carbon-components-angular 5.11.0 → 5.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/docs/documentation/components/TableHeadCheckbox.html +16 -56
  2. package/docs/documentation/components/Toggle.html +188 -197
  3. package/docs/documentation/coverage.html +4 -4
  4. package/docs/documentation/js/search/search_index.js +2 -2
  5. package/docs/documentation/modules/CodeSnippetModule/dependencies.svg +4 -4
  6. package/docs/documentation/modules/CodeSnippetModule.html +4 -4
  7. package/docs/documentation/modules/DatePickerInputModule/dependencies.svg +38 -42
  8. package/docs/documentation/modules/DatePickerInputModule.html +38 -42
  9. package/docs/documentation/modules/FileUploaderModule/dependencies.svg +4 -4
  10. package/docs/documentation/modules/FileUploaderModule.html +4 -4
  11. package/docs/documentation/modules/NumberModule/dependencies.svg +4 -4
  12. package/docs/documentation/modules/NumberModule.html +4 -4
  13. package/docs/documentation/modules/PanelModule/dependencies.svg +36 -36
  14. package/docs/documentation/modules/PanelModule.html +36 -36
  15. package/docs/documentation/modules/RadioModule/dependencies.svg +49 -49
  16. package/docs/documentation/modules/RadioModule.html +49 -49
  17. package/docs/documentation/modules/SelectModule/dependencies.svg +43 -43
  18. package/docs/documentation/modules/SelectModule.html +43 -43
  19. package/docs/documentation/modules/SliderModule/dependencies.svg +4 -4
  20. package/docs/documentation/modules/SliderModule.html +4 -4
  21. package/docs/documentation/modules/TableModule/dependencies.svg +216 -216
  22. package/docs/documentation/modules/TableModule.html +216 -216
  23. package/docs/documentation/modules/TabsModule/dependencies.svg +4 -4
  24. package/docs/documentation/modules/TabsModule.html +4 -4
  25. package/docs/documentation/modules/TagModule/dependencies.svg +28 -28
  26. package/docs/documentation/modules/TagModule.html +28 -28
  27. package/docs/documentation/modules/TilesModule/dependencies.svg +98 -98
  28. package/docs/documentation/modules/TilesModule.html +98 -98
  29. package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +42 -46
  30. package/docs/documentation/modules/TimePickerSelectModule.html +42 -46
  31. package/docs/documentation/modules/ToggleModule/dependencies.svg +20 -20
  32. package/docs/documentation/modules/ToggleModule.html +20 -20
  33. package/docs/documentation/modules/ToggletipModule/dependencies.svg +37 -37
  34. package/docs/documentation/modules/ToggletipModule.html +37 -37
  35. package/docs/documentation/modules/TooltipModule/dependencies.svg +28 -28
  36. package/docs/documentation/modules/TooltipModule.html +28 -28
  37. package/docs/documentation.json +71 -95
  38. package/docs/storybook/{1895.69e2c275.iframe.bundle.js → 1895.f908bfb8.iframe.bundle.js} +1 -1
  39. package/docs/storybook/{5868.3e7f17a9.iframe.bundle.js → 5868.2c92ef26.iframe.bundle.js} +1 -1
  40. package/docs/storybook/iframe.html +2 -2
  41. package/docs/storybook/{main.3edf90e2.iframe.bundle.js → main.78985516.iframe.bundle.js} +1 -1
  42. package/docs/storybook/main.css +173 -75
  43. package/docs/storybook/project.json +1 -1
  44. package/docs/storybook/{runtime~main.6c3bf6d5.iframe.bundle.js → runtime~main.e61e8f0b.iframe.bundle.js} +1 -1
  45. package/docs/storybook/toggle-toggle-stories.3f40e3b9.iframe.bundle.js +1 -0
  46. package/esm2020/table/head/table-head-checkbox.component.mjs +3 -9
  47. package/esm2020/table/head/table-head.component.mjs +1 -1
  48. package/esm2020/toggle/toggle.component.mjs +103 -83
  49. package/fesm2015/carbon-components-angular-table.mjs +3 -9
  50. package/fesm2015/carbon-components-angular-table.mjs.map +1 -1
  51. package/fesm2015/carbon-components-angular-toggle.mjs +102 -82
  52. package/fesm2015/carbon-components-angular-toggle.mjs.map +1 -1
  53. package/fesm2020/carbon-components-angular-table.mjs +3 -9
  54. package/fesm2020/carbon-components-angular-table.mjs.map +1 -1
  55. package/fesm2020/carbon-components-angular-toggle.mjs +102 -82
  56. package/fesm2020/carbon-components-angular-toggle.mjs.map +1 -1
  57. package/package.json +1 -1
  58. package/table/head/table-head-checkbox.component.d.ts +3 -8
  59. package/toggle/toggle.component.d.ts +3 -2
  60. package/docs/storybook/toggle-toggle-stories.3af803a8.iframe.bundle.js +0 -1
@@ -39,8 +39,8 @@ class Toggle extends Checkbox {
39
39
  * Set to `true` to hide the toggle label & set toggle on/off text to label.
40
40
  */
41
41
  this.hideLabel = false;
42
+ this.skeleton = false;
42
43
  this.toggleClass = true;
43
- this.formItem = true;
44
44
  /**
45
45
  * The unique id allocated to the `Toggle`.
46
46
  */
@@ -70,6 +70,9 @@ class Toggle extends Checkbox {
70
70
  get disabledClass() {
71
71
  return this.disabled;
72
72
  }
73
+ get formItem() {
74
+ return !this.skeleton;
75
+ }
73
76
  /**
74
77
  * `ControlValueAccessor` method to programmatically disable the toggle input.
75
78
  *
@@ -108,107 +111,119 @@ class Toggle extends Checkbox {
108
111
  */
109
112
  Toggle.toggleCount = 0;
110
113
  Toggle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Toggle, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.I18n }], target: i0.ɵɵFactoryTarget.Component });
111
- Toggle.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: Toggle, selector: "cds-toggle, ibm-toggle", inputs: { offText: "offText", onText: "onText", label: "label", size: "size", hideLabel: "hideLabel" }, host: { properties: { "class.cds--toggle": "this.toggleClass", "class.cds--toggle--disabled": "this.disabledClass", "class.cds--form-item": "this.formItem" } }, providers: [
114
+ Toggle.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: Toggle, selector: "cds-toggle, ibm-toggle", inputs: { offText: "offText", onText: "onText", label: "label", size: "size", hideLabel: "hideLabel", skeleton: "skeleton" }, host: { properties: { "class.cds--toggle--skeleton": "this.skeleton", "class.cds--toggle": "this.toggleClass", "class.cds--toggle--disabled": "this.disabledClass", "class.cds--form-item": "this.formItem" } }, providers: [
112
115
  {
113
116
  provide: NG_VALUE_ACCESSOR,
114
117
  useExisting: Toggle,
115
118
  multi: true
116
119
  }
117
120
  ], usesInheritance: true, ngImport: i0, template: `
118
- <button
119
- class="cds--toggle__button"
120
- [disabled]="disabled"
121
- [id]="id"
122
- role="switch"
123
- type="button"
124
- [attr.aria-checked]="checked"
125
- (click)="onClick($event)">
126
- </button>
127
- <label
128
- class="cds--toggle__label"
129
- [for]="id">
130
- <span
131
- class="cds--toggle__label-text"
132
- [ngClass]="{
133
- 'cds--visually-hidden': hideLabel
134
- }">
135
- <ng-container *ngIf="!isTemplate(label)">{{label}}</ng-container>
136
- <ng-template *ngIf="isTemplate(label)" [ngTemplateOutlet]="label"></ng-template>
137
- </span>
138
- <div
139
- class="cds--toggle__appearance"
140
- [ngClass]="{
141
- 'cds--toggle__appearance--sm': size === 'sm'
142
- }">
121
+ <ng-container *ngIf="!skeleton; else skeletonTemplate;">
122
+ <button
123
+ class="cds--toggle__button"
124
+ [disabled]="disabled"
125
+ [id]="id"
126
+ role="switch"
127
+ type="button"
128
+ [attr.aria-checked]="checked"
129
+ (click)="onClick($event)">
130
+ </button>
131
+ <label
132
+ class="cds--toggle__label"
133
+ [for]="id">
134
+ <span
135
+ class="cds--toggle__label-text"
136
+ [ngClass]="{
137
+ 'cds--visually-hidden': hideLabel
138
+ }">
139
+ <ng-container *ngIf="!isTemplate(label)">{{label}}</ng-container>
140
+ <ng-template *ngIf="isTemplate(label)" [ngTemplateOutlet]="label"></ng-template>
141
+ </span>
143
142
  <div
144
- class="cds--toggle__switch"
143
+ class="cds--toggle__appearance"
145
144
  [ngClass]="{
146
- 'cds--toggle__switch--checked': checked
145
+ 'cds--toggle__appearance--sm': size === 'sm'
147
146
  }">
148
- <svg
149
- *ngIf="size === 'sm'"
150
- class='cds--toggle__check'
151
- width="6px"
152
- height="5px"
153
- viewBox="0 0 6 5">
154
- <path d="M2.2 2.7L5 0 6 1 2.2 5 0 2.7 1 1.5z" />
155
- </svg>
147
+ <div
148
+ class="cds--toggle__switch"
149
+ [ngClass]="{
150
+ 'cds--toggle__switch--checked': checked
151
+ }">
152
+ <svg
153
+ *ngIf="size === 'sm'"
154
+ class='cds--toggle__check'
155
+ width="6px"
156
+ height="5px"
157
+ viewBox="0 0 6 5">
158
+ <path d="M2.2 2.7L5 0 6 1 2.2 5 0 2.7 1 1.5z" />
159
+ </svg>
160
+ </div>
161
+ <span class="cds--toggle__text">
162
+ {{(hideLabel ? label : (getCheckedText() | async))}}
163
+ </span>
156
164
  </div>
157
- <span class="cds--toggle__text">
158
- {{(hideLabel ? label : (getCheckedText() | async))}}
159
- </span>
160
- </div>
161
- </label>
165
+ </label>
166
+ </ng-container>
167
+ <ng-template #skeletonTemplate>
168
+ <div class="cds--toggle__skeleton-circle"></div>
169
+ <div class="cds--toggle__skeleton-rectangle"></div>
170
+ </ng-template>
162
171
  `, isInline: true, dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }] });
163
172
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: Toggle, decorators: [{
164
173
  type: Component,
165
174
  args: [{
166
175
  selector: "cds-toggle, ibm-toggle",
167
176
  template: `
168
- <button
169
- class="cds--toggle__button"
170
- [disabled]="disabled"
171
- [id]="id"
172
- role="switch"
173
- type="button"
174
- [attr.aria-checked]="checked"
175
- (click)="onClick($event)">
176
- </button>
177
- <label
178
- class="cds--toggle__label"
179
- [for]="id">
180
- <span
181
- class="cds--toggle__label-text"
182
- [ngClass]="{
183
- 'cds--visually-hidden': hideLabel
184
- }">
185
- <ng-container *ngIf="!isTemplate(label)">{{label}}</ng-container>
186
- <ng-template *ngIf="isTemplate(label)" [ngTemplateOutlet]="label"></ng-template>
187
- </span>
188
- <div
189
- class="cds--toggle__appearance"
190
- [ngClass]="{
191
- 'cds--toggle__appearance--sm': size === 'sm'
192
- }">
177
+ <ng-container *ngIf="!skeleton; else skeletonTemplate;">
178
+ <button
179
+ class="cds--toggle__button"
180
+ [disabled]="disabled"
181
+ [id]="id"
182
+ role="switch"
183
+ type="button"
184
+ [attr.aria-checked]="checked"
185
+ (click)="onClick($event)">
186
+ </button>
187
+ <label
188
+ class="cds--toggle__label"
189
+ [for]="id">
190
+ <span
191
+ class="cds--toggle__label-text"
192
+ [ngClass]="{
193
+ 'cds--visually-hidden': hideLabel
194
+ }">
195
+ <ng-container *ngIf="!isTemplate(label)">{{label}}</ng-container>
196
+ <ng-template *ngIf="isTemplate(label)" [ngTemplateOutlet]="label"></ng-template>
197
+ </span>
193
198
  <div
194
- class="cds--toggle__switch"
199
+ class="cds--toggle__appearance"
195
200
  [ngClass]="{
196
- 'cds--toggle__switch--checked': checked
201
+ 'cds--toggle__appearance--sm': size === 'sm'
197
202
  }">
198
- <svg
199
- *ngIf="size === 'sm'"
200
- class='cds--toggle__check'
201
- width="6px"
202
- height="5px"
203
- viewBox="0 0 6 5">
204
- <path d="M2.2 2.7L5 0 6 1 2.2 5 0 2.7 1 1.5z" />
205
- </svg>
203
+ <div
204
+ class="cds--toggle__switch"
205
+ [ngClass]="{
206
+ 'cds--toggle__switch--checked': checked
207
+ }">
208
+ <svg
209
+ *ngIf="size === 'sm'"
210
+ class='cds--toggle__check'
211
+ width="6px"
212
+ height="5px"
213
+ viewBox="0 0 6 5">
214
+ <path d="M2.2 2.7L5 0 6 1 2.2 5 0 2.7 1 1.5z" />
215
+ </svg>
216
+ </div>
217
+ <span class="cds--toggle__text">
218
+ {{(hideLabel ? label : (getCheckedText() | async))}}
219
+ </span>
206
220
  </div>
207
- <span class="cds--toggle__text">
208
- {{(hideLabel ? label : (getCheckedText() | async))}}
209
- </span>
210
- </div>
211
- </label>
221
+ </label>
222
+ </ng-container>
223
+ <ng-template #skeletonTemplate>
224
+ <div class="cds--toggle__skeleton-circle"></div>
225
+ <div class="cds--toggle__skeleton-rectangle"></div>
226
+ </ng-template>
212
227
  `,
213
228
  providers: [
214
229
  {
@@ -228,6 +243,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
228
243
  type: Input
229
244
  }], hideLabel: [{
230
245
  type: Input
246
+ }], skeleton: [{
247
+ type: HostBinding,
248
+ args: ["class.cds--toggle--skeleton"]
249
+ }, {
250
+ type: Input
231
251
  }], toggleClass: [{
232
252
  type: HostBinding,
233
253
  args: ["class.cds--toggle"]
@@ -1 +1 @@
1
- {"version":3,"file":"carbon-components-angular-toggle.mjs","sources":["../../src/toggle/toggle.component.ts","../../src/toggle/toggle.module.ts","../../src/toggle/carbon-components-angular-toggle.ts"],"sourcesContent":["import { Checkbox } from \"carbon-components-angular/checkbox\";\nimport {\n\tChangeDetectorRef,\n\tComponent,\n\tInput,\n\tHostBinding,\n\tTemplateRef\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\nimport { I18n } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Defines the set of states for a toggle component.\n */\nexport enum ToggleState {\n\tInit,\n\tChecked,\n\tUnchecked\n}\n\n/**\n * [See demo](../../?path=/story/components-toggle--basic)\n *\n * ```html\n * <cds-toggle [(ngModel)]=\"toggleState\">Toggle</cds-toggle>\n * ```\n */\n@Component({\n\tselector: \"cds-toggle, ibm-toggle\",\n\ttemplate: `\n\t\t<button\n\t\t\tclass=\"cds--toggle__button\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[id]=\"id\"\n\t\t\trole=\"switch\"\n\t\t\ttype=\"button\"\n\t\t\t[attr.aria-checked]=\"checked\"\n\t\t\t(click)=\"onClick($event)\">\n\t\t</button>\n\t\t<label\n\t\t\tclass=\"cds--toggle__label\"\n\t\t\t[for]=\"id\">\n\t\t\t<span\n\t\t\t\tclass=\"cds--toggle__label-text\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--visually-hidden': hideLabel\n\t\t\t\t}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t</span>\n\t\t\t<div\n\t\t\t\tclass=\"cds--toggle__appearance\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--toggle__appearance--sm': size === 'sm'\n\t\t\t\t}\">\n\t\t\t\t<div\n\t\t\t\t\tclass=\"cds--toggle__switch\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--toggle__switch--checked': checked\n\t\t\t\t\t}\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\t*ngIf=\"size === 'sm'\"\n\t\t\t\t\t\tclass='cds--toggle__check'\n\t\t\t\t\t\twidth=\"6px\"\n\t\t\t\t\t\theight=\"5px\"\n\t\t\t\t\t\tviewBox=\"0 0 6 5\">\n\t\t\t\t\t\t<path d=\"M2.2 2.7L5 0 6 1 2.2 5 0 2.7 1 1.5z\" />\n\t\t\t\t\t</svg>\n\t\t\t\t</div>\n\t\t\t\t<span class=\"cds--toggle__text\">\n\t\t\t\t\t{{(hideLabel ? label : (getCheckedText() | async))}}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</label>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: Toggle,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class Toggle extends Checkbox {\n\t/**\n\t * Variable used for creating unique ids for toggle components.\n\t */\n\tstatic toggleCount = 0;\n\n\t/**\n\t * Text that is set on the left side of the toggle.\n\t */\n\t@Input()\n\tset offText(value: string | Observable<string>) {\n\t\tthis._offValues.override(value);\n\t}\n\n\tget offText() {\n\t\treturn this._offValues.value;\n\t}\n\n\t/**\n\t * Text that is set on the right side of the toggle.\n\t */\n\t@Input()\n\tset onText(value: string | Observable<string>) {\n\t\tthis._onValues.override(value);\n\t}\n\n\tget onText() {\n\t\treturn this._onValues.value;\n\t}\n\t/**\n\t * Text that is set as the label of the toggle.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Size of the toggle component.\n\t */\n\t@Input() size: \"sm\" | \"md\" = \"md\";\n\t/**\n\t * Set to `true` to hide the toggle label & set toggle on/off text to label.\n\t */\n\t@Input() hideLabel = false;\n\n\t@HostBinding(\"class.cds--toggle\") toggleClass = true;\n\t@HostBinding(\"class.cds--toggle--disabled\") get disabledClass () {\n\t\treturn this.disabled;\n\t}\n\n\t@HostBinding(\"class.cds--form-item\") formItem = true;\n\n\t/**\n\t * The unique id allocated to the `Toggle`.\n\t */\n\tid = \"toggle-\" + Toggle.toggleCount;\n\n\tprotected _offValues = this.i18n.getOverridable(\"TOGGLE.OFF\");\n\tprotected _onValues = this.i18n.getOverridable(\"TOGGLE.ON\");\n\t/**\n\t * Creates an instance of Toggle.\n\t */\n\tconstructor(protected changeDetectorRef: ChangeDetectorRef, protected i18n: I18n) {\n\t\tsuper(changeDetectorRef);\n\t\tToggle.toggleCount++;\n\t}\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the toggle input.\n\t *\n\t * ex: `this.formGroup.get(\"myToggle\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the input\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\tgetOffText(): Observable<string> {\n\t\treturn this._offValues.subject;\n\t}\n\n\tgetOnText(): Observable<string> {\n\t\treturn this._onValues.subject;\n\t}\n\n\tgetCheckedText(): Observable<string> {\n\t\tif (this.checked) {\n\t\t\treturn this._onValues.subject;\n\t\t}\n\t\treturn this._offValues.subject;\n\t}\n\n\t/**\n\t * Creates instance of `ToggleChange` used to propagate the change event.\n\t */\n\temitChangeEvent() {\n\t\tthis.checkedChange.emit(this.checked);\n\t\tthis.propagateChange(this.checked);\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n}\n","// modules\nimport { NgModule } from \"@angular/core\";\nimport { FormsModule } from \"@angular/forms\";\nimport { CommonModule } from \"@angular/common\";\n\n// imports\nimport { I18nModule } from \"carbon-components-angular/i18n\";\nimport { Toggle } from \"./toggle.component\";\n\n@NgModule({\n\tdeclarations: [\n\t\tToggle\n\t],\n\texports: [\n\t\tToggle\n\t],\n\timports: [\n\t\tCommonModule,\n\t\tFormsModule,\n\t\tI18nModule\n\t]\n})\nexport class ToggleModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAaA;;AAEG;IACS,YAIX;AAJD,CAAA,UAAY,WAAW,EAAA;AACtB,IAAA,WAAA,CAAA,WAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;AACJ,IAAA,WAAA,CAAA,WAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAO,CAAA;AACP,IAAA,WAAA,CAAA,WAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;AACV,CAAC,EAJW,WAAW,KAAX,WAAW,GAItB,EAAA,CAAA,CAAA,CAAA;AAED;;;;;;AAMG;AAyDG,MAAO,MAAO,SAAQ,QAAQ,CAAA;AAwDnC;;AAEG;IACH,WAAsB,CAAA,iBAAoC,EAAY,IAAU,EAAA;QAC/E,KAAK,CAAC,iBAAiB,CAAC,CAAC;QADJ,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAAmB;QAAY,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAM;AA1BhF;;AAEG;QACM,IAAI,CAAA,IAAA,GAAgB,IAAI,CAAC;AAClC;;AAEG;QACM,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;QAEO,IAAW,CAAA,WAAA,GAAG,IAAI,CAAC;QAKhB,IAAQ,C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AK;gBAE4B,WAAW,EAAA,CAAA;sBAA5C,WAAW;uBAAC,mBAAmB,CAAA;gBACgB,aAAa,EAAA,CAAA;sBAA5D,WAAW;uBAAC,6BAA6B,CAAA;gBAIL,QAAQ,EAAA,CAAA;sBAA5C,WAAW;uBAAC,sBAAsB,CAAA;;;ACpIpC;MAsBa,YAAY,CAAA;;yGAAZ,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;0GAAZ,YAAY,EAAA,YAAA,EAAA,CAXvB,MAAM,CAAA,EAAA,OAAA,EAAA,CAMN,YAAY;QACZ,WAAW;AACX,QAAA,UAAU,aALV,MAAM,CAAA,EAAA,CAAA,CAAA;AAQK,YAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YALvB,YAAY;QACZ,WAAW;QACX,UAAU,CAAA,EAAA,CAAA,CAAA;2FAGC,YAAY,EAAA,UAAA,EAAA,CAAA;kBAbxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,YAAY,EAAE;wBACb,MAAM;AACN,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACR,MAAM;AACN,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACR,YAAY;wBACZ,WAAW;wBACX,UAAU;AACV,qBAAA;AACD,iBAAA,CAAA;;;ACrBD;;AAEG;;;;"}
1
+ {"version":3,"file":"carbon-components-angular-toggle.mjs","sources":["../../src/toggle/toggle.component.ts","../../src/toggle/toggle.module.ts","../../src/toggle/carbon-components-angular-toggle.ts"],"sourcesContent":["import { Checkbox } from \"carbon-components-angular/checkbox\";\nimport {\n\tChangeDetectorRef,\n\tComponent,\n\tInput,\n\tHostBinding,\n\tTemplateRef\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\nimport { I18n } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Defines the set of states for a toggle component.\n */\nexport enum ToggleState {\n\tInit,\n\tChecked,\n\tUnchecked\n}\n\n/**\n * [See demo](../../?path=/story/components-toggle--basic)\n *\n * ```html\n * <cds-toggle [(ngModel)]=\"toggleState\">Toggle</cds-toggle>\n * ```\n */\n@Component({\n\tselector: \"cds-toggle, ibm-toggle\",\n\ttemplate: `\n\t\t<ng-container *ngIf=\"!skeleton; else skeletonTemplate;\">\n\t\t\t<button\n\t\t\t\tclass=\"cds--toggle__button\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[id]=\"id\"\n\t\t\t\trole=\"switch\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t[attr.aria-checked]=\"checked\"\n\t\t\t\t(click)=\"onClick($event)\">\n\t\t\t</button>\n\t\t\t<label\n\t\t\t\tclass=\"cds--toggle__label\"\n\t\t\t\t[for]=\"id\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"cds--toggle__label-text\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--visually-hidden': hideLabel\n\t\t\t\t\t}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t\t</span>\n\t\t\t\t<div\n\t\t\t\t\tclass=\"cds--toggle__appearance\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--toggle__appearance--sm': size === 'sm'\n\t\t\t\t\t}\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"cds--toggle__switch\"\n\t\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t\t'cds--toggle__switch--checked': checked\n\t\t\t\t\t\t}\">\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t*ngIf=\"size === 'sm'\"\n\t\t\t\t\t\t\tclass='cds--toggle__check'\n\t\t\t\t\t\t\twidth=\"6px\"\n\t\t\t\t\t\t\theight=\"5px\"\n\t\t\t\t\t\t\tviewBox=\"0 0 6 5\">\n\t\t\t\t\t\t\t<path d=\"M2.2 2.7L5 0 6 1 2.2 5 0 2.7 1 1.5z\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t\t<span class=\"cds--toggle__text\">\n\t\t\t\t\t\t{{(hideLabel ? label : (getCheckedText() | async))}}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</label>\n\t\t</ng-container>\n\t\t<ng-template #skeletonTemplate>\n\t\t\t<div class=\"cds--toggle__skeleton-circle\"></div>\n\t\t\t<div class=\"cds--toggle__skeleton-rectangle\"></div>\n\t\t</ng-template>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: Toggle,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class Toggle extends Checkbox {\n\t/**\n\t * Variable used for creating unique ids for toggle components.\n\t */\n\tstatic toggleCount = 0;\n\n\t/**\n\t * Text that is set on the left side of the toggle.\n\t */\n\t@Input()\n\tset offText(value: string | Observable<string>) {\n\t\tthis._offValues.override(value);\n\t}\n\n\tget offText() {\n\t\treturn this._offValues.value;\n\t}\n\n\t/**\n\t * Text that is set on the right side of the toggle.\n\t */\n\t@Input()\n\tset onText(value: string | Observable<string>) {\n\t\tthis._onValues.override(value);\n\t}\n\n\tget onText() {\n\t\treturn this._onValues.value;\n\t}\n\t/**\n\t * Text that is set as the label of the toggle.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Size of the toggle component.\n\t */\n\t@Input() size: \"sm\" | \"md\" = \"md\";\n\t/**\n\t * Set to `true` to hide the toggle label & set toggle on/off text to label.\n\t */\n\t@Input() hideLabel = false;\n\n\t@HostBinding(\"class.cds--toggle--skeleton\") @Input() skeleton = false;\n\n\t@HostBinding(\"class.cds--toggle\") toggleClass = true;\n\t@HostBinding(\"class.cds--toggle--disabled\") get disabledClass () {\n\t\treturn this.disabled;\n\t}\n\n\t@HostBinding(\"class.cds--form-item\") get formItem() {\n\t\treturn !this.skeleton;\n\t}\n\n\t/**\n\t * The unique id allocated to the `Toggle`.\n\t */\n\tid = \"toggle-\" + Toggle.toggleCount;\n\n\tprotected _offValues = this.i18n.getOverridable(\"TOGGLE.OFF\");\n\tprotected _onValues = this.i18n.getOverridable(\"TOGGLE.ON\");\n\t/**\n\t * Creates an instance of Toggle.\n\t */\n\tconstructor(protected changeDetectorRef: ChangeDetectorRef, protected i18n: I18n) {\n\t\tsuper(changeDetectorRef);\n\t\tToggle.toggleCount++;\n\t}\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the toggle input.\n\t *\n\t * ex: `this.formGroup.get(\"myToggle\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the input\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\tgetOffText(): Observable<string> {\n\t\treturn this._offValues.subject;\n\t}\n\n\tgetOnText(): Observable<string> {\n\t\treturn this._onValues.subject;\n\t}\n\n\tgetCheckedText(): Observable<string> {\n\t\tif (this.checked) {\n\t\t\treturn this._onValues.subject;\n\t\t}\n\t\treturn this._offValues.subject;\n\t}\n\n\t/**\n\t * Creates instance of `ToggleChange` used to propagate the change event.\n\t */\n\temitChangeEvent() {\n\t\tthis.checkedChange.emit(this.checked);\n\t\tthis.propagateChange(this.checked);\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n}\n","// modules\nimport { NgModule } from \"@angular/core\";\nimport { FormsModule } from \"@angular/forms\";\nimport { CommonModule } from \"@angular/common\";\n\n// imports\nimport { I18nModule } from \"carbon-components-angular/i18n\";\nimport { Toggle } from \"./toggle.component\";\n\n@NgModule({\n\tdeclarations: [\n\t\tToggle\n\t],\n\texports: [\n\t\tToggle\n\t],\n\timports: [\n\t\tCommonModule,\n\t\tFormsModule,\n\t\tI18nModule\n\t]\n})\nexport class ToggleModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAaA;;AAEG;IACS,YAIX;AAJD,CAAA,UAAY,WAAW,EAAA;AACtB,IAAA,WAAA,CAAA,WAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;AACJ,IAAA,WAAA,CAAA,WAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAO,CAAA;AACP,IAAA,WAAA,CAAA,WAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;AACV,CAAC,EAJW,WAAW,KAAX,WAAW,GAItB,EAAA,CAAA,CAAA,CAAA;AAED;;;;;;AAMG;AA+DG,MAAO,MAAO,SAAQ,QAAQ,CAAA;AA4DnC;;AAEG;IACH,WAAsB,CAAA,iBAAoC,EAAY,IAAU,EAAA;QAC/E,KAAK,CAAC,iBAAiB,CAAC,CAAC;QADJ,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAAmB;QAAY,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAM;AA9BhF;;AAEG;QACM,IAAI,CAAA,IAAA,GAAgB,IAAI,CAAC;AAClC;;AAEG;QACM,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;QAE0B,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;QAEpC,IAAW,CAAA,WAAA,GAAG,IAAI,CAAC;AASrD;;AAEG;AACH,QAAA,IAAA,CAAA,EAAE,GAAG,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC;QAE1B,IAAU,CAAA,UAAA,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;QACpD,IAAS,CAAA,SAAA,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;Q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BAAmB,CAAA;gBACgB,aAAa,EAAA,CAAA;sBAA5D,WAAW;uBAAC,6BAA6B,CAAA;gBAID,QAAQ,EAAA,CAAA;sBAAhD,WAAW;uBAAC,sBAAsB,CAAA;;;AC5IpC;MAsBa,YAAY,CAAA;;yGAAZ,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;0GAAZ,YAAY,EAAA,YAAA,EAAA,CAXvB,MAAM,CAAA,EAAA,OAAA,EAAA,CAMN,YAAY;QACZ,WAAW;AACX,QAAA,UAAU,aALV,MAAM,CAAA,EAAA,CAAA,CAAA;AAQK,YAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YALvB,YAAY;QACZ,WAAW;QACX,UAAU,CAAA,EAAA,CAAA,CAAA;2FAGC,YAAY,EAAA,UAAA,EAAA,CAAA;kBAbxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,YAAY,EAAE;wBACb,MAAM;AACN,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACR,MAAM;AACN,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACR,YAAY;wBACZ,WAAW;wBACX,UAAU;AACV,qBAAA;AACD,iBAAA,CAAA;;;ACrBD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-components-angular",
3
- "version": "5.11.0",
3
+ "version": "5.12.0",
4
4
  "description": "Next generation components",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -19,17 +19,12 @@
19
19
 
20
20
 
21
21
  import { EventEmitter } from "@angular/core";
22
- import { I18n, Overridable } from "carbon-components-angular/i18n";
22
+ import { I18n } from "carbon-components-angular/i18n";
23
23
  import { Observable } from "rxjs";
24
- import { TableRowSize } from "../table.types";
25
24
  import * as i0 from "@angular/core";
26
25
  export declare class TableHeadCheckbox {
27
26
  protected i18n: I18n;
28
27
  private static tableSelectAllCount;
29
- /**
30
- * Size of the table rows.
31
- */
32
- size: TableRowSize;
33
28
  checked: boolean;
34
29
  indeterminate: boolean;
35
30
  skeleton: boolean;
@@ -38,9 +33,9 @@ export declare class TableHeadCheckbox {
38
33
  get ariaLabel(): string | Observable<string>;
39
34
  change: EventEmitter<void>;
40
35
  hostClass: boolean;
41
- protected _ariaLabel: Overridable;
36
+ protected _ariaLabel: import("carbon-components-angular/i18n").Overridable;
42
37
  constructor(i18n: I18n);
43
38
  getAriaLabel(): Observable<string>;
44
39
  static ɵfac: i0.ɵɵFactoryDeclaration<TableHeadCheckbox, never>;
45
- static ɵcmp: i0.ɵɵComponentDeclaration<TableHeadCheckbox, "[cdsTableHeadCheckbox], [ibmTableHeadCheckbox]", never, { "size": "size"; "checked": "checked"; "indeterminate": "indeterminate"; "skeleton": "skeleton"; "name": "name"; "ariaLabel": "ariaLabel"; }, { "change": "change"; }, never, never, false>;
40
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableHeadCheckbox, "[cdsTableHeadCheckbox], [ibmTableHeadCheckbox]", never, { "checked": "checked"; "indeterminate": "indeterminate"; "skeleton": "skeleton"; "name": "name"; "ariaLabel": "ariaLabel"; }, { "change": "change"; }, never, never, false>;
46
41
  }
@@ -67,9 +67,10 @@ export declare class Toggle extends Checkbox {
67
67
  * Set to `true` to hide the toggle label & set toggle on/off text to label.
68
68
  */
69
69
  hideLabel: boolean;
70
+ skeleton: boolean;
70
71
  toggleClass: boolean;
71
72
  get disabledClass(): boolean;
72
- formItem: boolean;
73
+ get formItem(): boolean;
73
74
  /**
74
75
  * The unique id allocated to the `Toggle`.
75
76
  */
@@ -97,5 +98,5 @@ export declare class Toggle extends Checkbox {
97
98
  emitChangeEvent(): void;
98
99
  isTemplate(value: any): boolean;
99
100
  static ɵfac: i0.ɵɵFactoryDeclaration<Toggle, never>;
100
- static ɵcmp: i0.ɵɵComponentDeclaration<Toggle, "cds-toggle, ibm-toggle", never, { "offText": "offText"; "onText": "onText"; "label": "label"; "size": "size"; "hideLabel": "hideLabel"; }, {}, never, never, false>;
101
+ static ɵcmp: i0.ɵɵComponentDeclaration<Toggle, "cds-toggle, ibm-toggle", never, { "offText": "offText"; "onText": "onText"; "label": "label"; "size": "size"; "hideLabel": "hideLabel"; "skeleton": "skeleton"; }, {}, never, never, false>;
101
102
  }
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcarbon_components_angular=self.webpackChunkcarbon_components_angular||[]).push([[2489],{"./node_modules/@carbon/utils-position/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{var _a,PLACEMENTS;__webpack_require__.d(__webpack_exports__,{FK:()=>position,ZP:()=>__WEBPACK_DEFAULT_EXPORT__}),function(PLACEMENTS){PLACEMENTS.LEFT="left",PLACEMENTS.RIGHT="right",PLACEMENTS.TOP="top",PLACEMENTS.BOTTOM="bottom"}(PLACEMENTS||(PLACEMENTS={}));var defaultPositions=((_a={})[PLACEMENTS.LEFT]=function(referenceOffset,target,referenceRect){return{top:referenceOffset.top-Math.round(target.offsetHeight/2)+Math.round(referenceRect.height/2),left:Math.round(referenceOffset.left-target.offsetWidth)}},_a[PLACEMENTS.RIGHT]=function(referenceOffset,target,referenceRect){return{top:referenceOffset.top-Math.round(target.offsetHeight/2)+Math.round(referenceRect.height/2),left:Math.round(referenceOffset.left+referenceRect.width)}},_a[PLACEMENTS.TOP]=function(referenceOffset,target,referenceRect){return{top:Math.round(referenceOffset.top-target.offsetHeight),left:referenceOffset.left-Math.round(target.offsetWidth/2)+Math.round(referenceRect.width/2)}},_a[PLACEMENTS.BOTTOM]=function(referenceOffset,target,referenceRect){return{top:Math.round(referenceOffset.top+referenceRect.height),left:referenceOffset.left-Math.round(target.offsetWidth/2)+Math.round(referenceRect.width/2)}},_a),windowRef="undefined"!=typeof window?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},Position=function(){function Position(positions){void 0===positions&&(positions={}),this.positions=defaultPositions,this.positions=Object.assign({},defaultPositions,positions)}return Position.prototype.getRelativeOffset=function(target){for(var offsets={left:target.offsetLeft,top:target.offsetTop};target.offsetParent&&"static"===getComputedStyle(target.offsetParent).position;)offsets.left+=target.offsetLeft,offsets.top+=target.offsetTop,target=target.offsetParent;return offsets},Position.prototype.getAbsoluteOffset=function(target){for(var currentNode=target,margins={top:0,left:0};currentNode.offsetParent;){var computed=getComputedStyle(currentNode.offsetParent);"static"===computed.position&&computed.marginLeft&&computed.marginTop&&(parseInt(computed.marginTop,10)&&(margins.top+=parseInt(computed.marginTop,10)),parseInt(computed.marginLeft,10)&&(margins.left+=parseInt(computed.marginLeft,10))),currentNode=currentNode.offsetParent}var targetRect=target.getBoundingClientRect(),relativeRect=document.body.getBoundingClientRect();return{top:targetRect.top-relativeRect.top+margins.top,left:targetRect.left-relativeRect.left+margins.left}},Position.prototype.findRelative=function(reference,target,placement){var referenceOffset=this.getRelativeOffset(reference),referenceRect=reference.getBoundingClientRect();return this.calculatePosition(referenceOffset,referenceRect,target,placement)},Position.prototype.findAbsolute=function(reference,target,placement){var referenceOffset=this.getAbsoluteOffset(reference),referenceRect=reference.getBoundingClientRect();return this.calculatePosition(referenceOffset,referenceRect,target,placement)},Position.prototype.findPosition=function(reference,target,placement,offsetFunction){void 0===offsetFunction&&(offsetFunction=this.getAbsoluteOffset.bind(this));var referenceOffset=offsetFunction(reference),referenceRect=reference.getBoundingClientRect();return this.calculatePosition(referenceOffset,referenceRect,target,placement)},Position.prototype.findPositionAt=function(offset,target,placement){return this.calculatePosition(offset,{top:0,left:0,height:0,width:0},target,placement)},Position.prototype.getPlacementBox=function(target,position){var targetBottom=target.offsetHeight+position.top,targetRight=target.offsetWidth+position.left;return{top:position.top,bottom:targetBottom,left:position.left,right:targetRight}},Position.prototype.addOffset=function(position,top,left){return void 0===top&&(top=0),void 0===left&&(left=0),Object.assign({},position,{top:position.top+top,left:position.left+left})},Position.prototype.setElement=function(element,position){element.style.top=position.top+"px",element.style.left=position.left+"px"},Position.prototype.findBestPlacement=function(reference,target,placements,containerFunction,positionFunction){var _this=this;void 0===containerFunction&&(containerFunction=this.defaultContainerFunction.bind(this)),void 0===positionFunction&&(positionFunction=this.findPosition.bind(this));var weightedPlacements=placements.map((function(placement){var pos=positionFunction(reference,target,placement),box=_this.getPlacementBox(target,pos),hiddenHeight=0,hiddenWidth=0,container=containerFunction();box.top<container.top?hiddenHeight=container.top-box.top:box.bottom>container.height&&(hiddenHeight=box.bottom-container.height),box.left<container.left?hiddenWidth=container.left-box.left:box.right>container.width&&(hiddenWidth=box.right-container.width),hiddenHeight&&!hiddenWidth?hiddenWidth=1:hiddenWidth&&!hiddenHeight&&(hiddenHeight=1);var area=target.offsetHeight*target.offsetWidth;return{placement,weight:(area-hiddenHeight*hiddenWidth)/area}}));return weightedPlacements.sort((function(a,b){return b.weight-a.weight})),weightedPlacements[0].placement},Position.prototype.findBestPlacementAt=function(offset,target,placements,containerFunction){var _this=this;void 0===containerFunction&&(containerFunction=this.defaultContainerFunction.bind(this));return this.findBestPlacement(null,target,placements,containerFunction,(function(_,target,placement){return _this.findPositionAt(offset,target,placement)}))},Position.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:windowRef.innerHeight,width:windowRef.innerWidth}},Position.prototype.calculatePosition=function(referenceOffset,referenceRect,target,placement){return this.positions[placement]?this.positions[placement](referenceOffset,target,referenceRect):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},Position}(),position=new Position;const __WEBPACK_DEFAULT_EXPORT__=Position},"./src/toggle/toggle.stories.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Basic:()=>Basic,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _storybook_angular__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@storybook/angular/dist/index.mjs"),___WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/toggle/index.ts");const __WEBPACK_DEFAULT_EXPORT__={title:"Components/Toggle",decorators:[(0,_storybook_angular__WEBPACK_IMPORTED_MODULE_0__.moduleMetadata)({imports:[___WEBPACK_IMPORTED_MODULE_1__.vm]})],component:___WEBPACK_IMPORTED_MODULE_1__.ZD},Basic=(args=>({props:args,template:'\n\t\t<cds-toggle\n\t\t\t[label]="label"\n\t\t\t[hideLabel]="hideLabel"\n\t\t\t[onText]="onText"\n\t\t\t[offText]="offText"\n\t\t\t[disabled]="disabled"\n\t\t\t[checked]="checked"\n\t\t\t(checkedChange)="onChange($event)"\n\t\t\t[size]="size">\n\t\t</cds-toggle>\n\t'})).bind({});Basic.args={disabled:!1,checked:!1,hideLabel:!1,label:"Toggle element label",onText:"On",offText:"Off"},Basic.argTypes={onChange:{control:"Toggled!"},size:{options:["sm","md"],defaultValue:"md",control:"radio"}}},"./src/checkbox/index.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{XZ:()=>Checkbox,nD:()=>CheckboxModule});var CheckboxState,tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.js"),core=__webpack_require__("./node_modules/@angular/core/fesm2020/core.mjs"),fesm2020_forms=__webpack_require__("./node_modules/@angular/forms/fesm2020/forms.mjs");!function(CheckboxState){CheckboxState[CheckboxState.Init=0]="Init",CheckboxState[CheckboxState.Indeterminate=1]="Indeterminate",CheckboxState[CheckboxState.Checked=2]="Checked",CheckboxState[CheckboxState.Unchecked=3]="Unchecked"}(CheckboxState||(CheckboxState={}));let Checkbox=class Checkbox{constructor(changeDetectorRef){this.changeDetectorRef=changeDetectorRef,this.disabled=!1,this.skeleton=!1,this.hideLabel=!1,this.id=`checkbox-${Checkbox.checkboxCount}`,this.ariaLabel="",this.click=new core.EventEmitter,this.checkedChange=new core.EventEmitter,this.indeterminateChange=new core.EventEmitter,this._checked=!1,this._indeterminate=!1,this.currentCheckboxState=CheckboxState.Init,this.onTouched=()=>{},this.propagateChange=_=>{},Checkbox.checkboxCount++}set indeterminate(indeterminate){indeterminate!==this._indeterminate&&(this._indeterminate=indeterminate,this._indeterminate?this.transitionCheckboxState(CheckboxState.Indeterminate):this.transitionCheckboxState(this.checked?CheckboxState.Checked:CheckboxState.Unchecked),this.inputCheckbox&&this.inputCheckbox.nativeElement&&(this.inputCheckbox.nativeElement.indeterminate=indeterminate),this.changeDetectorRef.markForCheck(),this.indeterminateChange.emit(this._indeterminate))}get indeterminate(){return this._indeterminate}set checked(checked){this.setChecked(checked,!1)}get checked(){return this._checked}toggle(){this.setChecked(!this.checked,!0)}writeValue(value){this.setChecked(!!value,!0)}registerOnChange(fn){this.propagateChange=fn}registerOnTouched(fn){this.onTouched=fn}setDisabledState(isDisabled){this.disabled=isDisabled,this.changeDetectorRef.markForCheck()}focusOut(){this.onTouched()}onChange(event){event.stopPropagation()}onClick(event){if(this.click.observers.length)return event.preventDefault(),void this.click.emit();this.disabled||(this.toggle(),this.transitionCheckboxState(this._checked?CheckboxState.Checked:CheckboxState.Unchecked),this.emitChangeEvent())}transitionCheckboxState(newState){this.currentCheckboxState=newState}emitChangeEvent(){this.checkedChange.emit(this.checked),this.propagateChange(this.checked)}ngAfterViewInit(){this.indeterminate&&this.inputCheckbox&&this.inputCheckbox.nativeElement&&(this.inputCheckbox.nativeElement.indeterminate=!0)}setChecked(checked,resetIndeterminate){checked!==this._checked&&(this._checked=checked,resetIndeterminate&&this._indeterminate&&(this._indeterminate=!1,Promise.resolve().then((()=>{this.indeterminateChange.emit(this._indeterminate)}))),this.changeDetectorRef.markForCheck())}};Checkbox.checkboxCount=0,Checkbox.ctorParameters=()=>[{type:core.ChangeDetectorRef}],Checkbox.propDecorators={disabled:[{type:core.Input}],skeleton:[{type:core.Input}],hideLabel:[{type:core.Input}],name:[{type:core.Input}],id:[{type:core.Input}],required:[{type:core.Input}],value:[{type:core.Input}],ariaLabel:[{type:core.Input}],ariaLabelledby:[{type:core.Input}],indeterminate:[{type:core.Input}],checked:[{type:core.Input}],click:[{type:core.Output}],checkedChange:[{type:core.Output}],indeterminateChange:[{type:core.Output}],inputCheckbox:[{type:core.ViewChild,args:["inputCheckbox"]}],focusOut:[{type:core.HostListener,args:["focusout"]}]},Checkbox=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-checkbox, ibm-checkbox",template:'\n\t\t<div class="cds--form-item cds--checkbox-wrapper">\n\t\t\t<input\n\t\t\t\t#inputCheckbox\n\t\t\t\tclass="cds--checkbox"\n\t\t\t\ttype="checkbox"\n\t\t\t\t[id]="id + \'_input\'"\n\t\t\t\t[value]="value"\n\t\t\t\t[name]="name"\n\t\t\t\t[required]="required"\n\t\t\t\t[checked]="checked"\n\t\t\t\t[disabled]="disabled"\n\t\t\t\t[attr.aria-labelledby]="ariaLabelledby"\n\t\t\t\t(change)="onChange($event)"\n\t\t\t\t(click)="onClick($event)">\n\t\t\t<label\n\t\t\t\t[for]="id + \'_input\'"\n\t\t\t\t[attr.aria-label]="ariaLabel"\n\t\t\t\tclass="cds--checkbox-label"\n\t\t\t\t[ngClass]="{\n\t\t\t\t\t\'cds--skeleton\' : skeleton\n\t\t\t\t}">\n\t\t\t\t<span [ngClass]="{\'cds--visually-hidden\' : hideLabel}" class="cds--checkbox-label-text">\n\t\t\t\t\t<ng-content></ng-content>\n\t\t\t\t</span>\n\t\t\t</label>\n\t\t</div>\n\t',providers:[{provide:fesm2020_forms.JU,useExisting:Checkbox,multi:!0}],changeDetection:core.ChangeDetectionStrategy.OnPush})],Checkbox);var common=__webpack_require__("./node_modules/@angular/common/fesm2020/common.mjs");let CheckboxModule=class CheckboxModule{};CheckboxModule=(0,tslib_es6.gn)([(0,core.NgModule)({declarations:[Checkbox],exports:[Checkbox],imports:[common.CommonModule,fesm2020_forms.u5]})],CheckboxModule)},"./src/toggle/index.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{ZD:()=>Toggle,vm:()=>ToggleModule});var ToggleState,tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.js"),src_checkbox=__webpack_require__("./src/checkbox/index.ts"),core=__webpack_require__("./node_modules/@angular/core/fesm2020/core.mjs"),fesm2020_forms=__webpack_require__("./node_modules/@angular/forms/fesm2020/forms.mjs"),i18n=__webpack_require__("./src/i18n/index.ts");!function(ToggleState){ToggleState[ToggleState.Init=0]="Init",ToggleState[ToggleState.Checked=1]="Checked",ToggleState[ToggleState.Unchecked=2]="Unchecked"}(ToggleState||(ToggleState={}));let Toggle=class Toggle extends src_checkbox.XZ{constructor(changeDetectorRef,i18n){super(changeDetectorRef),this.changeDetectorRef=changeDetectorRef,this.i18n=i18n,this.size="md",this.hideLabel=!1,this.toggleClass=!0,this.formItem=!0,this.id="toggle-"+Toggle.toggleCount,this._offValues=this.i18n.getOverridable("TOGGLE.OFF"),this._onValues=this.i18n.getOverridable("TOGGLE.ON"),Toggle.toggleCount++}set offText(value){this._offValues.override(value)}get offText(){return this._offValues.value}set onText(value){this._onValues.override(value)}get onText(){return this._onValues.value}get disabledClass(){return this.disabled}setDisabledState(isDisabled){this.disabled=isDisabled}getOffText(){return this._offValues.subject}getOnText(){return this._onValues.subject}getCheckedText(){return this.checked?this._onValues.subject:this._offValues.subject}emitChangeEvent(){this.checkedChange.emit(this.checked),this.propagateChange(this.checked)}isTemplate(value){return value instanceof core.TemplateRef}};Toggle.toggleCount=0,Toggle.ctorParameters=()=>[{type:core.ChangeDetectorRef},{type:i18n.oc}],Toggle.propDecorators={offText:[{type:core.Input}],onText:[{type:core.Input}],label:[{type:core.Input}],size:[{type:core.Input}],hideLabel:[{type:core.Input}],toggleClass:[{type:core.HostBinding,args:["class.cds--toggle"]}],disabledClass:[{type:core.HostBinding,args:["class.cds--toggle--disabled"]}],formItem:[{type:core.HostBinding,args:["class.cds--form-item"]}]},Toggle=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-toggle, ibm-toggle",template:'\n\t\t<button\n\t\t\tclass="cds--toggle__button"\n\t\t\t[disabled]="disabled"\n\t\t\t[id]="id"\n\t\t\trole="switch"\n\t\t\ttype="button"\n\t\t\t[attr.aria-checked]="checked"\n\t\t\t(click)="onClick($event)">\n\t\t</button>\n\t\t<label\n\t\t\tclass="cds--toggle__label"\n\t\t\t[for]="id">\n\t\t\t<span\n\t\t\t\tclass="cds--toggle__label-text"\n\t\t\t\t[ngClass]="{\n\t\t\t\t\t\'cds--visually-hidden\': hideLabel\n\t\t\t\t}">\n\t\t\t\t<ng-container *ngIf="!isTemplate(label)">{{label}}</ng-container>\n\t\t\t\t<ng-template *ngIf="isTemplate(label)" [ngTemplateOutlet]="label"></ng-template>\n\t\t\t</span>\n\t\t\t<div\n\t\t\t\tclass="cds--toggle__appearance"\n\t\t\t\t[ngClass]="{\n\t\t\t\t\t\'cds--toggle__appearance--sm\': size === \'sm\'\n\t\t\t\t}">\n\t\t\t\t<div\n\t\t\t\t\tclass="cds--toggle__switch"\n\t\t\t\t\t[ngClass]="{\n\t\t\t\t\t\t\'cds--toggle__switch--checked\': checked\n\t\t\t\t\t}">\n\t\t\t\t\t<svg\n\t\t\t\t\t\t*ngIf="size === \'sm\'"\n\t\t\t\t\t\tclass=\'cds--toggle__check\'\n\t\t\t\t\t\twidth="6px"\n\t\t\t\t\t\theight="5px"\n\t\t\t\t\t\tviewBox="0 0 6 5">\n\t\t\t\t\t\t<path d="M2.2 2.7L5 0 6 1 2.2 5 0 2.7 1 1.5z" />\n\t\t\t\t\t</svg>\n\t\t\t\t</div>\n\t\t\t\t<span class="cds--toggle__text">\n\t\t\t\t\t{{(hideLabel ? label : (getCheckedText() | async))}}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</label>\n\t',providers:[{provide:fesm2020_forms.JU,useExisting:Toggle,multi:!0}]})],Toggle);var common=__webpack_require__("./node_modules/@angular/common/fesm2020/common.mjs");let ToggleModule=class ToggleModule{};ToggleModule=(0,tslib_es6.gn)([(0,core.NgModule)({declarations:[Toggle],exports:[Toggle],imports:[common.CommonModule,fesm2020_forms.u5,i18n.LU]})],ToggleModule)},"./node_modules/@storybook/angular/dist/client/decorators.js":(__unused_webpack_module,exports,__webpack_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.componentWrapperDecorator=exports.applicationConfig=exports.moduleMetadata=void 0;const ComputesTemplateFromComponent_1=__webpack_require__("./node_modules/@storybook/angular/dist/client/angular-beta/ComputesTemplateFromComponent.js"),NgComponentAnalyzer_1=__webpack_require__("./node_modules/@storybook/angular/dist/client/angular-beta/utils/NgComponentAnalyzer.js");exports.moduleMetadata=metadata=>storyFn=>{const story=storyFn(),storyMetadata=story.moduleMetadata||{};return metadata=metadata||{},{...story,moduleMetadata:{declarations:[...metadata.declarations||[],...storyMetadata.declarations||[]],entryComponents:[...metadata.entryComponents||[],...storyMetadata.entryComponents||[]],imports:[...metadata.imports||[],...storyMetadata.imports||[]],schemas:[...metadata.schemas||[],...storyMetadata.schemas||[]],providers:[...metadata.providers||[],...storyMetadata.providers||[]]}}},exports.applicationConfig=function applicationConfig(config){return storyFn=>{const story=storyFn(),storyConfig=story.applicationConfig;return{...story,applicationConfig:storyConfig||config?{...config,...storyConfig,providers:[...config?.providers||[],...storyConfig?.providers||[]]}:void 0}}};exports.componentWrapperDecorator=(element,props)=>(storyFn,storyContext)=>{const story=storyFn(),currentProps="function"==typeof props?props(storyContext):props,template=(0,NgComponentAnalyzer_1.isComponent)(element)?(0,ComputesTemplateFromComponent_1.computesTemplateFromComponent)(element,currentProps??{},story.template):element(story.template);return{...story,template,...currentProps||story.props?{props:{...currentProps,...story.props}}:{}}}},"./node_modules/@storybook/angular/dist/client/index.js":function(__unused_webpack_module,exports,__webpack_require__){var __createBinding=this&&this.__createBinding||(Object.create?function(o,m,k,k2){void 0===k2&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);desc&&!("get"in desc?!m.__esModule:desc.writable||desc.configurable)||(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}:function(o,m,k,k2){void 0===k2&&(k2=k),o[k2]=m[k]}),__exportStar=this&&this.__exportStar||function(m,exports){for(var p in m)"default"===p||Object.prototype.hasOwnProperty.call(exports,p)||__createBinding(exports,m,p)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.applicationConfig=exports.componentWrapperDecorator=exports.moduleMetadata=void 0,__webpack_require__("./node_modules/@storybook/angular/dist/client/globals.js"),__exportStar(__webpack_require__("./node_modules/@storybook/angular/dist/client/public-api.js"),exports),__exportStar(__webpack_require__("./node_modules/@storybook/angular/dist/client/public-types.js"),exports);var decorators_1=__webpack_require__("./node_modules/@storybook/angular/dist/client/decorators.js");Object.defineProperty(exports,"moduleMetadata",{enumerable:!0,get:function(){return decorators_1.moduleMetadata}}),Object.defineProperty(exports,"componentWrapperDecorator",{enumerable:!0,get:function(){return decorators_1.componentWrapperDecorator}}),Object.defineProperty(exports,"applicationConfig",{enumerable:!0,get:function(){return decorators_1.applicationConfig}})},"./node_modules/@storybook/angular/dist/client/public-api.js":function(__unused_webpack_module,exports,__webpack_require__){var __createBinding=this&&this.__createBinding||(Object.create?function(o,m,k,k2){void 0===k2&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);desc&&!("get"in desc?!m.__esModule:desc.writable||desc.configurable)||(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}:function(o,m,k,k2){void 0===k2&&(k2=k),o[k2]=m[k]}),__exportStar=this&&this.__exportStar||function(m,exports){for(var p in m)"default"===p||Object.prototype.hasOwnProperty.call(exports,p)||__createBinding(exports,m,p)},__importDefault=this&&this.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.raw=exports.forceReRender=exports.configure=exports.storiesOf=void 0;const core_client_1=__webpack_require__("@storybook/core-client"),render_1=__webpack_require__("./node_modules/@storybook/angular/dist/client/render.js"),decorateStory_1=__importDefault(__webpack_require__("./node_modules/@storybook/angular/dist/client/decorateStory.js"));__exportStar(__webpack_require__("./node_modules/@storybook/angular/dist/client/public-types.js"),exports);const api=(0,core_client_1.start)(render_1.renderToCanvas,{decorateStory:decorateStory_1.default,render:render_1.render});exports.storiesOf=(kind,m)=>api.clientApi.storiesOf(kind,m).addParameters({renderer:"angular"});exports.configure=(...args)=>api.configure("angular",...args),exports.forceReRender=api.forceReRender,exports.raw=api.clientApi.raw},"./node_modules/@storybook/angular/dist/client/public-types.js":(__unused_webpack_module,exports)=>{Object.defineProperty(exports,"__esModule",{value:!0})},"./node_modules/@storybook/angular/dist/index.mjs":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{var _client_index__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@storybook/angular/dist/client/index.js");__webpack_require__.o(_client_index__WEBPACK_IMPORTED_MODULE_0__,"componentWrapperDecorator")&&__webpack_require__.d(__webpack_exports__,{componentWrapperDecorator:function(){return _client_index__WEBPACK_IMPORTED_MODULE_0__.componentWrapperDecorator}}),__webpack_require__.o(_client_index__WEBPACK_IMPORTED_MODULE_0__,"moduleMetadata")&&__webpack_require__.d(__webpack_exports__,{moduleMetadata:function(){return _client_index__WEBPACK_IMPORTED_MODULE_0__.moduleMetadata}})}}]);