frontile 0.18.5 → 0.18.7
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/-private/icons.d.ts +4 -0
- package/declarations/-private/icons.d.ts.map +1 -1
- package/declarations/-private/reveal-within.d.ts +19 -0
- package/declarations/-private/reveal-within.d.ts.map +1 -0
- package/declarations/components/collections/calendar/year-grid.d.ts.map +1 -1
- package/declarations/components/collections/dropdown/dropdown.d.ts +50 -53
- package/declarations/components/collections/dropdown/dropdown.d.ts.map +1 -1
- package/declarations/components/collections/listbox/item.d.ts +52 -1
- package/declarations/components/collections/listbox/item.d.ts.map +1 -1
- package/declarations/components/forms/date-input/segment-group.d.ts +2 -1
- package/declarations/components/forms/date-input/segment-group.d.ts.map +1 -1
- package/declarations/components/forms/date-input/segments.d.ts +3 -1
- package/declarations/components/forms/date-input/segments.d.ts.map +1 -1
- package/declarations/components/forms/date-picker/date-picker.d.ts +119 -1
- package/declarations/components/forms/date-picker/date-picker.d.ts.map +1 -1
- package/declarations/components/forms/date-picker/time-columns.d.ts +87 -0
- package/declarations/components/forms/date-picker/time-columns.d.ts.map +1 -0
- package/declarations/components/forms/date-picker/types.d.ts +28 -0
- package/declarations/components/forms/date-picker/types.d.ts.map +1 -1
- package/declarations/components/forms/select/native-mirror.d.ts +3 -2
- package/declarations/components/forms/select/native-mirror.d.ts.map +1 -1
- package/declarations/components/forms/select/select.d.ts +31 -2
- package/declarations/components/forms/select/select.d.ts.map +1 -1
- package/declarations/components/forms/select/types.d.ts +3 -2
- package/declarations/components/forms/select/types.d.ts.map +1 -1
- package/declarations/components/layout/app-layout-state.d.ts +32 -0
- package/declarations/components/layout/app-layout-state.d.ts.map +1 -0
- package/declarations/components/layout/app-layout.d.ts +954 -0
- package/declarations/components/layout/app-layout.d.ts.map +1 -0
- package/declarations/components/layout/aside-toggle.d.ts +55 -0
- package/declarations/components/layout/aside-toggle.d.ts.map +1 -0
- package/declarations/components/layout/aside.d.ts +761 -0
- package/declarations/components/layout/aside.d.ts.map +1 -0
- package/declarations/components/layout/bottom-nav-more.d.ts +123 -0
- package/declarations/components/layout/bottom-nav-more.d.ts.map +1 -0
- package/declarations/components/layout/bottom-nav.d.ts +60 -0
- package/declarations/components/layout/bottom-nav.d.ts.map +1 -0
- package/declarations/components/layout/context.d.ts +134 -0
- package/declarations/components/layout/context.d.ts.map +1 -0
- package/declarations/components/layout/index.d.ts +14 -0
- package/declarations/components/layout/index.d.ts.map +1 -0
- package/declarations/components/layout/main.d.ts +28 -0
- package/declarations/components/layout/main.d.ts.map +1 -0
- package/declarations/components/layout/menu-toggle.d.ts +58 -0
- package/declarations/components/layout/menu-toggle.d.ts.map +1 -0
- package/declarations/components/layout/nav-context.d.ts +45 -0
- package/declarations/components/layout/nav-context.d.ts.map +1 -0
- package/declarations/components/layout/nav-folder.d.ts +216 -0
- package/declarations/components/layout/nav-folder.d.ts.map +1 -0
- package/declarations/components/layout/nav-item.d.ts +220 -0
- package/declarations/components/layout/nav-item.d.ts.map +1 -0
- package/declarations/components/layout/nav-link.d.ts +67 -0
- package/declarations/components/layout/nav-link.d.ts.map +1 -0
- package/declarations/components/layout/navbar.d.ts +27 -0
- package/declarations/components/layout/navbar.d.ts.map +1 -0
- package/declarations/components/layout/page-header.d.ts +40 -0
- package/declarations/components/layout/page-header.d.ts.map +1 -0
- package/declarations/components/layout/sidebar-group.d.ts +41 -0
- package/declarations/components/layout/sidebar-group.d.ts.map +1 -0
- package/declarations/components/layout/sidebar-toggle.d.ts +71 -0
- package/declarations/components/layout/sidebar-toggle.d.ts.map +1 -0
- package/declarations/components/layout/sidebar.d.ts +904 -0
- package/declarations/components/layout/sidebar.d.ts.map +1 -0
- package/declarations/components/navigation/index.d.ts +1 -0
- package/declarations/components/navigation/index.d.ts.map +1 -1
- package/declarations/components/navigation/stepper/collapse-menu.d.ts +42 -0
- package/declarations/components/navigation/stepper/collapse-menu.d.ts.map +1 -0
- package/declarations/components/navigation/stepper/list.d.ts +24 -0
- package/declarations/components/navigation/stepper/list.d.ts.map +1 -0
- package/declarations/components/navigation/stepper/panel.d.ts +42 -0
- package/declarations/components/navigation/stepper/panel.d.ts.map +1 -0
- package/declarations/components/navigation/stepper/step.d.ts +123 -0
- package/declarations/components/navigation/stepper/step.d.ts.map +1 -0
- package/declarations/components/navigation/stepper/stepper.d.ts +947 -0
- package/declarations/components/navigation/stepper/stepper.d.ts.map +1 -0
- package/declarations/components/navigation/stepper.d.ts +6 -0
- package/declarations/components/navigation/stepper.d.ts.map +1 -0
- package/declarations/components/navigation/tab-nav/item.d.ts +2 -2
- package/declarations/components/navigation/tab-nav/item.d.ts.map +1 -1
- package/declarations/components/overlays/overlay.d.ts +17 -2
- package/declarations/components/overlays/overlay.d.ts.map +1 -1
- package/declarations/components/overlays/portal.d.ts.map +1 -1
- package/declarations/components/utilities/collapsible.d.ts +19 -2
- package/declarations/components/utilities/collapsible.d.ts.map +1 -1
- package/declarations/index.d.ts +1 -0
- package/declarations/index.d.ts.map +1 -1
- package/declarations/layout.d.ts +2 -0
- package/declarations/layout.d.ts.map +1 -0
- package/declarations/test-support.d.ts.map +1 -1
- package/declarations/utils/breakpoint.d.ts +16 -0
- package/declarations/utils/breakpoint.d.ts.map +1 -0
- package/declarations/utils/document-listener.d.ts +6 -0
- package/declarations/utils/document-listener.d.ts.map +1 -0
- package/declarations/utils/listManager.d.ts +7 -1
- package/declarations/utils/listManager.d.ts.map +1 -1
- package/declarations/utils/route-active.d.ts +34 -0
- package/declarations/utils/route-active.d.ts.map +1 -0
- package/declarations/utils/selection-indicator.d.ts +7 -4
- package/declarations/utils/selection-indicator.d.ts.map +1 -1
- package/dist/components/collections/calendar/header.js +1 -1
- package/dist/components/collections/calendar/year-grid.js +1 -30
- package/dist/components/collections/calendar/year-grid.js.map +1 -1
- package/dist/components/collections/dropdown/dropdown.js +172 -48
- package/dist/components/collections/dropdown/dropdown.js.map +1 -1
- package/dist/components/collections/listbox/item.js +36 -2
- package/dist/components/collections/listbox/item.js.map +1 -1
- package/dist/components/collections/table/column-visibility.js +1 -1
- package/dist/components/collections/table/sort-button.js +1 -1
- package/dist/components/disclosure/accordion/item.js +1 -1
- package/dist/components/forms/autocomplete.js +1 -1
- package/dist/components/forms/date-input/segment-group.js +1 -1
- package/dist/components/forms/date-input/segment-group.js.map +1 -1
- package/dist/components/forms/date-input/segments.js +1 -1
- package/dist/components/forms/date-input/segments.js.map +1 -1
- package/dist/components/forms/date-input.js +1 -1
- package/dist/components/forms/date-picker/date-picker.js +57 -6
- package/dist/components/forms/date-picker/date-picker.js.map +1 -1
- package/dist/components/forms/date-picker/end-content.js +1 -1
- package/dist/components/forms/date-picker/time-columns.js +238 -0
- package/dist/components/forms/date-picker/time-columns.js.map +1 -0
- package/dist/components/forms/index.js +1 -1
- package/dist/components/forms/native-select.js +1 -1
- package/dist/components/forms/select/end-content.js +1 -1
- package/dist/components/forms/select/native-mirror.js.map +1 -1
- package/dist/components/forms/select/select.js +24 -5
- package/dist/components/forms/select/select.js.map +1 -1
- package/dist/components/layout/app-layout-state.js +64 -0
- package/dist/components/layout/app-layout-state.js.map +1 -0
- package/dist/components/layout/app-layout.js +416 -0
- package/dist/components/layout/app-layout.js.map +1 -0
- package/dist/components/layout/aside-toggle.js +55 -0
- package/dist/components/layout/aside-toggle.js.map +1 -0
- package/dist/components/layout/aside.js +100 -0
- package/dist/components/layout/aside.js.map +1 -0
- package/dist/components/layout/bottom-nav-more.js +150 -0
- package/dist/components/layout/bottom-nav-more.js.map +1 -0
- package/dist/components/layout/bottom-nav.js +65 -0
- package/dist/components/layout/bottom-nav.js.map +1 -0
- package/dist/components/layout/context.js +89 -0
- package/dist/components/layout/context.js.map +1 -0
- package/dist/components/layout/index.js +14 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/components/layout/main.js +34 -0
- package/dist/components/layout/main.js.map +1 -0
- package/dist/components/layout/menu-toggle.js +61 -0
- package/dist/components/layout/menu-toggle.js.map +1 -0
- package/dist/components/layout/nav-context.js +85 -0
- package/dist/components/layout/nav-context.js.map +1 -0
- package/dist/components/layout/nav-folder.js +271 -0
- package/dist/components/layout/nav-folder.js.map +1 -0
- package/dist/components/layout/nav-item.js +192 -0
- package/dist/components/layout/nav-item.js.map +1 -0
- package/dist/components/layout/nav-link.js +58 -0
- package/dist/components/layout/nav-link.js.map +1 -0
- package/dist/components/layout/navbar.js +30 -0
- package/dist/components/layout/navbar.js.map +1 -0
- package/dist/components/layout/page-header.js +45 -0
- package/dist/components/layout/page-header.js.map +1 -0
- package/dist/components/layout/sidebar-group.js +41 -0
- package/dist/components/layout/sidebar-group.js.map +1 -0
- package/dist/components/layout/sidebar-toggle.js +82 -0
- package/dist/components/layout/sidebar-toggle.js.map +1 -0
- package/dist/components/layout/sidebar.js +249 -0
- package/dist/components/layout/sidebar.js.map +1 -0
- package/dist/components/navigation/breadcrumbs/separator.js +1 -1
- package/dist/components/navigation/index.js +4 -0
- package/dist/components/navigation/index.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.js +1 -1
- package/dist/components/navigation/stepper/collapse-menu.js +128 -0
- package/dist/components/navigation/stepper/collapse-menu.js.map +1 -0
- package/dist/components/navigation/stepper/list.js +17 -0
- package/dist/components/navigation/stepper/list.js.map +1 -0
- package/dist/components/navigation/stepper/panel.js +26 -0
- package/dist/components/navigation/stepper/panel.js.map +1 -0
- package/dist/components/navigation/stepper/step.js +130 -0
- package/dist/components/navigation/stepper/step.js.map +1 -0
- package/dist/components/navigation/stepper/stepper.js +475 -0
- package/dist/components/navigation/stepper/stepper.js.map +1 -0
- package/dist/components/navigation/stepper.js +5 -0
- package/dist/components/navigation/stepper.js.map +1 -0
- package/dist/components/navigation/tab-nav/item.js +6 -40
- package/dist/components/navigation/tab-nav/item.js.map +1 -1
- package/dist/components/notifications/index.js +1 -1
- package/dist/components/notifications/notification-card.js +2 -2
- package/dist/components/notifications/notifications-container.js +1 -1
- package/dist/components/overlays/overlay.js +55 -7
- package/dist/components/overlays/overlay.js.map +1 -1
- package/dist/components/overlays/portal.js +11 -2
- package/dist/components/overlays/portal.js.map +1 -1
- package/dist/components/status/alert.js +1 -1
- package/dist/components/utilities/collapsible.js +33 -5
- package/dist/components/utilities/collapsible.js.map +1 -1
- package/dist/forms.js +1 -1
- package/dist/{icons-DZ61nCzv.js → icons-55dthVFk.js} +14 -2
- package/dist/{icons-DZ61nCzv.js.map → icons-55dthVFk.js.map} +1 -1
- package/dist/index.js +19 -2
- package/dist/index.js.map +1 -1
- package/dist/layout.js +14 -0
- package/dist/layout.js.map +1 -0
- package/dist/navigation.js +4 -0
- package/dist/navigation.js.map +1 -1
- package/dist/{notification-card-dz-eE6z9.js → notification-card-BPfDo-Gf.js} +2 -2
- package/dist/{notification-card-dz-eE6z9.js.map → notification-card-BPfDo-Gf.js.map} +1 -1
- package/dist/notifications.js +1 -1
- package/dist/reveal-within-BcqpOmSI.js +33 -0
- package/dist/reveal-within-BcqpOmSI.js.map +1 -0
- package/dist/test-support.js +3 -1
- package/dist/test-support.js.map +1 -1
- package/dist/utils/breakpoint.js +56 -0
- package/dist/utils/breakpoint.js.map +1 -0
- package/dist/utils/document-listener.js +10 -0
- package/dist/utils/document-listener.js.map +1 -0
- package/dist/utils/listManager.js +12 -2
- package/dist/utils/listManager.js.map +1 -1
- package/dist/utils/route-active.js +70 -0
- package/dist/utils/route-active.js.map +1 -0
- package/dist/utils/selection-indicator.js +25 -5
- package/dist/utils/selection-indicator.js.map +1 -1
- package/package.json +7 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsible.js","sources":["../../../src/components/utilities/collapsible.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { buildWaiter } from '@ember/test-waiters';\nimport { on } from '@ember/modifier';\nimport { modifier } from 'ember-modifier';\nimport safeStyles from '../../utils/safe-styles';\nimport { prefersReducedMotion } from '../../utils/prefers-reduced-motion';\nimport type Owner from '@ember/owner';\n\nconst waiter = buildWaiter('frontile:collapsible');\n\n/**\n * Runs a caller-supplied height through the browser's own CSS parser.\n *\n * `@initialHeight` ends up in an inline `style` attribute, so a value such as\n * `10px; position: fixed` would otherwise smuggle in a second declaration.\n * Assigning it to a detached element's `style.height` lets the CSSOM decide:\n * it accepts every real height (`10px`, `2rem`, `50%`, `0`,\n * `calc(1rem + 2px)`, `var(--x)`, …) and drops anything it cannot parse as a\n * single height value — a trailing declaration included. Returns the parsed\n * value, or `undefined` when the input is unusable.\n */\nfunction parseHeight(value: string | undefined): string | undefined {\n if (!value) {\n return undefined;\n }\n\n // Reject anything that could terminate the declaration up front. The CSSOM\n // check below catches this too, but the explicit test keeps the guarantee\n // even where `document` has no real CSS parser (SSR / prerender).\n if (/[;}]/.test(value)) {\n return undefined;\n }\n\n if (typeof document === 'undefined') {\n return value;\n }\n\n const probe = document.createElement('div');\n probe.style.height = value;\n\n return probe.style.height || undefined;\n}\n\ninterface CollapsibleArgs {\n /**\n * If true, the content will be visible\n */\n isOpen: boolean;\n\n /**\n * The height for the content in it's collapsed state.\n * The unit of the value should be included, eg. '10px'. Any CSS height is\n * accepted (`2rem`, `50%`, `calc(1rem + 2px)`, …); a value the CSS parser\n * rejects is ignored and the content collapses to `0`.\n *\n * @defaultValue 0\n */\n initialHeight?: string;\n}\n\ninterface CollapsibleSignature {\n Args: CollapsibleArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nclass Collapsible extends Component<CollapsibleSignature> {\n isInitiallyOpen = false;\n waiterToken?: unknown;\n isCurrentlyOpen = false;\n\n constructor(owner: Owner, args: CollapsibleArgs) {\n super(owner, args);\n\n if (this.args.isOpen) {\n this.isInitiallyOpen = true;\n this.isCurrentlyOpen = true;\n }\n }\n\n /**\n * `@initialHeight`, validated by the CSS parser. `undefined` when it was not\n * given or could not be parsed as a height, in which case the collapsed\n * state falls back to `0`.\n */\n get initialHeight(): string | undefined {\n return parseHeight(this.args.initialHeight);\n }\n\n get styles(): ReturnType<typeof safeStyles> {\n let styles: Record<string, string | number> = {};\n const initialHeight = this.initialHeight;\n\n if (!this.isInitiallyOpen) {\n styles = {\n ...styles,\n height: initialHeight || 0,\n opacity: initialHeight ? '1' : '0'\n };\n }\n\n if (initialHeight || !this.isInitiallyOpen) {\n styles = {\n ...styles,\n overflow: 'hidden'\n };\n }\n\n return safeStyles(styles);\n }\n\n hasSetupUpdate = false;\n update = modifier((element: HTMLElement, [isOpen]: boolean[]) => {\n // do not run update on the initial setup of modifier\n if (!this.hasSetupUpdate) {\n this.hasSetupUpdate = true;\n return;\n }\n\n if (this.isCurrentlyOpen !== !!isOpen) {\n // A previous transition may still be in flight; end its token first so\n // toggling faster than the animation cannot leak a test waiter.\n this.endWaiter();\n this.waiterToken = waiter.beginAsync();\n }\n\n if (isOpen) {\n this.expand(element);\n } else {\n this.contract(element);\n }\n });\n\n endWaiter(): void {\n if (this.waiterToken) {\n const token = this.waiterToken;\n // Clear before ending so the same token can never be ended twice.\n this.waiterToken = undefined;\n waiter.endAsync(token);\n }\n }\n\n willDestroy(): void {\n super.willDestroy();\n this.cancelFrames();\n // Do not leave a waiter pending if we are torn down mid-transition.\n this.endWaiter();\n }\n\n /**\n * Frames scheduled by the current `expand`/`contract`. A frame left over\n * from the previous direction would otherwise still apply its styles after\n * the toggle, e.g. making a panel that was just closed visible again.\n */\n pendingFrames = new Set<number>();\n\n requestFrame(callback: () => void): void {\n const id = window.requestAnimationFrame(() => {\n this.pendingFrames.delete(id);\n callback();\n });\n this.pendingFrames.add(id);\n }\n\n cancelFrames(): void {\n this.pendingFrames.forEach((id) => window.cancelAnimationFrame(id));\n this.pendingFrames.clear();\n }\n\n /**\n * Ends the waiter when none of `properties` is transitioning after the\n * styles just written. `onTransitionEnd` only hears about transitions that\n * run: when the start and end values match -- a close that lands before the\n * open frame ever made the panel visible, or a transition that never got\n * to start -- no `transitionend` fires and the waiter would leak.\n */\n endWaiterUnlessTransitioning(\n element: HTMLElement,\n properties: string[]\n ): void {\n // Without the Web Animations API there is no way to tell; leave it to\n // `onTransitionEnd`.\n if (typeof element.getAnimations !== 'function') {\n return;\n }\n\n const isTransitioning = element\n .getAnimations()\n .some(\n (animation) =>\n 'transitionProperty' in animation &&\n properties.includes((animation as CSSTransition).transitionProperty)\n );\n\n if (!isTransitioning) {\n this.endWaiter();\n }\n }\n\n onTransitionEnd = (event: TransitionEvent) => {\n // `transitionend` bubbles, so ignore transitions of our own descendants.\n // Otherwise any child that animates height/opacity would get our inline\n // styles stamped onto it.\n if (event.target !== event.currentTarget) {\n return;\n }\n\n const element = event.currentTarget as HTMLElement;\n\n if (\n (event.propertyName === 'height' || event.propertyName == 'opacity') &&\n this.args.isOpen\n ) {\n element.style.height = 'auto';\n element.style.overflow = '';\n }\n if (this.waiterToken) {\n // End the waiter once the transition that matters for the current\n // direction (open/close, with/without initialHeight) has settled.\n if (\n (this.args.isOpen && event.propertyName === 'height') ||\n (!this.args.isOpen &&\n event.propertyName === 'opacity' &&\n element.style.opacity == '0') ||\n (this.args.isOpen &&\n event.propertyName === 'opacity' &&\n element.style.opacity == '1') ||\n (!this.args.isOpen &&\n this.initialHeight &&\n event.propertyName === 'height')\n ) {\n this.endWaiter();\n } else if (\n event.propertyName === 'height' ||\n event.propertyName === 'opacity'\n ) {\n // The transition the condition above waits for may never have run\n // (see `endWaiterUnlessTransitioning`); settle once nothing is left.\n this.endWaiterUnlessTransitioning(element, ['height', 'opacity']);\n }\n }\n };\n\n heightTransition(duration: number): string {\n return `height ${duration}s cubic-bezier(0.4, 0, 0.2, 1) 0ms`;\n }\n\n opacityTransition(duration: number): string {\n return `opacity ${duration}s ease-in-out 0ms`;\n }\n\n expand(element: HTMLElement): void {\n this.isCurrentlyOpen = true;\n this.cancelFrames();\n\n // The transition is written as an inline style, so a\n // `motion-reduce:transition-none` class could never beat it. The check has\n // to happen here.\n //\n // Height, overflow and opacity below land where `onTransitionEnd` leaves\n // them at the end of a normal expand. `transition` is the one property\n // that differs: the animated path never clears it, so an element that has\n // animated keeps an inline `transition` at rest while this path clears it.\n // Nothing reads that property between runs, so the asymmetry is harmless\n // -- but it is why this is not, strictly, the same terminal state.\n if (prefersReducedMotion()) {\n element.style.transition = '';\n element.style.overflow = '';\n element.style.opacity = '1';\n element.style.height = 'auto';\n this.endWaiter();\n return;\n }\n\n element.style.transition = [\n this.heightTransition(0.4),\n this.opacityTransition(0.3)\n ].join(', ');\n element.style.overflow = 'hidden';\n\n const height = element.scrollHeight;\n this.requestFrame(() => {\n element.style.opacity = '1';\n element.style.height = `${height}px`;\n this.endWaiterUnlessTransitioning(element, ['height', 'opacity']);\n });\n }\n\n /**\n * The geometry a collapsed panel ends at.\n *\n * Shared by the animated path's final frame and the reduced-motion early\n * return. Extracted rather than written twice: these two have to agree\n * about what \"closed\" means, and a second copy is only a way for them to\n * drift apart.\n */\n applyClosedState(element: HTMLElement): void {\n const initialHeight = this.initialHeight;\n\n if (!initialHeight) {\n element.style.opacity = '0';\n }\n element.style.height = initialHeight || '0';\n }\n\n contract(element: HTMLElement): void {\n this.isCurrentlyOpen = false;\n this.cancelFrames();\n\n if (prefersReducedMotion()) {\n element.style.transition = '';\n element.style.overflow = 'hidden';\n this.applyClosedState(element);\n this.endWaiter();\n return;\n }\n\n const height = element.scrollHeight;\n element.style.transition = '';\n element.style.overflow = 'hidden';\n\n this.requestFrame(() => {\n element.style.height = `${height}px`;\n element.style.transition = [\n this.heightTransition(0.2),\n this.opacityTransition(0.3)\n ].join(', ');\n\n this.requestFrame(() => {\n this.applyClosedState(element);\n this.endWaiterUnlessTransitioning(element, ['height', 'opacity']);\n });\n });\n }\n\n <template>\n <div\n style={{this.styles}}\n ...attributes\n {{this.update @isOpen}}\n {{on \"transitionend\" this.onTransitionEnd}}\n >\n {{yield}}\n </div>\n </template>\n}\n\nexport { Collapsible, type CollapsibleSignature };\nexport default Collapsible;\n"],"names":["waiter","buildWaiter","parseHeight","value","undefined","test","document","probe","createElement","style","height","Collapsible","Component","isInitiallyOpen","waiterToken","isCurrentlyOpen","constructor","owner","args","isOpen","initialHeight","styles","opacity","overflow","safeStyles","hasSetupUpdate","update","modifier","element","endWaiter","beginAsync","expand","contract","token","endAsync","willDestroy","cancelFrames","pendingFrames","Set","requestFrame","callback","id","window","requestAnimationFrame","delete","add","forEach","cancelAnimationFrame","clear","endWaiterUnlessTransitioning","properties","getAnimations","isTransitioning","some","animation","includes","transitionProperty","onTransitionEnd","event","target","currentTarget","propertyName","heightTransition","duration","opacityTransition","prefersReducedMotion","transition","join","scrollHeight","applyClosedState","setComponentTemplate","precompileTemplate","strictMode","scope","on"],"mappings":";;;;;;;;;AAQA,MAAMA,SAASC,WAAA,CAAY,sBAAA,CAAA;AAE3B;;;;;;;;;;;AAWA,SAASC,YAAYC,KAAyB,EAAqB;EACjE,IAAI,CAACA,KAAA,EAAO;AACV,IAAA,OAAOC,SAAA;AACT,EAAA;AAEA;AACA;AACA;AACA,EAAA,IAAI,MAAA,CAAOC,IAAI,CAACF,KAAA,CAAA,EAAQ;AACtB,IAAA,OAAOC,SAAA;AACT,EAAA;AAEA,EAAA,IAAI,OAAOE,aAAa,WAAA,EAAa;AACnC,IAAA,OAAOH,KAAA;AACT,EAAA;AAEA,EAAA,MAAMI,KAAA,GAAQD,QAAA,CAASE,aAAa,CAAC,KAAA,CAAA;AACrCD,EAAAA,KAAA,CAAME,KAAK,CAACC,MAAM,GAAGP,KAAA;AAErB,EAAA,OAAOI,KAAA,CAAME,KAAK,CAACC,MAAM,IAAIN,SAAA;AAC/B;AA2BA,MAAMO,oBAAoBC,SAAA,CAAU;AAClCC,EAAAA,eAAA,GAAkB,KAAA;EAClBC,WAAA;AACAC,EAAAA,eAAA,GAAkB,KAAA;AAElBC,EAAAA,WAAAA,CAAYC,KAAY,EAAEC,IAAqB,EAAE;AAC/C,IAAA,KAAK,CAACD,KAAA,EAAOC,IAAA,CAAA;AAEb,IAAA,IAAI,IAAI,CAACA,IAAI,CAACC,MAAM,EAAE;MACpB,IAAI,CAACN,eAAe,GAAG,IAAA;MACvB,IAAI,CAACE,eAAe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AAgB,CAAC,GAAA,CAAA,EACtB,IAAI,CAACE,iBAAiB,CAAC,GAAA,CAAA,CACxB,CAACG,IAAI,CAAC,IAAA,CAAA;MAEP,IAAI,CAAC5B,YAAY,CAAC,MAAA;AAChB,QAAA,IAAI,CAAC8B,gBAAgB,CAACzC,OAAA,CAAA;QACtB,IAAI,CAACqB,4BAA4B,CAACrB,OAAA,EAAS,CAAC,QAAA,EAAU,SAAA,CAAU,CAAA;AAClE,MAAA,CAAA,CAAA;AACF,IAAA,CAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAA0C,oBAAA,CAAAC,kBAAA,CAAA,sIAAA,EASA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
1
|
+
{"version":3,"file":"collapsible.js","sources":["../../../src/components/utilities/collapsible.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { buildWaiter } from '@ember/test-waiters';\nimport { on } from '@ember/modifier';\nimport { modifier } from 'ember-modifier';\nimport safeStyles from '../../utils/safe-styles';\nimport { prefersReducedMotion } from '../../utils/prefers-reduced-motion';\nimport type Owner from '@ember/owner';\n\nconst waiter = buildWaiter('frontile:collapsible');\n\n/**\n * Runs a caller-supplied height through the browser's own CSS parser.\n *\n * `@initialHeight` ends up in an inline `style` attribute, so a value such as\n * `10px; position: fixed` would otherwise smuggle in a second declaration.\n * Assigning it to a detached element's `style.height` lets the CSSOM decide:\n * it accepts every real height (`10px`, `2rem`, `50%`, `0`,\n * `calc(1rem + 2px)`, `var(--x)`, …) and drops anything it cannot parse as a\n * single height value — a trailing declaration included. Returns the parsed\n * value, or `undefined` when the input is unusable.\n */\nfunction parseHeight(value: string | undefined): string | undefined {\n if (!value) {\n return undefined;\n }\n\n // Reject anything that could terminate the declaration up front. The CSSOM\n // check below catches this too, but the explicit test keeps the guarantee\n // even where `document` has no real CSS parser (SSR / prerender).\n if (/[;}]/.test(value)) {\n return undefined;\n }\n\n if (typeof document === 'undefined') {\n return value;\n }\n\n const probe = document.createElement('div');\n probe.style.height = value;\n\n return probe.style.height || undefined;\n}\n\ninterface CollapsibleArgs {\n /**\n * If true, the content will be visible\n */\n isOpen: boolean;\n\n /**\n * The height for the content in it's collapsed state.\n * The unit of the value should be included, eg. '10px'. Any CSS height is\n * accepted (`2rem`, `50%`, `calc(1rem + 2px)`, …); a value the CSS parser\n * rejects is ignored and the content collapses to `0`.\n *\n * @defaultValue 0\n */\n initialHeight?: string;\n\n /**\n * When true, an `@isOpen` change that lands before the first animation\n * frame after the element is inserted is applied without a transition, as\n * if it had been the initial state. For callers that only learn their open\n * state right after the first render (e.g. once their children have\n * registered), so the content does not visibly slide open on load. Later\n * changes animate as usual. Read once, when the element is inserted.\n *\n * @defaultValue false\n */\n instantUntilPainted?: boolean;\n}\n\ninterface CollapsibleSignature {\n Args: CollapsibleArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nclass Collapsible extends Component<CollapsibleSignature> {\n isInitiallyOpen = false;\n waiterToken?: unknown;\n isCurrentlyOpen = false;\n\n constructor(owner: Owner, args: CollapsibleArgs) {\n super(owner, args);\n\n if (this.args.isOpen) {\n this.isInitiallyOpen = true;\n this.isCurrentlyOpen = true;\n }\n }\n\n /**\n * `@initialHeight`, validated by the CSS parser. `undefined` when it was not\n * given or could not be parsed as a height, in which case the collapsed\n * state falls back to `0`.\n */\n get initialHeight(): string | undefined {\n return parseHeight(this.args.initialHeight);\n }\n\n get styles(): ReturnType<typeof safeStyles> {\n let styles: Record<string, string | number> = {};\n const initialHeight = this.initialHeight;\n\n if (!this.isInitiallyOpen) {\n styles = {\n ...styles,\n height: initialHeight || 0,\n opacity: initialHeight ? '1' : '0'\n };\n }\n\n if (initialHeight || !this.isInitiallyOpen) {\n styles = {\n ...styles,\n overflow: 'hidden'\n };\n }\n\n return safeStyles(styles);\n }\n\n /**\n * False from insert until the first animation frame, while\n * `@instantUntilPainted` is set; changes in that window skip the transition.\n */\n isPainted = true;\n paintFrame?: number;\n\n hasSetupUpdate = false;\n update = modifier((element: HTMLElement, [isOpen]: boolean[]) => {\n // do not run update on the initial setup of modifier\n if (!this.hasSetupUpdate) {\n this.hasSetupUpdate = true;\n if (this.args.instantUntilPainted) {\n this.isPainted = false;\n // Kept apart from `pendingFrames`: expand/contract cancel those.\n this.paintFrame = window.requestAnimationFrame(() => {\n this.paintFrame = undefined;\n this.isPainted = true;\n });\n }\n return;\n }\n\n if (this.isCurrentlyOpen !== !!isOpen) {\n // A previous transition may still be in flight; end its token first so\n // toggling faster than the animation cannot leak a test waiter.\n this.endWaiter();\n this.waiterToken = waiter.beginAsync();\n }\n\n const instant = !this.isPainted;\n if (isOpen) {\n this.expand(element, instant);\n } else {\n this.contract(element, instant);\n }\n });\n\n endWaiter(): void {\n if (this.waiterToken) {\n const token = this.waiterToken;\n // Clear before ending so the same token can never be ended twice.\n this.waiterToken = undefined;\n waiter.endAsync(token);\n }\n }\n\n willDestroy(): void {\n super.willDestroy();\n this.cancelFrames();\n if (this.paintFrame !== undefined) {\n window.cancelAnimationFrame(this.paintFrame);\n }\n // Do not leave a waiter pending if we are torn down mid-transition.\n this.endWaiter();\n }\n\n /**\n * Frames scheduled by the current `expand`/`contract`. A frame left over\n * from the previous direction would otherwise still apply its styles after\n * the toggle, e.g. making a panel that was just closed visible again.\n */\n pendingFrames = new Set<number>();\n\n requestFrame(callback: () => void): void {\n const id = window.requestAnimationFrame(() => {\n this.pendingFrames.delete(id);\n callback();\n });\n this.pendingFrames.add(id);\n }\n\n cancelFrames(): void {\n this.pendingFrames.forEach((id) => window.cancelAnimationFrame(id));\n this.pendingFrames.clear();\n }\n\n /**\n * Ends the waiter when none of `properties` is transitioning after the\n * styles just written. `onTransitionEnd` only hears about transitions that\n * run: when the start and end values match -- a close that lands before the\n * open frame ever made the panel visible, or a transition that never got\n * to start -- no `transitionend` fires and the waiter would leak.\n */\n endWaiterUnlessTransitioning(\n element: HTMLElement,\n properties: string[]\n ): void {\n // Without the Web Animations API there is no way to tell; leave it to\n // `onTransitionEnd`.\n if (typeof element.getAnimations !== 'function') {\n return;\n }\n\n const isTransitioning = element\n .getAnimations()\n .some(\n (animation) =>\n 'transitionProperty' in animation &&\n properties.includes((animation as CSSTransition).transitionProperty)\n );\n\n if (!isTransitioning) {\n this.endWaiter();\n }\n }\n\n onTransitionEnd = (event: TransitionEvent) => {\n // `transitionend` bubbles, so ignore transitions of our own descendants.\n // Otherwise any child that animates height/opacity would get our inline\n // styles stamped onto it.\n if (event.target !== event.currentTarget) {\n return;\n }\n\n const element = event.currentTarget as HTMLElement;\n\n if (\n (event.propertyName === 'height' || event.propertyName == 'opacity') &&\n this.args.isOpen\n ) {\n element.style.height = 'auto';\n element.style.overflow = '';\n }\n if (this.waiterToken) {\n // End the waiter once the transition that matters for the current\n // direction (open/close, with/without initialHeight) has settled.\n if (\n (this.args.isOpen && event.propertyName === 'height') ||\n (!this.args.isOpen &&\n event.propertyName === 'opacity' &&\n element.style.opacity == '0') ||\n (this.args.isOpen &&\n event.propertyName === 'opacity' &&\n element.style.opacity == '1') ||\n (!this.args.isOpen &&\n this.initialHeight &&\n event.propertyName === 'height')\n ) {\n this.endWaiter();\n } else if (\n event.propertyName === 'height' ||\n event.propertyName === 'opacity'\n ) {\n // The transition the condition above waits for may never have run\n // (see `endWaiterUnlessTransitioning`); settle once nothing is left.\n this.endWaiterUnlessTransitioning(element, ['height', 'opacity']);\n }\n }\n };\n\n heightTransition(duration: number): string {\n return `height ${duration}s cubic-bezier(0.4, 0, 0.2, 1) 0ms`;\n }\n\n opacityTransition(duration: number): string {\n return `opacity ${duration}s ease-in-out 0ms`;\n }\n\n expand(element: HTMLElement, instant = false): void {\n this.isCurrentlyOpen = true;\n this.cancelFrames();\n\n // Before the first paint (`@instantUntilPainted`): end where an\n // initially open panel starts, with no inline geometry at all.\n if (instant) {\n element.style.transition = '';\n element.style.overflow = this.initialHeight ? 'hidden' : '';\n element.style.opacity = '';\n element.style.height = '';\n this.endWaiter();\n return;\n }\n\n // The transition is written as an inline style, so a\n // `motion-reduce:transition-none` class could never beat it. The check has\n // to happen here.\n //\n // Height, overflow and opacity below land where `onTransitionEnd` leaves\n // them at the end of a normal expand. `transition` is the one property\n // that differs: the animated path never clears it, so an element that has\n // animated keeps an inline `transition` at rest while this path clears it.\n // Nothing reads that property between runs, so the asymmetry is harmless\n // -- but it is why this is not, strictly, the same terminal state.\n if (prefersReducedMotion()) {\n element.style.transition = '';\n element.style.overflow = '';\n element.style.opacity = '1';\n element.style.height = 'auto';\n this.endWaiter();\n return;\n }\n\n element.style.transition = [\n this.heightTransition(0.4),\n this.opacityTransition(0.3)\n ].join(', ');\n element.style.overflow = 'hidden';\n\n const height = element.scrollHeight;\n this.requestFrame(() => {\n element.style.opacity = '1';\n element.style.height = `${height}px`;\n this.endWaiterUnlessTransitioning(element, ['height', 'opacity']);\n });\n }\n\n /**\n * The geometry a collapsed panel ends at.\n *\n * Shared by the animated path's final frame and the reduced-motion early\n * return. Extracted rather than written twice: these two have to agree\n * about what \"closed\" means, and a second copy is only a way for them to\n * drift apart.\n */\n applyClosedState(element: HTMLElement): void {\n const initialHeight = this.initialHeight;\n\n if (!initialHeight) {\n element.style.opacity = '0';\n }\n element.style.height = initialHeight || '0';\n }\n\n contract(element: HTMLElement, instant = false): void {\n this.isCurrentlyOpen = false;\n this.cancelFrames();\n\n if (instant || prefersReducedMotion()) {\n element.style.transition = '';\n element.style.overflow = 'hidden';\n this.applyClosedState(element);\n this.endWaiter();\n return;\n }\n\n const height = element.scrollHeight;\n element.style.transition = '';\n element.style.overflow = 'hidden';\n\n this.requestFrame(() => {\n element.style.height = `${height}px`;\n element.style.transition = [\n this.heightTransition(0.2),\n this.opacityTransition(0.3)\n ].join(', ');\n\n this.requestFrame(() => {\n this.applyClosedState(element);\n this.endWaiterUnlessTransitioning(element, ['height', 'opacity']);\n });\n });\n }\n\n <template>\n <div\n style={{this.styles}}\n ...attributes\n {{this.update @isOpen}}\n {{on \"transitionend\" this.onTransitionEnd}}\n >\n {{yield}}\n </div>\n </template>\n}\n\nexport { Collapsible, type CollapsibleSignature };\nexport default Collapsible;\n"],"names":["waiter","buildWaiter","parseHeight","value","undefined","test","document","probe","createElement","style","height","Collapsible","Component","isInitiallyOpen","waiterToken","isCurrentlyOpen","constructor","owner","args","isOpen","initialHeight","styles","opacity","overflow","safeStyles","isPainted","paintFrame","hasSetupUpdate","update","modifier","element","instantUntilPainted","window","requestAnimationFrame","endWaiter","beginAsync","instant","expand","contract","token","endAsync","willDestroy","cancelFrames","cancelAnimationFrame","pendingFrames","Set","requestFrame","callback","id","delete","add","forEach","clear","endWaiterUnlessTransitioning","properties","getAnimations","isTransitioning","some","animation","includes","transitionProperty","onTransitionEnd","event","target","currentTarget","propertyName","heightTransition","duration","opacityTransition","transition","prefersReducedMotion","join","scrollHeight","applyClosedState","setComponentTemplate","precompileTemplate","strictMode","scope","on"],"mappings":";;;;;;;;;AAQA,MAAMA,SAASC,WAAA,CAAY,sBAAA,CAAA;AAE3B;;;;;;;;;;;AAWA,SAASC,YAAYC,KAAyB,EAAqB;EACjE,IAAI,CAACA,KAAA,EAAO;AACV,IAAA,OAAOC,SAAA;AACT,EAAA;AAEA;AACA;AACA;AACA,EAAA,IAAI,MAAA,CAAOC,IAAI,CAACF,KAAA,CAAA,EAAQ;AACtB,IAAA,OAAOC,SAAA;AACT,EAAA;AAEA,EAAA,IAAI,OAAOE,aAAa,WAAA,EAAa;AACnC,IAAA,OAAOH,KAAA;AACT,EAAA;AAEA,EAAA,MAAMI,KAAA,GAAQD,QAAA,CAASE,aAAa,CAAC,KAAA,CAAA;AACrCD,EAAAA,KAAA,CAAME,KAAK,CAACC,MAAM,GAAGP,KAAA;AAErB,EAAA,OAAOI,KAAA,CAAME,KAAK,CAACC,MAAM,IAAIN,SAAA;AAC/B;AAuCA,MAAMO,oBAAoBC,SAAA,CAAU;AAClC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CoB,OAAA,CAAQrB,KAAK,CAAC4D,UAAU,GAAG,CACzB,IAAI,CAACH,gBAAgB,CAAC,GAAA,CAAA,EACtB,IAAI,CAACE,iBAAiB,CAAC,GAAA,CAAA,CACxB,CAACG,IAAI,CAAC,IAAA,CAAA;MAEP,IAAI,CAACzB,YAAY,CAAC,MAAA;AAChB,QAAA,IAAI,CAAC2B,gBAAgB,CAAC3C,OAAA,CAAA;QACtB,IAAI,CAACuB,4BAA4B,CAACvB,OAAA,EAAS,CAAC,QAAA,EAAU,SAAA,CAAU,CAAA;AAClE,MAAA,CAAA,CAAA;AACF,IAAA,CAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAA4C,oBAAA,CAAAC,kBAAA,CAAA,sIAAA,EASA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
package/dist/forms.js
CHANGED
|
@@ -17,7 +17,7 @@ export { FormControl } from './components/forms/form-control.js';
|
|
|
17
17
|
export { Switch } from './components/forms/switch.js';
|
|
18
18
|
export { DatePicker } from './components/forms/date-picker/date-picker.js';
|
|
19
19
|
export { DEFAULT_TIME_FORMAT, formatValue, isEmptyValue, parseDate, parseRange, toWire, withTimeOf } from './components/forms/date-picker/value.js';
|
|
20
|
-
export { BOUNDS, DEFAULT_FORMAT, applyDigit, applyLetter, buildParts, carryOver, clearSegment, commitSegment, daysInMonth, deleteDigit, displaySegment, emptySegment, findSegment, fromDate, hasDateChanged, hasTextualMonth, hourOfDay, hourOnCycle, isSegment, resolveSegmentFormat, resolveTwoDigitYear, step, timeOf, toDate, toNumericFormat, withTime, withValue } from './components/forms/date-input/segments.js';
|
|
20
|
+
export { BOUNDS, DEFAULT_FORMAT, applyDigit, applyLetter, buildParts, carryOver, clearSegment, commitSegment, daysInMonth, deleteDigit, displaySegment, emptySegment, findSegment, fromDate, hasDateChanged, hasTextualMonth, hourOfDay, hourOnCycle, isSegment, resolveSegmentFormat, resolveTwoDigitYear, seedFrom, step, timeOf, toDate, toNumericFormat, withTime, withValue } from './components/forms/date-input/segments.js';
|
|
21
21
|
export { formatForClipboard, parsePasted, splitRange } from './components/forms/date-input/clipboard.js';
|
|
22
22
|
export { DateInput } from './components/forms/date-input/date-input.js';
|
|
23
23
|
export { StandardValidator } from './utils/standard-validator.js';
|
|
@@ -46,6 +46,18 @@ const IconWarning = setComponentTemplate(precompileTemplate("<svg xmlns=\"http:/
|
|
|
46
46
|
const IconDanger = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" data-test-icon=\"danger\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\" />\n</svg>", {
|
|
47
47
|
strictMode: true
|
|
48
48
|
}), templateOnly());
|
|
49
|
+
const EllipsisHorizontalIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM12.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM18.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z\" />\n</svg>", {
|
|
50
|
+
strictMode: true
|
|
51
|
+
}), templateOnly());
|
|
52
|
+
const SidebarLeftIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" stroke-width=\"2\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" ...attributes>\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M9 4v16\" />\n</svg>", {
|
|
53
|
+
strictMode: true
|
|
54
|
+
}), templateOnly());
|
|
55
|
+
const SidebarRightIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" stroke-width=\"2\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" ...attributes>\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M15 4v16\" />\n</svg>", {
|
|
56
|
+
strictMode: true
|
|
57
|
+
}), templateOnly());
|
|
58
|
+
const MenuIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" stroke-width=\"2\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" ...attributes>\n <path d=\"M4 6h16M4 12h16M4 18h16\" />\n</svg>", {
|
|
59
|
+
strictMode: true
|
|
60
|
+
}), templateOnly());
|
|
49
61
|
|
|
50
|
-
export { ColumnVisibilityIcon as C, IconChevronUpDown as I, ChevronDownIcon as a, ChevronUpIcon as b, ChevronRightIcon as c, ChevronLeftIcon as d, IconCalendar as e,
|
|
51
|
-
//# sourceMappingURL=icons-
|
|
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-55dthVFk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons-DZ61nCzv.js","sources":["../src/-private/icons.gts"],"sourcesContent":["/**\n * Icon components shared across Frontile components (buttons, forms,\n * disclosure, navigation, collections, status/notifications). Kept in one\n * place to avoid duplicating the same SVG in multiple component folders.\n */\nimport type { TOC } from '@ember/component/template-only';\n\nexport interface IconSignature {\n Element: SVGElement;\n}\n\nexport const ChevronDownIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m19.5 8.25-7.5 7.5-7.5-7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronUpIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m4.5 15.75 7.5-7.5 7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronLeftIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M15.75 19.5 8.25 12l7.5-7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronRightIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m8.25 4.5 7.5 7.5-7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronDoubleLeftIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronDoubleRightIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const IconChevronUpDown: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9\"\n />\n </svg>\n</template>;\n\nexport const IconCalendar: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0V11.25A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5\"\n />\n </svg>\n</template>;\n\nexport const ColumnVisibilityIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z\"\n />\n </svg>\n</template>;\n\nexport const IconInfo: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"info\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M11.25 11.25h.75v4.5h.75M12 8.25h.008v.008H12V8.25ZM21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n />\n </svg>\n</template>;\n\nexport const IconSuccess: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"success\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n />\n </svg>\n</template>;\n\nexport const IconWarning: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"warning\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z\"\n />\n </svg>\n</template>;\n\nexport const IconDanger: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"danger\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n />\n </svg>\n</template>;\n"],"names":["ChevronDownIcon","setComponentTemplate","precompileTemplate","strictMode","templateOnly","ChevronUpIcon","ChevronLeftIcon","ChevronRightIcon","ChevronDoubleLeftIcon","ChevronDoubleRightIcon","IconChevronUpDown","IconCalendar","ColumnVisibilityIcon","IconInfo","IconSuccess","IconWarning","IconDanger"],"mappings":";;;;AAAA;;;;;MAWaA,eAAqB,GAAAC,oBAAA,CAAiBC,kBAAA,CAAA,wQAAA,EAgBnD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGC,aAAmB,GAAAJ,oBAAA,CAAiBC,kBAAA,CAAA,wQAAA,EAgBjD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAA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AC,YAAA,EAAA;MAEGY,UAAgB,GAAAf,oBAAA,CAAiBC,kBAAA,CAAA,6UAAA,EAiB9C;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;"}
|
|
1
|
+
{"version":3,"file":"icons-55dthVFk.js","sources":["../src/-private/icons.gts"],"sourcesContent":["/**\n * Icon components shared across Frontile components (buttons, forms,\n * disclosure, navigation, collections, status/notifications). Kept in one\n * place to avoid duplicating the same SVG in multiple component folders.\n */\nimport type { TOC } from '@ember/component/template-only';\n\nexport interface IconSignature {\n Element: SVGElement;\n}\n\nexport const ChevronDownIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m19.5 8.25-7.5 7.5-7.5-7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronUpIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m4.5 15.75 7.5-7.5 7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronLeftIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M15.75 19.5 8.25 12l7.5-7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronRightIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m8.25 4.5 7.5 7.5-7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronDoubleLeftIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronDoubleRightIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const IconChevronUpDown: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9\"\n />\n </svg>\n</template>;\n\nexport const IconCalendar: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0V11.25A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5\"\n />\n </svg>\n</template>;\n\nexport const ColumnVisibilityIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z\"\n />\n </svg>\n</template>;\n\nexport const IconInfo: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"info\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M11.25 11.25h.75v4.5h.75M12 8.25h.008v.008H12V8.25ZM21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n />\n </svg>\n</template>;\n\nexport const IconSuccess: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"success\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n />\n </svg>\n</template>;\n\nexport const IconWarning: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"warning\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z\"\n />\n </svg>\n</template>;\n\nexport const IconDanger: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"danger\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n />\n </svg>\n</template>;\n\nexport const EllipsisHorizontalIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n width=\"20\"\n height=\"20\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M6.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM12.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM18.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z\"\n />\n </svg>\n</template>;\n\nexport const SidebarLeftIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n width=\"20\"\n height=\"20\"\n stroke-width=\"2\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n ...attributes\n >\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M9 4v16\" />\n </svg>\n</template>;\n\nexport const SidebarRightIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n width=\"20\"\n height=\"20\"\n stroke-width=\"2\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n ...attributes\n >\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" />\n <path d=\"M15 4v16\" />\n </svg>\n</template>;\n\nexport const MenuIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n width=\"20\"\n height=\"20\"\n stroke-width=\"2\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path d=\"M4 6h16M4 12h16M4 18h16\" />\n </svg>\n</template>;\n"],"names":["ChevronDownIcon","setComponentTemplate","precompileTemplate","strictMode","templateOnly","ChevronUpIcon","ChevronLeftIcon","ChevronRightIcon","ChevronDoubleLeftIcon","ChevronDoubleRightIcon","IconChevronUpDown","IconCalendar","ColumnVisibilityIcon","IconInfo","IconSuccess","IconWarning","IconDanger","EllipsisHorizontalIcon","SidebarLeftIcon","SidebarRightIcon","MenuIcon"],"mappings":";;;;AAAA;;;;;MAWaA,eAAqB,GAAAC,oBAA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AA,CAAiBC,kBAAA,CAAA,uUAAA,EAiB/C;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGW,WAAiB,GAAAd,oBAAA,CAAiBC,kBAAA,CAAA,ybAAA,EAiB/C;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGY,UAAgB,GAAAf,oBAAA,CAAiBC,kBAAA,CAAA,6UAAA,EAiB9C;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGa,sBAA4B,GAAAhB,oBAAA,CAAiBC,kBAAA,CAAA,wZAAA,EAkB1D;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGc,eAAqB,GAAAjB,oBAAA,CAAiBC,kBAAA,CAAA,8UAAA,EAiBnD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGe,gBAAsB,GAAAlB,oBAAA,CAAiBC,kBAAA,CAAA,+UAAA,EAiBpD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGgB,QAAc,GAAAnB,oBAAA,CAAiBC,kBAAA,CAAA,8RAAA,EAgB5C;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;"}
|
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ export { FormControl } from './components/forms/form-control.js';
|
|
|
34
34
|
export { Switch } from './components/forms/switch.js';
|
|
35
35
|
export { DatePicker } from './components/forms/date-picker/date-picker.js';
|
|
36
36
|
export { DEFAULT_TIME_FORMAT, formatValue, isEmptyValue, parseDate, parseRange, toWire, withTimeOf } from './components/forms/date-picker/value.js';
|
|
37
|
-
export { BOUNDS, DEFAULT_FORMAT, applyDigit, applyLetter, buildParts, carryOver, clearSegment, commitSegment, daysInMonth, deleteDigit, displaySegment, emptySegment, findSegment, fromDate, hasDateChanged, hasTextualMonth, hourOfDay, hourOnCycle, isSegment, resolveSegmentFormat, resolveTwoDigitYear, step, timeOf, toDate, toNumericFormat, withTime, withValue } from './components/forms/date-input/segments.js';
|
|
37
|
+
export { BOUNDS, DEFAULT_FORMAT, applyDigit, applyLetter, buildParts, carryOver, clearSegment, commitSegment, daysInMonth, deleteDigit, displaySegment, emptySegment, findSegment, fromDate, hasDateChanged, hasTextualMonth, hourOfDay, hourOnCycle, isSegment, resolveSegmentFormat, resolveTwoDigitYear, seedFrom, step, timeOf, toDate, toNumericFormat, withTime, withValue } from './components/forms/date-input/segments.js';
|
|
38
38
|
export { formatForClipboard, parsePasted, splitRange } from './components/forms/date-input/clipboard.js';
|
|
39
39
|
export { DateInput } from './components/forms/date-input/date-input.js';
|
|
40
40
|
export { StandardValidator } from './utils/standard-validator.js';
|
|
@@ -70,6 +70,10 @@ export { READY_ATTRIBUTE, selectionIndicator } from './utils/selection-indicator
|
|
|
70
70
|
export { rovingFocus } from './utils/roving-focus.js';
|
|
71
71
|
export { PressEvent, default as press } from './modifiers/press.js';
|
|
72
72
|
export { default as dragToDismiss } from './modifiers/drag-to-dismiss.js';
|
|
73
|
+
export { Stepper } from './components/navigation/stepper/stepper.js';
|
|
74
|
+
export { StepperList } from './components/navigation/stepper/list.js';
|
|
75
|
+
export { StepperStep } from './components/navigation/stepper/step.js';
|
|
76
|
+
export { StepperPanel } from './components/navigation/stepper/panel.js';
|
|
73
77
|
export { Tabs, TabsList } from './components/navigation/tabs/tabs.js';
|
|
74
78
|
export { TabsTab } from './components/navigation/tabs/tab.js';
|
|
75
79
|
export { TabsPanel } from './components/navigation/tabs/panel.js';
|
|
@@ -85,8 +89,21 @@ export { Accordion } from './components/disclosure/accordion/accordion.js';
|
|
|
85
89
|
export { AccordionItem } from './components/disclosure/accordion/item.js';
|
|
86
90
|
import './manager-Dge4r8Vn.js';
|
|
87
91
|
import '@ember/service';
|
|
88
|
-
export { N as NotificationCard } from './notification-card-
|
|
92
|
+
export { N as NotificationCard } from './notification-card-BPfDo-Gf.js';
|
|
89
93
|
export { NotificationsContainer } from './components/notifications/notifications-container.js';
|
|
94
|
+
export { AppLayoutState } from './components/layout/app-layout-state.js';
|
|
95
|
+
export { AppLayout } from './components/layout/app-layout.js';
|
|
96
|
+
export { Aside } from './components/layout/aside.js';
|
|
97
|
+
export { AsideToggle } from './components/layout/aside-toggle.js';
|
|
98
|
+
export { BottomNav } from './components/layout/bottom-nav.js';
|
|
99
|
+
export { BottomNavMore } from './components/layout/bottom-nav-more.js';
|
|
100
|
+
export { Main } from './components/layout/main.js';
|
|
101
|
+
export { MenuToggle } from './components/layout/menu-toggle.js';
|
|
102
|
+
export { Navbar } from './components/layout/navbar.js';
|
|
103
|
+
export { PageHeader } from './components/layout/page-header.js';
|
|
104
|
+
export { Sidebar } from './components/layout/sidebar.js';
|
|
105
|
+
export { SidebarGroup } from './components/layout/sidebar-group.js';
|
|
106
|
+
export { SidebarToggle } from './components/layout/sidebar-toggle.js';
|
|
90
107
|
export { ListboxGroup } from './components/collections/listbox/group.js';
|
|
91
108
|
export { ListboxItem } from './components/collections/listbox/item.js';
|
|
92
109
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/layout.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { AppLayoutState } from './components/layout/app-layout-state.js';
|
|
2
|
+
export { AppLayout } from './components/layout/app-layout.js';
|
|
3
|
+
export { Aside } from './components/layout/aside.js';
|
|
4
|
+
export { AsideToggle } from './components/layout/aside-toggle.js';
|
|
5
|
+
export { BottomNav } from './components/layout/bottom-nav.js';
|
|
6
|
+
export { BottomNavMore } from './components/layout/bottom-nav-more.js';
|
|
7
|
+
export { Main } from './components/layout/main.js';
|
|
8
|
+
export { MenuToggle } from './components/layout/menu-toggle.js';
|
|
9
|
+
export { Navbar } from './components/layout/navbar.js';
|
|
10
|
+
export { PageHeader } from './components/layout/page-header.js';
|
|
11
|
+
export { Sidebar } from './components/layout/sidebar.js';
|
|
12
|
+
export { SidebarGroup } from './components/layout/sidebar-group.js';
|
|
13
|
+
export { SidebarToggle } from './components/layout/sidebar-toggle.js';
|
|
14
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
package/dist/navigation.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export { Stepper } from './components/navigation/stepper/stepper.js';
|
|
2
|
+
export { StepperList } from './components/navigation/stepper/list.js';
|
|
3
|
+
export { StepperStep } from './components/navigation/stepper/step.js';
|
|
4
|
+
export { StepperPanel } from './components/navigation/stepper/panel.js';
|
|
1
5
|
export { Tabs, TabsList } from './components/navigation/tabs/tabs.js';
|
|
2
6
|
export { TabsTab } from './components/navigation/tabs/tab.js';
|
|
3
7
|
export { TabsPanel } from './components/navigation/tabs/panel.js';
|
package/dist/navigation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"navigation.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -7,7 +7,7 @@ import { fn } from '@ember/helper';
|
|
|
7
7
|
import { CloseButton } from './components/buttons/close-button.js';
|
|
8
8
|
import { Button } from './components/buttons/button.js';
|
|
9
9
|
import { Spinner } from './components/utilities/spinner.js';
|
|
10
|
-
import {
|
|
10
|
+
import { i as IconDanger, j as IconWarning, k as IconSuccess, l as IconInfo } from './icons-55dthVFk.js';
|
|
11
11
|
import { useStyles } from '@frontile/theme';
|
|
12
12
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
13
13
|
import { setComponentTemplate } from '@ember/component';
|
|
@@ -330,4 +330,4 @@ class NotificationCard extends Component {
|
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
export { NotificationCard as N, NotificationStack as a };
|
|
333
|
-
//# sourceMappingURL=notification-card-
|
|
333
|
+
//# sourceMappingURL=notification-card-BPfDo-Gf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-card-dz-eE6z9.js","sources":["../src/-private/notification-stack.ts","../src/components/notifications/notification-card.gts"],"sourcesContent":["import type { containerPlacement } from './types';\n\n/**\n * How much each card behind the front of the stack shrinks, as a fraction.\n */\nconst SCALE_STEP = 0.05;\n\n/**\n * Cards are pinned to the placement edge, so a top placement stacks\n * downwards and a bottom placement stacks upwards. Exported so\n * notification-card.gts's own enter/exit slide direction can share this\n * instead of re-deriving it from the placement string.\n */\nfunction isTopPlacement(placement: containerPlacement): boolean {\n return placement.startsWith('top');\n}\n\ninterface NotificationStackInput {\n /**\n * Measured card heights in px, ordered front-first (index 0 is the newest\n * notification). A card that has not been measured yet contributes 0.\n */\n heights: number[];\n\n isExpanded: boolean;\n\n /**\n * Peek offset between collapsed cards, and the gap between expanded cards.\n */\n gap: number;\n\n /**\n * How many cards stay visible while collapsed.\n */\n visibleToasts: number;\n\n placement: containerPlacement;\n}\n\ninterface CardGeometry {\n transform: string;\n zIndex: number;\n opacity: number;\n\n /**\n * Fixed height in px while collapsed, so a taller card behind the front one\n * cannot stick out past it. `null` means the card sizes to its content.\n */\n height: number | null;\n\n transformOrigin: 'top center' | 'bottom center';\n\n /**\n * `'none'` when the card is fully transparent (collapsed beyond\n * `visibleToasts`), so it cannot swallow clicks meant for the page beneath\n * it; `'auto'` otherwise.\n */\n pointerEvents: 'auto' | 'none';\n}\n\n/**\n * Pure geometry for the notification stack: given measured card heights and\n * the current expansion state, it produces the transform for each card and\n * the height the container should animate to.\n *\n * Deliberately free of Ember and DOM dependencies so the layout maths can be\n * tested on its own.\n */\nclass NotificationStack {\n readonly heights: number[];\n readonly isExpanded: boolean;\n readonly gap: number;\n readonly visibleToasts: number;\n readonly placement: containerPlacement;\n\n constructor(input: NotificationStackInput) {\n this.heights = input.heights;\n this.isExpanded = input.isExpanded;\n this.gap = input.gap;\n this.visibleToasts = input.visibleToasts;\n this.placement = input.placement;\n }\n\n get isTopPlacement(): boolean {\n return isTopPlacement(this.placement);\n }\n\n /**\n * Cards are pinned to the placement edge, so a top placement stacks\n * downwards and a bottom placement stacks upwards.\n */\n get directionSign(): number {\n return this.isTopPlacement ? 1 : -1;\n }\n\n get transformOrigin(): CardGeometry['transformOrigin'] {\n return this.isTopPlacement ? 'top center' : 'bottom center';\n }\n\n get count(): number {\n return this.heights.length;\n }\n\n get frontHeight(): number {\n return this.heights[0] ?? 0;\n }\n\n geometryFor(index: number): CardGeometry {\n const zIndex = this.count - index;\n\n if (this.isExpanded) {\n return {\n transform: `translateY(${this.directionSign * this.offsetBefore(index)}px) scale(1)`,\n zIndex,\n opacity: 1,\n height: null,\n transformOrigin: this.transformOrigin,\n pointerEvents: 'auto'\n };\n }\n\n const offset = index * this.gap;\n const scale = Math.max(0, 1 - index * SCALE_STEP);\n const isVisible = index < this.visibleToasts;\n\n return {\n transform: `translateY(${this.directionSign * offset}px) scale(${scale})`,\n zIndex,\n opacity: isVisible ? 1 : 0,\n // The front card must size to its own content (`null`). Clamping it to\n // `frontHeight` would be self-referential — `frontHeight` *is* the\n // front card's own measurement — and would permanently lock in\n // whatever height was measured first, before content (e.g. a long\n // description) finished laying out. Only cards behind the front one\n // need clamping, so a taller card further back can't poke out past it.\n height: index === 0 ? null : this.frontHeight,\n transformOrigin: this.transformOrigin,\n // A card past `visibleToasts` is fully transparent while collapsed;\n // without this it would still sit in the fixed-position stack and\n // swallow clicks meant for the page beneath it.\n pointerEvents: isVisible ? 'auto' : 'none'\n };\n }\n\n get containerHeight(): number {\n if (this.count === 0) {\n return 0;\n }\n\n if (this.isExpanded) {\n return this.offsetBefore(this.count) - this.gap;\n }\n\n const visible = Math.min(this.count, this.visibleToasts);\n return this.frontHeight + (visible - 1) * this.gap;\n }\n\n /**\n * Distance from the placement edge to the leading edge of `index`, i.e. the\n * summed heights and gaps of every card in front of it.\n */\n private offsetBefore(index: number): number {\n let offset = 0;\n\n for (let i = 0; i < index; i++) {\n offset += (this.heights[i] ?? 0) + this.gap;\n }\n\n return offset;\n }\n}\n\nexport { NotificationStack, isTopPlacement };\nexport type { NotificationStackInput, CardGeometry };\n","import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { modifier } from 'ember-modifier';\nimport { service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport { fn } from '@ember/helper';\nimport { CloseButton } from '../buttons/close-button';\nimport { Button } from '../buttons/button';\nimport { Spinner } from '../utilities/spinner';\nimport {\n IconInfo,\n IconSuccess,\n IconWarning,\n IconDanger\n} from '../../-private/icons';\nimport { useStyles } from '@frontile/theme';\n\nimport type NotificationsService from '../../services/notifications';\nimport type Notification from '../../-private/notification';\nimport { isTopPlacement } from '../../-private/notification-stack';\nimport type { CardGeometry } from '../../-private/notification-stack';\nimport type {\n CustomAction,\n containerPlacement,\n NotificationStatus\n} from '../../-private/types';\nimport type { SafeString } from '@ember/template';\n\n/**\n * Everything that varies by `NotificationStatus`, keyed in one place so\n * adding a status means adding one row here instead of remembering to\n * touch an icon map, an action-colour map, and the `role` getter's cascade\n * separately.\n */\nconst STATUS_CONFIG = {\n neutral: {\n icon: IconInfo,\n // Button colour for the primary custom action. Also reused as the\n // loading <Spinner>'s `@color` (its colour union has the same\n // neutral/primary/success/warning/danger shape), so the spinner's arc\n // matches the same accent the card's custom action button would use.\n actionColor: 'neutral',\n // `alert` interrupts a screen reader, so it is reserved for the\n // statuses that warrant interrupting. This coupling is why the prop is\n // `@status` and not `@color`.\n role: 'status'\n },\n // Formerly `info`, which already painted `primary`'s classes. The info\n // glyph stays attached to `primary`.\n primary: {\n icon: IconInfo,\n actionColor: 'primary',\n role: 'status'\n },\n success: {\n icon: IconSuccess,\n actionColor: 'success',\n role: 'status'\n },\n warning: {\n icon: IconWarning,\n actionColor: 'warning',\n role: 'alert'\n },\n danger: {\n icon: IconDanger,\n actionColor: 'danger',\n role: 'alert'\n }\n} as const satisfies Record<\n NotificationStatus,\n {\n icon: unknown;\n actionColor: 'neutral' | 'primary' | 'success' | 'warning' | 'danger';\n role: 'status' | 'alert';\n }\n>;\n\ninterface NotificationCardSignature {\n Args: {\n notification: Notification<Record<string, unknown>>;\n placement: containerPlacement;\n\n /**\n * The visual style of the card.\n *\n * @defaultValue 'surface'\n */\n variant?: 'surface' | 'soft' | 'solid';\n\n /**\n * Position, scale, and stacking supplied by the container. When omitted\n * the card renders in place with no stack transform.\n *\n * Part of the container/card plumbing, not a consumer-facing argument.\n *\n * @internal\n */\n geometry?: CardGeometry;\n\n /**\n * Called with the card's measured height whenever it changes.\n *\n * Part of the container/card plumbing, not a consumer-facing argument.\n *\n * @internal\n */\n onMeasure?: (height: number) => void;\n };\n Element: HTMLDivElement;\n}\n\nclass NotificationCard extends Component<NotificationCardSignature> {\n @service notifications!: NotificationsService;\n\n /**\n * False for the first frame so the card can transition in from the\n * placement edge rather than appearing at its resting position.\n */\n @tracked hasEntered = false;\n\n get isTopPlacement(): boolean {\n return isTopPlacement(this.args.placement || 'bottom-right');\n }\n\n get status(): NotificationStatus {\n return this.args.notification.status;\n }\n\n get icon() {\n return STATUS_CONFIG[this.status].icon;\n }\n\n get actionColor() {\n return STATUS_CONFIG[this.status].actionColor;\n }\n\n get role(): 'status' | 'alert' {\n return STATUS_CONFIG[this.status].role;\n }\n\n get style(): SafeString {\n const { geometry, notification } = this.args;\n // The theme owns the whole `transition-duration` shorthand (and its\n // `motion-reduce:` override) so the per-property duration order can\n // never drift out of sync with `transition-[transform,opacity,height]`\n // across the component boundary — see notification-card.ts. This card\n // only supplies the one value `@transitionDuration` actually governs\n // (the enter/exit fade), as a custom property the theme's `var()` reads.\n const declarations = [\n `--frontile-toast-fade: ${notification.transitionDuration}ms`\n ];\n\n // The static edge-pinning (`position: absolute` + `left/right/top` or\n // `bottom`) lives in the `stackPlacement` theme variant (see\n // `this.classes`) rather than here, since it never varies frame to\n // frame — only the geometry-driven parts below (transform, opacity,\n // height, z-index, transform-origin) need to be inline, because a\n // `style` attribute passed through `...attributes` replaces the\n // element's own `style` outright and would drop them.\n\n if (!this.hasEntered || notification.isRemoving) {\n // Enter from, and exit to, the placement edge.\n const offset = this.isTopPlacement ? '-100%' : '100%';\n declarations.push(\n `opacity: 0`,\n `transform: translateY(${offset}) scale(0.95)`,\n // A card can be transparent-and-collapsed the instant it starts\n // exiting; keep it out of the click path either way.\n `pointer-events: none`\n );\n\n if (geometry) {\n declarations.push(\n `z-index: ${geometry.zIndex}`,\n `transform-origin: ${geometry.transformOrigin}`,\n // Preserve the collapsed height clamp through the exit\n // transition — otherwise a non-front collapsed card snaps from\n // its clamped height to `auto` for the slide-out.\n geometry.height === null\n ? `height: auto`\n : `height: ${geometry.height}px`\n );\n }\n\n return htmlSafe(declarations.join('; '));\n }\n\n if (geometry) {\n declarations.push(\n `transform: ${geometry.transform}`,\n `transform-origin: ${geometry.transformOrigin}`,\n `z-index: ${geometry.zIndex}`,\n `opacity: ${geometry.opacity}`,\n `pointer-events: ${geometry.pointerEvents}`,\n geometry.height === null\n ? `height: auto`\n : `height: ${geometry.height}px`\n );\n }\n\n return htmlSafe(declarations.join('; '));\n }\n\n /**\n * Flip to the resting position on the frame after insertion, so the browser\n * has a start value to transition from.\n */\n enter = modifier(() => {\n const frame = requestAnimationFrame(() => {\n this.hasEntered = true;\n });\n\n return () => cancelAnimationFrame(frame);\n });\n\n /**\n * Report the card's height to the container so the stack can lay itself\n * out. Also fires when promise content swaps change the height.\n *\n * `element` is the inner element (never height-constrained, so its\n * `offsetHeight` is always the content's true natural height). The border\n * lives on the outer element (`element.parentElement`), so it isn't part\n * of that number — we add it back via `outer.offsetHeight -\n * outer.clientHeight`, the outer element's vertical border width. That\n * difference is constant whether or not the outer element's height is\n * currently clamped by the collapsed-stack height, so it's safe to read\n * off the outer element even while it's clamped, and it stays correct if\n * the theme's border width ever changes.\n */\n measure = modifier((element: HTMLElement) => {\n const { onMeasure } = this.args;\n\n if (!onMeasure) {\n return;\n }\n\n const outer = element.parentElement as HTMLElement;\n\n const report = () => {\n const outerBorder = outer.offsetHeight - outer.clientHeight;\n onMeasure(element.offsetHeight + outerBorder);\n };\n\n const observer = new ResizeObserver(report);\n\n report();\n observer.observe(element);\n\n return () => observer.disconnect();\n });\n\n remove = () => {\n this.notifications.remove(this.args.notification);\n };\n\n handleClickCustomAction = (customAction: CustomAction) => {\n customAction.onClick();\n this.notifications.remove(this.args.notification);\n };\n\n get classes() {\n const { notificationCard } = useStyles();\n\n const {\n base,\n inner,\n icon,\n spinner,\n content,\n title,\n description,\n customActions,\n customActionButton,\n closeButton\n } = notificationCard({\n status: this.status,\n variant: this.args.variant || 'surface',\n hasDescription: !!this.args.notification.description,\n // Only pin the card to the placement edge once the container has\n // supplied stack geometry — see the `stackPlacement` variant's\n // comment in the theme.\n stackPlacement: this.args.geometry\n ? this.isTopPlacement\n ? 'top'\n : 'bottom'\n : 'none'\n });\n\n return {\n base: base(),\n inner: inner(),\n icon: icon(),\n spinner: spinner(),\n content: content(),\n title: title(),\n description: description(),\n customActions: customActions(),\n customActionButton: customActionButton(),\n closeButton: closeButton()\n };\n }\n\n <template>\n {{! template-lint-disable no-inline-styles style-concatenation }}\n <div\n data-component=\"notification-card\"\n data-part=\"base\"\n class={{this.classes.base}}\n style={{this.style}}\n role={{this.role}}\n data-test-notification-card\n data-test-status={{this.status}}\n {{this.enter}}\n ...attributes\n >\n {{! measure reads offsetHeight off this inner element, not the outer one above, since the outer carries the collapsed-stack height clamp. See notification-stack.ts. }}\n <div data-part=\"inner\" class={{this.classes.inner}} {{this.measure}}>\n {{#unless @notification.hideIcon}}\n {{#if @notification.isLoading}}\n <Spinner\n data-part=\"spinner\"\n @class={{this.classes.spinner}}\n @color={{this.actionColor}}\n @size=\"sm\"\n data-test-icon=\"loading\"\n />\n {{else}}\n {{#let this.icon as |Icon|}}\n <Icon data-part=\"icon\" class={{this.classes.icon}} />\n {{/let}}\n {{/if}}\n {{/unless}}\n\n <div data-part=\"content\" class={{this.classes.content}}>\n <div\n data-part=\"title\"\n class={{this.classes.title}}\n >{{@notification.title}}</div>\n\n {{#if @notification.description}}\n <div data-part=\"description\" class={{this.classes.description}}>\n {{@notification.description}}\n </div>\n {{/if}}\n </div>\n\n {{#if @notification.customActions}}\n <div data-part=\"custom-actions\" class={{this.classes.customActions}}>\n {{#each @notification.customActions as |customAction index|}}\n <Button\n data-part=\"custom-action-button\"\n @size=\"xs\"\n @color={{if index \"neutral\" this.actionColor}}\n @variant={{if index \"plain\" \"solid\"}}\n @class={{this.classes.customActionButton}}\n @onPress={{fn this.handleClickCustomAction customAction}}\n >\n {{customAction.label}}\n </Button>\n {{/each}}\n </div>\n {{/if}}\n\n {{#if @notification.allowClosing}}\n <CloseButton\n data-part=\"close-button\"\n @onPress={{this.remove}}\n @size=\"sm\"\n @class={{this.classes.closeButton}}\n />\n {{/if}}\n </div>\n </div>\n </template>\n}\n\nexport { NotificationCard, type NotificationCardSignature };\nexport default NotificationCard;\n"],"names":["SCALE_STEP","isTopPlacement","placement","startsWith","NotificationStack","heights","isExpanded","gap","visibleToasts","constructor","input","directionSign","transformOrigin","count","length","frontHeight","geometryFor","index","zIndex","transform","offsetBefore","opacity","height","pointerEvents","offset","scale","Math","max","isVisible","containerHeight","visible","min","i","STATUS_CONFIG","neutral","icon","IconInfo","actionColor","role","primary","success","IconSuccess","warning","IconWarning","danger","IconDanger","NotificationCard","Component","g","prototype","service","tracked","args","status","notification","style","geometry","declarations","transitionDuration","hasEntered","isRemoving","push","htmlSafe","join","enter","modifier","frame","requestAnimationFrame","cancelAnimationFrame","measure","element","onMeasure","outer","parentElement","report","outerBorder","offsetHeight","clientHeight","observer","ResizeObserver","observe","disconnect","remove","notifications","handleClickCustomAction","customAction","onClick","classes","notificationCard","useStyles","base","inner","spinner","content","title","description","customActions","customActionButton","closeButton","variant","hasDescription","stackPlacement","setComponentTemplate","precompileTemplate","strictMode","scope","Spinner","Button","fn","CloseButton"],"mappings":";;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,IAAI;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,cAAcA,CAACC,SAA6B,EAAW;AAC9D,EAAA,OAAOA,SAAS,CAACC,UAAU,CAAC,KAAK,CAAC;AACpC;AA6CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,CAAC;EACbC,OAAO;EACPC,UAAU;EACVC,GAAG;EACHC,aAAa;EACbN,SAAS;EAElBO,WAAWA,CAACC,KAA6B,EAAE;AACzC,IAAA,IAAI,CAACL,OAAO,GAAGK,KAAK,CAACL,OAAO;AAC5B,IAAA,IAAI,CAACC,UAAU,GAAGI,KAAK,CAACJ,UAAU;AAClC,IAAA,IAAI,CAACC,GAAG,GAAGG,KAAK,CAACH,GAAG;AACpB,IAAA,IAAI,CAACC,aAAa,GAAGE,KAAK,CAACF,aAAa;AACxC,IAAA,IAAI,CAACN,SAAS,GAAGQ,KAAK,CAACR,SAAS;AAClC,EAAA;EAEA,IAAID,cAAcA,GAAY;AAC5B,IAAA,OAAOA,cAAc,CAAC,IAAI,CAACC,SAAS,CAAC;AACvC,EAAA;;AAEA;AACF;AACA;AACA;EACE,IAAIS,aAAaA,GAAW;AAC1B,IAAA,OAAO,IAAI,CAACV,cAAc,GAAG,CAAC,GAAG,EAAE;AACrC,EAAA;EAEA,IAAIW,eAAeA,GAAoC;AACrD,IAAA,OAAO,IAAI,CAACX,cAAc,GAAG,YAAY,GAAG,e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,KAAA,EAAAA,OAAA;QAAAC,OAAA;QAAAC,MAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
1
|
+
{"version":3,"file":"notification-card-BPfDo-Gf.js","sources":["../src/-private/notification-stack.ts","../src/components/notifications/notification-card.gts"],"sourcesContent":["import type { containerPlacement } from './types';\n\n/**\n * How much each card behind the front of the stack shrinks, as a fraction.\n */\nconst SCALE_STEP = 0.05;\n\n/**\n * Cards are pinned to the placement edge, so a top placement stacks\n * downwards and a bottom placement stacks upwards. Exported so\n * notification-card.gts's own enter/exit slide direction can share this\n * instead of re-deriving it from the placement string.\n */\nfunction isTopPlacement(placement: containerPlacement): boolean {\n return placement.startsWith('top');\n}\n\ninterface NotificationStackInput {\n /**\n * Measured card heights in px, ordered front-first (index 0 is the newest\n * notification). A card that has not been measured yet contributes 0.\n */\n heights: number[];\n\n isExpanded: boolean;\n\n /**\n * Peek offset between collapsed cards, and the gap between expanded cards.\n */\n gap: number;\n\n /**\n * How many cards stay visible while collapsed.\n */\n visibleToasts: number;\n\n placement: containerPlacement;\n}\n\ninterface CardGeometry {\n transform: string;\n zIndex: number;\n opacity: number;\n\n /**\n * Fixed height in px while collapsed, so a taller card behind the front one\n * cannot stick out past it. `null` means the card sizes to its content.\n */\n height: number | null;\n\n transformOrigin: 'top center' | 'bottom center';\n\n /**\n * `'none'` when the card is fully transparent (collapsed beyond\n * `visibleToasts`), so it cannot swallow clicks meant for the page beneath\n * it; `'auto'` otherwise.\n */\n pointerEvents: 'auto' | 'none';\n}\n\n/**\n * Pure geometry for the notification stack: given measured card heights and\n * the current expansion state, it produces the transform for each card and\n * the height the container should animate to.\n *\n * Deliberately free of Ember and DOM dependencies so the layout maths can be\n * tested on its own.\n */\nclass NotificationStack {\n readonly heights: number[];\n readonly isExpanded: boolean;\n readonly gap: number;\n readonly visibleToasts: number;\n readonly placement: containerPlacement;\n\n constructor(input: NotificationStackInput) {\n this.heights = input.heights;\n this.isExpanded = input.isExpanded;\n this.gap = input.gap;\n this.visibleToasts = input.visibleToasts;\n this.placement = input.placement;\n }\n\n get isTopPlacement(): boolean {\n return isTopPlacement(this.placement);\n }\n\n /**\n * Cards are pinned to the placement edge, so a top placement stacks\n * downwards and a bottom placement stacks upwards.\n */\n get directionSign(): number {\n return this.isTopPlacement ? 1 : -1;\n }\n\n get transformOrigin(): CardGeometry['transformOrigin'] {\n return this.isTopPlacement ? 'top center' : 'bottom center';\n }\n\n get count(): number {\n return this.heights.length;\n }\n\n get frontHeight(): number {\n return this.heights[0] ?? 0;\n }\n\n geometryFor(index: number): CardGeometry {\n const zIndex = this.count - index;\n\n if (this.isExpanded) {\n return {\n transform: `translateY(${this.directionSign * this.offsetBefore(index)}px) scale(1)`,\n zIndex,\n opacity: 1,\n height: null,\n transformOrigin: this.transformOrigin,\n pointerEvents: 'auto'\n };\n }\n\n const offset = index * this.gap;\n const scale = Math.max(0, 1 - index * SCALE_STEP);\n const isVisible = index < this.visibleToasts;\n\n return {\n transform: `translateY(${this.directionSign * offset}px) scale(${scale})`,\n zIndex,\n opacity: isVisible ? 1 : 0,\n // The front card must size to its own content (`null`). Clamping it to\n // `frontHeight` would be self-referential — `frontHeight` *is* the\n // front card's own measurement — and would permanently lock in\n // whatever height was measured first, before content (e.g. a long\n // description) finished laying out. Only cards behind the front one\n // need clamping, so a taller card further back can't poke out past it.\n height: index === 0 ? null : this.frontHeight,\n transformOrigin: this.transformOrigin,\n // A card past `visibleToasts` is fully transparent while collapsed;\n // without this it would still sit in the fixed-position stack and\n // swallow clicks meant for the page beneath it.\n pointerEvents: isVisible ? 'auto' : 'none'\n };\n }\n\n get containerHeight(): number {\n if (this.count === 0) {\n return 0;\n }\n\n if (this.isExpanded) {\n return this.offsetBefore(this.count) - this.gap;\n }\n\n const visible = Math.min(this.count, this.visibleToasts);\n return this.frontHeight + (visible - 1) * this.gap;\n }\n\n /**\n * Distance from the placement edge to the leading edge of `index`, i.e. the\n * summed heights and gaps of every card in front of it.\n */\n private offsetBefore(index: number): number {\n let offset = 0;\n\n for (let i = 0; i < index; i++) {\n offset += (this.heights[i] ?? 0) + this.gap;\n }\n\n return offset;\n }\n}\n\nexport { NotificationStack, isTopPlacement };\nexport type { NotificationStackInput, CardGeometry };\n","import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { modifier } from 'ember-modifier';\nimport { service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport { fn } from '@ember/helper';\nimport { CloseButton } from '../buttons/close-button';\nimport { Button } from '../buttons/button';\nimport { Spinner } from '../utilities/spinner';\nimport {\n IconInfo,\n IconSuccess,\n IconWarning,\n IconDanger\n} from '../../-private/icons';\nimport { useStyles } from '@frontile/theme';\n\nimport type NotificationsService from '../../services/notifications';\nimport type Notification from '../../-private/notification';\nimport { isTopPlacement } from '../../-private/notification-stack';\nimport type { CardGeometry } from '../../-private/notification-stack';\nimport type {\n CustomAction,\n containerPlacement,\n NotificationStatus\n} from '../../-private/types';\nimport type { SafeString } from '@ember/template';\n\n/**\n * Everything that varies by `NotificationStatus`, keyed in one place so\n * adding a status means adding one row here instead of remembering to\n * touch an icon map, an action-colour map, and the `role` getter's cascade\n * separately.\n */\nconst STATUS_CONFIG = {\n neutral: {\n icon: IconInfo,\n // Button colour for the primary custom action. Also reused as the\n // loading <Spinner>'s `@color` (its colour union has the same\n // neutral/primary/success/warning/danger shape), so the spinner's arc\n // matches the same accent the card's custom action button would use.\n actionColor: 'neutral',\n // `alert` interrupts a screen reader, so it is reserved for the\n // statuses that warrant interrupting. This coupling is why the prop is\n // `@status` and not `@color`.\n role: 'status'\n },\n // Formerly `info`, which already painted `primary`'s classes. The info\n // glyph stays attached to `primary`.\n primary: {\n icon: IconInfo,\n actionColor: 'primary',\n role: 'status'\n },\n success: {\n icon: IconSuccess,\n actionColor: 'success',\n role: 'status'\n },\n warning: {\n icon: IconWarning,\n actionColor: 'warning',\n role: 'alert'\n },\n danger: {\n icon: IconDanger,\n actionColor: 'danger',\n role: 'alert'\n }\n} as const satisfies Record<\n NotificationStatus,\n {\n icon: unknown;\n actionColor: 'neutral' | 'primary' | 'success' | 'warning' | 'danger';\n role: 'status' | 'alert';\n }\n>;\n\ninterface NotificationCardSignature {\n Args: {\n notification: Notification<Record<string, unknown>>;\n placement: containerPlacement;\n\n /**\n * The visual style of the card.\n *\n * @defaultValue 'surface'\n */\n variant?: 'surface' | 'soft' | 'solid';\n\n /**\n * Position, scale, and stacking supplied by the container. When omitted\n * the card renders in place with no stack transform.\n *\n * Part of the container/card plumbing, not a consumer-facing argument.\n *\n * @internal\n */\n geometry?: CardGeometry;\n\n /**\n * Called with the card's measured height whenever it changes.\n *\n * Part of the container/card plumbing, not a consumer-facing argument.\n *\n * @internal\n */\n onMeasure?: (height: number) => void;\n };\n Element: HTMLDivElement;\n}\n\nclass NotificationCard extends Component<NotificationCardSignature> {\n @service notifications!: NotificationsService;\n\n /**\n * False for the first frame so the card can transition in from the\n * placement edge rather than appearing at its resting position.\n */\n @tracked hasEntered = false;\n\n get isTopPlacement(): boolean {\n return isTopPlacement(this.args.placement || 'bottom-right');\n }\n\n get status(): NotificationStatus {\n return this.args.notification.status;\n }\n\n get icon() {\n return STATUS_CONFIG[this.status].icon;\n }\n\n get actionColor() {\n return STATUS_CONFIG[this.status].actionColor;\n }\n\n get role(): 'status' | 'alert' {\n return STATUS_CONFIG[this.status].role;\n }\n\n get style(): SafeString {\n const { geometry, notification } = this.args;\n // The theme owns the whole `transition-duration` shorthand (and its\n // `motion-reduce:` override) so the per-property duration order can\n // never drift out of sync with `transition-[transform,opacity,height]`\n // across the component boundary — see notification-card.ts. This card\n // only supplies the one value `@transitionDuration` actually governs\n // (the enter/exit fade), as a custom property the theme's `var()` reads.\n const declarations = [\n `--frontile-toast-fade: ${notification.transitionDuration}ms`\n ];\n\n // The static edge-pinning (`position: absolute` + `left/right/top` or\n // `bottom`) lives in the `stackPlacement` theme variant (see\n // `this.classes`) rather than here, since it never varies frame to\n // frame — only the geometry-driven parts below (transform, opacity,\n // height, z-index, transform-origin) need to be inline, because a\n // `style` attribute passed through `...attributes` replaces the\n // element's own `style` outright and would drop them.\n\n if (!this.hasEntered || notification.isRemoving) {\n // Enter from, and exit to, the placement edge.\n const offset = this.isTopPlacement ? '-100%' : '100%';\n declarations.push(\n `opacity: 0`,\n `transform: translateY(${offset}) scale(0.95)`,\n // A card can be transparent-and-collapsed the instant it starts\n // exiting; keep it out of the click path either way.\n `pointer-events: none`\n );\n\n if (geometry) {\n declarations.push(\n `z-index: ${geometry.zIndex}`,\n `transform-origin: ${geometry.transformOrigin}`,\n // Preserve the collapsed height clamp through the exit\n // transition — otherwise a non-front collapsed card snaps from\n // its clamped height to `auto` for the slide-out.\n geometry.height === null\n ? `height: auto`\n : `height: ${geometry.height}px`\n );\n }\n\n return htmlSafe(declarations.join('; '));\n }\n\n if (geometry) {\n declarations.push(\n `transform: ${geometry.transform}`,\n `transform-origin: ${geometry.transformOrigin}`,\n `z-index: ${geometry.zIndex}`,\n `opacity: ${geometry.opacity}`,\n `pointer-events: ${geometry.pointerEvents}`,\n geometry.height === null\n ? `height: auto`\n : `height: ${geometry.height}px`\n );\n }\n\n return htmlSafe(declarations.join('; '));\n }\n\n /**\n * Flip to the resting position on the frame after insertion, so the browser\n * has a start value to transition from.\n */\n enter = modifier(() => {\n const frame = requestAnimationFrame(() => {\n this.hasEntered = true;\n });\n\n return () => cancelAnimationFrame(frame);\n });\n\n /**\n * Report the card's height to the container so the stack can lay itself\n * out. Also fires when promise content swaps change the height.\n *\n * `element` is the inner element (never height-constrained, so its\n * `offsetHeight` is always the content's true natural height). The border\n * lives on the outer element (`element.parentElement`), so it isn't part\n * of that number — we add it back via `outer.offsetHeight -\n * outer.clientHeight`, the outer element's vertical border width. That\n * difference is constant whether or not the outer element's height is\n * currently clamped by the collapsed-stack height, so it's safe to read\n * off the outer element even while it's clamped, and it stays correct if\n * the theme's border width ever changes.\n */\n measure = modifier((element: HTMLElement) => {\n const { onMeasure } = this.args;\n\n if (!onMeasure) {\n return;\n }\n\n const outer = element.parentElement as HTMLElement;\n\n const report = () => {\n const outerBorder = outer.offsetHeight - outer.clientHeight;\n onMeasure(element.offsetHeight + outerBorder);\n };\n\n const observer = new ResizeObserver(report);\n\n report();\n observer.observe(element);\n\n return () => observer.disconnect();\n });\n\n remove = () => {\n this.notifications.remove(this.args.notification);\n };\n\n handleClickCustomAction = (customAction: CustomAction) => {\n customAction.onClick();\n this.notifications.remove(this.args.notification);\n };\n\n get classes() {\n const { notificationCard } = useStyles();\n\n const {\n base,\n inner,\n icon,\n spinner,\n content,\n title,\n description,\n customActions,\n customActionButton,\n closeButton\n } = notificationCard({\n status: this.status,\n variant: this.args.variant || 'surface',\n hasDescription: !!this.args.notification.description,\n // Only pin the card to the placement edge once the container has\n // supplied stack geometry — see the `stackPlacement` variant's\n // comment in the theme.\n stackPlacement: this.args.geometry\n ? this.isTopPlacement\n ? 'top'\n : 'bottom'\n : 'none'\n });\n\n return {\n base: base(),\n inner: inner(),\n icon: icon(),\n spinner: spinner(),\n content: content(),\n title: title(),\n description: description(),\n customActions: customActions(),\n customActionButton: customActionButton(),\n closeButton: closeButton()\n };\n }\n\n <template>\n {{! template-lint-disable no-inline-styles style-concatenation }}\n <div\n data-component=\"notification-card\"\n data-part=\"base\"\n class={{this.classes.base}}\n style={{this.style}}\n role={{this.role}}\n data-test-notification-card\n data-test-status={{this.status}}\n {{this.enter}}\n ...attributes\n >\n {{! measure reads offsetHeight off this inner element, not the outer one above, since the outer carries the collapsed-stack height clamp. See notification-stack.ts. }}\n <div data-part=\"inner\" class={{this.classes.inner}} {{this.measure}}>\n {{#unless @notification.hideIcon}}\n {{#if @notification.isLoading}}\n <Spinner\n data-part=\"spinner\"\n @class={{this.classes.spinner}}\n @color={{this.actionColor}}\n @size=\"sm\"\n data-test-icon=\"loading\"\n />\n {{else}}\n {{#let this.icon as |Icon|}}\n <Icon data-part=\"icon\" class={{this.classes.icon}} />\n {{/let}}\n {{/if}}\n {{/unless}}\n\n <div data-part=\"content\" class={{this.classes.content}}>\n <div\n data-part=\"title\"\n class={{this.classes.title}}\n >{{@notification.title}}</div>\n\n {{#if @notification.description}}\n <div data-part=\"description\" class={{this.classes.description}}>\n {{@notification.description}}\n </div>\n {{/if}}\n </div>\n\n {{#if @notification.customActions}}\n <div data-part=\"custom-actions\" class={{this.classes.customActions}}>\n {{#each @notification.customActions as |customAction index|}}\n <Button\n data-part=\"custom-action-button\"\n @size=\"xs\"\n @color={{if index \"neutral\" this.actionColor}}\n @variant={{if index \"plain\" \"solid\"}}\n @class={{this.classes.customActionButton}}\n @onPress={{fn this.handleClickCustomAction customAction}}\n >\n {{customAction.label}}\n </Button>\n {{/each}}\n </div>\n {{/if}}\n\n {{#if @notification.allowClosing}}\n <CloseButton\n data-part=\"close-button\"\n @onPress={{this.remove}}\n @size=\"sm\"\n @class={{this.classes.closeButton}}\n />\n {{/if}}\n </div>\n </div>\n </template>\n}\n\nexport { NotificationCard, type NotificationCardSignature };\nexport default NotificationCard;\n"],"names":["SCALE_STEP","isTopPlacement","placement","startsWith","NotificationStack","heights","isExpanded","gap","visibleToasts","constructor","input","directionSign","transformOrigin","count","length","frontHeight","geometryFor","index","zIndex","transform","offsetBefore","opacity","height","pointerEvents","offset","scale","Math","max","isVisible","containerHeight","visible","min","i","STATUS_CONFIG","neutral","icon","IconInfo","actionColor","role","primary","success","IconSuccess","warning","IconWarning","danger","IconDanger","NotificationCard","Component","g","prototype","service","tracked","args","status","notification","style","geometry","declarations","transitionDuration","hasEntered","isRemoving","push","htmlSafe","join","enter","modifier","frame","requestAnimationFrame","cancelAnimationFrame","measure","element","onMeasure","outer","parentElement","report","outerBorder","offsetHeight","clientHeight","observer","ResizeObserver","observe","disconnect","remove","notifications","handleClickCustomAction","customAction","onClick","classes","notificationCard","useStyles","base","inner","spinner","content","title","description","customActions","customActionButton","closeButton","variant","hasDescription","stackPlacement","setComponentTemplate","precompileTemplate","strictMode","scope","Spinner","Button","fn","CloseButton"],"mappings":";;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,IAAI;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,cAAcA,CAACC,SAA6B,EAAW;AAC9D,EAAA,OAAOA,SAAS,CAACC,UAAU,CAAC,KAAK,CAAC;AACpC;AA6CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,CAAC;EACbC,OAAO;EACPC,UAAU;EACVC,GAAG;EACHC,aAAa;EACbN,SAAS;EAElBO,WAAWA,CAACC,KAA6B,EAAE;AACzC,IAAA,IAAI,CAACL,OAAO,GAAGK,KAAK,CAACL,OAAO;AAC5B,IAAA,IAAI,CAACC,UAAU,GAAGI,KAAK,CAACJ,UAAU;AAClC,IAAA,IAAI,CAACC,GAAG,GAAGG,KAAK,CAACH,GAAG;AACpB,IAAA,IAAI,CAACC,aAAa,GAAGE,KAAK,CAACF,aAAa;AACxC,IAAA,IAAI,CAACN,SAAS,GAAGQ,KAAK,CAACR,SAAS;AAClC,EAAA;EAEA,IAAID,cAAcA,GAAY;AAC5B,IAAA,OAAOA,cAAc,CAAC,IAAI,CAACC,SAAS,CAAC;AACvC,EAAA;;AAEA;AACF;AACA;AACA;EACE,IAAIS,aAAaA,GAAW;AAC1B,IAAA,OAAO,IAAI,CAACV,cAAc,GAAG,CAAC,GAAG,EAAE;AACrC,EAAA;EAEA,IAAIW,eAAeA,GAAoC;AACrD,IAAA,OAAO,IAAI,CAACX,cAAc,GAAG,YAAY,GAAG,eAAe;AAC7D,EAAA;EAEA,IAAIY,KAAKA,GAAW;AAClB,IAAA,OAAO,IAAI,CAACR,OAAO,CAACS,MAAM;AAC5B,EAAA;EAEA,IAAIC,WAAWA,GAAW;AACxB,IAAA,OAAO,IAAI,CAACV,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7B,EAAA;EAEAW,WAAWA,CAACC,KAAa,EA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|
import '@ember/service';
|
|
3
|
-
export { N as NotificationCard, a as NotificationStack } from './notification-card-
|
|
3
|
+
export { N as NotificationCard, a as NotificationStack } from './notification-card-BPfDo-Gf.js';
|
|
4
4
|
export { NotificationsContainer } from './components/notifications/notifications-container.js';
|
|
5
5
|
//# sourceMappingURL=notifications.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scroll `target` into view inside `panel` and nowhere else.
|
|
3
|
+
*
|
|
4
|
+
* `scrollIntoView` and a plain `focus()` both scroll *every* scrollable
|
|
5
|
+
* ancestor up to the document, so either one makes the host page jump when a
|
|
6
|
+
* panel opens or when arrow keys walk past its edge. Adjusting `scrollTop`
|
|
7
|
+
* directly keeps the movement inside the panel.
|
|
8
|
+
*
|
|
9
|
+
* The measurements come from `offsetTop`, not `getBoundingClientRect()`:
|
|
10
|
+
* client rects are in transformed pixels, so under any ancestor `scale()` they
|
|
11
|
+
* would not agree with `scrollTop`. This relies on the panel being the
|
|
12
|
+
* target's `offsetParent`, so the panel has to be positioned.
|
|
13
|
+
*
|
|
14
|
+
* `center` places the target mid-panel, for the opening jump to a value that
|
|
15
|
+
* is usually a long way down the list; otherwise the target is brought just
|
|
16
|
+
* far enough into view, which is what stepping key by key wants.
|
|
17
|
+
*/
|
|
18
|
+
function revealWithin(panel, target, center) {
|
|
19
|
+
const top = target.offsetTop;
|
|
20
|
+
const bottom = top + target.offsetHeight;
|
|
21
|
+
if (center) {
|
|
22
|
+
panel.scrollTop = top - (panel.clientHeight - target.offsetHeight) / 2;
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (top < panel.scrollTop) {
|
|
26
|
+
panel.scrollTop = top;
|
|
27
|
+
} else if (bottom > panel.scrollTop + panel.clientHeight) {
|
|
28
|
+
panel.scrollTop = bottom - panel.clientHeight;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { revealWithin as r };
|
|
33
|
+
//# sourceMappingURL=reveal-within-BcqpOmSI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reveal-within-BcqpOmSI.js","sources":["../src/-private/reveal-within.ts"],"sourcesContent":["/**\n * Scroll `target` into view inside `panel` and nowhere else.\n *\n * `scrollIntoView` and a plain `focus()` both scroll *every* scrollable\n * ancestor up to the document, so either one makes the host page jump when a\n * panel opens or when arrow keys walk past its edge. Adjusting `scrollTop`\n * directly keeps the movement inside the panel.\n *\n * The measurements come from `offsetTop`, not `getBoundingClientRect()`:\n * client rects are in transformed pixels, so under any ancestor `scale()` they\n * would not agree with `scrollTop`. This relies on the panel being the\n * target's `offsetParent`, so the panel has to be positioned.\n *\n * `center` places the target mid-panel, for the opening jump to a value that\n * is usually a long way down the list; otherwise the target is brought just\n * far enough into view, which is what stepping key by key wants.\n */\nexport function revealWithin(\n panel: HTMLElement,\n target: HTMLElement,\n center: boolean\n): void {\n const top = target.offsetTop;\n const bottom = top + target.offsetHeight;\n\n if (center) {\n panel.scrollTop = top - (panel.clientHeight - target.offsetHeight) / 2;\n return;\n }\n\n if (top < panel.scrollTop) {\n panel.scrollTop = top;\n } else if (bottom > panel.scrollTop + panel.clientHeight) {\n panel.scrollTop = bottom - panel.clientHeight;\n }\n}\n"],"names":["revealWithin","panel","target","center","top","offsetTop","bottom","offsetHeight","scrollTop","clientHeight"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,YAAYA,CAC1BC,KAAkB,EAClBC,MAAmB,EACnBC,MAAe,EACT;AACN,EAAA,MAAMC,GAAG,GAAGF,MAAM,CAACG,SAAS;AAC5B,EAAA,MAAMC,MAAM,GAAGF,GAAG,GAAGF,MAAM,CAACK,YAAY;AAExC,EAAA,IAAIJ,MAAM,EAAE;AACVF,IAAAA,KAAK,CAACO,SAAS,GAAGJ,GAAG,GAAG,CAACH,KAAK,CAACQ,YAAY,GAAGP,MAAM,CAACK,YAAY,IAAI,CAAC;AACtE,IAAA;AACF,EAAA;AAEA,EAAA,IAAIH,GAAG,GAAGH,KAAK,CAACO,SAAS,EAAE;IACzBP,KAAK,CAACO,SAAS,GAAGJ,GAAG;EACvB,CAAC,MAAM,IAAIE,MAAM,GAAGL,KAAK,CAACO,SAAS,GAAGP,KAAK,CAACQ,YAAY,EAAE;AACxDR,IAAAA,KAAK,CAACO,SAAS,GAAGF,MAAM,GAAGL,KAAK,CAACQ,YAAY;AAC/C,EAAA;AACF;;"}
|
package/dist/test-support.js
CHANGED
|
@@ -1713,7 +1713,9 @@ function changeOption(functionName, selectSelector, key, toggle) {
|
|
|
1713
1713
|
}
|
|
1714
1714
|
const option = select.querySelector(`[data-key="${key}"]`);
|
|
1715
1715
|
if (!option) {
|
|
1716
|
-
|
|
1716
|
+
// A Select with `@displayLimit` holds only the first options (and the
|
|
1717
|
+
// selected ones) in its hidden `<select>`, like its listbox.
|
|
1718
|
+
throw new Error(`You called "${functionName}('${selectSelector}', '${key}')" but no option with key "${key}" was found. ` + 'With @displayLimit, only the first options and the selected ones are there: type into the filter and click the option instead.');
|
|
1717
1719
|
}
|
|
1718
1720
|
if (toggle && option.selected) {
|
|
1719
1721
|
option.selected = false;
|