@fewangsit/wangsvue-gsts 1.0.0-alpha.37 → 1.0.0-alpha.39
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/approverinfo/index.d.ts +4 -0
- package/approverinfo/index.es.js +50 -43
- package/buttonbulkaction/index.es.js +15 -14
- package/calendar/index.es.js +47 -42
- package/changelogcustomvalue/index.es.js +20 -0
- package/changelogpage/index.es.js +62 -64
- package/columnlist/index.es.js +141 -116
- package/customcolumn/index.d.ts +5 -1
- package/datatable/index.d.ts +38 -0
- package/datatable/index.es.js +463 -435
- package/headercell/index.es.js +40 -0
- package/package.json +2 -1
- package/plugins/WangsVue.d.ts +1 -1
- package/stats.html +1 -1
- package/style.css +2 -2
- package/vendor/@tagsamurai/fats-api-services/api-services.es.es.js +163 -74
- package/wangsvue-gsts.esm.browser.js +11686 -11488
- package/wangsvue-gsts.system.js +60 -60
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ChangelogServices as
|
|
1
|
+
import { defineComponent as A, inject as E, shallowRef as T, ref as O, computed as N, createElementBlock as z, openBlock as f, normalizeProps as w, guardReactiveProps as B, unref as l, createElementVNode as Q, createVNode as p, createBlock as V, createCommentVNode as R, mergeProps as v } from "vue";
|
|
2
|
+
import { ChangelogServices as S } from "@tagsamurai/gsts-api-services";
|
|
3
3
|
import { u as H } from "../utils/toast.util.es.js";
|
|
4
|
-
import { _ as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { _ as
|
|
7
|
-
import { D as
|
|
8
|
-
import { _ as P } from "../
|
|
9
|
-
import { _ as
|
|
10
|
-
const
|
|
4
|
+
import { _ as I } from "../buttondownload/index.es.js";
|
|
5
|
+
import { _ as K } from "../buttonfilter/index.es.js";
|
|
6
|
+
import { _ as L } from "../buttonsearch/index.es.js";
|
|
7
|
+
import { D as M } from "../datatable/index.es.js";
|
|
8
|
+
import { _ as P } from "../changelogcustomvalue/index.es.js";
|
|
9
|
+
import { _ as G } from "../changelogfilter/index.es.js";
|
|
10
|
+
const oe = /* @__PURE__ */ A({
|
|
11
11
|
__name: "ChangelogPage",
|
|
12
12
|
props: {
|
|
13
13
|
useButtonDownload: { type: Boolean, default: !1 },
|
|
@@ -28,24 +28,24 @@ const le = /* @__PURE__ */ S({
|
|
|
28
28
|
},
|
|
29
29
|
emits: ["hide"],
|
|
30
30
|
setup(D) {
|
|
31
|
-
const
|
|
31
|
+
const F = H(), r = E("preset", {}).changelog, e = D, k = T(0), h = T(!1), b = O({
|
|
32
32
|
object: e.object,
|
|
33
33
|
...e.customParams
|
|
34
|
-
}),
|
|
35
|
-
if (e.isDialog &&
|
|
34
|
+
}), $ = N(() => {
|
|
35
|
+
if (e.isDialog && h.value)
|
|
36
36
|
return "calc(57vh - 126px)";
|
|
37
37
|
if (e.isDialog) return "57vh";
|
|
38
38
|
}), n = N(() => {
|
|
39
|
-
var
|
|
40
|
-
return e.tableName ?? `changelog-page-${(
|
|
41
|
-
}),
|
|
42
|
-
var
|
|
43
|
-
const
|
|
39
|
+
var t;
|
|
40
|
+
return e.tableName ?? `changelog-page-${(t = b.value.object) == null ? void 0 : t.toLowerCase().split(" ").join("-")}`;
|
|
41
|
+
}), x = (() => {
|
|
42
|
+
var o, s, i, m, u, d, c, g, C, y, j, _;
|
|
43
|
+
const t = [
|
|
44
44
|
{
|
|
45
45
|
field: "createdAt",
|
|
46
46
|
header: "Date",
|
|
47
47
|
sortable: !0,
|
|
48
|
-
visible: !((
|
|
48
|
+
visible: !((o = e.removedColumns) != null && o.includes("createdAt")),
|
|
49
49
|
dateFormatOptions: { showTime: !0 }
|
|
50
50
|
},
|
|
51
51
|
{
|
|
@@ -53,16 +53,16 @@ const le = /* @__PURE__ */ S({
|
|
|
53
53
|
header: "Action",
|
|
54
54
|
sortable: !0,
|
|
55
55
|
fixed: !0,
|
|
56
|
-
visible: !((
|
|
57
|
-
bodyTemplate: (
|
|
56
|
+
visible: !((s = e.removedColumns) != null && s.includes("action")),
|
|
57
|
+
bodyTemplate: (a) => a.action ?? "-"
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
field: "object",
|
|
61
61
|
header: "Object",
|
|
62
62
|
sortable: !0,
|
|
63
63
|
fixed: !0,
|
|
64
|
-
visible: !((
|
|
65
|
-
bodyTemplate: (
|
|
64
|
+
visible: !((i = e.additionalTemplateColumns) != null && i.length) && !((m = e.removedColumns) != null && m.includes("object")),
|
|
65
|
+
bodyTemplate: (a) => a.object ?? "-"
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
field: "objectName",
|
|
@@ -70,89 +70,87 @@ const le = /* @__PURE__ */ S({
|
|
|
70
70
|
sortable: !0,
|
|
71
71
|
fixed: !0,
|
|
72
72
|
visible: !((u = e.additionalTemplateColumns) != null && u.length) && !((d = e.removedColumns) != null && d.includes("objectName")),
|
|
73
|
-
bodyTemplate: (
|
|
73
|
+
bodyTemplate: (a) => a.objectName ?? "-"
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
field: "field",
|
|
77
77
|
header: "Field",
|
|
78
78
|
sortable: !0,
|
|
79
79
|
fixed: !0,
|
|
80
|
-
visible: !/Testing/.test(e.object) && !((
|
|
81
|
-
bodyTemplate: (
|
|
80
|
+
visible: !/Testing/.test(e.object) && !((c = e.removedColumns) != null && c.includes("field")),
|
|
81
|
+
bodyTemplate: (a) => a.field ?? "-"
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
field: "oldValue",
|
|
85
85
|
header: "Old Value",
|
|
86
86
|
sortable: !0,
|
|
87
|
-
visible: !((
|
|
88
|
-
bodyComponent: (
|
|
87
|
+
visible: !((g = e.removedColumns) != null && g.includes("oldValue")),
|
|
88
|
+
bodyComponent: (a) => ({
|
|
89
89
|
component: P,
|
|
90
|
-
props: {
|
|
91
|
-
}
|
|
92
|
-
dateFormatOptions: (t) => c(t.oldValue) ? { showTime: !0 } : void 0
|
|
90
|
+
props: { value: a.oldValue }
|
|
91
|
+
})
|
|
93
92
|
},
|
|
94
93
|
{
|
|
95
94
|
field: "newValue",
|
|
96
95
|
header: "New Value",
|
|
97
96
|
sortable: !0,
|
|
98
|
-
visible: !((
|
|
99
|
-
bodyComponent: (
|
|
97
|
+
visible: !((C = e.removedColumns) != null && C.includes("newValue")),
|
|
98
|
+
bodyComponent: (a) => ({
|
|
100
99
|
component: P,
|
|
101
|
-
props: {
|
|
102
|
-
}
|
|
103
|
-
dateFormatOptions: (t) => c(t.newValue) ? { showTime: !0 } : void 0
|
|
100
|
+
props: { value: a.newValue }
|
|
101
|
+
})
|
|
104
102
|
},
|
|
105
103
|
{
|
|
106
104
|
field: "modifiedBy",
|
|
107
105
|
header: "Modified By",
|
|
108
106
|
sortable: !0,
|
|
109
|
-
visible: !((
|
|
110
|
-
bodyTemplate: (
|
|
107
|
+
visible: !((y = e.removedColumns) != null && y.includes("modifiedBy")),
|
|
108
|
+
bodyTemplate: (a) => a.modifiedBy ?? "-"
|
|
111
109
|
}
|
|
112
|
-
].filter((
|
|
113
|
-
return (
|
|
114
|
-
|
|
115
|
-
})),
|
|
116
|
-
})(),
|
|
110
|
+
].filter((a) => a.visible);
|
|
111
|
+
return (j = e.additionalTemplateColumns) != null && j.length && ((_ = e.additionalTemplateColumns) == null || _.forEach((a) => {
|
|
112
|
+
t.splice(a.index, 0, a.column);
|
|
113
|
+
})), t;
|
|
114
|
+
})(), q = async (t) => {
|
|
117
115
|
try {
|
|
118
|
-
const { data:
|
|
119
|
-
return
|
|
120
|
-
} catch (
|
|
121
|
-
console.error(
|
|
122
|
-
error:
|
|
116
|
+
const { data: o } = await S.getChangelogs(t);
|
|
117
|
+
return o;
|
|
118
|
+
} catch (o) {
|
|
119
|
+
console.error(o), F.add({
|
|
120
|
+
error: o,
|
|
123
121
|
message: ""
|
|
124
122
|
});
|
|
125
123
|
}
|
|
126
124
|
};
|
|
127
|
-
return (
|
|
128
|
-
var
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
125
|
+
return (t, o) => {
|
|
126
|
+
var s, i, m, u, d;
|
|
127
|
+
return f(), z("div", w(B((s = l(r)) == null ? void 0 : s.root)), [
|
|
128
|
+
Q("div", w(B((i = l(r)) == null ? void 0 : i.header)), [
|
|
129
|
+
p(L, v((m = l(r)) == null ? void 0 : m.buttonsearch, { "table-name": n.value }), null, 16, ["table-name"]),
|
|
130
|
+
p(K, v((u = l(r)) == null ? void 0 : u.buttonfilter, {
|
|
133
131
|
"table-name": n.value,
|
|
134
|
-
onShowFilter:
|
|
132
|
+
onShowFilter: o[0] || (o[0] = (c) => h.value = c)
|
|
135
133
|
}), null, 16, ["table-name"]),
|
|
136
|
-
e.useButtonDownload ? (
|
|
137
|
-
"file-name":
|
|
134
|
+
e.useButtonDownload ? (f(), V(I, v({ key: 0 }, (d = l(r)) == null ? void 0 : d.buttondownload, {
|
|
135
|
+
"file-name": t.fileName ?? "Changelog",
|
|
138
136
|
"table-name": n.value
|
|
139
|
-
}), null, 16, ["file-name", "table-name"])) :
|
|
137
|
+
}), null, 16, ["file-name", "table-name"])) : R("", !0)
|
|
140
138
|
], 16),
|
|
141
|
-
|
|
142
|
-
"additional-template-filters":
|
|
139
|
+
p(G, {
|
|
140
|
+
"additional-template-filters": t.additionalTemplateFilters,
|
|
143
141
|
"custom-params": e.customParams,
|
|
144
142
|
"default-params-query": b.value,
|
|
145
143
|
object: e.object,
|
|
146
144
|
"object-name-column": e.objectNameColumn,
|
|
147
|
-
"removed-filters":
|
|
145
|
+
"removed-filters": t.removedFilters,
|
|
148
146
|
"table-name": n.value
|
|
149
147
|
}, null, 8, ["additional-template-filters", "custom-params", "default-params-query", "object", "object-name-column", "removed-filters", "table-name"]),
|
|
150
|
-
(
|
|
148
|
+
(f(), V(M, {
|
|
151
149
|
key: k.value,
|
|
152
|
-
columns: l(
|
|
150
|
+
columns: l(x),
|
|
153
151
|
"default-query-params": b.value,
|
|
154
152
|
"fetch-function": q,
|
|
155
|
-
"scroll-height":
|
|
153
|
+
"scroll-height": $.value,
|
|
156
154
|
"table-name": n.value,
|
|
157
155
|
"use-option": !1,
|
|
158
156
|
"data-key": "_id",
|
|
@@ -165,5 +163,5 @@ const le = /* @__PURE__ */ S({
|
|
|
165
163
|
}
|
|
166
164
|
});
|
|
167
165
|
export {
|
|
168
|
-
|
|
166
|
+
oe as _
|
|
169
167
|
};
|
package/columnlist/index.es.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { _ as
|
|
4
|
-
import { c as
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
1
|
+
import { reactive as $, defineComponent as _, mergeModels as q, useModel as U, ref as J, shallowRef as K, computed as B, watch as T, createElementBlock as w, openBlock as k, Fragment as E, renderList as z, createCommentVNode as G, mergeProps as I, withModifiers as C, createVNode as A } from "vue";
|
|
2
|
+
import { _ as Q } from "../checkbox/index.es.js";
|
|
3
|
+
import { _ as W } from "../icon/index.es.js";
|
|
4
|
+
import { c as X } from "../vendor/lodash-es/cloneDeep.es.js";
|
|
5
|
+
const Y = (o, d, l) => {
|
|
6
|
+
if (d && l > d) {
|
|
7
7
|
let r = 0;
|
|
8
8
|
return o.map((n) => {
|
|
9
|
-
const
|
|
10
|
-
return
|
|
9
|
+
const m = d !== void 0 && r < d, c = n.checkedByDefault !== !1 && d === void 0 || n.checkedByDefault !== !1 && m;
|
|
10
|
+
return c && r++, {
|
|
11
11
|
...n,
|
|
12
|
-
visible:
|
|
12
|
+
visible: c
|
|
13
13
|
};
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
return o;
|
|
17
|
-
},
|
|
17
|
+
}, x = "tableConfigs", Z = () => "user-" + (JSON.parse(localStorage.getItem("user") ?? "{}")._id ?? "unknown"), N = async () => {
|
|
18
18
|
let o = null;
|
|
19
|
-
return new Promise((
|
|
20
|
-
const l = indexedDB.open(
|
|
19
|
+
return new Promise((d) => {
|
|
20
|
+
const l = indexedDB.open(Z(), 1);
|
|
21
21
|
l.onupgradeneeded = (r) => {
|
|
22
|
-
o = r.target.result, o.createObjectStore(
|
|
22
|
+
o = r.target.result, o.createObjectStore(x);
|
|
23
23
|
}, l.onsuccess = (r) => {
|
|
24
|
-
o = r.target.result,
|
|
24
|
+
o = r.target.result, d(o);
|
|
25
25
|
};
|
|
26
26
|
});
|
|
27
|
-
},
|
|
28
|
-
const l = (await
|
|
27
|
+
}, ee = async () => {
|
|
28
|
+
const l = (await N()).transaction(x, "readonly").objectStore(x);
|
|
29
29
|
return new Promise((r) => {
|
|
30
|
-
let n,
|
|
31
|
-
l.getAllKeys().onsuccess = (
|
|
32
|
-
n =
|
|
33
|
-
}, l.getAll().onsuccess = (
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
n.forEach((
|
|
37
|
-
|
|
38
|
-
}), r(
|
|
30
|
+
let n, m;
|
|
31
|
+
l.getAllKeys().onsuccess = (c) => {
|
|
32
|
+
n = c.target.result;
|
|
33
|
+
}, l.getAll().onsuccess = (c) => {
|
|
34
|
+
m = c.target.result;
|
|
35
|
+
const b = {};
|
|
36
|
+
n.forEach((g, y) => {
|
|
37
|
+
b[g] = m[y];
|
|
38
|
+
}), r(b);
|
|
39
39
|
};
|
|
40
40
|
});
|
|
41
|
-
},
|
|
42
|
-
const o = async (
|
|
43
|
-
|
|
41
|
+
}, S = $({}), te = async () => {
|
|
42
|
+
const o = async (d, l) => {
|
|
43
|
+
S[d] = l, (await N()).transaction(x, "readwrite").objectStore(x).put(l, d);
|
|
44
44
|
};
|
|
45
|
-
return Object.assign(
|
|
46
|
-
config:
|
|
45
|
+
return Object.assign(S, await ee()), {
|
|
46
|
+
config: S,
|
|
47
47
|
setConfig: o
|
|
48
48
|
};
|
|
49
|
-
},
|
|
49
|
+
}, ae = ["id", "data-item-dragable", "draggable", "onDragenter", "onDragstart"], re = /* @__PURE__ */ _({
|
|
50
50
|
__name: "ColumnList",
|
|
51
51
|
props: /* @__PURE__ */ q({
|
|
52
52
|
tableId: {},
|
|
@@ -60,88 +60,110 @@ const W = (o, u, l) => {
|
|
|
60
60
|
modelModifiers: {}
|
|
61
61
|
}),
|
|
62
62
|
emits: ["update:modelValue"],
|
|
63
|
-
setup(o, { expose:
|
|
64
|
-
const l = o, r = U(o, "modelValue"), n =
|
|
65
|
-
if (!
|
|
63
|
+
setup(o, { expose: d }) {
|
|
64
|
+
const l = o, r = U(o, "modelValue"), n = J([]), m = K(), c = B(() => [...n.value].filter((a) => a.visible !== !1)), b = B(() => l.maxColumn ? c.value.length >= l.maxColumn : !1), g = (a) => a.dragable !== !1 && y(a), y = (a) => {
|
|
65
|
+
if (!b.value) return !0;
|
|
66
66
|
const t = r.value.findIndex((e) => e.field === a.field) > 0;
|
|
67
|
-
return
|
|
68
|
-
},
|
|
69
|
-
|
|
67
|
+
return b.value && t;
|
|
68
|
+
}, H = (a) => {
|
|
69
|
+
const t = [];
|
|
70
|
+
for (const e of a)
|
|
71
|
+
if (e.parentHeader) {
|
|
72
|
+
const s = t.find(
|
|
73
|
+
(f) => f.parentHeaderField === e.parentHeader.field
|
|
74
|
+
);
|
|
75
|
+
s ? s.siblingHeaders.push(e) : t.push({
|
|
76
|
+
...e,
|
|
77
|
+
parentHeaderField: e.parentHeader.field,
|
|
78
|
+
siblingHeaders: []
|
|
79
|
+
});
|
|
80
|
+
} else
|
|
81
|
+
t.push(e);
|
|
82
|
+
return t;
|
|
83
|
+
}, D = (a) => {
|
|
84
|
+
const t = [];
|
|
85
|
+
for (const e of a)
|
|
86
|
+
e.parentHeaderField ? t.push(e, ...e.siblingHeaders) : t.push(e);
|
|
87
|
+
return t;
|
|
88
|
+
}, V = () => {
|
|
89
|
+
n.value = Y(
|
|
70
90
|
n.value,
|
|
71
91
|
l.maxColumn,
|
|
72
|
-
|
|
73
|
-
), r.value = [...
|
|
74
|
-
},
|
|
75
|
-
const a =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
), { setConfig: t } = await
|
|
92
|
+
c.value.length
|
|
93
|
+
), r.value = D([...c.value]);
|
|
94
|
+
}, h = async () => {
|
|
95
|
+
const a = D(
|
|
96
|
+
n.value
|
|
97
|
+
).map((e) => ({
|
|
98
|
+
field: e.field,
|
|
99
|
+
width: e.width ?? "max-content",
|
|
100
|
+
visible: e.visible !== !1,
|
|
101
|
+
fixed: !!e.fixed
|
|
102
|
+
})), { setConfig: t } = await te();
|
|
83
103
|
await t(l.tableId, a);
|
|
84
|
-
},
|
|
85
|
-
r.value = [...n.value];
|
|
86
|
-
},
|
|
87
|
-
const { dataTransfer:
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
var e,
|
|
93
|
-
if (a.preventDefault(),
|
|
94
|
-
const f = a.target,
|
|
95
|
-
if (
|
|
96
|
-
const
|
|
97
|
-
(
|
|
98
|
-
var
|
|
99
|
-
return
|
|
104
|
+
}, R = () => {
|
|
105
|
+
r.value = D([...n.value]);
|
|
106
|
+
}, L = (a, t, e) => {
|
|
107
|
+
const { dataTransfer: s } = a;
|
|
108
|
+
m.value = t, s && (s.dropEffect = "move", s.effectAllowed = "move", s.setData("field", t.field), s.setData("index", e.toString()));
|
|
109
|
+
}, j = async () => {
|
|
110
|
+
m.value = void 0, R(), await h();
|
|
111
|
+
}, F = (a, t) => {
|
|
112
|
+
var e, s;
|
|
113
|
+
if (a.preventDefault(), g(t)) {
|
|
114
|
+
const f = a.target, u = f.tagName === "LI" ? f : f.closest("li");
|
|
115
|
+
if (u == null || u.classList.add("bg-primary-50"), (e = u == null ? void 0 : u.nextElementSibling) == null || e.classList.remove("bg-primary-50"), (s = u == null ? void 0 : u.previousElementSibling) == null || s.classList.remove("bg-primary-50"), !u || !m.value) return;
|
|
116
|
+
const i = n.value.findIndex(
|
|
117
|
+
(p) => {
|
|
118
|
+
var M;
|
|
119
|
+
return p.field === ((M = m.value) == null ? void 0 : M.field);
|
|
100
120
|
}
|
|
101
|
-
),
|
|
102
|
-
(
|
|
121
|
+
), v = n.value.findIndex(
|
|
122
|
+
(p) => p.field === u.id
|
|
103
123
|
);
|
|
104
|
-
|
|
105
|
-
n.value[
|
|
106
|
-
n.value[
|
|
124
|
+
i !== -1 && v !== -1 && ([
|
|
125
|
+
n.value[i],
|
|
126
|
+
n.value[v]
|
|
107
127
|
] = [
|
|
108
|
-
n.value[
|
|
109
|
-
n.value[
|
|
128
|
+
n.value[v],
|
|
129
|
+
n.value[i]
|
|
110
130
|
]);
|
|
111
131
|
}
|
|
112
132
|
}, O = (a) => {
|
|
113
133
|
const t = a.target.querySelector("label");
|
|
114
134
|
t && t.click();
|
|
115
|
-
},
|
|
116
|
-
const a =
|
|
135
|
+
}, P = () => {
|
|
136
|
+
const a = X(l.defaultColumns);
|
|
117
137
|
if (l.maxColumn && a.length > l.maxColumn) {
|
|
118
138
|
let t = 0;
|
|
119
|
-
n.value =
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
139
|
+
n.value = H(
|
|
140
|
+
a.map((e) => {
|
|
141
|
+
const s = l.maxColumn !== void 0 && t < l.maxColumn, f = e.checkedByDefault !== !1 && l.maxColumn === void 0 || e.checkedByDefault !== !1 && s;
|
|
142
|
+
return f && t++, {
|
|
143
|
+
...e,
|
|
144
|
+
visible: f
|
|
145
|
+
};
|
|
146
|
+
})
|
|
147
|
+
);
|
|
126
148
|
} else
|
|
127
|
-
n.value = a;
|
|
128
|
-
r.value = [...
|
|
149
|
+
n.value = H(a);
|
|
150
|
+
r.value = D([...c.value]), h();
|
|
129
151
|
};
|
|
130
|
-
return
|
|
152
|
+
return T(
|
|
131
153
|
() => l.savedColumns,
|
|
132
154
|
(a) => {
|
|
133
|
-
n.value = a ?? [];
|
|
155
|
+
n.value = H(a) ?? [];
|
|
134
156
|
},
|
|
135
157
|
{ immediate: !0 }
|
|
136
|
-
),
|
|
137
|
-
setColumnVisibilityConfig:
|
|
138
|
-
resetToDefault:
|
|
139
|
-
updateVisibleColumnsModel:
|
|
140
|
-
}), (a, t) => (
|
|
141
|
-
(
|
|
142
|
-
var f;
|
|
143
|
-
return
|
|
144
|
-
e.reorderable !== !1 ? (
|
|
158
|
+
), d({
|
|
159
|
+
setColumnVisibilityConfig: h,
|
|
160
|
+
resetToDefault: P,
|
|
161
|
+
updateVisibleColumnsModel: V
|
|
162
|
+
}), (a, t) => (k(), w("ul", null, [
|
|
163
|
+
(k(!0), w(E, null, z(n.value, (e, s) => {
|
|
164
|
+
var f, u;
|
|
165
|
+
return k(), w(E, null, [
|
|
166
|
+
e.reorderable !== !1 ? (k(), w("li", I(
|
|
145
167
|
{
|
|
146
168
|
id: e.field,
|
|
147
169
|
key: e.field,
|
|
@@ -149,56 +171,59 @@ const W = (o, u, l) => {
|
|
|
149
171
|
},
|
|
150
172
|
a.$preset.customcolumn.menuitem({
|
|
151
173
|
props: l,
|
|
152
|
-
context: { dragable:
|
|
174
|
+
context: { dragable: g(e) }
|
|
153
175
|
}),
|
|
154
176
|
{
|
|
155
|
-
"data-item-dragable":
|
|
156
|
-
draggable:
|
|
177
|
+
"data-item-dragable": g(e),
|
|
178
|
+
draggable: g(e),
|
|
157
179
|
onClick: O,
|
|
158
|
-
onDragend:
|
|
159
|
-
onDragenter:
|
|
160
|
-
onDragleave: t[2] || (t[2] =
|
|
180
|
+
onDragend: j,
|
|
181
|
+
onDragenter: C((i) => F(i, e), ["prevent"]),
|
|
182
|
+
onDragleave: t[2] || (t[2] = C(() => {
|
|
161
183
|
}, ["prevent"])),
|
|
162
|
-
onDragover: t[3] || (t[3] =
|
|
184
|
+
onDragover: t[3] || (t[3] = C(() => {
|
|
163
185
|
}, ["prevent"])),
|
|
164
|
-
onDragstart: (
|
|
165
|
-
onMouseenter: t[4] || (t[4] = (
|
|
166
|
-
onMouseleave: t[5] || (t[5] = (
|
|
186
|
+
onDragstart: (i) => L(i, e, s),
|
|
187
|
+
onMouseenter: t[4] || (t[4] = (i) => i.target.classList.add("bg-primary-50")),
|
|
188
|
+
onMouseleave: t[5] || (t[5] = (i) => i.target.classList.remove("bg-primary-50")),
|
|
167
189
|
"data-wv-section": "custom-column-menu-item"
|
|
168
190
|
}
|
|
169
191
|
), [
|
|
170
|
-
|
|
192
|
+
A(W, I(
|
|
171
193
|
{
|
|
172
|
-
onClick: t[0] || (t[0] =
|
|
194
|
+
onClick: t[0] || (t[0] = C(() => {
|
|
173
195
|
}, ["stop"])),
|
|
174
196
|
ref_for: !0
|
|
175
197
|
},
|
|
176
198
|
(f = a.$preset.customcolumn) == null ? void 0 : f.dragicon({
|
|
177
|
-
context: { dragable:
|
|
199
|
+
context: { dragable: g(e) }
|
|
178
200
|
}),
|
|
179
201
|
{ icon: "dragable-menu" }
|
|
180
202
|
), null, 16),
|
|
181
|
-
|
|
203
|
+
A(Q, {
|
|
182
204
|
"aria-label": e.header,
|
|
183
205
|
disabled: e.fixed,
|
|
184
|
-
label: e.header,
|
|
206
|
+
label: ((u = e.parentHeader) == null ? void 0 : u.header) ?? e.header,
|
|
185
207
|
"model-value": e.visible !== !1,
|
|
186
|
-
selectable:
|
|
187
|
-
onClick: t[1] || (t[1] =
|
|
208
|
+
selectable: y(e),
|
|
209
|
+
onClick: t[1] || (t[1] = C(() => {
|
|
188
210
|
}, ["stop"])),
|
|
189
|
-
"onUpdate:modelValue": (
|
|
190
|
-
|
|
211
|
+
"onUpdate:modelValue": (i) => {
|
|
212
|
+
var v;
|
|
213
|
+
e.visible = !!i, (v = e.siblingHeaders) == null || v.forEach((p) => {
|
|
214
|
+
p.visible = !!i;
|
|
215
|
+
}), V(), h();
|
|
191
216
|
},
|
|
192
217
|
class: "!w-full"
|
|
193
218
|
}, null, 8, ["aria-label", "disabled", "label", "model-value", "selectable", "onUpdate:modelValue"])
|
|
194
|
-
], 16,
|
|
219
|
+
], 16, ae)) : G("", !0)
|
|
195
220
|
], 64);
|
|
196
221
|
}), 256))
|
|
197
222
|
]));
|
|
198
223
|
}
|
|
199
224
|
});
|
|
200
225
|
export {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
226
|
+
re as _,
|
|
227
|
+
Y as s,
|
|
228
|
+
te as u
|
|
204
229
|
};
|
package/customcolumn/index.d.ts
CHANGED
|
@@ -5,7 +5,11 @@ export interface CustomColumnLocaleConfig {
|
|
|
5
5
|
resetDefaultText: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export type DragableColumn = TableColumn & {
|
|
8
|
+
export type DragableColumn = TableColumn & {
|
|
9
|
+
order?: number;
|
|
10
|
+
parentHeaderField?: string;
|
|
11
|
+
siblingHeaders?: TableColumn[];
|
|
12
|
+
};
|
|
9
13
|
|
|
10
14
|
export interface CustomColumnProps {
|
|
11
15
|
tableId: string;
|
package/datatable/index.d.ts
CHANGED
|
@@ -245,8 +245,42 @@ export type ColumnPreset =
|
|
|
245
245
|
| ColumnMultiRowPreset
|
|
246
246
|
| ColumnCheckboxPreset;
|
|
247
247
|
|
|
248
|
+
export interface CombinedHeaders {
|
|
249
|
+
parent: TableParentHeader[];
|
|
250
|
+
child: TreeTableColumns[];
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export interface TableParentHeader
|
|
254
|
+
extends Pick<
|
|
255
|
+
TableColumn,
|
|
256
|
+
'header' | 'info' | 'infoSeverity' | 'headerClass'
|
|
257
|
+
> {
|
|
258
|
+
/**
|
|
259
|
+
* Field is used as the header's key, parent headers with
|
|
260
|
+
* the same field will be grouped into one cell
|
|
261
|
+
*/
|
|
262
|
+
field: string;
|
|
263
|
+
/**
|
|
264
|
+
* Note: colspan is calculated automatically
|
|
265
|
+
* @ignore
|
|
266
|
+
*/
|
|
267
|
+
colspan?: number;
|
|
268
|
+
/**
|
|
269
|
+
* Note: rowspan is calculated automatically
|
|
270
|
+
* @ignore
|
|
271
|
+
*/
|
|
272
|
+
rowspan?: number;
|
|
273
|
+
}
|
|
274
|
+
|
|
248
275
|
export interface TableColumn {
|
|
249
276
|
header?: string;
|
|
277
|
+
/**
|
|
278
|
+
* The headers placed above certain child headers. If there are
|
|
279
|
+
* multiple child headers with the same parent header, the parent
|
|
280
|
+
* will have its colspan extended. The parent header will be shown
|
|
281
|
+
* when at least one of its child headers is visible.
|
|
282
|
+
*/
|
|
283
|
+
parentHeader?: TableParentHeader;
|
|
250
284
|
field: string;
|
|
251
285
|
fieldType?: 'string' | 'number' | 'boolean' | 'array';
|
|
252
286
|
info?: string;
|
|
@@ -666,6 +700,10 @@ export type BaseDataTableEmits = {
|
|
|
666
700
|
* Emits when option menu button clicked.
|
|
667
701
|
*/
|
|
668
702
|
'toggleOption': [data: Data];
|
|
703
|
+
/**
|
|
704
|
+
* Emits when an item is double clicked.
|
|
705
|
+
*/
|
|
706
|
+
'doubleClick': [data: Data];
|
|
669
707
|
/**
|
|
670
708
|
* @deprecated use 'v-model:selected-data' instead.
|
|
671
709
|
*/
|