@ecopages/radiant-ui 0.1.0-rc.8 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/dist/components/ui/autocomplete/autocomplete.css +1 -2
- package/dist/components/ui/avatar/avatar.css +10 -8
- package/dist/components/ui/avatar/avatar.d.ts +3 -1
- package/dist/components/ui/calendar/calendar.css +10 -5
- package/dist/components/ui/calendar/calendar.script.d.ts +1 -0
- package/dist/components/ui/calendar/index.js +1 -1
- package/dist/components/ui/calendar/index.js.map +3 -3
- package/dist/components/ui/carousel/carousel-autoplay.d.ts +22 -0
- package/dist/components/ui/carousel/carousel-swipe.d.ts +17 -0
- package/dist/components/ui/carousel/carousel-window.d.ts +63 -0
- package/dist/components/ui/carousel/carousel.css +71 -18
- package/dist/components/ui/carousel/carousel.d.ts +1 -1
- package/dist/components/ui/carousel/carousel.script.d.ts +49 -21
- package/dist/components/ui/carousel/index.js +1 -1
- package/dist/components/ui/carousel/index.js.map +4 -4
- package/dist/components/ui/checkbox/checkbox.script.d.ts +0 -3
- package/dist/components/ui/checkbox/index.js +1 -1
- package/dist/components/ui/checkbox/index.js.map +4 -4
- package/dist/components/ui/checkbox-group/checkbox-group.d.ts +0 -1
- package/dist/components/ui/checkbox-group/checkbox-group.script.d.ts +8 -7
- package/dist/components/ui/checkbox-group/index.js +1 -1
- package/dist/components/ui/checkbox-group/index.js.map +4 -4
- package/dist/components/ui/combobox/combobox.css +2 -2
- package/dist/components/ui/combobox/combobox.d.ts +1 -2
- package/dist/components/ui/combobox/combobox.script.d.ts +13 -6
- package/dist/components/ui/combobox/index.js +1 -1
- package/dist/components/ui/combobox/index.js.map +4 -4
- package/dist/components/ui/cycle-toggle/index.js +1 -1
- package/dist/components/ui/cycle-toggle/index.js.map +3 -3
- package/dist/components/ui/date-field/date-field.css +13 -17
- package/dist/components/ui/date-field/date-field.d.ts +7 -5
- package/dist/components/ui/date-field/date-field.script.d.ts +16 -48
- package/dist/components/ui/date-field/index.js +1 -1
- package/dist/components/ui/date-field/index.js.map +4 -4
- package/dist/components/ui/date-input/date-input-segment-dom.d.ts +24 -0
- package/dist/components/ui/date-input/date-input.css +50 -0
- package/dist/components/ui/date-input/date-input.d.ts +8 -0
- package/dist/components/ui/date-input/date-input.script.d.ts +137 -0
- package/dist/components/ui/date-input/index.d.ts +2 -0
- package/dist/components/ui/date-input/index.js +2 -0
- package/dist/components/ui/date-input/index.js.map +7 -0
- package/dist/components/ui/date-range-picker/date-range-picker.css +18 -19
- package/dist/components/ui/date-range-picker/date-range-picker.d.ts +8 -6
- package/dist/components/ui/date-range-picker/date-range-picker.script.d.ts +24 -47
- package/dist/components/ui/date-range-picker/index.js +1 -1
- package/dist/components/ui/date-range-picker/index.js.map +4 -4
- package/dist/components/ui/dialog/dialog.css +18 -14
- package/dist/components/ui/dialog/dialog.script.d.ts +10 -3
- package/dist/components/ui/dialog/index.js +1 -1
- package/dist/components/ui/dialog/index.js.map +4 -4
- package/dist/components/ui/disclosure/disclosure.css +3 -6
- package/dist/components/ui/disclosure/disclosure.d.ts +15 -5
- package/dist/components/ui/disclosure/disclosure.script.d.ts +2 -2
- package/dist/components/ui/disclosure/index.d.ts +1 -1
- package/dist/components/ui/disclosure/index.js +1 -1
- package/dist/components/ui/disclosure/index.js.map +4 -4
- package/dist/components/ui/field/field.d.ts +1 -1
- package/dist/components/ui/field/field.script.d.ts +27 -4
- package/dist/components/ui/field/index.js +1 -1
- package/dist/components/ui/field/index.js.map +4 -4
- package/dist/components/ui/form/control-protocol.d.ts +38 -1
- package/dist/components/ui/form/form-context.d.ts +3 -0
- package/dist/components/ui/form/form.script.d.ts +7 -0
- package/dist/components/ui/form/index.d.ts +2 -1
- package/dist/components/ui/form/index.js +1 -1
- package/dist/components/ui/form/index.js.map +4 -4
- package/dist/components/ui/hover-card/hover-card.css +12 -101
- package/dist/components/ui/hover-card/hover-card.script.d.ts +7 -0
- package/dist/components/ui/hover-card/index.js +1 -1
- package/dist/components/ui/hover-card/index.js.map +4 -4
- package/dist/components/ui/input/index.js +1 -1
- package/dist/components/ui/input/index.js.map +4 -4
- package/dist/components/ui/input/input.css +1 -1
- package/dist/components/ui/knob/index.js +1 -1
- package/dist/components/ui/knob/index.js.map +3 -3
- package/dist/components/ui/knob/knob.css +6 -1
- package/dist/components/ui/knob/knob.d.ts +1 -1
- package/dist/components/ui/knob/knob.script.d.ts +25 -10
- package/dist/components/ui/label/index.js +1 -1
- package/dist/components/ui/label/index.js.map +4 -4
- package/dist/components/ui/listbox/index.js +1 -1
- package/dist/components/ui/listbox/index.js.map +4 -4
- package/dist/components/ui/listbox/listbox.d.ts +1 -2
- package/dist/components/ui/listbox/listbox.script.d.ts +7 -5
- package/dist/components/ui/menu-button/index.js +1 -1
- package/dist/components/ui/menu-button/index.js.map +4 -4
- package/dist/components/ui/menu-button/menu-button.script.d.ts +1 -1
- package/dist/components/ui/menubar/index.js +1 -1
- package/dist/components/ui/menubar/index.js.map +4 -4
- package/dist/components/ui/meter/index.js +1 -1
- package/dist/components/ui/meter/index.js.map +3 -3
- package/dist/components/ui/meter/meter.css +27 -2
- package/dist/components/ui/meter/meter.script.d.ts +14 -4
- package/dist/components/ui/navigation-menu/index.d.ts +1 -1
- package/dist/components/ui/navigation-menu/index.js +1 -1
- package/dist/components/ui/navigation-menu/index.js.map +4 -4
- package/dist/components/ui/navigation-menu/navigation-menu.css +32 -34
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts +33 -4
- package/dist/components/ui/navigation-menu/navigation-menu.script.d.ts +71 -9
- package/dist/components/ui/number-field/index.js +1 -1
- package/dist/components/ui/number-field/index.js.map +4 -4
- package/dist/components/ui/number-field/number-field.css +1 -1
- package/dist/components/ui/number-field/number-field.d.ts +1 -1
- package/dist/components/ui/number-field/number-field.script.d.ts +7 -9
- package/dist/components/ui/pagination/index.d.ts +1 -1
- package/dist/components/ui/pagination/index.js +1 -1
- package/dist/components/ui/pagination/index.js.map +3 -3
- package/dist/components/ui/pagination/pagination.css +50 -13
- package/dist/components/ui/pagination/pagination.d.ts +25 -6
- package/dist/components/ui/popover/index.js +1 -1
- package/dist/components/ui/popover/index.js.map +4 -4
- package/dist/components/ui/popover/popover.script.d.ts +5 -0
- package/dist/components/ui/radio-group/index.js +1 -1
- package/dist/components/ui/radio-group/index.js.map +4 -4
- package/dist/components/ui/radio-group/radio-group.script.d.ts +2 -1
- package/dist/components/ui/select/index.d.ts +1 -1
- package/dist/components/ui/select/index.js +1 -1
- package/dist/components/ui/select/index.js.map +4 -4
- package/dist/components/ui/select/select.css +4 -3
- package/dist/components/ui/select/select.d.ts +7 -5
- package/dist/components/ui/select/select.script.d.ts +32 -12
- package/dist/components/ui/shared/calendar-popover-behavior.d.ts +27 -0
- package/dist/components/ui/shared/listbox-host-controller.d.ts +5 -4
- package/dist/components/ui/shared/multi-value.d.ts +18 -8
- package/dist/components/ui/shared/numeric-range.d.ts +8 -0
- package/dist/components/ui/shared/popover.css +10 -99
- package/dist/components/ui/sidebar/index.d.ts +2 -1
- package/dist/components/ui/sidebar/index.js +1 -1
- package/dist/components/ui/sidebar/index.js.map +4 -4
- package/dist/components/ui/sidebar/sidebar-trigger.d.ts +12 -0
- package/dist/components/ui/sidebar/sidebar-trigger.script.d.ts +42 -29
- package/dist/components/ui/sidebar/sidebar.css +67 -61
- package/dist/components/ui/sidebar/sidebar.d.ts +1 -7
- package/dist/components/ui/sidebar/sidebar.script.d.ts +12 -7
- package/dist/components/ui/slider/index.js +1 -1
- package/dist/components/ui/slider/index.js.map +4 -4
- package/dist/components/ui/slider/slider.css +5 -5
- package/dist/components/ui/slider/slider.d.ts +5 -6
- package/dist/components/ui/slider/slider.script.d.ts +72 -29
- package/dist/components/ui/switch/index.js +1 -1
- package/dist/components/ui/switch/index.js.map +4 -4
- package/dist/components/ui/switch/switch.css +28 -22
- package/dist/components/ui/switch/switch.script.d.ts +10 -3
- package/dist/components/ui/table/index.js +1 -1
- package/dist/components/ui/table/index.js.map +4 -4
- package/dist/components/ui/table/table.d.ts +5 -3
- package/dist/components/ui/table/table.script.d.ts +25 -10
- package/dist/components/ui/tabs/tabs.css +18 -12
- package/dist/components/ui/tabs/tabs.script.d.ts +7 -0
- package/dist/components/ui/tag-group/index.js +1 -1
- package/dist/components/ui/tag-group/index.js.map +4 -4
- package/dist/components/ui/tag-group/tag-group.d.ts +7 -4
- package/dist/components/ui/tag-group/tag-group.script.d.ts +7 -5
- package/dist/components/ui/textarea/index.js +1 -1
- package/dist/components/ui/textarea/index.js.map +4 -4
- package/dist/components/ui/textarea/textarea.css +1 -1
- package/dist/components/ui/toast/index.js +1 -1
- package/dist/components/ui/toast/index.js.map +3 -3
- package/dist/components/ui/toast/toast.css +35 -32
- package/dist/components/ui/toast/toast.script.d.ts +2 -1
- package/dist/components/ui/toast/toaster.script.d.ts +6 -0
- package/dist/components/ui/tooltip/index.js +1 -1
- package/dist/components/ui/tooltip/index.js.map +4 -4
- package/dist/components/ui/tooltip/tooltip.css +14 -94
- package/dist/components/ui/tooltip/tooltip.script.d.ts +9 -1
- package/dist/components/ui/window-splitter/index.d.ts +1 -1
- package/dist/components/ui/window-splitter/index.js +1 -1
- package/dist/components/ui/window-splitter/index.js.map +3 -3
- package/dist/components/ui/window-splitter/window-splitter.d.ts +1 -1
- package/dist/components/ui/window-splitter/window-splitter.script.d.ts +5 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/lib/icons/chevron-down.d.ts +0 -1
- package/dist/lib/intl-date/index.d.ts +4 -2
- package/dist/lib/intl-date/segment-editing.d.ts +34 -0
- package/dist/lib/intl-date/segments.d.ts +26 -4
- package/dist/lib/non-empty.d.ts +6 -0
- package/dist/lib/unique-id.d.ts +11 -0
- package/dist/lib/viewport/breakpoints.d.ts +6 -0
- package/dist/lib/viewport/mobile-layout.d.ts +15 -0
- package/dist/styles/primitives.css +10 -7
- package/dist/styles/radiant-ui-core.css +10 -0
- package/dist/styles/radiant-ui.css +40 -3
- package/dist/styles/style-dependencies.json +18 -6
- package/dist/styles/styles.css +456 -246
- package/dist/styles/tailwind.css +40 -93
- package/dist/styles/tokens/presets/colors/aurora.css +2 -0
- package/dist/styles/tokens/presets/colors/basalt.css +2 -0
- package/dist/styles/tokens/presets/colors/ember.css +2 -0
- package/dist/styles/tokens/presets/colors/glacier.css +2 -0
- package/dist/styles/tokens/semantic.css +1 -0
- package/dist/styles/tokens/system.css +11 -3
- package/dist/styles/tokens/typography/default.css +8 -0
- package/package.json +20 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/ui/pagination/pagination.tsx", "../../../../src/lib/cx.ts", "../../../../src/lib/icons/chevron-left.tsx", "../../../../src/lib/icons/chevron-right.tsx", "../../../../src/components/ui/button/button.tsx", "../../../../src/components/ui/pagination/pagination.script.tsx"],
|
|
4
|
-
"sourcesContent": ["import { jsx, jsxs } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nimport { RuiIconChevronLeft, RuiIconChevronRight } from \"@/lib/icons\";\nimport { RuiButton } from \"../button\";\nimport { PAGINATION_DEFAULT_LABEL, clampPage } from \"./pagination.script\";\nimport \"./pagination.script\";\nfunction getPageItems(page, pageCount, siblingCount) {\n const visibleCount = siblingCount * 2 + 5;\n if (pageCount <= visibleCount) {\n return Array.from({\n length: pageCount\n }, (_, index) => index + 1);\n }\n const start = Math.max(2, page - siblingCount);\n const end = Math.min(pageCount - 1, page + siblingCount);\n const items = [1];\n if (start > 2) items.push(\"start-ellipsis\");\n for (let current = start; current <= end; current += 1) items.push(current);\n if (end < pageCount - 1) items.push(\"end-ellipsis\");\n items.push(pageCount);\n return items;\n}\nexport function RuiPaginationNav({\n label,\n page,\n pageCount,\n disabled = false,\n siblingCount = 1\n}) {\n const resolvedPageCount = Math.max(1, Math.floor(pageCount) || 1);\n const resolvedPage = clampPage(page, resolvedPageCount);\n const resolvedSiblingCount = Math.max(0, Math.floor(siblingCount) || 0);\n const items = getPageItems(resolvedPage, resolvedPageCount, resolvedSiblingCount);\n return /* @__PURE__ */jsx(\"nav\", {\n class: \"rui-pagination__nav\",\n \"aria-label\": label,\n children: /* @__PURE__ */jsxs(\"ul\", {\n class: \"rui-pagination__list\",\n children: [/* @__PURE__ */jsx(\"li\", {\n children: /* @__PURE__ */jsxs(RuiButton, {\n variant: \"ghost\",\n size: \"sm\",\n class: \"rui-pagination__link rui-pagination__link--previous\",\n \"data-pagination-page\": resolvedPage - 1,\n \"aria-label\": \"Go to previous page\",\n disabled: disabled || resolvedPage <= 1,\n children: [/* @__PURE__ */jsx(RuiIconChevronLeft, {}), /* @__PURE__ */jsx(\"span\", {\n children: \"Previous\"\n })]\n })\n }), items.map(item => typeof item === \"number\" ? /* @__PURE__ */jsx(\"li\", {\n class: cx(\"rui-pagination__page\", item === resolvedPage && \"rui-pagination__page--current\"),\n children: /* @__PURE__ */jsx(RuiButton, {\n variant: item === resolvedPage ? \"filled\" : \"ghost\",\n size: \"sm\",\n square: true,\n class: \"rui-pagination__link\",\n \"data-pagination-page\": item,\n \"aria-label\": `Go to page ${item}`,\n \"aria-current\": item === resolvedPage ? \"page\" : void 0,\n disabled,\n children: item\n })\n }, item) : /* @__PURE__ */jsx(\"li\", {\n class: \"rui-pagination__ellipsis\",\n \"aria-hidden\": \"true\",\n children: \"\\u2026\"\n }, item)), /* @__PURE__ */jsxs(\"li\", {\n class: \"rui-pagination__status\",\n children: [resolvedPage, \" / \", resolvedPageCount]\n }), /* @__PURE__ */jsx(\"li\", {\n children: /* @__PURE__ */jsxs(RuiButton, {\n variant: \"ghost\",\n size: \"sm\",\n class: \"rui-pagination__link rui-pagination__link--next\",\n \"data-pagination-page\": resolvedPage + 1,\n \"aria-label\": \"Go to next page\",\n disabled: disabled || resolvedPage >= resolvedPageCount,\n children: [/* @__PURE__ */jsx(\"span\", {\n children: \"Next\"\n }), /* @__PURE__ */jsx(RuiIconChevronRight, {})]\n })\n })]\n })\n });\n}\nexport function RuiPagination({\n children,\n label = PAGINATION_DEFAULT_LABEL,\n page = 1,\n pageCount = 1,\n disabled = false,\n siblingCount = 1,\n class: className,\n ...props\n}) {\n const resolvedPageCount = Math.max(1, Math.floor(pageCount) || 1);\n const resolvedPage = clampPage(page, resolvedPageCount);\n const resolvedSiblingCount = Math.max(0, Math.floor(siblingCount) || 0);\n return /* @__PURE__ */jsx(\"rui-pagination\", {\n ...props,\n class: cx(\"rui-pagination\", className),\n label,\n page: resolvedPage,\n pageCount: resolvedPageCount,\n disabled,\n siblingCount: resolvedSiblingCount,\n children: children ?? /* @__PURE__ */jsx(RuiPaginationNav, {\n label,\n page: resolvedPage,\n pageCount: resolvedPageCount,\n disabled,\n siblingCount: resolvedSiblingCount\n })\n });\n}", "export function cx(...parts) {\n return parts.filter(Boolean).join(\" \");\n}", "import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nexport function RuiIconChevronLeft({\n class: className,\n size = \"sm\",\n ...props\n}) {\n return /* @__PURE__ */jsx(\"svg\", {\n ...props,\n class: cx(\"rui-icon\", size === \"md\" && \"rui-icon--md\", className),\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"aria-hidden\": \"true\",\n children: /* @__PURE__ */jsx(\"path\", {\n d: \"m15 18-6-6 6-6\"\n })\n });\n}", "import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nexport function RuiIconChevronRight({\n class: className,\n size = \"sm\",\n ...props\n}) {\n return /* @__PURE__ */jsx(\"svg\", {\n ...props,\n class: cx(\"rui-icon\", size === \"md\" && \"rui-icon--md\", className),\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"aria-hidden\": \"true\",\n children: /* @__PURE__ */jsx(\"path\", {\n d: \"m9 18 6-6-6-6\"\n })\n });\n}", "import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nfunction resolveAriaPressed(pressed, toggle, defaultPressed) {\n if (pressed !== void 0) {\n return pressed;\n }\n if (toggle) {\n return defaultPressed;\n }\n return void 0;\n}\nfunction invokeClickListener(listener, event) {\n if (typeof listener === \"function\") {\n listener(event);\n return;\n }\n if (listener != null && typeof listener === \"object\" && \"handleEvent\" in listener) {\n listener.handleEvent(event);\n }\n}\nexport function RuiButton(props) {\n if (props.href !== void 0) {\n const {\n href,\n target,\n rel,\n download,\n children: children2,\n class: className2,\n variant: variant2,\n size: size2,\n square: square2,\n ...host2\n } = props;\n return /* @__PURE__ */jsx(\"a\", {\n ...host2,\n href,\n target,\n rel,\n download,\n class: cx(\"rui-button\", `rui-button--${variant2 ?? \"filled\"}`, `rui-button--${size2 ?? \"md\"}`, square2 && \"rui-button--square\", className2),\n children: children2\n });\n }\n const {\n variant,\n size,\n square,\n class: className,\n children,\n type = \"button\",\n disabled,\n pressed,\n defaultPressed = false,\n toggle = false,\n \"on:click\": onClick,\n ...host\n } = props;\n const handleClick = event => {\n if (toggle && pressed === void 0) {\n const button = event.currentTarget;\n const next = button.getAttribute(\"aria-pressed\") !== \"true\";\n button.setAttribute(\"aria-pressed\", String(next));\n }\n invokeClickListener(onClick, event);\n };\n return /* @__PURE__ */jsx(\"button\", {\n ...host,\n type,\n class: cx(\"rui-button\", `rui-button--${variant ?? \"filled\"}`, `rui-button--${size ?? \"md\"}`, square && \"rui-button--square\", className),\n disabled,\n \"aria-pressed\": resolveAriaPressed(pressed, toggle, defaultPressed),\n \"data-toggle\": toggle && pressed === void 0 ? \"\" : void 0,\n \"on:click\": toggle || onClick ? handleClick : void 0,\n children\n });\n}", "let _initProto, _initClass, _init_label, _init_extra_label, _init_page, _init_extra_page, _init_pageCount, _init_extra_pageCount, _init_disabled, _init_extra_disabled, _init_siblingCount, _init_extra_siblingCount, _init_pageChangeEvent, _init_extra_pageChangeEvent;\nfunction _applyDecs(e, t, n, r, o, i) { var a, c, u, s, f, l, p, d = Symbol.metadata || Symbol.for(\"Symbol.metadata\"), m = Object.defineProperty, h = Object.create, y = [h(null), h(null)], v = t.length; function g(t, n, r) { return function (o, i) { n && (i = o, o = e); for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []); return r ? i : o; }; } function b(e, t, n, r) { if (\"function\" != typeof e && (r || void 0 !== e)) throw new TypeError(t + \" must \" + (n || \"be\") + \" a function\" + (r ? \"\" : \" or undefined\")); return e; } function applyDec(e, t, n, r, o, i, u, s, f, l, p) { function d(e) { if (!p(e)) throw new TypeError(\"Attempted to access private element on non-instance\"); } var h = [].concat(t[0]), v = t[3], w = !u, D = 1 === o, S = 3 === o, j = 4 === o, E = 2 === o; function I(t, n, r) { return function (o, i) { return n && (i = o, o = e), r && r(o), P[t].call(o, i); }; } if (!w) { var P = {}, k = [], F = S ? \"get\" : j || D ? \"set\" : \"value\"; if (f ? (l || D ? P = { get: _setFunctionName(function () { return v(this); }, r, \"get\"), set: function (e) { t[4](this, e); } } : P[F] = v, l || _setFunctionName(P[F], r, E ? \"\" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) { if ((c = y[+s][r]) && 7 !== (c ^ o)) throw Error(\"Decorating two elements with the same name (\" + P[F].name + \") is not supported yet\"); y[+s][r] = o < 3 ? 1 : o; } } for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) { var T = b(h[O], \"A decorator\", \"be\", !0), z = n ? h[O - 1] : void 0, A = {}, H = { kind: [\"field\", \"accessor\", \"method\", \"getter\", \"setter\", \"class\"][o], name: r, metadata: a, addInitializer: function (e, t) { if (e.v) throw new TypeError(\"attempted to call addInitializer after decoration was finished\"); b(t, \"An initializer\", \"be\", !0), i.push(t); }.bind(null, A) }; if (w) c = T.call(z, N, H), A.v = 1, b(c, \"class decorators\", \"return\") && (N = c);else if (H.static = s, H.private = f, c = H.access = { has: f ? p.bind() : function (e) { return r in e; } }, j || (c.get = f ? E ? function (e) { return d(e), P.value; } : I(\"get\", 0, d) : function (e) { return e[r]; }), E || S || (c.set = f ? I(\"set\", 0, d) : function (e, t) { e[r] = t; }), N = T.call(z, D ? { get: P.get, set: P.set } : P[F], H), A.v = 1, D) { if (\"object\" == typeof N && N) (c = b(N.get, \"accessor.get\")) && (P.get = c), (c = b(N.set, \"accessor.set\")) && (P.set = c), (c = b(N.init, \"accessor.init\")) && k.unshift(c);else if (void 0 !== N) throw new TypeError(\"accessor decorators must return an object with get, set, or init properties or undefined\"); } else b(N, (l ? \"field\" : \"method\") + \" decorators\", \"return\") && (l ? k.unshift(N) : P[F] = N); } return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I(\"get\", s), I(\"set\", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N; } function w(e) { return m(e, d, { configurable: !0, enumerable: !0, value: a }); } return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function (e) { e && f.push(g(e)); }, p = function (t, r) { for (var i = 0; i < n.length; i++) { var a = n[i], c = a[1], l = 7 & c; if ((8 & c) == t && !l == r) { var p = a[2], d = !!a[3], m = 16 & c; applyDec(t ? e : e.prototype, a, m, d ? \"#\" + p : _toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) { return _checkInRHS(t) === e; } : o); } } }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), { e: c, get c() { var n = []; return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)]; } }; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _setFunctionName(e, t, n) { \"symbol\" == typeof t && (t = (t = t.description) ? \"[\" + t + \"]\" : \"\"); try { Object.defineProperty(e, \"name\", { configurable: !0, value: n ? n + \" \" + t : t }); } catch (e) {} return e; }\nfunction _checkInRHS(e) { if (Object(e) !== e) throw TypeError(\"right-hand side of 'in' should be an object, got \" + (null !== e ? typeof e : \"null\")); return e; }\nimport { RadiantElement, customElement, event, onEvent, prop } from \"@ecopages/radiant\";\nexport const PAGINATION_DEFAULT_LABEL = \"Pagination\";\nexport function clampPage(page, pageCount) {\n return Math.min(Math.max(1, Math.floor(page) || 1), pageCount);\n}\nlet _RuiPagination;\nclass RuiPagination extends RadiantElement {\n static {\n ({\n e: [_init_label, _init_extra_label, _init_page, _init_extra_page, _init_pageCount, _init_extra_pageCount, _init_disabled, _init_extra_disabled, _init_siblingCount, _init_extra_siblingCount, _init_pageChangeEvent, _init_extra_pageChangeEvent, _initProto],\n c: [_RuiPagination, _initClass]\n } = _applyDecs(this, [customElement(\"rui-pagination\")], [[prop({\n type: String,\n defaultValue: PAGINATION_DEFAULT_LABEL\n }), 0, \"label\"], [prop({\n type: Number,\n reflect: true,\n defaultValue: 1\n }), 0, \"page\"], [prop({\n type: Number,\n attribute: \"page-count\",\n defaultValue: 1\n }), 0, \"pageCount\"], [prop({\n type: Boolean,\n reflect: true,\n defaultValue: false\n }), 0, \"disabled\"], [prop({\n type: Number,\n attribute: \"sibling-count\",\n defaultValue: 1\n }), 0, \"siblingCount\"], [event({\n name: \"rui-page-change\",\n bubbles: true,\n composed: true\n }), 0, \"pageChangeEvent\"], [onEvent({\n selector: \"[data-pagination-page]\",\n type: \"click\"\n }), 2, \"onPageClick\"]], 0, void 0, RadiantElement));\n }\n constructor(...args) {\n super(...args);\n _init_extra_pageChangeEvent(this);\n }\n label = (_initProto(this), _init_label(this));\n page = (_init_extra_label(this), _init_page(this));\n pageCount = (_init_extra_page(this), _init_pageCount(this));\n disabled = (_init_extra_pageCount(this), _init_disabled(this));\n siblingCount = (_init_extra_disabled(this), _init_siblingCount(this));\n pageChangeEvent = (_init_extra_siblingCount(this), _init_pageChangeEvent(this));\n changePage(page) {\n if (this.disabled) return;\n const next = clampPage(page, Math.max(1, Math.floor(this.pageCount) || 1));\n if (next === this.page) return;\n this.pageChangeEvent.emit({\n page: next\n });\n }\n onPageClick(event2) {\n const button = event2.target.closest(\"[data-pagination-page]\");\n const page = Number(button?.getAttribute(\"data-pagination-page\"));\n if (Number.isInteger(page)) this.changePage(page);\n }\n static {\n _initClass();\n }\n}\nexport { _RuiPagination as RuiPagination };"],
|
|
5
|
-
"mappings": "AAAA,OAAS,OAAAA,EAAK,QAAAC,MAAY,4BCAnB,SAASC,KAAMC,EAAO,CAC3B,OAAOA,EAAM,OAAO,OAAO,EAAE,KAAK,GAAG,CACvC,CCFA,OAAS,OAAAC,OAAW,4BAEb,SAASC,GAAmB,CACjC,MAAOC,EACP,KAAAC,EAAO,KACP,GAAGC,CACL,EAAG,CACD,OAAsBC,GAAI,MAAO,CAC/B,GAAGD,EACH,MAAOE,EAAG,WAAYH,IAAS,MAAQ,eAAgBD,CAAS,EAChE,QAAS,YACT,KAAM,OACN,OAAQ,eACR,eAAgB,IAChB,iBAAkB,QAClB,kBAAmB,QACnB,cAAe,OACf,SAAyBG,GAAI,OAAQ,CACnC,EAAG,gBACL,CAAC,CACH,CAAC,CACH,CCrBA,OAAS,OAAAE,OAAW,4BAEb,SAASC,GAAoB,CAClC,MAAOC,EACP,KAAAC,EAAO,KACP,GAAGC,CACL,EAAG,CACD,OAAsBC,GAAI,MAAO,CAC/B,GAAGD,EACH,MAAOE,EAAG,WAAYH,IAAS,MAAQ,eAAgBD,CAAS,EAChE,QAAS,YACT,KAAM,OACN,OAAQ,eACR,eAAgB,IAChB,i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,EACX,SAAAD,EACA,aAAcI,EACd,SAAUS,GAA2BR,EAAIP,GAAkB,CACzD,MAAAC,EACA,KAAMG,EACN,UAAWD,EACX,SAAAD,EACA,aAAcI,CAChB,CAAC,CACH,CAAC,CACH",
|
|
6
|
-
"names": ["jsx", "jsxs", "cx", "parts", "jsx", "RuiIconChevronLeft", "className", "size", "props", "jsx", "cx", "jsx", "RuiIconChevronRight", "className", "size", "props", "jsx", "cx", "jsx", "resolveAriaPressed", "pressed", "toggle", "defaultPressed", "invokeClickListener", "listener", "event", "RuiButton", "props", "href", "target", "rel", "download", "children2", "className2", "variant2", "size2", "square2", "host2", "jsx", "cx", "variant", "size", "square", "className", "children", "type", "disabled", "onClick", "host", "handleClick", "button", "next", "RadiantElement", "customElement", "event", "onEvent", "prop", "_initProto", "_initClass", "_init_label", "_init_extra_label", "_init_page", "_init_extra_page", "_init_pageCount", "_init_extra_pageCount", "_init_disabled", "_init_extra_disabled", "_init_siblingCount", "_init_extra_siblingCount", "_init_pageChangeEvent", "_init_extra_pageChangeEvent", "_applyDecs", "e", "t", "r", "o", "i", "c", "u", "s", "f", "l", "p", "d", "m", "h", "y", "v", "g", "n", "
|
|
4
|
+
"sourcesContent": ["import { jsx, jsxs } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nimport { RuiIconChevronLeft, RuiIconChevronRight } from \"@/lib/icons\";\nimport { RuiButton } from \"../button\";\nimport { PAGINATION_DEFAULT_LABEL, clampPage } from \"./pagination.script\";\nimport \"./pagination.script\";\nfunction getPageItems(page, pageCount, siblingCount) {\n const visibleCount = siblingCount * 2 + 5;\n if (pageCount <= visibleCount) {\n return Array.from({\n length: pageCount\n }, (_, index) => index + 1);\n }\n const start = Math.max(2, page - siblingCount);\n const end = Math.min(pageCount - 1, page + siblingCount);\n const items = [1];\n if (start > 2) items.push(\"start-ellipsis\");\n for (let current = start; current <= end; current += 1) items.push(current);\n if (end < pageCount - 1) items.push(\"end-ellipsis\");\n items.push(pageCount);\n return items;\n}\nexport function RuiPaginationNav({\n label,\n page,\n pageCount,\n disabled = false,\n siblingCount = 1,\n previousText = \"Previous\",\n previousLabel = \"Go to previous page\",\n nextText = \"Next\",\n nextLabel = \"Go to next page\",\n pageLabel = item => `Go to page ${item}`,\n statusLabel = (current, count) => `Page ${current} of ${count}`\n}) {\n const resolvedPageCount = Math.max(1, Math.floor(pageCount) || 1);\n const resolvedPage = clampPage(page, resolvedPageCount);\n const resolvedSiblingCount = Math.max(0, Math.floor(siblingCount) || 0);\n const items = getPageItems(resolvedPage, resolvedPageCount, resolvedSiblingCount);\n return /* @__PURE__ */jsx(\"nav\", {\n class: \"rui-pagination__nav\",\n \"aria-label\": label,\n children: /* @__PURE__ */jsxs(\"ul\", {\n class: \"rui-pagination__list\",\n children: [/* @__PURE__ */jsx(\"li\", {\n children: /* @__PURE__ */jsxs(RuiButton, {\n variant: \"ghost\",\n size: \"sm\",\n class: \"rui-pagination__link rui-pagination__link--previous\",\n \"data-pagination-page\": resolvedPage - 1,\n \"aria-label\": previousLabel,\n disabled: disabled || resolvedPage <= 1,\n children: [/* @__PURE__ */jsx(RuiIconChevronLeft, {}), /* @__PURE__ */jsx(\"span\", {\n children: previousText\n })]\n })\n }), items.map(item => typeof item === \"number\" ? /* @__PURE__ */jsx(\"li\", {\n class: cx(\"rui-pagination__page\", item === resolvedPage && \"rui-pagination__page--current\"),\n children: /* @__PURE__ */jsx(RuiButton, {\n variant: item === resolvedPage ? \"filled\" : \"ghost\",\n size: \"sm\",\n square: true,\n class: \"rui-pagination__link\",\n \"data-pagination-page\": item,\n \"aria-label\": pageLabel(item),\n \"aria-current\": item === resolvedPage ? \"page\" : void 0,\n disabled,\n children: item\n })\n }, item) : /* @__PURE__ */jsx(\"li\", {\n class: \"rui-pagination__ellipsis\",\n \"aria-hidden\": \"true\",\n children: \"\\u2026\"\n }, item)), /* @__PURE__ */jsx(\"li\", {\n class: \"rui-pagination__status\",\n \"aria-live\": \"polite\",\n children: /* @__PURE__ */jsx(\"span\", {\n class: \"rui-pagination__status-label\",\n children: statusLabel(resolvedPage, resolvedPageCount)\n })\n }), /* @__PURE__ */jsx(\"li\", {\n children: /* @__PURE__ */jsxs(RuiButton, {\n variant: \"ghost\",\n size: \"sm\",\n class: \"rui-pagination__link rui-pagination__link--next\",\n \"data-pagination-page\": resolvedPage + 1,\n \"aria-label\": nextLabel,\n disabled: disabled || resolvedPage >= resolvedPageCount,\n children: [/* @__PURE__ */jsx(\"span\", {\n children: nextText\n }), /* @__PURE__ */jsx(RuiIconChevronRight, {})]\n })\n })]\n })\n });\n}\nexport function RuiPagination({\n children,\n label = PAGINATION_DEFAULT_LABEL,\n page = 1,\n pageCount = 1,\n disabled = false,\n siblingCount = 1,\n previousText,\n previousLabel,\n nextText,\n nextLabel,\n pageLabel,\n statusLabel,\n class: className,\n ...props\n}) {\n const resolvedPageCount = Math.max(1, Math.floor(pageCount) || 1);\n const resolvedPage = clampPage(page, resolvedPageCount);\n const resolvedSiblingCount = Math.max(0, Math.floor(siblingCount) || 0);\n return /* @__PURE__ */jsx(\"rui-pagination\", {\n ...props,\n class: cx(\"rui-pagination\", className),\n label,\n page: resolvedPage,\n pageCount: resolvedPageCount,\n disabled,\n siblingCount: resolvedSiblingCount,\n children: children ?? /* @__PURE__ */jsx(RuiPaginationNav, {\n label,\n page: resolvedPage,\n pageCount: resolvedPageCount,\n disabled,\n siblingCount: resolvedSiblingCount,\n previousText,\n previousLabel,\n nextText,\n nextLabel,\n pageLabel,\n statusLabel\n })\n });\n}", "export function cx(...parts) {\n return parts.filter(Boolean).join(\" \");\n}", "import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nexport function RuiIconChevronLeft({\n class: className,\n size = \"sm\",\n ...props\n}) {\n return /* @__PURE__ */jsx(\"svg\", {\n ...props,\n class: cx(\"rui-icon\", size === \"md\" && \"rui-icon--md\", className),\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"aria-hidden\": \"true\",\n children: /* @__PURE__ */jsx(\"path\", {\n d: \"m15 18-6-6 6-6\"\n })\n });\n}", "import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nexport function RuiIconChevronRight({\n class: className,\n size = \"sm\",\n ...props\n}) {\n return /* @__PURE__ */jsx(\"svg\", {\n ...props,\n class: cx(\"rui-icon\", size === \"md\" && \"rui-icon--md\", className),\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"aria-hidden\": \"true\",\n children: /* @__PURE__ */jsx(\"path\", {\n d: \"m9 18 6-6-6-6\"\n })\n });\n}", "import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { cx } from \"@/lib/cx\";\nfunction resolveAriaPressed(pressed, toggle, defaultPressed) {\n if (pressed !== void 0) {\n return pressed;\n }\n if (toggle) {\n return defaultPressed;\n }\n return void 0;\n}\nfunction invokeClickListener(listener, event) {\n if (typeof listener === \"function\") {\n listener(event);\n return;\n }\n if (listener != null && typeof listener === \"object\" && \"handleEvent\" in listener) {\n listener.handleEvent(event);\n }\n}\nexport function RuiButton(props) {\n if (props.href !== void 0) {\n const {\n href,\n target,\n rel,\n download,\n children: children2,\n class: className2,\n variant: variant2,\n size: size2,\n square: square2,\n ...host2\n } = props;\n return /* @__PURE__ */jsx(\"a\", {\n ...host2,\n href,\n target,\n rel,\n download,\n class: cx(\"rui-button\", `rui-button--${variant2 ?? \"filled\"}`, `rui-button--${size2 ?? \"md\"}`, square2 && \"rui-button--square\", className2),\n children: children2\n });\n }\n const {\n variant,\n size,\n square,\n class: className,\n children,\n type = \"button\",\n disabled,\n pressed,\n defaultPressed = false,\n toggle = false,\n \"on:click\": onClick,\n ...host\n } = props;\n const handleClick = event => {\n if (toggle && pressed === void 0) {\n const button = event.currentTarget;\n const next = button.getAttribute(\"aria-pressed\") !== \"true\";\n button.setAttribute(\"aria-pressed\", String(next));\n }\n invokeClickListener(onClick, event);\n };\n return /* @__PURE__ */jsx(\"button\", {\n ...host,\n type,\n class: cx(\"rui-button\", `rui-button--${variant ?? \"filled\"}`, `rui-button--${size ?? \"md\"}`, square && \"rui-button--square\", className),\n disabled,\n \"aria-pressed\": resolveAriaPressed(pressed, toggle, defaultPressed),\n \"data-toggle\": toggle && pressed === void 0 ? \"\" : void 0,\n \"on:click\": toggle || onClick ? handleClick : void 0,\n children\n });\n}", "let _initProto, _initClass, _init_label, _init_extra_label, _init_page, _init_extra_page, _init_pageCount, _init_extra_pageCount, _init_disabled, _init_extra_disabled, _init_siblingCount, _init_extra_siblingCount, _init_pageChangeEvent, _init_extra_pageChangeEvent;\nfunction _applyDecs(e, t, n, r, o, i) { var a, c, u, s, f, l, p, d = Symbol.metadata || Symbol.for(\"Symbol.metadata\"), m = Object.defineProperty, h = Object.create, y = [h(null), h(null)], v = t.length; function g(t, n, r) { return function (o, i) { n && (i = o, o = e); for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []); return r ? i : o; }; } function b(e, t, n, r) { if (\"function\" != typeof e && (r || void 0 !== e)) throw new TypeError(t + \" must \" + (n || \"be\") + \" a function\" + (r ? \"\" : \" or undefined\")); return e; } function applyDec(e, t, n, r, o, i, u, s, f, l, p) { function d(e) { if (!p(e)) throw new TypeError(\"Attempted to access private element on non-instance\"); } var h = [].concat(t[0]), v = t[3], w = !u, D = 1 === o, S = 3 === o, j = 4 === o, E = 2 === o; function I(t, n, r) { return function (o, i) { return n && (i = o, o = e), r && r(o), P[t].call(o, i); }; } if (!w) { var P = {}, k = [], F = S ? \"get\" : j || D ? \"set\" : \"value\"; if (f ? (l || D ? P = { get: _setFunctionName(function () { return v(this); }, r, \"get\"), set: function (e) { t[4](this, e); } } : P[F] = v, l || _setFunctionName(P[F], r, E ? \"\" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) { if ((c = y[+s][r]) && 7 !== (c ^ o)) throw Error(\"Decorating two elements with the same name (\" + P[F].name + \") is not supported yet\"); y[+s][r] = o < 3 ? 1 : o; } } for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) { var T = b(h[O], \"A decorator\", \"be\", !0), z = n ? h[O - 1] : void 0, A = {}, H = { kind: [\"field\", \"accessor\", \"method\", \"getter\", \"setter\", \"class\"][o], name: r, metadata: a, addInitializer: function (e, t) { if (e.v) throw new TypeError(\"attempted to call addInitializer after decoration was finished\"); b(t, \"An initializer\", \"be\", !0), i.push(t); }.bind(null, A) }; if (w) c = T.call(z, N, H), A.v = 1, b(c, \"class decorators\", \"return\") && (N = c);else if (H.static = s, H.private = f, c = H.access = { has: f ? p.bind() : function (e) { return r in e; } }, j || (c.get = f ? E ? function (e) { return d(e), P.value; } : I(\"get\", 0, d) : function (e) { return e[r]; }), E || S || (c.set = f ? I(\"set\", 0, d) : function (e, t) { e[r] = t; }), N = T.call(z, D ? { get: P.get, set: P.set } : P[F], H), A.v = 1, D) { if (\"object\" == typeof N && N) (c = b(N.get, \"accessor.get\")) && (P.get = c), (c = b(N.set, \"accessor.set\")) && (P.set = c), (c = b(N.init, \"accessor.init\")) && k.unshift(c);else if (void 0 !== N) throw new TypeError(\"accessor decorators must return an object with get, set, or init properties or undefined\"); } else b(N, (l ? \"field\" : \"method\") + \" decorators\", \"return\") && (l ? k.unshift(N) : P[F] = N); } return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I(\"get\", s), I(\"set\", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N; } function w(e) { return m(e, d, { configurable: !0, enumerable: !0, value: a }); } return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function (e) { e && f.push(g(e)); }, p = function (t, r) { for (var i = 0; i < n.length; i++) { var a = n[i], c = a[1], l = 7 & c; if ((8 & c) == t && !l == r) { var p = a[2], d = !!a[3], m = 16 & c; applyDec(t ? e : e.prototype, a, m, d ? \"#\" + p : _toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) { return _checkInRHS(t) === e; } : o); } } }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), { e: c, get c() { var n = []; return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)]; } }; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _setFunctionName(e, t, n) { \"symbol\" == typeof t && (t = (t = t.description) ? \"[\" + t + \"]\" : \"\"); try { Object.defineProperty(e, \"name\", { configurable: !0, value: n ? n + \" \" + t : t }); } catch (e) {} return e; }\nfunction _checkInRHS(e) { if (Object(e) !== e) throw TypeError(\"right-hand side of 'in' should be an object, got \" + (null !== e ? typeof e : \"null\")); return e; }\nimport { RadiantElement, customElement, event, onEvent, prop } from \"@ecopages/radiant\";\nexport const PAGINATION_DEFAULT_LABEL = \"Pagination\";\nexport function clampPage(page, pageCount) {\n return Math.min(Math.max(1, Math.floor(page) || 1), pageCount);\n}\nlet _RuiPagination;\nclass RuiPagination extends RadiantElement {\n static {\n ({\n e: [_init_label, _init_extra_label, _init_page, _init_extra_page, _init_pageCount, _init_extra_pageCount, _init_disabled, _init_extra_disabled, _init_siblingCount, _init_extra_siblingCount, _init_pageChangeEvent, _init_extra_pageChangeEvent, _initProto],\n c: [_RuiPagination, _initClass]\n } = _applyDecs(this, [customElement(\"rui-pagination\")], [[prop({\n type: String,\n defaultValue: PAGINATION_DEFAULT_LABEL\n }), 0, \"label\"], [prop({\n type: Number,\n reflect: true,\n defaultValue: 1\n }), 0, \"page\"], [prop({\n type: Number,\n attribute: \"page-count\",\n defaultValue: 1\n }), 0, \"pageCount\"], [prop({\n type: Boolean,\n reflect: true,\n defaultValue: false\n }), 0, \"disabled\"], [prop({\n type: Number,\n attribute: \"sibling-count\",\n defaultValue: 1\n }), 0, \"siblingCount\"], [event({\n name: \"rui-page-change\",\n bubbles: true,\n composed: true\n }), 0, \"pageChangeEvent\"], [onEvent({\n selector: \"[data-pagination-page]\",\n type: \"click\"\n }), 2, \"onPageClick\"]], 0, void 0, RadiantElement));\n }\n constructor(...args) {\n super(...args);\n _init_extra_pageChangeEvent(this);\n }\n label = (_initProto(this), _init_label(this));\n page = (_init_extra_label(this), _init_page(this));\n pageCount = (_init_extra_page(this), _init_pageCount(this));\n disabled = (_init_extra_pageCount(this), _init_disabled(this));\n siblingCount = (_init_extra_disabled(this), _init_siblingCount(this));\n pageChangeEvent = (_init_extra_siblingCount(this), _init_pageChangeEvent(this));\n changePage(page) {\n if (this.disabled) return;\n const next = clampPage(page, Math.max(1, Math.floor(this.pageCount) || 1));\n if (next === this.page) return;\n this.pageChangeEvent.emit({\n page: next\n });\n }\n onPageClick(event2) {\n const button = event2.target.closest(\"[data-pagination-page]\");\n const page = Number(button?.getAttribute(\"data-pagination-page\"));\n if (Number.isInteger(page)) this.changePage(page);\n }\n static {\n _initClass();\n }\n}\nexport { _RuiPagination as RuiPagination };"],
|
|
5
|
+
"mappings": "AAAA,OAAS,OAAAA,EAAK,QAAAC,OAAY,4BCAnB,SAASC,KAAMC,EAAO,CAC3B,OAAOA,EAAM,OAAO,OAAO,EAAE,KAAK,GAAG,CACvC,CCFA,OAAS,OAAAC,OAAW,4BAEb,SAASC,EAAmB,CACjC,MAAOC,EACP,KAAAC,EAAO,KACP,GAAGC,CACL,EAAG,CACD,OAAsBC,GAAI,MAAO,CAC/B,GAAGD,EACH,MAAOE,EAAG,W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S,QACT,KAAM,KACN,MAAO,kDACP,uBAAwBL,EAAe,EACvC,aAAcN,EACd,SAAUJ,GAAYU,GAAgBD,EACtC,SAAU,CAAgBI,EAAI,OAAQ,CACpC,SAAUV,CACZ,CAAC,EAAkBU,EAAIK,GAAqB,CAAC,CAAC,CAAC,CACjD,CAAC,CACH,CAAC,CAAC,CACJ,CAAC,CACH,CAAC,CACH,CACO,SAASC,GAAc,CAC5B,SAAAC,EACA,MAAArB,EAAQsB,GACR,KAAAjC,EAAO,EACP,UAAAC,EAAY,EACZ,SAAAW,EAAW,GACX,aAAAV,EAAe,EACf,aAAAW,EACA,cAAAC,EACA,SAAAC,EACA,UAAAC,EACA,UAAAC,EACA,YAAAE,EACA,MAAOe,EACP,GAAGC,CACL,EAAG,CACD,IAAMd,EAAoB,KAAK,IAAI,EAAG,KAAK,MAAMpB,CAAS,GAAK,CAAC,EAC1DqB,EAAeC,EAAUvB,EAAMqB,CAAiB,EAChDG,EAAuB,KAAK,IAAI,EAAG,KAAK,MAAMtB,CAAY,GAAK,CAAC,EACtE,OAAsBuB,EAAI,iBAAkB,CAC1C,GAAGU,EACH,MAAON,EAAG,iBAAkBK,CAAS,EACrC,MAAAvB,EACA,KAAMW,EACN,UAAWD,EACX,SAAAT,EACA,aAAcY,EACd,SAAUQ,GAA2BP,EAAIf,GAAkB,CACzD,MAAAC,EACA,KAAMW,EACN,UAAWD,EACX,SAAAT,EACA,aAAcY,EACd,aAAAX,EACA,cAAAC,EACA,SAAAC,EACA,UAAAC,EACA,UAAAC,EACA,YAAAE,CACF,CAAC,CACH,CAAC,CACH",
|
|
6
|
+
"names": ["jsx", "jsxs", "cx", "parts", "jsx", "RuiIconChevronLeft", "className", "size", "props", "jsx", "cx", "jsx", "RuiIconChevronRight", "className", "size", "props", "jsx", "cx", "jsx", "resolveAriaPressed", "pressed", "toggle", "defaultPressed", "invokeClickListener", "listener", "event", "RuiButton", "props", "href", "target", "rel", "download", "children2", "className2", "variant2", "size2", "square2", "host2", "jsx", "cx", "variant", "size", "square", "className", "children", "type", "disabled", "onClick", "host", "handleClick", "button", "next", "RadiantElement", "customElement", "event", "onEvent", "prop", "_initProto", "_initClass", "_init_label", "_init_extra_label", "_init_page", "_init_extra_page", "_init_pageCount", "_init_extra_pageCount", "_init_disabled", "_init_extra_disabled", "_init_siblingCount", "_init_extra_siblingCount", "_init_pageChangeEvent", "_init_extra_pageChangeEvent", "_applyDecs", "e", "t", "r", "o", "i", "a", "c", "u", "s", "f", "l", "p", "d", "m", "h", "y", "v", "g", "n", "b", "applyDec", "w", "D", "S", "j", "E", "I", "P", "k", "F", "_setFunctionName", "N", "O", "T", "z", "A", "H", "_toPropertyKey", "_checkInRHS", "_toPrimitive", "PAGINATION_DEFAULT_LABEL", "clampPage", "page", "pageCount", "_RuiPagination", "RuiPagination", "args", "next", "event2", "button", "getPageItems", "page", "pageCount", "siblingCount", "visibleCount", "_", "index", "start", "end", "items", "current", "RuiPaginationNav", "label", "disabled", "previousText", "previousLabel", "nextText", "nextLabel", "pageLabel", "item", "statusLabel", "count", "resolvedPageCount", "resolvedPage", "clampPage", "resolvedSiblingCount", "jsx", "jsxs", "RuiButton", "RuiIconChevronLeft", "cx", "RuiIconChevronRight", "RuiPagination", "children", "PAGINATION_DEFAULT_LABEL", "className", "props"]
|
|
7
7
|
}
|
|
@@ -19,6 +19,9 @@ rui-pagination {
|
|
|
19
19
|
flex-shrink: 0;
|
|
20
20
|
align-items: center;
|
|
21
21
|
}
|
|
22
|
+
.rui-pagination__list > li.rui-pagination__status {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
22
25
|
.rui-pagination__link {
|
|
23
26
|
gap: var(--spacing-1, var(--space-1));
|
|
24
27
|
}
|
|
@@ -32,15 +35,20 @@ rui-pagination {
|
|
|
32
35
|
line-height: var(--tw-leading, var(--text-sm--line-height, calc(1.25 / 0.875)));
|
|
33
36
|
color: var(--color-on-surface, var(--on-surface));
|
|
34
37
|
}
|
|
35
|
-
.rui-pagination__status {
|
|
36
|
-
|
|
38
|
+
.rui-pagination__status-label {
|
|
39
|
+
font-size: var(--text-sm, var(--text-sm));
|
|
40
|
+
line-height: var(--tw-leading, var(--text-sm--line-height, calc(1.25 / 0.875)));
|
|
41
|
+
color: var(--color-on-surface, var(--on-surface));
|
|
42
|
+
opacity: var(--opacity-muted, var(--opacity-muted));
|
|
43
|
+
font-variant-numeric: tabular-nums;
|
|
44
|
+
white-space: nowrap;
|
|
37
45
|
}
|
|
38
46
|
.rui-pagination__link .rui-icon {
|
|
39
47
|
flex-shrink: 0;
|
|
40
48
|
}
|
|
41
49
|
@media (max-width: 40rem) {
|
|
42
50
|
.rui-pagination__link--previous span,
|
|
43
|
-
|
|
51
|
+
.rui-pagination__link--next span {
|
|
44
52
|
position: absolute;
|
|
45
53
|
width: 1px;
|
|
46
54
|
height: 1px;
|
|
@@ -51,26 +59,55 @@ rui-pagination {
|
|
|
51
59
|
white-space: nowrap;
|
|
52
60
|
border-width: 0;
|
|
53
61
|
}
|
|
62
|
+
}
|
|
63
|
+
.rui-pagination--compact :is(.rui-pagination__link--previous span,
|
|
64
|
+
.rui-pagination__link--next span) {
|
|
65
|
+
position: absolute;
|
|
66
|
+
width: 1px;
|
|
67
|
+
height: 1px;
|
|
68
|
+
padding: 0;
|
|
69
|
+
margin: -1px;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
clip-path: inset(50%);
|
|
72
|
+
white-space: nowrap;
|
|
73
|
+
border-width: 0;
|
|
74
|
+
}
|
|
75
|
+
@media (max-width: 40rem) {
|
|
54
76
|
.rui-pagination__link--previous,
|
|
55
|
-
|
|
77
|
+
.rui-pagination__link--next {
|
|
56
78
|
width: var(--size-control-sm);
|
|
57
79
|
padding-inline: 0;
|
|
58
80
|
aspect-ratio: 1;
|
|
59
81
|
}
|
|
60
|
-
|
|
61
|
-
|
|
82
|
+
}
|
|
83
|
+
.rui-pagination--compact :is(.rui-pagination__link--previous,
|
|
84
|
+
.rui-pagination__link--next) {
|
|
85
|
+
width: var(--size-control-sm);
|
|
86
|
+
padding-inline: 0;
|
|
87
|
+
aspect-ratio: 1;
|
|
88
|
+
}
|
|
89
|
+
@media (max-width: 40rem) {
|
|
90
|
+
.rui-pagination__list > li.rui-pagination__page,
|
|
91
|
+
.rui-pagination__list > li.rui-pagination__ellipsis {
|
|
62
92
|
display: none;
|
|
63
93
|
}
|
|
64
|
-
|
|
94
|
+
}
|
|
95
|
+
.rui-pagination--compact :is(.rui-pagination__list > li.rui-pagination__page,
|
|
96
|
+
.rui-pagination__list > li.rui-pagination__ellipsis) {
|
|
97
|
+
display: none;
|
|
98
|
+
}
|
|
99
|
+
@media (max-width: 40rem) {
|
|
100
|
+
.rui-pagination__list > li.rui-pagination__status {
|
|
65
101
|
display: flex;
|
|
66
|
-
align-items: center;
|
|
67
102
|
min-height: var(--size-control-sm);
|
|
68
103
|
padding-inline: var(--space-control-x);
|
|
69
|
-
|
|
70
|
-
font-variant-numeric: tabular-nums;
|
|
71
|
-
font-size: var(--text-sm, var(--text-sm));
|
|
72
|
-
line-height: var(--tw-leading, var(--text-sm--line-height, calc(1.25 / 0.875)));
|
|
73
|
-
color: var(--color-on-surface, var(--on-surface));
|
|
104
|
+
margin-inline: var(--space-1);
|
|
74
105
|
}
|
|
75
106
|
}
|
|
107
|
+
.rui-pagination--compact :is(.rui-pagination__list > li.rui-pagination__status) {
|
|
108
|
+
display: flex;
|
|
109
|
+
min-height: var(--size-control-sm);
|
|
110
|
+
padding-inline: var(--space-control-x);
|
|
111
|
+
margin-inline: var(--space-1);
|
|
112
|
+
}
|
|
76
113
|
}
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import type { JsxCustomElementAttributes, JsxRenderable } from '@ecopages/jsx';
|
|
2
2
|
import { type RuiPagination as RuiPaginationElement, type RuiPaginationProps } from './pagination.script';
|
|
3
3
|
import './pagination.script';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Copy for the default navigation chrome. Defaults are English; pass translations to localize.
|
|
6
|
+
*/
|
|
7
|
+
export type RuiPaginationLabels = {
|
|
8
|
+
/** Visible previous-control text (visually hidden in compact chrome). Default: `Previous`. */
|
|
9
|
+
previousText?: string;
|
|
10
|
+
/** Accessible name of the previous control. Default: `Go to previous page`. */
|
|
11
|
+
previousLabel?: string;
|
|
12
|
+
/** Visible next-control text (visually hidden in compact chrome). Default: `Next`. */
|
|
13
|
+
nextText?: string;
|
|
14
|
+
/** Accessible name of the next control. Default: `Go to next page`. */
|
|
15
|
+
nextLabel?: string;
|
|
16
|
+
/** Accessible name of a page-number control. Default: `Go to page {page}`. */
|
|
17
|
+
pageLabel?: (page: number) => string;
|
|
18
|
+
/** Page position shown in compact chrome. Default: `Page {page} of {pageCount}`. */
|
|
19
|
+
statusLabel?: (page: number, pageCount: number) => string;
|
|
20
|
+
};
|
|
21
|
+
export type RuiPaginationNavProps = RuiPaginationLabels & {
|
|
5
22
|
label: string;
|
|
6
23
|
page: number;
|
|
7
24
|
pageCount: number;
|
|
@@ -12,20 +29,22 @@ export type RuiPaginationNavProps = {
|
|
|
12
29
|
* Default previous / page / next chrome for `RuiPagination`. Stamps `[data-pagination-page]`
|
|
13
30
|
* on each navigable control.
|
|
14
31
|
*/
|
|
15
|
-
export declare function RuiPaginationNav({ label, page, pageCount, disabled, siblingCount, }: RuiPaginationNavProps): JsxRenderable;
|
|
32
|
+
export declare function RuiPaginationNav({ label, page, pageCount, disabled, siblingCount, previousText, previousLabel, nextText, nextLabel, pageLabel, statusLabel, }: RuiPaginationNavProps): JsxRenderable;
|
|
16
33
|
/**
|
|
17
34
|
* Accessible page navigation for a controlled collection. Stamps `<rui-pagination>`;
|
|
18
35
|
* renders `RuiPaginationNav` by default (each link carries `[data-pagination-page]`).
|
|
19
36
|
*
|
|
20
37
|
* @remarks Pass `children` to replace the navigation chrome while keeping the
|
|
21
|
-
* `rui-pagination` event contract.
|
|
38
|
+
* `rui-pagination` event contract. `RuiPaginationLabels` props localize the default
|
|
39
|
+
* chrome; they are view-only and never reach the host element.
|
|
22
40
|
*
|
|
23
41
|
* @cssclass rui-pagination - Navigation root on the host.
|
|
24
42
|
* @cssclass rui-pagination__page - Page-number item; `__page--current` marks the active page.
|
|
25
|
-
* @cssclass rui-pagination--compact - Force
|
|
26
|
-
* @cssclass rui-pagination__status - Non-interactive
|
|
43
|
+
* @cssclass rui-pagination--compact - Force the narrow chrome used below `40rem`: icon-only previous / next around the page position.
|
|
44
|
+
* @cssclass rui-pagination__status - Non-interactive page position in compact chrome.
|
|
45
|
+
* @cssclass rui-pagination__status-label - Muted “Page {n} of {m}” copy; hidden with full page list.
|
|
27
46
|
* @cssclass rui-pagination__ellipsis - Hidden range marker between page numbers.
|
|
28
47
|
*/
|
|
29
|
-
export declare function RuiPagination({ children, label, page, pageCount, disabled, siblingCount, class: className, ...props }: JsxCustomElementAttributes<RuiPaginationElement, RuiPaginationProps> & {
|
|
48
|
+
export declare function RuiPagination({ children, label, page, pageCount, disabled, siblingCount, previousText, previousLabel, nextText, nextLabel, pageLabel, statusLabel, class: className, ...props }: JsxCustomElementAttributes<RuiPaginationElement, RuiPaginationProps> & RuiPaginationLabels & {
|
|
30
49
|
children?: JsxRenderable;
|
|
31
50
|
}): JsxRenderable;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as F,jsxs as ee}from"@ecopages/jsx/jsx-runtime";function ht(...e){return e.filter(Boolean).join(" ")}import{RadiantElement as V,bound as Z,customElement as Zt,event as fe,onEvent as H,onUpdated as zt,prop as E,query as z}from"@ecopages/radiant";import{isServer as de}from"@ecopages/radiant/is-server";var ne={top:"bottom",bottom:"top",left:"right",right:"left"},re=8;function oe(e){let t=e.indexOf("-");if(t===-1)return{side:e,align:"center"};let n=e.slice(0,t),r=e.slice(t+1);return{side:n,align:r==="start"||r==="end"?r:"center"}}function dt(e){return e==="top"||e==="bottom"?"y":"x"}function pt(e,t,n,r,o){let{width:i,height:a}=t,s=0,f=0;switch(n){case"top":f=e.top-a-o;break;case"bottom":f=e.bottom+o;break;case"left":s=e.left-i-o;break;case"right":s=e.right+o;break}return dt(n)==="y"?r==="start"?s=e.left:r==="end"?s=e.right-i:s=e.left+(e.width-i)/2:r==="start"?f=e.top:r==="end"?f=e.bottom-a:f=e.top+(e.height-a)/2,{x:s,y:f}}function ie(e,t,n,r){let{padding:o,width:i,height:a}=r;return n==="top"?Math.max(0,o-e.y):n==="bottom"?Math.max(0,e.y+t.height-(a-o)):n==="left"?Math.max(0,o-e.x):Math.max(0,e.x+t.width-(i-o))}function ft(e,t,n,r){let{padding:o,width:i,height:a}=r;return n==="top"?e.top-o-t.height:n==="bottom"?a-o-t.height-e.bottom:n==="left"?e.left-o-t.width:i-o-t.width-e.right}function se(e,t){return t==="center"?e:`${e}-${t}`}function ae(e,t,n,r){let{padding:o,width:i,height:a}=r;if(dt(n)==="y"){let f=Math.max(o,i-o-t.width);return{x:Math.min(Math.max(e.x,o),f),y:e.y}}let s=Math.max(o,a-o-t.height);return{x:e.x,y:Math.min(Math.max(e.y,o),s)}}function ce(e,t,n,r,o={width:typeof window>"u"?0:window.innerWidth,height:typeof window>"u"?0:window.innerHeight,padding:re}){let{side:i,align:a}=oe(n),s=pt(e,t,i,a,r),f=ie(s,t,i,o),C=i,P=s;if(f>0){let A=ne[i],T=pt(e,t,A,a,r),R=ft(e,t,i,o);ft(e,t,A,o)>R&&(C=A,P=T)}return{coords:ae(P,t,C,o),placement:se(C,a)}}function le(e,t,n,r,o={}){let{coords:i,placement:a}=ce(e.getBoundingClientRect(),{width:t.offsetWidth,height:t.offsetHeight},n,r);return Object.assign(t.style,{position:"fixed",left:`${i.x}px`,top:`${i.y}px`,right:"auto",bottom:"auto",visibility:"visible"}),o.matchAnchorWidth&&(t.style.width=`${e.offsetWidth}px`),t.setAttribute("data-placement",a),a}function gt({anchor:e,floating:t,getPlacement:n,gap:r,matchAnchorWidth:o}){let i=()=>{t.hidden||le(e,t,n(),r,{matchAnchorWidth:o})};i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0);let a=new ResizeObserver(i);return a.observe(e),a.observe(t),()=>{window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),a.disconnect()}}function mt(e,t=document.body){let n=e.parentNode;if(!n)return{unmount:()=>{}};let r=document.createComment("rui-portal");return n.insertBefore(r,e),t.appendChild(e),{unmount:()=>{let o=r.parentNode;o&&(o.insertBefore(e,r),r.remove())}}}function J(e,t,n){return n?!!(e?.contains(n)||t?.contains(n)):!1}function vt(e,t,n){return n instanceof Node?!J(e,t,n):!0}function yt(e,t,n){return!J(e,t,n)}var B=class{config;cleanupFloating=null;portalHandle=null;floatingElement=null;constructor(t){this.config=t}updateConfig(t){this.config={...this.config,...t}}sync(){let t=this.resolveFloating();if(!t)return;if(!this.config.getOpen()){this.teardown(),t.toggleAttribute("hidden",!0);return}let r=this.config.getAnchor();if(!r)return;t.toggleAttribute("hidden",!1),this.config.portal!==!1?this.portalHandle||(this.portalHandle=mt(t,this.config.portalContainer??document.body)):this.portalHandle&&(this.portalHandle.unmount(),this.portalHandle=null),this.teardownFloating(),this.cleanupFloating=gt({anchor:r,floating:t,getPlacement:this.config.getPlacement,gap:this.config.gap??8,matchAnchorWidth:this.config.matchAnchorWidth})}contains(t){return J(this.config.getAnchor(),this.resolveFloating(),t)}getFloatingElement(){return this.resolveFloating()}teardown(){this.teardownFloating(),this.portalHandle&&(this.portalHandle.unmount(),this.portalHandle=null)}destroy(){this.teardown(),this.floatingElement=null}resolveFloating(){let t=this.config.getFloating();return t&&(this.floatingElement=t),t??this.floatingElement}teardownFloating(){this.cleanupFloating?.(),this.cleanupFloating=null}};var xt,bt,wt,_t,Et,Ct,Pt,At,Tt,kt,Ot,Ft,St,Dt,Ht,Rt,Wt,jt,Mt,It,Lt,Bt,Vt,qt,$t,Kt,Ut,Gt;function Qt(e,t,n,r,o,i){var a,s,f,C,P,A,T,R=Symbol.metadata||Symbol.for("Symbol.metadata"),q=Object.defineProperty,$=Object.create,N=[$(null),$(null)],tt=t.length;function W(c,v,g){return function(l,u){v&&(u=l,l=e);for(var y=0;y<c.length;y++)u=c[y].apply(l,g?[u]:[]);return g?u:l}}function w(c,v,g,l){if(typeof c!="function"&&(l||c!==void 0))throw new TypeError(v+" must "+(g||"be")+" a function"+(l?"":" or undefined"));return c}function et(c,v,g,l,u,y,k,m,x,b,rt){function K(p){if(!rt(p))throw new TypeError("Attempted to access private element on non-instance")}var U=[].concat(v[0]),ot=v[3],G=!k,S=u===1,it=u===3,st=u===4,j=u===2;function M(p,O,lt){return function(L,ut){return O&&(ut=L,L=c),lt&<(L),h[p].call(L,ut)}}if(!G){var h={},X=[],_=it?"get":st||S?"set":"value";if(x?(b||S?h={get:Xt(function(){return ot(this)},l,"get"),set:function(p){v[4](this,p)}}:h[_]=ot,b||Xt(h[_],l,j?"":_)):b||(h=Object.getOwnPropertyDescriptor(c,l)),!b&&!x){if((s=N[+m][l])&&(s^u)!==7)throw Error("Decorating two elements with the same name ("+h[_].name+") is not supported yet");N[+m][l]=u<3?1:u}}for(var d=c,I=U.length-1;I>=0;I-=g?2:1){var at=w(U[I],"A decorator","be",!0),ct=g?U[I-1]:void 0,Y={},D={kind:["field","accessor","method","getter","setter","class"][u],name:l,metadata:a,addInitializer:function(p,O){if(p.v)throw new TypeError("attempted to call addInitializer after decoration was finished");w(O,"An initializer","be",!0),y.push(O)}.bind(null,Y)};if(G)s=at.call(ct,d,D),Y.v=1,w(s,"class decorators","return")&&(d=s);else if(D.static=m,D.private=x,s=D.access={has:x?rt.bind():function(p){return l in p}},st||(s.get=x?j?function(p){return K(p),h.value}:M("get",0,K):function(p){return p[l]}),j||it||(s.set=x?M("set",0,K):function(p,O){p[l]=O}),d=at.call(ct,S?{get:h.get,set:h.set}:h[_],D),Y.v=1,S){if(typeof d=="object"&&d)(s=w(d.get,"accessor.get"))&&(h.get=s),(s=w(d.set,"accessor.set"))&&(h.set=s),(s=w(d.init,"accessor.init"))&&X.unshift(s);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else w(d,(b?"field":"method")+" decorators","return")&&(b?X.unshift(d):h[_]=d)}return u<2&&k.push(W(X,m,1),W(y,m,0)),b||G||(x?S?k.splice(-1,0,M("get",m),M("set",m)):k.push(j?h[_]:w.call.bind(h[_])):q(c,l,h)),d}function nt(c){return q(c,R,{configurable:!0,enumerable:!0,value:a})}return i!==void 0&&(a=i[R]),a=$(a??null),P=[],A=function(c){c&&P.push(W(c))},T=function(c,v){for(var g=0;g<n.length;g++){var l=n[g],u=l[1],y=7&u;if((8&u)==c&&!y==v){var k=l[2],m=!!l[3],x=16&u;et(c?e:e.prototype,l,x,m?"#"+k:ue(k),y,y<2?[]:c?C=C||[]:f=f||[],P,!!c,m,v,c&&m?function(b){return pe(b)===e}:o)}}},T(8,0),T(0,0),T(8,1),T(0,1),A(f),A(C),s=P,tt||nt(e),{e:s,get c(){var c=[];return tt&&[nt(e=et(e,[t],r,e.name,5,c)),W(c,1)]}}}function ue(e){var t=he(e,"string");return typeof t=="symbol"?t:t+""}function he(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xt(e,t,n){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+" "+t:t})}catch{}return e}function pe(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var Nt,Yt=class extends V{static{({e:[wt,_t,Et,Ct,Pt,At,Tt,kt,Ot,Ft,St,Dt,Ht,Rt,Wt,jt,Mt,It,Lt,Bt,xt],c:[Nt,bt]}=Qt(this,[Zt("rui-popover")],[[E({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[E({type:String,defaultValue:"bottom"}),0,"placement"],[E({type:Boolean,defaultValue:!0}),0,"portal"],[E({type:Boolean,defaultValue:!1}),0,"matchAnchorWidth"],[E({type:Number,defaultValue:8}),0,"offset"],[E({type:String,defaultValue:""}),0,"anchor"],[E({type:String,defaultValue:"default"}),0,"variant"],[z({ref:"surface"}),0,"surfaceTarget"],[z({ref:"host"}),0,"hostTarget"],[fe({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[Z,zt(["open","placement","portal","matchAnchorWidth","offset","anchor"])],2,"syncPopover"],[H({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[H({ref:"host",type:"focusout"}),2,"onFocusOut"],[Z,2,"onExternalAnchorClick"],[H({document:!0,type:"keydown"}),2,"onDocumentKeydown"]],0,void 0,V))}open=(xt(this),wt(this));placement=(_t(this),Et(this));portal=(Ct(this),Pt(this));matchAnchorWidth=(At(this),Tt(this));offset=(kt(this),Ot(this));anchor=(Ft(this),St(this));variant=(Dt(this),Ht(this));surfaceTarget=(Rt(this),Wt(this));hostTarget=(jt(this),Mt(this));openChangeEvent=(It(this),Lt(this));surfaceId=(Bt(this),`rui-popover-${Math.random().toString(36).slice(2,9)}`);controller=null;anchorClickTarget=null;onConnected(){this.syncPopover()}disconnectedCallback(){this.unbindExternalAnchorClick(),this.controller?.destroy(),this.controller=null,super.disconnectedCallback()}getAnchorElement(){let n=this.closest("rui-popover-trigger")?.querySelector("[data-popover-trigger]");if(n instanceof HTMLElement)return Q(n);let r=this.querySelector("[data-popover-trigger]");if(r instanceof HTMLElement)return Q(r);let o=this.anchor.trim();if(o){let i=document.querySelector(o);if(i instanceof HTMLElement)return Q(i)}return null}ensureController(){return this.controller||(this.controller=new B({getAnchor:()=>this.getAnchorElement(),getFloating:()=>this.surfaceTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:this.offset,portal:this.portal,matchAnchorWidth:this.matchAnchorWidth})),this.controller}syncPopover(){let t=this.getAnchorElement(),n=this.surfaceTarget;n&&(n.id=this.surfaceId),t&&(t.setAttribute("aria-controls",this.surfaceId),t.setAttribute("aria-expanded",String(this.open))),this.syncExternalAnchorClick(t);let r=this.ensureController();r.updateConfig({getAnchor:()=>this.getAnchorElement(),getFloating:()=>this.surfaceTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:this.offset,portal:this.portal,matchAnchorWidth:this.matchAnchorWidth}),r.sync()}setOpen(t,n=!0){if(this.open===t){this.syncPopover();return}this.open=t,n&&this.openChangeEvent.emit({open:t}),this.syncPopover()}onDocumentPointerDown(t){if(!this.open)return;let n=t.target;yt(this.getAnchorElement(),this.controller?.getFloatingElement()??this.surfaceTarget,n)&&this.setOpen(!1)}onFocusOut(t){this.open&&vt(this.getAnchorElement(),this.controller?.getFloatingElement()??this.surfaceTarget,t.relatedTarget)&&this.setOpen(!1)}usesExternalAnchor(){return!this.anchor.trim()||this.closest("rui-popover-trigger")?!1:!this.querySelector("[data-popover-trigger]")}syncExternalAnchorClick(t){if(!this.usesExternalAnchor()||!t){this.unbindExternalAnchorClick();return}this.anchorClickTarget!==t&&(this.unbindExternalAnchorClick(),t.addEventListener("click",this.onExternalAnchorClick),this.anchorClickTarget=t)}unbindExternalAnchorClick(){this.anchorClickTarget&&(this.anchorClickTarget.removeEventListener("click",this.onExternalAnchorClick),this.anchorClickTarget=null)}onExternalAnchorClick(){this.setOpen(!this.open)}onDocumentKeydown(t){if(!this.open||t.key!=="Escape")return;t.preventDefault(),this.setOpen(!1),this.getAnchorElement()?.focus()}static{bt()}};var te,Jt=class extends V{static{({e:[$t,Kt,Ut,Gt,Vt],c:[te,qt]}=Qt(this,[Zt("rui-popover-trigger")],[[E({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[z({ref:"root"}),0,"rootTarget"],[[Z,zt(["open"])],2,"syncToPopover"],[H({ref:"root",type:"click"}),2,"onHostClick"],[H({selector:"rui-popover",type:"rui-open-change"}),2,"onPopoverOpenChange"]],0,void 0,V))}constructor(...t){super(...t),Gt(this)}open=(Vt(this),$t(this));rootTarget=(Kt(this),Ut(this));getPopover(){return this.querySelector("rui-popover")}onConnected(){this.syncToPopover()}syncToPopover(){if(de)return;let t=this.getPopover();!t||typeof t.setOpen!="function"||t.open!==this.open&&t.setOpen(this.open,!1)}onHostClick(t){if(!t.target?.closest("[data-popover-trigger]"))return;this.open=!this.open;let r=this.getPopover();r&&typeof r.setOpen=="function"&&r.setOpen(this.open)}onPopoverOpenChange(t){let n=this.getPopover();t.target===n&&(this.open=t.detail.open)}static{qt()}};function Q(e){return e.querySelector('button, a[href], input, select, textarea, [role="button"]')??e}function ge({children:e,class:t,...n}){return F("div",{...n,class:ht(t),children:e})}function me({trigger:e,children:t,variant:n="default",...r}){let o=n==="listbox"?"rui-popover--listbox":"";return F("rui-popover",{...r,variant:n,children:ee("div",{class:"rui-popover-host","data-ref":"host",children:[e!=null?F("span",{"data-popover-trigger":!0,children:e}):null,F("div",{"data-ref":"surface",class:`rui-popover rui-floating ${o}`.trim(),role:"dialog",children:t})]})})}function ve({trigger:e,children:t,...n}){return F("rui-popover-trigger",{...n,children:ee("div",{class:"rui-popover-trigger","data-ref":"root",children:[F("span",{"data-popover-trigger":!0,children:e}),t]})})}export{me as RuiPopover,ge as RuiPopoverContent,Nt as RuiPopoverElement,ve as RuiPopoverTrigger,te as RuiPopoverTriggerElement};
|
|
1
|
+
import{jsx as F,jsxs as oe}from"@ecopages/jsx/jsx-runtime";function pt(...e){return e.filter(Boolean).join(" ")}import{RadiantElement as V,bound as Q,customElement as te,event as xe,onEvent as D,onUpdated as ee,prop as A,query as N}from"@ecopages/radiant";import{isServer as be}from"@ecopages/radiant/is-server";var ie=/^[A-Za-z][A-Za-z0-9_-]*$/;function ft(e){return ie.test(e)}function se(e){let t=e.trim();if(ft(t))return t;let n=`rui-${t}`;return t&&ft(n)?n:"rui"}function dt(e){let t=typeof crypto.randomUUID=="function"?crypto.randomUUID().replace(/-/g,""):Array.from(crypto.getRandomValues(new Uint8Array(16)),n=>n.toString(16).padStart(2,"0")).join("");return`${se(e)}-${t}`}var ae={top:"bottom",bottom:"top",left:"right",right:"left"},ce=8,Y=new WeakMap;function le(e){Y.has(e)&&(e.style.width="",e.style.minWidth="",e.style.maxWidth="",e.style.boxSizing="",Y.delete(e))}function ue(e){let t=e.indexOf("-");if(t===-1)return{side:e,align:"center"};let n=e.slice(0,t),r=e.slice(t+1);return{side:n,align:r==="start"||r==="end"?r:"center"}}function vt(e){return e==="top"||e==="bottom"?"y":"x"}function gt(e,t,n,r,o){let{width:i,height:a}=t,s=0,h=0;switch(n){case"top":h=e.top-a-o;break;case"bottom":h=e.bottom+o;break;case"left":s=e.left-i-o;break;case"right":s=e.right+o;break}return vt(n)==="y"?r==="start"?s=e.left:r==="end"?s=e.right-i:s=e.left+(e.width-i)/2:r==="start"?h=e.top:r==="end"?h=e.bottom-a:h=e.top+(e.height-a)/2,{x:s,y:h}}function he(e,t,n,r){let{padding:o,width:i,height:a}=r;return n==="top"?Math.max(0,o-e.y):n==="bottom"?Math.max(0,e.y+t.height-(a-o)):n==="left"?Math.max(0,o-e.x):Math.max(0,e.x+t.width-(i-o))}function mt(e,t,n,r){let{padding:o,width:i,height:a}=r;return n==="top"?e.top-o-t.height:n==="bottom"?a-o-t.height-e.bottom:n==="left"?e.left-o-t.width:i-o-t.width-e.right}function pe(e,t){return t==="center"?e:`${e}-${t}`}function fe(e,t,n,r){let{padding:o,width:i,height:a}=r;if(vt(n)==="y"){let h=Math.max(o,i-o-t.width);return{x:Math.min(Math.max(e.x,o),h),y:Math.max(o,e.y)}}let s=Math.max(o,a-o-t.height);return{x:Math.max(o,e.x),y:Math.min(Math.max(e.y,o),s)}}function de(e,t,n,r,o={width:typeof window>"u"?0:window.innerWidth,height:typeof window>"u"?0:window.innerHeight,padding:ce}){let{side:i,align:a}=ue(n),s=gt(e,t,i,a,r),h=he(s,t,i,o),v=i,C=s;if(h>0){let P=ae[i],T=gt(e,t,P,a,r),H=mt(e,t,i,o);mt(e,t,P,o)>H&&(v=P,C=T)}return{coords:fe(C,t,v,o),placement:pe(v,a)}}function ge(e,t,n,r,o={}){let i=o.matchAnchorWidth===!0,a=e.offsetWidth,s=i?{width:a,height:t.offsetHeight}:{width:t.offsetWidth,height:t.offsetHeight};i?(t.style.width=`${a}px`,t.style.minWidth=`${a}px`,t.style.maxWidth=`${a}px`,t.style.boxSizing="border-box",Y.set(t,!0)):le(t);let{coords:h,placement:v}=de(e.getBoundingClientRect(),s,n,r);return Object.assign(t.style,{position:"fixed",left:`${h.x}px`,top:`${h.y}px`,right:"auto",bottom:"auto",visibility:"visible"}),t.setAttribute("data-placement",v),v}function yt({anchor:e,floating:t,getPlacement:n,gap:r,matchAnchorWidth:o}){let i=()=>{t.hidden||ge(e,t,n(),r,{matchAnchorWidth:o})};i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0);let a=new ResizeObserver(i);return a.observe(e),a.observe(t),()=>{window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),a.disconnect()}}function xt(e,t=document.body){let n=e.parentNode;if(!n)return{unmount:()=>{}};let r=document.createComment("rui-portal");return n.insertBefore(r,e),t.appendChild(e),{unmount:()=>{let o=r.parentNode;o&&(o.insertBefore(e,r),r.remove())}}}function z(e,t,n){return n?!!(e?.contains(n)||t?.contains(n)):!1}function bt(e,t,n){return n instanceof Node?!z(e,t,n):!0}function wt(e,t,n){return!z(e,t,n)}var L=class{config;cleanupFloating=null;portalHandle=null;floatingElement=null;constructor(t){this.config=t}updateConfig(t){this.config={...this.config,...t}}sync(){let t=this.resolveFloating();if(!t)return;if(!this.config.getOpen()){this.teardown(),t.toggleAttribute("hidden",!0);return}let r=this.config.getAnchor();if(!r)return;t.toggleAttribute("hidden",!1),this.config.portal!==!1?this.portalHandle||(this.portalHandle=xt(t,this.config.portalContainer??document.body)):this.portalHandle&&(this.portalHandle.unmount(),this.portalHandle=null),this.teardownFloating(),this.cleanupFloating=yt({anchor:r,floating:t,getPlacement:this.config.getPlacement,gap:this.config.gap??8,matchAnchorWidth:this.config.matchAnchorWidth})}contains(t){return z(this.config.getAnchor(),this.resolveFloating(),t)}getFloatingElement(){return this.resolveFloating()}teardown(){this.teardownFloating(),this.portalHandle&&(this.portalHandle.unmount(),this.portalHandle=null)}destroy(){this.teardown(),this.floatingElement=null}resolveFloating(){let t=this.config.getFloating();return t&&(this.floatingElement=t),t??this.floatingElement}teardownFloating(){this.cleanupFloating?.(),this.cleanupFloating=null}};var _t,Et,At,Ct,Pt,Tt,St,kt,Ft,Ot,Wt,Dt,Ht,Rt,Mt,jt,It,$t,Lt,Vt,qt,Bt,Ut,Kt,Zt,Gt,Xt,Yt;function Nt(e,t,n,r,o,i){var a,s,h,v,C,P,T,H=Symbol.metadata||Symbol.for("Symbol.metadata"),q=Object.defineProperty,B=Object.create,tt=[B(null),B(null)],et=t.length;function R(c,y,g){return function(l,u){y&&(u=l,l=e);for(var x=0;x<c.length;x++)u=c[x].apply(l,g?[u]:[]);return g?u:l}}function _(c,y,g,l){if(typeof c!="function"&&(l||c!==void 0))throw new TypeError(y+" must "+(g||"be")+" a function"+(l?"":" or undefined"));return c}function nt(c,y,g,l,u,x,S,m,b,w,ot){function U(f){if(!ot(f))throw new TypeError("Attempted to access private element on non-instance")}var K=[].concat(y[0]),it=y[3],Z=!S,O=u===1,st=u===3,at=u===4,M=u===2;function j(f,k,ut){return function($,ht){return k&&(ht=$,$=c),ut&&ut($),p[f].call($,ht)}}if(!Z){var p={},G=[],E=st?"get":at||O?"set":"value";if(b?(w||O?p={get:zt(function(){return it(this)},l,"get"),set:function(f){y[4](this,f)}}:p[E]=it,w||zt(p[E],l,M?"":E)):w||(p=Object.getOwnPropertyDescriptor(c,l)),!w&&!b){if((s=tt[+m][l])&&(s^u)!==7)throw Error("Decorating two elements with the same name ("+p[E].name+") is not supported yet");tt[+m][l]=u<3?1:u}}for(var d=c,I=K.length-1;I>=0;I-=g?2:1){var ct=_(K[I],"A decorator","be",!0),lt=g?K[I-1]:void 0,X={},W={kind:["field","accessor","method","getter","setter","class"][u],name:l,metadata:a,addInitializer:function(f,k){if(f.v)throw new TypeError("attempted to call addInitializer after decoration was finished");_(k,"An initializer","be",!0),x.push(k)}.bind(null,X)};if(Z)s=ct.call(lt,d,W),X.v=1,_(s,"class decorators","return")&&(d=s);else if(W.static=m,W.private=b,s=W.access={has:b?ot.bind():function(f){return l in f}},at||(s.get=b?M?function(f){return U(f),p.value}:j("get",0,U):function(f){return f[l]}),M||st||(s.set=b?j("set",0,U):function(f,k){f[l]=k}),d=ct.call(lt,O?{get:p.get,set:p.set}:p[E],W),X.v=1,O){if(typeof d=="object"&&d)(s=_(d.get,"accessor.get"))&&(p.get=s),(s=_(d.set,"accessor.set"))&&(p.set=s),(s=_(d.init,"accessor.init"))&&G.unshift(s);else if(d!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else _(d,(w?"field":"method")+" decorators","return")&&(w?G.unshift(d):p[E]=d)}return u<2&&S.push(R(G,m,1),R(x,m,0)),w||Z||(b?O?S.splice(-1,0,j("get",m),j("set",m)):S.push(M?p[E]:_.call.bind(p[E])):q(c,l,p)),d}function rt(c){return q(c,H,{configurable:!0,enumerable:!0,value:a})}return i!==void 0&&(a=i[H]),a=B(a??null),C=[],P=function(c){c&&C.push(R(c))},T=function(c,y){for(var g=0;g<n.length;g++){var l=n[g],u=l[1],x=7&u;if((8&u)==c&&!x==y){var S=l[2],m=!!l[3],b=16&u;nt(c?e:e.prototype,l,b,m?"#"+S:me(S),x,x<2?[]:c?v=v||[]:h=h||[],C,!!c,m,y,c&&m?function(w){return ye(w)===e}:o)}}},T(8,0),T(0,0),T(8,1),T(0,1),P(h),P(v),s=C,et||rt(e),{e:s,get c(){var c=[];return et&&[rt(e=nt(e,[t],r,e.name,5,c)),R(c,1)]}}}function me(e){var t=ve(e,"string");return typeof t=="symbol"?t:t+""}function ve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zt(e,t,n){typeof t=="symbol"&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+" "+t:t})}catch{}return e}function ye(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(e!==null?typeof e:"null"));return e}var ne,Jt=class extends V{static{({e:[At,Ct,Pt,Tt,St,kt,Ft,Ot,Wt,Dt,Ht,Rt,Mt,jt,It,$t,Lt,Vt,qt,Bt,_t],c:[ne,Et]}=Nt(this,[te("rui-popover")],[[A({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[A({type:String,defaultValue:"bottom"}),0,"placement"],[A({type:Boolean,defaultValue:!0}),0,"portal"],[A({type:Boolean,defaultValue:!1}),0,"matchAnchorWidth"],[A({type:Number,defaultValue:8}),0,"offset"],[A({type:String,defaultValue:""}),0,"anchor"],[A({type:String,defaultValue:"default"}),0,"variant"],[N({ref:"surface"}),0,"surfaceTarget"],[N({ref:"host"}),0,"hostTarget"],[xe({name:"rui-open-change",bubbles:!0,composed:!0}),0,"openChangeEvent"],[[Q,ee(["open","placement","portal","matchAnchorWidth","offset","anchor"])],2,"syncPopover"],[D({document:!0,type:"pointerdown"}),2,"onDocumentPointerDown"],[D({ref:"host",type:"focusout"}),2,"onFocusOut"],[Q,2,"onExternalAnchorClick"],[D({document:!0,type:"keydown"}),2,"onDocumentKeydown"]],0,void 0,V))}open=(_t(this),At(this));placement=(Ct(this),Pt(this));portal=(Tt(this),St(this));matchAnchorWidth=(kt(this),Ft(this));offset=(Ot(this),Wt(this));anchor=(Dt(this),Ht(this));variant=(Rt(this),Mt(this));surfaceTarget=(jt(this),It(this));hostTarget=($t(this),Lt(this));openChangeEvent=(Vt(this),qt(this));surfaceId=(Bt(this),dt("rui-popover"));controller=null;anchorClickTarget=null;onConnected(){this.syncPopover()}disconnectedCallback(){this.unbindExternalAnchorClick(),this.controller?.destroy(),this.controller=null,super.disconnectedCallback()}getAnchorElement(){let n=this.closest("rui-popover-trigger")?.querySelector("[data-popover-trigger]");if(n instanceof HTMLElement)return J(n);let r=this.querySelector("[data-popover-trigger]");if(r instanceof HTMLElement)return J(r);let o=this.anchor.trim();if(o){let i=document.querySelector(o);if(i instanceof HTMLElement)return J(i)}return null}ensureController(){return this.controller||(this.controller=new L({getAnchor:()=>this.getAnchorElement(),getFloating:()=>this.surfaceTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:this.offset,portal:this.portal,matchAnchorWidth:this.matchAnchorWidth})),this.controller}syncPopover(){let t=this.getAnchorElement(),n=this.surfaceTarget;n&&(n.id=this.surfaceId),t&&(t.setAttribute("aria-controls",this.surfaceId),t.setAttribute("aria-expanded",String(this.open))),this.syncExternalAnchorClick(t);let r=this.ensureController();r.updateConfig({getAnchor:()=>this.getAnchorElement(),getFloating:()=>this.surfaceTarget,getOpen:()=>this.open,getPlacement:()=>this.placement,gap:this.offset,portal:this.portal,matchAnchorWidth:this.matchAnchorWidth}),r.sync()}setOpen(t,n=!0){if(this.open===t){this.syncPopover();return}this.open=t,n&&this.openChangeEvent.emit({open:t}),this.syncPopover()}onDocumentPointerDown(t){if(!this.open)return;let n=t.target;wt(this.getAnchorElement(),this.controller?.getFloatingElement()??this.surfaceTarget,n)&&this.setOpen(!1)}onFocusOut(t){this.open&&bt(this.getAnchorElement(),this.controller?.getFloatingElement()??this.surfaceTarget,t.relatedTarget)&&this.setOpen(!1)}usesExternalAnchor(){return!this.anchor.trim()||this.closest("rui-popover-trigger")?!1:!this.querySelector("[data-popover-trigger]")}syncExternalAnchorClick(t){if(!this.usesExternalAnchor()||!t){this.unbindExternalAnchorClick();return}this.anchorClickTarget!==t&&(this.unbindExternalAnchorClick(),t.addEventListener("click",this.onExternalAnchorClick),this.anchorClickTarget=t)}unbindExternalAnchorClick(){this.anchorClickTarget&&(this.anchorClickTarget.removeEventListener("click",this.onExternalAnchorClick),this.anchorClickTarget=null)}onExternalAnchorClick(){this.setOpen(!this.open)}onDocumentKeydown(t){if(!this.open||t.key!=="Escape")return;t.preventDefault(),this.setOpen(!1),this.getAnchorElement()?.focus()}static{Et()}};var re,Qt=class extends V{static{({e:[Zt,Gt,Xt,Yt,Ut],c:[re,Kt]}=Nt(this,[te("rui-popover-trigger")],[[A({type:Boolean,reflect:!0,defaultValue:!1}),0,"open"],[N({ref:"root"}),0,"rootTarget"],[[Q,ee(["open"])],2,"syncToPopover"],[D({ref:"root",type:"click"}),2,"onHostClick"],[D({selector:"rui-popover",type:"rui-open-change"}),2,"onPopoverOpenChange"]],0,void 0,V))}constructor(...t){super(...t),Yt(this)}open=(Ut(this),Zt(this));rootTarget=(Gt(this),Xt(this));getPopover(){return this.querySelector("rui-popover")}onConnected(){this.syncToPopover()}syncToPopover(){if(be)return;let t=this.getPopover();!t||typeof t.setOpen!="function"||t.open!==this.open&&t.setOpen(this.open,!1)}onHostClick(t){if(!t.target?.closest("[data-popover-trigger]"))return;this.open=!this.open;let r=this.getPopover();r&&typeof r.setOpen=="function"&&r.setOpen(this.open)}onPopoverOpenChange(t){let n=this.getPopover();t.target===n&&(this.open=t.detail.open)}static{Kt()}};function J(e){return e.querySelector('button, a[href], input, select, textarea, [role="button"]')??e}function we({children:e,class:t,...n}){return F("div",{...n,class:pt(t),children:e})}function _e({trigger:e,children:t,variant:n="default",...r}){let o=n==="listbox"?"rui-popover--listbox":"";return F("rui-popover",{...r,variant:n,children:oe("div",{class:"rui-popover-host","data-ref":"host",children:[e!=null?F("span",{"data-popover-trigger":!0,children:e}):null,F("div",{"data-ref":"surface",class:`rui-popover rui-floating ${o}`.trim(),role:"dialog",children:t})]})})}function Ee({trigger:e,children:t,...n}){return F("rui-popover-trigger",{...n,children:oe("div",{class:"rui-popover-trigger","data-ref":"root",children:[F("span",{"data-popover-trigger":!0,children:e}),t]})})}export{_e as RuiPopover,we as RuiPopoverContent,ne as RuiPopoverElement,Ee as RuiPopoverTrigger,re as RuiPopoverTriggerElement};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|