@dereekb/dbx-form 7.0.1 → 7.3.0
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/formly/config/validation.mjs +5 -5
- package/esm2020/lib/formly/field/checklist/checklist.item.field.component.mjs +5 -5
- package/esm2020/lib/formly/field/checklist/checklist.item.field.mjs +4 -5
- package/esm2020/lib/formly/field/field.mjs +15 -9
- package/esm2020/lib/formly/field/selection/pickable/pickable.field.directive.mjs +5 -5
- package/esm2020/lib/formly/field/selection/pickable/pickable.field.mjs +8 -8
- package/esm2020/lib/formly/field/selection/searchable/searchable.chip.field.component.mjs +1 -1
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.directive.mjs +5 -5
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.mjs +8 -8
- package/esm2020/lib/formly/field/selection/searchable/searchable.text.field.component.mjs +2 -2
- package/esm2020/lib/formly/field/selection/searchable/text.chip.field.mjs +5 -5
- package/esm2020/lib/formly/field/texteditor/texteditor.field.component.mjs +3 -3
- package/esm2020/lib/formly/field/texteditor/texteditor.field.mjs +3 -3
- package/esm2020/lib/formly/field/value/array/array.field.component.mjs +3 -3
- package/esm2020/lib/formly/field/value/array/array.field.mjs +3 -3
- package/esm2020/lib/formly/field/value/boolean/boolean.field.mjs +5 -5
- package/esm2020/lib/formly/field/value/date/datetime.field.component.mjs +3 -3
- package/esm2020/lib/formly/field/value/date/datetime.field.mjs +4 -5
- package/esm2020/lib/formly/field/value/enum/enum.field.mjs +2 -2
- package/esm2020/lib/formly/field/value/hidden.field.mjs +2 -2
- package/esm2020/lib/formly/field/value/phone/phone.field.component.mjs +3 -6
- package/esm2020/lib/formly/field/value/phone/phone.field.mjs +4 -5
- package/esm2020/lib/formly/field/value/text/text.address.field.mjs +2 -2
- package/esm2020/lib/formly/field/value/text/text.field.mjs +4 -4
- package/esm2020/lib/formly/field/wrapper/expandable.wrapper.delegate.mjs +4 -4
- package/esm2020/lib/formly/field/wrapper/flex.wrapper.component.mjs +2 -2
- package/esm2020/lib/formly/field/wrapper/form.wrapper.module.mjs +20 -19
- package/esm2020/lib/formly/field/wrapper/info.wrapper.component.mjs +2 -2
- package/esm2020/lib/formly/field/wrapper/section.wrapper.component.mjs +3 -3
- package/esm2020/lib/formly/field/wrapper/style.wrapper.component.mjs +2 -5
- package/esm2020/lib/formly/field/wrapper/subsection.wrapper.component.mjs +3 -3
- package/esm2020/lib/formly/field/wrapper/working.wrapper.component.mjs +1 -1
- package/esm2020/lib/formly/field/wrapper/wrapper.mjs +24 -33
- package/esm2020/lib/formly/template/login.mjs +2 -2
- package/fesm2015/dereekb-dbx-form.mjs +174 -200
- package/fesm2015/dereekb-dbx-form.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form.mjs +180 -192
- package/fesm2020/dereekb-dbx-form.mjs.map +1 -1
- package/lib/formly/field/checklist/checklist.item.field.component.d.ts +4 -7
- package/lib/formly/field/checklist/checklist.item.field.d.ts +4 -3
- package/lib/formly/field/field.d.ts +9 -4
- package/lib/formly/field/selection/pickable/pickable.field.d.ts +2 -2
- package/lib/formly/field/selection/pickable/pickable.field.directive.d.ts +4 -7
- package/lib/formly/field/selection/searchable/searchable.chip.field.component.d.ts +3 -6
- package/lib/formly/field/selection/searchable/searchable.field.d.ts +4 -4
- package/lib/formly/field/selection/searchable/searchable.field.directive.d.ts +5 -10
- package/lib/formly/field/selection/searchable/searchable.text.field.component.d.ts +4 -7
- package/lib/formly/field/selection/searchable/text.chip.field.d.ts +5 -6
- package/lib/formly/field/texteditor/texteditor.field.component.d.ts +3 -3
- package/lib/formly/field/value/array/array.field.d.ts +2 -2
- package/lib/formly/field/value/date/datetime.field.component.d.ts +4 -7
- package/lib/formly/field/value/date/datetime.field.d.ts +3 -3
- package/lib/formly/field/value/phone/phone.field.component.d.ts +6 -9
- package/lib/formly/field/value/phone/phone.field.d.ts +3 -3
- package/lib/formly/field/wrapper/expandable.wrapper.delegate.d.ts +3 -7
- package/lib/formly/field/wrapper/flex.wrapper.component.d.ts +3 -6
- package/lib/formly/field/wrapper/info.wrapper.component.d.ts +3 -6
- package/lib/formly/field/wrapper/section.wrapper.component.d.ts +3 -6
- package/lib/formly/field/wrapper/style.wrapper.component.d.ts +1 -5
- package/lib/formly/field/wrapper/subsection.wrapper.component.d.ts +3 -6
- package/lib/formly/field/wrapper/working.wrapper.component.d.ts +1 -4
- package/lib/formly/field/wrapper/wrapper.d.ts +17 -10
- package/lib/formly/formly.context.d.ts +3 -1
- package/lib/formly/formly.context.directive.d.ts +3 -1
- package/lib/formly/formly.form.component.d.ts +3 -1
- package/package.json +5 -5
|
@@ -26,7 +26,7 @@ import * as i1$2 from '@angular/material/button';
|
|
|
26
26
|
import { MatButtonModule } from '@angular/material/button';
|
|
27
27
|
import * as i3$1 from '@angular/flex-layout/flex';
|
|
28
28
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
29
|
-
import { objectIsEmpty, mergeObjects, filterFromPOJO, addPlusPrefixToNumber, convertMaybeToArray, makeValuesGroupMap, findUnique, mergeIntoArray, lastValue, separateValues, arrayToMap, getValueFromGetter, dateFromLogicalDate, KeyValueTypleValueFilter, valuesFromPOJO, allObjectsAreEqual, capitalizeFirstLetter, BooleanStringKeyArrayUtilityInstance } from '@dereekb/util';
|
|
29
|
+
import { objectIsEmpty, mergeObjectsFunction, filterFromPOJOFunction, mergeObjects, filterFromPOJO, addPlusPrefixToNumber, convertMaybeToArray, makeValuesGroupMap, findUnique, mergeIntoArray, lastValue, separateValues, arrayToMap, getValueFromGetter, dateFromLogicalDate, KeyValueTypleValueFilter, valuesFromPOJO, allObjectsAreEqual, capitalizeFirstLetter, BooleanStringKeyArrayUtilityInstance } from '@dereekb/util';
|
|
30
30
|
import * as i1$3 from '@angular/material/slide-toggle';
|
|
31
31
|
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
32
32
|
import * as i2$2 from '@angular/flex-layout/extended';
|
|
@@ -477,16 +477,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
477
477
|
}] });
|
|
478
478
|
|
|
479
479
|
function minLengthValidationMessage(err, field) {
|
|
480
|
-
return `Should have atleast ${field.
|
|
480
|
+
return `Should have atleast ${field.props.minLength} characters`;
|
|
481
481
|
}
|
|
482
482
|
function maxLengthValidationMessage(err, field) {
|
|
483
|
-
return `This value should be less than ${field.
|
|
483
|
+
return `This value should be less than ${field.props.maxLength} characters`;
|
|
484
484
|
}
|
|
485
485
|
function minValidationMessage(err, field) {
|
|
486
|
-
return `This value should be more than ${field.
|
|
486
|
+
return `This value should be more than ${field.props.min}`;
|
|
487
487
|
}
|
|
488
488
|
function maxValidationMessage(err, field) {
|
|
489
|
-
return `This value should be less than ${field.
|
|
489
|
+
return `This value should be less than ${field.props.max}`;
|
|
490
490
|
}
|
|
491
491
|
const REQUIRED_VALIDATION_MESSAGE = { name: 'required', message: 'This field is required' };
|
|
492
492
|
const MIN_LENGTH_VALIDATION_MESSAGE = { name: 'minLength', message: minLengthValidationMessage };
|
|
@@ -551,19 +551,16 @@ class DbxChecklistItemFieldComponent extends FieldType {
|
|
|
551
551
|
return this.key;
|
|
552
552
|
}
|
|
553
553
|
get label() {
|
|
554
|
-
|
|
555
|
-
return (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.label;
|
|
554
|
+
return this.props.label;
|
|
556
555
|
}
|
|
557
556
|
get description() {
|
|
558
|
-
|
|
559
|
-
return (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.description;
|
|
557
|
+
return this.props.description;
|
|
560
558
|
}
|
|
561
559
|
get required() {
|
|
562
|
-
|
|
563
|
-
return (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.required;
|
|
560
|
+
return this.props.required;
|
|
564
561
|
}
|
|
565
562
|
get checklistField() {
|
|
566
|
-
return this.
|
|
563
|
+
return this.props;
|
|
567
564
|
}
|
|
568
565
|
get errors() {
|
|
569
566
|
var _a;
|
|
@@ -620,7 +617,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
620
617
|
|
|
621
618
|
class DbxFormInfoWrapperComponent extends FieldWrapper {
|
|
622
619
|
get infoWrapper() {
|
|
623
|
-
return this.
|
|
620
|
+
return this.props.infoWrapper;
|
|
624
621
|
}
|
|
625
622
|
onInfoClick() {
|
|
626
623
|
this.infoWrapper.onInfoClick();
|
|
@@ -660,11 +657,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
660
657
|
class DbxFormSectionWrapperComponent extends FieldWrapper {
|
|
661
658
|
get header() {
|
|
662
659
|
var _a;
|
|
663
|
-
return (_a = this.
|
|
660
|
+
return (_a = this.props.sectionWrapper) === null || _a === void 0 ? void 0 : _a.header;
|
|
664
661
|
}
|
|
665
662
|
get hint() {
|
|
666
663
|
var _a;
|
|
667
|
-
return (_a = this.
|
|
664
|
+
return (_a = this.props.sectionWrapper) === null || _a === void 0 ? void 0 : _a.hint;
|
|
668
665
|
}
|
|
669
666
|
}
|
|
670
667
|
DbxFormSectionWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormSectionWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -686,7 +683,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
686
683
|
|
|
687
684
|
class DbxFormFlexWrapperComponent extends FieldWrapper {
|
|
688
685
|
get flexWrapper() {
|
|
689
|
-
return this.
|
|
686
|
+
return this.props.flexWrapper;
|
|
690
687
|
}
|
|
691
688
|
get breakpoint() {
|
|
692
689
|
var _a;
|
|
@@ -717,11 +714,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
717
714
|
class DbxFormSubsectionWrapperComponent extends FieldWrapper {
|
|
718
715
|
get header() {
|
|
719
716
|
var _a;
|
|
720
|
-
return (_a = this.
|
|
717
|
+
return (_a = this.props.subsectionWrapper) === null || _a === void 0 ? void 0 : _a.header;
|
|
721
718
|
}
|
|
722
719
|
get hint() {
|
|
723
720
|
var _a;
|
|
724
|
-
return (_a = this.
|
|
721
|
+
return (_a = this.props.subsectionWrapper) === null || _a === void 0 ? void 0 : _a.hint;
|
|
725
722
|
}
|
|
726
723
|
}
|
|
727
724
|
DbxFormSubsectionWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormSubsectionWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -761,7 +758,7 @@ class AbstractFormExpandableSectionWrapperDirective extends FieldWrapper {
|
|
|
761
758
|
}), shareReplay(1))));
|
|
762
759
|
}
|
|
763
760
|
get expandableSection() {
|
|
764
|
-
return this.
|
|
761
|
+
return this.props.expandWrapper;
|
|
765
762
|
}
|
|
766
763
|
get hasValueFn() {
|
|
767
764
|
var _a, _b;
|
|
@@ -769,11 +766,11 @@ class AbstractFormExpandableSectionWrapperDirective extends FieldWrapper {
|
|
|
769
766
|
}
|
|
770
767
|
get expandLabel() {
|
|
771
768
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
772
|
-
let label = (_b = (_a = this.expandableSection) === null || _a === void 0 ? void 0 : _a.expandLabel) !== null && _b !== void 0 ? _b : (_d = (_c = this.field) === null || _c === void 0 ? void 0 : _c.
|
|
769
|
+
let label = (_b = (_a = this.expandableSection) === null || _a === void 0 ? void 0 : _a.expandLabel) !== null && _b !== void 0 ? _b : (_d = (_c = this.field) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.label;
|
|
773
770
|
if (label == null) {
|
|
774
771
|
const firstFieldGroup = (_e = this.field.fieldGroup) === null || _e === void 0 ? void 0 : _e[0];
|
|
775
772
|
if (firstFieldGroup) {
|
|
776
|
-
label = (_g = (_f = firstFieldGroup.
|
|
773
|
+
label = (_g = (_f = firstFieldGroup.props) === null || _f === void 0 ? void 0 : _f.label) !== null && _g !== void 0 ? _g : firstFieldGroup.key;
|
|
777
774
|
}
|
|
778
775
|
}
|
|
779
776
|
return label;
|
|
@@ -912,11 +909,8 @@ class DbxFormStyleWrapperComponent extends FieldWrapper {
|
|
|
912
909
|
this._style = new BehaviorSubject(undefined);
|
|
913
910
|
this.style$ = this._style.pipe(switchMapMaybeDefault(''), shareReplay(1));
|
|
914
911
|
}
|
|
915
|
-
get styleWrapper() {
|
|
916
|
-
return this.field.styleWrapper;
|
|
917
|
-
}
|
|
918
912
|
get styleGetter() {
|
|
919
|
-
return this.
|
|
913
|
+
return this.props.style;
|
|
920
914
|
}
|
|
921
915
|
ngOnInit() {
|
|
922
916
|
this._style.next(asObservable(this.styleGetter));
|
|
@@ -983,6 +977,80 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
983
977
|
}]
|
|
984
978
|
}] });
|
|
985
979
|
|
|
980
|
+
const AUTO_TOUCH_WRAPPER_KEY = 'autotouch';
|
|
981
|
+
const EXPANDABLE_WRAPPER_KEY = 'expandable';
|
|
982
|
+
const TOGGLE_WRAPPER_KEY = 'toggle';
|
|
983
|
+
const SECTION_WRAPPER_KEY = 'section';
|
|
984
|
+
const SUBSECTION_WRAPPER_KEY = 'subsection';
|
|
985
|
+
const INFO_WRAPPER_KEY = 'info';
|
|
986
|
+
const FLEX_WRAPPER_KEY = 'flex';
|
|
987
|
+
const STYLE_WRAPPER_KEY = 'style';
|
|
988
|
+
const WORKING_WRAPPER_KEY = 'working';
|
|
989
|
+
function addWrapperToFormlyFieldConfig(fieldConfig, wrapperKey, wrapperProps) {
|
|
990
|
+
// ??? can probably remove?
|
|
991
|
+
fieldConfig.props = Object.assign(Object.assign({}, fieldConfig.props), wrapperProps);
|
|
992
|
+
return {
|
|
993
|
+
wrappers: [wrapperKey],
|
|
994
|
+
props: wrapperProps,
|
|
995
|
+
fieldGroup: [fieldConfig]
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
function autoTouchWrapper(fieldConfig, autoTouchWrapper = {}) {
|
|
999
|
+
return addWrapperToFormlyFieldConfig(fieldConfig, AUTO_TOUCH_WRAPPER_KEY, autoTouchWrapper);
|
|
1000
|
+
}
|
|
1001
|
+
function expandWrapper(fieldConfig, expandWrapper = {}) {
|
|
1002
|
+
return addWrapperToFormlyFieldConfig(fieldConfig, EXPANDABLE_WRAPPER_KEY, expandWrapper);
|
|
1003
|
+
}
|
|
1004
|
+
function toggleWrapper(fieldConfig, toggleWrapper = {}) {
|
|
1005
|
+
return addWrapperToFormlyFieldConfig(fieldConfig, TOGGLE_WRAPPER_KEY, toggleWrapper);
|
|
1006
|
+
}
|
|
1007
|
+
function sectionWrapper(fieldConfig, sectionWrapper = {}) {
|
|
1008
|
+
return addWrapperToFormlyFieldConfig(fieldConfig, SECTION_WRAPPER_KEY, sectionWrapper);
|
|
1009
|
+
}
|
|
1010
|
+
function subsectionWrapper(fieldConfig, subsectionWrapper = {}) {
|
|
1011
|
+
return addWrapperToFormlyFieldConfig(fieldConfig, SUBSECTION_WRAPPER_KEY, subsectionWrapper);
|
|
1012
|
+
}
|
|
1013
|
+
function infoWrapper(fieldConfig, infoWrapper) {
|
|
1014
|
+
return addWrapperToFormlyFieldConfig(fieldConfig, INFO_WRAPPER_KEY, infoWrapper);
|
|
1015
|
+
}
|
|
1016
|
+
function styleWrapper(fieldConfig, styleWrapper) {
|
|
1017
|
+
return addWrapperToFormlyFieldConfig(fieldConfig, STYLE_WRAPPER_KEY, styleWrapper);
|
|
1018
|
+
}
|
|
1019
|
+
function workingWrapper(fieldConfig, workingWrapper = {}) {
|
|
1020
|
+
return addWrapperToFormlyFieldConfig(fieldConfig, WORKING_WRAPPER_KEY, workingWrapper);
|
|
1021
|
+
}
|
|
1022
|
+
function checkIsFieldFlexLayoutGroupFieldConfig(input) {
|
|
1023
|
+
if (input.field != null) {
|
|
1024
|
+
return true;
|
|
1025
|
+
}
|
|
1026
|
+
else {
|
|
1027
|
+
return false;
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
function flexLayoutWrapper(fieldConfigs, { relative, breakpoint, size: defaultSize = 2 } = {}) {
|
|
1031
|
+
return {
|
|
1032
|
+
wrappers: ['flex'],
|
|
1033
|
+
fieldGroupClassName: 'dbx-flex-group',
|
|
1034
|
+
// fieldGroupClassName: 'field-layout-group',
|
|
1035
|
+
props: {
|
|
1036
|
+
flexWrapper: {
|
|
1037
|
+
breakpoint,
|
|
1038
|
+
relative
|
|
1039
|
+
}
|
|
1040
|
+
},
|
|
1041
|
+
fieldGroup: fieldConfigs.map((inputConfig) => {
|
|
1042
|
+
const fieldConfig = checkIsFieldFlexLayoutGroupFieldConfig(inputConfig)
|
|
1043
|
+
? inputConfig
|
|
1044
|
+
: {
|
|
1045
|
+
field: inputConfig
|
|
1046
|
+
};
|
|
1047
|
+
const { field, size = defaultSize } = fieldConfig;
|
|
1048
|
+
const className = `dbx-flex-${size}`;
|
|
1049
|
+
return Object.assign(Object.assign({}, field), { className });
|
|
1050
|
+
})
|
|
1051
|
+
};
|
|
1052
|
+
}
|
|
1053
|
+
|
|
986
1054
|
class DbxFormFormlyWrapperModule {
|
|
987
1055
|
}
|
|
988
1056
|
DbxFormFormlyWrapperModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFormFormlyWrapperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -1007,15 +1075,15 @@ DbxFormFormlyWrapperModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.
|
|
|
1007
1075
|
FlexLayoutModule,
|
|
1008
1076
|
FormlyModule.forChild({
|
|
1009
1077
|
wrappers: [
|
|
1010
|
-
{ name:
|
|
1011
|
-
{ name:
|
|
1012
|
-
{ name:
|
|
1013
|
-
{ name:
|
|
1014
|
-
{ name:
|
|
1015
|
-
{ name:
|
|
1016
|
-
{ name:
|
|
1017
|
-
{ name:
|
|
1018
|
-
{ name:
|
|
1078
|
+
{ name: AUTO_TOUCH_WRAPPER_KEY, component: AutoTouchFieldWrapperComponent },
|
|
1079
|
+
{ name: EXPANDABLE_WRAPPER_KEY, component: DbxFormExpandWrapperComponent },
|
|
1080
|
+
{ name: TOGGLE_WRAPPER_KEY, component: DbxFormToggleWrapperComponent },
|
|
1081
|
+
{ name: SECTION_WRAPPER_KEY, component: DbxFormSectionWrapperComponent },
|
|
1082
|
+
{ name: SUBSECTION_WRAPPER_KEY, component: DbxFormSubsectionWrapperComponent },
|
|
1083
|
+
{ name: INFO_WRAPPER_KEY, component: DbxFormInfoWrapperComponent },
|
|
1084
|
+
{ name: FLEX_WRAPPER_KEY, component: DbxFormFlexWrapperComponent },
|
|
1085
|
+
{ name: STYLE_WRAPPER_KEY, component: DbxFormStyleWrapperComponent },
|
|
1086
|
+
{ name: WORKING_WRAPPER_KEY, component: DbxFormWorkingWrapperComponent }
|
|
1019
1087
|
]
|
|
1020
1088
|
})
|
|
1021
1089
|
]] });
|
|
@@ -1034,15 +1102,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1034
1102
|
FlexLayoutModule,
|
|
1035
1103
|
FormlyModule.forChild({
|
|
1036
1104
|
wrappers: [
|
|
1037
|
-
{ name:
|
|
1038
|
-
{ name:
|
|
1039
|
-
{ name:
|
|
1040
|
-
{ name:
|
|
1041
|
-
{ name:
|
|
1042
|
-
{ name:
|
|
1043
|
-
{ name:
|
|
1044
|
-
{ name:
|
|
1045
|
-
{ name:
|
|
1105
|
+
{ name: AUTO_TOUCH_WRAPPER_KEY, component: AutoTouchFieldWrapperComponent },
|
|
1106
|
+
{ name: EXPANDABLE_WRAPPER_KEY, component: DbxFormExpandWrapperComponent },
|
|
1107
|
+
{ name: TOGGLE_WRAPPER_KEY, component: DbxFormToggleWrapperComponent },
|
|
1108
|
+
{ name: SECTION_WRAPPER_KEY, component: DbxFormSectionWrapperComponent },
|
|
1109
|
+
{ name: SUBSECTION_WRAPPER_KEY, component: DbxFormSubsectionWrapperComponent },
|
|
1110
|
+
{ name: INFO_WRAPPER_KEY, component: DbxFormInfoWrapperComponent },
|
|
1111
|
+
{ name: FLEX_WRAPPER_KEY, component: DbxFormFlexWrapperComponent },
|
|
1112
|
+
{ name: STYLE_WRAPPER_KEY, component: DbxFormStyleWrapperComponent },
|
|
1113
|
+
{ name: WORKING_WRAPPER_KEY, component: DbxFormWorkingWrapperComponent }
|
|
1046
1114
|
]
|
|
1047
1115
|
})
|
|
1048
1116
|
],
|
|
@@ -1115,16 +1183,22 @@ function formlyField(fieldConfig) {
|
|
|
1115
1183
|
}
|
|
1116
1184
|
return fieldConfig;
|
|
1117
1185
|
}
|
|
1118
|
-
function
|
|
1119
|
-
const
|
|
1186
|
+
function propsForFieldConfig(fieldConfig, override) {
|
|
1187
|
+
const props = propsValueForFieldConfig(fieldConfig, override);
|
|
1120
1188
|
return {
|
|
1121
|
-
|
|
1189
|
+
props
|
|
1122
1190
|
};
|
|
1123
1191
|
}
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1192
|
+
const partialPotentialFieldConfigKeys = ['label', 'placeholder', 'required', 'readonly', 'description', 'autocomplete'];
|
|
1193
|
+
const partialPotentialFieldConfigKeysFilter = {
|
|
1194
|
+
keysFilter: partialPotentialFieldConfigKeys
|
|
1195
|
+
};
|
|
1196
|
+
const mergePropsValueObjects = mergeObjectsFunction(partialPotentialFieldConfigKeysFilter);
|
|
1197
|
+
const filterPartialPotentialFieldConfigValuesFromObject = filterFromPOJOFunction({
|
|
1198
|
+
filter: partialPotentialFieldConfigKeysFilter
|
|
1199
|
+
});
|
|
1200
|
+
function propsValueForFieldConfig(fieldConfig, override) {
|
|
1201
|
+
const { label, placeholder, required, readonly, description, autocomplete } = mergePropsValueObjects([fieldConfig, override]);
|
|
1128
1202
|
const attributes = mergeObjects([fieldConfig.attributes, override === null || override === void 0 ? void 0 : override.attributes]);
|
|
1129
1203
|
const result = filterFromPOJO(Object.assign(Object.assign({}, override), { label,
|
|
1130
1204
|
placeholder,
|
|
@@ -1156,10 +1230,10 @@ function disableFormlyFieldAutofillAttributes() {
|
|
|
1156
1230
|
|
|
1157
1231
|
function checklistItemField(config) {
|
|
1158
1232
|
const { key, displayContentObs, componentClass } = config;
|
|
1159
|
-
const fieldConfig = formlyField(Object.assign({ key, type: 'checklistitem',
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1233
|
+
const fieldConfig = formlyField(Object.assign({ key, type: 'checklistitem' }, propsForFieldConfig(config, {
|
|
1234
|
+
displayContentObs,
|
|
1235
|
+
componentClass
|
|
1236
|
+
})));
|
|
1163
1237
|
return fieldConfig;
|
|
1164
1238
|
}
|
|
1165
1239
|
|
|
@@ -1368,14 +1442,13 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
|
1368
1442
|
this.noItemsAvailable$ = this.filterItemsLoadingState$.pipe(isListLoadingStateEmpty(), distinctUntilChanged());
|
|
1369
1443
|
}
|
|
1370
1444
|
get readonly() {
|
|
1371
|
-
|
|
1372
|
-
return (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.readonly;
|
|
1445
|
+
return this.props.readonly;
|
|
1373
1446
|
}
|
|
1374
1447
|
get isReadonlyOrDisabled() {
|
|
1375
1448
|
return this.readonly || this.disabled;
|
|
1376
1449
|
}
|
|
1377
1450
|
get pickableField() {
|
|
1378
|
-
return this.
|
|
1451
|
+
return this.props;
|
|
1379
1452
|
}
|
|
1380
1453
|
get multiSelect() {
|
|
1381
1454
|
var _a;
|
|
@@ -1393,12 +1466,11 @@ class AbstractDbxPickableItemFieldDirective extends FieldType$1 {
|
|
|
1393
1466
|
return (_a = this.field.name) !== null && _a !== void 0 ? _a : camelCase((_b = this.label) !== null && _b !== void 0 ? _b : this.key);
|
|
1394
1467
|
}
|
|
1395
1468
|
get label() {
|
|
1396
|
-
|
|
1397
|
-
return (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.label;
|
|
1469
|
+
return this.props.label;
|
|
1398
1470
|
}
|
|
1399
1471
|
get autocomplete() {
|
|
1400
|
-
var _a, _b
|
|
1401
|
-
return ((
|
|
1472
|
+
var _a, _b;
|
|
1473
|
+
return ((_b = (_a = this.props.attributes) === null || _a === void 0 ? void 0 : _a['autocomplete']) !== null && _b !== void 0 ? _b : this.key);
|
|
1402
1474
|
}
|
|
1403
1475
|
get changeSelectionModeToViewOnDisabled() {
|
|
1404
1476
|
var _a;
|
|
@@ -1758,15 +1830,11 @@ function sortPickableItemsByLabel(chips) {
|
|
|
1758
1830
|
}
|
|
1759
1831
|
function pickableItemChipField(config) {
|
|
1760
1832
|
const { key } = config;
|
|
1761
|
-
return formlyField(Object.assign(
|
|
1762
|
-
autocomplete: false
|
|
1763
|
-
})), { pickableField: config }));
|
|
1833
|
+
return formlyField(Object.assign({ key, type: 'pickablechipfield' }, propsForFieldConfig(config, Object.assign(Object.assign({}, config), { autocomplete: false }))));
|
|
1764
1834
|
}
|
|
1765
1835
|
function pickableItemListField(config) {
|
|
1766
1836
|
const { key } = config;
|
|
1767
|
-
return formlyField(Object.assign(
|
|
1768
|
-
autocomplete: false
|
|
1769
|
-
})), { pickableField: config }));
|
|
1837
|
+
return formlyField(Object.assign({ key, type: 'pickablelistfield' }, propsForFieldConfig(config, Object.assign(Object.assign({}, config), { autocomplete: false }))));
|
|
1770
1838
|
}
|
|
1771
1839
|
|
|
1772
1840
|
const DBX_SEARCHABLE_FIELD_COMPONENT_DATA_TOKEN = new InjectionToken('DbxSearchableField');
|
|
@@ -1884,23 +1952,21 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType$1 {
|
|
|
1884
1952
|
return (_a = this.field.name) !== null && _a !== void 0 ? _a : camelCase((_b = this.label) !== null && _b !== void 0 ? _b : this.key);
|
|
1885
1953
|
}
|
|
1886
1954
|
get label() {
|
|
1887
|
-
|
|
1888
|
-
return (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.label;
|
|
1955
|
+
return this.props.label;
|
|
1889
1956
|
}
|
|
1890
1957
|
get readonly() {
|
|
1891
|
-
|
|
1892
|
-
return (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.readonly;
|
|
1958
|
+
return this.props.readonly;
|
|
1893
1959
|
}
|
|
1894
1960
|
get searchableField() {
|
|
1895
|
-
return this.
|
|
1961
|
+
return this.props;
|
|
1896
1962
|
}
|
|
1897
1963
|
get searchOnEmptyText() {
|
|
1898
1964
|
var _a;
|
|
1899
1965
|
return (_a = this.searchableField.searchOnEmptyText) !== null && _a !== void 0 ? _a : false;
|
|
1900
1966
|
}
|
|
1901
1967
|
get autocomplete() {
|
|
1902
|
-
var _a, _b
|
|
1903
|
-
return ((
|
|
1968
|
+
var _a, _b;
|
|
1969
|
+
return ((_b = (_a = this.props.attributes) === null || _a === void 0 ? void 0 : _a['autocomplete']) !== null && _b !== void 0 ? _b : this.key);
|
|
1904
1970
|
}
|
|
1905
1971
|
get hashForValue() {
|
|
1906
1972
|
var _a;
|
|
@@ -2184,16 +2250,11 @@ function searchableStringChipField(config) {
|
|
|
2184
2250
|
}
|
|
2185
2251
|
function searchableChipField(config) {
|
|
2186
2252
|
const { key, placeholder } = config;
|
|
2187
|
-
return formlyField(Object.assign(
|
|
2188
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Add...',
|
|
2189
|
-
autocomplete: false
|
|
2190
|
-
})), { searchableField: config }));
|
|
2253
|
+
return formlyField(Object.assign({ key, type: 'searchablechipfield' }, propsForFieldConfig(config, Object.assign(Object.assign({}, config), { placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Add...', autocomplete: false }))));
|
|
2191
2254
|
}
|
|
2192
2255
|
function searchableTextField(config) {
|
|
2193
2256
|
const { key } = config;
|
|
2194
|
-
return formlyField(Object.assign(
|
|
2195
|
-
autocomplete: false
|
|
2196
|
-
})), { searchableField: config }));
|
|
2257
|
+
return formlyField(Object.assign({ key, type: 'searchabletextfield' }, propsForFieldConfig(config, Object.assign(Object.assign({}, config), { autocomplete: false }))));
|
|
2197
2258
|
}
|
|
2198
2259
|
|
|
2199
2260
|
/**
|
|
@@ -2209,7 +2270,7 @@ class DbxSearchableTextFieldComponent extends AbstractDbxSearchableValueFieldDir
|
|
|
2209
2270
|
this._clearInputSub = new SubscriptionObject();
|
|
2210
2271
|
}
|
|
2211
2272
|
get searchableField() {
|
|
2212
|
-
return this.
|
|
2273
|
+
return this.props;
|
|
2213
2274
|
}
|
|
2214
2275
|
get showSelectedValue() {
|
|
2215
2276
|
var _a;
|
|
@@ -2315,7 +2376,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2315
2376
|
|
|
2316
2377
|
function chipTextField(config) {
|
|
2317
2378
|
const convertStringValue = config.caseSensitive ? (x) => x : (x) => x === null || x === void 0 ? void 0 : x.toLowerCase();
|
|
2318
|
-
return
|
|
2379
|
+
return searchableChipField(Object.assign(Object.assign({ search: () => of([]) }, config), { allowStringValues: true, convertStringValue, displayForValue: (values) => {
|
|
2319
2380
|
return of(values.map((x) => (Object.assign(Object.assign({}, x), { label: x.value }))));
|
|
2320
2381
|
} }));
|
|
2321
2382
|
}
|
|
@@ -2355,10 +2416,10 @@ class DbxTextEditorFieldComponent extends FieldType$1 {
|
|
|
2355
2416
|
}
|
|
2356
2417
|
get label() {
|
|
2357
2418
|
var _a;
|
|
2358
|
-
return (_a = this.field.
|
|
2419
|
+
return (_a = this.field.props) === null || _a === void 0 ? void 0 : _a.label;
|
|
2359
2420
|
}
|
|
2360
2421
|
get description() {
|
|
2361
|
-
return this.
|
|
2422
|
+
return this.props.description;
|
|
2362
2423
|
}
|
|
2363
2424
|
ngOnInit() {
|
|
2364
2425
|
this._editor = new Editor({});
|
|
@@ -2466,7 +2527,7 @@ function textEditorField(config) {
|
|
|
2466
2527
|
// https://formly.dev/examples/validation/async-validation-update-on
|
|
2467
2528
|
// Set to trigger value update on blurs with the form. However, the value is set internally too.
|
|
2468
2529
|
updateOn: 'blur'
|
|
2469
|
-
} },
|
|
2530
|
+
} }, propsForFieldConfig(config, {
|
|
2470
2531
|
minLength,
|
|
2471
2532
|
maxLength
|
|
2472
2533
|
})));
|
|
@@ -2479,7 +2540,7 @@ class DbxFormRepeatArrayTypeComponent extends FieldArrayType {
|
|
|
2479
2540
|
}
|
|
2480
2541
|
get label() {
|
|
2481
2542
|
var _a;
|
|
2482
|
-
return (_a = this.field.
|
|
2543
|
+
return (_a = this.field.props.label) !== null && _a !== void 0 ? _a : this.field.key;
|
|
2483
2544
|
}
|
|
2484
2545
|
get addText() {
|
|
2485
2546
|
var _a;
|
|
@@ -2491,7 +2552,7 @@ class DbxFormRepeatArrayTypeComponent extends FieldArrayType {
|
|
|
2491
2552
|
}
|
|
2492
2553
|
get max() {
|
|
2493
2554
|
var _a;
|
|
2494
|
-
return (_a = this.field.
|
|
2555
|
+
return (_a = this.field.props) === null || _a === void 0 ? void 0 : _a.maxLength;
|
|
2495
2556
|
}
|
|
2496
2557
|
get count() {
|
|
2497
2558
|
var _a, _b;
|
|
@@ -2655,7 +2716,7 @@ function repeatArrayField(config) {
|
|
|
2655
2716
|
labelForField,
|
|
2656
2717
|
addText,
|
|
2657
2718
|
removeText
|
|
2658
|
-
} },
|
|
2719
|
+
} }, propsForFieldConfig(config, {
|
|
2659
2720
|
maxLength
|
|
2660
2721
|
})), { fieldArray: {
|
|
2661
2722
|
fieldGroup: repeatFieldGroup
|
|
@@ -2678,11 +2739,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2678
2739
|
|
|
2679
2740
|
function toggleField(config) {
|
|
2680
2741
|
const { key, defaultValue } = config;
|
|
2681
|
-
return formlyField(Object.assign({ key, type: 'toggle', wrappers: ['autotouch', 'form-field'], defaultValue: defaultValue !== null && defaultValue !== void 0 ? defaultValue : false },
|
|
2742
|
+
return formlyField(Object.assign({ key, type: 'toggle', wrappers: ['autotouch', 'form-field'], defaultValue: defaultValue !== null && defaultValue !== void 0 ? defaultValue : false }, propsForFieldConfig(config)));
|
|
2682
2743
|
}
|
|
2683
2744
|
function checkboxField(config) {
|
|
2684
2745
|
const { key, defaultValue } = config;
|
|
2685
|
-
return formlyField(Object.assign({ key, type: 'checkbox', defaultValue: defaultValue !== null && defaultValue !== void 0 ? defaultValue : false },
|
|
2746
|
+
return formlyField(Object.assign({ key, type: 'checkbox', defaultValue: defaultValue !== null && defaultValue !== void 0 ? defaultValue : false }, propsForFieldConfig(config)));
|
|
2686
2747
|
}
|
|
2687
2748
|
/*
|
|
2688
2749
|
export function acceptTermsField({ key = 'accept', label = 'Accept Terms', description = 'In order to proceed, please accept terms', required = true }
|
|
@@ -2690,7 +2751,7 @@ export function acceptTermsField({ key = 'accept', label = 'Accept Terms', descr
|
|
|
2690
2751
|
return {
|
|
2691
2752
|
key,
|
|
2692
2753
|
type: 'checkbox',
|
|
2693
|
-
|
|
2754
|
+
props: {
|
|
2694
2755
|
label,
|
|
2695
2756
|
description,
|
|
2696
2757
|
pattern: 'true',
|
|
@@ -2795,7 +2856,7 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2795
2856
|
return this.timeMode === DbxDateTimeFieldTimeMode.NONE;
|
|
2796
2857
|
}
|
|
2797
2858
|
get dateTimeField() {
|
|
2798
|
-
return this.field.
|
|
2859
|
+
return this.field.props;
|
|
2799
2860
|
}
|
|
2800
2861
|
get timeOnly() {
|
|
2801
2862
|
return this.dateTimeField.timeOnly;
|
|
@@ -2808,8 +2869,7 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2808
2869
|
return this.timeOnly ? DbxDateTimeFieldTimeMode.REQUIRED : (_a = this.dateTimeField.timeMode) !== null && _a !== void 0 ? _a : DbxDateTimeFieldTimeMode.REQUIRED;
|
|
2809
2870
|
}
|
|
2810
2871
|
get description() {
|
|
2811
|
-
|
|
2812
|
-
return (_a = this.field.templateOptions) === null || _a === void 0 ? void 0 : _a.description;
|
|
2872
|
+
return this.field.props.description;
|
|
2813
2873
|
}
|
|
2814
2874
|
ngOnInit() {
|
|
2815
2875
|
var _a, _b;
|
|
@@ -3018,12 +3078,12 @@ function timeOnlyField(config = {}) {
|
|
|
3018
3078
|
}
|
|
3019
3079
|
function dateTimeField(config = {}) {
|
|
3020
3080
|
const { key = 'date', timeMode = DbxDateTimeFieldTimeMode.REQUIRED, fullDayFieldName, getConfigObs, timeOnly = false } = config;
|
|
3021
|
-
const fieldConfig = formlyField(Object.assign(Object.assign({ key, type: 'datetime',
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3081
|
+
const fieldConfig = formlyField(Object.assign(Object.assign({ key, type: 'datetime' }, propsForFieldConfig(config, {
|
|
3082
|
+
timeMode: timeOnly ? DbxDateTimeFieldTimeMode.REQUIRED : timeMode,
|
|
3083
|
+
fullDayFieldName,
|
|
3084
|
+
getConfigObs,
|
|
3085
|
+
timeOnly
|
|
3086
|
+
})), { styleWrapper: {
|
|
3027
3087
|
style: 'dbx-datetime-parent-form-field'
|
|
3028
3088
|
} }));
|
|
3029
3089
|
return fieldConfig;
|
|
@@ -3033,7 +3093,7 @@ function staticEnumField({ key, label = '', placeholder = '', description, multi
|
|
|
3033
3093
|
const fieldConfig = formlyField({
|
|
3034
3094
|
key,
|
|
3035
3095
|
type: 'select',
|
|
3036
|
-
|
|
3096
|
+
props: {
|
|
3037
3097
|
label,
|
|
3038
3098
|
description,
|
|
3039
3099
|
placeholder,
|
|
@@ -3064,16 +3124,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
3064
3124
|
|
|
3065
3125
|
const DEFAULT_PREFERRED_COUNTRIES = ['us'];
|
|
3066
3126
|
class DbxPhoneFieldComponent extends FieldType$1 {
|
|
3067
|
-
get phoneField() {
|
|
3068
|
-
return this.field.phoneField;
|
|
3069
|
-
}
|
|
3070
3127
|
get preferredCountries() {
|
|
3071
3128
|
var _a;
|
|
3072
|
-
return (_a = this.
|
|
3129
|
+
return (_a = this.props.preferredCountries) !== null && _a !== void 0 ? _a : DEFAULT_PREFERRED_COUNTRIES;
|
|
3073
3130
|
}
|
|
3074
3131
|
get onlyCountries() {
|
|
3075
3132
|
var _a;
|
|
3076
|
-
return (_a = this.
|
|
3133
|
+
return (_a = this.props.onlyCountries) !== null && _a !== void 0 ? _a : [];
|
|
3077
3134
|
}
|
|
3078
3135
|
}
|
|
3079
3136
|
DbxPhoneFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPhoneFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -3137,92 +3194,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
3137
3194
|
}]
|
|
3138
3195
|
}] });
|
|
3139
3196
|
|
|
3140
|
-
const EXPANDABLE_WRAPPER_KEY = 'expandable';
|
|
3141
|
-
const TOGGLE_WRAPPER_KEY = 'toggle';
|
|
3142
|
-
const SECTION_WRAPPER_KEY = 'section';
|
|
3143
|
-
const SUBSECTION_WRAPPER_KEY = 'subsection';
|
|
3144
|
-
const INFO_WRAPPER_KEY = 'info';
|
|
3145
|
-
const FLEX_WRAPPER_KEY = 'flex';
|
|
3146
|
-
const STYLE_WRAPPER_KEY = 'style';
|
|
3147
|
-
const WORKING_WRAPPER_KEY = 'working';
|
|
3148
|
-
function addWrapperToFormlyFieldConfig(fieldConfig, wrapperKey, wrapperTemplateOptionsConfig) {
|
|
3149
|
-
fieldConfig.templateOptions = Object.assign(Object.assign({}, fieldConfig.templateOptions), wrapperTemplateOptionsConfig);
|
|
3150
|
-
return {
|
|
3151
|
-
wrappers: [wrapperKey],
|
|
3152
|
-
templateOptions: wrapperTemplateOptionsConfig,
|
|
3153
|
-
fieldGroup: [fieldConfig]
|
|
3154
|
-
};
|
|
3155
|
-
}
|
|
3156
|
-
function expandWrapper(fieldConfig, expandWrapper) {
|
|
3157
|
-
return addWrapperToFormlyFieldConfig(fieldConfig, EXPANDABLE_WRAPPER_KEY, {
|
|
3158
|
-
expandWrapper
|
|
3159
|
-
});
|
|
3160
|
-
}
|
|
3161
|
-
function toggleWrapper(fieldConfig, expandWrapper) {
|
|
3162
|
-
return addWrapperToFormlyFieldConfig(fieldConfig, TOGGLE_WRAPPER_KEY, {
|
|
3163
|
-
expandWrapper
|
|
3164
|
-
});
|
|
3165
|
-
}
|
|
3166
|
-
function sectionWrapper(fieldConfig, sectionWrapper) {
|
|
3167
|
-
return addWrapperToFormlyFieldConfig(fieldConfig, SECTION_WRAPPER_KEY, {
|
|
3168
|
-
sectionWrapper
|
|
3169
|
-
});
|
|
3170
|
-
}
|
|
3171
|
-
function subsectionWrapper(fieldConfig, subsectionWrapper) {
|
|
3172
|
-
return addWrapperToFormlyFieldConfig(fieldConfig, SUBSECTION_WRAPPER_KEY, {
|
|
3173
|
-
subsectionWrapper
|
|
3174
|
-
});
|
|
3175
|
-
}
|
|
3176
|
-
function infoWrapper(fieldConfig, infoWrapper) {
|
|
3177
|
-
return addWrapperToFormlyFieldConfig(fieldConfig, INFO_WRAPPER_KEY, {
|
|
3178
|
-
infoWrapper
|
|
3179
|
-
});
|
|
3180
|
-
}
|
|
3181
|
-
function styleWrapper(fieldConfig, styleWrapper) {
|
|
3182
|
-
return addWrapperToFormlyFieldConfig(fieldConfig, STYLE_WRAPPER_KEY, {
|
|
3183
|
-
styleWrapper
|
|
3184
|
-
});
|
|
3185
|
-
}
|
|
3186
|
-
function workingWrapper(fieldConfig, workingWrapper) {
|
|
3187
|
-
return addWrapperToFormlyFieldConfig(fieldConfig, WORKING_WRAPPER_KEY, {
|
|
3188
|
-
workingWrapper
|
|
3189
|
-
});
|
|
3190
|
-
}
|
|
3191
|
-
function checkIsFieldFlexLayoutGroupFieldConfig(input) {
|
|
3192
|
-
if (input.field != null) {
|
|
3193
|
-
return true;
|
|
3194
|
-
}
|
|
3195
|
-
else {
|
|
3196
|
-
return false;
|
|
3197
|
-
}
|
|
3198
|
-
}
|
|
3199
|
-
function flexLayoutWrapper(fieldConfigs, { relative, breakpoint, size: defaultSize = 2 } = {}) {
|
|
3200
|
-
return {
|
|
3201
|
-
wrappers: ['flex'],
|
|
3202
|
-
fieldGroupClassName: 'dbx-flex-group',
|
|
3203
|
-
// fieldGroupClassName: 'field-layout-group',
|
|
3204
|
-
templateOptions: {
|
|
3205
|
-
flexWrapper: {
|
|
3206
|
-
breakpoint,
|
|
3207
|
-
relative
|
|
3208
|
-
}
|
|
3209
|
-
},
|
|
3210
|
-
fieldGroup: fieldConfigs.map((inputConfig) => {
|
|
3211
|
-
const fieldConfig = checkIsFieldFlexLayoutGroupFieldConfig(inputConfig)
|
|
3212
|
-
? inputConfig
|
|
3213
|
-
: {
|
|
3214
|
-
field: inputConfig
|
|
3215
|
-
};
|
|
3216
|
-
const { field, size = defaultSize } = fieldConfig;
|
|
3217
|
-
const className = `dbx-flex-${size}`;
|
|
3218
|
-
return Object.assign(Object.assign({}, field), { className });
|
|
3219
|
-
})
|
|
3220
|
-
};
|
|
3221
|
-
}
|
|
3222
|
-
|
|
3223
3197
|
function textField(config) {
|
|
3224
3198
|
const { key, pattern, minLength, maxLength = 1000, inputType: type = 'text' } = config;
|
|
3225
|
-
return formlyField(Object.assign({ key, type: 'input' },
|
|
3199
|
+
return formlyField(Object.assign({ key, type: 'input' }, propsForFieldConfig(config, {
|
|
3226
3200
|
type,
|
|
3227
3201
|
minLength,
|
|
3228
3202
|
maxLength,
|
|
@@ -3231,7 +3205,7 @@ function textField(config) {
|
|
|
3231
3205
|
}
|
|
3232
3206
|
function textAreaField(config) {
|
|
3233
3207
|
const { key, rows = 3, minLength, maxLength = 1000 } = config;
|
|
3234
|
-
return formlyField(Object.assign({ key, type: 'textarea' },
|
|
3208
|
+
return formlyField(Object.assign({ key, type: 'textarea' }, propsForFieldConfig(config, {
|
|
3235
3209
|
rows,
|
|
3236
3210
|
minLength,
|
|
3237
3211
|
maxLength
|
|
@@ -3240,10 +3214,10 @@ function textAreaField(config) {
|
|
|
3240
3214
|
|
|
3241
3215
|
function phoneField(config = {}) {
|
|
3242
3216
|
const { key = 'phone', preferredCountries, onlyCountries } = config;
|
|
3243
|
-
const fieldConfig = formlyField(Object.assign({ key, type: 'intphone',
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3217
|
+
const fieldConfig = formlyField(Object.assign({ key, type: 'intphone' }, propsForFieldConfig(config, {
|
|
3218
|
+
preferredCountries,
|
|
3219
|
+
onlyCountries
|
|
3220
|
+
})));
|
|
3247
3221
|
return fieldConfig;
|
|
3248
3222
|
}
|
|
3249
3223
|
/**
|
|
@@ -3391,7 +3365,7 @@ function addressField({ key = 'address', required = false } = {}) {
|
|
|
3391
3365
|
return {
|
|
3392
3366
|
key,
|
|
3393
3367
|
wrappers: ['section'],
|
|
3394
|
-
|
|
3368
|
+
props: {
|
|
3395
3369
|
label: 'Address',
|
|
3396
3370
|
placeholder: '',
|
|
3397
3371
|
required
|
|
@@ -3429,7 +3403,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
3429
3403
|
function hiddenField({ key, required = false }) {
|
|
3430
3404
|
return formlyField({
|
|
3431
3405
|
key,
|
|
3432
|
-
|
|
3406
|
+
props: { required }
|
|
3433
3407
|
});
|
|
3434
3408
|
}
|
|
3435
3409
|
|
|
@@ -3513,7 +3487,7 @@ function textPasswordWithVerifyFieldGroup(config) {
|
|
|
3513
3487
|
var _a, _b, _c, _d, _e;
|
|
3514
3488
|
const passwordFieldConfig = textPasswordField(config.password);
|
|
3515
3489
|
const verifyPasswordFieldKey = (_b = (_a = config.verifyPassword) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : `verify${capitalizeFirstLetter(String(passwordFieldConfig.key))}`;
|
|
3516
|
-
const verifyPasswordField = textVerifyPasswordField(Object.assign(Object.assign(Object.assign({}, config.password), config.verifyPassword), { label: (_d = (_c = config.verifyPassword) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : `Verify ${(_e = passwordFieldConfig.
|
|
3490
|
+
const verifyPasswordField = textVerifyPasswordField(Object.assign(Object.assign(Object.assign({}, config.password), config.verifyPassword), { label: (_d = (_c = config.verifyPassword) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : `Verify ${(_e = passwordFieldConfig.props) === null || _e === void 0 ? void 0 : _e.label}`, key: verifyPasswordFieldKey }));
|
|
3517
3491
|
const validators = {
|
|
3518
3492
|
validation: [
|
|
3519
3493
|
{
|
|
@@ -4105,5 +4079,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
4105
4079
|
* Generated bundle index. Do not edit.
|
|
4106
4080
|
*/
|
|
4107
4081
|
|
|
4108
|
-
export { ADDRESS_CITY_MAX_LENGTH, ADDRESS_COUNTRY_MAX_LENGTH, ADDRESS_LINE_MAX_LENGTH, ADDRESS_STATE_MAX_LENGTH, ADDRESS_ZIP_MAX_LENGTH, APP_ACTION_FORM_DISABLED_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_PREFERRED_COUNTRIES, DOMAIN_NAME_REGEX, DbxActionFormDirective, DbxActionFormSafetyDirective, DbxChecklistItemContentComponent, DbxChecklistItemFieldComponent, DbxDateTimeFieldComponent, DbxDateTimeFieldTimeMode, DbxDefaultChecklistItemFieldDisplayComponent, DbxDefaultSearchableFieldDisplayComponent, DbxForm, DbxFormActionModule, DbxFormActionTransitionModule, DbxFormComponentFieldComponent, DbxFormExpandWrapperComponent, DbxFormExtensionModule, DbxFormFlexWrapperComponent, DbxFormFormlyArrayFieldModule, DbxFormFormlyBooleanFieldModule, DbxFormFormlyChecklistItemFieldModule, DbxFormFormlyComponentFieldModule, DbxFormFormlyDateFieldModule, DbxFormFormlyEnumFieldModule, DbxFormFormlyFieldModule, 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, 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, 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, addWrapperToFormlyFieldConfig, addressField, addressFormlyFields, addressListField, checkIsFieldFlexLayoutGroupFieldConfig, checkboxField, checklistItemField, chipTextField, cityField, componentField, countryField, dateTimeField, dbxFormSourceObservable, defaultValidationMessages, disableFormlyFieldAutofillAttributes, emailField, expandWrapper, fieldValueIsAvailableValidator, fieldValuesAreEqualValidator, filterPickableItemFieldValuesByLabel, flexLayoutWrapper, formlyField, hiddenField, infoWrapper, isDomain, isInRange, isTruthy, makeMetaFilterSearchableFieldValueDisplayFn, maxLengthValidationMessage, maxValidationMessage, minLengthValidationMessage, minValidationMessage, nameField, phoneAndLabelSectionField, phoneField, phoneListField, pickableItemChipField, pickableItemListField, provideDbxForm, provideDbxMutableForm, provideFormlyContext, repeatArrayField, searchableChipField, searchableStringChipField, searchableTextField, sectionWrapper, sortPickableItemsByLabel, stateField, staticEnumField, styleWrapper, subsectionWrapper,
|
|
4082
|
+
export { ADDRESS_CITY_MAX_LENGTH, ADDRESS_COUNTRY_MAX_LENGTH, ADDRESS_LINE_MAX_LENGTH, ADDRESS_STATE_MAX_LENGTH, ADDRESS_ZIP_MAX_LENGTH, 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_PREFERRED_COUNTRIES, DOMAIN_NAME_REGEX, DbxActionFormDirective, DbxActionFormSafetyDirective, DbxChecklistItemContentComponent, DbxChecklistItemFieldComponent, DbxDateTimeFieldComponent, DbxDateTimeFieldTimeMode, DbxDefaultChecklistItemFieldDisplayComponent, DbxDefaultSearchableFieldDisplayComponent, DbxForm, DbxFormActionModule, DbxFormActionTransitionModule, DbxFormComponentFieldComponent, DbxFormExpandWrapperComponent, DbxFormExtensionModule, DbxFormFlexWrapperComponent, DbxFormFormlyArrayFieldModule, DbxFormFormlyBooleanFieldModule, DbxFormFormlyChecklistItemFieldModule, DbxFormFormlyComponentFieldModule, DbxFormFormlyDateFieldModule, DbxFormFormlyEnumFieldModule, DbxFormFormlyFieldModule, 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, 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, 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, addWrapperToFormlyFieldConfig, addressField, addressFormlyFields, addressListField, autoTouchWrapper, checkIsFieldFlexLayoutGroupFieldConfig, checkboxField, checklistItemField, chipTextField, cityField, componentField, countryField, dateTimeField, dbxFormSourceObservable, defaultValidationMessages, disableFormlyFieldAutofillAttributes, emailField, expandWrapper, fieldValueIsAvailableValidator, fieldValuesAreEqualValidator, filterPartialPotentialFieldConfigValuesFromObject, filterPickableItemFieldValuesByLabel, flexLayoutWrapper, formlyField, hiddenField, infoWrapper, isDomain, isInRange, isTruthy, makeMetaFilterSearchableFieldValueDisplayFn, maxLengthValidationMessage, maxValidationMessage, mergePropsValueObjects, minLengthValidationMessage, minValidationMessage, nameField, partialPotentialFieldConfigKeys, partialPotentialFieldConfigKeysFilter, phoneAndLabelSectionField, phoneField, phoneListField, pickableItemChipField, pickableItemListField, propsForFieldConfig, propsValueForFieldConfig, provideDbxForm, provideDbxMutableForm, provideFormlyContext, repeatArrayField, searchableChipField, searchableStringChipField, searchableTextField, sectionWrapper, sortPickableItemsByLabel, stateField, staticEnumField, styleWrapper, subsectionWrapper, textAreaField, textEditorField, textField, textIsAvailableField, textPasswordField, textPasswordWithVerifyFieldGroup, textVerifyPasswordField, timeOnlyField, toggleField, toggleWrapper, usernamePasswordLoginFields, workingWrapper, wrappedPhoneAndLabelField, zipCodeField };
|
|
4109
4083
|
//# sourceMappingURL=dereekb-dbx-form.mjs.map
|