@skyux/forms 5.7.2 → 6.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/documentation.json +630 -630
  2. package/esm2020/index.mjs +43 -0
  3. package/esm2020/lib/modules/character-counter/character-counter-indicator.component.mjs +32 -0
  4. package/esm2020/lib/modules/character-counter/character-counter.directive.mjs +84 -0
  5. package/esm2020/lib/modules/character-counter/character-counter.module.mjs +46 -0
  6. package/esm2020/lib/modules/checkbox/checkbox-change.mjs +6 -0
  7. package/esm2020/lib/modules/checkbox/checkbox-label.component.mjs +14 -0
  8. package/esm2020/lib/modules/checkbox/checkbox-required-validator.directive.mjs +32 -0
  9. package/esm2020/lib/modules/checkbox/checkbox.component.mjs +237 -0
  10. package/esm2020/lib/modules/checkbox/checkbox.module.mjs +34 -0
  11. package/esm2020/lib/modules/file-attachment/file-attachment-label.component.mjs +14 -0
  12. package/esm2020/lib/modules/file-attachment/file-attachment.component.mjs +325 -0
  13. package/esm2020/lib/modules/file-attachment/file-attachment.service.mjs +94 -0
  14. package/esm2020/lib/modules/file-attachment/file-attachments.module.mjs +68 -0
  15. package/esm2020/lib/modules/file-attachment/file-drop.component.mjs +217 -0
  16. package/esm2020/lib/modules/file-attachment/file-item-error-type.mjs +2 -0
  17. package/esm2020/lib/modules/file-attachment/file-item.component.mjs +112 -0
  18. package/esm2020/lib/modules/file-attachment/file-item.mjs +2 -0
  19. package/esm2020/lib/modules/file-attachment/file-item.service.mjs +72 -0
  20. package/esm2020/lib/modules/file-attachment/file-link.mjs +2 -0
  21. package/esm2020/lib/modules/file-attachment/file-size.pipe.mjs +60 -0
  22. package/esm2020/lib/modules/file-attachment/types/file-attachment-change.mjs +2 -0
  23. package/esm2020/lib/modules/file-attachment/types/file-attachment-click.mjs +2 -0
  24. package/esm2020/lib/modules/file-attachment/types/file-drop-change.mjs +2 -0
  25. package/esm2020/lib/modules/input-box/input-box-adapter.service.mjs +35 -0
  26. package/esm2020/lib/modules/input-box/input-box-host.service.mjs +19 -0
  27. package/esm2020/lib/modules/input-box/input-box-populate-args.mjs +2 -0
  28. package/esm2020/lib/modules/input-box/input-box.component.mjs +89 -0
  29. package/esm2020/lib/modules/input-box/input-box.module.mjs +19 -0
  30. package/esm2020/lib/modules/radio/radio-group.component.mjs +220 -0
  31. package/esm2020/lib/modules/radio/radio-label.component.mjs +23 -0
  32. package/esm2020/lib/modules/radio/radio.component.mjs +256 -0
  33. package/esm2020/lib/modules/radio/radio.module.mjs +28 -0
  34. package/esm2020/lib/modules/radio/types/radio-change.mjs +2 -0
  35. package/esm2020/lib/modules/selection-box/selection-box-adapter.service.mjs +124 -0
  36. package/esm2020/lib/modules/selection-box/selection-box-description.component.mjs +14 -0
  37. package/esm2020/lib/modules/selection-box/selection-box-grid.component.mjs +126 -0
  38. package/esm2020/lib/modules/selection-box/selection-box-header.component.mjs +14 -0
  39. package/esm2020/lib/modules/selection-box/selection-box.component.mjs +101 -0
  40. package/esm2020/lib/modules/selection-box/selection-box.module.mjs +40 -0
  41. package/esm2020/lib/modules/selection-box/types/selection-box-grid-align-items-type.mjs +2 -0
  42. package/esm2020/lib/modules/selection-box/types/selection-box-grid-align-items.mjs +2 -0
  43. package/esm2020/lib/modules/shared/forms-utility.mjs +26 -0
  44. package/esm2020/lib/modules/shared/sky-forms-resources.module.mjs +89 -0
  45. package/esm2020/lib/modules/toggle-switch/toggle-switch-label.component.mjs +14 -0
  46. package/esm2020/lib/modules/toggle-switch/toggle-switch.component.mjs +153 -0
  47. package/esm2020/lib/modules/toggle-switch/toggle-switch.module.mjs +20 -0
  48. package/esm2020/lib/modules/toggle-switch/types/toggle-switch-change.mjs +2 -0
  49. package/esm2020/skyux-forms.mjs +5 -0
  50. package/esm2020/testing/checkbox-fixture.mjs +88 -0
  51. package/esm2020/testing/public-api.mjs +2 -0
  52. package/esm2020/testing/skyux-forms-testing.mjs +5 -0
  53. package/fesm2015/{skyux-forms-testing.js → skyux-forms-testing.mjs} +1 -1
  54. package/fesm2015/skyux-forms-testing.mjs.map +1 -0
  55. package/fesm2015/skyux-forms.mjs +2691 -0
  56. package/fesm2015/skyux-forms.mjs.map +1 -0
  57. package/{esm2015/testing/checkbox-fixture.js → fesm2020/skyux-forms-testing.mjs} +9 -2
  58. package/fesm2020/skyux-forms-testing.mjs.map +1 -0
  59. package/fesm2020/skyux-forms.mjs +2685 -0
  60. package/fesm2020/skyux-forms.mjs.map +1 -0
  61. package/package.json +40 -16
  62. package/testing/package.json +5 -5
  63. package/bundles/skyux-forms-testing.umd.js +0 -123
  64. package/bundles/skyux-forms.umd.js +0 -3422
  65. package/esm2015/index.js +0 -43
  66. package/esm2015/index.js.map +0 -1
  67. package/esm2015/lib/modules/character-counter/character-counter-indicator.component.js +0 -37
  68. package/esm2015/lib/modules/character-counter/character-counter-indicator.component.js.map +0 -1
  69. package/esm2015/lib/modules/character-counter/character-counter.directive.js +0 -84
  70. package/esm2015/lib/modules/character-counter/character-counter.directive.js.map +0 -1
  71. package/esm2015/lib/modules/character-counter/character-counter.module.js +0 -46
  72. package/esm2015/lib/modules/character-counter/character-counter.module.js.map +0 -1
  73. package/esm2015/lib/modules/checkbox/checkbox-change.js +0 -6
  74. package/esm2015/lib/modules/checkbox/checkbox-change.js.map +0 -1
  75. package/esm2015/lib/modules/checkbox/checkbox-label.component.js +0 -17
  76. package/esm2015/lib/modules/checkbox/checkbox-label.component.js.map +0 -1
  77. package/esm2015/lib/modules/checkbox/checkbox-required-validator.directive.js +0 -32
  78. package/esm2015/lib/modules/checkbox/checkbox-required-validator.directive.js.map +0 -1
  79. package/esm2015/lib/modules/checkbox/checkbox.component.js +0 -241
  80. package/esm2015/lib/modules/checkbox/checkbox.component.js.map +0 -1
  81. package/esm2015/lib/modules/checkbox/checkbox.module.js +0 -34
  82. package/esm2015/lib/modules/checkbox/checkbox.module.js.map +0 -1
  83. package/esm2015/lib/modules/file-attachment/file-attachment-label.component.js +0 -19
  84. package/esm2015/lib/modules/file-attachment/file-attachment-label.component.js.map +0 -1
  85. package/esm2015/lib/modules/file-attachment/file-attachment.component.js +0 -331
  86. package/esm2015/lib/modules/file-attachment/file-attachment.component.js.map +0 -1
  87. package/esm2015/lib/modules/file-attachment/file-attachment.service.js +0 -94
  88. package/esm2015/lib/modules/file-attachment/file-attachment.service.js.map +0 -1
  89. package/esm2015/lib/modules/file-attachment/file-attachments.module.js +0 -68
  90. package/esm2015/lib/modules/file-attachment/file-attachments.module.js.map +0 -1
  91. package/esm2015/lib/modules/file-attachment/file-drop.component.js +0 -222
  92. package/esm2015/lib/modules/file-attachment/file-drop.component.js.map +0 -1
  93. package/esm2015/lib/modules/file-attachment/file-item-error-type.js +0 -2
  94. package/esm2015/lib/modules/file-attachment/file-item-error-type.js.map +0 -1
  95. package/esm2015/lib/modules/file-attachment/file-item.component.js +0 -116
  96. package/esm2015/lib/modules/file-attachment/file-item.component.js.map +0 -1
  97. package/esm2015/lib/modules/file-attachment/file-item.js +0 -2
  98. package/esm2015/lib/modules/file-attachment/file-item.js.map +0 -1
  99. package/esm2015/lib/modules/file-attachment/file-item.service.js +0 -72
  100. package/esm2015/lib/modules/file-attachment/file-item.service.js.map +0 -1
  101. package/esm2015/lib/modules/file-attachment/file-link.js +0 -2
  102. package/esm2015/lib/modules/file-attachment/file-link.js.map +0 -1
  103. package/esm2015/lib/modules/file-attachment/file-size.pipe.js +0 -60
  104. package/esm2015/lib/modules/file-attachment/file-size.pipe.js.map +0 -1
  105. package/esm2015/lib/modules/file-attachment/types/file-attachment-change.js +0 -2
  106. package/esm2015/lib/modules/file-attachment/types/file-attachment-change.js.map +0 -1
  107. package/esm2015/lib/modules/file-attachment/types/file-attachment-click.js +0 -2
  108. package/esm2015/lib/modules/file-attachment/types/file-attachment-click.js.map +0 -1
  109. package/esm2015/lib/modules/file-attachment/types/file-drop-change.js +0 -2
  110. package/esm2015/lib/modules/file-attachment/types/file-drop-change.js.map +0 -1
  111. package/esm2015/lib/modules/input-box/input-box-adapter.service.js +0 -35
  112. package/esm2015/lib/modules/input-box/input-box-adapter.service.js.map +0 -1
  113. package/esm2015/lib/modules/input-box/input-box-host.service.js +0 -19
  114. package/esm2015/lib/modules/input-box/input-box-host.service.js.map +0 -1
  115. package/esm2015/lib/modules/input-box/input-box-populate-args.js +0 -2
  116. package/esm2015/lib/modules/input-box/input-box-populate-args.js.map +0 -1
  117. package/esm2015/lib/modules/input-box/input-box.component.js +0 -97
  118. package/esm2015/lib/modules/input-box/input-box.component.js.map +0 -1
  119. package/esm2015/lib/modules/input-box/input-box.module.js +0 -19
  120. package/esm2015/lib/modules/input-box/input-box.module.js.map +0 -1
  121. package/esm2015/lib/modules/radio/radio-group.component.js +0 -223
  122. package/esm2015/lib/modules/radio/radio-group.component.js.map +0 -1
  123. package/esm2015/lib/modules/radio/radio-label.component.js +0 -26
  124. package/esm2015/lib/modules/radio/radio-label.component.js.map +0 -1
  125. package/esm2015/lib/modules/radio/radio.component.js +0 -262
  126. package/esm2015/lib/modules/radio/radio.component.js.map +0 -1
  127. package/esm2015/lib/modules/radio/radio.module.js +0 -28
  128. package/esm2015/lib/modules/radio/radio.module.js.map +0 -1
  129. package/esm2015/lib/modules/radio/types/radio-change.js +0 -2
  130. package/esm2015/lib/modules/radio/types/radio-change.js.map +0 -1
  131. package/esm2015/lib/modules/selection-box/selection-box-adapter.service.js +0 -124
  132. package/esm2015/lib/modules/selection-box/selection-box-adapter.service.js.map +0 -1
  133. package/esm2015/lib/modules/selection-box/selection-box-description.component.js +0 -17
  134. package/esm2015/lib/modules/selection-box/selection-box-description.component.js.map +0 -1
  135. package/esm2015/lib/modules/selection-box/selection-box-grid.component.js +0 -132
  136. package/esm2015/lib/modules/selection-box/selection-box-grid.component.js.map +0 -1
  137. package/esm2015/lib/modules/selection-box/selection-box-header.component.js +0 -17
  138. package/esm2015/lib/modules/selection-box/selection-box-header.component.js.map +0 -1
  139. package/esm2015/lib/modules/selection-box/selection-box.component.js +0 -107
  140. package/esm2015/lib/modules/selection-box/selection-box.component.js.map +0 -1
  141. package/esm2015/lib/modules/selection-box/selection-box.module.js +0 -40
  142. package/esm2015/lib/modules/selection-box/selection-box.module.js.map +0 -1
  143. package/esm2015/lib/modules/selection-box/types/selection-box-grid-align-items-type.js +0 -2
  144. package/esm2015/lib/modules/selection-box/types/selection-box-grid-align-items-type.js.map +0 -1
  145. package/esm2015/lib/modules/selection-box/types/selection-box-grid-align-items.js +0 -2
  146. package/esm2015/lib/modules/selection-box/types/selection-box-grid-align-items.js.map +0 -1
  147. package/esm2015/lib/modules/shared/forms-utility.js +0 -26
  148. package/esm2015/lib/modules/shared/forms-utility.js.map +0 -1
  149. package/esm2015/lib/modules/shared/sky-forms-resources.module.js +0 -89
  150. package/esm2015/lib/modules/shared/sky-forms-resources.module.js.map +0 -1
  151. package/esm2015/lib/modules/toggle-switch/toggle-switch-label.component.js +0 -18
  152. package/esm2015/lib/modules/toggle-switch/toggle-switch-label.component.js.map +0 -1
  153. package/esm2015/lib/modules/toggle-switch/toggle-switch.component.js +0 -159
  154. package/esm2015/lib/modules/toggle-switch/toggle-switch.component.js.map +0 -1
  155. package/esm2015/lib/modules/toggle-switch/toggle-switch.module.js +0 -20
  156. package/esm2015/lib/modules/toggle-switch/toggle-switch.module.js.map +0 -1
  157. package/esm2015/lib/modules/toggle-switch/types/toggle-switch-change.js +0 -2
  158. package/esm2015/lib/modules/toggle-switch/types/toggle-switch-change.js.map +0 -1
  159. package/esm2015/skyux-forms.js +0 -5
  160. package/esm2015/skyux-forms.js.map +0 -1
  161. package/esm2015/testing/checkbox-fixture.js.map +0 -1
  162. package/esm2015/testing/public-api.js +0 -2
  163. package/esm2015/testing/public-api.js.map +0 -1
  164. package/esm2015/testing/skyux-forms-testing.js +0 -5
  165. package/esm2015/testing/skyux-forms-testing.js.map +0 -1
  166. package/fesm2015/skyux-forms-testing.js.map +0 -1
  167. package/fesm2015/skyux-forms.js +0 -2765
  168. package/fesm2015/skyux-forms.js.map +0 -1
@@ -1,262 +0,0 @@
1
- import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output, forwardRef, } from '@angular/core';
2
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
3
- import { BehaviorSubject, Observable, Subject } from 'rxjs';
4
- import { SkyFormsUtility } from '../shared/forms-utility';
5
- import * as i0 from "@angular/core";
6
- import * as i1 from "@skyux/indicators";
7
- import * as i2 from "@angular/common";
8
- /**
9
- * Auto-incrementing integer that generates unique IDs for radio components.
10
- */
11
- let nextUniqueId = 0;
12
- /**
13
- * Provider Expression that allows sky-radio to register as a ControlValueAccessor.
14
- * This allows it to support [(ngModel)].
15
- */
16
- // tslint:disable:no-forward-ref no-use-before-declare
17
- const SKY_RADIO_CONTROL_VALUE_ACCESSOR = {
18
- provide: NG_VALUE_ACCESSOR,
19
- useExisting: forwardRef(() => SkyRadioComponent),
20
- multi: true,
21
- };
22
- // tslint:enable
23
- /**
24
- * Renders a SKY UX-themed replacement for an HTML `input` element
25
- * with `type="radio"`. When users select a radio button, its value is driven through an
26
- * `ngModel` attribute that you specify on the `sky-radio` element or the parent `sky-radio-group` element.
27
- */
28
- export class SkyRadioComponent {
29
- constructor(changeDetector) {
30
- this.changeDetector = changeDetector;
31
- /**
32
- * Fires when users focus off a radio button.
33
- */
34
- this.blur = new Subject();
35
- /**
36
- * Specifies an ID for the radio button.
37
- * @default a unique, auto-incrementing integer. For example: `sky-radio-1`
38
- */
39
- this.id = `sky-radio-${++nextUniqueId}`;
40
- this._change = new EventEmitter();
41
- this._checked = false;
42
- this._checkedChange = new BehaviorSubject(this._checked);
43
- this._disabled = false;
44
- this._disabledChange = new BehaviorSubject(this._disabled);
45
- // eslint-disable-next-line @typescript-eslint/no-empty-function
46
- this.removeUniqueSelectionListener = () => { };
47
- // eslint-disable-next-line @typescript-eslint/no-empty-function
48
- this.onChangeCallback = (value) => { };
49
- // eslint-disable-next-line @typescript-eslint/no-empty-function
50
- this.onTouchedCallback = () => { };
51
- }
52
- /**
53
- * Indicates whether the radio button is selected.
54
- * @default false
55
- */
56
- set checked(value) {
57
- const newCheckedState = !!value;
58
- if (this._checked !== newCheckedState) {
59
- this._checked = newCheckedState;
60
- this._checkedChange.next(this._checked);
61
- if (newCheckedState) {
62
- this.selectedValue = this.value;
63
- }
64
- }
65
- this.changeDetector.markForCheck();
66
- }
67
- get checked() {
68
- return this._checked;
69
- }
70
- /**
71
- * Indicates whether to disable the input.
72
- * @default false
73
- */
74
- set disabled(value) {
75
- const coercedValue = SkyFormsUtility.coerceBooleanProperty(value);
76
- if (coercedValue !== this.disabled) {
77
- this._disabled = coercedValue;
78
- this._disabledChange.next(this._disabled);
79
- this.changeDetector.markForCheck();
80
- }
81
- }
82
- get disabled() {
83
- return this._disabled;
84
- }
85
- /**
86
- * This property is deprecated in favor of the `name` property on the `sky-radio-group element`.
87
- * We recommend using the `sky-radio-group` element with all radio buttons, but if you opt not to,
88
- * then this property specifies a name for a group of radio buttons.
89
- * @deprecated
90
- */
91
- set name(value) {
92
- this._name = value;
93
- this.changeDetector.markForCheck();
94
- }
95
- get name() {
96
- return this._name;
97
- }
98
- /**
99
- * This property is deprecated in favor of
100
- * the `tabIndex` property on the `sky-radio-group` element. It specifies an index for the radio
101
- * button. If the index is not defined, it is set to the position of the radio button on load.
102
- * @deprecated
103
- */
104
- set tabindex(value) {
105
- console.warn('The sky-radio `tabindex` property is deprecated. Please use the `tabindex` property on the sky-radio-group component.');
106
- this._tabindex = value;
107
- this.changeDetector.markForCheck();
108
- }
109
- get tabindex() {
110
- return this._tabindex || 0;
111
- }
112
- // For setting the tabindex from the radio group
113
- set groupTabIndex(value) {
114
- this._tabindex = value;
115
- this.changeDetector.markForCheck();
116
- }
117
- /**
118
- * Specifies and binds a value to the radio button's `value` property. The value usually
119
- * corresponds to the radio button's label, which you specify with the `sky-radio-label`
120
- * component.
121
- * @required
122
- */
123
- set value(value) {
124
- /* istanbul ignore else */
125
- if (this._value !== value) {
126
- if (this.selectedValue && this.selectedValue === this._value) {
127
- this.selectedValue = value;
128
- this.onChangeCallback(this.selectedValue);
129
- this.onTouchedCallback();
130
- }
131
- this._value = value;
132
- }
133
- this.changeDetector.markForCheck();
134
- }
135
- get value() {
136
- return this._value;
137
- }
138
- /**
139
- * Specifies a type to set the background color after users select an icon radio button.
140
- * The valid options correspond
141
- * [the label component's](https://developer.blackbaud.com/skyux/components/label)
142
- * label types. `danger` creates a red background, `info` creates a blue background,
143
- * `success` creates a green background, and `warning` creates an orange background.
144
- * @default "info"
145
- */
146
- get radioType() {
147
- return this._radioType || 'info';
148
- }
149
- set radioType(value) {
150
- if (value) {
151
- this._radioType = value.toLowerCase();
152
- }
153
- }
154
- /**
155
- * Fires when users select a radio button.
156
- */
157
- get change() {
158
- return this._change;
159
- }
160
- /**
161
- * Fires when the selected value changes.
162
- */
163
- get checkedChange() {
164
- return this._checkedChange;
165
- }
166
- /**
167
- * Fires when the selected value changes.
168
- */
169
- get disabledChange() {
170
- return this._disabledChange;
171
- }
172
- get inputId() {
173
- return `sky-radio-${this.id}-input`;
174
- }
175
- set selectedValue(value) {
176
- if (value !== this._selectedValue) {
177
- this._selectedValue = value;
178
- }
179
- }
180
- get selectedValue() {
181
- return this._selectedValue;
182
- }
183
- ngOnDestroy() {
184
- this.removeUniqueSelectionListener();
185
- }
186
- writeValue(value) {
187
- if (value === undefined) {
188
- return;
189
- }
190
- this.selectedValue = value;
191
- this.checked = this.value === this.selectedValue;
192
- this.changeDetector.markForCheck();
193
- }
194
- /**
195
- * @internal
196
- * Indicates whether to disable the control. Implemented as a part of ControlValueAccessor.
197
- */
198
- setDisabledState(isDisabled) {
199
- this.disabled = isDisabled;
200
- }
201
- registerOnChange(fn) {
202
- this.onChangeCallback = fn;
203
- }
204
- registerOnTouched(fn) {
205
- this.onTouchedCallback = fn;
206
- }
207
- onInputChange(event) {
208
- event.stopPropagation();
209
- if (!this.disabled) {
210
- this.checked = true;
211
- this._change.emit({
212
- source: this,
213
- value: this._value,
214
- });
215
- this.onInputFocusChange(undefined);
216
- this.onChangeCallback(this.value);
217
- }
218
- }
219
- onInputFocusChange(event) {
220
- this.onTouchedCallback();
221
- this.blur.next();
222
- }
223
- }
224
- SkyRadioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRadioComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
225
- SkyRadioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyRadioComponent, selector: "sky-radio", inputs: { checked: "checked", disabled: "disabled", id: "id", label: "label", labelledBy: "labelledBy", name: "name", tabindex: "tabindex", value: "value", icon: "icon", radioType: "radioType" }, outputs: { change: "change", checkedChange: "checkedChange", disabledChange: "disabledChange" }, providers: [SKY_RADIO_CONTROL_VALUE_ACCESSOR], ngImport: i0, template: "<label\n class=\"sky-radio-wrapper sky-switch\"\n [ngClass]=\"{ 'sky-switch-disabled': disabled }\"\n>\n <input\n class=\"sky-radio-input sky-switch-input\"\n type=\"radio\"\n [attr.aria-label]=\"label\"\n [attr.aria-labelledby]=\"labelledBy\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [id]=\"inputId\"\n [name]=\"name\"\n [tabIndex]=\"tabindex\"\n [value]=\"value\"\n (blur)=\"onInputFocusChange($event)\"\n (change)=\"onInputChange($event)\"\n />\n <span\n class=\"sky-switch-control\"\n [ngClass]=\"{\n 'sky-switch-control-icon': icon,\n 'sky-rounded-corners': icon,\n 'sky-rounded-circle': !icon,\n 'sky-switch-control-info': icon && radioType === 'info',\n 'sky-switch-control-success': icon && radioType === 'success',\n 'sky-switch-control-warning': icon && radioType === 'warning',\n 'sky-switch-control-danger': icon && radioType === 'danger'\n }\"\n >\n <sky-icon *ngIf=\"icon\" fixedWidth=\"true\" [icon]=\"icon\"> </sky-icon>\n </span>\n <ng-content select=\"sky-radio-label\"></ng-content>\n</label>\n", styles: [".sky-switch-control:not(.sky-switch-control-icon) sky-icon{font-size:70%}.sky-switch-input:checked+.sky-switch-control:not(.sky-switch-control-icon):after{content:\"\";display:inline-block;width:10px;height:10px;background:#000000;border-radius:50%}:host-context(.sky-theme-modern) .sky-switch-input:checked+.sky-switch-control:not(.sky-switch-control-icon):after{background:#1870B8}:host-context(.sky-theme-modern) .sky-radio-input:disabled+.sky-switch-control .sky-radio-icon-modern-checked{background-color:#212327}.sky-theme-modern .sky-switch-input:checked+.sky-switch-control:not(.sky-switch-control-icon):after{background:#1870B8}.sky-theme-modern .sky-radio-input:disabled+.sky-switch-control .sky-radio-icon-modern-checked{background-color:#212327}\n"], components: [{ type: i1.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
226
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRadioComponent, decorators: [{
227
- type: Component,
228
- args: [{
229
- selector: 'sky-radio',
230
- templateUrl: './radio.component.html',
231
- styleUrls: ['./radio.component.scss'],
232
- providers: [SKY_RADIO_CONTROL_VALUE_ACCESSOR],
233
- changeDetection: ChangeDetectionStrategy.OnPush,
234
- }]
235
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { checked: [{
236
- type: Input
237
- }], disabled: [{
238
- type: Input
239
- }], id: [{
240
- type: Input
241
- }], label: [{
242
- type: Input
243
- }], labelledBy: [{
244
- type: Input
245
- }], name: [{
246
- type: Input
247
- }], tabindex: [{
248
- type: Input
249
- }], value: [{
250
- type: Input
251
- }], icon: [{
252
- type: Input
253
- }], radioType: [{
254
- type: Input
255
- }], change: [{
256
- type: Output
257
- }], checkedChange: [{
258
- type: Output
259
- }], disabledChange: [{
260
- type: Output
261
- }] } });
262
- //# sourceMappingURL=radio.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"radio.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/radio/radio.component.ts","../../../../../../../../libs/components/forms/src/lib/modules/radio/radio.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,KAAK,EAEL,MAAM,EAEN,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAwB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;;;;AAI1D;;GAEG;AACH,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;GAGG;AACH,sDAAsD;AACtD,MAAM,gCAAgC,GAAa;IACjD,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC;IAChD,KAAK,EAAE,IAAI;CACZ,CAAC;AACF,gBAAgB;AAEhB;;;;GAIG;AAQH,MAAM,OAAO,iBAAiB;IAsN5B,YAAoB,cAAiC;QAAjC,mBAAc,GAAd,cAAc,CAAmB;QArNrD;;WAEG;QACI,SAAI,GAAG,IAAI,OAAO,EAAQ,CAAC;QA4ClC;;;WAGG;QAEI,OAAE,GAAG,aAAa,EAAE,YAAY,EAAE,CAAC;QAsJlC,YAAO,GAAG,IAAI,YAAY,EAAkB,CAAC;QAC7C,aAAQ,GAAG,KAAK,CAAC;QACjB,mBAAc,GAAG,IAAI,eAAe,CAAU,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7D,cAAS,GAAG,KAAK,CAAC;QAClB,oBAAe,GAAG,IAAI,eAAe,CAAU,IAAI,CAAC,SAAS,CAAC,CAAC;QA4DvE,gEAAgE;QACxD,kC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IAAI,CAAC;YACpB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;gBAChB,MAAM,EAAE,IAAI;gBACZ,KAAK,EAAE,IAAI,CAAC,MAAM;aACnB,CAAC,CAAC;YAEH,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;YACnC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACnC;IACH,CAAC;IAEM,kBAAkB,CAAC,KAAY;QACpC,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACnB,CAAC;;+GAzQU,iBAAiB;mGAAjB,iBAAiB,yUAHjB,CAAC,gCAAgC,CAAC,0BC7C/C,6lCAkCA;4FDca,iBAAiB;kBAP7B,SAAS;mBAAC;oBACT,QAAQ,EAAE,WAAW;oBACrB,WAAW,EAAE,wBAAwB;oBACrC,SAAS,EAAE,CAAC,wBAAwB,CAAC;oBACrC,SAAS,EAAE,CAAC,gCAAgC,CAAC;oBAC7C,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;wGAYY,OAAO;sBADjB,KAAK;gBAyBK,QAAQ;sBADlB,KAAK;gBAmBC,EAAE;sBADR,KAAK;gBAUC,KAAK;sBADX,KAAK;gBAUC,UAAU;sBADhB,KAAK;gBAUK,IAAI;sBADd,KAAK;gBAiBK,QAAQ;sBADlB,KAAK;gBAyBK,KAAK;sBADf,KAAK;gBA0BC,IAAI;sBADV,KAAK;gBAYK,SAAS;sBADnB,KAAK;gBAeK,MAAM;sBAFhB,MAAM;gBAUI,aAAa;sBADvB,MAAM;gBASI,cAAc;sBADxB,MAAM","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n Provider,\n forwardRef,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\n\nimport { SkyFormsUtility } from '../shared/forms-utility';\n\nimport { SkyRadioChange } from './types/radio-change';\n\n/**\n * Auto-incrementing integer that generates unique IDs for radio components.\n */\nlet nextUniqueId = 0;\n\n/**\n * Provider Expression that allows sky-radio to register as a ControlValueAccessor.\n * This allows it to support [(ngModel)].\n */\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_RADIO_CONTROL_VALUE_ACCESSOR: Provider = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyRadioComponent),\n multi: true,\n};\n// tslint:enable\n\n/**\n * Renders a SKY UX-themed replacement for an HTML `input` element\n * with `type=\"radio\"`. When users select a radio button, its value is driven through an\n * `ngModel` attribute that you specify on the `sky-radio` element or the parent `sky-radio-group` element.\n */\n@Component({\n selector: 'sky-radio',\n templateUrl: './radio.component.html',\n styleUrls: ['./radio.component.scss'],\n providers: [SKY_RADIO_CONTROL_VALUE_ACCESSOR],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyRadioComponent implements OnDestroy, ControlValueAccessor {\n /**\n * Fires when users focus off a radio button.\n */\n public blur = new Subject<void>();\n\n /**\n * Indicates whether the radio button is selected.\n * @default false\n */\n @Input()\n public set checked(value: boolean) {\n const newCheckedState = !!value;\n\n if (this._checked !== newCheckedState) {\n this._checked = newCheckedState;\n this._checkedChange.next(this._checked);\n\n if (newCheckedState) {\n this.selectedValue = this.value;\n }\n }\n\n this.changeDetector.markForCheck();\n }\n\n public get checked(): boolean {\n return this._checked;\n }\n\n /**\n * Indicates whether to disable the input.\n * @default false\n */\n @Input()\n public set disabled(value: boolean) {\n const coercedValue = SkyFormsUtility.coerceBooleanProperty(value);\n if (coercedValue !== this.disabled) {\n this._disabled = coercedValue;\n this._disabledChange.next(this._disabled);\n this.changeDetector.markForCheck();\n }\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n /**\n * Specifies an ID for the radio button.\n * @default a unique, auto-incrementing integer. For example: `sky-radio-1`\n */\n @Input()\n public id = `sky-radio-${++nextUniqueId}`;\n\n /**\n * Specifies an ARIA label for the radio button. This sets the radio button's `aria-label`\n * attribute [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility)\n * when the radio button does not include a visible label. You must set this property for icon\n * radio buttons. If the radio button includes a visible label, use `labelledBy` instead.\n */\n @Input()\n public label: string;\n\n /**\n * Specifies the HTML element ID (without the leading `#`) of the element that labels\n * the radio button. This sets the radio button's `aria-labelledby` attribute\n * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).\n * If the radio button does not include a visible label, use `label` instead.\n */\n @Input()\n public labelledBy: string;\n\n /**\n * This property is deprecated in favor of the `name` property on the `sky-radio-group element`.\n * We recommend using the `sky-radio-group` element with all radio buttons, but if you opt not to,\n * then this property specifies a name for a group of radio buttons.\n * @deprecated\n */\n @Input()\n public set name(value: string) {\n this._name = value;\n this.changeDetector.markForCheck();\n }\n\n public get name(): string {\n return this._name;\n }\n\n /**\n * This property is deprecated in favor of\n * the `tabIndex` property on the `sky-radio-group` element. It specifies an index for the radio\n * button. If the index is not defined, it is set to the position of the radio button on load.\n * @deprecated\n */\n @Input()\n public set tabindex(value: number) {\n console.warn(\n 'The sky-radio `tabindex` property is deprecated. Please use the `tabindex` property on the sky-radio-group component.'\n );\n this._tabindex = value;\n this.changeDetector.markForCheck();\n }\n public get tabindex(): number {\n return this._tabindex || 0;\n }\n\n // For setting the tabindex from the radio group\n public set groupTabIndex(value: number) {\n this._tabindex = value;\n this.changeDetector.markForCheck();\n }\n\n /**\n * Specifies and binds a value to the radio button's `value` property. The value usually\n * corresponds to the radio button's label, which you specify with the `sky-radio-label`\n * component.\n * @required\n */\n @Input()\n public set value(value: any) {\n /* istanbul ignore else */\n if (this._value !== value) {\n if (this.selectedValue && this.selectedValue === this._value) {\n this.selectedValue = value;\n this.onChangeCallback(this.selectedValue);\n this.onTouchedCallback();\n }\n\n this._value = value;\n }\n\n this.changeDetector.markForCheck();\n }\n\n public get value(): any {\n return this._value;\n }\n\n /**\n * Specifies an icon to display in place of the radio button. To group radio buttons like in\n * the demo above, place the `sky-switch-icon-group` class on the direct parent element of the\n * radio buttons.\n */\n @Input()\n public icon: string;\n\n /**\n * Specifies a type to set the background color after users select an icon radio button.\n * The valid options correspond\n * [the label component's](https://developer.blackbaud.com/skyux/components/label)\n * label types. `danger` creates a red background, `info` creates a blue background,\n * `success` creates a green background, and `warning` creates an orange background.\n * @default \"info\"\n */\n @Input()\n public get radioType(): string {\n return this._radioType || 'info';\n }\n public set radioType(value: string) {\n if (value) {\n this._radioType = value.toLowerCase();\n }\n }\n\n /**\n * Fires when users select a radio button.\n */\n @Output()\n // eslint-disable-next-line @angular-eslint/no-output-native\n public get change(): Observable<SkyRadioChange> {\n return this._change;\n }\n\n /**\n * Fires when the selected value changes.\n */\n @Output()\n public get checkedChange(): Observable<boolean> {\n return this._checkedChange;\n }\n\n /**\n * Fires when the selected value changes.\n */\n @Output()\n public get disabledChange(): Observable<boolean> {\n return this._disabledChange;\n }\n\n public get inputId(): string {\n return `sky-radio-${this.id}-input`;\n }\n\n public set selectedValue(value: any) {\n if (value !== this._selectedValue) {\n this._selectedValue = value;\n }\n }\n public get selectedValue(): any {\n return this._selectedValue;\n }\n\n private _change = new EventEmitter<SkyRadioChange>();\n private _checked = false;\n private _checkedChange = new BehaviorSubject<boolean>(this._checked);\n private _disabled = false;\n private _disabledChange = new BehaviorSubject<boolean>(this._disabled);\n private _name: string;\n private _radioType: string;\n private _selectedValue: any;\n private _tabindex: number;\n private _value: any;\n\n constructor(private changeDetector: ChangeDetectorRef) {}\n\n public ngOnDestroy(): void {\n this.removeUniqueSelectionListener();\n }\n\n public writeValue(value: any): void {\n if (value === undefined) {\n return;\n }\n\n this.selectedValue = value;\n this.checked = this.value === this.selectedValue;\n\n this.changeDetector.markForCheck();\n }\n\n /**\n * @internal\n * Indicates whether to disable the control. Implemented as a part of ControlValueAccessor.\n */\n public setDisabledState(isDisabled: boolean) {\n this.disabled = isDisabled;\n }\n\n public registerOnChange(fn: any): void {\n this.onChangeCallback = fn;\n }\n\n public registerOnTouched(fn: any): void {\n this.onTouchedCallback = fn;\n }\n\n public onInputChange(event: Event): void {\n event.stopPropagation();\n\n if (!this.disabled) {\n this.checked = true;\n this._change.emit({\n source: this,\n value: this._value,\n });\n\n this.onInputFocusChange(undefined);\n this.onChangeCallback(this.value);\n }\n }\n\n public onInputFocusChange(event: Event): void {\n this.onTouchedCallback();\n this.blur.next();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private removeUniqueSelectionListener = () => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onChangeCallback = (value: any) => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onTouchedCallback = () => {};\n}\n","<label\n class=\"sky-radio-wrapper sky-switch\"\n [ngClass]=\"{ 'sky-switch-disabled': disabled }\"\n>\n <input\n class=\"sky-radio-input sky-switch-input\"\n type=\"radio\"\n [attr.aria-label]=\"label\"\n [attr.aria-labelledby]=\"labelledBy\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [id]=\"inputId\"\n [name]=\"name\"\n [tabIndex]=\"tabindex\"\n [value]=\"value\"\n (blur)=\"onInputFocusChange($event)\"\n (change)=\"onInputChange($event)\"\n />\n <span\n class=\"sky-switch-control\"\n [ngClass]=\"{\n 'sky-switch-control-icon': icon,\n 'sky-rounded-corners': icon,\n 'sky-rounded-circle': !icon,\n 'sky-switch-control-info': icon && radioType === 'info',\n 'sky-switch-control-success': icon && radioType === 'success',\n 'sky-switch-control-warning': icon && radioType === 'warning',\n 'sky-switch-control-danger': icon && radioType === 'danger'\n }\"\n >\n <sky-icon *ngIf=\"icon\" fixedWidth=\"true\" [icon]=\"icon\"> </sky-icon>\n </span>\n <ng-content select=\"sky-radio-label\"></ng-content>\n</label>\n"]}
@@ -1,28 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { NgModule } from '@angular/core';
3
- import { FormsModule } from '@angular/forms';
4
- import { SkyIconModule } from '@skyux/indicators';
5
- import { SkyRadioGroupComponent } from './radio-group.component';
6
- import { SkyRadioLabelComponent } from './radio-label.component';
7
- import { SkyRadioComponent } from './radio.component';
8
- import * as i0 from "@angular/core";
9
- export class SkyRadioModule {
10
- }
11
- SkyRadioModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
12
- SkyRadioModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRadioModule, declarations: [SkyRadioComponent,
13
- SkyRadioGroupComponent,
14
- SkyRadioLabelComponent], imports: [CommonModule, FormsModule, SkyIconModule], exports: [SkyRadioComponent, SkyRadioGroupComponent, SkyRadioLabelComponent] });
15
- SkyRadioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRadioModule, imports: [[CommonModule, FormsModule, SkyIconModule]] });
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRadioModule, decorators: [{
17
- type: NgModule,
18
- args: [{
19
- declarations: [
20
- SkyRadioComponent,
21
- SkyRadioGroupComponent,
22
- SkyRadioLabelComponent,
23
- ],
24
- imports: [CommonModule, FormsModule, SkyIconModule],
25
- exports: [SkyRadioComponent, SkyRadioGroupComponent, SkyRadioLabelComponent],
26
- }]
27
- }] });
28
- //# sourceMappingURL=radio.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"radio.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/radio/radio.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;;AAWtD,MAAM,OAAO,cAAc;;4GAAd,cAAc;6GAAd,cAAc,iBAPvB,iBAAiB;QACjB,sBAAsB;QACtB,sBAAsB,aAEd,YAAY,EAAE,WAAW,EAAE,aAAa,aACxC,iBAAiB,EAAE,sBAAsB,EAAE,sBAAsB;6GAEhE,cAAc,YAHhB,CAAC,YAAY,EAAE,WAAW,EAAE,aAAa,CAAC;4FAGxC,cAAc;kBAT1B,QAAQ;mBAAC;oBACR,YAAY,EAAE;wBACZ,iBAAiB;wBACjB,sBAAsB;wBACtB,sBAAsB;qBACvB;oBACD,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,aAAa,CAAC;oBACnD,OAAO,EAAE,CAAC,iBAAiB,EAAE,sBAAsB,EAAE,sBAAsB,CAAC;iBAC7E","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { SkyIconModule } from '@skyux/indicators';\n\nimport { SkyRadioGroupComponent } from './radio-group.component';\nimport { SkyRadioLabelComponent } from './radio-label.component';\nimport { SkyRadioComponent } from './radio.component';\n\n@NgModule({\n declarations: [\n SkyRadioComponent,\n SkyRadioGroupComponent,\n SkyRadioLabelComponent,\n ],\n imports: [CommonModule, FormsModule, SkyIconModule],\n exports: [SkyRadioComponent, SkyRadioGroupComponent, SkyRadioLabelComponent],\n})\nexport class SkyRadioModule {}\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=radio-change.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"radio-change.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/forms/src/lib/modules/radio/types/radio-change.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyRadioComponent } from '../radio.component';\n\nexport interface SkyRadioChange {\n /**\n * Specifies the radio component that triggered the change event.\n * @internal\n */\n source: SkyRadioComponent;\n /**\n * Specifies the value from the radio component.\n */\n value: any;\n}\n"]}
@@ -1,124 +0,0 @@
1
- import { Injectable, RendererFactory2, } from '@angular/core';
2
- import { SkyCoreAdapterService, SkyMediaBreakpoints } from '@skyux/core';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "@skyux/core";
5
- const RESPONSIVE_CLASS_XS = 'sky-selection-box-container-xs';
6
- const RESPONSIVE_CLASS_SM = 'sky-selection-box-container-sm';
7
- const RESPONSIVE_CLASS_MD = 'sky-selection-box-container-md';
8
- const RESPONSIVE_CLASS_LG = 'sky-selection-box-container-lg';
9
- const BREAKPOINT_XS_MAX_PIXELS = 767;
10
- const BREAKPOINT_SM_MIN_PIXELS = 768;
11
- const BREAKPOINT_SM_MAX_PIXELS = 991;
12
- const BREAKPOINT_MD_MIN_PIXELS = 992;
13
- const BREAKPOINT_MD_MAX_PIXELS = 1439;
14
- /**
15
- * @internal
16
- */
17
- export class SkySelectionBoxAdapterService {
18
- constructor(coreAdapterService, rendererFactory) {
19
- this.coreAdapterService = coreAdapterService;
20
- this.renderer = rendererFactory.createRenderer(undefined, undefined);
21
- }
22
- /**
23
- * Sets focus on the specified element.
24
- */
25
- focus(el) {
26
- el.nativeElement.focus();
27
- }
28
- /**
29
- * Returns a child element with the `.sky-switch` class.
30
- * Useful for getting SKY UX-themed radio buttons or checkboxes.
31
- */
32
- getControl(el) {
33
- return el.nativeElement.querySelector('.sky-switch');
34
- }
35
- /**
36
- * Returns a breakpoint based on the width.
37
- * @param width Width of the element in pixels.
38
- */
39
- getBreakpointForWidth(width) {
40
- if (width <= BREAKPOINT_XS_MAX_PIXELS) {
41
- return SkyMediaBreakpoints.xs;
42
- }
43
- else if (width >= BREAKPOINT_SM_MIN_PIXELS &&
44
- width <= BREAKPOINT_SM_MAX_PIXELS) {
45
- return SkyMediaBreakpoints.sm;
46
- }
47
- else if (width >= BREAKPOINT_MD_MIN_PIXELS &&
48
- width <= BREAKPOINT_MD_MAX_PIXELS) {
49
- return SkyMediaBreakpoints.md;
50
- }
51
- else {
52
- return SkyMediaBreakpoints.lg;
53
- }
54
- }
55
- /**
56
- * Returns the width of the `parentNode` of the provided `element`.
57
- */
58
- getParentWidth(element) {
59
- return element.nativeElement.parentNode.getBoundingClientRect().width;
60
- }
61
- /**
62
- * Returns `true` if the `childEl` is a descendant of the `parentEl`.
63
- */
64
- isDescendant(parentEl, childEl) {
65
- return parentEl.nativeElement.contains(childEl);
66
- }
67
- /**
68
- * Sets the `tabIndex` of all focusable children of the `element` to the provided `tabIndex`.
69
- */
70
- setChildrenTabIndex(element, tabIndex) {
71
- const el = element.nativeElement;
72
- const focusableElems = this.coreAdapterService.getFocusableChildren(el, {
73
- ignoreVisibility: true,
74
- });
75
- let index = focusableElems.length;
76
- while (index--) {
77
- focusableElems[index].tabIndex = tabIndex;
78
- }
79
- }
80
- /**
81
- * Adds a responsive CSS class on the provided element based on its current width.
82
- */
83
- setResponsiveClass(element, breakpoint) {
84
- const nativeEl = element.nativeElement;
85
- this.renderer.removeClass(nativeEl, RESPONSIVE_CLASS_XS);
86
- this.renderer.removeClass(nativeEl, RESPONSIVE_CLASS_SM);
87
- this.renderer.removeClass(nativeEl, RESPONSIVE_CLASS_MD);
88
- this.renderer.removeClass(nativeEl, RESPONSIVE_CLASS_LG);
89
- let newClass;
90
- // tslint:disable-next-line: switch-default
91
- switch (breakpoint) {
92
- case SkyMediaBreakpoints.xs: {
93
- newClass = RESPONSIVE_CLASS_XS;
94
- break;
95
- }
96
- case SkyMediaBreakpoints.sm: {
97
- newClass = RESPONSIVE_CLASS_SM;
98
- break;
99
- }
100
- case SkyMediaBreakpoints.md: {
101
- newClass = RESPONSIVE_CLASS_MD;
102
- break;
103
- }
104
- case SkyMediaBreakpoints.lg: {
105
- newClass = RESPONSIVE_CLASS_LG;
106
- break;
107
- }
108
- }
109
- this.renderer.addClass(nativeEl, newClass);
110
- }
111
- /**
112
- * Sets the `tabIndex` of the `element` to the provided `tabIndex`.
113
- */
114
- setTabIndex(element, tabIndex) {
115
- const el = element.nativeElement;
116
- el.tabIndex = tabIndex;
117
- }
118
- }
119
- SkySelectionBoxAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxAdapterService, deps: [{ token: i1.SkyCoreAdapterService }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
120
- SkySelectionBoxAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxAdapterService });
121
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxAdapterService, decorators: [{
122
- type: Injectable
123
- }], ctorParameters: function () { return [{ type: i1.SkyCoreAdapterService }, { type: i0.RendererFactory2 }]; } });
124
- //# sourceMappingURL=selection-box-adapter.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selection-box-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/selection-box/selection-box-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEV,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;;;AAEzE,MAAM,mBAAmB,GAAG,gCAAgC,CAAC;AAC7D,MAAM,mBAAmB,GAAG,gCAAgC,CAAC;AAC7D,MAAM,mBAAmB,GAAG,gCAAgC,CAAC;AAC7D,MAAM,mBAAmB,GAAG,gCAAgC,CAAC;AAE7D,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC,MAAM,wBAAwB,GAAG,GAAG,CAA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,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,WAAW,CAAC,OAAmB,EAAE,QAAgB;QACtD,MAAM,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC;QACjC,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACzB,CAAC;;2HAxHU,6BAA6B;+HAA7B,6BAA6B;4FAA7B,6BAA6B;kBADzC,UAAU","sourcesContent":["import {\n ElementRef,\n Injectable,\n Renderer2,\n RendererFactory2,\n} from '@angular/core';\nimport { SkyCoreAdapterService, SkyMediaBreakpoints } from '@skyux/core';\n\nconst RESPONSIVE_CLASS_XS = 'sky-selection-box-container-xs';\nconst RESPONSIVE_CLASS_SM = 'sky-selection-box-container-sm';\nconst RESPONSIVE_CLASS_MD = 'sky-selection-box-container-md';\nconst RESPONSIVE_CLASS_LG = 'sky-selection-box-container-lg';\n\nconst BREAKPOINT_XS_MAX_PIXELS = 767;\nconst BREAKPOINT_SM_MIN_PIXELS = 768;\nconst BREAKPOINT_SM_MAX_PIXELS = 991;\nconst BREAKPOINT_MD_MIN_PIXELS = 992;\nconst BREAKPOINT_MD_MAX_PIXELS = 1439;\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkySelectionBoxAdapterService {\n private renderer: Renderer2;\n\n constructor(\n private coreAdapterService: SkyCoreAdapterService,\n rendererFactory: RendererFactory2\n ) {\n this.renderer = rendererFactory.createRenderer(undefined, undefined);\n }\n\n /**\n * Sets focus on the specified element.\n */\n public focus(el: ElementRef): void {\n el.nativeElement.focus();\n }\n\n /**\n * Returns a child element with the `.sky-switch` class.\n * Useful for getting SKY UX-themed radio buttons or checkboxes.\n */\n public getControl(el: ElementRef): HTMLElement {\n return el.nativeElement.querySelector('.sky-switch');\n }\n\n /**\n * Returns a breakpoint based on the width.\n * @param width Width of the element in pixels.\n */\n public getBreakpointForWidth(width: number): SkyMediaBreakpoints {\n if (width <= BREAKPOINT_XS_MAX_PIXELS) {\n return SkyMediaBreakpoints.xs;\n } else if (\n width >= BREAKPOINT_SM_MIN_PIXELS &&\n width <= BREAKPOINT_SM_MAX_PIXELS\n ) {\n return SkyMediaBreakpoints.sm;\n } else if (\n width >= BREAKPOINT_MD_MIN_PIXELS &&\n width <= BREAKPOINT_MD_MAX_PIXELS\n ) {\n return SkyMediaBreakpoints.md;\n } else {\n return SkyMediaBreakpoints.lg;\n }\n }\n\n /**\n * Returns the width of the `parentNode` of the provided `element`.\n */\n public getParentWidth(element: ElementRef): number {\n return element.nativeElement.parentNode.getBoundingClientRect().width;\n }\n\n /**\n * Returns `true` if the `childEl` is a descendant of the `parentEl`.\n */\n public isDescendant(parentEl: ElementRef, childEl: HTMLElement): boolean {\n return parentEl.nativeElement.contains(childEl);\n }\n\n /**\n * Sets the `tabIndex` of all focusable children of the `element` to the provided `tabIndex`.\n */\n public setChildrenTabIndex(element: ElementRef, tabIndex: number): void {\n const el = element.nativeElement;\n const focusableElems = this.coreAdapterService.getFocusableChildren(el, {\n ignoreVisibility: true,\n });\n let index = focusableElems.length;\n while (index--) {\n focusableElems[index].tabIndex = tabIndex;\n }\n }\n\n /**\n * Adds a responsive CSS class on the provided element based on its current width.\n */\n public setResponsiveClass(\n element: ElementRef,\n breakpoint: SkyMediaBreakpoints\n ): void {\n const nativeEl: HTMLElement = element.nativeElement;\n\n this.renderer.removeClass(nativeEl, RESPONSIVE_CLASS_XS);\n this.renderer.removeClass(nativeEl, RESPONSIVE_CLASS_SM);\n this.renderer.removeClass(nativeEl, RESPONSIVE_CLASS_MD);\n this.renderer.removeClass(nativeEl, RESPONSIVE_CLASS_LG);\n\n let newClass: string;\n\n // tslint:disable-next-line: switch-default\n switch (breakpoint) {\n case SkyMediaBreakpoints.xs: {\n newClass = RESPONSIVE_CLASS_XS;\n break;\n }\n case SkyMediaBreakpoints.sm: {\n newClass = RESPONSIVE_CLASS_SM;\n break;\n }\n case SkyMediaBreakpoints.md: {\n newClass = RESPONSIVE_CLASS_MD;\n break;\n }\n case SkyMediaBreakpoints.lg: {\n newClass = RESPONSIVE_CLASS_LG;\n break;\n }\n }\n\n this.renderer.addClass(nativeEl, newClass);\n }\n\n /**\n * Sets the `tabIndex` of the `element` to the provided `tabIndex`.\n */\n public setTabIndex(element: ElementRef, tabIndex: number): void {\n const el = element.nativeElement;\n el.tabIndex = tabIndex;\n }\n}\n"]}
@@ -1,17 +0,0 @@
1
- import { Component } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * Specifies the description to display in a selection box.
5
- */
6
- export class SkySelectionBoxDescriptionComponent {
7
- }
8
- SkySelectionBoxDescriptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxDescriptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
9
- SkySelectionBoxDescriptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkySelectionBoxDescriptionComponent, selector: "sky-selection-box-description", ngImport: i0, template: "<ng-content></ng-content>\n" });
10
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxDescriptionComponent, decorators: [{
11
- type: Component,
12
- args: [{
13
- selector: 'sky-selection-box-description',
14
- templateUrl: './selection-box-description.component.html',
15
- }]
16
- }] });
17
- //# sourceMappingURL=selection-box-description.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selection-box-description.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/selection-box/selection-box-description.component.ts","../../../../../../../../libs/components/forms/src/lib/modules/selection-box/selection-box-description.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;AAE1C;;GAEG;AAKH,MAAM,OAAO,mCAAmC;;iIAAnC,mCAAmC;qHAAnC,mCAAmC,qECThD,6BACA;4FDQa,mCAAmC;kBAJ/C,SAAS;mBAAC;oBACT,QAAQ,EAAE,+BAA+B;oBACzC,WAAW,EAAE,4CAA4C;iBAC1D","sourcesContent":["import { Component } from '@angular/core';\n\n/**\n * Specifies the description to display in a selection box.\n */\n@Component({\n selector: 'sky-selection-box-description',\n templateUrl: './selection-box-description.component.html',\n})\nexport class SkySelectionBoxDescriptionComponent {}\n","<ng-content></ng-content>\n"]}
@@ -1,132 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, ContentChildren, ElementRef, HostListener, Input, NgZone, QueryList, ViewChild, ViewEncapsulation, } from '@angular/core';
2
- import { MutationObserverService, SkyCoreAdapterService, } from '@skyux/core';
3
- import { SkyThemeService } from '@skyux/theme';
4
- import { Subject } from 'rxjs';
5
- import { takeUntil } from 'rxjs/operators';
6
- import { SkySelectionBoxAdapterService } from './selection-box-adapter.service';
7
- import { SkySelectionBoxComponent } from './selection-box.component';
8
- import * as i0 from "@angular/core";
9
- import * as i1 from "@skyux/theme";
10
- import * as i2 from "@skyux/core";
11
- import * as i3 from "./selection-box-adapter.service";
12
- import * as i4 from "@angular/common";
13
- const SKY_SELECTION_BOX_CLASS_NAME = '.sky-selection-box';
14
- /**
15
- * Creates a grid layout for an array of selection boxes.
16
- */
17
- export class SkySelectionBoxGridComponent {
18
- constructor(themeSvc, coreAdapterService, selectionBoxAdapter, hostElRef, mutationObserverSvc, ngZone) {
19
- this.themeSvc = themeSvc;
20
- this.coreAdapterService = coreAdapterService;
21
- this.selectionBoxAdapter = selectionBoxAdapter;
22
- this.hostElRef = hostElRef;
23
- this.mutationObserverSvc = mutationObserverSvc;
24
- this.ngZone = ngZone;
25
- this.ngUnsubscribe = new Subject();
26
- }
27
- /**
28
- * @internal
29
- * Specifies how to display the selection boxes in the grid.
30
- * @default 'center'
31
- */
32
- set alignItems(value) {
33
- this._alignItems = value;
34
- }
35
- get alignItems() {
36
- return this._alignItems || 'center';
37
- }
38
- set currentBreakpoint(value) {
39
- if (value !== this._currentBreakpoint) {
40
- this._currentBreakpoint = value;
41
- this.selectionBoxAdapter.setResponsiveClass(this.elementRef, value);
42
- this.updateChildrenHeights();
43
- }
44
- }
45
- ngOnInit() {
46
- /* istanbul ignore else */
47
- if (this.themeSvc) {
48
- this.themeSvc.settingsChange
49
- .pipe(takeUntil(this.ngUnsubscribe))
50
- .subscribe(() => {
51
- this.updateBreakpointClass();
52
- this.updateChildrenHeights();
53
- });
54
- }
55
- }
56
- ngAfterViewInit() {
57
- this.updateBreakpointClass();
58
- this.updateChildrenHeights();
59
- this.initMutationObserver();
60
- }
61
- ngOnDestroy() {
62
- this.ngUnsubscribe.next();
63
- this.ngUnsubscribe.complete();
64
- this.destroyMutationObserver();
65
- }
66
- onWindowResize() {
67
- this.updateBreakpointClass();
68
- }
69
- initMutationObserver() {
70
- /* istanbul ignore else */
71
- if (!this.mutationObserver) {
72
- const el = this.elementRef.nativeElement;
73
- // MutationObserver is patched by Zone.js and therefore becomes part of the
74
- // Angular change detection cycle, but this can lead to infinite loops in some
75
- // scenarios. This will keep MutationObserver from triggering change detection.
76
- this.ngZone.runOutsideAngular(() => {
77
- this.mutationObserver = this.mutationObserverSvc.create(() => {
78
- this.updateChildrenHeights();
79
- });
80
- this.mutationObserver.observe(el, {
81
- characterData: true,
82
- subtree: true,
83
- });
84
- });
85
- }
86
- }
87
- destroyMutationObserver() {
88
- /* istanbul ignore else */
89
- if (this.mutationObserver) {
90
- this.mutationObserver.disconnect();
91
- this.mutationObserver = undefined;
92
- }
93
- }
94
- updateBreakpointClass() {
95
- const parentWidth = this.selectionBoxAdapter.getParentWidth(this.hostElRef);
96
- this.currentBreakpoint =
97
- this.selectionBoxAdapter.getBreakpointForWidth(parentWidth);
98
- }
99
- updateChildrenHeights() {
100
- this.coreAdapterService.resetHeight(this.elementRef, SKY_SELECTION_BOX_CLASS_NAME);
101
- this.coreAdapterService.syncMaxHeight(this.elementRef, SKY_SELECTION_BOX_CLASS_NAME);
102
- }
103
- }
104
- SkySelectionBoxGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxGridComponent, deps: [{ token: i1.SkyThemeService }, { token: i2.SkyCoreAdapterService }, { token: i3.SkySelectionBoxAdapterService }, { token: i0.ElementRef }, { token: i2.MutationObserverService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
105
- SkySelectionBoxGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkySelectionBoxGridComponent, selector: "sky-selection-box-grid", inputs: { alignItems: "alignItems" }, host: { listeners: { "window:resize": "onWindowResize()" } }, queries: [{ propertyName: "selectionBoxes", predicate: SkySelectionBoxComponent, read: SkySelectionBoxComponent }], viewQueries: [{ propertyName: "elementRef", first: true, predicate: ["container"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<div\n class=\"sky-selection-box-grid\"\n [ngClass]=\"'sky-selection-box-grid-align-' + alignItems\"\n #container\n>\n <ng-content select=\"sky-selection-box\"></ng-content>\n</div>\n", styles: [":host{display:block}.sky-selection-box-grid{display:flex;flex-flow:row wrap;padding:0 7.5px;margin:0 auto}.sky-selection-box-grid.sky-selection-box-grid-align-center{justify-content:center}.sky-selection-box-grid.sky-selection-box-grid-align-left{justify-content:flex-start}.sky-selection-box-grid>sky-selection-box{margin:0 7.5px 15px;height:100%}.sky-selection-box-grid.sky-selection-box-container-xs{max-width:374px}.sky-selection-box-grid.sky-selection-box-container-xs>sky-selection-box{flex:0 1 344px}.sky-selection-box-grid.sky-selection-box-container-xs .sky-selection-box{padding:15px}.sky-selection-box-grid.sky-selection-box-container-xs .sky-selection-box .sky-selection-box-icon{display:none}.sky-selection-box-grid.sky-selection-box-container-xs .sky-selection-box .sky-selection-box-header{font-size:20px;font-weight:400}.sky-selection-box-grid.sky-selection-box-container-sm{max-width:733px}.sky-selection-box-grid.sky-selection-box-container-sm>sky-selection-box{flex:0 1 344px}.sky-selection-box-grid.sky-selection-box-container-sm .sky-selection-box{padding:15px}.sky-selection-box-grid.sky-selection-box-container-sm .sky-selection-box .sky-selection-box-icon{display:none}.sky-selection-box-grid.sky-selection-box-container-sm .sky-selection-box .sky-selection-box-header{font-size:20px;font-weight:400}.sky-selection-box-grid.sky-selection-box-container-md{max-width:937px}.sky-selection-box-grid.sky-selection-box-container-md>sky-selection-box{flex:0 1 446px}.sky-selection-box-grid.sky-selection-box-container-lg{max-width:1398px}.sky-selection-box-grid.sky-selection-box-container-lg>sky-selection-box{flex:0 1 446px}\n"], directives: [{ type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
106
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxGridComponent, decorators: [{
107
- type: Component,
108
- args: [{
109
- selector: 'sky-selection-box-grid',
110
- templateUrl: './selection-box-grid.component.html',
111
- styleUrls: ['./selection-box-grid.component.scss'],
112
- changeDetection: ChangeDetectionStrategy.OnPush,
113
- encapsulation: ViewEncapsulation.None,
114
- }]
115
- }], ctorParameters: function () { return [{ type: i1.SkyThemeService }, { type: i2.SkyCoreAdapterService }, { type: i3.SkySelectionBoxAdapterService }, { type: i0.ElementRef }, { type: i2.MutationObserverService }, { type: i0.NgZone }]; }, propDecorators: { alignItems: [{
116
- type: Input
117
- }], selectionBoxes: [{
118
- type: ContentChildren,
119
- args: [SkySelectionBoxComponent, {
120
- read: SkySelectionBoxComponent,
121
- }]
122
- }], elementRef: [{
123
- type: ViewChild,
124
- args: ['container', {
125
- read: ElementRef,
126
- static: true,
127
- }]
128
- }], onWindowResize: [{
129
- type: HostListener,
130
- args: ['window:resize']
131
- }] } });
132
- //# sourceMappingURL=selection-box-grid.component.js.map