-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from episerver/feature/AFORM-3564-add-textarea
Revamp validators type
- Loading branch information
Showing
24 changed files
with
127 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/@optimizely/forms-sdk/src/models/validators/AllowedExtensionsValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { InternalElementValidatorBase, ValidatorModelBase } from "./base"; | ||
|
||
export interface AllowedExtensionsValidator extends InternalElementValidatorBase{ | ||
model: AllowedExtensionsValidatorModel | ||
} | ||
|
||
export interface AllowedExtensionsValidatorModel extends ValidatorModelBase { | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
src/@optimizely/forms-sdk/src/models/validators/CaptchaValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { InternalElementValidatorBase } from "./base"; | ||
|
||
export interface CaptchaValidator extends InternalElementValidatorBase { | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
src/@optimizely/forms-sdk/src/models/validators/DateDDMMYYYYValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { RegularExpressionValidator } from "./RegularExpressionValidator"; | ||
|
||
export interface DateDDMMYYYYValidator extends RegularExpressionValidator { | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
src/@optimizely/forms-sdk/src/models/validators/DateMMDDYYYYValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { RegularExpressionValidator } from "./RegularExpressionValidator"; | ||
|
||
export interface DateMMDDYYYYValidator extends RegularExpressionValidator { | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
src/@optimizely/forms-sdk/src/models/validators/DateYYYYMMDDValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { RegularExpressionValidator } from "./RegularExpressionValidator"; | ||
|
||
export interface DateYYYYMMDDValidator extends RegularExpressionValidator { | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
src/@optimizely/forms-sdk/src/models/validators/EmailValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { RegularExpressionValidator } from "./RegularExpressionValidator"; | ||
|
||
export interface EmailValidator extends RegularExpressionValidator{ | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
src/@optimizely/forms-sdk/src/models/validators/IntegerValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { RegularExpressionValidator } from "./RegularExpressionValidator"; | ||
|
||
export interface IntegerValidator extends RegularExpressionValidator { | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
src/@optimizely/forms-sdk/src/models/validators/MaxFileSizeValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { InternalElementValidatorBase, ValidatorModelBase } from "./base"; | ||
|
||
export interface MaxFileSizeValidator extends InternalElementValidatorBase { | ||
model: MaxFileSizeValidationModel | ||
} | ||
|
||
export interface MaxFileSizeValidationModel extends ValidatorModelBase { | ||
sizeInBytes: number | ||
} |
5 changes: 5 additions & 0 deletions
5
src/@optimizely/forms-sdk/src/models/validators/NumericValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { ElementValidatorBase } from "./base"; | ||
|
||
export interface NumericValidator extends ElementValidatorBase { | ||
isValidNumber: boolean | ||
} |
5 changes: 5 additions & 0 deletions
5
src/@optimizely/forms-sdk/src/models/validators/PositiveIntegerValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { RegularExpressionValidatorBase } from "./base"; | ||
|
||
export interface PositiveIntegerValidator extends RegularExpressionValidatorBase { | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
src/@optimizely/forms-sdk/src/models/validators/RegularExpressionValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { RegularExpressionValidatorBase } from "./base"; | ||
|
||
export interface RegularExpressionValidator extends RegularExpressionValidatorBase{ | ||
} | ||
|
5 changes: 5 additions & 0 deletions
5
src/@optimizely/forms-sdk/src/models/validators/RequiredValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { ElementValidatorBase } from "./base"; | ||
|
||
export interface RequiredValidator extends ElementValidatorBase { | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
src/@optimizely/forms-sdk/src/models/validators/UrlValidator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { RegularExpressionValidatorBase } from "./base"; | ||
|
||
export interface UrlValidator extends RegularExpressionValidatorBase { | ||
|
||
} |
14 changes: 0 additions & 14 deletions
14
src/@optimizely/forms-sdk/src/models/validators/Validators.ts
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
src/@optimizely/forms-sdk/src/models/validators/base/ElementValidatorBase.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface ElementValidatorBase { | ||
validationOrder: number, | ||
description: string | ||
} |
5 changes: 5 additions & 0 deletions
5
src/@optimizely/forms-sdk/src/models/validators/base/InternalElementValidatorBase.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { ElementValidatorBase } from "./ElementValidatorBase"; | ||
|
||
export interface InternalElementValidatorBase extends ElementValidatorBase{ | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/@optimizely/forms-sdk/src/models/validators/base/RegularExpressionValidatorBase.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ElementValidatorBase } from "./ElementValidatorBase"; | ||
import { ValidatorModelBase } from "./ValidatorsBase"; | ||
|
||
export interface RegularExpressionValidatorBase extends ElementValidatorBase{ | ||
model: RegularExpressionValidatorModel | ||
} | ||
|
||
export interface RegularExpressionValidatorModel extends ValidatorModelBase { | ||
jsPattern: string, | ||
dotNetPattern: string | ||
} |
14 changes: 14 additions & 0 deletions
14
src/@optimizely/forms-sdk/src/models/validators/base/ValidatorsBase.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* Base class for validators | ||
*/ | ||
export interface ValidatorBase { | ||
type: string | ||
description: string | ||
model: ValidatorModelBase | ||
} | ||
|
||
export interface ValidatorModelBase { | ||
message: string | ||
validationCssClass: string | ||
additionalAttributes: any | ||
} |
4 changes: 4 additions & 0 deletions
4
src/@optimizely/forms-sdk/src/models/validators/base/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from "./ValidatorsBase"; | ||
export * from "./InternalElementValidatorBase"; | ||
export * from "./RegularExpressionValidatorBase"; | ||
export * from "./ElementValidatorBase"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
export * from "./Validators"; | ||
export * from "./models/EmailValidatorModel"; | ||
export * from "./models/RequiredValidatorModel"; | ||
export * from "./base" | ||
export * from "./AllowedExtensionsValidator"; | ||
export * from "./CaptchaValidator"; | ||
export * from "./DateDDMMYYYYValidator"; | ||
export * from "./DateMMDDYYYYValidator"; | ||
export * from "./DateYYYYMMDDValidator"; | ||
export * from "./EmailValidator"; | ||
export * from "./IntegerValidator"; | ||
export * from "./MaxFileSizeValidator"; | ||
export * from "./NumericValidator"; | ||
export * from "./PositiveIntegerValidator" | ||
export * from "./RegularExpressionValidator"; | ||
export * from "./RequiredValidator"; | ||
export * from "./UrlValidator"; |
11 changes: 0 additions & 11 deletions
11
src/@optimizely/forms-sdk/src/models/validators/models/EmailValidatorModel.ts
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
src/@optimizely/forms-sdk/src/models/validators/models/RequiredValidatorModel.ts
This file was deleted.
Oops, something went wrong.