@bravobit/bb-foundation 0.23.5 → 0.23.6
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/controls/lib/control-error/control-error.utils.d.ts +3 -0
- package/controls/lib/controls.module.d.ts +4 -2
- package/controls/lib/form-control/form-control/form-control.component.d.ts +0 -2
- package/controls/lib/radio/radio-button/radio-button.component.d.ts +24 -0
- package/controls/lib/radio/radio-group/radio-group.component.d.ts +53 -0
- package/controls/lib/radio/radio.module.d.ts +11 -0
- package/controls/lib/toggle/toggle/toggle.component.d.ts +45 -0
- package/controls/lib/toggle/toggle-group/toggle-group.component.d.ts +23 -0
- package/controls/lib/toggle/toggle.module.d.ts +10 -0
- package/controls/public_api.d.ts +7 -0
- package/elements/lib/avatar/avatar.component.d.ts +1 -1
- package/esm2020/auth/lib/auth.interceptor.mjs +3 -3
- package/esm2020/auth/lib/auth.module.mjs +4 -4
- package/esm2020/auth/lib/auth.service.mjs +3 -3
- package/esm2020/auth/lib/directives/authenticated.directive.mjs +3 -3
- package/esm2020/auth/lib/directives/permission.directive.mjs +3 -3
- package/esm2020/auth/lib/guards/anonymous.guard.mjs +3 -3
- package/esm2020/auth/lib/guards/authenticated.guard.mjs +3 -3
- package/esm2020/auth/lib/guards/permission.guard.mjs +3 -3
- package/esm2020/auth/lib/permissions/permissions.service.mjs +3 -3
- package/esm2020/collections/lib/collections.module.mjs +4 -4
- package/esm2020/collections/lib/components/collections-pager/collections-pager.component.mjs +3 -3
- package/esm2020/collections/lib/components/collections-viewer/collections-viewer.component.mjs +3 -3
- package/esm2020/collections/lib/components/collections.directive.mjs +12 -12
- package/esm2020/controls/lib/checkbox/checkbox/checkbox.component.mjs +22 -10
- package/esm2020/controls/lib/checkbox/checkbox-group/checkbox-group.component.mjs +13 -7
- package/esm2020/controls/lib/checkbox/checkbox.module.mjs +4 -4
- package/esm2020/controls/lib/control-error/control-error/control-error.component.mjs +3 -3
- package/esm2020/controls/lib/control-error/control-error-submit.directive.mjs +3 -3
- package/esm2020/controls/lib/control-error/control-error.module.mjs +4 -4
- package/esm2020/controls/lib/control-error/control-error.utils.mjs +20 -0
- package/esm2020/controls/lib/controls.module.mjs +19 -10
- package/esm2020/controls/lib/form-control/form-control/form-control.component.mjs +14 -30
- package/esm2020/controls/lib/form-control/form-control-addon/form-control-addon.component.mjs +3 -3
- package/esm2020/controls/lib/form-control/form-control-input.directive.mjs +3 -3
- package/esm2020/controls/lib/form-control/form-control.module.mjs +4 -4
- package/esm2020/controls/lib/radio/radio-button/radio-button.component.mjs +75 -0
- package/esm2020/controls/lib/radio/radio-group/radio-group.component.mjs +168 -0
- package/esm2020/controls/lib/radio/radio.module.mjs +21 -0
- package/esm2020/controls/lib/toggle/toggle/toggle.component.mjs +153 -0
- package/esm2020/controls/lib/toggle/toggle-group/toggle-group.component.mjs +62 -0
- package/esm2020/controls/lib/toggle/toggle.module.mjs +20 -0
- package/esm2020/controls/public_api.mjs +8 -1
- package/esm2020/dashboard/lib/dashboard/dashboard.component.mjs +3 -3
- package/esm2020/dashboard/lib/dashboard-header/dashboard-header.component.mjs +3 -3
- package/esm2020/dashboard/lib/dashboard-menu/dashboard-menu.component.mjs +3 -3
- package/esm2020/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.mjs +3 -3
- package/esm2020/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.mjs +3 -3
- package/esm2020/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.mjs +3 -3
- package/esm2020/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.mjs +3 -3
- package/esm2020/dashboard/lib/dashboard.module.mjs +4 -4
- package/esm2020/dialog/lib/dialog-actions/dialog-actions.component.mjs +3 -3
- package/esm2020/dialog/lib/dialog-confirm/dialog-confirm.component.mjs +3 -3
- package/esm2020/dialog/lib/dialog-container/dialog-container.component.mjs +3 -3
- package/esm2020/dialog/lib/dialog-header/dialog-header.component.mjs +3 -3
- package/esm2020/dialog/lib/dialog-link/dialog-link.component.mjs +3 -3
- package/esm2020/dialog/lib/dialog-modal/dialog-modal.component.mjs +3 -3
- package/esm2020/dialog/lib/dialog-overlay/dialog-overlay.component.mjs +3 -3
- package/esm2020/dialog/lib/dialog.insertion.mjs +3 -3
- package/esm2020/dialog/lib/dialog.module.mjs +4 -4
- package/esm2020/dialog/lib/dialog.service.mjs +3 -3
- package/esm2020/elements/lib/avatar/avatar.component.mjs +15 -13
- package/esm2020/elements/lib/button/button.component.mjs +6 -6
- package/esm2020/elements/lib/checkbox/checkbox.component.mjs +3 -3
- package/esm2020/elements/lib/date-picker/date-picker.component.mjs +3 -3
- package/esm2020/elements/lib/directives/addon.directive.mjs +6 -6
- package/esm2020/elements/lib/directives/form-submit.directive.mjs +3 -3
- package/esm2020/elements/lib/directives/form-submitter.directive.mjs +3 -3
- package/esm2020/elements/lib/directives/input.directive.mjs +6 -6
- package/esm2020/elements/lib/dropdown/dropdown.component.mjs +6 -6
- package/esm2020/elements/lib/elements.module.mjs +4 -4
- package/esm2020/elements/lib/file-picker/file-picker.component.mjs +3 -3
- package/esm2020/elements/lib/form-control/form-control.component.mjs +3 -3
- package/esm2020/elements/lib/form-error/form-error.component.mjs +3 -3
- package/esm2020/elements/lib/form-group/form-group.component.mjs +3 -3
- package/esm2020/elements/lib/icon/icon.component.mjs +3 -3
- package/esm2020/elements/lib/image-picker/image-picker.component.mjs +3 -3
- package/esm2020/elements/lib/pipes/file-image.pipe.mjs +3 -3
- package/esm2020/elements/lib/pipes/file-size.pipe.mjs +3 -3
- package/esm2020/elements/lib/pipes/relative-time.pipe.mjs +3 -3
- package/esm2020/elements/lib/spinner/spinner.component.mjs +3 -3
- package/esm2020/elements/lib/tag/tag.component.mjs +3 -3
- package/esm2020/http/lib/http.module.mjs +4 -4
- package/esm2020/http/lib/interceptors/base-url.interceptor.mjs +3 -3
- package/esm2020/http/lib/interceptors/error.interceptor.mjs +3 -3
- package/esm2020/lib/core/services/clipboard.service.mjs +3 -3
- package/esm2020/lib/core/services/exif.service.mjs +3 -3
- package/esm2020/lib/core/services/file-loader.service.mjs +3 -3
- package/esm2020/lib/core/services/image-converter.service.mjs +3 -3
- package/esm2020/lib/core/services/languages.service.mjs +3 -3
- package/esm2020/lib/core/services/network.service.mjs +3 -3
- package/esm2020/lib/core/services/patch.service.mjs +3 -3
- package/esm2020/localize/lib/localize.module.mjs +4 -4
- package/esm2020/localize/lib/localize.pipe.mjs +3 -3
- package/esm2020/localize/lib/localize.service.mjs +3 -3
- package/esm2020/localize/lib/views/localize-string/localize-string.component.mjs +3 -3
- package/esm2020/localize/lib/views/localize-template.directive.mjs +3 -3
- package/esm2020/masking/lib/directives/currency-mask.directive.mjs +3 -3
- package/esm2020/masking/lib/directives/date-mask.directive.mjs +3 -3
- package/esm2020/masking/lib/directives/input-mask.directive.mjs +3 -3
- package/esm2020/masking/lib/masking.module.mjs +4 -4
- package/esm2020/masking/lib/masking.service.mjs +3 -3
- package/esm2020/notifications/lib/notifications-item/notifications-item.component.mjs +3 -3
- package/esm2020/notifications/lib/notifications-list/notifications-list.component.mjs +3 -3
- package/esm2020/notifications/lib/notifications.module.mjs +4 -4
- package/esm2020/notifications/lib/notifications.service.mjs +3 -3
- package/esm2020/recaptcha/lib/recaptcha/recaptcha.component.mjs +3 -3
- package/esm2020/recaptcha/lib/recaptcha-loader.service.mjs +3 -3
- package/esm2020/recaptcha/lib/recaptcha.module.mjs +4 -4
- package/esm2020/storage/lib/storage.service.mjs +3 -3
- package/esm2020/table/lib/components/table/table.component.mjs +9 -9
- package/esm2020/table/lib/components/table-cell/table-cell.component.mjs +3 -3
- package/esm2020/table/lib/components/table-header-cell/table-header-cell.component.mjs +3 -3
- package/esm2020/table/lib/components/table-pager/table-pager.component.mjs +3 -3
- package/esm2020/table/lib/table.module.mjs +4 -4
- package/esm2020/theming/lib/themes/radio-button.theme.mjs +29 -0
- package/esm2020/theming/lib/themes/radio-group.theme.mjs +20 -0
- package/esm2020/theming/lib/themes/toggle-group.theme.mjs +17 -0
- package/esm2020/theming/lib/themes/toggle.theme.mjs +28 -0
- package/esm2020/theming/lib/theming.data.mjs +9 -1
- package/esm2020/theming/lib/theming.directive.mjs +3 -3
- package/esm2020/theming/lib/theming.interface.mjs +1 -1
- package/esm2020/theming/lib/theming.module.mjs +4 -4
- package/esm2020/utils/lib/directives/autosize.directive.mjs +3 -3
- package/esm2020/utils/lib/directives/focus-trap.directive.mjs +3 -3
- package/esm2020/utils/lib/directives/focus.directive.mjs +3 -3
- package/esm2020/utils/lib/directives/template.directive.mjs +3 -3
- package/esm2020/utils/lib/utils.module.mjs +4 -4
- package/fesm2015/bravobit-bb-foundation-auth.mjs +28 -28
- package/fesm2015/bravobit-bb-foundation-collections.mjs +22 -22
- package/fesm2015/bravobit-bb-foundation-controls.mjs +677 -179
- package/fesm2015/bravobit-bb-foundation-controls.mjs.map +1 -1
- package/fesm2015/bravobit-bb-foundation-dashboard.mjs +25 -25
- package/fesm2015/bravobit-bb-foundation-dialog.mjs +31 -31
- package/fesm2015/bravobit-bb-foundation-elements.mjs +87 -85
- package/fesm2015/bravobit-bb-foundation-elements.mjs.map +1 -1
- package/fesm2015/bravobit-bb-foundation-http.mjs +10 -10
- package/fesm2015/bravobit-bb-foundation-localize.mjs +16 -16
- package/fesm2015/bravobit-bb-foundation-masking.mjs +16 -16
- package/fesm2015/bravobit-bb-foundation-notifications.mjs +13 -13
- package/fesm2015/bravobit-bb-foundation-recaptcha.mjs +10 -10
- package/fesm2015/bravobit-bb-foundation-storage.mjs +3 -3
- package/fesm2015/bravobit-bb-foundation-table.mjs +22 -22
- package/fesm2015/bravobit-bb-foundation-theming.mjs +102 -7
- package/fesm2015/bravobit-bb-foundation-theming.mjs.map +1 -1
- package/fesm2015/bravobit-bb-foundation-utils.mjs +16 -16
- package/fesm2015/bravobit-bb-foundation.mjs +21 -21
- package/fesm2020/bravobit-bb-foundation-auth.mjs +28 -28
- package/fesm2020/bravobit-bb-foundation-collections.mjs +22 -22
- package/fesm2020/bravobit-bb-foundation-controls.mjs +663 -173
- package/fesm2020/bravobit-bb-foundation-controls.mjs.map +1 -1
- package/fesm2020/bravobit-bb-foundation-dashboard.mjs +25 -25
- package/fesm2020/bravobit-bb-foundation-dialog.mjs +31 -31
- package/fesm2020/bravobit-bb-foundation-elements.mjs +87 -85
- package/fesm2020/bravobit-bb-foundation-elements.mjs.map +1 -1
- package/fesm2020/bravobit-bb-foundation-http.mjs +10 -10
- package/fesm2020/bravobit-bb-foundation-localize.mjs +16 -16
- package/fesm2020/bravobit-bb-foundation-masking.mjs +16 -16
- package/fesm2020/bravobit-bb-foundation-notifications.mjs +13 -13
- package/fesm2020/bravobit-bb-foundation-recaptcha.mjs +10 -10
- package/fesm2020/bravobit-bb-foundation-storage.mjs +3 -3
- package/fesm2020/bravobit-bb-foundation-table.mjs +22 -22
- package/fesm2020/bravobit-bb-foundation-theming.mjs +102 -7
- package/fesm2020/bravobit-bb-foundation-theming.mjs.map +1 -1
- package/fesm2020/bravobit-bb-foundation-utils.mjs +16 -16
- package/fesm2020/bravobit-bb-foundation.mjs +21 -21
- package/package.json +1 -1
- package/theming/lib/themes/radio-button.theme.d.ts +26 -0
- package/theming/lib/themes/radio-group.theme.d.ts +17 -0
- package/theming/lib/themes/toggle-group.theme.d.ts +16 -0
- package/theming/lib/themes/toggle.theme.d.ts +25 -0
- package/theming/lib/theming.interface.d.ts +8 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, EventEmitter, forwardRef, ViewChild, Output, NgModule, Directive, Optional,
|
|
2
|
+
import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, EventEmitter, forwardRef, ViewChild, Output, NgModule, Directive, InjectionToken, Optional, Inject, HostBinding, HostListener, Self, ContentChild } from '@angular/core';
|
|
3
3
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
4
|
-
import * as
|
|
4
|
+
import * as i2 from '@angular/common';
|
|
5
5
|
import { CommonModule } from '@angular/common';
|
|
6
|
-
import * as i2 from '@bravobit/bb-foundation/utils';
|
|
6
|
+
import * as i2$1 from '@bravobit/bb-foundation/utils';
|
|
7
7
|
import { UtilsModule } from '@bravobit/bb-foundation/utils';
|
|
8
|
-
import * as i2$
|
|
9
|
-
import { NG_VALUE_ACCESSOR, Validators } from '@angular/forms';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import * as i2$2 from '@angular/forms';
|
|
9
|
+
import { NG_VALUE_ACCESSOR, NgControl, Validators } from '@angular/forms';
|
|
10
|
+
import { BehaviorSubject, Subscription, fromEvent, merge, of } from 'rxjs';
|
|
11
|
+
import { map, startWith, distinctUntilChanged, pairwise, switchMap, delay } from 'rxjs/operators';
|
|
12
12
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
13
|
-
import * as i1
|
|
13
|
+
import * as i1 from '@bravobit/bb-foundation/localize';
|
|
14
14
|
|
|
15
15
|
class BbiCheckboxGroup {
|
|
16
16
|
constructor(_changeDetectorRef) {
|
|
@@ -22,7 +22,9 @@ class BbiCheckboxGroup {
|
|
|
22
22
|
this._inline = false;
|
|
23
23
|
}
|
|
24
24
|
// Grouped.
|
|
25
|
-
get grouped() {
|
|
25
|
+
get grouped() {
|
|
26
|
+
return this._grouped;
|
|
27
|
+
}
|
|
26
28
|
set grouped(value) {
|
|
27
29
|
const newValue = coerceBooleanProperty(value);
|
|
28
30
|
if (newValue !== this.grouped) {
|
|
@@ -31,7 +33,9 @@ class BbiCheckboxGroup {
|
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
// Required.
|
|
34
|
-
get required() {
|
|
36
|
+
get required() {
|
|
37
|
+
return this._required;
|
|
38
|
+
}
|
|
35
39
|
set required(value) {
|
|
36
40
|
const newValue = coerceBooleanProperty(value);
|
|
37
41
|
if (newValue !== this.required) {
|
|
@@ -40,7 +44,9 @@ class BbiCheckboxGroup {
|
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
46
|
// Inline.
|
|
43
|
-
get inline() {
|
|
47
|
+
get inline() {
|
|
48
|
+
return this._inline;
|
|
49
|
+
}
|
|
44
50
|
set inline(value) {
|
|
45
51
|
const newValue = coerceBooleanProperty(value);
|
|
46
52
|
if (newValue !== this.inline) {
|
|
@@ -49,9 +55,9 @@ class BbiCheckboxGroup {
|
|
|
49
55
|
}
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
|
-
BbiCheckboxGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
53
|
-
BbiCheckboxGroup.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.
|
|
54
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
58
|
+
BbiCheckboxGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiCheckboxGroup, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
59
|
+
BbiCheckboxGroup.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: BbiCheckboxGroup, selector: "bbi-checkbox-group", inputs: { label: "label", grouped: "grouped", required: "required", inline: "inline" }, host: { properties: { "class.grouped": "grouped", "class.required": "required", "class.inline": "inline" }, classAttribute: "bbi-checkbox-group" }, ngImport: i0, template: "<label *ngIf=\"label as labelContent\"\n class=\"bbi-checkbox-group-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n</label>\n\n<div class=\"bbi-checkbox-group-items\">\n <ng-content select=\"bbi-checkbox\"></ng-content>\n</div>\n", styles: [".bbi-checkbox-group{display:block}.bbi-checkbox-group.grouped{margin-bottom:var(--checkbox-group-grouping, 20px)}.bbi-checkbox-group.required>.bbi-checkbox-group-label:after{content:\"*\";color:#c23934;font-size:12px;line-height:1.5}.bbi-checkbox-group-label{border:0;padding:0;font-family:inherit;display:inline-block;box-sizing:border-box;vertical-align:initial;color:var(--checkbox-group-label-color, #525252);font-size:var(--checkbox-group-label-font-size, 14px);margin-bottom:var(--checkbox-group-label-offset, 4px);line-height:var(--checkbox-group-label-line-height, 1.33);font-weight:var(--checkbox-group-label-font-weight, 400)}.bbi-checkbox-group-items{display:flex;flex-direction:column}.bbi-checkbox-group-items:not(:empty){margin-bottom:-var(--checkbox-group-item-spacing-vertical,4px)}.bbi-checkbox-group-items>*{margin-bottom:var(--checkbox-group-item-spacing-vertical, 4px)}@media only screen and (min-width: 768px){.bbi-checkbox-group.inline>.bbi-checkbox-group-items{flex-wrap:wrap;flex-direction:row}.bbi-checkbox-group.inline>.bbi-checkbox-group-items>*:not(:last-child){margin-right:var(--checkbox-group-item-spacing-horizontal, 10px)}}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiCheckboxGroup, decorators: [{
|
|
55
61
|
type: Component,
|
|
56
62
|
args: [{ selector: 'bbi-checkbox-group', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
57
63
|
'class': 'bbi-checkbox-group',
|
|
@@ -69,13 +75,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
|
|
|
69
75
|
type: Input
|
|
70
76
|
}] } });
|
|
71
77
|
|
|
72
|
-
let nextUniqueId$
|
|
78
|
+
let nextUniqueId$2 = 0;
|
|
73
79
|
class BbiCheckbox {
|
|
74
80
|
constructor(_renderer, _changeDetectorRef) {
|
|
75
81
|
this._renderer = _renderer;
|
|
76
82
|
this._changeDetectorRef = _changeDetectorRef;
|
|
77
83
|
// Readonly data.
|
|
78
|
-
this.labelId = `bbi-checkbox-${nextUniqueId$
|
|
84
|
+
this.labelId = `bbi-checkbox-${nextUniqueId$2++}`;
|
|
79
85
|
// Outputs.
|
|
80
86
|
this.checkedChange = new EventEmitter();
|
|
81
87
|
this.indeterminateChange = new EventEmitter();
|
|
@@ -90,7 +96,9 @@ class BbiCheckbox {
|
|
|
90
96
|
this.onTouched = () => ({});
|
|
91
97
|
}
|
|
92
98
|
// Checked.
|
|
93
|
-
get checked() {
|
|
99
|
+
get checked() {
|
|
100
|
+
return this._checked;
|
|
101
|
+
}
|
|
94
102
|
set checked(value) {
|
|
95
103
|
const newValue = coerceBooleanProperty(value);
|
|
96
104
|
if (newValue !== this.checked) {
|
|
@@ -99,7 +107,9 @@ class BbiCheckbox {
|
|
|
99
107
|
}
|
|
100
108
|
}
|
|
101
109
|
// Disabled.
|
|
102
|
-
get disabled() {
|
|
110
|
+
get disabled() {
|
|
111
|
+
return this._disabled;
|
|
112
|
+
}
|
|
103
113
|
set disabled(value) {
|
|
104
114
|
const newValue = coerceBooleanProperty(value);
|
|
105
115
|
if (newValue !== this.disabled) {
|
|
@@ -108,7 +118,9 @@ class BbiCheckbox {
|
|
|
108
118
|
}
|
|
109
119
|
}
|
|
110
120
|
// Grouped.
|
|
111
|
-
get grouped() {
|
|
121
|
+
get grouped() {
|
|
122
|
+
return this._grouped;
|
|
123
|
+
}
|
|
112
124
|
set grouped(value) {
|
|
113
125
|
const newValue = coerceBooleanProperty(value);
|
|
114
126
|
if (newValue !== this.grouped) {
|
|
@@ -117,13 +129,17 @@ class BbiCheckbox {
|
|
|
117
129
|
}
|
|
118
130
|
}
|
|
119
131
|
// Indeterminate.
|
|
120
|
-
get indeterminate() {
|
|
132
|
+
get indeterminate() {
|
|
133
|
+
return this._indeterminate;
|
|
134
|
+
}
|
|
121
135
|
set indeterminate(value) {
|
|
122
136
|
this._indeterminate = coerceBooleanProperty(value);
|
|
123
137
|
this.syncField('indeterminate', this._indeterminate);
|
|
124
138
|
}
|
|
125
139
|
// Required.
|
|
126
|
-
get required() {
|
|
140
|
+
get required() {
|
|
141
|
+
return this._required;
|
|
142
|
+
}
|
|
127
143
|
set required(value) {
|
|
128
144
|
const newValue = coerceBooleanProperty(value);
|
|
129
145
|
if (newValue !== this.required) {
|
|
@@ -132,7 +148,9 @@ class BbiCheckbox {
|
|
|
132
148
|
}
|
|
133
149
|
}
|
|
134
150
|
// Hide text.
|
|
135
|
-
get hideText() {
|
|
151
|
+
get hideText() {
|
|
152
|
+
return this._hideText;
|
|
153
|
+
}
|
|
136
154
|
set hideText(value) {
|
|
137
155
|
const newValue = coerceBooleanProperty(value);
|
|
138
156
|
if (newValue !== this.hideText) {
|
|
@@ -197,11 +215,11 @@ class BbiCheckbox {
|
|
|
197
215
|
this._renderer.setProperty(element, field, value);
|
|
198
216
|
}
|
|
199
217
|
}
|
|
200
|
-
BbiCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
201
|
-
BbiCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.
|
|
218
|
+
BbiCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiCheckbox, deps: [{ token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
219
|
+
BbiCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: BbiCheckbox, selector: "bbi-checkbox", inputs: { checked: "checked", disabled: "disabled", grouped: "grouped", indeterminate: "indeterminate", required: "required", hideText: "hideText" }, outputs: { checkedChange: "checkedChange", indeterminateChange: "indeterminateChange" }, host: { properties: { "class.grouped": "grouped", "class.indeterminate": "indeterminate", "class.required": "required" }, classAttribute: "bbi-checkbox" }, providers: [
|
|
202
220
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbiCheckbox), multi: true }
|
|
203
|
-
], viewQueries: [{ propertyName: "inputElementRef", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: "<input #input\n [id]=\"labelId\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n (change)=\"onChangeEvent($event)\"\n (click)=\"onClickEvent($event)\"\n (blur)=\"onTouched()\"\n class=\"bbi-checkbox-input\"\n type=\"checkbox\">\n<label [attr.for]=\"labelId\"\n class=\"bbi-checkbox-label\">\n <span *ngIf=\"!hideText\"\n class=\"bbi-checkbox-text\"><ng-content></ng-content></span>\n</label>\n", styles: [".bbi-checkbox{display:block}.bbi-checkbox.grouped{margin-bottom:var(--checkbox-grouping, 20px)}.bbi-checkbox.required>.bbi-checkbox-label>.bbi-checkbox-text:after{content:\"*\";color:#c23934;font-size:12px;line-height:1.5;margin-left:3px}.bbi-checkbox-input{border:0;width:1px;padding:0;height:1px;margin:-1px;overflow:hidden;position:absolute;visibility:inherit;white-space:nowrap;clip:rect(0,0,0,0)}.bbi-checkbox-input:checked+.bbi-checkbox-label:before,.bbi-checkbox-input:indeterminate+.bbi-checkbox-label:before{background-color:var(--checkbox-colors-accent, var(--accent-color, #1565c0));border:var(--checkbox-border-thickness, 1px) solid var(--checkbox-colors-accent, var(--accent-color, #1565c0))}.bbi-checkbox-input:checked+.bbi-checkbox-label:after,.bbi-checkbox-input:indeterminate+.bbi-checkbox-label:after{opacity:1;transform:scale(1) rotate(-45deg)}.bbi-checkbox-input:indeterminate+.bbi-checkbox-label:after{left:calc(var(--checkbox-size, 20px) / 4);width:calc(var(--checkbox-size, 20px) / 2);transform:scale(1) rotate(0);border-left:0 solid var(--checkbox-check-color, white);border-bottom:var(--checkbox-check-thickness, 2px) solid var(--checkbox-check-color, white)}.bbi-checkbox-input:focus+.bbi-checkbox-label:before{outline-color:var(--checkbox-outline-color, var(--accent-color, #1565c0))}.bbi-checkbox-input:disabled+.bbi-checkbox-label{cursor:not-allowed;color:var(--checkbox-colors-disabled, #c6c6c6)}.bbi-checkbox-input:disabled+.bbi-checkbox-label:before{border-color:var(--checkbox-colors-disabled, #c6c6c6)}.bbi-checkbox-input:disabled+.bbi-checkbox-label>.bbi-checkbox-text{color:var(--checkbox-colors-disabled, #c6c6c6)}.bbi-checkbox-input:checked:disabled+.bbi-checkbox-label:before,.bbi-checkbox-input:indeterminate:disabled+.bbi-checkbox-label:before{background-color:var(--checkbox-colors-disabled, #c6c6c6)}.bbi-checkbox-label{border:0;margin:0;display:flex;cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;align-items:center;font-family:inherit;vertical-align:initial;min-height:var(--checkbox-size, 20px);padding-left:var(--checkbox-size, 20px)}.bbi-checkbox-label:before{left:0;content:\"\";position:absolute;width:var(--checkbox-size, 20px);height:var(--checkbox-size, 20px);background-color:initial;border-radius:var(--checkbox-border-radius, 4px);outline-offset:var(--checkbox-outline-offset, 1px);outline:var(--checkbox-outline-thickness, 2px) solid transparent;border:var(--checkbox-border-thickness, 1px) solid var(--checkbox-border-color, #111111);transition:outline-color .2s cubic-bezier(0,0,.2,1),background-color .18s cubic-bezier(0,0,.2,1),border-color .18s cubic-bezier(0,0,.2,1)}.bbi-checkbox-label:after{opacity:0;content:\"\";background:none;position:absolute;transform-origin:center;width:var(--checkbox-check-size, 12px);transform:scale(.85) rotate(-60deg);height:calc(var(--checkbox-check-size, 12px) / 2);top:calc(50% - var(--checkbox-check-size, 12px) / 2 * .75);left:calc((var(--checkbox-size, 20px) - var(--checkbox-check-size, 12px)) / 2);border-left:var(--checkbox-check-thickness, 2px) solid var(--checkbox-check-color, white);border-bottom:var(--checkbox-check-thickness, 2px) solid var(--checkbox-check-color, white);transition:opacity .12s cubic-bezier(0,0,.2,1),transform .18s cubic-bezier(0,0,.2,1)}.bbi-checkbox-text{color:var(--checkbox-label-color, #111111);padding-left:var(--checkbox-label-offset, 6px);font-size:var(--checkbox-label-font-size, 16px);font-weight:var(--checkbox-label-font-weight, 400);line-height:var(--checkbox-label-line-height, 1.28)}\n"], dependencies: [{ kind: "directive", type:
|
|
204
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
221
|
+
], viewQueries: [{ propertyName: "inputElementRef", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: "<input #input\n [id]=\"labelId\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n (change)=\"onChangeEvent($event)\"\n (click)=\"onClickEvent($event)\"\n (blur)=\"onTouched()\"\n class=\"bbi-checkbox-input\"\n type=\"checkbox\">\n<label [attr.for]=\"labelId\"\n class=\"bbi-checkbox-label\">\n <span *ngIf=\"!hideText\"\n class=\"bbi-checkbox-text\"><ng-content></ng-content></span>\n</label>\n", styles: [".bbi-checkbox{display:block}.bbi-checkbox.grouped{margin-bottom:var(--checkbox-grouping, 20px)}.bbi-checkbox.required>.bbi-checkbox-label>.bbi-checkbox-text:after{content:\"*\";color:#c23934;font-size:12px;line-height:1.5;margin-left:3px}.bbi-checkbox-input{border:0;width:1px;padding:0;height:1px;margin:-1px;overflow:hidden;position:absolute;visibility:inherit;white-space:nowrap;clip:rect(0,0,0,0)}.bbi-checkbox-input:checked+.bbi-checkbox-label:before,.bbi-checkbox-input:indeterminate+.bbi-checkbox-label:before{background-color:var(--checkbox-colors-accent, var(--accent-color, #1565c0));border:var(--checkbox-border-thickness, 1px) solid var(--checkbox-colors-accent, var(--accent-color, #1565c0))}.bbi-checkbox-input:checked+.bbi-checkbox-label:after,.bbi-checkbox-input:indeterminate+.bbi-checkbox-label:after{opacity:1;transform:scale(1) rotate(-45deg)}.bbi-checkbox-input:indeterminate+.bbi-checkbox-label:after{left:calc(var(--checkbox-size, 20px) / 4);width:calc(var(--checkbox-size, 20px) / 2);transform:scale(1) rotate(0);border-left:0 solid var(--checkbox-check-color, white);border-bottom:var(--checkbox-check-thickness, 2px) solid var(--checkbox-check-color, white)}.bbi-checkbox-input:focus+.bbi-checkbox-label:before{outline-color:var(--checkbox-outline-color, var(--accent-color, #1565c0))}.bbi-checkbox-input:disabled+.bbi-checkbox-label{cursor:not-allowed;color:var(--checkbox-colors-disabled, #c6c6c6)}.bbi-checkbox-input:disabled+.bbi-checkbox-label:before{border-color:var(--checkbox-colors-disabled, #c6c6c6)}.bbi-checkbox-input:disabled+.bbi-checkbox-label>.bbi-checkbox-text{color:var(--checkbox-colors-disabled, #c6c6c6)}.bbi-checkbox-input:checked:disabled+.bbi-checkbox-label:before,.bbi-checkbox-input:indeterminate:disabled+.bbi-checkbox-label:before{background-color:var(--checkbox-colors-disabled, #c6c6c6)}.bbi-checkbox-label{border:0;margin:0;display:flex;cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;align-items:center;font-family:inherit;vertical-align:initial;min-height:var(--checkbox-size, 20px);padding-left:var(--checkbox-size, 20px)}.bbi-checkbox-label:before{left:0;content:\"\";position:absolute;width:var(--checkbox-size, 20px);height:var(--checkbox-size, 20px);background-color:initial;border-radius:var(--checkbox-border-radius, 4px);outline-offset:var(--checkbox-outline-offset, 1px);outline:var(--checkbox-outline-thickness, 2px) solid transparent;border:var(--checkbox-border-thickness, 1px) solid var(--checkbox-border-color, #111111);transition:outline-color .2s cubic-bezier(0,0,.2,1),background-color .18s cubic-bezier(0,0,.2,1),border-color .18s cubic-bezier(0,0,.2,1)}.bbi-checkbox-label:after{opacity:0;content:\"\";background:none;position:absolute;transform-origin:center;width:var(--checkbox-check-size, 12px);transform:scale(.85) rotate(-60deg);height:calc(var(--checkbox-check-size, 12px) / 2);top:calc(50% - var(--checkbox-check-size, 12px) / 2 * .75);left:calc((var(--checkbox-size, 20px) - var(--checkbox-check-size, 12px)) / 2);border-left:var(--checkbox-check-thickness, 2px) solid var(--checkbox-check-color, white);border-bottom:var(--checkbox-check-thickness, 2px) solid var(--checkbox-check-color, white);transition:opacity .12s cubic-bezier(0,0,.2,1),transform .18s cubic-bezier(0,0,.2,1)}.bbi-checkbox-text{color:var(--checkbox-label-color, #111111);padding-left:var(--checkbox-label-offset, 6px);font-size:var(--checkbox-label-font-size, 16px);font-weight:var(--checkbox-label-font-weight, 400);line-height:var(--checkbox-label-line-height, 1.28)}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
222
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiCheckbox, decorators: [{
|
|
205
223
|
type: Component,
|
|
206
224
|
args: [{ selector: 'bbi-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
|
|
207
225
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbiCheckbox), multi: true }
|
|
@@ -234,10 +252,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
|
|
|
234
252
|
|
|
235
253
|
class CheckboxModule {
|
|
236
254
|
}
|
|
237
|
-
CheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
238
|
-
CheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.
|
|
239
|
-
CheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.
|
|
240
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
255
|
+
CheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
256
|
+
CheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: CheckboxModule, declarations: [BbiCheckbox, BbiCheckboxGroup], imports: [CommonModule, UtilsModule], exports: [BbiCheckbox, BbiCheckboxGroup] });
|
|
257
|
+
CheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CheckboxModule, imports: [CommonModule, UtilsModule] });
|
|
258
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CheckboxModule, decorators: [{
|
|
241
259
|
type: NgModule,
|
|
242
260
|
args: [{
|
|
243
261
|
imports: [CommonModule, UtilsModule],
|
|
@@ -246,38 +264,96 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
|
|
|
246
264
|
}]
|
|
247
265
|
}] });
|
|
248
266
|
|
|
249
|
-
class
|
|
250
|
-
constructor(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
this.
|
|
267
|
+
class BbiToggleGroup {
|
|
268
|
+
constructor(_changeDetectorRef) {
|
|
269
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
270
|
+
// Inputs.
|
|
271
|
+
this.label = null;
|
|
272
|
+
this._grouped = false;
|
|
273
|
+
this._required = false;
|
|
274
|
+
this._inline = false;
|
|
275
|
+
}
|
|
276
|
+
// Grouped.
|
|
277
|
+
get grouped() { return this._grouped; }
|
|
278
|
+
set grouped(value) {
|
|
279
|
+
const newValue = coerceBooleanProperty(value);
|
|
280
|
+
if (newValue !== this.grouped) {
|
|
281
|
+
this._grouped = newValue;
|
|
282
|
+
this._changeDetectorRef.markForCheck();
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
// Required.
|
|
286
|
+
get required() { return this._required; }
|
|
287
|
+
set required(value) {
|
|
288
|
+
const newValue = coerceBooleanProperty(value);
|
|
289
|
+
if (newValue !== this.required) {
|
|
290
|
+
this._required = newValue;
|
|
291
|
+
this._changeDetectorRef.markForCheck();
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
// Inline.
|
|
295
|
+
get inline() { return this._inline; }
|
|
296
|
+
set inline(value) {
|
|
297
|
+
const newValue = coerceBooleanProperty(value);
|
|
298
|
+
if (newValue !== this.inline) {
|
|
299
|
+
this._inline = newValue;
|
|
300
|
+
this._changeDetectorRef.markForCheck();
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
BbiToggleGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiToggleGroup, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
305
|
+
BbiToggleGroup.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: BbiToggleGroup, selector: "bbi-toggle-group", inputs: { label: "label", grouped: "grouped", required: "required", inline: "inline" }, host: { properties: { "class.grouped": "grouped", "class.required": "required", "class.inline": "inline" }, classAttribute: "bbi-toggle-group" }, ngImport: i0, template: "<label *ngIf=\"label as labelContent\"\n class=\"bbi-toggle-group-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n</label>\n\n<div class=\"bbi-toggle-group-items\">\n <ng-content select=\"bbi-toggle\"></ng-content>\n</div>\n", styles: [".bbi-toggle-group{display:block}.bbi-toggle-group.grouped{margin-bottom:var(--toggle-group-grouping, 20px)}.bbi-toggle-group.required>.bbi-toggle-group-label:after{content:\"*\";color:#c23934;font-size:12px;line-height:1.5}.bbi-toggle-group-label{border:0;padding:0;font-family:inherit;display:inline-block;box-sizing:border-box;vertical-align:initial;color:var(--toggle-group-label-color, #525252);font-size:var(--toggle-group-label-font-size, 14px);margin-bottom:var(--toggle-group-label-offset, 4px);line-height:var(--toggle-group-label-line-height, 1.33);font-weight:var(--toggle-group-label-font-weight, 400)}.bbi-toggle-group-items{display:flex;flex-direction:column}.bbi-toggle-group-items:not(:empty){margin-bottom:-var(--toggle-group-item-spacing-vertical,4px)}.bbi-toggle-group-items>*{margin-bottom:var(--toggle-group-item-spacing-vertical, 4px)}@media only screen and (min-width: 768px){.bbi-toggle-group.inline>.bbi-toggle-group-items{flex-wrap:wrap;flex-direction:row}.bbi-toggle-group.inline>.bbi-toggle-group-items>*:not(:last-child){margin-right:var(--toggle-group-item-spacing-horizontal, 10px)}}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
306
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiToggleGroup, decorators: [{
|
|
307
|
+
type: Component,
|
|
308
|
+
args: [{ selector: 'bbi-toggle-group', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
309
|
+
'class': 'bbi-toggle-group',
|
|
310
|
+
'[class.grouped]': 'grouped',
|
|
311
|
+
'[class.required]': 'required',
|
|
312
|
+
'[class.inline]': 'inline'
|
|
313
|
+
}, preserveWhitespaces: false, template: "<label *ngIf=\"label as labelContent\"\n class=\"bbi-toggle-group-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n</label>\n\n<div class=\"bbi-toggle-group-items\">\n <ng-content select=\"bbi-toggle\"></ng-content>\n</div>\n", styles: [".bbi-toggle-group{display:block}.bbi-toggle-group.grouped{margin-bottom:var(--toggle-group-grouping, 20px)}.bbi-toggle-group.required>.bbi-toggle-group-label:after{content:\"*\";color:#c23934;font-size:12px;line-height:1.5}.bbi-toggle-group-label{border:0;padding:0;font-family:inherit;display:inline-block;box-sizing:border-box;vertical-align:initial;color:var(--toggle-group-label-color, #525252);font-size:var(--toggle-group-label-font-size, 14px);margin-bottom:var(--toggle-group-label-offset, 4px);line-height:var(--toggle-group-label-line-height, 1.33);font-weight:var(--toggle-group-label-font-weight, 400)}.bbi-toggle-group-items{display:flex;flex-direction:column}.bbi-toggle-group-items:not(:empty){margin-bottom:-var(--toggle-group-item-spacing-vertical,4px)}.bbi-toggle-group-items>*{margin-bottom:var(--toggle-group-item-spacing-vertical, 4px)}@media only screen and (min-width: 768px){.bbi-toggle-group.inline>.bbi-toggle-group-items{flex-wrap:wrap;flex-direction:row}.bbi-toggle-group.inline>.bbi-toggle-group-items>*:not(:last-child){margin-right:var(--toggle-group-item-spacing-horizontal, 10px)}}\n"] }]
|
|
314
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { label: [{
|
|
315
|
+
type: Input
|
|
316
|
+
}], grouped: [{
|
|
317
|
+
type: Input
|
|
318
|
+
}], required: [{
|
|
319
|
+
type: Input
|
|
320
|
+
}], inline: [{
|
|
321
|
+
type: Input
|
|
322
|
+
}] } });
|
|
323
|
+
|
|
324
|
+
let nextUniqueId$1 = 0;
|
|
325
|
+
class BbiToggle {
|
|
326
|
+
constructor(_renderer, _changeDetectorRef) {
|
|
327
|
+
this._renderer = _renderer;
|
|
254
328
|
this._changeDetectorRef = _changeDetectorRef;
|
|
255
|
-
this._ngControl = _ngControl;
|
|
256
329
|
// Readonly data.
|
|
257
|
-
this.labelId =
|
|
258
|
-
//
|
|
259
|
-
this.
|
|
260
|
-
this.
|
|
261
|
-
// Subscriptions.
|
|
262
|
-
this._subscription = new Subscription();
|
|
330
|
+
this.labelId = `bbi-toggle-${nextUniqueId$1++}`;
|
|
331
|
+
// Outputs.
|
|
332
|
+
this.checkedChange = new EventEmitter();
|
|
333
|
+
this._checked = false;
|
|
263
334
|
this._disabled = false;
|
|
264
|
-
this.
|
|
335
|
+
this._grouped = false;
|
|
265
336
|
this._required = false;
|
|
337
|
+
this._hideText = false;
|
|
338
|
+
// Methods.
|
|
339
|
+
this.onChange = () => ({});
|
|
340
|
+
this.onTouched = () => ({});
|
|
266
341
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
this.
|
|
270
|
-
this.handleFocusedState();
|
|
342
|
+
// Checked.
|
|
343
|
+
get checked() {
|
|
344
|
+
return this._checked;
|
|
271
345
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
(
|
|
346
|
+
set checked(value) {
|
|
347
|
+
const newValue = coerceBooleanProperty(value);
|
|
348
|
+
if (newValue !== this.checked) {
|
|
349
|
+
this._checked = newValue;
|
|
350
|
+
this._changeDetectorRef.markForCheck();
|
|
351
|
+
}
|
|
275
352
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
return
|
|
353
|
+
// Disabled.
|
|
354
|
+
get disabled() {
|
|
355
|
+
return this._disabled;
|
|
279
356
|
}
|
|
280
|
-
get disabled() { return this._disabled; }
|
|
281
357
|
set disabled(value) {
|
|
282
358
|
const newValue = coerceBooleanProperty(value);
|
|
283
359
|
if (newValue !== this.disabled) {
|
|
@@ -285,19 +361,19 @@ class BbiFormControlInput {
|
|
|
285
361
|
this._changeDetectorRef.markForCheck();
|
|
286
362
|
}
|
|
287
363
|
}
|
|
288
|
-
|
|
289
|
-
|
|
364
|
+
// Grouped.
|
|
365
|
+
get grouped() {
|
|
366
|
+
return this._grouped;
|
|
367
|
+
}
|
|
368
|
+
set grouped(value) {
|
|
290
369
|
const newValue = coerceBooleanProperty(value);
|
|
291
|
-
if (newValue !== this.
|
|
292
|
-
this.
|
|
370
|
+
if (newValue !== this.grouped) {
|
|
371
|
+
this._grouped = newValue;
|
|
293
372
|
this._changeDetectorRef.markForCheck();
|
|
294
373
|
}
|
|
295
374
|
}
|
|
375
|
+
// Required.
|
|
296
376
|
get required() {
|
|
297
|
-
var _a, _b;
|
|
298
|
-
if (this._ngControl) {
|
|
299
|
-
return (_b = (_a = this._ngControl) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.hasValidator(Validators.required);
|
|
300
|
-
}
|
|
301
377
|
return this._required;
|
|
302
378
|
}
|
|
303
379
|
set required(value) {
|
|
@@ -307,67 +383,129 @@ class BbiFormControlInput {
|
|
|
307
383
|
this._changeDetectorRef.markForCheck();
|
|
308
384
|
}
|
|
309
385
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
const
|
|
316
|
-
|
|
386
|
+
// Hide text.
|
|
387
|
+
get hideText() {
|
|
388
|
+
return this._hideText;
|
|
389
|
+
}
|
|
390
|
+
set hideText(value) {
|
|
391
|
+
const newValue = coerceBooleanProperty(value);
|
|
392
|
+
if (newValue !== this.hideText) {
|
|
393
|
+
this._hideText = newValue;
|
|
317
394
|
this._changeDetectorRef.markForCheck();
|
|
318
|
-
}
|
|
319
|
-
this._subscription.add(subscription);
|
|
395
|
+
}
|
|
320
396
|
}
|
|
321
|
-
|
|
322
|
-
|
|
397
|
+
registerOnChange(fn) {
|
|
398
|
+
this.onChange = fn;
|
|
399
|
+
}
|
|
400
|
+
registerOnTouched(fn) {
|
|
401
|
+
this.onTouched = fn;
|
|
402
|
+
}
|
|
403
|
+
setDisabledState(isDisabled) {
|
|
404
|
+
this.disabled = isDisabled;
|
|
405
|
+
}
|
|
406
|
+
writeValue(newValue) {
|
|
407
|
+
this.checked = !!newValue;
|
|
408
|
+
}
|
|
409
|
+
toggle() {
|
|
410
|
+
this.checked = !this.checked;
|
|
411
|
+
}
|
|
412
|
+
onClickEvent(event) {
|
|
413
|
+
event.stopPropagation();
|
|
414
|
+
if (this.disabled) {
|
|
323
415
|
return;
|
|
324
416
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
this.
|
|
417
|
+
this.toggle();
|
|
418
|
+
// Emit our custom change event if the native input emitted one.
|
|
419
|
+
// It is important to only emit it, if the native input triggered one, because
|
|
420
|
+
// we don't want to trigger a change event, when the `checked` variable changes for example.
|
|
421
|
+
this.emitChangeEvent();
|
|
330
422
|
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
this.
|
|
423
|
+
onChangeEvent(event) {
|
|
424
|
+
// We always have to stop propagation on the change event.
|
|
425
|
+
// Otherwise the change event, from the input element, will bubble up and
|
|
426
|
+
// emit its event object to the `change` output.
|
|
427
|
+
event.stopPropagation();
|
|
428
|
+
}
|
|
429
|
+
emitChangeEvent() {
|
|
430
|
+
var _a;
|
|
431
|
+
(_a = this.onChange) === null || _a === void 0 ? void 0 : _a.call(this, this.checked);
|
|
432
|
+
this.checkedChange.emit(this.checked);
|
|
433
|
+
this.syncField('checked', this.checked);
|
|
434
|
+
}
|
|
435
|
+
syncField(field, value) {
|
|
436
|
+
var _a;
|
|
437
|
+
const element = (_a = this.inputElementRef) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
438
|
+
if (!element) {
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
this._renderer.setProperty(element, field, value);
|
|
342
442
|
}
|
|
343
443
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}] }]
|
|
357
|
-
|
|
358
|
-
type:
|
|
359
|
-
args: ['
|
|
444
|
+
BbiToggle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiToggle, deps: [{ token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
445
|
+
BbiToggle.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: BbiToggle, selector: "bbi-toggle", inputs: { checked: "checked", disabled: "disabled", grouped: "grouped", required: "required", hideText: "hideText" }, outputs: { checkedChange: "checkedChange" }, host: { properties: { "class.grouped": "grouped", "class.required": "required" }, classAttribute: "bbi-toggle" }, providers: [
|
|
446
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbiToggle), multi: true }
|
|
447
|
+
], viewQueries: [{ propertyName: "inputElementRef", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: "<input #input\n [id]=\"labelId\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n (change)=\"onChangeEvent($event)\"\n (click)=\"onClickEvent($event)\"\n (blur)=\"onTouched()\"\n class=\"bbi-toggle-input\"\n type=\"checkbox\">\n<label [attr.for]=\"labelId\"\n class=\"bbi-toggle-label\">\n <div class=\"bbi-toggle-switch\"></div>\n <span *ngIf=\"!hideText\"\n class=\"bbi-toggle-text\"><ng-content></ng-content></span>\n</label>\n", styles: [".bbi-toggle{display:block}.bbi-toggle.grouped{margin-bottom:var(--toggle-grouping, 20px)}.bbi-toggle-input{border:0;width:1px;padding:0;height:1px;margin:-1px;overflow:hidden;position:absolute;visibility:inherit;white-space:nowrap;clip:rect(0,0,0,0)}.bbi-toggle-switch{display:block;position:relative;width:var(--toggle-width, 40px);height:var(--toggle-height, 20px);min-width:var(--toggle-width, 40px);min-height:var(--toggle-height, 20px);outline-offset:var(--toggle-outline-offset, 1px);border-radius:calc(var(--toggle-height, 20px) / 2);background-color:var(--toggle-colors-background, #aeaeae);outline:var(--toggle-outline-thickness, 2px) solid transparent;transition:background-color 70ms cubic-bezier(.2,0,1,.9)}.bbi-toggle-switch:before{content:\"\";position:absolute;border-radius:50%;top:calc(.125 * var(--toggle-height, 20px));width:calc(.75 * var(--toggle-height, 20px));height:calc(.75 * var(--toggle-height, 20px));left:calc(.125 * var(--toggle-height, 20px));background-color:var(--toggle-colors-indicator, #ffffff);transition:transform 70ms cubic-bezier(.2,0,1,.9)}.bbi-toggle-input:checked+.bbi-toggle-label>.bbi-toggle-switch{background-color:var(--toggle-colors-accent, var(--accent-color, #1565c0))}.bbi-toggle-input:checked+.bbi-toggle-label>.bbi-toggle-switch:before{transform:translate(calc(var(--toggle-width, 40px) - .75 * var(--toggle-height, 20px) - .125 * var(--toggle-height, 20px) * 2))}.bbi-toggle-input:focus+.bbi-toggle-label>.bbi-toggle-switch{outline-color:var(--toggle-outline-color, var(--accent-color, #1565c0))}.bbi-toggle-input:disabled+.bbi-toggle-label{cursor:not-allowed}.bbi-toggle-input:disabled+.bbi-toggle-label>.bbi-toggle-text{color:var(--toggle-colors-disabled, #c6c6c6)}.bbi-toggle-label{display:flex;cursor:pointer;align-items:center}.bbi-toggle-text{color:var(--toggle-label-color, #111111);padding-left:var(--toggle-label-offset, 6px);font-size:var(--toggle-label-font-size, 16px);font-weight:var(--toggle-label-font-weight, 400);line-height:var(--toggle-label-line-height, 1.28)}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
448
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiToggle, decorators: [{
|
|
449
|
+
type: Component,
|
|
450
|
+
args: [{ selector: 'bbi-toggle', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
|
|
451
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbiToggle), multi: true }
|
|
452
|
+
], host: {
|
|
453
|
+
'class': 'bbi-toggle',
|
|
454
|
+
'[class.grouped]': 'grouped',
|
|
455
|
+
'[class.required]': 'required'
|
|
456
|
+
}, preserveWhitespaces: false, template: "<input #input\n [id]=\"labelId\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n (change)=\"onChangeEvent($event)\"\n (click)=\"onClickEvent($event)\"\n (blur)=\"onTouched()\"\n class=\"bbi-toggle-input\"\n type=\"checkbox\">\n<label [attr.for]=\"labelId\"\n class=\"bbi-toggle-label\">\n <div class=\"bbi-toggle-switch\"></div>\n <span *ngIf=\"!hideText\"\n class=\"bbi-toggle-text\"><ng-content></ng-content></span>\n</label>\n", styles: [".bbi-toggle{display:block}.bbi-toggle.grouped{margin-bottom:var(--toggle-grouping, 20px)}.bbi-toggle-input{border:0;width:1px;padding:0;height:1px;margin:-1px;overflow:hidden;position:absolute;visibility:inherit;white-space:nowrap;clip:rect(0,0,0,0)}.bbi-toggle-switch{display:block;position:relative;width:var(--toggle-width, 40px);height:var(--toggle-height, 20px);min-width:var(--toggle-width, 40px);min-height:var(--toggle-height, 20px);outline-offset:var(--toggle-outline-offset, 1px);border-radius:calc(var(--toggle-height, 20px) / 2);background-color:var(--toggle-colors-background, #aeaeae);outline:var(--toggle-outline-thickness, 2px) solid transparent;transition:background-color 70ms cubic-bezier(.2,0,1,.9)}.bbi-toggle-switch:before{content:\"\";position:absolute;border-radius:50%;top:calc(.125 * var(--toggle-height, 20px));width:calc(.75 * var(--toggle-height, 20px));height:calc(.75 * var(--toggle-height, 20px));left:calc(.125 * var(--toggle-height, 20px));background-color:var(--toggle-colors-indicator, #ffffff);transition:transform 70ms cubic-bezier(.2,0,1,.9)}.bbi-toggle-input:checked+.bbi-toggle-label>.bbi-toggle-switch{background-color:var(--toggle-colors-accent, var(--accent-color, #1565c0))}.bbi-toggle-input:checked+.bbi-toggle-label>.bbi-toggle-switch:before{transform:translate(calc(var(--toggle-width, 40px) - .75 * var(--toggle-height, 20px) - .125 * var(--toggle-height, 20px) * 2))}.bbi-toggle-input:focus+.bbi-toggle-label>.bbi-toggle-switch{outline-color:var(--toggle-outline-color, var(--accent-color, #1565c0))}.bbi-toggle-input:disabled+.bbi-toggle-label{cursor:not-allowed}.bbi-toggle-input:disabled+.bbi-toggle-label>.bbi-toggle-text{color:var(--toggle-colors-disabled, #c6c6c6)}.bbi-toggle-label{display:flex;cursor:pointer;align-items:center}.bbi-toggle-text{color:var(--toggle-label-color, #111111);padding-left:var(--toggle-label-offset, 6px);font-size:var(--toggle-label-font-size, 16px);font-weight:var(--toggle-label-font-weight, 400);line-height:var(--toggle-label-line-height, 1.28)}\n"] }]
|
|
457
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { inputElementRef: [{
|
|
458
|
+
type: ViewChild,
|
|
459
|
+
args: ['input', { static: true }]
|
|
460
|
+
}], checkedChange: [{
|
|
461
|
+
type: Output
|
|
462
|
+
}], checked: [{
|
|
463
|
+
type: Input
|
|
360
464
|
}], disabled: [{
|
|
361
465
|
type: Input
|
|
362
|
-
}],
|
|
466
|
+
}], grouped: [{
|
|
363
467
|
type: Input
|
|
364
468
|
}], required: [{
|
|
365
|
-
type:
|
|
366
|
-
|
|
367
|
-
}, {
|
|
469
|
+
type: Input
|
|
470
|
+
}], hideText: [{
|
|
368
471
|
type: Input
|
|
369
472
|
}] } });
|
|
370
473
|
|
|
474
|
+
class ToggleModule {
|
|
475
|
+
}
|
|
476
|
+
ToggleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToggleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
477
|
+
ToggleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ToggleModule, declarations: [BbiToggle, BbiToggleGroup], imports: [CommonModule, UtilsModule], exports: [BbiToggle, BbiToggleGroup] });
|
|
478
|
+
ToggleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToggleModule, imports: [CommonModule, UtilsModule] });
|
|
479
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToggleModule, decorators: [{
|
|
480
|
+
type: NgModule,
|
|
481
|
+
args: [{
|
|
482
|
+
imports: [CommonModule, UtilsModule],
|
|
483
|
+
declarations: [BbiToggle, BbiToggleGroup],
|
|
484
|
+
exports: [BbiToggle, BbiToggleGroup]
|
|
485
|
+
}]
|
|
486
|
+
}] });
|
|
487
|
+
|
|
488
|
+
function shouldShowErrors(mode, control, submitted, focused, readonly) {
|
|
489
|
+
var _a, _b;
|
|
490
|
+
if (mode === 'hidden' || readonly || (control === null || control === void 0 ? void 0 : control.disabled)) {
|
|
491
|
+
return false;
|
|
492
|
+
}
|
|
493
|
+
// When submitted always show the errors.
|
|
494
|
+
if (submitted && !focused) {
|
|
495
|
+
return true;
|
|
496
|
+
}
|
|
497
|
+
// We want to show changes even when the user is focused.
|
|
498
|
+
if (mode === 'changes') {
|
|
499
|
+
return (_a = control === null || control === void 0 ? void 0 : control.dirty) !== null && _a !== void 0 ? _a : false;
|
|
500
|
+
}
|
|
501
|
+
// On blur show the error.
|
|
502
|
+
if (mode === 'blur' && !focused) {
|
|
503
|
+
return (_b = control === null || control === void 0 ? void 0 : control.touched) !== null && _b !== void 0 ? _b : false;
|
|
504
|
+
}
|
|
505
|
+
// Must not show the errors.
|
|
506
|
+
return false;
|
|
507
|
+
}
|
|
508
|
+
|
|
371
509
|
class BbiControlErrorSubmit {
|
|
372
510
|
constructor(_elementRef) {
|
|
373
511
|
this._elementRef = _elementRef;
|
|
@@ -402,9 +540,9 @@ class BbiControlErrorSubmit {
|
|
|
402
540
|
this._subscription.add(subscription);
|
|
403
541
|
}
|
|
404
542
|
}
|
|
405
|
-
BbiControlErrorSubmit.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
406
|
-
BbiControlErrorSubmit.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.
|
|
407
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
543
|
+
BbiControlErrorSubmit.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiControlErrorSubmit, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
544
|
+
BbiControlErrorSubmit.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.2", type: BbiControlErrorSubmit, selector: "form", exportAs: ["bbiControlErrorSubmit"], ngImport: i0 });
|
|
545
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiControlErrorSubmit, decorators: [{
|
|
408
546
|
type: Directive,
|
|
409
547
|
args: [{
|
|
410
548
|
selector: 'form',
|
|
@@ -468,13 +606,13 @@ class BbiControlError {
|
|
|
468
606
|
: data === null || data === void 0 ? void 0 : data.token;
|
|
469
607
|
}
|
|
470
608
|
}
|
|
471
|
-
BbiControlError.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
472
|
-
BbiControlError.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.
|
|
473
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
609
|
+
BbiControlError.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiControlError, deps: [{ token: i1.Localize, optional: true }, { token: BBI_CONTROL_ERRORS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
610
|
+
BbiControlError.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: BbiControlError, selector: "bbi-control-error", inputs: { errors: "errors" }, host: { properties: { "@errorAnimation": "this.animation" }, classAttribute: "bbi-control-error" }, ngImport: i0, template: "{{ error ?? '...' }}\n", styles: [".bbi-control-error{color:var(--control-error-color, var(--error-color, #bd322a));display:block;margin-top:var(--control-error-spacing, 4px);font-size:var(--control-error-font-size, 13px);font-weight:var(--control-error-font-weight, 400);line-height:var(--control-error-line-height, 1.5)}\n"], animations: [controlErrorAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
611
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiControlError, decorators: [{
|
|
474
612
|
type: Component,
|
|
475
613
|
args: [{ selector: 'bbi-control-error', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { 'class': 'bbi-control-error' }, preserveWhitespaces: false, animations: [controlErrorAnimation], template: "{{ error ?? '...' }}\n", styles: [".bbi-control-error{color:var(--control-error-color, var(--error-color, #bd322a));display:block;margin-top:var(--control-error-spacing, 4px);font-size:var(--control-error-font-size, 13px);font-weight:var(--control-error-font-weight, 400);line-height:var(--control-error-line-height, 1.5)}\n"] }]
|
|
476
614
|
}], ctorParameters: function () {
|
|
477
|
-
return [{ type: i1
|
|
615
|
+
return [{ type: i1.Localize, decorators: [{
|
|
478
616
|
type: Optional
|
|
479
617
|
}] }, { type: undefined, decorators: [{
|
|
480
618
|
type: Optional
|
|
@@ -489,24 +627,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
|
|
|
489
627
|
type: Input
|
|
490
628
|
}] } });
|
|
491
629
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
630
|
+
class BbiRadioGroup {
|
|
631
|
+
constructor(_injector, _changeDetectorRef, _errorSubmit) {
|
|
632
|
+
this._injector = _injector;
|
|
495
633
|
this._changeDetectorRef = _changeDetectorRef;
|
|
496
634
|
this._errorSubmit = _errorSubmit;
|
|
497
|
-
// Readonly data.
|
|
498
|
-
this.labelId = `bbi-form-control-${nextUniqueId++}`;
|
|
499
635
|
// Inputs.
|
|
500
636
|
this.label = null;
|
|
501
|
-
this.hint = null;
|
|
502
637
|
this.errorMode = 'blur';
|
|
638
|
+
// Outputs.
|
|
639
|
+
this.valueChange = new EventEmitter();
|
|
503
640
|
// State.
|
|
504
641
|
this.validationErrors$ = new BehaviorSubject(null);
|
|
505
|
-
this.
|
|
642
|
+
this._value = null;
|
|
643
|
+
this._disabled = false;
|
|
506
644
|
this._grouped = false;
|
|
507
|
-
|
|
645
|
+
this._readonly = false;
|
|
646
|
+
this._required = false;
|
|
647
|
+
this._inline = false;
|
|
648
|
+
// Methods.
|
|
649
|
+
this.onChange = () => ({});
|
|
650
|
+
this.onTouched = () => ({});
|
|
651
|
+
}
|
|
652
|
+
// Value.
|
|
653
|
+
get value() {
|
|
654
|
+
return this._value;
|
|
655
|
+
}
|
|
656
|
+
set value(value) {
|
|
657
|
+
this._value = value;
|
|
658
|
+
this._changeDetectorRef.markForCheck();
|
|
659
|
+
}
|
|
660
|
+
// Disabled.
|
|
661
|
+
get disabled() {
|
|
662
|
+
return this._disabled;
|
|
663
|
+
}
|
|
664
|
+
set disabled(value) {
|
|
665
|
+
const newValue = coerceBooleanProperty(value);
|
|
666
|
+
if (newValue !== this.disabled) {
|
|
667
|
+
this._disabled = newValue;
|
|
668
|
+
this._changeDetectorRef.markForCheck();
|
|
669
|
+
}
|
|
670
|
+
}
|
|
508
671
|
// Grouped.
|
|
509
|
-
get grouped() {
|
|
672
|
+
get grouped() {
|
|
673
|
+
return this._grouped;
|
|
674
|
+
}
|
|
510
675
|
set grouped(value) {
|
|
511
676
|
const newValue = coerceBooleanProperty(value);
|
|
512
677
|
if (newValue !== this.grouped) {
|
|
@@ -514,10 +679,45 @@ class BbiFormControl {
|
|
|
514
679
|
this._changeDetectorRef.markForCheck();
|
|
515
680
|
}
|
|
516
681
|
}
|
|
682
|
+
// Readonly.
|
|
683
|
+
get readonly() {
|
|
684
|
+
return this._readonly;
|
|
685
|
+
}
|
|
686
|
+
set readonly(value) {
|
|
687
|
+
const newValue = coerceBooleanProperty(value);
|
|
688
|
+
if (newValue !== this.grouped) {
|
|
689
|
+
this._readonly = newValue;
|
|
690
|
+
this._changeDetectorRef.markForCheck();
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
// Required.
|
|
694
|
+
get required() {
|
|
695
|
+
return this._required;
|
|
696
|
+
}
|
|
697
|
+
set required(value) {
|
|
698
|
+
const newValue = coerceBooleanProperty(value);
|
|
699
|
+
if (newValue !== this.required) {
|
|
700
|
+
this._required = newValue;
|
|
701
|
+
this._changeDetectorRef.markForCheck();
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
// Inline.
|
|
705
|
+
get inline() {
|
|
706
|
+
return this._inline;
|
|
707
|
+
}
|
|
708
|
+
set inline(value) {
|
|
709
|
+
const newValue = coerceBooleanProperty(value);
|
|
710
|
+
if (newValue !== this.inline) {
|
|
711
|
+
this._inline = newValue;
|
|
712
|
+
this._changeDetectorRef.markForCheck();
|
|
713
|
+
}
|
|
714
|
+
}
|
|
517
715
|
ngDoCheck() {
|
|
518
716
|
var _a, _b;
|
|
519
|
-
const
|
|
520
|
-
const
|
|
717
|
+
const control = this._injector.get(NgControl);
|
|
718
|
+
const submitted = (_a = this._errorSubmit) === null || _a === void 0 ? void 0 : _a.submitted;
|
|
719
|
+
const hasErrors = shouldShowErrors(this.errorMode, control, submitted, false, this.readonly);
|
|
720
|
+
const errors = (_b = control === null || control === void 0 ? void 0 : control.errors) !== null && _b !== void 0 ? _b : null;
|
|
521
721
|
const newValue = hasErrors ? errors : null;
|
|
522
722
|
const equal = JSON.stringify(newValue) === JSON.stringify(this.validationErrors$.getValue());
|
|
523
723
|
if (equal) {
|
|
@@ -525,32 +725,337 @@ class BbiFormControl {
|
|
|
525
725
|
}
|
|
526
726
|
this.validationErrors$.next(newValue);
|
|
527
727
|
}
|
|
528
|
-
|
|
529
|
-
var _a, _b
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
return false;
|
|
728
|
+
select(value) {
|
|
729
|
+
var _a, _b;
|
|
730
|
+
if (this.value === value || this.disabled || this.readonly) {
|
|
731
|
+
return;
|
|
533
732
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
733
|
+
this.value = value;
|
|
734
|
+
(_a = this.onChange) === null || _a === void 0 ? void 0 : _a.call(this, this.value);
|
|
735
|
+
this.valueChange.emit(this.value);
|
|
736
|
+
(_b = this.onTouched) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
737
|
+
}
|
|
738
|
+
registerOnChange(fn) {
|
|
739
|
+
this.onChange = fn;
|
|
740
|
+
}
|
|
741
|
+
registerOnTouched(fn) {
|
|
742
|
+
this.onTouched = fn;
|
|
743
|
+
}
|
|
744
|
+
setDisabledState(isDisabled) {
|
|
745
|
+
this.disabled = isDisabled;
|
|
746
|
+
}
|
|
747
|
+
writeValue(newValue) {
|
|
748
|
+
this.value = newValue;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
BbiRadioGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiRadioGroup, deps: [{ token: i0.Injector }, { token: i0.ChangeDetectorRef }, { token: BbiControlErrorSubmit, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
752
|
+
BbiRadioGroup.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: BbiRadioGroup, selector: "bbi-radio-group", inputs: { label: "label", errorMode: "errorMode", value: "value", disabled: "disabled", grouped: "grouped", readonly: "readonly", required: "required", inline: "inline" }, outputs: { valueChange: "valueChange" }, host: { properties: { "class.disabled": "disabled", "class.readonly": "readonly", "class.grouped": "grouped", "class.required": "required", "class.inline": "inline", "class.error": "validationErrors$?.getValue()" }, classAttribute: "bbi-radio-group" }, providers: [
|
|
753
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbiRadioGroup), multi: true }
|
|
754
|
+
], ngImport: i0, template: "<label *ngIf=\"label as labelContent\"\n class=\"bbi-radio-group-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n</label>\n\n<div class=\"bbi-radio-group-items\">\n <ng-content select=\"bbi-radio-button\"></ng-content>\n</div>\n\n<bbi-control-error *ngIf=\"validationErrors$ | async as errors\"\n [errors]=\"errors\">\n</bbi-control-error>\n", styles: [".bbi-radio-group{display:block}.bbi-radio-group.grouped{margin-bottom:var(--radio-group-grouping, 20px)}.bbi-radio-group.readonly{pointer-events:none}.bbi-radio-group.error>.bbi-radio-group-label{color:var(--radio-group-error, var(--error-color, #bd322a))}.bbi-radio-group.required>.bbi-radio-group-label:after{content:\"*\";color:#c23934;font-size:12px;line-height:1.5}.bbi-radio-group-label{border:0;padding:0;font-family:inherit;display:inline-block;box-sizing:border-box;vertical-align:initial;color:var(--radio-group-label-color, #525252);font-size:var(--radio-group-label-font-size, 14px);margin-bottom:var(--radio-group-label-offset, 4px);line-height:var(--radio-group-label-line-height, 1.33);font-weight:var(--radio-group-label-font-weight, 400)}.bbi-radio-group-items{display:flex;flex-direction:column}.bbi-radio-group-items:not(:empty){margin-bottom:-var(--radio-group-item-spacing-vertical,4px)}.bbi-radio-group-items>*{margin-bottom:var(--radio-group-item-spacing-vertical, 4px)}@media only screen and (min-width: 768px){.bbi-radio-group.inline>.bbi-radio-group-items{flex-wrap:wrap;flex-direction:row}.bbi-radio-group.inline>.bbi-radio-group-items>*:not(:last-child){margin-right:var(--radio-group-item-spacing-horizontal, 10px)}}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: BbiControlError, selector: "bbi-control-error", inputs: ["errors"] }, { kind: "directive", type: i2$1.BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
755
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiRadioGroup, decorators: [{
|
|
756
|
+
type: Component,
|
|
757
|
+
args: [{ selector: 'bbi-radio-group', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
|
|
758
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbiRadioGroup), multi: true }
|
|
759
|
+
], host: {
|
|
760
|
+
'class': 'bbi-radio-group',
|
|
761
|
+
'[class.disabled]': 'disabled',
|
|
762
|
+
'[class.readonly]': 'readonly',
|
|
763
|
+
'[class.grouped]': 'grouped',
|
|
764
|
+
'[class.required]': 'required',
|
|
765
|
+
'[class.inline]': 'inline',
|
|
766
|
+
'[class.error]': 'validationErrors$?.getValue()'
|
|
767
|
+
}, preserveWhitespaces: false, template: "<label *ngIf=\"label as labelContent\"\n class=\"bbi-radio-group-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n</label>\n\n<div class=\"bbi-radio-group-items\">\n <ng-content select=\"bbi-radio-button\"></ng-content>\n</div>\n\n<bbi-control-error *ngIf=\"validationErrors$ | async as errors\"\n [errors]=\"errors\">\n</bbi-control-error>\n", styles: [".bbi-radio-group{display:block}.bbi-radio-group.grouped{margin-bottom:var(--radio-group-grouping, 20px)}.bbi-radio-group.readonly{pointer-events:none}.bbi-radio-group.error>.bbi-radio-group-label{color:var(--radio-group-error, var(--error-color, #bd322a))}.bbi-radio-group.required>.bbi-radio-group-label:after{content:\"*\";color:#c23934;font-size:12px;line-height:1.5}.bbi-radio-group-label{border:0;padding:0;font-family:inherit;display:inline-block;box-sizing:border-box;vertical-align:initial;color:var(--radio-group-label-color, #525252);font-size:var(--radio-group-label-font-size, 14px);margin-bottom:var(--radio-group-label-offset, 4px);line-height:var(--radio-group-label-line-height, 1.33);font-weight:var(--radio-group-label-font-weight, 400)}.bbi-radio-group-items{display:flex;flex-direction:column}.bbi-radio-group-items:not(:empty){margin-bottom:-var(--radio-group-item-spacing-vertical,4px)}.bbi-radio-group-items>*{margin-bottom:var(--radio-group-item-spacing-vertical, 4px)}@media only screen and (min-width: 768px){.bbi-radio-group.inline>.bbi-radio-group-items{flex-wrap:wrap;flex-direction:row}.bbi-radio-group.inline>.bbi-radio-group-items>*:not(:last-child){margin-right:var(--radio-group-item-spacing-horizontal, 10px)}}\n"] }]
|
|
768
|
+
}], ctorParameters: function () {
|
|
769
|
+
return [{ type: i0.Injector }, { type: i0.ChangeDetectorRef }, { type: BbiControlErrorSubmit, decorators: [{
|
|
770
|
+
type: Optional
|
|
771
|
+
}] }];
|
|
772
|
+
}, propDecorators: { label: [{
|
|
773
|
+
type: Input
|
|
774
|
+
}], errorMode: [{
|
|
775
|
+
type: Input
|
|
776
|
+
}], valueChange: [{
|
|
777
|
+
type: Output
|
|
778
|
+
}], value: [{
|
|
779
|
+
type: Input
|
|
780
|
+
}], disabled: [{
|
|
781
|
+
type: Input
|
|
782
|
+
}], grouped: [{
|
|
783
|
+
type: Input
|
|
784
|
+
}], readonly: [{
|
|
785
|
+
type: Input
|
|
786
|
+
}], required: [{
|
|
787
|
+
type: Input
|
|
788
|
+
}], inline: [{
|
|
789
|
+
type: Input
|
|
790
|
+
}] } });
|
|
791
|
+
|
|
792
|
+
class BbiRadioButton {
|
|
793
|
+
constructor(_radioGroup, _changeDetectorRef) {
|
|
794
|
+
this._radioGroup = _radioGroup;
|
|
795
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
796
|
+
// Inputs.
|
|
797
|
+
this.value = null;
|
|
798
|
+
this._disabled = false;
|
|
799
|
+
this._hideText = false;
|
|
800
|
+
}
|
|
801
|
+
// Disabled.
|
|
802
|
+
get disabled() {
|
|
803
|
+
var _a;
|
|
804
|
+
return ((_a = this._radioGroup) === null || _a === void 0 ? void 0 : _a.disabled) || this._disabled;
|
|
805
|
+
}
|
|
806
|
+
set disabled(value) {
|
|
807
|
+
const newValue = coerceBooleanProperty(value);
|
|
808
|
+
if (newValue !== this.disabled) {
|
|
809
|
+
this._disabled = newValue;
|
|
810
|
+
this._changeDetectorRef.markForCheck();
|
|
538
811
|
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
812
|
+
}
|
|
813
|
+
// Hide text.
|
|
814
|
+
get hideText() {
|
|
815
|
+
return this._hideText;
|
|
816
|
+
}
|
|
817
|
+
set hideText(value) {
|
|
818
|
+
const newValue = coerceBooleanProperty(value);
|
|
819
|
+
if (newValue !== this.hideText) {
|
|
820
|
+
this._hideText = newValue;
|
|
821
|
+
this._changeDetectorRef.markForCheck();
|
|
542
822
|
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
823
|
+
}
|
|
824
|
+
onClick() {
|
|
825
|
+
if (this.disabled) {
|
|
826
|
+
return;
|
|
546
827
|
}
|
|
547
|
-
|
|
548
|
-
|
|
828
|
+
this._radioGroup.select(this.value);
|
|
829
|
+
}
|
|
830
|
+
onSpacePressed() {
|
|
831
|
+
return this.onClick();
|
|
832
|
+
}
|
|
833
|
+
get selected() {
|
|
834
|
+
var _a;
|
|
835
|
+
return ((_a = this._radioGroup) === null || _a === void 0 ? void 0 : _a.value) === this.value;
|
|
549
836
|
}
|
|
550
837
|
}
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
838
|
+
BbiRadioButton.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiRadioButton, deps: [{ token: BbiRadioGroup }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
839
|
+
BbiRadioButton.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: BbiRadioButton, selector: "bbi-radio-button", inputs: { value: "value", disabled: "disabled", hideText: "hideText" }, host: { listeners: { "click": "onClick()", "keydown.space": "onSpacePressed()" }, properties: { "class.disabled": "disabled", "tabindex": "disabled ? -1 : 0", "class.selected": "this.selected" }, classAttribute: "bbi-radio-button" }, ngImport: i0, template: "<div class=\"bbi-radio-button-indicator\"></div>\n<span *ngIf=\"!hideText\"\n class=\"bbi-radio-button-text\"><ng-content></ng-content></span>\n", styles: [".bbi-radio-button{display:flex;cursor:pointer;align-items:center}.bbi-radio-button:not(.disabled):focus>.bbi-radio-button-indicator{outline-color:var(--radio-button-outline-color, var(--accent-color, #1565c0))}.bbi-radio-button.disabled{-webkit-user-select:none;user-select:none;cursor:not-allowed}.bbi-radio-button.disabled>.bbi-radio-button-indicator{border-color:var(--radio-button-colors-disabled, #c6c6c6)}.bbi-radio-button.disabled>.bbi-radio-button-text{color:var(--radio-button-colors-disabled, #c6c6c6)}.bbi-radio-button.selected>.bbi-radio-button-indicator{border-color:var(--radio-button-colors-accent, var(--accent-color, #1565c0))}.bbi-radio-button.selected>.bbi-radio-button-indicator:after{opacity:1;transform:none}.bbi-radio-button-indicator{display:flex;align-items:center;justify-content:center;width:var(--radio-button-size, 20px);height:var(--radio-button-size, 20px);min-width:var(--radio-button-size, 20px);min-height:var(--radio-button-size, 20px);border-radius:var(--radio-button-border-radius, 50%);outline-offset:var(--radio-button-outline-offset, 1px);outline:var(--radio-button-outline-thickness, 2px) solid transparent;border:var(--radio-button-border-thickness, 1px) solid var(--radio-button-border-color, #111111);transition:outline-color .2s cubic-bezier(0,0,.2,1),border-color .18s cubic-bezier(0,0,.2,1)}.bbi-radio-button-indicator:after{opacity:0;content:\"\";display:block;transform:scale(0);width:calc(var(--radio-button-size, 20px) / 2);height:calc(var(--radio-button-size, 20px) / 2);border-radius:var(--radio-button-border-radius, 50%);background-color:var(--radio-button-colors-accent, var(--accent-color, #1565c0));transition:transform .1s cubic-bezier(0,0,.2,1)}.bbi-radio-button-text{color:var(--radio-button-label-color, #111111);padding-left:var(--radio-button-label-offset, 6px);font-size:var(--radio-button-label-font-size, 16px);font-weight:var(--radio-button-label-font-weight, 400);line-height:var(--radio-button-label-line-height, 1.28)}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
840
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiRadioButton, decorators: [{
|
|
841
|
+
type: Component,
|
|
842
|
+
args: [{ selector: 'bbi-radio-button', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
843
|
+
'class': 'bbi-radio-button',
|
|
844
|
+
'[class.disabled]': 'disabled',
|
|
845
|
+
'[tabindex]': 'disabled ? -1 : 0'
|
|
846
|
+
}, preserveWhitespaces: false, template: "<div class=\"bbi-radio-button-indicator\"></div>\n<span *ngIf=\"!hideText\"\n class=\"bbi-radio-button-text\"><ng-content></ng-content></span>\n", styles: [".bbi-radio-button{display:flex;cursor:pointer;align-items:center}.bbi-radio-button:not(.disabled):focus>.bbi-radio-button-indicator{outline-color:var(--radio-button-outline-color, var(--accent-color, #1565c0))}.bbi-radio-button.disabled{-webkit-user-select:none;user-select:none;cursor:not-allowed}.bbi-radio-button.disabled>.bbi-radio-button-indicator{border-color:var(--radio-button-colors-disabled, #c6c6c6)}.bbi-radio-button.disabled>.bbi-radio-button-text{color:var(--radio-button-colors-disabled, #c6c6c6)}.bbi-radio-button.selected>.bbi-radio-button-indicator{border-color:var(--radio-button-colors-accent, var(--accent-color, #1565c0))}.bbi-radio-button.selected>.bbi-radio-button-indicator:after{opacity:1;transform:none}.bbi-radio-button-indicator{display:flex;align-items:center;justify-content:center;width:var(--radio-button-size, 20px);height:var(--radio-button-size, 20px);min-width:var(--radio-button-size, 20px);min-height:var(--radio-button-size, 20px);border-radius:var(--radio-button-border-radius, 50%);outline-offset:var(--radio-button-outline-offset, 1px);outline:var(--radio-button-outline-thickness, 2px) solid transparent;border:var(--radio-button-border-thickness, 1px) solid var(--radio-button-border-color, #111111);transition:outline-color .2s cubic-bezier(0,0,.2,1),border-color .18s cubic-bezier(0,0,.2,1)}.bbi-radio-button-indicator:after{opacity:0;content:\"\";display:block;transform:scale(0);width:calc(var(--radio-button-size, 20px) / 2);height:calc(var(--radio-button-size, 20px) / 2);border-radius:var(--radio-button-border-radius, 50%);background-color:var(--radio-button-colors-accent, var(--accent-color, #1565c0));transition:transform .1s cubic-bezier(0,0,.2,1)}.bbi-radio-button-text{color:var(--radio-button-label-color, #111111);padding-left:var(--radio-button-label-offset, 6px);font-size:var(--radio-button-label-font-size, 16px);font-weight:var(--radio-button-label-font-weight, 400);line-height:var(--radio-button-label-line-height, 1.28)}\n"] }]
|
|
847
|
+
}], ctorParameters: function () { return [{ type: BbiRadioGroup }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { value: [{
|
|
848
|
+
type: Input
|
|
849
|
+
}], disabled: [{
|
|
850
|
+
type: Input
|
|
851
|
+
}], hideText: [{
|
|
852
|
+
type: Input
|
|
853
|
+
}], onClick: [{
|
|
854
|
+
type: HostListener,
|
|
855
|
+
args: ['click']
|
|
856
|
+
}], onSpacePressed: [{
|
|
857
|
+
type: HostListener,
|
|
858
|
+
args: ['keydown.space']
|
|
859
|
+
}], selected: [{
|
|
860
|
+
type: HostBinding,
|
|
861
|
+
args: ['class.selected']
|
|
862
|
+
}] } });
|
|
863
|
+
|
|
864
|
+
class ControlErrorModule {
|
|
865
|
+
}
|
|
866
|
+
ControlErrorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ControlErrorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
867
|
+
ControlErrorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ControlErrorModule, declarations: [BbiControlError, BbiControlErrorSubmit], imports: [CommonModule], exports: [BbiControlError, BbiControlErrorSubmit] });
|
|
868
|
+
ControlErrorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ControlErrorModule, imports: [CommonModule] });
|
|
869
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ControlErrorModule, decorators: [{
|
|
870
|
+
type: NgModule,
|
|
871
|
+
args: [{
|
|
872
|
+
imports: [CommonModule],
|
|
873
|
+
declarations: [BbiControlError, BbiControlErrorSubmit],
|
|
874
|
+
exports: [BbiControlError, BbiControlErrorSubmit]
|
|
875
|
+
}]
|
|
876
|
+
}] });
|
|
877
|
+
|
|
878
|
+
class RadioModule {
|
|
879
|
+
}
|
|
880
|
+
RadioModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: RadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
881
|
+
RadioModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: RadioModule, declarations: [BbiRadioGroup, BbiRadioButton], imports: [CommonModule, ControlErrorModule, UtilsModule], exports: [BbiRadioGroup, BbiRadioButton] });
|
|
882
|
+
RadioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: RadioModule, imports: [CommonModule, ControlErrorModule, UtilsModule] });
|
|
883
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: RadioModule, decorators: [{
|
|
884
|
+
type: NgModule,
|
|
885
|
+
args: [{
|
|
886
|
+
imports: [CommonModule, ControlErrorModule, UtilsModule],
|
|
887
|
+
declarations: [BbiRadioGroup, BbiRadioButton],
|
|
888
|
+
exports: [BbiRadioGroup, BbiRadioButton]
|
|
889
|
+
}]
|
|
890
|
+
}] });
|
|
891
|
+
|
|
892
|
+
class BbiFormControlInput {
|
|
893
|
+
constructor(_elementRef, _formControl, _changeDetectorRef, _ngControl) {
|
|
894
|
+
var _a, _b;
|
|
895
|
+
this._elementRef = _elementRef;
|
|
896
|
+
this._formControl = _formControl;
|
|
897
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
898
|
+
this._ngControl = _ngControl;
|
|
899
|
+
// Readonly data.
|
|
900
|
+
this.labelId = (_b = (_a = this._formControl) === null || _a === void 0 ? void 0 : _a.labelId) !== null && _b !== void 0 ? _b : null;
|
|
901
|
+
// State.
|
|
902
|
+
this.errors = null;
|
|
903
|
+
this.focused = false;
|
|
904
|
+
// Subscriptions.
|
|
905
|
+
this._subscription = new Subscription();
|
|
906
|
+
this._disabled = false;
|
|
907
|
+
this._readonly = false;
|
|
908
|
+
this._required = false;
|
|
909
|
+
}
|
|
910
|
+
ngOnInit() {
|
|
911
|
+
this.handleControlDisabledStatus();
|
|
912
|
+
this.handleControlErrorStatus();
|
|
913
|
+
this.handleFocusedState();
|
|
914
|
+
}
|
|
915
|
+
ngOnDestroy() {
|
|
916
|
+
var _a;
|
|
917
|
+
(_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
918
|
+
}
|
|
919
|
+
get control() {
|
|
920
|
+
var _a;
|
|
921
|
+
return (_a = this._ngControl) !== null && _a !== void 0 ? _a : null;
|
|
922
|
+
}
|
|
923
|
+
get disabled() { return this._disabled; }
|
|
924
|
+
set disabled(value) {
|
|
925
|
+
const newValue = coerceBooleanProperty(value);
|
|
926
|
+
if (newValue !== this.disabled) {
|
|
927
|
+
this._disabled = newValue;
|
|
928
|
+
this._changeDetectorRef.markForCheck();
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
get readonly() { return this._readonly; }
|
|
932
|
+
set readonly(value) {
|
|
933
|
+
const newValue = coerceBooleanProperty(value);
|
|
934
|
+
if (newValue !== this.readonly) {
|
|
935
|
+
this._readonly = newValue;
|
|
936
|
+
this._changeDetectorRef.markForCheck();
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
get required() {
|
|
940
|
+
var _a, _b;
|
|
941
|
+
if (this._ngControl) {
|
|
942
|
+
return (_b = (_a = this._ngControl) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.hasValidator(Validators.required);
|
|
943
|
+
}
|
|
944
|
+
return this._required;
|
|
945
|
+
}
|
|
946
|
+
set required(value) {
|
|
947
|
+
const newValue = coerceBooleanProperty(value);
|
|
948
|
+
if (newValue !== this.required) {
|
|
949
|
+
this._required = newValue;
|
|
950
|
+
this._changeDetectorRef.markForCheck();
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
handleControlErrorStatus() {
|
|
954
|
+
if (!this._ngControl) {
|
|
955
|
+
return;
|
|
956
|
+
}
|
|
957
|
+
const errors$ = this._ngControl.statusChanges.pipe(startWith(this._ngControl.status), map(() => { var _a, _b; return (_b = (_a = this._ngControl) === null || _a === void 0 ? void 0 : _a.errors) !== null && _b !== void 0 ? _b : null; }));
|
|
958
|
+
const subscription = errors$.subscribe(errors => {
|
|
959
|
+
this.errors = errors;
|
|
960
|
+
this._changeDetectorRef.markForCheck();
|
|
961
|
+
});
|
|
962
|
+
this._subscription.add(subscription);
|
|
963
|
+
}
|
|
964
|
+
handleControlDisabledStatus() {
|
|
965
|
+
if (!this._ngControl) {
|
|
966
|
+
return;
|
|
967
|
+
}
|
|
968
|
+
const disabled$ = this._ngControl.statusChanges.pipe(startWith(this._ngControl.status), map(status => status === 'DISABLED'), distinctUntilChanged());
|
|
969
|
+
const subscription = disabled$.subscribe(disabled => {
|
|
970
|
+
this.disabled = disabled;
|
|
971
|
+
});
|
|
972
|
+
this._subscription.add(subscription);
|
|
973
|
+
}
|
|
974
|
+
handleFocusedState() {
|
|
975
|
+
const focus$ = fromEvent(this._elementRef.nativeElement, 'focus').pipe(map(() => true));
|
|
976
|
+
const blur$ = fromEvent(this._elementRef.nativeElement, 'blur').pipe(map(() => false));
|
|
977
|
+
const focused$ = merge(focus$, blur$).pipe(startWith(false), pairwise(), switchMap(([oldValue, currentValue]) => {
|
|
978
|
+
if (oldValue && !currentValue) {
|
|
979
|
+
return of(currentValue).pipe(delay(100));
|
|
980
|
+
}
|
|
981
|
+
return of(currentValue);
|
|
982
|
+
}), distinctUntilChanged());
|
|
983
|
+
const subscription = focused$.subscribe(focused => this.focused = focused);
|
|
984
|
+
this._subscription.add(subscription);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
BbiFormControlInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiFormControlInput, deps: [{ token: i0.ElementRef }, { token: BbiFormControl }, { token: i0.ChangeDetectorRef }, { token: i2$2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
988
|
+
BbiFormControlInput.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.2", type: BbiFormControlInput, selector: "input[bbiFormControlInput]", inputs: { disabled: "disabled", readonly: "readonly", required: "required" }, host: { properties: { "attr.id": "this.labelId", "required": "this.required" } }, ngImport: i0 });
|
|
989
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiFormControlInput, decorators: [{
|
|
990
|
+
type: Directive,
|
|
991
|
+
args: [{
|
|
992
|
+
selector: 'input[bbiFormControlInput]'
|
|
993
|
+
}]
|
|
994
|
+
}], ctorParameters: function () {
|
|
995
|
+
return [{ type: i0.ElementRef }, { type: BbiFormControl }, { type: i0.ChangeDetectorRef }, { type: i2$2.NgControl, decorators: [{
|
|
996
|
+
type: Optional
|
|
997
|
+
}, {
|
|
998
|
+
type: Self
|
|
999
|
+
}] }];
|
|
1000
|
+
}, propDecorators: { labelId: [{
|
|
1001
|
+
type: HostBinding,
|
|
1002
|
+
args: ['attr.id']
|
|
1003
|
+
}], disabled: [{
|
|
1004
|
+
type: Input
|
|
1005
|
+
}], readonly: [{
|
|
1006
|
+
type: Input
|
|
1007
|
+
}], required: [{
|
|
1008
|
+
type: HostBinding,
|
|
1009
|
+
args: ['required']
|
|
1010
|
+
}, {
|
|
1011
|
+
type: Input
|
|
1012
|
+
}] } });
|
|
1013
|
+
|
|
1014
|
+
let nextUniqueId = 0;
|
|
1015
|
+
class BbiFormControl {
|
|
1016
|
+
constructor(_changeDetectorRef, _errorSubmit) {
|
|
1017
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
1018
|
+
this._errorSubmit = _errorSubmit;
|
|
1019
|
+
// Readonly data.
|
|
1020
|
+
this.labelId = `bbi-form-control-${nextUniqueId++}`;
|
|
1021
|
+
// Inputs.
|
|
1022
|
+
this.label = null;
|
|
1023
|
+
this.hint = null;
|
|
1024
|
+
this.errorMode = 'blur';
|
|
1025
|
+
// State.
|
|
1026
|
+
this.validationErrors$ = new BehaviorSubject(null);
|
|
1027
|
+
this._grouped = false;
|
|
1028
|
+
}
|
|
1029
|
+
// Grouped.
|
|
1030
|
+
get grouped() {
|
|
1031
|
+
return this._grouped;
|
|
1032
|
+
}
|
|
1033
|
+
set grouped(value) {
|
|
1034
|
+
const newValue = coerceBooleanProperty(value);
|
|
1035
|
+
if (newValue !== this.grouped) {
|
|
1036
|
+
this._grouped = newValue;
|
|
1037
|
+
this._changeDetectorRef.markForCheck();
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
ngDoCheck() {
|
|
1041
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1042
|
+
const control = (_a = this.formControlInput) === null || _a === void 0 ? void 0 : _a.control;
|
|
1043
|
+
const submitted = (_b = this._errorSubmit) === null || _b === void 0 ? void 0 : _b.submitted;
|
|
1044
|
+
const focused = (_c = this.formControlInput) === null || _c === void 0 ? void 0 : _c.focused;
|
|
1045
|
+
const readonly = (_d = this.formControlInput) === null || _d === void 0 ? void 0 : _d.readonly;
|
|
1046
|
+
const hasErrors = shouldShowErrors(this.errorMode, control, submitted, focused, readonly);
|
|
1047
|
+
const errors = (_f = (_e = this.formControlInput) === null || _e === void 0 ? void 0 : _e.errors) !== null && _f !== void 0 ? _f : null;
|
|
1048
|
+
const newValue = hasErrors ? errors : null;
|
|
1049
|
+
const equal = JSON.stringify(newValue) === JSON.stringify(this.validationErrors$.getValue());
|
|
1050
|
+
if (equal) {
|
|
1051
|
+
return;
|
|
1052
|
+
}
|
|
1053
|
+
this.validationErrors$.next(newValue);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
BbiFormControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiFormControl, deps: [{ token: i0.ChangeDetectorRef }, { token: BbiControlErrorSubmit, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
1057
|
+
BbiFormControl.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: BbiFormControl, selector: "bbi-form-control", inputs: { label: "label", hint: "hint", errorMode: "errorMode", grouped: "grouped" }, host: { properties: { "class.grouped": "grouped", "class.disabled": "formControlInput?.disabled", "class.required": "formControlInput?.required", "class.readonly": "formControlInput?.readonly", "class.focused": "formControlInput?.focused", "class.error": "validationErrors$?.getValue()" }, classAttribute: "bbi-form-control" }, queries: [{ propertyName: "formControlInput", first: true, predicate: BbiFormControlInput, descendants: true }], ngImport: i0, template: "<!-- Label of the form control. -->\n<label *ngIf=\"label as labelContent\"\n [attr.for]=\"labelId\"\n class=\"bbi-form-control-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n</label>\n\n<div class=\"bbi-form-control-container\">\n <ng-content select=\"[bbi-form-control-addon=prefix]\"></ng-content>\n <ng-content select=\"input[bbiFormControlInput]\"></ng-content>\n <ng-content select=\"[bbi-form-control-addon=suffix]\"></ng-content>\n</div>\n\n<bbi-control-error *ngIf=\"validationErrors$ | async as errors\"\n [errors]=\"errors\">\n</bbi-control-error>\n\n<div *ngIf=\"hint as hintContent\"\n class=\"bbi-form-control-hint\">\n <ng-template [bbTemplate]=\"hintContent\">{{ hintContent }}</ng-template>\n</div>\n", styles: [".bbi-form-control{display:block}.bbi-form-control.grouped{margin-bottom:var(--form-control-grouping, 20px)}.bbi-form-control.disabled{pointer-events:none;opacity:var(--form-control-disabled-opacity, .25)}.bbi-form-control.disabled>.bbi-form-control-container{color:var(--form-control-disabled-color, #111111);background:var(--form-control-disabled-background, white);border-radius:var(--form-control-disabled-border-radius, 6px);border:var(--form-control-disabled-border-width, 1px) var(--form-control-disabled-border-style, solid) var(--form-control-disabled-border-color, #212121)}.bbi-form-control.required:not([data-required-visually-hidden])>.bbi-form-control-label:after{content:\"*\";color:#bd322a;font-size:14px;vertical-align:text-top}.bbi-form-control:not(.readonly).focused>.bbi-form-control-container{color:var(--form-control-focused-color, #111111);box-shadow:var(--form-control-focused-shadow, 0 0 0 3px rgba(0, 123, 255, .2));background:var(--form-control-focused-background, white);border-radius:var(--form-control-focused-border-radius, 6px);border:var(--form-control-focused-border-width, 1px) var(--form-control-focused-border-style, solid) var(--form-control-focused-border-color, #212121)}.bbi-form-control:not(.readonly).error>.bbi-form-control-label{color:var(--form-control-error-color, var(--error-color, #bd322a))}.bbi-form-control:not(.readonly).error>.bbi-form-control-container{color:var(--form-control-error-color, var(--error-color, #bd322a));border-color:var(--form-control-error-color, var(--error-color, #bd322a));background:var(--form-control-error-background, rgba(189, 50, 42, .1))}.bbi-form-control:not(.readonly).error>.bbi-form-control-container>input::placeholder{color:var(--form-control-error-placeholder-color, rgba(189, 50, 42, .4))}.bbi-form-control-label{color:#525252;display:block;font-size:14px;font-weight:400;margin-bottom:4px}.bbi-form-control-container{display:flex;align-items:center;color:var(--form-control-color, #111111);border-radius:var(--form-control-border-radius, 6px);background-color:var(--form-control-background, white);border:var(--form-control-border-width, 1px) var(--form-control-border-style, solid) var(--form-control-border-color, rgba(67, 90, 111, .3))}.bbi-form-control-container>input{width:100%;border:none;height:40px;color:inherit;padding:0 10px;background-color:transparent}.bbi-form-control-container>input::placeholder{color:#d2d2d2}.bbi-form-control-hint{display:block;color:#525252;font-size:13px;margin-top:4px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: BbiControlError, selector: "bbi-control-error", inputs: ["errors"] }, { kind: "directive", type: i2$1.BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1058
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiFormControl, decorators: [{
|
|
554
1059
|
type: Component,
|
|
555
1060
|
args: [{ selector: 'bbi-form-control', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
556
1061
|
'class': 'bbi-form-control',
|
|
@@ -560,7 +1065,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
|
|
|
560
1065
|
'[class.readonly]': 'formControlInput?.readonly',
|
|
561
1066
|
'[class.focused]': 'formControlInput?.focused',
|
|
562
1067
|
'[class.error]': 'validationErrors$?.getValue()'
|
|
563
|
-
}, preserveWhitespaces: false, template: "<!-- Label of the form control. -->\n<label *ngIf=\"label as labelContent\"\n [attr.for]=\"labelId\"\n class=\"bbi-form-control-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n</label>\n\n<div class=\"bbi-form-control-container\">\n <ng-content select=\"[bbi-form-control-addon=prefix]\"></ng-content>\n <ng-content select=\"input[bbiFormControlInput]\"></ng-content>\n <ng-content select=\"[bbi-form-control-addon=suffix]\"></ng-content>\n</div>\n\n<bbi-control-error *ngIf=\"
|
|
1068
|
+
}, preserveWhitespaces: false, template: "<!-- Label of the form control. -->\n<label *ngIf=\"label as labelContent\"\n [attr.for]=\"labelId\"\n class=\"bbi-form-control-label\">\n <ng-template [bbTemplate]=\"labelContent\">{{ labelContent }}</ng-template>\n</label>\n\n<div class=\"bbi-form-control-container\">\n <ng-content select=\"[bbi-form-control-addon=prefix]\"></ng-content>\n <ng-content select=\"input[bbiFormControlInput]\"></ng-content>\n <ng-content select=\"[bbi-form-control-addon=suffix]\"></ng-content>\n</div>\n\n<bbi-control-error *ngIf=\"validationErrors$ | async as errors\"\n [errors]=\"errors\">\n</bbi-control-error>\n\n<div *ngIf=\"hint as hintContent\"\n class=\"bbi-form-control-hint\">\n <ng-template [bbTemplate]=\"hintContent\">{{ hintContent }}</ng-template>\n</div>\n", styles: [".bbi-form-control{display:block}.bbi-form-control.grouped{margin-bottom:var(--form-control-grouping, 20px)}.bbi-form-control.disabled{pointer-events:none;opacity:var(--form-control-disabled-opacity, .25)}.bbi-form-control.disabled>.bbi-form-control-container{color:var(--form-control-disabled-color, #111111);background:var(--form-control-disabled-background, white);border-radius:var(--form-control-disabled-border-radius, 6px);border:var(--form-control-disabled-border-width, 1px) var(--form-control-disabled-border-style, solid) var(--form-control-disabled-border-color, #212121)}.bbi-form-control.required:not([data-required-visually-hidden])>.bbi-form-control-label:after{content:\"*\";color:#bd322a;font-size:14px;vertical-align:text-top}.bbi-form-control:not(.readonly).focused>.bbi-form-control-container{color:var(--form-control-focused-color, #111111);box-shadow:var(--form-control-focused-shadow, 0 0 0 3px rgba(0, 123, 255, .2));background:var(--form-control-focused-background, white);border-radius:var(--form-control-focused-border-radius, 6px);border:var(--form-control-focused-border-width, 1px) var(--form-control-focused-border-style, solid) var(--form-control-focused-border-color, #212121)}.bbi-form-control:not(.readonly).error>.bbi-form-control-label{color:var(--form-control-error-color, var(--error-color, #bd322a))}.bbi-form-control:not(.readonly).error>.bbi-form-control-container{color:var(--form-control-error-color, var(--error-color, #bd322a));border-color:var(--form-control-error-color, var(--error-color, #bd322a));background:var(--form-control-error-background, rgba(189, 50, 42, .1))}.bbi-form-control:not(.readonly).error>.bbi-form-control-container>input::placeholder{color:var(--form-control-error-placeholder-color, rgba(189, 50, 42, .4))}.bbi-form-control-label{color:#525252;display:block;font-size:14px;font-weight:400;margin-bottom:4px}.bbi-form-control-container{display:flex;align-items:center;color:var(--form-control-color, #111111);border-radius:var(--form-control-border-radius, 6px);background-color:var(--form-control-background, white);border:var(--form-control-border-width, 1px) var(--form-control-border-style, solid) var(--form-control-border-color, rgba(67, 90, 111, .3))}.bbi-form-control-container>input{width:100%;border:none;height:40px;color:inherit;padding:0 10px;background-color:transparent}.bbi-form-control-container>input::placeholder{color:#d2d2d2}.bbi-form-control-hint{display:block;color:#525252;font-size:13px;margin-top:4px}\n"] }]
|
|
564
1069
|
}], ctorParameters: function () {
|
|
565
1070
|
return [{ type: i0.ChangeDetectorRef }, { type: BbiControlErrorSubmit, decorators: [{
|
|
566
1071
|
type: Optional
|
|
@@ -584,9 +1089,9 @@ class BbiFormControlAddon {
|
|
|
584
1089
|
this.type = null;
|
|
585
1090
|
}
|
|
586
1091
|
}
|
|
587
|
-
BbiFormControlAddon.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
588
|
-
BbiFormControlAddon.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.
|
|
589
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
1092
|
+
BbiFormControlAddon.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiFormControlAddon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1093
|
+
BbiFormControlAddon.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: BbiFormControlAddon, selector: "[bbi-form-control-addon]", inputs: { type: ["bbi-form-control-addon", "type"] }, host: { properties: { "class.prefix": "type === 'prefix'", "class.suffix": "type === 'suffix'" }, classAttribute: "bbi-form-control-addon" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [".bbi-form-control-addon{margin:0 10px;color:inherit;display:block}.bbi-form-control-addon.suffix{margin-left:0}.bbi-form-control-addon.prefix{margin-right:0}a.bbi-form-control-addon,button.bbi-form-control-addon{width:32px;height:32px;border:none;display:flex;-webkit-appearance:none;appearance:none;margin-right:4px;border-radius:6px;align-items:center;text-decoration:none;justify-content:center;background-color:transparent}a.bbi-form-control-addon,a.bbi-form-control-addon:visited,button.bbi-form-control-addon,button.bbi-form-control-addon:visited{color:inherit}a.bbi-form-control-addon:hover,button.bbi-form-control-addon:hover{background-color:#1565c014}a.bbi-form-control-addon:focus,button.bbi-form-control-addon:focus{background-color:#1565c01f}a.bbi-form-control-addon:active,button.bbi-form-control-addon:active{background-color:#1565c029}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1094
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiFormControlAddon, decorators: [{
|
|
590
1095
|
type: Component,
|
|
591
1096
|
args: [{ selector: '[bbi-form-control-addon]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
592
1097
|
'class': 'bbi-form-control-addon',
|
|
@@ -598,30 +1103,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
|
|
|
598
1103
|
args: ['bbi-form-control-addon']
|
|
599
1104
|
}] } });
|
|
600
1105
|
|
|
601
|
-
class ControlErrorModule {
|
|
602
|
-
}
|
|
603
|
-
ControlErrorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: ControlErrorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
604
|
-
ControlErrorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: ControlErrorModule, declarations: [BbiControlError, BbiControlErrorSubmit], imports: [CommonModule], exports: [BbiControlError, BbiControlErrorSubmit] });
|
|
605
|
-
ControlErrorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: ControlErrorModule, imports: [CommonModule] });
|
|
606
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: ControlErrorModule, decorators: [{
|
|
607
|
-
type: NgModule,
|
|
608
|
-
args: [{
|
|
609
|
-
imports: [CommonModule],
|
|
610
|
-
declarations: [BbiControlError, BbiControlErrorSubmit],
|
|
611
|
-
exports: [BbiControlError, BbiControlErrorSubmit]
|
|
612
|
-
}]
|
|
613
|
-
}] });
|
|
614
|
-
|
|
615
1106
|
class FormControlModule {
|
|
616
1107
|
}
|
|
617
|
-
FormControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
618
|
-
FormControlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.
|
|
1108
|
+
FormControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FormControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1109
|
+
FormControlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: FormControlModule, declarations: [BbiFormControl,
|
|
619
1110
|
BbiFormControlInput,
|
|
620
1111
|
BbiFormControlAddon], imports: [CommonModule, ControlErrorModule, UtilsModule], exports: [BbiFormControl,
|
|
621
1112
|
BbiFormControlInput,
|
|
622
1113
|
BbiFormControlAddon] });
|
|
623
|
-
FormControlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.
|
|
624
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
1114
|
+
FormControlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FormControlModule, imports: [CommonModule, ControlErrorModule, UtilsModule] });
|
|
1115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FormControlModule, decorators: [{
|
|
625
1116
|
type: NgModule,
|
|
626
1117
|
args: [{
|
|
627
1118
|
imports: [CommonModule, ControlErrorModule, UtilsModule],
|
|
@@ -674,38 +1165,45 @@ class ControlsModule {
|
|
|
674
1165
|
provide: BBI_CONTROL_ERRORS,
|
|
675
1166
|
useValue: Object.assign(Object.assign({}, controlErrorDefaults), ((_a = config === null || config === void 0 ? void 0 : config.errors) !== null && _a !== void 0 ? _a : {})),
|
|
676
1167
|
multi: true
|
|
677
|
-
},
|
|
678
|
-
{
|
|
679
|
-
provide: null,
|
|
680
|
-
useFactory: () => '',
|
|
681
|
-
multi: true
|
|
682
1168
|
}
|
|
683
1169
|
]
|
|
684
1170
|
};
|
|
685
1171
|
}
|
|
686
1172
|
}
|
|
687
|
-
ControlsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
688
|
-
ControlsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.
|
|
1173
|
+
ControlsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ControlsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1174
|
+
ControlsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ControlsModule, imports: [FormControlModule,
|
|
689
1175
|
CheckboxModule,
|
|
1176
|
+
RadioModule,
|
|
1177
|
+
ToggleModule,
|
|
690
1178
|
ControlErrorModule], exports: [FormControlModule,
|
|
691
1179
|
CheckboxModule,
|
|
1180
|
+
RadioModule,
|
|
1181
|
+
ToggleModule,
|
|
692
1182
|
ControlErrorModule] });
|
|
693
|
-
ControlsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.
|
|
1183
|
+
ControlsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ControlsModule, imports: [FormControlModule,
|
|
694
1184
|
CheckboxModule,
|
|
1185
|
+
RadioModule,
|
|
1186
|
+
ToggleModule,
|
|
695
1187
|
ControlErrorModule, FormControlModule,
|
|
696
1188
|
CheckboxModule,
|
|
1189
|
+
RadioModule,
|
|
1190
|
+
ToggleModule,
|
|
697
1191
|
ControlErrorModule] });
|
|
698
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
1192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ControlsModule, decorators: [{
|
|
699
1193
|
type: NgModule,
|
|
700
1194
|
args: [{
|
|
701
1195
|
imports: [
|
|
702
1196
|
FormControlModule,
|
|
703
1197
|
CheckboxModule,
|
|
1198
|
+
RadioModule,
|
|
1199
|
+
ToggleModule,
|
|
704
1200
|
ControlErrorModule
|
|
705
1201
|
],
|
|
706
1202
|
exports: [
|
|
707
1203
|
FormControlModule,
|
|
708
1204
|
CheckboxModule,
|
|
1205
|
+
RadioModule,
|
|
1206
|
+
ToggleModule,
|
|
709
1207
|
ControlErrorModule
|
|
710
1208
|
]
|
|
711
1209
|
}]
|
|
@@ -715,5 +1213,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
|
|
|
715
1213
|
* Generated bundle index. Do not edit.
|
|
716
1214
|
*/
|
|
717
1215
|
|
|
718
|
-
export { BBI_CONTROL_ERRORS, BbiCheckbox, BbiCheckboxGroup, BbiControlError, BbiControlErrorSubmit, BbiFormControl, BbiFormControlAddon, BbiFormControlInput, CheckboxModule, ControlErrorModule, ControlsModule, FormControlModule, controlErrorDefaults };
|
|
1216
|
+
export { BBI_CONTROL_ERRORS, BbiCheckbox, BbiCheckboxGroup, BbiControlError, BbiControlErrorSubmit, BbiFormControl, BbiFormControlAddon, BbiFormControlInput, BbiRadioButton, BbiRadioGroup, BbiToggle, BbiToggleGroup, CheckboxModule, ControlErrorModule, ControlsModule, FormControlModule, RadioModule, ToggleModule, controlErrorDefaults, shouldShowErrors };
|
|
719
1217
|
//# sourceMappingURL=bravobit-bb-foundation-controls.mjs.map
|