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
@@ -9,21 +9,21 @@ const [NgpFormFieldStateToken, ngpFormField, injectFormFieldState, provideFormFi
9
9
  const element = injectElementRef();
10
10
  const injector = inject(Injector);
11
11
  // Store the form labels
12
- const labels = signal([], ...(ngDevMode ? [{ debugName: "labels" }] : []));
12
+ const labels = signal([], ...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
13
13
  // Store the form descriptions
14
- const descriptions = signal([], ...(ngDevMode ? [{ debugName: "descriptions" }] : []));
14
+ const descriptions = signal([], ...(ngDevMode ? [{ debugName: "descriptions" }] : /* istanbul ignore next */ []));
15
15
  // Store the id of the associated form control
16
- const formControl = signal(null, ...(ngDevMode ? [{ debugName: "formControl" }] : []));
16
+ const formControl = signal(null, ...(ngDevMode ? [{ debugName: "formControl" }] : /* istanbul ignore next */ []));
17
17
  // Store the validation error messages
18
- const errors = signal([], ...(ngDevMode ? [{ debugName: "errors" }] : []));
18
+ const errors = signal([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
19
19
  // Form control state signals
20
- const pristine = signal(null, ...(ngDevMode ? [{ debugName: "pristine" }] : []));
21
- const touched = signal(null, ...(ngDevMode ? [{ debugName: "touched" }] : []));
22
- const dirty = signal(null, ...(ngDevMode ? [{ debugName: "dirty" }] : []));
23
- const valid = signal(null, ...(ngDevMode ? [{ debugName: "valid" }] : []));
24
- const invalid = signal(null, ...(ngDevMode ? [{ debugName: "invalid" }] : []));
25
- const pending = signal(null, ...(ngDevMode ? [{ debugName: "pending" }] : []));
26
- const disabled = signal(null, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
20
+ const pristine = signal(null, ...(ngDevMode ? [{ debugName: "pristine" }] : /* istanbul ignore next */ []));
21
+ const touched = signal(null, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
22
+ const dirty = signal(null, ...(ngDevMode ? [{ debugName: "dirty" }] : /* istanbul ignore next */ []));
23
+ const valid = signal(null, ...(ngDevMode ? [{ debugName: "valid" }] : /* istanbul ignore next */ []));
24
+ const invalid = signal(null, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
25
+ const pending = signal(null, ...(ngDevMode ? [{ debugName: "pending" }] : /* istanbul ignore next */ []));
26
+ const disabled = signal(null, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
27
27
  // Store the current status subscription
28
28
  let subscription;
29
29
  // Host bindings
@@ -170,13 +170,13 @@ class NgpDescription {
170
170
  /**
171
171
  * The id of the description. If not provided, a unique id will be generated.
172
172
  */
173
- this.id = input(uniqueId('ngp-description'), ...(ngDevMode ? [{ debugName: "id" }] : []));
173
+ this.id = input(uniqueId('ngp-description'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
174
174
  ngpDescription({ id: this.id });
175
175
  }
176
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
177
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpDescription, isStandalone: true, selector: "[ngpDescription]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideDescriptionState()], exportAs: ["ngpDescription"], ngImport: i0 }); }
176
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
177
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: NgpDescription, isStandalone: true, selector: "[ngpDescription]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideDescriptionState()], exportAs: ["ngpDescription"], ngImport: i0 }); }
178
178
  }
179
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpDescription, decorators: [{
179
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpDescription, decorators: [{
180
180
  type: Directive,
181
181
  args: [{
182
182
  selector: '[ngpDescription]',
@@ -193,9 +193,9 @@ const [NgpErrorStateToken, ngpError, injectErrorState, provideErrorState] = crea
193
193
  const errors = formField()?.errors() ?? [];
194
194
  const validatorValue = validator();
195
195
  return validatorValue ? errors?.includes(validatorValue) : errors?.length > 0;
196
- }, ...(ngDevMode ? [{ debugName: "hasError" }] : []));
196
+ }, ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
197
197
  // Determine whether the validator associated with this error is failing
198
- const state = computed(() => (hasError() ? 'fail' : 'pass'), ...(ngDevMode ? [{ debugName: "state" }] : []));
198
+ const state = computed(() => (hasError() ? 'fail' : 'pass'), ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
199
199
  // Host bindings
200
200
  attrBinding(element, 'id', id);
201
201
  dataBinding(element, 'data-invalid', () => (formField()?.invalid() ? '' : null));
@@ -251,19 +251,17 @@ class NgpError {
251
251
  /**
252
252
  * The id of the error message. If not provided, a unique id will be generated.
253
253
  */
254
- this.id = input(uniqueId('ngp-error'), ...(ngDevMode ? [{ debugName: "id" }] : []));
254
+ this.id = input(uniqueId('ngp-error'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
255
255
  /**
256
256
  * The validator associated with the error message.
257
257
  */
258
- this.validator = input(null, ...(ngDevMode ? [{ debugName: "validator", alias: 'ngpErrorValidator' }] : [{
259
- alias: 'ngpErrorValidator',
260
- }]));
258
+ this.validator = input(null, { ...(ngDevMode ? { debugName: "validator" } : /* istanbul ignore next */ {}), alias: 'ngpErrorValidator' });
261
259
  ngpError({ id: this.id, validator: this.validator });
262
260
  }
263
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpError, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
264
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpError, isStandalone: true, selector: "[ngpError]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, validator: { classPropertyName: "validator", publicName: "ngpErrorValidator", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideErrorState()], exportAs: ["ngpError"], ngImport: i0 }); }
261
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpError, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
262
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: NgpError, isStandalone: true, selector: "[ngpError]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, validator: { classPropertyName: "validator", publicName: "ngpErrorValidator", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideErrorState()], exportAs: ["ngpError"], ngImport: i0 }); }
265
263
  }
266
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpError, decorators: [{
264
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpError, decorators: [{
267
265
  type: Directive,
268
266
  args: [{
269
267
  selector: '[ngpError]',
@@ -282,12 +280,12 @@ function ngpFormControl({ id, disabled = signal(false), }) {
282
280
  const ariaLabelledBy = computed(() => {
283
281
  const labels = formField()?.labels() ?? [];
284
282
  return labels.length > 0 ? labels.join(' ') : null;
285
- }, ...(ngDevMode ? [{ debugName: "ariaLabelledBy" }] : []));
283
+ }, ...(ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []));
286
284
  // Determine the aria-describedby attribute value.
287
285
  const ariaDescribedBy = computed(() => {
288
286
  const descriptions = formField()?.descriptions() ?? [];
289
287
  return descriptions.length > 0 ? descriptions.join(' ') : null;
290
- }, ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : []));
288
+ }, ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : /* istanbul ignore next */ []));
291
289
  const supportsDisabledAttribute = 'disabled' in elementRef.nativeElement;
292
290
  // Host bindings
293
291
  attrBinding(elementRef, 'disabled', () => (supportsDisabledAttribute && disabled() ? '' : null));
@@ -318,24 +316,21 @@ class NgpFormControl {
318
316
  /**
319
317
  * The id of the form control. If not provided, a unique id will be generated.
320
318
  */
321
- this.id = input(uniqueId('ngp-form-control'), ...(ngDevMode ? [{ debugName: "id" }] : []));
319
+ this.id = input(uniqueId('ngp-form-control'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
322
320
  /**
323
321
  * Whether the form control is disabled by a parent.
324
322
  */
325
- this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", alias: 'ngpFormControlDisabled',
326
- transform: booleanAttribute }] : [{
327
- alias: 'ngpFormControlDisabled',
328
- transform: booleanAttribute,
329
- }]));
323
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), alias: 'ngpFormControlDisabled',
324
+ transform: booleanAttribute });
330
325
  /**
331
326
  * The status of the form control.
332
327
  */
333
328
  this.status = ngpFormControl({ id: this.id, disabled: this.disabled });
334
329
  }
335
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpFormControl, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
336
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpFormControl, isStandalone: true, selector: "[ngpFormControl]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpFormControlDisabled", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ngpFormControl"], ngImport: i0 }); }
330
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpFormControl, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
331
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: NgpFormControl, isStandalone: true, selector: "[ngpFormControl]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpFormControlDisabled", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ngpFormControl"], ngImport: i0 }); }
337
332
  }
338
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpFormControl, decorators: [{
333
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpFormControl, decorators: [{
339
334
  type: Directive,
340
335
  args: [{
341
336
  selector: '[ngpFormControl]',
@@ -355,13 +350,13 @@ class NgpFormField {
355
350
  * Find any NgControl within the form field.
356
351
  * @internal
357
352
  */
358
- this.ngControl = contentChild(NgControl, ...(ngDevMode ? [{ debugName: "ngControl" }] : []));
353
+ this.ngControl = contentChild(NgControl, ...(ngDevMode ? [{ debugName: "ngControl" }] : /* istanbul ignore next */ []));
359
354
  ngpFormField({ ngControl: this.ngControl });
360
355
  }
361
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpFormField, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
362
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.3.9", type: NgpFormField, isStandalone: true, selector: "[ngpFormField]", providers: [provideFormFieldState()], queries: [{ propertyName: "ngControl", first: true, predicate: NgControl, descendants: true, isSignal: true }], exportAs: ["ngpFormField"], ngImport: i0 }); }
356
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpFormField, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
357
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.14", type: NgpFormField, isStandalone: true, selector: "[ngpFormField]", providers: [provideFormFieldState()], queries: [{ propertyName: "ngControl", first: true, predicate: NgControl, descendants: true, isSignal: true }], exportAs: ["ngpFormField"], ngImport: i0 }); }
363
358
  }
364
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpFormField, decorators: [{
359
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpFormField, decorators: [{
365
360
  type: Directive,
366
361
  args: [{
367
362
  selector: '[ngpFormField]',
@@ -374,7 +369,7 @@ const [NgpLabelStateToken, ngpLabel, injectLabelState, provideLabelState] = crea
374
369
  const element = injectElementRef();
375
370
  const formField = injectFormFieldState({ optional: true });
376
371
  // Derive the for attribute value if the label is an HTML label element
377
- const htmlFor = computed(() => formField()?.formControl() ?? null, ...(ngDevMode ? [{ debugName: "htmlFor" }] : []));
372
+ const htmlFor = computed(() => formField()?.formControl() ?? null, ...(ngDevMode ? [{ debugName: "htmlFor" }] : /* istanbul ignore next */ []));
378
373
  // Determine if the label is an HTML label element
379
374
  const isLabel = element.nativeElement instanceof HTMLLabelElement;
380
375
  // Host bindings
@@ -452,13 +447,13 @@ class NgpLabel {
452
447
  /**
453
448
  * The id of the label. If not provided, a unique id will be generated.
454
449
  */
455
- this.id = input(uniqueId('ngp-label'), ...(ngDevMode ? [{ debugName: "id" }] : []));
450
+ this.id = input(uniqueId('ngp-label'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
456
451
  ngpLabel({ id: this.id });
457
452
  }
458
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
459
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpLabel, isStandalone: true, selector: "[ngpLabel]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideLabelState()], exportAs: ["ngpLabel"], ngImport: i0 }); }
453
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
454
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: NgpLabel, isStandalone: true, selector: "[ngpLabel]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideLabelState()], exportAs: ["ngpLabel"], ngImport: i0 }); }
460
455
  }
461
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpLabel, decorators: [{
456
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpLabel, decorators: [{
462
457
  type: Directive,
463
458
  args: [{
464
459
  selector: '[ngpLabel]',
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-form-field.mjs","sources":["../../../../packages/ng-primitives/form-field/src/form-field/form-field-state.ts","../../../../packages/ng-primitives/form-field/src/description/description-state.ts","../../../../packages/ng-primitives/form-field/src/description/description.ts","../../../../packages/ng-primitives/form-field/src/error/error-state.ts","../../../../packages/ng-primitives/form-field/src/error/error.ts","../../../../packages/ng-primitives/form-field/src/form-control/form-control-state.ts","../../../../packages/ng-primitives/form-field/src/form-control/form-control.ts","../../../../packages/ng-primitives/form-field/src/form-field/form-field.ts","../../../../packages/ng-primitives/form-field/src/label/label-state.ts","../../../../packages/ng-primitives/form-field/src/label/label.ts","../../../../packages/ng-primitives/form-field/src/ng-primitives-form-field.ts"],"sourcesContent":["import { Injector, Signal, effect, inject, signal, untracked } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { createPrimitive, dataBinding, onDestroy } from 'ng-primitives/state';\nimport { onChange } from 'ng-primitives/utils';\nimport { Subscription } from 'rxjs';\n\n/**\n * The state interface for the FormField primitive.\n */\nexport interface NgpFormFieldState {\n /**\n * The form labels.\n */\n readonly labels: Signal<string[]>;\n /**\n * The form descriptions.\n */\n readonly descriptions: Signal<string[]>;\n /**\n * The id of the associated form control.\n */\n readonly formControl: Signal<string | null>;\n /**\n * The validation error messages.\n */\n readonly errors: Signal<string[]>;\n /**\n * Whether the control is pristine.\n */\n readonly pristine: Signal<boolean | null>;\n /**\n * Whether the control is touched.\n */\n readonly touched: Signal<boolean | null>;\n /**\n * Whether the control is dirty.\n */\n readonly dirty: Signal<boolean | null>;\n /**\n * Whether the control is valid.\n */\n readonly valid: Signal<boolean | null>;\n /**\n * Whether the control is invalid.\n */\n readonly invalid: Signal<boolean | null>;\n /**\n * Whether the control is pending.\n */\n readonly pending: Signal<boolean | null>;\n /**\n * Whether the control is disabled.\n */\n readonly disabled: Signal<boolean | null>;\n /**\n * Register the id of the associated form control.\n */\n setFormControl(id: string): void;\n /**\n * Register a label with the form field.\n */\n addLabel(label: string): void;\n /**\n * Register a description with the form field.\n */\n addDescription(description: string): void;\n /**\n * Remove the associated form control.\n */\n removeFormControl(): void;\n /**\n * Remove a label from the form field.\n */\n removeLabel(label: string): void;\n /**\n * Remove a description from the form field.\n */\n removeDescription(description: string): void;\n}\n\n/**\n * The props interface for the FormField primitive.\n */\nexport interface NgpFormFieldProps {\n /**\n * Find any NgControl within the form field.\n */\n readonly ngControl: Signal<NgControl | undefined>;\n}\n\nexport const [NgpFormFieldStateToken, ngpFormField, injectFormFieldState, provideFormFieldState] =\n createPrimitive('NgpFormField', ({ ngControl }: NgpFormFieldProps) => {\n const element = injectElementRef();\n const injector = inject(Injector);\n\n // Store the form labels\n const labels = signal<string[]>([]);\n\n // Store the form descriptions\n const descriptions = signal<string[]>([]);\n\n // Store the id of the associated form control\n const formControl = signal<string | null>(null);\n\n // Store the validation error messages\n const errors = signal<string[]>([]);\n\n // Form control state signals\n const pristine = signal<boolean | null>(null);\n const touched = signal<boolean | null>(null);\n const dirty = signal<boolean | null>(null);\n const valid = signal<boolean | null>(null);\n const invalid = signal<boolean | null>(null);\n const pending = signal<boolean | null>(null);\n const disabled = signal<boolean | null>(null);\n\n // Store the current status subscription\n let subscription: Subscription | undefined;\n\n // Host bindings\n dataBinding(element, 'data-invalid', invalid);\n dataBinding(element, 'data-valid', valid);\n dataBinding(element, 'data-touched', touched);\n dataBinding(element, 'data-pristine', pristine);\n dataBinding(element, 'data-dirty', dirty);\n dataBinding(element, 'data-pending', pending);\n dataBinding(element, 'data-disabled', disabled);\n\n function updateStatus(): void {\n const control = ngControl();\n\n if (!control) {\n return;\n }\n\n // Wrap in try-catch to handle signal-forms interop controls where\n // the `field` input may not be available yet (throws NG0950).\n // Reading the signal still establishes a dependency, so the effect\n // will re-run when the input becomes available.\n try {\n const controlPristine = control.pristine;\n const controlTouched = control.touched;\n const controlDirty = control.dirty;\n const controlValid = control.valid;\n const controlInvalid = control.invalid;\n const controlPending = control.pending;\n const controlDisabled = control.disabled;\n const controlErrors = control.errors;\n\n untracked(() => {\n pristine.set(controlPristine);\n touched.set(controlTouched);\n dirty.set(controlDirty);\n valid.set(controlValid);\n invalid.set(controlInvalid);\n pending.set(controlPending);\n disabled.set(controlDisabled);\n errors.set(controlErrors ? Object.keys(controlErrors) : []);\n });\n } catch {\n // NG0950: Required input not available yet. The effect will re-run\n // when the signal input becomes available.\n }\n }\n\n function setupSubscriptions(control: NgControl | null | undefined): void {\n // Unsubscribe from the previous subscriptions.\n subscription?.unsubscribe();\n\n if (!control) {\n return;\n }\n\n // For signal-forms interop controls, use an effect to reactively track status.\n // For classic controls, also use an effect but additionally subscribe to events.\n effect(\n () => {\n updateStatus();\n },\n { injector },\n );\n\n // Classic controls also have an events observable we can subscribe to.\n const underlyingControl = control?.control;\n if (underlyingControl?.events) {\n subscription = underlyingControl.events.subscribe(() => updateStatus());\n }\n }\n\n // Setup subscriptions when ngControl changes\n onChange(ngControl, setupSubscriptions);\n\n // Cleanup subscription on destroy\n onDestroy(() => subscription?.unsubscribe());\n\n // Methods\n function setFormControl(id: string): void {\n formControl.set(id);\n }\n\n function addLabel(label: string): void {\n if (labels().includes(label)) {\n return;\n }\n\n labels.update(currentLabels => [...currentLabels, label]);\n }\n\n function addDescription(description: string): void {\n if (descriptions().includes(description)) {\n return;\n }\n\n descriptions.update(currentDescriptions => [...currentDescriptions, description]);\n }\n\n function removeFormControl(): void {\n formControl.set(null);\n }\n\n function removeLabel(label: string): void {\n labels.update(currentLabels => currentLabels.filter(l => l !== label));\n }\n\n function removeDescription(description: string): void {\n descriptions.update(currentDescriptions =>\n currentDescriptions.filter(d => d !== description),\n );\n }\n\n return {\n labels,\n descriptions,\n formControl,\n errors,\n pristine,\n touched,\n dirty,\n valid,\n invalid,\n pending,\n disabled,\n setFormControl,\n addLabel,\n addDescription,\n removeFormControl,\n removeLabel,\n removeDescription,\n } satisfies NgpFormFieldState;\n });\n","import { signal, Signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, createPrimitive, dataBinding, onDestroy } from 'ng-primitives/state';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\n/**\n * The state interface for the Description primitive.\n */\nexport interface NgpDescriptionState {\n /**\n * The id of the description.\n */\n readonly id: Signal<string>;\n}\n\n/**\n * The props interface for the Description primitive.\n */\nexport interface NgpDescriptionProps {\n /**\n * The id of the description.\n */\n readonly id: Signal<string>;\n}\n\nexport const [\n NgpDescriptionStateToken,\n ngpDescription,\n injectDescriptionState,\n provideDescriptionState,\n] = createPrimitive(\n 'NgpDescription',\n ({ id = signal(uniqueId('ngp-description')) }: NgpDescriptionProps) => {\n const element = injectElementRef();\n const formField = injectFormFieldState({ optional: true });\n\n // Host bindings\n attrBinding(element, 'id', id);\n dataBinding(element, 'data-invalid', () => (formField()?.invalid() ? '' : null));\n dataBinding(element, 'data-valid', () => (formField()?.valid() ? '' : null));\n dataBinding(element, 'data-touched', () => (formField()?.touched() ? '' : null));\n dataBinding(element, 'data-pristine', () => (formField()?.pristine() ? '' : null));\n dataBinding(element, 'data-dirty', () => (formField()?.dirty() ? '' : null));\n dataBinding(element, 'data-pending', () => (formField()?.pending() ? '' : null));\n dataBinding(element, 'data-disabled', () => (formField()?.disabled() ? '' : null));\n\n // Register with form field and cleanup on destroy\n formField()?.addDescription(id());\n onDestroy(() => formField()?.removeDescription(id()));\n\n onChange(id, (newId, oldId) => {\n if (oldId) {\n formField()?.removeDescription(oldId);\n }\n formField()?.addDescription(newId);\n });\n\n return { id } satisfies NgpDescriptionState;\n },\n);\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpDescription, provideDescriptionState } from './description-state';\n\n/**\n * The `NgpDescription` directive is used to mark a description element within a form field. There may be multiple descriptions associated with a form control.\n */\n@Directive({\n selector: '[ngpDescription]',\n exportAs: 'ngpDescription',\n providers: [provideDescriptionState()],\n})\nexport class NgpDescription {\n /**\n * The id of the description. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-description'));\n\n /**\n * The description state.\n */\n constructor() {\n ngpDescription({ id: this.id });\n }\n}\n","import { Signal, computed, signal } from '@angular/core';\nimport { explicitEffect, injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, createPrimitive, dataBinding, onDestroy } from 'ng-primitives/state';\nimport { onBooleanChange } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\n/**\n * The state interface for the Error primitive.\n */\nexport interface NgpErrorState {\n /**\n * The id of the error message.\n */\n readonly id: Signal<string>;\n /**\n * Determine if there is an error message.\n */\n readonly hasError: Signal<boolean>;\n /**\n * Determine whether the validator associated with this error is failing.\n */\n readonly state: Signal<'fail' | 'pass'>;\n}\n\n/**\n * The props interface for the Error primitive.\n */\nexport interface NgpErrorProps {\n /**\n * The id of the error message.\n */\n readonly id: Signal<string>;\n /**\n * The validator associated with the error message.\n */\n readonly validator?: Signal<string | null>;\n}\n\nexport const [NgpErrorStateToken, ngpError, injectErrorState, provideErrorState] = createPrimitive(\n 'NgpError',\n ({ id, validator = signal(null) }: NgpErrorProps) => {\n const element = injectElementRef();\n const formField = injectFormFieldState({ optional: true });\n\n // Determine if there is an error message\n const hasError = computed(() => {\n const errors = formField()?.errors() ?? [];\n const validatorValue = validator();\n\n return validatorValue ? errors?.includes(validatorValue) : errors?.length > 0;\n });\n\n // Determine whether the validator associated with this error is failing\n const state = computed(() => (hasError() ? 'fail' : 'pass'));\n\n // Host bindings\n attrBinding(element, 'id', id);\n dataBinding(element, 'data-invalid', () => (formField()?.invalid() ? '' : null));\n dataBinding(element, 'data-valid', () => (formField()?.valid() ? '' : null));\n dataBinding(element, 'data-touched', () => (formField()?.touched() ? '' : null));\n dataBinding(element, 'data-pristine', () => (formField()?.pristine() ? '' : null));\n dataBinding(element, 'data-dirty', () => (formField()?.dirty() ? '' : null));\n dataBinding(element, 'data-pending', () => (formField()?.pending() ? '' : null));\n dataBinding(element, 'data-disabled', () => (formField()?.disabled() ? '' : null));\n dataBinding(element, 'data-validator', state);\n\n let currentId = id();\n\n // Register/unregister with form field based on error state\n function registerError(): void {\n formField()?.addDescription(currentId);\n }\n\n function unregisterError(): void {\n formField()?.removeDescription(currentId);\n }\n\n // Update error registration when hasError changes\n onBooleanChange(hasError, registerError, unregisterError);\n\n function updateIdRegistration(newId: string, oldId?: string): void {\n if (oldId && hasError()) {\n formField()?.removeDescription(oldId);\n }\n currentId = newId;\n if (hasError()) {\n formField()?.addDescription(newId);\n }\n }\n\n // Watch for id changes to update registration\n explicitEffect([id], () => updateIdRegistration(id(), currentId));\n\n // Cleanup on destroy\n onDestroy(() => {\n if (hasError()) {\n formField()?.removeDescription(currentId);\n }\n });\n\n return {\n id,\n hasError,\n state,\n } satisfies NgpErrorState;\n },\n);\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpError, provideErrorState } from './error-state';\n\n/**\n * The `NgpError` directive is used to mark an error message element within a form field. There may be multiple error messages associated with a form control.\n */\n@Directive({\n selector: '[ngpError]',\n exportAs: 'ngpError',\n providers: [provideErrorState()],\n})\nexport class NgpError {\n /**\n * The id of the error message. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-error'));\n\n /**\n * The validator associated with the error message.\n */\n readonly validator = input<string | null>(null, {\n alias: 'ngpErrorValidator',\n });\n\n /**\n * The error state.\n */\n constructor() {\n ngpError({ id: this.id, validator: this.validator });\n }\n}\n","import { Signal, computed, signal } from '@angular/core';\nimport { explicitEffect, injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, dataBinding } from 'ng-primitives/state';\nimport { NgpControlStatus, controlStatus } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\ninterface NgpFormControlProps {\n /**\n * The id of the form control.\n */\n\n readonly id: Signal<string>;\n /**\n * Whether the form control is disabled by a parent.\n */\n readonly disabled?: Signal<boolean>;\n}\n\nexport function ngpFormControl({\n id,\n disabled = signal(false),\n}: NgpFormControlProps): Signal<NgpControlStatus> {\n const elementRef = injectElementRef();\n // Access the form field that the form control is associated with.\n const formField = injectFormFieldState({ optional: true });\n // Access the form control status.\n const status = controlStatus();\n // Determine the aria-labelledby attribute value.\n const ariaLabelledBy = computed(() => {\n const labels = formField()?.labels() ?? [];\n return labels.length > 0 ? labels.join(' ') : null;\n });\n // Determine the aria-describedby attribute value.\n const ariaDescribedBy = computed(() => {\n const descriptions = formField()?.descriptions() ?? [];\n return descriptions.length > 0 ? descriptions.join(' ') : null;\n });\n\n const supportsDisabledAttribute = 'disabled' in elementRef.nativeElement;\n\n // Host bindings\n attrBinding(elementRef, 'disabled', () => (supportsDisabledAttribute && disabled() ? '' : null));\n\n explicitEffect([id], ([id], onCleanup) => {\n formField()?.setFormControl(id);\n onCleanup(() => formField()?.removeFormControl());\n });\n\n attrBinding(elementRef, 'id', id);\n attrBinding(elementRef, 'aria-labelledby', ariaLabelledBy);\n attrBinding(elementRef, 'aria-describedby', ariaDescribedBy);\n dataBinding(elementRef, 'data-invalid', () => status().invalid);\n dataBinding(elementRef, 'data-valid', () => status().valid);\n dataBinding(elementRef, 'data-touched', () => status().touched);\n dataBinding(elementRef, 'data-pristine', () => status().pristine);\n dataBinding(elementRef, 'data-dirty', () => status().dirty);\n dataBinding(elementRef, 'data-pending', () => status().pending);\n dataBinding(elementRef, 'data-disabled', () => disabled() || status().disabled);\n\n return computed(() => ({ ...status(), disabled: status().disabled || disabled() }));\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpFormControl } from './form-control-state';\n\n/**\n * Typically this primitive would be not be used directly, but instead a more specific form control primitive would be used (e.g. `ngpInput`). All of our form control primitives use `ngpFormControl` internally so they will have the same accessibility features as described below.\n *\n * The `NgpFormControl` directive is used to mark a form control element within a form field. This element will have an `aria-labelledby` attribute set to the ID of the label element within the form field and an `aria-describedby` attribute set to the ID of the description elements within the form field.\n */\n@Directive({\n selector: '[ngpFormControl]',\n exportAs: 'ngpFormControl',\n})\nexport class NgpFormControl {\n /**\n * The id of the form control. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-form-control'));\n\n /**\n * Whether the form control is disabled by a parent.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFormControlDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The status of the form control.\n */\n readonly status = ngpFormControl({ id: this.id, disabled: this.disabled });\n}\n","import { Directive, contentChild } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { ngpFormField, provideFormFieldState } from './form-field-state';\n\n/**\n * The `NgpFormField` directive is a container for form field elements. Any labels, form controls, or descriptions should be placed within this directive.\n */\n@Directive({\n selector: '[ngpFormField]',\n exportAs: 'ngpFormField',\n providers: [provideFormFieldState()],\n})\nexport class NgpFormField {\n /**\n * Find any NgControl within the form field.\n * @internal\n */\n private readonly ngControl = contentChild(NgControl);\n\n /**\n * The form field state.\n */\n constructor() {\n ngpFormField({ ngControl: this.ngControl });\n }\n}\n","import { Signal, computed } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n attrBinding,\n createPrimitive,\n dataBinding,\n listener,\n onDestroy,\n} from 'ng-primitives/state';\nimport { onChange } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\n/**\n * The state interface for the Label primitive.\n */\nexport interface NgpLabelState {\n /**\n * The id of the label.\n */\n readonly id: Signal<string>;\n /**\n * The htmlFor attribute value.\n */\n readonly htmlFor: Signal<string | null>;\n}\n\n/**\n * The props interface for the Label primitive.\n */\nexport interface NgpLabelProps {\n /**\n * The id of the label.\n */\n readonly id: Signal<string>;\n}\n\nexport const [NgpLabelStateToken, ngpLabel, injectLabelState, provideLabelState] = createPrimitive(\n 'NgpLabel',\n ({ id }: NgpLabelProps) => {\n const element = injectElementRef();\n const formField = injectFormFieldState({ optional: true });\n\n // Derive the for attribute value if the label is an HTML label element\n const htmlFor = computed(() => formField()?.formControl() ?? null);\n\n // Determine if the label is an HTML label element\n const isLabel = element.nativeElement instanceof HTMLLabelElement;\n\n // Host bindings\n attrBinding(element, 'id', id);\n attrBinding(element, 'for', htmlFor);\n dataBinding(element, 'data-invalid', () => (formField()?.invalid() ? '' : null));\n dataBinding(element, 'data-valid', () => (formField()?.valid() ? '' : null));\n dataBinding(element, 'data-touched', () => (formField()?.touched() ? '' : null));\n dataBinding(element, 'data-pristine', () => (formField()?.pristine() ? '' : null));\n dataBinding(element, 'data-dirty', () => (formField()?.dirty() ? '' : null));\n dataBinding(element, 'data-pending', () => (formField()?.pending() ? '' : null));\n dataBinding(element, 'data-disabled', () => (formField()?.disabled() ? '' : null));\n\n function onClick(event: MouseEvent): void {\n // by default a label will perform a click on the associated form control, however\n // this only works if the associated form control is an input element which may not always\n // be the case, so we prevent the default behavior and handle the click event ourselves.\n // This was inspired by the HeadlessUI approach:\n // https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-react/src/components/label/label.tsx#L58\n if (isLabel) {\n event.preventDefault();\n }\n\n // to find the associated form control we can lookup via the known id\n const targetId = htmlFor();\n\n if (!targetId) {\n return;\n }\n\n const target = document.getElementById(targetId);\n\n if (!target) {\n return;\n }\n\n // if the target is disabled then do nothing\n const disabled = target.getAttribute('disabled');\n const ariaDisabled = target.getAttribute('aria-disabled');\n\n if (disabled === '' || disabled === 'true' || ariaDisabled === 'true') {\n return;\n }\n\n // radio buttons, checkboxes and switches should all be clicked immediately as they require state changes\n if (\n (target instanceof HTMLInputElement &&\n (target.type === 'radio' || target.type === 'checkbox')) ||\n target.role === 'radio' ||\n target.role === 'checkbox' ||\n target.role === 'switch'\n ) {\n target.click();\n }\n\n // Move focus to the element, this allows you to start using keyboard shortcuts since the\n // bound element is now focused.\n target.focus({ preventScroll: true });\n }\n\n // Event listeners\n listener(element, 'click', onClick);\n\n // Register with form field and cleanup on destroy\n formField()?.addLabel(id());\n onDestroy(() => formField()?.removeLabel(id()));\n\n // any time the id changes we need to update the registration with the form field\n onChange(id, (newId, oldId) => {\n if (oldId) {\n formField()?.removeLabel(oldId);\n }\n formField()?.addLabel(newId);\n });\n\n return {\n id,\n htmlFor,\n } satisfies NgpLabelState;\n },\n);\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpLabel, provideLabelState } from './label-state';\n\n/**\n * The `NgpLabel` directive is used to mark a label element within a form field. Preferably, there should use an HTML `<label>` element.\n */\n@Directive({\n selector: '[ngpLabel]',\n exportAs: 'ngpLabel',\n providers: [provideLabelState()],\n})\nexport class NgpLabel {\n /**\n * The id of the label. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-label'));\n\n /**\n * The label state.\n */\n constructor() {\n ngpLabel({ id: this.id });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MA2Fa,CAAC,sBAAsB,EAAE,YAAY,EAAE,oBAAoB,EAAE,qBAAqB,CAAC,GAC9F,eAAe,CAAC,cAAc,EAAE,CAAC,EAAE,SAAS,EAAqB,KAAI;AACnE,IAAA,MAAM,OAAO,GAAG,gBAAgB,EAAE;AAClC,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;;AAGjC,IAAA,MAAM,MAAM,GAAG,MAAM,CAAW,EAAE,kDAAC;;AAGnC,IAAA,MAAM,YAAY,GAAG,MAAM,CAAW,EAAE,wDAAC;;AAGzC,IAAA,MAAM,WAAW,GAAG,MAAM,CAAgB,IAAI,uDAAC;;AAG/C,IAAA,MAAM,MAAM,GAAG,MAAM,CAAW,EAAE,kDAAC;;AAGnC,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAiB,IAAI,oDAAC;AAC7C,IAAA,MAAM,OAAO,GAAG,MAAM,CAAiB,IAAI,mDAAC;AAC5C,IAAA,MAAM,KAAK,GAAG,MAAM,CAAiB,IAAI,iDAAC;AAC1C,IAAA,MAAM,KAAK,GAAG,MAAM,CAAiB,IAAI,iDAAC;AAC1C,IAAA,MAAM,OAAO,GAAG,MAAM,CAAiB,IAAI,mDAAC;AAC5C,IAAA,MAAM,OAAO,GAAG,MAAM,CAAiB,IAAI,mDAAC;AAC5C,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAiB,IAAI,oDAAC;;AAG7C,IAAA,IAAI,YAAsC;;AAG1C,IAAA,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC;AAC7C,IAAA,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,KAA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MAAA,EAAA,EAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,SAAA,EAFR,CAAC,iBAAiB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAErB,QAAQ,EAAA,UAAA,EAAA,CAAA;kBALpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,QAAQ,EAAE,UAAU;AACpB,oBAAA,SAAS,EAAE,CAAC,iBAAiB,EAAE,CAAC;AACjC,iBAAA;;;ACXD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-form-field.mjs","sources":["../../../../packages/ng-primitives/form-field/src/form-field/form-field-state.ts","../../../../packages/ng-primitives/form-field/src/description/description-state.ts","../../../../packages/ng-primitives/form-field/src/description/description.ts","../../../../packages/ng-primitives/form-field/src/error/error-state.ts","../../../../packages/ng-primitives/form-field/src/error/error.ts","../../../../packages/ng-primitives/form-field/src/form-control/form-control-state.ts","../../../../packages/ng-primitives/form-field/src/form-control/form-control.ts","../../../../packages/ng-primitives/form-field/src/form-field/form-field.ts","../../../../packages/ng-primitives/form-field/src/label/label-state.ts","../../../../packages/ng-primitives/form-field/src/label/label.ts","../../../../packages/ng-primitives/form-field/src/ng-primitives-form-field.ts"],"sourcesContent":["import { Injector, Signal, effect, inject, signal, untracked } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { createPrimitive, dataBinding, onDestroy } from 'ng-primitives/state';\nimport { onChange } from 'ng-primitives/utils';\nimport { Subscription } from 'rxjs';\n\n/**\n * The state interface for the FormField primitive.\n */\nexport interface NgpFormFieldState {\n /**\n * The form labels.\n */\n readonly labels: Signal<string[]>;\n /**\n * The form descriptions.\n */\n readonly descriptions: Signal<string[]>;\n /**\n * The id of the associated form control.\n */\n readonly formControl: Signal<string | null>;\n /**\n * The validation error messages.\n */\n readonly errors: Signal<string[]>;\n /**\n * Whether the control is pristine.\n */\n readonly pristine: Signal<boolean | null>;\n /**\n * Whether the control is touched.\n */\n readonly touched: Signal<boolean | null>;\n /**\n * Whether the control is dirty.\n */\n readonly dirty: Signal<boolean | null>;\n /**\n * Whether the control is valid.\n */\n readonly valid: Signal<boolean | null>;\n /**\n * Whether the control is invalid.\n */\n readonly invalid: Signal<boolean | null>;\n /**\n * Whether the control is pending.\n */\n readonly pending: Signal<boolean | null>;\n /**\n * Whether the control is disabled.\n */\n readonly disabled: Signal<boolean | null>;\n /**\n * Register the id of the associated form control.\n */\n setFormControl(id: string): void;\n /**\n * Register a label with the form field.\n */\n addLabel(label: string): void;\n /**\n * Register a description with the form field.\n */\n addDescription(description: string): void;\n /**\n * Remove the associated form control.\n */\n removeFormControl(): void;\n /**\n * Remove a label from the form field.\n */\n removeLabel(label: string): void;\n /**\n * Remove a description from the form field.\n */\n removeDescription(description: string): void;\n}\n\n/**\n * The props interface for the FormField primitive.\n */\nexport interface NgpFormFieldProps {\n /**\n * Find any NgControl within the form field.\n */\n readonly ngControl: Signal<NgControl | undefined>;\n}\n\nexport const [NgpFormFieldStateToken, ngpFormField, injectFormFieldState, provideFormFieldState] =\n createPrimitive('NgpFormField', ({ ngControl }: NgpFormFieldProps) => {\n const element = injectElementRef();\n const injector = inject(Injector);\n\n // Store the form labels\n const labels = signal<string[]>([]);\n\n // Store the form descriptions\n const descriptions = signal<string[]>([]);\n\n // Store the id of the associated form control\n const formControl = signal<string | null>(null);\n\n // Store the validation error messages\n const errors = signal<string[]>([]);\n\n // Form control state signals\n const pristine = signal<boolean | null>(null);\n const touched = signal<boolean | null>(null);\n const dirty = signal<boolean | null>(null);\n const valid = signal<boolean | null>(null);\n const invalid = signal<boolean | null>(null);\n const pending = signal<boolean | null>(null);\n const disabled = signal<boolean | null>(null);\n\n // Store the current status subscription\n let subscription: Subscription | undefined;\n\n // Host bindings\n dataBinding(element, 'data-invalid', invalid);\n dataBinding(element, 'data-valid', valid);\n dataBinding(element, 'data-touched', touched);\n dataBinding(element, 'data-pristine', pristine);\n dataBinding(element, 'data-dirty', dirty);\n dataBinding(element, 'data-pending', pending);\n dataBinding(element, 'data-disabled', disabled);\n\n function updateStatus(): void {\n const control = ngControl();\n\n if (!control) {\n return;\n }\n\n // Wrap in try-catch to handle signal-forms interop controls where\n // the `field` input may not be available yet (throws NG0950).\n // Reading the signal still establishes a dependency, so the effect\n // will re-run when the input becomes available.\n try {\n const controlPristine = control.pristine;\n const controlTouched = control.touched;\n const controlDirty = control.dirty;\n const controlValid = control.valid;\n const controlInvalid = control.invalid;\n const controlPending = control.pending;\n const controlDisabled = control.disabled;\n const controlErrors = control.errors;\n\n untracked(() => {\n pristine.set(controlPristine);\n touched.set(controlTouched);\n dirty.set(controlDirty);\n valid.set(controlValid);\n invalid.set(controlInvalid);\n pending.set(controlPending);\n disabled.set(controlDisabled);\n errors.set(controlErrors ? Object.keys(controlErrors) : []);\n });\n } catch {\n // NG0950: Required input not available yet. The effect will re-run\n // when the signal input becomes available.\n }\n }\n\n function setupSubscriptions(control: NgControl | null | undefined): void {\n // Unsubscribe from the previous subscriptions.\n subscription?.unsubscribe();\n\n if (!control) {\n return;\n }\n\n // For signal-forms interop controls, use an effect to reactively track status.\n // For classic controls, also use an effect but additionally subscribe to events.\n effect(\n () => {\n updateStatus();\n },\n { injector },\n );\n\n // Classic controls also have an events observable we can subscribe to.\n const underlyingControl = control?.control;\n if (underlyingControl?.events) {\n subscription = underlyingControl.events.subscribe(() => updateStatus());\n }\n }\n\n // Setup subscriptions when ngControl changes\n onChange(ngControl, setupSubscriptions);\n\n // Cleanup subscription on destroy\n onDestroy(() => subscription?.unsubscribe());\n\n // Methods\n function setFormControl(id: string): void {\n formControl.set(id);\n }\n\n function addLabel(label: string): void {\n if (labels().includes(label)) {\n return;\n }\n\n labels.update(currentLabels => [...currentLabels, label]);\n }\n\n function addDescription(description: string): void {\n if (descriptions().includes(description)) {\n return;\n }\n\n descriptions.update(currentDescriptions => [...currentDescriptions, description]);\n }\n\n function removeFormControl(): void {\n formControl.set(null);\n }\n\n function removeLabel(label: string): void {\n labels.update(currentLabels => currentLabels.filter(l => l !== label));\n }\n\n function removeDescription(description: string): void {\n descriptions.update(currentDescriptions =>\n currentDescriptions.filter(d => d !== description),\n );\n }\n\n return {\n labels,\n descriptions,\n formControl,\n errors,\n pristine,\n touched,\n dirty,\n valid,\n invalid,\n pending,\n disabled,\n setFormControl,\n addLabel,\n addDescription,\n removeFormControl,\n removeLabel,\n removeDescription,\n } satisfies NgpFormFieldState;\n });\n","import { signal, Signal } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, createPrimitive, dataBinding, onDestroy } from 'ng-primitives/state';\nimport { onChange, uniqueId } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\n/**\n * The state interface for the Description primitive.\n */\nexport interface NgpDescriptionState {\n /**\n * The id of the description.\n */\n readonly id: Signal<string>;\n}\n\n/**\n * The props interface for the Description primitive.\n */\nexport interface NgpDescriptionProps {\n /**\n * The id of the description.\n */\n readonly id: Signal<string>;\n}\n\nexport const [\n NgpDescriptionStateToken,\n ngpDescription,\n injectDescriptionState,\n provideDescriptionState,\n] = createPrimitive(\n 'NgpDescription',\n ({ id = signal(uniqueId('ngp-description')) }: NgpDescriptionProps) => {\n const element = injectElementRef();\n const formField = injectFormFieldState({ optional: true });\n\n // Host bindings\n attrBinding(element, 'id', id);\n dataBinding(element, 'data-invalid', () => (formField()?.invalid() ? '' : null));\n dataBinding(element, 'data-valid', () => (formField()?.valid() ? '' : null));\n dataBinding(element, 'data-touched', () => (formField()?.touched() ? '' : null));\n dataBinding(element, 'data-pristine', () => (formField()?.pristine() ? '' : null));\n dataBinding(element, 'data-dirty', () => (formField()?.dirty() ? '' : null));\n dataBinding(element, 'data-pending', () => (formField()?.pending() ? '' : null));\n dataBinding(element, 'data-disabled', () => (formField()?.disabled() ? '' : null));\n\n // Register with form field and cleanup on destroy\n formField()?.addDescription(id());\n onDestroy(() => formField()?.removeDescription(id()));\n\n onChange(id, (newId, oldId) => {\n if (oldId) {\n formField()?.removeDescription(oldId);\n }\n formField()?.addDescription(newId);\n });\n\n return { id } satisfies NgpDescriptionState;\n },\n);\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpDescription, provideDescriptionState } from './description-state';\n\n/**\n * The `NgpDescription` directive is used to mark a description element within a form field. There may be multiple descriptions associated with a form control.\n */\n@Directive({\n selector: '[ngpDescription]',\n exportAs: 'ngpDescription',\n providers: [provideDescriptionState()],\n})\nexport class NgpDescription {\n /**\n * The id of the description. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-description'));\n\n /**\n * The description state.\n */\n constructor() {\n ngpDescription({ id: this.id });\n }\n}\n","import { Signal, computed, signal } from '@angular/core';\nimport { explicitEffect, injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, createPrimitive, dataBinding, onDestroy } from 'ng-primitives/state';\nimport { onBooleanChange } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\n/**\n * The state interface for the Error primitive.\n */\nexport interface NgpErrorState {\n /**\n * The id of the error message.\n */\n readonly id: Signal<string>;\n /**\n * Determine if there is an error message.\n */\n readonly hasError: Signal<boolean>;\n /**\n * Determine whether the validator associated with this error is failing.\n */\n readonly state: Signal<'fail' | 'pass'>;\n}\n\n/**\n * The props interface for the Error primitive.\n */\nexport interface NgpErrorProps {\n /**\n * The id of the error message.\n */\n readonly id: Signal<string>;\n /**\n * The validator associated with the error message.\n */\n readonly validator?: Signal<string | null>;\n}\n\nexport const [NgpErrorStateToken, ngpError, injectErrorState, provideErrorState] = createPrimitive(\n 'NgpError',\n ({ id, validator = signal(null) }: NgpErrorProps) => {\n const element = injectElementRef();\n const formField = injectFormFieldState({ optional: true });\n\n // Determine if there is an error message\n const hasError = computed(() => {\n const errors = formField()?.errors() ?? [];\n const validatorValue = validator();\n\n return validatorValue ? errors?.includes(validatorValue) : errors?.length > 0;\n });\n\n // Determine whether the validator associated with this error is failing\n const state = computed(() => (hasError() ? 'fail' : 'pass'));\n\n // Host bindings\n attrBinding(element, 'id', id);\n dataBinding(element, 'data-invalid', () => (formField()?.invalid() ? '' : null));\n dataBinding(element, 'data-valid', () => (formField()?.valid() ? '' : null));\n dataBinding(element, 'data-touched', () => (formField()?.touched() ? '' : null));\n dataBinding(element, 'data-pristine', () => (formField()?.pristine() ? '' : null));\n dataBinding(element, 'data-dirty', () => (formField()?.dirty() ? '' : null));\n dataBinding(element, 'data-pending', () => (formField()?.pending() ? '' : null));\n dataBinding(element, 'data-disabled', () => (formField()?.disabled() ? '' : null));\n dataBinding(element, 'data-validator', state);\n\n let currentId = id();\n\n // Register/unregister with form field based on error state\n function registerError(): void {\n formField()?.addDescription(currentId);\n }\n\n function unregisterError(): void {\n formField()?.removeDescription(currentId);\n }\n\n // Update error registration when hasError changes\n onBooleanChange(hasError, registerError, unregisterError);\n\n function updateIdRegistration(newId: string, oldId?: string): void {\n if (oldId && hasError()) {\n formField()?.removeDescription(oldId);\n }\n currentId = newId;\n if (hasError()) {\n formField()?.addDescription(newId);\n }\n }\n\n // Watch for id changes to update registration\n explicitEffect([id], () => updateIdRegistration(id(), currentId));\n\n // Cleanup on destroy\n onDestroy(() => {\n if (hasError()) {\n formField()?.removeDescription(currentId);\n }\n });\n\n return {\n id,\n hasError,\n state,\n } satisfies NgpErrorState;\n },\n);\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpError, provideErrorState } from './error-state';\n\n/**\n * The `NgpError` directive is used to mark an error message element within a form field. There may be multiple error messages associated with a form control.\n */\n@Directive({\n selector: '[ngpError]',\n exportAs: 'ngpError',\n providers: [provideErrorState()],\n})\nexport class NgpError {\n /**\n * The id of the error message. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-error'));\n\n /**\n * The validator associated with the error message.\n */\n readonly validator = input<string | null>(null, {\n alias: 'ngpErrorValidator',\n });\n\n /**\n * The error state.\n */\n constructor() {\n ngpError({ id: this.id, validator: this.validator });\n }\n}\n","import { Signal, computed, signal } from '@angular/core';\nimport { explicitEffect, injectElementRef } from 'ng-primitives/internal';\nimport { attrBinding, dataBinding } from 'ng-primitives/state';\nimport { NgpControlStatus, controlStatus } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\ninterface NgpFormControlProps {\n /**\n * The id of the form control.\n */\n\n readonly id: Signal<string>;\n /**\n * Whether the form control is disabled by a parent.\n */\n readonly disabled?: Signal<boolean>;\n}\n\nexport function ngpFormControl({\n id,\n disabled = signal(false),\n}: NgpFormControlProps): Signal<NgpControlStatus> {\n const elementRef = injectElementRef();\n // Access the form field that the form control is associated with.\n const formField = injectFormFieldState({ optional: true });\n // Access the form control status.\n const status = controlStatus();\n // Determine the aria-labelledby attribute value.\n const ariaLabelledBy = computed(() => {\n const labels = formField()?.labels() ?? [];\n return labels.length > 0 ? labels.join(' ') : null;\n });\n // Determine the aria-describedby attribute value.\n const ariaDescribedBy = computed(() => {\n const descriptions = formField()?.descriptions() ?? [];\n return descriptions.length > 0 ? descriptions.join(' ') : null;\n });\n\n const supportsDisabledAttribute = 'disabled' in elementRef.nativeElement;\n\n // Host bindings\n attrBinding(elementRef, 'disabled', () => (supportsDisabledAttribute && disabled() ? '' : null));\n\n explicitEffect([id], ([id], onCleanup) => {\n formField()?.setFormControl(id);\n onCleanup(() => formField()?.removeFormControl());\n });\n\n attrBinding(elementRef, 'id', id);\n attrBinding(elementRef, 'aria-labelledby', ariaLabelledBy);\n attrBinding(elementRef, 'aria-describedby', ariaDescribedBy);\n dataBinding(elementRef, 'data-invalid', () => status().invalid);\n dataBinding(elementRef, 'data-valid', () => status().valid);\n dataBinding(elementRef, 'data-touched', () => status().touched);\n dataBinding(elementRef, 'data-pristine', () => status().pristine);\n dataBinding(elementRef, 'data-dirty', () => status().dirty);\n dataBinding(elementRef, 'data-pending', () => status().pending);\n dataBinding(elementRef, 'data-disabled', () => disabled() || status().disabled);\n\n return computed(() => ({ ...status(), disabled: status().disabled || disabled() }));\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpFormControl } from './form-control-state';\n\n/**\n * Typically this primitive would be not be used directly, but instead a more specific form control primitive would be used (e.g. `ngpInput`). All of our form control primitives use `ngpFormControl` internally so they will have the same accessibility features as described below.\n *\n * The `NgpFormControl` directive is used to mark a form control element within a form field. This element will have an `aria-labelledby` attribute set to the ID of the label element within the form field and an `aria-describedby` attribute set to the ID of the description elements within the form field.\n */\n@Directive({\n selector: '[ngpFormControl]',\n exportAs: 'ngpFormControl',\n})\nexport class NgpFormControl {\n /**\n * The id of the form control. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-form-control'));\n\n /**\n * Whether the form control is disabled by a parent.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFormControlDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The status of the form control.\n */\n readonly status = ngpFormControl({ id: this.id, disabled: this.disabled });\n}\n","import { Directive, contentChild } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { ngpFormField, provideFormFieldState } from './form-field-state';\n\n/**\n * The `NgpFormField` directive is a container for form field elements. Any labels, form controls, or descriptions should be placed within this directive.\n */\n@Directive({\n selector: '[ngpFormField]',\n exportAs: 'ngpFormField',\n providers: [provideFormFieldState()],\n})\nexport class NgpFormField {\n /**\n * Find any NgControl within the form field.\n * @internal\n */\n private readonly ngControl = contentChild(NgControl);\n\n /**\n * The form field state.\n */\n constructor() {\n ngpFormField({ ngControl: this.ngControl });\n }\n}\n","import { Signal, computed } from '@angular/core';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n attrBinding,\n createPrimitive,\n dataBinding,\n listener,\n onDestroy,\n} from 'ng-primitives/state';\nimport { onChange } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\n\n/**\n * The state interface for the Label primitive.\n */\nexport interface NgpLabelState {\n /**\n * The id of the label.\n */\n readonly id: Signal<string>;\n /**\n * The htmlFor attribute value.\n */\n readonly htmlFor: Signal<string | null>;\n}\n\n/**\n * The props interface for the Label primitive.\n */\nexport interface NgpLabelProps {\n /**\n * The id of the label.\n */\n readonly id: Signal<string>;\n}\n\nexport const [NgpLabelStateToken, ngpLabel, injectLabelState, provideLabelState] = createPrimitive(\n 'NgpLabel',\n ({ id }: NgpLabelProps) => {\n const element = injectElementRef();\n const formField = injectFormFieldState({ optional: true });\n\n // Derive the for attribute value if the label is an HTML label element\n const htmlFor = computed(() => formField()?.formControl() ?? null);\n\n // Determine if the label is an HTML label element\n const isLabel = element.nativeElement instanceof HTMLLabelElement;\n\n // Host bindings\n attrBinding(element, 'id', id);\n attrBinding(element, 'for', htmlFor);\n dataBinding(element, 'data-invalid', () => (formField()?.invalid() ? '' : null));\n dataBinding(element, 'data-valid', () => (formField()?.valid() ? '' : null));\n dataBinding(element, 'data-touched', () => (formField()?.touched() ? '' : null));\n dataBinding(element, 'data-pristine', () => (formField()?.pristine() ? '' : null));\n dataBinding(element, 'data-dirty', () => (formField()?.dirty() ? '' : null));\n dataBinding(element, 'data-pending', () => (formField()?.pending() ? '' : null));\n dataBinding(element, 'data-disabled', () => (formField()?.disabled() ? '' : null));\n\n function onClick(event: MouseEvent): void {\n // by default a label will perform a click on the associated form control, however\n // this only works if the associated form control is an input element which may not always\n // be the case, so we prevent the default behavior and handle the click event ourselves.\n // This was inspired by the HeadlessUI approach:\n // https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-react/src/components/label/label.tsx#L58\n if (isLabel) {\n event.preventDefault();\n }\n\n // to find the associated form control we can lookup via the known id\n const targetId = htmlFor();\n\n if (!targetId) {\n return;\n }\n\n const target = document.getElementById(targetId);\n\n if (!target) {\n return;\n }\n\n // if the target is disabled then do nothing\n const disabled = target.getAttribute('disabled');\n const ariaDisabled = target.getAttribute('aria-disabled');\n\n if (disabled === '' || disabled === 'true' || ariaDisabled === 'true') {\n return;\n }\n\n // radio buttons, checkboxes and switches should all be clicked immediately as they require state changes\n if (\n (target instanceof HTMLInputElement &&\n (target.type === 'radio' || target.type === 'checkbox')) ||\n target.role === 'radio' ||\n target.role === 'checkbox' ||\n target.role === 'switch'\n ) {\n target.click();\n }\n\n // Move focus to the element, this allows you to start using keyboard shortcuts since the\n // bound element is now focused.\n target.focus({ preventScroll: true });\n }\n\n // Event listeners\n listener(element, 'click', onClick);\n\n // Register with form field and cleanup on destroy\n formField()?.addLabel(id());\n onDestroy(() => formField()?.removeLabel(id()));\n\n // any time the id changes we need to update the registration with the form field\n onChange(id, (newId, oldId) => {\n if (oldId) {\n formField()?.removeLabel(oldId);\n }\n formField()?.addLabel(newId);\n });\n\n return {\n id,\n htmlFor,\n } satisfies NgpLabelState;\n },\n);\n","import { Directive, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { ngpLabel, provideLabelState } from './label-state';\n\n/**\n * The `NgpLabel` directive is used to mark a label element within a form field. Preferably, there should use an HTML `<label>` element.\n */\n@Directive({\n selector: '[ngpLabel]',\n exportAs: 'ngpLabel',\n providers: [provideLabelState()],\n})\nexport class NgpLabel {\n /**\n * The id of the label. If not provided, a unique id will be generated.\n */\n readonly id = input<string>(uniqueId('ngp-label'));\n\n /**\n * The label state.\n */\n constructor() {\n ngpLabel({ id: this.id });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MA2Fa,CAAC,sBAAsB,EAAE,YAAY,EAAE,oBAAoB,EAAE,qBAAqB,CAAC,GAC9F,eAAe,CAAC,c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iB,EAAE,CAAC;AACjC,iBAAA;;;ACXD;;AAEG;;;;"}
@@ -168,10 +168,10 @@ class NgpInputOtpInput {
168
168
  const end = input.selectionEnd || 0;
169
169
  this.state().updateSelection(start, end);
170
170
  }
171
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpInputOtpInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
172
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.9", type: NgpInputOtpInput, isStandalone: true, selector: "input[ngpInputOtpInput]", host: { attributes: { "autocomplete": "one-time-code" }, listeners: { "input": "onInput($event)", "paste": "onPaste($event)", "focus": "onFocus()", "blur": "onBlur()", "keyup": "onKeyup()", "select": "onSelect()" }, properties: { "attr.inputmode": "state().inputMode()", "attr.maxlength": "state().maxLength()", "attr.pattern": "state().pattern() || null", "attr.disabled": "state().disabled() ? \"\" : null" } }, exportAs: ["ngpInputOtpInput"], hostDirectives: [{ directive: i1.NgpVisuallyHidden }], ngImport: i0 }); }
171
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpInputOtpInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
172
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.14", type: NgpInputOtpInput, isStandalone: true, selector: "input[ngpInputOtpInput]", host: { attributes: { "autocomplete": "one-time-code" }, listeners: { "input": "onInput($event)", "paste": "onPaste($event)", "focus": "onFocus()", "blur": "onBlur()", "keyup": "onKeyup()", "select": "onSelect()" }, properties: { "attr.inputmode": "state().inputMode()", "attr.maxlength": "state().maxLength()", "attr.pattern": "state().pattern() || null", "attr.disabled": "state().disabled() ? \"\" : null" } }, exportAs: ["ngpInputOtpInput"], hostDirectives: [{ directive: i1.NgpVisuallyHidden }], ngImport: i0 }); }
173
173
  }
174
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpInputOtpInput, decorators: [{
174
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpInputOtpInput, decorators: [{
175
175
  type: Directive,
176
176
  args: [{
177
177
  selector: 'input[ngpInputOtpInput]',
@@ -214,7 +214,7 @@ class NgpInputOtpSlot {
214
214
  /**
215
215
  * The computed index of this slot based on registration order.
216
216
  */
217
- this.index = computed(() => this.state().getSlotIndex(this), ...(ngDevMode ? [{ debugName: "index" }] : []));
217
+ this.index = computed(() => this.state().getSlotIndex(this), ...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
218
218
  /**
219
219
  * The character for this slot from the value string.
220
220
  */
@@ -222,7 +222,7 @@ class NgpInputOtpSlot {
222
222
  const value = this.state().value();
223
223
  const currentIndex = this.index();
224
224
  return currentIndex >= 0 && currentIndex < value.length ? value[currentIndex] : null;
225
- }, ...(ngDevMode ? [{ debugName: "char" }] : []));
225
+ }, ...(ngDevMode ? [{ debugName: "char" }] : /* istanbul ignore next */ []));
226
226
  /**
227
227
  * Whether this slot is focused (active).
228
228
  */
@@ -235,7 +235,7 @@ class NgpInputOtpSlot {
235
235
  return (isFocused &&
236
236
  (currentIndex === selectionStart ||
237
237
  (value.length === maxLength && currentIndex === maxLength - 1)));
238
- }, ...(ngDevMode ? [{ debugName: "focused" }] : []));
238
+ }, ...(ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []));
239
239
  /**
240
240
  * Whether this slot should show the caret.
241
241
  */
@@ -250,18 +250,18 @@ class NgpInputOtpSlot {
250
250
  currentIndex === selectionStart &&
251
251
  selectionStart === selectionEnd &&
252
252
  value.length < maxLength);
253
- }, ...(ngDevMode ? [{ debugName: "caret" }] : []));
253
+ }, ...(ngDevMode ? [{ debugName: "caret" }] : /* istanbul ignore next */ []));
254
254
  /**
255
255
  * Whether this slot is filled with a character.
256
256
  */
257
- this.filled = computed(() => this.char() !== null, ...(ngDevMode ? [{ debugName: "filled" }] : []));
257
+ this.filled = computed(() => this.char() !== null, ...(ngDevMode ? [{ debugName: "filled" }] : /* istanbul ignore next */ []));
258
258
  /**
259
259
  * Whether to show placeholder for this slot.
260
260
  */
261
261
  this.showPlaceholder = computed(() => {
262
262
  const placeholder = this.state().placeholder();
263
263
  return !this.filled() && !!placeholder;
264
- }, ...(ngDevMode ? [{ debugName: "showPlaceholder" }] : []));
264
+ }, ...(ngDevMode ? [{ debugName: "showPlaceholder" }] : /* istanbul ignore next */ []));
265
265
  /**
266
266
  * The display character for this slot (character or placeholder).
267
267
  */
@@ -272,7 +272,7 @@ class NgpInputOtpSlot {
272
272
  if (this.showPlaceholder())
273
273
  return this.state().placeholder();
274
274
  return '';
275
- }, ...(ngDevMode ? [{ debugName: "displayChar" }] : []));
275
+ }, ...(ngDevMode ? [{ debugName: "displayChar" }] : /* istanbul ignore next */ []));
276
276
  this.state().registerSlot(this);
277
277
  }
278
278
  ngOnDestroy() {
@@ -294,10 +294,10 @@ class NgpInputOtpSlot {
294
294
  event.preventDefault();
295
295
  event.stopPropagation();
296
296
  }
297
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpInputOtpSlot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
298
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.9", type: NgpInputOtpSlot, isStandalone: true, selector: "[ngpInputOtpSlot]", host: { attributes: { "role": "presentation" }, listeners: { "click": "onClick($event)" }, properties: { "attr.data-slot-index": "index()", "attr.data-active": "focused() ? \"\" : null", "attr.data-filled": "filled() ? \"\" : null", "attr.data-caret": "caret() ? \"\" : null", "attr.data-placeholder": "showPlaceholder() ? \"\" : null", "textContent": "displayChar()" } }, exportAs: ["ngpInputOtpSlot"], ngImport: i0 }); }
297
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpInputOtpSlot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
298
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.14", type: NgpInputOtpSlot, isStandalone: true, selector: "[ngpInputOtpSlot]", host: { attributes: { "role": "presentation" }, listeners: { "click": "onClick($event)" }, properties: { "attr.data-slot-index": "index()", "attr.data-active": "focused() ? \"\" : null", "attr.data-filled": "filled() ? \"\" : null", "attr.data-caret": "caret() ? \"\" : null", "attr.data-placeholder": "showPlaceholder() ? \"\" : null", "textContent": "displayChar()" } }, exportAs: ["ngpInputOtpSlot"], ngImport: i0 }); }
299
299
  }
300
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpInputOtpSlot, decorators: [{
300
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpInputOtpSlot, decorators: [{
301
301
  type: Directive,
302
302
  args: [{
303
303
  selector: '[ngpInputOtpSlot]',
@@ -324,45 +324,32 @@ class NgpInputOtp {
324
324
  /**
325
325
  * The id of the input-otp.
326
326
  */
327
- this.id = input(uniqueId('ngp-input-otp'), ...(ngDevMode ? [{ debugName: "id" }] : []));
327
+ this.id = input(uniqueId('ngp-input-otp'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
328
328
  /**
329
329
  * The current value of the OTP.
330
330
  */
331
- this.value = input('', ...(ngDevMode ? [{ debugName: "value", alias: 'ngpInputOtpValue' }] : [{
332
- alias: 'ngpInputOtpValue',
333
- }]));
331
+ this.value = input('', { ...(ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {}), alias: 'ngpInputOtpValue' });
334
332
  /**
335
333
  * The regex pattern for allowed characters.
336
334
  */
337
- this.pattern = input('[0-9]', ...(ngDevMode ? [{ debugName: "pattern", alias: 'ngpInputOtpPattern' }] : [{
338
- alias: 'ngpInputOtpPattern',
339
- }]));
335
+ this.pattern = input('[0-9]', { ...(ngDevMode ? { debugName: "pattern" } : /* istanbul ignore next */ {}), alias: 'ngpInputOtpPattern' });
340
336
  /**
341
337
  * The input mode for the hidden input.
342
338
  */
343
- this.inputMode = input('text', ...(ngDevMode ? [{ debugName: "inputMode", alias: 'ngpInputOtpInputMode' }] : [{
344
- alias: 'ngpInputOtpInputMode',
345
- }]));
339
+ this.inputMode = input('text', { ...(ngDevMode ? { debugName: "inputMode" } : /* istanbul ignore next */ {}), alias: 'ngpInputOtpInputMode' });
346
340
  /**
347
341
  * Function to transform pasted text.
348
342
  */
349
- this.pasteTransformer = input(undefined, ...(ngDevMode ? [{ debugName: "pasteTransformer", alias: 'ngpInputOtpPasteTransformer' }] : [{
350
- alias: 'ngpInputOtpPasteTransformer',
351
- }]));
343
+ this.pasteTransformer = input(undefined, { ...(ngDevMode ? { debugName: "pasteTransformer" } : /* istanbul ignore next */ {}), alias: 'ngpInputOtpPasteTransformer' });
352
344
  /**
353
345
  * Whether the input-otp is disabled.
354
346
  */
355
- this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", alias: 'ngpInputOtpDisabled',
356
- transform: booleanAttribute }] : [{
357
- alias: 'ngpInputOtpDisabled',
358
- transform: booleanAttribute,
359
- }]));
347
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), alias: 'ngpInputOtpDisabled',
348
+ transform: booleanAttribute });
360
349
  /**
361
350
  * The placeholder character to display when a slot is empty.
362
351
  */
363
- this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder", alias: 'ngpInputOtpPlaceholder' }] : [{
364
- alias: 'ngpInputOtpPlaceholder',
365
- }]));
352
+ this.placeholder = input('', { ...(ngDevMode ? { debugName: "placeholder" } : /* istanbul ignore next */ {}), alias: 'ngpInputOtpPlaceholder' });
366
353
  /**
367
354
  * Event emitted when the value changes.
368
355
  */
@@ -379,31 +366,31 @@ class NgpInputOtp {
379
366
  * Store the input element reference.
380
367
  * @internal
381
368
  */
382
- this.inputElement = signal(undefined, ...(ngDevMode ? [{ debugName: "inputElement" }] : []));
369
+ this.inputElement = signal(undefined, ...(ngDevMode ? [{ debugName: "inputElement" }] : /* istanbul ignore next */ []));
383
370
  /**
384
371
  * Store registered slots in order.
385
372
  * @internal
386
373
  */
387
- this.slots = signal([], ...(ngDevMode ? [{ debugName: "slots" }] : []));
374
+ this.slots = signal([], ...(ngDevMode ? [{ debugName: "slots" }] : /* istanbul ignore next */ []));
388
375
  /**
389
376
  * The number of characters in the OTP, derived from registered slots.
390
377
  */
391
- this.maxLength = computed(() => this.slots().length, ...(ngDevMode ? [{ debugName: "maxLength" }] : []));
378
+ this.maxLength = computed(() => this.slots().length, ...(ngDevMode ? [{ debugName: "maxLength" }] : /* istanbul ignore next */ []));
392
379
  /**
393
380
  * The focus state of the input.
394
381
  * @internal
395
382
  */
396
- this.isFocused = signal(false, ...(ngDevMode ? [{ debugName: "isFocused" }] : []));
383
+ this.isFocused = signal(false, ...(ngDevMode ? [{ debugName: "isFocused" }] : /* istanbul ignore next */ []));
397
384
  /**
398
385
  * The selection start position.
399
386
  * @internal
400
387
  */
401
- this.selectionStart = signal(0, ...(ngDevMode ? [{ debugName: "selectionStart" }] : []));
388
+ this.selectionStart = signal(0, ...(ngDevMode ? [{ debugName: "selectionStart" }] : /* istanbul ignore next */ []));
402
389
  /**
403
390
  * The selection end position.
404
391
  * @internal
405
392
  */
406
- this.selectionEnd = signal(0, ...(ngDevMode ? [{ debugName: "selectionEnd" }] : []));
393
+ this.selectionEnd = signal(0, ...(ngDevMode ? [{ debugName: "selectionEnd" }] : /* istanbul ignore next */ []));
407
394
  /**
408
395
  * The state of the input-otp.
409
396
  */
@@ -495,10 +482,10 @@ class NgpInputOtp {
495
482
  input.focus();
496
483
  input.setSelectionRange(position, position);
497
484
  }
498
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpInputOtp, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
499
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: NgpInputOtp, isStandalone: true, selector: "[ngpInputOtp]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpInputOtpValue", isSignal: true, isRequired: false, transformFunction: null }, pattern: { classPropertyName: "pattern", publicName: "ngpInputOtpPattern", isSignal: true, isRequired: false, transformFunction: null }, inputMode: { classPropertyName: "inputMode", publicName: "ngpInputOtpInputMode", isSignal: true, isRequired: false, transformFunction: null }, pasteTransformer: { classPropertyName: "pasteTransformer", publicName: "ngpInputOtpPasteTransformer", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpInputOtpDisabled", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "ngpInputOtpPlaceholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpInputOtpValueChange", complete: "ngpInputOtpComplete" }, providers: [provideInputOtpState()], exportAs: ["ngpInputOtp"], ngImport: i0 }); }
485
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpInputOtp, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
486
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: NgpInputOtp, isStandalone: true, selector: "[ngpInputOtp]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpInputOtpValue", isSignal: true, isRequired: false, transformFunction: null }, pattern: { classPropertyName: "pattern", publicName: "ngpInputOtpPattern", isSignal: true, isRequired: false, transformFunction: null }, inputMode: { classPropertyName: "inputMode", publicName: "ngpInputOtpInputMode", isSignal: true, isRequired: false, transformFunction: null }, pasteTransformer: { classPropertyName: "pasteTransformer", publicName: "ngpInputOtpPasteTransformer", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpInputOtpDisabled", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "ngpInputOtpPlaceholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpInputOtpValueChange", complete: "ngpInputOtpComplete" }, providers: [provideInputOtpState()], exportAs: ["ngpInputOtp"], ngImport: i0 }); }
500
487
  }
501
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NgpInputOtp, decorators: [{
488
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpInputOtp, decorators: [{
502
489
  type: Directive,
503
490
  args: [{
504
491
  selector: '[ngpInputOtp]',