ng-primitives 0.41.0 → 0.43.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.
- package/checkbox/checkbox/checkbox.d.ts +1 -2
- package/dialog/dialog-trigger/dialog-trigger.d.ts +0 -4
- package/fesm2022/ng-primitives-a11y.mjs +3 -3
- package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
- package/fesm2022/ng-primitives-accordion.mjs +12 -12
- package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/ng-primitives-autofill.mjs +3 -3
- package/fesm2022/ng-primitives-autofill.mjs.map +1 -1
- package/fesm2022/ng-primitives-avatar.mjs +9 -9
- package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/ng-primitives-button.mjs +3 -3
- package/fesm2022/ng-primitives-button.mjs.map +1 -1
- package/fesm2022/ng-primitives-checkbox.mjs +5 -7
- package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-common.mjs +3 -3
- package/fesm2022/ng-primitives-common.mjs.map +1 -1
- package/fesm2022/ng-primitives-date-picker.mjs +27 -27
- package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
- package/fesm2022/ng-primitives-dialog.mjs +19 -23
- package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/ng-primitives-file-upload.mjs +6 -6
- package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
- package/fesm2022/ng-primitives-focus-trap.mjs +3 -3
- package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
- package/fesm2022/ng-primitives-form-field.mjs +77 -54
- package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
- package/fesm2022/ng-primitives-input.mjs +7 -8
- package/fesm2022/ng-primitives-input.mjs.map +1 -1
- package/fesm2022/ng-primitives-interactions.mjs +15 -15
- package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
- package/fesm2022/ng-primitives-internal.mjs +12 -12
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/fesm2022/ng-primitives-listbox.mjs +12 -12
- package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +12 -12
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-meter.mjs +15 -15
- package/fesm2022/ng-primitives-meter.mjs.map +1 -1
- package/fesm2022/ng-primitives-pagination.mjs +18 -18
- package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +6 -6
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-progress.mjs +15 -15
- package/fesm2022/ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/ng-primitives-radio.mjs +12 -14
- package/fesm2022/ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/ng-primitives-resize.mjs +10 -3
- package/fesm2022/ng-primitives-resize.mjs.map +1 -1
- package/fesm2022/ng-primitives-roving-focus.mjs +6 -6
- package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/ng-primitives-search.mjs +6 -6
- package/fesm2022/ng-primitives-search.mjs.map +1 -1
- package/fesm2022/ng-primitives-select.mjs +5 -7
- package/fesm2022/ng-primitives-select.mjs.map +1 -1
- package/fesm2022/ng-primitives-separator.mjs +3 -3
- package/fesm2022/ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/ng-primitives-slider.mjs +14 -16
- package/fesm2022/ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/ng-primitives-switch.mjs +6 -6
- package/fesm2022/ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/ng-primitives-tabs.mjs +14 -13
- package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/ng-primitives-textarea.mjs +5 -7
- package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
- package/fesm2022/ng-primitives-toast.mjs +3 -3
- package/fesm2022/ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/ng-primitives-toggle-group.mjs +6 -6
- package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/ng-primitives-toggle.mjs +3 -3
- package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/ng-primitives-toolbar.mjs +3 -3
- package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +6 -6
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/focus-trap/focus-trap/focus-trap-state.d.ts +2 -2
- package/form-field/form-control/form-control-state.d.ts +1 -38
- package/form-field/form-control/form-control.d.ts +7 -36
- package/form-field/index.d.ts +2 -2
- package/input/input/input.d.ts +2 -3
- package/listbox/listbox/listbox-state.d.ts +2 -2
- package/meter/meter/meter-state.d.ts +3 -3
- package/meter/meter-indicator/meter-indicator.d.ts +3 -3
- package/meter/meter-label/meter-label.d.ts +3 -3
- package/package.json +5 -5
- package/pagination/pagination/pagination-state.d.ts +2 -2
- package/pagination/pagination-first/pagination-first.d.ts +2 -2
- package/pagination/pagination-next/pagination-next.d.ts +2 -2
- package/pagination/pagination-previous/pagination-previous.d.ts +2 -2
- package/progress/progress/progress-state.d.ts +3 -3
- package/progress/progress-indicator/progress-indicator.d.ts +3 -3
- package/progress/progress-label/progress-label.d.ts +3 -3
- package/progress/progress-track/progress-track.d.ts +3 -3
- package/progress/progress-value/progress-value.d.ts +3 -3
- package/radio/radio-group/radio-group.d.ts +1 -2
- package/roving-focus/roving-focus-group/roving-focus-group-state.d.ts +6 -6
- package/schematics/ng-generate/schema.d.ts +2 -1
- package/schematics/ng-generate/schema.json +1 -0
- package/schematics/ng-generate/templates/popover/popover-trigger.__fileSuffix@dasherize__.ts.template +39 -0
- package/schematics/ng-generate/templates/popover/popover.__fileSuffix@dasherize__.ts.template +59 -0
- package/select/select/select.d.ts +1 -2
- package/slider/slider/slider-state.d.ts +4 -4
- package/slider/slider/slider.d.ts +1 -2
- package/slider/slider-range/slider-range.d.ts +4 -4
- package/slider/slider-thumb/slider-thumb.d.ts +4 -4
- package/slider/slider-track/slider-track.d.ts +4 -4
- package/tabs/tab-button/tab-button.d.ts +9 -12
- package/tabs/tab-list/tab-list.d.ts +6 -6
- package/tabs/tab-panel/tab-panel.d.ts +6 -6
- package/tabs/tabset/tabset-state.d.ts +6 -6
- package/textarea/textarea/textarea.d.ts +1 -2
- package/toggle-group/toggle-group/toggle-group-state.d.ts +6 -6
- package/toolbar/toolbar/toolbar-state.d.ts +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-interactions.mjs","sources":["../../../../packages/ng-primitives/interactions/src/focus-visible/focus-visible.ts","../../../../packages/ng-primitives/interactions/src/focus/focus.ts","../../../../packages/ng-primitives/interactions/src/hover/hover.ts","../../../../packages/ng-primitives/interactions/src/move/move.ts","../../../../packages/ng-primitives/interactions/src/press/press.ts","../../../../packages/ng-primitives/interactions/src/ng-primitives-interactions.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { setupFocusVisible } from 'ng-primitives/internal';\n\n/**\n * Apply the `ngpFocusVisible` directive to an element that should be visually focused. This is similar to `ngpFocus`\n * but it will only apply the focus visible styles when the element is focused via keyboard navigation.\n */\n@Directive({\n selector: '[ngpFocusVisible]',\n exportAs: 'ngpFocusVisible',\n})\nexport class NgpFocusVisible {\n /**\n * Whether focus events are listened to.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFocusVisibleDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the element is visually focused.\n */\n readonly focusChange = output<boolean>({\n alias: 'ngpFocusVisible',\n });\n\n constructor() {\n // setup the focus visible listener\n setupFocusVisible({\n disabled: this.disabled,\n focusChange: value => this.focusChange.emit(value),\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { setupFocus } from 'ng-primitives/internal';\n\n/**\n * This was inspired by the React Aria useFocus hook.\n * https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useFocus.ts#L20\n */\n@Directive({\n selector: '[ngpFocus]',\n exportAs: 'ngpFocus',\n})\nexport class NgpFocus {\n /**\n * Whether listening for focus events is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFocusDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the focus state changes.\n */\n readonly focus = output<boolean>({ alias: 'ngpFocus' });\n\n constructor() {\n // setup the focus listener\n setupFocus({\n disabled: this.disabled,\n focus: () => this.focus.emit(true),\n blur: () => this.focus.emit(false),\n });\n }\n}\n","import type { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { setupHover } from 'ng-primitives/internal';\n\n// This is an Angular port of the useHover hook from react-aria: https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useHover.ts\n\n/**\n * Apply the `ngpHover` directive to an element that you want to listen for hover events. T\n * his is particulaly useful for supporting hover events on touch devices, where hover events are not handled consistently.\n * On iOS relying on the `:hover` pseudo-class can result in the hover state being stuck until the user taps elsewhere on the screen.\n */\n@Directive({\n selector: '[ngpHover]',\n exportAs: 'ngpHover',\n})\nexport class NgpHover {\n /**\n * Whether hoving should be disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpHoverDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit an event when hovering starts.\n */\n readonly hoverStart = output<void>({ alias: 'ngpHoverStart' });\n\n /**\n * Emit an event when hovering ends.\n */\n readonly hoverEnd = output<void>({ alias: 'ngpHoverEnd' });\n\n /**\n * Emit an event when the hover state changes.\n */\n readonly hoverChange = output<boolean>({ alias: 'ngpHover' });\n\n /**\n * Setup the hover state.\n */\n constructor() {\n // setup the hover listener\n setupHover({\n hoverStart: () => {\n this.hoverStart.emit();\n this.hoverChange.emit(true);\n },\n hoverEnd: () => {\n this.hoverEnd.emit();\n this.hoverChange.emit(false);\n },\n disabled: this.disabled,\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, HostListener, input, output, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\n// Inspired by react-aria useMove hook: https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useMove.ts\n\n/**\n * The `NgpMove` directive is used to enable the pointer and keyboard move interactions on an element.\n */\n@Directive({\n selector: '[ngpMove]',\n exportAs: 'ngpMove',\n host: {\n '[attr.data-move]': 'isMoving() ? \"\" : null',\n },\n})\nexport class NgpMove {\n /**\n * Access the disposable helper.\n */\n private readonly disposables = injectDisposables();\n\n /**\n * Whether movement is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpMoveDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the move event begins.\n */\n readonly start = output<NgpMoveStartEvent>({\n alias: 'ngpMoveStart',\n });\n\n /**\n * Emit when the element is moved.\n */\n readonly move = output<NgpMoveEvent>({\n alias: 'ngpMove',\n });\n\n /**\n * Emit when the move event ends.\n */\n readonly end = output<NgpMoveEndEvent>({\n alias: 'ngpMoveEnd',\n });\n\n /**\n * Whether the element is currently being moved.\n */\n private isMoving = signal<boolean>(false);\n\n /**\n * Store the last x position of the element.\n */\n private x: number | null = null;\n\n /**\n * Store the last y position of the element.\n */\n private y: number | null = null;\n\n /**\n * Store the id of the last pointer.\n */\n private pointerId: number | null = null;\n\n /**\n * Store the disposable event listeners.\n */\n private disposableListeners: (() => void)[] = [];\n\n /**\n * Handle a move start.\n */\n private onMoveStart(event: PointerEvent | KeyboardEvent, pointerType: PointerType): void {\n this.start.emit({\n pointerType,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n altKey: event.altKey,\n });\n this.isMoving.set(true);\n }\n\n /**\n * Handle a move event.\n */\n private onMove(\n event: PointerEvent | KeyboardEvent,\n pointerType: PointerType,\n deltaX: number,\n deltaY: number,\n ): void {\n if (deltaX === 0 && deltaY === 0) {\n return;\n }\n\n this.move.emit({\n deltaX,\n deltaY,\n pointerType,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n altKey: event.altKey,\n });\n }\n\n /**\n * Handle a move end.\n */\n private onMoveEnd(event: PointerEvent | KeyboardEvent, pointerType: PointerType): void {\n this.end.emit({\n pointerType,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n altKey: event.altKey,\n });\n this.isMoving.set(false);\n }\n\n /**\n * Handle the pointer down event.\n */\n @HostListener('pointerdown', ['$event'])\n protected onPointerDown(event: PointerEvent): void {\n // ignore right-click or additional pointers\n if (event.button !== 0 || this.pointerId !== null || this.disabled()) {\n return;\n }\n\n // prevent the default behavior\n event.preventDefault();\n event.stopPropagation();\n\n this.onMoveStart(event, event.pointerType as PointerType);\n\n // store the pointer id and initial position\n this.pointerId = event.pointerId;\n this.x = event.pageX;\n this.y = event.pageY;\n\n // add global event listeners\n const pointerMove = this.disposables.addEventListener(\n window,\n 'pointermove',\n this.onPointerMove.bind(this) as EventListener,\n false,\n );\n\n const pointerUp = this.disposables.addEventListener(\n window,\n 'pointerup',\n this.onPointerUp.bind(this) as EventListener,\n false,\n );\n\n const pointerCancel = this.disposables.addEventListener(\n window,\n 'pointercancel',\n this.onPointerUp.bind(this) as EventListener,\n false,\n );\n\n // store the disposable event listeners\n this.disposableListeners = [pointerMove, pointerUp, pointerCancel];\n }\n\n /**\n * Handle the pointer up event.\n */\n protected onPointerUp(event: PointerEvent): void {\n if (this.pointerId !== event.pointerId) {\n return;\n }\n\n const pointerType = (event.pointerType ?? 'mouse') as PointerType;\n this.onMoveEnd(event, pointerType);\n this.pointerId = null;\n this.disposableListeners.forEach(dispose => dispose());\n }\n\n /**\n * Handle the pointer move event.\n */\n protected onPointerMove(event: PointerEvent): void {\n if (this.pointerId !== event.pointerId) {\n return;\n }\n\n // Problems with PointerEvent#movementX/movementY:\n // 1. it is always 0 on macOS Safari.\n // 2. On Chrome Android, it's scaled by devicePixelRatio, but not on Chrome macOS\n this.onMove(\n event,\n event.pointerType as PointerType,\n event.pageX - (this.x ?? 0),\n event.pageY - (this.y ?? 0),\n );\n this.x = event.pageX;\n this.y = event.pageY;\n }\n\n private triggerKeyboardMove(event: KeyboardEvent, deltaX: number, deltaY: number): void {\n if (this.disabled()) {\n return;\n }\n\n this.onMoveStart(event, 'keyboard');\n this.onMove(event, 'keyboard', deltaX, deltaY);\n this.onMoveEnd(event, 'keyboard');\n }\n\n @HostListener('keydown.ArrowUp', ['$event'])\n protected onArrowUp(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event, 0, -1);\n }\n\n @HostListener('keydown.ArrowDown', ['$event'])\n protected onArrowDown(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event, 0, 1);\n }\n\n @HostListener('keydown.ArrowLeft', ['$event'])\n protected onArrowLeft(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event, -1, 0);\n }\n\n @HostListener('keydown.ArrowRight', ['$event'])\n protected onArrowRight(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event, 1, 0);\n }\n}\n\ninterface NgpMoveBaseEvent {\n /**\n * Whether the event was triggered by a mouse or keyboard event.\n */\n pointerType: PointerType;\n /**\n * Whether the shift key was pressed during the event.\n */\n shiftKey: boolean;\n /**\n * Whether the control key was pressed during the event.\n */\n ctrlKey: boolean;\n /**\n * Whether the meta key was pressed during the event.\n */\n metaKey: boolean;\n /**\n * Whether the alt key was pressed during the event.\n */\n altKey: boolean;\n}\n\nexport type NgpMoveStartEvent = NgpMoveBaseEvent;\nexport type NgpMoveEndEvent = NgpMoveBaseEvent;\n\nexport interface NgpMoveEvent extends NgpMoveBaseEvent {\n /**\n * The amount of pixels moved in the x-axis.\n */\n deltaX: number;\n /**\n * The amount of pixels moved in the y-axis.\n */\n deltaY: number;\n}\n\nexport type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { setupPress } from 'ng-primitives/internal';\n\n// This was inpsired by Headless UI's active-press hook: https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-react/src/hooks/use-active-press.tsx\n\n/**\n * The `ngpPress` directive listens for press events on an element. This is particularly useful for supporting press events on touch devices, where press events are not handled consistently.\n */\n@Directive({\n selector: '[ngpPress]',\n exportAs: 'ngpPress',\n})\nexport class NgpPress {\n /**\n * Whether listening for press events is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPressDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the press begins.\n */\n readonly pressStart = output<void>({\n alias: 'ngpPressStart',\n });\n\n /**\n * Emit when the press ends.\n */\n readonly pressEnd = output<void>({\n alias: 'ngpPressEnd',\n });\n\n /**\n * Emit when the press changes.\n */\n readonly pressChange = output<boolean>({\n alias: 'ngpPress',\n });\n\n constructor() {\n // setup the press listener\n setupPress({\n pressStart: () => {\n this.pressStart.emit();\n this.pressChange.emit(true);\n },\n pressEnd: () => {\n this.pressEnd.emit();\n this.pressChange.emit(false);\n },\n disabled: this.disabled,\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAIA;;;AAGG;MAKU,eAAe,CAAA;AAgB1B,IAAA,WAAA,GAAA;AAfA;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,KAAK,EAAE,yBAAyB;AAChC,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC;AAEF;;AAEG;QACM,IAAW,CAAA,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AA,EAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAJpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,QAAQ,EAAE,UAAU;AACrB,iBAAA;;;ACZD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-interactions.mjs","sources":["../../../../packages/ng-primitives/interactions/src/focus-visible/focus-visible.ts","../../../../packages/ng-primitives/interactions/src/focus/focus.ts","../../../../packages/ng-primitives/interactions/src/hover/hover.ts","../../../../packages/ng-primitives/interactions/src/move/move.ts","../../../../packages/ng-primitives/interactions/src/press/press.ts","../../../../packages/ng-primitives/interactions/src/ng-primitives-interactions.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { setupFocusVisible } from 'ng-primitives/internal';\n\n/**\n * Apply the `ngpFocusVisible` directive to an element that should be visually focused. This is similar to `ngpFocus`\n * but it will only apply the focus visible styles when the element is focused via keyboard navigation.\n */\n@Directive({\n selector: '[ngpFocusVisible]',\n exportAs: 'ngpFocusVisible',\n})\nexport class NgpFocusVisible {\n /**\n * Whether focus events are listened to.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFocusVisibleDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the element is visually focused.\n */\n readonly focusChange = output<boolean>({\n alias: 'ngpFocusVisible',\n });\n\n constructor() {\n // setup the focus visible listener\n setupFocusVisible({\n disabled: this.disabled,\n focusChange: value => this.focusChange.emit(value),\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { setupFocus } from 'ng-primitives/internal';\n\n/**\n * This was inspired by the React Aria useFocus hook.\n * https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useFocus.ts#L20\n */\n@Directive({\n selector: '[ngpFocus]',\n exportAs: 'ngpFocus',\n})\nexport class NgpFocus {\n /**\n * Whether listening for focus events is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpFocusDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the focus state changes.\n */\n readonly focus = output<boolean>({ alias: 'ngpFocus' });\n\n constructor() {\n // setup the focus listener\n setupFocus({\n disabled: this.disabled,\n focus: () => this.focus.emit(true),\n blur: () => this.focus.emit(false),\n });\n }\n}\n","import type { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { setupHover } from 'ng-primitives/internal';\n\n// This is an Angular port of the useHover hook from react-aria: https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useHover.ts\n\n/**\n * Apply the `ngpHover` directive to an element that you want to listen for hover events. T\n * his is particulaly useful for supporting hover events on touch devices, where hover events are not handled consistently.\n * On iOS relying on the `:hover` pseudo-class can result in the hover state being stuck until the user taps elsewhere on the screen.\n */\n@Directive({\n selector: '[ngpHover]',\n exportAs: 'ngpHover',\n})\nexport class NgpHover {\n /**\n * Whether hoving should be disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpHoverDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit an event when hovering starts.\n */\n readonly hoverStart = output<void>({ alias: 'ngpHoverStart' });\n\n /**\n * Emit an event when hovering ends.\n */\n readonly hoverEnd = output<void>({ alias: 'ngpHoverEnd' });\n\n /**\n * Emit an event when the hover state changes.\n */\n readonly hoverChange = output<boolean>({ alias: 'ngpHover' });\n\n /**\n * Setup the hover state.\n */\n constructor() {\n // setup the hover listener\n setupHover({\n hoverStart: () => {\n this.hoverStart.emit();\n this.hoverChange.emit(true);\n },\n hoverEnd: () => {\n this.hoverEnd.emit();\n this.hoverChange.emit(false);\n },\n disabled: this.disabled,\n });\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, HostListener, input, output, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\n// Inspired by react-aria useMove hook: https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useMove.ts\n\n/**\n * The `NgpMove` directive is used to enable the pointer and keyboard move interactions on an element.\n */\n@Directive({\n selector: '[ngpMove]',\n exportAs: 'ngpMove',\n host: {\n '[attr.data-move]': 'isMoving() ? \"\" : null',\n },\n})\nexport class NgpMove {\n /**\n * Access the disposable helper.\n */\n private readonly disposables = injectDisposables();\n\n /**\n * Whether movement is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpMoveDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the move event begins.\n */\n readonly start = output<NgpMoveStartEvent>({\n alias: 'ngpMoveStart',\n });\n\n /**\n * Emit when the element is moved.\n */\n readonly move = output<NgpMoveEvent>({\n alias: 'ngpMove',\n });\n\n /**\n * Emit when the move event ends.\n */\n readonly end = output<NgpMoveEndEvent>({\n alias: 'ngpMoveEnd',\n });\n\n /**\n * Whether the element is currently being moved.\n */\n private isMoving = signal<boolean>(false);\n\n /**\n * Store the last x position of the element.\n */\n private x: number | null = null;\n\n /**\n * Store the last y position of the element.\n */\n private y: number | null = null;\n\n /**\n * Store the id of the last pointer.\n */\n private pointerId: number | null = null;\n\n /**\n * Store the disposable event listeners.\n */\n private disposableListeners: (() => void)[] = [];\n\n /**\n * Handle a move start.\n */\n private onMoveStart(event: PointerEvent | KeyboardEvent, pointerType: PointerType): void {\n this.start.emit({\n pointerType,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n altKey: event.altKey,\n });\n this.isMoving.set(true);\n }\n\n /**\n * Handle a move event.\n */\n private onMove(\n event: PointerEvent | KeyboardEvent,\n pointerType: PointerType,\n deltaX: number,\n deltaY: number,\n ): void {\n if (deltaX === 0 && deltaY === 0) {\n return;\n }\n\n this.move.emit({\n deltaX,\n deltaY,\n pointerType,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n altKey: event.altKey,\n });\n }\n\n /**\n * Handle a move end.\n */\n private onMoveEnd(event: PointerEvent | KeyboardEvent, pointerType: PointerType): void {\n this.end.emit({\n pointerType,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n altKey: event.altKey,\n });\n this.isMoving.set(false);\n }\n\n /**\n * Handle the pointer down event.\n */\n @HostListener('pointerdown', ['$event'])\n protected onPointerDown(event: PointerEvent): void {\n // ignore right-click or additional pointers\n if (event.button !== 0 || this.pointerId !== null || this.disabled()) {\n return;\n }\n\n // prevent the default behavior\n event.preventDefault();\n event.stopPropagation();\n\n this.onMoveStart(event, event.pointerType as PointerType);\n\n // store the pointer id and initial position\n this.pointerId = event.pointerId;\n this.x = event.pageX;\n this.y = event.pageY;\n\n // add global event listeners\n const pointerMove = this.disposables.addEventListener(\n window,\n 'pointermove',\n this.onPointerMove.bind(this) as EventListener,\n false,\n );\n\n const pointerUp = this.disposables.addEventListener(\n window,\n 'pointerup',\n this.onPointerUp.bind(this) as EventListener,\n false,\n );\n\n const pointerCancel = this.disposables.addEventListener(\n window,\n 'pointercancel',\n this.onPointerUp.bind(this) as EventListener,\n false,\n );\n\n // store the disposable event listeners\n this.disposableListeners = [pointerMove, pointerUp, pointerCancel];\n }\n\n /**\n * Handle the pointer up event.\n */\n protected onPointerUp(event: PointerEvent): void {\n if (this.pointerId !== event.pointerId) {\n return;\n }\n\n const pointerType = (event.pointerType ?? 'mouse') as PointerType;\n this.onMoveEnd(event, pointerType);\n this.pointerId = null;\n this.disposableListeners.forEach(dispose => dispose());\n }\n\n /**\n * Handle the pointer move event.\n */\n protected onPointerMove(event: PointerEvent): void {\n if (this.pointerId !== event.pointerId) {\n return;\n }\n\n // Problems with PointerEvent#movementX/movementY:\n // 1. it is always 0 on macOS Safari.\n // 2. On Chrome Android, it's scaled by devicePixelRatio, but not on Chrome macOS\n this.onMove(\n event,\n event.pointerType as PointerType,\n event.pageX - (this.x ?? 0),\n event.pageY - (this.y ?? 0),\n );\n this.x = event.pageX;\n this.y = event.pageY;\n }\n\n private triggerKeyboardMove(event: KeyboardEvent, deltaX: number, deltaY: number): void {\n if (this.disabled()) {\n return;\n }\n\n this.onMoveStart(event, 'keyboard');\n this.onMove(event, 'keyboard', deltaX, deltaY);\n this.onMoveEnd(event, 'keyboard');\n }\n\n @HostListener('keydown.ArrowUp', ['$event'])\n protected onArrowUp(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event, 0, -1);\n }\n\n @HostListener('keydown.ArrowDown', ['$event'])\n protected onArrowDown(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event, 0, 1);\n }\n\n @HostListener('keydown.ArrowLeft', ['$event'])\n protected onArrowLeft(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event, -1, 0);\n }\n\n @HostListener('keydown.ArrowRight', ['$event'])\n protected onArrowRight(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerKeyboardMove(event, 1, 0);\n }\n}\n\ninterface NgpMoveBaseEvent {\n /**\n * Whether the event was triggered by a mouse or keyboard event.\n */\n pointerType: PointerType;\n /**\n * Whether the shift key was pressed during the event.\n */\n shiftKey: boolean;\n /**\n * Whether the control key was pressed during the event.\n */\n ctrlKey: boolean;\n /**\n * Whether the meta key was pressed during the event.\n */\n metaKey: boolean;\n /**\n * Whether the alt key was pressed during the event.\n */\n altKey: boolean;\n}\n\nexport type NgpMoveStartEvent = NgpMoveBaseEvent;\nexport type NgpMoveEndEvent = NgpMoveBaseEvent;\n\nexport interface NgpMoveEvent extends NgpMoveBaseEvent {\n /**\n * The amount of pixels moved in the x-axis.\n */\n deltaX: number;\n /**\n * The amount of pixels moved in the y-axis.\n */\n deltaY: number;\n}\n\nexport type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { Directive, booleanAttribute, input, output } from '@angular/core';\nimport { setupPress } from 'ng-primitives/internal';\n\n// This was inpsired by Headless UI's active-press hook: https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-react/src/hooks/use-active-press.tsx\n\n/**\n * The `ngpPress` directive listens for press events on an element. This is particularly useful for supporting press events on touch devices, where press events are not handled consistently.\n */\n@Directive({\n selector: '[ngpPress]',\n exportAs: 'ngpPress',\n})\nexport class NgpPress {\n /**\n * Whether listening for press events is disabled.\n */\n readonly disabled = input<boolean, BooleanInput>(false, {\n alias: 'ngpPressDisabled',\n transform: booleanAttribute,\n });\n\n /**\n * Emit when the press begins.\n */\n readonly pressStart = output<void>({\n alias: 'ngpPressStart',\n });\n\n /**\n * Emit when the press ends.\n */\n readonly pressEnd = output<void>({\n alias: 'ngpPressEnd',\n });\n\n /**\n * Emit when the press changes.\n */\n readonly pressChange = output<boolean>({\n alias: 'ngpPress',\n });\n\n constructor() {\n // setup the press listener\n setupPress({\n pressStart: () => {\n this.pressStart.emit();\n this.pressChange.emit(true);\n },\n pressEnd: () => {\n this.pressEnd.emit();\n this.pressChange.emit(false);\n },\n disabled: this.disabled,\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAIA;;;AAGG;MAKU,eAAe,CAAA;AAgB1B,IAAA,WAAA,GAAA;AAfA;;AAEG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE;AACtD,YAAA,KAAK,EAAE,yBAAyB;AAChC,YAAA,SAAS,EAAE,gBAAgB;AAC5B,SAAA,CAAC;AAEF;;AAEG;QACM,IAAW,CAAA,WAAA,GAAG,MAAM,CAAU;AACrC,YAAA,KAAK,EAAE,iBAAiB;AACzB,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,EAAA,EAAA,CAAA,CAAA;;4FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAJpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,QAAQ,EAAE,UAAU;AACrB,iBAAA;;;ACZD;;AAEG;;;;"}
|
|
@@ -47,10 +47,10 @@ class NgpExitAnimationManager {
|
|
|
47
47
|
});
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
51
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
50
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpExitAnimationManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
51
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpExitAnimationManager }); }
|
|
52
52
|
}
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpExitAnimationManager, decorators: [{
|
|
54
54
|
type: Injectable
|
|
55
55
|
}] });
|
|
56
56
|
function provideExitAnimationManager() {
|
|
@@ -97,10 +97,10 @@ class NgpExitAnimation {
|
|
|
97
97
|
this.renderer.setAttribute(this.elementRef.nativeElement, 'inert', '');
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
101
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
100
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpExitAnimation, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
101
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpExitAnimation, isStandalone: true, selector: "[ngpExitAnimation]", exportAs: ["ngpExitAnimation"], ngImport: i0 }); }
|
|
102
102
|
}
|
|
103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpExitAnimation, decorators: [{
|
|
104
104
|
type: Directive,
|
|
105
105
|
args: [{
|
|
106
106
|
selector: '[ngpExitAnimation]',
|
|
@@ -324,10 +324,10 @@ class GlobalPointerEvents {
|
|
|
324
324
|
this.setGlobalIgnoreEmulatedMouseEvents();
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
328
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
327
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: GlobalPointerEvents, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
328
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: GlobalPointerEvents, providedIn: 'root' }); }
|
|
329
329
|
}
|
|
330
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
330
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: GlobalPointerEvents, decorators: [{
|
|
331
331
|
type: Injectable,
|
|
332
332
|
args: [{
|
|
333
333
|
providedIn: 'root',
|
|
@@ -607,10 +607,10 @@ class StyleInjector {
|
|
|
607
607
|
}
|
|
608
608
|
});
|
|
609
609
|
}
|
|
610
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
611
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
610
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: StyleInjector, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
611
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: StyleInjector, providedIn: 'root' }); }
|
|
612
612
|
}
|
|
613
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
613
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: StyleInjector, decorators: [{
|
|
614
614
|
type: Injectable,
|
|
615
615
|
args: [{
|
|
616
616
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-internal.mjs","sources":["../../../../packages/ng-primitives/internal/src/utilities/element-ref.ts","../../../../packages/ng-primitives/internal/src/exit-animation/exit-animation-manager.ts","../../../../packages/ng-primitives/internal/src/exit-animation/exit-animation.ts","../../../../packages/ng-primitives/internal/src/interactions/focus.ts","../../../../packages/ng-primitives/internal/src/interactions/focus-visible.ts","../../../../packages/ng-primitives/internal/src/utilities/dom-removal.ts","../../../../packages/ng-primitives/internal/src/interactions/hover.ts","../../../../packages/ng-primitives/internal/src/interactions/press.ts","../../../../packages/ng-primitives/internal/src/interactions/interactions.ts","../../../../packages/ng-primitives/internal/src/signals/explicit-effect.ts","../../../../packages/ng-primitives/internal/src/signals/sync-state.ts","../../../../packages/ng-primitives/internal/src/style-injector/style-injector.ts","../../../../packages/ng-primitives/internal/src/utilities/scrolling.ts","../../../../packages/ng-primitives/internal/src/ng-primitives-internal.ts"],"sourcesContent":["import { ElementRef, inject } from '@angular/core';\n\n/**\n * A simple utility function to inject an element reference with less boilerplate.\n * @returns The element reference.\n */\nexport function injectElementRef<T extends HTMLElement>(): ElementRef<T> {\n return inject(ElementRef);\n}\n","import { ClassProvider, inject, Injectable } from '@angular/core';\nimport type { NgpExitAnimation } from './exit-animation';\n\n@Injectable()\nexport class NgpExitAnimationManager {\n /** Store the instances of the exit animation directive. */\n private readonly instances: NgpExitAnimation[] = [];\n\n /** Add an instance to the manager. */\n add(instance: NgpExitAnimation): void {\n this.instances.push(instance);\n }\n\n /** Remove an instance from the manager. */\n remove(instance: NgpExitAnimation): void {\n const index = this.instances.indexOf(instance);\n if (index !== -1) {\n this.instances.splice(index, 1);\n }\n }\n\n /** Exit all instances. */\n exit(): Promise<void> {\n return new Promise((resolve, reject) => {\n const exitPromises = this.instances.map(instance => instance.exit());\n\n // Wait for all exit animations to finish\n Promise.all(exitPromises)\n .then(() => resolve())\n .catch(err => {\n if (err instanceof Error && err.name !== 'AbortError') {\n return reject(err);\n }\n // Ignore abort errors as they are expected when the animation is interrupted\n // by the removal of the element - e.g. when the user navigates away to another page\n resolve();\n });\n });\n }\n}\n\nexport function provideExitAnimationManager(): ClassProvider {\n return { provide: NgpExitAnimationManager, useClass: NgpExitAnimationManager };\n}\n\nexport function injectExitAnimationManager(): NgpExitAnimationManager {\n return inject(NgpExitAnimationManager);\n}\n","import { Directive, inject, OnDestroy, Renderer2 } from '@angular/core';\nimport { injectElementRef } from '../utilities/element-ref';\nimport { injectExitAnimationManager } from './exit-animation-manager';\n\n@Directive({\n selector: '[ngpExitAnimation]',\n exportAs: 'ngpExitAnimation',\n})\nexport class NgpExitAnimation implements OnDestroy {\n /** The animation manager. */\n private readonly animationManager = injectExitAnimationManager();\n /** The element to animate. */\n private readonly elementRef = injectElementRef();\n /** Access the renderer. */\n private readonly renderer = inject(Renderer2);\n\n constructor() {\n this.animationManager.add(this);\n this.setAnimationState('enter');\n }\n\n ngOnDestroy(): void {\n this.animationManager.remove(this);\n }\n\n /** Mark the element as exiting. */\n async exit(): Promise<void> {\n this.setAnimationState('exit');\n\n const animation = this.elementRef.nativeElement.getAnimations();\n\n if (animation.length > 0) {\n // Wait for the exit animation to finish\n await Promise.all(animation.map(anim => anim.finished));\n }\n }\n\n private setAnimationState(state: 'enter' | 'exit' | null): void {\n // remove all current animation state attributes\n this.renderer.removeAttribute(this.elementRef.nativeElement, 'data-enter');\n this.renderer.removeAttribute(this.elementRef.nativeElement, 'data-exit');\n\n // add the new animation state attribute\n if (state === 'enter') {\n this.renderer.setAttribute(this.elementRef.nativeElement, 'data-enter', '');\n } else if (state === 'exit') {\n this.renderer.setAttribute(this.elementRef.nativeElement, 'data-exit', '');\n // make the element inert to prevent interaction while exiting\n this.renderer.setAttribute(this.elementRef.nativeElement, 'inert', '');\n }\n }\n}\n","import { ElementRef, Renderer2, Signal, inject, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\nexport interface NgpFocusOptions {\n disabled?: Signal<boolean>;\n focus?: () => void;\n blur?: () => void;\n}\n\nexport interface NgpFocusState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocus({\n focus,\n blur,\n disabled = signal(false),\n}: NgpFocusOptions): NgpFocusState {\n /**\n * Access the element reference.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the disposables helper.\n */\n const disposables = injectDisposables();\n\n /**\n * Access the renderer.\n */\n const renderer = inject(Renderer2);\n\n /**\n * Whether the element is currently focused.\n */\n const isFocused = signal<boolean>(false);\n\n // setup event listeners\n disposables.addEventListener(elementRef.nativeElement, 'focus', onFocus);\n disposables.addEventListener(elementRef.nativeElement, 'blur', onBlur);\n\n /**\n * Listen for focus events.\n * @param event\n */\n function onFocus(event: FocusEvent): void {\n if (disabled()) {\n return;\n }\n\n const ownerDocument = (event.target as HTMLElement)?.ownerDocument ?? document;\n\n // ensure this element is still focused\n if (ownerDocument.activeElement === event.target && event.currentTarget === event.target) {\n focus?.();\n isFocused.set(true);\n // set the data-focus attribute\n renderer.setAttribute(elementRef.nativeElement, 'data-focus', '');\n }\n }\n\n /**\n * Listen for blur events.\n * @param event\n */\n function onBlur(event: FocusEvent): void {\n if (disabled()) {\n return;\n }\n\n if (event.currentTarget === event.target) {\n blur?.();\n isFocused.set(false);\n // remove the data-focus attribute\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus');\n }\n }\n\n return {\n isFocused,\n };\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { ElementRef, inject, Renderer2, Signal, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { onBooleanChange } from 'ng-primitives/utils';\n\nexport interface NgpFocusVisibleOptions {\n disabled?: Signal<boolean>;\n focusChange?: (value: boolean) => void;\n}\n\nexport interface NgpFocusVisibleState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocusVisible({\n focusChange,\n disabled = signal(false),\n}: NgpFocusVisibleOptions): NgpFocusVisibleState {\n /**\n * Access the element that the directive is applied to.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the renderer.\n */\n const renderer = inject(Renderer2);\n\n /**\n * Access the focus monitor.\n */\n const focusMonitor = inject(FocusMonitor);\n\n /**\n * Whether the element is currently focused.\n */\n const isFocused = signal<boolean>(false);\n\n // handle focus state\n focusMonitor\n .monitor(elementRef.nativeElement)\n .pipe(takeUntilDestroyed())\n .subscribe(origin =>\n // null indicates the element was blurred\n origin === null ? onBlur() : onFocus(origin),\n );\n\n // if the component becomes disabled and it is focused, hide the focus\n onBooleanChange(disabled, () => focus(false));\n\n function onFocus(origin: FocusOrigin): void {\n if (disabled() || isFocused()) {\n return;\n }\n\n // for some elements the focus visible state should always appear on focus\n if (alwaysShowFocus()) {\n focus(true);\n return;\n }\n\n // if the focus origin is keyboard or program(focused programmatically), then the focus is visible\n if (origin === 'keyboard') {\n focus(true);\n return;\n }\n }\n\n function onBlur(): void {\n if (disabled() || !isFocused()) {\n return;\n }\n\n focus(false);\n }\n\n /**\n * Trigger the focus signal along with the focusChange event.\n */\n function focus(value: boolean) {\n if (isFocused() === value) {\n return;\n }\n\n isFocused.set(value);\n focusChange?.(value);\n\n if (value) {\n renderer.setAttribute(elementRef.nativeElement, 'data-focus-visible', '');\n } else {\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus-visible');\n }\n }\n\n function alwaysShowFocus(): boolean {\n const nonTextInputTypes = [\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset',\n ];\n\n // if this is an input element and it is a text input\n if (\n elementRef.nativeElement instanceof HTMLInputElement &&\n !nonTextInputTypes.includes(elementRef.nativeElement.type)\n ) {\n return true;\n }\n\n // if this is a textarea\n if (elementRef.nativeElement instanceof HTMLTextAreaElement) {\n return true;\n }\n\n // if this is an element with contenteditable\n if (\n elementRef.nativeElement.isContentEditable ||\n elementRef.nativeElement.hasAttribute('contenteditable')\n ) {\n return true;\n }\n\n return false;\n }\n\n return {\n isFocused,\n };\n}\n","import { isPlatformServer } from '@angular/common';\nimport { inject, PLATFORM_ID } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromResizeEvent } from 'ng-primitives/resize';\n\n/**\n * Whenever an element is removed from the DOM, we call the callback.\n * @param element The element to watch for removal.\n * @param callback The callback to call when the element is removed.\n */\nexport function onDomRemoval(element: HTMLElement, callback: () => void): void {\n const platform = inject(PLATFORM_ID);\n\n // Dont run this on the server\n if (isPlatformServer(platform)) {\n return;\n }\n\n // This is a bit of a hack, but it works. If the element dimensions become zero,\n // it's likely that the element has been removed from the DOM.\n fromResizeEvent(element)\n .pipe(takeUntilDestroyed())\n .subscribe(dimensions => {\n // we check the dimensions first to short-circuit the check as it's faster\n if (dimensions.width === 0 && dimensions.height === 0 && !document.body.contains(element)) {\n callback();\n }\n });\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { effect, ElementRef, inject, Injectable, PLATFORM_ID, Signal, signal } from '@angular/core';\nimport { injectDisposables, onBooleanChange } from 'ng-primitives/utils';\nimport { onDomRemoval } from '../utilities/dom-removal';\n\n/**\n * We use a service here as this value is a singleton\n * and allows us to register the dom events once.\n */\n@Injectable({\n providedIn: 'root',\n})\nclass GlobalPointerEvents {\n /**\n * Whether global mouse events should be ignored.\n */\n ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Determine the platform id.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n constructor() {\n // we only want to setup events on the client\n if (isPlatformBrowser(this.platformId)) {\n this.setupGlobalTouchEvents();\n }\n }\n\n private setupGlobalTouchEvents(): void {\n this.document.addEventListener('pointerup', this.handleGlobalPointerEvent.bind(this));\n this.document.addEventListener('touchend', this.setGlobalIgnoreEmulatedMouseEvents.bind(this));\n }\n\n private setGlobalIgnoreEmulatedMouseEvents(): void {\n this.ignoreEmulatedMouseEvents = true;\n // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n // the distant future because a user previously touched the element.\n setTimeout(() => (this.ignoreEmulatedMouseEvents = false), 50);\n }\n\n private handleGlobalPointerEvent(event: PointerEvent): void {\n if (event.pointerType === 'touch') {\n this.setGlobalIgnoreEmulatedMouseEvents();\n }\n }\n}\n\ninterface NgpHoverOptions {\n disabled?: Signal<boolean>;\n hoverStart?: () => void;\n hoverEnd?: () => void;\n}\n\nexport interface NgpHoverState {\n hovered: Signal<boolean>;\n}\n\n/**\n * Programatically add the hover functionality to an element.\n * This is useful in cases where we can't necessarily use a HostDirective,\n * because there is a chance the directive has already been used.\n */\nexport function setupHover({\n hoverStart,\n hoverEnd,\n disabled = signal(false),\n}: NgpHoverOptions): NgpHoverState {\n /**\n * Access the element.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the global pointer events handler.\n */\n const globalPointerEvents = inject(GlobalPointerEvents);\n\n /**\n * Access the disposable helper.\n */\n const disposables = injectDisposables();\n\n /**\n * Store the current hover state.\n */\n const hovered = signal<boolean>(false);\n\n /**\n * Whether this element should ignore emulated mouse events.\n */\n let ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Setup event listeners.\n */\n disposables.addEventListener(elementRef.nativeElement, 'pointerenter', onPointerEnter);\n disposables.addEventListener(elementRef.nativeElement, 'pointerleave', onPointerLeave);\n disposables.addEventListener(elementRef.nativeElement, 'touchstart', onTouchStart);\n disposables.addEventListener(elementRef.nativeElement, 'mouseenter', onMouseEnter);\n disposables.addEventListener(elementRef.nativeElement, 'mouseleave', onMouseLeave);\n\n // anytime the disabled state changes to true, we must reset the hover state\n if (disabled) {\n onBooleanChange(disabled, reset);\n }\n\n // if the element is removed from the dom, we want to reset the hover state\n onDomRemoval(elementRef.nativeElement, reset);\n\n // anytime the hover state changes we want to update the attribute\n effect(() =>\n hovered()\n ? elementRef.nativeElement.setAttribute('data-hover', '')\n : elementRef.nativeElement.removeAttribute('data-hover'),\n );\n\n /**\n * Reset the hover state.\n */\n function reset(): void {\n onHoverEnd('mouse');\n }\n\n /**\n * Trigger the hover start events.\n * @param event\n * @param pointerType\n */\n function onHoverStart(event: Event, pointerType: string): void {\n if (\n disabled() ||\n pointerType === 'touch' ||\n hovered() ||\n !(event.currentTarget as Element)?.contains(event.target as Element)\n ) {\n return;\n }\n\n hovered.set(true);\n hoverStart?.();\n }\n\n /**\n * Trigger the hover end events.\n * @param pointerType\n */\n function onHoverEnd(pointerType: string): void {\n if (pointerType === 'touch' || !hovered()) {\n return;\n }\n\n hovered.set(false);\n hoverEnd?.();\n }\n\n function onPointerEnter(event: PointerEvent): void {\n if (globalPointerEvents.ignoreEmulatedMouseEvents && event.pointerType === 'mouse') {\n return;\n }\n\n onHoverStart(event, event.pointerType);\n }\n\n function onPointerLeave(event: PointerEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverEnd(event.pointerType);\n }\n }\n\n function onTouchStart(): void {\n ignoreEmulatedMouseEvents = true;\n }\n\n function onMouseEnter(event: MouseEvent): void {\n if (!ignoreEmulatedMouseEvents && !globalPointerEvents.ignoreEmulatedMouseEvents) {\n onHoverStart(event, 'mouse');\n }\n\n ignoreEmulatedMouseEvents = false;\n }\n\n function onMouseLeave(event: MouseEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverEnd('mouse');\n }\n }\n\n return { hovered };\n}\n","import { ElementRef, Signal, effect, inject, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\ninterface NgpPressState {\n pressed: Signal<boolean>;\n}\n\ninterface NgpPressOptions {\n disabled?: Signal<boolean>;\n pressStart?: () => void;\n pressEnd?: () => void;\n}\n\nexport function setupPress({\n pressStart,\n pressEnd,\n disabled = signal(false),\n}: NgpPressOptions): NgpPressState {\n /**\n * Access the element reference.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the disposables helper.\n */\n const disposables = injectDisposables();\n\n /**\n * Whether the element is currently pressed.\n */\n const pressed = signal<boolean>(false);\n\n // setup event listeners\n disposables.addEventListener(elementRef.nativeElement, 'pointerdown', onPointerDown);\n\n // anytime the press state changes we want to update the attribute\n effect(() =>\n pressed() && !disabled()\n ? elementRef.nativeElement.setAttribute('data-press', '')\n : elementRef.nativeElement.removeAttribute('data-press'),\n );\n\n /**\n * Reset the press state.\n */\n function reset(): void {\n // if we are not pressing, then do nothing\n if (!pressed()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n pressed.set(false);\n pressEnd?.();\n }\n\n /**\n * Store the list of disposables.\n */\n let disposableListeners: (() => void)[] = [];\n\n function onPointerDown(): void {\n if (disabled()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n\n // update the press state\n pressed.set(true);\n pressStart?.();\n\n // setup global event listeners to catch events on elements outside the directive\n const ownerDocument = elementRef.nativeElement.ownerDocument ?? document;\n\n // if the pointer up event happens on any elements, then we are no longer pressing on this element\n const pointerUp = disposables.addEventListener(\n ownerDocument,\n 'pointerup',\n () => reset(),\n false,\n );\n\n // Instead of relying on the `pointerleave` event, which is not consistently called on iOS Safari,\n // we use the `pointermove` event to determine if we are still \"pressing\".\n // By checking if the target is still within the element, we can determine if the press is ongoing.\n const pointerMove = disposables.addEventListener(\n ownerDocument,\n 'pointermove',\n () => onPointerMove as EventListener,\n false,\n );\n\n // if the pointer is cancelled, then we are no longer pressing on this element\n const pointerCancel = disposables.addEventListener(\n ownerDocument,\n 'pointercancel',\n () => reset(),\n false,\n );\n\n disposableListeners = [pointerUp, pointerMove, pointerCancel];\n }\n\n function onPointerMove(event: PointerEvent): void {\n if (\n elementRef.nativeElement !== event.target &&\n !elementRef.nativeElement.contains(event.target as Node)\n ) {\n reset();\n }\n }\n\n return { pressed };\n}\n","import { signal, Signal } from '@angular/core';\nimport { setupFocus } from './focus';\nimport { setupFocusVisible } from './focus-visible';\nimport { setupHover } from './hover';\nimport { setupPress } from './press';\n\nexport interface NgpInteractionOptions {\n hover?: boolean;\n press?: boolean;\n focus?: boolean;\n focusVisible?: boolean;\n disabled?: Signal<boolean>;\n}\n\n/**\n * Setup the interactions without relying on HostDirectives.\n */\nexport function setupInteractions({\n focus,\n hover,\n press,\n focusVisible,\n disabled = signal(false),\n}: NgpInteractionOptions): void {\n if (hover) {\n setupHover({ disabled });\n }\n if (press) {\n setupPress({ disabled });\n }\n if (focus) {\n setupFocus({ disabled });\n }\n if (focusVisible) {\n setupFocusVisible({ disabled });\n }\n}\n","/**\n * This implementation is heavily inspired by the great work on ngextension!\n * https://github.com/ngxtension/ngxtension-platform/blob/main/libs/ngxtension/explicit-effect/src/explicit-effect.ts\n */\nimport {\n CreateEffectOptions,\n EffectCleanupRegisterFn,\n EffectRef,\n effect,\n untracked,\n} from '@angular/core';\n\n/**\n * We want to have the Tuple in order to use the types in the function signature\n */\ntype ExplicitEffectValues<T> = {\n [K in keyof T]: () => T[K];\n};\n\n/**\n * This explicit effect function will take the dependencies and the function to run when the dependencies change.\n * @param deps - The dependencies that the effect will run on\n * @param fn - The function to run when the dependencies change\n * @param options - The options for the effect with the addition of defer (it allows the computation to run on first change, not immediately)\n */\nexport function explicitEffect<Input extends readonly unknown[], Params = Input>(\n deps: readonly [...ExplicitEffectValues<Input>],\n fn: (deps: Params, onCleanup: EffectCleanupRegisterFn) => void,\n options?: CreateEffectOptions,\n): EffectRef {\n return effect(onCleanup => {\n const depValues = deps.map(s => s());\n untracked(() => fn(depValues as Params, onCleanup));\n }, options);\n}\n","import { effect, Signal, untracked, WritableSignal } from '@angular/core';\n\nexport function syncState<T>(source: Signal<T>, target: WritableSignal<T>) {\n effect(() => {\n const sourceValue = source();\n untracked(() => target.set(sourceValue));\n });\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { inject, Injectable, PLATFORM_ID } from '@angular/core';\n\n/**\n * A utility service for injecting styles into the document.\n * Angular doesn't allow directives to specify styles, only components.\n * As we ship directives, occasionally we need to associate styles with them.\n * This service allows us to programmatically inject styles into the document.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class StyleInjector {\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Detect the platform.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n /**\n * Store the map of style elements with their unique identifiers.\n */\n private readonly styleElements = new Map<string, HTMLStyleElement>();\n\n constructor() {\n if (isPlatformBrowser(this.platformId)) {\n this.collectServerStyles();\n }\n }\n\n /**\n * Inject a style into the document.\n * @param id The unique identifier for the style.\n * @param style The style to inject.\n */\n add(id: string, style: string): void {\n if (this.styleElements.has(id)) {\n return;\n }\n\n const styleElement = this.document.createElement('style');\n styleElement.setAttribute('data-ngp-style', id);\n styleElement.textContent = style;\n\n this.document.head.appendChild(styleElement);\n this.styleElements.set(id, styleElement);\n }\n\n /**\n * Remove a style from the document.\n * @param id The unique identifier for the style.\n */\n remove(id: string): void {\n const styleElement = this.styleElements.get(id);\n\n if (styleElement) {\n this.document.head.removeChild(styleElement);\n this.styleElements.delete(id);\n }\n }\n\n /**\n * Collect any styles that were rendered by the server.\n */\n private collectServerStyles(): void {\n const styleElements = this.document.querySelectorAll<HTMLStyleElement>('style[data-ngp-style]');\n\n styleElements.forEach(styleElement => {\n const id = styleElement.getAttribute('data-ngp-style');\n\n if (id) {\n this.styleElements.set(id, styleElement);\n }\n });\n }\n}\n\nexport function injectStyleInjector(): StyleInjector {\n return inject(StyleInjector);\n}\n","function getScrollableAncestor(element: HTMLElement): HTMLElement | null {\n let parent = element.parentElement;\n while (parent) {\n const style = window.getComputedStyle(parent);\n if (/(auto|scroll)/.test(style.overflowY) || /(auto|scroll)/.test(style.overflowX)) {\n return parent;\n }\n parent = parent.parentElement;\n }\n return null;\n}\n\nexport function scrollIntoViewIfNeeded(element: HTMLElement): void {\n const scrollableAncestor = getScrollableAncestor(element);\n if (!scrollableAncestor) return;\n\n const parentRect = scrollableAncestor.getBoundingClientRect();\n const elementRect = element.getBoundingClientRect();\n\n if (elementRect.top < parentRect.top) {\n scrollableAncestor.scrollTop -= parentRect.top - elementRect.top;\n } else if (elementRect.bottom > parentRect.bottom) {\n scrollableAncestor.scrollTop += elementRect.bottom - parentRect.bottom;\n }\n\n if (elementRect.left < parentRect.left) {\n scrollableAncestor.scrollLeft -= parentRect.left - elementRect.left;\n } else if (elementRect.right > parentRect.right) {\n scrollableAncestor.scrollLeft += elementRect.right - parentRect.right;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEA;;;AAGG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC;AAC3B;;MCJa,uBAAuB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G,OAAO,CAAC,qBAAqB,EAAE;IAEnD,IAAI,WAAW,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,EAAE;QACpC,kBAAkB,CAAC,SAAS,IAAI,UAAU,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG;;SAC3D,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE;QACjD,kBAAkB,CAAC,SAAS,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM;;IAGxE,IAAI,WAAW,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE;QACtC,kBAAkB,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI;;SAC9D,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE;QAC/C,kBAAkB,CAAC,UAAU,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK;;AAEzE;;AC9BA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-internal.mjs","sources":["../../../../packages/ng-primitives/internal/src/utilities/element-ref.ts","../../../../packages/ng-primitives/internal/src/exit-animation/exit-animation-manager.ts","../../../../packages/ng-primitives/internal/src/exit-animation/exit-animation.ts","../../../../packages/ng-primitives/internal/src/interactions/focus.ts","../../../../packages/ng-primitives/internal/src/interactions/focus-visible.ts","../../../../packages/ng-primitives/internal/src/utilities/dom-removal.ts","../../../../packages/ng-primitives/internal/src/interactions/hover.ts","../../../../packages/ng-primitives/internal/src/interactions/press.ts","../../../../packages/ng-primitives/internal/src/interactions/interactions.ts","../../../../packages/ng-primitives/internal/src/signals/explicit-effect.ts","../../../../packages/ng-primitives/internal/src/signals/sync-state.ts","../../../../packages/ng-primitives/internal/src/style-injector/style-injector.ts","../../../../packages/ng-primitives/internal/src/utilities/scrolling.ts","../../../../packages/ng-primitives/internal/src/ng-primitives-internal.ts"],"sourcesContent":["import { ElementRef, inject } from '@angular/core';\n\n/**\n * A simple utility function to inject an element reference with less boilerplate.\n * @returns The element reference.\n */\nexport function injectElementRef<T extends HTMLElement>(): ElementRef<T> {\n return inject(ElementRef);\n}\n","import { ClassProvider, inject, Injectable } from '@angular/core';\nimport type { NgpExitAnimation } from './exit-animation';\n\n@Injectable()\nexport class NgpExitAnimationManager {\n /** Store the instances of the exit animation directive. */\n private readonly instances: NgpExitAnimation[] = [];\n\n /** Add an instance to the manager. */\n add(instance: NgpExitAnimation): void {\n this.instances.push(instance);\n }\n\n /** Remove an instance from the manager. */\n remove(instance: NgpExitAnimation): void {\n const index = this.instances.indexOf(instance);\n if (index !== -1) {\n this.instances.splice(index, 1);\n }\n }\n\n /** Exit all instances. */\n exit(): Promise<void> {\n return new Promise((resolve, reject) => {\n const exitPromises = this.instances.map(instance => instance.exit());\n\n // Wait for all exit animations to finish\n Promise.all(exitPromises)\n .then(() => resolve())\n .catch(err => {\n if (err instanceof Error && err.name !== 'AbortError') {\n return reject(err);\n }\n // Ignore abort errors as they are expected when the animation is interrupted\n // by the removal of the element - e.g. when the user navigates away to another page\n resolve();\n });\n });\n }\n}\n\nexport function provideExitAnimationManager(): ClassProvider {\n return { provide: NgpExitAnimationManager, useClass: NgpExitAnimationManager };\n}\n\nexport function injectExitAnimationManager(): NgpExitAnimationManager {\n return inject(NgpExitAnimationManager);\n}\n","import { Directive, inject, OnDestroy, Renderer2 } from '@angular/core';\nimport { injectElementRef } from '../utilities/element-ref';\nimport { injectExitAnimationManager } from './exit-animation-manager';\n\n@Directive({\n selector: '[ngpExitAnimation]',\n exportAs: 'ngpExitAnimation',\n})\nexport class NgpExitAnimation implements OnDestroy {\n /** The animation manager. */\n private readonly animationManager = injectExitAnimationManager();\n /** The element to animate. */\n private readonly elementRef = injectElementRef();\n /** Access the renderer. */\n private readonly renderer = inject(Renderer2);\n\n constructor() {\n this.animationManager.add(this);\n this.setAnimationState('enter');\n }\n\n ngOnDestroy(): void {\n this.animationManager.remove(this);\n }\n\n /** Mark the element as exiting. */\n async exit(): Promise<void> {\n this.setAnimationState('exit');\n\n const animation = this.elementRef.nativeElement.getAnimations();\n\n if (animation.length > 0) {\n // Wait for the exit animation to finish\n await Promise.all(animation.map(anim => anim.finished));\n }\n }\n\n private setAnimationState(state: 'enter' | 'exit' | null): void {\n // remove all current animation state attributes\n this.renderer.removeAttribute(this.elementRef.nativeElement, 'data-enter');\n this.renderer.removeAttribute(this.elementRef.nativeElement, 'data-exit');\n\n // add the new animation state attribute\n if (state === 'enter') {\n this.renderer.setAttribute(this.elementRef.nativeElement, 'data-enter', '');\n } else if (state === 'exit') {\n this.renderer.setAttribute(this.elementRef.nativeElement, 'data-exit', '');\n // make the element inert to prevent interaction while exiting\n this.renderer.setAttribute(this.elementRef.nativeElement, 'inert', '');\n }\n }\n}\n","import { ElementRef, Renderer2, Signal, inject, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\nexport interface NgpFocusOptions {\n disabled?: Signal<boolean>;\n focus?: () => void;\n blur?: () => void;\n}\n\nexport interface NgpFocusState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocus({\n focus,\n blur,\n disabled = signal(false),\n}: NgpFocusOptions): NgpFocusState {\n /**\n * Access the element reference.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the disposables helper.\n */\n const disposables = injectDisposables();\n\n /**\n * Access the renderer.\n */\n const renderer = inject(Renderer2);\n\n /**\n * Whether the element is currently focused.\n */\n const isFocused = signal<boolean>(false);\n\n // setup event listeners\n disposables.addEventListener(elementRef.nativeElement, 'focus', onFocus);\n disposables.addEventListener(elementRef.nativeElement, 'blur', onBlur);\n\n /**\n * Listen for focus events.\n * @param event\n */\n function onFocus(event: FocusEvent): void {\n if (disabled()) {\n return;\n }\n\n const ownerDocument = (event.target as HTMLElement)?.ownerDocument ?? document;\n\n // ensure this element is still focused\n if (ownerDocument.activeElement === event.target && event.currentTarget === event.target) {\n focus?.();\n isFocused.set(true);\n // set the data-focus attribute\n renderer.setAttribute(elementRef.nativeElement, 'data-focus', '');\n }\n }\n\n /**\n * Listen for blur events.\n * @param event\n */\n function onBlur(event: FocusEvent): void {\n if (disabled()) {\n return;\n }\n\n if (event.currentTarget === event.target) {\n blur?.();\n isFocused.set(false);\n // remove the data-focus attribute\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus');\n }\n }\n\n return {\n isFocused,\n };\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { ElementRef, inject, Renderer2, Signal, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { onBooleanChange } from 'ng-primitives/utils';\n\nexport interface NgpFocusVisibleOptions {\n disabled?: Signal<boolean>;\n focusChange?: (value: boolean) => void;\n}\n\nexport interface NgpFocusVisibleState {\n isFocused: Signal<boolean>;\n}\n\nexport function setupFocusVisible({\n focusChange,\n disabled = signal(false),\n}: NgpFocusVisibleOptions): NgpFocusVisibleState {\n /**\n * Access the element that the directive is applied to.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the renderer.\n */\n const renderer = inject(Renderer2);\n\n /**\n * Access the focus monitor.\n */\n const focusMonitor = inject(FocusMonitor);\n\n /**\n * Whether the element is currently focused.\n */\n const isFocused = signal<boolean>(false);\n\n // handle focus state\n focusMonitor\n .monitor(elementRef.nativeElement)\n .pipe(takeUntilDestroyed())\n .subscribe(origin =>\n // null indicates the element was blurred\n origin === null ? onBlur() : onFocus(origin),\n );\n\n // if the component becomes disabled and it is focused, hide the focus\n onBooleanChange(disabled, () => focus(false));\n\n function onFocus(origin: FocusOrigin): void {\n if (disabled() || isFocused()) {\n return;\n }\n\n // for some elements the focus visible state should always appear on focus\n if (alwaysShowFocus()) {\n focus(true);\n return;\n }\n\n // if the focus origin is keyboard or program(focused programmatically), then the focus is visible\n if (origin === 'keyboard') {\n focus(true);\n return;\n }\n }\n\n function onBlur(): void {\n if (disabled() || !isFocused()) {\n return;\n }\n\n focus(false);\n }\n\n /**\n * Trigger the focus signal along with the focusChange event.\n */\n function focus(value: boolean) {\n if (isFocused() === value) {\n return;\n }\n\n isFocused.set(value);\n focusChange?.(value);\n\n if (value) {\n renderer.setAttribute(elementRef.nativeElement, 'data-focus-visible', '');\n } else {\n renderer.removeAttribute(elementRef.nativeElement, 'data-focus-visible');\n }\n }\n\n function alwaysShowFocus(): boolean {\n const nonTextInputTypes = [\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset',\n ];\n\n // if this is an input element and it is a text input\n if (\n elementRef.nativeElement instanceof HTMLInputElement &&\n !nonTextInputTypes.includes(elementRef.nativeElement.type)\n ) {\n return true;\n }\n\n // if this is a textarea\n if (elementRef.nativeElement instanceof HTMLTextAreaElement) {\n return true;\n }\n\n // if this is an element with contenteditable\n if (\n elementRef.nativeElement.isContentEditable ||\n elementRef.nativeElement.hasAttribute('contenteditable')\n ) {\n return true;\n }\n\n return false;\n }\n\n return {\n isFocused,\n };\n}\n","import { isPlatformServer } from '@angular/common';\nimport { inject, PLATFORM_ID } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromResizeEvent } from 'ng-primitives/resize';\n\n/**\n * Whenever an element is removed from the DOM, we call the callback.\n * @param element The element to watch for removal.\n * @param callback The callback to call when the element is removed.\n */\nexport function onDomRemoval(element: HTMLElement, callback: () => void): void {\n const platform = inject(PLATFORM_ID);\n\n // Dont run this on the server\n if (isPlatformServer(platform)) {\n return;\n }\n\n // This is a bit of a hack, but it works. If the element dimensions become zero,\n // it's likely that the element has been removed from the DOM.\n fromResizeEvent(element)\n .pipe(takeUntilDestroyed())\n .subscribe(dimensions => {\n // we check the dimensions first to short-circuit the check as it's faster\n if (dimensions.width === 0 && dimensions.height === 0 && !document.body.contains(element)) {\n callback();\n }\n });\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { effect, ElementRef, inject, Injectable, PLATFORM_ID, Signal, signal } from '@angular/core';\nimport { injectDisposables, onBooleanChange } from 'ng-primitives/utils';\nimport { onDomRemoval } from '../utilities/dom-removal';\n\n/**\n * We use a service here as this value is a singleton\n * and allows us to register the dom events once.\n */\n@Injectable({\n providedIn: 'root',\n})\nclass GlobalPointerEvents {\n /**\n * Whether global mouse events should be ignored.\n */\n ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Determine the platform id.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n constructor() {\n // we only want to setup events on the client\n if (isPlatformBrowser(this.platformId)) {\n this.setupGlobalTouchEvents();\n }\n }\n\n private setupGlobalTouchEvents(): void {\n this.document.addEventListener('pointerup', this.handleGlobalPointerEvent.bind(this));\n this.document.addEventListener('touchend', this.setGlobalIgnoreEmulatedMouseEvents.bind(this));\n }\n\n private setGlobalIgnoreEmulatedMouseEvents(): void {\n this.ignoreEmulatedMouseEvents = true;\n // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n // the distant future because a user previously touched the element.\n setTimeout(() => (this.ignoreEmulatedMouseEvents = false), 50);\n }\n\n private handleGlobalPointerEvent(event: PointerEvent): void {\n if (event.pointerType === 'touch') {\n this.setGlobalIgnoreEmulatedMouseEvents();\n }\n }\n}\n\ninterface NgpHoverOptions {\n disabled?: Signal<boolean>;\n hoverStart?: () => void;\n hoverEnd?: () => void;\n}\n\nexport interface NgpHoverState {\n hovered: Signal<boolean>;\n}\n\n/**\n * Programatically add the hover functionality to an element.\n * This is useful in cases where we can't necessarily use a HostDirective,\n * because there is a chance the directive has already been used.\n */\nexport function setupHover({\n hoverStart,\n hoverEnd,\n disabled = signal(false),\n}: NgpHoverOptions): NgpHoverState {\n /**\n * Access the element.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the global pointer events handler.\n */\n const globalPointerEvents = inject(GlobalPointerEvents);\n\n /**\n * Access the disposable helper.\n */\n const disposables = injectDisposables();\n\n /**\n * Store the current hover state.\n */\n const hovered = signal<boolean>(false);\n\n /**\n * Whether this element should ignore emulated mouse events.\n */\n let ignoreEmulatedMouseEvents: boolean = false;\n\n /**\n * Setup event listeners.\n */\n disposables.addEventListener(elementRef.nativeElement, 'pointerenter', onPointerEnter);\n disposables.addEventListener(elementRef.nativeElement, 'pointerleave', onPointerLeave);\n disposables.addEventListener(elementRef.nativeElement, 'touchstart', onTouchStart);\n disposables.addEventListener(elementRef.nativeElement, 'mouseenter', onMouseEnter);\n disposables.addEventListener(elementRef.nativeElement, 'mouseleave', onMouseLeave);\n\n // anytime the disabled state changes to true, we must reset the hover state\n if (disabled) {\n onBooleanChange(disabled, reset);\n }\n\n // if the element is removed from the dom, we want to reset the hover state\n onDomRemoval(elementRef.nativeElement, reset);\n\n // anytime the hover state changes we want to update the attribute\n effect(() =>\n hovered()\n ? elementRef.nativeElement.setAttribute('data-hover', '')\n : elementRef.nativeElement.removeAttribute('data-hover'),\n );\n\n /**\n * Reset the hover state.\n */\n function reset(): void {\n onHoverEnd('mouse');\n }\n\n /**\n * Trigger the hover start events.\n * @param event\n * @param pointerType\n */\n function onHoverStart(event: Event, pointerType: string): void {\n if (\n disabled() ||\n pointerType === 'touch' ||\n hovered() ||\n !(event.currentTarget as Element)?.contains(event.target as Element)\n ) {\n return;\n }\n\n hovered.set(true);\n hoverStart?.();\n }\n\n /**\n * Trigger the hover end events.\n * @param pointerType\n */\n function onHoverEnd(pointerType: string): void {\n if (pointerType === 'touch' || !hovered()) {\n return;\n }\n\n hovered.set(false);\n hoverEnd?.();\n }\n\n function onPointerEnter(event: PointerEvent): void {\n if (globalPointerEvents.ignoreEmulatedMouseEvents && event.pointerType === 'mouse') {\n return;\n }\n\n onHoverStart(event, event.pointerType);\n }\n\n function onPointerLeave(event: PointerEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverEnd(event.pointerType);\n }\n }\n\n function onTouchStart(): void {\n ignoreEmulatedMouseEvents = true;\n }\n\n function onMouseEnter(event: MouseEvent): void {\n if (!ignoreEmulatedMouseEvents && !globalPointerEvents.ignoreEmulatedMouseEvents) {\n onHoverStart(event, 'mouse');\n }\n\n ignoreEmulatedMouseEvents = false;\n }\n\n function onMouseLeave(event: MouseEvent): void {\n if (!disabled() && (event.currentTarget as Element)?.contains(event.target as Element)) {\n onHoverEnd('mouse');\n }\n }\n\n return { hovered };\n}\n","import { ElementRef, Signal, effect, inject, signal } from '@angular/core';\nimport { injectDisposables } from 'ng-primitives/utils';\n\ninterface NgpPressState {\n pressed: Signal<boolean>;\n}\n\ninterface NgpPressOptions {\n disabled?: Signal<boolean>;\n pressStart?: () => void;\n pressEnd?: () => void;\n}\n\nexport function setupPress({\n pressStart,\n pressEnd,\n disabled = signal(false),\n}: NgpPressOptions): NgpPressState {\n /**\n * Access the element reference.\n */\n const elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Access the disposables helper.\n */\n const disposables = injectDisposables();\n\n /**\n * Whether the element is currently pressed.\n */\n const pressed = signal<boolean>(false);\n\n // setup event listeners\n disposables.addEventListener(elementRef.nativeElement, 'pointerdown', onPointerDown);\n\n // anytime the press state changes we want to update the attribute\n effect(() =>\n pressed() && !disabled()\n ? elementRef.nativeElement.setAttribute('data-press', '')\n : elementRef.nativeElement.removeAttribute('data-press'),\n );\n\n /**\n * Reset the press state.\n */\n function reset(): void {\n // if we are not pressing, then do nothing\n if (!pressed()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n pressed.set(false);\n pressEnd?.();\n }\n\n /**\n * Store the list of disposables.\n */\n let disposableListeners: (() => void)[] = [];\n\n function onPointerDown(): void {\n if (disabled()) {\n return;\n }\n\n // clear any existing disposables\n disposableListeners.forEach(dispose => dispose());\n\n // update the press state\n pressed.set(true);\n pressStart?.();\n\n // setup global event listeners to catch events on elements outside the directive\n const ownerDocument = elementRef.nativeElement.ownerDocument ?? document;\n\n // if the pointer up event happens on any elements, then we are no longer pressing on this element\n const pointerUp = disposables.addEventListener(\n ownerDocument,\n 'pointerup',\n () => reset(),\n false,\n );\n\n // Instead of relying on the `pointerleave` event, which is not consistently called on iOS Safari,\n // we use the `pointermove` event to determine if we are still \"pressing\".\n // By checking if the target is still within the element, we can determine if the press is ongoing.\n const pointerMove = disposables.addEventListener(\n ownerDocument,\n 'pointermove',\n () => onPointerMove as EventListener,\n false,\n );\n\n // if the pointer is cancelled, then we are no longer pressing on this element\n const pointerCancel = disposables.addEventListener(\n ownerDocument,\n 'pointercancel',\n () => reset(),\n false,\n );\n\n disposableListeners = [pointerUp, pointerMove, pointerCancel];\n }\n\n function onPointerMove(event: PointerEvent): void {\n if (\n elementRef.nativeElement !== event.target &&\n !elementRef.nativeElement.contains(event.target as Node)\n ) {\n reset();\n }\n }\n\n return { pressed };\n}\n","import { signal, Signal } from '@angular/core';\nimport { setupFocus } from './focus';\nimport { setupFocusVisible } from './focus-visible';\nimport { setupHover } from './hover';\nimport { setupPress } from './press';\n\nexport interface NgpInteractionOptions {\n hover?: boolean;\n press?: boolean;\n focus?: boolean;\n focusVisible?: boolean;\n disabled?: Signal<boolean>;\n}\n\n/**\n * Setup the interactions without relying on HostDirectives.\n */\nexport function setupInteractions({\n focus,\n hover,\n press,\n focusVisible,\n disabled = signal(false),\n}: NgpInteractionOptions): void {\n if (hover) {\n setupHover({ disabled });\n }\n if (press) {\n setupPress({ disabled });\n }\n if (focus) {\n setupFocus({ disabled });\n }\n if (focusVisible) {\n setupFocusVisible({ disabled });\n }\n}\n","/**\n * This implementation is heavily inspired by the great work on ngextension!\n * https://github.com/ngxtension/ngxtension-platform/blob/main/libs/ngxtension/explicit-effect/src/explicit-effect.ts\n */\nimport {\n CreateEffectOptions,\n EffectCleanupRegisterFn,\n EffectRef,\n effect,\n untracked,\n} from '@angular/core';\n\n/**\n * We want to have the Tuple in order to use the types in the function signature\n */\ntype ExplicitEffectValues<T> = {\n [K in keyof T]: () => T[K];\n};\n\n/**\n * This explicit effect function will take the dependencies and the function to run when the dependencies change.\n * @param deps - The dependencies that the effect will run on\n * @param fn - The function to run when the dependencies change\n * @param options - The options for the effect with the addition of defer (it allows the computation to run on first change, not immediately)\n */\nexport function explicitEffect<Input extends readonly unknown[], Params = Input>(\n deps: readonly [...ExplicitEffectValues<Input>],\n fn: (deps: Params, onCleanup: EffectCleanupRegisterFn) => void,\n options?: CreateEffectOptions,\n): EffectRef {\n return effect(onCleanup => {\n const depValues = deps.map(s => s());\n untracked(() => fn(depValues as Params, onCleanup));\n }, options);\n}\n","import { effect, Signal, untracked, WritableSignal } from '@angular/core';\n\nexport function syncState<T>(source: Signal<T>, target: WritableSignal<T>) {\n effect(() => {\n const sourceValue = source();\n untracked(() => target.set(sourceValue));\n });\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { inject, Injectable, PLATFORM_ID } from '@angular/core';\n\n/**\n * A utility service for injecting styles into the document.\n * Angular doesn't allow directives to specify styles, only components.\n * As we ship directives, occasionally we need to associate styles with them.\n * This service allows us to programmatically inject styles into the document.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class StyleInjector {\n /**\n * Access the document.\n */\n private readonly document = inject(DOCUMENT);\n\n /**\n * Detect the platform.\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n /**\n * Store the map of style elements with their unique identifiers.\n */\n private readonly styleElements = new Map<string, HTMLStyleElement>();\n\n constructor() {\n if (isPlatformBrowser(this.platformId)) {\n this.collectServerStyles();\n }\n }\n\n /**\n * Inject a style into the document.\n * @param id The unique identifier for the style.\n * @param style The style to inject.\n */\n add(id: string, style: string): void {\n if (this.styleElements.has(id)) {\n return;\n }\n\n const styleElement = this.document.createElement('style');\n styleElement.setAttribute('data-ngp-style', id);\n styleElement.textContent = style;\n\n this.document.head.appendChild(styleElement);\n this.styleElements.set(id, styleElement);\n }\n\n /**\n * Remove a style from the document.\n * @param id The unique identifier for the style.\n */\n remove(id: string): void {\n const styleElement = this.styleElements.get(id);\n\n if (styleElement) {\n this.document.head.removeChild(styleElement);\n this.styleElements.delete(id);\n }\n }\n\n /**\n * Collect any styles that were rendered by the server.\n */\n private collectServerStyles(): void {\n const styleElements = this.document.querySelectorAll<HTMLStyleElement>('style[data-ngp-style]');\n\n styleElements.forEach(styleElement => {\n const id = styleElement.getAttribute('data-ngp-style');\n\n if (id) {\n this.styleElements.set(id, styleElement);\n }\n });\n }\n}\n\nexport function injectStyleInjector(): StyleInjector {\n return inject(StyleInjector);\n}\n","function getScrollableAncestor(element: HTMLElement): HTMLElement | null {\n let parent = element.parentElement;\n while (parent) {\n const style = window.getComputedStyle(parent);\n if (/(auto|scroll)/.test(style.overflowY) || /(auto|scroll)/.test(style.overflowX)) {\n return parent;\n }\n parent = parent.parentElement;\n }\n return null;\n}\n\nexport function scrollIntoViewIfNeeded(element: HTMLElement): void {\n const scrollableAncestor = getScrollableAncestor(element);\n if (!scrollableAncestor) return;\n\n const parentRect = scrollableAncestor.getBoundingClientRect();\n const elementRect = element.getBoundingClientRect();\n\n if (elementRect.top < parentRect.top) {\n scrollableAncestor.scrollTop -= parentRect.top - elementRect.top;\n } else if (elementRect.bottom > parentRect.bottom) {\n scrollableAncestor.scrollTop += elementRect.bottom - parentRect.bottom;\n }\n\n if (elementRect.left < parentRect.left) {\n scrollableAncestor.scrollLeft -= parentRect.left - elementRect.left;\n } else if (elementRect.right > parentRect.right) {\n scrollableAncestor.scrollLeft += elementRect.right - parentRect.right;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEA;;;AAGG;SACa,gBAAgB,GAAA;AAC9B,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC;AAC3B;;MCJa,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;;QAGmB,IAAS,CAAA,SAAA,GAAuB,EAAE;A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CAAC,GAAG,EAAE;QACpC,kBAAkB,CAAC,SAAS,IAAI,UAAU,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG;;SAC3D,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE;QACjD,kBAAkB,CAAC,SAAS,IAAI,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM;;IAGxE,IAAI,WAAW,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE;QACtC,kBAAkB,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI;;SAC9D,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE;QAC/C,kBAAkB,CAAC,UAAU,IAAI,WAAW,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK;;AAEzE;;AC9BA;;AAEG;;;;"}
|
|
@@ -125,10 +125,10 @@ class NgpListboxOption {
|
|
|
125
125
|
}
|
|
126
126
|
this.listbox()?.activateOption(this.value());
|
|
127
127
|
}
|
|
128
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
129
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
128
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpListboxOption, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
129
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", 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 }); }
|
|
130
130
|
}
|
|
131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpListboxOption, decorators: [{
|
|
132
132
|
type: Directive,
|
|
133
133
|
args: [{
|
|
134
134
|
selector: '[ngpListboxOption]',
|
|
@@ -155,10 +155,10 @@ class NgpListboxSection {
|
|
|
155
155
|
*/
|
|
156
156
|
this.header = contentChild(NgpHeaderToken, { descendants: true });
|
|
157
157
|
}
|
|
158
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
159
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.
|
|
158
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpListboxSection, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
159
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.11", type: NgpListboxSection, isStandalone: true, selector: "[ngpListboxSection]", host: { attributes: { "role": "group" }, properties: { "attr.aria-labelledby": "header()?.id()" } }, queries: [{ propertyName: "header", first: true, predicate: NgpHeaderToken, descendants: true, isSignal: true }], exportAs: ["ngpListboxSection"], ngImport: i0 }); }
|
|
160
160
|
}
|
|
161
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpListboxSection, decorators: [{
|
|
162
162
|
type: Directive,
|
|
163
163
|
args: [{
|
|
164
164
|
selector: '[ngpListboxSection]',
|
|
@@ -186,10 +186,10 @@ class NgpListboxTrigger {
|
|
|
186
186
|
event.preventDefault();
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
190
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
189
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpListboxTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
190
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.11", type: NgpListboxTrigger, isStandalone: true, selector: "[ngpListboxTrigger]", host: { listeners: { "keydown": "openPopover($event)" } }, exportAs: ["ngpListboxTrigger"], ngImport: i0 }); }
|
|
191
191
|
}
|
|
192
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpListboxTrigger, decorators: [{
|
|
193
193
|
type: Directive,
|
|
194
194
|
args: [{
|
|
195
195
|
selector: '[ngpListboxTrigger]',
|
|
@@ -377,10 +377,10 @@ class NgpListbox {
|
|
|
377
377
|
removeOption(option) {
|
|
378
378
|
this.options.update(options => options.filter(o => o !== option));
|
|
379
379
|
}
|
|
380
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
381
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
380
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpListbox, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
381
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.11", type: NgpListbox, isStandalone: true, selector: "[ngpListbox]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "ngpListboxMode", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "ngpListboxValue", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "ngpListboxDisabled", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "ngpListboxCompareWith", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "ngpListboxValueChange" }, host: { attributes: { "role": "listbox" }, listeners: { "focusin": "isFocused.set(true)", "focusout": "isFocused.set(false)", "keydown": "onKeydown($event)" }, properties: { "id": "state.id()", "attr.tabindex": "tabindex()", "attr.aria-disabled": "state.disabled()", "attr.aria-multiselectable": "state.mode() === \"multiple\"", "attr.aria-activedescendant": "activeDescendant()" } }, providers: [provideListboxState()], exportAs: ["ngpListbox"], ngImport: i0 }); }
|
|
382
382
|
}
|
|
383
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
383
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: NgpListbox, decorators: [{
|
|
384
384
|
type: Directive,
|
|
385
385
|
args: [{
|
|
386
386
|
selector: '[ngpListbox]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-primitives-listbox.mjs","sources":["../../../../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 {\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(NgpListboxStateToken, { deferred: true });\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 {\n injectElementRef,\n onDomRemoval,\n scrollIntoViewIfNeeded,\n setupInteractions,\n} 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 setupInteractions({\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 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('keyboard');\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 { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NgpSelectionMode } from 'ng-primitives/common';\nimport { explicitEffect, setupFocusVisible } from 'ng-primitives/internal';\nimport { injectPopoverTriggerState } from 'ng-primitives/popover';\nimport { 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 private readonly state = listboxState<NgpListbox<T>>(this);\n\n constructor() {\n setupFocusVisible({ disabled: this.state.disabled });\n }\n\n ngAfterContentInit(): void {\n this.keyManager.withHomeAndEnd().withTypeAhead().withVerticalOrientation();\n\n this.keyManager.change\n .pipe(takeUntilDestroyed(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 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 this.state.value.set([value]);\n this.valueChange.emit(this.state.value());\n } else {\n // if the value is already selected, remove it, otherwise add it\n if (this.isSelected(value)) {\n this.state.value.set(this.state.value().filter(v => !this.state.compareWith()(v, value)));\n this.valueChange.emit(this.state.value());\n } else {\n this.state.value.set([...this.state.value(), value]);\n this.valueChange.emit(this.state.value());\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":";;;;;;;;;;AAQA;;AAEG;AACI,MAAM,oBAAoB,GAAG,gBAAgB,CAAsB,SAAS,CAAC;AAEpF;;AAEG;MACU,mBAAmB,GAAG,mBAAmB,CAAC,oBAAoB;AAE3E;;AAEG;AACI,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,oBAAoB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;AAE9F;;AAEG;AACI,MAAM,YAAY,GAAG,WAAW,CAAC,oBAAoB,CAAC;;MCWhD,gBAAgB,CAAA;AAmC3B;;;AAGG;AACH,IAAA,IAAI,QAAQ,GAAA;AACV,QAAA,OAAO,IAAI,CAAC,SAAS,EAAE;;AAUzB,IAAA,WAAA,GAAA;QAjDmB,IAAO,CAAA,OAAA,GAAG,kBAAkB,EAAiB;QAC/C,IAAU,CAAA,UAAA,GAAG,gBAAgB,EAAE;AAEhD;;AAEG;QACM,IAAE,CAAA,EAAA,GAAG,KAAK,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;AAEnD;;AAEG;AACM,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAI;AACjC,YAAA,KAAK,EAAE,u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AA,8BAA8B,EAAE,oBAAoB;AACpD,wBAAA,WAAW,EAAE,qBAAqB;AAClC,wBAAA,YAAY,EAAE,sBAAsB;AACrC,qBAAA;AACF,iBAAA;wDA0HW,SAAS,EAAA,CAAA;sBADlB,YAAY;uBAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;;;AC9JrC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-primitives-listbox.mjs","sources":["../../../../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 {\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(NgpListboxStateToken, { deferred: true });\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 {\n injectElementRef,\n onDomRemoval,\n scrollIntoViewIfNeeded,\n setupInteractions,\n} 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 setupInteractions({\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 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('keyboard');\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 { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NgpSelectionMode } from 'ng-primitives/common';\nimport { explicitEffect, setupFocusVisible } from 'ng-primitives/internal';\nimport { injectPopoverTriggerState } from 'ng-primitives/popover';\nimport { 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 private readonly state = listboxState<NgpListbox<T>>(this);\n\n constructor() {\n setupFocusVisible({ disabled: this.state.disabled });\n }\n\n ngAfterContentInit(): void {\n this.keyManager.withHomeAndEnd().withTypeAhead().withVerticalOrientation();\n\n this.keyManager.change\n .pipe(takeUntilDestroyed(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 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 this.state.value.set([value]);\n this.valueChange.emit(this.state.value());\n } else {\n // if the value is already selected, remove it, otherwise add it\n if (this.isSelected(value)) {\n this.state.value.set(this.state.value().filter(v => !this.state.compareWith()(v, value)));\n this.valueChange.emit(this.state.value());\n } else {\n this.state.value.set([...this.state.value(), value]);\n this.valueChange.emit(this.state.value());\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":";;;;;;;;;;AAQA;;AAEG;AACI,MAAM,oBAAoB,GAAG,gBAAgB,CAAsB,SAAS,CAAC;AAEpF;;AAEG;MACU,mBAAmB,GAAG,mBAAmB,CAAC,oBAAoB;AAE3E;;AAEG;AACI,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,oBAAoB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;AAE9F;;AAEG;AACI,MAAM,YAAY,GAAG,WAAW,CAAC,oBAAoB,CAAC;;MCWhD,gBAAgB,CAAA;AAmC3B;;;AAG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