@adapttable/element-plus 0.1.0 → 0.1.1
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/dist/{ElementColumnMenuPanel-D7SdfclW.js → ElementColumnMenuPanel-D9oWJf02.js} +10 -5
- package/dist/ElementColumnMenuPanel-D9oWJf02.js.map +1 -0
- package/dist/{ElementColumnMenuPanel-DRQbZVow.cjs → ElementColumnMenuPanel-DavsUQAR.cjs} +10 -5
- package/dist/ElementColumnMenuPanel-DavsUQAR.cjs.map +1 -0
- package/dist/{ElementFilterSurface-DcPyYCK-.cjs → ElementFilterSurface-B8Fo3hPb.cjs} +7 -1
- package/dist/ElementFilterSurface-B8Fo3hPb.cjs.map +1 -0
- package/dist/{ElementFilterSurface-DdvPfm1N.js → ElementFilterSurface-BR_nBvZU.js} +8 -2
- package/dist/ElementFilterSurface-BR_nBvZU.js.map +1 -0
- package/dist/{column-menu-CfqfyZzs.js → column-menu-C6gwlyUQ.js} +2 -2
- package/dist/{column-menu-CfqfyZzs.js.map → column-menu-C6gwlyUQ.js.map} +1 -1
- package/dist/{column-menu-DfTLlqC-.cjs → column-menu-CtaKQS3b.cjs} +2 -2
- package/dist/{column-menu-DfTLlqC-.cjs.map → column-menu-CtaKQS3b.cjs.map} +1 -1
- package/dist/column-menu.cjs +1 -1
- package/dist/column-menu.js +1 -1
- package/dist/{filters-Dg22pfUy.js → filters-C9_trRXw.js} +2 -2
- package/dist/{filters-Dg22pfUy.js.map → filters-C9_trRXw.js.map} +1 -1
- package/dist/{filters-BA8vjGzr.cjs → filters-DOlxNQqE.cjs} +2 -2
- package/dist/{filters-BA8vjGzr.cjs.map → filters-DOlxNQqE.cjs.map} +1 -1
- package/dist/filters.cjs +2 -2
- package/dist/filters.js +2 -2
- package/dist/{header-filters-B_WFdnIO.js → header-filters-Chknfchw.js} +2 -2
- package/dist/{header-filters-B_WFdnIO.js.map → header-filters-Chknfchw.js.map} +1 -1
- package/dist/{header-filters-DnlmROS8.cjs → header-filters-D71v75Us.cjs} +2 -2
- package/dist/{header-filters-DnlmROS8.cjs.map → header-filters-D71v75Us.cjs.map} +1 -1
- package/dist/header-filters.cjs +1 -1
- package/dist/header-filters.js +1 -1
- package/dist/preset.cjs +4 -4
- package/dist/preset.js +4 -4
- package/dist/{saved-views-DLiRBZ13.cjs → saved-views-BTJxWOyY.cjs} +2 -2
- package/dist/{saved-views-DLiRBZ13.cjs.map → saved-views-BTJxWOyY.cjs.map} +1 -1
- package/dist/{saved-views-BtC15-kG.js → saved-views-DW8WybwV.js} +2 -2
- package/dist/{saved-views-BtC15-kG.js.map → saved-views-DW8WybwV.js.map} +1 -1
- package/dist/saved-views.cjs +1 -1
- package/dist/saved-views.js +1 -1
- package/package.json +2 -2
- package/dist/ElementColumnMenuPanel-D7SdfclW.js.map +0 -1
- package/dist/ElementColumnMenuPanel-DRQbZVow.cjs.map +0 -1
- package/dist/ElementFilterSurface-DcPyYCK-.cjs.map +0 -1
- package/dist/ElementFilterSurface-DdvPfm1N.js.map +0 -1
|
@@ -60,10 +60,15 @@ const ElementColumnMenuPanel = defineComponent((props) => {
|
|
|
60
60
|
event.stopPropagation();
|
|
61
61
|
close("escape");
|
|
62
62
|
};
|
|
63
|
-
watch([
|
|
64
|
-
|
|
65
|
-
anchor
|
|
66
|
-
|
|
63
|
+
watch([
|
|
64
|
+
active,
|
|
65
|
+
() => props.control.anchor,
|
|
66
|
+
() => props.control.open
|
|
67
|
+
], ([enabled, anchor], _previous, cleanup) => {
|
|
68
|
+
if (!enabled || !anchor || !props.control.open) return;
|
|
69
|
+
const document = anchor.ownerDocument;
|
|
70
|
+
document.addEventListener("keydown", keydown);
|
|
71
|
+
cleanup(() => document.removeEventListener("keydown", keydown));
|
|
67
72
|
}, { immediate: true });
|
|
68
73
|
const focus = () => {
|
|
69
74
|
if (!active.value || !props.control.open || !props.control.isCurrent()) return;
|
|
@@ -123,4 +128,4 @@ const ElementColumnMenuPanel = defineComponent((props) => {
|
|
|
123
128
|
//#endregion
|
|
124
129
|
export { columnMenuContainer as n, ElementColumnMenuPanel as t };
|
|
125
130
|
|
|
126
|
-
//# sourceMappingURL=ElementColumnMenuPanel-
|
|
131
|
+
//# sourceMappingURL=ElementColumnMenuPanel-D9oWJf02.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementColumnMenuPanel-D9oWJf02.js","names":[],"sources":["../src/columns/panelContext.ts","../src/columns/ElementColumnMenuPanel.ts"],"sourcesContent":["import type { InjectionKey, ShallowRef } from \"vue\";\n\n/** A managed menu's actual native content host, outside its scrolling body. */\nexport const columnMenuContainer: InjectionKey<\n Readonly<ShallowRef<HTMLElement | null>>\n> = Symbol(\"element-column-menu-container\");\n","import {\n type ManagedOverlayPanelProps,\n useElementRef,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ClickOutside, ElPopover } from \"element-plus\";\nimport {\n defineComponent,\n h,\n mergeProps,\n nextTick,\n onScopeDispose,\n type PropType,\n provide,\n shallowRef,\n watch,\n withDirectives,\n} from \"vue\";\n\nimport { isElementRef } from \"../controls/ref\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport { rtlScrollbarGutter } from \"../scrollbarGutter\";\nimport { columnMenuContainer } from \"./panelContext\";\n\nexport const ElementColumnMenuPanel = defineComponent(\n (props: {\n readonly control: ManagedOverlayPanelProps;\n readonly initialFocus?: string;\n }) => {\n const active = useScopeActivity();\n const inheritedDirection = shallowRef<\"ltr\" | \"rtl\">();\n const readDirection = () => {\n if (props.control.attrs.dir !== undefined) return;\n const anchor = props.control.anchor;\n const view = anchor?.ownerDocument.defaultView;\n if (anchor && view)\n inheritedDirection.value =\n view.getComputedStyle(anchor).direction === \"rtl\" ? \"rtl\" : \"ltr\";\n };\n // A public virtual positioning reference leaves trigger ARIA/events with Chrome.\n const virtualAnchor = {\n getBoundingClientRect: () =>\n props.control.anchor?.getBoundingClientRect() ?? new DOMRect(),\n get contextElement() {\n return props.control.anchor ?? undefined;\n },\n };\n const panel = shallowRef<HTMLElement | null>(null);\n const setPanel = (target: unknown) => {\n if (target == null) {\n panel.value = null;\n return;\n }\n panel.value = target instanceof HTMLElement ? target : null;\n };\n provide(columnMenuContainer, panel);\n useElementRef(\n () => panel.value,\n () =>\n isElementRef(props.control.attrs.ref)\n ? props.control.attrs.ref\n : undefined\n );\n let live = true;\n onScopeDispose(() => {\n live = false;\n });\n const close = (reason: \"escape\" | \"outside\") => {\n const control = props.control;\n if (!active.value || !control.open || !control.isCurrent()) return;\n control.onClose(reason);\n if (reason === \"escape\")\n void nextTick(() => {\n if (\n (!live || !props.control.open) &&\n control.isCurrent() &&\n control.anchor?.isConnected\n )\n control.anchor.focus();\n });\n };\n const outside = (event: MouseEvent) => {\n if (\n event.target instanceof Node &&\n props.control.anchor?.contains(event.target)\n )\n return;\n close(\"outside\");\n };\n const keydown = (event: KeyboardEvent) => {\n if (\n !active.value ||\n !props.control.open ||\n !props.control.isCurrent() ||\n event.key !== \"Escape\"\n )\n return;\n // Element's focus trap releases on any Escape that reaches the document,\n // including one an inner control handled or an IME composition owns, so\n // the panel keeps those Escapes inside itself.\n if (event.defaultPrevented || event.isComposing) {\n event.stopPropagation();\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n close(\"escape\");\n };\n // The virtual reference leaves the trigger outside ElPopover's event tree.\n // It remains the keyboard owner until the native enter handoff finishes.\n watch(\n [active, () => props.control.anchor, () => props.control.open],\n ([enabled, anchor], _previous, cleanup) => {\n if (!enabled || !anchor || !props.control.open) return;\n const document = anchor.ownerDocument;\n document.addEventListener(\"keydown\", keydown);\n cleanup(() => document.removeEventListener(\"keydown\", keydown));\n },\n { immediate: true }\n );\n const focus = () => {\n if (!active.value || !props.control.open || !props.control.isCurrent())\n return;\n const element = panel.value;\n if (!element) return;\n const focused = element.ownerDocument.activeElement;\n if (\n focused !== props.control.anchor &&\n focused !== element.ownerDocument.body &&\n focused !== element &&\n focused !== element.closest(\".el-popper\")\n )\n return;\n const search = panel.value?.querySelector<HTMLInputElement>(\n props.initialFocus ?? 'input[data-adapttable-part=\"column-menu-search\"]'\n );\n (search ?? element).focus({ preventScroll: true });\n };\n return () => {\n const control = props.control;\n if (\n !active.value ||\n !control.open ||\n !control.isCurrent() ||\n !control.anchor\n )\n return null;\n const direction = control.attrs.dir;\n const dir =\n direction === \"rtl\" || direction === \"ltr\"\n ? direction\n : inheritedDirection.value;\n return h(\n ElPopover,\n {\n visible: control.open,\n virtualTriggering: true,\n virtualRef: virtualAnchor,\n trigger: \"click\",\n // The actual content card carries Chrome's dialog id, name and ref.\n role: \"group\",\n placement: dir === \"rtl\" ? \"bottom-end\" : \"bottom-start\",\n appendTo: control.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n width: \"min(28rem, calc(100vw - 1rem))\",\n popperStyle: {\n padding: 0,\n direction: dir,\n translate: `${rtlScrollbarGutter(dir, props.control.anchor?.ownerDocument.defaultView)} 0`,\n },\n onBeforeEnter: readDirection,\n onAfterEnter: focus,\n },\n {\n default: () =>\n withDirectives(\n h(\n ElementCard,\n {\n attrs: mergeProps(control.attrs, {\n ref: setPanel,\n dir,\n tabindex: -1,\n class: \"adapttable-element-plus-column-panel\",\n style: { overflow: \"visible\" },\n onKeydown: keydown,\n }),\n bodyStyle: {\n padding: \"0.75rem\",\n maxHeight: \"min(70vh, 32rem)\",\n overflow: \"auto\",\n },\n },\n { default: () => control.content }\n ),\n [[ClickOutside, outside]]\n ),\n }\n );\n };\n },\n {\n name: \"ElementColumnMenuPanel\",\n props: {\n control: { type: Object as PropType<ManagedOverlayPanelProps> },\n initialFocus: { type: String as PropType<string | undefined> },\n },\n }\n);\n"],"mappings":";;;;;;;;AAGA,MAAa,sBAET,OAAO,+BAA+B;;;ACmB1C,MAAa,yBAAyB,iBACnC,UAGK;CACJ,MAAM,SAAS,iBAAiB;CAChC,MAAM,qBAAqB,WAA0B;CACrD,MAAM,sBAAsB;EAC1B,IAAI,MAAM,QAAQ,M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ACP,aAAa;IACX,SAAS;IACT,WAAW;IACX,WAAW,GAAG,mBAAmB,KAAK,MAAM,QAAQ,QAAQ,cAAc,WAAW,EAAE;GACzF;GACA,eAAe;GACf,cAAc;EAChB,GACA,EACE,eACE,eACE,EACE,aACA;GACE,OAAO,WAAW,QAAQ,OAAO;IAC/B,KAAK;IACL;IACA,UAAU;IACV,OAAO;IACP,OAAO,EAAE,UAAU,UAAU;IAC7B,WAAW;GACb,CAAC;GACD,WAAW;IACT,SAAS;IACT,WAAW;IACX,UAAU;GACZ;EACF,GACA,EAAE,eAAe,QAAQ,QAAQ,CACnC,GACA,CAAC,CAAC,cAAc,OAAO,CAAC,CAC1B,EACJ,CACF;CACF;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,SAAS,EAAE,MAAM,OAA6C;EAC9D,cAAc,EAAE,MAAM,OAAuC;CAC/D;AACF,CACF"}
|
|
@@ -60,10 +60,15 @@ const ElementColumnMenuPanel = (0, vue.defineComponent)((props) => {
|
|
|
60
60
|
event.stopPropagation();
|
|
61
61
|
close("escape");
|
|
62
62
|
};
|
|
63
|
-
(0, vue.watch)([
|
|
64
|
-
|
|
65
|
-
anchor
|
|
66
|
-
|
|
63
|
+
(0, vue.watch)([
|
|
64
|
+
active,
|
|
65
|
+
() => props.control.anchor,
|
|
66
|
+
() => props.control.open
|
|
67
|
+
], ([enabled, anchor], _previous, cleanup) => {
|
|
68
|
+
if (!enabled || !anchor || !props.control.open) return;
|
|
69
|
+
const document = anchor.ownerDocument;
|
|
70
|
+
document.addEventListener("keydown", keydown);
|
|
71
|
+
cleanup(() => document.removeEventListener("keydown", keydown));
|
|
67
72
|
}, { immediate: true });
|
|
68
73
|
const focus = () => {
|
|
69
74
|
if (!active.value || !props.control.open || !props.control.isCurrent()) return;
|
|
@@ -134,4 +139,4 @@ Object.defineProperty(exports, "columnMenuContainer", {
|
|
|
134
139
|
}
|
|
135
140
|
});
|
|
136
141
|
|
|
137
|
-
//# sourceMappingURL=ElementColumnMenuPanel-
|
|
142
|
+
//# sourceMappingURL=ElementColumnMenuPanel-DavsUQAR.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementColumnMenuPanel-DavsUQAR.cjs","names":["defineComponent","useScopeActivity","shallowRef","isElementRef","nextTick","h","ElPopover","rtlScrollbarGutter","withDirectives","ElementCard","mergeProps","ClickOutside"],"sources":["../src/columns/panelContext.ts","../src/columns/ElementColumnMenuPanel.ts"],"sourcesContent":["import type { InjectionKey, ShallowRef } from \"vue\";\n\n/** A managed menu's actual native content host, outside its scrolling body. */\nexport const columnMenuContainer: InjectionKey<\n Readonly<ShallowRef<HTMLElement | null>>\n> = Symbol(\"element-column-menu-container\");\n","import {\n type ManagedOverlayPanelProps,\n useElementRef,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ClickOutside, ElPopover } from \"element-plus\";\nimport {\n defineComponent,\n h,\n mergeProps,\n nextTick,\n onScopeDispose,\n type PropType,\n provide,\n shallowRef,\n watch,\n withDirectives,\n} from \"vue\";\n\nimport { isElementRef } from \"../controls/ref\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport { rtlScrollbarGutter } from \"../scrollbarGutter\";\nimport { columnMenuContainer } from \"./panelContext\";\n\nexport const ElementColumnMenuPanel = defineComponent(\n (props: {\n readonly control: ManagedOverlayPanelProps;\n readonly initialFocus?: string;\n }) => {\n const active = useScopeActivity();\n const inheritedDirection = shallowRef<\"ltr\" | \"rtl\">();\n const readDirection = () => {\n if (props.control.attrs.dir !== undefined) return;\n const anchor = props.control.anchor;\n const view = anchor?.ownerDocument.defaultView;\n if (anchor && view)\n inheritedDirection.value =\n view.getComputedStyle(anchor).direction === \"rtl\" ? \"rtl\" : \"ltr\";\n };\n // A public virtual positioning reference leaves trigger ARIA/events with Chrome.\n const virtualAnchor = {\n getBoundingClientRect: () =>\n props.control.anchor?.getBoundingClientRect() ?? new DOMRect(),\n get contextElement() {\n return props.control.anchor ?? undefined;\n },\n };\n const panel = shallowRef<HTMLElement | null>(null);\n const setPanel = (target: unknown) => {\n if (target == null) {\n panel.value = null;\n return;\n }\n panel.value = target instanceof HTMLElement ? target : null;\n };\n provide(columnMenuContainer, panel);\n useElementRef(\n () => panel.value,\n () =>\n isElementRef(props.control.attrs.ref)\n ? props.control.attrs.ref\n : undefined\n );\n let live = true;\n onScopeDispose(() => {\n live = false;\n });\n const close = (reason: \"escape\" | \"outside\") => {\n const control = props.control;\n if (!active.value || !control.open || !control.isCurrent()) return;\n control.onClose(reason);\n if (reason === \"escape\")\n void nextTick(() => {\n if (\n (!live || !props.control.open) &&\n control.isCurrent() &&\n control.anchor?.isConnected\n )\n control.anchor.focus();\n });\n };\n const outside = (event: MouseEvent) => {\n if (\n event.target instanceof Node &&\n props.control.anchor?.contains(event.target)\n )\n return;\n close(\"outside\");\n };\n const keydown = (event: KeyboardEvent) => {\n if (\n !active.value ||\n !props.control.open ||\n !props.control.isCurrent() ||\n event.key !== \"Escape\"\n )\n return;\n // Element's focus trap releases on any Escape that reaches the document,\n // including one an inner control handled or an IME composition owns, so\n // the panel keeps those Escapes inside itself.\n if (event.defaultPrevented || event.isComposing) {\n event.stopPropagation();\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n close(\"escape\");\n };\n // The virtual reference leaves the trigger outside ElPopover's event tree.\n // It remains the keyboard owner until the native enter handoff finishes.\n watch(\n [active, () => props.control.anchor, () => props.control.open],\n ([enabled, anchor], _previous, cleanup) => {\n if (!enabled || !anchor || !props.control.open) return;\n const document = anchor.ownerDocument;\n document.addEventListener(\"keydown\", keydown);\n cleanup(() => document.removeEventListener(\"keydown\", keydown));\n },\n { immediate: true }\n );\n const focus = () => {\n if (!active.value || !props.control.open || !props.control.isCurrent())\n return;\n const element = panel.value;\n if (!element) return;\n const focused = element.ownerDocument.activeElement;\n if (\n focused !== props.control.anchor &&\n focused !== element.ownerDocument.body &&\n focused !== element &&\n focused !== element.closest(\".el-popper\")\n )\n return;\n const search = panel.value?.querySelector<HTMLInputElement>(\n props.initialFocus ?? 'input[data-adapttable-part=\"column-menu-search\"]'\n );\n (search ?? element).focus({ preventScroll: true });\n };\n return () => {\n const control = props.control;\n if (\n !active.value ||\n !control.open ||\n !control.isCurrent() ||\n !control.anchor\n )\n return null;\n const direction = control.attrs.dir;\n const dir =\n direction === \"rtl\" || direction === \"ltr\"\n ? direction\n : inheritedDirection.value;\n return h(\n ElPopover,\n {\n visible: control.open,\n virtualTriggering: true,\n virtualRef: virtualAnchor,\n trigger: \"click\",\n // The actual content card carries Chrome's dialog id, name and ref.\n role: \"group\",\n placement: dir === \"rtl\" ? \"bottom-end\" : \"bottom-start\",\n appendTo: control.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n width: \"min(28rem, calc(100vw - 1rem))\",\n popperStyle: {\n padding: 0,\n direction: dir,\n translate: `${rtlScrollbarGutter(dir, props.control.anchor?.ownerDocument.defaultView)} 0`,\n },\n onBeforeEnter: readDirection,\n onAfterEnter: focus,\n },\n {\n default: () =>\n withDirectives(\n h(\n ElementCard,\n {\n attrs: mergeProps(control.attrs, {\n ref: setPanel,\n dir,\n tabindex: -1,\n class: \"adapttable-element-plus-column-panel\",\n style: { overflow: \"visible\" },\n onKeydown: keydown,\n }),\n bodyStyle: {\n padding: \"0.75rem\",\n maxHeight: \"min(70vh, 32rem)\",\n overflow: \"auto\",\n },\n },\n { default: () => control.content }\n ),\n [[ClickOutside, outside]]\n ),\n }\n );\n };\n },\n {\n name: \"ElementColumnMenuPanel\",\n props: {\n control: { type: Object as PropType<ManagedOverlayPanelProps> },\n initialFocus: { type: String as PropType<string | undefined> },\n },\n }\n);\n"],"mappings":";;;;;;;;AAGA,MAAa,sBAET,OAAO,+BAA+B;;;ACmB1C,MAAa,0BAAA,GAAyBA,IAAAA,gBAAAA,EACnC,UAGK;CACJ,MAAM,UAAA,GAASC,wBAAAA,iBAAAA,CAAiB;CAChC,MAAM,sBAAA,GAAqBC,IAAAA,WAAAA,CAA0B;CACr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ACzB,QAAA,GAAOC,IAAAA,EAAAA,CACLC,aAAAA,WACA;GACE,SAAS,QAAQ;GACjB,mBAAmB;GACnB,YAAY;GACZ,SAAS;GAET,MAAM;GACN,WAAW,QAAQ,QAAQ,eAAe;GAC1C,UAAU,QAAQ,aAAa;GAC/B,YAAY;GACZ,YAAY;GACZ,WAAW;GACX,OAAO;GACP,aAAa;IACX,SAAS;IACT,WAAW;IACX,WAAW,GAAGC,wBAAAA,mBAAmB,KAAK,MAAM,QAAQ,QAAQ,cAAc,WAAW,EAAE;GACzF;GACA,eAAe;GACf,cAAc;EAChB,GACA,EACE,gBAAA,GACEC,IAAAA,eAAAA,EAAAA,GACEH,IAAAA,EAAAA,CACEI,oBAAAA,aACA;GACE,QAAA,GAAOC,IAAAA,WAAAA,CAAW,QAAQ,OAAO;IAC/B,KAAK;IACL;IACA,UAAU;IACV,OAAO;IACP,OAAO,EAAE,UAAU,UAAU;IAC7B,WAAW;GACb,CAAC;GACD,WAAW;IACT,SAAS;IACT,WAAW;IACX,UAAU;GACZ;EACF,GACA,EAAE,eAAe,QAAQ,QAAQ,CACnC,GACA,CAAC,CAACC,aAAAA,cAAc,OAAO,CAAC,CAC1B,EACJ,CACF;CACF;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,SAAS,EAAE,MAAM,OAA6C;EAC9D,cAAc,EAAE,MAAM,OAAuC;CAC/D;AACF,CACF"}
|
|
@@ -185,6 +185,12 @@ const ElementFilterSurface = (0, vue.defineComponent)((props) => {
|
|
|
185
185
|
event.stopPropagation();
|
|
186
186
|
close("escape");
|
|
187
187
|
};
|
|
188
|
+
(0, vue.watch)(() => active.value && props.open, (open, _previous, cleanup) => {
|
|
189
|
+
const document = props.anchor?.ownerDocument;
|
|
190
|
+
if (!open || !document) return;
|
|
191
|
+
document.addEventListener("keydown", keydown);
|
|
192
|
+
cleanup(() => document.removeEventListener("keydown", keydown));
|
|
193
|
+
}, { immediate: true });
|
|
188
194
|
const captureKeydown = (event) => {
|
|
189
195
|
const target = event.target;
|
|
190
196
|
if (target instanceof Element && target.getAttribute("role") === "combobox" && target.getAttribute("aria-expanded") === "false") keydown(event);
|
|
@@ -299,4 +305,4 @@ Object.defineProperty(exports, "_sfc_main", {
|
|
|
299
305
|
}
|
|
300
306
|
});
|
|
301
307
|
|
|
302
|
-
//# sourceMappingURL=ElementFilterSurface-
|
|
308
|
+
//# sourceMappingURL=ElementFilterSurface-B8Fo3hPb.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementFilterSurface-B8Fo3hPb.cjs","names":["h","ElementInput","ElementSelect","ElementCheckbox","h","ElementInput","elementButton","ElementCheckbox","ElText","defineComponent","useChecklistModel","ChecklistChrome","createVNode","defineComponent","shallowRef","useScopeActivity","useFeatureState","FULLSCREEN_MODEL","nextTick","h","ElDrawer","ElPopover","rtlScrollbarGutter","withDirectives","ElCard","ClickOutside"],"sources":["../src/filters/fieldControls.ts","../src/filters/ElementBasicFilterField.vue","../src/filters/ElementChecklistFilter.ts","../src/filters/ElementFilterField.vue","../src/filters/ElementFilterSurface.ts"],"sourcesContent":["import type {\n DataTableClassNames,\n FilterFieldSlots,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\nexport function elementFilterControls(\n names: () => DataTableClassNames\n): FilterFieldSlots {\n return {\n Input: (control) =>\n h(ElementInput, {\n ...control.attrs,\n value: control.value,\n type: control.type,\n class: names().filterInput,\n onChange: control.onChange,\n }),\n Select: (control) =>\n h(ElementSelect, {\n ...control.attrs,\n value: control.value,\n options: control.options,\n class:\n control.attrs[\"data-adapttable-part\"] === \"filter-operator\"\n ? names().filterOperator\n : names().filterSelect,\n onChange: control.onChange,\n }),\n Checkbox: (control) =>\n h(ElementCheckbox, {\n ...control.attrs,\n checked: control.checked,\n label: control.label,\n labelVisible: true,\n class: names().filterCheckbox,\n onChange: control.onChange,\n }),\n };\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n FilterFieldChrome,\n type FilterFieldOptions,\n useFilterField,\n} from \"@adapttable/vue/adapter\";\n\nimport { elementFilterControls } from \"./fieldControls\";\n\ndefineOptions({ name: \"ElementBasicFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\nconst model = useFilterField(() => props);\nconst controls = elementFilterControls(() => props.classNames ?? {});\nconst Render = () =>\n FilterFieldChrome({\n model: model.value,\n controls,\n classNames: props.classNames,\n });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n","import {\n ChecklistChrome,\n type ChecklistFilterProps,\n type ChecklistSlots,\n useChecklistModel,\n} from \"@adapttable/vue/adapter\";\nimport { ElText } from \"element-plus\";\nimport {\n createVNode,\n defineComponent,\n h,\n type PropType,\n type SetupContext,\n type VNodeChild,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\n\nconst controls: ChecklistSlots<VNodeChild> = {\n Search: (control) =>\n h(ElementInput, {\n type: \"search\",\n value: control.value,\n \"aria-label\": control.label,\n \"data-adapttable-part\": \"filter-checklist-search\",\n class: control.className,\n onChange: control.onChange,\n }),\n Button: (control) =>\n elementButton({ onClick: control.onClick }, control.label),\n Checkbox: (control) =>\n h(\"div\", { class: \"adapttable-element-plus-checklist-option\" }, [\n h(ElementCheckbox, {\n \"data-adapttable-part\": \"filter-checkbox\",\n class: control.className,\n label: control.label,\n labelVisible: true,\n checked: control.checked,\n onChange: control.onChange,\n }),\n h(\n ElText,\n {\n class: control.countClassName,\n \"data-adapttable-part\": \"filter-checklist-count\",\n type: \"info\",\n size: \"small\",\n },\n { default: () => control.count }\n ),\n ]),\n};\n\n// The presentation validates values; its key list preserves generic public\n// components and Vue fallthrough attribute inference.\nconst checklistRuntimeProps = {\n def: { type: Object as PropType<ChecklistFilterProps<unknown>[\"def\"]> },\n source: { type: Object as PropType<ChecklistFilterProps<unknown>[\"source\"]> },\n labels: { type: Object as PropType<ChecklistFilterProps<unknown>[\"labels\"]> },\n classNames: {\n type: Object as PropType<ChecklistFilterProps<unknown>[\"classNames\"]>,\n },\n};\n\nconst ElementChecklistFilterPresentation = defineComponent(\n (props: ChecklistFilterProps<unknown>) => {\n const model = useChecklistModel(() => props);\n return () => ChecklistChrome({ model: model.value, controls });\n },\n {\n name: \"ElementChecklistFilterPresentation\",\n props: checklistRuntimeProps,\n }\n);\n\n/** Preserve the canonical row contract without exposing versioned instance helpers. */\nexport function ElementChecklistFilter<TRow>(\n props: ChecklistFilterProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n) {\n return createVNode(ElementChecklistFilterPresentation, {\n ...context.attrs,\n ...props,\n });\n}\nElementChecklistFilter.props = Object.keys(checklistRuntimeProps);\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n defaultFilterRegistry,\n type FilterFieldOptions,\n filterLabel,\n filterWidgetKind,\n} from \"@adapttable/vue/adapter\";\nimport { ElFormItem } from \"element-plus\";\n\nimport ElementBasicFilterField from \"./ElementBasicFilterField.vue\";\nimport { ElementChecklistFilter } from \"./ElementChecklistFilter\";\n\ndefineOptions({ name: \"ElementFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\n</script>\n\n<template>\n <ElFormItem\n v-if=\"\n filterWidgetKind(props.def, props.registry ?? defaultFilterRegistry) ===\n 'checklist'\n \"\n :label=\"filterLabel(props.def)\"\n :class=\"props.classNames?.filterField\"\n data-adapttable-part=\"filter-field\"\n >\n <ElementChecklistFilter\n :def=\"props.def\"\n :source=\"props.source\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n />\n </ElFormItem>\n <ElementBasicFilterField v-else v-bind=\"props\" />\n</template>\n","import {\n type FilterPanelSurfaceProps,\n FULLSCREEN_MODEL,\n useFeatureState,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type CardInstance,\n ClickOutside,\n ElCard,\n ElDrawer,\n ElPopover,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n nextTick,\n onMounted,\n type PropType,\n shallowRef,\n watch,\n withDirectives,\n} from \"vue\";\n\nimport { rtlScrollbarGutter } from \"../scrollbarGutter\";\n\n/** Kit overlays retain their own positioning, focus trap and modal backdrop. */\nexport const ElementFilterSurface = defineComponent(\n (\n props: FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n }\n ) => {\n const mounted = shallowRef(false);\n const active = useScopeActivity();\n const fullscreen = useFeatureState(FULLSCREEN_MODEL);\n const panel = shallowRef<CardInstance>();\n onMounted(() => {\n mounted.value = true;\n });\n const close: FilterPanelSurfaceProps[\"onClose\"] = (reason) => {\n if (!active.value || !props.open) return;\n props.onClose(reason);\n if (reason === \"escape\") {\n const anchor = props.anchor;\n void nextTick(() => {\n if (\n active.value &&\n !props.open &&\n props.anchor === anchor &&\n anchor?.isConnected\n )\n anchor.focus();\n });\n }\n };\n const outside = (event: MouseEvent) => {\n const target = event.target;\n if (target instanceof Node && props.anchor?.contains(target)) return;\n close(\"outside\");\n };\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return;\n // Element's focus trap releases on any Escape that reaches the document,\n // including one an inner control handled or an IME composition owns, so\n // the panel keeps those Escapes inside itself.\n if (event.defaultPrevented || event.isComposing) {\n event.stopPropagation();\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n close(\"escape\");\n };\n // Escape also dismisses while focus is still on the external trigger,\n // before the native enter transition has moved it into the card.\n watch(\n () => active.value && props.open,\n (open, _previous, cleanup) => {\n const document = props.anchor?.ownerDocument;\n if (!open || !document) return;\n document.addEventListener(\"keydown\", keydown);\n cleanup(() => document.removeEventListener(\"keydown\", keydown));\n },\n { immediate: true }\n );\n // A closed native combobox must not swallow the containing overlay's Escape.\n // Open comboboxes keep the event so their own menu closes first.\n const captureKeydown = (event: KeyboardEvent) => {\n const target = event.target;\n if (\n target instanceof Element &&\n target.getAttribute(\"role\") === \"combobox\" &&\n target.getAttribute(\"aria-expanded\") === \"false\"\n )\n keydown(event);\n };\n const focusPanel = () => {\n const element: unknown = panel.value?.$el;\n if (!active.value || !props.open || !(element instanceof HTMLElement))\n return;\n const focused = element.ownerDocument.activeElement;\n if (focused === props.anchor || focused === element.ownerDocument.body)\n element.focus();\n };\n return () => {\n if (!mounted.value || !active.value) return null;\n if (props.modal)\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n title: props.label,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n appendToBody: true,\n modal: true,\n modalClass: props.backdropClassName,\n withHeader: false,\n showClose: false,\n destroyOnClose: true,\n // Relative to the drawer's overlay, which excludes a classic\n // scrollbar or a reserved gutter; 100vw does not.\n size: \"min(30rem, 100%)\",\n dir: props.dir,\n class: props.className,\n \"data-adapttable-part\": \"filters-panel\",\n beforeClose: () => close(\"outside\"),\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n );\n if (!props.anchor) return null;\n return h(\n ElPopover,\n {\n visible: props.open,\n virtualTriggering: true,\n virtualRef: props.anchor,\n trigger: \"click\",\n role: \"dialog\",\n \"aria-label\": props.label,\n placement: props.dir === \"rtl\" ? \"bottom-end\" : \"bottom-start\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n width: \"min(28rem, calc(100vw - 1rem))\",\n popperClass: \"adapttable-element-plus-filter-popover\",\n popperStyle: {\n padding: 0,\n translate: `${rtlScrollbarGutter(props.dir, props.anchor?.ownerDocument.defaultView)} 0`,\n },\n onAfterEnter: focusPanel,\n },\n {\n default: () =>\n withDirectives(\n h(\n ElCard,\n {\n ref: panel,\n shadow: \"never\",\n dir: props.dir,\n tabindex: -1,\n \"aria-label\": props.label,\n \"data-adapttable-part\": props.part ?? \"filters-popover\",\n class: props.className,\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n ),\n [[ClickOutside, outside]]\n ),\n }\n );\n };\n },\n {\n name: \"ElementFilterSurface\",\n props: {\n className: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"className\"]\n >,\n },\n open: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"open\"]\n >,\n default: undefined,\n },\n label: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"label\"]\n >,\n },\n dir: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"dir\"]\n >,\n },\n anchor: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"anchor\"]\n >,\n },\n container: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"container\"]\n >,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"children\"]\n >,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"onClose\"]\n >,\n },\n modal: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"modal\"]\n >,\n default: undefined,\n },\n part: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"part\"]\n >,\n },\n backdropClassName: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"backdropClassName\"]\n >,\n },\n },\n }\n);\n"],"mappings":";;;;;;;;;AAUA,SAAgB,sBACd,OACkB;CAClB,OAAO;EACL,QAAQ,aAAA,GACNA,IAAAA,EAAAA,CAAEC,qBAAAA,WAAc;GACd,GAAG,QAAQ;GACX,OAAO,QAAQ;GACf,MAAM,QAAQ;GACd,OAAO,MAAM,CAAC,CAAC;GACf,UAAU,QAAQ;EACpB,CAAC;EACH,SAAS,aAAA,GACPD,IAAAA,EAAAA,CAAEE,sBAAAA,WAAe;GACf,GAAG,QAAQ;GACX,OAAO,QAAQ;GACf,SAAS,QAAQ;GACjB,OACE,QAAQ,MAAM,4BAA4B,oBACtC,MAAM,CAAC,CAAC,iBACR,MAAM,CAAC,CAAC;GACd,UAAU,QAAQ;EACpB,CAAC;EACH,WAAW,aAAA,GACTF,IAAAA,EAAAA,CAAEG,wBAAAA,WAAiB;G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;IACX,SAAS;IACT,WAAW,GAAGC,wBAAAA,mBAAmB,MAAM,KAAK,MAAM,QAAQ,cAAc,WAAW,EAAE;GACvF;GACA,cAAc;EAChB,GACA,EACE,gBAAA,GACEC,IAAAA,eAAAA,EAAAA,GACEJ,IAAAA,EAAAA,CACEK,aAAAA,QACA;GACE,KAAK;GACL,QAAQ;GACR,KAAK,MAAM;GACX,UAAU;GACV,cAAc,MAAM;GACpB,wBAAwB,MAAM,QAAQ;GACtC,OAAO,MAAM;GACb,WAAW;GACX,kBAAkB;EACpB,GACA,EAAE,eAAe,MAAM,SAAS,CAClC,GACA,CAAC,CAACC,aAAAA,cAAc,OAAO,CAAC,CAC1B,EACJ,CACF;CACF;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,WAAW,EACT,MAAM,OAQR;EACA,MAAM;GACJ,MAAM;GAQN,SAAS,KAAA;EACX;EACA,OAAO,EACL,MAAM,OAQR;EACA,KAAK,EACH,MAAM,OAQR;EACA,QAAQ,EACN,MAAM,OAQR;EACA,WAAW,EACT,MAAM,OAQR;EACA,UAAU;GACR,MAAM;IAAC;IAAQ;IAAQ;IAAS;IAAO;GAAM;GAQ7C,SAAS,KAAA;EACX;EACA,SAAS,EACP,MAAM,SAQR;EACA,OAAO;GACL,MAAM;GAQN,SAAS,KAAA;EACX;EACA,MAAM,EACJ,MAAM,OAQR;EACA,mBAAmB,EACjB,MAAM,OAQR;CACF;AACF,CACF"}
|
|
@@ -3,7 +3,7 @@ import { t as _sfc_main$2 } from "./ElementCheckbox-BQN4_eas.js";
|
|
|
3
3
|
import { t as _sfc_main$3 } from "./ElementInput-BsoAvPfO.js";
|
|
4
4
|
import { t as _sfc_main$4 } from "./ElementSelect-Cl5ZjuQM.js";
|
|
5
5
|
import { t as rtlScrollbarGutter } from "./scrollbarGutter-BNp0-4l1.js";
|
|
6
|
-
import { createBlock, createVNode, defineComponent, h, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, openBlock, shallowRef, unref, withCtx, withDirectives } from "vue";
|
|
6
|
+
import { createBlock, createVNode, defineComponent, h, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, openBlock, shallowRef, unref, watch, withCtx, withDirectives } from "vue";
|
|
7
7
|
import { ChecklistChrome, FULLSCREEN_MODEL, FilterFieldChrome, defaultFilterRegistry, filterLabel, filterWidgetKind, useChecklistModel, useFeatureState, useFilterField, useScopeActivity } from "@adapttable/vue/adapter";
|
|
8
8
|
import { ClickOutside, ElCard, ElDrawer, ElFormItem, ElPopover, ElText } from "element-plus";
|
|
9
9
|
//#region src/filters/fieldControls.ts
|
|
@@ -185,6 +185,12 @@ const ElementFilterSurface = defineComponent((props) => {
|
|
|
185
185
|
event.stopPropagation();
|
|
186
186
|
close("escape");
|
|
187
187
|
};
|
|
188
|
+
watch(() => active.value && props.open, (open, _previous, cleanup) => {
|
|
189
|
+
const document = props.anchor?.ownerDocument;
|
|
190
|
+
if (!open || !document) return;
|
|
191
|
+
document.addEventListener("keydown", keydown);
|
|
192
|
+
cleanup(() => document.removeEventListener("keydown", keydown));
|
|
193
|
+
}, { immediate: true });
|
|
188
194
|
const captureKeydown = (event) => {
|
|
189
195
|
const target = event.target;
|
|
190
196
|
if (target instanceof Element && target.getAttribute("role") === "combobox" && target.getAttribute("aria-expanded") === "false") keydown(event);
|
|
@@ -282,4 +288,4 @@ const ElementFilterSurface = defineComponent((props) => {
|
|
|
282
288
|
//#endregion
|
|
283
289
|
export { _sfc_main as n, ElementChecklistFilter as r, ElementFilterSurface as t };
|
|
284
290
|
|
|
285
|
-
//# sourceMappingURL=ElementFilterSurface-
|
|
291
|
+
//# sourceMappingURL=ElementFilterSurface-BR_nBvZU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementFilterSurface-BR_nBvZU.js","names":["ElementInput","ElementSelect","ElementCheckbox","ElementInput","ElementCheckbox"],"sources":["../src/filters/fieldControls.ts","../src/filters/ElementBasicFilterField.vue","../src/filters/ElementChecklistFilter.ts","../src/filters/ElementFilterField.vue","../src/filters/ElementFilterSurface.ts"],"sourcesContent":["import type {\n DataTableClassNames,\n FilterFieldSlots,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\nexport function elementFilterControls(\n names: () => DataTableClassNames\n): FilterFieldSlots {\n return {\n Input: (control) =>\n h(ElementInput, {\n ...control.attrs,\n value: control.value,\n type: control.type,\n class: names().filterInput,\n onChange: control.onChange,\n }),\n Select: (control) =>\n h(ElementSelect, {\n ...control.attrs,\n value: control.value,\n options: control.options,\n class:\n control.attrs[\"data-adapttable-part\"] === \"filter-operator\"\n ? names().filterOperator\n : names().filterSelect,\n onChange: control.onChange,\n }),\n Checkbox: (control) =>\n h(ElementCheckbox, {\n ...control.attrs,\n checked: control.checked,\n label: control.label,\n labelVisible: true,\n class: names().filterCheckbox,\n onChange: control.onChange,\n }),\n };\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n FilterFieldChrome,\n type FilterFieldOptions,\n useFilterField,\n} from \"@adapttable/vue/adapter\";\n\nimport { elementFilterControls } from \"./fieldControls\";\n\ndefineOptions({ name: \"ElementBasicFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\nconst model = useFilterField(() => props);\nconst controls = elementFilterControls(() => props.classNames ?? {});\nconst Render = () =>\n FilterFieldChrome({\n model: model.value,\n controls,\n classNames: props.classNames,\n });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n","import {\n ChecklistChrome,\n type ChecklistFilterProps,\n type ChecklistSlots,\n useChecklistModel,\n} from \"@adapttable/vue/adapter\";\nimport { ElText } from \"element-plus\";\nimport {\n createVNode,\n defineComponent,\n h,\n type PropType,\n type SetupContext,\n type VNodeChild,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\n\nconst controls: ChecklistSlots<VNodeChild> = {\n Search: (control) =>\n h(ElementInput, {\n type: \"search\",\n value: control.value,\n \"aria-label\": control.label,\n \"data-adapttable-part\": \"filter-checklist-search\",\n class: control.className,\n onChange: control.onChange,\n }),\n Button: (control) =>\n elementButton({ onClick: control.onClick }, control.label),\n Checkbox: (control) =>\n h(\"div\", { class: \"adapttable-element-plus-checklist-option\" }, [\n h(ElementCheckbox, {\n \"data-adapttable-part\": \"filter-checkbox\",\n class: control.className,\n label: control.label,\n labelVisible: true,\n checked: control.checked,\n onChange: control.onChange,\n }),\n h(\n ElText,\n {\n class: control.countClassName,\n \"data-adapttable-part\": \"filter-checklist-count\",\n type: \"info\",\n size: \"small\",\n },\n { default: () => control.count }\n ),\n ]),\n};\n\n// The presentation validates values; its key list preserves generic public\n// components and Vue fallthrough attribute inference.\nconst checklistRuntimeProps = {\n def: { type: Object as PropType<ChecklistFilterProps<unknown>[\"def\"]> },\n source: { type: Object as PropType<ChecklistFilterProps<unknown>[\"source\"]> },\n labels: { type: Object as PropType<ChecklistFilterProps<unknown>[\"labels\"]> },\n classNames: {\n type: Object as PropType<ChecklistFilterProps<unknown>[\"classNames\"]>,\n },\n};\n\nconst ElementChecklistFilterPresentation = defineComponent(\n (props: ChecklistFilterProps<unknown>) => {\n const model = useChecklistModel(() => props);\n return () => ChecklistChrome({ model: model.value, controls });\n },\n {\n name: \"ElementChecklistFilterPresentation\",\n props: checklistRuntimeProps,\n }\n);\n\n/** Preserve the canonical row contract without exposing versioned instance helpers. */\nexport function ElementChecklistFilter<TRow>(\n props: ChecklistFilterProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n) {\n return createVNode(ElementChecklistFilterPresentation, {\n ...context.attrs,\n ...props,\n });\n}\nElementChecklistFilter.props = Object.keys(checklistRuntimeProps);\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n defaultFilterRegistry,\n type FilterFieldOptions,\n filterLabel,\n filterWidgetKind,\n} from \"@adapttable/vue/adapter\";\nimport { ElFormItem } from \"element-plus\";\n\nimport ElementBasicFilterField from \"./ElementBasicFilterField.vue\";\nimport { ElementChecklistFilter } from \"./ElementChecklistFilter\";\n\ndefineOptions({ name: \"ElementFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\n</script>\n\n<template>\n <ElFormItem\n v-if=\"\n filterWidgetKind(props.def, props.registry ?? defaultFilterRegistry) ===\n 'checklist'\n \"\n :label=\"filterLabel(props.def)\"\n :class=\"props.classNames?.filterField\"\n data-adapttable-part=\"filter-field\"\n >\n <ElementChecklistFilter\n :def=\"props.def\"\n :source=\"props.source\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n />\n </ElFormItem>\n <ElementBasicFilterField v-else v-bind=\"props\" />\n</template>\n","import {\n type FilterPanelSurfaceProps,\n FULLSCREEN_MODEL,\n useFeatureState,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type CardInstance,\n ClickOutside,\n ElCard,\n ElDrawer,\n ElPopover,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n nextTick,\n onMounted,\n type PropType,\n shallowRef,\n watch,\n withDirectives,\n} from \"vue\";\n\nimport { rtlScrollbarGutter } from \"../scrollbarGutter\";\n\n/** Kit overlays retain their own positioning, focus trap and modal backdrop. */\nexport const ElementFilterSurface = defineComponent(\n (\n props: FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n }\n ) => {\n const mounted = shallowRef(false);\n const active = useScopeActivity();\n const fullscreen = useFeatureState(FULLSCREEN_MODEL);\n const panel = shallowRef<CardInstance>();\n onMounted(() => {\n mounted.value = true;\n });\n const close: FilterPanelSurfaceProps[\"onClose\"] = (reason) => {\n if (!active.value || !props.open) return;\n props.onClose(reason);\n if (reason === \"escape\") {\n const anchor = props.anchor;\n void nextTick(() => {\n if (\n active.value &&\n !props.open &&\n props.anchor === anchor &&\n anchor?.isConnected\n )\n anchor.focus();\n });\n }\n };\n const outside = (event: MouseEvent) => {\n const target = event.target;\n if (target instanceof Node && props.anchor?.contains(target)) return;\n close(\"outside\");\n };\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return;\n // Element's focus trap releases on any Escape that reaches the document,\n // including one an inner control handled or an IME composition owns, so\n // the panel keeps those Escapes inside itself.\n if (event.defaultPrevented || event.isComposing) {\n event.stopPropagation();\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n close(\"escape\");\n };\n // Escape also dismisses while focus is still on the external trigger,\n // before the native enter transition has moved it into the card.\n watch(\n () => active.value && props.open,\n (open, _previous, cleanup) => {\n const document = props.anchor?.ownerDocument;\n if (!open || !document) return;\n document.addEventListener(\"keydown\", keydown);\n cleanup(() => document.removeEventListener(\"keydown\", keydown));\n },\n { immediate: true }\n );\n // A closed native combobox must not swallow the containing overlay's Escape.\n // Open comboboxes keep the event so their own menu closes first.\n const captureKeydown = (event: KeyboardEvent) => {\n const target = event.target;\n if (\n target instanceof Element &&\n target.getAttribute(\"role\") === \"combobox\" &&\n target.getAttribute(\"aria-expanded\") === \"false\"\n )\n keydown(event);\n };\n const focusPanel = () => {\n const element: unknown = panel.value?.$el;\n if (!active.value || !props.open || !(element instanceof HTMLElement))\n return;\n const focused = element.ownerDocument.activeElement;\n if (focused === props.anchor || focused === element.ownerDocument.body)\n element.focus();\n };\n return () => {\n if (!mounted.value || !active.value) return null;\n if (props.modal)\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n title: props.label,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n appendToBody: true,\n modal: true,\n modalClass: props.backdropClassName,\n withHeader: false,\n showClose: false,\n destroyOnClose: true,\n // Relative to the drawer's overlay, which excludes a classic\n // scrollbar or a reserved gutter; 100vw does not.\n size: \"min(30rem, 100%)\",\n dir: props.dir,\n class: props.className,\n \"data-adapttable-part\": \"filters-panel\",\n beforeClose: () => close(\"outside\"),\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n );\n if (!props.anchor) return null;\n return h(\n ElPopover,\n {\n visible: props.open,\n virtualTriggering: true,\n virtualRef: props.anchor,\n trigger: \"click\",\n role: \"dialog\",\n \"aria-label\": props.label,\n placement: props.dir === \"rtl\" ? \"bottom-end\" : \"bottom-start\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n width: \"min(28rem, calc(100vw - 1rem))\",\n popperClass: \"adapttable-element-plus-filter-popover\",\n popperStyle: {\n padding: 0,\n translate: `${rtlScrollbarGutter(props.dir, props.anchor?.ownerDocument.defaultView)} 0`,\n },\n onAfterEnter: focusPanel,\n },\n {\n default: () =>\n withDirectives(\n h(\n ElCard,\n {\n ref: panel,\n shadow: \"never\",\n dir: props.dir,\n tabindex: -1,\n \"aria-label\": props.label,\n \"data-adapttable-part\": props.part ?? \"filters-popover\",\n class: props.className,\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n ),\n [[ClickOutside, outside]]\n ),\n }\n );\n };\n },\n {\n name: \"ElementFilterSurface\",\n props: {\n className: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"className\"]\n >,\n },\n open: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"open\"]\n >,\n default: undefined,\n },\n label: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"label\"]\n >,\n },\n dir: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"dir\"]\n >,\n },\n anchor: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"anchor\"]\n >,\n },\n container: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"container\"]\n >,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"children\"]\n >,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"onClose\"]\n >,\n },\n modal: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"modal\"]\n >,\n default: undefined,\n },\n part: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"part\"]\n >,\n },\n backdropClassName: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"backdropClassName\"]\n >,\n },\n },\n }\n);\n"],"mappings":";;;;;;;;;AAUA,SAAgB,sBACd,OACkB;CAClB,OAAO;EACL,QAAQ,YACN,EAAEA,aAAc;GACd,GAAG,QAAQ;GACX,OAAO,QAAQ;GACf,MAAM,QAAQ;GACd,OAAO,MAAM,CAAC,CAAC;GACf,UAAU,QAAQ;EACpB,CAAC;EACH,SAAS,YACP,EAAEC,aAAe;GACf,GAAG,QAAQ;GACX,OAAO,QAAQ;GACf,SAAS,QAAQ;GACjB,OACE,QAAQ,MAAM,4BAA4B,oBACtC,MAAM,CAAC,CAAC,iBACR,MAAM,CAAC,CAAC;GACd,UAAU,QAAQ;EACpB,CAAC;EACH,WAAW,YACT,EAAEC,aAAiB;GACjB,GAAG,QAAQ;GACX,SAAS,QAAQ;GACjB,OAAO,QAAQ;GACf,cAAc;GACd,OAAO,MAAM,CAAC,CAAC;GACf,UAAU,QAAQ;EACpB,CAAC;CACL;AACF;;;;;;;;;;;;;;;EChCA,MAAM,QAAQ;EAGd,MAAM,QAAQ,qBAAqB,KAAK;EACxC,MAAM,WAAW,4BAA4B,MAAM,cAAc,CAAC,CAAC;EACnE,MAAM,eACJ,kBAAkB;GAChB,OAAO,MAAM;GACb;GACA,YAAY,MAAM;EACpB,CAAC;EAEH,OAAO,QAAQ,CAAA;;GAGL,OAAA,UAAA,GAAA,YAAU,MAAA;;;;;;ACNpB,MAAM,WAAuC;CAC3C,SAAS,YACP,EAAEC,aAAc;EACd,MAAM;EACN,OAAO,QAAQ;EACf,cAAc,QAAQ;EACtB,wBAAwB;EACxB,OAAO,QAAQ;EACf,UAAU,QAAQ;CACpB,CAAC;CACH,SAAS,YACP,cAAc,EAAE,SAAS,QAAQ,QAAQ,GAAG,QAAQ,KAAK;CAC3D,WAAW,YACT,EAAE,OAAO,EAAE,OAAO,2CAA2C,GAAG,CAC9D,EAAEC,aAAiB;EACjB,wBAAwB;EACxB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A,CAAC,CAAC,cAAc,OAAO,CAAC,CAC1B,EACJ,CACF;CACF;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,WAAW,EACT,MAAM,OAQR;EACA,MAAM;GACJ,MAAM;GAQN,SAAS,KAAA;EACX;EACA,OAAO,EACL,MAAM,OAQR;EACA,KAAK,EACH,MAAM,OAQR;EACA,QAAQ,EACN,MAAM,OAQR;EACA,WAAW,EACT,MAAM,OAQR;EACA,UAAU;GACR,MAAM;IAAC;IAAQ;IAAQ;IAAS;IAAO;GAAM;GAQ7C,SAAS,KAAA;EACX;EACA,SAAS,EACP,MAAM,SAQR;EACA,OAAO;GACL,MAAM;GAQN,SAAS,KAAA;EACX;EACA,MAAM,EACJ,MAAM,OAQR;EACA,mBAAmB,EACjB,MAAM,OAQR;CACF;AACF,CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as isElementRef, t as elementButton } from "./button-DwB4UxI2.js";
|
|
2
2
|
import { t as _sfc_main } from "./ElementInput-BsoAvPfO.js";
|
|
3
3
|
import { t as _sfc_main$1 } from "./ElementSelect-Cl5ZjuQM.js";
|
|
4
|
-
import { n as columnMenuContainer, t as ElementColumnMenuPanel } from "./ElementColumnMenuPanel-
|
|
4
|
+
import { n as columnMenuContainer, t as ElementColumnMenuPanel } from "./ElementColumnMenuPanel-D9oWJf02.js";
|
|
5
5
|
import { createVNode, defineComponent, h, inject } from "vue";
|
|
6
6
|
import { COLUMN_HEADER_RENAME, COLUMN_MENU, ColumnHeaderRenameChrome, ColumnMenuChrome, extendFeature, managedOverlayPanel, slotRender, useColumnMenu } from "@adapttable/vue/adapter";
|
|
7
7
|
import { columnMenu } from "@adapttable/vue/features";
|
|
@@ -112,4 +112,4 @@ function columnMenu$1() {
|
|
|
112
112
|
//#endregion
|
|
113
113
|
export { ColumnMenu as n, columnMenu$1 as t };
|
|
114
114
|
|
|
115
|
-
//# sourceMappingURL=column-menu-
|
|
115
|
+
//# sourceMappingURL=column-menu-C6gwlyUQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-menu-
|
|
1
|
+
{"version":3,"file":"column-menu-C6gwlyUQ.js","names":["ElementSelect","ElementInput","columnMenu","bindingColumnMenu"],"sources":["../src/columns/ElementColumnChoice.ts","../src/columns/elementColumnMenuControls.ts","../src/columns/ColumnMenu.ts","../src/column-menu.ts"],"sourcesContent":["import type { ColumnMenuSlots } from \"@adapttable/vue/adapter\";\nimport { defineComponent, h, inject, type PropType } from \"vue\";\n\nimport ElementSelect from \"../controls/ElementSelect.vue\";\nimport { columnMenuContainer } from \"./panelContext\";\n\ntype ChoiceControl = Parameters<ColumnMenuSlots[\"Choice\"]>[0];\nfunction isKeyboardHandler(\n value: unknown\n): value is (event: KeyboardEvent) => void {\n return typeof value === \"function\";\n}\nexport const ElementColumnChoice = defineComponent(\n (props: { readonly control: ChoiceControl }) => {\n const container = inject(columnMenuContainer, undefined);\n const escape = (event: KeyboardEvent) => {\n const target = event.target;\n if (\n event.key === \"Escape\" &&\n !event.defaultPrevented &&\n !event.isComposing &&\n target instanceof Element &&\n target.getAttribute(\"role\") === \"combobox\" &&\n target.getAttribute(\"aria-expanded\") === \"false\"\n ) {\n const handler = props.control.attrs.onKeydown;\n if (isKeyboardHandler(handler)) handler(event);\n }\n };\n return () =>\n h(ElementSelect, {\n ...props.control.attrs,\n value: props.control.value,\n options: props.control.options,\n teleported: container?.value != null,\n appendTo: container?.value ?? undefined,\n onChange: props.control.onChange,\n onKeydownCapture: escape,\n });\n },\n {\n name: \"ElementColumnChoice\",\n props: {\n control: { type: Object as PropType<ChoiceControl> },\n },\n }\n);\n","import {\n type ColumnMenuButtonProps,\n type ColumnMenuSlots,\n managedOverlayPanel,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport { isElementRef } from \"../controls/ref\";\nimport { ElementColumnChoice } from \"./ElementColumnChoice\";\nimport { ElementColumnMenuPanel } from \"./ElementColumnMenuPanel\";\n\nfunction button(control: ColumnMenuButtonProps) {\n const icons = {\n grip: \"⠿\",\n visible: \"◉\",\n hidden: \"○\",\n pin: \"⌖\",\n more: \"⋯\",\n rename: \"✎\",\n };\n return elementButton(\n { \"aria-label\": control.label, ...control.attrs },\n control.icon\n ? h(\"span\", { \"aria-hidden\": \"true\" }, icons[control.icon])\n : control.label\n );\n}\nexport const elementColumnMenuSlots: ColumnMenuSlots = {\n Trigger: button,\n Button: button,\n Input: ({ attrs, value, onChange }) => {\n const nativeAttrs = Object.fromEntries(\n Object.entries(attrs).filter(([key]) => key !== \"ref\" && key !== \"type\")\n );\n return h(ElementInput, {\n ...nativeAttrs,\n value,\n type: attrs.type === \"search\" ? \"search\" : \"text\",\n inputRef: isElementRef(attrs.ref) ? attrs.ref : undefined,\n onChange,\n });\n },\n Choice: (control) => h(ElementColumnChoice, { control }),\n Panel: managedOverlayPanel((control) =>\n h(ElementColumnMenuPanel, { control })\n ),\n};\n","import {\n ColumnMenuChrome,\n type ColumnMenuSlotProps,\n useColumnMenu,\n} from \"@adapttable/vue/adapter\";\nimport { createVNode, defineComponent, h, type SetupContext } from \"vue\";\n\nimport { elementColumnMenuSlots } from \"./elementColumnMenuControls\";\n\nconst menuProps = {\n allColumns: null,\n layout: null,\n labels: null,\n hasRowActions: Boolean,\n hasRowReorder: Boolean,\n onAutoSize: null,\n onAutoSizeColumn: null,\n onSortColumn: null,\n onFilterColumn: null,\n onRenameColumn: null,\n sortBy: null,\n sortDir: null,\n dir: null,\n groupingPanel: null,\n featureHost: null,\n classNames: null,\n container: null,\n} satisfies Record<keyof ColumnMenuSlotProps<unknown>, unknown>;\nconst ElementColumnMenuPresentation = defineComponent(\n (props: ColumnMenuSlotProps<unknown>) => {\n const model = useColumnMenu(() => props);\n return () => h(ColumnMenuChrome, { model, slots: elementColumnMenuSlots });\n },\n { name: \"ElementColumnMenuPresentation\", props: menuProps }\n);\nexport function ColumnMenu<TRow>(\n props: ColumnMenuSlotProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n) {\n return createVNode(ElementColumnMenuPresentation, {\n ...context.attrs,\n ...props,\n });\n}\nColumnMenu.props = menuProps;\n","import type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n COLUMN_HEADER_RENAME,\n COLUMN_MENU,\n ColumnHeaderRenameChrome,\n extendFeature,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { columnMenu as bindingColumnMenu } from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { ColumnMenu } from \"./columns/ColumnMenu\";\nimport { elementColumnMenuSlots } from \"./columns/elementColumnMenuControls\";\n\nexport function columnMenu(): StaticTableFeature {\n return extendFeature(bindingColumnMenu(), [\n slotRender(COLUMN_MENU, (props) => h(ColumnMenu<never>, { ...props })),\n slotRender(COLUMN_HEADER_RENAME, (props) =>\n h(ColumnHeaderRenameChrome, { ...props, slots: elementColumnMenuSlots })\n ),\n ]);\n}\nexport { ColumnMenu } from \"./columns/ColumnMenu\";\nexport type { ColumnMenuSlotProps } from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;AAOA,SAAS,kBACP,OACyC;CACzC,OAAO,OAAO,UAAU;AAC1B;AACA,MAAa,sBAAsB,iBAChC,UAA+C;CAC9C,MAAM,YAAY,OAAO,qBAAqB,KAAA,CAAS;CACvD,MAAM,UAAU,UAAyB;EACvC,MAAM,SAAS,MAAM;EACrB,IACE,MAAM,QAAQ,YACd,CAAC,MAAM,oBACP,CAAC,MAAM,eACP,kBAAkB,WAClB,OAAO,aAAa,MAAM,MAAM,cAChC,OAAO,aAAa,eAAe,MAAM,SACzC;GACA,MAAM,UAAU,MAAM,QAAQ,MAAM;GACpC,IAAI,kBAAkB,OAAO,GAAG,QAAQ,KAAK;EAC/C;CACF;CACA,aACE,EAAEA,aAAe;EACf,GAAG,MAAM,QAAQ;EACjB,OAAO,MAAM,QAAQ;EACrB,SAAS,MAAM,QAAQ;EACvB,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AAa,EAAE,kBAAkB;EAAE;EAAO,OAAO;CAAuB,CAAC;AAC3E,GACA;CAAE,MAAM;CAAiC,OAAO;AAAU,CAC5D;AACA,SAAgB,WACd,OACA,SACA;CACA,OAAO,YAAY,+BAA+B;EAChD,GAAG,QAAQ;EACX,GAAG;CACL,CAAC;AACH;AACA,WAAW,QAAQ;;;AC9BnB,SAAgBC,eAAiC;CAC/C,OAAO,cAAcC,WAAkB,GAAG,CACxC,WAAW,cAAc,UAAU,EAAE,YAAmB,EAAE,GAAG,MAAM,CAAC,CAAC,GACrE,WAAW,uBAAuB,UAChC,EAAE,0BAA0B;EAAE,GAAG;EAAO,OAAO;CAAuB,CAAC,CACzE,CACF,CAAC;AACH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_button = require("./button-BFjBL9m3.cjs");
|
|
2
2
|
const require_ElementInput = require("./ElementInput-vBVDBaLp.cjs");
|
|
3
3
|
const require_ElementSelect = require("./ElementSelect-K1rRvu5q.cjs");
|
|
4
|
-
const require_ElementColumnMenuPanel = require("./ElementColumnMenuPanel-
|
|
4
|
+
const require_ElementColumnMenuPanel = require("./ElementColumnMenuPanel-DavsUQAR.cjs");
|
|
5
5
|
let vue = require("vue");
|
|
6
6
|
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
7
7
|
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
@@ -123,4 +123,4 @@ Object.defineProperty(exports, "columnMenu", {
|
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
125
|
|
|
126
|
-
//# sourceMappingURL=column-menu-
|
|
126
|
+
//# sourceMappingURL=column-menu-CtaKQS3b.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-menu-
|
|
1
|
+
{"version":3,"file":"column-menu-CtaKQS3b.cjs","names":["defineComponent","inject","columnMenuContainer","h","ElementSelect","elementButton","h","ElementInput","isElementRef","managedOverlayPanel","ElementColumnMenuPanel","defineComponent","useColumnMenu","h","ColumnMenuChrome","createVNode","extendFeature","bindingColumnMenu","slotRender","COLUMN_MENU","h","COLUMN_HEADER_RENAME","ColumnHeaderRenameChrome"],"sources":["../src/columns/ElementColumnChoice.ts","../src/columns/elementColumnMenuControls.ts","../src/columns/ColumnMenu.ts","../src/column-menu.ts"],"sourcesContent":["import type { ColumnMenuSlots } from \"@adapttable/vue/adapter\";\nimport { defineComponent, h, inject, type PropType } from \"vue\";\n\nimport ElementSelect from \"../controls/ElementSelect.vue\";\nimport { columnMenuContainer } from \"./panelContext\";\n\ntype ChoiceControl = Parameters<ColumnMenuSlots[\"Choice\"]>[0];\nfunction isKeyboardHandler(\n value: unknown\n): value is (event: KeyboardEvent) => void {\n return typeof value === \"function\";\n}\nexport const ElementColumnChoice = defineComponent(\n (props: { readonly control: ChoiceControl }) => {\n const container = inject(columnMenuContainer, undefined);\n const escape = (event: KeyboardEvent) => {\n const target = event.target;\n if (\n event.key === \"Escape\" &&\n !event.defaultPrevented &&\n !event.isComposing &&\n target instanceof Element &&\n target.getAttribute(\"role\") === \"combobox\" &&\n target.getAttribute(\"aria-expanded\") === \"false\"\n ) {\n const handler = props.control.attrs.onKeydown;\n if (isKeyboardHandler(handler)) handler(event);\n }\n };\n return () =>\n h(ElementSelect, {\n ...props.control.attrs,\n value: props.control.value,\n options: props.control.options,\n teleported: container?.value != null,\n appendTo: container?.value ?? undefined,\n onChange: props.control.onChange,\n onKeydownCapture: escape,\n });\n },\n {\n name: \"ElementColumnChoice\",\n props: {\n control: { type: Object as PropType<ChoiceControl> },\n },\n }\n);\n","import {\n type ColumnMenuButtonProps,\n type ColumnMenuSlots,\n managedOverlayPanel,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport { isElementRef } from \"../controls/ref\";\nimport { ElementColumnChoice } from \"./ElementColumnChoice\";\nimport { ElementColumnMenuPanel } from \"./ElementColumnMenuPanel\";\n\nfunction button(control: ColumnMenuButtonProps) {\n const icons = {\n grip: \"⠿\",\n visible: \"◉\",\n hidden: \"○\",\n pin: \"⌖\",\n more: \"⋯\",\n rename: \"✎\",\n };\n return elementButton(\n { \"aria-label\": control.label, ...control.attrs },\n control.icon\n ? h(\"span\", { \"aria-hidden\": \"true\" }, icons[control.icon])\n : control.label\n );\n}\nexport const elementColumnMenuSlots: ColumnMenuSlots = {\n Trigger: button,\n Button: button,\n Input: ({ attrs, value, onChange }) => {\n const nativeAttrs = Object.fromEntries(\n Object.entries(attrs).filter(([key]) => key !== \"ref\" && key !== \"type\")\n );\n return h(ElementInput, {\n ...nativeAttrs,\n value,\n type: attrs.type === \"search\" ? \"search\" : \"text\",\n inputRef: isElementRef(attrs.ref) ? attrs.ref : undefined,\n onChange,\n });\n },\n Choice: (control) => h(ElementColumnChoice, { control }),\n Panel: managedOverlayPanel((control) =>\n h(ElementColumnMenuPanel, { control })\n ),\n};\n","import {\n ColumnMenuChrome,\n type ColumnMenuSlotProps,\n useColumnMenu,\n} from \"@adapttable/vue/adapter\";\nimport { createVNode, defineComponent, h, type SetupContext } from \"vue\";\n\nimport { elementColumnMenuSlots } from \"./elementColumnMenuControls\";\n\nconst menuProps = {\n allColumns: null,\n layout: null,\n labels: null,\n hasRowActions: Boolean,\n hasRowReorder: Boolean,\n onAutoSize: null,\n onAutoSizeColumn: null,\n onSortColumn: null,\n onFilterColumn: null,\n onRenameColumn: null,\n sortBy: null,\n sortDir: null,\n dir: null,\n groupingPanel: null,\n featureHost: null,\n classNames: null,\n container: null,\n} satisfies Record<keyof ColumnMenuSlotProps<unknown>, unknown>;\nconst ElementColumnMenuPresentation = defineComponent(\n (props: ColumnMenuSlotProps<unknown>) => {\n const model = useColumnMenu(() => props);\n return () => h(ColumnMenuChrome, { model, slots: elementColumnMenuSlots });\n },\n { name: \"ElementColumnMenuPresentation\", props: menuProps }\n);\nexport function ColumnMenu<TRow>(\n props: ColumnMenuSlotProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n) {\n return createVNode(ElementColumnMenuPresentation, {\n ...context.attrs,\n ...props,\n });\n}\nColumnMenu.props = menuProps;\n","import type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n COLUMN_HEADER_RENAME,\n COLUMN_MENU,\n ColumnHeaderRenameChrome,\n extendFeature,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { columnMenu as bindingColumnMenu } from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { ColumnMenu } from \"./columns/ColumnMenu\";\nimport { elementColumnMenuSlots } from \"./columns/elementColumnMenuControls\";\n\nexport function columnMenu(): StaticTableFeature {\n return extendFeature(bindingColumnMenu(), [\n slotRender(COLUMN_MENU, (props) => h(ColumnMenu<never>, { ...props })),\n slotRender(COLUMN_HEADER_RENAME, (props) =>\n h(ColumnHeaderRenameChrome, { ...props, slots: elementColumnMenuSlots })\n ),\n ]);\n}\nexport { ColumnMenu } from \"./columns/ColumnMenu\";\nexport type { ColumnMenuSlotProps } from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;AAOA,SAAS,kBACP,OACyC;CACzC,OAAO,OAAO,UAAU;AAC1B;AACA,MAAa,uBAAA,GAAsBA,IAAAA,gBAAAA,EAChC,UAA+C;CAC9C,MAAM,aAAA,GAAYC,IAAAA,OAAAA,CAAOC,+BAAAA,qBAAqB,KAAA,CAAS;CACvD,MAAM,UAAU,UAAyB;EACvC,MAAM,SAAS,MAAM;EACrB,IACE,MAAM,QAAQ,YACd,CAAC,MAAM,oBACP,CAAC,MAAM,eACP,kBAAkB,WAClB,OAAO,aAAa,MAAM,MAAM,cAChC,OAAO,aAAa,eAAe,MAAM,SACzC;GACA,MAAM,UAAU,MAAM,QAAQ,MAAM;GACpC,IAAI,kBAAkB,OAAO,GAAG,QAAQ,KAAK;EAC/C;CACF;CACA,cAAA,GACEC,IAAAA,EAAAA,CAAEC,sBAAAA,WAAe;EACf,GAAG,MAAM,QAAQ;EACjB,OAAO,MAAM,QAAQ;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;CAChB,gBAAgB;CAChB,QAAQ;CACR,SAAS;CACT,KAAK;CACL,eAAe;CACf,aAAa;CACb,YAAY;CACZ,WAAW;AACb;AACA,MAAM,iCAAA,GAAgCC,IAAAA,gBAAAA,EACnC,UAAwC;CACvC,MAAM,SAAA,GAAQC,wBAAAA,cAAAA,OAAoB,KAAK;CACvC,cAAA,GAAaC,IAAAA,EAAAA,CAAEC,wBAAAA,kBAAkB;EAAE;EAAO,OAAO;CAAuB,CAAC;AAC3E,GACA;CAAE,MAAM;CAAiC,OAAO;AAAU,CAC5D;AACA,SAAgB,WACd,OACA,SACA;CACA,QAAA,GAAOC,IAAAA,YAAAA,CAAY,+BAA+B;EAChD,GAAG,QAAQ;EACX,GAAG;CACL,CAAC;AACH;AACA,WAAW,QAAQ;;;AC9BnB,SAAgB,aAAiC;CAC/C,QAAA,GAAOC,wBAAAA,cAAAA,EAAAA,GAAcC,yBAAAA,WAAAA,CAAkB,GAAG,EAAA,GACxCC,wBAAAA,WAAAA,CAAWC,wBAAAA,cAAc,WAAA,GAAUC,IAAAA,EAAAA,CAAE,YAAmB,EAAE,GAAG,MAAM,CAAC,CAAC,IAAA,GACrEF,wBAAAA,WAAAA,CAAWG,wBAAAA,uBAAuB,WAAA,GAChCD,IAAAA,EAAAA,CAAEE,wBAAAA,0BAA0B;EAAE,GAAG;EAAO,OAAO;CAAuB,CAAC,CACzE,CACF,CAAC;AACH"}
|
package/dist/column-menu.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_column_menu = require("./column-menu-
|
|
2
|
+
const require_column_menu = require("./column-menu-CtaKQS3b.cjs");
|
|
3
3
|
exports.ColumnMenu = require_column_menu.ColumnMenu;
|
|
4
4
|
exports.columnMenu = require_column_menu.columnMenu;
|
package/dist/column-menu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ColumnMenu, t as columnMenu } from "./column-menu-
|
|
1
|
+
import { n as ColumnMenu, t as columnMenu } from "./column-menu-C6gwlyUQ.js";
|
|
2
2
|
export { ColumnMenu, columnMenu };
|
|
@@ -2,7 +2,7 @@ import { n as useClassNames } from "./classNamesContext-18Wbxy4F.js";
|
|
|
2
2
|
import { t as elementButton } from "./button-DwB4UxI2.js";
|
|
3
3
|
import { t as _sfc_main } from "./ElementInput-BsoAvPfO.js";
|
|
4
4
|
import { t as _sfc_main$1 } from "./ElementSelect-Cl5ZjuQM.js";
|
|
5
|
-
import { n as _sfc_main$2, t as ElementFilterSurface } from "./ElementFilterSurface-
|
|
5
|
+
import { n as _sfc_main$2, t as ElementFilterSurface } from "./ElementFilterSurface-BR_nBvZU.js";
|
|
6
6
|
import { createVNode, defineComponent, h } from "vue";
|
|
7
7
|
import { ACTIVE_FILTER_CHIPS, FilterChipsChrome, FilterPanelChrome, FilterTreeChrome, TOOLBAR_EXTRAS, extendFeature, filterViewKey, slotRender, useFeatureState, useFilterTreeModel } from "@adapttable/vue/adapter";
|
|
8
8
|
import { ElCollapse, ElCollapseItem, ElFormItem, ElIcon, ElTag, ElText } from "element-plus";
|
|
@@ -188,4 +188,4 @@ function filters$1(defs = [], options = {}) {
|
|
|
188
188
|
//#endregion
|
|
189
189
|
export { filters$1 as n, ElementFilterTree as r, filterTypes as t };
|
|
190
190
|
|
|
191
|
-
//# sourceMappingURL=filters-
|
|
191
|
+
//# sourceMappingURL=filters-C9_trRXw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters-Dg22pfUy.js","names":["ElementSelect","ElementInput","ElementFilterField","filters","bindingFilters"],"sources":["../src/filters/ElementFilterChips.ts","../src/filters/ElementFilterTree.ts","../src/filters/ElementFiltersPanel.ts","../src/filters.ts"],"sourcesContent":["import {\n type ActiveFilterChipsSlotProps,\n FilterChipsChrome,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, type PropType } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\n\nexport const ElementFilterChips = defineComponent(\n (props: ActiveFilterChipsSlotProps) => {\n const names = useClassNames();\n return () =>\n FilterChipsChrome({\n ...props,\n classNames: names.value,\n slots: {\n Remove: ({ attrs }) => elementButton(attrs, \"×\"),\n Clear: ({ attrs, label }) => elementButton(attrs, label),\n },\n });\n },\n {\n name: \"ElementFilterChips\",\n props: {\n chips: { type: Array as PropType<ActiveFilterChipsSlotProps[\"chips\"]> },\n labels: {\n type: Object as PropType<ActiveFilterChipsSlotProps[\"labels\"]>,\n },\n onClearAll: {\n type: Function as PropType<ActiveFilterChipsSlotProps[\"onClearAll\"]>,\n },\n },\n }\n);\n","import {\n type FilterTreeBuilderProps,\n FilterTreeChrome,\n type FilterTreeSlots,\n useFilterTreeModel,\n} from \"@adapttable/vue/adapter\";\nimport {\n type CollapseModelValue,\n ElCollapse,\n ElCollapseItem,\n ElFormItem,\n ElText,\n} from \"element-plus\";\nimport {\n createVNode,\n defineComponent,\n h,\n type SetupContext,\n type VNodeChild,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\nconst controls: FilterTreeSlots<VNodeChild> = {\n Select: (control) =>\n h(\n ElFormItem,\n { class: control.fieldClassName, \"data-adapttable-part\": \"filter-field\" },\n {\n label: () =>\n h(\n ElText,\n {\n class: control.labelClassName,\n \"data-adapttable-part\": \"filter-label\",\n },\n { default: () => control.label }\n ),\n default: () =>\n h(ElementSelect, {\n value: control.value,\n options: control.options,\n class: control.className,\n \"aria-label\": control.label,\n \"data-adapttable-part\": control.part,\n onChange: control.onChange,\n }),\n }\n ),\n Input: (control) =>\n h(\n ElFormItem,\n { class: control.fieldClassName, \"data-adapttable-part\": \"filter-field\" },\n {\n label: () =>\n h(\n ElText,\n {\n class: control.labelClassName,\n \"data-adapttable-part\": \"filter-label\",\n },\n { default: () => control.label }\n ),\n default: () =>\n h(ElementInput, {\n value: control.value,\n type: control.type,\n class: control.className,\n \"aria-label\": control.label,\n \"data-adapttable-part\": \"filter-input\",\n onChange: control.onChange,\n }),\n }\n ),\n Button: (control) =>\n elementButton(\n {\n class: control.className,\n \"data-adapttable-part\": control.part,\n onClick: control.onClick,\n },\n control.label\n ),\n Disclosure: (control) =>\n h(\n ElCollapse,\n {\n modelValue: control.expanded ? [\"query\"] : [],\n class: control.className,\n \"data-adapttable-part\": \"filter-tree\",\n \"onUpdate:modelValue\": (value: CollapseModelValue) =>\n control.onExpandedChange(\n Array.isArray(value) && value.includes(\"query\")\n ),\n },\n {\n default: () =>\n h(\n ElCollapseItem,\n { name: \"query\" },\n {\n title: () =>\n h(\n ElText,\n {\n class: control.summaryClassName,\n \"data-adapttable-part\": \"filter-tree-summary\",\n },\n { default: () => control.label }\n ),\n default: () => control.children,\n }\n ),\n }\n ),\n};\n\nconst treeProps = {\n defs: null,\n source: null,\n labels: null,\n registry: null,\n classNames: null,\n defaultExpanded: { type: Boolean, default: undefined },\n} satisfies Record<keyof FilterTreeBuilderProps<unknown>, unknown>;\n\nconst ElementFilterTreePresentation = defineComponent(\n (props: FilterTreeBuilderProps<unknown>) => {\n const model = useFilterTreeModel(() => props);\n return () => FilterTreeChrome({ model: model.value, controls });\n },\n {\n name: \"ElementFilterTreePresentation\",\n props: treeProps,\n }\n);\n\n/** Preserve the canonical row contract without exposing versioned instance helpers. */\nexport function ElementFilterTree<TRow>(\n props: FilterTreeBuilderProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n) {\n return createVNode(ElementFilterTreePresentation, {\n ...context.attrs,\n ...props,\n });\n}\nElementFilterTree.props = treeProps;\n","import {\n FilterPanelChrome,\n type FilterPanelSlots,\n filterViewKey,\n useFeatureState,\n} from \"@adapttable/vue/adapter\";\nimport { ElIcon, ElTag } from \"element-plus\";\nimport { defineComponent, h } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\nimport ElementFilterField from \"./ElementFilterField.vue\";\nimport { ElementFilterSurface } from \"./ElementFilterSurface\";\nimport { ElementFilterTree } from \"./ElementFilterTree\";\n\nexport const ElementFiltersPanel = defineComponent({\n name: \"ElementFiltersPanel\",\n setup() {\n const names = useClassNames();\n const model = useFeatureState(filterViewKey<unknown>());\n const controls: FilterPanelSlots<unknown> = {\n Trigger: (control) =>\n elementButton(\n {\n ...control.attrs,\n ref: control.triggerRef,\n class: names.value.filtersButton,\n onPointerdown: control.onPointerDown,\n onClick: control.onClick,\n },\n [\n h(\n ElIcon,\n {\n \"data-adapttable-part\": \"filters-icon\",\n class: names.value.filtersIcon,\n \"aria-hidden\": \"true\",\n },\n {\n default: () =>\n h(\"svg\", { viewBox: \"0 0 24 24\", focusable: \"false\" }, [\n h(\"path\", {\n d: \"M3 4h18l-7 8v7l-4 2v-9z\",\n fill: \"none\",\n stroke: \"currentColor\",\n }),\n ]),\n }\n ),\n control.label,\n control.count\n ? h(\n ElTag,\n {\n \"data-adapttable-part\": \"filters-count\",\n class: names.value.filtersCount,\n size: \"small\",\n round: true,\n },\n { default: () => control.count }\n )\n : null,\n ]\n ),\n Button: (control) =>\n elementButton(\n {\n \"data-adapttable-part\": control.part,\n class: {\n \"filters-clear\": names.value.filtersClear,\n \"filters-close\": names.value.filtersClose,\n \"filters-done\": names.value.filtersDone,\n }[control.part],\n disabled: control.disabled,\n onClick: control.onClick,\n },\n control.label\n ),\n Field: (field) =>\n h(ElementFilterField<unknown>, { ...field, classNames: names.value }),\n Tree: (tree) =>\n h(ElementFilterTree, { ...tree, classNames: names.value }),\n Popover: (surface) =>\n h(ElementFilterSurface, { ...surface, modal: false }),\n Drawer: (surface) =>\n h(ElementFilterSurface, {\n ...surface,\n modal: true,\n backdropClassName: names.value.filtersBackdrop,\n }),\n };\n return () =>\n model.value\n ? FilterPanelChrome({\n model: model.value,\n controls,\n classNames: names.value,\n })\n : null;\n },\n});\n","import type { FilterDef, TableFeature } from \"@adapttable/vue\";\nimport {\n ACTIVE_FILTER_CHIPS,\n extendFeature,\n slotRender,\n TOOLBAR_EXTRAS,\n} from \"@adapttable/vue/adapter\";\nimport {\n filters as bindingFilters,\n type FiltersOptions,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { ElementFilterChips } from \"./filters/ElementFilterChips\";\nimport { ElementFiltersPanel } from \"./filters/ElementFiltersPanel\";\n\nexport function filters<TRow>(\n defs: readonly FilterDef<TRow>[] = [],\n options: FiltersOptions = {}\n): TableFeature<TRow> {\n return extendFeature(bindingFilters(defs, options), [\n slotRender(TOOLBAR_EXTRAS, () => h(ElementFiltersPanel)),\n slotRender(ACTIVE_FILTER_CHIPS, (props) =>\n h(ElementFilterChips, { ...props })\n ),\n ]);\n}\n\nexport { ElementChecklistFilter as ChecklistFilter } from \"./filters/ElementChecklistFilter\";\nexport { default as FilterField } from \"./filters/ElementFilterField.vue\";\nexport { ElementFilterTree as FilterTreeBuilder } from \"./filters/ElementFilterTree\";\nexport type { FilterDef, FilterOption, FilterTypeSpec } from \"@adapttable/vue\";\nexport type {\n ChecklistFilterProps,\n FilterFieldOptions,\n FilterTreeBuilderProps,\n} from \"@adapttable/vue/adapter\";\nexport type { FiltersOptions } from \"@adapttable/vue/features\";\nexport { filterTypes } from \"@adapttable/vue/features\";\n"],"mappings":";;;;;;;;;;AASA,MAAa,qBAAqB,iBAC/B,UAAsC;CACrC,MAAM,QAAQ,cAAc;CAC5B,aACE,kBAAkB;EAChB,GAAG;EACH,YAAY,MAAM;EAClB,OAAO;GACL,SAAS,EAAE,YAAY,cAAc,OAAO,GAAG;GAC/C,QAAQ,EAAE,OAAO,YAAY,cAAc,OAAO,KAAK;EACzD;CACF,CAAC;AACL,GACA;CACE,MAAM;CACN,OAAO;EACL,OAAO,EAAE,MAAM,MAAuD;EACtE,QAAQ,EACN,MAAM,OACR;EACA,YAAY,EACV,MAAM,SACR;CACF;AACF,CACF;;;ACTA,MAAM,WAAwC;CAC5C,SAAS,YACP,EACE,Y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C;GACtE,OAAO,SACL,EAAE,mBAAmB;IAAE,GAAG;IAAM,YAAY,MAAM;GAAM,CAAC;GAC3D,UAAU,YACR,EAAE,sBAAsB;IAAE,GAAG;IAAS,OAAO;GAAM,CAAC;GACtD,SAAS,YACP,EAAE,sBAAsB;IACtB,GAAG;IACH,OAAO;IACP,mBAAmB,MAAM,MAAM;GACjC,CAAC;EACL;EACA,aACE,MAAM,QACF,kBAAkB;GAChB,OAAO,MAAM;GACb;GACA,YAAY,MAAM;EACpB,CAAC,IACD;CACR;AACF,CAAC;;;ACpFD,SAAgBC,UACd,OAAmC,CAAC,GACpC,UAA0B,CAAC,GACP;CACpB,OAAO,cAAcC,QAAe,MAAM,OAAO,GAAG,CAClD,WAAW,sBAAsB,EAAE,mBAAmB,CAAC,GACvD,WAAW,sBAAsB,UAC/B,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC,CACpC,CACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"filters-C9_trRXw.js","names":["ElementSelect","ElementInput","ElementFilterField","filters","bindingFilters"],"sources":["../src/filters/ElementFilterChips.ts","../src/filters/ElementFilterTree.ts","../src/filters/ElementFiltersPanel.ts","../src/filters.ts"],"sourcesContent":["import {\n type ActiveFilterChipsSlotProps,\n FilterChipsChrome,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, type PropType } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\n\nexport const ElementFilterChips = defineComponent(\n (props: ActiveFilterChipsSlotProps) => {\n const names = useClassNames();\n return () =>\n FilterChipsChrome({\n ...props,\n classNames: names.value,\n slots: {\n Remove: ({ attrs }) => elementButton(attrs, \"×\"),\n Clear: ({ attrs, label }) => elementButton(attrs, label),\n },\n });\n },\n {\n name: \"ElementFilterChips\",\n props: {\n chips: { type: Array as PropType<ActiveFilterChipsSlotProps[\"chips\"]> },\n labels: {\n type: Object as PropType<ActiveFilterChipsSlotProps[\"labels\"]>,\n },\n onClearAll: {\n type: Function as PropType<ActiveFilterChipsSlotProps[\"onClearAll\"]>,\n },\n },\n }\n);\n","import {\n type FilterTreeBuilderProps,\n FilterTreeChrome,\n type FilterTreeSlots,\n useFilterTreeModel,\n} from \"@adapttable/vue/adapter\";\nimport {\n type CollapseModelValue,\n ElCollapse,\n ElCollapseItem,\n ElFormItem,\n ElText,\n} from \"element-plus\";\nimport {\n createVNode,\n defineComponent,\n h,\n type SetupContext,\n type VNodeChild,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\nconst controls: FilterTreeSlots<VNodeChild> = {\n Select: (control) =>\n h(\n ElFormItem,\n { class: control.fieldClassName, \"data-adapttable-part\": \"filter-field\" },\n {\n label: () =>\n h(\n ElText,\n {\n class: control.labelClassName,\n \"data-adapttable-part\": \"filter-label\",\n },\n { default: () => control.label }\n ),\n default: () =>\n h(ElementSelect, {\n value: control.value,\n options: control.options,\n class: control.className,\n \"aria-label\": control.label,\n \"data-adapttable-part\": control.part,\n onChange: control.onChange,\n }),\n }\n ),\n Input: (control) =>\n h(\n ElFormItem,\n { class: control.fieldClassName, \"data-adapttable-part\": \"filter-field\" },\n {\n label: () =>\n h(\n ElText,\n {\n class: control.labelClassName,\n \"data-adapttable-part\": \"filter-label\",\n },\n { default: () => control.label }\n ),\n default: () =>\n h(ElementInput, {\n value: control.value,\n type: control.type,\n class: control.className,\n \"aria-label\": control.label,\n \"data-adapttable-part\": \"filter-input\",\n onChange: control.onChange,\n }),\n }\n ),\n Button: (control) =>\n elementButton(\n {\n class: control.className,\n \"data-adapttable-part\": control.part,\n onClick: control.onClick,\n },\n control.label\n ),\n Disclosure: (control) =>\n h(\n ElCollapse,\n {\n modelValue: control.expanded ? [\"query\"] : [],\n class: control.className,\n \"data-adapttable-part\": \"filter-tree\",\n \"onUpdate:modelValue\": (value: CollapseModelValue) =>\n control.onExpandedChange(\n Array.isArray(value) && value.includes(\"query\")\n ),\n },\n {\n default: () =>\n h(\n ElCollapseItem,\n { name: \"query\" },\n {\n title: () =>\n h(\n ElText,\n {\n class: control.summaryClassName,\n \"data-adapttable-part\": \"filter-tree-summary\",\n },\n { default: () => control.label }\n ),\n default: () => control.children,\n }\n ),\n }\n ),\n};\n\nconst treeProps = {\n defs: null,\n source: null,\n labels: null,\n registry: null,\n classNames: null,\n defaultExpanded: { type: Boolean, default: undefined },\n} satisfies Record<keyof FilterTreeBuilderProps<unknown>, unknown>;\n\nconst ElementFilterTreePresentation = defineComponent(\n (props: FilterTreeBuilderProps<unknown>) => {\n const model = useFilterTreeModel(() => props);\n return () => FilterTreeChrome({ model: model.value, controls });\n },\n {\n name: \"ElementFilterTreePresentation\",\n props: treeProps,\n }\n);\n\n/** Preserve the canonical row contract without exposing versioned instance helpers. */\nexport function ElementFilterTree<TRow>(\n props: FilterTreeBuilderProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n) {\n return createVNode(ElementFilterTreePresentation, {\n ...context.attrs,\n ...props,\n });\n}\nElementFilterTree.props = treeProps;\n","import {\n FilterPanelChrome,\n type FilterPanelSlots,\n filterViewKey,\n useFeatureState,\n} from \"@adapttable/vue/adapter\";\nimport { ElIcon, ElTag } from \"element-plus\";\nimport { defineComponent, h } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\nimport ElementFilterField from \"./ElementFilterField.vue\";\nimport { ElementFilterSurface } from \"./ElementFilterSurface\";\nimport { ElementFilterTree } from \"./ElementFilterTree\";\n\nexport const ElementFiltersPanel = defineComponent({\n name: \"ElementFiltersPanel\",\n setup() {\n const names = useClassNames();\n const model = useFeatureState(filterViewKey<unknown>());\n const controls: FilterPanelSlots<unknown> = {\n Trigger: (control) =>\n elementButton(\n {\n ...control.attrs,\n ref: control.triggerRef,\n class: names.value.filtersButton,\n onPointerdown: control.onPointerDown,\n onClick: control.onClick,\n },\n [\n h(\n ElIcon,\n {\n \"data-adapttable-part\": \"filters-icon\",\n class: names.value.filtersIcon,\n \"aria-hidden\": \"true\",\n },\n {\n default: () =>\n h(\"svg\", { viewBox: \"0 0 24 24\", focusable: \"false\" }, [\n h(\"path\", {\n d: \"M3 4h18l-7 8v7l-4 2v-9z\",\n fill: \"none\",\n stroke: \"currentColor\",\n }),\n ]),\n }\n ),\n control.label,\n control.count\n ? h(\n ElTag,\n {\n \"data-adapttable-part\": \"filters-count\",\n class: names.value.filtersCount,\n size: \"small\",\n round: true,\n },\n { default: () => control.count }\n )\n : null,\n ]\n ),\n Button: (control) =>\n elementButton(\n {\n \"data-adapttable-part\": control.part,\n class: {\n \"filters-clear\": names.value.filtersClear,\n \"filters-close\": names.value.filtersClose,\n \"filters-done\": names.value.filtersDone,\n }[control.part],\n disabled: control.disabled,\n onClick: control.onClick,\n },\n control.label\n ),\n Field: (field) =>\n h(ElementFilterField<unknown>, { ...field, classNames: names.value }),\n Tree: (tree) =>\n h(ElementFilterTree, { ...tree, classNames: names.value }),\n Popover: (surface) =>\n h(ElementFilterSurface, { ...surface, modal: false }),\n Drawer: (surface) =>\n h(ElementFilterSurface, {\n ...surface,\n modal: true,\n backdropClassName: names.value.filtersBackdrop,\n }),\n };\n return () =>\n model.value\n ? FilterPanelChrome({\n model: model.value,\n controls,\n classNames: names.value,\n })\n : null;\n },\n});\n","import type { FilterDef, TableFeature } from \"@adapttable/vue\";\nimport {\n ACTIVE_FILTER_CHIPS,\n extendFeature,\n slotRender,\n TOOLBAR_EXTRAS,\n} from \"@adapttable/vue/adapter\";\nimport {\n filters as bindingFilters,\n type FiltersOptions,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { ElementFilterChips } from \"./filters/ElementFilterChips\";\nimport { ElementFiltersPanel } from \"./filters/ElementFiltersPanel\";\n\nexport function filters<TRow>(\n defs: readonly FilterDef<TRow>[] = [],\n options: FiltersOptions = {}\n): TableFeature<TRow> {\n return extendFeature(bindingFilters(defs, options), [\n slotRender(TOOLBAR_EXTRAS, () => h(ElementFiltersPanel)),\n slotRender(ACTIVE_FILTER_CHIPS, (props) =>\n h(ElementFilterChips, { ...props })\n ),\n ]);\n}\n\nexport { ElementChecklistFilter as ChecklistFilter } from \"./filters/ElementChecklistFilter\";\nexport { default as FilterField } from \"./filters/ElementFilterField.vue\";\nexport { ElementFilterTree as FilterTreeBuilder } from \"./filters/ElementFilterTree\";\nexport type { FilterDef, FilterOption, FilterTypeSpec } from \"@adapttable/vue\";\nexport type {\n ChecklistFilterProps,\n FilterFieldOptions,\n FilterTreeBuilderProps,\n} from \"@adapttable/vue/adapter\";\nexport type { FiltersOptions } from \"@adapttable/vue/features\";\nexport { filterTypes } from \"@adapttable/vue/features\";\n"],"mappings":";;;;;;;;;;AASA,MAAa,qBAAqB,iBAC/B,UAAsC;CACrC,MAAM,QAAQ,cAAc;CAC5B,aACE,kBAAkB;EAChB,GAAG;EACH,YAAY,MAAM;EAClB,OAAO;GACL,SAAS,EAAE,YAAY,cAAc,OAAO,GAAG;GAC/C,QAAQ,EAAE,OAAO,YAAY,cAAc,OAAO,KAAK;EACzD;CACF,CAAC;AACL,GACA;CACE,MAAM;CACN,OAAO;EACL,OAAO,EAAE,MAAM,MAAuD;EACtE,QAAQ,EACN,MAAM,OACR;EACA,YAAY,EACV,MAAM,SACR;CACF;AACF,CACF;;;ACTA,MAAM,WAAwC;CAC5C,SAAS,YACP,EACE,YACA;EAAE,OAAO,QAAQ;EAAgB,wBAAwB;CAAe,GACxE;EACE,aACE,EACE,QACA;GACE,OAAO,QAAQ;GACf,wBAAwB;EAC1B,GACA,EAAE,eAAe,QAAQ,MAAM,CACjC;EACF,eACE,EAAEA,aAAe;GACf,OAAO,QAAQ;GACf,SAAS,QAAQ;GACjB,OAAO,QAAQ;GACf,cAAc,QAAQ;GACtB,wBAAwB,QAAQ;GAChC,UAAU,QAAQ;EACpB,CAAC;CACL,CACF;CACF,QAAQ,YACN,EACE,YACA;EAAE,OAAO,QAAQ;EAAgB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gBC,UACd,OAAmC,CAAC,GACpC,UAA0B,CAAC,GACP;CACpB,OAAO,cAAcC,QAAe,MAAM,OAAO,GAAG,CAClD,WAAW,sBAAsB,EAAE,mBAAmB,CAAC,GACvD,WAAW,sBAAsB,UAC/B,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC,CACpC,CACF,CAAC;AACH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_button = require("./button-BFjBL9m3.cjs");
|
|
2
2
|
const require_ElementInput = require("./ElementInput-vBVDBaLp.cjs");
|
|
3
3
|
const require_ElementSelect = require("./ElementSelect-K1rRvu5q.cjs");
|
|
4
|
-
const require_ElementFilterSurface = require("./ElementFilterSurface-
|
|
4
|
+
const require_ElementFilterSurface = require("./ElementFilterSurface-B8Fo3hPb.cjs");
|
|
5
5
|
let vue = require("vue");
|
|
6
6
|
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
7
7
|
let element_plus = require("element-plus");
|
|
@@ -198,4 +198,4 @@ Object.defineProperty(exports, "filters", {
|
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
200
|
|
|
201
|
-
//# sourceMappingURL=filters-
|
|
201
|
+
//# sourceMappingURL=filters-DOlxNQqE.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters-BA8vjGzr.cjs","names":["defineComponent","useClassNames","FilterChipsChrome","elementButton","h","ElFormItem","ElText","ElementSelect","ElementInput","elementButton","ElCollapse","ElCollapseItem","defineComponent","useFilterTreeModel","FilterTreeChrome","createVNode","defineComponent","useClassNames","useFeatureState","filterViewKey","elementButton","h","ElIcon","ElTag","ElementFilterField","ElementFilterSurface","FilterPanelChrome","extendFeature","bindingFilters","slotRender","TOOLBAR_EXTRAS","h","ACTIVE_FILTER_CHIPS"],"sources":["../src/filters/ElementFilterChips.ts","../src/filters/ElementFilterTree.ts","../src/filters/ElementFiltersPanel.ts","../src/filters.ts"],"sourcesContent":["import {\n type ActiveFilterChipsSlotProps,\n FilterChipsChrome,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, type PropType } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\n\nexport const ElementFilterChips = defineComponent(\n (props: ActiveFilterChipsSlotProps) => {\n const names = useClassNames();\n return () =>\n FilterChipsChrome({\n ...props,\n classNames: names.value,\n slots: {\n Remove: ({ attrs }) => elementButton(attrs, \"×\"),\n Clear: ({ attrs, label }) => elementButton(attrs, label),\n },\n });\n },\n {\n name: \"ElementFilterChips\",\n props: {\n chips: { type: Array as PropType<ActiveFilterChipsSlotProps[\"chips\"]> },\n labels: {\n type: Object as PropType<ActiveFilterChipsSlotProps[\"labels\"]>,\n },\n onClearAll: {\n type: Function as PropType<ActiveFilterChipsSlotProps[\"onClearAll\"]>,\n },\n },\n }\n);\n","import {\n type FilterTreeBuilderProps,\n FilterTreeChrome,\n type FilterTreeSlots,\n useFilterTreeModel,\n} from \"@adapttable/vue/adapter\";\nimport {\n type CollapseModelValue,\n ElCollapse,\n ElCollapseItem,\n ElFormItem,\n ElText,\n} from \"element-plus\";\nimport {\n createVNode,\n defineComponent,\n h,\n type SetupContext,\n type VNodeChild,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\nconst controls: FilterTreeSlots<VNodeChild> = {\n Select: (control) =>\n h(\n ElFormItem,\n { class: control.fieldClassName, \"data-adapttable-part\": \"filter-field\" },\n {\n label: () =>\n h(\n ElText,\n {\n class: control.labelClassName,\n \"data-adapttable-part\": \"filter-label\",\n },\n { default: () => control.label }\n ),\n default: () =>\n h(ElementSelect, {\n value: control.value,\n options: control.options,\n class: control.className,\n \"aria-label\": control.label,\n \"data-adapttable-part\": control.part,\n onChange: control.onChange,\n }),\n }\n ),\n Input: (control) =>\n h(\n ElFormItem,\n { class: control.fieldClassName, \"data-adapttable-part\": \"filter-field\" },\n {\n label: () =>\n h(\n ElText,\n {\n class: control.labelClassName,\n \"data-adapttable-part\": \"filter-label\",\n },\n { default: () => control.label }\n ),\n default: () =>\n h(ElementInput, {\n value: control.value,\n type: control.type,\n class: control.className,\n \"aria-label\": control.label,\n \"data-adapttable-part\": \"filter-input\",\n onChange: control.onChange,\n }),\n }\n ),\n Button: (control) =>\n elementButton(\n {\n class: control.className,\n \"data-adapttable-part\": control.part,\n onClick: control.onClick,\n },\n control.label\n ),\n Disclosure: (control) =>\n h(\n ElCollapse,\n {\n modelValue: control.expanded ? [\"query\"] : [],\n class: control.className,\n \"data-adapttable-part\": \"filter-tree\",\n \"onUpdate:modelValue\": (value: CollapseModelValue) =>\n control.onExpandedChange(\n Array.isArray(value) && value.includes(\"query\")\n ),\n },\n {\n default: () =>\n h(\n ElCollapseItem,\n { name: \"query\" },\n {\n title: () =>\n h(\n ElText,\n {\n class: control.summaryClassName,\n \"data-adapttable-part\": \"filter-tree-summary\",\n },\n { default: () => control.label }\n ),\n default: () => control.children,\n }\n ),\n }\n ),\n};\n\nconst treeProps = {\n defs: null,\n source: null,\n labels: null,\n registry: null,\n classNames: null,\n defaultExpanded: { type: Boolean, default: undefined },\n} satisfies Record<keyof FilterTreeBuilderProps<unknown>, unknown>;\n\nconst ElementFilterTreePresentation = defineComponent(\n (props: FilterTreeBuilderProps<unknown>) => {\n const model = useFilterTreeModel(() => props);\n return () => FilterTreeChrome({ model: model.value, controls });\n },\n {\n name: \"ElementFilterTreePresentation\",\n props: treeProps,\n }\n);\n\n/** Preserve the canonical row contract without exposing versioned instance helpers. */\nexport function ElementFilterTree<TRow>(\n props: FilterTreeBuilderProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n) {\n return createVNode(ElementFilterTreePresentation, {\n ...context.attrs,\n ...props,\n });\n}\nElementFilterTree.props = treeProps;\n","import {\n FilterPanelChrome,\n type FilterPanelSlots,\n filterViewKey,\n useFeatureState,\n} from \"@adapttable/vue/adapter\";\nimport { ElIcon, ElTag } from \"element-plus\";\nimport { defineComponent, h } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\nimport ElementFilterField from \"./ElementFilterField.vue\";\nimport { ElementFilterSurface } from \"./ElementFilterSurface\";\nimport { ElementFilterTree } from \"./ElementFilterTree\";\n\nexport const ElementFiltersPanel = defineComponent({\n name: \"ElementFiltersPanel\",\n setup() {\n const names = useClassNames();\n const model = useFeatureState(filterViewKey<unknown>());\n const controls: FilterPanelSlots<unknown> = {\n Trigger: (control) =>\n elementButton(\n {\n ...control.attrs,\n ref: control.triggerRef,\n class: names.value.filtersButton,\n onPointerdown: control.onPointerDown,\n onClick: control.onClick,\n },\n [\n h(\n ElIcon,\n {\n \"data-adapttable-part\": \"filters-icon\",\n class: names.value.filtersIcon,\n \"aria-hidden\": \"true\",\n },\n {\n default: () =>\n h(\"svg\", { viewBox: \"0 0 24 24\", focusable: \"false\" }, [\n h(\"path\", {\n d: \"M3 4h18l-7 8v7l-4 2v-9z\",\n fill: \"none\",\n stroke: \"currentColor\",\n }),\n ]),\n }\n ),\n control.label,\n control.count\n ? h(\n ElTag,\n {\n \"data-adapttable-part\": \"filters-count\",\n class: names.value.filtersCount,\n size: \"small\",\n round: true,\n },\n { default: () => control.count }\n )\n : null,\n ]\n ),\n Button: (control) =>\n elementButton(\n {\n \"data-adapttable-part\": control.part,\n class: {\n \"filters-clear\": names.value.filtersClear,\n \"filters-close\": names.value.filtersClose,\n \"filters-done\": names.value.filtersDone,\n }[control.part],\n disabled: control.disabled,\n onClick: control.onClick,\n },\n control.label\n ),\n Field: (field) =>\n h(ElementFilterField<unknown>, { ...field, classNames: names.value }),\n Tree: (tree) =>\n h(ElementFilterTree, { ...tree, classNames: names.value }),\n Popover: (surface) =>\n h(ElementFilterSurface, { ...surface, modal: false }),\n Drawer: (surface) =>\n h(ElementFilterSurface, {\n ...surface,\n modal: true,\n backdropClassName: names.value.filtersBackdrop,\n }),\n };\n return () =>\n model.value\n ? FilterPanelChrome({\n model: model.value,\n controls,\n classNames: names.value,\n })\n : null;\n },\n});\n","import type { FilterDef, TableFeature } from \"@adapttable/vue\";\nimport {\n ACTIVE_FILTER_CHIPS,\n extendFeature,\n slotRender,\n TOOLBAR_EXTRAS,\n} from \"@adapttable/vue/adapter\";\nimport {\n filters as bindingFilters,\n type FiltersOptions,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { ElementFilterChips } from \"./filters/ElementFilterChips\";\nimport { ElementFiltersPanel } from \"./filters/ElementFiltersPanel\";\n\nexport function filters<TRow>(\n defs: readonly FilterDef<TRow>[] = [],\n options: FiltersOptions = {}\n): TableFeature<TRow> {\n return extendFeature(bindingFilters(defs, options), [\n slotRender(TOOLBAR_EXTRAS, () => h(ElementFiltersPanel)),\n slotRender(ACTIVE_FILTER_CHIPS, (props) =>\n h(ElementFilterChips, { ...props })\n ),\n ]);\n}\n\nexport { ElementChecklistFilter as ChecklistFilter } from \"./filters/ElementChecklistFilter\";\nexport { default as FilterField } from \"./filters/ElementFilterField.vue\";\nexport { ElementFilterTree as FilterTreeBuilder } from \"./filters/ElementFilterTree\";\nexport type { FilterDef, FilterOption, FilterTypeSpec } from \"@adapttable/vue\";\nexport type {\n ChecklistFilterProps,\n FilterFieldOptions,\n FilterTreeBuilderProps,\n} from \"@adapttable/vue/adapter\";\nexport type { FiltersOptions } from \"@adapttable/vue/features\";\nexport { filterTypes } from \"@adapttable/vue/features\";\n"],"mappings":";;;;;;;;;AASA,MAAa,sBAAA,GAAqBA,IAAAA,gBAAAA,EAC/B,UAAsC;CACrC,MAAM,SAAA,GAAQC,wBAAAA,uBAAAA,CAAc;CAC5B,cAAA,GACEC,wBAAAA,kBAAAA,CAAkB;EAChB,GAAG;EACH,YAAY,MAAM;EAClB,OAAO;GACL,SAAS,EAAE,YAAYC,eAAAA,cAAc,OAAO,GAAG;GAC/C,QAAQ,EAAE,OAAO,YAAYA,eAAAA,cAAc,OAAO,KAAK;EACzD;CACF,C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F,CAAC;;;ACpFD,SAAgB,QACd,OAAmC,CAAC,GACpC,UAA0B,CAAC,GACP;CACpB,QAAA,GAAOC,wBAAAA,cAAAA,EAAAA,GAAcC,yBAAAA,QAAAA,CAAe,MAAM,OAAO,GAAG,EAAA,GAClDC,wBAAAA,WAAAA,CAAWC,wBAAAA,uBAAAA,GAAsBC,IAAAA,EAAAA,CAAE,mBAAmB,CAAC,IAAA,GACvDF,wBAAAA,WAAAA,CAAWG,wBAAAA,sBAAsB,WAAA,GAC/BD,IAAAA,EAAAA,CAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC,CACpC,CACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"filters-DOlxNQqE.cjs","names":["defineComponent","useClassNames","FilterChipsChrome","elementButton","h","ElFormItem","ElText","ElementSelect","ElementInput","elementButton","ElCollapse","ElCollapseItem","defineComponent","useFilterTreeModel","FilterTreeChrome","createVNode","defineComponent","useClassNames","useFeatureState","filterViewKey","elementButton","h","ElIcon","ElTag","ElementFilterField","ElementFilterSurface","FilterPanelChrome","extendFeature","bindingFilters","slotRender","TOOLBAR_EXTRAS","h","ACTIVE_FILTER_CHIPS"],"sources":["../src/filters/ElementFilterChips.ts","../src/filters/ElementFilterTree.ts","../src/filters/ElementFiltersPanel.ts","../src/filters.ts"],"sourcesContent":["import {\n type ActiveFilterChipsSlotProps,\n FilterChipsChrome,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, type PropType } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\n\nexport const ElementFilterChips = defineComponent(\n (props: ActiveFilterChipsSlotProps) => {\n const names = useClassNames();\n return () =>\n FilterChipsChrome({\n ...props,\n classNames: names.value,\n slots: {\n Remove: ({ attrs }) => elementButton(attrs, \"×\"),\n Clear: ({ attrs, label }) => elementButton(attrs, label),\n },\n });\n },\n {\n name: \"ElementFilterChips\",\n props: {\n chips: { type: Array as PropType<ActiveFilterChipsSlotProps[\"chips\"]> },\n labels: {\n type: Object as PropType<ActiveFilterChipsSlotProps[\"labels\"]>,\n },\n onClearAll: {\n type: Function as PropType<ActiveFilterChipsSlotProps[\"onClearAll\"]>,\n },\n },\n }\n);\n","import {\n type FilterTreeBuilderProps,\n FilterTreeChrome,\n type FilterTreeSlots,\n useFilterTreeModel,\n} from \"@adapttable/vue/adapter\";\nimport {\n type CollapseModelValue,\n ElCollapse,\n ElCollapseItem,\n ElFormItem,\n ElText,\n} from \"element-plus\";\nimport {\n createVNode,\n defineComponent,\n h,\n type SetupContext,\n type VNodeChild,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\nconst controls: FilterTreeSlots<VNodeChild> = {\n Select: (control) =>\n h(\n ElFormItem,\n { class: control.fieldClassName, \"data-adapttable-part\": \"filter-field\" },\n {\n label: () =>\n h(\n ElText,\n {\n class: control.labelClassName,\n \"data-adapttable-part\": \"filter-label\",\n },\n { default: () => control.label }\n ),\n default: () =>\n h(ElementSelect, {\n value: control.value,\n options: control.options,\n class: control.className,\n \"aria-label\": control.label,\n \"data-adapttable-part\": control.part,\n onChange: control.onChange,\n }),\n }\n ),\n Input: (control) =>\n h(\n ElFormItem,\n { class: control.fieldClassName, \"data-adapttable-part\": \"filter-field\" },\n {\n label: () =>\n h(\n ElText,\n {\n class: control.labelClassName,\n \"data-adapttable-part\": \"filter-label\",\n },\n { default: () => control.label }\n ),\n default: () =>\n h(ElementInput, {\n value: control.value,\n type: control.type,\n class: control.className,\n \"aria-label\": control.label,\n \"data-adapttable-part\": \"filter-input\",\n onChange: control.onChange,\n }),\n }\n ),\n Button: (control) =>\n elementButton(\n {\n class: control.className,\n \"data-adapttable-part\": control.part,\n onClick: control.onClick,\n },\n control.label\n ),\n Disclosure: (control) =>\n h(\n ElCollapse,\n {\n modelValue: control.expanded ? [\"query\"] : [],\n class: control.className,\n \"data-adapttable-part\": \"filter-tree\",\n \"onUpdate:modelValue\": (value: CollapseModelValue) =>\n control.onExpandedChange(\n Array.isArray(value) && value.includes(\"query\")\n ),\n },\n {\n default: () =>\n h(\n ElCollapseItem,\n { name: \"query\" },\n {\n title: () =>\n h(\n ElText,\n {\n class: control.summaryClassName,\n \"data-adapttable-part\": \"filter-tree-summary\",\n },\n { default: () => control.label }\n ),\n default: () => control.children,\n }\n ),\n }\n ),\n};\n\nconst treeProps = {\n defs: null,\n source: null,\n labels: null,\n registry: null,\n classNames: null,\n defaultExpanded: { type: Boolean, default: undefined },\n} satisfies Record<keyof FilterTreeBuilderProps<unknown>, unknown>;\n\nconst ElementFilterTreePresentation = defineComponent(\n (props: FilterTreeBuilderProps<unknown>) => {\n const model = useFilterTreeModel(() => props);\n return () => FilterTreeChrome({ model: model.value, controls });\n },\n {\n name: \"ElementFilterTreePresentation\",\n props: treeProps,\n }\n);\n\n/** Preserve the canonical row contract without exposing versioned instance helpers. */\nexport function ElementFilterTree<TRow>(\n props: FilterTreeBuilderProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n) {\n return createVNode(ElementFilterTreePresentation, {\n ...context.attrs,\n ...props,\n });\n}\nElementFilterTree.props = treeProps;\n","import {\n FilterPanelChrome,\n type FilterPanelSlots,\n filterViewKey,\n useFeatureState,\n} from \"@adapttable/vue/adapter\";\nimport { ElIcon, ElTag } from \"element-plus\";\nimport { defineComponent, h } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\nimport ElementFilterField from \"./ElementFilterField.vue\";\nimport { ElementFilterSurface } from \"./ElementFilterSurface\";\nimport { ElementFilterTree } from \"./ElementFilterTree\";\n\nexport const ElementFiltersPanel = defineComponent({\n name: \"ElementFiltersPanel\",\n setup() {\n const names = useClassNames();\n const model = useFeatureState(filterViewKey<unknown>());\n const controls: FilterPanelSlots<unknown> = {\n Trigger: (control) =>\n elementButton(\n {\n ...control.attrs,\n ref: control.triggerRef,\n class: names.value.filtersButton,\n onPointerdown: control.onPointerDown,\n onClick: control.onClick,\n },\n [\n h(\n ElIcon,\n {\n \"data-adapttable-part\": \"filters-icon\",\n class: names.value.filtersIcon,\n \"aria-hidden\": \"true\",\n },\n {\n default: () =>\n h(\"svg\", { viewBox: \"0 0 24 24\", focusable: \"false\" }, [\n h(\"path\", {\n d: \"M3 4h18l-7 8v7l-4 2v-9z\",\n fill: \"none\",\n stroke: \"currentColor\",\n }),\n ]),\n }\n ),\n control.label,\n control.count\n ? h(\n ElTag,\n {\n \"data-adapttable-part\": \"filters-count\",\n class: names.value.filtersCount,\n size: \"small\",\n round: true,\n },\n { default: () => control.count }\n )\n : null,\n ]\n ),\n Button: (control) =>\n elementButton(\n {\n \"data-adapttable-part\": control.part,\n class: {\n \"filters-clear\": names.value.filtersClear,\n \"filters-close\": names.value.filtersClose,\n \"filters-done\": names.value.filtersDone,\n }[control.part],\n disabled: control.disabled,\n onClick: control.onClick,\n },\n control.label\n ),\n Field: (field) =>\n h(ElementFilterField<unknown>, { ...field, classNames: names.value }),\n Tree: (tree) =>\n h(ElementFilterTree, { ...tree, classNames: names.value }),\n Popover: (surface) =>\n h(ElementFilterSurface, { ...surface, modal: false }),\n Drawer: (surface) =>\n h(ElementFilterSurface, {\n ...surface,\n modal: true,\n backdropClassName: names.value.filtersBackdrop,\n }),\n };\n return () =>\n model.value\n ? FilterPanelChrome({\n model: model.value,\n controls,\n classNames: names.value,\n })\n : null;\n },\n});\n","import type { FilterDef, TableFeature } from \"@adapttable/vue\";\nimport {\n ACTIVE_FILTER_CHIPS,\n extendFeature,\n slotRender,\n TOOLBAR_EXTRAS,\n} from \"@adapttable/vue/adapter\";\nimport {\n filters as bindingFilters,\n type FiltersOptions,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { ElementFilterChips } from \"./filters/ElementFilterChips\";\nimport { ElementFiltersPanel } from \"./filters/ElementFiltersPanel\";\n\nexport function filters<TRow>(\n defs: readonly FilterDef<TRow>[] = [],\n options: FiltersOptions = {}\n): TableFeature<TRow> {\n return extendFeature(bindingFilters(defs, options), [\n slotRender(TOOLBAR_EXTRAS, () => h(ElementFiltersPanel)),\n slotRender(ACTIVE_FILTER_CHIPS, (props) =>\n h(ElementFilterChips, { ...props })\n ),\n ]);\n}\n\nexport { ElementChecklistFilter as ChecklistFilter } from \"./filters/ElementChecklistFilter\";\nexport { default as FilterField } from \"./filters/ElementFilterField.vue\";\nexport { ElementFilterTree as FilterTreeBuilder } from \"./filters/ElementFilterTree\";\nexport type { FilterDef, FilterOption, FilterTypeSpec } from \"@adapttable/vue\";\nexport type {\n ChecklistFilterProps,\n FilterFieldOptions,\n FilterTreeBuilderProps,\n} from \"@adapttable/vue/adapter\";\nexport type { FiltersOptions } from \"@adapttable/vue/features\";\nexport { filterTypes } from \"@adapttable/vue/features\";\n"],"mappings":";;;;;;;;;AASA,MAAa,sBAAA,GAAqBA,IAAAA,gBAAAA,EAC/B,UAAsC;CACrC,MAAM,SAAA,GAAQC,wBAAAA,uBAAAA,CAAc;CAC5B,cAAA,GACEC,wBAAAA,kBAAAA,CAAkB;EAChB,GAAG;EACH,YAAY,MAAM;EAClB,OAAO;GACL,SAAS,EAAE,YAAYC,eAAAA,cAAc,OAAO,GAAG;GAC/C,QAAQ,EAAE,OAAO,YAAYA,eAAAA,cAAc,OAAO,KAAK;EACzD;CACF,CAAC;AACL,GACA;CACE,MAAM;CACN,OAAO;EACL,OAAO,EAAE,MAAM,MAAuD;EACtE,QAAQ,EACN,MAAM,OACR;EACA,YAAY,EACV,MAAM,SACR;CACF;AACF,CACF;;;ACTA,MAAM,WAAwC;CAC5C,SAAS,aAAA,GACPC,IAAAA,EAAAA,CACEC,aAAAA,YACA;EAAE,OAAO,QAAQ;EAAgB,wBAAwB;CAAe,GACxE;EACE,cAAA,GACED,IAAAA,EAAAA,CACEE,aAAAA,QACA;GACE,OAAO,QAAQ;GACf,wBAAwB;EAC1B,GACA,EAAE,eAAe,QAAQ,MAAM,CACjC;EACF,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AACH"}
|
package/dist/filters.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_filters = require("./filters-
|
|
3
|
-
const require_ElementFilterSurface = require("./ElementFilterSurface-
|
|
2
|
+
const require_filters = require("./filters-DOlxNQqE.cjs");
|
|
3
|
+
const require_ElementFilterSurface = require("./ElementFilterSurface-B8Fo3hPb.cjs");
|
|
4
4
|
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
5
5
|
exports.ChecklistFilter = require_ElementFilterSurface.ElementChecklistFilter;
|
|
6
6
|
exports.FilterField = require_ElementFilterSurface._sfc_main;
|
package/dist/filters.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as filters, r as ElementFilterTree, t as filterTypes } from "./filters-
|
|
2
|
-
import { n as _sfc_main, r as ElementChecklistFilter } from "./ElementFilterSurface-
|
|
1
|
+
import { n as filters, r as ElementFilterTree, t as filterTypes } from "./filters-C9_trRXw.js";
|
|
2
|
+
import { n as _sfc_main, r as ElementChecklistFilter } from "./ElementFilterSurface-BR_nBvZU.js";
|
|
3
3
|
export { ElementChecklistFilter as ChecklistFilter, _sfc_main as FilterField, ElementFilterTree as FilterTreeBuilder, filterTypes, filters };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as useClassNames } from "./classNamesContext-18Wbxy4F.js";
|
|
2
2
|
import { t as elementButton } from "./button-DwB4UxI2.js";
|
|
3
|
-
import { n as _sfc_main$1, t as ElementFilterSurface } from "./ElementFilterSurface-
|
|
3
|
+
import { n as _sfc_main$1, t as ElementFilterSurface } from "./ElementFilterSurface-BR_nBvZU.js";
|
|
4
4
|
import { createBlock, defineComponent, h, openBlock } from "vue";
|
|
5
5
|
import { HeaderFilterChrome, extendFeature, headerFilterSlotKey, mergeVueAttrs, slotRender, useHeaderFilter } from "@adapttable/vue/adapter";
|
|
6
6
|
import { headerFilters } from "@adapttable/vue/features";
|
|
@@ -64,4 +64,4 @@ function headerFilters$1() {
|
|
|
64
64
|
//#endregion
|
|
65
65
|
export { _sfc_main as n, headerFilters$1 as t };
|
|
66
66
|
|
|
67
|
-
//# sourceMappingURL=header-filters-
|
|
67
|
+
//# sourceMappingURL=header-filters-Chknfchw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-filters-
|
|
1
|
+
{"version":3,"file":"header-filters-Chknfchw.js","names":["headerFilters","bindingHeaderFilters","ElementHeaderFilter"],"sources":["../src/filters/ElementHeaderFilter.vue","../src/header-filters.ts"],"sourcesContent":["<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n HeaderFilterChrome,\n type HeaderFilterChromeSlots,\n type HeaderFilterOptions,\n mergeVueAttrs,\n useHeaderFilter,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\nimport ElementFilterField from \"./ElementFilterField.vue\";\nimport { ElementFilterSurface } from \"./ElementFilterSurface\";\n\ndefineOptions({ name: \"ElementHeaderFilter\" });\nconst props = withDefaults(defineProps<HeaderFilterOptions<TRow>>(), {\n closeOnSelect: undefined,\n});\nconst names = useClassNames();\nconst model = useHeaderFilter(() => props);\nconst controls: HeaderFilterChromeSlots<TRow> = {\n Trigger: (control) =>\n elementButton(\n mergeVueAttrs(control.attrs, {\n class: [\n names.value.filterHeaderButton,\n names.value.filterHeaderTrigger,\n ],\n ref: control.triggerRef,\n \"aria-label\": control.label,\n \"data-active\": control.count > 0 ? \"\" : undefined,\n onPointerdown: control.onPointerDown,\n onClick: control.onClick,\n }),\n control.label\n ),\n Field: (field) =>\n h(ElementFilterField<TRow>, { ...field, classNames: names.value }),\n Popover: (surface) =>\n h(ElementFilterSurface, {\n ...surface,\n modal: false,\n part: \"filter-header-cell\",\n }),\n};\nconst Render = () => HeaderFilterChrome({ model: model.value, controls });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n","import { type StaticTableFeature } from \"@adapttable/vue\";\nimport {\n extendFeature,\n headerFilterSlotKey,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { headerFilters as bindingHeaderFilters } from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport ElementHeaderFilter from \"./filters/ElementHeaderFilter.vue\";\n\n/** Element anchored column filters share the binding's lifecycle and field models. */\nexport function headerFilters(): StaticTableFeature {\n return extendFeature(bindingHeaderFilters(), [\n slotRender(headerFilterSlotKey<unknown>(), (props) =>\n h(ElementHeaderFilter, { ...props })\n ),\n ]);\n}\nexport { default as FilterHeaderControl } from \"./filters/ElementFilterHeaderControl.vue\";\nexport { default as FilterHeaderRow } from \"./filters/ElementFilterHeaderRow.vue\";\nexport { ElementHeaderFilter };\nexport type {\n FilterHeaderControlOptions,\n FilterHeaderControlProps,\n FilterHeaderRowProps,\n} from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ;EAGd,MAAM,QAAQ,cAAc;EAC5B,MAAM,QAAQ,sBAAsB,KAAK;EACzC,MAAM,WAA0C;GAC9C,UAAU,YACR,cACE,cAAc,QAAQ,OAAO;IAC3B,OAAO,CACL,MAAM,MAAM,oBACZ,MAAM,MAAM,mBACd;IACA,KAAK,QAAQ;IACb,cAAc,QAAQ;IACtB,eAAe,QAAQ,QAAQ,IAAI,KAAK,KAAA;IACxC,eAAe,QAAQ;IACvB,SAAS,QAAQ;GACnB,CAAC,GACD,QAAQ,KACV;GACF,QAAQ,UACN,EAAE,aAA0B;IAAE,GAAG;IAAO,YAAY,MAAM;GAAM,CAAC;GACnE,UAAU,YACR,EAAE,sBAAsB;IACtB,GAAG;IACH,OAAO;IACP,MAAM;GACR,CAAC;EACL;EACA,MAAM,eAAe,mBAAmB;GAAE,OAAO,MAAM;GAAO;EAAS,CAAC;EAExE,OAAO,QAAQ,CAAA;;GAGL,OAAA,UAAA,GAAA,YAAU,MAAA;;;;;;;ACvCpB,SAAgBA,kBAAoC;CAClD,OAAO,cAAcC,cAAqB,GAAG,CAC3C,WAAW,oBAA6B,IAAI,UAC1C,EAAEC,WAAqB,EAAE,GAAG,MAAM,CAAC,CACrC,CACF,CAAC;AACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_button = require("./button-BFjBL9m3.cjs");
|
|
2
|
-
const require_ElementFilterSurface = require("./ElementFilterSurface-
|
|
2
|
+
const require_ElementFilterSurface = require("./ElementFilterSurface-B8Fo3hPb.cjs");
|
|
3
3
|
let vue = require("vue");
|
|
4
4
|
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
5
5
|
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
@@ -74,4 +74,4 @@ Object.defineProperty(exports, "headerFilters", {
|
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
//# sourceMappingURL=header-filters-
|
|
77
|
+
//# sourceMappingURL=header-filters-D71v75Us.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-filters-
|
|
1
|
+
{"version":3,"file":"header-filters-D71v75Us.cjs","names":["extendFeature","bindingHeaderFilters","slotRender","headerFilterSlotKey","h","ElementHeaderFilter"],"sources":["../src/filters/ElementHeaderFilter.vue","../src/header-filters.ts"],"sourcesContent":["<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n HeaderFilterChrome,\n type HeaderFilterChromeSlots,\n type HeaderFilterOptions,\n mergeVueAttrs,\n useHeaderFilter,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\nimport ElementFilterField from \"./ElementFilterField.vue\";\nimport { ElementFilterSurface } from \"./ElementFilterSurface\";\n\ndefineOptions({ name: \"ElementHeaderFilter\" });\nconst props = withDefaults(defineProps<HeaderFilterOptions<TRow>>(), {\n closeOnSelect: undefined,\n});\nconst names = useClassNames();\nconst model = useHeaderFilter(() => props);\nconst controls: HeaderFilterChromeSlots<TRow> = {\n Trigger: (control) =>\n elementButton(\n mergeVueAttrs(control.attrs, {\n class: [\n names.value.filterHeaderButton,\n names.value.filterHeaderTrigger,\n ],\n ref: control.triggerRef,\n \"aria-label\": control.label,\n \"data-active\": control.count > 0 ? \"\" : undefined,\n onPointerdown: control.onPointerDown,\n onClick: control.onClick,\n }),\n control.label\n ),\n Field: (field) =>\n h(ElementFilterField<TRow>, { ...field, classNames: names.value }),\n Popover: (surface) =>\n h(ElementFilterSurface, {\n ...surface,\n modal: false,\n part: \"filter-header-cell\",\n }),\n};\nconst Render = () => HeaderFilterChrome({ model: model.value, controls });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n","import { type StaticTableFeature } from \"@adapttable/vue\";\nimport {\n extendFeature,\n headerFilterSlotKey,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { headerFilters as bindingHeaderFilters } from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport ElementHeaderFilter from \"./filters/ElementHeaderFilter.vue\";\n\n/** Element anchored column filters share the binding's lifecycle and field models. */\nexport function headerFilters(): StaticTableFeature {\n return extendFeature(bindingHeaderFilters(), [\n slotRender(headerFilterSlotKey<unknown>(), (props) =>\n h(ElementHeaderFilter, { ...props })\n ),\n ]);\n}\nexport { default as FilterHeaderControl } from \"./filters/ElementFilterHeaderControl.vue\";\nexport { default as FilterHeaderRow } from \"./filters/ElementFilterHeaderRow.vue\";\nexport { ElementHeaderFilter };\nexport type {\n FilterHeaderControlOptions,\n FilterHeaderControlProps,\n FilterHeaderRowProps,\n} from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ;EAGd,MAAM,SAAA,GAAQ,wBAAA,uBAAA,CAAc;EAC5B,MAAM,SAAA,GAAQ,wBAAA,gBAAA,OAAsB,KAAK;EACzC,MAAM,WAA0C;GAC9C,UAAU,YACR,eAAA,eAAA,GACE,wBAAA,cAAA,CAAc,QAAQ,OAAO;IAC3B,OAAO,CACL,MAAM,MAAM,oBACZ,MAAM,MAAM,mBACd;IACA,KAAK,QAAQ;IACb,cAAc,QAAQ;IACtB,eAAe,QAAQ,QAAQ,IAAI,KAAK,KAAA;IACxC,eAAe,QAAQ;IACvB,SAAS,QAAQ;GACnB,CAAC,GACD,QAAQ,KACV;GACF,QAAQ,WAAA,GACN,IAAA,EAAA,CAAE,6BAAA,WAA0B;IAAE,GAAG;IAAO,YAAY,MAAM;GAAM,CAAC;GACnE,UAAU,aAAA,GACR,IAAA,EAAA,CAAE,6BAAA,sBAAsB;IACtB,GAAG;IACH,OAAO;IACP,MAAM;GACR,CAAC;EACL;EACA,MAAM,gBAAA,GAAe,wBAAA,mBAAA,CAAmB;GAAE,OAAO,MAAM;GAAO;EAAS,CAAC;EAExE,OAAO,QAAQ,CAAA;;GAGL,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,CAAU,MAAA;;;;;;;ACvCpB,SAAgB,gBAAoC;CAClD,QAAA,GAAOA,wBAAAA,cAAAA,EAAAA,GAAcC,yBAAAA,cAAAA,CAAqB,GAAG,EAAA,GAC3CC,wBAAAA,WAAAA,EAAAA,GAAWC,wBAAAA,oBAAAA,CAA6B,IAAI,WAAA,GAC1CC,IAAAA,EAAAA,CAAEC,WAAqB,EAAE,GAAG,MAAM,CAAC,CACrC,CACF,CAAC;AACH"}
|
package/dist/header-filters.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_ElementFilterHeaderRow = require("./ElementFilterHeaderRow-CR1aax4I.cjs");
|
|
3
|
-
const require_header_filters = require("./header-filters-
|
|
3
|
+
const require_header_filters = require("./header-filters-D71v75Us.cjs");
|
|
4
4
|
exports.ElementHeaderFilter = require_header_filters._sfc_main;
|
|
5
5
|
exports.FilterHeaderControl = require_ElementFilterHeaderRow._sfc_main$1;
|
|
6
6
|
exports.FilterHeaderRow = require_ElementFilterHeaderRow._sfc_main;
|
package/dist/header-filters.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as _sfc_main$1, t as _sfc_main$2 } from "./ElementFilterHeaderRow-CjduRYN5.js";
|
|
2
|
-
import { n as _sfc_main, t as headerFilters } from "./header-filters-
|
|
2
|
+
import { n as _sfc_main, t as headerFilters } from "./header-filters-Chknfchw.js";
|
|
3
3
|
export { _sfc_main as ElementHeaderFilter, _sfc_main$1 as FilterHeaderControl, _sfc_main$2 as FilterHeaderRow, headerFilters };
|
package/dist/preset.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_density = require("./density-Bj1pck4x.cjs");
|
|
3
3
|
const require_fullscreen = require("./fullscreen.cjs");
|
|
4
|
-
const require_filters = require("./filters-
|
|
5
|
-
const require_header_filters = require("./header-filters-
|
|
4
|
+
const require_filters = require("./filters-DOlxNQqE.cjs");
|
|
5
|
+
const require_header_filters = require("./header-filters-D71v75Us.cjs");
|
|
6
6
|
const require_grouping = require("./grouping.cjs");
|
|
7
7
|
const require_find_in_table = require("./find-in-table-DOn2Hua1.cjs");
|
|
8
8
|
const require_status_bar = require("./status-bar-C-XuZg77.cjs");
|
|
9
9
|
const require_bulk_actions = require("./bulk-actions.cjs");
|
|
10
|
-
const require_column_menu = require("./column-menu-
|
|
10
|
+
const require_column_menu = require("./column-menu-CtaKQS3b.cjs");
|
|
11
11
|
const require_export = require("./export-CL36qPVY.cjs");
|
|
12
12
|
require("./fit-columns.cjs");
|
|
13
13
|
require("./multi-sort.cjs");
|
|
14
14
|
require("./resizable-columns.cjs");
|
|
15
|
-
const require_saved_views = require("./saved-views-
|
|
15
|
+
const require_saved_views = require("./saved-views-BTJxWOyY.cjs");
|
|
16
16
|
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
17
17
|
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
18
18
|
//#region src/preset.ts
|
package/dist/preset.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { t as densityChooser } from "./density-ChRp0NG3.js";
|
|
2
2
|
import { fullscreen } from "./fullscreen.js";
|
|
3
|
-
import { n as filters } from "./filters-
|
|
4
|
-
import { t as headerFilters } from "./header-filters-
|
|
3
|
+
import { n as filters } from "./filters-C9_trRXw.js";
|
|
4
|
+
import { t as headerFilters } from "./header-filters-Chknfchw.js";
|
|
5
5
|
import { grouping } from "./grouping.js";
|
|
6
6
|
import { t as findInTable } from "./find-in-table--8ZBYijC.js";
|
|
7
7
|
import { n as statusBar } from "./status-bar-DaWh0Agh.js";
|
|
8
8
|
import { bulkActions } from "./bulk-actions.js";
|
|
9
|
-
import { t as columnMenu } from "./column-menu-
|
|
9
|
+
import { t as columnMenu } from "./column-menu-C6gwlyUQ.js";
|
|
10
10
|
import { t as exportCsv } from "./export-DR1t4N5Q.js";
|
|
11
11
|
import { fitColumns } from "./fit-columns.js";
|
|
12
12
|
import { multiSort } from "./multi-sort.js";
|
|
13
13
|
import { resizableColumns } from "./resizable-columns.js";
|
|
14
|
-
import { n as savedViews } from "./saved-views-
|
|
14
|
+
import { n as savedViews } from "./saved-views-DW8WybwV.js";
|
|
15
15
|
import { standardFeatureList } from "@adapttable/vue/adapter";
|
|
16
16
|
//#region src/preset.ts
|
|
17
17
|
function standardFeatures(options = {}) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_button = require("./button-BFjBL9m3.cjs");
|
|
2
2
|
const require_ElementInput = require("./ElementInput-vBVDBaLp.cjs");
|
|
3
3
|
const require_ElementCard = require("./ElementCard-BRZekaHr.cjs");
|
|
4
|
-
const require_ElementColumnMenuPanel = require("./ElementColumnMenuPanel-
|
|
4
|
+
const require_ElementColumnMenuPanel = require("./ElementColumnMenuPanel-DavsUQAR.cjs");
|
|
5
5
|
let vue = require("vue");
|
|
6
6
|
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
7
7
|
let element_plus = require("element-plus");
|
|
@@ -143,4 +143,4 @@ Object.defineProperty(exports, "savedViews", {
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
|
|
146
|
-
//# sourceMappingURL=saved-views-
|
|
146
|
+
//# sourceMappingURL=saved-views-BTJxWOyY.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saved-views-DLiRBZ13.cjs","names":["elementButton","h","ElementInput","managedOverlayPanel","ElementColumnMenuPanel","ElementCard","ElTag","defineComponent","h","SavedViewsPanelChrome","extendFeature","bindingSavedViews","slotRender","SAVED_VIEWS_CONTROL","SavedViewsMenuChrome"],"sources":["../src/views/elementSavedViewsControls.ts","../src/saved-views.ts"],"sourcesContent":["import {\n managedOverlayPanel,\n type SavedViewsMenuSlots,\n type SavedViewsPanelSlots,\n} from \"@adapttable/vue/adapter\";\nimport { ElTag } from \"element-plus\";\nimport { h } from \"vue\";\n\nimport { ElementColumnMenuPanel } from \"../columns/ElementColumnMenuPanel\";\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport type { DataTableClassNames } from \"../types\";\nexport const elementSavedViewsMenuSlots: SavedViewsMenuSlots = {\n Trigger: ({ attrs, label }) => elementButton(attrs, label),\n Button: ({ attrs, label }) => elementButton(attrs, label),\n Input: ({ attrs, value, onChange }) =>\n h(ElementInput, { ...attrs, value, onChange }),\n Panel: managedOverlayPanel((control) =>\n h(ElementColumnMenuPanel, {\n control,\n initialFocus: 'input[data-adapttable-part=\"views-input\"]',\n })\n ),\n};\nexport function elementSavedViewsPanelSlots(\n names: () => DataTableClassNames\n): SavedViewsPanelSlots {\n return {\n Surface: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n \"data-adapttable-part\": props[\"data-adapttable-part\"],\n class: props.className,\n },\n },\n {\n default: () => [\n h(\n \"h2\",\n { \"data-adapttable-part\": \"saved-views-title\" },\n props.title\n ),\n props.children,\n props.footer\n ? h(\"span\", { \"data-adapttable-part\": \"saved-views-footer\" }, [\n props.footer,\n ])\n : null,\n ],\n }\n ),\n Row: (props) =>\n h(\n \"div\",\n {\n key: props.viewName,\n class: names().viewsRow,\n \"data-adapttable-part\": props[\"data-adapttable-part\"],\n style: props.layout.row,\n },\n [\n h(\n \"div\",\n {\n \"data-adapttable-part\": \"saved-view-caption\",\n style: props.layout.caption,\n },\n [\n props.isEditing\n ? props.name\n : elementButton(\n {\n type: \"button\",\n title: props.applyLabel,\n class: names().viewsItem,\n onClick: props.onApply,\n },\n [props.name]\n ),\n props.isDefault\n ? h(\n ElTag,\n { \"data-adapttable-part\": \"saved-view-default\" },\n { default: () => props.defaultLabel }\n )\n : null,\n props.readOnly\n ? h(\n ElTag,\n { \"data-adapttable-part\": \"saved-view-readonly\" },\n { default: () => props.readOnlyLabel }\n )\n : null,\n ]\n ),\n h(\n \"div\",\n {\n \"data-adapttable-part\": \"saved-view-controls\",\n style: props.layout.controls,\n },\n props.controls.map((control) =>\n elementButton(\n {\n key: control.key,\n type: \"button\",\n class: names().viewsDelete,\n title: control.label,\n \"aria-label\": control.label,\n \"aria-pressed\": control.pressed,\n disabled: !control.onPress,\n onClick: control.onPress,\n style: props.layout.control,\n },\n [control.icon]\n )\n )\n ),\n ]\n ),\n Input: (props) =>\n h(ElementInput, {\n inputRef: (element) => {\n if (element instanceof HTMLInputElement || element === null)\n props.ref(element);\n },\n class: names().viewsInput,\n \"aria-label\": props.label,\n value: props.value,\n onChange: props.onChange,\n onKeydown: (event: KeyboardEvent) => {\n if (event.isComposing) return;\n if (event.key === \"Enter\") {\n event.preventDefault();\n props.onCommit();\n }\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n props.onCancel();\n }\n },\n }),\n Empty: ({ message }) => h(\"p\", message),\n };\n}\n","import type { StaticTableFeature, UseSavedViewsOptions } from \"@adapttable/vue\";\nimport {\n extendFeature,\n SAVED_VIEWS_CONTROL,\n SavedViewsMenuChrome,\n SavedViewsPanelChrome,\n type SavedViewsPanelChromeProps,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { savedViews as bindingSavedViews } from \"@adapttable/vue/features\";\nimport { defineComponent, h, type MaybeRefOrGetter, type PropType } from \"vue\";\n\nimport type { DataTableClassNames } from \"./types\";\nimport {\n elementSavedViewsMenuSlots,\n elementSavedViewsPanelSlots,\n} from \"./views/elementSavedViewsControls\";\n\nexport type { DataTableClassNames } from \"./types\";\nexport type {\n SavedView,\n SavedViewsStore,\n UseSavedViewsOptions,\n} from \"@adapttable/vue\";\nexport interface SavedViewsPanelProps extends Omit<\n SavedViewsPanelChromeProps,\n \"slots\"\n> {\n readonly classNames?: DataTableClassNames;\n}\n\n/** Element Plus management surface over the binding's rename and ordering model. */\nexport const SavedViewsPanel = defineComponent(\n (props: SavedViewsPanelProps) => {\n const slots = elementSavedViewsPanelSlots(() => props.classNames ?? {});\n return () => {\n const { classNames, ...panelProps } = props;\n return h(SavedViewsPanelChrome, {\n ...panelProps,\n className: [props.className, classNames?.viewsPanel]\n .filter(Boolean)\n .join(\" \"),\n slots,\n });\n };\n },\n {\n name: \"SavedViewsPanel\",\n props: {\n views: { type: Array as PropType<SavedViewsPanelProps[\"views\"]> },\n onApply: { type: Function as PropType<SavedViewsPanelProps[\"onApply\"]> },\n onRename: {\n type: Function as PropType<SavedViewsPanelProps[\"onRename\"]>,\n },\n onMove: { type: Function as PropType<SavedViewsPanelProps[\"onMove\"]> },\n onSetDefault: {\n type: Function as PropType<SavedViewsPanelProps[\"onSetDefault\"]>,\n },\n onRemove: {\n type: Function as PropType<SavedViewsPanelProps[\"onRemove\"]>,\n },\n labels: { type: Object as PropType<SavedViewsPanelProps[\"labels\"]> },\n footer: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n SavedViewsPanelProps[\"footer\"]\n >,\n default: undefined,\n },\n className: {\n type: String as PropType<SavedViewsPanelProps[\"className\"]>,\n },\n classNames: {\n type: Object as PropType<SavedViewsPanelProps[\"classNames\"]>,\n },\n },\n }\n);\n\n/** The table creates the saved-view model once; this fill only renders it. */\nexport function savedViews(\n options: MaybeRefOrGetter<UseSavedViewsOptions>\n): StaticTableFeature {\n return extendFeature(bindingSavedViews(options), [\n slotRender(SAVED_VIEWS_CONTROL, (props) =>\n h(SavedViewsMenuChrome, { ...props, slots: elementSavedViewsMenuSlots })\n ),\n ]);\n}\n"],"mappings":";;;;;;;;;AAaA,MAAa,6BAAkD;CAC7D,UAAU,EAAE,OAAO,YAAYA,eAAAA,cAAc,OAAO,KAAK;CACzD,SAAS,EAAE,OAAO,YAAYA,eAAAA,cAAc,OAAO,KAAK;CACxD,QAAQ,EAAE,OAAO,OAAO,gBAAA,GACtBC,IAAAA,EAAAA,CAAEC,qBAAAA,WAAc;EAAE,GAAG;EAAO;EAAO;CAAS,CAAC;CAC/C,QAAA,GAAOC,wBAAAA,oBAAAA,EAAqB,aAAA,GAC1BF,IAAAA,EAAAA,CAAEG,+BAAAA,wBAAwB;EACxB;EACA,cAAc;CAChB,CAAC,CACH;AACF;AACA,SAAgB,4BACd,OACsB;CACtB,OAAO;EACL,UAAU,WAAA,GACRH,IAAAA,EAAAA,CACEI,oBAAAA,aACA,EACE,OAAO;GACL,wBAAwB,MAAM;GAC9B,OAAO,MAAM;EACf,EACF,GACA,EACE,eAAe;IACbJ,GAAAA,IAAAA,EAAAA,CACE,MACA,EAAE,wBAAwB,oBAAoB,GAC9C,MAAM,KACR;GACA,MAAM;GACN,MAAM,UAAA,GACFA,IAAAA,EAAAA,CAAE,QAAQ,EAAE,wBAAwB,qBAAqB,GAAG,CAC1D,MAAM,MACR,CAAC,IACD;EACN,EACF,CACF;EACF,MAAM,WAAA,GACJA,IAAAA,EAAAA,CACE,OACA;GACE,KAAK,MAAM;GACX,OAAO,MAAM,CAAC,CAAC;GACf,wBAAwB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","names":["elementButton","h","ElementInput","managedOverlayPanel","ElementColumnMenuPanel","ElementCard","ElTag","defineComponent","h","SavedViewsPanelChrome","extendFeature","bindingSavedViews","slotRender","SAVED_VIEWS_CONTROL","SavedViewsMenuChrome"],"sources":["../src/views/elementSavedViewsControls.ts","../src/saved-views.ts"],"sourcesContent":["import {\n managedOverlayPanel,\n type SavedViewsMenuSlots,\n type SavedViewsPanelSlots,\n} from \"@adapttable/vue/adapter\";\nimport { ElTag } from \"element-plus\";\nimport { h } from \"vue\";\n\nimport { ElementColumnMenuPanel } from \"../columns/ElementColumnMenuPanel\";\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport type { DataTableClassNames } from \"../types\";\nexport const elementSavedViewsMenuSlots: SavedViewsMenuSlots = {\n Trigger: ({ attrs, label }) => elementButton(attrs, label),\n Button: ({ attrs, label }) => elementButton(attrs, label),\n Input: ({ attrs, value, onChange }) =>\n h(ElementInput, { ...attrs, value, onChange }),\n Panel: managedOverlayPanel((control) =>\n h(ElementColumnMenuPanel, {\n control,\n initialFocus: 'input[data-adapttable-part=\"views-input\"]',\n })\n ),\n};\nexport function elementSavedViewsPanelSlots(\n names: () => DataTableClassNames\n): SavedViewsPanelSlots {\n return {\n Surface: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n \"data-adapttable-part\": props[\"data-adapttable-part\"],\n class: props.className,\n },\n },\n {\n default: () => [\n h(\n \"h2\",\n { \"data-adapttable-part\": \"saved-views-title\" },\n props.title\n ),\n props.children,\n props.footer\n ? h(\"span\", { \"data-adapttable-part\": \"saved-views-footer\" }, [\n props.footer,\n ])\n : null,\n ],\n }\n ),\n Row: (props) =>\n h(\n \"div\",\n {\n key: props.viewName,\n class: names().viewsRow,\n \"data-adapttable-part\": props[\"data-adapttable-part\"],\n style: props.layout.row,\n },\n [\n h(\n \"div\",\n {\n \"data-adapttable-part\": \"saved-view-caption\",\n style: props.layout.caption,\n },\n [\n props.isEditing\n ? props.name\n : elementButton(\n {\n type: \"button\",\n title: props.applyLabel,\n class: names().viewsItem,\n onClick: props.onApply,\n },\n [props.name]\n ),\n props.isDefault\n ? h(\n ElTag,\n { \"data-adapttable-part\": \"saved-view-default\" },\n { default: () => props.defaultLabel }\n )\n : null,\n props.readOnly\n ? h(\n ElTag,\n { \"data-adapttable-part\": \"saved-view-readonly\" },\n { default: () => props.readOnlyLabel }\n )\n : null,\n ]\n ),\n h(\n \"div\",\n {\n \"data-adapttable-part\": \"saved-view-controls\",\n style: props.layout.controls,\n },\n props.controls.map((control) =>\n elementButton(\n {\n key: control.key,\n type: \"button\",\n class: names().viewsDelete,\n title: control.label,\n \"aria-label\": control.label,\n \"aria-pressed\": control.pressed,\n disabled: !control.onPress,\n onClick: control.onPress,\n style: props.layout.control,\n },\n [control.icon]\n )\n )\n ),\n ]\n ),\n Input: (props) =>\n h(ElementInput, {\n inputRef: (element) => {\n if (element instanceof HTMLInputElement || element === null)\n props.ref(element);\n },\n class: names().viewsInput,\n \"aria-label\": props.label,\n value: props.value,\n onChange: props.onChange,\n onKeydown: (event: KeyboardEvent) => {\n if (event.isComposing) return;\n if (event.key === \"Enter\") {\n event.preventDefault();\n props.onCommit();\n }\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n props.onCancel();\n }\n },\n }),\n Empty: ({ message }) => h(\"p\", message),\n };\n}\n","import type { StaticTableFeature, UseSavedViewsOptions } from \"@adapttable/vue\";\nimport {\n extendFeature,\n SAVED_VIEWS_CONTROL,\n SavedViewsMenuChrome,\n SavedViewsPanelChrome,\n type SavedViewsPanelChromeProps,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { savedViews as bindingSavedViews } from \"@adapttable/vue/features\";\nimport { defineComponent, h, type MaybeRefOrGetter, type PropType } from \"vue\";\n\nimport type { DataTableClassNames } from \"./types\";\nimport {\n elementSavedViewsMenuSlots,\n elementSavedViewsPanelSlots,\n} from \"./views/elementSavedViewsControls\";\n\nexport type { DataTableClassNames } from \"./types\";\nexport type {\n SavedView,\n SavedViewsStore,\n UseSavedViewsOptions,\n} from \"@adapttable/vue\";\nexport interface SavedViewsPanelProps extends Omit<\n SavedViewsPanelChromeProps,\n \"slots\"\n> {\n readonly classNames?: DataTableClassNames;\n}\n\n/** Element Plus management surface over the binding's rename and ordering model. */\nexport const SavedViewsPanel = defineComponent(\n (props: SavedViewsPanelProps) => {\n const slots = elementSavedViewsPanelSlots(() => props.classNames ?? {});\n return () => {\n const { classNames, ...panelProps } = props;\n return h(SavedViewsPanelChrome, {\n ...panelProps,\n className: [props.className, classNames?.viewsPanel]\n .filter(Boolean)\n .join(\" \"),\n slots,\n });\n };\n },\n {\n name: \"SavedViewsPanel\",\n props: {\n views: { type: Array as PropType<SavedViewsPanelProps[\"views\"]> },\n onApply: { type: Function as PropType<SavedViewsPanelProps[\"onApply\"]> },\n onRename: {\n type: Function as PropType<SavedViewsPanelProps[\"onRename\"]>,\n },\n onMove: { type: Function as PropType<SavedViewsPanelProps[\"onMove\"]> },\n onSetDefault: {\n type: Function as PropType<SavedViewsPanelProps[\"onSetDefault\"]>,\n },\n onRemove: {\n type: Function as PropType<SavedViewsPanelProps[\"onRemove\"]>,\n },\n labels: { type: Object as PropType<SavedViewsPanelProps[\"labels\"]> },\n footer: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n SavedViewsPanelProps[\"footer\"]\n >,\n default: undefined,\n },\n className: {\n type: String as PropType<SavedViewsPanelProps[\"className\"]>,\n },\n classNames: {\n type: Object as PropType<SavedViewsPanelProps[\"classNames\"]>,\n },\n },\n }\n);\n\n/** The table creates the saved-view model once; this fill only renders it. */\nexport function savedViews(\n options: MaybeRefOrGetter<UseSavedViewsOptions>\n): StaticTableFeature {\n return extendFeature(bindingSavedViews(options), [\n slotRender(SAVED_VIEWS_CONTROL, (props) =>\n h(SavedViewsMenuChrome, { ...props, slots: elementSavedViewsMenuSlots })\n ),\n ]);\n}\n"],"mappings":";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,GAAOC,IAAAA,EAAAA,CAAEC,wBAAAA,uBAAuB;GAC9B,GAAG;GACH,WAAW,CAAC,MAAM,WAAW,YAAY,UAAU,CAAC,CACjD,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;GACX;EACF,CAAC;CACH;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,OAAO,EAAE,MAAM,MAAiD;EAChE,SAAS,EAAE,MAAM,SAAsD;EACvE,UAAU,EACR,MAAM,SACR;EACA,QAAQ,EAAE,MAAM,SAAqD;EACrE,cAAc,EACZ,MAAM,SACR;EACA,UAAU,EACR,MAAM,SACR;EACA,QAAQ,EAAE,MAAM,OAAmD;EACnE,QAAQ;GACN,MAAM;IAAC;IAAQ;IAAQ;IAAS;IAAO;GAAM;GAG7C,SAAS,KAAA;EACX;EACA,WAAW,EACT,MAAM,OACR;EACA,YAAY,EACV,MAAM,OACR;CACF;AACF,CACF;;AAGA,SAAgB,WACd,SACoB;CACpB,QAAA,GAAOC,wBAAAA,cAAAA,EAAAA,GAAcC,yBAAAA,WAAAA,CAAkB,OAAO,GAAG,EAAA,GAC/CC,wBAAAA,WAAAA,CAAWC,wBAAAA,sBAAsB,WAAA,GAC/BL,IAAAA,EAAAA,CAAEM,wBAAAA,sBAAsB;EAAE,GAAG;EAAO,OAAO;CAA2B,CAAC,CACzE,CACF,CAAC;AACH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as elementButton } from "./button-DwB4UxI2.js";
|
|
2
2
|
import { t as _sfc_main } from "./ElementInput-BsoAvPfO.js";
|
|
3
3
|
import { t as ElementCard } from "./ElementCard-DZdAU6x8.js";
|
|
4
|
-
import { t as ElementColumnMenuPanel } from "./ElementColumnMenuPanel-
|
|
4
|
+
import { t as ElementColumnMenuPanel } from "./ElementColumnMenuPanel-D9oWJf02.js";
|
|
5
5
|
import { defineComponent, h } from "vue";
|
|
6
6
|
import { SAVED_VIEWS_CONTROL, SavedViewsMenuChrome, SavedViewsPanelChrome, extendFeature, managedOverlayPanel, slotRender } from "@adapttable/vue/adapter";
|
|
7
7
|
import { ElTag } from "element-plus";
|
|
@@ -132,4 +132,4 @@ function savedViews$1(options) {
|
|
|
132
132
|
//#endregion
|
|
133
133
|
export { savedViews$1 as n, SavedViewsPanel as t };
|
|
134
134
|
|
|
135
|
-
//# sourceMappingURL=saved-views-
|
|
135
|
+
//# sourceMappingURL=saved-views-DW8WybwV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saved-views-BtC15-kG.js","names":["ElementInput","savedViews","bindingSavedViews"],"sources":["../src/views/elementSavedViewsControls.ts","../src/saved-views.ts"],"sourcesContent":["import {\n managedOverlayPanel,\n type SavedViewsMenuSlots,\n type SavedViewsPanelSlots,\n} from \"@adapttable/vue/adapter\";\nimport { ElTag } from \"element-plus\";\nimport { h } from \"vue\";\n\nimport { ElementColumnMenuPanel } from \"../columns/ElementColumnMenuPanel\";\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport type { DataTableClassNames } from \"../types\";\nexport const elementSavedViewsMenuSlots: SavedViewsMenuSlots = {\n Trigger: ({ attrs, label }) => elementButton(attrs, label),\n Button: ({ attrs, label }) => elementButton(attrs, label),\n Input: ({ attrs, value, onChange }) =>\n h(ElementInput, { ...attrs, value, onChange }),\n Panel: managedOverlayPanel((control) =>\n h(ElementColumnMenuPanel, {\n control,\n initialFocus: 'input[data-adapttable-part=\"views-input\"]',\n })\n ),\n};\nexport function elementSavedViewsPanelSlots(\n names: () => DataTableClassNames\n): SavedViewsPanelSlots {\n return {\n Surface: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n \"data-adapttable-part\": props[\"data-adapttable-part\"],\n class: props.className,\n },\n },\n {\n default: () => [\n h(\n \"h2\",\n { \"data-adapttable-part\": \"saved-views-title\" },\n props.title\n ),\n props.children,\n props.footer\n ? h(\"span\", { \"data-adapttable-part\": \"saved-views-footer\" }, [\n props.footer,\n ])\n : null,\n ],\n }\n ),\n Row: (props) =>\n h(\n \"div\",\n {\n key: props.viewName,\n class: names().viewsRow,\n \"data-adapttable-part\": props[\"data-adapttable-part\"],\n style: props.layout.row,\n },\n [\n h(\n \"div\",\n {\n \"data-adapttable-part\": \"saved-view-caption\",\n style: props.layout.caption,\n },\n [\n props.isEditing\n ? props.name\n : elementButton(\n {\n type: \"button\",\n title: props.applyLabel,\n class: names().viewsItem,\n onClick: props.onApply,\n },\n [props.name]\n ),\n props.isDefault\n ? h(\n ElTag,\n { \"data-adapttable-part\": \"saved-view-default\" },\n { default: () => props.defaultLabel }\n )\n : null,\n props.readOnly\n ? h(\n ElTag,\n { \"data-adapttable-part\": \"saved-view-readonly\" },\n { default: () => props.readOnlyLabel }\n )\n : null,\n ]\n ),\n h(\n \"div\",\n {\n \"data-adapttable-part\": \"saved-view-controls\",\n style: props.layout.controls,\n },\n props.controls.map((control) =>\n elementButton(\n {\n key: control.key,\n type: \"button\",\n class: names().viewsDelete,\n title: control.label,\n \"aria-label\": control.label,\n \"aria-pressed\": control.pressed,\n disabled: !control.onPress,\n onClick: control.onPress,\n style: props.layout.control,\n },\n [control.icon]\n )\n )\n ),\n ]\n ),\n Input: (props) =>\n h(ElementInput, {\n inputRef: (element) => {\n if (element instanceof HTMLInputElement || element === null)\n props.ref(element);\n },\n class: names().viewsInput,\n \"aria-label\": props.label,\n value: props.value,\n onChange: props.onChange,\n onKeydown: (event: KeyboardEvent) => {\n if (event.isComposing) return;\n if (event.key === \"Enter\") {\n event.preventDefault();\n props.onCommit();\n }\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n props.onCancel();\n }\n },\n }),\n Empty: ({ message }) => h(\"p\", message),\n };\n}\n","import type { StaticTableFeature, UseSavedViewsOptions } from \"@adapttable/vue\";\nimport {\n extendFeature,\n SAVED_VIEWS_CONTROL,\n SavedViewsMenuChrome,\n SavedViewsPanelChrome,\n type SavedViewsPanelChromeProps,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { savedViews as bindingSavedViews } from \"@adapttable/vue/features\";\nimport { defineComponent, h, type MaybeRefOrGetter, type PropType } from \"vue\";\n\nimport type { DataTableClassNames } from \"./types\";\nimport {\n elementSavedViewsMenuSlots,\n elementSavedViewsPanelSlots,\n} from \"./views/elementSavedViewsControls\";\n\nexport type { DataTableClassNames } from \"./types\";\nexport type {\n SavedView,\n SavedViewsStore,\n UseSavedViewsOptions,\n} from \"@adapttable/vue\";\nexport interface SavedViewsPanelProps extends Omit<\n SavedViewsPanelChromeProps,\n \"slots\"\n> {\n readonly classNames?: DataTableClassNames;\n}\n\n/** Element Plus management surface over the binding's rename and ordering model. */\nexport const SavedViewsPanel = defineComponent(\n (props: SavedViewsPanelProps) => {\n const slots = elementSavedViewsPanelSlots(() => props.classNames ?? {});\n return () => {\n const { classNames, ...panelProps } = props;\n return h(SavedViewsPanelChrome, {\n ...panelProps,\n className: [props.className, classNames?.viewsPanel]\n .filter(Boolean)\n .join(\" \"),\n slots,\n });\n };\n },\n {\n name: \"SavedViewsPanel\",\n props: {\n views: { type: Array as PropType<SavedViewsPanelProps[\"views\"]> },\n onApply: { type: Function as PropType<SavedViewsPanelProps[\"onApply\"]> },\n onRename: {\n type: Function as PropType<SavedViewsPanelProps[\"onRename\"]>,\n },\n onMove: { type: Function as PropType<SavedViewsPanelProps[\"onMove\"]> },\n onSetDefault: {\n type: Function as PropType<SavedViewsPanelProps[\"onSetDefault\"]>,\n },\n onRemove: {\n type: Function as PropType<SavedViewsPanelProps[\"onRemove\"]>,\n },\n labels: { type: Object as PropType<SavedViewsPanelProps[\"labels\"]> },\n footer: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n SavedViewsPanelProps[\"footer\"]\n >,\n default: undefined,\n },\n className: {\n type: String as PropType<SavedViewsPanelProps[\"className\"]>,\n },\n classNames: {\n type: Object as PropType<SavedViewsPanelProps[\"classNames\"]>,\n },\n },\n }\n);\n\n/** The table creates the saved-view model once; this fill only renders it. */\nexport function savedViews(\n options: MaybeRefOrGetter<UseSavedViewsOptions>\n): StaticTableFeature {\n return extendFeature(bindingSavedViews(options), [\n slotRender(SAVED_VIEWS_CONTROL, (props) =>\n h(SavedViewsMenuChrome, { ...props, slots: elementSavedViewsMenuSlots })\n ),\n ]);\n}\n"],"mappings":";;;;;;;;;AAaA,MAAa,6BAAkD;CAC7D,UAAU,EAAE,OAAO,YAAY,cAAc,OAAO,KAAK;CACzD,SAAS,EAAE,OAAO,YAAY,cAAc,OAAO,KAAK;CACxD,QAAQ,EAAE,OAAO,OAAO,eACtB,EAAEA,WAAc;EAAE,GAAG;EAAO;EAAO;CAAS,CAAC;CAC/C,OAAO,qBAAqB,YAC1B,EAAE,wBAAwB;EACxB;EACA,cAAc;CAChB,CAAC,CACH;AACF;AACA,SAAgB,4BACd,OACsB;CACtB,OAAO;EACL,UAAU,UACR,EACE,aACA,EACE,OAAO;GACL,wBAAwB,MAAM;GAC9B,OAAO,MAAM;EACf,EACF,GACA,EACE,eAAe;GACb,EACE,MACA,EAAE,wBAAwB,oBAAoB,GAC9C,MAAM,KACR;GACA,MAAM;GACN,MAAM,SACF,EAAE,QAAQ,EAAE,wBAAwB,qBAAqB,GAAG,CAC1D,MAAM,MACR,CAAC,IACD;EACN,EACF,CACF;EACF,MAAM,UACJ,EACE,OACA;GACE,KAAK,MAAM;GACX,OAAO,MAAM,CAAC,CAAC;GACf,wBAAwB,MAAM;GAC9B,OAAO,MAAM,OAAO;EACtB,GACA,CACE,EACE,OACA;GACE,wBAAwB;GACxB,OAAO,MAAM,OAAO;EACtB,GACA;GACE,MAAM,YACF,MAAM,OACN,cACE;IACE,MAAM;IACN,OAAO,MAAM;IACb,OAAO,MAAM,CAAC,CAAC;IACf,SAAS,MAAM;GACjB,GACA,CAAC,MAAM,IAAI,CACb;GACJ,MAAM,YACF,EACE,OACA,EAAE,wBAAwB,qBAAqB,GAC/C,EAAE,eAAe,MAAM,aAAa,CACtC,IACA;GACJ,MAA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M,MAAiD;EAChE,SAAS,EAAE,MAAM,SAAsD;EACvE,UAAU,EACR,MAAM,SACR;EACA,QAAQ,EAAE,MAAM,SAAqD;EACrE,cAAc,EACZ,MAAM,SACR;EACA,UAAU,EACR,MAAM,SACR;EACA,QAAQ,EAAE,MAAM,OAAmD;EACnE,QAAQ;GACN,MAAM;IAAC;IAAQ;IAAQ;IAAS;IAAO;GAAM;GAG7C,SAAS,KAAA;EACX;EACA,WAAW,EACT,MAAM,OACR;EACA,YAAY,EACV,MAAM,OACR;CACF;AACF,CACF;;AAGA,SAAgBC,aACd,SACoB;CACpB,OAAO,cAAcC,WAAkB,OAAO,GAAG,CAC/C,WAAW,sBAAsB,UAC/B,EAAE,sBAAsB;EAAE,GAAG;EAAO,OAAO;CAA2B,CAAC,CACzE,CACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"saved-views-DW8WybwV.js","names":["ElementInput","savedViews","bindingSavedViews"],"sources":["../src/views/elementSavedViewsControls.ts","../src/saved-views.ts"],"sourcesContent":["import {\n managedOverlayPanel,\n type SavedViewsMenuSlots,\n type SavedViewsPanelSlots,\n} from \"@adapttable/vue/adapter\";\nimport { ElTag } from \"element-plus\";\nimport { h } from \"vue\";\n\nimport { ElementColumnMenuPanel } from \"../columns/ElementColumnMenuPanel\";\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport type { DataTableClassNames } from \"../types\";\nexport const elementSavedViewsMenuSlots: SavedViewsMenuSlots = {\n Trigger: ({ attrs, label }) => elementButton(attrs, label),\n Button: ({ attrs, label }) => elementButton(attrs, label),\n Input: ({ attrs, value, onChange }) =>\n h(ElementInput, { ...attrs, value, onChange }),\n Panel: managedOverlayPanel((control) =>\n h(ElementColumnMenuPanel, {\n control,\n initialFocus: 'input[data-adapttable-part=\"views-input\"]',\n })\n ),\n};\nexport function elementSavedViewsPanelSlots(\n names: () => DataTableClassNames\n): SavedViewsPanelSlots {\n return {\n Surface: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n \"data-adapttable-part\": props[\"data-adapttable-part\"],\n class: props.className,\n },\n },\n {\n default: () => [\n h(\n \"h2\",\n { \"data-adapttable-part\": \"saved-views-title\" },\n props.title\n ),\n props.children,\n props.footer\n ? h(\"span\", { \"data-adapttable-part\": \"saved-views-footer\" }, [\n props.footer,\n ])\n : null,\n ],\n }\n ),\n Row: (props) =>\n h(\n \"div\",\n {\n key: props.viewName,\n class: names().viewsRow,\n \"data-adapttable-part\": props[\"data-adapttable-part\"],\n style: props.layout.row,\n },\n [\n h(\n \"div\",\n {\n \"data-adapttable-part\": \"saved-view-caption\",\n style: props.layout.caption,\n },\n [\n props.isEditing\n ? props.name\n : elementButton(\n {\n type: \"button\",\n title: props.applyLabel,\n class: names().viewsItem,\n onClick: props.onApply,\n },\n [props.name]\n ),\n props.isDefault\n ? h(\n ElTag,\n { \"data-adapttable-part\": \"saved-view-default\" },\n { default: () => props.defaultLabel }\n )\n : null,\n props.readOnly\n ? h(\n ElTag,\n { \"data-adapttable-part\": \"saved-view-readonly\" },\n { default: () => props.readOnlyLabel }\n )\n : null,\n ]\n ),\n h(\n \"div\",\n {\n \"data-adapttable-part\": \"saved-view-controls\",\n style: props.layout.controls,\n },\n props.controls.map((control) =>\n elementButton(\n {\n key: control.key,\n type: \"button\",\n class: names().viewsDelete,\n title: control.label,\n \"aria-label\": control.label,\n \"aria-pressed\": control.pressed,\n disabled: !control.onPress,\n onClick: control.onPress,\n style: props.layout.control,\n },\n [control.icon]\n )\n )\n ),\n ]\n ),\n Input: (props) =>\n h(ElementInput, {\n inputRef: (element) => {\n if (element instanceof HTMLInputElement || element === null)\n props.ref(element);\n },\n class: names().viewsInput,\n \"aria-label\": props.label,\n value: props.value,\n onChange: props.onChange,\n onKeydown: (event: KeyboardEvent) => {\n if (event.isComposing) return;\n if (event.key === \"Enter\") {\n event.preventDefault();\n props.onCommit();\n }\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n props.onCancel();\n }\n },\n }),\n Empty: ({ message }) => h(\"p\", message),\n };\n}\n","import type { StaticTableFeature, UseSavedViewsOptions } from \"@adapttable/vue\";\nimport {\n extendFeature,\n SAVED_VIEWS_CONTROL,\n SavedViewsMenuChrome,\n SavedViewsPanelChrome,\n type SavedViewsPanelChromeProps,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { savedViews as bindingSavedViews } from \"@adapttable/vue/features\";\nimport { defineComponent, h, type MaybeRefOrGetter, type PropType } from \"vue\";\n\nimport type { DataTableClassNames } from \"./types\";\nimport {\n elementSavedViewsMenuSlots,\n elementSavedViewsPanelSlots,\n} from \"./views/elementSavedViewsControls\";\n\nexport type { DataTableClassNames } from \"./types\";\nexport type {\n SavedView,\n SavedViewsStore,\n UseSavedViewsOptions,\n} from \"@adapttable/vue\";\nexport interface SavedViewsPanelProps extends Omit<\n SavedViewsPanelChromeProps,\n \"slots\"\n> {\n readonly classNames?: DataTableClassNames;\n}\n\n/** Element Plus management surface over the binding's rename and ordering model. */\nexport const SavedViewsPanel = defineComponent(\n (props: SavedViewsPanelProps) => {\n const slots = elementSavedViewsPanelSlots(() => props.classNames ?? {});\n return () => {\n const { classNames, ...panelProps } = props;\n return h(SavedViewsPanelChrome, {\n ...panelProps,\n className: [props.className, classNames?.viewsPanel]\n .filter(Boolean)\n .join(\" \"),\n slots,\n });\n };\n },\n {\n name: \"SavedViewsPanel\",\n props: {\n views: { type: Array as PropType<SavedViewsPanelProps[\"views\"]> },\n onApply: { type: Function as PropType<SavedViewsPanelProps[\"onApply\"]> },\n onRename: {\n type: Function as PropType<SavedViewsPanelProps[\"onRename\"]>,\n },\n onMove: { type: Function as PropType<SavedViewsPanelProps[\"onMove\"]> },\n onSetDefault: {\n type: Function as PropType<SavedViewsPanelProps[\"onSetDefault\"]>,\n },\n onRemove: {\n type: Function as PropType<SavedViewsPanelProps[\"onRemove\"]>,\n },\n labels: { type: Object as PropType<SavedViewsPanelProps[\"labels\"]> },\n footer: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n SavedViewsPanelProps[\"footer\"]\n >,\n default: undefined,\n },\n className: {\n type: String as PropType<SavedViewsPanelProps[\"className\"]>,\n },\n classNames: {\n type: Object as PropType<SavedViewsPanelProps[\"classNames\"]>,\n },\n },\n }\n);\n\n/** The table creates the saved-view model once; this fill only renders it. */\nexport function savedViews(\n options: MaybeRefOrGetter<UseSavedViewsOptions>\n): StaticTableFeature {\n return extendFeature(bindingSavedViews(options), [\n slotRender(SAVED_VIEWS_CONTROL, (props) =>\n h(SavedViewsMenuChrome, { ...props, slots: elementSavedViewsMenuSlots })\n ),\n ]);\n}\n"],"mappings":";;;;;;;;;AAaA,MAAa,6BAAkD;CAC7D,UAAU,EAAE,OAAO,YAAY,cAAc,OAAO,KAAK;CACzD,SAAS,EAAE,OAAO,YAAY,cAAc,OAAO,KAAK;CACxD,QAAQ,EAAE,OAAO,OAAO,eACtB,EAAEA,WAAc;EAAE,GAAG;EAAO;EAAO;CAAS,CAAC;CAC/C,OAAO,qBAAqB,YAC1B,EAAE,wBAAwB;EACxB;EACA,cAAc;CAChB,CAAC,CACH;AACF;AACA,SAAgB,4BACd,OACsB;CACtB,OAAO;EACL,UAAU,UACR,EACE,aACA,EACE,OAAO;GACL,wBAAwB,MAAM;GAC9B,OAAO,MAAM;EACf,EACF,GACA,EACE,eAAe;GACb,EACE,MACA,EAAE,wBAAwB,oBAAoB,GAC9C,MAAM,KACR;GACA,MAAM;GACN,MAAM,SACF,EAAE,QAAQ,EAAE,wBAAwB,qBAAqB,GAAG,CAC1D,MAAM,MACR,CAAC,IACD;EACN,EACF,CACF;EACF,MAAM,UACJ,EACE,OACA;GACE,KAAK,MAAM;GACX,OAAO,MAAM,CAAC,CAAC;GACf,wBAAwB,MAAM;GAC9B,OAAO,MAAM,OAAO;EACtB,GACA,CACE,EACE,OACA;GACE,wBAAwB;GACxB,OAAO,MAAM,OAAO;EACtB,GACA;GACE,MAAM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MAAM,EAAE,YAAY,GAAG,eAAe;EACtC,OAAO,EAAE,uBAAuB;GAC9B,GAAG;GACH,WAAW,CAAC,MAAM,WAAW,YAAY,UAAU,CAAC,CACjD,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;GACX;EACF,CAAC;CACH;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,OAAO,EAAE,MAAM,MAAiD;EAChE,SAAS,EAAE,MAAM,SAAsD;EACvE,UAAU,EACR,MAAM,SACR;EACA,QAAQ,EAAE,MAAM,SAAqD;EACrE,cAAc,EACZ,MAAM,SACR;EACA,UAAU,EACR,MAAM,SACR;EACA,QAAQ,EAAE,MAAM,OAAmD;EACnE,QAAQ;GACN,MAAM;IAAC;IAAQ;IAAQ;IAAS;IAAO;GAAM;GAG7C,SAAS,KAAA;EACX;EACA,WAAW,EACT,MAAM,OACR;EACA,YAAY,EACV,MAAM,OACR;CACF;AACF,CACF;;AAGA,SAAgBC,aACd,SACoB;CACpB,OAAO,cAAcC,WAAkB,OAAO,GAAG,CAC/C,WAAW,sBAAsB,UAC/B,EAAE,sBAAsB;EAAE,GAAG;EAAO,OAAO;CAA2B,CAAC,CACzE,CACF,CAAC;AACH"}
|
package/dist/saved-views.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_saved_views = require("./saved-views-
|
|
2
|
+
const require_saved_views = require("./saved-views-BTJxWOyY.cjs");
|
|
3
3
|
exports.SavedViewsPanel = require_saved_views.SavedViewsPanel;
|
|
4
4
|
exports.savedViews = require_saved_views.savedViews;
|
package/dist/saved-views.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as savedViews, t as SavedViewsPanel } from "./saved-views-
|
|
1
|
+
import { n as savedViews, t as SavedViewsPanel } from "./saved-views-DW8WybwV.js";
|
|
2
2
|
export { SavedViewsPanel, savedViews };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adapttable/element-plus",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Element Plus data table controls for the AdaptTable Vue binding.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Orwa Mahmoud",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"module": "./dist/index.js",
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@adapttable/vue": "0.1.
|
|
20
|
+
"@adapttable/vue": "0.1.1"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"element-plus": "^2.14.7",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ElementColumnMenuPanel-D7SdfclW.js","names":[],"sources":["../src/columns/panelContext.ts","../src/columns/ElementColumnMenuPanel.ts"],"sourcesContent":["import type { InjectionKey, ShallowRef } from \"vue\";\n\n/** A managed menu's actual native content host, outside its scrolling body. */\nexport const columnMenuContainer: InjectionKey<\n Readonly<ShallowRef<HTMLElement | null>>\n> = Symbol(\"element-column-menu-container\");\n","import {\n type ManagedOverlayPanelProps,\n useElementRef,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ClickOutside, ElPopover } from \"element-plus\";\nimport {\n defineComponent,\n h,\n mergeProps,\n nextTick,\n onScopeDispose,\n type PropType,\n provide,\n shallowRef,\n watch,\n withDirectives,\n} from \"vue\";\n\nimport { isElementRef } from \"../controls/ref\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport { rtlScrollbarGutter } from \"../scrollbarGutter\";\nimport { columnMenuContainer } from \"./panelContext\";\n\nexport const ElementColumnMenuPanel = defineComponent(\n (props: {\n readonly control: ManagedOverlayPanelProps;\n readonly initialFocus?: string;\n }) => {\n const active = useScopeActivity();\n const inheritedDirection = shallowRef<\"ltr\" | \"rtl\">();\n const readDirection = () => {\n if (props.control.attrs.dir !== undefined) return;\n const anchor = props.control.anchor;\n const view = anchor?.ownerDocument.defaultView;\n if (anchor && view)\n inheritedDirection.value =\n view.getComputedStyle(anchor).direction === \"rtl\" ? \"rtl\" : \"ltr\";\n };\n // A public virtual positioning reference leaves trigger ARIA/events with Chrome.\n const virtualAnchor = {\n getBoundingClientRect: () =>\n props.control.anchor?.getBoundingClientRect() ?? new DOMRect(),\n get contextElement() {\n return props.control.anchor ?? undefined;\n },\n };\n const panel = shallowRef<HTMLElement | null>(null);\n const setPanel = (target: unknown) => {\n if (target == null) {\n panel.value = null;\n return;\n }\n panel.value = target instanceof HTMLElement ? target : null;\n };\n provide(columnMenuContainer, panel);\n useElementRef(\n () => panel.value,\n () =>\n isElementRef(props.control.attrs.ref)\n ? props.control.attrs.ref\n : undefined\n );\n let live = true;\n onScopeDispose(() => {\n live = false;\n });\n const close = (reason: \"escape\" | \"outside\") => {\n const control = props.control;\n if (!active.value || !control.open || !control.isCurrent()) return;\n control.onClose(reason);\n if (reason === \"escape\")\n void nextTick(() => {\n if (\n (!live || !props.control.open) &&\n control.isCurrent() &&\n control.anchor?.isConnected\n )\n control.anchor.focus();\n });\n };\n const outside = (event: MouseEvent) => {\n if (\n event.target instanceof Node &&\n props.control.anchor?.contains(event.target)\n )\n return;\n close(\"outside\");\n };\n const keydown = (event: KeyboardEvent) => {\n if (\n !active.value ||\n !props.control.open ||\n !props.control.isCurrent() ||\n event.key !== \"Escape\"\n )\n return;\n // Element's focus trap releases on any Escape that reaches the document,\n // including one an inner control handled or an IME composition owns, so\n // the panel keeps those Escapes inside itself.\n if (event.defaultPrevented || event.isComposing) {\n event.stopPropagation();\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n close(\"escape\");\n };\n // The virtual reference leaves the trigger outside ElPopover's event tree.\n // It remains the keyboard owner until the native enter handoff finishes.\n watch(\n [active, () => props.control.anchor],\n ([enabled, anchor], _previous, cleanup) => {\n if (!enabled || !anchor) return;\n anchor.addEventListener(\"keydown\", keydown);\n cleanup(() => anchor.removeEventListener(\"keydown\", keydown));\n },\n { immediate: true }\n );\n const focus = () => {\n if (!active.value || !props.control.open || !props.control.isCurrent())\n return;\n const element = panel.value;\n if (!element) return;\n const focused = element.ownerDocument.activeElement;\n if (\n focused !== props.control.anchor &&\n focused !== element.ownerDocument.body &&\n focused !== element &&\n focused !== element.closest(\".el-popper\")\n )\n return;\n const search = panel.value?.querySelector<HTMLInputElement>(\n props.initialFocus ?? 'input[data-adapttable-part=\"column-menu-search\"]'\n );\n (search ?? element).focus({ preventScroll: true });\n };\n return () => {\n const control = props.control;\n if (\n !active.value ||\n !control.open ||\n !control.isCurrent() ||\n !control.anchor\n )\n return null;\n const direction = control.attrs.dir;\n const dir =\n direction === \"rtl\" || direction === \"ltr\"\n ? direction\n : inheritedDirection.value;\n return h(\n ElPopover,\n {\n visible: control.open,\n virtualTriggering: true,\n virtualRef: virtualAnchor,\n trigger: \"click\",\n // The actual content card carries Chrome's dialog id, name and ref.\n role: \"group\",\n placement: dir === \"rtl\" ? \"bottom-end\" : \"bottom-start\",\n appendTo: control.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n width: \"min(28rem, calc(100vw - 1rem))\",\n popperStyle: {\n padding: 0,\n direction: dir,\n translate: `${rtlScrollbarGutter(dir, props.control.anchor?.ownerDocument.defaultView)} 0`,\n },\n onBeforeEnter: readDirection,\n onAfterEnter: focus,\n },\n {\n default: () =>\n withDirectives(\n h(\n ElementCard,\n {\n attrs: mergeProps(control.attrs, {\n ref: setPanel,\n dir,\n tabindex: -1,\n class: \"adapttable-element-plus-column-panel\",\n style: { overflow: \"visible\" },\n onKeydown: keydown,\n }),\n bodyStyle: {\n padding: \"0.75rem\",\n maxHeight: \"min(70vh, 32rem)\",\n overflow: \"auto\",\n },\n },\n { default: () => control.content }\n ),\n [[ClickOutside, outside]]\n ),\n }\n );\n };\n },\n {\n name: \"ElementColumnMenuPanel\",\n props: {\n control: { type: Object as PropType<ManagedOverlayPanelProps> },\n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QAAQ;GACjB,mBAAmB;GACnB,YAAY;GACZ,SAAS;GAET,MAAM;GACN,WAAW,QAAQ,QAAQ,eAAe;GAC1C,UAAU,QAAQ,aAAa;GAC/B,YAAY;GACZ,YAAY;GACZ,WAAW;GACX,OAAO;GACP,aAAa;IACX,SAAS;IACT,WAAW;IACX,WAAW,GAAG,mBAAmB,KAAK,MAAM,QAAQ,QAAQ,cAAc,WAAW,EAAE;GACzF;GACA,eAAe;GACf,cAAc;EAChB,GACA,EACE,eACE,eACE,EACE,aACA;GACE,OAAO,WAAW,QAAQ,OAAO;IAC/B,KAAK;IACL;IACA,UAAU;IACV,OAAO;IACP,OAAO,EAAE,UAAU,UAAU;IAC7B,WAAW;GACb,CAAC;GACD,WAAW;IACT,SAAS;IACT,WAAW;IACX,UAAU;GACZ;EACF,GACA,EAAE,eAAe,QAAQ,QAAQ,CACnC,GACA,CAAC,CAAC,cAAc,OAAO,CAAC,CAC1B,EACJ,CACF;CACF;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,SAAS,EAAE,MAAM,OAA6C;EAC9D,cAAc,EAAE,MAAM,OAAuC;CAC/D;AACF,CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ElementColumnMenuPanel-DRQbZVow.cjs","names":["defineComponent","useScopeActivity","shallowRef","isElementRef","nextTick","h","ElPopover","rtlScrollbarGutter","withDirectives","ElementCard","mergeProps","ClickOutside"],"sources":["../src/columns/panelContext.ts","../src/columns/ElementColumnMenuPanel.ts"],"sourcesContent":["import type { InjectionKey, ShallowRef } from \"vue\";\n\n/** A managed menu's actual native content host, outside its scrolling body. */\nexport const columnMenuContainer: InjectionKey<\n Readonly<ShallowRef<HTMLElement | null>>\n> = Symbol(\"element-column-menu-container\");\n","import {\n type ManagedOverlayPanelProps,\n useElementRef,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ClickOutside, ElPopover } from \"element-plus\";\nimport {\n defineComponent,\n h,\n mergeProps,\n nextTick,\n onScopeDispose,\n type PropType,\n provide,\n shallowRef,\n watch,\n withDirectives,\n} from \"vue\";\n\nimport { isElementRef } from \"../controls/ref\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport { rtlScrollbarGutter } from \"../scrollbarGutter\";\nimport { columnMenuContainer } from \"./panelContext\";\n\nexport const ElementColumnMenuPanel = defineComponent(\n (props: {\n readonly control: ManagedOverlayPanelProps;\n readonly initialFocus?: string;\n }) => {\n const active = useScopeActivity();\n const inheritedDirection = shallowRef<\"ltr\" | \"rtl\">();\n const readDirection = () => {\n if (props.control.attrs.dir !== undefined) return;\n const anchor = props.control.anchor;\n const view = anchor?.ownerDocument.defaultView;\n if (anchor && view)\n inheritedDirection.value =\n view.getComputedStyle(anchor).direction === \"rtl\" ? \"rtl\" : \"ltr\";\n };\n // A public virtual positioning reference leaves trigger ARIA/events with Chrome.\n const virtualAnchor = {\n getBoundingClientRect: () =>\n props.control.anchor?.getBoundingClientRect() ?? new DOMRect(),\n get contextElement() {\n return props.control.anchor ?? undefined;\n },\n };\n const panel = shallowRef<HTMLElement | null>(null);\n const setPanel = (target: unknown) => {\n if (target == null) {\n panel.value = null;\n return;\n }\n panel.value = target instanceof HTMLElement ? target : null;\n };\n provide(columnMenuContainer, panel);\n useElementRef(\n () => panel.value,\n () =>\n isElementRef(props.control.attrs.ref)\n ? props.control.attrs.ref\n : undefined\n );\n let live = true;\n onScopeDispose(() => {\n live = false;\n });\n const close = (reason: \"escape\" | \"outside\") => {\n const control = props.control;\n if (!active.value || !control.open || !control.isCurrent()) return;\n control.onClose(reason);\n if (reason === \"escape\")\n void nextTick(() => {\n if (\n (!live || !props.control.open) &&\n control.isCurrent() &&\n control.anchor?.isConnected\n )\n control.anchor.focus();\n });\n };\n const outside = (event: MouseEvent) => {\n if (\n event.target instanceof Node &&\n props.control.anchor?.contains(event.target)\n )\n return;\n close(\"outside\");\n };\n const keydown = (event: KeyboardEvent) => {\n if (\n !active.value ||\n !props.control.open ||\n !props.control.isCurrent() ||\n event.key !== \"Escape\"\n )\n return;\n // Element's focus trap releases on any Escape that reaches the document,\n // including one an inner control handled or an IME composition owns, so\n // the panel keeps those Escapes inside itself.\n if (event.defaultPrevented || event.isComposing) {\n event.stopPropagation();\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n close(\"escape\");\n };\n // The virtual reference leaves the trigger outside ElPopover's event tree.\n // It remains the keyboard owner until the native enter handoff finishes.\n watch(\n [active, () => props.control.anchor],\n ([enabled, anchor], _previous, cleanup) => {\n if (!enabled || !anchor) return;\n anchor.addEventListener(\"keydown\", keydown);\n cleanup(() => anchor.removeEventListener(\"keydown\", keydown));\n },\n { immediate: true }\n );\n const focus = () => {\n if (!active.value || !props.control.open || !props.control.isCurrent())\n return;\n const element = panel.value;\n if (!element) return;\n const focused = element.ownerDocument.activeElement;\n if (\n focused !== props.control.anchor &&\n focused !== element.ownerDocument.body &&\n focused !== element &&\n focused !== element.closest(\".el-popper\")\n )\n return;\n const search = panel.value?.querySelector<HTMLInputElement>(\n props.initialFocus ?? 'input[data-adapttable-part=\"column-menu-search\"]'\n );\n (search ?? element).focus({ preventScroll: true });\n };\n return () => {\n const control = props.control;\n if (\n !active.value ||\n !control.open ||\n !control.isCurrent() ||\n !control.anchor\n )\n return null;\n const direction = control.attrs.dir;\n const dir =\n direction === \"rtl\" || direction === \"ltr\"\n ? direction\n : inheritedDirection.value;\n return h(\n ElPopover,\n {\n visible: control.open,\n virtualTriggering: true,\n virtualRef: virtualAnchor,\n trigger: \"click\",\n // The actual content card carries Chrome's dialog id, name and ref.\n role: \"group\",\n placement: dir === \"rtl\" ? \"bottom-end\" : \"bottom-start\",\n appendTo: control.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n width: \"min(28rem, calc(100vw - 1rem))\",\n popperStyle: {\n padding: 0,\n direction: dir,\n translate: `${rtlScrollbarGutter(dir, props.control.anchor?.ownerDocument.defaultView)} 0`,\n },\n onBeforeEnter: readDirection,\n onAfterEnter: focus,\n },\n {\n default: () =>\n withDirectives(\n h(\n ElementCard,\n {\n attrs: mergeProps(control.attrs, {\n ref: setPanel,\n dir,\n tabindex: -1,\n class: \"adapttable-element-plus-column-panel\",\n style: { overflow: \"visible\" },\n onKeydown: keydown,\n }),\n bodyStyle: {\n padding: \"0.75rem\",\n maxHeight: \"min(70vh, 32rem)\",\n overflow: \"auto\",\n },\n },\n { default: () => control.content }\n ),\n [[ClickOutside, outside]]\n ),\n }\n );\n };\n },\n {\n name: \"ElementColumnMenuPanel\",\n props: {\n control: { type: Object as PropType<ManagedOverlayPanelProps> },\n initialFocus: { type: String as PropType<string | undefined> },\n },\n }\n);\n"],"mappings":";;;;;;;;AAGA,MAAa,sBAET,OAAO,+BAA+B;;;ACmB1C,MAAa,0BAAA,GAAyBA,IAAAA,gBAAAA,EACnC,UAGK;CACJ,MAAM,UAAA,GAASC,wBAAAA,iBAAAA,CAAiB;CAChC,MAAM,sBAAA,GAAqBC,IAAAA,WAAAA,CAA0B;CACrD,MAAM,sBAAsB;EAC1B,IAAI,MAAM,QAAQ,MAAM,QAAQ,KAAA,GAAW;EAC3C,MAAM,SAAS,MAAM,QAAQ;EAC7B,MAAM,OAAO,QAAQ,cAAc;EACnC,IAAI,UAAU,MACZ,mBAAmB,QACjB,KAAK,iBAAiB,MAAM,CAAC,CAAC,cAAc,QAAQ,QAAQ;CAClE;CAEA,MAAM,gBAAgB;EACpB,6BACE,MAAM,QAAQ,QAAQ,sBAAsB,KAAK,IAAI,QAAQ;EAC/D,IAAI,iBAAiB;GACnB,OAAO,MAAM,QAAQ,UAAU,KAAA;EACjC;CACF;CACA,MAAM,SAAA,GAAQA,IAAAA,WAAAA,CAA+B,IAAI;CACjD,MAAM,YAAY,WAAoB;EACpC,IAAI,UAAU,MAAM;GAClB,MAAM,QAAQ;GACd;EACF;EACA,MAAM,QAAQ,kBAAkB,cAAc,SAAS;CACzD;CACA,CAAA,GAAA,IAAA,QAAA,CAAQ,qBAAqB,KAAK;CAClC,CAAA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ACnC,GACA,CAAC,CAACC,aAAAA,cAAc,OAAO,CAAC,CAC1B,EACJ,CACF;CACF;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,SAAS,EAAE,MAAM,OAA6C;EAC9D,cAAc,EAAE,MAAM,OAAuC;CAC/D;AACF,CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ElementFilterSurface-DcPyYCK-.cjs","names":["h","ElementInput","ElementSelect","ElementCheckbox","h","ElementInput","elementButton","ElementCheckbox","ElText","defineComponent","useChecklistModel","ChecklistChrome","createVNode","defineComponent","shallowRef","useScopeActivity","useFeatureState","FULLSCREEN_MODEL","nextTick","h","ElDrawer","ElPopover","rtlScrollbarGutter","withDirectives","ElCard","ClickOutside"],"sources":["../src/filters/fieldControls.ts","../src/filters/ElementBasicFilterField.vue","../src/filters/ElementChecklistFilter.ts","../src/filters/ElementFilterField.vue","../src/filters/ElementFilterSurface.ts"],"sourcesContent":["import type {\n DataTableClassNames,\n FilterFieldSlots,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\nexport function elementFilterControls(\n names: () => DataTableClassNames\n): FilterFieldSlots {\n return {\n Input: (control) =>\n h(ElementInput, {\n ...control.attrs,\n value: control.value,\n type: control.type,\n class: names().filterInput,\n onChange: control.onChange,\n }),\n Select: (control) =>\n h(ElementSelect, {\n ...control.attrs,\n value: control.value,\n options: control.options,\n class:\n control.attrs[\"data-adapttable-part\"] === \"filter-operator\"\n ? names().filterOperator\n : names().filterSelect,\n onChange: control.onChange,\n }),\n Checkbox: (control) =>\n h(ElementCheckbox, {\n ...control.attrs,\n checked: control.checked,\n label: control.label,\n labelVisible: true,\n class: names().filterCheckbox,\n onChange: control.onChange,\n }),\n };\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n FilterFieldChrome,\n type FilterFieldOptions,\n useFilterField,\n} from \"@adapttable/vue/adapter\";\n\nimport { elementFilterControls } from \"./fieldControls\";\n\ndefineOptions({ name: \"ElementBasicFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\nconst model = useFilterField(() => props);\nconst controls = elementFilterControls(() => props.classNames ?? {});\nconst Render = () =>\n FilterFieldChrome({\n model: model.value,\n controls,\n classNames: props.classNames,\n });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n","import {\n ChecklistChrome,\n type ChecklistFilterProps,\n type ChecklistSlots,\n useChecklistModel,\n} from \"@adapttable/vue/adapter\";\nimport { ElText } from \"element-plus\";\nimport {\n createVNode,\n defineComponent,\n h,\n type PropType,\n type SetupContext,\n type VNodeChild,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\n\nconst controls: ChecklistSlots<VNodeChild> = {\n Search: (control) =>\n h(ElementInput, {\n type: \"search\",\n value: control.value,\n \"aria-label\": control.label,\n \"data-adapttable-part\": \"filter-checklist-search\",\n class: control.className,\n onChange: control.onChange,\n }),\n Button: (control) =>\n elementButton({ onClick: control.onClick }, control.label),\n Checkbox: (control) =>\n h(\"div\", { class: \"adapttable-element-plus-checklist-option\" }, [\n h(ElementCheckbox, {\n \"data-adapttable-part\": \"filter-checkbox\",\n class: control.className,\n label: control.label,\n labelVisible: true,\n checked: control.checked,\n onChange: control.onChange,\n }),\n h(\n ElText,\n {\n class: control.countClassName,\n \"data-adapttable-part\": \"filter-checklist-count\",\n type: \"info\",\n size: \"small\",\n },\n { default: () => control.count }\n ),\n ]),\n};\n\n// The presentation validates values; its key list preserves generic public\n// components and Vue fallthrough attribute inference.\nconst checklistRuntimeProps = {\n def: { type: Object as PropType<ChecklistFilterProps<unknown>[\"def\"]> },\n source: { type: Object as PropType<ChecklistFilterProps<unknown>[\"source\"]> },\n labels: { type: Object as PropType<ChecklistFilterProps<unknown>[\"labels\"]> },\n classNames: {\n type: Object as PropType<ChecklistFilterProps<unknown>[\"classNames\"]>,\n },\n};\n\nconst ElementChecklistFilterPresentation = defineComponent(\n (props: ChecklistFilterProps<unknown>) => {\n const model = useChecklistModel(() => props);\n return () => ChecklistChrome({ model: model.value, controls });\n },\n {\n name: \"ElementChecklistFilterPresentation\",\n props: checklistRuntimeProps,\n }\n);\n\n/** Preserve the canonical row contract without exposing versioned instance helpers. */\nexport function ElementChecklistFilter<TRow>(\n props: ChecklistFilterProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n) {\n return createVNode(ElementChecklistFilterPresentation, {\n ...context.attrs,\n ...props,\n });\n}\nElementChecklistFilter.props = Object.keys(checklistRuntimeProps);\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n defaultFilterRegistry,\n type FilterFieldOptions,\n filterLabel,\n filterWidgetKind,\n} from \"@adapttable/vue/adapter\";\nimport { ElFormItem } from \"element-plus\";\n\nimport ElementBasicFilterField from \"./ElementBasicFilterField.vue\";\nimport { ElementChecklistFilter } from \"./ElementChecklistFilter\";\n\ndefineOptions({ name: \"ElementFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\n</script>\n\n<template>\n <ElFormItem\n v-if=\"\n filterWidgetKind(props.def, props.registry ?? defaultFilterRegistry) ===\n 'checklist'\n \"\n :label=\"filterLabel(props.def)\"\n :class=\"props.classNames?.filterField\"\n data-adapttable-part=\"filter-field\"\n >\n <ElementChecklistFilter\n :def=\"props.def\"\n :source=\"props.source\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n />\n </ElFormItem>\n <ElementBasicFilterField v-else v-bind=\"props\" />\n</template>\n","import {\n type FilterPanelSurfaceProps,\n FULLSCREEN_MODEL,\n useFeatureState,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type CardInstance,\n ClickOutside,\n ElCard,\n ElDrawer,\n ElPopover,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n nextTick,\n onMounted,\n type PropType,\n shallowRef,\n withDirectives,\n} from \"vue\";\n\nimport { rtlScrollbarGutter } from \"../scrollbarGutter\";\n\n/** Kit overlays retain their own positioning, focus trap and modal backdrop. */\nexport const ElementFilterSurface = defineComponent(\n (\n props: FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n }\n ) => {\n const mounted = shallowRef(false);\n const active = useScopeActivity();\n const fullscreen = useFeatureState(FULLSCREEN_MODEL);\n const panel = shallowRef<CardInstance>();\n onMounted(() => {\n mounted.value = true;\n });\n const close: FilterPanelSurfaceProps[\"onClose\"] = (reason) => {\n if (!active.value || !props.open) return;\n props.onClose(reason);\n if (reason === \"escape\") {\n const anchor = props.anchor;\n void nextTick(() => {\n if (\n active.value &&\n !props.open &&\n props.anchor === anchor &&\n anchor?.isConnected\n )\n anchor.focus();\n });\n }\n };\n const outside = (event: MouseEvent) => {\n const target = event.target;\n if (target instanceof Node && props.anchor?.contains(target)) return;\n close(\"outside\");\n };\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return;\n // Element's focus trap releases on any Escape that reaches the document,\n // including one an inner control handled or an IME composition owns, so\n // the panel keeps those Escapes inside itself.\n if (event.defaultPrevented || event.isComposing) {\n event.stopPropagation();\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n close(\"escape\");\n };\n // A closed native combobox must not swallow the containing overlay's Escape.\n // Open comboboxes keep the event so their own menu closes first.\n const captureKeydown = (event: KeyboardEvent) => {\n const target = event.target;\n if (\n target instanceof Element &&\n target.getAttribute(\"role\") === \"combobox\" &&\n target.getAttribute(\"aria-expanded\") === \"false\"\n )\n keydown(event);\n };\n const focusPanel = () => {\n const element: unknown = panel.value?.$el;\n if (!active.value || !props.open || !(element instanceof HTMLElement))\n return;\n const focused = element.ownerDocument.activeElement;\n if (focused === props.anchor || focused === element.ownerDocument.body)\n element.focus();\n };\n return () => {\n if (!mounted.value || !active.value) return null;\n if (props.modal)\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n title: props.label,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n appendToBody: true,\n modal: true,\n modalClass: props.backdropClassName,\n withHeader: false,\n showClose: false,\n destroyOnClose: true,\n // Relative to the drawer's overlay, which excludes a classic\n // scrollbar or a reserved gutter; 100vw does not.\n size: \"min(30rem, 100%)\",\n dir: props.dir,\n class: props.className,\n \"data-adapttable-part\": \"filters-panel\",\n beforeClose: () => close(\"outside\"),\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n );\n if (!props.anchor) return null;\n return h(\n ElPopover,\n {\n visible: props.open,\n virtualTriggering: true,\n virtualRef: props.anchor,\n trigger: \"click\",\n role: \"dialog\",\n \"aria-label\": props.label,\n placement: props.dir === \"rtl\" ? \"bottom-end\" : \"bottom-start\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n width: \"min(28rem, calc(100vw - 1rem))\",\n popperClass: \"adapttable-element-plus-filter-popover\",\n popperStyle: {\n padding: 0,\n translate: `${rtlScrollbarGutter(props.dir, props.anchor?.ownerDocument.defaultView)} 0`,\n },\n onAfterEnter: focusPanel,\n },\n {\n default: () =>\n withDirectives(\n h(\n ElCard,\n {\n ref: panel,\n shadow: \"never\",\n dir: props.dir,\n tabindex: -1,\n \"aria-label\": props.label,\n \"data-adapttable-part\": props.part ?? \"filters-popover\",\n class: props.className,\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n ),\n [[ClickOutside, outside]]\n ),\n }\n );\n };\n },\n {\n name: \"ElementFilterSurface\",\n props: {\n className: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"className\"]\n >,\n },\n open: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"open\"]\n >,\n default: undefined,\n },\n label: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"label\"]\n >,\n },\n dir: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"dir\"]\n >,\n },\n anchor: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"anchor\"]\n >,\n },\n container: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"container\"]\n >,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"children\"]\n >,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"onClose\"]\n >,\n },\n modal: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"modal\"]\n >,\n default: undefined,\n },\n part: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"part\"]\n >,\n },\n backdropClassName: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"backdropClassName\"]\n >,\n },\n },\n }\n);\n"],"mappings":";;;;;;;;;AAUA,SAAgB,sBACd,OACkB;CAClB,OAAO;EACL,QAAQ,aAAA,GACNA,IAAAA,EAAAA,CAAEC,qBAAAA,WAAc;GACd,GAAG,QAAQ;GACX,OAAO,QAAQ;GACf,MAAM,QAAQ;GACd,OAAO,MAAM,CAAC,CAAC;GACf,UAAU,QAAQ;EACpB,CAAC;EACH,SAAS,aAAA,GACPD,IAAAA,EAAAA,CAAEE,sBAAAA,WAAe;GACf,GAAG,QAAQ;GACX,OAAO,QAAQ;GACf,SAAS,QAAQ;GACjB,OACE,QAAQ,MAAM,4BAA4B,oBACtC,MAAM,CAAC,CAAC,iBACR,MAAM,CAAC,CAAC;GACd,UAAU,QAAQ;EACpB,CAAC;EACH,WAAW,aAAA,GACTF,IAAAA,EAAAA,CAAEG,wBAAAA,WAAiB;GACjB,GAAG,QAAQ;GACX,SAAS,QAAQ;GACjB,OAAO,QAAQ;GACf,cAAc;GACd,OAAO,MAAM,CAAC,CAAC;GACf,UAAU,QAAQ;EACpB,CAAC;CACL;AACF;;;;;;;;;;;;;;;EChCA,MAAM,QAAQ;EAGd,MAAM,SAAA,GAAQ,wBAAA,eAAA,OAAqB,KAAK;EACxC,MAAM,WAAW,4BAA4B,MAAM,cAAc,CAAC,CAAC;EACnE,MAAM,gBAAA,GACJ,wBAAA,kBAA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ACA,KAAK,EACH,MAAM,OAQR;EACA,QAAQ,EACN,MAAM,OAQR;EACA,WAAW,EACT,MAAM,OAQR;EACA,UAAU;GACR,MAAM;IAAC;IAAQ;IAAQ;IAAS;IAAO;GAAM;GAQ7C,SAAS,KAAA;EACX;EACA,SAAS,EACP,MAAM,SAQR;EACA,OAAO;GACL,MAAM;GAQN,SAAS,KAAA;EACX;EACA,MAAM,EACJ,MAAM,OAQR;EACA,mBAAmB,EACjB,MAAM,OAQR;CACF;AACF,CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ElementFilterSurface-DdvPfm1N.js","names":["ElementInput","ElementSelect","ElementCheckbox","ElementInput","ElementCheckbox"],"sources":["../src/filters/fieldControls.ts","../src/filters/ElementBasicFilterField.vue","../src/filters/ElementChecklistFilter.ts","../src/filters/ElementFilterField.vue","../src/filters/ElementFilterSurface.ts"],"sourcesContent":["import type {\n DataTableClassNames,\n FilterFieldSlots,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\nexport function elementFilterControls(\n names: () => DataTableClassNames\n): FilterFieldSlots {\n return {\n Input: (control) =>\n h(ElementInput, {\n ...control.attrs,\n value: control.value,\n type: control.type,\n class: names().filterInput,\n onChange: control.onChange,\n }),\n Select: (control) =>\n h(ElementSelect, {\n ...control.attrs,\n value: control.value,\n options: control.options,\n class:\n control.attrs[\"data-adapttable-part\"] === \"filter-operator\"\n ? names().filterOperator\n : names().filterSelect,\n onChange: control.onChange,\n }),\n Checkbox: (control) =>\n h(ElementCheckbox, {\n ...control.attrs,\n checked: control.checked,\n label: control.label,\n labelVisible: true,\n class: names().filterCheckbox,\n onChange: control.onChange,\n }),\n };\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n FilterFieldChrome,\n type FilterFieldOptions,\n useFilterField,\n} from \"@adapttable/vue/adapter\";\n\nimport { elementFilterControls } from \"./fieldControls\";\n\ndefineOptions({ name: \"ElementBasicFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\nconst model = useFilterField(() => props);\nconst controls = elementFilterControls(() => props.classNames ?? {});\nconst Render = () =>\n FilterFieldChrome({\n model: model.value,\n controls,\n classNames: props.classNames,\n });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n","import {\n ChecklistChrome,\n type ChecklistFilterProps,\n type ChecklistSlots,\n useChecklistModel,\n} from \"@adapttable/vue/adapter\";\nimport { ElText } from \"element-plus\";\nimport {\n createVNode,\n defineComponent,\n h,\n type PropType,\n type SetupContext,\n type VNodeChild,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\n\nconst controls: ChecklistSlots<VNodeChild> = {\n Search: (control) =>\n h(ElementInput, {\n type: \"search\",\n value: control.value,\n \"aria-label\": control.label,\n \"data-adapttable-part\": \"filter-checklist-search\",\n class: control.className,\n onChange: control.onChange,\n }),\n Button: (control) =>\n elementButton({ onClick: control.onClick }, control.label),\n Checkbox: (control) =>\n h(\"div\", { class: \"adapttable-element-plus-checklist-option\" }, [\n h(ElementCheckbox, {\n \"data-adapttable-part\": \"filter-checkbox\",\n class: control.className,\n label: control.label,\n labelVisible: true,\n checked: control.checked,\n onChange: control.onChange,\n }),\n h(\n ElText,\n {\n class: control.countClassName,\n \"data-adapttable-part\": \"filter-checklist-count\",\n type: \"info\",\n size: \"small\",\n },\n { default: () => control.count }\n ),\n ]),\n};\n\n// The presentation validates values; its key list preserves generic public\n// components and Vue fallthrough attribute inference.\nconst checklistRuntimeProps = {\n def: { type: Object as PropType<ChecklistFilterProps<unknown>[\"def\"]> },\n source: { type: Object as PropType<ChecklistFilterProps<unknown>[\"source\"]> },\n labels: { type: Object as PropType<ChecklistFilterProps<unknown>[\"labels\"]> },\n classNames: {\n type: Object as PropType<ChecklistFilterProps<unknown>[\"classNames\"]>,\n },\n};\n\nconst ElementChecklistFilterPresentation = defineComponent(\n (props: ChecklistFilterProps<unknown>) => {\n const model = useChecklistModel(() => props);\n return () => ChecklistChrome({ model: model.value, controls });\n },\n {\n name: \"ElementChecklistFilterPresentation\",\n props: checklistRuntimeProps,\n }\n);\n\n/** Preserve the canonical row contract without exposing versioned instance helpers. */\nexport function ElementChecklistFilter<TRow>(\n props: ChecklistFilterProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n) {\n return createVNode(ElementChecklistFilterPresentation, {\n ...context.attrs,\n ...props,\n });\n}\nElementChecklistFilter.props = Object.keys(checklistRuntimeProps);\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n defaultFilterRegistry,\n type FilterFieldOptions,\n filterLabel,\n filterWidgetKind,\n} from \"@adapttable/vue/adapter\";\nimport { ElFormItem } from \"element-plus\";\n\nimport ElementBasicFilterField from \"./ElementBasicFilterField.vue\";\nimport { ElementChecklistFilter } from \"./ElementChecklistFilter\";\n\ndefineOptions({ name: \"ElementFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\n</script>\n\n<template>\n <ElFormItem\n v-if=\"\n filterWidgetKind(props.def, props.registry ?? defaultFilterRegistry) ===\n 'checklist'\n \"\n :label=\"filterLabel(props.def)\"\n :class=\"props.classNames?.filterField\"\n data-adapttable-part=\"filter-field\"\n >\n <ElementChecklistFilter\n :def=\"props.def\"\n :source=\"props.source\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n />\n </ElFormItem>\n <ElementBasicFilterField v-else v-bind=\"props\" />\n</template>\n","import {\n type FilterPanelSurfaceProps,\n FULLSCREEN_MODEL,\n useFeatureState,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type CardInstance,\n ClickOutside,\n ElCard,\n ElDrawer,\n ElPopover,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n nextTick,\n onMounted,\n type PropType,\n shallowRef,\n withDirectives,\n} from \"vue\";\n\nimport { rtlScrollbarGutter } from \"../scrollbarGutter\";\n\n/** Kit overlays retain their own positioning, focus trap and modal backdrop. */\nexport const ElementFilterSurface = defineComponent(\n (\n props: FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n }\n ) => {\n const mounted = shallowRef(false);\n const active = useScopeActivity();\n const fullscreen = useFeatureState(FULLSCREEN_MODEL);\n const panel = shallowRef<CardInstance>();\n onMounted(() => {\n mounted.value = true;\n });\n const close: FilterPanelSurfaceProps[\"onClose\"] = (reason) => {\n if (!active.value || !props.open) return;\n props.onClose(reason);\n if (reason === \"escape\") {\n const anchor = props.anchor;\n void nextTick(() => {\n if (\n active.value &&\n !props.open &&\n props.anchor === anchor &&\n anchor?.isConnected\n )\n anchor.focus();\n });\n }\n };\n const outside = (event: MouseEvent) => {\n const target = event.target;\n if (target instanceof Node && props.anchor?.contains(target)) return;\n close(\"outside\");\n };\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return;\n // Element's focus trap releases on any Escape that reaches the document,\n // including one an inner control handled or an IME composition owns, so\n // the panel keeps those Escapes inside itself.\n if (event.defaultPrevented || event.isComposing) {\n event.stopPropagation();\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n close(\"escape\");\n };\n // A closed native combobox must not swallow the containing overlay's Escape.\n // Open comboboxes keep the event so their own menu closes first.\n const captureKeydown = (event: KeyboardEvent) => {\n const target = event.target;\n if (\n target instanceof Element &&\n target.getAttribute(\"role\") === \"combobox\" &&\n target.getAttribute(\"aria-expanded\") === \"false\"\n )\n keydown(event);\n };\n const focusPanel = () => {\n const element: unknown = panel.value?.$el;\n if (!active.value || !props.open || !(element instanceof HTMLElement))\n return;\n const focused = element.ownerDocument.activeElement;\n if (focused === props.anchor || focused === element.ownerDocument.body)\n element.focus();\n };\n return () => {\n if (!mounted.value || !active.value) return null;\n if (props.modal)\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n title: props.label,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n appendToBody: true,\n modal: true,\n modalClass: props.backdropClassName,\n withHeader: false,\n showClose: false,\n destroyOnClose: true,\n // Relative to the drawer's overlay, which excludes a classic\n // scrollbar or a reserved gutter; 100vw does not.\n size: \"min(30rem, 100%)\",\n dir: props.dir,\n class: props.className,\n \"data-adapttable-part\": \"filters-panel\",\n beforeClose: () => close(\"outside\"),\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n );\n if (!props.anchor) return null;\n return h(\n ElPopover,\n {\n visible: props.open,\n virtualTriggering: true,\n virtualRef: props.anchor,\n trigger: \"click\",\n role: \"dialog\",\n \"aria-label\": props.label,\n placement: props.dir === \"rtl\" ? \"bottom-end\" : \"bottom-start\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n width: \"min(28rem, calc(100vw - 1rem))\",\n popperClass: \"adapttable-element-plus-filter-popover\",\n popperStyle: {\n padding: 0,\n translate: `${rtlScrollbarGutter(props.dir, props.anchor?.ownerDocument.defaultView)} 0`,\n },\n onAfterEnter: focusPanel,\n },\n {\n default: () =>\n withDirectives(\n h(\n ElCard,\n {\n ref: panel,\n shadow: \"never\",\n dir: props.dir,\n tabindex: -1,\n \"aria-label\": props.label,\n \"data-adapttable-part\": props.part ?? \"filters-popover\",\n class: props.className,\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n ),\n [[ClickOutside, outside]]\n ),\n }\n );\n };\n },\n {\n name: \"ElementFilterSurface\",\n props: {\n className: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"className\"]\n >,\n },\n open: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"open\"]\n >,\n default: undefined,\n },\n label: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"label\"]\n >,\n },\n dir: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"dir\"]\n >,\n },\n anchor: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"anchor\"]\n >,\n },\n container: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"container\"]\n >,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"children\"]\n >,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"onClose\"]\n >,\n },\n modal: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"modal\"]\n >,\n default: undefined,\n },\n part: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"part\"]\n >,\n },\n backdropClassName: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"backdropClassName\"]\n >,\n },\n },\n }\n);\n"],"mappings":";;;;;;;;;AAUA,SAAgB,sBACd,OACkB;CAClB,OAAO;EACL,QAAQ,YACN,EAAEA,aAAc;GACd,GAAG,QAAQ;GACX,OAAO,QAAQ;GACf,MAAM,QAAQ;GACd,OAAO,MAAM,CAAC,CAAC;GACf,UAAU,QAAQ;EACpB,CAAC;EACH,SAAS,YACP,EAAEC,aAAe;GACf,GAAG,QAAQ;GACX,OAAO,QAAQ;GACf,SAAS,QAAQ;GACjB,OACE,QAAQ,MAAM,4BAA4B,oBACtC,MAAM,CAAC,CAAC,iBACR,MAAM,CAAC,CAAC;GACd,UAAU,QAAQ;EACpB,CAAC;EACH,WAAW,YACT,EAAEC,aAAiB;GACjB,GAAG,QAAQ;GACX,SAAS,QAAQ;GACjB,OAAO,QAAQ;GACf,cAAc;GACd,OAAO,MAAM,CAAC,CAAC;GACf,UAAU,QAAQ;EACpB,CAAC;CACL;AACF;;;;;;;;;;;;;;;EChCA,MAAM,QAAQ;EAGd,MAAM,QAAQ,qBAAqB,KAAK;EACxC,MAAM,WAAW,4BAA4B,MAAM,cAAc,CAAC,CAAC;EACnE,MAAM,eACJ,kBAAkB;GAChB,OAAO,MAAM;GACb;GACA,YAAY,MAAM;EACpB,CAAC;EAEH,OAAO,QAAQ,CAAA;;GAGL,OAAA,UAAA,GAAA,YAAU,MAAA;;;;;;ACNpB,MAAM,WAAuC;CAC3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