@dereekb/dbx-form 2.0.0 → 2.1.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/form/action/form.action.directive.mjs +1 -1
- package/esm2020/lib/formly/field/value/date/datetime.field.component.mjs +15 -15
- package/esm2020/lib/formly/field/value/date/datetime.field.mjs +5 -5
- package/fesm2015/dereekb-dbx-form.mjs +18 -18
- package/fesm2015/dereekb-dbx-form.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form.mjs +18 -18
- package/fesm2020/dereekb-dbx-form.mjs.map +1 -1
- package/lib/form/action/form.action.directive.d.ts +5 -10
- package/lib/formly/field/value/date/datetime.field.component.d.ts +3 -3
- package/lib/formly/field/value/phone/_phone.scss +4 -0
- package/package.json +21 -23
|
@@ -2738,21 +2738,21 @@ export function acceptTermsField({ key = 'accept', label = 'Accept Terms', descr
|
|
|
2738
2738
|
}
|
|
2739
2739
|
*/
|
|
2740
2740
|
|
|
2741
|
-
var
|
|
2742
|
-
(function (
|
|
2741
|
+
var DbxDateTimeFieldTimeMode;
|
|
2742
|
+
(function (DbxDateTimeFieldTimeMode) {
|
|
2743
2743
|
/**
|
|
2744
2744
|
* Time is required.
|
|
2745
2745
|
*/
|
|
2746
|
-
|
|
2746
|
+
DbxDateTimeFieldTimeMode["REQUIRED"] = "required";
|
|
2747
2747
|
/**
|
|
2748
2748
|
* Time is optional.
|
|
2749
2749
|
*/
|
|
2750
|
-
|
|
2750
|
+
DbxDateTimeFieldTimeMode["OPTIONAL"] = "optional";
|
|
2751
2751
|
/**
|
|
2752
2752
|
* Time is permenantly off.
|
|
2753
2753
|
*/
|
|
2754
|
-
|
|
2755
|
-
})(
|
|
2754
|
+
DbxDateTimeFieldTimeMode["NONE"] = "none";
|
|
2755
|
+
})(DbxDateTimeFieldTimeMode || (DbxDateTimeFieldTimeMode = {}));
|
|
2756
2756
|
class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
2757
2757
|
constructor(cdRef) {
|
|
2758
2758
|
super();
|
|
@@ -2785,9 +2785,9 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2785
2785
|
});
|
|
2786
2786
|
this._config = new BehaviorSubject(undefined);
|
|
2787
2787
|
this.fullDay$ = this.fullDayControl$.pipe(switchMap$1(control => control.valueChanges.pipe(startWith$1(control.value))));
|
|
2788
|
-
this.showTimeInput$ = this.fullDay$.pipe(map$1(x => !x && this.timeMode !==
|
|
2789
|
-
this.showAddTime$ = this.showTimeInput$.pipe(map$1(x => !x && this.timeMode ===
|
|
2790
|
-
this.date$ = this.dateInputCtrl.valueChanges.pipe(filterMaybe(), shareReplay(1));
|
|
2788
|
+
this.showTimeInput$ = this.fullDay$.pipe(map$1(x => !x && this.timeMode !== DbxDateTimeFieldTimeMode.NONE));
|
|
2789
|
+
this.showAddTime$ = this.showTimeInput$.pipe(map$1(x => !x && this.timeMode === DbxDateTimeFieldTimeMode.OPTIONAL), shareReplay(1));
|
|
2790
|
+
this.date$ = this.dateInputCtrl.valueChanges.pipe(startWith$1(this.dateInputCtrl.value), filterMaybe(), shareReplay(1));
|
|
2791
2791
|
this.dateValue$ = merge(this.date$, this.value$.pipe(skipFirstMaybe())).pipe(map$1((x) => (x) ? startOfDay(x) : x), distinctUntilChanged$1((a, b) => Boolean(a && b) && isSameDay(a, b)), shareReplay(1));
|
|
2792
2792
|
this.timeInput$ = this._updateTime.pipe(debounceTime$1(5), map$1(_ => this.timeInputCtrl.value), distinctUntilChanged$1());
|
|
2793
2793
|
this.config$ = this._config.pipe(switchMapMaybeDefault(), shareReplay(1));
|
|
@@ -2837,7 +2837,7 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2837
2837
|
}), distinctUntilChanged$1((a, b) => Boolean(a && b) && isSameMinute(a, b)), shareReplay(1));
|
|
2838
2838
|
}
|
|
2839
2839
|
get dateOnly() {
|
|
2840
|
-
return this.timeMode ===
|
|
2840
|
+
return this.timeMode === DbxDateTimeFieldTimeMode.NONE;
|
|
2841
2841
|
}
|
|
2842
2842
|
get dateTimeField() {
|
|
2843
2843
|
return this.field.dateTimeField;
|
|
@@ -2849,7 +2849,7 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2849
2849
|
return !this.timeOnly;
|
|
2850
2850
|
}
|
|
2851
2851
|
get timeMode() {
|
|
2852
|
-
return (this.timeOnly) ?
|
|
2852
|
+
return (this.timeOnly) ? DbxDateTimeFieldTimeMode.REQUIRED : (this.dateTimeField.timeMode ?? DbxDateTimeFieldTimeMode.REQUIRED);
|
|
2853
2853
|
}
|
|
2854
2854
|
get description() {
|
|
2855
2855
|
return this.field.templateOptions?.description;
|
|
@@ -2896,12 +2896,12 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
2896
2896
|
}
|
|
2897
2897
|
this._fullDayControlObs.next(fullDayFieldCtrl);
|
|
2898
2898
|
switch (this.dateTimeField.timeMode) {
|
|
2899
|
-
case
|
|
2899
|
+
case DbxDateTimeFieldTimeMode.OPTIONAL:
|
|
2900
2900
|
break;
|
|
2901
|
-
case
|
|
2901
|
+
case DbxDateTimeFieldTimeMode.NONE:
|
|
2902
2902
|
this.removeTime();
|
|
2903
2903
|
break;
|
|
2904
|
-
case
|
|
2904
|
+
case DbxDateTimeFieldTimeMode.REQUIRED:
|
|
2905
2905
|
this.addTime();
|
|
2906
2906
|
break;
|
|
2907
2907
|
}
|
|
@@ -3063,17 +3063,17 @@ const TAKE_NEXT_UPCOMING_TIME_CONFIG_OBS = () => of({
|
|
|
3063
3063
|
function timeOnlyField(config = {}) {
|
|
3064
3064
|
return dateTimeField({
|
|
3065
3065
|
...config,
|
|
3066
|
-
timeMode:
|
|
3066
|
+
timeMode: DbxDateTimeFieldTimeMode.REQUIRED,
|
|
3067
3067
|
timeOnly: true
|
|
3068
3068
|
});
|
|
3069
3069
|
}
|
|
3070
3070
|
function dateTimeField(config = {}) {
|
|
3071
|
-
const { key = 'date', timeMode =
|
|
3071
|
+
const { key = 'date', timeMode = DbxDateTimeFieldTimeMode.REQUIRED, fullDayFieldName, getConfigObs, timeOnly = false } = config;
|
|
3072
3072
|
const fieldConfig = formlyField({
|
|
3073
3073
|
key,
|
|
3074
3074
|
type: 'datetime',
|
|
3075
3075
|
dateTimeField: {
|
|
3076
|
-
timeMode: (timeOnly) ?
|
|
3076
|
+
timeMode: (timeOnly) ? DbxDateTimeFieldTimeMode.REQUIRED : timeMode,
|
|
3077
3077
|
fullDayFieldName,
|
|
3078
3078
|
getConfigObs,
|
|
3079
3079
|
timeOnly,
|
|
@@ -4113,5 +4113,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
|
|
|
4113
4113
|
* Generated bundle index. Do not edit.
|
|
4114
4114
|
*/
|
|
4115
4115
|
|
|
4116
|
-
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,
|
|
4116
|
+
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, DbxFormlyContext, DbxFormlyFieldsContextDirective, DbxFormlyFormComponent, DbxFormlyModule, DbxMutableForm, DbxPhoneFieldComponent, DbxPickableChipListFieldComponent, DbxPickableListFieldComponent, DbxPickableListFieldItemListComponent, DbxPickableListFieldItemListViewComponent, DbxPickableListFieldItemListViewItemComponent, DbxSearchableChipFieldComponent, DbxSearchableFieldAutocompleteItemComponent, DbxSearchableTextFieldComponent, DbxTextEditorFieldComponent, EXPANDABLE_WRAPPER_KEY, FLEX_WRAPPER_KEY, INFO_WRAPPER_KEY, INVALID_PHONE_NUMBER_MESSAGE, IsDomain, IsInRange, IsTruthy, LABEL_STRING_MAX_LENGTH, MAX_LENGTH_VALIDATION_MESSAGE, MAX_VALIDATION_MESSAGE, MIN_LENGTH_VALIDATION_MESSAGE, MIN_VALIDATION_MESSAGE, PHONE_LABEL_MAX_LENGTH, ProvideDbxForm, ProvideDbxMutableForm, ProvideFormlyContext, 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, addWrapperToFormlyFieldConfig, addressField, addressFormlyFields, addressListField, checkIsFieldFlexLayoutGroupFieldConfig, checkboxField, checklistItemField, chipTextField, cityField, componentField, countryField, dateTimeField, defaultValidationMessages, disableFormlyFieldAutofillAttributes, emailField, expandWrapper, filterPickableItemFieldValuesByLabel, flexLayoutWrapper, formlyField, hiddenField, infoWrapper, makeMetaFilterSearchableFieldValueDisplayFn, maxLengthValidationMessage, maxValidationMessage, minLengthValidationMessage, minValidationMessage, nameField, phoneAndLabelSectionField, phoneField, phoneListField, pickableItemChipField, pickableItemListField, repeatArrayField, searchableChipField, searchableStringChipField, searchableTextField, sectionWrapper, sortPickableItemsByLabel, stateField, staticEnumField, styleWrapper, subsectionWrapper, templateOptionsForFieldConfig, templateOptionsValueForFieldConfig, textAreaField, textEditorField, textField, timeOnlyField, toggleField, toggleWrapper, wrappedPhoneAndLabelField, zipCodeField };
|
|
4117
4117
|
//# sourceMappingURL=dereekb-dbx-form.mjs.map
|