@fewangsit/wangsvue-fats 1.0.1-alpha.40 → 1.0.1-alpha.42
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/animation/index.d.ts +13 -1
- package/animation/index.es.js +11 -9
- package/assets/lottiejs/scan-qr.es.js +4 -0
- package/badge/index.d.ts +11 -1
- package/badge/index.es.js +55 -53
- package/badgegroup/index.es.js +16 -14
- package/buttonbulkaction/index.es.js +15 -14
- package/datatable/index.d.ts +41 -0
- package/datatable/index.es.js +471 -435
- package/disposalreporttable/index.es.js +56 -55
- package/dropdown/index.d.ts +1 -0
- package/dropdown/index.es.js +82 -72
- package/headercell/index.es.js +40 -0
- package/inputbadge/index.d.ts +33 -0
- package/inputbadge/index.es.js +108 -94
- package/inputcurrency/index.es.js +2 -1
- package/package.json +2 -1
- package/scan-qr-C6V4afHJ.js +4 -0
- package/scan-qr-ER7xYaNh.js +1 -0
- package/stats.html +1 -1
- package/style.css +1 -1
- package/wangsvue-fats.esm.browser.js +11705 -11603
- package/wangsvue-fats.system.js +69 -69
package/animation/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Config } from '@lottiefiles/dotlottie-web';
|
|
2
|
+
|
|
1
3
|
import { ClassComponent } from '../ts-helpers.d';
|
|
2
4
|
|
|
3
5
|
export interface AnimationDefaultConfig {
|
|
@@ -5,7 +7,12 @@ export interface AnimationDefaultConfig {
|
|
|
5
7
|
}
|
|
6
8
|
|
|
7
9
|
export interface AnimationProps {
|
|
8
|
-
animation:
|
|
10
|
+
animation:
|
|
11
|
+
| 'no-data'
|
|
12
|
+
| 'loading-plane'
|
|
13
|
+
| 'loading-page'
|
|
14
|
+
| 'loading-table'
|
|
15
|
+
| 'scan-qr';
|
|
9
16
|
/**
|
|
10
17
|
* @default true
|
|
11
18
|
*/
|
|
@@ -14,6 +21,11 @@ export interface AnimationProps {
|
|
|
14
21
|
* @default true
|
|
15
22
|
*/
|
|
16
23
|
loop?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Custom configurations for the animation
|
|
26
|
+
* Reference: https://developers.lottiefiles.com/docs/dotlottie-player/dotlottie-web/api/config/
|
|
27
|
+
*/
|
|
28
|
+
customConfig?: Partial<Config>;
|
|
17
29
|
}
|
|
18
30
|
|
|
19
31
|
/**
|
package/animation/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as p, computed as m, ref as u, onMounted as c, createElementBlock as d, openBlock as f, mergeProps as g, createElementVNode as
|
|
2
|
-
import { u as
|
|
3
|
-
import { m as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as p, computed as m, ref as u, onMounted as c, createElementBlock as d, openBlock as f, mergeProps as g, createElementVNode as w } from "vue";
|
|
2
|
+
import { u as y } from "../plugins/WangsVue.es.js";
|
|
3
|
+
import { m as h } from "../utils/mergePropsWithDefaults.util.es.js";
|
|
4
|
+
const v = (n, e, i) => {
|
|
5
5
|
const o = n[e];
|
|
6
6
|
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((a, s) => {
|
|
7
7
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
@@ -18,17 +18,19 @@ const w = (n, e, i) => {
|
|
|
18
18
|
props: {
|
|
19
19
|
animation: {},
|
|
20
20
|
autoplay: { type: Boolean, default: !0 },
|
|
21
|
-
loop: { type: Boolean, default: !0 }
|
|
21
|
+
loop: { type: Boolean, default: !0 },
|
|
22
|
+
customConfig: {}
|
|
22
23
|
},
|
|
23
24
|
setup(n) {
|
|
24
|
-
const e = n, { defaultProps: i } =
|
|
25
|
+
const e = n, { defaultProps: i } = y("Animation"), o = m(() => h(e, i)), a = u(null);
|
|
25
26
|
c(async () => {
|
|
26
|
-
const l = await
|
|
27
|
+
const l = await v(/* @__PURE__ */ Object.assign({ "../../assets/lottie/admin/loading-page.lottie": () => import("../assets/lottiejs/loading-page.es.js").then((t) => t.l), "../../assets/lottie/admin/loading-table.lottie": () => import("../assets/lottiejs/loading-table.es.js").then((t) => t.l), "../../assets/lottie/admin/no-data.lottie": () => import("../assets/lottiejs/no-data.es.js").then((t) => t.n), "../../assets/lottie/supplyasset/loading-page.lottie": () => import("../assets/lottiejs/loading-page.es.js").then((t) => t.a), "../../assets/lottie/supplyasset/loading-table.lottie": () => import("../assets/lottiejs/loading-table.es.js").then((t) => t.a), "../../assets/lottie/supplyasset/no-data.lottie": () => import("../assets/lottiejs/no-data.es.js").then((t) => t.a), "../../assets/lottie/workspace/loading-page.lottie": () => import("../assets/lottiejs/loading-page.es.js").then((t) => t.b), "../../assets/lottie/workspace/loading-plane.lottie": () => import("../assets/lottiejs/loading-plane.es.js"), "../../assets/lottie/workspace/loading-table.lottie": () => import("../assets/lottiejs/loading-table.es.js").then((t) => t.b), "../../assets/lottie/workspace/no-data.lottie": () => import("../assets/lottiejs/no-data.es.js").then((t) => t.b), "../../assets/lottie/workspace/scan-qr.lottie": () => import("../assets/lottiejs/scan-qr.es.js") }), `../../assets/lottie/${o.value.libPath}/${e.animation}.lottie`, 6), { DotLottie: r } = await s();
|
|
27
28
|
a.value && new r({
|
|
28
29
|
canvas: a.value,
|
|
29
30
|
src: l.default,
|
|
30
31
|
autoplay: e.autoplay,
|
|
31
|
-
loop: e.loop
|
|
32
|
+
loop: e.loop,
|
|
33
|
+
...e.customConfig
|
|
32
34
|
});
|
|
33
35
|
});
|
|
34
36
|
const s = () => "System" in window ? new Function(
|
|
@@ -39,7 +41,7 @@ const w = (n, e, i) => {
|
|
|
39
41
|
"https://cdn.jsdelivr.net/npm/@lottiefiles/dotlottie-web@0.38.2/+esm"
|
|
40
42
|
);
|
|
41
43
|
return (l, r) => (f(), d("div", g({ "data-wv-name": "animation" }, l.$attrs), [
|
|
42
|
-
|
|
44
|
+
w("canvas", {
|
|
43
45
|
ref_key: "canvasRef",
|
|
44
46
|
ref: a,
|
|
45
47
|
style: { width: "100%", height: "100%" }
|
|
@@ -0,0 +1,4 @@
|
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sEt+n6Ef0Ccbe1BO3zOnh2GFFzWoLxzLbdAMg+i3DnCX8Oi69tiqAtb/i0+8nMVBP3ovt9PlzfwlphaK+znsLJATf7KVhUsrtGpq3llZcCN8LWF50QaXquFRgxIvtWgU9rq+ICvLwcD8I3KU49pbudtg+BK02eMofQuN9haGll0vfrduq8vV4t4XbDe60GDt9T/wUFDQT3TGIIQBBrNAEBlG5izHUV4to4BLkjXFLZKHbH27ZQr6eEYj+366bpd4j15/8xY6I6lPQqJSuM3tjDh/ovsgIbwueXTxFmpHQg+mbhIKA5WF2KSzBm4fe6fzBnoSZSVf6o2hLhzL8OWZ+e+c7DKk71juc6y4flWmsEPDqPn6Wu6UdchqoteH9VTDLIfVPDsHGBbu7fW2GQ7DP1tx31zD+xBrZgioA611Q/E60Xso2ruxhU0krym9goRBmGmSPE/8afA8iet9aQMD977t26ChRj9qQXTvfifJz9ePg+WjGOuGed9c0KlXM4gar1KfU7vfVmcVb7RTHWfcYKpDu0ze5tBNdaR1OMX9xSzUk5rpYBR8npkOIi+m67tuefnh4f9QSwECFAAUAAAACACcDPZarFVO0IAAAAC1AAAADQAAAAAAAAAAAAAAAAAAAAAAbWFuaWZlc3QuanNvblBLAQIUABQAAAAIAJwM9lqrVGMVGAoAAEicAAA0AAAAAAAAAAAAAAAAAKsAAABhbmltYXRpb25zLzY2YTg4YTA4LTkyNGItNGM5Yy05ZDc0LWIxNTljNWU4N2MxMC5qc29uUEsFBgAAAAACAAIAnQAAABULAAAAAA==";
|
|
2
|
+
export {
|
|
3
|
+
A as default
|
|
4
|
+
};
|
package/badge/index.d.ts
CHANGED
|
@@ -22,6 +22,11 @@ export interface BadgeProps extends BadgeComponentConfigs {
|
|
|
22
22
|
* Whether the badge text is editable.
|
|
23
23
|
*/
|
|
24
24
|
editable?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Prevent the badge text from being empty.
|
|
27
|
+
* When set to true, the badge text content will be set to the previous value if it left empty.
|
|
28
|
+
*/
|
|
29
|
+
restoreOnEmpty?: boolean;
|
|
25
30
|
/**
|
|
26
31
|
* Sets the severity level for styling purposes. This prop might be omitted if getSeverity is provided.
|
|
27
32
|
*/
|
|
@@ -34,6 +39,11 @@ export interface BadgeProps extends BadgeComponentConfigs {
|
|
|
34
39
|
* Whether to show the remove icon or not. Clicking the remove icon will emit 'remove' event.
|
|
35
40
|
*/
|
|
36
41
|
removable?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Wether to show remove button, but it must be disabled.
|
|
44
|
+
* It will affect nothing when `removable` is truthy
|
|
45
|
+
*/
|
|
46
|
+
disableRemoveButton?: boolean;
|
|
37
47
|
/**
|
|
38
48
|
* Whether to set badge become disabled.
|
|
39
49
|
*/
|
|
@@ -56,7 +66,7 @@ export type BadgeEmits = {
|
|
|
56
66
|
* Emits when the text is edited.
|
|
57
67
|
* Only available when props.editable=true
|
|
58
68
|
*/
|
|
59
|
-
'update:label': [label: string | null];
|
|
69
|
+
'update:label': [label: string | null, prevLabel: string | null];
|
|
60
70
|
};
|
|
61
71
|
|
|
62
72
|
/**
|
package/badge/index.es.js
CHANGED
|
@@ -1,99 +1,101 @@
|
|
|
1
|
-
import { defineComponent as C, computed as
|
|
2
|
-
import { u as
|
|
3
|
-
import { m as
|
|
4
|
-
import { f as
|
|
5
|
-
import { _ as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as C, computed as n, resolveDirective as w, withDirectives as D, createElementBlock as c, openBlock as d, mergeProps as p, createElementVNode as S, createBlock as T, createCommentVNode as E, toDisplayString as R } from "vue";
|
|
2
|
+
import { u as V } from "../plugins/WangsVue.es.js";
|
|
3
|
+
import { m as W } from "../utils/mergePropsWithDefaults.util.es.js";
|
|
4
|
+
import { f as _ } from "../utils/textFormatter.util.es.js";
|
|
5
|
+
import { _ as N } from "../button/index.es.js";
|
|
6
|
+
const O = ["contenteditable"], P = {
|
|
7
7
|
key: 1,
|
|
8
8
|
"aria-label": "invalid-label"
|
|
9
|
-
},
|
|
9
|
+
}, j = /* @__PURE__ */ C({
|
|
10
10
|
__name: "Badge",
|
|
11
11
|
props: {
|
|
12
12
|
label: {},
|
|
13
13
|
editable: { type: Boolean },
|
|
14
|
+
restoreOnEmpty: { type: Boolean },
|
|
14
15
|
severity: {},
|
|
15
16
|
format: {},
|
|
16
17
|
removable: { type: Boolean },
|
|
18
|
+
disableRemoveButton: { type: Boolean },
|
|
17
19
|
disabled: { type: Boolean },
|
|
18
20
|
tooltip: {},
|
|
19
21
|
getSeverity: { type: Function }
|
|
20
22
|
},
|
|
21
23
|
emits: ["remove", "update:label"],
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
}),
|
|
27
|
-
var
|
|
28
|
-
return
|
|
29
|
-
}),
|
|
30
|
-
if (!
|
|
31
|
-
switch (
|
|
24
|
+
setup(v, { emit: f }) {
|
|
25
|
+
const e = v, s = f, { defaultProps: y } = V("Badge"), g = n(() => W(e, y)), b = n(() => {
|
|
26
|
+
const t = typeof e.label;
|
|
27
|
+
return t === "number" || t === "string" && e.label && e.label !== "-";
|
|
28
|
+
}), i = n(() => {
|
|
29
|
+
var t, o;
|
|
30
|
+
return e.severity || ((o = (t = g.value).getSeverity) == null ? void 0 : o.call(t, e.label));
|
|
31
|
+
}), B = n(() => {
|
|
32
|
+
if (!b.value) return "-";
|
|
33
|
+
switch (e.format) {
|
|
32
34
|
case "nowrap":
|
|
33
|
-
return
|
|
35
|
+
return e.label;
|
|
34
36
|
case "username":
|
|
35
|
-
return
|
|
37
|
+
return _(e.label);
|
|
36
38
|
default:
|
|
37
|
-
if (
|
|
38
|
-
const
|
|
39
|
-
return `${
|
|
39
|
+
if (e.label.length > 12) {
|
|
40
|
+
const t = e.label.slice(0, 5), o = e.label.slice(-5);
|
|
41
|
+
return `${t}..${o}`;
|
|
40
42
|
}
|
|
41
|
-
return
|
|
43
|
+
return e.label;
|
|
42
44
|
}
|
|
43
|
-
}),
|
|
44
|
-
const o =
|
|
45
|
-
(
|
|
46
|
-
}, k = (
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
-
const
|
|
50
|
-
|
|
45
|
+
}), m = n(() => e.tooltip || (e.format !== "nowrap" && e.label.length > 12 || e.format === "username" && e.label.length > 8 ? e.label : void 0)), $ = (t) => {
|
|
46
|
+
const o = t.target;
|
|
47
|
+
(t.code === "Enter" || t.code === "Tab") && (t.preventDefault(), o.blur());
|
|
48
|
+
}, k = (t, o) => {
|
|
49
|
+
const l = t.textContent;
|
|
50
|
+
if (l !== e.label) {
|
|
51
|
+
const r = (l == null ? void 0 : l.trim()) ?? null, a = e.restoreOnEmpty && !r ? e.label : r;
|
|
52
|
+
t.textContent = a, s("update:label", a, e.label), o && !a && e.removable != !1 && (o.remove(), s("remove"));
|
|
51
53
|
}
|
|
52
54
|
};
|
|
53
|
-
return (
|
|
54
|
-
var
|
|
55
|
-
const
|
|
56
|
-
return
|
|
55
|
+
return (t, o) => {
|
|
56
|
+
var r, a, u;
|
|
57
|
+
const l = w("tooltip");
|
|
58
|
+
return b.value ? D((d(), c("span", p(
|
|
57
59
|
{
|
|
58
60
|
key: 0,
|
|
59
61
|
ref: "badge"
|
|
60
62
|
},
|
|
61
|
-
(
|
|
62
|
-
props: { severity:
|
|
63
|
+
(r = t.$preset.badge) == null ? void 0 : r.root({
|
|
64
|
+
props: { severity: i.value, disabled: t.disabled }
|
|
63
65
|
})
|
|
64
66
|
), [
|
|
65
|
-
S("span",
|
|
66
|
-
contenteditable:
|
|
67
|
+
S("span", p({ ref: "input" }, (a = t.$preset.badge) == null ? void 0 : a.input({ props: e, context: { badgeTooltip: m.value } }), {
|
|
68
|
+
contenteditable: t.editable,
|
|
67
69
|
onBlur: o[0] || (o[0] = (h) => k(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
t.$refs.input,
|
|
71
|
+
t.$refs.badge
|
|
70
72
|
)),
|
|
71
|
-
onKeydown:
|
|
73
|
+
onKeydown: $,
|
|
72
74
|
spellcheck: "false"
|
|
73
|
-
}),
|
|
74
|
-
|
|
75
|
+
}), R(B.value), 17, O),
|
|
76
|
+
e.removable || e.disableRemoveButton ? (d(), T(N, p(
|
|
75
77
|
{ key: 0 },
|
|
76
|
-
(
|
|
78
|
+
(u = t.$preset.badge) == null ? void 0 : u.removebutton({ props: { badgeSeverity: i.value, disabled: t.disabled } }),
|
|
77
79
|
{
|
|
78
|
-
disabled:
|
|
79
|
-
severity:
|
|
80
|
-
onClick: o[1] || (o[1] = (h) =>
|
|
80
|
+
disabled: e.disabled || !e.removable && e.disableRemoveButton,
|
|
81
|
+
severity: i.value,
|
|
82
|
+
onClick: o[1] || (o[1] = (h) => s("remove")),
|
|
81
83
|
icon: "close",
|
|
82
84
|
rounded: "",
|
|
83
85
|
text: ""
|
|
84
86
|
}
|
|
85
|
-
), null, 16, ["disabled", "severity"])) :
|
|
87
|
+
), null, 16, ["disabled", "severity"])) : E("", !0)
|
|
86
88
|
], 16)), [
|
|
87
89
|
[
|
|
88
|
-
|
|
89
|
-
{ value:
|
|
90
|
+
l,
|
|
91
|
+
{ value: m.value, autoHide: !1 },
|
|
90
92
|
void 0,
|
|
91
93
|
{ top: !0 }
|
|
92
94
|
]
|
|
93
|
-
]) : (
|
|
95
|
+
]) : (d(), c("span", P, "-"));
|
|
94
96
|
};
|
|
95
97
|
}
|
|
96
98
|
});
|
|
97
99
|
export {
|
|
98
|
-
|
|
100
|
+
j as _
|
|
99
101
|
};
|
package/badgegroup/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as k, shallowRef as
|
|
2
|
-
import { s as
|
|
1
|
+
import { defineComponent as k, shallowRef as b, computed as m, createElementBlock as s, openBlock as o, normalizeProps as c, mergeProps as u, createBlock as a, createCommentVNode as y, Fragment as d, renderList as f, unref as h, withCtx as $, renderSlot as B } from "vue";
|
|
2
|
+
import { s as w } from "../vendor/primevue/dialog/dialog.esm.es.js";
|
|
3
3
|
import { _ as v } from "../badge/index.es.js";
|
|
4
|
-
import { _ as
|
|
5
|
-
const L = { key: 0 },
|
|
4
|
+
import { _ as x } from "../button/index.es.js";
|
|
5
|
+
const L = { key: 0 }, R = /* @__PURE__ */ k({
|
|
6
6
|
__name: "BadgeGroup",
|
|
7
7
|
props: {
|
|
8
8
|
labels: {},
|
|
@@ -11,32 +11,34 @@ const L = { key: 0 }, j = /* @__PURE__ */ k({
|
|
|
11
11
|
limit: {},
|
|
12
12
|
headerLabel: { default: "Header" },
|
|
13
13
|
editable: { type: Boolean },
|
|
14
|
+
restoreOnEmpty: { type: Boolean },
|
|
14
15
|
severity: {},
|
|
15
16
|
format: {},
|
|
17
|
+
disableRemoveButton: { type: Boolean },
|
|
16
18
|
tooltip: {},
|
|
17
19
|
getSeverity: {}
|
|
18
20
|
},
|
|
19
21
|
setup(g) {
|
|
20
|
-
const t = g, l =
|
|
22
|
+
const t = g, l = b(!1), n = m(() => t.labels.slice(0, t.limit)), p = m(
|
|
21
23
|
() => t.labels.length - n.value.length
|
|
22
24
|
);
|
|
23
|
-
return (r, i) => n.value.length ? (o(), s("div",
|
|
24
|
-
(o(!0), s(d, null,
|
|
25
|
+
return (r, i) => n.value.length ? (o(), s("div", c(u({ key: 1 }, r.$preset.badgegroup.root)), [
|
|
26
|
+
(o(!0), s(d, null, f(n.value, (e) => (o(), a(v, {
|
|
25
27
|
key: typeof e == "string" ? e : e.text,
|
|
26
28
|
format: t.format,
|
|
27
29
|
label: typeof e == "string" ? e : e.text,
|
|
28
30
|
severity: typeof e == "string" ? t.severity : e.severity,
|
|
29
31
|
tooltip: typeof e == "object" && e.tooltip
|
|
30
32
|
}, null, 8, ["format", "label", "severity", "tooltip"]))), 128)),
|
|
31
|
-
p.value ? (o(), a(
|
|
33
|
+
p.value ? (o(), a(x, u({
|
|
32
34
|
key: 0,
|
|
33
35
|
label: `+${p.value} ${r.textMore}`
|
|
34
36
|
}, r.$preset.badgegroup.showmorebutton, {
|
|
35
37
|
severity: t.textMoreSeverity ?? "dark",
|
|
36
38
|
onClick: i[0] || (i[0] = (e) => l.value = !0),
|
|
37
39
|
text: ""
|
|
38
|
-
}), null, 16, ["label", "severity"])) :
|
|
39
|
-
r.limit ? (o(), a(
|
|
40
|
+
}), null, 16, ["label", "severity"])) : y("", !0),
|
|
41
|
+
r.limit ? (o(), a(h(w), {
|
|
40
42
|
key: 1,
|
|
41
43
|
visible: l.value,
|
|
42
44
|
"onUpdate:visible": i[1] || (i[1] = (e) => l.value = e),
|
|
@@ -46,10 +48,10 @@ const L = { key: 0 }, j = /* @__PURE__ */ k({
|
|
|
46
48
|
modal: ""
|
|
47
49
|
}, {
|
|
48
50
|
default: $(() => [
|
|
49
|
-
|
|
51
|
+
B(r.$slots, "dialogcontent", {
|
|
50
52
|
labels: t.labels
|
|
51
53
|
}, () => [
|
|
52
|
-
(o(!0), s(d, null,
|
|
54
|
+
(o(!0), s(d, null, f(t.labels, (e) => (o(), a(v, {
|
|
53
55
|
key: typeof e == "string" ? e : e.text,
|
|
54
56
|
format: t.format,
|
|
55
57
|
label: typeof e == "string" ? e : e.text,
|
|
@@ -59,10 +61,10 @@ const L = { key: 0 }, j = /* @__PURE__ */ k({
|
|
|
59
61
|
])
|
|
60
62
|
]),
|
|
61
63
|
_: 3
|
|
62
|
-
}, 8, ["visible", "header", "pt"])) :
|
|
64
|
+
}, 8, ["visible", "header", "pt"])) : y("", !0)
|
|
63
65
|
], 16)) : (o(), s("span", L, " - "));
|
|
64
66
|
}
|
|
65
67
|
});
|
|
66
68
|
export {
|
|
67
|
-
|
|
69
|
+
R as _
|
|
68
70
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as Y, onMounted as Z, onUnmounted as I, ref as R, shallowRef as k, computed as x, watch as F, withDirectives as y, createElementBlock as h, openBlock as
|
|
1
|
+
import { defineComponent as Y, onMounted as Z, onUnmounted as I, ref as R, shallowRef as k, computed as x, watch as F, withDirectives as y, createElementBlock as h, openBlock as u, mergeProps as f, createBlock as E, createCommentVNode as w, createVNode as v, unref as o, Fragment as T, renderSlot as ee, withCtx as V, normalizeClass as te, vShow as $, createElementVNode as le, normalizeProps as ae, guardReactiveProps as oe, toDisplayString as P, createTextVNode as H, nextTick as ne } from "vue";
|
|
2
2
|
import { e as c } from "../event-bus/index.es.js";
|
|
3
3
|
import { u as se } from "../plugins/WangsVue.es.js";
|
|
4
4
|
import { m as ie } from "../utils/mergePropsWithDefaults.util.es.js";
|
|
5
|
-
import { s as
|
|
5
|
+
import { s as ue } from "../vendor/primevue/dropdown/dropdown.esm.es.js";
|
|
6
6
|
import { _ as A } from "../button/index.es.js";
|
|
7
|
-
import { _ as
|
|
7
|
+
import { _ as re } from "../icon/index.es.js";
|
|
8
8
|
import { _ as ce } from "../menu/index.es.js";
|
|
9
9
|
import { _ as de } from "../menuitem/index.es.js";
|
|
10
10
|
const pe = (D, N) => {
|
|
@@ -58,7 +58,7 @@ const pe = (D, N) => {
|
|
|
58
58
|
var t, s;
|
|
59
59
|
if (e.useAdditionSlot) {
|
|
60
60
|
n.value = e, await ne();
|
|
61
|
-
const
|
|
61
|
+
const r = (t = _.value) == null ? void 0 : t.children[1], a = r == null ? void 0 : r.querySelector(
|
|
62
62
|
"input"
|
|
63
63
|
);
|
|
64
64
|
a && (a == null || a.click(), a == null || a.focus());
|
|
@@ -84,22 +84,23 @@ const pe = (D, N) => {
|
|
|
84
84
|
(e) => m.value = e ?? 0,
|
|
85
85
|
{ immediate: !0 }
|
|
86
86
|
), (e, t) => {
|
|
87
|
-
var s,
|
|
88
|
-
return y((
|
|
87
|
+
var s, r, a, U, W, q;
|
|
88
|
+
return y((u(), h("div", f(e.$preset.buttonbulkaction.root, {
|
|
89
89
|
ref_key: "wrapper",
|
|
90
90
|
ref: _
|
|
91
91
|
}), [
|
|
92
|
-
o(p).selectMenuType === "overlay-panel" && ((s = i.value) != null && s.length) ? (
|
|
92
|
+
o(p).selectMenuType === "overlay-panel" && ((s = i.value) != null && s.length) ? (u(), E(ce, {
|
|
93
93
|
key: 0,
|
|
94
94
|
ref_key: "menu",
|
|
95
95
|
ref: S,
|
|
96
96
|
model: e.options,
|
|
97
97
|
popup: ""
|
|
98
98
|
}, null, 8, ["model"])) : w("", !0),
|
|
99
|
-
o(p).selectMenuType === "dropdown" ? (
|
|
100
|
-
(
|
|
99
|
+
o(p).selectMenuType === "dropdown" ? (u(), h(T, { key: 1 }, [
|
|
100
|
+
(r = e.selectedData) != null && r.length ? (u(), E(o(ue), {
|
|
101
101
|
key: 0,
|
|
102
102
|
disabled: l.disabled || M.value || !((a = e.selectedData) != null && a.length),
|
|
103
|
+
"model-value": n.value,
|
|
103
104
|
options: o(pe)(
|
|
104
105
|
e.options,
|
|
105
106
|
e.$wangsvue.config.locale.components.Menu.noOptionLabel
|
|
@@ -111,7 +112,7 @@ const pe = (D, N) => {
|
|
|
111
112
|
placeholder: "Bulk Action"
|
|
112
113
|
}, {
|
|
113
114
|
dropdownicon: V(({ class: b }) => [
|
|
114
|
-
v(
|
|
115
|
+
v(re, {
|
|
115
116
|
class: te([b]),
|
|
116
117
|
icon: "arrow-down"
|
|
117
118
|
}, null, 8, ["class"])
|
|
@@ -127,7 +128,7 @@ const pe = (D, N) => {
|
|
|
127
128
|
}, null, 8, ["item", "router-props"])
|
|
128
129
|
]),
|
|
129
130
|
_: 1
|
|
130
|
-
}, 8, ["disabled", "options", "pt"])) : w("", !0),
|
|
131
|
+
}, 8, ["disabled", "model-value", "options", "pt"])) : w("", !0),
|
|
131
132
|
ee(e.$slots, "addition", { selectedOption: n.value }),
|
|
132
133
|
y(v(A, f({ onClick: X }, e.$preset.buttonbulkaction.applybutton, { label: "Apply" }), null, 16), [
|
|
133
134
|
[$, (U = n.value) == null ? void 0 : U.useAdditionSlot]
|
|
@@ -147,9 +148,9 @@ const pe = (D, N) => {
|
|
|
147
148
|
{ text: "" }
|
|
148
149
|
), {
|
|
149
150
|
default: V(() => [
|
|
150
|
-
C.value ? (
|
|
151
|
+
C.value ? (u(), h(T, { key: 1 }, [
|
|
151
152
|
H(P(o(d).allRecordSelected.replace("{naming}", o(p).naming)), 1)
|
|
152
|
-
], 64)) : (
|
|
153
|
+
], 64)) : (u(), h(T, { key: 0 }, [
|
|
153
154
|
H(P(o(d).selectAllRecords.replace(
|
|
154
155
|
"{totalRecords}",
|
|
155
156
|
m.value.toString()
|
|
@@ -160,7 +161,7 @@ const pe = (D, N) => {
|
|
|
160
161
|
}, 16), [
|
|
161
162
|
[$, j.value]
|
|
162
163
|
]),
|
|
163
|
-
o(p).selectMenuType === "overlay-panel" ? (
|
|
164
|
+
o(p).selectMenuType === "overlay-panel" ? (u(), E(A, f({
|
|
164
165
|
key: 2,
|
|
165
166
|
onClick: K
|
|
166
167
|
}, e.$preset.buttonbulkaction.bulkactiontoggle, {
|
package/datatable/index.d.ts
CHANGED
|
@@ -245,8 +245,38 @@ export type ColumnPreset =
|
|
|
245
245
|
| ColumnMultiRowPreset
|
|
246
246
|
| ColumnCheckboxPreset;
|
|
247
247
|
|
|
248
|
+
export interface CombinedHeaders {
|
|
249
|
+
parent: TableParentHeaders[];
|
|
250
|
+
child: TreeTableColumns[];
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export interface TableParentHeaders
|
|
254
|
+
extends Pick<
|
|
255
|
+
TableColumn,
|
|
256
|
+
'header' | 'info' | 'infoSeverity' | 'headerClass'
|
|
257
|
+
> {
|
|
258
|
+
/**
|
|
259
|
+
* Field is used as the header's key
|
|
260
|
+
*/
|
|
261
|
+
field: string;
|
|
262
|
+
/**
|
|
263
|
+
* Note: colspan is calculated automatically
|
|
264
|
+
* @ignore
|
|
265
|
+
*/
|
|
266
|
+
colspan?: number;
|
|
267
|
+
/**
|
|
268
|
+
* Note: rowspan is calculated automatically
|
|
269
|
+
* @ignore
|
|
270
|
+
*/
|
|
271
|
+
rowspan?: number;
|
|
272
|
+
}
|
|
273
|
+
|
|
248
274
|
export interface TableColumn {
|
|
249
275
|
header?: string;
|
|
276
|
+
/**
|
|
277
|
+
* The parent header (the header placed above this column)
|
|
278
|
+
*/
|
|
279
|
+
parentHeader?: string;
|
|
250
280
|
field: string;
|
|
251
281
|
fieldType?: 'string' | 'number' | 'boolean' | 'array';
|
|
252
282
|
info?: string;
|
|
@@ -500,6 +530,13 @@ export interface BaseDataTableProps {
|
|
|
500
530
|
* @optional
|
|
501
531
|
*/
|
|
502
532
|
tableTitle?: string;
|
|
533
|
+
/**
|
|
534
|
+
* The headers placed above certain child headers. If there are
|
|
535
|
+
* multiple child headers with the same parent header, the parent
|
|
536
|
+
* will have its colspan extended. The parent header will be shown
|
|
537
|
+
* when at least one of its child headers is visible.
|
|
538
|
+
*/
|
|
539
|
+
parentHeaders?: TableParentHeaders[];
|
|
503
540
|
/**
|
|
504
541
|
* An array of table columns to display.
|
|
505
542
|
*/
|
|
@@ -666,6 +703,10 @@ export type BaseDataTableEmits = {
|
|
|
666
703
|
* Emits when option menu button clicked.
|
|
667
704
|
*/
|
|
668
705
|
'toggleOption': [data: Data];
|
|
706
|
+
/**
|
|
707
|
+
* Emits when an item is double clicked.
|
|
708
|
+
*/
|
|
709
|
+
'doubleClick': [data: Data];
|
|
669
710
|
/**
|
|
670
711
|
* @deprecated use 'v-model:selected-data' instead.
|
|
671
712
|
*/
|