@bravobit/bb-foundation 0.21.4 → 0.22.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/lib/auth.interceptor.d.ts +1 -1
- package/auth/lib/auth.module.d.ts +4 -5
- package/auth/lib/auth.service.d.ts +4 -7
- package/auth/lib/directives/abstract.directive.d.ts +12 -0
- package/auth/lib/directives/authenticated.directive.d.ts +7 -4
- package/auth/lib/directives/permission.directive.d.ts +11 -11
- package/auth/lib/guards/anonymous.guard.d.ts +8 -5
- package/auth/lib/guards/authenticated.guard.d.ts +8 -5
- package/auth/lib/guards/permission.guard.d.ts +15 -0
- package/auth/lib/interfaces/config.interface.d.ts +14 -8
- package/auth/lib/interfaces/permission.interface.d.ts +6 -0
- package/auth/lib/interfaces/provider.interface.d.ts +10 -3
- package/auth/lib/permissions/permissions.handler.d.ts +9 -0
- package/auth/lib/permissions/permissions.service.d.ts +16 -0
- package/auth/lib/providers/email.provider.d.ts +2 -8
- package/auth/lib/providers/verify.provider.d.ts +2 -6
- package/auth/public_api.d.ts +4 -4
- package/controls/lib/checkbox/checkbox/checkbox.component.d.ts +5 -1
- package/controls/lib/control-error/control-error/control-error.animation.d.ts +1 -0
- package/controls/lib/control-error/control-error/control-error.component.d.ts +17 -0
- package/controls/lib/control-error/control-error-submit.directive.d.ts +15 -0
- package/controls/lib/control-error/control-error.defaults.d.ts +2 -0
- package/controls/lib/control-error/control-error.interface.d.ts +12 -0
- package/controls/lib/control-error/control-error.module.d.ts +9 -0
- package/controls/lib/controls.interfaces.d.ts +4 -0
- package/controls/lib/controls.module.d.ts +7 -2
- package/controls/lib/form-control/form-control/form-control.component.d.ts +31 -0
- package/controls/lib/form-control/form-control-addon/form-control-addon.component.d.ts +6 -0
- package/controls/lib/form-control/form-control-input.directive.d.ts +35 -0
- package/controls/lib/form-control/form-control.module.d.ts +11 -0
- package/controls/public_api.d.ts +9 -0
- package/dashboard/lib/dashboard/dashboard.component.d.ts +2 -1
- package/dialog/lib/dialog-confirm/dialog-confirm.component.d.ts +10 -5
- package/dialog/lib/dialog-container/dialog-container.animations.d.ts +1 -0
- package/dialog/lib/dialog-container/dialog-container.component.d.ts +5 -7
- package/dialog/lib/dialog-header/dialog-header.component.d.ts +1 -3
- package/dialog/lib/dialog-modal/dialog-modal.component.d.ts +7 -3
- package/dialog/lib/dialog-overlay/dialog-overlay.animations.d.ts +1 -0
- package/dialog/lib/dialog-overlay/dialog-overlay.component.d.ts +5 -7
- package/dialog/lib/dialog.service.d.ts +4 -3
- package/elements/lib/directives/focus-trap.directive.d.ts +1 -1
- package/elements/lib/directives/focus.directive.d.ts +1 -3
- package/elements/lib/directives/form-submitter.directive.d.ts +9 -0
- package/elements/lib/elements.module.d.ts +25 -24
- package/elements/lib/form-error/form-error.component.d.ts +9 -5
- package/elements/lib/pipes/file-image.pipe.d.ts +2 -1
- package/elements/public_api.d.ts +1 -0
- package/esm2020/auth/lib/auth.interceptor.mjs +9 -12
- package/esm2020/auth/lib/auth.module.mjs +7 -17
- package/esm2020/auth/lib/auth.service.mjs +29 -55
- package/esm2020/auth/lib/directives/abstract.directive.mjs +40 -0
- package/esm2020/auth/lib/directives/authenticated.directive.mjs +25 -14
- package/esm2020/auth/lib/directives/permission.directive.mjs +24 -46
- package/esm2020/auth/lib/guards/anonymous.guard.mjs +28 -19
- package/esm2020/auth/lib/guards/authenticated.guard.mjs +31 -20
- package/esm2020/auth/lib/guards/permission.guard.mjs +53 -0
- package/esm2020/auth/lib/helpers/jwt.helper.mjs +7 -7
- package/esm2020/auth/lib/interfaces/config.interface.mjs +1 -1
- package/esm2020/auth/lib/interfaces/permission.interface.mjs +2 -0
- package/esm2020/auth/lib/interfaces/provider.interface.mjs +1 -1
- package/esm2020/auth/lib/permissions/permissions.handler.mjs +33 -0
- package/esm2020/auth/lib/permissions/permissions.service.mjs +64 -0
- package/esm2020/auth/lib/providers/email.provider.mjs +8 -9
- package/esm2020/auth/lib/providers/verify.provider.mjs +8 -5
- package/esm2020/auth/public_api.mjs +5 -5
- package/esm2020/collections/lib/collections.module.mjs +4 -4
- package/esm2020/collections/lib/components/collections-pager/collections-pager.component.mjs +3 -3
- package/esm2020/collections/lib/components/collections-viewer/collections-viewer.component.mjs +3 -3
- package/esm2020/collections/lib/components/collections.directive.mjs +12 -12
- package/esm2020/controls/lib/checkbox/checkbox/checkbox.component.mjs +19 -6
- package/esm2020/controls/lib/checkbox/checkbox-group/checkbox-group.component.mjs +4 -4
- package/esm2020/controls/lib/checkbox/checkbox.module.mjs +4 -4
- package/esm2020/controls/lib/control-error/control-error/control-error.animation.mjs +14 -0
- package/esm2020/controls/lib/control-error/control-error/control-error.component.mjs +63 -0
- package/esm2020/controls/lib/control-error/control-error-submit.directive.mjs +47 -0
- package/esm2020/controls/lib/control-error/control-error.defaults.mjs +26 -0
- package/esm2020/controls/lib/control-error/control-error.interface.mjs +3 -0
- package/esm2020/controls/lib/control-error/control-error.module.mjs +19 -0
- package/esm2020/controls/lib/controls.interfaces.mjs +2 -0
- package/esm2020/controls/lib/controls.module.mjs +45 -8
- package/esm2020/controls/lib/form-control/form-control/form-control.component.mjs +94 -0
- package/esm2020/controls/lib/form-control/form-control-addon/form-control-addon.component.mjs +22 -0
- package/esm2020/controls/lib/form-control/form-control-input.directive.mjs +124 -0
- package/esm2020/controls/lib/form-control/form-control.module.mjs +33 -0
- package/esm2020/controls/public_api.mjs +10 -1
- package/esm2020/dashboard/lib/dashboard/dashboard.component.mjs +7 -6
- package/esm2020/dashboard/lib/dashboard-header/dashboard-header.component.mjs +3 -3
- package/esm2020/dashboard/lib/dashboard-menu/dashboard-menu.component.mjs +3 -3
- package/esm2020/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.mjs +3 -3
- package/esm2020/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.mjs +3 -3
- package/esm2020/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.mjs +3 -3
- package/esm2020/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.mjs +3 -3
- package/esm2020/dashboard/lib/dashboard.module.mjs +4 -4
- package/esm2020/dialog/lib/dialog-actions/dialog-actions.component.mjs +3 -3
- package/esm2020/dialog/lib/dialog-confirm/dialog-confirm.component.mjs +17 -11
- package/esm2020/dialog/lib/dialog-container/dialog-container.animations.mjs +29 -0
- package/esm2020/dialog/lib/dialog-container/dialog-container.component.mjs +28 -104
- package/esm2020/dialog/lib/dialog-header/dialog-header.component.mjs +7 -14
- package/esm2020/dialog/lib/dialog-link/dialog-link.component.mjs +4 -4
- package/esm2020/dialog/lib/dialog-modal/dialog-modal.component.mjs +29 -8
- package/esm2020/dialog/lib/dialog-overlay/dialog-overlay.animations.mjs +26 -0
- package/esm2020/dialog/lib/dialog-overlay/dialog-overlay.component.mjs +29 -84
- package/esm2020/dialog/lib/dialog.insertion.mjs +3 -3
- package/esm2020/dialog/lib/dialog.module.mjs +4 -4
- package/esm2020/dialog/lib/dialog.service.mjs +8 -7
- package/esm2020/elements/lib/avatar/avatar.component.mjs +8 -6
- package/esm2020/elements/lib/button/button.component.mjs +6 -6
- package/esm2020/elements/lib/checkbox/checkbox.component.mjs +3 -3
- package/esm2020/elements/lib/date-picker/date-picker.component.mjs +3 -3
- package/esm2020/elements/lib/directives/addon.directive.mjs +6 -6
- package/esm2020/elements/lib/directives/autosize.directive.mjs +3 -3
- package/esm2020/elements/lib/directives/focus-trap.directive.mjs +5 -5
- package/esm2020/elements/lib/directives/focus.directive.mjs +7 -9
- package/esm2020/elements/lib/directives/form-submit.directive.mjs +3 -3
- package/esm2020/elements/lib/directives/form-submitter.directive.mjs +25 -0
- package/esm2020/elements/lib/directives/input.directive.mjs +6 -6
- package/esm2020/elements/lib/directives/template.directive.mjs +3 -3
- package/esm2020/elements/lib/dropdown/dropdown.component.mjs +6 -6
- package/esm2020/elements/lib/elements.module.mjs +9 -5
- package/esm2020/elements/lib/file-picker/file-picker.component.mjs +3 -3
- package/esm2020/elements/lib/form-control/form-control.component.mjs +3 -3
- package/esm2020/elements/lib/form-error/form-error.component.mjs +22 -7
- package/esm2020/elements/lib/form-group/form-group.component.mjs +3 -3
- package/esm2020/elements/lib/icon/icon.component.mjs +3 -3
- package/esm2020/elements/lib/image-picker/image-picker.component.mjs +3 -3
- package/esm2020/elements/lib/pipes/file-image.pipe.mjs +8 -7
- package/esm2020/elements/lib/pipes/file-size.pipe.mjs +3 -3
- package/esm2020/elements/lib/pipes/relative-time.pipe.mjs +3 -3
- package/esm2020/elements/lib/spinner/spinner.component.mjs +3 -3
- package/esm2020/elements/lib/tag/tag.component.mjs +3 -3
- package/esm2020/elements/public_api.mjs +2 -1
- package/esm2020/http/lib/http.module.mjs +4 -4
- package/esm2020/http/lib/interceptors/base-url.interceptor.mjs +3 -3
- package/esm2020/http/lib/interceptors/error.interceptor.mjs +3 -3
- package/esm2020/lib/core/services/clipboard.service.mjs +5 -5
- package/esm2020/lib/core/services/exif.service.mjs +5 -5
- package/esm2020/lib/core/services/file-loader.service.mjs +3 -3
- package/esm2020/lib/core/services/image-converter.service.mjs +5 -5
- package/esm2020/lib/core/services/languages.service.mjs +3 -3
- package/esm2020/lib/core/services/network.service.mjs +7 -7
- package/esm2020/lib/core/services/patch.service.mjs +7 -7
- package/esm2020/localize/lib/localize.module.mjs +4 -4
- package/esm2020/localize/lib/localize.pipe.mjs +3 -3
- package/esm2020/localize/lib/localize.service.mjs +5 -5
- package/esm2020/localize/lib/views/localize-string/localize-string.component.mjs +3 -3
- package/esm2020/localize/lib/views/localize-template-or-string.directive.mjs +3 -3
- package/esm2020/localize/lib/views/localize-template.directive.mjs +3 -3
- package/esm2020/masking/lib/directives/currency-mask.directive.mjs +3 -3
- package/esm2020/masking/lib/directives/date-mask.directive.mjs +3 -3
- package/esm2020/masking/lib/directives/input-mask.directive.mjs +7 -7
- package/esm2020/masking/lib/masking.module.mjs +4 -4
- package/esm2020/masking/lib/masking.service.mjs +3 -3
- package/esm2020/notifications/lib/notifications-item/notifications-item.component.mjs +5 -5
- package/esm2020/notifications/lib/notifications-list/notifications-list.component.mjs +7 -7
- package/esm2020/notifications/lib/notifications.module.mjs +4 -4
- package/esm2020/notifications/lib/notifications.service.mjs +5 -5
- package/esm2020/public_api.mjs +1 -2
- package/esm2020/recaptcha/lib/recaptcha/recaptcha.component.mjs +3 -3
- package/esm2020/recaptcha/lib/recaptcha-loader.service.mjs +10 -10
- package/esm2020/recaptcha/lib/recaptcha.module.mjs +4 -4
- package/esm2020/storage/lib/storage.service.mjs +5 -5
- package/esm2020/table/lib/components/table/table.component.mjs +9 -9
- package/esm2020/table/lib/components/table-cell/table-cell.component.mjs +3 -3
- package/esm2020/table/lib/components/table-header-cell/table-header-cell.component.mjs +3 -3
- package/esm2020/table/lib/components/table-pager/table-pager.component.mjs +3 -3
- package/esm2020/table/lib/table.module.mjs +4 -4
- package/esm2020/theming/lib/themes/checkbox-group.theme.mjs +17 -2
- package/esm2020/theming/lib/themes/checkbox.theme.mjs +35 -2
- package/esm2020/theming/lib/themes/control-error.theme.mjs +11 -0
- package/esm2020/theming/lib/themes/form-control-addon.theme.mjs +6 -0
- package/esm2020/theming/lib/themes/form-control.theme.mjs +45 -0
- package/esm2020/theming/lib/theming.data.mjs +82 -0
- package/esm2020/theming/lib/theming.directive.mjs +38 -0
- package/esm2020/theming/lib/theming.interface.mjs +2 -3
- package/esm2020/theming/lib/theming.module.mjs +12 -34
- package/esm2020/theming/lib/utils/theming.variable.mjs +41 -0
- package/esm2020/theming/public_api.mjs +6 -3
- package/fesm2015/bravobit-bb-foundation-auth.mjs +326 -284
- package/fesm2015/bravobit-bb-foundation-auth.mjs.map +1 -1
- package/fesm2015/bravobit-bb-foundation-collections.mjs +22 -22
- package/fesm2015/bravobit-bb-foundation-controls.mjs +493 -24
- package/fesm2015/bravobit-bb-foundation-controls.mjs.map +1 -1
- package/fesm2015/bravobit-bb-foundation-dashboard.mjs +29 -28
- package/fesm2015/bravobit-bb-foundation-dashboard.mjs.map +1 -1
- package/fesm2015/bravobit-bb-foundation-dialog.mjs +185 -233
- package/fesm2015/bravobit-bb-foundation-dialog.mjs.map +1 -1
- package/fesm2015/bravobit-bb-foundation-elements.mjs +140 -99
- package/fesm2015/bravobit-bb-foundation-elements.mjs.map +1 -1
- package/fesm2015/bravobit-bb-foundation-http.mjs +10 -10
- package/fesm2015/bravobit-bb-foundation-localize.mjs +20 -20
- package/fesm2015/bravobit-bb-foundation-localize.mjs.map +1 -1
- package/fesm2015/bravobit-bb-foundation-masking.mjs +20 -19
- package/fesm2015/bravobit-bb-foundation-masking.mjs.map +1 -1
- package/fesm2015/bravobit-bb-foundation-notifications.mjs +18 -17
- package/fesm2015/bravobit-bb-foundation-notifications.mjs.map +1 -1
- package/fesm2015/bravobit-bb-foundation-recaptcha.mjs +16 -16
- package/fesm2015/bravobit-bb-foundation-recaptcha.mjs.map +1 -1
- package/fesm2015/bravobit-bb-foundation-storage.mjs +4 -4
- package/fesm2015/bravobit-bb-foundation-storage.mjs.map +1 -1
- package/fesm2015/bravobit-bb-foundation-table.mjs +22 -22
- package/fesm2015/bravobit-bb-foundation-theming.mjs +251 -128
- package/fesm2015/bravobit-bb-foundation-theming.mjs.map +1 -1
- package/fesm2015/bravobit-bb-foundation.mjs +33 -73
- package/fesm2015/bravobit-bb-foundation.mjs.map +1 -1
- package/fesm2020/bravobit-bb-foundation-auth.mjs +306 -277
- package/fesm2020/bravobit-bb-foundation-auth.mjs.map +1 -1
- package/fesm2020/bravobit-bb-foundation-collections.mjs +22 -22
- package/fesm2020/bravobit-bb-foundation-controls.mjs +477 -24
- package/fesm2020/bravobit-bb-foundation-controls.mjs.map +1 -1
- package/fesm2020/bravobit-bb-foundation-dashboard.mjs +29 -28
- package/fesm2020/bravobit-bb-foundation-dashboard.mjs.map +1 -1
- package/fesm2020/bravobit-bb-foundation-dialog.mjs +175 -233
- package/fesm2020/bravobit-bb-foundation-dialog.mjs.map +1 -1
- package/fesm2020/bravobit-bb-foundation-elements.mjs +140 -99
- package/fesm2020/bravobit-bb-foundation-elements.mjs.map +1 -1
- package/fesm2020/bravobit-bb-foundation-http.mjs +10 -10
- package/fesm2020/bravobit-bb-foundation-localize.mjs +20 -20
- package/fesm2020/bravobit-bb-foundation-localize.mjs.map +1 -1
- package/fesm2020/bravobit-bb-foundation-masking.mjs +19 -19
- package/fesm2020/bravobit-bb-foundation-masking.mjs.map +1 -1
- package/fesm2020/bravobit-bb-foundation-notifications.mjs +17 -17
- package/fesm2020/bravobit-bb-foundation-notifications.mjs.map +1 -1
- package/fesm2020/bravobit-bb-foundation-recaptcha.mjs +16 -16
- package/fesm2020/bravobit-bb-foundation-recaptcha.mjs.map +1 -1
- package/fesm2020/bravobit-bb-foundation-storage.mjs +4 -4
- package/fesm2020/bravobit-bb-foundation-storage.mjs.map +1 -1
- package/fesm2020/bravobit-bb-foundation-table.mjs +22 -22
- package/fesm2020/bravobit-bb-foundation-theming.mjs +252 -120
- package/fesm2020/bravobit-bb-foundation-theming.mjs.map +1 -1
- package/fesm2020/bravobit-bb-foundation.mjs +32 -70
- package/fesm2020/bravobit-bb-foundation.mjs.map +1 -1
- package/lib/core/services/clipboard.service.d.ts +2 -2
- package/lib/core/services/exif.service.d.ts +1 -1
- package/lib/core/services/image-converter.service.d.ts +1 -1
- package/lib/core/services/network.service.d.ts +4 -4
- package/lib/core/services/patch.service.d.ts +4 -4
- package/localize/lib/localize.service.d.ts +1 -1
- package/notifications/lib/notifications-item/notifications-item.component.d.ts +1 -1
- package/notifications/lib/notifications.service.d.ts +1 -1
- package/package.json +4 -4
- package/public_api.d.ts +0 -1
- package/recaptcha/lib/recaptcha-loader.service.d.ts +3 -3
- package/storage/lib/storage.service.d.ts +1 -1
- package/theming/lib/themes/checkbox-group.theme.d.ts +14 -3
- package/theming/lib/themes/checkbox.theme.d.ts +30 -17
- package/theming/lib/themes/control-error.theme.d.ts +9 -0
- package/theming/lib/themes/form-control-addon.theme.d.ts +5 -0
- package/theming/lib/themes/form-control.theme.d.ts +32 -0
- package/theming/lib/theming.data.d.ts +17 -0
- package/theming/lib/theming.directive.d.ts +13 -0
- package/theming/lib/theming.interface.d.ts +19 -8
- package/theming/lib/theming.module.d.ts +3 -9
- package/theming/lib/utils/theming.variable.d.ts +16 -0
- package/theming/public_api.d.ts +5 -2
- package/auth/lib/directives/role.directive.d.ts +0 -16
- package/auth/lib/helpers/mapper.helper.d.ts +0 -23
- package/auth/lib/interfaces/mapper.interface.d.ts +0 -19
- package/auth/lib/permissions.service.d.ts +0 -14
- package/esm2020/auth/lib/directives/role.directive.mjs +0 -37
- package/esm2020/auth/lib/helpers/mapper.helper.mjs +0 -35
- package/esm2020/auth/lib/interfaces/mapper.interface.mjs +0 -2
- package/esm2020/auth/lib/permissions.service.mjs +0 -56
- package/esm2020/lib/core/services/platform.service.mjs +0 -42
- package/esm2020/theming/lib/themes/theme.mjs +0 -34
- package/esm2020/theming/lib/theming.service.mjs +0 -77
- package/lib/core/services/platform.service.d.ts +0 -18
- package/theming/lib/themes/theme.d.ts +0 -12
- package/theming/lib/theming.service.d.ts +0 -22
|
@@ -1,154 +1,286 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import { DOCUMENT } from '@angular/common';
|
|
2
|
+
import { RendererStyleFlags2, Directive, Input, NgModule } from '@angular/core';
|
|
4
3
|
|
|
5
|
-
class
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
this.
|
|
11
|
-
this._rendererFactory = _rendererFactory;
|
|
12
|
-
this._document = _document;
|
|
13
|
-
// Readonly data.
|
|
14
|
-
this._attribute = 'data-theme';
|
|
15
|
-
this._renderer = this._rendererFactory.createRenderer(null, null);
|
|
16
|
-
// State.
|
|
17
|
-
this._currentTheme = null;
|
|
18
|
-
this.setCssVariables();
|
|
19
|
-
this.setFirstTheme();
|
|
20
|
-
}
|
|
21
|
-
get all() {
|
|
22
|
-
return this._options?.themes ?? [];
|
|
4
|
+
class BbiTheming {
|
|
5
|
+
constructor(_renderer, _elementRef) {
|
|
6
|
+
this._renderer = _renderer;
|
|
7
|
+
this._elementRef = _elementRef;
|
|
8
|
+
// Cache.
|
|
9
|
+
this._theme = null;
|
|
23
10
|
}
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
// Inputs.
|
|
12
|
+
set theme(theme) {
|
|
13
|
+
this._theme = theme;
|
|
14
|
+
this.setTheme();
|
|
26
15
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (!theme) {
|
|
30
|
-
throw new Error('Invalid theme.');
|
|
31
|
-
}
|
|
32
|
-
const document = this._document.documentElement;
|
|
33
|
-
if (!document) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
this._renderer.setAttribute(document, this._attribute, name);
|
|
37
|
-
this._currentTheme = theme;
|
|
38
|
-
}
|
|
39
|
-
setCssVariables() {
|
|
40
|
-
const style = this._renderer.createElement('style');
|
|
41
|
-
this._renderer.setAttribute(style, 'id', 'theming-style');
|
|
42
|
-
const variables = this.getCssVariables();
|
|
43
|
-
this._renderer.setProperty(style, 'innerHTML', variables);
|
|
44
|
-
const head = this._document?.head ?? null;
|
|
45
|
-
if (!head) {
|
|
16
|
+
setTheme() {
|
|
17
|
+
if (!this._theme) {
|
|
46
18
|
return;
|
|
47
19
|
}
|
|
48
|
-
this.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
.
|
|
53
|
-
.join('\n');
|
|
54
|
-
}
|
|
55
|
-
getThemeContents(theme) {
|
|
56
|
-
const themeData = theme?.data ?? {};
|
|
57
|
-
return Object.keys(themeData)
|
|
58
|
-
.map(key => `${key}: ${themeData?.[key]};`)
|
|
59
|
-
.join(' ');
|
|
60
|
-
}
|
|
61
|
-
setFirstTheme() {
|
|
62
|
-
const theme = this.all?.[0] ?? null;
|
|
63
|
-
if (!theme) {
|
|
64
|
-
throw new Error('No theme found.');
|
|
20
|
+
const variables = this._theme.variables();
|
|
21
|
+
const element = this._elementRef.nativeElement;
|
|
22
|
+
for (const key in variables) {
|
|
23
|
+
const value = variables?.[key];
|
|
24
|
+
this._renderer.setStyle(element, key, value, RendererStyleFlags2.DashCase);
|
|
65
25
|
}
|
|
66
|
-
const themeName = theme?.name ?? null;
|
|
67
|
-
return this.set(themeName);
|
|
68
26
|
}
|
|
69
27
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
73
|
-
type:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
28
|
+
BbiTheming.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbiTheming, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
29
|
+
BbiTheming.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.1", type: BbiTheming, selector: "[bbiTheming]", inputs: { theme: ["bbiTheming", "theme"] }, ngImport: i0 });
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: BbiTheming, decorators: [{
|
|
31
|
+
type: Directive,
|
|
32
|
+
args: [{
|
|
33
|
+
selector: '[bbiTheming]'
|
|
34
|
+
}]
|
|
35
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { theme: [{
|
|
36
|
+
type: Input,
|
|
37
|
+
args: ['bbiTheming']
|
|
38
|
+
}] } });
|
|
80
39
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
40
|
+
function formControlAddonThemeFactory() {
|
|
41
|
+
return {
|
|
42
|
+
spacing: '10px'
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function checkboxGroupThemeFactory() {
|
|
47
|
+
return {
|
|
48
|
+
grouping: '20px',
|
|
49
|
+
label: {
|
|
50
|
+
color: '#525252',
|
|
51
|
+
offset: '4px',
|
|
52
|
+
fontSize: '14px',
|
|
53
|
+
fontWeight: '400',
|
|
54
|
+
lineHeight: '1.33'
|
|
55
|
+
},
|
|
56
|
+
spacing: {
|
|
57
|
+
horizontal: '10px',
|
|
58
|
+
vertical: '4px'
|
|
86
59
|
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
class ThemeVariableFunction {
|
|
64
|
+
constructor(_key) {
|
|
65
|
+
this._key = _key;
|
|
87
66
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
{ provide: ThemingOptions, useValue: options }
|
|
95
|
-
]
|
|
96
|
-
};
|
|
67
|
+
toString(variables) {
|
|
68
|
+
const value = variables?.[this._key] ?? null;
|
|
69
|
+
if (!value) {
|
|
70
|
+
throw new Error(`Invalid variable key "${this._key}"`);
|
|
71
|
+
}
|
|
72
|
+
return !!value ? this.format(value) : null;
|
|
97
73
|
}
|
|
98
74
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
75
|
+
class ThemeColorVariable extends ThemeVariableFunction {
|
|
76
|
+
constructor(key) {
|
|
77
|
+
super(key);
|
|
78
|
+
// State.
|
|
79
|
+
this._opacity = 1;
|
|
80
|
+
}
|
|
81
|
+
format(value) {
|
|
82
|
+
const rgb = this.hexToRgb(value);
|
|
83
|
+
return this.toRgba(rgb);
|
|
84
|
+
}
|
|
85
|
+
opacity(value) {
|
|
86
|
+
this._opacity = value;
|
|
87
|
+
return this;
|
|
88
|
+
}
|
|
89
|
+
toRgba(data) {
|
|
90
|
+
return `rgba(${data?.red},${data?.green},${data?.blue},${this._opacity})`;
|
|
91
|
+
}
|
|
92
|
+
hexToRgb(value) {
|
|
93
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(value);
|
|
94
|
+
if (!result) {
|
|
95
|
+
throw new Error(`Invalid color format for "${value}". Only hex is currently supported.`);
|
|
96
|
+
}
|
|
97
|
+
const red = parseInt(result?.[1], 16);
|
|
98
|
+
const green = parseInt(result?.[2], 16);
|
|
99
|
+
const blue = parseInt(result?.[3], 16);
|
|
100
|
+
return { red, green, blue };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function controlErrorThemeFactory() {
|
|
105
|
+
return {
|
|
106
|
+
color: new ThemeColorVariable('errorColor'),
|
|
107
|
+
fontSize: '13px',
|
|
108
|
+
lineHeight: '1.5',
|
|
109
|
+
fontWeight: '400',
|
|
110
|
+
spacing: '4px'
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function formControlThemeFactory() {
|
|
115
|
+
const errorColorKey = 'errorColor';
|
|
116
|
+
const inputColor = '#111111';
|
|
117
|
+
const backgroundColor = '#ffffff';
|
|
118
|
+
return {
|
|
119
|
+
grouping: '20px',
|
|
120
|
+
color: inputColor,
|
|
121
|
+
background: backgroundColor,
|
|
122
|
+
error: {
|
|
123
|
+
color: new ThemeColorVariable(errorColorKey),
|
|
124
|
+
background: new ThemeColorVariable(errorColorKey).opacity(0.1),
|
|
125
|
+
placeholderColor: new ThemeColorVariable(errorColorKey).opacity(0.4)
|
|
126
|
+
},
|
|
127
|
+
border: {
|
|
128
|
+
radius: '6px',
|
|
129
|
+
width: '1px',
|
|
130
|
+
style: 'solid',
|
|
131
|
+
color: 'rgba(67, 90, 111, 0.3)'
|
|
132
|
+
},
|
|
133
|
+
focused: {
|
|
134
|
+
color: inputColor,
|
|
135
|
+
background: backgroundColor,
|
|
136
|
+
border: {
|
|
137
|
+
radius: '6px',
|
|
138
|
+
width: '1px',
|
|
139
|
+
style: 'solid',
|
|
140
|
+
color: '#212121'
|
|
141
|
+
},
|
|
142
|
+
shadow: '0 0 0 3px rgba(0, 123, 255, 0.2)'
|
|
143
|
+
},
|
|
144
|
+
disabled: {
|
|
145
|
+
color: inputColor,
|
|
146
|
+
background: backgroundColor,
|
|
147
|
+
border: {
|
|
148
|
+
radius: '6px',
|
|
149
|
+
width: '1px',
|
|
150
|
+
style: 'solid',
|
|
151
|
+
color: '#212121'
|
|
152
|
+
},
|
|
153
|
+
opacity: '0.25'
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function checkboxThemeFactory() {
|
|
159
|
+
const accentColor = new ThemeColorVariable('accentColor');
|
|
160
|
+
return {
|
|
161
|
+
size: '20px',
|
|
162
|
+
grouping: '20px',
|
|
163
|
+
colors: {
|
|
164
|
+
accent: accentColor,
|
|
165
|
+
disabled: '#c6c6c6'
|
|
166
|
+
},
|
|
167
|
+
border: {
|
|
168
|
+
color: '#111111',
|
|
169
|
+
thickness: '1px',
|
|
170
|
+
radius: '4px'
|
|
171
|
+
},
|
|
172
|
+
outline: {
|
|
173
|
+
color: accentColor,
|
|
174
|
+
offset: '1px',
|
|
175
|
+
thickness: '2px'
|
|
176
|
+
},
|
|
177
|
+
check: {
|
|
178
|
+
size: '12px',
|
|
179
|
+
color: 'white',
|
|
180
|
+
thickness: '2px'
|
|
181
|
+
},
|
|
182
|
+
label: {
|
|
183
|
+
color: '#111111',
|
|
184
|
+
offset: '6px',
|
|
185
|
+
fontSize: '16px',
|
|
186
|
+
fontWeight: '400',
|
|
187
|
+
lineHeight: '1.28'
|
|
188
|
+
}
|
|
189
|
+
};
|
|
113
190
|
}
|
|
114
191
|
|
|
115
192
|
class Theme {
|
|
116
|
-
constructor(
|
|
117
|
-
this.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
193
|
+
constructor(theme) {
|
|
194
|
+
this.isObject = (item) => {
|
|
195
|
+
return (item && typeof item === 'object' && !Array.isArray(item));
|
|
196
|
+
};
|
|
197
|
+
const defaultFactories = this.defaultFactories();
|
|
198
|
+
this.data = this.mergeThemeData(defaultFactories, theme);
|
|
199
|
+
this.globals = this.getGlobals();
|
|
123
200
|
}
|
|
124
|
-
|
|
125
|
-
return this.
|
|
201
|
+
variables() {
|
|
202
|
+
return this.getContents(this.data);
|
|
126
203
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
204
|
+
defaultFactories() {
|
|
205
|
+
return {
|
|
206
|
+
accentColor: '#1565c0',
|
|
207
|
+
errorColor: '#bd322a',
|
|
208
|
+
formControl: formControlThemeFactory(),
|
|
209
|
+
formControlAddon: formControlAddonThemeFactory(),
|
|
210
|
+
checkbox: checkboxThemeFactory(),
|
|
211
|
+
checkboxGroup: checkboxGroupThemeFactory(),
|
|
212
|
+
controlError: controlErrorThemeFactory()
|
|
213
|
+
};
|
|
130
214
|
}
|
|
131
|
-
|
|
215
|
+
getContents(data, scope = null) {
|
|
132
216
|
return Object.keys(data).reduce((previous, current) => {
|
|
133
217
|
const value = data?.[current];
|
|
134
|
-
const token = this.
|
|
135
|
-
if (typeof value === 'object' && value !== null) {
|
|
136
|
-
const formatted = this.
|
|
218
|
+
const token = this.getToken(current, scope);
|
|
219
|
+
if (typeof value === 'object' && value !== null && !(value instanceof ThemeVariableFunction)) {
|
|
220
|
+
const formatted = this.getContents(value, token);
|
|
137
221
|
return { ...previous, ...formatted };
|
|
138
222
|
}
|
|
139
|
-
|
|
223
|
+
const formattedValue = (value instanceof ThemeVariableFunction)
|
|
224
|
+
? value.toString(this.globals)
|
|
225
|
+
: value;
|
|
226
|
+
if (!formattedValue) {
|
|
227
|
+
return previous;
|
|
228
|
+
}
|
|
229
|
+
return { ...previous, [`--${token}`]: formattedValue };
|
|
140
230
|
}, {});
|
|
141
231
|
}
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
return [scope, current].filter(item => !!item).join('-');
|
|
232
|
+
getToken(key, scope) {
|
|
233
|
+
const token = this.tokenize(key);
|
|
234
|
+
return [scope, token].filter(item => !!item).join('-');
|
|
146
235
|
}
|
|
236
|
+
tokenize(value) {
|
|
237
|
+
const result = value.replace(/([A-Z])/g, ' $1');
|
|
238
|
+
return result.split(' ').join('-').toLowerCase();
|
|
239
|
+
}
|
|
240
|
+
mergeThemeData(target, ...sources) {
|
|
241
|
+
if (!sources?.length) {
|
|
242
|
+
return target;
|
|
243
|
+
}
|
|
244
|
+
const source = sources.shift();
|
|
245
|
+
if (this.isObject(target) && this.isObject(source)) {
|
|
246
|
+
for (const key in source) {
|
|
247
|
+
if (this.isObject(source[key])) {
|
|
248
|
+
if (!target[key]) {
|
|
249
|
+
Object.assign(target, { [key]: {} });
|
|
250
|
+
}
|
|
251
|
+
this.mergeThemeData(target[key], source[key]);
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
Object.assign(target, { [key]: source[key] });
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return this.mergeThemeData(target, ...sources);
|
|
259
|
+
}
|
|
260
|
+
getGlobals() {
|
|
261
|
+
return {
|
|
262
|
+
accentColor: this.data.accentColor,
|
|
263
|
+
errorColor: this.data.errorColor
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
class ThemingModule {
|
|
147
269
|
}
|
|
270
|
+
ThemingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: ThemingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
271
|
+
ThemingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.1", ngImport: i0, type: ThemingModule, declarations: [BbiTheming], exports: [BbiTheming] });
|
|
272
|
+
ThemingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: ThemingModule });
|
|
273
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.1", ngImport: i0, type: ThemingModule, decorators: [{
|
|
274
|
+
type: NgModule,
|
|
275
|
+
args: [{
|
|
276
|
+
declarations: [BbiTheming],
|
|
277
|
+
exports: [BbiTheming]
|
|
278
|
+
}]
|
|
279
|
+
}] });
|
|
148
280
|
|
|
149
281
|
/**
|
|
150
282
|
* Generated bundle index. Do not edit.
|
|
151
283
|
*/
|
|
152
284
|
|
|
153
|
-
export { Theme,
|
|
285
|
+
export { BbiTheming, Theme, ThemeColorVariable, ThemeVariableFunction, ThemingModule, checkboxGroupThemeFactory, checkboxThemeFactory, formControlAddonThemeFactory, formControlThemeFactory };
|
|
154
286
|
//# sourceMappingURL=bravobit-bb-foundation-theming.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bravobit-bb-foundation-theming.mjs","sources":["../../../projects/bb-foundation/theming/src/lib/theming.interface.ts","../../../projects/bb-foundation/theming/src/lib/theming.service.ts","../../../projects/bb-foundation/theming/src/lib/theming.module.ts","../../../projects/bb-foundation/theming/src/lib/themes/theme.ts","../../../projects/bb-foundation/theming/src/bravobit-bb-foundation-theming.ts"],"sourcesContent":["import {CheckboxGroupTheme} from './themes/checkbox-group.theme';\nimport {CheckboxTheme} from './themes/checkbox.theme';\nimport {Theme} from './themes/theme';\n\nexport class ThemingOptions {\n themes: Theme[];\n}\n\nexport type ThemeDataRecord = Record<string, string> | string;\n\nexport interface ThemeData {\n accentColor?: string;\n checkbox?: Partial<CheckboxTheme>;\n checkboxGroup?: Partial<CheckboxGroupTheme>\n\n custom?: { [key: string]: ThemeDataRecord };\n}\n","import {Inject, Injectable, Optional, Renderer2, RendererFactory2} from '@angular/core';\nimport {ThemingOptions} from './theming.interface';\nimport {DOCUMENT} from '@angular/common';\nimport {Theme} from './themes/theme';\n\n@Injectable()\nexport class Theming {\n\n // Readonly data.\n private readonly _attribute: string = 'data-theme';\n private readonly _renderer: Renderer2 = this._rendererFactory.createRenderer(null, null);\n\n // State.\n private _currentTheme: Theme | null = null;\n\n constructor(private _options: ThemingOptions,\n private _rendererFactory: RendererFactory2,\n @Optional() @Inject(DOCUMENT) private _document: Document) {\n this.setCssVariables();\n this.setFirstTheme();\n }\n\n get all() {\n return this._options?.themes ?? [];\n }\n\n get current() {\n return this._currentTheme ?? null;\n }\n\n set(name: string) {\n const theme = this.all?.find(theme => theme?.name === name);\n if (!theme) {\n throw new Error('Invalid theme.');\n }\n\n const document = this._document.documentElement;\n if (!document) {\n return;\n }\n\n this._renderer.setAttribute(document, this._attribute, name);\n this._currentTheme = theme;\n }\n\n private setCssVariables() {\n const style = this._renderer.createElement('style');\n this._renderer.setAttribute(style, 'id', 'theming-style');\n\n const variables = this.getCssVariables();\n this._renderer.setProperty(style, 'innerHTML', variables);\n\n const head = this._document?.head ?? null;\n if (!head) {\n return;\n }\n\n this._renderer.appendChild(this._document?.head, style);\n }\n\n private getCssVariables() {\n return this.all\n .map(theme => `:root[${this._attribute}=\"${theme?.name}\"] {${this.getThemeContents(theme)}}`)\n .join('\\n');\n }\n\n private getThemeContents(theme: Theme) {\n const themeData = theme?.data ?? {};\n return Object.keys(themeData)\n .map(key => `${key}: ${themeData?.[key]};`)\n .join(' ');\n }\n\n private setFirstTheme() {\n const theme = this.all?.[0] ?? null;\n if (!theme) {\n throw new Error('No theme found.');\n }\n\n const themeName = theme?.name ?? null;\n return this.set(themeName);\n }\n\n}\n","import {APP_INITIALIZER, ModuleWithProviders, NgModule, Optional, SkipSelf} from '@angular/core';\nimport {ThemingOptions} from './theming.interface';\nimport {Theming} from './theming.service';\n\n@NgModule({})\nexport class ThemingModule {\n\n constructor(@Optional() @SkipSelf() private _parent?: ThemingModule) {\n if (this._parent) {\n throw new Error('ThemingModule is already loaded; Import it in the core module only.');\n }\n }\n\n static forRoot(options: ThemingOptions): ModuleWithProviders<ThemingModule> {\n return {\n ngModule: ThemingModule,\n providers: [\n Theming,\n {provide: APP_INITIALIZER, deps: [Theming], useFactory: initializeTheme, multi: true},\n {provide: ThemingOptions, useValue: options}\n ]\n };\n }\n\n}\n\nexport function initializeTheme(_: Theming) {\n // Note: We just need to initialize the theme.\n return () => ({});\n}\n","import {ThemeData} from '../theming.interface';\n\nexport class Theme {\n\n // Readonly data.\n private _parsed: Record<string, string>;\n\n constructor(private _name: string,\n private _data?: ThemeData) {\n this._parsed = this.parseData(_data ?? {});\n }\n\n get name() {\n return this._name;\n }\n\n get data() {\n return this._parsed;\n }\n\n update(data: ThemeData) {\n this._parsed = {...this._parsed, ...this.parseData(data)};\n return this;\n }\n\n protected parseData(data: object, scope: string | null = null) {\n return Object.keys(data).reduce((previous, current) => {\n const value = data?.[current];\n const token = this.getFormattedToken(current, scope);\n if (typeof value === 'object' && value !== null) {\n const formatted = this.parseData(value, token);\n return {...previous, ...formatted};\n }\n return {...previous, [`--${token}`]: value};\n }, {});\n }\n\n protected getFormattedToken(key: string, scope: string | null = null) {\n const result = key.replace(/([A-Z])/g, ' $1');\n const current = result.split(' ').join('-').toLowerCase();\n return [scope, current].filter(item => !!item).join('-');\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAIa,cAAc,CAAA;AAE1B;;MCAY,OAAO,CAAA;AAShB,IAAA,WAAA,CAAoB,QAAwB,EACxB,gBAAkC,EACJ,SAAmB,EAAA;QAFjD,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAgB;QACxB,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAAkB;QACJ,IAAS,CAAA,SAAA,GAAT,SAAS,CAAU;;QARpD,IAAU,CAAA,UAAA,GAAW,YAAY,CAAC;QAClC,IAAS,CAAA,SAAA,GAAc,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;;QAGjF,IAAa,CAAA,aAAA,GAAiB,IAAI,CAAC;QAKv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GAAG,SAAS,EAAC,CAAC;AACtC,aAAA;AACD,YAAA,OAAO,EAAC,GAAG,QAAQ,EAAE,CAAC,CAAA,EAAA,EAAK,KAAK,CAAA,CAAE,GAAG,KAAK,EAAC,CAAC;SAC/C,EAAE,EAAE,CAAC,CAAC;KACV;AAES,IAAA,iBAAiB,CAAC,GAAW,EAAE,KAAA,GAAuB,IAAI,EAAA;QAChE,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AAC9C,QAAA,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;QAC1D,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC5D;AAEJ;;AC3CD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"bravobit-bb-foundation-theming.mjs","sources":["../../../projects/bb-foundation/theming/src/lib/theming.directive.ts","../../../projects/bb-foundation/theming/src/lib/themes/form-control-addon.theme.ts","../../../projects/bb-foundation/theming/src/lib/themes/checkbox-group.theme.ts","../../../projects/bb-foundation/theming/src/lib/utils/theming.variable.ts","../../../projects/bb-foundation/theming/src/lib/themes/control-error.theme.ts","../../../projects/bb-foundation/theming/src/lib/themes/form-control.theme.ts","../../../projects/bb-foundation/theming/src/lib/themes/checkbox.theme.ts","../../../projects/bb-foundation/theming/src/lib/theming.data.ts","../../../projects/bb-foundation/theming/src/lib/theming.module.ts","../../../projects/bb-foundation/theming/src/bravobit-bb-foundation-theming.ts"],"sourcesContent":["import {Directive, ElementRef, Input, Renderer2, RendererStyleFlags2} from '@angular/core';\nimport {Theme} from './theming.data';\n\n@Directive({\n selector: '[bbiTheming]'\n})\nexport class BbiTheming {\n\n // Inputs.\n @Input('bbiTheming') set theme(theme: Theme | null) {\n this._theme = theme;\n this.setTheme();\n }\n\n // Cache.\n private _theme: Theme | null = null;\n\n constructor(private _renderer: Renderer2,\n private _elementRef: ElementRef) {\n }\n\n private setTheme() {\n if (!this._theme) {\n return;\n }\n const variables = this._theme.variables();\n const element = this._elementRef.nativeElement;\n\n for (const key in variables) {\n const value = variables?.[key];\n this._renderer.setStyle(element, key, value, RendererStyleFlags2.DashCase);\n }\n }\n\n}\n","import {ThemeVariable} from '../utils/theming.variable';\n\nexport interface FormControlAddonTheme {\n spacing: ThemeVariable;\n}\n\nexport function formControlAddonThemeFactory(): FormControlAddonTheme {\n return {\n spacing: '10px'\n };\n}\n","import {ThemeVariable} from '../utils/theming.variable';\n\nexport interface CheckboxGroupTheme {\n grouping: ThemeVariable;\n\n label: {\n color: ThemeVariable;\n fontSize: ThemeVariable;\n fontWeight: ThemeVariable;\n lineHeight: ThemeVariable;\n offset: ThemeVariable;\n };\n\n spacing: {\n horizontal: ThemeVariable;\n vertical: ThemeVariable;\n };\n}\n\nexport function checkboxGroupThemeFactory(): CheckboxGroupTheme {\n return {\n grouping: '20px',\n label: {\n color: '#525252',\n offset: '4px',\n fontSize: '14px',\n fontWeight: '400',\n lineHeight: '1.33'\n },\n spacing: {\n horizontal: '10px',\n vertical: '4px'\n }\n };\n}\n","import {GlobalVariables, GlobalVariablesKey} from '../theming.interface';\n\nexport type ThemeVariable = ThemeVariableFunction | string;\n\nexport abstract class ThemeVariableFunction {\n\n protected constructor(private _key: GlobalVariablesKey) {\n }\n\n abstract format(value: string): string;\n\n toString(variables: GlobalVariables) {\n const value = variables?.[this._key] ?? null;\n if (!value) {\n throw new Error(`Invalid variable key \"${this._key}\"`);\n }\n return !!value ? this.format(value) : null;\n }\n\n}\n\nexport class ThemeColorVariable extends ThemeVariableFunction {\n\n // State.\n private _opacity: number = 1;\n\n constructor(key: GlobalVariablesKey) {\n super(key);\n }\n\n format(value: string) {\n const rgb = this.hexToRgb(value);\n return this.toRgba(rgb);\n }\n\n opacity(value: number) {\n this._opacity = value;\n return this;\n }\n\n private toRgba(data: { red: number, green: number, blue: number }) {\n return `rgba(${data?.red},${data?.green},${data?.blue},${this._opacity})`;\n }\n\n private hexToRgb(value: string) {\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(value);\n if (!result) {\n throw new Error(`Invalid color format for \"${value}\". Only hex is currently supported.`);\n }\n\n const red = parseInt(result?.[1], 16);\n const green = parseInt(result?.[2], 16);\n const blue = parseInt(result?.[3], 16);\n return {red, green, blue};\n }\n\n}\n","import {ThemeColorVariable, ThemeVariable} from '../utils/theming.variable';\n\nexport interface ControlErrorTheme {\n color: ThemeVariable;\n fontSize: ThemeVariable;\n lineHeight: ThemeVariable;\n fontWeight: ThemeVariable;\n spacing: ThemeVariable;\n}\n\nexport function controlErrorThemeFactory(): ControlErrorTheme {\n return {\n color: new ThemeColorVariable('errorColor'),\n fontSize: '13px',\n lineHeight: '1.5',\n fontWeight: '400',\n spacing: '4px'\n };\n}\n","import {ThemeColorVariable, ThemeVariable} from '../utils/theming.variable';\n\ninterface BorderTheme {\n radius: ThemeVariable;\n width: ThemeVariable;\n style: ThemeVariable;\n color: ThemeVariable;\n}\n\nexport interface FormControlTheme {\n grouping: ThemeVariable;\n color: ThemeVariable;\n background: ThemeVariable;\n error: {\n color: ThemeVariable;\n background: ThemeVariable;\n placeholderColor: ThemeVariable;\n };\n border: BorderTheme;\n focused: {\n color: ThemeVariable;\n background: ThemeVariable;\n shadow: ThemeVariable;\n border: BorderTheme;\n };\n disabled: {\n color: ThemeVariable;\n background: ThemeVariable;\n opacity: ThemeVariable;\n border: BorderTheme;\n };\n}\n\nexport function formControlThemeFactory(): FormControlTheme {\n const errorColorKey = 'errorColor';\n const inputColor = '#111111';\n const backgroundColor = '#ffffff';\n return {\n grouping: '20px',\n color: inputColor,\n background: backgroundColor,\n error: {\n color: new ThemeColorVariable(errorColorKey),\n background: new ThemeColorVariable(errorColorKey).opacity(0.1),\n placeholderColor: new ThemeColorVariable(errorColorKey).opacity(0.4)\n },\n border: {\n radius: '6px',\n width: '1px',\n style: 'solid',\n color: 'rgba(67, 90, 111, 0.3)'\n },\n focused: {\n color: inputColor,\n background: backgroundColor,\n border: {\n radius: '6px',\n width: '1px',\n style: 'solid',\n color: '#212121'\n },\n shadow: '0 0 0 3px rgba(0, 123, 255, 0.2)'\n },\n disabled: {\n color: inputColor,\n background: backgroundColor,\n border: {\n radius: '6px',\n width: '1px',\n style: 'solid',\n color: '#212121'\n },\n opacity: '0.25'\n }\n };\n}\n","import {ThemeColorVariable, ThemeVariable} from '../utils/theming.variable';\n\nexport interface CheckboxTheme {\n size: ThemeVariable;\n grouping: ThemeVariable;\n\n colors: {\n accent: ThemeVariable;\n disabled: ThemeVariable;\n };\n\n border: {\n color: ThemeVariable;\n thickness: ThemeVariable;\n radius: ThemeVariable;\n };\n\n outline: {\n color: ThemeVariable;\n offset: ThemeVariable;\n thickness: ThemeVariable;\n };\n\n check: {\n size: ThemeVariable;\n color: ThemeVariable;\n thickness: ThemeVariable;\n };\n\n label: {\n color: ThemeVariable;\n fontSize: ThemeVariable;\n fontWeight: ThemeVariable;\n lineHeight: ThemeVariable;\n offset: ThemeVariable;\n };\n}\n\nexport function checkboxThemeFactory(): CheckboxTheme {\n const accentColor = new ThemeColorVariable('accentColor');\n return {\n size: '20px',\n grouping: '20px',\n colors: {\n accent: accentColor,\n disabled: '#c6c6c6'\n },\n border: {\n color: '#111111',\n thickness: '1px',\n radius: '4px'\n },\n outline: {\n color: accentColor,\n offset: '1px',\n thickness: '2px'\n },\n check: {\n size: '12px',\n color: 'white',\n thickness: '2px'\n },\n label: {\n color: '#111111',\n offset: '6px',\n fontSize: '16px',\n fontWeight: '400',\n lineHeight: '1.28'\n }\n };\n}\n","import {GlobalTheme, GlobalVariables, PartialGlobalTheme} from './theming.interface';\nimport {formControlAddonThemeFactory} from './themes/form-control-addon.theme';\nimport {checkboxGroupThemeFactory} from './themes/checkbox-group.theme';\nimport {controlErrorThemeFactory} from './themes/control-error.theme';\nimport {formControlThemeFactory} from './themes/form-control.theme';\nimport {ThemeVariableFunction} from './utils/theming.variable';\nimport {checkboxThemeFactory} from './themes/checkbox.theme';\n\nexport class Theme {\n\n protected readonly data: GlobalTheme;\n protected readonly globals: GlobalVariables;\n\n constructor(theme?: PartialGlobalTheme) {\n const defaultFactories = this.defaultFactories();\n this.data = this.mergeThemeData(defaultFactories, theme);\n this.globals = this.getGlobals();\n }\n\n variables() {\n return this.getContents(this.data);\n }\n\n protected defaultFactories(): GlobalTheme {\n return {\n accentColor: '#1565c0',\n errorColor: '#bd322a',\n formControl: formControlThemeFactory(),\n formControlAddon: formControlAddonThemeFactory(),\n checkbox: checkboxThemeFactory(),\n checkboxGroup: checkboxGroupThemeFactory(),\n controlError: controlErrorThemeFactory()\n };\n }\n\n protected getContents(data: object, scope: string | null = null) {\n return Object.keys(data).reduce((previous, current) => {\n const value = data?.[current];\n const token = this.getToken(current, scope);\n\n if (typeof value === 'object' && value !== null && !(value instanceof ThemeVariableFunction)) {\n const formatted = this.getContents(value, token);\n return {...previous, ...formatted};\n }\n\n const formattedValue = (value instanceof ThemeVariableFunction)\n ? value.toString(this.globals)\n : value;\n\n if (!formattedValue) {\n return previous;\n }\n\n return {...previous, [`--${token}`]: formattedValue};\n }, {}) as { [key: string]: string };\n }\n\n protected getToken(key: string, scope: string) {\n const token = this.tokenize(key);\n return [scope, token].filter(item => !!item).join('-');\n }\n\n protected tokenize(value: string) {\n const result = value.replace(/([A-Z])/g, ' $1');\n return result.split(' ').join('-').toLowerCase();\n }\n\n protected mergeThemeData(target: GlobalTheme, ...sources: PartialGlobalTheme[]) {\n if (!sources?.length) {\n return target;\n }\n\n const source = sources.shift();\n if (this.isObject(target) && this.isObject(source)) {\n for (const key in source) {\n if (this.isObject(source[key])) {\n if (!target[key]) {\n Object.assign(target, {[key]: {}});\n }\n this.mergeThemeData(target[key], source[key]);\n } else {\n Object.assign(target, {[key]: source[key]});\n }\n }\n }\n\n return this.mergeThemeData(target, ...sources);\n }\n\n protected getGlobals() {\n return {\n accentColor: this.data.accentColor,\n errorColor: this.data.errorColor\n };\n }\n\n private isObject = (item: unknown) => {\n return (item && typeof item === 'object' && !Array.isArray(item));\n };\n\n}\n","import {BbiTheming} from './theming.directive';\nimport {NgModule} from '@angular/core';\n\n@NgModule({\n declarations: [BbiTheming],\n exports: [BbiTheming]\n})\nexport class ThemingModule {\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;MAMa,UAAU,CAAA;IAWnB,WAAoB,CAAA,SAAoB,EACpB,WAAuB,EAAA;QADvB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAW;QACpB,IAAW,CAAA,WAAA,GAAX,WAAW,CAAY;;QAHnC,IAAM,CAAA,MAAA,GAAiB,IAAI,CAAC;KAInC;;IAVD,IAAyB,KAAK,CAAC,KAAmB,EAAA;AAC9C,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,QAAQ,EAAE,CAAC;KACnB;IASO,QAAQ,GAAA;AACZ,QAAA,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACd,OAAO;AACV,SAAA;QACD,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;AAC1C,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC;AAE/C,QAAA,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE;AACzB,YAAA,MAAM,KAAK,GAAG,SAAS,GAAG,GAAG,CAAC,CAAC;AAC/B,YAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAC9E,SAAA;KACJ;;uGA1BQ,UAAU,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,SAAA,EAAA,EAA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