@web-utils/form-ui 1.0.0-beta27 → 1.0.0-beta28
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/chunks/{CE2akkTQ.mjs → B99alfW4.mjs} +2 -2
- package/chunks/BQ77eAb3.mjs +71 -0
- package/chunks/BV_N8p9t.mjs +83 -0
- package/chunks/BV_P9a8o.mjs +100 -0
- package/chunks/Bd1O2CP5.mjs +637 -0
- package/chunks/{DzMQIy5h.mjs → BgDYHgyH.mjs} +1 -1
- package/chunks/{BJP-5-0v.mjs → BmZieBZW.mjs} +2 -2
- package/chunks/{ADvOhGAW.mjs → Br4i8stg.mjs} +1 -1
- package/chunks/{ltggbLWM.mjs → C3a15Ful.mjs} +2 -2
- package/chunks/{BAE_vglg.mjs → C4bM8miy.mjs} +2 -2
- package/chunks/{D-ffcm89.mjs → Cby3mvvZ.mjs} +2 -2
- package/chunks/{tRXOz6_G.mjs → Cc3EJjbV.mjs} +2 -2
- package/chunks/{lVzx0-GH.mjs → Cgl-hCE5.mjs} +2 -2
- package/chunks/{DJTwM7o_.mjs → Ci1XxmdE.mjs} +3 -3
- package/chunks/{mjEH6tHn.mjs → CsfgUCe9.mjs} +1 -1
- package/chunks/{o5196FMX.mjs → CugRu2Ka.mjs} +3 -3
- package/chunks/{DlFC9IZx.mjs → Cy-4nmyC.mjs} +2 -2
- package/chunks/{qRpPD8iK.mjs → D1EOkWJ7.mjs} +2 -2
- package/chunks/{DGYsSu6t.mjs → DO8dVGef.mjs} +2 -2
- package/chunks/{BhmGnR4F.mjs → DazglPJZ.mjs} +1 -1
- package/chunks/{CCc9Zjms.mjs → Dt6gY213.mjs} +2 -2
- package/chunks/{3QpBKdDM.mjs → DtAYXPvz.mjs} +2 -2
- package/chunks/{Cme51jl3.mjs → JhyiXnbd.mjs} +2 -2
- package/chunks/{CotIhBXj.mjs → S64sNmuR.mjs} +2 -2
- package/chunks/{Dn79Y_Rb.mjs → bnRb5PUB.mjs} +2 -2
- package/chunks/{CnP5qx9A.mjs → q1SlJP1y.mjs} +2 -2
- package/dict-render/index.d.ts +28 -0
- package/element-dialog/index.d.ts +6 -6
- package/element-dialog/index.mjs +1 -1
- package/form-cascader/index.d.ts +2 -2
- package/form-cascader/index.mjs +1 -1
- package/form-check-box-group/index.d.ts +1 -1
- package/form-check-box-group/index.mjs +1 -1
- package/form-checkbox/index.d.ts +1 -1
- package/form-checkbox/index.mjs +1 -1
- package/form-date-picker/index.d.ts +2 -2
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.mjs +1 -1
- package/form-image/index.d.ts +1 -1
- package/form-image/index.mjs +1 -1
- package/form-input/index.d.ts +1 -1
- package/form-input/index.mjs +1 -1
- package/form-input-cron-expression/index.d.ts +1 -1
- package/form-input-cron-expression/index.mjs +1 -1
- package/form-input-email/index.d.ts +1 -1
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.d.ts +1 -1
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.d.ts +1 -1
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.d.ts +1 -1
- package/form-input-phone-number/index.mjs +1 -1
- package/form-item-x/index.d.ts +1 -1
- package/form-item-x/index.mjs +1 -1
- package/form-radio-group/index.d.ts +1 -1
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.d.ts +1 -1
- package/form-rate/index.mjs +1 -1
- package/form-select/index.d.ts +2 -2
- package/form-select/index.mjs +1 -1
- package/form-slider/index.d.ts +2 -2
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.d.ts +1 -1
- package/form-switch/index.mjs +1 -1
- package/form-text/index.d.ts +1 -1
- package/form-text/index.mjs +1 -1
- package/helper/dictionary.mjs +7 -7
- package/hook/useVisibilityChange.d.ts +4 -0
- package/hook/useVisibilityChange.mjs +14 -0
- package/iframe-window/index.mjs +1 -1
- package/index.d.ts +5 -1
- package/index.mjs +32 -28
- package/package.json +2 -1
- package/pageable-table/index.d.ts +436 -0
- package/pageable-table/index.mjs +2 -0
- package/pageable-table/style.css +1 -0
- package/resize-observer/index.d.ts +8 -0
- package/resize-observer/index.mjs +40 -0
- package/resize-observer/style.css +1 -0
- package/table-column/index.d.ts +160 -0
- package/table-column/index.mjs +2 -0
- package/table-column/style.css +1 -0
- package/table-column-def/index.d.ts +85 -0
- package/table-column-def/index.mjs +11 -0
- package/table-column-filter/index.d.ts +11 -0
- package/table-column-filterable/index.d.ts +10 -0
- package/toolbar/index.mjs +1 -1
- package/toolbar-button/index.mjs +1 -1
- package/web-types.json +1 -1
- package/year-calendar/index.mjs +1 -1
- package/chunks/BVLgLg_s.mjs +0 -53
- /package/chunks/{DS8NSFKr.mjs → 4ZuVpQf6.mjs} +0 -0
- /package/chunks/{Bgny2wyC.mjs → dM-icPM8.mjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as e } from "./BQ77eAb3.mjs";
|
|
2
2
|
import { goBack as t, hasAuthority as n } from "../api/index.mjs";
|
|
3
3
|
import { toolbarContextKey as r } from "../constants/index.mjs";
|
|
4
|
-
import { t as i } from "./
|
|
4
|
+
import { t as i } from "./dM-icPM8.mjs";
|
|
5
5
|
import { NOOP as a, capitalize as o } from "@web-utils/core";
|
|
6
6
|
import { Comment as s, createVNode as c } from "vue";
|
|
7
7
|
//#region src/components/toolbar/Toolbar.vue?vue&type=script&lang.jsx
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { capitalize as e, copy as t, isArray as n, uncapitalize as r } from "@web-utils/core";
|
|
2
|
+
import { computed as i } from "vue";
|
|
3
|
+
import { ElMessage as a } from "element-plus";
|
|
4
|
+
//#region src/utils/index.ts
|
|
5
|
+
var o = (t, n, r, i) => {
|
|
6
|
+
let a = {};
|
|
7
|
+
if (n) for (let e in t) n(e) && (a[e] = t[e]);
|
|
8
|
+
return r && r.forEach((t) => {
|
|
9
|
+
a[`on${e(t)}`] = (...e) => i(t, ...e);
|
|
10
|
+
}), a;
|
|
11
|
+
}, s = (e, { emit: t, events: n, predicate: r }) => i(() => o(e, r, n, t)), c = (e, { withOn: t = !1 } = {}) => {
|
|
12
|
+
let n = {};
|
|
13
|
+
for (let i in e) i.startsWith("on") && (t ? n[i] = e[i] : n[r(i.replace(/^on/, ""))] = e[i]);
|
|
14
|
+
return n;
|
|
15
|
+
}, l = (e, t = "id", n = "label") => {
|
|
16
|
+
let r = [];
|
|
17
|
+
function i(e, a) {
|
|
18
|
+
if (!e) return;
|
|
19
|
+
let o = [...a, {
|
|
20
|
+
[t]: e[t],
|
|
21
|
+
[n]: e[n]
|
|
22
|
+
}];
|
|
23
|
+
if (!e.children || e.children.length === 0) {
|
|
24
|
+
r.push(o);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
e.children.forEach((e) => {
|
|
28
|
+
i(e, o);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return e.forEach((e) => i(e, [])), r;
|
|
32
|
+
}, u = (e, t = "id", n = "label") => {
|
|
33
|
+
let r = [];
|
|
34
|
+
return l(e).forEach((e) => {
|
|
35
|
+
let i = [], a = [];
|
|
36
|
+
for (let r = 0; r < e.length; r++) i.push(e[r][t]), a.push(e[r][n]);
|
|
37
|
+
r.push({
|
|
38
|
+
value: i.join("/"),
|
|
39
|
+
label: a.join("/")
|
|
40
|
+
});
|
|
41
|
+
}), r;
|
|
42
|
+
}, d = (e, t = "id", n = "label") => {
|
|
43
|
+
let r = {};
|
|
44
|
+
return l(e).forEach((e) => {
|
|
45
|
+
let i = [], a = [];
|
|
46
|
+
for (let r = 0; r < e.length; r++) i.push(e[r][t]), a.push(e[r][n]);
|
|
47
|
+
r[i.join("/")] = {
|
|
48
|
+
value: i.join("/"),
|
|
49
|
+
label: a.join("/")
|
|
50
|
+
};
|
|
51
|
+
}), r;
|
|
52
|
+
};
|
|
53
|
+
function f(e) {
|
|
54
|
+
t(e, () => a.success({
|
|
55
|
+
duration: 1e3,
|
|
56
|
+
message: "复制成功!",
|
|
57
|
+
type: "success"
|
|
58
|
+
}), () => a.error({
|
|
59
|
+
duration: 1e3,
|
|
60
|
+
message: "复制失败!",
|
|
61
|
+
type: "error"
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
var p = (e) => {
|
|
65
|
+
let t = [];
|
|
66
|
+
return e && (n(e) ? e.forEach((e) => {
|
|
67
|
+
n(e) ? t.push(...p(e)) : e && t.push(e);
|
|
68
|
+
}) : e && t.push(e)), t;
|
|
69
|
+
};
|
|
70
|
+
//#endregion
|
|
71
|
+
export { d as a, c as i, p as n, u as o, o as r, s, f as t };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
//#region src/components/table/table-column.ts
|
|
2
|
+
var e = {
|
|
3
|
+
type: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: "default"
|
|
6
|
+
},
|
|
7
|
+
index: [Number, Function],
|
|
8
|
+
label: String,
|
|
9
|
+
columnKey: String,
|
|
10
|
+
prop: String,
|
|
11
|
+
width: [String, Number],
|
|
12
|
+
minWidth: [String, Number],
|
|
13
|
+
fixed: [Boolean, String],
|
|
14
|
+
renderHeader: Function,
|
|
15
|
+
sortable: [Boolean, String],
|
|
16
|
+
sortMethod: Function,
|
|
17
|
+
sortBy: [
|
|
18
|
+
Function,
|
|
19
|
+
String,
|
|
20
|
+
Array
|
|
21
|
+
],
|
|
22
|
+
sortOrders: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default: () => [
|
|
25
|
+
"ascending",
|
|
26
|
+
"descending",
|
|
27
|
+
null
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
resizable: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !0
|
|
33
|
+
},
|
|
34
|
+
formatter: Function,
|
|
35
|
+
showOverflowTooltip: {
|
|
36
|
+
type: [Boolean, Object],
|
|
37
|
+
default: !0
|
|
38
|
+
},
|
|
39
|
+
align: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: "left"
|
|
42
|
+
},
|
|
43
|
+
headerAlign: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "left"
|
|
46
|
+
},
|
|
47
|
+
className: String,
|
|
48
|
+
labelClassName: String,
|
|
49
|
+
selectable: Function,
|
|
50
|
+
reserveSelection: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
filters: Array,
|
|
55
|
+
filterPlacement: String,
|
|
56
|
+
filterClassName: String,
|
|
57
|
+
filterMultiple: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: !0
|
|
60
|
+
},
|
|
61
|
+
filterMethod: Function,
|
|
62
|
+
filteredValue: {
|
|
63
|
+
type: Array,
|
|
64
|
+
default: () => []
|
|
65
|
+
},
|
|
66
|
+
tooltipFormatter: Function,
|
|
67
|
+
property: String,
|
|
68
|
+
showTooltipWhenOverflow: Boolean,
|
|
69
|
+
clickable: Boolean,
|
|
70
|
+
cellClick: Function,
|
|
71
|
+
dictType: String,
|
|
72
|
+
options: Array,
|
|
73
|
+
autoUpdate: Boolean,
|
|
74
|
+
treeDict: Boolean,
|
|
75
|
+
idAsValue: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: !0
|
|
78
|
+
},
|
|
79
|
+
labelAsValue: Boolean,
|
|
80
|
+
maxWidth: String
|
|
81
|
+
};
|
|
82
|
+
//#endregion
|
|
83
|
+
export { e as t };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { n as e } from "./BQ77eAb3.mjs";
|
|
2
|
+
import { getDictLabel as t } from "../helper/dictionary.mjs";
|
|
3
|
+
import { tableViewContextKey as n } from "../constants/index.mjs";
|
|
4
|
+
import { t as r } from "./BV_N8p9t.mjs";
|
|
5
|
+
import { computed as i, createVNode as a, inject as o, mergeProps as s, ref as c, watchEffect as l } from "vue";
|
|
6
|
+
import { ElTableColumn as u } from "element-plus/es";
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/components/table/components/DictRender.vue
|
|
9
|
+
var d = {
|
|
10
|
+
name: "DictRender",
|
|
11
|
+
inheritAttrs: !1,
|
|
12
|
+
props: {
|
|
13
|
+
row: Object,
|
|
14
|
+
column: Object,
|
|
15
|
+
dictType: String,
|
|
16
|
+
options: Array,
|
|
17
|
+
treeDict: Boolean,
|
|
18
|
+
idAsValue: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !0
|
|
21
|
+
},
|
|
22
|
+
labelAsValue: Boolean
|
|
23
|
+
},
|
|
24
|
+
setup(e, { attrs: n }) {
|
|
25
|
+
let r = c(null), o = i(() => e.row[e.column.property]);
|
|
26
|
+
return l(async () => {
|
|
27
|
+
if (e.dictType) r.value = await t(e.dictType, o.value, !0, {
|
|
28
|
+
options: !0,
|
|
29
|
+
treeDict: e.treeDict,
|
|
30
|
+
idAsValue: e.idAsValue,
|
|
31
|
+
labelAsValue: e.labelAsValue
|
|
32
|
+
});
|
|
33
|
+
else {
|
|
34
|
+
var n;
|
|
35
|
+
r.value = ((n = e.options) == null || (n = n.find((e) => `${e.modelValue}` == `${e.value}`)) == null ? void 0 : n.label) ?? `${o.value}`;
|
|
36
|
+
}
|
|
37
|
+
}), () => a("span", n, [r.value]);
|
|
38
|
+
}
|
|
39
|
+
}, f = {
|
|
40
|
+
selection: !0,
|
|
41
|
+
"single-selection": !0,
|
|
42
|
+
index: !0,
|
|
43
|
+
expand: !0
|
|
44
|
+
}, p = (e, t, n, r, i) => {
|
|
45
|
+
var a;
|
|
46
|
+
let o = (e == null || (a = e.$parent) == null ? void 0 : a.rowDbClick) || (e == null ? void 0 : e.rowDbClick);
|
|
47
|
+
o == null || o(t, n, r, i);
|
|
48
|
+
}, m = (e) => {
|
|
49
|
+
let t = e.target;
|
|
50
|
+
for (; t && t.tagName.toUpperCase() !== "HTML";) {
|
|
51
|
+
if (t.tagName.toUpperCase() === "TD") return t;
|
|
52
|
+
t = t.parentNode;
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}, h = () => {}, g = (t) => !e(t).length, _ = {
|
|
56
|
+
name: "TableColumn",
|
|
57
|
+
props: { ...r },
|
|
58
|
+
setup(e, { slots: t, attrs: r }) {
|
|
59
|
+
let i = o(n, null);
|
|
60
|
+
return () => {
|
|
61
|
+
let { clickable: n, cellClick: o, ...c } = e, l, _ = f[e.type];
|
|
62
|
+
if (!_) {
|
|
63
|
+
let s = n || r.onClick || o;
|
|
64
|
+
(s || e.dictType || e.options) && (l = (n) => {
|
|
65
|
+
var c;
|
|
66
|
+
let { row: l, column: u } = n, f = s ? (e) => {
|
|
67
|
+
let t = m(e);
|
|
68
|
+
if (r.onClick || o) {
|
|
69
|
+
var n;
|
|
70
|
+
(n = r.onClick) == null || n.call(r, l, u, l, u, t, e), o == null || o(l, u, l, u, t, e);
|
|
71
|
+
} else p(i, l, u, t, e);
|
|
72
|
+
} : h, _ = t == null || (c = t.default) == null ? void 0 : c.call(t, n);
|
|
73
|
+
return g(_) && (_ = null), (e.dictType || e.options) && !_ ? a(d, {
|
|
74
|
+
class: { "is-clickable": s },
|
|
75
|
+
onClick: f,
|
|
76
|
+
row: l,
|
|
77
|
+
column: u,
|
|
78
|
+
dictType: e.dictType,
|
|
79
|
+
treeDict: e.treeDict,
|
|
80
|
+
idAsValue: e.idAsValue,
|
|
81
|
+
labelAsValue: e.labelAsValue,
|
|
82
|
+
options: e.options
|
|
83
|
+
}, null) : s ? a("span", {
|
|
84
|
+
class: "is-clickable",
|
|
85
|
+
onClick: f
|
|
86
|
+
}, [_ || (l == null ? void 0 : l[u == null ? void 0 : u.property])]) : _;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return a(u, s(c, {
|
|
90
|
+
key: r.filterable,
|
|
91
|
+
showOverflowTooltip: _ ? !1 : c.showOverflowTooltip
|
|
92
|
+
}), {
|
|
93
|
+
...t,
|
|
94
|
+
default: l || t.default
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
//#endregion
|
|
100
|
+
export { _ as t };
|