@bravobit/bb-foundation 0.23.4 → 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.
Files changed (187) hide show
  1. package/auth/lib/auth.service.d.ts +4 -3
  2. package/auth/lib/guards/anonymous.guard.d.ts +5 -4
  3. package/auth/lib/guards/authenticated.guard.d.ts +5 -4
  4. package/auth/lib/guards/permission.guard.d.ts +5 -4
  5. package/auth/lib/interfaces/config.interface.d.ts +8 -0
  6. package/controls/lib/control-error/control-error.utils.d.ts +3 -0
  7. package/controls/lib/controls.module.d.ts +4 -2
  8. package/controls/lib/form-control/form-control/form-control.component.d.ts +0 -2
  9. package/controls/lib/radio/radio-button/radio-button.component.d.ts +24 -0
  10. package/controls/lib/radio/radio-group/radio-group.component.d.ts +53 -0
  11. package/controls/lib/radio/radio.module.d.ts +11 -0
  12. package/controls/lib/toggle/toggle/toggle.component.d.ts +45 -0
  13. package/controls/lib/toggle/toggle-group/toggle-group.component.d.ts +23 -0
  14. package/controls/lib/toggle/toggle.module.d.ts +10 -0
  15. package/controls/public_api.d.ts +7 -0
  16. package/elements/lib/avatar/avatar.component.d.ts +1 -1
  17. package/esm2020/auth/lib/auth.interceptor.mjs +3 -3
  18. package/esm2020/auth/lib/auth.module.mjs +4 -4
  19. package/esm2020/auth/lib/auth.service.mjs +21 -6
  20. package/esm2020/auth/lib/directives/authenticated.directive.mjs +3 -3
  21. package/esm2020/auth/lib/directives/permission.directive.mjs +3 -3
  22. package/esm2020/auth/lib/guards/anonymous.guard.mjs +17 -7
  23. package/esm2020/auth/lib/guards/authenticated.guard.mjs +17 -7
  24. package/esm2020/auth/lib/guards/permission.guard.mjs +17 -7
  25. package/esm2020/auth/lib/interfaces/config.interface.mjs +3 -1
  26. package/esm2020/auth/lib/permissions/permissions.service.mjs +3 -3
  27. package/esm2020/collections/lib/collections.module.mjs +4 -4
  28. package/esm2020/collections/lib/components/collections-pager/collections-pager.component.mjs +3 -3
  29. package/esm2020/collections/lib/components/collections-viewer/collections-viewer.component.mjs +3 -3
  30. package/esm2020/collections/lib/components/collections.directive.mjs +12 -12
  31. package/esm2020/controls/lib/checkbox/checkbox/checkbox.component.mjs +22 -10
  32. package/esm2020/controls/lib/checkbox/checkbox-group/checkbox-group.component.mjs +13 -7
  33. package/esm2020/controls/lib/checkbox/checkbox.module.mjs +4 -4
  34. package/esm2020/controls/lib/control-error/control-error/control-error.component.mjs +3 -3
  35. package/esm2020/controls/lib/control-error/control-error-submit.directive.mjs +3 -3
  36. package/esm2020/controls/lib/control-error/control-error.module.mjs +4 -4
  37. package/esm2020/controls/lib/control-error/control-error.utils.mjs +20 -0
  38. package/esm2020/controls/lib/controls.module.mjs +19 -10
  39. package/esm2020/controls/lib/form-control/form-control/form-control.component.mjs +14 -30
  40. package/esm2020/controls/lib/form-control/form-control-addon/form-control-addon.component.mjs +3 -3
  41. package/esm2020/controls/lib/form-control/form-control-input.directive.mjs +3 -3
  42. package/esm2020/controls/lib/form-control/form-control.module.mjs +4 -4
  43. package/esm2020/controls/lib/radio/radio-button/radio-button.component.mjs +75 -0
  44. package/esm2020/controls/lib/radio/radio-group/radio-group.component.mjs +168 -0
  45. package/esm2020/controls/lib/radio/radio.module.mjs +21 -0
  46. package/esm2020/controls/lib/toggle/toggle/toggle.component.mjs +153 -0
  47. package/esm2020/controls/lib/toggle/toggle-group/toggle-group.component.mjs +62 -0
  48. package/esm2020/controls/lib/toggle/toggle.module.mjs +20 -0
  49. package/esm2020/controls/public_api.mjs +8 -1
  50. package/esm2020/dashboard/lib/dashboard/dashboard.component.mjs +3 -3
  51. package/esm2020/dashboard/lib/dashboard-header/dashboard-header.component.mjs +3 -3
  52. package/esm2020/dashboard/lib/dashboard-menu/dashboard-menu.component.mjs +3 -3
  53. package/esm2020/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.mjs +3 -3
  54. package/esm2020/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.mjs +3 -3
  55. package/esm2020/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.mjs +3 -3
  56. package/esm2020/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.mjs +3 -3
  57. package/esm2020/dashboard/lib/dashboard.module.mjs +4 -4
  58. package/esm2020/dialog/lib/dialog-actions/dialog-actions.component.mjs +3 -3
  59. package/esm2020/dialog/lib/dialog-confirm/dialog-confirm.component.mjs +3 -3
  60. package/esm2020/dialog/lib/dialog-container/dialog-container.component.mjs +3 -3
  61. package/esm2020/dialog/lib/dialog-header/dialog-header.component.mjs +3 -3
  62. package/esm2020/dialog/lib/dialog-link/dialog-link.component.mjs +3 -3
  63. package/esm2020/dialog/lib/dialog-modal/dialog-modal.component.mjs +3 -3
  64. package/esm2020/dialog/lib/dialog-overlay/dialog-overlay.component.mjs +3 -3
  65. package/esm2020/dialog/lib/dialog.insertion.mjs +3 -3
  66. package/esm2020/dialog/lib/dialog.module.mjs +4 -4
  67. package/esm2020/dialog/lib/dialog.service.mjs +3 -3
  68. package/esm2020/elements/lib/avatar/avatar.component.mjs +15 -13
  69. package/esm2020/elements/lib/button/button.component.mjs +6 -6
  70. package/esm2020/elements/lib/checkbox/checkbox.component.mjs +3 -3
  71. package/esm2020/elements/lib/date-picker/date-picker.component.mjs +3 -3
  72. package/esm2020/elements/lib/directives/addon.directive.mjs +6 -6
  73. package/esm2020/elements/lib/directives/form-submit.directive.mjs +3 -3
  74. package/esm2020/elements/lib/directives/form-submitter.directive.mjs +3 -3
  75. package/esm2020/elements/lib/directives/input.directive.mjs +6 -6
  76. package/esm2020/elements/lib/dropdown/dropdown.component.mjs +6 -6
  77. package/esm2020/elements/lib/elements.module.mjs +4 -4
  78. package/esm2020/elements/lib/file-picker/file-picker.component.mjs +3 -3
  79. package/esm2020/elements/lib/form-control/form-control.component.mjs +3 -3
  80. package/esm2020/elements/lib/form-error/form-error.component.mjs +3 -3
  81. package/esm2020/elements/lib/form-group/form-group.component.mjs +3 -3
  82. package/esm2020/elements/lib/icon/icon.component.mjs +3 -3
  83. package/esm2020/elements/lib/image-picker/image-picker.component.mjs +3 -3
  84. package/esm2020/elements/lib/pipes/file-image.pipe.mjs +3 -3
  85. package/esm2020/elements/lib/pipes/file-size.pipe.mjs +3 -3
  86. package/esm2020/elements/lib/pipes/relative-time.pipe.mjs +3 -3
  87. package/esm2020/elements/lib/spinner/spinner.component.mjs +3 -3
  88. package/esm2020/elements/lib/tag/tag.component.mjs +3 -3
  89. package/esm2020/http/lib/http.module.mjs +4 -4
  90. package/esm2020/http/lib/interceptors/base-url.interceptor.mjs +3 -3
  91. package/esm2020/http/lib/interceptors/error.interceptor.mjs +3 -3
  92. package/esm2020/lib/core/services/clipboard.service.mjs +3 -3
  93. package/esm2020/lib/core/services/exif.service.mjs +3 -3
  94. package/esm2020/lib/core/services/file-loader.service.mjs +3 -3
  95. package/esm2020/lib/core/services/image-converter.service.mjs +3 -3
  96. package/esm2020/lib/core/services/languages.service.mjs +3 -3
  97. package/esm2020/lib/core/services/network.service.mjs +3 -3
  98. package/esm2020/lib/core/services/patch.service.mjs +3 -3
  99. package/esm2020/localize/lib/dictionary/dictionary.class.mjs +2 -4
  100. package/esm2020/localize/lib/interfaces/config.interfaces.mjs +1 -1
  101. package/esm2020/localize/lib/localize.module.mjs +8 -5
  102. package/esm2020/localize/lib/localize.pipe.mjs +3 -3
  103. package/esm2020/localize/lib/localize.service.mjs +18 -5
  104. package/esm2020/localize/lib/views/localize-string/localize-string.component.mjs +3 -3
  105. package/esm2020/localize/lib/views/localize-template.directive.mjs +3 -3
  106. package/esm2020/masking/lib/directives/currency-mask.directive.mjs +3 -3
  107. package/esm2020/masking/lib/directives/date-mask.directive.mjs +3 -3
  108. package/esm2020/masking/lib/directives/input-mask.directive.mjs +3 -3
  109. package/esm2020/masking/lib/masking.module.mjs +4 -4
  110. package/esm2020/masking/lib/masking.service.mjs +3 -3
  111. package/esm2020/notifications/lib/notifications-item/notifications-item.component.mjs +3 -3
  112. package/esm2020/notifications/lib/notifications-list/notifications-list.component.mjs +3 -3
  113. package/esm2020/notifications/lib/notifications.module.mjs +4 -4
  114. package/esm2020/notifications/lib/notifications.service.mjs +3 -3
  115. package/esm2020/recaptcha/lib/recaptcha/recaptcha.component.mjs +3 -3
  116. package/esm2020/recaptcha/lib/recaptcha-loader.service.mjs +3 -3
  117. package/esm2020/recaptcha/lib/recaptcha.module.mjs +4 -4
  118. package/esm2020/storage/lib/storage.service.mjs +3 -3
  119. package/esm2020/table/lib/components/table/table.component.mjs +9 -9
  120. package/esm2020/table/lib/components/table-cell/table-cell.component.mjs +3 -3
  121. package/esm2020/table/lib/components/table-header-cell/table-header-cell.component.mjs +3 -3
  122. package/esm2020/table/lib/components/table-pager/table-pager.component.mjs +3 -3
  123. package/esm2020/table/lib/table.module.mjs +4 -4
  124. package/esm2020/theming/lib/themes/radio-button.theme.mjs +29 -0
  125. package/esm2020/theming/lib/themes/radio-group.theme.mjs +20 -0
  126. package/esm2020/theming/lib/themes/toggle-group.theme.mjs +17 -0
  127. package/esm2020/theming/lib/themes/toggle.theme.mjs +28 -0
  128. package/esm2020/theming/lib/theming.data.mjs +9 -1
  129. package/esm2020/theming/lib/theming.directive.mjs +3 -3
  130. package/esm2020/theming/lib/theming.interface.mjs +1 -1
  131. package/esm2020/theming/lib/theming.module.mjs +4 -4
  132. package/esm2020/utils/lib/directives/autosize.directive.mjs +3 -3
  133. package/esm2020/utils/lib/directives/focus-trap.directive.mjs +3 -3
  134. package/esm2020/utils/lib/directives/focus.directive.mjs +3 -3
  135. package/esm2020/utils/lib/directives/template.directive.mjs +3 -3
  136. package/esm2020/utils/lib/utils.module.mjs +4 -4
  137. package/fesm2015/bravobit-bb-foundation-auth.mjs +80 -38
  138. package/fesm2015/bravobit-bb-foundation-auth.mjs.map +1 -1
  139. package/fesm2015/bravobit-bb-foundation-collections.mjs +22 -22
  140. package/fesm2015/bravobit-bb-foundation-controls.mjs +677 -179
  141. package/fesm2015/bravobit-bb-foundation-controls.mjs.map +1 -1
  142. package/fesm2015/bravobit-bb-foundation-dashboard.mjs +25 -25
  143. package/fesm2015/bravobit-bb-foundation-dialog.mjs +31 -31
  144. package/fesm2015/bravobit-bb-foundation-elements.mjs +87 -85
  145. package/fesm2015/bravobit-bb-foundation-elements.mjs.map +1 -1
  146. package/fesm2015/bravobit-bb-foundation-http.mjs +10 -10
  147. package/fesm2015/bravobit-bb-foundation-localize.mjs +38 -22
  148. package/fesm2015/bravobit-bb-foundation-localize.mjs.map +1 -1
  149. package/fesm2015/bravobit-bb-foundation-masking.mjs +16 -16
  150. package/fesm2015/bravobit-bb-foundation-notifications.mjs +13 -13
  151. package/fesm2015/bravobit-bb-foundation-recaptcha.mjs +10 -10
  152. package/fesm2015/bravobit-bb-foundation-storage.mjs +3 -3
  153. package/fesm2015/bravobit-bb-foundation-table.mjs +22 -22
  154. package/fesm2015/bravobit-bb-foundation-theming.mjs +102 -7
  155. package/fesm2015/bravobit-bb-foundation-theming.mjs.map +1 -1
  156. package/fesm2015/bravobit-bb-foundation-utils.mjs +16 -16
  157. package/fesm2015/bravobit-bb-foundation.mjs +21 -21
  158. package/fesm2020/bravobit-bb-foundation-auth.mjs +80 -38
  159. package/fesm2020/bravobit-bb-foundation-auth.mjs.map +1 -1
  160. package/fesm2020/bravobit-bb-foundation-collections.mjs +22 -22
  161. package/fesm2020/bravobit-bb-foundation-controls.mjs +663 -173
  162. package/fesm2020/bravobit-bb-foundation-controls.mjs.map +1 -1
  163. package/fesm2020/bravobit-bb-foundation-dashboard.mjs +25 -25
  164. package/fesm2020/bravobit-bb-foundation-dialog.mjs +31 -31
  165. package/fesm2020/bravobit-bb-foundation-elements.mjs +87 -85
  166. package/fesm2020/bravobit-bb-foundation-elements.mjs.map +1 -1
  167. package/fesm2020/bravobit-bb-foundation-http.mjs +10 -10
  168. package/fesm2020/bravobit-bb-foundation-localize.mjs +34 -20
  169. package/fesm2020/bravobit-bb-foundation-localize.mjs.map +1 -1
  170. package/fesm2020/bravobit-bb-foundation-masking.mjs +16 -16
  171. package/fesm2020/bravobit-bb-foundation-notifications.mjs +13 -13
  172. package/fesm2020/bravobit-bb-foundation-recaptcha.mjs +10 -10
  173. package/fesm2020/bravobit-bb-foundation-storage.mjs +3 -3
  174. package/fesm2020/bravobit-bb-foundation-table.mjs +22 -22
  175. package/fesm2020/bravobit-bb-foundation-theming.mjs +102 -7
  176. package/fesm2020/bravobit-bb-foundation-theming.mjs.map +1 -1
  177. package/fesm2020/bravobit-bb-foundation-utils.mjs +16 -16
  178. package/fesm2020/bravobit-bb-foundation.mjs +21 -21
  179. package/localize/lib/interfaces/config.interfaces.d.ts +1 -0
  180. package/localize/lib/localize.module.d.ts +1 -1
  181. package/localize/lib/localize.service.d.ts +2 -1
  182. package/package.json +1 -1
  183. package/theming/lib/themes/radio-button.theme.d.ts +26 -0
  184. package/theming/lib/themes/radio-group.theme.d.ts +17 -0
  185. package/theming/lib/themes/toggle-group.theme.d.ts +16 -0
  186. package/theming/lib/themes/toggle.theme.d.ts +25 -0
  187. 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, Self, HostBinding, InjectionToken, Inject, ContentChild } from '@angular/core';
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 i1 from '@angular/common';
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$1 from '@angular/forms';
9
- import { NG_VALUE_ACCESSOR, Validators } from '@angular/forms';
10
- import { startWith, map, distinctUntilChanged, pairwise, switchMap, delay, debounceTime } from 'rxjs/operators';
11
- import { Subscription, fromEvent, merge, of, BehaviorSubject } from 'rxjs';
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$1 from '@bravobit/bb-foundation/localize';
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() { return this._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() { return this._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() { return this._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.1", ngImport: i0, type: BbiCheckboxGroup, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
53
- BbiCheckboxGroup.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", 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: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BbiCheckboxGroup, decorators: [{
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$1 = 0;
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$1++}`;
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() { return this._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() { return this._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() { return this._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() { return this._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() { return this._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() { return this._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) {
@@ -195,11 +213,11 @@ class BbiCheckbox {
195
213
  this._renderer.setProperty(element, field, value);
196
214
  }
197
215
  }
198
- BbiCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BbiCheckbox, deps: [{ token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
199
- BbiCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", 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: [
216
+ 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 });
217
+ 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: [
200
218
  { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbiCheckbox), multi: true }
201
- ], 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: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
202
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BbiCheckbox, decorators: [{
219
+ ], 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 });
220
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiCheckbox, decorators: [{
203
221
  type: Component,
204
222
  args: [{ selector: 'bbi-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
205
223
  { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbiCheckbox), multi: true }
@@ -232,10 +250,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
232
250
 
233
251
  class CheckboxModule {
234
252
  }
235
- CheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: CheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
236
- CheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: CheckboxModule, declarations: [BbiCheckbox, BbiCheckboxGroup], imports: [CommonModule, UtilsModule], exports: [BbiCheckbox, BbiCheckboxGroup] });
237
- CheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: CheckboxModule, imports: [CommonModule, UtilsModule] });
238
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: CheckboxModule, decorators: [{
253
+ CheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
254
+ 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] });
255
+ CheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CheckboxModule, imports: [CommonModule, UtilsModule] });
256
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CheckboxModule, decorators: [{
239
257
  type: NgModule,
240
258
  args: [{
241
259
  imports: [CommonModule, UtilsModule],
@@ -244,35 +262,96 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
244
262
  }]
245
263
  }] });
246
264
 
247
- class BbiFormControlInput {
248
- constructor(_elementRef, _formControl, _changeDetectorRef, _ngControl) {
249
- this._elementRef = _elementRef;
250
- this._formControl = _formControl;
265
+ class BbiToggleGroup {
266
+ constructor(_changeDetectorRef) {
267
+ this._changeDetectorRef = _changeDetectorRef;
268
+ // Inputs.
269
+ this.label = null;
270
+ this._grouped = false;
271
+ this._required = false;
272
+ this._inline = false;
273
+ }
274
+ // Grouped.
275
+ get grouped() { return this._grouped; }
276
+ set grouped(value) {
277
+ const newValue = coerceBooleanProperty(value);
278
+ if (newValue !== this.grouped) {
279
+ this._grouped = newValue;
280
+ this._changeDetectorRef.markForCheck();
281
+ }
282
+ }
283
+ // Required.
284
+ get required() { return this._required; }
285
+ set required(value) {
286
+ const newValue = coerceBooleanProperty(value);
287
+ if (newValue !== this.required) {
288
+ this._required = newValue;
289
+ this._changeDetectorRef.markForCheck();
290
+ }
291
+ }
292
+ // Inline.
293
+ get inline() { return this._inline; }
294
+ set inline(value) {
295
+ const newValue = coerceBooleanProperty(value);
296
+ if (newValue !== this.inline) {
297
+ this._inline = newValue;
298
+ this._changeDetectorRef.markForCheck();
299
+ }
300
+ }
301
+ }
302
+ BbiToggleGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiToggleGroup, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
303
+ 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 });
304
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiToggleGroup, decorators: [{
305
+ type: Component,
306
+ args: [{ selector: 'bbi-toggle-group', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
307
+ 'class': 'bbi-toggle-group',
308
+ '[class.grouped]': 'grouped',
309
+ '[class.required]': 'required',
310
+ '[class.inline]': 'inline'
311
+ }, 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"] }]
312
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { label: [{
313
+ type: Input
314
+ }], grouped: [{
315
+ type: Input
316
+ }], required: [{
317
+ type: Input
318
+ }], inline: [{
319
+ type: Input
320
+ }] } });
321
+
322
+ let nextUniqueId$1 = 0;
323
+ class BbiToggle {
324
+ constructor(_renderer, _changeDetectorRef) {
325
+ this._renderer = _renderer;
251
326
  this._changeDetectorRef = _changeDetectorRef;
252
- this._ngControl = _ngControl;
253
327
  // Readonly data.
254
- this.labelId = this._formControl?.labelId ?? null;
255
- // State.
256
- this.errors = null;
257
- this.focused = false;
258
- // Subscriptions.
259
- this._subscription = new Subscription();
328
+ this.labelId = `bbi-toggle-${nextUniqueId$1++}`;
329
+ // Outputs.
330
+ this.checkedChange = new EventEmitter();
331
+ this._checked = false;
260
332
  this._disabled = false;
261
- this._readonly = false;
333
+ this._grouped = false;
262
334
  this._required = false;
335
+ this._hideText = false;
336
+ // Methods.
337
+ this.onChange = () => ({});
338
+ this.onTouched = () => ({});
263
339
  }
264
- ngOnInit() {
265
- this.handleControlDisabledStatus();
266
- this.handleControlErrorStatus();
267
- this.handleFocusedState();
340
+ // Checked.
341
+ get checked() {
342
+ return this._checked;
268
343
  }
269
- ngOnDestroy() {
270
- this._subscription?.unsubscribe();
344
+ set checked(value) {
345
+ const newValue = coerceBooleanProperty(value);
346
+ if (newValue !== this.checked) {
347
+ this._checked = newValue;
348
+ this._changeDetectorRef.markForCheck();
349
+ }
271
350
  }
272
- get control() {
273
- return this._ngControl ?? null;
351
+ // Disabled.
352
+ get disabled() {
353
+ return this._disabled;
274
354
  }
275
- get disabled() { return this._disabled; }
276
355
  set disabled(value) {
277
356
  const newValue = coerceBooleanProperty(value);
278
357
  if (newValue !== this.disabled) {
@@ -280,18 +359,19 @@ class BbiFormControlInput {
280
359
  this._changeDetectorRef.markForCheck();
281
360
  }
282
361
  }
283
- get readonly() { return this._readonly; }
284
- set readonly(value) {
362
+ // Grouped.
363
+ get grouped() {
364
+ return this._grouped;
365
+ }
366
+ set grouped(value) {
285
367
  const newValue = coerceBooleanProperty(value);
286
- if (newValue !== this.readonly) {
287
- this._readonly = newValue;
368
+ if (newValue !== this.grouped) {
369
+ this._grouped = newValue;
288
370
  this._changeDetectorRef.markForCheck();
289
371
  }
290
372
  }
373
+ // Required.
291
374
  get required() {
292
- if (this._ngControl) {
293
- return this._ngControl?.control?.hasValidator(Validators.required);
294
- }
295
375
  return this._required;
296
376
  }
297
377
  set required(value) {
@@ -301,65 +381,126 @@ class BbiFormControlInput {
301
381
  this._changeDetectorRef.markForCheck();
302
382
  }
303
383
  }
304
- handleControlErrorStatus() {
305
- if (!this._ngControl) {
306
- return;
307
- }
308
- const errors$ = this._ngControl.statusChanges.pipe(startWith(this._ngControl.status), map(() => this._ngControl?.errors ?? null));
309
- const subscription = errors$.subscribe(errors => {
310
- this.errors = errors;
384
+ // Hide text.
385
+ get hideText() {
386
+ return this._hideText;
387
+ }
388
+ set hideText(value) {
389
+ const newValue = coerceBooleanProperty(value);
390
+ if (newValue !== this.hideText) {
391
+ this._hideText = newValue;
311
392
  this._changeDetectorRef.markForCheck();
312
- });
313
- this._subscription.add(subscription);
393
+ }
314
394
  }
315
- handleControlDisabledStatus() {
316
- if (!this._ngControl) {
395
+ registerOnChange(fn) {
396
+ this.onChange = fn;
397
+ }
398
+ registerOnTouched(fn) {
399
+ this.onTouched = fn;
400
+ }
401
+ setDisabledState(isDisabled) {
402
+ this.disabled = isDisabled;
403
+ }
404
+ writeValue(newValue) {
405
+ this.checked = !!newValue;
406
+ }
407
+ toggle() {
408
+ this.checked = !this.checked;
409
+ }
410
+ onClickEvent(event) {
411
+ event.stopPropagation();
412
+ if (this.disabled) {
317
413
  return;
318
414
  }
319
- const disabled$ = this._ngControl.statusChanges.pipe(startWith(this._ngControl.status), map(status => status === 'DISABLED'), distinctUntilChanged());
320
- const subscription = disabled$.subscribe(disabled => {
321
- this.disabled = disabled;
322
- });
323
- this._subscription.add(subscription);
415
+ this.toggle();
416
+ // Emit our custom change event if the native input emitted one.
417
+ // It is important to only emit it, if the native input triggered one, because
418
+ // we don't want to trigger a change event, when the `checked` variable changes for example.
419
+ this.emitChangeEvent();
324
420
  }
325
- handleFocusedState() {
326
- const focus$ = fromEvent(this._elementRef.nativeElement, 'focus').pipe(map(() => true));
327
- const blur$ = fromEvent(this._elementRef.nativeElement, 'blur').pipe(map(() => false));
328
- const focused$ = merge(focus$, blur$).pipe(startWith(false), pairwise(), switchMap(([oldValue, currentValue]) => {
329
- if (oldValue && !currentValue) {
330
- return of(currentValue).pipe(delay(100));
331
- }
332
- return of(currentValue);
333
- }), distinctUntilChanged());
334
- const subscription = focused$.subscribe(focused => this.focused = focused);
335
- this._subscription.add(subscription);
421
+ onChangeEvent(event) {
422
+ // We always have to stop propagation on the change event.
423
+ // Otherwise the change event, from the input element, will bubble up and
424
+ // emit its event object to the `change` output.
425
+ event.stopPropagation();
426
+ }
427
+ emitChangeEvent() {
428
+ this.onChange?.(this.checked);
429
+ this.checkedChange.emit(this.checked);
430
+ this.syncField('checked', this.checked);
431
+ }
432
+ syncField(field, value) {
433
+ const element = this.inputElementRef?.nativeElement;
434
+ if (!element) {
435
+ return;
436
+ }
437
+ this._renderer.setProperty(element, field, value);
336
438
  }
337
439
  }
338
- BbiFormControlInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BbiFormControlInput, deps: [{ token: i0.ElementRef }, { token: BbiFormControl }, { token: i0.ChangeDetectorRef }, { token: i2$1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
339
- BbiFormControlInputdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.1", type: BbiFormControlInput, selector: "input[bbiFormControlInput]", inputs: { disabled: "disabled", readonly: "readonly", required: "required" }, host: { properties: { "attr.id": "this.labelId", "required": "this.required" } }, ngImport: i0 });
340
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BbiFormControlInput, decorators: [{
341
- type: Directive,
342
- args: [{
343
- selector: 'input[bbiFormControlInput]'
344
- }]
345
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: BbiFormControl }, { type: i0.ChangeDetectorRef }, { type: i2$1.NgControl, decorators: [{
346
- type: Optional
347
- }, {
348
- type: Self
349
- }] }]; }, propDecorators: { labelId: [{
350
- type: HostBinding,
351
- args: ['attr.id']
440
+ 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 });
441
+ BbiTogglecmp = 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: [
442
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbiToggle), multi: true }
443
+ ], 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 });
444
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiToggle, decorators: [{
445
+ type: Component,
446
+ args: [{ selector: 'bbi-toggle', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
447
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbiToggle), multi: true }
448
+ ], host: {
449
+ 'class': 'bbi-toggle',
450
+ '[class.grouped]': 'grouped',
451
+ '[class.required]': 'required'
452
+ }, 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"] }]
453
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { inputElementRef: [{
454
+ type: ViewChild,
455
+ args: ['input', { static: true }]
456
+ }], checkedChange: [{
457
+ type: Output
458
+ }], checked: [{
459
+ type: Input
352
460
  }], disabled: [{
353
461
  type: Input
354
- }], readonly: [{
462
+ }], grouped: [{
355
463
  type: Input
356
464
  }], required: [{
357
- type: HostBinding,
358
- args: ['required']
359
- }, {
465
+ type: Input
466
+ }], hideText: [{
360
467
  type: Input
361
468
  }] } });
362
469
 
470
+ class ToggleModule {
471
+ }
472
+ ToggleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToggleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
473
+ 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] });
474
+ ToggleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToggleModule, imports: [CommonModule, UtilsModule] });
475
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToggleModule, decorators: [{
476
+ type: NgModule,
477
+ args: [{
478
+ imports: [CommonModule, UtilsModule],
479
+ declarations: [BbiToggle, BbiToggleGroup],
480
+ exports: [BbiToggle, BbiToggleGroup]
481
+ }]
482
+ }] });
483
+
484
+ function shouldShowErrors(mode, control, submitted, focused, readonly) {
485
+ if (mode === 'hidden' || readonly || control?.disabled) {
486
+ return false;
487
+ }
488
+ // When submitted always show the errors.
489
+ if (submitted && !focused) {
490
+ return true;
491
+ }
492
+ // We want to show changes even when the user is focused.
493
+ if (mode === 'changes') {
494
+ return control?.dirty ?? false;
495
+ }
496
+ // On blur show the error.
497
+ if (mode === 'blur' && !focused) {
498
+ return control?.touched ?? false;
499
+ }
500
+ // Must not show the errors.
501
+ return false;
502
+ }
503
+
363
504
  class BbiControlErrorSubmit {
364
505
  constructor(_elementRef) {
365
506
  this._elementRef = _elementRef;
@@ -393,9 +534,9 @@ class BbiControlErrorSubmit {
393
534
  this._subscription.add(subscription);
394
535
  }
395
536
  }
396
- BbiControlErrorSubmit.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BbiControlErrorSubmit, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
397
- BbiControlErrorSubmit.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.1", type: BbiControlErrorSubmit, selector: "form", exportAs: ["bbiControlErrorSubmit"], ngImport: i0 });
398
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BbiControlErrorSubmit, decorators: [{
537
+ BbiControlErrorSubmit.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiControlErrorSubmit, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
538
+ BbiControlErrorSubmit.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.2", type: BbiControlErrorSubmit, selector: "form", exportAs: ["bbiControlErrorSubmit"], ngImport: i0 });
539
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiControlErrorSubmit, decorators: [{
399
540
  type: Directive,
400
541
  args: [{
401
542
  selector: 'form',
@@ -457,12 +598,12 @@ class BbiControlError {
457
598
  : data?.token;
458
599
  }
459
600
  }
460
- BbiControlError.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BbiControlError, deps: [{ token: i1$1.Localize, optional: true }, { token: BBI_CONTROL_ERRORS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
461
- BbiControlError.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", 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 });
462
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BbiControlError, decorators: [{
601
+ 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 });
602
+ 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 });
603
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiControlError, decorators: [{
463
604
  type: Component,
464
605
  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"] }]
465
- }], ctorParameters: function () { return [{ type: i1$1.Localize, decorators: [{
606
+ }], ctorParameters: function () { return [{ type: i1.Localize, decorators: [{
466
607
  type: Optional
467
608
  }] }, { type: undefined, decorators: [{
468
609
  type: Optional
@@ -476,34 +617,96 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
476
617
  type: Input
477
618
  }] } });
478
619
 
479
- let nextUniqueId = 0;
480
- class BbiFormControl {
481
- constructor(_changeDetectorRef, _errorSubmit) {
620
+ class BbiRadioGroup {
621
+ constructor(_injector, _changeDetectorRef, _errorSubmit) {
622
+ this._injector = _injector;
482
623
  this._changeDetectorRef = _changeDetectorRef;
483
624
  this._errorSubmit = _errorSubmit;
484
- // Readonly data.
485
- this.labelId = `bbi-form-control-${nextUniqueId++}`;
486
625
  // Inputs.
487
626
  this.label = null;
488
- this.hint = null;
489
627
  this.errorMode = 'blur';
628
+ // Outputs.
629
+ this.valueChange = new EventEmitter();
490
630
  // State.
491
631
  this.validationErrors$ = new BehaviorSubject(null);
492
- this.errors$ = this.validationErrors$.pipe(debounceTime(5), distinctUntilChanged());
632
+ this._value = null;
633
+ this._disabled = false;
493
634
  this._grouped = false;
635
+ this._readonly = false;
636
+ this._required = false;
637
+ this._inline = false;
638
+ // Methods.
639
+ this.onChange = () => ({});
640
+ this.onTouched = () => ({});
494
641
  }
495
- // Grouped.
496
- get grouped() { return this._grouped; }
497
- set grouped(value) {
642
+ // Value.
643
+ get value() {
644
+ return this._value;
645
+ }
646
+ set value(value) {
647
+ this._value = value;
648
+ this._changeDetectorRef.markForCheck();
649
+ }
650
+ // Disabled.
651
+ get disabled() {
652
+ return this._disabled;
653
+ }
654
+ set disabled(value) {
655
+ const newValue = coerceBooleanProperty(value);
656
+ if (newValue !== this.disabled) {
657
+ this._disabled = newValue;
658
+ this._changeDetectorRef.markForCheck();
659
+ }
660
+ }
661
+ // Grouped.
662
+ get grouped() {
663
+ return this._grouped;
664
+ }
665
+ set grouped(value) {
498
666
  const newValue = coerceBooleanProperty(value);
499
667
  if (newValue !== this.grouped) {
500
668
  this._grouped = newValue;
501
669
  this._changeDetectorRef.markForCheck();
502
670
  }
503
671
  }
672
+ // Readonly.
673
+ get readonly() {
674
+ return this._readonly;
675
+ }
676
+ set readonly(value) {
677
+ const newValue = coerceBooleanProperty(value);
678
+ if (newValue !== this.grouped) {
679
+ this._readonly = newValue;
680
+ this._changeDetectorRef.markForCheck();
681
+ }
682
+ }
683
+ // Required.
684
+ get required() {
685
+ return this._required;
686
+ }
687
+ set required(value) {
688
+ const newValue = coerceBooleanProperty(value);
689
+ if (newValue !== this.required) {
690
+ this._required = newValue;
691
+ this._changeDetectorRef.markForCheck();
692
+ }
693
+ }
694
+ // Inline.
695
+ get inline() {
696
+ return this._inline;
697
+ }
698
+ set inline(value) {
699
+ const newValue = coerceBooleanProperty(value);
700
+ if (newValue !== this.inline) {
701
+ this._inline = newValue;
702
+ this._changeDetectorRef.markForCheck();
703
+ }
704
+ }
504
705
  ngDoCheck() {
505
- const hasErrors = this.showErrors();
506
- const errors = this.formControlInput?.errors ?? null;
706
+ const control = this._injector.get(NgControl);
707
+ const submitted = this._errorSubmit?.submitted;
708
+ const hasErrors = shouldShowErrors(this.errorMode, control, submitted, false, this.readonly);
709
+ const errors = control?.errors ?? null;
507
710
  const newValue = hasErrors ? errors : null;
508
711
  const equal = JSON.stringify(newValue) === JSON.stringify(this.validationErrors$.getValue());
509
712
  if (equal) {
@@ -511,31 +714,325 @@ class BbiFormControl {
511
714
  }
512
715
  this.validationErrors$.next(newValue);
513
716
  }
514
- showErrors() {
515
- // When the error mode is none we don't want to show
516
- if (this.errorMode === 'hidden' || this.formControlInput?.readonly) {
517
- return false;
717
+ select(value) {
718
+ if (this.value === value || this.disabled || this.readonly) {
719
+ return;
518
720
  }
519
- // When submitted always show the errors.
520
- const focused = this.formControlInput?.focused;
521
- if (this._errorSubmit?.submitted && !focused) {
522
- return true;
721
+ this.value = value;
722
+ this.onChange?.(this.value);
723
+ this.valueChange.emit(this.value);
724
+ this.onTouched?.();
725
+ }
726
+ registerOnChange(fn) {
727
+ this.onChange = fn;
728
+ }
729
+ registerOnTouched(fn) {
730
+ this.onTouched = fn;
731
+ }
732
+ setDisabledState(isDisabled) {
733
+ this.disabled = isDisabled;
734
+ }
735
+ writeValue(newValue) {
736
+ this.value = newValue;
737
+ }
738
+ }
739
+ 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 });
740
+ 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: [
741
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbiRadioGroup), multi: true }
742
+ ], 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 });
743
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiRadioGroup, decorators: [{
744
+ type: Component,
745
+ args: [{ selector: 'bbi-radio-group', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
746
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BbiRadioGroup), multi: true }
747
+ ], host: {
748
+ 'class': 'bbi-radio-group',
749
+ '[class.disabled]': 'disabled',
750
+ '[class.readonly]': 'readonly',
751
+ '[class.grouped]': 'grouped',
752
+ '[class.required]': 'required',
753
+ '[class.inline]': 'inline',
754
+ '[class.error]': 'validationErrors$?.getValue()'
755
+ }, 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"] }]
756
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.ChangeDetectorRef }, { type: BbiControlErrorSubmit, decorators: [{
757
+ type: Optional
758
+ }] }]; }, propDecorators: { label: [{
759
+ type: Input
760
+ }], errorMode: [{
761
+ type: Input
762
+ }], valueChange: [{
763
+ type: Output
764
+ }], value: [{
765
+ type: Input
766
+ }], disabled: [{
767
+ type: Input
768
+ }], grouped: [{
769
+ type: Input
770
+ }], readonly: [{
771
+ type: Input
772
+ }], required: [{
773
+ type: Input
774
+ }], inline: [{
775
+ type: Input
776
+ }] } });
777
+
778
+ class BbiRadioButton {
779
+ constructor(_radioGroup, _changeDetectorRef) {
780
+ this._radioGroup = _radioGroup;
781
+ this._changeDetectorRef = _changeDetectorRef;
782
+ // Inputs.
783
+ this.value = null;
784
+ this._disabled = false;
785
+ this._hideText = false;
786
+ }
787
+ // Disabled.
788
+ get disabled() {
789
+ return this._radioGroup?.disabled || this._disabled;
790
+ }
791
+ set disabled(value) {
792
+ const newValue = coerceBooleanProperty(value);
793
+ if (newValue !== this.disabled) {
794
+ this._disabled = newValue;
795
+ this._changeDetectorRef.markForCheck();
523
796
  }
524
- // We want to show changes even when the user is focused.
525
- if (this.errorMode === 'changes') {
526
- return this.formControlInput?.control?.dirty ?? false;
797
+ }
798
+ // Hide text.
799
+ get hideText() {
800
+ return this._hideText;
801
+ }
802
+ set hideText(value) {
803
+ const newValue = coerceBooleanProperty(value);
804
+ if (newValue !== this.hideText) {
805
+ this._hideText = newValue;
806
+ this._changeDetectorRef.markForCheck();
527
807
  }
528
- // On blur show the error.
529
- if (this.errorMode === 'blur' && !focused) {
530
- return this.formControlInput?.control?.touched ?? false;
808
+ }
809
+ onClick() {
810
+ if (this.disabled) {
811
+ return;
531
812
  }
532
- // Must not show the errors.
533
- return false;
813
+ this._radioGroup.select(this.value);
814
+ }
815
+ onSpacePressed() {
816
+ return this.onClick();
817
+ }
818
+ get selected() {
819
+ return this._radioGroup?.value === this.value;
820
+ }
821
+ }
822
+ 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 });
823
+ 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 });
824
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiRadioButton, decorators: [{
825
+ type: Component,
826
+ args: [{ selector: 'bbi-radio-button', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
827
+ 'class': 'bbi-radio-button',
828
+ '[class.disabled]': 'disabled',
829
+ '[tabindex]': 'disabled ? -1 : 0'
830
+ }, 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"] }]
831
+ }], ctorParameters: function () { return [{ type: BbiRadioGroup }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { value: [{
832
+ type: Input
833
+ }], disabled: [{
834
+ type: Input
835
+ }], hideText: [{
836
+ type: Input
837
+ }], onClick: [{
838
+ type: HostListener,
839
+ args: ['click']
840
+ }], onSpacePressed: [{
841
+ type: HostListener,
842
+ args: ['keydown.space']
843
+ }], selected: [{
844
+ type: HostBinding,
845
+ args: ['class.selected']
846
+ }] } });
847
+
848
+ class ControlErrorModule {
849
+ }
850
+ ControlErrorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ControlErrorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
851
+ ControlErrorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ControlErrorModule, declarations: [BbiControlError, BbiControlErrorSubmit], imports: [CommonModule], exports: [BbiControlError, BbiControlErrorSubmit] });
852
+ ControlErrorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ControlErrorModule, imports: [CommonModule] });
853
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ControlErrorModule, decorators: [{
854
+ type: NgModule,
855
+ args: [{
856
+ imports: [CommonModule],
857
+ declarations: [BbiControlError, BbiControlErrorSubmit],
858
+ exports: [BbiControlError, BbiControlErrorSubmit]
859
+ }]
860
+ }] });
861
+
862
+ class RadioModule {
863
+ }
864
+ RadioModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: RadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
865
+ 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] });
866
+ RadioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: RadioModule, imports: [CommonModule, ControlErrorModule, UtilsModule] });
867
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: RadioModule, decorators: [{
868
+ type: NgModule,
869
+ args: [{
870
+ imports: [CommonModule, ControlErrorModule, UtilsModule],
871
+ declarations: [BbiRadioGroup, BbiRadioButton],
872
+ exports: [BbiRadioGroup, BbiRadioButton]
873
+ }]
874
+ }] });
875
+
876
+ class BbiFormControlInput {
877
+ constructor(_elementRef, _formControl, _changeDetectorRef, _ngControl) {
878
+ this._elementRef = _elementRef;
879
+ this._formControl = _formControl;
880
+ this._changeDetectorRef = _changeDetectorRef;
881
+ this._ngControl = _ngControl;
882
+ // Readonly data.
883
+ this.labelId = this._formControl?.labelId ?? null;
884
+ // State.
885
+ this.errors = null;
886
+ this.focused = false;
887
+ // Subscriptions.
888
+ this._subscription = new Subscription();
889
+ this._disabled = false;
890
+ this._readonly = false;
891
+ this._required = false;
892
+ }
893
+ ngOnInit() {
894
+ this.handleControlDisabledStatus();
895
+ this.handleControlErrorStatus();
896
+ this.handleFocusedState();
897
+ }
898
+ ngOnDestroy() {
899
+ this._subscription?.unsubscribe();
900
+ }
901
+ get control() {
902
+ return this._ngControl ?? null;
903
+ }
904
+ get disabled() { return this._disabled; }
905
+ set disabled(value) {
906
+ const newValue = coerceBooleanProperty(value);
907
+ if (newValue !== this.disabled) {
908
+ this._disabled = newValue;
909
+ this._changeDetectorRef.markForCheck();
910
+ }
911
+ }
912
+ get readonly() { return this._readonly; }
913
+ set readonly(value) {
914
+ const newValue = coerceBooleanProperty(value);
915
+ if (newValue !== this.readonly) {
916
+ this._readonly = newValue;
917
+ this._changeDetectorRef.markForCheck();
918
+ }
919
+ }
920
+ get required() {
921
+ if (this._ngControl) {
922
+ return this._ngControl?.control?.hasValidator(Validators.required);
923
+ }
924
+ return this._required;
925
+ }
926
+ set required(value) {
927
+ const newValue = coerceBooleanProperty(value);
928
+ if (newValue !== this.required) {
929
+ this._required = newValue;
930
+ this._changeDetectorRef.markForCheck();
931
+ }
932
+ }
933
+ handleControlErrorStatus() {
934
+ if (!this._ngControl) {
935
+ return;
936
+ }
937
+ const errors$ = this._ngControl.statusChanges.pipe(startWith(this._ngControl.status), map(() => this._ngControl?.errors ?? null));
938
+ const subscription = errors$.subscribe(errors => {
939
+ this.errors = errors;
940
+ this._changeDetectorRef.markForCheck();
941
+ });
942
+ this._subscription.add(subscription);
943
+ }
944
+ handleControlDisabledStatus() {
945
+ if (!this._ngControl) {
946
+ return;
947
+ }
948
+ const disabled$ = this._ngControl.statusChanges.pipe(startWith(this._ngControl.status), map(status => status === 'DISABLED'), distinctUntilChanged());
949
+ const subscription = disabled$.subscribe(disabled => {
950
+ this.disabled = disabled;
951
+ });
952
+ this._subscription.add(subscription);
953
+ }
954
+ handleFocusedState() {
955
+ const focus$ = fromEvent(this._elementRef.nativeElement, 'focus').pipe(map(() => true));
956
+ const blur$ = fromEvent(this._elementRef.nativeElement, 'blur').pipe(map(() => false));
957
+ const focused$ = merge(focus$, blur$).pipe(startWith(false), pairwise(), switchMap(([oldValue, currentValue]) => {
958
+ if (oldValue && !currentValue) {
959
+ return of(currentValue).pipe(delay(100));
960
+ }
961
+ return of(currentValue);
962
+ }), distinctUntilChanged());
963
+ const subscription = focused$.subscribe(focused => this.focused = focused);
964
+ this._subscription.add(subscription);
534
965
  }
535
966
  }
536
- BbiFormControl.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BbiFormControl, deps: [{ token: i0.ChangeDetectorRef }, { token: BbiControlErrorSubmit, optional: true }], target: i0.ɵɵFactoryTarget.Component });
537
- BbiFormControlcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", 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=\"errors$ | 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: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: BbiControlError, selector: "bbi-control-error", inputs: ["errors"] }, { kind: "directive", type: i2.BbTemplate, selector: "[bbTemplate]", inputs: ["bbTemplate"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
538
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BbiFormControl, decorators: [{
967
+ 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 });
968
+ BbiFormControlInputdir = 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 });
969
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiFormControlInput, decorators: [{
970
+ type: Directive,
971
+ args: [{
972
+ selector: 'input[bbiFormControlInput]'
973
+ }]
974
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: BbiFormControl }, { type: i0.ChangeDetectorRef }, { type: i2$2.NgControl, decorators: [{
975
+ type: Optional
976
+ }, {
977
+ type: Self
978
+ }] }]; }, propDecorators: { labelId: [{
979
+ type: HostBinding,
980
+ args: ['attr.id']
981
+ }], disabled: [{
982
+ type: Input
983
+ }], readonly: [{
984
+ type: Input
985
+ }], required: [{
986
+ type: HostBinding,
987
+ args: ['required']
988
+ }, {
989
+ type: Input
990
+ }] } });
991
+
992
+ let nextUniqueId = 0;
993
+ class BbiFormControl {
994
+ constructor(_changeDetectorRef, _errorSubmit) {
995
+ this._changeDetectorRef = _changeDetectorRef;
996
+ this._errorSubmit = _errorSubmit;
997
+ // Readonly data.
998
+ this.labelId = `bbi-form-control-${nextUniqueId++}`;
999
+ // Inputs.
1000
+ this.label = null;
1001
+ this.hint = null;
1002
+ this.errorMode = 'blur';
1003
+ // State.
1004
+ this.validationErrors$ = new BehaviorSubject(null);
1005
+ this._grouped = false;
1006
+ }
1007
+ // Grouped.
1008
+ get grouped() {
1009
+ return this._grouped;
1010
+ }
1011
+ set grouped(value) {
1012
+ const newValue = coerceBooleanProperty(value);
1013
+ if (newValue !== this.grouped) {
1014
+ this._grouped = newValue;
1015
+ this._changeDetectorRef.markForCheck();
1016
+ }
1017
+ }
1018
+ ngDoCheck() {
1019
+ const control = this.formControlInput?.control;
1020
+ const submitted = this._errorSubmit?.submitted;
1021
+ const focused = this.formControlInput?.focused;
1022
+ const readonly = this.formControlInput?.readonly;
1023
+ const hasErrors = shouldShowErrors(this.errorMode, control, submitted, focused, readonly);
1024
+ const errors = this.formControlInput?.errors ?? null;
1025
+ const newValue = hasErrors ? errors : null;
1026
+ const equal = JSON.stringify(newValue) === JSON.stringify(this.validationErrors$.getValue());
1027
+ if (equal) {
1028
+ return;
1029
+ }
1030
+ this.validationErrors$.next(newValue);
1031
+ }
1032
+ }
1033
+ 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 });
1034
+ 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 });
1035
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiFormControl, decorators: [{
539
1036
  type: Component,
540
1037
  args: [{ selector: 'bbi-form-control', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
541
1038
  'class': 'bbi-form-control',
@@ -545,7 +1042,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
545
1042
  '[class.readonly]': 'formControlInput?.readonly',
546
1043
  '[class.focused]': 'formControlInput?.focused',
547
1044
  '[class.error]': 'validationErrors$?.getValue()'
548
- }, 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=\"errors$ | 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"] }]
1045
+ }, 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"] }]
549
1046
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: BbiControlErrorSubmit, decorators: [{
550
1047
  type: Optional
551
1048
  }] }]; }, propDecorators: { formControlInput: [{
@@ -567,9 +1064,9 @@ class BbiFormControlAddon {
567
1064
  this.type = null;
568
1065
  }
569
1066
  }
570
- BbiFormControlAddon.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BbiFormControlAddon, deps: [], target: i0.ɵɵFactoryTarget.Component });
571
- BbiFormControlAddon.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", 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 });
572
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: BbiFormControlAddon, decorators: [{
1067
+ BbiFormControlAddon.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiFormControlAddon, deps: [], target: i0.ɵɵFactoryTarget.Component });
1068
+ 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 });
1069
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BbiFormControlAddon, decorators: [{
573
1070
  type: Component,
574
1071
  args: [{ selector: '[bbi-form-control-addon]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
575
1072
  'class': 'bbi-form-control-addon',
@@ -581,30 +1078,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
581
1078
  args: ['bbi-form-control-addon']
582
1079
  }] } });
583
1080
 
584
- class ControlErrorModule {
585
- }
586
- ControlErrorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: ControlErrorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
587
- ControlErrorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: ControlErrorModule, declarations: [BbiControlError, BbiControlErrorSubmit], imports: [CommonModule], exports: [BbiControlError, BbiControlErrorSubmit] });
588
- ControlErrorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: ControlErrorModule, imports: [CommonModule] });
589
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: ControlErrorModule, decorators: [{
590
- type: NgModule,
591
- args: [{
592
- imports: [CommonModule],
593
- declarations: [BbiControlError, BbiControlErrorSubmit],
594
- exports: [BbiControlError, BbiControlErrorSubmit]
595
- }]
596
- }] });
597
-
598
1081
  class FormControlModule {
599
1082
  }
600
- FormControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: FormControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
601
- FormControlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: FormControlModule, declarations: [BbiFormControl,
1083
+ FormControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FormControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1084
+ FormControlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: FormControlModule, declarations: [BbiFormControl,
602
1085
  BbiFormControlInput,
603
1086
  BbiFormControlAddon], imports: [CommonModule, ControlErrorModule, UtilsModule], exports: [BbiFormControl,
604
1087
  BbiFormControlInput,
605
1088
  BbiFormControlAddon] });
606
- FormControlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: FormControlModule, imports: [CommonModule, ControlErrorModule, UtilsModule] });
607
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: FormControlModule, decorators: [{
1089
+ FormControlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FormControlModule, imports: [CommonModule, ControlErrorModule, UtilsModule] });
1090
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FormControlModule, decorators: [{
608
1091
  type: NgModule,
609
1092
  args: [{
610
1093
  imports: [CommonModule, ControlErrorModule, UtilsModule],
@@ -656,38 +1139,45 @@ class ControlsModule {
656
1139
  provide: BBI_CONTROL_ERRORS,
657
1140
  useValue: { ...controlErrorDefaults, ...(config?.errors ?? {}) },
658
1141
  multi: true
659
- },
660
- {
661
- provide: null,
662
- useFactory: () => '',
663
- multi: true
664
1142
  }
665
1143
  ]
666
1144
  };
667
1145
  }
668
1146
  }
669
- ControlsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: ControlsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
670
- ControlsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: ControlsModule, imports: [FormControlModule,
1147
+ ControlsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ControlsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1148
+ ControlsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ControlsModule, imports: [FormControlModule,
671
1149
  CheckboxModule,
1150
+ RadioModule,
1151
+ ToggleModule,
672
1152
  ControlErrorModule], exports: [FormControlModule,
673
1153
  CheckboxModule,
1154
+ RadioModule,
1155
+ ToggleModule,
674
1156
  ControlErrorModule] });
675
- ControlsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: ControlsModule, imports: [FormControlModule,
1157
+ ControlsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ControlsModule, imports: [FormControlModule,
676
1158
  CheckboxModule,
1159
+ RadioModule,
1160
+ ToggleModule,
677
1161
  ControlErrorModule, FormControlModule,
678
1162
  CheckboxModule,
1163
+ RadioModule,
1164
+ ToggleModule,
679
1165
  ControlErrorModule] });
680
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: ControlsModule, decorators: [{
1166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ControlsModule, decorators: [{
681
1167
  type: NgModule,
682
1168
  args: [{
683
1169
  imports: [
684
1170
  FormControlModule,
685
1171
  CheckboxModule,
1172
+ RadioModule,
1173
+ ToggleModule,
686
1174
  ControlErrorModule
687
1175
  ],
688
1176
  exports: [
689
1177
  FormControlModule,
690
1178
  CheckboxModule,
1179
+ RadioModule,
1180
+ ToggleModule,
691
1181
  ControlErrorModule
692
1182
  ]
693
1183
  }]
@@ -697,5 +1187,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
697
1187
  * Generated bundle index. Do not edit.
698
1188
  */
699
1189
 
700
- export { BBI_CONTROL_ERRORS, BbiCheckbox, BbiCheckboxGroup, BbiControlError, BbiControlErrorSubmit, BbiFormControl, BbiFormControlAddon, BbiFormControlInput, CheckboxModule, ControlErrorModule, ControlsModule, FormControlModule, controlErrorDefaults };
1190
+ export { BBI_CONTROL_ERRORS, BbiCheckbox, BbiCheckboxGroup, BbiControlError, BbiControlErrorSubmit, BbiFormControl, BbiFormControlAddon, BbiFormControlInput, BbiRadioButton, BbiRadioGroup, BbiToggle, BbiToggleGroup, CheckboxModule, ControlErrorModule, ControlsModule, FormControlModule, RadioModule, ToggleModule, controlErrorDefaults, shouldShowErrors };
701
1191
  //# sourceMappingURL=bravobit-bb-foundation-controls.mjs.map