@dereekb/dbx-form 9.18.2 → 9.18.3
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.
- package/esm2020/lib/form.module.mjs +6 -5
- package/esm2020/lib/formly/field/selection/pickable/pickable.field.mjs +4 -3
- package/esm2020/lib/formly/form/form.form.mjs +13 -0
- package/esm2020/lib/formly/form/form.form.module.mjs +21 -0
- package/esm2020/lib/formly/form/index.mjs +4 -0
- package/esm2020/lib/formly/form/search.form.component.mjs +42 -0
- package/esm2020/lib/formly/formly.directive.mjs +2 -1
- package/esm2020/lib/formly/index.mjs +2 -1
- package/fesm2015/dereekb-dbx-form.mjs +209 -146
- package/fesm2015/dereekb-dbx-form.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form.mjs +232 -170
- package/fesm2020/dereekb-dbx-form.mjs.map +1 -1
- package/lib/form.module.d.ts +2 -1
- package/lib/formly/field/selection/pickable/pickable.field.d.ts +1 -0
- package/lib/formly/form/_form.scss +31 -0
- package/lib/formly/form/form.form.d.ts +10 -0
- package/lib/formly/form/form.form.module.d.ts +11 -0
- package/lib/formly/form/index.d.ts +3 -0
- package/lib/formly/form/search.form.component.d.ts +14 -0
- package/lib/formly/formly.directive.d.ts +1 -0
- package/lib/formly/index.d.ts +1 -0
- package/lib/style/_all-core.scss +2 -0
- package/lib/style/_all-theme.scss +2 -0
- package/lib/style/_all-typography.scss +2 -0
- package/mapbox/package.json +4 -4
- package/package.json +4 -4
|
@@ -26,7 +26,7 @@ import * as i1$1 from '@angular/material/button';
|
|
|
26
26
|
import { MatButtonModule } from '@angular/material/button';
|
|
27
27
|
import * as i3$3 from '@angular/flex-layout/flex';
|
|
28
28
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
29
|
-
import { objectIsEmpty, mergeObjectsFunction, filterFromPOJOFunction, mergeObjects, filterFromPOJO, asArray, objectHasNoKeys, addPlusPrefixToNumber, convertMaybeToArray, isSelectedDecisionFunctionFactory, readKeysFrom, hasDifferentValues, makeValuesGroupMap, findUnique, searchStringFilterFunction, caseInsensitiveFilterByIndexOfDecisionFactory, mergeIntoArray, lastValue, separateValues, arrayToMap, cachedGetter, makeGetter, asDecisionFunction, getValueFromGetter, filterMaybeValues, dateFromLogicalDate, WEBSITE_DOMAIN_NAME_REGEX, KeyValueTypleValueFilter, valuesFromPOJO, allObjectsAreEqual, isNumberDivisibleBy, nearestDivisibleValues, transformNumberFunction, concatArrays, transformStringFunction, US_STATE_CODE_STRING_REGEX, ZIP_CODE_STRING_REGEX, LAT_LNG_PATTERN,
|
|
29
|
+
import { objectIsEmpty, mergeObjectsFunction, filterFromPOJOFunction, mergeObjects, filterFromPOJO, asArray, objectHasNoKeys, addPlusPrefixToNumber, convertMaybeToArray, isSelectedDecisionFunctionFactory, readKeysFrom, hasDifferentValues, makeValuesGroupMap, findUnique, searchStringFilterFunction, caseInsensitiveFilterByIndexOfDecisionFactory, sortByStringFunction, mergeIntoArray, lastValue, separateValues, arrayToMap, cachedGetter, makeGetter, asDecisionFunction, getValueFromGetter, filterMaybeValues, dateFromLogicalDate, WEBSITE_DOMAIN_NAME_REGEX, KeyValueTypleValueFilter, valuesFromPOJO, allObjectsAreEqual, isNumberDivisibleBy, nearestDivisibleValues, transformNumberFunction, concatArrays, transformStringFunction, US_STATE_CODE_STRING_REGEX, ZIP_CODE_STRING_REGEX, LAT_LNG_PATTERN, BooleanStringKeyArrayUtilityInstance, capitalizeFirstLetter } from '@dereekb/util';
|
|
30
30
|
import * as i2$2 from '@angular/material/slide-toggle';
|
|
31
31
|
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
32
32
|
import * as i2$3 from '@angular/flex-layout/extended';
|
|
@@ -2068,8 +2068,9 @@ function filterPickableItemFieldValuesByLabel(filterText, values) {
|
|
|
2068
2068
|
}
|
|
2069
2069
|
return of(filteredValues.map((x) => x.value));
|
|
2070
2070
|
}
|
|
2071
|
+
const sortPickableItemsByLabelStringFunction = sortByStringFunction((x) => x.itemValue.label);
|
|
2071
2072
|
function sortPickableItemsByLabel(chips) {
|
|
2072
|
-
return chips.sort(
|
|
2073
|
+
return chips.sort(sortPickableItemsByLabelStringFunction);
|
|
2073
2074
|
}
|
|
2074
2075
|
function pickableItemChipField(config) {
|
|
2075
2076
|
const { key } = config;
|
|
@@ -4248,139 +4249,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
4248
4249
|
}]
|
|
4249
4250
|
}] });
|
|
4250
4251
|
|
|
4251
|
-
/**
|
|
4252
|
-
* Configured simple text password field.
|
|
4253
|
-
*
|
|
4254
|
-
* @param config
|
|
4255
|
-
* @returns
|
|
4256
|
-
*/
|
|
4257
|
-
function textPasswordField(config) {
|
|
4258
|
-
return textField({
|
|
4259
|
-
key: 'password',
|
|
4260
|
-
...config,
|
|
4261
|
-
label: config?.label ?? 'Password',
|
|
4262
|
-
inputType: 'password',
|
|
4263
|
-
required: true
|
|
4264
|
-
});
|
|
4265
|
-
}
|
|
4266
|
-
/**
|
|
4267
|
-
* Configured verify field for a password.
|
|
4268
|
-
* @param config
|
|
4269
|
-
* @returns
|
|
4270
|
-
*/
|
|
4271
|
-
function textVerifyPasswordField(config) {
|
|
4272
|
-
return textPasswordField({
|
|
4273
|
-
key: 'verifyPassword',
|
|
4274
|
-
label: 'Verify Password',
|
|
4275
|
-
...config,
|
|
4276
|
-
required: true
|
|
4277
|
-
});
|
|
4278
|
-
}
|
|
4279
|
-
function textPasswordWithVerifyFieldGroup(config) {
|
|
4280
|
-
const passwordFieldConfig = textPasswordField(config.password);
|
|
4281
|
-
const verifyPasswordFieldKey = config.verifyPassword?.key ?? `verify${capitalizeFirstLetter(String(passwordFieldConfig.key))}`;
|
|
4282
|
-
const verifyPasswordField = textVerifyPasswordField({
|
|
4283
|
-
...config.password,
|
|
4284
|
-
...config.verifyPassword,
|
|
4285
|
-
label: config.verifyPassword?.label ?? `Verify ${passwordFieldConfig.props?.label}`,
|
|
4286
|
-
key: verifyPasswordFieldKey
|
|
4287
|
-
});
|
|
4288
|
-
const validators = {
|
|
4289
|
-
validation: [
|
|
4290
|
-
{
|
|
4291
|
-
errorPath: verifyPasswordFieldKey,
|
|
4292
|
-
expression: fieldValuesAreEqualValidator({ keysFilter: [passwordFieldConfig.key, verifyPasswordField.key], message: 'The passwords do not match.' })
|
|
4293
|
-
}
|
|
4294
|
-
]
|
|
4295
|
-
};
|
|
4296
|
-
const groupFieldConfig = {
|
|
4297
|
-
validators,
|
|
4298
|
-
fieldGroup: [passwordFieldConfig, verifyPasswordField]
|
|
4299
|
-
};
|
|
4300
|
-
return groupFieldConfig;
|
|
4301
|
-
}
|
|
4302
|
-
/**
|
|
4303
|
-
* Template for login field that takes in a username and password.
|
|
4304
|
-
*
|
|
4305
|
-
* @param param0
|
|
4306
|
-
* @returns
|
|
4307
|
-
*/
|
|
4308
|
-
function usernamePasswordLoginFields({ username, password, verifyPassword }) {
|
|
4309
|
-
let usernameField;
|
|
4310
|
-
let usernameFieldConfig = username;
|
|
4311
|
-
const defaultUsernameFieldConfig = { key: 'username', required: true };
|
|
4312
|
-
if (typeof username === 'string') {
|
|
4313
|
-
if (username === 'email') {
|
|
4314
|
-
usernameFieldConfig = {
|
|
4315
|
-
email: defaultUsernameFieldConfig
|
|
4316
|
-
};
|
|
4317
|
-
}
|
|
4318
|
-
else {
|
|
4319
|
-
usernameFieldConfig = {
|
|
4320
|
-
username: defaultUsernameFieldConfig
|
|
4321
|
-
};
|
|
4322
|
-
}
|
|
4323
|
-
}
|
|
4324
|
-
if (usernameFieldConfig.email) {
|
|
4325
|
-
usernameField = emailField({ ...usernameFieldConfig.username, ...defaultUsernameFieldConfig });
|
|
4326
|
-
}
|
|
4327
|
-
else {
|
|
4328
|
-
usernameField = textField({ ...usernameFieldConfig.username, ...defaultUsernameFieldConfig });
|
|
4329
|
-
}
|
|
4330
|
-
const passwordField = verifyPassword ? textPasswordWithVerifyFieldGroup({ password, verifyPassword: verifyPassword === true ? undefined : verifyPassword }) : textPasswordField(password);
|
|
4331
|
-
return [usernameField, passwordField];
|
|
4332
|
-
}
|
|
4333
|
-
|
|
4334
|
-
function textIsAvailableField(config) {
|
|
4335
|
-
const field = textField(config);
|
|
4336
|
-
field.asyncValidators = {
|
|
4337
|
-
validation: [
|
|
4338
|
-
{
|
|
4339
|
-
expression: fieldValueIsAvailableValidator({
|
|
4340
|
-
...config,
|
|
4341
|
-
message: config?.isNotAvailableErrorMessage
|
|
4342
|
-
})
|
|
4343
|
-
}
|
|
4344
|
-
]
|
|
4345
|
-
};
|
|
4346
|
-
return workingWrapper(field, {});
|
|
4347
|
-
}
|
|
4348
|
-
|
|
4349
|
-
function timezoneStringSearchFunction() {
|
|
4350
|
-
const timezoneInfos = allTimezoneInfos();
|
|
4351
|
-
return (search) => {
|
|
4352
|
-
let searchResults;
|
|
4353
|
-
if (search.length === 0) {
|
|
4354
|
-
searchResults = [timezoneInfoForSystem()].concat(timezoneInfos);
|
|
4355
|
-
}
|
|
4356
|
-
else {
|
|
4357
|
-
searchResults = searchTimezoneInfos(search, timezoneInfos);
|
|
4358
|
-
}
|
|
4359
|
-
return of(searchResults.map((meta) => ({ value: meta.timezone, meta })));
|
|
4360
|
-
};
|
|
4361
|
-
}
|
|
4362
|
-
const DISPLAY_FOR_TIMEZONE_STRING_VALUE = (values) => {
|
|
4363
|
-
const displayValues = values.map((x) => ({ ...x, label: x.value, sublabel: x.meta?.abbreviation ?? 'Unknown' }));
|
|
4364
|
-
const obs = of(displayValues);
|
|
4365
|
-
return obs;
|
|
4366
|
-
};
|
|
4367
|
-
/**
|
|
4368
|
-
* Template for login field that takes in a username and password.
|
|
4369
|
-
*
|
|
4370
|
-
* @param param0
|
|
4371
|
-
* @returns
|
|
4372
|
-
*/
|
|
4373
|
-
function timezoneStringField(config = {}) {
|
|
4374
|
-
return searchableTextField({
|
|
4375
|
-
key: 'timezone',
|
|
4376
|
-
label: 'Timezone',
|
|
4377
|
-
...config,
|
|
4378
|
-
searchOnEmptyText: true,
|
|
4379
|
-
search: timezoneStringSearchFunction(),
|
|
4380
|
-
displayForValue: DISPLAY_FOR_TIMEZONE_STRING_VALUE
|
|
4381
|
-
});
|
|
4382
|
-
}
|
|
4383
|
-
|
|
4384
4252
|
/**
|
|
4385
4253
|
* Allows a directive to provide a formly context and form.
|
|
4386
4254
|
*/
|
|
@@ -4556,6 +4424,7 @@ class AbstractConfigAsyncFormlyFormDirective extends AbstractAsyncFormlyFormDire
|
|
|
4556
4424
|
constructor() {
|
|
4557
4425
|
super(...arguments);
|
|
4558
4426
|
this._config = new BehaviorSubject(undefined);
|
|
4427
|
+
this.currentConfig$ = this._config.asObservable();
|
|
4559
4428
|
this.config$ = this._config.pipe(filterMaybe(), shareReplay(1));
|
|
4560
4429
|
}
|
|
4561
4430
|
get config() {
|
|
@@ -4577,38 +4446,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
4577
4446
|
type: Input
|
|
4578
4447
|
}] } });
|
|
4579
4448
|
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
return this._fields.value;
|
|
4591
|
-
}
|
|
4592
|
-
set fields(fields) {
|
|
4593
|
-
this._fields.next(fields);
|
|
4594
|
-
}
|
|
4595
|
-
ngOnDestroy() {
|
|
4596
|
-
super.ngOnDestroy();
|
|
4597
|
-
this._fields.complete();
|
|
4598
|
-
}
|
|
4449
|
+
function dbxFormSearchFormFields(config) {
|
|
4450
|
+
const { label = ' ', placeholder = 'Search' } = config || {};
|
|
4451
|
+
return [
|
|
4452
|
+
textField({
|
|
4453
|
+
key: 'search',
|
|
4454
|
+
label,
|
|
4455
|
+
placeholder,
|
|
4456
|
+
autocomplete: false
|
|
4457
|
+
})
|
|
4458
|
+
];
|
|
4599
4459
|
}
|
|
4600
|
-
DbxFormlyFieldsContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormlyFieldsContextDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
4601
|
-
DbxFormlyFieldsContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: DbxFormlyFieldsContextDirective, selector: "[dbxFormlyFields]", inputs: { fields: ["dbxFormlyFields", "fields"] }, providers: provideFormlyContext(), usesInheritance: true, ngImport: i0 });
|
|
4602
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormlyFieldsContextDirective, decorators: [{
|
|
4603
|
-
type: Directive,
|
|
4604
|
-
args: [{
|
|
4605
|
-
selector: '[dbxFormlyFields]',
|
|
4606
|
-
providers: provideFormlyContext()
|
|
4607
|
-
}]
|
|
4608
|
-
}], propDecorators: { fields: [{
|
|
4609
|
-
type: Input,
|
|
4610
|
-
args: ['dbxFormlyFields']
|
|
4611
|
-
}] } });
|
|
4612
4460
|
|
|
4613
4461
|
/**
|
|
4614
4462
|
* Used for rending a form from a DbxFormlyContext.
|
|
@@ -4780,6 +4628,73 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
4780
4628
|
}]
|
|
4781
4629
|
}], ctorParameters: function () { return [{ type: DbxFormlyContext }]; } });
|
|
4782
4630
|
|
|
4631
|
+
class DbxFormSearchFormComponent extends AbstractConfigAsyncFormlyFormDirective {
|
|
4632
|
+
constructor() {
|
|
4633
|
+
super(...arguments);
|
|
4634
|
+
this.search = new EventEmitter();
|
|
4635
|
+
this.fields$ = this.currentConfig$.pipe(map(dbxFormSearchFormFields));
|
|
4636
|
+
}
|
|
4637
|
+
searchChanged(value) {
|
|
4638
|
+
this.search.next(value.search ?? '');
|
|
4639
|
+
}
|
|
4640
|
+
ngOnDestroy() {
|
|
4641
|
+
super.ngOnDestroy();
|
|
4642
|
+
this.search.complete();
|
|
4643
|
+
}
|
|
4644
|
+
}
|
|
4645
|
+
DbxFormSearchFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormSearchFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
4646
|
+
DbxFormSearchFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxFormSearchFormComponent, selector: "dbx-form-search-form", outputs: { search: "search" }, host: { classAttribute: "d-block dbx-form-search-form" }, providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `
|
|
4647
|
+
<dbx-formly (dbxFormValueChange)="searchChanged($event)"></dbx-formly>
|
|
4648
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: DbxFormValueChangesDirective, selector: "[dbxFormValueChange]", outputs: ["dbxFormValueChange"] }, { kind: "component", type: DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
|
|
4649
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormSearchFormComponent, decorators: [{
|
|
4650
|
+
type: Component,
|
|
4651
|
+
args: [{
|
|
4652
|
+
template: `
|
|
4653
|
+
<dbx-formly (dbxFormValueChange)="searchChanged($event)"></dbx-formly>
|
|
4654
|
+
`,
|
|
4655
|
+
selector: 'dbx-form-search-form',
|
|
4656
|
+
providers: [provideFormlyContext()],
|
|
4657
|
+
host: {
|
|
4658
|
+
class: 'd-block dbx-form-search-form'
|
|
4659
|
+
}
|
|
4660
|
+
}]
|
|
4661
|
+
}], propDecorators: { search: [{
|
|
4662
|
+
type: Output
|
|
4663
|
+
}] } });
|
|
4664
|
+
|
|
4665
|
+
/**
|
|
4666
|
+
* Provides an DbxFormlyContext and has an input for fields.
|
|
4667
|
+
*/
|
|
4668
|
+
class DbxFormlyFieldsContextDirective extends AbstractAsyncFormlyFormDirective {
|
|
4669
|
+
constructor() {
|
|
4670
|
+
super(...arguments);
|
|
4671
|
+
this._fields = new BehaviorSubject(undefined);
|
|
4672
|
+
this.fields$ = this._fields.asObservable();
|
|
4673
|
+
}
|
|
4674
|
+
get fields() {
|
|
4675
|
+
return this._fields.value;
|
|
4676
|
+
}
|
|
4677
|
+
set fields(fields) {
|
|
4678
|
+
this._fields.next(fields);
|
|
4679
|
+
}
|
|
4680
|
+
ngOnDestroy() {
|
|
4681
|
+
super.ngOnDestroy();
|
|
4682
|
+
this._fields.complete();
|
|
4683
|
+
}
|
|
4684
|
+
}
|
|
4685
|
+
DbxFormlyFieldsContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormlyFieldsContextDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
4686
|
+
DbxFormlyFieldsContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: DbxFormlyFieldsContextDirective, selector: "[dbxFormlyFields]", inputs: { fields: ["dbxFormlyFields", "fields"] }, providers: provideFormlyContext(), usesInheritance: true, ngImport: i0 });
|
|
4687
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormlyFieldsContextDirective, decorators: [{
|
|
4688
|
+
type: Directive,
|
|
4689
|
+
args: [{
|
|
4690
|
+
selector: '[dbxFormlyFields]',
|
|
4691
|
+
providers: provideFormlyContext()
|
|
4692
|
+
}]
|
|
4693
|
+
}], propDecorators: { fields: [{
|
|
4694
|
+
type: Input,
|
|
4695
|
+
args: ['dbxFormlyFields']
|
|
4696
|
+
}] } });
|
|
4697
|
+
|
|
4783
4698
|
class DbxFormlyModule {
|
|
4784
4699
|
}
|
|
4785
4700
|
DbxFormlyModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormlyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -4813,6 +4728,153 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
4813
4728
|
}]
|
|
4814
4729
|
}] });
|
|
4815
4730
|
|
|
4731
|
+
class DbxFormFormlyFormModule {
|
|
4732
|
+
}
|
|
4733
|
+
DbxFormFormlyFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormFormlyFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4734
|
+
DbxFormFormlyFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxFormFormlyFormModule, declarations: [DbxFormSearchFormComponent], imports: [CommonModule, DbxFormModule, DbxFormlyModule, DbxFormFormlyFieldModule], exports: [DbxFormSearchFormComponent] });
|
|
4735
|
+
DbxFormFormlyFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormFormlyFormModule, imports: [CommonModule, DbxFormModule, DbxFormlyModule, DbxFormFormlyFieldModule] });
|
|
4736
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormFormlyFormModule, decorators: [{
|
|
4737
|
+
type: NgModule,
|
|
4738
|
+
args: [{
|
|
4739
|
+
imports: [CommonModule, DbxFormModule, DbxFormlyModule, DbxFormFormlyFieldModule],
|
|
4740
|
+
declarations: [DbxFormSearchFormComponent],
|
|
4741
|
+
exports: [DbxFormSearchFormComponent]
|
|
4742
|
+
}]
|
|
4743
|
+
}] });
|
|
4744
|
+
|
|
4745
|
+
/**
|
|
4746
|
+
* Configured simple text password field.
|
|
4747
|
+
*
|
|
4748
|
+
* @param config
|
|
4749
|
+
* @returns
|
|
4750
|
+
*/
|
|
4751
|
+
function textPasswordField(config) {
|
|
4752
|
+
return textField({
|
|
4753
|
+
key: 'password',
|
|
4754
|
+
...config,
|
|
4755
|
+
label: config?.label ?? 'Password',
|
|
4756
|
+
inputType: 'password',
|
|
4757
|
+
required: true
|
|
4758
|
+
});
|
|
4759
|
+
}
|
|
4760
|
+
/**
|
|
4761
|
+
* Configured verify field for a password.
|
|
4762
|
+
* @param config
|
|
4763
|
+
* @returns
|
|
4764
|
+
*/
|
|
4765
|
+
function textVerifyPasswordField(config) {
|
|
4766
|
+
return textPasswordField({
|
|
4767
|
+
key: 'verifyPassword',
|
|
4768
|
+
label: 'Verify Password',
|
|
4769
|
+
...config,
|
|
4770
|
+
required: true
|
|
4771
|
+
});
|
|
4772
|
+
}
|
|
4773
|
+
function textPasswordWithVerifyFieldGroup(config) {
|
|
4774
|
+
const passwordFieldConfig = textPasswordField(config.password);
|
|
4775
|
+
const verifyPasswordFieldKey = config.verifyPassword?.key ?? `verify${capitalizeFirstLetter(String(passwordFieldConfig.key))}`;
|
|
4776
|
+
const verifyPasswordField = textVerifyPasswordField({
|
|
4777
|
+
...config.password,
|
|
4778
|
+
...config.verifyPassword,
|
|
4779
|
+
label: config.verifyPassword?.label ?? `Verify ${passwordFieldConfig.props?.label}`,
|
|
4780
|
+
key: verifyPasswordFieldKey
|
|
4781
|
+
});
|
|
4782
|
+
const validators = {
|
|
4783
|
+
validation: [
|
|
4784
|
+
{
|
|
4785
|
+
errorPath: verifyPasswordFieldKey,
|
|
4786
|
+
expression: fieldValuesAreEqualValidator({ keysFilter: [passwordFieldConfig.key, verifyPasswordField.key], message: 'The passwords do not match.' })
|
|
4787
|
+
}
|
|
4788
|
+
]
|
|
4789
|
+
};
|
|
4790
|
+
const groupFieldConfig = {
|
|
4791
|
+
validators,
|
|
4792
|
+
fieldGroup: [passwordFieldConfig, verifyPasswordField]
|
|
4793
|
+
};
|
|
4794
|
+
return groupFieldConfig;
|
|
4795
|
+
}
|
|
4796
|
+
/**
|
|
4797
|
+
* Template for login field that takes in a username and password.
|
|
4798
|
+
*
|
|
4799
|
+
* @param param0
|
|
4800
|
+
* @returns
|
|
4801
|
+
*/
|
|
4802
|
+
function usernamePasswordLoginFields({ username, password, verifyPassword }) {
|
|
4803
|
+
let usernameField;
|
|
4804
|
+
let usernameFieldConfig = username;
|
|
4805
|
+
const defaultUsernameFieldConfig = { key: 'username', required: true };
|
|
4806
|
+
if (typeof username === 'string') {
|
|
4807
|
+
if (username === 'email') {
|
|
4808
|
+
usernameFieldConfig = {
|
|
4809
|
+
email: defaultUsernameFieldConfig
|
|
4810
|
+
};
|
|
4811
|
+
}
|
|
4812
|
+
else {
|
|
4813
|
+
usernameFieldConfig = {
|
|
4814
|
+
username: defaultUsernameFieldConfig
|
|
4815
|
+
};
|
|
4816
|
+
}
|
|
4817
|
+
}
|
|
4818
|
+
if (usernameFieldConfig.email) {
|
|
4819
|
+
usernameField = emailField({ ...usernameFieldConfig.username, ...defaultUsernameFieldConfig });
|
|
4820
|
+
}
|
|
4821
|
+
else {
|
|
4822
|
+
usernameField = textField({ ...usernameFieldConfig.username, ...defaultUsernameFieldConfig });
|
|
4823
|
+
}
|
|
4824
|
+
const passwordField = verifyPassword ? textPasswordWithVerifyFieldGroup({ password, verifyPassword: verifyPassword === true ? undefined : verifyPassword }) : textPasswordField(password);
|
|
4825
|
+
return [usernameField, passwordField];
|
|
4826
|
+
}
|
|
4827
|
+
|
|
4828
|
+
function textIsAvailableField(config) {
|
|
4829
|
+
const field = textField(config);
|
|
4830
|
+
field.asyncValidators = {
|
|
4831
|
+
validation: [
|
|
4832
|
+
{
|
|
4833
|
+
expression: fieldValueIsAvailableValidator({
|
|
4834
|
+
...config,
|
|
4835
|
+
message: config?.isNotAvailableErrorMessage
|
|
4836
|
+
})
|
|
4837
|
+
}
|
|
4838
|
+
]
|
|
4839
|
+
};
|
|
4840
|
+
return workingWrapper(field, {});
|
|
4841
|
+
}
|
|
4842
|
+
|
|
4843
|
+
function timezoneStringSearchFunction() {
|
|
4844
|
+
const timezoneInfos = allTimezoneInfos();
|
|
4845
|
+
return (search) => {
|
|
4846
|
+
let searchResults;
|
|
4847
|
+
if (search.length === 0) {
|
|
4848
|
+
searchResults = [timezoneInfoForSystem()].concat(timezoneInfos);
|
|
4849
|
+
}
|
|
4850
|
+
else {
|
|
4851
|
+
searchResults = searchTimezoneInfos(search, timezoneInfos);
|
|
4852
|
+
}
|
|
4853
|
+
return of(searchResults.map((meta) => ({ value: meta.timezone, meta })));
|
|
4854
|
+
};
|
|
4855
|
+
}
|
|
4856
|
+
const DISPLAY_FOR_TIMEZONE_STRING_VALUE = (values) => {
|
|
4857
|
+
const displayValues = values.map((x) => ({ ...x, label: x.value, sublabel: x.meta?.abbreviation ?? 'Unknown' }));
|
|
4858
|
+
const obs = of(displayValues);
|
|
4859
|
+
return obs;
|
|
4860
|
+
};
|
|
4861
|
+
/**
|
|
4862
|
+
* Template for login field that takes in a username and password.
|
|
4863
|
+
*
|
|
4864
|
+
* @param param0
|
|
4865
|
+
* @returns
|
|
4866
|
+
*/
|
|
4867
|
+
function timezoneStringField(config = {}) {
|
|
4868
|
+
return searchableTextField({
|
|
4869
|
+
key: 'timezone',
|
|
4870
|
+
label: 'Timezone',
|
|
4871
|
+
...config,
|
|
4872
|
+
searchOnEmptyText: true,
|
|
4873
|
+
search: timezoneStringSearchFunction(),
|
|
4874
|
+
displayForValue: DISPLAY_FOR_TIMEZONE_STRING_VALUE
|
|
4875
|
+
});
|
|
4876
|
+
}
|
|
4877
|
+
|
|
4816
4878
|
/**
|
|
4817
4879
|
* Provides vertical spacing after a form.
|
|
4818
4880
|
*/
|
|
@@ -4849,12 +4911,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
4849
4911
|
class DbxFormExtensionModule {
|
|
4850
4912
|
}
|
|
4851
4913
|
DbxFormExtensionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormExtensionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4852
|
-
DbxFormExtensionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxFormExtensionModule, exports: [DbxFormModule, DbxFormlyModule, DbxFormFormlyFieldModule] });
|
|
4853
|
-
DbxFormExtensionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormExtensionModule, imports: [DbxFormModule, DbxFormlyModule, DbxFormFormlyFieldModule] });
|
|
4914
|
+
DbxFormExtensionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxFormExtensionModule, exports: [DbxFormModule, DbxFormlyModule, DbxFormFormlyFieldModule, DbxFormFormlyFormModule] });
|
|
4915
|
+
DbxFormExtensionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormExtensionModule, imports: [DbxFormModule, DbxFormlyModule, DbxFormFormlyFieldModule, DbxFormFormlyFormModule] });
|
|
4854
4916
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormExtensionModule, decorators: [{
|
|
4855
4917
|
type: NgModule,
|
|
4856
4918
|
args: [{
|
|
4857
|
-
exports: [DbxFormModule, DbxFormlyModule, DbxFormFormlyFieldModule]
|
|
4919
|
+
exports: [DbxFormModule, DbxFormlyModule, DbxFormFormlyFieldModule, DbxFormFormlyFormModule]
|
|
4858
4920
|
}]
|
|
4859
4921
|
}] });
|
|
4860
4922
|
|
|
@@ -4862,5 +4924,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
4862
4924
|
* Generated bundle index. Do not edit.
|
|
4863
4925
|
*/
|
|
4864
4926
|
|
|
4865
|
-
export { APP_ACTION_FORM_DISABLED_KEY, AUTO_TOUCH_WRAPPER_KEY, AbstractAsyncFormlyFormDirective, AbstractConfigAsyncFormlyFormDirective, AbstractDbxPickableItemFieldDirective, AbstractDbxSearchableFieldDisplayDirective, AbstractDbxSearchableValueFieldDirective, AbstractFormExpandableSectionWrapperDirective, AbstractFormlyFormDirective, AbstractSyncFormlyFormDirective, AutoTouchFieldWrapperComponent, ChecklistItemFieldDataSetBuilder, DBX_SEARCHABLE_FIELD_COMPONENT_DATA_TOKEN, DEFAULT_FORM_DISABLED_KEY, DEFAULT_HAS_VALUE_FN, DEFAULT_LAT_LNG_TEXT_FIELD_PATTERN_MESSAGE, DEFAULT_LAT_LNG_TEXT_FIELD_PLACEHOLDER, DEFAULT_PREFERRED_COUNTRIES, DISPLAY_FOR_TIMEZONE_STRING_VALUE, DbxActionFormDirective, DbxActionFormSafetyDirective, DbxChecklistItemContentComponent, DbxChecklistItemFieldComponent, DbxDateTimeFieldComponent, DbxDateTimeFieldTimeMode, DbxDateTimeValueMode, DbxDefaultChecklistItemFieldDisplayComponent, DbxDefaultSearchableFieldDisplayComponent, DbxForm, DbxFormActionModule, DbxFormActionTransitionModule, DbxFormComponentFieldComponent, DbxFormExpandWrapperComponent, DbxFormExtensionModule, DbxFormFlexWrapperComponent, DbxFormFormlyArrayFieldModule, DbxFormFormlyBooleanFieldModule, DbxFormFormlyChecklistItemFieldModule, DbxFormFormlyComponentFieldModule, DbxFormFormlyDateFieldModule, DbxFormFormlyDbxListFieldModule, DbxFormFormlyFieldModule, DbxFormFormlyNumberFieldModule, DbxFormFormlyPhoneFieldModule, DbxFormFormlyPickableFieldModule, DbxFormFormlySearchableFieldModule, DbxFormFormlySelectionModule, DbxFormFormlyTextEditorFieldModule, DbxFormFormlyTextFieldModule, DbxFormFormlyValueModule, DbxFormFormlyWrapperModule, DbxFormInfoWrapperComponent, DbxFormIoModule, DbxFormLayoutModule, DbxFormLoadingSourceDirective, DbxFormModule, DbxFormRepeatArrayTypeComponent, DbxFormSectionWrapperComponent, DbxFormSourceDirective, DbxFormSpacerComponent, DbxFormState, DbxFormSubsectionWrapperComponent, DbxFormToggleWrapperComponent, DbxFormValueChangesDirective, DbxFormWorkingWrapperComponent, DbxFormlyContext, DbxFormlyFieldsContextDirective, DbxFormlyFormComponent, DbxFormlyModule, DbxItemListFieldComponent, DbxMutableForm, DbxPhoneFieldComponent, DbxPickableChipListFieldComponent, DbxPickableListFieldComponent, DbxPickableListFieldItemListComponent, DbxPickableListFieldItemListViewComponent, DbxPickableListFieldItemListViewItemComponent, DbxSearchableChipFieldComponent, DbxSearchableFieldAutocompleteItemComponent, DbxSearchableTextFieldComponent, DbxTextEditorFieldComponent, EXPANDABLE_WRAPPER_KEY, FIELD_VALUES_ARE_EQUAL_VALIDATION_KEY, FIELD_VALUE_IS_AVAILABLE_ERROR_VALIDATION_KEY, FIELD_VALUE_IS_AVAILABLE_VALIDATION_KEY, FLEX_WRAPPER_KEY, INFO_WRAPPER_KEY, INVALID_PHONE_NUMBER_MESSAGE, IS_DIVISIBLE_BY_VALIDATION_KEY, LABEL_STRING_MAX_LENGTH, MAX_LENGTH_VALIDATION_MESSAGE, MAX_VALIDATION_MESSAGE, MIN_LENGTH_VALIDATION_MESSAGE, MIN_VALIDATION_MESSAGE, PHONE_LABEL_MAX_LENGTH, REQUIRED_VALIDATION_MESSAGE, SEARCH_STRING_MAX_LENGTH, SECTION_WRAPPER_KEY, STYLE_WRAPPER_KEY, SUBSECTION_WRAPPER_KEY, TAKE_NEXT_UPCOMING_TIME_CONFIG_OBS, TOGGLE_WRAPPER_KEY, WORKING_WRAPPER_KEY, addValueSelectionOptionFunction, addWrapperToFormlyFieldConfig, addressField, addressFormlyFields, addressLineField, addressListField, autoTouchWrapper, checkIsFieldFlexLayoutGroupFieldConfig, checkboxField, checklistItemField, chipTextField, cityField, componentField, countryField, dateRangeField, dateTimeField, dbxDateTimeInputValueParseFactory, dbxDateTimeOutputValueFactory, dbxFormSourceObservable, dbxFormSourceObservableFromStream, dbxListField, defaultValidationMessages, disableFormlyFieldAutofillAttributes, dollarAmountField, emailField, expandWrapper, fieldValueIsAvailableValidator, fieldValuesAreEqualValidator, filterPartialPotentialFieldConfigValuesFromObject, filterPickableItemFieldValuesByLabel, filterPickableItemFieldValuesByLabelFilterFunction, flexLayoutWrapper, formlyField, hiddenField, infoWrapper, isDivisibleBy, isDomain, isInRange, isTruthy, latLngTextField, makeMetaFilterSearchableFieldValueDisplayFn, maxLengthValidationMessage, maxValidationMessage, mergePropsValueObjects, minLengthValidationMessage, minValidationMessage, nameField, numberField, numberFieldTransformParser, partialPotentialFieldConfigKeys, partialPotentialFieldConfigKeysFilter, phoneAndLabelSectionField, phoneField, phoneListField, pickableItemChipField, pickableItemListField, propsAndConfigForFieldConfig, propsForFieldConfig, propsValueForFieldConfig, provideDbxForm, provideDbxMutableForm, provideFormlyContext, repeatArrayField, searchableChipField, searchableStringChipField, searchableTextField, sectionWrapper, sortPickableItemsByLabel, stateField, styleWrapper, subsectionWrapper, syncConfigValueObs, textAreaField, textEditorField, textField, textFieldTransformParser, textIsAvailableField, textPasswordField, textPasswordWithVerifyFieldGroup, textVerifyPasswordField, timeOnlyField, timezoneStringField, timezoneStringSearchFunction, toggleField, toggleWrapper, usernamePasswordLoginFields, validatorsForFieldConfig, valueSelectionField, workingWrapper, wrappedPhoneAndLabelField, zipCodeField };
|
|
4927
|
+
export { APP_ACTION_FORM_DISABLED_KEY, AUTO_TOUCH_WRAPPER_KEY, AbstractAsyncFormlyFormDirective, AbstractConfigAsyncFormlyFormDirective, AbstractDbxPickableItemFieldDirective, AbstractDbxSearchableFieldDisplayDirective, AbstractDbxSearchableValueFieldDirective, AbstractFormExpandableSectionWrapperDirective, AbstractFormlyFormDirective, AbstractSyncFormlyFormDirective, AutoTouchFieldWrapperComponent, ChecklistItemFieldDataSetBuilder, DBX_SEARCHABLE_FIELD_COMPONENT_DATA_TOKEN, DEFAULT_FORM_DISABLED_KEY, DEFAULT_HAS_VALUE_FN, DEFAULT_LAT_LNG_TEXT_FIELD_PATTERN_MESSAGE, DEFAULT_LAT_LNG_TEXT_FIELD_PLACEHOLDER, DEFAULT_PREFERRED_COUNTRIES, DISPLAY_FOR_TIMEZONE_STRING_VALUE, DbxActionFormDirective, DbxActionFormSafetyDirective, DbxChecklistItemContentComponent, DbxChecklistItemFieldComponent, DbxDateTimeFieldComponent, DbxDateTimeFieldTimeMode, DbxDateTimeValueMode, DbxDefaultChecklistItemFieldDisplayComponent, DbxDefaultSearchableFieldDisplayComponent, DbxForm, DbxFormActionModule, DbxFormActionTransitionModule, DbxFormComponentFieldComponent, DbxFormExpandWrapperComponent, DbxFormExtensionModule, DbxFormFlexWrapperComponent, DbxFormFormlyArrayFieldModule, DbxFormFormlyBooleanFieldModule, DbxFormFormlyChecklistItemFieldModule, DbxFormFormlyComponentFieldModule, DbxFormFormlyDateFieldModule, DbxFormFormlyDbxListFieldModule, DbxFormFormlyFieldModule, DbxFormFormlyFormModule, DbxFormFormlyNumberFieldModule, DbxFormFormlyPhoneFieldModule, DbxFormFormlyPickableFieldModule, DbxFormFormlySearchableFieldModule, DbxFormFormlySelectionModule, DbxFormFormlyTextEditorFieldModule, DbxFormFormlyTextFieldModule, DbxFormFormlyValueModule, DbxFormFormlyWrapperModule, DbxFormInfoWrapperComponent, DbxFormIoModule, DbxFormLayoutModule, DbxFormLoadingSourceDirective, DbxFormModule, DbxFormRepeatArrayTypeComponent, DbxFormSearchFormComponent, DbxFormSectionWrapperComponent, DbxFormSourceDirective, DbxFormSpacerComponent, DbxFormState, DbxFormSubsectionWrapperComponent, DbxFormToggleWrapperComponent, DbxFormValueChangesDirective, DbxFormWorkingWrapperComponent, DbxFormlyContext, DbxFormlyFieldsContextDirective, DbxFormlyFormComponent, DbxFormlyModule, DbxItemListFieldComponent, DbxMutableForm, DbxPhoneFieldComponent, DbxPickableChipListFieldComponent, DbxPickableListFieldComponent, DbxPickableListFieldItemListComponent, DbxPickableListFieldItemListViewComponent, DbxPickableListFieldItemListViewItemComponent, DbxSearchableChipFieldComponent, DbxSearchableFieldAutocompleteItemComponent, DbxSearchableTextFieldComponent, DbxTextEditorFieldComponent, EXPANDABLE_WRAPPER_KEY, FIELD_VALUES_ARE_EQUAL_VALIDATION_KEY, FIELD_VALUE_IS_AVAILABLE_ERROR_VALIDATION_KEY, FIELD_VALUE_IS_AVAILABLE_VALIDATION_KEY, FLEX_WRAPPER_KEY, INFO_WRAPPER_KEY, INVALID_PHONE_NUMBER_MESSAGE, IS_DIVISIBLE_BY_VALIDATION_KEY, LABEL_STRING_MAX_LENGTH, MAX_LENGTH_VALIDATION_MESSAGE, MAX_VALIDATION_MESSAGE, MIN_LENGTH_VALIDATION_MESSAGE, MIN_VALIDATION_MESSAGE, PHONE_LABEL_MAX_LENGTH, REQUIRED_VALIDATION_MESSAGE, SEARCH_STRING_MAX_LENGTH, SECTION_WRAPPER_KEY, STYLE_WRAPPER_KEY, SUBSECTION_WRAPPER_KEY, TAKE_NEXT_UPCOMING_TIME_CONFIG_OBS, TOGGLE_WRAPPER_KEY, WORKING_WRAPPER_KEY, addValueSelectionOptionFunction, addWrapperToFormlyFieldConfig, addressField, addressFormlyFields, addressLineField, addressListField, autoTouchWrapper, checkIsFieldFlexLayoutGroupFieldConfig, checkboxField, checklistItemField, chipTextField, cityField, componentField, countryField, dateRangeField, dateTimeField, dbxDateTimeInputValueParseFactory, dbxDateTimeOutputValueFactory, dbxFormSearchFormFields, dbxFormSourceObservable, dbxFormSourceObservableFromStream, dbxListField, defaultValidationMessages, disableFormlyFieldAutofillAttributes, dollarAmountField, emailField, expandWrapper, fieldValueIsAvailableValidator, fieldValuesAreEqualValidator, filterPartialPotentialFieldConfigValuesFromObject, filterPickableItemFieldValuesByLabel, filterPickableItemFieldValuesByLabelFilterFunction, flexLayoutWrapper, formlyField, hiddenField, infoWrapper, isDivisibleBy, isDomain, isInRange, isTruthy, latLngTextField, makeMetaFilterSearchableFieldValueDisplayFn, maxLengthValidationMessage, maxValidationMessage, mergePropsValueObjects, minLengthValidationMessage, minValidationMessage, nameField, numberField, numberFieldTransformParser, partialPotentialFieldConfigKeys, partialPotentialFieldConfigKeysFilter, phoneAndLabelSectionField, phoneField, phoneListField, pickableItemChipField, pickableItemListField, propsAndConfigForFieldConfig, propsForFieldConfig, propsValueForFieldConfig, provideDbxForm, provideDbxMutableForm, provideFormlyContext, repeatArrayField, searchableChipField, searchableStringChipField, searchableTextField, sectionWrapper, sortPickableItemsByLabel, sortPickableItemsByLabelStringFunction, stateField, styleWrapper, subsectionWrapper, syncConfigValueObs, textAreaField, textEditorField, textField, textFieldTransformParser, textIsAvailableField, textPasswordField, textPasswordWithVerifyFieldGroup, textVerifyPasswordField, timeOnlyField, timezoneStringField, timezoneStringSearchFunction, toggleField, toggleWrapper, usernamePasswordLoginFields, validatorsForFieldConfig, valueSelectionField, workingWrapper, wrappedPhoneAndLabelField, zipCodeField };
|
|
4866
4928
|
//# sourceMappingURL=dereekb-dbx-form.mjs.map
|