@web-utils/form-ui 1.0.0-beta5 → 1.0.0-beta51
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/api/index.d.ts +60 -0
- package/api/index.mjs +42 -0
- package/awesome-button/index.d.ts +60 -0
- package/awesome-button/index.mjs +49 -0
- package/base.css +1 -1
- package/chunks/6yfBZFOB.mjs +56 -0
- package/chunks/B1IPSTA6.mjs +198 -0
- package/chunks/B9gA65rt2.mjs +38 -0
- package/chunks/BBERmTup.mjs +83 -0
- package/chunks/BG8z3V9d2.mjs +643 -0
- package/chunks/BQk3-Ppb2.mjs +146 -0
- package/chunks/BQyL45PF2.mjs +207 -0
- package/chunks/BWh6u1O0.mjs +660 -0
- package/chunks/BbSPWDDZ.mjs +100 -0
- package/chunks/BfxDxIg0.mjs +106 -0
- package/chunks/BqWvBF14.mjs +35 -0
- package/chunks/BsZgAJX_2.mjs +81 -0
- package/chunks/BtcjAHE6.mjs +317 -0
- package/chunks/Bwbtu2cp.mjs +194 -0
- package/chunks/ByHz4mmh.mjs +87 -0
- package/chunks/C2zgFLYO.mjs +185 -0
- package/chunks/C7G-cAoI.mjs +1361 -0
- package/chunks/CAd1zK9Q.mjs +25 -0
- package/chunks/CJdkjadi.mjs +17 -0
- package/chunks/CXsoKP22.mjs +86 -0
- package/chunks/CabldOLo.mjs +157 -0
- package/chunks/CkOD-_VV.mjs +8 -0
- package/chunks/CqVd8D222.mjs +89 -0
- package/chunks/CuAoMR3n.mjs +105 -0
- package/chunks/DA7oGHSX.mjs +141 -0
- package/chunks/DKwp6AMl.mjs +168 -0
- package/chunks/DOP3aBxf.mjs +93 -0
- package/chunks/DOZRzqlo.mjs +37 -0
- package/chunks/D_Fs3bkZ.mjs +57 -0
- package/chunks/D_qiRmiE.mjs +230 -0
- package/chunks/DcTVYqeJ.mjs +113 -0
- package/chunks/Dt3lfDnL.mjs +166 -0
- package/chunks/GI8krYU82.mjs +478 -0
- package/chunks/V2p-PCpL.mjs +176 -0
- package/chunks/YFiU0ngn.mjs +622 -0
- package/chunks/bFbPPcdq.mjs +25 -0
- package/chunks/eae6huQB.mjs +25 -0
- package/chunks/gCeDFHo1.mjs +32 -0
- package/chunks/gLPy4Sus.mjs +164 -0
- package/chunks/hlha6Bhc.mjs +107 -0
- package/chunks/pIzhYsBe.mjs +93 -0
- package/chunks/wDS9KBFw.mjs +67 -0
- package/chunks/wXeqV-_7.mjs +89 -0
- package/confirm-button/index.d.ts +122 -0
- package/confirm-button/index.mjs +35 -0
- package/confirmable/index.d.ts +93 -0
- package/confirmable/index.mjs +8 -0
- package/constants/index.d.ts +54 -0
- package/constants/index.mjs +4 -0
- package/dict-render/index.d.ts +28 -0
- package/dict-render/index.mjs +2 -0
- package/editable-tree/index.d.ts +254 -0
- package/editable-tree/index.mjs +2 -0
- package/editable-tree/style.css +1 -0
- package/element-dialog/index.d.ts +337 -16
- package/element-dialog/index.mjs +2 -91
- package/element-resize-observer/index.d.ts +8 -0
- package/element-resize-observer/index.mjs +40 -0
- package/element-resize-observer/style.css +1 -0
- package/empty-view/index.d.ts +2 -2
- package/empty-view/index.mjs +1 -1
- package/flex-scroll-area/index.d.ts +1 -1
- package/flex-scroll-area/index.mjs +1 -1
- package/form-advice/index.mjs +13 -12
- package/form-button/index.d.ts +123 -0
- package/form-button/index.mjs +36 -0
- package/form-card/index.d.ts +14 -0
- package/form-card/index.mjs +18 -0
- package/form-cascader/index.d.ts +472 -0
- package/form-cascader/index.mjs +2 -0
- package/form-checkbox/index.d.ts +236 -16
- package/form-checkbox/index.mjs +1 -1
- package/form-checkbox-group/index.d.ts +364 -0
- package/form-checkbox-group/index.mjs +2 -0
- package/form-checkbox-group/style.css +1 -0
- package/form-date-picker/index.d.ts +390 -19
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.d.ts +87 -20
- package/form-holder/index.mjs +1 -1
- package/form-holder/style.css +1 -1
- package/form-image/index.d.ts +145 -13
- package/form-image/index.mjs +1 -1
- package/form-input/index.d.ts +301 -20
- package/form-input/index.mjs +1 -1
- package/form-input/style.css +1 -0
- package/form-input-cron-expression/index.d.ts +217 -0
- package/form-input-cron-expression/index.mjs +2 -0
- package/form-input-cron-expression/style.css +1 -0
- package/form-input-email/index.d.ts +307 -16
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.d.ts +307 -16
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.d.ts +246 -18
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.d.ts +307 -16
- package/form-input-phone-number/index.mjs +1 -1
- package/form-input-tag/index.d.ts +263 -1
- package/form-input-tag/index.mjs +1 -3
- package/form-input-time/index.d.ts +434 -1
- package/form-input-time/index.mjs +1 -3
- package/form-item-config-provider/index.d.ts +22 -0
- package/form-item-config-provider/index.mjs +24 -0
- package/form-item-group/index.d.ts +91 -17
- package/form-item-group/index.mjs +2 -78
- package/form-item-group/style.css +1 -1
- package/form-item-x/index.d.ts +141 -11
- package/form-item-x/index.mjs +1 -1
- package/form-item-x/style.css +1 -0
- package/form-radio-group/index.d.ts +303 -16
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.d.ts +254 -14
- package/form-rate/index.mjs +1 -1
- package/form-red-table/index.mjs +27 -26
- package/form-row/index.d.ts +2 -2
- package/form-row/index.mjs +1 -1
- package/form-select/index.d.ts +537 -18
- package/form-select/index.mjs +1 -1
- package/form-slider/index.d.ts +283 -16
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.d.ts +272 -14
- package/form-switch/index.mjs +1 -1
- package/form-table/index.d.ts +269 -0
- package/form-table/index.mjs +2 -0
- package/form-table-plus/index.d.ts +266 -0
- package/form-table-plus/index.mjs +2 -0
- package/form-text/index.d.ts +165 -13
- package/form-text/index.mjs +1 -1
- package/form-textarea/index.d.ts +351 -0
- package/form-textarea/index.mjs +2 -0
- package/form-time-select/index.d.ts +319 -0
- package/form-time-select/index.mjs +2 -0
- package/form-view/index.mjs +1 -1
- package/helper/dictionary.d.ts +15 -0
- package/helper/dictionary.mjs +97 -0
- package/hook/useDictionary.d.ts +60 -0
- package/hook/useDictionary.mjs +15 -0
- package/hook/useVisibilityChange.d.ts +4 -0
- package/hook/useVisibilityChange.mjs +14 -0
- package/iframe-window/index.d.ts +9 -0
- package/iframe-window/index.mjs +37 -0
- package/iframe-window/style.css +1 -0
- package/index.css +2 -0
- package/index.d.ts +57 -36
- package/index.mjs +59 -61
- package/package.json +10 -5
- package/pageable-table/index.d.ts +400 -0
- package/pageable-table/index.mjs +2 -0
- package/pageable-table/style.css +1 -0
- package/resolver/index.mjs +29 -0
- package/sub-table/index.d.ts +100 -0
- package/sub-table/index.mjs +537 -0
- package/sub-table/style.css +1 -0
- package/sub-table-plus/index.d.ts +100 -0
- package/sub-table-plus/index.mjs +2 -0
- package/sub-table-plus/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 +95 -0
- package/table-column-def/index.mjs +11 -0
- package/table-view/index.d.ts +341 -1
- package/table-view/index.mjs +457 -6
- package/table-view/style.css +1 -0
- package/toolbar/index.d.ts +128 -1
- package/toolbar/index.mjs +1 -8
- package/toolbar/style.css +1 -0
- package/toolbar-button/index.d.ts +188 -1
- package/toolbar-button/index.mjs +1 -8
- package/vue-cron/index.d.ts +191 -0
- package/vue-cron/index.mjs +2 -0
- package/vue-cron/style.css +1 -0
- package/web-types.json +1 -1
- package/x-input-tag/index.d.ts +2 -0
- package/x-input-tag/index.mjs +228 -0
- package/x-input-tag/style.css +1 -0
- package/year-calendar/index.d.ts +99 -0
- package/year-calendar/index.mjs +2 -0
- package/year-calendar/style.css +1 -0
- package/chunks/B4M_TFeR.mjs +0 -152
- package/chunks/B5BIQCcK.mjs +0 -149
- package/chunks/BHNKrW1j.mjs +0 -61
- package/chunks/BO9jWhBl.mjs +0 -46
- package/chunks/BZ8aOa78.mjs +0 -35
- package/chunks/Bsz7y4Xp.mjs +0 -73
- package/chunks/Bxj372sF.mjs +0 -53
- package/chunks/C33EmJN8.mjs +0 -32
- package/chunks/C6Li3-l7.mjs +0 -28
- package/chunks/CBcdalMX.mjs +0 -35
- package/chunks/CdRsyF0n.mjs +0 -43
- package/chunks/ClNahmiU.mjs +0 -23
- package/chunks/CstztYMu.mjs +0 -28
- package/chunks/DC9b53M6.mjs +0 -32
- package/chunks/DDVAgRED.mjs +0 -36
- package/chunks/DpJQABVD.mjs +0 -91
- package/chunks/ZsLNWI9x.mjs +0 -46
- package/chunks/jn_iQrVZ.mjs +0 -28
- package/constants.d.ts +0 -1
- package/constants.mjs +0 -4
- package/form-check-box-group/index.d.ts +0 -93
- package/form-check-box-group/index.mjs +0 -2
- package/input/style.css +0 -1
- package/resolver.mjs +0 -79
- /package/{resolver.d.ts → resolver/index.d.ts} +0 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { i as e } from "./DcTVYqeJ.mjs";
|
|
2
|
+
import { i as t, n } from "./D_qiRmiE.mjs";
|
|
3
|
+
import { n as r, t as i } from "./CJdkjadi.mjs";
|
|
4
|
+
import { r as a } from "./CabldOLo.mjs";
|
|
5
|
+
import { n as o } from "./gCeDFHo1.mjs";
|
|
6
|
+
import { n as s, t as c } from "./BG8z3V9d2.mjs";
|
|
7
|
+
import { isArray as l, isString as u, trace as d, warning as f } from "@web-utils/core";
|
|
8
|
+
import { computed as p, createVNode as m, getCurrentInstance as h, mergeProps as g, useModel as _, useTemplateRef as v } from "vue";
|
|
9
|
+
import { useEventBus as y } from "@web-utils/vue/hooks/useEventBus";
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/form/FormTablePlus.vue
|
|
12
|
+
var b = {
|
|
13
|
+
name: "FormTablePlus",
|
|
14
|
+
props: {
|
|
15
|
+
...r,
|
|
16
|
+
...i,
|
|
17
|
+
...s,
|
|
18
|
+
rowDbClick: Function,
|
|
19
|
+
viewId: [String, Array],
|
|
20
|
+
block: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: !0
|
|
23
|
+
},
|
|
24
|
+
formPath: [String, Function]
|
|
25
|
+
},
|
|
26
|
+
emits: { ...n },
|
|
27
|
+
setup(n, { emit: r, slots: i, attrs: s, expose: b }) {
|
|
28
|
+
let x = _(n, "modelValue"), S = v("table"), C = [];
|
|
29
|
+
n.viewId && C.push(n.viewId);
|
|
30
|
+
let w = h();
|
|
31
|
+
C.includes(w.parent.proxy.$options.name) || C.push(w.parent.proxy.$options.name);
|
|
32
|
+
let T = () => {
|
|
33
|
+
var e;
|
|
34
|
+
return (e = S.value.table) == null ? void 0 : e.reloadTable();
|
|
35
|
+
}, E = async () => {
|
|
36
|
+
var e;
|
|
37
|
+
return await ((e = S.value.table) == null ? void 0 : e.refreshTable());
|
|
38
|
+
};
|
|
39
|
+
y("reloadTableView", (e) => {
|
|
40
|
+
if (C) if (u(e) || l(e)) {
|
|
41
|
+
let t = e;
|
|
42
|
+
u(t) && (t = t.split(",")), C.some((e) => t.includes(e)) && (d.call(w.parent.proxy || {}, "reloadTableView"), T());
|
|
43
|
+
} else f.call(w.parent.proxy || {}, "`viewId`的类型必须是字符串或数组");
|
|
44
|
+
});
|
|
45
|
+
let D = (...t) => {
|
|
46
|
+
n.rowDbClick ? n.rowDbClick(...t) : w.proxy.$router.push(e(n.formPath, t[0]));
|
|
47
|
+
}, O = () => {
|
|
48
|
+
w.proxy.$router.push(e(n.formPath));
|
|
49
|
+
}, { render: k, placeholder: A, disabled: j, listeners: M, inputProps: N } = t(n, {
|
|
50
|
+
rules: p(() => [n.fetchApi ? {
|
|
51
|
+
required: !0,
|
|
52
|
+
validator: a
|
|
53
|
+
} : { required: !0 }]),
|
|
54
|
+
emit: r,
|
|
55
|
+
slots: i,
|
|
56
|
+
attrs: s,
|
|
57
|
+
predicate: o
|
|
58
|
+
});
|
|
59
|
+
return b({
|
|
60
|
+
reloadTable: T,
|
|
61
|
+
refreshTable: E
|
|
62
|
+
}), () => {
|
|
63
|
+
var e;
|
|
64
|
+
let t = {};
|
|
65
|
+
for (let r = 0; r < (((e = n.columns) == null ? void 0 : e.length) ?? 0); r++) {
|
|
66
|
+
let e = n.columns[r];
|
|
67
|
+
t[e.prop] = ({ row: t, column: n, index: r, prop: a, required: o }) => {
|
|
68
|
+
var s;
|
|
69
|
+
return (s = i[e.prop]) == null ? void 0 : s.call(i, {
|
|
70
|
+
row: t,
|
|
71
|
+
column: n,
|
|
72
|
+
index: r,
|
|
73
|
+
prop: a,
|
|
74
|
+
required: o
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return k({ vNodes: m(c, g({ ref: "table" }, M.value, N.value, {
|
|
79
|
+
prop: n.prop,
|
|
80
|
+
disabled: j.value,
|
|
81
|
+
"on-row-db-click": D,
|
|
82
|
+
modelValue: x.value,
|
|
83
|
+
"onUpdate:modelValue": (e) => x.value = e,
|
|
84
|
+
placeholder: A.value,
|
|
85
|
+
onAddRow: O
|
|
86
|
+
}), {
|
|
87
|
+
...t,
|
|
88
|
+
columns: ({ columns: e }) => {
|
|
89
|
+
var t;
|
|
90
|
+
return (t = i.columns) == null ? void 0 : t.call(i, { columns: e });
|
|
91
|
+
},
|
|
92
|
+
handle: ({ add: e, remove: t }) => {
|
|
93
|
+
var n;
|
|
94
|
+
return (n = i.handle) == null ? void 0 : n.call(i, {
|
|
95
|
+
add: e,
|
|
96
|
+
remove: t
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
tag: ({ column: e, row: t, $index: n }) => {
|
|
100
|
+
var r;
|
|
101
|
+
return (r = i.tag) == null ? void 0 : r.call(i, {
|
|
102
|
+
column: e,
|
|
103
|
+
row: t,
|
|
104
|
+
index: n
|
|
105
|
+
});
|
|
106
|
+
},
|
|
107
|
+
"handle-column-header": ({ column: e, $index: t }) => {
|
|
108
|
+
var n;
|
|
109
|
+
return (n = i["handle-column-header"]) == null ? void 0 : n.call(i, {
|
|
110
|
+
column: e,
|
|
111
|
+
index: t
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
toolbar: () => {
|
|
115
|
+
var e;
|
|
116
|
+
return (e = i.toolbar) == null ? void 0 : e.call(i);
|
|
117
|
+
},
|
|
118
|
+
"toolbar-left": ({ addRow: e, delRow: t, refresh: n }) => {
|
|
119
|
+
var r;
|
|
120
|
+
return (r = i["toolbar-left"]) == null ? void 0 : r.call(i, {
|
|
121
|
+
addRow: e,
|
|
122
|
+
delRow: t,
|
|
123
|
+
refresh: n
|
|
124
|
+
});
|
|
125
|
+
},
|
|
126
|
+
"toolbar-left-append": ({ addRow: e, delRow: t, refresh: n }) => {
|
|
127
|
+
var r;
|
|
128
|
+
return (r = i["toolbar-left-append"]) == null ? void 0 : r.call(i, {
|
|
129
|
+
addRow: e,
|
|
130
|
+
delRow: t,
|
|
131
|
+
refresh: n
|
|
132
|
+
});
|
|
133
|
+
},
|
|
134
|
+
"toolbar-right": ({ selectedRows: e, removeSelectedRows: t }) => {
|
|
135
|
+
var n;
|
|
136
|
+
return (n = i["toolbar-right"]) == null ? void 0 : n.call(i, {
|
|
137
|
+
selectedRows: e,
|
|
138
|
+
removeSelectedRows: t
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}) });
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
//#endregion
|
|
146
|
+
export { b as t };
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { s as e } from "./DcTVYqeJ.mjs";
|
|
2
|
+
import { goBack as t, hasAuthority as n } from "../api/index.mjs";
|
|
3
|
+
import { toolbarContextKey as r } from "../constants/index.mjs";
|
|
4
|
+
import { t as i } from "./Dt3lfDnL.mjs";
|
|
5
|
+
import { NOOP as a, capitalize as o } from "@web-utils/core";
|
|
6
|
+
import { Comment as s, createVNode as c } from "vue";
|
|
7
|
+
//#region src/components/toolbar/Toolbar.vue?vue&type=script&lang.jsx
|
|
8
|
+
var l = {
|
|
9
|
+
back: {
|
|
10
|
+
label: "返回",
|
|
11
|
+
type: "primary",
|
|
12
|
+
icon: "el-icon-arrow-left"
|
|
13
|
+
},
|
|
14
|
+
cancel: {
|
|
15
|
+
label: "取消",
|
|
16
|
+
icon: "el-icon-close"
|
|
17
|
+
},
|
|
18
|
+
create: {
|
|
19
|
+
label: "新增",
|
|
20
|
+
type: "primary",
|
|
21
|
+
icon: "el-icon-plus"
|
|
22
|
+
},
|
|
23
|
+
save: {
|
|
24
|
+
label: "保存",
|
|
25
|
+
type: "primary",
|
|
26
|
+
icon: "el-icon-takeaway-box",
|
|
27
|
+
loadable: !0
|
|
28
|
+
},
|
|
29
|
+
withdraw: {
|
|
30
|
+
label: "提取",
|
|
31
|
+
type: "primary",
|
|
32
|
+
icon: "el-icon-refresh-left"
|
|
33
|
+
},
|
|
34
|
+
edit: {
|
|
35
|
+
label: "编辑",
|
|
36
|
+
type: "primary",
|
|
37
|
+
icon: "el-icon-edit-outline"
|
|
38
|
+
},
|
|
39
|
+
submit: {
|
|
40
|
+
label: "审批办理",
|
|
41
|
+
type: "primary",
|
|
42
|
+
icon: "el-icon-s-promotion"
|
|
43
|
+
},
|
|
44
|
+
publish: {
|
|
45
|
+
label: "发布",
|
|
46
|
+
type: "primary",
|
|
47
|
+
icon: "el-icon-s-promotion"
|
|
48
|
+
},
|
|
49
|
+
agree: {
|
|
50
|
+
label: "同意",
|
|
51
|
+
type: "primary",
|
|
52
|
+
icon: "el-icon-check"
|
|
53
|
+
},
|
|
54
|
+
disagree: {
|
|
55
|
+
label: "不同意",
|
|
56
|
+
type: "primary",
|
|
57
|
+
icon: "el-icon-close"
|
|
58
|
+
},
|
|
59
|
+
reject: {
|
|
60
|
+
label: "退回",
|
|
61
|
+
type: "primary",
|
|
62
|
+
icon: "el-icon-s-release"
|
|
63
|
+
},
|
|
64
|
+
finish: {
|
|
65
|
+
label: "完成",
|
|
66
|
+
type: "primary",
|
|
67
|
+
icon: "el-icon-circle-check"
|
|
68
|
+
},
|
|
69
|
+
enable: {
|
|
70
|
+
label: "启用",
|
|
71
|
+
type: "primary",
|
|
72
|
+
icon: "el-icon-circle-check"
|
|
73
|
+
},
|
|
74
|
+
exp: {
|
|
75
|
+
label: "导出",
|
|
76
|
+
type: "primary",
|
|
77
|
+
icon: "el-icon-download"
|
|
78
|
+
},
|
|
79
|
+
imp: {
|
|
80
|
+
label: "导入",
|
|
81
|
+
type: "primary",
|
|
82
|
+
icon: "el-icon-upload"
|
|
83
|
+
},
|
|
84
|
+
del: {
|
|
85
|
+
label: "删除",
|
|
86
|
+
type: "primary",
|
|
87
|
+
icon: "el-icon-delete"
|
|
88
|
+
},
|
|
89
|
+
print: {
|
|
90
|
+
label: "打印",
|
|
91
|
+
type: "primary",
|
|
92
|
+
icon: "el-icon-printer"
|
|
93
|
+
},
|
|
94
|
+
disabled: {
|
|
95
|
+
label: "禁用",
|
|
96
|
+
type: "primary",
|
|
97
|
+
icon: "el-icon-remove-outline"
|
|
98
|
+
},
|
|
99
|
+
reload: {
|
|
100
|
+
label: "刷新",
|
|
101
|
+
icon: "el-icon-refresh",
|
|
102
|
+
separateLine: !1,
|
|
103
|
+
circle: !0
|
|
104
|
+
},
|
|
105
|
+
settings: {
|
|
106
|
+
label: "设置",
|
|
107
|
+
icon: "el-icon-s-operation",
|
|
108
|
+
separateLine: !1,
|
|
109
|
+
circle: !0
|
|
110
|
+
},
|
|
111
|
+
search: {
|
|
112
|
+
label: "搜索",
|
|
113
|
+
icon: "el-icon-search",
|
|
114
|
+
separateLine: !1,
|
|
115
|
+
circle: !0
|
|
116
|
+
}
|
|
117
|
+
}, u = {
|
|
118
|
+
name: "Toolbar",
|
|
119
|
+
provide() {
|
|
120
|
+
return { [r]: this };
|
|
121
|
+
},
|
|
122
|
+
props: {
|
|
123
|
+
searchable: Boolean,
|
|
124
|
+
refreshable: Boolean,
|
|
125
|
+
buttons: {
|
|
126
|
+
type: Array,
|
|
127
|
+
default: () => ["back"]
|
|
128
|
+
},
|
|
129
|
+
back: Function,
|
|
130
|
+
cancel: Function,
|
|
131
|
+
emitter: {
|
|
132
|
+
type: String,
|
|
133
|
+
default: "self"
|
|
134
|
+
},
|
|
135
|
+
footer: Boolean,
|
|
136
|
+
label: Object
|
|
137
|
+
},
|
|
138
|
+
computed: {},
|
|
139
|
+
methods: {
|
|
140
|
+
goBack() {
|
|
141
|
+
t(this.$route.path);
|
|
142
|
+
},
|
|
143
|
+
createButton(t, { label: n, icon: r, type: s, separateLine: l = !0, loadable: u, circle: d, onClick: f, title: p }) {
|
|
144
|
+
var m;
|
|
145
|
+
let h, g = ((m = this.label) == null ? void 0 : m[t]) || n;
|
|
146
|
+
return h = f || (["back", "cancel"].includes(t) ? this.goBack : (n) => {
|
|
147
|
+
(e(this.$attrs, { withOn: !0 })[`on${o(t)}`] || a)(n);
|
|
148
|
+
}), c(i, {
|
|
149
|
+
"separate-line": l,
|
|
150
|
+
icon: r,
|
|
151
|
+
title: p,
|
|
152
|
+
label: g,
|
|
153
|
+
loadable: u,
|
|
154
|
+
circle: d,
|
|
155
|
+
footer: this.footer,
|
|
156
|
+
type: s,
|
|
157
|
+
onClick: h
|
|
158
|
+
}, null);
|
|
159
|
+
},
|
|
160
|
+
getLeftButtons() {
|
|
161
|
+
var e, t, r;
|
|
162
|
+
let { createButton: i } = this;
|
|
163
|
+
return (r = (((e = (t = this.$slots)["toolbar-left"]) == null ? void 0 : e.call(t)) || this.buttons.flatMap((e) => {
|
|
164
|
+
let t = l[e];
|
|
165
|
+
if (t) {
|
|
166
|
+
var n, r;
|
|
167
|
+
return ((n = (r = this.$slots)[e]) == null ? void 0 : n.call(r)) || i(e, t);
|
|
168
|
+
} else if (e === "slot") {
|
|
169
|
+
var a, o;
|
|
170
|
+
let e = ((a = (o = this.$slots).default) == null ? void 0 : a.call(o, {
|
|
171
|
+
buttons: this.buttons,
|
|
172
|
+
footer: this.footer
|
|
173
|
+
})) ?? null;
|
|
174
|
+
if (e && e.length === 1) {
|
|
175
|
+
var c;
|
|
176
|
+
return e == null || (c = e[0]) == null || (c = c.children) == null ? void 0 : c.filter((e) => e.type !== s);
|
|
177
|
+
}
|
|
178
|
+
return e || [];
|
|
179
|
+
} else return null;
|
|
180
|
+
})).filter((e) => e)) == null ? void 0 : r.filter((e) => e.props.privilege ? n(e.props.privilege) : !0);
|
|
181
|
+
},
|
|
182
|
+
getRightButtons() {
|
|
183
|
+
var e, t, n, r;
|
|
184
|
+
let i = (e = (t = this.$slots)["toolbar-right"]) == null ? void 0 : e.call(t), a = [
|
|
185
|
+
...((n = (r = this.$slots)["toolbar-right-button"]) == null ? void 0 : n.call(r)) || [],
|
|
186
|
+
this.getRefreshButton(),
|
|
187
|
+
this.getSettingsButton(),
|
|
188
|
+
this.getSearchButton()
|
|
189
|
+
];
|
|
190
|
+
return i || a;
|
|
191
|
+
},
|
|
192
|
+
getSearchButton() {
|
|
193
|
+
return this.searchable ? this.createButton("search", l.search) : null;
|
|
194
|
+
},
|
|
195
|
+
getRefreshButton() {
|
|
196
|
+
return this.refreshable ? this.createButton("reload", l.reload) : null;
|
|
197
|
+
},
|
|
198
|
+
getSettingsButton() {
|
|
199
|
+
return this.refreshable ? this.createButton("settings", l.settings) : null;
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
render() {
|
|
203
|
+
return this.footer ? c("div", { class: "footer-bar" }, [this.getLeftButtons()]) : c("div", { class: "toolbar" }, [c("div", { class: "toolbar-left" }, [this.getLeftButtons()]), c("div", { class: "toolbar-right" }, [this.getRightButtons()])]);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
//#endregion
|
|
207
|
+
export { u as t };
|