@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 +24 -0
- package/dist/index.d.ts +41 -0
- package/dist/vue3-datagrid.js +135 -77
- package/dist/vue3-datagrid.umd.cjs +1 -1
- package/package.json +2 -2
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;
|
package/dist/vue3-datagrid.js
CHANGED
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { defineCustomElements as
|
|
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
|
|
6
|
-
(
|
|
7
|
-
),
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const { routerLink: h } =
|
|
12
|
-
if (h !==
|
|
13
|
-
if (
|
|
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
|
|
17
|
-
const
|
|
18
|
-
|
|
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
|
-
|
|
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
|
-
|
|
26
|
-
|
|
26
|
+
i[n], A(c.class).forEach((a) => {
|
|
27
|
+
R.add(a);
|
|
27
28
|
});
|
|
28
|
-
const d =
|
|
29
|
-
d !== void 0 && d(
|
|
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:
|
|
33
|
-
class:
|
|
33
|
+
ref: E,
|
|
34
|
+
class: K(E, R),
|
|
34
35
|
onClick: h
|
|
35
36
|
};
|
|
36
|
-
for (const
|
|
37
|
-
const
|
|
38
|
-
(
|
|
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
|
|
41
|
+
return i[v] !== p && (l = {
|
|
41
42
|
...l,
|
|
42
|
-
href:
|
|
43
|
-
}),
|
|
43
|
+
href: i[v]
|
|
44
|
+
}), C(e, l, u.default && u.default());
|
|
44
45
|
};
|
|
45
46
|
});
|
|
46
|
-
return typeof
|
|
47
|
-
[
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
})),
|
|
51
|
-
},
|
|
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
|
|
139
|
-
r?.appContext && (
|
|
139
|
+
function G(e, r) {
|
|
140
|
+
r?.appContext && (e.appContext = r.appContext);
|
|
140
141
|
}
|
|
141
|
-
const
|
|
142
|
+
const S = (e, r, t, n, s = null) => {
|
|
142
143
|
if (!r)
|
|
143
|
-
return
|
|
144
|
-
let
|
|
145
|
-
if (
|
|
146
|
-
|
|
147
|
-
for (const c in
|
|
148
|
-
|
|
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
|
-
|
|
151
|
-
return { vueInstance:
|
|
152
|
-
},
|
|
153
|
-
const c =
|
|
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
|
|
156
|
-
key:
|
|
157
|
-
ref: (
|
|
158
|
-
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,
|
|
164
|
-
this.VueEditorConstructor = r, this.column =
|
|
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: (
|
|
177
|
-
const
|
|
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 =
|
|
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
|
|
194
|
-
const r =
|
|
195
|
-
return function(
|
|
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
|
-
|
|
200
|
-
a,
|
|
201
|
+
s,
|
|
201
202
|
r
|
|
202
203
|
);
|
|
203
204
|
};
|
|
204
205
|
};
|
|
205
|
-
function
|
|
206
|
-
const
|
|
206
|
+
function ae() {
|
|
207
|
+
const e = m();
|
|
207
208
|
return {
|
|
208
|
-
template(r,
|
|
209
|
-
const
|
|
210
|
-
return
|
|
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
|
-
|
|
215
|
-
|
|
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
|
|
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
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
J as
|
|
224
|
-
|
|
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(
|
|
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.
|
|
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.
|
|
70
|
+
"@revolist/revogrid": "4.32.4"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@stencil/core": "^4.43.2",
|