@bravobit/bb-foundation 0.42.0 → 0.42.2
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 +3 -6
- package/auth/lib/auth.service.d.ts +11 -16
- package/dialog/lib/dialog-confirm/dialog-confirm.component.d.ts +2 -5
- package/dialog/lib/dialog-container/dialog-container.component.d.ts +4 -6
- package/dialog/lib/dialog-overlay/dialog-overlay.component.d.ts +5 -7
- package/esm2022/auth/lib/auth.interceptor.mjs +36 -42
- package/esm2022/auth/lib/auth.module.mjs +4 -4
- package/esm2022/auth/lib/auth.service.mjs +25 -41
- package/esm2022/auth/lib/auth.session.mjs +26 -22
- package/esm2022/auth/lib/directives/authenticated.directive.mjs +16 -12
- package/esm2022/auth/lib/helpers/jwt.helper.mjs +29 -31
- package/esm2022/auth/lib/providers/email.provider.mjs +4 -1
- package/esm2022/auth/lib/providers/verify.provider.mjs +4 -1
- package/esm2022/collections/lib/collection.mjs +17 -7
- package/esm2022/collections/lib/collections.module.mjs +6 -6
- package/esm2022/collections/lib/components/collections-actions/collections-actions.component.mjs +7 -9
- package/esm2022/collections/lib/components/collections-grid/collections-grid.component.mjs +11 -11
- package/esm2022/collections/lib/components/collections-pager/collections-pager.component.mjs +10 -10
- package/esm2022/collections/lib/components/collections-table/collections-table.component.mjs +16 -16
- package/esm2022/collections/lib/components/collections-table-label/collections-table-label.component.mjs +9 -11
- package/esm2022/collections/lib/components/collections-table-sorting/collections-table-sorting.component.mjs +12 -9
- package/esm2022/collections/lib/components/collections-viewer/collections-viewer.component.mjs +10 -7
- package/esm2022/collections/lib/directives/collections-data-row.directive.mjs +6 -3
- package/esm2022/collections/lib/directives/collections-data.directive.mjs +6 -3
- package/esm2022/collections/lib/directives/collections-empty.directive.mjs +6 -3
- package/esm2022/collections/lib/directives/collections-error.directive.mjs +6 -3
- package/esm2022/collections/lib/directives/collections-initial.directive.mjs +4 -3
- package/esm2022/collections/lib/directives/collections-item.directive.mjs +6 -3
- package/esm2022/collections/lib/providers/api-collection.provider.mjs +6 -4
- package/esm2022/collections/lib/providers/local-collection.provider.mjs +2 -2
- package/esm2022/combobox/combobox/combobox-container.directive.mjs +12 -7
- package/esm2022/combobox/combobox/combobox.component.mjs +23 -20
- package/esm2022/combobox/combobox-label.directive.mjs +3 -3
- package/esm2022/combobox/combobox-option.directive.mjs +3 -3
- package/esm2022/combobox/combobox-panel/combobox-panel.component.mjs +10 -6
- package/esm2022/dashboard/lib/dashboard/dashboard.component.mjs +13 -13
- package/esm2022/dashboard/lib/dashboard-header/dashboard-header.component.mjs +5 -7
- package/esm2022/dashboard/lib/dashboard-menu/dashboard-menu.component.mjs +8 -10
- package/esm2022/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.mjs +5 -7
- package/esm2022/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.mjs +12 -13
- package/esm2022/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.mjs +13 -12
- package/esm2022/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.mjs +7 -5
- package/esm2022/dashboard/lib/dashboard.module.mjs +5 -5
- package/esm2022/dialog/lib/dialog-actions/dialog-actions.component.mjs +3 -3
- package/esm2022/dialog/lib/dialog-confirm/dialog-confirm.component.mjs +21 -20
- package/esm2022/dialog/lib/dialog-container/dialog-container.component.mjs +19 -24
- package/esm2022/dialog/lib/dialog-header/dialog-header.component.mjs +5 -7
- package/esm2022/dialog/lib/dialog-link/dialog-link.component.mjs +3 -3
- package/esm2022/dialog/lib/dialog-modal/dialog-modal.component.mjs +9 -6
- package/esm2022/dialog/lib/dialog-overlay/dialog-overlay.component.mjs +19 -26
- package/esm2022/dialog/lib/dialog.insertion.mjs +4 -3
- package/esm2022/dialog/lib/dialog.interfaces.mjs +4 -1
- package/esm2022/dialog/lib/dialog.module.mjs +6 -6
- package/esm2022/dialog/lib/dialog.ref.mjs +4 -6
- package/esm2022/dialog/lib/dialog.service.mjs +5 -3
- package/esm2022/dialog/lib/directives/confirm.directive.mjs +12 -14
- package/esm2022/elements/lib/avatar/avatar.component.mjs +75 -77
- package/esm2022/elements/lib/button/button.component.mjs +12 -10
- package/esm2022/elements/lib/checkbox/checkbox.component.mjs +21 -17
- package/esm2022/elements/lib/checkbox-group/checkbox-group.component.mjs +8 -10
- package/esm2022/elements/lib/date-picker/date-picker.component.mjs +82 -76
- package/esm2022/elements/lib/directives/addon.directive.mjs +5 -5
- package/esm2022/elements/lib/directives/extra-error-controls.directive.mjs +7 -9
- package/esm2022/elements/lib/directives/form-submit.directive.mjs +6 -3
- package/esm2022/elements/lib/directives/form-submitter.directive.mjs +5 -7
- package/esm2022/elements/lib/directives/image-upload.directive.mjs +14 -11
- package/esm2022/elements/lib/directives/input.directive.mjs +6 -4
- package/esm2022/elements/lib/elements.module.mjs +6 -6
- package/esm2022/elements/lib/file-picker/file-picker.component.mjs +52 -51
- package/esm2022/elements/lib/form-control/form-control.component.mjs +14 -14
- package/esm2022/elements/lib/form-error/form-error.component.mjs +16 -8
- package/esm2022/elements/lib/form-group/form-group.component.mjs +5 -7
- package/esm2022/elements/lib/icon/icon.component.mjs +14 -13
- package/esm2022/elements/lib/image-picker/image-picker.component.mjs +20 -17
- package/esm2022/elements/lib/multi-file-control/multi-file-control.component.mjs +28 -24
- package/esm2022/elements/lib/pipes/date.pipe.mjs +6 -8
- package/esm2022/elements/lib/pipes/file-image.pipe.mjs +6 -3
- package/esm2022/elements/lib/pipes/file-size.pipe.mjs +13 -15
- package/esm2022/elements/lib/pipes/relative-time.pipe.mjs +37 -35
- package/esm2022/elements/lib/radio-button/radio-button.component.mjs +8 -7
- package/esm2022/elements/lib/radio-group/radio-group.component.mjs +21 -20
- package/esm2022/elements/lib/spinner/spinner.component.mjs +7 -9
- package/esm2022/http/lib/classes/http.config.mjs +19 -15
- package/esm2022/http/lib/http.interfaces.mjs +1 -1
- package/esm2022/http/lib/http.module.mjs +5 -4
- package/esm2022/http/lib/interceptors/base-url.interceptor.mjs +12 -20
- package/esm2022/http/lib/interceptors/error.interceptor.mjs +9 -14
- package/esm2022/lib/core/services/exif.service.mjs +102 -100
- package/esm2022/lib/core/services/file-loader.service.mjs +15 -17
- package/esm2022/lib/core/services/files.service.mjs +9 -17
- package/esm2022/lib/core/services/image-converter.service.mjs +33 -30
- package/esm2022/lib/core/services/languages.service.mjs +25 -24
- package/esm2022/lib/core/services/network.service.mjs +8 -5
- package/esm2022/lib/core/services/patch.service.mjs +9 -6
- package/esm2022/localize/lib/dictionary/dictionary.class.mjs +7 -1
- package/esm2022/localize/lib/dictionary/dictionary.context.mjs +2 -4
- package/esm2022/localize/lib/dictionary/dictionary.data.mjs +2 -1
- package/esm2022/localize/lib/handlers/missing.handler.mjs +2 -4
- package/esm2022/localize/lib/localize.module.mjs +5 -5
- package/esm2022/localize/lib/localize.pipe.mjs +4 -3
- package/esm2022/localize/lib/localize.service.mjs +36 -62
- package/esm2022/localize/lib/transforms/interpolate.transform.mjs +12 -22
- package/esm2022/localize/lib/transforms/plural.transform.mjs +9 -18
- package/esm2022/localize/lib/transforms/reference.transform.mjs +7 -15
- package/esm2022/localize/lib/views/localize-string/localize-string.component.mjs +14 -11
- package/esm2022/localize/lib/views/localize-template.directive.mjs +6 -5
- package/esm2022/masking/lib/directives/currency-mask.directive.mjs +11 -6
- package/esm2022/masking/lib/directives/date-mask.directive.mjs +11 -6
- package/esm2022/masking/lib/directives/input-mask.directive.mjs +21 -14
- package/esm2022/masking/lib/masking.module.mjs +5 -5
- package/esm2022/masking/lib/masking.service.mjs +4 -3
- package/esm2022/notifications/lib/notifications-item/notifications-item.component.mjs +50 -36
- package/esm2022/notifications/lib/notifications-list/notifications-list.component.mjs +8 -7
- package/esm2022/notifications/lib/notifications.interfaces.mjs +10 -1
- package/esm2022/notifications/lib/notifications.module.mjs +4 -4
- package/esm2022/notifications/lib/notifications.service.mjs +24 -10
- package/esm2022/permissions/lib/directives/permission.directive.mjs +20 -14
- package/esm2022/permissions/lib/handlers/local.handler.mjs +3 -1
- package/esm2022/permissions/lib/permissions.interface.mjs +4 -1
- package/esm2022/permissions/lib/permissions.module.mjs +4 -4
- package/esm2022/permissions/lib/permissions.service.mjs +8 -7
- package/esm2022/recaptcha/lib/recaptcha/recaptcha.component.mjs +35 -28
- package/esm2022/recaptcha/lib/recaptcha-loader.service.mjs +15 -15
- package/esm2022/recaptcha/lib/recaptcha.module.mjs +4 -4
- package/esm2022/select/lib/select/select.component.mjs +52 -47
- package/esm2022/select/lib/select-label.directive.mjs +4 -3
- package/esm2022/select/lib/select-multi-label.directive.mjs +4 -3
- package/esm2022/select/lib/select-option-group.directive.mjs +4 -3
- package/esm2022/select/lib/select-option.directive.mjs +4 -3
- package/esm2022/select/lib/select.module.mjs +5 -5
- package/esm2022/storage/lib/storage.service.mjs +25 -21
- package/esm2022/storage/lib/strategies/cookie-storage.strategy.mjs +66 -64
- package/esm2022/storage/lib/strategies/memory-storage.strategy.mjs +16 -18
- package/esm2022/storage/lib/strategies/polyfill-storage.strategy.mjs +31 -30
- package/esm2022/table/lib/components/table/table.component.mjs +30 -20
- package/esm2022/table/lib/components/table-cell/table-cell.component.mjs +3 -3
- package/esm2022/table/lib/components/table-header-cell/table-header-cell.component.mjs +15 -11
- package/esm2022/table/lib/components/table-pager/table-pager.component.mjs +18 -16
- package/esm2022/table/lib/data/datasource.data.mjs +4 -6
- package/esm2022/table/lib/data/generic.data.mjs +38 -36
- package/esm2022/table/lib/table.module.mjs +6 -6
- package/esm2022/tooltip/lib/tooltip-container/tooltip-container.component.mjs +5 -7
- package/esm2022/tooltip/lib/tooltip.directive.mjs +15 -15
- package/esm2022/tooltip/lib/tooltip.module.mjs +4 -4
- package/esm2022/utils/lib/directives/autosize.directive.mjs +9 -7
- package/esm2022/utils/lib/directives/focus-trap.directive.mjs +24 -22
- package/esm2022/utils/lib/directives/focus.directive.mjs +8 -5
- package/esm2022/utils/lib/directives/template.directive.mjs +7 -3
- package/esm2022/utils/lib/utils.module.mjs +5 -5
- package/fesm2022/bravobit-bb-foundation-auth.mjs +134 -144
- package/fesm2022/bravobit-bb-foundation-auth.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-collections.mjs +123 -93
- package/fesm2022/bravobit-bb-foundation-collections.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-combobox.mjs +46 -34
- package/fesm2022/bravobit-bb-foundation-combobox.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-dashboard.mjs +60 -64
- package/fesm2022/bravobit-bb-foundation-dashboard.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-dialog.mjs +97 -103
- package/fesm2022/bravobit-bb-foundation-dialog.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-elements.mjs +468 -440
- package/fesm2022/bravobit-bb-foundation-elements.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-http.mjs +40 -46
- package/fesm2022/bravobit-bb-foundation-http.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-localize.mjs +91 -130
- package/fesm2022/bravobit-bb-foundation-localize.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-masking.mjs +47 -29
- package/fesm2022/bravobit-bb-foundation-masking.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-notifications.mjs +91 -53
- package/fesm2022/bravobit-bb-foundation-notifications.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-permissions.mjs +34 -22
- package/fesm2022/bravobit-bb-foundation-permissions.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-recaptcha.mjs +51 -44
- package/fesm2022/bravobit-bb-foundation-recaptcha.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-select.mjs +67 -58
- package/fesm2022/bravobit-bb-foundation-select.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-storage.mjs +134 -129
- package/fesm2022/bravobit-bb-foundation-storage.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-table.mjs +107 -91
- package/fesm2022/bravobit-bb-foundation-table.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-tooltip.mjs +21 -23
- package/fesm2022/bravobit-bb-foundation-tooltip.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation-utils.mjs +48 -37
- package/fesm2022/bravobit-bb-foundation-utils.mjs.map +1 -1
- package/fesm2022/bravobit-bb-foundation.mjs +194 -191
- package/fesm2022/bravobit-bb-foundation.mjs.map +1 -1
- package/http/lib/http.interfaces.d.ts +2 -1
- package/http/lib/interceptors/base-url.interceptor.d.ts +2 -4
- package/http/lib/interceptors/error.interceptor.d.ts +1 -3
- package/lib/core/services/files.service.d.ts +3 -7
- package/localize/lib/localize.service.d.ts +10 -14
- package/localize/lib/transforms/interpolate.transform.d.ts +4 -5
- package/localize/lib/transforms/plural.transform.d.ts +5 -6
- package/localize/lib/transforms/reference.transform.d.ts +2 -3
- package/package.json +39 -39
|
@@ -16,6 +16,9 @@ import * as i3 from '@angular/platform-browser';
|
|
|
16
16
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
17
17
|
|
|
18
18
|
class BbFormSubmit {
|
|
19
|
+
_host;
|
|
20
|
+
_formDirective;
|
|
21
|
+
submitStatus$;
|
|
19
22
|
constructor(_host, _formDirective) {
|
|
20
23
|
this._host = _host;
|
|
21
24
|
this._formDirective = _formDirective;
|
|
@@ -45,8 +48,8 @@ class BbFormSubmit {
|
|
|
45
48
|
}
|
|
46
49
|
return this._formDirective.ngSubmit.pipe(map(() => true));
|
|
47
50
|
}
|
|
48
|
-
static
|
|
49
|
-
static
|
|
51
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFormSubmit, deps: [{ token: i0.ElementRef }, { token: i1.FormGroupDirective, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
52
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.0", type: BbFormSubmit, isStandalone: true, selector: "form", exportAs: ["bbForm"], ngImport: i0 });
|
|
50
53
|
}
|
|
51
54
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFormSubmit, decorators: [{
|
|
52
55
|
type: Directive,
|
|
@@ -62,18 +65,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
62
65
|
}] }] });
|
|
63
66
|
|
|
64
67
|
class BbFormSubmitter {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
this.submitted$ = new BehaviorSubject(false);
|
|
68
|
-
}
|
|
68
|
+
// State.
|
|
69
|
+
submitted$ = new BehaviorSubject(false);
|
|
69
70
|
submit() {
|
|
70
71
|
this.submitted$.next(true);
|
|
71
72
|
}
|
|
72
73
|
reset() {
|
|
73
74
|
this.submitted$.next(false);
|
|
74
75
|
}
|
|
75
|
-
static
|
|
76
|
-
static
|
|
76
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFormSubmitter, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
77
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.0", type: BbFormSubmitter, isStandalone: true, selector: "[bbFormSubmitter]", exportAs: ["bbFormSubmitter"], ngImport: i0 });
|
|
77
78
|
}
|
|
78
79
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFormSubmitter, decorators: [{
|
|
79
80
|
type: Directive,
|
|
@@ -88,12 +89,10 @@ const ELEMENTS_ICONS = new InjectionToken('elements_icons');
|
|
|
88
89
|
const ELEMENTS_ERRORS = new InjectionToken('elements_errors');
|
|
89
90
|
|
|
90
91
|
class BbExtraErrorControls {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
this._subscription = null;
|
|
96
|
-
}
|
|
92
|
+
// State.
|
|
93
|
+
changes = new BehaviorSubject(null);
|
|
94
|
+
// Subscriptions.
|
|
95
|
+
_subscription = null;
|
|
97
96
|
set extraControls(controls) {
|
|
98
97
|
this.handle(controls);
|
|
99
98
|
}
|
|
@@ -112,8 +111,8 @@ class BbExtraErrorControls {
|
|
|
112
111
|
this._subscription = errors$
|
|
113
112
|
.subscribe(errors => this.changes.next(errors ?? null));
|
|
114
113
|
}
|
|
115
|
-
static
|
|
116
|
-
static
|
|
114
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbExtraErrorControls, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
115
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.0", type: BbExtraErrorControls, isStandalone: true, selector: "[bbExtraErrorControls]", inputs: { extraControls: ["bbExtraErrorControls", "extraControls"] }, ngImport: i0 });
|
|
117
116
|
}
|
|
118
117
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbExtraErrorControls, decorators: [{
|
|
119
118
|
type: Directive,
|
|
@@ -127,18 +126,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
127
126
|
}] } });
|
|
128
127
|
|
|
129
128
|
class BbFormError {
|
|
129
|
+
_form;
|
|
130
|
+
_ngControl;
|
|
131
|
+
_formSubmitter;
|
|
132
|
+
_extraErrorControls;
|
|
133
|
+
_errors;
|
|
134
|
+
// Readonly data.
|
|
135
|
+
errorsMap;
|
|
136
|
+
// Inputs.
|
|
137
|
+
control = null;
|
|
138
|
+
// Outputs.
|
|
139
|
+
errorChange = new EventEmitter();
|
|
140
|
+
// State.
|
|
141
|
+
error$;
|
|
130
142
|
constructor(_form, _ngControl, _formSubmitter, _extraErrorControls, _errors) {
|
|
131
143
|
this._form = _form;
|
|
132
144
|
this._ngControl = _ngControl;
|
|
133
145
|
this._formSubmitter = _formSubmitter;
|
|
134
146
|
this._extraErrorControls = _extraErrorControls;
|
|
135
147
|
this._errors = _errors;
|
|
136
|
-
// Readonly data.
|
|
137
148
|
this.errorsMap = this._errors.reduce((previous, current) => ({ ...previous, ...current }), {});
|
|
138
|
-
// Inputs.
|
|
139
|
-
this.control = null;
|
|
140
|
-
// Outputs.
|
|
141
|
-
this.errorChange = new EventEmitter();
|
|
142
149
|
}
|
|
143
150
|
ngOnInit() {
|
|
144
151
|
this.setControl();
|
|
@@ -188,8 +195,8 @@ class BbFormError {
|
|
|
188
195
|
const extraError$ = this._extraErrorControls?.changes?.asObservable() ?? of(null);
|
|
189
196
|
return combineLatest([error$, extraError$]).pipe(map(([error, extraError]) => error ?? extraError ?? null), distinctUntilChanged());
|
|
190
197
|
}
|
|
191
|
-
static
|
|
192
|
-
static
|
|
198
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFormError, deps: [{ token: BbFormSubmit, optional: true }, { token: i1.NgControl, optional: true }, { token: BbFormSubmitter, optional: true }, { token: BbExtraErrorControls, optional: true }, { token: ELEMENTS_ERRORS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
199
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", type: BbFormError, isStandalone: true, selector: "bb-form-error", inputs: { control: "control" }, outputs: { errorChange: "errorChange" }, host: { classAttribute: "bb-form-error" }, ngImport: i0, template: "@if (error$ | async; as error) {\n @if (error?.token | bbLocalize:{optional: true, data: error?.data}; as message) {\n <p class=\"bb-form-error-message\">{{ message }}</p>\n }\n}\n", styles: [".bb-form-error{display:block}.bb-form-error-message{color:#c23934;display:block;line-height:1.5;margin-top:.25rem;font-size:.8125rem}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: BbLocalize, name: "bbLocalize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
193
200
|
}
|
|
194
201
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFormError, decorators: [{
|
|
195
202
|
type: Component,
|
|
@@ -215,22 +222,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
215
222
|
|
|
216
223
|
let nextUniqueId$3 = 0;
|
|
217
224
|
class BbFormControl {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
225
|
+
// Readonly data.
|
|
226
|
+
labelId = `bb-form-control-${nextUniqueId$3++}`;
|
|
227
|
+
// Views.
|
|
228
|
+
ngControl;
|
|
229
|
+
// Inputs.
|
|
230
|
+
label = null;
|
|
231
|
+
hint = null;
|
|
232
|
+
grouped = false;
|
|
233
|
+
hideErrors = false;
|
|
234
|
+
// State.
|
|
235
|
+
error = false;
|
|
229
236
|
onErrorChange(error) {
|
|
230
237
|
this.error = !!error;
|
|
231
238
|
}
|
|
232
|
-
static
|
|
233
|
-
static
|
|
239
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFormControl, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
240
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", type: BbFormControl, isStandalone: true, selector: "bb-form-control", inputs: { label: "label", hint: "hint", grouped: ["grouped", "grouped", booleanAttribute], hideErrors: ["hideErrors", "hideErrors", booleanAttribute] }, host: { properties: { "class.grouped": "grouped", "class.error": "error" }, classAttribute: "bb-form-control" }, queries: [{ propertyName: "ngControl", first: true, predicate: NgControl, descendants: true }], ngImport: i0, template: "<!-- Label of the form control. -->\n@if (label; as labelContent) {\n <label [attr.for]=\"labelId\"\n class=\"bb-form-control-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n </label>\n}\n\n<!-- The input with the addons. -->\n<div class=\"bb-form-control-container\">\n <ng-content select=\"[bbPrefix]\"></ng-content>\n <ng-content select=\"[bbInput]\"></ng-content>\n <ng-content select=\"[bbSuffix]\"></ng-content>\n</div>\n\n<!-- The error component. -->\n@if (!hideErrors) {\n <bb-form-error [control]=\"ngControl\"\n (errorChange)=\"onErrorChange($event)\">\n </bb-form-error>\n}\n\n<!-- The form control hint. -->\n@if (hint; as hintContent) {\n <p class=\"bb-form-control-hint\">\n <ng-template [bbTemplate]=\"hintContent\">{{ hintContent }}</ng-template>\n </p>\n}\n", styles: [".bb-form-control{color:#111;display:block}.bb-form-control>.bb-form-control-container>*.bb-prefix,.bb-form-control>.bb-form-control-container>*.bb-suffix{color:#b4b4b4;transition:color .3s cubic-bezier(0,0,.2,1)}.bb-form-control>.bb-form-control-container>*.bb-prefix{margin-left:.5rem}.bb-form-control>.bb-form-control-container>*.bb-suffix{margin-right:.5rem}.bb-form-control.grouped{margin-bottom:1.5rem}.bb-form-control.small{max-width:15rem}.bb-form-control.medium{max-width:30rem}.bb-form-control.large{max-width:45rem}.bb-form-control:has(input:required,textarea:required,select:required)>.bb-form-control-label:after{content:\"*\";font-size:.75rem;vertical-align:top;color:var(--bb-form-label-required-color)}.bb-form-control-container:has(input:not(:disabled):not(:read-only):focus,textarea:not(:disabled):not(:read-only):focus,select:not(:disabled):focus){border-color:#757e8a;box-shadow:0 .375rem .375rem -.375rem #0000001a,var(--bb-form-control-box-shadow)}.bb-form-control-container:has(input:not(:disabled):read-only,textarea:not(:disabled):read-only){cursor:default;border-style:dotted;border-color:#bdc4c9}.bb-form-control-container:has(input:disabled,textarea:disabled,select:disabled){cursor:default;pointer-events:none;color:gray;background-color:#e6e6e6}.bb-form-control.error>.bb-form-control-label{color:#c23934}.bb-form-control.error>.bb-form-control-hint{display:none}.bb-form-control.error>.bb-form-control-container>*.bb-prefix,.bb-form-control.error>.bb-form-control-container>.bb-suffix{color:#b51c1c}.bb-form-control.error>.bb-form-control-container>input::placeholder,.bb-form-control.error>.bb-form-control-container>textarea::placeholder{color:#ea7b7b}.bb-form-control.error>.bb-form-control-container,.bb-form-control.error>.bb-form-control-container:has(input:not(:disabled):not(:read-only):focus,textarea:not(:disabled):not(:read-only):focus,select:not(:disabled):focus){border:1px solid hsl(0,73%,30%);background-color:#f8d3d3;box-shadow:0 .375rem .375rem -.375rem #0000001a,0 0 0 .1875rem #f8d3d3}.bb-form-control-container:has(select):after{top:0;right:0;bottom:0;content:\"\";width:1.5rem;display:flex;height:2.5rem;min-width:1.5rem;position:absolute;pointer-events:none;background-repeat:no-repeat;background-size:.75rem .375rem;background-position:calc(100% - .5rem) center;background-image:url('data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 6\"%3E%3Cpath fill=\"%23D8D8D8\" fill-rule=\"evenodd\" d=\"m6 6 6-6H0z\"/%3E%3C/svg%3E')}.bb-form-control-container{width:100%;display:flex;color:#111;overflow:hidden;position:relative;align-items:center;border-radius:.5rem;background-color:#fff;transition-duration:.25s;border:1px solid hsl(213,8%,74%);transition-property:background-color,box-shadow;transition-timing-function:cubic-bezier(0,0,.2,1);box-shadow:0 .375rem .375rem -.375rem #0000001a}.bb-form-control-container>input::placeholder,.bb-form-control-container>textarea::placeholder{color:#d1d1d1;transition:color .3s cubic-bezier(0,0,.2,1)}.bb-form-control-container>input,.bb-form-control-container>textarea,.bb-form-control-container>select{margin:0;width:100%;border:none;color:inherit;font-size:1rem;appearance:none;background-color:transparent}.bb-form-control-container>input,.bb-form-control-container>select{height:2.5rem;padding:0 .5rem}.bb-form-control-container>select{padding-right:2rem}.bb-form-control-container>select>::-ms-expand{display:none}.bb-form-control-container>input::-ms-clear,.bb-form-control-container>input::-ms-reveal{width:0;height:0;display:none}.bb-form-control-container>input::-webkit-search-decoration,.bb-form-control-container>input::-webkit-search-cancel-button,.bb-form-control-container>input::-webkit-search-results-button,.bb-form-control-container>input::-webkit-search-results-decoration{display:none}.bb-form-control-container>textarea{resize:none;padding:.5rem}.bb-form-control-label{display:block;margin-bottom:.25rem;color:var(--bb-form-label-color);font-size:var(--bb-form-label-font-size);font-weight:var(--bb-form-label-font-weight)}.bb-form-control-hint{display:block;line-height:1.5;margin-top:.25rem;font-size:.8125rem;color:#758795}\n"], dependencies: [{ kind: "directive", type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }, { kind: "component", type: BbFormError, selector: "bb-form-error", inputs: ["control"], outputs: ["errorChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
234
241
|
}
|
|
235
242
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFormControl, decorators: [{
|
|
236
243
|
type: Component,
|
|
@@ -255,10 +262,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
255
262
|
}] } });
|
|
256
263
|
|
|
257
264
|
class BbInput {
|
|
265
|
+
_elementRef;
|
|
266
|
+
_formControl;
|
|
258
267
|
constructor(_elementRef, _formControl) {
|
|
259
268
|
this._elementRef = _elementRef;
|
|
260
269
|
this._formControl = _formControl;
|
|
261
|
-
this._required = false;
|
|
262
270
|
}
|
|
263
271
|
focus() {
|
|
264
272
|
return this._elementRef?.nativeElement?.focus();
|
|
@@ -273,8 +281,9 @@ class BbInput {
|
|
|
273
281
|
set required(value) {
|
|
274
282
|
this._required = value;
|
|
275
283
|
}
|
|
276
|
-
|
|
277
|
-
static
|
|
284
|
+
_required = false;
|
|
285
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbInput, deps: [{ token: i0.ElementRef }, { token: BbFormControl, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
286
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.1.0", type: BbInput, isStandalone: true, selector: "input[bbInput],textarea[bbInput],select[bbInput]", inputs: { required: ["required", "required", booleanAttribute] }, host: { properties: { "attr.id": "this.id", "attr.required": "this.required" } }, ngImport: i0 });
|
|
278
287
|
}
|
|
279
288
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbInput, decorators: [{
|
|
280
289
|
type: Directive,
|
|
@@ -298,8 +307,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
298
307
|
}] } });
|
|
299
308
|
|
|
300
309
|
class BbSuffix {
|
|
301
|
-
static
|
|
302
|
-
static
|
|
310
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbSuffix, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
311
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.0", type: BbSuffix, isStandalone: true, selector: "[bbSuffix]", host: { classAttribute: "bb-suffix" }, ngImport: i0 });
|
|
303
312
|
}
|
|
304
313
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbSuffix, decorators: [{
|
|
305
314
|
type: Directive,
|
|
@@ -310,8 +319,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
310
319
|
}]
|
|
311
320
|
}] });
|
|
312
321
|
class BbPrefix {
|
|
313
|
-
static
|
|
314
|
-
static
|
|
322
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbPrefix, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
323
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.1.0", type: BbPrefix, isStandalone: true, selector: "[bbPrefix]", host: { classAttribute: "bb-prefix" }, ngImport: i0 });
|
|
315
324
|
}
|
|
316
325
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbPrefix, decorators: [{
|
|
317
326
|
type: Directive,
|
|
@@ -323,18 +332,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
323
332
|
}] });
|
|
324
333
|
|
|
325
334
|
class BbImageUpload {
|
|
335
|
+
_files;
|
|
336
|
+
_platform;
|
|
337
|
+
_renderer;
|
|
338
|
+
// Inputs.
|
|
339
|
+
width = null;
|
|
340
|
+
height = null;
|
|
341
|
+
mode = 'aspect-fit';
|
|
342
|
+
type = 'png';
|
|
343
|
+
// Outputs.
|
|
344
|
+
onDataUri = new EventEmitter();
|
|
345
|
+
onFile = new EventEmitter();
|
|
326
346
|
constructor(_files, _platform, _renderer) {
|
|
327
347
|
this._files = _files;
|
|
328
348
|
this._platform = _platform;
|
|
329
349
|
this._renderer = _renderer;
|
|
330
|
-
// Inputs.
|
|
331
|
-
this.width = null;
|
|
332
|
-
this.height = null;
|
|
333
|
-
this.mode = 'aspect-fit';
|
|
334
|
-
this.type = 'png';
|
|
335
|
-
// Outputs.
|
|
336
|
-
this.onDataUri = new EventEmitter();
|
|
337
|
-
this.onFile = new EventEmitter();
|
|
338
350
|
}
|
|
339
351
|
async onClick() {
|
|
340
352
|
if (!this._platform.isBrowser) {
|
|
@@ -428,8 +440,8 @@ class BbImageUpload {
|
|
|
428
440
|
return 'image';
|
|
429
441
|
}
|
|
430
442
|
}
|
|
431
|
-
static
|
|
432
|
-
static
|
|
443
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbImageUpload, deps: [{ token: i1$1.Files }, { token: i2.Platform }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
444
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.1.0", type: BbImageUpload, isStandalone: true, selector: "button[bbImageUpload]", inputs: { width: ["bbImageUploadWidth", "width", numberAttribute], height: ["bbImageUploadHeight", "height", numberAttribute], mode: ["bbImageUploadMode", "mode"], type: ["bbImageUploadType", "type"] }, outputs: { onDataUri: "onDataUri", onFile: "onFile" }, host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
433
445
|
}
|
|
434
446
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbImageUpload, decorators: [{
|
|
435
447
|
type: Directive,
|
|
@@ -459,23 +471,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
459
471
|
}] } });
|
|
460
472
|
|
|
461
473
|
class BbFileSize {
|
|
462
|
-
constructor() {
|
|
463
|
-
this.format = (value, decimals = 2) => {
|
|
464
|
-
if (value === 0) {
|
|
465
|
-
return '0 Bytes';
|
|
466
|
-
}
|
|
467
|
-
const k = 1024;
|
|
468
|
-
const dm = decimals < 0 ? 0 : decimals;
|
|
469
|
-
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
470
|
-
const index = Math.floor(Math.log(value) / Math.log(k));
|
|
471
|
-
return parseFloat((value / Math.pow(k, index)).toFixed(dm)) + ' ' + sizes[index];
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
474
|
transform(value) {
|
|
475
475
|
return this.format(value);
|
|
476
476
|
}
|
|
477
|
-
|
|
478
|
-
|
|
477
|
+
format = (value, decimals = 2) => {
|
|
478
|
+
if (value === 0) {
|
|
479
|
+
return '0 Bytes';
|
|
480
|
+
}
|
|
481
|
+
const k = 1024;
|
|
482
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
483
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
484
|
+
const index = Math.floor(Math.log(value) / Math.log(k));
|
|
485
|
+
return parseFloat((value / Math.pow(k, index)).toFixed(dm)) + ' ' + sizes[index];
|
|
486
|
+
};
|
|
487
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFileSize, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
488
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.1.0", ngImport: i0, type: BbFileSize, isStandalone: true, name: "bbFileSize" });
|
|
479
489
|
}
|
|
480
490
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFileSize, decorators: [{
|
|
481
491
|
type: Pipe,
|
|
@@ -486,6 +496,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
486
496
|
}] });
|
|
487
497
|
|
|
488
498
|
class BbFileImage {
|
|
499
|
+
_platform;
|
|
500
|
+
_image;
|
|
501
|
+
_sanitizer;
|
|
489
502
|
constructor(_platform, _image, _sanitizer) {
|
|
490
503
|
this._platform = _platform;
|
|
491
504
|
this._image = _image;
|
|
@@ -514,8 +527,8 @@ class BbFileImage {
|
|
|
514
527
|
return null;
|
|
515
528
|
});
|
|
516
529
|
}
|
|
517
|
-
static
|
|
518
|
-
static
|
|
530
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFileImage, deps: [{ token: i2.Platform }, { token: i1$1.ImageConverter }, { token: i3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
531
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.1.0", ngImport: i0, type: BbFileImage, isStandalone: true, name: "bbFileImage" });
|
|
519
532
|
}
|
|
520
533
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFileImage, decorators: [{
|
|
521
534
|
type: Pipe,
|
|
@@ -526,41 +539,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
526
539
|
}], ctorParameters: () => [{ type: i2.Platform }, { type: i1$1.ImageConverter }, { type: i3.DomSanitizer }] });
|
|
527
540
|
|
|
528
541
|
class BbRelativeTime {
|
|
542
|
+
_localeId;
|
|
543
|
+
_localize;
|
|
529
544
|
constructor(_localeId, _localize) {
|
|
530
545
|
this._localeId = _localeId;
|
|
531
546
|
this._localize = _localize;
|
|
532
|
-
this.isValidDate = (date) => {
|
|
533
|
-
return typeof date === 'object' &&
|
|
534
|
-
typeof date.getTime === 'function' &&
|
|
535
|
-
!isNaN(date.getTime());
|
|
536
|
-
};
|
|
537
|
-
this.parseAsDate = (value) => {
|
|
538
|
-
// Add a Z after the date so
|
|
539
|
-
// it is treated as a UTC date.
|
|
540
|
-
if (typeof value === 'string' && /^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/.test(value)) {
|
|
541
|
-
return new Date(`${value}Z`);
|
|
542
|
-
}
|
|
543
|
-
// Return the regular parsed date.
|
|
544
|
-
return new Date(value);
|
|
545
|
-
};
|
|
546
|
-
this.isToday = (date) => {
|
|
547
|
-
const today = new Date();
|
|
548
|
-
return date?.getDate() === today?.getDate() &&
|
|
549
|
-
date?.getMonth() === today?.getMonth() &&
|
|
550
|
-
date?.getFullYear() === today?.getFullYear();
|
|
551
|
-
};
|
|
552
|
-
this.isYesterday = (date) => {
|
|
553
|
-
const yesterday = new Date(new Date()?.setDate(new Date()?.getDate() - 1));
|
|
554
|
-
return date?.getDate() === yesterday?.getDate() &&
|
|
555
|
-
date?.getMonth() === yesterday?.getMonth() &&
|
|
556
|
-
date?.getFullYear() === yesterday?.getFullYear();
|
|
557
|
-
};
|
|
558
|
-
this.isTomorrow = (date) => {
|
|
559
|
-
const tomorrow = new Date(new Date()?.setDate(new Date()?.getDate() + 1));
|
|
560
|
-
return date?.getDate() === tomorrow?.getDate() &&
|
|
561
|
-
date?.getMonth() === tomorrow?.getMonth() &&
|
|
562
|
-
date?.getFullYear() === tomorrow?.getFullYear();
|
|
563
|
-
};
|
|
564
547
|
}
|
|
565
548
|
transform(value) {
|
|
566
549
|
// Parse the value to a date object.
|
|
@@ -602,8 +585,40 @@ class BbRelativeTime {
|
|
|
602
585
|
get locale() {
|
|
603
586
|
return this._localize?.current?.locale ?? this._localeId;
|
|
604
587
|
}
|
|
605
|
-
|
|
606
|
-
|
|
588
|
+
isValidDate = (date) => {
|
|
589
|
+
return typeof date === 'object' &&
|
|
590
|
+
typeof date.getTime === 'function' &&
|
|
591
|
+
!isNaN(date.getTime());
|
|
592
|
+
};
|
|
593
|
+
parseAsDate = (value) => {
|
|
594
|
+
// Add a Z after the date so
|
|
595
|
+
// it is treated as a UTC date.
|
|
596
|
+
if (typeof value === 'string' && /^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/.test(value)) {
|
|
597
|
+
return new Date(`${value}Z`);
|
|
598
|
+
}
|
|
599
|
+
// Return the regular parsed date.
|
|
600
|
+
return new Date(value);
|
|
601
|
+
};
|
|
602
|
+
isToday = (date) => {
|
|
603
|
+
const today = new Date();
|
|
604
|
+
return date?.getDate() === today?.getDate() &&
|
|
605
|
+
date?.getMonth() === today?.getMonth() &&
|
|
606
|
+
date?.getFullYear() === today?.getFullYear();
|
|
607
|
+
};
|
|
608
|
+
isYesterday = (date) => {
|
|
609
|
+
const yesterday = new Date(new Date()?.setDate(new Date()?.getDate() - 1));
|
|
610
|
+
return date?.getDate() === yesterday?.getDate() &&
|
|
611
|
+
date?.getMonth() === yesterday?.getMonth() &&
|
|
612
|
+
date?.getFullYear() === yesterday?.getFullYear();
|
|
613
|
+
};
|
|
614
|
+
isTomorrow = (date) => {
|
|
615
|
+
const tomorrow = new Date(new Date()?.setDate(new Date()?.getDate() + 1));
|
|
616
|
+
return date?.getDate() === tomorrow?.getDate() &&
|
|
617
|
+
date?.getMonth() === tomorrow?.getMonth() &&
|
|
618
|
+
date?.getFullYear() === tomorrow?.getFullYear();
|
|
619
|
+
};
|
|
620
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbRelativeTime, deps: [{ token: LOCALE_ID }, { token: i1$2.Localize, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
621
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.1.0", ngImport: i0, type: BbRelativeTime, isStandalone: true, name: "bbRelativeTime" });
|
|
607
622
|
}
|
|
608
623
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbRelativeTime, decorators: [{
|
|
609
624
|
type: Pipe,
|
|
@@ -619,11 +634,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
619
634
|
}] }] });
|
|
620
635
|
|
|
621
636
|
class BbDate {
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
this._localeId = inject(LOCALE_ID);
|
|
626
|
-
}
|
|
637
|
+
// Dependencies.
|
|
638
|
+
_localize = inject(Localize, { optional: true });
|
|
639
|
+
_localeId = inject(LOCALE_ID);
|
|
627
640
|
transform(value, format) {
|
|
628
641
|
const date = parseDate(value);
|
|
629
642
|
if (date === null) {
|
|
@@ -632,8 +645,8 @@ class BbDate {
|
|
|
632
645
|
const locale = this._localize?.current?.locale ?? this._localeId ?? 'en-US';
|
|
633
646
|
return formatDate(date, format ?? 'mediumDate', locale);
|
|
634
647
|
}
|
|
635
|
-
static
|
|
636
|
-
static
|
|
648
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDate, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
649
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.1.0", ngImport: i0, type: BbDate, isStandalone: true, name: "bbDate" });
|
|
637
650
|
}
|
|
638
651
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDate, decorators: [{
|
|
639
652
|
type: Pipe,
|
|
@@ -644,14 +657,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
644
657
|
}] });
|
|
645
658
|
|
|
646
659
|
class BbSpinner {
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
}
|
|
653
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbSpinner, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
654
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.1.0", type: BbSpinner, isStandalone: true, selector: "bb-spinner", inputs: { color: "color", alt: "alt", disabled: ["disabled", "disabled", booleanAttribute] }, host: { classAttribute: "bb-spinner" }, ngImport: i0, template: "<!--\n The spinner element.\n\n This element contains a circle with a 25% bar that spins\n indefinitely. The border color can be set via the \"color\"\n property.\n-->\n<div class=\"bb-spinner-container\">\n <div [style.border-left-color]=\"color\"\n [class.disabled]=\"disabled\"\n class=\"bb-spinner-loader\"\n aria-live=\"assertive\"\n role=\"alert\">\n {{ alt }}\n </div>\n <ng-content select=\"img\"></ng-content>\n</div>\n\n<!--\n The content of the spinner.\n\n This element contains the content of the spinner. The user\n can set the content inside the tag.\n-->\n<span class=\"bb-spinner-content\">\n <ng-content></ng-content>\n</span>\n", styles: [".bb-spinner{padding:1.5rem 0;text-align:center;align-items:center;display:inline-flex;flex-direction:column;justify-content:center;color:#666}.bb-spinner.block{display:flex}.bb-spinner.inverse .bb-spinner-loader{border-color:#fff3}.bb-spinner.inverse .bb-spinner-content{color:#fff}.bb-spinner.small .bb-spinner-loader,.bb-spinner.small .bb-spinner-loader:after{width:1.5rem;height:1.5rem;min-width:1.5rem;min-height:1.5rem}.bb-spinner.small .bb-spinner-loader{border-width:.125rem}.bb-spinner.small .bb-spinner-content{font-size:.75rem}.bb-spinner.medium .bb-spinner-loader,.bb-spinner.medium .bb-spinner-loader:after{width:3rem;height:3rem;min-width:3rem;min-height:3rem}.bb-spinner.medium .bb-spinner-loader{border-width:.1875rem}.bb-spinner.medium .bb-spinner-content{font-size:.875rem}.bb-spinner.large .bb-spinner-loader,.bb-spinner.large .bb-spinner-loader:after{width:4.5rem;height:4.5rem;min-width:4.5rem;min-height:4.5rem}.bb-spinner.large .bb-spinner-loader{border-width:.25rem}.bb-spinner.large .bb-spinner-content{font-size:1rem}.bb-spinner.horizontal{text-align:left;flex-direction:row}.bb-spinner.horizontal .bb-spinner-content:not(:empty){margin-top:0;margin-left:.75rem}.bb-spinner.vertical{text-align:center;flex-direction:column}.bb-spinner.vertical .bb-spinner-content:not(:empty){margin-left:0;margin-top:.75rem}.bb-spinner-container{display:flex;position:relative}.bb-spinner-container>img{top:20%;left:20%;width:60%;height:60%;position:absolute}.bb-spinner-loader{margin:0;padding:0;overflow:hidden;text-indent:100%;color:transparent;position:relative;display:inline-block;vertical-align:middle;border:.1875rem solid #f2f4f6;animation:1s linear infinite spin}.bb-spinner-loader,.bb-spinner-loader:after{width:3rem;height:3rem;min-width:3rem;min-height:3rem;border-radius:50%}.bb-spinner-loader.disabled{cursor:default;-webkit-user-select:none;user-select:none;pointer-events:none;animation-play-state:paused}.bb-spinner-content:not(:empty){font-weight:400;font-size:.875rem;margin-top:.75rem}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
660
|
+
// Inputs.
|
|
661
|
+
color = 'hsla(212, 80%, 42%, 1)';
|
|
662
|
+
alt = 'Loading...';
|
|
663
|
+
disabled = false;
|
|
664
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbSpinner, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
665
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.1.0", type: BbSpinner, isStandalone: true, selector: "bb-spinner", inputs: { color: "color", alt: "alt", disabled: ["disabled", "disabled", booleanAttribute] }, host: { classAttribute: "bb-spinner" }, ngImport: i0, template: "<!--\n The spinner element.\n\n This element contains a circle with a 25% bar that spins\n indefinitely. The border color can be set via the \"color\"\n property.\n-->\n<div class=\"bb-spinner-container\">\n <div [style.border-left-color]=\"color\"\n [class.disabled]=\"disabled\"\n class=\"bb-spinner-loader\"\n aria-live=\"assertive\"\n role=\"alert\">\n {{ alt }}\n </div>\n <ng-content select=\"img\"></ng-content>\n</div>\n\n<!--\n The content of the spinner.\n\n This element contains the content of the spinner. The user\n can set the content inside the tag.\n-->\n<span class=\"bb-spinner-content\">\n <ng-content></ng-content>\n</span>\n", styles: [".bb-spinner{padding:1.5rem 0;text-align:center;align-items:center;display:inline-flex;flex-direction:column;justify-content:center;color:#666}.bb-spinner.block{display:flex}.bb-spinner.inverse .bb-spinner-loader{border-color:#fff3}.bb-spinner.inverse .bb-spinner-content{color:#fff}.bb-spinner.small .bb-spinner-loader,.bb-spinner.small .bb-spinner-loader:after{width:1.5rem;height:1.5rem;min-width:1.5rem;min-height:1.5rem}.bb-spinner.small .bb-spinner-loader{border-width:.125rem}.bb-spinner.small .bb-spinner-content{font-size:.75rem}.bb-spinner.medium .bb-spinner-loader,.bb-spinner.medium .bb-spinner-loader:after{width:3rem;height:3rem;min-width:3rem;min-height:3rem}.bb-spinner.medium .bb-spinner-loader{border-width:.1875rem}.bb-spinner.medium .bb-spinner-content{font-size:.875rem}.bb-spinner.large .bb-spinner-loader,.bb-spinner.large .bb-spinner-loader:after{width:4.5rem;height:4.5rem;min-width:4.5rem;min-height:4.5rem}.bb-spinner.large .bb-spinner-loader{border-width:.25rem}.bb-spinner.large .bb-spinner-content{font-size:1rem}.bb-spinner.horizontal{text-align:left;flex-direction:row}.bb-spinner.horizontal .bb-spinner-content:not(:empty){margin-top:0;margin-left:.75rem}.bb-spinner.vertical{text-align:center;flex-direction:column}.bb-spinner.vertical .bb-spinner-content:not(:empty){margin-left:0;margin-top:.75rem}.bb-spinner-container{display:flex;position:relative}.bb-spinner-container>img{top:20%;left:20%;width:60%;height:60%;position:absolute}.bb-spinner-loader{margin:0;padding:0;overflow:hidden;text-indent:100%;color:transparent;position:relative;display:inline-block;vertical-align:middle;border:.1875rem solid #f2f4f6;animation:1s linear infinite spin}.bb-spinner-loader,.bb-spinner-loader:after{width:3rem;height:3rem;min-width:3rem;min-height:3rem;border-radius:50%}.bb-spinner-loader.disabled{cursor:default;-webkit-user-select:none;user-select:none;pointer-events:none;animation-play-state:paused}.bb-spinner-content:not(:empty){font-weight:400;font-size:.875rem;margin-top:.75rem}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
655
666
|
}
|
|
656
667
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbSpinner, decorators: [{
|
|
657
668
|
type: Component,
|
|
@@ -666,18 +677,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
666
677
|
}] } });
|
|
667
678
|
|
|
668
679
|
class BbButton {
|
|
680
|
+
elementRef;
|
|
681
|
+
// Inputs.
|
|
682
|
+
disabled = false;
|
|
683
|
+
loading = false;
|
|
669
684
|
constructor(elementRef) {
|
|
670
685
|
this.elementRef = elementRef;
|
|
671
|
-
// Inputs.
|
|
672
|
-
this.disabled = false;
|
|
673
|
-
this.loading = false;
|
|
674
686
|
}
|
|
675
687
|
focus() {
|
|
676
688
|
const element = this.elementRef?.nativeElement ?? null;
|
|
677
689
|
element?.focus?.();
|
|
678
690
|
}
|
|
679
|
-
static
|
|
680
|
-
static
|
|
691
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbButton, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
692
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", type: BbButton, isStandalone: true, selector: "button[bb-button]", inputs: { disabled: ["disabled", "disabled", booleanAttribute], loading: ["loading", "loading", booleanAttribute] }, host: { properties: { "class.loading": "loading", "attr.disabled": "disabled || loading || null" }, classAttribute: "bb-button" }, exportAs: ["bbButton"], ngImport: i0, template: "@if (loading) {\n <bb-spinner class=\"bb-button-spinner small\"></bb-spinner>\n}\n\n<ng-content select=\"[prefix]\"></ng-content>\n<span class=\"bb-button-content\"><ng-content></ng-content></span>\n<ng-content select=\"[suffix]\"></ng-content>\n", styles: [".bb-button{height:2.5rem;cursor:pointer;font-size:1rem;max-width:100%;overflow:hidden;font-weight:400;padding:0 .5rem;-webkit-user-select:none;user-select:none;position:relative;font-style:normal;text-align:center;align-items:center;display:inline-flex;border-radius:.5rem;text-decoration:none;text-overflow:ellipsis;justify-content:center;transition-duration:.2s;border:1px solid transparent;background-color:transparent;transition-property:background-color,box-shadow;transition-timing-function:cubic-bezier(0,0,.2,1)}.bb-button,.bb-button:visited{color:var(--bb-button-color)}.bb-button:hover{background-color:var(--bb-button-hover-background-color)}.bb-button:focus{border-color:var(--bb-button-focus-border-color);box-shadow:var(--bb-button-focus-box-shadow)}.bb-button:active{background-color:var(--bb-button-active-background-color)}.bb-button.small{height:2rem;font-size:.875rem}.bb-button.large{height:3rem;font-size:1.125rem}.bb-button.full{width:100%}.bb-button.square{padding:0;width:2.5rem;min-width:2.5rem}.bb-button.square.small{width:2rem;min-width:2rem}.bb-button.square.large{width:3rem;min-width:3rem}.bb-button>[prefix]{margin-right:.25rem}.bb-button>[suffix]{margin-left:.25rem}.bb-button.secondary{border-color:var(--bb-button-secondary-border-color)}.bb-button.secondary,.bb-button.secondary:visited{color:var(--bb-button-secondary-color)}.bb-button.secondary:hover{background-color:var(--bb-button-secondary-hover-background-color)}.bb-button.secondary:focus{box-shadow:var(--bb-button-secondary-focus-box-shadow)}.bb-button.secondary:active{background-color:var(--bb-button-secondary-active-background-color)}.bb-button.primary{border-color:var(--bb-button-primary-border-color);background-color:var(--bb-button-primary-background-color)}.bb-button.primary,.bb-button.primary:visited{color:var(--bb-button-primary-color)}.bb-button.primary:hover{background-color:var(--bb-button-primary-hover-background-color)}.bb-button.primary:focus{box-shadow:var(--bb-button-primary-focus-box-shadow)}.bb-button.primary:active{background-color:var(--bb-button-primary-active-background-color)}.bb-button.destructive{border-color:var(--bb-button-destructive-border-color);background-color:var(--bb-button-destructive-background-color)}.bb-button.destructive,.bb-button.destructive:visited{color:var(--bb-button-destructive-color)}.bb-button.destructive:hover{background-color:var(--bb-button-destructive-hover-background-color)}.bb-button.destructive:focus{box-shadow:var(--bb-button-destructive-focus-box-shadow)}.bb-button.destructive:active{background-color:var(--bb-button-destructive-active-background-color)}.bb-button:disabled,.bb-button:disabled:focus,.bb-button:disabled:hover,.bb-button:disabled:active,.bb-button[disabled],.bb-button[disabled]:focus,.bb-button[disabled]:hover,.bb-button[disabled]:active,.bb-button.loading,.bb-button.loading:focus,.bb-button.loading:hover,.bb-button.loading:active{cursor:default;box-shadow:none;opacity:var(--bb-button-disabled-opacity)}.bb-button.loading>*:not(.bb-button-spinner){opacity:0}.bb-button>.bb-button-spinner{left:50%;padding:0;overflow:hidden;position:absolute;transform:translate(-50%)}.bb-button-content{max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"], dependencies: [{ kind: "component", type: BbSpinner, selector: "bb-spinner", inputs: ["color", "alt", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
681
693
|
}
|
|
682
694
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbButton, decorators: [{
|
|
683
695
|
type: Component,
|
|
@@ -694,11 +706,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
694
706
|
args: [{ transform: booleanAttribute }]
|
|
695
707
|
}] } });
|
|
696
708
|
class BbAnchor extends BbButton {
|
|
709
|
+
elementRef;
|
|
710
|
+
// Inputs.
|
|
711
|
+
tabIndex = null;
|
|
697
712
|
constructor(elementRef) {
|
|
698
713
|
super(elementRef);
|
|
699
714
|
this.elementRef = elementRef;
|
|
700
|
-
// Inputs.
|
|
701
|
-
this.tabIndex = null;
|
|
702
715
|
}
|
|
703
716
|
stopDisabledEvents(event) {
|
|
704
717
|
// If the button is not disabled (and not loading) let all events pass.
|
|
@@ -710,8 +723,8 @@ class BbAnchor extends BbButton {
|
|
|
710
723
|
event.preventDefault();
|
|
711
724
|
event.stopImmediatePropagation();
|
|
712
725
|
}
|
|
713
|
-
static
|
|
714
|
-
static
|
|
726
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbAnchor, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
727
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", type: BbAnchor, isStandalone: true, selector: "a[bb-button]", inputs: { tabIndex: "tabIndex" }, host: { listeners: { "click": "stopDisabledEvents($event)" }, properties: { "attr.tabindex": "(disabled || loading) ? -1 : (tabIndex || 0)", "attr.disabled": "disabled || loading || null", "attr.aria-disabled": "(disabled || loading).toString()" }, classAttribute: "bb-button" }, exportAs: ["bbButton", "bbAnchor"], usesInheritance: true, ngImport: i0, template: "@if (loading) {\n <bb-spinner class=\"bb-button-spinner small\"></bb-spinner>\n}\n\n<ng-content select=\"[prefix]\"></ng-content>\n<span class=\"bb-button-content\"><ng-content></ng-content></span>\n<ng-content select=\"[suffix]\"></ng-content>\n", styles: [".bb-button{height:2.5rem;cursor:pointer;font-size:1rem;max-width:100%;overflow:hidden;font-weight:400;padding:0 .5rem;-webkit-user-select:none;user-select:none;position:relative;font-style:normal;text-align:center;align-items:center;display:inline-flex;border-radius:.5rem;text-decoration:none;text-overflow:ellipsis;justify-content:center;transition-duration:.2s;border:1px solid transparent;background-color:transparent;transition-property:background-color,box-shadow;transition-timing-function:cubic-bezier(0,0,.2,1)}.bb-button,.bb-button:visited{color:var(--bb-button-color)}.bb-button:hover{background-color:var(--bb-button-hover-background-color)}.bb-button:focus{border-color:var(--bb-button-focus-border-color);box-shadow:var(--bb-button-focus-box-shadow)}.bb-button:active{background-color:var(--bb-button-active-background-color)}.bb-button.small{height:2rem;font-size:.875rem}.bb-button.large{height:3rem;font-size:1.125rem}.bb-button.full{width:100%}.bb-button.square{padding:0;width:2.5rem;min-width:2.5rem}.bb-button.square.small{width:2rem;min-width:2rem}.bb-button.square.large{width:3rem;min-width:3rem}.bb-button>[prefix]{margin-right:.25rem}.bb-button>[suffix]{margin-left:.25rem}.bb-button.secondary{border-color:var(--bb-button-secondary-border-color)}.bb-button.secondary,.bb-button.secondary:visited{color:var(--bb-button-secondary-color)}.bb-button.secondary:hover{background-color:var(--bb-button-secondary-hover-background-color)}.bb-button.secondary:focus{box-shadow:var(--bb-button-secondary-focus-box-shadow)}.bb-button.secondary:active{background-color:var(--bb-button-secondary-active-background-color)}.bb-button.primary{border-color:var(--bb-button-primary-border-color);background-color:var(--bb-button-primary-background-color)}.bb-button.primary,.bb-button.primary:visited{color:var(--bb-button-primary-color)}.bb-button.primary:hover{background-color:var(--bb-button-primary-hover-background-color)}.bb-button.primary:focus{box-shadow:var(--bb-button-primary-focus-box-shadow)}.bb-button.primary:active{background-color:var(--bb-button-primary-active-background-color)}.bb-button.destructive{border-color:var(--bb-button-destructive-border-color);background-color:var(--bb-button-destructive-background-color)}.bb-button.destructive,.bb-button.destructive:visited{color:var(--bb-button-destructive-color)}.bb-button.destructive:hover{background-color:var(--bb-button-destructive-hover-background-color)}.bb-button.destructive:focus{box-shadow:var(--bb-button-destructive-focus-box-shadow)}.bb-button.destructive:active{background-color:var(--bb-button-destructive-active-background-color)}.bb-button:disabled,.bb-button:disabled:focus,.bb-button:disabled:hover,.bb-button:disabled:active,.bb-button[disabled],.bb-button[disabled]:focus,.bb-button[disabled]:hover,.bb-button[disabled]:active,.bb-button.loading,.bb-button.loading:focus,.bb-button.loading:hover,.bb-button.loading:active{cursor:default;box-shadow:none;opacity:var(--bb-button-disabled-opacity)}.bb-button.loading>*:not(.bb-button-spinner){opacity:0}.bb-button>.bb-button-spinner{left:50%;padding:0;overflow:hidden;position:absolute;transform:translate(-50%)}.bb-button-content{max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"], dependencies: [{ kind: "component", type: BbSpinner, selector: "bb-spinner", inputs: ["color", "alt", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
715
728
|
}
|
|
716
729
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbAnchor, decorators: [{
|
|
717
730
|
type: Component,
|
|
@@ -729,6 +742,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
729
742
|
}] } });
|
|
730
743
|
|
|
731
744
|
class BbIcon {
|
|
745
|
+
_registry;
|
|
746
|
+
// Data.
|
|
747
|
+
_src = null;
|
|
748
|
+
// State.
|
|
749
|
+
state$ = new BehaviorSubject(null);
|
|
750
|
+
alt = null;
|
|
751
|
+
size = 1.5;
|
|
752
|
+
ariaHidden = true;
|
|
732
753
|
set src(newValue) {
|
|
733
754
|
this.state$.next(this.convert(newValue));
|
|
734
755
|
this._src = newValue;
|
|
@@ -738,16 +759,6 @@ class BbIcon {
|
|
|
738
759
|
}
|
|
739
760
|
constructor(_registry) {
|
|
740
761
|
this._registry = _registry;
|
|
741
|
-
// Data.
|
|
742
|
-
this._src = null;
|
|
743
|
-
// State.
|
|
744
|
-
this.state$ = new BehaviorSubject(null);
|
|
745
|
-
this.alt = null;
|
|
746
|
-
this.size = 1.5;
|
|
747
|
-
this.ariaHidden = true;
|
|
748
|
-
this.warn = (content) => {
|
|
749
|
-
return console && console.warn && console.warn(content);
|
|
750
|
-
};
|
|
751
762
|
}
|
|
752
763
|
convert(src) {
|
|
753
764
|
const [namespace, value] = (src || '').split(':');
|
|
@@ -789,8 +800,11 @@ class BbIcon {
|
|
|
789
800
|
}
|
|
790
801
|
return { type: data['type'], className: data['className'], content };
|
|
791
802
|
}
|
|
792
|
-
|
|
793
|
-
|
|
803
|
+
warn = (content) => {
|
|
804
|
+
return console && console.warn && console.warn(content);
|
|
805
|
+
};
|
|
806
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbIcon, deps: [{ token: ELEMENTS_ICONS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
807
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", type: BbIcon, isStandalone: true, selector: "bb-icon", inputs: { alt: "alt", size: ["size", "size", numberAttribute], ariaHidden: ["ariaHidden", "ariaHidden", booleanAttribute], src: "src" }, host: { properties: { "attr.aria-hidden": "ariaHidden", "style.width.rem": "size", "style.height.rem": "size", "style.min-width.rem": "size", "style.min-height.rem": "size", "style.font-size.rem": "size" }, classAttribute: "bb-icon" }, ngImport: i0, template: "@if (state$ | async; as data) {\n @switch (data?.type) {\n @case ('font') {\n <i [attr.data-icon]=\"data?.attribute\"\n [class]=\"data?.className\">\n {{ data?.content }}\n </i>\n }\n @case ('image') {\n <img [src]=\"data?.src\"\n [alt]=\"alt\">\n }\n @default {\n <svg viewBox=\"0 0 1 1\">\n <rect x=\"0\" y=\"0\" width=\"1\" height=\"1\" fill=\"#c5c5c5\"></rect>\n </svg>\n }\n }\n}\n", styles: [".bb-icon{display:flex;-webkit-user-select:none;user-select:none;align-items:center;justify-content:center}.bb-icon>i{font-size:inherit}.bb-icon>img,.bb-icon>svg{width:100%;height:100%;display:flex}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
794
808
|
}
|
|
795
809
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbIcon, decorators: [{
|
|
796
810
|
type: Component,
|
|
@@ -821,12 +835,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
821
835
|
}] } });
|
|
822
836
|
|
|
823
837
|
class BbFormGroup {
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
}
|
|
828
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFormGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
829
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.1.0", type: BbFormGroup, isStandalone: true, selector: "bb-form-group", inputs: { grouped: ["grouped", "grouped", booleanAttribute] }, host: { properties: { "class.grouped": "grouped" }, classAttribute: "bb-form-group" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [".bb-form-group{width:100%;display:flex;flex-wrap:wrap;margin-top:-.75rem}.bb-form-group>*{margin-top:.75rem}.bb-form-group>*:not(:first-child){margin-left:.75rem}.bb-form-group.start{justify-content:flex-start}.bb-form-group.end{justify-content:flex-end}.bb-form-group.vertical{flex-direction:column;justify-content:normal}.bb-form-group.vertical>*{margin-left:0}.bb-form-group.vertical.start{align-items:flex-start}.bb-form-group.vertical.end{align-items:flex-end}.bb-form-group.grouped{margin-bottom:1.5rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
838
|
+
// Inputs.
|
|
839
|
+
grouped = false;
|
|
840
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFormGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
841
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.1.0", type: BbFormGroup, isStandalone: true, selector: "bb-form-group", inputs: { grouped: ["grouped", "grouped", booleanAttribute] }, host: { properties: { "class.grouped": "grouped" }, classAttribute: "bb-form-group" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [".bb-form-group{width:100%;display:flex;flex-wrap:wrap;margin-top:-.75rem}.bb-form-group>*{margin-top:.75rem}.bb-form-group>*:not(:first-child){margin-left:.75rem}.bb-form-group.start{justify-content:flex-start}.bb-form-group.end{justify-content:flex-end}.bb-form-group.vertical{flex-direction:column;justify-content:normal}.bb-form-group.vertical>*{margin-left:0}.bb-form-group.vertical.start{align-items:flex-start}.bb-form-group.vertical.end{align-items:flex-end}.bb-form-group.grouped{margin-bottom:1.5rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
830
842
|
}
|
|
831
843
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFormGroup, decorators: [{
|
|
832
844
|
type: Component,
|
|
@@ -841,22 +853,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
841
853
|
|
|
842
854
|
let nextUniqueId$2 = 0;
|
|
843
855
|
class BbCheckbox {
|
|
856
|
+
_renderer;
|
|
857
|
+
_changeDetectorRef;
|
|
858
|
+
// Data.
|
|
859
|
+
labelId = `bb-checkbox-${nextUniqueId$2++}`;
|
|
860
|
+
// Views.
|
|
861
|
+
inputElementRef;
|
|
862
|
+
// Inputs.
|
|
863
|
+
checked = false;
|
|
864
|
+
indeterminate = false;
|
|
865
|
+
disabled = false;
|
|
866
|
+
grouped = false;
|
|
867
|
+
// Outputs.
|
|
868
|
+
checkedChange = new EventEmitter();
|
|
869
|
+
indeterminateChange = new EventEmitter();
|
|
870
|
+
// Callbacks.
|
|
871
|
+
onTouchedCallback = () => ({});
|
|
872
|
+
onChangeCallback = () => ({});
|
|
844
873
|
constructor(_renderer, _changeDetectorRef) {
|
|
845
874
|
this._renderer = _renderer;
|
|
846
875
|
this._changeDetectorRef = _changeDetectorRef;
|
|
847
|
-
// Data.
|
|
848
|
-
this.labelId = `bb-checkbox-${nextUniqueId$2++}`;
|
|
849
|
-
// Inputs.
|
|
850
|
-
this.checked = false;
|
|
851
|
-
this.indeterminate = false;
|
|
852
|
-
this.disabled = false;
|
|
853
|
-
this.grouped = false;
|
|
854
|
-
// Outputs.
|
|
855
|
-
this.checkedChange = new EventEmitter();
|
|
856
|
-
this.indeterminateChange = new EventEmitter();
|
|
857
|
-
// Callbacks.
|
|
858
|
-
this.onTouchedCallback = () => ({});
|
|
859
|
-
this.onChangeCallback = () => ({});
|
|
860
876
|
}
|
|
861
877
|
ngAfterViewInit() {
|
|
862
878
|
this.syncField('indeterminate', this.indeterminate);
|
|
@@ -912,10 +928,10 @@ class BbCheckbox {
|
|
|
912
928
|
}
|
|
913
929
|
this._renderer.setProperty(element, field, value);
|
|
914
930
|
}
|
|
915
|
-
static
|
|
916
|
-
static
|
|
931
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbCheckbox, deps: [{ token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
932
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.1.0", type: BbCheckbox, isStandalone: true, selector: "bb-checkbox", inputs: { checked: ["checked", "checked", booleanAttribute], indeterminate: ["indeterminate", "indeterminate", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute], grouped: ["grouped", "grouped", booleanAttribute] }, outputs: { checkedChange: "checkedChange", indeterminateChange: "indeterminateChange" }, host: { properties: { "class.indeterminate": "indeterminate", "class.disabled": "disabled", "class.grouped": "grouped" }, classAttribute: "bb-checkbox" }, providers: [
|
|
917
933
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbCheckbox), multi: true }
|
|
918
|
-
], viewQueries: [{ propertyName: "inputElementRef", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: "<input #input\n [id]=\"labelId\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n (change)=\"onChangeEvent($event)\"\n (click)=\"onClickEvent($event)\"\n (blur)=\"onTouchedCallback()\"\n class=\"bb-checkbox-input\"\n tabindex=\"-1\"\n type=\"checkbox\">\n\n<label [for]=\"labelId\"\n [attr.tabindex]=\"disabled ? -1 : 0\"\n (keyup.space)=\"onClickEvent($event)\"\n class=\"bb-checkbox-label\">\n <span class=\"bb-checkbox-area\">\n <svg width=\"68%\"\n height=\"68%\"\n viewBox=\"0 0 12 12\">\n <polyline [attr.points]=\"indeterminate ? '1 6 11 6' : '1.5 7 4.5 10 10.5 2'\"></polyline>\n </svg>\n </span>\n <span class=\"bb-checkbox-content\">\n <ng-content></ng-content>\n </span>\n</label>\n", styles: [".bb-checkbox{display:block}.bb-checkbox.grouped{margin-bottom:1.5rem}.bb-checkbox-input{display:none}.bb-checkbox-label{margin:0;display:flex;cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center}.bb-checkbox-label>span{display:inline-block;vertical-align:middle;transform:translateZ(0)}.bb-checkbox-area{width:1.25rem;height:1.25rem;position:relative;min-width:1.25rem;min-height:1.25rem;border-radius:.25rem;vertical-align:middle;transition-duration:.2s;border:1px solid hsl(213,8%,74%);transition-timing-function:cubic-bezier(0,0,.2,1);box-shadow:0 .375rem .375rem -.375rem #0000001a;transition-property:stroke-dashoffset,box-shadow,border-color,background-color}.bb-checkbox-area>svg{top:16%;left:16%;fill:none;stroke:#fff;stroke-width:2;position:absolute;stroke-linecap:round;transition-delay:.1s;stroke-linejoin:round;stroke-dasharray:1rem;stroke-dashoffset:1rem;transition:all .3s ease;transform:translateZ(0)}.bb-checkbox-content{font-size:1rem;font-weight:400;padding-left:.5rem;color:#121212}.bb-checkbox-content>small{display:block;line-height:1.5;font-size:.8125rem;margin-top:.125rem;color:#758795}.bb-checkbox-input:not(:disabled)+.bb-checkbox-label:focus>.bb-checkbox-area{box-shadow:0 .375rem .375rem -.375rem #0000001a,0 0 0 .1875rem var(--bb-checkbox-outline-color)}.bb-checkbox-input:checked+.bb-checkbox-label>.bb-checkbox-area,.bb-checkbox.indeterminate>.bb-checkbox-label>.bb-checkbox-area{border-color:var(--bb-checkbox-border-color);background-color:var(--bb-checkbox-background-color)}.bb-checkbox-input:checked+.bb-checkbox-label>.bb-checkbox-area>svg,.bb-checkbox.indeterminate>.bb-checkbox-label>.bb-checkbox-area>svg{stroke-dashoffset:0}.bb-checkbox.disabled>.bb-checkbox-label{cursor:default;pointer-events:none}.bb-checkbox.disabled>.bb-checkbox-input:checked+.bb-checkbox-label>.bb-checkbox-area,.bb-checkbox.indeterminate.disabled>.bb-checkbox-input+.bb-checkbox-label>.bb-checkbox-area{border-color:#b7bcc2;background-color:#e6e6e6}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
934
|
+
], viewQueries: [{ propertyName: "inputElementRef", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: "<input #input\n [id]=\"labelId\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n (change)=\"onChangeEvent($event)\"\n (click)=\"onClickEvent($event)\"\n (blur)=\"onTouchedCallback()\"\n class=\"bb-checkbox-input\"\n tabindex=\"-1\"\n type=\"checkbox\">\n\n<label [for]=\"labelId\"\n [attr.tabindex]=\"disabled ? -1 : 0\"\n (keyup.space)=\"onClickEvent($event)\"\n class=\"bb-checkbox-label\">\n <span class=\"bb-checkbox-area\">\n <svg width=\"68%\"\n height=\"68%\"\n viewBox=\"0 0 12 12\">\n <polyline [attr.points]=\"indeterminate ? '1 6 11 6' : '1.5 7 4.5 10 10.5 2'\"></polyline>\n </svg>\n </span>\n <span class=\"bb-checkbox-content\">\n <ng-content></ng-content>\n </span>\n</label>\n", styles: [".bb-checkbox{display:block}.bb-checkbox.grouped{margin-bottom:1.5rem}.bb-checkbox-input{display:none}.bb-checkbox-label{margin:0;display:flex;cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center}.bb-checkbox-label>span{display:inline-block;vertical-align:middle;transform:translateZ(0)}.bb-checkbox-area{width:1.25rem;height:1.25rem;position:relative;min-width:1.25rem;min-height:1.25rem;border-radius:.25rem;vertical-align:middle;transition-duration:.2s;border:1px solid hsl(213,8%,74%);transition-timing-function:cubic-bezier(0,0,.2,1);box-shadow:0 .375rem .375rem -.375rem #0000001a;transition-property:stroke-dashoffset,box-shadow,border-color,background-color}.bb-checkbox-area>svg{top:16%;left:16%;fill:none;stroke:#fff;stroke-width:2;position:absolute;stroke-linecap:round;transition-delay:.1s;stroke-linejoin:round;stroke-dasharray:1rem;stroke-dashoffset:1rem;transition:all .3s ease;transform:translateZ(0)}.bb-checkbox-content{font-size:1rem;font-weight:400;padding-left:.5rem;color:#121212}.bb-checkbox-content>small{display:block;line-height:1.5;font-size:.8125rem;margin-top:.125rem;color:#758795}.bb-checkbox-input:not(:disabled)+.bb-checkbox-label:focus>.bb-checkbox-area{box-shadow:0 .375rem .375rem -.375rem #0000001a,0 0 0 .1875rem var(--bb-checkbox-outline-color)}.bb-checkbox-input:checked+.bb-checkbox-label>.bb-checkbox-area,.bb-checkbox.indeterminate>.bb-checkbox-label>.bb-checkbox-area{border-color:var(--bb-checkbox-border-color);background-color:var(--bb-checkbox-background-color)}.bb-checkbox-input:checked+.bb-checkbox-label>.bb-checkbox-area>svg,.bb-checkbox.indeterminate>.bb-checkbox-label>.bb-checkbox-area>svg{stroke-dashoffset:0}.bb-checkbox.disabled>.bb-checkbox-label{cursor:default;pointer-events:none}.bb-checkbox.disabled>.bb-checkbox-input:checked+.bb-checkbox-label>.bb-checkbox-area,.bb-checkbox.indeterminate.disabled>.bb-checkbox-input+.bb-checkbox-label>.bb-checkbox-area{border-color:#b7bcc2;background-color:#e6e6e6}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
919
935
|
}
|
|
920
936
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbCheckbox, decorators: [{
|
|
921
937
|
type: Component,
|
|
@@ -949,15 +965,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
949
965
|
}] } });
|
|
950
966
|
|
|
951
967
|
class BbCheckboxGroup {
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
}
|
|
959
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbCheckboxGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
960
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", type: BbCheckboxGroup, isStandalone: true, selector: "bb-checkbox-group", inputs: { label: "label", required: ["required", "required", booleanAttribute], grouped: ["grouped", "grouped", booleanAttribute], inline: ["inline", "inline", booleanAttribute] }, host: { properties: { "class.grouped": "grouped", "class.required": "required", "class.inline": "inline" }, classAttribute: "bb-checkbox-group" }, ngImport: i0, template: "@if (label; as labelContent) {\n <label class=\"bb-checkbox-group-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n </label>\n}\n\n<div class=\"bb-checkbox-group-items\">\n <ng-content select=\"bb-checkbox\"></ng-content>\n</div>\n", styles: [".bb-checkbox-group{display:block}.bb-checkbox-group.grouped{margin-bottom:1.5rem}.bb-checkbox-group.required>.bb-checkbox-group-label:after{content:\"*\";font-size:.75rem;vertical-align:top;color:var(--bb-form-label-required-color)}.bb-checkbox-group-label{display:block;margin-bottom:.25rem;color:var(--bb-form-label-color, #525252);font-weight:var(--bb-form-label-font-weight, 400);font-size:var(--bb-form-label-font-size, .875rem)}.bb-checkbox-group-items{display:flex;flex-direction:column}.bb-checkbox-group-items:not(:empty){margin-bottom:.25rem}.bb-checkbox-group-items>*{margin-bottom:.25rem}@media only screen and (min-width: 768px){.bb-checkbox-group.inline>.bb-checkbox-group-items{flex-wrap:wrap;flex-direction:row}.bb-checkbox-group.inline>.bb-checkbox-group-items>*:not(:last-child){margin-right:.75rem}}\n"], dependencies: [{ kind: "directive", type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
968
|
+
// Inputs.
|
|
969
|
+
label = null;
|
|
970
|
+
required = false;
|
|
971
|
+
grouped = false;
|
|
972
|
+
inline = false;
|
|
973
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbCheckboxGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
974
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", type: BbCheckboxGroup, isStandalone: true, selector: "bb-checkbox-group", inputs: { label: "label", required: ["required", "required", booleanAttribute], grouped: ["grouped", "grouped", booleanAttribute], inline: ["inline", "inline", booleanAttribute] }, host: { properties: { "class.grouped": "grouped", "class.required": "required", "class.inline": "inline" }, classAttribute: "bb-checkbox-group" }, ngImport: i0, template: "@if (label; as labelContent) {\n <label class=\"bb-checkbox-group-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n </label>\n}\n\n<div class=\"bb-checkbox-group-items\">\n <ng-content select=\"bb-checkbox\"></ng-content>\n</div>\n", styles: [".bb-checkbox-group{display:block}.bb-checkbox-group.grouped{margin-bottom:1.5rem}.bb-checkbox-group.required>.bb-checkbox-group-label:after{content:\"*\";font-size:.75rem;vertical-align:top;color:var(--bb-form-label-required-color)}.bb-checkbox-group-label{display:block;margin-bottom:.25rem;color:var(--bb-form-label-color, #525252);font-weight:var(--bb-form-label-font-weight, 400);font-size:var(--bb-form-label-font-size, .875rem)}.bb-checkbox-group-items{display:flex;flex-direction:column}.bb-checkbox-group-items:not(:empty){margin-bottom:.25rem}.bb-checkbox-group-items>*{margin-bottom:.25rem}@media only screen and (min-width: 768px){.bb-checkbox-group.inline>.bb-checkbox-group-items{flex-wrap:wrap;flex-direction:row}.bb-checkbox-group.inline>.bb-checkbox-group-items>*:not(:last-child){margin-right:.75rem}}\n"], dependencies: [{ kind: "directive", type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
961
975
|
}
|
|
962
976
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbCheckboxGroup, decorators: [{
|
|
963
977
|
type: Component,
|
|
@@ -981,6 +995,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
981
995
|
}] } });
|
|
982
996
|
|
|
983
997
|
class BbRadioGroup {
|
|
998
|
+
_changeDetectorRef;
|
|
999
|
+
// Inputs.
|
|
1000
|
+
label = null;
|
|
1001
|
+
disabled = false;
|
|
1002
|
+
readonly = false;
|
|
1003
|
+
required = false;
|
|
1004
|
+
grouped = false;
|
|
1005
|
+
inline = false;
|
|
1006
|
+
hideErrors = false;
|
|
1007
|
+
// Outputs.
|
|
1008
|
+
valueChange = new EventEmitter();
|
|
984
1009
|
// Value.
|
|
985
1010
|
get value() {
|
|
986
1011
|
return this._value;
|
|
@@ -989,24 +1014,14 @@ class BbRadioGroup {
|
|
|
989
1014
|
this._value = value;
|
|
990
1015
|
this._changeDetectorRef.markForCheck();
|
|
991
1016
|
}
|
|
1017
|
+
_value = null;
|
|
1018
|
+
// Callbacks.
|
|
1019
|
+
onTouchedCallback = () => ({});
|
|
1020
|
+
onChangeCallback = () => ({});
|
|
1021
|
+
// State.
|
|
1022
|
+
error = false;
|
|
992
1023
|
constructor(_changeDetectorRef) {
|
|
993
1024
|
this._changeDetectorRef = _changeDetectorRef;
|
|
994
|
-
// Inputs.
|
|
995
|
-
this.label = null;
|
|
996
|
-
this.disabled = false;
|
|
997
|
-
this.readonly = false;
|
|
998
|
-
this.required = false;
|
|
999
|
-
this.grouped = false;
|
|
1000
|
-
this.inline = false;
|
|
1001
|
-
this.hideErrors = false;
|
|
1002
|
-
// Outputs.
|
|
1003
|
-
this.valueChange = new EventEmitter();
|
|
1004
|
-
this._value = null;
|
|
1005
|
-
// Callbacks.
|
|
1006
|
-
this.onTouchedCallback = () => ({});
|
|
1007
|
-
this.onChangeCallback = () => ({});
|
|
1008
|
-
// State.
|
|
1009
|
-
this.error = false;
|
|
1010
1025
|
}
|
|
1011
1026
|
select(value) {
|
|
1012
1027
|
if (this.value === value || this.disabled || this.readonly) {
|
|
@@ -1032,10 +1047,10 @@ class BbRadioGroup {
|
|
|
1032
1047
|
onErrorChange(error) {
|
|
1033
1048
|
this.error = !!error;
|
|
1034
1049
|
}
|
|
1035
|
-
static
|
|
1036
|
-
static
|
|
1050
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbRadioGroup, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1051
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", type: BbRadioGroup, isStandalone: true, selector: "bb-radio-group", inputs: { label: "label", disabled: ["disabled", "disabled", booleanAttribute], readonly: ["readonly", "readonly", booleanAttribute], required: ["required", "required", booleanAttribute], grouped: ["grouped", "grouped", booleanAttribute], inline: ["inline", "inline", booleanAttribute], hideErrors: ["hideErrors", "hideErrors", booleanAttribute], value: "value" }, outputs: { valueChange: "valueChange" }, host: { properties: { "class.disabled": "disabled", "class.readonly": "readonly", "class.grouped": "grouped", "class.required": "required", "class.inline": "inline", "class.error": "error" }, classAttribute: "bb-radio-group" }, providers: [
|
|
1037
1052
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbRadioGroup), multi: true }
|
|
1038
|
-
], ngImport: i0, template: "@if (label; as labelContent) {\n <label class=\"bb-radio-group-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n </label>\n}\n\n<div class=\"bb-radio-group-items\">\n <ng-content select=\"bb-radio-button\"></ng-content>\n</div>\n\n<!-- The error component. -->\n@if (!hideErrors) {\n <bb-form-error (errorChange)=\"onErrorChange($event)\"></bb-form-error>\n}\n", styles: [".bb-radio-group{display:block}.bb-radio-group.grouped{margin-bottom:1.5rem}.bb-radio-group.readonly{pointer-events:none}.bb-radio-group.error>.bb-radio-group-label{color:#c23934}.bb-radio-group.required>.bb-radio-group-label:after{content:\"*\";font-size:.75rem;vertical-align:top;color:var(--bb-form-label-required-color)}.bb-radio-group-label{display:block;margin-bottom:.25rem;color:var(--bb-form-label-color, #525252);font-weight:var(--bb-form-label-font-weight, 400);font-size:var(--bb-form-label-font-size, .875rem)}.bb-radio-group-items{display:flex;flex-direction:column}.bb-radio-group-items:not(:empty){margin-bottom:.25rem}.bb-radio-group-items>*{margin-bottom:.25rem}@media only screen and (min-width: 768px){.bb-radio-group.inline>.bb-radio-group-items{flex-wrap:wrap;flex-direction:row}.bb-radio-group.inline>.bb-radio-group-items>*:not(:last-child){margin-right:.75rem}}\n"], dependencies: [{ kind: "directive", type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }, { kind: "component", type: BbFormError, selector: "bb-form-error", inputs: ["control"], outputs: ["errorChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1053
|
+
], ngImport: i0, template: "@if (label; as labelContent) {\n <label class=\"bb-radio-group-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n </label>\n}\n\n<div class=\"bb-radio-group-items\">\n <ng-content select=\"bb-radio-button\"></ng-content>\n</div>\n\n<!-- The error component. -->\n@if (!hideErrors) {\n <bb-form-error (errorChange)=\"onErrorChange($event)\"></bb-form-error>\n}\n", styles: [".bb-radio-group{display:block}.bb-radio-group.grouped{margin-bottom:1.5rem}.bb-radio-group.readonly{pointer-events:none}.bb-radio-group.error>.bb-radio-group-label{color:#c23934}.bb-radio-group.required>.bb-radio-group-label:after{content:\"*\";font-size:.75rem;vertical-align:top;color:var(--bb-form-label-required-color)}.bb-radio-group-label{display:block;margin-bottom:.25rem;color:var(--bb-form-label-color, #525252);font-weight:var(--bb-form-label-font-weight, 400);font-size:var(--bb-form-label-font-size, .875rem)}.bb-radio-group-items{display:flex;flex-direction:column}.bb-radio-group-items:not(:empty){margin-bottom:.25rem}.bb-radio-group-items>*{margin-bottom:.25rem}@media only screen and (min-width: 768px){.bb-radio-group.inline>.bb-radio-group-items{flex-wrap:wrap;flex-direction:row}.bb-radio-group.inline>.bb-radio-group-items>*:not(:last-child){margin-right:.75rem}}\n"], dependencies: [{ kind: "directive", type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }, { kind: "component", type: BbFormError, selector: "bb-form-error", inputs: ["control"], outputs: ["errorChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1039
1054
|
}
|
|
1040
1055
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbRadioGroup, decorators: [{
|
|
1041
1056
|
type: Component,
|
|
@@ -1077,6 +1092,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
1077
1092
|
}] } });
|
|
1078
1093
|
|
|
1079
1094
|
class BbRadioButton {
|
|
1095
|
+
_radioGroup;
|
|
1096
|
+
// Inputs.
|
|
1097
|
+
value = null;
|
|
1098
|
+
hideText = false;
|
|
1080
1099
|
// Disabled.
|
|
1081
1100
|
set disabled(value) {
|
|
1082
1101
|
this._disabled = value;
|
|
@@ -1084,6 +1103,7 @@ class BbRadioButton {
|
|
|
1084
1103
|
get disabled() {
|
|
1085
1104
|
return this._radioGroup?.disabled || this._disabled;
|
|
1086
1105
|
}
|
|
1106
|
+
_disabled = false;
|
|
1087
1107
|
onClick() {
|
|
1088
1108
|
if (this.disabled) {
|
|
1089
1109
|
return;
|
|
@@ -1098,13 +1118,9 @@ class BbRadioButton {
|
|
|
1098
1118
|
}
|
|
1099
1119
|
constructor(_radioGroup) {
|
|
1100
1120
|
this._radioGroup = _radioGroup;
|
|
1101
|
-
// Inputs.
|
|
1102
|
-
this.value = null;
|
|
1103
|
-
this.hideText = false;
|
|
1104
|
-
this._disabled = false;
|
|
1105
1121
|
}
|
|
1106
|
-
static
|
|
1107
|
-
static
|
|
1122
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbRadioButton, deps: [{ token: BbRadioGroup }], target: i0.ɵɵFactoryTarget.Component });
|
|
1123
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", type: BbRadioButton, isStandalone: true, selector: "bb-radio-button", inputs: { value: "value", hideText: ["hideText", "hideText", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute] }, host: { listeners: { "click": "onClick()", "keydown.space": "onSpacePressed()" }, properties: { "class.disabled": "disabled", "tabindex": "disabled ? -1 : 0", "class.selected": "this.selected" }, classAttribute: "bb-radio-button" }, ngImport: i0, template: "<div class=\"bb-radio-button-indicator\"></div>\n@if (!hideText) {\n <span class=\"bb-radio-button-text\"><ng-content></ng-content></span>\n}\n\n", styles: [".bb-radio-button{display:flex;cursor:pointer;align-items:center}.bb-radio-button:not(.disabled):focus>.bb-radio-button-indicator{box-shadow:0 .375rem .375rem -.375rem #0000001a,0 0 0 .1875rem var(--bb-radio-outline-color)}.bb-radio-button.selected>.bb-radio-button-indicator{border-color:var(--bb-radio-border-color)}.bb-radio-button.selected>.bb-radio-button-indicator:after{opacity:1;transform:none}.bb-radio-button.disabled{-webkit-user-select:none;user-select:none}.bb-radio-button.disabled>.bb-radio-button-indicator{border-color:gray}.bb-radio-button.disabled>.bb-radio-button-indicator:after{background-color:gray}.bb-radio-button.disabled>.bb-radio-button-text{color:gray}.bb-radio-button-indicator{display:flex;width:1.25rem;height:1.25rem;min-width:1.25rem;border-radius:50%;min-height:1.25rem;align-items:center;justify-content:center;border:1px solid hsl(213,8%,74%);transition:box-shadow .25s cubic-bezier(0,0,.2,1),border-color .25s cubic-bezier(0,0,.2,1);box-shadow:0 .375rem .375rem -.375rem #0000001a}.bb-radio-button-indicator:after{opacity:0;content:\"\";display:block;border-radius:50%;transform:scale(0);width:.625rem;height:.625rem;background-color:var(--bb-radio-indicator-color);transition:transform .12s cubic-bezier(0,0,.2,1),opacity .12s cubic-bezier(0,0,.2,1)}.bb-radio-button-text{color:#111;font-size:1rem;font-weight:400;padding-left:.5rem}.bb-radio-button-text>small{display:block;line-height:1.5;font-size:.8125rem;margin-top:.125rem;color:#758795}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1108
1124
|
}
|
|
1109
1125
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbRadioButton, decorators: [{
|
|
1110
1126
|
type: Component,
|
|
@@ -1133,80 +1149,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
1133
1149
|
}] } });
|
|
1134
1150
|
|
|
1135
1151
|
class BbAvatar {
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
this._backgroundColor = 'rgb(66, 66, 66)';
|
|
1147
|
-
this.toRgb = (value) => {
|
|
1148
|
-
const baseRed = 128;
|
|
1149
|
-
const baseGreen = 128;
|
|
1150
|
-
const baseBlue = 128;
|
|
1151
|
-
let seed = value.charCodeAt(0) ^ value.charCodeAt(1);
|
|
1152
|
-
const rand_1 = Math.abs((Math.sin(seed++) * 10000)) % 256;
|
|
1153
|
-
const rand_2 = Math.abs((Math.sin(seed++) * 10000)) % 256;
|
|
1154
|
-
const rand_3 = Math.abs((Math.sin(seed++) * 10000)) % 256;
|
|
1155
|
-
const r = Math.round((rand_1 + baseRed) / 2);
|
|
1156
|
-
const g = Math.round((rand_2 + baseGreen) / 2);
|
|
1157
|
-
const b = Math.round((rand_3 + baseBlue) / 2);
|
|
1158
|
-
return { r, g, b };
|
|
1159
|
-
};
|
|
1160
|
-
this.getInitials = (name) => {
|
|
1161
|
-
// Get all the initials.
|
|
1162
|
-
const names = (name ?? '').split(' ');
|
|
1163
|
-
const initials = names
|
|
1164
|
-
.map(name => name.charAt(0).toUpperCase())
|
|
1165
|
-
.filter(name => /^[a-zA-Z]+$/.test(name));
|
|
1166
|
-
// Check if there are any initials.
|
|
1167
|
-
if (initials?.length <= 0) {
|
|
1168
|
-
return null;
|
|
1169
|
-
}
|
|
1170
|
-
// Get the first and last initials.
|
|
1171
|
-
if (initials?.length > 1) {
|
|
1172
|
-
return `${initials?.[0]}${initials?.[initials?.length - 1]}`;
|
|
1173
|
-
}
|
|
1174
|
-
// Get only the first initial.
|
|
1175
|
-
return initials?.[0];
|
|
1176
|
-
};
|
|
1177
|
-
this.parseColorFormat = (value) => {
|
|
1178
|
-
if (!value) {
|
|
1179
|
-
return null;
|
|
1180
|
-
}
|
|
1181
|
-
// Hex 3 values.
|
|
1182
|
-
let match = value.match(/^#([0-9a-f]{3})$/i);
|
|
1183
|
-
if (match && match[1]) {
|
|
1184
|
-
const r = parseInt(match[1].charAt(0), 16) * 0x11;
|
|
1185
|
-
const g = parseInt(match[1].charAt(1), 16) * 0x11;
|
|
1186
|
-
const b = parseInt(match[1].charAt(2), 16) * 0x11;
|
|
1187
|
-
return { r, g, b };
|
|
1188
|
-
}
|
|
1189
|
-
// Hex 6 values.
|
|
1190
|
-
match = value.match(/^#([0-9a-f]{6})$/i);
|
|
1191
|
-
if (match && match[1]) {
|
|
1192
|
-
const r = parseInt(match[1].substring(0, 2), 16);
|
|
1193
|
-
const g = parseInt(match[1].substring(2, 4), 16);
|
|
1194
|
-
const b = parseInt(match[1].substring(4, 6), 16);
|
|
1195
|
-
return { r, g, b };
|
|
1196
|
-
}
|
|
1197
|
-
// Rgb values.
|
|
1198
|
-
match = value.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);
|
|
1199
|
-
if (match) {
|
|
1200
|
-
const r = parseInt(match[1], 10);
|
|
1201
|
-
const g = parseInt(match[2], 10);
|
|
1202
|
-
const b = parseInt(match[3], 10);
|
|
1203
|
-
return { r, g, b };
|
|
1204
|
-
}
|
|
1205
|
-
// Not a supported color format.
|
|
1206
|
-
console?.warn?.(`BbAvatar: Unsupported tintColor "${value}" was used.`);
|
|
1207
|
-
return null;
|
|
1208
|
-
};
|
|
1209
|
-
}
|
|
1152
|
+
// Inputs.
|
|
1153
|
+
size = 2.5;
|
|
1154
|
+
// State.
|
|
1155
|
+
state$ = new BehaviorSubject('initials');
|
|
1156
|
+
// Data.
|
|
1157
|
+
_src = null;
|
|
1158
|
+
_title = null;
|
|
1159
|
+
_initials = '!';
|
|
1160
|
+
_color = 'rgb(255, 255, 255)';
|
|
1161
|
+
_backgroundColor = 'rgb(66, 66, 66)';
|
|
1210
1162
|
set src(value) {
|
|
1211
1163
|
this._src = value;
|
|
1212
1164
|
if (this._src) {
|
|
@@ -1248,8 +1200,70 @@ class BbAvatar {
|
|
|
1248
1200
|
this._color = `rgb(${red},${green},${blue})`;
|
|
1249
1201
|
this._backgroundColor = `rgba(${red},${green},${blue}, 0.25)`;
|
|
1250
1202
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1203
|
+
toRgb = (value) => {
|
|
1204
|
+
const baseRed = 128;
|
|
1205
|
+
const baseGreen = 128;
|
|
1206
|
+
const baseBlue = 128;
|
|
1207
|
+
let seed = value.charCodeAt(0) ^ value.charCodeAt(1);
|
|
1208
|
+
const rand_1 = Math.abs((Math.sin(seed++) * 10000)) % 256;
|
|
1209
|
+
const rand_2 = Math.abs((Math.sin(seed++) * 10000)) % 256;
|
|
1210
|
+
const rand_3 = Math.abs((Math.sin(seed++) * 10000)) % 256;
|
|
1211
|
+
const r = Math.round((rand_1 + baseRed) / 2);
|
|
1212
|
+
const g = Math.round((rand_2 + baseGreen) / 2);
|
|
1213
|
+
const b = Math.round((rand_3 + baseBlue) / 2);
|
|
1214
|
+
return { r, g, b };
|
|
1215
|
+
};
|
|
1216
|
+
getInitials = (name) => {
|
|
1217
|
+
// Get all the initials.
|
|
1218
|
+
const names = (name ?? '').split(' ');
|
|
1219
|
+
const initials = names
|
|
1220
|
+
.map(name => name.charAt(0).toUpperCase())
|
|
1221
|
+
.filter(name => /^[a-zA-Z]+$/.test(name));
|
|
1222
|
+
// Check if there are any initials.
|
|
1223
|
+
if (initials?.length <= 0) {
|
|
1224
|
+
return null;
|
|
1225
|
+
}
|
|
1226
|
+
// Get the first and last initials.
|
|
1227
|
+
if (initials?.length > 1) {
|
|
1228
|
+
return `${initials?.[0]}${initials?.[initials?.length - 1]}`;
|
|
1229
|
+
}
|
|
1230
|
+
// Get only the first initial.
|
|
1231
|
+
return initials?.[0];
|
|
1232
|
+
};
|
|
1233
|
+
parseColorFormat = (value) => {
|
|
1234
|
+
if (!value) {
|
|
1235
|
+
return null;
|
|
1236
|
+
}
|
|
1237
|
+
// Hex 3 values.
|
|
1238
|
+
let match = value.match(/^#([0-9a-f]{3})$/i);
|
|
1239
|
+
if (match && match[1]) {
|
|
1240
|
+
const r = parseInt(match[1].charAt(0), 16) * 0x11;
|
|
1241
|
+
const g = parseInt(match[1].charAt(1), 16) * 0x11;
|
|
1242
|
+
const b = parseInt(match[1].charAt(2), 16) * 0x11;
|
|
1243
|
+
return { r, g, b };
|
|
1244
|
+
}
|
|
1245
|
+
// Hex 6 values.
|
|
1246
|
+
match = value.match(/^#([0-9a-f]{6})$/i);
|
|
1247
|
+
if (match && match[1]) {
|
|
1248
|
+
const r = parseInt(match[1].substring(0, 2), 16);
|
|
1249
|
+
const g = parseInt(match[1].substring(2, 4), 16);
|
|
1250
|
+
const b = parseInt(match[1].substring(4, 6), 16);
|
|
1251
|
+
return { r, g, b };
|
|
1252
|
+
}
|
|
1253
|
+
// Rgb values.
|
|
1254
|
+
match = value.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);
|
|
1255
|
+
if (match) {
|
|
1256
|
+
const r = parseInt(match[1], 10);
|
|
1257
|
+
const g = parseInt(match[2], 10);
|
|
1258
|
+
const b = parseInt(match[3], 10);
|
|
1259
|
+
return { r, g, b };
|
|
1260
|
+
}
|
|
1261
|
+
// Not a supported color format.
|
|
1262
|
+
console?.warn?.(`BbAvatar: Unsupported tintColor "${value}" was used.`);
|
|
1263
|
+
return null;
|
|
1264
|
+
};
|
|
1265
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbAvatar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1266
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", type: BbAvatar, isStandalone: true, selector: "bb-avatar", inputs: { size: ["size", "size", numberAttribute], src: "src", title: "title", tintColor: "tintColor" }, host: { attributes: { "role": "img" }, properties: { "style.width.rem": "size", "style.min-width.rem": "size", "style.height.rem": "size", "style.min-height.rem": "size", "style.font-size.rem": "size * 0.42", "style.color": "color", "style.background-color": "backgroundColor", "attr.title": "this.title" }, classAttribute: "bb-avatar" }, ngImport: i0, template: "@switch (state$ | async) {\n @case ('image') {\n <img [src]=\"src\"\n [alt]=\"initials\"\n (error)=\"state$?.next('initials')\"\n class=\"bb-avatar-image\">\n }\n @default {\n {{ initials }}\n }\n}\n", styles: [".bb-avatar{line-height:1;overflow:hidden;font-weight:500;-webkit-user-select:none;user-select:none;position:relative;border-radius:50%;align-items:center;display:inline-flex;justify-content:center}.bb-avatar.rounded{border-radius:4px}.bb-avatar.square{border-radius:0}.bb-avatar-image{width:100%;height:100%;object-fit:cover;position:absolute}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1253
1267
|
}
|
|
1254
1268
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbAvatar, decorators: [{
|
|
1255
1269
|
type: Component,
|
|
@@ -1280,29 +1294,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
1280
1294
|
|
|
1281
1295
|
let nextUniqueId$1 = 0;
|
|
1282
1296
|
class BbMultiFileControl {
|
|
1297
|
+
_files;
|
|
1298
|
+
_changeDetectorRef;
|
|
1299
|
+
// Readonly data.
|
|
1300
|
+
labelId = `bb-multi-file-control-${nextUniqueId$1++}`;
|
|
1301
|
+
// Views.
|
|
1302
|
+
fileInput;
|
|
1303
|
+
// Inputs.
|
|
1304
|
+
label = null;
|
|
1305
|
+
hint = null;
|
|
1306
|
+
accept = null;
|
|
1307
|
+
grouped = false;
|
|
1308
|
+
required = false;
|
|
1309
|
+
disabled = false;
|
|
1310
|
+
hideErrors = false;
|
|
1311
|
+
items = [];
|
|
1312
|
+
// Outputs.
|
|
1313
|
+
delete = new EventEmitter();
|
|
1314
|
+
// State.
|
|
1315
|
+
value = [];
|
|
1316
|
+
dragging = false;
|
|
1317
|
+
error = false;
|
|
1318
|
+
// Callbacks.
|
|
1319
|
+
onTouchedCallback = () => ({});
|
|
1320
|
+
onChangeCallback = () => ({});
|
|
1283
1321
|
constructor(_files, _changeDetectorRef) {
|
|
1284
1322
|
this._files = _files;
|
|
1285
1323
|
this._changeDetectorRef = _changeDetectorRef;
|
|
1286
|
-
// Readonly data.
|
|
1287
|
-
this.labelId = `bb-multi-file-control-${nextUniqueId$1++}`;
|
|
1288
|
-
// Inputs.
|
|
1289
|
-
this.label = null;
|
|
1290
|
-
this.hint = null;
|
|
1291
|
-
this.accept = null;
|
|
1292
|
-
this.grouped = false;
|
|
1293
|
-
this.required = false;
|
|
1294
|
-
this.disabled = false;
|
|
1295
|
-
this.hideErrors = false;
|
|
1296
|
-
this.items = [];
|
|
1297
|
-
// Outputs.
|
|
1298
|
-
this.delete = new EventEmitter();
|
|
1299
|
-
// State.
|
|
1300
|
-
this.value = [];
|
|
1301
|
-
this.dragging = false;
|
|
1302
|
-
this.error = false;
|
|
1303
|
-
// Callbacks.
|
|
1304
|
-
this.onTouchedCallback = () => ({});
|
|
1305
|
-
this.onChangeCallback = () => ({});
|
|
1306
1324
|
}
|
|
1307
1325
|
get showList() {
|
|
1308
1326
|
return this.value?.length > 0 || this.items?.length > 0;
|
|
@@ -1380,11 +1398,11 @@ class BbMultiFileControl {
|
|
|
1380
1398
|
isBlob(input) {
|
|
1381
1399
|
return 'Blob' in window && input instanceof Blob;
|
|
1382
1400
|
}
|
|
1383
|
-
static
|
|
1384
|
-
static
|
|
1401
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbMultiFileControl, deps: [{ token: i1$1.Files }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1402
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", type: BbMultiFileControl, isStandalone: true, selector: "bb-multi-file-control", inputs: { label: "label", hint: "hint", accept: "accept", grouped: ["grouped", "grouped", booleanAttribute], required: ["required", "required", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute], hideErrors: ["hideErrors", "hideErrors", booleanAttribute], items: "items" }, outputs: { delete: "delete" }, host: { listeners: { "dragover": "onDrag($event,true)", "dragleave": "onDrag($event,false)", "drop": "onDrop($event)" }, properties: { "class.required": "required", "class.disabled": "disabled", "class.grouped": "grouped", "class.dragging": "dragging", "class.error": "error" }, classAttribute: "bb-multi-file-control" }, providers: [
|
|
1385
1403
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbMultiFileControl), multi: true },
|
|
1386
1404
|
{ provide: NG_VALIDATORS, useExisting: BbMultiFileControl, multi: true }
|
|
1387
|
-
], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, static: true }], ngImport: i0, template: "<!-- The label of the input. -->\n@if (label; as labelContent) {\n <label [for]=\"labelId\"\n class=\"bb-multi-file-control-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n </label>\n}\n\n<input #fileInput\n [id]=\"labelId\"\n [accept]=\"accept\"\n [disabled]=\"disabled\"\n (change)=\"onFileChange($event)\"\n class=\"bb-multi-file-control-input\"\n type=\"file\"\n tabindex=\"-1\"\n multiple>\n\n<div class=\"bb-multi-file-control-container\">\n @if (showList) {\n <ul class=\"bb-multi-file-control-list\">\n @for (item of items; track item?.id) {\n <li class=\"bb-multi-file-control-item\">\n <i class=\"bb-multi-file-control-icon attach-horizontal\"></i>\n <a [href]=\"item?.url\"\n target=\"_blank\"\n rel=\"noopener\"\n class=\"bb-multi-file-control-item-content\">{{ item?.label }}</a>\n @if (!disabled && delete?.observed) {\n <button (click)=\"delete?.emit(item)\"\n type=\"button\"\n class=\"bb-multi-file-control-item-button\">\n <i class=\"bb-multi-file-control-icon clear\"></i>\n </button>\n }\n </li>\n }\n @for (file of value; track $index) {\n <li class=\"bb-multi-file-control-item\">\n <i class=\"bb-multi-file-control-icon attach-horizontal\"></i>\n <button (click)=\"downloadFile(file)\"\n class=\"bb-multi-file-control-item-content\"\n type=\"button\">\n {{ file?.name }}\n </button>\n @if (!disabled) {\n <button (click)=\"deleteFile($index)\"\n type=\"button\"\n class=\"bb-multi-file-control-item-button\">\n <i class=\"bb-multi-file-control-icon clear\"></i>\n </button>\n }\n </li>\n }\n </ul>\n } @else if (!disabled) {\n <i class=\"bb-multi-file-control-icon attach-vertical\"></i>\n <p [bb-localize-string]=\"'multi-file-control.choose_file_text' | bbLocalize\"\n class=\"bb-multi-file-control-empty\">\n <label *bbLocalizeTemplate=\"'label'\"\n [for]=\"labelId\">{{ 'multi-file-control.choose_file' | bbLocalize }}</label>\n </p>\n }\n @if (!disabled) {\n <button (click)=\"openFileDialog()\"\n type=\"button\"\n class=\"primary small bb-multi-file-control-button\"\n bb-button>\n <i class=\"bb-multi-file-control-icon add\" suffix></i>\n {{ 'multi-file-control.choose_file' | bbLocalize }}\n </button>\n }\n</div>\n\n@if (!hideErrors) {\n <bb-form-error (errorChange)=\"onErrorChange($event)\"></bb-form-error>\n}\n\n<!-- The file picker hint. -->\n@if (hint; as hintContent) {\n <p class=\"bb-multi-file-control-hint\">\n <ng-template [bbTemplate]=\"hintContent\">{{ hintContent }}</ng-template>\n </p>\n}\n", styles: [".bb-multi-file-control{display:block}.bb-multi-file-control.grouped{margin-bottom:1.5rem}.bb-multi-file-control.required>.bb-multi-file-control-label:after{content:\"*\";font-size:.75rem;vertical-align:top;color:var(--bb-form-label-required-color)}.bb-multi-file-control.dragging>.bb-multi-file-control-container{border-color:#757e8a;box-shadow:0 .375rem .375rem -.375rem #0000001a,var(--bb-multi-file-control-box-shadow)}.bb-multi-file-control.disabled>.bb-multi-file-control-container{cursor:default;color:gray;background-color:#e6e6e6}.bb-multi-file-control-label{display:block;margin-bottom:.25rem;color:var(--bb-form-label-color);font-size:var(--bb-form-label-font-size);font-weight:var(--bb-form-label-font-weight)}.bb-multi-file-control-input{opacity:0;z-index:-1;width:.1px;height:.1px;overflow:hidden;position:absolute}.bb-multi-file-control-container{width:100%;display:flex;color:#111;padding:.5rem;overflow:hidden;min-height:7.5rem;align-items:center;border-radius:.5rem;flex-direction:column;justify-content:center;background-color:#fff;border:1px solid hsl(213,8%,74%);box-shadow:0 .375rem .375rem -.375rem #0000001a}.bb-multi-file-control-button{margin-top:.5rem}.bb-multi-file-control-list{flex:1;width:100%;overflow:hidden}.bb-multi-file-control-empty{flex:1;width:100%;color:#758795;display:block;font-weight:400;line-height:1.5;text-align:center;font-size:.875rem}.bb-multi-file-control-empty>label{cursor:pointer;display:inline;font-size:inherit;font-weight:inherit;text-decoration:underline;color:var(--bb-multi-file-control-color)}.bb-multi-file-control-item{height:2rem;display:flex;max-width:100%;overflow:hidden;align-items:center;white-space:nowrap;border-radius:.5rem;text-overflow:ellipsis;padding:0 .25rem 0 .5rem;border:1px solid hsl(213,8%,74%);background-color:#edf4fd}.bb-multi-file-control-item:not(:last-child){margin-bottom:.25rem}.bb-multi-file-control-item-content{flex:1;padding:0;border:none;max-width:100%;margin:0 .5rem;overflow:hidden;appearance:none;text-align:left;font-weight:400;font-size:.875rem;white-space:nowrap;text-decoration:none;text-overflow:ellipsis;background-color:transparent}.bb-multi-file-control-item-content,.bb-multi-file-control-item-content:visited{color:#0a305c}.bb-multi-file-control-item-content:hover,.bb-multi-file-control-item-content:focus{text-decoration:underline}.bb-multi-file-control-item-button{padding:0;width:1.5rem;display:flex;height:1.5rem;align-items:center;border-radius:.25rem;justify-content:center;border:1px solid hsl(0,73%,25%);background-color:#b51c1c}.bb-multi-file-control-item-button:hover,.bb-multi-file-control-item-button:focus{background-color:#a81a1a}.bb-multi-file-control-item-button:active{background-color:#9a1818}.bb-multi-file-control-hint{display:block;line-height:1.5;margin-top:.25rem;font-size:.8125rem;color:#758795}.bb-multi-file-control-icon{width:1.25rem;height:1.25rem;display:inline-flex;background-size:contain;background-repeat:no-repeat;background-position:center center}.bb-multi-file-control-icon.add{background-image:url('data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" fill=\"%23fff\" viewBox=\"0 0 24 24\"%3E%3Cpath d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\"/%3E%3C/svg%3E')}.bb-multi-file-control-icon.attach-vertical{width:1.5rem;height:1.5rem;margin-bottom:.5rem;background-image:url('data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" fill=\"%23758795\" viewBox=\"0 0 24 24\"%3E%3Cpath d=\"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z\"/%3E%3C/svg%3E')}.bb-multi-file-control-icon.attach-horizontal{background-image:url('data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"%3E%3Cpath d=\"M2 12.5C2 9.46 4.46 7 7.5 7H18c2.21 0 4 1.79 4 4s-1.79 4-4 4H9.5C8.12 15 7 13.88 7 12.5S8.12 10 9.5 10H17v2H9.41c-.55 0-.55 1 0 1H18c1.1 0 2-.9 2-2s-.9-2-2-2H7.5C5.57 9 4 10.57 4 12.5S5.57 16 7.5 16H17v2H7.5C4.46 18 2 15.54 2 12.5z\"/%3E%3C/svg%3E')}.bb-multi-file-control-icon.clear{background-image:url('data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" fill=\"%23fff\" viewBox=\"0 0 24 24\"%3E%3Cpath d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/%3E%3C/svg%3E')}\n"], dependencies: [{ kind: "component", type: BbFormError, selector: "bb-form-error", inputs: ["control"], outputs: ["errorChange"] }, { kind: "directive", type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }, { kind: "component", type: BbButton, selector: "button[bb-button]", inputs: ["disabled", "loading"], exportAs: ["bbButton"] }, { kind: "pipe", type: BbLocalize, name: "bbLocalize" }, { kind: "directive", type: BbLocalizeTemplate, selector: "[bbLocalizeTemplate]", inputs: ["bbLocalizeTemplate"] }, { kind: "component", type: BbLocalizeString, selector: "[bb-localize-string]", inputs: ["substitutions", "bb-localize-string"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1405
|
+
], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, static: true }], ngImport: i0, template: "<!-- The label of the input. -->\n@if (label; as labelContent) {\n <label [for]=\"labelId\"\n class=\"bb-multi-file-control-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n </label>\n}\n\n<input #fileInput\n [id]=\"labelId\"\n [accept]=\"accept\"\n [disabled]=\"disabled\"\n (change)=\"onFileChange($event)\"\n class=\"bb-multi-file-control-input\"\n type=\"file\"\n tabindex=\"-1\"\n multiple>\n\n<div class=\"bb-multi-file-control-container\">\n @if (showList) {\n <ul class=\"bb-multi-file-control-list\">\n @for (item of items; track item?.id) {\n <li class=\"bb-multi-file-control-item\">\n <i class=\"bb-multi-file-control-icon attach-horizontal\"></i>\n <a [href]=\"item?.url\"\n target=\"_blank\"\n rel=\"noopener\"\n class=\"bb-multi-file-control-item-content\">{{ item?.label }}</a>\n @if (!disabled && delete?.observed) {\n <button (click)=\"delete?.emit(item)\"\n type=\"button\"\n class=\"bb-multi-file-control-item-button\">\n <i class=\"bb-multi-file-control-icon clear\"></i>\n </button>\n }\n </li>\n }\n @for (file of value; track $index) {\n <li class=\"bb-multi-file-control-item\">\n <i class=\"bb-multi-file-control-icon attach-horizontal\"></i>\n <button (click)=\"downloadFile(file)\"\n class=\"bb-multi-file-control-item-content\"\n type=\"button\">\n {{ file?.name }}\n </button>\n @if (!disabled) {\n <button (click)=\"deleteFile($index)\"\n type=\"button\"\n class=\"bb-multi-file-control-item-button\">\n <i class=\"bb-multi-file-control-icon clear\"></i>\n </button>\n }\n </li>\n }\n </ul>\n } @else if (!disabled) {\n <i class=\"bb-multi-file-control-icon attach-vertical\"></i>\n <p [bb-localize-string]=\"'multi-file-control.choose_file_text' | bbLocalize\"\n class=\"bb-multi-file-control-empty\">\n <label *bbLocalizeTemplate=\"'label'\"\n [for]=\"labelId\">{{ 'multi-file-control.choose_file' | bbLocalize }}</label>\n </p>\n }\n @if (!disabled) {\n <button (click)=\"openFileDialog()\"\n type=\"button\"\n class=\"primary small bb-multi-file-control-button\"\n bb-button>\n <i class=\"bb-multi-file-control-icon add\" suffix></i>\n {{ 'multi-file-control.choose_file' | bbLocalize }}\n </button>\n }\n</div>\n\n@if (!hideErrors) {\n <bb-form-error (errorChange)=\"onErrorChange($event)\"></bb-form-error>\n}\n\n<!-- The file picker hint. -->\n@if (hint; as hintContent) {\n <p class=\"bb-multi-file-control-hint\">\n <ng-template [bbTemplate]=\"hintContent\">{{ hintContent }}</ng-template>\n </p>\n}\n", styles: [".bb-multi-file-control{display:block}.bb-multi-file-control.grouped{margin-bottom:1.5rem}.bb-multi-file-control.required>.bb-multi-file-control-label:after{content:\"*\";font-size:.75rem;vertical-align:top;color:var(--bb-form-label-required-color)}.bb-multi-file-control.dragging>.bb-multi-file-control-container{border-color:#757e8a;box-shadow:0 .375rem .375rem -.375rem #0000001a,var(--bb-multi-file-control-box-shadow)}.bb-multi-file-control.disabled>.bb-multi-file-control-container{cursor:default;color:gray;background-color:#e6e6e6}.bb-multi-file-control-label{display:block;margin-bottom:.25rem;color:var(--bb-form-label-color);font-size:var(--bb-form-label-font-size);font-weight:var(--bb-form-label-font-weight)}.bb-multi-file-control-input{opacity:0;z-index:-1;width:.1px;height:.1px;overflow:hidden;position:absolute}.bb-multi-file-control-container{width:100%;display:flex;color:#111;padding:.5rem;overflow:hidden;min-height:7.5rem;align-items:center;border-radius:.5rem;flex-direction:column;justify-content:center;background-color:#fff;border:1px solid hsl(213,8%,74%);box-shadow:0 .375rem .375rem -.375rem #0000001a}.bb-multi-file-control-button{margin-top:.5rem}.bb-multi-file-control-list{flex:1;width:100%;overflow:hidden}.bb-multi-file-control-empty{flex:1;width:100%;color:#758795;display:block;font-weight:400;line-height:1.5;text-align:center;font-size:.875rem}.bb-multi-file-control-empty>label{cursor:pointer;display:inline;font-size:inherit;font-weight:inherit;text-decoration:underline;color:var(--bb-multi-file-control-color)}.bb-multi-file-control-item{height:2rem;display:flex;max-width:100%;overflow:hidden;align-items:center;white-space:nowrap;border-radius:.5rem;text-overflow:ellipsis;padding:0 .25rem 0 .5rem;border:1px solid hsl(213,8%,74%);background-color:#edf4fd}.bb-multi-file-control-item:not(:last-child){margin-bottom:.25rem}.bb-multi-file-control-item-content{flex:1;padding:0;border:none;max-width:100%;margin:0 .5rem;overflow:hidden;appearance:none;text-align:left;font-weight:400;font-size:.875rem;white-space:nowrap;text-decoration:none;text-overflow:ellipsis;background-color:transparent}.bb-multi-file-control-item-content,.bb-multi-file-control-item-content:visited{color:#0a305c}.bb-multi-file-control-item-content:hover,.bb-multi-file-control-item-content:focus{text-decoration:underline}.bb-multi-file-control-item-button{padding:0;width:1.5rem;display:flex;height:1.5rem;align-items:center;border-radius:.25rem;justify-content:center;border:1px solid hsl(0,73%,25%);background-color:#b51c1c}.bb-multi-file-control-item-button:hover,.bb-multi-file-control-item-button:focus{background-color:#a81a1a}.bb-multi-file-control-item-button:active{background-color:#9a1818}.bb-multi-file-control-hint{display:block;line-height:1.5;margin-top:.25rem;font-size:.8125rem;color:#758795}.bb-multi-file-control-icon{width:1.25rem;height:1.25rem;display:inline-flex;background-size:contain;background-repeat:no-repeat;background-position:center center}.bb-multi-file-control-icon.add{background-image:url('data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" fill=\"%23fff\" viewBox=\"0 0 24 24\"%3E%3Cpath d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\"/%3E%3C/svg%3E')}.bb-multi-file-control-icon.attach-vertical{width:1.5rem;height:1.5rem;margin-bottom:.5rem;background-image:url('data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" fill=\"%23758795\" viewBox=\"0 0 24 24\"%3E%3Cpath d=\"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z\"/%3E%3C/svg%3E')}.bb-multi-file-control-icon.attach-horizontal{background-image:url('data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"%3E%3Cpath d=\"M2 12.5C2 9.46 4.46 7 7.5 7H18c2.21 0 4 1.79 4 4s-1.79 4-4 4H9.5C8.12 15 7 13.88 7 12.5S8.12 10 9.5 10H17v2H9.41c-.55 0-.55 1 0 1H18c1.1 0 2-.9 2-2s-.9-2-2-2H7.5C5.57 9 4 10.57 4 12.5S5.57 16 7.5 16H17v2H7.5C4.46 18 2 15.54 2 12.5z\"/%3E%3C/svg%3E')}.bb-multi-file-control-icon.clear{background-image:url('data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" fill=\"%23fff\" viewBox=\"0 0 24 24\"%3E%3Cpath d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/%3E%3C/svg%3E')}\n"], dependencies: [{ kind: "component", type: BbFormError, selector: "bb-form-error", inputs: ["control"], outputs: ["errorChange"] }, { kind: "directive", type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }, { kind: "component", type: BbButton, selector: "button[bb-button]", inputs: ["disabled", "loading"], exportAs: ["bbButton"] }, { kind: "pipe", type: BbLocalize, name: "bbLocalize" }, { kind: "directive", type: BbLocalizeTemplate, selector: "[bbLocalizeTemplate]", inputs: ["bbLocalizeTemplate"] }, { kind: "component", type: BbLocalizeString, selector: "[bb-localize-string]", inputs: ["substitutions", "bb-localize-string"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1388
1406
|
}
|
|
1389
1407
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbMultiFileControl, decorators: [{
|
|
1390
1408
|
type: Component,
|
|
@@ -1437,57 +1455,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
1437
1455
|
|
|
1438
1456
|
let nextUniqueId = 0;
|
|
1439
1457
|
class BbFilePicker {
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
// Validate the files exist.
|
|
1463
|
-
if (!files) {
|
|
1464
|
-
return;
|
|
1465
|
-
}
|
|
1466
|
-
// Retrieve the first file.
|
|
1467
|
-
const file = files[0];
|
|
1468
|
-
// Validate the first file exists.
|
|
1469
|
-
if (!file) {
|
|
1470
|
-
return;
|
|
1471
|
-
}
|
|
1472
|
-
// Save the file.
|
|
1473
|
-
this.value = file;
|
|
1474
|
-
};
|
|
1475
|
-
this.getFileListFromEvent = (event) => {
|
|
1476
|
-
const element = event.target;
|
|
1477
|
-
if (!element) {
|
|
1478
|
-
return null;
|
|
1479
|
-
}
|
|
1480
|
-
return element.files;
|
|
1481
|
-
};
|
|
1482
|
-
this.preventDefault = (event) => {
|
|
1483
|
-
event.preventDefault();
|
|
1484
|
-
event.stopPropagation();
|
|
1485
|
-
};
|
|
1486
|
-
}
|
|
1458
|
+
// Readonly data.
|
|
1459
|
+
labelId = `bb-file-picker-${nextUniqueId++}`;
|
|
1460
|
+
// Views.
|
|
1461
|
+
fileInput;
|
|
1462
|
+
extraTemplate;
|
|
1463
|
+
// Inputs.
|
|
1464
|
+
label = null;
|
|
1465
|
+
hint = null;
|
|
1466
|
+
accept = null;
|
|
1467
|
+
showImages = true;
|
|
1468
|
+
allowDragging = true;
|
|
1469
|
+
grouped = false;
|
|
1470
|
+
required = false;
|
|
1471
|
+
disabled = false;
|
|
1472
|
+
hideErrors = false;
|
|
1473
|
+
// State.
|
|
1474
|
+
hovered = false;
|
|
1475
|
+
error = false;
|
|
1476
|
+
value$ = new BehaviorSubject({});
|
|
1477
|
+
// Callbacks.
|
|
1478
|
+
onTouchedCallback = () => ({});
|
|
1479
|
+
onChangeCallback = () => ({});
|
|
1487
1480
|
get value() {
|
|
1488
1481
|
const { file } = this.value$.getValue();
|
|
1489
1482
|
return file;
|
|
1490
1483
|
}
|
|
1484
|
+
valueChange = new EventEmitter();
|
|
1491
1485
|
set value(value) {
|
|
1492
1486
|
this.value$.next({ file: value });
|
|
1493
1487
|
this.valueChange.emit(value);
|
|
@@ -1574,8 +1568,33 @@ class BbFilePicker {
|
|
|
1574
1568
|
invalidFileType: true
|
|
1575
1569
|
};
|
|
1576
1570
|
}
|
|
1577
|
-
|
|
1578
|
-
|
|
1571
|
+
saveFile = (files) => {
|
|
1572
|
+
// Validate the files exist.
|
|
1573
|
+
if (!files) {
|
|
1574
|
+
return;
|
|
1575
|
+
}
|
|
1576
|
+
// Retrieve the first file.
|
|
1577
|
+
const file = files[0];
|
|
1578
|
+
// Validate the first file exists.
|
|
1579
|
+
if (!file) {
|
|
1580
|
+
return;
|
|
1581
|
+
}
|
|
1582
|
+
// Save the file.
|
|
1583
|
+
this.value = file;
|
|
1584
|
+
};
|
|
1585
|
+
getFileListFromEvent = (event) => {
|
|
1586
|
+
const element = event.target;
|
|
1587
|
+
if (!element) {
|
|
1588
|
+
return null;
|
|
1589
|
+
}
|
|
1590
|
+
return element.files;
|
|
1591
|
+
};
|
|
1592
|
+
preventDefault = (event) => {
|
|
1593
|
+
event.preventDefault();
|
|
1594
|
+
event.stopPropagation();
|
|
1595
|
+
};
|
|
1596
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFilePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1597
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", type: BbFilePicker, isStandalone: true, selector: "bb-file-picker", inputs: { label: "label", hint: "hint", accept: "accept", showImages: "showImages", allowDragging: "allowDragging", grouped: ["grouped", "grouped", booleanAttribute], required: ["required", "required", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute], hideErrors: ["hideErrors", "hideErrors", booleanAttribute], value: "value" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "dragover": "onDrag($event,true)", "dragleave": "onDrag($event,false)", "drop": "onDrop($event)" }, properties: { "class.required": "required", "class.disabled": "disabled", "class.grouped": "grouped", "class.hovered": "hovered", "class.error": "error" }, classAttribute: "bb-file-picker" }, providers: [
|
|
1579
1598
|
{
|
|
1580
1599
|
provide: NG_VALUE_ACCESSOR,
|
|
1581
1600
|
useExisting: forwardRef(() => BbFilePicker),
|
|
@@ -1596,7 +1615,7 @@ class BbFilePicker {
|
|
|
1596
1615
|
animate('200ms', style({ opacity: 0 }))
|
|
1597
1616
|
])
|
|
1598
1617
|
])
|
|
1599
|
-
], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1618
|
+
], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1600
1619
|
}
|
|
1601
1620
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbFilePicker, decorators: [{
|
|
1602
1621
|
type: Component,
|
|
@@ -1673,25 +1692,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
1673
1692
|
}] } });
|
|
1674
1693
|
|
|
1675
1694
|
class BbImagePicker {
|
|
1695
|
+
_converter;
|
|
1696
|
+
// Views.
|
|
1697
|
+
fileInput;
|
|
1698
|
+
// Inputs.
|
|
1699
|
+
label = null;
|
|
1700
|
+
placeholder = null;
|
|
1701
|
+
styleDimensions = null;
|
|
1702
|
+
cropDimensions = null;
|
|
1703
|
+
disabled = false;
|
|
1704
|
+
grouped = false;
|
|
1705
|
+
// Callbacks.
|
|
1706
|
+
onTouchedCallback = () => ({});
|
|
1707
|
+
onChangeCallback = () => ({});
|
|
1708
|
+
// Form.
|
|
1709
|
+
_value$ = new BehaviorSubject(null);
|
|
1676
1710
|
constructor(_converter) {
|
|
1677
1711
|
this._converter = _converter;
|
|
1678
|
-
// Inputs.
|
|
1679
|
-
this.label = null;
|
|
1680
|
-
this.placeholder = null;
|
|
1681
|
-
this.styleDimensions = null;
|
|
1682
|
-
this.cropDimensions = null;
|
|
1683
|
-
this.disabled = false;
|
|
1684
|
-
this.grouped = false;
|
|
1685
|
-
// Callbacks.
|
|
1686
|
-
this.onTouchedCallback = () => ({});
|
|
1687
|
-
this.onChangeCallback = () => ({});
|
|
1688
|
-
// Form.
|
|
1689
|
-
this._value$ = new BehaviorSubject(null);
|
|
1690
|
-
this.valueChange = new EventEmitter();
|
|
1691
1712
|
}
|
|
1692
1713
|
get value() {
|
|
1693
1714
|
return this._value$.getValue();
|
|
1694
1715
|
}
|
|
1716
|
+
valueChange = new EventEmitter();
|
|
1695
1717
|
set value(value) {
|
|
1696
1718
|
this._value$.next(value);
|
|
1697
1719
|
this.valueChange.emit(value);
|
|
@@ -1739,14 +1761,14 @@ class BbImagePicker {
|
|
|
1739
1761
|
setDisabledState(isDisabled) {
|
|
1740
1762
|
this.disabled = isDisabled;
|
|
1741
1763
|
}
|
|
1742
|
-
static
|
|
1743
|
-
static
|
|
1764
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbImagePicker, deps: [{ token: i1$1.ImageConverter }], target: i0.ɵɵFactoryTarget.Component });
|
|
1765
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", type: BbImagePicker, isStandalone: true, selector: "bb-image-picker", inputs: { label: "label", placeholder: "placeholder", styleDimensions: "styleDimensions", cropDimensions: "cropDimensions", disabled: ["disabled", "disabled", booleanAttribute], grouped: ["grouped", "grouped", booleanAttribute], value: "value" }, outputs: { valueChange: "valueChange" }, host: { properties: { "class.disabled": "disabled", "class.grouped": "grouped" }, classAttribute: "bb-image-picker" }, providers: [
|
|
1744
1766
|
{
|
|
1745
1767
|
provide: NG_VALUE_ACCESSOR,
|
|
1746
1768
|
useExisting: forwardRef(() => BbImagePicker),
|
|
1747
1769
|
multi: true
|
|
1748
1770
|
}
|
|
1749
|
-
], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, static: true }], ngImport: i0, template: "<!-- The input that can open the file picker. -->\n<input #fileInput\n (change)=\"onFileChange($event)\"\n class=\"bb-image-picker-input\"\n type=\"file\"\n tabindex=\"-1\"\n accept=\"image/*\">\n\n<span [style.width]=\"styleDimensions?.width || '100%'\"\n [style.height]=\"styleDimensions?.height || '215px'\"\n [style.background-image]=\"image | async\"\n class=\"bb-image-input-image\">\n </span>\n\n@if (label; as labelText) {\n <button (click)=\"openFilePicker()\"\n bb-button\n class=\"bb-image-input-button\"\n type=\"button\">\n {{ labelText }}\n </button>\n}\n", styles: [".bb-image-picker{display:flex;align-items:center;flex-direction:column}.bb-image-picker.circle>.bb-image-input-image{border-radius:50%}.bb-image-picker.grouped{margin-bottom:1.5rem}.bb-image-picker.disabled{opacity:.5;cursor:default;-webkit-user-select:none;user-select:none;pointer-events:none}.bb-image-picker-input{opacity:0;z-index:-1;width:.1px;height:.1px;overflow:hidden;position:absolute}.bb-image-input-image{display:flex;cursor:default;position:relative;align-items:center;border-radius:.25rem;justify-content:center;background:#0003 url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7) center center/cover no-repeat}.bb-image-input-button{margin-top:.75rem}\n"], dependencies: [{ kind: "component", type: BbButton, selector: "button[bb-button]", inputs: ["disabled", "loading"], exportAs: ["bbButton"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1771
|
+
], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, static: true }], ngImport: i0, template: "<!-- The input that can open the file picker. -->\n<input #fileInput\n (change)=\"onFileChange($event)\"\n class=\"bb-image-picker-input\"\n type=\"file\"\n tabindex=\"-1\"\n accept=\"image/*\">\n\n<span [style.width]=\"styleDimensions?.width || '100%'\"\n [style.height]=\"styleDimensions?.height || '215px'\"\n [style.background-image]=\"image | async\"\n class=\"bb-image-input-image\">\n </span>\n\n@if (label; as labelText) {\n <button (click)=\"openFilePicker()\"\n bb-button\n class=\"bb-image-input-button\"\n type=\"button\">\n {{ labelText }}\n </button>\n}\n", styles: [".bb-image-picker{display:flex;align-items:center;flex-direction:column}.bb-image-picker.circle>.bb-image-input-image{border-radius:50%}.bb-image-picker.grouped{margin-bottom:1.5rem}.bb-image-picker.disabled{opacity:.5;cursor:default;-webkit-user-select:none;user-select:none;pointer-events:none}.bb-image-picker-input{opacity:0;z-index:-1;width:.1px;height:.1px;overflow:hidden;position:absolute}.bb-image-input-image{display:flex;cursor:default;position:relative;align-items:center;border-radius:.25rem;justify-content:center;background:#0003 url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7) center center/cover no-repeat}.bb-image-input-button{margin-top:.75rem}\n"], dependencies: [{ kind: "component", type: BbButton, selector: "button[bb-button]", inputs: ["disabled", "loading"], exportAs: ["bbButton"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1750
1772
|
}
|
|
1751
1773
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbImagePicker, decorators: [{
|
|
1752
1774
|
type: Component,
|
|
@@ -1785,6 +1807,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImpor
|
|
|
1785
1807
|
}] } });
|
|
1786
1808
|
|
|
1787
1809
|
class BbDatePicker {
|
|
1810
|
+
_changeDetectorRef;
|
|
1811
|
+
_localizeId;
|
|
1812
|
+
// Readonly data.
|
|
1813
|
+
_yearRegex = /^(10|[1-9][0-9])\d{2}$/; // Note: 1000 - 9999
|
|
1814
|
+
// Inputs.
|
|
1815
|
+
label = null;
|
|
1816
|
+
hint = null;
|
|
1817
|
+
dayPlaceholder = 'dd';
|
|
1818
|
+
monthPlaceholder = 'mm';
|
|
1819
|
+
yearPlaceholder = 'yyyy';
|
|
1820
|
+
required = false;
|
|
1821
|
+
grouped = false;
|
|
1822
|
+
readonly = false;
|
|
1823
|
+
hideErrors = false;
|
|
1788
1824
|
set disabled(value) {
|
|
1789
1825
|
this._disabled = value;
|
|
1790
1826
|
this._disabled ? this.form?.disable() : this.form?.enable();
|
|
@@ -1796,6 +1832,11 @@ class BbDatePicker {
|
|
|
1796
1832
|
set years(value) {
|
|
1797
1833
|
this.parseYears(value);
|
|
1798
1834
|
}
|
|
1835
|
+
// Forms.
|
|
1836
|
+
form;
|
|
1837
|
+
// Data.
|
|
1838
|
+
data$;
|
|
1839
|
+
years$ = new BehaviorSubject(null);
|
|
1799
1840
|
get value() {
|
|
1800
1841
|
return this.formToDateString(this.form?.value);
|
|
1801
1842
|
}
|
|
@@ -1803,81 +1844,18 @@ class BbDatePicker {
|
|
|
1803
1844
|
this.parseDateStringInForm(value);
|
|
1804
1845
|
this.valueChange.emit(this.value);
|
|
1805
1846
|
}
|
|
1847
|
+
valueChange = new EventEmitter();
|
|
1848
|
+
// State.
|
|
1849
|
+
error = false;
|
|
1850
|
+
_disabled = false;
|
|
1851
|
+
// Callbacks.
|
|
1852
|
+
onTouchedCallback = () => ({});
|
|
1853
|
+
onChangeCallback = () => ({});
|
|
1854
|
+
// Subscriptions.
|
|
1855
|
+
_subscription = new Subscription();
|
|
1806
1856
|
constructor(_changeDetectorRef, _localizeId) {
|
|
1807
1857
|
this._changeDetectorRef = _changeDetectorRef;
|
|
1808
1858
|
this._localizeId = _localizeId;
|
|
1809
|
-
// Readonly data.
|
|
1810
|
-
this._yearRegex = /^(10|[1-9][0-9])\d{2}$/; // Note: 1000 - 9999
|
|
1811
|
-
// Inputs.
|
|
1812
|
-
this.label = null;
|
|
1813
|
-
this.hint = null;
|
|
1814
|
-
this.dayPlaceholder = 'dd';
|
|
1815
|
-
this.monthPlaceholder = 'mm';
|
|
1816
|
-
this.yearPlaceholder = 'yyyy';
|
|
1817
|
-
this.required = false;
|
|
1818
|
-
this.grouped = false;
|
|
1819
|
-
this.readonly = false;
|
|
1820
|
-
this.hideErrors = false;
|
|
1821
|
-
this.years$ = new BehaviorSubject(null);
|
|
1822
|
-
this.valueChange = new EventEmitter();
|
|
1823
|
-
// State.
|
|
1824
|
-
this.error = false;
|
|
1825
|
-
this._disabled = false;
|
|
1826
|
-
// Callbacks.
|
|
1827
|
-
this.onTouchedCallback = () => ({});
|
|
1828
|
-
this.onChangeCallback = () => ({});
|
|
1829
|
-
// Subscriptions.
|
|
1830
|
-
this._subscription = new Subscription();
|
|
1831
|
-
this.formToDateString = ({ year, month, day }) => {
|
|
1832
|
-
if (this.form?.invalid) {
|
|
1833
|
-
return null;
|
|
1834
|
-
}
|
|
1835
|
-
const prefixedMonth = this.padString(`${month}`, 2, '0');
|
|
1836
|
-
const prefixedDay = this.padString(`${day}`, 2, '0');
|
|
1837
|
-
return [year, prefixedMonth, prefixedDay].join('-');
|
|
1838
|
-
};
|
|
1839
|
-
this.parseYearFormat = (value) => {
|
|
1840
|
-
// Transform the value to a definitive string.
|
|
1841
|
-
const yearString = `${value}`;
|
|
1842
|
-
const currentFullYear = new Date().getFullYear();
|
|
1843
|
-
// Handle default "current" syntax.
|
|
1844
|
-
if (yearString === 'current') {
|
|
1845
|
-
return currentFullYear;
|
|
1846
|
-
}
|
|
1847
|
-
// Handle "current + {amount}" syntax.
|
|
1848
|
-
if (/^current\s?\+\s?\d+$/.test(yearString)) {
|
|
1849
|
-
const amount = Number(yearString?.split('+')?.[1]?.trim()) ?? 0;
|
|
1850
|
-
return currentFullYear + amount;
|
|
1851
|
-
}
|
|
1852
|
-
// Handle "current - {amount}" syntax.
|
|
1853
|
-
if (/^current\s?-\s?\d+$/.test(yearString)) {
|
|
1854
|
-
const amount = Number(yearString?.split('-')?.[1]?.trim()) ?? 0;
|
|
1855
|
-
return currentFullYear - amount;
|
|
1856
|
-
}
|
|
1857
|
-
// Handling the default number case.
|
|
1858
|
-
if (/^[0-9]{4}$/.test(yearString)) {
|
|
1859
|
-
return Number(yearString);
|
|
1860
|
-
}
|
|
1861
|
-
// We could not parse it.
|
|
1862
|
-
return null;
|
|
1863
|
-
};
|
|
1864
|
-
this.getDaysInMonth = (month = null, year = null) => {
|
|
1865
|
-
if (this.form?.invalid || month === null || year === null) {
|
|
1866
|
-
return 31;
|
|
1867
|
-
}
|
|
1868
|
-
const parsedYear = parseInt(year, 10);
|
|
1869
|
-
return new Date(parsedYear, month, 0).getDate();
|
|
1870
|
-
};
|
|
1871
|
-
this.isValidDateString = (value) => {
|
|
1872
|
-
return typeof value === 'string' && /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(value);
|
|
1873
|
-
};
|
|
1874
|
-
this.padString = (value, maxLength, fillString = '0') => {
|
|
1875
|
-
const count = maxLength - value.length;
|
|
1876
|
-
for (let index = 0; index < count; index++) {
|
|
1877
|
-
value = `${fillString}${value}`;
|
|
1878
|
-
}
|
|
1879
|
-
return value;
|
|
1880
|
-
};
|
|
1881
1859
|
}
|
|
1882
1860
|
ngOnInit() {
|
|
1883
1861
|
this.composeForm();
|
|
@@ -2026,11 +2004,61 @@ class BbDatePicker {
|
|
|
2026
2004
|
// Push the years.
|
|
2027
2005
|
return this.years$.next(years);
|
|
2028
2006
|
}
|
|
2029
|
-
|
|
2030
|
-
|
|
2007
|
+
formToDateString = ({ year, month, day }) => {
|
|
2008
|
+
if (this.form?.invalid) {
|
|
2009
|
+
return null;
|
|
2010
|
+
}
|
|
2011
|
+
const prefixedMonth = this.padString(`${month}`, 2, '0');
|
|
2012
|
+
const prefixedDay = this.padString(`${day}`, 2, '0');
|
|
2013
|
+
return [year, prefixedMonth, prefixedDay].join('-');
|
|
2014
|
+
};
|
|
2015
|
+
parseYearFormat = (value) => {
|
|
2016
|
+
// Transform the value to a definitive string.
|
|
2017
|
+
const yearString = `${value}`;
|
|
2018
|
+
const currentFullYear = new Date().getFullYear();
|
|
2019
|
+
// Handle default "current" syntax.
|
|
2020
|
+
if (yearString === 'current') {
|
|
2021
|
+
return currentFullYear;
|
|
2022
|
+
}
|
|
2023
|
+
// Handle "current + {amount}" syntax.
|
|
2024
|
+
if (/^current\s?\+\s?\d+$/.test(yearString)) {
|
|
2025
|
+
const amount = Number(yearString?.split('+')?.[1]?.trim()) ?? 0;
|
|
2026
|
+
return currentFullYear + amount;
|
|
2027
|
+
}
|
|
2028
|
+
// Handle "current - {amount}" syntax.
|
|
2029
|
+
if (/^current\s?-\s?\d+$/.test(yearString)) {
|
|
2030
|
+
const amount = Number(yearString?.split('-')?.[1]?.trim()) ?? 0;
|
|
2031
|
+
return currentFullYear - amount;
|
|
2032
|
+
}
|
|
2033
|
+
// Handling the default number case.
|
|
2034
|
+
if (/^[0-9]{4}$/.test(yearString)) {
|
|
2035
|
+
return Number(yearString);
|
|
2036
|
+
}
|
|
2037
|
+
// We could not parse it.
|
|
2038
|
+
return null;
|
|
2039
|
+
};
|
|
2040
|
+
getDaysInMonth = (month = null, year = null) => {
|
|
2041
|
+
if (this.form?.invalid || month === null || year === null) {
|
|
2042
|
+
return 31;
|
|
2043
|
+
}
|
|
2044
|
+
const parsedYear = parseInt(year, 10);
|
|
2045
|
+
return new Date(parsedYear, month, 0).getDate();
|
|
2046
|
+
};
|
|
2047
|
+
isValidDateString = (value) => {
|
|
2048
|
+
return typeof value === 'string' && /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(value);
|
|
2049
|
+
};
|
|
2050
|
+
padString = (value, maxLength, fillString = '0') => {
|
|
2051
|
+
const count = maxLength - value.length;
|
|
2052
|
+
for (let index = 0; index < count; index++) {
|
|
2053
|
+
value = `${fillString}${value}`;
|
|
2054
|
+
}
|
|
2055
|
+
return value;
|
|
2056
|
+
};
|
|
2057
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDatePicker, deps: [{ token: i0.ChangeDetectorRef }, { token: LOCALIZE_ID }], target: i0.ɵɵFactoryTarget.Component });
|
|
2058
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.0", type: BbDatePicker, isStandalone: true, selector: "bb-date-picker", inputs: { label: "label", hint: "hint", dayPlaceholder: "dayPlaceholder", monthPlaceholder: "monthPlaceholder", yearPlaceholder: "yearPlaceholder", required: ["required", "required", booleanAttribute], grouped: ["grouped", "grouped", booleanAttribute], readonly: ["readonly", "readonly", booleanAttribute], hideErrors: ["hideErrors", "hideErrors", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute], years: "years", value: "value" }, outputs: { valueChange: "valueChange" }, host: { properties: { "class.required": "required", "class.readonly": "readonly", "class.disabled": "disabled", "class.grouped": "grouped", "class.error": "error" }, classAttribute: "bb-date-picker" }, providers: [
|
|
2031
2059
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbDatePicker), multi: true },
|
|
2032
2060
|
{ provide: NG_VALIDATORS, useExisting: BbDatePicker, multi: true }
|
|
2033
|
-
], ngImport: i0, template: "<!-- Label of the date picker. -->\n@if (label; as labelContent) {\n <label class=\"bb-date-picker-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n </label>\n}\n\n@if (data$ | async; as data) {\n <!-- The form containing the year/month/day fields. -->\n <div [formGroup]=\"form\"\n class=\"bb-date-picker-container\">\n <div class=\"bb-date-picker-item\">\n <bb-form-control hideErrors>\n <select [class.has-value]=\"!!form?.get('day')?.value\"\n bbInput\n autocomplete=\"off\"\n formControlName=\"day\">\n <option [ngValue]=\"null\">{{ dayPlaceholder }}</option>\n @for (day of data?.days; track day?.value) {\n <option [ngValue]=\"day?.value\">{{ day?.label }}</option>\n }\n </select>\n </bb-form-control>\n </div>\n <div class=\"bb-date-picker-item\">\n <bb-form-control hideErrors>\n <select [class.has-value]=\"!!form?.get('month')?.value\"\n bbInput\n autocomplete=\"off\"\n formControlName=\"month\">\n <option [ngValue]=\"null\">{{ monthPlaceholder }}</option>\n @for (month of data?.months; track month?.value) {\n <option [ngValue]=\"month?.value\">{{ month?.label }}</option>\n }\n </select>\n </bb-form-control>\n </div>\n <div class=\"bb-date-picker-item\">\n <bb-form-control hideErrors>\n @if (data?.years?.length > 0) {\n <select [class.has-value]=\"!!form?.get('year')?.value\"\n bbInput\n autocomplete=\"off\"\n formControlName=\"year\">\n <option [ngValue]=\"null\">{{ yearPlaceholder }}</option>\n @for (year of data?.years; track year) {\n <option [ngValue]=\"year\">{{ year }}</option>\n }\n </select>\n } @else {\n <input [placeholder]=\"yearPlaceholder\"\n bbInput\n type=\"text\"\n inputmode=\"numeric\"\n minlength=\"4\"\n maxlength=\"4\"\n pattern=\"^[0-9]{4}$\"\n formControlName=\"year\"\n autocomplete=\"off\">\n }\n </bb-form-control>\n </div>\n </div>\n}\n\n<!-- The date picker error. -->\n@if (!hideErrors) {\n <bb-form-error (errorChange)=\"onErrorChange($event)\"></bb-form-error>\n}\n<!-- The date picker hint. -->\n@if (hint; as hintContent) {\n <p class=\"bb-date-picker-hint\">\n <ng-template [bbTemplate]=\"hintContent\">{{ hintContent }}</ng-template>\n </p>\n}\n", styles: [".bb-date-picker{display:block}.bb-date-picker.required>.bb-date-picker-label:after{content:\"*\";font-size:.75rem;vertical-align:top;color:var(--bb-form-label-required-color)}.bb-date-picker.readonly{pointer-events:none}.bb-date-picker.readonly>.bb-date-picker-container>.bb-date-picker-item>.bb-form-control>.bb-form-control-container{cursor:default;border-style:dotted;border-color:#bdc4c9}.bb-date-picker.readonly>.bb-date-picker-container>.bb-date-picker-item>.bb-form-control>.bb-form-control-container>select:disabled{opacity:1}.bb-date-picker.grouped{margin-bottom:1.5rem}.bb-date-picker.error>.bb-date-picker-label{color:#c23934}.bb-date-picker.error>.bb-date-picker-container>.bb-date-picker-item>.bb-form-control>.bb-form-control-container{border-color:#841515;background-color:#f8d3d3}.bb-date-picker.error>.bb-date-picker-container>.bb-date-picker-item>.bb-form-control>.bb-form-control-container:has(input:not(:disabled):not(:read-only):focus,select:not(:disabled):focus){box-shadow:0 .375rem .375rem -.375rem #0000001a,0 0 0 .1875rem #f8d3d3}.bb-date-picker-label{display:block;margin-bottom:.25rem;color:var(--bb-form-label-color, #525252);font-weight:var(--bb-form-label-font-weight, 400);font-size:var(--bb-form-label-font-size, .875rem)}.bb-date-picker-container{display:flex}.bb-date-picker-item{flex:1}.bb-date-picker-item>.bb-form-control>.bb-form-control-container:has(input:not(:disabled):not(:read-only):focus,select:not(:disabled):focus){z-index:1;position:relative}.bb-date-picker-item>.bb-form-control>.bb-form-control-container>select>option:first-child{color:#d2d2d2}.bb-date-picker-item>.bb-form-control>.bb-form-control-container>select:not(.has-value){color:#d2d2d2}.bb-date-picker-item>.bb-form-control>.bb-form-control-container>select:not(.has-value)>option:not(:first-child){color:#111}.bb-date-picker-item:not(:first-child):not(:last-child){margin:0 -1px}.bb-date-picker-item:not(:first-child):not(:last-child)>.bb-form-control>.bb-form-control-container{border-radius:0}.bb-date-picker-item:first-child>.bb-form-control>.bb-form-control-container{border-top-right-radius:0;border-bottom-right-radius:0}.bb-date-picker-item:last-child>.bb-form-control>.bb-form-control-container{border-top-left-radius:0;border-bottom-left-radius:0}.bb-date-picker-hint{display:block;line-height:1.5;margin-top:.25rem;font-size:.8125rem;color:#758795}\n"], dependencies: [{ kind: "directive", type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: BbFormControl, selector: "bb-form-control", inputs: ["label", "hint", "grouped", "hideErrors"] }, { kind: "directive", type: BbInput, selector: "input[bbInput],textarea[bbInput],select[bbInput]", inputs: ["required"] }, { kind: "component", type: BbFormError, selector: "bb-form-error", inputs: ["control"], outputs: ["errorChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2061
|
+
], ngImport: i0, template: "<!-- Label of the date picker. -->\n@if (label; as labelContent) {\n <label class=\"bb-date-picker-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n </label>\n}\n\n@if (data$ | async; as data) {\n <!-- The form containing the year/month/day fields. -->\n <div [formGroup]=\"form\"\n class=\"bb-date-picker-container\">\n <div class=\"bb-date-picker-item\">\n <bb-form-control hideErrors>\n <select [class.has-value]=\"!!form?.get('day')?.value\"\n bbInput\n autocomplete=\"off\"\n formControlName=\"day\">\n <option [ngValue]=\"null\">{{ dayPlaceholder }}</option>\n @for (day of data?.days; track day?.value) {\n <option [ngValue]=\"day?.value\">{{ day?.label }}</option>\n }\n </select>\n </bb-form-control>\n </div>\n <div class=\"bb-date-picker-item\">\n <bb-form-control hideErrors>\n <select [class.has-value]=\"!!form?.get('month')?.value\"\n bbInput\n autocomplete=\"off\"\n formControlName=\"month\">\n <option [ngValue]=\"null\">{{ monthPlaceholder }}</option>\n @for (month of data?.months; track month?.value) {\n <option [ngValue]=\"month?.value\">{{ month?.label }}</option>\n }\n </select>\n </bb-form-control>\n </div>\n <div class=\"bb-date-picker-item\">\n <bb-form-control hideErrors>\n @if (data?.years?.length > 0) {\n <select [class.has-value]=\"!!form?.get('year')?.value\"\n bbInput\n autocomplete=\"off\"\n formControlName=\"year\">\n <option [ngValue]=\"null\">{{ yearPlaceholder }}</option>\n @for (year of data?.years; track year) {\n <option [ngValue]=\"year\">{{ year }}</option>\n }\n </select>\n } @else {\n <input [placeholder]=\"yearPlaceholder\"\n bbInput\n type=\"text\"\n inputmode=\"numeric\"\n minlength=\"4\"\n maxlength=\"4\"\n pattern=\"^[0-9]{4}$\"\n formControlName=\"year\"\n autocomplete=\"off\">\n }\n </bb-form-control>\n </div>\n </div>\n}\n\n<!-- The date picker error. -->\n@if (!hideErrors) {\n <bb-form-error (errorChange)=\"onErrorChange($event)\"></bb-form-error>\n}\n<!-- The date picker hint. -->\n@if (hint; as hintContent) {\n <p class=\"bb-date-picker-hint\">\n <ng-template [bbTemplate]=\"hintContent\">{{ hintContent }}</ng-template>\n </p>\n}\n", styles: [".bb-date-picker{display:block}.bb-date-picker.required>.bb-date-picker-label:after{content:\"*\";font-size:.75rem;vertical-align:top;color:var(--bb-form-label-required-color)}.bb-date-picker.readonly{pointer-events:none}.bb-date-picker.readonly>.bb-date-picker-container>.bb-date-picker-item>.bb-form-control>.bb-form-control-container{cursor:default;border-style:dotted;border-color:#bdc4c9}.bb-date-picker.readonly>.bb-date-picker-container>.bb-date-picker-item>.bb-form-control>.bb-form-control-container>select:disabled{opacity:1}.bb-date-picker.grouped{margin-bottom:1.5rem}.bb-date-picker.error>.bb-date-picker-label{color:#c23934}.bb-date-picker.error>.bb-date-picker-container>.bb-date-picker-item>.bb-form-control>.bb-form-control-container{border-color:#841515;background-color:#f8d3d3}.bb-date-picker.error>.bb-date-picker-container>.bb-date-picker-item>.bb-form-control>.bb-form-control-container:has(input:not(:disabled):not(:read-only):focus,select:not(:disabled):focus){box-shadow:0 .375rem .375rem -.375rem #0000001a,0 0 0 .1875rem #f8d3d3}.bb-date-picker-label{display:block;margin-bottom:.25rem;color:var(--bb-form-label-color, #525252);font-weight:var(--bb-form-label-font-weight, 400);font-size:var(--bb-form-label-font-size, .875rem)}.bb-date-picker-container{display:flex}.bb-date-picker-item{flex:1}.bb-date-picker-item>.bb-form-control>.bb-form-control-container:has(input:not(:disabled):not(:read-only):focus,select:not(:disabled):focus){z-index:1;position:relative}.bb-date-picker-item>.bb-form-control>.bb-form-control-container>select>option:first-child{color:#d2d2d2}.bb-date-picker-item>.bb-form-control>.bb-form-control-container>select:not(.has-value){color:#d2d2d2}.bb-date-picker-item>.bb-form-control>.bb-form-control-container>select:not(.has-value)>option:not(:first-child){color:#111}.bb-date-picker-item:not(:first-child):not(:last-child){margin:0 -1px}.bb-date-picker-item:not(:first-child):not(:last-child)>.bb-form-control>.bb-form-control-container{border-radius:0}.bb-date-picker-item:first-child>.bb-form-control>.bb-form-control-container{border-top-right-radius:0;border-bottom-right-radius:0}.bb-date-picker-item:last-child>.bb-form-control>.bb-form-control-container{border-top-left-radius:0;border-bottom-left-radius:0}.bb-date-picker-hint{display:block;line-height:1.5;margin-top:.25rem;font-size:.8125rem;color:#758795}\n"], dependencies: [{ kind: "directive", type: BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: BbFormControl, selector: "bb-form-control", inputs: ["label", "hint", "grouped", "hideErrors"] }, { kind: "directive", type: BbInput, selector: "input[bbInput],textarea[bbInput],select[bbInput]", inputs: ["required"] }, { kind: "component", type: BbFormError, selector: "bb-form-error", inputs: ["control"], outputs: ["errorChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2034
2062
|
}
|
|
2035
2063
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: BbDatePicker, decorators: [{
|
|
2036
2064
|
type: Component,
|
|
@@ -2169,8 +2197,8 @@ class ElementsModule {
|
|
|
2169
2197
|
]
|
|
2170
2198
|
};
|
|
2171
2199
|
}
|
|
2172
|
-
static
|
|
2173
|
-
static
|
|
2200
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: ElementsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2201
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.0", ngImport: i0, type: ElementsModule, imports: [
|
|
2174
2202
|
// Directives.
|
|
2175
2203
|
BbFormError,
|
|
2176
2204
|
BbFormSubmit,
|
|
@@ -2230,9 +2258,9 @@ class ElementsModule {
|
|
|
2230
2258
|
BbMultiFileControl,
|
|
2231
2259
|
BbFilePicker,
|
|
2232
2260
|
BbImagePicker,
|
|
2233
|
-
BbDatePicker] });
|
|
2234
|
-
static
|
|
2235
|
-
BbDatePicker] });
|
|
2261
|
+
BbDatePicker] });
|
|
2262
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: ElementsModule, imports: [BbMultiFileControl,
|
|
2263
|
+
BbDatePicker] });
|
|
2236
2264
|
}
|
|
2237
2265
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: ElementsModule, decorators: [{
|
|
2238
2266
|
type: NgModule,
|