@dereekb/dbx-form 9.24.16 → 9.24.18
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/calendar/lib/calendar.module.d.ts +1 -1
- package/calendar/lib/calendar.schedule.selection.dialog.button.component.d.ts +2 -1
- package/calendar/lib/calendar.schedule.selection.range.component.d.ts +6 -1
- package/calendar/lib/field/schedule/calendar.schedule.field.component.d.ts +23 -0
- package/calendar/lib/field/schedule/calendar.schedule.module.d.ts +10 -9
- package/esm2020/calendar/lib/calendar.module.mjs +8 -2
- package/esm2020/calendar/lib/calendar.schedule.selection.component.mjs +24 -8
- package/esm2020/calendar/lib/calendar.schedule.selection.dialog.button.component.mjs +8 -6
- package/esm2020/calendar/lib/calendar.schedule.selection.popover.content.component.mjs +17 -12
- package/esm2020/calendar/lib/calendar.schedule.selection.range.component.mjs +45 -5
- package/esm2020/calendar/lib/field/schedule/calendar.schedule.field.component.mjs +23 -9
- package/esm2020/calendar/lib/field/schedule/calendar.schedule.field.mjs +5 -3
- package/esm2020/calendar/lib/field/schedule/calendar.schedule.module.mjs +7 -3
- package/esm2020/lib/formly/config/validation.mjs +3 -2
- package/esm2020/lib/formly/field/value/number/number.field.mjs +34 -1
- package/esm2020/lib/formly/field/value/number/number.field.module.mjs +5 -4
- package/esm2020/lib/formly/field/value/phone/phone.field.component.mjs +84 -5
- package/esm2020/lib/formly/field/value/phone/phone.field.mjs +9 -3
- package/esm2020/lib/validator/index.mjs +2 -1
- package/esm2020/lib/validator/phone.mjs +61 -0
- package/fesm2015/dereekb-dbx-form-calendar.mjs +123 -39
- package/fesm2015/dereekb-dbx-form-calendar.mjs.map +1 -1
- package/fesm2015/dereekb-dbx-form.mjs +171 -11
- package/fesm2015/dereekb-dbx-form.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form-calendar.mjs +124 -41
- package/fesm2020/dereekb-dbx-form-calendar.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form.mjs +182 -10
- package/fesm2020/dereekb-dbx-form.mjs.map +1 -1
- package/lib/extension/calendar/_calendar.scss +13 -0
- package/lib/formly/config/validation.d.ts +4 -0
- package/lib/formly/field/value/date/_date.scss +4 -0
- package/lib/formly/field/value/number/number.field.d.ts +27 -0
- package/lib/formly/field/value/number/number.field.module.d.ts +3 -2
- package/lib/formly/field/value/phone/_phone.scss +22 -13
- package/lib/formly/field/value/phone/phone.field.component.d.ts +19 -0
- package/lib/validator/index.d.ts +1 -0
- package/lib/validator/phone.d.ts +16 -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$2 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, separateValues, filterUniqueValues, searchStringFilterFunction, caseInsensitiveFilterByIndexOfDecisionFactory, sortByStringFunction, mergeIntoArray, lastValue, arrayToMap, setContainsAllValues, addToSetCopy, setsAreEquivalent, filterMaybeValues, mergeArrays, cachedGetter, makeGetter, asDecisionFunction, getValueFromGetter, asGetter, MS_IN_MINUTE, isMonthDaySlashDate, WEBSITE_DOMAIN_NAME_REGEX, KeyValueTypleValueFilter, valuesFromPOJO, allObjectsAreEqual, isNumberDivisibleBy, nearestDivisibleValues, mapMaybeFunction, transformNumberFunction, concatArrays, transformStringFunction, US_STATE_CODE_STRING_REGEX, ZIP_CODE_STRING_REGEX, LAT_LNG_PATTERN, BooleanStringKeyArrayUtilityInstance, capitalizeFirstLetter } from '@dereekb/util';
|
|
29
|
+
import { objectIsEmpty, mergeObjectsFunction, filterFromPOJOFunction, mergeObjects, filterFromPOJO, asArray, objectHasNoKeys, addPlusPrefixToNumber, convertMaybeToArray, isSelectedDecisionFunctionFactory, readKeysFrom, hasDifferentValues, makeValuesGroupMap, separateValues, filterUniqueValues, searchStringFilterFunction, caseInsensitiveFilterByIndexOfDecisionFactory, sortByStringFunction, mergeIntoArray, lastValue, arrayToMap, setContainsAllValues, addToSetCopy, setsAreEquivalent, filterMaybeValues, mergeArrays, cachedGetter, makeGetter, asDecisionFunction, getValueFromGetter, asGetter, MS_IN_MINUTE, isMonthDaySlashDate, WEBSITE_DOMAIN_NAME_REGEX, KeyValueTypleValueFilter, valuesFromPOJO, allObjectsAreEqual, isNumberDivisibleBy, nearestDivisibleValues, isE164PhoneNumber as isE164PhoneNumber$1, isValidPhoneExtensionNumber, e164PhoneNumberExtensionPair, mapMaybeFunction, transformNumberFunction, concatArrays, e164PhoneNumberFromE164PhoneNumberExtensionPair, 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';
|
|
@@ -56,7 +56,8 @@ import * as i4$5 from 'ngx-editor';
|
|
|
56
56
|
import { Editor, NgxEditorModule } from 'ngx-editor';
|
|
57
57
|
import * as i4$6 from '@angular/cdk/drag-drop';
|
|
58
58
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
59
|
-
import
|
|
59
|
+
import { FormlyMatSliderModule } from '@ngx-formly/material/slider';
|
|
60
|
+
import * as i3$4 from 'ngx-mat-intl-tel-input';
|
|
60
61
|
import { NgxMatIntlTelInputComponent } from 'ngx-mat-intl-tel-input';
|
|
61
62
|
import { ADDRESS_CITY_MAX_LENGTH, ADDRESS_STATE_CODE_MAX_LENGTH, ADDRESS_STATE_MAX_LENGTH, ADDRESS_COUNTRY_MAX_LENGTH, ADDRESS_ZIP_MAX_LENGTH, ADDRESS_LINE_MAX_LENGTH } from '@dereekb/model';
|
|
62
63
|
import { cloneDeep } from 'lodash';
|
|
@@ -533,8 +534,9 @@ const MAX_LENGTH_VALIDATION_MESSAGE = { name: 'maxLength', message: maxLengthVal
|
|
|
533
534
|
const MIN_VALIDATION_MESSAGE = { name: 'min', message: minValidationMessage };
|
|
534
535
|
const MAX_VALIDATION_MESSAGE = { name: 'max', message: maxValidationMessage };
|
|
535
536
|
const INVALID_PHONE_NUMBER_MESSAGE = { name: 'validatePhoneNumber', message: 'This is not a valid phone number.' };
|
|
537
|
+
const INVALID_PHONE_NUMBER_EXTENSION_MESSAGE = { name: 'validatePhoneNumberExtension', message: 'This is not a valid phone number extension.' };
|
|
536
538
|
function defaultValidationMessages() {
|
|
537
|
-
return [REQUIRED_VALIDATION_MESSAGE, MIN_LENGTH_VALIDATION_MESSAGE, MAX_LENGTH_VALIDATION_MESSAGE, MIN_VALIDATION_MESSAGE, MAX_VALIDATION_MESSAGE, INVALID_PHONE_NUMBER_MESSAGE];
|
|
539
|
+
return [REQUIRED_VALIDATION_MESSAGE, MIN_LENGTH_VALIDATION_MESSAGE, MAX_LENGTH_VALIDATION_MESSAGE, MIN_VALIDATION_MESSAGE, MAX_VALIDATION_MESSAGE, INVALID_PHONE_NUMBER_MESSAGE, INVALID_PHONE_NUMBER_EXTENSION_MESSAGE];
|
|
538
540
|
}
|
|
539
541
|
|
|
540
542
|
// MARK: Default
|
|
@@ -5010,6 +5012,65 @@ function fieldValueIsAvailableValidator(config) {
|
|
|
5010
5012
|
})), first());
|
|
5011
5013
|
}
|
|
5012
5014
|
|
|
5015
|
+
/**
|
|
5016
|
+
* Angular Form ValidationFn for checking isE164PhoneNumber the input divisor.
|
|
5017
|
+
*
|
|
5018
|
+
* @param divisor
|
|
5019
|
+
* @returns
|
|
5020
|
+
*/
|
|
5021
|
+
function isE164PhoneNumber(allowExtension) {
|
|
5022
|
+
return (control) => {
|
|
5023
|
+
const value = control.value;
|
|
5024
|
+
if (value != null && !isE164PhoneNumber$1(value, allowExtension)) {
|
|
5025
|
+
return {
|
|
5026
|
+
[INVALID_PHONE_NUMBER_MESSAGE.name]: true
|
|
5027
|
+
};
|
|
5028
|
+
}
|
|
5029
|
+
return {};
|
|
5030
|
+
};
|
|
5031
|
+
}
|
|
5032
|
+
/**
|
|
5033
|
+
* Angular Form ValidationFn for checking the input is a valid phone extension. Empty values return true.
|
|
5034
|
+
*
|
|
5035
|
+
* @param divisor
|
|
5036
|
+
* @returns
|
|
5037
|
+
*/
|
|
5038
|
+
function isPhoneExtension() {
|
|
5039
|
+
return (control) => {
|
|
5040
|
+
const value = control.value;
|
|
5041
|
+
if (value != null) {
|
|
5042
|
+
const asString = value.toString();
|
|
5043
|
+
if (asString.length > 0 && !isValidPhoneExtensionNumber(asString)) {
|
|
5044
|
+
return {
|
|
5045
|
+
[INVALID_PHONE_NUMBER_EXTENSION_MESSAGE.name]: true
|
|
5046
|
+
};
|
|
5047
|
+
}
|
|
5048
|
+
}
|
|
5049
|
+
return {};
|
|
5050
|
+
};
|
|
5051
|
+
}
|
|
5052
|
+
function isE164PhoneNumberWithValidExtension() {
|
|
5053
|
+
return (control) => {
|
|
5054
|
+
const value = control.value;
|
|
5055
|
+
if (value != null) {
|
|
5056
|
+
if (isE164PhoneNumber$1(value, true)) {
|
|
5057
|
+
const pair = e164PhoneNumberExtensionPair(value);
|
|
5058
|
+
if (pair.extension && !isValidPhoneExtensionNumber(pair.extension)) {
|
|
5059
|
+
return {
|
|
5060
|
+
[INVALID_PHONE_NUMBER_EXTENSION_MESSAGE.name]: true
|
|
5061
|
+
};
|
|
5062
|
+
}
|
|
5063
|
+
}
|
|
5064
|
+
else {
|
|
5065
|
+
return {
|
|
5066
|
+
[INVALID_PHONE_NUMBER_MESSAGE.name]: true
|
|
5067
|
+
};
|
|
5068
|
+
}
|
|
5069
|
+
}
|
|
5070
|
+
return {};
|
|
5071
|
+
};
|
|
5072
|
+
}
|
|
5073
|
+
|
|
5013
5074
|
function numberFieldTransformParser(config) {
|
|
5014
5075
|
const { parsers: inputParsers, transform } = config;
|
|
5015
5076
|
let parsers;
|
|
@@ -5045,6 +5106,39 @@ function numberField(config) {
|
|
|
5045
5106
|
parsers
|
|
5046
5107
|
});
|
|
5047
5108
|
}
|
|
5109
|
+
function numberSliderField(config) {
|
|
5110
|
+
const { key, min, max, step, enforceStep, inputType: type = 'number', materialFormField, thumbLabel: inputThumbLabel, tickInterval: inputTickInterval, invertSelectionColoring: invertedSelectionColoring = false, displayWith } = config;
|
|
5111
|
+
const parsers = numberFieldTransformParser(config);
|
|
5112
|
+
const validators = [];
|
|
5113
|
+
let tickIntervalFromSteps;
|
|
5114
|
+
if (step) {
|
|
5115
|
+
tickIntervalFromSteps = 1;
|
|
5116
|
+
if (enforceStep) {
|
|
5117
|
+
validators.push(isDivisibleBy(step));
|
|
5118
|
+
}
|
|
5119
|
+
}
|
|
5120
|
+
const tickInterval = inputTickInterval === false ? undefined : inputTickInterval ?? tickIntervalFromSteps ?? undefined;
|
|
5121
|
+
return formlyField({
|
|
5122
|
+
key,
|
|
5123
|
+
type: 'slider',
|
|
5124
|
+
...propsAndConfigForFieldConfig(config, {
|
|
5125
|
+
...materialFormField,
|
|
5126
|
+
type,
|
|
5127
|
+
min,
|
|
5128
|
+
max,
|
|
5129
|
+
step,
|
|
5130
|
+
inverted: invertedSelectionColoring,
|
|
5131
|
+
thumbLabel: inputThumbLabel ?? true,
|
|
5132
|
+
showTickMarks: Boolean(tickInterval),
|
|
5133
|
+
tickInterval,
|
|
5134
|
+
displayWith
|
|
5135
|
+
}),
|
|
5136
|
+
...validatorsForFieldConfig({
|
|
5137
|
+
validators
|
|
5138
|
+
}),
|
|
5139
|
+
parsers
|
|
5140
|
+
});
|
|
5141
|
+
}
|
|
5048
5142
|
function dollarAmountField(config) {
|
|
5049
5143
|
return numberField({ ...config, transform: { ...config.transform, precision: 2 } });
|
|
5050
5144
|
}
|
|
@@ -5052,12 +5146,12 @@ function dollarAmountField(config) {
|
|
|
5052
5146
|
class DbxFormFormlyNumberFieldModule {
|
|
5053
5147
|
}
|
|
5054
5148
|
DbxFormFormlyNumberFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormFormlyNumberFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5055
|
-
DbxFormFormlyNumberFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxFormFormlyNumberFieldModule, imports: [FormlyMaterialModule], exports: [DbxFormFormlyWrapperModule] });
|
|
5056
|
-
DbxFormFormlyNumberFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormFormlyNumberFieldModule, imports: [FormlyMaterialModule, DbxFormFormlyWrapperModule] });
|
|
5149
|
+
DbxFormFormlyNumberFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxFormFormlyNumberFieldModule, imports: [FormlyMaterialModule, FormlyMatSliderModule], exports: [DbxFormFormlyWrapperModule] });
|
|
5150
|
+
DbxFormFormlyNumberFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormFormlyNumberFieldModule, imports: [FormlyMaterialModule, FormlyMatSliderModule, DbxFormFormlyWrapperModule] });
|
|
5057
5151
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormFormlyNumberFieldModule, decorators: [{
|
|
5058
5152
|
type: NgModule,
|
|
5059
5153
|
args: [{
|
|
5060
|
-
imports: [FormlyMaterialModule],
|
|
5154
|
+
imports: [FormlyMaterialModule, FormlyMatSliderModule],
|
|
5061
5155
|
declarations: [],
|
|
5062
5156
|
exports: [DbxFormFormlyWrapperModule]
|
|
5063
5157
|
}]
|
|
@@ -5065,18 +5159,91 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
5065
5159
|
|
|
5066
5160
|
const DEFAULT_PREFERRED_COUNTRIES = ['us'];
|
|
5067
5161
|
class DbxPhoneFieldComponent extends FieldType$1 {
|
|
5162
|
+
constructor() {
|
|
5163
|
+
super(...arguments);
|
|
5164
|
+
this.inputSync = new SubscriptionObject();
|
|
5165
|
+
this.outputSync = new SubscriptionObject();
|
|
5166
|
+
this.extensionErrorSync = new SubscriptionObject();
|
|
5167
|
+
this.phoneErrorSync = new SubscriptionObject();
|
|
5168
|
+
this.phoneCtrl = new FormControl('');
|
|
5169
|
+
this.extensionCtrl = new FormControl('', {
|
|
5170
|
+
validators: [isPhoneExtension()]
|
|
5171
|
+
});
|
|
5172
|
+
this.inputFormGroup = new FormGroup({
|
|
5173
|
+
phone: this.phoneCtrl,
|
|
5174
|
+
extension: this.extensionCtrl
|
|
5175
|
+
});
|
|
5176
|
+
}
|
|
5068
5177
|
get preferredCountries() {
|
|
5069
5178
|
return this.props.preferredCountries ?? DEFAULT_PREFERRED_COUNTRIES;
|
|
5070
5179
|
}
|
|
5071
5180
|
get onlyCountries() {
|
|
5072
5181
|
return this.props.onlyCountries ?? [];
|
|
5073
5182
|
}
|
|
5183
|
+
get allowExtension() {
|
|
5184
|
+
return this.props.allowExtension ?? false;
|
|
5185
|
+
}
|
|
5186
|
+
ngOnInit() {
|
|
5187
|
+
this.inputSync.subscription = this.formControl.valueChanges.pipe(startWith(this.formControl.value), distinctUntilChanged()).subscribe((inputValue) => {
|
|
5188
|
+
let phone;
|
|
5189
|
+
let extension;
|
|
5190
|
+
if (inputValue) {
|
|
5191
|
+
const pair = e164PhoneNumberExtensionPair(inputValue);
|
|
5192
|
+
phone = pair.number;
|
|
5193
|
+
extension = pair.extension;
|
|
5194
|
+
}
|
|
5195
|
+
// do not clear/reset if phone is undefined and the phone value is currently null
|
|
5196
|
+
if (phone || (!phone && this.phoneCtrl.value !== null)) {
|
|
5197
|
+
this.phoneCtrl.setValue(phone || '');
|
|
5198
|
+
this.extensionCtrl.setValue(extension || '');
|
|
5199
|
+
}
|
|
5200
|
+
});
|
|
5201
|
+
this.outputSync.subscription = combineLatest([this.phoneCtrl.valueChanges.pipe(distinctUntilChanged()), this.extensionCtrl.valueChanges.pipe(startWith(this.extensionCtrl.value), distinctUntilChanged())])
|
|
5202
|
+
.pipe(map(([phone, extension]) => {
|
|
5203
|
+
if (phone) {
|
|
5204
|
+
if (this.allowExtension) {
|
|
5205
|
+
return e164PhoneNumberFromE164PhoneNumberExtensionPair({
|
|
5206
|
+
number: phone,
|
|
5207
|
+
extension
|
|
5208
|
+
});
|
|
5209
|
+
}
|
|
5210
|
+
else {
|
|
5211
|
+
return phone;
|
|
5212
|
+
}
|
|
5213
|
+
}
|
|
5214
|
+
else {
|
|
5215
|
+
return undefined;
|
|
5216
|
+
}
|
|
5217
|
+
}), distinctUntilChanged())
|
|
5218
|
+
.subscribe((x) => {
|
|
5219
|
+
this.formControl.setValue(x);
|
|
5220
|
+
});
|
|
5221
|
+
/*
|
|
5222
|
+
* The phoneCtrl's errors are being used to drive the error matcher for this. Sync any invalid states with errors to phoneCtrl.
|
|
5223
|
+
* PhoneCtrl updates when the input is updated so it works.
|
|
5224
|
+
*/
|
|
5225
|
+
this.extensionErrorSync.subscription = this.extensionCtrl.statusChanges.subscribe((x) => {
|
|
5226
|
+
if (x === 'INVALID') {
|
|
5227
|
+
this.phoneCtrl.setErrors(this.formControl.errors, { emitEvent: true });
|
|
5228
|
+
}
|
|
5229
|
+
});
|
|
5230
|
+
// sync any phoneCtrl errors with the errors of the form control.
|
|
5231
|
+
this.phoneErrorSync.subscription = this.inputFormGroup.statusChanges.subscribe((x) => {
|
|
5232
|
+
const errors = { ...this.phoneCtrl.errors, ...this.extensionCtrl.errors };
|
|
5233
|
+
this.formControl.setErrors(objectHasNoKeys(errors) ? null : errors, { emitEvent: true });
|
|
5234
|
+
});
|
|
5235
|
+
}
|
|
5236
|
+
ngOnDestroy() {
|
|
5237
|
+
super.ngOnDestroy();
|
|
5238
|
+
this.inputSync.destroy();
|
|
5239
|
+
this.outputSync.destroy();
|
|
5240
|
+
}
|
|
5074
5241
|
}
|
|
5075
5242
|
DbxPhoneFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxPhoneFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
5076
|
-
DbxPhoneFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxPhoneFieldComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<ngx-mat-intl-tel-input class=\"dbx-form-phone-field\" [required]=\"required\" [preferredCountries]=\"preferredCountries\" [enablePlaceholder]=\"false\" name=\"phone\" [formControl]=\"
|
|
5243
|
+
DbxPhoneFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxPhoneFieldComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div class=\"dbx-form-phone-field\" [formGroup]=\"inputFormGroup\">\n <ngx-mat-intl-tel-input class=\"dbx-form-phone-field-phone-content\" [required]=\"required\" [preferredCountries]=\"preferredCountries\" [enablePlaceholder]=\"false\" name=\"phone\" [formControl]=\"phoneCtrl\"></ngx-mat-intl-tel-input>\n <div *ngIf=\"allowExtension\" class=\"dbx-form-phone-field-extension-content\">\n <span class=\"dbx-hint dbx-button-spacer\">Ext.</span>\n <input class=\"dbx-form-phone-field-extension-input\" placeholder=\"123\" minlength=\"0\" maxlength=\"6\" #extensionInput [formControl]=\"extensionCtrl\" />\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3$1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i3$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3$4.NgxMatIntlTelInputComponent, selector: "ngx-mat-intl-tel-input", inputs: ["preferredCountries", "enablePlaceholder", "inputPlaceholder", "cssClass", "name", "onlyCountries", "errorStateMatcher", "enableSearch", "searchPlaceholder", "describedBy", "format", "placeholder", "required", "disabled"], outputs: ["countryChanged"] }] });
|
|
5077
5244
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxPhoneFieldComponent, decorators: [{
|
|
5078
5245
|
type: Component,
|
|
5079
|
-
args: [{ template: "<ngx-mat-intl-tel-input class=\"dbx-form-phone-field\" [required]=\"required\" [preferredCountries]=\"preferredCountries\" [enablePlaceholder]=\"false\" name=\"phone\" [formControl]=\"
|
|
5246
|
+
args: [{ template: "<div class=\"dbx-form-phone-field\" [formGroup]=\"inputFormGroup\">\n <ngx-mat-intl-tel-input class=\"dbx-form-phone-field-phone-content\" [required]=\"required\" [preferredCountries]=\"preferredCountries\" [enablePlaceholder]=\"false\" name=\"phone\" [formControl]=\"phoneCtrl\"></ngx-mat-intl-tel-input>\n <div *ngIf=\"allowExtension\" class=\"dbx-form-phone-field-extension-content\">\n <span class=\"dbx-hint dbx-button-spacer\">Ext.</span>\n <input class=\"dbx-form-phone-field-extension-input\" placeholder=\"123\" minlength=\"0\" maxlength=\"6\" #extensionInput [formControl]=\"extensionCtrl\" />\n </div>\n</div>\n" }]
|
|
5080
5247
|
}] });
|
|
5081
5248
|
|
|
5082
5249
|
class DbxFormFormlyPhoneFieldModule {
|
|
@@ -5176,14 +5343,19 @@ function textAreaField(config) {
|
|
|
5176
5343
|
}
|
|
5177
5344
|
|
|
5178
5345
|
function phoneField(config = {}) {
|
|
5179
|
-
const { key = 'phone', label = 'Phone Number', preferredCountries, onlyCountries } = config;
|
|
5346
|
+
const { key = 'phone', label = 'Phone Number', preferredCountries, onlyCountries, allowExtension: inputAllowExtension } = config;
|
|
5347
|
+
const allowExtension = inputAllowExtension ?? false;
|
|
5180
5348
|
const fieldConfig = formlyField({
|
|
5181
5349
|
key,
|
|
5182
5350
|
type: 'intphone',
|
|
5183
5351
|
...propsAndConfigForFieldConfig(config, {
|
|
5184
5352
|
label,
|
|
5353
|
+
allowExtension,
|
|
5185
5354
|
preferredCountries,
|
|
5186
5355
|
onlyCountries
|
|
5356
|
+
}),
|
|
5357
|
+
...validatorsForFieldConfig({
|
|
5358
|
+
validators: [isE164PhoneNumber(allowExtension)]
|
|
5187
5359
|
})
|
|
5188
5360
|
});
|
|
5189
5361
|
return fieldConfig;
|
|
@@ -6137,5 +6309,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
6137
6309
|
* Generated bundle index. Do not edit.
|
|
6138
6310
|
*/
|
|
6139
6311
|
|
|
6140
|
-
export { APP_ACTION_FORM_DISABLED_KEY, AUTO_TOUCH_WRAPPER_KEY, AbstractAsyncFormlyFormDirective, AbstractConfigAsyncFormlyFormDirective, AbstractDbxPickableItemFieldDirective, AbstractDbxSearchableFieldDisplayDirective, AbstractDbxSearchableValueFieldDirective, AbstractFormExpandableSectionWrapperDirective, AbstractFormlyFormDirective, AbstractSyncFormlyFormDirective, AutoTouchFieldWrapperComponent, ChecklistItemFieldDataSetBuilder, DBX_DATE_TIME_FIELD_MENU_PRESETS_TOKEN, DBX_SEARCHABLE_FIELD_COMPONENT_DATA_TOKEN, DEFAULT_DATE_TIME_FIELD_MENU_PRESETS_PRESETS, 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, DbxDateTimeFieldMenuPresetsService, DbxDateTimeFieldTimeMode, DbxDateTimeValueMode, DbxDefaultChecklistItemFieldDisplayComponent, DbxDefaultSearchableFieldDisplayComponent, DbxForm, DbxFormActionModule, DbxFormActionTransitionModule, DbxFormComponentFieldComponent, DbxFormExpandWrapperComponent, DbxFormExtensionModule, DbxFormFlexWrapperComponent, DbxFormFormlyArrayFieldModule, DbxFormFormlyBooleanFieldModule, DbxFormFormlyChecklistItemFieldModule, DbxFormFormlyComponentFieldModule, DbxFormFormlyDateFieldModule, DbxFormFormlyDbxListFieldModule, DbxFormFormlyFieldModule, DbxFormFormlyFormModule, DbxFormFormlyNumberFieldModule, DbxFormFormlyPhoneFieldModule, DbxFormFormlyPickableFieldModule, DbxFormFormlySearchableFieldModule, DbxFormFormlySelectionModule, DbxFormFormlySourceSelectModule, DbxFormFormlyTextEditorFieldModule, DbxFormFormlyTextFieldModule, DbxFormFormlyValueModule, DbxFormFormlyWrapperModule, DbxFormInfoWrapperComponent, DbxFormIoModule, DbxFormLayoutModule, DbxFormLoadingSourceDirective, DbxFormModule, DbxFormRepeatArrayTypeComponent, DbxFormSearchFormComponent, DbxFormSectionWrapperComponent, DbxFormSourceDirective, DbxFormSourceSelectFieldComponent, 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, dateTimePreset, dateTimeRangeField, dbxDateRangeIsSameDateRangeFieldValue, dbxDateTimeInputValueParseFactory, dbxDateTimeIsSameDateTimeFieldValue, dbxDateTimeOutputValueFactory, dbxFormSearchFormFields, dbxFormSourceObservable, dbxFormSourceObservableFromStream, dbxListField, defaultValidationMessages, disableFormlyFieldAutofillAttributes, dollarAmountField, emailField, expandWrapper, fieldValueIsAvailableValidator, fieldValuesAreEqualValidator, filterPartialPotentialFieldConfigValuesFromObject, filterPickableItemFieldValuesByLabel, filterPickableItemFieldValuesByLabelFilterFunction, fixedDateRangeField, 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, pickableValueFieldValuesConfigForStaticLabeledValues, propsAndConfigForFieldConfig, propsForFieldConfig, propsValueForFieldConfig, provideDbxForm, provideDbxMutableForm, provideFormlyContext, repeatArrayField, searchableChipField, searchableStringChipField, searchableTextField, sectionWrapper, sortPickableItemsByLabel, sortPickableItemsByLabelStringFunction, sourceSelectField, stateField, styleWrapper, subsectionWrapper, syncConfigValueObs, textAreaField, textEditorField, textField, textFieldTransformParser, textIsAvailableField, textPasswordField, textPasswordWithVerifyFieldGroup, textVerifyPasswordField, timeOnlyField, timezoneStringField, timezoneStringSearchFunction, toggleField, toggleWrapper, usernamePasswordLoginFields, validatorsForFieldConfig, valueSelectionField, workingWrapper, wrappedPhoneAndLabelField, zipCodeField };
|
|
6312
|
+
export { APP_ACTION_FORM_DISABLED_KEY, AUTO_TOUCH_WRAPPER_KEY, AbstractAsyncFormlyFormDirective, AbstractConfigAsyncFormlyFormDirective, AbstractDbxPickableItemFieldDirective, AbstractDbxSearchableFieldDisplayDirective, AbstractDbxSearchableValueFieldDirective, AbstractFormExpandableSectionWrapperDirective, AbstractFormlyFormDirective, AbstractSyncFormlyFormDirective, AutoTouchFieldWrapperComponent, ChecklistItemFieldDataSetBuilder, DBX_DATE_TIME_FIELD_MENU_PRESETS_TOKEN, DBX_SEARCHABLE_FIELD_COMPONENT_DATA_TOKEN, DEFAULT_DATE_TIME_FIELD_MENU_PRESETS_PRESETS, 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, DbxDateTimeFieldMenuPresetsService, DbxDateTimeFieldTimeMode, DbxDateTimeValueMode, DbxDefaultChecklistItemFieldDisplayComponent, DbxDefaultSearchableFieldDisplayComponent, DbxForm, DbxFormActionModule, DbxFormActionTransitionModule, DbxFormComponentFieldComponent, DbxFormExpandWrapperComponent, DbxFormExtensionModule, DbxFormFlexWrapperComponent, DbxFormFormlyArrayFieldModule, DbxFormFormlyBooleanFieldModule, DbxFormFormlyChecklistItemFieldModule, DbxFormFormlyComponentFieldModule, DbxFormFormlyDateFieldModule, DbxFormFormlyDbxListFieldModule, DbxFormFormlyFieldModule, DbxFormFormlyFormModule, DbxFormFormlyNumberFieldModule, DbxFormFormlyPhoneFieldModule, DbxFormFormlyPickableFieldModule, DbxFormFormlySearchableFieldModule, DbxFormFormlySelectionModule, DbxFormFormlySourceSelectModule, DbxFormFormlyTextEditorFieldModule, DbxFormFormlyTextFieldModule, DbxFormFormlyValueModule, DbxFormFormlyWrapperModule, DbxFormInfoWrapperComponent, DbxFormIoModule, DbxFormLayoutModule, DbxFormLoadingSourceDirective, DbxFormModule, DbxFormRepeatArrayTypeComponent, DbxFormSearchFormComponent, DbxFormSectionWrapperComponent, DbxFormSourceDirective, DbxFormSourceSelectFieldComponent, 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_EXTENSION_MESSAGE, 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, dateTimePreset, dateTimeRangeField, dbxDateRangeIsSameDateRangeFieldValue, dbxDateTimeInputValueParseFactory, dbxDateTimeIsSameDateTimeFieldValue, dbxDateTimeOutputValueFactory, dbxFormSearchFormFields, dbxFormSourceObservable, dbxFormSourceObservableFromStream, dbxListField, defaultValidationMessages, disableFormlyFieldAutofillAttributes, dollarAmountField, emailField, expandWrapper, fieldValueIsAvailableValidator, fieldValuesAreEqualValidator, filterPartialPotentialFieldConfigValuesFromObject, filterPickableItemFieldValuesByLabel, filterPickableItemFieldValuesByLabelFilterFunction, fixedDateRangeField, flexLayoutWrapper, formlyField, hiddenField, infoWrapper, isDivisibleBy, isDomain, isE164PhoneNumber, isE164PhoneNumberWithValidExtension, isInRange, isPhoneExtension, isTruthy, latLngTextField, makeMetaFilterSearchableFieldValueDisplayFn, maxLengthValidationMessage, maxValidationMessage, mergePropsValueObjects, minLengthValidationMessage, minValidationMessage, nameField, numberField, numberFieldTransformParser, numberSliderField, partialPotentialFieldConfigKeys, partialPotentialFieldConfigKeysFilter, phoneAndLabelSectionField, phoneField, phoneListField, pickableItemChipField, pickableItemListField, pickableValueFieldValuesConfigForStaticLabeledValues, propsAndConfigForFieldConfig, propsForFieldConfig, propsValueForFieldConfig, provideDbxForm, provideDbxMutableForm, provideFormlyContext, repeatArrayField, searchableChipField, searchableStringChipField, searchableTextField, sectionWrapper, sortPickableItemsByLabel, sortPickableItemsByLabelStringFunction, sourceSelectField, stateField, styleWrapper, subsectionWrapper, syncConfigValueObs, textAreaField, textEditorField, textField, textFieldTransformParser, textIsAvailableField, textPasswordField, textPasswordWithVerifyFieldGroup, textVerifyPasswordField, timeOnlyField, timezoneStringField, timezoneStringSearchFunction, toggleField, toggleWrapper, usernamePasswordLoginFields, validatorsForFieldConfig, valueSelectionField, workingWrapper, wrappedPhoneAndLabelField, zipCodeField };
|
|
6141
6313
|
//# sourceMappingURL=dereekb-dbx-form.mjs.map
|