@bravobit/bb-foundation 0.54.3 → 0.55.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/auth/index.d.ts +267 -5
- package/collections/index.d.ts +350 -5
- package/combobox/index.d.ts +58 -5
- package/dashboard/index.d.ts +104 -5
- package/dialog/index.d.ts +168 -5
- package/elements/index.d.ts +838 -5
- package/fesm2022/bravobit-bb-foundation-auth.mjs +22 -22
- package/fesm2022/bravobit-bb-foundation-collections.mjs +44 -44
- package/fesm2022/bravobit-bb-foundation-collections.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-combobox.mjs +15 -15
- package/fesm2022/bravobit-bb-foundation-dashboard.mjs +25 -25
- package/fesm2022/bravobit-bb-foundation-dialog.mjs +33 -33
- package/fesm2022/bravobit-bb-foundation-dialog.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-elements.mjs +102 -102
- package/fesm2022/bravobit-bb-foundation-elements.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-http.mjs +10 -10
- package/fesm2022/bravobit-bb-foundation-localize.mjs +18 -18
- package/fesm2022/bravobit-bb-foundation-localize.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-masking.mjs +16 -16
- package/fesm2022/bravobit-bb-foundation-notifications.mjs +15 -15
- package/fesm2022/bravobit-bb-foundation-notifications.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-permissions.mjs +10 -10
- package/fesm2022/bravobit-bb-foundation-recaptcha.mjs +11 -12
- package/fesm2022/bravobit-bb-foundation-recaptcha.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-select.mjs +21 -21
- package/fesm2022/bravobit-bb-foundation-select.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-storage.mjs +3 -3
- package/fesm2022/bravobit-bb-foundation-table.mjs +22 -22
- package/fesm2022/bravobit-bb-foundation-tooltip.mjs +10 -10
- package/fesm2022/bravobit-bb-foundation-utils.mjs +16 -16
- package/fesm2022/bravobit-bb-foundation.mjs +25 -25
- package/fesm2022/bravobit-bb-foundation.mjs.map +1 -1
- package/http/index.d.ts +78 -5
- package/index.d.ts +215 -5
- package/localize/index.d.ts +546 -5
- package/masking/index.d.ts +104 -5
- package/notifications/index.d.ts +78 -5
- package/package.json +21 -21
- package/permissions/index.d.ts +89 -5
- package/recaptcha/index.d.ts +92 -5
- package/rxjs/index.d.ts +19 -5
- package/select/index.d.ts +129 -5
- package/storage/index.d.ts +109 -5
- package/table/index.d.ts +197 -5
- package/tooltip/index.d.ts +45 -5
- package/utils/index.d.ts +66 -5
- package/auth/lib/acting.interceptor.d.ts +0 -9
- package/auth/lib/acting.service.d.ts +0 -17
- package/auth/lib/auth.config.d.ts +0 -3
- package/auth/lib/auth.interceptor.d.ts +0 -20
- package/auth/lib/auth.module.d.ts +0 -10
- package/auth/lib/auth.service.d.ts +0 -51
- package/auth/lib/auth.session.d.ts +0 -50
- package/auth/lib/directives/anonymous.directive.d.ts +0 -20
- package/auth/lib/directives/authenticated.directive.d.ts +0 -20
- package/auth/lib/guards/anonymous.guard.d.ts +0 -2
- package/auth/lib/guards/authenticated.guard.d.ts +0 -2
- package/auth/lib/helpers/jwt.helper.d.ts +0 -8
- package/auth/lib/interfaces/config.interface.d.ts +0 -27
- package/auth/lib/interfaces/provider.interface.d.ts +0 -23
- package/auth/lib/interfaces/token.interface.d.ts +0 -11
- package/auth/lib/providers/email.provider.d.ts +0 -9
- package/auth/lib/providers/verify.provider.d.ts +0 -9
- package/auth/lib/tokens/use-authorization.token.d.ts +0 -2
- package/auth/public_api.d.ts +0 -17
- package/collections/lib/classes/array.collection.d.ts +0 -17
- package/collections/lib/collection.d.ts +0 -40
- package/collections/lib/collections.config.d.ts +0 -3
- package/collections/lib/collections.interfaces.d.ts +0 -10
- package/collections/lib/collections.module.d.ts +0 -19
- package/collections/lib/components/collections-actions/collections-actions.component.d.ts +0 -13
- package/collections/lib/components/collections-grid/collections-grid.component.d.ts +0 -18
- package/collections/lib/components/collections-pager/collections-pager.component.d.ts +0 -38
- package/collections/lib/components/collections-table/collections-table.component.d.ts +0 -26
- package/collections/lib/components/collections-table-label/collections-table-label.component.d.ts +0 -11
- package/collections/lib/components/collections-table-sorting/collections-table-sorting.component.d.ts +0 -18
- package/collections/lib/components/collections-viewer/collections-viewer.component.d.ts +0 -16
- package/collections/lib/directives/collections-data-row.directive.d.ts +0 -14
- package/collections/lib/directives/collections-data.directive.d.ts +0 -14
- package/collections/lib/directives/collections-empty.directive.d.ts +0 -14
- package/collections/lib/directives/collections-error.directive.d.ts +0 -14
- package/collections/lib/directives/collections-initial.directive.d.ts +0 -11
- package/collections/lib/directives/collections-item.directive.d.ts +0 -14
- package/collections/lib/interfaces/array-collection.interface.d.ts +0 -6
- package/collections/lib/interfaces/collection.interface.d.ts +0 -32
- package/collections/lib/providers/api-collection.provider.d.ts +0 -19
- package/collections/lib/providers/collection.provider.d.ts +0 -9
- package/collections/lib/providers/local-collection.provider.d.ts +0 -16
- package/collections/public_api.d.ts +0 -23
- package/combobox/combobox/combobox-container.directive.d.ts +0 -28
- package/combobox/combobox/combobox.component.d.ts +0 -37
- package/combobox/combobox-label.directive.d.ts +0 -5
- package/combobox/combobox-option.directive.d.ts +0 -7
- package/combobox/combobox-panel/combobox-panel.animation.d.ts +0 -1
- package/combobox/combobox-panel/combobox-panel.component.d.ts +0 -18
- package/combobox/combobox.interface.d.ts +0 -8
- package/combobox/public_api.d.ts +0 -3
- package/dashboard/lib/dashboard/dashboard.component.d.ts +0 -17
- package/dashboard/lib/dashboard-header/dashboard-header.component.d.ts +0 -9
- package/dashboard/lib/dashboard-menu/dashboard-menu.component.d.ts +0 -9
- package/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.d.ts +0 -8
- package/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.d.ts +0 -19
- package/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.d.ts +0 -22
- package/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.d.ts +0 -16
- package/dashboard/lib/dashboard.module.d.ts +0 -13
- package/dashboard/public_api.d.ts +0 -8
- package/dialog/lib/dialog-actions/dialog-actions.component.d.ts +0 -5
- package/dialog/lib/dialog-confirm/dialog-confirm.component.d.ts +0 -22
- package/dialog/lib/dialog-container/dialog-container.component.d.ts +0 -23
- package/dialog/lib/dialog-header/dialog-header.component.d.ts +0 -13
- package/dialog/lib/dialog-modal/dialog-modal.component.d.ts +0 -16
- package/dialog/lib/dialog-overlay/dialog-overlay.component.d.ts +0 -19
- package/dialog/lib/dialog.config.d.ts +0 -3
- package/dialog/lib/dialog.insertion.d.ts +0 -7
- package/dialog/lib/dialog.interfaces.d.ts +0 -21
- package/dialog/lib/dialog.module.d.ts +0 -17
- package/dialog/lib/dialog.ref.d.ts +0 -8
- package/dialog/lib/dialog.service.d.ts +0 -15
- package/dialog/lib/directives/confirm.directive.d.ts +0 -14
- package/dialog/public_api.d.ts +0 -10
- package/elements/lib/avatar/avatar.component.d.ts +0 -31
- package/elements/lib/button/button.component.d.ts +0 -21
- package/elements/lib/checkbox/checkbox.component.d.ts +0 -36
- package/elements/lib/checkbox-group/checkbox-group.component.d.ts +0 -13
- package/elements/lib/color-picker/color-picker.component.d.ts +0 -18
- package/elements/lib/color-slider/color-slider.component.d.ts +0 -24
- package/elements/lib/date-picker/date-picker.component.d.ts +0 -77
- package/elements/lib/directives/color-picker.directive.d.ts +0 -27
- package/elements/lib/directives/extra-error-controls.directive.d.ts +0 -13
- package/elements/lib/directives/file-drop.directive.d.ts +0 -13
- package/elements/lib/directives/form-submit.directive.d.ts +0 -17
- package/elements/lib/directives/form-submitter.directive.d.ts +0 -9
- package/elements/lib/directives/image-upload.directive.d.ts +0 -25
- package/elements/lib/directives/input.directive.d.ts +0 -16
- package/elements/lib/elements.config.d.ts +0 -3
- package/elements/lib/elements.inject.d.ts +0 -3
- package/elements/lib/elements.interfaces.d.ts +0 -41
- package/elements/lib/elements.module.d.ts +0 -39
- package/elements/lib/file-picker/file-picker.component.d.ts +0 -57
- package/elements/lib/form-control/form-control.component.d.ts +0 -20
- package/elements/lib/form-error/form-error.component.d.ts +0 -36
- package/elements/lib/form-group/form-group.component.d.ts +0 -7
- package/elements/lib/icon/icon.component.d.ts +0 -26
- package/elements/lib/image-control/image-control.component.d.ts +0 -44
- package/elements/lib/image-picker/image-picker.component.d.ts +0 -39
- package/elements/lib/multi-file-control/multi-file-control.component.d.ts +0 -72
- package/elements/lib/pincode-control/pincode-control.component.d.ts +0 -65
- package/elements/lib/pipes/date.pipe.d.ts +0 -9
- package/elements/lib/pipes/file-data-url.pipe.d.ts +0 -12
- package/elements/lib/pipes/file-image.pipe.d.ts +0 -14
- package/elements/lib/pipes/file-size.pipe.d.ts +0 -7
- package/elements/lib/pipes/relative-time.pipe.d.ts +0 -19
- package/elements/lib/radio-button/radio-button.component.d.ts +0 -16
- package/elements/lib/radio-group/radio-group.component.d.ts +0 -38
- package/elements/lib/spinner/spinner.component.d.ts +0 -9
- package/elements/public_api.d.ts +0 -35
- package/http/lib/classes/http.config.d.ts +0 -9
- package/http/lib/classes/http.error.d.ts +0 -7
- package/http/lib/http.config.d.ts +0 -5
- package/http/lib/http.interfaces.d.ts +0 -21
- package/http/lib/http.module.d.ts +0 -11
- package/http/lib/interceptors/base-url.interceptor.d.ts +0 -15
- package/http/lib/interceptors/error.interceptor.d.ts +0 -9
- package/http/public_api.d.ts +0 -7
- package/lib/core/colors/hex.d.ts +0 -18
- package/lib/core/colors/hsl.d.ts +0 -7
- package/lib/core/colors/hsv.d.ts +0 -13
- package/lib/core/colors/rgb.d.ts +0 -7
- package/lib/core/functions/array.utils.d.ts +0 -1
- package/lib/core/functions/date.utils.d.ts +0 -4
- package/lib/core/functions/file.utils.d.ts +0 -3
- package/lib/core/functions/format.utils.d.ts +0 -1
- package/lib/core/functions/password.utils.d.ts +0 -1
- package/lib/core/functions/route-cache.utils.d.ts +0 -10
- package/lib/core/functions/utils.d.ts +0 -1
- package/lib/core/miscellaneous/coercion.d.ts +0 -2
- package/lib/core/miscellaneous/regex.d.ts +0 -5
- package/lib/core/miscellaneous/validator.d.ts +0 -13
- package/lib/core/services/exif.service.d.ts +0 -12
- package/lib/core/services/file-loader.service.d.ts +0 -13
- package/lib/core/services/files.service.d.ts +0 -15
- package/lib/core/services/image-converter.service.d.ts +0 -17
- package/lib/core/services/languages.service.d.ts +0 -15
- package/lib/core/services/network.service.d.ts +0 -13
- package/lib/core/services/patch.service.d.ts +0 -14
- package/lib/core/tokens/accept-language.token.d.ts +0 -2
- package/lib/core/tokens/cookie.token.d.ts +0 -2
- package/lib/core/tokens/global-focus-mode.token.d.ts +0 -4
- package/lib/core/tokens/location.token.d.ts +0 -2
- package/lib/core/tokens/navigator.token.d.ts +0 -2
- package/lib/core/tokens/window.token.d.ts +0 -2
- package/localize/lib/dictionary/dictionary.class.d.ts +0 -28
- package/localize/lib/dictionary/dictionary.context.d.ts +0 -7
- package/localize/lib/dictionary/dictionary.data.d.ts +0 -7
- package/localize/lib/functions/date.function.d.ts +0 -5
- package/localize/lib/functions/lowercase.function.d.ts +0 -5
- package/localize/lib/functions/uppercase.function.d.ts +0 -5
- package/localize/lib/handlers/missing.handler.d.ts +0 -6
- package/localize/lib/interfaces/config.interfaces.d.ts +0 -18
- package/localize/lib/interfaces/functions.interfaces.d.ts +0 -7
- package/localize/lib/interfaces/handlers.interfaces.d.ts +0 -6
- package/localize/lib/interfaces/options.interfaces.d.ts +0 -11
- package/localize/lib/localizations/dutch.localization.d.ts +0 -74
- package/localize/lib/localizations/english.localization.d.ts +0 -74
- package/localize/lib/localizations/papiamento.localization.d.ts +0 -74
- package/localize/lib/localizations/spanish.localization.d.ts +0 -74
- package/localize/lib/localize.config.d.ts +0 -5
- package/localize/lib/localize.module.d.ts +0 -12
- package/localize/lib/localize.pipe.d.ts +0 -12
- package/localize/lib/localize.service.d.ts +0 -43
- package/localize/lib/localize.tokens.d.ts +0 -11
- package/localize/lib/transforms/abstract.transform.d.ts +0 -13
- package/localize/lib/transforms/interpolate.transform.d.ts +0 -13
- package/localize/lib/transforms/plural.transform.d.ts +0 -16
- package/localize/lib/transforms/reference.transform.d.ts +0 -9
- package/localize/lib/views/localize-string/localize-string.component.d.ts +0 -23
- package/localize/lib/views/localize-template.directive.d.ts +0 -9
- package/localize/public_api.d.ts +0 -26
- package/masking/lib/directives/currency-mask.directive.d.ts +0 -17
- package/masking/lib/directives/date-mask.directive.d.ts +0 -17
- package/masking/lib/directives/input-mask.directive.d.ts +0 -38
- package/masking/lib/input-mask.interface.d.ts +0 -19
- package/masking/lib/masking.module.d.ts +0 -9
- package/masking/lib/masking.service.d.ts +0 -12
- package/masking/public_api.d.ts +0 -6
- package/notifications/lib/notifications-item/notifications-item.component.d.ts +0 -33
- package/notifications/lib/notifications-list/notifications-list.component.d.ts +0 -18
- package/notifications/lib/notifications.animations.d.ts +0 -1
- package/notifications/lib/notifications.config.d.ts +0 -3
- package/notifications/lib/notifications.interfaces.d.ts +0 -36
- package/notifications/lib/notifications.module.d.ts +0 -9
- package/notifications/lib/notifications.service.d.ts +0 -30
- package/notifications/public_api.d.ts +0 -4
- package/permissions/lib/directives/permission.directive.d.ts +0 -27
- package/permissions/lib/guards/permission.guard.d.ts +0 -3
- package/permissions/lib/handlers/abstract.handler.d.ts +0 -4
- package/permissions/lib/handlers/local.handler.d.ts +0 -10
- package/permissions/lib/permissions.config.d.ts +0 -3
- package/permissions/lib/permissions.interface.d.ts +0 -13
- package/permissions/lib/permissions.module.d.ts +0 -10
- package/permissions/lib/permissions.service.d.ts +0 -23
- package/permissions/public_api.d.ts +0 -8
- package/public_api.d.ts +0 -27
- package/recaptcha/lib/recaptcha/recaptcha.component.d.ts +0 -47
- package/recaptcha/lib/recaptcha-loader.service.d.ts +0 -19
- package/recaptcha/lib/recaptcha.config.d.ts +0 -3
- package/recaptcha/lib/recaptcha.interface.d.ts +0 -13
- package/recaptcha/lib/recaptcha.module.d.ts +0 -10
- package/recaptcha/public_api.d.ts +0 -5
- package/rxjs/lib/observables/get-control-value.observable.d.ts +0 -3
- package/rxjs/lib/observables/get-route-param.observable.d.ts +0 -3
- package/rxjs/lib/operators/combine-latest-map.operator.d.ts +0 -8
- package/rxjs/lib/operators/filter-nil.operator.d.ts +0 -1
- package/rxjs/public_api.d.ts +0 -4
- package/select/lib/select/select.component.d.ts +0 -94
- package/select/lib/select-label.directive.d.ts +0 -7
- package/select/lib/select-multi-label.directive.d.ts +0 -7
- package/select/lib/select-option-group.directive.d.ts +0 -7
- package/select/lib/select-option.directive.d.ts +0 -7
- package/select/lib/select.config.d.ts +0 -2
- package/select/lib/select.module.d.ts +0 -11
- package/select/public_api.d.ts +0 -7
- package/storage/lib/interfaces/attributes.interface.d.ts +0 -13
- package/storage/lib/interfaces/memory.interface.d.ts +0 -7
- package/storage/lib/interfaces/strategy.interface.d.ts +0 -17
- package/storage/lib/storage.service.d.ts +0 -25
- package/storage/lib/strategies/cookie-storage.strategy.d.ts +0 -20
- package/storage/lib/strategies/memory-storage.strategy.d.ts +0 -11
- package/storage/lib/strategies/polyfill-storage.strategy.d.ts +0 -15
- package/storage/public_api.d.ts +0 -7
- package/table/lib/components/table/table.component.d.ts +0 -57
- package/table/lib/components/table-cell/table-cell.component.d.ts +0 -5
- package/table/lib/components/table-header-cell/table-header-cell.component.d.ts +0 -26
- package/table/lib/components/table-pager/table-pager.component.d.ts +0 -40
- package/table/lib/data/datasource.data.d.ts +0 -14
- package/table/lib/data/generic.data.d.ts +0 -25
- package/table/lib/interfaces/datasource.interface.d.ts +0 -17
- package/table/lib/interfaces/table.interfaces.d.ts +0 -11
- package/table/lib/table.config.d.ts +0 -3
- package/table/lib/table.module.d.ts +0 -10
- package/table/public_api.d.ts +0 -10
- package/tooltip/lib/tooltip-container/tooltip-container.component.d.ts +0 -9
- package/tooltip/lib/tooltip.directive.d.ts +0 -23
- package/tooltip/lib/tooltip.interfaces.d.ts +0 -4
- package/tooltip/lib/tooltip.module.d.ts +0 -7
- package/tooltip/public_api.d.ts +0 -4
- package/utils/lib/directives/autosize.directive.d.ts +0 -19
- package/utils/lib/directives/focus-trap.directive.d.ts +0 -14
- package/utils/lib/directives/focus.directive.d.ts +0 -16
- package/utils/lib/directives/template.directive.d.ts +0 -10
- package/utils/lib/utils.module.d.ts +0 -10
- package/utils/public_api.d.ts +0 -5
|
@@ -105,10 +105,10 @@ class BbInputMask {
|
|
|
105
105
|
}
|
|
106
106
|
// Required so that the template type checker can infer the type of the coerced inputs.
|
|
107
107
|
static ngAcceptInputType_bbInputMask;
|
|
108
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
109
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
108
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: BbInputMask, deps: [{ token: i0.NgZone }, { token: i1.Platform }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
109
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: BbInputMask, isStandalone: true, selector: "input[bbInputMask],input[bbCurrencyMask],input[bbDateMask]", inputs: { mask: ["bbInputMask", "mask"] }, host: { listeners: { "input": "onInput($event.target.value)", "blur": "onTouched($event.target.value)" } }, ngImport: i0 });
|
|
110
110
|
}
|
|
111
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
111
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: BbInputMask, decorators: [{
|
|
112
112
|
type: Directive,
|
|
113
113
|
args: [{
|
|
114
114
|
selector: 'input[bbInputMask],input[bbCurrencyMask],input[bbDateMask]'
|
|
@@ -216,10 +216,10 @@ class Masking {
|
|
|
216
216
|
return ['yyyy', 'MM', 'dd'];
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
220
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
219
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: Masking, deps: [{ token: i1$1.Localize, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
220
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: Masking, providedIn: 'root' });
|
|
221
221
|
}
|
|
222
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
222
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: Masking, decorators: [{
|
|
223
223
|
type: Injectable,
|
|
224
224
|
args: [{
|
|
225
225
|
providedIn: 'root'
|
|
@@ -246,10 +246,10 @@ class BbCurrencyMask {
|
|
|
246
246
|
// Required so that the template type checker can infer the type of the coerced inputs.
|
|
247
247
|
static ngAcceptInputType_bbCurrencyMask;
|
|
248
248
|
static ngAcceptInputType_bbCurrencyMaskOptions;
|
|
249
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
250
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
249
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: BbCurrencyMask, deps: [{ token: Masking }, { token: BbInputMask, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
250
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: BbCurrencyMask, isStandalone: true, selector: "input[bbCurrencyMask]", inputs: { currencyCode: ["bbCurrencyMask", "currencyCode"], options: ["bbCurrencyMaskOptions", "options"] }, usesOnChanges: true, ngImport: i0 });
|
|
251
251
|
}
|
|
252
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
252
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: BbCurrencyMask, decorators: [{
|
|
253
253
|
type: Directive,
|
|
254
254
|
args: [{
|
|
255
255
|
selector: 'input[bbCurrencyMask]'
|
|
@@ -282,10 +282,10 @@ class BbDateMask {
|
|
|
282
282
|
// Required so that the template type checker can infer the type of the coerced inputs.
|
|
283
283
|
static ngAcceptInputType_bbDateMask;
|
|
284
284
|
static ngAcceptInputType_bbDateMaskSeparator;
|
|
285
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
286
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
285
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: BbDateMask, deps: [{ token: Masking }, { token: BbInputMask, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
286
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: BbDateMask, isStandalone: true, selector: "input[bbDateMask]", inputs: { format: ["bbDateMask", "format"], separator: ["bbDateMaskSeparator", "separator"] }, usesOnChanges: true, ngImport: i0 });
|
|
287
287
|
}
|
|
288
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
288
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: BbDateMask, decorators: [{
|
|
289
289
|
type: Directive,
|
|
290
290
|
args: [{
|
|
291
291
|
selector: 'input[bbDateMask]'
|
|
@@ -301,15 +301,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
301
301
|
}] } });
|
|
302
302
|
|
|
303
303
|
class MaskingModule {
|
|
304
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
305
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
304
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: MaskingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
305
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0", ngImport: i0, type: MaskingModule, imports: [BbInputMask,
|
|
306
306
|
BbCurrencyMask,
|
|
307
307
|
BbDateMask], exports: [BbInputMask,
|
|
308
308
|
BbCurrencyMask,
|
|
309
309
|
BbDateMask] });
|
|
310
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
310
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: MaskingModule });
|
|
311
311
|
}
|
|
312
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
312
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: MaskingModule, decorators: [{
|
|
313
313
|
type: NgModule,
|
|
314
314
|
args: [{
|
|
315
315
|
imports: [
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, NgZone, ChangeDetectorRef, HostBinding, ViewChild, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, ApplicationRef, EnvironmentInjector, createEnvironmentInjector, createComponent, Injectable, makeEnvironmentProviders, NgModule } from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, NgZone, ChangeDetectorRef, HostBinding, ViewChild, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, ApplicationRef, EnvironmentInjector, DOCUMENT, createEnvironmentInjector, createComponent, Injectable, makeEnvironmentProviders, NgModule } from '@angular/core';
|
|
3
3
|
import { BbLocalize, Localize } from '@bravobit/bb-foundation/localize';
|
|
4
4
|
import { BbTemplate } from '@bravobit/bb-foundation/utils';
|
|
5
5
|
import { Platform } from '@angular/cdk/platform';
|
|
6
6
|
import { WINDOW } from '@bravobit/bb-foundation';
|
|
7
7
|
import { trigger, transition, query, style, animate } from '@angular/animations';
|
|
8
|
-
import { AsyncPipe
|
|
8
|
+
import { AsyncPipe } from '@angular/common';
|
|
9
9
|
import { map } from 'rxjs/operators';
|
|
10
10
|
import { BehaviorSubject } from 'rxjs';
|
|
11
11
|
|
|
@@ -100,10 +100,10 @@ class BbNotificationsItem {
|
|
|
100
100
|
}
|
|
101
101
|
return this._window.setTimeout(method, timeout);
|
|
102
102
|
}
|
|
103
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
104
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
103
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: BbNotificationsItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
104
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: BbNotificationsItem, isStandalone: true, selector: "bb-notifications-item", inputs: { notification: "notification" }, host: { attributes: { "role": "alert" }, properties: { "class": "this.getClass" } }, viewQueries: [{ propertyName: "progressElementRef", first: true, predicate: ["progress"], descendants: true }], ngImport: i0, template: "<div class=\"notification-content-wrapper\">\n <div [style.color]=\"notification?.color\"\n [style.background-color]=\"notification?.backgroundColor\"\n class=\"notification-icon-wrapper\">\n <svg xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 20\"\n class=\"notification-icon\">\n <path\n d=\"M8 20c1.1 0 2-.923 2-2.051H6C6 19.077 6.9 20 8 20Zm6-6.154V8.718c0-3.18-1.6-5.744-4.5-6.462v-.718C9.5.718 8.8 0 8 0S6.5.718 6.5 1.538v.718C3.6 2.974 2 5.538 2 8.718v5.128l-2 2.051v1.026h16v-1.026l-2-2.05Z\">\n </path>\n </svg>\n\n @if (notification?.timeout > 0) {\n <svg class=\"notification-progress-ring\"\n viewBox=\"0 0 40 40\"\n role=\"progressbar\">\n <circle #progress\n [attr.stroke-dasharray]=\"progressStrokeArray\"\n [attr.stroke-dashoffset]=\"progressStrokeOffset\"\n [style.stroke]=\"notification?.color\"\n class=\"notification-progress-circle\"\n stroke-width=\"2\"\n fill=\"transparent\"\n r=\"19\"\n cx=\"20\"\n cy=\"20\">\n </circle>\n </svg>\n }\n </div>\n\n <div class=\"notification-content\">\n <ng-template [bbTemplate]=\"notification?.content\">\n @if (notification?.localize) {\n {{ $any(notification?.content) | bbLocalize }}\n } @else {\n {{ notification?.content }}\n }\n </ng-template>\n </div>\n</div>\n\n@if (notification?.actions?.length > 0 || notification?.dismiss) {\n <div class=\"notification-actions\">\n @for (action of notification?.actions; track $index) {\n <button [class.destructive]=\"action?.type === 'cancel'\"\n (click)=\"callActionAndDestroy(notification, action)\"\n type=\"button\"\n class=\"notification-actions-button\">\n <span class=\"notification-actions-button-highlight\">\n @if (notification?.localize) {\n {{ action?.title | bbLocalize }}\n } @else {\n {{ action?.title }}\n }\n </span>\n </button>\n }\n @if (notification?.dismiss) {\n <button (click)=\"notification?.destroy()\"\n class=\"notification-actions-button destructive\"\n type=\"button\">\n <span\n class=\"notification-actions-button-highlight\">{{ notification?.dismissText ?? dismissText }}</span>\n </button>\n }\n </div>\n}\n", styles: [".bb-notifications-item{top:0;left:0;width:100%;display:flex;position:absolute;pointer-events:all;border-radius:.5rem;flex-direction:column;background-color:#fff;box-shadow:0 .375rem .375rem -.375rem #00000026;border:1px solid rgb(214.3982142857,218.6677857143,224.1017857143);transition:margin-top .2s cubic-bezier(0,0,.2,1),transform .2s cubic-bezier(0,0,.2,1)}.bb-notifications-item.success .notification-icon-wrapper{color:#2dc05d;background-color:#ebfaf0}.bb-notifications-item.success .notification-progress-circle{stroke:#36d068}.bb-notifications-item.error .notification-icon-wrapper{color:#f43e3e;background-color:#feeeee}.bb-notifications-item.error .notification-progress-circle{stroke:#f55656}.bb-notifications-item.warning .notification-icon-wrapper{color:#f1ae00;background-color:#fff8e7}.bb-notifications-item.warning .notification-progress-circle{stroke:#ffbc0b}.bb-notifications-item.info .notification-icon-wrapper{color:#099bf6;background-color:#e9f6fe}.bb-notifications-item.info .notification-progress-circle{stroke:#22a5f7}.bb-notifications-item.custom .notification-icon-wrapper{color:#657385;background-color:#f3f5f6}.bb-notifications-item.custom .notification-progress-circle{stroke:#657385}.notification-content-wrapper{gap:.75rem;display:flex;padding:.75rem;align-items:center}.notification-icon-wrapper{width:2rem;height:2rem;display:flex;-webkit-user-select:none;user-select:none;position:relative;border-radius:50%;align-items:center;justify-content:center;color:#657385;background-color:#f3f5f6}.notification-icon{width:100%;height:100%;padding:.5rem;fill:currentColor}.notification-content{flex:1;font-weight:400;line-height:1.8;font-size:.875rem;color:#121212}.notification-content,.notification-actions-button{font-family:inherit}.notification-actions{display:flex;margin:0 1.5rem;-webkit-user-select:none;user-select:none;border-top:1px solid rgb(243.3589285714,244.5830714286,246.1410714286)}.notification-actions-button{flex:1;border:none;color:#22a5f7;cursor:pointer;font-weight:500;text-align:center;font-size:.875rem;padding:.75rem .125rem;background-color:transparent}.notification-actions-button:hover>.notification-actions-button-highlight,.notification-actions-button:focus>.notification-actions-button-highlight{background-color:#22a5f71a}.notification-actions-button:active>.notification-actions-button-highlight{background-color:#22a5f733}.notification-actions-button.destructive{color:#f55656}.notification-actions-button.destructive:hover>.notification-actions-button-highlight,.notification-actions-button.destructive:focus>.notification-actions-button-highlight{background-color:#f556561a}.notification-actions-button.destructive:active>.notification-actions-button-highlight{background-color:#f5565633}.notification-actions-button-highlight{display:inline-flex;border-radius:.75rem;padding:.25rem .75rem;transition:background-color .2s cubic-bezier(0,0,.2,1)}.notification-progress-ring{inset:0;width:100%;height:100%;position:absolute}.notification-progress-circle{transform:rotate(-90deg);transform-origin:50% 50%;stroke:#657385}\n"], dependencies: [{ kind: "pipe", type: BbLocalize, name: "bbLocalize" }, { kind: "directive", type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
105
105
|
}
|
|
106
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: BbNotificationsItem, decorators: [{
|
|
107
107
|
type: Component,
|
|
108
108
|
args: [{ selector: 'bb-notifications-item', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { 'role': 'alert' }, imports: [BbLocalize, BbTemplate], template: "<div class=\"notification-content-wrapper\">\n <div [style.color]=\"notification?.color\"\n [style.background-color]=\"notification?.backgroundColor\"\n class=\"notification-icon-wrapper\">\n <svg xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 20\"\n class=\"notification-icon\">\n <path\n d=\"M8 20c1.1 0 2-.923 2-2.051H6C6 19.077 6.9 20 8 20Zm6-6.154V8.718c0-3.18-1.6-5.744-4.5-6.462v-.718C9.5.718 8.8 0 8 0S6.5.718 6.5 1.538v.718C3.6 2.974 2 5.538 2 8.718v5.128l-2 2.051v1.026h16v-1.026l-2-2.05Z\">\n </path>\n </svg>\n\n @if (notification?.timeout > 0) {\n <svg class=\"notification-progress-ring\"\n viewBox=\"0 0 40 40\"\n role=\"progressbar\">\n <circle #progress\n [attr.stroke-dasharray]=\"progressStrokeArray\"\n [attr.stroke-dashoffset]=\"progressStrokeOffset\"\n [style.stroke]=\"notification?.color\"\n class=\"notification-progress-circle\"\n stroke-width=\"2\"\n fill=\"transparent\"\n r=\"19\"\n cx=\"20\"\n cy=\"20\">\n </circle>\n </svg>\n }\n </div>\n\n <div class=\"notification-content\">\n <ng-template [bbTemplate]=\"notification?.content\">\n @if (notification?.localize) {\n {{ $any(notification?.content) | bbLocalize }}\n } @else {\n {{ notification?.content }}\n }\n </ng-template>\n </div>\n</div>\n\n@if (notification?.actions?.length > 0 || notification?.dismiss) {\n <div class=\"notification-actions\">\n @for (action of notification?.actions; track $index) {\n <button [class.destructive]=\"action?.type === 'cancel'\"\n (click)=\"callActionAndDestroy(notification, action)\"\n type=\"button\"\n class=\"notification-actions-button\">\n <span class=\"notification-actions-button-highlight\">\n @if (notification?.localize) {\n {{ action?.title | bbLocalize }}\n } @else {\n {{ action?.title }}\n }\n </span>\n </button>\n }\n @if (notification?.dismiss) {\n <button (click)=\"notification?.destroy()\"\n class=\"notification-actions-button destructive\"\n type=\"button\">\n <span\n class=\"notification-actions-button-highlight\">{{ notification?.dismissText ?? dismissText }}</span>\n </button>\n }\n </div>\n}\n", styles: [".bb-notifications-item{top:0;left:0;width:100%;display:flex;position:absolute;pointer-events:all;border-radius:.5rem;flex-direction:column;background-color:#fff;box-shadow:0 .375rem .375rem -.375rem #00000026;border:1px solid rgb(214.3982142857,218.6677857143,224.1017857143);transition:margin-top .2s cubic-bezier(0,0,.2,1),transform .2s cubic-bezier(0,0,.2,1)}.bb-notifications-item.success .notification-icon-wrapper{color:#2dc05d;background-color:#ebfaf0}.bb-notifications-item.success .notification-progress-circle{stroke:#36d068}.bb-notifications-item.error .notification-icon-wrapper{color:#f43e3e;background-color:#feeeee}.bb-notifications-item.error .notification-progress-circle{stroke:#f55656}.bb-notifications-item.warning .notification-icon-wrapper{color:#f1ae00;background-color:#fff8e7}.bb-notifications-item.warning .notification-progress-circle{stroke:#ffbc0b}.bb-notifications-item.info .notification-icon-wrapper{color:#099bf6;background-color:#e9f6fe}.bb-notifications-item.info .notification-progress-circle{stroke:#22a5f7}.bb-notifications-item.custom .notification-icon-wrapper{color:#657385;background-color:#f3f5f6}.bb-notifications-item.custom .notification-progress-circle{stroke:#657385}.notification-content-wrapper{gap:.75rem;display:flex;padding:.75rem;align-items:center}.notification-icon-wrapper{width:2rem;height:2rem;display:flex;-webkit-user-select:none;user-select:none;position:relative;border-radius:50%;align-items:center;justify-content:center;color:#657385;background-color:#f3f5f6}.notification-icon{width:100%;height:100%;padding:.5rem;fill:currentColor}.notification-content{flex:1;font-weight:400;line-height:1.8;font-size:.875rem;color:#121212}.notification-content,.notification-actions-button{font-family:inherit}.notification-actions{display:flex;margin:0 1.5rem;-webkit-user-select:none;user-select:none;border-top:1px solid rgb(243.3589285714,244.5830714286,246.1410714286)}.notification-actions-button{flex:1;border:none;color:#22a5f7;cursor:pointer;font-weight:500;text-align:center;font-size:.875rem;padding:.75rem .125rem;background-color:transparent}.notification-actions-button:hover>.notification-actions-button-highlight,.notification-actions-button:focus>.notification-actions-button-highlight{background-color:#22a5f71a}.notification-actions-button:active>.notification-actions-button-highlight{background-color:#22a5f733}.notification-actions-button.destructive{color:#f55656}.notification-actions-button.destructive:hover>.notification-actions-button-highlight,.notification-actions-button.destructive:focus>.notification-actions-button-highlight{background-color:#f556561a}.notification-actions-button.destructive:active>.notification-actions-button-highlight{background-color:#f5565633}.notification-actions-button-highlight{display:inline-flex;border-radius:.75rem;padding:.25rem .75rem;transition:background-color .2s cubic-bezier(0,0,.2,1)}.notification-progress-ring{inset:0;width:100%;height:100%;position:absolute}.notification-progress-circle{transform:rotate(-90deg);transform-origin:50% 50%;stroke:#657385}\n"] }]
|
|
109
109
|
}], propDecorators: { notification: [{
|
|
@@ -150,10 +150,10 @@ class BbNotificationsList {
|
|
|
150
150
|
});
|
|
151
151
|
}));
|
|
152
152
|
}
|
|
153
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
154
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
153
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: BbNotificationsList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
154
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: BbNotificationsList, isStandalone: true, selector: "bb-notifications-list", host: { attributes: { "role": "list" }, classAttribute: "bb-notifications-list" }, ngImport: i0, template: "@if (data$ | async; as data) {\n <div [@notificationListAnimation]=\"data?.length\"\n class=\"notifications-list-wrapper\">\n @for (item of data; track item?.notification?.id) {\n <bb-notifications-item [notification]=\"item?.notification\"\n [style.z-index]=\"item?.notification?.id\"\n [style.margin-top.rem]=\"item?.styles?.offset\"\n [style.transform]=\"item?.styles?.scale\">\n </bb-notifications-item>\n }\n </div>\n}\n", styles: [".bb-notifications-list{inset:0;z-index:1100;display:flex;position:fixed;padding:.75rem;pointer-events:none;align-items:flex-start;justify-content:flex-end}.notifications-list-wrapper{width:100%;gap:.75rem;display:flex;max-width:24rem;position:relative;flex-direction:column}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: BbNotificationsItem, selector: "bb-notifications-item", inputs: ["notification"] }], animations: [notificationListAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
155
155
|
}
|
|
156
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
156
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: BbNotificationsList, decorators: [{
|
|
157
157
|
type: Component,
|
|
158
158
|
args: [{ selector: 'bb-notifications-list', animations: [notificationListAnimation], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
159
159
|
'class': 'bb-notifications-list',
|
|
@@ -259,10 +259,10 @@ class Notifications {
|
|
|
259
259
|
// Don't do anything, because it must've failed.
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
263
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
262
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: Notifications, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
263
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: Notifications, providedIn: 'root' });
|
|
264
264
|
}
|
|
265
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
265
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: Notifications, decorators: [{
|
|
266
266
|
type: Injectable,
|
|
267
267
|
args: [{
|
|
268
268
|
providedIn: 'root'
|
|
@@ -284,11 +284,11 @@ class NotificationsModule {
|
|
|
284
284
|
]
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
288
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
289
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
287
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NotificationsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
288
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0", ngImport: i0, type: NotificationsModule });
|
|
289
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NotificationsModule });
|
|
290
290
|
}
|
|
291
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
291
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NotificationsModule, decorators: [{
|
|
292
292
|
type: NgModule
|
|
293
293
|
}] });
|
|
294
294
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bravobit-bb-foundation-notifications.mjs","sources":["../../../projects/bb-foundation/notifications/src/lib/notifications.interfaces.ts","../../../projects/bb-foundation/notifications/src/lib/notifications-item/notifications-item.component.ts","../../../projects/bb-foundation/notifications/src/lib/notifications-item/notifications-item.component.html","../../../projects/bb-foundation/notifications/src/lib/notifications.animations.ts","../../../projects/bb-foundation/notifications/src/lib/notifications-list/notifications-list.component.ts","../../../projects/bb-foundation/notifications/src/lib/notifications-list/notifications-list.component.html","../../../projects/bb-foundation/notifications/src/lib/notifications.service.ts","../../../projects/bb-foundation/notifications/src/lib/notifications.config.ts","../../../projects/bb-foundation/notifications/src/lib/notifications.module.ts","../../../projects/bb-foundation/notifications/src/bravobit-bb-foundation-notifications.ts"],"sourcesContent":["import {InjectionToken, TemplateRef} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nexport interface Notification {\n content: string | TemplateRef<any>;\n type: NotificationType;\n\n id?: number;\n\n timeout?: number;\n localize?: boolean;\n dismiss?: boolean;\n dismissText?: string;\n actions?: NotificationAction[];\n\n color?: string;\n backgroundColor?: string;\n\n destroy?: () => void;\n}\n\nexport interface NotificationAction {\n title: string;\n callback?: () => any;\n type?: 'default' | 'cancel';\n}\n\nexport enum NotificationType {\n Success = 'success',\n Error = 'error',\n Warning = 'warning',\n Info = 'info',\n Custom = 'custom'\n}\n\nexport class NotificationsConfig {\n mode?: 'append' | 'prepend';\n timeout?: number;\n dismiss?: boolean;\n localize?: boolean;\n dismissText?: string;\n}\n\nexport const NOTIFICATIONS_DATA: InjectionToken<Observable<Notification[]>> = new InjectionToken('notifications data');\n\nexport const NOTIFICATIONS_CONFIG: InjectionToken<NotificationsConfig> = new InjectionToken('notifications config');\n","import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, HostBinding, inject, Input, NgZone, OnDestroy, OnInit, ViewChild, ViewEncapsulation} from '@angular/core';\nimport {Notification, NotificationAction, NotificationsConfig} from '../notifications.interfaces';\nimport {BbLocalize} from '@bravobit/bb-foundation/localize';\nimport {BbTemplate} from '@bravobit/bb-foundation/utils';\nimport {Platform} from '@angular/cdk/platform';\nimport {WINDOW} from '@bravobit/bb-foundation';\n\n@Component({\n selector: 'bb-notifications-item',\n templateUrl: './notifications-item.component.html',\n styleUrls: ['./notifications-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {'role': 'alert'},\n imports: [BbLocalize, BbTemplate]\n})\nexport class BbNotificationsItem implements OnInit, OnDestroy {\n\n // Dependencies.\n private readonly _zone: NgZone = inject(NgZone);\n private readonly _platform: Platform = inject(Platform);\n private readonly _changeDetection: ChangeDetectorRef = inject(ChangeDetectorRef);\n\n // Dependencies.\n private readonly _config?: NotificationsConfig = inject(NotificationsConfig, {optional: true});\n private readonly _window?: Window = inject(WINDOW, {optional: true});\n\n // Readonly data.\n readonly dismissText: string = this._config?.dismissText ?? null;\n\n // Inputs.\n @Input() notification: Notification | null = null;\n\n // Elements.\n @ViewChild('progress', {static: false}) progressElementRef: ElementRef<SVGCircleElement>;\n\n // Data.\n private _progress: number = 0;\n private _count: number = 0;\n\n // Helper variables.\n private _steps: number;\n private _speed: number;\n private _timer: number;\n private _startTime: number;\n private _difference: number;\n\n // Data.\n private readonly _radius = 19;\n private readonly _circumference = this._radius * 2 * Math.PI;\n\n @HostBinding('class')\n get getClass() {\n return `bb-notifications-item ${this.notification.type}`;\n }\n\n get progressStrokeArray() {\n const value = Math.floor(this._circumference);\n return `${value}, ${value}`;\n }\n\n get progressStrokeOffset() {\n return Math.floor(this._circumference - this._progress / 100 * this._circumference);\n }\n\n ngOnInit() {\n // Check if the notification timeout is not 0 and the platform is a browser.\n if (this.notification.timeout <= 0 || !this._platform.isBrowser) {\n this.notification.dismiss = true;\n return;\n }\n\n // Start the timeout.\n this.startTimeout();\n }\n\n ngOnDestroy() {\n this._timer && this._window?.clearTimeout?.(this._timer);\n }\n\n callActionAndDestroy(notification: Notification, action: NotificationAction) {\n action?.callback?.();\n notification?.destroy?.();\n }\n\n private startTimeout() {\n this._steps = this.notification.timeout / 10;\n this._speed = this.notification.timeout / this._steps;\n this._startTime = Date.now();\n this._zone.runOutsideAngular(() => this._timer = this.setTimeout(this.instance, this._speed));\n }\n\n private instance = () => {\n this._difference = (Date.now() - this._startTime) - (this._count * this._speed);\n\n if (this._count++ === this._steps) {\n this.notification.destroy();\n }\n\n this._progress += 100 / this._steps;\n this._timer = this.setTimeout(this.instance, this._speed - this._difference);\n this._zone.run(() => this._changeDetection.detectChanges());\n };\n\n private setTimeout(method: () => void, timeout: number) {\n if (!this._window || !this._window.setTimeout) {\n return null;\n }\n\n return this._window.setTimeout(method, timeout);\n }\n\n}\n","<div class=\"notification-content-wrapper\">\n <div [style.color]=\"notification?.color\"\n [style.background-color]=\"notification?.backgroundColor\"\n class=\"notification-icon-wrapper\">\n <svg xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 20\"\n class=\"notification-icon\">\n <path\n d=\"M8 20c1.1 0 2-.923 2-2.051H6C6 19.077 6.9 20 8 20Zm6-6.154V8.718c0-3.18-1.6-5.744-4.5-6.462v-.718C9.5.718 8.8 0 8 0S6.5.718 6.5 1.538v.718C3.6 2.974 2 5.538 2 8.718v5.128l-2 2.051v1.026h16v-1.026l-2-2.05Z\">\n </path>\n </svg>\n\n @if (notification?.timeout > 0) {\n <svg class=\"notification-progress-ring\"\n viewBox=\"0 0 40 40\"\n role=\"progressbar\">\n <circle #progress\n [attr.stroke-dasharray]=\"progressStrokeArray\"\n [attr.stroke-dashoffset]=\"progressStrokeOffset\"\n [style.stroke]=\"notification?.color\"\n class=\"notification-progress-circle\"\n stroke-width=\"2\"\n fill=\"transparent\"\n r=\"19\"\n cx=\"20\"\n cy=\"20\">\n </circle>\n </svg>\n }\n </div>\n\n <div class=\"notification-content\">\n <ng-template [bbTemplate]=\"notification?.content\">\n @if (notification?.localize) {\n {{ $any(notification?.content) | bbLocalize }}\n } @else {\n {{ notification?.content }}\n }\n </ng-template>\n </div>\n</div>\n\n@if (notification?.actions?.length > 0 || notification?.dismiss) {\n <div class=\"notification-actions\">\n @for (action of notification?.actions; track $index) {\n <button [class.destructive]=\"action?.type === 'cancel'\"\n (click)=\"callActionAndDestroy(notification, action)\"\n type=\"button\"\n class=\"notification-actions-button\">\n <span class=\"notification-actions-button-highlight\">\n @if (notification?.localize) {\n {{ action?.title | bbLocalize }}\n } @else {\n {{ action?.title }}\n }\n </span>\n </button>\n }\n @if (notification?.dismiss) {\n <button (click)=\"notification?.destroy()\"\n class=\"notification-actions-button destructive\"\n type=\"button\">\n <span\n class=\"notification-actions-button-highlight\">{{ notification?.dismissText ?? dismissText }}</span>\n </button>\n }\n </div>\n}\n","import {animate, query, style, transition, trigger} from '@angular/animations';\n\nexport const notificationListAnimation = trigger('notificationListAnimation', [\n transition('* => *', [\n query(':enter', [\n style({opacity: 0, transform: 'translateY(-1rem)'}),\n animate('250ms cubic-bezier(0, 0, 0.2, 1)', style({opacity: 1, transform: 'none'}))\n ], {optional: true}),\n\n query(':leave', [\n animate('250ms cubic-bezier(0, 0, .2, 1)', style({opacity: 0}))\n ], {optional: true})\n ])\n]);\n","import {ChangeDetectionStrategy, Component, inject, OnInit, ViewEncapsulation} from '@angular/core';\nimport {BbNotificationsItem} from '../notifications-item/notifications-item.component';\nimport {Notification, NOTIFICATIONS_DATA} from '../notifications.interfaces';\nimport {notificationListAnimation} from '../notifications.animations';\nimport {AsyncPipe} from '@angular/common';\nimport {map} from 'rxjs/operators';\nimport {Observable} from 'rxjs';\n\n@Component({\n selector: 'bb-notifications-list',\n templateUrl: './notifications-list.component.html',\n styleUrls: ['./notifications-list.component.scss'],\n animations: [notificationListAnimation],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'class': 'bb-notifications-list',\n 'role': 'list'\n },\n imports: [AsyncPipe, BbNotificationsItem]\n})\nexport class BbNotificationsList implements OnInit {\n\n // Dependencies.\n private readonly _data$: Observable<Notification[]> = inject(NOTIFICATIONS_DATA);\n\n // Data.\n data$: Observable<{\n notification?: Notification,\n styles?: { offset?: number, scale?: string }\n }[]>;\n\n ngOnInit() {\n this.setData();\n }\n\n private setData() {\n this.data$ = this._data$.pipe(\n map(notifications => {\n return notifications.map((notification, index) => {\n const scale = Math.max(0.9, 1 - (index * 0.02));\n return {\n notification,\n styles: {\n offset: Math.min(index, 5),\n scale: `scale(${scale})`\n }\n };\n });\n })\n );\n }\n\n}\n","@if (data$ | async; as data) {\n <div [@notificationListAnimation]=\"data?.length\"\n class=\"notifications-list-wrapper\">\n @for (item of data; track item?.notification?.id) {\n <bb-notifications-item [notification]=\"item?.notification\"\n [style.z-index]=\"item?.notification?.id\"\n [style.margin-top.rem]=\"item?.styles?.offset\"\n [style.transform]=\"item?.styles?.scale\">\n </bb-notifications-item>\n }\n </div>\n}\n","import {ApplicationRef, ComponentRef, createComponent, createEnvironmentInjector, EnvironmentInjector, inject, Injectable, TemplateRef} from '@angular/core';\nimport {Notification, NotificationAction, NOTIFICATIONS_CONFIG, NOTIFICATIONS_DATA, NotificationsConfig, NotificationType} from './notifications.interfaces';\nimport {BbNotificationsList} from './notifications-list/notifications-list.component';\nimport {Localize} from '@bravobit/bb-foundation/localize';\nimport {Platform} from '@angular/cdk/platform';\nimport {DOCUMENT} from '@angular/common';\nimport {BehaviorSubject} from 'rxjs';\n\nlet nextUniqueId = 0;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Notifications {\n\n // Dependencies.\n private _platform: Platform = inject(Platform);\n private _applicationRef: ApplicationRef = inject(ApplicationRef);\n private _environmentInjector: EnvironmentInjector = inject(EnvironmentInjector);\n private _localize?: Localize = inject(Localize, {optional: true});\n private _config?: NotificationsConfig = inject(NOTIFICATIONS_CONFIG, {optional: true});\n private _document?: Document = inject(DOCUMENT, {optional: true});\n\n // Reference to the list.\n private _componentRef: ComponentRef<BbNotificationsList>;\n\n // The default settings for the notifications.\n private readonly _defaultMode: 'prepend' | 'append' = this._config?.mode ?? 'prepend';\n private readonly _defaultTimeout: number = this._config?.timeout ?? 8_000;\n private readonly _defaultLocalize: boolean = this._config?.localize ?? false;\n private readonly _defaultDismiss: boolean = this._config?.dismiss ?? true;\n private readonly _defaultDismissText: string = this._config?.dismissText ?? 'Dismiss';\n\n // The data containing the notifications.\n private _notifications$ = new BehaviorSubject<Notification[]>([]);\n\n constructor() {\n this.createElement();\n }\n\n success(content: string | TemplateRef<any>, actions: NotificationAction[] = [], timeout = this._defaultTimeout) {\n return this.create({content, timeout, actions, type: NotificationType.Success});\n }\n\n error(content: string | TemplateRef<any>, actions: NotificationAction[] = [], timeout = this._defaultTimeout) {\n return this.create({content, timeout, actions, type: NotificationType.Error});\n }\n\n warn(content: string | TemplateRef<any>, actions: NotificationAction[] = [], timeout = this._defaultTimeout) {\n return this.create({content, timeout, actions, type: NotificationType.Warning});\n }\n\n info(content: string | TemplateRef<any>, actions: NotificationAction[] = [], timeout = this._defaultTimeout) {\n return this.create({content, timeout, actions, type: NotificationType.Info});\n }\n\n create(notification: Notification) {\n const item = this.compose(notification);\n item.destroy = () => this.pull(item);\n return this.push(item);\n }\n\n private push(notification: Notification) {\n // Get the current list.\n const oldList = this._notifications$.getValue();\n\n // Check which mode is activated.\n let newList: Notification[];\n switch (this._defaultMode) {\n case 'append':\n newList = [...oldList, notification];\n break;\n case 'prepend':\n default:\n newList = [notification, ...oldList];\n }\n\n // Push the new notifications.\n this._notifications$.next(newList);\n\n // Return the notification for further use.\n return notification;\n }\n\n private pull(notification: Notification) {\n // Get the current list.\n const newList = this._notifications$\n .getValue()\n .filter(item => item?.id !== notification?.id);\n\n // Push a new list.\n this._notifications$.next(newList);\n }\n\n private compose(notification: Notification) {\n // Attach a random id to the notification.\n notification.id = ++nextUniqueId % 99999;\n\n // Set all properties.\n notification.type = notification?.type ?? NotificationType.Custom;\n notification.content = notification?.content ?? null;\n notification.timeout = notification?.timeout ?? this._defaultTimeout;\n notification.localize = notification?.localize ?? this._defaultLocalize;\n notification.dismiss = notification?.dismiss ?? this._defaultDismiss;\n\n // Dismiss text localization.\n const dismissText = notification.dismissText ?? this._defaultDismissText;\n notification.dismissText = this._defaultLocalize && this._localize\n ? this._localize.translate(dismissText)\n : dismissText;\n\n // Return the composed notification.\n return notification;\n }\n\n private createElement() {\n const environmentInjector = createEnvironmentInjector([\n {provide: NOTIFICATIONS_DATA, useValue: this._notifications$}\n ], this._environmentInjector);\n\n this._componentRef = createComponent(BbNotificationsList, {environmentInjector});\n this._applicationRef.attachView(this._componentRef.hostView);\n\n if (!this._platform.isBrowser) {\n return;\n }\n\n try {\n this._document.body.appendChild(this._componentRef?.location?.nativeElement);\n } catch {\n // Don't do anything, because it must've failed.\n }\n }\n\n}\n","import {NOTIFICATIONS_CONFIG, NotificationsConfig} from './notifications.interfaces';\nimport {EnvironmentProviders, makeEnvironmentProviders} from '@angular/core';\n\nexport function provideNotificationsConfig(config: NotificationsConfig): EnvironmentProviders {\n return makeEnvironmentProviders([\n {provide: NOTIFICATIONS_CONFIG, useValue: config ?? {}}\n ]);\n}\n","import {provideNotificationsConfig} from './notifications.config';\nimport {NotificationsConfig} from './notifications.interfaces';\nimport {ModuleWithProviders, NgModule} from '@angular/core';\n\n@NgModule()\nexport class NotificationsModule {\n\n static forRoot(config?: NotificationsConfig): ModuleWithProviders<NotificationsModule> {\n return {\n ngModule: NotificationsModule,\n providers: [\n provideNotificationsConfig(config)\n ]\n };\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;IA2BY;AAAZ,CAAA,UAAY,gBAAgB,EAAA;AACxB,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,gBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IA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,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cAFV,MAAM,EAAA,CAAA;;2FAET,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE;AACf,iBAAA;;;ACTK,SAAU,0BAA0B,CAAC,MAA2B,EAAA;AAClE,IAAA,OAAO,wBAAwB,CAAC;QAC5B,EAAC,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,IAAI,EAAE;AACzD,KAAA,CAAC;AACN;;MCFa,mBAAmB,CAAA;IAE5B,OAAO,OAAO,CAAC,MAA4B,EAAA;QACvC,OAAO;AACH,YAAA,QAAQ,EAAE,mBAAmB;AAC7B,YAAA,SAAS,EAAE;gBACP,0BAA0B,CAAC,MAAM;AACpC;SACJ;;uGARI,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAnB,mBAAmB,EAAA,CAAA;wGAAnB,mBAAmB,EAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B;;;ACJD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"bravobit-bb-foundation-notifications.mjs","sources":["../../../projects/bb-foundation/notifications/src/lib/notifications.interfaces.ts","../../../projects/bb-foundation/notifications/src/lib/notifications-item/notifications-item.component.ts","../../../projects/bb-foundation/notifications/src/lib/notifications-item/notifications-item.component.html","../../../projects/bb-foundation/notifications/src/lib/notifications.animations.ts","../../../projects/bb-foundation/notifications/src/lib/notifications-list/notifications-list.component.ts","../../../projects/bb-foundation/notifications/src/lib/notifications-list/notifications-list.component.html","../../../projects/bb-foundation/notifications/src/lib/notifications.service.ts","../../../projects/bb-foundation/notifications/src/lib/notifications.config.ts","../../../projects/bb-foundation/notifications/src/lib/notifications.module.ts","../../../projects/bb-foundation/notifications/src/bravobit-bb-foundation-notifications.ts"],"sourcesContent":["import {InjectionToken, TemplateRef} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nexport interface Notification {\n content: string | TemplateRef<any>;\n type: NotificationType;\n\n id?: number;\n\n timeout?: number;\n localize?: boolean;\n dismiss?: boolean;\n dismissText?: string;\n actions?: NotificationAction[];\n\n color?: string;\n backgroundColor?: string;\n\n destroy?: () => void;\n}\n\nexport interface NotificationAction {\n title: string;\n callback?: () => any;\n type?: 'default' | 'cancel';\n}\n\nexport enum NotificationType {\n Success = 'success',\n Error = 'error',\n Warning = 'warning',\n Info = 'info',\n Custom = 'custom'\n}\n\nexport class NotificationsConfig {\n mode?: 'append' | 'prepend';\n timeout?: number;\n dismiss?: boolean;\n localize?: boolean;\n dismissText?: string;\n}\n\nexport const NOTIFICATIONS_DATA: InjectionToken<Observable<Notification[]>> = new InjectionToken('notifications data');\n\nexport const NOTIFICATIONS_CONFIG: InjectionToken<NotificationsConfig> = new InjectionToken('notifications config');\n","import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, HostBinding, inject, Input, NgZone, OnDestroy, OnInit, ViewChild, ViewEncapsulation} from '@angular/core';\nimport {Notification, NotificationAction, NotificationsConfig} from '../notifications.interfaces';\nimport {BbLocalize} from '@bravobit/bb-foundation/localize';\nimport {BbTemplate} from '@bravobit/bb-foundation/utils';\nimport {Platform} from '@angular/cdk/platform';\nimport {WINDOW} from '@bravobit/bb-foundation';\n\n@Component({\n selector: 'bb-notifications-item',\n templateUrl: './notifications-item.component.html',\n styleUrls: ['./notifications-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {'role': 'alert'},\n imports: [BbLocalize, BbTemplate]\n})\nexport class BbNotificationsItem implements OnInit, OnDestroy {\n\n // Dependencies.\n private readonly _zone: NgZone = inject(NgZone);\n private readonly _platform: Platform = inject(Platform);\n private readonly _changeDetection: ChangeDetectorRef = inject(ChangeDetectorRef);\n\n // Dependencies.\n private readonly _config?: NotificationsConfig = inject(NotificationsConfig, {optional: true});\n private readonly _window?: Window = inject(WINDOW, {optional: true});\n\n // Readonly data.\n readonly dismissText: string = this._config?.dismissText ?? null;\n\n // Inputs.\n @Input() notification: Notification | null = null;\n\n // Elements.\n @ViewChild('progress', {static: false}) progressElementRef: ElementRef<SVGCircleElement>;\n\n // Data.\n private _progress: number = 0;\n private _count: number = 0;\n\n // Helper variables.\n private _steps: number;\n private _speed: number;\n private _timer: number;\n private _startTime: number;\n private _difference: number;\n\n // Data.\n private readonly _radius = 19;\n private readonly _circumference = this._radius * 2 * Math.PI;\n\n @HostBinding('class')\n get getClass() {\n return `bb-notifications-item ${this.notification.type}`;\n }\n\n get progressStrokeArray() {\n const value = Math.floor(this._circumference);\n return `${value}, ${value}`;\n }\n\n get progressStrokeOffset() {\n return Math.floor(this._circumference - this._progress / 100 * this._circumference);\n }\n\n ngOnInit() {\n // Check if the notification timeout is not 0 and the platform is a browser.\n if (this.notification.timeout <= 0 || !this._platform.isBrowser) {\n this.notification.dismiss = true;\n return;\n }\n\n // Start the timeout.\n this.startTimeout();\n }\n\n ngOnDestroy() {\n this._timer && this._window?.clearTimeout?.(this._timer);\n }\n\n callActionAndDestroy(notification: Notification, action: NotificationAction) {\n action?.callback?.();\n notification?.destroy?.();\n }\n\n private startTimeout() {\n this._steps = this.notification.timeout / 10;\n this._speed = this.notification.timeout / this._steps;\n this._startTime = Date.now();\n this._zone.runOutsideAngular(() => this._timer = this.setTimeout(this.instance, this._speed));\n }\n\n private instance = () => {\n this._difference = (Date.now() - this._startTime) - (this._count * this._speed);\n\n if (this._count++ === this._steps) {\n this.notification.destroy();\n }\n\n this._progress += 100 / this._steps;\n this._timer = this.setTimeout(this.instance, this._speed - this._difference);\n this._zone.run(() => this._changeDetection.detectChanges());\n };\n\n private setTimeout(method: () => void, timeout: number) {\n if (!this._window || !this._window.setTimeout) {\n return null;\n }\n\n return this._window.setTimeout(method, timeout);\n }\n\n}\n","<div class=\"notification-content-wrapper\">\n <div [style.color]=\"notification?.color\"\n [style.background-color]=\"notification?.backgroundColor\"\n class=\"notification-icon-wrapper\">\n <svg xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 20\"\n class=\"notification-icon\">\n <path\n d=\"M8 20c1.1 0 2-.923 2-2.051H6C6 19.077 6.9 20 8 20Zm6-6.154V8.718c0-3.18-1.6-5.744-4.5-6.462v-.718C9.5.718 8.8 0 8 0S6.5.718 6.5 1.538v.718C3.6 2.974 2 5.538 2 8.718v5.128l-2 2.051v1.026h16v-1.026l-2-2.05Z\">\n </path>\n </svg>\n\n @if (notification?.timeout > 0) {\n <svg class=\"notification-progress-ring\"\n viewBox=\"0 0 40 40\"\n role=\"progressbar\">\n <circle #progress\n [attr.stroke-dasharray]=\"progressStrokeArray\"\n [attr.stroke-dashoffset]=\"progressStrokeOffset\"\n [style.stroke]=\"notification?.color\"\n class=\"notification-progress-circle\"\n stroke-width=\"2\"\n fill=\"transparent\"\n r=\"19\"\n cx=\"20\"\n cy=\"20\">\n </circle>\n </svg>\n }\n </div>\n\n <div class=\"notification-content\">\n <ng-template [bbTemplate]=\"notification?.content\">\n @if (notification?.localize) {\n {{ $any(notification?.content) | bbLocalize }}\n } @else {\n {{ notification?.content }}\n }\n </ng-template>\n </div>\n</div>\n\n@if (notification?.actions?.length > 0 || notification?.dismiss) {\n <div class=\"notification-actions\">\n @for (action of notification?.actions; track $index) {\n <button [class.destructive]=\"action?.type === 'cancel'\"\n (click)=\"callActionAndDestroy(notification, action)\"\n type=\"button\"\n class=\"notification-actions-button\">\n <span class=\"notification-actions-button-highlight\">\n @if (notification?.localize) {\n {{ action?.title | bbLocalize }}\n } @else {\n {{ action?.title }}\n }\n </span>\n </button>\n }\n @if (notification?.dismiss) {\n <button (click)=\"notification?.destroy()\"\n class=\"notification-actions-button destructive\"\n type=\"button\">\n <span\n class=\"notification-actions-button-highlight\">{{ notification?.dismissText ?? dismissText }}</span>\n </button>\n }\n </div>\n}\n","import {animate, query, style, transition, trigger} from '@angular/animations';\n\nexport const notificationListAnimation = trigger('notificationListAnimation', [\n transition('* => *', [\n query(':enter', [\n style({opacity: 0, transform: 'translateY(-1rem)'}),\n animate('250ms cubic-bezier(0, 0, 0.2, 1)', style({opacity: 1, transform: 'none'}))\n ], {optional: true}),\n\n query(':leave', [\n animate('250ms cubic-bezier(0, 0, .2, 1)', style({opacity: 0}))\n ], {optional: true})\n ])\n]);\n","import {ChangeDetectionStrategy, Component, inject, OnInit, ViewEncapsulation} from '@angular/core';\nimport {BbNotificationsItem} from '../notifications-item/notifications-item.component';\nimport {Notification, NOTIFICATIONS_DATA} from '../notifications.interfaces';\nimport {notificationListAnimation} from '../notifications.animations';\nimport {AsyncPipe} from '@angular/common';\nimport {map} from 'rxjs/operators';\nimport {Observable} from 'rxjs';\n\n@Component({\n selector: 'bb-notifications-list',\n templateUrl: './notifications-list.component.html',\n styleUrls: ['./notifications-list.component.scss'],\n animations: [notificationListAnimation],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'class': 'bb-notifications-list',\n 'role': 'list'\n },\n imports: [AsyncPipe, BbNotificationsItem]\n})\nexport class BbNotificationsList implements OnInit {\n\n // Dependencies.\n private readonly _data$: Observable<Notification[]> = inject(NOTIFICATIONS_DATA);\n\n // Data.\n data$: Observable<{\n notification?: Notification,\n styles?: { offset?: number, scale?: string }\n }[]>;\n\n ngOnInit() {\n this.setData();\n }\n\n private setData() {\n this.data$ = this._data$.pipe(\n map(notifications => {\n return notifications.map((notification, index) => {\n const scale = Math.max(0.9, 1 - (index * 0.02));\n return {\n notification,\n styles: {\n offset: Math.min(index, 5),\n scale: `scale(${scale})`\n }\n };\n });\n })\n );\n }\n\n}\n","@if (data$ | async; as data) {\n <div [@notificationListAnimation]=\"data?.length\"\n class=\"notifications-list-wrapper\">\n @for (item of data; track item?.notification?.id) {\n <bb-notifications-item [notification]=\"item?.notification\"\n [style.z-index]=\"item?.notification?.id\"\n [style.margin-top.rem]=\"item?.styles?.offset\"\n [style.transform]=\"item?.styles?.scale\">\n </bb-notifications-item>\n }\n </div>\n}\n","import {ApplicationRef, ComponentRef, createComponent, createEnvironmentInjector, EnvironmentInjector, inject, Injectable, TemplateRef, DOCUMENT} from '@angular/core';\nimport {Notification, NotificationAction, NOTIFICATIONS_CONFIG, NOTIFICATIONS_DATA, NotificationsConfig, NotificationType} from './notifications.interfaces';\nimport {BbNotificationsList} from './notifications-list/notifications-list.component';\nimport {Localize} from '@bravobit/bb-foundation/localize';\nimport {Platform} from '@angular/cdk/platform';\nimport {BehaviorSubject} from 'rxjs';\n\nlet nextUniqueId = 0;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class Notifications {\n\n // Dependencies.\n private _platform: Platform = inject(Platform);\n private _applicationRef: ApplicationRef = inject(ApplicationRef);\n private _environmentInjector: EnvironmentInjector = inject(EnvironmentInjector);\n private _localize?: Localize = inject(Localize, {optional: true});\n private _config?: NotificationsConfig = inject(NOTIFICATIONS_CONFIG, {optional: true});\n private _document?: Document = inject(DOCUMENT, {optional: true});\n\n // Reference to the list.\n private _componentRef: ComponentRef<BbNotificationsList>;\n\n // The default settings for the notifications.\n private readonly _defaultMode: 'prepend' | 'append' = this._config?.mode ?? 'prepend';\n private readonly _defaultTimeout: number = this._config?.timeout ?? 8_000;\n private readonly _defaultLocalize: boolean = this._config?.localize ?? false;\n private readonly _defaultDismiss: boolean = this._config?.dismiss ?? true;\n private readonly _defaultDismissText: string = this._config?.dismissText ?? 'Dismiss';\n\n // The data containing the notifications.\n private _notifications$ = new BehaviorSubject<Notification[]>([]);\n\n constructor() {\n this.createElement();\n }\n\n success(content: string | TemplateRef<any>, actions: NotificationAction[] = [], timeout = this._defaultTimeout) {\n return this.create({content, timeout, actions, type: NotificationType.Success});\n }\n\n error(content: string | TemplateRef<any>, actions: NotificationAction[] = [], timeout = this._defaultTimeout) {\n return this.create({content, timeout, actions, type: NotificationType.Error});\n }\n\n warn(content: string | TemplateRef<any>, actions: NotificationAction[] = [], timeout = this._defaultTimeout) {\n return this.create({content, timeout, actions, type: NotificationType.Warning});\n }\n\n info(content: string | TemplateRef<any>, actions: NotificationAction[] = [], timeout = this._defaultTimeout) {\n return this.create({content, timeout, actions, type: NotificationType.Info});\n }\n\n create(notification: Notification) {\n const item = this.compose(notification);\n item.destroy = () => this.pull(item);\n return this.push(item);\n }\n\n private push(notification: Notification) {\n // Get the current list.\n const oldList = this._notifications$.getValue();\n\n // Check which mode is activated.\n let newList: Notification[];\n switch (this._defaultMode) {\n case 'append':\n newList = [...oldList, notification];\n break;\n case 'prepend':\n default:\n newList = [notification, ...oldList];\n }\n\n // Push the new notifications.\n this._notifications$.next(newList);\n\n // Return the notification for further use.\n return notification;\n }\n\n private pull(notification: Notification) {\n // Get the current list.\n const newList = this._notifications$\n .getValue()\n .filter(item => item?.id !== notification?.id);\n\n // Push a new list.\n this._notifications$.next(newList);\n }\n\n private compose(notification: Notification) {\n // Attach a random id to the notification.\n notification.id = ++nextUniqueId % 99999;\n\n // Set all properties.\n notification.type = notification?.type ?? NotificationType.Custom;\n notification.content = notification?.content ?? null;\n notification.timeout = notification?.timeout ?? this._defaultTimeout;\n notification.localize = notification?.localize ?? this._defaultLocalize;\n notification.dismiss = notification?.dismiss ?? this._defaultDismiss;\n\n // Dismiss text localization.\n const dismissText = notification.dismissText ?? this._defaultDismissText;\n notification.dismissText = this._defaultLocalize && this._localize\n ? this._localize.translate(dismissText)\n : dismissText;\n\n // Return the composed notification.\n return notification;\n }\n\n private createElement() {\n const environmentInjector = createEnvironmentInjector([\n {provide: NOTIFICATIONS_DATA, useValue: this._notifications$}\n ], this._environmentInjector);\n\n this._componentRef = createComponent(BbNotificationsList, {environmentInjector});\n this._applicationRef.attachView(this._componentRef.hostView);\n\n if (!this._platform.isBrowser) {\n return;\n }\n\n try {\n this._document.body.appendChild(this._componentRef?.location?.nativeElement);\n } catch {\n // Don't do anything, because it must've failed.\n }\n }\n\n}\n","import {NOTIFICATIONS_CONFIG, NotificationsConfig} from './notifications.interfaces';\nimport {EnvironmentProviders, makeEnvironmentProviders} from '@angular/core';\n\nexport function provideNotificationsConfig(config: NotificationsConfig): EnvironmentProviders {\n return makeEnvironmentProviders([\n {provide: NOTIFICATIONS_CONFIG, useValue: config ?? {}}\n ]);\n}\n","import {provideNotificationsConfig} from './notifications.config';\nimport {NotificationsConfig} from './notifications.interfaces';\nimport {ModuleWithProviders, NgModule} from '@angular/core';\n\n@NgModule()\nexport class NotificationsModule {\n\n static forRoot(config?: NotificationsConfig): ModuleWithProviders<NotificationsModule> {\n return {\n ngModule: NotificationsModule,\n providers: [\n provideNotificationsConfig(config)\n ]\n };\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;IA2BY;AAAZ,CAAA,UAAY,gBAAgB,EAAA;AACxB,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,gBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,gBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,gBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACrB,CAAC,EANW,gBAAgB,KAAhB,gBAAgB,GAM3B,EAAA,CAAA,CAAA;MAEY,mBAAmB,CAAA;AAC5B,IAAA,IAAI;AACJ,IAAA,OAAO;AACP,IAAA,OAAO;AACP,IAAA,QAAQ;AACR,IAAA,WAAW;AACd;MAEY,kBAAkB,GAA+C,IAAI,cAAc,CAAC,oBAAoB;MAExG,oBAAoB,GAAwC,IAAI,cAAc,CAAC,sBAAsB;;MC7BrG,mBAAmB,CAAA;;AAGX,IAAA,KAAK,GAAW,MAAM,CAAC,MAAM,CAAC;AAC9B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;MCFa,mBAAmB,CAAA;IAE5B,OAAO,OAAO,CAAC,MAA4B,EAAA;QACvC,OAAO;AACH,YAAA,QAAQ,EAAE,mBAAmB;AAC7B,YAAA,SAAS,EAAE;gBACP,0BAA0B,CAAC,MAAM;AACpC;SACJ;;uGARI,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAnB,mBAAmB,EAAA,CAAA;wGAAnB,mBAAmB,EAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B;;;ACJD;;AAEG;;;;"}
|
|
@@ -120,10 +120,10 @@ class Permissions {
|
|
|
120
120
|
});
|
|
121
121
|
this._subscription.add(subscription);
|
|
122
122
|
}
|
|
123
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
124
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
123
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: Permissions, deps: [{ token: PermissionsHandler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
124
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: Permissions, providedIn: 'root' });
|
|
125
125
|
}
|
|
126
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
126
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: Permissions, decorators: [{
|
|
127
127
|
type: Injectable,
|
|
128
128
|
args: [{
|
|
129
129
|
providedIn: 'root'
|
|
@@ -199,10 +199,10 @@ class BbPermission {
|
|
|
199
199
|
static ngAcceptInputType_bbPermission;
|
|
200
200
|
static ngAcceptInputType_bbPermissionElse;
|
|
201
201
|
static ngAcceptInputType_bbPermissionMode;
|
|
202
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
203
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
202
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: BbPermission, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
203
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: BbPermission, isStandalone: true, selector: "ng-template[bbPermission]", inputs: { bbPermission: "bbPermission", bbPermissionElse: "bbPermissionElse", bbPermissionMode: "bbPermissionMode" }, ngImport: i0 });
|
|
204
204
|
}
|
|
205
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: BbPermission, decorators: [{
|
|
206
206
|
type: Directive,
|
|
207
207
|
args: [{
|
|
208
208
|
selector: 'ng-template[bbPermission]'
|
|
@@ -267,11 +267,11 @@ class PermissionsModule {
|
|
|
267
267
|
]
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
271
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
272
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
270
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: PermissionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
271
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0", ngImport: i0, type: PermissionsModule, imports: [BbPermission], exports: [BbPermission] });
|
|
272
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: PermissionsModule });
|
|
273
273
|
}
|
|
274
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
274
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: PermissionsModule, decorators: [{
|
|
275
275
|
type: NgModule,
|
|
276
276
|
args: [{
|
|
277
277
|
imports: [BbPermission],
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, RendererFactory2, LOCALE_ID, Injectable, NgZone, Renderer2, ElementRef, EventEmitter, forwardRef, booleanAttribute, Output, Input, HostBinding, ViewEncapsulation, ChangeDetectionStrategy, Component, makeEnvironmentProviders, NgModule } from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, RendererFactory2, LOCALE_ID, DOCUMENT, Injectable, NgZone, Renderer2, ElementRef, EventEmitter, forwardRef, booleanAttribute, Output, Input, HostBinding, ViewEncapsulation, ChangeDetectionStrategy, Component, makeEnvironmentProviders, NgModule } from '@angular/core';
|
|
3
3
|
import { Localize, LOCALIZE_ID } from '@bravobit/bb-foundation/localize';
|
|
4
4
|
import { Platform } from '@angular/cdk/platform';
|
|
5
|
-
import { DOCUMENT } from '@angular/common';
|
|
6
5
|
import { BehaviorSubject, Subscription } from 'rxjs';
|
|
7
6
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
8
7
|
|
|
@@ -71,10 +70,10 @@ class RecaptchaLoader {
|
|
|
71
70
|
.map(item => `${item?.key}=${item?.value}`)
|
|
72
71
|
.join('&');
|
|
73
72
|
}
|
|
74
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
75
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
73
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RecaptchaLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
74
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RecaptchaLoader, providedIn: 'root' });
|
|
76
75
|
}
|
|
77
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
76
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RecaptchaLoader, decorators: [{
|
|
78
77
|
type: Injectable,
|
|
79
78
|
args: [{
|
|
80
79
|
providedIn: 'root'
|
|
@@ -234,8 +233,8 @@ class RecaptchaComponent {
|
|
|
234
233
|
const newSrc = src.replace(/hl=(.*?)&/, `hl=${locale}&`);
|
|
235
234
|
this._renderer.setAttribute(frame, 'src', newSrc);
|
|
236
235
|
}
|
|
237
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
238
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "
|
|
236
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RecaptchaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
237
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.0.0", type: RecaptchaComponent, isStandalone: true, selector: "bb-recaptcha", inputs: { id: "id", siteKey: "siteKey", tabIndex: "tabIndex", type: "type", size: "size", theme: "theme", badge: "badge", errorMode: "errorMode", grouped: ["grouped", "grouped", booleanAttribute] }, outputs: { resolved: "resolved", error: "error" }, host: { properties: { "class.grouped": "grouped", "attr.id": "this.id" }, classAttribute: "bb-recaptcha" }, providers: [
|
|
239
238
|
{
|
|
240
239
|
provide: NG_VALUE_ACCESSOR,
|
|
241
240
|
useExisting: forwardRef(() => RecaptchaComponent),
|
|
@@ -243,7 +242,7 @@ class RecaptchaComponent {
|
|
|
243
242
|
}
|
|
244
243
|
], exportAs: ["bbRecaptcha"], ngImport: i0, template: "", styles: [".bb-recaptcha{display:block;line-height:normal}.bb-recaptcha.grouped{margin-bottom:1.5rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
245
244
|
}
|
|
246
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RecaptchaComponent, decorators: [{
|
|
247
246
|
type: Component,
|
|
248
247
|
args: [{ selector: 'bb-recaptcha', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'bbRecaptcha', providers: [
|
|
249
248
|
{
|
|
@@ -299,11 +298,11 @@ class RecaptchaModule {
|
|
|
299
298
|
]
|
|
300
299
|
};
|
|
301
300
|
}
|
|
302
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
303
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
304
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
301
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RecaptchaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
302
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0", ngImport: i0, type: RecaptchaModule, imports: [RecaptchaComponent], exports: [RecaptchaComponent] });
|
|
303
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RecaptchaModule });
|
|
305
304
|
}
|
|
306
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
305
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: RecaptchaModule, decorators: [{
|
|
307
306
|
type: NgModule,
|
|
308
307
|
args: [{
|
|
309
308
|
imports: [RecaptchaComponent],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bravobit-bb-foundation-recaptcha.mjs","sources":["../../../projects/bb-foundation/recaptcha/src/lib/recaptcha.interface.ts","../../../projects/bb-foundation/recaptcha/src/lib/recaptcha-loader.service.ts","../../../projects/bb-foundation/recaptcha/src/lib/recaptcha/recaptcha.component.ts","../../../projects/bb-foundation/recaptcha/src/lib/recaptcha/recaptcha.component.html","../../../projects/bb-foundation/recaptcha/src/lib/recaptcha.config.ts","../../../projects/bb-foundation/recaptcha/src/lib/recaptcha.module.ts","../../../projects/bb-foundation/recaptcha/src/bravobit-bb-foundation-recaptcha.ts"],"sourcesContent":["import {InjectionToken} from '@angular/core';\n\nexport const RECAPTCHA_CONFIG = new InjectionToken<RecaptchaConfig>('bb-recaptcha-config');\n\nexport interface RecaptchaConfig {\n baseUrl?: string;\n nonce?: string;\n siteKey?: string;\n theme?: ReCaptchaV2.Theme;\n type?: ReCaptchaV2.Type;\n size?: ReCaptchaV2.Size;\n badge?: ReCaptchaV2.Badge;\n}\n\nexport type NeverUndefined<T> = T extends undefined ? never : T;\nexport type RecaptchaErrorParameters = Parameters<NeverUndefined<ReCaptchaV2.Parameters['error-callback']>>;\n","import {inject, Injectable, LOCALE_ID, RendererFactory2} from '@angular/core';\nimport {Localize} from '@bravobit/bb-foundation/localize';\nimport {RECAPTCHA_CONFIG} from './recaptcha.interface';\nimport {Platform} from '@angular/cdk/platform';\nimport {DOCUMENT} from '@angular/common';\nimport {BehaviorSubject} from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class RecaptchaLoader {\n\n // Dependencies.\n private readonly _platform = inject(Platform);\n private readonly _rendererFactory = inject(RendererFactory2);\n private readonly _config = inject(RECAPTCHA_CONFIG);\n private readonly _localize = inject(Localize, {optional: true});\n private readonly _localeId = inject(LOCALE_ID, {optional: true});\n private readonly _document = inject(DOCUMENT, {optional: true});\n private readonly _renderer = this._rendererFactory.createRenderer(null, null);\n\n // Ready state.\n readonly ready$: BehaviorSubject<ReCaptchaV2.ReCaptcha | null> | null = null;\n\n // Data.\n private readonly _windowLoadFn: string = 'bbRecaptchaLoad';\n\n constructor() {\n // Set the ready subject if not exists.\n if (this.ready$) {\n return;\n }\n this.ready$ = new BehaviorSubject<ReCaptchaV2.ReCaptcha | null>(null);\n\n // Create the script.\n this.createScript(captcha => this.ready$.next(captcha));\n }\n\n private createScript(callback: (grecaptcha: ReCaptchaV2.ReCaptcha) => void) {\n // Validate we are on a browser.\n if (!this._platform.isBrowser) {\n return;\n }\n\n // Create the script.\n const script = this._renderer.createElement('script');\n\n // Set properties on the script.\n this._renderer.setProperty(script, 'src', this.getUrl());\n this._renderer.setProperty(script, 'async', true);\n this._renderer.setProperty(script, 'defer', true);\n\n // Set the nonce.\n if (this._config.nonce) {\n this._renderer.setAttribute(script, 'nonce', this._config.nonce);\n }\n\n // Set the loading function.\n if (this._platform.isBrowser) {\n window[this._windowLoadFn] = () => callback(grecaptcha);\n }\n\n // Append the script tag.\n this._renderer.appendChild(this._document?.body, script);\n }\n\n private getUrl() {\n const baseUrl = this._config?.baseUrl ?? 'https://www.google.com/recaptcha/api.js';\n return [baseUrl, this.getQueryParams()]\n .filter(item => !!item)\n .join('?');\n }\n\n private getQueryParams() {\n const localeId = this._localize?.current?.id ?? this._localeId ?? null;\n const params = {\n render: 'explicit',\n onload: this._windowLoadFn ?? null,\n hl: localeId\n };\n\n return Object.keys(params)\n .map(key => ({key, value: params[key]}))\n .filter(item => !!item.value)\n .map(item => `${item?.key}=${item?.value}`)\n .join('&');\n }\n\n}\n","import {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n inject,\n Input,\n NgZone,\n OnDestroy,\n Output,\n Renderer2,\n ViewEncapsulation\n} from '@angular/core';\nimport {RECAPTCHA_CONFIG, RecaptchaConfig, RecaptchaErrorParameters} from '../recaptcha.interface';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {LOCALIZE_ID} from '@bravobit/bb-foundation/localize';\nimport {RecaptchaLoader} from '../recaptcha-loader.service';\nimport {Platform} from '@angular/cdk/platform';\nimport {Observable, Subscription} from 'rxjs';\n\nlet nextUniqueId = 0;\n\n@Component({\n selector: 'bb-recaptcha',\n templateUrl: './recaptcha.component.html',\n styleUrls: ['./recaptcha.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'bbRecaptcha',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RecaptchaComponent),\n multi: true\n }\n ],\n host: {\n 'class': 'bb-recaptcha',\n '[class.grouped]': 'grouped'\n }\n})\nexport class RecaptchaComponent implements ControlValueAccessor, AfterViewInit, OnDestroy {\n\n // Dependencies.\n private readonly _zone: NgZone = inject(NgZone);\n private readonly _platform: Platform = inject(Platform);\n private readonly _renderer: Renderer2 = inject(Renderer2);\n private readonly _elementRef: ElementRef = inject(ElementRef);\n private readonly _loader: RecaptchaLoader = inject(RecaptchaLoader);\n private readonly _localizeId: Observable<string> = inject(LOCALIZE_ID);\n private readonly _config?: RecaptchaConfig = inject(RECAPTCHA_CONFIG, {optional: true});\n\n // Host bindings.\n @HostBinding('attr.id') @Input() id: string = `bb-recaptcha-${nextUniqueId++}`;\n\n // Inputs.\n @Input() siteKey: string | null = null;\n @Input() tabIndex: number | null = null;\n @Input() type: ReCaptchaV2.Type | null = null;\n @Input() size: ReCaptchaV2.Size | null = null;\n @Input() theme: ReCaptchaV2.Theme | null = null;\n @Input() badge: ReCaptchaV2.Badge | null = null;\n @Input() errorMode: 'handled' | 'default' = 'default';\n @Input({transform: booleanAttribute}) grouped: boolean = false;\n\n // Outputs.\n @Output() resolved = new EventEmitter<string>();\n @Output() error = new EventEmitter<RecaptchaErrorParameters>();\n\n // Data.\n private _widgetId: number | null = null;\n private _grecaptcha: ReCaptchaV2.ReCaptcha | null = null;\n private _executeRequested: boolean = false;\n\n // Form methods.\n private _onChange: (value: string) => void | null = null;\n private _onTouched: () => void | null = null;\n\n // Subscriptions.\n private _subscriptions = new Subscription();\n\n constructor() {\n this.initializeProperties();\n }\n\n ngAfterViewInit() {\n this.handleOnLoad();\n this.handleLocaleChanges();\n }\n\n ngOnDestroy() {\n // Reset the captcha.\n this.resetCaptchaElement();\n\n // Unsubscribe of ready data.\n this._subscriptions?.unsubscribe();\n }\n\n execute() {\n // Check if the captcha is invisible.\n if (this.size !== 'invisible') {\n return;\n }\n\n // Check if the widget exists else return.\n if (this._widgetId == null) {\n this._executeRequested = true;\n return;\n }\n\n // Execute the captcha.\n this._grecaptcha.execute(this._widgetId).then(_ => _);\n }\n\n reset() {\n if (this._widgetId == null) {\n return;\n }\n\n if (this._grecaptcha.getResponse(this._widgetId)) {\n this.resolved.emit(null);\n }\n\n this.resetCaptchaElement();\n }\n\n writeValue(value: string) {\n if (value) {\n return;\n }\n\n this.reset();\n }\n\n registerOnChange(fn: (value: string) => void) {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: () => void) {\n this._onTouched = fn;\n }\n\n onResolve(event: string) {\n // Emit the value.\n this.resolved.emit(event);\n\n // Call the form functions.\n this._onChange?.(event);\n this._onTouched?.();\n }\n\n private renderCaptchaElement() {\n const parameters: ReCaptchaV2.Parameters = {\n badge: this.badge,\n sitekey: this.siteKey,\n size: this.size,\n tabindex: this.tabIndex,\n theme: this.theme,\n type: this.type,\n 'callback': (response: string) => this._zone.run(() => this.onResolve(response)),\n 'expired-callback': () => this._zone.run(() => this.onResolve(null))\n };\n\n if (this.errorMode === 'handled') {\n parameters['error-callback'] = (...args: RecaptchaErrorParameters) => {\n return this._zone.run(() => this.error.emit(args));\n };\n }\n\n this._widgetId = this._grecaptcha.render(this._elementRef.nativeElement, parameters);\n\n if (this._executeRequested) {\n this._executeRequested = false;\n this.execute();\n }\n }\n\n private resetCaptchaElement() {\n if (this._widgetId == null) {\n return;\n }\n\n this._zone.runOutsideAngular(() => this._grecaptcha.reset(this._widgetId));\n }\n\n private initializeProperties() {\n this.siteKey = this.siteKey ?? this._config?.siteKey;\n this.theme = this.theme ?? this._config?.theme;\n this.size = this.size ?? this._config?.size;\n this.type = this.type ?? this._config?.type;\n this.badge = this.badge ?? this._config?.badge;\n }\n\n private handleOnLoad() {\n const subscription = this._loader.ready$.subscribe((grecaptcha: ReCaptchaV2.ReCaptcha) => {\n if (grecaptcha == null || !(grecaptcha.render instanceof Function)) {\n return;\n }\n\n this._grecaptcha = grecaptcha;\n this.renderCaptchaElement();\n });\n\n this._subscriptions.add(subscription);\n }\n\n private handleLocaleChanges() {\n const subscription = this._localizeId.subscribe(locale => this.onLocaleChanged(locale));\n this._subscriptions.add(subscription);\n }\n\n private onLocaleChanged(locale: string) {\n const element = this._elementRef?.nativeElement ?? null;\n if (!element || !this._platform.isBrowser) {\n return;\n }\n\n const frame = element?.querySelector('iframe');\n if (!frame) {\n return;\n }\n\n const src = frame.getAttribute('src');\n const currentLanguageId = src.match(/hl=(.*?)&/).pop();\n if (currentLanguageId === locale) {\n return;\n }\n\n const newSrc = src.replace(/hl=(.*?)&/, `hl=${locale}&`);\n this._renderer.setAttribute(frame, 'src', newSrc);\n }\n\n}\n","","import {EnvironmentProviders, makeEnvironmentProviders} from '@angular/core';\nimport {RECAPTCHA_CONFIG, RecaptchaConfig} from './recaptcha.interface';\n\nexport function provideRecaptchaConfig(config: RecaptchaConfig): EnvironmentProviders {\n return makeEnvironmentProviders([\n {provide: RECAPTCHA_CONFIG, useValue: config}\n ]);\n}\n","import {RecaptchaComponent} from './recaptcha/recaptcha.component';\nimport {ModuleWithProviders, NgModule} from '@angular/core';\nimport {RecaptchaLoader} from './recaptcha-loader.service';\nimport {provideRecaptchaConfig} from './recaptcha.config';\nimport {RecaptchaConfig} from './recaptcha.interface';\n\n@NgModule({\n imports: [RecaptchaComponent],\n exports: [RecaptchaComponent]\n})\nexport class RecaptchaModule {\n\n static forRoot(config?: RecaptchaConfig): ModuleWithProviders<RecaptchaModule> {\n return {\n ngModule: RecaptchaModule,\n providers: [\n provideRecaptchaConfig(config),\n RecaptchaLoader\n ]\n };\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MAEa,gBAAgB,GAAG,IAAI,cAAc,CAAkB,qBAAqB;;MCQ5E,eAAe,CAAA;;AAGP,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC5B,IAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC3C,IAAA,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAClC,SAAS,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;IAC9C,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;IAC/C,SAAS,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;IAC9C,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;;IAGpE,MAAM,GAAyD,IAAI;;IAG3D,aAAa,GAAW,iBAAiB;AAE1D,IAAA,WAAA,GAAA;;AAEI,QAAA,IAAI,IAAI,CAAC,MAAM,EAAE;YACb;;QAEJ,IAAI,CAAC,MAAM,GAAG,IAAI,eAAe,CAA+B,IAAI,CAAC;;AAGrE,QAAA,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;;AAGnD,IAAA,YAAY,CAAC,QAAqD,EAAA;;AAEtE,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;YAC3B;;;QAIJ,MA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D;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"bravobit-bb-foundation-recaptcha.mjs","sources":["../../../projects/bb-foundation/recaptcha/src/lib/recaptcha.interface.ts","../../../projects/bb-foundation/recaptcha/src/lib/recaptcha-loader.service.ts","../../../projects/bb-foundation/recaptcha/src/lib/recaptcha/recaptcha.component.ts","../../../projects/bb-foundation/recaptcha/src/lib/recaptcha/recaptcha.component.html","../../../projects/bb-foundation/recaptcha/src/lib/recaptcha.config.ts","../../../projects/bb-foundation/recaptcha/src/lib/recaptcha.module.ts","../../../projects/bb-foundation/recaptcha/src/bravobit-bb-foundation-recaptcha.ts"],"sourcesContent":["import {InjectionToken} from '@angular/core';\n\nexport const RECAPTCHA_CONFIG = new InjectionToken<RecaptchaConfig>('bb-recaptcha-config');\n\nexport interface RecaptchaConfig {\n baseUrl?: string;\n nonce?: string;\n siteKey?: string;\n theme?: ReCaptchaV2.Theme;\n type?: ReCaptchaV2.Type;\n size?: ReCaptchaV2.Size;\n badge?: ReCaptchaV2.Badge;\n}\n\nexport type NeverUndefined<T> = T extends undefined ? never : T;\nexport type RecaptchaErrorParameters = Parameters<NeverUndefined<ReCaptchaV2.Parameters['error-callback']>>;\n","import {inject, Injectable, LOCALE_ID, RendererFactory2, DOCUMENT} from '@angular/core';\nimport {Localize} from '@bravobit/bb-foundation/localize';\nimport {RECAPTCHA_CONFIG} from './recaptcha.interface';\nimport {Platform} from '@angular/cdk/platform';\nimport {BehaviorSubject} from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class RecaptchaLoader {\n\n // Dependencies.\n private readonly _platform = inject(Platform);\n private readonly _rendererFactory = inject(RendererFactory2);\n private readonly _config = inject(RECAPTCHA_CONFIG);\n private readonly _localize = inject(Localize, {optional: true});\n private readonly _localeId = inject(LOCALE_ID, {optional: true});\n private readonly _document = inject(DOCUMENT, {optional: true});\n private readonly _renderer = this._rendererFactory.createRenderer(null, null);\n\n // Ready state.\n readonly ready$: BehaviorSubject<ReCaptchaV2.ReCaptcha | null> | null = null;\n\n // Data.\n private readonly _windowLoadFn: string = 'bbRecaptchaLoad';\n\n constructor() {\n // Set the ready subject if not exists.\n if (this.ready$) {\n return;\n }\n this.ready$ = new BehaviorSubject<ReCaptchaV2.ReCaptcha | null>(null);\n\n // Create the script.\n this.createScript(captcha => this.ready$.next(captcha));\n }\n\n private createScript(callback: (grecaptcha: ReCaptchaV2.ReCaptcha) => void) {\n // Validate we are on a browser.\n if (!this._platform.isBrowser) {\n return;\n }\n\n // Create the script.\n const script = this._renderer.createElement('script');\n\n // Set properties on the script.\n this._renderer.setProperty(script, 'src', this.getUrl());\n this._renderer.setProperty(script, 'async', true);\n this._renderer.setProperty(script, 'defer', true);\n\n // Set the nonce.\n if (this._config.nonce) {\n this._renderer.setAttribute(script, 'nonce', this._config.nonce);\n }\n\n // Set the loading function.\n if (this._platform.isBrowser) {\n window[this._windowLoadFn] = () => callback(grecaptcha);\n }\n\n // Append the script tag.\n this._renderer.appendChild(this._document?.body, script);\n }\n\n private getUrl() {\n const baseUrl = this._config?.baseUrl ?? 'https://www.google.com/recaptcha/api.js';\n return [baseUrl, this.getQueryParams()]\n .filter(item => !!item)\n .join('?');\n }\n\n private getQueryParams() {\n const localeId = this._localize?.current?.id ?? this._localeId ?? null;\n const params = {\n render: 'explicit',\n onload: this._windowLoadFn ?? null,\n hl: localeId\n };\n\n return Object.keys(params)\n .map(key => ({key, value: params[key]}))\n .filter(item => !!item.value)\n .map(item => `${item?.key}=${item?.value}`)\n .join('&');\n }\n\n}\n","import {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n inject,\n Input,\n NgZone,\n OnDestroy,\n Output,\n Renderer2,\n ViewEncapsulation\n} from '@angular/core';\nimport {RECAPTCHA_CONFIG, RecaptchaConfig, RecaptchaErrorParameters} from '../recaptcha.interface';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {LOCALIZE_ID} from '@bravobit/bb-foundation/localize';\nimport {RecaptchaLoader} from '../recaptcha-loader.service';\nimport {Platform} from '@angular/cdk/platform';\nimport {Observable, Subscription} from 'rxjs';\n\nlet nextUniqueId = 0;\n\n@Component({\n selector: 'bb-recaptcha',\n templateUrl: './recaptcha.component.html',\n styleUrls: ['./recaptcha.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'bbRecaptcha',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RecaptchaComponent),\n multi: true\n }\n ],\n host: {\n 'class': 'bb-recaptcha',\n '[class.grouped]': 'grouped'\n }\n})\nexport class RecaptchaComponent implements ControlValueAccessor, AfterViewInit, OnDestroy {\n\n // Dependencies.\n private readonly _zone: NgZone = inject(NgZone);\n private readonly _platform: Platform = inject(Platform);\n private readonly _renderer: Renderer2 = inject(Renderer2);\n private readonly _elementRef: ElementRef = inject(ElementRef);\n private readonly _loader: RecaptchaLoader = inject(RecaptchaLoader);\n private readonly _localizeId: Observable<string> = inject(LOCALIZE_ID);\n private readonly _config?: RecaptchaConfig = inject(RECAPTCHA_CONFIG, {optional: true});\n\n // Host bindings.\n @HostBinding('attr.id') @Input() id: string = `bb-recaptcha-${nextUniqueId++}`;\n\n // Inputs.\n @Input() siteKey: string | null = null;\n @Input() tabIndex: number | null = null;\n @Input() type: ReCaptchaV2.Type | null = null;\n @Input() size: ReCaptchaV2.Size | null = null;\n @Input() theme: ReCaptchaV2.Theme | null = null;\n @Input() badge: ReCaptchaV2.Badge | null = null;\n @Input() errorMode: 'handled' | 'default' = 'default';\n @Input({transform: booleanAttribute}) grouped: boolean = false;\n\n // Outputs.\n @Output() resolved = new EventEmitter<string>();\n @Output() error = new EventEmitter<RecaptchaErrorParameters>();\n\n // Data.\n private _widgetId: number | null = null;\n private _grecaptcha: ReCaptchaV2.ReCaptcha | null = null;\n private _executeRequested: boolean = false;\n\n // Form methods.\n private _onChange: (value: string) => void | null = null;\n private _onTouched: () => void | null = null;\n\n // Subscriptions.\n private _subscriptions = new Subscription();\n\n constructor() {\n this.initializeProperties();\n }\n\n ngAfterViewInit() {\n this.handleOnLoad();\n this.handleLocaleChanges();\n }\n\n ngOnDestroy() {\n // Reset the captcha.\n this.resetCaptchaElement();\n\n // Unsubscribe of ready data.\n this._subscriptions?.unsubscribe();\n }\n\n execute() {\n // Check if the captcha is invisible.\n if (this.size !== 'invisible') {\n return;\n }\n\n // Check if the widget exists else return.\n if (this._widgetId == null) {\n this._executeRequested = true;\n return;\n }\n\n // Execute the captcha.\n this._grecaptcha.execute(this._widgetId).then(_ => _);\n }\n\n reset() {\n if (this._widgetId == null) {\n return;\n }\n\n if (this._grecaptcha.getResponse(this._widgetId)) {\n this.resolved.emit(null);\n }\n\n this.resetCaptchaElement();\n }\n\n writeValue(value: string) {\n if (value) {\n return;\n }\n\n this.reset();\n }\n\n registerOnChange(fn: (value: string) => void) {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: () => void) {\n this._onTouched = fn;\n }\n\n onResolve(event: string) {\n // Emit the value.\n this.resolved.emit(event);\n\n // Call the form functions.\n this._onChange?.(event);\n this._onTouched?.();\n }\n\n private renderCaptchaElement() {\n const parameters: ReCaptchaV2.Parameters = {\n badge: this.badge,\n sitekey: this.siteKey,\n size: this.size,\n tabindex: this.tabIndex,\n theme: this.theme,\n type: this.type,\n 'callback': (response: string) => this._zone.run(() => this.onResolve(response)),\n 'expired-callback': () => this._zone.run(() => this.onResolve(null))\n };\n\n if (this.errorMode === 'handled') {\n parameters['error-callback'] = (...args: RecaptchaErrorParameters) => {\n return this._zone.run(() => this.error.emit(args));\n };\n }\n\n this._widgetId = this._grecaptcha.render(this._elementRef.nativeElement, parameters);\n\n if (this._executeRequested) {\n this._executeRequested = false;\n this.execute();\n }\n }\n\n private resetCaptchaElement() {\n if (this._widgetId == null) {\n return;\n }\n\n this._zone.runOutsideAngular(() => this._grecaptcha.reset(this._widgetId));\n }\n\n private initializeProperties() {\n this.siteKey = this.siteKey ?? this._config?.siteKey;\n this.theme = this.theme ?? this._config?.theme;\n this.size = this.size ?? this._config?.size;\n this.type = this.type ?? this._config?.type;\n this.badge = this.badge ?? this._config?.badge;\n }\n\n private handleOnLoad() {\n const subscription = this._loader.ready$.subscribe((grecaptcha: ReCaptchaV2.ReCaptcha) => {\n if (grecaptcha == null || !(grecaptcha.render instanceof Function)) {\n return;\n }\n\n this._grecaptcha = grecaptcha;\n this.renderCaptchaElement();\n });\n\n this._subscriptions.add(subscription);\n }\n\n private handleLocaleChanges() {\n const subscription = this._localizeId.subscribe(locale => this.onLocaleChanged(locale));\n this._subscriptions.add(subscription);\n }\n\n private onLocaleChanged(locale: string) {\n const element = this._elementRef?.nativeElement ?? null;\n if (!element || !this._platform.isBrowser) {\n return;\n }\n\n const frame = element?.querySelector('iframe');\n if (!frame) {\n return;\n }\n\n const src = frame.getAttribute('src');\n const currentLanguageId = src.match(/hl=(.*?)&/).pop();\n if (currentLanguageId === locale) {\n return;\n }\n\n const newSrc = src.replace(/hl=(.*?)&/, `hl=${locale}&`);\n this._renderer.setAttribute(frame, 'src', newSrc);\n }\n\n}\n","","import {EnvironmentProviders, makeEnvironmentProviders} from '@angular/core';\nimport {RECAPTCHA_CONFIG, RecaptchaConfig} from './recaptcha.interface';\n\nexport function provideRecaptchaConfig(config: RecaptchaConfig): EnvironmentProviders {\n return makeEnvironmentProviders([\n {provide: RECAPTCHA_CONFIG, useValue: config}\n ]);\n}\n","import {RecaptchaComponent} from './recaptcha/recaptcha.component';\nimport {ModuleWithProviders, NgModule} from '@angular/core';\nimport {RecaptchaLoader} from './recaptcha-loader.service';\nimport {provideRecaptchaConfig} from './recaptcha.config';\nimport {RecaptchaConfig} from './recaptcha.interface';\n\n@NgModule({\n imports: [RecaptchaComponent],\n exports: [RecaptchaComponent]\n})\nexport class RecaptchaModule {\n\n static forRoot(config?: RecaptchaConfig): ModuleWithProviders<RecaptchaModule> {\n return {\n ngModule: RecaptchaModule,\n providers: [\n provideRecaptchaConfig(config),\n RecaptchaLoader\n ]\n };\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MAEa,gBAAgB,GAAG,IAAI,cAAc,CAAkB,qBAAqB;;MCO5E,eAAe,CAAA;;AAGP,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC5B,IAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC3C,IAAA,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAClC,SAAS,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;IAC9C,SAAS,GAAG,MAAM,CAAC,SAAS,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;IAC/C,SAAS,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;IAC9C,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;;IAGpE,MAAM,GAAyD,IAAI;;IAG3D,aAAa,GAAW,iBAAiB;AAE1D,IAAA,WAAA,GAAA;;AAEI,QAAA,IAAI,IAAI,CAAC,MAAM,EAAE;YACb;;QAEJ,IAAI,CAAC,MAAM,GAAG,IAAI,eAAe,CAA+B,IAAI,CAAC;;AAGrE,QAAA,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;;AAGnD,IAAA,YAAY,CAAC,QAAqD,EAAA;;AAEtE,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;YAC3B;;;QAIJ,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC;;AAGrD,QAAA,IAAI,CAAC,SAAS,CAAC,WA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