@inandu-solutions/grid-vue 0.2.2 → 0.2.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/README.md +4 -4
- package/dist/components/InanduGrid.vue.d.ts +1 -1
- package/dist/composables/useInanduGrid.d.ts +5 -1
- package/dist/core/core.spec.d.ts +1 -0
- package/dist/inandu-grid-vue.cjs +3 -3
- package/dist/inandu-grid-vue.js +621 -620
- package/dist/style.css +13 -0
- package/package.json +6 -3
package/dist/inandu-grid-vue.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, normalizeStyle as u, onBeforeUnmount as d, onScopeDispose as f, openBlock as p, renderList as m, shallowRef as h, toDisplayString as g, toValue as _, unref as v, useSlots as y, watch as
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
function
|
|
5
|
-
let r = {}, i = n ?
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, normalizeStyle as u, onBeforeUnmount as d, onScopeDispose as f, openBlock as p, renderList as m, shallowRef as h, toDisplayString as g, toValue as _, unref as v, useSlots as y, watch as b, withModifiers as x } from "vue";
|
|
2
|
+
// src/core/format.ts
|
|
3
|
+
var S = /^(\d+)?\.(\d+)-(\d+)$/;
|
|
4
|
+
function ee(e, t, n) {
|
|
5
|
+
let r = {}, i = n ? S.exec(n) : null;
|
|
6
6
|
return i ? (i[1] && (r.minimumIntegerDigits = Number(i[1])), r.minimumFractionDigits = Number(i[2]), r.maximumFractionDigits = Number(i[3])) : r.maximumFractionDigits = 3, new Intl.NumberFormat(t || void 0, r).format(e);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function C(e) {
|
|
9
9
|
return e instanceof Date ? e : typeof e == "string" ? new Date(e.replace(/^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2})/, "$1T$2")) : new Date(e);
|
|
10
10
|
}
|
|
11
|
-
var
|
|
12
|
-
function
|
|
11
|
+
var w = /YYYY|sss|MM|DD|HH|mm|ss/g;
|
|
12
|
+
function T(e, t) {
|
|
13
13
|
let n = (e, t = 2) => String(e).padStart(t, "0");
|
|
14
|
-
return t.replace(
|
|
14
|
+
return t.replace(w, (t) => {
|
|
15
15
|
switch (t) {
|
|
16
16
|
case "YYYY": return String(e.getFullYear());
|
|
17
17
|
case "MM": return n(e.getMonth() + 1);
|
|
@@ -24,7 +24,7 @@ function w(e, t) {
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function E(e, t, n, r, i = ee) {
|
|
28
28
|
if (e == null) return "";
|
|
29
29
|
switch (t) {
|
|
30
30
|
case "number": {
|
|
@@ -32,8 +32,8 @@ function T(e, t, n, r, i = te) {
|
|
|
32
32
|
return Number.isNaN(t) ? String(e) : i(t, r, n || void 0);
|
|
33
33
|
}
|
|
34
34
|
case "date": {
|
|
35
|
-
let t =
|
|
36
|
-
return Number.isNaN(t.getTime()) ? String(e) :
|
|
35
|
+
let t = C(e);
|
|
36
|
+
return Number.isNaN(t.getTime()) ? String(e) : T(t, n || "YYYY-MM-DD");
|
|
37
37
|
}
|
|
38
38
|
case "boolean": {
|
|
39
39
|
let [t, r] = (n || "true|false").split("|");
|
|
@@ -42,14 +42,12 @@ function T(e, t, n, r, i = te) {
|
|
|
42
42
|
default: return String(e);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
function E(e, t, n) {
|
|
45
|
+
// src/core/sort.ts
|
|
46
|
+
function D(e, t, n) {
|
|
48
47
|
return e == null && t == null ? 0 : e == null ? -1 : t == null ? 1 : e instanceof Date && t instanceof Date ? e.getTime() - t.getTime() : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t), n || void 0);
|
|
49
48
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
function D(e, t) {
|
|
49
|
+
// src/core/tree.ts
|
|
50
|
+
function O(e, t) {
|
|
53
51
|
let { getChildren: n, isExpanded: r, match: i, compare: a } = t, o = [], s = /* @__PURE__ */ new Map(), c = (e) => {
|
|
54
52
|
if (!i) return !0;
|
|
55
53
|
let t = s.get(e);
|
|
@@ -75,7 +73,7 @@ function D(e, t) {
|
|
|
75
73
|
};
|
|
76
74
|
return l(e, 0), o;
|
|
77
75
|
}
|
|
78
|
-
function
|
|
76
|
+
function k(e, t) {
|
|
79
77
|
let n = [], r = (e) => {
|
|
80
78
|
for (let i of e) {
|
|
81
79
|
n.push(i);
|
|
@@ -85,14 +83,13 @@ function ne(e, t) {
|
|
|
85
83
|
};
|
|
86
84
|
return r(e), n;
|
|
87
85
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
function re(e) {
|
|
86
|
+
// src/core/filter.ts
|
|
87
|
+
function A(e) {
|
|
91
88
|
return e ? Object.values(e).some((e) => Array.isArray(e) ? !0 : !!e) : !1;
|
|
92
89
|
}
|
|
93
|
-
function
|
|
90
|
+
function te(e, t, n, r, i) {
|
|
94
91
|
let a = t[e.field()];
|
|
95
|
-
if (n.values !== void 0) return n.values.includes(
|
|
92
|
+
if (n.values !== void 0) return n.values.includes(E(a, e.type(), e.format(), r, i));
|
|
96
93
|
switch (e.type()) {
|
|
97
94
|
case "number": {
|
|
98
95
|
let e = !!n.min, t = !!n.max;
|
|
@@ -104,7 +101,7 @@ function ie(e, t, n, r, i) {
|
|
|
104
101
|
let e = !!n.from, t = !!n.to;
|
|
105
102
|
if (!e && !t) return !0;
|
|
106
103
|
if (a == null) return !1;
|
|
107
|
-
let r =
|
|
104
|
+
let r = C(a);
|
|
108
105
|
if (Number.isNaN(r.getTime()) || e && r < new Date(n.from)) return !1;
|
|
109
106
|
if (t) {
|
|
110
107
|
let e = new Date(n.to);
|
|
@@ -115,20 +112,19 @@ function ie(e, t, n, r, i) {
|
|
|
115
112
|
case "boolean": return !n.bool || !!a == (n.bool === "true");
|
|
116
113
|
default: {
|
|
117
114
|
let t = (n.text ?? "").trim().toLowerCase();
|
|
118
|
-
return !t ||
|
|
115
|
+
return !t || E(a, e.type(), e.format(), r, i).toLowerCase().includes(t);
|
|
119
116
|
}
|
|
120
117
|
}
|
|
121
118
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
var O = {
|
|
119
|
+
// src/core/aggregate.ts
|
|
120
|
+
var j = {
|
|
125
121
|
sum: "Σ",
|
|
126
122
|
avg: "x̄",
|
|
127
123
|
min: "min",
|
|
128
124
|
max: "max",
|
|
129
125
|
count: "#"
|
|
130
126
|
};
|
|
131
|
-
function
|
|
127
|
+
function ne(e, t) {
|
|
132
128
|
let n = {};
|
|
133
129
|
for (let r of t) {
|
|
134
130
|
let t = r.field(), i = r.aggregate();
|
|
@@ -153,9 +149,8 @@ function ae(e, t) {
|
|
|
153
149
|
}
|
|
154
150
|
return n;
|
|
155
151
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
function oe(e, t) {
|
|
152
|
+
// src/core/parse.ts
|
|
153
|
+
function re(e, t) {
|
|
159
154
|
switch (t) {
|
|
160
155
|
case "number": {
|
|
161
156
|
if (e === "" || e === void 0) return;
|
|
@@ -170,41 +165,35 @@ function oe(e, t) {
|
|
|
170
165
|
default: return e;
|
|
171
166
|
}
|
|
172
167
|
}
|
|
173
|
-
function
|
|
174
|
-
return t === "boolean" ? e.trim().toLowerCase() === "true" :
|
|
168
|
+
function ie(e, t) {
|
|
169
|
+
return t === "boolean" ? e.trim().toLowerCase() === "true" : re(e, t);
|
|
175
170
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
function k(e) {
|
|
171
|
+
// src/core/dom.ts
|
|
172
|
+
function M(e) {
|
|
179
173
|
return e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
180
174
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
function A(e) {
|
|
175
|
+
// src/core/export/csv.ts
|
|
176
|
+
function N(e) {
|
|
184
177
|
return /[",\r\n]/.test(e) ? "\"" + e.replace(/"/g, "\"\"") + "\"" : e;
|
|
185
178
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
function j(e) {
|
|
179
|
+
// src/core/export/markup.ts
|
|
180
|
+
function P(e) {
|
|
189
181
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
190
182
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
function M(e, t, n) {
|
|
183
|
+
// src/core/export/pdf.ts
|
|
184
|
+
function F(e, t, n) {
|
|
194
185
|
if (e.getTextWidth(t) <= n) return t;
|
|
195
186
|
let r = t;
|
|
196
187
|
for (; r.length > 0 && e.getTextWidth(r + "…") > n;) r = r.slice(0, -1);
|
|
197
188
|
return r + "…";
|
|
198
189
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
function N(e, t, n) {
|
|
190
|
+
// src/core/export/download.ts
|
|
191
|
+
function I(e, t, n) {
|
|
202
192
|
let r = e instanceof Blob ? e : new Blob([e], { type: n }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
203
193
|
a.href = i, a.download = t, a.click(), URL.revokeObjectURL(i);
|
|
204
194
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
var P = {
|
|
195
|
+
// src/core/i18n/en.ts
|
|
196
|
+
var L = {
|
|
208
197
|
MsgNoData: "No data",
|
|
209
198
|
MsgFirstPage: "First page",
|
|
210
199
|
MsgPreviousPage: "Previous page",
|
|
@@ -249,7 +238,7 @@ var P = {
|
|
|
249
238
|
MsgValidationMin: "Must be at least {{min}}",
|
|
250
239
|
MsgValidationMax: "Must be at most {{max}}",
|
|
251
240
|
MsgValidationPattern: "Invalid format"
|
|
252
|
-
},
|
|
241
|
+
}, R = {
|
|
253
242
|
MsgNoData: "Sin datos",
|
|
254
243
|
MsgFirstPage: "Primera página",
|
|
255
244
|
MsgPreviousPage: "Página anterior",
|
|
@@ -294,7 +283,7 @@ var P = {
|
|
|
294
283
|
MsgValidationMin: "Debe ser como mínimo {{min}}",
|
|
295
284
|
MsgValidationMax: "Debe ser como máximo {{max}}",
|
|
296
285
|
MsgValidationPattern: "Formato inválido"
|
|
297
|
-
},
|
|
286
|
+
}, z = {
|
|
298
287
|
MsgNoData: "Aucune donnée",
|
|
299
288
|
MsgFirstPage: "Première page",
|
|
300
289
|
MsgPreviousPage: "Page précédente",
|
|
@@ -339,7 +328,7 @@ var P = {
|
|
|
339
328
|
MsgValidationMin: "Doit être au moins {{min}}",
|
|
340
329
|
MsgValidationMax: "Doit être au plus {{max}}",
|
|
341
330
|
MsgValidationPattern: "Format invalide"
|
|
342
|
-
},
|
|
331
|
+
}, ae = {
|
|
343
332
|
MsgNoData: "Nessun dato",
|
|
344
333
|
MsgFirstPage: "Prima pagina",
|
|
345
334
|
MsgPreviousPage: "Pagina precedente",
|
|
@@ -384,7 +373,7 @@ var P = {
|
|
|
384
373
|
MsgValidationMin: "Deve essere almeno {{min}}",
|
|
385
374
|
MsgValidationMax: "Deve essere al massimo {{max}}",
|
|
386
375
|
MsgValidationPattern: "Formato non valido"
|
|
387
|
-
},
|
|
376
|
+
}, B = {
|
|
388
377
|
MsgNoData: "暂无数据",
|
|
389
378
|
MsgFirstPage: "首页",
|
|
390
379
|
MsgPreviousPage: "上一页",
|
|
@@ -429,25 +418,23 @@ var P = {
|
|
|
429
418
|
MsgValidationMin: "不得小于 {{min}}",
|
|
430
419
|
MsgValidationMax: "不得大于 {{max}}",
|
|
431
420
|
MsgValidationPattern: "格式无效"
|
|
432
|
-
},
|
|
433
|
-
en:
|
|
434
|
-
es:
|
|
435
|
-
fr:
|
|
436
|
-
it:
|
|
437
|
-
zh:
|
|
421
|
+
}, V = {
|
|
422
|
+
en: L,
|
|
423
|
+
es: R,
|
|
424
|
+
fr: z,
|
|
425
|
+
it: ae,
|
|
426
|
+
zh: B
|
|
438
427
|
};
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
function le(e, t) {
|
|
428
|
+
// src/utils/translate.ts
|
|
429
|
+
function oe(e, t) {
|
|
442
430
|
return t ? e.replace(/\{\{(\w+)\}\}/g, (e, n) => n in t ? String(t[n]) : e) : e;
|
|
443
431
|
}
|
|
444
|
-
function
|
|
445
|
-
let t =
|
|
446
|
-
return (e, n) =>
|
|
432
|
+
function se(e) {
|
|
433
|
+
let t = V[e.split("-")[0]] ?? L;
|
|
434
|
+
return (e, n) => oe(t[e] ?? L[e], n);
|
|
447
435
|
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
function de(e) {
|
|
436
|
+
// src/composables/useInanduGrid.ts
|
|
437
|
+
function ce(e) {
|
|
451
438
|
return {
|
|
452
439
|
field: () => e.field,
|
|
453
440
|
type: () => e.type ?? "string",
|
|
@@ -456,9 +443,9 @@ function de(e) {
|
|
|
456
443
|
aggregate: () => e.aggregate ?? ""
|
|
457
444
|
};
|
|
458
445
|
}
|
|
459
|
-
function
|
|
460
|
-
let n = (n) => t(() => _(e)[n]), r = n("rows"), i = n("columns"), a = t(() => _(e).locale ?? "en"), o = n("lang"), s = t(() => _(e).pageSize ?? 0), c = t(() => _(e).selectable ?? !1), l = n("treeChildrenKey"), u = t(() => _(e).treeDefaultExpanded ?? "none"), d = t(() => _(e).virtualScroll ?? !1), f = n("extraRowFilter"), p = n("serverSide"), m = t(() => !!p.value), g = () => _(e), v = h([]), y = h({}),
|
|
461
|
-
let e =
|
|
446
|
+
function le(e) {
|
|
447
|
+
let n = (n) => t(() => _(e)[n]), r = n("rows"), i = n("columns"), a = t(() => _(e).locale ?? "en"), o = n("lang"), s = t(() => _(e).pageSize ?? 0), c = t(() => _(e).selectable ?? !1), l = n("treeChildrenKey"), u = t(() => _(e).treeDefaultExpanded ?? "none"), d = t(() => _(e).virtualScroll ?? !1), f = n("extraRowFilter"), p = n("serverSide"), m = t(() => !!p.value), g = () => _(e), v = h([]), y = h({}), x = h(""), S = h(0), ee = h(void 0), w = t(() => m.value ? void 0 : ee.value), T = h(/* @__PURE__ */ new Set()), j = h(void 0), M = h(!1), N = h({}), P = h({}), F = h(!1), I = h(/* @__PURE__ */ new Set()), L = h(void 0), R = h(void 0), z = h({}), ae = h({}), B = h(void 0), V = h(/* @__PURE__ */ new Set()), oe = h(/* @__PURE__ */ new Set()), le, ue = t(() => se(o.value ?? a.value)), H = t(() => {
|
|
448
|
+
let e = L.value;
|
|
462
449
|
if (!e) return i.value;
|
|
463
450
|
let t = new Map(i.value.map((e) => [e.field, e])), n = [];
|
|
464
451
|
for (let r of e) {
|
|
@@ -466,188 +453,188 @@ function fe(e) {
|
|
|
466
453
|
e && (n.push(e), t.delete(r));
|
|
467
454
|
}
|
|
468
455
|
return n.push(...t.values()), n;
|
|
469
|
-
}),
|
|
470
|
-
function
|
|
471
|
-
let t =
|
|
472
|
-
|
|
456
|
+
}), U = t(() => I.value.size === 0 ? H.value : H.value.filter((e) => !I.value.has(e.field))), de = t(() => H.value.filter((e) => e.hideable !== !1));
|
|
457
|
+
function fe(e) {
|
|
458
|
+
let t = H.value.map((e) => e.field), n = new Set(t), r = e.filter((e) => n.has(e)), i = new Set(r), a = t.filter((e) => !i.has(e));
|
|
459
|
+
L.value = [...r, ...a];
|
|
473
460
|
}
|
|
474
|
-
function
|
|
475
|
-
|
|
461
|
+
function pe(e) {
|
|
462
|
+
R.value = e;
|
|
476
463
|
}
|
|
477
|
-
function
|
|
478
|
-
let t =
|
|
479
|
-
if (
|
|
480
|
-
let n =
|
|
464
|
+
function me(e) {
|
|
465
|
+
let t = R.value;
|
|
466
|
+
if (R.value = void 0, !t || t === e) return;
|
|
467
|
+
let n = H.value.find((e) => e.field === t);
|
|
481
468
|
if (!n || n.reorder === !1) return;
|
|
482
|
-
let r =
|
|
483
|
-
i !== -1 && a !== -1 && (r.splice(i, 1), i < a && a--, r.splice(a, 0, t),
|
|
469
|
+
let r = H.value.map((e) => e.field), i = r.indexOf(t), a = r.indexOf(e);
|
|
470
|
+
i !== -1 && a !== -1 && (r.splice(i, 1), i < a && a--, r.splice(a, 0, t), fe(r));
|
|
484
471
|
}
|
|
485
|
-
function
|
|
486
|
-
return
|
|
472
|
+
function he(e) {
|
|
473
|
+
return I.value.has(e);
|
|
487
474
|
}
|
|
488
|
-
function
|
|
489
|
-
if (
|
|
490
|
-
let t = new Set(
|
|
491
|
-
t.delete(e),
|
|
492
|
-
} else
|
|
475
|
+
function ge(e) {
|
|
476
|
+
if (I.value.has(e)) {
|
|
477
|
+
let t = new Set(I.value);
|
|
478
|
+
t.delete(e), I.value = t;
|
|
479
|
+
} else U.value.length <= 1 || (I.value = new Set(I.value).add(e));
|
|
493
480
|
}
|
|
494
|
-
let
|
|
495
|
-
function
|
|
496
|
-
|
|
481
|
+
let _e = t(() => U.value.filter((e) => e.editable));
|
|
482
|
+
function ve(e) {
|
|
483
|
+
S.value = 0, x.value = e;
|
|
497
484
|
}
|
|
498
|
-
let
|
|
499
|
-
function
|
|
500
|
-
|
|
485
|
+
let W = t(() => new Map(U.value.map((e) => [e.field, ce(e)]))), G = t(() => U.value.filter((e) => e.aggregate).map((e) => W.value.get(e.field)));
|
|
486
|
+
function ye(e, t) {
|
|
487
|
+
S.value = 0, y.value = {
|
|
501
488
|
...y.value,
|
|
502
489
|
[e]: t
|
|
503
490
|
};
|
|
504
491
|
}
|
|
505
|
-
function
|
|
506
|
-
|
|
492
|
+
function K() {
|
|
493
|
+
S.value = 0, y.value = {};
|
|
507
494
|
}
|
|
508
|
-
function
|
|
509
|
-
return
|
|
510
|
-
let r =
|
|
511
|
-
return
|
|
495
|
+
function q(e, t) {
|
|
496
|
+
return U.value.some((n) => {
|
|
497
|
+
let r = W.value.get(n.field);
|
|
498
|
+
return E(e[n.field], r.type(), r.format(), a.value).toLowerCase().includes(t);
|
|
512
499
|
});
|
|
513
500
|
}
|
|
514
|
-
function
|
|
501
|
+
function be(e, t) {
|
|
515
502
|
return t.every(([t, n]) => {
|
|
516
|
-
let r =
|
|
517
|
-
return !r ||
|
|
503
|
+
let r = W.value.get(t);
|
|
504
|
+
return !r || te(r, e, n, a.value);
|
|
518
505
|
});
|
|
519
506
|
}
|
|
520
|
-
function
|
|
507
|
+
function J(e, t) {
|
|
521
508
|
for (let { field: n, direction: r } of v.value) {
|
|
522
|
-
let i =
|
|
509
|
+
let i = D(e[n], t[n], a.value) * (r === "asc" ? 1 : -1);
|
|
523
510
|
if (i !== 0) return i;
|
|
524
511
|
}
|
|
525
512
|
return 0;
|
|
526
513
|
}
|
|
527
|
-
let
|
|
514
|
+
let Y = t(() => {
|
|
528
515
|
let e = r.value;
|
|
529
516
|
if (m.value) return e;
|
|
530
|
-
let t =
|
|
531
|
-
t && (e = e.filter((e) =>
|
|
532
|
-
let n = Object.entries(y.value).filter(([, e]) =>
|
|
533
|
-
n.length > 0 && (e = e.filter((e) =>
|
|
517
|
+
let t = x.value.trim().toLowerCase();
|
|
518
|
+
t && (e = e.filter((e) => q(e, t)));
|
|
519
|
+
let n = Object.entries(y.value).filter(([, e]) => A(e));
|
|
520
|
+
n.length > 0 && (e = e.filter((e) => be(e, n)));
|
|
534
521
|
let i = f.value;
|
|
535
|
-
return i && (e = e.filter(i)), v.value.length > 0 && (e = [...e].sort(
|
|
536
|
-
}),
|
|
537
|
-
let e =
|
|
522
|
+
return i && (e = e.filter(i)), v.value.length > 0 && (e = [...e].sort(J)), e;
|
|
523
|
+
}), xe = t(() => {
|
|
524
|
+
let e = w.value;
|
|
538
525
|
if (!e) return null;
|
|
539
|
-
let t =
|
|
526
|
+
let t = W.value.get(e);
|
|
540
527
|
if (!t) return null;
|
|
541
528
|
let n = /* @__PURE__ */ new Map();
|
|
542
|
-
for (let r of
|
|
543
|
-
let i =
|
|
529
|
+
for (let r of Y.value) {
|
|
530
|
+
let i = E(r[e], t.type(), t.format(), a.value), o = n.get(i);
|
|
544
531
|
o ? o.push(r) : n.set(i, [r]);
|
|
545
532
|
}
|
|
546
533
|
return Array.from(n.entries()).map(([e, t]) => ({
|
|
547
534
|
key: e,
|
|
548
535
|
rows: t,
|
|
549
|
-
aggregates:
|
|
536
|
+
aggregates: ne(t, G.value)
|
|
550
537
|
}));
|
|
551
|
-
}),
|
|
552
|
-
function
|
|
538
|
+
}), Se = t(() => ne(Y.value, G.value)), X = t(() => !!l.value && !w.value && !d.value && !m.value);
|
|
539
|
+
function Z(e) {
|
|
553
540
|
let t = l.value, n = t ? e[t] : void 0;
|
|
554
541
|
return Array.isArray(n) ? n : void 0;
|
|
555
542
|
}
|
|
556
|
-
let
|
|
557
|
-
if (!
|
|
558
|
-
let e =
|
|
559
|
-
return
|
|
560
|
-
getChildren:
|
|
543
|
+
let Ce = t(() => {
|
|
544
|
+
if (!X.value) return [];
|
|
545
|
+
let e = x.value.trim().toLowerCase(), t = Object.entries(y.value).filter(([, e]) => A(e)), n = f.value, i = e || t.length > 0 || n ? (r) => e && !q(r, e) || !be(r, t) ? !1 : !n || n(r) : void 0, a = v.value.length > 0 ? J : void 0, o = V.value;
|
|
546
|
+
return O(r.value, {
|
|
547
|
+
getChildren: Z,
|
|
561
548
|
isExpanded: (e) => o.has(e),
|
|
562
549
|
match: i,
|
|
563
550
|
compare: a
|
|
564
551
|
});
|
|
565
552
|
});
|
|
566
|
-
|
|
567
|
-
|
|
553
|
+
b([
|
|
554
|
+
X,
|
|
568
555
|
r,
|
|
569
556
|
u
|
|
570
557
|
], () => {
|
|
571
|
-
if (!
|
|
572
|
-
|
|
558
|
+
if (!X.value || le === r.value) return;
|
|
559
|
+
le = r.value;
|
|
573
560
|
let e = u.value;
|
|
574
561
|
if (e === "none") {
|
|
575
|
-
|
|
562
|
+
V.value = /* @__PURE__ */ new Set();
|
|
576
563
|
return;
|
|
577
564
|
}
|
|
578
565
|
let t = /* @__PURE__ */ new Set();
|
|
579
|
-
if (e === "all") for (let e of
|
|
566
|
+
if (e === "all") for (let e of k(r.value, Z)) Z(e)?.length && t.add(e);
|
|
580
567
|
else {
|
|
581
568
|
let n = (r, i) => {
|
|
582
569
|
if (!(i >= e)) for (let e of r) {
|
|
583
|
-
let r =
|
|
570
|
+
let r = Z(e);
|
|
584
571
|
r?.length && (t.add(e), n(r, i + 1));
|
|
585
572
|
}
|
|
586
573
|
};
|
|
587
574
|
n(r.value, 0);
|
|
588
575
|
}
|
|
589
|
-
|
|
576
|
+
V.value = t;
|
|
590
577
|
}, {
|
|
591
578
|
immediate: !0,
|
|
592
579
|
flush: "sync"
|
|
593
580
|
});
|
|
594
|
-
function
|
|
595
|
-
return
|
|
581
|
+
function we(e) {
|
|
582
|
+
return V.value.has(e);
|
|
596
583
|
}
|
|
597
|
-
function
|
|
598
|
-
let t = new Set(
|
|
599
|
-
t.has(e) ? t.delete(e) : t.add(e),
|
|
584
|
+
function Q(e) {
|
|
585
|
+
let t = new Set(V.value);
|
|
586
|
+
t.has(e) ? t.delete(e) : t.add(e), V.value = t;
|
|
600
587
|
}
|
|
601
|
-
function
|
|
588
|
+
function Te(e) {
|
|
602
589
|
if (!e) {
|
|
603
|
-
|
|
590
|
+
V.value = /* @__PURE__ */ new Set();
|
|
604
591
|
return;
|
|
605
592
|
}
|
|
606
593
|
let t = /* @__PURE__ */ new Set();
|
|
607
|
-
for (let e of
|
|
608
|
-
|
|
594
|
+
for (let e of k(r.value, Z)) Z(e)?.length && t.add(e);
|
|
595
|
+
V.value = t;
|
|
609
596
|
}
|
|
610
|
-
let
|
|
611
|
-
if (
|
|
612
|
-
if (!
|
|
613
|
-
let e =
|
|
614
|
-
return
|
|
597
|
+
let Ee = t(() => d.value && !w.value && !m.value), De = t(() => s.value > 0 && !w.value && !X.value && !Ee.value), Oe = t(() => p.value ? p.value.totalItems : Y.value.length), ke = t(() => De.value ? Math.max(1, Math.ceil(Oe.value / s.value)) : 1), $ = t(() => m.value ? S.value : Math.min(S.value, ke.value - 1)), Ae = t(() => {
|
|
598
|
+
if (X.value) return Ce.value.map((e) => e.row);
|
|
599
|
+
if (!De.value || m.value) return Y.value;
|
|
600
|
+
let e = $.value * s.value;
|
|
601
|
+
return Y.value.slice(e, e + s.value);
|
|
615
602
|
});
|
|
616
|
-
|
|
603
|
+
b([
|
|
617
604
|
m,
|
|
618
|
-
|
|
605
|
+
$,
|
|
619
606
|
s,
|
|
620
607
|
v,
|
|
621
608
|
y,
|
|
622
|
-
|
|
609
|
+
x
|
|
623
610
|
], () => {
|
|
624
611
|
m.value && g().onQueryChange?.({
|
|
625
|
-
page:
|
|
612
|
+
page: $.value,
|
|
626
613
|
pageSize: s.value,
|
|
627
614
|
sortCriteria: v.value,
|
|
628
615
|
filterValues: y.value,
|
|
629
|
-
filterQuery:
|
|
616
|
+
filterQuery: x.value
|
|
630
617
|
});
|
|
631
618
|
}, { immediate: !0 });
|
|
632
|
-
let
|
|
619
|
+
let je = t(() => w.value ? Y.value : Ae.value);
|
|
633
620
|
function Me(e) {
|
|
634
|
-
return
|
|
621
|
+
return T.value.has(e);
|
|
635
622
|
}
|
|
636
623
|
function Ne(e) {
|
|
637
|
-
let t = new Set(
|
|
638
|
-
t.has(e) ? t.delete(e) : t.add(e),
|
|
624
|
+
let t = new Set(T.value);
|
|
625
|
+
t.has(e) ? t.delete(e) : t.add(e), T.value = t;
|
|
639
626
|
}
|
|
640
|
-
let Pe = t(() =>
|
|
627
|
+
let Pe = t(() => je.value.length > 0 && je.value.every((e) => T.value.has(e))), Fe = t(() => !Pe.value && je.value.some((e) => T.value.has(e)));
|
|
641
628
|
function Ie() {
|
|
642
|
-
let e = !Pe.value, t = new Set(
|
|
643
|
-
for (let n of
|
|
644
|
-
|
|
629
|
+
let e = !Pe.value, t = new Set(T.value);
|
|
630
|
+
for (let n of je.value) e ? t.add(n) : t.delete(n);
|
|
631
|
+
T.value = t;
|
|
645
632
|
}
|
|
646
633
|
function Le() {
|
|
647
|
-
|
|
634
|
+
T.value = /* @__PURE__ */ new Set();
|
|
648
635
|
}
|
|
649
636
|
function Re(e, t = !1) {
|
|
650
|
-
|
|
637
|
+
S.value = 0;
|
|
651
638
|
let n = v.value, r = n.findIndex((t) => t.field === e);
|
|
652
639
|
if (t) {
|
|
653
640
|
if (r === -1) {
|
|
@@ -682,16 +669,16 @@ function fe(e) {
|
|
|
682
669
|
return t === -1 ? void 0 : t + 1;
|
|
683
670
|
}
|
|
684
671
|
function He(e) {
|
|
685
|
-
return
|
|
672
|
+
return j.value === e;
|
|
686
673
|
}
|
|
687
674
|
function Ue(e) {
|
|
688
|
-
return
|
|
675
|
+
return M.value ? !0 : j.value !== void 0 && j.value !== e;
|
|
689
676
|
}
|
|
690
677
|
function We(e, t) {
|
|
691
678
|
let n = t.type ?? "string";
|
|
692
679
|
if (n === "boolean") return !!e[t.field];
|
|
693
680
|
if (n === "date") {
|
|
694
|
-
let n =
|
|
681
|
+
let n = C(e[t.field]);
|
|
695
682
|
if (Number.isNaN(n.getTime())) return "";
|
|
696
683
|
let r = (e) => String(e).padStart(2, "0");
|
|
697
684
|
return `${n.getFullYear()}-${r(n.getMonth() + 1)}-${r(n.getDate())}`;
|
|
@@ -701,20 +688,20 @@ function fe(e) {
|
|
|
701
688
|
}
|
|
702
689
|
function Ge(e) {
|
|
703
690
|
let t = {};
|
|
704
|
-
for (let n of
|
|
705
|
-
|
|
691
|
+
for (let n of _e.value) t[n.field] = We(e, n);
|
|
692
|
+
j.value = e, N.value = t, P.value = {};
|
|
706
693
|
}
|
|
707
694
|
function Ke() {
|
|
708
|
-
|
|
695
|
+
j.value = void 0, N.value = {}, P.value = {};
|
|
709
696
|
}
|
|
710
697
|
function qe(e, t) {
|
|
711
|
-
|
|
712
|
-
...
|
|
698
|
+
N.value = {
|
|
699
|
+
...N.value,
|
|
713
700
|
[e]: t
|
|
714
701
|
};
|
|
715
702
|
}
|
|
716
703
|
function Je(e, t, n, r) {
|
|
717
|
-
let i =
|
|
704
|
+
let i = ue.value;
|
|
718
705
|
if (e.required && (t === "" || t == null)) return i("MsgValidationRequired");
|
|
719
706
|
if ((e.type ?? "string") === "number" && typeof n == "number") {
|
|
720
707
|
if (e.min !== void 0 && n < e.min) return i("MsgValidationMin", { min: e.min });
|
|
@@ -735,8 +722,8 @@ function fe(e) {
|
|
|
735
722
|
return Je(e, t, t, n);
|
|
736
723
|
}
|
|
737
724
|
async function Xe(e) {
|
|
738
|
-
let t =
|
|
739
|
-
for (let r of t) n[r.field] =
|
|
725
|
+
let t = _e.value, n = {};
|
|
726
|
+
for (let r of t) n[r.field] = re(e[r.field], r.type ?? "string");
|
|
740
727
|
let r = {}, i = {}, a = [];
|
|
741
728
|
for (let o of t) {
|
|
742
729
|
let t = o.field, s = Je(o, e[t], n[t], n);
|
|
@@ -745,11 +732,11 @@ function fe(e) {
|
|
|
745
732
|
})) : n[t] !== void 0 && (i[t] = n[t]);
|
|
746
733
|
}
|
|
747
734
|
if (a.length > 0) {
|
|
748
|
-
|
|
735
|
+
F.value = !0;
|
|
749
736
|
try {
|
|
750
737
|
await Promise.all(a);
|
|
751
738
|
} finally {
|
|
752
|
-
|
|
739
|
+
F.value = !1;
|
|
753
740
|
}
|
|
754
741
|
}
|
|
755
742
|
return {
|
|
@@ -758,9 +745,9 @@ function fe(e) {
|
|
|
758
745
|
};
|
|
759
746
|
}
|
|
760
747
|
async function Ze(e) {
|
|
761
|
-
if (
|
|
762
|
-
let { errors: t, values: n } = await Xe(
|
|
763
|
-
|
|
748
|
+
if (j.value !== e) return;
|
|
749
|
+
let { errors: t, values: n } = await Xe(N.value);
|
|
750
|
+
j.value === e && (Object.keys(t).length > 0 ? P.value = t : (j.value = void 0, N.value = {}, P.value = {}, g().onRowSave?.({
|
|
764
751
|
row: e,
|
|
765
752
|
values: n
|
|
766
753
|
})));
|
|
@@ -772,26 +759,26 @@ function fe(e) {
|
|
|
772
759
|
function $e() {
|
|
773
760
|
let e = g().bulkDeleteConfirmMessage;
|
|
774
761
|
if (e && !window.confirm(e)) return;
|
|
775
|
-
let t = Array.from(
|
|
762
|
+
let t = Array.from(T.value);
|
|
776
763
|
Le(), g().onRowsDelete?.(t);
|
|
777
764
|
}
|
|
778
765
|
function et() {
|
|
779
|
-
|
|
766
|
+
M.value = !0, N.value = {}, P.value = {};
|
|
780
767
|
}
|
|
781
768
|
function tt() {
|
|
782
|
-
|
|
769
|
+
M.value = !1, N.value = {}, P.value = {};
|
|
783
770
|
}
|
|
784
771
|
async function nt() {
|
|
785
|
-
if (!
|
|
786
|
-
let { errors: e, values: t } = await Xe(
|
|
787
|
-
|
|
772
|
+
if (!M.value) return;
|
|
773
|
+
let { errors: e, values: t } = await Xe(N.value);
|
|
774
|
+
M.value && (Object.keys(e).length > 0 ? P.value = e : (M.value = !1, N.value = {}, P.value = {}, g().onRowCreate?.(t)));
|
|
788
775
|
}
|
|
789
776
|
function rt(e, t) {
|
|
790
|
-
let n =
|
|
791
|
-
return !n || !r ? "" :
|
|
777
|
+
let n = Ae.value[e], r = W.value.get(t);
|
|
778
|
+
return !n || !r ? "" : E(n[t], r.type(), r.format(), a.value);
|
|
792
779
|
}
|
|
793
780
|
function it(e, t, n) {
|
|
794
|
-
let r =
|
|
781
|
+
let r = U.value, i = Ae.value, a = r.findIndex((e) => e.field === t);
|
|
795
782
|
if (e === -1 || a === -1) return;
|
|
796
783
|
let o = [];
|
|
797
784
|
n.replace(/\r\n$|\r$|\n$/, "").split(/\r\n|\r|\n/).map((e) => e.split(" ")).forEach((t, n) => {
|
|
@@ -801,54 +788,54 @@ function fe(e) {
|
|
|
801
788
|
n && n.editable && o.push({
|
|
802
789
|
row: s,
|
|
803
790
|
field: n.field,
|
|
804
|
-
value:
|
|
791
|
+
value: ie(e, n.type ?? "string")
|
|
805
792
|
});
|
|
806
793
|
});
|
|
807
794
|
}), o.length > 0 && g().onCellsPaste?.(o);
|
|
808
795
|
}
|
|
809
796
|
function at(e) {
|
|
810
|
-
let t =
|
|
811
|
-
return t === void 0 ?
|
|
797
|
+
let t = z.value[e];
|
|
798
|
+
return t === void 0 ? H.value.find((t) => t.field === e)?.width ?? 80 : t;
|
|
812
799
|
}
|
|
813
800
|
function ot(e) {
|
|
814
|
-
return
|
|
801
|
+
return z.value[e] !== void 0;
|
|
815
802
|
}
|
|
816
803
|
function st(e, t) {
|
|
817
|
-
|
|
818
|
-
...
|
|
804
|
+
H.value.some((t) => t.field === e) && (z.value = {
|
|
805
|
+
...z.value,
|
|
819
806
|
[e]: Math.max(30, t)
|
|
820
807
|
});
|
|
821
808
|
}
|
|
822
809
|
function ct(e) {
|
|
823
|
-
|
|
810
|
+
B.value = e;
|
|
824
811
|
}
|
|
825
812
|
function lt(e) {
|
|
826
|
-
return
|
|
813
|
+
return oe.value.has(e);
|
|
827
814
|
}
|
|
828
815
|
function ut(e) {
|
|
829
|
-
let t =
|
|
830
|
-
t.has(e) ? n.delete(e) : n.add(e),
|
|
816
|
+
let t = oe.value, n = g().singleDetailExpand ? /* @__PURE__ */ new Set() : new Set(t);
|
|
817
|
+
t.has(e) ? n.delete(e) : n.add(e), oe.value = n;
|
|
831
818
|
}
|
|
832
819
|
function dt(e) {
|
|
833
|
-
let t =
|
|
834
|
-
if (
|
|
835
|
-
let n = [...
|
|
820
|
+
let t = B.value;
|
|
821
|
+
if (B.value = void 0, !t || t === e) return;
|
|
822
|
+
let n = [...Y.value], r = n.indexOf(t), i = n.indexOf(e);
|
|
836
823
|
r !== -1 && i !== -1 && (n.splice(r, 1), r < i && i--, n.splice(i, 0, t), g().onRowOrderChange?.(n));
|
|
837
824
|
}
|
|
838
825
|
function ft(e) {
|
|
839
|
-
let t =
|
|
826
|
+
let t = ae.value[e];
|
|
840
827
|
if (t === "left" || t === "right") return t;
|
|
841
|
-
if (t !== "none") return
|
|
828
|
+
if (t !== "none") return H.value.find((t) => t.field === e)?.pinned;
|
|
842
829
|
}
|
|
843
830
|
function pt(e, t) {
|
|
844
|
-
|
|
845
|
-
...
|
|
831
|
+
ae.value = {
|
|
832
|
+
...ae.value,
|
|
846
833
|
[e]: t ?? "none"
|
|
847
834
|
};
|
|
848
835
|
}
|
|
849
836
|
function mt(e) {
|
|
850
837
|
let t = c.value ? 36 : 0;
|
|
851
|
-
for (let n of
|
|
838
|
+
for (let n of U.value) {
|
|
852
839
|
if (n.field === e) break;
|
|
853
840
|
ft(n.field) === "left" && (t += at(n.field));
|
|
854
841
|
}
|
|
@@ -856,70 +843,70 @@ function fe(e) {
|
|
|
856
843
|
}
|
|
857
844
|
function ht(e) {
|
|
858
845
|
let t = 0, n = !1;
|
|
859
|
-
for (let r of
|
|
846
|
+
for (let r of U.value) r.field === e ? n = !0 : n && ft(r.field) === "right" && (t += at(r.field));
|
|
860
847
|
return t;
|
|
861
848
|
}
|
|
862
849
|
function gt(e) {
|
|
863
|
-
|
|
850
|
+
S.value = e;
|
|
864
851
|
}
|
|
865
852
|
function _t(e) {
|
|
866
|
-
|
|
853
|
+
ee.value = e;
|
|
867
854
|
}
|
|
868
855
|
return {
|
|
869
856
|
get visibleColumns() {
|
|
870
|
-
return
|
|
857
|
+
return U.value;
|
|
871
858
|
},
|
|
872
859
|
get allColumns() {
|
|
873
|
-
return
|
|
860
|
+
return H.value;
|
|
874
861
|
},
|
|
875
862
|
stickyOffset: mt,
|
|
876
863
|
stickyOffsetRight: ht,
|
|
877
864
|
columnPinnedSide: ft,
|
|
878
865
|
setColumnPinned: pt,
|
|
879
866
|
get hideableColumns() {
|
|
880
|
-
return
|
|
867
|
+
return de.value;
|
|
881
868
|
},
|
|
882
|
-
isColumnHidden:
|
|
883
|
-
toggleColumnVisibility:
|
|
884
|
-
setColumnOrder:
|
|
869
|
+
isColumnHidden: he,
|
|
870
|
+
toggleColumnVisibility: ge,
|
|
871
|
+
setColumnOrder: fe,
|
|
885
872
|
get draggingField() {
|
|
886
|
-
return
|
|
873
|
+
return R.value;
|
|
887
874
|
},
|
|
888
|
-
onColumnDragStart:
|
|
889
|
-
onColumnDrop:
|
|
875
|
+
onColumnDragStart: pe,
|
|
876
|
+
onColumnDrop: me,
|
|
890
877
|
effectiveWidth: at,
|
|
891
878
|
isColumnResized: ot,
|
|
892
879
|
setColumnWidth: st,
|
|
893
880
|
get draggingRow() {
|
|
894
|
-
return
|
|
881
|
+
return B.value;
|
|
895
882
|
},
|
|
896
883
|
onRowDragStart: ct,
|
|
897
884
|
onRowDrop: dt,
|
|
898
885
|
get hasTreeData() {
|
|
899
|
-
return
|
|
886
|
+
return X.value;
|
|
900
887
|
},
|
|
901
888
|
get treeRows() {
|
|
902
|
-
return
|
|
889
|
+
return Ce.value;
|
|
903
890
|
},
|
|
904
|
-
isTreeRowExpanded:
|
|
905
|
-
toggleTreeRow:
|
|
906
|
-
setAllTreeRowsExpanded:
|
|
891
|
+
isTreeRowExpanded: we,
|
|
892
|
+
toggleTreeRow: Q,
|
|
893
|
+
setAllTreeRowsExpanded: Te,
|
|
907
894
|
isRowExpanded: lt,
|
|
908
895
|
toggleRowExpanded: ut,
|
|
909
896
|
get hasVirtualScroll() {
|
|
910
|
-
return
|
|
897
|
+
return Ee.value;
|
|
911
898
|
},
|
|
912
899
|
get visibleRows() {
|
|
913
|
-
return
|
|
900
|
+
return Ae.value;
|
|
914
901
|
},
|
|
915
902
|
get exportRows() {
|
|
916
|
-
return
|
|
903
|
+
return je.value;
|
|
917
904
|
},
|
|
918
905
|
get sortedRows() {
|
|
919
|
-
return
|
|
906
|
+
return Y.value;
|
|
920
907
|
},
|
|
921
908
|
get filteredRowCount() {
|
|
922
|
-
return
|
|
909
|
+
return Oe.value;
|
|
923
910
|
},
|
|
924
911
|
get locale() {
|
|
925
912
|
return a.value;
|
|
@@ -934,31 +921,31 @@ function fe(e) {
|
|
|
934
921
|
get filterValues() {
|
|
935
922
|
return y.value;
|
|
936
923
|
},
|
|
937
|
-
setFilterValue:
|
|
938
|
-
clearAllFilters:
|
|
924
|
+
setFilterValue: ye,
|
|
925
|
+
clearAllFilters: K,
|
|
939
926
|
get filterQuery() {
|
|
940
|
-
return
|
|
927
|
+
return x.value;
|
|
941
928
|
},
|
|
942
|
-
setFilterQuery:
|
|
929
|
+
setFilterQuery: ve,
|
|
943
930
|
get page() {
|
|
944
|
-
return
|
|
931
|
+
return $.value;
|
|
945
932
|
},
|
|
946
933
|
setPage: gt,
|
|
947
934
|
get pageCount() {
|
|
948
|
-
return
|
|
935
|
+
return De.value ? ke.value : 1;
|
|
949
936
|
},
|
|
950
937
|
get groupByField() {
|
|
951
|
-
return
|
|
938
|
+
return w.value;
|
|
952
939
|
},
|
|
953
940
|
setGroupByField: _t,
|
|
954
941
|
get groups() {
|
|
955
|
-
return
|
|
942
|
+
return xe.value;
|
|
956
943
|
},
|
|
957
944
|
get totals() {
|
|
958
|
-
return
|
|
945
|
+
return Se.value;
|
|
959
946
|
},
|
|
960
947
|
get selectedRows() {
|
|
961
|
-
return
|
|
948
|
+
return T.value;
|
|
962
949
|
},
|
|
963
950
|
isRowSelected: Me,
|
|
964
951
|
toggleRowSelection: Ne,
|
|
@@ -971,22 +958,22 @@ function fe(e) {
|
|
|
971
958
|
toggleSelectAll: Ie,
|
|
972
959
|
clearSelection: Le,
|
|
973
960
|
get editableColumns() {
|
|
974
|
-
return
|
|
961
|
+
return _e.value;
|
|
975
962
|
},
|
|
976
963
|
get editingRow() {
|
|
977
|
-
return
|
|
964
|
+
return j.value;
|
|
978
965
|
},
|
|
979
966
|
get isAddingRow() {
|
|
980
|
-
return
|
|
967
|
+
return M.value;
|
|
981
968
|
},
|
|
982
969
|
get rowDraft() {
|
|
983
|
-
return
|
|
970
|
+
return N.value;
|
|
984
971
|
},
|
|
985
972
|
get fieldErrors() {
|
|
986
|
-
return
|
|
973
|
+
return P.value;
|
|
987
974
|
},
|
|
988
975
|
get isValidating() {
|
|
989
|
-
return
|
|
976
|
+
return F.value;
|
|
990
977
|
},
|
|
991
978
|
isEditingRow: He,
|
|
992
979
|
isAnotherRowEditing: Ue,
|
|
@@ -1004,69 +991,66 @@ function fe(e) {
|
|
|
1004
991
|
pasteAt: it
|
|
1005
992
|
};
|
|
1006
993
|
}
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
function pe(e) {
|
|
994
|
+
// src/utils/exporters.ts
|
|
995
|
+
function ue(e) {
|
|
1010
996
|
return e.headerText || e.field;
|
|
1011
997
|
}
|
|
1012
|
-
function
|
|
1013
|
-
return
|
|
998
|
+
function H(e, t, n) {
|
|
999
|
+
return E(t[e.field], e.type ?? "string", e.format ?? "", n);
|
|
1014
1000
|
}
|
|
1015
|
-
function
|
|
1016
|
-
return "" + [t.map((e) =>
|
|
1001
|
+
function U(e, t, n) {
|
|
1002
|
+
return "" + [t.map((e) => N(ue(e))).join(","), ...e.map((e) => t.map((t) => N(H(t, e, n))).join(","))].join("\r\n");
|
|
1017
1003
|
}
|
|
1018
|
-
function
|
|
1019
|
-
|
|
1004
|
+
function de(e, t, n, r = "inandu-grid") {
|
|
1005
|
+
I(U(e, t, n), `${r}-export.csv`, "text/csv;charset=utf-8;");
|
|
1020
1006
|
}
|
|
1021
|
-
function
|
|
1007
|
+
function fe(e, t, n) {
|
|
1022
1008
|
let r = (e, t) => {
|
|
1023
1009
|
let n = t[e.field];
|
|
1024
1010
|
return e.type === "number" && typeof n == "number" && Number.isFinite(n) ? n : void 0;
|
|
1025
1011
|
}, i = (e, t) => {
|
|
1026
1012
|
let i = r(e, t);
|
|
1027
|
-
return i === void 0 ? `<Cell><Data ss:Type="String">${
|
|
1028
|
-
}, a = `<Row ss:StyleID="header">${t.map((e) => `<Cell><Data ss:Type="String">${
|
|
1013
|
+
return i === void 0 ? `<Cell><Data ss:Type="String">${P(H(e, t, n))}</Data></Cell>` : `<Cell><Data ss:Type="Number">${i}</Data></Cell>`;
|
|
1014
|
+
}, a = `<Row ss:StyleID="header">${t.map((e) => `<Cell><Data ss:Type="String">${P(ue(e))}</Data></Cell>`).join("")}</Row>`, o = e.map((e) => `<Row>${t.map((t) => i(t, e)).join("")}</Row>`).join("");
|
|
1029
1015
|
return "<?xml version=\"1.0\"?><?mso-application progid=\"Excel.Sheet\"?><Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\"><Styles><Style ss:ID=\"header\"><Font ss:Bold=\"1\"/></Style></Styles><Worksheet ss:Name=\"Sheet1\"><Table>" + a + o + "</Table></Worksheet></Workbook>";
|
|
1030
1016
|
}
|
|
1031
|
-
function
|
|
1032
|
-
|
|
1017
|
+
function pe(e, t, n, r = "inandu-grid") {
|
|
1018
|
+
I(fe(e, t, n), `${r}-export.xls`, "application/vnd.ms-excel");
|
|
1033
1019
|
}
|
|
1034
|
-
function
|
|
1035
|
-
let i = t.map((e) => `<th>${
|
|
1020
|
+
function me(e, t, n, r = "inandu-grid") {
|
|
1021
|
+
let i = t.map((e) => `<th>${P(ue(e))}</th>`).join(""), a = e.map((e) => `<tr>${t.map((t) => `<td>${P(H(t, e, n))}</td>`).join("")}</tr>`).join(""), o = `<!doctype html><html><head><meta charset="utf-8"><title>${P(r)}</title><style>table{border-collapse:collapse;width:100%}th,td{border:1px solid #333;padding:4px 8px;text-align:left}th{background:#eee}</style></head><body><table><thead><tr>${i}</tr></thead><tbody>${a}</tbody></table></body></html>`, s = window.open("", "_blank");
|
|
1036
1022
|
s && (s.document.write(o), s.document.close(), s.focus(), setTimeout(() => s.print(), 0));
|
|
1037
1023
|
}
|
|
1038
|
-
async function
|
|
1039
|
-
let { jsPDF: i } = await import("jspdf"), a = t.map(
|
|
1024
|
+
async function he(e, t, n, r = "inandu-grid") {
|
|
1025
|
+
let { jsPDF: i } = await import("jspdf"), a = t.map(ue), o = new i({ orientation: "landscape" }), s = o.internal.pageSize.getWidth() - 20, c = o.internal.pageSize.getHeight() - 10, l = s / (t.length || 1), u = 10, d = (e, t) => {
|
|
1040
1026
|
o.setFont("helvetica", t ? "bold" : "normal");
|
|
1041
1027
|
let n = 10;
|
|
1042
1028
|
e.forEach((e) => {
|
|
1043
|
-
o.text(
|
|
1029
|
+
o.text(F(o, e, l - 4), n + 2, u + 6), n += l;
|
|
1044
1030
|
}), u += 8;
|
|
1045
1031
|
};
|
|
1046
1032
|
d(a, !0);
|
|
1047
|
-
for (let r of e) u + 8 > c && (o.addPage(), u = 10, d(a, !0)), d(t.map((e) =>
|
|
1048
|
-
|
|
1033
|
+
for (let r of e) u + 8 > c && (o.addPage(), u = 10, d(a, !0)), d(t.map((e) => H(e, r, n)), !1);
|
|
1034
|
+
I(o.output("blob"), `${r}-export.pdf`);
|
|
1049
1035
|
}
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
let r = typeof CSS < "u" && CSS.escape ? CSS.escape(t) : k(t), i = Array.from(e.querySelectorAll(`td[data-field="${r}"]`)), a = e.querySelector(`th[data-field="${r}"]`), o = i[0] ?? a ?? e, s = getComputedStyle(o), c = document.createElement("span");
|
|
1036
|
+
// src/utils/measureColumn.ts
|
|
1037
|
+
function ge(e, t, n) {
|
|
1038
|
+
let r = typeof CSS < "u" && CSS.escape ? CSS.escape(t) : M(t), i = Array.from(e.querySelectorAll(`td[data-field="${r}"]`)), a = e.querySelector(`th[data-field="${r}"]`), o = i[0] ?? a ?? e, s = getComputedStyle(o), c = document.createElement("span");
|
|
1054
1039
|
c.style.cssText = "position:absolute;left:-9999px;top:-9999px;visibility:hidden;white-space:pre;pointer-events:none", c.style.font = s.font || `${s.fontStyle} ${s.fontWeight} ${s.fontSize}/${s.lineHeight} ${s.fontFamily}`, c.style.letterSpacing = s.letterSpacing, document.body.appendChild(c);
|
|
1055
1040
|
let l = (parseFloat(s.paddingLeft) || 0) + (parseFloat(s.paddingRight) || 0) + 2, u = 0;
|
|
1056
1041
|
c.textContent = n || t, u = Math.max(u, c.offsetWidth + 44);
|
|
1057
1042
|
for (let e of i) c.textContent = (e.textContent ?? "").replace(/\s+/g, " ").trim(), u = Math.max(u, c.offsetWidth + l);
|
|
1058
1043
|
return c.remove(), i.length || a ? Math.ceil(u) : 0;
|
|
1059
1044
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
1045
|
+
// src/components/EditCell.vue?vue&type=script&setup=true&lang.ts
|
|
1046
|
+
var _e = { class: "inandu-grid-edit-cell" }, ve = ["aria-label", "checked"], W = [
|
|
1063
1047
|
"aria-label",
|
|
1064
1048
|
"type",
|
|
1065
1049
|
"value"
|
|
1066
|
-
],
|
|
1050
|
+
], G = {
|
|
1067
1051
|
key: 2,
|
|
1068
1052
|
class: "inandu-grid-field-error"
|
|
1069
|
-
},
|
|
1053
|
+
}, ye = /* @__PURE__ */ c({
|
|
1070
1054
|
__name: "EditCell",
|
|
1071
1055
|
props: {
|
|
1072
1056
|
column: {},
|
|
@@ -1077,21 +1061,21 @@ var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
|
1077
1061
|
emits: ["change"],
|
|
1078
1062
|
setup(e, { emit: n }) {
|
|
1079
1063
|
let a = e, o = n, s = t(() => a.column.type ?? "string"), c = t(() => a.t("MsgEditCell", { column: a.column.headerText ?? a.column.field })), l = t(() => typeof a.value == "string" ? a.value : "");
|
|
1080
|
-
return (t, n) => (p(), i("span",
|
|
1064
|
+
return (t, n) => (p(), i("span", _e, [s.value === "boolean" ? (p(), i("input", {
|
|
1081
1065
|
key: 0,
|
|
1082
1066
|
"aria-label": c.value,
|
|
1083
1067
|
type: "checkbox",
|
|
1084
1068
|
checked: !!e.value,
|
|
1085
1069
|
onChange: n[0] ||= (e) => o("change", e.target.checked)
|
|
1086
|
-
}, null, 40,
|
|
1070
|
+
}, null, 40, ve)) : (p(), i("input", {
|
|
1087
1071
|
key: 1,
|
|
1088
1072
|
"aria-label": c.value,
|
|
1089
1073
|
type: s.value === "date" ? "date" : s.value === "number" ? "number" : "text",
|
|
1090
1074
|
value: l.value,
|
|
1091
1075
|
onInput: n[1] ||= (e) => o("change", e.target.value)
|
|
1092
|
-
}, null, 40,
|
|
1076
|
+
}, null, 40, W)), e.error ? (p(), i("span", G, g(e.error), 1)) : r("", !0)]));
|
|
1093
1077
|
}
|
|
1094
|
-
}),
|
|
1078
|
+
}), K = c({
|
|
1095
1079
|
name: "InanduGridRenderNodes",
|
|
1096
1080
|
props: { nodes: {
|
|
1097
1081
|
type: null,
|
|
@@ -1100,18 +1084,18 @@ var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
|
1100
1084
|
setup(e) {
|
|
1101
1085
|
return () => e.nodes;
|
|
1102
1086
|
}
|
|
1103
|
-
}),
|
|
1087
|
+
}), q = ["data-row-index", "aria-selected"], be = { key: 0 }, J = ["aria-label", "title"], Y = { key: 1 }, xe = ["aria-label"], Se = ["aria-label", "checked"], X = [
|
|
1104
1088
|
"data-field",
|
|
1105
1089
|
"tabindex",
|
|
1106
1090
|
"onMousedown",
|
|
1107
1091
|
"onMouseenter"
|
|
1108
|
-
],
|
|
1092
|
+
], Z = {
|
|
1109
1093
|
key: 3,
|
|
1110
1094
|
class: "inandu-grid-row-actions"
|
|
1111
|
-
},
|
|
1095
|
+
}, Ce = ["disabled"], we = ["disabled"], Q = ["disabled"], Te = ["disabled"], Ee = {
|
|
1112
1096
|
key: 0,
|
|
1113
1097
|
class: "inandu-grid-detail-row"
|
|
1114
|
-
},
|
|
1098
|
+
}, De = ["colspan"], Oe = /* @__PURE__ */ c({
|
|
1115
1099
|
__name: "DataRow",
|
|
1116
1100
|
props: {
|
|
1117
1101
|
ctx: {},
|
|
@@ -1146,38 +1130,39 @@ var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
|
1146
1130
|
function y(e) {
|
|
1147
1131
|
d.hasRowDragHandle && (e.preventDefault(), f("rowDragOver"));
|
|
1148
1132
|
}
|
|
1149
|
-
function
|
|
1133
|
+
function b(e) {
|
|
1150
1134
|
d.hasRowDragHandle && (e.preventDefault(), f("rowDrop"));
|
|
1151
1135
|
}
|
|
1152
|
-
function
|
|
1136
|
+
function x(e) {
|
|
1153
1137
|
f("rowDragStart"), e.dataTransfer?.setData("text/plain", "row");
|
|
1154
1138
|
}
|
|
1155
|
-
function
|
|
1139
|
+
function S(e, t) {
|
|
1156
1140
|
d.ctx.cellRangeSelection && d.ctx.onCellRangeMouseDown(e, d.rowIndex, t);
|
|
1157
1141
|
}
|
|
1158
|
-
function
|
|
1142
|
+
function ee(e) {
|
|
1159
1143
|
d.ctx.cellRangeSelection && d.ctx.onCellRangeMouseEnter(d.rowIndex, e);
|
|
1160
1144
|
}
|
|
1161
1145
|
return (t, c) => (p(), i(e, null, [a("tr", {
|
|
1162
1146
|
"data-row-index": o.rowIndex,
|
|
1147
|
+
"aria-selected": o.ctx.selectable ? o.ctx.isRowSelected(o.row) : void 0,
|
|
1163
1148
|
class: l(o.isDragOverRow ? "inandu-drag-over" : void 0),
|
|
1164
1149
|
onDragover: y,
|
|
1165
1150
|
onDragleave: c[6] ||= (e) => o.hasRowDragHandle && f("rowDragLeave"),
|
|
1166
|
-
onDrop:
|
|
1151
|
+
onDrop: b
|
|
1167
1152
|
}, [
|
|
1168
|
-
o.hasMasterDetail ? (p(), i("td",
|
|
1153
|
+
o.hasMasterDetail ? (p(), i("td", be, [a("button", {
|
|
1169
1154
|
type: "button",
|
|
1170
1155
|
class: "inandu-grid-detail-toggle",
|
|
1171
1156
|
"aria-label": _.value,
|
|
1172
1157
|
title: _.value,
|
|
1173
1158
|
onClick: c[0] ||= (e) => f("toggleExpanded")
|
|
1174
|
-
}, g(o.isRowExpanded ? "▾" : "▸"), 9,
|
|
1175
|
-
o.hasRowDragHandle ? (p(), i("td",
|
|
1159
|
+
}, g(o.isRowExpanded ? "▾" : "▸"), 9, J)])) : r("", !0),
|
|
1160
|
+
o.hasRowDragHandle ? (p(), i("td", Y, [a("span", {
|
|
1176
1161
|
class: "inandu-grid-row-drag-handle",
|
|
1177
1162
|
"aria-label": o.ctx.t("MsgDragRow"),
|
|
1178
1163
|
draggable: "true",
|
|
1179
|
-
onDragstart:
|
|
1180
|
-
}, "⋮⋮", 40,
|
|
1164
|
+
onDragstart: x
|
|
1165
|
+
}, "⋮⋮", 40, xe)])) : r("", !0),
|
|
1181
1166
|
o.ctx.selectable ? (p(), i("td", {
|
|
1182
1167
|
key: 2,
|
|
1183
1168
|
style: u(o.ctx.selectColumnStyle)
|
|
@@ -1186,16 +1171,16 @@ var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
|
1186
1171
|
type: "checkbox",
|
|
1187
1172
|
checked: o.ctx.isRowSelected(o.row),
|
|
1188
1173
|
onChange: c[1] ||= (e) => o.ctx.toggleRowSelection(o.row)
|
|
1189
|
-
}, null, 40,
|
|
1174
|
+
}, null, 40, Se)], 4)) : r("", !0),
|
|
1190
1175
|
(p(!0), i(e, null, m(o.ctx.columns, (t, r) => (p(), i("td", {
|
|
1191
1176
|
key: t.field,
|
|
1192
1177
|
style: u(o.ctx.columnStyle(t)),
|
|
1193
1178
|
"data-field": t.field,
|
|
1194
1179
|
tabindex: o.ctx.clipboard ? 0 : void 0,
|
|
1195
1180
|
class: l(o.ctx.cellRangeSelection && o.ctx.isCellInRange(o.rowIndex, r) ? "inandu-cell-range-selected" : void 0),
|
|
1196
|
-
onMousedown: (e) =>
|
|
1197
|
-
onMouseenter: (e) =>
|
|
1198
|
-
}, [h.value && t.editable ? (p(), i(e, { key: 0 }, [o.ctx.editorContent(t, o.row) === void 0 ? (p(), n(
|
|
1181
|
+
onMousedown: (e) => S(e, r),
|
|
1182
|
+
onMouseenter: (e) => ee(r)
|
|
1183
|
+
}, [h.value && t.editable ? (p(), i(e, { key: 0 }, [o.ctx.editorContent(t, o.row) === void 0 ? (p(), n(ye, {
|
|
1199
1184
|
key: 1,
|
|
1200
1185
|
column: t,
|
|
1201
1186
|
value: o.ctx.rowDraft[t.field],
|
|
@@ -1208,38 +1193,38 @@ var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
|
1208
1193
|
"error",
|
|
1209
1194
|
"t",
|
|
1210
1195
|
"onChange"
|
|
1211
|
-
])) : (p(), n(v(
|
|
1196
|
+
])) : (p(), n(v(K), {
|
|
1212
1197
|
key: 0,
|
|
1213
1198
|
nodes: o.ctx.editorContent(t, o.row)
|
|
1214
|
-
}, null, 8, ["nodes"]))], 64)) : (p(), n(v(
|
|
1199
|
+
}, null, 8, ["nodes"]))], 64)) : (p(), n(v(K), {
|
|
1215
1200
|
key: 1,
|
|
1216
1201
|
nodes: o.ctx.cellContent(t, o.row)
|
|
1217
|
-
}, null, 8, ["nodes"]))], 46,
|
|
1218
|
-
o.ctx.hasRowActions ? (p(), i("td",
|
|
1202
|
+
}, null, 8, ["nodes"]))], 46, X))), 128)),
|
|
1203
|
+
o.ctx.hasRowActions ? (p(), i("td", Z, [h.value ? (p(), i(e, { key: 0 }, [a("button", {
|
|
1219
1204
|
type: "button",
|
|
1220
1205
|
disabled: o.ctx.isValidating,
|
|
1221
1206
|
onClick: c[2] ||= (e) => o.ctx.saveRow(o.row)
|
|
1222
|
-
}, g(o.ctx.t("MsgSaveRow")), 9,
|
|
1207
|
+
}, g(o.ctx.t("MsgSaveRow")), 9, Ce), a("button", {
|
|
1223
1208
|
type: "button",
|
|
1224
1209
|
disabled: o.ctx.isValidating,
|
|
1225
1210
|
onClick: c[3] ||= (e) => o.ctx.cancelRowEdit()
|
|
1226
|
-
}, g(o.ctx.t("MsgCancelRowEdit")), 9,
|
|
1211
|
+
}, g(o.ctx.t("MsgCancelRowEdit")), 9, we)], 64)) : (p(), i(e, { key: 1 }, [o.ctx.editableColumnCount > 0 ? (p(), i("button", {
|
|
1227
1212
|
key: 0,
|
|
1228
1213
|
type: "button",
|
|
1229
1214
|
disabled: o.ctx.isAnotherRowEditing(o.row),
|
|
1230
1215
|
onClick: c[4] ||= (e) => o.ctx.startEditingRow(o.row)
|
|
1231
|
-
}, g(o.ctx.t("MsgEditRow")), 9,
|
|
1216
|
+
}, g(o.ctx.t("MsgEditRow")), 9, Q)) : r("", !0), o.ctx.deletable ? (p(), i("button", {
|
|
1232
1217
|
key: 1,
|
|
1233
1218
|
type: "button",
|
|
1234
1219
|
disabled: o.ctx.isAnotherRowEditing(o.row),
|
|
1235
1220
|
onClick: c[5] ||= (e) => o.ctx.deleteRow(o.row)
|
|
1236
|
-
}, g(o.ctx.t("MsgDeleteRow")), 9,
|
|
1237
|
-
], 42,
|
|
1221
|
+
}, g(o.ctx.t("MsgDeleteRow")), 9, Te)) : r("", !0)], 64))])) : r("", !0)
|
|
1222
|
+
], 42, q), o.hasMasterDetail && o.isRowExpanded ? (p(), i("tr", Ee, [a("td", { colspan: o.ctx.columns.length + o.ctx.extraColumnCount }, [s(v(K), { nodes: o.ctx.detailContent(o.row) }, null, 8, ["nodes"])], 8, De)])) : r("", !0)], 64));
|
|
1238
1223
|
}
|
|
1239
|
-
}),
|
|
1224
|
+
}), ke = {
|
|
1240
1225
|
key: 0,
|
|
1241
1226
|
class: "inandu-grid-filter-range"
|
|
1242
|
-
},
|
|
1227
|
+
}, $ = ["aria-label", "value"], Ae = ["aria-label", "value"], je = {
|
|
1243
1228
|
key: 1,
|
|
1244
1229
|
class: "inandu-grid-filter-range"
|
|
1245
1230
|
}, Me = ["aria-label", "value"], Ne = ["aria-label", "value"], Pe = ["aria-label", "value"], Fe = { value: "" }, Ie = ["aria-label", "value"], Le = /* @__PURE__ */ c({
|
|
@@ -1255,17 +1240,17 @@ var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
|
1255
1240
|
function l(e) {
|
|
1256
1241
|
return e.target.value;
|
|
1257
1242
|
}
|
|
1258
|
-
return (t, n) => s.value === "number" ? (p(), i("span",
|
|
1243
|
+
return (t, n) => s.value === "number" ? (p(), i("span", ke, [a("input", {
|
|
1259
1244
|
"aria-label": `${c.value} ${e.t("MsgFilterMin")}`,
|
|
1260
1245
|
type: "number",
|
|
1261
1246
|
value: e.value?.min ?? "",
|
|
1262
1247
|
onInput: n[0] ||= (e) => o("change", { min: l(e) })
|
|
1263
|
-
}, null, 40,
|
|
1248
|
+
}, null, 40, $), a("input", {
|
|
1264
1249
|
"aria-label": `${c.value} ${e.t("MsgFilterMax")}`,
|
|
1265
1250
|
type: "number",
|
|
1266
1251
|
value: e.value?.max ?? "",
|
|
1267
1252
|
onInput: n[1] ||= (e) => o("change", { max: l(e) })
|
|
1268
|
-
}, null, 40,
|
|
1253
|
+
}, null, 40, Ae)])) : s.value === "date" ? (p(), i("span", je, [a("input", {
|
|
1269
1254
|
"aria-label": `${c.value} ${e.t("MsgFilterFrom")}`,
|
|
1270
1255
|
type: "date",
|
|
1271
1256
|
value: e.value?.from ?? "",
|
|
@@ -1292,26 +1277,31 @@ var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
|
1292
1277
|
onInput: n[5] ||= (e) => o("change", { text: l(e) })
|
|
1293
1278
|
}, null, 40, Ie));
|
|
1294
1279
|
}
|
|
1295
|
-
}), Re = { class: "inandu-grid-vue" }, ze = {
|
|
1280
|
+
}), Re = { class: "inandu-grid-vue" }, ze = {
|
|
1281
|
+
class: "inandu-grid-sr-only",
|
|
1282
|
+
role: "status",
|
|
1283
|
+
"aria-live": "polite"
|
|
1284
|
+
}, Be = { class: "inandu-grid-search" }, Ve = [
|
|
1296
1285
|
"aria-label",
|
|
1297
1286
|
"placeholder",
|
|
1298
1287
|
"value"
|
|
1299
|
-
],
|
|
1288
|
+
], He = { class: "inandu-grid-toolbar" }, Ue = {
|
|
1300
1289
|
key: 3,
|
|
1301
1290
|
class: "inandu-grid-column-toggle"
|
|
1302
|
-
},
|
|
1291
|
+
}, We = [
|
|
1303
1292
|
"aria-label",
|
|
1304
1293
|
"checked",
|
|
1305
1294
|
"onChange"
|
|
1306
|
-
],
|
|
1295
|
+
], Ge = {
|
|
1307
1296
|
key: 0,
|
|
1308
1297
|
class: "inandu-grid-group-by"
|
|
1309
|
-
},
|
|
1298
|
+
}, Ke = ["value"], qe = { value: "" }, Je = ["value"], Ye = ["aria-rowcount"], Xe = { key: 0 }, Ze = { key: 1 }, Qe = [
|
|
1310
1299
|
"aria-label",
|
|
1311
1300
|
"checked",
|
|
1312
1301
|
"indeterminate"
|
|
1313
|
-
],
|
|
1302
|
+
], $e = [
|
|
1314
1303
|
"data-field",
|
|
1304
|
+
"aria-sort",
|
|
1315
1305
|
"draggable",
|
|
1316
1306
|
"aria-label",
|
|
1317
1307
|
"onDragstart",
|
|
@@ -1319,43 +1309,47 @@ var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
|
1319
1309
|
"onDragleave",
|
|
1320
1310
|
"onDrop",
|
|
1321
1311
|
"onClick"
|
|
1322
|
-
],
|
|
1312
|
+
], et = {
|
|
1323
1313
|
key: 0,
|
|
1324
1314
|
class: "inandu-grid-sort-priority"
|
|
1325
|
-
},
|
|
1315
|
+
}, tt = ["onMousedown", "onDblclick"], nt = { key: 3 }, rt = { class: "inandu-grid-filter-row" }, it = { key: 0 }, at = { key: 1 }, ot = { key: 3 }, st = {
|
|
1326
1316
|
key: 0,
|
|
1327
1317
|
class: "inandu-grid-new-row"
|
|
1328
|
-
},
|
|
1318
|
+
}, ct = {
|
|
1329
1319
|
key: 1,
|
|
1330
1320
|
class: "inandu-grid-row-actions"
|
|
1331
|
-
},
|
|
1321
|
+
}, lt = ["disabled"], ut = ["disabled"], dt = { key: 1 }, ft = ["colspan"], pt = [
|
|
1322
|
+
"aria-selected",
|
|
1323
|
+
"aria-level",
|
|
1324
|
+
"aria-expanded"
|
|
1325
|
+
], mt = [
|
|
1332
1326
|
"aria-label",
|
|
1333
1327
|
"checked",
|
|
1334
1328
|
"onChange"
|
|
1335
|
-
],
|
|
1329
|
+
], ht = [
|
|
1336
1330
|
"aria-label",
|
|
1337
1331
|
"title",
|
|
1338
1332
|
"onClick"
|
|
1339
|
-
],
|
|
1333
|
+
], gt = {
|
|
1340
1334
|
key: 1,
|
|
1341
1335
|
class: "inandu-grid-tree-toggle-spacer",
|
|
1342
1336
|
"aria-hidden": "true"
|
|
1343
|
-
},
|
|
1337
|
+
}, _t = {
|
|
1344
1338
|
key: 1,
|
|
1345
1339
|
class: "inandu-grid-row-actions"
|
|
1346
|
-
},
|
|
1340
|
+
}, vt = { class: "inandu-grid-group-row" }, yt = ["colspan"], bt = {
|
|
1347
1341
|
key: 0,
|
|
1348
1342
|
class: "inandu-grid-group-aggregates"
|
|
1349
|
-
},
|
|
1343
|
+
}, xt = {
|
|
1350
1344
|
key: 0,
|
|
1351
1345
|
"aria-hidden": "true"
|
|
1352
|
-
},
|
|
1346
|
+
}, St = ["colspan"], Ct = {
|
|
1353
1347
|
key: 1,
|
|
1354
1348
|
"aria-hidden": "true"
|
|
1355
|
-
},
|
|
1349
|
+
}, wt = ["colspan"], Tt = { key: 0 }, Et = { class: "inandu-grid-totals-row" }, Dt = { key: 0 }, Ot = { key: 1 }, kt = { key: 3 }, At = {
|
|
1356
1350
|
key: 1,
|
|
1357
1351
|
class: "inandu-grid-pagination"
|
|
1358
|
-
},
|
|
1352
|
+
}, jt = ["disabled"], Mt = ["disabled"], Nt = /* @__PURE__ */ c({
|
|
1359
1353
|
name: "InanduGrid",
|
|
1360
1354
|
__name: "InanduGrid",
|
|
1361
1355
|
props: {
|
|
@@ -1401,7 +1395,7 @@ var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
|
1401
1395
|
"rowOrderChange"
|
|
1402
1396
|
],
|
|
1403
1397
|
setup(c, { expose: f, emit: _ }) {
|
|
1404
|
-
function
|
|
1398
|
+
function S(e, t) {
|
|
1405
1399
|
return {
|
|
1406
1400
|
minRow: Math.min(e.row, t.row),
|
|
1407
1401
|
maxRow: Math.max(e.row, t.row),
|
|
@@ -1409,132 +1403,137 @@ var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
|
1409
1403
|
maxCol: Math.max(e.col, t.col)
|
|
1410
1404
|
};
|
|
1411
1405
|
}
|
|
1412
|
-
function
|
|
1406
|
+
function ee(e, t, n) {
|
|
1413
1407
|
return t >= e.minRow && t <= e.maxRow && n >= e.minCol && n <= e.maxCol;
|
|
1414
1408
|
}
|
|
1415
|
-
let
|
|
1416
|
-
rows:
|
|
1417
|
-
columns:
|
|
1418
|
-
locale:
|
|
1419
|
-
lang:
|
|
1420
|
-
pageSize:
|
|
1421
|
-
selectable:
|
|
1422
|
-
deleteConfirmMessage:
|
|
1423
|
-
bulkDeleteConfirmMessage:
|
|
1424
|
-
onRowSave: (e) =>
|
|
1425
|
-
onRowCreate: (e) =>
|
|
1426
|
-
onRowDelete: (e) =>
|
|
1427
|
-
onRowsDelete: (e) =>
|
|
1428
|
-
onCellsPaste: (e) =>
|
|
1429
|
-
onRowOrderChange: (e) =>
|
|
1430
|
-
treeChildrenKey:
|
|
1431
|
-
treeDefaultExpanded:
|
|
1432
|
-
singleDetailExpand:
|
|
1433
|
-
extraRowFilter:
|
|
1434
|
-
virtualScroll:
|
|
1435
|
-
serverSide:
|
|
1436
|
-
onQueryChange: (e) =>
|
|
1409
|
+
let C = c, w = _, T = y(), D = le(() => ({
|
|
1410
|
+
rows: C.rows,
|
|
1411
|
+
columns: C.columns,
|
|
1412
|
+
locale: C.locale,
|
|
1413
|
+
lang: C.lang,
|
|
1414
|
+
pageSize: C.pageSize,
|
|
1415
|
+
selectable: C.selectable,
|
|
1416
|
+
deleteConfirmMessage: C.deleteConfirmMessage,
|
|
1417
|
+
bulkDeleteConfirmMessage: C.bulkDeleteConfirmMessage,
|
|
1418
|
+
onRowSave: (e) => w("rowSave", e),
|
|
1419
|
+
onRowCreate: (e) => w("rowCreate", e),
|
|
1420
|
+
onRowDelete: (e) => w("rowDelete", e),
|
|
1421
|
+
onRowsDelete: (e) => w("rowsDelete", e),
|
|
1422
|
+
onCellsPaste: (e) => w("cellsPaste", e),
|
|
1423
|
+
onRowOrderChange: (e) => w("rowOrderChange", e),
|
|
1424
|
+
treeChildrenKey: C.treeChildrenKey,
|
|
1425
|
+
treeDefaultExpanded: C.treeDefaultExpanded,
|
|
1426
|
+
singleDetailExpand: C.singleDetailExpand,
|
|
1427
|
+
extraRowFilter: C.extraRowFilter,
|
|
1428
|
+
virtualScroll: C.virtualScroll,
|
|
1429
|
+
serverSide: C.serverSide,
|
|
1430
|
+
onQueryChange: (e) => w("queryChange", e)
|
|
1437
1431
|
}));
|
|
1438
|
-
f({ grid:
|
|
1439
|
-
let
|
|
1440
|
-
|
|
1441
|
-
let
|
|
1442
|
-
function
|
|
1443
|
-
e.preventDefault(),
|
|
1444
|
-
let n = e.clientX, r =
|
|
1445
|
-
window.addEventListener("mousemove", i), window.addEventListener("mouseup", a),
|
|
1446
|
-
window.removeEventListener("mousemove", i), window.removeEventListener("mouseup", a),
|
|
1432
|
+
f({ grid: D });
|
|
1433
|
+
let O = t(() => se(C.lang ?? C.locale)), k = h(void 0), A = h(void 0), te = h(0), ne = h(null);
|
|
1434
|
+
b(() => D.selectedRows, (e) => w("selectionChange", Array.from(e)), { immediate: !0 });
|
|
1435
|
+
let re;
|
|
1436
|
+
function ie(e, t) {
|
|
1437
|
+
e.preventDefault(), re?.();
|
|
1438
|
+
let n = e.clientX, r = D.effectiveWidth(t), i = (e) => D.setColumnWidth(t, r + (e.clientX - n)), a = () => re?.();
|
|
1439
|
+
window.addEventListener("mousemove", i), window.addEventListener("mouseup", a), re = () => {
|
|
1440
|
+
window.removeEventListener("mousemove", i), window.removeEventListener("mouseup", a), re = void 0;
|
|
1447
1441
|
};
|
|
1448
1442
|
}
|
|
1449
|
-
function
|
|
1450
|
-
if (!
|
|
1443
|
+
function M(e, t) {
|
|
1444
|
+
if (!C.autosize || !ne.value) return;
|
|
1451
1445
|
e.preventDefault(), e.stopPropagation();
|
|
1452
|
-
let n =
|
|
1453
|
-
n > 0 &&
|
|
1446
|
+
let n = ge(ne.value, t.field, t.headerText ?? t.field);
|
|
1447
|
+
n > 0 && D.setColumnWidth(t.field, Math.min(600, n));
|
|
1454
1448
|
}
|
|
1455
|
-
let
|
|
1456
|
-
function
|
|
1457
|
-
return
|
|
1449
|
+
let N = t(() => C.cellRangeSelection && !D.groupByField && !D.hasVirtualScroll && !D.hasTreeData), P = h(void 0), F = h(void 0), I = h([]), L = !1, R = t(() => P.value && F.value ? S(P.value, F.value) : void 0), z = t(() => R.value ? [...I.value, R.value] : I.value);
|
|
1450
|
+
function ae(e, t) {
|
|
1451
|
+
return z.value.some((n) => ee(n, e, t));
|
|
1458
1452
|
}
|
|
1459
|
-
function
|
|
1453
|
+
function B(e) {
|
|
1460
1454
|
return {
|
|
1461
|
-
rows:
|
|
1462
|
-
fields:
|
|
1455
|
+
rows: D.visibleRows.slice(e.minRow, e.maxRow + 1),
|
|
1456
|
+
fields: D.visibleColumns.slice(e.minCol, e.maxCol + 1).map((e) => e.field)
|
|
1463
1457
|
};
|
|
1464
1458
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
() =>
|
|
1469
|
-
() =>
|
|
1459
|
+
b([
|
|
1460
|
+
N,
|
|
1461
|
+
z,
|
|
1462
|
+
() => D.visibleRows,
|
|
1463
|
+
() => D.visibleColumns
|
|
1470
1464
|
], () => {
|
|
1471
|
-
|
|
1465
|
+
N.value && (w("cellRangeChange", R.value ? B(R.value) : void 0), w("cellRangesChange", z.value.map(B)));
|
|
1472
1466
|
}, { immediate: !0 });
|
|
1473
|
-
function
|
|
1474
|
-
e.button === 0 && (
|
|
1467
|
+
function V(e, t, n) {
|
|
1468
|
+
e.button === 0 && (L = !0, C.multiRange && (e.ctrlKey || e.metaKey) && !e.shiftKey ? (R.value && (I.value = [...I.value, R.value]), P.value = {
|
|
1475
1469
|
row: t,
|
|
1476
1470
|
col: n
|
|
1477
|
-
}) :
|
|
1471
|
+
}) : e.shiftKey && P.value || (I.value = [], P.value = {
|
|
1478
1472
|
row: t,
|
|
1479
1473
|
col: n
|
|
1480
|
-
}),
|
|
1474
|
+
}), F.value = {
|
|
1481
1475
|
row: t,
|
|
1482
1476
|
col: n
|
|
1483
1477
|
});
|
|
1484
1478
|
}
|
|
1485
|
-
function
|
|
1486
|
-
|
|
1479
|
+
function oe(e, t) {
|
|
1480
|
+
L && (F.value = {
|
|
1487
1481
|
row: e,
|
|
1488
1482
|
col: t
|
|
1489
1483
|
});
|
|
1490
1484
|
}
|
|
1491
|
-
let
|
|
1492
|
-
|
|
1485
|
+
let ce = () => {
|
|
1486
|
+
L = !1;
|
|
1493
1487
|
};
|
|
1494
|
-
|
|
1495
|
-
e && (document.addEventListener("mouseup",
|
|
1496
|
-
}, { immediate: !0 }), d(() =>
|
|
1497
|
-
function
|
|
1498
|
-
let t =
|
|
1499
|
-
return t.map((e) => n.map((t) =>
|
|
1488
|
+
b(N, (e, t, n) => {
|
|
1489
|
+
e && (document.addEventListener("mouseup", ce), n(() => document.removeEventListener("mouseup", ce)));
|
|
1490
|
+
}, { immediate: !0 }), d(() => re?.());
|
|
1491
|
+
function ue(e) {
|
|
1492
|
+
let t = D.visibleRows.slice(e.minRow, e.maxRow + 1), n = D.visibleColumns.slice(e.minCol, e.maxCol + 1);
|
|
1493
|
+
return t.map((e) => n.map((t) => E(e[t.field], t.type ?? "string", t.format ?? "", C.locale)).join(" ")).join("\n");
|
|
1494
|
+
}
|
|
1495
|
+
let H = t(() => D.visibleColumns.filter((e) => e.aggregate)), U = t(() => C.serverSide ? [] : D.visibleColumns.filter((e) => e.groupable !== !1)), fe = t(() => D.groups ? D.groups.length === 0 : D.visibleRows.length === 0);
|
|
1496
|
+
function _e(e) {
|
|
1497
|
+
let t = D.sortDirectionFor(e);
|
|
1498
|
+
return t === "asc" ? "ascending" : t === "desc" ? "descending" : "none";
|
|
1500
1499
|
}
|
|
1501
|
-
let
|
|
1502
|
-
function
|
|
1503
|
-
|
|
1500
|
+
let ve = t(() => C.serverSide || C.pageSize > 0 && !D.groupByField || D.hasVirtualScroll ? (C.serverSide ? C.serverSide.totalItems : D.filteredRowCount) + 2 : void 0), W = t(() => D.editableColumns.length > 0 || C.deletable || C.creatable), G = t(() => C.rowReorder && !D.groupByField && !D.hasVirtualScroll), q = t(() => (!!T.detail || !!C.renderDetail) && !D.groupByField && !D.hasVirtualScroll), be = t(() => +!!q.value + +!!G.value + +!!C.selectable + +!!W.value), J = t(() => D.visibleColumns.length + be.value), Y = t(() => D.hasVirtualScroll ? Math.max(0, Math.floor(te.value / C.virtualRowHeight) - C.overscan) : 0), xe = t(() => D.hasVirtualScroll ? Math.min(D.visibleRows.length, Math.ceil((te.value + C.height) / C.virtualRowHeight) + C.overscan) : D.visibleRows.length), Se = t(() => D.hasVirtualScroll ? D.visibleRows.slice(Y.value, xe.value) : D.visibleRows), X = t(() => Y.value * C.virtualRowHeight), Z = t(() => (D.visibleRows.length - xe.value) * C.virtualRowHeight);
|
|
1501
|
+
function Ce(e) {
|
|
1502
|
+
D.hasVirtualScroll && (te.value = e.currentTarget.scrollTop);
|
|
1504
1503
|
}
|
|
1505
|
-
function
|
|
1506
|
-
|
|
1507
|
-
...
|
|
1504
|
+
function we(e, t) {
|
|
1505
|
+
D.setFilterValue(e, {
|
|
1506
|
+
...D.filterValues[e],
|
|
1508
1507
|
...t
|
|
1509
1508
|
});
|
|
1510
1509
|
}
|
|
1511
|
-
function
|
|
1512
|
-
let t = e.width !== void 0 ||
|
|
1510
|
+
function Q(e) {
|
|
1511
|
+
let t = e.width !== void 0 || D.isColumnResized(e.field) ? { width: `${D.effectiveWidth(e.field)}px` } : {}, n = D.columnPinnedSide(e.field);
|
|
1513
1512
|
return n === "left" ? {
|
|
1514
1513
|
...t,
|
|
1515
1514
|
position: "sticky",
|
|
1516
|
-
left: `${
|
|
1515
|
+
left: `${D.stickyOffset(e.field)}px`,
|
|
1517
1516
|
zIndex: 1
|
|
1518
1517
|
} : n === "right" ? {
|
|
1519
1518
|
...t,
|
|
1520
1519
|
position: "sticky",
|
|
1521
|
-
right: `${
|
|
1520
|
+
right: `${D.stickyOffsetRight(e.field)}px`,
|
|
1522
1521
|
zIndex: 1
|
|
1523
1522
|
} : t;
|
|
1524
1523
|
}
|
|
1525
1524
|
function Te(e, t) {
|
|
1526
|
-
|
|
1525
|
+
D.onColumnDragStart(t), e.dataTransfer?.setData("text/plain", t);
|
|
1527
1526
|
}
|
|
1528
1527
|
function Ee(e, t) {
|
|
1529
|
-
e.preventDefault(),
|
|
1528
|
+
e.preventDefault(), k.value = t;
|
|
1530
1529
|
}
|
|
1531
1530
|
function De(e) {
|
|
1532
|
-
|
|
1531
|
+
k.value === e && (k.value = void 0);
|
|
1533
1532
|
}
|
|
1534
|
-
function
|
|
1535
|
-
e.preventDefault(),
|
|
1533
|
+
function ke(e, t) {
|
|
1534
|
+
e.preventDefault(), k.value = void 0, D.onColumnDrop(t);
|
|
1536
1535
|
}
|
|
1537
|
-
let
|
|
1536
|
+
let $ = t(() => C.selectable ? {
|
|
1538
1537
|
position: "sticky",
|
|
1539
1538
|
left: "0px",
|
|
1540
1539
|
zIndex: 1
|
|
@@ -1542,44 +1541,44 @@ var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
|
1542
1541
|
function Ae(e, t) {
|
|
1543
1542
|
let n = e.aggregate, r = t[e.field];
|
|
1544
1543
|
if (!n || r === void 0) return "";
|
|
1545
|
-
let i = n === "count" ? String(r) :
|
|
1546
|
-
return `${e.headerText ?? e.field} ${
|
|
1544
|
+
let i = n === "count" ? String(r) : E(r, "number", e.format ?? "", C.locale);
|
|
1545
|
+
return `${e.headerText ?? e.field} ${j[n]}: ${i}`;
|
|
1547
1546
|
}
|
|
1548
1547
|
function je(e) {
|
|
1549
1548
|
let t = {
|
|
1550
1549
|
title: e.headerText ?? e.field,
|
|
1551
1550
|
field: e.field
|
|
1552
|
-
}, n =
|
|
1551
|
+
}, n = T[`header-${e.field}`];
|
|
1553
1552
|
return n ? n(t) : e.renderHeader ? e.renderHeader(t) : t.title;
|
|
1554
1553
|
}
|
|
1555
|
-
function
|
|
1554
|
+
function Me(e, t) {
|
|
1556
1555
|
let n = {
|
|
1557
1556
|
value: t[e.field],
|
|
1558
1557
|
row: t,
|
|
1559
1558
|
field: e.field
|
|
1560
|
-
}, r =
|
|
1561
|
-
return r ? r(n) : e.renderCell ? e.renderCell(n) :
|
|
1559
|
+
}, r = T[`cell-${e.field}`];
|
|
1560
|
+
return r ? r(n) : e.renderCell ? e.renderCell(n) : E(t[e.field], e.type ?? "string", e.format ?? "", C.locale);
|
|
1562
1561
|
}
|
|
1563
|
-
function
|
|
1564
|
-
let n =
|
|
1562
|
+
function Ne(e, t) {
|
|
1563
|
+
let n = T[`editor-${e.field}`];
|
|
1565
1564
|
if (!n && !e.renderEditor) return;
|
|
1566
1565
|
let r = {
|
|
1567
|
-
value:
|
|
1566
|
+
value: D.rowDraft[e.field],
|
|
1568
1567
|
row: t,
|
|
1569
1568
|
field: e.field,
|
|
1570
|
-
setValue: (t) =>
|
|
1571
|
-
error:
|
|
1569
|
+
setValue: (t) => D.setRowDraftValue(e.field, t),
|
|
1570
|
+
error: D.fieldErrors[e.field]
|
|
1572
1571
|
};
|
|
1573
1572
|
return n ? n(r) : e.renderEditor(r);
|
|
1574
1573
|
}
|
|
1575
|
-
function
|
|
1576
|
-
return
|
|
1574
|
+
function Pe(e) {
|
|
1575
|
+
return T.detail ? T.detail({ row: e }) : C.renderDetail?.(e);
|
|
1577
1576
|
}
|
|
1578
|
-
function
|
|
1579
|
-
|
|
1577
|
+
function Fe(e, t) {
|
|
1578
|
+
D.toggleColumnVisibility(t), e.target.checked = !D.isColumnHidden(t);
|
|
1580
1579
|
}
|
|
1581
|
-
function
|
|
1582
|
-
if (!
|
|
1580
|
+
function Ie(e) {
|
|
1581
|
+
if (!C.clipboard || !(e.ctrlKey || e.metaKey)) return;
|
|
1583
1582
|
let t = e.key.toLowerCase();
|
|
1584
1583
|
if (t !== "c" && t !== "v") return;
|
|
1585
1584
|
let n = e.target;
|
|
@@ -1588,221 +1587,225 @@ var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
|
1588
1587
|
if (!r || !i || a == null) return;
|
|
1589
1588
|
let o = Number(a);
|
|
1590
1589
|
if (e.preventDefault(), t === "c") {
|
|
1591
|
-
let e =
|
|
1592
|
-
navigator.clipboard?.writeText(t ??
|
|
1593
|
-
} else navigator.clipboard?.readText()?.then((e) =>
|
|
1590
|
+
let e = R.value, t = N.value && e && (e.minRow !== e.maxRow || e.minCol !== e.maxCol) ? ue(e) : void 0;
|
|
1591
|
+
navigator.clipboard?.writeText(t ?? D.copyCellText(o, i))?.catch(() => void 0);
|
|
1592
|
+
} else navigator.clipboard?.readText()?.then((e) => D.pasteAt(o, i, e)).catch(() => void 0);
|
|
1594
1593
|
}
|
|
1595
|
-
function
|
|
1594
|
+
function Nt(e, t) {
|
|
1596
1595
|
return e.id == null ? t : String(e.id);
|
|
1597
1596
|
}
|
|
1598
|
-
let
|
|
1599
|
-
columns:
|
|
1600
|
-
t:
|
|
1601
|
-
selectable:
|
|
1602
|
-
selectColumnStyle:
|
|
1603
|
-
columnStyle:
|
|
1604
|
-
isRowSelected:
|
|
1605
|
-
toggleRowSelection:
|
|
1606
|
-
hasRowActions:
|
|
1607
|
-
editableColumnCount:
|
|
1608
|
-
isEditingRow:
|
|
1609
|
-
isAnotherRowEditing:
|
|
1610
|
-
startEditingRow:
|
|
1611
|
-
cancelRowEdit:
|
|
1612
|
-
saveRow: (e) => void
|
|
1613
|
-
deleteRow:
|
|
1614
|
-
deletable:
|
|
1615
|
-
rowDraft:
|
|
1616
|
-
fieldErrors:
|
|
1617
|
-
isValidating:
|
|
1618
|
-
setRowDraftValue:
|
|
1619
|
-
cellContent:
|
|
1620
|
-
editorContent:
|
|
1621
|
-
detailContent:
|
|
1622
|
-
clipboard:
|
|
1623
|
-
cellRangeSelection:
|
|
1624
|
-
isCellInRange:
|
|
1625
|
-
onCellRangeMouseDown:
|
|
1626
|
-
onCellRangeMouseEnter:
|
|
1597
|
+
let Pt = t(() => ({
|
|
1598
|
+
columns: D.visibleColumns,
|
|
1599
|
+
t: O.value,
|
|
1600
|
+
selectable: C.selectable,
|
|
1601
|
+
selectColumnStyle: $.value,
|
|
1602
|
+
columnStyle: Q,
|
|
1603
|
+
isRowSelected: D.isRowSelected,
|
|
1604
|
+
toggleRowSelection: D.toggleRowSelection,
|
|
1605
|
+
hasRowActions: W.value,
|
|
1606
|
+
editableColumnCount: D.editableColumns.length,
|
|
1607
|
+
isEditingRow: D.isEditingRow,
|
|
1608
|
+
isAnotherRowEditing: D.isAnotherRowEditing,
|
|
1609
|
+
startEditingRow: D.startEditingRow,
|
|
1610
|
+
cancelRowEdit: D.cancelRowEdit,
|
|
1611
|
+
saveRow: (e) => void D.saveRow(e),
|
|
1612
|
+
deleteRow: D.deleteRow,
|
|
1613
|
+
deletable: C.deletable,
|
|
1614
|
+
rowDraft: D.rowDraft,
|
|
1615
|
+
fieldErrors: D.fieldErrors,
|
|
1616
|
+
isValidating: D.isValidating,
|
|
1617
|
+
setRowDraftValue: D.setRowDraftValue,
|
|
1618
|
+
cellContent: Me,
|
|
1619
|
+
editorContent: Ne,
|
|
1620
|
+
detailContent: Pe,
|
|
1621
|
+
clipboard: C.clipboard,
|
|
1622
|
+
cellRangeSelection: N.value,
|
|
1623
|
+
isCellInRange: ae,
|
|
1624
|
+
onCellRangeMouseDown: V,
|
|
1625
|
+
onCellRangeMouseEnter: oe,
|
|
1627
1626
|
extraColumnCount: be.value
|
|
1628
1627
|
}));
|
|
1629
1628
|
return (t, d) => (p(), i("div", Re, [
|
|
1630
|
-
a("div", ze,
|
|
1631
|
-
|
|
1629
|
+
a("div", ze, g(fe.value ? O.value("MsgNoData") : ""), 1),
|
|
1630
|
+
a("div", Be, [a("input", {
|
|
1631
|
+
"aria-label": O.value("MsgFilterPlaceholder"),
|
|
1632
1632
|
type: "text",
|
|
1633
|
-
placeholder: `${
|
|
1634
|
-
value: v(
|
|
1635
|
-
onInput: d[0] ||= (e) => v(
|
|
1636
|
-
}, null, 40,
|
|
1637
|
-
a("div",
|
|
1633
|
+
placeholder: `${O.value("MsgFilterPlaceholder")}…`,
|
|
1634
|
+
value: v(D).filterQuery,
|
|
1635
|
+
onInput: d[0] ||= (e) => v(D).setFilterQuery(e.target.value)
|
|
1636
|
+
}, null, 40, Ve)]),
|
|
1637
|
+
a("div", He, [
|
|
1638
1638
|
c.exportable ? (p(), i(e, { key: 0 }, [
|
|
1639
1639
|
a("button", {
|
|
1640
1640
|
type: "button",
|
|
1641
|
-
onClick: d[1] ||= (e) => v(
|
|
1642
|
-
}, g(
|
|
1641
|
+
onClick: d[1] ||= (e) => v(de)(v(D).exportRows, v(D).visibleColumns, c.locale, c.exportFilenameBase)
|
|
1642
|
+
}, g(O.value("MsgExportCsv")), 1),
|
|
1643
1643
|
a("button", {
|
|
1644
1644
|
type: "button",
|
|
1645
|
-
onClick: d[2] ||= (e) => v(
|
|
1646
|
-
}, g(
|
|
1645
|
+
onClick: d[2] ||= (e) => v(pe)(v(D).exportRows, v(D).visibleColumns, c.locale, c.exportFilenameBase)
|
|
1646
|
+
}, g(O.value("MsgExportExcel")), 1),
|
|
1647
1647
|
a("button", {
|
|
1648
1648
|
type: "button",
|
|
1649
|
-
onClick: d[3] ||= (e) => void v(
|
|
1650
|
-
}, g(
|
|
1649
|
+
onClick: d[3] ||= (e) => void v(he)(v(D).exportRows, v(D).visibleColumns, c.locale, c.exportFilenameBase)
|
|
1650
|
+
}, g(O.value("MsgExportPdf")), 1),
|
|
1651
1651
|
a("button", {
|
|
1652
1652
|
type: "button",
|
|
1653
|
-
onClick: d[4] ||= (e) => v(
|
|
1654
|
-
}, g(
|
|
1653
|
+
onClick: d[4] ||= (e) => v(me)(v(D).exportRows, v(D).visibleColumns, c.locale, c.exportFilenameBase)
|
|
1654
|
+
}, g(O.value("MsgPrint")), 1)
|
|
1655
1655
|
], 64)) : r("", !0),
|
|
1656
|
-
c.creatable && v(
|
|
1656
|
+
c.creatable && v(D).editableColumns.length > 0 && !v(D).isAddingRow ? (p(), i("button", {
|
|
1657
1657
|
key: 1,
|
|
1658
1658
|
type: "button",
|
|
1659
|
-
onClick: d[5] ||= (e) => v(
|
|
1660
|
-
}, g(
|
|
1661
|
-
c.selectable && c.deletable && v(
|
|
1659
|
+
onClick: d[5] ||= (e) => v(D).startAddingRow()
|
|
1660
|
+
}, g(O.value("MsgAddRow")), 1)) : r("", !0),
|
|
1661
|
+
c.selectable && c.deletable && v(D).selectedRows.size > 0 ? (p(), i("button", {
|
|
1662
1662
|
key: 2,
|
|
1663
1663
|
type: "button",
|
|
1664
|
-
onClick: d[6] ||= (e) => v(
|
|
1665
|
-
}, g(
|
|
1666
|
-
c.columnToggle ? (p(), i("details",
|
|
1667
|
-
"aria-label":
|
|
1664
|
+
onClick: d[6] ||= (e) => v(D).deleteSelectedRows()
|
|
1665
|
+
}, g(O.value("MsgDeleteSelected", { count: v(D).selectedRows.size })), 1)) : r("", !0),
|
|
1666
|
+
c.columnToggle ? (p(), i("details", Ue, [a("summary", null, g(O.value("MsgToggleColumns")), 1), a("ul", null, [(p(!0), i(e, null, m(v(D).hideableColumns, (e) => (p(), i("li", { key: e.field }, [a("label", null, [a("input", {
|
|
1667
|
+
"aria-label": O.value("MsgToggleColumn", { column: e.headerText ?? e.field }),
|
|
1668
1668
|
type: "checkbox",
|
|
1669
|
-
checked: !v(
|
|
1670
|
-
onChange: (t) =>
|
|
1671
|
-
}, null, 40,
|
|
1669
|
+
checked: !v(D).isColumnHidden(e.field),
|
|
1670
|
+
onChange: (t) => Fe(t, e.field)
|
|
1671
|
+
}, null, 40, We), o(" " + g(e.headerText ?? e.field), 1)])]))), 128))])])) : r("", !0)
|
|
1672
1672
|
]),
|
|
1673
|
-
|
|
1673
|
+
U.value.length > 0 ? (p(), i("div", Ge, [a("label", null, [o(g(v(D).groupByField ? O.value("MsgGroupedBy", { column: U.value.find((e) => e.field === v(D).groupByField)?.headerText ?? v(D).groupByField }) : O.value("MsgGroupByHint")) + " ", 1), a("select", {
|
|
1674
1674
|
"aria-label": "Group by",
|
|
1675
|
-
value: v(
|
|
1676
|
-
onChange: d[7] ||= (e) => v(
|
|
1677
|
-
}, [a("option",
|
|
1675
|
+
value: v(D).groupByField ?? "",
|
|
1676
|
+
onChange: d[7] ||= (e) => v(D).setGroupByField(e.target.value || void 0)
|
|
1677
|
+
}, [a("option", qe, g(O.value("MsgCancelGrouping")), 1), (p(!0), i(e, null, m(U.value, (e) => (p(), i("option", {
|
|
1678
1678
|
key: e.field,
|
|
1679
1679
|
value: e.field
|
|
1680
|
-
}, g(e.headerText ?? e.field), 9,
|
|
1680
|
+
}, g(e.headerText ?? e.field), 9, Je))), 128))], 40, Ke)])])) : r("", !0),
|
|
1681
1681
|
a("div", {
|
|
1682
|
-
class: l(v(
|
|
1683
|
-
style: u(v(
|
|
1682
|
+
class: l(v(D).hasVirtualScroll ? "inandu-grid-viewport" : void 0),
|
|
1683
|
+
style: u(v(D).hasVirtualScroll ? {
|
|
1684
1684
|
height: `${c.height}px`,
|
|
1685
1685
|
overflow: "auto"
|
|
1686
1686
|
} : void 0),
|
|
1687
|
-
onScroll:
|
|
1687
|
+
onScroll: Ce
|
|
1688
1688
|
}, [a("table", {
|
|
1689
1689
|
ref_key: "tableRef",
|
|
1690
|
-
ref:
|
|
1690
|
+
ref: ne,
|
|
1691
1691
|
class: "inandu-grid",
|
|
1692
|
-
|
|
1692
|
+
"aria-rowcount": ve.value,
|
|
1693
|
+
onKeydown: Ie
|
|
1693
1694
|
}, [
|
|
1694
1695
|
a("thead", null, [a("tr", null, [
|
|
1695
|
-
|
|
1696
|
-
|
|
1696
|
+
q.value ? (p(), i("th", Xe)) : r("", !0),
|
|
1697
|
+
G.value ? (p(), i("th", Ze)) : r("", !0),
|
|
1697
1698
|
c.selectable ? (p(), i("th", {
|
|
1698
1699
|
key: 2,
|
|
1699
|
-
style: u(
|
|
1700
|
+
style: u($.value)
|
|
1700
1701
|
}, [a("input", {
|
|
1701
|
-
"aria-label":
|
|
1702
|
+
"aria-label": O.value("MsgSelectAll"),
|
|
1702
1703
|
type: "checkbox",
|
|
1703
|
-
checked: v(
|
|
1704
|
-
indeterminate: v(
|
|
1705
|
-
onChange: d[8] ||= (e) => v(
|
|
1706
|
-
}, null, 40,
|
|
1707
|
-
(p(!0), i(e, null, m(v(
|
|
1704
|
+
checked: v(D).allSelected,
|
|
1705
|
+
indeterminate: v(D).someSelected,
|
|
1706
|
+
onChange: d[8] ||= (e) => v(D).toggleSelectAll()
|
|
1707
|
+
}, null, 40, Qe)], 4)) : r("", !0),
|
|
1708
|
+
(p(!0), i(e, null, m(v(D).visibleColumns, (e) => (p(), i("th", {
|
|
1708
1709
|
key: e.field,
|
|
1709
1710
|
"data-field": e.field,
|
|
1710
|
-
|
|
1711
|
-
|
|
1711
|
+
"aria-sort": _e(e.field),
|
|
1712
|
+
style: u(Q(e)),
|
|
1713
|
+
class: l(k.value === e.field ? "inandu-drag-over" : void 0),
|
|
1712
1714
|
draggable: e.reorder !== !1,
|
|
1713
|
-
"aria-label":
|
|
1715
|
+
"aria-label": O.value("MsgSortBy", { column: e.headerText ?? e.field }),
|
|
1714
1716
|
onDragstart: (t) => Te(t, e.field),
|
|
1715
1717
|
onDragover: (t) => Ee(t, e.field),
|
|
1716
1718
|
onDragleave: (t) => De(e.field),
|
|
1717
|
-
onDrop: (t) =>
|
|
1718
|
-
onClick: (t) => v(
|
|
1719
|
+
onDrop: (t) => ke(t, e.field),
|
|
1720
|
+
onClick: (t) => v(D).toggleSort(e.field, t.shiftKey)
|
|
1719
1721
|
}, [
|
|
1720
|
-
s(v(
|
|
1721
|
-
o(g(v(
|
|
1722
|
-
v(
|
|
1722
|
+
s(v(K), { nodes: je(e) }, null, 8, ["nodes"]),
|
|
1723
|
+
o(g(v(D).sortDirectionFor(e.field) ? v(D).sortDirectionFor(e.field) === "asc" ? " ▲" : " ▼" : ""), 1),
|
|
1724
|
+
v(D).sortPriorityFor(e.field) === void 0 ? r("", !0) : (p(), i("sup", et, g(v(D).sortPriorityFor(e.field)), 1)),
|
|
1723
1725
|
a("span", {
|
|
1724
1726
|
class: "inandu-grid-resize-handle",
|
|
1725
1727
|
draggable: "false",
|
|
1726
|
-
onMousedown: (t) =>
|
|
1727
|
-
onDblclick: (t) =>
|
|
1728
|
-
onClick: d[9] ||=
|
|
1729
|
-
}, null, 40,
|
|
1730
|
-
], 46,
|
|
1731
|
-
|
|
1732
|
-
]), a("tr",
|
|
1733
|
-
|
|
1734
|
-
|
|
1728
|
+
onMousedown: (t) => ie(t, e.field),
|
|
1729
|
+
onDblclick: (t) => M(t, e),
|
|
1730
|
+
onClick: d[9] ||= x(() => {}, ["stop"])
|
|
1731
|
+
}, null, 40, tt)
|
|
1732
|
+
], 46, $e))), 128)),
|
|
1733
|
+
W.value ? (p(), i("th", nt)) : r("", !0)
|
|
1734
|
+
]), a("tr", rt, [
|
|
1735
|
+
q.value ? (p(), i("th", it)) : r("", !0),
|
|
1736
|
+
G.value ? (p(), i("th", at)) : r("", !0),
|
|
1735
1737
|
c.selectable ? (p(), i("th", {
|
|
1736
1738
|
key: 2,
|
|
1737
|
-
style: u(
|
|
1739
|
+
style: u($.value)
|
|
1738
1740
|
}, null, 4)) : r("", !0),
|
|
1739
|
-
(p(!0), i(e, null, m(v(
|
|
1741
|
+
(p(!0), i(e, null, m(v(D).visibleColumns, (e) => (p(), i("th", {
|
|
1740
1742
|
key: e.field,
|
|
1741
|
-
style: u(
|
|
1743
|
+
style: u(Q(e))
|
|
1742
1744
|
}, [s(Le, {
|
|
1743
1745
|
column: e,
|
|
1744
|
-
value: v(
|
|
1745
|
-
t:
|
|
1746
|
-
onChange: (t) =>
|
|
1746
|
+
value: v(D).filterValues[e.field],
|
|
1747
|
+
t: O.value,
|
|
1748
|
+
onChange: (t) => we(e.field, t)
|
|
1747
1749
|
}, null, 8, [
|
|
1748
1750
|
"column",
|
|
1749
1751
|
"value",
|
|
1750
1752
|
"t",
|
|
1751
1753
|
"onChange"
|
|
1752
1754
|
])], 4))), 128)),
|
|
1753
|
-
|
|
1755
|
+
W.value ? (p(), i("th", ot)) : r("", !0)
|
|
1754
1756
|
])]),
|
|
1755
|
-
a("tbody", null, [v(
|
|
1757
|
+
a("tbody", null, [v(D).isAddingRow ? (p(), i("tr", st, [
|
|
1756
1758
|
c.selectable ? (p(), i("td", {
|
|
1757
1759
|
key: 0,
|
|
1758
|
-
style: u(
|
|
1760
|
+
style: u($.value)
|
|
1759
1761
|
}, null, 4)) : r("", !0),
|
|
1760
|
-
(p(!0), i(e, null, m(v(
|
|
1762
|
+
(p(!0), i(e, null, m(v(D).visibleColumns, (t) => (p(), i("td", {
|
|
1761
1763
|
key: t.field,
|
|
1762
|
-
style: u(
|
|
1763
|
-
}, [t.editable ? (p(), i(e, { key: 0 }, [
|
|
1764
|
+
style: u(Q(t))
|
|
1765
|
+
}, [t.editable ? (p(), i(e, { key: 0 }, [Ne(t, {}) === void 0 ? (p(), n(ye, {
|
|
1764
1766
|
key: 1,
|
|
1765
1767
|
column: t,
|
|
1766
|
-
value: v(
|
|
1767
|
-
error: v(
|
|
1768
|
-
t:
|
|
1769
|
-
onChange: (e) => v(
|
|
1768
|
+
value: v(D).rowDraft[t.field],
|
|
1769
|
+
error: v(D).fieldErrors[t.field],
|
|
1770
|
+
t: O.value,
|
|
1771
|
+
onChange: (e) => v(D).setRowDraftValue(t.field, e)
|
|
1770
1772
|
}, null, 8, [
|
|
1771
1773
|
"column",
|
|
1772
1774
|
"value",
|
|
1773
1775
|
"error",
|
|
1774
1776
|
"t",
|
|
1775
1777
|
"onChange"
|
|
1776
|
-
])) : (p(), n(v(
|
|
1778
|
+
])) : (p(), n(v(K), {
|
|
1777
1779
|
key: 0,
|
|
1778
|
-
nodes:
|
|
1780
|
+
nodes: Ne(t, {})
|
|
1779
1781
|
}, null, 8, ["nodes"]))], 64)) : r("", !0)], 4))), 128)),
|
|
1780
|
-
|
|
1782
|
+
W.value ? (p(), i("td", ct, [a("button", {
|
|
1781
1783
|
type: "button",
|
|
1782
|
-
disabled: v(
|
|
1783
|
-
onClick: d[10] ||= (e) => void v(
|
|
1784
|
-
}, g(
|
|
1784
|
+
disabled: v(D).isValidating,
|
|
1785
|
+
onClick: d[10] ||= (e) => void v(D).saveNewRow()
|
|
1786
|
+
}, g(O.value("MsgSaveRow")), 9, lt), a("button", {
|
|
1785
1787
|
type: "button",
|
|
1786
|
-
disabled: v(
|
|
1787
|
-
onClick: d[11] ||= (e) => v(
|
|
1788
|
-
}, g(
|
|
1789
|
-
])) : r("", !0),
|
|
1790
|
-
key:
|
|
1788
|
+
disabled: v(D).isValidating,
|
|
1789
|
+
onClick: d[11] ||= (e) => v(D).cancelAddRow()
|
|
1790
|
+
}, g(O.value("MsgCancelRowEdit")), 9, ut)])) : r("", !0)
|
|
1791
|
+
])) : r("", !0), fe.value ? (p(), i("tr", dt, [a("td", { colspan: J.value }, g(O.value("MsgNoData")), 9, ft)])) : v(D).hasTreeData ? (p(!0), i(e, { key: 2 }, m(v(D).treeRows, (t, o) => (p(), i("tr", {
|
|
1792
|
+
key: Nt(t.row, o),
|
|
1793
|
+
"aria-selected": c.selectable ? v(D).isRowSelected(t.row) : void 0,
|
|
1791
1794
|
"aria-level": t.depth + 1,
|
|
1792
|
-
"aria-expanded": t.expandable ? v(
|
|
1795
|
+
"aria-expanded": t.expandable ? v(D).isTreeRowExpanded(t.row) : void 0
|
|
1793
1796
|
}, [
|
|
1794
1797
|
c.selectable ? (p(), i("td", {
|
|
1795
1798
|
key: 0,
|
|
1796
|
-
style: u(
|
|
1799
|
+
style: u($.value)
|
|
1797
1800
|
}, [a("input", {
|
|
1798
|
-
"aria-label":
|
|
1801
|
+
"aria-label": O.value("MsgSelectRow", { index: o + 1 }),
|
|
1799
1802
|
type: "checkbox",
|
|
1800
|
-
checked: v(
|
|
1801
|
-
onChange: (e) => v(
|
|
1802
|
-
}, null, 40,
|
|
1803
|
-
(p(!0), i(e, null, m(v(
|
|
1803
|
+
checked: v(D).isRowSelected(t.row),
|
|
1804
|
+
onChange: (e) => v(D).toggleRowSelection(t.row)
|
|
1805
|
+
}, null, 40, mt)], 4)) : r("", !0),
|
|
1806
|
+
(p(!0), i(e, null, m(v(D).visibleColumns, (e, r) => (p(), i("td", {
|
|
1804
1807
|
key: e.field,
|
|
1805
|
-
style: u(
|
|
1808
|
+
style: u(Q(e))
|
|
1806
1809
|
}, [r === 0 ? (p(), i("span", {
|
|
1807
1810
|
key: 0,
|
|
1808
1811
|
class: "inandu-grid-tree-cell",
|
|
@@ -1811,21 +1814,21 @@ var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
|
1811
1814
|
key: 0,
|
|
1812
1815
|
type: "button",
|
|
1813
1816
|
class: "inandu-grid-tree-toggle",
|
|
1814
|
-
"aria-label": v(
|
|
1815
|
-
title: v(
|
|
1816
|
-
onClick: (e) => v(
|
|
1817
|
-
}, g(v(
|
|
1817
|
+
"aria-label": v(D).isTreeRowExpanded(t.row) ? O.value("MsgCollapseDetail") : O.value("MsgExpandDetail"),
|
|
1818
|
+
title: v(D).isTreeRowExpanded(t.row) ? O.value("MsgCollapseDetail") : O.value("MsgExpandDetail"),
|
|
1819
|
+
onClick: (e) => v(D).toggleTreeRow(t.row)
|
|
1820
|
+
}, g(v(D).isTreeRowExpanded(t.row) ? "▾" : "▸"), 9, ht)) : (p(), i("span", gt)), s(v(K), { nodes: Me(e, t.row) }, null, 8, ["nodes"])], 4)) : (p(), n(v(K), {
|
|
1818
1821
|
key: 1,
|
|
1819
|
-
nodes:
|
|
1822
|
+
nodes: Me(e, t.row)
|
|
1820
1823
|
}, null, 8, ["nodes"]))], 4))), 128)),
|
|
1821
|
-
|
|
1822
|
-
], 8,
|
|
1824
|
+
W.value ? (p(), i("td", _t)) : r("", !0)
|
|
1825
|
+
], 8, pt))), 128)) : v(D).groups ? (p(!0), i(e, { key: 3 }, m(v(D).groups, (t) => (p(), i(e, { key: t.key }, [a("tr", vt, [a("td", { colspan: J.value }, [
|
|
1823
1826
|
a("strong", null, g(t.key), 1),
|
|
1824
1827
|
o(" (" + g(t.rows.length) + ") ", 1),
|
|
1825
|
-
|
|
1826
|
-
], 8,
|
|
1827
|
-
key:
|
|
1828
|
-
ctx:
|
|
1828
|
+
H.value.length > 0 ? (p(), i("span", bt, [(p(!0), i(e, null, m(H.value, (e) => (p(), i("span", { key: e.field }, " · " + g(Ae(e, t.aggregates)), 1))), 128))])) : r("", !0)
|
|
1829
|
+
], 8, yt)]), (p(!0), i(e, null, m(t.rows, (e, r) => (p(), n(Oe, {
|
|
1830
|
+
key: Nt(e, `${t.key}:${r}`),
|
|
1831
|
+
ctx: Pt.value,
|
|
1829
1832
|
row: e,
|
|
1830
1833
|
"row-index": r
|
|
1831
1834
|
}, null, 8, [
|
|
@@ -1833,28 +1836,28 @@ var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
|
1833
1836
|
"row",
|
|
1834
1837
|
"row-index"
|
|
1835
1838
|
]))), 128))], 64))), 128)) : (p(), i(e, { key: 4 }, [
|
|
1836
|
-
v(
|
|
1839
|
+
v(D).hasVirtualScroll && X.value > 0 ? (p(), i("tr", xt, [a("td", {
|
|
1837
1840
|
style: u({
|
|
1838
|
-
height: `${
|
|
1841
|
+
height: `${X.value}px`,
|
|
1839
1842
|
padding: 0,
|
|
1840
1843
|
border: "none"
|
|
1841
1844
|
}),
|
|
1842
|
-
colspan:
|
|
1843
|
-
}, null, 12,
|
|
1844
|
-
(p(!0), i(e, null, m(
|
|
1845
|
-
key:
|
|
1846
|
-
ctx:
|
|
1845
|
+
colspan: J.value
|
|
1846
|
+
}, null, 12, St)])) : r("", !0),
|
|
1847
|
+
(p(!0), i(e, null, m(Se.value, (e, t) => (p(), n(Oe, {
|
|
1848
|
+
key: Nt(e, Y.value + t),
|
|
1849
|
+
ctx: Pt.value,
|
|
1847
1850
|
row: e,
|
|
1848
|
-
"row-index":
|
|
1849
|
-
"has-row-drag-handle":
|
|
1850
|
-
"is-drag-over-row": v(
|
|
1851
|
-
"has-master-detail":
|
|
1852
|
-
"is-row-expanded": v(
|
|
1853
|
-
onRowDragStart: (t) => v(
|
|
1854
|
-
onRowDragOver: (t) =>
|
|
1855
|
-
onRowDragLeave: (t) =>
|
|
1856
|
-
onRowDrop: (t) => v(
|
|
1857
|
-
onToggleExpanded: (t) => v(
|
|
1851
|
+
"row-index": Y.value + t,
|
|
1852
|
+
"has-row-drag-handle": G.value,
|
|
1853
|
+
"is-drag-over-row": v(D).draggingRow !== void 0 && A.value === e,
|
|
1854
|
+
"has-master-detail": q.value,
|
|
1855
|
+
"is-row-expanded": v(D).isRowExpanded(e),
|
|
1856
|
+
onRowDragStart: (t) => v(D).onRowDragStart(e),
|
|
1857
|
+
onRowDragOver: (t) => A.value = e,
|
|
1858
|
+
onRowDragLeave: (t) => A.value === e && (A.value = void 0),
|
|
1859
|
+
onRowDrop: (t) => v(D).onRowDrop(e),
|
|
1860
|
+
onToggleExpanded: (t) => v(D).toggleRowExpanded(e)
|
|
1858
1861
|
}, null, 8, [
|
|
1859
1862
|
"ctx",
|
|
1860
1863
|
"row",
|
|
@@ -1869,67 +1872,66 @@ var V = { class: "inandu-grid-edit-cell" }, H = ["aria-label", "checked"], U = [
|
|
|
1869
1872
|
"onRowDrop",
|
|
1870
1873
|
"onToggleExpanded"
|
|
1871
1874
|
]))), 128)),
|
|
1872
|
-
v(
|
|
1875
|
+
v(D).hasVirtualScroll && Z.value > 0 ? (p(), i("tr", Ct, [a("td", {
|
|
1873
1876
|
style: u({
|
|
1874
|
-
height: `${
|
|
1877
|
+
height: `${Z.value}px`,
|
|
1875
1878
|
padding: 0,
|
|
1876
1879
|
border: "none"
|
|
1877
1880
|
}),
|
|
1878
|
-
colspan:
|
|
1879
|
-
}, null, 12,
|
|
1881
|
+
colspan: J.value
|
|
1882
|
+
}, null, 12, wt)])) : r("", !0)
|
|
1880
1883
|
], 64))]),
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
+
H.value.length > 0 && !v(D).hasVirtualScroll ? (p(), i("tfoot", Tt, [a("tr", Et, [
|
|
1885
|
+
q.value ? (p(), i("td", Dt)) : r("", !0),
|
|
1886
|
+
G.value ? (p(), i("td", Ot)) : r("", !0),
|
|
1884
1887
|
c.selectable ? (p(), i("td", {
|
|
1885
1888
|
key: 2,
|
|
1886
|
-
style: u(
|
|
1889
|
+
style: u($.value)
|
|
1887
1890
|
}, null, 4)) : r("", !0),
|
|
1888
|
-
(p(!0), i(e, null, m(v(
|
|
1891
|
+
(p(!0), i(e, null, m(v(D).visibleColumns, (e) => (p(), i("td", {
|
|
1889
1892
|
key: e.field,
|
|
1890
|
-
style: u(
|
|
1891
|
-
}, g(e.aggregate ? Ae(e, v(
|
|
1892
|
-
|
|
1893
|
+
style: u(Q(e))
|
|
1894
|
+
}, g(e.aggregate ? Ae(e, v(D).totals) : ""), 5))), 128)),
|
|
1895
|
+
W.value ? (p(), i("td", kt)) : r("", !0)
|
|
1893
1896
|
])])) : r("", !0)
|
|
1894
|
-
],
|
|
1895
|
-
c.pageSize > 0 && !v(
|
|
1897
|
+
], 40, Ye)], 38),
|
|
1898
|
+
c.pageSize > 0 && !v(D).groupByField && !v(D).hasVirtualScroll ? (p(), i("div", At, [
|
|
1896
1899
|
a("button", {
|
|
1897
1900
|
type: "button",
|
|
1898
|
-
disabled: v(
|
|
1899
|
-
onClick: d[12] ||= (e) => v(
|
|
1900
|
-
}, "‹ " + g(
|
|
1901
|
-
a("span", null, g(
|
|
1902
|
-
page: v(
|
|
1903
|
-
total: v(
|
|
1904
|
-
})) + " (" + g(v(
|
|
1901
|
+
disabled: v(D).page === 0,
|
|
1902
|
+
onClick: d[12] ||= (e) => v(D).setPage(v(D).page - 1)
|
|
1903
|
+
}, "‹ " + g(O.value("MsgPreviousPage")), 9, jt),
|
|
1904
|
+
a("span", null, g(O.value("MsgPageOf", {
|
|
1905
|
+
page: v(D).page + 1,
|
|
1906
|
+
total: v(D).pageCount
|
|
1907
|
+
})) + " (" + g(v(D).filteredRowCount) + ")", 1),
|
|
1905
1908
|
a("button", {
|
|
1906
1909
|
type: "button",
|
|
1907
|
-
disabled: v(
|
|
1908
|
-
onClick: d[13] ||= (e) => v(
|
|
1909
|
-
}, g(
|
|
1910
|
+
disabled: v(D).page >= v(D).pageCount - 1,
|
|
1911
|
+
onClick: d[13] ||= (e) => v(D).setPage(v(D).page + 1)
|
|
1912
|
+
}, g(O.value("MsgNextPage")) + " ›", 9, Mt)
|
|
1910
1913
|
])) : r("", !0)
|
|
1911
1914
|
]));
|
|
1912
1915
|
}
|
|
1913
1916
|
});
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
function Mt(e, t = {}) {
|
|
1917
|
+
// src/composables/useInanduGridServer.ts
|
|
1918
|
+
function Pt(e, t = {}) {
|
|
1917
1919
|
let n = new URLSearchParams();
|
|
1918
1920
|
n.set("page", String(e.page + 1)), e.pageSize > 0 && n.set("pageSize", String(e.pageSize)), e.sortCriteria.length > 0 && n.set("sort", e.sortCriteria.map((e) => (e.direction === "desc" ? "-" : "") + e.field).join(","));
|
|
1919
1921
|
let r = e.filterQuery.trim();
|
|
1920
1922
|
r && n.set("q", r);
|
|
1921
|
-
for (let [t, r] of Object.entries(e.filterValues))
|
|
1923
|
+
for (let [t, r] of Object.entries(e.filterValues)) A(r) && (r.values && r.values.length > 0 ? n.set(`${t}_in`, r.values.join(",")) : (r.text && n.set(`${t}_contains`, r.text), r.min && n.set(`${t}_gte`, r.min), r.max && n.set(`${t}_lte`, r.max), r.from && n.set(`${t}_gte`, r.from), r.to && n.set(`${t}_lte`, r.to), (r.bool === "true" || r.bool === "false") && n.set(`${t}_eq`, r.bool)));
|
|
1922
1924
|
for (let [e, r] of Object.entries(t.extraParams ?? {})) n.set(e, r);
|
|
1923
1925
|
return n;
|
|
1924
1926
|
}
|
|
1925
|
-
function
|
|
1927
|
+
function Ft(e) {
|
|
1926
1928
|
let t = h(void 0), n = h([]), r = h(0), i = h(!1), a = h(void 0), o = h(0), s = !1, c;
|
|
1927
1929
|
function l(t) {
|
|
1928
1930
|
c?.();
|
|
1929
1931
|
let o = new AbortController(), l = async () => {
|
|
1930
1932
|
u(!0), a.value = void 0;
|
|
1931
1933
|
try {
|
|
1932
|
-
let i =
|
|
1934
|
+
let i = Pt(t, { extraParams: e.extraParams }).toString(), a = e.url + (e.url.includes("?") ? "&" : "?") + i, s = {
|
|
1933
1935
|
...e.init,
|
|
1934
1936
|
signal: o.signal
|
|
1935
1937
|
}, c = await (e.fetcher ?? fetch)(a, s);
|
|
@@ -1954,7 +1956,7 @@ function Nt(e) {
|
|
|
1954
1956
|
clearTimeout(f), o.abort();
|
|
1955
1957
|
};
|
|
1956
1958
|
}
|
|
1957
|
-
return
|
|
1959
|
+
return b([t, o], () => {
|
|
1958
1960
|
t.value && l(t.value);
|
|
1959
1961
|
}), f(() => c?.(), !0), {
|
|
1960
1962
|
rows: n,
|
|
@@ -1969,5 +1971,4 @@ function Nt(e) {
|
|
|
1969
1971
|
}
|
|
1970
1972
|
};
|
|
1971
1973
|
}
|
|
1972
|
-
|
|
1973
|
-
export { O as AGGREGATE_SYMBOLS, R as INANDU_GRID_TRANSLATIONS, jt as InanduGrid, B as buildCsv, he as buildExcelXml, Mt as buildInanduGridQuery, E as compareCellValues, ae as computeGroupAggregates, ue as createTranslator, P as en, F as es, me as exportCsv, ge as exportExcel, ve as exportPdf, T as formatCellValue, I as fr, le as interpolate, ce as it, ie as matchesColumnFilter, ye as measureColumnContentWidth, _e as printTable, fe as useInanduGrid, Nt as useInanduGridServer, L as zh };
|
|
1974
|
+
export { j as AGGREGATE_SYMBOLS, V as INANDU_GRID_TRANSLATIONS, Nt as InanduGrid, U as buildCsv, fe as buildExcelXml, Pt as buildInanduGridQuery, D as compareCellValues, ne as computeGroupAggregates, se as createTranslator, L as en, R as es, de as exportCsv, pe as exportExcel, he as exportPdf, E as formatCellValue, z as fr, oe as interpolate, ae as it, te as matchesColumnFilter, ge as measureColumnContentWidth, me as printTable, le as useInanduGrid, Ft as useInanduGridServer, B as zh };
|