@bravura/ui 3.8.0 → 4.0.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/CHANGELOG.md +579 -557
- package/LICENSE +6 -6
- package/README.md +56 -54
- package/alert/alert-container.component.d.ts +1 -1
- package/alert/alert-message.component.d.ts +1 -1
- package/behavior/await.directive.d.ts +1 -1
- package/behavior/observe-content-class.directive.d.ts +1 -1
- package/behavior/sizing.directive.d.ts +1 -1
- package/clip-note/clip-note.directive.d.ts +1 -1
- package/currency-input/currency-input.directive.d.ts +1 -1
- package/decimal-input/decimal-input.directive.d.ts +1 -1
- package/discrete-input/discrete-input.component.d.ts +1 -1
- package/esm2022/alert/alert-container.component.mjs +207 -0
- package/esm2022/alert/alert-message.component.mjs +101 -0
- package/esm2022/alert/alert.module.mjs +22 -0
- package/{esm2020 → esm2022}/alert/public-api.mjs +1 -1
- package/esm2022/alert/testing/test-api.mjs +44 -0
- package/{esm2020 → esm2022}/behavior/await.directive.mjs +6 -6
- package/esm2022/behavior/behavior.module.mjs +37 -0
- package/{esm2020 → esm2022}/behavior/observe-content-class.directive.mjs +5 -5
- package/{esm2020 → esm2022}/behavior/public-api.mjs +1 -1
- package/esm2022/behavior/sizing-monitor.directive.mjs +31 -0
- package/esm2022/behavior/sizing.directive.mjs +256 -0
- package/esm2022/clip-note/clip-note.component.mjs +216 -0
- package/esm2022/clip-note/clip-note.directive.mjs +141 -0
- package/esm2022/clip-note/clip-note.module.mjs +32 -0
- package/{esm2020 → esm2022}/clip-note/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/common/common-utils.mjs +1 -1
- package/{esm2020 → esm2022}/common/common.module.mjs +7 -7
- package/{esm2020 → esm2022}/common/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/currency-input/currency-input.directive.mjs +6 -6
- package/esm2022/currency-input/currency-input.module.mjs +19 -0
- package/{esm2020 → esm2022}/currency-input/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/decimal-input/decimal-input.directive.mjs +9 -9
- package/{esm2020 → esm2022}/decimal-input/decimal-input.module.mjs +5 -5
- package/esm2022/discrete-input/discrete-input.component.mjs +337 -0
- package/esm2022/discrete-input/discrete-input.module.mjs +21 -0
- package/{esm2020 → esm2022}/discrete-input/public-api.mjs +1 -1
- package/esm2022/file-upload/file-upload.component.mjs +400 -0
- package/esm2022/file-upload/file-upload.module.mjs +44 -0
- package/esm2022/file-upload/file-upload.service.mjs +29 -0
- package/{esm2020 → esm2022}/file-upload/public-api.mjs +1 -1
- package/esm2022/form-field/form-field.component.mjs +82 -0
- package/esm2022/form-field/form-field.module.mjs +33 -0
- package/{esm2020 → esm2022}/form-field/public-api.mjs +1 -1
- package/esm2022/icon-font/icon-font.module.mjs +22 -0
- package/{esm2020 → esm2022}/icon-font/icon.directive.mjs +5 -5
- package/{esm2020 → esm2022}/icon-font/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/icon-font/utilities.mjs +1 -1
- package/esm2022/panel/panel-section.component.mjs +41 -0
- package/esm2022/panel/panel.component.mjs +87 -0
- package/esm2022/panel/panel.module.mjs +23 -0
- package/{esm2020 → esm2022}/panel/public-api.mjs +1 -1
- package/esm2022/panel/tinted.directive.mjs +60 -0
- package/esm2022/phone-number/phone-number.directive.mjs +188 -0
- package/{esm2020 → esm2022}/phone-number/phone-number.module.mjs +5 -5
- package/{esm2020 → esm2022}/phone-number/phone-number.pipe.mjs +6 -6
- package/esm2022/phone-number/phone-number.validator.mjs +64 -0
- package/{esm2020 → esm2022}/phone-number/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/public-api.mjs +1 -1
- package/esm2022/radio-panel/radio-panel-item.component.mjs +93 -0
- package/esm2022/radio-panel/radio-panel.component.mjs +81 -0
- package/{esm2020 → esm2022}/radio-panel/radio-panel.module.mjs +5 -5
- package/esm2022/radio-panel/testing/test-api.mjs +46 -0
- package/{esm2020 → esm2022}/selection-panel/public-api.mjs +1 -1
- package/esm2022/selection-panel/selection-panel-item.component.mjs +166 -0
- package/esm2022/selection-panel/selection-panel.directive.mjs +119 -0
- package/esm2022/selection-panel/selection-panel.module.mjs +23 -0
- package/{esm2020 → esm2022}/skeletons/public-api.mjs +1 -1
- package/esm2022/skeletons/skeleton-loader-presets.directive.mjs +83 -0
- package/{esm2020 → esm2022}/skeletons/skeleton-loader.component.mjs +5 -5
- package/esm2022/skeletons/skeletons.module.mjs +35 -0
- package/{esm2020 → esm2022}/stepper/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/stepper/stepper-animation.mjs +1 -1
- package/esm2022/stepper/stepper.component.mjs +176 -0
- package/esm2022/stepper/stepper.module.mjs +52 -0
- package/{esm2020 → esm2022}/tooltip/public-api.mjs +1 -1
- package/esm2022/tooltip/tooltip.component.mjs +63 -0
- package/esm2022/tooltip/tooltip.directive.mjs +148 -0
- package/esm2022/tooltip/tooltip.module.mjs +25 -0
- package/{fesm2020 → fesm2022}/bravura-ui-alert-testing.mjs +2 -2
- package/fesm2022/bravura-ui-alert-testing.mjs.map +1 -0
- package/fesm2022/bravura-ui-alert.mjs +327 -0
- package/fesm2022/bravura-ui-alert.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-behavior.mjs +45 -45
- package/fesm2022/bravura-ui-behavior.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-clip-note.mjs +70 -70
- package/fesm2022/bravura-ui-clip-note.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-common.mjs +6 -6
- package/fesm2022/bravura-ui-common.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-currency-input.mjs +11 -11
- package/fesm2022/bravura-ui-currency-input.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-decimal-input.mjs +12 -12
- package/fesm2022/bravura-ui-decimal-input.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-discrete-input.mjs +48 -48
- package/fesm2022/bravura-ui-discrete-input.mjs.map +1 -0
- package/fesm2022/bravura-ui-file-upload.mjs +474 -0
- package/fesm2022/bravura-ui-file-upload.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-form-field.mjs +19 -19
- package/fesm2022/bravura-ui-form-field.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-icon-font.mjs +8 -8
- package/fesm2022/bravura-ui-icon-font.mjs.map +1 -0
- package/fesm2022/bravura-ui-panel.mjs +206 -0
- package/fesm2022/bravura-ui-panel.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-phone-number.mjs +30 -30
- package/fesm2022/bravura-ui-phone-number.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-radio-panel-testing.mjs +5 -6
- package/fesm2022/bravura-ui-radio-panel-testing.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-radio-panel.mjs +31 -31
- package/fesm2022/bravura-ui-radio-panel.mjs.map +1 -0
- package/fesm2022/bravura-ui-selection-panel.mjs +306 -0
- package/fesm2022/bravura-ui-selection-panel.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-skeletons.mjs +43 -43
- package/fesm2022/bravura-ui-skeletons.mjs.map +1 -0
- package/fesm2022/bravura-ui-stepper.mjs +251 -0
- package/fesm2022/bravura-ui-stepper.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/bravura-ui-tooltip.mjs +32 -24
- package/fesm2022/bravura-ui-tooltip.mjs.map +1 -0
- package/fesm2022/bravura-ui.mjs.map +1 -0
- package/file-upload/file-upload.component.d.ts +1 -1
- package/form-field/form-field.component.d.ts +1 -1
- package/icon-font/icon.directive.d.ts +1 -1
- package/package.json +76 -120
- package/panel/panel.component.d.ts +1 -1
- package/panel/tinted.directive.d.ts +1 -1
- package/phone-number/phone-number.directive.d.ts +1 -1
- package/phone-number/phone-number.validator.d.ts +2 -2
- package/radio-panel/radio-panel-item.component.d.ts +1 -1
- package/radio-panel/radio-panel.component.d.ts +1 -1
- package/radio-panel/testing/test-api.d.ts +2 -3
- package/selection-panel/selection-panel-item.component.d.ts +1 -1
- package/selection-panel/selection-panel.directive.d.ts +1 -1
- package/skeletons/skeleton-loader-presets.directive.d.ts +3 -3
- package/stepper/stepper.component.d.ts +1 -1
- package/theme/_bui-card.scss +56 -56
- package/theme/_ui-theme.scss +112 -112
- package/theme/global-style-by-bootstrap.scss +3 -3
- package/theme/global-style-by-tailwind.scss +3 -3
- package/theme/scrollbar.scss +40 -40
- package/tooltip/tooltip.component.d.ts +2 -0
- package/tooltip/tooltip.directive.d.ts +3 -5
- package/esm2020/alert/alert-container.component.mjs +0 -207
- package/esm2020/alert/alert-message.component.mjs +0 -102
- package/esm2020/alert/alert.module.mjs +0 -22
- package/esm2020/alert/testing/test-api.mjs +0 -44
- package/esm2020/behavior/behavior.module.mjs +0 -37
- package/esm2020/behavior/sizing-monitor.directive.mjs +0 -31
- package/esm2020/behavior/sizing.directive.mjs +0 -256
- package/esm2020/clip-note/clip-note.component.mjs +0 -216
- package/esm2020/clip-note/clip-note.directive.mjs +0 -141
- package/esm2020/clip-note/clip-note.module.mjs +0 -32
- package/esm2020/currency-input/currency-input.module.mjs +0 -19
- package/esm2020/discrete-input/discrete-input.component.mjs +0 -337
- package/esm2020/discrete-input/discrete-input.module.mjs +0 -21
- package/esm2020/file-upload/file-upload.component.mjs +0 -400
- package/esm2020/file-upload/file-upload.module.mjs +0 -44
- package/esm2020/file-upload/file-upload.service.mjs +0 -29
- package/esm2020/form-field/form-field.component.mjs +0 -82
- package/esm2020/form-field/form-field.module.mjs +0 -33
- package/esm2020/icon-font/icon-font.module.mjs +0 -22
- package/esm2020/panel/panel-section.component.mjs +0 -41
- package/esm2020/panel/panel.component.mjs +0 -87
- package/esm2020/panel/panel.module.mjs +0 -23
- package/esm2020/panel/tinted.directive.mjs +0 -60
- package/esm2020/phone-number/phone-number.directive.mjs +0 -188
- package/esm2020/phone-number/phone-number.validator.mjs +0 -64
- package/esm2020/radio-panel/radio-panel-item.component.mjs +0 -93
- package/esm2020/radio-panel/radio-panel.component.mjs +0 -81
- package/esm2020/radio-panel/testing/test-api.mjs +0 -47
- package/esm2020/selection-panel/selection-panel-item.component.mjs +0 -166
- package/esm2020/selection-panel/selection-panel.directive.mjs +0 -119
- package/esm2020/selection-panel/selection-panel.module.mjs +0 -23
- package/esm2020/skeletons/skeleton-loader-presets.directive.mjs +0 -83
- package/esm2020/skeletons/skeletons.module.mjs +0 -35
- package/esm2020/stepper/stepper.component.mjs +0 -176
- package/esm2020/stepper/stepper.module.mjs +0 -52
- package/esm2020/tooltip/tooltip.component.mjs +0 -54
- package/esm2020/tooltip/tooltip.directive.mjs +0 -149
- package/esm2020/tooltip/tooltip.module.mjs +0 -25
- package/fesm2015/bravura-ui-alert-testing.mjs +0 -64
- package/fesm2015/bravura-ui-alert-testing.mjs.map +0 -1
- package/fesm2015/bravura-ui-alert.mjs +0 -340
- package/fesm2015/bravura-ui-alert.mjs.map +0 -1
- package/fesm2015/bravura-ui-behavior.mjs +0 -515
- package/fesm2015/bravura-ui-behavior.mjs.map +0 -1
- package/fesm2015/bravura-ui-clip-note.mjs +0 -393
- package/fesm2015/bravura-ui-clip-note.mjs.map +0 -1
- package/fesm2015/bravura-ui-common.mjs +0 -96
- package/fesm2015/bravura-ui-common.mjs.map +0 -1
- package/fesm2015/bravura-ui-currency-input.mjs +0 -300
- package/fesm2015/bravura-ui-currency-input.mjs.map +0 -1
- package/fesm2015/bravura-ui-decimal-input.mjs +0 -145
- package/fesm2015/bravura-ui-decimal-input.mjs.map +0 -1
- package/fesm2015/bravura-ui-discrete-input.mjs +0 -365
- package/fesm2015/bravura-ui-discrete-input.mjs.map +0 -1
- package/fesm2015/bravura-ui-file-upload.mjs +0 -478
- package/fesm2015/bravura-ui-file-upload.mjs.map +0 -1
- package/fesm2015/bravura-ui-form-field.mjs +0 -120
- package/fesm2015/bravura-ui-form-field.mjs.map +0 -1
- package/fesm2015/bravura-ui-icon-font.mjs +0 -178
- package/fesm2015/bravura-ui-icon-font.mjs.map +0 -1
- package/fesm2015/bravura-ui-panel.mjs +0 -210
- package/fesm2015/bravura-ui-panel.mjs.map +0 -1
- package/fesm2015/bravura-ui-phone-number.mjs +0 -327
- package/fesm2015/bravura-ui-phone-number.mjs.map +0 -1
- package/fesm2015/bravura-ui-radio-panel-testing.mjs +0 -63
- package/fesm2015/bravura-ui-radio-panel-testing.mjs.map +0 -1
- package/fesm2015/bravura-ui-radio-panel.mjs +0 -200
- package/fesm2015/bravura-ui-radio-panel.mjs.map +0 -1
- package/fesm2015/bravura-ui-selection-panel.mjs +0 -311
- package/fesm2015/bravura-ui-selection-panel.mjs.map +0 -1
- package/fesm2015/bravura-ui-skeletons.mjs +0 -195
- package/fesm2015/bravura-ui-skeletons.mjs.map +0 -1
- package/fesm2015/bravura-ui-stepper.mjs +0 -253
- package/fesm2015/bravura-ui-stepper.mjs.map +0 -1
- package/fesm2015/bravura-ui-tooltip.mjs +0 -229
- package/fesm2015/bravura-ui-tooltip.mjs.map +0 -1
- package/fesm2015/bravura-ui.mjs.map +0 -1
- package/fesm2020/bravura-ui-alert-testing.mjs.map +0 -1
- package/fesm2020/bravura-ui-alert.mjs +0 -328
- package/fesm2020/bravura-ui-alert.mjs.map +0 -1
- package/fesm2020/bravura-ui-behavior.mjs.map +0 -1
- package/fesm2020/bravura-ui-clip-note.mjs.map +0 -1
- package/fesm2020/bravura-ui-common.mjs.map +0 -1
- package/fesm2020/bravura-ui-currency-input.mjs.map +0 -1
- package/fesm2020/bravura-ui-decimal-input.mjs.map +0 -1
- package/fesm2020/bravura-ui-discrete-input.mjs.map +0 -1
- package/fesm2020/bravura-ui-file-upload.mjs +0 -474
- package/fesm2020/bravura-ui-file-upload.mjs.map +0 -1
- package/fesm2020/bravura-ui-form-field.mjs.map +0 -1
- package/fesm2020/bravura-ui-icon-font.mjs.map +0 -1
- package/fesm2020/bravura-ui-panel.mjs +0 -206
- package/fesm2020/bravura-ui-panel.mjs.map +0 -1
- package/fesm2020/bravura-ui-phone-number.mjs.map +0 -1
- package/fesm2020/bravura-ui-radio-panel-testing.mjs.map +0 -1
- package/fesm2020/bravura-ui-radio-panel.mjs.map +0 -1
- package/fesm2020/bravura-ui-selection-panel.mjs +0 -306
- package/fesm2020/bravura-ui-selection-panel.mjs.map +0 -1
- package/fesm2020/bravura-ui-skeletons.mjs.map +0 -1
- package/fesm2020/bravura-ui-stepper.mjs +0 -251
- package/fesm2020/bravura-ui-stepper.mjs.map +0 -1
- package/fesm2020/bravura-ui-tooltip.mjs.map +0 -1
- package/fesm2020/bravura-ui.mjs +0 -8
- package/fesm2020/bravura-ui.mjs.map +0 -1
- /package/{esm2020 → esm2022}/alert/bravura-ui-alert.mjs +0 -0
- /package/{esm2020 → esm2022}/alert/testing/bravura-ui-alert-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/behavior/bravura-ui-behavior.mjs +0 -0
- /package/{esm2020 → esm2022}/bravura-ui.mjs +0 -0
- /package/{esm2020 → esm2022}/clip-note/bravura-ui-clip-note.mjs +0 -0
- /package/{esm2020 → esm2022}/common/bravura-ui-common.mjs +0 -0
- /package/{esm2020 → esm2022}/currency-input/bravura-ui-currency-input.mjs +0 -0
- /package/{esm2020 → esm2022}/decimal-input/bravura-ui-decimal-input.mjs +0 -0
- /package/{esm2020 → esm2022}/decimal-input/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/discrete-input/bravura-ui-discrete-input.mjs +0 -0
- /package/{esm2020 → esm2022}/file-upload/bravura-ui-file-upload.mjs +0 -0
- /package/{esm2020 → esm2022}/form-field/bravura-ui-form-field.mjs +0 -0
- /package/{esm2020 → esm2022}/icon-font/bravura-ui-icon-font.mjs +0 -0
- /package/{esm2020 → esm2022}/panel/bravura-ui-panel.mjs +0 -0
- /package/{esm2020 → esm2022}/phone-number/bravura-ui-phone-number.mjs +0 -0
- /package/{esm2020 → esm2022}/radio-panel/bravura-ui-radio-panel.mjs +0 -0
- /package/{esm2020 → esm2022}/radio-panel/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/radio-panel/testing/bravura-ui-radio-panel-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/selection-panel/bravura-ui-selection-panel.mjs +0 -0
- /package/{esm2020 → esm2022}/skeletons/bravura-ui-skeletons.mjs +0 -0
- /package/{esm2020 → esm2022}/stepper/bravura-ui-stepper.mjs +0 -0
- /package/{esm2020 → esm2022}/tooltip/bravura-ui-tooltip.mjs +0 -0
- /package/{fesm2015 → fesm2022}/bravura-ui.mjs +0 -0
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { LOCALE_ID, Pipe, Inject, forwardRef, Directive, Input, EventEmitter, Optional, Output, HostListener, NgModule } from '@angular/core';
|
|
4
|
-
import intlTelInput from 'intl-tel-input';
|
|
5
|
-
import { of } from 'rxjs';
|
|
6
|
-
import { debounceTime, take } from 'rxjs/operators';
|
|
7
|
-
import * as i1 from '@angular/forms';
|
|
8
|
-
import { NG_VALIDATORS } from '@angular/forms';
|
|
9
|
-
import * as i2 from '@angular/material/form-field';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
class PhoneNumberPipe {
|
|
15
|
-
constructor(_locale) {
|
|
16
|
-
this._locale = _locale;
|
|
17
|
-
}
|
|
18
|
-
transform(value, mode, renderLink) {
|
|
19
|
-
if (!value) {
|
|
20
|
-
return value;
|
|
21
|
-
}
|
|
22
|
-
const countryCode = getCountryCodeFromLocale(this._locale);
|
|
23
|
-
let format;
|
|
24
|
-
switch (mode) {
|
|
25
|
-
case 'NATIONAL':
|
|
26
|
-
format = intlTelInputUtils.numberFormat.NATIONAL;
|
|
27
|
-
break;
|
|
28
|
-
default:
|
|
29
|
-
format = intlTelInputUtils.numberFormat.INTERNATIONAL;
|
|
30
|
-
}
|
|
31
|
-
const result = intlTelInputUtils.formatNumber(value, countryCode, format);
|
|
32
|
-
if (renderLink) {
|
|
33
|
-
return `<a href="tel:${result}">${result}</a>`;
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
return result;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
PhoneNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: PhoneNumberPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
41
|
-
PhoneNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.6", ngImport: i0, type: PhoneNumberPipe, name: "buiPhone" });
|
|
42
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: PhoneNumberPipe, decorators: [{
|
|
43
|
-
type: Pipe,
|
|
44
|
-
args: [{
|
|
45
|
-
name: 'buiPhone',
|
|
46
|
-
pure: true
|
|
47
|
-
}]
|
|
48
|
-
}], ctorParameters: function () {
|
|
49
|
-
return [{ type: undefined, decorators: [{
|
|
50
|
-
type: Inject,
|
|
51
|
-
args: [LOCALE_ID]
|
|
52
|
-
}] }];
|
|
53
|
-
} });
|
|
54
|
-
function getCountryCodeFromLocale(locale) {
|
|
55
|
-
return locale.replace(/.+[-_]([a-z][a-z])$/i, '$1');
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @internal
|
|
60
|
-
*/
|
|
61
|
-
const SELECTOR = '[buiTelInput], input([type=tel])[ngModel], input([type=tel])[formControlName], input([type=tel])[formControl]';
|
|
62
|
-
/**
|
|
63
|
-
* @internal
|
|
64
|
-
*/
|
|
65
|
-
const PHONE_VALIDATOR = {
|
|
66
|
-
provide: NG_VALIDATORS,
|
|
67
|
-
useExisting: forwardRef(() => PhoneNumberValidator),
|
|
68
|
-
multi: true
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* @internal
|
|
72
|
-
*/
|
|
73
|
-
class PhoneNumberValidator {
|
|
74
|
-
constructor(_el) {
|
|
75
|
-
this._el = _el;
|
|
76
|
-
this.telType = 'FIXED_LINE';
|
|
77
|
-
}
|
|
78
|
-
static validateControl(inp, type, update) {
|
|
79
|
-
const err = { tel: true };
|
|
80
|
-
if (!inp.value) {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
const iti = inp.$$iti;
|
|
84
|
-
if (!iti) {
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
if (iti.isValidNumber()) {
|
|
88
|
-
const n = iti.getNumber(intlTelInputUtils.numberFormat.INTERNATIONAL);
|
|
89
|
-
if (update) {
|
|
90
|
-
inp.value = n;
|
|
91
|
-
}
|
|
92
|
-
const t = iti.getNumberType();
|
|
93
|
-
if (t !== intlTelInputUtils.numberType.FIXED_LINE_OR_MOBILE) {
|
|
94
|
-
if ((type === 'MOBILE' && t !== intlTelInputUtils.numberType.MOBILE) ||
|
|
95
|
-
(type === 'FIXED_LINE' && t !== intlTelInputUtils.numberType.FIXED_LINE)) {
|
|
96
|
-
return err;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
return err;
|
|
102
|
-
}
|
|
103
|
-
validate(_) {
|
|
104
|
-
return PhoneNumberValidator.validateControl(this._el.nativeElement, this.telType, false);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
PhoneNumberValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: PhoneNumberValidator, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
108
|
-
PhoneNumberValidator.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.6", type: PhoneNumberValidator, selector: "[buiTelInput], input([type=tel])[ngModel], input([type=tel])[formControlName], input([type=tel])[formControl]", inputs: { telType: "telType" }, providers: [PHONE_VALIDATOR], ngImport: i0 });
|
|
109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: PhoneNumberValidator, decorators: [{
|
|
110
|
-
type: Directive,
|
|
111
|
-
args: [{
|
|
112
|
-
selector: SELECTOR,
|
|
113
|
-
providers: [PHONE_VALIDATOR]
|
|
114
|
-
}]
|
|
115
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { telType: [{
|
|
116
|
-
type: Input
|
|
117
|
-
}] } });
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Add phone number validation support by specifying the `type` attribute as `tel` in an `<input>` element.
|
|
121
|
-
*
|
|
122
|
-
* To use this feature, please install a peer dependency `intl-tel-input` in your project and add the following
|
|
123
|
-
* to your application polyfills:
|
|
124
|
-
*
|
|
125
|
-
* ```javascript
|
|
126
|
-
* import 'intl-tel-input/build/js/utils.js';
|
|
127
|
-
* ```
|
|
128
|
-
*
|
|
129
|
-
* You will also need to add the following statements to one of your global SCSS files:
|
|
130
|
-
*
|
|
131
|
-
* ```scss
|
|
132
|
-
* $flagsImagePath: '~intl-tel-input/build/img/' !default;
|
|
133
|
-
* @import '~intl-tel-input/src/css/intlTelInput';
|
|
134
|
-
* ```
|
|
135
|
-
*/
|
|
136
|
-
class PhoneNumberDirective {
|
|
137
|
-
constructor(_el, _ngModel, _formControlName, _formControlDirective, _locale, _zone, _matField) {
|
|
138
|
-
this._el = _el;
|
|
139
|
-
this._ngModel = _ngModel;
|
|
140
|
-
this._formControlName = _formControlName;
|
|
141
|
-
this._formControlDirective = _formControlDirective;
|
|
142
|
-
this._locale = _locale;
|
|
143
|
-
this._zone = _zone;
|
|
144
|
-
this._matField = _matField;
|
|
145
|
-
/**
|
|
146
|
-
* The type of phone number to validate for
|
|
147
|
-
*/
|
|
148
|
-
this.telType = 'FIXED_LINE';
|
|
149
|
-
/**
|
|
150
|
-
* Disable country dropdown by setting this property to `false`.
|
|
151
|
-
*/
|
|
152
|
-
this.telDropdown = true;
|
|
153
|
-
/**
|
|
154
|
-
* This event is triggered when a new country is selected from the dropdown. The event detail is the ISO country code.
|
|
155
|
-
*/
|
|
156
|
-
this.telCountryChange = new EventEmitter();
|
|
157
|
-
this._reactive = false;
|
|
158
|
-
this._countryChangeListener = () => null;
|
|
159
|
-
}
|
|
160
|
-
/** @internal */
|
|
161
|
-
onInput() {
|
|
162
|
-
const err = PhoneNumberValidator.validateControl(this._input, this.telType, true);
|
|
163
|
-
this._control.patchValue(this._input.value, { emitEvent: false });
|
|
164
|
-
if (this._reactive && err) {
|
|
165
|
-
this._control.setErrors(Object.assign(Object.assign({}, this._control.errors), err));
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
ngOnInit() {
|
|
169
|
-
const ctrDirective = this._ngModel || this._formControlName || this._formControlDirective;
|
|
170
|
-
this._control = ctrDirective.control;
|
|
171
|
-
this._reactive = this._ngModel ? false : true;
|
|
172
|
-
this._input = this._el.nativeElement;
|
|
173
|
-
this._countryChangeListener = (() => {
|
|
174
|
-
this._zone.run(() => {
|
|
175
|
-
this._control.markAsDirty();
|
|
176
|
-
this._control.updateValueAndValidity({ emitEvent: true });
|
|
177
|
-
this.telCountryChange.emit(this._iti.getSelectedCountryData().iso2);
|
|
178
|
-
});
|
|
179
|
-
}).bind(this);
|
|
180
|
-
(PhoneNumberDirective.BYPASS_SHADOW_DETECTION ? of(0) : this._zone.onStable)
|
|
181
|
-
.pipe(debounceTime(10), take(1))
|
|
182
|
-
.subscribe(() => this.initElement());
|
|
183
|
-
}
|
|
184
|
-
ngOnDestroy() {
|
|
185
|
-
var _a;
|
|
186
|
-
this._input.removeEventListener('countrychange', this._countryChangeListener);
|
|
187
|
-
(_a = this._iti) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
188
|
-
}
|
|
189
|
-
ngOnChanges(changes) {
|
|
190
|
-
const td = changes.telDropdown;
|
|
191
|
-
if (td && !td.firstChange) {
|
|
192
|
-
this.ngOnDestroy();
|
|
193
|
-
this.ngOnInit();
|
|
194
|
-
}
|
|
195
|
-
const type = changes.telType;
|
|
196
|
-
if (type && !type.firstChange) {
|
|
197
|
-
this.onInput();
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
initElement() {
|
|
201
|
-
var _a;
|
|
202
|
-
const countryCode = getCountryCodeFromLocale(this._locale).toLowerCase();
|
|
203
|
-
const root = this._input.getRootNode();
|
|
204
|
-
if (!root.querySelector('#bui-tel-input-style')) {
|
|
205
|
-
const styleTag = document.createElement('style');
|
|
206
|
-
styleTag.id = 'bui-tel-input-style';
|
|
207
|
-
styleTag.innerText =
|
|
208
|
-
'.mat-mdc-form-field .bui-tel-input-placeholder:not(.mdc-floating-label--float-above){margin-left:44px;}' +
|
|
209
|
-
'.iti--allow-dropdown{margin-left:-8px}' +
|
|
210
|
-
'.bui-tel-input-with-value:disabled{cursor:pointer;}';
|
|
211
|
-
(root instanceof Document ? root.querySelector('head') : root).appendChild(styleTag);
|
|
212
|
-
}
|
|
213
|
-
this._iti = intlTelInput(this._input, {
|
|
214
|
-
initialCountry: countryCode,
|
|
215
|
-
placeholderNumberType: this.telType,
|
|
216
|
-
preferredCountries: [countryCode, ...['au', 'ca', 'nz', 'us', 'gb'].filter(c => c !== countryCode)],
|
|
217
|
-
dropdownContainer: root instanceof ShadowRoot ? root.querySelector('overlay-root') || root : root.body,
|
|
218
|
-
autoPlaceholder: 'off',
|
|
219
|
-
allowDropdown: this.telDropdown
|
|
220
|
-
});
|
|
221
|
-
this._input.$$iti = this._iti;
|
|
222
|
-
this._input.addEventListener('countrychange', this._countryChangeListener);
|
|
223
|
-
const frameTime = Date.now();
|
|
224
|
-
const postRenderWork = () => {
|
|
225
|
-
var _a, _b;
|
|
226
|
-
if (frameTime + PhoneNumberDirective.POST_RENDER_INIT_DELAY > Date.now()) {
|
|
227
|
-
window.requestAnimationFrame(postRenderWork);
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
let label;
|
|
231
|
-
if (((_a = this._matField) === null || _a === void 0 ? void 0 : _a.getLabelId()) && typeof root.getElementById === 'function') {
|
|
232
|
-
label = root.getElementById(this._matField.getLabelId());
|
|
233
|
-
label === null || label === void 0 ? void 0 : label.classList.remove('bui-tel-input-placeholder');
|
|
234
|
-
}
|
|
235
|
-
if (label && this.telDropdown) {
|
|
236
|
-
label.classList.add('bui-tel-input-placeholder');
|
|
237
|
-
}
|
|
238
|
-
if ((_b = this._input) === null || _b === void 0 ? void 0 : _b.value) {
|
|
239
|
-
this._input.classList.add('bui-tel-input-with-value');
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
window.requestAnimationFrame(postRenderWork);
|
|
243
|
-
this._input.addEventListener('click', () => {
|
|
244
|
-
var _a;
|
|
245
|
-
if (((_a = this._control) === null || _a === void 0 ? void 0 : _a.disabled) && this._control.value) {
|
|
246
|
-
window.location.href = 'tel://' + this._control.value;
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
(_a = this._control) === null || _a === void 0 ? void 0 : _a.registerOnDisabledChange(isDisabled => this._patchValueByState(isDisabled));
|
|
250
|
-
this._patchValueByState(this._control.disabled);
|
|
251
|
-
}
|
|
252
|
-
_patchValueByState(isDisabled) {
|
|
253
|
-
setTimeout(() => {
|
|
254
|
-
var _a, _b;
|
|
255
|
-
if (!isDisabled) {
|
|
256
|
-
this.onInput();
|
|
257
|
-
}
|
|
258
|
-
else {
|
|
259
|
-
const v = this._iti.getNumber(intlTelInputUtils.numberFormat.NATIONAL);
|
|
260
|
-
this._input.value = v;
|
|
261
|
-
(_a = this._control) === null || _a === void 0 ? void 0 : _a.patchValue((_b = this._input) === null || _b === void 0 ? void 0 : _b.value, { emitEvent: false });
|
|
262
|
-
}
|
|
263
|
-
}, 20);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* @ignore
|
|
268
|
-
*/
|
|
269
|
-
PhoneNumberDirective.POST_RENDER_INIT_DELAY = 20;
|
|
270
|
-
/**
|
|
271
|
-
* @ignore
|
|
272
|
-
*/
|
|
273
|
-
PhoneNumberDirective.BYPASS_SHADOW_DETECTION = false;
|
|
274
|
-
PhoneNumberDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: PhoneNumberDirective, deps: [{ token: i0.ElementRef }, { token: i1.NgModel, optional: true }, { token: i1.FormControlName, optional: true }, { token: i1.FormControlDirective, optional: true }, { token: LOCALE_ID }, { token: i0.NgZone }, { token: i2.MatFormField, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
275
|
-
PhoneNumberDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.6", type: PhoneNumberDirective, selector: "[buiTelInput], input([type=tel])[ngModel], input([type=tel])[formControlName], input([type=tel])[formControl]", inputs: { telType: "telType", telDropdown: "telDropdown" }, outputs: { telCountryChange: "telCountryChange" }, host: { listeners: { "input": "onInput()" } }, usesOnChanges: true, ngImport: i0 });
|
|
276
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: PhoneNumberDirective, decorators: [{
|
|
277
|
-
type: Directive,
|
|
278
|
-
args: [{
|
|
279
|
-
selector: SELECTOR
|
|
280
|
-
}]
|
|
281
|
-
}], ctorParameters: function () {
|
|
282
|
-
return [{ type: i0.ElementRef }, { type: i1.NgModel, decorators: [{
|
|
283
|
-
type: Optional
|
|
284
|
-
}] }, { type: i1.FormControlName, decorators: [{
|
|
285
|
-
type: Optional
|
|
286
|
-
}] }, { type: i1.FormControlDirective, decorators: [{
|
|
287
|
-
type: Optional
|
|
288
|
-
}] }, { type: undefined, decorators: [{
|
|
289
|
-
type: Inject,
|
|
290
|
-
args: [LOCALE_ID]
|
|
291
|
-
}] }, { type: i0.NgZone }, { type: i2.MatFormField, decorators: [{
|
|
292
|
-
type: Optional
|
|
293
|
-
}] }];
|
|
294
|
-
}, propDecorators: { telType: [{
|
|
295
|
-
type: Input
|
|
296
|
-
}], telDropdown: [{
|
|
297
|
-
type: Input
|
|
298
|
-
}], telCountryChange: [{
|
|
299
|
-
type: Output
|
|
300
|
-
}], onInput: [{
|
|
301
|
-
type: HostListener,
|
|
302
|
-
args: ['input']
|
|
303
|
-
}] } });
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* @internal
|
|
307
|
-
*/
|
|
308
|
-
class PhoneModule {
|
|
309
|
-
}
|
|
310
|
-
PhoneModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: PhoneModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
311
|
-
PhoneModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.6", ngImport: i0, type: PhoneModule, declarations: [PhoneNumberPipe, PhoneNumberDirective, PhoneNumberValidator], imports: [CommonModule], exports: [PhoneNumberDirective, PhoneNumberPipe, PhoneNumberValidator] });
|
|
312
|
-
PhoneModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: PhoneModule, imports: [CommonModule] });
|
|
313
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.6", ngImport: i0, type: PhoneModule, decorators: [{
|
|
314
|
-
type: NgModule,
|
|
315
|
-
args: [{
|
|
316
|
-
declarations: [PhoneNumberPipe, PhoneNumberDirective, PhoneNumberValidator],
|
|
317
|
-
imports: [CommonModule],
|
|
318
|
-
exports: [PhoneNumberDirective, PhoneNumberPipe, PhoneNumberValidator]
|
|
319
|
-
}]
|
|
320
|
-
}] });
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Generated bundle index. Do not edit.
|
|
324
|
-
*/
|
|
325
|
-
|
|
326
|
-
export { PhoneModule, PhoneNumberDirective, PhoneNumberPipe, PhoneNumberValidator };
|
|
327
|
-
//# sourceMappingURL=bravura-ui-phone-number.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bravura-ui-phone-number.mjs","sources":["../../../projects/ui/phone-number/phone-number.pipe.ts","../../../projects/ui/phone-number/phone-number.validator.ts","../../../projects/ui/phone-number/phone-number.directive.ts","../../../projects/ui/phone-number/phone-number.module.ts","../../../projects/ui/phone-number/bravura-ui-phone-number.ts"],"sourcesContent":["import { Inject, LOCALE_ID, Pipe, PipeTransform } from '@angular/core';\n\ndeclare const intlTelInputUtils: any;\n\n/**\n * @internal\n */\n@Pipe({\n\tname: 'buiPhone',\n\tpure: true\n})\nexport class PhoneNumberPipe implements PipeTransform {\n\tconstructor(@Inject(LOCALE_ID) private _locale: string) {}\n\n\ttransform(value: any, mode?: string, renderLink?: boolean): string {\n\t\tif (!value) {\n\t\t\treturn value;\n\t\t}\n\n\t\tconst countryCode = getCountryCodeFromLocale(this._locale);\n\n\t\tlet format: number;\n\t\tswitch (mode) {\n\t\t\tcase 'NATIONAL':\n\t\t\t\tformat = intlTelInputUtils.numberFormat.NATIONAL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tformat = intlTelInputUtils.numberFormat.INTERNATIONAL;\n\t\t}\n\t\tconst result = intlTelInputUtils.formatNumber(value, countryCode, format);\n\t\tif (renderLink) {\n\t\t\treturn `<a href=\"tel:${result}\">${result}</a>`;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n}\n\nexport function getCountryCodeFromLocale(locale: string): string {\n\treturn locale.replace(/.+[-_]([a-z][a-z])$/i, '$1');\n}\n","import { Directive, ElementRef, Input, StaticProvider, forwardRef } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, Validator } from '@angular/forms';\n\n/**\n * @internal\n */\nexport const SELECTOR =\n\t'[buiTelInput], input([type=tel])[ngModel], input([type=tel])[formControlName], input([type=tel])[formControl]';\n\n/**\n * @internal\n */\nexport const PHONE_VALIDATOR: StaticProvider = {\n\tprovide: NG_VALIDATORS,\n\tuseExisting: forwardRef(() => PhoneNumberValidator),\n\tmulti: true\n};\n\n/**\n * @internal\n */\nexport type TEL_TYPE = 'MOBILE' | 'FIXED_LINE_OR_MOBILE' | 'FIXED_LINE';\n\n/**\n * @internal\n */\ndeclare const intlTelInputUtils: any;\n\n/**\n * @internal\n */\n@Directive({\n\tselector: SELECTOR,\n\tproviders: [PHONE_VALIDATOR]\n})\nexport class PhoneNumberValidator implements Validator {\n\t@Input()\n\ttelType: TEL_TYPE = 'FIXED_LINE';\n\n\tstatic validateControl(inp: HTMLInputElement, type: TEL_TYPE, update: boolean): { [key: string]: any } | null {\n\t\tconst err = { tel: true };\n\t\tif (!inp.value) {\n\t\t\treturn null;\n\t\t}\n\t\tconst iti = (inp as any).$$iti;\n\t\tif (!iti) {\n\t\t\treturn null;\n\t\t}\n\t\tif (iti.isValidNumber()) {\n\t\t\tconst n = iti.getNumber(intlTelInputUtils.numberFormat.INTERNATIONAL);\n\t\t\tif (update) {\n\t\t\t\tinp.value = n;\n\t\t\t}\n\n\t\t\tconst t = iti.getNumberType();\n\t\t\tif (t !== intlTelInputUtils.numberType.FIXED_LINE_OR_MOBILE) {\n\t\t\t\tif (\n\t\t\t\t\t(type === 'MOBILE' && t !== intlTelInputUtils.numberType.MOBILE) ||\n\t\t\t\t\t(type === 'FIXED_LINE' && t !== intlTelInputUtils.numberType.FIXED_LINE)\n\t\t\t\t) {\n\t\t\t\t\treturn err;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\treturn err;\n\t}\n\n\tconstructor(private _el: ElementRef<HTMLInputElement>) {}\n\n\tvalidate(_: AbstractControl): { [key: string]: any } | null {\n\t\treturn PhoneNumberValidator.validateControl(this._el.nativeElement, this.telType, false);\n\t}\n}\n","import {\n\tDirective,\n\tElementRef,\n\tEventEmitter,\n\tHostListener,\n\tInject,\n\tInput,\n\tLOCALE_ID,\n\tNgZone,\n\tOnChanges,\n\tOnDestroy,\n\tOnInit,\n\tOptional,\n\tOutput,\n\tSimpleChanges\n} from '@angular/core';\nimport { UntypedFormControl, FormControlDirective, FormControlName, NgModel } from '@angular/forms';\nimport { MatFormField } from '@angular/material/form-field';\nimport intlTelInput from 'intl-tel-input';\nimport { of } from 'rxjs';\nimport { debounceTime, take } from 'rxjs/operators';\n\nimport { getCountryCodeFromLocale } from './phone-number.pipe';\nimport { PhoneNumberValidator, SELECTOR, TEL_TYPE } from './phone-number.validator';\n\n/**\n * @ignore\n */\ndeclare const intlTelInputUtils: any;\n\n/**\n * Add phone number validation support by specifying the `type` attribute as `tel` in an `<input>` element.\n *\n * To use this feature, please install a peer dependency `intl-tel-input` in your project and add the following\n * to your application polyfills:\n *\n * ```javascript\n * import 'intl-tel-input/build/js/utils.js';\n * ```\n *\n * You will also need to add the following statements to one of your global SCSS files:\n *\n * ```scss\n * $flagsImagePath: '~intl-tel-input/build/img/' !default;\n * @import '~intl-tel-input/src/css/intlTelInput';\n * ```\n */\n@Directive({\n\tselector: SELECTOR\n})\nexport class PhoneNumberDirective implements OnInit, OnChanges, OnDestroy {\n\t/**\n\t * @ignore\n\t */\n\tstatic POST_RENDER_INIT_DELAY = 20;\n\n\t/**\n\t * @ignore\n\t */\n\tstatic BYPASS_SHADOW_DETECTION = false;\n\n\t/**\n\t * The type of phone number to validate for\n\t */\n\t@Input()\n\ttelType: TEL_TYPE = 'FIXED_LINE';\n\n\t/**\n\t * Disable country dropdown by setting this property to `false`.\n\t */\n\t@Input()\n\ttelDropdown = true;\n\n\t/**\n\t * This event is triggered when a new country is selected from the dropdown. The event detail is the ISO country code.\n\t */\n\t@Output()\n\ttelCountryChange = new EventEmitter<string>();\n\n\tprivate _control: UntypedFormControl | undefined;\n\tprivate _reactive = false;\n\tprivate _countryChangeListener: () => void = () => null;\n\tprivate _input: HTMLInputElement | undefined;\n\tprivate _iti: any;\n\n\tconstructor(\n\t\tprivate _el: ElementRef<HTMLInputElement>,\n\t\t@Optional() private _ngModel: NgModel,\n\t\t@Optional() private _formControlName: FormControlName,\n\t\t@Optional() private _formControlDirective: FormControlDirective,\n\t\t@Inject(LOCALE_ID) private _locale: string,\n\t\tprivate _zone: NgZone,\n\t\t@Optional() private _matField: MatFormField\n\t) {}\n\n\t/** @internal */\n\t@HostListener('input')\n\tonInput() {\n\t\tconst err = PhoneNumberValidator.validateControl(this._input!, this.telType, true);\n\t\tthis._control!.patchValue(this._input!.value, { emitEvent: false });\n\n\t\tif (this._reactive && err) {\n\t\t\tthis._control!.setErrors({ ...this._control!.errors, ...err });\n\t\t}\n\t}\n\n\tngOnInit() {\n\t\tconst ctrDirective = this._ngModel || this._formControlName || this._formControlDirective;\n\t\tthis._control = ctrDirective.control as UntypedFormControl;\n\t\tthis._reactive = this._ngModel ? false : true;\n\t\tthis._input = this._el.nativeElement;\n\n\t\tthis._countryChangeListener = (() => {\n\t\t\tthis._zone.run(() => {\n\t\t\t\tthis._control!.markAsDirty();\n\t\t\t\tthis._control!.updateValueAndValidity({ emitEvent: true });\n\t\t\t\tthis.telCountryChange.emit(this._iti.getSelectedCountryData().iso2);\n\t\t\t});\n\t\t}).bind(this);\n\n\t\t(PhoneNumberDirective.BYPASS_SHADOW_DETECTION ? of(0 as any) : this._zone.onStable)\n\t\t\t.pipe(debounceTime(10), take(1))\n\t\t\t.subscribe(() => this.initElement());\n\t}\n\n\tngOnDestroy() {\n\t\tthis._input!.removeEventListener('countrychange', this._countryChangeListener);\n\t\tthis._iti?.destroy();\n\t}\n\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tconst td = changes.telDropdown;\n\t\tif (td && !td.firstChange) {\n\t\t\tthis.ngOnDestroy();\n\t\t\tthis.ngOnInit();\n\t\t}\n\t\tconst type = changes.telType;\n\t\tif (type && !type.firstChange) {\n\t\t\tthis.onInput();\n\t\t}\n\t}\n\n\tprivate initElement() {\n\t\tconst countryCode = getCountryCodeFromLocale(this._locale).toLowerCase();\n\n\t\tconst root: ShadowRoot | Document = this._input!.getRootNode() as ShadowRoot | Document;\n\t\tif (!root.querySelector('#bui-tel-input-style')) {\n\t\t\tconst styleTag = document.createElement('style');\n\t\t\tstyleTag.id = 'bui-tel-input-style';\n\t\t\tstyleTag.innerText =\n\t\t\t\t'.mat-mdc-form-field .bui-tel-input-placeholder:not(.mdc-floating-label--float-above){margin-left:44px;}' +\n\t\t\t\t'.iti--allow-dropdown{margin-left:-8px}' +\n\t\t\t\t'.bui-tel-input-with-value:disabled{cursor:pointer;}';\n\t\t\t(root instanceof Document ? (root.querySelector('head') as any) : root).appendChild(styleTag);\n\t\t}\n\t\tthis._iti = intlTelInput(this._input!, {\n\t\t\tinitialCountry: countryCode,\n\t\t\tplaceholderNumberType: this.telType,\n\t\t\tpreferredCountries: [countryCode, ...['au', 'ca', 'nz', 'us', 'gb'].filter(c => c !== countryCode)],\n\t\t\tdropdownContainer: root instanceof ShadowRoot ? root.querySelector('overlay-root') || root : (root.body as any),\n\t\t\tautoPlaceholder: 'off',\n\t\t\tallowDropdown: this.telDropdown\n\t\t});\n\n\t\t(this._input as any).$$iti = this._iti;\n\t\tthis._input!.addEventListener('countrychange', this._countryChangeListener);\n\t\tconst frameTime = Date.now();\n\t\tconst postRenderWork = () => {\n\t\t\tif (frameTime + PhoneNumberDirective.POST_RENDER_INIT_DELAY > Date.now()) {\n\t\t\t\twindow.requestAnimationFrame(postRenderWork);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet label: HTMLLabelElement | undefined;\n\t\t\tif (this._matField?.getLabelId() && typeof root.getElementById === 'function') {\n\t\t\t\tlabel = root.getElementById(this._matField.getLabelId()!) as HTMLLabelElement;\n\t\t\t\tlabel?.classList.remove('bui-tel-input-placeholder');\n\t\t\t}\n\t\t\tif (label && this.telDropdown) {\n\t\t\t\tlabel.classList.add('bui-tel-input-placeholder');\n\t\t\t}\n\n\t\t\tif (this._input?.value) {\n\t\t\t\tthis._input.classList.add('bui-tel-input-with-value');\n\t\t\t}\n\t\t};\n\t\twindow.requestAnimationFrame(postRenderWork);\n\n\t\tthis._input!.addEventListener('click', () => {\n\t\t\tif (this._control?.disabled && this._control.value) {\n\t\t\t\twindow.location.href = 'tel://' + this._control.value;\n\t\t\t}\n\t\t});\n\n\t\tthis._control?.registerOnDisabledChange(isDisabled => this._patchValueByState(isDisabled));\n\t\tthis._patchValueByState(this._control!.disabled);\n\t}\n\n\tprivate _patchValueByState(isDisabled: boolean) {\n\t\tsetTimeout(() => {\n\t\t\tif (!isDisabled) {\n\t\t\t\tthis.onInput();\n\t\t\t} else {\n\t\t\t\tconst v = this._iti.getNumber(intlTelInputUtils.numberFormat.NATIONAL);\n\t\t\t\tthis._input!.value = v;\n\t\t\t\tthis._control?.patchValue(this._input?.value, { emitEvent: false });\n\t\t\t}\n\t\t}, 20);\n\t}\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { PhoneNumberDirective } from './phone-number.directive';\nimport { PhoneNumberPipe } from './phone-number.pipe';\nimport { PhoneNumberValidator } from './phone-number.validator';\n\n/**\n * @internal\n */\n@NgModule({\n\tdeclarations: [PhoneNumberPipe, PhoneNumberDirective, PhoneNumberValidator],\n\timports: [CommonModule],\n\texports: [PhoneNumberDirective, PhoneNumberPipe, PhoneNumberValidator]\n})\nexport class PhoneModule {}\n\nexport { PhoneNumberDirective, PhoneNumberPipe, PhoneNumberValidator };\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAIA;;AAEG;MAKU,eAAe,CAAA;AAC3B,IAAA,WAAA,CAAuC,OAAe,EAAA;AAAf,QAAA,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;KAAI;AAE1D,IAAA,SAAS,CAAC,KAAU,EAAE,IAAa,EAAE,UAAoB,EAAA;QACxD,IAAI,CAAC,KAAK,EAAE;AACX,YAAA,OAAO,KAAK,CAAC;AACb,SAAA;QAED,MAAM,WAAW,GAAG,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAE3D,QAAA,IAAI,MAAc,CAAC;AACnB,QAAA,QAAQ,IAAI;AACX,YAAA,KAAK,UAAU;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AO,EAAA,CAAA;sBADN,YAAY;uBAAC,OAAO,CAAA;;;ACzFtB;;AAEG;MAMU,WAAW,CAAA;;wGAAX,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAX,WAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,EAJR,YAAA,EAAA,CAAA,eAAe,EAAE,oBAAoB,EAAE,oBAAoB,CAChE,EAAA,OAAA,EAAA,CAAA,YAAY,CACZ,EAAA,OAAA,EAAA,CAAA,oBAAoB,EAAE,eAAe,EAAE,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAEzD,WAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,YAHb,YAAY,CAAA,EAAA,CAAA,CAAA;2FAGV,WAAW,EAAA,UAAA,EAAA,CAAA;kBALvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,YAAY,EAAE,CAAC,eAAe,EAAE,oBAAoB,EAAE,oBAAoB,CAAC;oBAC3E,OAAO,EAAE,CAAC,YAAY,CAAC;AACvB,oBAAA,OAAO,EAAE,CAAC,oBAAoB,EAAE,eAAe,EAAE,oBAAoB,CAAC;iBACtE,CAAA;;;ACdD;;AAEG;;;;"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { __awaiter } from 'tslib';
|
|
2
|
-
import { HarnessPredicate } from '@angular/cdk/testing';
|
|
3
|
-
import { MatRadioButtonHarness, _MatRadioGroupHarnessBase } from '@angular/material/radio/testing';
|
|
4
|
-
|
|
5
|
-
class RadioPanelItemHarness extends MatRadioButtonHarness {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.getLabelElement = this.locatorFor('label');
|
|
9
|
-
this._textLabel = this.locatorFor('label .bui-label-title');
|
|
10
|
-
this._clickLabel = this.getLabelElement;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Gets a `HarnessPredicate` that can be used to search for a radio button with specific
|
|
14
|
-
* attributes.
|
|
15
|
-
* @param options Options for filtering which radio button instances are considered a match.
|
|
16
|
-
* @return a `HarnessPredicate` configured with the given options.
|
|
17
|
-
*/
|
|
18
|
-
static with(options = {}) {
|
|
19
|
-
return MatRadioButtonHarness.with
|
|
20
|
-
.bind(this)(options)
|
|
21
|
-
.addOption('value', options.value, (harness, value) => HarnessPredicate.stringMatches(harness.getValue(), value));
|
|
22
|
-
}
|
|
23
|
-
click() {
|
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
const element = yield this.getLabelElement();
|
|
26
|
-
element.click();
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
getLabelCssValue(prop) {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
const element = yield this.getLabelElement();
|
|
32
|
-
return element.getCssValue(prop);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
getBorderColor() {
|
|
36
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
const label = yield this.getLabelElement();
|
|
38
|
-
return label.getCssValue('border-color');
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
RadioPanelItemHarness.hostSelector = 'bui-radio-panel-item';
|
|
43
|
-
class RadioPanelHarness extends _MatRadioGroupHarnessBase {
|
|
44
|
-
constructor() {
|
|
45
|
-
super(...arguments);
|
|
46
|
-
this._buttonClass = RadioPanelItemHarness;
|
|
47
|
-
this.getItem = (filters) => this.locatorFor(RadioPanelItemHarness.with(filters))();
|
|
48
|
-
}
|
|
49
|
-
getFlexDir() {
|
|
50
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
return (yield this.host()).getCssValue('flex-direction');
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
/** The selector for the host element of a `MatRadioGroup` instance. */
|
|
56
|
-
RadioPanelHarness.hostSelector = 'bui-radio-panel';
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Generated bundle index. Do not edit.
|
|
60
|
-
*/
|
|
61
|
-
|
|
62
|
-
export { RadioPanelHarness, RadioPanelItemHarness };
|
|
63
|
-
//# sourceMappingURL=bravura-ui-radio-panel-testing.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bravura-ui-radio-panel-testing.mjs","sources":["../../../projects/ui/radio-panel/testing/test-api.ts","../../../projects/ui/radio-panel/testing/bravura-ui-radio-panel-testing.ts"],"sourcesContent":["import { ComponentHarnessConstructor, HarnessPredicate } from '@angular/cdk/testing';\nimport {\n\tMatRadioButtonHarness,\n\tRadioButtonHarnessFilters,\n\t_MatRadioGroupHarnessBase\n} from '@angular/material/radio/testing';\n\nexport interface RadioPanelItemHarnessFilters extends RadioButtonHarnessFilters {\n\tvalue?: string | RegExp;\n}\n\nexport class RadioPanelItemHarness extends MatRadioButtonHarness {\n\tstatic hostSelector = 'bui-radio-panel-item';\n\tgetLabelElement = this.locatorFor('label');\n\n\tprotected _textLabel = this.locatorFor('label .bui-label-title');\n\tprotected _clickLabel = this.getLabelElement;\n\n\t/**\n\t * Gets a `HarnessPredicate` that can be used to search for a radio button with specific\n\t * attributes.\n\t * @param options Options for filtering which radio button instances are considered a match.\n\t * @return a `HarnessPredicate` configured with the given options.\n\t */\n\tstatic with<T extends MatRadioButtonHarness>(\n\t\tthis: ComponentHarnessConstructor<T>,\n\t\toptions: RadioPanelItemHarnessFilters = {}\n\t): HarnessPredicate<T> {\n\t\treturn MatRadioButtonHarness.with\n\t\t\t.bind(this)(options)\n\t\t\t.addOption('value', options.value, (harness, value) =>\n\t\t\t\tHarnessPredicate.stringMatches(harness.getValue(), value)\n\t\t\t) as HarnessPredicate<T>;\n\t}\n\n\tasync click() {\n\t\tconst element = await this.getLabelElement();\n\t\telement.click();\n\t}\n\n\tasync getLabelCssValue(prop: string): Promise<string> {\n\t\tconst element = await this.getLabelElement();\n\t\treturn element.getCssValue(prop);\n\t}\n\n\tasync getBorderColor(): Promise<string> {\n\t\tconst label = await this.getLabelElement();\n\t\treturn label.getCssValue('border-color');\n\t}\n}\n\nexport class RadioPanelHarness extends _MatRadioGroupHarnessBase<\n\ttypeof RadioPanelItemHarness,\n\tRadioPanelItemHarness,\n\tRadioButtonHarnessFilters\n> {\n\t/** The selector for the host element of a `MatRadioGroup` instance. */\n\tstatic hostSelector = 'bui-radio-panel';\n\n\tprotected _buttonClass = RadioPanelItemHarness;\n\n\tgetItem = (filters: RadioPanelItemHarnessFilters) => this.locatorFor(RadioPanelItemHarness.with(filters))();\n\n\tasync getFlexDir(): Promise<string> {\n\t\treturn (await this.host()).getCssValue('flex-direction');\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './test-api';\n"],"names":[],"mappings":";;;;AAWM,MAAO,qBAAsB,SAAQ,qBAAqB,CAAA;AAAhE,IAAA,WAAA,GAAA;;QAEC,IAAA,CAAA,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAEjC,IAAA,CAAA,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC;AACvD,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC;KAiC7C;AA/BA;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAEV,OAAA,GAAwC,EAAE,EAAA;QAE1C,OAAO,qBAAqB,CAAC,IAAI;AAC/B,aAAA,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;aACnB,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,EA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