@toolbox-web/grid-vue 0.1.0 → 0.3.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.
Files changed (41) hide show
  1. package/README.md +18 -10
  2. package/chunks/use-grid-DwjXrO19.js +21 -0
  3. package/chunks/use-grid-DwjXrO19.js.map +1 -0
  4. package/features/export.d.ts +51 -10
  5. package/features/export.d.ts.map +1 -1
  6. package/features/export.js +54 -3
  7. package/features/export.js.map +1 -1
  8. package/features/filtering.d.ts +57 -7
  9. package/features/filtering.d.ts.map +1 -1
  10. package/features/filtering.js +70 -3
  11. package/features/filtering.js.map +1 -1
  12. package/features/print.d.ts +30 -7
  13. package/features/print.d.ts.map +1 -1
  14. package/features/print.js +27 -3
  15. package/features/print.js.map +1 -1
  16. package/features/selection.d.ts +43 -10
  17. package/features/selection.d.ts.map +1 -1
  18. package/features/selection.js +42 -3
  19. package/features/selection.js.map +1 -1
  20. package/features/undo-redo.d.ts +47 -7
  21. package/features/undo-redo.d.ts.map +1 -1
  22. package/features/undo-redo.js +48 -3
  23. package/features/undo-redo.js.map +1 -1
  24. package/index.d.ts +14 -2
  25. package/index.d.ts.map +1 -1
  26. package/index.js +337 -260
  27. package/index.js.map +1 -1
  28. package/lib/TbwGrid.vue.d.ts +46 -44
  29. package/lib/TbwGrid.vue.d.ts.map +1 -1
  30. package/lib/feature-props.d.ts +5 -1
  31. package/lib/feature-props.d.ts.map +1 -1
  32. package/lib/grid-provider.d.ts +1 -1
  33. package/lib/grid-type-registry.d.ts +27 -5
  34. package/lib/grid-type-registry.d.ts.map +1 -1
  35. package/lib/vue-column-config.d.ts +77 -15
  36. package/lib/vue-column-config.d.ts.map +1 -1
  37. package/lib/vue-grid-adapter.d.ts +57 -4
  38. package/lib/vue-grid-adapter.d.ts.map +1 -1
  39. package/package.json +1 -1
  40. package/typedoc-entry.d.ts +12 -2
  41. package/typedoc-entry.d.ts.map +1 -1
package/index.js CHANGED
@@ -1,12 +1,14 @@
1
- import { defineComponent as f, provide as T, inject as _, ref as v, createApp as B, computed as H, onMounted as b, onBeforeUnmount as W, watch as G, createElementBlock as w, openBlock as h, renderSlot as $, useSlots as j, h as y } from "vue";
2
- import { DataGridElement as Y } from "@toolbox-web/grid";
3
- import { c as K } from "./chunks/feature-registry-BgEOysSJ.js";
4
- import { a as Ce, g as Be, b as Oe, i as _e, r as je } from "./chunks/feature-registry-BgEOysSJ.js";
5
- const I = /* @__PURE__ */ Symbol("grid-icons");
6
- function J() {
7
- return _(I, void 0);
1
+ import { defineComponent as p, provide as j, inject as D, createApp as g, ref as h, computed as Y, onMounted as b, onBeforeUnmount as W, watch as B, createElementBlock as w, openBlock as E, renderSlot as $, useSlots as G, h as y } from "vue";
2
+ import { DataGridElement as K } from "@toolbox-web/grid";
3
+ import { c as J } from "./chunks/feature-registry-BgEOysSJ.js";
4
+ import { a as Be, g as Ge, b as Oe, i as _e, r as je } from "./chunks/feature-registry-BgEOysSJ.js";
5
+ import { G as I } from "./chunks/use-grid-DwjXrO19.js";
6
+ import { u as ke } from "./chunks/use-grid-DwjXrO19.js";
7
+ const z = /* @__PURE__ */ Symbol("grid-icons");
8
+ function Q() {
9
+ return D(z, void 0);
8
10
  }
9
- const Q = f({
11
+ const X = p({
10
12
  name: "GridIconProvider",
11
13
  props: {
12
14
  /**
@@ -17,17 +19,17 @@ const Q = f({
17
19
  required: !0
18
20
  }
19
21
  },
20
- setup(e, { slots: n }) {
21
- return T(I, e.icons), () => n.default?.();
22
+ setup(o, { slots: t }) {
23
+ return j(z, o.icons), () => t.default?.();
22
24
  }
23
- }), z = /* @__PURE__ */ Symbol("grid-type-defaults");
24
- function N() {
25
- return _(z, void 0);
25
+ }), N = /* @__PURE__ */ Symbol("grid-type-defaults");
26
+ function q() {
27
+ return D(N, void 0);
26
28
  }
27
- function ue(e) {
28
- return N()?.[e];
29
+ function me(o) {
30
+ return q()?.[o];
29
31
  }
30
- const X = f({
32
+ const Z = p({
31
33
  name: "GridTypeProvider",
32
34
  props: {
33
35
  /**
@@ -38,107 +40,102 @@ const X = f({
38
40
  required: !0
39
41
  }
40
42
  },
41
- setup(e, { slots: n }) {
42
- return T(z, e.defaults), () => n.default?.();
43
+ setup(o, { slots: t }) {
44
+ return j(N, o.defaults), () => t.default?.();
43
45
  }
44
- }), L = /* @__PURE__ */ Symbol("tbw-grid");
45
- function fe() {
46
- const e = _(L, v(null));
47
- return {
48
- gridElement: e,
49
- forceLayout: async () => {
50
- await e.value?.forceLayout();
51
- },
52
- getConfig: () => e.value?.getConfig(),
53
- ready: async () => {
54
- await e.value?.ready();
55
- },
56
- getPlugin: (n) => e.value?.getPlugin(n)
57
- };
58
- }
59
- const q = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new Map();
60
- function Z(e, n) {
61
- const o = e.getAttribute("field"), r = g.get(e) ?? {};
62
- if (r.renderer = n, g.set(e, r), o) {
63
- const i = p.get(o) ?? {};
64
- i.renderer = n, p.set(o, i);
46
+ }), U = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new Map();
47
+ function ee(o, t) {
48
+ const e = o.getAttribute("field"), n = m.get(o) ?? {};
49
+ if (n.renderer = t, m.set(o, n), e) {
50
+ const i = v.get(e) ?? {};
51
+ i.renderer = t, v.set(e, i);
65
52
  }
66
53
  }
67
- function ee(e, n) {
68
- const o = e.getAttribute("field"), r = g.get(e) ?? {};
69
- if (r.editor = n, g.set(e, r), o) {
70
- const i = p.get(o) ?? {};
71
- i.editor = n, p.set(o, i);
54
+ function te(o, t) {
55
+ const e = o.getAttribute("field"), n = m.get(o) ?? {};
56
+ if (n.editor = t, m.set(o, n), e) {
57
+ const i = v.get(e) ?? {};
58
+ i.editor = t, v.set(e, i);
72
59
  }
73
60
  }
74
- function te(e) {
75
- let n = g.get(e)?.renderer;
76
- if (!n) {
77
- const o = e.getAttribute("field");
78
- o && (n = p.get(o)?.renderer);
61
+ function ne(o) {
62
+ let t = m.get(o)?.renderer;
63
+ if (!t) {
64
+ const e = o.getAttribute("field");
65
+ e && (t = v.get(e)?.renderer);
79
66
  }
80
- return n;
67
+ return t;
81
68
  }
82
- function ne(e) {
83
- let n = g.get(e)?.editor;
84
- if (!n) {
85
- const o = e.getAttribute("field");
86
- o && (n = p.get(o)?.editor);
69
+ function re(o) {
70
+ let t = m.get(o)?.editor;
71
+ if (!t) {
72
+ const e = o.getAttribute("field");
73
+ e && (t = v.get(e)?.editor);
87
74
  }
88
- return n;
75
+ return t;
89
76
  }
90
77
  class oe {
91
78
  mountedViews = [];
79
+ typeDefaults = null;
80
+ /**
81
+ * Sets the type defaults map for this adapter.
82
+ * Called by TbwGrid when it receives type defaults from context.
83
+ *
84
+ * @internal
85
+ */
86
+ setTypeDefaults(t) {
87
+ this.typeDefaults = t;
88
+ }
92
89
  /**
93
90
  * Determines if this adapter can handle the given element.
94
91
  * Checks if a renderer or editor is registered for this element.
95
92
  */
96
- canHandle(n) {
97
- const o = n.getAttribute("field");
98
- let r = g.get(n);
99
- if (!r && o) {
100
- const l = p.get(o);
101
- l && (l.renderer || l.editor) && (r = l, g.set(n, r));
93
+ canHandle(t) {
94
+ const e = t.getAttribute("field");
95
+ let n = m.get(t);
96
+ if (!n && e) {
97
+ const l = v.get(e);
98
+ l && (l.renderer || l.editor) && (n = l, m.set(t, n));
102
99
  }
103
- const i = r?.renderer !== void 0, s = r?.editor !== void 0;
104
- return r !== void 0 && (i || s);
100
+ const i = n?.renderer !== void 0, a = n?.editor !== void 0;
101
+ return n !== void 0 && (i || a);
105
102
  }
106
103
  /**
107
104
  * Creates a view renderer function that renders a Vue component
108
105
  * and returns its container DOM element.
109
106
  */
110
- createRenderer(n) {
111
- const o = te(n);
112
- if (!o)
107
+ createRenderer(t) {
108
+ const e = ne(t);
109
+ if (!e)
113
110
  return;
114
- const r = /* @__PURE__ */ new WeakMap();
111
+ const n = /* @__PURE__ */ new WeakMap();
115
112
  return (i) => {
116
- const s = i.cellEl;
117
- if (s) {
118
- const a = r.get(s);
119
- if (a)
120
- return a.update(i), a.container;
113
+ const a = i.cellEl;
114
+ if (a) {
115
+ const s = n.get(a);
116
+ if (s)
117
+ return s.update(i), s.container;
121
118
  const c = document.createElement("div");
122
119
  c.className = "vue-cell-renderer", c.style.display = "contents";
123
120
  let u = i;
124
- const E = B({
121
+ const R = g({
125
122
  render() {
126
- return o(u);
123
+ return e(u);
127
124
  }
128
125
  });
129
- return E.mount(c), r.set(s, {
130
- app: E,
126
+ return R.mount(c), n.set(a, {
127
+ app: R,
131
128
  container: c,
132
- update: (R) => {
133
- u = R, E._instance?.update();
129
+ update: (O) => {
130
+ u = O, R._instance?.update();
134
131
  }
135
132
  }), c;
136
133
  }
137
134
  const l = document.createElement("div");
138
135
  l.className = "vue-cell-renderer", l.style.display = "contents";
139
- const d = B({
136
+ const d = g({
140
137
  render() {
141
- return o(i);
138
+ return e(i);
142
139
  }
143
140
  });
144
141
  return d.mount(l), this.mountedViews.push({ app: d, container: l }), l;
@@ -148,37 +145,37 @@ class oe {
148
145
  * Creates an editor spec that renders a Vue component for cell editing.
149
146
  * Returns a function that creates the editor DOM element.
150
147
  */
151
- createEditor(n) {
152
- const o = ne(n);
153
- if (o)
154
- return (r) => {
148
+ createEditor(t) {
149
+ const e = re(t);
150
+ if (e)
151
+ return (n) => {
155
152
  const i = document.createElement("div");
156
153
  i.className = "vue-cell-editor", i.style.display = "contents";
157
- const s = B({
154
+ const a = g({
158
155
  render() {
159
- return o(r);
156
+ return e(n);
160
157
  }
161
158
  });
162
- return s.mount(i), this.mountedViews.push({ app: s, container: i }), i;
159
+ return a.mount(i), this.mountedViews.push({ app: a, container: i }), i;
163
160
  };
164
161
  }
165
162
  /**
166
163
  * Framework adapter hook called by MasterDetailPlugin during attach().
167
164
  * Parses the <tbw-grid-detail> element and returns a Vue-based renderer.
168
165
  */
169
- parseDetailElement(n) {
170
- const o = n.closest("tbw-grid");
171
- if (!o) return;
172
- const r = o.querySelector("tbw-grid-detail");
173
- if (!r) return;
174
- const i = q.get(r);
166
+ parseDetailElement(t) {
167
+ const e = t.closest("tbw-grid");
168
+ if (!e) return;
169
+ const n = e.querySelector("tbw-grid-detail");
170
+ if (!n) return;
171
+ const i = U.get(n);
175
172
  if (i)
176
- return (s, l) => {
173
+ return (a, l) => {
177
174
  const d = document.createElement("div");
178
175
  d.className = "vue-detail-panel";
179
- const c = i({ row: s, rowIndex: l });
176
+ const c = i({ row: a, rowIndex: l });
180
177
  if (c && c.length > 0) {
181
- const u = B({
178
+ const u = g({
182
179
  render() {
183
180
  return c;
184
181
  }
@@ -192,19 +189,19 @@ class oe {
192
189
  * Framework adapter hook called by ResponsivePlugin during attach().
193
190
  * Parses the <tbw-grid-responsive-card> element and returns a Vue-based renderer.
194
191
  */
195
- parseResponsiveCardElement(n) {
196
- const o = n.closest("tbw-grid");
197
- if (!o) return;
198
- const r = o.querySelector("tbw-grid-responsive-card");
199
- if (!r) return;
200
- const i = U.get(r);
192
+ parseResponsiveCardElement(t) {
193
+ const e = t.closest("tbw-grid");
194
+ if (!e) return;
195
+ const n = e.querySelector("tbw-grid-responsive-card");
196
+ if (!n) return;
197
+ const i = H.get(n);
201
198
  if (i)
202
- return (s, l) => {
199
+ return (a, l) => {
203
200
  const d = document.createElement("div");
204
201
  d.className = "vue-responsive-card";
205
- const c = i({ row: s, rowIndex: l });
202
+ const c = i({ row: a, rowIndex: l });
206
203
  if (c && c.length > 0) {
207
- const u = B({
204
+ const u = g({
208
205
  render() {
209
206
  return c;
210
207
  }
@@ -214,19 +211,92 @@ class oe {
214
211
  return d;
215
212
  };
216
213
  }
214
+ // #region Type Defaults Support
215
+ /**
216
+ * Gets type-level defaults from the type defaults map.
217
+ *
218
+ * This enables application-wide type defaults configured via GridTypeProvider.
219
+ * The returned TypeDefault contains renderer/editor functions that render
220
+ * Vue components into the grid's cells.
221
+ *
222
+ * @example
223
+ * ```vue
224
+ * <script setup>
225
+ * import { GridTypeProvider } from '@toolbox-web/grid-vue';
226
+ * import { h } from 'vue';
227
+ * import CountryBadge from './CountryBadge.vue';
228
+ *
229
+ * const typeDefaults = {
230
+ * country: {
231
+ * renderer: (ctx) => h(CountryBadge, { code: ctx.value }),
232
+ * },
233
+ * };
234
+ * <\/script>
235
+ *
236
+ * <template>
237
+ * <GridTypeProvider :defaults="typeDefaults">
238
+ * <App />
239
+ * </GridTypeProvider>
240
+ * </template>
241
+ * ```
242
+ */
243
+ getTypeDefault(t) {
244
+ if (!this.typeDefaults)
245
+ return;
246
+ const e = this.typeDefaults[t];
247
+ if (!e)
248
+ return;
249
+ const n = {
250
+ editorParams: e.editorParams
251
+ };
252
+ return e.renderer && (n.renderer = this.createTypeRenderer(e.renderer)), e.editor && (n.editor = this.createTypeEditor(e.editor)), n;
253
+ }
254
+ /**
255
+ * Creates a renderer function from a Vue render function for type defaults.
256
+ * @internal
257
+ */
258
+ createTypeRenderer(t) {
259
+ return (e) => {
260
+ const n = document.createElement("span");
261
+ n.style.display = "contents";
262
+ const i = g({
263
+ render() {
264
+ return t(e);
265
+ }
266
+ });
267
+ return i.mount(n), this.mountedViews.push({ app: i, container: n }), n;
268
+ };
269
+ }
270
+ /**
271
+ * Creates an editor function from a Vue render function for type defaults.
272
+ * @internal
273
+ */
274
+ createTypeEditor(t) {
275
+ return (e) => {
276
+ const n = document.createElement("span");
277
+ n.style.display = "contents";
278
+ const i = g({
279
+ render() {
280
+ return t(e);
281
+ }
282
+ });
283
+ return i.mount(n), this.mountedViews.push({ app: i, container: n }), n;
284
+ };
285
+ }
286
+ // #endregion
217
287
  /**
218
288
  * Cleanup all mounted Vue apps.
219
289
  */
220
290
  cleanup() {
221
- for (const { app: n, container: o } of this.mountedViews)
291
+ for (const { app: t, container: e } of this.mountedViews)
222
292
  try {
223
- n.unmount(), o.remove();
293
+ t.unmount(), e.remove();
224
294
  } catch {
225
295
  }
226
296
  this.mountedViews = [];
227
297
  }
228
298
  }
229
- const ge = /* @__PURE__ */ f({
299
+ const ie = oe, ge = /* @__PURE__ */ p({
230
300
  __name: "TbwGrid",
231
301
  props: {
232
302
  /** Row data to display */
@@ -369,15 +439,15 @@ const ge = /* @__PURE__ */ f({
369
439
  }
370
440
  },
371
441
  emits: ["cell-commit", "row-commit", "cell-click", "cell-dblclick", "selection-change", "row-toggle", "sort-change", "ready"],
372
- setup(e, { expose: n, emit: o }) {
373
- let r = !1, i = null;
374
- function s() {
375
- return r || (i = new oe(), Y.registerAdapter(i), r = !0), i;
442
+ setup(o, { expose: t, emit: e }) {
443
+ let n = !1, i = null;
444
+ function a() {
445
+ return n || (i = new ie(), K.registerAdapter(i), n = !0), i;
376
446
  }
377
- s();
378
- const l = e, d = o, a = v(null);
379
- T(L, a), N();
380
- const c = J(), u = [
447
+ a();
448
+ const l = o, d = e, s = h(null);
449
+ j(I, s);
450
+ const c = q(), u = Q(), R = [
381
451
  "selection",
382
452
  "editing",
383
453
  "clipboard",
@@ -402,92 +472,98 @@ const ge = /* @__PURE__ */ f({
402
472
  "pivot",
403
473
  "serverSide"
404
474
  ];
405
- function E() {
406
- const t = [];
407
- for (const m of u) {
408
- const O = l[m];
409
- if (O !== void 0) {
410
- const C = K(m, O);
411
- C && t.push(C);
475
+ function O() {
476
+ const r = [];
477
+ for (const f of R) {
478
+ const T = l[f];
479
+ if (T !== void 0) {
480
+ const C = J(f, T);
481
+ C && r.push(C);
412
482
  }
413
483
  }
414
- return t;
484
+ return r;
415
485
  }
416
- const R = H(() => {
417
- const t = l.gridConfig ?? {}, m = E(), O = t.plugins ?? [], C = [...m, ...O], V = c ? { ...t.icons, ...c } : t.icons;
486
+ const _ = Y(() => {
487
+ const r = l.gridConfig ?? {}, f = O(), T = r.plugins ?? [], C = [...f, ...T], V = u ? { ...r.icons, ...u } : r.icons;
418
488
  return {
419
- ...t,
489
+ ...r,
420
490
  ...l.columns ? { columns: l.columns } : {},
421
491
  ...C.length > 0 ? { plugins: C } : {},
422
492
  ...V ? { icons: V } : {}
423
493
  };
424
494
  });
425
- function S(t) {
426
- d("cell-commit", t);
495
+ function k(r) {
496
+ d("cell-commit", r);
427
497
  }
428
- function k(t) {
429
- d("row-commit", t);
498
+ function S(r) {
499
+ d("row-commit", r);
430
500
  }
431
- function P(t) {
432
- d("cell-click", t);
501
+ function L(r) {
502
+ d("cell-click", r);
433
503
  }
434
- function x(t) {
435
- d("cell-dblclick", t);
504
+ function P(r) {
505
+ d("cell-dblclick", r);
436
506
  }
437
- function D(t) {
438
- d("selection-change", t);
507
+ function x(r) {
508
+ d("selection-change", r);
439
509
  }
440
- function F(t) {
441
- d("row-toggle", t);
510
+ function A(r) {
511
+ d("row-toggle", r);
442
512
  }
443
- function A(t) {
444
- d("sort-change", t);
513
+ function F(r) {
514
+ d("sort-change", r);
445
515
  }
446
- function M(t) {
447
- d("ready", t);
516
+ function M(r) {
517
+ d("ready", r);
448
518
  }
449
519
  return b(() => {
450
- const t = a.value;
451
- if (!t) return;
452
- const m = s();
453
- t.__frameworkAdapter = m, t.addEventListener("cell-commit", S), t.addEventListener("row-commit", k), t.addEventListener("cell-click", P), t.addEventListener("cell-dblclick", x), t.addEventListener("selection-change", D), t.addEventListener("row-toggle", F), t.addEventListener("sort-change", A), t.addEventListener("ready", M), l.rows.length > 0 && (t.rows = l.rows), R.value && (t.gridConfig = R.value), l.fitMode && (t.fitMode = l.fitMode);
520
+ const r = s.value;
521
+ if (!r) return;
522
+ const f = a();
523
+ r.__frameworkAdapter = f, f.setTypeDefaults(c ?? null), r.addEventListener("cell-commit", k), r.addEventListener("row-commit", S), r.addEventListener("cell-click", L), r.addEventListener("cell-dblclick", P), r.addEventListener("selection-change", x), r.addEventListener("row-toggle", A), r.addEventListener("sort-change", F), r.addEventListener("ready", M), l.rows.length > 0 && (r.rows = l.rows), _.value && (r.gridConfig = _.value), l.fitMode && (r.fitMode = l.fitMode);
454
524
  }), W(() => {
455
- const t = a.value;
456
- t && (t.removeEventListener("cell-commit", S), t.removeEventListener("row-commit", k), t.removeEventListener("cell-click", P), t.removeEventListener("cell-dblclick", x), t.removeEventListener("selection-change", D), t.removeEventListener("row-toggle", F), t.removeEventListener("sort-change", A), t.removeEventListener("ready", M));
457
- }), G(
525
+ const r = s.value;
526
+ r && (r.removeEventListener("cell-commit", k), r.removeEventListener("row-commit", S), r.removeEventListener("cell-click", L), r.removeEventListener("cell-dblclick", P), r.removeEventListener("selection-change", x), r.removeEventListener("row-toggle", A), r.removeEventListener("sort-change", F), r.removeEventListener("ready", M));
527
+ }), B(
458
528
  () => l.rows,
459
- (t) => {
460
- a.value && (a.value.rows = t);
529
+ (r) => {
530
+ s.value && (s.value.rows = r);
461
531
  },
462
532
  { deep: !0 }
463
- ), G(
464
- R,
465
- (t) => {
466
- a.value && t && (a.value.gridConfig = t);
533
+ ), B(
534
+ _,
535
+ (r) => {
536
+ s.value && r && (s.value.gridConfig = r);
467
537
  },
468
538
  { deep: !0 }
469
- ), G(
539
+ ), B(
470
540
  () => l.fitMode,
471
- (t) => {
472
- a.value && t && (a.value.fitMode = t);
541
+ (r) => {
542
+ s.value && r && (s.value.fitMode = r);
473
543
  }
474
- ), n({
544
+ ), B(
545
+ () => c,
546
+ (r) => {
547
+ a().setTypeDefaults(r ?? null);
548
+ },
549
+ { deep: !0 }
550
+ ), t({
475
551
  /** The underlying grid element */
476
- gridElement: a,
552
+ gridElement: s,
477
553
  /** Force a layout recalculation */
478
- forceLayout: () => a.value?.forceLayout(),
554
+ forceLayout: () => s.value?.forceLayout(),
479
555
  /** Get current grid configuration */
480
- getConfig: () => a.value?.getConfig(),
556
+ getConfig: () => s.value?.getConfig(),
481
557
  /** Wait for grid to be ready */
482
- ready: () => a.value?.ready()
483
- }), (t, m) => (h(), w("tbw-grid", {
558
+ ready: () => s.value?.ready()
559
+ }), (r, f) => (E(), w("tbw-grid", {
484
560
  ref_key: "gridRef",
485
- ref: a
561
+ ref: s
486
562
  }, [
487
- $(t.$slots, "default")
563
+ $(r.$slots, "default")
488
564
  ], 512));
489
565
  }
490
- }), re = ["field", "header", "width", "min-width", "max-width", "sortable", "resizable", "editable", "type", "align", "hidden"], me = /* @__PURE__ */ f({
566
+ }), le = ["field", "header", "width", "min-width", "max-width", "sortable", "resizable", "editable", "type", "align", "hidden"], ve = /* @__PURE__ */ p({
491
567
  __name: "TbwGridColumn",
492
568
  props: {
493
569
  field: {},
@@ -502,87 +578,87 @@ const ge = /* @__PURE__ */ f({
502
578
  align: {},
503
579
  hidden: { type: Boolean }
504
580
  },
505
- setup(e) {
506
- const n = j(), o = v(null);
581
+ setup(o) {
582
+ const t = G(), e = h(null);
507
583
  return b(() => {
508
- const r = o.value;
509
- if (!r) return;
510
- const i = !!n.cell, s = !!n.editor;
511
- i && Z(r, (l) => {
512
- const d = n.cell;
584
+ const n = e.value;
585
+ if (!n) return;
586
+ const i = !!t.cell, a = !!t.editor;
587
+ i && ee(n, (l) => {
588
+ const d = t.cell;
513
589
  if (!d) return y("span");
514
- const a = d({
590
+ const s = d({
515
591
  value: l.value,
516
592
  row: l.row,
517
593
  column: l.column
518
594
  });
519
- return y("div", { style: "display: contents" }, a);
520
- }), s && ee(r, (l) => {
521
- const d = n.editor;
595
+ return y("div", { style: "display: contents" }, s);
596
+ }), a && te(n, (l) => {
597
+ const d = t.editor;
522
598
  if (!d) return y("span");
523
- const a = d({
599
+ const s = d({
524
600
  value: l.value,
525
601
  row: l.row,
526
602
  column: l.column,
527
603
  commit: l.commit,
528
604
  cancel: l.cancel
529
605
  });
530
- return y("div", { style: "display: contents" }, a);
606
+ return y("div", { style: "display: contents" }, s);
531
607
  });
532
- }), (r, i) => (h(), w("tbw-grid-column", {
608
+ }), (n, i) => (E(), w("tbw-grid-column", {
533
609
  ref_key: "columnRef",
534
- ref: o,
535
- field: e.field,
536
- header: e.header,
537
- width: e.width,
538
- "min-width": e.minWidth,
539
- "max-width": e.maxWidth,
540
- sortable: e.sortable,
541
- resizable: e.resizable,
542
- editable: e.editable,
543
- type: e.type,
544
- align: e.align,
545
- hidden: e.hidden
546
- }, null, 8, re));
610
+ ref: e,
611
+ field: o.field,
612
+ header: o.header,
613
+ width: o.width,
614
+ "min-width": o.minWidth,
615
+ "max-width": o.maxWidth,
616
+ sortable: o.sortable,
617
+ resizable: o.resizable,
618
+ editable: o.editable,
619
+ type: o.type,
620
+ align: o.align,
621
+ hidden: o.hidden
622
+ }, null, 8, le));
547
623
  }
548
- }), ie = ["show-expand-column", "animation"], pe = /* @__PURE__ */ f({
624
+ }), de = ["show-expand-column", "animation"], ye = /* @__PURE__ */ p({
549
625
  __name: "TbwGridDetailPanel",
550
626
  props: {
551
627
  showExpandColumn: { type: Boolean, default: !0 },
552
628
  animation: { type: [String, Boolean], default: "slide" }
553
629
  },
554
- setup(e) {
555
- const n = v(null), o = j();
630
+ setup(o) {
631
+ const t = h(null), e = G();
556
632
  return b(() => {
557
- const r = n.value;
558
- !r || !o.default || q.set(r, (i) => o.default?.(i));
559
- }), (r, i) => (h(), w("tbw-grid-detail", {
633
+ const n = t.value;
634
+ !n || !e.default || U.set(n, (i) => e.default?.(i));
635
+ }), (n, i) => (E(), w("tbw-grid-detail", {
560
636
  ref_key: "detailRef",
561
- ref: n,
562
- "show-expand-column": e.showExpandColumn,
563
- animation: e.animation
564
- }, null, 8, ie));
637
+ ref: t,
638
+ "show-expand-column": o.showExpandColumn,
639
+ animation: o.animation
640
+ }, null, 8, de));
565
641
  }
566
- }), ve = /* @__PURE__ */ f({
642
+ }), he = /* @__PURE__ */ p({
567
643
  __name: "TbwGridResponsiveCard",
568
- setup(e) {
569
- const n = v(null), o = j();
644
+ setup(o) {
645
+ const t = h(null), e = G();
570
646
  return b(() => {
571
- const r = n.value;
572
- !r || !o.default || U.set(r, (i) => o.default?.(i));
573
- }), (r, i) => (h(), w("tbw-grid-responsive-card", {
647
+ const n = t.value;
648
+ !n || !e.default || H.set(n, (i) => e.default?.(i));
649
+ }), (n, i) => (E(), w("tbw-grid-responsive-card", {
574
650
  ref_key: "cardRef",
575
- ref: n
651
+ ref: t
576
652
  }, null, 512));
577
653
  }
578
- }), ye = /* @__PURE__ */ f({
654
+ }), be = /* @__PURE__ */ p({
579
655
  __name: "TbwGridToolButtons",
580
- setup(e) {
581
- return (n, o) => (h(), w("tbw-grid-tool-buttons", null, [
582
- $(n.$slots, "default")
656
+ setup(o) {
657
+ return (t, e) => (E(), w("tbw-grid-tool-buttons", null, [
658
+ $(t.$slots, "default")
583
659
  ]));
584
660
  }
585
- }), le = /* @__PURE__ */ new WeakMap(), de = ["id", "label", "icon", "position", "width"], be = /* @__PURE__ */ f({
661
+ }), se = /* @__PURE__ */ new WeakMap(), ae = ["id", "label", "icon", "position", "width"], we = /* @__PURE__ */ p({
586
662
  __name: "TbwGridToolPanel",
587
663
  props: {
588
664
  id: {},
@@ -591,35 +667,35 @@ const ge = /* @__PURE__ */ f({
591
667
  position: { default: "right" },
592
668
  width: { default: "250px" }
593
669
  },
594
- setup(e) {
595
- const n = v(null), o = j();
670
+ setup(o) {
671
+ const t = h(null), e = G();
596
672
  return b(() => {
597
- const r = n.value;
598
- !r || !o.default || le.set(r, (i) => o.default?.(i));
599
- }), (r, i) => (h(), w("tbw-grid-tool-panel", {
673
+ const n = t.value;
674
+ !n || !e.default || se.set(n, (i) => e.default?.(i));
675
+ }), (n, i) => (E(), w("tbw-grid-tool-panel", {
600
676
  ref_key: "panelRef",
601
- ref: n,
602
- id: e.id,
603
- label: e.label,
604
- icon: e.icon,
605
- position: e.position,
606
- width: e.width
607
- }, null, 8, de));
677
+ ref: t,
678
+ id: o.id,
679
+ label: o.label,
680
+ icon: o.icon,
681
+ position: o.position,
682
+ width: o.width
683
+ }, null, 8, ae));
608
684
  }
609
685
  });
610
- function we(e, n, o) {
611
- const r = o ?? _(L, v(null));
686
+ function Ee(o, t, e) {
687
+ const n = e ?? D(I, h(null));
612
688
  let i = null;
613
689
  b(() => {
614
- const s = r.value;
615
- if (!s) return;
616
- const l = n;
617
- s.addEventListener(e, l), i = () => s.removeEventListener(e, l);
690
+ const a = n.value;
691
+ if (!a) return;
692
+ const l = t;
693
+ a.addEventListener(o, l), i = () => a.removeEventListener(o, l);
618
694
  }), W(() => {
619
695
  i?.();
620
696
  });
621
697
  }
622
- const he = f({
698
+ const Re = p({
623
699
  name: "GridProvider",
624
700
  props: {
625
701
  /**
@@ -637,37 +713,38 @@ const he = f({
637
713
  default: void 0
638
714
  }
639
715
  },
640
- setup(e, { slots: n }) {
716
+ setup(o, { slots: t }) {
641
717
  return () => {
642
- let o = n.default?.();
643
- return e.typeDefaults && (o = y(X, { defaults: e.typeDefaults }, () => o)), e.icons && (o = y(Q, { icons: e.icons }, () => o)), o;
718
+ let e = t.default?.();
719
+ return o.typeDefaults && (e = y(Z, { defaults: o.typeDefaults }, () => e)), o.icons && (e = y(X, { icons: o.icons }, () => e)), e;
644
720
  };
645
721
  }
646
722
  });
647
723
  export {
648
- L as GRID_ELEMENT_KEY,
649
- I as GRID_ICONS,
650
- z as GRID_TYPE_DEFAULTS,
651
- Q as GridIconProvider,
652
- he as GridProvider,
653
- X as GridTypeProvider,
724
+ I as GRID_ELEMENT_KEY,
725
+ z as GRID_ICONS,
726
+ N as GRID_TYPE_DEFAULTS,
727
+ oe as GridAdapter,
728
+ X as GridIconProvider,
729
+ Re as GridProvider,
730
+ Z as GridTypeProvider,
654
731
  ge as TbwGrid,
655
- me as TbwGridColumn,
656
- pe as TbwGridDetailPanel,
657
- ve as TbwGridResponsiveCard,
658
- ye as TbwGridToolButtons,
659
- be as TbwGridToolPanel,
660
- oe as VueGridAdapter,
661
- Ce as clearFeatureRegistry,
662
- K as createPluginFromFeature,
663
- Be as getFeatureFactory,
732
+ ve as TbwGridColumn,
733
+ ye as TbwGridDetailPanel,
734
+ he as TbwGridResponsiveCard,
735
+ be as TbwGridToolButtons,
736
+ we as TbwGridToolPanel,
737
+ ie as VueGridAdapter,
738
+ Be as clearFeatureRegistry,
739
+ J as createPluginFromFeature,
740
+ Ge as getFeatureFactory,
664
741
  Oe as getRegisteredFeatures,
665
742
  _e as isFeatureRegistered,
666
743
  je as registerFeature,
667
- fe as useGrid,
668
- we as useGridEvent,
669
- J as useGridIcons,
670
- N as useGridTypeDefaults,
671
- ue as useTypeDefault
744
+ ke as useGrid,
745
+ Ee as useGridEvent,
746
+ Q as useGridIcons,
747
+ q as useGridTypeDefaults,
748
+ me as useTypeDefault
672
749
  };
673
750
  //# sourceMappingURL=index.js.map