@toolbox-web/grid-vue 0.3.1 → 0.4.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/filtering.d.ts.map +1 -1
- package/features/filtering.js +42 -24
- package/features/filtering.js.map +1 -1
- package/index.js +173 -150
- package/index.js.map +1 -1
- package/lib/TbwGrid.vue.d.ts.map +1 -1
- package/lib/TbwGridColumn.vue.d.ts.map +1 -1
- package/lib/feature-props.d.ts +19 -1
- package/lib/feature-props.d.ts.map +1 -1
- package/lib/grid-type-registry.d.ts +23 -0
- package/lib/grid-type-registry.d.ts.map +1 -1
- package/lib/slot-types.d.ts +14 -0
- package/lib/slot-types.d.ts.map +1 -1
- package/lib/vue-grid-adapter.d.ts +9 -0
- package/lib/vue-grid-adapter.d.ts.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as y, provide as L, inject as
|
|
1
|
+
import { defineComponent as y, provide as L, inject as F, createApp as f, createVNode as k, ref as R, computed as ne, onMounted as T, onBeforeUnmount as q, watch as j, createElementBlock as O, openBlock as P, renderSlot as U, useSlots as S, h as C } from "vue";
|
|
2
2
|
import { DataGridElement as re } from "@toolbox-web/grid";
|
|
3
3
|
import { c as oe } from "./chunks/feature-registry-BgEOysSJ.js";
|
|
4
|
-
import { a as
|
|
4
|
+
import { a as Ve, g as ke, b as Le, i as Fe, r as Me } from "./chunks/feature-registry-BgEOysSJ.js";
|
|
5
5
|
import { G as H } from "./chunks/use-grid-DwjXrO19.js";
|
|
6
|
-
import { u as
|
|
6
|
+
import { u as Ae } from "./chunks/use-grid-DwjXrO19.js";
|
|
7
7
|
const K = /* @__PURE__ */ Symbol("grid-icons");
|
|
8
8
|
function ie() {
|
|
9
|
-
return
|
|
9
|
+
return F(K, void 0);
|
|
10
10
|
}
|
|
11
11
|
const se = y({
|
|
12
12
|
name: "GridIconProvider",
|
|
@@ -24,7 +24,7 @@ const se = y({
|
|
|
24
24
|
}
|
|
25
25
|
}), Y = /* @__PURE__ */ Symbol("grid-type-defaults");
|
|
26
26
|
function J() {
|
|
27
|
-
return
|
|
27
|
+
return F(Y, void 0);
|
|
28
28
|
}
|
|
29
29
|
function Ce(i) {
|
|
30
30
|
return J()?.[i];
|
|
@@ -43,26 +43,26 @@ const de = y({
|
|
|
43
43
|
setup(i, { slots: e }) {
|
|
44
44
|
return L(Y, i.defaults), () => e.default?.();
|
|
45
45
|
}
|
|
46
|
-
}), Q = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(),
|
|
46
|
+
}), Q = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new Map();
|
|
47
47
|
function le(i, e) {
|
|
48
48
|
const n = i.getAttribute("field"), t = v.get(i) ?? {};
|
|
49
49
|
if (t.renderer = e, v.set(i, t), n) {
|
|
50
|
-
const r =
|
|
51
|
-
r.renderer = e,
|
|
50
|
+
const r = w.get(n) ?? {};
|
|
51
|
+
r.renderer = e, w.set(n, r);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function ae(i, e) {
|
|
55
55
|
const n = i.getAttribute("field"), t = v.get(i) ?? {};
|
|
56
56
|
if (t.editor = e, v.set(i, t), n) {
|
|
57
|
-
const r =
|
|
58
|
-
r.editor = e,
|
|
57
|
+
const r = w.get(n) ?? {};
|
|
58
|
+
r.editor = e, w.set(n, r);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function ce(i) {
|
|
62
62
|
let e = v.get(i)?.renderer;
|
|
63
63
|
if (!e) {
|
|
64
64
|
const n = i.getAttribute("field");
|
|
65
|
-
n && (e =
|
|
65
|
+
n && (e = w.get(n)?.renderer);
|
|
66
66
|
}
|
|
67
67
|
return e;
|
|
68
68
|
}
|
|
@@ -70,11 +70,11 @@ function ue(i) {
|
|
|
70
70
|
let e = v.get(i)?.editor;
|
|
71
71
|
if (!e) {
|
|
72
72
|
const n = i.getAttribute("field");
|
|
73
|
-
n && (e =
|
|
73
|
+
n && (e = w.get(n)?.editor);
|
|
74
74
|
}
|
|
75
75
|
return e;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function G(i) {
|
|
78
78
|
if (i == null || typeof i == "function" && i.prototype === void 0)
|
|
79
79
|
return !1;
|
|
80
80
|
if (typeof i == "object") {
|
|
@@ -89,8 +89,8 @@ function j(i) {
|
|
|
89
89
|
}
|
|
90
90
|
return !1;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return typeof i == "function" && !
|
|
92
|
+
function B(i) {
|
|
93
|
+
return typeof i == "function" && !G(i);
|
|
94
94
|
}
|
|
95
95
|
const E = /* @__PURE__ */ Symbol.for("tbw:vue-processed");
|
|
96
96
|
class fe {
|
|
@@ -138,13 +138,13 @@ class fe {
|
|
|
138
138
|
const s = {
|
|
139
139
|
editorParams: r.editorParams
|
|
140
140
|
};
|
|
141
|
-
r.renderer && (
|
|
141
|
+
r.renderer && (G(r.renderer) ? s.renderer = this.createConfigComponentRenderer(r.renderer) : B(r.renderer) && (s.renderer = this.createTypeRenderer(
|
|
142
142
|
r.renderer
|
|
143
|
-
))), r.editor && (
|
|
143
|
+
))), r.editor && (G(r.editor) ? s.editor = this.createConfigComponentEditor(
|
|
144
144
|
r.editor
|
|
145
|
-
) :
|
|
145
|
+
) : B(r.editor) && (s.editor = this.createTypeEditor(
|
|
146
146
|
r.editor
|
|
147
|
-
))), n[t] = s;
|
|
147
|
+
))), r.filterPanelRenderer && (s.filterPanelRenderer = this.createFilterPanelRenderer(r.filterPanelRenderer)), n[t] = s;
|
|
148
148
|
}
|
|
149
149
|
return n;
|
|
150
150
|
}
|
|
@@ -158,19 +158,19 @@ class fe {
|
|
|
158
158
|
processColumn(e) {
|
|
159
159
|
const n = { ...e };
|
|
160
160
|
if (e.renderer && !e.renderer[E]) {
|
|
161
|
-
if (
|
|
161
|
+
if (G(e.renderer)) {
|
|
162
162
|
const t = this.createConfigComponentRenderer(e.renderer);
|
|
163
163
|
t[E] = !0, n.renderer = t;
|
|
164
|
-
} else if (
|
|
164
|
+
} else if (B(e.renderer)) {
|
|
165
165
|
const t = this.createConfigVNodeRenderer(e.renderer);
|
|
166
166
|
t[E] = !0, n.renderer = t;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
if (e.editor && !e.editor[E]) {
|
|
170
|
-
if (
|
|
170
|
+
if (G(e.editor)) {
|
|
171
171
|
const t = this.createConfigComponentEditor(e.editor);
|
|
172
172
|
t[E] = !0, n.editor = t;
|
|
173
|
-
} else if (
|
|
173
|
+
} else if (B(e.editor)) {
|
|
174
174
|
const t = this.createConfigVNodeEditor(e.editor);
|
|
175
175
|
t[E] = !0, n.editor = t;
|
|
176
176
|
}
|
|
@@ -187,30 +187,30 @@ class fe {
|
|
|
187
187
|
return (t) => {
|
|
188
188
|
const r = t.cellEl;
|
|
189
189
|
if (r) {
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
192
|
-
return
|
|
193
|
-
const
|
|
194
|
-
|
|
190
|
+
const a = n.get(r);
|
|
191
|
+
if (a)
|
|
192
|
+
return a.update(t), a.container;
|
|
193
|
+
const c = document.createElement("div");
|
|
194
|
+
c.className = "vue-cell-renderer", c.style.display = "contents";
|
|
195
195
|
let u = t;
|
|
196
|
-
const g = e, h =
|
|
196
|
+
const g = e, h = f({
|
|
197
197
|
render() {
|
|
198
|
-
return
|
|
198
|
+
return k(g, { ...u });
|
|
199
199
|
}
|
|
200
200
|
});
|
|
201
|
-
return h.mount(
|
|
201
|
+
return h.mount(c), n.set(r, {
|
|
202
202
|
app: h,
|
|
203
|
-
container:
|
|
204
|
-
update: (
|
|
205
|
-
u =
|
|
203
|
+
container: c,
|
|
204
|
+
update: (_) => {
|
|
205
|
+
u = _, h._instance?.update();
|
|
206
206
|
}
|
|
207
|
-
}),
|
|
207
|
+
}), c;
|
|
208
208
|
}
|
|
209
209
|
const s = document.createElement("div");
|
|
210
210
|
s.className = "vue-cell-renderer", s.style.display = "contents";
|
|
211
|
-
const d = e, l =
|
|
211
|
+
const d = e, l = f({
|
|
212
212
|
render() {
|
|
213
|
-
return
|
|
213
|
+
return k(d, { ...t });
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
216
|
return l.mount(s), this.mountedViews.push({ app: l, container: s }), s;
|
|
@@ -229,25 +229,25 @@ class fe {
|
|
|
229
229
|
const l = n.get(r);
|
|
230
230
|
if (l)
|
|
231
231
|
return l.update(t), l.container;
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
let
|
|
235
|
-
const u =
|
|
232
|
+
const a = document.createElement("div");
|
|
233
|
+
a.className = "vue-cell-renderer", a.style.display = "contents";
|
|
234
|
+
let c = t;
|
|
235
|
+
const u = f({
|
|
236
236
|
render() {
|
|
237
|
-
return e(
|
|
237
|
+
return e(c);
|
|
238
238
|
}
|
|
239
239
|
});
|
|
240
|
-
return u.mount(
|
|
240
|
+
return u.mount(a), n.set(r, {
|
|
241
241
|
app: u,
|
|
242
|
-
container:
|
|
242
|
+
container: a,
|
|
243
243
|
update: (g) => {
|
|
244
|
-
|
|
244
|
+
c = g, u._instance?.update();
|
|
245
245
|
}
|
|
246
|
-
}),
|
|
246
|
+
}), a;
|
|
247
247
|
}
|
|
248
248
|
const s = document.createElement("div");
|
|
249
249
|
s.className = "vue-cell-renderer", s.style.display = "contents";
|
|
250
|
-
const d =
|
|
250
|
+
const d = f({
|
|
251
251
|
render() {
|
|
252
252
|
return e(t);
|
|
253
253
|
}
|
|
@@ -264,9 +264,9 @@ class fe {
|
|
|
264
264
|
return (n) => {
|
|
265
265
|
const t = document.createElement("div");
|
|
266
266
|
t.className = "vue-cell-editor", t.style.display = "contents";
|
|
267
|
-
const r = e, s =
|
|
267
|
+
const r = e, s = f({
|
|
268
268
|
render() {
|
|
269
|
-
return
|
|
269
|
+
return k(r, { ...n });
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
return s.mount(t), this.mountedViews.push({ app: s, container: t }), t;
|
|
@@ -281,7 +281,7 @@ class fe {
|
|
|
281
281
|
return (n) => {
|
|
282
282
|
const t = document.createElement("div");
|
|
283
283
|
t.className = "vue-cell-editor", t.style.display = "contents";
|
|
284
|
-
const r =
|
|
284
|
+
const r = f({
|
|
285
285
|
render() {
|
|
286
286
|
return e(n);
|
|
287
287
|
}
|
|
@@ -307,7 +307,7 @@ class fe {
|
|
|
307
307
|
const n = e.getAttribute("field");
|
|
308
308
|
let t = v.get(e);
|
|
309
309
|
if (!t && n) {
|
|
310
|
-
const d =
|
|
310
|
+
const d = w.get(n);
|
|
311
311
|
d && (d.renderer || d.editor) && (t = d, v.set(e, t));
|
|
312
312
|
}
|
|
313
313
|
const r = t?.renderer !== void 0, s = t?.editor !== void 0;
|
|
@@ -318,35 +318,35 @@ class fe {
|
|
|
318
318
|
* and returns its container DOM element.
|
|
319
319
|
*/
|
|
320
320
|
createRenderer(e) {
|
|
321
|
-
const n =
|
|
321
|
+
const n = ce(e);
|
|
322
322
|
if (!n)
|
|
323
323
|
return;
|
|
324
324
|
const t = /* @__PURE__ */ new WeakMap();
|
|
325
325
|
return (r) => {
|
|
326
326
|
const s = r.cellEl;
|
|
327
327
|
if (s) {
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
330
|
-
return
|
|
331
|
-
const
|
|
332
|
-
|
|
328
|
+
const a = t.get(s);
|
|
329
|
+
if (a)
|
|
330
|
+
return a.update(r), a.container;
|
|
331
|
+
const c = document.createElement("div");
|
|
332
|
+
c.className = "vue-cell-renderer", c.style.display = "contents";
|
|
333
333
|
let u = r;
|
|
334
|
-
const g =
|
|
334
|
+
const g = f({
|
|
335
335
|
render() {
|
|
336
336
|
return n(u);
|
|
337
337
|
}
|
|
338
338
|
});
|
|
339
|
-
return g.mount(
|
|
339
|
+
return g.mount(c), t.set(s, {
|
|
340
340
|
app: g,
|
|
341
|
-
container:
|
|
341
|
+
container: c,
|
|
342
342
|
update: (h) => {
|
|
343
343
|
u = h, g._instance?.update();
|
|
344
344
|
}
|
|
345
|
-
}),
|
|
345
|
+
}), c;
|
|
346
346
|
}
|
|
347
347
|
const d = document.createElement("div");
|
|
348
348
|
d.className = "vue-cell-renderer", d.style.display = "contents";
|
|
349
|
-
const l =
|
|
349
|
+
const l = f({
|
|
350
350
|
render() {
|
|
351
351
|
return n(r);
|
|
352
352
|
}
|
|
@@ -364,7 +364,7 @@ class fe {
|
|
|
364
364
|
return (t) => {
|
|
365
365
|
const r = document.createElement("div");
|
|
366
366
|
r.className = "vue-cell-editor", r.style.display = "contents";
|
|
367
|
-
const s =
|
|
367
|
+
const s = f({
|
|
368
368
|
render() {
|
|
369
369
|
return n(t);
|
|
370
370
|
}
|
|
@@ -386,11 +386,11 @@ class fe {
|
|
|
386
386
|
return (s, d) => {
|
|
387
387
|
const l = document.createElement("div");
|
|
388
388
|
l.className = "vue-detail-panel";
|
|
389
|
-
const
|
|
390
|
-
if (
|
|
391
|
-
const u =
|
|
389
|
+
const c = r({ row: s, rowIndex: d });
|
|
390
|
+
if (c && c.length > 0) {
|
|
391
|
+
const u = f({
|
|
392
392
|
render() {
|
|
393
|
-
return
|
|
393
|
+
return c;
|
|
394
394
|
}
|
|
395
395
|
});
|
|
396
396
|
u.mount(l), this.mountedViews.push({ app: u, container: l });
|
|
@@ -412,11 +412,11 @@ class fe {
|
|
|
412
412
|
return (s, d) => {
|
|
413
413
|
const l = document.createElement("div");
|
|
414
414
|
l.className = "vue-responsive-card";
|
|
415
|
-
const
|
|
416
|
-
if (
|
|
417
|
-
const u =
|
|
415
|
+
const c = r({ row: s, rowIndex: d });
|
|
416
|
+
if (c && c.length > 0) {
|
|
417
|
+
const u = f({
|
|
418
418
|
render() {
|
|
419
|
-
return
|
|
419
|
+
return c;
|
|
420
420
|
}
|
|
421
421
|
});
|
|
422
422
|
u.mount(l), this.mountedViews.push({ app: u, container: l });
|
|
@@ -462,7 +462,7 @@ class fe {
|
|
|
462
462
|
const t = {
|
|
463
463
|
editorParams: n.editorParams
|
|
464
464
|
};
|
|
465
|
-
return n.renderer && (t.renderer = this.createTypeRenderer(n.renderer)), n.editor && (t.editor = this.createTypeEditor(n.editor)), t;
|
|
465
|
+
return n.renderer && (t.renderer = this.createTypeRenderer(n.renderer)), n.editor && (t.editor = this.createTypeEditor(n.editor)), n.filterPanelRenderer && (t.filterPanelRenderer = this.createFilterPanelRenderer(n.filterPanelRenderer)), t;
|
|
466
466
|
}
|
|
467
467
|
/**
|
|
468
468
|
* Creates a renderer function from a Vue render function for type defaults.
|
|
@@ -472,7 +472,7 @@ class fe {
|
|
|
472
472
|
return (n) => {
|
|
473
473
|
const t = document.createElement("span");
|
|
474
474
|
t.style.display = "contents";
|
|
475
|
-
const r =
|
|
475
|
+
const r = f({
|
|
476
476
|
render() {
|
|
477
477
|
return e(n);
|
|
478
478
|
}
|
|
@@ -488,7 +488,7 @@ class fe {
|
|
|
488
488
|
return (n) => {
|
|
489
489
|
const t = document.createElement("span");
|
|
490
490
|
t.style.display = "contents";
|
|
491
|
-
const r =
|
|
491
|
+
const r = f({
|
|
492
492
|
render() {
|
|
493
493
|
return e(n);
|
|
494
494
|
}
|
|
@@ -496,6 +496,25 @@ class fe {
|
|
|
496
496
|
return r.mount(t), this.mountedViews.push({ app: r, container: t }), t;
|
|
497
497
|
};
|
|
498
498
|
}
|
|
499
|
+
/**
|
|
500
|
+
* Creates a filter panel renderer function from a Vue render function.
|
|
501
|
+
*
|
|
502
|
+
* Wraps a Vue `(params: FilterPanelParams) => VNode` function into the
|
|
503
|
+
* imperative `(container, params) => void` signature expected by the core grid.
|
|
504
|
+
* @internal
|
|
505
|
+
*/
|
|
506
|
+
createFilterPanelRenderer(e) {
|
|
507
|
+
return (n, t) => {
|
|
508
|
+
const r = document.createElement("div");
|
|
509
|
+
r.style.display = "contents";
|
|
510
|
+
const s = f({
|
|
511
|
+
render() {
|
|
512
|
+
return e(t);
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
s.mount(r), this.mountedViews.push({ app: s, container: r }), n.appendChild(r);
|
|
516
|
+
};
|
|
517
|
+
}
|
|
499
518
|
// #endregion
|
|
500
519
|
/**
|
|
501
520
|
* Cleanup all mounted Vue apps.
|
|
@@ -658,9 +677,9 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
658
677
|
return t || (r = new pe(), re.registerAdapter(r), t = !0), r;
|
|
659
678
|
}
|
|
660
679
|
s();
|
|
661
|
-
const d = i, l = n,
|
|
662
|
-
L(H,
|
|
663
|
-
const
|
|
680
|
+
const d = i, l = n, a = R(null);
|
|
681
|
+
L(H, a);
|
|
682
|
+
const c = J(), u = ie(), g = [
|
|
664
683
|
"selection",
|
|
665
684
|
"editing",
|
|
666
685
|
"clipboard",
|
|
@@ -687,58 +706,58 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
687
706
|
];
|
|
688
707
|
function h() {
|
|
689
708
|
const o = [];
|
|
690
|
-
for (const
|
|
691
|
-
const
|
|
692
|
-
if (
|
|
693
|
-
const m = oe(
|
|
709
|
+
for (const p of g) {
|
|
710
|
+
const b = d[p];
|
|
711
|
+
if (b !== void 0) {
|
|
712
|
+
const m = oe(p, b);
|
|
694
713
|
m && o.push(m);
|
|
695
714
|
}
|
|
696
715
|
}
|
|
697
716
|
return o;
|
|
698
717
|
}
|
|
699
|
-
const
|
|
700
|
-
const o = d.gridConfig ?? {},
|
|
718
|
+
const _ = ne(() => {
|
|
719
|
+
const o = d.gridConfig ?? {}, p = h(), b = o.plugins ?? [], m = [...p, ...b], D = u ? { ...o.icons, ...u } : o.icons;
|
|
701
720
|
return {
|
|
702
721
|
...o,
|
|
703
722
|
...d.columns ? { columns: d.columns } : {},
|
|
704
723
|
...m.length > 0 ? { plugins: m } : {},
|
|
705
|
-
...
|
|
724
|
+
...D ? { icons: D } : {}
|
|
706
725
|
};
|
|
707
726
|
});
|
|
708
|
-
function
|
|
727
|
+
function M(o) {
|
|
709
728
|
l("cell-commit", o);
|
|
710
729
|
}
|
|
711
|
-
function
|
|
730
|
+
function N(o) {
|
|
712
731
|
l("row-commit", o);
|
|
713
732
|
}
|
|
714
|
-
function
|
|
733
|
+
function A(o) {
|
|
715
734
|
l("cell-click", o);
|
|
716
735
|
}
|
|
717
|
-
function
|
|
736
|
+
function W(o) {
|
|
718
737
|
l("cell-dblclick", o);
|
|
719
738
|
}
|
|
720
|
-
function
|
|
739
|
+
function I(o) {
|
|
721
740
|
l("selection-change", o);
|
|
722
741
|
}
|
|
723
|
-
function
|
|
742
|
+
function x(o) {
|
|
724
743
|
l("row-toggle", o);
|
|
725
744
|
}
|
|
726
|
-
function
|
|
745
|
+
function $(o) {
|
|
727
746
|
l("sort-change", o);
|
|
728
747
|
}
|
|
729
748
|
function z(o) {
|
|
730
749
|
l("ready", o);
|
|
731
750
|
}
|
|
732
|
-
function Z(o,
|
|
733
|
-
const
|
|
751
|
+
function Z(o, p) {
|
|
752
|
+
const b = Object.getPrototypeOf(o), m = Object.getOwnPropertyDescriptor(b, "gridConfig");
|
|
734
753
|
if (!m?.set || !m?.get) return;
|
|
735
|
-
const
|
|
754
|
+
const D = m.set, te = m.get;
|
|
736
755
|
Object.defineProperty(o, "gridConfig", {
|
|
737
756
|
get() {
|
|
738
757
|
return te.call(this);
|
|
739
758
|
},
|
|
740
|
-
set(
|
|
741
|
-
|
|
759
|
+
set(V) {
|
|
760
|
+
V && p ? D.call(this, p.processGridConfig(V)) : D.call(this, V);
|
|
742
761
|
},
|
|
743
762
|
configurable: !0
|
|
744
763
|
});
|
|
@@ -747,48 +766,48 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
747
766
|
delete o.gridConfig;
|
|
748
767
|
}
|
|
749
768
|
return T(() => {
|
|
750
|
-
const o =
|
|
769
|
+
const o = a.value;
|
|
751
770
|
if (!o) return;
|
|
752
|
-
const
|
|
753
|
-
o.__frameworkAdapter =
|
|
771
|
+
const p = s();
|
|
772
|
+
o.__frameworkAdapter = p, p.setTypeDefaults(c ?? null), Z(o, p), o.addEventListener("cell-commit", M), o.addEventListener("row-commit", N), o.addEventListener("cell-click", A), o.addEventListener("cell-dblclick", W), o.addEventListener("selection-change", I), o.addEventListener("row-toggle", x), o.addEventListener("sort-change", $), o.addEventListener("ready", z), d.rows.length > 0 && (o.rows = d.rows), _.value && (o.gridConfig = _.value), d.fitMode && (o.fitMode = d.fitMode);
|
|
754
773
|
}), q(() => {
|
|
755
|
-
const o =
|
|
756
|
-
o && (ee(o), o.removeEventListener("cell-commit",
|
|
757
|
-
}),
|
|
774
|
+
const o = a.value;
|
|
775
|
+
o && (ee(o), o.removeEventListener("cell-commit", M), o.removeEventListener("row-commit", N), o.removeEventListener("cell-click", A), o.removeEventListener("cell-dblclick", W), o.removeEventListener("selection-change", I), o.removeEventListener("row-toggle", x), o.removeEventListener("sort-change", $), o.removeEventListener("ready", z));
|
|
776
|
+
}), j(
|
|
758
777
|
() => d.rows,
|
|
759
778
|
(o) => {
|
|
760
|
-
|
|
779
|
+
a.value && (a.value.rows = o);
|
|
761
780
|
},
|
|
762
781
|
{ deep: !0 }
|
|
763
|
-
),
|
|
764
|
-
|
|
782
|
+
), j(
|
|
783
|
+
_,
|
|
765
784
|
(o) => {
|
|
766
|
-
|
|
785
|
+
a.value && o && (a.value.gridConfig = o);
|
|
767
786
|
},
|
|
768
787
|
{ deep: !0 }
|
|
769
|
-
),
|
|
788
|
+
), j(
|
|
770
789
|
() => d.fitMode,
|
|
771
790
|
(o) => {
|
|
772
|
-
|
|
791
|
+
a.value && o && (a.value.fitMode = o);
|
|
773
792
|
}
|
|
774
|
-
),
|
|
775
|
-
() =>
|
|
793
|
+
), j(
|
|
794
|
+
() => c,
|
|
776
795
|
(o) => {
|
|
777
796
|
s().setTypeDefaults(o ?? null);
|
|
778
797
|
},
|
|
779
798
|
{ deep: !0 }
|
|
780
799
|
), e({
|
|
781
800
|
/** The underlying grid element */
|
|
782
|
-
gridElement:
|
|
801
|
+
gridElement: a,
|
|
783
802
|
/** Force a layout recalculation */
|
|
784
|
-
forceLayout: () =>
|
|
803
|
+
forceLayout: () => a.value?.forceLayout(),
|
|
785
804
|
/** Get current grid configuration */
|
|
786
|
-
getConfig: () =>
|
|
805
|
+
getConfig: () => a.value?.getConfig(),
|
|
787
806
|
/** Wait for grid to be ready */
|
|
788
|
-
ready: () =>
|
|
789
|
-
}), (o,
|
|
807
|
+
ready: () => a.value?.ready()
|
|
808
|
+
}), (o, p) => (P(), O("tbw-grid", {
|
|
790
809
|
ref_key: "gridRef",
|
|
791
|
-
ref:
|
|
810
|
+
ref: a
|
|
792
811
|
}, [
|
|
793
812
|
U(o.$slots, "default")
|
|
794
813
|
], 512));
|
|
@@ -809,7 +828,7 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
809
828
|
hidden: { type: Boolean }
|
|
810
829
|
},
|
|
811
830
|
setup(i) {
|
|
812
|
-
const e =
|
|
831
|
+
const e = S(), n = R(null);
|
|
813
832
|
return T(() => {
|
|
814
833
|
const t = n.value;
|
|
815
834
|
if (!t) return;
|
|
@@ -817,25 +836,29 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
817
836
|
r && le(t, (d) => {
|
|
818
837
|
const l = e.cell;
|
|
819
838
|
if (!l) return C("span");
|
|
820
|
-
const
|
|
839
|
+
const a = l({
|
|
821
840
|
value: d.value,
|
|
822
841
|
row: d.row,
|
|
823
842
|
column: d.column
|
|
824
843
|
});
|
|
825
|
-
return C("div", { style: "display: contents" },
|
|
826
|
-
}), s &&
|
|
844
|
+
return C("div", { style: "display: contents" }, a);
|
|
845
|
+
}), s && ae(t, (d) => {
|
|
827
846
|
const l = e.editor;
|
|
828
847
|
if (!l) return C("span");
|
|
829
|
-
const
|
|
848
|
+
const a = l({
|
|
830
849
|
value: d.value,
|
|
831
850
|
row: d.row,
|
|
832
851
|
column: d.column,
|
|
852
|
+
field: d.field,
|
|
853
|
+
rowId: d.rowId ?? "",
|
|
833
854
|
commit: d.commit,
|
|
834
|
-
cancel: d.cancel
|
|
855
|
+
cancel: d.cancel,
|
|
856
|
+
updateRow: d.updateRow,
|
|
857
|
+
onValueChange: d.onValueChange
|
|
835
858
|
});
|
|
836
|
-
return C("div", { style: "display: contents" },
|
|
859
|
+
return C("div", { style: "display: contents" }, a);
|
|
837
860
|
});
|
|
838
|
-
}), (t, r) => (
|
|
861
|
+
}), (t, r) => (P(), O("tbw-grid-column", {
|
|
839
862
|
ref_key: "columnRef",
|
|
840
863
|
ref: n,
|
|
841
864
|
field: i.field,
|
|
@@ -858,37 +881,37 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
858
881
|
animation: { type: [String, Boolean], default: "slide" }
|
|
859
882
|
},
|
|
860
883
|
setup(i) {
|
|
861
|
-
const e = R(null), n =
|
|
884
|
+
const e = R(null), n = S();
|
|
862
885
|
return T(() => {
|
|
863
886
|
const t = e.value;
|
|
864
887
|
!t || !n.default || Q.set(t, (r) => n.default?.(r));
|
|
865
|
-
}), (t, r) => (
|
|
888
|
+
}), (t, r) => (P(), O("tbw-grid-detail", {
|
|
866
889
|
ref_key: "detailRef",
|
|
867
890
|
ref: e,
|
|
868
891
|
"show-expand-column": i.showExpandColumn,
|
|
869
892
|
animation: i.animation
|
|
870
893
|
}, null, 8, ge));
|
|
871
894
|
}
|
|
872
|
-
}),
|
|
895
|
+
}), Pe = /* @__PURE__ */ y({
|
|
873
896
|
__name: "TbwGridResponsiveCard",
|
|
874
897
|
setup(i) {
|
|
875
|
-
const e = R(null), n =
|
|
898
|
+
const e = R(null), n = S();
|
|
876
899
|
return T(() => {
|
|
877
900
|
const t = e.value;
|
|
878
901
|
!t || !n.default || X.set(t, (r) => n.default?.(r));
|
|
879
|
-
}), (t, r) => (
|
|
902
|
+
}), (t, r) => (P(), O("tbw-grid-responsive-card", {
|
|
880
903
|
ref_key: "cardRef",
|
|
881
904
|
ref: e
|
|
882
905
|
}, null, 512));
|
|
883
906
|
}
|
|
884
|
-
}),
|
|
907
|
+
}), _e = /* @__PURE__ */ y({
|
|
885
908
|
__name: "TbwGridToolButtons",
|
|
886
909
|
setup(i) {
|
|
887
|
-
return (e, n) => (
|
|
910
|
+
return (e, n) => (P(), O("tbw-grid-tool-buttons", null, [
|
|
888
911
|
U(e.$slots, "default")
|
|
889
912
|
]));
|
|
890
913
|
}
|
|
891
|
-
}), ye = /* @__PURE__ */ new WeakMap(), ve = ["id", "label", "icon", "position", "width"],
|
|
914
|
+
}), ye = /* @__PURE__ */ new WeakMap(), ve = ["id", "label", "icon", "position", "width"], De = /* @__PURE__ */ y({
|
|
892
915
|
__name: "TbwGridToolPanel",
|
|
893
916
|
props: {
|
|
894
917
|
id: {},
|
|
@@ -898,11 +921,11 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
898
921
|
width: { default: "250px" }
|
|
899
922
|
},
|
|
900
923
|
setup(i) {
|
|
901
|
-
const e = R(null), n =
|
|
924
|
+
const e = R(null), n = S();
|
|
902
925
|
return T(() => {
|
|
903
926
|
const t = e.value;
|
|
904
927
|
!t || !n.default || ye.set(t, (r) => n.default?.(r));
|
|
905
|
-
}), (t, r) => (
|
|
928
|
+
}), (t, r) => (P(), O("tbw-grid-tool-panel", {
|
|
906
929
|
ref_key: "panelRef",
|
|
907
930
|
ref: e,
|
|
908
931
|
id: i.id,
|
|
@@ -913,8 +936,8 @@ const pe = fe, Re = /* @__PURE__ */ y({
|
|
|
913
936
|
}, null, 8, ve));
|
|
914
937
|
}
|
|
915
938
|
});
|
|
916
|
-
function
|
|
917
|
-
const t = n ??
|
|
939
|
+
function Ge(i, e, n) {
|
|
940
|
+
const t = n ?? F(H, R(null));
|
|
918
941
|
let r = null;
|
|
919
942
|
T(() => {
|
|
920
943
|
const s = t.value;
|
|
@@ -925,7 +948,7 @@ function je(i, e, n) {
|
|
|
925
948
|
r?.();
|
|
926
949
|
});
|
|
927
950
|
}
|
|
928
|
-
const
|
|
951
|
+
const je = y({
|
|
929
952
|
name: "GridProvider",
|
|
930
953
|
props: {
|
|
931
954
|
/**
|
|
@@ -956,24 +979,24 @@ export {
|
|
|
956
979
|
Y as GRID_TYPE_DEFAULTS,
|
|
957
980
|
fe as GridAdapter,
|
|
958
981
|
se as GridIconProvider,
|
|
959
|
-
|
|
982
|
+
je as GridProvider,
|
|
960
983
|
de as GridTypeProvider,
|
|
961
984
|
Re as TbwGrid,
|
|
962
985
|
Te as TbwGridColumn,
|
|
963
986
|
Oe as TbwGridDetailPanel,
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
987
|
+
Pe as TbwGridResponsiveCard,
|
|
988
|
+
_e as TbwGridToolButtons,
|
|
989
|
+
De as TbwGridToolPanel,
|
|
967
990
|
pe as VueGridAdapter,
|
|
968
|
-
|
|
991
|
+
Ve as clearFeatureRegistry,
|
|
969
992
|
oe as createPluginFromFeature,
|
|
970
|
-
|
|
993
|
+
ke as getFeatureFactory,
|
|
971
994
|
Le as getRegisteredFeatures,
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
995
|
+
Fe as isFeatureRegistered,
|
|
996
|
+
G as isVueComponent,
|
|
997
|
+
Me as registerFeature,
|
|
998
|
+
Ae as useGrid,
|
|
999
|
+
Ge as useGridEvent,
|
|
977
1000
|
ie as useGridIcons,
|
|
978
1001
|
J as useGridTypeDefaults,
|
|
979
1002
|
Ce as useTypeDefault
|