ng-primitives 0.124.0 → 0.126.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 (77) hide show
  1. package/date-time-date-fns/README.md +3 -0
  2. package/fesm2022/ng-primitives-avatar.mjs +4 -2
  3. package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
  4. package/fesm2022/ng-primitives-checkbox.mjs +4 -2
  5. package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
  6. package/fesm2022/ng-primitives-date-picker.mjs +42 -44
  7. package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
  8. package/fesm2022/ng-primitives-date-time-date-fns.mjs +95 -0
  9. package/fesm2022/ng-primitives-date-time-date-fns.mjs.map +1 -0
  10. package/fesm2022/ng-primitives-date-time-luxon.mjs +21 -3
  11. package/fesm2022/ng-primitives-date-time-luxon.mjs.map +1 -1
  12. package/fesm2022/ng-primitives-date-time.mjs +18 -3
  13. package/fesm2022/ng-primitives-date-time.mjs.map +1 -1
  14. package/fesm2022/ng-primitives-dialog.mjs +11 -4
  15. package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
  16. package/fesm2022/ng-primitives-form-field.mjs +3 -0
  17. package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
  18. package/fesm2022/ng-primitives-input-otp.mjs +15 -7
  19. package/fesm2022/ng-primitives-input-otp.mjs.map +1 -1
  20. package/fesm2022/ng-primitives-listbox.mjs +5 -4
  21. package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
  22. package/fesm2022/ng-primitives-menu.mjs +8 -0
  23. package/fesm2022/ng-primitives-menu.mjs.map +1 -1
  24. package/fesm2022/ng-primitives-meter.mjs +20 -5
  25. package/fesm2022/ng-primitives-meter.mjs.map +1 -1
  26. package/fesm2022/ng-primitives-number-field.mjs +10 -0
  27. package/fesm2022/ng-primitives-number-field.mjs.map +1 -1
  28. package/fesm2022/ng-primitives-pagination.mjs +16 -6
  29. package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
  30. package/fesm2022/ng-primitives-password.mjs +293 -0
  31. package/fesm2022/ng-primitives-password.mjs.map +1 -0
  32. package/fesm2022/ng-primitives-popover.mjs +4 -0
  33. package/fesm2022/ng-primitives-popover.mjs.map +1 -1
  34. package/fesm2022/ng-primitives-progress.mjs +36 -11
  35. package/fesm2022/ng-primitives-progress.mjs.map +1 -1
  36. package/fesm2022/ng-primitives-roving-focus.mjs +13 -2
  37. package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
  38. package/fesm2022/ng-primitives-search.mjs +2 -1
  39. package/fesm2022/ng-primitives-search.mjs.map +1 -1
  40. package/fesm2022/ng-primitives-slider.mjs +38 -18
  41. package/fesm2022/ng-primitives-slider.mjs.map +1 -1
  42. package/fesm2022/ng-primitives-switch.mjs +18 -8
  43. package/fesm2022/ng-primitives-switch.mjs.map +1 -1
  44. package/fesm2022/ng-primitives-tabs.mjs +22 -6
  45. package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
  46. package/fesm2022/ng-primitives-textarea.mjs +10 -8
  47. package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
  48. package/fesm2022/ng-primitives-toast.mjs +3 -0
  49. package/fesm2022/ng-primitives-toast.mjs.map +1 -1
  50. package/fesm2022/ng-primitives-toggle-group.mjs +31 -8
  51. package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
  52. package/package.json +12 -1
  53. package/password/README.md +3 -0
  54. package/schematics/ng-generate/templates/checkbox/checkbox.__fileSuffix@dasherize__.ts.template +2 -1
  55. package/schematics/ng-generate/templates/combobox/combobox.__fileSuffix@dasherize__.ts.template +3 -2
  56. package/schematics/ng-generate/templates/date-picker/date-picker.__fileSuffix@dasherize__.ts.template +2 -1
  57. package/schematics/ng-generate/templates/listbox/listbox.__fileSuffix@dasherize__.ts.template +9 -4
  58. package/schematics/ng-generate/templates/pagination/pagination.__fileSuffix@dasherize__.ts.template +7 -1
  59. package/schematics/ng-generate/templates/password/password.__fileSuffix@dasherize__.ts.template +141 -0
  60. package/schematics/ng-generate/templates/range-slider/range-slider.__fileSuffix@dasherize__.ts.template +4 -3
  61. package/schematics/ng-generate/templates/slider/slider.__fileSuffix@dasherize__.ts.template +2 -1
  62. package/schematics/ng-generate/templates/switch/switch.__fileSuffix@dasherize__.ts.template +2 -1
  63. package/types/ng-primitives-checkbox.d.ts +5 -1
  64. package/types/ng-primitives-date-picker.d.ts +7 -9
  65. package/types/ng-primitives-date-time-date-fns.d.ts +30 -0
  66. package/types/ng-primitives-date-time.d.ts +15 -3
  67. package/types/ng-primitives-dialog.d.ts +4 -0
  68. package/types/ng-primitives-input-otp.d.ts +5 -5
  69. package/types/ng-primitives-meter.d.ts +9 -2
  70. package/types/ng-primitives-pagination.d.ts +34 -8
  71. package/types/ng-primitives-password.d.ts +296 -0
  72. package/types/ng-primitives-progress.d.ts +4 -2
  73. package/types/ng-primitives-roving-focus.d.ts +7 -0
  74. package/types/ng-primitives-slider.d.ts +5 -4
  75. package/types/ng-primitives-switch.d.ts +14 -4
  76. package/types/ng-primitives-tabs.d.ts +6 -1
  77. package/types/ng-primitives-toggle-group.d.ts +51 -37
@@ -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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EAAA,CAAA,CAAA;;4FAErB,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 // Expose the validity to assistive technology. `aria-invalid=\"true\"` is only\n // present while the control is invalid; a valid or untracked control omits it.\n attrBinding(elementRef, 'aria-invalid', () => (status().invalid ? 'true' : null));\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,IAA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;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { HostListener, Directive, computed, input, booleanAttribute, output, signal } from '@angular/core';
2
+ import { afterRenderEffect, HostListener, Directive, computed, input, booleanAttribute, output, signal } from '@angular/core';
3
3
  import * as i1 from 'ng-primitives/a11y';
4
4
  import { NgpVisuallyHidden } from 'ng-primitives/a11y';
5
5
  import { injectElementRef } from 'ng-primitives/internal';
@@ -36,10 +36,16 @@ class NgpInputOtpInput {
36
36
  this.state = injectInputOtpState();
37
37
  // Register this input with the parent
38
38
  this.state().registerInput(this);
39
- }
40
- ngAfterViewInit() {
41
- // Set initial value
42
- this.elementRef.nativeElement.value = this.state().value();
39
+ // Keep the hidden input's value in sync with the state, including
40
+ // programmatic changes (e.g. a form writeValue) which don't fire `input`.
41
+ // Guarded so it never rewrites the value the user is actively typing (which
42
+ // would reset the caret) — during typing state and element already agree.
43
+ afterRenderEffect(() => {
44
+ const value = this.state().value();
45
+ if (this.elementRef.nativeElement.value !== value) {
46
+ this.elementRef.nativeElement.value = value;
47
+ }
48
+ });
43
49
  }
44
50
  /**
45
51
  * Focus the input.
@@ -326,9 +332,11 @@ class NgpInputOtp {
326
332
  */
327
333
  this.id = input(uniqueId('ngp-input-otp'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
328
334
  /**
329
- * The current value of the OTP.
335
+ * The current value of the OTP. A null/undefined value (e.g. from a form
336
+ * `writeValue(null)` or `reset()`) is coerced to an empty string.
330
337
  */
331
- this.value = input('', { ...(ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {}), alias: 'ngpInputOtpValue' });
338
+ this.value = input('', { ...(ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {}), alias: 'ngpInputOtpValue',
339
+ transform: value => value ?? '' });
332
340
  /**
333
341
  * The regex pattern for allowed characters.
334
342
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-input-otp.mjs","sources":["../../../../packages/ng-primitives/input-otp/src/input-otp/input-otp-state.ts","../../../../packages/ng-primitives/input-otp/src/input-otp-input/input-otp-input.ts","../../../../packages/ng-primitives/input-otp/src/input-otp-slot/input-otp-slot.ts","../../../../packages/ng-primitives/input-otp/src/input-otp/input-otp.ts","../../../../packages/ng-primitives/input-otp/src/ng-primitives-input-otp.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpInputOtp } from './input-otp';\n\n/**\n * The state token for the InputOtp primitive.\n */\nexport const NgpInputOtpStateToken = createStateToken<NgpInputOtp>('InputOtp');\n\n/**\n * Provides the InputOtp state.\n */\nexport const provideInputOtpState = createStateProvider(NgpInputOtpStateToken);\n\n/**\n * Injects the InputOtp state.\n */\nexport const injectInputOtpState = createStateInjector<NgpInputOtp>(NgpInputOtpStateToken);\n\n/**\n * The InputOtp state registration function.\n */\nexport const inputOtpState = createState(NgpInputOtpStateToken);\n","import { AfterViewInit, Directive, HostListener } from '@angular/core';\nimport { NgpVisuallyHidden } from 'ng-primitives/a11y';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { injectInputOtpState } from '../input-otp/input-otp-state';\n\n@Directive({\n selector: 'input[ngpInputOtpInput]',\n exportAs: 'ngpInputOtpInput',\n hostDirectives: [NgpVisuallyHidden],\n host: {\n autocomplete: 'one-time-code',\n '[attr.inputmode]': 'state().inputMode()',\n '[attr.maxlength]': 'state().maxLength()',\n '[attr.pattern]': 'state().pattern() || null',\n '[attr.disabled]': 'state().disabled() ? \"\" : null',\n },\n})\nexport class NgpInputOtpInput implements AfterViewInit {\n /**\n * Access the element reference.\n */\n readonly elementRef = injectElementRef<HTMLInputElement>();\n\n /**\n * Access the input-otp state.\n */\n protected readonly state = injectInputOtpState();\n\n constructor() {\n // Register this input with the parent\n this.state().registerInput(this);\n }\n\n ngAfterViewInit(): void {\n // Set initial value\n this.elementRef.nativeElement.value = this.state().value();\n }\n\n /**\n * Focus the input.\n * @internal\n */\n focus(): void {\n this.elementRef.nativeElement.focus();\n }\n\n /**\n * Set selection range.\n * @param start Start position\n * @param end End position\n * @internal\n */\n setSelectionRange(start: number, end: number): void {\n this.elementRef.nativeElement.setSelectionRange(start, end);\n }\n\n /**\n * Handle input events (typing).\n */\n @HostListener('input', ['$event'])\n protected onInput(event: Event): void {\n if (this.state().disabled()) {\n return;\n }\n\n const input = event.target as HTMLInputElement;\n let newValue = input.value;\n\n // Validate against pattern if provided\n const pattern = this.state().pattern();\n if (pattern) {\n const patternRegex = new RegExp(pattern);\n const filteredValue = newValue\n .split('')\n .filter(char => patternRegex.test(char))\n .join('');\n\n if (filteredValue !== newValue) {\n newValue = filteredValue;\n input.value = newValue;\n }\n }\n\n // Clamp to maxLength\n const maxLength = this.state().maxLength();\n if (newValue.length > maxLength) {\n newValue = newValue.substring(0, maxLength);\n input.value = newValue;\n }\n\n this.state().updateValue(newValue);\n this.updateSelection();\n }\n\n /**\n * Handle paste events.\n */\n @HostListener('paste', ['$event'])\n protected onPaste(event: ClipboardEvent): void {\n if (this.state().disabled()) {\n return;\n }\n\n event.preventDefault();\n\n const clipboardData = event.clipboardData?.getData('text') || '';\n let pastedText = clipboardData.trim();\n\n // Apply paste transformer if provided\n const transformer = this.state().pasteTransformer();\n if (transformer) {\n pastedText = transformer(pastedText);\n }\n\n // Validate against pattern if provided\n const pattern = this.state().pattern();\n if (pattern) {\n const patternRegex = new RegExp(pattern);\n pastedText = pastedText\n .split('')\n .filter(char => patternRegex.test(char))\n .join('');\n }\n\n // Clamp to maxLength\n const maxLength = this.state().maxLength();\n if (pastedText.length > maxLength) {\n pastedText = pastedText.substring(0, maxLength);\n }\n\n // Update the input value and state\n this.elementRef.nativeElement.value = pastedText;\n this.state().updateValue(pastedText);\n\n // Set caret to the end\n const endPosition = pastedText.length;\n this.setSelectionRange(endPosition, endPosition);\n this.updateSelection();\n }\n\n /**\n * Handle focus events.\n */\n @HostListener('focus')\n protected onFocus(): void {\n this.state().updateFocus(true);\n this.updateSelection();\n }\n\n /**\n * Handle blur events.\n */\n @HostListener('blur')\n protected onBlur(): void {\n this.state().updateFocus(false);\n }\n\n /**\n * Handle keyup events to update selection.\n */\n @HostListener('keyup')\n protected onKeyup(): void {\n this.updateSelection();\n }\n\n /**\n * Handle selection change events.\n */\n @HostListener('select')\n protected onSelect(): void {\n this.updateSelection();\n }\n\n /**\n * Update the selection state.\n */\n private updateSelection(): void {\n const input = this.elementRef.nativeElement;\n const maxLength = this.state().maxLength();\n\n // If input is at max length, set selection to last character\n if (input.value.length === maxLength) {\n input.setSelectionRange(input.value.length - 1, input.value.length);\n }\n\n // if the input is not at max length, set selection at the end\n if (input.value.length < maxLength) {\n input.setSelectionRange(input.value.length, input.value.length);\n }\n\n const start = input.selectionStart || 0;\n const end = input.selectionEnd || 0;\n this.state().updateSelection(start, end);\n }\n}\n","import { computed, Directive, OnDestroy } from '@angular/core';\nimport { injectInputOtpState } from '../input-otp/input-otp-state';\n\n@Directive({\n selector: '[ngpInputOtpSlot]',\n exportAs: 'ngpInputOtpSlot',\n host: {\n role: 'presentation',\n '[attr.data-slot-index]': 'index()',\n '[attr.data-active]': 'focused() ? \"\" : null',\n '[attr.data-filled]': 'filled() ? \"\" : null',\n '[attr.data-caret]': 'caret() ? \"\" : null',\n '[attr.data-placeholder]': 'showPlaceholder() ? \"\" : null',\n '[textContent]': 'displayChar()',\n '(click)': 'onClick($event)',\n },\n})\nexport class NgpInputOtpSlot implements OnDestroy {\n /**\n * Access the input-otp state.\n */\n protected readonly state = injectInputOtpState();\n\n /**\n * The computed index of this slot based on registration order.\n */\n readonly index = computed(() => this.state().getSlotIndex(this));\n\n /**\n * The character for this slot from the value string.\n */\n private readonly char = computed(() => {\n const value = this.state().value();\n const currentIndex = this.index();\n return currentIndex >= 0 && currentIndex < value.length ? value[currentIndex] : null;\n });\n\n /**\n * Whether this slot is focused (active).\n */\n protected readonly focused = computed(() => {\n const currentIndex = this.index();\n const isFocused = this.state().isFocused();\n const selectionStart = this.state().selectionStart();\n const value = this.state().value();\n const maxLength = this.state().maxLength();\n\n return (\n isFocused &&\n (currentIndex === selectionStart ||\n (value.length === maxLength && currentIndex === maxLength - 1))\n );\n });\n\n /**\n * Whether this slot should show the caret.\n */\n protected readonly caret = computed(() => {\n const currentIndex = this.index();\n const isFocused = this.state().isFocused();\n const selectionStart = this.state().selectionStart();\n const selectionEnd = this.state().selectionEnd();\n const value = this.state().value();\n const maxLength = this.state().maxLength();\n\n return (\n isFocused &&\n currentIndex === selectionStart &&\n selectionStart === selectionEnd &&\n value.length < maxLength\n );\n });\n\n /**\n * Whether this slot is filled with a character.\n */\n protected readonly filled = computed(() => this.char() !== null);\n\n /**\n * Whether to show placeholder for this slot.\n */\n protected readonly showPlaceholder = computed(() => {\n const placeholder = this.state().placeholder();\n return !this.filled() && !!placeholder;\n });\n\n /**\n * The display character for this slot (character or placeholder).\n */\n protected readonly displayChar = computed(() => {\n const char = this.char();\n if (char) return char;\n if (this.showPlaceholder()) return this.state().placeholder();\n return '';\n });\n\n constructor() {\n this.state().registerSlot(this);\n }\n\n ngOnDestroy(): void {\n // Unregister this slot when destroyed\n this.state().unregisterSlot(this);\n }\n\n /**\n * Handle click events on the slot.\n * @internal\n */\n protected onClick(event: Event): void {\n if (this.state().disabled()) return;\n\n const currentValue = this.state().value();\n const maxLength = this.state().maxLength();\n\n // Focus the first empty slot, or the last slot if all are filled\n const targetPosition = currentValue.length < maxLength ? currentValue.length : maxLength - 1;\n this.state().focusAtPosition(targetPosition);\n event.preventDefault();\n event.stopPropagation();\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, input, output, signal } from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport type { NgpInputOtpInput } from '../input-otp-input/input-otp-input';\nimport type { NgpInputOtpSlot } from '../input-otp-slot/input-otp-slot';\nimport { inputOtpState, provideInputOtpState } from './input-otp-state';\n\nexport type NgpInputOtpInputMode =\n | 'numeric'\n | 'text'\n | 'decimal'\n | 'tel'\n | 'search'\n | 'email'\n | 'url';\n\n@Directive({\n selector: '[ngpInputOtp]',\n exportAs: 'ngpInputOtp',\n providers: [provideInputOtpState()],\n})\nexport class NgpInputOtp {\n /**\n * Access the element reference.\n */\n readonly elementRef = injectElementRef<HTMLElement>();\n\n /**\n * The id of the input-otp.\n */\n readonly id = input(uniqueId('ngp-input-otp'));\n\n /**\n * The current value of the OTP.\n */\n readonly value = input<string>('', {\n alias: 'ngpInputOtpValue',\n });\n\n /**\n * The regex pattern for allowed characters.\n */\n readonly pattern = input<string>('[0-9]', {\n alias: 'ngpInputOtpPattern',\n });\n\n /**\n * The input mode for the hidden input.\n */\n readonly inputMode = input<NgpInputOtpInputMode>('text', {\n alias: 'ngpInputOtpInputMode',\n });\n\n /**\n * Function to transform pasted text.\n */\n readonly pasteTransformer = input<(text: string) => string>(undefined, {\n alias: 'ngpInputOtpPasteTransformer',\n });\n\n /**\n * Whether the input-otp is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpInputOtpDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The placeholder character to display when a slot is empty.\n */\n readonly placeholder = input<string>('', {\n alias: 'ngpInputOtpPlaceholder',\n });\n\n /**\n * Event emitted when the value changes.\n */\n readonly valueChange = output<string>({\n alias: 'ngpInputOtpValueChange',\n });\n\n /**\n * Event emitted when the OTP is complete (maxLength characters entered).\n */\n readonly complete = output<string>({\n alias: 'ngpInputOtpComplete',\n });\n\n /**\n * Store the input element reference.\n * @internal\n */\n private readonly inputElement = signal<NgpInputOtpInput | undefined>(undefined);\n\n /**\n * Store registered slots in order.\n * @internal\n */\n private readonly slots = signal<NgpInputOtpSlot[]>([]);\n\n /**\n * The number of characters in the OTP, derived from registered slots.\n */\n readonly maxLength = computed(() => this.slots().length);\n\n /**\n * The focus state of the input.\n * @internal\n */\n readonly isFocused = signal(false);\n\n /**\n * The selection start position.\n * @internal\n */\n readonly selectionStart = signal(0);\n\n /**\n * The selection end position.\n * @internal\n */\n readonly selectionEnd = signal(0);\n\n /**\n * The state of the input-otp.\n */\n protected readonly state = inputOtpState<NgpInputOtp>(this);\n\n constructor() {\n ngpInteractions({\n hover: true,\n press: true,\n focus: true,\n disabled: this.state.disabled,\n });\n }\n\n /**\n * Register an input element with the input-otp.\n * @param input The input element to register.\n * @internal\n */\n registerInput(input: NgpInputOtpInput): void {\n this.inputElement.set(input);\n }\n\n /**\n * Register a slot with the input-otp.\n * @param slot The slot to register.\n * @internal\n */\n registerSlot(slot: NgpInputOtpSlot): void {\n this.slots.update(currentSlots => [...currentSlots, slot]);\n }\n\n /**\n * Unregister a slot from the input-otp.\n * @param slot The slot to unregister.\n * @internal\n */\n unregisterSlot(slot: NgpInputOtpSlot): void {\n this.slots.update(currentSlots => currentSlots.filter(s => s !== slot));\n }\n\n /**\n * Get the index of a registered slot.\n * @param slot The slot to get the index for.\n * @returns The index of the slot, or -1 if not found.\n * @internal\n */\n getSlotIndex(slot: NgpInputOtpSlot): number {\n return this.slots().indexOf(slot);\n }\n\n /**\n * Update the value and emit change events.\n * @param newValue The new value.\n * @internal\n */\n updateValue(newValue: string): void {\n if (newValue === this.state.value()) {\n return;\n }\n\n this.state.value.set(newValue);\n this.valueChange.emit(newValue);\n\n // Emit complete event when the OTP is complete\n if (newValue.length === this.maxLength()) {\n this.complete.emit(newValue);\n }\n }\n\n /**\n * Update focus state.\n * @param focused Whether the input is focused.\n * @internal\n */\n updateFocus(focused: boolean): void {\n this.isFocused.set(focused);\n }\n\n /**\n * Update selection state.\n * @param start Selection start position.\n * @param end Selection end position.\n * @internal\n */\n updateSelection(start: number, end: number): void {\n this.selectionStart.set(start);\n this.selectionEnd.set(end);\n }\n\n /**\n * Focus the input and set caret to the specified position.\n * @param position The position to set the caret to.\n * @internal\n */\n focusAtPosition(position: number): void {\n const input = this.inputElement();\n if (!input) {\n return;\n }\n\n input.focus();\n input.setSelectionRange(position, position);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAQA;;AAEG;AACI,MAAM,qBAAqB,GAAG,gBAAgB,CAAc,UAAU,CAAC;AAE9E;;AAEG;MACU,oBAAoB,GAAG,mBAAmB,CAAC,qBAAqB;AAE7E;;AAEG;MACU,mBAAmB,GAAG,mBAAmB,CAAc,qBAAqB;AAEzF;;AAEG;AACI,MAAM,aAAa,GAAG,WAAW,CAAC,qBAAqB,CAAC;;MCTlD,gBAAgB,CAAA;AAW3B,IAAA,WAAA,GAAA;AAVA;;AAEG;QACM,IAAA,CAAA,UAAU,GAAG,gBAAgB,EAAoB;AAE1D;;AAEG;QACgB,IAAA,CAAA,KAAK,GAAG,mBAAmB,EAAE;;QAI9C,IAAI,CAAC,KAAK,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC;IAClC;IAEA,eAAe,GAAA;;AAEb,QAAA,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE;IAC5D;AAEA;;;AAGG;IACH,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,EAAE;IACvC;AAEA;;;;;AAKG;IACH,iBAAiB,CAAC,KAAa,EAAE,GAAW,EAAA;QAC1C,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC;IAC7D;AAEA;;AAEG;AAEO,IAAA,OAAO,CAAC,KAAY,EAAA;QAC5B,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,EAAE;YAC3B;QACF;AAEA,QAAA,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B;AAC9C,QAAA,IAAI,QAAQ,GAAG,KAAK,CAAC,KAAK;;QAG1B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,OAA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SAAS,EAAE,CAAC,oBAAoB,EAAE,CAAC;AACpC,iBAAA;;;ACtBD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-input-otp.mjs","sources":["../../../../packages/ng-primitives/input-otp/src/input-otp/input-otp-state.ts","../../../../packages/ng-primitives/input-otp/src/input-otp-input/input-otp-input.ts","../../../../packages/ng-primitives/input-otp/src/input-otp-slot/input-otp-slot.ts","../../../../packages/ng-primitives/input-otp/src/input-otp/input-otp.ts","../../../../packages/ng-primitives/input-otp/src/ng-primitives-input-otp.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpInputOtp } from './input-otp';\n\n/**\n * The state token for the InputOtp primitive.\n */\nexport const NgpInputOtpStateToken = createStateToken<NgpInputOtp>('InputOtp');\n\n/**\n * Provides the InputOtp state.\n */\nexport const provideInputOtpState = createStateProvider(NgpInputOtpStateToken);\n\n/**\n * Injects the InputOtp state.\n */\nexport const injectInputOtpState = createStateInjector<NgpInputOtp>(NgpInputOtpStateToken);\n\n/**\n * The InputOtp state registration function.\n */\nexport const inputOtpState = createState(NgpInputOtpStateToken);\n","import { afterRenderEffect, Directive, HostListener } from '@angular/core';\nimport { NgpVisuallyHidden } from 'ng-primitives/a11y';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { injectInputOtpState } from '../input-otp/input-otp-state';\n\n@Directive({\n selector: 'input[ngpInputOtpInput]',\n exportAs: 'ngpInputOtpInput',\n hostDirectives: [NgpVisuallyHidden],\n host: {\n autocomplete: 'one-time-code',\n '[attr.inputmode]': 'state().inputMode()',\n '[attr.maxlength]': 'state().maxLength()',\n '[attr.pattern]': 'state().pattern() || null',\n '[attr.disabled]': 'state().disabled() ? \"\" : null',\n },\n})\nexport class NgpInputOtpInput {\n /**\n * Access the element reference.\n */\n readonly elementRef = injectElementRef<HTMLInputElement>();\n\n /**\n * Access the input-otp state.\n */\n protected readonly state = injectInputOtpState();\n\n constructor() {\n // Register this input with the parent\n this.state().registerInput(this);\n\n // Keep the hidden input's value in sync with the state, including\n // programmatic changes (e.g. a form writeValue) which don't fire `input`.\n // Guarded so it never rewrites the value the user is actively typing (which\n // would reset the caret) — during typing state and element already agree.\n afterRenderEffect(() => {\n const value = this.state().value();\n if (this.elementRef.nativeElement.value !== value) {\n this.elementRef.nativeElement.value = value;\n }\n });\n }\n\n /**\n * Focus the input.\n * @internal\n */\n focus(): void {\n this.elementRef.nativeElement.focus();\n }\n\n /**\n * Set selection range.\n * @param start Start position\n * @param end End position\n * @internal\n */\n setSelectionRange(start: number, end: number): void {\n this.elementRef.nativeElement.setSelectionRange(start, end);\n }\n\n /**\n * Handle input events (typing).\n */\n @HostListener('input', ['$event'])\n protected onInput(event: Event): void {\n if (this.state().disabled()) {\n return;\n }\n\n const input = event.target as HTMLInputElement;\n let newValue = input.value;\n\n // Validate against pattern if provided\n const pattern = this.state().pattern();\n if (pattern) {\n const patternRegex = new RegExp(pattern);\n const filteredValue = newValue\n .split('')\n .filter(char => patternRegex.test(char))\n .join('');\n\n if (filteredValue !== newValue) {\n newValue = filteredValue;\n input.value = newValue;\n }\n }\n\n // Clamp to maxLength\n const maxLength = this.state().maxLength();\n if (newValue.length > maxLength) {\n newValue = newValue.substring(0, maxLength);\n input.value = newValue;\n }\n\n this.state().updateValue(newValue);\n this.updateSelection();\n }\n\n /**\n * Handle paste events.\n */\n @HostListener('paste', ['$event'])\n protected onPaste(event: ClipboardEvent): void {\n if (this.state().disabled()) {\n return;\n }\n\n event.preventDefault();\n\n const clipboardData = event.clipboardData?.getData('text') || '';\n let pastedText = clipboardData.trim();\n\n // Apply paste transformer if provided\n const transformer = this.state().pasteTransformer();\n if (transformer) {\n pastedText = transformer(pastedText);\n }\n\n // Validate against pattern if provided\n const pattern = this.state().pattern();\n if (pattern) {\n const patternRegex = new RegExp(pattern);\n pastedText = pastedText\n .split('')\n .filter(char => patternRegex.test(char))\n .join('');\n }\n\n // Clamp to maxLength\n const maxLength = this.state().maxLength();\n if (pastedText.length > maxLength) {\n pastedText = pastedText.substring(0, maxLength);\n }\n\n // Update the input value and state\n this.elementRef.nativeElement.value = pastedText;\n this.state().updateValue(pastedText);\n\n // Set caret to the end\n const endPosition = pastedText.length;\n this.setSelectionRange(endPosition, endPosition);\n this.updateSelection();\n }\n\n /**\n * Handle focus events.\n */\n @HostListener('focus')\n protected onFocus(): void {\n this.state().updateFocus(true);\n this.updateSelection();\n }\n\n /**\n * Handle blur events.\n */\n @HostListener('blur')\n protected onBlur(): void {\n this.state().updateFocus(false);\n }\n\n /**\n * Handle keyup events to update selection.\n */\n @HostListener('keyup')\n protected onKeyup(): void {\n this.updateSelection();\n }\n\n /**\n * Handle selection change events.\n */\n @HostListener('select')\n protected onSelect(): void {\n this.updateSelection();\n }\n\n /**\n * Update the selection state.\n */\n private updateSelection(): void {\n const input = this.elementRef.nativeElement;\n const maxLength = this.state().maxLength();\n\n // If input is at max length, set selection to last character\n if (input.value.length === maxLength) {\n input.setSelectionRange(input.value.length - 1, input.value.length);\n }\n\n // if the input is not at max length, set selection at the end\n if (input.value.length < maxLength) {\n input.setSelectionRange(input.value.length, input.value.length);\n }\n\n const start = input.selectionStart || 0;\n const end = input.selectionEnd || 0;\n this.state().updateSelection(start, end);\n }\n}\n","import { computed, Directive, OnDestroy } from '@angular/core';\nimport { injectInputOtpState } from '../input-otp/input-otp-state';\n\n@Directive({\n selector: '[ngpInputOtpSlot]',\n exportAs: 'ngpInputOtpSlot',\n host: {\n role: 'presentation',\n '[attr.data-slot-index]': 'index()',\n '[attr.data-active]': 'focused() ? \"\" : null',\n '[attr.data-filled]': 'filled() ? \"\" : null',\n '[attr.data-caret]': 'caret() ? \"\" : null',\n '[attr.data-placeholder]': 'showPlaceholder() ? \"\" : null',\n '[textContent]': 'displayChar()',\n '(click)': 'onClick($event)',\n },\n})\nexport class NgpInputOtpSlot implements OnDestroy {\n /**\n * Access the input-otp state.\n */\n protected readonly state = injectInputOtpState();\n\n /**\n * The computed index of this slot based on registration order.\n */\n readonly index = computed(() => this.state().getSlotIndex(this));\n\n /**\n * The character for this slot from the value string.\n */\n private readonly char = computed(() => {\n const value = this.state().value();\n const currentIndex = this.index();\n return currentIndex >= 0 && currentIndex < value.length ? value[currentIndex] : null;\n });\n\n /**\n * Whether this slot is focused (active).\n */\n protected readonly focused = computed(() => {\n const currentIndex = this.index();\n const isFocused = this.state().isFocused();\n const selectionStart = this.state().selectionStart();\n const value = this.state().value();\n const maxLength = this.state().maxLength();\n\n return (\n isFocused &&\n (currentIndex === selectionStart ||\n (value.length === maxLength && currentIndex === maxLength - 1))\n );\n });\n\n /**\n * Whether this slot should show the caret.\n */\n protected readonly caret = computed(() => {\n const currentIndex = this.index();\n const isFocused = this.state().isFocused();\n const selectionStart = this.state().selectionStart();\n const selectionEnd = this.state().selectionEnd();\n const value = this.state().value();\n const maxLength = this.state().maxLength();\n\n return (\n isFocused &&\n currentIndex === selectionStart &&\n selectionStart === selectionEnd &&\n value.length < maxLength\n );\n });\n\n /**\n * Whether this slot is filled with a character.\n */\n protected readonly filled = computed(() => this.char() !== null);\n\n /**\n * Whether to show placeholder for this slot.\n */\n protected readonly showPlaceholder = computed(() => {\n const placeholder = this.state().placeholder();\n return !this.filled() && !!placeholder;\n });\n\n /**\n * The display character for this slot (character or placeholder).\n */\n protected readonly displayChar = computed(() => {\n const char = this.char();\n if (char) return char;\n if (this.showPlaceholder()) return this.state().placeholder();\n return '';\n });\n\n constructor() {\n this.state().registerSlot(this);\n }\n\n ngOnDestroy(): void {\n // Unregister this slot when destroyed\n this.state().unregisterSlot(this);\n }\n\n /**\n * Handle click events on the slot.\n * @internal\n */\n protected onClick(event: Event): void {\n if (this.state().disabled()) return;\n\n const currentValue = this.state().value();\n const maxLength = this.state().maxLength();\n\n // Focus the first empty slot, or the last slot if all are filled\n const targetPosition = currentValue.length < maxLength ? currentValue.length : maxLength - 1;\n this.state().focusAtPosition(targetPosition);\n event.preventDefault();\n event.stopPropagation();\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, input, output, signal } from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport type { NgpInputOtpInput } from '../input-otp-input/input-otp-input';\nimport type { NgpInputOtpSlot } from '../input-otp-slot/input-otp-slot';\nimport { inputOtpState, provideInputOtpState } from './input-otp-state';\n\nexport type NgpInputOtpInputMode =\n | 'numeric'\n | 'text'\n | 'decimal'\n | 'tel'\n | 'search'\n | 'email'\n | 'url';\n\n@Directive({\n selector: '[ngpInputOtp]',\n exportAs: 'ngpInputOtp',\n providers: [provideInputOtpState()],\n})\nexport class NgpInputOtp {\n /**\n * Access the element reference.\n */\n readonly elementRef = injectElementRef<HTMLElement>();\n\n /**\n * The id of the input-otp.\n */\n readonly id = input(uniqueId('ngp-input-otp'));\n\n /**\n * The current value of the OTP. A null/undefined value (e.g. from a form\n * `writeValue(null)` or `reset()`) is coerced to an empty string.\n */\n readonly value = input<string, string | null | undefined>('', {\n alias: 'ngpInputOtpValue',\n transform: value => value ?? '',\n });\n\n /**\n * The regex pattern for allowed characters.\n */\n readonly pattern = input<string>('[0-9]', {\n alias: 'ngpInputOtpPattern',\n });\n\n /**\n * The input mode for the hidden input.\n */\n readonly inputMode = input<NgpInputOtpInputMode>('text', {\n alias: 'ngpInputOtpInputMode',\n });\n\n /**\n * Function to transform pasted text.\n */\n readonly pasteTransformer = input<(text: string) => string>(undefined, {\n alias: 'ngpInputOtpPasteTransformer',\n });\n\n /**\n * Whether the input-otp is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpInputOtpDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The placeholder character to display when a slot is empty.\n */\n readonly placeholder = input<string>('', {\n alias: 'ngpInputOtpPlaceholder',\n });\n\n /**\n * Event emitted when the value changes.\n */\n readonly valueChange = output<string>({\n alias: 'ngpInputOtpValueChange',\n });\n\n /**\n * Event emitted when the OTP is complete (maxLength characters entered).\n */\n readonly complete = output<string>({\n alias: 'ngpInputOtpComplete',\n });\n\n /**\n * Store the input element reference.\n * @internal\n */\n private readonly inputElement = signal<NgpInputOtpInput | undefined>(undefined);\n\n /**\n * Store registered slots in order.\n * @internal\n */\n private readonly slots = signal<NgpInputOtpSlot[]>([]);\n\n /**\n * The number of characters in the OTP, derived from registered slots.\n */\n readonly maxLength = computed(() => this.slots().length);\n\n /**\n * The focus state of the input.\n * @internal\n */\n readonly isFocused = signal(false);\n\n /**\n * The selection start position.\n * @internal\n */\n readonly selectionStart = signal(0);\n\n /**\n * The selection end position.\n * @internal\n */\n readonly selectionEnd = signal(0);\n\n /**\n * The state of the input-otp.\n */\n protected readonly state = inputOtpState<NgpInputOtp>(this);\n\n constructor() {\n ngpInteractions({\n hover: true,\n press: true,\n focus: true,\n disabled: this.state.disabled,\n });\n }\n\n /**\n * Register an input element with the input-otp.\n * @param input The input element to register.\n * @internal\n */\n registerInput(input: NgpInputOtpInput): void {\n this.inputElement.set(input);\n }\n\n /**\n * Register a slot with the input-otp.\n * @param slot The slot to register.\n * @internal\n */\n registerSlot(slot: NgpInputOtpSlot): void {\n this.slots.update(currentSlots => [...currentSlots, slot]);\n }\n\n /**\n * Unregister a slot from the input-otp.\n * @param slot The slot to unregister.\n * @internal\n */\n unregisterSlot(slot: NgpInputOtpSlot): void {\n this.slots.update(currentSlots => currentSlots.filter(s => s !== slot));\n }\n\n /**\n * Get the index of a registered slot.\n * @param slot The slot to get the index for.\n * @returns The index of the slot, or -1 if not found.\n * @internal\n */\n getSlotIndex(slot: NgpInputOtpSlot): number {\n return this.slots().indexOf(slot);\n }\n\n /**\n * Update the value and emit change events.\n * @param newValue The new value.\n * @internal\n */\n updateValue(newValue: string): void {\n if (newValue === this.state.value()) {\n return;\n }\n\n this.state.value.set(newValue);\n this.valueChange.emit(newValue);\n\n // Emit complete event when the OTP is complete\n if (newValue.length === this.maxLength()) {\n this.complete.emit(newValue);\n }\n }\n\n /**\n * Update focus state.\n * @param focused Whether the input is focused.\n * @internal\n */\n updateFocus(focused: boolean): void {\n this.isFocused.set(focused);\n }\n\n /**\n * Update selection state.\n * @param start Selection start position.\n * @param end Selection end position.\n * @internal\n */\n updateSelection(start: number, end: number): void {\n this.selectionStart.set(start);\n this.selectionEnd.set(end);\n }\n\n /**\n * Focus the input and set caret to the specified position.\n * @param position The position to set the caret to.\n * @internal\n */\n focusAtPosition(position: number): void {\n const input = this.inputElement();\n if (!input) {\n return;\n }\n\n input.focus();\n input.setSelectionRange(position, position);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAQA;;AAEG;AACI,MAAM,qBAAqB,GAAG,gBAAgB,CAAc,UAAU,CAAC;AAE9E;;AAEG;MACU,oBAAoB,GAAG,mBAAmB,CAAC,qBAAqB;AAE7E;;AAEG;MACU,mBAAmB,GAAG,mBAAmB,CAAc,qBAAqB;AAEzF;;AAEG;AACI,MAAM,aAAa,GAAG,WAAW,CAAC,qBAAqB,CAAC;;MCTlD,gBAAgB,CAAA;AAW3B,IAAA,WAAA,GAAA;AAVA;;AAEG;QACM,IAAA,CAAA,UAAU,GAAG,gBAAgB,EAAoB;AAE1D;;AAEG;QACgB,IAAA,CAAA,KAAK,GAAG,mBAAmB,EAAE;;QAI9C,IAAI,CAAC,KAAK,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC;;;;;QAMhC,iBAAiB,CAAC,MAAK;YACrB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE;YAClC,IAAI,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,KAAK,KAAK,EAAE;gBACjD,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,GAAG,KAAK;YAC7C;AACF,QAAA,CAAC,CAAC;IACJ;AAEA;;;AAGG;IACH,KAAK,GAAA;AACH,QAA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AAA,UAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,wBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,WAAA,EAAA,wBAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,EAAA,SAAA,EAFX,CAAC,oBAAoB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAExB,WAAW,EAAA,UAAA,EAAA,CAAA;kBALvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,SAAS,EAAE,CAAC,oBAAoB,EAAE,CAAC;AACpC,iBAAA;;;ACtBD;;AAEG;;;;"}
@@ -151,7 +151,7 @@ class NgpListboxOption {
151
151
  this.listbox()?.activateOption(this.value());
152
152
  }
153
153
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpListboxOption, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
154
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: NgpListboxOption, isStandalone: true, selector: "[ngpListboxOption]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpListboxOptionValue", isSignal: true, isRequired: true, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "ngpListboxOptionDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "option" }, listeners: { "click": "select(\"mouse\")", "mouseenter": "activate()", "keydown.enter": "select(\"keyboard\")", "keydown.space": "select(\"keyboard\")" }, properties: { "attr.id": "id()", "attr.aria-disabled": "optionDisabled()", "attr.data-active": "listbox()?.isFocused() && active() ? \"\" : undefined", "attr.data-selected": "selected() ? \"\" : undefined", "attr.data-disabled": "optionDisabled() ? \"\" : undefined" } }, exportAs: ["ngpListboxOption"], ngImport: i0 }); }
154
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.14", type: NgpListboxOption, isStandalone: true, selector: "[ngpListboxOption]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpListboxOptionValue", isSignal: true, isRequired: true, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "ngpListboxOptionDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "option" }, listeners: { "click": "select(\"mouse\")", "mouseenter": "activate()", "keydown.enter": "select(\"keyboard\")", "keydown.space": "select(\"keyboard\")" }, properties: { "attr.id": "id()", "attr.aria-disabled": "_disabled()", "attr.data-active": "listbox()?.isFocused() && active() ? \"\" : undefined", "attr.data-selected": "selected() ? \"\" : undefined", "attr.data-disabled": "_disabled() ? \"\" : undefined" } }, exportAs: ["ngpListboxOption"], ngImport: i0 }); }
155
155
  }
156
156
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: NgpListboxOption, decorators: [{
157
157
  type: Directive,
@@ -161,10 +161,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
161
161
  host: {
162
162
  role: 'option',
163
163
  '[attr.id]': 'id()',
164
- '[attr.aria-disabled]': 'optionDisabled()',
164
+ '[attr.aria-disabled]': '_disabled()',
165
165
  '[attr.data-active]': 'listbox()?.isFocused() && active() ? "" : undefined',
166
166
  '[attr.data-selected]': 'selected() ? "" : undefined',
167
- '[attr.data-disabled]': 'optionDisabled() ? "" : undefined',
167
+ '[attr.data-disabled]': '_disabled() ? "" : undefined',
168
168
  '(click)': 'select("mouse")',
169
169
  '(mouseenter)': 'activate()',
170
170
  '(keydown.enter)': 'select("keyboard")',
@@ -372,7 +372,8 @@ class NgpListbox {
372
372
  * Determine if an option is selected using the compareWith function.
373
373
  */
374
374
  isSelected(value) {
375
- return this.state.value().some(v => this.state.compareWith()(v, value));
375
+ // a form may write null/undefined (writeValue(null) / reset); treat as empty
376
+ return (this.state.value() ?? []).some(v => this.state.compareWith()(v, value));
376
377
  }
377
378
  /**
378
379
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-listbox.mjs","sources":["../../../../packages/ng-primitives/listbox/src/listbox-header/listbox-header.ts","../../../../packages/ng-primitives/listbox/src/listbox/listbox-state.ts","../../../../packages/ng-primitives/listbox/src/listbox-option/listbox-option.ts","../../../../packages/ng-primitives/listbox/src/listbox-section/listbox-section.ts","../../../../packages/ng-primitives/listbox/src/listbox-trigger/listbox-trigger.ts","../../../../packages/ng-primitives/listbox/src/listbox/listbox.ts","../../../../packages/ng-primitives/listbox/src/ng-primitives-listbox.ts"],"sourcesContent":["import { Directive, input } from '@angular/core';\nimport { NgpHeaderToken } from 'ng-primitives/common';\nimport { uniqueId } from 'ng-primitives/utils';\n\n@Directive({\n selector: '[ngpListboxHeader]',\n exportAs: 'ngpListboxHeader',\n host: {\n role: 'presentation',\n '[attr.id]': 'id()',\n },\n // temporary until we remove NgpHeader completely - this prevents breaking changes\n providers: [{ provide: NgpHeaderToken, useExisting: NgpListboxHeader }],\n})\nexport class NgpListboxHeader {\n /**\n * The id of the listbox header.\n */\n readonly id = input(uniqueId('ngp-listbox-header'));\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpListbox } from './listbox';\n\n/**\n * The state token for the Listbox primitive.\n */\nexport const NgpListboxStateToken = createStateToken<NgpListbox<unknown>>('Listbox');\n\n/**\n * Provides the Listbox state.\n */\nexport const provideListboxState = createStateProvider(NgpListboxStateToken);\n\n/**\n * Injects the Listbox state.\n */\nexport const injectListboxState = createStateInjector<NgpListbox<unknown>>(NgpListboxStateToken, {\n deferred: true,\n});\n\n/**\n * The Listbox state registration function.\n */\nexport const listboxState = createState(NgpListboxStateToken);\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n effect,\n input,\n OnDestroy,\n signal,\n} from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef, onDomRemoval, scrollIntoViewIfNeeded } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport type { NgpListbox } from '../listbox/listbox';\nimport { injectListboxState } from '../listbox/listbox-state';\n\n@Directive({\n selector: '[ngpListboxOption]',\n exportAs: 'ngpListboxOption',\n host: {\n role: 'option',\n '[attr.id]': 'id()',\n '[attr.aria-disabled]': 'optionDisabled()',\n '[attr.data-active]': 'listbox()?.isFocused() && active() ? \"\" : undefined',\n '[attr.data-selected]': 'selected() ? \"\" : undefined',\n '[attr.data-disabled]': 'optionDisabled() ? \"\" : undefined',\n '(click)': 'select(\"mouse\")',\n '(mouseenter)': 'activate()',\n '(keydown.enter)': 'select(\"keyboard\")',\n '(keydown.space)': 'select(\"keyboard\")',\n },\n})\nexport class NgpListboxOption<T> implements OnDestroy {\n protected readonly listbox = injectListboxState<NgpListbox<T>>();\n private readonly elementRef = injectElementRef();\n\n /**\n * The id of the listbox.\n */\n readonly id = input(uniqueId('ngp-listbox-option'));\n\n /**\n * The value of the option.\n */\n readonly value = input.required<T>({\n alias: 'ngpListboxOptionValue',\n });\n\n /**\n * Whether the option is disabled.\n */\n readonly optionDisabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpListboxOptionDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the option is active.\n */\n protected readonly active = signal<boolean>(false);\n\n /**\n * @internal\n * Whether the option is selected.\n */\n readonly selected = computed(() => this.listbox()?.isSelected(this.value()));\n\n /**\n * @internal\n * Whether the option is disabled - this is used by the `Highlightable` interface.\n */\n get disabled(): boolean {\n return this._disabled();\n }\n\n /**\n * Whether the option is disabled.\n */\n protected readonly _disabled = computed(\n () => this.optionDisabled() || (this.listbox()?.disabled() ?? false),\n );\n\n constructor() {\n ngpInteractions({\n hover: true,\n press: true,\n focusVisible: true,\n focus: true,\n disabled: this._disabled,\n });\n\n // the listbox may not be available when the option is initialized\n // so we need to add the option when the listbox is available\n effect(() => this.listbox()?.addOption(this));\n\n // any time the element is removed from the dom, we need to remove the option from the listbox\n // and we also want to reset the active state\n onDomRemoval(this.elementRef.nativeElement, () => {\n this.listbox()?.removeOption(this);\n this.setInactiveStyles();\n });\n }\n\n ngOnDestroy(): void {\n this.listbox()?.removeOption(this);\n }\n\n /**\n * @internal\n * Sets the active state of the option.\n */\n setActiveStyles(): void {\n this.active.set(true);\n scrollIntoViewIfNeeded(this.elementRef.nativeElement);\n }\n\n /**\n * @internal\n * Sets the inactive state of the option.\n */\n setInactiveStyles(): void {\n this.active.set(false);\n }\n\n /**\n * @internal\n * Gets the label of the option, used by the `Highlightable` interface.\n */\n getLabel(): string {\n return this.elementRef.nativeElement.textContent ?? '';\n }\n\n /**\n * @internal\n * Selects the option.\n */\n select(origin: FocusOrigin): void {\n if (this._disabled()) {\n return;\n }\n\n this.listbox()?.selectOption(this.value(), origin);\n }\n\n /**\n * @internal\n * Activate the current options.\n */\n activate(): void {\n if (this._disabled()) {\n return;\n }\n\n this.listbox()?.activateOption(this.value());\n }\n}\n","import { contentChild, Directive } from '@angular/core';\nimport { NgpHeaderToken } from 'ng-primitives/common';\n\n@Directive({\n selector: '[ngpListboxSection]',\n exportAs: 'ngpListboxSection',\n host: {\n role: 'group',\n '[attr.aria-labelledby]': 'header()?.id()',\n },\n})\nexport class NgpListboxSection {\n /**\n * Access the header of the section if it exists.\n */\n protected readonly header = contentChild(NgpHeaderToken, { descendants: true });\n}\n","import { Directive, HostListener } from '@angular/core';\nimport { injectPopoverTriggerState } from 'ng-primitives/popover';\n\n@Directive({\n selector: '[ngpListboxTrigger]',\n exportAs: 'ngpListboxTrigger',\n})\nexport class NgpListboxTrigger {\n /**\n * There must also be a popover trigger directive associated with this element.\n */\n private readonly popoverTrigger = injectPopoverTriggerState();\n\n /**\n * When the up or down arrow key is pressed, open the popover.\n */\n @HostListener('keydown', ['$event'])\n openPopover(event: KeyboardEvent) {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n this.popoverTrigger().show();\n event.preventDefault();\n }\n }\n}\n","import { ActiveDescendantKeyManager, FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n AfterContentInit,\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n HostListener,\n inject,\n Injector,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { NgpSelectionMode } from 'ng-primitives/common';\nimport { ngpFocusVisible } from 'ng-primitives/interactions';\nimport { explicitEffect } from 'ng-primitives/internal';\nimport { injectPopoverTriggerState } from 'ng-primitives/popover';\nimport { safeTakeUntilDestroyed, uniqueId } from 'ng-primitives/utils';\nimport type { NgpListboxOption } from '../listbox-option/listbox-option';\nimport { listboxState, provideListboxState } from './listbox-state';\n\n@Directive({\n selector: '[ngpListbox]',\n exportAs: 'ngpListbox',\n providers: [provideListboxState()],\n host: {\n '[id]': 'state.id()',\n role: 'listbox',\n '[attr.tabindex]': 'tabindex()',\n '[attr.aria-disabled]': 'state.disabled()',\n '[attr.aria-multiselectable]': 'state.mode() === \"multiple\"',\n '[attr.aria-activedescendant]': 'activeDescendant()',\n '(focusin)': 'isFocused.set(true)',\n '(focusout)': 'isFocused.set(false)',\n },\n})\nexport class NgpListbox<T> implements AfterContentInit {\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the destroy ref.\n */\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * The listbox may be used within a popover, which we may want to close on selection.\n */\n private readonly popoverTrigger = injectPopoverTriggerState({ optional: true });\n\n /**\n * The id of the listbox.\n */\n readonly id = input(uniqueId('ngp-listbox'));\n\n /**\n * The listbox selection mode.\n */\n readonly mode = input<NgpSelectionMode>('single', {\n alias: 'ngpListboxMode',\n });\n\n /**\n * The listbox selection.\n */\n readonly value = input<T[]>([], {\n alias: 'ngpListboxValue',\n });\n\n /**\n * Emits when the listbox selection changes.\n */\n readonly valueChange = output<T[]>({\n alias: 'ngpListboxValueChange',\n });\n\n /**\n * The listbox disabled state.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpListboxDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The comparator function to use when comparing values.\n * If not provided, strict equality (===) is used.\n */\n readonly compareWith = input<(a: T, b: T) => boolean>((a, b) => a === b, {\n alias: 'ngpListboxCompareWith',\n });\n\n /**\n * The tabindex of the listbox.\n */\n protected readonly tabindex = computed(() => (this.state.disabled() ? -1 : 0));\n\n /**\n * Access the options in the listbox.\n */\n protected readonly options = signal<NgpListboxOption<T>[]>([]);\n\n /**\n * The active descendant of the listbox.\n */\n protected readonly keyManager = new ActiveDescendantKeyManager(this.options, this.injector);\n\n /**\n * Gets the active descendant of the listbox.\n */\n protected readonly activeDescendant = signal<string | undefined>(undefined);\n\n /**\n * @internal\n * Whether the listbox is focused.\n */\n readonly isFocused = signal(false);\n\n /**\n * The listbox state\n */\n protected readonly state = listboxState<NgpListbox<T>>(this);\n\n constructor() {\n ngpFocusVisible({ disabled: this.state.disabled });\n }\n\n ngAfterContentInit(): void {\n this.keyManager.withHomeAndEnd().withTypeAhead().withVerticalOrientation();\n\n this.keyManager.change\n .pipe(safeTakeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.activeDescendant.set(this.keyManager.activeItem?.id()));\n\n // On initialization, set the first selected option as the active descendant if there is one.\n this.updateActiveItem();\n\n // if the options change, update the active item, for example the item that was previously active may have been removed\n // any time the value changes we should make sure that the active item is updated\n explicitEffect([this.options], () => this.updateActiveItem(), {\n injector: this.injector,\n });\n }\n\n private updateActiveItem(): void {\n const activeItem = this.keyManager.activeItem;\n if (activeItem && this.options().includes(activeItem)) {\n return;\n }\n\n const selectedOption = this.options().find(o => o.selected());\n\n if (selectedOption) {\n this.keyManager.setActiveItem(selectedOption);\n } else {\n this.keyManager.setFirstItemActive();\n }\n }\n\n @HostListener('keydown', ['$event'])\n protected onKeydown(event: KeyboardEvent): void {\n this.keyManager.onKeydown(event);\n\n // if the keydown was enter or space, select the active descendant if there is one\n if (event.key === 'Enter' || event.key === ' ') {\n this.keyManager.activeItem?.select('keyboard');\n }\n\n // if this is an arrow key or selection key, prevent the default action to prevent the page from scrolling\n if (\n event.key === 'ArrowDown' ||\n event.key === 'ArrowUp' ||\n event.key === 'Enter' ||\n event.key === ' '\n ) {\n event.preventDefault();\n }\n }\n\n /**\n * @internal\n * Selects an option in the listbox.\n */\n selectOption(value: T, origin: FocusOrigin): void {\n if (this.state.mode() === 'single') {\n const newValue = [value];\n this.state.value.set(newValue);\n this.valueChange.emit(newValue);\n } else {\n // if the value is already selected, remove it, otherwise add it\n if (this.isSelected(value)) {\n const newValue = this.state.value().filter(v => !this.state.compareWith()(v, value));\n this.state.value.set(newValue);\n this.valueChange.emit(newValue);\n } else {\n const newValue = [...this.state.value(), value];\n this.state.value.set(newValue);\n this.valueChange.emit(newValue);\n }\n }\n\n // Set the active descendant to the selected option.\n const option = this.options().find(o => this.state.compareWith()(o.value(), value));\n\n if (option) {\n this.keyManager.setActiveItem(option);\n }\n\n // If the listbox is within a popover, close the popover on selection if it is not in a multiple selection mode.\n if (this.state.mode() !== 'multiple') {\n this.popoverTrigger()?.hide(origin);\n }\n }\n\n /**\n * @internal\n * Determine if an option is selected using the compareWith function.\n */\n isSelected(value: T): boolean {\n return this.state.value().some(v => this.state.compareWith()(v, value));\n }\n\n /**\n * @internal\n * Activate an option in the listbox.\n */\n activateOption(value: T) {\n const option = this.options().find(o => this.state.compareWith()(o.value(), value));\n\n if (option) {\n this.keyManager.setActiveItem(option);\n }\n }\n\n /**\n * Registers an option with the listbox.\n * @internal\n */\n addOption(option: NgpListboxOption<T>): void {\n // if the option already exists, do not add it again\n if (!this.options().includes(option)) {\n this.options.update(options => [...options, option]);\n }\n }\n\n /**\n * Deregisters an option with the listbox.\n * @internal\n */\n removeOption(option: NgpListboxOption<T>): void {\n this.options.update(options => options.filter(o => o !== option));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAca,gBAAgB,CAAA;AAV7B,IAAA,WAAA,GAAA;AAWE;;AAEG;QACM,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,oBAAoB,CAAC,yEAAC;AACpD,IAAA;+GALY,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,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,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,cAAA,EAAA,EAAA,UAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,EAAA,EAAA,SAAA,EAFhB,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAE5D,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAV5B,SAAS;AAAC,YAAA,IAA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,EAAA,UAAA,EAAA,EAAA,IAAA,EAAA,YAAA,EAAA,eAAA,EAAA,YAAA,EAAA,oBAAA,EAAA,kBAAA,EAAA,2BAAA,EAAA,+BAAA,EAAA,4BAAA,EAAA,oBAAA,EAAA,EAAA,EAAA,SAAA,EAZV,CAAC,mBAAmB,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAYvB,UAAU,EAAA,UAAA,EAAA,CAAA;kBAftB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,SAAS,EAAE,CAAC,mBAAmB,EAAE,CAAC;AAClC,oBAAA,IAAI,EAAE;AACJ,wBAAA,MAAM,EAAE,YAAY;AACpB,wBAAA,IAAI,EAAE,SAAS;AACf,wBAAA,iBAAiB,EAAE,YAAY;AAC/B,wBAAA,sBAAsB,EAAE,kBAAkB;AAC1C,wBAAA,6BAA6B,EAAE,6BAA6B;AAC5D,wBAAA,8BAA8B,EAAE,oBAAoB;AACpD,wBAAA,WAAW,EAAE,qBAAqB;AAClC,wBAAA,YAAY,EAAE,sBAAsB;AACrC,qBAAA;AACF,iBAAA;;sBA8HE,YAAY;uBAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;;;ACnKrC;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-listbox.mjs","sources":["../../../../packages/ng-primitives/listbox/src/listbox-header/listbox-header.ts","../../../../packages/ng-primitives/listbox/src/listbox/listbox-state.ts","../../../../packages/ng-primitives/listbox/src/listbox-option/listbox-option.ts","../../../../packages/ng-primitives/listbox/src/listbox-section/listbox-section.ts","../../../../packages/ng-primitives/listbox/src/listbox-trigger/listbox-trigger.ts","../../../../packages/ng-primitives/listbox/src/listbox/listbox.ts","../../../../packages/ng-primitives/listbox/src/ng-primitives-listbox.ts"],"sourcesContent":["import { Directive, input } from '@angular/core';\nimport { NgpHeaderToken } from 'ng-primitives/common';\nimport { uniqueId } from 'ng-primitives/utils';\n\n@Directive({\n selector: '[ngpListboxHeader]',\n exportAs: 'ngpListboxHeader',\n host: {\n role: 'presentation',\n '[attr.id]': 'id()',\n },\n // temporary until we remove NgpHeader completely - this prevents breaking changes\n providers: [{ provide: NgpHeaderToken, useExisting: NgpListboxHeader }],\n})\nexport class NgpListboxHeader {\n /**\n * The id of the listbox header.\n */\n readonly id = input(uniqueId('ngp-listbox-header'));\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpListbox } from './listbox';\n\n/**\n * The state token for the Listbox primitive.\n */\nexport const NgpListboxStateToken = createStateToken<NgpListbox<unknown>>('Listbox');\n\n/**\n * Provides the Listbox state.\n */\nexport const provideListboxState = createStateProvider(NgpListboxStateToken);\n\n/**\n * Injects the Listbox state.\n */\nexport const injectListboxState = createStateInjector<NgpListbox<unknown>>(NgpListboxStateToken, {\n deferred: true,\n});\n\n/**\n * The Listbox state registration function.\n */\nexport const listboxState = createState(NgpListboxStateToken);\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n effect,\n input,\n OnDestroy,\n signal,\n} from '@angular/core';\nimport { ngpInteractions } from 'ng-primitives/interactions';\nimport { injectElementRef, onDomRemoval, scrollIntoViewIfNeeded } from 'ng-primitives/internal';\nimport { uniqueId } from 'ng-primitives/utils';\nimport type { NgpListbox } from '../listbox/listbox';\nimport { injectListboxState } from '../listbox/listbox-state';\n\n@Directive({\n selector: '[ngpListboxOption]',\n exportAs: 'ngpListboxOption',\n host: {\n role: 'option',\n '[attr.id]': 'id()',\n '[attr.aria-disabled]': '_disabled()',\n '[attr.data-active]': 'listbox()?.isFocused() && active() ? \"\" : undefined',\n '[attr.data-selected]': 'selected() ? \"\" : undefined',\n '[attr.data-disabled]': '_disabled() ? \"\" : undefined',\n '(click)': 'select(\"mouse\")',\n '(mouseenter)': 'activate()',\n '(keydown.enter)': 'select(\"keyboard\")',\n '(keydown.space)': 'select(\"keyboard\")',\n },\n})\nexport class NgpListboxOption<T> implements OnDestroy {\n protected readonly listbox = injectListboxState<NgpListbox<T>>();\n private readonly elementRef = injectElementRef();\n\n /**\n * The id of the listbox.\n */\n readonly id = input(uniqueId('ngp-listbox-option'));\n\n /**\n * The value of the option.\n */\n readonly value = input.required<T>({\n alias: 'ngpListboxOptionValue',\n });\n\n /**\n * Whether the option is disabled.\n */\n readonly optionDisabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpListboxOptionDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Whether the option is active.\n */\n protected readonly active = signal<boolean>(false);\n\n /**\n * @internal\n * Whether the option is selected.\n */\n readonly selected = computed(() => this.listbox()?.isSelected(this.value()));\n\n /**\n * @internal\n * Whether the option is disabled - this is used by the `Highlightable` interface.\n */\n get disabled(): boolean {\n return this._disabled();\n }\n\n /**\n * Whether the option is disabled.\n */\n protected readonly _disabled = computed(\n () => this.optionDisabled() || (this.listbox()?.disabled() ?? false),\n );\n\n constructor() {\n ngpInteractions({\n hover: true,\n press: true,\n focusVisible: true,\n focus: true,\n disabled: this._disabled,\n });\n\n // the listbox may not be available when the option is initialized\n // so we need to add the option when the listbox is available\n effect(() => this.listbox()?.addOption(this));\n\n // any time the element is removed from the dom, we need to remove the option from the listbox\n // and we also want to reset the active state\n onDomRemoval(this.elementRef.nativeElement, () => {\n this.listbox()?.removeOption(this);\n this.setInactiveStyles();\n });\n }\n\n ngOnDestroy(): void {\n this.listbox()?.removeOption(this);\n }\n\n /**\n * @internal\n * Sets the active state of the option.\n */\n setActiveStyles(): void {\n this.active.set(true);\n scrollIntoViewIfNeeded(this.elementRef.nativeElement);\n }\n\n /**\n * @internal\n * Sets the inactive state of the option.\n */\n setInactiveStyles(): void {\n this.active.set(false);\n }\n\n /**\n * @internal\n * Gets the label of the option, used by the `Highlightable` interface.\n */\n getLabel(): string {\n return this.elementRef.nativeElement.textContent ?? '';\n }\n\n /**\n * @internal\n * Selects the option.\n */\n select(origin: FocusOrigin): void {\n if (this._disabled()) {\n return;\n }\n\n this.listbox()?.selectOption(this.value(), origin);\n }\n\n /**\n * @internal\n * Activate the current options.\n */\n activate(): void {\n if (this._disabled()) {\n return;\n }\n\n this.listbox()?.activateOption(this.value());\n }\n}\n","import { contentChild, Directive } from '@angular/core';\nimport { NgpHeaderToken } from 'ng-primitives/common';\n\n@Directive({\n selector: '[ngpListboxSection]',\n exportAs: 'ngpListboxSection',\n host: {\n role: 'group',\n '[attr.aria-labelledby]': 'header()?.id()',\n },\n})\nexport class NgpListboxSection {\n /**\n * Access the header of the section if it exists.\n */\n protected readonly header = contentChild(NgpHeaderToken, { descendants: true });\n}\n","import { Directive, HostListener } from '@angular/core';\nimport { injectPopoverTriggerState } from 'ng-primitives/popover';\n\n@Directive({\n selector: '[ngpListboxTrigger]',\n exportAs: 'ngpListboxTrigger',\n})\nexport class NgpListboxTrigger {\n /**\n * There must also be a popover trigger directive associated with this element.\n */\n private readonly popoverTrigger = injectPopoverTriggerState();\n\n /**\n * When the up or down arrow key is pressed, open the popover.\n */\n @HostListener('keydown', ['$event'])\n openPopover(event: KeyboardEvent) {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n this.popoverTrigger().show();\n event.preventDefault();\n }\n }\n}\n","import { ActiveDescendantKeyManager, FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n AfterContentInit,\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n HostListener,\n inject,\n Injector,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { NgpSelectionMode } from 'ng-primitives/common';\nimport { ngpFocusVisible } from 'ng-primitives/interactions';\nimport { explicitEffect } from 'ng-primitives/internal';\nimport { injectPopoverTriggerState } from 'ng-primitives/popover';\nimport { safeTakeUntilDestroyed, uniqueId } from 'ng-primitives/utils';\nimport type { NgpListboxOption } from '../listbox-option/listbox-option';\nimport { listboxState, provideListboxState } from './listbox-state';\n\n@Directive({\n selector: '[ngpListbox]',\n exportAs: 'ngpListbox',\n providers: [provideListboxState()],\n host: {\n '[id]': 'state.id()',\n role: 'listbox',\n '[attr.tabindex]': 'tabindex()',\n '[attr.aria-disabled]': 'state.disabled()',\n '[attr.aria-multiselectable]': 'state.mode() === \"multiple\"',\n '[attr.aria-activedescendant]': 'activeDescendant()',\n '(focusin)': 'isFocused.set(true)',\n '(focusout)': 'isFocused.set(false)',\n },\n})\nexport class NgpListbox<T> implements AfterContentInit {\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the destroy ref.\n */\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * The listbox may be used within a popover, which we may want to close on selection.\n */\n private readonly popoverTrigger = injectPopoverTriggerState({ optional: true });\n\n /**\n * The id of the listbox.\n */\n readonly id = input(uniqueId('ngp-listbox'));\n\n /**\n * The listbox selection mode.\n */\n readonly mode = input<NgpSelectionMode>('single', {\n alias: 'ngpListboxMode',\n });\n\n /**\n * The listbox selection.\n */\n readonly value = input<T[]>([], {\n alias: 'ngpListboxValue',\n });\n\n /**\n * Emits when the listbox selection changes.\n */\n readonly valueChange = output<T[]>({\n alias: 'ngpListboxValueChange',\n });\n\n /**\n * The listbox disabled state.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpListboxDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * The comparator function to use when comparing values.\n * If not provided, strict equality (===) is used.\n */\n readonly compareWith = input<(a: T, b: T) => boolean>((a, b) => a === b, {\n alias: 'ngpListboxCompareWith',\n });\n\n /**\n * The tabindex of the listbox.\n */\n protected readonly tabindex = computed(() => (this.state.disabled() ? -1 : 0));\n\n /**\n * Access the options in the listbox.\n */\n protected readonly options = signal<NgpListboxOption<T>[]>([]);\n\n /**\n * The active descendant of the listbox.\n */\n protected readonly keyManager = new ActiveDescendantKeyManager(this.options, this.injector);\n\n /**\n * Gets the active descendant of the listbox.\n */\n protected readonly activeDescendant = signal<string | undefined>(undefined);\n\n /**\n * @internal\n * Whether the listbox is focused.\n */\n readonly isFocused = signal(false);\n\n /**\n * The listbox state\n */\n protected readonly state = listboxState<NgpListbox<T>>(this);\n\n constructor() {\n ngpFocusVisible({ disabled: this.state.disabled });\n }\n\n ngAfterContentInit(): void {\n this.keyManager.withHomeAndEnd().withTypeAhead().withVerticalOrientation();\n\n this.keyManager.change\n .pipe(safeTakeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.activeDescendant.set(this.keyManager.activeItem?.id()));\n\n // On initialization, set the first selected option as the active descendant if there is one.\n this.updateActiveItem();\n\n // if the options change, update the active item, for example the item that was previously active may have been removed\n // any time the value changes we should make sure that the active item is updated\n explicitEffect([this.options], () => this.updateActiveItem(), {\n injector: this.injector,\n });\n }\n\n private updateActiveItem(): void {\n const activeItem = this.keyManager.activeItem;\n if (activeItem && this.options().includes(activeItem)) {\n return;\n }\n\n const selectedOption = this.options().find(o => o.selected());\n\n if (selectedOption) {\n this.keyManager.setActiveItem(selectedOption);\n } else {\n this.keyManager.setFirstItemActive();\n }\n }\n\n @HostListener('keydown', ['$event'])\n protected onKeydown(event: KeyboardEvent): void {\n this.keyManager.onKeydown(event);\n\n // if the keydown was enter or space, select the active descendant if there is one\n if (event.key === 'Enter' || event.key === ' ') {\n this.keyManager.activeItem?.select('keyboard');\n }\n\n // if this is an arrow key or selection key, prevent the default action to prevent the page from scrolling\n if (\n event.key === 'ArrowDown' ||\n event.key === 'ArrowUp' ||\n event.key === 'Enter' ||\n event.key === ' '\n ) {\n event.preventDefault();\n }\n }\n\n /**\n * @internal\n * Selects an option in the listbox.\n */\n selectOption(value: T, origin: FocusOrigin): void {\n if (this.state.mode() === 'single') {\n const newValue = [value];\n this.state.value.set(newValue);\n this.valueChange.emit(newValue);\n } else {\n // if the value is already selected, remove it, otherwise add it\n if (this.isSelected(value)) {\n const newValue = this.state.value().filter(v => !this.state.compareWith()(v, value));\n this.state.value.set(newValue);\n this.valueChange.emit(newValue);\n } else {\n const newValue = [...this.state.value(), value];\n this.state.value.set(newValue);\n this.valueChange.emit(newValue);\n }\n }\n\n // Set the active descendant to the selected option.\n const option = this.options().find(o => this.state.compareWith()(o.value(), value));\n\n if (option) {\n this.keyManager.setActiveItem(option);\n }\n\n // If the listbox is within a popover, close the popover on selection if it is not in a multiple selection mode.\n if (this.state.mode() !== 'multiple') {\n this.popoverTrigger()?.hide(origin);\n }\n }\n\n /**\n * @internal\n * Determine if an option is selected using the compareWith function.\n */\n isSelected(value: T): boolean {\n // a form may write null/undefined (writeValue(null) / reset); treat as empty\n return (this.state.value() ?? []).some(v => this.state.compareWith()(v, value));\n }\n\n /**\n * @internal\n * Activate an option in the listbox.\n */\n activateOption(value: T) {\n const option = this.options().find(o => this.state.compareWith()(o.value(), value));\n\n if (option) {\n this.keyManager.setActiveItem(option);\n }\n }\n\n /**\n * Registers an option with the listbox.\n * @internal\n */\n addOption(option: NgpListboxOption<T>): void {\n // if the option already exists, do not add it again\n if (!this.options().includes(option)) {\n this.options.update(options => [...options, option]);\n }\n }\n\n /**\n * Deregisters an option with the listbox.\n * @internal\n */\n removeOption(option: NgpListboxOption<T>): void {\n this.options.update(options => options.filter(o => o !== option));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAca,gBAAgB,CAAA;AAV7B,IAAA,WAAA,GAAA;AAWE;;AAEG;QACM,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,oBAAoB,CAAC,yEAAC;AACpD,IAAA;+GALY,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAA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,EAAE,oBAAoB;AACpD,wBAAA,WAAW,EAAE,qBAAqB;AAClC,wBAAA,YAAY,EAAE,sBAAsB;AACrC,qBAAA;AACF,iBAAA;;sBA8HE,YAAY;uBAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;;;ACnKrC;;AAEG;;;;"}
@@ -825,6 +825,10 @@ const [NgpMenuItemStateToken, ngpMenuItem, injectMenuItemState, provideMenuItemS
825
825
  listener(element, 'mouseenter', showSubmenuOnHover);
826
826
  // Methods
827
827
  function onClick(event) {
828
+ // Disabled items are inert - they must not activate or close the menu.
829
+ if (disabled()) {
830
+ return;
831
+ }
828
832
  // we do this here to avoid circular dependency issues
829
833
  const trigger = injector.get(NgpSubmenuTrigger, null, { self: true, optional: true });
830
834
  const origin = event.detail === 0 ? 'keyboard' : 'mouse';
@@ -835,6 +839,10 @@ const [NgpMenuItemStateToken, ngpMenuItem, injectMenuItemState, provideMenuItemS
835
839
  }
836
840
  }
837
841
  function handleArrowKey(event) {
842
+ // disabled items are inert - they must not respond to keyboard navigation
843
+ if (disabled()) {
844
+ return;
845
+ }
838
846
  if (event instanceof KeyboardEvent === false) {
839
847
  return;
840
848
  }