@adapttable/naive-ui 0.4.1 → 0.6.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 +5 -5
- package/dist/{NaiveFilterSurface-DqUmkz-o.cjs → NaiveFilterField-CP2V5YLz.cjs} +183 -149
- package/dist/NaiveFilterField-CP2V5YLz.cjs.map +1 -0
- package/dist/{NaiveFilterSurface-CnhNSSF1.js → NaiveFilterField-SRraOkWU.js} +173 -151
- package/dist/NaiveFilterField-SRraOkWU.js.map +1 -0
- package/dist/{NaiveRowActions-BR140413.cjs → NaiveRowActions-DUlkorWa.cjs} +2 -2
- package/dist/NaiveRowActions-DUlkorWa.cjs.map +1 -0
- package/dist/{NaiveRowActions-DVyMXQJq.js → NaiveRowActions-DdHuWGCQ.js} +2 -2
- package/dist/NaiveRowActions-DdHuWGCQ.js.map +1 -0
- package/dist/assistant.cjs +360 -5
- package/dist/assistant.cjs.map +1 -0
- package/dist/assistant.js +356 -1
- package/dist/assistant.js.map +1 -0
- package/dist/batch-editing.cjs +1 -1
- package/dist/batch-editing.d.cts +1 -1
- package/dist/batch-editing.d.ts +1 -1
- package/dist/batch-editing.js +1 -1
- package/dist/cell-navigation.cjs.map +1 -1
- package/dist/cell-navigation.d.cts +1 -1
- package/dist/cell-navigation.d.cts.map +1 -1
- package/dist/cell-navigation.d.ts +1 -1
- package/dist/cell-navigation.d.ts.map +1 -1
- package/dist/cell-navigation.js.map +1 -1
- package/dist/column-layout.cjs +24 -0
- package/dist/column-layout.cjs.map +1 -0
- package/dist/column-layout.d.cts +12 -0
- package/dist/column-layout.d.cts.map +1 -0
- package/dist/column-layout.d.ts +12 -0
- package/dist/column-layout.d.ts.map +1 -0
- package/dist/column-layout.js +22 -0
- package/dist/column-layout.js.map +1 -0
- package/dist/{column-menu-GUeADLrH.cjs → column-menu-B-EhL5Ih.cjs} +3 -3
- package/dist/{column-menu-GUeADLrH.cjs.map → column-menu-B-EhL5Ih.cjs.map} +1 -1
- package/dist/{column-menu-BeNblq2u.js → column-menu-BwKtCGEo.js} +3 -3
- package/dist/{column-menu-BeNblq2u.js.map → column-menu-BwKtCGEo.js.map} +1 -1
- package/dist/column-menu.cjs +1 -1
- package/dist/column-menu.d.cts +24 -2
- package/dist/column-menu.d.cts.map +1 -0
- package/dist/column-menu.d.ts +24 -2
- package/dist/column-menu.d.ts.map +1 -0
- package/dist/column-menu.js +1 -1
- package/dist/command-palette.cjs +112 -2
- package/dist/command-palette.cjs.map +1 -0
- package/dist/command-palette.js +111 -1
- package/dist/command-palette.js.map +1 -0
- package/dist/context-menu.cjs +140 -2
- package/dist/context-menu.cjs.map +1 -0
- package/dist/context-menu.js +139 -1
- package/dist/context-menu.js.map +1 -0
- package/dist/{editing-DTOBwNI6.js → editing-Btr52gcG.js} +19 -5
- package/dist/{editing-DTOBwNI6.js.map → editing-Btr52gcG.js.map} +1 -1
- package/dist/{editing-BAUOl5Ox.cjs → editing-CIvf43jv.cjs} +23 -3
- package/dist/editing-CIvf43jv.cjs.map +1 -0
- package/dist/{editing-Dho3Y2RK.d.ts → editing-dN16BK0k.d.ts} +10 -2
- package/dist/{editing-Dho3Y2RK.d.ts.map → editing-dN16BK0k.d.ts.map} +1 -1
- package/dist/{editing-CdIoFGiK.d.cts → editing-xDGCcasQ.d.cts} +10 -2
- package/dist/{editing-CdIoFGiK.d.cts.map → editing-xDGCcasQ.d.cts.map} +1 -1
- package/dist/editing.cjs +4 -13
- package/dist/editing.d.cts +2 -2
- package/dist/editing.d.ts +2 -2
- package/dist/editing.js +2 -2
- package/dist/export-DLLCc4Lb.js +10 -0
- package/dist/export-DLLCc4Lb.js.map +1 -0
- package/dist/{export-csv.cjs → export-fT_9Xp5t.cjs} +7 -3
- package/dist/export-fT_9Xp5t.cjs.map +1 -0
- package/dist/export.cjs +2 -2
- package/dist/export.d.cts +9 -2
- package/dist/export.d.cts.map +1 -0
- package/dist/export.d.ts +9 -2
- package/dist/export.d.ts.map +1 -0
- package/dist/export.js +1 -1
- package/dist/filtering.cjs +22 -0
- package/dist/filtering.cjs.map +1 -0
- package/dist/filtering.d.cts +13 -0
- package/dist/filtering.d.cts.map +1 -0
- package/dist/filtering.d.ts +13 -0
- package/dist/filtering.d.ts.map +1 -0
- package/dist/filtering.js +21 -0
- package/dist/filtering.js.map +1 -0
- package/dist/{filters-DipcT7-T.js → filters-BxRu0r4j.js} +64 -9
- package/dist/filters-BxRu0r4j.js.map +1 -0
- package/dist/{filters-B5JX7H8p.cjs → filters-U0LYOQjA.cjs} +106 -9
- package/dist/filters-U0LYOQjA.cjs.map +1 -0
- package/dist/filters.cjs +11 -4
- package/dist/filters.d.cts +90 -2
- package/dist/filters.d.cts.map +1 -0
- package/dist/filters.d.ts +90 -2
- package/dist/filters.d.ts.map +1 -0
- package/dist/filters.js +3 -3
- package/dist/grouping-panel.cjs +146 -3
- package/dist/grouping-panel.cjs.map +1 -0
- package/dist/grouping-panel.js +145 -2
- package/dist/grouping-panel.js.map +1 -0
- package/dist/{header-filters-CWad6foD.js → header-filters-Bxb3snYP.js} +2 -2
- package/dist/{header-filters-CWad6foD.js.map → header-filters-Bxb3snYP.js.map} +1 -1
- package/dist/{header-filters-C8cAJJ7r.cjs → header-filters-CvStECsj.cjs} +5 -5
- package/dist/{header-filters-C8cAJJ7r.cjs.map → header-filters-CvStECsj.cjs.map} +1 -1
- package/dist/header-filters.cjs +1 -1
- package/dist/header-filters.d.cts +52 -2
- package/dist/header-filters.d.cts.map +1 -0
- package/dist/header-filters.d.ts +52 -2
- package/dist/header-filters.d.ts.map +1 -0
- package/dist/header-filters.js +1 -1
- package/dist/index.cjs +2 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -27
- package/dist/index.js.map +1 -1
- package/dist/preset.cjs +9 -10
- package/dist/preset.cjs.map +1 -1
- package/dist/preset.js +8 -9
- package/dist/preset.js.map +1 -1
- package/dist/row-actions.cjs +1 -1
- package/dist/row-actions.js +1 -1
- package/dist/row-pinning.cjs +1 -1
- package/dist/row-pinning.js +1 -1
- package/dist/row-reorder.cjs +185 -2
- package/dist/row-reorder.cjs.map +1 -0
- package/dist/row-reorder.d.cts +2 -1
- package/dist/row-reorder.d.cts.map +1 -1
- package/dist/row-reorder.d.ts +2 -1
- package/dist/row-reorder.d.ts.map +1 -1
- package/dist/row-reorder.js +185 -1
- package/dist/row-reorder.js.map +1 -0
- package/dist/selection.cjs +8 -0
- package/dist/selection.d.cts +2 -0
- package/dist/selection.d.ts +2 -0
- package/dist/selection.js +2 -0
- package/dist/side-panel.cjs +59 -2
- package/dist/side-panel.cjs.map +1 -0
- package/dist/side-panel.js +58 -1
- package/dist/side-panel.js.map +1 -0
- package/dist/styles.css +39 -39
- package/package.json +33 -23
- package/dist/NaiveFilterSurface-CnhNSSF1.js.map +0 -1
- package/dist/NaiveFilterSurface-DqUmkz-o.cjs.map +0 -1
- package/dist/NaiveRowActions-BR140413.cjs.map +0 -1
- package/dist/NaiveRowActions-DVyMXQJq.js.map +0 -1
- package/dist/assistant-DppW6EN1.cjs +0 -380
- package/dist/assistant-DppW6EN1.cjs.map +0 -1
- package/dist/assistant-_SYRZCOi.js +0 -357
- package/dist/assistant-_SYRZCOi.js.map +0 -1
- package/dist/column-menu-DdWVP1hz.d.cts +0 -23
- package/dist/column-menu-DdWVP1hz.d.cts.map +0 -1
- package/dist/column-menu-DdWVP1hz.d.ts +0 -23
- package/dist/column-menu-DdWVP1hz.d.ts.map +0 -1
- package/dist/command-palette-4qS9viir.cjs +0 -117
- package/dist/command-palette-4qS9viir.cjs.map +0 -1
- package/dist/command-palette-CSI-tgcP.js +0 -112
- package/dist/command-palette-CSI-tgcP.js.map +0 -1
- package/dist/context-menu-CsbLaMcR.js +0 -140
- package/dist/context-menu-CsbLaMcR.js.map +0 -1
- package/dist/context-menu-qVwE9S2V.cjs +0 -145
- package/dist/context-menu-qVwE9S2V.cjs.map +0 -1
- package/dist/editing-BAUOl5Ox.cjs.map +0 -1
- package/dist/export-csv-BU39yRSN.d.ts +0 -9
- package/dist/export-csv-BU39yRSN.d.ts.map +0 -1
- package/dist/export-csv-DRDjZuQj.d.cts +0 -9
- package/dist/export-csv-DRDjZuQj.d.cts.map +0 -1
- package/dist/export-csv.cjs.map +0 -1
- package/dist/export-csv.d.cts +0 -2
- package/dist/export-csv.d.ts +0 -2
- package/dist/export-csv.js +0 -10
- package/dist/export-csv.js.map +0 -1
- package/dist/features.cjs +0 -218
- package/dist/features.d.cts +0 -41
- package/dist/features.d.ts +0 -41
- package/dist/features.js +0 -37
- package/dist/filters-B5JX7H8p.cjs.map +0 -1
- package/dist/filters-BJ48GzqJ.d.ts +0 -66
- package/dist/filters-BJ48GzqJ.d.ts.map +0 -1
- package/dist/filters-C6DvAZ_T.d.cts +0 -66
- package/dist/filters-C6DvAZ_T.d.cts.map +0 -1
- package/dist/filters-DipcT7-T.js.map +0 -1
- package/dist/grouping-panel-BPaPG49S.cjs +0 -151
- package/dist/grouping-panel-BPaPG49S.cjs.map +0 -1
- package/dist/grouping-panel-CYUPSa0u.js +0 -146
- package/dist/grouping-panel-CYUPSa0u.js.map +0 -1
- package/dist/header-filters-CQg6clum.d.cts +0 -52
- package/dist/header-filters-CQg6clum.d.cts.map +0 -1
- package/dist/header-filters-CQg6clum.d.ts +0 -52
- package/dist/header-filters-CQg6clum.d.ts.map +0 -1
- package/dist/row-reorder-2Ztn7QRu.cjs +0 -191
- package/dist/row-reorder-2Ztn7QRu.cjs.map +0 -1
- package/dist/row-reorder-DBzbJ20V.js +0 -186
- package/dist/row-reorder-DBzbJ20V.js.map +0 -1
- package/dist/side-panel-Bf4zBlYZ.cjs +0 -64
- package/dist/side-panel-Bf4zBlYZ.cjs.map +0 -1
- package/dist/side-panel-CLTgXUnb.js +0 -59
- package/dist/side-panel-CLTgXUnb.js.map +0 -1
package/dist/context-menu.js
CHANGED
|
@@ -1,2 +1,140 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { r as htmlRoot, t as naiveButton } from "./button-BxXdDW7A.js";
|
|
2
|
+
import { CONTEXT_MENU_CONTROL, ContextMenuChrome, createMenuNavigation, extendFeature, scheduleTick, slotRender, useScopeActivity } from "@adapttable/vue/adapter";
|
|
3
|
+
import { contextMenu as contextMenu$1 } from "@adapttable/vue/features";
|
|
4
|
+
import { defineComponent, h, shallowRef, watch } from "vue";
|
|
5
|
+
import { NCard, NDivider, NPopover } from "naive-ui";
|
|
6
|
+
//#region src/actions/NaiveContextMenuSurface.ts
|
|
7
|
+
/** Native surfaces apply the shared core's menu-navigation decisions. */
|
|
8
|
+
const NaiveContextMenuSurface = /*#__PURE__*/ defineComponent((props) => {
|
|
9
|
+
const active = useScopeActivity();
|
|
10
|
+
const card = shallowRef(null);
|
|
11
|
+
const navigation = createMenuNavigation();
|
|
12
|
+
const root = () => card.value ? htmlRoot(card.value) : null;
|
|
13
|
+
const entries = () => {
|
|
14
|
+
const panel = root();
|
|
15
|
+
return [...panel?.querySelectorAll("[role=\"menuitem\"]") ?? []].filter((item) => item.closest("[role=\"menu\"]") === panel);
|
|
16
|
+
};
|
|
17
|
+
watch([
|
|
18
|
+
card,
|
|
19
|
+
active,
|
|
20
|
+
() => props.at
|
|
21
|
+
], ([, live], _previous, cleanup) => {
|
|
22
|
+
navigation.reset();
|
|
23
|
+
if (!live) return;
|
|
24
|
+
let current = true;
|
|
25
|
+
scheduleTick(() => {
|
|
26
|
+
if (current && active.value) entries().find((item) => item.getAttribute("aria-disabled") !== "true")?.focus({ preventScroll: true });
|
|
27
|
+
});
|
|
28
|
+
cleanup(() => {
|
|
29
|
+
current = false;
|
|
30
|
+
});
|
|
31
|
+
}, { flush: "post" });
|
|
32
|
+
const keydown = (event) => {
|
|
33
|
+
const panel = root();
|
|
34
|
+
if (!active.value || !panel || !(event.target instanceof Element) || event.target.closest("[role=\"menu\"]") !== panel) return;
|
|
35
|
+
const items = entries();
|
|
36
|
+
const focusTargets = items;
|
|
37
|
+
const action = navigation.key(event, items.map((item) => ({
|
|
38
|
+
label: item.textContent ?? "",
|
|
39
|
+
disabled: item.getAttribute("aria-disabled") === "true"
|
|
40
|
+
})), focusTargets.indexOf(panel.ownerDocument.activeElement));
|
|
41
|
+
if (!action) return;
|
|
42
|
+
if (action.kind !== "close" || action.key !== "Tab") event.preventDefault();
|
|
43
|
+
event.stopPropagation();
|
|
44
|
+
if (action.kind === "close") props.onClose();
|
|
45
|
+
else items[action.index]?.focus({ preventScroll: true });
|
|
46
|
+
};
|
|
47
|
+
return () => {
|
|
48
|
+
const at = props.at;
|
|
49
|
+
const close = () => {
|
|
50
|
+
if (active.value && props.at === at) props.onClose();
|
|
51
|
+
};
|
|
52
|
+
return h(NPopover, {
|
|
53
|
+
trigger: "manual",
|
|
54
|
+
show: active.value,
|
|
55
|
+
x: at.x,
|
|
56
|
+
y: at.y,
|
|
57
|
+
to: props.container ?? false,
|
|
58
|
+
raw: true,
|
|
59
|
+
showArrow: false,
|
|
60
|
+
placement: "bottom-start",
|
|
61
|
+
onClickoutside: close
|
|
62
|
+
}, { default: () => h(NCard, {
|
|
63
|
+
ref: card,
|
|
64
|
+
size: "small",
|
|
65
|
+
role: "menu",
|
|
66
|
+
tabindex: -1,
|
|
67
|
+
"aria-label": props.label,
|
|
68
|
+
"data-adapttable-part": "context-menu",
|
|
69
|
+
class: ["adapttable-naive-context-menu", props.className],
|
|
70
|
+
onKeydown: keydown,
|
|
71
|
+
contentStyle: {
|
|
72
|
+
display: "flex",
|
|
73
|
+
flexDirection: "column",
|
|
74
|
+
gap: "4px"
|
|
75
|
+
},
|
|
76
|
+
style: {
|
|
77
|
+
maxWidth: "90vw",
|
|
78
|
+
maxHeight: "80dvh",
|
|
79
|
+
overflow: "auto"
|
|
80
|
+
}
|
|
81
|
+
}, { default: () => props.children }) });
|
|
82
|
+
};
|
|
83
|
+
}, {
|
|
84
|
+
name: "NaiveContextMenuSurface",
|
|
85
|
+
props: {
|
|
86
|
+
at: { type: Object },
|
|
87
|
+
anchorRef: { type: Object },
|
|
88
|
+
label: { type: String },
|
|
89
|
+
onClose: { type: Function },
|
|
90
|
+
container: { type: Object },
|
|
91
|
+
children: {
|
|
92
|
+
type: [
|
|
93
|
+
String,
|
|
94
|
+
Number,
|
|
95
|
+
Boolean,
|
|
96
|
+
Array,
|
|
97
|
+
Object
|
|
98
|
+
],
|
|
99
|
+
default: void 0
|
|
100
|
+
},
|
|
101
|
+
className: { type: String }
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/context-menu.ts
|
|
106
|
+
function contextSlots(names = {}) {
|
|
107
|
+
return {
|
|
108
|
+
Surface: (props) => h(NaiveContextMenuSurface, props),
|
|
109
|
+
Item: ({ item, onSelect }) => naiveButton({
|
|
110
|
+
role: "menuitem",
|
|
111
|
+
tabindex: -1,
|
|
112
|
+
disabled: item.disabled,
|
|
113
|
+
"aria-disabled": item.disabled,
|
|
114
|
+
"data-danger": item.danger ? "" : void 0,
|
|
115
|
+
"data-adapttable-part": "context-menu-item",
|
|
116
|
+
class: names.contextMenuItem,
|
|
117
|
+
onClick: onSelect
|
|
118
|
+
}, item.label),
|
|
119
|
+
Separator: () => h(NDivider, {
|
|
120
|
+
role: "separator",
|
|
121
|
+
"data-adapttable-part": "context-menu-separator",
|
|
122
|
+
class: names.contextMenuSeparator
|
|
123
|
+
})
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function contextMenu(options = true) {
|
|
127
|
+
return extendFeature(contextMenu$1(options), [slotRender(CONTEXT_MENU_CONTROL, (props) => h(ContextMenuChrome, {
|
|
128
|
+
items: props.model.items,
|
|
129
|
+
at: props.model.at,
|
|
130
|
+
onClose: props.model.close,
|
|
131
|
+
labels: props.labels,
|
|
132
|
+
className: props.classNames?.contextMenu,
|
|
133
|
+
container: props.container,
|
|
134
|
+
slots: contextSlots(props.classNames)
|
|
135
|
+
}))]);
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
2
138
|
export { contextMenu };
|
|
139
|
+
|
|
140
|
+
//# sourceMappingURL=context-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 scheduleTick,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { NCard, NPopover } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\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 scheduleTick(() => {\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,KA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;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"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { a as withoutAttributes, r as htmlRoot, t as naiveButton } from "./button-BxXdDW7A.js";
|
|
2
2
|
import { t as naiveCheckbox } from "./checkbox-GQ0BLv13.js";
|
|
3
3
|
import { t as naiveInput } from "./input-YgQ2d8K9.js";
|
|
4
|
-
import
|
|
4
|
+
import "@adapttable/vue";
|
|
5
|
+
import { BatchEditBarChrome, EditableCellChrome, HistoryButtonsChrome, RowEditActionsChrome, UNDO_REDO_CONTROL, batchEditBarSlotKey, editableCellSlotKey, editableCustomControl, editingFamilyList, elementRef, extendFeature, formatMultiDraft, readMultiDraft, rowEditActionsSlotKey, slotRender, useDataTableClassNames, useEditableCellModel, useElementRef, useScopeActivity } from "@adapttable/vue/adapter";
|
|
5
6
|
import { batchEditing, dirtyIndicators, editHistory, editing, rowEditing, undoRedoButtons } from "@adapttable/vue/features";
|
|
6
7
|
import { Fragment, createBlock, createPropsRestProxy, defineComponent, h, mergeProps, openBlock, shallowRef, useId, watch } from "vue";
|
|
7
8
|
import { NInputNumber, NSelect } from "naive-ui";
|
|
@@ -303,8 +304,6 @@ const NaiveHistoryButtons = defineComponent((props) => {
|
|
|
303
304
|
},
|
|
304
305
|
undoLabel: { type: String },
|
|
305
306
|
redoLabel: { type: String },
|
|
306
|
-
density: { type: String },
|
|
307
|
-
onDensityChange: { type: Function },
|
|
308
307
|
labels: { type: Object },
|
|
309
308
|
classNames: { type: Object }
|
|
310
309
|
}
|
|
@@ -364,7 +363,22 @@ function batchEditing$1(onBatchEdit, extras = {}) {
|
|
|
364
363
|
function undoRedoButtons$1() {
|
|
365
364
|
return extendFeature(undoRedoButtons(), [slotRender(UNDO_REDO_CONTROL, (props) => h(NaiveHistoryButtons, { ...props }))]);
|
|
366
365
|
}
|
|
366
|
+
/**
|
|
367
|
+
* All of editing — cell editing, dirty marks, edit history and undo
|
|
368
|
+
* controls — with this kit's controls, passed to `features` as one entry.
|
|
369
|
+
* Row and batch editing join beside it.
|
|
370
|
+
*
|
|
371
|
+
* @public
|
|
372
|
+
*/
|
|
373
|
+
function editingFamily(onCellEdit, extras) {
|
|
374
|
+
return editingFamilyList({
|
|
375
|
+
editing: (save, more) => editing$1(save, more),
|
|
376
|
+
dirtyIndicators,
|
|
377
|
+
editHistory: () => editHistory(),
|
|
378
|
+
undoRedoButtons: undoRedoButtons$1
|
|
379
|
+
}, onCellEdit, extras);
|
|
380
|
+
}
|
|
367
381
|
//#endregion
|
|
368
|
-
export {
|
|
382
|
+
export { editingFamily as a, _sfc_main as c, editing$1 as i, _sfc_main$1 as l, dirtyIndicators as n, rowEditing$1 as o, editHistory as r, undoRedoButtons$1 as s, batchEditing$1 as t, _sfc_main$2 as u };
|
|
369
383
|
|
|
370
|
-
//# sourceMappingURL=editing-
|
|
384
|
+
//# sourceMappingURL=editing-Btr52gcG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editing-DTOBwNI6.js","names":["NaiveEditableCell","editing","bindingEditing","rowEditing","bindingRowEditing","NaiveRowEditActions","batchEditing","bindingBatchEditing","NaiveBatchEditBar","undoRedoButtons","bindingUndoRedoButtons"],"sources":["../src/editing/naiveEditingButton.ts","../src/editing/NaiveBatchEditBar.vue","../src/editing/NaiveChoiceEditor.ts","../src/editing/NaiveNumberEditor.ts","../src/editing/NaiveEditableCell.vue","../src/editing/NaiveHistoryButtons.ts","../src/editing/NaiveRowEditActions.vue","../src/editing.ts"],"sourcesContent":["import type { EditingActionButtonProps } from \"@adapttable/vue/adapter\";\nimport { mergeProps, type VNodeChild } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\n\nexport function naiveEditingButton(\n control: EditingActionButtonProps,\n className?: string\n) {\n return naiveButton(\n mergeProps(control.attrs, { class: className, onClick: control.onClick }),\n [\n control.icon === false ? null : (control.icon as VNodeChild),\n control.label,\n ]\n );\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n BatchEditBarChrome,\n type BatchEditBarProps,\n useDataTableClassNames,\n} from \"@adapttable/vue/adapter\";\n\nimport { naiveEditingButton } from \"./naiveEditingButton\";\ndefineOptions({ name: \"NaiveBatchEditBar\" });\nconst { contested = undefined, ...props } =\n defineProps<BatchEditBarProps<TRow>>();\nconst names = useDataTableClassNames();\nconst Render = () =>\n BatchEditBarChrome({\n ...props,\n contested,\n className: [props.className, names.value.batchEditBar]\n .filter(Boolean)\n .join(\" \"),\n controls: {\n Button: (control) =>\n naiveEditingButton(control, names.value.batchEditButton),\n },\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","import type { Attrs, ElementRef } from \"@adapttable/vue\";\nimport {\n formatMultiDraft,\n readMultiDraft,\n useElementRef,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { NSelect, type SelectInst } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n type InputHTMLAttributes,\n type PropType,\n shallowRef,\n useId,\n watch,\n} from \"vue\";\n\nimport { withoutAttributes } from \"../controls/attributes\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\ninterface ChoiceEditorProps {\n readonly attrs: Attrs;\n readonly draft: string;\n readonly multiple: boolean;\n readonly options: readonly {\n readonly value: string;\n readonly label: string;\n }[];\n readonly onChange: (value: string) => void;\n readonly onBlur: () => void;\n readonly onKeyDown: (event: KeyboardEvent) => void;\n}\n\n/** NSelect owns its open menu; the binding owns editing keys when that menu is closed. */\nexport const NaiveChoiceEditor = defineComponent(\n (props: ChoiceEditorProps) => {\n const instance = shallowRef<(ComponentPublicInstance & SelectInst) | null>(\n null\n );\n const active = useScopeActivity();\n const show = shallowRef(false);\n const listId = `adapttable-naive-edit-options-${useId()}`;\n watch(\n active,\n (enabled) => {\n if (!enabled) show.value = false;\n },\n { flush: \"sync\" }\n );\n useElementRef(\n () =>\n active.value && instance.value\n ? htmlRoot(instance.value)?.querySelector<HTMLInputElement>(\n 'input[role=\"combobox\"]'\n )\n : null,\n () =>\n typeof props.attrs.ref === \"function\"\n ? (props.attrs.ref as ElementRef)\n : undefined\n );\n let menuKey = false;\n return () => {\n const attrs = withoutAttributes(props.attrs, [\n \"ref\",\n \"onBlur\",\n \"onKeydown\",\n \"id\",\n \"class\",\n \"data-adapttable-part\",\n ]);\n const inputProps = {\n ...attrs,\n id: props.attrs.id as string | undefined,\n class: props.attrs.class as InputHTMLAttributes[\"class\"],\n \"data-adapttable-part\": props.attrs[\"data-adapttable-part\"],\n role: \"combobox\",\n \"aria-autocomplete\": \"list\" as const,\n \"aria-expanded\": show.value,\n \"aria-controls\": listId,\n };\n return h(NSelect, {\n ref: instance,\n size: \"small\",\n disabled: props.attrs.disabled === true,\n filterable: true,\n to: false,\n show: active.value && show.value,\n multiple: props.multiple,\n value: props.multiple ? readMultiDraft(props.draft) : props.draft,\n options: [...props.options],\n inputProps,\n menuProps: {\n id: listId,\n role: \"listbox\",\n \"aria-multiselectable\": props.multiple || undefined,\n },\n nodeProps: (option) => ({\n role: \"option\",\n \"aria-selected\": props.multiple\n ? readMultiDraft(props.draft).includes(String(option.value))\n : option.value === props.draft,\n }),\n \"onUpdate:value\": (\n value: string | number | (string | number)[] | null\n ) => {\n if (!active.value) return;\n const draft = Array.isArray(value)\n ? formatMultiDraft(value.map(String))\n : String(value ?? \"\");\n props.onChange(draft);\n },\n \"onUpdate:show\": (value: boolean) => {\n if (active.value) show.value = value;\n },\n onBlur: () => {\n if (active.value) props.onBlur();\n },\n onKeydownCapture: (event: KeyboardEvent) => {\n menuKey =\n show.value &&\n [\"Escape\", \"Enter\", \"ArrowUp\", \"ArrowDown\", \"Home\", \"End\"].includes(\n event.key\n );\n },\n onKeydown: (event: KeyboardEvent) => {\n if (!active.value) return;\n if (menuKey) {\n event.stopPropagation();\n if (event.key === \"Escape\") instance.value?.focusInput();\n } else props.onKeyDown(event);\n menuKey = false;\n },\n });\n };\n },\n {\n name: \"NaiveChoiceEditor\",\n inheritAttrs: false,\n props: {\n attrs: { type: Object as PropType<ChoiceEditorProps[\"attrs\"]> },\n draft: { type: String as PropType<ChoiceEditorProps[\"draft\"]> },\n multiple: {\n type: Boolean as PropType<ChoiceEditorProps[\"multiple\"]>,\n default: undefined,\n },\n options: { type: Array as PropType<ChoiceEditorProps[\"options\"]> },\n onChange: { type: Function as PropType<ChoiceEditorProps[\"onChange\"]> },\n onBlur: { type: Function as PropType<ChoiceEditorProps[\"onBlur\"]> },\n onKeyDown: { type: Function as PropType<ChoiceEditorProps[\"onKeyDown\"]> },\n },\n }\n);\n","import type { Attrs, ElementRef } from \"@adapttable/vue\";\nimport { useElementRef, useScopeActivity } from \"@adapttable/vue/adapter\";\nimport { NInputNumber } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n type PropType,\n shallowRef,\n} from \"vue\";\n\nimport { withoutAttributes } from \"../controls/attributes\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\ninterface NumberEditorProps {\n readonly attrs: Attrs;\n readonly draft: string;\n readonly onChange: (value: string) => void;\n readonly onBlur: () => void;\n}\n\n/** The public formatter preserves the binding's raw draft through vendor blur formatting. */\nexport const NaiveNumberEditor = defineComponent(\n (props: NumberEditorProps) => {\n const active = useScopeActivity();\n const instance = shallowRef<ComponentPublicInstance | null>(null);\n useElementRef(\n () =>\n active.value && instance.value\n ? htmlRoot(instance.value)?.querySelector<HTMLInputElement>(\n 'input[role=\"spinbutton\"]'\n )\n : null,\n () =>\n typeof props.attrs.ref === \"function\"\n ? (props.attrs.ref as ElementRef)\n : undefined\n );\n return () =>\n h(NInputNumber, {\n ref: instance,\n size: \"small\",\n disabled: props.attrs.disabled === true,\n readonly:\n props.attrs.readonly === true || props.attrs.readOnly === true,\n value:\n props.draft.trim() !== \"\" && Number.isFinite(Number(props.draft))\n ? Number(props.draft)\n : null,\n format: () => props.draft,\n showButton: false,\n inputProps: {\n ...withoutAttributes(props.attrs, [\"ref\", \"onBlur\"]),\n role: \"spinbutton\",\n onInput: (event: Event) => {\n if (active.value)\n props.onChange((event.currentTarget as HTMLInputElement).value);\n },\n },\n \"onUpdate:value\": (value: number | null) => {\n if (active.value) props.onChange(value === null ? \"\" : String(value));\n },\n onBlur: () => {\n if (active.value) props.onBlur();\n },\n });\n },\n {\n name: \"NaiveNumberEditor\",\n inheritAttrs: false,\n props: {\n attrs: { type: Object as PropType<NumberEditorProps[\"attrs\"]> },\n draft: { type: String as PropType<NumberEditorProps[\"draft\"]> },\n onChange: { type: Function as PropType<NumberEditorProps[\"onChange\"]> },\n onBlur: { type: Function as PropType<NumberEditorProps[\"onBlur\"]> },\n },\n }\n);\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n EditableCellChrome,\n type EditableCellChromeSlots,\n editableCustomControl,\n elementRef,\n useDataTableClassNames,\n useEditableCellModel,\n type VueEditableCellProps,\n} from \"@adapttable/vue/adapter\";\nimport { Fragment, h, mergeProps, type VNodeChild } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { naiveCheckbox } from \"../controls/checkbox\";\nimport { naiveInput } from \"../controls/input\";\nimport { NaiveChoiceEditor } from \"./NaiveChoiceEditor\";\nimport { NaiveNumberEditor } from \"./NaiveNumberEditor\";\n\nconst props = defineProps<VueEditableCellProps<TRow>>();\nconst names = useDataTableClassNames();\nconst model = useEditableCellModel(() => props);\nconst controls: EditableCellChromeSlots<TRow> = {\n Activate: (control) =>\n naiveButton(\n {\n title: control.title,\n \"aria-description\": control.title,\n class: [control.className, names.value.editCellActivate],\n ref: elementRef(control.activateRef),\n \"data-adapttable-part\": \"edit-cell-activate\",\n \"data-save-status\": control.saveStatus,\n \"data-dirty\": control.dirty ? \"\" : undefined,\n onClick: control.onClick,\n onDblclick: control.onDoubleClick,\n onKeydown: control.onKeyDown,\n },\n control.display,\n { text: true }\n ),\n Editor: (control) => {\n const editor = control.controller.editor;\n const attrs = mergeProps(control.attrs, {\n ref: elementRef<HTMLElement>(control.editorRef),\n class: names.value.editCellEditor,\n onBlur: control.onBlur,\n onKeydown: control.onKeyDown,\n });\n if (editor && typeof editor === \"object\") {\n if (editor.type === \"custom\")\n return h(Fragment, [\n editor.render(editableCustomControl(model.value)) as VNodeChild,\n ]);\n return h(NaiveChoiceEditor, {\n attrs,\n draft: control.controller.draft,\n multiple: editor.type === \"multi-select\",\n options: control.controller.selectOptions,\n onChange: control.onChange,\n onBlur: control.onBlur,\n onKeyDown: control.onKeyDown,\n });\n }\n if (editor === \"number\")\n return h(NaiveNumberEditor, {\n attrs,\n draft: control.controller.draft,\n onChange: control.onChange,\n onBlur: control.onBlur,\n });\n if (editor === \"boolean\")\n return naiveCheckbox({\n attrs,\n checked: control.controller.draft === \"true\",\n indeterminate: false,\n onToggle: () =>\n control.onChange(String(control.controller.draft !== \"true\")),\n });\n return naiveInput({\n attrs: {\n ...attrs,\n type: editor === \"datetime\" ? \"datetime-local\" : (editor ?? \"text\"),\n },\n value: control.controller.draft,\n onChange: control.onChange,\n });\n },\n Button: (control) =>\n naiveButton(\n {\n class: [\n control.className,\n control.part === \"edit-cell-rollback\"\n ? names.value.editCellRollback\n : names.value.editCellConflictButton,\n ],\n \"data-adapttable-part\": control.part,\n onMousedown: control.onMouseDown,\n onClick: control.onClick,\n },\n control.label\n ),\n};\nconst Render = () =>\n EditableCellChrome({ model: model.value, controls, classNames: names.value });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n","import {\n HistoryButtonsChrome,\n type ToolbarExtrasSlotProps,\n useDataTableClassNames,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, type PropType } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\n\nexport const NaiveHistoryButtons = defineComponent(\n (props: ToolbarExtrasSlotProps) => {\n const names = useDataTableClassNames();\n return () =>\n HistoryButtonsChrome({\n ...props,\n classNames: { ...names.value },\n slots: { Button: ({ label, attrs }) => naiveButton(attrs, label) },\n });\n },\n {\n name: \"NaiveHistoryButtons\",\n props: {\n onUndo: { type: Function as PropType<ToolbarExtrasSlotProps[\"onUndo\"]> },\n onRedo: { type: Function as PropType<ToolbarExtrasSlotProps[\"onRedo\"]> },\n canUndo: {\n type: Boolean as PropType<ToolbarExtrasSlotProps[\"canUndo\"]>,\n default: undefined,\n },\n canRedo: {\n type: Boolean as PropType<ToolbarExtrasSlotProps[\"canRedo\"]>,\n default: undefined,\n },\n undoLabel: {\n type: String as PropType<ToolbarExtrasSlotProps[\"undoLabel\"]>,\n },\n redoLabel: {\n type: String as PropType<ToolbarExtrasSlotProps[\"redoLabel\"]>,\n },\n density: { type: String as PropType<ToolbarExtrasSlotProps[\"density\"]> },\n onDensityChange: {\n type: Function as PropType<ToolbarExtrasSlotProps[\"onDensityChange\"]>,\n },\n labels: { type: Object as PropType<ToolbarExtrasSlotProps[\"labels\"]> },\n classNames: {\n type: Object as PropType<ToolbarExtrasSlotProps[\"classNames\"]>,\n },\n },\n }\n);\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n RowEditActionsChrome,\n type RowEditActionsProps,\n useDataTableClassNames,\n} from \"@adapttable/vue/adapter\";\n\nimport { naiveEditingButton } from \"./naiveEditingButton\";\ndefineOptions({ name: \"NaiveRowEditActions\" });\nconst { showBegin = undefined, ...props } =\n defineProps<RowEditActionsProps<TRow>>();\nconst names = useDataTableClassNames();\nconst Render = () =>\n RowEditActionsChrome({\n ...props,\n showBegin,\n className: [props.className, names.value.rowEditActions]\n .filter(Boolean)\n .join(\" \"),\n controls: {\n Button: (control) =>\n naiveEditingButton(control, names.value.rowEditButton),\n },\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","import type {\n CellEditHandler,\n StaticTableFeature,\n TableEditingOptions,\n TableFeature,\n} from \"@adapttable/vue\";\nimport {\n batchEditBarSlotKey,\n editableCellSlotKey,\n extendFeature,\n rowEditActionsSlotKey,\n slotRender,\n UNDO_REDO_CONTROL,\n} from \"@adapttable/vue/adapter\";\nimport {\n batchEditing as bindingBatchEditing,\n editing as bindingEditing,\n type EditingLifecycleExtras,\n rowEditing as bindingRowEditing,\n undoRedoButtons as bindingUndoRedoButtons,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport NaiveBatchEditBar from \"./editing/NaiveBatchEditBar.vue\";\nimport NaiveEditableCell from \"./editing/NaiveEditableCell.vue\";\nimport { NaiveHistoryButtons } from \"./editing/NaiveHistoryButtons\";\nimport NaiveRowEditActions from \"./editing/NaiveRowEditActions.vue\";\n\nfunction cellSlot<TRow>() {\n return slotRender(editableCellSlotKey<TRow>(), (props) =>\n h(NaiveEditableCell<TRow>, { ...props })\n );\n}\n\n/** Naive controls keep all validation, save and host-write transitions in the binding. */\nexport function editing<TRow>(\n onCellEdit: CellEditHandler<TRow>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingEditing(onCellEdit, extras), [cellSlot<TRow>()]);\n}\n\n/** Edit a row as one gesture with explicit Naive UI Save and Cancel controls. */\nexport function rowEditing<TRow>(\n onRowEdit: NonNullable<TableEditingOptions<TRow>[\"onRowEdit\"]>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingRowEditing(onRowEdit, extras), [\n cellSlot<TRow>(),\n slotRender(rowEditActionsSlotKey<TRow>(), (props) =>\n h(NaiveRowEditActions<TRow>, { ...props })\n ),\n ]);\n}\n\n/** Stage edits across rows; host writes happen only on the batch Save action. */\nexport function batchEditing<TRow>(\n onBatchEdit: NonNullable<TableEditingOptions<TRow>[\"onBatchEdit\"]>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingBatchEditing(onBatchEdit, extras), [\n cellSlot<TRow>(),\n slotRender(batchEditBarSlotKey<TRow>(), (props) =>\n h(NaiveBatchEditBar<TRow>, { ...props })\n ),\n ]);\n}\n\nexport { default as NaiveBatchEditBar } from \"./editing/NaiveBatchEditBar.vue\";\nexport { default as NaiveEditableCell } from \"./editing/NaiveEditableCell.vue\";\nexport { default as NaiveRowEditActions } from \"./editing/NaiveRowEditActions.vue\";\nexport type {\n BatchEditingState,\n BatchRowEdit,\n CellEditHandler,\n RowEditingState,\n TableEditingOptions,\n} from \"@adapttable/vue\";\nexport type { RowEditIcons } from \"@adapttable/vue/adapter\";\nexport type { EditingLifecycleExtras } from \"@adapttable/vue/features\";\nexport { dirtyIndicators, editHistory } from \"@adapttable/vue/features\";\n\n/** Opt-in Naive UI Undo and Redo buttons use the shell's history projection. */\nexport function undoRedoButtons(): StaticTableFeature {\n return extendFeature(bindingUndoRedoButtons(), [\n slotRender(UNDO_REDO_CONTROL, (props) =>\n h(NaiveHistoryButtons, { ...props })\n ),\n ]);\n}\n"],"mappings":";;;;;;;;AAKA,SAAgB,mBACd,SACA,WACA;CACA,OAAO,YACL,WAAW,QAAQ,OAAO;EAAE,OAAO;EAAW,SAAS,QAAQ;CAAQ,CAAC,GACxE,CACE,QAAQ,SAAS,QAAQ,OAAQ,QAAQ,MACzC,QAAQ,KACV,CACF;AACF;;;;;;;;;;;;;;;;;ECPA,MAAM,QACJ,qBAAA,SAAA,CAAA,WAAA,CAAA;EACF,MAAM,QAAQ,uBAAuB;EACrC,MAAM,eACJ,mBAAmB;GACjB,GAAG;GACH,WAAQ,QAAA;GACR,WAAW,CAAC,MAAM,WAAW,MAAM,MAAM,YAAY,CAAA,CAClD,OAAO,OAAO,CAAA,CACd,KAAK,GAAG;GACX,UAAU,EACR,SAAS,YACP,mBAAmB,SAAS,MAAM,MAAM,eAAe,EAC3D;EACF,CAAC;EAIH,OAAO,QAAQ,CAAA;;GAIb,OAAA,UAAA,GAAA,YA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,WAA2B,EAAE,GAAG,MAAM,CAAC,CAC3C,CACF,CAAC;AACH;;AAGA,SAAgBC,eACd,aACA,SAAuC,CAAC,GACpB;CACpB,OAAO,cAAcC,aAAoB,aAAa,MAAM,GAAG,CAC7D,SAAe,GACf,WAAW,oBAA0B,IAAI,UACvC,EAAEC,aAAyB,EAAE,GAAG,MAAM,CAAC,CACzC,CACF,CAAC;AACH;;AAiBA,SAAgBC,oBAAsC;CACpD,OAAO,cAAcC,gBAAuB,GAAG,CAC7C,WAAW,oBAAoB,UAC7B,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC,CACrC,CACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"editing-Btr52gcG.js","names":["NaiveEditableCell","editing","bindingEditing","rowEditing","bindingRowEditing","NaiveRowEditActions","batchEditing","bindingBatchEditing","NaiveBatchEditBar","undoRedoButtons","bindingUndoRedoButtons"],"sources":["../src/editing/naiveEditingButton.ts","../src/editing/NaiveBatchEditBar.vue","../src/editing/NaiveChoiceEditor.ts","../src/editing/NaiveNumberEditor.ts","../src/editing/NaiveEditableCell.vue","../src/editing/NaiveHistoryButtons.ts","../src/editing/NaiveRowEditActions.vue","../src/editing.ts"],"sourcesContent":["import type { EditingActionButtonProps } from \"@adapttable/vue/adapter\";\nimport { mergeProps, type VNodeChild } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\n\nexport function naiveEditingButton(\n control: EditingActionButtonProps,\n className?: string\n) {\n return naiveButton(\n mergeProps(control.attrs, { class: className, onClick: control.onClick }),\n [\n control.icon === false ? null : (control.icon as VNodeChild),\n control.label,\n ]\n );\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n BatchEditBarChrome,\n type BatchEditBarProps,\n useDataTableClassNames,\n} from \"@adapttable/vue/adapter\";\n\nimport { naiveEditingButton } from \"./naiveEditingButton\";\ndefineOptions({ name: \"NaiveBatchEditBar\" });\nconst { contested = undefined, ...props } =\n defineProps<BatchEditBarProps<TRow>>();\nconst names = useDataTableClassNames();\nconst Render = () =>\n BatchEditBarChrome({\n ...props,\n contested,\n className: [props.className, names.value.batchEditBar]\n .filter(Boolean)\n .join(\" \"),\n controls: {\n Button: (control) =>\n naiveEditingButton(control, names.value.batchEditButton),\n },\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","import type { Attrs, ElementRef } from \"@adapttable/vue\";\nimport {\n formatMultiDraft,\n readMultiDraft,\n useElementRef,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { NSelect, type SelectInst } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n type InputHTMLAttributes,\n type PropType,\n shallowRef,\n useId,\n watch,\n} from \"vue\";\n\nimport { withoutAttributes } from \"../controls/attributes\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\ninterface ChoiceEditorProps {\n readonly attrs: Attrs;\n readonly draft: string;\n readonly multiple: boolean;\n readonly options: readonly {\n readonly value: string;\n readonly label: string;\n }[];\n readonly onChange: (value: string) => void;\n readonly onBlur: () => void;\n readonly onKeyDown: (event: KeyboardEvent) => void;\n}\n\n/** NSelect owns its open menu; the binding owns editing keys when that menu is closed. */\nexport const NaiveChoiceEditor = defineComponent(\n (props: ChoiceEditorProps) => {\n const instance = shallowRef<(ComponentPublicInstance & SelectInst) | null>(\n null\n );\n const active = useScopeActivity();\n const show = shallowRef(false);\n const listId = `adapttable-naive-edit-options-${useId()}`;\n watch(\n active,\n (enabled) => {\n if (!enabled) show.value = false;\n },\n { flush: \"sync\" }\n );\n useElementRef(\n () =>\n active.value && instance.value\n ? htmlRoot(instance.value)?.querySelector<HTMLInputElement>(\n 'input[role=\"combobox\"]'\n )\n : null,\n () =>\n typeof props.attrs.ref === \"function\"\n ? (props.attrs.ref as ElementRef)\n : undefined\n );\n let menuKey = false;\n return () => {\n const attrs = withoutAttributes(props.attrs, [\n \"ref\",\n \"onBlur\",\n \"onKeydown\",\n \"id\",\n \"class\",\n \"data-adapttable-part\",\n ]);\n const inputProps = {\n ...attrs,\n id: props.attrs.id as string | undefined,\n class: props.attrs.class as InputHTMLAttributes[\"class\"],\n \"data-adapttable-part\": props.attrs[\"data-adapttable-part\"],\n role: \"combobox\",\n \"aria-autocomplete\": \"list\" as const,\n \"aria-expanded\": show.value,\n \"aria-controls\": listId,\n };\n return h(NSelect, {\n ref: instance,\n size: \"small\",\n disabled: props.attrs.disabled === true,\n filterable: true,\n to: false,\n show: active.value && show.value,\n multiple: props.multiple,\n value: props.multiple ? readMultiDraft(props.draft) : props.draft,\n options: [...props.options],\n inputProps,\n menuProps: {\n id: listId,\n role: \"listbox\",\n \"aria-multiselectable\": props.multiple || undefined,\n },\n nodeProps: (option) => ({\n role: \"option\",\n \"aria-selected\": props.multiple\n ? readMultiDraft(props.draft).includes(String(option.value))\n : option.value === props.draft,\n }),\n \"onUpdate:value\": (\n value: string | number | (string | number)[] | null\n ) => {\n if (!active.value) return;\n const draft = Array.isArray(value)\n ? formatMultiDraft(value.map(String))\n : String(value ?? \"\");\n props.onChange(draft);\n },\n \"onUpdate:show\": (value: boolean) => {\n if (active.value) show.value = value;\n },\n onBlur: () => {\n if (active.value) props.onBlur();\n },\n onKeydownCapture: (event: KeyboardEvent) => {\n menuKey =\n show.value &&\n [\"Escape\", \"Enter\", \"ArrowUp\", \"ArrowDown\", \"Home\", \"End\"].includes(\n event.key\n );\n },\n onKeydown: (event: KeyboardEvent) => {\n if (!active.value) return;\n if (menuKey) {\n event.stopPropagation();\n if (event.key === \"Escape\") instance.value?.focusInput();\n } else props.onKeyDown(event);\n menuKey = false;\n },\n });\n };\n },\n {\n name: \"NaiveChoiceEditor\",\n inheritAttrs: false,\n props: {\n attrs: { type: Object as PropType<ChoiceEditorProps[\"attrs\"]> },\n draft: { type: String as PropType<ChoiceEditorProps[\"draft\"]> },\n multiple: {\n type: Boolean as PropType<ChoiceEditorProps[\"multiple\"]>,\n default: undefined,\n },\n options: { type: Array as PropType<ChoiceEditorProps[\"options\"]> },\n onChange: { type: Function as PropType<ChoiceEditorProps[\"onChange\"]> },\n onBlur: { type: Function as PropType<ChoiceEditorProps[\"onBlur\"]> },\n onKeyDown: { type: Function as PropType<ChoiceEditorProps[\"onKeyDown\"]> },\n },\n }\n);\n","import type { Attrs, ElementRef } from \"@adapttable/vue\";\nimport { useElementRef, useScopeActivity } from \"@adapttable/vue/adapter\";\nimport { NInputNumber } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n type PropType,\n shallowRef,\n} from \"vue\";\n\nimport { withoutAttributes } from \"../controls/attributes\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\ninterface NumberEditorProps {\n readonly attrs: Attrs;\n readonly draft: string;\n readonly onChange: (value: string) => void;\n readonly onBlur: () => void;\n}\n\n/** The public formatter preserves the binding's raw draft through vendor blur formatting. */\nexport const NaiveNumberEditor = defineComponent(\n (props: NumberEditorProps) => {\n const active = useScopeActivity();\n const instance = shallowRef<ComponentPublicInstance | null>(null);\n useElementRef(\n () =>\n active.value && instance.value\n ? htmlRoot(instance.value)?.querySelector<HTMLInputElement>(\n 'input[role=\"spinbutton\"]'\n )\n : null,\n () =>\n typeof props.attrs.ref === \"function\"\n ? (props.attrs.ref as ElementRef)\n : undefined\n );\n return () =>\n h(NInputNumber, {\n ref: instance,\n size: \"small\",\n disabled: props.attrs.disabled === true,\n readonly:\n props.attrs.readonly === true || props.attrs.readOnly === true,\n value:\n props.draft.trim() !== \"\" && Number.isFinite(Number(props.draft))\n ? Number(props.draft)\n : null,\n format: () => props.draft,\n showButton: false,\n inputProps: {\n ...withoutAttributes(props.attrs, [\"ref\", \"onBlur\"]),\n role: \"spinbutton\",\n onInput: (event: Event) => {\n if (active.value)\n props.onChange((event.currentTarget as HTMLInputElement).value);\n },\n },\n \"onUpdate:value\": (value: number | null) => {\n if (active.value) props.onChange(value === null ? \"\" : String(value));\n },\n onBlur: () => {\n if (active.value) props.onBlur();\n },\n });\n },\n {\n name: \"NaiveNumberEditor\",\n inheritAttrs: false,\n props: {\n attrs: { type: Object as PropType<NumberEditorProps[\"attrs\"]> },\n draft: { type: String as PropType<NumberEditorProps[\"draft\"]> },\n onChange: { type: Function as PropType<NumberEditorProps[\"onChange\"]> },\n onBlur: { type: Function as PropType<NumberEditorProps[\"onBlur\"]> },\n },\n }\n);\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n EditableCellChrome,\n type EditableCellChromeSlots,\n editableCustomControl,\n elementRef,\n useDataTableClassNames,\n useEditableCellModel,\n type VueEditableCellProps,\n} from \"@adapttable/vue/adapter\";\nimport { Fragment, h, mergeProps, type VNodeChild } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { naiveCheckbox } from \"../controls/checkbox\";\nimport { naiveInput } from \"../controls/input\";\nimport { NaiveChoiceEditor } from \"./NaiveChoiceEditor\";\nimport { NaiveNumberEditor } from \"./NaiveNumberEditor\";\n\nconst props = defineProps<VueEditableCellProps<TRow>>();\nconst names = useDataTableClassNames();\nconst model = useEditableCellModel(() => props);\nconst controls: EditableCellChromeSlots<TRow> = {\n Activate: (control) =>\n naiveButton(\n {\n title: control.title,\n \"aria-description\": control.title,\n class: [control.className, names.value.editCellActivate],\n ref: elementRef(control.activateRef),\n \"data-adapttable-part\": \"edit-cell-activate\",\n \"data-save-status\": control.saveStatus,\n \"data-dirty\": control.dirty ? \"\" : undefined,\n onClick: control.onClick,\n onDblclick: control.onDoubleClick,\n onKeydown: control.onKeyDown,\n },\n control.display,\n { text: true }\n ),\n Editor: (control) => {\n const editor = control.controller.editor;\n const attrs = mergeProps(control.attrs, {\n ref: elementRef<HTMLElement>(control.editorRef),\n class: names.value.editCellEditor,\n onBlur: control.onBlur,\n onKeydown: control.onKeyDown,\n });\n if (editor && typeof editor === \"object\") {\n if (editor.type === \"custom\")\n return h(Fragment, [\n editor.render(editableCustomControl(model.value)) as VNodeChild,\n ]);\n return h(NaiveChoiceEditor, {\n attrs,\n draft: control.controller.draft,\n multiple: editor.type === \"multi-select\",\n options: control.controller.selectOptions,\n onChange: control.onChange,\n onBlur: control.onBlur,\n onKeyDown: control.onKeyDown,\n });\n }\n if (editor === \"number\")\n return h(NaiveNumberEditor, {\n attrs,\n draft: control.controller.draft,\n onChange: control.onChange,\n onBlur: control.onBlur,\n });\n if (editor === \"boolean\")\n return naiveCheckbox({\n attrs,\n checked: control.controller.draft === \"true\",\n indeterminate: false,\n onToggle: () =>\n control.onChange(String(control.controller.draft !== \"true\")),\n });\n return naiveInput({\n attrs: {\n ...attrs,\n type: editor === \"datetime\" ? \"datetime-local\" : (editor ?? \"text\"),\n },\n value: control.controller.draft,\n onChange: control.onChange,\n });\n },\n Button: (control) =>\n naiveButton(\n {\n class: [\n control.className,\n control.part === \"edit-cell-rollback\"\n ? names.value.editCellRollback\n : names.value.editCellConflictButton,\n ],\n \"data-adapttable-part\": control.part,\n onMousedown: control.onMouseDown,\n onClick: control.onClick,\n },\n control.label\n ),\n};\nconst Render = () =>\n EditableCellChrome({ model: model.value, controls, classNames: names.value });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n","import {\n HistoryButtonsChrome,\n type UndoRedoControlProps,\n useDataTableClassNames,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, type PropType } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\n\nexport const NaiveHistoryButtons = defineComponent(\n (props: UndoRedoControlProps) => {\n const names = useDataTableClassNames();\n return () =>\n HistoryButtonsChrome({\n ...props,\n classNames: { ...names.value },\n slots: { Button: ({ label, attrs }) => naiveButton(attrs, label) },\n });\n },\n {\n name: \"NaiveHistoryButtons\",\n props: {\n onUndo: { type: Function as PropType<UndoRedoControlProps[\"onUndo\"]> },\n onRedo: { type: Function as PropType<UndoRedoControlProps[\"onRedo\"]> },\n canUndo: {\n type: Boolean as PropType<UndoRedoControlProps[\"canUndo\"]>,\n default: undefined,\n },\n canRedo: {\n type: Boolean as PropType<UndoRedoControlProps[\"canRedo\"]>,\n default: undefined,\n },\n undoLabel: {\n type: String as PropType<UndoRedoControlProps[\"undoLabel\"]>,\n },\n redoLabel: {\n type: String as PropType<UndoRedoControlProps[\"redoLabel\"]>,\n },\n labels: { type: Object as PropType<UndoRedoControlProps[\"labels\"]> },\n classNames: {\n type: Object as PropType<UndoRedoControlProps[\"classNames\"]>,\n },\n },\n }\n);\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n RowEditActionsChrome,\n type RowEditActionsProps,\n useDataTableClassNames,\n} from \"@adapttable/vue/adapter\";\n\nimport { naiveEditingButton } from \"./naiveEditingButton\";\ndefineOptions({ name: \"NaiveRowEditActions\" });\nconst { showBegin = undefined, ...props } =\n defineProps<RowEditActionsProps<TRow>>();\nconst names = useDataTableClassNames();\nconst Render = () =>\n RowEditActionsChrome({\n ...props,\n showBegin,\n className: [props.className, names.value.rowEditActions]\n .filter(Boolean)\n .join(\" \"),\n controls: {\n Button: (control) =>\n naiveEditingButton(control, names.value.rowEditButton),\n },\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","import {\n type CellEditHandler,\n type StaticTableFeature,\n type TableEditingOptions,\n type TableFeature,\n} from \"@adapttable/vue\";\nimport {\n batchEditBarSlotKey,\n editableCellSlotKey,\n editingFamilyList,\n extendFeature,\n rowEditActionsSlotKey,\n slotRender,\n UNDO_REDO_CONTROL,\n} from \"@adapttable/vue/adapter\";\nimport {\n batchEditing as bindingBatchEditing,\n dirtyIndicators,\n editHistory,\n editing as bindingEditing,\n type EditingLifecycleExtras,\n rowEditing as bindingRowEditing,\n undoRedoButtons as bindingUndoRedoButtons,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport NaiveBatchEditBar from \"./editing/NaiveBatchEditBar.vue\";\nimport NaiveEditableCell from \"./editing/NaiveEditableCell.vue\";\nimport { NaiveHistoryButtons } from \"./editing/NaiveHistoryButtons\";\nimport NaiveRowEditActions from \"./editing/NaiveRowEditActions.vue\";\n\nfunction cellSlot<TRow>() {\n return slotRender(editableCellSlotKey<TRow>(), (props) =>\n h(NaiveEditableCell<TRow>, { ...props })\n );\n}\n\n/** Naive controls keep all validation, save and host-write transitions in the binding. */\nexport function editing<TRow>(\n onCellEdit: CellEditHandler<TRow>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingEditing(onCellEdit, extras), [cellSlot<TRow>()]);\n}\n\n/** Edit a row as one gesture with explicit Naive UI Save and Cancel controls. */\nexport function rowEditing<TRow>(\n onRowEdit: NonNullable<TableEditingOptions<TRow>[\"onRowEdit\"]>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingRowEditing(onRowEdit, extras), [\n cellSlot<TRow>(),\n slotRender(rowEditActionsSlotKey<TRow>(), (props) =>\n h(NaiveRowEditActions<TRow>, { ...props })\n ),\n ]);\n}\n\n/** Stage edits across rows; host writes happen only on the batch Save action. */\nexport function batchEditing<TRow>(\n onBatchEdit: NonNullable<TableEditingOptions<TRow>[\"onBatchEdit\"]>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingBatchEditing(onBatchEdit, extras), [\n cellSlot<TRow>(),\n slotRender(batchEditBarSlotKey<TRow>(), (props) =>\n h(NaiveBatchEditBar<TRow>, { ...props })\n ),\n ]);\n}\n\nexport { default as NaiveBatchEditBar } from \"./editing/NaiveBatchEditBar.vue\";\nexport { default as NaiveEditableCell } from \"./editing/NaiveEditableCell.vue\";\nexport { default as NaiveRowEditActions } from \"./editing/NaiveRowEditActions.vue\";\nexport type {\n BatchEditingState,\n BatchRowEdit,\n CellEditHandler,\n RowEditingState,\n TableEditingOptions,\n} from \"@adapttable/vue\";\nexport type { RowEditIcons } from \"@adapttable/vue/adapter\";\nexport type { EditingLifecycleExtras } from \"@adapttable/vue/features\";\nexport { dirtyIndicators, editHistory };\n\n/** Opt-in Naive UI Undo and Redo buttons use the shell's history projection. */\nexport function undoRedoButtons(): StaticTableFeature {\n return extendFeature(bindingUndoRedoButtons(), [\n slotRender(UNDO_REDO_CONTROL, (props) =>\n h(NaiveHistoryButtons, { ...props })\n ),\n ]);\n}\n\n/**\n * All of editing — cell editing, dirty marks, edit history and undo\n * controls — with this kit's controls, passed to `features` as one entry.\n * Row and batch editing join beside it.\n *\n * @public\n */\nexport function editingFamily<TRow>(\n onCellEdit: CellEditHandler<TRow>,\n extras?: EditingLifecycleExtras<TRow>\n): readonly TableFeature<TRow>[] {\n return editingFamilyList<\n TableFeature<TRow>,\n CellEditHandler<TRow>,\n EditingLifecycleExtras<TRow> | undefined\n >(\n {\n editing: (save, more) => editing(save, more),\n dirtyIndicators,\n editHistory: () => editHistory(),\n undoRedoButtons,\n },\n onCellEdit,\n extras\n );\n}\n"],"mappings":";;;;;;;;;AAKA,SAAgB,mBACd,SACA,WACA;CACA,OAAO,YACL,WAAW,QAAQ,OAAO;EAAE,OAAO;EAAW,SAAS,QAAQ;CAAQ,CAAC,GACxE,CACE,QAAQ,SAAS,QAAQ,OAAQ,QAAQ,MACzC,QAAQ,KACV,CACF;AACF;;;;;;;;;;;;;;;;;ECPA,MAAM,QACJ,qBAAA,SAAA,CAAA,WAAA,CAAA;EACF,MAAM,QAAQ,uBAAuB;EACrC,MAAM,eACJ,mBAAmB;GACjB,GAAG;GACH,WAAQ,QAAA;GACR,WAAW,CAAC,MAAM,WAAW,MAAM,MAAM,YAAY,CAAA,CAClD,OAAO,OAAO,CAAA,CACd,KAAK,GAAG;GACX,UAAU,EACR,SAAS,YACP,mBAAmB,SAAS,MAAM,MAAM,eAAe,EAC3D;EACF,CAAC;EAIH,OAAO,QAAQ,CAAA;;GAIb,OAAA,UAAA,GAAA,YAAU,MAAA;;;;;;;ACKZ,MAAa,oBAAoB,iBAC9B,UAA6B;CAC5B,MAAM,WA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Aa,MAAM,GAAG,CAC7D,SAAe,GACf,WAAW,oBAA0B,IAAI,UACvC,EAAEC,aAAyB,EAAE,GAAG,MAAM,CAAC,CACzC,CACF,CAAC;AACH;;AAiBA,SAAgBC,oBAAsC;CACpD,OAAO,cAAcC,gBAAuB,GAAG,CAC7C,WAAW,oBAAoB,UAC7B,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC,CACrC,CACF,CAAC;AACH;;;;;;;;AASA,SAAgB,cACd,YACA,QAC+B;CAC/B,OAAO,kBAKL;EACE,UAAU,MAAM,SAAST,UAAQ,MAAM,IAAI;EAC3C;EACA,mBAAmB,YAAY;EAC/B,iBAAA;CACF,GACA,YACA,MACF;AACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const require_button = require("./button-CaakTzYM.cjs");
|
|
2
2
|
const require_checkbox = require("./checkbox-DcANe2ru.cjs");
|
|
3
3
|
const require_input = require("./input-DZV2IoAG.cjs");
|
|
4
|
+
require("@adapttable/vue");
|
|
4
5
|
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
5
6
|
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
6
7
|
let vue = require("vue");
|
|
@@ -303,8 +304,6 @@ const NaiveHistoryButtons = (0, vue.defineComponent)((props) => {
|
|
|
303
304
|
},
|
|
304
305
|
undoLabel: { type: String },
|
|
305
306
|
redoLabel: { type: String },
|
|
306
|
-
density: { type: String },
|
|
307
|
-
onDensityChange: { type: Function },
|
|
308
307
|
labels: { type: Object },
|
|
309
308
|
classNames: { type: Object }
|
|
310
309
|
}
|
|
@@ -364,6 +363,21 @@ function batchEditing(onBatchEdit, extras = {}) {
|
|
|
364
363
|
function undoRedoButtons() {
|
|
365
364
|
return (0, _adapttable_vue_adapter.extendFeature)((0, _adapttable_vue_features.undoRedoButtons)(), [(0, _adapttable_vue_adapter.slotRender)(_adapttable_vue_adapter.UNDO_REDO_CONTROL, (props) => (0, vue.h)(NaiveHistoryButtons, { ...props }))]);
|
|
366
365
|
}
|
|
366
|
+
/**
|
|
367
|
+
* All of editing — cell editing, dirty marks, edit history and undo
|
|
368
|
+
* controls — with this kit's controls, passed to `features` as one entry.
|
|
369
|
+
* Row and batch editing join beside it.
|
|
370
|
+
*
|
|
371
|
+
* @public
|
|
372
|
+
*/
|
|
373
|
+
function editingFamily(onCellEdit, extras) {
|
|
374
|
+
return (0, _adapttable_vue_adapter.editingFamilyList)({
|
|
375
|
+
editing: (save, more) => editing(save, more),
|
|
376
|
+
dirtyIndicators: _adapttable_vue_features.dirtyIndicators,
|
|
377
|
+
editHistory: () => (0, _adapttable_vue_features.editHistory)(),
|
|
378
|
+
undoRedoButtons
|
|
379
|
+
}, onCellEdit, extras);
|
|
380
|
+
}
|
|
367
381
|
//#endregion
|
|
368
382
|
Object.defineProperty(exports, "_sfc_main", {
|
|
369
383
|
enumerable: true,
|
|
@@ -395,6 +409,12 @@ Object.defineProperty(exports, "editing", {
|
|
|
395
409
|
return editing;
|
|
396
410
|
}
|
|
397
411
|
});
|
|
412
|
+
Object.defineProperty(exports, "editingFamily", {
|
|
413
|
+
enumerable: true,
|
|
414
|
+
get: function() {
|
|
415
|
+
return editingFamily;
|
|
416
|
+
}
|
|
417
|
+
});
|
|
398
418
|
Object.defineProperty(exports, "rowEditing", {
|
|
399
419
|
enumerable: true,
|
|
400
420
|
get: function() {
|
|
@@ -408,4 +428,4 @@ Object.defineProperty(exports, "undoRedoButtons", {
|
|
|
408
428
|
}
|
|
409
429
|
});
|
|
410
430
|
|
|
411
|
-
//# sourceMappingURL=editing-
|
|
431
|
+
//# sourceMappingURL=editing-CIvf43jv.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editing-CIvf43jv.cjs","names":["naiveButton","mergeProps","defineComponent","shallowRef","useScopeActivity","useId","htmlRoot","withoutAttributes","h","NSelect","readMultiDraft","formatMultiDraft","defineComponent","useScopeActivity","shallowRef","htmlRoot","h","NInputNumber","withoutAttributes","defineComponent","useDataTableClassNames","HistoryButtonsChrome","naiveButton","slotRender","editableCellSlotKey","h","NaiveEditableCell","extendFeature","bindingEditing","bindingRowEditing","rowEditActionsSlotKey","NaiveRowEditActions","bindingBatchEditing","batchEditBarSlotKey","NaiveBatchEditBar","bindingUndoRedoButtons","UNDO_REDO_CONTROL","editingFamilyList","editHistory"],"sources":["../src/editing/naiveEditingButton.ts","../src/editing/NaiveBatchEditBar.vue","../src/editing/NaiveChoiceEditor.ts","../src/editing/NaiveNumberEditor.ts","../src/editing/NaiveEditableCell.vue","../src/editing/NaiveHistoryButtons.ts","../src/editing/NaiveRowEditActions.vue","../src/editing.ts"],"sourcesContent":["import type { EditingActionButtonProps } from \"@adapttable/vue/adapter\";\nimport { mergeProps, type VNodeChild } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\n\nexport function naiveEditingButton(\n control: EditingActionButtonProps,\n className?: string\n) {\n return naiveButton(\n mergeProps(control.attrs, { class: className, onClick: control.onClick }),\n [\n control.icon === false ? null : (control.icon as VNodeChild),\n control.label,\n ]\n );\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n BatchEditBarChrome,\n type BatchEditBarProps,\n useDataTableClassNames,\n} from \"@adapttable/vue/adapter\";\n\nimport { naiveEditingButton } from \"./naiveEditingButton\";\ndefineOptions({ name: \"NaiveBatchEditBar\" });\nconst { contested = undefined, ...props } =\n defineProps<BatchEditBarProps<TRow>>();\nconst names = useDataTableClassNames();\nconst Render = () =>\n BatchEditBarChrome({\n ...props,\n contested,\n className: [props.className, names.value.batchEditBar]\n .filter(Boolean)\n .join(\" \"),\n controls: {\n Button: (control) =>\n naiveEditingButton(control, names.value.batchEditButton),\n },\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","import type { Attrs, ElementRef } from \"@adapttable/vue\";\nimport {\n formatMultiDraft,\n readMultiDraft,\n useElementRef,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { NSelect, type SelectInst } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n type InputHTMLAttributes,\n type PropType,\n shallowRef,\n useId,\n watch,\n} from \"vue\";\n\nimport { withoutAttributes } from \"../controls/attributes\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\ninterface ChoiceEditorProps {\n readonly attrs: Attrs;\n readonly draft: string;\n readonly multiple: boolean;\n readonly options: readonly {\n readonly value: string;\n readonly label: string;\n }[];\n readonly onChange: (value: string) => void;\n readonly onBlur: () => void;\n readonly onKeyDown: (event: KeyboardEvent) => void;\n}\n\n/** NSelect owns its open menu; the binding owns editing keys when that menu is closed. */\nexport const NaiveChoiceEditor = defineComponent(\n (props: ChoiceEditorProps) => {\n const instance = shallowRef<(ComponentPublicInstance & SelectInst) | null>(\n null\n );\n const active = useScopeActivity();\n const show = shallowRef(false);\n const listId = `adapttable-naive-edit-options-${useId()}`;\n watch(\n active,\n (enabled) => {\n if (!enabled) show.value = false;\n },\n { flush: \"sync\" }\n );\n useElementRef(\n () =>\n active.value && instance.value\n ? htmlRoot(instance.value)?.querySelector<HTMLInputElement>(\n 'input[role=\"combobox\"]'\n )\n : null,\n () =>\n typeof props.attrs.ref === \"function\"\n ? (props.attrs.ref as ElementRef)\n : undefined\n );\n let menuKey = false;\n return () => {\n const attrs = withoutAttributes(props.attrs, [\n \"ref\",\n \"onBlur\",\n \"onKeydown\",\n \"id\",\n \"class\",\n \"data-adapttable-part\",\n ]);\n const inputProps = {\n ...attrs,\n id: props.attrs.id as string | undefined,\n class: props.attrs.class as InputHTMLAttributes[\"class\"],\n \"data-adapttable-part\": props.attrs[\"data-adapttable-part\"],\n role: \"combobox\",\n \"aria-autocomplete\": \"list\" as const,\n \"aria-expanded\": show.value,\n \"aria-controls\": listId,\n };\n return h(NSelect, {\n ref: instance,\n size: \"small\",\n disabled: props.attrs.disabled === true,\n filterable: true,\n to: false,\n show: active.value && show.value,\n multiple: props.multiple,\n value: props.multiple ? readMultiDraft(props.draft) : props.draft,\n options: [...props.options],\n inputProps,\n menuProps: {\n id: listId,\n role: \"listbox\",\n \"aria-multiselectable\": props.multiple || undefined,\n },\n nodeProps: (option) => ({\n role: \"option\",\n \"aria-selected\": props.multiple\n ? readMultiDraft(props.draft).includes(String(option.value))\n : option.value === props.draft,\n }),\n \"onUpdate:value\": (\n value: string | number | (string | number)[] | null\n ) => {\n if (!active.value) return;\n const draft = Array.isArray(value)\n ? formatMultiDraft(value.map(String))\n : String(value ?? \"\");\n props.onChange(draft);\n },\n \"onUpdate:show\": (value: boolean) => {\n if (active.value) show.value = value;\n },\n onBlur: () => {\n if (active.value) props.onBlur();\n },\n onKeydownCapture: (event: KeyboardEvent) => {\n menuKey =\n show.value &&\n [\"Escape\", \"Enter\", \"ArrowUp\", \"ArrowDown\", \"Home\", \"End\"].includes(\n event.key\n );\n },\n onKeydown: (event: KeyboardEvent) => {\n if (!active.value) return;\n if (menuKey) {\n event.stopPropagation();\n if (event.key === \"Escape\") instance.value?.focusInput();\n } else props.onKeyDown(event);\n menuKey = false;\n },\n });\n };\n },\n {\n name: \"NaiveChoiceEditor\",\n inheritAttrs: false,\n props: {\n attrs: { type: Object as PropType<ChoiceEditorProps[\"attrs\"]> },\n draft: { type: String as PropType<ChoiceEditorProps[\"draft\"]> },\n multiple: {\n type: Boolean as PropType<ChoiceEditorProps[\"multiple\"]>,\n default: undefined,\n },\n options: { type: Array as PropType<ChoiceEditorProps[\"options\"]> },\n onChange: { type: Function as PropType<ChoiceEditorProps[\"onChange\"]> },\n onBlur: { type: Function as PropType<ChoiceEditorProps[\"onBlur\"]> },\n onKeyDown: { type: Function as PropType<ChoiceEditorProps[\"onKeyDown\"]> },\n },\n }\n);\n","import type { Attrs, ElementRef } from \"@adapttable/vue\";\nimport { useElementRef, useScopeActivity } from \"@adapttable/vue/adapter\";\nimport { NInputNumber } from \"naive-ui\";\nimport {\n type ComponentPublicInstance,\n defineComponent,\n h,\n type PropType,\n shallowRef,\n} from \"vue\";\n\nimport { withoutAttributes } from \"../controls/attributes\";\nimport { htmlRoot } from \"../controls/elementTarget\";\n\ninterface NumberEditorProps {\n readonly attrs: Attrs;\n readonly draft: string;\n readonly onChange: (value: string) => void;\n readonly onBlur: () => void;\n}\n\n/** The public formatter preserves the binding's raw draft through vendor blur formatting. */\nexport const NaiveNumberEditor = defineComponent(\n (props: NumberEditorProps) => {\n const active = useScopeActivity();\n const instance = shallowRef<ComponentPublicInstance | null>(null);\n useElementRef(\n () =>\n active.value && instance.value\n ? htmlRoot(instance.value)?.querySelector<HTMLInputElement>(\n 'input[role=\"spinbutton\"]'\n )\n : null,\n () =>\n typeof props.attrs.ref === \"function\"\n ? (props.attrs.ref as ElementRef)\n : undefined\n );\n return () =>\n h(NInputNumber, {\n ref: instance,\n size: \"small\",\n disabled: props.attrs.disabled === true,\n readonly:\n props.attrs.readonly === true || props.attrs.readOnly === true,\n value:\n props.draft.trim() !== \"\" && Number.isFinite(Number(props.draft))\n ? Number(props.draft)\n : null,\n format: () => props.draft,\n showButton: false,\n inputProps: {\n ...withoutAttributes(props.attrs, [\"ref\", \"onBlur\"]),\n role: \"spinbutton\",\n onInput: (event: Event) => {\n if (active.value)\n props.onChange((event.currentTarget as HTMLInputElement).value);\n },\n },\n \"onUpdate:value\": (value: number | null) => {\n if (active.value) props.onChange(value === null ? \"\" : String(value));\n },\n onBlur: () => {\n if (active.value) props.onBlur();\n },\n });\n },\n {\n name: \"NaiveNumberEditor\",\n inheritAttrs: false,\n props: {\n attrs: { type: Object as PropType<NumberEditorProps[\"attrs\"]> },\n draft: { type: String as PropType<NumberEditorProps[\"draft\"]> },\n onChange: { type: Function as PropType<NumberEditorProps[\"onChange\"]> },\n onBlur: { type: Function as PropType<NumberEditorProps[\"onBlur\"]> },\n },\n }\n);\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n EditableCellChrome,\n type EditableCellChromeSlots,\n editableCustomControl,\n elementRef,\n useDataTableClassNames,\n useEditableCellModel,\n type VueEditableCellProps,\n} from \"@adapttable/vue/adapter\";\nimport { Fragment, h, mergeProps, type VNodeChild } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\nimport { naiveCheckbox } from \"../controls/checkbox\";\nimport { naiveInput } from \"../controls/input\";\nimport { NaiveChoiceEditor } from \"./NaiveChoiceEditor\";\nimport { NaiveNumberEditor } from \"./NaiveNumberEditor\";\n\nconst props = defineProps<VueEditableCellProps<TRow>>();\nconst names = useDataTableClassNames();\nconst model = useEditableCellModel(() => props);\nconst controls: EditableCellChromeSlots<TRow> = {\n Activate: (control) =>\n naiveButton(\n {\n title: control.title,\n \"aria-description\": control.title,\n class: [control.className, names.value.editCellActivate],\n ref: elementRef(control.activateRef),\n \"data-adapttable-part\": \"edit-cell-activate\",\n \"data-save-status\": control.saveStatus,\n \"data-dirty\": control.dirty ? \"\" : undefined,\n onClick: control.onClick,\n onDblclick: control.onDoubleClick,\n onKeydown: control.onKeyDown,\n },\n control.display,\n { text: true }\n ),\n Editor: (control) => {\n const editor = control.controller.editor;\n const attrs = mergeProps(control.attrs, {\n ref: elementRef<HTMLElement>(control.editorRef),\n class: names.value.editCellEditor,\n onBlur: control.onBlur,\n onKeydown: control.onKeyDown,\n });\n if (editor && typeof editor === \"object\") {\n if (editor.type === \"custom\")\n return h(Fragment, [\n editor.render(editableCustomControl(model.value)) as VNodeChild,\n ]);\n return h(NaiveChoiceEditor, {\n attrs,\n draft: control.controller.draft,\n multiple: editor.type === \"multi-select\",\n options: control.controller.selectOptions,\n onChange: control.onChange,\n onBlur: control.onBlur,\n onKeyDown: control.onKeyDown,\n });\n }\n if (editor === \"number\")\n return h(NaiveNumberEditor, {\n attrs,\n draft: control.controller.draft,\n onChange: control.onChange,\n onBlur: control.onBlur,\n });\n if (editor === \"boolean\")\n return naiveCheckbox({\n attrs,\n checked: control.controller.draft === \"true\",\n indeterminate: false,\n onToggle: () =>\n control.onChange(String(control.controller.draft !== \"true\")),\n });\n return naiveInput({\n attrs: {\n ...attrs,\n type: editor === \"datetime\" ? \"datetime-local\" : (editor ?? \"text\"),\n },\n value: control.controller.draft,\n onChange: control.onChange,\n });\n },\n Button: (control) =>\n naiveButton(\n {\n class: [\n control.className,\n control.part === \"edit-cell-rollback\"\n ? names.value.editCellRollback\n : names.value.editCellConflictButton,\n ],\n \"data-adapttable-part\": control.part,\n onMousedown: control.onMouseDown,\n onClick: control.onClick,\n },\n control.label\n ),\n};\nconst Render = () =>\n EditableCellChrome({ model: model.value, controls, classNames: names.value });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n","import {\n HistoryButtonsChrome,\n type UndoRedoControlProps,\n useDataTableClassNames,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, type PropType } from \"vue\";\n\nimport { naiveButton } from \"../controls/button\";\n\nexport const NaiveHistoryButtons = defineComponent(\n (props: UndoRedoControlProps) => {\n const names = useDataTableClassNames();\n return () =>\n HistoryButtonsChrome({\n ...props,\n classNames: { ...names.value },\n slots: { Button: ({ label, attrs }) => naiveButton(attrs, label) },\n });\n },\n {\n name: \"NaiveHistoryButtons\",\n props: {\n onUndo: { type: Function as PropType<UndoRedoControlProps[\"onUndo\"]> },\n onRedo: { type: Function as PropType<UndoRedoControlProps[\"onRedo\"]> },\n canUndo: {\n type: Boolean as PropType<UndoRedoControlProps[\"canUndo\"]>,\n default: undefined,\n },\n canRedo: {\n type: Boolean as PropType<UndoRedoControlProps[\"canRedo\"]>,\n default: undefined,\n },\n undoLabel: {\n type: String as PropType<UndoRedoControlProps[\"undoLabel\"]>,\n },\n redoLabel: {\n type: String as PropType<UndoRedoControlProps[\"redoLabel\"]>,\n },\n labels: { type: Object as PropType<UndoRedoControlProps[\"labels\"]> },\n classNames: {\n type: Object as PropType<UndoRedoControlProps[\"classNames\"]>,\n },\n },\n }\n);\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n RowEditActionsChrome,\n type RowEditActionsProps,\n useDataTableClassNames,\n} from \"@adapttable/vue/adapter\";\n\nimport { naiveEditingButton } from \"./naiveEditingButton\";\ndefineOptions({ name: \"NaiveRowEditActions\" });\nconst { showBegin = undefined, ...props } =\n defineProps<RowEditActionsProps<TRow>>();\nconst names = useDataTableClassNames();\nconst Render = () =>\n RowEditActionsChrome({\n ...props,\n showBegin,\n className: [props.className, names.value.rowEditActions]\n .filter(Boolean)\n .join(\" \"),\n controls: {\n Button: (control) =>\n naiveEditingButton(control, names.value.rowEditButton),\n },\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","import {\n type CellEditHandler,\n type StaticTableFeature,\n type TableEditingOptions,\n type TableFeature,\n} from \"@adapttable/vue\";\nimport {\n batchEditBarSlotKey,\n editableCellSlotKey,\n editingFamilyList,\n extendFeature,\n rowEditActionsSlotKey,\n slotRender,\n UNDO_REDO_CONTROL,\n} from \"@adapttable/vue/adapter\";\nimport {\n batchEditing as bindingBatchEditing,\n dirtyIndicators,\n editHistory,\n editing as bindingEditing,\n type EditingLifecycleExtras,\n rowEditing as bindingRowEditing,\n undoRedoButtons as bindingUndoRedoButtons,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport NaiveBatchEditBar from \"./editing/NaiveBatchEditBar.vue\";\nimport NaiveEditableCell from \"./editing/NaiveEditableCell.vue\";\nimport { NaiveHistoryButtons } from \"./editing/NaiveHistoryButtons\";\nimport NaiveRowEditActions from \"./editing/NaiveRowEditActions.vue\";\n\nfunction cellSlot<TRow>() {\n return slotRender(editableCellSlotKey<TRow>(), (props) =>\n h(NaiveEditableCell<TRow>, { ...props })\n );\n}\n\n/** Naive controls keep all validation, save and host-write transitions in the binding. */\nexport function editing<TRow>(\n onCellEdit: CellEditHandler<TRow>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingEditing(onCellEdit, extras), [cellSlot<TRow>()]);\n}\n\n/** Edit a row as one gesture with explicit Naive UI Save and Cancel controls. */\nexport function rowEditing<TRow>(\n onRowEdit: NonNullable<TableEditingOptions<TRow>[\"onRowEdit\"]>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingRowEditing(onRowEdit, extras), [\n cellSlot<TRow>(),\n slotRender(rowEditActionsSlotKey<TRow>(), (props) =>\n h(NaiveRowEditActions<TRow>, { ...props })\n ),\n ]);\n}\n\n/** Stage edits across rows; host writes happen only on the batch Save action. */\nexport function batchEditing<TRow>(\n onBatchEdit: NonNullable<TableEditingOptions<TRow>[\"onBatchEdit\"]>,\n extras: EditingLifecycleExtras<TRow> = {}\n): TableFeature<TRow> {\n return extendFeature(bindingBatchEditing(onBatchEdit, extras), [\n cellSlot<TRow>(),\n slotRender(batchEditBarSlotKey<TRow>(), (props) =>\n h(NaiveBatchEditBar<TRow>, { ...props })\n ),\n ]);\n}\n\nexport { default as NaiveBatchEditBar } from \"./editing/NaiveBatchEditBar.vue\";\nexport { default as NaiveEditableCell } from \"./editing/NaiveEditableCell.vue\";\nexport { default as NaiveRowEditActions } from \"./editing/NaiveRowEditActions.vue\";\nexport type {\n BatchEditingState,\n BatchRowEdit,\n CellEditHandler,\n RowEditingState,\n TableEditingOptions,\n} from \"@adapttable/vue\";\nexport type { RowEditIcons } from \"@adapttable/vue/adapter\";\nexport type { EditingLifecycleExtras } from \"@adapttable/vue/features\";\nexport { dirtyIndicators, editHistory };\n\n/** Opt-in Naive UI Undo and Redo buttons use the shell's history projection. */\nexport function undoRedoButtons(): StaticTableFeature {\n return extendFeature(bindingUndoRedoButtons(), [\n slotRender(UNDO_REDO_CONTROL, (props) =>\n h(NaiveHistoryButtons, { ...props })\n ),\n ]);\n}\n\n/**\n * All of editing — cell editing, dirty marks, edit history and undo\n * controls — with this kit's controls, passed to `features` as one entry.\n * Row and batch editing join beside it.\n *\n * @public\n */\nexport function editingFamily<TRow>(\n onCellEdit: CellEditHandler<TRow>,\n extras?: EditingLifecycleExtras<TRow>\n): readonly TableFeature<TRow>[] {\n return editingFamilyList<\n TableFeature<TRow>,\n CellEditHandler<TRow>,\n EditingLifecycleExtras<TRow> | undefined\n >(\n {\n editing: (save, more) => editing(save, more),\n dirtyIndicators,\n editHistory: () => editHistory(),\n undoRedoButtons,\n },\n onCellEdit,\n extras\n );\n}\n"],"mappings":";;;;;;;;;AAKA,SAAgB,mBACd,SACA,WACA;CACA,OAAOA,eAAAA,aAAAA,GACLC,IAAAA,WAAAA,CAAW,QAAQ,OAAO;EAAE,OAAO;EAAW,SAAS,QAAQ;CAAQ,CAAC,GACxE,CACE,QAAQ,SAAS,QAAQ,OAAQ,QAAQ,MACzC,QAAQ,KACV,CACF;AACF;;;;;;;;;;;;;;;;;ECPA,MAAM,SAAA,GACJ,IAAA,qBAAA,CAAA,SAAA,CAAA,WAAA,CAAA;EACF,MAAM,SAAA,GAAQ,wBAAA,uBAAA,CAAuB;EACrC,MAAM,gBAAA,GACJ,wBAAA,mBAAA,CAAmB;GACjB,GAAG;GACH,WAAQ,QAAA;GACR,WAAW,CAAC,MAAM,WAAW,MAAM,MAAM,YAAY,CAAA,CAClD,OAAO,OAAO,CAAA,CACd,KAAK,GAAG;GACX,UAAU,EACR,SAAS,YACP,mBAAmB,SAAS,MAAM,MAAM,eAAe,EAC3D;EACF,CAAC;EAIH,OAAO,QAAQ,CAAA;;GAIb,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,CAAU,MAAA;;;;;;;ACKZ,MAAa,qBAAA,GAAoBC,IAAAA,gBAAAA,EAC9B,UAA6B;CAC5B,MAAM,YAAA,GAAWC,IAAAA,WAAAA,CACf,IACF;CACA,MAAM,UAAA,GAASC,wBAAAA,iBAAAA,CAAiB;CAChC,MAAM,QAAA,GAAOD,IAAAA,WAAAA,CAAW,KAAK;CAC7B,MAAM,SAAS,kCAAA,GAAiCE,IAAAA,MAAAA,CAAM;CACtD,CAAA,G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A,GAC7BX,IAAAA,EAAAA,CAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC,CACrC,CACF,CAAC;AACH;;;;;;;;AASA,SAAgB,cACd,YACA,QAC+B;CAC/B,QAAA,GAAOY,wBAAAA,kBAAAA,CAKL;EACE,UAAU,MAAM,SAAS,QAAQ,MAAM,IAAI;EAC3C,iBAAA,yBAAA;EACA,oBAAA,GAAmBC,yBAAAA,YAAAA,CAAY;EAC/B;CACF,GACA,YACA,MACF;AACF"}
|
|
@@ -55,6 +55,14 @@ declare function rowEditing$1<TRow>(onRowEdit: NonNullable<TableEditingOptions<T
|
|
|
55
55
|
declare function batchEditing$1<TRow>(onBatchEdit: NonNullable<TableEditingOptions<TRow>["onBatchEdit"]>, extras?: EditingLifecycleExtras<TRow>): TableFeature<TRow>;
|
|
56
56
|
/** Opt-in Naive UI Undo and Redo buttons use the shell's history projection. */
|
|
57
57
|
declare function undoRedoButtons$1(): StaticTableFeature;
|
|
58
|
+
/**
|
|
59
|
+
* All of editing — cell editing, dirty marks, edit history and undo
|
|
60
|
+
* controls — with this kit's controls, passed to `features` as one entry.
|
|
61
|
+
* Row and batch editing join beside it.
|
|
62
|
+
*
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
declare function editingFamily<TRow>(onCellEdit: CellEditHandler<TRow>, extras?: EditingLifecycleExtras<TRow>): readonly TableFeature<TRow>[];
|
|
58
66
|
//#endregion
|
|
59
|
-
export { RowEditIcons as a, batchEditing$1 as c, editing$1 as d,
|
|
60
|
-
//# sourceMappingURL=editing-
|
|
67
|
+
export { _default$2 as _, RowEditIcons as a, batchEditing$1 as c, editing$1 as d, editingFamily as f, _default$1 as g, _default as h, EditingLifecycleExtras$1 as i, dirtyIndicators as l, undoRedoButtons$1 as m, BatchRowEdit as n, RowEditingState as o, rowEditing$1 as p, CellEditHandler$1 as r, TableEditingOptions$1 as s, BatchEditingState as t, editHistory as u };
|
|
68
|
+
//# sourceMappingURL=editing-dN16BK0k.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editing-
|
|
1
|
+
{"version":3,"file":"editing-dN16BK0k.d.ts","names":[],"sources":["../src/editing/NaiveBatchEditBar.vue","../src/editing/NaiveEditableCell.vue","../src/editing/NaiveRowEditActions.vue","../src/editing.ts"],"mappings":";;;;cA0CM,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAgDO,qBAAc,cAAc,sBAAmB,kBAAA,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;;;cC2B9F,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAmHO,qBAAc,cAAc,sBAAmB,qBAAA,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;;;cCxN9F,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAgDO,qBAAc,cAAc,oBAAmB,oBAAA,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;;;;iBCjEpF,UAAQ,MACtB,YAAY,gBAAgB,OAC5B,SAAQ,uBAAuB,QAC9B,aAAa;;iBAKA,aAAW,MACzB,WAAW,YAAY,oBAAoB,qBAC3C,SAAQ,uBAAuB,QAC9B,aAAa;;iBAUA,eAAa,MAC3B,aAAa,YAAY,oBAAoB,uBAC7C,SAAQ,uBAAuB,QAC9B,aAAa;;iBAwBA,qBAAmB;;;;;;;;iBAenB,cAAc,MAC5B,YAAY,gBAAgB,OAC5B,SAAS,uBAAuB,iBACtB,aAAa"}
|
|
@@ -55,6 +55,14 @@ declare function rowEditing<TRow>(onRowEdit: NonNullable<TableEditingOptions<TRo
|
|
|
55
55
|
declare function batchEditing<TRow>(onBatchEdit: NonNullable<TableEditingOptions<TRow>["onBatchEdit"]>, extras?: EditingLifecycleExtras<TRow>): TableFeature<TRow>;
|
|
56
56
|
/** Opt-in Naive UI Undo and Redo buttons use the shell's history projection. */
|
|
57
57
|
declare function undoRedoButtons(): StaticTableFeature;
|
|
58
|
+
/**
|
|
59
|
+
* All of editing — cell editing, dirty marks, edit history and undo
|
|
60
|
+
* controls — with this kit's controls, passed to `features` as one entry.
|
|
61
|
+
* Row and batch editing join beside it.
|
|
62
|
+
*
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
declare function editingFamily<TRow>(onCellEdit: CellEditHandler<TRow>, extras?: EditingLifecycleExtras<TRow>): readonly TableFeature<TRow>[];
|
|
58
66
|
//#endregion
|
|
59
|
-
export { RowEditIcons as a, batchEditing as c, editing as d,
|
|
60
|
-
//# sourceMappingURL=editing-
|
|
67
|
+
export { _default$2 as _, RowEditIcons as a, batchEditing as c, editing as d, editingFamily as f, _default$1 as g, _default as h, EditingLifecycleExtras$1 as i, dirtyIndicators as l, undoRedoButtons as m, BatchRowEdit as n, RowEditingState as o, rowEditing as p, CellEditHandler$1 as r, TableEditingOptions$1 as s, BatchEditingState as t, editHistory as u };
|
|
68
|
+
//# sourceMappingURL=editing-xDGCcasQ.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editing-
|
|
1
|
+
{"version":3,"file":"editing-xDGCcasQ.d.cts","names":[],"sources":["../src/editing/NaiveBatchEditBar.vue","../src/editing/NaiveEditableCell.vue","../src/editing/NaiveRowEditActions.vue","../src/editing.ts"],"mappings":";;;;cA0CM,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAgDO,qBAAc,cAAc,sBAAmB,kBAAA,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;;;cC2B9F,iBAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,sBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAmHO,qBAAc,cAAc,sBAAmB,qBAAA,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;;;cCxN9F,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAgDO,qBAAc,cAAc,oBAAmB,oBAAA,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;;;;iBCjEpF,QAAQ,MACtB,YAAY,gBAAgB,OAC5B,SAAQ,uBAAuB,QAC9B,aAAa;;iBAKA,WAAW,MACzB,WAAW,YAAY,oBAAoB,qBAC3C,SAAQ,uBAAuB,QAC9B,aAAa;;iBAUA,aAAa,MAC3B,aAAa,YAAY,oBAAoB,uBAC7C,SAAQ,uBAAuB,QAC9B,aAAa;;iBAwBA,mBAAmB;;;;;;;;iBAenB,cAAc,MAC5B,YAAY,gBAAgB,OAC5B,SAAS,uBAAuB,iBACtB,aAAa"}
|
package/dist/editing.cjs
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_editing = require("./editing-
|
|
2
|
+
const require_editing = require("./editing-CIvf43jv.cjs");
|
|
3
3
|
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
4
4
|
exports.NaiveBatchEditBar = require_editing._sfc_main$2;
|
|
5
5
|
exports.NaiveEditableCell = require_editing._sfc_main$1;
|
|
6
6
|
exports.NaiveRowEditActions = require_editing._sfc_main;
|
|
7
7
|
exports.batchEditing = require_editing.batchEditing;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
get: function() {
|
|
11
|
-
return _adapttable_vue_features.dirtyIndicators;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, "editHistory", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function() {
|
|
17
|
-
return _adapttable_vue_features.editHistory;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
8
|
+
exports.dirtyIndicators = _adapttable_vue_features.dirtyIndicators;
|
|
9
|
+
exports.editHistory = _adapttable_vue_features.editHistory;
|
|
20
10
|
exports.editing = require_editing.editing;
|
|
11
|
+
exports.editingFamily = require_editing.editingFamily;
|
|
21
12
|
exports.rowEditing = require_editing.rowEditing;
|
|
22
13
|
exports.undoRedoButtons = require_editing.undoRedoButtons;
|
package/dist/editing.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RowEditIcons, c as batchEditing, d as editing, f as
|
|
2
|
-
export { type BatchEditingState, type BatchRowEdit, type CellEditHandler, type EditingLifecycleExtras, _default as NaiveBatchEditBar, _default$1 as NaiveEditableCell, _default$2 as NaiveRowEditActions, type RowEditIcons, type RowEditingState, type TableEditingOptions, batchEditing, dirtyIndicators, editHistory, editing, rowEditing, undoRedoButtons };
|
|
1
|
+
import { _ as _default, a as RowEditIcons, c as batchEditing, d as editing, f as editingFamily, g as _default$1, h as _default$2, i as EditingLifecycleExtras, l as dirtyIndicators, m as undoRedoButtons, n as BatchRowEdit, o as RowEditingState, p as rowEditing, r as CellEditHandler, s as TableEditingOptions, t as BatchEditingState, u as editHistory } from "./editing-xDGCcasQ.cjs";
|
|
2
|
+
export { type BatchEditingState, type BatchRowEdit, type CellEditHandler, type EditingLifecycleExtras, _default as NaiveBatchEditBar, _default$1 as NaiveEditableCell, _default$2 as NaiveRowEditActions, type RowEditIcons, type RowEditingState, type TableEditingOptions, batchEditing, dirtyIndicators, editHistory, editing, editingFamily, rowEditing, undoRedoButtons };
|
package/dist/editing.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RowEditIcons, c as batchEditing, d as editing, f as
|
|
2
|
-
export { type BatchEditingState, type BatchRowEdit, type CellEditHandler, type EditingLifecycleExtras, _default as NaiveBatchEditBar, _default$1 as NaiveEditableCell, _default$2 as NaiveRowEditActions, type RowEditIcons, type RowEditingState, type TableEditingOptions, batchEditing, dirtyIndicators, editHistory, editing, rowEditing, undoRedoButtons };
|
|
1
|
+
import { _ as _default, a as RowEditIcons, c as batchEditing, d as editing, f as editingFamily, g as _default$1, h as _default$2, i as EditingLifecycleExtras, l as dirtyIndicators, m as undoRedoButtons, n as BatchRowEdit, o as RowEditingState, p as rowEditing, r as CellEditHandler, s as TableEditingOptions, t as BatchEditingState, u as editHistory } from "./editing-dN16BK0k.js";
|
|
2
|
+
export { type BatchEditingState, type BatchRowEdit, type CellEditHandler, type EditingLifecycleExtras, _default as NaiveBatchEditBar, _default$1 as NaiveEditableCell, _default$2 as NaiveRowEditActions, type RowEditIcons, type RowEditingState, type TableEditingOptions, batchEditing, dirtyIndicators, editHistory, editing, editingFamily, rowEditing, undoRedoButtons };
|
package/dist/editing.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { _sfc_main as NaiveBatchEditBar, _sfc_main$1 as NaiveEditableCell, _sfc_main$2 as NaiveRowEditActions, batchEditing, dirtyIndicators, editHistory, editing, rowEditing, undoRedoButtons };
|
|
1
|
+
import { a as editingFamily, c as _sfc_main$2, i as editing, l as _sfc_main$1, n as dirtyIndicators, o as rowEditing, r as editHistory, s as undoRedoButtons, t as batchEditing, u as _sfc_main } from "./editing-Btr52gcG.js";
|
|
2
|
+
export { _sfc_main as NaiveBatchEditBar, _sfc_main$1 as NaiveEditableCell, _sfc_main$2 as NaiveRowEditActions, batchEditing, dirtyIndicators, editHistory, editing, editingFamily, rowEditing, undoRedoButtons };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { t as withNaiveExport } from "./withNaiveExport-B0gpxqNd.js";
|
|
2
|
+
import { exportCsv } from "@adapttable/vue/features";
|
|
3
|
+
//#region src/export-csv.ts
|
|
4
|
+
function exportCsv$1(options = true) {
|
|
5
|
+
return withNaiveExport(exportCsv(options));
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { exportCsv$1 as t };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=export-DLLCc4Lb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-DLLCc4Lb.js","names":["exportCsv","bindingExport"],"sources":["../src/export-csv.ts"],"sourcesContent":["import type { StaticTableFeature, TableFeature } from \"@adapttable/vue\";\nimport {\n exportCsv as bindingExport,\n type ExportCsvOptions,\n} from \"@adapttable/vue/features\";\n\nimport { withNaiveExport } from \"./export/withNaiveExport\";\n\n/** Export the current view as CSV through the binding's cancellable export model. */\nexport function exportCsv(options?: boolean): StaticTableFeature;\nexport function exportCsv<TRow>(\n options?: boolean | ExportCsvOptions<TRow>\n): TableFeature<TRow>;\nexport function exportCsv<TRow>(\n options: boolean | ExportCsvOptions<TRow> = true\n): TableFeature<TRow> {\n return withNaiveExport(bindingExport<TRow>(options));\n}\nexport type { ExportCsvOptions } from \"@adapttable/vue/features\";\n"],"mappings":";;;AAaA,SAAgBA,YACd,UAA4C,MACxB;CACpB,OAAO,gBAAgBC,UAAoB,OAAO,CAAC;AACrD"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
1
|
const require_withNaiveExport = require("./withNaiveExport-pQdjjXto.cjs");
|
|
3
2
|
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
4
3
|
//#region src/export-csv.ts
|
|
@@ -6,6 +5,11 @@ function exportCsv(options = true) {
|
|
|
6
5
|
return require_withNaiveExport.withNaiveExport((0, _adapttable_vue_features.exportCsv)(options));
|
|
7
6
|
}
|
|
8
7
|
//#endregion
|
|
9
|
-
exports
|
|
8
|
+
Object.defineProperty(exports, "exportCsv", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function() {
|
|
11
|
+
return exportCsv;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
10
14
|
|
|
11
|
-
//# sourceMappingURL=export-
|
|
15
|
+
//# sourceMappingURL=export-fT_9Xp5t.cjs.map
|