@revolist/vue3-datagrid 4.32.0 → 4.32.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -564,3 +564,27 @@ MIT
564
564
  See [component templates](./component-templates.md) for `useTemplates`,
565
565
  typed content integration with cells, master details,
566
566
  Kanban cards, and Gantt bars. Existing `VGridVueTemplate` remains supported.
567
+
568
+ ### Custom grid controls
569
+
570
+ `GridControlsProvider` supplies its ready grid to descendant components. `useGridControls()` returns a readonly reactive reference containing the current grid, or `null` while it is unavailable. Watch the reference to subscribe to events, and clean up listeners when it changes.
571
+
572
+ ```vue
573
+ <script setup lang="ts">
574
+ import {
575
+ GridControlsProvider,
576
+ VGrid,
577
+ useGridControls,
578
+ } from "@revolist/vue3-datagrid";
579
+ // Call useGridControls() in a descendant component's setup function.
580
+ </script>
581
+
582
+ <template>
583
+ <GridControlsProvider>
584
+ <MyControl />
585
+ <VGrid :columns="columns" :source="rows" />
586
+ </GridControlsProvider>
587
+ </template>
588
+ ```
589
+
590
+ Use `GridControl` with a `GridControlMount` callback when mounting an imperative control. Each provider owns one grid, and nested providers are independent.
package/dist/index.d.ts CHANGED
@@ -2,15 +2,25 @@ import { ColumnDataSchemaModel } from '@revolist/revogrid';
2
2
  import { ColumnTemplateProp } from '@revolist/revogrid';
3
3
  import { Component } from 'vue';
4
4
  import { ComponentInternalInstance } from 'vue';
5
+ import { ComponentOptionsMixin } from 'vue';
6
+ import { ComponentProvideOptions } from 'vue';
5
7
  import { ComponentPublicInstance } from 'vue';
8
+ import { ComputedRef } from 'vue';
6
9
  import { createVNode } from 'vue';
10
+ import { DefineComponent } from 'vue';
7
11
  import { DefineSetupFnComponent } from 'vue';
8
12
  import { EditCell } from '@revolist/revogrid';
9
13
  import { EditorCtr } from '@revolist/revogrid';
14
+ import { ExtractPropTypes } from 'vue';
15
+ import { GridControlMount } from '@revolist/revogrid';
10
16
  import { HyperFunc } from '@revolist/revogrid';
11
17
  import { JSX } from '@revolist/revogrid';
18
+ import { PropType } from 'vue';
12
19
  import { PublicProps } from 'vue';
20
+ import { RendererElement } from 'vue';
21
+ import { RendererNode } from 'vue';
13
22
  import { VNode } from '@revolist/revogrid';
23
+ import { VNode as VNode_2 } from 'vue';
14
24
 
15
25
  declare type CreateVNodeParameters = (Parameters<typeof createVNode>)[0];
16
26
 
@@ -23,10 +33,41 @@ export declare interface EditorType extends Partial<EditCell> {
23
33
  close: (focusNext?: boolean) => void;
24
34
  }
25
35
 
36
+ export declare const GridControl: DefineComponent<ExtractPropTypes< {
37
+ grid: {
38
+ type: PropType<HTMLRevoGridElement | null | undefined>;
39
+ default: any;
40
+ };
41
+ mount: {
42
+ type: PropType<GridControlMount>;
43
+ required: true;
44
+ };
45
+ }>, () => VNode_2<RendererNode, RendererElement, {
46
+ [key: string]: any;
47
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
48
+ grid: {
49
+ type: PropType<HTMLRevoGridElement | null | undefined>;
50
+ default: any;
51
+ };
52
+ mount: {
53
+ type: PropType<GridControlMount>;
54
+ required: true;
55
+ };
56
+ }>> & Readonly<{}>, {
57
+ grid: HTMLRevoGridElement;
58
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
59
+
60
+ export declare const GridControlsProvider: DefineComponent< {}, () => VNode_2<RendererNode, RendererElement, {
61
+ [key: string]: any;
62
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
63
+
26
64
  declare interface InputProps<T> {
27
65
  modelValue?: T;
28
66
  }
29
67
 
68
+ /** Read the ready grid in the nearest provider as a readonly reactive value. */
69
+ export declare function useGridControls(): ComputedRef<HTMLRevoGridElement | null>;
70
+
30
71
  /** Bind the existing template factory for use on any content surface. */
31
72
  export declare function useTemplates(): {
32
73
  template<C>(component: Component, options?: Parameters<typeof VGridVueTemplate<C>>[2]): (h: HyperFunc<VNode>, p: C, addition?: any) => VNode;
@@ -1,54 +1,55 @@
1
- import { defineComponent as I, ref as _, getCurrentInstance as p, inject as O, h as z, createVNode as S, render as R, defineAsyncComponent as D } from "vue";
2
- import { defineCustomElements as L } from "@revolist/revogrid/loader";
1
+ import { defineComponent as y, ref as M, getCurrentInstance as m, inject as _, h as C, createVNode as L, render as V, shallowRef as g, provide as N, onMounted as I, onBeforeUnmount as O, watch as U, computed as F, defineAsyncComponent as X } from "vue";
2
+ import { defineCustomElements as $ } from "@revolist/revogrid/loader";
3
3
  export * from "@revolist/revogrid/loader";
4
+ import { observeScopedGrid as B, mountGridControl as W } from "@revolist/revogrid";
4
5
  export * from "@revolist/revogrid";
5
- const g = "routerLink", w = "navManager", M = "router", G = "aria", m = /* @__PURE__ */ Symbol(), V = { default: m }, k = (t) => t?.split(" ") || [], N = (t, r, n = []) => [...Array.from(t.value?.classList || []), ...n].filter(
6
- (o, a, e) => !r.has(o) && e.indexOf(o) === a
7
- ), U = (t, r, n = [], o, a) => {
8
- const e = I((s, { attrs: c, slots: u, emit: v }) => {
9
- s[o];
10
- const y = _(), C = new Set(k(c.class)), b = p()?.appContext?.provides[w] ? O(w) : void 0, A = (d) => {
11
- const { routerLink: h } = s;
12
- if (h !== m)
13
- if (b !== void 0) {
6
+ const v = "routerLink", k = "navManager", Y = "router", H = "aria", p = /* @__PURE__ */ Symbol(), T = { default: p }, A = (e) => e?.split(" ") || [], K = (e, r, t = []) => [...Array.from(e.value?.classList || []), ...t].filter(
7
+ (n, s, o) => !r.has(n) && o.indexOf(n) === s
8
+ ), j = (e, r, t = [], n, s) => {
9
+ const o = y((i, { attrs: c, slots: u, emit: b }) => {
10
+ i[n];
11
+ const E = M(), R = new Set(A(c.class)), w = m()?.appContext?.provides[k] ? _(k) : void 0, D = (d) => {
12
+ const { routerLink: h } = i;
13
+ if (h !== p)
14
+ if (w !== void 0) {
14
15
  d.preventDefault();
15
16
  let l = { event: d };
16
- for (const f in s) {
17
- const i = s[f];
18
- s.hasOwnProperty(f) && f.startsWith(M) && i !== m && (l[f] = i);
17
+ for (const f in i) {
18
+ const a = i[f];
19
+ i.hasOwnProperty(f) && f.startsWith(Y) && a !== p && (l[f] = a);
19
20
  }
20
- b.navigate(l);
21
+ w.navigate(l);
21
22
  } else
22
23
  console.warn("Tried to navigate, but no router was found. Make sure you have mounted Vue Router.");
23
24
  };
24
25
  return () => {
25
- s[o], k(c.class).forEach((i) => {
26
- C.add(i);
26
+ i[n], A(c.class).forEach((a) => {
27
+ R.add(a);
27
28
  });
28
- const d = s.onClick, h = (i) => {
29
- d !== void 0 && d(i), i.defaultPrevented || A(i);
29
+ const d = i.onClick, h = (a) => {
30
+ d !== void 0 && d(a), a.defaultPrevented || D(a);
30
31
  };
31
32
  let l = {
32
- ref: y,
33
- class: N(y, C),
33
+ ref: E,
34
+ class: K(E, R),
34
35
  onClick: h
35
36
  };
36
- for (const i in s) {
37
- const E = s[i];
38
- (s.hasOwnProperty(i) && E !== m || i.startsWith(G)) && (l[i] = E);
37
+ for (const a in i) {
38
+ const P = i[a];
39
+ (i.hasOwnProperty(a) && P !== p || a.startsWith(H)) && (l[a] = P);
39
40
  }
40
- return s[g] !== m && (l = {
41
+ return i[v] !== p && (l = {
41
42
  ...l,
42
- href: s[g]
43
- }), z(t, l, u.default && u.default());
43
+ href: i[v]
44
+ }), C(e, l, u.default && u.default());
44
45
  };
45
46
  });
46
- return typeof e != "function" && (e.name = t, e.props = {
47
- [g]: V
48
- }, n.forEach((s) => {
49
- e.props[s] = V;
50
- })), e;
51
- }, F = /* @__PURE__ */ U("revo-grid", void 0, [
47
+ return typeof o != "function" && (o.name = e, o.props = {
48
+ [v]: T
49
+ }, t.forEach((i) => {
50
+ o.props[i] = T;
51
+ })), o;
52
+ }, q = /* @__PURE__ */ j("revo-grid", void 0, [
52
53
  "rowHeaders",
53
54
  "frameSize",
54
55
  "rowSize",
@@ -135,33 +136,33 @@ const g = "routerLink", w = "navManager", M = "router", G = "aria", m = /* @__PU
135
136
  "afterthemechanged",
136
137
  "created"
137
138
  ]);
138
- function P(t, r) {
139
- r?.appContext && (t.appContext = r.appContext);
139
+ function G(e, r) {
140
+ r?.appContext && (e.appContext = r.appContext);
140
141
  }
141
- const x = (t, r, n, o, a = null) => {
142
+ const S = (e, r, t, n, s = null) => {
142
143
  if (!r)
143
- return a?.destroy?.(), { vueInstance: null, destroy: () => null, el: null };
144
- let e = r._vnode;
145
- if (e) {
146
- P(e, o);
147
- for (const c in n)
148
- e.component.props[c] = n[c];
144
+ return s?.destroy?.(), { vueInstance: null, destroy: () => null, el: null };
145
+ let o = r._vnode;
146
+ if (o) {
147
+ G(o, n);
148
+ for (const c in t)
149
+ o.component.props[c] = t[c];
149
150
  } else
150
- e = S(t, n), P(e, o), R(e, r);
151
- return { vueInstance: e, destroy: () => R(null, r), el: r };
152
- }, X = (t, r, n, o = p()) => (a, e, s) => {
153
- const c = n?.props ? n.props(e) : { ...r, ...e, addition: s };
151
+ o = L(e, t), G(o, n), V(o, r);
152
+ return { vueInstance: o, destroy: () => V(null, r), el: r };
153
+ }, J = (e, r, t, n = m()) => (s, o, i) => {
154
+ const c = t?.props ? t.props(o) : { ...r, ...o, addition: i };
154
155
  let u = null;
155
- return a("span", {
156
- key: n?.key?.(e) ?? `${e.prop}-${e.rowIndex || 0}`,
157
- ref: (v) => {
158
- u = x(t, v, c, o, u);
156
+ return s("span", {
157
+ key: t?.key?.(o) ?? `${o.prop}-${o.rowIndex || 0}`,
158
+ ref: (b) => {
159
+ u = S(e, b, c, n, u);
159
160
  }
160
161
  });
161
162
  };
162
- class $ {
163
- constructor(r, n, o, a, e) {
164
- this.VueEditorConstructor = r, this.column = n, this.save = o, this.close = a, this.vInstance = e, this.element = null;
163
+ class Q {
164
+ constructor(r, t, n, s, o) {
165
+ this.VueEditorConstructor = r, this.column = t, this.save = n, this.close = s, this.vInstance = o, this.element = null;
165
166
  }
166
167
  // optional, called after editor rendered
167
168
  componentDidRender() {
@@ -173,53 +174,110 @@ class $ {
173
174
  render(r) {
174
175
  return r("span", {
175
176
  key: `${this.column.prop}-${this.editCell?.rowIndex || 0}`,
176
- ref: (n) => {
177
- const o = {
177
+ ref: (t) => {
178
+ const n = {
178
179
  ...this.editCell,
179
180
  column: this.column,
180
181
  save: this.save,
181
182
  close: this.close
182
183
  };
183
- this.vueEl = x(
184
+ this.vueEl = S(
184
185
  this.VueEditorConstructor,
186
+ t,
185
187
  n,
186
- o,
187
188
  this.vInstance
188
189
  );
189
190
  }
190
191
  });
191
192
  }
192
193
  }
193
- const j = (t) => {
194
- const r = p();
195
- return function(n, o, a) {
196
- return new $(
194
+ const ie = (e) => {
195
+ const r = m();
196
+ return function(t, n, s) {
197
+ return new Q(
198
+ e,
197
199
  t,
198
200
  n,
199
- o,
200
- a,
201
+ s,
201
202
  r
202
203
  );
203
204
  };
204
205
  };
205
- function q() {
206
- const t = p();
206
+ function ae() {
207
+ const e = m();
207
208
  return {
208
- template(r, n) {
209
- const o = { ...n, props: n?.props ?? ((a) => ({ context: a })) };
210
- return X(r, void 0, o, t);
209
+ template(r, t) {
210
+ const n = { ...t, props: t?.props ?? ((s) => ({ context: s })) };
211
+ return J(r, void 0, n, e);
211
212
  }
212
213
  };
213
214
  }
214
- function W(t) {
215
- return !!t && (typeof t == "object" || typeof t == "function") && typeof t.then == "function";
215
+ const z = /* @__PURE__ */ Symbol(
216
+ "RevoGrid controls scope"
217
+ );
218
+ function Z() {
219
+ const e = _(z, void 0);
220
+ return F(() => e?.value ?? null);
216
221
  }
217
- const T = L?.(), J = D(async () => (W(T) && await T, F));
222
+ const ce = y({
223
+ name: "GridControlsProvider",
224
+ inheritAttrs: !1,
225
+ setup(e, { slots: r }) {
226
+ const t = g(null), n = g(null);
227
+ N(z, t);
228
+ let s;
229
+ return I(() => {
230
+ n.value && (s = B(n.value, (o) => {
231
+ t.value = o;
232
+ }));
233
+ }), O(() => s?.()), () => C(
234
+ "div",
235
+ {
236
+ ref: n,
237
+ "data-rv-grid-controls-scope": "",
238
+ style: { display: "contents" }
239
+ },
240
+ r.default?.()
241
+ );
242
+ }
243
+ }), le = y({
244
+ name: "GridControl",
245
+ props: {
246
+ grid: {
247
+ type: Object,
248
+ default: void 0
249
+ },
250
+ mount: { type: Function, required: !0 }
251
+ },
252
+ setup(e) {
253
+ const r = Z(), t = g(null);
254
+ let n;
255
+ return I(() => {
256
+ n = U(
257
+ [
258
+ () => e.grid === void 0 ? r.value : e.grid,
259
+ () => e.mount
260
+ ],
261
+ ([s, o], i, c) => {
262
+ t.value && s && c(W(t.value, s, o));
263
+ },
264
+ { immediate: !0, flush: "post" }
265
+ );
266
+ }), O(() => n?.()), () => C("div", { ref: t });
267
+ }
268
+ });
269
+ function ee(e) {
270
+ return !!e && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
271
+ }
272
+ const x = $?.(), ue = X(async () => (ee(x) && await x, q));
218
273
  export {
219
- J as VGrid,
220
- j as VGridVueEditor,
221
- X as VGridVueTemplate,
222
- x as VGridVueTemplateConstructor,
223
- J as default,
224
- q as useTemplates
274
+ le as GridControl,
275
+ ce as GridControlsProvider,
276
+ ue as VGrid,
277
+ ie as VGridVueEditor,
278
+ J as VGridVueTemplate,
279
+ S as VGridVueTemplateConstructor,
280
+ ue as default,
281
+ Z as useGridControls,
282
+ ae as useTemplates
225
283
  };
@@ -1 +1 @@
1
- (function(o,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("@revolist/revogrid/loader"),require("@revolist/revogrid")):typeof define=="function"&&define.amd?define(["exports","vue","@revolist/revogrid/loader","@revolist/revogrid"],a):(o=typeof globalThis<"u"?globalThis:o||self,a(o.Vue3Datagrid={},o.Vue,o.RevogridLoader,o.Revogrid))})(this,(function(o,a,g,C){"use strict";const y="routerLink",E="navManager",z="router",D="aria",f=Symbol(),R={default:f},w=e=>e?.split(" ")||[],M=(e,r,n=[])=>[...Array.from(e.value?.classList||[]),...n].filter((i,d,t)=>!r.has(i)&&t.indexOf(i)===d),j=((e,r,n=[],i,d)=>{const t=a.defineComponent((s,{attrs:l,slots:p,emit:I})=>{s[i];const k=a.ref(),A=new Set(w(l.class)),_=a.getCurrentInstance()?.appContext?.provides[E]?a.inject(E):void 0,F=m=>{const{routerLink:v}=s;if(v!==f)if(_!==void 0){m.preventDefault();let u={event:m};for(const h in s){const c=s[h];s.hasOwnProperty(h)&&h.startsWith(z)&&c!==f&&(u[h]=c)}_.navigate(u)}else console.warn("Tried to navigate, but no router was found. Make sure you have mounted Vue Router.")};return()=>{s[i],w(l.class).forEach(c=>{A.add(c)});const m=s.onClick,v=c=>{m!==void 0&&m(c),c.defaultPrevented||F(c)};let u={ref:k,class:M(k,A),onClick:v};for(const c in s){const S=s[c];(s.hasOwnProperty(c)&&S!==f||c.startsWith(D))&&(u[c]=S)}return s[y]!==f&&(u={...u,href:s[y]}),a.h(e,u,p.default&&p.default())}});return typeof t!="function"&&(t.name=e,t.props={[y]:R},n.forEach(s=>{t.props[s]=R})),t})("revo-grid",void 0,["rowHeaders","frameSize","rowSize","colSize","range","readonly","resize","resizeRow","noHorizontalScrollTransfer","canFocus","useClipboard","columns","source","pinnedTopSource","pinnedBottomSource","rowDefinitions","editors","applyOnClose","plugins","columnTypes","theme","themeDefinitions","rowClass","autoSizeColumn","filter","sorting","focusTemplate","canMoveColumns","trimmedRows","exporting","grouping","stretch","additionalData","disableVirtualX","virtualX","disableVirtualY","hideAttribution","jobsBeforeRender","registerVNode","accessible","rtl","canDrag","contentsizechanged","beforeedit","beforerangeedit","afteredit","beforeautofill","beforerange","afterfocus","roworderchanged","beforesorting","beforesourcesortingapply","beforesortingapply","aftersortingapply","rowdragstart","headerclick","beforecellfocus","beforefocuslost","beforesourceset","beforeanysource","aftersourceset","afteranysource","beforecolumnsgather","beforecolumnsset","beforecolumnapplied","aftercolumnsset","beforefilterapply","beforefiltertrimmed","afterfilterapply","beforetrimmed","aftertrimmed","viewportscroll","beforeexport","beforeeditstart","aftercolumnresize","beforerowdefinition","filterconfigchanged","sortingconfigchanged","rowheaderschanged","beforegridrender","aftergridrender","aftergridinit","additionaldatachanged","afterthemechanged","created"]);function P(e,r){r?.appContext&&(e.appContext=r.appContext)}const b=(e,r,n,i,d=null)=>{if(!r)return d?.destroy?.(),{vueInstance:null,destroy:()=>null,el:null};let t=r._vnode;if(t){P(t,i);for(const l in n)t.component.props[l]=n[l]}else t=a.createVNode(e,n),P(t,i),a.render(t,r);return{vueInstance:t,destroy:()=>a.render(null,r),el:r}},V=(e,r,n,i=a.getCurrentInstance())=>(d,t,s)=>{const l=n?.props?n.props(t):{...r,...t,addition:s};let p=null;return d("span",{key:n?.key?.(t)??`${t.prop}-${t.rowIndex||0}`,ref:I=>{p=b(e,I,l,i,p)}})};class L{constructor(r,n,i,d,t){this.VueEditorConstructor=r,this.column=n,this.save=i,this.close=d,this.vInstance=t,this.element=null}componentDidRender(){}disconnectedCallback(){this.vueEl?.destroy(),this.vueEl=void 0}render(r){return r("span",{key:`${this.column.prop}-${this.editCell?.rowIndex||0}`,ref:n=>{const i={...this.editCell,column:this.column,save:this.save,close:this.close};this.vueEl=b(this.VueEditorConstructor,n,i,this.vInstance)}})}}const G=e=>{const r=a.getCurrentInstance();return function(n,i,d){return new L(e,n,i,d,r)}};function N(){const e=a.getCurrentInstance();return{template(r,n){const i={...n,props:n?.props??(d=>({context:d}))};return V(r,void 0,i,e)}}}function U(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}const T=g.defineCustomElements?.(),O=a.defineAsyncComponent(async()=>(U(T)&&await T,j));o.VGrid=O,o.VGridVueEditor=G,o.VGridVueTemplate=V,o.VGridVueTemplateConstructor=b,o.default=O,o.useTemplates=N,Object.keys(g).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(o,e)&&Object.defineProperty(o,e,{enumerable:!0,get:()=>g[e]})}),Object.keys(C).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(o,e)&&Object.defineProperty(o,e,{enumerable:!0,get:()=>C[e]})}),Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(s,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@revolist/revogrid/loader"),require("@revolist/revogrid")):typeof define=="function"&&define.amd?define(["exports","vue","@revolist/revogrid/loader","@revolist/revogrid"],t):(s=typeof globalThis<"u"?globalThis:s||self,t(s.Vue3Datagrid={},s.Vue,s.RevogridLoader,s.Revogrid))})(this,(function(s,t,y,g){"use strict";const C="routerLink",R="navManager",j="router",z="aria",f=Symbol(),w={default:f},E=e=>e?.split(" ")||[],D=(e,r,n=[])=>[...Array.from(e.value?.classList||[]),...n].filter((i,a,o)=>!r.has(i)&&o.indexOf(i)===a),L=((e,r,n=[],i,a)=>{const o=t.defineComponent((c,{attrs:d,slots:p,emit:_})=>{c[i];const A=t.ref(),k=new Set(E(d.class)),S=t.getCurrentInstance()?.appContext?.provides[R]?t.inject(R):void 0,$=m=>{const{routerLink:v}=c;if(v!==f)if(S!==void 0){m.preventDefault();let u={event:m};for(const h in c){const l=c[h];c.hasOwnProperty(h)&&h.startsWith(j)&&l!==f&&(u[h]=l)}S.navigate(u)}else console.warn("Tried to navigate, but no router was found. Make sure you have mounted Vue Router.")};return()=>{c[i],E(d.class).forEach(l=>{k.add(l)});const m=c.onClick,v=l=>{m!==void 0&&m(l),l.defaultPrevented||$(l)};let u={ref:A,class:D(A,k),onClick:v};for(const l in c){const M=c[l];(c.hasOwnProperty(l)&&M!==f||l.startsWith(z))&&(u[l]=M)}return c[C]!==f&&(u={...u,href:c[C]}),t.h(e,u,p.default&&p.default())}});return typeof o!="function"&&(o.name=e,o.props={[C]:w},n.forEach(c=>{o.props[c]=w})),o})("revo-grid",void 0,["rowHeaders","frameSize","rowSize","colSize","range","readonly","resize","resizeRow","noHorizontalScrollTransfer","canFocus","useClipboard","columns","source","pinnedTopSource","pinnedBottomSource","rowDefinitions","editors","applyOnClose","plugins","columnTypes","theme","themeDefinitions","rowClass","autoSizeColumn","filter","sorting","focusTemplate","canMoveColumns","trimmedRows","exporting","grouping","stretch","additionalData","disableVirtualX","virtualX","disableVirtualY","hideAttribution","jobsBeforeRender","registerVNode","accessible","rtl","canDrag","contentsizechanged","beforeedit","beforerangeedit","afteredit","beforeautofill","beforerange","afterfocus","roworderchanged","beforesorting","beforesourcesortingapply","beforesortingapply","aftersortingapply","rowdragstart","headerclick","beforecellfocus","beforefocuslost","beforesourceset","beforeanysource","aftersourceset","afteranysource","beforecolumnsgather","beforecolumnsset","beforecolumnapplied","aftercolumnsset","beforefilterapply","beforefiltertrimmed","afterfilterapply","beforetrimmed","aftertrimmed","viewportscroll","beforeexport","beforeeditstart","aftercolumnresize","beforerowdefinition","filterconfigchanged","sortingconfigchanged","rowheaderschanged","beforegridrender","aftergridrender","aftergridinit","additionaldatachanged","afterthemechanged","created"]);function P(e,r){r?.appContext&&(e.appContext=r.appContext)}const b=(e,r,n,i,a=null)=>{if(!r)return a?.destroy?.(),{vueInstance:null,destroy:()=>null,el:null};let o=r._vnode;if(o){P(o,i);for(const d in n)o.component.props[d]=n[d]}else o=t.createVNode(e,n),P(o,i),t.render(o,r);return{vueInstance:o,destroy:()=>t.render(null,r),el:r}},V=(e,r,n,i=t.getCurrentInstance())=>(a,o,c)=>{const d=n?.props?n.props(o):{...r,...o,addition:c};let p=null;return a("span",{key:n?.key?.(o)??`${o.prop}-${o.rowIndex||0}`,ref:_=>{p=b(e,_,d,i,p)}})};class U{constructor(r,n,i,a,o){this.VueEditorConstructor=r,this.column=n,this.save=i,this.close=a,this.vInstance=o,this.element=null}componentDidRender(){}disconnectedCallback(){this.vueEl?.destroy(),this.vueEl=void 0}render(r){return r("span",{key:`${this.column.prop}-${this.editCell?.rowIndex||0}`,ref:n=>{const i={...this.editCell,column:this.column,save:this.save,close:this.close};this.vueEl=b(this.VueEditorConstructor,n,i,this.vInstance)}})}}const N=e=>{const r=t.getCurrentInstance();return function(n,i,a){return new U(e,n,i,a,r)}};function F(){const e=t.getCurrentInstance();return{template(r,n){const i={...n,props:n?.props??(a=>({context:a}))};return V(r,void 0,i,e)}}}const O=Symbol("RevoGrid controls scope");function T(){const e=t.inject(O,void 0);return t.computed(()=>e?.value??null)}const q=t.defineComponent({name:"GridControlsProvider",inheritAttrs:!1,setup(e,{slots:r}){const n=t.shallowRef(null),i=t.shallowRef(null);t.provide(O,n);let a;return t.onMounted(()=>{i.value&&(a=g.observeScopedGrid(i.value,o=>{n.value=o}))}),t.onBeforeUnmount(()=>a?.()),()=>t.h("div",{ref:i,"data-rv-grid-controls-scope":"",style:{display:"contents"}},r.default?.())}}),B=t.defineComponent({name:"GridControl",props:{grid:{type:Object,default:void 0},mount:{type:Function,required:!0}},setup(e){const r=T(),n=t.shallowRef(null);let i;return t.onMounted(()=>{i=t.watch([()=>e.grid===void 0?r.value:e.grid,()=>e.mount],([a,o],c,d)=>{n.value&&a&&d(g.mountGridControl(n.value,a,o))},{immediate:!0,flush:"post"})}),t.onBeforeUnmount(()=>i?.()),()=>t.h("div",{ref:n})}});function X(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}const G=y.defineCustomElements?.(),I=t.defineAsyncComponent(async()=>(X(G)&&await G,L));s.GridControl=B,s.GridControlsProvider=q,s.VGrid=I,s.VGridVueEditor=N,s.VGridVueTemplate=V,s.VGridVueTemplateConstructor=b,s.default=I,s.useGridControls=T,s.useTemplates=F,Object.keys(y).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(s,e)&&Object.defineProperty(s,e,{enumerable:!0,get:()=>y[e]})}),Object.keys(g).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(s,e)&&Object.defineProperty(s,e,{enumerable:!0,get:()=>g[e]})}),Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revolist/vue3-datagrid",
3
- "version": "4.32.0",
3
+ "version": "4.32.4",
4
4
  "description": "Vue 3 DataGrid Spreadsheet component with native Vue 3 cell render support",
5
5
  "main": "./dist/vue3-datagrid.umd.cjs",
6
6
  "module": "./dist/vue3-datagrid.js",
@@ -67,7 +67,7 @@
67
67
  "homepage": "https://github.com/revolist/revogrid#readme",
68
68
  "license": "MIT",
69
69
  "dependencies": {
70
- "@revolist/revogrid": "4.32.0"
70
+ "@revolist/revogrid": "4.32.4"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@stencil/core": "^4.43.2",