@toolbox-web/grid-vue 0.7.1 → 0.9.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/features/clipboard.d.ts +0 -19
- package/features/clipboard.d.ts.map +1 -1
- package/features/clipboard.js +1 -3
- package/features/clipboard.js.map +1 -1
- package/features/column-virtualization.d.ts +0 -19
- package/features/column-virtualization.d.ts.map +1 -1
- package/features/column-virtualization.js +1 -3
- package/features/column-virtualization.js.map +1 -1
- package/features/context-menu.d.ts +0 -19
- package/features/context-menu.d.ts.map +1 -1
- package/features/context-menu.js +1 -3
- package/features/context-menu.js.map +1 -1
- package/features/editing.d.ts +0 -19
- package/features/editing.d.ts.map +1 -1
- package/features/editing.js +1 -3
- package/features/editing.js.map +1 -1
- package/features/export.d.ts.map +1 -1
- package/features/export.js +18 -20
- package/features/export.js.map +1 -1
- package/features/filtering.js +4 -4
- package/features/grouping-columns.d.ts +9 -0
- package/features/grouping-columns.d.ts.map +1 -1
- package/features/grouping-columns.js +22 -3
- package/features/grouping-columns.js.map +1 -1
- package/features/grouping-rows.d.ts +9 -0
- package/features/grouping-rows.d.ts.map +1 -1
- package/features/grouping-rows.js +21 -2
- package/features/grouping-rows.js.map +1 -1
- package/features/index.js +17 -18
- package/features/index.js.map +1 -1
- package/features/master-detail.d.ts +0 -22
- package/features/master-detail.d.ts.map +1 -1
- package/features/master-detail.js +1 -3
- package/features/master-detail.js.map +1 -1
- package/features/multi-sort.d.ts +0 -19
- package/features/multi-sort.d.ts.map +1 -1
- package/features/multi-sort.js +1 -4
- package/features/multi-sort.js.map +1 -1
- package/features/pinned-columns.d.ts +0 -22
- package/features/pinned-columns.d.ts.map +1 -1
- package/features/pinned-columns.js +1 -3
- package/features/pinned-columns.js.map +1 -1
- package/features/pinned-rows.d.ts +0 -21
- package/features/pinned-rows.d.ts.map +1 -1
- package/features/pinned-rows.js +26 -3
- package/features/pinned-rows.js.map +1 -1
- package/features/pivot.d.ts +0 -23
- package/features/pivot.d.ts.map +1 -1
- package/features/pivot.js +1 -3
- package/features/pivot.js.map +1 -1
- package/features/print.d.ts.map +1 -1
- package/features/print.js +9 -11
- package/features/print.js.map +1 -1
- package/features/reorder-columns.d.ts +1 -0
- package/features/reorder-columns.d.ts.map +1 -0
- package/features/reorder-columns.js +2 -0
- package/features/reorder-columns.js.map +1 -0
- package/features/reorder-rows.d.ts +1 -0
- package/features/reorder-rows.d.ts.map +1 -0
- package/features/reorder-rows.js +2 -0
- package/features/reorder-rows.js.map +1 -0
- package/features/reorder.d.ts +3 -17
- package/features/reorder.d.ts.map +1 -1
- package/features/reorder.js +1 -3
- package/features/reorder.js.map +1 -1
- package/features/responsive.d.ts +0 -23
- package/features/responsive.d.ts.map +1 -1
- package/features/responsive.js +1 -3
- package/features/responsive.js.map +1 -1
- package/features/row-reorder.d.ts +3 -17
- package/features/row-reorder.d.ts.map +1 -1
- package/features/row-reorder.js +1 -3
- package/features/row-reorder.js.map +1 -1
- package/features/selection.d.ts.map +1 -1
- package/features/selection.js +20 -22
- package/features/selection.js.map +1 -1
- package/features/server-side.d.ts +0 -21
- package/features/server-side.d.ts.map +1 -1
- package/features/server-side.js +1 -3
- package/features/server-side.js.map +1 -1
- package/features/tree.d.ts +0 -22
- package/features/tree.d.ts.map +1 -1
- package/features/tree.js +1 -3
- package/features/tree.js.map +1 -1
- package/features/undo-redo.d.ts.map +1 -1
- package/features/undo-redo.js +10 -12
- package/features/undo-redo.js.map +1 -1
- package/features/visibility.d.ts +0 -19
- package/features/visibility.d.ts.map +1 -1
- package/features/visibility.js +1 -3
- package/features/visibility.js.map +1 -1
- package/index.js +545 -395
- package/index.js.map +1 -1
- package/lib/TbwGrid.vue.d.ts +5 -1
- package/lib/TbwGrid.vue.d.ts.map +1 -1
- package/lib/feature-props.d.ts +12 -4
- package/lib/feature-props.d.ts.map +1 -1
- package/lib/feature-registry.d.ts +6 -51
- package/lib/feature-registry.d.ts.map +1 -1
- package/lib/vue-column-config.d.ts +20 -3
- package/lib/vue-column-config.d.ts.map +1 -1
- package/lib/vue-grid-adapter.d.ts +34 -0
- package/lib/vue-grid-adapter.d.ts.map +1 -1
- package/package.json +1 -1
- package/chunks/feature-registry-BgEOysSJ.js +0 -38
- package/chunks/feature-registry-BgEOysSJ.js.map +0 -1
package/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as y, provide as
|
|
2
|
-
import { DataGridElement as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { G as
|
|
6
|
-
import { u as
|
|
1
|
+
import { defineComponent as y, provide as N, inject as k, createApp as u, createVNode as V, ref as O, computed as re, onMounted as P, onBeforeUnmount as q, watch as G, createElementBlock as T, openBlock as j, renderSlot as x, useSlots as B, h as L } from "vue";
|
|
2
|
+
import { DataGridElement as ne } from "@toolbox-web/grid";
|
|
3
|
+
import { createPluginFromFeature as oe } from "@toolbox-web/grid/features/registry";
|
|
4
|
+
import { clearFeatureRegistry as Be, createPluginFromFeature as Se, getFeatureFactory as Ne, getRegisteredFeatures as ke, isFeatureRegistered as Fe, registerFeature as Ae } from "@toolbox-web/grid/features/registry";
|
|
5
|
+
import { G as U } from "./chunks/use-grid-B59B6XdD.js";
|
|
6
|
+
import { u as We } from "./chunks/use-grid-B59B6XdD.js";
|
|
7
7
|
const K = /* @__PURE__ */ Symbol("grid-icons");
|
|
8
8
|
function ie() {
|
|
9
|
-
return
|
|
9
|
+
return k(K, void 0);
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const de = y({
|
|
12
12
|
name: "GridIconProvider",
|
|
13
13
|
props: {
|
|
14
14
|
/**
|
|
@@ -19,17 +19,17 @@ const se = y({
|
|
|
19
19
|
required: !0
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
setup(i, { slots:
|
|
23
|
-
return
|
|
22
|
+
setup(i, { slots: t }) {
|
|
23
|
+
return N(K, i.icons), () => t.default?.();
|
|
24
24
|
}
|
|
25
25
|
}), Y = /* @__PURE__ */ Symbol("grid-type-defaults");
|
|
26
26
|
function J() {
|
|
27
|
-
return
|
|
27
|
+
return k(Y, void 0);
|
|
28
28
|
}
|
|
29
29
|
function Ce(i) {
|
|
30
30
|
return J()?.[i];
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const se = y({
|
|
33
33
|
name: "GridTypeProvider",
|
|
34
34
|
props: {
|
|
35
35
|
/**
|
|
@@ -40,60 +40,60 @@ const de = y({
|
|
|
40
40
|
required: !0
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
setup(i, { slots:
|
|
44
|
-
return
|
|
43
|
+
setup(i, { slots: t }) {
|
|
44
|
+
return N(Y, i.defaults), () => t.default?.();
|
|
45
45
|
}
|
|
46
|
-
}), Q = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(),
|
|
47
|
-
function
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
const
|
|
51
|
-
|
|
46
|
+
}), Q = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new Map();
|
|
47
|
+
function ae(i, t) {
|
|
48
|
+
const r = i.getAttribute("field"), e = w.get(i) ?? {};
|
|
49
|
+
if (e.renderer = t, w.set(i, e), r) {
|
|
50
|
+
const n = C.get(r) ?? {};
|
|
51
|
+
n.renderer = t, C.set(r, n);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
57
|
-
const
|
|
58
|
-
|
|
54
|
+
function le(i, t) {
|
|
55
|
+
const r = i.getAttribute("field"), e = w.get(i) ?? {};
|
|
56
|
+
if (e.editor = t, w.set(i, e), r) {
|
|
57
|
+
const n = C.get(r) ?? {};
|
|
58
|
+
n.editor = t, C.set(r, n);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
function ce(i) {
|
|
62
|
-
let
|
|
63
|
-
if (!
|
|
64
|
-
const
|
|
65
|
-
|
|
62
|
+
let t = w.get(i)?.renderer;
|
|
63
|
+
if (!t) {
|
|
64
|
+
const r = i.getAttribute("field");
|
|
65
|
+
r && (t = C.get(r)?.renderer);
|
|
66
66
|
}
|
|
67
|
-
return
|
|
67
|
+
return t;
|
|
68
68
|
}
|
|
69
69
|
function ue(i) {
|
|
70
|
-
let
|
|
71
|
-
if (!
|
|
72
|
-
const
|
|
73
|
-
|
|
70
|
+
let t = w.get(i)?.editor;
|
|
71
|
+
if (!t) {
|
|
72
|
+
const r = i.getAttribute("field");
|
|
73
|
+
r && (t = C.get(r)?.editor);
|
|
74
74
|
}
|
|
75
|
-
return
|
|
75
|
+
return t;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function v(i) {
|
|
78
78
|
if (i == null || typeof i == "function" && i.prototype === void 0)
|
|
79
79
|
return !1;
|
|
80
80
|
if (typeof i == "object") {
|
|
81
|
-
const
|
|
82
|
-
if ("__name" in
|
|
81
|
+
const t = i;
|
|
82
|
+
if ("__name" in t || typeof t.setup == "function" || typeof t.render == "function") return !0;
|
|
83
83
|
}
|
|
84
84
|
if (typeof i == "function") {
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
88
|
-
if ("__name" in
|
|
85
|
+
const t = Function.prototype.toString.call(i);
|
|
86
|
+
if (t.startsWith("class ") || t.startsWith("class{")) return !0;
|
|
87
|
+
const r = i;
|
|
88
|
+
if ("__name" in r || typeof r.setup == "function") return !0;
|
|
89
89
|
}
|
|
90
90
|
return !1;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return typeof i == "function" && !
|
|
92
|
+
function R(i) {
|
|
93
|
+
return typeof i == "function" && !v(i);
|
|
94
94
|
}
|
|
95
|
-
const
|
|
96
|
-
class
|
|
95
|
+
const m = /* @__PURE__ */ Symbol.for("tbw:vue-processed");
|
|
96
|
+
class pe {
|
|
97
97
|
mountedViews = [];
|
|
98
98
|
/** Editor-specific views tracked separately for per-cell cleanup via releaseCell. */
|
|
99
99
|
editorViews = [];
|
|
@@ -123,9 +123,13 @@ class fe {
|
|
|
123
123
|
* @param config - Vue grid config with possible component/VNode references
|
|
124
124
|
* @returns Processed config with DOM-returning functions
|
|
125
125
|
*/
|
|
126
|
-
processGridConfig(
|
|
127
|
-
const
|
|
128
|
-
return
|
|
126
|
+
processGridConfig(t) {
|
|
127
|
+
const r = { ...t };
|
|
128
|
+
return t.columns && (r.columns = t.columns.map((e) => this.processColumn(e))), t.typeDefaults && (r.typeDefaults = this.processTypeDefaults(t.typeDefaults)), t.loadingRenderer && (v(t.loadingRenderer) ? r.loadingRenderer = this.createComponentLoadingRenderer(
|
|
129
|
+
t.loadingRenderer
|
|
130
|
+
) : R(t.loadingRenderer) && (r.loadingRenderer = this.createVNodeLoadingRenderer(
|
|
131
|
+
t.loadingRenderer
|
|
132
|
+
))), r;
|
|
129
133
|
}
|
|
130
134
|
/**
|
|
131
135
|
* Processes typeDefaults, converting Vue component/VNode references
|
|
@@ -134,21 +138,21 @@ class fe {
|
|
|
134
138
|
* @param typeDefaults - Vue type defaults with possible component references
|
|
135
139
|
* @returns Processed TypeDefault record
|
|
136
140
|
*/
|
|
137
|
-
processTypeDefaults(
|
|
138
|
-
const
|
|
139
|
-
for (const [
|
|
140
|
-
const
|
|
141
|
-
editorParams:
|
|
141
|
+
processTypeDefaults(t) {
|
|
142
|
+
const r = {};
|
|
143
|
+
for (const [e, n] of Object.entries(t)) {
|
|
144
|
+
const d = {
|
|
145
|
+
editorParams: n.editorParams
|
|
142
146
|
};
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
))),
|
|
146
|
-
|
|
147
|
-
) :
|
|
148
|
-
|
|
149
|
-
))),
|
|
147
|
+
n.renderer && (v(n.renderer) ? d.renderer = this.createConfigComponentRenderer(n.renderer) : R(n.renderer) && (d.renderer = this.createTypeRenderer(
|
|
148
|
+
n.renderer
|
|
149
|
+
))), n.editor && (v(n.editor) ? d.editor = this.createConfigComponentEditor(
|
|
150
|
+
n.editor
|
|
151
|
+
) : R(n.editor) && (d.editor = this.createTypeEditor(
|
|
152
|
+
n.editor
|
|
153
|
+
))), n.filterPanelRenderer && (d.filterPanelRenderer = this.createFilterPanelRenderer(n.filterPanelRenderer)), r[e] = d;
|
|
150
154
|
}
|
|
151
|
-
return
|
|
155
|
+
return r;
|
|
152
156
|
}
|
|
153
157
|
/**
|
|
154
158
|
* Processes a single column configuration, converting Vue component references
|
|
@@ -157,65 +161,87 @@ class fe {
|
|
|
157
161
|
* @param column - Vue column config
|
|
158
162
|
* @returns Processed ColumnConfig with DOM-returning functions
|
|
159
163
|
*/
|
|
160
|
-
processColumn(
|
|
161
|
-
const
|
|
162
|
-
if (
|
|
163
|
-
if (
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
} else if (
|
|
167
|
-
const
|
|
168
|
-
|
|
164
|
+
processColumn(t) {
|
|
165
|
+
const r = { ...t };
|
|
166
|
+
if (t.renderer && !t.renderer[m]) {
|
|
167
|
+
if (v(t.renderer)) {
|
|
168
|
+
const e = this.createConfigComponentRenderer(t.renderer);
|
|
169
|
+
e[m] = !0, r.renderer = e;
|
|
170
|
+
} else if (R(t.renderer)) {
|
|
171
|
+
const e = this.createConfigVNodeRenderer(t.renderer);
|
|
172
|
+
e[m] = !0, r.renderer = e;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (t.editor && !t.editor[m]) {
|
|
176
|
+
if (v(t.editor)) {
|
|
177
|
+
const e = this.createConfigComponentEditor(t.editor);
|
|
178
|
+
e[m] = !0, r.editor = e;
|
|
179
|
+
} else if (R(t.editor)) {
|
|
180
|
+
const e = this.createConfigVNodeEditor(t.editor);
|
|
181
|
+
e[m] = !0, r.editor = e;
|
|
169
182
|
}
|
|
170
183
|
}
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
} else if (
|
|
176
|
-
const
|
|
177
|
-
|
|
184
|
+
if (t.headerRenderer && !t.headerRenderer[m]) {
|
|
185
|
+
if (v(t.headerRenderer)) {
|
|
186
|
+
const e = this.createConfigComponentHeaderRenderer(t.headerRenderer);
|
|
187
|
+
e[m] = !0, r.headerRenderer = e;
|
|
188
|
+
} else if (R(t.headerRenderer)) {
|
|
189
|
+
const e = this.createConfigVNodeHeaderRenderer(
|
|
190
|
+
t.headerRenderer
|
|
191
|
+
);
|
|
192
|
+
e[m] = !0, r.headerRenderer = e;
|
|
178
193
|
}
|
|
179
194
|
}
|
|
180
|
-
|
|
195
|
+
if (t.headerLabelRenderer && !t.headerLabelRenderer[m]) {
|
|
196
|
+
if (v(t.headerLabelRenderer)) {
|
|
197
|
+
const e = this.createConfigComponentHeaderLabelRenderer(t.headerLabelRenderer);
|
|
198
|
+
e[m] = !0, r.headerLabelRenderer = e;
|
|
199
|
+
} else if (R(t.headerLabelRenderer)) {
|
|
200
|
+
const e = this.createConfigVNodeHeaderLabelRenderer(
|
|
201
|
+
t.headerLabelRenderer
|
|
202
|
+
);
|
|
203
|
+
e[m] = !0, r.headerLabelRenderer = e;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return r;
|
|
181
207
|
}
|
|
182
208
|
/**
|
|
183
209
|
* Creates a DOM-returning renderer from a Vue component class.
|
|
184
210
|
* Used for config-based renderers (not slot-based).
|
|
185
211
|
* @internal
|
|
186
212
|
*/
|
|
187
|
-
createConfigComponentRenderer(
|
|
188
|
-
const
|
|
189
|
-
return (
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
192
|
-
const
|
|
193
|
-
if (
|
|
194
|
-
return
|
|
213
|
+
createConfigComponentRenderer(t) {
|
|
214
|
+
const r = /* @__PURE__ */ new WeakMap();
|
|
215
|
+
return (e) => {
|
|
216
|
+
const n = e.cellEl;
|
|
217
|
+
if (n) {
|
|
218
|
+
const l = r.get(n);
|
|
219
|
+
if (l)
|
|
220
|
+
return l.update(e), l.container;
|
|
195
221
|
const c = document.createElement("div");
|
|
196
222
|
c.className = "vue-cell-renderer", c.style.display = "contents";
|
|
197
|
-
let
|
|
198
|
-
const
|
|
223
|
+
let p = e;
|
|
224
|
+
const h = t, b = u({
|
|
199
225
|
render() {
|
|
200
|
-
return
|
|
226
|
+
return V(h, { ...p });
|
|
201
227
|
}
|
|
202
228
|
});
|
|
203
|
-
return
|
|
204
|
-
app:
|
|
229
|
+
return b.mount(c), r.set(n, {
|
|
230
|
+
app: b,
|
|
205
231
|
container: c,
|
|
206
|
-
update: (
|
|
207
|
-
|
|
232
|
+
update: (_) => {
|
|
233
|
+
p = _, b._instance?.update();
|
|
208
234
|
}
|
|
209
235
|
}), c;
|
|
210
236
|
}
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
const
|
|
237
|
+
const d = document.createElement("div");
|
|
238
|
+
d.className = "vue-cell-renderer", d.style.display = "contents";
|
|
239
|
+
const s = t, a = u({
|
|
214
240
|
render() {
|
|
215
|
-
return
|
|
241
|
+
return V(s, { ...e });
|
|
216
242
|
}
|
|
217
243
|
});
|
|
218
|
-
return
|
|
244
|
+
return a.mount(d), this.mountedViews.push({ app: a, container: d }), d;
|
|
219
245
|
};
|
|
220
246
|
}
|
|
221
247
|
/**
|
|
@@ -223,38 +249,38 @@ class fe {
|
|
|
223
249
|
* Used for config-based renderers (not slot-based).
|
|
224
250
|
* @internal
|
|
225
251
|
*/
|
|
226
|
-
createConfigVNodeRenderer(
|
|
227
|
-
const
|
|
228
|
-
return (
|
|
229
|
-
const
|
|
230
|
-
if (
|
|
231
|
-
const
|
|
232
|
-
if (
|
|
233
|
-
return
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
let c =
|
|
237
|
-
const
|
|
252
|
+
createConfigVNodeRenderer(t) {
|
|
253
|
+
const r = /* @__PURE__ */ new WeakMap();
|
|
254
|
+
return (e) => {
|
|
255
|
+
const n = e.cellEl;
|
|
256
|
+
if (n) {
|
|
257
|
+
const a = r.get(n);
|
|
258
|
+
if (a)
|
|
259
|
+
return a.update(e), a.container;
|
|
260
|
+
const l = document.createElement("div");
|
|
261
|
+
l.className = "vue-cell-renderer", l.style.display = "contents";
|
|
262
|
+
let c = e;
|
|
263
|
+
const p = u({
|
|
238
264
|
render() {
|
|
239
|
-
return
|
|
265
|
+
return t(c);
|
|
240
266
|
}
|
|
241
267
|
});
|
|
242
|
-
return
|
|
243
|
-
app:
|
|
244
|
-
container:
|
|
245
|
-
update: (
|
|
246
|
-
c =
|
|
268
|
+
return p.mount(l), r.set(n, {
|
|
269
|
+
app: p,
|
|
270
|
+
container: l,
|
|
271
|
+
update: (h) => {
|
|
272
|
+
c = h, p._instance?.update();
|
|
247
273
|
}
|
|
248
|
-
}),
|
|
274
|
+
}), l;
|
|
249
275
|
}
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
const
|
|
276
|
+
const d = document.createElement("div");
|
|
277
|
+
d.className = "vue-cell-renderer", d.style.display = "contents";
|
|
278
|
+
const s = u({
|
|
253
279
|
render() {
|
|
254
|
-
return e
|
|
280
|
+
return t(e);
|
|
255
281
|
}
|
|
256
282
|
});
|
|
257
|
-
return
|
|
283
|
+
return s.mount(d), this.mountedViews.push({ app: s, container: d }), d;
|
|
258
284
|
};
|
|
259
285
|
}
|
|
260
286
|
/**
|
|
@@ -262,16 +288,16 @@ class fe {
|
|
|
262
288
|
* Used for config-based editors (not slot-based).
|
|
263
289
|
* @internal
|
|
264
290
|
*/
|
|
265
|
-
createConfigComponentEditor(
|
|
266
|
-
return (
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
const
|
|
291
|
+
createConfigComponentEditor(t) {
|
|
292
|
+
return (r) => {
|
|
293
|
+
const e = document.createElement("div");
|
|
294
|
+
e.className = "vue-cell-editor", e.style.display = "contents";
|
|
295
|
+
const n = t, d = u({
|
|
270
296
|
render() {
|
|
271
|
-
return
|
|
297
|
+
return V(n, { ...r });
|
|
272
298
|
}
|
|
273
299
|
});
|
|
274
|
-
return
|
|
300
|
+
return d.mount(e), this.editorViews.push({ app: d, container: e }), e;
|
|
275
301
|
};
|
|
276
302
|
}
|
|
277
303
|
/**
|
|
@@ -279,16 +305,126 @@ class fe {
|
|
|
279
305
|
* Used for config-based editors (not slot-based).
|
|
280
306
|
* @internal
|
|
281
307
|
*/
|
|
282
|
-
createConfigVNodeEditor(
|
|
283
|
-
return (
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
const
|
|
308
|
+
createConfigVNodeEditor(t) {
|
|
309
|
+
return (r) => {
|
|
310
|
+
const e = document.createElement("div");
|
|
311
|
+
e.className = "vue-cell-editor", e.style.display = "contents";
|
|
312
|
+
const n = u({
|
|
313
|
+
render() {
|
|
314
|
+
return t(r);
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
return n.mount(e), this.editorViews.push({ app: n, container: e }), e;
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Creates a DOM-returning header renderer from a Vue component class.
|
|
322
|
+
* Used for config-based headerRenderer (not slot-based).
|
|
323
|
+
* @internal
|
|
324
|
+
*/
|
|
325
|
+
createConfigComponentHeaderRenderer(t) {
|
|
326
|
+
return (r) => {
|
|
327
|
+
const e = document.createElement("div");
|
|
328
|
+
e.className = "vue-header-renderer", e.style.display = "contents";
|
|
329
|
+
const n = t, d = u({
|
|
330
|
+
render() {
|
|
331
|
+
return V(n, {
|
|
332
|
+
column: r.column,
|
|
333
|
+
value: r.value,
|
|
334
|
+
sortState: r.sortState,
|
|
335
|
+
filterActive: r.filterActive,
|
|
336
|
+
renderSortIcon: r.renderSortIcon,
|
|
337
|
+
renderFilterButton: r.renderFilterButton
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
return d.mount(e), this.mountedViews.push({ app: d, container: e }), e;
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Creates a DOM-returning header renderer from a VNode-returning render function.
|
|
346
|
+
* Used for config-based headerRenderer (not slot-based).
|
|
347
|
+
* @internal
|
|
348
|
+
*/
|
|
349
|
+
createConfigVNodeHeaderRenderer(t) {
|
|
350
|
+
return (r) => {
|
|
351
|
+
const e = document.createElement("div");
|
|
352
|
+
e.className = "vue-header-renderer", e.style.display = "contents";
|
|
353
|
+
const n = u({
|
|
287
354
|
render() {
|
|
288
|
-
return
|
|
355
|
+
return t(r);
|
|
289
356
|
}
|
|
290
357
|
});
|
|
291
|
-
return
|
|
358
|
+
return n.mount(e), this.mountedViews.push({ app: n, container: e }), e;
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Creates a DOM-returning header label renderer from a Vue component class.
|
|
363
|
+
* Used for config-based headerLabelRenderer (not slot-based).
|
|
364
|
+
* @internal
|
|
365
|
+
*/
|
|
366
|
+
createConfigComponentHeaderLabelRenderer(t) {
|
|
367
|
+
return (r) => {
|
|
368
|
+
const e = document.createElement("div");
|
|
369
|
+
e.className = "vue-header-label-renderer", e.style.display = "contents";
|
|
370
|
+
const n = t, d = u({
|
|
371
|
+
render() {
|
|
372
|
+
return V(n, {
|
|
373
|
+
column: r.column,
|
|
374
|
+
value: r.value
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
return d.mount(e), this.mountedViews.push({ app: d, container: e }), e;
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Creates a DOM-returning header label renderer from a VNode-returning render function.
|
|
383
|
+
* Used for config-based headerLabelRenderer (not slot-based).
|
|
384
|
+
* @internal
|
|
385
|
+
*/
|
|
386
|
+
createConfigVNodeHeaderLabelRenderer(t) {
|
|
387
|
+
return (r) => {
|
|
388
|
+
const e = document.createElement("div");
|
|
389
|
+
e.className = "vue-header-label-renderer", e.style.display = "contents";
|
|
390
|
+
const n = u({
|
|
391
|
+
render() {
|
|
392
|
+
return t(r);
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
return n.mount(e), this.mountedViews.push({ app: n, container: e }), e;
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Creates a DOM-returning loading renderer from a Vue component class.
|
|
400
|
+
* @internal
|
|
401
|
+
*/
|
|
402
|
+
createComponentLoadingRenderer(t) {
|
|
403
|
+
return (r) => {
|
|
404
|
+
const e = document.createElement("div");
|
|
405
|
+
e.className = "vue-loading-renderer", e.style.display = "contents";
|
|
406
|
+
const n = t, d = u({
|
|
407
|
+
render() {
|
|
408
|
+
return V(n, { size: r.size });
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
return d.mount(e), this.mountedViews.push({ app: d, container: e }), e;
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Creates a DOM-returning loading renderer from a VNode-returning render function.
|
|
416
|
+
* @internal
|
|
417
|
+
*/
|
|
418
|
+
createVNodeLoadingRenderer(t) {
|
|
419
|
+
return (r) => {
|
|
420
|
+
const e = document.createElement("div");
|
|
421
|
+
e.className = "vue-loading-renderer", e.style.display = "contents";
|
|
422
|
+
const n = u({
|
|
423
|
+
render() {
|
|
424
|
+
return t(r);
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
return n.mount(e), this.mountedViews.push({ app: n, container: e }), e;
|
|
292
428
|
};
|
|
293
429
|
}
|
|
294
430
|
// #endregion
|
|
@@ -298,132 +434,132 @@ class fe {
|
|
|
298
434
|
*
|
|
299
435
|
* @internal
|
|
300
436
|
*/
|
|
301
|
-
setTypeDefaults(
|
|
302
|
-
this.typeDefaults =
|
|
437
|
+
setTypeDefaults(t) {
|
|
438
|
+
this.typeDefaults = t;
|
|
303
439
|
}
|
|
304
440
|
/**
|
|
305
441
|
* Determines if this adapter can handle the given element.
|
|
306
442
|
* Checks if a renderer or editor is registered for this element.
|
|
307
443
|
*/
|
|
308
|
-
canHandle(
|
|
309
|
-
const
|
|
310
|
-
let
|
|
311
|
-
if (!
|
|
312
|
-
const
|
|
313
|
-
|
|
444
|
+
canHandle(t) {
|
|
445
|
+
const r = t.getAttribute("field");
|
|
446
|
+
let e = w.get(t);
|
|
447
|
+
if (!e && r) {
|
|
448
|
+
const s = C.get(r);
|
|
449
|
+
s && (s.renderer || s.editor) && (e = s, w.set(t, e));
|
|
314
450
|
}
|
|
315
|
-
const
|
|
316
|
-
return
|
|
451
|
+
const n = e?.renderer !== void 0, d = e?.editor !== void 0;
|
|
452
|
+
return e !== void 0 && (n || d);
|
|
317
453
|
}
|
|
318
454
|
/**
|
|
319
455
|
* Creates a view renderer function that renders a Vue component
|
|
320
456
|
* and returns its container DOM element.
|
|
321
457
|
*/
|
|
322
|
-
createRenderer(
|
|
323
|
-
const
|
|
324
|
-
if (!
|
|
458
|
+
createRenderer(t) {
|
|
459
|
+
const r = ce(t);
|
|
460
|
+
if (!r)
|
|
325
461
|
return;
|
|
326
|
-
const
|
|
327
|
-
return (
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
330
|
-
const
|
|
331
|
-
if (
|
|
332
|
-
return
|
|
462
|
+
const e = /* @__PURE__ */ new WeakMap();
|
|
463
|
+
return (n) => {
|
|
464
|
+
const d = n.cellEl;
|
|
465
|
+
if (d) {
|
|
466
|
+
const l = e.get(d);
|
|
467
|
+
if (l)
|
|
468
|
+
return l.update(n), l.container;
|
|
333
469
|
const c = document.createElement("div");
|
|
334
470
|
c.className = "vue-cell-renderer", c.style.display = "contents";
|
|
335
|
-
let
|
|
336
|
-
const
|
|
471
|
+
let p = n;
|
|
472
|
+
const h = u({
|
|
337
473
|
render() {
|
|
338
|
-
return
|
|
474
|
+
return r(p);
|
|
339
475
|
}
|
|
340
476
|
});
|
|
341
|
-
return
|
|
342
|
-
app:
|
|
477
|
+
return h.mount(c), e.set(d, {
|
|
478
|
+
app: h,
|
|
343
479
|
container: c,
|
|
344
|
-
update: (
|
|
345
|
-
|
|
480
|
+
update: (b) => {
|
|
481
|
+
p = b, h._instance?.update();
|
|
346
482
|
}
|
|
347
483
|
}), c;
|
|
348
484
|
}
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
const
|
|
485
|
+
const s = document.createElement("div");
|
|
486
|
+
s.className = "vue-cell-renderer", s.style.display = "contents";
|
|
487
|
+
const a = u({
|
|
352
488
|
render() {
|
|
353
|
-
return
|
|
489
|
+
return r(n);
|
|
354
490
|
}
|
|
355
491
|
});
|
|
356
|
-
return
|
|
492
|
+
return a.mount(s), this.mountedViews.push({ app: a, container: s }), s;
|
|
357
493
|
};
|
|
358
494
|
}
|
|
359
495
|
/**
|
|
360
496
|
* Creates an editor spec that renders a Vue component for cell editing.
|
|
361
497
|
* Returns a function that creates the editor DOM element.
|
|
362
498
|
*/
|
|
363
|
-
createEditor(
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
366
|
-
return (
|
|
367
|
-
const
|
|
368
|
-
|
|
369
|
-
const
|
|
499
|
+
createEditor(t) {
|
|
500
|
+
const r = ue(t);
|
|
501
|
+
if (r)
|
|
502
|
+
return (e) => {
|
|
503
|
+
const n = document.createElement("div");
|
|
504
|
+
n.className = "vue-cell-editor", n.style.display = "contents";
|
|
505
|
+
const d = u({
|
|
370
506
|
render() {
|
|
371
|
-
return
|
|
507
|
+
return r(e);
|
|
372
508
|
}
|
|
373
509
|
});
|
|
374
|
-
return
|
|
510
|
+
return d.mount(n), this.editorViews.push({ app: d, container: n }), n;
|
|
375
511
|
};
|
|
376
512
|
}
|
|
377
513
|
/**
|
|
378
514
|
* Framework adapter hook called by MasterDetailPlugin during attach().
|
|
379
515
|
* Parses the <tbw-grid-detail> element and returns a Vue-based renderer.
|
|
380
516
|
*/
|
|
381
|
-
parseDetailElement(
|
|
382
|
-
const
|
|
383
|
-
if (!
|
|
384
|
-
const
|
|
385
|
-
if (!
|
|
386
|
-
const
|
|
387
|
-
if (
|
|
388
|
-
return (
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
-
const c =
|
|
517
|
+
parseDetailElement(t) {
|
|
518
|
+
const r = t.closest("tbw-grid");
|
|
519
|
+
if (!r) return;
|
|
520
|
+
const e = r.querySelector("tbw-grid-detail");
|
|
521
|
+
if (!e) return;
|
|
522
|
+
const n = Q.get(e);
|
|
523
|
+
if (n)
|
|
524
|
+
return (d, s) => {
|
|
525
|
+
const a = document.createElement("div");
|
|
526
|
+
a.className = "vue-detail-panel";
|
|
527
|
+
const c = n({ row: d, rowIndex: s });
|
|
392
528
|
if (c && c.length > 0) {
|
|
393
|
-
const
|
|
529
|
+
const p = u({
|
|
394
530
|
render() {
|
|
395
531
|
return c;
|
|
396
532
|
}
|
|
397
533
|
});
|
|
398
|
-
|
|
534
|
+
p.mount(a), this.mountedViews.push({ app: p, container: a });
|
|
399
535
|
}
|
|
400
|
-
return
|
|
536
|
+
return a;
|
|
401
537
|
};
|
|
402
538
|
}
|
|
403
539
|
/**
|
|
404
540
|
* Framework adapter hook called by ResponsivePlugin during attach().
|
|
405
541
|
* Parses the <tbw-grid-responsive-card> element and returns a Vue-based renderer.
|
|
406
542
|
*/
|
|
407
|
-
parseResponsiveCardElement(
|
|
408
|
-
const
|
|
409
|
-
if (!
|
|
410
|
-
const
|
|
411
|
-
if (!
|
|
412
|
-
const
|
|
413
|
-
if (
|
|
414
|
-
return (
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
const c =
|
|
543
|
+
parseResponsiveCardElement(t) {
|
|
544
|
+
const r = t.closest("tbw-grid");
|
|
545
|
+
if (!r) return;
|
|
546
|
+
const e = r.querySelector("tbw-grid-responsive-card");
|
|
547
|
+
if (!e) return;
|
|
548
|
+
const n = X.get(e);
|
|
549
|
+
if (n)
|
|
550
|
+
return (d, s) => {
|
|
551
|
+
const a = document.createElement("div");
|
|
552
|
+
a.className = "vue-responsive-card";
|
|
553
|
+
const c = n({ row: d, rowIndex: s });
|
|
418
554
|
if (c && c.length > 0) {
|
|
419
|
-
const
|
|
555
|
+
const p = u({
|
|
420
556
|
render() {
|
|
421
557
|
return c;
|
|
422
558
|
}
|
|
423
559
|
});
|
|
424
|
-
|
|
560
|
+
p.mount(a), this.mountedViews.push({ app: p, container: a });
|
|
425
561
|
}
|
|
426
|
-
return
|
|
562
|
+
return a;
|
|
427
563
|
};
|
|
428
564
|
}
|
|
429
565
|
// #region Type Defaults Support
|
|
@@ -455,47 +591,47 @@ class fe {
|
|
|
455
591
|
* </template>
|
|
456
592
|
* ```
|
|
457
593
|
*/
|
|
458
|
-
getTypeDefault(
|
|
594
|
+
getTypeDefault(t) {
|
|
459
595
|
if (!this.typeDefaults)
|
|
460
596
|
return;
|
|
461
|
-
const
|
|
462
|
-
if (!
|
|
597
|
+
const r = this.typeDefaults[t];
|
|
598
|
+
if (!r)
|
|
463
599
|
return;
|
|
464
|
-
const
|
|
465
|
-
editorParams:
|
|
600
|
+
const e = {
|
|
601
|
+
editorParams: r.editorParams
|
|
466
602
|
};
|
|
467
|
-
return
|
|
603
|
+
return r.renderer && (e.renderer = this.createTypeRenderer(r.renderer)), r.editor && (e.editor = this.createTypeEditor(r.editor)), r.filterPanelRenderer && (e.filterPanelRenderer = this.createFilterPanelRenderer(r.filterPanelRenderer)), e;
|
|
468
604
|
}
|
|
469
605
|
/**
|
|
470
606
|
* Creates a renderer function from a Vue render function for type defaults.
|
|
471
607
|
* @internal
|
|
472
608
|
*/
|
|
473
|
-
createTypeRenderer(
|
|
474
|
-
return (
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
const
|
|
609
|
+
createTypeRenderer(t) {
|
|
610
|
+
return (r) => {
|
|
611
|
+
const e = document.createElement("span");
|
|
612
|
+
e.style.display = "contents";
|
|
613
|
+
const n = u({
|
|
478
614
|
render() {
|
|
479
|
-
return
|
|
615
|
+
return t(r);
|
|
480
616
|
}
|
|
481
617
|
});
|
|
482
|
-
return
|
|
618
|
+
return n.mount(e), this.mountedViews.push({ app: n, container: e }), e;
|
|
483
619
|
};
|
|
484
620
|
}
|
|
485
621
|
/**
|
|
486
622
|
* Creates an editor function from a Vue render function for type defaults.
|
|
487
623
|
* @internal
|
|
488
624
|
*/
|
|
489
|
-
createTypeEditor(
|
|
490
|
-
return (
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
const
|
|
625
|
+
createTypeEditor(t) {
|
|
626
|
+
return (r) => {
|
|
627
|
+
const e = document.createElement("span");
|
|
628
|
+
e.style.display = "contents";
|
|
629
|
+
const n = u({
|
|
494
630
|
render() {
|
|
495
|
-
return
|
|
631
|
+
return t(r);
|
|
496
632
|
}
|
|
497
633
|
});
|
|
498
|
-
return
|
|
634
|
+
return n.mount(e), this.editorViews.push({ app: n, container: e }), e;
|
|
499
635
|
};
|
|
500
636
|
}
|
|
501
637
|
/**
|
|
@@ -505,16 +641,16 @@ class fe {
|
|
|
505
641
|
* imperative `(container, params) => void` signature expected by the core grid.
|
|
506
642
|
* @internal
|
|
507
643
|
*/
|
|
508
|
-
createFilterPanelRenderer(
|
|
509
|
-
return (
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
const
|
|
644
|
+
createFilterPanelRenderer(t) {
|
|
645
|
+
return (r, e) => {
|
|
646
|
+
const n = document.createElement("div");
|
|
647
|
+
n.style.display = "contents";
|
|
648
|
+
const d = u({
|
|
513
649
|
render() {
|
|
514
|
-
return e
|
|
650
|
+
return t(e);
|
|
515
651
|
}
|
|
516
652
|
});
|
|
517
|
-
|
|
653
|
+
d.mount(n), this.mountedViews.push({ app: d, container: n }), r.appendChild(n);
|
|
518
654
|
};
|
|
519
655
|
}
|
|
520
656
|
// #endregion
|
|
@@ -522,15 +658,15 @@ class fe {
|
|
|
522
658
|
* Cleanup all mounted Vue apps.
|
|
523
659
|
*/
|
|
524
660
|
cleanup() {
|
|
525
|
-
for (const { app:
|
|
661
|
+
for (const { app: t, container: r } of this.mountedViews)
|
|
526
662
|
try {
|
|
527
|
-
|
|
663
|
+
t.unmount(), r.remove();
|
|
528
664
|
} catch {
|
|
529
665
|
}
|
|
530
666
|
this.mountedViews = [];
|
|
531
|
-
for (const { app:
|
|
667
|
+
for (const { app: t, container: r } of this.editorViews)
|
|
532
668
|
try {
|
|
533
|
-
|
|
669
|
+
t.unmount(), r.remove();
|
|
534
670
|
} catch {
|
|
535
671
|
}
|
|
536
672
|
this.editorViews = [];
|
|
@@ -540,15 +676,15 @@ class fe {
|
|
|
540
676
|
* Finds the matching entry in mountedViews by container reference
|
|
541
677
|
* and properly destroys the Vue app to prevent memory leaks.
|
|
542
678
|
*/
|
|
543
|
-
unmount(
|
|
544
|
-
for (let
|
|
545
|
-
const
|
|
546
|
-
if (
|
|
679
|
+
unmount(t) {
|
|
680
|
+
for (let r = this.mountedViews.length - 1; r >= 0; r--) {
|
|
681
|
+
const e = this.mountedViews[r];
|
|
682
|
+
if (e.container === t || t.contains(e.container)) {
|
|
547
683
|
try {
|
|
548
|
-
|
|
684
|
+
e.app.unmount();
|
|
549
685
|
} catch {
|
|
550
686
|
}
|
|
551
|
-
this.mountedViews.splice(
|
|
687
|
+
this.mountedViews.splice(r, 1);
|
|
552
688
|
return;
|
|
553
689
|
}
|
|
554
690
|
}
|
|
@@ -557,20 +693,20 @@ class fe {
|
|
|
557
693
|
* Called when a cell's content is about to be wiped.
|
|
558
694
|
* Destroys editor Vue apps whose container is inside the cell.
|
|
559
695
|
*/
|
|
560
|
-
releaseCell(
|
|
561
|
-
for (let
|
|
562
|
-
const { app:
|
|
563
|
-
if (
|
|
696
|
+
releaseCell(t) {
|
|
697
|
+
for (let r = this.editorViews.length - 1; r >= 0; r--) {
|
|
698
|
+
const { app: e, container: n } = this.editorViews[r];
|
|
699
|
+
if (t.contains(n)) {
|
|
564
700
|
try {
|
|
565
|
-
|
|
701
|
+
e.unmount(), n.remove();
|
|
566
702
|
} catch {
|
|
567
703
|
}
|
|
568
|
-
this.editorViews.splice(
|
|
704
|
+
this.editorViews.splice(r, 1);
|
|
569
705
|
}
|
|
570
706
|
}
|
|
571
707
|
}
|
|
572
708
|
}
|
|
573
|
-
const
|
|
709
|
+
const fe = pe, Ee = /* @__PURE__ */ y({
|
|
574
710
|
__name: "TbwGrid",
|
|
575
711
|
props: {
|
|
576
712
|
/** Row data to display */
|
|
@@ -632,6 +768,11 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
632
768
|
default: void 0
|
|
633
769
|
},
|
|
634
770
|
/** Enable column drag-to-reorder */
|
|
771
|
+
reorderColumns: {
|
|
772
|
+
type: [Boolean, Object],
|
|
773
|
+
default: void 0
|
|
774
|
+
},
|
|
775
|
+
/** @deprecated Use `reorderColumns` instead */
|
|
635
776
|
reorder: {
|
|
636
777
|
type: [Boolean, Object],
|
|
637
778
|
default: void 0
|
|
@@ -657,6 +798,11 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
657
798
|
default: void 0
|
|
658
799
|
},
|
|
659
800
|
/** Enable row drag-to-reorder */
|
|
801
|
+
reorderRows: {
|
|
802
|
+
type: [Boolean, Object],
|
|
803
|
+
default: void 0
|
|
804
|
+
},
|
|
805
|
+
/** @deprecated Use `reorderRows` instead */
|
|
660
806
|
rowReorder: {
|
|
661
807
|
type: [Boolean, Object],
|
|
662
808
|
default: void 0
|
|
@@ -713,15 +859,15 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
713
859
|
}
|
|
714
860
|
},
|
|
715
861
|
emits: ["cell-commit", "row-commit", "cell-click", "cell-dblclick", "selection-change", "row-toggle", "sort-change", "ready"],
|
|
716
|
-
setup(i, { expose:
|
|
717
|
-
let
|
|
718
|
-
function
|
|
719
|
-
return
|
|
862
|
+
setup(i, { expose: t, emit: r }) {
|
|
863
|
+
let e = !1, n = null;
|
|
864
|
+
function d() {
|
|
865
|
+
return e || (n = new fe(), ne.registerAdapter(n), e = !0), n;
|
|
720
866
|
}
|
|
721
|
-
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
const c = J(),
|
|
867
|
+
d();
|
|
868
|
+
const s = i, a = r, l = O(null);
|
|
869
|
+
N(U, l);
|
|
870
|
+
const c = J(), p = ie(), h = [
|
|
725
871
|
"selection",
|
|
726
872
|
"editing",
|
|
727
873
|
"clipboard",
|
|
@@ -729,12 +875,16 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
729
875
|
"multiSort",
|
|
730
876
|
"sorting",
|
|
731
877
|
"filtering",
|
|
878
|
+
"reorderColumns",
|
|
732
879
|
"reorder",
|
|
880
|
+
// deprecated alias for reorderColumns
|
|
733
881
|
"visibility",
|
|
734
882
|
"pinnedColumns",
|
|
735
883
|
"groupingColumns",
|
|
736
884
|
"columnVirtualization",
|
|
885
|
+
"reorderRows",
|
|
737
886
|
"rowReorder",
|
|
887
|
+
// deprecated alias for reorderRows
|
|
738
888
|
"groupingRows",
|
|
739
889
|
"pinnedRows",
|
|
740
890
|
"tree",
|
|
@@ -746,60 +896,60 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
746
896
|
"pivot",
|
|
747
897
|
"serverSide"
|
|
748
898
|
];
|
|
749
|
-
function
|
|
899
|
+
function b() {
|
|
750
900
|
const o = [];
|
|
751
|
-
for (const
|
|
752
|
-
const
|
|
753
|
-
if (
|
|
754
|
-
const
|
|
755
|
-
|
|
901
|
+
for (const f of h) {
|
|
902
|
+
const E = s[f];
|
|
903
|
+
if (E !== void 0) {
|
|
904
|
+
const g = oe(f, E);
|
|
905
|
+
g && o.push(g);
|
|
756
906
|
}
|
|
757
907
|
}
|
|
758
908
|
return o;
|
|
759
909
|
}
|
|
760
|
-
const
|
|
761
|
-
const o =
|
|
910
|
+
const _ = re(() => {
|
|
911
|
+
const o = s.gridConfig ?? {}, f = b(), E = o.plugins ?? [], g = [...f, ...E], D = p ? { ...o.icons, ...p } : o.icons;
|
|
762
912
|
return {
|
|
763
913
|
...o,
|
|
764
|
-
...
|
|
765
|
-
...
|
|
766
|
-
...
|
|
914
|
+
...s.columns ? { columns: s.columns } : {},
|
|
915
|
+
...g.length > 0 ? { plugins: g } : {},
|
|
916
|
+
...D ? { icons: D } : {}
|
|
767
917
|
};
|
|
768
918
|
});
|
|
769
|
-
function
|
|
770
|
-
|
|
771
|
-
}
|
|
772
|
-
function N(o) {
|
|
773
|
-
l("row-commit", o);
|
|
919
|
+
function F(o) {
|
|
920
|
+
a("cell-commit", o);
|
|
774
921
|
}
|
|
775
922
|
function A(o) {
|
|
776
|
-
|
|
923
|
+
a("row-commit", o);
|
|
924
|
+
}
|
|
925
|
+
function M(o) {
|
|
926
|
+
a("cell-click", o);
|
|
777
927
|
}
|
|
778
928
|
function W(o) {
|
|
779
|
-
|
|
929
|
+
a("cell-dblclick", o);
|
|
780
930
|
}
|
|
781
931
|
function I(o) {
|
|
782
|
-
|
|
932
|
+
a("selection-change", o);
|
|
783
933
|
}
|
|
784
|
-
function
|
|
785
|
-
|
|
934
|
+
function H(o) {
|
|
935
|
+
a("row-toggle", o);
|
|
786
936
|
}
|
|
787
937
|
function $(o) {
|
|
788
|
-
|
|
938
|
+
a("sort-change", o);
|
|
789
939
|
}
|
|
790
940
|
function z(o) {
|
|
791
|
-
|
|
941
|
+
a("ready", o);
|
|
792
942
|
}
|
|
793
|
-
function Z(o,
|
|
794
|
-
const
|
|
795
|
-
if (!
|
|
796
|
-
const
|
|
943
|
+
function Z(o, f) {
|
|
944
|
+
const E = Object.getPrototypeOf(o), g = Object.getOwnPropertyDescriptor(E, "gridConfig");
|
|
945
|
+
if (!g?.set || !g?.get) return;
|
|
946
|
+
const D = g.set, te = g.get;
|
|
797
947
|
Object.defineProperty(o, "gridConfig", {
|
|
798
948
|
get() {
|
|
799
949
|
return te.call(this);
|
|
800
950
|
},
|
|
801
951
|
set(S) {
|
|
802
|
-
S &&
|
|
952
|
+
S && f ? D.call(this, f.processGridConfig(S)) : D.call(this, S);
|
|
803
953
|
},
|
|
804
954
|
configurable: !0
|
|
805
955
|
});
|
|
@@ -807,54 +957,54 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
807
957
|
function ee(o) {
|
|
808
958
|
delete o.gridConfig;
|
|
809
959
|
}
|
|
810
|
-
return
|
|
811
|
-
const o =
|
|
960
|
+
return P(() => {
|
|
961
|
+
const o = l.value;
|
|
812
962
|
if (!o) return;
|
|
813
|
-
const
|
|
814
|
-
o.__frameworkAdapter =
|
|
963
|
+
const f = d();
|
|
964
|
+
o.__frameworkAdapter = f, f.setTypeDefaults(c ?? null), Z(o, f), o.addEventListener("cell-commit", F), o.addEventListener("row-commit", A), o.addEventListener("cell-click", M), o.addEventListener("cell-dblclick", W), o.addEventListener("selection-change", I), o.addEventListener("row-toggle", H), o.addEventListener("sort-change", $), o.addEventListener("ready", z), s.rows.length > 0 && (o.rows = s.rows), _.value && (o.gridConfig = _.value), s.fitMode && (o.fitMode = s.fitMode);
|
|
815
965
|
}), q(() => {
|
|
816
|
-
const o =
|
|
817
|
-
o && (ee(o), o.removeEventListener("cell-commit",
|
|
966
|
+
const o = l.value;
|
|
967
|
+
o && (ee(o), o.removeEventListener("cell-commit", F), o.removeEventListener("row-commit", A), o.removeEventListener("cell-click", M), o.removeEventListener("cell-dblclick", W), o.removeEventListener("selection-change", I), o.removeEventListener("row-toggle", H), o.removeEventListener("sort-change", $), o.removeEventListener("ready", z));
|
|
818
968
|
}), G(
|
|
819
|
-
() =>
|
|
969
|
+
() => s.rows,
|
|
820
970
|
(o) => {
|
|
821
|
-
|
|
971
|
+
l.value && (l.value.rows = o);
|
|
822
972
|
},
|
|
823
973
|
{ deep: !0 }
|
|
824
974
|
), G(
|
|
825
|
-
|
|
975
|
+
_,
|
|
826
976
|
(o) => {
|
|
827
|
-
|
|
977
|
+
l.value && o && (l.value.gridConfig = o);
|
|
828
978
|
},
|
|
829
979
|
{ deep: !0 }
|
|
830
980
|
), G(
|
|
831
|
-
() =>
|
|
981
|
+
() => s.fitMode,
|
|
832
982
|
(o) => {
|
|
833
|
-
|
|
983
|
+
l.value && o && (l.value.fitMode = o);
|
|
834
984
|
}
|
|
835
985
|
), G(
|
|
836
986
|
() => c,
|
|
837
987
|
(o) => {
|
|
838
|
-
|
|
988
|
+
d().setTypeDefaults(o ?? null);
|
|
839
989
|
},
|
|
840
990
|
{ deep: !0 }
|
|
841
|
-
),
|
|
991
|
+
), t({
|
|
842
992
|
/** The underlying grid element */
|
|
843
|
-
gridElement:
|
|
993
|
+
gridElement: l,
|
|
844
994
|
/** Force a layout recalculation */
|
|
845
|
-
forceLayout: () =>
|
|
995
|
+
forceLayout: () => l.value?.forceLayout(),
|
|
846
996
|
/** Get current grid configuration */
|
|
847
|
-
getConfig: () =>
|
|
997
|
+
getConfig: () => l.value?.getConfig(),
|
|
848
998
|
/** Wait for grid to be ready */
|
|
849
|
-
ready: () =>
|
|
850
|
-
}), (o,
|
|
999
|
+
ready: () => l.value?.ready()
|
|
1000
|
+
}), (o, f) => (j(), T("tbw-grid", {
|
|
851
1001
|
ref_key: "gridRef",
|
|
852
|
-
ref:
|
|
1002
|
+
ref: l
|
|
853
1003
|
}, [
|
|
854
|
-
|
|
1004
|
+
x(o.$slots, "default")
|
|
855
1005
|
], 512));
|
|
856
1006
|
}
|
|
857
|
-
}), me = ["field", "header", "width", "min-width", "max-width", "sortable", "resizable", "editable", "type", "align", "hidden"],
|
|
1007
|
+
}), me = ["field", "header", "width", "min-width", "max-width", "sortable", "resizable", "editable", "type", "align", "hidden"], Ve = /* @__PURE__ */ y({
|
|
858
1008
|
__name: "TbwGridColumn",
|
|
859
1009
|
props: {
|
|
860
1010
|
field: {},
|
|
@@ -870,39 +1020,39 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
870
1020
|
hidden: { type: Boolean }
|
|
871
1021
|
},
|
|
872
1022
|
setup(i) {
|
|
873
|
-
const
|
|
874
|
-
return
|
|
875
|
-
const
|
|
876
|
-
if (!
|
|
877
|
-
const
|
|
878
|
-
|
|
879
|
-
const
|
|
880
|
-
if (!
|
|
881
|
-
const
|
|
882
|
-
value:
|
|
883
|
-
row:
|
|
884
|
-
column:
|
|
1023
|
+
const t = B(), r = O(null);
|
|
1024
|
+
return P(() => {
|
|
1025
|
+
const e = r.value;
|
|
1026
|
+
if (!e) return;
|
|
1027
|
+
const n = !!t.cell, d = !!t.editor;
|
|
1028
|
+
n && ae(e, (s) => {
|
|
1029
|
+
const a = t.cell;
|
|
1030
|
+
if (!a) return L("span");
|
|
1031
|
+
const l = a({
|
|
1032
|
+
value: s.value,
|
|
1033
|
+
row: s.row,
|
|
1034
|
+
column: s.column
|
|
885
1035
|
});
|
|
886
|
-
return
|
|
887
|
-
}),
|
|
888
|
-
const
|
|
889
|
-
if (!
|
|
890
|
-
const
|
|
891
|
-
value:
|
|
892
|
-
row:
|
|
893
|
-
column:
|
|
894
|
-
field:
|
|
895
|
-
rowId:
|
|
896
|
-
commit:
|
|
897
|
-
cancel:
|
|
898
|
-
updateRow:
|
|
899
|
-
onValueChange:
|
|
1036
|
+
return L("div", { style: "display: contents" }, l);
|
|
1037
|
+
}), d && le(e, (s) => {
|
|
1038
|
+
const a = t.editor;
|
|
1039
|
+
if (!a) return L("span");
|
|
1040
|
+
const l = a({
|
|
1041
|
+
value: s.value,
|
|
1042
|
+
row: s.row,
|
|
1043
|
+
column: s.column,
|
|
1044
|
+
field: s.field,
|
|
1045
|
+
rowId: s.rowId ?? "",
|
|
1046
|
+
commit: s.commit,
|
|
1047
|
+
cancel: s.cancel,
|
|
1048
|
+
updateRow: s.updateRow,
|
|
1049
|
+
onValueChange: s.onValueChange
|
|
900
1050
|
});
|
|
901
|
-
return
|
|
1051
|
+
return L("div", { style: "display: contents" }, l);
|
|
902
1052
|
});
|
|
903
|
-
}), (
|
|
1053
|
+
}), (e, n) => (j(), T("tbw-grid-column", {
|
|
904
1054
|
ref_key: "columnRef",
|
|
905
|
-
ref:
|
|
1055
|
+
ref: r,
|
|
906
1056
|
field: i.field,
|
|
907
1057
|
header: i.header,
|
|
908
1058
|
width: i.width,
|
|
@@ -916,44 +1066,44 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
916
1066
|
hidden: i.hidden
|
|
917
1067
|
}, null, 8, me));
|
|
918
1068
|
}
|
|
919
|
-
}), ge = ["show-expand-column", "animation"],
|
|
1069
|
+
}), ge = ["show-expand-column", "animation"], Le = /* @__PURE__ */ y({
|
|
920
1070
|
__name: "TbwGridDetailPanel",
|
|
921
1071
|
props: {
|
|
922
1072
|
showExpandColumn: { type: Boolean, default: !0 },
|
|
923
1073
|
animation: { type: [String, Boolean], default: "slide" }
|
|
924
1074
|
},
|
|
925
1075
|
setup(i) {
|
|
926
|
-
const
|
|
927
|
-
return
|
|
928
|
-
const
|
|
929
|
-
!
|
|
930
|
-
}), (
|
|
1076
|
+
const t = O(null), r = B();
|
|
1077
|
+
return P(() => {
|
|
1078
|
+
const e = t.value;
|
|
1079
|
+
!e || !r.default || Q.set(e, (n) => r.default?.(n));
|
|
1080
|
+
}), (e, n) => (j(), T("tbw-grid-detail", {
|
|
931
1081
|
ref_key: "detailRef",
|
|
932
|
-
ref:
|
|
1082
|
+
ref: t,
|
|
933
1083
|
"show-expand-column": i.showExpandColumn,
|
|
934
1084
|
animation: i.animation
|
|
935
1085
|
}, null, 8, ge));
|
|
936
1086
|
}
|
|
937
|
-
}),
|
|
1087
|
+
}), Oe = /* @__PURE__ */ y({
|
|
938
1088
|
__name: "TbwGridResponsiveCard",
|
|
939
1089
|
setup(i) {
|
|
940
|
-
const
|
|
941
|
-
return
|
|
942
|
-
const
|
|
943
|
-
!
|
|
944
|
-
}), (
|
|
1090
|
+
const t = O(null), r = B();
|
|
1091
|
+
return P(() => {
|
|
1092
|
+
const e = t.value;
|
|
1093
|
+
!e || !r.default || X.set(e, (n) => r.default?.(n));
|
|
1094
|
+
}), (e, n) => (j(), T("tbw-grid-responsive-card", {
|
|
945
1095
|
ref_key: "cardRef",
|
|
946
|
-
ref:
|
|
1096
|
+
ref: t
|
|
947
1097
|
}, null, 512));
|
|
948
1098
|
}
|
|
949
|
-
}),
|
|
1099
|
+
}), Pe = /* @__PURE__ */ y({
|
|
950
1100
|
__name: "TbwGridToolButtons",
|
|
951
1101
|
setup(i) {
|
|
952
|
-
return (
|
|
953
|
-
|
|
1102
|
+
return (t, r) => (j(), T("tbw-grid-tool-buttons", null, [
|
|
1103
|
+
x(t.$slots, "default")
|
|
954
1104
|
]));
|
|
955
1105
|
}
|
|
956
|
-
}),
|
|
1106
|
+
}), he = /* @__PURE__ */ new WeakMap(), ye = ["id", "label", "icon", "position", "width"], Te = /* @__PURE__ */ y({
|
|
957
1107
|
__name: "TbwGridToolPanel",
|
|
958
1108
|
props: {
|
|
959
1109
|
id: {},
|
|
@@ -963,34 +1113,34 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
963
1113
|
width: { default: "250px" }
|
|
964
1114
|
},
|
|
965
1115
|
setup(i) {
|
|
966
|
-
const
|
|
967
|
-
return
|
|
968
|
-
const
|
|
969
|
-
!
|
|
970
|
-
}), (
|
|
1116
|
+
const t = O(null), r = B();
|
|
1117
|
+
return P(() => {
|
|
1118
|
+
const e = t.value;
|
|
1119
|
+
!e || !r.default || he.set(e, (n) => r.default?.(n));
|
|
1120
|
+
}), (e, n) => (j(), T("tbw-grid-tool-panel", {
|
|
971
1121
|
ref_key: "panelRef",
|
|
972
|
-
ref:
|
|
1122
|
+
ref: t,
|
|
973
1123
|
id: i.id,
|
|
974
1124
|
label: i.label,
|
|
975
1125
|
icon: i.icon,
|
|
976
1126
|
position: i.position,
|
|
977
1127
|
width: i.width
|
|
978
|
-
}, null, 8,
|
|
1128
|
+
}, null, 8, ye));
|
|
979
1129
|
}
|
|
980
1130
|
});
|
|
981
|
-
function
|
|
982
|
-
const
|
|
983
|
-
let
|
|
984
|
-
|
|
985
|
-
const
|
|
986
|
-
if (!
|
|
987
|
-
const
|
|
988
|
-
|
|
1131
|
+
function je(i, t, r) {
|
|
1132
|
+
const e = r ?? k(U, O(null));
|
|
1133
|
+
let n = null;
|
|
1134
|
+
P(() => {
|
|
1135
|
+
const d = e.value;
|
|
1136
|
+
if (!d) return;
|
|
1137
|
+
const s = t;
|
|
1138
|
+
d.addEventListener(i, s), n = () => d.removeEventListener(i, s);
|
|
989
1139
|
}), q(() => {
|
|
990
|
-
|
|
1140
|
+
n?.();
|
|
991
1141
|
});
|
|
992
1142
|
}
|
|
993
|
-
const
|
|
1143
|
+
const _e = y({
|
|
994
1144
|
name: "GridProvider",
|
|
995
1145
|
props: {
|
|
996
1146
|
/**
|
|
@@ -1008,37 +1158,37 @@ const Ge = y({
|
|
|
1008
1158
|
default: void 0
|
|
1009
1159
|
}
|
|
1010
1160
|
},
|
|
1011
|
-
setup(i, { slots:
|
|
1161
|
+
setup(i, { slots: t }) {
|
|
1012
1162
|
return () => {
|
|
1013
|
-
let
|
|
1014
|
-
return i.typeDefaults && (
|
|
1163
|
+
let r = t.default?.();
|
|
1164
|
+
return i.typeDefaults && (r = L(se, { defaults: i.typeDefaults }, () => r)), i.icons && (r = L(de, { icons: i.icons }, () => r)), r;
|
|
1015
1165
|
};
|
|
1016
1166
|
}
|
|
1017
1167
|
});
|
|
1018
1168
|
export {
|
|
1019
|
-
|
|
1169
|
+
U as GRID_ELEMENT_KEY,
|
|
1020
1170
|
K as GRID_ICONS,
|
|
1021
1171
|
Y as GRID_TYPE_DEFAULTS,
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1172
|
+
pe as GridAdapter,
|
|
1173
|
+
de as GridIconProvider,
|
|
1174
|
+
_e as GridProvider,
|
|
1175
|
+
se as GridTypeProvider,
|
|
1176
|
+
Ee as TbwGrid,
|
|
1177
|
+
Ve as TbwGridColumn,
|
|
1178
|
+
Le as TbwGridDetailPanel,
|
|
1179
|
+
Oe as TbwGridResponsiveCard,
|
|
1180
|
+
Pe as TbwGridToolButtons,
|
|
1181
|
+
Te as TbwGridToolPanel,
|
|
1182
|
+
fe as VueGridAdapter,
|
|
1183
|
+
Be as clearFeatureRegistry,
|
|
1184
|
+
Se as createPluginFromFeature,
|
|
1185
|
+
Ne as getFeatureFactory,
|
|
1186
|
+
ke as getRegisteredFeatures,
|
|
1037
1187
|
Fe as isFeatureRegistered,
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1188
|
+
v as isVueComponent,
|
|
1189
|
+
Ae as registerFeature,
|
|
1190
|
+
We as useGrid,
|
|
1191
|
+
je as useGridEvent,
|
|
1042
1192
|
ie as useGridIcons,
|
|
1043
1193
|
J as useGridTypeDefaults,
|
|
1044
1194
|
Ce as useTypeDefault
|