@toolbox-web/grid-vue 0.11.2 → 0.11.3

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/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { defineComponent as h, provide as k, inject as A, createApp as u, createVNode as V, ref as _, computed as U, onMounted as D, onBeforeUnmount as M, watch as B, createElementBlock as j, openBlock as O, renderSlot as W, useSlots as G, h as T } from "vue";
2
- import { DataGridElement as K } from "@toolbox-web/grid";
3
- import { createPluginFromFeature as Y } from "@toolbox-web/grid/features/registry";
4
- import { clearFeatureRegistry as Ve, createPluginFromFeature as Te, getFeatureFactory as _e, getRegisteredFeatures as De, isFeatureRegistered as je, registerFeature as Oe } from "@toolbox-web/grid/features/registry";
5
- import { G as x } from "./chunks/use-grid-CeVD1azo.js";
6
- import { u as Be } from "./chunks/use-grid-CeVD1azo.js";
7
- const I = /* @__PURE__ */ Symbol("grid-icons");
8
- function J() {
9
- return A(I, void 0);
1
+ import { defineComponent as y, provide as A, inject as L, createApp as u, createVNode as V, ref as B, computed as K, onMounted as _, onBeforeUnmount as W, watch as S, createElementBlock as D, openBlock as O, renderSlot as x, useSlots as G, h as T } from "vue";
2
+ import { DataGridElement as Y } from "@toolbox-web/grid";
3
+ import { createPluginFromFeature as J } from "@toolbox-web/grid/features/registry";
4
+ import { clearFeatureRegistry as Se, createPluginFromFeature as Te, getFeatureFactory as Be, getRegisteredFeatures as _e, isFeatureRegistered as De, registerFeature as Oe } from "@toolbox-web/grid/features/registry";
5
+ import { G as I } from "./chunks/use-grid-DjGoQOoZ.js";
6
+ import { u as Pe } from "./chunks/use-grid-DjGoQOoZ.js";
7
+ const z = /* @__PURE__ */ Symbol("grid-icons");
8
+ function Q() {
9
+ return L(z, void 0);
10
10
  }
11
- const Q = h({
11
+ const X = y({
12
12
  name: "GridIconProvider",
13
13
  props: {
14
14
  /**
@@ -20,16 +20,16 @@ const Q = h({
20
20
  }
21
21
  },
22
22
  setup(o, { slots: r }) {
23
- return k(I, o.icons), () => r.default?.();
23
+ return A(z, o.icons), () => r.default?.();
24
24
  }
25
- }), z = /* @__PURE__ */ Symbol("grid-type-defaults");
26
- function H() {
27
- return A(z, void 0);
25
+ }), H = /* @__PURE__ */ Symbol("grid-type-defaults");
26
+ function $() {
27
+ return L(H, void 0);
28
28
  }
29
- function fe(o) {
30
- return H()?.[o];
29
+ function me(o) {
30
+ return $()?.[o];
31
31
  }
32
- const X = h({
32
+ const Z = y({
33
33
  name: "GridTypeProvider",
34
34
  props: {
35
35
  /**
@@ -41,40 +41,40 @@ const X = h({
41
41
  }
42
42
  },
43
43
  setup(o, { slots: r }) {
44
- return k(z, o.defaults), () => r.default?.();
44
+ return A(H, o.defaults), () => r.default?.();
45
45
  }
46
- }), $ = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new Map();
47
- function Z(o, r) {
48
- const t = o.getAttribute("field"), e = v.get(o) ?? {};
49
- if (e.renderer = r, v.set(o, e), t) {
50
- const n = w.get(t) ?? {};
51
- n.renderer = r, w.set(t, n);
46
+ }), q = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new Map();
47
+ function ee(o, r) {
48
+ const t = o.getAttribute("field"), e = w.get(o) ?? {};
49
+ if (e.renderer = r, w.set(o, e), t) {
50
+ const n = b.get(t) ?? {};
51
+ n.renderer = r, b.set(t, n);
52
52
  }
53
53
  }
54
- function ee(o, r) {
55
- const t = o.getAttribute("field"), e = v.get(o) ?? {};
56
- if (e.editor = r, v.set(o, e), t) {
57
- const n = w.get(t) ?? {};
58
- n.editor = r, w.set(t, n);
54
+ function te(o, r) {
55
+ const t = o.getAttribute("field"), e = w.get(o) ?? {};
56
+ if (e.editor = r, w.set(o, e), t) {
57
+ const n = b.get(t) ?? {};
58
+ n.editor = r, b.set(t, n);
59
59
  }
60
60
  }
61
- function te(o) {
62
- let r = v.get(o)?.renderer;
61
+ function re(o) {
62
+ let r = w.get(o)?.renderer;
63
63
  if (!r) {
64
64
  const t = o.getAttribute("field");
65
- t && (r = w.get(t)?.renderer);
65
+ t && (r = b.get(t)?.renderer);
66
66
  }
67
67
  return r;
68
68
  }
69
- function re(o) {
70
- let r = v.get(o)?.editor;
69
+ function ne(o) {
70
+ let r = w.get(o)?.editor;
71
71
  if (!r) {
72
72
  const t = o.getAttribute("field");
73
- t && (r = w.get(t)?.editor);
73
+ t && (r = b.get(t)?.editor);
74
74
  }
75
75
  return r;
76
76
  }
77
- function y(o) {
77
+ function v(o) {
78
78
  if (o == null || typeof o == "function" && o.prototype === void 0)
79
79
  return !1;
80
80
  if (typeof o == "object") {
@@ -90,10 +90,10 @@ function y(o) {
90
90
  return !1;
91
91
  }
92
92
  function C(o) {
93
- return typeof o == "function" && !y(o);
93
+ return typeof o == "function" && !v(o);
94
94
  }
95
- const f = /* @__PURE__ */ Symbol.for("tbw:vue-processed");
96
- class ne {
95
+ const m = /* @__PURE__ */ Symbol.for("tbw:vue-processed");
96
+ class oe {
97
97
  mountedViews = [];
98
98
  /** Editor-specific views tracked separately for per-cell cleanup via releaseCell. */
99
99
  editorViews = [];
@@ -132,7 +132,7 @@ class ne {
132
132
  */
133
133
  processConfig(r) {
134
134
  const t = r, e = { ...t };
135
- return t.columns && (e.columns = t.columns.map((n) => this.processColumn(n))), t.typeDefaults && (e.typeDefaults = this.processTypeDefaults(t.typeDefaults)), t.loadingRenderer && (y(t.loadingRenderer) ? e.loadingRenderer = this.createComponentLoadingRenderer(
135
+ return t.columns && (e.columns = t.columns.map((n) => this.processColumn(n))), t.typeDefaults && (e.typeDefaults = this.processTypeDefaults(t.typeDefaults)), t.loadingRenderer && (v(t.loadingRenderer) ? e.loadingRenderer = this.createComponentLoadingRenderer(
136
136
  t.loadingRenderer
137
137
  ) : C(t.loadingRenderer) && (e.loadingRenderer = this.createVNodeLoadingRenderer(
138
138
  t.loadingRenderer
@@ -148,16 +148,16 @@ class ne {
148
148
  processTypeDefaults(r) {
149
149
  const t = {};
150
150
  for (const [e, n] of Object.entries(r)) {
151
- const i = {
151
+ const s = {
152
152
  editorParams: n.editorParams
153
153
  };
154
- n.renderer && (y(n.renderer) ? i.renderer = this.createConfigComponentRenderer(n.renderer) : C(n.renderer) && (i.renderer = this.createTypeRenderer(
154
+ n.renderer && (v(n.renderer) ? s.renderer = this.createConfigComponentRenderer(n.renderer) : C(n.renderer) && (s.renderer = this.createTypeRenderer(
155
155
  n.renderer
156
- ))), n.editor && (y(n.editor) ? i.editor = this.createConfigComponentEditor(
156
+ ))), n.editor && (v(n.editor) ? s.editor = this.createConfigComponentEditor(
157
157
  n.editor
158
- ) : C(n.editor) && (i.editor = this.createTypeEditor(
158
+ ) : C(n.editor) && (s.editor = this.createTypeEditor(
159
159
  n.editor
160
- ))), n.filterPanelRenderer && (i.filterPanelRenderer = this.createFilterPanelRenderer(n.filterPanelRenderer)), t[e] = i;
160
+ ))), n.filterPanelRenderer && (s.filterPanelRenderer = this.createFilterPanelRenderer(n.filterPanelRenderer)), t[e] = s;
161
161
  }
162
162
  return t;
163
163
  }
@@ -170,44 +170,44 @@ class ne {
170
170
  */
171
171
  processColumn(r) {
172
172
  const t = { ...r };
173
- if (r.renderer && !r.renderer[f]) {
174
- if (y(r.renderer)) {
173
+ if (r.renderer && !r.renderer[m]) {
174
+ if (v(r.renderer)) {
175
175
  const e = this.createConfigComponentRenderer(r.renderer);
176
- e[f] = !0, t.renderer = e;
176
+ e[m] = !0, t.renderer = e;
177
177
  } else if (C(r.renderer)) {
178
178
  const e = this.createConfigVNodeRenderer(r.renderer);
179
- e[f] = !0, t.renderer = e;
179
+ e[m] = !0, t.renderer = e;
180
180
  }
181
181
  }
182
- if (r.editor && !r.editor[f]) {
183
- if (y(r.editor)) {
182
+ if (r.editor && !r.editor[m]) {
183
+ if (v(r.editor)) {
184
184
  const e = this.createConfigComponentEditor(r.editor);
185
- e[f] = !0, t.editor = e;
185
+ e[m] = !0, t.editor = e;
186
186
  } else if (C(r.editor)) {
187
187
  const e = this.createConfigVNodeEditor(r.editor);
188
- e[f] = !0, t.editor = e;
188
+ e[m] = !0, t.editor = e;
189
189
  }
190
190
  }
191
- if (r.headerRenderer && !r.headerRenderer[f]) {
192
- if (y(r.headerRenderer)) {
191
+ if (r.headerRenderer && !r.headerRenderer[m]) {
192
+ if (v(r.headerRenderer)) {
193
193
  const e = this.createConfigComponentHeaderRenderer(r.headerRenderer);
194
- e[f] = !0, t.headerRenderer = e;
194
+ e[m] = !0, t.headerRenderer = e;
195
195
  } else if (C(r.headerRenderer)) {
196
196
  const e = this.createConfigVNodeHeaderRenderer(
197
197
  r.headerRenderer
198
198
  );
199
- e[f] = !0, t.headerRenderer = e;
199
+ e[m] = !0, t.headerRenderer = e;
200
200
  }
201
201
  }
202
- if (r.headerLabelRenderer && !r.headerLabelRenderer[f]) {
203
- if (y(r.headerLabelRenderer)) {
202
+ if (r.headerLabelRenderer && !r.headerLabelRenderer[m]) {
203
+ if (v(r.headerLabelRenderer)) {
204
204
  const e = this.createConfigComponentHeaderLabelRenderer(r.headerLabelRenderer);
205
- e[f] = !0, t.headerLabelRenderer = e;
205
+ e[m] = !0, t.headerLabelRenderer = e;
206
206
  } else if (C(r.headerLabelRenderer)) {
207
207
  const e = this.createConfigVNodeHeaderLabelRenderer(
208
208
  r.headerLabelRenderer
209
209
  );
210
- e[f] = !0, t.headerLabelRenderer = e;
210
+ e[m] = !0, t.headerLabelRenderer = e;
211
211
  }
212
212
  }
213
213
  return t;
@@ -228,27 +228,27 @@ class ne {
228
228
  const d = document.createElement("div");
229
229
  d.className = "vue-cell-renderer", d.style.display = "contents";
230
230
  let p = e;
231
- const g = r, b = u({
231
+ const g = r, R = u({
232
232
  render() {
233
233
  return V(g, { ...p });
234
234
  }
235
235
  });
236
- return b.mount(d), t.set(n, {
237
- app: b,
236
+ return R.mount(d), t.set(n, {
237
+ app: R,
238
238
  container: d,
239
239
  update: (N) => {
240
- p = N, b._instance?.update();
240
+ p = N, R._instance?.update();
241
241
  }
242
242
  }), d;
243
243
  }
244
- const i = document.createElement("div");
245
- i.className = "vue-cell-renderer", i.style.display = "contents";
246
- const s = r, a = u({
244
+ const s = document.createElement("div");
245
+ s.className = "vue-cell-renderer", s.style.display = "contents";
246
+ const i = r, l = u({
247
247
  render() {
248
- return V(s, { ...e });
248
+ return V(i, { ...e });
249
249
  }
250
250
  });
251
- return a.mount(i), this.mountedViews.push({ app: a, container: i }), i;
251
+ return l.mount(s), this.mountedViews.push({ app: l, container: s }), s;
252
252
  };
253
253
  }
254
254
  /**
@@ -261,9 +261,9 @@ class ne {
261
261
  return (e) => {
262
262
  const n = e.cellEl;
263
263
  if (n) {
264
- const a = t.get(n);
265
- if (a)
266
- return a.update(e), a.container;
264
+ const l = t.get(n);
265
+ if (l)
266
+ return l.update(e), l.container;
267
267
  const c = document.createElement("div");
268
268
  c.className = "vue-cell-renderer", c.style.display = "contents";
269
269
  let d = e;
@@ -280,14 +280,14 @@ class ne {
280
280
  }
281
281
  }), c;
282
282
  }
283
- const i = document.createElement("div");
284
- i.className = "vue-cell-renderer", i.style.display = "contents";
285
- const s = u({
283
+ const s = document.createElement("div");
284
+ s.className = "vue-cell-renderer", s.style.display = "contents";
285
+ const i = u({
286
286
  render() {
287
287
  return r(e);
288
288
  }
289
289
  });
290
- return s.mount(i), this.mountedViews.push({ app: s, container: i }), i;
290
+ return i.mount(s), this.mountedViews.push({ app: i, container: s }), s;
291
291
  };
292
292
  }
293
293
  /**
@@ -299,12 +299,12 @@ class ne {
299
299
  return (t) => {
300
300
  const e = document.createElement("div");
301
301
  e.className = "vue-cell-editor", e.style.display = "contents";
302
- const n = r, i = u({
302
+ const n = r, s = u({
303
303
  render() {
304
304
  return V(n, { ...t });
305
305
  }
306
306
  });
307
- return i.mount(e), this.editorViews.push({ app: i, container: e }), e;
307
+ return s.mount(e), this.editorViews.push({ app: s, container: e }), e;
308
308
  };
309
309
  }
310
310
  /**
@@ -333,7 +333,7 @@ class ne {
333
333
  return (t) => {
334
334
  const e = document.createElement("div");
335
335
  e.className = "vue-header-renderer", e.style.display = "contents";
336
- const n = r, i = u({
336
+ const n = r, s = u({
337
337
  render() {
338
338
  return V(n, {
339
339
  column: t.column,
@@ -345,7 +345,7 @@ class ne {
345
345
  });
346
346
  }
347
347
  });
348
- return i.mount(e), this.mountedViews.push({ app: i, container: e }), e;
348
+ return s.mount(e), this.mountedViews.push({ app: s, container: e }), e;
349
349
  };
350
350
  }
351
351
  /**
@@ -374,7 +374,7 @@ class ne {
374
374
  return (t) => {
375
375
  const e = document.createElement("div");
376
376
  e.className = "vue-header-label-renderer", e.style.display = "contents";
377
- const n = r, i = u({
377
+ const n = r, s = u({
378
378
  render() {
379
379
  return V(n, {
380
380
  column: t.column,
@@ -382,7 +382,7 @@ class ne {
382
382
  });
383
383
  }
384
384
  });
385
- return i.mount(e), this.mountedViews.push({ app: i, container: e }), e;
385
+ return s.mount(e), this.mountedViews.push({ app: s, container: e }), e;
386
386
  };
387
387
  }
388
388
  /**
@@ -410,12 +410,12 @@ class ne {
410
410
  return (t) => {
411
411
  const e = document.createElement("div");
412
412
  e.className = "vue-loading-renderer", e.style.display = "contents";
413
- const n = r, i = u({
413
+ const n = r, s = u({
414
414
  render() {
415
415
  return V(n, { size: t.size });
416
416
  }
417
417
  });
418
- return i.mount(e), this.mountedViews.push({ app: i, container: e }), e;
418
+ return s.mount(e), this.mountedViews.push({ app: s, container: e }), e;
419
419
  };
420
420
  }
421
421
  /**
@@ -450,27 +450,27 @@ class ne {
450
450
  */
451
451
  canHandle(r) {
452
452
  const t = r.getAttribute("field");
453
- let e = v.get(r);
453
+ let e = w.get(r);
454
454
  if (!e && t) {
455
- const s = w.get(t);
456
- s && (s.renderer || s.editor) && (e = s, v.set(r, e));
455
+ const i = b.get(t);
456
+ i && (i.renderer || i.editor) && (e = i, w.set(r, e));
457
457
  }
458
- const n = e?.renderer !== void 0, i = e?.editor !== void 0;
459
- return e !== void 0 && (n || i);
458
+ const n = e?.renderer !== void 0, s = e?.editor !== void 0;
459
+ return e !== void 0 && (n || s);
460
460
  }
461
461
  /**
462
462
  * Creates a view renderer function that renders a Vue component
463
463
  * and returns its container DOM element.
464
464
  */
465
465
  createRenderer(r) {
466
- const t = te(r);
466
+ const t = re(r);
467
467
  if (!t)
468
468
  return;
469
469
  const e = /* @__PURE__ */ new WeakMap();
470
470
  return (n) => {
471
- const i = n.cellEl;
472
- if (i) {
473
- const c = e.get(i);
471
+ const s = n.cellEl;
472
+ if (s) {
473
+ const c = e.get(s);
474
474
  if (c)
475
475
  return c.update(n), c.container;
476
476
  const d = document.createElement("div");
@@ -481,22 +481,22 @@ class ne {
481
481
  return t(p);
482
482
  }
483
483
  });
484
- return g.mount(d), e.set(i, {
484
+ return g.mount(d), e.set(s, {
485
485
  app: g,
486
486
  container: d,
487
- update: (b) => {
488
- p = b, g._instance?.update();
487
+ update: (R) => {
488
+ p = R, g._instance?.update();
489
489
  }
490
490
  }), d;
491
491
  }
492
- const s = document.createElement("div");
493
- s.className = "vue-cell-renderer", s.style.display = "contents";
494
- const a = u({
492
+ const i = document.createElement("div");
493
+ i.className = "vue-cell-renderer", i.style.display = "contents";
494
+ const l = u({
495
495
  render() {
496
496
  return t(n);
497
497
  }
498
498
  });
499
- return a.mount(s), this.mountedViews.push({ app: a, container: s }), s;
499
+ return l.mount(i), this.mountedViews.push({ app: l, container: i }), i;
500
500
  };
501
501
  }
502
502
  /**
@@ -504,17 +504,17 @@ class ne {
504
504
  * Returns a function that creates the editor DOM element.
505
505
  */
506
506
  createEditor(r) {
507
- const t = re(r);
507
+ const t = ne(r);
508
508
  if (t)
509
509
  return (e) => {
510
510
  const n = document.createElement("div");
511
511
  n.className = "vue-cell-editor", n.style.display = "contents";
512
- const i = u({
512
+ const s = u({
513
513
  render() {
514
514
  return t(e);
515
515
  }
516
516
  });
517
- return i.mount(n), this.editorViews.push({ app: i, container: n }), n;
517
+ return s.mount(n), this.editorViews.push({ app: s, container: n }), n;
518
518
  };
519
519
  }
520
520
  /**
@@ -526,21 +526,21 @@ class ne {
526
526
  if (!t) return;
527
527
  const e = t.querySelector("tbw-grid-detail");
528
528
  if (!e) return;
529
- const n = $.get(e);
529
+ const n = q.get(e);
530
530
  if (n)
531
- return (i, s) => {
532
- const a = document.createElement("div");
533
- a.className = "vue-detail-panel";
534
- const d = n({ row: i, rowIndex: s });
531
+ return (s, i) => {
532
+ const l = document.createElement("div");
533
+ l.className = "vue-detail-panel";
534
+ const d = n({ row: s, rowIndex: i });
535
535
  if (d && d.length > 0) {
536
536
  const p = u({
537
537
  render() {
538
538
  return d;
539
539
  }
540
540
  });
541
- p.mount(a), this.mountedViews.push({ app: p, container: a });
541
+ p.mount(l), this.mountedViews.push({ app: p, container: l });
542
542
  }
543
- return a;
543
+ return l;
544
544
  };
545
545
  }
546
546
  /**
@@ -552,21 +552,21 @@ class ne {
552
552
  if (!t) return;
553
553
  const e = t.querySelector("tbw-grid-responsive-card");
554
554
  if (!e) return;
555
- const n = q.get(e);
555
+ const n = U.get(e);
556
556
  if (n)
557
- return (i, s) => {
558
- const a = document.createElement("div");
559
- a.className = "vue-responsive-card";
560
- const d = n({ row: i, rowIndex: s });
557
+ return (s, i) => {
558
+ const l = document.createElement("div");
559
+ l.className = "vue-responsive-card";
560
+ const d = n({ row: s, rowIndex: i });
561
561
  if (d && d.length > 0) {
562
562
  const p = u({
563
563
  render() {
564
564
  return d;
565
565
  }
566
566
  });
567
- p.mount(a), this.mountedViews.push({ app: p, container: a });
567
+ p.mount(l), this.mountedViews.push({ app: p, container: l });
568
568
  }
569
- return a;
569
+ return l;
570
570
  };
571
571
  }
572
572
  // #region Type Defaults Support
@@ -652,12 +652,12 @@ class ne {
652
652
  return (t, e) => {
653
653
  const n = document.createElement("div");
654
654
  n.style.display = "contents";
655
- const i = u({
655
+ const s = u({
656
656
  render() {
657
657
  return r(e);
658
658
  }
659
659
  });
660
- i.mount(n), this.mountedViews.push({ app: i, container: n }), t.appendChild(n);
660
+ s.mount(n), this.mountedViews.push({ app: s, container: n }), t.appendChild(n);
661
661
  };
662
662
  }
663
663
  // #endregion
@@ -676,7 +676,7 @@ class ne {
676
676
  r.unmount(), t.remove();
677
677
  } catch {
678
678
  }
679
- this.editorViews = [], w.clear();
679
+ this.editorViews = [], b.clear();
680
680
  }
681
681
  /**
682
682
  * Unmount a specific container (e.g., detail panel, tool panel).
@@ -713,7 +713,7 @@ class ne {
713
713
  }
714
714
  }
715
715
  }
716
- const oe = ne, me = /* @__PURE__ */ h({
716
+ const ie = oe, ge = /* @__PURE__ */ y({
717
717
  __name: "TbwGrid",
718
718
  props: {
719
719
  /** Row data to display */
@@ -737,6 +737,54 @@ const oe = ne, me = /* @__PURE__ */ h({
737
737
  default: void 0
738
738
  },
739
739
  // ═══════════════════════════════════════════════════════════════════
740
+ // GRID-WIDE TOGGLES
741
+ // ═══════════════════════════════════════════════════════════════════
742
+ /**
743
+ * Grid-wide sorting toggle.
744
+ * When false, disables sorting for all columns regardless of their individual `sortable` setting.
745
+ * @default true
746
+ */
747
+ sortable: {
748
+ type: Boolean,
749
+ default: void 0
750
+ },
751
+ /**
752
+ * Grid-wide filtering toggle.
753
+ * When false, disables filtering for all columns regardless of their individual `filterable` setting.
754
+ * Requires the FilteringPlugin to be loaded (via `filtering` prop or feature import).
755
+ * @default true
756
+ */
757
+ filterable: {
758
+ type: Boolean,
759
+ default: void 0
760
+ },
761
+ /**
762
+ * Grid-wide selection toggle.
763
+ * When false, disables selection for all rows/cells.
764
+ * Requires the SelectionPlugin to be loaded (via `selection` prop or feature import).
765
+ * @default true
766
+ */
767
+ selectable: {
768
+ type: Boolean,
769
+ default: void 0
770
+ },
771
+ /**
772
+ * Show a loading overlay on the grid.
773
+ * Use this during initial data fetch or refresh operations.
774
+ * @default false
775
+ */
776
+ loading: {
777
+ type: Boolean,
778
+ default: void 0
779
+ },
780
+ /**
781
+ * Custom CSS styles to inject into the grid via `document.adoptedStyleSheets`.
782
+ */
783
+ customStyles: {
784
+ type: String,
785
+ default: void 0
786
+ },
787
+ // ═══════════════════════════════════════════════════════════════════
740
788
  // FEATURE PROPS - Declarative plugin configuration
741
789
  // ═══════════════════════════════════════════════════════════════════
742
790
  /** Enable cell/row/range selection */
@@ -870,20 +918,21 @@ const oe = ne, me = /* @__PURE__ */ h({
870
918
  default: void 0
871
919
  }
872
920
  },
873
- emits: ["cell-click", "row-click", "cell-activate", "cell-change", "cell-commit", "row-commit", "sort-change", "filter-change", "column-resize", "column-move", "column-visibility", "column-state-change", "selection-change", "row-move", "group-toggle", "tree-expand", "detail-expand", "responsive-change", "copy", "paste", "undo-redo", "export-complete", "print-start", "print-complete"],
921
+ emits: ["cell-click", "row-click", "cell-activate", "cell-change", "cell-commit", "row-commit", "changed-rows-reset", "sort-change", "filter-change", "column-resize", "column-move", "column-visibility", "column-state-change", "selection-change", "row-move", "group-toggle", "tree-expand", "detail-expand", "responsive-change", "copy", "paste", "undo-redo", "export-complete", "print-start", "print-complete"],
874
922
  setup(o, { expose: r, emit: t }) {
875
923
  let e = !1, n = null;
876
- function i() {
877
- return e || (n = new oe(), K.registerAdapter(n), e = !0), n;
924
+ function s() {
925
+ return e || (n = new ie(), Y.registerAdapter(n), e = !0), n;
878
926
  }
879
- i();
880
- const s = o, a = {
927
+ s();
928
+ const i = o, l = {
881
929
  "cell-click": "",
882
930
  "row-click": "",
883
931
  "cell-activate": "",
884
932
  "cell-change": "",
885
933
  "cell-commit": "",
886
934
  "row-commit": "",
935
+ "changed-rows-reset": "",
887
936
  "sort-change": "",
888
937
  "filter-change": "",
889
938
  "column-resize": "",
@@ -902,9 +951,9 @@ const oe = ne, me = /* @__PURE__ */ h({
902
951
  "export-complete": "",
903
952
  "print-start": "",
904
953
  "print-complete": ""
905
- }, c = t, d = _(null);
906
- k(x, d);
907
- const p = H(), g = J(), b = [
954
+ }, c = t, d = B(null);
955
+ A(I, d);
956
+ const p = $(), g = Q(), R = [
908
957
  "selection",
909
958
  "editing",
910
959
  "clipboard",
@@ -935,56 +984,74 @@ const oe = ne, me = /* @__PURE__ */ h({
935
984
  "tooltip"
936
985
  ];
937
986
  function N() {
938
- const l = [];
939
- for (const m of b) {
940
- const R = s[m];
941
- if (R !== void 0) {
942
- const E = Y(m, R);
943
- E && l.push(E);
987
+ const a = [];
988
+ for (const f of R) {
989
+ const h = i[f];
990
+ if (h !== void 0) {
991
+ const E = J(f, h);
992
+ E && a.push(E);
944
993
  }
945
994
  }
946
- return l;
995
+ return a;
947
996
  }
948
- const S = U(() => {
949
- const l = s.gridConfig ?? {}, m = N(), R = l.plugins ?? [], E = [...m, ...R], P = g ? { ...l.icons, ...g } : l.icons;
950
- return {
951
- ...l,
952
- ...s.columns ? { columns: s.columns } : {},
997
+ const F = K(() => {
998
+ const a = i.gridConfig ?? {}, f = N(), h = a.plugins ?? [], E = [...f, ...h], j = g ? { ...a.icons, ...g } : a.icons, P = {};
999
+ return i.sortable !== void 0 && (P.sortable = i.sortable), i.filterable !== void 0 && (P.filterable = i.filterable), i.selectable !== void 0 && (P.selectable = i.selectable), {
1000
+ ...a,
1001
+ ...P,
1002
+ ...i.columns ? { columns: i.columns } : {},
953
1003
  ...E.length > 0 ? { plugins: E } : {},
954
- ...P ? { icons: P } : {}
1004
+ ...j ? { icons: j } : {}
955
1005
  };
956
- }), F = [];
957
- return D(() => {
958
- const l = d.value;
959
- if (!l) return;
960
- const m = i();
961
- l.__frameworkAdapter = m, m.setTypeDefaults(p ?? null);
962
- for (const R of Object.keys(a))
963
- F.push(l.on(R, (E, P) => c(R, P)));
964
- s.rows.length > 0 && (l.rows = s.rows), S.value && (l.gridConfig = S.value), s.fitMode && (l.fitMode = s.fitMode);
965
- }), M(() => {
966
- d.value && (F.forEach((m) => m()), F.length = 0);
967
- }), B(
968
- () => s.rows,
969
- (l) => {
970
- d.value && (d.value.rows = l);
1006
+ }), k = [];
1007
+ return _(() => {
1008
+ const a = d.value;
1009
+ if (!a) return;
1010
+ const f = s();
1011
+ a.__frameworkAdapter = f, f.setTypeDefaults(p ?? null);
1012
+ for (const h of Object.keys(l))
1013
+ k.push(a.on(h, (E, j) => c(h, j)));
1014
+ i.rows.length > 0 && (a.rows = i.rows), F.value && (a.gridConfig = F.value), i.fitMode && (a.fitMode = i.fitMode), i.loading !== void 0 && (a.loading = i.loading), i.customStyles && a.ready?.().then(() => {
1015
+ d.value && d.value.registerStyles?.("vue-custom-styles", i.customStyles);
1016
+ });
1017
+ }), W(() => {
1018
+ const a = d.value;
1019
+ a && (i.customStyles && a.unregisterStyles?.("vue-custom-styles"), k.forEach((f) => f()), k.length = 0);
1020
+ }), S(
1021
+ () => i.rows,
1022
+ (a) => {
1023
+ d.value && (d.value.rows = a);
971
1024
  },
972
1025
  { deep: !0 }
973
- ), B(
974
- S,
975
- (l) => {
976
- d.value && l && (d.value.gridConfig = l);
1026
+ ), S(
1027
+ F,
1028
+ (a) => {
1029
+ d.value && a && (d.value.gridConfig = a);
977
1030
  },
978
1031
  { deep: !0 }
979
- ), B(
980
- () => s.fitMode,
981
- (l) => {
982
- d.value && l && (d.value.fitMode = l);
1032
+ ), S(
1033
+ () => i.fitMode,
1034
+ (a) => {
1035
+ d.value && a && (d.value.fitMode = a);
983
1036
  }
984
- ), B(
1037
+ ), S(
1038
+ () => i.loading,
1039
+ (a) => {
1040
+ d.value && a !== void 0 && (d.value.loading = a);
1041
+ }
1042
+ ), S(
1043
+ () => i.customStyles,
1044
+ (a, f) => {
1045
+ if (!d.value) return;
1046
+ const h = d.value;
1047
+ f && !a ? h.unregisterStyles?.("vue-custom-styles") : a && h.ready?.().then(() => {
1048
+ d.value && d.value.registerStyles?.("vue-custom-styles", a);
1049
+ });
1050
+ }
1051
+ ), S(
985
1052
  () => p,
986
- (l) => {
987
- i().setTypeDefaults(l ?? null);
1053
+ (a) => {
1054
+ s().setTypeDefaults(a ?? null);
988
1055
  },
989
1056
  { deep: !0 }
990
1057
  ), r({
@@ -996,14 +1063,14 @@ const oe = ne, me = /* @__PURE__ */ h({
996
1063
  getConfig: () => d.value?.getConfig(),
997
1064
  /** Wait for grid to be ready */
998
1065
  ready: () => d.value?.ready()
999
- }), (l, m) => (O(), j("tbw-grid", {
1066
+ }), (a, f) => (O(), D("tbw-grid", {
1000
1067
  ref_key: "gridRef",
1001
1068
  ref: d
1002
1069
  }, [
1003
- W(l.$slots, "default")
1070
+ x(a.$slots, "default")
1004
1071
  ], 512));
1005
1072
  }
1006
- }), ie = ["field", "header", "width", "min-width", "max-width", "sortable", "resizable", "editable", "type", "align", "hidden"], ge = /* @__PURE__ */ h({
1073
+ }), se = ["field", "header", "width", "min-width", "max-width", "sortable", "resizable", "editable", "type", "align", "hidden"], he = /* @__PURE__ */ y({
1007
1074
  __name: "TbwGridColumn",
1008
1075
  props: {
1009
1076
  field: {},
@@ -1019,37 +1086,37 @@ const oe = ne, me = /* @__PURE__ */ h({
1019
1086
  hidden: { type: Boolean }
1020
1087
  },
1021
1088
  setup(o) {
1022
- const r = G(), t = _(null);
1023
- return D(() => {
1089
+ const r = G(), t = B(null);
1090
+ return _(() => {
1024
1091
  const e = t.value;
1025
1092
  if (!e) return;
1026
- const n = !!r.cell, i = !!r.editor;
1027
- n && Z(e, (s) => {
1028
- const a = r.cell;
1029
- if (!a) return T("span");
1030
- const c = a({
1031
- value: s.value,
1032
- row: s.row,
1033
- column: s.column
1093
+ const n = !!r.cell, s = !!r.editor;
1094
+ n && ee(e, (i) => {
1095
+ const l = r.cell;
1096
+ if (!l) return T("span");
1097
+ const c = l({
1098
+ value: i.value,
1099
+ row: i.row,
1100
+ column: i.column
1034
1101
  });
1035
1102
  return T("div", { style: "display: contents" }, c);
1036
- }), i && ee(e, (s) => {
1037
- const a = r.editor;
1038
- if (!a) return T("span");
1039
- const c = a({
1040
- value: s.value,
1041
- row: s.row,
1042
- column: s.column,
1043
- field: s.field,
1044
- rowId: s.rowId ?? "",
1045
- commit: s.commit,
1046
- cancel: s.cancel,
1047
- updateRow: s.updateRow,
1048
- onValueChange: s.onValueChange
1103
+ }), s && te(e, (i) => {
1104
+ const l = r.editor;
1105
+ if (!l) return T("span");
1106
+ const c = l({
1107
+ value: i.value,
1108
+ row: i.row,
1109
+ column: i.column,
1110
+ field: i.field,
1111
+ rowId: i.rowId ?? "",
1112
+ commit: i.commit,
1113
+ cancel: i.cancel,
1114
+ updateRow: i.updateRow,
1115
+ onValueChange: i.onValueChange
1049
1116
  });
1050
1117
  return T("div", { style: "display: contents" }, c);
1051
1118
  });
1052
- }), (e, n) => (O(), j("tbw-grid-column", {
1119
+ }), (e, n) => (O(), D("tbw-grid-column", {
1053
1120
  ref_key: "columnRef",
1054
1121
  ref: t,
1055
1122
  field: o.field,
@@ -1063,46 +1130,46 @@ const oe = ne, me = /* @__PURE__ */ h({
1063
1130
  type: o.type,
1064
1131
  align: o.align,
1065
1132
  hidden: o.hidden
1066
- }, null, 8, ie));
1133
+ }, null, 8, se));
1067
1134
  }
1068
- }), se = ["show-expand-column", "animation"], he = /* @__PURE__ */ h({
1135
+ }), de = ["show-expand-column", "animation"], ye = /* @__PURE__ */ y({
1069
1136
  __name: "TbwGridDetailPanel",
1070
1137
  props: {
1071
1138
  showExpandColumn: { type: Boolean, default: !0 },
1072
1139
  animation: { type: [String, Boolean], default: "slide" }
1073
1140
  },
1074
1141
  setup(o) {
1075
- const r = _(null), t = G();
1076
- return D(() => {
1142
+ const r = B(null), t = G();
1143
+ return _(() => {
1077
1144
  const e = r.value;
1078
- !e || !t.default || $.set(e, (n) => t.default?.(n));
1079
- }), (e, n) => (O(), j("tbw-grid-detail", {
1145
+ !e || !t.default || q.set(e, (n) => t.default?.(n));
1146
+ }), (e, n) => (O(), D("tbw-grid-detail", {
1080
1147
  ref_key: "detailRef",
1081
1148
  ref: r,
1082
1149
  "show-expand-column": o.showExpandColumn,
1083
1150
  animation: o.animation
1084
- }, null, 8, se));
1151
+ }, null, 8, de));
1085
1152
  }
1086
- }), ye = /* @__PURE__ */ h({
1153
+ }), ve = /* @__PURE__ */ y({
1087
1154
  __name: "TbwGridResponsiveCard",
1088
1155
  setup(o) {
1089
- const r = _(null), t = G();
1090
- return D(() => {
1156
+ const r = B(null), t = G();
1157
+ return _(() => {
1091
1158
  const e = r.value;
1092
- !e || !t.default || q.set(e, (n) => t.default?.(n));
1093
- }), (e, n) => (O(), j("tbw-grid-responsive-card", {
1159
+ !e || !t.default || U.set(e, (n) => t.default?.(n));
1160
+ }), (e, n) => (O(), D("tbw-grid-responsive-card", {
1094
1161
  ref_key: "cardRef",
1095
1162
  ref: r
1096
1163
  }, null, 512));
1097
1164
  }
1098
- }), ve = /* @__PURE__ */ h({
1165
+ }), we = /* @__PURE__ */ y({
1099
1166
  __name: "TbwGridToolButtons",
1100
1167
  setup(o) {
1101
- return (r, t) => (O(), j("tbw-grid-tool-buttons", null, [
1102
- W(r.$slots, "default")
1168
+ return (r, t) => (O(), D("tbw-grid-tool-buttons", null, [
1169
+ x(r.$slots, "default")
1103
1170
  ]));
1104
1171
  }
1105
- }), de = /* @__PURE__ */ new WeakMap(), ae = ["id", "label", "icon", "position", "width"], we = /* @__PURE__ */ h({
1172
+ }), ae = /* @__PURE__ */ new WeakMap(), le = ["id", "label", "icon", "position", "width"], be = /* @__PURE__ */ y({
1106
1173
  __name: "TbwGridToolPanel",
1107
1174
  props: {
1108
1175
  id: {},
@@ -1112,11 +1179,11 @@ const oe = ne, me = /* @__PURE__ */ h({
1112
1179
  width: { default: "250px" }
1113
1180
  },
1114
1181
  setup(o) {
1115
- const r = _(null), t = G();
1116
- return D(() => {
1182
+ const r = B(null), t = G();
1183
+ return _(() => {
1117
1184
  const e = r.value;
1118
- !e || !t.default || de.set(e, (n) => t.default?.(n));
1119
- }), (e, n) => (O(), j("tbw-grid-tool-panel", {
1185
+ !e || !t.default || ae.set(e, (n) => t.default?.(n));
1186
+ }), (e, n) => (O(), D("tbw-grid-tool-panel", {
1120
1187
  ref_key: "panelRef",
1121
1188
  ref: r,
1122
1189
  id: o.id,
@@ -1124,29 +1191,29 @@ const oe = ne, me = /* @__PURE__ */ h({
1124
1191
  icon: o.icon,
1125
1192
  position: o.position,
1126
1193
  width: o.width
1127
- }, null, 8, ae));
1194
+ }, null, 8, le));
1128
1195
  }
1129
1196
  });
1130
- let L = !1;
1131
- function be(o, r, t) {
1132
- !L && typeof window < "u" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.includes(".local")) && (L = !0, console.warn(
1197
+ let M = !1;
1198
+ function Re(o, r, t) {
1199
+ !M && typeof window < "u" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.includes(".local")) && (M = !0, console.warn(
1133
1200
  `[useGridEvent] Deprecated: Use @event handlers directly on <TbwGrid> instead.
1134
1201
  Example: <TbwGrid @selection-change="handler" />
1135
1202
  See migration guide: https://toolboxjs.com/grid-vue/migration`
1136
1203
  ));
1137
- const e = t ?? A(x, _(null));
1204
+ const e = t ?? L(I, B(null));
1138
1205
  let n = null;
1139
- D(() => {
1140
- const i = e.value;
1141
- i && (n = i.on(
1206
+ _(() => {
1207
+ const s = e.value;
1208
+ s && (n = s.on(
1142
1209
  o,
1143
- (s, a) => r(a)
1210
+ (i, l) => r(l)
1144
1211
  ));
1145
- }), M(() => {
1212
+ }), W(() => {
1146
1213
  n?.();
1147
1214
  });
1148
1215
  }
1149
- const Re = h({
1216
+ const Ce = y({
1150
1217
  name: "GridProvider",
1151
1218
  props: {
1152
1219
  /**
@@ -1169,42 +1236,42 @@ const Re = h({
1169
1236
  let t = r.default?.();
1170
1237
  if (o.typeDefaults) {
1171
1238
  const e = t;
1172
- t = T(X, { defaults: o.typeDefaults }, () => e);
1239
+ t = T(Z, { defaults: o.typeDefaults }, () => e);
1173
1240
  }
1174
1241
  if (o.icons) {
1175
1242
  const e = t;
1176
- t = T(Q, { icons: o.icons }, () => e);
1243
+ t = T(X, { icons: o.icons }, () => e);
1177
1244
  }
1178
1245
  return t;
1179
1246
  };
1180
1247
  }
1181
1248
  });
1182
1249
  export {
1183
- x as GRID_ELEMENT_KEY,
1184
- I as GRID_ICONS,
1185
- z as GRID_TYPE_DEFAULTS,
1186
- ne as GridAdapter,
1187
- Q as GridIconProvider,
1188
- Re as GridProvider,
1189
- X as GridTypeProvider,
1190
- me as TbwGrid,
1191
- ge as TbwGridColumn,
1192
- he as TbwGridDetailPanel,
1193
- ye as TbwGridResponsiveCard,
1194
- ve as TbwGridToolButtons,
1195
- we as TbwGridToolPanel,
1196
- oe as VueGridAdapter,
1197
- Ve as clearFeatureRegistry,
1250
+ I as GRID_ELEMENT_KEY,
1251
+ z as GRID_ICONS,
1252
+ H as GRID_TYPE_DEFAULTS,
1253
+ oe as GridAdapter,
1254
+ X as GridIconProvider,
1255
+ Ce as GridProvider,
1256
+ Z as GridTypeProvider,
1257
+ ge as TbwGrid,
1258
+ he as TbwGridColumn,
1259
+ ye as TbwGridDetailPanel,
1260
+ ve as TbwGridResponsiveCard,
1261
+ we as TbwGridToolButtons,
1262
+ be as TbwGridToolPanel,
1263
+ ie as VueGridAdapter,
1264
+ Se as clearFeatureRegistry,
1198
1265
  Te as createPluginFromFeature,
1199
- _e as getFeatureFactory,
1200
- De as getRegisteredFeatures,
1201
- je as isFeatureRegistered,
1202
- y as isVueComponent,
1266
+ Be as getFeatureFactory,
1267
+ _e as getRegisteredFeatures,
1268
+ De as isFeatureRegistered,
1269
+ v as isVueComponent,
1203
1270
  Oe as registerFeature,
1204
- Be as useGrid,
1205
- be as useGridEvent,
1206
- J as useGridIcons,
1207
- H as useGridTypeDefaults,
1208
- fe as useTypeDefault
1271
+ Pe as useGrid,
1272
+ Re as useGridEvent,
1273
+ Q as useGridIcons,
1274
+ $ as useGridTypeDefaults,
1275
+ me as useTypeDefault
1209
1276
  };
1210
1277
  //# sourceMappingURL=index.js.map