From d666e8b8e556a41958eb0ed8645dd70b7302496b Mon Sep 17 00:00:00 2001 From: Tom Demulier Date: Wed, 1 Mar 2017 15:54:07 +0100 Subject: [PATCH] feat(alert): add attributes min & max to alert inputs --- src/components/alert/alert-component.ts | 4 +++- src/components/alert/alert-options.ts | 2 ++ src/components/alert/alert.ts | 2 ++ src/components/alert/test/basic/app.module.ts | 12 ++++++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/alert/alert-component.ts b/src/components/alert/alert-component.ts index 91991698530..8ac7a06b1ae 100644 --- a/src/components/alert/alert-component.ts +++ b/src/components/alert/alert-component.ts @@ -51,7 +51,7 @@ import { ViewController } from '../../navigation/view-controller'; '' + @@ -157,6 +157,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 }; }); diff --git a/src/components/alert/alert-options.ts b/src/components/alert/alert-options.ts index 5000a7edd64..c8a5546011d 100644 --- a/src/components/alert/alert-options.ts +++ b/src/components/alert/alert-options.ts @@ -19,4 +19,6 @@ export interface AlertInputOptions { checked?: boolean; disabled?: boolean; id?: string; + min?: string; + max?: string; } diff --git a/src/components/alert/alert.ts b/src/components/alert/alert.ts index 7fa69656a3b..758eb4ef3b4 100644 --- a/src/components/alert/alert.ts +++ b/src/components/alert/alert.ts @@ -244,6 +244,8 @@ 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` | The input's minimum authorized value (only for date inputs) | + * | max | `string` | The input's maximum authorized value (only for date inputs) | * * Button options * diff --git a/src/components/alert/test/basic/app.module.ts b/src/components/alert/test/basic/app.module.ts index fd0a8d8cf7c..b6d534c3558 100644 --- a/src/components/alert/test/basic/app.module.ts +++ b/src/components/alert/test/basic/app.module.ts @@ -109,6 +109,18 @@ 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.addButton({ text: 'Cancel', handler: (data: any) => {