ng-primitives 0.0.7 → 0.2.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 (211) hide show
  1. package/README.md +14 -4
  2. package/accordion/accordion-trigger/accordion-trigger.directive.d.ts +2 -1
  3. package/autofill/README.md +3 -0
  4. package/autofill/autofill/autofill.directive.d.ts +19 -0
  5. package/{select/select-button/select-button.token.d.ts → autofill/autofill/autofill.token.d.ts} +4 -4
  6. package/autofill/index.d.ts +9 -0
  7. package/avatar/avatar/avatar.directive.d.ts +2 -1
  8. package/button/README.md +3 -0
  9. package/button/button/button.directive.d.ts +27 -0
  10. package/{select/select-option/select-option.token.d.ts → button/button/button.token.d.ts} +4 -4
  11. package/button/index.d.ts +9 -0
  12. package/checkbox/checkbox/checkbox.directive.d.ts +11 -61
  13. package/checkbox/index.d.ts +0 -4
  14. package/esm2022/a11y/visually-hidden/visually-hidden.directive.mjs +3 -3
  15. package/esm2022/accordion/accordion/accordion.directive.mjs +5 -4
  16. package/esm2022/accordion/accordion-content/accordion-content.directive.mjs +5 -6
  17. package/esm2022/accordion/accordion-item/accordion-item.directive.mjs +5 -5
  18. package/esm2022/accordion/accordion-trigger/accordion-trigger.directive.mjs +8 -5
  19. package/esm2022/autofill/autofill/autofill.directive.mjs +71 -0
  20. package/esm2022/autofill/autofill/autofill.token.mjs +16 -0
  21. package/esm2022/autofill/index.mjs +10 -0
  22. package/esm2022/autofill/ng-primitives-autofill.mjs +5 -0
  23. package/esm2022/avatar/avatar/avatar.directive.mjs +7 -4
  24. package/esm2022/avatar/avatar-fallback/avatar-fallback.directive.mjs +3 -3
  25. package/esm2022/avatar/avatar-image/avatar-image.directive.mjs +3 -3
  26. package/esm2022/button/button/button.directive.mjs +47 -0
  27. package/esm2022/button/button/button.token.mjs +16 -0
  28. package/esm2022/button/index.mjs +10 -0
  29. package/esm2022/button/ng-primitives-button.mjs +5 -0
  30. package/esm2022/checkbox/checkbox/checkbox.directive.mjs +29 -79
  31. package/esm2022/checkbox/index.mjs +1 -5
  32. package/esm2022/file-upload/file-upload/file-upload.directive.mjs +7 -4
  33. package/esm2022/focus-trap/focus-trap/focus-trap.directive.mjs +262 -0
  34. package/esm2022/focus-trap/focus-trap/focus-trap.token.mjs +16 -0
  35. package/esm2022/focus-trap/index.mjs +10 -0
  36. package/esm2022/focus-trap/ng-primitives-focus-trap.mjs +5 -0
  37. package/esm2022/form-field/description/description.directive.mjs +14 -14
  38. package/esm2022/form-field/error/error.directive.mjs +27 -29
  39. package/esm2022/form-field/form-control/form-control.directive.mjs +22 -16
  40. package/esm2022/form-field/form-field/form-field.directive.mjs +3 -3
  41. package/esm2022/form-field/form-field/form-field.token.mjs +3 -7
  42. package/esm2022/form-field/label/label.directive.mjs +56 -17
  43. package/esm2022/input/index.mjs +10 -0
  44. package/esm2022/input/input/input.directive.mjs +55 -0
  45. package/esm2022/input/input/input.token.mjs +16 -0
  46. package/esm2022/input/ng-primitives-input.mjs +5 -0
  47. package/esm2022/interactions/focus/focus.directive.mjs +15 -10
  48. package/esm2022/interactions/focus-visible/focus-visible.directive.mjs +12 -7
  49. package/esm2022/interactions/hover/hover.directive.mjs +16 -11
  50. package/esm2022/interactions/index.mjs +5 -1
  51. package/esm2022/interactions/move/move.directive.mjs +216 -0
  52. package/esm2022/interactions/move/move.token.mjs +16 -0
  53. package/esm2022/interactions/press/press.directive.mjs +118 -0
  54. package/esm2022/interactions/press/press.token.mjs +16 -0
  55. package/esm2022/internal/disabled/disabled.mjs +19 -0
  56. package/esm2022/internal/index.mjs +11 -0
  57. package/esm2022/internal/ng-primitives-internal.mjs +5 -0
  58. package/esm2022/internal/orientation/orientation.mjs +19 -0
  59. package/esm2022/internal/style-injector/style-injector.mjs +81 -0
  60. package/esm2022/progress/progress/progress.directive.mjs +3 -3
  61. package/esm2022/progress/progress-indicator/progress-indicator.directive.mjs +3 -3
  62. package/esm2022/radio/radio-group/radio-group.directive.mjs +14 -54
  63. package/esm2022/radio/radio-indicator/radio-indicator.directive.mjs +8 -5
  64. package/esm2022/radio/radio-item/radio-item.directive.mjs +8 -6
  65. package/esm2022/resize/resize/resize.directive.mjs +3 -3
  66. package/esm2022/roving-focus/roving-focus-group/roving-focus-group.directive.mjs +14 -9
  67. package/esm2022/roving-focus/roving-focus-item/roving-focus-item.directive.mjs +3 -3
  68. package/esm2022/search/index.mjs +10 -0
  69. package/esm2022/search/ng-primitives-search.mjs +5 -0
  70. package/esm2022/search/search-field/search-field.directive.mjs +47 -0
  71. package/esm2022/search/search-field/search-field.token.mjs +16 -0
  72. package/esm2022/select/index.mjs +1 -7
  73. package/esm2022/select/select/select.directive.mjs +23 -36
  74. package/esm2022/select/select/select.token.mjs +1 -1
  75. package/esm2022/slider/slider/slider.directive.mjs +18 -5
  76. package/esm2022/slider/slider-range/slider-range.directive.mjs +6 -5
  77. package/esm2022/slider/slider-thumb/slider-thumb.directive.mjs +7 -4
  78. package/esm2022/slider/slider-track/slider-track.directive.mjs +8 -4
  79. package/esm2022/switch/switch/switch.directive.mjs +18 -58
  80. package/esm2022/switch/switch-thumb/switch-thumb.directive.mjs +9 -6
  81. package/esm2022/tabs/tab-button/tab-button.directive.mjs +8 -6
  82. package/esm2022/tabs/tab-list/tab-list.directive.mjs +3 -3
  83. package/esm2022/tabs/tab-panel/tab-panel.directive.mjs +5 -6
  84. package/esm2022/tabs/tabset/tabset.directive.mjs +14 -18
  85. package/esm2022/textarea/index.mjs +10 -0
  86. package/esm2022/textarea/ng-primitives-textarea.mjs +5 -0
  87. package/esm2022/textarea/textarea/textarea.directive.mjs +37 -0
  88. package/esm2022/textarea/textarea/textarea.token.mjs +16 -0
  89. package/esm2022/toggle/toggle/toggle.directive.mjs +33 -13
  90. package/esm2022/tooltip/tooltip/tooltip.directive.mjs +3 -3
  91. package/esm2022/tooltip/tooltip-trigger/tooltip-trigger.directive.mjs +7 -7
  92. package/esm2022/utils/helpers/focus-manager.mjs +3 -3
  93. package/esm2022/utils/index.mjs +2 -2
  94. package/esm2022/utils/signals/async.mjs +11 -17
  95. package/fesm2022/ng-primitives-a11y.mjs +3 -3
  96. package/fesm2022/ng-primitives-accordion.mjs +19 -16
  97. package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
  98. package/fesm2022/ng-primitives-autofill.mjs +100 -0
  99. package/fesm2022/ng-primitives-autofill.mjs.map +1 -0
  100. package/fesm2022/ng-primitives-avatar.mjs +13 -10
  101. package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
  102. package/fesm2022/ng-primitives-button.mjs +76 -0
  103. package/fesm2022/ng-primitives-button.mjs.map +1 -0
  104. package/fesm2022/ng-primitives-checkbox.mjs +25 -203
  105. package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
  106. package/fesm2022/ng-primitives-file-upload.mjs +6 -3
  107. package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
  108. package/fesm2022/ng-primitives-focus-trap.mjs +291 -0
  109. package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -0
  110. package/fesm2022/ng-primitives-form-field.mjs +119 -80
  111. package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
  112. package/fesm2022/ng-primitives-input.mjs +84 -0
  113. package/fesm2022/ng-primitives-input.mjs.map +1 -0
  114. package/fesm2022/ng-primitives-interactions.mjs +394 -26
  115. package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
  116. package/fesm2022/ng-primitives-internal.mjs +132 -0
  117. package/fesm2022/ng-primitives-internal.mjs.map +1 -0
  118. package/fesm2022/ng-primitives-progress.mjs +6 -6
  119. package/fesm2022/ng-primitives-radio.mjs +25 -62
  120. package/fesm2022/ng-primitives-radio.mjs.map +1 -1
  121. package/fesm2022/ng-primitives-resize.mjs +3 -3
  122. package/fesm2022/ng-primitives-roving-focus.mjs +15 -10
  123. package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
  124. package/fesm2022/ng-primitives-search.mjs +76 -0
  125. package/fesm2022/ng-primitives-search.mjs.map +1 -0
  126. package/fesm2022/ng-primitives-select.mjs +23 -395
  127. package/fesm2022/ng-primitives-select.mjs.map +1 -1
  128. package/fesm2022/ng-primitives-slider.mjs +35 -14
  129. package/fesm2022/ng-primitives-slider.mjs.map +1 -1
  130. package/fesm2022/ng-primitives-switch.mjs +23 -62
  131. package/fesm2022/ng-primitives-switch.mjs.map +1 -1
  132. package/fesm2022/ng-primitives-tabs.mjs +27 -30
  133. package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
  134. package/fesm2022/ng-primitives-textarea.mjs +66 -0
  135. package/fesm2022/ng-primitives-textarea.mjs.map +1 -0
  136. package/fesm2022/ng-primitives-toggle.mjs +32 -12
  137. package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
  138. package/fesm2022/ng-primitives-tooltip.mjs +9 -9
  139. package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
  140. package/fesm2022/ng-primitives-utils.mjs +14 -20
  141. package/fesm2022/ng-primitives-utils.mjs.map +1 -1
  142. package/file-upload/file-upload/file-upload.directive.d.ts +2 -1
  143. package/focus-trap/README.md +3 -0
  144. package/focus-trap/focus-trap/focus-trap.directive.d.ts +64 -0
  145. package/{select/select-options/select-options.token.d.ts → focus-trap/focus-trap/focus-trap.token.d.ts} +4 -4
  146. package/focus-trap/index.d.ts +9 -0
  147. package/form-field/description/description.directive.d.ts +1 -1
  148. package/form-field/error/error.directive.d.ts +9 -5
  149. package/form-field/form-control/form-control.directive.d.ts +7 -3
  150. package/form-field/form-field/form-field.token.d.ts +1 -1
  151. package/form-field/label/label.directive.d.ts +3 -2
  152. package/input/README.md +3 -0
  153. package/input/index.d.ts +9 -0
  154. package/input/input/input.directive.d.ts +33 -0
  155. package/input/input/input.token.d.ts +14 -0
  156. package/interactions/focus/focus.directive.d.ts +6 -2
  157. package/interactions/focus-visible/focus-visible.directive.d.ts +5 -1
  158. package/interactions/hover/hover.directive.d.ts +5 -1
  159. package/interactions/index.d.ts +4 -0
  160. package/interactions/move/move.directive.d.ts +126 -0
  161. package/interactions/move/move.token.d.ts +14 -0
  162. package/interactions/press/press.directive.d.ts +59 -0
  163. package/interactions/press/press.token.d.ts +14 -0
  164. package/internal/README.md +3 -0
  165. package/internal/disabled/disabled.d.ts +21 -0
  166. package/internal/index.d.ts +10 -0
  167. package/internal/orientation/orientation.d.ts +22 -0
  168. package/internal/style-injector/style-injector.d.ts +36 -0
  169. package/package.json +49 -7
  170. package/radio/radio-group/radio-group.directive.d.ts +4 -41
  171. package/radio/radio-indicator/radio-indicator.directive.d.ts +2 -1
  172. package/radio/radio-item/radio-item.directive.d.ts +2 -1
  173. package/roving-focus/roving-focus-group/roving-focus-group.directive.d.ts +7 -2
  174. package/search/README.md +3 -0
  175. package/search/index.d.ts +9 -0
  176. package/search/search-field/search-field.directive.d.ts +15 -0
  177. package/search/search-field/search-field.token.d.ts +14 -0
  178. package/select/index.d.ts +0 -6
  179. package/select/select/select.directive.d.ts +7 -22
  180. package/select/select/select.token.d.ts +2 -2
  181. package/slider/slider/slider.directive.d.ts +4 -2
  182. package/slider/slider-thumb/slider-thumb.directive.d.ts +2 -1
  183. package/slider/slider-track/slider-track.directive.d.ts +1 -1
  184. package/switch/switch/switch.directive.d.ts +5 -45
  185. package/switch/switch-thumb/switch-thumb.directive.d.ts +2 -1
  186. package/tabs/tab-button/tab-button.directive.d.ts +2 -1
  187. package/tabs/tabset/tabset.directive.d.ts +3 -9
  188. package/textarea/README.md +3 -0
  189. package/textarea/index.d.ts +9 -0
  190. package/textarea/textarea/textarea.directive.d.ts +20 -0
  191. package/textarea/textarea/textarea.token.d.ts +14 -0
  192. package/toggle/toggle/toggle.directive.d.ts +16 -4
  193. package/utils/index.d.ts +1 -1
  194. package/utils/signals/async.d.ts +10 -12
  195. package/checkbox/checkbox-indicator/checkbox-indicator.directive.d.ts +0 -19
  196. package/checkbox/checkbox-indicator/checkbox-indicator.token.d.ts +0 -15
  197. package/checkbox/checkbox-input/checkbox-input.directive.d.ts +0 -10
  198. package/checkbox/checkbox-label/checkbox-label.directive.d.ts +0 -9
  199. package/esm2022/checkbox/checkbox-indicator/checkbox-indicator.directive.mjs +0 -51
  200. package/esm2022/checkbox/checkbox-indicator/checkbox-indicator.token.mjs +0 -17
  201. package/esm2022/checkbox/checkbox-input/checkbox-input.directive.mjs +0 -40
  202. package/esm2022/checkbox/checkbox-label/checkbox-label.directive.mjs +0 -32
  203. package/esm2022/select/select-button/select-button.directive.mjs +0 -84
  204. package/esm2022/select/select-button/select-button.token.mjs +0 -16
  205. package/esm2022/select/select-option/select-option.directive.mjs +0 -90
  206. package/esm2022/select/select-option/select-option.token.mjs +0 -16
  207. package/esm2022/select/select-options/select-options.directive.mjs +0 -157
  208. package/esm2022/select/select-options/select-options.token.mjs +0 -16
  209. package/select/select-button/select-button.directive.d.ts +0 -51
  210. package/select/select-option/select-option.directive.d.ts +0 -57
  211. package/select/select-options/select-options.directive.d.ts +0 -65
@@ -0,0 +1,76 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, inject, ElementRef, input, booleanAttribute, Directive } from '@angular/core';
3
+ import * as i1 from 'ng-primitives/interactions';
4
+ import { NgpHover, NgpFocusVisible, NgpPress } from 'ng-primitives/interactions';
5
+ import { NgpDisabledToken } from 'ng-primitives/internal';
6
+
7
+ /**
8
+ * Copyright © 2024 Angular Primitives.
9
+ * https://github.com/ng-primitives/ng-primitives
10
+ *
11
+ * This source code is licensed under the CC BY-ND 4.0 license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ */
14
+ const NgpButtonToken = new InjectionToken('NgpButtonToken');
15
+ /**
16
+ * Inject the Button directive instance
17
+ */
18
+ function injectButton() {
19
+ return inject(NgpButtonToken);
20
+ }
21
+
22
+ class NgpButton {
23
+ constructor() {
24
+ /**
25
+ * Get the native element of the button.
26
+ */
27
+ this.elementRef = inject(ElementRef);
28
+ /**
29
+ * Whether the button is disabled.
30
+ */
31
+ this.disabled = input(false, {
32
+ transform: booleanAttribute,
33
+ });
34
+ /**
35
+ * Detect if this is an HTML button element.
36
+ */
37
+ this.isButton = this.elementRef.nativeElement.tagName.toLowerCase() === 'button';
38
+ }
39
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgpButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
40
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.1.1", type: NgpButton, isStandalone: true, selector: "[ngpButton]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-disabled": "disabled()", "attr.disabled": "isButton && disabled() ? true : null" } }, providers: [
41
+ { provide: NgpButtonToken, useExisting: NgpButton },
42
+ { provide: NgpDisabledToken, useExisting: NgpButton },
43
+ ], exportAs: ["ngpButton"], hostDirectives: [{ directive: i1.NgpHover }, { directive: i1.NgpFocusVisible }, { directive: i1.NgpPress }], ngImport: i0 }); }
44
+ }
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgpButton, decorators: [{
46
+ type: Directive,
47
+ args: [{
48
+ standalone: true,
49
+ selector: '[ngpButton]',
50
+ exportAs: 'ngpButton',
51
+ providers: [
52
+ { provide: NgpButtonToken, useExisting: NgpButton },
53
+ { provide: NgpDisabledToken, useExisting: NgpButton },
54
+ ],
55
+ hostDirectives: [NgpHover, NgpFocusVisible, NgpPress],
56
+ host: {
57
+ '[attr.data-disabled]': 'disabled()',
58
+ '[attr.disabled]': 'isButton && disabled() ? true : null',
59
+ },
60
+ }]
61
+ }] });
62
+
63
+ /**
64
+ * Copyright © 2024 Angular Primitives.
65
+ * https://github.com/ng-primitives/ng-primitives
66
+ *
67
+ * This source code is licensed under the CC BY-ND 4.0 license found in the
68
+ * LICENSE file in the root directory of this source tree.
69
+ */
70
+
71
+ /**
72
+ * Generated bundle index. Do not edit.
73
+ */
74
+
75
+ export { NgpButton, NgpButtonToken };
76
+ //# sourceMappingURL=ng-primitives-button.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ng-primitives-button.mjs","sources":["../../../../packages/ng-primitives/button/src/button/button.token.ts","../../../../packages/ng-primitives/button/src/button/button.directive.ts","../../../../packages/ng-primitives/button/src/index.ts","../../../../packages/ng-primitives/button/src/ng-primitives-button.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpButton } from './button.directive';\n\nexport const NgpButtonToken = new InjectionToken<NgpButton>('NgpButtonToken');\n\n/**\n * Inject the Button directive instance\n */\nexport function injectButton(): NgpButton {\n return inject(NgpButtonToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, ElementRef, booleanAttribute, inject, input } from '@angular/core';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { NgpCanDisable, NgpDisabledToken } from 'ng-primitives/internal';\nimport { NgpButtonToken } from './button.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpButton]',\n exportAs: 'ngpButton',\n providers: [\n { provide: NgpButtonToken, useExisting: NgpButton },\n { provide: NgpDisabledToken, useExisting: NgpButton },\n ],\n hostDirectives: [NgpHover, NgpFocusVisible, NgpPress],\n host: {\n '[attr.data-disabled]': 'disabled()',\n '[attr.disabled]': 'isButton && disabled() ? true : null',\n },\n})\nexport class NgpButton implements NgpCanDisable {\n /**\n * Get the native element of the button.\n */\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Whether the button is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n transform: booleanAttribute,\n });\n\n /**\n * Detect if this is an HTML button element.\n */\n protected readonly isButton = this.elementRef.nativeElement.tagName.toLowerCase() === 'button';\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport { NgpButton } from './button/button.directive';\nexport { NgpButtonToken } from './button/button.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;MAIU,cAAc,GAAG,IAAI,cAAc,CAAY,gBAAgB,EAAE;AAE9E;;AAEG;SACa,YAAY,GAAA;AAC1B,IAAA,OAAO,MAAM,CAAC,cAAc,CAAC,CAAC;AAChC;;MCUa,SAAS,CAAA;AAdtB,IAAA,WAAA,GAAA;AAeE;;AAEG;AACc,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC;AAE1E;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC,CAAC;AAEH;;AAEG;AACgB,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC;AAChG,KAAA;8GAjBY,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAT,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,SAAS,EAVT,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAA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 from '@angular/core';
2
- import { InjectionToken, inject, input, numberAttribute, Directive, model, booleanAttribute, signal, computed, contentChild, HostListener } from '@angular/core';
2
+ import { InjectionToken, inject, input, model, booleanAttribute, Directive, HostListener } from '@angular/core';
3
+ import * as i1 from 'ng-primitives/form-field';
4
+ import { NgpFormControl } from 'ng-primitives/form-field';
5
+ import * as i2 from 'ng-primitives/interactions';
6
+ import { NgpHover, NgpFocusVisible, NgpPress } from 'ng-primitives/interactions';
7
+ import { NgpDisabledToken } from 'ng-primitives/internal';
3
8
  import { uniqueId } from 'ng-primitives/utils';
4
- import * as i1 from 'ng-primitives/a11y';
5
- import { NgpVisuallyHidden } from 'ng-primitives/a11y';
6
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
7
9
 
8
10
  /**
9
11
  * Copyright © 2024 Angular Primitives.
@@ -21,134 +23,13 @@ function injectCheckbox() {
21
23
  return inject(NgpCheckboxToken);
22
24
  }
23
25
 
24
- /**
25
- * Copyright © 2024 Angular Primitives.
26
- * https://github.com/ng-primitives/ng-primitives
27
- *
28
- * This source code is licensed under the CC BY-ND 4.0 license found in the
29
- * LICENSE file in the root directory of this source tree.
30
- */
31
- const NgpCheckboxIndicatorToken = new InjectionToken('NgpCheckboxIndicatorToken');
32
- /**
33
- * Inject the CheckboxIndicator directive instance
34
- * @returns The CheckboxIndicator directive instance
35
- */
36
- function injectCheckboxIndicator() {
37
- return inject(NgpCheckboxIndicatorToken);
38
- }
39
-
40
- /**
41
- * Copyright © 2024 Angular Primitives.
42
- * https://github.com/ng-primitives/ng-primitives
43
- *
44
- * This source code is licensed under the CC BY-ND 4.0 license found in the
45
- * LICENSE file in the root directory of this source tree.
46
- */
47
- class NgpCheckboxIndicator {
26
+ class NgpCheckbox {
48
27
  constructor() {
49
- /**
50
- * Access the checkbox that the indicator belongs to.
51
- */
52
- this.checkbox = injectCheckbox();
53
28
  /**
54
29
  * The id of the checkbox.
55
30
  * @internal
56
31
  */
57
- this.id = input(uniqueId('ngp-checkbox-indicator'));
58
- /**
59
- * The tabindex of the checkbox.
60
- * @internal
61
- */
62
- this.tabindex = input(0, { transform: numberAttribute });
63
- }
64
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: NgpCheckboxIndicator, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
65
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.0.2", type: NgpCheckboxIndicator, isStandalone: true, selector: "[ngpCheckboxIndicator]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "checkbox" }, properties: { "id": "id()", "tabindex": "checkbox.disabled() ? -1 : tabindex()", "style.pointer-events": "\"none\"", "attr.aria-checked": "checkbox.indeterminate() ? \"mixed\" : checkbox.checked()", "attr.data-state": "checkbox.state()", "attr.data-disabled": "checkbox.disabled()" } }, providers: [{ provide: NgpCheckboxIndicatorToken, useExisting: NgpCheckboxIndicator }], exportAs: ["ngpCheckboxIndicator"], ngImport: i0 }); }
66
- }
67
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: NgpCheckboxIndicator, decorators: [{
68
- type: Directive,
69
- args: [{
70
- standalone: true,
71
- selector: '[ngpCheckboxIndicator]',
72
- exportAs: 'ngpCheckboxIndicator',
73
- providers: [{ provide: NgpCheckboxIndicatorToken, useExisting: NgpCheckboxIndicator }],
74
- host: {
75
- role: 'checkbox',
76
- '[id]': 'id()',
77
- '[tabindex]': 'checkbox.disabled() ? -1 : tabindex()',
78
- '[style.pointer-events]': '"none"',
79
- '[attr.aria-checked]': 'checkbox.indeterminate() ? "mixed" : checkbox.checked()',
80
- '[attr.data-state]': 'checkbox.state()',
81
- '[attr.data-disabled]': 'checkbox.disabled()',
82
- },
83
- }]
84
- }] });
85
-
86
- /**
87
- * Copyright © 2024 Angular Primitives.
88
- * https://github.com/ng-primitives/ng-primitives
89
- *
90
- * This source code is licensed under the CC BY-ND 4.0 license found in the
91
- * LICENSE file in the root directory of this source tree.
92
- */
93
- class NgpCheckboxInput {
94
- constructor() {
95
- /**
96
- * Access the checkbox instance
97
- */
98
- this.checkbox = injectCheckbox();
99
- }
100
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: NgpCheckboxInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
101
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.2", type: NgpCheckboxInput, isStandalone: true, selector: "input[ngpCheckboxInput]", host: { attributes: { "type": "checkbox", "tabindex": "-1" }, properties: { "attr.aria-hidden": "true", "checked": "checkbox.checked()", "disabled": "checkbox.disabled()", "required": "checkbox.required()" } }, exportAs: ["ngpCheckboxInput"], hostDirectives: [{ directive: i1.NgpVisuallyHidden }], ngImport: i0 }); }
102
- }
103
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: NgpCheckboxInput, decorators: [{
104
- type: Directive,
105
- args: [{
106
- standalone: true,
107
- selector: 'input[ngpCheckboxInput]',
108
- exportAs: 'ngpCheckboxInput',
109
- hostDirectives: [NgpVisuallyHidden],
110
- host: {
111
- type: 'checkbox',
112
- tabindex: '-1',
113
- '[attr.aria-hidden]': 'true',
114
- '[checked]': 'checkbox.checked()',
115
- '[disabled]': 'checkbox.disabled()',
116
- '[required]': 'checkbox.required()',
117
- },
118
- }]
119
- }] });
120
-
121
- /**
122
- * Copyright © 2024 Angular Primitives.
123
- * https://github.com/ng-primitives/ng-primitives
124
- *
125
- * This source code is licensed under the CC BY-ND 4.0 license found in the
126
- * LICENSE file in the root directory of this source tree.
127
- */
128
- class NgpCheckboxLabel {
129
- constructor() {
130
- /**
131
- * Access the checkbox that the label belongs to.
132
- */
133
- this.checkbox = injectCheckbox();
134
- }
135
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: NgpCheckboxLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
136
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.2", type: NgpCheckboxLabel, isStandalone: true, selector: "[ngpCheckboxLabel]", host: { properties: { "attr.for": "checkbox.indicatorId()" } }, exportAs: ["ngpCheckboxLabel"], ngImport: i0 }); }
137
- }
138
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: NgpCheckboxLabel, decorators: [{
139
- type: Directive,
140
- args: [{
141
- standalone: true,
142
- selector: '[ngpCheckboxLabel]',
143
- exportAs: 'ngpCheckboxLabel',
144
- host: {
145
- '[attr.for]': 'checkbox.indicatorId()',
146
- },
147
- }]
148
- }] });
149
-
150
- class NgpCheckbox {
151
- constructor() {
32
+ this.id = input(uniqueId('ngp-checkbox'));
152
33
  /**
153
34
  * Defines whether the checkbox is checked.
154
35
  */
@@ -171,106 +52,50 @@ class NgpCheckbox {
171
52
  /**
172
53
  * Defines whether the checkbox is disabled.
173
54
  */
174
- this.inputDisabled = input(false, {
55
+ this.disabled = input(false, {
175
56
  alias: 'ngpCheckboxDisabled',
176
57
  transform: booleanAttribute,
177
58
  });
178
- /**
179
- * Whether the checkbox is disabled by the form.
180
- */
181
- this.formDisabled = signal(false);
182
- /**
183
- * Whether the checkbox is disabled.
184
- */
185
- this.disabled = computed(() => this.inputDisabled() || this.inputDisabled());
186
- /**
187
- * Determine the state
188
- * @returns 'checked' | 'unchecked' | 'indeterminate'
189
- */
190
- this.state = computed(() => {
191
- const checked = this.checked();
192
- if (this.indeterminate()) {
193
- return 'indeterminate';
194
- }
195
- return checked ? 'checked' : 'unchecked';
196
- });
197
- /**
198
- * Access the indicator instance
199
- * @internal
200
- */
201
- this.indicator = contentChild(NgpCheckboxIndicatorToken, { descendants: true });
202
- /**
203
- * Access the indicator id
204
- */
205
- this.indicatorId = computed(() => this.indicator()?.id() ?? null);
206
59
  }
207
60
  onEnter(event) {
208
61
  // According to WAI ARIA, Checkboxes don't activate on enter keypress
209
62
  event.preventDefault();
210
63
  }
211
64
  toggle(event) {
212
- if (this.disabled() || this.formDisabled()) {
65
+ if (this.disabled()) {
213
66
  return;
214
67
  }
215
68
  // prevent this firing twice in cases where the label is clicked and the checkbox is clicked by the one event
216
69
  event?.preventDefault();
217
70
  this.checked.set(this.indeterminate() ? true : !this.checked());
218
- this.onChange?.(this.checked());
219
71
  // if the checkbox was indeterminate, it isn't anymore
220
72
  if (this.indeterminate()) {
221
73
  this.indeterminate.set(false);
222
74
  }
223
75
  }
224
- onBlur() {
225
- this.onTouched?.();
226
- }
227
- /**
228
- * Sets the checked state of the checkbox.
229
- * @param checked The checked state of the checkbox.
230
- * @internal
231
- */
232
- writeValue(checked) {
233
- this.checked.set(checked);
234
- }
235
- /**
236
- * Registers a callback function that should be called when the checkbox checked state changes.
237
- * @param fn The callback function.
238
- * @internal
239
- */
240
- registerOnChange(fn) {
241
- this.onChange = fn;
242
- }
243
- /**
244
- * Registers a callback function that should be called when the checkbox is blurred.
245
- * @param fn The callback function.
246
- * @internal
247
- */
248
- registerOnTouched(fn) {
249
- this.onTouched = fn;
250
- }
251
- /**
252
- * Sets the disabled state of the checkbox.
253
- * @param isDisabled The disabled state of the checkbox.
254
- * @internal
255
- */
256
- setDisabledState(isDisabled) {
257
- this.formDisabled.set(isDisabled);
258
- }
259
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: NgpCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
260
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "18.0.2", type: NgpCheckbox, isStandalone: true, selector: "[ngpCheckbox]", inputs: { checked: { classPropertyName: "checked", publicName: "ngpCheckboxChecked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "ngpCheckboxIndeterminate", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "ngpCheckboxRequired", isSignal: true, isRequired: false, transformFunction: null }, inputDisabled: { classPropertyName: "inputDisabled", publicName: "ngpCheckboxDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "ngpCheckboxCheckedChange", indeterminate: "ngpCheckboxIndeterminateChange" }, host: { listeners: { "keydown.enter": "onEnter($event)", "click": "toggle($event)", "keydown.space": "toggle($event)", "blur": "onBlur()" } }, providers: [
76
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgpCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
77
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.1.1", type: NgpCheckbox, isStandalone: true, selector: "[ngpCheckbox]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "ngpCheckboxChecked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "ngpCheckboxIndeterminate", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "ngpCheckboxRequired", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpCheckboxDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "ngpCheckboxCheckedChange", indeterminate: "ngpCheckboxIndeterminateChange" }, host: { attributes: { "role": "checkbox" }, listeners: { "keydown.enter": "onEnter($event)", "click": "toggle($event)", "keydown.space": "toggle($event)" }, properties: { "attr.aria-checked": "indeterminate() ? \"mixed\" : checked()", "attr.data-checked": "checked()", "attr.data-indeterminate": "indeterminate()", "tabindex": "disabled() ? -1 : 0" } }, providers: [
261
78
  { provide: NgpCheckboxToken, useExisting: NgpCheckbox },
262
- { provide: NG_VALUE_ACCESSOR, useExisting: NgpCheckbox, multi: true },
263
- ], queries: [{ propertyName: "indicator", first: true, predicate: NgpCheckboxIndicatorToken, descendants: true, isSignal: true }], ngImport: i0 }); }
79
+ { provide: NgpDisabledToken, useExisting: NgpCheckbox },
80
+ ], hostDirectives: [{ directive: i1.NgpFormControl }, { directive: i2.NgpHover }, { directive: i2.NgpFocusVisible }, { directive: i2.NgpPress }], ngImport: i0 }); }
264
81
  }
265
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: NgpCheckbox, decorators: [{
82
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgpCheckbox, decorators: [{
266
83
  type: Directive,
267
84
  args: [{
268
85
  selector: '[ngpCheckbox]',
269
86
  standalone: true,
270
87
  providers: [
271
88
  { provide: NgpCheckboxToken, useExisting: NgpCheckbox },
272
- { provide: NG_VALUE_ACCESSOR, useExisting: NgpCheckbox, multi: true },
89
+ { provide: NgpDisabledToken, useExisting: NgpCheckbox },
273
90
  ],
91
+ hostDirectives: [NgpFormControl, NgpHover, NgpFocusVisible, NgpPress],
92
+ host: {
93
+ role: 'checkbox',
94
+ '[attr.aria-checked]': 'indeterminate() ? "mixed" : checked()',
95
+ '[attr.data-checked]': 'checked()',
96
+ '[attr.data-indeterminate]': 'indeterminate()',
97
+ '[tabindex]': 'disabled() ? -1 : 0',
98
+ },
274
99
  }]
275
100
  }], propDecorators: { onEnter: [{
276
101
  type: HostListener,
@@ -281,9 +106,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
281
106
  }, {
282
107
  type: HostListener,
283
108
  args: ['keydown.space', ['$event']]
284
- }], onBlur: [{
285
- type: HostListener,
286
- args: ['blur']
287
109
  }] } });
288
110
 
289
111
  /**
@@ -298,5 +120,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
298
120
  * Generated bundle index. Do not edit.
299
121
  */
300
122
 
301
- export { NgpCheckbox, NgpCheckboxIndicator, NgpCheckboxIndicatorToken, NgpCheckboxInput, NgpCheckboxLabel, NgpCheckboxToken };
123
+ export { NgpCheckbox, NgpCheckboxToken };
302
124
  //# sourceMappingURL=ng-primitives-checkbox.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-checkbox.mjs","sources":["../../../../packages/ng-primitives/checkbox/src/checkbox/checkbox.token.ts","../../../../packages/ng-primitives/checkbox/src/checkbox-indicator/checkbox-indicator.token.ts","../../../../packages/ng-primitives/checkbox/src/checkbox-indicator/checkbox-indicator.directive.ts","../../../../packages/ng-primitives/checkbox/src/checkbox-input/checkbox-input.directive.ts","../../../../packages/ng-primitives/checkbox/src/checkbox-label/checkbox-label.directive.ts","../../../../packages/ng-primitives/checkbox/src/checkbox/checkbox.directive.ts","../../../../packages/ng-primitives/checkbox/src/index.ts","../../../../packages/ng-primitives/checkbox/src/ng-primitives-checkbox.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpCheckbox } from './checkbox.directive';\n\nexport const NgpCheckboxToken = new InjectionToken<NgpCheckbox>('NgpCheckboxToken');\n\n/**\n * Inject the Checkbox directive instance\n * @returns The Checkbox directive instance\n */\nexport function injectCheckbox(): NgpCheckbox {\n return inject(NgpCheckboxToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpCheckboxIndicator } from './checkbox-indicator.directive';\n\nexport const NgpCheckboxIndicatorToken = new InjectionToken<NgpCheckboxIndicator>(\n 'NgpCheckboxIndicatorToken',\n);\n\n/**\n * Inject the CheckboxIndicator directive instance\n * @returns The CheckboxIndicator directive instance\n */\nexport function injectCheckboxIndicator(): NgpCheckboxIndicator {\n return inject(NgpCheckboxIndicatorToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Directive, input, numberAttribute } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectCheckbox } from '../checkbox/checkbox.token';\nimport { NgpCheckboxIndicatorToken } from './checkbox-indicator.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpCheckboxIndicator]',\n exportAs: 'ngpCheckboxIndicator',\n providers: [{ provide: NgpCheckboxIndicatorToken, useExisting: NgpCheckboxIndicator }],\n host: {\n role: 'checkbox',\n '[id]': 'id()',\n '[tabindex]': 'checkbox.disabled() ? -1 : tabindex()',\n '[style.pointer-events]': '\"none\"',\n '[attr.aria-checked]': 'checkbox.indeterminate() ? \"mixed\" : checkbox.checked()',\n '[attr.data-state]': 'checkbox.state()',\n '[attr.data-disabled]': 'checkbox.disabled()',\n },\n})\nexport class NgpCheckboxIndicator {\n /**\n * Access the checkbox that the indicator belongs to.\n */\n protected readonly checkbox = injectCheckbox();\n\n /**\n * The id of the checkbox.\n * @internal\n */\n readonly id = input(uniqueId('ngp-checkbox-indicator'));\n\n /**\n * The tabindex of the checkbox.\n * @internal\n */\n readonly tabindex = input(0, { transform: numberAttribute });\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Directive } from '@angular/core';\nimport { NgpVisuallyHidden } from 'ng-primitives/a11y';\nimport { injectCheckbox } from '../checkbox/checkbox.token';\n\n@Directive({\n standalone: true,\n selector: 'input[ngpCheckboxInput]',\n exportAs: 'ngpCheckboxInput',\n hostDirectives: [NgpVisuallyHidden],\n host: {\n type: 'checkbox',\n tabindex: '-1',\n '[attr.aria-hidden]': 'true',\n '[checked]': 'checkbox.checked()',\n '[disabled]': 'checkbox.disabled()',\n '[required]': 'checkbox.required()',\n },\n})\nexport class NgpCheckboxInput {\n /**\n * Access the checkbox instance\n */\n protected readonly checkbox = injectCheckbox();\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Directive } from '@angular/core';\nimport { injectCheckbox } from '../checkbox/checkbox.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpCheckboxLabel]',\n exportAs: 'ngpCheckboxLabel',\n host: {\n '[attr.for]': 'checkbox.indicatorId()',\n },\n})\nexport class NgpCheckboxLabel {\n /**\n * Access the checkbox that the label belongs to.\n */\n protected readonly checkbox = injectCheckbox();\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n Directive,\n HostListener,\n booleanAttribute,\n computed,\n contentChild,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { NgpCheckboxIndicatorToken } from '../checkbox-indicator/checkbox-indicator.token';\nimport { NgpCheckboxToken } from './checkbox.token';\n\n@Directive({\n selector: '[ngpCheckbox]',\n standalone: true,\n providers: [\n { provide: NgpCheckboxToken, useExisting: NgpCheckbox },\n { provide: NG_VALUE_ACCESSOR, useExisting: NgpCheckbox, multi: true },\n ],\n})\nexport class NgpCheckbox implements ControlValueAccessor {\n /**\n * Defines whether the checkbox is checked.\n */\n readonly checked = model<boolean>(false, {\n alias: 'ngpCheckboxChecked',\n });\n\n /**\n * Defines whether the checkbox is indeterminate.\n */\n readonly indeterminate = model<boolean>(false, {\n alias: 'ngpCheckboxIndeterminate',\n });\n\n /**\n * Whether the checkbox is required.\n */\n readonly required = input<boolean, BooleanInput>(false, {\n alias: 'ngpCheckboxRequired',\n transform: booleanAttribute,\n });\n\n /**\n * Defines whether the checkbox is disabled.\n */\n readonly inputDisabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpCheckboxDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the checkbox is disabled by the form.\n */\n private readonly formDisabled = signal<boolean>(false);\n\n /**\n * Whether the checkbox is disabled.\n */\n readonly disabled = computed<boolean>(() => this.inputDisabled() || this.inputDisabled());\n\n /**\n * Determine the state\n * @returns 'checked' | 'unchecked' | 'indeterminate'\n */\n readonly state = computed<'checked' | 'unchecked' | 'indeterminate'>(() => {\n const checked = this.checked();\n\n if (this.indeterminate()) {\n return 'indeterminate';\n }\n\n return checked ? 'checked' : 'unchecked';\n });\n\n /**\n * Access the indicator instance\n * @internal\n */\n protected readonly indicator = contentChild(NgpCheckboxIndicatorToken, { descendants: true });\n\n /**\n * Access the indicator id\n */\n readonly indicatorId = computed<string | null>(() => this.indicator()?.id() ?? null);\n\n /**\n * Store the callback function that should be called when the checkbox checked state changes.\n * @internal\n */\n private onChange?: (checked: boolean) => void;\n\n /**\n * Store the callback function that should be called when the checkbox is blurred.\n * @internal\n */\n private onTouched?: () => void;\n\n @HostListener('keydown.enter', ['$event'])\n protected onEnter(event: KeyboardEvent): void {\n // According to WAI ARIA, Checkboxes don't activate on enter keypress\n event.preventDefault();\n }\n\n @HostListener('click', ['$event'])\n @HostListener('keydown.space', ['$event'])\n toggle(event?: Event): void {\n if (this.disabled() || this.formDisabled()) {\n return;\n }\n\n // prevent this firing twice in cases where the label is clicked and the checkbox is clicked by the one event\n event?.preventDefault();\n\n this.checked.set(this.indeterminate() ? true : !this.checked());\n this.onChange?.(this.checked());\n\n // if the checkbox was indeterminate, it isn't anymore\n if (this.indeterminate()) {\n this.indeterminate.set(false);\n }\n }\n\n @HostListener('blur')\n protected onBlur(): void {\n this.onTouched?.();\n }\n\n /**\n * Sets the checked state of the checkbox.\n * @param checked The checked state of the checkbox.\n * @internal\n */\n writeValue(checked: boolean): void {\n this.checked.set(checked);\n }\n\n /**\n * Registers a callback function that should be called when the checkbox checked state changes.\n * @param fn The callback function.\n * @internal\n */\n registerOnChange(fn: (checked: boolean) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Registers a callback function that should be called when the checkbox is blurred.\n * @param fn The callback function.\n * @internal\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Sets the disabled state of the checkbox.\n * @param isDisabled The disabled state of the checkbox.\n * @internal\n */\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport { NgpCheckboxIndicator } from './checkbox-indicator/checkbox-indicator.directive';\nexport { NgpCheckboxIndicatorToken } from './checkbox-indicator/checkbox-indicator.token';\nexport { NgpCheckboxInput } from './checkbox-input/checkbox-input.directive';\nexport { NgpCheckboxLabel } from './checkbox-label/checkbox-label.directive';\nexport { NgpCheckbox } from './checkbox/checkbox.directive';\nexport { NgpCheckboxToken } from './checkbox/checkbox.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;AAMG;MAIU,gBAAgB,GAAG,IAAI,cAAc,CAAc,kBAAkB,EAAE;AAEpF;;;AAGG;SACa,cAAc,GAAA;AAC5B,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAClC;;AClBA;;;;;;AAMG;MAIU,yBAAyB,GAAG,IAAI,cAAc,CACzD,2BAA2B,EAC3B;AAEF;;;AAGG;SACa,uBA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/src/checkbox/checkbox.token.ts","../../../../packages/ng-primitives/checkbox/src/checkbox/checkbox.directive.ts","../../../../packages/ng-primitives/checkbox/src/index.ts","../../../../packages/ng-primitives/checkbox/src/ng-primitives-checkbox.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpCheckbox } from './checkbox.directive';\n\nexport const NgpCheckboxToken = new InjectionToken<NgpCheckbox>('NgpCheckboxToken');\n\n/**\n * Inject the Checkbox directive instance\n * @returns The Checkbox directive instance\n */\nexport function injectCheckbox(): NgpCheckbox {\n return inject(NgpCheckboxToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, HostListener, booleanAttribute, input, model } from '@angular/core';\nimport { NgpFormControl } from 'ng-primitives/form-field';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { NgpCanDisable, NgpDisabledToken } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { NgpCheckboxToken } from './checkbox.token';\n\n@Directive({\n selector: '[ngpCheckbox]',\n standalone: true,\n providers: [\n { provide: NgpCheckboxToken, useExisting: NgpCheckbox },\n { provide: NgpDisabledToken, useExisting: NgpCheckbox },\n ],\n hostDirectives: [NgpFormControl, NgpHover, NgpFocusVisible, NgpPress],\n host: {\n role: 'checkbox',\n '[attr.aria-checked]': 'indeterminate() ? \"mixed\" : checked()',\n '[attr.data-checked]': 'checked()',\n '[attr.data-indeterminate]': 'indeterminate()',\n '[tabindex]': 'disabled() ? -1 : 0',\n },\n})\nexport class NgpCheckbox implements NgpCanDisable {\n /**\n * The id of the checkbox.\n * @internal\n */\n readonly id = input(uniqueId('ngp-checkbox'));\n\n /**\n * Defines whether the checkbox is checked.\n */\n readonly checked = model<boolean>(false, {\n alias: 'ngpCheckboxChecked',\n });\n\n /**\n * Defines whether the checkbox is indeterminate.\n */\n readonly indeterminate = model<boolean>(false, {\n alias: 'ngpCheckboxIndeterminate',\n });\n\n /**\n * Whether the checkbox is required.\n */\n readonly required = input<boolean, BooleanInput>(false, {\n alias: 'ngpCheckboxRequired',\n transform: booleanAttribute,\n });\n\n /**\n * Defines whether the checkbox is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpCheckboxDisabled',\n transform: booleanAttribute,\n });\n\n @HostListener('keydown.enter', ['$event'])\n protected onEnter(event: KeyboardEvent): void {\n // According to WAI ARIA, Checkboxes don't activate on enter keypress\n event.preventDefault();\n }\n\n @HostListener('click', ['$event'])\n @HostListener('keydown.space', ['$event'])\n toggle(event?: Event): void {\n if (this.disabled()) {\n return;\n }\n\n // prevent this firing twice in cases where the label is clicked and the checkbox is clicked by the one event\n event?.preventDefault();\n\n this.checked.set(this.indeterminate() ? true : !this.checked());\n\n // if the checkbox was indeterminate, it isn't anymore\n if (this.indeterminate()) {\n this.indeterminate.set(false);\n }\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport { NgpCheckbox } from './checkbox/checkbox.directive';\nexport { NgpCheckboxToken } from './checkbox/checkbox.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;AAMG;MAIU,gBAAgB,GAAG,IAAI,cAAc,CAAc,kBAAkB,EAAE;AAEpF;;;AAGG;SACa,cAAc,GAAA;AAC5B,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAClC;;MCaa,WAAW,CAAA;AAh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,EAAA,CAAA;sBADhB,YAAY;uBAAC,eAAe,EAAE,CAAC,QAAQ,CAAC,CAAA;gBAQzC,MAAM,EAAA,CAAA;sBAFL,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAA;;sBAChC,YAAY;uBAAC,eAAe,EAAE,CAAC,QAAQ,CAAC,CAAA;;;AC3E3C;;;;;;AAMG;;ACNH;;AAEG;;;;"}
@@ -1,6 +1,8 @@
1
1
  import { coerceStringArray } from '@angular/cdk/coercion';
2
2
  import * as i0 from '@angular/core';
3
3
  import { InjectionToken, inject, ElementRef, input, booleanAttribute, output, signal, Directive, HostListener } from '@angular/core';
4
+ import * as i1 from 'ng-primitives/interactions';
5
+ import { NgpHover, NgpFocusVisible, NgpPress } from 'ng-primitives/interactions';
4
6
 
5
7
  /**
6
8
  * Copyright © 2024 Angular Primitives.
@@ -141,10 +143,10 @@ class NgpFileUpload {
141
143
  this.selected.emit(event.dataTransfer.files);
142
144
  }
143
145
  }
144
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: NgpFileUpload, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
145
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.0.2", type: NgpFileUpload, isStandalone: true, selector: "[ngpFileUpload]", inputs: { fileTypes: { classPropertyName: "fileTypes", publicName: "ngpFileUploadFileTypes", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "ngpFileUploadMultiple", isSignal: true, isRequired: false, transformFunction: null }, directory: { classPropertyName: "directory", publicName: "ngpFileUploadDirectory", isSignal: true, isRequired: false, transformFunction: null }, dragAndDrop: { classPropertyName: "dragAndDrop", publicName: "ngpFileUploadDragDrop", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpFileUploadDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "ngpFileUploadSelected", dragOver: "ngpFileUploadDragOver" }, host: { listeners: { "click": "showFileDialog()", "dragenter": "onDragEnter($event)", "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDrop($event)" }, properties: { "attr.data-disabled": "disabled()", "attr.data-dragover": "isDragOver()" } }, providers: [{ provide: NgpFileUploadToken, useExisting: NgpFileUpload }], exportAs: ["ngpFileUpload"], ngImport: i0 }); }
146
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgpFileUpload, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
147
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.1.1", type: NgpFileUpload, isStandalone: true, selector: "[ngpFileUpload]", inputs: { fileTypes: { classPropertyName: "fileTypes", publicName: "ngpFileUploadFileTypes", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "ngpFileUploadMultiple", isSignal: true, isRequired: false, transformFunction: null }, directory: { classPropertyName: "directory", publicName: "ngpFileUploadDirectory", isSignal: true, isRequired: false, transformFunction: null }, dragAndDrop: { classPropertyName: "dragAndDrop", publicName: "ngpFileUploadDragDrop", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpFileUploadDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "ngpFileUploadSelected", dragOver: "ngpFileUploadDragOver" }, host: { listeners: { "click": "showFileDialog()", "dragenter": "onDragEnter($event)", "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDrop($event)" }, properties: { "attr.data-disabled": "disabled()", "attr.data-dragover": "isDragOver()" } }, providers: [{ provide: NgpFileUploadToken, useExisting: NgpFileUpload }], exportAs: ["ngpFileUpload"], hostDirectives: [{ directive: i1.NgpHover }, { directive: i1.NgpFocusVisible }, { directive: i1.NgpPress }], ngImport: i0 }); }
146
148
  }
147
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: NgpFileUpload, decorators: [{
149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgpFileUpload, decorators: [{
148
150
  type: Directive,
149
151
  args: [{
150
152
  standalone: true,
@@ -155,6 +157,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
155
157
  '[attr.data-disabled]': 'disabled()',
156
158
  '[attr.data-dragover]': 'isDragOver()',
157
159
  },
160
+ hostDirectives: [NgpHover, NgpFocusVisible, NgpPress],
158
161
  }]
159
162
  }], ctorParameters: () => [], propDecorators: { showFileDialog: [{
160
163
  type: HostListener,
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-file-upload.mjs","sources":["../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload.token.ts","../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload.directive.ts","../../../../packages/ng-primitives/file-upload/src/index.ts","../../../../packages/ng-primitives/file-upload/src/ng-primitives-file-upload.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpFileUpload } from './file-upload.directive';\n\nexport const NgpFileUploadToken = new InjectionToken<NgpFileUpload>('NgpFileUploadToken');\n\n/**\n * Inject the FileUpload directive instance\n */\nexport function injectFileUpload(): NgpFileUpload {\n return inject(NgpFileUploadToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport {\n Directive,\n ElementRef,\n HostListener,\n booleanAttribute,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { NgpFileUploadToken } from './file-upload.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpFileUpload]',\n exportAs: 'ngpFileUpload',\n providers: [{ provide: NgpFileUploadToken, useExisting: NgpFileUpload }],\n host: {\n '[attr.data-disabled]': 'disabled()',\n '[attr.data-dragover]': 'isDragOver()',\n },\n})\nexport class NgpFileUpload {\n /**\n * Access the host element.\n */\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The accepted file types.\n */\n readonly fileTypes = input<string[] | undefined, string>(undefined, {\n alias: 'ngpFileUploadFileTypes',\n transform: coerceStringArray,\n });\n\n /**\n * Whether to allow multiple files to be selected.\n */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadMultiple',\n transform: booleanAttribute,\n });\n\n /**\n * Whether to allow the user to select directories.\n */\n readonly directory = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadDirectory',\n transform: booleanAttribute,\n });\n\n /**\n * Whether drag-and-drop is enabled.\n */\n readonly dragAndDrop = input<boolean, BooleanInput>(true, {\n alias: 'ngpFileUploadDragDrop',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the file upload is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emits when the user selects files.\n */\n readonly selected = output<FileList | null>({\n alias: 'ngpFileUploadSelected',\n });\n\n /**\n * Emits when the user drags a file over the file upload.\n */\n readonly dragOver = output<boolean>({\n alias: 'ngpFileUploadDragOver',\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n private readonly isDragOver = signal<boolean>(false);\n\n /**\n * Store the file input element.\n */\n private input: HTMLInputElement = document.createElement('input');\n\n constructor() {\n this.input.type = 'file';\n this.input.addEventListener('change', () => this.selected.emit(this.input.files));\n }\n\n @HostListener('click')\n protected showFileDialog(): void {\n if (this.disabled()) {\n return;\n }\n\n const fileTypes = this.fileTypes()?.join(',');\n\n if (fileTypes) {\n this.input.accept = fileTypes;\n }\n\n this.input.multiple = this.multiple();\n this.input.webkitdirectory = this.directory();\n this.input.click();\n }\n\n @HostListener('dragenter', ['$event'])\n protected onDragEnter(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(true);\n this.dragOver.emit(true);\n }\n\n @HostListener('dragover', ['$event'])\n protected onDragOver(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n this.isDragOver.set(true);\n }\n\n @HostListener('dragleave', ['$event'])\n protected onDragLeave(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop() || !this.isDragOver()) {\n return;\n }\n\n // if the element we are dragging over is a child of the file upload, ignore the event\n if (this.elementRef.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n }\n\n @HostListener('drop', ['$event'])\n protected onDrop(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop()) {\n return;\n }\n\n event.preventDefault();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n\n if (event.dataTransfer?.files) {\n this.selected.emit(event.dataTransfer.files);\n }\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nexport { NgpFileUpload } from './file-upload/file-upload.directive';\nexport { NgpFileUploadToken, injectFileUpload } from './file-upload/file-upload.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;;;;;AAMG;MAIU,kBAAkB,GAAG,IAAI,cAAc,CAAgB,oBAAoB,EAAE;AAE1F;;AAEG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,kBAAkB,CAAC,CAA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ANb,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAM7D,aAAa,EAAA,UAAA,EAAA,CAAA;kBAVzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,eAAe;oBACzB,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAe,aAAA,EAAE,CAAC;AACxE,oBAAA,IAAI,EAAE;AACJ,wBAAA,sBAAsB,EAAE,YAAY;AACpC,wBAAA,sBAAsB,EAAE,cAAc;AACvC,qBAAA;AACF,iBAAA,CAAA;wDA6EW,cAAc,EAAA,CAAA;sBADvB,YAAY;uBAAC,OAAO,CAAA;gBAkBX,WAAW,EAAA,CAAA;sBADpB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAA;gBAa3B,UAAU,EAAA,CAAA;sBADnB,YAAY;uBAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,CAAA;gBAY1B,WAAW,EAAA,CAAA;sBADpB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAA;gBAkB3B,MAAM,EAAA,CAAA;sBADf,YAAY;uBAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAA;;;AClKlC;;;;;;AAMG;;ACNH;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-file-upload.mjs","sources":["../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload.token.ts","../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload.directive.ts","../../../../packages/ng-primitives/file-upload/src/index.ts","../../../../packages/ng-primitives/file-upload/src/ng-primitives-file-upload.ts"],"sourcesContent":["/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { InjectionToken, inject } from '@angular/core';\nimport type { NgpFileUpload } from './file-upload.directive';\n\nexport const NgpFileUploadToken = new InjectionToken<NgpFileUpload>('NgpFileUploadToken');\n\n/**\n * Inject the FileUpload directive instance\n */\nexport function injectFileUpload(): NgpFileUpload {\n return inject(NgpFileUploadToken);\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport {\n Directive,\n ElementRef,\n HostListener,\n booleanAttribute,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { NgpFocusVisible, NgpHover, NgpPress } from 'ng-primitives/interactions';\nimport { NgpFileUploadToken } from './file-upload.token';\n\n@Directive({\n standalone: true,\n selector: '[ngpFileUpload]',\n exportAs: 'ngpFileUpload',\n providers: [{ provide: NgpFileUploadToken, useExisting: NgpFileUpload }],\n host: {\n '[attr.data-disabled]': 'disabled()',\n '[attr.data-dragover]': 'isDragOver()',\n },\n hostDirectives: [NgpHover, NgpFocusVisible, NgpPress],\n})\nexport class NgpFileUpload {\n /**\n * Access the host element.\n */\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The accepted file types.\n */\n readonly fileTypes = input<string[] | undefined, string>(undefined, {\n alias: 'ngpFileUploadFileTypes',\n transform: coerceStringArray,\n });\n\n /**\n * Whether to allow multiple files to be selected.\n */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadMultiple',\n transform: booleanAttribute,\n });\n\n /**\n * Whether to allow the user to select directories.\n */\n readonly directory = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadDirectory',\n transform: booleanAttribute,\n });\n\n /**\n * Whether drag-and-drop is enabled.\n */\n readonly dragAndDrop = input<boolean, BooleanInput>(true, {\n alias: 'ngpFileUploadDragDrop',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the file upload is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileUploadDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emits when the user selects files.\n */\n readonly selected = output<FileList | null>({\n alias: 'ngpFileUploadSelected',\n });\n\n /**\n * Emits when the user drags a file over the file upload.\n */\n readonly dragOver = output<boolean>({\n alias: 'ngpFileUploadDragOver',\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n private readonly isDragOver = signal<boolean>(false);\n\n /**\n * Store the file input element.\n */\n private input: HTMLInputElement = document.createElement('input');\n\n constructor() {\n this.input.type = 'file';\n this.input.addEventListener('change', () => this.selected.emit(this.input.files));\n }\n\n @HostListener('click')\n protected showFileDialog(): void {\n if (this.disabled()) {\n return;\n }\n\n const fileTypes = this.fileTypes()?.join(',');\n\n if (fileTypes) {\n this.input.accept = fileTypes;\n }\n\n this.input.multiple = this.multiple();\n this.input.webkitdirectory = this.directory();\n this.input.click();\n }\n\n @HostListener('dragenter', ['$event'])\n protected onDragEnter(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(true);\n this.dragOver.emit(true);\n }\n\n @HostListener('dragover', ['$event'])\n protected onDragOver(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n this.isDragOver.set(true);\n }\n\n @HostListener('dragleave', ['$event'])\n protected onDragLeave(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop() || !this.isDragOver()) {\n return;\n }\n\n // if the element we are dragging over is a child of the file upload, ignore the event\n if (this.elementRef.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n }\n\n @HostListener('drop', ['$event'])\n protected onDrop(event: DragEvent): void {\n if (this.disabled() || !this.dragAndDrop()) {\n return;\n }\n\n event.preventDefault();\n this.isDragOver.set(false);\n this.dragOver.emit(false);\n\n if (event.dataTransfer?.files) {\n this.selected.emit(event.dataTransfer.files);\n }\n }\n}\n","/**\n * Copyright © 2024 Angular Primitives.\n * https://github.com/ng-primitives/ng-primitives\n *\n * This source code is licensed under the CC BY-ND 4.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nexport { NgpFileUpload } from './file-upload/file-upload.directive';\nexport { NgpFileUploadToken, injectFileUpload } from './file-upload/file-upload.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;MAIU,kBAAkB,GAAG,IAAI,cAAc,CAAgB,oBAAoB,EAAE;AAE1F;;AAEG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,kBAAkB,CAAC,CAAC;AACpC;;ACjBA;;;;;;AAMG;MA0BU,aAAa,CAAA;AAsExB,IAAA,WAAA,GAAA;AArEA;;AAEG;AACc,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC,CAAC;AAE1E;;AAEG;AACM,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAA+B,SAAS,EAAE;AAClE,YAAA,KAAK,EAAE,wBAAwB;AAC/B,YAAA,SAAS,EAAE,iBAAiB;AAC7B,SAAA,CAAC,CAAC;AAEH;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,KAAK,EAAE,uBAAuB;AAC9B,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC,CAAC;AAEH;;AAEG;AACM,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAwB,KAAK,EAAE;AACvD,YAAA,KAAK,EAAE,wBAAwB;AAC/B,YAAA,SAA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