ng-primitives 0.65.0 → 0.67.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.
@@ -160,15 +160,23 @@ class NgpFormControl {
160
160
  alias: 'ngpFormControlDisabled',
161
161
  transform: booleanAttribute,
162
162
  });
163
+ /**
164
+ * The element reference.
165
+ */
166
+ this.elementRef = injectElementRef();
167
+ /**
168
+ * Whether the element supports the disabled attribute.
169
+ */
170
+ this.supportsDisabledAttribute = 'disabled' in this.elementRef.nativeElement;
163
171
  /**
164
172
  * The state of the form control.
165
173
  */
166
174
  this.state = formControlState(this);
167
175
  // Sync the form control state with the control state.
168
- setupFormControl({ id: this.state.id, disabled: this.state.disabled });
176
+ this.status = setupFormControl({ id: this.state.id, disabled: this.state.disabled });
169
177
  }
170
178
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpFormControl, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
171
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpFormControl, isStandalone: true, selector: "[ngpFormControl]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpFormControlDisabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideFormControlState()], exportAs: ["ngpFormControl"], ngImport: i0 }); }
179
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpFormControl, isStandalone: true, selector: "[ngpFormControl]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpFormControlDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.disabled": "supportsDisabledAttribute && status().disabled ? \"\" : null" } }, providers: [provideFormControlState()], exportAs: ["ngpFormControl"], ngImport: i0 }); }
172
180
  }
173
181
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpFormControl, decorators: [{
174
182
  type: Directive,
@@ -176,6 +184,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
176
184
  selector: '[ngpFormControl]',
177
185
  exportAs: 'ngpFormControl',
178
186
  providers: [provideFormControlState()],
187
+ host: {
188
+ '[attr.disabled]': 'supportsDisabledAttribute && status().disabled ? "" : null',
189
+ },
179
190
  }]
180
191
  }], ctorParameters: () => [] });
181
192
  function setupFormControl({ id, disabled = signal(false), }) {
@@ -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.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.ts","../../../../packages/ng-primitives/form-field/src/ng-primitives-form-field.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpFormField } from './form-field';\n\n/**\n * The state token for the FormField primitive.\n */\nexport const NgpFormFieldStateToken = createStateToken<NgpFormField>('FormField');\n\n/**\n * Provides the FormField state.\n */\nexport const provideFormFieldState = createStateProvider(NgpFormFieldStateToken);\n\n/**\n * Injects the FormField state.\n */\nexport const injectFormFieldState = createStateInjector<NgpFormField>(NgpFormFieldStateToken);\n\n/**\n * The FormField state registration function.\n */\nexport const formFieldState = createState(NgpFormFieldStateToken);\n","import { Directive, effect, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-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 host: {\n '[attr.id]': 'id()',\n '[attr.data-invalid]': 'formField()?.invalid() ? \"\" : null',\n '[attr.data-valid]': 'formField()?.valid() ? \"\" : null',\n '[attr.data-touched]': 'formField()?.touched() ? \"\" : null',\n '[attr.data-pristine]': 'formField()?.pristine() ? \"\" : null',\n '[attr.data-dirty]': 'formField()?.dirty() ? \"\" : null',\n '[attr.data-pending]': 'formField()?.pending() ? \"\" : null',\n '[attr.data-disabled]': 'formField()?.disabled() ? \"\" : null',\n },\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 * Access the form field that the description is associated with.\n */\n protected readonly formField = injectFormFieldState({ optional: true });\n\n constructor() {\n effect(onCleanup => {\n this.formField()?.addDescription(this.id());\n onCleanup(() => this.formField()?.removeDescription(this.id()));\n });\n }\n}\n","import { Directive, OnChanges, OnDestroy, SimpleChanges, computed, input } from '@angular/core';\nimport { onBooleanChange, uniqueId } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-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 host: {\n '[attr.id]': 'id()',\n '[attr.data-invalid]': 'formField()?.invalid() ? \"\" : null',\n '[attr.data-valid]': 'formField()?.valid() ? \"\" : null',\n '[attr.data-touched]': 'formField()?.touched() ? \"\" : null',\n '[attr.data-pristine]': 'formField()?.pristine() ? \"\" : null',\n '[attr.data-dirty]': 'formField()?.dirty() ? \"\" : null',\n '[attr.data-pending]': 'formField()?.pending() ? \"\" : null',\n '[attr.data-disabled]': 'formField()?.disabled() ? \"\" : null',\n '[attr.data-validator]': 'state()',\n },\n})\nexport class NgpError implements OnChanges, OnDestroy {\n /**\n * Access the form field that the description is associated with.\n */\n protected readonly formField = injectFormFieldState({ optional: true });\n\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 * Determine if there is an error message.\n */\n protected readonly hasError = computed(() => {\n const errors = this.formField()?.errors() ?? [];\n const validator = this.validator();\n\n return validator ? errors?.includes(validator) : errors?.length > 0;\n });\n\n /**\n * Determine whether the validator associated with this error is failing.\n */\n protected readonly state = computed(() => (this.hasError() ? 'fail' : 'pass'));\n\n constructor() {\n // add or remove the error message when the error state changes\n onBooleanChange(\n this.hasError,\n () => this.formField()?.addDescription(this.id()),\n () => this.formField()?.removeDescription(this.id()),\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if ('id' in changes) {\n this.formField()?.removeDescription(changes['id'].previousValue);\n }\n }\n\n ngOnDestroy(): void {\n this.formField()?.removeDescription(this.id());\n }\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpFormControl } from './form-control';\n\n/**\n * The state token for the FormControl primitive.\n */\nexport const NgpFormControlStateToken = createStateToken<NgpFormControl>('FormControl');\n\n/**\n * Provides the FormControl state.\n */\nexport const provideFormControlState = createStateProvider(NgpFormControlStateToken);\n\n/**\n * Injects the FormControl state.\n */\nexport const injectFormControlState = createStateInjector<NgpFormControl>(NgpFormControlStateToken);\n\n/**\n * The FormControl state registration function.\n */\nexport const formControlState = createState(NgpFormControlStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n afterRenderEffect,\n booleanAttribute,\n computed,\n Directive,\n input,\n signal,\n Signal,\n} from '@angular/core';\nimport { explicitEffect, injectElementRef } from 'ng-primitives/internal';\nimport { controlStatus, NgpControlStatus, uniqueId } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\nimport { formControlState, provideFormControlState } 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 providers: [provideFormControlState()],\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 state of the form control.\n */\n private readonly state = formControlState<NgpFormControl>(this);\n\n constructor() {\n // Sync the form control state with the control state.\n setupFormControl({ id: this.state.id, disabled: this.state.disabled });\n }\n}\n\ninterface FormControlState {\n id: Signal<string>;\n disabled?: Signal<boolean>;\n}\n\nexport function setupFormControl({\n id,\n disabled = signal(false),\n}: FormControlState): Signal<NgpControlStatus> {\n const element = injectElementRef().nativeElement;\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(() => formField()?.labels().join(' '));\n // Determine the aria-describedby attribute value.\n const ariaDescribedBy = computed(() => formField()?.descriptions().join(' '));\n\n explicitEffect([id], ([id], onCleanup) => {\n formField()?.setFormControl(id);\n onCleanup(() => formField()?.removeFormControl());\n });\n\n afterRenderEffect({\n write: () => {\n setAttribute(element, 'id', id());\n setAttribute(element, 'aria-labelledby', ariaLabelledBy());\n setAttribute(element, 'aria-describedby', ariaDescribedBy());\n\n setStateAttribute(element, status().invalid, 'data-invalid');\n setStateAttribute(element, status().valid, 'data-valid');\n setStateAttribute(element, status().touched, 'data-touched');\n setStateAttribute(element, status().pristine, 'data-pristine');\n setStateAttribute(element, status().dirty, 'data-dirty');\n setStateAttribute(element, status().pending, 'data-pending');\n setStateAttribute(element, disabled() || status().disabled, 'data-disabled');\n },\n });\n\n return computed(() => ({ ...status(), disabled: status().disabled || disabled() }));\n}\n\n/**\n * Sets the attribute on the element. If the value is not empty, the attribute is set to the value.\n * If the value is empty, the attribute is removed.\n * @param element The element to set the attribute on.\n * @param attribute The attribute to set on the element.\n * @param value The value to set on the attribute.\n */\nfunction setAttribute(element: HTMLElement, attribute: string, value: string) {\n if (value && value.length > 0) {\n element.setAttribute(attribute, value);\n } else {\n element.removeAttribute(attribute);\n }\n}\n\n/**\n * Sets the attribute on the element based on the state. If the state is true, the attribute\n * is set to an empty string. If the state is false, the attribute is removed.\n * @param element The element to set the attribute on.\n * @param state The state to set the attribute based on.\n * @param attribute The attribute to set on the element.\n */\nfunction setStateAttribute(element: HTMLElement, state: boolean | null, attribute: string) {\n if (state) {\n element.setAttribute(attribute, '');\n } else {\n element.removeAttribute(attribute);\n }\n}\n","import { Directive, OnDestroy, contentChild, signal } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { onChange } from 'ng-primitives/utils';\nimport { Subscription } from 'rxjs';\nimport { formFieldState, 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 host: {\n '[attr.data-invalid]': 'invalid() ? \"\" : null',\n '[attr.data-valid]': 'valid() ? \"\" : null',\n '[attr.data-touched]': 'touched() ? \"\" : null',\n '[attr.data-pristine]': 'pristine() ? \"\" : null',\n '[attr.data-dirty]': 'dirty() ? \"\" : null',\n '[attr.data-pending]': 'pending() ? \"\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n },\n})\nexport class NgpFormField implements OnDestroy {\n /**\n * Store the form label.\n * @internal\n */\n readonly labels = signal<string[]>([]);\n\n /**\n * Store the form descriptions.\n * @internal\n */\n readonly descriptions = signal<string[]>([]);\n\n /**\n * Store the id of the associated form control.\n * @internal\n */\n readonly formControl = signal<string | null>(null);\n\n /**\n * Find any NgControl within the form field.\n * @internal\n */\n private readonly ngControl = contentChild(NgControl);\n\n /**\n * Store the validation error messages.\n * @internal\n */\n readonly errors = signal<string[]>([]);\n\n /**\n * Whether the control is pristine.\n * @internal\n */\n readonly pristine = signal<boolean | null>(null);\n\n /**\n * Whether the control is touched.\n * @internal\n */\n readonly touched = signal<boolean | null>(null);\n\n /**\n * Whether the control is dirty.\n * @internal\n */\n readonly dirty = signal<boolean | null>(null);\n\n /**\n * Whether the control is valid.\n */\n readonly valid = signal<boolean | null>(null);\n\n /**\n * Whether the control is invalid.\n * @internal\n */\n readonly invalid = signal<boolean | null>(null);\n\n /**\n * Whether the control is pending.\n * @internal\n */\n readonly pending = signal<boolean | null>(null);\n\n /**\n * Whether the control is disabled.\n * @internal\n */\n readonly disabled = signal<boolean | null>(null);\n\n /**\n * Store the current status subscription.\n */\n private subscription?: Subscription;\n\n /**\n * The form field state.\n */\n protected readonly state = formFieldState<NgpFormField>(this);\n\n constructor() {\n // any time the ngControl changes, setup the subscriptions.\n onChange(this.ngControl, this.setupSubscriptions.bind(this));\n }\n\n ngOnDestroy(): void {\n this.subscription?.unsubscribe();\n }\n\n /**\n * Setup a listener for the form control status.\n * @param control\n */\n private setupSubscriptions(control: NgControl | null | undefined): void {\n // Unsubscribe from the previous subscriptions.\n this.subscription?.unsubscribe();\n\n // set the initial values\n this.updateStatus();\n\n const underlyingControl = control?.control;\n\n // Listen for changes to the underlying control's status.\n this.subscription = underlyingControl?.events?.subscribe(this.updateStatus.bind(this));\n }\n\n private updateStatus(): void {\n const control = this.ngControl();\n\n if (!control) {\n return;\n }\n\n this.pristine.set(control.pristine);\n this.touched.set(control.touched);\n this.dirty.set(control.dirty);\n this.valid.set(control.valid);\n this.invalid.set(control.invalid);\n this.pending.set(control.pending);\n this.disabled.set(control.disabled);\n this.errors.set(control?.errors ? Object.keys(control.errors) : []);\n }\n\n /**\n * Register the id of the associated form control.\n * @param id\n * @internal\n */\n setFormControl(id: string): void {\n this.formControl.set(id);\n }\n\n /**\n * Register a label with the form field.\n * @param label\n * @internal\n */\n addLabel(label: string): void {\n this.labels.update(labels => [...labels, label]);\n }\n\n /**\n * Register a description with the form field.\n * @param description\n * @internal\n */\n addDescription(description: string): void {\n this.descriptions.update(descriptions => [...descriptions, description]);\n }\n\n /**\n * Remove the associated form control.\n * @internal\n */\n removeFormControl(): void {\n this.formControl.set(null);\n }\n\n /**\n * Remove a label from the form field.\n * @param label\n * @internal\n */\n removeLabel(label: string): void {\n this.labels.update(labels => labels.filter(l => l !== label));\n }\n\n /**\n * Remove a description from the form field.\n * @param description\n * @internal\n */\n removeDescription(description: string): void {\n this.descriptions.update(descriptions => descriptions.filter(d => d !== description));\n }\n}\n","import {\n computed,\n Directive,\n effect,\n ElementRef,\n HostListener,\n inject,\n input,\n} from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-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 host: {\n '[attr.id]': 'id()',\n '[attr.for]': 'htmlFor()',\n '[attr.data-invalid]': 'formField()?.invalid() ? \"\" : null',\n '[attr.data-valid]': 'formField()?.valid() ? \"\" : null',\n '[attr.data-touched]': 'formField()?.touched() ? \"\" : null',\n '[attr.data-pristine]': 'formField()?.pristine() ? \"\" : null',\n '[attr.data-dirty]': 'formField()?.dirty() ? \"\" : null',\n '[attr.data-pending]': 'formField()?.pending() ? \"\" : null',\n '[attr.data-disabled]': 'formField()?.disabled() ? \"\" : null',\n },\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 * Access the form field that the label is associated with.\n */\n protected readonly formField = injectFormFieldState({ optional: true });\n /**\n * Derive the for attribute value if the label is an HTML label element.\n */\n protected readonly htmlFor = computed(() => this.formField()?.formControl());\n /**\n * Access the element that the label is associated with.\n */\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n /**\n * Determine if the label is an HTML label element.\n */\n protected readonly isLabel = this.elementRef.nativeElement instanceof HTMLLabelElement;\n\n constructor() {\n effect(onCleanup => {\n this.formField()?.addLabel(this.id());\n onCleanup(() => this.formField()?.removeLabel(this.id()));\n });\n }\n\n @HostListener('click', ['$event'])\n protected 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 (this.isLabel) {\n event.preventDefault();\n }\n\n // to find the associated form control we can lookup via the known id\n const targetId = this.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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAQA;;AAEG;AACI,MAAM,sBAAsB,GAAG,gBAAgB,CAAe,WAAW,CAAC;AAEjF;;AAEG;MACU,qBAAqB,GAAG,m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AA,sCAAA,EAAA,iBAAA,EAAA,oCAAA,EAAA,mBAAA,EAAA,sCAAA,EAAA,oBAAA,EAAA,uCAAA,EAAA,iBAAA,EAAA,oCAAA,EAAA,mBAAA,EAAA,sCAAA,EAAA,oBAAA,EAAA,uCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAfpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,QAAQ,EAAE,UAAU;AACpB,oBAAA,IAAI,EAAE;AACJ,wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,YAAY,EAAE,WAAW;AACzB,wBAAA,qBAAqB,EAAE,oCAAoC;AAC3D,wBAAA,mBAAmB,EAAE,kCAAkC;AACvD,wBAAA,qBAAqB,EAAE,oCAAoC;AAC3D,wBAAA,sBAAsB,EAAE,qCAAqC;AAC7D,wBAAA,mBAAmB,EAAE,kCAAkC;AACvD,wBAAA,qBAAqB,EAAE,oCAAoC;AAC3D,wBAAA,sBAAsB,EAAE,qCAAqC;AAC9D,qBAAA;AACF,iBAAA;wDA+BW,OAAO,EAAA,CAAA;sBADhB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;AC3DnC;;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.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.ts","../../../../packages/ng-primitives/form-field/src/ng-primitives-form-field.ts"],"sourcesContent":["import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpFormField } from './form-field';\n\n/**\n * The state token for the FormField primitive.\n */\nexport const NgpFormFieldStateToken = createStateToken<NgpFormField>('FormField');\n\n/**\n * Provides the FormField state.\n */\nexport const provideFormFieldState = createStateProvider(NgpFormFieldStateToken);\n\n/**\n * Injects the FormField state.\n */\nexport const injectFormFieldState = createStateInjector<NgpFormField>(NgpFormFieldStateToken);\n\n/**\n * The FormField state registration function.\n */\nexport const formFieldState = createState(NgpFormFieldStateToken);\n","import { Directive, effect, input } from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-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 host: {\n '[attr.id]': 'id()',\n '[attr.data-invalid]': 'formField()?.invalid() ? \"\" : null',\n '[attr.data-valid]': 'formField()?.valid() ? \"\" : null',\n '[attr.data-touched]': 'formField()?.touched() ? \"\" : null',\n '[attr.data-pristine]': 'formField()?.pristine() ? \"\" : null',\n '[attr.data-dirty]': 'formField()?.dirty() ? \"\" : null',\n '[attr.data-pending]': 'formField()?.pending() ? \"\" : null',\n '[attr.data-disabled]': 'formField()?.disabled() ? \"\" : null',\n },\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 * Access the form field that the description is associated with.\n */\n protected readonly formField = injectFormFieldState({ optional: true });\n\n constructor() {\n effect(onCleanup => {\n this.formField()?.addDescription(this.id());\n onCleanup(() => this.formField()?.removeDescription(this.id()));\n });\n }\n}\n","import { Directive, OnChanges, OnDestroy, SimpleChanges, computed, input } from '@angular/core';\nimport { onBooleanChange, uniqueId } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-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 host: {\n '[attr.id]': 'id()',\n '[attr.data-invalid]': 'formField()?.invalid() ? \"\" : null',\n '[attr.data-valid]': 'formField()?.valid() ? \"\" : null',\n '[attr.data-touched]': 'formField()?.touched() ? \"\" : null',\n '[attr.data-pristine]': 'formField()?.pristine() ? \"\" : null',\n '[attr.data-dirty]': 'formField()?.dirty() ? \"\" : null',\n '[attr.data-pending]': 'formField()?.pending() ? \"\" : null',\n '[attr.data-disabled]': 'formField()?.disabled() ? \"\" : null',\n '[attr.data-validator]': 'state()',\n },\n})\nexport class NgpError implements OnChanges, OnDestroy {\n /**\n * Access the form field that the description is associated with.\n */\n protected readonly formField = injectFormFieldState({ optional: true });\n\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 * Determine if there is an error message.\n */\n protected readonly hasError = computed(() => {\n const errors = this.formField()?.errors() ?? [];\n const validator = this.validator();\n\n return validator ? errors?.includes(validator) : errors?.length > 0;\n });\n\n /**\n * Determine whether the validator associated with this error is failing.\n */\n protected readonly state = computed(() => (this.hasError() ? 'fail' : 'pass'));\n\n constructor() {\n // add or remove the error message when the error state changes\n onBooleanChange(\n this.hasError,\n () => this.formField()?.addDescription(this.id()),\n () => this.formField()?.removeDescription(this.id()),\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if ('id' in changes) {\n this.formField()?.removeDescription(changes['id'].previousValue);\n }\n }\n\n ngOnDestroy(): void {\n this.formField()?.removeDescription(this.id());\n }\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpFormControl } from './form-control';\n\n/**\n * The state token for the FormControl primitive.\n */\nexport const NgpFormControlStateToken = createStateToken<NgpFormControl>('FormControl');\n\n/**\n * Provides the FormControl state.\n */\nexport const provideFormControlState = createStateProvider(NgpFormControlStateToken);\n\n/**\n * Injects the FormControl state.\n */\nexport const injectFormControlState = createStateInjector<NgpFormControl>(NgpFormControlStateToken);\n\n/**\n * The FormControl state registration function.\n */\nexport const formControlState = createState(NgpFormControlStateToken);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n afterRenderEffect,\n booleanAttribute,\n computed,\n Directive,\n input,\n signal,\n Signal,\n} from '@angular/core';\nimport { explicitEffect, injectElementRef } from 'ng-primitives/internal';\nimport { controlStatus, NgpControlStatus, uniqueId } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-state';\nimport { formControlState, provideFormControlState } 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 providers: [provideFormControlState()],\n host: {\n '[attr.disabled]': 'supportsDisabledAttribute && status().disabled ? \"\" : null',\n },\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: Signal<NgpControlStatus>;\n\n /**\n * The element reference.\n */\n private readonly elementRef = injectElementRef();\n\n /**\n * Whether the element supports the disabled attribute.\n */\n protected readonly supportsDisabledAttribute = 'disabled' in this.elementRef.nativeElement;\n\n /**\n * The state of the form control.\n */\n private readonly state = formControlState<NgpFormControl>(this);\n\n constructor() {\n // Sync the form control state with the control state.\n this.status = setupFormControl({ id: this.state.id, disabled: this.state.disabled });\n }\n}\n\ninterface FormControlState {\n id: Signal<string>;\n disabled?: Signal<boolean>;\n}\n\nexport function setupFormControl({\n id,\n disabled = signal(false),\n}: FormControlState): Signal<NgpControlStatus> {\n const element = injectElementRef().nativeElement;\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(() => formField()?.labels().join(' '));\n // Determine the aria-describedby attribute value.\n const ariaDescribedBy = computed(() => formField()?.descriptions().join(' '));\n\n explicitEffect([id], ([id], onCleanup) => {\n formField()?.setFormControl(id);\n onCleanup(() => formField()?.removeFormControl());\n });\n\n afterRenderEffect({\n write: () => {\n setAttribute(element, 'id', id());\n setAttribute(element, 'aria-labelledby', ariaLabelledBy());\n setAttribute(element, 'aria-describedby', ariaDescribedBy());\n\n setStateAttribute(element, status().invalid, 'data-invalid');\n setStateAttribute(element, status().valid, 'data-valid');\n setStateAttribute(element, status().touched, 'data-touched');\n setStateAttribute(element, status().pristine, 'data-pristine');\n setStateAttribute(element, status().dirty, 'data-dirty');\n setStateAttribute(element, status().pending, 'data-pending');\n setStateAttribute(element, disabled() || status().disabled, 'data-disabled');\n },\n });\n\n return computed(() => ({ ...status(), disabled: status().disabled || disabled() }));\n}\n\n/**\n * Sets the attribute on the element. If the value is not empty, the attribute is set to the value.\n * If the value is empty, the attribute is removed.\n * @param element The element to set the attribute on.\n * @param attribute The attribute to set on the element.\n * @param value The value to set on the attribute.\n */\nfunction setAttribute(element: HTMLElement, attribute: string, value: string) {\n if (value && value.length > 0) {\n element.setAttribute(attribute, value);\n } else {\n element.removeAttribute(attribute);\n }\n}\n\n/**\n * Sets the attribute on the element based on the state. If the state is true, the attribute\n * is set to an empty string. If the state is false, the attribute is removed.\n * @param element The element to set the attribute on.\n * @param state The state to set the attribute based on.\n * @param attribute The attribute to set on the element.\n */\nfunction setStateAttribute(element: HTMLElement, state: boolean | null, attribute: string) {\n if (state) {\n element.setAttribute(attribute, '');\n } else {\n element.removeAttribute(attribute);\n }\n}\n","import { Directive, OnDestroy, contentChild, signal } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { onChange } from 'ng-primitives/utils';\nimport { Subscription } from 'rxjs';\nimport { formFieldState, 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 host: {\n '[attr.data-invalid]': 'invalid() ? \"\" : null',\n '[attr.data-valid]': 'valid() ? \"\" : null',\n '[attr.data-touched]': 'touched() ? \"\" : null',\n '[attr.data-pristine]': 'pristine() ? \"\" : null',\n '[attr.data-dirty]': 'dirty() ? \"\" : null',\n '[attr.data-pending]': 'pending() ? \"\" : null',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n },\n})\nexport class NgpFormField implements OnDestroy {\n /**\n * Store the form label.\n * @internal\n */\n readonly labels = signal<string[]>([]);\n\n /**\n * Store the form descriptions.\n * @internal\n */\n readonly descriptions = signal<string[]>([]);\n\n /**\n * Store the id of the associated form control.\n * @internal\n */\n readonly formControl = signal<string | null>(null);\n\n /**\n * Find any NgControl within the form field.\n * @internal\n */\n private readonly ngControl = contentChild(NgControl);\n\n /**\n * Store the validation error messages.\n * @internal\n */\n readonly errors = signal<string[]>([]);\n\n /**\n * Whether the control is pristine.\n * @internal\n */\n readonly pristine = signal<boolean | null>(null);\n\n /**\n * Whether the control is touched.\n * @internal\n */\n readonly touched = signal<boolean | null>(null);\n\n /**\n * Whether the control is dirty.\n * @internal\n */\n readonly dirty = signal<boolean | null>(null);\n\n /**\n * Whether the control is valid.\n */\n readonly valid = signal<boolean | null>(null);\n\n /**\n * Whether the control is invalid.\n * @internal\n */\n readonly invalid = signal<boolean | null>(null);\n\n /**\n * Whether the control is pending.\n * @internal\n */\n readonly pending = signal<boolean | null>(null);\n\n /**\n * Whether the control is disabled.\n * @internal\n */\n readonly disabled = signal<boolean | null>(null);\n\n /**\n * Store the current status subscription.\n */\n private subscription?: Subscription;\n\n /**\n * The form field state.\n */\n protected readonly state = formFieldState<NgpFormField>(this);\n\n constructor() {\n // any time the ngControl changes, setup the subscriptions.\n onChange(this.ngControl, this.setupSubscriptions.bind(this));\n }\n\n ngOnDestroy(): void {\n this.subscription?.unsubscribe();\n }\n\n /**\n * Setup a listener for the form control status.\n * @param control\n */\n private setupSubscriptions(control: NgControl | null | undefined): void {\n // Unsubscribe from the previous subscriptions.\n this.subscription?.unsubscribe();\n\n // set the initial values\n this.updateStatus();\n\n const underlyingControl = control?.control;\n\n // Listen for changes to the underlying control's status.\n this.subscription = underlyingControl?.events?.subscribe(this.updateStatus.bind(this));\n }\n\n private updateStatus(): void {\n const control = this.ngControl();\n\n if (!control) {\n return;\n }\n\n this.pristine.set(control.pristine);\n this.touched.set(control.touched);\n this.dirty.set(control.dirty);\n this.valid.set(control.valid);\n this.invalid.set(control.invalid);\n this.pending.set(control.pending);\n this.disabled.set(control.disabled);\n this.errors.set(control?.errors ? Object.keys(control.errors) : []);\n }\n\n /**\n * Register the id of the associated form control.\n * @param id\n * @internal\n */\n setFormControl(id: string): void {\n this.formControl.set(id);\n }\n\n /**\n * Register a label with the form field.\n * @param label\n * @internal\n */\n addLabel(label: string): void {\n this.labels.update(labels => [...labels, label]);\n }\n\n /**\n * Register a description with the form field.\n * @param description\n * @internal\n */\n addDescription(description: string): void {\n this.descriptions.update(descriptions => [...descriptions, description]);\n }\n\n /**\n * Remove the associated form control.\n * @internal\n */\n removeFormControl(): void {\n this.formControl.set(null);\n }\n\n /**\n * Remove a label from the form field.\n * @param label\n * @internal\n */\n removeLabel(label: string): void {\n this.labels.update(labels => labels.filter(l => l !== label));\n }\n\n /**\n * Remove a description from the form field.\n * @param description\n * @internal\n */\n removeDescription(description: string): void {\n this.descriptions.update(descriptions => descriptions.filter(d => d !== description));\n }\n}\n","import {\n computed,\n Directive,\n effect,\n ElementRef,\n HostListener,\n inject,\n input,\n} from '@angular/core';\nimport { uniqueId } from 'ng-primitives/utils';\nimport { injectFormFieldState } from '../form-field/form-field-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 host: {\n '[attr.id]': 'id()',\n '[attr.for]': 'htmlFor()',\n '[attr.data-invalid]': 'formField()?.invalid() ? \"\" : null',\n '[attr.data-valid]': 'formField()?.valid() ? \"\" : null',\n '[attr.data-touched]': 'formField()?.touched() ? \"\" : null',\n '[attr.data-pristine]': 'formField()?.pristine() ? \"\" : null',\n '[attr.data-dirty]': 'formField()?.dirty() ? \"\" : null',\n '[attr.data-pending]': 'formField()?.pending() ? \"\" : null',\n '[attr.data-disabled]': 'formField()?.disabled() ? \"\" : null',\n },\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 * Access the form field that the label is associated with.\n */\n protected readonly formField = injectFormFieldState({ optional: true });\n /**\n * Derive the for attribute value if the label is an HTML label element.\n */\n protected readonly htmlFor = computed(() => this.formField()?.formControl());\n /**\n * Access the element that the label is associated with.\n */\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n /**\n * Determine if the label is an HTML label element.\n */\n protected readonly isLabel = this.elementRef.nativeElement instanceof HTMLLabelElement;\n\n constructor() {\n effect(onCleanup => {\n this.formField()?.addLabel(this.id());\n onCleanup(() => this.formField()?.removeLabel(this.id()));\n });\n }\n\n @HostListener('click', ['$event'])\n protected 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 (this.isLabel) {\n event.preventDefault();\n }\n\n // to find the associated form control we can lookup via the known id\n const targetId = this.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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAQA;;AAEG;AACI,MAAM,sBAAsB,GAAG,gBAAgB,CAAe,WAAW,CAAC;AAEjF;;AAEG;MACU,qBAAqB,GAAG,mBAAmB,CAAC,sBAAsB;AAE/E;;AAEG;MACU,oBAAoB,GAAG,mBAAmB,CAAe,sBAAsB;AAE5F;;AAEG;AACI,MAAM,cAAc,GAAG,WAAW,CAAC,sBAAsB,CAAC;;ACtBjE;;AAEG;MAeU,cAAc,CAAA;AAUzB,IAAA,WAAA,GAAA;AATA;;AAEG;QACM,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AACxD;;AAEG;QACgB,IAAA,CAAA,SAAS,GAAG,oBAAoB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAGrE,MAAM,CAAC,SAAS,IAAG;YACjB,IAAI,CAAC,SAAS,EAAE,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;AAC3C,YAAA,SAAS,CAAC,MAAM,IAAI,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,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAfpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,QAAQ,EAAE,UAAU;AACpB,oBAAA,IAAI,EAAE;AACJ,wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,YAAY,EAAE,WAAW;AACzB,wBAAA,qBAAqB,EAAE,oCAAoC;AAC3D,wBAAA,mBAAmB,EAAE,kCAAkC;AACvD,wBAAA,qBAAqB,EAAE,oCAAoC;AAC3D,wBAAA,sBAAsB,EAAE,qCAAqC;AAC7D,wBAAA,mBAAmB,EAAE,kCAAkC;AACvD,wBAAA,qBAAqB,EAAE,oCAAoC;AAC3D,wBAAA,sBAAsB,EAAE,qCAAqC;AAC9D,qBAAA;AACF,iBAAA;wDA+BW,OAAO,EAAA,CAAA;sBADhB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;AC3DnC;;AAEG;;;;"}
@@ -563,7 +563,7 @@ class NgpMenu {
563
563
  this.parentMenu?.closeAllMenus(origin);
564
564
  }
565
565
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
566
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpMenu, isStandalone: true, selector: "[ngpMenu]", host: { attributes: { "role": "menu" }, properties: { "style.left.px": "overlay.position().x", "style.top.px": "overlay.position().y", "style.--ngp-menu-trigger-width.px": "overlay.triggerWidth()", "style.--ngp-menu-transform-origin": "overlay.transformOrigin()" } }, providers: [
566
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpMenu, isStandalone: true, selector: "[ngpMenu]", host: { attributes: { "role": "menu" }, properties: { "style.left.px": "overlay.position().x", "style.top.px": "overlay.position().y", "style.--ngp-menu-trigger-width.px": "overlay.triggerWidth()", "style.--ngp-menu-transform-origin": "overlay.transformOrigin()", "attr.data-placement": "overlay.finalPlacement()" } }, providers: [
567
567
  // ensure we don't inherit the focus group from the parent menu if there is one
568
568
  provideRovingFocusGroup(NgpRovingFocusGroup, { inherit: false }),
569
569
  provideMenu(NgpMenu),
@@ -586,6 +586,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImpo
586
586
  '[style.top.px]': 'overlay.position().y',
587
587
  '[style.--ngp-menu-trigger-width.px]': 'overlay.triggerWidth()',
588
588
  '[style.--ngp-menu-transform-origin]': 'overlay.transformOrigin()',
589
+ '[attr.data-placement]': 'overlay.finalPlacement()',
589
590
  },
590
591
  }]
591
592
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"ng-primitives-menu.mjs","sources":["../../../../packages/ng-primitives/menu/src/config/menu-config.ts","../../../../packages/ng-primitives/menu/src/menu/menu-token.ts","../../../../packages/ng-primitives/menu/src/submenu-trigger/submenu-trigger-state.ts","../../../../packages/ng-primitives/menu/src/submenu-trigger/submenu-trigger.ts","../../../../packages/ng-primitives/menu/src/menu-item/menu-item.ts","../../../../packages/ng-primitives/menu/src/menu-trigger/menu-trigger-state.ts","../../../../packages/ng-primitives/menu/src/menu-trigger/menu-trigger.ts","../../../../packages/ng-primitives/menu/src/menu/menu.ts","../../../../packages/ng-primitives/menu/src/ng-primitives-menu.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { Placement } from '@floating-ui/dom';\n\nexport interface NgpMenuConfig {\n /**\n * Define the offset of the menu relative to the trigger.\n * @default 4\n */\n offset: number;\n\n /**\n * Define the placement of the menu relative to the trigger.\n * @default 'bottom-start'\n */\n placement: Placement;\n\n /**\n * Define whether the menu should flip when there is not enough space for the menu.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container in to which the menu should be attached.\n * @default document.body\n */\n container: HTMLElement | null;\n\n /**\n * Defines how the menu behaves when the window is scrolled.\n * @default scroll\n */\n scrollBehavior: 'reposition' | 'block';\n}\n\nexport const defaultMenuConfig: NgpMenuConfig = {\n offset: 4,\n placement: 'bottom-start',\n flip: true,\n container: null,\n scrollBehavior: 'block',\n};\n\nexport const NgpMenuConfigToken = new InjectionToken<NgpMenuConfig>('NgpMenuConfigToken');\n\n/**\n * Provide the default Menu configuration\n * @param config The Menu configuration\n * @returns The provider\n */\nexport function provideMenuConfig(config: Partial<NgpMenuConfig>): Provider[] {\n return [\n {\n provide: NgpMenuConfigToken,\n useValue: { ...defaultMenuConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Menu configuration\n * @returns The global Menu configuration\n */\nexport function injectMenuConfig(): NgpMenuConfig {\n return inject(NgpMenuConfigToken, { optional: true }) ?? defaultMenuConfig;\n}\n","import { ExistingProvider, inject, InjectionToken, Type } from '@angular/core';\nimport type { NgpMenu } from './menu';\n\nexport const NgpMenuToken = new InjectionToken<NgpMenu>('NgpMenuToken');\n\n/**\n * Inject the Menu directive instance\n */\nexport function injectMenu(): NgpMenu {\n return inject(NgpMenuToken);\n}\n\n/**\n * Provide the Menu directive instance\n */\nexport function provideMenu(type: Type<NgpMenu>): ExistingProvider {\n return { provide: NgpMenuToken, useExisting: type };\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpSubmenuTrigger } from './submenu-trigger';\n\n/**\n * The state token for the SubmenuTrigger primitive.\n */\nexport const NgpSubmenuTriggerStateToken = createStateToken<NgpSubmenuTrigger>('SubmenuTrigger');\n\n/**\n * Provides the SubmenuTrigger state.\n */\nexport const provideSubmenuTriggerState = createStateProvider(NgpSubmenuTriggerStateToken);\n\n/**\n * Injects the SubmenuTrigger state.\n */\nexport const injectSubmenuTriggerState = createStateInjector<NgpSubmenuTrigger>(\n NgpSubmenuTriggerStateToken,\n);\n\n/**\n * The SubmenuTrigger state registration function.\n */\nexport const submenuTriggerState = createState(NgpSubmenuTriggerStateToken);\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n inject,\n Injector,\n input,\n numberAttribute,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { Placement } from '@floating-ui/dom';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { NgpMenuToken } from '../menu/menu-token';\nimport { provideSubmenuTriggerState, submenuTriggerState } from './submenu-trigger-state';\n\n@Directive({\n selector: '[ngpSubmenuTrigger]',\n exportAs: 'ngpSubmenuTrigger',\n providers: [provideSubmenuTriggerState({ inherit: false })],\n host: {\n 'aria-haspopup': 'true',\n '[attr.aria-expanded]': 'open() ? \"true\" : \"false\"',\n '[attr.data-open]': 'open() ? \"\" : null',\n '(click)': 'toggle($event)',\n },\n})\nexport class NgpSubmenuTrigger<T = unknown> {\n /**\n * Access the menu trigger element.\n */\n private readonly trigger = injectElementRef();\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /** Access the parent menu */\n private readonly parentMenu = inject(NgpMenuToken, { optional: true });\n\n /**\n * Access the submenu template ref.\n */\n readonly menu = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpSubmenuTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpSubmenuTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the menu relative to the trigger.\n * @default 'right-start'\n */\n readonly placement = input<Placement>('right-start', {\n alias: 'ngpSubmenuTriggerPlacement',\n });\n\n /**\n * Define the offset of the menu relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(0, {\n alias: 'ngpSubmenuTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the menu should flip when there is not enough space for the menu.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(true, {\n alias: 'ngpSubmenuTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * The overlay that manages the menu\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the menu.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Access the menu trigger state.\n */\n readonly state = submenuTriggerState<NgpSubmenuTrigger<T>>(this);\n\n constructor() {\n this.parentMenu?.closeSubmenus.pipe(safeTakeUntilDestroyed()).subscribe(element => {\n // if the element is not the trigger, we want to close the menu\n if (element === this.trigger.nativeElement) {\n return;\n }\n\n this.hide('mouse');\n });\n }\n\n protected toggle(event: MouseEvent): void {\n // if the trigger is disabled then do not toggle the menu\n if (this.state.disabled()) {\n return;\n }\n\n // determine the origin of the event, 0 is keyboard, 1 is mouse\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if the menu is open then hide it\n if (this.open()) {\n this.hide(origin);\n } else {\n this.show();\n }\n }\n\n /**\n * Show the menu.\n */\n show(): void {\n // If the trigger is disabled, don't show the menu\n if (this.state.disabled()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n this.overlay()?.show();\n }\n\n /**\n * @internal\n * Hide the menu.\n */\n hide(origin: FocusOrigin = 'program'): void {\n // If the trigger is disabled or the menu is not open, do nothing\n if (this.state.disabled() || !this.open()) {\n return;\n }\n\n // Hide the overlay\n this.overlay()?.hide({ origin });\n }\n\n /**\n * Create the overlay that will contain the menu\n */\n private createOverlay(): void {\n const menu = this.state.menu();\n\n if (!menu) {\n throw new Error('Menu must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: menu,\n triggerElement: this.trigger.nativeElement,\n injector: this.injector,\n placement: this.state.placement(),\n offset: this.state.offset(),\n flip: this.state.flip(),\n closeOnOutsideClick: true,\n closeOnEscape: true,\n restoreFocus: true,\n viewContainerRef: this.viewContainerRef,\n };\n\n this.overlay.set(createOverlay(config));\n }\n\n /**\n * If the user presses the right arrow key, we want to open the submenu\n * and focus the first item in the submenu.\n * This behavior will be inverted if the direction is RTL.\n * @param event\n */\n @HostListener('keydown.ArrowRight', ['$event'])\n @HostListener('keydown.ArrowLeft', ['$event'])\n protected showSubmenuOnArrow(event: KeyboardEvent): void {\n const direction = getComputedStyle(this.trigger.nativeElement).direction;\n\n const isRtl = direction === 'rtl';\n\n const isRightArrow = event.key === 'ArrowRight';\n const isLeftArrow = event.key === 'ArrowLeft';\n\n if ((isRightArrow && !isRtl) || (isLeftArrow && isRtl)) {\n event.preventDefault();\n this.show();\n }\n }\n\n /**\n * If the user hovers over the trigger, we want to open the submenu\n */\n @HostListener('pointerenter', ['$event'])\n protected showSubmenuOnHover(event: PointerEvent): void {\n // if this was triggered by a touch event, we don't want to show the submenu\n // as it will be shown by the click event - this prevents the submenu from being toggled\n if (event.pointerType === 'touch') {\n return;\n }\n\n this.show();\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, HostListener, inject, Injector, input } from '@angular/core';\nimport { injectElementRef, setupButton } from 'ng-primitives/internal';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectMenu } from '../menu/menu-token';\nimport { NgpSubmenuTrigger } from '../submenu-trigger/submenu-trigger';\n\n/**\n * The `NgpMenuItem` directive represents a menu item.\n */\n@Directive({\n selector: '[ngpMenuItem]',\n exportAs: 'ngpMenuItem',\n hostDirectives: [\n { directive: NgpRovingFocusItem, inputs: ['ngpRovingFocusItemDisabled: ngpMenuItemDisabled'] },\n ],\n host: {\n role: 'menuitem',\n '(click)': 'onClick($event)',\n '(keydown.ArrowLeft)': 'handleArrowKey($event)',\n '(keydown.ArrowRight)': 'handleArrowKey($event)',\n },\n})\nexport class NgpMenuItem {\n /** Access the injector */\n private readonly injector = inject(Injector);\n /** Access the button element */\n private readonly elementRef = injectElementRef();\n\n /** Access the parent menu */\n private readonly parentMenu = injectMenu();\n\n /** Whether the menu item is disabled */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpMenuItemDisabled',\n transform: booleanAttribute,\n });\n\n constructor() {\n setupButton({ disabled: this.disabled });\n }\n\n /** Close the menu when the item is clicked */\n protected onClick(event: MouseEvent): void {\n // we do this here to avoid circular dependency issues\n const trigger = this.injector.get(NgpSubmenuTrigger, null, { self: true, optional: true });\n\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if this is a submenu trigger, we don't want to close the menu, we want to open the submenu\n if (!trigger) {\n this.parentMenu?.closeAllMenus(origin);\n }\n }\n\n /**\n * If the user presses the left arrow key (in LTR) and there is a parent menu,\n * we want to close the menu and focus the parent menu item.\n */\n protected handleArrowKey(event: KeyboardEvent): void {\n // if there is no parent menu, we don't want to do anything\n const trigger = this.injector.get(NgpSubmenuTrigger, null, { optional: true });\n\n if (!trigger) {\n return;\n }\n\n const direction = getComputedStyle(this.elementRef.nativeElement).direction;\n const isRtl = direction === 'rtl';\n\n const isLeftArrow = event.key === 'ArrowLeft';\n const isRightArrow = event.key === 'ArrowRight';\n\n if ((isLeftArrow && !isRtl) || (isRightArrow && isRtl)) {\n event.preventDefault();\n\n if (trigger) {\n trigger.hide('keyboard');\n }\n }\n }\n\n /**\n * If the user hovers over the trigger, we want to open the submenu\n */\n @HostListener('mouseenter')\n protected showSubmenuOnHover(): void {\n this.parentMenu?.closeSubmenus.next(this.elementRef.nativeElement);\n }\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpMenuTrigger } from './menu-trigger';\n\n/**\n * The state token for the MenuTrigger primitive.\n */\nexport const NgpMenuTriggerStateToken = createStateToken<NgpMenuTrigger>('MenuTrigger');\n\n/**\n * Provides the MenuTrigger state.\n */\nexport const provideMenuTriggerState = createStateProvider(NgpMenuTriggerStateToken);\n\n/**\n * Injects the MenuTrigger state.\n */\nexport const injectMenuTriggerState = createStateInjector<NgpMenuTrigger>(NgpMenuTriggerStateToken);\n\n/**\n * The MenuTrigger state registration function.\n */\nexport const menuTriggerState = createState(NgpMenuTriggerStateToken);\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { Placement } from '@floating-ui/dom';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { injectMenuConfig } from '../config/menu-config';\nimport { menuTriggerState, provideMenuTriggerState } from './menu-trigger-state';\n\n/**\n * The `NgpMenuTrigger` directive allows you to turn an element into a menu trigger.\n */\n@Directive({\n selector: '[ngpMenuTrigger]',\n exportAs: 'ngpMenuTrigger',\n providers: [provideMenuTriggerState({ inherit: false })],\n host: {\n 'aria-haspopup': 'true',\n '[attr.aria-expanded]': 'open() ? \"true\" : \"false\"',\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-placement]': 'state.placement()',\n '(click)': 'toggle($event)',\n },\n})\nexport class NgpMenuTrigger<T = unknown> implements OnDestroy {\n /**\n * Access the trigger element\n */\n private readonly trigger = injectElementRef();\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the global menu configuration.\n */\n private readonly config = injectMenuConfig();\n\n /**\n * Access the menu template ref.\n */\n readonly menu = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpMenuTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpMenuTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the menu relative to the trigger.\n * @default 'bottom-start'\n */\n readonly placement = input<Placement>(this.config.placement, {\n alias: 'ngpMenuTriggerPlacement',\n });\n\n /**\n * Define the offset of the menu relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(this.config.offset, {\n alias: 'ngpMenuTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the menu should flip when there is not enough space for the menu.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpMenuTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the menu should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | null>(this.config.container, {\n alias: 'ngpMenuTriggerContainer',\n });\n\n /**\n * Defines how the menu behaves when the window is scrolled.\n * @default 'block'\n */\n readonly scrollBehavior = input<'reposition' | 'block'>(this.config.scrollBehavior, {\n alias: 'ngpMenuTriggerScrollBehavior',\n });\n\n /**\n * Provide context to the menu. This can be used to pass data to the menu content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpMenuTriggerContext',\n });\n\n /**\n * The overlay that manages the menu\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the menu.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * The menu trigger state.\n */\n readonly state = menuTriggerState<NgpMenuTrigger<T>>(this);\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n protected toggle(event: MouseEvent): void {\n // if the trigger is disabled then do not toggle the menu\n if (this.state.disabled()) {\n return;\n }\n\n // determine the origin of the event, 0 is keyboard, 1 is mouse\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if the menu is open then hide it\n if (this.open()) {\n this.hide(origin);\n } else {\n this.show();\n }\n }\n\n /**\n * Show the menu.\n */\n show(): void {\n // If the trigger is disabled, don't show the menu\n if (this.state.disabled()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n this.overlay()?.show();\n }\n\n /**\n * @internal\n * Hide the menu.\n */\n hide(origin: FocusOrigin = 'program'): void {\n // If the trigger is disabled or the menu is not open, do nothing\n if (this.state.disabled() || !this.open()) {\n return;\n }\n\n // Hide the overlay\n this.overlay()?.hide({ origin });\n }\n\n /**\n * Create the overlay that will contain the menu\n */\n private createOverlay(): void {\n const menu = this.state.menu();\n\n if (!menu) {\n throw new Error('Menu must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: menu,\n triggerElement: this.trigger.nativeElement,\n viewContainerRef: this.viewContainerRef,\n injector: this.injector,\n context: this.state.context,\n container: this.state.container(),\n placement: this.state.placement(),\n offset: this.state.offset(),\n flip: this.state.flip(),\n closeOnOutsideClick: true,\n closeOnEscape: true,\n restoreFocus: true,\n scrollBehaviour: this.state.scrollBehavior(),\n };\n\n this.overlay.set(createOverlay(config));\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { Directive, inject } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { injectOverlay } from 'ng-primitives/portal';\nimport { NgpRovingFocusGroup, provideRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { Subject } from 'rxjs';\nimport { injectMenuTriggerState } from '../menu-trigger/menu-trigger-state';\nimport { NgpMenuToken, provideMenu } from './menu-token';\n\n/**\n * The `NgpMenu` is a container for menu items.\n */\n@Directive({\n selector: '[ngpMenu]',\n exportAs: 'ngpMenu',\n hostDirectives: [NgpRovingFocusGroup, NgpFocusTrap],\n providers: [\n // ensure we don't inherit the focus group from the parent menu if there is one\n provideRovingFocusGroup(NgpRovingFocusGroup, { inherit: false }),\n provideMenu(NgpMenu),\n ],\n host: {\n role: 'menu',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-menu-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-menu-transform-origin]': 'overlay.transformOrigin()',\n },\n})\nexport class NgpMenu {\n /** Access the overlay. */\n protected readonly overlay = injectOverlay();\n\n /** Access the menu trigger state */\n private readonly menuTrigger = injectMenuTriggerState();\n\n /** Access any parent menus */\n private readonly parentMenu = inject(NgpMenuToken, { optional: true, skipSelf: true });\n\n /** @internal Whether we should close submenus */\n readonly closeSubmenus = new Subject<HTMLElement>();\n\n /** @internal Close the menu and any parent menus */\n closeAllMenus(origin: FocusOrigin): void {\n this.menuTrigger().hide(origin);\n this.parentMenu?.closeAllMenus(origin);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAmCO,MAAM,iBAAiB,GAAkB;AAC9C,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,cAAc;AACzB,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,cAAc,EAAE,OAAO;CACxB;AAEM,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAgB,oBAAoB,CAAC;AAEzF;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,MAA8B,EAAA;IAC9D,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,kBAAkB;AAC3B,YAAA,QAAQ,EAAE,EAAE,GAAG,iBAAiB,EAAE,GAAG,MAAM,EAAE;AAC9C,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,iBAAiB;AAC5E;;MC9Da,YA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qCAAqC,EAAE,2BAA2B;AACnE,qBAAA;AACF,iBAAA;;;AC5BD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-primitives-menu.mjs","sources":["../../../../packages/ng-primitives/menu/src/config/menu-config.ts","../../../../packages/ng-primitives/menu/src/menu/menu-token.ts","../../../../packages/ng-primitives/menu/src/submenu-trigger/submenu-trigger-state.ts","../../../../packages/ng-primitives/menu/src/submenu-trigger/submenu-trigger.ts","../../../../packages/ng-primitives/menu/src/menu-item/menu-item.ts","../../../../packages/ng-primitives/menu/src/menu-trigger/menu-trigger-state.ts","../../../../packages/ng-primitives/menu/src/menu-trigger/menu-trigger.ts","../../../../packages/ng-primitives/menu/src/menu/menu.ts","../../../../packages/ng-primitives/menu/src/ng-primitives-menu.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { Placement } from '@floating-ui/dom';\n\nexport interface NgpMenuConfig {\n /**\n * Define the offset of the menu relative to the trigger.\n * @default 4\n */\n offset: number;\n\n /**\n * Define the placement of the menu relative to the trigger.\n * @default 'bottom-start'\n */\n placement: Placement;\n\n /**\n * Define whether the menu should flip when there is not enough space for the menu.\n * @default true\n */\n flip: boolean;\n\n /**\n * Define the container in to which the menu should be attached.\n * @default document.body\n */\n container: HTMLElement | null;\n\n /**\n * Defines how the menu behaves when the window is scrolled.\n * @default scroll\n */\n scrollBehavior: 'reposition' | 'block';\n}\n\nexport const defaultMenuConfig: NgpMenuConfig = {\n offset: 4,\n placement: 'bottom-start',\n flip: true,\n container: null,\n scrollBehavior: 'block',\n};\n\nexport const NgpMenuConfigToken = new InjectionToken<NgpMenuConfig>('NgpMenuConfigToken');\n\n/**\n * Provide the default Menu configuration\n * @param config The Menu configuration\n * @returns The provider\n */\nexport function provideMenuConfig(config: Partial<NgpMenuConfig>): Provider[] {\n return [\n {\n provide: NgpMenuConfigToken,\n useValue: { ...defaultMenuConfig, ...config },\n },\n ];\n}\n\n/**\n * Inject the Menu configuration\n * @returns The global Menu configuration\n */\nexport function injectMenuConfig(): NgpMenuConfig {\n return inject(NgpMenuConfigToken, { optional: true }) ?? defaultMenuConfig;\n}\n","import { ExistingProvider, inject, InjectionToken, Type } from '@angular/core';\nimport type { NgpMenu } from './menu';\n\nexport const NgpMenuToken = new InjectionToken<NgpMenu>('NgpMenuToken');\n\n/**\n * Inject the Menu directive instance\n */\nexport function injectMenu(): NgpMenu {\n return inject(NgpMenuToken);\n}\n\n/**\n * Provide the Menu directive instance\n */\nexport function provideMenu(type: Type<NgpMenu>): ExistingProvider {\n return { provide: NgpMenuToken, useExisting: type };\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpSubmenuTrigger } from './submenu-trigger';\n\n/**\n * The state token for the SubmenuTrigger primitive.\n */\nexport const NgpSubmenuTriggerStateToken = createStateToken<NgpSubmenuTrigger>('SubmenuTrigger');\n\n/**\n * Provides the SubmenuTrigger state.\n */\nexport const provideSubmenuTriggerState = createStateProvider(NgpSubmenuTriggerStateToken);\n\n/**\n * Injects the SubmenuTrigger state.\n */\nexport const injectSubmenuTriggerState = createStateInjector<NgpSubmenuTrigger>(\n NgpSubmenuTriggerStateToken,\n);\n\n/**\n * The SubmenuTrigger state registration function.\n */\nexport const submenuTriggerState = createState(NgpSubmenuTriggerStateToken);\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n HostListener,\n inject,\n Injector,\n input,\n numberAttribute,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { Placement } from '@floating-ui/dom';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { safeTakeUntilDestroyed } from 'ng-primitives/utils';\nimport { NgpMenuToken } from '../menu/menu-token';\nimport { provideSubmenuTriggerState, submenuTriggerState } from './submenu-trigger-state';\n\n@Directive({\n selector: '[ngpSubmenuTrigger]',\n exportAs: 'ngpSubmenuTrigger',\n providers: [provideSubmenuTriggerState({ inherit: false })],\n host: {\n 'aria-haspopup': 'true',\n '[attr.aria-expanded]': 'open() ? \"true\" : \"false\"',\n '[attr.data-open]': 'open() ? \"\" : null',\n '(click)': 'toggle($event)',\n },\n})\nexport class NgpSubmenuTrigger<T = unknown> {\n /**\n * Access the menu trigger element.\n */\n private readonly trigger = injectElementRef();\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /** Access the parent menu */\n private readonly parentMenu = inject(NgpMenuToken, { optional: true });\n\n /**\n * Access the submenu template ref.\n */\n readonly menu = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpSubmenuTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpSubmenuTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the menu relative to the trigger.\n * @default 'right-start'\n */\n readonly placement = input<Placement>('right-start', {\n alias: 'ngpSubmenuTriggerPlacement',\n });\n\n /**\n * Define the offset of the menu relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(0, {\n alias: 'ngpSubmenuTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the menu should flip when there is not enough space for the menu.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(true, {\n alias: 'ngpSubmenuTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * The overlay that manages the menu\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the menu.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * Access the menu trigger state.\n */\n readonly state = submenuTriggerState<NgpSubmenuTrigger<T>>(this);\n\n constructor() {\n this.parentMenu?.closeSubmenus.pipe(safeTakeUntilDestroyed()).subscribe(element => {\n // if the element is not the trigger, we want to close the menu\n if (element === this.trigger.nativeElement) {\n return;\n }\n\n this.hide('mouse');\n });\n }\n\n protected toggle(event: MouseEvent): void {\n // if the trigger is disabled then do not toggle the menu\n if (this.state.disabled()) {\n return;\n }\n\n // determine the origin of the event, 0 is keyboard, 1 is mouse\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if the menu is open then hide it\n if (this.open()) {\n this.hide(origin);\n } else {\n this.show();\n }\n }\n\n /**\n * Show the menu.\n */\n show(): void {\n // If the trigger is disabled, don't show the menu\n if (this.state.disabled()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n this.overlay()?.show();\n }\n\n /**\n * @internal\n * Hide the menu.\n */\n hide(origin: FocusOrigin = 'program'): void {\n // If the trigger is disabled or the menu is not open, do nothing\n if (this.state.disabled() || !this.open()) {\n return;\n }\n\n // Hide the overlay\n this.overlay()?.hide({ origin });\n }\n\n /**\n * Create the overlay that will contain the menu\n */\n private createOverlay(): void {\n const menu = this.state.menu();\n\n if (!menu) {\n throw new Error('Menu must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: menu,\n triggerElement: this.trigger.nativeElement,\n injector: this.injector,\n placement: this.state.placement(),\n offset: this.state.offset(),\n flip: this.state.flip(),\n closeOnOutsideClick: true,\n closeOnEscape: true,\n restoreFocus: true,\n viewContainerRef: this.viewContainerRef,\n };\n\n this.overlay.set(createOverlay(config));\n }\n\n /**\n * If the user presses the right arrow key, we want to open the submenu\n * and focus the first item in the submenu.\n * This behavior will be inverted if the direction is RTL.\n * @param event\n */\n @HostListener('keydown.ArrowRight', ['$event'])\n @HostListener('keydown.ArrowLeft', ['$event'])\n protected showSubmenuOnArrow(event: KeyboardEvent): void {\n const direction = getComputedStyle(this.trigger.nativeElement).direction;\n\n const isRtl = direction === 'rtl';\n\n const isRightArrow = event.key === 'ArrowRight';\n const isLeftArrow = event.key === 'ArrowLeft';\n\n if ((isRightArrow && !isRtl) || (isLeftArrow && isRtl)) {\n event.preventDefault();\n this.show();\n }\n }\n\n /**\n * If the user hovers over the trigger, we want to open the submenu\n */\n @HostListener('pointerenter', ['$event'])\n protected showSubmenuOnHover(event: PointerEvent): void {\n // if this was triggered by a touch event, we don't want to show the submenu\n // as it will be shown by the click event - this prevents the submenu from being toggled\n if (event.pointerType === 'touch') {\n return;\n }\n\n this.show();\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, HostListener, inject, Injector, input } from '@angular/core';\nimport { injectElementRef, setupButton } from 'ng-primitives/internal';\nimport { NgpRovingFocusItem } from 'ng-primitives/roving-focus';\nimport { injectMenu } from '../menu/menu-token';\nimport { NgpSubmenuTrigger } from '../submenu-trigger/submenu-trigger';\n\n/**\n * The `NgpMenuItem` directive represents a menu item.\n */\n@Directive({\n selector: '[ngpMenuItem]',\n exportAs: 'ngpMenuItem',\n hostDirectives: [\n { directive: NgpRovingFocusItem, inputs: ['ngpRovingFocusItemDisabled: ngpMenuItemDisabled'] },\n ],\n host: {\n role: 'menuitem',\n '(click)': 'onClick($event)',\n '(keydown.ArrowLeft)': 'handleArrowKey($event)',\n '(keydown.ArrowRight)': 'handleArrowKey($event)',\n },\n})\nexport class NgpMenuItem {\n /** Access the injector */\n private readonly injector = inject(Injector);\n /** Access the button element */\n private readonly elementRef = injectElementRef();\n\n /** Access the parent menu */\n private readonly parentMenu = injectMenu();\n\n /** Whether the menu item is disabled */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpMenuItemDisabled',\n transform: booleanAttribute,\n });\n\n constructor() {\n setupButton({ disabled: this.disabled });\n }\n\n /** Close the menu when the item is clicked */\n protected onClick(event: MouseEvent): void {\n // we do this here to avoid circular dependency issues\n const trigger = this.injector.get(NgpSubmenuTrigger, null, { self: true, optional: true });\n\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if this is a submenu trigger, we don't want to close the menu, we want to open the submenu\n if (!trigger) {\n this.parentMenu?.closeAllMenus(origin);\n }\n }\n\n /**\n * If the user presses the left arrow key (in LTR) and there is a parent menu,\n * we want to close the menu and focus the parent menu item.\n */\n protected handleArrowKey(event: KeyboardEvent): void {\n // if there is no parent menu, we don't want to do anything\n const trigger = this.injector.get(NgpSubmenuTrigger, null, { optional: true });\n\n if (!trigger) {\n return;\n }\n\n const direction = getComputedStyle(this.elementRef.nativeElement).direction;\n const isRtl = direction === 'rtl';\n\n const isLeftArrow = event.key === 'ArrowLeft';\n const isRightArrow = event.key === 'ArrowRight';\n\n if ((isLeftArrow && !isRtl) || (isRightArrow && isRtl)) {\n event.preventDefault();\n\n if (trigger) {\n trigger.hide('keyboard');\n }\n }\n }\n\n /**\n * If the user hovers over the trigger, we want to open the submenu\n */\n @HostListener('mouseenter')\n protected showSubmenuOnHover(): void {\n this.parentMenu?.closeSubmenus.next(this.elementRef.nativeElement);\n }\n}\n","import {\n createState,\n createStateInjector,\n createStateProvider,\n createStateToken,\n} from 'ng-primitives/state';\nimport type { NgpMenuTrigger } from './menu-trigger';\n\n/**\n * The state token for the MenuTrigger primitive.\n */\nexport const NgpMenuTriggerStateToken = createStateToken<NgpMenuTrigger>('MenuTrigger');\n\n/**\n * Provides the MenuTrigger state.\n */\nexport const provideMenuTriggerState = createStateProvider(NgpMenuTriggerStateToken);\n\n/**\n * Injects the MenuTrigger state.\n */\nexport const injectMenuTriggerState = createStateInjector<NgpMenuTrigger>(NgpMenuTriggerStateToken);\n\n/**\n * The MenuTrigger state registration function.\n */\nexport const menuTriggerState = createState(NgpMenuTriggerStateToken);\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n Injector,\n input,\n numberAttribute,\n OnDestroy,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport { Placement } from '@floating-ui/dom';\nimport { injectElementRef } from 'ng-primitives/internal';\nimport {\n createOverlay,\n NgpOverlay,\n NgpOverlayConfig,\n NgpOverlayContent,\n} from 'ng-primitives/portal';\nimport { injectMenuConfig } from '../config/menu-config';\nimport { menuTriggerState, provideMenuTriggerState } from './menu-trigger-state';\n\n/**\n * The `NgpMenuTrigger` directive allows you to turn an element into a menu trigger.\n */\n@Directive({\n selector: '[ngpMenuTrigger]',\n exportAs: 'ngpMenuTrigger',\n providers: [provideMenuTriggerState({ inherit: false })],\n host: {\n 'aria-haspopup': 'true',\n '[attr.aria-expanded]': 'open() ? \"true\" : \"false\"',\n '[attr.data-open]': 'open() ? \"\" : null',\n '[attr.data-placement]': 'state.placement()',\n '(click)': 'toggle($event)',\n },\n})\nexport class NgpMenuTrigger<T = unknown> implements OnDestroy {\n /**\n * Access the trigger element\n */\n private readonly trigger = injectElementRef();\n\n /**\n * Access the injector.\n */\n private readonly injector = inject(Injector);\n\n /**\n * Access the view container reference.\n */\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Access the global menu configuration.\n */\n private readonly config = injectMenuConfig();\n\n /**\n * Access the menu template ref.\n */\n readonly menu = input<NgpOverlayContent<T>>(undefined, {\n alias: 'ngpMenuTrigger',\n });\n\n /**\n * Define if the trigger should be disabled.\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpMenuTriggerDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Define the placement of the menu relative to the trigger.\n * @default 'bottom-start'\n */\n readonly placement = input<Placement>(this.config.placement, {\n alias: 'ngpMenuTriggerPlacement',\n });\n\n /**\n * Define the offset of the menu relative to the trigger.\n * @default 0\n */\n readonly offset = input<number, NumberInput>(this.config.offset, {\n alias: 'ngpMenuTriggerOffset',\n transform: numberAttribute,\n });\n\n /**\n * Define whether the menu should flip when there is not enough space for the menu.\n * @default true\n */\n readonly flip = input<boolean, BooleanInput>(this.config.flip, {\n alias: 'ngpMenuTriggerFlip',\n transform: booleanAttribute,\n });\n\n /**\n * Define the container in which the menu should be attached.\n * @default document.body\n */\n readonly container = input<HTMLElement | null>(this.config.container, {\n alias: 'ngpMenuTriggerContainer',\n });\n\n /**\n * Defines how the menu behaves when the window is scrolled.\n * @default 'block'\n */\n readonly scrollBehavior = input<'reposition' | 'block'>(this.config.scrollBehavior, {\n alias: 'ngpMenuTriggerScrollBehavior',\n });\n\n /**\n * Provide context to the menu. This can be used to pass data to the menu content.\n */\n readonly context = input<T>(undefined, {\n alias: 'ngpMenuTriggerContext',\n });\n\n /**\n * The overlay that manages the menu\n * @internal\n */\n readonly overlay = signal<NgpOverlay<T> | null>(null);\n\n /**\n * The open state of the menu.\n * @internal\n */\n readonly open = computed(() => this.overlay()?.isOpen() ?? false);\n\n /**\n * The menu trigger state.\n */\n readonly state = menuTriggerState<NgpMenuTrigger<T>>(this);\n\n ngOnDestroy(): void {\n this.overlay()?.destroy();\n }\n\n protected toggle(event: MouseEvent): void {\n // if the trigger is disabled then do not toggle the menu\n if (this.state.disabled()) {\n return;\n }\n\n // determine the origin of the event, 0 is keyboard, 1 is mouse\n const origin: FocusOrigin = event.detail === 0 ? 'keyboard' : 'mouse';\n\n // if the menu is open then hide it\n if (this.open()) {\n this.hide(origin);\n } else {\n this.show();\n }\n }\n\n /**\n * Show the menu.\n */\n show(): void {\n // If the trigger is disabled, don't show the menu\n if (this.state.disabled()) {\n return;\n }\n\n // Create the overlay if it doesn't exist yet\n if (!this.overlay()) {\n this.createOverlay();\n }\n\n // Show the overlay\n this.overlay()?.show();\n }\n\n /**\n * @internal\n * Hide the menu.\n */\n hide(origin: FocusOrigin = 'program'): void {\n // If the trigger is disabled or the menu is not open, do nothing\n if (this.state.disabled() || !this.open()) {\n return;\n }\n\n // Hide the overlay\n this.overlay()?.hide({ origin });\n }\n\n /**\n * Create the overlay that will contain the menu\n */\n private createOverlay(): void {\n const menu = this.state.menu();\n\n if (!menu) {\n throw new Error('Menu must be either a TemplateRef or a ComponentType');\n }\n\n // Create config for the overlay\n const config: NgpOverlayConfig<T> = {\n content: menu,\n triggerElement: this.trigger.nativeElement,\n viewContainerRef: this.viewContainerRef,\n injector: this.injector,\n context: this.state.context,\n container: this.state.container(),\n placement: this.state.placement(),\n offset: this.state.offset(),\n flip: this.state.flip(),\n closeOnOutsideClick: true,\n closeOnEscape: true,\n restoreFocus: true,\n scrollBehaviour: this.state.scrollBehavior(),\n };\n\n this.overlay.set(createOverlay(config));\n }\n}\n","import { FocusOrigin } from '@angular/cdk/a11y';\nimport { Directive, inject } from '@angular/core';\nimport { NgpFocusTrap } from 'ng-primitives/focus-trap';\nimport { injectOverlay } from 'ng-primitives/portal';\nimport { NgpRovingFocusGroup, provideRovingFocusGroup } from 'ng-primitives/roving-focus';\nimport { Subject } from 'rxjs';\nimport { injectMenuTriggerState } from '../menu-trigger/menu-trigger-state';\nimport { NgpMenuToken, provideMenu } from './menu-token';\n\n/**\n * The `NgpMenu` is a container for menu items.\n */\n@Directive({\n selector: '[ngpMenu]',\n exportAs: 'ngpMenu',\n hostDirectives: [NgpRovingFocusGroup, NgpFocusTrap],\n providers: [\n // ensure we don't inherit the focus group from the parent menu if there is one\n provideRovingFocusGroup(NgpRovingFocusGroup, { inherit: false }),\n provideMenu(NgpMenu),\n ],\n host: {\n role: 'menu',\n '[style.left.px]': 'overlay.position().x',\n '[style.top.px]': 'overlay.position().y',\n '[style.--ngp-menu-trigger-width.px]': 'overlay.triggerWidth()',\n '[style.--ngp-menu-transform-origin]': 'overlay.transformOrigin()',\n '[attr.data-placement]': 'overlay.finalPlacement()',\n },\n})\nexport class NgpMenu {\n /** Access the overlay. */\n protected readonly overlay = injectOverlay();\n\n /** Access the menu trigger state */\n private readonly menuTrigger = injectMenuTriggerState();\n\n /** Access any parent menus */\n private readonly parentMenu = inject(NgpMenuToken, { optional: true, skipSelf: true });\n\n /** @internal Whether we should close submenus */\n readonly closeSubmenus = new Subject<HTMLElement>();\n\n /** @internal Close the menu and any parent menus */\n closeAllMenus(origin: FocusOrigin): void {\n this.menuTrigger().hide(origin);\n this.parentMenu?.closeAllMenus(origin);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAmCO,MAAM,iBAAiB,GAAkB;AAC9C,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,SAAS,EAAE,cAAc;AACzB,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,cAAc,EAAE,OAAO;CACxB;AAEM,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAgB,oBAAoB,CAAC;AAEzF;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,MAA8B,EAAA;IAC9D,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,kBAAkB;AAC3B,YAAA,QAAQ,EAAE,EAAE,GAAG,iBAAiB,EAAE,GAAG,MAAM,EAAE;AAC9C,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,iBAAiB;AAC5E;;MC9Da,YAAY,GAAG,IAAI,cAAc,CAAU,cAAc;AAEtE;;AAEG;SACa,UAAU,GAAA;AACxB,IAAA,OAAO,MAAM,CAAC,YAAY,CAAC;AAC7B;AAEA;;AAEG;AACG,SAAU,WAAW,CAAC,IAAmB,EAAA;IAC7C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,IAAI,EAAE;AACrD;;ACTA;;AAEG;AACI,MAAM,2BAA2B,GAAG,gBAAgB,CAAoB,gBAAgB,CAAC;AAEhG;;AAEG;MACU,0BAA0B,GAAG,mBAAmB,CAAC,2BAA2B;AAEzF;;AAEG;MACU,yBAAyB,GAAG,mBAAmB,CAC1D,2BAA2B;AA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AAuB,CAAC,mBAAmB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;YAChE,WAAW,CAAC,OAAO,CAAC;AACrB,SAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,mBAAA,EAAA,EAAA,EAAA,SAAA,EAAA,EAAA,CAAA,YAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAUU,OAAO,EAAA,UAAA,EAAA,CAAA;kBAlBnB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,QAAQ,EAAE,SAAS;AACnB,oBAAA,cAAc,EAAE,CAAC,mBAAmB,EAAE,YAAY,CAAC;AACnD,oBAAA,SAAS,EAAE;;wBAET,uBAAuB,CAAC,mBAAmB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAChE,wBAAA,WAAW,CAAA,OAAA,CAAS;AACrB,qBAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,MAAM;AACZ,wBAAA,iBAAiB,EAAE,sBAAsB;AACzC,wBAAA,gBAAgB,EAAE,sBAAsB;AACxC,wBAAA,qCAAqC,EAAE,wBAAwB;AAC/D,wBAAA,qCAAqC,EAAE,2BAA2B;AAClE,wBAAA,uBAAuB,EAAE,0BAA0B;AACpD,qBAAA;AACF,iBAAA;;;AC7BD;;AAEG;;;;"}
@@ -16,6 +16,18 @@ export declare class NgpFormControl {
16
16
  * Whether the form control is disabled by a parent.
17
17
  */
18
18
  readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
19
+ /**
20
+ * The status of the form control.
21
+ */
22
+ readonly status: Signal<NgpControlStatus>;
23
+ /**
24
+ * The element reference.
25
+ */
26
+ private readonly elementRef;
27
+ /**
28
+ * Whether the element supports the disabled attribute.
29
+ */
30
+ protected readonly supportsDisabledAttribute: boolean;
19
31
  /**
20
32
  * The state of the form control.
21
33
  */
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ng-primitives",
3
3
  "description": "Angular Primitives is a low-level headless UI component library with a focus on accessibility, customization, and developer experience. ",
4
4
  "license": "Apache-2.0",
5
- "version": "0.65.0",
5
+ "version": "0.67.0",
6
6
  "keywords": [
7
7
  "angular",
8
8
  "primitives",
@@ -34,6 +34,7 @@ import { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';
34
34
  [ngpListboxMode]="mode()"
35
35
  [ngpListboxDisabled]="disabled()"
36
36
  [ngpListboxCompareWith]="compareWith()"
37
+ (ngpListboxValueChange)="onListboxValueChange($event)"
37
38
  ngpPopover
38
39
  ngpListbox
39
40
  >
@@ -139,4 +140,9 @@ export class Listbox<%= componentSuffix %> implements ControlValueAccessor {
139
140
  setDisabledState(isDisabled: boolean): void {
140
141
  this.state()?.disabled.set(isDisabled);
141
142
  }
143
+
144
+ onListboxValueChange(value: string[]): void {
145
+ this.value.set(value);
146
+ if (this.onChange) this.onChange(value);
147
+ }
142
148
  }