@theseam/ui-common 1.0.2-beta.39 → 1.0.2-beta.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,21 @@
1
+ import { isEmptyInputValue, isNumeric } from '@theseam/ui-common/utils';
1
2
  import { isObservable } from 'rxjs';
2
3
  import { map } from 'rxjs/operators';
3
4
  import { Validators } from '@angular/forms';
4
- import { isEmptyInputValue, isNumeric } from '@theseam/ui-common/utils';
5
5
 
6
+ const TAX_ID_PATTERN = /^\d{9}$|^\d{2}-\d{7}$|^\d{3}-\d{2}-\d{4}$/;
6
7
  /**
7
- * Validates that value matches on of the following:
8
- * '' // empty string
8
+ * Validates that value matches one of the following:
9
9
  * 'xxxxxxxxx' // 'x' is a number
10
10
  * 'xx-xxxxxxx' // 'x' is a number
11
11
  * 'xxx-xx-xxxx' // 'x' is a number
12
12
  */
13
- function taxIdValidator(control) {
14
- const isValid = /^$|^\d{9}$|^\d{2}-\d{7}$|^\d{3}-\d{2}-\d{4}$/.test(control.value);
15
- return isValid ? null : { taxId: {} };
16
- }
13
+ const taxIdValidator = (control) => {
14
+ if (isEmptyInputValue(control.value)) {
15
+ return null;
16
+ }
17
+ return TAX_ID_PATTERN.test(control.value) ? null : { taxId: {} };
18
+ };
17
19
 
18
20
  /**
19
21
  * Validates that an email already exists.
@@ -31,61 +33,77 @@ function emailExistsValidator(emailExists) {
31
33
  };
32
34
  }
33
35
 
36
+ const DEFAULT_CONFIG$2 = {
37
+ minLength: 7,
38
+ maxLength: 18,
39
+ };
34
40
  /**
35
41
  * Validates that a value is a valid phone number length.
36
42
  */
37
- function phoneLengthValidator(control) {
38
- return control.value.length === 0 ||
39
- (control.value.length <= 18 && control.value.length >= 7)
40
- ? null
41
- : { phoneLength: {} };
43
+ function phoneLengthValidator(config) {
44
+ const c = { ...DEFAULT_CONFIG$2, ...config };
45
+ return (control) => {
46
+ if (isEmptyInputValue(control.value)) {
47
+ return null;
48
+ }
49
+ return control.value.length <= c.maxLength &&
50
+ control.value.length >= c.minLength
51
+ ? null
52
+ : { phoneLength: {} };
53
+ };
42
54
  }
43
55
 
44
56
  const DECIMAL_REGEX = /^([-+]{1})?\d*(\.\d*)?$/;
45
- function _decimalValidator() {
57
+ const DEFAULT_CONFIG$1 = {
58
+ regex: DECIMAL_REGEX,
59
+ };
60
+ /**
61
+ * Validates control value is a valid decimal number.
62
+ *
63
+ * NOTE: This does not allow any js valid decimal number. It only accepts them
64
+ * in a format expected by our backend.
65
+ */
66
+ function decimalValidator(config) {
67
+ const c = { ...DEFAULT_CONFIG$1, ...config };
46
68
  return (control) => {
47
69
  if (isEmptyInputValue(control.value)) {
48
70
  return null; // don't validate empty values to allow optional controls
49
71
  }
50
72
  const isDecimal = !Array.isArray(control.value) &&
51
73
  isNumeric(control.value) &&
52
- Validators.pattern(DECIMAL_REGEX)(control) === null;
74
+ Validators.pattern(c.regex)(control) === null;
53
75
  if (!isDecimal) {
54
76
  return { decimal: { reason: 'Must be valid decimal number.' } };
55
77
  }
56
78
  return null;
57
79
  };
58
80
  }
81
+
82
+ const INTEGER_REGEX = /^([-+]{1})?[0-9]*$/;
83
+ const DEFAULT_CONFIG = {
84
+ regex: INTEGER_REGEX,
85
+ };
59
86
  /**
60
- * Validates control value is a valid decimal number.
87
+ * Validates control value is a valid integer number.
61
88
  *
62
- * NOTE: This does not allow any js valid decimal number. It only accepts them
89
+ * NOTE: This does not allow any js valid integer number. It only accepts them
63
90
  * in a format expected by our backend.
64
91
  */
65
- const decimalValidator = _decimalValidator();
66
-
67
- const INTEGER_REGEX = /^([-+]{1})?[0-9]*$/;
68
- function _integerValidator() {
92
+ function integerValidator(config) {
93
+ const c = { ...DEFAULT_CONFIG, ...config };
69
94
  return (control) => {
70
95
  if (isEmptyInputValue(control.value)) {
71
96
  return null; // don't validate empty values to allow optional controls
72
97
  }
73
98
  const isInteger = !Array.isArray(control.value) &&
74
99
  isNumeric(control.value) &&
75
- Validators.pattern(INTEGER_REGEX)(control) === null;
100
+ Validators.pattern(c.regex)(control) === null;
76
101
  if (!isInteger) {
77
102
  return { integer: { reason: 'Must be valid integer.' } };
78
103
  }
79
104
  return null;
80
105
  };
81
106
  }
82
- /**
83
- * Validates control value is a valid integer number.
84
- *
85
- * NOTE: This does not allow any js valid integer number. It only accepts them
86
- * in a format expected by our backend.
87
- */
88
- const integerValidator = _integerValidator();
89
107
 
90
108
  /**
91
109
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"theseam-ui-common-validators.mjs","sources":["../../../projects/ui-common/validators/tax-id.validator.ts","../../../projects/ui-common/validators/email-exists.validator.ts","../../../projects/ui-common/validators/phone-length.validator.ts","../../../projects/ui-common/validators/decimal.validator.ts","../../../projects/ui-common/validators/integer.validator.ts","../../../projects/ui-common/validators/theseam-ui-common-validators.ts"],"sourcesContent":["import { FormControl } from '@angular/forms'\n\n/**\n * Validates that value matches on of the following:\n * '' // empty string\n * 'xxxxxxxxx' // 'x' is a number\n * 'xx-xxxxxxx' // 'x' is a number\n * 'xxx-xx-xxxx' // 'x' is a number\n */\nexport function taxIdValidator(control: FormControl) {\n const isValid = /^$|^\\d{9}$|^\\d{2}-\\d{7}$|^\\d{3}-\\d{2}-\\d{4}$/.test(\n control.value,\n )\n return isValid ? null : { taxId: {} }\n}\n","import { FormControl } from '@angular/forms'\nimport { isObservable, Observable } from 'rxjs'\nimport { map } from 'rxjs/operators'\n\n/**\n * Validates that an email already exists.\n */\nexport function emailExistsValidator(\n emailExists: (\n email: string,\n ) => Promise<boolean> | Observable<boolean> | boolean,\n) {\n return (control: FormControl) => {\n const validationResult = (exists: boolean) => {\n return exists === false ? null : { emailExists: {} }\n }\n\n const fnRes = emailExists(control.value)\n if (isObservable(fnRes)) {\n return fnRes.pipe(map(validationResult))\n }\n return Promise.resolve(fnRes).then(validationResult)\n }\n}\n","import { FormControl } from '@angular/forms'\n\n/**\n * Validates that a value is a valid phone number length.\n */\nexport function phoneLengthValidator(control: FormControl) {\n return control.value.length === 0 ||\n (control.value.length <= 18 && control.value.length >= 7)\n ? null\n : { phoneLength: {} }\n}\n","import { AbstractControl, ValidatorFn, Validators } from '@angular/forms'\n\nimport { isEmptyInputValue, isNumeric } from '@theseam/ui-common/utils'\n\nexport const DECIMAL_REGEX = /^([-+]{1})?\\d*(\\.\\d*)?$/\n\nfunction _decimalValidator(): ValidatorFn {\n return (control: AbstractControl) => {\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const isDecimal =\n !Array.isArray(control.value) &&\n isNumeric(control.value) &&\n Validators.pattern(DECIMAL_REGEX)(control) === null\n\n if (!isDecimal) {\n return { decimal: { reason: 'Must be valid decimal number.' } }\n }\n\n return null\n }\n}\n\n/**\n * Validates control value is a valid decimal number.\n *\n * NOTE: This does not allow any js valid decimal number. It only accepts them\n * in a format expected by our backend.\n */\nexport const decimalValidator: ValidatorFn = _decimalValidator()\n","import { AbstractControl, ValidatorFn, Validators } from '@angular/forms'\n\nimport { isEmptyInputValue, isNumeric } from '@theseam/ui-common/utils'\n\nexport const INTEGER_REGEX = /^([-+]{1})?[0-9]*$/\n\nfunction _integerValidator(): ValidatorFn {\n return (control: AbstractControl) => {\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const isInteger =\n !Array.isArray(control.value) &&\n isNumeric(control.value) &&\n Validators.pattern(INTEGER_REGEX)(control) === null\n\n if (!isInteger) {\n return { integer: { reason: 'Must be valid integer.' } }\n }\n return null\n }\n}\n\n/**\n * Validates control value is a valid integer number.\n *\n * NOTE: This does not allow any js valid integer number. It only accepts them\n * in a format expected by our backend.\n */\nexport const integerValidator: ValidatorFn = _integerValidator()\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAEA;;;;;;AAMG;AACG,SAAU,cAAc,CAAC,OAAoB,EAAA;IACjD,MAAM,OAAO,GAAG,8CAA8C,CAAC,IAAI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O,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI;QAErD,IAAI,CAAC,SAAS,EAAE;YACd,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,+BAA+B,EAAE,EAAE;QACjE;AAEA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;AAEA;;;;;AAKG;AACI,MAAM,gBAAgB,GAAgB,iBAAiB;;AC3BvD,MAAM,aAAa,GAAG;AAE7B,SAAS,iBAAiB,GAAA;IACxB,OAAO,CAAC,OAAwB,KAAI;AAClC,QAAA,IAAI,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACpC,OAAO,IAAI,CAAA;QACb;QAEA,MAAM,SAAS,GACb,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;AAC7B,YAAA,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;YACxB,UAAU,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI;QAErD,IAAI,CAAC,SAAS,EAAE;YACd,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,wBAAwB,EAAE,EAAE;QAC1D;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;AAEA;;;;;AAKG;AACI,MAAM,gBAAgB,GAAgB,iBAAiB;;AC9B9D;;AAEG;;;;"}
1
+ {"version":3,"file":"theseam-ui-common-validators.mjs","sources":["../../../projects/ui-common/validators/tax-id.validator.ts","../../../projects/ui-common/validators/email-exists.validator.ts","../../../projects/ui-common/validators/phone-length.validator.ts","../../../projects/ui-common/validators/decimal.validator.ts","../../../projects/ui-common/validators/integer.validator.ts","../../../projects/ui-common/validators/theseam-ui-common-validators.ts"],"sourcesContent":["import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport { isEmptyInputValue } from '@theseam/ui-common/utils'\n\nconst TAX_ID_PATTERN = /^\\d{9}$|^\\d{2}-\\d{7}$|^\\d{3}-\\d{2}-\\d{4}$/\n\n/**\n * Validates that value matches one of the following:\n * 'xxxxxxxxx' // 'x' is a number\n * 'xx-xxxxxxx' // 'x' is a number\n * 'xxx-xx-xxxx' // 'x' is a number\n */\nexport const taxIdValidator: ValidatorFn = (control: AbstractControl) => {\n if (isEmptyInputValue(control.value)) {\n return null\n }\n return TAX_ID_PATTERN.test(control.value) ? null : { taxId: {} }\n}\n","import { FormControl } from '@angular/forms'\nimport { isObservable, Observable } from 'rxjs'\nimport { map } from 'rxjs/operators'\n\n/**\n * Validates that an email already exists.\n */\nexport function emailExistsValidator(\n emailExists: (\n email: string,\n ) => Promise<boolean> | Observable<boolean> | boolean,\n) {\n return (control: FormControl) => {\n const validationResult = (exists: boolean) => {\n return exists === false ? null : { emailExists: {} }\n }\n\n const fnRes = emailExists(control.value)\n if (isObservable(fnRes)) {\n return fnRes.pipe(map(validationResult))\n }\n return Promise.resolve(fnRes).then(validationResult)\n }\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms'\n\nimport { isEmptyInputValue } from '@theseam/ui-common/utils'\n\nexport interface TheSeamPhoneLengthConfig {\n minLength: number\n maxLength: number\n}\n\nconst DEFAULT_CONFIG: TheSeamPhoneLengthConfig = {\n minLength: 7,\n maxLength: 18,\n}\n\n/**\n * Validates that a value is a valid phone number length.\n */\nexport function phoneLengthValidator(\n config?: Partial<TheSeamPhoneLengthConfig>,\n): ValidatorFn {\n const c = { ...DEFAULT_CONFIG, ...config }\n return (control: AbstractControl) => {\n if (isEmptyInputValue(control.value)) {\n return null\n }\n return control.value.length <= c.maxLength &&\n control.value.length >= c.minLength\n ? null\n : { phoneLength: {} }\n }\n}\n","import { AbstractControl, ValidatorFn, Validators } from '@angular/forms'\n\nimport { isEmptyInputValue, isNumeric } from '@theseam/ui-common/utils'\n\nexport const DECIMAL_REGEX = /^([-+]{1})?\\d*(\\.\\d*)?$/\n\nexport interface TheSeamDecimalConfig {\n regex: RegExp\n}\n\nconst DEFAULT_CONFIG: TheSeamDecimalConfig = {\n regex: DECIMAL_REGEX,\n}\n\n/**\n * Validates control value is a valid decimal number.\n *\n * NOTE: This does not allow any js valid decimal number. It only accepts them\n * in a format expected by our backend.\n */\nexport function decimalValidator(\n config?: Partial<TheSeamDecimalConfig>,\n): ValidatorFn {\n const c = { ...DEFAULT_CONFIG, ...config }\n return (control: AbstractControl) => {\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const isDecimal =\n !Array.isArray(control.value) &&\n isNumeric(control.value) &&\n Validators.pattern(c.regex)(control) === null\n\n if (!isDecimal) {\n return { decimal: { reason: 'Must be valid decimal number.' } }\n }\n\n return null\n }\n}\n","import { AbstractControl, ValidatorFn, Validators } from '@angular/forms'\n\nimport { isEmptyInputValue, isNumeric } from '@theseam/ui-common/utils'\n\nexport const INTEGER_REGEX = /^([-+]{1})?[0-9]*$/\n\nexport interface TheSeamIntegerConfig {\n regex: RegExp\n}\n\nconst DEFAULT_CONFIG: TheSeamIntegerConfig = {\n regex: INTEGER_REGEX,\n}\n\n/**\n * Validates control value is a valid integer number.\n *\n * NOTE: This does not allow any js valid integer number. It only accepts them\n * in a format expected by our backend.\n */\nexport function integerValidator(\n config?: Partial<TheSeamIntegerConfig>,\n): ValidatorFn {\n const c = { ...DEFAULT_CONFIG, ...config }\n return (control: AbstractControl) => {\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const isInteger =\n !Array.isArray(control.value) &&\n isNumeric(control.value) &&\n Validators.pattern(c.regex)(control) === null\n\n if (!isInteger) {\n return { integer: { reason: 'Must be valid integer.' } }\n }\n return null\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DEFAULT_CONFIG"],"mappings":";;;;;AAIA,MAAM,cAAc,GAAG,2CAA2C;AAElE;;;;;AAKG;AACI,MAAM,cAAc,GAAgB,CAAC,OAAwB,KAAI;AACtE,IAAA,IAAI,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAA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C,KAAK,IAAI;QAE/C,IAAI,CAAC,SAAS,EAAE;YACd,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,wBAAwB,EAAE,EAAE;QAC1D;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACvCA;;AAEG;;;;"}
@@ -1,8 +1,9 @@
1
+ import { ValidatorFn, AsyncValidatorFn, FormControl, FormGroup, AbstractControl } from '@angular/forms';
1
2
  import * as i0 from '@angular/core';
2
- import { ElementRef, TemplateRef, OnInit, InjectionToken, OnDestroy, EventEmitter, ComponentRef, EmbeddedViewRef, AfterViewInit, QueryList, ViewContainerRef, AfterContentInit } from '@angular/core';
3
- import { HasElementRef, CanDisableCtor } from '@theseam/ui-common/core';
3
+ import { DestroyRef, ElementRef, TemplateRef, OnInit, InjectionToken, OnDestroy, EventEmitter, ComponentRef, EmbeddedViewRef, AfterViewInit, QueryList, ViewContainerRef, AfterContentInit } from '@angular/core';
4
4
  import * as rxjs from 'rxjs';
5
- import { Observable, Subject, BehaviorSubject } from 'rxjs';
5
+ import { Observable, Subscription, Subject, BehaviorSubject } from 'rxjs';
6
+ import { HasElementRef, CanDisableCtor } from '@theseam/ui-common/core';
6
7
  import * as _fortawesome_fontawesome_common_types from '@fortawesome/fontawesome-common-types';
7
8
  import { TemplatePortal, ComponentType, ComponentPortal, BasePortalOutlet, Portal, CdkPortalOutletAttachedRef } from '@angular/cdk/portal';
8
9
  import { MediaQueryAliases, TheSeamLayoutService } from '@theseam/ui-common/layout';
@@ -18,9 +19,188 @@ import * as _angular_animations from '@angular/animations';
18
19
  import * as i2 from '@angular/common';
19
20
  import * as i2$1 from '@ajsf/core';
20
21
  import { JsonSchemaFormService, isArray, TitleMapItem, Framework } from '@ajsf/core';
21
- import { AbstractControl } from '@angular/forms';
22
22
  import { TheSeamTiledSelectItem, TheSeamTiledSelectLayout } from '@theseam/ui-common/tiled-select';
23
23
 
24
+ interface TheSeamControlValidators {
25
+ validators: ValidatorFn[];
26
+ asyncValidators: AsyncValidatorFn[];
27
+ }
28
+
29
+ interface TheSeamValidatorOverrides {
30
+ /**
31
+ * Include `Validators.required`. Set to `false` to exclude it.
32
+ *
33
+ * default: true
34
+ */
35
+ required?: boolean;
36
+ }
37
+
38
+ interface TheSeamAddressFieldConfig {
39
+ address1MaxLength: number;
40
+ address2MaxLength: number;
41
+ cityMaxLength: number;
42
+ stateMaxLength: number;
43
+ countryMaxLength: number;
44
+ zipcodePattern: RegExp;
45
+ }
46
+ declare const DEFAULT_ADDRESS_FIELD_CONFIG: TheSeamAddressFieldConfig;
47
+
48
+ interface TheSeamUsernameFieldConfig {
49
+ minLength: number;
50
+ pattern: RegExp;
51
+ }
52
+ declare const DEFAULT_USERNAME_FIELD_CONFIG: TheSeamUsernameFieldConfig;
53
+
54
+ interface TheSeamCreateCountryControlOptions {
55
+ /**
56
+ * Only allow 'USA' as the value.
57
+ *
58
+ * default: false
59
+ */
60
+ onlyAllowUsa?: boolean;
61
+ }
62
+
63
+ interface TheSeamAddressFormValue {
64
+ address1: string | null;
65
+ address2: string | null;
66
+ city: string | null;
67
+ state: string | null;
68
+ zip: string | null;
69
+ country: string | null;
70
+ }
71
+
72
+ interface TheSeamAddressFormGroupOptions {
73
+ config?: Partial<TheSeamAddressFieldConfig>;
74
+ stateCodes: Observable<string[]>;
75
+ /** default: true */
76
+ countryRequiredOutsideUSA?: boolean;
77
+ /** default: 'USA' */
78
+ defaultCountry?: string;
79
+ /** If provided, country-change subscription is auto-cleaned up. */
80
+ destroyRef?: DestroyRef;
81
+ }
82
+ type TheSeamAddressFormControls = Record<keyof TheSeamAddressFormValue, FormControl<string | null>>;
83
+ type TheSeamAddressFormGroupResult<T extends TheSeamAddressFormGroupOptions> = T extends {
84
+ destroyRef: DestroyRef;
85
+ } ? FormGroup<TheSeamAddressFormControls> : {
86
+ group: FormGroup<TheSeamAddressFormControls>;
87
+ subscription: Subscription;
88
+ };
89
+
90
+ interface TheSeamPasswordFieldConfig {
91
+ minLength: number;
92
+ }
93
+ declare const DEFAULT_PASSWORD_FIELD_CONFIG: TheSeamPasswordFieldConfig;
94
+
95
+ interface TheSeamPasswordFormValue {
96
+ password1: string | null;
97
+ password2: string | null;
98
+ }
99
+
100
+ declare function isCountryUSA(control: AbstractControl): boolean;
101
+
102
+ /**
103
+ * Use Validator if 'country' control value is 'USA'.
104
+ *
105
+ * If `countryControlOrPath` is not provided, it will be assumed there is a
106
+ * sibling named 'country'.
107
+ */
108
+ declare function ifUSA(fn: ValidatorFn, countryControlOrPath?: AbstractControl | string | (string | number)[]): ValidatorFn;
109
+
110
+ declare function stateProvinceRegionValidator(stateCodes: Observable<string[]>): AsyncValidatorFn;
111
+
112
+ type TheSeamUserExistsFn = (userName: string) => Promise<boolean> | Observable<boolean> | boolean;
113
+ /**
114
+ * Validates that a username already exists.
115
+ *
116
+ * Mirrors the `emailExistsValidator` pattern from `@theseam/ui-common/validators`.
117
+ */
118
+ declare function usernameExistsValidator(userExists: TheSeamUserExistsFn): AsyncValidatorFn;
119
+
120
+ /**
121
+ * Rejects passwords that contain the word "password" (case-insensitive).
122
+ */
123
+ declare function passwordContentValidator(control: AbstractControl): {
124
+ passwordContent: {
125
+ value: string;
126
+ };
127
+ } | null;
128
+
129
+ /**
130
+ * Requires at least one lowercase letter.
131
+ */
132
+ declare function passwordLowercaseValidator(control: AbstractControl): {
133
+ passwordLowercase: {};
134
+ } | null;
135
+
136
+ /**
137
+ * Requires at least one uppercase letter.
138
+ */
139
+ declare function passwordUppercaseValidator(control: AbstractControl): {
140
+ passwordUppercase: {};
141
+ } | null;
142
+
143
+ /**
144
+ * Requires at least one digit.
145
+ */
146
+ declare function passwordNumberValidator(control: AbstractControl): {
147
+ passwordNumber: {};
148
+ } | null;
149
+
150
+ /**
151
+ * Requires at least one special character.
152
+ */
153
+ declare function passwordSpecialCharValidator(control: AbstractControl): {
154
+ passwordSpecialChar: {};
155
+ } | null;
156
+
157
+ /**
158
+ * Requires password to meet a minimum length.
159
+ */
160
+ declare function passwordLengthValidator(config?: Partial<TheSeamPasswordFieldConfig>): ValidatorFn;
161
+
162
+ /**
163
+ * Group-level validator that checks password1 and password2 controls match.
164
+ */
165
+ declare function passwordMatchValidator(g: AbstractControl): {
166
+ passwordMatch: boolean;
167
+ } | null;
168
+
169
+ declare function getAddress1Validators(config?: Partial<TheSeamAddressFieldConfig>, overrides?: TheSeamValidatorOverrides): TheSeamControlValidators;
170
+
171
+ declare function getAddress2Validators(config?: Partial<TheSeamAddressFieldConfig>, overrides?: TheSeamValidatorOverrides): TheSeamControlValidators;
172
+
173
+ declare function getCityValidators(config?: Partial<TheSeamAddressFieldConfig>, overrides?: TheSeamValidatorOverrides): TheSeamControlValidators;
174
+
175
+ declare function getCountryValidators(config?: Partial<TheSeamAddressFieldConfig>, options?: TheSeamCreateCountryControlOptions, overrides?: TheSeamValidatorOverrides): TheSeamControlValidators;
176
+
177
+ declare function getStateValidators(stateCodes: Observable<string[]>, countryControlOrPath?: AbstractControl | string | (string | number)[], requiredOutsideUSA?: boolean, config?: Partial<TheSeamAddressFieldConfig>): TheSeamControlValidators;
178
+
179
+ declare function getZipValidators(countryControlOrPath?: AbstractControl | string | (string | number)[], config?: Partial<TheSeamAddressFieldConfig>): TheSeamControlValidators;
180
+
181
+ declare function getUsernameValidators(userExists: TheSeamUserExistsFn, config?: Partial<TheSeamUsernameFieldConfig>, overrides?: TheSeamValidatorOverrides): TheSeamControlValidators;
182
+
183
+ declare function getPasswordValidators(config?: Partial<TheSeamPasswordFieldConfig>, overrides?: TheSeamValidatorOverrides): TheSeamControlValidators;
184
+
185
+ declare function createAddress1Control(formState?: string | null, config?: Partial<TheSeamAddressFieldConfig>, overrides?: TheSeamValidatorOverrides): FormControl<string | null>;
186
+
187
+ declare function createAddress2Control(formState?: string | null, config?: Partial<TheSeamAddressFieldConfig>, overrides?: TheSeamValidatorOverrides): FormControl<string | null>;
188
+
189
+ declare function createCityControl(formState?: string | null, config?: Partial<TheSeamAddressFieldConfig>, overrides?: TheSeamValidatorOverrides): FormControl<string | null>;
190
+
191
+ declare function createCountryControl(formState?: string | null, options?: TheSeamCreateCountryControlOptions, overrides?: TheSeamValidatorOverrides): FormControl<string | null>;
192
+
193
+ declare function createStateControl(formState: string | null | undefined, stateCodes: Observable<string[]>, requiredOutsideUSA?: boolean): FormControl<string | null>;
194
+
195
+ declare function createZipControl(formState?: string | null): FormControl<string | null>;
196
+
197
+ declare function createUsernameControl(formState: string | null | undefined, userExists: TheSeamUserExistsFn, config?: Partial<TheSeamUsernameFieldConfig>, overrides?: TheSeamValidatorOverrides): FormControl<string | null>;
198
+
199
+ declare function createAddressFormGroup<T extends TheSeamAddressFormGroupOptions>(options: T): TheSeamAddressFormGroupResult<T>;
200
+
201
+ type TheSeamPasswordFormControls = Record<keyof TheSeamPasswordFormValue, FormControl<string | null>>;
202
+ declare function createPasswordFormGroup(config?: Partial<TheSeamPasswordFieldConfig>): FormGroup<TheSeamPasswordFormControls>;
203
+
24
204
  declare class BaseLayoutContentFooterDirective implements HasElementRef {
25
205
  readonly _elementRef: ElementRef<any>;
26
206
  static ɵfac: i0.ɵɵFactoryDeclaration<BaseLayoutContentFooterDirective, never>;
@@ -1454,5 +1634,5 @@ declare class SeamRouteShellComponent {
1454
1634
  static ɵcmp: i0.ɵɵComponentDeclaration<SeamRouteShellComponent, "seam-route-shell", never, {}, {}, never, never, true, never>;
1455
1635
  }
1456
1636
 
1457
- export { BaseLayoutContentDirective, BaseLayoutContentFooterDirective, BaseLayoutContentHeaderDirective, BaseLayoutSideBarDirective, BaseLayoutSideBarFooterDirective, BaseLayoutSideBarHeaderDirective, BaseLayoutTopBarDirective, DEFAULT_SIDE_NAV_CONFIG, DashboardComponent, DashboardWidgetContainerComponent, DashboardWidgetPortalOutletDirective, DashboardWidgetTemplateContainerComponent, DashboardWidgetsComponent, DashboardWidgetsPreferencesService, DashboardWidgetsService, HierarchyLevelResolver, HierarchyRouterOutletComponent, HorizontalNavComponent, NavItemComponent, SeamRouteShellComponent, SideNavComponent, SideNavItemComponent, SideNavToggleComponent, THESEAM_BASE_LAYOUT_REF, THESEAM_DASHBOARD_WIDGETS_PREFERENCES_ACCESSOR, THESEAM_SCHEMA_FRAMEWORK_OVERRIDES, THESEAM_SIDE_NAV_ACCESSOR, THESEAM_SIDE_NAV_CONFIG, THE_SEAM_BASE_LAYOUT, TheSeamBaseLayoutComponent, TheSeamBaseLayoutModule, TheSeamBaseLayoutNavToggleDirective, TheSeamDashboardModule, TheSeamDynamicRouterModule, TheSeamFramework, TheSeamNavModule, TheSeamSchemaFormFrameworkComponent, TheSeamSchemaFormModule, TheSeamSideNavModule, TheSeamTopBarComponent, TheSeamTopBarModule, TopBarCompactMenuBtnDetailDirective, TopBarItemDirective, TopBarMenuBtnDetailDirective, TopBarMenuButtonComponent, TopBarMenuDirective, TopBarNavToggleBtnDetailDirective, TopBarTitleComponent, applyItemConfig, areSameHorizontalNavItem, canBeActive, canExpand, canHaveChildren, computeDirection, extendFramework, fader, findHorizontalNavLinkItems, findLinkItems, getHorizontalNavItemStateProp, getItemStateProp, getUrlSegments, hasActiveChild, hasChildren, hasExpandedChild, horizontalNavItemCanBeActive, horizontalNavItemCanExpand, horizontalNavItemCanHaveChildren, horizontalNavItemHasActiveChild, horizontalNavItemHasChildren, horizontalNavItemHasExpandedChild, isExpanded, isHorizontalNavItemActive, isHorizontalNavItemExpanded, isHorizontalNavItemFocused, isHorizontalNavItemType, isNavItemActive, isNavItemType, routeChanges, seamRouteTransition, setDefaultHorizontalNavItemState, setDefaultState, setHorizontalNavItemStateProp, setItemStateProp, sideNavExpandStateChangeFn, sideToSide, slider, stepper, transformer };
1458
- export type { IDashboardWidgetItemLayout, IDashboardWidgetItemLayoutPreference, IDashboardWidgetsColumnRecord, IDashboardWidgetsItem, IDashboardWidgetsItemDef, IDashboardWidgetsItemSerialized, IDashboardWidgetsPreferences, IDashboardWidgetsPreferencesMapRecord, IDynamicRouteDef, INavBadge, INavBasic, INavButton, INavDivider, INavItem, INavItemBase, INavItemState, INavLink, INavTitle, ISideNavBadge, ISideNavBasic, ISideNavButton, ISideNavDivider, ISideNavItem, ISideNavItemBase, ISideNavItemState, ISideNavLink, ISideNavTitle, ITheSeamDashboardWidgetsPreferencesAccessor, NavItemBadgeTooltip, NavItemCanHaveChildren, NavItemCanHaveState, NavItemChildAction, NavItemExpandAction, NavItemExpandedEvent, NavItemStateChanged, RouteDirection, SideNavAccessor, SideNavConfig, SideNavItemBadgeTooltip, SideNavItemCanBeActive, SideNavItemCanHaveChildren, SideNavItemCanHaveState, SideNavItemMenuItemTooltipBehavior, SideNavItemMenuItemTooltipConfig, SideNavItemStateChanged, TheSeamBaseLayoutAction, TheSeamBaseLayoutActionBase, TheSeamBaseLayoutActionButton, TheSeamBaseLayoutActionHref, TheSeamBaseLayoutActionRouterLink, TheSeamBaseLayoutActionTemplate, TheSeamBaseLayoutNav, TheSeamBaseLayoutRef, TheSeamSchemaFormControlWidget, TheSeamSchemaFormFrameworkOverrides, TheSeamSchemaFormWidget, TheSeamSchemaFormWidgetLayoutNodeOptions, TopBarPosition };
1637
+ export { BaseLayoutContentDirective, BaseLayoutContentFooterDirective, BaseLayoutContentHeaderDirective, BaseLayoutSideBarDirective, BaseLayoutSideBarFooterDirective, BaseLayoutSideBarHeaderDirective, BaseLayoutTopBarDirective, DEFAULT_ADDRESS_FIELD_CONFIG, DEFAULT_PASSWORD_FIELD_CONFIG, DEFAULT_SIDE_NAV_CONFIG, DEFAULT_USERNAME_FIELD_CONFIG, DashboardComponent, DashboardWidgetContainerComponent, DashboardWidgetPortalOutletDirective, DashboardWidgetTemplateContainerComponent, DashboardWidgetsComponent, DashboardWidgetsPreferencesService, DashboardWidgetsService, HierarchyLevelResolver, HierarchyRouterOutletComponent, HorizontalNavComponent, NavItemComponent, SeamRouteShellComponent, SideNavComponent, SideNavItemComponent, SideNavToggleComponent, THESEAM_BASE_LAYOUT_REF, THESEAM_DASHBOARD_WIDGETS_PREFERENCES_ACCESSOR, THESEAM_SCHEMA_FRAMEWORK_OVERRIDES, THESEAM_SIDE_NAV_ACCESSOR, THESEAM_SIDE_NAV_CONFIG, THE_SEAM_BASE_LAYOUT, TheSeamBaseLayoutComponent, TheSeamBaseLayoutModule, TheSeamBaseLayoutNavToggleDirective, TheSeamDashboardModule, TheSeamDynamicRouterModule, TheSeamFramework, TheSeamNavModule, TheSeamSchemaFormFrameworkComponent, TheSeamSchemaFormModule, TheSeamSideNavModule, TheSeamTopBarComponent, TheSeamTopBarModule, TopBarCompactMenuBtnDetailDirective, TopBarItemDirective, TopBarMenuBtnDetailDirective, TopBarMenuButtonComponent, TopBarMenuDirective, TopBarNavToggleBtnDetailDirective, TopBarTitleComponent, applyItemConfig, areSameHorizontalNavItem, canBeActive, canExpand, canHaveChildren, computeDirection, createAddress1Control, createAddress2Control, createAddressFormGroup, createCityControl, createCountryControl, createPasswordFormGroup, createStateControl, createUsernameControl, createZipControl, extendFramework, fader, findHorizontalNavLinkItems, findLinkItems, getAddress1Validators, getAddress2Validators, getCityValidators, getCountryValidators, getHorizontalNavItemStateProp, getItemStateProp, getPasswordValidators, getStateValidators, getUrlSegments, getUsernameValidators, getZipValidators, hasActiveChild, hasChildren, hasExpandedChild, horizontalNavItemCanBeActive, horizontalNavItemCanExpand, horizontalNavItemCanHaveChildren, horizontalNavItemHasActiveChild, horizontalNavItemHasChildren, horizontalNavItemHasExpandedChild, ifUSA, isCountryUSA, isExpanded, isHorizontalNavItemActive, isHorizontalNavItemExpanded, isHorizontalNavItemFocused, isHorizontalNavItemType, isNavItemActive, isNavItemType, passwordContentValidator, passwordLengthValidator, passwordLowercaseValidator, passwordMatchValidator, passwordNumberValidator, passwordSpecialCharValidator, passwordUppercaseValidator, routeChanges, seamRouteTransition, setDefaultHorizontalNavItemState, setDefaultState, setHorizontalNavItemStateProp, setItemStateProp, sideNavExpandStateChangeFn, sideToSide, slider, stateProvinceRegionValidator, stepper, transformer, usernameExistsValidator };
1638
+ export type { IDashboardWidgetItemLayout, IDashboardWidgetItemLayoutPreference, IDashboardWidgetsColumnRecord, IDashboardWidgetsItem, IDashboardWidgetsItemDef, IDashboardWidgetsItemSerialized, IDashboardWidgetsPreferences, IDashboardWidgetsPreferencesMapRecord, IDynamicRouteDef, INavBadge, INavBasic, INavButton, INavDivider, INavItem, INavItemBase, INavItemState, INavLink, INavTitle, ISideNavBadge, ISideNavBasic, ISideNavButton, ISideNavDivider, ISideNavItem, ISideNavItemBase, ISideNavItemState, ISideNavLink, ISideNavTitle, ITheSeamDashboardWidgetsPreferencesAccessor, NavItemBadgeTooltip, NavItemCanHaveChildren, NavItemCanHaveState, NavItemChildAction, NavItemExpandAction, NavItemExpandedEvent, NavItemStateChanged, RouteDirection, SideNavAccessor, SideNavConfig, SideNavItemBadgeTooltip, SideNavItemCanBeActive, SideNavItemCanHaveChildren, SideNavItemCanHaveState, SideNavItemMenuItemTooltipBehavior, SideNavItemMenuItemTooltipConfig, SideNavItemStateChanged, TheSeamAddressFieldConfig, TheSeamAddressFormControls, TheSeamAddressFormGroupOptions, TheSeamAddressFormGroupResult, TheSeamAddressFormValue, TheSeamBaseLayoutAction, TheSeamBaseLayoutActionBase, TheSeamBaseLayoutActionButton, TheSeamBaseLayoutActionHref, TheSeamBaseLayoutActionRouterLink, TheSeamBaseLayoutActionTemplate, TheSeamBaseLayoutNav, TheSeamBaseLayoutRef, TheSeamControlValidators, TheSeamCreateCountryControlOptions, TheSeamPasswordFieldConfig, TheSeamPasswordFormControls, TheSeamPasswordFormValue, TheSeamSchemaFormControlWidget, TheSeamSchemaFormFrameworkOverrides, TheSeamSchemaFormWidget, TheSeamSchemaFormWidgetLayoutNodeOptions, TheSeamUserExistsFn, TheSeamUsernameFieldConfig, TheSeamValidatorOverrides, TopBarPosition };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theseam/ui-common",
3
- "version": "1.0.2-beta.39",
3
+ "version": "1.0.2-beta.43",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^20.2.3",
6
6
  "@angular/common": "^20.3.0",
@@ -1,16 +1,13 @@
1
- import { FormControl, ValidatorFn } from '@angular/forms';
1
+ import { ValidatorFn, FormControl } from '@angular/forms';
2
2
  import { Observable } from 'rxjs';
3
3
 
4
4
  /**
5
- * Validates that value matches on of the following:
6
- * '' // empty string
5
+ * Validates that value matches one of the following:
7
6
  * 'xxxxxxxxx' // 'x' is a number
8
7
  * 'xx-xxxxxxx' // 'x' is a number
9
8
  * 'xxx-xx-xxxx' // 'x' is a number
10
9
  */
11
- declare function taxIdValidator(control: FormControl): {
12
- taxId: {};
13
- } | null;
10
+ declare const taxIdValidator: ValidatorFn;
14
11
 
15
12
  /**
16
13
  * Validates that an email already exists.
@@ -21,29 +18,38 @@ declare function emailExistsValidator(emailExists: (email: string) => Promise<bo
21
18
  emailExists: {};
22
19
  } | null>;
23
20
 
21
+ interface TheSeamPhoneLengthConfig {
22
+ minLength: number;
23
+ maxLength: number;
24
+ }
24
25
  /**
25
26
  * Validates that a value is a valid phone number length.
26
27
  */
27
- declare function phoneLengthValidator(control: FormControl): {
28
- phoneLength: {};
29
- } | null;
28
+ declare function phoneLengthValidator(config?: Partial<TheSeamPhoneLengthConfig>): ValidatorFn;
30
29
 
31
30
  declare const DECIMAL_REGEX: RegExp;
31
+ interface TheSeamDecimalConfig {
32
+ regex: RegExp;
33
+ }
32
34
  /**
33
35
  * Validates control value is a valid decimal number.
34
36
  *
35
37
  * NOTE: This does not allow any js valid decimal number. It only accepts them
36
38
  * in a format expected by our backend.
37
39
  */
38
- declare const decimalValidator: ValidatorFn;
40
+ declare function decimalValidator(config?: Partial<TheSeamDecimalConfig>): ValidatorFn;
39
41
 
40
42
  declare const INTEGER_REGEX: RegExp;
43
+ interface TheSeamIntegerConfig {
44
+ regex: RegExp;
45
+ }
41
46
  /**
42
47
  * Validates control value is a valid integer number.
43
48
  *
44
49
  * NOTE: This does not allow any js valid integer number. It only accepts them
45
50
  * in a format expected by our backend.
46
51
  */
47
- declare const integerValidator: ValidatorFn;
52
+ declare function integerValidator(config?: Partial<TheSeamIntegerConfig>): ValidatorFn;
48
53
 
49
54
  export { DECIMAL_REGEX, INTEGER_REGEX, decimalValidator, emailExistsValidator, integerValidator, phoneLengthValidator, taxIdValidator };
55
+ export type { TheSeamDecimalConfig, TheSeamIntegerConfig, TheSeamPhoneLengthConfig };