frontile 0.18.10 → 0.18.11
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/declarations/components/buttons/segmented-control/segmented-control.d.ts +21 -23
- package/declarations/components/buttons/segmented-control/segmented-control.d.ts.map +1 -1
- package/declarations/components/collections/calendar/calendar.d.ts +168 -103
- package/declarations/components/collections/calendar/calendar.d.ts.map +1 -1
- package/declarations/components/collections/command/input.d.ts +70 -46
- package/declarations/components/collections/command/input.d.ts.map +1 -1
- package/declarations/components/collections/command/list.d.ts +70 -33
- package/declarations/components/collections/command/list.d.ts.map +1 -1
- package/declarations/components/collections/simple-table/body.d.ts +137 -72
- package/declarations/components/collections/simple-table/body.d.ts.map +1 -1
- package/declarations/components/collections/simple-table/cell.d.ts +137 -72
- package/declarations/components/collections/simple-table/cell.d.ts.map +1 -1
- package/declarations/components/collections/simple-table/column.d.ts +137 -72
- package/declarations/components/collections/simple-table/column.d.ts.map +1 -1
- package/declarations/components/collections/simple-table/footer.d.ts +137 -72
- package/declarations/components/collections/simple-table/footer.d.ts.map +1 -1
- package/declarations/components/collections/simple-table/header.d.ts +137 -72
- package/declarations/components/collections/simple-table/header.d.ts.map +1 -1
- package/declarations/components/collections/simple-table/index.d.ts +137 -72
- package/declarations/components/collections/simple-table/index.d.ts.map +1 -1
- package/declarations/components/collections/simple-table/row.d.ts +137 -72
- package/declarations/components/collections/simple-table/row.d.ts.map +1 -1
- package/declarations/components/collections/table/checkbox.d.ts +30 -14
- package/declarations/components/collections/table/checkbox.d.ts.map +1 -1
- package/declarations/components/collections/table/column-visibility.d.ts +137 -72
- package/declarations/components/collections/table/column-visibility.d.ts.map +1 -1
- package/declarations/components/collections/table/sort-button.d.ts +137 -72
- package/declarations/components/collections/table/sort-button.d.ts.map +1 -1
- package/declarations/components/collections/table/table.d.ts +137 -72
- package/declarations/components/collections/table/table.d.ts.map +1 -1
- package/declarations/components/disclosure/accordion/accordion.d.ts +77 -51
- package/declarations/components/disclosure/accordion/accordion.d.ts.map +1 -1
- package/declarations/components/forms/autocomplete.d.ts +112 -28
- package/declarations/components/forms/autocomplete.d.ts.map +1 -1
- package/declarations/components/forms/checkbox-group.d.ts +21 -15
- package/declarations/components/forms/checkbox-group.d.ts.map +1 -1
- package/declarations/components/forms/checkbox.d.ts +30 -14
- package/declarations/components/forms/checkbox.d.ts.map +1 -1
- package/declarations/components/forms/date-picker/date-picker.d.ts +307 -56
- package/declarations/components/forms/date-picker/date-picker.d.ts.map +1 -1
- package/declarations/components/forms/input-otp.d.ts +56 -40
- package/declarations/components/forms/input-otp.d.ts.map +1 -1
- package/declarations/components/forms/input.d.ts +35 -30
- package/declarations/components/forms/input.d.ts.map +1 -1
- package/declarations/components/forms/label.d.ts +14 -13
- package/declarations/components/forms/label.d.ts.map +1 -1
- package/declarations/components/forms/native-select.d.ts +66 -18
- package/declarations/components/forms/native-select.d.ts.map +1 -1
- package/declarations/components/forms/radio-group.d.ts +21 -15
- package/declarations/components/forms/radio-group.d.ts.map +1 -1
- package/declarations/components/forms/radio.d.ts +30 -14
- package/declarations/components/forms/radio.d.ts.map +1 -1
- package/declarations/components/forms/select/select.d.ts +186 -36
- package/declarations/components/forms/select/select.d.ts.map +1 -1
- package/declarations/components/forms/switch.d.ts +56 -39
- package/declarations/components/forms/switch.d.ts.map +1 -1
- package/declarations/components/forms/textarea.d.ts +53 -16
- package/declarations/components/forms/textarea.d.ts.map +1 -1
- package/declarations/components/layout/app-layout.d.ts +168 -118
- package/declarations/components/layout/app-layout.d.ts.map +1 -1
- package/declarations/components/layout/aside.d.ts +168 -118
- package/declarations/components/layout/aside.d.ts.map +1 -1
- package/declarations/components/layout/navbar.d.ts +168 -118
- package/declarations/components/layout/navbar.d.ts.map +1 -1
- package/declarations/components/layout/sidebar.d.ts +168 -118
- package/declarations/components/layout/sidebar.d.ts.map +1 -1
- package/declarations/components/navigation/breadcrumbs/breadcrumbs.d.ts +42 -31
- package/declarations/components/navigation/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/declarations/components/navigation/pagination/pagination.d.ts +56 -39
- package/declarations/components/navigation/pagination/pagination.d.ts.map +1 -1
- package/declarations/components/navigation/stepper/stepper.d.ts +294 -188
- package/declarations/components/navigation/stepper/stepper.d.ts.map +1 -1
- package/declarations/components/navigation/tab-nav/tab-nav.d.ts +35 -30
- package/declarations/components/navigation/tab-nav/tab-nav.d.ts.map +1 -1
- package/declarations/components/navigation/tabs/tabs.d.ts +35 -30
- package/declarations/components/navigation/tabs/tabs.d.ts.map +1 -1
- package/declarations/components/overlays/drawer.d.ts +91 -60
- package/declarations/components/overlays/drawer.d.ts.map +1 -1
- package/declarations/components/overlays/modal.d.ts +35 -26
- package/declarations/components/overlays/modal.d.ts.map +1 -1
- package/declarations/components/overlays/popover.d.ts +2 -0
- package/declarations/components/overlays/popover.d.ts.map +1 -1
- package/declarations/components/status/badge.d.ts +4 -0
- package/declarations/components/status/badge.d.ts.map +1 -1
- package/declarations/components/utilities/avatar.d.ts +21 -20
- package/declarations/components/utilities/avatar.d.ts.map +1 -1
- package/dist/components/buttons/button-group.js +1 -1
- package/dist/components/buttons/button.js +2 -2
- package/dist/components/buttons/chip.js +1 -1
- package/dist/components/buttons/close-button.js +1 -1
- package/dist/components/buttons/segmented-control/segmented-control.js +1 -1
- package/dist/components/buttons/toggle-button.js +1 -1
- package/dist/components/collections/calendar/calendar.js +1 -1
- package/dist/components/collections/calendar/header.js +1 -1
- package/dist/components/collections/calendar/year-grid.js +1 -1
- package/dist/components/collections/command/command.js +1 -1
- package/dist/components/collections/command/list.js +1 -1
- package/dist/components/collections/dropdown/dropdown.js +2 -2
- package/dist/components/collections/dropdown/sub.js +1 -1
- package/dist/components/collections/listbox/item.js +2 -2
- package/dist/components/collections/listbox/listbox.js +2 -2
- package/dist/components/collections/table/column-visibility.js +1 -1
- package/dist/components/collections/table/sort-button.js +1 -1
- package/dist/components/collections/table/table.js +1 -1
- package/dist/components/disclosure/accordion/accordion.js +1 -1
- package/dist/components/disclosure/accordion/item.js +1 -1
- package/dist/components/forms/autocomplete.js +4 -4
- package/dist/components/forms/date-input/date-input.js +1 -1
- package/dist/components/forms/date-input/segment-group.js +1 -1
- package/dist/components/forms/date-picker/date-picker.js +2 -2
- package/dist/components/forms/date-picker/end-content.js +1 -1
- package/dist/components/forms/date-picker/time-columns.js +2 -2
- package/dist/components/forms/form-feedback.js +2 -2
- package/dist/components/forms/form.js +1 -1
- package/dist/components/forms/input-otp.js +1 -1
- package/dist/components/forms/input.js +1 -1
- package/dist/components/forms/native-select.js +2 -2
- package/dist/components/forms/select/end-content.js +1 -1
- package/dist/components/forms/select/select.js +3 -3
- package/dist/components/forms/switch.js +2 -2
- package/dist/components/layout/app-layout-state.js +1 -1
- package/dist/components/layout/app-layout.js +1 -1
- package/dist/components/layout/aside-toggle.js +1 -1
- package/dist/components/layout/aside.js +1 -1
- package/dist/components/layout/bottom-nav-more.js +2 -2
- package/dist/components/layout/bottom-nav.js +1 -1
- package/dist/components/layout/main.js +1 -1
- package/dist/components/layout/menu-toggle.js +1 -1
- package/dist/components/layout/nav-context.js +1 -1
- package/dist/components/layout/nav-folder.js +2 -2
- package/dist/components/layout/nav-item.js +1 -1
- package/dist/components/layout/nav-link.js +1 -1
- package/dist/components/layout/navbar.js +1 -1
- package/dist/components/layout/page-header.js +1 -1
- package/dist/components/layout/sidebar-group.js +1 -1
- package/dist/components/layout/sidebar-toggle.js +1 -1
- package/dist/components/layout/sidebar.js +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js +1 -1
- package/dist/components/navigation/breadcrumbs/item.js +1 -1
- package/dist/components/navigation/breadcrumbs/separator.js +1 -1
- package/dist/components/navigation/external-link.js +1 -1
- package/dist/components/navigation/pagination/pagination.js +2 -2
- package/dist/components/navigation/stepper/collapse-menu.js +1 -1
- package/dist/components/navigation/stepper/stepper.js +1 -1
- package/dist/components/navigation/tab-nav/item.js +1 -1
- package/dist/components/navigation/tab-nav/tab-nav.js +1 -1
- package/dist/components/navigation/tabs/tabs.js +1 -1
- package/dist/components/notifications/index.js +2 -2
- package/dist/components/notifications/notification-card.js +3 -3
- package/dist/components/notifications/notifications-container.js +2 -2
- package/dist/components/overlays/drawer.js +2 -2
- package/dist/components/overlays/modal.js +2 -2
- package/dist/components/overlays/overlay.js +1 -1
- package/dist/components/overlays/popover.js +44 -5
- package/dist/components/overlays/popover.js.map +1 -1
- package/dist/components/overlays/portal.js +1 -1
- package/dist/components/status/alert.js +1 -1
- package/dist/components/status/badge.js +4 -0
- package/dist/components/status/badge.js.map +1 -1
- package/dist/components/status/progress-bar.js +1 -1
- package/dist/components/utilities/avatar.js +1 -1
- package/dist/components/utilities/kbd.js +1 -1
- package/dist/components/utilities/spinner.js +1 -1
- package/dist/{control-blur-C8OnSQR5.js → control-blur-ByDW39Z2.js} +1 -1
- package/dist/{control-blur-C8OnSQR5.js.map → control-blur-ByDW39Z2.js.map} +1 -1
- package/dist/{deprecated-args-BIUjLA8y.js → deprecated-args-D6KS2fwp.js} +1 -1
- package/dist/{deprecated-args-BIUjLA8y.js.map → deprecated-args-D6KS2fwp.js.map} +1 -1
- package/dist/{dialog-CreV7aPQ.js → dialog-C5sLU1yl.js} +1 -1
- package/dist/{dialog-CreV7aPQ.js.map → dialog-C5sLU1yl.js.map} +1 -1
- package/dist/{dom-cKWVvtkd.js → dom-CbIZhRH4.js} +1 -1
- package/dist/{dom-cKWVvtkd.js.map → dom-CbIZhRH4.js.map} +1 -1
- package/dist/{icons-55dthVFk.js → icons-DqlDWFrr.js} +1 -1
- package/dist/{icons-55dthVFk.js.map → icons-DqlDWFrr.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/{manager-Dge4r8Vn.js → manager-DFO_x6Jr.js} +2 -2
- package/dist/{manager-Dge4r8Vn.js.map → manager-DFO_x6Jr.js.map} +1 -1
- package/dist/{notification-card-BPfDo-Gf.js → notification-card-C4mlc9Ac.js} +3 -3
- package/dist/{notification-card-BPfDo-Gf.js.map → notification-card-C4mlc9Ac.js.map} +1 -1
- package/dist/notifications.js +2 -2
- package/dist/{reveal-within-BcqpOmSI.js → reveal-within-BbeisIjK.js} +1 -1
- package/dist/{reveal-within-BcqpOmSI.js.map → reveal-within-BbeisIjK.js.map} +1 -1
- package/dist/{runtime--fcdnjmJ-BOdRhmsS.js → runtime--fcdnjmJ-DOFHQ2m8.js} +1 -1
- package/dist/{runtime--fcdnjmJ-BOdRhmsS.js.map → runtime--fcdnjmJ-DOFHQ2m8.js.map} +1 -1
- package/dist/services/notifications.js +1 -1
- package/dist/test-support.js +3 -51
- package/dist/test-support.js.map +1 -1
- package/dist/utils/keys.js +1 -1
- package/dist/utils/listManager.js +2 -2
- package/dist/utils/ref.js +1 -1
- package/dist/utils/toggle.js +1 -1
- package/package.json +16 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","sources":["../../../src/components/overlays/popover.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { Overlay, type OverlaySignature } from './overlay';\nimport { tracked, cached } from '@glimmer/tracking';\nimport { Velcro } from 'ember-velcro';\nimport { arrow as arrowMiddleware } from '@floating-ui/dom';\nimport { assert } from '@ember/debug';\nimport { guidFor } from '@ember/object/internals';\nimport { hash } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nimport { modifier } from 'ember-modifier';\nimport { debounce, later, cancel } from '@ember/runloop';\nimport type { Timer as EmberTimer } from '@ember/runloop';\nimport type { ModifierLike } from '@glint/template';\nimport type { WithBoundArgs } from '@glint/template';\nimport type { Signature as VelcroSignature } from 'ember-velcro/modifiers/velcro';\nimport type { MiddlewareArguments } from '@floating-ui/dom';\nimport { hasKey } from '../../utils/keyboard-event';\n\ninterface PopoverSignature {\n Args: {\n /**\n * Placement of the menu when open\n *\n * @defaultValue 'bottom-start'\n */\n placement?:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end';\n\n /**\n * Options for the floating-ui flip middleware, which moves the content to\n * the opposite side when it would overflow the viewport.\n */\n flipOptions?: VelcroSignature['Args']['Named']['flipOptions'];\n\n /**\n * Additional floating-ui middleware, for positioning behavior beyond what\n * `placement`, `offsetOptions`, `flipOptions`, and `shiftOptions` cover.\n */\n middleware?: VelcroSignature['Args']['Named']['middleware'];\n\n /**\n * Options for the floating-ui shift middleware, which nudges the content\n * along its axis to keep it in view.\n */\n shiftOptions?: VelcroSignature['Args']['Named']['shiftOptions'];\n\n /**\n * @defaultValue 5\n */\n offsetOptions?: VelcroSignature['Args']['Named']['offsetOptions'];\n\n /**\n * @defaultValue 'absolute'\n */\n strategy?: VelcroSignature['Args']['Named']['strategy'];\n\n /**\n * Whether the popover is open. Pair with `onOpenChange` to control it;\n * leave it unset to let the popover manage its own state.\n */\n isOpen?: boolean;\n\n /**\n * Callback when the popover opens or closes, receiving the new state.\n */\n onOpenChange?: (isOpen: boolean) => void;\n\n /**\n * Callback when closing has finished, including any exit transition.\n */\n didClose?: () => void;\n\n /**\n * Milliseconds to wait before opening on hover or keyboard focus. Only\n * applies to a `trigger` installed in hover mode.\n *\n * @defaultValue 100\n */\n openDelay?: number;\n\n /**\n * Milliseconds to wait before closing after the pointer leaves the trigger\n * or the content. Only applies to a `trigger` installed in hover mode.\n *\n * This is also the window the pointer has to cross the gap between the\n * trigger and the content, so setting it to 0 makes content hover\n * unreachable in practice.\n *\n * @defaultValue 100\n */\n closeDelay?: number;\n };\n Element: HTMLUListElement;\n Blocks: {\n default: [\n {\n anchor: ModifierLike<{ Element: HTMLElement }>;\n\n /**\n * Nominates the element it is placed on as the width reference for\n * `@size=\"trigger\"` content, instead of the element carrying `trigger`.\n */\n measureWidth: ModifierLike<{ Element: HTMLElement }>;\n isOpen: boolean;\n toggle: () => void;\n open: () => void;\n close: () => void;\n trigger: ModifierLike<{\n Element: HTMLElement;\n Args: {\n Positional: [eventType?: 'click' | 'hover'];\n Named: { aria?: 'menu' | 'describedby' | 'none' };\n };\n }>;\n\n /**\n * The floating-ui middleware data for the current position, including\n * the placement actually resolved after `flip`.\n */\n data: MiddlewareArguments;\n Content: WithBoundArgs<\n typeof Content,\n | 'loop'\n | 'isOpen'\n | 'id'\n | 'toggle'\n | 'internalDidClose'\n | 'blockScroll'\n | 'backdrop'\n | 'triggerWidth'\n | 'preventAutoFocus'\n | 'isHoverTrigger'\n | 'onContentHoverStart'\n | 'onContentHoverEnd'\n | 'registerArrow'\n | 'velcroData'\n >;\n }\n ];\n };\n}\n\nclass Popover extends Component<PopoverSignature> {\n /**\n * The element `measureWidth` is watching, when a consumer opts into measuring\n * something other than the trigger. Its presence is what gives `measureWidth`\n * precedence over `trigger` as the source of `triggerWidth`.\n */\n widthEl?: HTMLElement;\n\n menuId = guidFor(this);\n\n /**\n * Whether the consumer is still owed a `@didClose`. Set by `close()` when a\n * popover that was actually open was closed, and cleared either by `didClose`\n * once it has fired the callback -- so it can only ever fire once per close --\n * or by `open()`, which means the close it was armed for never completed.\n */\n isDidClosePending = false;\n\n @tracked _isOpen = false;\n @tracked isClosing = false;\n @tracked preventFocusRestore = false;\n\n /**\n * Whether a `trigger` is installed in hover mode. Hover popovers must not\n * take focus -- `Overlay` focuses its content when the focus trap is\n * disabled, which for a hover popover means the pointer silently moves focus\n * and scrolls the content into view.\n */\n @tracked isHoverTrigger = false;\n @tracked triggerWidth?: number;\n\n /**\n * The arrow element, once `Content` has rendered one. Tracked because the\n * middleware array is derived from it -- `Velcro` re-runs when the array\n * identity changes, so the arrow is picked up whenever it appears, in either\n * render order.\n */\n @tracked arrowEl?: HTMLElement;\n\n registerArrow = modifier((el: HTMLElement) => {\n this.arrowEl = el;\n\n return () => {\n if (this.arrowEl === el) {\n this.arrowEl = undefined;\n }\n };\n });\n\n /**\n * `@cached` is load-bearing, not decorative: without it this getter would\n * build a brand-new array (and a brand-new `arrowMiddleware(...)` instance)\n * on every access. `{{this.middleware}}` sits in the same template block\n * that yields `velcro.data`, so a `Velcro`-driven position update re-renders\n * that block, which re-invokes the getter -- an unmemoized array would read\n * to `Velcro` as changed middleware and retrigger positioning, looping\n * forever. Caching keeps the array's identity stable across re-renders that\n * don't touch `this.args.middleware` or `this.arrowEl`, while still\n * producing a new array when either of those tracked dependencies changes\n * (e.g. when the arrow element first appears).\n */\n @cached\n get middleware(): VelcroSignature['Args']['Named']['middleware'] {\n const consumer = this.args.middleware ?? [];\n\n if (!this.arrowEl) {\n return this.args.middleware;\n }\n\n // `padding` keeps the arrow off the content's rounded corners, where it\n // would poke out past the radius.\n return [\n ...consumer,\n arrowMiddleware({ element: this.arrowEl, padding: 4 })\n ];\n }\n\n get isOpen(): boolean {\n if (\n typeof this.args.isOpen !== 'undefined' &&\n typeof this.args.onOpenChange === 'function'\n ) {\n return this.args.isOpen;\n }\n\n return this._isOpen;\n }\n\n toggle = (event?: Event) => {\n // stops event bubbling to prevent parent click event\n if (typeof event?.stopPropagation === 'function') {\n event.stopPropagation();\n }\n\n if (this.isOpen) {\n this.close();\n } else {\n this.open();\n }\n };\n\n open = () => {\n if (this.isClosing) {\n return;\n }\n\n // Opening settles any close that never finished. In controlled mode\n // `close()` only *asks* -- it calls `onOpenChange(false)` and the consumer\n // decides -- so a consumer that declines leaves the content mounted with\n // the callback still owed. Nothing clears that but `didClose`, which never\n // runs while the content stays up, so without this the debt would sit armed\n // and be paid out by whatever unrelated teardown came next.\n this.isDidClosePending = false;\n\n if (typeof this.args.onOpenChange === 'function') {\n this.args.onOpenChange(true);\n } else {\n this._isOpen = true;\n }\n };\n\n close = () => {\n // Only a popover that was actually open has a close to finish, and so a\n // `@didClose` to owe. `close()` is reachable with nothing open -- a stray\n // `mouseleave`, a consumer calling the yielded `close` -- and firing the\n // callback for those would be a lie.\n const wasOpen = this.isOpen;\n\n this.isClosing = true;\n if (typeof this.args.onOpenChange === 'function') {\n this.args.onOpenChange(false);\n } else {\n this._isOpen = false;\n }\n\n if (wasOpen) {\n this.isDidClosePending = true;\n }\n\n debounce(this, this.resetIsClosing, 90);\n };\n\n /**\n * The single pending hover intent, or `undefined`. One field rather than two\n * debounces: `debounce` keys on the target/method pair, so debouncing\n * `open` from `mouseenter` and `close` from `mouseleave` left the two unable\n * to cancel each other -- a leave-then-re-enter inside the window queued\n * both, and the close won.\n *\n * Scheduled with `@ember/runloop`'s `later`/`cancel`, like the rest of this\n * codebase (`-private/timer.ts`, `control-blur.ts`, `-private/manager.ts`,\n * `utils/listManager.ts`, `resetIsClosing` below), rather than a raw\n * `setTimeout`/`clearTimeout`. Run-loop tracking is what makes `settled()`\n * -- and so `await triggerEvent(...)`/`await click(...)` in\n * `@ember/test-helpers` -- wait out a pending hover open or close, the same\n * way every other timed transition in this component already does. Tests\n * that need to prove a pending close gets cancelled by a second event\n * (e.g. the pointer arriving on the content) dispatch the raw DOM events\n * directly and `await settled()` once afterward, instead of relying on\n * `await triggerEvent(...)`'s auto-wait -- see the \"hover: leaving and\n * re-entering\" tests below.\n */\n hoverTimer?: { id: EmberTimer; intent: 'open' | 'close' };\n\n get openDelay(): number {\n return typeof this.args.openDelay === 'number' ? this.args.openDelay : 100;\n }\n\n get closeDelay(): number {\n return typeof this.args.closeDelay === 'number'\n ? this.args.closeDelay\n : 100;\n }\n\n clearHoverTimer = () => {\n if (this.hoverTimer) {\n cancel(this.hoverTimer.id);\n this.hoverTimer = undefined;\n }\n };\n\n scheduleOpen = () => {\n this.clearHoverTimer();\n\n if (this.isOpen) {\n return;\n }\n\n const run = () => {\n this.hoverTimer = undefined;\n if (this.isDestroyed || this.isDestroying) return;\n // A hover open is never part of the click cascade `isClosing` guards\n // against, so it must not be gated by it -- that gate is what swallowed\n // opens on an adjacent trigger.\n this.isClosing = false;\n this.open();\n };\n\n if (this.openDelay === 0) {\n run();\n return;\n }\n\n this.hoverTimer = { id: later(run, this.openDelay), intent: 'open' };\n };\n\n scheduleClose = () => {\n this.clearHoverTimer();\n\n if (!this.isOpen) {\n return;\n }\n\n const run = () => {\n this.hoverTimer = undefined;\n if (this.isDestroyed || this.isDestroying) return;\n this.close();\n };\n\n if (this.closeDelay === 0) {\n run();\n return;\n }\n\n this.hoverTimer = { id: later(run, this.closeDelay), intent: 'close' };\n };\n\n /**\n * `Escape` must close a hover popover (WCAG 1.4.13), but in hover mode focus\n * is typically nowhere near the trigger, so a trigger-level `keydown` would\n * never see the key. Installed on the document while open in hover mode.\n */\n escapeListener?: (event: KeyboardEvent) => void;\n\n setupEscapeListener = () => {\n if (this.escapeListener) return;\n\n this.escapeListener = (event: KeyboardEvent) => {\n if (event.key === 'Escape' && this.isOpen) {\n this.clearHoverTimer();\n this.close();\n }\n };\n\n document.addEventListener('keydown', this.escapeListener);\n };\n\n teardownEscapeListener = () => {\n if (this.escapeListener) {\n document.removeEventListener('keydown', this.escapeListener);\n this.escapeListener = undefined;\n }\n };\n\n willDestroy(): void {\n super.willDestroy();\n this.clearHoverTimer();\n this.teardownEscapeListener();\n }\n\n trigger = modifier(\n (\n el: HTMLElement,\n [eventType]: [eventType?: 'click' | 'hover'],\n { aria }: { aria?: 'menu' | 'describedby' | 'none' } = {}\n ) => {\n // The trigger is only the width reference when nothing more specific was\n // nominated. `widthEl` is checked when the measurement happens rather than\n // when the modifier installs, so the two modifiers can install in either\n // order.\n requestAnimationFrame(() => {\n if (!this.widthEl) {\n this.triggerWidth = Math.round(el.offsetWidth);\n }\n });\n\n let observer: ResizeObserver;\n if (eventType !== 'hover') {\n observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (this.widthEl) {\n continue;\n }\n this.triggerWidth = Math.round(\n (entry.target as HTMLElement).offsetWidth\n );\n }\n });\n observer.observe(el);\n }\n\n const onFocusIn = () => {\n if (el.matches(':focus-visible')) {\n this.scheduleOpen();\n }\n };\n\n const onKeydown = (event: KeyboardEvent) => {\n if (!hasKey(event)) return;\n\n if (this.isOpen && event.key === 'Escape') {\n this.close();\n event.stopPropagation();\n }\n if (\n !this.isOpen &&\n (event.key === 'ArrowDown' || event.key === 'ArrowUp')\n ) {\n this.open();\n event.stopPropagation();\n }\n\n if (this.isOpen && event.key === 'Tab') {\n this.preventFocusRestore = true;\n this.close();\n }\n\n // Open when a letter is pressed, so the content can be typed into.\n // Modifier combos belong to the browser or the OS (Cmd+R, Ctrl+F,\n // Alt+C) and still deliver a letter `key`, so without this check the\n // popover would pop open over whatever the shortcut does. Shift stays\n // allowed: a capital letter is legitimate type-ahead.\n if (\n !this.isOpen &&\n !event.metaKey &&\n !event.ctrlKey &&\n !event.altKey &&\n event.code === `Key${event.key.toUpperCase()}`\n ) {\n this.open();\n }\n };\n\n if (eventType === 'hover') {\n this.preventFocusRestore = true;\n this.isHoverTrigger = true;\n // The modifier body re-runs on every open/close (it reads\n // `this.isOpen` below to keep whichever ARIA attribute the trigger's\n // `aria` mode owns in sync -- `aria-expanded` in `'menu'` mode,\n // `aria-describedby` in `'describedby'` mode), and the returned\n // cleanup below always tears the listener down first -- so gating\n // the install on `isOpen` here is what keeps the document listener\n // attached only while open, matching the doc comment on\n // `escapeListener`.\n if (this.isOpen) {\n this.setupEscapeListener();\n }\n\n el.addEventListener('mouseenter', this.scheduleOpen);\n el.addEventListener('mouseleave', this.scheduleClose);\n // Keyboard-only: a mouse click also fires `focusin`, and opening on\n // that would leave content up after the pointer had already left.\n el.addEventListener('focusin', onFocusIn);\n el.addEventListener('focusout', this.scheduleClose);\n } else {\n el.addEventListener('keydown', onKeydown);\n el.addEventListener('click', this.toggle);\n }\n\n // Reading `this.isOpen` here is what keeps these attributes in sync: the\n // modifier consumes the tracked state, so its whole body re-runs on every\n // open and close. That is more work than an attribute needs -- the\n // listeners are rebuilt too -- but it is the only mechanism that covers\n // `@isOpen` being flipped from outside in controlled mode, which an\n // imperative update from `open()`/`close()` would miss.\n const ariaMode = aria ?? 'menu';\n\n if (ariaMode === 'menu') {\n el.setAttribute('aria-haspopup', 'true');\n el.setAttribute('aria-controls', this.menuId);\n el.setAttribute('aria-expanded', this.isOpen.toString());\n } else if (ariaMode === 'describedby') {\n // A tooltip is its trigger's description, not a popup it owns. The\n // attribute only exists while there is something to describe --\n // pointing at an unrendered id is worse than pointing at nothing.\n if (this.isOpen) {\n el.setAttribute('aria-describedby', this.menuId);\n } else {\n el.removeAttribute('aria-describedby');\n }\n }\n\n return () => {\n if (eventType === 'hover') {\n this.isHoverTrigger = false;\n this.clearHoverTimer();\n this.teardownEscapeListener();\n el.removeEventListener('mouseenter', this.scheduleOpen);\n el.removeEventListener('mouseleave', this.scheduleClose);\n el.removeEventListener('focusin', onFocusIn);\n el.removeEventListener('focusout', this.scheduleClose);\n } else {\n el.removeEventListener('click', this.toggle);\n el.removeEventListener('keydown', onKeydown);\n }\n if (observer) {\n observer.disconnect();\n }\n };\n }\n );\n\n /**\n * Nominates the element it is placed on as the popover's width reference,\n * instead of the element carrying `trigger`.\n *\n * `@size=\"trigger\"` content is sized from `--trigger-width`, which is normally\n * the trigger's own width. That is only right while the toggle and the box the\n * content should line up with are the same element. When they are not -- a\n * field whose trigger is one of several things inside it, say -- put this on\n * the element the content should match.\n *\n * It takes precedence over `trigger`'s own measurement for as long as it is\n * installed, so the two never race.\n */\n measureWidth = modifier((el: HTMLElement) => {\n this.widthEl = el;\n\n requestAnimationFrame(() => {\n if (this.widthEl === el) {\n this.triggerWidth = Math.round(el.offsetWidth);\n }\n });\n\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (this.widthEl !== el) {\n continue;\n }\n this.triggerWidth = Math.round(\n (entry.target as HTMLElement).offsetWidth\n );\n }\n });\n observer.observe(el);\n\n return () => {\n observer.disconnect();\n if (this.widthEl === el) {\n this.widthEl = undefined;\n }\n };\n });\n\n /**\n * Clears the short window during which `open()` refuses to re-open.\n *\n * The 90ms this is debounced by is deliberately unrelated to the transition\n * duration (the default `scale` transition runs 200ms in and 100ms out):\n * the window exists to absorb a single event cascade -- the Overlay's\n * outside-click handler closing while the trigger's own click handler is\n * about to re-open -- not to wait for the animation out. Stretching it to the\n * transition would leave the trigger feeling dead for a fifth of a second\n * after every close, which is far more noticeable than a re-click inside 90ms\n * being dropped.\n */\n resetIsClosing = () => {\n if (!this.isDestroyed && !this.isDestroying) {\n this.isClosing = false;\n }\n };\n\n /**\n * Passed to `Content` as `internalDidClose`, so it runs once the Overlay has\n * finished tearing down -- that is, after the exit transition. That is the\n * moment `@didClose` documents, which is why the consumer's callback is fired\n * from here and not from `close()`.\n *\n * A popover whose `Content` never mounted never gets here, and never owes the\n * callback: there was no overlay, so there was no close to finish.\n */\n didClose = () => {\n this.resetIsClosing();\n\n if (this.isDidClosePending) {\n this.isDidClosePending = false;\n\n if (typeof this.args.didClose === 'function') {\n this.args.didClose();\n }\n }\n };\n\n <template>\n <Velcro\n @placement={{if @placement @placement \"bottom-start\"}}\n @strategy={{if @strategy @strategy \"absolute\"}}\n @offsetOptions={{if @offsetOptions @offsetOptions 5}}\n @flipOptions={{@flipOptions}}\n @middleware={{this.middleware}}\n @shiftOptions={{@shiftOptions}}\n as |velcro|\n >\n {{yield\n (hash\n anchor=velcro.hook\n measureWidth=this.measureWidth\n isOpen=this.isOpen\n open=this.open\n close=this.close\n toggle=this.toggle\n trigger=this.trigger\n data=velcro.data\n Content=(component\n Content\n id=this.menuId\n loop=velcro.loop\n isOpen=this.isOpen\n toggle=this.toggle\n internalDidClose=this.didClose\n preventFocusRestore=this.preventFocusRestore\n preventAutoFocus=this.isHoverTrigger\n triggerWidth=this.triggerWidth\n isHoverTrigger=this.isHoverTrigger\n onContentHoverStart=this.clearHoverTimer\n onContentHoverEnd=this.scheduleClose\n registerArrow=this.registerArrow\n velcroData=velcro.data\n )\n )\n }}\n </Velcro>\n </template>\n}\n\ninterface ContentArgs extends Pick<\n OverlaySignature['Args'],\n | 'onOpen'\n | 'didClose'\n | 'renderInPlace'\n | 'target'\n | 'transitionDuration'\n | 'backdrop'\n | 'disableTransitions'\n | 'focusTrapOptions'\n | 'closeOnOutsideClick'\n | 'closeOnEscapeKey'\n | 'backdropTransition'\n | 'blockScroll'\n | 'preventAutoFocus'\n> {\n /**\n * @internal\n */\n loop: ModifierLike<{ Element: HTMLElement }>;\n /**\n * @internal\n */\n isOpen: boolean;\n\n /**\n * @internal\n */\n toggle: () => void;\n\n /**\n * @ignore\n */\n internalDidClose: () => void;\n\n /**\n * @internal\n */\n id: string;\n\n /**\n * @internal\n */\n preventFocusRestore?: boolean;\n\n /**\n * @internal\n */\n triggerWidth?: number;\n\n /**\n * @internal\n */\n isHoverTrigger?: boolean;\n\n /**\n * @internal\n */\n onContentHoverStart?: () => void;\n\n /**\n * @internal\n */\n onContentHoverEnd?: () => void;\n\n /**\n * Renders an arrow pointing at the anchor.\n *\n * @defaultValue false\n */\n arrow?: boolean;\n\n /**\n * @internal\n */\n registerArrow?: ModifierLike<{ Element: HTMLElement }>;\n\n /**\n * @internal\n * Additional classes for the arrow element, merged with `overlayArrow`'s\n * defaults via Tailwind Merge. Lets a consumer that composes `Content`\n * (e.g. `Tooltip`) give the arrow an intent-specific border; not meant as\n * public `Popover` API.\n */\n arrowClass?: string;\n\n /**\n * @internal\n */\n velcroData?: MiddlewareArguments;\n\n /**\n * Closes as soon as the pointer leaves the trigger, instead of letting it\n * move into the content. Only meaningful for a hover trigger.\n *\n * @defaultValue false\n */\n disableInteractive?: boolean;\n\n /**\n * Custom class name for the content element, merged with the default ones\n * using Tailwind Merge.\n */\n class?: string;\n\n /**\n * The transition to be used in the Modal.\n *\n * @defaultValue {name: 'overlay-transition--scale'}\n */\n transition?: OverlaySignature['Args']['transition'];\n\n /**\n * @defaultValue true\n */\n disableFocusTrap?: boolean;\n\n /**\n * The size of the content.\n *\n * @defaultValue 'md'\n */\n size?: 'sm' | 'md' | 'lg' | 'xl' | 'trigger' | 'auto';\n}\n\ninterface ContentSignature {\n Args: ContentArgs;\n Element: HTMLDivElement;\n Blocks: { default: [] };\n}\n\n/**\n * Component yielded from Popover\n */\nclass Content extends Component<ContentSignature> {\n get loop() {\n assert(\n 'The Popover is not properly configured; the @loop is undefined. This issue may arise from failing to set up the anchor.',\n this.args.loop\n );\n return this.args.loop;\n }\n\n get classNames() {\n const { popover } = useStyles();\n return popover({\n size: this.args.size,\n // Scoped to `@arrow`, not applied unconditionally: an unrelated\n // popover may rely on `overflow-auto` (the `overlay` tv base) to\n // scroll long content, and `@arrow` is new, so gating on it here\n // can't regress an existing popover. Without this, the arrow's\n // protruding half is clipped by that inherited `overflow-auto` --\n // see the `tooltip` theme base for the same fix, unconditional there\n // because a tooltip should never scroll.\n class: [this.args.arrow ? 'overflow-visible' : undefined, this.args.class]\n });\n }\n\n get backdrop(): OverlaySignature['Args']['backdrop'] {\n return this.args.backdrop || 'none';\n }\n\n get transition() {\n const options: OverlaySignature['Args']['transition'] = {\n name: 'overlay-transition--scale'\n };\n\n if (typeof this.args.transition === 'object') {\n return { ...options, ...this.args.transition };\n }\n\n return options;\n }\n\n get blockScroll() {\n if (typeof this.args.blockScroll !== 'undefined') {\n return this.args.blockScroll;\n }\n return false;\n }\n\n get disableFocusTrap() {\n if (this.args.disableFocusTrap === false) {\n return false;\n }\n return true;\n }\n\n didClose = () => {\n if (typeof this.args.internalDidClose === 'function') {\n this.args.internalDidClose();\n }\n\n if (typeof this.args.didClose === 'function') {\n this.args.didClose();\n }\n };\n\n updateTriggerWidth = modifier((el: HTMLDivElement) => {\n if (el && this.args.triggerWidth) {\n el.style.setProperty('--trigger-width', `${this.args.triggerWidth}px`);\n }\n });\n\n /**\n * `{{#if}}` cannot guard a modifier, so the decision lives inside it: when\n * the trigger is not in hover mode, or the consumer opted out, this installs\n * no listeners at all.\n *\n * Also tracks focus, not just the pointer: a keyboard user tabbing from the\n * trigger into a focusable element inside the content triggers the\n * trigger's own `focusout`, which unconditionally schedules a close. With\n * nothing here to cancel it, that close would fire out from under a\n * keyboard user after `closeDelay`, even though the pointer analogue --\n * moving onto the content -- keeps it open. `focusin`/`focusout` reuse the\n * same callbacks as `mouseenter`/`mouseleave` because they need to do\n * exactly the same thing: cancel or (re)schedule the one pending hover\n * intent.\n */\n trackContentHover = modifier((el: HTMLElement) => {\n if (\n this.args.isHoverTrigger !== true ||\n this.args.disableInteractive === true\n ) {\n return;\n }\n\n const enter = () => this.args.onContentHoverStart?.();\n const leave = () => this.args.onContentHoverEnd?.();\n\n el.addEventListener('mouseenter', enter);\n el.addEventListener('mouseleave', leave);\n el.addEventListener('focusin', enter);\n el.addEventListener('focusout', leave);\n\n return () => {\n el.removeEventListener('mouseenter', enter);\n el.removeEventListener('mouseleave', leave);\n el.removeEventListener('focusin', enter);\n el.removeEventListener('focusout', leave);\n };\n });\n\n get placement(): string | undefined {\n return this.args.velcroData?.placement;\n }\n\n get arrowClass(): string {\n const { overlayArrow } = useStyles();\n return overlayArrow({ class: this.args.arrowClass });\n }\n\n /**\n * Positions the arrow from the floating-ui `arrow` middleware: it supplies\n * the offset along the content's edge (`x` for a top/bottom placement, `y`\n * for left/right), and the side the arrow sits on is the one opposite the\n * resolved placement. Inline styles rather than classes -- the offset is a\n * computed pixel value that changes on every reposition.\n *\n * Also clears two of the arrow's four borders (`overlayArrow` draws all\n * four, since a rotated square has no \"outer edge\" of its own to target\n * with a class). Half the arrow sits inside the content box, half sits\n * outside pointing at the anchor; the half inside draws two border lines\n * straight across the content's fill, which reads as a stray diagonal\n * seam. Only the two edges meeting at the *outward* vertex (the one\n * pointing away from the box, at the anchor) should keep a border --\n * those are the visible \"point\" of the arrow against the page background.\n *\n * Worked out for a `rotate: 45deg` square with corners TL/TR/BR/BL: that\n * rotation carries TL to the top vertex, TR to the right vertex, BR to the\n * bottom vertex, and BL to the left vertex, so `border-top` (the TL-TR\n * edge) and `border-left` (the BL-TL edge) are the two edges meeting at\n * the *top* vertex, and so on around. Which vertex is \"outward\" depends on\n * `staticSide` (the box edge the arrow sits on): outward is the same\n * direction as `staticSide` itself (e.g. `top` placement puts the box\n * above the anchor, so the arrow sits on the box's own bottom edge and\n * points further down, toward the anchor -- the bottom vertex, made of\n * `border-right`+`border-bottom`, so the *top* vertex's\n * `border-top`+`border-left` are the ones to clear).\n */\n positionArrow = modifier((el: HTMLElement) => {\n const data = this.args.velcroData;\n const offset = data?.middlewareData?.arrow;\n const placement = data?.placement;\n\n if (!offset || !placement) {\n return;\n }\n\n const staticSides: Record<string, string> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left'\n };\n const side = placement.split('-')[0] as string;\n const staticSide = staticSides[side] ?? 'bottom';\n\n el.style.left = typeof offset.x === 'number' ? `${offset.x}px` : '';\n el.style.top = typeof offset.y === 'number' ? `${offset.y}px` : '';\n el.style.right = '';\n el.style.bottom = '';\n // Half the arrow's 8px box, so the rotated square straddles the edge.\n el.style[staticSide as 'top' | 'bottom' | 'left' | 'right'] = '-4px';\n\n type BorderWidthProp =\n | 'borderTopWidth'\n | 'borderRightWidth'\n | 'borderBottomWidth'\n | 'borderLeftWidth';\n\n // The two edges meeting at the *inward* vertex (the one poking into the\n // content box), keyed by `side` -- see the doc comment above for the\n // derivation.\n const innerBorders: Record<string, [BorderWidthProp, BorderWidthProp]> = {\n top: ['borderTopWidth', 'borderLeftWidth'],\n bottom: ['borderRightWidth', 'borderBottomWidth'],\n left: ['borderBottomWidth', 'borderLeftWidth'],\n right: ['borderTopWidth', 'borderRightWidth']\n };\n\n const allBorderProps: BorderWidthProp[] = [\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth'\n ];\n // Reset every side first: the resolved placement (and so `side`) can\n // change at runtime -- e.g. the flip middleware -- and a border cleared\n // for a previous placement must not stay cleared for the new one.\n for (const prop of allBorderProps) {\n el.style[prop] = '';\n }\n const toClear = innerBorders[side] ?? innerBorders['top'];\n for (const prop of toClear as [BorderWidthProp, BorderWidthProp]) {\n el.style[prop] = '0';\n }\n });\n\n <template>\n <Overlay\n @blockScroll={{this.blockScroll}}\n @transition={{this.transition}}\n @backdrop={{this.backdrop}}\n @customContentModifier={{this.loop}}\n @disableFlexContent={{true}}\n @isOpen={{@isOpen}}\n @onClose={{@toggle}}\n @onOpen={{@onOpen}}\n @didClose={{this.didClose}}\n @renderInPlace={{@renderInPlace}}\n @target={{@target}}\n @transitionDuration={{@transitionDuration}}\n @disableTransitions={{@disableTransitions}}\n @disableFocusTrap={{this.disableFocusTrap}}\n @focusTrapOptions={{@focusTrapOptions}}\n @closeOnOutsideClick={{@closeOnOutsideClick}}\n @closeOnEscapeKey={{@closeOnEscapeKey}}\n @backdropTransition={{@backdropTransition}}\n @class={{this.classNames}}\n @preventFocusRestore={{@preventFocusRestore}}\n @preventAutoFocus={{@preventAutoFocus}}\n @closeOnOverlayElementClick={{false}}\n id={{@id}}\n data-placement={{this.placement}}\n ...attributes\n {{this.updateTriggerWidth @triggerWidth}}\n {{this.trackContentHover @isHoverTrigger @disableInteractive}}\n >\n {{yield}}\n {{#if @arrow}}\n <span\n class={{this.arrowClass}}\n data-part=\"arrow\"\n {{@registerArrow}}\n {{! @velcroData is passed but never read by the modifier body: supplying\n it is what makes ember-modifier re-run this on every reposition.\n Remove the argument and the arrow positions once, then never moves. }}\n {{this.positionArrow @velcroData}}\n ></span>\n {{/if}}\n </Overlay>\n </template>\n}\n\nexport {\n Popover,\n Content as PopoverContent,\n type PopoverSignature,\n type ContentSignature\n};\nexport default Popover;\n"],"names":["Popover","Component","widthEl","menuId","guidFor","isDidClosePending","g","prototype","tracked","i","registerArrow","modifier","el","arrowEl","undefined","middleware","consumer","args","arrowMiddleware","element","padding","n","cached","isOpen","onOpenChange","_isOpen","toggle","event","stopPropagation","close","open","isClosing","wasOpen","debounce","resetIsClosing","hoverTimer","openDelay","closeDelay","clearHoverTimer","cancel","id","scheduleOpen","run","isDestroyed","isDestroying","later","intent","scheduleClose","escapeListener","setupEscapeListener","key","document","addEventListener","teardownEscapeListener","removeEventListener","willDestroy","trigger","eventType","aria","requestAnimationFrame","triggerWidth","Math","round","offsetWidth","observer","ResizeObserver","entries","entry","target","observe","onFocusIn","matches","onKeydown","hasKey","preventFocusRestore","metaKey","ctrlKey","altKey","code","toUpperCase","isHoverTrigger","ariaMode","setAttribute","toString","removeAttribute","disconnect","measureWidth","didClose","setComponentTemplate","precompileTemplate","strictMode","scope","Velcro","hash","Content","loop","assert","classNames","popover","useStyles","size","class","arrow","backdrop","transition","options","name","blockScroll","disableFocusTrap","internalDidClose","updateTriggerWidth","style","setProperty","trackContentHover","disableInteractive","enter","onContentHoverStart","leave","onContentHoverEnd","placement","velcroData","arrowClass","overlayArrow","positionArrow","data","offset","middlewareData","staticSides","top","bottom","left","right","side","split","staticSide","x","y","innerBorders","allBorderProps","prop","toClear","Overlay"],"mappings":";;;;;;;;;;;;;;;;AAyJA,MAAMA,gBAAgBC,SAAA,CAAU;AAC9B;;;;AAIC;EACDC;AAEAC,EAAAA,MAAA,GAASC,OAAA,CAAQ,IAAI,CAAA;AAErB;;;;;AAKC;AACDC,EAAAA,oBAAoB,KAAA;AAAM,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,SAAA,EAAA,CAEzBC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAkB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,QAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,SAAA,CAAA,EAAA,MAAA;AAAA,EAAA;IAAAH,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CAClBC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAoB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,UAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAA,MAAA;AAAA,EAAA;IAAAH,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,qBAAA,EAAA,CACpBC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAA8B,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,oBAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,qBAAA,CAAA,EAAA,MAAA;AAAA,EAAA;IAAAH,eAAA,CAAA,IAA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ources":["../../../src/components/overlays/popover.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { Overlay, type OverlaySignature } from './overlay';\nimport { tracked, cached } from '@glimmer/tracking';\nimport { Velcro } from 'ember-velcro';\nimport { arrow as arrowMiddleware, size } from '@floating-ui/dom';\nimport { assert } from '@ember/debug';\nimport { guidFor } from '@ember/object/internals';\nimport { hash } from '@ember/helper';\nimport { useStyles } from '@frontile/theme';\nimport { modifier } from 'ember-modifier';\nimport { debounce, later, cancel } from '@ember/runloop';\nimport type { Timer as EmberTimer } from '@ember/runloop';\nimport type { ModifierLike } from '@glint/template';\nimport type { WithBoundArgs } from '@glint/template';\nimport type { Signature as VelcroSignature } from 'ember-velcro/modifiers/velcro';\nimport type { MiddlewareArguments } from '@floating-ui/dom';\nimport { hasKey } from '../../utils/keyboard-event';\n\ninterface PopoverSignature {\n Args: {\n /**\n * Placement of the menu when open\n *\n * @defaultValue 'bottom-start'\n */\n placement?:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end';\n\n /**\n * Options for the floating-ui flip middleware, which moves the content to\n * the opposite side when it would overflow the viewport.\n */\n flipOptions?: VelcroSignature['Args']['Named']['flipOptions'];\n\n /**\n * Additional floating-ui middleware, for positioning behavior beyond what\n * `placement`, `offsetOptions`, `flipOptions`, and `shiftOptions` cover.\n */\n middleware?: VelcroSignature['Args']['Named']['middleware'];\n\n /**\n * Options for the floating-ui shift middleware, which nudges the content\n * along its axis to keep it in view.\n *\n * @defaultValue { padding: 16 }\n */\n shiftOptions?: VelcroSignature['Args']['Named']['shiftOptions'];\n\n /**\n * @defaultValue 5\n */\n offsetOptions?: VelcroSignature['Args']['Named']['offsetOptions'];\n\n /**\n * @defaultValue 'absolute'\n */\n strategy?: VelcroSignature['Args']['Named']['strategy'];\n\n /**\n * Whether the popover is open. Pair with `onOpenChange` to control it;\n * leave it unset to let the popover manage its own state.\n */\n isOpen?: boolean;\n\n /**\n * Callback when the popover opens or closes, receiving the new state.\n */\n onOpenChange?: (isOpen: boolean) => void;\n\n /**\n * Callback when closing has finished, including any exit transition.\n */\n didClose?: () => void;\n\n /**\n * Milliseconds to wait before opening on hover or keyboard focus. Only\n * applies to a `trigger` installed in hover mode.\n *\n * @defaultValue 100\n */\n openDelay?: number;\n\n /**\n * Milliseconds to wait before closing after the pointer leaves the trigger\n * or the content. Only applies to a `trigger` installed in hover mode.\n *\n * This is also the window the pointer has to cross the gap between the\n * trigger and the content, so setting it to 0 makes content hover\n * unreachable in practice.\n *\n * @defaultValue 100\n */\n closeDelay?: number;\n };\n Element: HTMLUListElement;\n Blocks: {\n default: [\n {\n anchor: ModifierLike<{ Element: HTMLElement }>;\n\n /**\n * Nominates the element it is placed on as the width reference for\n * `@size=\"trigger\"` content, instead of the element carrying `trigger`.\n */\n measureWidth: ModifierLike<{ Element: HTMLElement }>;\n isOpen: boolean;\n toggle: () => void;\n open: () => void;\n close: () => void;\n trigger: ModifierLike<{\n Element: HTMLElement;\n Args: {\n Positional: [eventType?: 'click' | 'hover'];\n Named: { aria?: 'menu' | 'describedby' | 'none' };\n };\n }>;\n\n /**\n * The floating-ui middleware data for the current position, including\n * the placement actually resolved after `flip`.\n */\n data: MiddlewareArguments;\n Content: WithBoundArgs<\n typeof Content,\n | 'loop'\n | 'isOpen'\n | 'id'\n | 'toggle'\n | 'internalDidClose'\n | 'blockScroll'\n | 'backdrop'\n | 'triggerWidth'\n | 'preventAutoFocus'\n | 'isHoverTrigger'\n | 'onContentHoverStart'\n | 'onContentHoverEnd'\n | 'registerArrow'\n | 'velcroData'\n >;\n }\n ];\n };\n}\n\n/**\n * The inset, in px, a popover keeps from the edge of the viewport. Used by the\n * default `shiftOptions` and the `size` middleware below, so the gutter is one\n * number.\n */\nconst VIEWPORT_GUTTER = 16;\n\n/**\n * Default `shiftOptions`: keeps the content a gutter away from the viewport\n * edge, so a popover that is as wide as the screen reads as an inset card\n * rather than running edge to edge. A module-level constant, not an inline\n * object, so `Velcro` sees the same identity across re-renders and doesn't\n * retrigger positioning (see the note on `middleware` below).\n */\nconst DEFAULT_SHIFT_OPTIONS = { padding: VIEWPORT_GUTTER };\n\n/**\n * Publishes the room the content has -- the viewport minus the gutter, on the\n * side it was placed -- as `--popover-available-width` and\n * `--popover-available-height`, which the `popover` theme turns into\n * `max-width` / `max-height`. Custom properties rather than inline\n * `max-*` so a `max-h-*` class from the consumer still wins, and measured by\n * floating-ui rather than written as `100vw`, which counts a classic\n * scrollbar the content can't use. Module-level for the same identity reason\n * as `DEFAULT_SHIFT_OPTIONS`.\n */\nconst availableSpace = size({\n padding: VIEWPORT_GUTTER,\n apply({ availableWidth, availableHeight, elements }) {\n const style = elements.floating.style;\n\n style.setProperty('--popover-available-width', `${availableWidth}px`);\n style.setProperty('--popover-available-height', `${availableHeight}px`);\n }\n});\n\nclass Popover extends Component<PopoverSignature> {\n /**\n * The element `measureWidth` is watching, when a consumer opts into measuring\n * something other than the trigger. Its presence is what gives `measureWidth`\n * precedence over `trigger` as the source of `triggerWidth`.\n */\n widthEl?: HTMLElement;\n\n menuId = guidFor(this);\n\n /**\n * Whether the consumer is still owed a `@didClose`. Set by `close()` when a\n * popover that was actually open was closed, and cleared either by `didClose`\n * once it has fired the callback -- so it can only ever fire once per close --\n * or by `open()`, which means the close it was armed for never completed.\n */\n isDidClosePending = false;\n\n @tracked _isOpen = false;\n @tracked isClosing = false;\n @tracked preventFocusRestore = false;\n\n /**\n * Whether a `trigger` is installed in hover mode. Hover popovers must not\n * take focus -- `Overlay` focuses its content when the focus trap is\n * disabled, which for a hover popover means the pointer silently moves focus\n * and scrolls the content into view.\n */\n @tracked isHoverTrigger = false;\n @tracked triggerWidth?: number;\n\n /**\n * The arrow element, once `Content` has rendered one. Tracked because the\n * middleware array is derived from it -- `Velcro` re-runs when the array\n * identity changes, so the arrow is picked up whenever it appears, in either\n * render order.\n */\n @tracked arrowEl?: HTMLElement;\n\n registerArrow = modifier((el: HTMLElement) => {\n this.arrowEl = el;\n\n return () => {\n if (this.arrowEl === el) {\n this.arrowEl = undefined;\n }\n };\n });\n\n /**\n * `@cached` is load-bearing, not decorative: without it this getter would\n * build a brand-new array (and a brand-new `arrowMiddleware(...)` instance)\n * on every access. `{{this.middleware}}` sits in the same template block\n * that yields `velcro.data`, so a `Velcro`-driven position update re-renders\n * that block, which re-invokes the getter -- an unmemoized array would read\n * to `Velcro` as changed middleware and retrigger positioning, looping\n * forever. Caching keeps the array's identity stable across re-renders that\n * don't touch `this.args.middleware` or `this.arrowEl`, while still\n * producing a new array when either of those tracked dependencies changes\n * (e.g. when the arrow element first appears).\n */\n @cached\n get middleware(): VelcroSignature['Args']['Named']['middleware'] {\n const consumer = this.args.middleware ?? [];\n\n if (!this.arrowEl) {\n return [...consumer, availableSpace];\n }\n\n // `padding` keeps the arrow off the content's rounded corners, where it\n // would poke out past the radius.\n return [\n ...consumer,\n availableSpace,\n arrowMiddleware({ element: this.arrowEl, padding: 4 })\n ];\n }\n\n get isOpen(): boolean {\n if (\n typeof this.args.isOpen !== 'undefined' &&\n typeof this.args.onOpenChange === 'function'\n ) {\n return this.args.isOpen;\n }\n\n return this._isOpen;\n }\n\n toggle = (event?: Event) => {\n // stops event bubbling to prevent parent click event\n if (typeof event?.stopPropagation === 'function') {\n event.stopPropagation();\n }\n\n if (this.isOpen) {\n this.close();\n } else {\n this.open();\n }\n };\n\n open = () => {\n if (this.isClosing) {\n return;\n }\n\n // Opening settles any close that never finished. In controlled mode\n // `close()` only *asks* -- it calls `onOpenChange(false)` and the consumer\n // decides -- so a consumer that declines leaves the content mounted with\n // the callback still owed. Nothing clears that but `didClose`, which never\n // runs while the content stays up, so without this the debt would sit armed\n // and be paid out by whatever unrelated teardown came next.\n this.isDidClosePending = false;\n\n if (typeof this.args.onOpenChange === 'function') {\n this.args.onOpenChange(true);\n } else {\n this._isOpen = true;\n }\n };\n\n close = () => {\n // Only a popover that was actually open has a close to finish, and so a\n // `@didClose` to owe. `close()` is reachable with nothing open -- a stray\n // `mouseleave`, a consumer calling the yielded `close` -- and firing the\n // callback for those would be a lie.\n const wasOpen = this.isOpen;\n\n this.isClosing = true;\n if (typeof this.args.onOpenChange === 'function') {\n this.args.onOpenChange(false);\n } else {\n this._isOpen = false;\n }\n\n if (wasOpen) {\n this.isDidClosePending = true;\n }\n\n debounce(this, this.resetIsClosing, 90);\n };\n\n /**\n * The single pending hover intent, or `undefined`. One field rather than two\n * debounces: `debounce` keys on the target/method pair, so debouncing\n * `open` from `mouseenter` and `close` from `mouseleave` left the two unable\n * to cancel each other -- a leave-then-re-enter inside the window queued\n * both, and the close won.\n *\n * Scheduled with `@ember/runloop`'s `later`/`cancel`, like the rest of this\n * codebase (`-private/timer.ts`, `control-blur.ts`, `-private/manager.ts`,\n * `utils/listManager.ts`, `resetIsClosing` below), rather than a raw\n * `setTimeout`/`clearTimeout`. Run-loop tracking is what makes `settled()`\n * -- and so `await triggerEvent(...)`/`await click(...)` in\n * `@ember/test-helpers` -- wait out a pending hover open or close, the same\n * way every other timed transition in this component already does. Tests\n * that need to prove a pending close gets cancelled by a second event\n * (e.g. the pointer arriving on the content) dispatch the raw DOM events\n * directly and `await settled()` once afterward, instead of relying on\n * `await triggerEvent(...)`'s auto-wait -- see the \"hover: leaving and\n * re-entering\" tests below.\n */\n hoverTimer?: { id: EmberTimer; intent: 'open' | 'close' };\n\n get openDelay(): number {\n return typeof this.args.openDelay === 'number' ? this.args.openDelay : 100;\n }\n\n get closeDelay(): number {\n return typeof this.args.closeDelay === 'number'\n ? this.args.closeDelay\n : 100;\n }\n\n clearHoverTimer = () => {\n if (this.hoverTimer) {\n cancel(this.hoverTimer.id);\n this.hoverTimer = undefined;\n }\n };\n\n scheduleOpen = () => {\n this.clearHoverTimer();\n\n if (this.isOpen) {\n return;\n }\n\n const run = () => {\n this.hoverTimer = undefined;\n if (this.isDestroyed || this.isDestroying) return;\n // A hover open is never part of the click cascade `isClosing` guards\n // against, so it must not be gated by it -- that gate is what swallowed\n // opens on an adjacent trigger.\n this.isClosing = false;\n this.open();\n };\n\n if (this.openDelay === 0) {\n run();\n return;\n }\n\n this.hoverTimer = { id: later(run, this.openDelay), intent: 'open' };\n };\n\n scheduleClose = () => {\n this.clearHoverTimer();\n\n if (!this.isOpen) {\n return;\n }\n\n const run = () => {\n this.hoverTimer = undefined;\n if (this.isDestroyed || this.isDestroying) return;\n this.close();\n };\n\n if (this.closeDelay === 0) {\n run();\n return;\n }\n\n this.hoverTimer = { id: later(run, this.closeDelay), intent: 'close' };\n };\n\n /**\n * `Escape` must close a hover popover (WCAG 1.4.13), but in hover mode focus\n * is typically nowhere near the trigger, so a trigger-level `keydown` would\n * never see the key. Installed on the document while open in hover mode.\n */\n escapeListener?: (event: KeyboardEvent) => void;\n\n setupEscapeListener = () => {\n if (this.escapeListener) return;\n\n this.escapeListener = (event: KeyboardEvent) => {\n if (event.key === 'Escape' && this.isOpen) {\n this.clearHoverTimer();\n this.close();\n }\n };\n\n document.addEventListener('keydown', this.escapeListener);\n };\n\n teardownEscapeListener = () => {\n if (this.escapeListener) {\n document.removeEventListener('keydown', this.escapeListener);\n this.escapeListener = undefined;\n }\n };\n\n willDestroy(): void {\n super.willDestroy();\n this.clearHoverTimer();\n this.teardownEscapeListener();\n }\n\n trigger = modifier(\n (\n el: HTMLElement,\n [eventType]: [eventType?: 'click' | 'hover'],\n { aria }: { aria?: 'menu' | 'describedby' | 'none' } = {}\n ) => {\n // The trigger is only the width reference when nothing more specific was\n // nominated. `widthEl` is checked when the measurement happens rather than\n // when the modifier installs, so the two modifiers can install in either\n // order.\n requestAnimationFrame(() => {\n if (!this.widthEl) {\n this.triggerWidth = Math.round(el.offsetWidth);\n }\n });\n\n let observer: ResizeObserver;\n if (eventType !== 'hover') {\n observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (this.widthEl) {\n continue;\n }\n this.triggerWidth = Math.round(\n (entry.target as HTMLElement).offsetWidth\n );\n }\n });\n observer.observe(el);\n }\n\n const onFocusIn = () => {\n if (el.matches(':focus-visible')) {\n this.scheduleOpen();\n }\n };\n\n const onKeydown = (event: KeyboardEvent) => {\n if (!hasKey(event)) return;\n\n if (this.isOpen && event.key === 'Escape') {\n this.close();\n event.stopPropagation();\n }\n if (\n !this.isOpen &&\n (event.key === 'ArrowDown' || event.key === 'ArrowUp')\n ) {\n this.open();\n event.stopPropagation();\n }\n\n if (this.isOpen && event.key === 'Tab') {\n this.preventFocusRestore = true;\n this.close();\n }\n\n // Open when a letter is pressed, so the content can be typed into.\n // Modifier combos belong to the browser or the OS (Cmd+R, Ctrl+F,\n // Alt+C) and still deliver a letter `key`, so without this check the\n // popover would pop open over whatever the shortcut does. Shift stays\n // allowed: a capital letter is legitimate type-ahead.\n if (\n !this.isOpen &&\n !event.metaKey &&\n !event.ctrlKey &&\n !event.altKey &&\n event.code === `Key${event.key.toUpperCase()}`\n ) {\n this.open();\n }\n };\n\n if (eventType === 'hover') {\n this.preventFocusRestore = true;\n this.isHoverTrigger = true;\n // The modifier body re-runs on every open/close (it reads\n // `this.isOpen` below to keep whichever ARIA attribute the trigger's\n // `aria` mode owns in sync -- `aria-expanded` in `'menu'` mode,\n // `aria-describedby` in `'describedby'` mode), and the returned\n // cleanup below always tears the listener down first -- so gating\n // the install on `isOpen` here is what keeps the document listener\n // attached only while open, matching the doc comment on\n // `escapeListener`.\n if (this.isOpen) {\n this.setupEscapeListener();\n }\n\n el.addEventListener('mouseenter', this.scheduleOpen);\n el.addEventListener('mouseleave', this.scheduleClose);\n // Keyboard-only: a mouse click also fires `focusin`, and opening on\n // that would leave content up after the pointer had already left.\n el.addEventListener('focusin', onFocusIn);\n el.addEventListener('focusout', this.scheduleClose);\n } else {\n el.addEventListener('keydown', onKeydown);\n el.addEventListener('click', this.toggle);\n }\n\n // Reading `this.isOpen` here is what keeps these attributes in sync: the\n // modifier consumes the tracked state, so its whole body re-runs on every\n // open and close. That is more work than an attribute needs -- the\n // listeners are rebuilt too -- but it is the only mechanism that covers\n // `@isOpen` being flipped from outside in controlled mode, which an\n // imperative update from `open()`/`close()` would miss.\n const ariaMode = aria ?? 'menu';\n\n if (ariaMode === 'menu') {\n el.setAttribute('aria-haspopup', 'true');\n el.setAttribute('aria-controls', this.menuId);\n el.setAttribute('aria-expanded', this.isOpen.toString());\n } else if (ariaMode === 'describedby') {\n // A tooltip is its trigger's description, not a popup it owns. The\n // attribute only exists while there is something to describe --\n // pointing at an unrendered id is worse than pointing at nothing.\n if (this.isOpen) {\n el.setAttribute('aria-describedby', this.menuId);\n } else {\n el.removeAttribute('aria-describedby');\n }\n }\n\n return () => {\n if (eventType === 'hover') {\n this.isHoverTrigger = false;\n this.clearHoverTimer();\n this.teardownEscapeListener();\n el.removeEventListener('mouseenter', this.scheduleOpen);\n el.removeEventListener('mouseleave', this.scheduleClose);\n el.removeEventListener('focusin', onFocusIn);\n el.removeEventListener('focusout', this.scheduleClose);\n } else {\n el.removeEventListener('click', this.toggle);\n el.removeEventListener('keydown', onKeydown);\n }\n if (observer) {\n observer.disconnect();\n }\n };\n }\n );\n\n /**\n * Nominates the element it is placed on as the popover's width reference,\n * instead of the element carrying `trigger`.\n *\n * `@size=\"trigger\"` content is sized from `--trigger-width`, which is normally\n * the trigger's own width. That is only right while the toggle and the box the\n * content should line up with are the same element. When they are not -- a\n * field whose trigger is one of several things inside it, say -- put this on\n * the element the content should match.\n *\n * It takes precedence over `trigger`'s own measurement for as long as it is\n * installed, so the two never race.\n */\n measureWidth = modifier((el: HTMLElement) => {\n this.widthEl = el;\n\n requestAnimationFrame(() => {\n if (this.widthEl === el) {\n this.triggerWidth = Math.round(el.offsetWidth);\n }\n });\n\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (this.widthEl !== el) {\n continue;\n }\n this.triggerWidth = Math.round(\n (entry.target as HTMLElement).offsetWidth\n );\n }\n });\n observer.observe(el);\n\n return () => {\n observer.disconnect();\n if (this.widthEl === el) {\n this.widthEl = undefined;\n }\n };\n });\n\n /**\n * Clears the short window during which `open()` refuses to re-open.\n *\n * The 90ms this is debounced by is deliberately unrelated to the transition\n * duration (the default `scale` transition runs 200ms in and 100ms out):\n * the window exists to absorb a single event cascade -- the Overlay's\n * outside-click handler closing while the trigger's own click handler is\n * about to re-open -- not to wait for the animation out. Stretching it to the\n * transition would leave the trigger feeling dead for a fifth of a second\n * after every close, which is far more noticeable than a re-click inside 90ms\n * being dropped.\n */\n resetIsClosing = () => {\n if (!this.isDestroyed && !this.isDestroying) {\n this.isClosing = false;\n }\n };\n\n /**\n * Passed to `Content` as `internalDidClose`, so it runs once the Overlay has\n * finished tearing down -- that is, after the exit transition. That is the\n * moment `@didClose` documents, which is why the consumer's callback is fired\n * from here and not from `close()`.\n *\n * A popover whose `Content` never mounted never gets here, and never owes the\n * callback: there was no overlay, so there was no close to finish.\n */\n didClose = () => {\n this.resetIsClosing();\n\n if (this.isDidClosePending) {\n this.isDidClosePending = false;\n\n if (typeof this.args.didClose === 'function') {\n this.args.didClose();\n }\n }\n };\n\n <template>\n <Velcro\n @placement={{if @placement @placement \"bottom-start\"}}\n @strategy={{if @strategy @strategy \"absolute\"}}\n @offsetOptions={{if @offsetOptions @offsetOptions 5}}\n @flipOptions={{@flipOptions}}\n @middleware={{this.middleware}}\n @shiftOptions={{if @shiftOptions @shiftOptions DEFAULT_SHIFT_OPTIONS}}\n as |velcro|\n >\n {{yield\n (hash\n anchor=velcro.hook\n measureWidth=this.measureWidth\n isOpen=this.isOpen\n open=this.open\n close=this.close\n toggle=this.toggle\n trigger=this.trigger\n data=velcro.data\n Content=(component\n Content\n id=this.menuId\n loop=velcro.loop\n isOpen=this.isOpen\n toggle=this.toggle\n internalDidClose=this.didClose\n preventFocusRestore=this.preventFocusRestore\n preventAutoFocus=this.isHoverTrigger\n triggerWidth=this.triggerWidth\n isHoverTrigger=this.isHoverTrigger\n onContentHoverStart=this.clearHoverTimer\n onContentHoverEnd=this.scheduleClose\n registerArrow=this.registerArrow\n velcroData=velcro.data\n )\n )\n }}\n </Velcro>\n </template>\n}\n\ninterface ContentArgs extends Pick<\n OverlaySignature['Args'],\n | 'onOpen'\n | 'didClose'\n | 'renderInPlace'\n | 'target'\n | 'transitionDuration'\n | 'backdrop'\n | 'disableTransitions'\n | 'focusTrapOptions'\n | 'closeOnOutsideClick'\n | 'closeOnEscapeKey'\n | 'backdropTransition'\n | 'blockScroll'\n | 'preventAutoFocus'\n> {\n /**\n * @internal\n */\n loop: ModifierLike<{ Element: HTMLElement }>;\n /**\n * @internal\n */\n isOpen: boolean;\n\n /**\n * @internal\n */\n toggle: () => void;\n\n /**\n * @ignore\n */\n internalDidClose: () => void;\n\n /**\n * @internal\n */\n id: string;\n\n /**\n * @internal\n */\n preventFocusRestore?: boolean;\n\n /**\n * @internal\n */\n triggerWidth?: number;\n\n /**\n * @internal\n */\n isHoverTrigger?: boolean;\n\n /**\n * @internal\n */\n onContentHoverStart?: () => void;\n\n /**\n * @internal\n */\n onContentHoverEnd?: () => void;\n\n /**\n * Renders an arrow pointing at the anchor.\n *\n * @defaultValue false\n */\n arrow?: boolean;\n\n /**\n * @internal\n */\n registerArrow?: ModifierLike<{ Element: HTMLElement }>;\n\n /**\n * @internal\n * Additional classes for the arrow element, merged with `overlayArrow`'s\n * defaults via Tailwind Merge. Lets a consumer that composes `Content`\n * (e.g. `Tooltip`) give the arrow an intent-specific border; not meant as\n * public `Popover` API.\n */\n arrowClass?: string;\n\n /**\n * @internal\n */\n velcroData?: MiddlewareArguments;\n\n /**\n * Closes as soon as the pointer leaves the trigger, instead of letting it\n * move into the content. Only meaningful for a hover trigger.\n *\n * @defaultValue false\n */\n disableInteractive?: boolean;\n\n /**\n * Custom class name for the content element, merged with the default ones\n * using Tailwind Merge.\n */\n class?: string;\n\n /**\n * The transition to be used in the Modal.\n *\n * @defaultValue {name: 'overlay-transition--scale'}\n */\n transition?: OverlaySignature['Args']['transition'];\n\n /**\n * @defaultValue true\n */\n disableFocusTrap?: boolean;\n\n /**\n * The size of the content.\n *\n * @defaultValue 'md'\n */\n size?: 'sm' | 'md' | 'lg' | 'xl' | 'trigger' | 'auto';\n}\n\ninterface ContentSignature {\n Args: ContentArgs;\n Element: HTMLDivElement;\n Blocks: { default: [] };\n}\n\n/**\n * Component yielded from Popover\n */\nclass Content extends Component<ContentSignature> {\n get loop() {\n assert(\n 'The Popover is not properly configured; the @loop is undefined. This issue may arise from failing to set up the anchor.',\n this.args.loop\n );\n return this.args.loop;\n }\n\n get classNames() {\n const { popover } = useStyles();\n return popover({\n size: this.args.size,\n // Scoped to `@arrow`, not applied unconditionally: an unrelated\n // popover may rely on `overflow-auto` (the `overlay` tv base) to\n // scroll long content, and `@arrow` is new, so gating on it here\n // can't regress an existing popover. Without this, the arrow's\n // protruding half is clipped by that inherited `overflow-auto` --\n // see the `tooltip` theme base for the same fix, unconditional there\n // because a tooltip should never scroll.\n class: [this.args.arrow ? 'overflow-visible' : undefined, this.args.class]\n });\n }\n\n get backdrop(): OverlaySignature['Args']['backdrop'] {\n return this.args.backdrop || 'none';\n }\n\n get transition() {\n const options: OverlaySignature['Args']['transition'] = {\n name: 'overlay-transition--scale'\n };\n\n if (typeof this.args.transition === 'object') {\n return { ...options, ...this.args.transition };\n }\n\n return options;\n }\n\n get blockScroll() {\n if (typeof this.args.blockScroll !== 'undefined') {\n return this.args.blockScroll;\n }\n return false;\n }\n\n get disableFocusTrap() {\n if (this.args.disableFocusTrap === false) {\n return false;\n }\n return true;\n }\n\n didClose = () => {\n if (typeof this.args.internalDidClose === 'function') {\n this.args.internalDidClose();\n }\n\n if (typeof this.args.didClose === 'function') {\n this.args.didClose();\n }\n };\n\n updateTriggerWidth = modifier((el: HTMLDivElement) => {\n if (el && this.args.triggerWidth) {\n el.style.setProperty('--trigger-width', `${this.args.triggerWidth}px`);\n }\n });\n\n /**\n * `{{#if}}` cannot guard a modifier, so the decision lives inside it: when\n * the trigger is not in hover mode, or the consumer opted out, this installs\n * no listeners at all.\n *\n * Also tracks focus, not just the pointer: a keyboard user tabbing from the\n * trigger into a focusable element inside the content triggers the\n * trigger's own `focusout`, which unconditionally schedules a close. With\n * nothing here to cancel it, that close would fire out from under a\n * keyboard user after `closeDelay`, even though the pointer analogue --\n * moving onto the content -- keeps it open. `focusin`/`focusout` reuse the\n * same callbacks as `mouseenter`/`mouseleave` because they need to do\n * exactly the same thing: cancel or (re)schedule the one pending hover\n * intent.\n */\n trackContentHover = modifier((el: HTMLElement) => {\n if (\n this.args.isHoverTrigger !== true ||\n this.args.disableInteractive === true\n ) {\n return;\n }\n\n const enter = () => this.args.onContentHoverStart?.();\n const leave = () => this.args.onContentHoverEnd?.();\n\n el.addEventListener('mouseenter', enter);\n el.addEventListener('mouseleave', leave);\n el.addEventListener('focusin', enter);\n el.addEventListener('focusout', leave);\n\n return () => {\n el.removeEventListener('mouseenter', enter);\n el.removeEventListener('mouseleave', leave);\n el.removeEventListener('focusin', enter);\n el.removeEventListener('focusout', leave);\n };\n });\n\n get placement(): string | undefined {\n return this.args.velcroData?.placement;\n }\n\n get arrowClass(): string {\n const { overlayArrow } = useStyles();\n return overlayArrow({ class: this.args.arrowClass });\n }\n\n /**\n * Positions the arrow from the floating-ui `arrow` middleware: it supplies\n * the offset along the content's edge (`x` for a top/bottom placement, `y`\n * for left/right), and the side the arrow sits on is the one opposite the\n * resolved placement. Inline styles rather than classes -- the offset is a\n * computed pixel value that changes on every reposition.\n *\n * Also clears two of the arrow's four borders (`overlayArrow` draws all\n * four, since a rotated square has no \"outer edge\" of its own to target\n * with a class). Half the arrow sits inside the content box, half sits\n * outside pointing at the anchor; the half inside draws two border lines\n * straight across the content's fill, which reads as a stray diagonal\n * seam. Only the two edges meeting at the *outward* vertex (the one\n * pointing away from the box, at the anchor) should keep a border --\n * those are the visible \"point\" of the arrow against the page background.\n *\n * Worked out for a `rotate: 45deg` square with corners TL/TR/BR/BL: that\n * rotation carries TL to the top vertex, TR to the right vertex, BR to the\n * bottom vertex, and BL to the left vertex, so `border-top` (the TL-TR\n * edge) and `border-left` (the BL-TL edge) are the two edges meeting at\n * the *top* vertex, and so on around. Which vertex is \"outward\" depends on\n * `staticSide` (the box edge the arrow sits on): outward is the same\n * direction as `staticSide` itself (e.g. `top` placement puts the box\n * above the anchor, so the arrow sits on the box's own bottom edge and\n * points further down, toward the anchor -- the bottom vertex, made of\n * `border-right`+`border-bottom`, so the *top* vertex's\n * `border-top`+`border-left` are the ones to clear).\n */\n positionArrow = modifier((el: HTMLElement) => {\n const data = this.args.velcroData;\n const offset = data?.middlewareData?.arrow;\n const placement = data?.placement;\n\n if (!offset || !placement) {\n return;\n }\n\n const staticSides: Record<string, string> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left'\n };\n const side = placement.split('-')[0] as string;\n const staticSide = staticSides[side] ?? 'bottom';\n\n el.style.left = typeof offset.x === 'number' ? `${offset.x}px` : '';\n el.style.top = typeof offset.y === 'number' ? `${offset.y}px` : '';\n el.style.right = '';\n el.style.bottom = '';\n // Half the arrow's 8px box, so the rotated square straddles the edge.\n el.style[staticSide as 'top' | 'bottom' | 'left' | 'right'] = '-4px';\n\n type BorderWidthProp =\n | 'borderTopWidth'\n | 'borderRightWidth'\n | 'borderBottomWidth'\n | 'borderLeftWidth';\n\n // The two edges meeting at the *inward* vertex (the one poking into the\n // content box), keyed by `side` -- see the doc comment above for the\n // derivation.\n const innerBorders: Record<string, [BorderWidthProp, BorderWidthProp]> = {\n top: ['borderTopWidth', 'borderLeftWidth'],\n bottom: ['borderRightWidth', 'borderBottomWidth'],\n left: ['borderBottomWidth', 'borderLeftWidth'],\n right: ['borderTopWidth', 'borderRightWidth']\n };\n\n const allBorderProps: BorderWidthProp[] = [\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth'\n ];\n // Reset every side first: the resolved placement (and so `side`) can\n // change at runtime -- e.g. the flip middleware -- and a border cleared\n // for a previous placement must not stay cleared for the new one.\n for (const prop of allBorderProps) {\n el.style[prop] = '';\n }\n const toClear = innerBorders[side] ?? innerBorders['top'];\n for (const prop of toClear as [BorderWidthProp, BorderWidthProp]) {\n el.style[prop] = '0';\n }\n });\n\n <template>\n <Overlay\n @blockScroll={{this.blockScroll}}\n @transition={{this.transition}}\n @backdrop={{this.backdrop}}\n @customContentModifier={{this.loop}}\n @disableFlexContent={{true}}\n @isOpen={{@isOpen}}\n @onClose={{@toggle}}\n @onOpen={{@onOpen}}\n @didClose={{this.didClose}}\n @renderInPlace={{@renderInPlace}}\n @target={{@target}}\n @transitionDuration={{@transitionDuration}}\n @disableTransitions={{@disableTransitions}}\n @disableFocusTrap={{this.disableFocusTrap}}\n @focusTrapOptions={{@focusTrapOptions}}\n @closeOnOutsideClick={{@closeOnOutsideClick}}\n @closeOnEscapeKey={{@closeOnEscapeKey}}\n @backdropTransition={{@backdropTransition}}\n @class={{this.classNames}}\n @preventFocusRestore={{@preventFocusRestore}}\n @preventAutoFocus={{@preventAutoFocus}}\n @closeOnOverlayElementClick={{false}}\n id={{@id}}\n data-placement={{this.placement}}\n ...attributes\n {{this.updateTriggerWidth @triggerWidth}}\n {{this.trackContentHover @isHoverTrigger @disableInteractive}}\n >\n {{yield}}\n {{#if @arrow}}\n <span\n class={{this.arrowClass}}\n data-part=\"arrow\"\n {{@registerArrow}}\n {{! @velcroData is passed but never read by the modifier body: supplying\n it is what makes ember-modifier re-run this on every reposition.\n Remove the argument and the arrow positions once, then never moves. }}\n {{this.positionArrow @velcroData}}\n ></span>\n {{/if}}\n </Overlay>\n </template>\n}\n\nexport {\n Popover,\n Content as PopoverContent,\n type PopoverSignature,\n type ContentSignature\n};\nexport default Popover;\n"],"names":["VIEWPORT_GUTTER","DEFAULT_SHIFT_OPTIONS","padding","availableSpace","size","apply","availableWidth","availableHeight","elements","style","floating","setProperty","Popover","Component","widthEl","menuId","guidFor","isDidClosePending","g","prototype","tracked","i","registerArrow","modifier","el","arrowEl","undefined","middleware","consumer","args","arrowMiddleware","element","n","cached","isOpen","onOpenChange","_isOpen","toggle","event","stopPropagation","close","open","isClosing","wasOpen","debounce","resetIsClosing","hoverTimer","openDelay","closeDelay","clearHoverTimer","cancel","id","scheduleOpen","run","isDestroyed","isDestroying","later","intent","scheduleClose","escapeListener","setupEscapeListener","key","document","addEventListener","teardownEscapeListener","removeEventListener","willDestroy","trigger","eventType","aria","requestAnimationFrame","triggerWidth","Math","round","offsetWidth","observer","ResizeObserver","entries","entry","target","observe","onFocusIn","matches","onKeydown","hasKey","preventFocusRestore","metaKey","ctrlKey","altKey","code","toUpperCase","isHoverTrigger","ariaMode","setAttribute","toString","removeAttribute","disconnect","measureWidth","didClose","setComponentTemplate","precompileTemplate","strictMode","scope","Velcro","hash","Content","loop","assert","classNames","popover","useStyles","class","arrow","backdrop","transition","options","name","blockScroll","disableFocusTrap","internalDidClose","updateTriggerWidth","trackContentHover","disableInteractive","enter","onContentHoverStart","leave","onContentHoverEnd","placement","velcroData","arrowClass","overlayArrow","positionArrow","data","offset","middlewareData","staticSides","top","bottom","left","right","side","split","staticSide","x","y","innerBorders","allBorderProps","prop","toClear","Overlay"],"mappings":";;;;;;;;;;;;;;;;AA2JA;;;;AAIC;AACD,MAAMA,eAAA,GAAkB,EAAA;AAExB;;;;;;AAMC;AACD,MAAMC,qBAAA,GAAwB;AAAEC,EAAAA,OAAA,EAASF;AAAgB,CAAA;AAEzD;;;;;;;;;;AAUA,MAAMG,iBAAiBC,IAAA,CAAK;AAC1BF,EAAAA,OAAA,EAASF,eAAA;AACTK,EAAAA,KAAAA,CAAM;IAAEC,cAAc;IAAEC,eAAe;AAAEC,IAAAA;AAAQ,GAAE,EAAA;AACjD,IAAA,MAAMC,KAAA,GAAQD,QAAA,CAASE,QAAQ,CAACD,KAAK;IAErCA,KAAA,CAAME,WAAW,CAAC,2BAAA,EAA6B,CAAA,EAAGL,cAAA,IAAkB,CAAA;IACpEG,KAAA,CAAME,WAAW,CAAC,4BAAA,EAA8B,CAAA,EAAGJ,eAAA,IAAmB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AMG,YAA+C,GAAoB;AACvET,MAAAA,GAAA,EAAK,CAAC,gBAAA,EAAkB,iBAAA,CAAkB;AAC1CC,MAAAA,MAAA,EAAQ,CAAC,kBAAA,EAAoB,mBAAA,CAAoB;AACjDC,MAAAA,IAAA,EAAM,CAAC,mBAAA,EAAqB,iBAAA,CAAkB;AAC9CC,MAAAA,KAAA,EAAO,CAAC,gBAAA,EAAkB,kBAAA;KAC5B;IAEA,MAAMO,cAAgB,GAAoB,CACxC,gBAAA,EACA,kBAAA,EACA,mBAAA,EACA,iBAAA,CACD;AACD;AACA;AACA;AACA,IAAA,KAAK,MAAMC,QAAQD,cAAA,EAAgB;AACjC1H,MAAAA,EAAA,CAAGf,KAAK,CAAC0I,IAAA,CAAK,GAAG,EAAA;AACnB,IAAA;IACA,MAAMC,UAAUH,YAAY,CAACL,KAAK,IAAIK,YAAY,CAAC,KAAA,CAAM;AACzD,IAAA,KAAK,MAAME,IAAA,IAAQC,OAAA,EAA+C;AAChE5H,MAAAA,EAAA,CAAGf,KAAK,CAAC0I,IAAA,CAAK,GAAG,GAAA;AACnB,IAAA;AACF,EAAA,CAAA,CAAA;AAEA,EAAA;IAAAhD,oBAAA,CAAAC,kBAAA,CAAA,2zCAAA,EA2CA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAA+C,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import { a as getDOM, g as getElementById, b as getElementByAttribute } from '../../dom-
|
|
2
|
+
import { a as getDOM, g as getElementById, b as getElementByAttribute } from '../../dom-CbIZhRH4.js';
|
|
3
3
|
import { guidFor } from '@ember/object/internals';
|
|
4
4
|
import { macroCondition, isTesting } from '@embroider/macros';
|
|
5
5
|
import { PortalTarget } from './portal-target.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { useStyles } from '@frontile/theme';
|
|
3
|
-
import { i as IconDanger, j as IconWarning, k as IconSuccess, l as IconInfo } from '../../icons-
|
|
3
|
+
import { i as IconDanger, j as IconWarning, k as IconSuccess, l as IconInfo } from '../../icons-DqlDWFrr.js';
|
|
4
4
|
import { CloseButton } from '../buttons/close-button.js';
|
|
5
5
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
6
6
|
import { setComponentTemplate } from '@ember/component';
|
|
@@ -10,6 +10,10 @@ import { setComponentTemplate } from '@ember/component';
|
|
|
10
10
|
* When you pass a named block (`<:startIcon>` or `<:endIcon>`), Glimmer no
|
|
11
11
|
* longer treats loose content as the default block, so put the label in
|
|
12
12
|
* `<:default>`.
|
|
13
|
+
*
|
|
14
|
+
* Facet 2.0 content parts map one-to-one onto this API, so there are no extra
|
|
15
|
+
* slots: `leading` is the default block, `price` is `@value`, `unit` is
|
|
16
|
+
* `@unit`, `startGlyph` is `<:startIcon>` and `endGlyph` is `<:endIcon>`.
|
|
13
17
|
*/
|
|
14
18
|
class Badge extends Component {
|
|
15
19
|
// `!= null` rather than truthiness, so a count of `0` is shown.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sources":["../../../src/components/status/badge.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\n\ninterface BadgeSignature {\n Args: {\n /**\n * The badge variant. There is no `solid`: a saturated block reads as a\n * Chip or Button.\n *\n * @defaultValue 'soft'\n */\n variant?: 'soft' | 'outline';\n\n /**\n * The color of the badge.\n *\n * @defaultValue 'neutral'\n */\n color?:\n 'neutral' | 'primary' | 'secondary' | 'tertiary' | 'success' | 'danger';\n\n /**\n * The size of the badge\n *\n * @defaultValue 'md'\n */\n size?: 'xs' | 'sm' | 'md' | 'lg';\n\n /**\n * Adds a dot before the content, colored by `@color`.\n *\n * @defaultValue false\n */\n withDot?: boolean;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */\n class?: string;\n\n /**\n * A figure shown after the label, such as a price or a count. A number is\n * accepted, and `0` still renders; only `undefined` or `null` leaves the\n * value out. Rendered in its own part so the theme can give it a\n * tabular, heavier treatment.\n */\n value?: string | number;\n\n /**\n * A unit shown after the value, such as `/mo`. Rendered only when set.\n */\n unit?: string;\n };\n Blocks: {\n /**\n * The badge label.\n */\n default: [];\n\n /**\n * An icon shown before the label. Using this block means the label must\n * go in the `<:default>` block.\n */\n startIcon?: [];\n\n /**\n * An icon shown after the value and unit. Using this block means the label\n * must go in the `<:default>` block.\n */\n endIcon?: [];\n };\n Element: HTMLSpanElement;\n}\n\n/**\n * A non-interactive label for status or metadata. Renders, in order: dot, start\n * icon, label, value, unit, end icon.\n *\n * When you pass a named block (`<:startIcon>` or `<:endIcon>`), Glimmer no\n * longer treats loose content as the default block, so put the label in\n * `<:default>`.\n */\nclass Badge extends Component<BadgeSignature> {\n // `!= null` rather than truthiness, so a count of `0` is shown.\n get hasValue(): boolean {\n return this.args.value != null;\n }\n\n get classNames() {\n const { badge } = useStyles();\n\n const { base, value, unit, icon, dot } = badge({\n color: this.args.color,\n size: this.args.size,\n variant: this.args.variant\n });\n\n return {\n base: base({ class: this.args.class }),\n value: value(),\n unit: unit(),\n icon: icon(),\n dot: dot()\n };\n }\n\n <template>\n <span\n class={{this.classNames.base}}\n data-component=\"badge\"\n data-part=\"base\"\n ...attributes\n >\n {{#if @withDot}}\n <span class={{this.classNames.dot}} data-part=\"dot\"></span>\n {{/if}}\n {{#if (has-block \"startIcon\")}}\n <span\n class={{this.classNames.icon}}\n data-part=\"icon\"\n data-position=\"start\"\n >\n {{yield to=\"startIcon\"}}\n </span>\n {{/if}}\n {{yield}}\n {{#if this.hasValue}}\n <span\n class={{this.classNames.value}}\n data-part=\"value\"\n >{{@value}}</span>\n {{/if}}\n {{#if @unit}}\n <span class={{this.classNames.unit}} data-part=\"unit\">{{@unit}}</span>\n {{/if}}\n {{#if (has-block \"endIcon\")}}\n <span\n class={{this.classNames.icon}}\n data-part=\"icon\"\n data-position=\"end\"\n >\n {{yield to=\"endIcon\"}}\n </span>\n {{/if}}\n </span>\n </template>\n}\n\nexport { Badge, type BadgeSignature };\nexport default Badge;\n"],"names":["Badge","Component","hasValue","args","value","classNames","badge","useStyles","base","unit","icon","dot","color","size","variant","class","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AA0EA
|
|
1
|
+
{"version":3,"file":"badge.js","sources":["../../../src/components/status/badge.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\n\ninterface BadgeSignature {\n Args: {\n /**\n * The badge variant. There is no `solid`: a saturated block reads as a\n * Chip or Button.\n *\n * @defaultValue 'soft'\n */\n variant?: 'soft' | 'outline';\n\n /**\n * The color of the badge.\n *\n * @defaultValue 'neutral'\n */\n color?:\n 'neutral' | 'primary' | 'secondary' | 'tertiary' | 'success' | 'danger';\n\n /**\n * The size of the badge\n *\n * @defaultValue 'md'\n */\n size?: 'xs' | 'sm' | 'md' | 'lg';\n\n /**\n * Adds a dot before the content, colored by `@color`.\n *\n * @defaultValue false\n */\n withDot?: boolean;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */\n class?: string;\n\n /**\n * A figure shown after the label, such as a price or a count. A number is\n * accepted, and `0` still renders; only `undefined` or `null` leaves the\n * value out. Rendered in its own part so the theme can give it a\n * tabular, heavier treatment.\n */\n value?: string | number;\n\n /**\n * A unit shown after the value, such as `/mo`. Rendered only when set.\n */\n unit?: string;\n };\n Blocks: {\n /**\n * The badge label.\n */\n default: [];\n\n /**\n * An icon shown before the label. Using this block means the label must\n * go in the `<:default>` block.\n */\n startIcon?: [];\n\n /**\n * An icon shown after the value and unit. Using this block means the label\n * must go in the `<:default>` block.\n */\n endIcon?: [];\n };\n Element: HTMLSpanElement;\n}\n\n/**\n * A non-interactive label for status or metadata. Renders, in order: dot, start\n * icon, label, value, unit, end icon.\n *\n * When you pass a named block (`<:startIcon>` or `<:endIcon>`), Glimmer no\n * longer treats loose content as the default block, so put the label in\n * `<:default>`.\n *\n * Facet 2.0 content parts map one-to-one onto this API, so there are no extra\n * slots: `leading` is the default block, `price` is `@value`, `unit` is\n * `@unit`, `startGlyph` is `<:startIcon>` and `endGlyph` is `<:endIcon>`.\n */\nclass Badge extends Component<BadgeSignature> {\n // `!= null` rather than truthiness, so a count of `0` is shown.\n get hasValue(): boolean {\n return this.args.value != null;\n }\n\n get classNames() {\n const { badge } = useStyles();\n\n const { base, value, unit, icon, dot } = badge({\n color: this.args.color,\n size: this.args.size,\n variant: this.args.variant\n });\n\n return {\n base: base({ class: this.args.class }),\n value: value(),\n unit: unit(),\n icon: icon(),\n dot: dot()\n };\n }\n\n <template>\n <span\n class={{this.classNames.base}}\n data-component=\"badge\"\n data-part=\"base\"\n ...attributes\n >\n {{#if @withDot}}\n <span class={{this.classNames.dot}} data-part=\"dot\"></span>\n {{/if}}\n {{#if (has-block \"startIcon\")}}\n <span\n class={{this.classNames.icon}}\n data-part=\"icon\"\n data-position=\"start\"\n >\n {{yield to=\"startIcon\"}}\n </span>\n {{/if}}\n {{yield}}\n {{#if this.hasValue}}\n <span\n class={{this.classNames.value}}\n data-part=\"value\"\n >{{@value}}</span>\n {{/if}}\n {{#if @unit}}\n <span class={{this.classNames.unit}} data-part=\"unit\">{{@unit}}</span>\n {{/if}}\n {{#if (has-block \"endIcon\")}}\n <span\n class={{this.classNames.icon}}\n data-part=\"icon\"\n data-position=\"end\"\n >\n {{yield to=\"endIcon\"}}\n </span>\n {{/if}}\n </span>\n </template>\n}\n\nexport { Badge, type BadgeSignature };\nexport default Badge;\n"],"names":["Badge","Component","hasValue","args","value","classNames","badge","useStyles","base","unit","icon","dot","color","size","variant","class","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AA0EA;;;;;;;;;;;;AAYA,MAAMA,cAAcC,SAAA,CAAU;AAC5B;EACA,IAAIC,QAAAA,GAAoB;AACtB,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,KAAK,IAAI,IAAA;AAC5B,EAAA;EAEA,IAAIC,UAAAA,GAAa;IACf,MAAM;AAAEC,MAAAA;KAAO,GAAGC,SAAA,EAAA;IAElB,MAAM;MAAEC,IAAI;MAAEJ,KAAK;MAAEK,IAAI;MAAEC,IAAI;AAAEC,MAAAA;KAAK,GAAGL,KAAA,CAAM;AAC7CM,MAAAA,KAAA,EAAO,IAAI,CAACT,IAAI,CAACS,KAAK;AACtBC,MAAAA,IAAA,EAAM,IAAI,CAACV,IAAI,CAACU,IAAI;AACpBC,MAAAA,OAAA,EAAS,IAAI,CAACX,IAAI,CAACW;AACrB,KAAA,CAAA;IAEA,OAAO;MACLN,IAAA,EAAMA,IAAA,CAAK;AAAEO,QAAAA,KAAA,EAAO,IAAI,CAACZ,IAAI,CAACY;AAAM,OAAA,CAAA;MACpCX,KAAA,EAAOA,KAAA,EAAA;MACPK,IAAA,EAAMA,IAAA,EAAA;MACNC,IAAA,EAAMA,IAAA,EAAA;MACNC,GAAA,EAAKA,GAAA;KACP;AACF,EAAA;AAEA,EAAA;IAAAK,oBAAA,CAAAC,kBAAA,CAAA,4xBAAA,EAuCA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
@@ -2,7 +2,7 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { useStyles } from '@frontile/theme';
|
|
3
3
|
import { htmlSafe } from '@ember/template';
|
|
4
4
|
import { guidFor } from '@ember/object/internals';
|
|
5
|
-
import { r as renamedArgValue } from '../../deprecated-args-
|
|
5
|
+
import { r as renamedArgValue } from '../../deprecated-args-D6KS2fwp.js';
|
|
6
6
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
7
7
|
import { setComponentTemplate } from '@ember/component';
|
|
8
8
|
|
|
@@ -4,7 +4,7 @@ import { on } from '@ember/modifier';
|
|
|
4
4
|
import { useStyles } from '@frontile/theme';
|
|
5
5
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
6
6
|
import { setComponentTemplate } from '@ember/component';
|
|
7
|
-
import { d as decorateFieldV2, i as initializeDeferredDecorator } from '../../runtime--fcdnjmJ-
|
|
7
|
+
import { d as decorateFieldV2, i as initializeDeferredDecorator } from '../../runtime--fcdnjmJ-DOFHQ2m8.js';
|
|
8
8
|
|
|
9
9
|
class Avatar extends Component {
|
|
10
10
|
static {
|
|
@@ -4,7 +4,7 @@ import { useStyles } from '@frontile/theme';
|
|
|
4
4
|
import { parseKeys } from '../../utils/keys.js';
|
|
5
5
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
6
6
|
import { setComponentTemplate } from '@ember/component';
|
|
7
|
-
import { a as decorateMethodV2 } from '../../runtime--fcdnjmJ-
|
|
7
|
+
import { a as decorateMethodV2 } from '../../runtime--fcdnjmJ-DOFHQ2m8.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Renders keyboard keys and shortcuts.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { useStyles } from '@frontile/theme';
|
|
3
|
-
import { r as renamedArgValue } from '../../deprecated-args-
|
|
3
|
+
import { r as renamedArgValue } from '../../deprecated-args-D6KS2fwp.js';
|
|
4
4
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
5
5
|
import { setComponentTemplate } from '@ember/component';
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-blur-
|
|
1
|
+
{"version":3,"file":"control-blur-ByDW39Z2.js","sources":["../src/-private/control-blur.ts"],"sourcesContent":["import { later, cancel } from '@ember/runloop';\n\n/**\n * How long to wait before deciding that a focus loss with no identifiable\n * destination really left the control.\n *\n * Only the targetless case waits at all (see {@link ControlBlurTracker}): a\n * `focusout` that names where focus went is answered synchronously. Targetless\n * blurs are the ones a click on something unfocusable produces -- the page\n * background, a backdrop, the dropdown's own padding -- and the browser\n * dispatches the rest of that click (mouseup, click) in later tasks, which is\n * where an outside click gets around to closing the popover. Deciding before\n * that would read a control that still looks open and stay silent. A beat is\n * long enough for the click to finish and short enough that blur validation\n * still feels immediate.\n */\nconst FOCUS_SETTLE_MS = 150;\n\ninterface ControlBlurTrackerOptions {\n /**\n * The element the popover's `trigger` modifier is installed on. Its\n * `aria-controls` is how the portaled content is found, so this must be the\n * element that opens the dropdown, not merely something inside the control.\n */\n trigger: () => HTMLElement | null | undefined;\n\n /** The control's outermost element: trigger, chips, clear button and all. */\n container: () => HTMLElement | null | undefined;\n\n /** Whether the control's dropdown is currently open. */\n isOpen: () => boolean;\n\n /** Whether the owning component has been (or is being) destroyed. */\n isDestroyed: () => boolean;\n\n /** Called once each time focus genuinely leaves the control. */\n onBlur: () => void;\n}\n\n/**\n * Decides when a composite control -- a trigger plus a dropdown -- has really\n * lost focus, and reports it once.\n *\n * A trigger's own blur is not the answer. Clicking an option moves focus onto\n * that option, which is *inside* the control as far as the user is concerned\n * but is not a DOM descendant of the trigger: the popover content is portaled\n * to the end of the document. And in multiple selection mode the dropdown\n * stays open across several such clicks, so a trigger-blur-means-blur rule\n * fires mid-interaction -- which is what made blur validation paint \"pick at\n * least three\" under a field the user was still filling in.\n *\n * So the control is treated as two regions, the container and the popover\n * content, and focus leaving one for the other is not a blur:\n *\n * - **`focusout` naming its destination** (`relatedTarget`) is answered\n * immediately, with no timer at all. This covers every deliberate exit --\n * Tab, or a click on another focusable thing -- and every move *into* the\n * dropdown, including the option click that starts a selection.\n * - **A targetless `focusout`** is deferred by {@link FOCUS_SETTLE_MS} and then\n * judged on `document.activeElement`. Focus nowhere (`body`) while the\n * dropdown is open is still part of the interaction -- a click on the\n * dropdown's padding -- so it is not a blur; once the dropdown has closed,\n * the same state means the user clicked away.\n *\n * The portaled content is located through the trigger's `aria-controls`, which\n * the popover's trigger modifier sets to the content's id. That needs no extra\n * plumbing through the popover and stays correct wherever the content is\n * rendered.\n *\n * Callers must call {@link cancel} from `willDestroy`: a pending timer would\n * otherwise resolve against a torn-down component and both write tracked state\n * and call a callback the consumer has stopped expecting.\n */\nclass ControlBlurTracker {\n #timer?: ReturnType<typeof later>;\n\n private readonly options: ControlBlurTrackerOptions;\n\n constructor(options: ControlBlurTrackerOptions) {\n this.options = options;\n }\n\n /**\n * Wire this to `focusout` on the trigger -- not `blur`, whose\n * `relatedTarget` browsers are not obliged to populate.\n */\n handleFocusOut = (event: FocusEvent): void => {\n this.cancel();\n\n const next = event.relatedTarget;\n\n if (next instanceof Element) {\n if (!this.#holdsFocus(next)) {\n this.#report();\n }\n return;\n }\n\n this.#timer = later(this, this.#settle, FOCUS_SETTLE_MS);\n };\n\n /** Cancels a pending decision. Call from the owner's `willDestroy`. */\n cancel = (): void => {\n if (this.#timer) {\n cancel(this.#timer);\n this.#timer = undefined;\n }\n };\n\n #settle = (): void => {\n this.#timer = undefined;\n\n if (this.options.isDestroyed()) {\n return;\n }\n\n const active = document.activeElement;\n\n if (!active || active === document.body) {\n // Focus is nowhere. While the dropdown is open that is the user clicking\n // an unfocusable part of it; once it has closed it is the user having\n // clicked away from the control entirely.\n if (!this.options.isOpen()) {\n this.#report();\n }\n return;\n }\n\n if (!this.#holdsFocus(active)) {\n this.#report();\n }\n };\n\n /** Whether `el` is part of the control: the field itself, or its dropdown. */\n #holdsFocus(el: Element): boolean {\n const container = this.options.container();\n if (container && container.contains(el)) {\n return true;\n }\n\n const content = this.#popoverContent();\n return !!content && content.contains(el);\n }\n\n #popoverContent(): HTMLElement | null {\n const id = this.options.trigger()?.getAttribute('aria-controls');\n return id ? document.getElementById(id) : null;\n }\n\n #report(): void {\n if (this.options.isDestroyed()) {\n return;\n }\n this.options.onBlur();\n }\n}\n\nexport { ControlBlurTracker, type ControlBlurTrackerOptions };\n"],"names":["FOCUS_SETTLE_MS","ControlBlurTracker","options","constructor","handleFocusOut","event","cancel","next","relatedTarget","Element","later","undefined","#settle","isDestroyed","active","document","activeElement","body","isOpen","#holdsFocus","el","container","contains","content","#popoverContent","id","trigger","getAttribute","getElementById","#report","on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a;IAErC,IAAI,CAACF,MAAM,IAAIA,MAAM,KAAKC,QAAQ,CAACE,IAAI,EAAE;AACvC;AACA;AACA;MACA,IAAI,CAAC,IAAI,CAACf,OAAO,CAACgB,MAAM,EAAE,EAAE;AAC1B,QAAA,IAAI,CAAC,OAAO,EAAE;AAChB,MAAA;AACA,MAAA;AACF,IAAA;IAEA,IAAI,CAAC,IAAI,CAAC,WAAW,CAACJ,MAAM,CAAC,EAAE;AAC7B,MAAA,IAAI,CAAC,OAAO,EAAE;AAChB,IAAA;EACF,CAAC;;AAED;EACA,WAAWK,CAACC,EAAW,EAAW;IAChC,MAAMC,SAAS,GAAG,IAAI,CAACnB,OAAO,CAACmB,SAAS,EAAE;IAC1C,IAAIA,SAAS,IAAIA,SAAS,CAACC,QAAQ,CAACF,EAAE,CAAC,EAAE;AACvC,MAAA,OAAO,IAAI;AACb,IAAA;AAEA,IAAA,MAAMG,OAAO,GAAG,IAAI,CAAC,eAAe,EAAE;IACtC,OAAO,CAAC,CAACA,OAAO,IAAIA,OAAO,CAACD,QAAQ,CAACF,EAAE,CAAC;AAC1C,EAAA;EAEA,eAAeI,GAAuB;AACpC,IAAA,MAAMC,EAAE,GAAG,IAAI,CAACvB,OAAO,CAACwB,OAAO,EAAE,EAAEC,YAAY,CAAC,eAAe,CAAC;IAChE,OAAOF,EAAE,GAAGV,QAAQ,CAACa,cAAc,CAACH,EAAE,CAAC,GAAG,IAAI;AAChD,EAAA;EAEA,OAAOI,GAAS;AACd,IAAA,IAAI,IAAI,CAAC3B,OAAO,CAACW,WAAW,EAAE,EAAE;AAC9B,MAAA;AACF,IAAA;AACA,IAAA,IAAI,CAACX,OAAO,CAAC4B,MAAM,EAAE;AACvB,EAAA;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-args-
|
|
1
|
+
{"version":3,"file":"deprecated-args-D6KS2fwp.js","sources":["../src/-private/deprecated-args.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\nexport interface RenamedArgOptions {\n /** Component name as it appears to a consumer, e.g. `'Button'`. */\n component: string;\n /** The old argument name, without the `@`. */\n from: string;\n /** The new argument name, without the `@`. */\n to: string;\n /** Deprecation id, e.g. `'frontile.button.appearance'`. */\n id: string;\n}\n\nfunction warn(options: RenamedArgOptions, detail = ''): void {\n deprecate(\n `${options.component}: \\`@${options.from}\\` is deprecated. Use \\`@${options.to}\\` instead.${detail}`,\n false,\n {\n id: options.id,\n until: '0.19.0',\n for: 'frontile',\n since: { available: '0.18.0', enabled: '0.18.0' }\n }\n );\n}\n\n/**\n * Resolve an argument whose name *and* values moved.\n *\n * `values` maps old spellings to new ones. A legacy value absent from the map\n * kept its name (e.g. Button's `custom`) and passes through untouched — so the\n * map only lists what actually changed.\n */\nexport function renamedArgValue<Old extends string, New extends string>(\n next: New | undefined,\n legacy: Old | undefined,\n values: Partial<Record<Old, New>>,\n options: RenamedArgOptions\n): New | undefined {\n if (typeof legacy === 'undefined') {\n return next;\n }\n\n const mapped = values[legacy] ?? (legacy as unknown as New);\n\n warn(\n options,\n values[legacy] ? ` \\`${legacy}\\` is now \\`${values[legacy]}\\`.` : ''\n );\n\n return typeof next === 'undefined' ? mapped : next;\n}\n"],"names":["warn","options","detail","deprecate","component","from","to","id","until","for","since","available","enabled","renamedArgValue","next","legacy","values","mapped"],"mappings":";;AAaA,SAASA,IAAIA,CAACC,OAA0B,EAAEC,MAAM,GAAG,EAAE,EAAQ;AAC3DC,EAAAA,SAAS,CACP,CAAA,EAAGF,OAAO,CAACG,SAAS,CAAA,KAAA,EAAQH,OAAO,CAACI,IAAI,CAAA,yBAAA,EAA4BJ,OAAO,CAACK,EAAE,CAAA,WAAA,EAAcJ,MAAM,CAAA,CAAE,EACpG,KAAK,EACL;IACEK,EAAE,EAAEN,OAAO,CAACM,EAAE;AACdC,IAAAA,KAAK,EAAE,QAAQ;AACfC,IAAAA,GAAG,EAAE,UAAU;AACfC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,SAAS,EAAE,QAAQ;AAAEC,MAAAA,OAAO,EAAE;AAAS;AAClD,GACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,eAAeA,CAC7BC,IAAqB,EACrBC,MAAuB,EACvBC,MAAiC,EACjCf,OAA0B,EACT;AACjB,EAAA,IAAI,OAAOc,MAAM,KAAK,WAAW,EAAE;AACjC,IAAA,OAAOD,IAAI;AACb,EAAA;AAEA,EAAA,MAAMG,MAAM,GAAGD,MAAM,CAACD,MAAM,CAAC,IAAKA,MAAyB;AAE3Df,EAAAA,IAAI,CACFC,OAAO,EACPe,MAAM,CAACD,MAAM,CAAC,GAAG,CAAA,GAAA,EAAMA,MAAM,CAAA,YAAA,EAAeC,MAAM,CAACD,MAAM,CAAC,CAAA,GAAA,CAAK,GAAG,EACpE,CAAC;AAED,EAAA,OAAO,OAAOD,IAAI,KAAK,WAAW,GAAGG,MAAM,GAAGH,IAAI;AACpD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-
|
|
1
|
+
{"version":3,"file":"dialog-C5sLU1yl.js","sources":["../src/-private/dialog.ts"],"sourcesContent":["import { warn } from '@ember/debug';\n\n/**\n * Warns when a dialog ends up with no accessible name at all — no registered\n * `Header`, and no `aria-label`/`aria-labelledby` of the consumer's own.\n * Assistive technology announces such a dialog as just \"dialog\", and nothing\n * else surfaces the mistake at runtime.\n *\n * Consumer-supplied names arrive through `...attributes`, which the component\n * cannot see in its args, so this inspects the rendered element for them. A\n * heading merely carrying `headerId` deliberately does *not* count: nothing\n * points `aria-labelledby` at it, so the dialog really is unnamed, and that is\n * the case most worth surfacing.\n *\n * `warn` is stripped from production builds, so this costs consumers nothing.\n */\nexport function warnIfDialogHasNoAccessibleName(\n element: Element,\n hasRegisteredHeader: boolean,\n component: 'modal' | 'drawer'\n): void {\n const hasName =\n hasRegisteredHeader ||\n !!element.getAttribute('aria-label') ||\n !!element.getAttribute('aria-labelledby');\n\n const name = component === 'modal' ? 'Modal' : 'Drawer';\n const block = component === 'modal' ? 'm' : 'd';\n\n warn(\n `<${name}> has no accessible name: assistive technology will announce it ` +\n `as just \"dialog\". Render the yielded <${block}.Header>, or pass your ` +\n `own aria-label or aria-labelledby to <${name}>. Putting the yielded ` +\n `headerId on a heading of your own is not enough on its own — pass ` +\n `aria-labelledby={{${block}.headerId}} alongside it.`,\n hasName,\n { id: `frontile.${component}.missing-accessible-name` }\n );\n}\n"],"names":["warnIfDialogHasNoAccessibleName","element","hasRegisteredHeader","component","hasName","getAttribute","name","block","warn","id"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,+BAA+BA,CAC7CC,OAAgB,EAChBC,mBAA4B,EAC5BC,SAA6B,EACvB;EACN,MAAMC,OAAO,GACXF,mBAAmB,IACnB,CAAC,CAACD,OAAO,CAACI,YAAY,CAAC,YAAY,CAAC,IACpC,CAAC,CAACJ,OAAO,CAACI,YAAY,CAAC,iBAAiB,CAAC;EAE3C,MAAMC,IAAI,GAAGH,SAAS,KAAK,OAAO,GAAG,OAAO,GAAG,QAAQ;EACvD,MAAMI,KAAK,GAAGJ,SAAS,KAAK,OAAO,GAAG,GAAG,GAAG,GAAG;EAE/CK,IAAI,CACF,IAAIF,IAAI,CAAA,gEAAA,CAAkE,GACxE,CAAA,sCAAA,EAAyCC,KAAK,yBAAyB,GACvE,CAAA,sCAAA,EAAyCD,IAAI,CAAA,uBAAA,CAAyB,GACtE,oEAAoE,GACpE,CAAA,kBAAA,EAAqBC,KAAK,CAAA,yBAAA,CAA2B,EACvDH,OAAO,EACP;IAAEK,EAAE,EAAE,YAAYN,SAAS,CAAA,wBAAA;AAA2B,GACxD,CAAC;AACH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom-
|
|
1
|
+
{"version":3,"file":"dom-CbIZhRH4.js","sources":["../src/-private/dom.ts"],"sourcesContent":["import { getOwner } from '@ember/owner';\n\nexport function getDOM(context: object): Document | null {\n if (typeof document !== 'undefined') {\n return document;\n }\n\n const container = getOwner(context);\n if (!container) {\n return null;\n }\n const documentService = container.lookup('service:-document');\n\n if (documentService) {\n return documentService as Document;\n }\n return null;\n}\n\nfunction childNodesOfElement(\n element: Node | Element | null | undefined\n): (Node | Element)[] {\n if (!element) {\n return [];\n }\n\n const children = [];\n let child = element.firstChild;\n while (child) {\n children.push(child);\n child = child.nextSibling;\n }\n return children;\n}\n\n// eslint-disable-next-line no-control-regex\nconst CONTROL_CHARACTERS = /[\\u0000-\\u001f\\u007f]/g;\n\n/**\n * Escapes a value for use inside a *quoted* attribute selector.\n *\n * Values reaching here come from consumers — `Portal @target=\"#some-id\"`, a\n * portal target name — and an id is only required to be non-empty and free of\n * whitespace, so plenty of legal ids (`1foo`, `user.email`, `a:b`) are not\n * valid CSS identifiers. Interpolating them raw either throws a `SyntaxError`\n * and takes the render down, or, for a crafted value like\n * `x], [data-portal-target`, closes the predicate and matches something else\n * entirely.\n *\n * `CSS.escape` would also work here, but it escapes for the *identifier*\n * grammar while every call site interpolates into a *quoted string*\n * (`[attr=\"…\"]`). Two escapers for two grammars in one function is a trap\n * even though both happen to round-trip, and `CSS.escape` is a browser global\n * this module cannot rely on — it also runs against the `-document` service\n * when the app is prerendered. So there is one hand-rolled escaper, complete\n * for the quoted-string position and exercised by every caller on every\n * platform:\n *\n * - `\"` and `\\` are escaped with a backslash; they are the only characters a\n * quoted string cannot carry literally.\n * - Control characters — newline (`\\a`), carriage return (`\\d`), form feed\n * (`\\c`) among them — cannot appear literally in a CSS string either, and\n * get the hex escape the grammar defines, always with the terminating space\n * so the following character is never absorbed into the escape. Substituting\n * a different character for them (a space, say) would silently query for a\n * *different* value and match the wrong element, or none, with no error.\n */\nfunction escapeAttributeValue(value: string): string {\n return value\n .replace(/[\"\\\\]/g, '\\\\$&')\n .replace(\n CONTROL_CHARACTERS,\n (char) => `\\\\${char.charCodeAt(0).toString(16)} `\n );\n}\n\nexport function getElementById(\n doc: Document | Element,\n id: string\n): null | Element {\n // `Document` (and the `-document` service standing in for it) can answer\n // this without a selector at all, which sidesteps escaping entirely.\n // `Element` has no `getElementById`, so those callers keep the selector and\n // node-walking paths below.\n //\n // Intentional asymmetry with `getElementByAttribute`: an empty id is *no id*\n // here (`@target=\"#\"` must resolve to nothing rather than to whichever\n // element happens to carry an `id` first), while an empty value passed to\n // `getElementByAttribute` is a value like any other and is matched\n // literally. Both receivers are reachable, so the two exports disagree by\n // design, not by oversight.\n if (typeof (doc as Document).getElementById === 'function') {\n return id ? (doc as Document).getElementById(id) : null;\n }\n\n return getElementByAttribute(doc, 'id', id);\n}\n\nexport function getElementByAttribute(\n doc: Document | Element,\n attribute: string,\n value: string | undefined = undefined\n): null | Element {\n // Only an omitted value means \"any element carrying this attribute\". An\n // empty string is a value like any other and is matched literally —\n // otherwise `@target=\"#\"` would portal into whatever element happens to\n // carry an `id` first.\n const hasValue = typeof value !== 'undefined';\n\n if (doc.querySelector) {\n if (hasValue) {\n return doc.querySelector(\n `[${attribute}=\"${escapeAttributeValue(value as string)}\"]`\n );\n } else {\n return doc.querySelector(`[${attribute}]`);\n }\n }\n\n let nodes = childNodesOfElement(doc);\n let node;\n\n while (nodes.length) {\n node = nodes.shift();\n\n if (node && isElement(node)) {\n if (hasValue && node.getAttribute(attribute) === value) {\n return node as Element;\n } else if (!hasValue && node.getAttribute(attribute)) {\n return node as Element;\n }\n }\n\n nodes = childNodesOfElement(node).concat(nodes);\n }\n\n return null;\n}\n\nfunction isElement(el: Node | Element): el is Element {\n // @ts-expect-error checking if is an element\n return typeof el.getAttribute == 'function';\n}\n"],"names":["getDOM","context","document","container","getOwner","documentService","lookup","childNodesOfElement","element","children","child","firstChild","push","nextSibling","CONTROL_CHARACTERS","escapeAttributeValue","value","replace","char","charCodeAt","toString","getElementById","doc","id","getElementByAttribute","attribute","undefined","hasValue","querySelector","nodes","node","length","shift","isElement","getAttribute","concat","el"],"mapp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YAAY,CAACT,SAAS,CAAC,EAAE;AACpD,QAAA,OAAOK,IAAI;AACb,MAAA;AACF,IAAA;IAEAD,KAAK,GAAGtB,mBAAmB,CAACuB,IAAI,CAAC,CAACK,MAAM,CAACN,KAAK,CAAC;AACjD,EAAA;AAEA,EAAA,OAAO,IAAI;AACb;AAEA,SAASI,SAASA,CAACG,EAAkB,EAAiB;AACpD;AACA,EAAA,OAAO,OAAOA,EAAE,CAACF,YAAY,IAAI,UAAU;AAC7C;;"}
|
|
@@ -60,4 +60,4 @@ const MenuIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://ww
|
|
|
60
60
|
}), templateOnly());
|
|
61
61
|
|
|
62
62
|
export { ColumnVisibilityIcon as C, EllipsisHorizontalIcon as E, IconChevronUpDown as I, MenuIcon as M, SidebarRightIcon as S, ChevronDownIcon as a, ChevronUpIcon as b, ChevronRightIcon as c, ChevronLeftIcon as d, IconCalendar as e, SidebarLeftIcon as f, ChevronDoubleRightIcon as g, ChevronDoubleLeftIcon as h, IconDanger as i, IconWarning as j, IconSuccess as k, IconInfo as l };
|
|
63
|
-
//# sourceMappingURL=icons-
|
|
63
|
+
//# sourceMappingURL=icons-DqlDWFrr.js.map
|