@adapttable/element-plus 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -8
- package/dist/{ElementRowActions-CUlFbY6s.js → ElementRowActions-CUdXemC-.js} +2 -2
- package/dist/ElementRowActions-CUdXemC-.js.map +1 -0
- package/dist/{ElementRowActions-ClYC3Ssq.cjs → ElementRowActions-XyX2PAWL.cjs} +2 -2
- package/dist/ElementRowActions-XyX2PAWL.cjs.map +1 -0
- package/dist/assistant.cjs +309 -5
- package/dist/assistant.cjs.map +1 -0
- package/dist/assistant.js +305 -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-DJ-_1Mjr.cjs.map +1 -1
- package/dist/cell-navigation-arDY86xD.js.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/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-jNw7kuxp.cjs → column-menu-CqyYtohz.cjs} +3 -3
- package/dist/{column-menu-jNw7kuxp.cjs.map → column-menu-CqyYtohz.cjs.map} +1 -1
- package/dist/{column-menu-BUxMPyJI.js → column-menu-CwTWnahc.js} +3 -3
- package/dist/{column-menu-BUxMPyJI.js.map → column-menu-CwTWnahc.js.map} +1 -1
- package/dist/column-menu.cjs +1 -1
- package/dist/column-menu.d.cts +34 -2
- package/dist/column-menu.d.cts.map +1 -0
- package/dist/column-menu.d.ts +34 -2
- package/dist/column-menu.d.ts.map +1 -0
- package/dist/column-menu.js +1 -1
- package/dist/{editing-DHjzbw-I.js → editing-BlpYR839.js} +19 -5
- package/dist/{editing-DHjzbw-I.js.map → editing-BlpYR839.js.map} +1 -1
- package/dist/{editing-Bhw_4VG8.cjs → editing-CSqZENeW.cjs} +23 -3
- package/dist/editing-CSqZENeW.cjs.map +1 -0
- package/dist/{editing-BnLdNDlo.d.ts → editing-CU4pOLjr.d.ts} +10 -2
- package/dist/{editing-BnLdNDlo.d.ts.map → editing-CU4pOLjr.d.ts.map} +1 -1
- package/dist/{editing-Cg6ZNvSa.d.cts → editing-DJrjZjpu.d.cts} +10 -2
- package/dist/{editing-Cg6ZNvSa.d.cts.map → editing-DJrjZjpu.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-kuOvIoQg.js +10 -0
- package/dist/export-kuOvIoQg.js.map +1 -0
- package/dist/{export-csv.cjs → export-x-Ow8SY5.cjs} +7 -3
- package/dist/export-x-Ow8SY5.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-C0YXpD3-.js → filters-CIQ1uMZw.js} +6 -5
- package/dist/filters-CIQ1uMZw.js.map +1 -0
- package/dist/{filters-hVQM8Cok.cjs → filters-CYQFsZ_f.cjs} +5 -4
- package/dist/filters-CYQFsZ_f.cjs.map +1 -0
- package/dist/filters.cjs +1 -1
- package/dist/filters.d.cts +77 -2
- package/dist/filters.d.cts.map +1 -0
- package/dist/filters.d.ts +77 -2
- package/dist/filters.d.ts.map +1 -0
- package/dist/filters.js +1 -1
- package/dist/grouping-panel.cjs +145 -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.d.cts +23 -2
- package/dist/header-filters.d.cts.map +1 -0
- package/dist/header-filters.d.ts +23 -2
- package/dist/header-filters.d.ts.map +1 -0
- package/dist/index.cjs +2 -26
- 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 -26
- package/dist/index.js.map +1 -1
- package/dist/preset.cjs +8 -9
- package/dist/preset.cjs.map +1 -1
- package/dist/preset.js +7 -8
- package/dist/preset.js.map +1 -1
- package/dist/row-actions.cjs +1 -1
- package/dist/row-actions.d.cts +7 -2
- package/dist/row-actions.d.cts.map +1 -0
- package/dist/row-actions.d.ts +7 -2
- package/dist/row-actions.d.ts.map +1 -0
- package/dist/row-actions.js +1 -1
- package/dist/row-pinning.cjs +1 -1
- package/dist/row-pinning.d.cts +8 -2
- package/dist/row-pinning.d.cts.map +1 -0
- package/dist/row-pinning.d.ts +8 -2
- package/dist/row-pinning.d.ts.map +1 -0
- package/dist/row-pinning.js +1 -1
- package/dist/row-reorder.cjs +155 -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 +156 -1
- package/dist/row-reorder.js.map +1 -0
- package/dist/rows.d.cts +2 -2
- package/dist/rows.d.ts +2 -2
- 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/styles.css +57 -57
- package/package.json +33 -23
- package/dist/ElementRowActions-CUlFbY6s.js.map +0 -1
- package/dist/ElementRowActions-ClYC3Ssq.cjs.map +0 -1
- package/dist/assistant-D4l4OdXN.cjs +0 -329
- package/dist/assistant-D4l4OdXN.cjs.map +0 -1
- package/dist/assistant-DRDxJajO.js +0 -306
- package/dist/assistant-DRDxJajO.js.map +0 -1
- package/dist/column-menu-CAkx6AjR.d.ts +0 -33
- package/dist/column-menu-CAkx6AjR.d.ts.map +0 -1
- package/dist/column-menu-DsL_xeEM.d.cts +0 -33
- package/dist/column-menu-DsL_xeEM.d.cts.map +0 -1
- package/dist/editing-Bhw_4VG8.cjs.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-VyICO_s0.d.ts +0 -9
- package/dist/export-csv-VyICO_s0.d.ts.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 -220
- package/dist/features.d.cts +0 -36
- package/dist/features.d.ts +0 -36
- package/dist/features.js +0 -32
- package/dist/filters-C0YXpD3-.js.map +0 -1
- package/dist/filters-Ci3fdJMe.d.cts +0 -77
- package/dist/filters-Ci3fdJMe.d.cts.map +0 -1
- package/dist/filters-Dh2MjW9V.d.ts +0 -77
- package/dist/filters-Dh2MjW9V.d.ts.map +0 -1
- package/dist/filters-hVQM8Cok.cjs.map +0 -1
- package/dist/grouping-panel-B7j8sSpT.js +0 -146
- package/dist/grouping-panel-B7j8sSpT.js.map +0 -1
- package/dist/grouping-panel-B_ibl915.cjs +0 -150
- package/dist/grouping-panel-B_ibl915.cjs.map +0 -1
- package/dist/header-filters-B2B5RqQS.d.ts +0 -24
- package/dist/header-filters-B2B5RqQS.d.ts.map +0 -1
- package/dist/header-filters-hGm_7LFO.d.cts +0 -24
- package/dist/header-filters-hGm_7LFO.d.cts.map +0 -1
- package/dist/row-actions-VRa4T6oF.d.cts +0 -7
- package/dist/row-actions-VRa4T6oF.d.cts.map +0 -1
- package/dist/row-actions-VRa4T6oF.d.ts +0 -7
- package/dist/row-actions-VRa4T6oF.d.ts.map +0 -1
- package/dist/row-pinning-B0WfYDZD.d.ts +0 -8
- package/dist/row-pinning-B0WfYDZD.d.ts.map +0 -1
- package/dist/row-pinning-LzBZmZcZ.d.cts +0 -8
- package/dist/row-pinning-LzBZmZcZ.d.cts.map +0 -1
- package/dist/row-reorder-BYwX3CBP.js +0 -157
- package/dist/row-reorder-BYwX3CBP.js.map +0 -1
- package/dist/row-reorder-MSR2yDN6.cjs +0 -161
- package/dist/row-reorder-MSR2yDN6.cjs.map +0 -1
package/dist/row-reorder.cjs
CHANGED
|
@@ -1,10 +1,163 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
2
|
+
const require_button = require("./button-BFjBL9m3.cjs");
|
|
3
|
+
let vue = require("vue");
|
|
4
|
+
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
5
|
+
let element_plus = require("element-plus");
|
|
6
|
+
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
3
7
|
let _adapttable_vue = require("@adapttable/vue");
|
|
4
|
-
|
|
8
|
+
//#region src/reorder/ElementRowMoveMenu.ts
|
|
9
|
+
/** The shared controller owns target selection and pending confirmation. */
|
|
10
|
+
const ElementRowMoveMenu = (0, vue.defineComponent)((props) => {
|
|
11
|
+
const active = (0, _adapttable_vue_adapter.useScopeActivity)();
|
|
12
|
+
let lifetime = 0;
|
|
13
|
+
(0, vue.watch)(active, () => lifetime++, { flush: "sync" });
|
|
14
|
+
const trigger = (0, vue.shallowRef)();
|
|
15
|
+
const description = `adapttable-row-move-${(0, vue.useId)()}`;
|
|
16
|
+
return () => {
|
|
17
|
+
const live = active.value;
|
|
18
|
+
const ticket = lifetime;
|
|
19
|
+
const items = props.items;
|
|
20
|
+
const owner = props.confirmation;
|
|
21
|
+
const isCurrent = () => live && active.value && ticket === lifetime;
|
|
22
|
+
const finish = (kind) => {
|
|
23
|
+
if (!isCurrent() || !owner) return;
|
|
24
|
+
if (props.confirmation?.onConfirm === owner.onConfirm && props.confirmation.onCancel === owner.onCancel) owner[kind]();
|
|
25
|
+
};
|
|
26
|
+
return (0, vue.h)("span", { "data-adapttable-part": "row-move-menu" }, [(0, vue.h)(element_plus.ElSelect, {
|
|
27
|
+
ref: trigger,
|
|
28
|
+
modelValue: "",
|
|
29
|
+
placeholder: props.label,
|
|
30
|
+
"aria-label": props.label,
|
|
31
|
+
"data-adapttable-part": "row-move-menu-trigger",
|
|
32
|
+
teleported: false,
|
|
33
|
+
disabled: props.items.every((item) => item.disabled),
|
|
34
|
+
validateEvent: false,
|
|
35
|
+
"onUpdate:modelValue": (value) => {
|
|
36
|
+
if (!isCurrent()) return;
|
|
37
|
+
const item = items.find((item) => item.id === value);
|
|
38
|
+
if (item && !item.disabled) item.onSelect();
|
|
39
|
+
(0, _adapttable_vue_adapter.scheduleTick)(() => {
|
|
40
|
+
if (isCurrent()) trigger.value?.$forceUpdate();
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}, { default: () => props.items.map((item) => (0, vue.h)(element_plus.ElOption, {
|
|
44
|
+
key: item.id,
|
|
45
|
+
value: item.id,
|
|
46
|
+
label: item.label,
|
|
47
|
+
disabled: item.disabled,
|
|
48
|
+
title: item.disabledReason,
|
|
49
|
+
"data-adapttable-part": "row-move-menu-item"
|
|
50
|
+
})) }), owner ? (0, vue.h)(element_plus.ElDialog, {
|
|
51
|
+
modelValue: active.value,
|
|
52
|
+
title: owner.title,
|
|
53
|
+
showClose: false,
|
|
54
|
+
destroyOnClose: true,
|
|
55
|
+
"data-adapttable-part": "row-move-confirmation",
|
|
56
|
+
"aria-describedby": description,
|
|
57
|
+
width: "min(28rem, calc(100vw - 2rem))",
|
|
58
|
+
appendToBody: false,
|
|
59
|
+
beforeClose: () => finish("onCancel")
|
|
60
|
+
}, {
|
|
61
|
+
default: () => (0, vue.h)("p", { id: description }, owner.description),
|
|
62
|
+
footer: () => [require_button.elementButton({
|
|
63
|
+
type: "button",
|
|
64
|
+
"data-adapttable-part": "row-move-cancel",
|
|
65
|
+
onClick: () => finish("onCancel")
|
|
66
|
+
}, owner.cancelLabel), require_button.elementButton({
|
|
67
|
+
type: "button",
|
|
68
|
+
"data-adapttable-part": "row-move-confirm",
|
|
69
|
+
onClick: () => finish("onConfirm")
|
|
70
|
+
}, owner.confirmLabel)]
|
|
71
|
+
}) : null]);
|
|
72
|
+
};
|
|
73
|
+
}, {
|
|
74
|
+
name: "ElementRowMoveMenu",
|
|
75
|
+
props: {
|
|
76
|
+
label: { type: String },
|
|
77
|
+
items: { type: Array },
|
|
78
|
+
confirmation: { type: Object }
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/reorder/elementReorderControls.ts
|
|
83
|
+
const elementReorderControls = {
|
|
84
|
+
Handle: ({ label, pressed, dragging, disabled, dragProps, onKeyDown, className }) => require_button.elementButton({
|
|
85
|
+
type: "button",
|
|
86
|
+
"aria-label": label,
|
|
87
|
+
"aria-pressed": pressed,
|
|
88
|
+
"data-dragging": dragging ? "" : void 0,
|
|
89
|
+
"data-adapttable-part": "row-reorder-handle",
|
|
90
|
+
"data-adapttable-grip": "",
|
|
91
|
+
class: className,
|
|
92
|
+
disabled,
|
|
93
|
+
draggable: dragProps.draggable,
|
|
94
|
+
onDragstart: (event) => {
|
|
95
|
+
if (event.dataTransfer) dragProps.onDragStart({
|
|
96
|
+
...event,
|
|
97
|
+
dataTransfer: event.dataTransfer,
|
|
98
|
+
clientY: event.clientY,
|
|
99
|
+
currentTarget: event.currentTarget instanceof HTMLElement ? event.currentTarget : null,
|
|
100
|
+
preventDefault: () => event.preventDefault()
|
|
101
|
+
});
|
|
102
|
+
},
|
|
103
|
+
onDragend: dragProps.onDragEnd,
|
|
104
|
+
onKeydown: (event) => onKeyDown({
|
|
105
|
+
key: event.key,
|
|
106
|
+
currentTarget: event.currentTarget instanceof HTMLElement ? event.currentTarget : null,
|
|
107
|
+
preventDefault: () => event.preventDefault()
|
|
108
|
+
})
|
|
109
|
+
}, "↕"),
|
|
110
|
+
Button: ({ label, part, disabled, onClick, className }) => require_button.elementButton({
|
|
111
|
+
type: "button",
|
|
112
|
+
"aria-label": label,
|
|
113
|
+
"data-adapttable-part": part,
|
|
114
|
+
class: className,
|
|
115
|
+
disabled,
|
|
116
|
+
onClick
|
|
117
|
+
}, label),
|
|
118
|
+
Menu: (props) => (0, vue.h)(ElementRowMoveMenu, props)
|
|
119
|
+
};
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/reorder/ElementRowReorder.vue
|
|
122
|
+
const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
123
|
+
__name: "ElementRowReorder",
|
|
124
|
+
props: {
|
|
125
|
+
model: {},
|
|
126
|
+
labels: {},
|
|
127
|
+
mobile: { type: Boolean },
|
|
128
|
+
classNames: {},
|
|
129
|
+
rowId: {},
|
|
130
|
+
localIndex: {},
|
|
131
|
+
row: {},
|
|
132
|
+
windowStart: {},
|
|
133
|
+
rowCount: {}
|
|
134
|
+
},
|
|
135
|
+
setup(__props) {
|
|
136
|
+
const props = __props;
|
|
137
|
+
const names = (0, _adapttable_vue_adapter.useDataTableClassNames)();
|
|
138
|
+
const Render = () => (0, _adapttable_vue_adapter.RowReorderChrome)({
|
|
139
|
+
...props,
|
|
140
|
+
classNames: { ...names.value },
|
|
141
|
+
slots: elementReorderControls
|
|
142
|
+
});
|
|
143
|
+
Render.props = [];
|
|
144
|
+
return (_ctx, _cache) => {
|
|
145
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)(Render);
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/row-reorder.ts
|
|
151
|
+
function rowReorder(onRowReorder, options) {
|
|
152
|
+
return (0, _adapttable_vue_adapter.extendFeature)((0, _adapttable_vue_features.rowReorder)(onRowReorder, options), [(0, _adapttable_vue_adapter.slotRender)((0, _adapttable_vue_adapter.rowReorderControlKey)(), (props) => (0, vue.h)(_sfc_main, { ...props }))]);
|
|
153
|
+
}
|
|
154
|
+
//#endregion
|
|
155
|
+
exports.rowReorder = rowReorder;
|
|
5
156
|
Object.defineProperty(exports, "useRowReorder", {
|
|
6
157
|
enumerable: true,
|
|
7
158
|
get: function() {
|
|
8
159
|
return _adapttable_vue.useRowReorder;
|
|
9
160
|
}
|
|
10
161
|
});
|
|
162
|
+
|
|
163
|
+
//# sourceMappingURL=row-reorder.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row-reorder.cjs","names":["defineComponent","useScopeActivity","shallowRef","useId","h","ElSelect","ElOption","ElDialog","elementButton","elementButton","h","extendFeature","bindingRowReorder","slotRender","rowReorderControlKey","h","ElementRowReorder"],"sources":["../src/reorder/ElementRowMoveMenu.ts","../src/reorder/elementReorderControls.ts","../src/reorder/ElementRowReorder.vue","../src/row-reorder.ts"],"sourcesContent":["import {\n type RowMoveMenuSlotProps,\n scheduleTick,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n ElDialog,\n ElOption,\n ElSelect,\n type SelectInstance,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n type PropType,\n shallowRef,\n useId,\n watch,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n/** The shared controller owns target selection and pending confirmation. */\nexport const ElementRowMoveMenu = defineComponent(\n (props: RowMoveMenuSlotProps) => {\n const active = useScopeActivity();\n let lifetime = 0;\n watch(active, () => lifetime++, { flush: \"sync\" });\n const trigger = shallowRef<SelectInstance>();\n const description = `adapttable-row-move-${useId()}`;\n return () => {\n const live = active.value;\n const ticket = lifetime;\n const items = props.items;\n const owner = props.confirmation;\n const isCurrent = () => live && active.value && ticket === lifetime;\n const finish = (kind: \"onConfirm\" | \"onCancel\") => {\n if (!isCurrent() || !owner) return;\n if (\n props.confirmation?.onConfirm === owner.onConfirm &&\n props.confirmation.onCancel === owner.onCancel\n )\n owner[kind]();\n };\n return h(\"span\", { \"data-adapttable-part\": \"row-move-menu\" }, [\n h(\n ElSelect,\n {\n ref: trigger,\n modelValue: \"\",\n placeholder: props.label,\n \"aria-label\": props.label,\n \"data-adapttable-part\": \"row-move-menu-trigger\",\n teleported: false,\n disabled: props.items.every((item) => item.disabled),\n validateEvent: false,\n \"onUpdate:modelValue\": (value: unknown) => {\n if (!isCurrent()) return;\n const item = items.find((item) => item.id === value);\n if (item && !item.disabled) item.onSelect();\n scheduleTick(() => {\n if (isCurrent()) trigger.value?.$forceUpdate();\n });\n },\n },\n {\n default: () =>\n props.items.map((item) =>\n h(ElOption, {\n key: item.id,\n value: item.id,\n label: item.label,\n disabled: item.disabled,\n title: item.disabledReason,\n \"data-adapttable-part\": \"row-move-menu-item\",\n })\n ),\n }\n ),\n owner\n ? h(\n ElDialog,\n {\n modelValue: active.value,\n title: owner.title,\n showClose: false,\n destroyOnClose: true,\n \"data-adapttable-part\": \"row-move-confirmation\",\n \"aria-describedby\": description,\n width: \"min(28rem, calc(100vw - 2rem))\",\n appendToBody: false,\n beforeClose: () => finish(\"onCancel\"),\n },\n {\n default: () => h(\"p\", { id: description }, owner.description),\n footer: () => [\n elementButton(\n {\n type: \"button\",\n \"data-adapttable-part\": \"row-move-cancel\",\n onClick: () => finish(\"onCancel\"),\n },\n owner.cancelLabel\n ),\n elementButton(\n {\n type: \"button\",\n \"data-adapttable-part\": \"row-move-confirm\",\n onClick: () => finish(\"onConfirm\"),\n },\n owner.confirmLabel\n ),\n ],\n }\n )\n : null,\n ]);\n };\n },\n {\n name: \"ElementRowMoveMenu\",\n props: {\n label: { type: String as PropType<RowMoveMenuSlotProps[\"label\"]> },\n items: { type: Array as PropType<RowMoveMenuSlotProps[\"items\"]> },\n confirmation: {\n type: Object as PropType<RowMoveMenuSlotProps[\"confirmation\"]>,\n },\n },\n }\n);\n","import type { RowReorderControlSlots } from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport { ElementRowMoveMenu } from \"./ElementRowMoveMenu\";\n\nexport const elementReorderControls: RowReorderControlSlots = {\n Handle: ({\n label,\n pressed,\n dragging,\n disabled,\n dragProps,\n onKeyDown,\n className,\n }) =>\n elementButton(\n {\n type: \"button\",\n \"aria-label\": label,\n \"aria-pressed\": pressed,\n \"data-dragging\": dragging ? \"\" : undefined,\n \"data-adapttable-part\": \"row-reorder-handle\",\n \"data-adapttable-grip\": \"\",\n class: className,\n disabled,\n draggable: dragProps.draggable,\n onDragstart: (event: DragEvent) => {\n if (event.dataTransfer)\n dragProps.onDragStart({\n ...event,\n dataTransfer: event.dataTransfer,\n clientY: event.clientY,\n currentTarget:\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget\n : null,\n preventDefault: () => event.preventDefault(),\n });\n },\n onDragend: dragProps.onDragEnd,\n onKeydown: (event: KeyboardEvent) =>\n onKeyDown({\n key: event.key,\n currentTarget:\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget\n : null,\n preventDefault: () => event.preventDefault(),\n }),\n },\n \"↕\"\n ),\n Button: ({ label, part, disabled, onClick, className }) =>\n elementButton(\n {\n type: \"button\",\n \"aria-label\": label,\n \"data-adapttable-part\": part,\n class: className,\n disabled,\n onClick,\n },\n label\n ),\n Menu: (props) => h(ElementRowMoveMenu, props),\n};\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n RowReorderChrome,\n type RowReorderControlProps,\n} from \"@adapttable/vue/adapter\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementReorderControls } from \"./elementReorderControls\";\n\nconst props = defineProps<RowReorderControlProps<TRow>>();\nconst names = useClassNames();\nconst Render = () =>\n RowReorderChrome({\n ...props,\n classNames: { ...names.value },\n slots: elementReorderControls,\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 RowReorderHandler,\n RowReorderOptions,\n TableFeature,\n} from \"@adapttable/vue\";\nimport {\n extendFeature,\n rowReorderControlKey,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { rowReorder as bindingRowReorder } from \"@adapttable/vue/features\";\nimport { h, type MaybeRefOrGetter } from \"vue\";\n\nimport ElementRowReorder from \"./reorder/ElementRowReorder.vue\";\nexport {\n type RowReorderHandler,\n type RowReorderOptions,\n useRowReorder,\n} from \"@adapttable/vue\";\nexport function rowReorder<TRow>(\n onRowReorder: RowReorderHandler<TRow>,\n options?: MaybeRefOrGetter<RowReorderOptions<TRow> | undefined>\n): TableFeature<TRow> {\n return extendFeature(bindingRowReorder(onRowReorder, options), [\n slotRender(rowReorderControlKey<TRow>(), (props) =>\n h(ElementRowReorder<TRow>, { ...props })\n ),\n ]);\n}\n"],"mappings":";;;;;;;;;AAsBA,MAAa,sBAAA,GAAqBA,IAAAA,gBAAAA,EAC/B,UAAgC;CAC/B,MAAM,UAAA,GAASC,wBAAAA,iBAAAA,CAAiB;CAChC,IAAI,WAAW;CACf,CAAA,GAAA,IAAA,MAAA,CAAM,cAAc,YAAY,EAAE,OAAO,OAAO,CAAC;CACjD,MAAM,WAAA,GAAUC,IAAAA,WAAAA,CAA2B;CAC3C,MAAM,cAAc,wBAAA,GAAuBC,IAAAA,MAAAA,CAAM;CACjD,aAAa;EACX,MAAM,OAAO,OAAO;EACpB,MAAM,SAAS;EACf,MAAM,QAAQ,MAAM;EACpB,MAAM,QAAQ,MAAM;EACpB,MAAM,kBAAkB,QAAQ,OAAO,SAAS,WAAW;EAC3D,MAAM,UAAU,SAAmC;GACjD,IAAI,CAAC,UAAU,KAAK,CAAC,OAAO;GAC5B,IACE,MAAM,cAAc,cAAc,MAAM,a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,GAAA,IAAA,YAAA,CAAU,MAAA;;;;;;ACLZ,SAAgB,WACd,cACA,SACoB;CACpB,QAAA,GAAOC,wBAAAA,cAAAA,EAAAA,GAAcC,yBAAAA,WAAAA,CAAkB,cAAc,OAAO,GAAG,EAAA,GAC7DC,wBAAAA,WAAAA,EAAAA,GAAWC,wBAAAA,qBAAAA,CAA2B,IAAI,WAAA,GACxCC,IAAAA,EAAAA,CAAEC,WAAyB,EAAE,GAAG,MAAM,CAAC,CACzC,CACF,CAAC;AACH"}
|
package/dist/row-reorder.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RowReorderHandler, RowReorderHandler as RowReorderHandler$1, RowReorderOptions, RowReorderOptions as RowReorderOptions$1, TableFeature, useRowReorder } from "@adapttable/vue";
|
|
2
|
+
import { MaybeRefOrGetter } from "vue";
|
|
2
3
|
//#region src/row-reorder.d.ts
|
|
3
|
-
declare function rowReorder<TRow>(onRowReorder: RowReorderHandler$1<TRow>, options?: RowReorderOptions$1<TRow>): TableFeature<TRow>;
|
|
4
|
+
declare function rowReorder<TRow>(onRowReorder: RowReorderHandler$1<TRow>, options?: MaybeRefOrGetter<RowReorderOptions$1<TRow> | undefined>): TableFeature<TRow>;
|
|
4
5
|
//#endregion
|
|
5
6
|
export { type RowReorderHandler, type RowReorderOptions, rowReorder, useRowReorder };
|
|
6
7
|
//# sourceMappingURL=row-reorder.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row-reorder.d.cts","names":[],"sources":["../src/row-reorder.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"row-reorder.d.cts","names":[],"sources":["../src/row-reorder.ts"],"mappings":";;;iBAmBgB,WAAW,MACzB,cAAc,oBAAkB,OAChC,UAAU,iBAAiB,oBAAkB,qBAC5C,aAAa"}
|
package/dist/row-reorder.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { MaybeRefOrGetter } from "vue";
|
|
1
2
|
import { RowReorderHandler, RowReorderHandler as RowReorderHandler$1, RowReorderOptions, RowReorderOptions as RowReorderOptions$1, TableFeature, useRowReorder } from "@adapttable/vue";
|
|
2
3
|
//#region src/row-reorder.d.ts
|
|
3
|
-
declare function rowReorder<TRow>(onRowReorder: RowReorderHandler$1<TRow>, options?: RowReorderOptions$1<TRow>): TableFeature<TRow>;
|
|
4
|
+
declare function rowReorder<TRow>(onRowReorder: RowReorderHandler$1<TRow>, options?: MaybeRefOrGetter<RowReorderOptions$1<TRow> | undefined>): TableFeature<TRow>;
|
|
4
5
|
//#endregion
|
|
5
6
|
export { type RowReorderHandler, type RowReorderOptions, rowReorder, useRowReorder };
|
|
6
7
|
//# sourceMappingURL=row-reorder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row-reorder.d.ts","names":[],"sources":["../src/row-reorder.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"row-reorder.d.ts","names":[],"sources":["../src/row-reorder.ts"],"mappings":";;;iBAmBgB,WAAW,MACzB,cAAc,oBAAkB,OAChC,UAAU,iBAAiB,oBAAkB,qBAC5C,aAAa"}
|
package/dist/row-reorder.js
CHANGED
|
@@ -1,2 +1,157 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { n as useClassNames } from "./classNamesContext-18Wbxy4F.js";
|
|
2
|
+
import { t as elementButton } from "./button-DwB4UxI2.js";
|
|
3
|
+
import { createBlock, defineComponent, h, openBlock, shallowRef, useId, watch } from "vue";
|
|
4
|
+
import { RowReorderChrome, extendFeature, rowReorderControlKey, scheduleTick, slotRender, useScopeActivity } from "@adapttable/vue/adapter";
|
|
5
|
+
import { ElDialog, ElOption, ElSelect } from "element-plus";
|
|
6
|
+
import { rowReorder as rowReorder$1 } from "@adapttable/vue/features";
|
|
7
|
+
import { useRowReorder } from "@adapttable/vue";
|
|
8
|
+
//#region src/reorder/ElementRowMoveMenu.ts
|
|
9
|
+
/** The shared controller owns target selection and pending confirmation. */
|
|
10
|
+
const ElementRowMoveMenu = defineComponent((props) => {
|
|
11
|
+
const active = useScopeActivity();
|
|
12
|
+
let lifetime = 0;
|
|
13
|
+
watch(active, () => lifetime++, { flush: "sync" });
|
|
14
|
+
const trigger = shallowRef();
|
|
15
|
+
const description = `adapttable-row-move-${useId()}`;
|
|
16
|
+
return () => {
|
|
17
|
+
const live = active.value;
|
|
18
|
+
const ticket = lifetime;
|
|
19
|
+
const items = props.items;
|
|
20
|
+
const owner = props.confirmation;
|
|
21
|
+
const isCurrent = () => live && active.value && ticket === lifetime;
|
|
22
|
+
const finish = (kind) => {
|
|
23
|
+
if (!isCurrent() || !owner) return;
|
|
24
|
+
if (props.confirmation?.onConfirm === owner.onConfirm && props.confirmation.onCancel === owner.onCancel) owner[kind]();
|
|
25
|
+
};
|
|
26
|
+
return h("span", { "data-adapttable-part": "row-move-menu" }, [h(ElSelect, {
|
|
27
|
+
ref: trigger,
|
|
28
|
+
modelValue: "",
|
|
29
|
+
placeholder: props.label,
|
|
30
|
+
"aria-label": props.label,
|
|
31
|
+
"data-adapttable-part": "row-move-menu-trigger",
|
|
32
|
+
teleported: false,
|
|
33
|
+
disabled: props.items.every((item) => item.disabled),
|
|
34
|
+
validateEvent: false,
|
|
35
|
+
"onUpdate:modelValue": (value) => {
|
|
36
|
+
if (!isCurrent()) return;
|
|
37
|
+
const item = items.find((item) => item.id === value);
|
|
38
|
+
if (item && !item.disabled) item.onSelect();
|
|
39
|
+
scheduleTick(() => {
|
|
40
|
+
if (isCurrent()) trigger.value?.$forceUpdate();
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}, { default: () => props.items.map((item) => h(ElOption, {
|
|
44
|
+
key: item.id,
|
|
45
|
+
value: item.id,
|
|
46
|
+
label: item.label,
|
|
47
|
+
disabled: item.disabled,
|
|
48
|
+
title: item.disabledReason,
|
|
49
|
+
"data-adapttable-part": "row-move-menu-item"
|
|
50
|
+
})) }), owner ? h(ElDialog, {
|
|
51
|
+
modelValue: active.value,
|
|
52
|
+
title: owner.title,
|
|
53
|
+
showClose: false,
|
|
54
|
+
destroyOnClose: true,
|
|
55
|
+
"data-adapttable-part": "row-move-confirmation",
|
|
56
|
+
"aria-describedby": description,
|
|
57
|
+
width: "min(28rem, calc(100vw - 2rem))",
|
|
58
|
+
appendToBody: false,
|
|
59
|
+
beforeClose: () => finish("onCancel")
|
|
60
|
+
}, {
|
|
61
|
+
default: () => h("p", { id: description }, owner.description),
|
|
62
|
+
footer: () => [elementButton({
|
|
63
|
+
type: "button",
|
|
64
|
+
"data-adapttable-part": "row-move-cancel",
|
|
65
|
+
onClick: () => finish("onCancel")
|
|
66
|
+
}, owner.cancelLabel), elementButton({
|
|
67
|
+
type: "button",
|
|
68
|
+
"data-adapttable-part": "row-move-confirm",
|
|
69
|
+
onClick: () => finish("onConfirm")
|
|
70
|
+
}, owner.confirmLabel)]
|
|
71
|
+
}) : null]);
|
|
72
|
+
};
|
|
73
|
+
}, {
|
|
74
|
+
name: "ElementRowMoveMenu",
|
|
75
|
+
props: {
|
|
76
|
+
label: { type: String },
|
|
77
|
+
items: { type: Array },
|
|
78
|
+
confirmation: { type: Object }
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/reorder/elementReorderControls.ts
|
|
83
|
+
const elementReorderControls = {
|
|
84
|
+
Handle: ({ label, pressed, dragging, disabled, dragProps, onKeyDown, className }) => elementButton({
|
|
85
|
+
type: "button",
|
|
86
|
+
"aria-label": label,
|
|
87
|
+
"aria-pressed": pressed,
|
|
88
|
+
"data-dragging": dragging ? "" : void 0,
|
|
89
|
+
"data-adapttable-part": "row-reorder-handle",
|
|
90
|
+
"data-adapttable-grip": "",
|
|
91
|
+
class: className,
|
|
92
|
+
disabled,
|
|
93
|
+
draggable: dragProps.draggable,
|
|
94
|
+
onDragstart: (event) => {
|
|
95
|
+
if (event.dataTransfer) dragProps.onDragStart({
|
|
96
|
+
...event,
|
|
97
|
+
dataTransfer: event.dataTransfer,
|
|
98
|
+
clientY: event.clientY,
|
|
99
|
+
currentTarget: event.currentTarget instanceof HTMLElement ? event.currentTarget : null,
|
|
100
|
+
preventDefault: () => event.preventDefault()
|
|
101
|
+
});
|
|
102
|
+
},
|
|
103
|
+
onDragend: dragProps.onDragEnd,
|
|
104
|
+
onKeydown: (event) => onKeyDown({
|
|
105
|
+
key: event.key,
|
|
106
|
+
currentTarget: event.currentTarget instanceof HTMLElement ? event.currentTarget : null,
|
|
107
|
+
preventDefault: () => event.preventDefault()
|
|
108
|
+
})
|
|
109
|
+
}, "↕"),
|
|
110
|
+
Button: ({ label, part, disabled, onClick, className }) => elementButton({
|
|
111
|
+
type: "button",
|
|
112
|
+
"aria-label": label,
|
|
113
|
+
"data-adapttable-part": part,
|
|
114
|
+
class: className,
|
|
115
|
+
disabled,
|
|
116
|
+
onClick
|
|
117
|
+
}, label),
|
|
118
|
+
Menu: (props) => h(ElementRowMoveMenu, props)
|
|
119
|
+
};
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/reorder/ElementRowReorder.vue
|
|
122
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
123
|
+
__name: "ElementRowReorder",
|
|
124
|
+
props: {
|
|
125
|
+
model: {},
|
|
126
|
+
labels: {},
|
|
127
|
+
mobile: { type: Boolean },
|
|
128
|
+
classNames: {},
|
|
129
|
+
rowId: {},
|
|
130
|
+
localIndex: {},
|
|
131
|
+
row: {},
|
|
132
|
+
windowStart: {},
|
|
133
|
+
rowCount: {}
|
|
134
|
+
},
|
|
135
|
+
setup(__props) {
|
|
136
|
+
const props = __props;
|
|
137
|
+
const names = useClassNames();
|
|
138
|
+
const Render = () => RowReorderChrome({
|
|
139
|
+
...props,
|
|
140
|
+
classNames: { ...names.value },
|
|
141
|
+
slots: elementReorderControls
|
|
142
|
+
});
|
|
143
|
+
Render.props = [];
|
|
144
|
+
return (_ctx, _cache) => {
|
|
145
|
+
return openBlock(), createBlock(Render);
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/row-reorder.ts
|
|
151
|
+
function rowReorder(onRowReorder, options) {
|
|
152
|
+
return extendFeature(rowReorder$1(onRowReorder, options), [slotRender(rowReorderControlKey(), (props) => h(_sfc_main, { ...props }))]);
|
|
153
|
+
}
|
|
154
|
+
//#endregion
|
|
2
155
|
export { rowReorder, useRowReorder };
|
|
156
|
+
|
|
157
|
+
//# sourceMappingURL=row-reorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row-reorder.js","names":["bindingRowReorder","ElementRowReorder"],"sources":["../src/reorder/ElementRowMoveMenu.ts","../src/reorder/elementReorderControls.ts","../src/reorder/ElementRowReorder.vue","../src/row-reorder.ts"],"sourcesContent":["import {\n type RowMoveMenuSlotProps,\n scheduleTick,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n ElDialog,\n ElOption,\n ElSelect,\n type SelectInstance,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n type PropType,\n shallowRef,\n useId,\n watch,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n/** The shared controller owns target selection and pending confirmation. */\nexport const ElementRowMoveMenu = defineComponent(\n (props: RowMoveMenuSlotProps) => {\n const active = useScopeActivity();\n let lifetime = 0;\n watch(active, () => lifetime++, { flush: \"sync\" });\n const trigger = shallowRef<SelectInstance>();\n const description = `adapttable-row-move-${useId()}`;\n return () => {\n const live = active.value;\n const ticket = lifetime;\n const items = props.items;\n const owner = props.confirmation;\n const isCurrent = () => live && active.value && ticket === lifetime;\n const finish = (kind: \"onConfirm\" | \"onCancel\") => {\n if (!isCurrent() || !owner) return;\n if (\n props.confirmation?.onConfirm === owner.onConfirm &&\n props.confirmation.onCancel === owner.onCancel\n )\n owner[kind]();\n };\n return h(\"span\", { \"data-adapttable-part\": \"row-move-menu\" }, [\n h(\n ElSelect,\n {\n ref: trigger,\n modelValue: \"\",\n placeholder: props.label,\n \"aria-label\": props.label,\n \"data-adapttable-part\": \"row-move-menu-trigger\",\n teleported: false,\n disabled: props.items.every((item) => item.disabled),\n validateEvent: false,\n \"onUpdate:modelValue\": (value: unknown) => {\n if (!isCurrent()) return;\n const item = items.find((item) => item.id === value);\n if (item && !item.disabled) item.onSelect();\n scheduleTick(() => {\n if (isCurrent()) trigger.value?.$forceUpdate();\n });\n },\n },\n {\n default: () =>\n props.items.map((item) =>\n h(ElOption, {\n key: item.id,\n value: item.id,\n label: item.label,\n disabled: item.disabled,\n title: item.disabledReason,\n \"data-adapttable-part\": \"row-move-menu-item\",\n })\n ),\n }\n ),\n owner\n ? h(\n ElDialog,\n {\n modelValue: active.value,\n title: owner.title,\n showClose: false,\n destroyOnClose: true,\n \"data-adapttable-part\": \"row-move-confirmation\",\n \"aria-describedby\": description,\n width: \"min(28rem, calc(100vw - 2rem))\",\n appendToBody: false,\n beforeClose: () => finish(\"onCancel\"),\n },\n {\n default: () => h(\"p\", { id: description }, owner.description),\n footer: () => [\n elementButton(\n {\n type: \"button\",\n \"data-adapttable-part\": \"row-move-cancel\",\n onClick: () => finish(\"onCancel\"),\n },\n owner.cancelLabel\n ),\n elementButton(\n {\n type: \"button\",\n \"data-adapttable-part\": \"row-move-confirm\",\n onClick: () => finish(\"onConfirm\"),\n },\n owner.confirmLabel\n ),\n ],\n }\n )\n : null,\n ]);\n };\n },\n {\n name: \"ElementRowMoveMenu\",\n props: {\n label: { type: String as PropType<RowMoveMenuSlotProps[\"label\"]> },\n items: { type: Array as PropType<RowMoveMenuSlotProps[\"items\"]> },\n confirmation: {\n type: Object as PropType<RowMoveMenuSlotProps[\"confirmation\"]>,\n },\n },\n }\n);\n","import type { RowReorderControlSlots } from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport { ElementRowMoveMenu } from \"./ElementRowMoveMenu\";\n\nexport const elementReorderControls: RowReorderControlSlots = {\n Handle: ({\n label,\n pressed,\n dragging,\n disabled,\n dragProps,\n onKeyDown,\n className,\n }) =>\n elementButton(\n {\n type: \"button\",\n \"aria-label\": label,\n \"aria-pressed\": pressed,\n \"data-dragging\": dragging ? \"\" : undefined,\n \"data-adapttable-part\": \"row-reorder-handle\",\n \"data-adapttable-grip\": \"\",\n class: className,\n disabled,\n draggable: dragProps.draggable,\n onDragstart: (event: DragEvent) => {\n if (event.dataTransfer)\n dragProps.onDragStart({\n ...event,\n dataTransfer: event.dataTransfer,\n clientY: event.clientY,\n currentTarget:\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget\n : null,\n preventDefault: () => event.preventDefault(),\n });\n },\n onDragend: dragProps.onDragEnd,\n onKeydown: (event: KeyboardEvent) =>\n onKeyDown({\n key: event.key,\n currentTarget:\n event.currentTarget instanceof HTMLElement\n ? event.currentTarget\n : null,\n preventDefault: () => event.preventDefault(),\n }),\n },\n \"↕\"\n ),\n Button: ({ label, part, disabled, onClick, className }) =>\n elementButton(\n {\n type: \"button\",\n \"aria-label\": label,\n \"data-adapttable-part\": part,\n class: className,\n disabled,\n onClick,\n },\n label\n ),\n Menu: (props) => h(ElementRowMoveMenu, props),\n};\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n RowReorderChrome,\n type RowReorderControlProps,\n} from \"@adapttable/vue/adapter\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementReorderControls } from \"./elementReorderControls\";\n\nconst props = defineProps<RowReorderControlProps<TRow>>();\nconst names = useClassNames();\nconst Render = () =>\n RowReorderChrome({\n ...props,\n classNames: { ...names.value },\n slots: elementReorderControls,\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 RowReorderHandler,\n RowReorderOptions,\n TableFeature,\n} from \"@adapttable/vue\";\nimport {\n extendFeature,\n rowReorderControlKey,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport { rowReorder as bindingRowReorder } from \"@adapttable/vue/features\";\nimport { h, type MaybeRefOrGetter } from \"vue\";\n\nimport ElementRowReorder from \"./reorder/ElementRowReorder.vue\";\nexport {\n type RowReorderHandler,\n type RowReorderOptions,\n useRowReorder,\n} from \"@adapttable/vue\";\nexport function rowReorder<TRow>(\n onRowReorder: RowReorderHandler<TRow>,\n options?: MaybeRefOrGetter<RowReorderOptions<TRow> | undefined>\n): TableFeature<TRow> {\n return extendFeature(bindingRowReorder(onRowReorder, options), [\n slotRender(rowReorderControlKey<TRow>(), (props) =>\n h(ElementRowReorder<TRow>, { ...props })\n ),\n ]);\n}\n"],"mappings":";;;;;;;;;AAsBA,MAAa,qBAAqB,iBAC/B,UAAgC;CAC/B,MAAM,SAAS,iBAAiB;CAChC,IAAI,WAAW;CACf,MAAM,cAAc,YAAY,EAAE,OAAO,OAAO,CAAC;CACjD,MAAM,UAAU,WAA2B;CAC3C,MAAM,cAAc,uBAAuB,MAAM;CACjD,aAAa;EACX,MAAM,OAAO,OAAO;EACpB,MAAM,SAAS;EACf,MAAM,QAAQ,MAAM;EACpB,MAAM,QAAQ,MAAM;EACpB,MAAM,kBAAkB,QAAQ,OAAO,SAAS,WAAW;EAC3D,MAAM,UAAU,SAAmC;GACjD,IAAI,CAAC,UAAU,KAAK,CAAC,OAAO;GAC5B,IACE,MAAM,cAAc,cAAc,MAAM,aACxC,MAAM,aAAa,aAAa,MAAM,UAEtC,MAAM,KAAK,CAAC;EAChB;EACA,OAAO,EAAE,QAAQ,EAAE,wBAAwB,gBAAgB,GAAG,CAC5D,EACE,UACA;GACE,KAAK;GACL,YAAY;GACZ,aAAa,MAAM;GACnB,cAAc,MAAM;GACpB,wBAAwB;GACxB,YAAY;GACZ,UAAU,MAAM,MAAM,OAAO,SAAS,KAAK,QAAQ;GACnD,eAAe;GACf,wBAAwB,UAAmB;IACzC,IAAI,CAAC,UAAU,GAAG;IAClB,MAAM,OAAO,MAAM,MAAM,SAAS,KAAK,OAAO,KAAK;IACnD,IAAI,QAAQ,CAA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,eAAe;GAC7C,CAAC;EACL;EACA,WAAW,UAAU;EACrB,YAAY,UACV,UAAU;GACR,KAAK,MAAM;GACX,eACE,MAAM,yBAAyB,cAC3B,MAAM,gBACN;GACN,sBAAsB,MAAM,eAAe;EAC7C,CAAC;CACL,GACA,GACF;CACF,SAAS,EAAE,OAAO,MAAM,UAAU,SAAS,gBACzC,cACE;EACE,MAAM;EACN,cAAc;EACd,wBAAwB;EACxB,OAAO;EACP;EACA;CACF,GACA,KACF;CACF,OAAO,UAAU,EAAE,oBAAoB,KAAK;AAC9C;;;;;;;;;;;;;;;;;ECzDA,MAAM,QAAQ;EACd,MAAM,QAAQ,cAAc;EAC5B,MAAM,eACJ,iBAAiB;GACf,GAAG;GACH,YAAY,EAAE,GAAG,MAAM,MAAM;GAC7B,OAAO;EACT,CAAC;EAIH,OAAO,QAAQ,CAAA;;GAIb,OAAA,UAAA,GAAA,YAAU,MAAA;;;;;;ACLZ,SAAgB,WACd,cACA,SACoB;CACpB,OAAO,cAAcA,aAAkB,cAAc,OAAO,GAAG,CAC7D,WAAW,qBAA2B,IAAI,UACxC,EAAEC,WAAyB,EAAE,GAAG,MAAM,CAAC,CACzC,CACF,CAAC;AACH"}
|
package/dist/rows.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { rowActions } from "./row-actions.cjs";
|
|
2
|
+
import { rowPinning } from "./row-pinning.cjs";
|
|
3
3
|
import { CellSpanAppearance, CellSpanRequest, ConfirmHandler, ConfirmRequest, ExtraRowKind, GetCellSpan, GetCellSpanArgs, PinnedRows, PinnedSummaryEntry, RowAction, RowHeight, RowMutationHandlers, RowPinSide, RowPinState, RowStyle } from "@adapttable/vue";
|
|
4
4
|
import { ExtraEntry, ExtraRow } from "@adapttable/vue/adapter";
|
|
5
5
|
import { RowAppearanceOptions, RowPinningFeatureOptions, cellSpan, extraRows, pinnedSummaryRows, rowAppearance } from "@adapttable/vue/features";
|
package/dist/rows.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { rowActions } from "./row-actions.js";
|
|
2
|
+
import { rowPinning } from "./row-pinning.js";
|
|
3
3
|
import { ExtraEntry, ExtraRow } from "@adapttable/vue/adapter";
|
|
4
4
|
import { RowAppearanceOptions, RowPinningFeatureOptions, cellSpan, extraRows, pinnedSummaryRows, rowAppearance } from "@adapttable/vue/features";
|
|
5
5
|
import { CellSpanAppearance, CellSpanRequest, ConfirmHandler, ConfirmRequest, ExtraRowKind, GetCellSpan, GetCellSpanArgs, PinnedRows, PinnedSummaryEntry, RowAction, RowHeight, RowMutationHandlers, RowPinSide, RowPinState, RowStyle } from "@adapttable/vue";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
3
|
+
Object.defineProperty(exports, "selection", {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: function() {
|
|
6
|
+
return _adapttable_vue_features.selection;
|
|
7
|
+
}
|
|
8
|
+
});
|
package/dist/styles.css
CHANGED
|
@@ -598,63 +598,6 @@
|
|
|
598
598
|
min-width: 44px;
|
|
599
599
|
min-height: 44px;
|
|
600
600
|
}
|
|
601
|
-
.adapttable-element-plus-pivot {
|
|
602
|
-
flex-wrap: wrap;
|
|
603
|
-
gap: .75rem;
|
|
604
|
-
display: flex;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
.adapttable-element-plus-pivot fieldset {
|
|
608
|
-
border: 1px solid var(--el-border-color);
|
|
609
|
-
border-radius: var(--el-border-radius-base);
|
|
610
|
-
gap: .5rem;
|
|
611
|
-
min-inline-size: 0;
|
|
612
|
-
margin: 0;
|
|
613
|
-
padding: .5rem .75rem .75rem;
|
|
614
|
-
display: grid;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
.adapttable-element-plus-pivot [data-adapttable-part="pivot-field"] {
|
|
618
|
-
flex-wrap: wrap;
|
|
619
|
-
align-items: center;
|
|
620
|
-
gap: .375rem;
|
|
621
|
-
display: flex;
|
|
622
|
-
}
|
|
623
|
-
.adapttable-element-plus-assistant-panel, .adapttable-element-plus-assistant-window {
|
|
624
|
-
flex-direction: column;
|
|
625
|
-
min-inline-size: 18rem;
|
|
626
|
-
display: flex;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
.adapttable-element-plus-assistant-input {
|
|
630
|
-
inline-size: 100%;
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
.adapttable-element-plus-approval-list {
|
|
634
|
-
gap: .5rem;
|
|
635
|
-
margin: 0;
|
|
636
|
-
padding: 0;
|
|
637
|
-
list-style: none;
|
|
638
|
-
display: grid;
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
.el-button.adapttable-element-edit-value {
|
|
642
|
-
justify-content: start;
|
|
643
|
-
inline-size: 100%;
|
|
644
|
-
min-inline-size: 0;
|
|
645
|
-
block-size: auto;
|
|
646
|
-
padding: 0;
|
|
647
|
-
border: 0;
|
|
648
|
-
color: inherit;
|
|
649
|
-
font: inherit;
|
|
650
|
-
text-align: inherit;
|
|
651
|
-
white-space: normal;
|
|
652
|
-
overflow-wrap: anywhere;
|
|
653
|
-
cursor: text;
|
|
654
|
-
}
|
|
655
|
-
.el-button.adapttable-element-edit-value > span {
|
|
656
|
-
min-inline-size: 0;
|
|
657
|
-
}
|
|
658
601
|
|
|
659
602
|
.adapttable-element-grouping > .el-card__body {
|
|
660
603
|
display: flex;
|
|
@@ -808,3 +751,60 @@
|
|
|
808
751
|
border-style: solid;
|
|
809
752
|
outline: 2px solid var(--el-color-danger);
|
|
810
753
|
}
|
|
754
|
+
.adapttable-element-plus-pivot {
|
|
755
|
+
flex-wrap: wrap;
|
|
756
|
+
gap: .75rem;
|
|
757
|
+
display: flex;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
.adapttable-element-plus-pivot fieldset {
|
|
761
|
+
border: 1px solid var(--el-border-color);
|
|
762
|
+
border-radius: var(--el-border-radius-base);
|
|
763
|
+
gap: .5rem;
|
|
764
|
+
min-inline-size: 0;
|
|
765
|
+
margin: 0;
|
|
766
|
+
padding: .5rem .75rem .75rem;
|
|
767
|
+
display: grid;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
.adapttable-element-plus-pivot [data-adapttable-part="pivot-field"] {
|
|
771
|
+
flex-wrap: wrap;
|
|
772
|
+
align-items: center;
|
|
773
|
+
gap: .375rem;
|
|
774
|
+
display: flex;
|
|
775
|
+
}
|
|
776
|
+
.adapttable-element-plus-assistant-panel, .adapttable-element-plus-assistant-window {
|
|
777
|
+
flex-direction: column;
|
|
778
|
+
min-inline-size: 18rem;
|
|
779
|
+
display: flex;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
.adapttable-element-plus-assistant-input {
|
|
783
|
+
inline-size: 100%;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
.adapttable-element-plus-approval-list {
|
|
787
|
+
gap: .5rem;
|
|
788
|
+
margin: 0;
|
|
789
|
+
padding: 0;
|
|
790
|
+
list-style: none;
|
|
791
|
+
display: grid;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
.el-button.adapttable-element-edit-value {
|
|
795
|
+
justify-content: start;
|
|
796
|
+
inline-size: 100%;
|
|
797
|
+
min-inline-size: 0;
|
|
798
|
+
block-size: auto;
|
|
799
|
+
padding: 0;
|
|
800
|
+
border: 0;
|
|
801
|
+
color: inherit;
|
|
802
|
+
font: inherit;
|
|
803
|
+
text-align: inherit;
|
|
804
|
+
white-space: normal;
|
|
805
|
+
overflow-wrap: anywhere;
|
|
806
|
+
cursor: text;
|
|
807
|
+
}
|
|
808
|
+
.el-button.adapttable-element-edit-value > span {
|
|
809
|
+
min-inline-size: 0;
|
|
810
|
+
}
|