ng-primitives 0.120.4 → 0.121.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 (147) hide show
  1. package/example-theme/index.css +9 -0
  2. package/fesm2022/ng-primitives-a11y.mjs +5 -5
  3. package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
  4. package/fesm2022/ng-primitives-accordion.mjs +34 -51
  5. package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
  6. package/fesm2022/ng-primitives-ai.mjs +39 -52
  7. package/fesm2022/ng-primitives-ai.mjs.map +1 -1
  8. package/fesm2022/ng-primitives-autofill.mjs +4 -4
  9. package/fesm2022/ng-primitives-autofill.mjs.map +1 -1
  10. package/fesm2022/ng-primitives-avatar.mjs +14 -17
  11. package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
  12. package/fesm2022/ng-primitives-breadcrumbs.mjs +21 -21
  13. package/fesm2022/ng-primitives-breadcrumbs.mjs.map +1 -1
  14. package/fesm2022/ng-primitives-button.mjs +7 -9
  15. package/fesm2022/ng-primitives-button.mjs.map +1 -1
  16. package/fesm2022/ng-primitives-checkbox.mjs +15 -30
  17. package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
  18. package/fesm2022/ng-primitives-combobox.mjs +60 -92
  19. package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
  20. package/fesm2022/ng-primitives-common.mjs +4 -4
  21. package/fesm2022/ng-primitives-common.mjs.map +1 -1
  22. package/fesm2022/ng-primitives-context-menu.mjs +68 -121
  23. package/fesm2022/ng-primitives-context-menu.mjs.map +1 -1
  24. package/fesm2022/ng-primitives-date-picker.mjs +91 -115
  25. package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
  26. package/fesm2022/ng-primitives-dialog.mjs +35 -51
  27. package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
  28. package/fesm2022/ng-primitives-file-upload.mjs +26 -53
  29. package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
  30. package/fesm2022/ng-primitives-focus-trap.mjs +5 -8
  31. package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
  32. package/fesm2022/ng-primitives-form-field.mjs +39 -44
  33. package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
  34. package/fesm2022/ng-primitives-input-otp.mjs +30 -43
  35. package/fesm2022/ng-primitives-input-otp.mjs.map +1 -1
  36. package/fesm2022/ng-primitives-input.mjs +6 -8
  37. package/fesm2022/ng-primitives-input.mjs.map +1 -1
  38. package/fesm2022/ng-primitives-interactions.mjs +31 -48
  39. package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
  40. package/fesm2022/ng-primitives-internal.mjs +39 -35
  41. package/fesm2022/ng-primitives-internal.mjs.map +1 -1
  42. package/fesm2022/ng-primitives-listbox.mjs +34 -48
  43. package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
  44. package/fesm2022/ng-primitives-menu.mjs +85 -151
  45. package/fesm2022/ng-primitives-menu.mjs.map +1 -1
  46. package/fesm2022/ng-primitives-meter.mjs +25 -36
  47. package/fesm2022/ng-primitives-meter.mjs.map +1 -1
  48. package/fesm2022/ng-primitives-navigation-menu.mjs +60 -108
  49. package/fesm2022/ng-primitives-navigation-menu.mjs.map +1 -1
  50. package/fesm2022/ng-primitives-number-field.mjs +35 -59
  51. package/fesm2022/ng-primitives-number-field.mjs.map +1 -1
  52. package/fesm2022/ng-primitives-pagination.mjs +270 -297
  53. package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
  54. package/fesm2022/ng-primitives-popover.mjs +209 -223
  55. package/fesm2022/ng-primitives-popover.mjs.map +1 -1
  56. package/fesm2022/ng-primitives-portal.mjs +88 -59
  57. package/fesm2022/ng-primitives-portal.mjs.map +1 -1
  58. package/fesm2022/ng-primitives-progress.mjs +30 -41
  59. package/fesm2022/ng-primitives-progress.mjs.map +1 -1
  60. package/fesm2022/ng-primitives-radio.mjs +20 -30
  61. package/fesm2022/ng-primitives-radio.mjs.map +1 -1
  62. package/fesm2022/ng-primitives-resize.mjs +3 -3
  63. package/fesm2022/ng-primitives-resize.mjs.map +1 -1
  64. package/fesm2022/ng-primitives-roving-focus.mjs +20 -34
  65. package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
  66. package/fesm2022/ng-primitives-search.mjs +9 -9
  67. package/fesm2022/ng-primitives-search.mjs.map +1 -1
  68. package/fesm2022/ng-primitives-select.mjs +720 -620
  69. package/fesm2022/ng-primitives-select.mjs.map +1 -1
  70. package/fesm2022/ng-primitives-separator.mjs +4 -6
  71. package/fesm2022/ng-primitives-separator.mjs.map +1 -1
  72. package/fesm2022/ng-primitives-slider.mjs +63 -100
  73. package/fesm2022/ng-primitives-slider.mjs.map +1 -1
  74. package/fesm2022/ng-primitives-state.mjs +3 -3
  75. package/fesm2022/ng-primitives-state.mjs.map +1 -1
  76. package/fesm2022/ng-primitives-switch.mjs +15 -21
  77. package/fesm2022/ng-primitives-switch.mjs.map +1 -1
  78. package/fesm2022/ng-primitives-tabs.mjs +31 -41
  79. package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
  80. package/fesm2022/ng-primitives-textarea.mjs +5 -7
  81. package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
  82. package/fesm2022/ng-primitives-toast.mjs +30 -23
  83. package/fesm2022/ng-primitives-toast.mjs.map +1 -1
  84. package/fesm2022/ng-primitives-toggle-group.mjs +20 -36
  85. package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
  86. package/fesm2022/ng-primitives-toggle.mjs +10 -19
  87. package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
  88. package/fesm2022/ng-primitives-toolbar.mjs +4 -6
  89. package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
  90. package/fesm2022/ng-primitives-tooltip.mjs +401 -402
  91. package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
  92. package/fesm2022/ng-primitives-utils.mjs +5 -4
  93. package/fesm2022/ng-primitives-utils.mjs.map +1 -1
  94. package/package.json +56 -55
  95. package/schematics/ng-generate/templates/select/select.__fileSuffix@dasherize__.ts.template +48 -48
  96. package/{a11y/index.d.ts → types/ng-primitives-a11y.d.ts} +18 -24
  97. package/{accordion/index.d.ts → types/ng-primitives-accordion.d.ts} +85 -98
  98. package/{autofill/index.d.ts → types/ng-primitives-autofill.d.ts} +3 -10
  99. package/{avatar/index.d.ts → types/ng-primitives-avatar.d.ts} +7 -30
  100. package/{breadcrumbs/index.d.ts → types/ng-primitives-breadcrumbs.d.ts} +15 -70
  101. package/{button/index.d.ts → types/ng-primitives-button.d.ts} +23 -29
  102. package/{checkbox/index.d.ts → types/ng-primitives-checkbox.d.ts} +68 -74
  103. package/{combobox/index.d.ts → types/ng-primitives-combobox.d.ts} +35 -35
  104. package/{context-menu/index.d.ts → types/ng-primitives-context-menu.d.ts} +2 -1
  105. package/{date-picker/index.d.ts → types/ng-primitives-date-picker.d.ts} +2 -2
  106. package/{dialog/index.d.ts → types/ng-primitives-dialog.d.ts} +7 -2
  107. package/{file-upload/index.d.ts → types/ng-primitives-file-upload.d.ts} +5 -20
  108. package/{focus-trap/index.d.ts → types/ng-primitives-focus-trap.d.ts} +3 -10
  109. package/{form-field/index.d.ts → types/ng-primitives-form-field.d.ts} +9 -40
  110. package/{input/index.d.ts → types/ng-primitives-input.d.ts} +3 -10
  111. package/{menu/index.d.ts → types/ng-primitives-menu.d.ts} +17 -63
  112. package/{navigation-menu/index.d.ts → types/ng-primitives-navigation-menu.d.ts} +15 -70
  113. package/{number-field/index.d.ts → types/ng-primitives-number-field.d.ts} +80 -110
  114. package/types/ng-primitives-pagination.d.ts +502 -0
  115. package/{popover/index.d.ts → types/ng-primitives-popover.d.ts} +244 -57
  116. package/{portal/index.d.ts → types/ng-primitives-portal.d.ts} +22 -13
  117. package/{progress/index.d.ts → types/ng-primitives-progress.d.ts} +3 -10
  118. package/{roving-focus/index.d.ts → types/ng-primitives-roving-focus.d.ts} +65 -79
  119. package/types/ng-primitives-select.d.ts +687 -0
  120. package/{separator/index.d.ts → types/ng-primitives-separator.d.ts} +3 -10
  121. package/{slider/index.d.ts → types/ng-primitives-slider.d.ts} +76 -138
  122. package/{state/index.d.ts → types/ng-primitives-state.d.ts} +26 -21
  123. package/{switch/index.d.ts → types/ng-primitives-switch.d.ts} +50 -64
  124. package/{tabs/index.d.ts → types/ng-primitives-tabs.d.ts} +9 -40
  125. package/{textarea/index.d.ts → types/ng-primitives-textarea.d.ts} +3 -10
  126. package/{toast/index.d.ts → types/ng-primitives-toast.d.ts} +13 -1
  127. package/{toggle-group/index.d.ts → types/ng-primitives-toggle-group.d.ts} +75 -89
  128. package/{toggle/index.d.ts → types/ng-primitives-toggle.d.ts} +50 -56
  129. package/{toolbar/index.d.ts → types/ng-primitives-toolbar.d.ts} +3 -10
  130. package/types/ng-primitives-tooltip.d.ts +691 -0
  131. package/pagination/index.d.ts +0 -211
  132. package/select/index.d.ts +0 -396
  133. package/tooltip/index.d.ts +0 -384
  134. /package/{ai/index.d.ts → types/ng-primitives-ai.d.ts} +0 -0
  135. /package/{common/index.d.ts → types/ng-primitives-common.d.ts} +0 -0
  136. /package/{date-time-luxon/index.d.ts → types/ng-primitives-date-time-luxon.d.ts} +0 -0
  137. /package/{date-time/index.d.ts → types/ng-primitives-date-time.d.ts} +0 -0
  138. /package/{input-otp/index.d.ts → types/ng-primitives-input-otp.d.ts} +0 -0
  139. /package/{interactions/index.d.ts → types/ng-primitives-interactions.d.ts} +0 -0
  140. /package/{internal/index.d.ts → types/ng-primitives-internal.d.ts} +0 -0
  141. /package/{listbox/index.d.ts → types/ng-primitives-listbox.d.ts} +0 -0
  142. /package/{meter/index.d.ts → types/ng-primitives-meter.d.ts} +0 -0
  143. /package/{radio/index.d.ts → types/ng-primitives-radio.d.ts} +0 -0
  144. /package/{resize/index.d.ts → types/ng-primitives-resize.d.ts} +0 -0
  145. /package/{search/index.d.ts → types/ng-primitives-search.d.ts} +0 -0
  146. /package/{utils/index.d.ts → types/ng-primitives-utils.d.ts} +0 -0
  147. /package/{index.d.ts → types/ng-primitives.d.ts} +0 -0
@@ -37,7 +37,7 @@ function filesToFileList(files) {
37
37
 
38
38
  const [NgpFileDropzoneStateToken, ngpFileDropzone, injectFileDropzoneState, provideFileDropzoneState,] = createPrimitive('NgpFileDropzone', ({ fileTypes = signal(undefined), multiple = signal(false), directory = signal(false), disabled: _disabled = signal(false), onSelected, onRejected, onDragOver, }) => {
39
39
  const element = injectElementRef();
40
- const isDragOverState = signal(false, ...(ngDevMode ? [{ debugName: "isDragOverState" }] : []));
40
+ const isDragOverState = signal(false, ...(ngDevMode ? [{ debugName: "isDragOverState" }] : /* istanbul ignore next */ []));
41
41
  // Controlled properties
42
42
  const disabled = controlled(_disabled);
43
43
  // Create observables
@@ -132,35 +132,23 @@ class NgpFileDropzone {
132
132
  * The accepted file types. This can be an array of strings or a comma-separated string.
133
133
  * Accepted types can either be file extensions (e.g. `.jpg`) or MIME types (e.g. `image/jpeg`).
134
134
  */
135
- this.fileTypes = input(undefined, ...(ngDevMode ? [{ debugName: "fileTypes", alias: 'ngpFileDropzoneFileTypes',
136
- transform: types => coerceStringArray(types, ',') }] : [{
137
- alias: 'ngpFileDropzoneFileTypes',
138
- transform: types => coerceStringArray(types, ','),
139
- }]));
135
+ this.fileTypes = input(undefined, { ...(ngDevMode ? { debugName: "fileTypes" } : /* istanbul ignore next */ {}), alias: 'ngpFileDropzoneFileTypes',
136
+ transform: types => coerceStringArray(types, ',') });
140
137
  /**
141
138
  * Whether to allow multiple files to be selected.
142
139
  */
143
- this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple", alias: 'ngpFileDropzoneMultiple',
144
- transform: booleanAttribute }] : [{
145
- alias: 'ngpFileDropzoneMultiple',
146
- transform: booleanAttribute,
147
- }]));
140
+ this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), alias: 'ngpFileDropzoneMultiple',
141
+ transform: booleanAttribute });
148
142
  /**
149
143
  * Whether to allow the user to select directories.
150
144
  */
151
- this.directory = input(false, ...(ngDevMode ? [{ debugName: "directory", alias: 'ngpFileDropzoneDirectory',
152
- transform: booleanAttribute }] : [{
153
- alias: 'ngpFileDropzoneDirectory',
154
- transform: booleanAttribute,
155
- }]));
145
+ this.directory = input(false, { ...(ngDevMode ? { debugName: "directory" } : /* istanbul ignore next */ {}), alias: 'ngpFileDropzoneDirectory',
146
+ transform: booleanAttribute });
156
147
  /**
157
148
  * Whether the file upload is disabled.
158
149
  */
159
- this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", alias: 'ngpFileDropzoneDisabled',
160
- transform: booleanAttribute }] : [{
161
- alias: 'ngpFileDropzoneDisabled',
162
- transform: booleanAttribute,
163
- }]));
150
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), alias: 'ngpFileDropzoneDisabled',
151
+ transform: booleanAttribute });
164
152
  /**
165
153
  * Emits when the user selects files.
166
154
  */
@@ -193,10 +181,10 @@ class NgpFileDropzone {
193
181
  */
194
182
  this.isDragOver = this.state.isDragOver;
195
183
  }
196
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpFileDropzone, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
197
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpFileDropzone, isStandalone: true, selector: "[ngpFileDropzone]", inputs: { fileTypes: { classPropertyName: "fileTypes", publicName: "ngpFileDropzoneFileTypes", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "ngpFileDropzoneMultiple", isSignal: true, isRequired: false, transformFunction: null }, directory: { classPropertyName: "directory", publicName: "ngpFileDropzoneDirectory", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpFileDropzoneDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "ngpFileDropzoneSelected", rejected: "ngpFileDropzoneRejected", dragOver: "ngpFileDropzoneDragOver" }, providers: [provideFileDropzoneState()], exportAs: ["ngpFileDropzone"], ngImport: i0 }); }
184
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpFileDropzone, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
185
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: NgpFileDropzone, isStandalone: true, selector: "[ngpFileDropzone]", inputs: { fileTypes: { classPropertyName: "fileTypes", publicName: "ngpFileDropzoneFileTypes", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "ngpFileDropzoneMultiple", isSignal: true, isRequired: false, transformFunction: null }, directory: { classPropertyName: "directory", publicName: "ngpFileDropzoneDirectory", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpFileDropzoneDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "ngpFileDropzoneSelected", rejected: "ngpFileDropzoneRejected", dragOver: "ngpFileDropzoneDragOver" }, providers: [provideFileDropzoneState()], exportAs: ["ngpFileDropzone"], ngImport: i0 }); }
198
186
  }
199
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpFileDropzone, decorators: [{
187
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpFileDropzone, decorators: [{
200
188
  type: Directive,
201
189
  args: [{
202
190
  selector: '[ngpFileDropzone]',
@@ -208,7 +196,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
208
196
  const [NgpFileUploadStateToken, ngpFileUpload, injectFileUploadState, provideFileUploadState,] = createPrimitive('NgpFileUpload', ({ fileTypes, multiple, directory, dragAndDrop, disabled, onSelected, onCanceled, onRejected, onDragOver, }) => {
209
197
  const element = injectElementRef();
210
198
  const document = inject(DOCUMENT);
211
- const isDragOver = signal(false, ...(ngDevMode ? [{ debugName: "isDragOver" }] : []));
199
+ const isDragOver = signal(false, ...(ngDevMode ? [{ debugName: "isDragOver" }] : /* istanbul ignore next */ []));
212
200
  // Create observables
213
201
  const selected = emitter();
214
202
  const canceled = emitter();
@@ -328,43 +316,28 @@ class NgpFileUpload {
328
316
  * The accepted file types. This can be an array of strings or a comma-separated string.
329
317
  * Accepted types can either be file extensions (e.g. `.jpg`) or MIME types (e.g. `image/jpeg`).
330
318
  */
331
- this.fileTypes = input(undefined, ...(ngDevMode ? [{ debugName: "fileTypes", alias: 'ngpFileUploadFileTypes',
332
- transform: types => coerceStringArray(types, ',') }] : [{
333
- alias: 'ngpFileUploadFileTypes',
334
- transform: types => coerceStringArray(types, ','),
335
- }]));
319
+ this.fileTypes = input(undefined, { ...(ngDevMode ? { debugName: "fileTypes" } : /* istanbul ignore next */ {}), alias: 'ngpFileUploadFileTypes',
320
+ transform: types => coerceStringArray(types, ',') });
336
321
  /**
337
322
  * Whether to allow multiple files to be selected.
338
323
  */
339
- this.multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple", alias: 'ngpFileUploadMultiple',
340
- transform: booleanAttribute }] : [{
341
- alias: 'ngpFileUploadMultiple',
342
- transform: booleanAttribute,
343
- }]));
324
+ this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), alias: 'ngpFileUploadMultiple',
325
+ transform: booleanAttribute });
344
326
  /**
345
327
  * Whether to allow the user to select directories.
346
328
  */
347
- this.directory = input(false, ...(ngDevMode ? [{ debugName: "directory", alias: 'ngpFileUploadDirectory',
348
- transform: booleanAttribute }] : [{
349
- alias: 'ngpFileUploadDirectory',
350
- transform: booleanAttribute,
351
- }]));
329
+ this.directory = input(false, { ...(ngDevMode ? { debugName: "directory" } : /* istanbul ignore next */ {}), alias: 'ngpFileUploadDirectory',
330
+ transform: booleanAttribute });
352
331
  /**
353
332
  * Whether drag-and-drop is enabled.
354
333
  */
355
- this.dragAndDrop = input(true, ...(ngDevMode ? [{ debugName: "dragAndDrop", alias: 'ngpFileUploadDragDrop',
356
- transform: booleanAttribute }] : [{
357
- alias: 'ngpFileUploadDragDrop',
358
- transform: booleanAttribute,
359
- }]));
334
+ this.dragAndDrop = input(true, { ...(ngDevMode ? { debugName: "dragAndDrop" } : /* istanbul ignore next */ {}), alias: 'ngpFileUploadDragDrop',
335
+ transform: booleanAttribute });
360
336
  /**
361
337
  * Whether the file upload is disabled.
362
338
  */
363
- this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", alias: 'ngpFileUploadDisabled',
364
- transform: booleanAttribute }] : [{
365
- alias: 'ngpFileUploadDisabled',
366
- transform: booleanAttribute,
367
- }]));
339
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), alias: 'ngpFileUploadDisabled',
340
+ transform: booleanAttribute });
368
341
  /**
369
342
  * Emits when the user selects files.
370
343
  */
@@ -411,10 +384,10 @@ class NgpFileUpload {
411
384
  showFileDialog() {
412
385
  this.state.showFileDialog();
413
386
  }
414
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpFileUpload, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
415
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", 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", canceled: "ngpFileUploadCanceled", rejected: "ngpFileUploadRejected", dragOver: "ngpFileUploadDragOver" }, providers: [provideFileUploadState()], exportAs: ["ngpFileUpload"], ngImport: i0 }); }
387
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpFileUpload, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
388
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", 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", canceled: "ngpFileUploadCanceled", rejected: "ngpFileUploadRejected", dragOver: "ngpFileUploadDragOver" }, providers: [provideFileUploadState()], exportAs: ["ngpFileUpload"], ngImport: i0 }); }
416
389
  }
417
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpFileUpload, decorators: [{
390
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpFileUpload, decorators: [{
418
391
  type: Directive,
419
392
  args: [{
420
393
  selector: '[ngpFileUpload]',
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-file-upload.mjs","sources":["../../../../packages/ng-primitives/file-upload/src/file-dropzone/file-drop-filter.ts","../../../../packages/ng-primitives/file-upload/src/file-dropzone/file-dropzone-state.ts","../../../../packages/ng-primitives/file-upload/src/file-dropzone/file-dropzone.ts","../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload-state.ts","../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload.ts","../../../../packages/ng-primitives/file-upload/src/ng-primitives-file-upload.ts"],"sourcesContent":["export function fileDropFilter(\n fileList: FileList,\n acceptedTypes: string[] | undefined,\n multiple: boolean,\n) {\n const validFiles = Array.from(fileList).filter(file => isFileTypeAccepted(file, acceptedTypes));\n\n const limitedFiles = multiple ? validFiles : validFiles.slice(0, 1);\n\n return limitedFiles.length > 0 ? filesToFileList(limitedFiles) : null;\n}\n\nexport function isFileTypeAccepted(file: File, acceptedTypes: string[] | undefined) {\n // allow all file types if no types are specified\n if (!acceptedTypes || acceptedTypes.length === 0) return true;\n\n const mimeType = file.type;\n const fileName = file.name.toLowerCase();\n\n return acceptedTypes.some(type => {\n type = type.toLowerCase();\n\n if (type.startsWith('.')) {\n return fileName.endsWith(type);\n }\n\n if (type.endsWith('/*')) {\n const baseType = type.replace('/*', '');\n return mimeType.startsWith(baseType);\n }\n\n return mimeType === type;\n });\n}\n\nfunction filesToFileList(files: File[]): FileList {\n const dataTransfer = new DataTransfer();\n files.forEach(file => dataTransfer.items.add(file));\n return dataTransfer.files;\n}\n","import { Signal, signal } from '@angular/core';\nimport { ngpHover } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n controlled,\n createPrimitive,\n dataBinding,\n deprecatedSetter,\n emitter,\n listener,\n} from 'ng-primitives/state';\nimport { Observable } from 'rxjs';\nimport { fileDropFilter } from './file-drop-filter';\n\n/**\n * The state for the NgpFileDropzone directive.\n */\nexport interface NgpFileDropzoneState {\n /**\n * Whether the file dropzone is disabled.\n */\n readonly disabled: Signal<boolean | undefined>;\n /**\n * Whether the user is currently dragging over the element.\n */\n readonly isDragOver: Signal<boolean>;\n /**\n * Observable that emits when files are selected.\n */\n readonly selected: Observable<FileList | null>;\n /**\n * Observable that emits when files are rejected.\n */\n readonly rejected: Observable<void>;\n /**\n * Observable that emits when drag over state changes.\n */\n readonly dragOver: Observable<boolean>;\n\n /**\n * Set the accepted file types.\n */\n readonly fileTypes: Signal<string[] | undefined>;\n /**\n * Whether multiple files can be selected.\n */\n readonly multiple: Signal<boolean | undefined>;\n /**\n * Whether directories can be selected.\n */\n readonly directory: Signal<boolean | undefined>;\n\n /**\n * Set the disabled state.\n */\n setDisabled(value: boolean): void;\n}\n\n/**\n * The props for the NgpFileDropzone state.\n */\nexport interface NgpFileDropzoneProps {\n /**\n * The accepted file types.\n */\n readonly fileTypes?: Signal<string[] | undefined>;\n /**\n * Whether multiple files can be selected.\n */\n readonly multiple?: Signal<boolean>;\n /**\n * Whether directories can be selected.\n */\n readonly directory?: Signal<boolean>;\n /**\n * Whether the file dropzone is disabled.\n */\n readonly disabled?: Signal<boolean>;\n /**\n * Callback when files are selected.\n */\n readonly onSelected?: (files: FileList | null) => void;\n /**\n * Callback when files are rejected.\n */\n readonly onRejected?: () => void;\n /**\n * Callback when drag over state changes.\n */\n readonly onDragOver?: (isDragOver: boolean) => void;\n}\n\nexport const [\n NgpFileDropzoneStateToken,\n ngpFileDropzone,\n injectFileDropzoneState,\n provideFileDropzoneState,\n] = createPrimitive(\n 'NgpFileDropzone',\n ({\n fileTypes = signal<string[] | undefined>(undefined),\n multiple = signal<boolean>(false),\n directory = signal<boolean>(false),\n disabled: _disabled = signal<boolean>(false),\n onSelected,\n onRejected,\n onDragOver,\n }: NgpFileDropzoneProps) => {\n const element = injectElementRef();\n const isDragOverState = signal(false);\n\n // Controlled properties\n const disabled = controlled(_disabled);\n\n // Create observables\n const selected = emitter<FileList | null>();\n const rejected = emitter<void>();\n const dragOver = emitter<boolean>();\n\n // Host bindings\n dataBinding(element, 'data-dragover', () => (isDragOverState() ? '' : null));\n dataBinding(element, 'data-disabled', () => (disabled?.() ? '' : null));\n\n // Setup hover interaction\n ngpHover({ disabled });\n\n function onDragEnter(event: DragEvent): void {\n if (disabled?.()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOverState.set(true);\n dragOver.emit(true);\n onDragOver?.(true);\n }\n\n function onDragOverHandler(event: DragEvent): void {\n if (disabled?.()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n isDragOverState.set(true);\n }\n\n function onDragLeave(event: DragEvent): void {\n if (disabled?.() || !isDragOverState()) {\n return;\n }\n\n // if the element we are dragging over is a child of the file dropzone, ignore the event\n if (element.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOverState.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n }\n\n function onDrop(event: DragEvent): void {\n if (disabled?.()) {\n return;\n }\n\n event.preventDefault();\n isDragOverState.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n\n const fileList = event.dataTransfer?.files;\n if (fileList) {\n const filteredFiles = fileDropFilter(fileList, fileTypes?.(), multiple?.() ?? false);\n\n if (filteredFiles) {\n selected.emit(filteredFiles);\n onSelected?.(filteredFiles);\n } else {\n rejected.emit();\n onRejected?.();\n }\n }\n }\n\n // Event listeners\n listener(element, 'dragenter', onDragEnter);\n listener(element, 'dragover', onDragOverHandler);\n listener(element, 'dragleave', onDragLeave);\n listener(element, 'drop', onDrop);\n\n function setDisabled(value: boolean): void {\n disabled?.set(value);\n }\n\n return {\n disabled: deprecatedSetter(disabled, 'setDisabled'),\n fileTypes,\n multiple,\n directory,\n isDragOver: isDragOverState,\n selected: selected.asObservable(),\n rejected: rejected.asObservable(),\n dragOver: dragOver.asObservable(),\n setDisabled,\n } satisfies NgpFileDropzoneState;\n },\n);\n","import { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output } from '@angular/core';\nimport { ngpFileDropzone, provideFileDropzoneState } from './file-dropzone-state';\n\n/**\n * Capture files dropped on the element.\n */\n@Directive({\n selector: '[ngpFileDropzone]',\n exportAs: 'ngpFileDropzone',\n providers: [provideFileDropzoneState()],\n})\nexport class NgpFileDropzone {\n /**\n * The accepted file types. This can be an array of strings or a comma-separated string.\n * Accepted types can either be file extensions (e.g. `.jpg`) or MIME types (e.g. `image/jpeg`).\n */\n readonly fileTypes = input<string[], string | string[]>(undefined, {\n alias: 'ngpFileDropzoneFileTypes',\n transform: types => coerceStringArray(types, ','),\n });\n\n /**\n * Whether to allow multiple files to be selected.\n */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileDropzoneMultiple',\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: 'ngpFileDropzoneDirectory',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the file upload is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileDropzoneDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emits when the user selects files.\n */\n readonly selected = output<FileList | null>({\n alias: 'ngpFileDropzoneSelected',\n });\n\n /**\n * Emits when uploaded files are rejected because they do not match the allowed {@link fileTypes}.\n */\n readonly rejected = output<void>({\n alias: 'ngpFileDropzoneRejected',\n });\n\n /**\n * Emits when the user drags a file over the file upload.\n */\n readonly dragOver = output<boolean>({\n alias: 'ngpFileDropzoneDragOver',\n });\n\n private readonly state = ngpFileDropzone({\n fileTypes: this.fileTypes,\n multiple: this.multiple,\n directory: this.directory,\n disabled: this.disabled,\n onSelected: files => this.selected.emit(files),\n onRejected: () => this.rejected.emit(),\n onDragOver: isDragOver => this.dragOver.emit(isDragOver),\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n readonly isDragOver = this.state.isDragOver;\n}\n","import { DOCUMENT } from '@angular/common';\nimport { inject, Signal, signal } from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { createPrimitive, dataBinding, emitter, listener } from 'ng-primitives/state';\nimport { Observable } from 'rxjs';\nimport { fileDropFilter } from '../file-dropzone/file-drop-filter';\n\n/**\n * The state for the NgpFileUpload directive.\n */\nexport interface NgpFileUploadState {\n /**\n * Whether the user is currently dragging over the element.\n */\n readonly isDragOver: Signal<boolean>;\n /**\n * Observable that emits when files are selected.\n */\n readonly selected: Observable<FileList | null>;\n /**\n * Observable that emits when file selection is canceled.\n */\n readonly canceled: Observable<void>;\n /**\n * Observable that emits when files are rejected.\n */\n readonly rejected: Observable<void>;\n /**\n * Observable that emits when drag over state changes.\n */\n readonly dragOver: Observable<boolean>;\n /**\n * Show the file dialog.\n */\n showFileDialog(): void;\n}\n\n/**\n * The props for the NgpFileUpload state.\n */\nexport interface NgpFileUploadProps {\n /**\n * The accepted file types.\n */\n readonly fileTypes?: Signal<string[] | undefined>;\n /**\n * Whether multiple files can be selected.\n */\n readonly multiple?: Signal<boolean>;\n /**\n * Whether directories can be selected.\n */\n readonly directory?: Signal<boolean>;\n /**\n * Whether drag and drop is enabled.\n */\n readonly dragAndDrop?: Signal<boolean>;\n /**\n * Whether the file upload is disabled.\n */\n readonly disabled?: Signal<boolean>;\n /**\n * Callback when files are selected.\n */\n readonly onSelected?: (files: FileList | null) => void;\n /**\n * Callback when file selection is canceled.\n */\n readonly onCanceled?: () => void;\n /**\n * Callback when files are rejected.\n */\n readonly onRejected?: () => void;\n /**\n * Callback when drag over state changes.\n */\n readonly onDragOver?: (isDragOver: boolean) => void;\n}\n\nexport const [\n NgpFileUploadStateToken,\n ngpFileUpload,\n injectFileUploadState,\n provideFileUploadState,\n] = createPrimitive(\n 'NgpFileUpload',\n ({\n fileTypes,\n multiple,\n directory,\n dragAndDrop,\n disabled,\n onSelected,\n onCanceled,\n onRejected,\n onDragOver,\n }: NgpFileUploadProps) => {\n const element = injectElementRef();\n const document = inject(DOCUMENT);\n\n const isDragOver = signal(false);\n\n // Create observables\n const selected = emitter<FileList | null>();\n const canceled = emitter<void>();\n const rejected = emitter<void>();\n const dragOver = emitter<boolean>();\n\n // Host bindings\n dataBinding(element, 'data-disabled', () => (disabled?.() ? '' : null));\n dataBinding(element, 'data-dragover', () => (isDragOver() ? '' : null));\n\n // Setup interactions\n ngpInteractions({\n hover: true,\n press: true,\n focusVisible: true,\n disabled,\n });\n\n // Create file input\n const input: HTMLInputElement = document.createElement('input');\n input.type = 'file';\n input.style.display = 'none';\n\n input.addEventListener('change', () => {\n const files = input.files;\n selected.emit(files);\n onSelected?.(files);\n input.value = '';\n });\n\n input.addEventListener('cancel', () => {\n canceled.emit();\n onCanceled?.();\n });\n\n function showFileDialog(): void {\n if (disabled?.()) {\n return;\n }\n\n const fileTypesValue = fileTypes?.()?.join(',');\n if (fileTypesValue) {\n input.accept = fileTypesValue;\n }\n\n input.multiple = multiple?.() ?? false;\n input.webkitdirectory = directory?.() ?? false;\n input.click();\n }\n\n function onDragEnter(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOver.set(true);\n dragOver.emit(true);\n onDragOver?.(true);\n }\n\n function onDragOverHandler(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n isDragOver.set(true);\n }\n\n function onDragLeave(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.() || !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 (element.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOver.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n }\n\n function onDrop(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.()) {\n return;\n }\n\n event.preventDefault();\n isDragOver.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n\n const fileList = event.dataTransfer?.files;\n if (fileList) {\n const filteredFiles = fileDropFilter(fileList, fileTypes?.(), multiple?.() ?? false);\n\n if (filteredFiles) {\n selected.emit(filteredFiles);\n onSelected?.(filteredFiles);\n } else {\n rejected.emit();\n onRejected?.();\n }\n }\n }\n\n // Event listeners\n listener(element, 'click', showFileDialog);\n listener(element, 'dragenter', onDragEnter);\n listener(element, 'dragover', onDragOverHandler);\n listener(element, 'dragleave', onDragLeave);\n listener(element, 'drop', onDrop);\n\n return {\n isDragOver,\n selected: selected.asObservable(),\n canceled: canceled.asObservable(),\n rejected: rejected.asObservable(),\n dragOver: dragOver.asObservable(),\n showFileDialog,\n } satisfies NgpFileUploadState;\n },\n);\n","import { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output } from '@angular/core';\nimport { ngpFileUpload, provideFileUploadState } from './file-upload-state';\n\n/**\n * A directive that allows you to turn any element into a file upload trigger.\n */\n@Directive({\n selector: '[ngpFileUpload]',\n exportAs: 'ngpFileUpload',\n providers: [provideFileUploadState()],\n})\nexport class NgpFileUpload {\n /**\n * The accepted file types. This can be an array of strings or a comma-separated string.\n * Accepted types can either be file extensions (e.g. `.jpg`) or MIME types (e.g. `image/jpeg`).\n */\n readonly fileTypes = input<string[], string | string[]>(undefined, {\n alias: 'ngpFileUploadFileTypes',\n transform: types => coerceStringArray(types, ','),\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 cancel the file selection.\n */\n readonly canceled = output<void>({\n alias: 'ngpFileUploadCanceled',\n });\n\n /**\n * Emits when uploaded files are rejected because they do not match the allowed {@link fileTypes}.\n */\n readonly rejected = output<void>({\n alias: 'ngpFileUploadRejected',\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 private readonly state = ngpFileUpload({\n fileTypes: this.fileTypes,\n multiple: this.multiple,\n directory: this.directory,\n dragAndDrop: this.dragAndDrop,\n disabled: this.disabled,\n onSelected: files => this.selected.emit(files),\n onCanceled: () => this.canceled.emit(),\n onRejected: () => this.rejected.emit(),\n onDragOver: isDragOver => this.dragOver.emit(isDragOver),\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n readonly isDragOver = this.state.isDragOver;\n\n /**\n * Show the file dialog.\n */\n showFileDialog(): void {\n this.state.showFileDialog();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;SAAgB,cAAc,CAC5B,QAAkB,EAClB,aAAmC,EACnC,QAAiB,EAAA;IAEjB,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,kBAAkB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AAE/F,IAAA,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;AAEnE,IAAA,OAAO,YAAY,CAAC,MAAM,GAAG,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,GAAG,IAAI;AACvE;AAEM,SAAU,kBAAkB,CAAC,IAAU,EAAE,aAAmC,EAAA;;AAEhF,IAAA,IAAI,CAAC,aAAa,IAAI,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A,UAAA,EAAA,UAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,wBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,EAAA,SAAA,EAFb,CAAC,sBAAsB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAE1B,aAAa,EAAA,UAAA,EAAA,CAAA;kBALzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,SAAS,EAAE,CAAC,sBAAsB,EAAE,CAAC;AACtC,iBAAA;;;ACXD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-file-upload.mjs","sources":["../../../../packages/ng-primitives/file-upload/src/file-dropzone/file-drop-filter.ts","../../../../packages/ng-primitives/file-upload/src/file-dropzone/file-dropzone-state.ts","../../../../packages/ng-primitives/file-upload/src/file-dropzone/file-dropzone.ts","../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload-state.ts","../../../../packages/ng-primitives/file-upload/src/file-upload/file-upload.ts","../../../../packages/ng-primitives/file-upload/src/ng-primitives-file-upload.ts"],"sourcesContent":["export function fileDropFilter(\n fileList: FileList,\n acceptedTypes: string[] | undefined,\n multiple: boolean,\n) {\n const validFiles = Array.from(fileList).filter(file => isFileTypeAccepted(file, acceptedTypes));\n\n const limitedFiles = multiple ? validFiles : validFiles.slice(0, 1);\n\n return limitedFiles.length > 0 ? filesToFileList(limitedFiles) : null;\n}\n\nexport function isFileTypeAccepted(file: File, acceptedTypes: string[] | undefined) {\n // allow all file types if no types are specified\n if (!acceptedTypes || acceptedTypes.length === 0) return true;\n\n const mimeType = file.type;\n const fileName = file.name.toLowerCase();\n\n return acceptedTypes.some(type => {\n type = type.toLowerCase();\n\n if (type.startsWith('.')) {\n return fileName.endsWith(type);\n }\n\n if (type.endsWith('/*')) {\n const baseType = type.replace('/*', '');\n return mimeType.startsWith(baseType);\n }\n\n return mimeType === type;\n });\n}\n\nfunction filesToFileList(files: File[]): FileList {\n const dataTransfer = new DataTransfer();\n files.forEach(file => dataTransfer.items.add(file));\n return dataTransfer.files;\n}\n","import { Signal, signal } from '@angular/core';\nimport { ngpHover } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n controlled,\n createPrimitive,\n dataBinding,\n deprecatedSetter,\n emitter,\n listener,\n} from 'ng-primitives/state';\nimport { Observable } from 'rxjs';\nimport { fileDropFilter } from './file-drop-filter';\n\n/**\n * The state for the NgpFileDropzone directive.\n */\nexport interface NgpFileDropzoneState {\n /**\n * Whether the file dropzone is disabled.\n */\n readonly disabled: Signal<boolean | undefined>;\n /**\n * Whether the user is currently dragging over the element.\n */\n readonly isDragOver: Signal<boolean>;\n /**\n * Observable that emits when files are selected.\n */\n readonly selected: Observable<FileList | null>;\n /**\n * Observable that emits when files are rejected.\n */\n readonly rejected: Observable<void>;\n /**\n * Observable that emits when drag over state changes.\n */\n readonly dragOver: Observable<boolean>;\n\n /**\n * Set the accepted file types.\n */\n readonly fileTypes: Signal<string[] | undefined>;\n /**\n * Whether multiple files can be selected.\n */\n readonly multiple: Signal<boolean | undefined>;\n /**\n * Whether directories can be selected.\n */\n readonly directory: Signal<boolean | undefined>;\n\n /**\n * Set the disabled state.\n */\n setDisabled(value: boolean): void;\n}\n\n/**\n * The props for the NgpFileDropzone state.\n */\nexport interface NgpFileDropzoneProps {\n /**\n * The accepted file types.\n */\n readonly fileTypes?: Signal<string[] | undefined>;\n /**\n * Whether multiple files can be selected.\n */\n readonly multiple?: Signal<boolean>;\n /**\n * Whether directories can be selected.\n */\n readonly directory?: Signal<boolean>;\n /**\n * Whether the file dropzone is disabled.\n */\n readonly disabled?: Signal<boolean>;\n /**\n * Callback when files are selected.\n */\n readonly onSelected?: (files: FileList | null) => void;\n /**\n * Callback when files are rejected.\n */\n readonly onRejected?: () => void;\n /**\n * Callback when drag over state changes.\n */\n readonly onDragOver?: (isDragOver: boolean) => void;\n}\n\nexport const [\n NgpFileDropzoneStateToken,\n ngpFileDropzone,\n injectFileDropzoneState,\n provideFileDropzoneState,\n] = createPrimitive(\n 'NgpFileDropzone',\n ({\n fileTypes = signal<string[] | undefined>(undefined),\n multiple = signal<boolean>(false),\n directory = signal<boolean>(false),\n disabled: _disabled = signal<boolean>(false),\n onSelected,\n onRejected,\n onDragOver,\n }: NgpFileDropzoneProps) => {\n const element = injectElementRef();\n const isDragOverState = signal(false);\n\n // Controlled properties\n const disabled = controlled(_disabled);\n\n // Create observables\n const selected = emitter<FileList | null>();\n const rejected = emitter<void>();\n const dragOver = emitter<boolean>();\n\n // Host bindings\n dataBinding(element, 'data-dragover', () => (isDragOverState() ? '' : null));\n dataBinding(element, 'data-disabled', () => (disabled?.() ? '' : null));\n\n // Setup hover interaction\n ngpHover({ disabled });\n\n function onDragEnter(event: DragEvent): void {\n if (disabled?.()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOverState.set(true);\n dragOver.emit(true);\n onDragOver?.(true);\n }\n\n function onDragOverHandler(event: DragEvent): void {\n if (disabled?.()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n isDragOverState.set(true);\n }\n\n function onDragLeave(event: DragEvent): void {\n if (disabled?.() || !isDragOverState()) {\n return;\n }\n\n // if the element we are dragging over is a child of the file dropzone, ignore the event\n if (element.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOverState.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n }\n\n function onDrop(event: DragEvent): void {\n if (disabled?.()) {\n return;\n }\n\n event.preventDefault();\n isDragOverState.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n\n const fileList = event.dataTransfer?.files;\n if (fileList) {\n const filteredFiles = fileDropFilter(fileList, fileTypes?.(), multiple?.() ?? false);\n\n if (filteredFiles) {\n selected.emit(filteredFiles);\n onSelected?.(filteredFiles);\n } else {\n rejected.emit();\n onRejected?.();\n }\n }\n }\n\n // Event listeners\n listener(element, 'dragenter', onDragEnter);\n listener(element, 'dragover', onDragOverHandler);\n listener(element, 'dragleave', onDragLeave);\n listener(element, 'drop', onDrop);\n\n function setDisabled(value: boolean): void {\n disabled?.set(value);\n }\n\n return {\n disabled: deprecatedSetter(disabled, 'setDisabled'),\n fileTypes,\n multiple,\n directory,\n isDragOver: isDragOverState,\n selected: selected.asObservable(),\n rejected: rejected.asObservable(),\n dragOver: dragOver.asObservable(),\n setDisabled,\n } satisfies NgpFileDropzoneState;\n },\n);\n","import { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output } from '@angular/core';\nimport { ngpFileDropzone, provideFileDropzoneState } from './file-dropzone-state';\n\n/**\n * Capture files dropped on the element.\n */\n@Directive({\n selector: '[ngpFileDropzone]',\n exportAs: 'ngpFileDropzone',\n providers: [provideFileDropzoneState()],\n})\nexport class NgpFileDropzone {\n /**\n * The accepted file types. This can be an array of strings or a comma-separated string.\n * Accepted types can either be file extensions (e.g. `.jpg`) or MIME types (e.g. `image/jpeg`).\n */\n readonly fileTypes = input<string[], string | string[]>(undefined, {\n alias: 'ngpFileDropzoneFileTypes',\n transform: types => coerceStringArray(types, ','),\n });\n\n /**\n * Whether to allow multiple files to be selected.\n */\n readonly multiple = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileDropzoneMultiple',\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: 'ngpFileDropzoneDirectory',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the file upload is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFileDropzoneDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emits when the user selects files.\n */\n readonly selected = output<FileList | null>({\n alias: 'ngpFileDropzoneSelected',\n });\n\n /**\n * Emits when uploaded files are rejected because they do not match the allowed {@link fileTypes}.\n */\n readonly rejected = output<void>({\n alias: 'ngpFileDropzoneRejected',\n });\n\n /**\n * Emits when the user drags a file over the file upload.\n */\n readonly dragOver = output<boolean>({\n alias: 'ngpFileDropzoneDragOver',\n });\n\n private readonly state = ngpFileDropzone({\n fileTypes: this.fileTypes,\n multiple: this.multiple,\n directory: this.directory,\n disabled: this.disabled,\n onSelected: files => this.selected.emit(files),\n onRejected: () => this.rejected.emit(),\n onDragOver: isDragOver => this.dragOver.emit(isDragOver),\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n readonly isDragOver = this.state.isDragOver;\n}\n","import { DOCUMENT } from '@angular/common';\nimport { inject, Signal, signal } from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { createPrimitive, dataBinding, emitter, listener } from 'ng-primitives/state';\nimport { Observable } from 'rxjs';\nimport { fileDropFilter } from '../file-dropzone/file-drop-filter';\n\n/**\n * The state for the NgpFileUpload directive.\n */\nexport interface NgpFileUploadState {\n /**\n * Whether the user is currently dragging over the element.\n */\n readonly isDragOver: Signal<boolean>;\n /**\n * Observable that emits when files are selected.\n */\n readonly selected: Observable<FileList | null>;\n /**\n * Observable that emits when file selection is canceled.\n */\n readonly canceled: Observable<void>;\n /**\n * Observable that emits when files are rejected.\n */\n readonly rejected: Observable<void>;\n /**\n * Observable that emits when drag over state changes.\n */\n readonly dragOver: Observable<boolean>;\n /**\n * Show the file dialog.\n */\n showFileDialog(): void;\n}\n\n/**\n * The props for the NgpFileUpload state.\n */\nexport interface NgpFileUploadProps {\n /**\n * The accepted file types.\n */\n readonly fileTypes?: Signal<string[] | undefined>;\n /**\n * Whether multiple files can be selected.\n */\n readonly multiple?: Signal<boolean>;\n /**\n * Whether directories can be selected.\n */\n readonly directory?: Signal<boolean>;\n /**\n * Whether drag and drop is enabled.\n */\n readonly dragAndDrop?: Signal<boolean>;\n /**\n * Whether the file upload is disabled.\n */\n readonly disabled?: Signal<boolean>;\n /**\n * Callback when files are selected.\n */\n readonly onSelected?: (files: FileList | null) => void;\n /**\n * Callback when file selection is canceled.\n */\n readonly onCanceled?: () => void;\n /**\n * Callback when files are rejected.\n */\n readonly onRejected?: () => void;\n /**\n * Callback when drag over state changes.\n */\n readonly onDragOver?: (isDragOver: boolean) => void;\n}\n\nexport const [\n NgpFileUploadStateToken,\n ngpFileUpload,\n injectFileUploadState,\n provideFileUploadState,\n] = createPrimitive(\n 'NgpFileUpload',\n ({\n fileTypes,\n multiple,\n directory,\n dragAndDrop,\n disabled,\n onSelected,\n onCanceled,\n onRejected,\n onDragOver,\n }: NgpFileUploadProps) => {\n const element = injectElementRef();\n const document = inject(DOCUMENT);\n\n const isDragOver = signal(false);\n\n // Create observables\n const selected = emitter<FileList | null>();\n const canceled = emitter<void>();\n const rejected = emitter<void>();\n const dragOver = emitter<boolean>();\n\n // Host bindings\n dataBinding(element, 'data-disabled', () => (disabled?.() ? '' : null));\n dataBinding(element, 'data-dragover', () => (isDragOver() ? '' : null));\n\n // Setup interactions\n ngpInteractions({\n hover: true,\n press: true,\n focusVisible: true,\n disabled,\n });\n\n // Create file input\n const input: HTMLInputElement = document.createElement('input');\n input.type = 'file';\n input.style.display = 'none';\n\n input.addEventListener('change', () => {\n const files = input.files;\n selected.emit(files);\n onSelected?.(files);\n input.value = '';\n });\n\n input.addEventListener('cancel', () => {\n canceled.emit();\n onCanceled?.();\n });\n\n function showFileDialog(): void {\n if (disabled?.()) {\n return;\n }\n\n const fileTypesValue = fileTypes?.()?.join(',');\n if (fileTypesValue) {\n input.accept = fileTypesValue;\n }\n\n input.multiple = multiple?.() ?? false;\n input.webkitdirectory = directory?.() ?? false;\n input.click();\n }\n\n function onDragEnter(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOver.set(true);\n dragOver.emit(true);\n onDragOver?.(true);\n }\n\n function onDragOverHandler(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.()) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n isDragOver.set(true);\n }\n\n function onDragLeave(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.() || !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 (element.nativeElement.contains(event.relatedTarget as Node)) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n isDragOver.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n }\n\n function onDrop(event: DragEvent): void {\n if (disabled?.() || !dragAndDrop?.()) {\n return;\n }\n\n event.preventDefault();\n isDragOver.set(false);\n dragOver.emit(false);\n onDragOver?.(false);\n\n const fileList = event.dataTransfer?.files;\n if (fileList) {\n const filteredFiles = fileDropFilter(fileList, fileTypes?.(), multiple?.() ?? false);\n\n if (filteredFiles) {\n selected.emit(filteredFiles);\n onSelected?.(filteredFiles);\n } else {\n rejected.emit();\n onRejected?.();\n }\n }\n }\n\n // Event listeners\n listener(element, 'click', showFileDialog);\n listener(element, 'dragenter', onDragEnter);\n listener(element, 'dragover', onDragOverHandler);\n listener(element, 'dragleave', onDragLeave);\n listener(element, 'drop', onDrop);\n\n return {\n isDragOver,\n selected: selected.asObservable(),\n canceled: canceled.asObservable(),\n rejected: rejected.asObservable(),\n dragOver: dragOver.asObservable(),\n showFileDialog,\n } satisfies NgpFileUploadState;\n },\n);\n","import { BooleanInput, coerceStringArray } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, output } from '@angular/core';\nimport { ngpFileUpload, provideFileUploadState } from './file-upload-state';\n\n/**\n * A directive that allows you to turn any element into a file upload trigger.\n */\n@Directive({\n selector: '[ngpFileUpload]',\n exportAs: 'ngpFileUpload',\n providers: [provideFileUploadState()],\n})\nexport class NgpFileUpload {\n /**\n * The accepted file types. This can be an array of strings or a comma-separated string.\n * Accepted types can either be file extensions (e.g. `.jpg`) or MIME types (e.g. `image/jpeg`).\n */\n readonly fileTypes = input<string[], string | string[]>(undefined, {\n alias: 'ngpFileUploadFileTypes',\n transform: types => coerceStringArray(types, ','),\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 cancel the file selection.\n */\n readonly canceled = output<void>({\n alias: 'ngpFileUploadCanceled',\n });\n\n /**\n * Emits when uploaded files are rejected because they do not match the allowed {@link fileTypes}.\n */\n readonly rejected = output<void>({\n alias: 'ngpFileUploadRejected',\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 private readonly state = ngpFileUpload({\n fileTypes: this.fileTypes,\n multiple: this.multiple,\n directory: this.directory,\n dragAndDrop: this.dragAndDrop,\n disabled: this.disabled,\n onSelected: files => this.selected.emit(files),\n onCanceled: () => this.canceled.emit(),\n onRejected: () => this.rejected.emit(),\n onDragOver: isDragOver => this.dragOver.emit(isDragOver),\n });\n\n /**\n * Whether the user is currently dragging a file over the file upload.\n */\n readonly isDragOver = this.state.isDragOver;\n\n /**\n * Show the file dialog.\n */\n showFileDialog(): void {\n this.state.showFileDialog();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;SAAgB,cAAc,CAC5B,QAAkB,EAClB,aAAmC,EACnC,QAAiB,EAAA;IAEjB,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,kBAAkB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AAE/F,IAAA,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;AAEnE,IAAA,OAAO,YAAY,CAAC,MAAM,GAAG,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,GAAG,IAAI;AACvE;AAEM,SAAU,kBAAkB,CAAC,IAAU,EAAE,aAAmC,EAAA;;AAEhF,IAAA,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI;AAE7D,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI;IAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC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AAC,sBAAsB,EAAE,CAAC;AACtC,iBAAA;;;ACXD;;AAEG;;;;"}
@@ -307,17 +307,14 @@ class NgpFocusTrap {
307
307
  /**
308
308
  * Whether the focus trap is disabled.
309
309
  */
310
- this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", alias: 'ngpFocusTrapDisabled',
311
- transform: booleanAttribute }] : [{
312
- alias: 'ngpFocusTrapDisabled',
313
- transform: booleanAttribute,
314
- }]));
310
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), alias: 'ngpFocusTrapDisabled',
311
+ transform: booleanAttribute });
315
312
  ngpFocusTrap({ disabled: this.disabled });
316
313
  }
317
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpFocusTrap, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
318
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpFocusTrap, isStandalone: true, selector: "[ngpFocusTrap]", inputs: { disabled: { classPropertyName: "disabled", publicName: "ngpFocusTrapDisabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideFocusTrapState()], exportAs: ["ngpFocusTrap"], ngImport: i0 }); }
314
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpFocusTrap, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
315
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: NgpFocusTrap, isStandalone: true, selector: "[ngpFocusTrap]", inputs: { disabled: { classPropertyName: "disabled", publicName: "ngpFocusTrapDisabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideFocusTrapState()], exportAs: ["ngpFocusTrap"], ngImport: i0 }); }
319
316
  }
320
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpFocusTrap, decorators: [{
317
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpFocusTrap, decorators: [{
321
318
  type: Directive,
322
319
  args: [{
323
320
  selector: '[ngpFocusTrap]',
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-focus-trap.mjs","sources":["../../../../packages/ng-primitives/focus-trap/src/focus-trap/focus-trap-state.ts","../../../../packages/ng-primitives/focus-trap/src/focus-trap/focus-trap.ts","../../../../packages/ng-primitives/focus-trap/src/ng-primitives-focus-trap.ts"],"sourcesContent":["import { FocusMonitor, FocusOrigin, InteractivityChecker } from '@angular/cdk/a11y';\nimport { afterNextRender, inject, Injector, NgZone, signal, Signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { NgpOverlay, NgpOverlayRegistry } from 'ng-primitives/portal';\nimport {\n attrBinding,\n createPrimitive,\n dataBinding,\n listener,\n onDestroy,\n} from 'ng-primitives/state';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\n\nclass FocusTrap {\n /**\n * Whether the focus trap is active.\n */\n active: boolean = false;\n\n /**\n * Activates the focus trap.\n */\n activate(): void {\n this.active = true;\n }\n\n /**\n * Deactivates the focus trap.\n */\n deactivate(): void {\n this.active = false;\n }\n}\n\nclass FocusTrapStack {\n /**\n * The stack of focus traps.\n */\n private readonly stack: FocusTrap[] = [];\n\n /**\n * Adds a focus trap to the stack.\n */\n add(focusTrap: FocusTrap): void {\n // deactivate the previous focus trap\n this.stack.forEach(t => t.deactivate());\n\n // add the new focus trap and activate it\n this.stack.push(focusTrap);\n focusTrap.activate();\n }\n\n /**\n * Removes a focus trap from the stack.\n */\n remove(focusTrap: FocusTrap): void {\n // remove the focus trap\n const index = this.stack.indexOf(focusTrap);\n\n if (index < 0) {\n return;\n }\n\n // Only reactivate the previous trap if we're removing from the top of the stack.\n // This prevents reactivating a parent trap when closing all overlays (where the\n // parent is removed first, leaving the child at the top).\n const wasOnTop = index === this.stack.length - 1;\n\n // Deactivate the removed focus trap so its event listeners don't interfere\n focusTrap.deactivate();\n this.stack.splice(index, 1);\n\n // activate the previous focus trap only if removed from top\n if (wasOnTop) {\n const previous = this.stack[this.stack.length - 1];\n\n if (previous) {\n previous.activate();\n }\n }\n }\n}\n\n// create a global stack of focus traps\nconst focusTrapStack = new FocusTrapStack();\n\n/**\n * The state for the FocusTrap primitive.\n */\nexport interface NgpFocusTrapState {\n // No public API\n}\n\n/**\n * The props for the FocusTrap primitive.\n */\nexport interface NgpFocusTrapProps {\n /**\n * Whether the focus trap is disabled.\n */\n readonly disabled?: Signal<boolean>;\n\n /**\n * The focus origin to use when programmatically focusing elements.\n * If not provided, falls back to the FocusMonitor's last known origin.\n */\n readonly focusOrigin?: Signal<FocusOrigin>;\n}\n\nexport const [NgpFocusTrapStateToken, ngpFocusTrap, injectFocusTrapState, provideFocusTrapState] =\n createPrimitive(\n 'NgpFocusTrap',\n ({ disabled = signal(false), focusOrigin }: NgpFocusTrapProps) => {\n const element = injectElementRef();\n const overlay = inject(NgpOverlay, { optional: true });\n const injector = inject(Injector);\n const focusMonitor = inject(FocusMonitor);\n const interactivityChecker = inject(InteractivityChecker);\n const ngZone = inject(NgZone);\n const overlayRegistry = inject(NgpOverlayRegistry);\n\n // Create a new focus trap\n const focusTrap = new FocusTrap();\n\n // Store the mutation observer\n let mutationObserver: MutationObserver | null = null;\n\n // Store the last focused element\n let lastFocusedElement: HTMLElement | null = null;\n\n // Host bindings\n attrBinding(element, 'tabindex', '-1');\n dataBinding(element, 'data-focus-trap', () => (disabled() ? null : ''));\n\n // Setup the focus trap\n function setupFocusTrap(): void {\n focusTrapStack.add(focusTrap);\n\n mutationObserver = new MutationObserver(handleMutations);\n\n // Setup event listeners\n ngZone.runOutsideAngular(() => {\n mutationObserver!.observe(element.nativeElement, {\n childList: true,\n subtree: true,\n });\n document.addEventListener('focusin', handleFocusIn);\n document.addEventListener('focusout', handleFocusOut);\n });\n\n const previouslyFocusedElement = document.activeElement as HTMLElement | null;\n const hasFocusedCandidate = element.nativeElement.contains(previouslyFocusedElement);\n\n // Only perform initial focusing if the focus trap is not disabled\n if (!hasFocusedCandidate && !disabled?.()) {\n // we do this to ensure the content is rendered before we try to find the first focusable element\n // and focus it\n afterNextRender(\n {\n write: () => {\n focusFirst();\n\n // if the focus didn't change, focus the container\n if (document.activeElement === previouslyFocusedElement) {\n focus(element.nativeElement);\n }\n },\n },\n { injector },\n );\n }\n }\n\n function teardownFocusTrap(): void {\n // Remove from stack (this also deactivates the trap)\n focusTrapStack.remove(focusTrap);\n mutationObserver?.disconnect();\n mutationObserver = null;\n\n // Remove event listeners\n document.removeEventListener('focusin', handleFocusIn);\n document.removeEventListener('focusout', handleFocusOut);\n }\n\n function handleFocusIn(event: FocusEvent): void {\n if (!focusTrap.active || disabled?.()) {\n return;\n }\n\n const target = event.target as HTMLElement | null;\n\n if (element.nativeElement.contains(target)) {\n lastFocusedElement = target;\n } else if (isAllowedExternalTarget(target)) {\n // Don't interfere — see `isAllowedExternalTarget` for details.\n } else {\n focus(lastFocusedElement);\n }\n }\n\n /**\n * Handles the `focusout` event.\n */\n function handleFocusOut(event: FocusEvent) {\n if (!focusTrap.active || disabled?.() || event.relatedTarget === null) {\n return;\n }\n\n const relatedTarget = event.relatedTarget as HTMLElement;\n\n if (\n !element.nativeElement.contains(relatedTarget) &&\n !isAllowedExternalTarget(relatedTarget)\n ) {\n focus(lastFocusedElement);\n }\n }\n\n /**\n * Whether the given element belongs to another focus trap, a CDK overlay\n * container, or an open ng-primitives overlay (e.g. a combobox/menu/popover\n * dropdown rendered into a portal).\n *\n * When focus moves to these elements we must not redirect it back, because\n * they manage their own focus or are an intentional escape hatch from the\n * trapped region. Without this check, opening a combobox dropdown from\n * inside a focus-trapped dialog would yank focus back into the dialog as\n * soon as the user tried to focus the dropdown's search input, making it\n * unusable.\n *\n * See https://github.com/ng-primitives/ng-primitives/issues/682\n * and https://github.com/ng-primitives/ng-primitives/issues/687\n */\n function isAllowedExternalTarget(target: HTMLElement | null): boolean {\n if (!target) {\n return false;\n }\n if (target.closest?.('[data-focus-trap]') || target.closest?.('.cdk-overlay-container')) {\n return true;\n }\n return overlayRegistry.findContainingOverlay(target) !== null;\n }\n\n /**\n * If the focused element gets removed from the DOM, browsers move focus back to the document.body.\n * We move focus to the container to keep focus trapped correctly.\n */\n function handleMutations(mutations: MutationRecord[]): void {\n // Don't handle mutations if the focus trap is not active (e.g., during overlay close)\n if (!focusTrap.active || disabled?.()) {\n return;\n }\n\n const focusedElement = document.activeElement as HTMLElement | null;\n\n if (focusedElement !== document.body) {\n return;\n }\n\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) {\n focus(element.nativeElement);\n }\n }\n }\n\n /**\n * Handles the `keydown` event.\n */\n function handleKeyDown(event: KeyboardEvent): void {\n if (!focusTrap.active || disabled?.()) {\n return;\n }\n\n const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement as HTMLElement | null;\n\n if (isTabKey && focusedElement) {\n const container = event.currentTarget as HTMLElement;\n const [first, last] = getTabbableEdges(container);\n const hasTabbableElementsInside = first && last;\n\n // we can only wrap focus if we have tabbable edges\n if (!hasTabbableElementsInside) {\n if (focusedElement === container) {\n event.preventDefault();\n }\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n focus(first);\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n focus(last);\n }\n }\n }\n }\n\n /**\n * Returns the first and last tabbable elements inside a container.\n */\n function getTabbableEdges(container: HTMLElement) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates);\n const last = findVisible(candidates.reverse());\n return [first, last] as const;\n }\n\n /**\n * Returns a list of potential focusable elements inside a container.\n */\n function getTabbableCandidates(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: HTMLElement) =>\n interactivityChecker.isTabbable(node)\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_SKIP,\n });\n while (walker.nextNode()) {\n nodes.push(walker.currentNode as HTMLElement);\n }\n return nodes;\n }\n\n /**\n * Returns the first visible element in a list.\n */\n function findVisible(elements: HTMLElement[]) {\n return elements.find(element => interactivityChecker.isVisible(element)) ?? null;\n }\n\n function focus(element: HTMLElement | null): void {\n if (!element) {\n return;\n }\n // Use the provided focus origin if available, otherwise fall back to FocusMonitor's last origin\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const origin = focusOrigin?.() ?? (focusMonitor as any)._lastFocusOrigin ?? 'program';\n focusMonitor.focusVia(element, origin, {\n preventScroll: true,\n });\n }\n\n function focusFirst(): void {\n const previouslyFocusedElement = document.activeElement;\n\n for (const candidate of getTabbableCandidates(element.nativeElement)) {\n focus(candidate);\n\n if (document.activeElement !== previouslyFocusedElement) {\n return;\n }\n }\n }\n\n // Setup the focus trap\n setupFocusTrap();\n\n // Teardown the focus trap on destroy\n onDestroy(teardownFocusTrap);\n\n // Listen to keydown events\n listener(element, 'keydown', handleKeyDown);\n\n // if this is used within an overlay we must remove the focus trap from the stack as soon as the overlay is closing\n // this prevents reactivation of parent focus traps during component destruction\n overlay?.closing.pipe(safeTakeUntilDestroyed()).subscribe(() => {\n focusTrapStack.remove(focusTrap);\n });\n\n return {} satisfies NgpFocusTrapState;\n },\n );\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { ngpFocusTrap, provideFocusTrapState } from './focus-trap-state';\n\n/**\n * This implementation is based on the Radix UI FocusScope:\n * https://github.com/radix-ui/primitives/blob/main/packages/react/focus-scope/src/FocusScope.tsx#L306\n */\n\n/**\n * The `NgpFocusTrap` directive traps focus within the host element.\n */\n@Directive({\n selector: '[ngpFocusTrap]',\n exportAs: 'ngpFocusTrap',\n providers: [provideFocusTrapState()],\n})\nexport class NgpFocusTrap {\n /**\n * Whether the focus trap is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFocusTrapDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The focus trap state.\n */\n constructor() {\n ngpFocusTrap({ disabled: this.disabled });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAaA,MAAM,SAAS,CAAA;AAAf,IAAA,WAAA,GAAA;AACE;;AAEG;QACH,IAAA,CAAA,MAAM,GAAY,KAAK;IAezB;AAbE;;AAEG;IACH,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI;IACpB;AAEA;;AAEG;IACH,UAAU,GAAA;AACR,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK;IACrB;AACD;AAED,MAAM,cAAc,CAAA;AAApB,IAAA,WAAA,GAAA;AACE;;AAEG;QACc,IAAA,CAAA,KAAK,GAAgB,EAAE;IA2C1C;AAzCE;;AAEG;AACH,IAAA,GAAG,CAAC,SAAoB,EAAA;;AAEtB,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;;AAGvC,QAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;QAC1B,SAAS,CAAC,QAAQ,EAAE;IACtB;AAEA;;AAEG;AACH,IAAA,MAAM,CAAC,SAAoB,EAAA;;QAEzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAE3C,QAAA,IAAI,KAAK,GAAG,CAAC,EAAE;YACb;QACF;;;;QAKA,MAAM,QAAQ,GAAG,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;;QAGhD,SAAS,CAAC,UAAU,EAAE;QACtB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;;QAG3B,IAAI,QAAQ,EAAE;AACZ,YAAA,MAAM,QAAQ,GAA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A,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,SAAA,EAFZ,CAAC,qBAAqB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAEzB,YAAY,EAAA,UAAA,EAAA,CAAA;kBALxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,SAAS,EAAE,CAAC,qBAAqB,EAAE,CAAC;AACrC,iBAAA;;;AChBD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-focus-trap.mjs","sources":["../../../../packages/ng-primitives/focus-trap/src/focus-trap/focus-trap-state.ts","../../../../packages/ng-primitives/focus-trap/src/focus-trap/focus-trap.ts","../../../../packages/ng-primitives/focus-trap/src/ng-primitives-focus-trap.ts"],"sourcesContent":["import { FocusMonitor, FocusOrigin, InteractivityChecker } from '@angular/cdk/a11y';\nimport { afterNextRender, inject, Injector, NgZone, signal, Signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { NgpOverlay, NgpOverlayRegistry } from 'ng-primitives/portal';\nimport {\n attrBinding,\n createPrimitive,\n dataBinding,\n listener,\n onDestroy,\n} from 'ng-primitives/state';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\n\nclass FocusTrap {\n /**\n * Whether the focus trap is active.\n */\n active: boolean = false;\n\n /**\n * Activates the focus trap.\n */\n activate(): void {\n this.active = true;\n }\n\n /**\n * Deactivates the focus trap.\n */\n deactivate(): void {\n this.active = false;\n }\n}\n\nclass FocusTrapStack {\n /**\n * The stack of focus traps.\n */\n private readonly stack: FocusTrap[] = [];\n\n /**\n * Adds a focus trap to the stack.\n */\n add(focusTrap: FocusTrap): void {\n // deactivate the previous focus trap\n this.stack.forEach(t => t.deactivate());\n\n // add the new focus trap and activate it\n this.stack.push(focusTrap);\n focusTrap.activate();\n }\n\n /**\n * Removes a focus trap from the stack.\n */\n remove(focusTrap: FocusTrap): void {\n // remove the focus trap\n const index = this.stack.indexOf(focusTrap);\n\n if (index < 0) {\n return;\n }\n\n // Only reactivate the previous trap if we're removing from the top of the stack.\n // This prevents reactivating a parent trap when closing all overlays (where the\n // parent is removed first, leaving the child at the top).\n const wasOnTop = index === this.stack.length - 1;\n\n // Deactivate the removed focus trap so its event listeners don't interfere\n focusTrap.deactivate();\n this.stack.splice(index, 1);\n\n // activate the previous focus trap only if removed from top\n if (wasOnTop) {\n const previous = this.stack[this.stack.length - 1];\n\n if (previous) {\n previous.activate();\n }\n }\n }\n}\n\n// create a global stack of focus traps\nconst focusTrapStack = new FocusTrapStack();\n\n/**\n * The state for the FocusTrap primitive.\n */\nexport interface NgpFocusTrapState {\n // No public API\n}\n\n/**\n * The props for the FocusTrap primitive.\n */\nexport interface NgpFocusTrapProps {\n /**\n * Whether the focus trap is disabled.\n */\n readonly disabled?: Signal<boolean>;\n\n /**\n * The focus origin to use when programmatically focusing elements.\n * If not provided, falls back to the FocusMonitor's last known origin.\n */\n readonly focusOrigin?: Signal<FocusOrigin>;\n}\n\nexport const [NgpFocusTrapStateToken, ngpFocusTrap, injectFocusTrapState, provideFocusTrapState] =\n createPrimitive(\n 'NgpFocusTrap',\n ({ disabled = signal(false), focusOrigin }: NgpFocusTrapProps) => {\n const element = injectElementRef();\n const overlay = inject(NgpOverlay, { optional: true });\n const injector = inject(Injector);\n const focusMonitor = inject(FocusMonitor);\n const interactivityChecker = inject(InteractivityChecker);\n const ngZone = inject(NgZone);\n const overlayRegistry = inject(NgpOverlayRegistry);\n\n // Create a new focus trap\n const focusTrap = new FocusTrap();\n\n // Store the mutation observer\n let mutationObserver: MutationObserver | null = null;\n\n // Store the last focused element\n let lastFocusedElement: HTMLElement | null = null;\n\n // Host bindings\n attrBinding(element, 'tabindex', '-1');\n dataBinding(element, 'data-focus-trap', () => (disabled() ? null : ''));\n\n // Setup the focus trap\n function setupFocusTrap(): void {\n focusTrapStack.add(focusTrap);\n\n mutationObserver = new MutationObserver(handleMutations);\n\n // Setup event listeners\n ngZone.runOutsideAngular(() => {\n mutationObserver!.observe(element.nativeElement, {\n childList: true,\n subtree: true,\n });\n document.addEventListener('focusin', handleFocusIn);\n document.addEventListener('focusout', handleFocusOut);\n });\n\n const previouslyFocusedElement = document.activeElement as HTMLElement | null;\n const hasFocusedCandidate = element.nativeElement.contains(previouslyFocusedElement);\n\n // Only perform initial focusing if the focus trap is not disabled\n if (!hasFocusedCandidate && !disabled?.()) {\n // we do this to ensure the content is rendered before we try to find the first focusable element\n // and focus it\n afterNextRender(\n {\n write: () => {\n focusFirst();\n\n // if the focus didn't change, focus the container\n if (document.activeElement === previouslyFocusedElement) {\n focus(element.nativeElement);\n }\n },\n },\n { injector },\n );\n }\n }\n\n function teardownFocusTrap(): void {\n // Remove from stack (this also deactivates the trap)\n focusTrapStack.remove(focusTrap);\n mutationObserver?.disconnect();\n mutationObserver = null;\n\n // Remove event listeners\n document.removeEventListener('focusin', handleFocusIn);\n document.removeEventListener('focusout', handleFocusOut);\n }\n\n function handleFocusIn(event: FocusEvent): void {\n if (!focusTrap.active || disabled?.()) {\n return;\n }\n\n const target = event.target as HTMLElement | null;\n\n if (element.nativeElement.contains(target)) {\n lastFocusedElement = target;\n } else if (isAllowedExternalTarget(target)) {\n // Don't interfere — see `isAllowedExternalTarget` for details.\n } else {\n focus(lastFocusedElement);\n }\n }\n\n /**\n * Handles the `focusout` event.\n */\n function handleFocusOut(event: FocusEvent) {\n if (!focusTrap.active || disabled?.() || event.relatedTarget === null) {\n return;\n }\n\n const relatedTarget = event.relatedTarget as HTMLElement;\n\n if (\n !element.nativeElement.contains(relatedTarget) &&\n !isAllowedExternalTarget(relatedTarget)\n ) {\n focus(lastFocusedElement);\n }\n }\n\n /**\n * Whether the given element belongs to another focus trap, a CDK overlay\n * container, or an open ng-primitives overlay (e.g. a combobox/menu/popover\n * dropdown rendered into a portal).\n *\n * When focus moves to these elements we must not redirect it back, because\n * they manage their own focus or are an intentional escape hatch from the\n * trapped region. Without this check, opening a combobox dropdown from\n * inside a focus-trapped dialog would yank focus back into the dialog as\n * soon as the user tried to focus the dropdown's search input, making it\n * unusable.\n *\n * See https://github.com/ng-primitives/ng-primitives/issues/682\n * and https://github.com/ng-primitives/ng-primitives/issues/687\n */\n function isAllowedExternalTarget(target: HTMLElement | null): boolean {\n if (!target) {\n return false;\n }\n if (target.closest?.('[data-focus-trap]') || target.closest?.('.cdk-overlay-container')) {\n return true;\n }\n return overlayRegistry.findContainingOverlay(target) !== null;\n }\n\n /**\n * If the focused element gets removed from the DOM, browsers move focus back to the document.body.\n * We move focus to the container to keep focus trapped correctly.\n */\n function handleMutations(mutations: MutationRecord[]): void {\n // Don't handle mutations if the focus trap is not active (e.g., during overlay close)\n if (!focusTrap.active || disabled?.()) {\n return;\n }\n\n const focusedElement = document.activeElement as HTMLElement | null;\n\n if (focusedElement !== document.body) {\n return;\n }\n\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) {\n focus(element.nativeElement);\n }\n }\n }\n\n /**\n * Handles the `keydown` event.\n */\n function handleKeyDown(event: KeyboardEvent): void {\n if (!focusTrap.active || disabled?.()) {\n return;\n }\n\n const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement as HTMLElement | null;\n\n if (isTabKey && focusedElement) {\n const container = event.currentTarget as HTMLElement;\n const [first, last] = getTabbableEdges(container);\n const hasTabbableElementsInside = first && last;\n\n // we can only wrap focus if we have tabbable edges\n if (!hasTabbableElementsInside) {\n if (focusedElement === container) {\n event.preventDefault();\n }\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n focus(first);\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n focus(last);\n }\n }\n }\n }\n\n /**\n * Returns the first and last tabbable elements inside a container.\n */\n function getTabbableEdges(container: HTMLElement) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates);\n const last = findVisible(candidates.reverse());\n return [first, last] as const;\n }\n\n /**\n * Returns a list of potential focusable elements inside a container.\n */\n function getTabbableCandidates(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: HTMLElement) =>\n interactivityChecker.isTabbable(node)\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_SKIP,\n });\n while (walker.nextNode()) {\n nodes.push(walker.currentNode as HTMLElement);\n }\n return nodes;\n }\n\n /**\n * Returns the first visible element in a list.\n */\n function findVisible(elements: HTMLElement[]) {\n return elements.find(element => interactivityChecker.isVisible(element)) ?? null;\n }\n\n function focus(element: HTMLElement | null): void {\n if (!element) {\n return;\n }\n // Use the provided focus origin if available, otherwise fall back to FocusMonitor's last origin\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const origin = focusOrigin?.() ?? (focusMonitor as any)._lastFocusOrigin ?? 'program';\n focusMonitor.focusVia(element, origin, {\n preventScroll: true,\n });\n }\n\n function focusFirst(): void {\n const previouslyFocusedElement = document.activeElement;\n\n for (const candidate of getTabbableCandidates(element.nativeElement)) {\n focus(candidate);\n\n if (document.activeElement !== previouslyFocusedElement) {\n return;\n }\n }\n }\n\n // Setup the focus trap\n setupFocusTrap();\n\n // Teardown the focus trap on destroy\n onDestroy(teardownFocusTrap);\n\n // Listen to keydown events\n listener(element, 'keydown', handleKeyDown);\n\n // if this is used within an overlay we must remove the focus trap from the stack as soon as the overlay is closing\n // this prevents reactivation of parent focus traps during component destruction\n overlay?.closing.pipe(safeTakeUntilDestroyed()).subscribe(() => {\n focusTrapStack.remove(focusTrap);\n });\n\n return {} satisfies NgpFocusTrapState;\n },\n );\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { ngpFocusTrap, provideFocusTrapState } from './focus-trap-state';\n\n/**\n * This implementation is based on the Radix UI FocusScope:\n * https://github.com/radix-ui/primitives/blob/main/packages/react/focus-scope/src/FocusScope.tsx#L306\n */\n\n/**\n * The `NgpFocusTrap` directive traps focus within the host element.\n */\n@Directive({\n selector: '[ngpFocusTrap]',\n exportAs: 'ngpFocusTrap',\n providers: [provideFocusTrapState()],\n})\nexport class NgpFocusTrap {\n /**\n * Whether the focus trap is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFocusTrapDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The focus trap state.\n */\n constructor() {\n ngpFocusTrap({ disabled: this.disabled });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAaA,MAAM,SAAS,CAAA;AAAf,IAAA,WAAA,GAAA;AACE;;AAEG;QACH,IAAA,CAAA,MAAM,GAAY,KAAK;IAezB;AAbE;;AAEG;IACH,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI;IACpB;AAEA;;AAEG;IACH,UAAU,GAAA;AACR,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK;IACrB;AACD;AAED,MAAM,cAAc,CAAA;AAApB,IAAA,WAAA,GAAA;AACE;;AAEG;QACc,IAAA,CAAA,KAAK,GAAgB,EAAE;IA2C1C;AAzCE;;AAEG;AACH,IAAA,GAAG,CAAC,SAAoB,EAAA;;AAEtB,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;;AAGvC,QAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;QAC1B,SAAS,CAAC,QAAQ,EAAE;IACtB;AAEA;;AAEG;AACH,IAAA,MAAM,CAAC,SAAoB,EAAA;;QAEzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;AAE3C,QAAA,IAAI,KAAK,GAAG,CAAC,EAAE;YACb;QACF;;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