@theseam/ui-common 1.0.0-beta.0 → 1.0.0-beta.10
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/breadcrumbs/index.d.ts +1 -2
- package/buttons/index.d.ts +20 -13
- package/datatable/index.d.ts +77 -39
- package/dynamic/index.d.ts +5 -5
- package/fesm2022/theseam-ui-common-asset-reader.mjs +28 -29
- package/fesm2022/theseam-ui-common-asset-reader.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-breadcrumbs.mjs +25 -31
- package/fesm2022/theseam-ui-common-breadcrumbs.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-buttons.mjs +108 -66
- package/fesm2022/theseam-ui-common-buttons.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-card.mjs +21 -21
- package/fesm2022/theseam-ui-common-card.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-carousel.mjs +28 -30
- package/fesm2022/theseam-ui-common-carousel.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-checkbox.mjs +27 -27
- package/fesm2022/theseam-ui-common-checkbox.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-confirm-dialog.mjs +23 -27
- package/fesm2022/theseam-ui-common-confirm-dialog.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-core.mjs +31 -11
- package/fesm2022/theseam-ui-common-core.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-data-exporter.mjs +18 -19
- package/fesm2022/theseam-ui-common-data-exporter.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-data-filters.mjs +80 -64
- package/fesm2022/theseam-ui-common-data-filters.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-datatable-alterations-display.mjs +51 -49
- package/fesm2022/theseam-ui-common-datatable-alterations-display.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-datatable-dynamic.mjs +145 -112
- package/fesm2022/theseam-ui-common-datatable-dynamic.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-datatable.mjs +727 -420
- package/fesm2022/theseam-ui-common-datatable.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-dynamic-component-loader.mjs +12 -14
- package/fesm2022/theseam-ui-common-dynamic-component-loader.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-dynamic.mjs +60 -48
- package/fesm2022/theseam-ui-common-dynamic.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-footer-bar.mjs +9 -15
- package/fesm2022/theseam-ui-common-footer-bar.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-form-field-error.mjs +60 -43
- package/fesm2022/theseam-ui-common-form-field-error.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-form-field.mjs +129 -76
- package/fesm2022/theseam-ui-common-form-field.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-framework.mjs +669 -543
- package/fesm2022/theseam-ui-common-framework.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-google-maps.mjs +206 -149
- package/fesm2022/theseam-ui-common-google-maps.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-graphql.mjs +311 -254
- package/fesm2022/theseam-ui-common-graphql.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-icon.mjs +125 -89
- package/fesm2022/theseam-ui-common-icon.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-layout.mjs +18 -26
- package/fesm2022/theseam-ui-common-layout.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-loading.mjs +19 -28
- package/fesm2022/theseam-ui-common-loading.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-menu.mjs +124 -95
- package/fesm2022/theseam-ui-common-menu.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-modal.mjs +178 -129
- package/fesm2022/theseam-ui-common-modal.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-models.mjs +3 -3
- package/fesm2022/theseam-ui-common-models.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-navigation-reload.mjs +13 -11
- package/fesm2022/theseam-ui-common-navigation-reload.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-popover.mjs +81 -88
- package/fesm2022/theseam-ui-common-popover.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-progress.mjs +15 -19
- package/fesm2022/theseam-ui-common-progress.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-rich-text.mjs +65 -52
- package/fesm2022/theseam-ui-common-rich-text.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-scrollbar.mjs +12 -9
- package/fesm2022/theseam-ui-common-scrollbar.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-services.mjs +41 -26
- package/fesm2022/theseam-ui-common-services.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-shared.mjs +149 -159
- package/fesm2022/theseam-ui-common-shared.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-storage.mjs +9 -6
- package/fesm2022/theseam-ui-common-storage.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-story-helpers.mjs +148 -86
- package/fesm2022/theseam-ui-common-story-helpers.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-tabbed.mjs +43 -39
- package/fesm2022/theseam-ui-common-tabbed.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-table-cell-type.mjs +63 -39
- package/fesm2022/theseam-ui-common-table-cell-type.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-table-cell-types.mjs +182 -144
- package/fesm2022/theseam-ui-common-table-cell-types.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-table.mjs +62 -41
- package/fesm2022/theseam-ui-common-table.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-tel-input.mjs +98 -63
- package/fesm2022/theseam-ui-common-tel-input.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-testing.mjs +13 -10
- package/fesm2022/theseam-ui-common-testing.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-tiled-select.mjs +54 -50
- package/fesm2022/theseam-ui-common-tiled-select.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-toggle-edit.mjs +41 -37
- package/fesm2022/theseam-ui-common-toggle-edit.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-toggle-group.mjs +30 -31
- package/fesm2022/theseam-ui-common-toggle-group.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-tooltip.mjs +225 -66
- package/fesm2022/theseam-ui-common-tooltip.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-unsaved-changes-dialog.mjs +14 -12
- package/fesm2022/theseam-ui-common-unsaved-changes-dialog.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-utils.mjs +113 -77
- package/fesm2022/theseam-ui-common-utils.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-validators.mjs +10 -9
- package/fesm2022/theseam-ui-common-validators.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-vertical-list-filter.mjs +39 -17
- package/fesm2022/theseam-ui-common-vertical-list-filter.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-viewers.mjs +80 -53
- package/fesm2022/theseam-ui-common-viewers.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-widget.mjs +288 -314
- package/fesm2022/theseam-ui-common-widget.mjs.map +1 -1
- package/form-field/index.d.ts +1 -1
- package/framework/base-layout/base-layout.component.scss +9 -4
- package/framework/base-layout/styles/_variables.scss +4 -9
- package/framework/dashboard/dashboard-widgets/dashboard-widgets.component.scss +6 -4
- package/framework/index.d.ts +6 -6
- package/framework/nav/nav-item/nav-item.component.scss +7 -6
- package/framework/nav/styles/_themes/light/_variables.scss +21 -5
- package/framework/nav/styles/_themes/primary/_variables.scss +21 -5
- package/framework/side-nav/side-nav-item/side-nav-item.component.scss +5 -2
- package/framework/side-nav/styles/_themes/light/_variables.scss +5 -1
- package/framework/side-nav/styles/_themes/primary/_variables.scss +25 -5
- package/graphql/index.d.ts +49 -7
- package/modal/README.md +5 -5
- package/modal/index.d.ts +1 -1
- package/models/index.d.ts +1 -1
- package/package.json +59 -60
- package/popover/index.d.ts +0 -2
- package/progress/progress-circle/styles/_variables.scss +15 -3
- package/shared/index.d.ts +0 -13
- package/story-helpers/index.d.ts +11 -1
- package/styles/bootstrap/_bootstrap.scss +34 -34
- package/styles/bootstrap/_bs-styles.scss +4 -8
- package/styles/bootstrap/_bs-utilities.scss +4 -4
- package/styles/bootstrap/_bs-variables.scss +65 -70
- package/styles/common/_forms.scss +9 -10
- package/styles/common/_global.scss +0 -1
- package/styles/common/_hacks.scss +1 -1
- package/styles/common/_table.scss +0 -1
- package/styles/common/_text.scss +3 -1
- package/styles/theme.scss +1 -1
- package/styles/vendor/ng-select/_ng-select-bs4.scss +292 -294
- package/styles/vendor/ngx-datatable/_ngx-datatable.scss +63 -32
- package/styles/vendor/ngx-datatable/_themes/bootstrap/_variables.scss +37 -10
- package/styles/vendor/ngx-datatable/_themes/material/_variables.scss +3 -1
- package/styles/vendor/quill/_quill.scss +15 -9
- package/table/index.d.ts +4 -1
- package/table-cell-type/index.d.ts +27 -2
- package/tel-input/README.md +27 -27
- package/utils/index.d.ts +3 -3
- package/viewers/index.d.ts +9 -2
- package/widget/_widget-theme.scss +1 -1
- package/widget/styles/_variables.scss +2 -2
- package/widget/widget/widget.component.scss +0 -2
- package/widget/widget-content-components/widget-tile/widget-tile.component.scss +1 -3
- package/widget/widget-footer/widget-footer.component.scss +0 -1
|
@@ -107,15 +107,15 @@ function addCountryCode(data, iso2, countryCode, priority) {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
// check for undefined as 0 is falsy
|
|
110
|
-
const index =
|
|
110
|
+
const index = priority !== undefined ? priority : data.countryCodes[countryCode].length;
|
|
111
111
|
data.countryCodes[countryCode][index] = iso2;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
const TelInputNumberFormatName = {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
E164: intlTelInputUtils.numberFormat.E164,
|
|
116
|
+
INTERNATIONAL: intlTelInputUtils.numberFormat.INTERNATIONAL,
|
|
117
|
+
NATIONAL: intlTelInputUtils.numberFormat.NATIONAL,
|
|
118
|
+
RFC3966: intlTelInputUtils.numberFormat.RFC3966,
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
const THESEAM_DEFAULT_PHONE_NUMBER_FORMAT = intlTelInputUtils.numberFormat.INTERNATIONAL;
|
|
@@ -123,7 +123,7 @@ function coercePhoneNumberFormat(format, defaultFormat = THESEAM_DEFAULT_PHONE_N
|
|
|
123
123
|
let res = defaultFormat;
|
|
124
124
|
if (typeof format === 'string') {
|
|
125
125
|
const _format = TelInputNumberFormatName[`${format}`.trim().toUpperCase()];
|
|
126
|
-
res =
|
|
126
|
+
res = _format === undefined || _format === null ? defaultFormat : _format;
|
|
127
127
|
}
|
|
128
128
|
else if (typeof format === 'number') {
|
|
129
129
|
// We could check for a number range, but I think it is safer to assume it's
|
|
@@ -144,7 +144,11 @@ function getNumeric(s) {
|
|
|
144
144
|
function getCountryCode(data, dialCode) {
|
|
145
145
|
const _countryCodes = data.countryCodes[getNumeric(dialCode)];
|
|
146
146
|
// Refer to `_setInitialState` to get libraries default logic
|
|
147
|
-
return
|
|
147
|
+
return _countryCodes === undefined ||
|
|
148
|
+
_countryCodes === null ||
|
|
149
|
+
_countryCodes.length === 0
|
|
150
|
+
? 'us'
|
|
151
|
+
: _countryCodes[0];
|
|
148
152
|
}
|
|
149
153
|
|
|
150
154
|
/**
|
|
@@ -205,10 +209,10 @@ function getIntlTelInputUtils() {
|
|
|
205
209
|
return Promise.resolve(globalIntlTelInputUtils());
|
|
206
210
|
}
|
|
207
211
|
if (globalIntlTelInputGlobals().startedLoadingUtilsScript) {
|
|
208
|
-
return waitOnConditionAsync(() => notNullOrUndefined(globalIntlTelInputUtils()), 5000)
|
|
209
|
-
.then(() => globalIntlTelInputUtils());
|
|
212
|
+
return waitOnConditionAsync(() => notNullOrUndefined(globalIntlTelInputUtils()), 5000).then(() => globalIntlTelInputUtils());
|
|
210
213
|
}
|
|
211
|
-
return globalIntlTelInputGlobals()
|
|
214
|
+
return globalIntlTelInputGlobals()
|
|
215
|
+
.loadUtils(TEL_INPUT_UTILS_PATH)
|
|
212
216
|
.then(() => waitOnConditionAsync(() => notNullOrUndefined(globalIntlTelInputUtils()), 5000))
|
|
213
217
|
.then(() => globalIntlTelInputUtils());
|
|
214
218
|
}
|
|
@@ -217,7 +221,7 @@ const VALIDATOR_CODE_MESSAGES = {
|
|
|
217
221
|
[intlTelInputUtils.validationError.INVALID_COUNTRY_CODE]: 'Country code is invalid.',
|
|
218
222
|
[intlTelInputUtils.validationError.TOO_SHORT]: 'Number is too short.',
|
|
219
223
|
[intlTelInputUtils.validationError.TOO_LONG]: 'Number is too long.',
|
|
220
|
-
[intlTelInputUtils.validationError.NOT_A_NUMBER]: 'Must be numbers only.'
|
|
224
|
+
[intlTelInputUtils.validationError.NOT_A_NUMBER]: 'Must be numbers only.',
|
|
221
225
|
};
|
|
222
226
|
function getValidationErrorMessage(code) {
|
|
223
227
|
const message = VALIDATOR_CODE_MESSAGES[code];
|
|
@@ -235,7 +239,7 @@ function processCountryCodes(countries) {
|
|
|
235
239
|
// here we store just dial codes
|
|
236
240
|
dialCodes: {},
|
|
237
241
|
// here we store "country codes" (both dial codes and their area codes)
|
|
238
|
-
countryCodes: {}
|
|
242
|
+
countryCodes: {},
|
|
239
243
|
};
|
|
240
244
|
// first: add dial codes
|
|
241
245
|
for (const c of countries) {
|
|
@@ -301,9 +305,12 @@ class TheSeamTelInputDirective {
|
|
|
301
305
|
this._ngControl = _ngControl;
|
|
302
306
|
}
|
|
303
307
|
ngOnInit() {
|
|
304
|
-
this._elementRef.nativeElement.value = this._ngControl
|
|
308
|
+
this._elementRef.nativeElement.value = this._ngControl
|
|
309
|
+
? this._ngControl.value
|
|
310
|
+
: (this.value ?? '');
|
|
305
311
|
this._elementRef.nativeElement.setAttribute('instance-loading', '');
|
|
306
|
-
merge(this._assetLoader.loadStyleSheet(TEL_INPUT_STYLESHEET_PATH), this._assetLoader.loadStyle(TEL_INPUT_STYLES))
|
|
312
|
+
merge(this._assetLoader.loadStyleSheet(TEL_INPUT_STYLESHEET_PATH), this._assetLoader.loadStyle(TEL_INPUT_STYLES))
|
|
313
|
+
.pipe(tap((v) => this._loadedAssetRefs.push(v)), last(), switchMap(() => {
|
|
307
314
|
this._instance = IntlTelInputFn(this._elementRef.nativeElement, {
|
|
308
315
|
utilsScript: TEL_INPUT_UTILS_PATH,
|
|
309
316
|
preferredCountries: ['US'],
|
|
@@ -316,11 +323,12 @@ class TheSeamTelInputDirective {
|
|
|
316
323
|
// initialCountry: 'auto'
|
|
317
324
|
});
|
|
318
325
|
this._tryUpdateDropdownAttributes();
|
|
319
|
-
return this._instance.promise.then(v => {
|
|
326
|
+
return this._instance.promise.then((v) => {
|
|
320
327
|
this._elementRef.nativeElement.removeAttribute('instance-loading');
|
|
321
328
|
return v;
|
|
322
329
|
});
|
|
323
|
-
}), tap(() => this._initDropdownListener()), tap(() => this.value = this._value), tap(this._formatIntlTelInput), switchMap(() => merge(fromEvent(this._elementRef.nativeElement, 'keyup'), fromEvent(this._elementRef.nativeElement, 'change'))), tap(this._formatIntlTelInput), takeUntil(this._ngUnsubscribe))
|
|
330
|
+
}), tap(() => this._initDropdownListener()), tap(() => (this.value = this._value)), tap(this._formatIntlTelInput), switchMap(() => merge(fromEvent(this._elementRef.nativeElement, 'keyup'), fromEvent(this._elementRef.nativeElement, 'change'))), tap(this._formatIntlTelInput), takeUntil(this._ngUnsubscribe))
|
|
331
|
+
.subscribe();
|
|
324
332
|
}
|
|
325
333
|
ngOnDestroy() {
|
|
326
334
|
this._instance?.destroy();
|
|
@@ -397,9 +405,11 @@ class TheSeamTelInputDirective {
|
|
|
397
405
|
const openDropdown$ = fromEvent(this._elementRef.nativeElement, 'open:countrydropdown');
|
|
398
406
|
const closeDropdown$ = fromEvent(this._elementRef.nativeElement, 'close:countrydropdown');
|
|
399
407
|
const instance = this._instance;
|
|
400
|
-
openDropdown
|
|
408
|
+
openDropdown$
|
|
409
|
+
.pipe(switchMap(() => {
|
|
401
410
|
const pressDown$ = merge(fromEvent(doc, 'touchstart', { capture: true }), fromEvent(doc, 'mousedown', { capture: true })).pipe(auditTime(0), tap((event) => {
|
|
402
|
-
if (instance.countryList.contains(event.target) ||
|
|
411
|
+
if (instance.countryList.contains(event.target) ||
|
|
412
|
+
instance.selectedFlag.contains(event.target)) {
|
|
403
413
|
return;
|
|
404
414
|
}
|
|
405
415
|
instance._closeDropdown();
|
|
@@ -412,21 +422,25 @@ class TheSeamTelInputDirective {
|
|
|
412
422
|
instance._closeDropdown();
|
|
413
423
|
}));
|
|
414
424
|
return merge(pressDown$, flagBtnClick$).pipe(takeUntil(closeDropdown$));
|
|
415
|
-
}), takeUntil(this._ngUnsubscribe))
|
|
425
|
+
}), takeUntil(this._ngUnsubscribe))
|
|
426
|
+
.subscribe();
|
|
416
427
|
const flagsContainer = this._instance?.selectedFlag;
|
|
417
428
|
if (flagsContainer) {
|
|
418
|
-
fromEvent(flagsContainer, 'keydown', { capture: true })
|
|
429
|
+
fromEvent(flagsContainer, 'keydown', { capture: true })
|
|
430
|
+
.pipe(tap((e) => {
|
|
419
431
|
const control = this._ngControl;
|
|
420
432
|
if (control) {
|
|
421
433
|
const disabled = control.disabled ?? false;
|
|
422
|
-
if (disabled &&
|
|
434
|
+
if (disabled &&
|
|
435
|
+
['ArrowUp', 'Up', 'ArrowDown', 'Down', ' ', 'Enter'].indexOf(e.key) !== -1) {
|
|
423
436
|
// prevent form from being submitted if "ENTER" was pressed
|
|
424
437
|
e.preventDefault();
|
|
425
438
|
// prevent event from being handled again by document
|
|
426
439
|
e.stopPropagation();
|
|
427
440
|
}
|
|
428
441
|
}
|
|
429
|
-
}), takeUntil(this._ngUnsubscribe))
|
|
442
|
+
}), takeUntil(this._ngUnsubscribe))
|
|
443
|
+
.subscribe();
|
|
430
444
|
}
|
|
431
445
|
});
|
|
432
446
|
}
|
|
@@ -448,10 +462,10 @@ class TheSeamTelInputDirective {
|
|
|
448
462
|
getHostElement() {
|
|
449
463
|
return this._elementRef.nativeElement;
|
|
450
464
|
}
|
|
451
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
452
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.
|
|
465
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: TheSeamTelInputDirective, deps: [{ token: i0.ElementRef }, { token: i1.AssetLoaderService }, { token: i0.NgZone }, { token: DOCUMENT, optional: true }, { token: i2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
466
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.7", type: TheSeamTelInputDirective, isStandalone: true, selector: "input[seamTelInput]", inputs: { value: "value" }, host: { properties: { "attr.type": "this._attrType" } }, exportAs: ["seamTelInput"], ngImport: i0 });
|
|
453
467
|
}
|
|
454
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
468
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: TheSeamTelInputDirective, decorators: [{
|
|
455
469
|
type: Directive,
|
|
456
470
|
args: [{
|
|
457
471
|
selector: 'input[seamTelInput]',
|
|
@@ -490,7 +504,9 @@ class TheSeamTelInputComponent {
|
|
|
490
504
|
_focusOrigin = null;
|
|
491
505
|
_hasInvalidCss$;
|
|
492
506
|
required = false;
|
|
493
|
-
get disabled() {
|
|
507
|
+
get disabled() {
|
|
508
|
+
return this._disabled;
|
|
509
|
+
}
|
|
494
510
|
set disabled(value) {
|
|
495
511
|
const newValue = coerceBooleanProperty(value);
|
|
496
512
|
if (this._control.disabled !== newValue) {
|
|
@@ -513,11 +529,19 @@ class TheSeamTelInputComponent {
|
|
|
513
529
|
* component to receive `focus` event from javascript, but not get focused by
|
|
514
530
|
* keyboard navigation.
|
|
515
531
|
*/
|
|
516
|
-
set tabIndex(value) {
|
|
517
|
-
|
|
532
|
+
set tabIndex(value) {
|
|
533
|
+
this._tabIndex = coerceNumberProperty(value);
|
|
534
|
+
}
|
|
535
|
+
get tabIndex() {
|
|
536
|
+
return this._tabIndex;
|
|
537
|
+
}
|
|
518
538
|
_tabIndex = -1;
|
|
519
|
-
get _attrDisabled() {
|
|
520
|
-
|
|
539
|
+
get _attrDisabled() {
|
|
540
|
+
return this.disabled || null;
|
|
541
|
+
}
|
|
542
|
+
get _attrTabIndex() {
|
|
543
|
+
return this.disabled ? -1 : this.tabIndex || 0;
|
|
544
|
+
}
|
|
521
545
|
/** Name value will be applied to the input element if present */
|
|
522
546
|
name = null;
|
|
523
547
|
/** The value attribute of the native input element */
|
|
@@ -558,11 +582,14 @@ class TheSeamTelInputComponent {
|
|
|
558
582
|
const telInputBlurEvent$ = this._telInputDirective
|
|
559
583
|
? fromEvent(this._telInputDirective.getHostElement(), 'blur')
|
|
560
584
|
: of();
|
|
561
|
-
this._hasInvalidCss$ = defer(() => of(
|
|
585
|
+
this._hasInvalidCss$ = defer(() => of(this._injector.get(NgControl, null, { self: true })?.control ||
|
|
586
|
+
undefined)).pipe(switchMap((control) => {
|
|
562
587
|
if (control) {
|
|
563
588
|
return merge(control.valueChanges, control.statusChanges, telInputBlurEvent$).pipe(auditTime(0), map(() => {
|
|
564
589
|
const inputControl = this._inputDirective?.ngControl;
|
|
565
|
-
return control.invalid &&
|
|
590
|
+
return (control.invalid &&
|
|
591
|
+
(inputControl?.dirty ||
|
|
592
|
+
inputControl?.touched));
|
|
566
593
|
}));
|
|
567
594
|
}
|
|
568
595
|
return of(false);
|
|
@@ -570,8 +597,13 @@ class TheSeamTelInputComponent {
|
|
|
570
597
|
}
|
|
571
598
|
/** @ignore */
|
|
572
599
|
ngOnInit() {
|
|
573
|
-
this._focusMonitor
|
|
574
|
-
|
|
600
|
+
this._focusMonitor
|
|
601
|
+
.monitor(this._elementRef, true)
|
|
602
|
+
.pipe(takeUntil(this._ngUnsubscribe))
|
|
603
|
+
.subscribe((origin) => (this._focusOrigin = origin));
|
|
604
|
+
this._control.valueChanges
|
|
605
|
+
.pipe(takeUntil(this._ngUnsubscribe))
|
|
606
|
+
.subscribe((v) => {
|
|
575
607
|
const value = this._telInputDirective?.getFullNumber();
|
|
576
608
|
// console.log('valueChanges', v, value)
|
|
577
609
|
this.value = value;
|
|
@@ -627,28 +659,32 @@ class TheSeamTelInputComponent {
|
|
|
627
659
|
hasFocus() {
|
|
628
660
|
return this._focusOrigin !== null && this._focusOrigin !== undefined;
|
|
629
661
|
}
|
|
630
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
631
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
662
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: TheSeamTelInputComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Injector }, { token: i0.ElementRef }, { token: i1$1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
|
|
663
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.7", type: TheSeamTelInputComponent, isStandalone: true, selector: "seam-tel-input", inputs: { required: "required", disabled: "disabled", tabIndex: "tabIndex", name: "name", value: "value" }, outputs: { change: "change" }, host: { listeners: { "focus": "_onFocus($event)" }, properties: { "attr.disabled": "this._attrDisabled", "attr.tabindex": "this._attrTabIndex" } }, providers: [
|
|
664
|
+
{
|
|
632
665
|
provide: NG_VALUE_ACCESSOR,
|
|
633
666
|
useExisting: forwardRef(() => TheSeamTelInputComponent),
|
|
634
|
-
multi: true
|
|
635
|
-
}
|
|
667
|
+
multi: true,
|
|
668
|
+
},
|
|
669
|
+
], viewQueries: [{ propertyName: "_telInputDirective", first: true, predicate: TheSeamTelInputDirective, descendants: true, static: true }, { propertyName: "_inputDirective", first: true, predicate: InputDirective, descendants: true, static: true }, { propertyName: "_inputElementRef", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: "<input\n seamTelInput\n seamInput\n [formControl]=\"_control\"\n [class.is-invalid]=\"_hasInvalidCss$ | async\"\n [required]=\"required\"\n/>\n", styles: [":host{display:block}:host[disabled] ::ng-deep .iti--allow-dropdown .iti__flag-container:hover{cursor:default}:host[disabled] ::ng-deep .iti--allow-dropdown .iti__flag-container:hover .iti__selected-flag{background-color:transparent}:host[disabled] ::ng-deep .iti--allow-dropdown .iti__arrow{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TheSeamFormFieldModule }, { kind: "directive", type: i3.InputDirective, selector: "input[seamInput], textarea[seamInput], ng-select[seamInput], seam-tel-input[seamInput], quill-editor[seamInput], seam-google-maps[seamInput], seam-rich-text[seamInput]", inputs: ["seamInputSize", "id", "type", "placeholder", "required", "disabled", "readonly"], exportAs: ["seamInput"] }, { kind: "directive", type: TheSeamTelInputDirective, selector: "input[seamTelInput]", inputs: ["value"], exportAs: ["seamTelInput"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
636
670
|
}
|
|
637
671
|
__decorate([
|
|
638
672
|
InputBoolean()
|
|
639
673
|
], TheSeamTelInputComponent.prototype, "required", void 0);
|
|
640
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
674
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: TheSeamTelInputComponent, decorators: [{
|
|
641
675
|
type: Component,
|
|
642
|
-
args: [{ selector: 'seam-tel-input', providers: [
|
|
676
|
+
args: [{ selector: 'seam-tel-input', providers: [
|
|
677
|
+
{
|
|
643
678
|
provide: NG_VALUE_ACCESSOR,
|
|
644
679
|
useExisting: forwardRef(() => TheSeamTelInputComponent),
|
|
645
|
-
multi: true
|
|
646
|
-
}
|
|
680
|
+
multi: true,
|
|
681
|
+
},
|
|
682
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
647
683
|
CommonModule,
|
|
648
684
|
ReactiveFormsModule,
|
|
649
685
|
TheSeamFormFieldModule,
|
|
650
686
|
TheSeamTelInputDirective,
|
|
651
|
-
], template: "<input
|
|
687
|
+
], template: "<input\n seamTelInput\n seamInput\n [formControl]=\"_control\"\n [class.is-invalid]=\"_hasInvalidCss$ | async\"\n [required]=\"required\"\n/>\n", styles: [":host{display:block}:host[disabled] ::ng-deep .iti--allow-dropdown .iti__flag-container:hover{cursor:default}:host[disabled] ::ng-deep .iti--allow-dropdown .iti__flag-container:hover .iti__selected-flag{background-color:transparent}:host[disabled] ::ng-deep .iti--allow-dropdown .iti__arrow{display:none}\n"] }]
|
|
652
688
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Injector }, { type: i0.ElementRef }, { type: i1$1.FocusMonitor }], propDecorators: { required: [{
|
|
653
689
|
type: Input
|
|
654
690
|
}], disabled: [{
|
|
@@ -687,7 +723,7 @@ function telInputValidator(control) {
|
|
|
687
723
|
if (typeof value !== 'string' || value.length === 0) {
|
|
688
724
|
return Promise.resolve(null);
|
|
689
725
|
}
|
|
690
|
-
return getIntlTelInputUtils().then(utils => {
|
|
726
|
+
return getIntlTelInputUtils().then((utils) => {
|
|
691
727
|
const data = processCountryCodes(globalIntlTelInputGlobals().getCountryData());
|
|
692
728
|
const dialCode = getDialCode(data, value);
|
|
693
729
|
const countryCode = getCountryCode(data, dialCode);
|
|
@@ -701,7 +737,7 @@ function telInputValidator(control) {
|
|
|
701
737
|
if (!utils.isValidNumber(number, countryCode)) {
|
|
702
738
|
const code = utils.getValidationError(number, countryCode);
|
|
703
739
|
const message = getValidationErrorMessage(code);
|
|
704
|
-
return {
|
|
740
|
+
return { telInput: { code, message } };
|
|
705
741
|
}
|
|
706
742
|
return null;
|
|
707
743
|
});
|
|
@@ -715,9 +751,11 @@ class TheSeamPhoneNumberPipe {
|
|
|
715
751
|
constructor(_cdr) {
|
|
716
752
|
this._cdr = _cdr;
|
|
717
753
|
}
|
|
718
|
-
transform(phoneNumber, numberFormat = intlTelInputUtils.numberFormat
|
|
754
|
+
transform(phoneNumber, numberFormat = intlTelInputUtils.numberFormat
|
|
755
|
+
.INTERNATIONAL) {
|
|
719
756
|
// console.log('transform', phoneNumber, numberFormat)
|
|
720
|
-
if (this._latestPhoneNumber !== phoneNumber ||
|
|
757
|
+
if (this._latestPhoneNumber !== phoneNumber ||
|
|
758
|
+
this._latestNumberFormat !== numberFormat) {
|
|
721
759
|
this._transform(phoneNumber, numberFormat);
|
|
722
760
|
}
|
|
723
761
|
this._latestPhoneNumber = phoneNumber;
|
|
@@ -744,38 +782,36 @@ class TheSeamPhoneNumberPipe {
|
|
|
744
782
|
// this._cdr.markForCheck()
|
|
745
783
|
this._cdr.detectChanges();
|
|
746
784
|
}
|
|
747
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
748
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.
|
|
785
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: TheSeamPhoneNumberPipe, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
786
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.7", ngImport: i0, type: TheSeamPhoneNumberPipe, isStandalone: false, name: "phoneNumber", pure: false });
|
|
749
787
|
}
|
|
750
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
788
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: TheSeamPhoneNumberPipe, decorators: [{
|
|
751
789
|
type: Pipe,
|
|
752
790
|
args: [{
|
|
753
791
|
name: 'phoneNumber',
|
|
754
792
|
pure: false,
|
|
755
|
-
standalone: false
|
|
793
|
+
standalone: false,
|
|
756
794
|
}]
|
|
757
795
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
|
|
758
796
|
|
|
759
797
|
class TheSeamTelInputModule {
|
|
760
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
761
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
798
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: TheSeamTelInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
799
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.7", ngImport: i0, type: TheSeamTelInputModule, declarations: [TheSeamPhoneNumberPipe], imports: [CommonModule,
|
|
762
800
|
ReactiveFormsModule,
|
|
763
801
|
TheSeamFormFieldModule,
|
|
764
802
|
TheSeamTelInputDirective,
|
|
765
803
|
TheSeamTelInputComponent], exports: [TheSeamTelInputDirective,
|
|
766
804
|
TheSeamTelInputComponent,
|
|
767
805
|
TheSeamPhoneNumberPipe] });
|
|
768
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
806
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: TheSeamTelInputModule, imports: [CommonModule,
|
|
769
807
|
ReactiveFormsModule,
|
|
770
808
|
TheSeamFormFieldModule,
|
|
771
809
|
TheSeamTelInputComponent] });
|
|
772
810
|
}
|
|
773
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
811
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: TheSeamTelInputModule, decorators: [{
|
|
774
812
|
type: NgModule,
|
|
775
813
|
args: [{
|
|
776
|
-
declarations: [
|
|
777
|
-
TheSeamPhoneNumberPipe
|
|
778
|
-
],
|
|
814
|
+
declarations: [TheSeamPhoneNumberPipe],
|
|
779
815
|
imports: [
|
|
780
816
|
CommonModule,
|
|
781
817
|
ReactiveFormsModule,
|
|
@@ -786,8 +822,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
786
822
|
exports: [
|
|
787
823
|
TheSeamTelInputDirective,
|
|
788
824
|
TheSeamTelInputComponent,
|
|
789
|
-
TheSeamPhoneNumberPipe
|
|
790
|
-
]
|
|
825
|
+
TheSeamPhoneNumberPipe,
|
|
826
|
+
],
|
|
791
827
|
}]
|
|
792
828
|
}] });
|
|
793
829
|
|
|
@@ -796,8 +832,7 @@ class TheSeamTelInputHarness extends ComponentHarness {
|
|
|
796
832
|
_input = this.locatorFor('input');
|
|
797
833
|
/** Creates a `HarnessPredicate` used to locate a particular `TheSeamTelInputHarness`. */
|
|
798
834
|
static with(options) {
|
|
799
|
-
return new HarnessPredicate(TheSeamTelInputHarness, options)
|
|
800
|
-
.addOption('field name', options.name, (harness, name) => HarnessPredicate.stringMatches(harness.getName(), name));
|
|
835
|
+
return new HarnessPredicate(TheSeamTelInputHarness, options).addOption('field name', options.name, (harness, name) => HarnessPredicate.stringMatches(harness.getName(), name));
|
|
801
836
|
}
|
|
802
837
|
async getName() {
|
|
803
838
|
return (await this._input()).getAttribute('name');
|
|
@@ -819,7 +854,7 @@ class TheSeamTelInputHarness extends ComponentHarness {
|
|
|
819
854
|
// TODO: Find out why setInputValue() doesn't update the FormControl.
|
|
820
855
|
// return (await this._input()).setInputValue(value)
|
|
821
856
|
await (await this._input()).click();
|
|
822
|
-
await this._input().then(x => x.setInputValue(''));
|
|
857
|
+
await this._input().then((x) => x.setInputValue(''));
|
|
823
858
|
return (await this._input()).sendKeys(value);
|
|
824
859
|
}
|
|
825
860
|
async _waitOnInstance() {
|