@revolist/vue3-datagrid 4.0.2 → 4.0.11
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/dist/index.d.ts +1 -3
- package/dist/vue3-datagrid.js +73 -72
- package/dist/vue3-datagrid.umd.cjs +1 -1
- package/package.json +8 -7
package/dist/index.d.ts
CHANGED
|
@@ -21,8 +21,6 @@ export default VGrid;
|
|
|
21
21
|
* Create editor constructor.
|
|
22
22
|
* This function creates editor constructor by wrapping it with VueEditorAdapter
|
|
23
23
|
* which is responsible for connecting editor with Vue lifecycle events
|
|
24
|
-
* @param vueConstructor editor Vue constructor
|
|
25
|
-
* @returns editor constructor
|
|
26
24
|
*/
|
|
27
25
|
export declare const VGridVueEditor: (vueConstructor: any) => EditorCtr;
|
|
28
26
|
|
|
@@ -49,7 +47,7 @@ export declare const VGridVueTemplateConstructor: (vueConstructor: DefineCompone
|
|
|
49
47
|
el: VueElement | null;
|
|
50
48
|
};
|
|
51
49
|
|
|
52
|
-
declare interface VueElement extends
|
|
50
|
+
declare interface VueElement extends Element {
|
|
53
51
|
_vnode?: ComponentPublicInstance<any>;
|
|
54
52
|
}
|
|
55
53
|
|
package/dist/vue3-datagrid.js
CHANGED
|
@@ -1,55 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { defineComponent as I, ref as L, getCurrentInstance as C, inject as M, h as G, createVNode as N, render as w, defineAsyncComponent as U } from "vue";
|
|
5
|
-
import { defineCustomElements as D } from "@revolist/revogrid/loader";
|
|
6
|
-
const F = "routerLink", E = "navManager", W = "router", X = "aria", m = Symbol(), P = { default: m }, k = (t) => (t == null ? void 0 : t.split(" ")) || [], Y = (t, e, n = []) => {
|
|
1
|
+
import { defineComponent as x, ref as S, getCurrentInstance as v, inject as z, h as I, createVNode as L, render as V, defineAsyncComponent as M } from "vue";
|
|
2
|
+
import { defineCustomElements as G } from "@revolist/revogrid/loader";
|
|
3
|
+
const N = "routerLink", w = "navManager", U = "router", D = "aria", m = Symbol(), E = { default: m }, P = (t) => (t == null ? void 0 : t.split(" ")) || [], F = (t, e, r = []) => {
|
|
7
4
|
var i;
|
|
8
|
-
return [...Array.from(((i = t.value) == null ? void 0 : i.classList) || []), ...
|
|
9
|
-
(s, o,
|
|
5
|
+
return [...Array.from(((i = t.value) == null ? void 0 : i.classList) || []), ...r].filter(
|
|
6
|
+
(s, o, n) => !e.has(s) && n.indexOf(s) === o
|
|
10
7
|
);
|
|
11
|
-
},
|
|
12
|
-
const o =
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
const { routerLink: p } =
|
|
8
|
+
}, W = (t, e, r = [], i, s) => {
|
|
9
|
+
const o = x((n, { attrs: c, slots: u, emit: H }) => {
|
|
10
|
+
var y;
|
|
11
|
+
n[i];
|
|
12
|
+
const C = S(), g = new Set(P(c.class)), h = v(), b = ((y = h == null ? void 0 : h.appContext) == null ? void 0 : y.provides[w]) ? z(w) : void 0, O = (l) => {
|
|
13
|
+
const { routerLink: p } = n;
|
|
17
14
|
if (p !== m)
|
|
18
|
-
if (
|
|
19
|
-
let d = { event:
|
|
20
|
-
for (const
|
|
21
|
-
const a =
|
|
22
|
-
|
|
15
|
+
if (b !== void 0) {
|
|
16
|
+
let d = { event: l };
|
|
17
|
+
for (const f in n) {
|
|
18
|
+
const a = n[f];
|
|
19
|
+
n.hasOwnProperty(f) && f.startsWith(U) && a !== m && (d[f] = a);
|
|
23
20
|
}
|
|
24
|
-
|
|
21
|
+
b.navigate(d);
|
|
25
22
|
} else
|
|
26
23
|
console.warn("Tried to navigate, but no router was found. Make sure you have mounted Vue Router.");
|
|
27
24
|
};
|
|
28
25
|
return () => {
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
n[i], P(c.class).forEach((a) => {
|
|
27
|
+
g.add(a);
|
|
31
28
|
});
|
|
32
|
-
const
|
|
33
|
-
|
|
29
|
+
const l = n.onClick, p = (a) => {
|
|
30
|
+
l !== void 0 && l(a), a.defaultPrevented || O(a);
|
|
34
31
|
};
|
|
35
32
|
let d = {
|
|
36
|
-
ref:
|
|
37
|
-
class:
|
|
33
|
+
ref: C,
|
|
34
|
+
class: F(C, g),
|
|
38
35
|
onClick: p
|
|
39
36
|
};
|
|
40
|
-
for (const a in
|
|
41
|
-
const
|
|
42
|
-
(
|
|
37
|
+
for (const a in n) {
|
|
38
|
+
const R = n[a];
|
|
39
|
+
(n.hasOwnProperty(a) && R !== m || a.startsWith(D)) && (d[a] = R);
|
|
43
40
|
}
|
|
44
|
-
return
|
|
41
|
+
return I(t, d, u.default && u.default());
|
|
45
42
|
};
|
|
46
43
|
});
|
|
47
44
|
return typeof o != "function" && (o.name = t, o.props = {
|
|
48
|
-
[
|
|
49
|
-
},
|
|
50
|
-
o.props[
|
|
45
|
+
[N]: E
|
|
46
|
+
}, r.forEach((n) => {
|
|
47
|
+
o.props[n] = E;
|
|
51
48
|
})), o;
|
|
52
|
-
},
|
|
49
|
+
}, X = /* @__PURE__ */ W("revo-grid", void 0, [
|
|
53
50
|
"rowHeaders",
|
|
54
51
|
"frameSize",
|
|
55
52
|
"rowSize",
|
|
@@ -119,10 +116,10 @@ const F = "routerLink", E = "navManager", W = "router", X = "aria", m = Symbol()
|
|
|
119
116
|
"beforegridrender",
|
|
120
117
|
"aftergridinit"
|
|
121
118
|
]);
|
|
122
|
-
function
|
|
119
|
+
function k(t, e) {
|
|
123
120
|
e != null && e.appContext && (t.appContext = e.appContext);
|
|
124
121
|
}
|
|
125
|
-
const
|
|
122
|
+
const _ = (t, e, r, i, s = null) => {
|
|
126
123
|
var c;
|
|
127
124
|
if (!e)
|
|
128
125
|
return (c = s == null ? void 0 : s.destroy) == null || c.call(s), {
|
|
@@ -132,76 +129,80 @@ const O = (t, e, n, i, s = null) => {
|
|
|
132
129
|
};
|
|
133
130
|
let o = e._vnode;
|
|
134
131
|
if (o) {
|
|
135
|
-
|
|
136
|
-
for (const u in
|
|
137
|
-
o.component.props[u] =
|
|
132
|
+
k(o, i);
|
|
133
|
+
for (const u in r)
|
|
134
|
+
o.component.props[u] = r[u];
|
|
138
135
|
} else
|
|
139
|
-
o =
|
|
136
|
+
o = L(t, r), k(o, i), V(o, e);
|
|
140
137
|
return {
|
|
141
138
|
vueInstance: o,
|
|
142
|
-
destroy: () =>
|
|
139
|
+
destroy: () => V(null, e),
|
|
143
140
|
el: e
|
|
144
141
|
};
|
|
145
|
-
},
|
|
146
|
-
const
|
|
142
|
+
}, J = (t, e) => {
|
|
143
|
+
const r = v();
|
|
147
144
|
return (i, s, o) => {
|
|
148
|
-
const
|
|
145
|
+
const n = e ? {
|
|
149
146
|
...e,
|
|
150
147
|
...s
|
|
151
148
|
} : s;
|
|
152
|
-
|
|
149
|
+
n.addition = o;
|
|
153
150
|
let c = null;
|
|
154
151
|
return i("span", {
|
|
155
152
|
ref: (u) => {
|
|
156
|
-
c =
|
|
153
|
+
c = _(t, u, n, r, c);
|
|
157
154
|
}
|
|
158
155
|
}, null);
|
|
159
156
|
};
|
|
160
157
|
};
|
|
161
|
-
class
|
|
162
|
-
constructor(e,
|
|
163
|
-
|
|
164
|
-
v(this, "editCell", null);
|
|
165
|
-
this.VueEditorConstructor = e, this.column = n, this.save = i, this.close = s, this.vInstance = o;
|
|
158
|
+
class Y {
|
|
159
|
+
constructor(e, r, i, s, o) {
|
|
160
|
+
this.VueEditorConstructor = e, this.column = r, this.save = i, this.close = s, this.vInstance = o, this.element = null;
|
|
166
161
|
}
|
|
167
162
|
// optional, called after editor rendered
|
|
168
163
|
componentDidRender() {
|
|
169
164
|
}
|
|
170
165
|
// optional, called after editor destroyed
|
|
171
166
|
disconnectedCallback() {
|
|
172
|
-
|
|
167
|
+
var e;
|
|
168
|
+
(e = this.vueEl) == null || e.destroy(), this.vueEl = void 0;
|
|
173
169
|
}
|
|
174
170
|
render(e) {
|
|
175
171
|
return e("span", {
|
|
176
|
-
ref: (
|
|
177
|
-
this.vueEl =
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
172
|
+
ref: (r) => {
|
|
173
|
+
this.vueEl = _(
|
|
174
|
+
this.VueEditorConstructor,
|
|
175
|
+
r,
|
|
176
|
+
{
|
|
177
|
+
...this.editCell,
|
|
178
|
+
column: this.column,
|
|
179
|
+
save: this.save,
|
|
180
|
+
close: this.close
|
|
181
|
+
},
|
|
182
|
+
this.vInstance
|
|
183
|
+
);
|
|
183
184
|
}
|
|
184
|
-
}
|
|
185
|
+
});
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
|
-
const
|
|
188
|
-
return new
|
|
188
|
+
const Q = (t) => function(e, r, i) {
|
|
189
|
+
return new Y(
|
|
189
190
|
t,
|
|
190
191
|
e,
|
|
191
|
-
|
|
192
|
+
r,
|
|
192
193
|
i,
|
|
193
|
-
|
|
194
|
+
v()
|
|
194
195
|
);
|
|
195
196
|
};
|
|
196
|
-
function
|
|
197
|
+
function B(t) {
|
|
197
198
|
return !!t && (typeof t == "object" || typeof t == "function") && typeof t.then == "function";
|
|
198
199
|
}
|
|
199
|
-
var
|
|
200
|
-
const
|
|
200
|
+
var A;
|
|
201
|
+
const T = (A = G) == null ? void 0 : A(), Z = M(async () => (B(T) && await T, X));
|
|
201
202
|
export {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
Z as VGrid,
|
|
204
|
+
Q as VGridVueEditor,
|
|
205
|
+
J as VGridVueTemplate,
|
|
206
|
+
_ as VGridVueTemplateConstructor,
|
|
207
|
+
Z as default
|
|
207
208
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(r
|
|
1
|
+
(function(u,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@revolist/revogrid/loader")):typeof define=="function"&&define.amd?define(["exports","vue","@revolist/revogrid/loader"],r):(u=typeof globalThis<"u"?globalThis:u||self,r(u.Vue3Datagrid={},u.Vue,u.RevogridLoader))})(this,function(u,r,C){"use strict";var P;const I="routerLink",b="navManager",M="router",L="aria",h=Symbol(),R={default:h},V=t=>(t==null?void 0:t.split(" "))||[],z=(t,e,i=[])=>{var s;return[...Array.from(((s=t.value)==null?void 0:s.classList)||[]),...i].filter((c,n,o)=>!e.has(c)&&o.indexOf(c)===n)},G=((t,e,i=[],s,c)=>{const n=r.defineComponent((o,{attrs:a,slots:f,emit:X})=>{var O;o[s];const k=r.ref(),A=new Set(V(a.class)),v=r.getCurrentInstance(),_=((O=v==null?void 0:v.appContext)==null?void 0:O.provides[b])?r.inject(b):void 0,F=g=>{const{routerLink:y}=o;if(y!==h)if(_!==void 0){let l={event:g};for(const m in o){const d=o[m];o.hasOwnProperty(m)&&m.startsWith(M)&&d!==h&&(l[m]=d)}_.navigate(l)}else console.warn("Tried to navigate, but no router was found. Make sure you have mounted Vue Router.")};return()=>{o[s],V(a.class).forEach(d=>{A.add(d)});const g=o.onClick,y=d=>{g!==void 0&&g(d),d.defaultPrevented||F(d)};let l={ref:k,class:z(k,A),onClick:y};for(const d in o){const S=o[d];(o.hasOwnProperty(d)&&S!==h||d.startsWith(L))&&(l[d]=S)}return r.h(t,l,f.default&&f.default())}});return typeof n!="function"&&(n.name=t,n.props={[I]:R},i.forEach(o=>{n.props[o]=R})),n})("revo-grid",void 0,["rowHeaders","frameSize","rowSize","colSize","range","readonly","resize","canFocus","useClipboard","columns","source","pinnedTopSource","pinnedBottomSource","rowDefinitions","editors","applyOnClose","plugins","columnTypes","theme","rowClass","autoSizeColumn","filter","focusTemplate","canMoveColumns","trimmedRows","exporting","grouping","stretch","additionalData","disableVirtualX","disableVirtualY","hideAttribution","jobsBeforeRender","registerVNode","contentsizechanged","beforeedit","beforerangeedit","afteredit","beforeautofill","beforeange","afterfocus","roworderchanged","beforesortingapply","beforesorting","rowdragstart","headerclick","beforecellfocus","beforefocuslost","beforesourceset","beforeanysource","aftersourceset","afteranysource","beforecolumnsset","beforecolumnapplied","aftercolumnsset","beforefilterapply","beforefiltertrimmed","beforetrimmed","aftertrimmed","viewportscroll","beforeexport","beforeeditstart","aftercolumnresize","beforerowdefinition","filterconfigchanged","rowheaderschanged","beforegridrender","aftergridinit"]);function w(t,e){e!=null&&e.appContext&&(t.appContext=e.appContext)}const p=(t,e,i,s,c=null)=>{var a;if(!e)return(a=c==null?void 0:c.destroy)==null||a.call(c),{vueInstance:null,destroy:()=>null,el:null};let n=e._vnode;if(n){w(n,s);for(const f in i)n.component.props[f]=i[f]}else n=r.createVNode(t,i),w(n,s),r.render(n,e);return{vueInstance:n,destroy:()=>r.render(null,e),el:e}},x=(t,e)=>{const i=r.getCurrentInstance();return(s,c,n)=>{const o=e?{...e,...c}:c;o.addition=n;let a=null;return s("span",{ref:f=>{a=p(t,f,o,i,a)}},null)}};class N{constructor(e,i,s,c,n){this.VueEditorConstructor=e,this.column=i,this.save=s,this.close=c,this.vInstance=n,this.element=null}componentDidRender(){}disconnectedCallback(){var e;(e=this.vueEl)==null||e.destroy(),this.vueEl=void 0}render(e){return e("span",{ref:i=>{this.vueEl=p(this.VueEditorConstructor,i,{...this.editCell,column:this.column,save:this.save,close:this.close},this.vInstance)}})}}const D=t=>function(e,i,s){return new N(t,e,i,s,r.getCurrentInstance())};function U(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}const T=(P=C.defineCustomElements)==null?void 0:P.call(C),E=r.defineAsyncComponent(async()=>(U(T)&&await T,G));u.VGrid=E,u.VGridVueEditor=D,u.VGridVueTemplate=x,u.VGridVueTemplateConstructor=p,u.default=E,Object.defineProperties(u,{__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.0.
|
|
3
|
+
"version": "4.0.11",
|
|
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",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"scripts": {
|
|
20
20
|
"dev": "vite",
|
|
21
21
|
"build": "vue-tsc && vite build",
|
|
22
|
-
"preview": "vite preview"
|
|
22
|
+
"preview": "vite preview",
|
|
23
|
+
"release": "npm run build && npm publish --public --tag pre-release"
|
|
23
24
|
},
|
|
24
25
|
"keywords": [
|
|
25
26
|
"revo-grid",
|
|
@@ -64,17 +65,17 @@
|
|
|
64
65
|
"homepage": "https://github.com/revolist/revogrid#readme",
|
|
65
66
|
"license": "MIT",
|
|
66
67
|
"dependencies": {
|
|
67
|
-
"@revolist/revogrid": "
|
|
68
|
-
"vue": "^3.4.21"
|
|
68
|
+
"@revolist/revogrid": "4.0.11"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@vitejs/plugin-vue": "^5.0.5",
|
|
72
72
|
"@vitejs/plugin-vue-jsx": "^4.0.0",
|
|
73
73
|
"typescript": "^5.2.2",
|
|
74
74
|
"@stencil/core": "^4.18.3",
|
|
75
|
-
"vite": "^5.
|
|
76
|
-
"vite-plugin-dts": "^3.9.
|
|
77
|
-
"vue-tsc": "^2.0.14"
|
|
75
|
+
"vite": "^5.3.1",
|
|
76
|
+
"vite-plugin-dts": "^3.9.1",
|
|
77
|
+
"vue-tsc": "^2.0.14",
|
|
78
|
+
"vue": "^3.4.29"
|
|
78
79
|
},
|
|
79
80
|
"publishConfig": {
|
|
80
81
|
"access": "public"
|