@adapttable/naive-ui 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/assistant-Cv8df2ti.js +355 -0
- package/dist/assistant-Cv8df2ti.js.map +1 -0
- package/dist/assistant-D6mc-LJl.cjs +378 -0
- package/dist/assistant-D6mc-LJl.cjs.map +1 -0
- package/dist/assistant.cjs +5 -354
- package/dist/assistant.d.cts.map +1 -1
- package/dist/assistant.d.ts.map +1 -1
- package/dist/assistant.js +1 -350
- package/dist/column-menu-DdWVP1hz.d.cts +23 -0
- package/dist/column-menu-DdWVP1hz.d.cts.map +1 -0
- package/dist/column-menu-DdWVP1hz.d.ts +23 -0
- package/dist/column-menu-DdWVP1hz.d.ts.map +1 -0
- package/dist/column-menu.d.cts +2 -23
- package/dist/column-menu.d.ts +2 -23
- package/dist/command-palette-vIegnqVo.js +112 -0
- package/dist/command-palette-vIegnqVo.js.map +1 -0
- package/dist/command-palette-ztI3qI2V.cjs +117 -0
- package/dist/command-palette-ztI3qI2V.cjs.map +1 -0
- package/dist/command-palette.cjs +2 -112
- package/dist/command-palette.js +1 -111
- package/dist/context-menu-BbhrjTZr.cjs +145 -0
- package/dist/context-menu-BbhrjTZr.cjs.map +1 -0
- package/dist/context-menu-DjYIQXhY.js +140 -0
- package/dist/context-menu-DjYIQXhY.js.map +1 -0
- package/dist/context-menu.cjs +2 -140
- package/dist/context-menu.js +1 -139
- package/dist/features.cjs +217 -0
- package/dist/features.d.cts +40 -0
- package/dist/features.d.ts +40 -0
- package/dist/features.js +36 -0
- package/dist/filters-BJ48GzqJ.d.ts +66 -0
- package/dist/filters-BJ48GzqJ.d.ts.map +1 -0
- package/dist/filters-C6DvAZ_T.d.cts +66 -0
- package/dist/filters-C6DvAZ_T.d.cts.map +1 -0
- package/dist/filters.d.cts +2 -66
- package/dist/filters.d.ts +2 -66
- package/dist/grouping-panel-BPaPG49S.cjs +151 -0
- package/dist/grouping-panel-BPaPG49S.cjs.map +1 -0
- package/dist/grouping-panel-CYUPSa0u.js +146 -0
- package/dist/grouping-panel-CYUPSa0u.js.map +1 -0
- package/dist/grouping-panel.cjs +3 -146
- package/dist/grouping-panel.js +2 -145
- package/dist/header-filters-CQg6clum.d.cts +52 -0
- package/dist/header-filters-CQg6clum.d.cts.map +1 -0
- package/dist/header-filters-CQg6clum.d.ts +52 -0
- package/dist/header-filters-CQg6clum.d.ts.map +1 -0
- package/dist/header-filters.d.cts +2 -52
- package/dist/header-filters.d.ts +2 -52
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{mobile-Bc3-31-b.cjs → mobile-C2JUs6b_.cjs} +3 -2
- package/dist/mobile-C2JUs6b_.cjs.map +1 -0
- package/dist/{mobile-Dlwq8dB7.js → mobile-CC3NeIRK.js} +4 -3
- package/dist/mobile-CC3NeIRK.js.map +1 -0
- package/dist/preset.cjs +5 -5
- package/dist/preset.js +5 -5
- package/dist/renderers.cjs +1 -1
- package/dist/renderers.d.cts.map +1 -1
- package/dist/renderers.d.ts.map +1 -1
- package/dist/renderers.js +1 -1
- package/dist/row-reorder-BNYYEL8w.js +186 -0
- package/dist/row-reorder-BNYYEL8w.js.map +1 -0
- package/dist/row-reorder-BRySq2FF.cjs +191 -0
- package/dist/row-reorder-BRySq2FF.cjs.map +1 -0
- package/dist/row-reorder.cjs +2 -185
- package/dist/row-reorder.js +1 -185
- package/dist/side-panel-Bf4zBlYZ.cjs +64 -0
- package/dist/side-panel-Bf4zBlYZ.cjs.map +1 -0
- package/dist/side-panel-CLTgXUnb.js +59 -0
- package/dist/side-panel-CLTgXUnb.js.map +1 -0
- package/dist/side-panel.cjs +2 -59
- package/dist/side-panel.js +1 -58
- package/dist/styles.css +39 -39
- package/package.json +14 -3
- package/dist/assistant.cjs.map +0 -1
- package/dist/assistant.js.map +0 -1
- package/dist/column-menu.d.cts.map +0 -1
- package/dist/column-menu.d.ts.map +0 -1
- package/dist/command-palette.cjs.map +0 -1
- package/dist/command-palette.js.map +0 -1
- package/dist/context-menu.cjs.map +0 -1
- package/dist/context-menu.js.map +0 -1
- package/dist/filters.d.cts.map +0 -1
- package/dist/filters.d.ts.map +0 -1
- package/dist/grouping-panel.cjs.map +0 -1
- package/dist/grouping-panel.js.map +0 -1
- package/dist/header-filters.d.cts.map +0 -1
- package/dist/header-filters.d.ts.map +0 -1
- package/dist/mobile-Bc3-31-b.cjs.map +0 -1
- package/dist/mobile-Dlwq8dB7.js.map +0 -1
- package/dist/row-reorder.cjs.map +0 -1
- package/dist/row-reorder.js.map +0 -1
- package/dist/side-panel.cjs.map +0 -1
- package/dist/side-panel.js.map +0 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { t as naiveButton } from "./button-BxXdDW7A.js";
|
|
2
|
+
import "@adapttable/vue";
|
|
3
|
+
import { SIDE_PANEL_CONTROL, SidePanelChrome, extendFeature, slotRender, toVueAttrs } from "@adapttable/vue/adapter";
|
|
4
|
+
import { sidePanel } from "@adapttable/vue/features";
|
|
5
|
+
import { defineComponent, h } from "vue";
|
|
6
|
+
import { NCard } from "naive-ui";
|
|
7
|
+
//#region src/actions/sidePanelControls.ts
|
|
8
|
+
const naiveSidePanelSlots = (names = {}) => ({
|
|
9
|
+
Frame: (props) => h(NCard, {
|
|
10
|
+
tag: "aside",
|
|
11
|
+
size: "small",
|
|
12
|
+
"data-adapttable-part": "side-panel",
|
|
13
|
+
class: props.className,
|
|
14
|
+
"data-side": props.side,
|
|
15
|
+
style: {
|
|
16
|
+
minWidth: "min(18rem,100%)",
|
|
17
|
+
maxWidth: "100%"
|
|
18
|
+
}
|
|
19
|
+
}, { default: () => props.children }),
|
|
20
|
+
Tab: (props) => naiveButton({
|
|
21
|
+
...toVueAttrs(props.buttonProps),
|
|
22
|
+
class: names.sidePanelTab
|
|
23
|
+
}, props.panel.label),
|
|
24
|
+
Close: (props) => naiveButton({
|
|
25
|
+
"aria-label": props.label,
|
|
26
|
+
"data-adapttable-part": "side-panel-close",
|
|
27
|
+
class: names.sidePanelClose,
|
|
28
|
+
onClick: props.onClose
|
|
29
|
+
}, props.label)
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/side-panel.ts
|
|
33
|
+
const NaiveSidePanel = /*#__PURE__*/ defineComponent((props) => {
|
|
34
|
+
const slots = {
|
|
35
|
+
Frame: (control) => naiveSidePanelSlots(props.classNames).Frame(control),
|
|
36
|
+
Tab: (control) => naiveSidePanelSlots(props.classNames).Tab(control),
|
|
37
|
+
Close: (control) => naiveSidePanelSlots(props.classNames).Close(control)
|
|
38
|
+
};
|
|
39
|
+
return () => h(SidePanelChrome, {
|
|
40
|
+
...props,
|
|
41
|
+
slots
|
|
42
|
+
});
|
|
43
|
+
}, {
|
|
44
|
+
name: "NaiveSidePanel",
|
|
45
|
+
props: {
|
|
46
|
+
model: { type: Object },
|
|
47
|
+
labels: { type: Object },
|
|
48
|
+
dir: { type: String },
|
|
49
|
+
classNames: { type: Object },
|
|
50
|
+
container: { type: Object }
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
function sidePanel$1(options) {
|
|
54
|
+
return extendFeature(sidePanel(options), [slotRender(SIDE_PANEL_CONTROL, (props) => h(NaiveSidePanel, { ...props }))]);
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { sidePanel$1 as t };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=side-panel-CLTgXUnb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-CLTgXUnb.js","names":["sidePanel","bindingSidePanel"],"sources":["../src/actions/sidePanelControls.ts","../src/side-panel.ts"],"sourcesContent":["import { type SidePanelSlots, toVueAttrs } from \"@adapttable/vue/adapter\";\nimport { NCard } from \"naive-ui\";\nimport { h } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\n\nexport const naiveSidePanelSlots = (\n names: Readonly<Record<string, string | undefined>> = {}\n): SidePanelSlots => ({\n Frame: (props) =>\n h(\n NCard,\n {\n tag: \"aside\",\n size: \"small\",\n \"data-adapttable-part\": \"side-panel\",\n class: props.className,\n \"data-side\": props.side,\n style: { minWidth: \"min(18rem,100%)\", maxWidth: \"100%\" },\n },\n { default: () => props.children }\n ),\n Tab: (props) =>\n naiveButton(\n { ...toVueAttrs(props.buttonProps), class: names.sidePanelTab },\n props.panel.label\n ),\n Close: (props) =>\n naiveButton(\n {\n \"aria-label\": props.label,\n \"data-adapttable-part\": \"side-panel-close\",\n class: names.sidePanelClose,\n onClick: props.onClose,\n },\n props.label\n ),\n});\n","import { type StaticTableFeature } from \"@adapttable/vue\";\nimport {\n extendFeature,\n SIDE_PANEL_CONTROL,\n SidePanelChrome,\n type SidePanelChromeProps,\n type SidePanelSlots,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { sidePanel as bindingSidePanel } from \"@adapttable/vue/features\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport { naiveSidePanelSlots } from \"./actions/sidePanelControls\";\nconst NaiveSidePanel = /*#__PURE__*/ defineComponent(\n (props: Omit<SidePanelChromeProps, \"slots\" | \"presentation\">) => {\n const slots: SidePanelSlots = {\n Frame: (control) => naiveSidePanelSlots(props.classNames).Frame(control),\n Tab: (control) => naiveSidePanelSlots(props.classNames).Tab(control),\n Close: (control) => naiveSidePanelSlots(props.classNames).Close(control),\n };\n return () => h(SidePanelChrome, { ...props, slots });\n },\n {\n name: \"NaiveSidePanel\",\n props: {\n model: {\n type: Object as PropType<\n Omit<SidePanelChromeProps, \"slots\" | \"presentation\">[\"model\"]\n >,\n },\n labels: {\n type: Object as PropType<\n Omit<SidePanelChromeProps, \"slots\" | \"presentation\">[\"labels\"]\n >,\n },\n dir: {\n type: String as PropType<\n Omit<SidePanelChromeProps, \"slots\" | \"presentation\">[\"dir\"]\n >,\n },\n classNames: {\n type: Object as PropType<\n Omit<SidePanelChromeProps, \"slots\" | \"presentation\">[\"classNames\"]\n >,\n },\n container: {\n type: Object as PropType<\n Omit<SidePanelChromeProps, \"slots\" | \"presentation\">[\"container\"]\n >,\n },\n },\n }\n);\nexport function sidePanel(\n options: Parameters<typeof bindingSidePanel>[0]\n): StaticTableFeature {\n return extendFeature(bindingSidePanel(options), [\n slotRender(SIDE_PANEL_CONTROL, (props) => h(NaiveSidePanel, { ...props })),\n ]);\n}\nexport type {\n SidePanelOptions,\n SidePanelPanel,\n} from \"@adapttable/vue/features\";\n"],"mappings":";;;;;;;AAMA,MAAa,uBACX,QAAsD,CAAC,OACnC;CACpB,QAAQ,UACN,EACE,OACA;EACE,KAAK;EACL,MAAM;EACN,wBAAwB;EACxB,OAAO,MAAM;EACb,aAAa,MAAM;EACnB,OAAO;GAAE,UAAU;GAAmB,UAAU;EAAO;CACzD,GACA,EAAE,eAAe,MAAM,SAAS,CAClC;CACF,MAAM,UACJ,YACE;EAAE,GAAG,WAAW,MAAM,WAAW;EAAG,OAAO,MAAM;CAAa,GAC9D,MAAM,MAAM,KACd;CACF,QAAQ,UACN,YACE;EACE,cAAc,MAAM;EACpB,wBAAwB;EACxB,OAAO,MAAM;EACb,SAAS,MAAM;CACjB,GACA,MAAM,KACR;AACJ;;;ACxBA,MAAM,iBAA+B,+BAClC,UAAgE;CAC/D,MAAM,QAAwB;EAC5B,QAAQ,YAAY,oBAAoB,MAAM,UAAU,CAAC,CAAC,MAAM,OAAO;EACvE,MAAM,YAAY,oBAAoB,MAAM,UAAU,CAAC,CAAC,IAAI,OAAO;EACnE,QAAQ,YAAY,oBAAoB,MAAM,UAAU,CAAC,CAAC,MAAM,OAAO;CACzE;CACA,aAAa,EAAE,iBAAiB;EAAE,GAAG;EAAO;CAAM,CAAC;AACrD,GACA;CACE,MAAM;CACN,OAAO;EACL,OAAO,EACL,MAAM,OAGR;EACA,QAAQ,EACN,MAAM,OAGR;EACA,KAAK,EACH,MAAM,OAGR;EACA,YAAY,EACV,MAAM,OAGR;EACA,WAAW,EACT,MAAM,OAGR;CACF;AACF,CACF;AACA,SAAgBA,YACd,SACoB;CACpB,OAAO,cAAcC,UAAiB,OAAO,GAAG,CAC9C,WAAW,qBAAqB,UAAU,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC,CAAC,CAC3E,CAAC;AACH"}
|
package/dist/side-panel.cjs
CHANGED
|
@@ -1,60 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
5
|
-
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
6
|
-
let vue = require("vue");
|
|
7
|
-
let naive_ui = require("naive-ui");
|
|
8
|
-
//#region src/actions/sidePanelControls.ts
|
|
9
|
-
const naiveSidePanelSlots = (names = {}) => ({
|
|
10
|
-
Frame: (props) => (0, vue.h)(naive_ui.NCard, {
|
|
11
|
-
tag: "aside",
|
|
12
|
-
size: "small",
|
|
13
|
-
"data-adapttable-part": "side-panel",
|
|
14
|
-
class: props.className,
|
|
15
|
-
"data-side": props.side,
|
|
16
|
-
style: {
|
|
17
|
-
minWidth: "min(18rem,100%)",
|
|
18
|
-
maxWidth: "100%"
|
|
19
|
-
}
|
|
20
|
-
}, { default: () => props.children }),
|
|
21
|
-
Tab: (props) => require_button.naiveButton({
|
|
22
|
-
...(0, _adapttable_vue_adapter.toVueAttrs)(props.buttonProps),
|
|
23
|
-
class: names.sidePanelTab
|
|
24
|
-
}, props.panel.label),
|
|
25
|
-
Close: (props) => require_button.naiveButton({
|
|
26
|
-
"aria-label": props.label,
|
|
27
|
-
"data-adapttable-part": "side-panel-close",
|
|
28
|
-
class: names.sidePanelClose,
|
|
29
|
-
onClick: props.onClose
|
|
30
|
-
}, props.label)
|
|
31
|
-
});
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/side-panel.ts
|
|
34
|
-
const NaiveSidePanel = /*#__PURE__*/ (0, vue.defineComponent)((props) => {
|
|
35
|
-
const slots = {
|
|
36
|
-
Frame: (control) => naiveSidePanelSlots(props.classNames).Frame(control),
|
|
37
|
-
Tab: (control) => naiveSidePanelSlots(props.classNames).Tab(control),
|
|
38
|
-
Close: (control) => naiveSidePanelSlots(props.classNames).Close(control)
|
|
39
|
-
};
|
|
40
|
-
return () => (0, vue.h)(_adapttable_vue_adapter.SidePanelChrome, {
|
|
41
|
-
...props,
|
|
42
|
-
slots
|
|
43
|
-
});
|
|
44
|
-
}, {
|
|
45
|
-
name: "NaiveSidePanel",
|
|
46
|
-
props: {
|
|
47
|
-
model: { type: Object },
|
|
48
|
-
labels: { type: Object },
|
|
49
|
-
dir: { type: String },
|
|
50
|
-
classNames: { type: Object },
|
|
51
|
-
container: { type: Object }
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
function sidePanel(options) {
|
|
55
|
-
return (0, _adapttable_vue_adapter.extendFeature)((0, _adapttable_vue_features.sidePanel)(options), [(0, _adapttable_vue_adapter.slotRender)(_adapttable_vue_adapter.SIDE_PANEL_CONTROL, (props) => (0, vue.h)(NaiveSidePanel, { ...props }))]);
|
|
56
|
-
}
|
|
57
|
-
//#endregion
|
|
58
|
-
exports.sidePanel = sidePanel;
|
|
59
|
-
|
|
60
|
-
//# sourceMappingURL=side-panel.cjs.map
|
|
2
|
+
const require_side_panel = require("./side-panel-Bf4zBlYZ.cjs");
|
|
3
|
+
exports.sidePanel = require_side_panel.sidePanel;
|
package/dist/side-panel.js
CHANGED
|
@@ -1,59 +1,2 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import "@adapttable/vue";
|
|
3
|
-
import { SIDE_PANEL_CONTROL, SidePanelChrome, extendFeature, slotRender, toVueAttrs } from "@adapttable/vue/adapter";
|
|
4
|
-
import { sidePanel as sidePanel$1 } from "@adapttable/vue/features";
|
|
5
|
-
import { defineComponent, h } from "vue";
|
|
6
|
-
import { NCard } from "naive-ui";
|
|
7
|
-
//#region src/actions/sidePanelControls.ts
|
|
8
|
-
const naiveSidePanelSlots = (names = {}) => ({
|
|
9
|
-
Frame: (props) => h(NCard, {
|
|
10
|
-
tag: "aside",
|
|
11
|
-
size: "small",
|
|
12
|
-
"data-adapttable-part": "side-panel",
|
|
13
|
-
class: props.className,
|
|
14
|
-
"data-side": props.side,
|
|
15
|
-
style: {
|
|
16
|
-
minWidth: "min(18rem,100%)",
|
|
17
|
-
maxWidth: "100%"
|
|
18
|
-
}
|
|
19
|
-
}, { default: () => props.children }),
|
|
20
|
-
Tab: (props) => naiveButton({
|
|
21
|
-
...toVueAttrs(props.buttonProps),
|
|
22
|
-
class: names.sidePanelTab
|
|
23
|
-
}, props.panel.label),
|
|
24
|
-
Close: (props) => naiveButton({
|
|
25
|
-
"aria-label": props.label,
|
|
26
|
-
"data-adapttable-part": "side-panel-close",
|
|
27
|
-
class: names.sidePanelClose,
|
|
28
|
-
onClick: props.onClose
|
|
29
|
-
}, props.label)
|
|
30
|
-
});
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/side-panel.ts
|
|
33
|
-
const NaiveSidePanel = /*#__PURE__*/ defineComponent((props) => {
|
|
34
|
-
const slots = {
|
|
35
|
-
Frame: (control) => naiveSidePanelSlots(props.classNames).Frame(control),
|
|
36
|
-
Tab: (control) => naiveSidePanelSlots(props.classNames).Tab(control),
|
|
37
|
-
Close: (control) => naiveSidePanelSlots(props.classNames).Close(control)
|
|
38
|
-
};
|
|
39
|
-
return () => h(SidePanelChrome, {
|
|
40
|
-
...props,
|
|
41
|
-
slots
|
|
42
|
-
});
|
|
43
|
-
}, {
|
|
44
|
-
name: "NaiveSidePanel",
|
|
45
|
-
props: {
|
|
46
|
-
model: { type: Object },
|
|
47
|
-
labels: { type: Object },
|
|
48
|
-
dir: { type: String },
|
|
49
|
-
classNames: { type: Object },
|
|
50
|
-
container: { type: Object }
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
function sidePanel(options) {
|
|
54
|
-
return extendFeature(sidePanel$1(options), [slotRender(SIDE_PANEL_CONTROL, (props) => h(NaiveSidePanel, { ...props }))]);
|
|
55
|
-
}
|
|
56
|
-
//#endregion
|
|
1
|
+
import { t as sidePanel } from "./side-panel-CLTgXUnb.js";
|
|
57
2
|
export { sidePanel };
|
|
58
|
-
|
|
59
|
-
//# sourceMappingURL=side-panel.js.map
|
package/dist/styles.css
CHANGED
|
@@ -258,6 +258,45 @@
|
|
|
258
258
|
min-inline-size: 44px;
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
+
.adapttable-naive-pivot {
|
|
262
|
+
flex-wrap: wrap;
|
|
263
|
+
gap: 12px;
|
|
264
|
+
display: flex;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.adapttable-naive-pivot fieldset {
|
|
268
|
+
border: 1px solid var(--n-border-color, #e0e0e6);
|
|
269
|
+
border-radius: 4px;
|
|
270
|
+
gap: 8px;
|
|
271
|
+
min-inline-size: 0;
|
|
272
|
+
margin: 0;
|
|
273
|
+
padding: 8px 12px 12px;
|
|
274
|
+
display: grid;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.adapttable-naive-pivot fieldset > div {
|
|
278
|
+
flex-wrap: wrap;
|
|
279
|
+
align-items: center;
|
|
280
|
+
gap: 6px;
|
|
281
|
+
display: flex;
|
|
282
|
+
}
|
|
283
|
+
.adapttable-naive-assistant-panel, .adapttable-naive-assistant-window {
|
|
284
|
+
flex-direction: column;
|
|
285
|
+
min-inline-size: 18rem;
|
|
286
|
+
display: flex;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.adapttable-naive-assistant-input {
|
|
290
|
+
inline-size: 100%;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.adapttable-naive-approval-list {
|
|
294
|
+
gap: .5rem;
|
|
295
|
+
margin: 0;
|
|
296
|
+
padding: 0;
|
|
297
|
+
list-style: none;
|
|
298
|
+
display: grid;
|
|
299
|
+
}
|
|
261
300
|
|
|
262
301
|
.adapttable-naive-ui-grouping-layout > .n-card-content {
|
|
263
302
|
display: flex;
|
|
@@ -438,42 +477,3 @@
|
|
|
438
477
|
border-style: solid;
|
|
439
478
|
outline: 2px solid var(--adapttable-naive-error, #d03050);
|
|
440
479
|
}
|
|
441
|
-
.adapttable-naive-pivot {
|
|
442
|
-
flex-wrap: wrap;
|
|
443
|
-
gap: 12px;
|
|
444
|
-
display: flex;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
.adapttable-naive-pivot fieldset {
|
|
448
|
-
border: 1px solid var(--n-border-color, #e0e0e6);
|
|
449
|
-
border-radius: 4px;
|
|
450
|
-
gap: 8px;
|
|
451
|
-
min-inline-size: 12rem;
|
|
452
|
-
margin: 0;
|
|
453
|
-
padding: 8px 12px 12px;
|
|
454
|
-
display: grid;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
.adapttable-naive-pivot fieldset > div {
|
|
458
|
-
flex-wrap: wrap;
|
|
459
|
-
align-items: center;
|
|
460
|
-
gap: 6px;
|
|
461
|
-
display: flex;
|
|
462
|
-
}
|
|
463
|
-
.adapttable-naive-assistant-panel, .adapttable-naive-assistant-window {
|
|
464
|
-
flex-direction: column;
|
|
465
|
-
min-inline-size: 18rem;
|
|
466
|
-
display: flex;
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
.adapttable-naive-assistant-input {
|
|
470
|
-
inline-size: 100%;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
.adapttable-naive-approval-list {
|
|
474
|
-
gap: .5rem;
|
|
475
|
-
margin: 0;
|
|
476
|
-
padding: 0;
|
|
477
|
-
list-style: none;
|
|
478
|
-
display: grid;
|
|
479
|
-
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.2.0",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"author": "Orwa Mahmoud",
|
|
5
5
|
"type": "module",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"vue": "^3.5.43",
|
|
23
23
|
"naive-ui": "2.45.3",
|
|
24
24
|
"@css-render/vue3-ssr": "0.15.14",
|
|
25
|
-
"@adapttable/
|
|
25
|
+
"@adapttable/core": "3.10.0",
|
|
26
|
+
"@adapttable/i18n": "3.3.4"
|
|
26
27
|
},
|
|
27
28
|
"engines": {
|
|
28
29
|
"node": ">=22.12.0"
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
"name": "@adapttable/naive-ui",
|
|
31
32
|
"description": "Naive UI data table controls for the AdaptTable Vue binding.",
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"@adapttable/vue": "0.1.
|
|
34
|
+
"@adapttable/vue": "0.1.4"
|
|
34
35
|
},
|
|
35
36
|
"exports": {
|
|
36
37
|
".": {
|
|
@@ -444,6 +445,16 @@
|
|
|
444
445
|
"types": "./dist/column-selection.d.cts",
|
|
445
446
|
"default": "./dist/column-selection.cjs"
|
|
446
447
|
}
|
|
448
|
+
},
|
|
449
|
+
"./features": {
|
|
450
|
+
"import": {
|
|
451
|
+
"types": "./dist/features.d.ts",
|
|
452
|
+
"default": "./dist/features.js"
|
|
453
|
+
},
|
|
454
|
+
"require": {
|
|
455
|
+
"types": "./dist/features.d.cts",
|
|
456
|
+
"default": "./dist/features.cjs"
|
|
457
|
+
}
|
|
447
458
|
}
|
|
448
459
|
},
|
|
449
460
|
"repository": {
|
package/dist/assistant.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assistant.cjs","names":["naiveButton","h","NCard","defineComponent","useScopeActivity","shallowRef","createMenuNavigation","nextTick","htmlRoot","NPopover","defineComponent","useScopeActivity","h","NDrawer","NDrawerContent","h","NCard","naiveButton","naiveInput","NTag","naiveSelect","defineComponent","h","TableAssistantChrome","AgentApprovalChrome","createAdapterTableAssistantFeature","createAdapterAgentApprovalFeature"],"sources":["../src/assistant/ExamplesMenu.ts","../src/assistant/Sheet.ts","../src/assistant/controls.ts","../src/assistant.ts"],"sourcesContent":["import {\n createMenuNavigation,\n type TableAssistantMenuProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NPopover } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n nextTick,\n type PropType,\n type ShallowRef,\n shallowRef,\n watch,\n} from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\n/** One shortcut as a menu item: its icon, title and optional description. */\nfunction shortcut(\n item: TableAssistantMenuProps[\"items\"][number],\n choose: (id: string) => void\n) {\n return naiveButton(\n {\n key: item.id,\n role: \"menuitem\",\n tabindex: -1,\n \"data-adapttable-part\": item.part,\n class: \"adapttable-naive-assistant-shortcut\",\n onClick: () => choose(item.id),\n },\n [\n item.icon,\n h(\"span\", [\n h(\"strong\", item.title),\n item.description ? h(\"small\", item.description) : null,\n ]),\n ],\n { text: true }\n );\n}\n\n/** The open menu: a Naive UI card holding one menu item per shortcut. */\nfunction menuCard(\n props: TableAssistantMenuProps,\n card: ShallowRef<ComponentPublicInstance | null>,\n keydown: (event: KeyboardEvent) => void,\n choose: (id: string) => void\n) {\n const items = props.items.map((item) => shortcut(item, choose));\n return h(\n NCard,\n {\n ref: card,\n size: \"small\",\n role: \"menu\",\n \"aria-label\": props.label,\n class: \"adapttable-naive-assistant-menu\",\n contentStyle: { display: \"flex\", flexDirection: \"column\", gap: \"4px\" },\n style: { maxHeight: props.maxHeight, overflowY: \"auto\" },\n onKeydown: keydown,\n },\n { default: () => items }\n );\n}\n\n/**\n * The assistant's shortcuts in a Naive UI popover menu under its trigger.\n * The shared menu navigation moves focus; Escape and Tab close the menu and\n * Escape returns focus to the trigger.\n */\nexport const NaiveExamplesMenu = defineComponent(\n (props: TableAssistantMenuProps) => {\n const active = useScopeActivity();\n const open = shallowRef(false);\n const trigger = shallowRef<HTMLElement | null>(null);\n const card = shallowRef<ComponentPublicInstance | null>(null);\n const navigation = createMenuNavigation();\n let generation = 0;\n watch(\n [active, () => props.disabled, () => props.items, () => props.onSelect],\n () => {\n generation++;\n open.value = false;\n },\n { flush: \"sync\" }\n );\n watch(open, (expanded) => {\n navigation.reset();\n if (!expanded) return;\n void nextTick(() => {\n const panel = card.value ? htmlRoot(card.value) : null;\n panel\n ?.querySelector<HTMLElement>('[role=\"menuitem\"]')\n ?.focus({ preventScroll: true });\n });\n });\n const close = (restore: boolean) => {\n open.value = false;\n if (restore) trigger.value?.focus({ preventScroll: true });\n };\n const keydown = (event: KeyboardEvent) => {\n const panel = event.currentTarget;\n if (!(panel instanceof HTMLElement)) return;\n const items = [\n ...panel.querySelectorAll<HTMLButtonElement>('[role=\"menuitem\"]'),\n ];\n const focusTargets: readonly (EventTarget | null | undefined)[] = items;\n const action = navigation.key(\n event,\n items.map((item) => ({\n label: item.textContent ?? \"\",\n disabled: item.disabled,\n })),\n focusTargets.indexOf(panel.ownerDocument.activeElement)\n );\n if (!action) return;\n if (action.kind !== \"close\" || action.key !== \"Tab\")\n event.preventDefault();\n event.stopPropagation();\n if (action.kind === \"close\") close(action.key === \"Escape\");\n else items[action.index]?.focus({ preventScroll: true });\n };\n return () => {\n if (!active.value) return null;\n const ticket = generation;\n const choose = (id: string) => {\n if (\n !active.value ||\n props.disabled ||\n ticket !== generation ||\n !props.items.some((item) => item.id === id)\n )\n return;\n close(false);\n props.onSelect(id);\n };\n return h(\n NPopover,\n {\n trigger: \"manual\",\n show: open.value,\n placement: \"bottom-start\",\n showArrow: false,\n raw: true,\n onClickoutside: (event: MouseEvent) => {\n if (\n event.target instanceof Node &&\n trigger.value?.contains(event.target)\n )\n return;\n close(false);\n },\n },\n {\n trigger: () =>\n naiveButton(\n {\n ref: (element: HTMLElement | null) => {\n trigger.value = element;\n },\n disabled: props.disabled,\n \"aria-label\": props.label,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": open.value,\n title: props.label,\n class: props.className,\n \"data-adapttable-part\": props.part,\n onClick: () => {\n if (active.value && !props.disabled) open.value = !open.value;\n },\n },\n [props.icon, props.label]\n ),\n default: () => menuCard(props, card, keydown, choose),\n }\n );\n };\n },\n {\n name: \"NaiveExamplesMenu\",\n props: {\n label: { type: String as PropType<TableAssistantMenuProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantMenuProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantMenuProps[\"className\"]>,\n },\n icon: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantMenuProps[\"icon\"]\n >,\n default: undefined,\n },\n disabled: {\n type: Boolean as PropType<TableAssistantMenuProps[\"disabled\"]>,\n default: undefined,\n },\n items: { type: Array as PropType<TableAssistantMenuProps[\"items\"]> },\n onSelect: {\n type: Function as PropType<TableAssistantMenuProps[\"onSelect\"]>,\n },\n maxHeight: {\n type: String as PropType<TableAssistantMenuProps[\"maxHeight\"]>,\n },\n },\n }\n);\n","import {\n type TableAssistantSheetProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { NDrawer, NDrawerContent } from \"naive-ui\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\n/**\n * Chrome chooses initial and return focus; NDrawer contains focus and owns\n * the portal. Escape and mask dismissal become one close request to the\n * host, and the drawer stays open until the host closes it.\n */\nexport const NaiveAssistantSheet = defineComponent(\n (props: TableAssistantSheetProps) => {\n const active = useScopeActivity();\n const requestClose = () => {\n if (active.value && props.open) props.onClose();\n };\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing)\n return;\n event.preventDefault();\n event.stopPropagation();\n requestClose();\n };\n return () => {\n if (!active.value) return null;\n return h(\n NDrawer,\n {\n show: props.open,\n placement: props.dir === \"rtl\" ? \"left\" : \"right\",\n width: \"min(28rem, 100vw)\",\n autoFocus: false,\n closeOnEsc: false,\n maskClosable: false,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n \"aria-label\": props.label,\n dir: props.dir,\n class: [\"adapttable-naive-assistant-sheet\", props.className],\n \"data-adapttable-part\": props.part,\n onKeydown: keydown,\n onMaskClick: requestClose,\n },\n {\n default: () =>\n h(NDrawerContent, {}, { default: () => props.children }),\n }\n );\n };\n },\n {\n name: \"NaiveAssistantSheet\",\n props: {\n label: { type: String as PropType<TableAssistantSheetProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantSheetProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantSheetProps[\"className\"]>,\n },\n dir: { type: String as PropType<TableAssistantSheetProps[\"dir\"]> },\n open: {\n type: Boolean as PropType<TableAssistantSheetProps[\"open\"]>,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<TableAssistantSheetProps[\"onClose\"]>,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantSheetProps[\"children\"]\n >,\n default: undefined,\n },\n },\n }\n);\n","import type {\n ApprovalReviewSlots,\n TableAssistantSlots,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NTag } from \"naive-ui\";\nimport { h, type StyleValue, type VNodeChild } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { naiveInput } from \"../controls/input\";\nimport { naiveSelect } from \"../controls/select\";\nimport { NaiveExamplesMenu } from \"./ExamplesMenu\";\nimport { NaiveAssistantSheet } from \"./Sheet\";\n\n/** Naive UI tag types for the assistant's status tones. */\nconst TAG_TYPE = {\n neutral: \"default\",\n busy: \"info\",\n warning: \"warning\",\n danger: \"error\",\n} as const;\n\nconst surface = (\n props: {\n readonly part: string;\n readonly label: string;\n readonly children: VNodeChild;\n readonly style?: StyleValue;\n },\n classes: readonly (string | undefined)[]\n) =>\n h(\n NCard,\n {\n size: \"small\",\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: classes,\n style: props.style,\n contentStyle: { display: \"flex\", flexDirection: \"column\", minHeight: 0 },\n },\n { default: () => props.children }\n );\n\nexport const naiveAssistantControls: TableAssistantSlots = {\n Button: (props) =>\n naiveButton(\n {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n \"aria-expanded\": props.expanded,\n title: props.tooltip,\n class: props.className,\n disabled: props.disabled,\n onClick: props.onClick,\n },\n [\n props.icon,\n props.iconOnly && props.icon ? null : (props.children ?? props.label),\n ],\n { size: props.part === \"assistant-launcher\" ? \"medium\" : \"small\" }\n ),\n Composer: (props) =>\n naiveInput({\n type: \"textarea\",\n value: props.value,\n attrs: {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n placeholder: props.placeholder,\n class: props.className,\n disabled: props.disabled,\n rows: 2,\n onKeydown: props.onKeyDown,\n },\n onChange: props.onChange,\n }),\n Badge: (props) =>\n h(\n NTag,\n {\n \"data-adapttable-part\": props.part,\n \"data-tone\": props.tone,\n type: TAG_TYPE[props.tone],\n size: \"small\",\n bordered: false,\n class: props.className,\n },\n { default: () => props.label }\n ),\n Panel: (props) =>\n surface(props, [\"adapttable-naive-assistant-panel\", props.className]),\n Window: (props) =>\n surface(props, [\"adapttable-naive-assistant-window\", props.className]),\n Sheet: (props) => h(NaiveAssistantSheet, { ...props, key: props.part }),\n Menu: (props) => h(NaiveExamplesMenu, props),\n LanguageChip: (props) =>\n naiveSelect({\n attrs: {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: props.className,\n disabled: props.disabled,\n },\n value: props.value,\n options: props.options,\n onChange: props.onChange,\n }),\n};\n\nexport const naiveApprovalControls: ApprovalReviewSlots = {\n Approve: naiveAssistantControls.Button,\n Reject: naiveAssistantControls.Button,\n Action: naiveAssistantControls.Button,\n List: (props) =>\n h(\n \"ul\",\n {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-naive-approval-list\", props.className],\n },\n [props.children]\n ),\n};\n","/** Optional assistant presentation; all conversation and approval state stays in the binding. */\nimport \"./assistant/assistant.css\";\n\nimport type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n AgentApprovalChrome,\n type AgentApprovalProps,\n createAdapterAgentApprovalFeature,\n createAdapterTableAssistantFeature,\n TableAssistantChrome,\n type TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport {\n naiveApprovalControls,\n naiveAssistantControls,\n} from \"./assistant/controls\";\n\nexport const TableAssistant = defineComponent(\n (props: TableAssistantProps) => () =>\n h(TableAssistantChrome, { ...props, slots: naiveAssistantControls }),\n {\n name: \"NaiveTableAssistant\",\n props: {\n assistant: { type: Object as PropType<TableAssistantProps[\"assistant\"]> },\n speech: { type: Object as PropType<TableAssistantProps[\"speech\"]> },\n open: {\n type: Boolean as PropType<TableAssistantProps[\"open\"]>,\n default: undefined,\n },\n onOpenChange: {\n type: Function as PropType<TableAssistantProps[\"onOpenChange\"]>,\n },\n presentation: {\n type: String as PropType<TableAssistantProps[\"presentation\"]>,\n },\n labels: { type: Object as PropType<TableAssistantProps[\"labels\"]> },\n accent: { type: String as PropType<TableAssistantProps[\"accent\"]> },\n receipts: {\n type: Boolean as PropType<TableAssistantProps[\"receipts\"]>,\n default: undefined,\n },\n className: { type: String as PropType<TableAssistantProps[\"className\"]> },\n launcher: {\n type: Boolean as PropType<TableAssistantProps[\"launcher\"]>,\n default: undefined,\n },\n onSettings: {\n type: Function as PropType<TableAssistantProps[\"onSettings\"]>,\n },\n boundary: {\n type: [String, Object] as PropType<TableAssistantProps[\"boundary\"]>,\n },\n note: { type: String as PropType<TableAssistantProps[\"note\"]> },\n greeting: { type: String as PropType<TableAssistantProps[\"greeting\"]> },\n avatars: { type: Object as PropType<TableAssistantProps[\"avatars\"]> },\n messageAction: {\n type: Function as PropType<TableAssistantProps[\"messageAction\"]>,\n },\n approval: { type: Object as PropType<TableAssistantProps[\"approval\"]> },\n dir: { type: String as PropType<TableAssistantProps[\"dir\"]> },\n },\n }\n);\nexport const AgentApproval = defineComponent(\n (props: AgentApprovalProps) => () =>\n h(AgentApprovalChrome, { ...props, slots: naiveApprovalControls }),\n {\n name: \"NaiveAgentApproval\",\n props: {\n pending: { type: Object as PropType<AgentApprovalProps[\"pending\"]> },\n labels: { type: Object as PropType<AgentApprovalProps[\"labels\"]> },\n className: { type: String as PropType<AgentApprovalProps[\"className\"]> },\n buttonClassName: {\n type: String as PropType<AgentApprovalProps[\"buttonClassName\"]>,\n },\n },\n }\n);\nexport function tableAssistant(): StaticTableFeature {\n return createAdapterTableAssistantFeature((props) =>\n h(TableAssistant, props)\n );\n}\nexport function agentApproval(): StaticTableFeature {\n return createAdapterAgentApprovalFeature((props) => h(AgentApproval, props));\n}\nexport type {\n AgentApprovalProps,\n TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;;AAqBA,SAAS,SACP,MACA,QACA;CACA,OAAOA,eAAAA,YACL;EACE,KAAK,KAAK;EACV,MAAM;EACN,UAAU;EACV,wBAAwB,KAAK;EAC7B,OAAO;EACP,eAAe,OAAO,KAAK,EAAE;CAC/B,GACA,CACE,KAAK,OAAA,GACLC,IAAAA,EAAAA,CAAE,QAAQ,EAAA,GACRA,IAAAA,EAAAA,CAAE,UAAU,KAAK,KAAK,GACtB,KAAK,eAAA,GAAcA,IAAAA,EAAAA,CAAE,SAAS,KAAK,WAAW,IAAI,IACpD,CAAC,CACH,GACA,EAAE,MAAM,KAAK,CACf;AACF;;AAGA,SAAS,SACP,OACA,MACA,SACA,QACA;CACA,MAAM,QAAQ,MAAM,MAAM,KAAK,SAAS,SAAS,MAAM,MAAM,CAAC;CAC9D,QAAA,GAAOA,IAAAA,EAAAA,CACLC,SAAAA,OACA;EACE,KAAK;EACL,MAAM;EACN,MAAM;EACN,cAAc,MAAM;EACpB,OAAO;EACP,cAAc;GAAE,SAAS;GAAQ,eAAe;GAAU,KAAK;EAAM;EACrE,OAAO;GAAE,WAAW,MAAM;GAAW,WAAW;EAAO;EACvD,WAAW;CACb,GACA,EAAE,eAAe,MAAM,CACzB;AACF;;;;;;AAOA,MAAa,qBAAA,GAAoBC,IAAAA,gBAAAA,EAC9B,UAAmC;CAClC,MAAM,UAAA,GAASC,wBAAAA,iBAAAA,CAAiB;CAChC,MAAM,QAAA,GAAO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+C;CAC9D;AACF,CACF;AACA,MAAa,iBAAA,GAAgBF,IAAAA,gBAAAA,EAC1B,iBAAA,GACCC,IAAAA,EAAAA,CAAEE,wBAAAA,qBAAqB;CAAE,GAAG;CAAO,OAAO;AAAsB,CAAC,GACnE;CACE,MAAM;CACN,OAAO;EACL,SAAS,EAAE,MAAM,OAAkD;EACnE,QAAQ,EAAE,MAAM,OAAiD;EACjE,WAAW,EAAE,MAAM,OAAoD;EACvE,iBAAiB,EACf,MAAM,OACR;CACF;AACF,CACF;AACA,SAAgB,iBAAqC;CACnD,QAAA,GAAOC,wBAAAA,mCAAAA,EAAoC,WAAA,GACzCH,IAAAA,EAAAA,CAAE,gBAAgB,KAAK,CACzB;AACF;AACA,SAAgB,gBAAoC;CAClD,QAAA,GAAOI,wBAAAA,kCAAAA,EAAmC,WAAA,GAAUJ,IAAAA,EAAAA,CAAE,eAAe,KAAK,CAAC;AAC7E"}
|
package/dist/assistant.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assistant.js","names":[],"sources":["../src/assistant/ExamplesMenu.ts","../src/assistant/Sheet.ts","../src/assistant/controls.ts","../src/assistant.ts"],"sourcesContent":["import {\n createMenuNavigation,\n type TableAssistantMenuProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NPopover } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n nextTick,\n type PropType,\n type ShallowRef,\n shallowRef,\n watch,\n} from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\n/** One shortcut as a menu item: its icon, title and optional description. */\nfunction shortcut(\n item: TableAssistantMenuProps[\"items\"][number],\n choose: (id: string) => void\n) {\n return naiveButton(\n {\n key: item.id,\n role: \"menuitem\",\n tabindex: -1,\n \"data-adapttable-part\": item.part,\n class: \"adapttable-naive-assistant-shortcut\",\n onClick: () => choose(item.id),\n },\n [\n item.icon,\n h(\"span\", [\n h(\"strong\", item.title),\n item.description ? h(\"small\", item.description) : null,\n ]),\n ],\n { text: true }\n );\n}\n\n/** The open menu: a Naive UI card holding one menu item per shortcut. */\nfunction menuCard(\n props: TableAssistantMenuProps,\n card: ShallowRef<ComponentPublicInstance | null>,\n keydown: (event: KeyboardEvent) => void,\n choose: (id: string) => void\n) {\n const items = props.items.map((item) => shortcut(item, choose));\n return h(\n NCard,\n {\n ref: card,\n size: \"small\",\n role: \"menu\",\n \"aria-label\": props.label,\n class: \"adapttable-naive-assistant-menu\",\n contentStyle: { display: \"flex\", flexDirection: \"column\", gap: \"4px\" },\n style: { maxHeight: props.maxHeight, overflowY: \"auto\" },\n onKeydown: keydown,\n },\n { default: () => items }\n );\n}\n\n/**\n * The assistant's shortcuts in a Naive UI popover menu under its trigger.\n * The shared menu navigation moves focus; Escape and Tab close the menu and\n * Escape returns focus to the trigger.\n */\nexport const NaiveExamplesMenu = defineComponent(\n (props: TableAssistantMenuProps) => {\n const active = useScopeActivity();\n const open = shallowRef(false);\n const trigger = shallowRef<HTMLElement | null>(null);\n const card = shallowRef<ComponentPublicInstance | null>(null);\n const navigation = createMenuNavigation();\n let generation = 0;\n watch(\n [active, () => props.disabled, () => props.items, () => props.onSelect],\n () => {\n generation++;\n open.value = false;\n },\n { flush: \"sync\" }\n );\n watch(open, (expanded) => {\n navigation.reset();\n if (!expanded) return;\n void nextTick(() => {\n const panel = card.value ? htmlRoot(card.value) : null;\n panel\n ?.querySelector<HTMLElement>('[role=\"menuitem\"]')\n ?.focus({ preventScroll: true });\n });\n });\n const close = (restore: boolean) => {\n open.value = false;\n if (restore) trigger.value?.focus({ preventScroll: true });\n };\n const keydown = (event: KeyboardEvent) => {\n const panel = event.currentTarget;\n if (!(panel instanceof HTMLElement)) return;\n const items = [\n ...panel.querySelectorAll<HTMLButtonElement>('[role=\"menuitem\"]'),\n ];\n const focusTargets: readonly (EventTarget | null | undefined)[] = items;\n const action = navigation.key(\n event,\n items.map((item) => ({\n label: item.textContent ?? \"\",\n disabled: item.disabled,\n })),\n focusTargets.indexOf(panel.ownerDocument.activeElement)\n );\n if (!action) return;\n if (action.kind !== \"close\" || action.key !== \"Tab\")\n event.preventDefault();\n event.stopPropagation();\n if (action.kind === \"close\") close(action.key === \"Escape\");\n else items[action.index]?.focus({ preventScroll: true });\n };\n return () => {\n if (!active.value) return null;\n const ticket = generation;\n const choose = (id: string) => {\n if (\n !active.value ||\n props.disabled ||\n ticket !== generation ||\n !props.items.some((item) => item.id === id)\n )\n return;\n close(false);\n props.onSelect(id);\n };\n return h(\n NPopover,\n {\n trigger: \"manual\",\n show: open.value,\n placement: \"bottom-start\",\n showArrow: false,\n raw: true,\n onClickoutside: (event: MouseEvent) => {\n if (\n event.target instanceof Node &&\n trigger.value?.contains(event.target)\n )\n return;\n close(false);\n },\n },\n {\n trigger: () =>\n naiveButton(\n {\n ref: (element: HTMLElement | null) => {\n trigger.value = element;\n },\n disabled: props.disabled,\n \"aria-label\": props.label,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": open.value,\n title: props.label,\n class: props.className,\n \"data-adapttable-part\": props.part,\n onClick: () => {\n if (active.value && !props.disabled) open.value = !open.value;\n },\n },\n [props.icon, props.label]\n ),\n default: () => menuCard(props, card, keydown, choose),\n }\n );\n };\n },\n {\n name: \"NaiveExamplesMenu\",\n props: {\n label: { type: String as PropType<TableAssistantMenuProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantMenuProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantMenuProps[\"className\"]>,\n },\n icon: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantMenuProps[\"icon\"]\n >,\n default: undefined,\n },\n disabled: {\n type: Boolean as PropType<TableAssistantMenuProps[\"disabled\"]>,\n default: undefined,\n },\n items: { type: Array as PropType<TableAssistantMenuProps[\"items\"]> },\n onSelect: {\n type: Function as PropType<TableAssistantMenuProps[\"onSelect\"]>,\n },\n maxHeight: {\n type: String as PropType<TableAssistantMenuProps[\"maxHeight\"]>,\n },\n },\n }\n);\n","import {\n type TableAssistantSheetProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { NDrawer, NDrawerContent } from \"naive-ui\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\n/**\n * Chrome chooses initial and return focus; NDrawer contains focus and owns\n * the portal. Escape and mask dismissal become one close request to the\n * host, and the drawer stays open until the host closes it.\n */\nexport const NaiveAssistantSheet = defineComponent(\n (props: TableAssistantSheetProps) => {\n const active = useScopeActivity();\n const requestClose = () => {\n if (active.value && props.open) props.onClose();\n };\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing)\n return;\n event.preventDefault();\n event.stopPropagation();\n requestClose();\n };\n return () => {\n if (!active.value) return null;\n return h(\n NDrawer,\n {\n show: props.open,\n placement: props.dir === \"rtl\" ? \"left\" : \"right\",\n width: \"min(28rem, 100vw)\",\n autoFocus: false,\n closeOnEsc: false,\n maskClosable: false,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n \"aria-label\": props.label,\n dir: props.dir,\n class: [\"adapttable-naive-assistant-sheet\", props.className],\n \"data-adapttable-part\": props.part,\n onKeydown: keydown,\n onMaskClick: requestClose,\n },\n {\n default: () =>\n h(NDrawerContent, {}, { default: () => props.children }),\n }\n );\n };\n },\n {\n name: \"NaiveAssistantSheet\",\n props: {\n label: { type: String as PropType<TableAssistantSheetProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantSheetProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantSheetProps[\"className\"]>,\n },\n dir: { type: String as PropType<TableAssistantSheetProps[\"dir\"]> },\n open: {\n type: Boolean as PropType<TableAssistantSheetProps[\"open\"]>,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<TableAssistantSheetProps[\"onClose\"]>,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantSheetProps[\"children\"]\n >,\n default: undefined,\n },\n },\n }\n);\n","import type {\n ApprovalReviewSlots,\n TableAssistantSlots,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NTag } from \"naive-ui\";\nimport { h, type StyleValue, type VNodeChild } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { naiveInput } from \"../controls/input\";\nimport { naiveSelect } from \"../controls/select\";\nimport { NaiveExamplesMenu } from \"./ExamplesMenu\";\nimport { NaiveAssistantSheet } from \"./Sheet\";\n\n/** Naive UI tag types for the assistant's status tones. */\nconst TAG_TYPE = {\n neutral: \"default\",\n busy: \"info\",\n warning: \"warning\",\n danger: \"error\",\n} as const;\n\nconst surface = (\n props: {\n readonly part: string;\n readonly label: string;\n readonly children: VNodeChild;\n readonly style?: StyleValue;\n },\n classes: readonly (string | undefined)[]\n) =>\n h(\n NCard,\n {\n size: \"small\",\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: classes,\n style: props.style,\n contentStyle: { display: \"flex\", flexDirection: \"column\", minHeight: 0 },\n },\n { default: () => props.children }\n );\n\nexport const naiveAssistantControls: TableAssistantSlots = {\n Button: (props) =>\n naiveButton(\n {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n \"aria-expanded\": props.expanded,\n title: props.tooltip,\n class: props.className,\n disabled: props.disabled,\n onClick: props.onClick,\n },\n [\n props.icon,\n props.iconOnly && props.icon ? null : (props.children ?? props.label),\n ],\n { size: props.part === \"assistant-launcher\" ? \"medium\" : \"small\" }\n ),\n Composer: (props) =>\n naiveInput({\n type: \"textarea\",\n value: props.value,\n attrs: {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n placeholder: props.placeholder,\n class: props.className,\n disabled: props.disabled,\n rows: 2,\n onKeydown: props.onKeyDown,\n },\n onChange: props.onChange,\n }),\n Badge: (props) =>\n h(\n NTag,\n {\n \"data-adapttable-part\": props.part,\n \"data-tone\": props.tone,\n type: TAG_TYPE[props.tone],\n size: \"small\",\n bordered: false,\n class: props.className,\n },\n { default: () => props.label }\n ),\n Panel: (props) =>\n surface(props, [\"adapttable-naive-assistant-panel\", props.className]),\n Window: (props) =>\n surface(props, [\"adapttable-naive-assistant-window\", props.className]),\n Sheet: (props) => h(NaiveAssistantSheet, { ...props, key: props.part }),\n Menu: (props) => h(NaiveExamplesMenu, props),\n LanguageChip: (props) =>\n naiveSelect({\n attrs: {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: props.className,\n disabled: props.disabled,\n },\n value: props.value,\n options: props.options,\n onChange: props.onChange,\n }),\n};\n\nexport const naiveApprovalControls: ApprovalReviewSlots = {\n Approve: naiveAssistantControls.Button,\n Reject: naiveAssistantControls.Button,\n Action: naiveAssistantControls.Button,\n List: (props) =>\n h(\n \"ul\",\n {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-naive-approval-list\", props.className],\n },\n [props.children]\n ),\n};\n","/** Optional assistant presentation; all conversation and approval state stays in the binding. */\nimport \"./assistant/assistant.css\";\n\nimport type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n AgentApprovalChrome,\n type AgentApprovalProps,\n createAdapterAgentApprovalFeature,\n createAdapterTableAssistantFeature,\n TableAssistantChrome,\n type TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport {\n naiveApprovalControls,\n naiveAssistantControls,\n} from \"./assistant/controls\";\n\nexport const TableAssistant = defineComponent(\n (props: TableAssistantProps) => () =>\n h(TableAssistantChrome, { ...props, slots: naiveAssistantControls }),\n {\n name: \"NaiveTableAssistant\",\n props: {\n assistant: { type: Object as PropType<TableAssistantProps[\"assistant\"]> },\n speech: { type: Object as PropType<TableAssistantProps[\"speech\"]> },\n open: {\n type: Boolean as PropType<TableAssistantProps[\"open\"]>,\n default: undefined,\n },\n onOpenChange: {\n type: Function as PropType<TableAssistantProps[\"onOpenChange\"]>,\n },\n presentation: {\n type: String as PropType<TableAssistantProps[\"presentation\"]>,\n },\n labels: { type: Object as PropType<TableAssistantProps[\"labels\"]> },\n accent: { type: String as PropType<TableAssistantProps[\"accent\"]> },\n receipts: {\n type: Boolean as PropType<TableAssistantProps[\"receipts\"]>,\n default: undefined,\n },\n className: { type: String as PropType<TableAssistantProps[\"className\"]> },\n launcher: {\n type: Boolean as PropType<TableAssistantProps[\"launcher\"]>,\n default: undefined,\n },\n onSettings: {\n type: Function as PropType<TableAssistantProps[\"onSettings\"]>,\n },\n boundary: {\n type: [String, Object] as PropType<TableAssistantProps[\"boundary\"]>,\n },\n note: { type: String as PropType<TableAssistantProps[\"note\"]> },\n greeting: { type: String as PropType<TableAssistantProps[\"greeting\"]> },\n avatars: { type: Object as PropType<TableAssistantProps[\"avatars\"]> },\n messageAction: {\n type: Function as PropType<TableAssistantProps[\"messageAction\"]>,\n },\n approval: { type: Object as PropType<TableAssistantProps[\"approval\"]> },\n dir: { type: String as PropType<TableAssistantProps[\"dir\"]> },\n },\n }\n);\nexport const AgentApproval = defineComponent(\n (props: AgentApprovalProps) => () =>\n h(AgentApprovalChrome, { ...props, slots: naiveApprovalControls }),\n {\n name: \"NaiveAgentApproval\",\n props: {\n pending: { type: Object as PropType<AgentApprovalProps[\"pending\"]> },\n labels: { type: Object as PropType<AgentApprovalProps[\"labels\"]> },\n className: { type: String as PropType<AgentApprovalProps[\"className\"]> },\n buttonClassName: {\n type: String as PropType<AgentApprovalProps[\"buttonClassName\"]>,\n },\n },\n }\n);\nexport function tableAssistant(): StaticTableFeature {\n return createAdapterTableAssistantFeature((props) =>\n h(TableAssistant, props)\n );\n}\nexport function agentApproval(): StaticTableFeature {\n return createAdapterAgentApprovalFeature((props) => h(AgentApproval, props));\n}\nexport type {\n AgentApprovalProps,\n TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;AAqBA,SAAS,SACP,MACA,QACA;CACA,OAAO,YACL;EACE,KAAK,KAAK;EACV,MAAM;EACN,UAAU;EACV,wBAAwB,KAAK;EAC7B,OAAO;EACP,eAAe,OAAO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AM,OAAmD;EACpE,eAAe,EACb,MAAM,SACR;EACA,UAAU,EAAE,MAAM,OAAoD;EACtE,KAAK,EAAE,MAAM,OAA+C;CAC9D;AACF,CACF;AACA,MAAa,gBAAgB,iBAC1B,gBACC,EAAE,qBAAqB;CAAE,GAAG;CAAO,OAAO;AAAsB,CAAC,GACnE;CACE,MAAM;CACN,OAAO;EACL,SAAS,EAAE,MAAM,OAAkD;EACnE,QAAQ,EAAE,MAAM,OAAiD;EACjE,WAAW,EAAE,MAAM,OAAoD;EACvE,iBAAiB,EACf,MAAM,OACR;CACF;AACF,CACF;AACA,SAAgB,iBAAqC;CACnD,OAAO,oCAAoC,UACzC,EAAE,gBAAgB,KAAK,CACzB;AACF;AACA,SAAgB,gBAAoC;CAClD,OAAO,mCAAmC,UAAU,EAAE,eAAe,KAAK,CAAC;AAC7E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"column-menu.d.cts","names":[],"sources":["../src/columns/ColumnMenu.vue","../src/column-menu.ts"],"mappings":";;;cA0BM,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAiCO,qBAAc,cAAc,oBAAmB,sBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,iBAAO;KACvB,oBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;;iBCzDpF,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"column-menu.d.ts","names":[],"sources":["../src/columns/ColumnMenu.vue","../src/column-menu.ts"],"mappings":";;;cA0BM,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAiCO,qBAAc,cAAc,oBAAmB,sBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,iBAAO;KACvB,oBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;;iBCzDpF,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command-palette.cjs","names":["shallowRef","useNaiveModalEscape","htmlRoot","h","NModal","NCard","managedCommandPaletteSurface","h","naiveInput","toVueAttrs","naiveButton","NText","CommandPaletteChrome","extendFeature","bindingCommandPalette","slotRender","COMMAND_PALETTE_CONTROL"],"sources":["../src/actions/NaivePaletteSurface.ts","../src/command-palette.ts"],"sourcesContent":["import type { Direction } from \"@adapttable/vue\";\nimport type { ManagedCommandPaletteSurfaceProps } from \"@adapttable/vue/adapter\";\nimport { NCard, NModal } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n type PropType,\n shallowRef,\n} from \"vue\";\n\nimport { htmlRoot } from \"../controls/elementTarget\";\nimport { useNaiveModalEscape } from \"../controls/modalEscape\";\n\n/** Naive owns modal autofocus, Tab trapping, and focus restoration. */\nexport const NaivePaletteSurface = /*#__PURE__*/ defineComponent(\n (props: {\n readonly control: ManagedCommandPaletteSurfaceProps;\n readonly container?: HTMLElement;\n readonly dir: Direction;\n }) => {\n const card = shallowRef<ComponentPublicInstance | null>(null);\n const escape = useNaiveModalEscape(() =>\n card.value ? htmlRoot(card.value) : null\n );\n return () => {\n const owner = props.control;\n const close = () => {\n if (owner.open && owner.isCurrent()) owner.onClose();\n };\n return h(\n NModal,\n {\n show: owner.open && owner.isCurrent(),\n to: props.container,\n autoFocus: true,\n trapFocus: true,\n \"onUpdate:show\": (show: boolean) => {\n if (!show && escape.allow()) close();\n },\n },\n {\n default: () =>\n h(\n NCard,\n {\n ref: card,\n role: \"dialog\",\n dir: props.dir,\n onKeydownCapture: escape.capture,\n \"aria-modal\": true,\n \"aria-label\": owner.label,\n \"data-adapttable-part\": \"command-palette\",\n class: owner.className,\n style: {\n width: \"min(40rem,calc(100vw - 2rem))\",\n maxHeight: \"75dvh\",\n overflow: \"auto\",\n },\n },\n { default: () => owner.children }\n ),\n }\n );\n };\n },\n {\n name: \"NaivePaletteSurface\",\n props: {\n control: { type: Object as PropType<ManagedCommandPaletteSurfaceProps> },\n container: { type: Object as PropType<HTMLElement | undefined> },\n dir: { type: String as PropType<Direction> },\n },\n }\n);\n","import type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n type ActionPresentation,\n COMMAND_PALETTE_CONTROL,\n CommandPaletteChrome,\n type CommandPaletteModel,\n type CommandPaletteSlots,\n extendFeature,\n managedCommandPaletteSurface,\n slotRender,\n toVueAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { commandPalette as bindingCommandPalette } from \"@adapttable/vue/features\";\nimport { NText } from \"naive-ui\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport { NaivePaletteSurface } from \"./actions/NaivePaletteSurface\";\nimport { naiveButton } from \"./controls/button\";\nimport { naiveInput } from \"./controls/input\";\n\nconst NaiveCommandPalette = /*#__PURE__*/ defineComponent(\n (props: ActionPresentation & { readonly model: CommandPaletteModel }) => {\n // A stable surface identity lets the shared controller retain queued actions.\n const slots: CommandPaletteSlots = {\n Surface: managedCommandPaletteSurface((control) =>\n h(NaivePaletteSurface, {\n control,\n container: props.container,\n dir: props.dir,\n })\n ),\n Input: ({ inputProps }) => {\n const { value, onChange, ref, ...attrs } = inputProps;\n return naiveInput({\n value,\n onChange,\n attrs: {\n ...toVueAttrs(attrs),\n ref,\n class: props.classNames?.commandInput,\n },\n });\n },\n Item: (control) =>\n naiveButton(\n {\n ...toVueAttrs(control.itemProps),\n class: props.classNames?.commandItem,\n tabindex: -1,\n disabled: control.command.disabled,\n },\n control.command.label\n ),\n Empty: (control) =>\n h(\n NText,\n {\n \"data-adapttable-part\": \"command-empty\",\n class: props.classNames?.commandEmpty,\n },\n { default: () => control.message }\n ),\n };\n return () => [\n props.model.button\n ? naiveButton(\n {\n \"data-adapttable-part\": \"command-palette-button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": props.model.open,\n class: props.classNames?.commandPaletteButton,\n onClick: props.model.show,\n },\n props.labels.commandPalette\n )\n : null,\n h(CommandPaletteChrome, {\n commands: props.model.commands,\n open: props.model.open,\n onClose: props.model.close,\n labels: props.labels,\n className: props.classNames?.commandPalette,\n slots,\n }),\n ];\n },\n {\n name: \"NaiveCommandPalette\",\n props: {\n model: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"model\"]\n >,\n },\n labels: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"labels\"]\n >,\n },\n dir: {\n type: String as PropType<\n (ActionPresentation & { readonly model: CommandPaletteModel })[\"dir\"]\n >,\n },\n classNames: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"classNames\"]\n >,\n },\n container: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"container\"]\n >,\n },\n },\n }\n);\nexport function commandPalette(\n options: Parameters<typeof bindingCommandPalette>[0] = true\n): StaticTableFeature {\n return extendFeature(bindingCommandPalette(options), [\n slotRender(COMMAND_PALETTE_CONTROL, (props) =>\n h(NaiveCommandPalette, props)\n ),\n ]);\n}\nexport type { CommandPaletteOptions } from \"@adapttable/vue/features\";\n"],"mappings":";;;;;;;;;;AAeA,MAAa,sBAAoC,eAAA,GAAA,IAAA,gBAAA,EAC9C,UAIK;CACJ,MAAM,QAAA,GAAOA,IAAAA,WAAAA,CAA2C,IAAI;CAC5D,MAAM,SAASC,oBAAAA,0BACb,KAAK,QAAQC,eAAAA,SAAS,KAAK,KAAK,IAAI,IACtC;CACA,aAAa;EACX,MAAM,QAAQ,MAAM;EACpB,MAAM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AAO,MAAM,YAAY;GACzB,UAAU;GACV,UAAU,QAAQ,QAAQ;EAC5B,GACA,QAAQ,QAAQ,KAClB;EACF,QAAQ,aAAA,GACNF,IAAAA,EAAAA,CACEI,SAAAA,OACA;GACE,wBAAwB;GACxB,OAAO,MAAM,YAAY;EAC3B,GACA,EAAE,eAAe,QAAQ,QAAQ,CACnC;CACJ;CACA,aAAa,CACX,MAAM,MAAM,SACRD,eAAAA,YACE;EACE,wBAAwB;EACxB,iBAAiB;EACjB,iBAAiB,MAAM,MAAM;EAC7B,OAAO,MAAM,YAAY;EACzB,SAAS,MAAM,MAAM;CACvB,GACA,MAAM,OAAO,cACf,IACA,OAAA,GACJH,IAAAA,EAAAA,CAAEK,wBAAAA,sBAAsB;EACtB,UAAU,MAAM,MAAM;EACtB,MAAM,MAAM,MAAM;EAClB,SAAS,MAAM,MAAM;EACrB,QAAQ,MAAM;EACd,WAAW,MAAM,YAAY;EAC7B;CACF,CAAC,CACH;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,OAAO,EACL,MAAM,OAKR;EACA,QAAQ,EACN,MAAM,OAKR;EACA,KAAK,EACH,MAAM,OAGR;EACA,YAAY,EACV,MAAM,OAKR;EACA,WAAW,EACT,MAAM,OAKR;CACF;AACF,CACF;AACA,SAAgB,eACd,UAAuD,MACnC;CACpB,QAAA,GAAOC,wBAAAA,cAAAA,EAAAA,GAAcC,yBAAAA,eAAAA,CAAsB,OAAO,GAAG,EAAA,GACnDC,wBAAAA,WAAAA,CAAWC,wBAAAA,0BAA0B,WAAA,GACnCT,IAAAA,EAAAA,CAAE,qBAAqB,KAAK,CAC9B,CACF,CAAC;AACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command-palette.js","names":["bindingCommandPalette"],"sources":["../src/actions/NaivePaletteSurface.ts","../src/command-palette.ts"],"sourcesContent":["import type { Direction } from \"@adapttable/vue\";\nimport type { ManagedCommandPaletteSurfaceProps } from \"@adapttable/vue/adapter\";\nimport { NCard, NModal } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n type PropType,\n shallowRef,\n} from \"vue\";\n\nimport { htmlRoot } from \"../controls/elementTarget\";\nimport { useNaiveModalEscape } from \"../controls/modalEscape\";\n\n/** Naive owns modal autofocus, Tab trapping, and focus restoration. */\nexport const NaivePaletteSurface = /*#__PURE__*/ defineComponent(\n (props: {\n readonly control: ManagedCommandPaletteSurfaceProps;\n readonly container?: HTMLElement;\n readonly dir: Direction;\n }) => {\n const card = shallowRef<ComponentPublicInstance | null>(null);\n const escape = useNaiveModalEscape(() =>\n card.value ? htmlRoot(card.value) : null\n );\n return () => {\n const owner = props.control;\n const close = () => {\n if (owner.open && owner.isCurrent()) owner.onClose();\n };\n return h(\n NModal,\n {\n show: owner.open && owner.isCurrent(),\n to: props.container,\n autoFocus: true,\n trapFocus: true,\n \"onUpdate:show\": (show: boolean) => {\n if (!show && escape.allow()) close();\n },\n },\n {\n default: () =>\n h(\n NCard,\n {\n ref: card,\n role: \"dialog\",\n dir: props.dir,\n onKeydownCapture: escape.capture,\n \"aria-modal\": true,\n \"aria-label\": owner.label,\n \"data-adapttable-part\": \"command-palette\",\n class: owner.className,\n style: {\n width: \"min(40rem,calc(100vw - 2rem))\",\n maxHeight: \"75dvh\",\n overflow: \"auto\",\n },\n },\n { default: () => owner.children }\n ),\n }\n );\n };\n },\n {\n name: \"NaivePaletteSurface\",\n props: {\n control: { type: Object as PropType<ManagedCommandPaletteSurfaceProps> },\n container: { type: Object as PropType<HTMLElement | undefined> },\n dir: { type: String as PropType<Direction> },\n },\n }\n);\n","import type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n type ActionPresentation,\n COMMAND_PALETTE_CONTROL,\n CommandPaletteChrome,\n type CommandPaletteModel,\n type CommandPaletteSlots,\n extendFeature,\n managedCommandPaletteSurface,\n slotRender,\n toVueAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { commandPalette as bindingCommandPalette } from \"@adapttable/vue/features\";\nimport { NText } from \"naive-ui\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport { NaivePaletteSurface } from \"./actions/NaivePaletteSurface\";\nimport { naiveButton } from \"./controls/button\";\nimport { naiveInput } from \"./controls/input\";\n\nconst NaiveCommandPalette = /*#__PURE__*/ defineComponent(\n (props: ActionPresentation & { readonly model: CommandPaletteModel }) => {\n // A stable surface identity lets the shared controller retain queued actions.\n const slots: CommandPaletteSlots = {\n Surface: managedCommandPaletteSurface((control) =>\n h(NaivePaletteSurface, {\n control,\n container: props.container,\n dir: props.dir,\n })\n ),\n Input: ({ inputProps }) => {\n const { value, onChange, ref, ...attrs } = inputProps;\n return naiveInput({\n value,\n onChange,\n attrs: {\n ...toVueAttrs(attrs),\n ref,\n class: props.classNames?.commandInput,\n },\n });\n },\n Item: (control) =>\n naiveButton(\n {\n ...toVueAttrs(control.itemProps),\n class: props.classNames?.commandItem,\n tabindex: -1,\n disabled: control.command.disabled,\n },\n control.command.label\n ),\n Empty: (control) =>\n h(\n NText,\n {\n \"data-adapttable-part\": \"command-empty\",\n class: props.classNames?.commandEmpty,\n },\n { default: () => control.message }\n ),\n };\n return () => [\n props.model.button\n ? naiveButton(\n {\n \"data-adapttable-part\": \"command-palette-button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": props.model.open,\n class: props.classNames?.commandPaletteButton,\n onClick: props.model.show,\n },\n props.labels.commandPalette\n )\n : null,\n h(CommandPaletteChrome, {\n commands: props.model.commands,\n open: props.model.open,\n onClose: props.model.close,\n labels: props.labels,\n className: props.classNames?.commandPalette,\n slots,\n }),\n ];\n },\n {\n name: \"NaiveCommandPalette\",\n props: {\n model: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"model\"]\n >,\n },\n labels: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"labels\"]\n >,\n },\n dir: {\n type: String as PropType<\n (ActionPresentation & { readonly model: CommandPaletteModel })[\"dir\"]\n >,\n },\n classNames: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"classNames\"]\n >,\n },\n container: {\n type: Object as PropType<\n (ActionPresentation & {\n readonly model: CommandPaletteModel;\n })[\"container\"]\n >,\n },\n },\n }\n);\nexport function commandPalette(\n options: Parameters<typeof bindingCommandPalette>[0] = true\n): StaticTableFeature {\n return extendFeature(bindingCommandPalette(options), [\n slotRender(COMMAND_PALETTE_CONTROL, (props) =>\n h(NaiveCommandPalette, props)\n ),\n ]);\n}\nexport type { CommandPaletteOptions } from \"@adapttable/vue/features\";\n"],"mappings":";;;;;;;;;AAeA,MAAa,sBAAoC,+BAC9C,UAIK;CACJ,MAAM,OAAO,WAA2C,IAAI;CAC5D,MAAM,SAAS,0BACb,KAAK,QAAQ,SAAS,KAAK,KAAK,IAAI,IACtC;CACA,aAAa;EACX,MAAM,QAAQ,MAAM;EACpB,MAAM,cAAc;GAClB,IAAI,MAAM,QAAQ,MAAM,UAAU,GAAG,MAAM,QAAQ;EACrD;EACA,OAAO,EACL,QACA;GACE,MAAM,MAAM,QAAQ,MAAM,UAAU;GACpC,IAAI,MAAM;GACV,WAAW;GACX,WAAW;GACX,kBAAkB,SAAkB;IAClC,IAAI,CAAC,QAAQ,OAAO,MAAM,GAAG,MAAM;GACrC;EACF,GACA,EACE,eACE,EACE,OACA;GACE,KAAK;GACL,MAAM;GACN,KAAK,MAAM;GACX,kBAAkB,OAAO;GACzB,cAAc;GACd,cAAc,MAAM;GACpB,wBAAwB;GACxB,OAAO,MAAM;GACb,OAAO;IACL,OAAO;IACP,WAAW;IACX,UAAU;GACZ;EACF,GACA,EAAE,eAAe,MAAM,SAAS,CAClC,EACJ,CACF;CACF;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,SAAS,EAAE,MAAM,OAAsD;EACvE,WAAW,EAAE,MAAM,OAA4C;EAC/D,KAAK,EAAE,MAAM,OAA8B;CAC7C;AACF,CACF;;;ACtDA,MAAM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CACF,CAAC;AACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.cjs","names":["useScopeActivity","shallowRef","createMenuNavigation","htmlRoot","nextTick","h","NPopover","NCard","h","naiveButton","NDivider","extendFeature","bindingContextMenu","slotRender","CONTEXT_MENU_CONTROL","ContextMenuChrome"],"sources":["../src/actions/NaiveContextMenuSurface.ts","../src/context-menu.ts"],"sourcesContent":["import {\n type ContextMenuSurfaceProps,\n createMenuNavigation,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NPopover } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n nextTick,\n type PropType,\n shallowRef,\n type VNodeChild,\n watch,\n} from \"vue\";\n\nimport { htmlRoot } from \"../controls/elementTarget\";\n/** Native surfaces apply the shared core's menu-navigation decisions. */\nexport const NaiveContextMenuSurface = /*#__PURE__*/ defineComponent(\n (props: ContextMenuSurfaceProps<VNodeChild>) => {\n const active = useScopeActivity();\n const card = shallowRef<ComponentPublicInstance | null>(null);\n const navigation = createMenuNavigation();\n const root = () => (card.value ? htmlRoot(card.value) : null);\n const entries = () => {\n const panel = root();\n return [\n ...(panel?.querySelectorAll<HTMLElement>('[role=\"menuitem\"]') ?? []),\n ].filter((item) => item.closest('[role=\"menu\"]') === panel);\n };\n watch(\n [card, active, () => props.at],\n ([, live], _previous, cleanup) => {\n navigation.reset();\n if (!live) return;\n let current = true;\n void nextTick(() => {\n if (current && active.value)\n entries()\n .find((item) => item.getAttribute(\"aria-disabled\") !== \"true\")\n ?.focus({ preventScroll: true });\n });\n cleanup(() => {\n current = false;\n });\n },\n { flush: \"post\" }\n );\n const keydown = (event: KeyboardEvent) => {\n const panel = root();\n if (\n !active.value ||\n !panel ||\n !(event.target instanceof Element) ||\n event.target.closest('[role=\"menu\"]') !== panel\n )\n return;\n const items = entries();\n const focusTargets: readonly (EventTarget | null | undefined)[] = items;\n const action = navigation.key(\n event,\n items.map((item) => ({\n label: item.textContent ?? \"\",\n disabled: item.getAttribute(\"aria-disabled\") === \"true\",\n })),\n focusTargets.indexOf(panel.ownerDocument.activeElement)\n );\n if (!action) return;\n if (action.kind !== \"close\" || action.key !== \"Tab\")\n event.preventDefault();\n event.stopPropagation();\n if (action.kind === \"close\") props.onClose();\n else items[action.index]?.focus({ preventScroll: true });\n };\n return () => {\n const at = props.at;\n const close = () => {\n if (active.value && props.at === at) props.onClose();\n };\n return h(\n NPopover,\n {\n trigger: \"manual\",\n show: active.value,\n x: at.x,\n y: at.y,\n to: props.container ?? false,\n raw: true,\n showArrow: false,\n placement: \"bottom-start\",\n onClickoutside: close,\n },\n {\n default: () =>\n h(\n NCard,\n {\n ref: card,\n size: \"small\",\n role: \"menu\",\n tabindex: -1,\n \"aria-label\": props.label,\n \"data-adapttable-part\": \"context-menu\",\n class: [\"adapttable-naive-context-menu\", props.className],\n onKeydown: keydown,\n contentStyle: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4px\",\n },\n style: {\n maxWidth: \"90vw\",\n maxHeight: \"80dvh\",\n overflow: \"auto\",\n },\n },\n { default: () => props.children }\n ),\n }\n );\n };\n },\n {\n name: \"NaiveContextMenuSurface\",\n props: {\n at: {\n type: Object as PropType<ContextMenuSurfaceProps<VNodeChild>[\"at\"]>,\n },\n anchorRef: {\n type: Object as PropType<\n ContextMenuSurfaceProps<VNodeChild>[\"anchorRef\"]\n >,\n },\n label: {\n type: String as PropType<ContextMenuSurfaceProps<VNodeChild>[\"label\"]>,\n },\n onClose: {\n type: Function as PropType<\n ContextMenuSurfaceProps<VNodeChild>[\"onClose\"]\n >,\n },\n container: {\n type: Object as PropType<\n ContextMenuSurfaceProps<VNodeChild>[\"container\"]\n >,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n ContextMenuSurfaceProps<VNodeChild>[\"children\"]\n >,\n default: undefined,\n },\n className: {\n type: String as PropType<\n ContextMenuSurfaceProps<VNodeChild>[\"className\"]\n >,\n },\n },\n }\n);\n","import type { TableFeature } from \"@adapttable/vue\";\nimport {\n CONTEXT_MENU_CONTROL,\n ContextMenuChrome,\n type ContextMenuSlots,\n extendFeature,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport {\n contextMenu as bindingContextMenu,\n type ContextMenuOptions,\n} from \"@adapttable/vue/features\";\nimport { NDivider } from \"naive-ui\";\nimport { h } from \"vue\";\n\nimport { NaiveContextMenuSurface } from \"./actions/NaiveContextMenuSurface\";\nimport { naiveButton } from \"./controls/button\";\nfunction contextSlots(\n names: Readonly<Record<string, string | undefined>> = {}\n): ContextMenuSlots {\n return {\n Surface: (props) => h(NaiveContextMenuSurface, props),\n Item: ({ item, onSelect }) =>\n naiveButton(\n {\n role: \"menuitem\",\n tabindex: -1,\n disabled: item.disabled,\n \"aria-disabled\": item.disabled,\n \"data-danger\": item.danger ? \"\" : undefined,\n \"data-adapttable-part\": \"context-menu-item\",\n class: names.contextMenuItem,\n onClick: onSelect,\n },\n item.label\n ),\n Separator: () =>\n h(NDivider, {\n role: \"separator\",\n \"data-adapttable-part\": \"context-menu-separator\",\n class: names.contextMenuSeparator,\n }),\n };\n}\nexport function contextMenu<TRow>(\n options: boolean | ContextMenuOptions<TRow> = true\n): TableFeature<TRow> {\n return extendFeature(bindingContextMenu<TRow>(options), [\n slotRender(CONTEXT_MENU_CONTROL, (props) =>\n h(ContextMenuChrome, {\n items: props.model.items,\n at: props.model.at,\n onClose: props.model.close,\n labels: props.labels,\n className: props.classNames?.contextMenu,\n container: props.container,\n slots: contextSlots(props.classNames),\n })\n ),\n ]);\n}\nexport type { ContextMenuOptions } from \"@adapttable/vue/features\";\n"],"mappings":";;;;;;;;AAmBA,MAAa,0BAAwC,eAAA,GAAA,IAAA,gBAAA,EAClD,UAA+C;CAC9C,MAAM,UAAA,GAASA,wBAAAA,iBAAAA,CAAiB;CAChC,MAAM,QAAA,GAAOC,IAAAA,WAAAA,CAA2C,IAAI;CAC5D,MAAM,cAAA,GAAaC,wBAAAA,qBA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A,KAAK,KACP;EACF,kBAAA,GACED,IAAAA,EAAAA,CAAEE,SAAAA,UAAU;GACV,MAAM;GACN,wBAAwB;GACxB,OAAO,MAAM;EACf,CAAC;CACL;AACF;AACA,SAAgB,YACd,UAA8C,MAC1B;CACpB,QAAA,GAAOC,wBAAAA,cAAAA,EAAAA,GAAcC,yBAAAA,YAAAA,CAAyB,OAAO,GAAG,EAAA,GACtDC,wBAAAA,WAAAA,CAAWC,wBAAAA,uBAAuB,WAAA,GAChCN,IAAAA,EAAAA,CAAEO,wBAAAA,mBAAmB;EACnB,OAAO,MAAM,MAAM;EACnB,IAAI,MAAM,MAAM;EAChB,SAAS,MAAM,MAAM;EACrB,QAAQ,MAAM;EACd,WAAW,MAAM,YAAY;EAC7B,WAAW,MAAM;EACjB,OAAO,aAAa,MAAM,UAAU;CACtC,CAAC,CACH,CACF,CAAC;AACH"}
|
package/dist/context-menu.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.js","names":["bindingContextMenu"],"sources":["../src/actions/NaiveContextMenuSurface.ts","../src/context-menu.ts"],"sourcesContent":["import {\n type ContextMenuSurfaceProps,\n createMenuNavigation,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NPopover } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n nextTick,\n type PropType,\n shallowRef,\n type VNodeChild,\n watch,\n} from \"vue\";\n\nimport { htmlRoot } from \"../controls/elementTarget\";\n/** Native surfaces apply the shared core's menu-navigation decisions. */\nexport const NaiveContextMenuSurface = /*#__PURE__*/ defineComponent(\n (props: ContextMenuSurfaceProps<VNodeChild>) => {\n const active = useScopeActivity();\n const card = shallowRef<ComponentPublicInstance | null>(null);\n const navigation = createMenuNavigation();\n const root = () => (card.value ? htmlRoot(card.value) : null);\n const entries = () => {\n const panel = root();\n return [\n ...(panel?.querySelectorAll<HTMLElement>('[role=\"menuitem\"]') ?? []),\n ].filter((item) => item.closest('[role=\"menu\"]') === panel);\n };\n watch(\n [card, active, () => props.at],\n ([, live], _previous, cleanup) => {\n navigation.reset();\n if (!live) return;\n let current = true;\n void nextTick(() => {\n if (current && active.value)\n entries()\n .find((item) => item.getAttribute(\"aria-disabled\") !== \"true\")\n ?.focus({ preventScroll: true });\n });\n cleanup(() => {\n current = false;\n });\n },\n { flush: \"post\" }\n );\n const keydown = (event: KeyboardEvent) => {\n const panel = root();\n if (\n !active.value ||\n !panel ||\n !(event.target instanceof Element) ||\n event.target.closest('[role=\"menu\"]') !== panel\n )\n return;\n const items = entries();\n const focusTargets: readonly (EventTarget | null | undefined)[] = items;\n const action = navigation.key(\n event,\n items.map((item) => ({\n label: item.textContent ?? \"\",\n disabled: item.getAttribute(\"aria-disabled\") === \"true\",\n })),\n focusTargets.indexOf(panel.ownerDocument.activeElement)\n );\n if (!action) return;\n if (action.kind !== \"close\" || action.key !== \"Tab\")\n event.preventDefault();\n event.stopPropagation();\n if (action.kind === \"close\") props.onClose();\n else items[action.index]?.focus({ preventScroll: true });\n };\n return () => {\n const at = props.at;\n const close = () => {\n if (active.value && props.at === at) props.onClose();\n };\n return h(\n NPopover,\n {\n trigger: \"manual\",\n show: active.value,\n x: at.x,\n y: at.y,\n to: props.container ?? false,\n raw: true,\n showArrow: false,\n placement: \"bottom-start\",\n onClickoutside: close,\n },\n {\n default: () =>\n h(\n NCard,\n {\n ref: card,\n size: \"small\",\n role: \"menu\",\n tabindex: -1,\n \"aria-label\": props.label,\n \"data-adapttable-part\": \"context-menu\",\n class: [\"adapttable-naive-context-menu\", props.className],\n onKeydown: keydown,\n contentStyle: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"4px\",\n },\n style: {\n maxWidth: \"90vw\",\n maxHeight: \"80dvh\",\n overflow: \"auto\",\n },\n },\n { default: () => props.children }\n ),\n }\n );\n };\n },\n {\n name: \"NaiveContextMenuSurface\",\n props: {\n at: {\n type: Object as PropType<ContextMenuSurfaceProps<VNodeChild>[\"at\"]>,\n },\n anchorRef: {\n type: Object as PropType<\n ContextMenuSurfaceProps<VNodeChild>[\"anchorRef\"]\n >,\n },\n label: {\n type: String as PropType<ContextMenuSurfaceProps<VNodeChild>[\"label\"]>,\n },\n onClose: {\n type: Function as PropType<\n ContextMenuSurfaceProps<VNodeChild>[\"onClose\"]\n >,\n },\n container: {\n type: Object as PropType<\n ContextMenuSurfaceProps<VNodeChild>[\"container\"]\n >,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n ContextMenuSurfaceProps<VNodeChild>[\"children\"]\n >,\n default: undefined,\n },\n className: {\n type: String as PropType<\n ContextMenuSurfaceProps<VNodeChild>[\"className\"]\n >,\n },\n },\n }\n);\n","import type { TableFeature } from \"@adapttable/vue\";\nimport {\n CONTEXT_MENU_CONTROL,\n ContextMenuChrome,\n type ContextMenuSlots,\n extendFeature,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport {\n contextMenu as bindingContextMenu,\n type ContextMenuOptions,\n} from \"@adapttable/vue/features\";\nimport { NDivider } from \"naive-ui\";\nimport { h } from \"vue\";\n\nimport { NaiveContextMenuSurface } from \"./actions/NaiveContextMenuSurface\";\nimport { naiveButton } from \"./controls/button\";\nfunction contextSlots(\n names: Readonly<Record<string, string | undefined>> = {}\n): ContextMenuSlots {\n return {\n Surface: (props) => h(NaiveContextMenuSurface, props),\n Item: ({ item, onSelect }) =>\n naiveButton(\n {\n role: \"menuitem\",\n tabindex: -1,\n disabled: item.disabled,\n \"aria-disabled\": item.disabled,\n \"data-danger\": item.danger ? \"\" : undefined,\n \"data-adapttable-part\": \"context-menu-item\",\n class: names.contextMenuItem,\n onClick: onSelect,\n },\n item.label\n ),\n Separator: () =>\n h(NDivider, {\n role: \"separator\",\n \"data-adapttable-part\": \"context-menu-separator\",\n class: names.contextMenuSeparator,\n }),\n };\n}\nexport function contextMenu<TRow>(\n options: boolean | ContextMenuOptions<TRow> = true\n): TableFeature<TRow> {\n return extendFeature(bindingContextMenu<TRow>(options), [\n slotRender(CONTEXT_MENU_CONTROL, (props) =>\n h(ContextMenuChrome, {\n items: props.model.items,\n at: props.model.at,\n onClose: props.model.close,\n labels: props.labels,\n className: props.classNames?.contextMenu,\n container: props.container,\n slots: contextSlots(props.classNames),\n })\n ),\n ]);\n}\nexport type { ContextMenuOptions } from \"@adapttable/vue/features\";\n"],"mappings":";;;;;;;AAmBA,MAAa,0BAAwC,+BAClD,UAA+C;CAC9C,MAAM,SAAS,iBAAiB;CAChC,MAAM,OAAO,WAA2C,IAAI;CAC5D,MAAM,aAAa,qBAAqB;CACxC,MAAM,aAAc,KAAK,QAAQ,SAAS,KAAK,KAAK,IAAI;CACxD,MAAM,gBAAgB;EACpB,MAAM,QAAQ,KAAK;EACnB,OAAO,CACL,GAAI,OAAO,iBAA8B,qBAAmB,KAAK,CAAC,CACpE,CAAC,CAAC,QAAQ,SAAS,KAAK,QAAQ,iBAAe,MAAM,KAAK;CAC5D;CACA,MACE;EAAC;EAAM;QAAc,MAAM;CAAE,IAC5B,GAAG,OAAO,WAAW,YAAY;EAChC,WAAW,MAAM;EACjB,IAAI,CAAC,MAAM;EACX,IAAI,UAAU;EACd,eAAoB;GAClB,IAAI,WAAW,OAAO,OACpB,QAAQ,CAAC,CACN,MAAM,SAAS,KAAK,aAAa,eAAe,MAAM,MAAM,CAAC,EAC5D,MAAM,EAAE,eAAe,KAAK,CAAC;EACrC,CAAC;EACD,cAAc;GACZ,UAAU;EACZ,CAAC;CACH,GACA,EAAE,OAAO,OAAO,CAClB;CACA,MAAM,WAAW,UAAyB;EACxC,MAAM,QAAQ,KAAK;EACnB,IACE,CAAC,OAAO,SACR,CAAC,SACD,EAAE,MAAM,kBAAkB,YAC1B,MAAM,OAAO,QAAQ,iBAAe,MAAM,OAE1C;EACF,MAAM,QAAQ,QAAQ;EACtB,MAAM,eAA4D;EAClE,MAAM,SAAS,WAAW,IACxB,OACA,MAAM,KAAK,UAAU;GACnB,OAAO,KAAK,eAAe;GAC3B,UAAU,KAA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yBAAyB,KAAK;EACpD,OAAO,EAAE,MAAM,eACb,YACE;GACE,MAAM;GACN,UAAU;GACV,UAAU,KAAK;GACf,iBAAiB,KAAK;GACtB,eAAe,KAAK,SAAS,KAAK,KAAA;GAClC,wBAAwB;GACxB,OAAO,MAAM;GACb,SAAS;EACX,GACA,KAAK,KACP;EACF,iBACE,EAAE,UAAU;GACV,MAAM;GACN,wBAAwB;GACxB,OAAO,MAAM;EACf,CAAC;CACL;AACF;AACA,SAAgB,YACd,UAA8C,MAC1B;CACpB,OAAO,cAAcA,cAAyB,OAAO,GAAG,CACtD,WAAW,uBAAuB,UAChC,EAAE,mBAAmB;EACnB,OAAO,MAAM,MAAM;EACnB,IAAI,MAAM,MAAM;EAChB,SAAS,MAAM,MAAM;EACrB,QAAQ,MAAM;EACd,WAAW,MAAM,YAAY;EAC7B,WAAW,MAAM;EACjB,OAAO,aAAa,MAAM,UAAU;CACtC,CAAC,CACH,CACF,CAAC;AACH"}
|
package/dist/filters.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filters.d.cts","names":[],"sources":["../src/filters/NaiveChecklistFilter.vue","../src/filters/NaiveFilterField.vue","../src/filters/NaiveFilterTree.vue","../src/filters.ts"],"mappings":";;;;cA2EM,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAwEO,qBAAc,cAAc;aArEpB,KAAA,uBAAqB;aAClB,QAAA,uBAAqB;aACpB,SAAA,YAAY,uBAAqB;aAC7B,aAAA,YAAY,uBAAqB;eAkE4B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,iBAAO;KACvB,sBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;cC/F9F,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EA8DO,qBAAc,cAAc,sBAAmB,mBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,mBAAO;KACvB,sBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;cCxB9F,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAoHO,qBAAc,cAAc;aAjHjB,MAAA,yBAAuB;aACrB,QAAA,yBAAuB;aACtB,SAAA,YAAY,yBAAuB;aAC/B,aAAA,YACpB,yBAAuB;aAEL,WAAA,YAAY,yBAAuB;aAC5B;eA0GsD;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,mBAAO;KACvB,oBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;;iBCpOpF,QAAQ,MACtB,gBAAe,YAAU,SACzB,UAAS,mBACR,aAAa"}
|
package/dist/filters.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filters.d.ts","names":[],"sources":["../src/filters/NaiveChecklistFilter.vue","../src/filters/NaiveFilterField.vue","../src/filters/NaiveFilterTree.vue","../src/filters.ts"],"mappings":";;;;cA2EM,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAwEO,qBAAc,cAAc;aArEpB,KAAA,uBAAqB;aAClB,QAAA,uBAAqB;aACpB,SAAA,YAAY,uBAAqB;aAC7B,aAAA,YAAY,uBAAqB;eAkE4B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,iBAAO;KACvB,sBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;cC/F9F,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EA8DO,qBAAc,cAAc,sBAAmB,mBAAA,iBAA8B;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,mBAAO;KACvB,sBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;cCxB9F,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAoHO,qBAAc,cAAc;aAjHjB,MAAA,yBAAuB;aACrB,QAAA,yBAAuB;aACtB,SAAA,YAAY,yBAAuB;aAC/B,aAAA,YACpB,yBAAuB;aAEL,WAAA,YAAY,yBAAuB;aAC5B;eA0GsD;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,mBAAO;KACvB,oBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;;iBCpOpF,QAAQ,MACtB,gBAAe,YAAU,SACzB,UAAS,mBACR,aAAa"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grouping-panel.cjs","names":["h","NCheckbox","NCard","toVueAttrs","NTag","NFlex","naiveButton","naiveSelect","NText","grouping","extendFeature","bindingGroupingPanel","slotRender","groupingPanelControlKey","h","NaiveGroupingPanel"],"sources":["../src/grouping/naiveGroupingControls.ts","../src/grouping/NaiveGroupingPanel.vue","../src/grouping-panel.ts"],"sourcesContent":["import {\n type DataTableClassNames,\n type GroupingPanelSlots,\n toVueAttrs,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NCheckbox, NFlex, NTag, NText } from \"naive-ui\";\nimport { type ComputedRef, h } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { naiveSelect } from \"../controls/select\";\nfunction aggregationOption(\n option: { value: string; label: string; checked: boolean },\n disabled: boolean | undefined,\n onToggle: (value: string, checked: boolean) => void\n) {\n return h(\n NCheckbox,\n {\n key: option.value,\n checked: option.checked,\n disabled,\n \"data-adapttable-part\": \"grouping-aggregation-option\",\n \"onUpdate:checked\": (checked: boolean) => onToggle(option.value, checked),\n },\n { default: () => option.label }\n );\n}\nexport function naiveGroupingControls(\n names: ComputedRef<DataTableClassNames>\n): GroupingPanelSlots {\n return {\n Surface: ({ children, label, mobile, ...attrs }) =>\n h(\n NCard,\n {\n ...toVueAttrs(attrs),\n size: \"small\",\n class: [\n \"adapttable-naive-ui-grouping-layout\",\n names.value.groupingPanel,\n ],\n role: \"group\",\n \"aria-label\": label,\n \"data-mobile\": mobile ? \"\" : undefined,\n },\n {\n default: () => [\n h(\n \"span\",\n { class: \"adapttable-naive-ui-grouping-layout-label\" },\n label\n ),\n children,\n ],\n }\n ),\n DropZone: ({ label, empty, active, dragging, dropProps, ...attrs }) =>\n h(\n NTag,\n {\n ...attrs,\n ...toVueAttrs({ ...dropProps }),\n class: names.value.groupingDropZone,\n \"aria-label\": label,\n \"data-empty\": empty ? \"\" : undefined,\n \"data-active\": active ? \"\" : undefined,\n \"data-dragging\": dragging ? \"\" : undefined,\n },\n { default: () => (empty ? label : \"\") }\n ),\n Chip: ({\n label,\n level,\n dragProps,\n keyboardProps,\n onRemove,\n removeLabel,\n ...attrs\n }) =>\n h(\n NFlex,\n {\n ...attrs,\n inline: true,\n align: \"center\",\n size: 4,\n class: names.value.groupingChip,\n \"data-level\": level,\n },\n {\n default: () => [\n naiveButton(\n {\n ...toVueAttrs({ ...dragProps }),\n ...toVueAttrs({ ...keyboardProps }),\n class: names.value.groupingChipHandle,\n \"data-adapttable-part\": \"grouping-chip-handle\",\n },\n `${level}. ${label}`\n ),\n naiveButton(\n {\n class: names.value.groupingChipRemove,\n \"aria-label\": removeLabel,\n \"data-adapttable-part\": \"grouping-chip-remove\",\n onClick: onRemove,\n },\n \"×\"\n ),\n ],\n }\n ),\n Select: ({ label, value, options, onChange, disabled, ...attrs }) =>\n naiveSelect({\n value,\n options:\n value === \"\"\n ? [{ value: \"\", label, disabled: true }, ...options]\n : options,\n onChange,\n attrs: {\n ...attrs,\n class:\n attrs[\"data-adapttable-part\"] === \"grouping-add\"\n ? names.value.groupingAdd\n : names.value.groupingAggregationOperation,\n disabled,\n \"aria-label\": label,\n placeholder: label,\n },\n }),\n RemoveZone: ({ label, active, dropProps, ...attrs }) =>\n h(\n NTag,\n {\n ...attrs,\n ...toVueAttrs({ ...dropProps }),\n class: names.value.groupingRemoveZone,\n \"aria-label\": label,\n \"data-active\": active ? \"\" : undefined,\n },\n { default: () => label }\n ),\n AggregationItem: ({ label, readOnly, readOnlyLabel, children, ...attrs }) =>\n h(\n NFlex,\n {\n ...attrs,\n inline: true,\n align: \"center\",\n class: names.value.groupingAggregationItem,\n \"data-read-only\": readOnly ? \"\" : undefined,\n },\n {\n default: () => [\n h(NText, null, { default: () => label }),\n readOnly ? h(NTag, null, { default: () => readOnlyLabel }) : null,\n children,\n ],\n }\n ),\n AggregationRemove: ({ label, onRemove, ...attrs }) =>\n naiveButton(\n {\n ...attrs,\n class: names.value.groupingAggregationRemove,\n \"aria-label\": label,\n onClick: onRemove,\n },\n \"×\"\n ),\n AggregationPicker: ({ label, options, onToggle, disabled, ...attrs }) =>\n h(\n NFlex,\n {\n ...attrs,\n role: \"group\",\n \"aria-label\": label,\n class: names.value.groupingAggregationAdd,\n },\n {\n default: () =>\n options.map((option) =>\n aggregationOption(option, disabled, onToggle)\n ),\n }\n ),\n AggregationRestore: ({ label, disabled, onRestore, ...attrs }) =>\n naiveButton(\n {\n ...attrs,\n class: names.value.groupingAggregationsRestore,\n disabled,\n onClick: onRestore,\n },\n label\n ),\n };\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport { type GroupingPanelProps } from \"@adapttable/vue\";\nimport {\n GroupingPanelChrome,\n useDataTableClassNames,\n} from \"@adapttable/vue/adapter\";\n\nimport { naiveGroupingControls } from \"./naiveGroupingControls\";\n\ndefineOptions({ name: \"NaiveGroupingPanel\" });\nconst props = defineProps<GroupingPanelProps<TRow>>();\nconst names = useDataTableClassNames();\nconst controls = naiveGroupingControls(names);\nconst Render = () =>\n GroupingPanelChrome({\n ...props,\n classNames: names.value,\n slots: controls,\n });\n\n// Declare no props so Vue forwards all root attributes, including id and data-*.\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n\n<style>\n.adapttable-naive-ui-grouping-layout > .n-card-content {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n padding: 0.75rem 1rem;\n min-inline-size: 0;\n}\n.adapttable-naive-ui-grouping-layout-label,\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregations\"]::before {\n font-size: 0.8125rem;\n font-weight: 600;\n color: var(--n-text-color);\n margin-inline-end: 0.5rem;\n}\n.adapttable-naive-ui-grouping-layout [data-adapttable-part=\"grouping-add\"] {\n flex: 0 1 15rem;\n inline-size: 15rem;\n min-inline-size: 0;\n max-inline-size: 100%;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregations\"] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.75rem;\n flex-basis: 100%;\n min-inline-size: 0;\n margin: 0.25rem 0 0;\n padding: 0.75rem 0 0;\n border: 0;\n border-block-start: 1px solid var(--n-border-color);\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregations\"]::before {\n content: attr(aria-label);\n}\n.adapttable-naive-ui-grouping-layout [data-adapttable-aggregation],\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregation-item\"] {\n display: inline-flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem;\n min-inline-size: 0;\n max-inline-size: 100%;\n margin: 0;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregation-operation\"] {\n flex: 0 1 8rem;\n inline-size: 8rem;\n min-inline-size: 0;\n max-inline-size: 100%;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregation-add\"] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5rem 0.75rem;\n min-inline-size: 0;\n max-inline-size: 100%;\n margin: 0;\n padding: 0;\n border: 0;\n box-shadow: none;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregation-add\"]\n legend {\n float: inline-start;\n padding: 0;\n font-size: 0.8125rem;\n color: var(--n-text-color);\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregation-add\"]\n label {\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n margin: 0;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-chip-remove\"],\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-aggregation-remove\"] {\n min-inline-size: 2rem;\n min-block-size: 2rem;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-drop-zone\"]:not([data-empty]):not(\n [data-dragging]\n ):not([data-active]) {\n opacity: 0;\n}\n\n/* Keep insertion boundaries stable so the target never moves under the pointer. */\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-drop-zone\"] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n flex: 0 0 auto;\n min-inline-size: 10px;\n min-block-size: 32px;\n block-size: auto;\n transition:\n border-color 120ms ease,\n background-color 120ms ease;\n margin-inline: 2px;\n padding: 0;\n border: 1px dashed color-mix(in srgb, currentColor 30%, transparent);\n border-radius: 4px;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-drop-zone\"][data-empty] {\n min-inline-size: 9rem;\n min-block-size: 44px;\n padding: 0.5rem;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-drop-zone\"][data-dragging] {\n opacity: 1;\n border-color: var(--adapttable-naive-primary, #18a058);\n background: color-mix(\n in srgb,\n var(--adapttable-naive-primary, #18a058) 8%,\n transparent\n );\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-drop-zone\"][data-active] {\n border-style: solid;\n border-color: var(--adapttable-naive-primary, #18a058);\n background: color-mix(\n in srgb,\n var(--adapttable-naive-primary, #18a058) 22%,\n transparent\n );\n outline: 2px solid var(--adapttable-naive-primary, #18a058);\n outline-offset: 1px;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-chip-handle\"] {\n cursor: grab;\n}\n.adapttable-naive-ui-grouping-layout [data-grouping-dragging] {\n opacity: 0.5;\n cursor: grabbing;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-remove-zone\"] {\n display: flex;\n flex: 1 1 100%;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n min-block-size: 44px;\n padding: 0.5rem 0.75rem;\n border: 1px dashed var(--adapttable-naive-error, #d03050);\n border-radius: 6px;\n color: var(--adapttable-naive-error, #d03050);\n font-size: 0.8125rem;\n}\n.adapttable-naive-ui-grouping-layout\n [data-adapttable-part=\"grouping-remove-zone\"][data-active] {\n background: color-mix(\n in srgb,\n var(--adapttable-naive-error, #d03050) 12%,\n transparent\n );\n border-style: solid;\n outline: 2px solid var(--adapttable-naive-error, #d03050);\n}\n</style>\n","import { type StaticTableFeature, type TableFeature } from \"@adapttable/vue\";\nimport {\n extendFeature,\n groupingPanelControlKey,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport {\n type GroupingExtras,\n groupingPanel as bindingGroupingPanel,\n type StaticGroupingExtras,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { grouping } from \"./grouping\";\nimport NaiveGroupingPanel from \"./grouping/NaiveGroupingPanel.vue\";\nexport type { GroupingPanelProps } from \"@adapttable/vue\";\nexport type { GroupingExtras } from \"@adapttable/vue/features\";\nexport function groupingPanel(\n initialGroupBy?: string | readonly string[],\n extras?: StaticGroupingExtras\n): StaticTableFeature;\nexport function groupingPanel<TRow>(\n initialGroupBy?: string | readonly string[],\n extras?: GroupingExtras<TRow>\n): TableFeature<TRow>;\nexport function groupingPanel<TRow>(\n initialGroupBy?: string | readonly string[],\n extras: GroupingExtras<TRow> = {}\n): TableFeature<TRow> {\n const ordinary = grouping<TRow>([], extras);\n return extendFeature(bindingGroupingPanel<TRow>(initialGroupBy, extras), [\n ...(ordinary.renders ?? []),\n slotRender(groupingPanelControlKey<TRow>(), (props) =>\n h(NaiveGroupingPanel<TRow>, { ...props })\n ),\n ]);\n}\n"],"mappings":";;;;;;;;;;AAUA,SAAS,kBACP,QACA,UACA,UACA;CACA,QAAA,GAAOA,IAAAA,EAAAA,CACLC,SAAAA,WACA;EACE,KAAK,OAAO;EACZ,SAAS,OAAO;EAChB;EACA,wBAAwB;EACxB,qBAAqB,YAAqB,SAAS,OAAO,OAAO,OAAO;CAC1E,GACA,EAAE,eAAe,OAAO,MAAM,CAChC;AACF;AACA,SAAgB,sBACd,OACoB;CACpB,OAAO;EACL,UAAU,EAAE,UAAU,OAAO,QAAQ,GAAG,aAAA,GACtCD,IAAAA,EAAAA,CACEE,SAAAA,OACA;GACE,IAAA,GAAGC,wBAAAA,WAAAA,CAAW,KAAK;GACnB,MAAM;GACN,OAAO,CACL,uCACA,MAAM,MAAM,aACd;GACA,MAAM;GACN,cAAc;GACd,eAAe,SAAS,K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