@guiexpert/vue3-table 3.1.109 → 3.1.113
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.cjs +1 -1
- package/index.js +102 -85
- package/lib/GuiexpertTable.vue.d.ts +5 -1
- package/package.json +2 -2
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("@guiexpert/table"),d=require("vue"),m=d.defineComponent({props:{tableModel:{required:!0,type:Object},tableOptions:{required:!1,default:()=>new u.TableOptions,type:Object},debounceMouseClickDelay:{required:!1,type:Number,default:150},licenseKey:{default:"",required:!1},loading:{required:!1,type:Boolean,default:!1}},emits:["tableReady","mouseClicked","mouseDragging","checkboxChanged","contextmenu","modelChanged","focusChanged","selectionChanged","mouseDraggingEnd","mouseMoved","scroll","stateChanged","rowDragStart","rowDragMove","rowDragEnd","batchEditChanged","detailExpandedChanged","editingChanged","undoStackChanged","columnResizeStart","columnResizeEnd","columnMoveStart","columnMoveEnd"],setup(r,{emit:n}){const t=d.ref(null);let a,o,l=!1;const i=s=>{const c=r.debounceMouseClickDelay;if(!c||c<=0){n("mouseClicked",s);return}a&&clearTimeout(a),a=setTimeout(()=>{a=void 0,n("mouseClicked",s)},c)},g=()=>{a&&clearTimeout(a),a=void 0,o==null||o.destroy(),o=void 0};d.onBeforeUnmount(g);const h=s=>{g();const c={onSelectionChanged:e=>{n("selectionChanged",e)},onFocusChanged:e=>{n("focusChanged",e)},onCheckboxChanged:e=>{n("checkboxChanged",e)},onContextmenu:e=>{n("contextmenu",e)},onModelChanged:e=>{n("modelChanged",e)},onMouseClicked:e=>{i(e)},onMouseDragging:e=>{n("mouseDragging",e)},onMouseDraggingEnd:e=>{n("mouseDraggingEnd",e)},onMouseMoved:e=>{n("mouseMoved",e)},onScroll:e=>{n("scroll",e)},onStateChanged:e=>{n("stateChanged",e)},onRowDragStart:e=>{n("rowDragStart",e)},onRowDragMove:e=>{n("rowDragMove",e)},onRowDragEnd:e=>{n("rowDragEnd",e)},onBatchEditChanged:e=>{n("batchEditChanged",e)},onDetailExpandedChanged:e=>{n("detailExpandedChanged",e)},onEditingChanged:e=>{n("editingChanged",e)},onUndoStackChanged:e=>{n("undoStackChanged",e)},onColumnResizeStart:e=>{n("columnResizeStart",e)},onColumnResizeEnd:e=>{n("columnResizeEnd",e)},onColumnMoveStart:e=>{n("columnMoveStart",e)},onColumnMoveEnd:e=>{n("columnMoveEnd",e)}},p=new u.TableScope(s,r.tableModel,new u.SimpleDomService,r.tableOptions??new u.TableOptions,c);o=p,p.firstInit(),l=!1,C(),n("tableReady",p.getApi())},C=()=>{r.loading?(o==null||o.showLoadingOverlay(),l=!0):l&&(o==null||o.hideOverlay(),l=!1)};return d.onMounted(()=>{t.value&&h(t.value)}),d.watch([()=>r.tableModel,()=>r.tableOptions],()=>{t.value&&h(t.value)}),d.watch(()=>r.loading,C,{flush:"sync"}),d.watch(()=>r.licenseKey,s=>{s&&u.LicenseManager.getInstance().setLicenseKey(s)},{immediate:!0}),{root:t}}}),b=(r,n)=>{const t=r.__vccOpts||r;for(const[a,o]of n)t[a]=o;return t},v={ref:"root",class:"container-div",style:{width:"100%",height:"100%","background-color":"transparent",padding:"0",margin:"0"}};function M(r,n,t,a,o,l){return d.openBlock(),d.createElementBlock("div",v,null,512)}const f=b(m,[["render",M]]);class w{constructor(n,t){this.component=n,this.appContext=t}render(n,t,a,o,l,i,g){return this.mount(this.component,{cellDiv:n,rowIndex:t,columnIndex:a,areaIdent:o,areaModel:l,cellValue:i},this.appContext,n)}mount(n,t,a,o){let l=d.createVNode(n,t);return l.appContext=a,d.render(l,o),()=>{o&&d.render(null,o)}}}class x{constructor(n,t=null){this.component=n,this.appContext=t}render(n,t,a){const o=d.createVNode(this.component,{row:t,rowIndex:a.rowIndex,tableApi:a.tableApi,context:a});return o.appContext=this.appContext,d.render(o,n),()=>d.render(null,n)}}const y={install:(r,n={img:""})=>{r.component("GuiexpertTable",f)}};exports.ComponentRendererWrapper=w;exports.DetailComponentRendererWrapper=x;exports.GuiexpertTable=f;exports.default=y;
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TableOptions as f, LicenseManager as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
const
|
|
1
|
+
import { TableOptions as f, LicenseManager as v, TableScope as M, SimpleDomService as b } from "@guiexpert/table";
|
|
2
|
+
import { defineComponent as x, ref as y, onBeforeUnmount as E, onMounted as w, watch as C, openBlock as k, createElementBlock as D, createVNode as m, render as u } from "vue";
|
|
3
|
+
const S = x({
|
|
4
4
|
// class, style and other attributes go to the root div (before: inheritAttrs: false dropped them)
|
|
5
5
|
props: {
|
|
6
6
|
tableModel: {
|
|
@@ -60,160 +60,177 @@ const _ = v({
|
|
|
60
60
|
// since 1.1.97 (master/detail)
|
|
61
61
|
"editingChanged",
|
|
62
62
|
// since 1.1.99 (Excel-style editing)
|
|
63
|
-
"undoStackChanged"
|
|
63
|
+
"undoStackChanged",
|
|
64
64
|
// since 1.1.99 (undo and redo)
|
|
65
|
+
"columnResizeStart",
|
|
66
|
+
// since 1.1.110 (column drag)
|
|
67
|
+
"columnResizeEnd",
|
|
68
|
+
"columnMoveStart",
|
|
69
|
+
"columnMoveEnd"
|
|
65
70
|
],
|
|
66
|
-
setup(d, { emit:
|
|
67
|
-
const t =
|
|
71
|
+
setup(d, { emit: n }) {
|
|
72
|
+
const t = y(null);
|
|
68
73
|
let a, o, r = !1;
|
|
69
|
-
const
|
|
74
|
+
const c = (l) => {
|
|
70
75
|
const s = d.debounceMouseClickDelay;
|
|
71
76
|
if (!s || s <= 0) {
|
|
72
|
-
|
|
77
|
+
n("mouseClicked", l);
|
|
73
78
|
return;
|
|
74
79
|
}
|
|
75
80
|
a && clearTimeout(a), a = setTimeout(() => {
|
|
76
|
-
a = void 0,
|
|
81
|
+
a = void 0, n("mouseClicked", l);
|
|
77
82
|
}, s);
|
|
78
|
-
},
|
|
83
|
+
}, i = () => {
|
|
79
84
|
a && clearTimeout(a), a = void 0, o == null || o.destroy(), o = void 0;
|
|
80
85
|
};
|
|
81
|
-
|
|
86
|
+
E(i);
|
|
82
87
|
const g = (l) => {
|
|
83
|
-
|
|
88
|
+
i();
|
|
84
89
|
const s = {
|
|
85
|
-
onSelectionChanged: (
|
|
86
|
-
|
|
90
|
+
onSelectionChanged: (e) => {
|
|
91
|
+
n("selectionChanged", e);
|
|
87
92
|
},
|
|
88
|
-
onFocusChanged: (
|
|
89
|
-
|
|
93
|
+
onFocusChanged: (e) => {
|
|
94
|
+
n("focusChanged", e);
|
|
90
95
|
},
|
|
91
|
-
onCheckboxChanged: (
|
|
92
|
-
|
|
96
|
+
onCheckboxChanged: (e) => {
|
|
97
|
+
n("checkboxChanged", e);
|
|
93
98
|
},
|
|
94
|
-
onContextmenu: (
|
|
95
|
-
|
|
99
|
+
onContextmenu: (e) => {
|
|
100
|
+
n("contextmenu", e);
|
|
96
101
|
},
|
|
97
|
-
onModelChanged: (
|
|
98
|
-
|
|
102
|
+
onModelChanged: (e) => {
|
|
103
|
+
n("modelChanged", e);
|
|
99
104
|
},
|
|
100
|
-
onMouseClicked: (
|
|
101
|
-
|
|
105
|
+
onMouseClicked: (e) => {
|
|
106
|
+
c(e);
|
|
102
107
|
},
|
|
103
|
-
onMouseDragging: (
|
|
104
|
-
|
|
108
|
+
onMouseDragging: (e) => {
|
|
109
|
+
n("mouseDragging", e);
|
|
105
110
|
},
|
|
106
|
-
onMouseDraggingEnd: (
|
|
107
|
-
|
|
111
|
+
onMouseDraggingEnd: (e) => {
|
|
112
|
+
n("mouseDraggingEnd", e);
|
|
108
113
|
},
|
|
109
|
-
onMouseMoved: (
|
|
110
|
-
|
|
114
|
+
onMouseMoved: (e) => {
|
|
115
|
+
n("mouseMoved", e);
|
|
111
116
|
},
|
|
112
|
-
onScroll: (
|
|
113
|
-
|
|
117
|
+
onScroll: (e) => {
|
|
118
|
+
n("scroll", e);
|
|
114
119
|
},
|
|
115
|
-
onStateChanged: (
|
|
116
|
-
|
|
120
|
+
onStateChanged: (e) => {
|
|
121
|
+
n("stateChanged", e);
|
|
117
122
|
},
|
|
118
|
-
onRowDragStart: (
|
|
119
|
-
|
|
123
|
+
onRowDragStart: (e) => {
|
|
124
|
+
n("rowDragStart", e);
|
|
120
125
|
},
|
|
121
|
-
onRowDragMove: (
|
|
122
|
-
|
|
126
|
+
onRowDragMove: (e) => {
|
|
127
|
+
n("rowDragMove", e);
|
|
123
128
|
},
|
|
124
|
-
onRowDragEnd: (
|
|
125
|
-
|
|
129
|
+
onRowDragEnd: (e) => {
|
|
130
|
+
n("rowDragEnd", e);
|
|
126
131
|
},
|
|
127
|
-
onBatchEditChanged: (
|
|
128
|
-
|
|
132
|
+
onBatchEditChanged: (e) => {
|
|
133
|
+
n("batchEditChanged", e);
|
|
129
134
|
},
|
|
130
|
-
onDetailExpandedChanged: (
|
|
131
|
-
|
|
135
|
+
onDetailExpandedChanged: (e) => {
|
|
136
|
+
n("detailExpandedChanged", e);
|
|
132
137
|
},
|
|
133
|
-
onEditingChanged: (
|
|
134
|
-
|
|
138
|
+
onEditingChanged: (e) => {
|
|
139
|
+
n("editingChanged", e);
|
|
135
140
|
},
|
|
136
|
-
onUndoStackChanged: (
|
|
137
|
-
|
|
141
|
+
onUndoStackChanged: (e) => {
|
|
142
|
+
n("undoStackChanged", e);
|
|
143
|
+
},
|
|
144
|
+
onColumnResizeStart: (e) => {
|
|
145
|
+
n("columnResizeStart", e);
|
|
146
|
+
},
|
|
147
|
+
onColumnResizeEnd: (e) => {
|
|
148
|
+
n("columnResizeEnd", e);
|
|
149
|
+
},
|
|
150
|
+
onColumnMoveStart: (e) => {
|
|
151
|
+
n("columnMoveStart", e);
|
|
152
|
+
},
|
|
153
|
+
onColumnMoveEnd: (e) => {
|
|
154
|
+
n("columnMoveEnd", e);
|
|
138
155
|
}
|
|
139
|
-
}, h = new
|
|
156
|
+
}, h = new M(
|
|
140
157
|
l,
|
|
141
158
|
d.tableModel,
|
|
142
|
-
new
|
|
159
|
+
new b(),
|
|
143
160
|
d.tableOptions ?? new f(),
|
|
144
161
|
s
|
|
145
162
|
);
|
|
146
|
-
o = h, h.firstInit(), r = !1,
|
|
147
|
-
},
|
|
163
|
+
o = h, h.firstInit(), r = !1, p(), n("tableReady", h.getApi());
|
|
164
|
+
}, p = () => {
|
|
148
165
|
d.loading ? (o == null || o.showLoadingOverlay(), r = !0) : r && (o == null || o.hideOverlay(), r = !1);
|
|
149
166
|
};
|
|
150
|
-
return
|
|
167
|
+
return w(() => {
|
|
151
168
|
t.value && g(t.value);
|
|
152
|
-
}),
|
|
169
|
+
}), C([() => d.tableModel, () => d.tableOptions], () => {
|
|
153
170
|
t.value && g(t.value);
|
|
154
|
-
}),
|
|
155
|
-
l &&
|
|
171
|
+
}), C(() => d.loading, p, { flush: "sync" }), C(() => d.licenseKey, (l) => {
|
|
172
|
+
l && v.getInstance().setLicenseKey(l);
|
|
156
173
|
}, { immediate: !0 }), {
|
|
157
174
|
root: t
|
|
158
175
|
};
|
|
159
176
|
}
|
|
160
|
-
}),
|
|
177
|
+
}), _ = (d, n) => {
|
|
161
178
|
const t = d.__vccOpts || d;
|
|
162
|
-
for (const [a, o] of
|
|
179
|
+
for (const [a, o] of n)
|
|
163
180
|
t[a] = o;
|
|
164
181
|
return t;
|
|
165
|
-
},
|
|
182
|
+
}, R = {
|
|
166
183
|
ref: "root",
|
|
167
184
|
class: "container-div",
|
|
168
185
|
style: { width: "100%", height: "100%", "background-color": "transparent", padding: "0", margin: "0" }
|
|
169
186
|
};
|
|
170
|
-
function
|
|
171
|
-
return
|
|
187
|
+
function T(d, n, t, a, o, r) {
|
|
188
|
+
return k(), D("div", R, null, 512);
|
|
172
189
|
}
|
|
173
|
-
const
|
|
174
|
-
class
|
|
175
|
-
constructor(
|
|
176
|
-
this.component =
|
|
190
|
+
const O = /* @__PURE__ */ _(S, [["render", T]]);
|
|
191
|
+
class q {
|
|
192
|
+
constructor(n, t) {
|
|
193
|
+
this.component = n, this.appContext = t;
|
|
177
194
|
}
|
|
178
|
-
render(
|
|
195
|
+
render(n, t, a, o, r, c, i) {
|
|
179
196
|
return this.mount(
|
|
180
197
|
this.component,
|
|
181
198
|
{
|
|
182
|
-
cellDiv:
|
|
199
|
+
cellDiv: n,
|
|
183
200
|
rowIndex: t,
|
|
184
201
|
columnIndex: a,
|
|
185
202
|
areaIdent: o,
|
|
186
203
|
areaModel: r,
|
|
187
|
-
cellValue:
|
|
204
|
+
cellValue: c
|
|
188
205
|
},
|
|
189
206
|
this.appContext,
|
|
190
|
-
|
|
207
|
+
n
|
|
191
208
|
);
|
|
192
209
|
}
|
|
193
|
-
mount(
|
|
194
|
-
let r = m(
|
|
195
|
-
return r.appContext = a,
|
|
196
|
-
o &&
|
|
210
|
+
mount(n, t, a, o) {
|
|
211
|
+
let r = m(n, t);
|
|
212
|
+
return r.appContext = a, u(r, o), () => {
|
|
213
|
+
o && u(null, o);
|
|
197
214
|
};
|
|
198
215
|
}
|
|
199
216
|
}
|
|
200
|
-
class
|
|
201
|
-
constructor(
|
|
202
|
-
this.component =
|
|
217
|
+
class F {
|
|
218
|
+
constructor(n, t = null) {
|
|
219
|
+
this.component = n, this.appContext = t;
|
|
203
220
|
}
|
|
204
|
-
render(
|
|
221
|
+
render(n, t, a) {
|
|
205
222
|
const o = m(this.component, { row: t, rowIndex: a.rowIndex, tableApi: a.tableApi, context: a });
|
|
206
|
-
return o.appContext = this.appContext,
|
|
223
|
+
return o.appContext = this.appContext, u(o, n), () => u(null, n);
|
|
207
224
|
}
|
|
208
225
|
}
|
|
209
|
-
const
|
|
210
|
-
install: (d,
|
|
211
|
-
d.component("GuiexpertTable",
|
|
226
|
+
const I = {
|
|
227
|
+
install: (d, n = { img: "" }) => {
|
|
228
|
+
d.component("GuiexpertTable", O);
|
|
212
229
|
}
|
|
213
230
|
};
|
|
214
231
|
export {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
232
|
+
q as ComponentRendererWrapper,
|
|
233
|
+
F as DetailComponentRendererWrapper,
|
|
234
|
+
O as GuiexpertTable,
|
|
235
|
+
I as default
|
|
219
236
|
};
|
|
@@ -41,7 +41,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
41
41
|
};
|
|
42
42
|
}>, {
|
|
43
43
|
root: import('vue').Ref<null, null>;
|
|
44
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("tableReady" | "mouseClicked" | "mouseDragging" | "checkboxChanged" | "contextmenu" | "modelChanged" | "focusChanged" | "selectionChanged" | "mouseDraggingEnd" | "mouseMoved" | "scroll" | "stateChanged" | "rowDragStart" | "rowDragMove" | "rowDragEnd" | "batchEditChanged" | "detailExpandedChanged" | "editingChanged" | "undoStackChanged")[], "tableReady" | "mouseClicked" | "mouseDragging" | "checkboxChanged" | "contextmenu" | "modelChanged" | "focusChanged" | "selectionChanged" | "mouseDraggingEnd" | "mouseMoved" | "scroll" | "stateChanged" | "rowDragStart" | "rowDragMove" | "rowDragEnd" | "batchEditChanged" | "detailExpandedChanged" | "editingChanged" | "undoStackChanged", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
44
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("tableReady" | "mouseClicked" | "mouseDragging" | "checkboxChanged" | "contextmenu" | "modelChanged" | "focusChanged" | "selectionChanged" | "mouseDraggingEnd" | "mouseMoved" | "scroll" | "stateChanged" | "rowDragStart" | "rowDragMove" | "rowDragEnd" | "batchEditChanged" | "detailExpandedChanged" | "editingChanged" | "undoStackChanged" | "columnResizeStart" | "columnResizeEnd" | "columnMoveStart" | "columnMoveEnd")[], "tableReady" | "mouseClicked" | "mouseDragging" | "checkboxChanged" | "contextmenu" | "modelChanged" | "focusChanged" | "selectionChanged" | "mouseDraggingEnd" | "mouseMoved" | "scroll" | "stateChanged" | "rowDragStart" | "rowDragMove" | "rowDragEnd" | "batchEditChanged" | "detailExpandedChanged" | "editingChanged" | "undoStackChanged" | "columnResizeStart" | "columnResizeEnd" | "columnMoveStart" | "columnMoveEnd", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
45
45
|
tableModel: {
|
|
46
46
|
required: true;
|
|
47
47
|
type: PropType<TableModelIf>;
|
|
@@ -93,6 +93,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
93
93
|
onDetailExpandedChanged?: ((...args: any[]) => any) | undefined;
|
|
94
94
|
onEditingChanged?: ((...args: any[]) => any) | undefined;
|
|
95
95
|
onUndoStackChanged?: ((...args: any[]) => any) | undefined;
|
|
96
|
+
onColumnResizeStart?: ((...args: any[]) => any) | undefined;
|
|
97
|
+
onColumnResizeEnd?: ((...args: any[]) => any) | undefined;
|
|
98
|
+
onColumnMoveStart?: ((...args: any[]) => any) | undefined;
|
|
99
|
+
onColumnMoveEnd?: ((...args: any[]) => any) | undefined;
|
|
96
100
|
}>, {
|
|
97
101
|
tableOptions: TableOptionsIf;
|
|
98
102
|
debounceMouseClickDelay: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guiexpert/vue3-table",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.113",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Dr. Marc Kronberg <info@gui.expert> (https://gui.expert)",
|
|
6
6
|
"repository": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"tslib": "^2.3.0",
|
|
34
|
-
"@guiexpert/table": "^1.1.
|
|
34
|
+
"@guiexpert/table": "^1.1.113"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"vue": "^3.0.0"
|