mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Merge branch '10590-alert-input-min-max-attributes' of https://github.com/TomDemulierChevret/ionic
# Conflicts: # src/components/alert/alert-component.ts # src/components/alert/alert-options.ts
This commit is contained in:
@@ -52,7 +52,7 @@ import { AlertInputOptions, AlertOptions, AlertButton } from './alert-options';
|
||||
'<template ngSwitchDefault>' +
|
||||
'<div class="alert-input-group">' +
|
||||
'<div *ngFor="let i of d.inputs" class="alert-input-wrapper">' +
|
||||
'<input [placeholder]="i.placeholder" [(ngModel)]="i.value" [type]="i.type" [attr.id]="i.id" class="alert-input">' +
|
||||
'<input [placeholder]="i.placeholder" [(ngModel)]="i.value" [type]="i.type" [min]="i.min" [max]="i.max" [attr.id]="i.id" class="alert-input">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</template>' +
|
||||
@@ -149,6 +149,8 @@ export class AlertCmp {
|
||||
disabled: !!input.disabled,
|
||||
id: isPresent(input.id) ? input.id : `alert-input-${this.id}-${index}`,
|
||||
handler: isPresent(input.handler) ? input.handler : null,
|
||||
min: isPresent(input.min) ? input.min : null,
|
||||
max: isPresent(input.max) ? input.max : null
|
||||
};
|
||||
return r;
|
||||
});
|
||||
|
||||
@@ -20,6 +20,8 @@ export interface AlertInputOptions {
|
||||
disabled?: boolean;
|
||||
id?: string;
|
||||
handler?: Function;
|
||||
min?: string | number;
|
||||
max?: string | number;
|
||||
}
|
||||
|
||||
export interface AlertButton {
|
||||
|
||||
@@ -250,6 +250,12 @@ export class Alert extends ViewController {
|
||||
* | label | `string` | The input's label (only for radio/checkbox inputs) |
|
||||
* | checked | `boolean` | Whether or not the input is checked. |
|
||||
* | id | `string` | The input's id. |
|
||||
* | min | `string | number` | The input's minimum authorized value (string only for date inputs, number
|
||||
* only for number inputs)
|
||||
* |
|
||||
* | max | `string | number` | The input's maximum authorized value (string only for date inputs, number
|
||||
* only for number inputs)
|
||||
* |
|
||||
*
|
||||
* Button options
|
||||
*
|
||||
|
||||
@@ -108,6 +108,28 @@ export class E2EPage {
|
||||
type: 'url',
|
||||
placeholder: 'Favorite site ever'
|
||||
});
|
||||
// input date with min & max
|
||||
alert.addInput({
|
||||
name: 'name4',
|
||||
type: 'date',
|
||||
min: '2017-03-01',
|
||||
max: '2018-01-12'
|
||||
});
|
||||
// input date without min nor max
|
||||
alert.addInput({
|
||||
name: 'name5',
|
||||
type: 'date'
|
||||
});
|
||||
alert.addInput({
|
||||
name: 'name6',
|
||||
type: 'number',
|
||||
min: -5,
|
||||
max: 10
|
||||
});
|
||||
alert.addInput({
|
||||
name: 'name7',
|
||||
type: 'number'
|
||||
});
|
||||
alert.addButton({
|
||||
text: 'Cancel',
|
||||
handler: (data: any) => {
|
||||
|
||||
Reference in New Issue
Block a user