@bravura/ui 1.21.6 → 2.0.1
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 +19 -0
- package/README.md +1 -0
- package/alert/alert-container.component.d.ts +1 -1
- package/alert/alert-message.component.d.ts +1 -1
- package/alert/{bravura-ui-alert.d.ts → index.d.ts} +0 -0
- package/behavior/await.directive.d.ts +1 -1
- package/behavior/{bravura-ui-behavior.d.ts → index.d.ts} +0 -0
- package/behavior/sizing-monitor.directive.d.ts +1 -1
- package/behavior/sizing.directive.d.ts +1 -1
- package/common/{bravura-ui-common.d.ts → index.d.ts} +0 -0
- package/currency-input/currency-input.directive.d.ts +1 -1
- package/currency-input/{bravura-ui-currency-input.d.ts → index.d.ts} +0 -0
- package/decimal-input/decimal-input.directive.d.ts +1 -1
- package/decimal-input/{bravura-ui-decimal-input.d.ts → index.d.ts} +0 -0
- package/discrete-input/discrete-input.component.d.ts +6 -5
- package/discrete-input/{bravura-ui-discrete-input.d.ts → index.d.ts} +0 -0
- package/esm2020/alert/alert-container.component.mjs +201 -0
- package/esm2020/alert/alert-message.component.mjs +92 -0
- package/esm2020/alert/alert.module.mjs +22 -0
- package/{esm2015/alert/bravura-ui-alert.js → esm2020/alert/bravura-ui-alert.mjs} +0 -0
- package/{esm2015/alert/public-api.js → esm2020/alert/public-api.mjs} +0 -0
- package/{esm2015/behavior/await.directive.js → esm2020/behavior/await.directive.mjs} +4 -4
- package/esm2020/behavior/behavior.module.mjs +25 -0
- package/{esm2015/behavior/bravura-ui-behavior.js → esm2020/behavior/bravura-ui-behavior.mjs} +0 -0
- package/{esm2015/behavior/public-api.js → esm2020/behavior/public-api.mjs} +0 -0
- package/{esm2015/behavior/sizing-monitor.directive.js → esm2020/behavior/sizing-monitor.directive.mjs} +4 -4
- package/{esm2015/behavior/sizing.directive.js → esm2020/behavior/sizing.directive.mjs} +4 -4
- package/{esm2015/bravura-ui.js → esm2020/bravura-ui.mjs} +0 -0
- package/{esm2015/common/bravura-ui-common.js → esm2020/common/bravura-ui-common.mjs} +0 -0
- package/{esm2015/common/common-utils.js → esm2020/common/common-utils.mjs} +0 -0
- package/esm2020/common/common.module.mjs +52 -0
- package/{esm2015/common/public-api.js → esm2020/common/public-api.mjs} +0 -0
- package/{esm2015/currency-input/bravura-ui-currency-input.js → esm2020/currency-input/bravura-ui-currency-input.mjs} +0 -0
- package/esm2020/currency-input/currency-input.directive.mjs +279 -0
- package/esm2020/currency-input/currency-input.module.mjs +19 -0
- package/{esm2015/currency-input/public-api.js → esm2020/currency-input/public-api.mjs} +0 -0
- package/{esm2015/decimal-input/bravura-ui-decimal-input.js → esm2020/decimal-input/bravura-ui-decimal-input.mjs} +0 -0
- package/esm2020/decimal-input/decimal-input.directive.mjs +125 -0
- package/esm2020/decimal-input/decimal-input.module.mjs +19 -0
- package/{esm2015/decimal-input/public-api.js → esm2020/decimal-input/public-api.mjs} +0 -0
- package/{esm2015/discrete-input/bravura-ui-discrete-input.js → esm2020/discrete-input/bravura-ui-discrete-input.mjs} +0 -0
- package/esm2020/discrete-input/discrete-input.component.mjs +326 -0
- package/esm2020/discrete-input/discrete-input.module.mjs +21 -0
- package/{esm2015/discrete-input/public-api.js → esm2020/discrete-input/public-api.mjs} +0 -0
- package/{esm2015/file-upload/bravura-ui-file-upload.js → esm2020/file-upload/bravura-ui-file-upload.mjs} +0 -0
- package/esm2020/file-upload/file-upload.component.mjs +356 -0
- package/{esm2015/file-upload/file-upload.module.js → esm2020/file-upload/file-upload.module.mjs} +11 -13
- package/{esm2015/file-upload/file-upload.service.js → esm2020/file-upload/file-upload.service.mjs} +4 -4
- package/{esm2015/file-upload/public-api.js → esm2020/file-upload/public-api.mjs} +0 -0
- package/{esm2015/form-field/bravura-ui-form-field.js → esm2020/form-field/bravura-ui-form-field.mjs} +0 -0
- package/esm2020/form-field/form-field.component.mjs +96 -0
- package/esm2020/form-field/form-field.module.mjs +20 -0
- package/{esm2015/form-field/public-api.js → esm2020/form-field/public-api.mjs} +0 -0
- package/{esm2015/icon-font/bravura-ui-icon-font.js → esm2020/icon-font/bravura-ui-icon-font.mjs} +0 -0
- package/esm2020/icon-font/icon-font.module.mjs +22 -0
- package/{esm2015/icon-font/icon.directive.js → esm2020/icon-font/icon.directive.mjs} +4 -4
- package/{esm2015/icon-font/public-api.js → esm2020/icon-font/public-api.mjs} +0 -0
- package/{esm2015/icon-font/utilities.js → esm2020/icon-font/utilities.mjs} +0 -0
- package/{esm2015/phone-number/bravura-ui-phone-number.js → esm2020/phone-number/bravura-ui-phone-number.mjs} +0 -0
- package/esm2020/phone-number/phone-number.directive.mjs +187 -0
- package/esm2020/phone-number/phone-number.module.mjs +24 -0
- package/{esm2015/phone-number/phone-number.pipe.js → esm2020/phone-number/phone-number.pipe.mjs} +4 -4
- package/{esm2015/phone-number/phone-number.validator.js → esm2020/phone-number/phone-number.validator.mjs} +4 -4
- package/{esm2015/phone-number/public-api.js → esm2020/phone-number/public-api.mjs} +0 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/{esm2015/radio-panel/bravura-ui-radio-panel.js → esm2020/radio-panel/bravura-ui-radio-panel.mjs} +0 -0
- package/{esm2015/radio-panel/public-api.js → esm2020/radio-panel/public-api.mjs} +0 -0
- package/esm2020/radio-panel/radio-panel-item.component.mjs +97 -0
- package/esm2020/radio-panel/radio-panel.component.mjs +89 -0
- package/esm2020/radio-panel/radio-panel.module.mjs +25 -0
- package/{esm2015/selection-panel/bravura-ui-selection-panel.js → esm2020/selection-panel/bravura-ui-selection-panel.mjs} +0 -0
- package/{esm2015/selection-panel/public-api.js → esm2020/selection-panel/public-api.mjs} +0 -0
- package/esm2020/selection-panel/selection-panel-item.component.mjs +166 -0
- package/esm2020/selection-panel/selection-panel.directive.mjs +119 -0
- package/esm2020/selection-panel/selection-panel.module.mjs +23 -0
- package/{esm2015/skeletons/bravura-ui-skeletons.js → esm2020/skeletons/bravura-ui-skeletons.mjs} +0 -0
- package/{esm2015/skeletons/public-api.js → esm2020/skeletons/public-api.mjs} +0 -0
- package/esm2020/skeletons/skeleton-loader-presets.directive.mjs +83 -0
- package/{esm2015/skeletons/skeleton-loader.component.js → esm2020/skeletons/skeleton-loader.component.mjs} +4 -4
- package/esm2020/skeletons/skeletons.module.mjs +35 -0
- package/{esm2015/stepper/bravura-ui-stepper.js → esm2020/stepper/bravura-ui-stepper.mjs} +0 -0
- package/{esm2015/stepper/public-api.js → esm2020/stepper/public-api.mjs} +0 -0
- package/esm2020/stepper/stepper-animation.mjs +23 -0
- package/esm2020/stepper/stepper.component.mjs +166 -0
- package/{esm2015/stepper/stepper.module.js → esm2020/stepper/stepper.module.mjs} +13 -15
- package/{esm2015/tooltip/bravura-ui-tooltip.js → esm2020/tooltip/bravura-ui-tooltip.mjs} +0 -0
- package/{esm2015/tooltip/public-api.js → esm2020/tooltip/public-api.mjs} +0 -0
- package/esm2020/tooltip/tooltip.component.mjs +51 -0
- package/{esm2015/tooltip/tooltip.directive.js → esm2020/tooltip/tooltip.directive.mjs} +4 -4
- package/esm2020/tooltip/tooltip.module.mjs +25 -0
- package/fesm2015/bravura-ui-alert.mjs +324 -0
- package/fesm2015/bravura-ui-alert.mjs.map +1 -0
- package/fesm2015/bravura-ui-behavior.mjs +407 -0
- package/fesm2015/bravura-ui-behavior.mjs.map +1 -0
- package/fesm2015/bravura-ui-common.mjs +74 -0
- package/fesm2015/bravura-ui-common.mjs.map +1 -0
- package/fesm2015/bravura-ui-currency-input.mjs +303 -0
- package/fesm2015/bravura-ui-currency-input.mjs.map +1 -0
- package/fesm2015/bravura-ui-decimal-input.mjs +148 -0
- package/fesm2015/bravura-ui-decimal-input.mjs.map +1 -0
- package/fesm2015/bravura-ui-discrete-input.mjs +354 -0
- package/fesm2015/bravura-ui-discrete-input.mjs.map +1 -0
- package/fesm2015/bravura-ui-file-upload.mjs +434 -0
- package/fesm2015/bravura-ui-file-upload.mjs.map +1 -0
- package/fesm2015/{bravura-ui-form-field.js → bravura-ui-form-field.mjs} +12 -23
- package/fesm2015/bravura-ui-form-field.mjs.map +1 -0
- package/fesm2015/{bravura-ui-icon-font.js → bravura-ui-icon-font.mjs} +8 -8
- package/fesm2015/bravura-ui-icon-font.mjs.map +1 -0
- package/fesm2015/{bravura-ui-phone-number.js → bravura-ui-phone-number.mjs} +34 -30
- package/fesm2015/bravura-ui-phone-number.mjs.map +1 -0
- package/fesm2015/bravura-ui-radio-panel.mjs +212 -0
- package/fesm2015/bravura-ui-radio-panel.mjs.map +1 -0
- package/fesm2015/{bravura-ui-selection-panel.js → bravura-ui-selection-panel.mjs} +24 -28
- package/fesm2015/bravura-ui-selection-panel.mjs.map +1 -0
- package/fesm2015/bravura-ui-skeletons.mjs +195 -0
- package/fesm2015/bravura-ui-skeletons.mjs.map +1 -0
- package/fesm2015/bravura-ui-stepper.mjs +243 -0
- package/fesm2015/bravura-ui-stepper.mjs.map +1 -0
- package/fesm2015/bravura-ui-tooltip.mjs +195 -0
- package/fesm2015/bravura-ui-tooltip.mjs.map +1 -0
- package/fesm2015/{bravura-ui.js → bravura-ui.mjs} +1 -1
- package/fesm2015/bravura-ui.mjs.map +1 -0
- package/fesm2020/bravura-ui-alert.mjs +312 -0
- package/fesm2020/bravura-ui-alert.mjs.map +1 -0
- package/{fesm2015/bravura-ui-behavior.js → fesm2020/bravura-ui-behavior.mjs} +14 -14
- package/fesm2020/bravura-ui-behavior.mjs.map +1 -0
- package/{fesm2015/bravura-ui-common.js → fesm2020/bravura-ui-common.mjs} +7 -7
- package/fesm2020/bravura-ui-common.mjs.map +1 -0
- package/{fesm2015/bravura-ui-currency-input.js → fesm2020/bravura-ui-currency-input.mjs} +10 -11
- package/fesm2020/bravura-ui-currency-input.mjs.map +1 -0
- package/{fesm2015/bravura-ui-decimal-input.js → fesm2020/bravura-ui-decimal-input.mjs} +9 -8
- package/fesm2020/bravura-ui-decimal-input.mjs.map +1 -0
- package/{fesm2015/bravura-ui-discrete-input.js → fesm2020/bravura-ui-discrete-input.mjs} +18 -26
- package/fesm2020/bravura-ui-discrete-input.mjs.map +1 -0
- package/fesm2020/bravura-ui-file-upload.mjs +430 -0
- package/fesm2020/bravura-ui-file-upload.mjs.map +1 -0
- package/fesm2020/bravura-ui-form-field.mjs +119 -0
- package/fesm2020/bravura-ui-form-field.mjs.map +1 -0
- package/fesm2020/bravura-ui-icon-font.mjs +178 -0
- package/fesm2020/bravura-ui-icon-font.mjs.map +1 -0
- package/fesm2020/bravura-ui-phone-number.mjs +317 -0
- package/fesm2020/bravura-ui-phone-number.mjs.map +1 -0
- package/fesm2020/bravura-ui-radio-panel.mjs +209 -0
- package/fesm2020/bravura-ui-radio-panel.mjs.map +1 -0
- package/fesm2020/bravura-ui-selection-panel.mjs +306 -0
- package/fesm2020/bravura-ui-selection-panel.mjs.map +1 -0
- package/{fesm2015/bravura-ui-skeletons.js → fesm2020/bravura-ui-skeletons.mjs} +13 -13
- package/fesm2020/bravura-ui-skeletons.mjs.map +1 -0
- package/{fesm2015/bravura-ui-stepper.js → fesm2020/bravura-ui-stepper.mjs} +27 -44
- package/fesm2020/bravura-ui-stepper.mjs.map +1 -0
- package/{fesm2015/bravura-ui-tooltip.js → fesm2020/bravura-ui-tooltip.mjs} +13 -22
- package/fesm2020/bravura-ui-tooltip.mjs.map +1 -0
- package/fesm2020/bravura-ui.mjs +8 -0
- package/fesm2020/bravura-ui.mjs.map +1 -0
- package/file-upload/file-upload.component.d.ts +1 -1
- package/file-upload/{bravura-ui-file-upload.d.ts → index.d.ts} +0 -0
- package/form-field/form-field.component.d.ts +1 -1
- package/form-field/{bravura-ui-form-field.d.ts → index.d.ts} +0 -0
- package/icon-font/icon.directive.d.ts +1 -1
- package/icon-font/{bravura-ui-icon-font.d.ts → index.d.ts} +0 -0
- package/{bravura-ui.d.ts → index.d.ts} +0 -0
- package/package.json +149 -14
- package/phone-number/{bravura-ui-phone-number.d.ts → index.d.ts} +0 -0
- package/phone-number/phone-number.directive.d.ts +1 -1
- package/phone-number/phone-number.pipe.d.ts +1 -1
- package/phone-number/phone-number.validator.d.ts +1 -1
- package/radio-panel/{bravura-ui-radio-panel.d.ts → index.d.ts} +0 -0
- package/radio-panel/radio-panel-item.component.d.ts +1 -1
- package/radio-panel/radio-panel.component.d.ts +1 -1
- package/selection-panel/{bravura-ui-selection-panel.d.ts → index.d.ts} +0 -0
- package/selection-panel/selection-panel-item.component.d.ts +1 -1
- package/selection-panel/selection-panel.directive.d.ts +1 -1
- package/skeletons/{bravura-ui-skeletons.d.ts → index.d.ts} +0 -0
- package/skeletons/skeleton-loader-presets.directive.d.ts +1 -1
- package/skeletons/skeleton-loader.component.d.ts +1 -1
- package/stepper/{bravura-ui-stepper.d.ts → index.d.ts} +0 -0
- package/stepper/stepper.component.d.ts +1 -1
- package/theme/_ui-theme.scss +1 -1
- package/tooltip/{bravura-ui-tooltip.d.ts → index.d.ts} +0 -0
- package/tooltip/tooltip.component.d.ts +1 -1
- package/tooltip/tooltip.directive.d.ts +1 -1
- package/alert/package.json +0 -10
- package/behavior/package.json +0 -10
- package/bundles/bravura-ui-alert.umd.js +0 -745
- package/bundles/bravura-ui-alert.umd.js.map +0 -1
- package/bundles/bravura-ui-behavior.umd.js +0 -788
- package/bundles/bravura-ui-behavior.umd.js.map +0 -1
- package/bundles/bravura-ui-common.umd.js +0 -103
- package/bundles/bravura-ui-common.umd.js.map +0 -1
- package/bundles/bravura-ui-currency-input.umd.js +0 -335
- package/bundles/bravura-ui-currency-input.umd.js.map +0 -1
- package/bundles/bravura-ui-decimal-input.umd.js +0 -176
- package/bundles/bravura-ui-decimal-input.umd.js.map +0 -1
- package/bundles/bravura-ui-discrete-input.umd.js +0 -747
- package/bundles/bravura-ui-discrete-input.umd.js.map +0 -1
- package/bundles/bravura-ui-file-upload.umd.js +0 -845
- package/bundles/bravura-ui-file-upload.umd.js.map +0 -1
- package/bundles/bravura-ui-form-field.umd.js +0 -494
- package/bundles/bravura-ui-form-field.umd.js.map +0 -1
- package/bundles/bravura-ui-icon-font.umd.js +0 -539
- package/bundles/bravura-ui-icon-font.umd.js.map +0 -1
- package/bundles/bravura-ui-phone-number.umd.js +0 -690
- package/bundles/bravura-ui-phone-number.umd.js.map +0 -1
- package/bundles/bravura-ui-radio-panel.umd.js +0 -595
- package/bundles/bravura-ui-radio-panel.umd.js.map +0 -1
- package/bundles/bravura-ui-selection-panel.umd.js +0 -699
- package/bundles/bravura-ui-selection-panel.umd.js.map +0 -1
- package/bundles/bravura-ui-skeletons.umd.js +0 -525
- package/bundles/bravura-ui-skeletons.umd.js.map +0 -1
- package/bundles/bravura-ui-stepper.umd.js +0 -613
- package/bundles/bravura-ui-stepper.umd.js.map +0 -1
- package/bundles/bravura-ui-tooltip.umd.js +0 -586
- package/bundles/bravura-ui-tooltip.umd.js.map +0 -1
- package/bundles/bravura-ui.umd.js +0 -18
- package/bundles/bravura-ui.umd.js.map +0 -1
- package/common/package.json +0 -10
- package/currency-input/package.json +0 -10
- package/decimal-input/package.json +0 -10
- package/discrete-input/package.json +0 -10
- package/esm2015/alert/alert-container.component.js +0 -220
- package/esm2015/alert/alert-message.component.js +0 -98
- package/esm2015/alert/alert.module.js +0 -22
- package/esm2015/behavior/behavior.module.js +0 -25
- package/esm2015/common/common.module.js +0 -52
- package/esm2015/currency-input/currency-input.directive.js +0 -280
- package/esm2015/currency-input/currency-input.module.js +0 -19
- package/esm2015/decimal-input/decimal-input.directive.js +0 -124
- package/esm2015/decimal-input/decimal-input.module.js +0 -19
- package/esm2015/discrete-input/discrete-input.component.js +0 -334
- package/esm2015/discrete-input/discrete-input.module.js +0 -21
- package/esm2015/file-upload/file-upload.component.js +0 -367
- package/esm2015/form-field/form-field.component.js +0 -107
- package/esm2015/form-field/form-field.module.js +0 -20
- package/esm2015/icon-font/icon-font.module.js +0 -22
- package/esm2015/phone-number/phone-number.directive.js +0 -192
- package/esm2015/phone-number/phone-number.module.js +0 -24
- package/esm2015/radio-panel/radio-panel-item.component.js +0 -109
- package/esm2015/radio-panel/radio-panel.component.js +0 -98
- package/esm2015/radio-panel/radio-panel.module.js +0 -25
- package/esm2015/selection-panel/selection-panel-item.component.js +0 -174
- package/esm2015/selection-panel/selection-panel.directive.js +0 -120
- package/esm2015/selection-panel/selection-panel.module.js +0 -23
- package/esm2015/skeletons/skeleton-loader-presets.directive.js +0 -83
- package/esm2015/skeletons/skeletons.module.js +0 -35
- package/esm2015/stepper/stepper-animation.js +0 -23
- package/esm2015/stepper/stepper.component.js +0 -181
- package/esm2015/tooltip/tooltip.component.js +0 -59
- package/esm2015/tooltip/tooltip.module.js +0 -26
- package/fesm2015/bravura-ui-alert.js +0 -337
- package/fesm2015/bravura-ui-alert.js.map +0 -1
- package/fesm2015/bravura-ui-behavior.js.map +0 -1
- package/fesm2015/bravura-ui-common.js.map +0 -1
- package/fesm2015/bravura-ui-currency-input.js.map +0 -1
- package/fesm2015/bravura-ui-decimal-input.js.map +0 -1
- package/fesm2015/bravura-ui-discrete-input.js.map +0 -1
- package/fesm2015/bravura-ui-file-upload.js +0 -443
- package/fesm2015/bravura-ui-file-upload.js.map +0 -1
- package/fesm2015/bravura-ui-form-field.js.map +0 -1
- package/fesm2015/bravura-ui-icon-font.js.map +0 -1
- package/fesm2015/bravura-ui-phone-number.js.map +0 -1
- package/fesm2015/bravura-ui-radio-panel.js +0 -230
- package/fesm2015/bravura-ui-radio-panel.js.map +0 -1
- package/fesm2015/bravura-ui-selection-panel.js.map +0 -1
- package/fesm2015/bravura-ui-skeletons.js.map +0 -1
- package/fesm2015/bravura-ui-stepper.js.map +0 -1
- package/fesm2015/bravura-ui-tooltip.js.map +0 -1
- package/fesm2015/bravura-ui.js.map +0 -1
- package/file-upload/package.json +0 -10
- package/form-field/package.json +0 -10
- package/icon-font/package.json +0 -10
- package/phone-number/package.json +0 -10
- package/radio-panel/package.json +0 -10
- package/selection-panel/package.json +0 -10
- package/skeletons/package.json +0 -10
- package/stepper/package.json +0 -10
- package/tooltip/package.json +0 -10
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Directive, EventEmitter, Inject, Optional, Input, Output, NgModule } from '@angular/core';
|
|
5
|
+
import { debounceTime, take } from 'rxjs/operators';
|
|
6
|
+
import { MatProgressSpinner, MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
7
|
+
import * as i1 from '@angular/material/button';
|
|
8
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Use this directive to designate a target HTML element, based on which the child elements'
|
|
12
|
+
* `[buiSizing]` directives will calculate the sizes.
|
|
13
|
+
*
|
|
14
|
+
* ```html
|
|
15
|
+
* <div [buiSizingMonitor]>
|
|
16
|
+
* <div [buiSizing]="...">
|
|
17
|
+
* </div>
|
|
18
|
+
* <div>
|
|
19
|
+
* <div [buiSizing]="...">
|
|
20
|
+
* </div>
|
|
21
|
+
* </div>
|
|
22
|
+
* <div>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
class SizingMonitorDirective {
|
|
26
|
+
constructor(element) {
|
|
27
|
+
this.element = element;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
SizingMonitorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SizingMonitorDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
31
|
+
SizingMonitorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.3", type: SizingMonitorDirective, selector: "[buiSizingMonitor]", ngImport: i0 });
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SizingMonitorDirective, decorators: [{
|
|
33
|
+
type: Directive,
|
|
34
|
+
args: [{
|
|
35
|
+
selector: '[buiSizingMonitor]'
|
|
36
|
+
}]
|
|
37
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* This directive monitors the changes in the width of the `sizingBy` target, and apply specified style
|
|
41
|
+
* classes and/or inline styles to the current element dynamically.
|
|
42
|
+
*
|
|
43
|
+
* In order for the layout engine to efficiently calculate and stabilize the dimensions, the effective style property
|
|
44
|
+
* `box-sizing` of the `sizingBy` target element must be set to `border-box`.
|
|
45
|
+
*
|
|
46
|
+
* The directive uses [ResizeObserver API](https://developer.mozilla.org/en-US/docs/Web/API/Resize_Observer_API)
|
|
47
|
+
* to capture the events of element resizing. Please use a polyfill if you want to support older browsers
|
|
48
|
+
* that do not implement ResizeObserver API.
|
|
49
|
+
*
|
|
50
|
+
* Examples:
|
|
51
|
+
*
|
|
52
|
+
* ```html
|
|
53
|
+
* <div #parentElement>
|
|
54
|
+
* <div [buiSizing]="{'400': 'small', '800': 'medium', '~': 'large'}" [buiSizingBy]="parentElement"></div>
|
|
55
|
+
* <div [buiSizing]="['small', 'medium', 'large']" [buiSizingBy]="'root'"></div>
|
|
56
|
+
* <div [buiSizing]="{'650': 'border-color: #28569', '~': 'bg-muted; border-style: dotted'}" [buiSizingBy]="parentElement"></div>
|
|
57
|
+
* </div>
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
class SizingDirective {
|
|
61
|
+
constructor(_doc, _defaultTarget, elemRef, _zone) {
|
|
62
|
+
this._doc = _doc;
|
|
63
|
+
this._defaultTarget = _defaultTarget;
|
|
64
|
+
this._zone = _zone;
|
|
65
|
+
/**
|
|
66
|
+
* Specifies the breakpoint widths and the style classes.
|
|
67
|
+
*
|
|
68
|
+
* The sizing spec `{"400": "small", "800": "medium", "~": "large"}` tells the directive to apply
|
|
69
|
+
* a style class `small` when the width of the monitored target is smaller than 400 pixels,
|
|
70
|
+
* `medium` when the width is between 400 and 800 pixels, and `large` when above.
|
|
71
|
+
*
|
|
72
|
+
* @example {'400': 'small', '800': 'medium', '~': 'large'}
|
|
73
|
+
*/
|
|
74
|
+
this.buiSizing = {};
|
|
75
|
+
/**
|
|
76
|
+
* The alias of `buiSizingBy`.
|
|
77
|
+
* @default 'root'
|
|
78
|
+
* @deprecated
|
|
79
|
+
* @ignore
|
|
80
|
+
*/
|
|
81
|
+
this.sizingBy = 'root';
|
|
82
|
+
/**
|
|
83
|
+
* Emits `{width, height}` when the monitor target element resizes.
|
|
84
|
+
*
|
|
85
|
+
* Note that the dimensions emitted are of the [sizingBy] target, but not the current element.
|
|
86
|
+
*/
|
|
87
|
+
this.buiResized = new EventEmitter();
|
|
88
|
+
/**
|
|
89
|
+
* Recalculate the height of this element according to the height of the monitored target.
|
|
90
|
+
*/
|
|
91
|
+
this.buiFixedHeight = false;
|
|
92
|
+
this._sizingSpec = {};
|
|
93
|
+
this._width = 0;
|
|
94
|
+
this._height = 0;
|
|
95
|
+
this._reflowFrameCount = 0;
|
|
96
|
+
this._element = elemRef.nativeElement;
|
|
97
|
+
this._monitorTarget = this._element;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Designate an element to be monitored for recalculating the style classes of the current element.
|
|
101
|
+
*
|
|
102
|
+
* - `root` specifies the document root or the enclosing shadow host. This is the default value.
|
|
103
|
+
* - `parent` specifies the parent element.
|
|
104
|
+
*
|
|
105
|
+
* @default 'root'
|
|
106
|
+
* @alias sizingBy
|
|
107
|
+
*/
|
|
108
|
+
get buiSizingBy() {
|
|
109
|
+
return this.sizingBy;
|
|
110
|
+
}
|
|
111
|
+
set buiSizingBy(target) {
|
|
112
|
+
this.sizingBy = target;
|
|
113
|
+
}
|
|
114
|
+
ngOnChanges(_) {
|
|
115
|
+
const disconnected = this._element.getRootNode() instanceof HTMLElement;
|
|
116
|
+
if (disconnected) {
|
|
117
|
+
// defer shadow detection till dom connection event
|
|
118
|
+
this._zone.onStable.pipe(debounceTime(10), take(1)).subscribe(() => this._initOrReset());
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
this._initOrReset();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
ngOnDestroy() {
|
|
125
|
+
this._tearDownNodeMonitor();
|
|
126
|
+
}
|
|
127
|
+
_initOrReset() {
|
|
128
|
+
const originalTarget = this._monitorTarget;
|
|
129
|
+
if (this.buiSizingBy instanceof HTMLElement) {
|
|
130
|
+
this._monitorTarget = this.buiSizingBy;
|
|
131
|
+
}
|
|
132
|
+
else if (this._defaultTarget) {
|
|
133
|
+
this._monitorTarget = this._defaultTarget.element.nativeElement;
|
|
134
|
+
}
|
|
135
|
+
else if (this.buiSizingBy === 'root') {
|
|
136
|
+
const root = this._element.getRootNode();
|
|
137
|
+
if (root instanceof ShadowRoot) {
|
|
138
|
+
this._monitorTarget = root.host;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
this._monitorTarget = this._doc.documentElement;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
this._monitorTarget = this._element.parentElement;
|
|
146
|
+
}
|
|
147
|
+
if (this._monitorTarget != originalTarget) {
|
|
148
|
+
this._setUpNodeMonitor();
|
|
149
|
+
}
|
|
150
|
+
this._sizingSpec = {};
|
|
151
|
+
let spec = this.buiSizing;
|
|
152
|
+
if (typeof spec === 'string') {
|
|
153
|
+
spec = spec.split(',').map(k => k.trim());
|
|
154
|
+
}
|
|
155
|
+
if (Array.isArray(spec)) {
|
|
156
|
+
spec.forEach((c, i) => {
|
|
157
|
+
this._sizingSpec[SizingDirective.defaultSizingBreakpoints[i] || '~'] = c;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
else if (spec) {
|
|
161
|
+
this._sizingSpec = spec;
|
|
162
|
+
}
|
|
163
|
+
this.buiFixedHeight = coerceBooleanProperty(this.buiFixedHeight);
|
|
164
|
+
this._calculateSize();
|
|
165
|
+
}
|
|
166
|
+
_setUpNodeMonitor() {
|
|
167
|
+
this._tearDownNodeMonitor();
|
|
168
|
+
if (this._monitorTarget) {
|
|
169
|
+
this._observer = new ResizeObserver(() => this._calculateSize());
|
|
170
|
+
this._observer.observe(this._monitorTarget, { box: 'border-box' });
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
_tearDownNodeMonitor() {
|
|
174
|
+
if (this._observer) {
|
|
175
|
+
this._observer.disconnect();
|
|
176
|
+
this._observer = undefined;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
_calculateSize() {
|
|
180
|
+
const widthChanged = this._width !== this._monitorTarget.clientWidth;
|
|
181
|
+
const heightChanged = this._height !== this._monitorTarget.clientHeight;
|
|
182
|
+
if (widthChanged) {
|
|
183
|
+
this._width = this._monitorTarget.clientWidth;
|
|
184
|
+
const bks = Object.keys(this._sizingSpec).sort((a, b) => this._toNumber(a) - this._toNumber(b));
|
|
185
|
+
let found = false;
|
|
186
|
+
for (const key of bks) {
|
|
187
|
+
const classesOrStyles = this._sizingSpec[key].split(/;+/).filter(c => c);
|
|
188
|
+
this._removeClassesOrStyles(classesOrStyles);
|
|
189
|
+
const expectedWidth = this._toNumber(key);
|
|
190
|
+
if (this._width <= expectedWidth && !found) {
|
|
191
|
+
this._applyClassesOrStyles(classesOrStyles);
|
|
192
|
+
found = true;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (widthChanged || heightChanged) {
|
|
197
|
+
this._height = this._monitorTarget.clientHeight;
|
|
198
|
+
if (this.buiFixedHeight) {
|
|
199
|
+
this._reflowFrameCount = 0;
|
|
200
|
+
this._reflowHeight();
|
|
201
|
+
}
|
|
202
|
+
setTimeout(() => this._zone.run(() => this.buiResized.emit({ width: this._width, height: this._height })));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
_applyClassesOrStyles(clsOrStyles) {
|
|
206
|
+
clsOrStyles.forEach(s => {
|
|
207
|
+
if (s.includes(':')) {
|
|
208
|
+
const [prop, val] = s.split(':');
|
|
209
|
+
this._element.style.setProperty(prop.trim(), val.trim());
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
const classes = s.split(/\s+/).filter(c => c);
|
|
213
|
+
if (classes.length) {
|
|
214
|
+
this._element.classList.add(...classes);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
_removeClassesOrStyles(clsOrStyles) {
|
|
220
|
+
clsOrStyles.forEach(s => {
|
|
221
|
+
if (s.includes(':')) {
|
|
222
|
+
const [prop] = s.split(':');
|
|
223
|
+
this._element.style.removeProperty(prop);
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
const classes = s.split(/\s+/).filter(c => c);
|
|
227
|
+
if (classes.length) {
|
|
228
|
+
this._element.classList.remove(...classes);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
_reflowHeight() {
|
|
234
|
+
const cnt = this._reflowFrameCount;
|
|
235
|
+
if (cnt < 15) {
|
|
236
|
+
requestAnimationFrame(this._reflowHeight.bind(this));
|
|
237
|
+
if (cnt === 0) {
|
|
238
|
+
this._element.style.height = '0';
|
|
239
|
+
}
|
|
240
|
+
else if (cnt === 14) {
|
|
241
|
+
const gt = parseInt(getComputedStyle(this._monitorTarget).getPropertyValue('padding-top').replace(/px$/, '') || '0', 10);
|
|
242
|
+
const gb = parseInt(getComputedStyle(this._monitorTarget).getPropertyValue('padding-bottom').replace(/px$/, '') || '0', 10);
|
|
243
|
+
this._element.style.height = `${this._height - gt - gb - 5}px`;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
this._reflowFrameCount++;
|
|
247
|
+
}
|
|
248
|
+
_toNumber(s) {
|
|
249
|
+
return (s === '~' ? Infinity : Number(s)) || -Infinity;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* @ignore
|
|
254
|
+
*/
|
|
255
|
+
SizingDirective.defaultSizingBreakpoints = ['400', '800', '~'];
|
|
256
|
+
SizingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SizingDirective, deps: [{ token: DOCUMENT }, { token: SizingMonitorDirective, optional: true }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
257
|
+
SizingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.3", type: SizingDirective, selector: "[buiSizing],[buiResized],[buiSizingBy],[buiFixedHeight]", inputs: { buiSizing: "buiSizing", sizingBy: "sizingBy", buiSizingBy: "buiSizingBy", buiFixedHeight: "buiFixedHeight" }, outputs: { buiResized: "buiResized" }, usesOnChanges: true, ngImport: i0 });
|
|
258
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SizingDirective, decorators: [{
|
|
259
|
+
type: Directive,
|
|
260
|
+
args: [{
|
|
261
|
+
selector: '[buiSizing],[buiResized],[buiSizingBy],[buiFixedHeight]'
|
|
262
|
+
}]
|
|
263
|
+
}], ctorParameters: function () {
|
|
264
|
+
return [{ type: Document, decorators: [{
|
|
265
|
+
type: Inject,
|
|
266
|
+
args: [DOCUMENT]
|
|
267
|
+
}] }, { type: SizingMonitorDirective, decorators: [{
|
|
268
|
+
type: Optional
|
|
269
|
+
}] }, { type: i0.ElementRef }, { type: i0.NgZone }];
|
|
270
|
+
}, propDecorators: { buiSizing: [{
|
|
271
|
+
type: Input
|
|
272
|
+
}], sizingBy: [{
|
|
273
|
+
type: Input
|
|
274
|
+
}], buiSizingBy: [{
|
|
275
|
+
type: Input
|
|
276
|
+
}], buiResized: [{
|
|
277
|
+
type: Output
|
|
278
|
+
}], buiFixedHeight: [{
|
|
279
|
+
type: Input
|
|
280
|
+
}] } });
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Use this directive on a `MatButton` element to provide an alternative view when an sync operation is in progress.
|
|
284
|
+
*
|
|
285
|
+
* For example:
|
|
286
|
+
*
|
|
287
|
+
* ```
|
|
288
|
+
* <button (click)="submit();" [buiAwait]="submitSubscription" buiAwaitAriaLabel="submitting">Submit</button>
|
|
289
|
+
* ```
|
|
290
|
+
*
|
|
291
|
+
* Please refer to [Material Design](https://material.io/components/progress-indicators#circular-progress-indicators)
|
|
292
|
+
* for more details of integrating circular spinner component with action buttons.
|
|
293
|
+
*
|
|
294
|
+
* The operation is considered 'in progress' when the bound property `buiAwait` evaluates to
|
|
295
|
+
*
|
|
296
|
+
* - `true`; or
|
|
297
|
+
* - an instance of `rxjs/Subscription` and `buiAwait.closed` is falsy
|
|
298
|
+
*
|
|
299
|
+
* When in progress
|
|
300
|
+
*
|
|
301
|
+
* - the button's caption will be hidden;
|
|
302
|
+
* - a `<mat-progress-spinner>` will be displayed in place of the caption;
|
|
303
|
+
* - the button will be disabled by setting the property `disabled` of the `MatButton` instance.
|
|
304
|
+
*/
|
|
305
|
+
class AwaitDirective {
|
|
306
|
+
constructor(_eRef, button, doc, factoryResolver, _viewCont) {
|
|
307
|
+
this._eRef = _eRef;
|
|
308
|
+
this.button = button;
|
|
309
|
+
this.doc = doc;
|
|
310
|
+
this._viewCont = _viewCont;
|
|
311
|
+
/** The ARIA label to be put on the spinner. The default value is `"In progress"`. */
|
|
312
|
+
this.buiAwaitAriaLabel = 'In progress';
|
|
313
|
+
/** The diameter of the in-progress spinner. The default value is `20`. */
|
|
314
|
+
this.buiAwaitDiameter = 20;
|
|
315
|
+
this._processing = false;
|
|
316
|
+
if (!button) {
|
|
317
|
+
console.error('[buiAwait] can only be used on a MatButton');
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
this._factory = factoryResolver.resolveComponentFactory(MatProgressSpinner);
|
|
321
|
+
}
|
|
322
|
+
/** @ignore */
|
|
323
|
+
ngAfterViewInit() {
|
|
324
|
+
if (this.button) {
|
|
325
|
+
this._overlayEl = this.doc.createElement('div');
|
|
326
|
+
this._eRef.nativeElement.appendChild(this._overlayEl);
|
|
327
|
+
this._overlayEl.classList.add('bui-await-overlay');
|
|
328
|
+
this._overlayEl.style.cssText =
|
|
329
|
+
'display:flex; position:absolute; top:0; right:0; bottom:0; left:0; align-items: center; justify-content: center';
|
|
330
|
+
this._captionWrapper = this._eRef.nativeElement.querySelector('.mat-button-wrapper');
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/** @ignore */
|
|
334
|
+
ngDoCheck() {
|
|
335
|
+
const inProgress = this.buiAwait === true || (typeof this.buiAwait === 'object' && !this.buiAwait.closed);
|
|
336
|
+
if (inProgress !== this._processing) {
|
|
337
|
+
this._processing = inProgress;
|
|
338
|
+
this._statusChanged();
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
_statusChanged() {
|
|
342
|
+
if (this.button) {
|
|
343
|
+
this.button.disabled = this._processing;
|
|
344
|
+
if (this._processing) {
|
|
345
|
+
this._spinnerRef = this._viewCont.createComponent(this._factory);
|
|
346
|
+
const c = this._spinnerRef.instance;
|
|
347
|
+
c.diameter = this.buiAwaitDiameter;
|
|
348
|
+
c.mode = 'indeterminate';
|
|
349
|
+
c.color = this.button.color;
|
|
350
|
+
const e = this._spinnerRef.location.nativeElement;
|
|
351
|
+
e.setAttribute('aria-label', this.buiAwaitAriaLabel);
|
|
352
|
+
this._overlayEl.appendChild(e);
|
|
353
|
+
this._captionWrapper.style.visibility = 'hidden';
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
this._captionWrapper.style.visibility = '';
|
|
357
|
+
this._spinnerRef.destroy();
|
|
358
|
+
this._overlayEl.innerHTML = '';
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
AwaitDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AwaitDirective, deps: [{ token: i0.ElementRef }, { token: i1.MatButton, optional: true }, { token: DOCUMENT }, { token: i0.ComponentFactoryResolver }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
364
|
+
AwaitDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.3", type: AwaitDirective, selector: "[buiAwait]", inputs: { buiAwait: "buiAwait", buiAwaitAriaLabel: "buiAwaitAriaLabel", buiAwaitDiameter: "buiAwaitDiameter" }, ngImport: i0 });
|
|
365
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AwaitDirective, decorators: [{
|
|
366
|
+
type: Directive,
|
|
367
|
+
args: [{
|
|
368
|
+
selector: '[buiAwait]'
|
|
369
|
+
}]
|
|
370
|
+
}], ctorParameters: function () {
|
|
371
|
+
return [{ type: i0.ElementRef }, { type: i1.MatButton, decorators: [{
|
|
372
|
+
type: Optional
|
|
373
|
+
}] }, { type: Document, decorators: [{
|
|
374
|
+
type: Inject,
|
|
375
|
+
args: [DOCUMENT]
|
|
376
|
+
}] }, { type: i0.ComponentFactoryResolver }, { type: i0.ViewContainerRef }];
|
|
377
|
+
}, propDecorators: { buiAwait: [{
|
|
378
|
+
type: Input
|
|
379
|
+
}], buiAwaitAriaLabel: [{
|
|
380
|
+
type: Input
|
|
381
|
+
}], buiAwaitDiameter: [{
|
|
382
|
+
type: Input
|
|
383
|
+
}] } });
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* For functionality that cannot be easily achieved via CSS.
|
|
387
|
+
*/
|
|
388
|
+
class BehaviorModule {
|
|
389
|
+
}
|
|
390
|
+
BehaviorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: BehaviorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
391
|
+
BehaviorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: BehaviorModule, declarations: [SizingDirective, SizingMonitorDirective, AwaitDirective], imports: [CommonModule, MatButtonModule, MatProgressSpinnerModule], exports: [SizingDirective, SizingMonitorDirective, AwaitDirective, MatProgressSpinnerModule] });
|
|
392
|
+
BehaviorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: BehaviorModule, imports: [CommonModule, MatButtonModule, MatProgressSpinnerModule, MatProgressSpinnerModule] });
|
|
393
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: BehaviorModule, decorators: [{
|
|
394
|
+
type: NgModule,
|
|
395
|
+
args: [{
|
|
396
|
+
declarations: [SizingDirective, SizingMonitorDirective, AwaitDirective],
|
|
397
|
+
imports: [CommonModule, MatButtonModule, MatProgressSpinnerModule],
|
|
398
|
+
exports: [SizingDirective, SizingMonitorDirective, AwaitDirective, MatProgressSpinnerModule]
|
|
399
|
+
}]
|
|
400
|
+
}] });
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Generated bundle index. Do not edit.
|
|
404
|
+
*/
|
|
405
|
+
|
|
406
|
+
export { AwaitDirective, BehaviorModule, SizingDirective, SizingMonitorDirective };
|
|
407
|
+
//# sourceMappingURL=bravura-ui-behavior.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bravura-ui-behavior.mjs","sources":["../../../projects/ui/behavior/sizing-monitor.directive.ts","../../../projects/ui/behavior/sizing.directive.ts","../../../projects/ui/behavior/await.directive.ts","../../../projects/ui/behavior/behavior.module.ts","../../../projects/ui/behavior/bravura-ui-behavior.ts"],"sourcesContent":["import { Directive, ElementRef } from '@angular/core';\n\n/**\n * Use this directive to designate a target HTML element, based on which the child elements'\n * `[buiSizing]` directives will calculate the sizes.\n *\n * ```html\n * <div [buiSizingMonitor]>\n * <div [buiSizing]=\"...\">\n * </div>\n * <div>\n * <div [buiSizing]=\"...\">\n * </div>\n * </div>\n * <div>\n * ```\n */\n@Directive({\n\tselector: '[buiSizingMonitor]'\n})\nexport class SizingMonitorDirective {\n\tconstructor(public readonly element: ElementRef<HTMLElement>) {}\n}\n","import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { DOCUMENT } from '@angular/common';\nimport {\n\tDirective,\n\tElementRef,\n\tEventEmitter,\n\tInject,\n\tInput,\n\tNgZone,\n\tOnChanges,\n\tOnDestroy,\n\tOptional,\n\tOutput,\n\tSimpleChanges\n} from '@angular/core';\nimport { debounceTime, take } from 'rxjs/operators';\nimport { SizingMonitorDirective } from './sizing-monitor.directive';\n\n/**\n * This directive monitors the changes in the width of the `sizingBy` target, and apply specified style\n * classes and/or inline styles to the current element dynamically.\n *\n * In order for the layout engine to efficiently calculate and stabilize the dimensions, the effective style property\n * `box-sizing` of the `sizingBy` target element must be set to `border-box`.\n *\n * The directive uses [ResizeObserver API](https://developer.mozilla.org/en-US/docs/Web/API/Resize_Observer_API)\n * to capture the events of element resizing. Please use a polyfill if you want to support older browsers\n * that do not implement ResizeObserver API.\n *\n * Examples:\n *\n * ```html\n * <div #parentElement>\n * <div [buiSizing]=\"{'400': 'small', '800': 'medium', '~': 'large'}\" [buiSizingBy]=\"parentElement\"></div>\n * <div [buiSizing]=\"['small', 'medium', 'large']\" [buiSizingBy]=\"'root'\"></div>\n * <div [buiSizing]=\"{'650': 'border-color: #28569', '~': 'bg-muted; border-style: dotted'}\" [buiSizingBy]=\"parentElement\"></div>\n * </div>\n * ```\n */\n@Directive({\n\tselector: '[buiSizing],[buiResized],[buiSizingBy],[buiFixedHeight]'\n})\nexport class SizingDirective implements OnChanges, OnDestroy {\n\t/**\n\t * @ignore\n\t */\n\tstatic defaultSizingBreakpoints = ['400', '800', '~'];\n\n\t/**\n\t * Specifies the breakpoint widths and the style classes.\n\t *\n\t * The sizing spec `{\"400\": \"small\", \"800\": \"medium\", \"~\": \"large\"}` tells the directive to apply\n\t * a style class `small` when the width of the monitored target is smaller than 400 pixels,\n\t * `medium` when the width is between 400 and 800 pixels, and `large` when above.\n\t *\n\t * @example {'400': 'small', '800': 'medium', '~': 'large'}\n\t */\n\t@Input()\n\tbuiSizing: string | Array<string> | { [key: string]: string } = {};\n\n\t/**\n\t * The alias of `buiSizingBy`.\n\t * @default 'root'\n\t * @deprecated\n\t * @ignore\n\t */\n\t@Input()\n\tsizingBy: 'root' | 'parent' | HTMLElement = 'root';\n\n\t/**\n\t * Designate an element to be monitored for recalculating the style classes of the current element.\n\t *\n\t * - `root` specifies the document root or the enclosing shadow host. This is the default value.\n\t * - `parent` specifies the parent element.\n\t *\n\t * @default 'root'\n\t * @alias sizingBy\n\t */\n\t@Input()\n\tget buiSizingBy(): 'root' | 'parent' | HTMLElement {\n\t\treturn this.sizingBy;\n\t}\n\tset buiSizingBy(target: 'root' | 'parent' | HTMLElement) {\n\t\tthis.sizingBy = target;\n\t}\n\n\t/**\n\t * Emits `{width, height}` when the monitor target element resizes.\n\t *\n\t * Note that the dimensions emitted are of the [sizingBy] target, but not the current element.\n\t */\n\t@Output()\n\tbuiResized = new EventEmitter<{ width: number; height: number }>();\n\n\t/**\n\t * Recalculate the height of this element according to the height of the monitored target.\n\t */\n\t@Input()\n\tbuiFixedHeight = false;\n\n\tprivate _monitorTarget: HTMLElement;\n\tprivate _observer: ResizeObserver | undefined;\n\tprivate _sizingSpec: { [key: string]: string } = {};\n\tprivate _width = 0;\n\tprivate _height = 0;\n\tprivate _reflowFrameCount = 0;\n\tprivate _element: HTMLElement;\n\n\tconstructor(\n\t\t@Inject(DOCUMENT) private _doc: Document,\n\t\t@Optional() private _defaultTarget: SizingMonitorDirective,\n\t\telemRef: ElementRef<HTMLElement>,\n\t\tprivate _zone: NgZone\n\t) {\n\t\tthis._element = elemRef.nativeElement;\n\t\tthis._monitorTarget = this._element;\n\t}\n\n\tngOnChanges(_: SimpleChanges): void {\n\t\tconst disconnected = this._element.getRootNode() instanceof HTMLElement;\n\t\tif (disconnected) {\n\t\t\t// defer shadow detection till dom connection event\n\t\t\tthis._zone.onStable.pipe(debounceTime(10), take(1)).subscribe(() => this._initOrReset());\n\t\t} else {\n\t\t\tthis._initOrReset();\n\t\t}\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._tearDownNodeMonitor();\n\t}\n\n\tprivate _initOrReset() {\n\t\tconst originalTarget = this._monitorTarget;\n\t\tif (this.buiSizingBy instanceof HTMLElement) {\n\t\t\tthis._monitorTarget = this.buiSizingBy;\n\t\t} else if (this._defaultTarget) {\n\t\t\tthis._monitorTarget = this._defaultTarget.element.nativeElement;\n\t\t} else if (this.buiSizingBy === 'root') {\n\t\t\tconst root = this._element.getRootNode();\n\t\t\tif (root instanceof ShadowRoot) {\n\t\t\t\tthis._monitorTarget = root.host as HTMLElement;\n\t\t\t} else {\n\t\t\t\tthis._monitorTarget = this._doc.documentElement;\n\t\t\t}\n\t\t} else {\n\t\t\tthis._monitorTarget = this._element.parentElement as any;\n\t\t}\n\n\t\tif (this._monitorTarget != originalTarget) {\n\t\t\tthis._setUpNodeMonitor();\n\t\t}\n\n\t\tthis._sizingSpec = {};\n\t\tlet spec = this.buiSizing;\n\t\tif (typeof spec === 'string') {\n\t\t\tspec = spec.split(',').map(k => k.trim());\n\t\t}\n\n\t\tif (Array.isArray(spec)) {\n\t\t\tspec.forEach((c, i) => {\n\t\t\t\tthis._sizingSpec[SizingDirective.defaultSizingBreakpoints[i] || '~'] = c;\n\t\t\t});\n\t\t} else if (spec) {\n\t\t\tthis._sizingSpec = spec;\n\t\t}\n\n\t\tthis.buiFixedHeight = coerceBooleanProperty(this.buiFixedHeight);\n\n\t\tthis._calculateSize();\n\t}\n\n\tprivate _setUpNodeMonitor() {\n\t\tthis._tearDownNodeMonitor();\n\t\tif (this._monitorTarget) {\n\t\t\tthis._observer = new ResizeObserver(() => this._calculateSize());\n\n\t\t\tthis._observer.observe(this._monitorTarget, { box: 'border-box' });\n\t\t}\n\t}\n\n\tprivate _tearDownNodeMonitor() {\n\t\tif (this._observer) {\n\t\t\tthis._observer.disconnect();\n\t\t\tthis._observer = undefined;\n\t\t}\n\t}\n\n\tprivate _calculateSize() {\n\t\tconst widthChanged = this._width !== this._monitorTarget.clientWidth;\n\t\tconst heightChanged = this._height !== this._monitorTarget.clientHeight;\n\t\tif (widthChanged) {\n\t\t\tthis._width = this._monitorTarget.clientWidth;\n\n\t\t\tconst bks = Object.keys(this._sizingSpec).sort((a, b) => this._toNumber(a) - this._toNumber(b));\n\t\t\tlet found = false;\n\t\t\tfor (const key of bks) {\n\t\t\t\tconst classesOrStyles = this._sizingSpec[key].split(/;+/).filter(c => c);\n\t\t\t\tthis._removeClassesOrStyles(classesOrStyles);\n\t\t\t\tconst expectedWidth = this._toNumber(key);\n\t\t\t\tif (this._width <= expectedWidth && !found) {\n\t\t\t\t\tthis._applyClassesOrStyles(classesOrStyles);\n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (widthChanged || heightChanged) {\n\t\t\tthis._height = this._monitorTarget.clientHeight;\n\t\t\tif (this.buiFixedHeight) {\n\t\t\t\tthis._reflowFrameCount = 0;\n\t\t\t\tthis._reflowHeight();\n\t\t\t}\n\t\t\tsetTimeout(() => this._zone.run(() => this.buiResized.emit({ width: this._width, height: this._height })));\n\t\t}\n\t}\n\n\tprivate _applyClassesOrStyles(clsOrStyles: string[]) {\n\t\tclsOrStyles.forEach(s => {\n\t\t\tif (s.includes(':')) {\n\t\t\t\tconst [prop, val] = s.split(':');\n\t\t\t\tthis._element.style.setProperty(prop.trim(), val.trim());\n\t\t\t} else {\n\t\t\t\tconst classes = s.split(/\\s+/).filter(c => c);\n\t\t\t\tif (classes.length) {\n\t\t\t\t\tthis._element.classList.add(...classes);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _removeClassesOrStyles(clsOrStyles: string[]) {\n\t\tclsOrStyles.forEach(s => {\n\t\t\tif (s.includes(':')) {\n\t\t\t\tconst [prop] = s.split(':');\n\t\t\t\tthis._element.style.removeProperty(prop);\n\t\t\t} else {\n\t\t\t\tconst classes = s.split(/\\s+/).filter(c => c);\n\t\t\t\tif (classes.length) {\n\t\t\t\t\tthis._element.classList.remove(...classes);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _reflowHeight() {\n\t\tconst cnt = this._reflowFrameCount;\n\t\tif (cnt < 15) {\n\t\t\trequestAnimationFrame(this._reflowHeight.bind(this));\n\n\t\t\tif (cnt === 0) {\n\t\t\t\tthis._element.style.height = '0';\n\t\t\t} else if (cnt === 14) {\n\t\t\t\tconst gt = parseInt(\n\t\t\t\t\tgetComputedStyle(this._monitorTarget).getPropertyValue('padding-top').replace(/px$/, '') || '0',\n\t\t\t\t\t10\n\t\t\t\t);\n\t\t\t\tconst gb = parseInt(\n\t\t\t\t\tgetComputedStyle(this._monitorTarget).getPropertyValue('padding-bottom').replace(/px$/, '') || '0',\n\t\t\t\t\t10\n\t\t\t\t);\n\t\t\t\tthis._element.style.height = `${this._height - gt - gb - 5}px`;\n\t\t\t}\n\t\t}\n\t\tthis._reflowFrameCount++;\n\t}\n\n\tprivate _toNumber(s: string) {\n\t\treturn (s === '~' ? Infinity : Number(s)) || -Infinity;\n\t}\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n\tAfterViewInit,\n\tComponentFactory,\n\tComponentFactoryResolver,\n\tComponentRef,\n\tDirective,\n\tDoCheck,\n\tElementRef,\n\tInject,\n\tInput,\n\tOptional,\n\tViewContainerRef\n} from '@angular/core';\nimport { MatButton } from '@angular/material/button';\nimport { MatProgressSpinner } from '@angular/material/progress-spinner';\nimport { Subscription } from 'rxjs';\n\n/**\n * Use this directive on a `MatButton` element to provide an alternative view when an sync operation is in progress.\n *\n * For example:\n *\n * ```\n * <button (click)=\"submit();\" [buiAwait]=\"submitSubscription\" buiAwaitAriaLabel=\"submitting\">Submit</button>\n * ```\n *\n * Please refer to [Material Design](https://material.io/components/progress-indicators#circular-progress-indicators)\n * for more details of integrating circular spinner component with action buttons.\n *\n * The operation is considered 'in progress' when the bound property `buiAwait` evaluates to\n *\n * - `true`; or\n * - an instance of `rxjs/Subscription` and `buiAwait.closed` is falsy\n *\n * When in progress\n *\n * - the button's caption will be hidden;\n * - a `<mat-progress-spinner>` will be displayed in place of the caption;\n * - the button will be disabled by setting the property `disabled` of the `MatButton` instance.\n */\n@Directive({\n\tselector: '[buiAwait]'\n})\nexport class AwaitDirective implements AfterViewInit, DoCheck {\n\t/**\n\t * Indicates the `in progress` status of an async operation.\n\t *\n\t * The operation is considered 'in progress' when the property evaluates to\n\t *\n\t * - `true`; or\n\t * - an instance of `rxjs/Subscription` and `buiAwait.closed` is falsy\n\t *\n\t */\n\t@Input()\n\tbuiAwait: null | undefined | boolean | Subscription;\n\n\t/** The ARIA label to be put on the spinner. The default value is `\"In progress\"`. */\n\t@Input()\n\tbuiAwaitAriaLabel = 'In progress';\n\n\t/** The diameter of the in-progress spinner. The default value is `20`. */\n\t@Input()\n\tbuiAwaitDiameter = 20;\n\n\tprivate _overlayEl: HTMLDivElement | undefined;\n\tprivate _processing = false;\n\tprivate _factory: ComponentFactory<MatProgressSpinner> | undefined;\n\tprivate _spinnerRef: ComponentRef<MatProgressSpinner> | undefined;\n\tprivate _captionWrapper: HTMLElement | undefined;\n\n\tconstructor(\n\t\tprivate readonly _eRef: ElementRef<HTMLElement>,\n\t\t@Optional() private readonly button: MatButton,\n\t\t@Inject(DOCUMENT) private readonly doc: Document,\n\t\tfactoryResolver: ComponentFactoryResolver,\n\t\tprivate _viewCont: ViewContainerRef\n\t) {\n\t\tif (!button) {\n\t\t\tconsole.error('[buiAwait] can only be used on a MatButton');\n\t\t\treturn;\n\t\t}\n\t\tthis._factory = factoryResolver.resolveComponentFactory(MatProgressSpinner);\n\t}\n\n\t/** @ignore */\n\tngAfterViewInit(): void {\n\t\tif (this.button) {\n\t\t\tthis._overlayEl = this.doc.createElement('div');\n\t\t\tthis._eRef.nativeElement.appendChild(this._overlayEl);\n\t\t\tthis._overlayEl.classList.add('bui-await-overlay');\n\t\t\tthis._overlayEl.style.cssText =\n\t\t\t\t'display:flex; position:absolute; top:0; right:0; bottom:0; left:0; align-items: center; justify-content: center';\n\t\t\tthis._captionWrapper = this._eRef.nativeElement.querySelector('.mat-button-wrapper') as HTMLElement;\n\t\t}\n\t}\n\n\t/** @ignore */\n\tngDoCheck(): void {\n\t\tconst inProgress = this.buiAwait === true || (typeof this.buiAwait === 'object' && !this.buiAwait!.closed);\n\t\tif (inProgress !== this._processing) {\n\t\t\tthis._processing = inProgress;\n\t\t\tthis._statusChanged();\n\t\t}\n\t}\n\n\tprivate _statusChanged() {\n\t\tif (this.button) {\n\t\t\tthis.button.disabled = this._processing;\n\n\t\t\tif (this._processing) {\n\t\t\t\tthis._spinnerRef = this._viewCont.createComponent(this._factory!);\n\t\t\t\tconst c = this._spinnerRef.instance;\n\t\t\t\tc.diameter = this.buiAwaitDiameter;\n\t\t\t\tc.mode = 'indeterminate';\n\t\t\t\tc.color = this.button.color;\n\t\t\t\tconst e: HTMLElement = this._spinnerRef.location.nativeElement;\n\t\t\t\te.setAttribute('aria-label', this.buiAwaitAriaLabel);\n\t\t\t\tthis._overlayEl!.appendChild(e);\n\t\t\t\tthis._captionWrapper!.style.visibility = 'hidden';\n\t\t\t} else {\n\t\t\t\tthis._captionWrapper!.style.visibility = '';\n\t\t\t\tthis._spinnerRef!.destroy();\n\t\t\t\tthis._overlayEl!.innerHTML = '';\n\t\t\t}\n\t\t}\n\t}\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SizingDirective } from './sizing.directive';\nimport { SizingMonitorDirective } from './sizing-monitor.directive';\nimport { AwaitDirective } from './await.directive';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\n\n/**\n * For functionality that cannot be easily achieved via CSS.\n */\n@NgModule({\n\tdeclarations: [SizingDirective, SizingMonitorDirective, AwaitDirective],\n\timports: [CommonModule, MatButtonModule, MatProgressSpinnerModule],\n\texports: [SizingDirective, SizingMonitorDirective, AwaitDirective, MatProgressSpinner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;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,YAAY,EAAE,CAAC,eAAe,EAAE,sBAAsB,EAAE,cAAc,CAAC;AACvE,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,wBAAwB,CAAC;oBAClE,OAAO,EAAE,CAAC,eAAe,EAAE,sBAAsB,EAAE,cAAc,EAAE,wBAAwB,CAAC;iBAC5F,CAAA;;;ACfD;;AAEG;;;;"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as i1 from '@angular/cdk/bidi';
|
|
2
|
+
import { BidiModule } from '@angular/cdk/bidi';
|
|
3
|
+
import { DOCUMENT } from '@angular/common';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { NgModule, Optional, SkipSelf, Inject } from '@angular/core';
|
|
6
|
+
|
|
7
|
+
function generateID() {
|
|
8
|
+
return btoa(`${(Math.round(Math.random() * 1000) + Date.now() * 1000) % 1000000}`)
|
|
9
|
+
.replace(/[^\w\d]/g, '')
|
|
10
|
+
.toLowerCase();
|
|
11
|
+
}
|
|
12
|
+
function isElementInViewport(el) {
|
|
13
|
+
const rect = el.getBoundingClientRect();
|
|
14
|
+
return (rect.top >= 0 &&
|
|
15
|
+
rect.left >= 0 &&
|
|
16
|
+
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
|
|
17
|
+
rect.right <= (window.innerWidth || document.documentElement.clientWidth));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Regex that matches locales with an RTL script. Taken from `goog.i18n.bidi.isRtlLanguage`. */
|
|
21
|
+
const RTL_LOCALE_PATTERN = /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;
|
|
22
|
+
/** Resolves a string value to a specific direction. */
|
|
23
|
+
function _resolveDirectionality(rawValue) {
|
|
24
|
+
const value = (rawValue === null || rawValue === void 0 ? void 0 : rawValue.toLowerCase()) || '';
|
|
25
|
+
if (value === 'auto' && typeof navigator !== 'undefined' && (navigator === null || navigator === void 0 ? void 0 : navigator.language)) {
|
|
26
|
+
return RTL_LOCALE_PATTERN.test(navigator.language) ? 'rtl' : 'ltr';
|
|
27
|
+
}
|
|
28
|
+
return value === 'rtl' ? 'rtl' : 'ltr';
|
|
29
|
+
}
|
|
30
|
+
class BuiCommonModule {
|
|
31
|
+
constructor(dir, thisModule, document) {
|
|
32
|
+
if (!thisModule) {
|
|
33
|
+
const observer = new MutationObserver(() => {
|
|
34
|
+
const attr = document.documentElement.getAttribute('dir') || document.body.getAttribute('dir');
|
|
35
|
+
if (attr && dir.value !== attr) {
|
|
36
|
+
const d = _resolveDirectionality(attr);
|
|
37
|
+
dir.change.emit(d);
|
|
38
|
+
if (Object.getOwnPropertyNames(dir).includes('value')) {
|
|
39
|
+
dir.value = d;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
observer.observe(document.documentElement, { attributes: true });
|
|
44
|
+
observer.observe(document.body, { attributes: true });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
BuiCommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: BuiCommonModule, deps: [{ token: i1.Directionality }, { token: BuiCommonModule, optional: true, skipSelf: true }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
49
|
+
BuiCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: BuiCommonModule, imports: [BidiModule], exports: [BidiModule] });
|
|
50
|
+
BuiCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: BuiCommonModule, imports: [BidiModule, BidiModule] });
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: BuiCommonModule, decorators: [{
|
|
52
|
+
type: NgModule,
|
|
53
|
+
args: [{
|
|
54
|
+
declarations: [],
|
|
55
|
+
imports: [BidiModule],
|
|
56
|
+
exports: [BidiModule]
|
|
57
|
+
}]
|
|
58
|
+
}], ctorParameters: function () {
|
|
59
|
+
return [{ type: i1.Directionality }, { type: BuiCommonModule, decorators: [{
|
|
60
|
+
type: Optional
|
|
61
|
+
}, {
|
|
62
|
+
type: SkipSelf
|
|
63
|
+
}] }, { type: Document, decorators: [{
|
|
64
|
+
type: Inject,
|
|
65
|
+
args: [DOCUMENT]
|
|
66
|
+
}] }];
|
|
67
|
+
} });
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Generated bundle index. Do not edit.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
export { BuiCommonModule, _resolveDirectionality, generateID, isElementInViewport };
|
|
74
|
+
//# sourceMappingURL=bravura-ui-common.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bravura-ui-common.mjs","sources":["../../../projects/ui/common/common-utils.ts","../../../projects/ui/common/common.module.ts","../../../projects/ui/common/bravura-ui-common.ts"],"sourcesContent":["export function generateID() {\n\treturn btoa(`${(Math.round(Math.random() * 1000) + Date.now() * 1000) % 1000000}`)\n\t\t.replace(/[^\\w\\d]/g, '')\n\t\t.toLowerCase();\n}\n\nexport function isElementInViewport(el: HTMLElement) {\n\tconst rect = el.getBoundingClientRect();\n\n\treturn (\n\t\trect.top >= 0 &&\n\t\trect.left >= 0 &&\n\t\trect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n\t\trect.right <= (window.innerWidth || document.documentElement.clientWidth)\n\t);\n}\n","import { BidiModule, Direction, Directionality } from '@angular/cdk/bidi';\nimport { DOCUMENT } from '@angular/common';\nimport { Inject, NgModule, Optional, SkipSelf } from '@angular/core';\n\n/** Regex that matches locales with an RTL script. Taken from `goog.i18n.bidi.isRtlLanguage`. */\nconst RTL_LOCALE_PATTERN =\n\t/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;\n\n/** Resolves a string value to a specific direction. */\nexport function _resolveDirectionality(rawValue: string): Direction {\n\tconst value = rawValue?.toLowerCase() || '';\n\n\tif (value === 'auto' && typeof navigator !== 'undefined' && navigator?.language) {\n\t\treturn RTL_LOCALE_PATTERN.test(navigator.language) ? 'rtl' : 'ltr';\n\t}\n\n\treturn value === 'rtl' ? 'rtl' : 'ltr';\n}\n\n@NgModule({\n\tdeclarations: [],\n\timports: [BidiModule],\n\texports: [BidiModule]\n})\nexport class BuiCommonModule {\n\tconstructor(\n\t\tdir: Directionality,\n\t\t@Optional()\n\t\t@SkipSelf()\n\t\tthisModule: BuiCommonModule,\n\t\t@Inject(DOCUMENT) document: Document\n\t) {\n\t\tif (!thisModule) {\n\t\t\tconst observer = new MutationObserver(() => {\n\t\t\t\tconst attr = document.documentElement.getAttribute('dir') || document.body.getAttribute('dir');\n\t\t\t\tif (attr && dir.value !== attr) {\n\t\t\t\t\tconst d = _resolveDirectionality(attr);\n\t\t\t\t\tdir.change.emit(d);\n\t\t\t\t\tif (Object.getOwnPropertyNames(dir).includes('value')) {\n\t\t\t\t\t\t(dir as any).value = d;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tobserver.observe(document.documentElement, { attributes: true });\n\t\t\tobserver.observe(document.body, { attributes: true });\n\t\t}\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;SAAgB,UAAU,GAAA;IACzB,OAAO,IAAI,CAAC,CAAA,EAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,IAAI,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