@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 +0,0 @@
1
- {"version":3,"file":"selection-box-grid.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/selection-box/selection-box-grid.component.ts","../../../../../../../../libs/components/forms/src/lib/modules/selection-box/selection-box-grid.component.html"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EACvB,SAAS,EACT,eAAe,EACf,UAAU,EACV,YAAY,EACZ,KAAK,EACL,MAAM,EAGN,SAAS,EACT,SAAS,EACT,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,GAEtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;;;;;;AAGrE,MAAM,4BAA4B,GAAG,oBAAoB,CAAC;AAE1D;;GAEG;AAQH,MAAM,OAAO,4BAA4B;IA4CvC,YACU,QAAyB,EACzB,kBAAyC,EACzC,mBAAkD,EAClD,SAAqB,EACrB,mBAA4C,EAC5C,MAAc;QALd,aAAQ,GAAR,QAAQ,CAAiB;QACzB,uBAAkB,GAAlB,kBAAkB,CAAuB;QACzC,wBAAmB,GAAnB,mBAAmB,CAA+B;QAClD,cAAS,GAAT,SAAS,CAAY;QACrB,wBAAmB,GAAnB,mBAAmB,CAAyB;QAC5C,WAAM,GAAN,MAAM,CAAQ;QAZhB,kBAAa,GAAG,IAAI,OAAO,EAAE,CAAC;IAanC,CAAC;IAhDJ;;;;OAIG;IACH,IACW,UAAU,CAAC,KAAwC;QAC5D,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,I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iB,CAAC,IAAI;iBACtC;0QAUY,UAAU;sBADpB,KAAK;gBAYC,cAAc;sBAHpB,eAAe;uBAAC,wBAAwB,EAAE;wBACzC,IAAI,EAAE,wBAAwB;qBAC/B;gBAeO,UAAU;sBAJjB,SAAS;uBAAC,WAAW,EAAE;wBACtB,IAAI,EAAE,UAAU;wBAChB,MAAM,EAAE,IAAI;qBACb;gBA8CM,cAAc;sBADpB,YAAY;uBAAC,eAAe","sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n HostListener,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n QueryList,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n MutationObserverService,\n SkyCoreAdapterService,\n SkyMediaBreakpoints,\n} from '@skyux/core';\nimport { SkyThemeService } from '@skyux/theme';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkySelectionBoxAdapterService } from './selection-box-adapter.service';\nimport { SkySelectionBoxComponent } from './selection-box.component';\nimport { SkySelectionBoxGridAlignItemsType } from './types/selection-box-grid-align-items-type';\n\nconst SKY_SELECTION_BOX_CLASS_NAME = '.sky-selection-box';\n\n/**\n * Creates a grid layout for an array of selection boxes.\n */\n@Component({\n selector: 'sky-selection-box-grid',\n templateUrl: './selection-box-grid.component.html',\n styleUrls: ['./selection-box-grid.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class SkySelectionBoxGridComponent\n implements AfterViewInit, OnDestroy, OnInit\n{\n /**\n * @internal\n * Specifies how to display the selection boxes in the grid.\n * @default 'center'\n */\n @Input()\n public set alignItems(value: SkySelectionBoxGridAlignItemsType) {\n this._alignItems = value;\n }\n\n public get alignItems(): SkySelectionBoxGridAlignItemsType {\n return this._alignItems || 'center';\n }\n\n @ContentChildren(SkySelectionBoxComponent, {\n read: SkySelectionBoxComponent,\n })\n public selectionBoxes: QueryList<SkySelectionBoxComponent>;\n\n private set currentBreakpoint(value: SkyMediaBreakpoints) {\n if (value !== this._currentBreakpoint) {\n this._currentBreakpoint = value;\n this.selectionBoxAdapter.setResponsiveClass(this.elementRef, value);\n this.updateChildrenHeights();\n }\n }\n\n @ViewChild('container', {\n read: ElementRef,\n static: true,\n })\n private elementRef: ElementRef<any>;\n\n private mutationObserver: MutationObserver;\n\n private ngUnsubscribe = new Subject();\n\n private _alignItems: SkySelectionBoxGridAlignItemsType;\n\n private _currentBreakpoint: SkyMediaBreakpoints;\n\n constructor(\n private themeSvc: SkyThemeService,\n private coreAdapterService: SkyCoreAdapterService,\n private selectionBoxAdapter: SkySelectionBoxAdapterService,\n private hostElRef: ElementRef,\n private mutationObserverSvc: MutationObserverService,\n private ngZone: NgZone\n ) {}\n\n public ngOnInit(): void {\n /* istanbul ignore else */\n if (this.themeSvc) {\n this.themeSvc.settingsChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.updateBreakpointClass();\n this.updateChildrenHeights();\n });\n }\n }\n\n public ngAfterViewInit(): void {\n this.updateBreakpointClass();\n this.updateChildrenHeights();\n this.initMutationObserver();\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n\n this.destroyMutationObserver();\n }\n\n @HostListener('window:resize')\n public onWindowResize(): void {\n this.updateBreakpointClass();\n }\n\n private initMutationObserver(): void {\n /* istanbul ignore else */\n if (!this.mutationObserver) {\n const el = this.elementRef.nativeElement;\n\n // MutationObserver is patched by Zone.js and therefore becomes part of the\n // Angular change detection cycle, but this can lead to infinite loops in some\n // scenarios. This will keep MutationObserver from triggering change detection.\n this.ngZone.runOutsideAngular(() => {\n this.mutationObserver = this.mutationObserverSvc.create(() => {\n this.updateChildrenHeights();\n });\n\n this.mutationObserver.observe(el, {\n characterData: true,\n subtree: true,\n });\n });\n }\n }\n\n private destroyMutationObserver(): void {\n /* istanbul ignore else */\n if (this.mutationObserver) {\n this.mutationObserver.disconnect();\n this.mutationObserver = undefined;\n }\n }\n\n private updateBreakpointClass(): void {\n const parentWidth = this.selectionBoxAdapter.getParentWidth(this.hostElRef);\n this.currentBreakpoint =\n this.selectionBoxAdapter.getBreakpointForWidth(parentWidth);\n }\n\n private updateChildrenHeights(): void {\n this.coreAdapterService.resetHeight(\n this.elementRef,\n SKY_SELECTION_BOX_CLASS_NAME\n );\n this.coreAdapterService.syncMaxHeight(\n this.elementRef,\n SKY_SELECTION_BOX_CLASS_NAME\n );\n }\n}\n","<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"]}
@@ -1,17 +0,0 @@
1
- import { Component } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * Specifies the header to display in a selection box.
5
- */
6
- export class SkySelectionBoxHeaderComponent {
7
- }
8
- SkySelectionBoxHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
9
- SkySelectionBoxHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkySelectionBoxHeaderComponent, selector: "sky-selection-box-header", ngImport: i0, template: "<ng-content></ng-content>\n" });
10
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxHeaderComponent, decorators: [{
11
- type: Component,
12
- args: [{
13
- selector: 'sky-selection-box-header',
14
- templateUrl: './selection-box-header.component.html',
15
- }]
16
- }] });
17
- //# sourceMappingURL=selection-box-header.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selection-box-header.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/selection-box/selection-box-header.component.ts","../../../../../../../../libs/components/forms/src/lib/modules/selection-box/selection-box-header.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;AAE1C;;GAEG;AAKH,MAAM,OAAO,8BAA8B;;4HAA9B,8BAA8B;gHAA9B,8BAA8B,gECT3C,6BACA;4FDQa,8BAA8B;kBAJ1C,SAAS;mBAAC;oBACT,QAAQ,EAAE,0BAA0B;oBACpC,WAAW,EAAE,uCAAuC;iBACrD","sourcesContent":["import { Component } from '@angular/core';\n\n/**\n * Specifies the header to display in a selection box.\n */\n@Component({\n selector: 'sky-selection-box-header',\n templateUrl: './selection-box-header.component.html',\n})\nexport class SkySelectionBoxHeaderComponent {}\n","<ng-content></ng-content>\n"]}
@@ -1,107 +0,0 @@
1
- import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Input, ViewChild, ViewEncapsulation, } from '@angular/core';
2
- import { Subject } from 'rxjs';
3
- import { takeUntil } from 'rxjs/operators';
4
- import { SkySelectionBoxAdapterService } from './selection-box-adapter.service';
5
- import * as i0 from "@angular/core";
6
- import * as i1 from "./selection-box-adapter.service";
7
- import * as i2 from "@angular/common";
8
- import * as i3 from "@skyux/theme";
9
- /**
10
- * Creates a button to present users with a choice or question before proceeding with a one-time process.
11
- */
12
- export class SkySelectionBoxComponent {
13
- constructor(changeDetector, selectionBoxAdapterService) {
14
- this.changeDetector = changeDetector;
15
- this.selectionBoxAdapterService = selectionBoxAdapterService;
16
- this.ngUnsubscribe = new Subject();
17
- }
18
- set checked(value) {
19
- this._checked = value;
20
- this.changeDetector.markForCheck();
21
- }
22
- get checked() {
23
- return this._checked;
24
- }
25
- set disabled(value) {
26
- this.selectionBoxAdapterService.setTabIndex(this.selectionBoxEl, value ? -1 : 0);
27
- this._disabled = value;
28
- this.changeDetector.markForCheck();
29
- }
30
- get disabled() {
31
- return this._disabled || false;
32
- }
33
- ngAfterViewInit() {
34
- // Wait for consumer form controls to initialize before setting selected/disabled states.
35
- setTimeout(() => {
36
- this.selectionBoxAdapterService.setChildrenTabIndex(this.selectionBoxEl, -1);
37
- this.updateCheckedOnControlChange();
38
- this.updateDisabledState();
39
- });
40
- }
41
- ngOnDestroy() {
42
- this.ngUnsubscribe.next();
43
- this.ngUnsubscribe.complete();
44
- }
45
- /**
46
- * Since we are programatically firing a click on the control,
47
- * make sure user is not clicking on the control before firing click logic.
48
- */
49
- onClick(event) {
50
- const isControlClick = this.selectionBoxAdapterService.isDescendant(this.controlEl, event.target);
51
- if (!isControlClick) {
52
- this.selectControl();
53
- }
54
- }
55
- onKeydown(event) {
56
- /* istanbul ignore else */
57
- if (event.key === ' ') {
58
- this.selectControl();
59
- event.preventDefault();
60
- }
61
- }
62
- selectControl() {
63
- this.selectionBoxAdapterService.getControl(this.controlEl).click();
64
- this.selectionBoxAdapterService.focus(this.selectionBoxEl);
65
- }
66
- updateCheckedOnControlChange() {
67
- this.control.checkedChange
68
- .pipe(takeUntil(this.ngUnsubscribe))
69
- .subscribe((value) => {
70
- this.checked = value;
71
- });
72
- }
73
- updateDisabledState() {
74
- this.control.disabledChange
75
- .pipe(takeUntil(this.ngUnsubscribe))
76
- .subscribe((value) => {
77
- this.disabled = value;
78
- });
79
- }
80
- }
81
- SkySelectionBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.SkySelectionBoxAdapterService }], target: i0.ɵɵFactoryTarget.Component });
82
- SkySelectionBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkySelectionBoxComponent, selector: "sky-selection-box", inputs: { control: "control" }, viewQueries: [{ propertyName: "controlEl", first: true, predicate: ["control"], descendants: true, read: ElementRef }, { propertyName: "selectionBoxEl", first: true, predicate: ["selectionBox"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div\n class=\"sky-selection-box sky-rounded-corners sky-btn sky-btn-default\"\n role=\"button\"\n tabindex=\"0\"\n [attr.disabled]=\"disabled ? true : null\"\n [ngClass]=\"{\n 'sky-selection-box-selected': checked,\n 'sky-selection-box-disabled': disabled\n }\"\n [skyThemeClass]=\"{\n 'sky-shadow': 'default',\n 'sky-box sky-elevation-1': 'modern'\n }\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n #selectionBox\n>\n <div\n class=\"sky-selection-box-icon\"\n [ngStyle]=\"{\n display: !icon.innerHTML.trim() ? 'none' : ''\n }\"\n #icon\n >\n <ng-content select=\"sky-icon\"> </ng-content>\n </div>\n\n <div class=\"sky-selection-box-content\">\n <div\n class=\"sky-selection-box-header\"\n [ngClass]=\"{\n 'sky-font-heading-2': icon.innerHTML.trim(),\n 'sky-font-heading-3': !icon.innerHTML.trim()\n }\"\n >\n <ng-content select=\"sky-selection-box-header\"></ng-content>\n </div>\n <div\n class=\"sky-selection-box-description\"\n [skyThemeClass]=\"{\n 'sky-font-deemphasized': 'modern',\n 'sky-deemphasized': 'default'\n }\"\n >\n <ng-content select=\"sky-selection-box-description\"> </ng-content>\n </div>\n </div>\n\n <div class=\"sky-selection-box-control\" #control>\n <ng-content select=\"sky-radio\"> </ng-content>\n <ng-content select=\"sky-checkbox\"> </ng-content>\n </div>\n</div>\n", styles: [".sky-selection-box{display:flex;flex-flow:row nowrap;padding:15px;text-align:left}.sky-selection-box:hover{background:#ffffff;box-shadow:0 0 5px #0000004d,inset 0 0 0 1px #00b4f1}.sky-selection-box:hover .sky-switch-control{border:solid 1px #00b4f1}.sky-selection-box:focus .sky-switch-control{outline:thin dotted;outline:-webkit-focus-ring-color auto 5px}.sky-selection-box.sky-selection-box-selected{background:#f1eef6}.sky-selection-box.sky-selection-box-disabled{background:#eeeeef}.sky-selection-box.sky-selection-box-disabled .sky-selection-box-icon{color:#686c73}.sky-selection-box .sky-selection-box-icon{color:#0974a1;margin:0 10px 0 0;width:42px;height:42px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}.sky-selection-box .sky-selection-box-icon .sky-icon{font-size:24px!important}.sky-selection-box .sky-selection-box-content{flex:1 1 auto;margin:0 10px 0 0;white-space:initial}.sky-selection-box .sky-selection-box-header{padding-top:3px}.sky-selection-box .sky-selection-box-control{flex:0 0 auto;padding-top:5px}:host-context(.sky-theme-modern) .sky-selection-box{padding:30px}:host-context(.sky-theme-modern) .sky-selection-box:hover{box-shadow:0 1px 3px #0000004d,inset 0 0 0 1px #1870b8}:host-context(.sky-theme-modern) .sky-selection-box:hover .sky-switch-control{border:solid 1px #1870B8}:host-context(.sky-theme-modern) .sky-selection-box:focus .sky-switch-input:not(:disabled):checked+.sky-switch-control{border:none}:host-context(.sky-theme-modern) .sky-selection-box:focus .sky-switch-control{outline:none;border:none;box-shadow:inset 0 0 0 2px #1870b8}:host-context(.sky-theme-modern) .sky-selection-box.sky-selection-box-selected,:host-context(.sky-theme-modern) .sky-selection-box:focus.sky-selection-box-selected{background:#e8f8ff;box-shadow:inset 0 0 0 2px #1870b8,0 1px 8px #0000004d,inset 6px 0 #0974a1}:host-context(.sky-theme-modern) .sky-selection-box.sky-selection-box-disabled .sky-selection-box-icon{background:#d2d2d2;color:#686c73}:host-context(.sky-theme-modern) .sky-selection-box .sky-selection-box-icon{color:#0974a1;background:#e8f8ff;margin:0 15px 0 0;border-radius:50%;width:42px;height:42px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}:host-context(.sky-theme-modern) .sky-selection-box .sky-selection-box-content{margin:0 30px 0 0}:host-context(.sky-theme-modern) .sky-selection-box .sky-selection-box-description{margin:3px 0 0}.sky-theme-modern .sky-selection-box{padding:30px}.sky-theme-modern .sky-selection-box:hover{box-shadow:0 1px 3px #0000004d,inset 0 0 0 1px #1870b8}.sky-theme-modern .sky-selection-box:hover .sky-switch-control{border:solid 1px #1870B8}.sky-theme-modern .sky-selection-box:focus .sky-switch-input:not(:disabled):checked+.sky-switch-control{border:none}.sky-theme-modern .sky-selection-box:focus .sky-switch-control{outline:none;border:none;box-shadow:inset 0 0 0 2px #1870b8}.sky-theme-modern .sky-selection-box.sky-selection-box-selected,.sky-theme-modern .sky-selection-box:focus.sky-selection-box-selected{background:#e8f8ff;box-shadow:inset 0 0 0 2px #1870b8,0 1px 8px #0000004d,inset 6px 0 #0974a1}.sky-theme-modern .sky-selection-box.sky-selection-box-disabled .sky-selection-box-icon{background:#d2d2d2;color:#686c73}.sky-theme-modern .sky-selection-box .sky-selection-box-icon{color:#0974a1;background:#e8f8ff;margin:0 15px 0 0;border-radius:50%;width:42px;height:42px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}.sky-theme-modern .sky-selection-box .sky-selection-box-content{margin:0 30px 0 0}.sky-theme-modern .sky-selection-box .sky-selection-box-description{margin:3px 0 0}\n"], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
83
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxComponent, decorators: [{
84
- type: Component,
85
- args: [{
86
- selector: 'sky-selection-box',
87
- styleUrls: ['./selection-box.component.scss'],
88
- templateUrl: './selection-box.component.html',
89
- changeDetection: ChangeDetectionStrategy.OnPush,
90
- encapsulation: ViewEncapsulation.None,
91
- }]
92
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.SkySelectionBoxAdapterService }]; }, propDecorators: { control: [{
93
- type: Input
94
- }], controlEl: [{
95
- type: ViewChild,
96
- args: ['control', {
97
- read: ElementRef,
98
- static: false,
99
- }]
100
- }], selectionBoxEl: [{
101
- type: ViewChild,
102
- args: ['selectionBox', {
103
- read: ElementRef,
104
- static: false,
105
- }]
106
- }] } });
107
- //# sourceMappingURL=selection-box.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selection-box.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/selection-box/selection-box.component.ts","../../../../../../../../libs/components/forms/src/lib/modules/selection-box/selection-box.component.html"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,KAAK,EAEL,SAAS,EACT,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;;;;;AAEhF;;GAEG;AAQH,MAAM,OAAO,wBAAwB;IAgDnC,YACU,cAAiC,EACjC,0BAAyD;QADzD,mBAAc,GAAd,cAAc,CAAmB;QACjC,+BAA0B,GAA1B,0BAA0B,CAA+B;QAR3D,kBAAa,GAAG,IAAI,OAAO,EAAQ,CAAC;IASzC,CAAC;IA3CJ,IAAW,OAAO,CAAC,KAAc;QAC/B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAW,QAAQ,CAAC,KAAc;QAChC,IAAI,CAAC,0BAA0B,CAAC,WAAW,CACzC,IAAI,CAAC,cAAc,EACnB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CACf,CAAC;QACF,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC;IACjC,CAAC;IAyBM,eAAe;QACpB,yFAAyF;QACzF,UAAU,CAAC,GAAG,EAAE;YACd,I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C,IAAI,CAAC,aAAa,CAAC,CAAC;aACnC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;YACnB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACxB,CAAC,CAAC,CAAC;IACP,CAAC;;sHA/GU,wBAAwB;0GAAxB,wBAAwB,0KA+B3B,UAAU,yGAMV,UAAU,6BCnEpB,s7CAqDA;4FDvBa,wBAAwB;kBAPpC,SAAS;mBAAC;oBACT,QAAQ,EAAE,mBAAmB;oBAC7B,SAAS,EAAE,CAAC,gCAAgC,CAAC;oBAC7C,WAAW,EAAE,gCAAgC;oBAC7C,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;oJAOQ,OAAO;sBADb,KAAK;gBA6BE,SAAS;sBAJhB,SAAS;uBAAC,SAAS,EAAE;wBACpB,IAAI,EAAE,UAAU;wBAChB,MAAM,EAAE,KAAK;qBACd;gBAOO,cAAc;sBAJrB,SAAS;uBAAC,cAAc,EAAE;wBACzB,IAAI,EAAE,UAAU;wBAChB,MAAM,EAAE,KAAK;qBACd","sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n OnDestroy,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyCheckboxComponent } from '../checkbox/checkbox.component';\nimport { SkyRadioComponent } from '../radio/radio.component';\n\nimport { SkySelectionBoxAdapterService } from './selection-box-adapter.service';\n\n/**\n * Creates a button to present users with a choice or question before proceeding with a one-time process.\n */\n@Component({\n selector: 'sky-selection-box',\n styleUrls: ['./selection-box.component.scss'],\n templateUrl: './selection-box.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class SkySelectionBoxComponent implements AfterViewInit, OnDestroy {\n /**\n * Specifies the radio button or checkbox to display in the selection box.\n * @required\n */\n @Input()\n public control: SkyCheckboxComponent | SkyRadioComponent;\n\n public set checked(value: boolean) {\n this._checked = value;\n this.changeDetector.markForCheck();\n }\n\n public get checked(): boolean {\n return this._checked;\n }\n\n public set disabled(value: boolean) {\n this.selectionBoxAdapterService.setTabIndex(\n this.selectionBoxEl,\n value ? -1 : 0\n );\n this._disabled = value;\n this.changeDetector.markForCheck();\n }\n\n public get disabled(): boolean {\n return this._disabled || false;\n }\n\n @ViewChild('control', {\n read: ElementRef,\n static: false,\n })\n private controlEl: ElementRef;\n\n @ViewChild('selectionBox', {\n read: ElementRef,\n static: false,\n })\n private selectionBoxEl: ElementRef;\n\n private ngUnsubscribe = new Subject<void>();\n\n private _checked: boolean;\n\n private _disabled: boolean;\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n private selectionBoxAdapterService: SkySelectionBoxAdapterService\n ) {}\n\n public ngAfterViewInit(): void {\n // Wait for consumer form controls to initialize before setting selected/disabled states.\n setTimeout(() => {\n this.selectionBoxAdapterService.setChildrenTabIndex(\n this.selectionBoxEl,\n -1\n );\n this.updateCheckedOnControlChange();\n this.updateDisabledState();\n });\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n /**\n * Since we are programatically firing a click on the control,\n * make sure user is not clicking on the control before firing click logic.\n */\n public onClick(event: any): void {\n const isControlClick = this.selectionBoxAdapterService.isDescendant(\n this.controlEl,\n event.target\n );\n if (!isControlClick) {\n this.selectControl();\n }\n }\n\n public onKeydown(event: KeyboardEvent): void {\n /* istanbul ignore else */\n if (event.key === ' ') {\n this.selectControl();\n event.preventDefault();\n }\n }\n\n private selectControl(): void {\n this.selectionBoxAdapterService.getControl(this.controlEl).click();\n this.selectionBoxAdapterService.focus(this.selectionBoxEl);\n }\n\n private updateCheckedOnControlChange(): void {\n this.control.checkedChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((value) => {\n this.checked = value;\n });\n }\n\n private updateDisabledState(): void {\n this.control.disabledChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((value) => {\n this.disabled = value;\n });\n }\n}\n","<div\n class=\"sky-selection-box sky-rounded-corners sky-btn sky-btn-default\"\n role=\"button\"\n tabindex=\"0\"\n [attr.disabled]=\"disabled ? true : null\"\n [ngClass]=\"{\n 'sky-selection-box-selected': checked,\n 'sky-selection-box-disabled': disabled\n }\"\n [skyThemeClass]=\"{\n 'sky-shadow': 'default',\n 'sky-box sky-elevation-1': 'modern'\n }\"\n (click)=\"onClick($event)\"\n (keydown)=\"onKeydown($event)\"\n #selectionBox\n>\n <div\n class=\"sky-selection-box-icon\"\n [ngStyle]=\"{\n display: !icon.innerHTML.trim() ? 'none' : ''\n }\"\n #icon\n >\n <ng-content select=\"sky-icon\"> </ng-content>\n </div>\n\n <div class=\"sky-selection-box-content\">\n <div\n class=\"sky-selection-box-header\"\n [ngClass]=\"{\n 'sky-font-heading-2': icon.innerHTML.trim(),\n 'sky-font-heading-3': !icon.innerHTML.trim()\n }\"\n >\n <ng-content select=\"sky-selection-box-header\"></ng-content>\n </div>\n <div\n class=\"sky-selection-box-description\"\n [skyThemeClass]=\"{\n 'sky-font-deemphasized': 'modern',\n 'sky-deemphasized': 'default'\n }\"\n >\n <ng-content select=\"sky-selection-box-description\"> </ng-content>\n </div>\n </div>\n\n <div class=\"sky-selection-box-control\" #control>\n <ng-content select=\"sky-radio\"> </ng-content>\n <ng-content select=\"sky-checkbox\"> </ng-content>\n </div>\n</div>\n"]}
@@ -1,40 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { NgModule } from '@angular/core';
3
- import { SkyThemeModule } from '@skyux/theme';
4
- import { SkySelectionBoxAdapterService } from './selection-box-adapter.service';
5
- import { SkySelectionBoxDescriptionComponent } from './selection-box-description.component';
6
- import { SkySelectionBoxGridComponent } from './selection-box-grid.component';
7
- import { SkySelectionBoxHeaderComponent } from './selection-box-header.component';
8
- import { SkySelectionBoxComponent } from './selection-box.component';
9
- import * as i0 from "@angular/core";
10
- export class SkySelectionBoxModule {
11
- }
12
- SkySelectionBoxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
13
- SkySelectionBoxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxModule, declarations: [SkySelectionBoxGridComponent,
14
- SkySelectionBoxComponent,
15
- SkySelectionBoxDescriptionComponent,
16
- SkySelectionBoxHeaderComponent], imports: [CommonModule, SkyThemeModule], exports: [SkySelectionBoxGridComponent,
17
- SkySelectionBoxComponent,
18
- SkySelectionBoxDescriptionComponent,
19
- SkySelectionBoxHeaderComponent] });
20
- SkySelectionBoxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxModule, providers: [SkySelectionBoxAdapterService], imports: [[CommonModule, SkyThemeModule]] });
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkySelectionBoxModule, decorators: [{
22
- type: NgModule,
23
- args: [{
24
- declarations: [
25
- SkySelectionBoxGridComponent,
26
- SkySelectionBoxComponent,
27
- SkySelectionBoxDescriptionComponent,
28
- SkySelectionBoxHeaderComponent,
29
- ],
30
- imports: [CommonModule, SkyThemeModule],
31
- exports: [
32
- SkySelectionBoxGridComponent,
33
- SkySelectionBoxComponent,
34
- SkySelectionBoxDescriptionComponent,
35
- SkySelectionBoxHeaderComponent,
36
- ],
37
- providers: [SkySelectionBoxAdapterService],
38
- }]
39
- }] });
40
- //# sourceMappingURL=selection-box.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selection-box.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/selection-box/selection-box.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;;AAkBrE,MAAM,OAAO,qBAAqB;;mHAArB,qBAAqB;oHAArB,qBAAqB,iBAd9B,4BAA4B;QAC5B,wBAAwB;QACxB,mCAAmC;QACnC,8BAA8B,aAEtB,YAAY,EAAE,cAAc,aAEpC,4BAA4B;QAC5B,wBAAwB;QACxB,mCAAmC;QACnC,8BAA8B;oHAIrB,qBAAqB,aAFrB,CAAC,6BAA6B,CAAC,YAPjC,CAAC,YAAY,EAAE,cAAc,CAAC;4FAS5B,qBAAqB;kBAhBjC,QAAQ;mBAAC;oBACR,YAAY,EAAE;wBACZ,4BAA4B;wBAC5B,wBAAwB;wBACxB,mCAAmC;wBACnC,8BAA8B;qBAC/B;oBACD,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,CAAC;oBACvC,OAAO,EAAE;wBACP,4BAA4B;wBAC5B,wBAAwB;wBACxB,mCAAmC;wBACnC,8BAA8B;qBAC/B;oBACD,SAAS,EAAE,CAAC,6BAA6B,CAAC;iBAC3C","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SkyThemeModule } from '@skyux/theme';\n\nimport { SkySelectionBoxAdapterService } from './selection-box-adapter.service';\nimport { SkySelectionBoxDescriptionComponent } from './selection-box-description.component';\nimport { SkySelectionBoxGridComponent } from './selection-box-grid.component';\nimport { SkySelectionBoxHeaderComponent } from './selection-box-header.component';\nimport { SkySelectionBoxComponent } from './selection-box.component';\n\n@NgModule({\n declarations: [\n SkySelectionBoxGridComponent,\n SkySelectionBoxComponent,\n SkySelectionBoxDescriptionComponent,\n SkySelectionBoxHeaderComponent,\n ],\n imports: [CommonModule, SkyThemeModule],\n exports: [\n SkySelectionBoxGridComponent,\n SkySelectionBoxComponent,\n SkySelectionBoxDescriptionComponent,\n SkySelectionBoxHeaderComponent,\n ],\n providers: [SkySelectionBoxAdapterService],\n})\nexport class SkySelectionBoxModule {}\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=selection-box-grid-align-items-type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selection-box-grid-align-items-type.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/forms/src/lib/modules/selection-box/types/selection-box-grid-align-items-type.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @internal\n */\nexport type SkySelectionBoxGridAlignItemsType = 'center' | 'left';\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=selection-box-grid-align-items.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selection-box-grid-align-items.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/forms/src/lib/modules/selection-box/types/selection-box-grid-align-items.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @internal\n * @deprecated Use `SkySelectionBoxGridAlignItemsType` instead.\n */\nexport const enum SkySelectionBoxGridAlignItems {\n /**\n * Center-aligns the selection boxes.\n */\n Center = 'center',\n\n /**\n * Left-aligns the selection boxes.\n */\n Left = 'left',\n}\n"]}
@@ -1,26 +0,0 @@
1
- // Need to add the following to classes which contain static methods.
2
- // See: https://github.com/ng-packagr/ng-packagr/issues/641
3
- // @dynamic
4
- export class SkyFormsUtility {
5
- /** Coerces a data-bound value (typically a string) to a boolean. */
6
- static coerceBooleanProperty(value) {
7
- return value !== undefined && `${value}` !== 'false';
8
- }
9
- /**
10
- * Gets the required state of the checkbox.
11
- * Currently, Angular doesn't offer a way to get this easily, so we have to create an empty
12
- * control using the current validator to see if it throws a `required` validation error.
13
- * https://github.com/angular/angular/issues/13461#issuecomment-340368046
14
- */
15
- static hasRequiredValidation(ngControl) {
16
- const abstractControl = ngControl.control;
17
- if (abstractControl && abstractControl.validator) {
18
- const validator = abstractControl.validator({});
19
- if (validator && validator.required) {
20
- return true;
21
- }
22
- }
23
- return false;
24
- }
25
- }
26
- //# sourceMappingURL=forms-utility.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forms-utility.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/shared/forms-utility.ts"],"names":[],"mappings":"AAEA,qEAAqE;AACrE,2DAA2D;AAC3D,WAAW;AACX,MAAM,OAAO,eAAe;IAC1B,oEAAoE;IAC7D,MAAM,CAAC,qBAAqB,CAAC,KAAU;QAC5C,OAAO,KAAK,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE,KAAK,OAAO,CAAC;IACvD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,qBAAqB,CAAC,SAAoB;QACtD,MAAM,eAAe,GAAG,SAAS,CAAC,OAA0B,CAAC;QAC7D,IAAI,eAAe,IAAI,eAAe,CAAC,SAAS,EAAE;YAChD,MAAM,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC,EAAqB,CAAC,CAAC;YACnE,IAAI,SAAS,IAAI,SAAS,CAAC,QAAQ,EAAE;gBACnC,OAAO,IAAI,CAAC;aACb;SACF;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["import { AbstractControl, NgControl } from '@angular/forms';\n\n// Need to add the following to classes which contain static methods.\n// See: https://github.com/ng-packagr/ng-packagr/issues/641\n// @dynamic\nexport class SkyFormsUtility {\n /** Coerces a data-bound value (typically a string) to a boolean. */\n public static coerceBooleanProperty(value: any): boolean {\n return value !== undefined && `${value}` !== 'false';\n }\n\n /**\n * Gets the required state of the checkbox.\n * Currently, Angular doesn't offer a way to get this easily, so we have to create an empty\n * control using the current validator to see if it throws a `required` validation error.\n * https://github.com/angular/angular/issues/13461#issuecomment-340368046\n */\n public static hasRequiredValidation(ngControl: NgControl): boolean {\n const abstractControl = ngControl.control as AbstractControl;\n if (abstractControl && abstractControl.validator) {\n const validator = abstractControl.validator({} as AbstractControl);\n if (validator && validator.required) {\n return true;\n }\n }\n return false;\n }\n}\n"]}
@@ -1,89 +0,0 @@
1
- /**
2
- * NOTICE: DO NOT MODIFY THIS FILE!
3
- * The contents of this file were automatically generated by
4
- * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-forms' schematic.
5
- * To update this file, simply rerun the command.
6
- */
7
- import { NgModule } from '@angular/core';
8
- import { SKY_LIB_RESOURCES_PROVIDERS, SkyI18nModule, getLibStringForLocale, } from '@skyux/i18n';
9
- import * as i0 from "@angular/core";
10
- const RESOURCES = {
11
- 'EN-US': {
12
- skyux_character_count_message: { message: 'characters out of' },
13
- skyux_character_count_over_limit: {
14
- message: 'You are over the character limit.',
15
- },
16
- skyux_file_attachment_button_label_choose_file: { message: 'Choose file' },
17
- skyux_file_attachment_button_label_replace_file: {
18
- message: 'Replace file',
19
- },
20
- skyux_file_attachment_file_item_delete: { message: 'Delete file' },
21
- skyux_file_attachment_file_size_b_plural: { message: '{0} bytes' },
22
- skyux_file_attachment_file_size_b_singular: { message: '{0} byte' },
23
- skyux_file_attachment_file_size_gb: { message: '{0} GB' },
24
- skyux_file_attachment_file_size_kb: { message: '{0} KB' },
25
- skyux_file_attachment_file_size_mb: { message: '{0} MB' },
26
- skyux_file_attachment_file_upload_drag_file_here: {
27
- message: 'Drag a file here',
28
- },
29
- skyux_file_attachment_file_upload_drag_or_click: {
30
- message: 'Drag a file here or click to browse',
31
- },
32
- skyux_file_attachment_file_upload_drop_files_here: {
33
- message: 'Drop files here',
34
- },
35
- skyux_file_attachment_file_upload_image_preview_alt_text: {
36
- message: 'Image preview',
37
- },
38
- skyux_file_attachment_file_upload_invalid_file: {
39
- message: 'This file type is invalid',
40
- },
41
- skyux_file_attachment_file_upload_link_input: {
42
- message: 'Add a link to a file',
43
- },
44
- skyux_file_attachment_file_upload_link_placeholder: {
45
- message: 'http://www.something.com/file',
46
- },
47
- skyux_file_attachment_file_upload_or_click_to_browse: {
48
- message: 'or click to browse',
49
- },
50
- skyux_file_attachment_file_upload_paste_link: {
51
- message: 'Paste a link to a file',
52
- },
53
- skyux_file_attachment_file_upload_paste_link_done: { message: 'Done' },
54
- skyux_file_attachment_label_no_file_chosen: { message: 'No file chosen' },
55
- },
56
- };
57
- export class SkyFormsResourcesProvider {
58
- getString(localeInfo, name) {
59
- return getLibStringForLocale(RESOURCES, localeInfo.locale, name);
60
- }
61
- }
62
- /**
63
- * Import into any component library module that needs to use resource strings.
64
- */
65
- export class SkyFormsResourcesModule {
66
- }
67
- SkyFormsResourcesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFormsResourcesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
68
- SkyFormsResourcesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFormsResourcesModule, exports: [SkyI18nModule] });
69
- SkyFormsResourcesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFormsResourcesModule, providers: [
70
- {
71
- provide: SKY_LIB_RESOURCES_PROVIDERS,
72
- useClass: SkyFormsResourcesProvider,
73
- multi: true,
74
- },
75
- ], imports: [SkyI18nModule] });
76
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyFormsResourcesModule, decorators: [{
77
- type: NgModule,
78
- args: [{
79
- exports: [SkyI18nModule],
80
- providers: [
81
- {
82
- provide: SKY_LIB_RESOURCES_PROVIDERS,
83
- useClass: SkyFormsResourcesProvider,
84
- multi: true,
85
- },
86
- ],
87
- }]
88
- }] });
89
- //# sourceMappingURL=sky-forms-resources.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sky-forms-resources.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/shared/sky-forms-resources.module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,2BAA2B,EAE3B,aAAa,EAGb,qBAAqB,GACtB,MAAM,aAAa,CAAC;;AAErB,MAAM,SAAS,GAA0C;IACvD,OAAO,EAAE;QACP,6BAA6B,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE;QAC/D,gCAAgC,EAAE;YAChC,OAAO,EAAE,mCAAmC;SAC7C;QACD,8CAA8C,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;QAC1E,+CAA+C,EAAE;YAC/C,OAAO,EAAE,cAAc;SACxB;QACD,sCAAsC,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;QAClE,wCAAwC,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;QAClE,0CAA0C,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;QACnE,kCAAkC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QACzD,kCAAkC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QACzD,kCAAkC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QACzD,gDAAgD,EAAE;YAChD,OAAO,EAAE,kBAAkB;SAC5B;QACD,+CAA+C,EAAE;YAC/C,OAAO,EAAE,qCAAqC;SAC/C;QACD,iDAAiD,EAAE;YACjD,OAAO,EAAE,iBAAiB;SAC3B;QACD,wDAAwD,EAAE;YACxD,OAAO,EAAE,eAAe;SACzB;QACD,8CAA8C,EAAE;YAC9C,OAAO,EAAE,2BAA2B;SACrC;QACD,4CAA4C,EAAE;YAC5C,OAAO,EAAE,sBAAsB;SAChC;QACD,kDAAkD,EAAE;YAClD,OAAO,EAAE,+BAA+B;SACzC;QACD,oDAAoD,EAAE;YACpD,OAAO,EAAE,oBAAoB;SAC9B;QACD,4CAA4C,EAAE;YAC5C,OAAO,EAAE,wBAAwB;SAClC;QACD,iDAAiD,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QACtE,0CAA0C,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;KAC1E;CACF,CAAC;AAEF,MAAM,OAAO,yBAAyB;IAC7B,SAAS,CACd,UAA4B,EAC5B,IAAY;QAEZ,OAAO,qBAAqB,CAAC,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACnE,CAAC;CACF;AAED;;GAEG;AAWH,MAAM,OAAO,uBAAuB;;qHAAvB,uBAAuB;sHAAvB,uBAAuB,YATxB,aAAa;sHASZ,uBAAuB,aARvB;QACT;YACE,OAAO,EAAE,2BAA2B;YACpC,QAAQ,EAAE,yBAAyB;YACnC,KAAK,EAAE,IAAI;SACZ;KACF,YAPS,aAAa;4FASZ,uBAAuB;kBAVnC,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,2BAA2B;4BACpC,QAAQ,EAAE,yBAAyB;4BACnC,KAAK,EAAE,IAAI;yBACZ;qBACF;iBACF","sourcesContent":["/**\n * NOTICE: DO NOT MODIFY THIS FILE!\n * The contents of this file were automatically generated by\n * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-forms' schematic.\n * To update this file, simply rerun the command.\n */\nimport { NgModule } from '@angular/core';\nimport {\n SKY_LIB_RESOURCES_PROVIDERS,\n SkyAppLocaleInfo,\n SkyI18nModule,\n SkyLibResources,\n SkyLibResourcesProvider,\n getLibStringForLocale,\n} from '@skyux/i18n';\n\nconst RESOURCES: { [locale: string]: SkyLibResources } = {\n 'EN-US': {\n skyux_character_count_message: { message: 'characters out of' },\n skyux_character_count_over_limit: {\n message: 'You are over the character limit.',\n },\n skyux_file_attachment_button_label_choose_file: { message: 'Choose file' },\n skyux_file_attachment_button_label_replace_file: {\n message: 'Replace file',\n },\n skyux_file_attachment_file_item_delete: { message: 'Delete file' },\n skyux_file_attachment_file_size_b_plural: { message: '{0} bytes' },\n skyux_file_attachment_file_size_b_singular: { message: '{0} byte' },\n skyux_file_attachment_file_size_gb: { message: '{0} GB' },\n skyux_file_attachment_file_size_kb: { message: '{0} KB' },\n skyux_file_attachment_file_size_mb: { message: '{0} MB' },\n skyux_file_attachment_file_upload_drag_file_here: {\n message: 'Drag a file here',\n },\n skyux_file_attachment_file_upload_drag_or_click: {\n message: 'Drag a file here or click to browse',\n },\n skyux_file_attachment_file_upload_drop_files_here: {\n message: 'Drop files here',\n },\n skyux_file_attachment_file_upload_image_preview_alt_text: {\n message: 'Image preview',\n },\n skyux_file_attachment_file_upload_invalid_file: {\n message: 'This file type is invalid',\n },\n skyux_file_attachment_file_upload_link_input: {\n message: 'Add a link to a file',\n },\n skyux_file_attachment_file_upload_link_placeholder: {\n message: 'http://www.something.com/file',\n },\n skyux_file_attachment_file_upload_or_click_to_browse: {\n message: 'or click to browse',\n },\n skyux_file_attachment_file_upload_paste_link: {\n message: 'Paste a link to a file',\n },\n skyux_file_attachment_file_upload_paste_link_done: { message: 'Done' },\n skyux_file_attachment_label_no_file_chosen: { message: 'No file chosen' },\n },\n};\n\nexport class SkyFormsResourcesProvider implements SkyLibResourcesProvider {\n public getString(\n localeInfo: SkyAppLocaleInfo,\n name: string\n ): string | undefined {\n return getLibStringForLocale(RESOURCES, localeInfo.locale, name);\n }\n}\n\n/**\n * Import into any component library module that needs to use resource strings.\n */\n@NgModule({\n exports: [SkyI18nModule],\n providers: [\n {\n provide: SKY_LIB_RESOURCES_PROVIDERS,\n useClass: SkyFormsResourcesProvider,\n multi: true,\n },\n ],\n})\nexport class SkyFormsResourcesModule {}\n"]}
@@ -1,18 +0,0 @@
1
- import { ChangeDetectionStrategy, Component } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * Specifies the label to display beside the toggle switch.
5
- */
6
- export class SkyToggleSwitchLabelComponent {
7
- }
8
- SkyToggleSwitchLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyToggleSwitchLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
9
- SkyToggleSwitchLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyToggleSwitchLabelComponent, selector: "sky-toggle-switch-label", ngImport: i0, template: "<ng-content></ng-content>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
10
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyToggleSwitchLabelComponent, decorators: [{
11
- type: Component,
12
- args: [{
13
- selector: 'sky-toggle-switch-label',
14
- templateUrl: './toggle-switch-label.component.html',
15
- changeDetection: ChangeDetectionStrategy.OnPush,
16
- }]
17
- }] });
18
- //# sourceMappingURL=toggle-switch-label.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toggle-switch-label.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/toggle-switch/toggle-switch-label.component.ts","../../../../../../../../libs/components/forms/src/lib/modules/toggle-switch/toggle-switch-label.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;AAEnE;;GAEG;AAMH,MAAM,OAAO,6BAA6B;;2HAA7B,6BAA6B;+GAA7B,6BAA6B,+DCV1C,6BACA;4FDSa,6BAA6B;kBALzC,SAAS;mBAAC;oBACT,QAAQ,EAAE,yBAAyB;oBACnC,WAAW,EAAE,sCAAsC;oBACnD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n/**\n * Specifies the label to display beside the toggle switch.\n */\n@Component({\n selector: 'sky-toggle-switch-label',\n templateUrl: './toggle-switch-label.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyToggleSwitchLabelComponent {}\n","<ng-content></ng-content>\n"]}
@@ -1,159 +0,0 @@
1
- import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChildren, EventEmitter, Input, Output, QueryList, forwardRef, } from '@angular/core';
2
- import { NG_VALIDATORS, NG_VALUE_ACCESSOR, } from '@angular/forms';
3
- import { Subject } from 'rxjs';
4
- import { takeUntil } from 'rxjs/operators';
5
- import { SkyToggleSwitchLabelComponent } from './toggle-switch-label.component';
6
- import * as i0 from "@angular/core";
7
- import * as i1 from "@angular/common";
8
- // tslint:disable:no-forward-ref no-use-before-declare
9
- const SKY_TOGGLE_SWITCH_CONTROL_VALUE_ACCESSOR = {
10
- provide: NG_VALUE_ACCESSOR,
11
- useExisting: forwardRef(() => SkyToggleSwitchComponent),
12
- multi: true,
13
- };
14
- const SKY_TOGGLE_SWITCH_VALIDATOR = {
15
- provide: NG_VALIDATORS,
16
- useExisting: forwardRef(() => SkyToggleSwitchComponent),
17
- multi: true,
18
- };
19
- // tslint:enable
20
- let uniqueId = 0;
21
- export class SkyToggleSwitchComponent {
22
- constructor(changeDetector) {
23
- this.changeDetector = changeDetector;
24
- /**
25
- * Indicates whether to disable the toggle switch.
26
- */
27
- this.disabled = false;
28
- /**
29
- * Specifies a tab index for the toggle switch. If not defined, the index is set to the position
30
- * of the toggle switch on load.
31
- */
32
- this.tabIndex = 0;
33
- /**
34
- * Fires when the checked state of a toggle switch changes.
35
- */
36
- this.toggleChange = new EventEmitter();
37
- this.enableIndicatorAnimation = false;
38
- this.isFirstChange = true;
39
- this.ngUnsubscribe = new Subject();
40
- this.toggleSwitchId = uniqueId++;
41
- this._checked = false;
42
- // eslint-disable-next-line @typescript-eslint/no-empty-function
43
- this.onTouched = () => { };
44
- // eslint-disable-next-line @typescript-eslint/no-empty-function
45
- this.onChange = () => { };
46
- }
47
- /**
48
- * Indicates whether the toggle switch is selected.
49
- * @default false
50
- */
51
- set checked(checked) {
52
- if (checked !== this.checked) {
53
- this._checked = checked;
54
- this.onChange(checked);
55
- // Do not mark the field as "dirty"
56
- // if the field has been initialized with a value.
57
- if (this.isFirstChange && this.control) {
58
- this.control.markAsPristine();
59
- this.isFirstChange = false;
60
- }
61
- }
62
- }
63
- get checked() {
64
- return this._checked || false;
65
- }
66
- get hasLabelComponent() {
67
- return this.labelComponents.length > 0;
68
- }
69
- get labelElementId() {
70
- return `sky-toggle-switch-label-${this.toggleSwitchId}`;
71
- }
72
- ngAfterContentInit() {
73
- this.labelComponents.changes
74
- .pipe(takeUntil(this.ngUnsubscribe))
75
- .subscribe(() => {
76
- // Allow the template to reload any ARIA attributes that are relying on the
77
- // label component existing in the DOM.
78
- this.changeDetector.markForCheck();
79
- });
80
- // Wait for the view to render before applying animation effects.
81
- // (Some browsers, such as Firefox, apply the animation too early.)
82
- setTimeout(() => {
83
- this.enableIndicatorAnimation = true;
84
- });
85
- }
86
- ngOnDestroy() {
87
- this.ngUnsubscribe.next();
88
- this.ngUnsubscribe.complete();
89
- }
90
- writeValue(value) {
91
- this.checked = !!value;
92
- this.changeDetector.markForCheck();
93
- }
94
- validate(control) {
95
- if (!this.control) {
96
- this.control = control;
97
- }
98
- return;
99
- }
100
- registerOnChange(fn) {
101
- this.onChange = fn;
102
- }
103
- registerOnTouched(fn) {
104
- this.onTouched = fn;
105
- }
106
- setDisabledState(disabled) {
107
- this.disabled = disabled;
108
- this.changeDetector.markForCheck();
109
- }
110
- onButtonClick(event) {
111
- event.stopPropagation();
112
- this.toggleChecked();
113
- this.emitChangeEvent();
114
- }
115
- onButtonBlur() {
116
- this.onTouched();
117
- }
118
- emitChangeEvent() {
119
- this.onChange(this._checked);
120
- this.toggleChange.emit({
121
- checked: this._checked,
122
- });
123
- }
124
- toggleChecked() {
125
- this.checked = !this.checked;
126
- }
127
- }
128
- SkyToggleSwitchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyToggleSwitchComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
129
- SkyToggleSwitchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyToggleSwitchComponent, selector: "sky-toggle-switch", inputs: { ariaLabel: "ariaLabel", checked: "checked", disabled: "disabled", tabIndex: "tabIndex" }, outputs: { toggleChange: "toggleChange" }, providers: [
130
- SKY_TOGGLE_SWITCH_CONTROL_VALUE_ACCESSOR,
131
- SKY_TOGGLE_SWITCH_VALIDATOR,
132
- ], queries: [{ propertyName: "labelComponents", predicate: SkyToggleSwitchLabelComponent }], ngImport: i0, template: "<span class=\"sky-toggle-switch\">\n <button\n class=\"sky-toggle-switch-button\"\n role=\"switch\"\n type=\"button\"\n [attr.aria-checked]=\"checked\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"hasLabelComponent ? labelElementId : null\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'sky-toggle-switch-checked': checked,\n 'sky-toggle-switch-disabled': disabled\n }\"\n [tabIndex]=\"tabIndex\"\n (blur)=\"onButtonBlur()\"\n (click)=\"onButtonClick($event)\"\n >\n <i\n aria-hidden=\"true\"\n class=\"sky-toggle-switch-indicator\"\n [ngClass]=\"{\n 'sky-toggle-switch-transition': enableIndicatorAnimation\n }\"\n role=\"presentation\"\n >&nbsp;</i\n >\n <!-- Non-breaking space needed to align switch to baseline! -->\n </button>\n\n <label\n *ngIf=\"hasLabelComponent\"\n class=\"sky-toggle-switch-label\"\n [attr.id]=\"labelElementId\"\n >\n <ng-container *ngTemplateOutlet=\"labelContent\"> </ng-container>\n </label>\n</span>\n\n<ng-template #labelContent>\n <ng-content select=\"sky-toggle-switch-label\"></ng-content>\n</ng-template>\n", styles: [".sky-toggle-switch{display:inline-flex;align-items:baseline}.sky-toggle-switch-button{border:1px solid #cdcfd2;background-color:#eeeeef;padding:1px;border-radius:24px;flex:1 0 46px;line-height:1.428571429}.sky-toggle-switch-button:hover:not(.sky-toggle-switch-disabled){border-color:#00b4f1;border-width:2px;padding:0;cursor:pointer}.sky-toggle-switch-button.sky-toggle-switch-checked{background-color:#c1e8fb;border-color:#00b4f1;border-width:2px;padding:0}.sky-toggle-switch-button.sky-toggle-switch-checked .sky-toggle-switch-indicator{left:100%}.sky-toggle-switch-button.sky-toggle-switch-disabled{background-color:#cdcfd2;border-color:transparent}.sky-toggle-switch-button.sky-toggle-switch-disabled .sky-toggle-switch-indicator{background-color:#eeeeef}.sky-toggle-switch-button+.sky-toggle-switch-label{margin-left:10px;flex:1 0 auto}.sky-toggle-switch-indicator{height:22px;width:22px;display:block;position:relative;top:0;left:22px;margin-left:-22px;border-radius:100%;box-shadow:0 1px 2px #000000bf;background-color:#fff}.sky-toggle-switch-indicator.sky-toggle-switch-transition{transition:left .15s}:host-context(.sky-theme-modern) .sky-toggle-switch-button{background-color:#fff;border-width:1px;flex-basis:48px;transition:border-color .15s,box-shadow .15s}:host-context(.sky-theme-modern) .sky-toggle-switch-button.sky-toggle-switch-disabled{border-color:#d2d2d2;cursor:not-allowed}:host-context(.sky-theme-modern) .sky-toggle-switch-button.sky-toggle-switch-disabled,:host-context(.sky-theme-modern) .sky-toggle-switch-button.sky-toggle-switch-disabled .sky-toggle-switch-indicator{background-color:#ededee}:host-context(.sky-theme-modern) .sky-toggle-switch-button.sky-toggle-switch-checked{padding:1px}:host-context(.sky-theme-modern) .sky-toggle-switch-button:not(.sky-toggle-switch-disabled).sky-toggle-switch-checked{background-color:#c1e8fb;border-color:#1870b8}:host-context(.sky-theme-modern) .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):active,:host-context(.sky-theme-modern) .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):focus{outline:none;border:solid 2px #1870B8;padding:0}:host-context(.sky-theme-modern) .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):not(:active):focus{box-shadow:0 1px 8px #0000004d}:host-context(.sky-theme-modern) .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):not(:active):hover:not(:focus){padding:1px;border:solid 1px #1870B8}:host-context(.sky-theme-modern) .sky-toggle-switch-indicator{box-shadow:0 1px 2px #00000080}.sky-theme-modern .sky-toggle-switch-button{background-color:#fff;border-width:1px;flex-basis:48px;transition:border-color .15s,box-shadow .15s}.sky-theme-modern .sky-toggle-switch-button.sky-toggle-switch-disabled{border-color:#d2d2d2;cursor:not-allowed}.sky-theme-modern .sky-toggle-switch-button.sky-toggle-switch-disabled,.sky-theme-modern .sky-toggle-switch-button.sky-toggle-switch-disabled .sky-toggle-switch-indicator{background-color:#ededee}.sky-theme-modern .sky-toggle-switch-button.sky-toggle-switch-checked{padding:1px}.sky-theme-modern .sky-toggle-switch-button:not(.sky-toggle-switch-disabled).sky-toggle-switch-checked{background-color:#c1e8fb;border-color:#1870b8}.sky-theme-modern .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):active,.sky-theme-modern .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):focus{outline:none;border:solid 2px #1870B8;padding:0}.sky-theme-modern .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):not(:active):focus{box-shadow:0 1px 8px #0000004d}.sky-theme-modern .sky-toggle-switch-button:not(.sky-toggle-switch-disabled):not(:active):hover:not(:focus){padding:1px;border:solid 1px #1870B8}.sky-theme-modern .sky-toggle-switch-indicator{box-shadow:0 1px 2px #00000080}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-toggle-switch-button{background-color:#121212}.sky-theme-modern.sky-theme-mode-dark .sky-toggle-switch-button{background-color:#121212}\n"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
133
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyToggleSwitchComponent, decorators: [{
134
- type: Component,
135
- args: [{
136
- selector: 'sky-toggle-switch',
137
- templateUrl: './toggle-switch.component.html',
138
- styleUrls: ['./toggle-switch.component.scss'],
139
- providers: [
140
- SKY_TOGGLE_SWITCH_CONTROL_VALUE_ACCESSOR,
141
- SKY_TOGGLE_SWITCH_VALIDATOR,
142
- ],
143
- changeDetection: ChangeDetectionStrategy.OnPush,
144
- }]
145
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { ariaLabel: [{
146
- type: Input
147
- }], checked: [{
148
- type: Input
149
- }], disabled: [{
150
- type: Input
151
- }], tabIndex: [{
152
- type: Input
153
- }], toggleChange: [{
154
- type: Output
155
- }], labelComponents: [{
156
- type: ContentChildren,
157
- args: [SkyToggleSwitchLabelComponent]
158
- }] } });
159
- //# sourceMappingURL=toggle-switch.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toggle-switch.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/forms/src/lib/modules/toggle-switch/toggle-switch.component.ts","../../../../../../../../libs/components/forms/src/lib/modules/toggle-switch/toggle-switch.component.html"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,YAAY,EACZ,KAAK,EAEL,MAAM,EACN,SAAS,EACT,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,aAAa,EACb,iBAAiB,GAGlB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;;;AAGhF,sDAAsD;AACtD,MAAM,wCAAwC,GAAQ;IACpD,OAAO,EAAE,iBAAiB;IAC1B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AAC,QAAiB;QACvC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;IAEM,aAAa,CAAC,KAAU;QAC7B,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAEM,YAAY;QACjB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAOO,eAAe;QACrB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;YACrB,OAAO,EAAE,IAAI,CAAC,QAAQ;SACvB,CAAC,CAAC;IACL,CAAC;IAEO,aAAa;QACnB,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;IAC/B,CAAC;;sHAlJU,wBAAwB;0GAAxB,wBAAwB,2LANxB;QACT,wCAAwC;QACxC,2BAA2B;KAC5B,0DAkEgB,6BAA6B,6BCpHhD,opCAyCA;4FDYa,wBAAwB;kBAVpC,SAAS;mBAAC;oBACT,QAAQ,EAAE,mBAAmB;oBAC7B,WAAW,EAAE,gCAAgC;oBAC7C,SAAS,EAAE,CAAC,gCAAgC,CAAC;oBAC7C,SAAS,EAAE;wBACT,wCAAwC;wBACxC,2BAA2B;qBAC5B;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;wGAUQ,SAAS;sBADf,KAAK;gBAQK,OAAO;sBADjB,KAAK;gBAuBC,QAAQ;sBADd,KAAK;gBAQC,QAAQ;sBADd,KAAK;gBAOC,YAAY;sBADlB,MAAM;gBAcC,eAAe;sBADtB,eAAe;uBAAC,6BAA6B","sourcesContent":["import {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n QueryList,\n forwardRef,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyToggleSwitchLabelComponent } from './toggle-switch-label.component';\nimport { SkyToggleSwitchChange } from './types/toggle-switch-change';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_TOGGLE_SWITCH_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyToggleSwitchComponent),\n multi: true,\n};\nconst SKY_TOGGLE_SWITCH_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyToggleSwitchComponent),\n multi: true,\n};\n// tslint:enable\n\nlet uniqueId = 0;\n\n@Component({\n selector: 'sky-toggle-switch',\n templateUrl: './toggle-switch.component.html',\n styleUrls: ['./toggle-switch.component.scss'],\n providers: [\n SKY_TOGGLE_SWITCH_CONTROL_VALUE_ACCESSOR,\n SKY_TOGGLE_SWITCH_VALIDATOR,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyToggleSwitchComponent\n implements AfterContentInit, OnDestroy, ControlValueAccessor, Validator\n{\n /**\n * Specifies an ARIA label for the toggle switch. This sets the toggle switch's `aria-label`\n * attribute [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).\n * If the `sky-toggle-switch-label` component displays a visible label, do not use this property.\n */\n @Input()\n public ariaLabel: string;\n\n /**\n * Indicates whether the toggle switch is selected.\n * @default false\n */\n @Input()\n public set checked(checked: boolean) {\n if (checked !== this.checked) {\n this._checked = checked;\n this.onChange(checked);\n\n // Do not mark the field as \"dirty\"\n // if the field has been initialized with a value.\n if (this.isFirstChange && this.control) {\n this.control.markAsPristine();\n this.isFirstChange = false;\n }\n }\n }\n\n public get checked(): boolean {\n return this._checked || false;\n }\n\n /**\n * Indicates whether to disable the toggle switch.\n */\n @Input()\n public disabled = false;\n\n /**\n * Specifies a tab index for the toggle switch. If not defined, the index is set to the position\n * of the toggle switch on load.\n */\n @Input()\n public tabIndex = 0;\n\n /**\n * Fires when the checked state of a toggle switch changes.\n */\n @Output()\n public toggleChange = new EventEmitter<SkyToggleSwitchChange>();\n\n public get hasLabelComponent(): boolean {\n return this.labelComponents.length > 0;\n }\n\n public enableIndicatorAnimation = false;\n\n public get labelElementId(): string {\n return `sky-toggle-switch-label-${this.toggleSwitchId}`;\n }\n\n @ContentChildren(SkyToggleSwitchLabelComponent)\n private labelComponents: QueryList<SkyToggleSwitchLabelComponent>;\n\n private control: AbstractControl;\n private isFirstChange = true;\n private ngUnsubscribe = new Subject<void>();\n private toggleSwitchId = uniqueId++;\n\n private _checked = false;\n\n constructor(private changeDetector: ChangeDetectorRef) {}\n\n public ngAfterContentInit(): void {\n this.labelComponents.changes\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n // Allow the template to reload any ARIA attributes that are relying on the\n // label component existing in the DOM.\n this.changeDetector.markForCheck();\n });\n\n // Wait for the view to render before applying animation effects.\n // (Some browsers, such as Firefox, apply the animation too early.)\n setTimeout(() => {\n this.enableIndicatorAnimation = true;\n });\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public writeValue(value: boolean): void {\n this.checked = !!value;\n this.changeDetector.markForCheck();\n }\n\n public validate(control: AbstractControl): ValidationErrors {\n if (!this.control) {\n this.control = control;\n }\n\n return;\n }\n\n public registerOnChange(fn: (value: any) => void) {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n public setDisabledState(disabled: boolean): void {\n this.disabled = disabled;\n this.changeDetector.markForCheck();\n }\n\n public onButtonClick(event: any): void {\n event.stopPropagation();\n this.toggleChecked();\n this.emitChangeEvent();\n }\n\n public onButtonBlur(): void {\n this.onTouched();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onTouched: () => any = () => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onChange: (value: any) => void = () => {};\n\n private emitChangeEvent(): void {\n this.onChange(this._checked);\n this.toggleChange.emit({\n checked: this._checked,\n });\n }\n\n private toggleChecked(): void {\n this.checked = !this.checked;\n }\n}\n","<span class=\"sky-toggle-switch\">\n <button\n class=\"sky-toggle-switch-button\"\n role=\"switch\"\n type=\"button\"\n [attr.aria-checked]=\"checked\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"hasLabelComponent ? labelElementId : null\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'sky-toggle-switch-checked': checked,\n 'sky-toggle-switch-disabled': disabled\n }\"\n [tabIndex]=\"tabIndex\"\n (blur)=\"onButtonBlur()\"\n (click)=\"onButtonClick($event)\"\n >\n <i\n aria-hidden=\"true\"\n class=\"sky-toggle-switch-indicator\"\n [ngClass]=\"{\n 'sky-toggle-switch-transition': enableIndicatorAnimation\n }\"\n role=\"presentation\"\n >&nbsp;</i\n >\n <!-- Non-breaking space needed to align switch to baseline! -->\n </button>\n\n <label\n *ngIf=\"hasLabelComponent\"\n class=\"sky-toggle-switch-label\"\n [attr.id]=\"labelElementId\"\n >\n <ng-container *ngTemplateOutlet=\"labelContent\"> </ng-container>\n </label>\n</span>\n\n<ng-template #labelContent>\n <ng-content select=\"sky-toggle-switch-label\"></ng-content>\n</ng-template>\n"]}