From b2a3acea0d0f66028c9ce5fad02d4ecc64abf70c Mon Sep 17 00:00:00 2001 From: Israel Lavi Date: Tue, 7 Aug 2018 10:54:17 +0300 Subject: Initial commit. Adding files needed for Linux Foundation. Change-Id: I9f2b4851a5ae01f83800c7f8bab8608a2221c730 Issue-ID: SDC-1608 Signed-off-by: Israel Lavi --- .../ng2-component-lab/validation.component.exp.ts | 162 --------------------- 1 file changed, 162 deletions(-) delete mode 100644 stories/ng2-component-lab/validation.component.exp.ts (limited to 'stories/ng2-component-lab/validation.component.exp.ts') diff --git a/stories/ng2-component-lab/validation.component.exp.ts b/stories/ng2-component-lab/validation.component.exp.ts deleted file mode 100644 index 7f18c93..0000000 --- a/stories/ng2-component-lab/validation.component.exp.ts +++ /dev/null @@ -1,162 +0,0 @@ -import { experimentOn } from '@islavi/ng2-component-lab'; -import { RegexPatterns } from '../../src/angular/common/enums'; -import { DropDownOptionType, IDropDownOption } from './../../src/angular/form-elements/dropdown/dropdown-models'; - -const options1: IDropDownOption[] = [ - { - label: 'First Option', - value: 'First Option', - }, - { - label: 'Second Option', - value: 'Second Option', - }, - { - label: 'Third Option', - value: 'Third Option', - type: DropDownOptionType.Simple - } -]; - -export default experimentOn('Validation') - .group("Validation", [ - { - id: 'validation1', - showSource: true, - title: 'Simple validation', - description: 'Simple validation (validating that email is valid and that user inserted something in the field). \ - By default the validation starts after first key press', - context: { - emailPattern: RegexPatterns.email - }, - template: ` - - - - - - ` - }, - { - id: 'validation2', - showSource: true, - title: 'Simple validation', - description: 'Simple validation', - context: { - numbersPattern: RegexPatterns.numbers, - isValueHundred: (value: any) => { - return (Number(value) === 100) ? true : false; - } - }, - template: ` - - - - - - ` - }, - { - id: 'validation3', - showSource: true, - title: 'Disabled validation', - description: 'Disabled validation', - context: { - emailPattern: RegexPatterns.email - }, - template: ` - - - - - - ` - }, - { - id: 'validation4', - showSource: true, - title: 'Validation with value already entered', - description: 'Validation with value already entered', - context: { - emailPattern: RegexPatterns.email - }, - template: ` - - - - - - ` - }, - { - id: 'validation5', - showSource: true, - title: 'Validation with validity changed callback', - description: 'Simple validation with alert when validity changes', - context: { - numbersPattern: RegexPatterns.numbers, - validityChanged: (newState: boolean) => { - alert("Validity has changed to " + newState); - } - }, - template: ` - - - - - ` - }, - { - id: 'dropdownWithValidation', - showSource: true, - context: { - options: options1, - isThirdOption: (value: any) => { - return value === 'Third Option'; - } - }, - title: 'DropDown with validation', - description: 'DropDown with validation', - template: ` - - - - - - ` - }, - { - id: 'validationGroup', - showSource: true, - context: { - options: options1, - emailPattern: RegexPatterns.email, - isThirdOption: (value: any) => { - return value === 'Third Option'; - }, - validateGroup: (validationGroup) => { - validationGroup.validate(); - } - }, - title: 'Validation group', - description: 'Validation group (activating validation from code)', - template: ` - - - - - - - - - - - - - - - - - ` - } - ]); -- cgit 1.2.3-korg