@vtj/ui 0.6.25 → 0.7.0
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/LICENSE +21 -21
- package/dist/index.cjs +7 -0
- package/dist/index.iife.js +7 -0
- package/dist/index.mjs +4165 -0
- package/dist/index.umd.js +7 -0
- package/dist/style.css +1 -0
- package/package.json +23 -21
- package/types/components/action/Action.d.ts +23 -22
- package/types/components/action/Trigger.d.ts +15 -14
- package/types/components/action/hooks.d.ts +7 -6
- package/types/components/action/types.d.ts +14 -10
- package/types/components/action-bar/ActionBar.d.ts +41 -40
- package/types/components/action-bar/types.d.ts +10 -11
- package/types/components/chart/Chart.d.ts +4 -4
- package/types/components/chart/types.d.ts +3 -3
- package/types/components/chart/useChart.d.ts +5 -5
- package/types/components/container/Container.d.ts +7 -7
- package/types/components/container/types.d.ts +3 -3
- package/types/components/data-item/DataItem.d.ts +23 -22
- package/types/components/data-item/types.d.ts +3 -3
- package/types/components/dialog/Dialog.d.ts +9 -9
- package/types/components/dialog/create.d.ts +2 -2
- package/types/components/dialog/hooks.d.ts +5 -5
- package/types/components/dialog/types.d.ts +4 -4
- package/types/components/dialog-form/DialogForm.d.ts +3 -3
- package/types/components/dialog-form/types.d.ts +3 -3
- package/types/components/field/Field.d.ts +17 -4
- package/types/components/field/editors/CheckboxEditor.d.ts +6 -3
- package/types/components/field/editors/RadioEditor.d.ts +6 -3
- package/types/components/field/editors/SelectEditor.d.ts +6 -3
- package/types/components/field/hooks/useEditor.d.ts +3 -3
- package/types/components/field/types.d.ts +16 -4
- package/types/components/form/Form.d.ts +13 -3
- package/types/components/form/types.d.ts +10 -2
- package/types/components/header/Header.d.ts +2 -2
- package/types/components/header/types.d.ts +4 -3
- package/types/components/icon/Icon.d.ts +2 -2
- package/types/components/index.d.ts +2 -2
- package/types/components/list/List.d.ts +109 -0
- package/types/components/list/index.d.ts +3 -0
- package/types/components/list/types.d.ts +58 -0
- package/types/components/mask/Mask.d.ts +23 -22
- package/types/components/mask/components/Avatar.d.ts +2 -2
- package/types/components/mask/components/Brand.d.ts +5 -2
- package/types/components/mask/components/Content.d.ts +3 -3
- package/types/components/mask/components/Menu.d.ts +6 -3
- package/types/components/mask/components/Sidebar.d.ts +2 -2
- package/types/components/mask/components/SwitchBar.d.ts +5 -2
- package/types/components/mask/components/Tabs.d.ts +4 -4
- package/types/components/mask/components/ThemeSwitch.d.ts +2 -2
- package/types/components/mask/components/Toolbar.d.ts +7 -4
- package/types/components/mask/defineTab.d.ts +1 -1
- package/types/components/mask/hooks/useContent.d.ts +2 -2
- package/types/components/mask/hooks/useHome.d.ts +1 -1
- package/types/components/mask/hooks/useMenus.d.ts +3 -3
- package/types/components/mask/hooks/useSidebar.d.ts +1 -2
- package/types/components/mask/hooks/useTabs.d.ts +4 -4
- package/types/components/mask/types.d.ts +3 -3
- package/types/components/menu/Menu.d.ts +6 -3
- package/types/components/menu/MenuItem.d.ts +3 -3
- package/types/components/menu/types.d.ts +2 -2
- package/types/components/panel/Panel.d.ts +6 -24
- package/types/components/panel/types.d.ts +9 -11
- package/types/components/shared.d.ts +2 -1
- package/types/components/tabs/Tabs.d.ts +3 -3
- package/types/components/tabs/types.d.ts +3 -3
- package/types/components/test/Test.d.ts +244 -0
- package/types/components/test/index.d.ts +3 -0
- package/types/components/test/types.d.ts +41 -0
- package/types/directives/vDraggable.d.ts +2 -2
- package/types/directives/vResizable.d.ts +2 -2
- package/types/hooks/index.d.ts +1 -0
- package/types/hooks/useDisabled.d.ts +1 -1
- package/types/hooks/useIcon.d.ts +3 -3
- package/types/index.d.ts +1 -4
- package/types/install.d.ts +4 -0
- package/types/list.d.ts +1 -1
- package/types/utils/util.d.ts +1 -3
- package/types/version.d.ts +8 -1
- package/cdn/index.js +0 -1
- package/cdn/style.css +0 -1
- package/lib/index.js +0 -3830
- package/lib/style.css +0 -1
- package/types/components/simple-mask/SimpleMask.d.ts +0 -43
- package/types/components/simple-mask/index.d.ts +0 -2
- package/types/components/startup/Startup.d.ts +0 -38
- package/types/components/startup/index.d.ts +0 -2
package/lib/index.js
DELETED
|
@@ -1,3830 +0,0 @@
|
|
|
1
|
-
import { defineComponent as M, openBlock as u, createElementBlock as E, renderSlot as _, createElementVNode as R, unref as n, toDisplayString as F, createVNode as k, withCtx as f, createTextVNode as N, createBlock as g, createCommentVNode as y, useAttrs as Ue, getCurrentInstance as ve, computed as h, markRaw as be, normalizeClass as Q, normalizeStyle as ue, resolveDynamicComponent as W, mergeProps as j, Fragment as Z, renderList as se, isVNode as jt, h as te, toRef as Be, useSlots as Nt, toRaw as pe, ref as D, normalizeProps as ce, guardReactiveProps as ge, effectScope as ct, watch as L, reactive as He, onMounted as ut, onUnmounted as dt, watchEffect as pt, nextTick as me, Teleport as mt, withDirectives as J, createSlots as ye, render as Ye, vShow as ee, isRef as $e, withModifiers as Xt, KeepAlive as Ut, shallowRef as qe, provide as Se, inject as we } from "vue";
|
|
2
|
-
import { ElDivider as xe, ElButton as de, ElIcon as Ht, ElSubMenu as Wt, ElBadge as Oe, ElMenuItem as Lt, ElMenu as Kt, ElContainer as et, ElHeader as Qt, ElAside as Zt, ElMain as Jt, ElFooter as Gt, ElDropdown as Yt, ElDropdownMenu as qt, ElDropdownItem as eo, ElTooltip as ft, ElSwitch as We, ElInput as je, ElEmpty as to, ElTabs as gt, ElTabPane as Ne, ElPopover as yt, ElAvatar as oo, ElMessageBox as Re, ElSelect as no, ElOption as ao, ElCheckboxButton as so, ElCheckbox as lo, ElCheckboxGroup as io, ElRadioButton as ro, ElRadio as co, ElRadioGroup as uo, ElInputNumber as po, ElDatePicker as tt, ElTimePicker as mo, ElRate as fo, ElSlider as go, ElCascader as yo, formContextKey as ho, ElFormItem as vo, ElForm as bo, ElImage as _o } from "element-plus";
|
|
3
|
-
import { VideoPlay as ko, Document as re, Menu as ht, ArrowRight as wo, StarFilled as vt, Search as Xe, Close as bt, Expand as xo, Fold as So, Star as _t, Refresh as zo, CopyDocument as Co, Moon as To, Sunny as Eo, MoreFilled as Mo, UserFilled as $o, HomeFilled as Bo, WarningFilled as Io } from "@element-plus/icons-vue";
|
|
4
|
-
import { useRouter as Ae, useRoute as Le, RouterView as kt, routeLocationKey as Ao } from "vue-router";
|
|
5
|
-
import { Minimize as Po, Popup as Vo, Maximize as Do, RawClose as Ro } from "@vtj/icons";
|
|
6
|
-
import { useDraggable as Fo, useMouseInElement as Oo, useEventListener as Ie, useElementSize as wt, useDark as jo, useResizeObserver as No } from "@vueuse/core";
|
|
7
|
-
import { isEqual as Ke, isObject as Qe, uid as xt, arrayToMap as Xo, isUrl as Uo, upperFirstCamelCase as St, toArray as Ho, merge as Wo, set as ot, debounce as Lo } from "@vtj/utils";
|
|
8
|
-
import * as nt from "echarts";
|
|
9
|
-
function oe(a) {
|
|
10
|
-
return typeof a == "string" ? a : `${a}px`;
|
|
11
|
-
}
|
|
12
|
-
function Te(a = 0, t) {
|
|
13
|
-
if (typeof a == "number")
|
|
14
|
-
return a;
|
|
15
|
-
if (/(%|vh|vw)$/i.test(a)) {
|
|
16
|
-
const o = Number.parseInt(a);
|
|
17
|
-
return Math.floor(t * o / 100);
|
|
18
|
-
}
|
|
19
|
-
return Number.parseInt(a);
|
|
20
|
-
}
|
|
21
|
-
function Pa(a, t) {
|
|
22
|
-
const e = {};
|
|
23
|
-
return Object.keys(a).forEach((o) => {
|
|
24
|
-
t.includes(o) || (e[o] = a[o]);
|
|
25
|
-
}), e;
|
|
26
|
-
}
|
|
27
|
-
function Va(a, t) {
|
|
28
|
-
const e = {};
|
|
29
|
-
return Object.keys(a).forEach((o) => {
|
|
30
|
-
t.includes(o) && (e[o] = a[o]);
|
|
31
|
-
}), e;
|
|
32
|
-
}
|
|
33
|
-
const Da = () => {
|
|
34
|
-
}, at = Symbol("INSTALLED_KEY"), Ko = (a = []) => ({
|
|
35
|
-
install: (e) => {
|
|
36
|
-
e[at] || (e[at] = !0, a.forEach((o) => {
|
|
37
|
-
o.name && e.component(o.name, o);
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
}), zt = "data:image/png;base64,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", Qo = { class: "x-startup" }, Zo = { class: "brand" }, Jo = ["src"], Go = /* @__PURE__ */ R("h3", null, [
|
|
41
|
-
/* @__PURE__ */ N("基于 "),
|
|
42
|
-
/* @__PURE__ */ R("span", null, "Vue3 + TypeScript"),
|
|
43
|
-
/* @__PURE__ */ N(" 的低代码设计器引擎")
|
|
44
|
-
], -1), Yo = { class: "btn" }, qo = /* @__PURE__ */ R("div", { class: "ba" }, [
|
|
45
|
-
/* @__PURE__ */ R("a", { href: "http://beian.miit.gov.cn/" }, "粤ICP备2023104074号")
|
|
46
|
-
], -1), en = /* @__PURE__ */ M({
|
|
47
|
-
name: "XStartup",
|
|
48
|
-
__name: "Startup",
|
|
49
|
-
props: {
|
|
50
|
-
text: { default: "VTJ.PRO" },
|
|
51
|
-
link: { default: "/" },
|
|
52
|
-
example: {}
|
|
53
|
-
},
|
|
54
|
-
setup(a) {
|
|
55
|
-
const t = a, e = () => {
|
|
56
|
-
location.href = t.link + "#/?startup";
|
|
57
|
-
}, o = () => {
|
|
58
|
-
t.example && t.example(t.link);
|
|
59
|
-
};
|
|
60
|
-
return (l, s) => (u(), E("div", Qo, [
|
|
61
|
-
_(l.$slots, "default", {}, () => [
|
|
62
|
-
R("div", null, [
|
|
63
|
-
R("div", Zo, [
|
|
64
|
-
R("img", { src: n(zt) }, null, 8, Jo),
|
|
65
|
-
R("h1", null, F(t.text), 1)
|
|
66
|
-
]),
|
|
67
|
-
k(n(xe)),
|
|
68
|
-
Go,
|
|
69
|
-
R("div", Yo, [
|
|
70
|
-
k(n(de), {
|
|
71
|
-
onClick: e,
|
|
72
|
-
type: "primary",
|
|
73
|
-
round: "",
|
|
74
|
-
size: "large",
|
|
75
|
-
icon: n(ko)
|
|
76
|
-
}, {
|
|
77
|
-
default: f(() => [
|
|
78
|
-
N(" 立即开始体验 ")
|
|
79
|
-
]),
|
|
80
|
-
_: 1
|
|
81
|
-
}, 8, ["icon"]),
|
|
82
|
-
t.example ? (u(), g(n(de), {
|
|
83
|
-
key: 0,
|
|
84
|
-
onClick: o,
|
|
85
|
-
type: "default",
|
|
86
|
-
round: "",
|
|
87
|
-
size: "large",
|
|
88
|
-
icon: n(re)
|
|
89
|
-
}, {
|
|
90
|
-
default: f(() => [
|
|
91
|
-
N(" 加载示例项目 ")
|
|
92
|
-
]),
|
|
93
|
-
_: 1
|
|
94
|
-
}, 8, ["icon"])) : y("", !0)
|
|
95
|
-
])
|
|
96
|
-
])
|
|
97
|
-
]),
|
|
98
|
-
qo
|
|
99
|
-
]));
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
const tn = {
|
|
103
|
-
default: 14,
|
|
104
|
-
small: 12,
|
|
105
|
-
large: 18
|
|
106
|
-
}, on = {
|
|
107
|
-
icon: {
|
|
108
|
-
type: [String, Object]
|
|
109
|
-
},
|
|
110
|
-
color: {
|
|
111
|
-
type: String
|
|
112
|
-
},
|
|
113
|
-
size: {
|
|
114
|
-
type: [Number, String],
|
|
115
|
-
default: "inherit"
|
|
116
|
-
},
|
|
117
|
-
src: {
|
|
118
|
-
type: String
|
|
119
|
-
},
|
|
120
|
-
background: {
|
|
121
|
-
type: String
|
|
122
|
-
},
|
|
123
|
-
padding: {
|
|
124
|
-
type: Number
|
|
125
|
-
},
|
|
126
|
-
radius: {
|
|
127
|
-
type: Number
|
|
128
|
-
}
|
|
129
|
-
}, nn = ["src"], ae = /* @__PURE__ */ M({
|
|
130
|
-
name: "XIcon",
|
|
131
|
-
__name: "Icon",
|
|
132
|
-
props: on,
|
|
133
|
-
setup(a) {
|
|
134
|
-
const t = a, e = Ue(), o = ve(), l = h(() => {
|
|
135
|
-
if (!t.icon)
|
|
136
|
-
return null;
|
|
137
|
-
const i = o?.appContext.app;
|
|
138
|
-
return typeof t.icon == "object" ? be(t.icon) : i?.component(t.icon) || t.icon;
|
|
139
|
-
}), s = h(() => {
|
|
140
|
-
const i = {
|
|
141
|
-
"is-pointer": !!e.onClick
|
|
142
|
-
};
|
|
143
|
-
return !l.value && t.icon && (i[t.icon] = !0), i;
|
|
144
|
-
}), c = h(() => ({
|
|
145
|
-
"background-color": t.background,
|
|
146
|
-
"border-radius": t.radius ? oe(t.radius) : void 0,
|
|
147
|
-
padding: t.padding ? oe(t.padding) : void 0
|
|
148
|
-
})), r = h(() => typeof t.size == "number" ? t.size : tn[t.size] ?? void 0);
|
|
149
|
-
return (i, m) => (u(), g(n(Ht), {
|
|
150
|
-
class: Q(["x-icon", s.value]),
|
|
151
|
-
color: t.color,
|
|
152
|
-
size: r.value,
|
|
153
|
-
style: ue(c.value)
|
|
154
|
-
}, {
|
|
155
|
-
default: f(() => [
|
|
156
|
-
_(i.$slots, "default", {}, () => [
|
|
157
|
-
l.value ? (u(), g(W(l.value), { key: 0 })) : y("", !0),
|
|
158
|
-
t.src ? (u(), E("img", {
|
|
159
|
-
key: 1,
|
|
160
|
-
src: t.src
|
|
161
|
-
}, null, 8, nn)) : y("", !0)
|
|
162
|
-
])
|
|
163
|
-
]),
|
|
164
|
-
_: 3
|
|
165
|
-
}, 8, ["class", "color", "size", "style"]));
|
|
166
|
-
}
|
|
167
|
-
}), an = { class: "x-menu__wrapper" }, sn = {
|
|
168
|
-
key: 1,
|
|
169
|
-
class: "x-menu__title"
|
|
170
|
-
}, ln = /* @__PURE__ */ R("i", null, null, -1), rn = {
|
|
171
|
-
key: 0,
|
|
172
|
-
class: "x-menu__title"
|
|
173
|
-
}, cn = /* @__PURE__ */ R("i", null, null, -1), Ct = /* @__PURE__ */ M({
|
|
174
|
-
inheritAttrs: !1,
|
|
175
|
-
name: "XMenuItem",
|
|
176
|
-
__name: "MenuItem",
|
|
177
|
-
props: {
|
|
178
|
-
item: {},
|
|
179
|
-
subMenu: {},
|
|
180
|
-
defaultIcon: { type: [Object, Function] }
|
|
181
|
-
},
|
|
182
|
-
setup(a) {
|
|
183
|
-
const t = a, e = ve(), o = (c) => {
|
|
184
|
-
if (c)
|
|
185
|
-
return typeof c == "string" && (e?.appContext.app?.component(c) || t.defaultIcon) || c;
|
|
186
|
-
}, l = (c) => typeof c == "object" ? c : { value: c }, s = (c = []) => c.filter((r) => !r.hidden);
|
|
187
|
-
return (c, r) => t.item.children ? (u(), g(n(Wt), j({
|
|
188
|
-
key: 0,
|
|
189
|
-
disabled: t.item.disabled
|
|
190
|
-
}, t.subMenu, {
|
|
191
|
-
index: String(t.item.id)
|
|
192
|
-
}), {
|
|
193
|
-
title: f(() => [
|
|
194
|
-
R("div", an, [
|
|
195
|
-
t.item.icon ? (u(), g(n(ae), {
|
|
196
|
-
key: 0,
|
|
197
|
-
icon: o(t.item.icon)
|
|
198
|
-
}, null, 8, ["icon"])) : y("", !0),
|
|
199
|
-
t.item.title ? (u(), E("span", sn, F(t.item.title), 1)) : y("", !0),
|
|
200
|
-
t.item.badge ? (u(), g(n(Oe), j({
|
|
201
|
-
key: 2,
|
|
202
|
-
class: "x-menu__badge"
|
|
203
|
-
}, l(t.item.badge)), {
|
|
204
|
-
default: f(() => [
|
|
205
|
-
ln
|
|
206
|
-
]),
|
|
207
|
-
_: 1
|
|
208
|
-
}, 16)) : y("", !0)
|
|
209
|
-
])
|
|
210
|
-
]),
|
|
211
|
-
default: f(() => [
|
|
212
|
-
(u(!0), E(Z, null, se(s(t.item.children), (i) => (u(), g(n(Ct), {
|
|
213
|
-
key: i.id,
|
|
214
|
-
item: i,
|
|
215
|
-
subMenu: t.subMenu,
|
|
216
|
-
defaultIcon: t.defaultIcon
|
|
217
|
-
}, null, 8, ["item", "subMenu", "defaultIcon"]))), 128))
|
|
218
|
-
]),
|
|
219
|
-
_: 1
|
|
220
|
-
}, 16, ["disabled", "index"])) : (u(), g(n(Lt), {
|
|
221
|
-
key: 1,
|
|
222
|
-
index: String(t.item.id),
|
|
223
|
-
disabled: t.item.disabled
|
|
224
|
-
}, {
|
|
225
|
-
title: f(() => [
|
|
226
|
-
t.item.title ? (u(), E("span", rn, F(t.item.title), 1)) : y("", !0),
|
|
227
|
-
t.item.badge ? (u(), g(n(Oe), j({
|
|
228
|
-
key: 1,
|
|
229
|
-
class: "x-menu__badge"
|
|
230
|
-
}, l(t.item.badge)), {
|
|
231
|
-
default: f(() => [
|
|
232
|
-
cn
|
|
233
|
-
]),
|
|
234
|
-
_: 1
|
|
235
|
-
}, 16)) : y("", !0)
|
|
236
|
-
]),
|
|
237
|
-
default: f(() => [
|
|
238
|
-
t.item.icon ? (u(), g(n(ae), {
|
|
239
|
-
key: 0,
|
|
240
|
-
icon: o(t.item.icon)
|
|
241
|
-
}, null, 8, ["icon"])) : y("", !0)
|
|
242
|
-
]),
|
|
243
|
-
_: 1
|
|
244
|
-
}, 8, ["index", "disabled"]));
|
|
245
|
-
}
|
|
246
|
-
}), ne = /* @__PURE__ */ M({
|
|
247
|
-
inheritAttrs: !1,
|
|
248
|
-
name: "XMenu",
|
|
249
|
-
__name: "Menu",
|
|
250
|
-
props: {
|
|
251
|
-
data: { default: () => [] },
|
|
252
|
-
subMenu: {},
|
|
253
|
-
defaultIcon: {}
|
|
254
|
-
},
|
|
255
|
-
emits: ["select"],
|
|
256
|
-
setup(a, { emit: t }) {
|
|
257
|
-
const e = a, o = t, l = h(() => e.data.filter((r) => !r.hidden)), s = (r, i) => {
|
|
258
|
-
const m = (p, d = []) => {
|
|
259
|
-
for (const b of d) {
|
|
260
|
-
if (b.id.toString() === p.toString())
|
|
261
|
-
return b;
|
|
262
|
-
if (b.children?.length) {
|
|
263
|
-
const S = m(p, b.children);
|
|
264
|
-
if (S)
|
|
265
|
-
return S;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
return m(i, r);
|
|
270
|
-
}, c = (r) => {
|
|
271
|
-
const i = s(l.value, r);
|
|
272
|
-
i && o("select", i);
|
|
273
|
-
};
|
|
274
|
-
return (r, i) => (u(), g(n(Kt), j({ class: "x-menu" }, r.$attrs, { onSelect: c }), {
|
|
275
|
-
default: f(() => [
|
|
276
|
-
(u(!0), E(Z, null, se(l.value, (m) => (u(), g(n(Ct), {
|
|
277
|
-
item: { ...m, icon: m.icon || n(ht) },
|
|
278
|
-
defaultIcon: e.defaultIcon,
|
|
279
|
-
subMenu: e.subMenu
|
|
280
|
-
}, null, 8, ["item", "defaultIcon", "subMenu"]))), 256))
|
|
281
|
-
]),
|
|
282
|
-
_: 1
|
|
283
|
-
}, 16));
|
|
284
|
-
}
|
|
285
|
-
}), un = { class: "x-simple-mask__brand" }, dn = { class: "x-simple-mask__aciton" }, pn = /* @__PURE__ */ M({
|
|
286
|
-
name: "XSimpleMask",
|
|
287
|
-
__name: "SimpleMask",
|
|
288
|
-
props: {
|
|
289
|
-
preview: { type: Boolean },
|
|
290
|
-
project: { default: () => ({
|
|
291
|
-
name: "Logo",
|
|
292
|
-
home: "/"
|
|
293
|
-
}) },
|
|
294
|
-
menu: {}
|
|
295
|
-
},
|
|
296
|
-
setup(a, { expose: t }) {
|
|
297
|
-
const e = a, o = Ae(), l = Le(), s = h(() => l.params.id), c = () => {
|
|
298
|
-
const i = e.project.home;
|
|
299
|
-
i && o.push(i);
|
|
300
|
-
}, r = (i) => {
|
|
301
|
-
const m = i?.id;
|
|
302
|
-
if (m) {
|
|
303
|
-
const d = `${e.preview ? "/preview" : e.project.page}/${m}`;
|
|
304
|
-
o.push(d);
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
return t({
|
|
308
|
-
goHome: c
|
|
309
|
-
}), (i, m) => (u(), g(n(et), { class: "x-simple-mask" }, {
|
|
310
|
-
default: f(() => [
|
|
311
|
-
k(n(Qt), { class: "x-simple-mask__header" }, {
|
|
312
|
-
default: f(() => [
|
|
313
|
-
R("div", un, [
|
|
314
|
-
R("span", {
|
|
315
|
-
class: "x-simple-mask__logo",
|
|
316
|
-
onClick: c
|
|
317
|
-
}, [
|
|
318
|
-
_(i.$slots, "logo", {}, () => [
|
|
319
|
-
N(F(e.project.name), 1)
|
|
320
|
-
])
|
|
321
|
-
])
|
|
322
|
-
]),
|
|
323
|
-
R("div", dn, [
|
|
324
|
-
_(i.$slots, "action")
|
|
325
|
-
])
|
|
326
|
-
]),
|
|
327
|
-
_: 3
|
|
328
|
-
}),
|
|
329
|
-
k(n(et), null, {
|
|
330
|
-
default: f(() => [
|
|
331
|
-
k(n(Zt), { class: "x-simple-mask__aside" }, {
|
|
332
|
-
default: f(() => [
|
|
333
|
-
k(n(ne), j(e.menu, {
|
|
334
|
-
"default-active": s.value,
|
|
335
|
-
onSelect: r
|
|
336
|
-
}), null, 16, ["default-active"])
|
|
337
|
-
]),
|
|
338
|
-
_: 1
|
|
339
|
-
}),
|
|
340
|
-
k(n(Jt), { class: "x-simple-mask__main" }, {
|
|
341
|
-
default: f(() => [
|
|
342
|
-
_(i.$slots, "default", {}, () => [
|
|
343
|
-
k(n(kt))
|
|
344
|
-
])
|
|
345
|
-
]),
|
|
346
|
-
_: 3
|
|
347
|
-
})
|
|
348
|
-
]),
|
|
349
|
-
_: 3
|
|
350
|
-
}),
|
|
351
|
-
i.$slots.footer ? (u(), g(n(Gt), {
|
|
352
|
-
key: 0,
|
|
353
|
-
class: "x-simple-mask__footer",
|
|
354
|
-
height: "40px"
|
|
355
|
-
}, {
|
|
356
|
-
default: f(() => [
|
|
357
|
-
_(i.$slots, "footer")
|
|
358
|
-
]),
|
|
359
|
-
_: 3
|
|
360
|
-
})) : y("", !0)
|
|
361
|
-
]),
|
|
362
|
-
_: 3
|
|
363
|
-
}));
|
|
364
|
-
}
|
|
365
|
-
}), Tt = {
|
|
366
|
-
/**
|
|
367
|
-
* 动作名称标识
|
|
368
|
-
*/
|
|
369
|
-
name: {
|
|
370
|
-
type: String
|
|
371
|
-
},
|
|
372
|
-
/**
|
|
373
|
-
* 动作标题文本
|
|
374
|
-
*/
|
|
375
|
-
label: {
|
|
376
|
-
type: String
|
|
377
|
-
},
|
|
378
|
-
/**
|
|
379
|
-
* 动作值,用来传输数据
|
|
380
|
-
*/
|
|
381
|
-
value: {
|
|
382
|
-
type: [String, Number, Object, Array, Boolean]
|
|
383
|
-
},
|
|
384
|
-
/**
|
|
385
|
-
* 图标配置
|
|
386
|
-
*/
|
|
387
|
-
icon: {
|
|
388
|
-
type: [String, Object]
|
|
389
|
-
},
|
|
390
|
-
/**
|
|
391
|
-
* 模式
|
|
392
|
-
*/
|
|
393
|
-
mode: {
|
|
394
|
-
type: String,
|
|
395
|
-
default: "button"
|
|
396
|
-
},
|
|
397
|
-
/**
|
|
398
|
-
* 下拉菜单配置
|
|
399
|
-
*/
|
|
400
|
-
menus: {
|
|
401
|
-
type: Array
|
|
402
|
-
},
|
|
403
|
-
/**
|
|
404
|
-
* tooltip 配置
|
|
405
|
-
*/
|
|
406
|
-
tooltip: {
|
|
407
|
-
type: [String, Object]
|
|
408
|
-
},
|
|
409
|
-
/**
|
|
410
|
-
* Badge 配置
|
|
411
|
-
*/
|
|
412
|
-
badge: {
|
|
413
|
-
type: [String, Number, Object]
|
|
414
|
-
},
|
|
415
|
-
/**
|
|
416
|
-
* ElDropdown 组件配置
|
|
417
|
-
*/
|
|
418
|
-
dropdown: {
|
|
419
|
-
type: Object
|
|
420
|
-
},
|
|
421
|
-
/**
|
|
422
|
-
* ElButton 组件配置,mode为button时有效
|
|
423
|
-
*/
|
|
424
|
-
button: {
|
|
425
|
-
type: Object
|
|
426
|
-
},
|
|
427
|
-
/**
|
|
428
|
-
* 禁用
|
|
429
|
-
*/
|
|
430
|
-
disabled: {
|
|
431
|
-
type: [Boolean, Function]
|
|
432
|
-
},
|
|
433
|
-
/**
|
|
434
|
-
* 尺寸
|
|
435
|
-
*/
|
|
436
|
-
size: {
|
|
437
|
-
type: String,
|
|
438
|
-
default: "default"
|
|
439
|
-
},
|
|
440
|
-
/**
|
|
441
|
-
* 颜色类型
|
|
442
|
-
*/
|
|
443
|
-
type: {
|
|
444
|
-
type: String,
|
|
445
|
-
default: "primary"
|
|
446
|
-
},
|
|
447
|
-
/**
|
|
448
|
-
* icon 背景设置,当 mode为 icon 时有效
|
|
449
|
-
*/
|
|
450
|
-
background: {
|
|
451
|
-
type: String,
|
|
452
|
-
default: "always"
|
|
453
|
-
},
|
|
454
|
-
/**
|
|
455
|
-
* icon 背景样式圆形,当 mode为 icon 时有效
|
|
456
|
-
*/
|
|
457
|
-
circle: {
|
|
458
|
-
type: Boolean
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
function mn(a) {
|
|
462
|
-
return h(() => {
|
|
463
|
-
const t = a.tooltip;
|
|
464
|
-
if (t)
|
|
465
|
-
return typeof t == "string" ? { content: t } : t;
|
|
466
|
-
});
|
|
467
|
-
}
|
|
468
|
-
function fn(a) {
|
|
469
|
-
return h(() => {
|
|
470
|
-
const t = a.badge;
|
|
471
|
-
if (t)
|
|
472
|
-
return typeof t == "object" ? t : { value: t };
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
function gn(a) {
|
|
476
|
-
return h(() => {
|
|
477
|
-
const { dropdown: t, menus: e } = a;
|
|
478
|
-
if (e && e.length > 0)
|
|
479
|
-
return Object.assign(
|
|
480
|
-
{ popperClass: "x-action__menus", size: a.size },
|
|
481
|
-
t || {}
|
|
482
|
-
);
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
function yn(a) {
|
|
486
|
-
const t = ve();
|
|
487
|
-
return h(() => {
|
|
488
|
-
const e = n(a);
|
|
489
|
-
if (e)
|
|
490
|
-
if (typeof e == "string" || e.setup || e.render || jt(e)) {
|
|
491
|
-
const o = t?.appContext.app;
|
|
492
|
-
return {
|
|
493
|
-
icon: typeof e == "string" && o?.component(e) || e
|
|
494
|
-
};
|
|
495
|
-
} else
|
|
496
|
-
return e;
|
|
497
|
-
return null;
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
function he(a) {
|
|
501
|
-
const t = yn(a);
|
|
502
|
-
return t.value ? be(M({ render: () => te(ae, t.value) })) : null;
|
|
503
|
-
}
|
|
504
|
-
function Ze(a, t) {
|
|
505
|
-
return h(() => {
|
|
506
|
-
const e = n(a);
|
|
507
|
-
return typeof e == "function" ? e(t) : !!e;
|
|
508
|
-
});
|
|
509
|
-
}
|
|
510
|
-
const hn = { key: 0 }, vn = /* @__PURE__ */ M({
|
|
511
|
-
__name: "Trigger",
|
|
512
|
-
props: Tt,
|
|
513
|
-
emits: ["click"],
|
|
514
|
-
setup(a, { emit: t }) {
|
|
515
|
-
const e = a, o = t, l = he(Be(e, "icon")), s = Ze(Be(e, "disabled")), c = h(() => ({
|
|
516
|
-
[`is-${e.mode}`]: !!e.mode,
|
|
517
|
-
[`is-${e.type}`]: !!e.type,
|
|
518
|
-
[`is-${e.size}`]: !!e.size && e.size !== "default",
|
|
519
|
-
[`is-background-${e.background}`]: e.mode === "icon" && !!e.background,
|
|
520
|
-
"is-disabled": !!e.disabled,
|
|
521
|
-
"is-circle": !!e.circle
|
|
522
|
-
})), r = () => {
|
|
523
|
-
o("click");
|
|
524
|
-
};
|
|
525
|
-
return (i, m) => e.mode === "button" ? (u(), g(n(de), j({
|
|
526
|
-
key: 0,
|
|
527
|
-
icon: n(l),
|
|
528
|
-
type: e.type,
|
|
529
|
-
size: e.size,
|
|
530
|
-
disabled: n(s)
|
|
531
|
-
}, e.button, { onClick: r }), {
|
|
532
|
-
default: f(() => [
|
|
533
|
-
N(F(i.label), 1)
|
|
534
|
-
]),
|
|
535
|
-
_: 1
|
|
536
|
-
}, 16, ["icon", "type", "size", "disabled"])) : (u(), E("div", {
|
|
537
|
-
key: 1,
|
|
538
|
-
class: Q(["x-action__inner", c.value]),
|
|
539
|
-
onClick: r
|
|
540
|
-
}, [
|
|
541
|
-
(u(), g(W(n(l)))),
|
|
542
|
-
i.label ? (u(), E("span", hn, F(i.label), 1)) : y("", !0)
|
|
543
|
-
], 2));
|
|
544
|
-
}
|
|
545
|
-
}), Y = /* @__PURE__ */ M({
|
|
546
|
-
name: "XAction",
|
|
547
|
-
__name: "Action",
|
|
548
|
-
props: Tt,
|
|
549
|
-
emits: ["click", "command"],
|
|
550
|
-
setup(a, { emit: t }) {
|
|
551
|
-
const e = a, o = Nt(), l = t, s = mn(e), c = fn(e), r = gn(e), i = Ze(Be(e, "disabled")), m = h(() => ({
|
|
552
|
-
[`x-action--${e.mode}`]: !!e.mode
|
|
553
|
-
})), p = () => {
|
|
554
|
-
l("click", pe(e));
|
|
555
|
-
}, d = (x) => {
|
|
556
|
-
const T = e.menus?.find((v) => v.command === x);
|
|
557
|
-
T && l("command", pe(T));
|
|
558
|
-
}, b = (x) => te(Oe, c.value, () => [].concat(x)), S = (x) => te(
|
|
559
|
-
Yt,
|
|
560
|
-
{ ...r.value, disabled: i.value, onCommand: d },
|
|
561
|
-
{
|
|
562
|
-
default: () => [x],
|
|
563
|
-
dropdown: () => [
|
|
564
|
-
te(
|
|
565
|
-
qt,
|
|
566
|
-
() => (e.menus || []).map((T) => te(
|
|
567
|
-
eo,
|
|
568
|
-
T,
|
|
569
|
-
() => o.item ? o.item({ item: T }) : T.label
|
|
570
|
-
))
|
|
571
|
-
)
|
|
572
|
-
]
|
|
573
|
-
}
|
|
574
|
-
), w = (x) => te(ft, { ...s.value, disabled: i.value }, () => [
|
|
575
|
-
x
|
|
576
|
-
]), P = h(() => {
|
|
577
|
-
let x = o.default ? o.default()[0] : te(be(vn), { ...e, onClick: p });
|
|
578
|
-
return c.value && (x = b(x)), r.value && (x = S(x)), s.value && (x = w(x)), x;
|
|
579
|
-
});
|
|
580
|
-
return (x, T) => (u(), E("div", {
|
|
581
|
-
class: Q(["x-action", m.value])
|
|
582
|
-
}, [
|
|
583
|
-
(u(), g(W(P.value)))
|
|
584
|
-
], 2));
|
|
585
|
-
}
|
|
586
|
-
}), bn = {
|
|
587
|
-
/**
|
|
588
|
-
* 动作项
|
|
589
|
-
*/
|
|
590
|
-
items: {
|
|
591
|
-
type: Array
|
|
592
|
-
},
|
|
593
|
-
/**
|
|
594
|
-
* 模式
|
|
595
|
-
*/
|
|
596
|
-
mode: {
|
|
597
|
-
type: String,
|
|
598
|
-
default: "button"
|
|
599
|
-
},
|
|
600
|
-
/**
|
|
601
|
-
* 尺寸
|
|
602
|
-
*/
|
|
603
|
-
size: {
|
|
604
|
-
type: String,
|
|
605
|
-
default: "default"
|
|
606
|
-
},
|
|
607
|
-
/**
|
|
608
|
-
* 颜色类型
|
|
609
|
-
*/
|
|
610
|
-
type: {
|
|
611
|
-
type: String,
|
|
612
|
-
default: "primary"
|
|
613
|
-
},
|
|
614
|
-
/**
|
|
615
|
-
* icon 背景设置,当 mode为 icon 时有效
|
|
616
|
-
*/
|
|
617
|
-
background: {
|
|
618
|
-
type: String,
|
|
619
|
-
default: "always"
|
|
620
|
-
},
|
|
621
|
-
/**
|
|
622
|
-
* icon 背景样式圆形,当 mode为 icon 时有效
|
|
623
|
-
*/
|
|
624
|
-
circle: {
|
|
625
|
-
type: Boolean
|
|
626
|
-
},
|
|
627
|
-
/**
|
|
628
|
-
* 禁用
|
|
629
|
-
*/
|
|
630
|
-
disabled: {
|
|
631
|
-
type: [Boolean, Function]
|
|
632
|
-
},
|
|
633
|
-
/**
|
|
634
|
-
* tooltip 配置
|
|
635
|
-
*/
|
|
636
|
-
tooltip: {
|
|
637
|
-
type: Object
|
|
638
|
-
},
|
|
639
|
-
/**
|
|
640
|
-
* Badge 配置
|
|
641
|
-
*/
|
|
642
|
-
badge: {
|
|
643
|
-
type: Object
|
|
644
|
-
},
|
|
645
|
-
/**
|
|
646
|
-
* ElDropdown 组件配置
|
|
647
|
-
*/
|
|
648
|
-
dropdown: {
|
|
649
|
-
type: Object
|
|
650
|
-
},
|
|
651
|
-
/**
|
|
652
|
-
* ElButton 组件配置,mode为button时有效
|
|
653
|
-
*/
|
|
654
|
-
button: {
|
|
655
|
-
type: Object
|
|
656
|
-
}
|
|
657
|
-
}, Pe = /* @__PURE__ */ M({
|
|
658
|
-
name: "XActionBar",
|
|
659
|
-
__name: "ActionBar",
|
|
660
|
-
props: bn,
|
|
661
|
-
emits: ["click", "command"],
|
|
662
|
-
setup(a, { emit: t }) {
|
|
663
|
-
const e = a, o = t, l = h(() => (e.items || []).map((r) => r === "|" ? r : {
|
|
664
|
-
...r,
|
|
665
|
-
badge: r.badge ? {
|
|
666
|
-
...e.badge,
|
|
667
|
-
...typeof r.badge == "object" ? r.badge || {} : { value: r.badge }
|
|
668
|
-
} : void 0,
|
|
669
|
-
tooltip: r.tooltip ? {
|
|
670
|
-
...e.tooltip,
|
|
671
|
-
...typeof r.tooltip == "object" ? r.tooltip || {} : { content: r.tooltip }
|
|
672
|
-
} : void 0
|
|
673
|
-
})), s = (r) => {
|
|
674
|
-
o("click", r);
|
|
675
|
-
}, c = (r, i) => {
|
|
676
|
-
o("command", r, i);
|
|
677
|
-
};
|
|
678
|
-
return (r, i) => (u(), g(n($), {
|
|
679
|
-
class: "x-action-bar",
|
|
680
|
-
align: "center"
|
|
681
|
-
}, {
|
|
682
|
-
default: f(() => [
|
|
683
|
-
(u(!0), E(Z, null, se(l.value, (m) => (u(), E(Z, null, [
|
|
684
|
-
m === "|" ? (u(), g(n(xe), {
|
|
685
|
-
key: 0,
|
|
686
|
-
direction: "vertical",
|
|
687
|
-
class: "x-action-bar__divider"
|
|
688
|
-
})) : (u(), g(n(Y), j({
|
|
689
|
-
key: 1,
|
|
690
|
-
mode: e.mode,
|
|
691
|
-
size: e.size,
|
|
692
|
-
type: e.type,
|
|
693
|
-
circle: e.circle,
|
|
694
|
-
background: e.background,
|
|
695
|
-
button: e.button,
|
|
696
|
-
dropdown: e.dropdown,
|
|
697
|
-
disabled: n(Ze)(e.disabled, m).value
|
|
698
|
-
}, m, {
|
|
699
|
-
onClick: s,
|
|
700
|
-
onCommand: (p) => c(m, p)
|
|
701
|
-
}), null, 16, ["mode", "size", "type", "circle", "background", "button", "dropdown", "disabled", "onCommand"]))
|
|
702
|
-
], 64))), 256))
|
|
703
|
-
]),
|
|
704
|
-
_: 1
|
|
705
|
-
}));
|
|
706
|
-
}
|
|
707
|
-
}), _n = {
|
|
708
|
-
/**
|
|
709
|
-
* 组件渲染html标签
|
|
710
|
-
*/
|
|
711
|
-
tag: {
|
|
712
|
-
type: String,
|
|
713
|
-
default: "div"
|
|
714
|
-
},
|
|
715
|
-
/**
|
|
716
|
-
* 宽高自适应
|
|
717
|
-
*/
|
|
718
|
-
fit: {
|
|
719
|
-
type: Boolean,
|
|
720
|
-
default: !1
|
|
721
|
-
},
|
|
722
|
-
/**
|
|
723
|
-
* 指定高度,fit 为true 失效
|
|
724
|
-
*/
|
|
725
|
-
width: {
|
|
726
|
-
type: [String, Number]
|
|
727
|
-
},
|
|
728
|
-
/**
|
|
729
|
-
* 指定高度,fit 为true失效
|
|
730
|
-
*/
|
|
731
|
-
height: {
|
|
732
|
-
type: [String, Number]
|
|
733
|
-
},
|
|
734
|
-
/**
|
|
735
|
-
* 开启flex布局
|
|
736
|
-
*/
|
|
737
|
-
flex: {
|
|
738
|
-
type: Boolean,
|
|
739
|
-
default: !0
|
|
740
|
-
},
|
|
741
|
-
/**
|
|
742
|
-
* inline-flex
|
|
743
|
-
*/
|
|
744
|
-
inline: {
|
|
745
|
-
type: Boolean
|
|
746
|
-
},
|
|
747
|
-
/**
|
|
748
|
-
* flex主轴方向
|
|
749
|
-
*/
|
|
750
|
-
direction: {
|
|
751
|
-
type: String,
|
|
752
|
-
default: "row"
|
|
753
|
-
},
|
|
754
|
-
/**
|
|
755
|
-
* 换行
|
|
756
|
-
*/
|
|
757
|
-
wrap: {
|
|
758
|
-
type: String,
|
|
759
|
-
default: "nowrap"
|
|
760
|
-
},
|
|
761
|
-
/**
|
|
762
|
-
* 主轴上的对齐方式。
|
|
763
|
-
*/
|
|
764
|
-
justify: {
|
|
765
|
-
type: String,
|
|
766
|
-
default: "flex-start"
|
|
767
|
-
},
|
|
768
|
-
/**
|
|
769
|
-
* 交叉轴上对齐方式
|
|
770
|
-
*/
|
|
771
|
-
align: {
|
|
772
|
-
type: String,
|
|
773
|
-
default: "flex-start"
|
|
774
|
-
},
|
|
775
|
-
/**
|
|
776
|
-
* 多根轴线的对齐方式。如果项目只有一根轴线,该属性不起作用
|
|
777
|
-
*/
|
|
778
|
-
alignContent: {
|
|
779
|
-
type: String,
|
|
780
|
-
default: "stretch"
|
|
781
|
-
},
|
|
782
|
-
/**
|
|
783
|
-
* 放大
|
|
784
|
-
*/
|
|
785
|
-
grow: {
|
|
786
|
-
type: Boolean,
|
|
787
|
-
default: !1
|
|
788
|
-
},
|
|
789
|
-
/**
|
|
790
|
-
* 缩小
|
|
791
|
-
*/
|
|
792
|
-
shrink: {
|
|
793
|
-
type: Boolean,
|
|
794
|
-
default: !1
|
|
795
|
-
},
|
|
796
|
-
/**
|
|
797
|
-
* 单个项目有与其他项目不一样的对齐方式。可覆盖容器的align-items属性
|
|
798
|
-
*/
|
|
799
|
-
alignSelf: {
|
|
800
|
-
type: String,
|
|
801
|
-
default: "auto"
|
|
802
|
-
},
|
|
803
|
-
/**
|
|
804
|
-
* css overflow
|
|
805
|
-
*/
|
|
806
|
-
overflow: {
|
|
807
|
-
type: String
|
|
808
|
-
},
|
|
809
|
-
/**
|
|
810
|
-
* 内边距
|
|
811
|
-
*/
|
|
812
|
-
padding: {
|
|
813
|
-
type: Boolean,
|
|
814
|
-
default: !1
|
|
815
|
-
},
|
|
816
|
-
// 嵌套子组件加间隔
|
|
817
|
-
gap: {
|
|
818
|
-
type: Boolean
|
|
819
|
-
},
|
|
820
|
-
autoPointer: {
|
|
821
|
-
type: Boolean
|
|
822
|
-
}
|
|
823
|
-
}, $ = /* @__PURE__ */ M({
|
|
824
|
-
name: "XContainer",
|
|
825
|
-
__name: "Container",
|
|
826
|
-
props: _n,
|
|
827
|
-
setup(a) {
|
|
828
|
-
const t = a, e = Ue(), o = ve(), l = h(() => {
|
|
829
|
-
const r = o?.parent;
|
|
830
|
-
if (!r)
|
|
831
|
-
return !1;
|
|
832
|
-
const i = r.proxy;
|
|
833
|
-
return i.$options.name === "XContainer" || !!i.flex;
|
|
834
|
-
}), s = h(() => ({
|
|
835
|
-
"is-fit": t.fit,
|
|
836
|
-
"is-flex": t.flex && !t.inline,
|
|
837
|
-
"is-inline-flex": t.flex && t.inline,
|
|
838
|
-
[`is-direction-${t.direction}`]: t.flex && t.direction !== "row",
|
|
839
|
-
[`is-wrap-${t.wrap}`]: t.flex && t.wrap !== "nowrap",
|
|
840
|
-
[`is-justify-${t.justify}`]: t.flex && t.justify !== "flex-start",
|
|
841
|
-
[`is-align-${t.align}`]: t.flex && t.align !== "flex-start",
|
|
842
|
-
[`is-align-content-${t.alignContent}`]: t.flex && t.alignContent !== "stretch",
|
|
843
|
-
"is-grow": t.grow ?? l.value,
|
|
844
|
-
"is-shrink": l.value && t.shrink,
|
|
845
|
-
[`is-align-self-${t.alignSelf}`]: l.value && t.alignSelf !== "auto",
|
|
846
|
-
[`is-overflow-${t.overflow}`]: !!t.overflow,
|
|
847
|
-
"is-padding": !!t.padding,
|
|
848
|
-
"is-pointer": t.autoPointer && !!e.onClick,
|
|
849
|
-
"is-gap": !!t.gap
|
|
850
|
-
})), c = h(() => {
|
|
851
|
-
const { width: r, height: i, fit: m } = t;
|
|
852
|
-
return m ? null : {
|
|
853
|
-
width: r ? oe(r) : void 0,
|
|
854
|
-
height: i ? oe(i) : void 0
|
|
855
|
-
};
|
|
856
|
-
});
|
|
857
|
-
return (r, i) => (u(), g(W(t.tag), {
|
|
858
|
-
class: Q(["x-container", s.value]),
|
|
859
|
-
style: ue(c.value)
|
|
860
|
-
}, {
|
|
861
|
-
default: f(() => [
|
|
862
|
-
_(r.$slots, "default")
|
|
863
|
-
]),
|
|
864
|
-
_: 3
|
|
865
|
-
}, 8, ["class", "style"]));
|
|
866
|
-
}
|
|
867
|
-
}), kn = {
|
|
868
|
-
size: {
|
|
869
|
-
type: String,
|
|
870
|
-
default: "default"
|
|
871
|
-
},
|
|
872
|
-
content: {
|
|
873
|
-
type: String,
|
|
874
|
-
default: ""
|
|
875
|
-
},
|
|
876
|
-
subtitle: {
|
|
877
|
-
type: String
|
|
878
|
-
},
|
|
879
|
-
icon: {
|
|
880
|
-
type: [String, Object]
|
|
881
|
-
},
|
|
882
|
-
border: {
|
|
883
|
-
type: Boolean
|
|
884
|
-
},
|
|
885
|
-
more: {
|
|
886
|
-
type: Boolean
|
|
887
|
-
}
|
|
888
|
-
}, wn = {
|
|
889
|
-
key: 2,
|
|
890
|
-
class: "x-header__subtitle"
|
|
891
|
-
}, xn = {
|
|
892
|
-
key: 0,
|
|
893
|
-
class: "x-header__actions"
|
|
894
|
-
}, Et = /* @__PURE__ */ M({
|
|
895
|
-
name: "XHeader",
|
|
896
|
-
inheritAttrs: !1,
|
|
897
|
-
__name: "Header",
|
|
898
|
-
props: kn,
|
|
899
|
-
setup(a) {
|
|
900
|
-
const t = a, e = Ue(), o = he(Be(t, "icon")), l = h(() => ({
|
|
901
|
-
[`is-size-${t.size}`]: !!t.size && t.size !== "default",
|
|
902
|
-
"is-border": t.border,
|
|
903
|
-
"is-pointer": !!e.onClick
|
|
904
|
-
}));
|
|
905
|
-
return (s, c) => (u(), g(n($), {
|
|
906
|
-
class: Q(["x-header", l.value]),
|
|
907
|
-
justify: "space-between",
|
|
908
|
-
align: "center"
|
|
909
|
-
}, {
|
|
910
|
-
default: f(() => [
|
|
911
|
-
k(n($), {
|
|
912
|
-
align: "center",
|
|
913
|
-
class: Q(["x-header__wrapper", l.value]),
|
|
914
|
-
grow: ""
|
|
915
|
-
}, {
|
|
916
|
-
default: f(() => [
|
|
917
|
-
n(o) ? (u(), g(W(n(o)), {
|
|
918
|
-
key: 0,
|
|
919
|
-
class: "x-header__icon"
|
|
920
|
-
})) : y("", !0),
|
|
921
|
-
R("span", j({ class: "x-header__content" }, s.$attrs), [
|
|
922
|
-
_(s.$slots, "default", {}, () => [
|
|
923
|
-
N(F(t.content), 1)
|
|
924
|
-
])
|
|
925
|
-
], 16),
|
|
926
|
-
t.more ? (u(), g(n(ae), {
|
|
927
|
-
key: 1,
|
|
928
|
-
class: "x-header__more",
|
|
929
|
-
icon: n(wo)
|
|
930
|
-
}, null, 8, ["icon"])) : y("", !0),
|
|
931
|
-
t.subtitle || s.$slots.subtitle ? (u(), E("span", wn, [
|
|
932
|
-
_(s.$slots, "subtitle", {}, () => [
|
|
933
|
-
N(F(t.subtitle), 1)
|
|
934
|
-
])
|
|
935
|
-
])) : y("", !0)
|
|
936
|
-
]),
|
|
937
|
-
_: 3
|
|
938
|
-
}, 8, ["class"]),
|
|
939
|
-
s.$slots.actions ? (u(), E("div", xn, [
|
|
940
|
-
_(s.$slots, "actions")
|
|
941
|
-
])) : y("", !0)
|
|
942
|
-
]),
|
|
943
|
-
_: 3
|
|
944
|
-
}, 8, ["class"]));
|
|
945
|
-
}
|
|
946
|
-
}), Sn = {
|
|
947
|
-
/**
|
|
948
|
-
* 宽高自适应
|
|
949
|
-
*/
|
|
950
|
-
fit: {
|
|
951
|
-
type: Boolean,
|
|
952
|
-
default: !1
|
|
953
|
-
},
|
|
954
|
-
/**
|
|
955
|
-
* 指定高度,fit 为true 失效
|
|
956
|
-
*/
|
|
957
|
-
width: {
|
|
958
|
-
type: [String, Number]
|
|
959
|
-
},
|
|
960
|
-
/**
|
|
961
|
-
* 指定高度,fit 为true失效
|
|
962
|
-
*/
|
|
963
|
-
height: {
|
|
964
|
-
type: [String, Number]
|
|
965
|
-
},
|
|
966
|
-
/**
|
|
967
|
-
* 显示边框
|
|
968
|
-
*/
|
|
969
|
-
border: {
|
|
970
|
-
type: Boolean,
|
|
971
|
-
default: !0
|
|
972
|
-
},
|
|
973
|
-
/**
|
|
974
|
-
* 圆角
|
|
975
|
-
*/
|
|
976
|
-
radius: {
|
|
977
|
-
type: Boolean,
|
|
978
|
-
default: !0
|
|
979
|
-
},
|
|
980
|
-
/**
|
|
981
|
-
* 卡片模式
|
|
982
|
-
*/
|
|
983
|
-
card: {
|
|
984
|
-
type: Boolean
|
|
985
|
-
},
|
|
986
|
-
/**
|
|
987
|
-
* 尺寸
|
|
988
|
-
*/
|
|
989
|
-
size: {
|
|
990
|
-
type: String
|
|
991
|
-
},
|
|
992
|
-
/**
|
|
993
|
-
* 阴影设置
|
|
994
|
-
*/
|
|
995
|
-
shadow: {
|
|
996
|
-
type: String
|
|
997
|
-
},
|
|
998
|
-
/**
|
|
999
|
-
* 头部设置
|
|
1000
|
-
*/
|
|
1001
|
-
header: {
|
|
1002
|
-
type: [String, Object]
|
|
1003
|
-
},
|
|
1004
|
-
bodyPadding: {
|
|
1005
|
-
type: Boolean,
|
|
1006
|
-
default: !0
|
|
1007
|
-
},
|
|
1008
|
-
footerPadding: {
|
|
1009
|
-
type: Boolean,
|
|
1010
|
-
default: !0
|
|
1011
|
-
},
|
|
1012
|
-
body: {
|
|
1013
|
-
type: Object
|
|
1014
|
-
},
|
|
1015
|
-
footer: {
|
|
1016
|
-
type: Object
|
|
1017
|
-
}
|
|
1018
|
-
}, Mt = /* @__PURE__ */ M({
|
|
1019
|
-
name: "XPanel",
|
|
1020
|
-
__name: "Panel",
|
|
1021
|
-
props: Sn,
|
|
1022
|
-
setup(a, { expose: t }) {
|
|
1023
|
-
const e = a, o = D(), l = h(() => ({
|
|
1024
|
-
"x-panel--card": !!e.card,
|
|
1025
|
-
"x-panel--default": !e.card,
|
|
1026
|
-
[`is-${e.size}`]: !!e.size && e.size !== "default",
|
|
1027
|
-
"is-border": !!e.border,
|
|
1028
|
-
"is-radius": !!e.radius,
|
|
1029
|
-
[`is-shadow-${e.shadow}`]: !!e.shadow && e.shadow !== "none"
|
|
1030
|
-
})), s = h(() => e.header === null ? null : typeof e.header == "string" ? {
|
|
1031
|
-
content: e.header,
|
|
1032
|
-
size: e.size
|
|
1033
|
-
} : {
|
|
1034
|
-
...e.header,
|
|
1035
|
-
size: e.size
|
|
1036
|
-
}), c = h(() => e.fit || e.height ? "auto" : void 0);
|
|
1037
|
-
return t({
|
|
1038
|
-
bodyRef: o
|
|
1039
|
-
}), (r, i) => (u(), g(n($), {
|
|
1040
|
-
class: Q(["x-panel", l.value]),
|
|
1041
|
-
direction: "column",
|
|
1042
|
-
fit: e.fit,
|
|
1043
|
-
width: e.width,
|
|
1044
|
-
height: e.height
|
|
1045
|
-
}, {
|
|
1046
|
-
default: f(() => [
|
|
1047
|
-
s.value ? (u(), g(n($), {
|
|
1048
|
-
key: 0,
|
|
1049
|
-
flex: !1,
|
|
1050
|
-
class: "x-panel__header"
|
|
1051
|
-
}, {
|
|
1052
|
-
default: f(() => [
|
|
1053
|
-
_(r.$slots, "header", {}, () => [
|
|
1054
|
-
k(n(Et), ce(ge(s.value)), {
|
|
1055
|
-
default: f(() => [
|
|
1056
|
-
_(r.$slots, "title")
|
|
1057
|
-
]),
|
|
1058
|
-
actions: f(() => [
|
|
1059
|
-
_(r.$slots, "actions")
|
|
1060
|
-
]),
|
|
1061
|
-
_: 3
|
|
1062
|
-
}, 16)
|
|
1063
|
-
])
|
|
1064
|
-
]),
|
|
1065
|
-
_: 3
|
|
1066
|
-
})) : y("", !0),
|
|
1067
|
-
k(n($), j({
|
|
1068
|
-
ref_key: "bodyRef",
|
|
1069
|
-
ref: o,
|
|
1070
|
-
flex: !1,
|
|
1071
|
-
overflow: c.value,
|
|
1072
|
-
grow: "",
|
|
1073
|
-
padding: "",
|
|
1074
|
-
class: "x-panel__body"
|
|
1075
|
-
}, e.body), {
|
|
1076
|
-
default: f(() => [
|
|
1077
|
-
_(r.$slots, "default")
|
|
1078
|
-
]),
|
|
1079
|
-
_: 3
|
|
1080
|
-
}, 16, ["overflow"]),
|
|
1081
|
-
r.$slots.footer ? (u(), g(n($), j({
|
|
1082
|
-
key: 1,
|
|
1083
|
-
flex: !1,
|
|
1084
|
-
padding: "",
|
|
1085
|
-
class: "x-panel__footer"
|
|
1086
|
-
}, e.footer), {
|
|
1087
|
-
default: f(() => [
|
|
1088
|
-
_(r.$slots, "footer")
|
|
1089
|
-
]),
|
|
1090
|
-
_: 3
|
|
1091
|
-
}, 16)) : y("", !0)
|
|
1092
|
-
]),
|
|
1093
|
-
_: 3
|
|
1094
|
-
}, 8, ["class", "fit", "width", "height"]));
|
|
1095
|
-
}
|
|
1096
|
-
}), st = "user-select-none";
|
|
1097
|
-
class lt {
|
|
1098
|
-
constructor(t, e = {}) {
|
|
1099
|
-
this.el = t, this.options = e, this.scope = ct(), this.scope.run(() => {
|
|
1100
|
-
this.init();
|
|
1101
|
-
});
|
|
1102
|
-
}
|
|
1103
|
-
scope;
|
|
1104
|
-
dragging = !1;
|
|
1105
|
-
getHandle() {
|
|
1106
|
-
const { selector: t, handle: e } = this.options;
|
|
1107
|
-
return t ? this.el.querySelector(t) : e;
|
|
1108
|
-
}
|
|
1109
|
-
getTarget() {
|
|
1110
|
-
const { target: t = "body" } = this.options;
|
|
1111
|
-
return typeof t == "string" ? document.querySelector(t) : n(t) || document.body;
|
|
1112
|
-
}
|
|
1113
|
-
init() {
|
|
1114
|
-
const { el: t, options: e } = this, { disabled: o, delay: l = 150, onStart: s, onEnd: c } = e;
|
|
1115
|
-
if (o)
|
|
1116
|
-
return;
|
|
1117
|
-
let r = null;
|
|
1118
|
-
const i = this.getHandle(), m = this.getTarget();
|
|
1119
|
-
let p = t.getBoundingClientRect(), d = null;
|
|
1120
|
-
const { x: b, y: S } = Fo(t, {
|
|
1121
|
-
initialValue: { x: p.x, y: p.y },
|
|
1122
|
-
...e,
|
|
1123
|
-
handle: i,
|
|
1124
|
-
onStart: (w, P) => {
|
|
1125
|
-
document.body.classList.add(st), clearTimeout(r), r = setTimeout(() => {
|
|
1126
|
-
this.dragging = !0, p = t.getBoundingClientRect(), d = m?.getBoundingClientRect(), s && s(w, P);
|
|
1127
|
-
}, l);
|
|
1128
|
-
},
|
|
1129
|
-
onEnd: (w, P) => {
|
|
1130
|
-
if (clearTimeout(r), document.body.classList.remove(st), this.dragging && d) {
|
|
1131
|
-
this.dragging = !1;
|
|
1132
|
-
const { x, y: T } = w, v = this.getPosition(d, p, x, T);
|
|
1133
|
-
c && c(v, P), d = null;
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
});
|
|
1137
|
-
L([b, S], () => {
|
|
1138
|
-
if (this.dragging && d) {
|
|
1139
|
-
const w = this.getPosition(d, p, b.value, S.value);
|
|
1140
|
-
t.style.left = `${w.x}px`, t.style.top = `${w.y}px`;
|
|
1141
|
-
}
|
|
1142
|
-
});
|
|
1143
|
-
}
|
|
1144
|
-
getPosition(t, e, o, l) {
|
|
1145
|
-
const { edge: s = 50 } = this.options, c = -e.width + s, r = t.width - s, i = 0, m = t.height - s, p = Math.min(r, Math.max(o, c)), d = Math.min(m, Math.max(l, i));
|
|
1146
|
-
return {
|
|
1147
|
-
x: p,
|
|
1148
|
-
y: d
|
|
1149
|
-
};
|
|
1150
|
-
}
|
|
1151
|
-
destory() {
|
|
1152
|
-
this.scope.stop();
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
const zn = {
|
|
1156
|
-
mounted(a, t) {
|
|
1157
|
-
const e = t.value || {}, o = new lt(a, e);
|
|
1158
|
-
a.__draggable__ = o;
|
|
1159
|
-
},
|
|
1160
|
-
updated(a, t) {
|
|
1161
|
-
const e = t.value || {};
|
|
1162
|
-
let o = a.__draggable__;
|
|
1163
|
-
o && !Ke(o.options, e) && (o.destory(), a.__draggable__ = new lt(a, e));
|
|
1164
|
-
},
|
|
1165
|
-
unmounted(a) {
|
|
1166
|
-
const t = a.__draggable__;
|
|
1167
|
-
t && (t.destory(), a.__draggable__ = null);
|
|
1168
|
-
}
|
|
1169
|
-
}, Fe = "user-select-none";
|
|
1170
|
-
class it {
|
|
1171
|
-
constructor(t, e = {}) {
|
|
1172
|
-
this.el = t, this.options = e, this.scope = ct(), this.scope.run(() => {
|
|
1173
|
-
this.init();
|
|
1174
|
-
});
|
|
1175
|
-
}
|
|
1176
|
-
scope;
|
|
1177
|
-
resizing = D(!1);
|
|
1178
|
-
direction = D("");
|
|
1179
|
-
MIE = null;
|
|
1180
|
-
cleanMousedown;
|
|
1181
|
-
cleanMouseup;
|
|
1182
|
-
init() {
|
|
1183
|
-
const { el: t, options: e } = this, { disabled: o, onStart: l, onEnd: s } = e;
|
|
1184
|
-
if (o)
|
|
1185
|
-
return;
|
|
1186
|
-
this.MIE = Oo(t), this.cleanMousedown = Ie(document, "mousedown", () => {
|
|
1187
|
-
this.direction?.value && this.MIE && (this.resizing.value = !0, t.classList.add("is-resizing", `is-${this.direction.value}-resizing`), l && l(this.direction.value, this.MIE));
|
|
1188
|
-
}), this.cleanMouseup = Ie(document, "mouseup", () => {
|
|
1189
|
-
this.resizing.value && this.direction?.value && this.MIE && (t.classList.remove(
|
|
1190
|
-
"is-resizing",
|
|
1191
|
-
`is-${this.direction.value}-resizing`
|
|
1192
|
-
), s && s(this.direction.value, this.MIE)), this.resizing.value = !1;
|
|
1193
|
-
}), L(this.direction, (i) => {
|
|
1194
|
-
const m = document.body;
|
|
1195
|
-
m.style.cursor = i ? `${i}-resize` : "", i ? m.classList.add(Fe) : m.classList.remove(Fe);
|
|
1196
|
-
});
|
|
1197
|
-
const { x: c, y: r } = this.MIE;
|
|
1198
|
-
L([c, r], () => {
|
|
1199
|
-
this.resizing.value ? this.resize() : this.direction.value = this.getDirection();
|
|
1200
|
-
});
|
|
1201
|
-
}
|
|
1202
|
-
resize() {
|
|
1203
|
-
const { MIE: t, direction: e, resizing: o, options: l, el: s } = this, c = e?.value || "";
|
|
1204
|
-
if (!t || !o.value || !c)
|
|
1205
|
-
return;
|
|
1206
|
-
const { x: r, y: i, elementX: m, elementY: p, elementHeight: d, elementWidth: b } = t, { onResizing: S } = l, {
|
|
1207
|
-
minWidth: w = 0,
|
|
1208
|
-
minHeight: P = 0,
|
|
1209
|
-
maxWidth: x = 99999,
|
|
1210
|
-
maxHeight: T = 99999
|
|
1211
|
-
} = l;
|
|
1212
|
-
if (c.includes("e")) {
|
|
1213
|
-
const v = Math.min(Math.max(m.value, w), x);
|
|
1214
|
-
s.style.width = `${v}px`;
|
|
1215
|
-
}
|
|
1216
|
-
if (c.includes("s")) {
|
|
1217
|
-
const v = Math.min(Math.max(p.value, P), T);
|
|
1218
|
-
s.style.height = `${v}px`;
|
|
1219
|
-
}
|
|
1220
|
-
if (c.includes("w")) {
|
|
1221
|
-
const v = Math.min(
|
|
1222
|
-
Math.max(b.value - m.value, w),
|
|
1223
|
-
x
|
|
1224
|
-
);
|
|
1225
|
-
s.style.width = `${v}px`, s.style.left = `${r.value}px`;
|
|
1226
|
-
}
|
|
1227
|
-
if (c.includes("n")) {
|
|
1228
|
-
const v = Math.min(
|
|
1229
|
-
Math.max(d.value - p.value, P),
|
|
1230
|
-
T
|
|
1231
|
-
);
|
|
1232
|
-
this.el.style.height = `${v}px`, this.el.style.top = `${i.value}px`;
|
|
1233
|
-
}
|
|
1234
|
-
S && S(c, t);
|
|
1235
|
-
}
|
|
1236
|
-
getDirection() {
|
|
1237
|
-
if (!this.MIE)
|
|
1238
|
-
return "";
|
|
1239
|
-
const { elementX: t, elementY: e, elementHeight: o, elementWidth: l, isOutside: s } = this.MIE;
|
|
1240
|
-
if (s.value)
|
|
1241
|
-
return "";
|
|
1242
|
-
const { dirs: c = ["n", "s", "w", "e"], edge: r = 5 } = this.options;
|
|
1243
|
-
let i = "";
|
|
1244
|
-
return c.includes("n") && e.value <= r ? i += "n" : c.includes("s") && e.value > o.value - r && (i += "s"), c.includes("w") && t.value <= r ? i += "w" : c.includes("e") && t.value > l.value - r && (i += "e"), i;
|
|
1245
|
-
}
|
|
1246
|
-
destory() {
|
|
1247
|
-
const t = document.body;
|
|
1248
|
-
t.style.cursor = "", t.classList.remove(Fe), this.cleanMousedown && this.cleanMousedown(), this.cleanMouseup && this.cleanMouseup(), this.MIE?.stop(), this.scope.stop();
|
|
1249
|
-
}
|
|
1250
|
-
}
|
|
1251
|
-
const $t = {
|
|
1252
|
-
mounted(a, t) {
|
|
1253
|
-
const e = t.value || {}, o = new it(a, e);
|
|
1254
|
-
a.__resizable__ = o;
|
|
1255
|
-
},
|
|
1256
|
-
updated(a, t) {
|
|
1257
|
-
const e = t.value || {};
|
|
1258
|
-
let o = a.__resizable__;
|
|
1259
|
-
o && !Ke(o.options, e) && (o.destory(), a.__resizable__ = new it(a, e));
|
|
1260
|
-
},
|
|
1261
|
-
unmounted(a) {
|
|
1262
|
-
const t = a.__resizable__;
|
|
1263
|
-
t && (t.destory(), a.__resizable__ = null);
|
|
1264
|
-
}
|
|
1265
|
-
}, Cn = {
|
|
1266
|
-
modelValue: {
|
|
1267
|
-
type: Boolean,
|
|
1268
|
-
default: !0
|
|
1269
|
-
},
|
|
1270
|
-
title: {
|
|
1271
|
-
type: String
|
|
1272
|
-
},
|
|
1273
|
-
subtitle: {
|
|
1274
|
-
type: String
|
|
1275
|
-
},
|
|
1276
|
-
icon: {
|
|
1277
|
-
type: [String, Object]
|
|
1278
|
-
},
|
|
1279
|
-
size: {
|
|
1280
|
-
type: String,
|
|
1281
|
-
default: "default"
|
|
1282
|
-
},
|
|
1283
|
-
width: {
|
|
1284
|
-
type: [Number, String],
|
|
1285
|
-
default: "70%"
|
|
1286
|
-
},
|
|
1287
|
-
height: {
|
|
1288
|
-
type: [Number, String],
|
|
1289
|
-
default: "70%"
|
|
1290
|
-
},
|
|
1291
|
-
left: {
|
|
1292
|
-
type: [Number, String]
|
|
1293
|
-
},
|
|
1294
|
-
top: {
|
|
1295
|
-
type: [Number, String]
|
|
1296
|
-
},
|
|
1297
|
-
modal: {
|
|
1298
|
-
type: Boolean,
|
|
1299
|
-
default: !0
|
|
1300
|
-
},
|
|
1301
|
-
draggable: {
|
|
1302
|
-
type: [Boolean, Object],
|
|
1303
|
-
default: !0
|
|
1304
|
-
},
|
|
1305
|
-
resizable: {
|
|
1306
|
-
type: [Boolean, Object]
|
|
1307
|
-
},
|
|
1308
|
-
closable: {
|
|
1309
|
-
type: Boolean,
|
|
1310
|
-
default: !0
|
|
1311
|
-
},
|
|
1312
|
-
maximizable: {
|
|
1313
|
-
type: Boolean,
|
|
1314
|
-
default: !0
|
|
1315
|
-
},
|
|
1316
|
-
minimizable: {
|
|
1317
|
-
type: Boolean,
|
|
1318
|
-
default: !0
|
|
1319
|
-
},
|
|
1320
|
-
mode: {
|
|
1321
|
-
type: String,
|
|
1322
|
-
default: "normal"
|
|
1323
|
-
},
|
|
1324
|
-
content: {
|
|
1325
|
-
type: Object
|
|
1326
|
-
},
|
|
1327
|
-
src: {
|
|
1328
|
-
type: String
|
|
1329
|
-
},
|
|
1330
|
-
componentInstance: {
|
|
1331
|
-
type: Object
|
|
1332
|
-
},
|
|
1333
|
-
beforeClose: {
|
|
1334
|
-
type: Function
|
|
1335
|
-
},
|
|
1336
|
-
submit: {
|
|
1337
|
-
type: [Boolean, String]
|
|
1338
|
-
},
|
|
1339
|
-
cancel: {
|
|
1340
|
-
type: [Boolean, String]
|
|
1341
|
-
},
|
|
1342
|
-
bodyPadding: {
|
|
1343
|
-
type: Boolean,
|
|
1344
|
-
default: !0
|
|
1345
|
-
},
|
|
1346
|
-
primary: {
|
|
1347
|
-
type: Boolean
|
|
1348
|
-
}
|
|
1349
|
-
};
|
|
1350
|
-
let fe = 1e3;
|
|
1351
|
-
function Tn(a, t) {
|
|
1352
|
-
const { width: e, height: o } = wt(t), l = He({
|
|
1353
|
-
mode: a.mode || "normal",
|
|
1354
|
-
wrapperWidth: 0,
|
|
1355
|
-
wrapperHeight: 0,
|
|
1356
|
-
width: 0,
|
|
1357
|
-
height: 0,
|
|
1358
|
-
top: 0,
|
|
1359
|
-
left: 0,
|
|
1360
|
-
zIndex: ++fe,
|
|
1361
|
-
dragging: !1,
|
|
1362
|
-
resizing: !1
|
|
1363
|
-
});
|
|
1364
|
-
return L([e, o], ([s, c]) => {
|
|
1365
|
-
l.wrapperWidth = s, l.wrapperHeight = c, l.width = Te(a.width, s), l.height = Te(a.height, c), l.left = a.left ? Te(a.left, s) - l.width / 2 : Math.max(Math.floor((s - l.width) / 2), 0), l.top = a.top ? Te(a.top, c) : Math.max(Math.floor((c - l.height) / 2), 0);
|
|
1366
|
-
}), L(l, (s) => {
|
|
1367
|
-
fe = Math.max(s.zIndex, fe);
|
|
1368
|
-
}), {
|
|
1369
|
-
state: l,
|
|
1370
|
-
normal: h(() => l.mode === "normal"),
|
|
1371
|
-
maximized: h(() => l.mode === "maximized"),
|
|
1372
|
-
minimized: h(() => l.mode === "minimized")
|
|
1373
|
-
};
|
|
1374
|
-
}
|
|
1375
|
-
function En(a, t) {
|
|
1376
|
-
const e = h(() => {
|
|
1377
|
-
const { width: c, height: r, top: i, left: m, zIndex: p } = t;
|
|
1378
|
-
return {
|
|
1379
|
-
width: `${c}px`,
|
|
1380
|
-
height: `${r}px`,
|
|
1381
|
-
top: `${i}px`,
|
|
1382
|
-
left: `${m}px`,
|
|
1383
|
-
zIndex: p
|
|
1384
|
-
};
|
|
1385
|
-
}), o = h(() => ({
|
|
1386
|
-
[`is-${t.mode}`]: !!t.mode,
|
|
1387
|
-
"is-draggable": !!a.draggable,
|
|
1388
|
-
"is-resizable": !!a.resizable,
|
|
1389
|
-
"is-primary": !!a.primary
|
|
1390
|
-
})), l = h(() => ({
|
|
1391
|
-
[`is-${t.mode}`]: !!t.mode,
|
|
1392
|
-
"is-dragging": t.dragging,
|
|
1393
|
-
"is-resizing": t.resizing
|
|
1394
|
-
})), s = h(() => ({
|
|
1395
|
-
zIndex: t.zIndex
|
|
1396
|
-
}));
|
|
1397
|
-
return {
|
|
1398
|
-
styles: e,
|
|
1399
|
-
classes: o,
|
|
1400
|
-
wrapperClass: l,
|
|
1401
|
-
modalStyle: s
|
|
1402
|
-
};
|
|
1403
|
-
}
|
|
1404
|
-
function Mn(a, t, e) {
|
|
1405
|
-
const o = (p) => {
|
|
1406
|
-
t.mode = p, ["maximized", "minimized", "normal"].includes(p) && e(p), e("modeChange", p);
|
|
1407
|
-
}, l = async () => {
|
|
1408
|
-
(!a.beforeClose || await a.beforeClose()) && (e("update:modelValue", !1), e("close"), e("destroy"));
|
|
1409
|
-
};
|
|
1410
|
-
return {
|
|
1411
|
-
close: l,
|
|
1412
|
-
changeMode: o,
|
|
1413
|
-
show: () => o("normal"),
|
|
1414
|
-
hide: () => o("minimized"),
|
|
1415
|
-
active: () => {
|
|
1416
|
-
t.zIndex = Math.max(t.zIndex, ++fe);
|
|
1417
|
-
},
|
|
1418
|
-
submit: () => e("submit"),
|
|
1419
|
-
cancel: () => {
|
|
1420
|
-
e("cancel"), l();
|
|
1421
|
-
}
|
|
1422
|
-
};
|
|
1423
|
-
}
|
|
1424
|
-
function $n(a, t, e, o) {
|
|
1425
|
-
return h(() => {
|
|
1426
|
-
const l = typeof a.draggable == "boolean" ? !a.draggable : !!a.draggable?.disabled;
|
|
1427
|
-
return {
|
|
1428
|
-
...Qe(a.draggable) ? a.draggable : {},
|
|
1429
|
-
disabled: l,
|
|
1430
|
-
target: o,
|
|
1431
|
-
selector: ".x-panel__header",
|
|
1432
|
-
onStart(s) {
|
|
1433
|
-
t.dragging = !0, t.zIndex = Math.max(t.zIndex, ++fe), e("dragStart", s);
|
|
1434
|
-
},
|
|
1435
|
-
onMove(s) {
|
|
1436
|
-
e("dragging", s);
|
|
1437
|
-
},
|
|
1438
|
-
onEnd(s) {
|
|
1439
|
-
if (t.mode === "maximized")
|
|
1440
|
-
return;
|
|
1441
|
-
const { x: c, y: r } = s;
|
|
1442
|
-
t.left = c, t.top = r, t.dragging = !1, e("dragEnd", s);
|
|
1443
|
-
}
|
|
1444
|
-
};
|
|
1445
|
-
});
|
|
1446
|
-
}
|
|
1447
|
-
function Bn(a, t, e) {
|
|
1448
|
-
return h(() => {
|
|
1449
|
-
const o = typeof a.resizable == "boolean" ? !a.resizable : !!a.resizable?.disabled;
|
|
1450
|
-
return {
|
|
1451
|
-
minWidth: 200,
|
|
1452
|
-
minHeight: 150,
|
|
1453
|
-
...Qe(a.resizable) ? a.resizable : {},
|
|
1454
|
-
disabled: o,
|
|
1455
|
-
dirs: ["e", "s", "w"],
|
|
1456
|
-
onStart(l, s) {
|
|
1457
|
-
t.resizing = !0, t.zIndex = Math.max(t.zIndex, ++fe), e("resizeStart", l, s);
|
|
1458
|
-
},
|
|
1459
|
-
onResizing(l, s) {
|
|
1460
|
-
e("resizing", l, s);
|
|
1461
|
-
},
|
|
1462
|
-
onEnd(l, s) {
|
|
1463
|
-
t.left = s.elementPositionX.value, t.top = s.elementPositionY.value, t.width = s.elementWidth.value, t.height = s.elementHeight.value, t.resizing = !1, e("resizeEnd", l, s);
|
|
1464
|
-
}
|
|
1465
|
-
};
|
|
1466
|
-
});
|
|
1467
|
-
}
|
|
1468
|
-
function In(a, t) {
|
|
1469
|
-
const e = a.componentInstance;
|
|
1470
|
-
if (!e)
|
|
1471
|
-
return;
|
|
1472
|
-
let o = null;
|
|
1473
|
-
return ut(() => {
|
|
1474
|
-
const l = n(t), s = n(l?.bodyRef);
|
|
1475
|
-
o = e.$el, s && s.$el && s.$el.appendChild(o);
|
|
1476
|
-
}), dt(() => {
|
|
1477
|
-
o && o.parentNode && o.parentNode.removeChild(o);
|
|
1478
|
-
}), {
|
|
1479
|
-
componentInstance: e
|
|
1480
|
-
};
|
|
1481
|
-
}
|
|
1482
|
-
const An = ["src"], Je = /* @__PURE__ */ M({
|
|
1483
|
-
name: "XDialog",
|
|
1484
|
-
__name: "Dialog",
|
|
1485
|
-
props: Cn,
|
|
1486
|
-
emits: ["update:modelValue", "open", "close", "destroy", "maximized", "minimized", "normal", "modeChange", "dragStart", "dragging", "dragEnd", "resizeStart", "resizeEnd", "resizing", "submit", "cancel"],
|
|
1487
|
-
setup(a, { expose: t, emit: e }) {
|
|
1488
|
-
const o = a, l = e, s = ve(), c = D(), r = D(), { state: i, maximized: m, minimized: p, normal: d } = Tn(o, c), { styles: b, classes: S, wrapperClass: w, modalStyle: P } = En(o, i), { changeMode: x, active: T, close: v, show: I, hide: A, submit: U, cancel: z } = Mn(
|
|
1489
|
-
o,
|
|
1490
|
-
i,
|
|
1491
|
-
l
|
|
1492
|
-
), H = $n(o, i, l, c), X = Bn(o, i, l), le = In(o, r);
|
|
1493
|
-
pt(async () => {
|
|
1494
|
-
o.modelValue && (await me(), s && l("open", s));
|
|
1495
|
-
});
|
|
1496
|
-
const _e = h(() => r.value?.$el);
|
|
1497
|
-
return t({
|
|
1498
|
-
$vtjEl: _e,
|
|
1499
|
-
panelRef: r,
|
|
1500
|
-
state: i,
|
|
1501
|
-
maximized: m,
|
|
1502
|
-
minimized: p,
|
|
1503
|
-
changeMode: x,
|
|
1504
|
-
show: I,
|
|
1505
|
-
hide: A,
|
|
1506
|
-
submit: U,
|
|
1507
|
-
cancel: z,
|
|
1508
|
-
componentInstance: le
|
|
1509
|
-
}), (K, G) => o.modelValue ? (u(), g(mt, {
|
|
1510
|
-
key: 0,
|
|
1511
|
-
to: "body"
|
|
1512
|
-
}, [
|
|
1513
|
-
R("div", {
|
|
1514
|
-
ref_key: "wrapper",
|
|
1515
|
-
ref: c,
|
|
1516
|
-
class: Q(["x-dialog__wrapper", n(w)])
|
|
1517
|
-
}, [
|
|
1518
|
-
o.modal ? (u(), E("div", {
|
|
1519
|
-
key: 0,
|
|
1520
|
-
class: "x-dialog__modal",
|
|
1521
|
-
style: ue(n(P))
|
|
1522
|
-
}, null, 4)) : y("", !0),
|
|
1523
|
-
J((u(), g(n(Mt), {
|
|
1524
|
-
ref_key: "panelRef",
|
|
1525
|
-
ref: r,
|
|
1526
|
-
class: Q(["x-dialog", n(S)]),
|
|
1527
|
-
card: "",
|
|
1528
|
-
shadow: "always",
|
|
1529
|
-
header: { icon: o.icon, subtitle: o.subtitle },
|
|
1530
|
-
width: "800px",
|
|
1531
|
-
height: "600px",
|
|
1532
|
-
footer: { justify: "space-between", flex: !0, align: "center" },
|
|
1533
|
-
style: ue(n(b)),
|
|
1534
|
-
size: o.size,
|
|
1535
|
-
body: { padding: o.bodyPadding },
|
|
1536
|
-
onClick: n(T)
|
|
1537
|
-
}, ye({
|
|
1538
|
-
title: f(() => [
|
|
1539
|
-
N(F(o.title), 1)
|
|
1540
|
-
]),
|
|
1541
|
-
actions: f(() => [
|
|
1542
|
-
_(K.$slots, "actions"),
|
|
1543
|
-
o.minimizable ? (u(), g(n(Y), {
|
|
1544
|
-
key: 0,
|
|
1545
|
-
icon: n(Po),
|
|
1546
|
-
size: o.size,
|
|
1547
|
-
mode: "icon",
|
|
1548
|
-
type: "primary",
|
|
1549
|
-
background: "hover",
|
|
1550
|
-
onClick: G[0] || (G[0] = (ie) => n(x)("minimized"))
|
|
1551
|
-
}, null, 8, ["icon", "size"])) : y("", !0),
|
|
1552
|
-
o.maximizable ? (u(), E(Z, { key: 1 }, [
|
|
1553
|
-
n(d) ? (u(), g(n(Y), {
|
|
1554
|
-
key: 1,
|
|
1555
|
-
icon: n(Do),
|
|
1556
|
-
size: o.size,
|
|
1557
|
-
mode: "icon",
|
|
1558
|
-
type: "primary",
|
|
1559
|
-
background: "hover",
|
|
1560
|
-
onClick: G[2] || (G[2] = (ie) => n(x)("maximized"))
|
|
1561
|
-
}, null, 8, ["icon", "size"])) : (u(), g(n(Y), {
|
|
1562
|
-
key: 0,
|
|
1563
|
-
icon: n(Vo),
|
|
1564
|
-
size: o.size,
|
|
1565
|
-
mode: "icon",
|
|
1566
|
-
type: "primary",
|
|
1567
|
-
background: "hover",
|
|
1568
|
-
onClick: G[1] || (G[1] = (ie) => n(x)("normal"))
|
|
1569
|
-
}, null, 8, ["icon", "size"]))
|
|
1570
|
-
], 64)) : y("", !0),
|
|
1571
|
-
o.closable ? (u(), g(n(Y), {
|
|
1572
|
-
key: 2,
|
|
1573
|
-
icon: n(Ro),
|
|
1574
|
-
size: o.size,
|
|
1575
|
-
mode: "icon",
|
|
1576
|
-
type: "danger",
|
|
1577
|
-
background: "hover",
|
|
1578
|
-
onClick: n(v)
|
|
1579
|
-
}, null, 8, ["icon", "size", "onClick"])) : y("", !0)
|
|
1580
|
-
]),
|
|
1581
|
-
default: f(() => [
|
|
1582
|
-
_(K.$slots, "default", {}, () => [
|
|
1583
|
-
o.content ? (u(), g(W(o.content), { key: 0 })) : y("", !0),
|
|
1584
|
-
o.src ? (u(), E("iframe", {
|
|
1585
|
-
key: 1,
|
|
1586
|
-
src: o.src,
|
|
1587
|
-
class: "x-dialog__frame"
|
|
1588
|
-
}, null, 8, An)) : y("", !0)
|
|
1589
|
-
])
|
|
1590
|
-
]),
|
|
1591
|
-
_: 2
|
|
1592
|
-
}, [
|
|
1593
|
-
o.cancel || o.submit || K.$slots.footer || K.$slots.extra || K.$slots.handle ? {
|
|
1594
|
-
name: "footer",
|
|
1595
|
-
fn: f(() => [
|
|
1596
|
-
_(K.$slots, "footer", {}, () => [
|
|
1597
|
-
k(n($), { align: "center" }, {
|
|
1598
|
-
default: f(() => [
|
|
1599
|
-
_(K.$slots, "extra")
|
|
1600
|
-
]),
|
|
1601
|
-
_: 3
|
|
1602
|
-
}),
|
|
1603
|
-
k(n($), { align: "center" }, {
|
|
1604
|
-
default: f(() => [
|
|
1605
|
-
_(K.$slots, "handle"),
|
|
1606
|
-
o.cancel ? (u(), g(n(de), {
|
|
1607
|
-
key: 0,
|
|
1608
|
-
type: "default",
|
|
1609
|
-
size: o.size,
|
|
1610
|
-
onClick: n(z)
|
|
1611
|
-
}, {
|
|
1612
|
-
default: f(() => [
|
|
1613
|
-
N(F(typeof o.cancel == "string" ? o.cancel : "取消"), 1)
|
|
1614
|
-
]),
|
|
1615
|
-
_: 1
|
|
1616
|
-
}, 8, ["size", "onClick"])) : y("", !0),
|
|
1617
|
-
o.submit ? (u(), g(n(de), {
|
|
1618
|
-
key: 1,
|
|
1619
|
-
type: "primary",
|
|
1620
|
-
size: o.size,
|
|
1621
|
-
onClick: n(U)
|
|
1622
|
-
}, {
|
|
1623
|
-
default: f(() => [
|
|
1624
|
-
N(F(typeof o.submit == "string" ? o.submit : "确定"), 1)
|
|
1625
|
-
]),
|
|
1626
|
-
_: 1
|
|
1627
|
-
}, 8, ["size", "onClick"])) : y("", !0)
|
|
1628
|
-
]),
|
|
1629
|
-
_: 3
|
|
1630
|
-
})
|
|
1631
|
-
])
|
|
1632
|
-
]),
|
|
1633
|
-
key: "0"
|
|
1634
|
-
} : void 0
|
|
1635
|
-
]), 1032, ["header", "class", "style", "size", "body", "onClick"])), [
|
|
1636
|
-
[n(zn), n(H)],
|
|
1637
|
-
[n($t), n(X)]
|
|
1638
|
-
])
|
|
1639
|
-
], 2)
|
|
1640
|
-
])) : y("", !0);
|
|
1641
|
-
}
|
|
1642
|
-
});
|
|
1643
|
-
function Ge(a, t) {
|
|
1644
|
-
const e = document.createElement("div"), o = k(Je, a);
|
|
1645
|
-
o.appContext = t ?? Ge._context, Ye(o, e);
|
|
1646
|
-
const l = () => {
|
|
1647
|
-
Ye(null, e), e.parentNode?.removeChild(e);
|
|
1648
|
-
};
|
|
1649
|
-
return o.props.onDestroy = () => {
|
|
1650
|
-
l();
|
|
1651
|
-
}, document.body.appendChild(e), {
|
|
1652
|
-
vnode: o,
|
|
1653
|
-
destroy: l
|
|
1654
|
-
};
|
|
1655
|
-
}
|
|
1656
|
-
const Pn = /* @__PURE__ */ R("div", { class: "x-mask-sidebar__helper" }, null, -1), Vn = /* @__PURE__ */ M({
|
|
1657
|
-
__name: "Sidebar",
|
|
1658
|
-
props: {
|
|
1659
|
-
collapsed: { type: Boolean }
|
|
1660
|
-
},
|
|
1661
|
-
setup(a) {
|
|
1662
|
-
const t = a;
|
|
1663
|
-
return (e, o) => J((u(), g(n($), {
|
|
1664
|
-
class: Q(["x-mask-sidebar", { "is-collapsed": t.collapsed }]),
|
|
1665
|
-
grow: !1,
|
|
1666
|
-
flex: "",
|
|
1667
|
-
direction: "column"
|
|
1668
|
-
}, {
|
|
1669
|
-
default: f(() => [
|
|
1670
|
-
_(e.$slots, "brand"),
|
|
1671
|
-
k(n($), {
|
|
1672
|
-
class: "x-mask-sidebar__wrapper",
|
|
1673
|
-
flex: "",
|
|
1674
|
-
grow: "",
|
|
1675
|
-
direction: "column",
|
|
1676
|
-
justify: "space-between",
|
|
1677
|
-
align: "center"
|
|
1678
|
-
}, {
|
|
1679
|
-
default: f(() => [
|
|
1680
|
-
_(e.$slots, "default"),
|
|
1681
|
-
Pn
|
|
1682
|
-
]),
|
|
1683
|
-
_: 3
|
|
1684
|
-
})
|
|
1685
|
-
]),
|
|
1686
|
-
_: 3
|
|
1687
|
-
}, 8, ["class"])), [
|
|
1688
|
-
[n($t), {
|
|
1689
|
-
dirs: ["e"],
|
|
1690
|
-
disabled: t.collapsed,
|
|
1691
|
-
maxWidth: 500,
|
|
1692
|
-
minWidth: 200
|
|
1693
|
-
}]
|
|
1694
|
-
]);
|
|
1695
|
-
}
|
|
1696
|
-
}), Dn = /* @__PURE__ */ M({
|
|
1697
|
-
__name: "SwitchBar",
|
|
1698
|
-
props: {
|
|
1699
|
-
collasped: { type: Boolean, default: !1 },
|
|
1700
|
-
favorite: { type: Boolean, default: !1 },
|
|
1701
|
-
keyword: {}
|
|
1702
|
-
},
|
|
1703
|
-
emits: [
|
|
1704
|
-
"update:collasped",
|
|
1705
|
-
"update:keyword",
|
|
1706
|
-
"update:favorite"
|
|
1707
|
-
],
|
|
1708
|
-
setup(a, { emit: t }) {
|
|
1709
|
-
const e = a, o = t, l = D(!1), s = D(""), c = D(!1), r = () => {
|
|
1710
|
-
l.value = !0;
|
|
1711
|
-
}, i = () => {
|
|
1712
|
-
s.value = "", l.value = !1, o("update:keyword", s.value);
|
|
1713
|
-
}, m = () => {
|
|
1714
|
-
o("update:collasped", !e.collasped);
|
|
1715
|
-
}, p = () => {
|
|
1716
|
-
o("update:keyword", s.value);
|
|
1717
|
-
}, d = () => {
|
|
1718
|
-
o("update:favorite", c.value);
|
|
1719
|
-
};
|
|
1720
|
-
return (b, S) => (u(), g(n($), {
|
|
1721
|
-
class: "x-mask-switch-bar",
|
|
1722
|
-
justify: "space-between",
|
|
1723
|
-
align: "center"
|
|
1724
|
-
}, {
|
|
1725
|
-
default: f(() => [
|
|
1726
|
-
e.collasped ? y("", !0) : (u(), g(n($), {
|
|
1727
|
-
key: 0,
|
|
1728
|
-
class: "x-mask-switch-bar__left",
|
|
1729
|
-
grow: ""
|
|
1730
|
-
}, {
|
|
1731
|
-
default: f(() => [
|
|
1732
|
-
l.value ? y("", !0) : (u(), g(n(We), {
|
|
1733
|
-
key: 0,
|
|
1734
|
-
modelValue: c.value,
|
|
1735
|
-
"onUpdate:modelValue": S[0] || (S[0] = (w) => c.value = w),
|
|
1736
|
-
class: "x-mask-switch-bar__switch",
|
|
1737
|
-
"active-icon": n(vt),
|
|
1738
|
-
"inactive-icon": n(ht),
|
|
1739
|
-
onChange: d
|
|
1740
|
-
}, null, 8, ["modelValue", "active-icon", "inactive-icon"])),
|
|
1741
|
-
l.value ? (u(), g(n(je), {
|
|
1742
|
-
key: 1,
|
|
1743
|
-
modelValue: s.value,
|
|
1744
|
-
"onUpdate:modelValue": S[1] || (S[1] = (w) => s.value = w),
|
|
1745
|
-
class: "x-mask-switch-bar__input",
|
|
1746
|
-
size: "small",
|
|
1747
|
-
placeholder: "请输入查询关键字",
|
|
1748
|
-
onInput: p,
|
|
1749
|
-
"prefix-icon": n(Xe)
|
|
1750
|
-
}, {
|
|
1751
|
-
suffix: f(() => [
|
|
1752
|
-
k(n(ae), {
|
|
1753
|
-
icon: n(bt),
|
|
1754
|
-
onClick: i
|
|
1755
|
-
}, null, 8, ["icon"])
|
|
1756
|
-
]),
|
|
1757
|
-
_: 1
|
|
1758
|
-
}, 8, ["modelValue", "prefix-icon"])) : y("", !0)
|
|
1759
|
-
]),
|
|
1760
|
-
_: 1
|
|
1761
|
-
})),
|
|
1762
|
-
k(n($), {
|
|
1763
|
-
class: Q(["x-mask-switch-bar__right", { "is-collasped": e.collasped }]),
|
|
1764
|
-
flex: "",
|
|
1765
|
-
align: "center",
|
|
1766
|
-
justify: "center"
|
|
1767
|
-
}, {
|
|
1768
|
-
default: f(() => [
|
|
1769
|
-
!l.value && !e.collasped ? (u(), g(n(Y), {
|
|
1770
|
-
key: 0,
|
|
1771
|
-
icon: n(Xe),
|
|
1772
|
-
mode: "icon",
|
|
1773
|
-
background: "hover",
|
|
1774
|
-
size: "default",
|
|
1775
|
-
circle: "",
|
|
1776
|
-
onClick: r
|
|
1777
|
-
}, null, 8, ["icon"])) : y("", !0),
|
|
1778
|
-
e.collasped ? (u(), g(n(Y), {
|
|
1779
|
-
key: 1,
|
|
1780
|
-
icon: n(xo),
|
|
1781
|
-
mode: "icon",
|
|
1782
|
-
size: "default",
|
|
1783
|
-
background: "hover",
|
|
1784
|
-
onClick: m,
|
|
1785
|
-
circle: ""
|
|
1786
|
-
}, null, 8, ["icon"])) : y("", !0),
|
|
1787
|
-
e.collasped ? y("", !0) : (u(), g(n(Y), {
|
|
1788
|
-
key: 2,
|
|
1789
|
-
icon: n(So),
|
|
1790
|
-
mode: "icon",
|
|
1791
|
-
size: "default",
|
|
1792
|
-
background: "hover",
|
|
1793
|
-
circle: "",
|
|
1794
|
-
onClick: m
|
|
1795
|
-
}, null, 8, ["icon"]))
|
|
1796
|
-
]),
|
|
1797
|
-
_: 1
|
|
1798
|
-
}, 8, ["class"])
|
|
1799
|
-
]),
|
|
1800
|
-
_: 1
|
|
1801
|
-
}));
|
|
1802
|
-
}
|
|
1803
|
-
}), Rn = ["src"], Fn = { key: 0 }, On = /* @__PURE__ */ M({
|
|
1804
|
-
__name: "Brand",
|
|
1805
|
-
props: {
|
|
1806
|
-
collapsed: { type: Boolean, default: !1 },
|
|
1807
|
-
logo: {},
|
|
1808
|
-
title: {},
|
|
1809
|
-
url: {}
|
|
1810
|
-
},
|
|
1811
|
-
setup(a) {
|
|
1812
|
-
const t = a, e = Ae(), o = () => {
|
|
1813
|
-
t.url && e.push(t.url);
|
|
1814
|
-
};
|
|
1815
|
-
return (l, s) => (u(), g(n($), {
|
|
1816
|
-
class: Q(["x-mask-brand", { "is-collapsed": t.collapsed }]),
|
|
1817
|
-
align: "center"
|
|
1818
|
-
}, {
|
|
1819
|
-
default: f(() => [
|
|
1820
|
-
k(n($), {
|
|
1821
|
-
class: "x-mask-brand__logo",
|
|
1822
|
-
flex: "",
|
|
1823
|
-
justify: "center",
|
|
1824
|
-
align: "center",
|
|
1825
|
-
onClick: o
|
|
1826
|
-
}, {
|
|
1827
|
-
default: f(() => [
|
|
1828
|
-
_(l.$slots, "logo", {}, () => [
|
|
1829
|
-
t.logo ? (u(), E("img", {
|
|
1830
|
-
key: 0,
|
|
1831
|
-
src: t.logo
|
|
1832
|
-
}, null, 8, Rn)) : y("", !0)
|
|
1833
|
-
])
|
|
1834
|
-
]),
|
|
1835
|
-
_: 3
|
|
1836
|
-
}),
|
|
1837
|
-
k(n($), {
|
|
1838
|
-
class: "x-mask-brand__title",
|
|
1839
|
-
flex: "",
|
|
1840
|
-
align: "center"
|
|
1841
|
-
}, {
|
|
1842
|
-
default: f(() => [
|
|
1843
|
-
t.title ? (u(), E("span", Fn, [
|
|
1844
|
-
_(l.$slots, "title", {}, () => [
|
|
1845
|
-
N(F(t.title), 1)
|
|
1846
|
-
])
|
|
1847
|
-
])) : y("", !0)
|
|
1848
|
-
]),
|
|
1849
|
-
_: 3
|
|
1850
|
-
})
|
|
1851
|
-
]),
|
|
1852
|
-
_: 3
|
|
1853
|
-
}, 8, ["class"]));
|
|
1854
|
-
}
|
|
1855
|
-
}), Ee = "__favorites__", Me = "__search__", jn = /* @__PURE__ */ M({
|
|
1856
|
-
__name: "Menu",
|
|
1857
|
-
props: {
|
|
1858
|
-
collapse: { type: Boolean, default: !1 },
|
|
1859
|
-
keyword: {},
|
|
1860
|
-
favorite: { type: Boolean },
|
|
1861
|
-
favorites: {},
|
|
1862
|
-
flatMenus: {},
|
|
1863
|
-
menus: {},
|
|
1864
|
-
active: {}
|
|
1865
|
-
},
|
|
1866
|
-
emits: ["select"],
|
|
1867
|
-
setup(a, { emit: t }) {
|
|
1868
|
-
const e = a, o = h(() => e.menus || []), l = t, s = h(() => String(e.active?.id)), c = h(() => [
|
|
1869
|
-
{
|
|
1870
|
-
id: Ee,
|
|
1871
|
-
title: "收藏",
|
|
1872
|
-
icon: _t,
|
|
1873
|
-
children: e.favorites?.length ? e.favorites : [
|
|
1874
|
-
{
|
|
1875
|
-
id: Ee + "empty",
|
|
1876
|
-
disabled: !0,
|
|
1877
|
-
title: "暂无收藏菜单"
|
|
1878
|
-
}
|
|
1879
|
-
]
|
|
1880
|
-
}
|
|
1881
|
-
]), r = h(() => {
|
|
1882
|
-
const m = (e.keyword || "").trim(), p = m ? (e.flatMenus || []).filter((d) => d.title?.includes(m)) : [];
|
|
1883
|
-
return [
|
|
1884
|
-
{
|
|
1885
|
-
id: Me,
|
|
1886
|
-
title: "搜索",
|
|
1887
|
-
icon: Xe,
|
|
1888
|
-
children: p?.length ? p : [
|
|
1889
|
-
{
|
|
1890
|
-
id: Me + "empty",
|
|
1891
|
-
disabled: !0,
|
|
1892
|
-
title: "查询匹配不到菜单项"
|
|
1893
|
-
}
|
|
1894
|
-
]
|
|
1895
|
-
}
|
|
1896
|
-
];
|
|
1897
|
-
}), i = (m) => {
|
|
1898
|
-
l("select", m);
|
|
1899
|
-
};
|
|
1900
|
-
return (m, p) => (u(), E(Z, null, [
|
|
1901
|
-
J(k(n($), {
|
|
1902
|
-
class: "x-mask-menu",
|
|
1903
|
-
grow: "",
|
|
1904
|
-
flex: !1,
|
|
1905
|
-
overflow: "auto"
|
|
1906
|
-
}, {
|
|
1907
|
-
default: f(() => [
|
|
1908
|
-
J(k(n(ne), {
|
|
1909
|
-
subMenu: {
|
|
1910
|
-
popperClass: "x-mask-menu-popper",
|
|
1911
|
-
teleported: !0,
|
|
1912
|
-
showTimeout: 200,
|
|
1913
|
-
hideTimeout: 200
|
|
1914
|
-
},
|
|
1915
|
-
data: o.value,
|
|
1916
|
-
"default-icon": n(re),
|
|
1917
|
-
collapse: !0,
|
|
1918
|
-
"collapse-transition": !1,
|
|
1919
|
-
"default-active": s.value,
|
|
1920
|
-
onSelect: i
|
|
1921
|
-
}, null, 8, ["data", "default-icon", "default-active"]), [
|
|
1922
|
-
[ee, e.collapse]
|
|
1923
|
-
]),
|
|
1924
|
-
J(k(n(ne), {
|
|
1925
|
-
subMenu: {
|
|
1926
|
-
popperClass: "x-mask-menu-popper",
|
|
1927
|
-
teleported: !0
|
|
1928
|
-
},
|
|
1929
|
-
data: o.value,
|
|
1930
|
-
"default-icon": n(re),
|
|
1931
|
-
collapse: !1,
|
|
1932
|
-
"collapse-transition": !1,
|
|
1933
|
-
"default-active": s.value,
|
|
1934
|
-
onSelect: i
|
|
1935
|
-
}, null, 8, ["data", "default-icon", "default-active"]), [
|
|
1936
|
-
[ee, !e.collapse]
|
|
1937
|
-
]),
|
|
1938
|
-
o.value.length ? y("", !0) : (u(), g(n(to), {
|
|
1939
|
-
key: 0,
|
|
1940
|
-
description: "暂无菜单数据"
|
|
1941
|
-
}))
|
|
1942
|
-
]),
|
|
1943
|
-
_: 1
|
|
1944
|
-
}, 512), [
|
|
1945
|
-
[ee, !e.favorite && !e.keyword]
|
|
1946
|
-
]),
|
|
1947
|
-
J(k(n($), {
|
|
1948
|
-
class: "x-mask-menu",
|
|
1949
|
-
grow: "",
|
|
1950
|
-
flex: !1,
|
|
1951
|
-
overflow: "auto"
|
|
1952
|
-
}, {
|
|
1953
|
-
default: f(() => [
|
|
1954
|
-
J(k(n(ne), {
|
|
1955
|
-
class: "x-mask-menu__favorites",
|
|
1956
|
-
subMenu: {
|
|
1957
|
-
popperClass: "x-mask-menu-popper",
|
|
1958
|
-
teleported: !0,
|
|
1959
|
-
showTimeout: 200,
|
|
1960
|
-
hideTimeout: 200
|
|
1961
|
-
},
|
|
1962
|
-
data: c.value,
|
|
1963
|
-
"default-icon": n(re),
|
|
1964
|
-
collapse: !0,
|
|
1965
|
-
"collapse-transition": !1,
|
|
1966
|
-
"default-active": s.value,
|
|
1967
|
-
"default-openeds": [Ee],
|
|
1968
|
-
onSelect: i
|
|
1969
|
-
}, null, 8, ["data", "default-icon", "default-active", "default-openeds"]), [
|
|
1970
|
-
[ee, e.collapse]
|
|
1971
|
-
]),
|
|
1972
|
-
J(k(n(ne), {
|
|
1973
|
-
class: "x-mask-menu__favorites",
|
|
1974
|
-
subMenu: {
|
|
1975
|
-
popperClass: "x-mask-menu-popper",
|
|
1976
|
-
teleported: !0,
|
|
1977
|
-
showTimeout: 200,
|
|
1978
|
-
hideTimeout: 200
|
|
1979
|
-
},
|
|
1980
|
-
data: c.value,
|
|
1981
|
-
"default-icon": n(re),
|
|
1982
|
-
collapse: !1,
|
|
1983
|
-
"collapse-transition": !1,
|
|
1984
|
-
"default-active": s.value,
|
|
1985
|
-
"default-openeds": [Ee],
|
|
1986
|
-
onSelect: i
|
|
1987
|
-
}, null, 8, ["data", "default-icon", "default-active", "default-openeds"]), [
|
|
1988
|
-
[ee, !e.collapse]
|
|
1989
|
-
])
|
|
1990
|
-
]),
|
|
1991
|
-
_: 1
|
|
1992
|
-
}, 512), [
|
|
1993
|
-
[ee, e.favorite && !e.keyword]
|
|
1994
|
-
]),
|
|
1995
|
-
e.keyword ? J((u(), g(n($), {
|
|
1996
|
-
key: 0,
|
|
1997
|
-
class: "x-mask-menu",
|
|
1998
|
-
grow: "",
|
|
1999
|
-
flex: !1,
|
|
2000
|
-
overflow: "auto"
|
|
2001
|
-
}, {
|
|
2002
|
-
default: f(() => [
|
|
2003
|
-
J(k(n(ne), {
|
|
2004
|
-
class: "x-mask-menu__search",
|
|
2005
|
-
subMenu: {
|
|
2006
|
-
popperClass: "x-mask-menu-popper",
|
|
2007
|
-
teleported: !0,
|
|
2008
|
-
showTimeout: 200,
|
|
2009
|
-
hideTimeout: 200
|
|
2010
|
-
},
|
|
2011
|
-
data: r.value,
|
|
2012
|
-
"default-icon": n(re),
|
|
2013
|
-
collapse: !0,
|
|
2014
|
-
"collapse-transition": !1,
|
|
2015
|
-
"default-active": s.value,
|
|
2016
|
-
"default-openeds": [Me],
|
|
2017
|
-
onSelect: i
|
|
2018
|
-
}, null, 8, ["data", "default-icon", "default-active", "default-openeds"]), [
|
|
2019
|
-
[ee, e.collapse]
|
|
2020
|
-
]),
|
|
2021
|
-
J(k(n(ne), {
|
|
2022
|
-
class: "x-mask-menu__search",
|
|
2023
|
-
subMenu: {
|
|
2024
|
-
popperClass: "x-mask-menu-popper",
|
|
2025
|
-
teleported: !0,
|
|
2026
|
-
showTimeout: 200,
|
|
2027
|
-
hideTimeout: 200
|
|
2028
|
-
},
|
|
2029
|
-
data: r.value,
|
|
2030
|
-
"default-icon": n(re),
|
|
2031
|
-
collapse: !1,
|
|
2032
|
-
"collapse-transition": !1,
|
|
2033
|
-
"default-active": s.value,
|
|
2034
|
-
"default-openeds": [Me],
|
|
2035
|
-
onSelect: i
|
|
2036
|
-
}, null, 8, ["data", "default-icon", "default-active", "default-openeds"]), [
|
|
2037
|
-
[ee, !e.collapse]
|
|
2038
|
-
])
|
|
2039
|
-
]),
|
|
2040
|
-
_: 1
|
|
2041
|
-
}, 512)), [
|
|
2042
|
-
[ee, !!e.keyword]
|
|
2043
|
-
]) : y("", !0)
|
|
2044
|
-
], 64));
|
|
2045
|
-
}
|
|
2046
|
-
}), Nn = { class: "x-mask-tabs__trigger" }, Xn = { key: 1 }, Un = ["onDragstart", "onDragend"], Hn = { key: 1 }, Wn = /* @__PURE__ */ M({
|
|
2047
|
-
__name: "Tabs",
|
|
2048
|
-
props: {
|
|
2049
|
-
tabs: {},
|
|
2050
|
-
home: {},
|
|
2051
|
-
isActiveTab: { type: Function },
|
|
2052
|
-
value: {},
|
|
2053
|
-
favorites: {}
|
|
2054
|
-
},
|
|
2055
|
-
emits: ["click", "remove", "refresh", "toggleFavorite", "dialog"],
|
|
2056
|
-
setup(a, { emit: t }) {
|
|
2057
|
-
const e = a, o = t, l = (p) => {
|
|
2058
|
-
const d = !!e.favorites.find(
|
|
2059
|
-
(b) => b === p.menu || b.id === p.menu?.id
|
|
2060
|
-
);
|
|
2061
|
-
return [
|
|
2062
|
-
{
|
|
2063
|
-
icon: zo,
|
|
2064
|
-
label: "刷新",
|
|
2065
|
-
name: "refresh",
|
|
2066
|
-
value: p
|
|
2067
|
-
},
|
|
2068
|
-
"|",
|
|
2069
|
-
{
|
|
2070
|
-
icon: d ? vt : _t,
|
|
2071
|
-
label: "收藏",
|
|
2072
|
-
name: "favorite",
|
|
2073
|
-
value: p.menu,
|
|
2074
|
-
disabled: !p.menu
|
|
2075
|
-
},
|
|
2076
|
-
"|",
|
|
2077
|
-
{
|
|
2078
|
-
icon: Co,
|
|
2079
|
-
label: "弹窗",
|
|
2080
|
-
name: "dialog",
|
|
2081
|
-
value: p
|
|
2082
|
-
}
|
|
2083
|
-
];
|
|
2084
|
-
}, s = (p) => {
|
|
2085
|
-
const d = p.paneName;
|
|
2086
|
-
if (d === e.home.id) {
|
|
2087
|
-
o("click", e.home);
|
|
2088
|
-
return;
|
|
2089
|
-
}
|
|
2090
|
-
const b = e.tabs.find((S) => S.id === d);
|
|
2091
|
-
b && o("click", b);
|
|
2092
|
-
}, c = (p) => {
|
|
2093
|
-
const d = e.tabs.find((b) => b.id === p);
|
|
2094
|
-
d && o("remove", d);
|
|
2095
|
-
}, r = (p) => {
|
|
2096
|
-
switch (p.name) {
|
|
2097
|
-
case "refresh":
|
|
2098
|
-
o("refresh", p.value);
|
|
2099
|
-
break;
|
|
2100
|
-
case "favorite":
|
|
2101
|
-
o("toggleFavorite", p.value);
|
|
2102
|
-
break;
|
|
2103
|
-
case "dialog":
|
|
2104
|
-
o("dialog", p.value);
|
|
2105
|
-
break;
|
|
2106
|
-
}
|
|
2107
|
-
}, i = (p, d) => {
|
|
2108
|
-
d.dataTransfer && (d.dataTransfer.setData("tab", p.id), d.target && d.target.classList.add("is-dagging"));
|
|
2109
|
-
}, m = (p, d) => {
|
|
2110
|
-
d.target && d.target.classList.remove("is-dagging");
|
|
2111
|
-
};
|
|
2112
|
-
return (p, d) => (u(), g(n($), {
|
|
2113
|
-
ref: "tabsRef",
|
|
2114
|
-
class: "x-mask-tabs",
|
|
2115
|
-
height: "100%",
|
|
2116
|
-
grow: "",
|
|
2117
|
-
flex: "",
|
|
2118
|
-
justify: "flex-end",
|
|
2119
|
-
direction: "column"
|
|
2120
|
-
}, {
|
|
2121
|
-
default: f(() => [
|
|
2122
|
-
k(n(gt), {
|
|
2123
|
-
type: "card",
|
|
2124
|
-
"model-value": e.value,
|
|
2125
|
-
onTabRemove: c,
|
|
2126
|
-
onTabClick: s
|
|
2127
|
-
}, {
|
|
2128
|
-
default: f(() => [
|
|
2129
|
-
e.home ? (u(), g(n(Ne), {
|
|
2130
|
-
key: 0,
|
|
2131
|
-
name: e.home.id
|
|
2132
|
-
}, {
|
|
2133
|
-
label: f(() => [
|
|
2134
|
-
R("div", Nn, [
|
|
2135
|
-
e.home.icon ? (u(), g(W(n(he)(e.home.icon)), { key: 0 })) : y("", !0),
|
|
2136
|
-
e.home.title ? (u(), E("span", Xn, F(e.home.title), 1)) : y("", !0)
|
|
2137
|
-
])
|
|
2138
|
-
]),
|
|
2139
|
-
_: 1
|
|
2140
|
-
}, 8, ["name"])) : y("", !0),
|
|
2141
|
-
(u(!0), E(Z, null, se(e.tabs, (b) => (u(), g(n(Ne), {
|
|
2142
|
-
key: b.id,
|
|
2143
|
-
name: b.id,
|
|
2144
|
-
lazy: "",
|
|
2145
|
-
closable: ""
|
|
2146
|
-
}, {
|
|
2147
|
-
label: f(() => [
|
|
2148
|
-
k(n(yt), {
|
|
2149
|
-
"open-delay": 500,
|
|
2150
|
-
placement: "bottom",
|
|
2151
|
-
trigger: "hover",
|
|
2152
|
-
width: "200px",
|
|
2153
|
-
disabled: b.id !== e.value
|
|
2154
|
-
}, {
|
|
2155
|
-
reference: f(() => [
|
|
2156
|
-
R("div", {
|
|
2157
|
-
class: "x-mask-tabs__trigger",
|
|
2158
|
-
draggable: "true",
|
|
2159
|
-
onDragstart: (S) => i(b, S),
|
|
2160
|
-
onDragend: (S) => m(b, S)
|
|
2161
|
-
}, [
|
|
2162
|
-
b.icon ? (u(), g(W(n(he)(b.icon)), { key: 0 })) : y("", !0),
|
|
2163
|
-
b.title ? (u(), E("span", Hn, F(b.title), 1)) : y("", !0)
|
|
2164
|
-
], 40, Un)
|
|
2165
|
-
]),
|
|
2166
|
-
default: f(() => [
|
|
2167
|
-
k(n(Pe), {
|
|
2168
|
-
items: l(b),
|
|
2169
|
-
mode: "text",
|
|
2170
|
-
size: "small",
|
|
2171
|
-
type: "info",
|
|
2172
|
-
onClick: r
|
|
2173
|
-
}, null, 8, ["items"])
|
|
2174
|
-
]),
|
|
2175
|
-
_: 2
|
|
2176
|
-
}, 1032, ["disabled"])
|
|
2177
|
-
]),
|
|
2178
|
-
_: 2
|
|
2179
|
-
}, 1032, ["name"]))), 128))
|
|
2180
|
-
]),
|
|
2181
|
-
_: 1
|
|
2182
|
-
}, 8, ["model-value"])
|
|
2183
|
-
]),
|
|
2184
|
-
_: 1
|
|
2185
|
-
}, 512));
|
|
2186
|
-
}
|
|
2187
|
-
}), Ln = /* @__PURE__ */ M({
|
|
2188
|
-
__name: "ThemeSwitch",
|
|
2189
|
-
setup(a) {
|
|
2190
|
-
const t = jo();
|
|
2191
|
-
return (e, o) => (u(), g(n(We), {
|
|
2192
|
-
class: "x-mask-theme-switch",
|
|
2193
|
-
modelValue: n(t),
|
|
2194
|
-
"onUpdate:modelValue": o[0] || (o[0] = (l) => $e(t) ? t.value = l : null),
|
|
2195
|
-
size: "default",
|
|
2196
|
-
"active-action-icon": n(To),
|
|
2197
|
-
"inactive-action-icon": n(Eo)
|
|
2198
|
-
}, null, 8, ["modelValue", "active-action-icon", "inactive-action-icon"]));
|
|
2199
|
-
}
|
|
2200
|
-
}), Kn = { class: "x-mask-toolbar__menu-item" }, Qn = /* @__PURE__ */ M({
|
|
2201
|
-
__name: "Toolbar",
|
|
2202
|
-
props: {
|
|
2203
|
-
tabs: { default: () => [] },
|
|
2204
|
-
actions: {},
|
|
2205
|
-
theme: { type: Boolean }
|
|
2206
|
-
},
|
|
2207
|
-
emits: [
|
|
2208
|
-
"closeOtherTabs",
|
|
2209
|
-
"closeAllTabs",
|
|
2210
|
-
"closeTab",
|
|
2211
|
-
"clickTab",
|
|
2212
|
-
"actionClick",
|
|
2213
|
-
"actionCommand"
|
|
2214
|
-
],
|
|
2215
|
-
setup(a, { emit: t }) {
|
|
2216
|
-
const e = a, o = t, l = h(() => {
|
|
2217
|
-
const m = e.tabs.map((p, d) => ({
|
|
2218
|
-
divided: d === 0,
|
|
2219
|
-
label: p.title,
|
|
2220
|
-
command: p
|
|
2221
|
-
}));
|
|
2222
|
-
return [
|
|
2223
|
-
{
|
|
2224
|
-
label: "关闭其他",
|
|
2225
|
-
command: "other"
|
|
2226
|
-
},
|
|
2227
|
-
{
|
|
2228
|
-
label: "关闭全部",
|
|
2229
|
-
command: "all"
|
|
2230
|
-
},
|
|
2231
|
-
...m
|
|
2232
|
-
];
|
|
2233
|
-
}), s = (m) => {
|
|
2234
|
-
o("closeTab", m.command);
|
|
2235
|
-
}, c = (m) => {
|
|
2236
|
-
switch (m.command) {
|
|
2237
|
-
case "all":
|
|
2238
|
-
o("closeAllTabs");
|
|
2239
|
-
break;
|
|
2240
|
-
case "other":
|
|
2241
|
-
o("closeOtherTabs");
|
|
2242
|
-
break;
|
|
2243
|
-
default:
|
|
2244
|
-
o("clickTab", m.command);
|
|
2245
|
-
break;
|
|
2246
|
-
}
|
|
2247
|
-
}, r = (m) => {
|
|
2248
|
-
o("actionClick", m);
|
|
2249
|
-
}, i = (m, p) => {
|
|
2250
|
-
o("actionCommand", m, p);
|
|
2251
|
-
};
|
|
2252
|
-
return (m, p) => (u(), g(n($), {
|
|
2253
|
-
class: "x-mask-toolbar",
|
|
2254
|
-
align: "center"
|
|
2255
|
-
}, {
|
|
2256
|
-
default: f(() => [
|
|
2257
|
-
k(n(Y), {
|
|
2258
|
-
icon: n(Mo),
|
|
2259
|
-
menus: l.value,
|
|
2260
|
-
dropdown: { size: "small" },
|
|
2261
|
-
mode: "icon",
|
|
2262
|
-
circle: "",
|
|
2263
|
-
background: "hover",
|
|
2264
|
-
onCommand: c
|
|
2265
|
-
}, {
|
|
2266
|
-
item: f(({ item: d }) => [
|
|
2267
|
-
R("span", Kn, [
|
|
2268
|
-
N(F(d.label) + " ", 1),
|
|
2269
|
-
["other", "all"].includes(d.command) ? y("", !0) : (u(), g(n(ae), {
|
|
2270
|
-
key: 0,
|
|
2271
|
-
onClick: Xt((b) => s(d), ["stop"]),
|
|
2272
|
-
icon: n(bt)
|
|
2273
|
-
}, null, 8, ["onClick", "icon"]))
|
|
2274
|
-
])
|
|
2275
|
-
]),
|
|
2276
|
-
_: 1
|
|
2277
|
-
}, 8, ["icon", "menus"]),
|
|
2278
|
-
k(n(xe), { direction: "vertical" }),
|
|
2279
|
-
e.actions ? (u(), g(n(Pe), {
|
|
2280
|
-
key: 0,
|
|
2281
|
-
circle: "",
|
|
2282
|
-
mode: "icon",
|
|
2283
|
-
size: "default",
|
|
2284
|
-
background: "hover",
|
|
2285
|
-
items: m.actions,
|
|
2286
|
-
onClick: r,
|
|
2287
|
-
onCommand: i
|
|
2288
|
-
}, null, 8, ["items"])) : y("", !0),
|
|
2289
|
-
e.actions ? (u(), g(n(xe), {
|
|
2290
|
-
key: 1,
|
|
2291
|
-
direction: "vertical"
|
|
2292
|
-
})) : y("", !0),
|
|
2293
|
-
e.theme ? (u(), g(Ln, { key: 2 })) : y("", !0),
|
|
2294
|
-
e.theme ? (u(), g(n(xe), {
|
|
2295
|
-
key: 3,
|
|
2296
|
-
direction: "vertical"
|
|
2297
|
-
})) : y("", !0),
|
|
2298
|
-
_(m.$slots, "default")
|
|
2299
|
-
]),
|
|
2300
|
-
_: 3
|
|
2301
|
-
}));
|
|
2302
|
-
}
|
|
2303
|
-
}), Zn = /* @__PURE__ */ M({
|
|
2304
|
-
__name: "Avatar",
|
|
2305
|
-
props: {
|
|
2306
|
-
avatar: {}
|
|
2307
|
-
},
|
|
2308
|
-
setup(a) {
|
|
2309
|
-
const t = a;
|
|
2310
|
-
return (e, o) => (u(), g(n(yt), {
|
|
2311
|
-
width: 200,
|
|
2312
|
-
"popper-class": "x-mask-avatar__popper",
|
|
2313
|
-
disabled: !e.$slots.default
|
|
2314
|
-
}, {
|
|
2315
|
-
reference: f(() => [
|
|
2316
|
-
k(n(oo), {
|
|
2317
|
-
class: "x-mask-avatar",
|
|
2318
|
-
shape: "circle",
|
|
2319
|
-
icon: n($o),
|
|
2320
|
-
src: t.avatar,
|
|
2321
|
-
size: 26
|
|
2322
|
-
}, null, 8, ["icon", "src"])
|
|
2323
|
-
]),
|
|
2324
|
-
default: f(() => [
|
|
2325
|
-
e.$slots.default ? _(e.$slots, "default", { key: 0 }) : y("", !0)
|
|
2326
|
-
]),
|
|
2327
|
-
_: 3
|
|
2328
|
-
}, 8, ["disabled"]));
|
|
2329
|
-
}
|
|
2330
|
-
}), rt = /* @__PURE__ */ M({
|
|
2331
|
-
__name: "Content",
|
|
2332
|
-
props: {
|
|
2333
|
-
createView: { type: Function },
|
|
2334
|
-
exclude: {}
|
|
2335
|
-
},
|
|
2336
|
-
setup(a) {
|
|
2337
|
-
const t = a;
|
|
2338
|
-
return (e, o) => (u(), g(n($), {
|
|
2339
|
-
class: "x-mask__content",
|
|
2340
|
-
flex: !1,
|
|
2341
|
-
grow: "",
|
|
2342
|
-
padding: !1
|
|
2343
|
-
}, {
|
|
2344
|
-
default: f(() => [
|
|
2345
|
-
_(e.$slots, "default"),
|
|
2346
|
-
k(n(kt), null, {
|
|
2347
|
-
default: f(({ Component: l, route: s }) => [
|
|
2348
|
-
(u(), g(Ut, {
|
|
2349
|
-
exclude: t.exclude
|
|
2350
|
-
}, [
|
|
2351
|
-
l ? (u(), g(W(t.createView(l, s)), {
|
|
2352
|
-
key: s.fullPath
|
|
2353
|
-
})) : y("", !0)
|
|
2354
|
-
], 1032, ["exclude"]))
|
|
2355
|
-
]),
|
|
2356
|
-
_: 1
|
|
2357
|
-
})
|
|
2358
|
-
]),
|
|
2359
|
-
_: 3
|
|
2360
|
-
}));
|
|
2361
|
-
}
|
|
2362
|
-
}), Jn = 140, Gn = {
|
|
2363
|
-
/**
|
|
2364
|
-
* 系统logo
|
|
2365
|
-
*/
|
|
2366
|
-
logo: {
|
|
2367
|
-
type: String,
|
|
2368
|
-
default: zt
|
|
2369
|
-
},
|
|
2370
|
-
/**
|
|
2371
|
-
* 系统标题
|
|
2372
|
-
*/
|
|
2373
|
-
title: {
|
|
2374
|
-
type: String,
|
|
2375
|
-
default: "VTJ.PRO"
|
|
2376
|
-
},
|
|
2377
|
-
/**
|
|
2378
|
-
* 菜单项数据
|
|
2379
|
-
*/
|
|
2380
|
-
menus: {
|
|
2381
|
-
type: [Array, Function],
|
|
2382
|
-
default() {
|
|
2383
|
-
return [];
|
|
2384
|
-
}
|
|
2385
|
-
},
|
|
2386
|
-
/**
|
|
2387
|
-
* 收藏菜单项
|
|
2388
|
-
*/
|
|
2389
|
-
favorites: {
|
|
2390
|
-
type: [Array, Function],
|
|
2391
|
-
default() {
|
|
2392
|
-
return [];
|
|
2393
|
-
}
|
|
2394
|
-
},
|
|
2395
|
-
/**
|
|
2396
|
-
* 菜单项数据适配函数,用作转换菜单项数据
|
|
2397
|
-
*/
|
|
2398
|
-
menuAdapter: {
|
|
2399
|
-
type: Function
|
|
2400
|
-
},
|
|
2401
|
-
/**
|
|
2402
|
-
* 主页Tab配置
|
|
2403
|
-
*/
|
|
2404
|
-
home: {
|
|
2405
|
-
type: [String, Object],
|
|
2406
|
-
default: "/"
|
|
2407
|
-
},
|
|
2408
|
-
/**
|
|
2409
|
-
* 最大tabs数量
|
|
2410
|
-
*/
|
|
2411
|
-
tabs: {
|
|
2412
|
-
type: Number,
|
|
2413
|
-
default: 20
|
|
2414
|
-
},
|
|
2415
|
-
/**
|
|
2416
|
-
* 右上角工具条配置
|
|
2417
|
-
*/
|
|
2418
|
-
actions: {
|
|
2419
|
-
type: Array
|
|
2420
|
-
},
|
|
2421
|
-
/**
|
|
2422
|
-
* 用户头像图片url
|
|
2423
|
-
*/
|
|
2424
|
-
avatar: {
|
|
2425
|
-
type: String
|
|
2426
|
-
},
|
|
2427
|
-
/**
|
|
2428
|
-
* 开启主题切换
|
|
2429
|
-
*/
|
|
2430
|
-
theme: {
|
|
2431
|
-
type: Boolean
|
|
2432
|
-
},
|
|
2433
|
-
/**
|
|
2434
|
-
* 禁用框架容器
|
|
2435
|
-
*/
|
|
2436
|
-
disabled: {
|
|
2437
|
-
type: Boolean
|
|
2438
|
-
},
|
|
2439
|
-
addFavorite: {
|
|
2440
|
-
type: Function
|
|
2441
|
-
},
|
|
2442
|
-
removeFavorite: {
|
|
2443
|
-
type: Function
|
|
2444
|
-
}
|
|
2445
|
-
}, Bt = Symbol(), It = Symbol();
|
|
2446
|
-
function Yn(a) {
|
|
2447
|
-
const t = D(!1), e = D(""), o = D(!1);
|
|
2448
|
-
return {
|
|
2449
|
-
collapsed: t,
|
|
2450
|
-
keyword: e,
|
|
2451
|
-
favorite: o
|
|
2452
|
-
};
|
|
2453
|
-
}
|
|
2454
|
-
function qn(a) {
|
|
2455
|
-
const t = xt();
|
|
2456
|
-
return h(() => {
|
|
2457
|
-
const e = a.home;
|
|
2458
|
-
return Object.assign(
|
|
2459
|
-
{ id: t, url: "/", name: "MaskHome", icon: Bo, closable: !1 },
|
|
2460
|
-
typeof e == "string" ? { url: e } : e || {}
|
|
2461
|
-
);
|
|
2462
|
-
});
|
|
2463
|
-
}
|
|
2464
|
-
function At(a, t) {
|
|
2465
|
-
let e = [];
|
|
2466
|
-
return a.forEach((o) => {
|
|
2467
|
-
o = t ? t(o) : o, o.children ? e = e.concat(At(o.children, t)) : e.push(o);
|
|
2468
|
-
}), e;
|
|
2469
|
-
}
|
|
2470
|
-
function ea(a, t) {
|
|
2471
|
-
const e = Ae(), o = qe([]), l = qe([]), s = h(() => At(o.value, a.menuAdapter)), c = h(() => Xo(s.value, "id")), r = D(null), i = (w) => {
|
|
2472
|
-
const P = typeof w == "object" ? w.id : w, x = c.value.get(P);
|
|
2473
|
-
if (!x) {
|
|
2474
|
-
console.warn("找不到菜单", w);
|
|
2475
|
-
return;
|
|
2476
|
-
}
|
|
2477
|
-
const { type: T = "route", url: v, title: I, icon: A } = x;
|
|
2478
|
-
if (!v) {
|
|
2479
|
-
r.value = x, t("select", x);
|
|
2480
|
-
return;
|
|
2481
|
-
}
|
|
2482
|
-
if (T === "route") {
|
|
2483
|
-
Uo(v) || v.startsWith("//") ? window.open(v) : (r.value = x, e.push(v).catch((U) => U));
|
|
2484
|
-
return;
|
|
2485
|
-
}
|
|
2486
|
-
if (T === "window") {
|
|
2487
|
-
window.open(v);
|
|
2488
|
-
return;
|
|
2489
|
-
}
|
|
2490
|
-
T === "dialog" && Ge({
|
|
2491
|
-
resizable: !0,
|
|
2492
|
-
bodyPadding: !1,
|
|
2493
|
-
width: "80%",
|
|
2494
|
-
height: "80%",
|
|
2495
|
-
title: I,
|
|
2496
|
-
icon: A,
|
|
2497
|
-
src: v
|
|
2498
|
-
});
|
|
2499
|
-
}, m = async () => {
|
|
2500
|
-
o.value = typeof a.menus == "function" ? await a.menus() || [] : a.menus ?? [], l.value = typeof a.favorites == "function" ? await a.favorites() || [] : a.favorites ?? [];
|
|
2501
|
-
}, p = (w) => {
|
|
2502
|
-
l.value = [w, ...l.value], a.addFavorite && a.addFavorite(w);
|
|
2503
|
-
}, d = (w) => {
|
|
2504
|
-
l.value = l.value.filter((P) => P.id !== w.id), a.removeFavorite && a.removeFavorite(w);
|
|
2505
|
-
}, b = (w) => !!l.value.find((P) => P === w || P.id === w.id), S = (w) => {
|
|
2506
|
-
b(w) ? d(w) : p(w);
|
|
2507
|
-
};
|
|
2508
|
-
return pt(m), {
|
|
2509
|
-
menus: o,
|
|
2510
|
-
favorites: l,
|
|
2511
|
-
flatMenus: s,
|
|
2512
|
-
active: r,
|
|
2513
|
-
select: i,
|
|
2514
|
-
toggleFavorite: S
|
|
2515
|
-
};
|
|
2516
|
-
}
|
|
2517
|
-
function ta(a, t, e, o, l) {
|
|
2518
|
-
const s = Le(), c = Ae(), r = {}, i = D([]), m = D(), { width: p } = wt(m), d = h(() => Math.floor(p.value / Jn)), b = h(
|
|
2519
|
-
() => i.value.slice(0, d.value).filter((C) => !C.dialog)
|
|
2520
|
-
), S = h(() => i.value.slice(d.value)), w = (C) => e.value.find((B) => B.url === C), P = (C) => s.fullPath === C.url, x = (C) => l.value.id === C ? l.value : i.value.find((B) => B.id === C), T = D(""), v = h(() => x(T.value)), I = (C) => {
|
|
2521
|
-
c.push(C.url).catch((B) => B);
|
|
2522
|
-
}, A = (C) => {
|
|
2523
|
-
T.value = C.id, s.fullPath !== C.url && I(C);
|
|
2524
|
-
}, U = () => {
|
|
2525
|
-
I(l.value);
|
|
2526
|
-
}, z = (C) => {
|
|
2527
|
-
const B = i.value.find((V) => V.url === C.url || V.id === C.id);
|
|
2528
|
-
B ? A(B) : (i.value.unshift(C), A(C));
|
|
2529
|
-
}, H = async (C) => {
|
|
2530
|
-
const { url: B = s.fullPath, icon: V, title: ze = "新建标签页" } = C || {}, Ce = r[B], Ve = xt(), De = St(B);
|
|
2531
|
-
return {
|
|
2532
|
-
id: Ve,
|
|
2533
|
-
name: De,
|
|
2534
|
-
url: B,
|
|
2535
|
-
icon: V,
|
|
2536
|
-
title: ze,
|
|
2537
|
-
closable: !0,
|
|
2538
|
-
menu: C,
|
|
2539
|
-
...Ce ? await Ce() : {}
|
|
2540
|
-
};
|
|
2541
|
-
}, X = async (C) => {
|
|
2542
|
-
if (await Re.confirm("是否关闭页签", "提示", {
|
|
2543
|
-
type: "warning"
|
|
2544
|
-
}).catch((V) => !1)) {
|
|
2545
|
-
if (i.value = i.value.filter((V) => V.id !== C.id), T.value === C.id) {
|
|
2546
|
-
const V = i.value[0];
|
|
2547
|
-
I(V || l.value);
|
|
2548
|
-
}
|
|
2549
|
-
return C;
|
|
2550
|
-
}
|
|
2551
|
-
}, le = (C) => {
|
|
2552
|
-
const B = i.value.findIndex((V) => V.id === C.id);
|
|
2553
|
-
if (B >= 0) {
|
|
2554
|
-
const V = i.value[B];
|
|
2555
|
-
i.value.splice(B, 1, Object.assign(V, C));
|
|
2556
|
-
}
|
|
2557
|
-
}, _e = async () => {
|
|
2558
|
-
if (!await Re.confirm("是否关闭全部页签", "提示", {
|
|
2559
|
-
type: "warning"
|
|
2560
|
-
}).catch((V) => !1))
|
|
2561
|
-
return;
|
|
2562
|
-
const B = i.value;
|
|
2563
|
-
return i.value = [], A(l.value), B;
|
|
2564
|
-
}, K = async () => {
|
|
2565
|
-
if (!await Re.confirm("是否关闭其他页签", "提示", {
|
|
2566
|
-
type: "warning"
|
|
2567
|
-
}).catch((V) => !1))
|
|
2568
|
-
return;
|
|
2569
|
-
const B = i.value.filter((V) => V.id !== T.value);
|
|
2570
|
-
return i.value = i.value.filter((V) => V.id === T.value), B;
|
|
2571
|
-
}, G = (C) => {
|
|
2572
|
-
const B = i.value.filter((V) => V.id !== C.id);
|
|
2573
|
-
i.value = [C, ...B], A(C);
|
|
2574
|
-
}, ie = async () => {
|
|
2575
|
-
await me();
|
|
2576
|
-
const C = l.value.url === s.fullPath, B = w(s.fullPath);
|
|
2577
|
-
if (C)
|
|
2578
|
-
T.value = l.value.id;
|
|
2579
|
-
else {
|
|
2580
|
-
const V = await H(B);
|
|
2581
|
-
z(V);
|
|
2582
|
-
}
|
|
2583
|
-
await me(), o.value = B || null;
|
|
2584
|
-
};
|
|
2585
|
-
return L(e, ie), L(s, ie, { immediate: !0 }), Se(Bt, r), {
|
|
2586
|
-
tabRef: m,
|
|
2587
|
-
tabs: i,
|
|
2588
|
-
showTabs: b,
|
|
2589
|
-
currentTab: v,
|
|
2590
|
-
changeTab: I,
|
|
2591
|
-
removeTab: X,
|
|
2592
|
-
updateTab: le,
|
|
2593
|
-
addTab: z,
|
|
2594
|
-
home: l,
|
|
2595
|
-
tabValue: T,
|
|
2596
|
-
isCurrentTab: P,
|
|
2597
|
-
activeHome: U,
|
|
2598
|
-
activeTab: A,
|
|
2599
|
-
dropdownTabs: S,
|
|
2600
|
-
removeAllTabs: _e,
|
|
2601
|
-
removeOtherTabs: K,
|
|
2602
|
-
moveToShow: G
|
|
2603
|
-
};
|
|
2604
|
-
}
|
|
2605
|
-
function oa(a) {
|
|
2606
|
-
const t = /* @__PURE__ */ new Map(), e = D([]), o = He({}), l = {}, { updateTab: s, isCurrentTab: c, activeHome: r, tabs: i } = a, m = (v, I) => {
|
|
2607
|
-
const A = I.fullPath;
|
|
2608
|
-
if (t.has(A))
|
|
2609
|
-
return t.get(A);
|
|
2610
|
-
{
|
|
2611
|
-
const U = St(A), z = {
|
|
2612
|
-
name: U,
|
|
2613
|
-
setup() {
|
|
2614
|
-
const H = h(() => o[A] || document.body), X = h(() => !o[A]), le = h(() => !e.value.includes(U));
|
|
2615
|
-
return Se(
|
|
2616
|
-
Ao,
|
|
2617
|
-
pe({ ...I })
|
|
2618
|
-
), () => le.value ? te(
|
|
2619
|
-
mt,
|
|
2620
|
-
{
|
|
2621
|
-
to: H.value,
|
|
2622
|
-
disabled: X.value
|
|
2623
|
-
},
|
|
2624
|
-
[te(v)]
|
|
2625
|
-
) : null;
|
|
2626
|
-
}
|
|
2627
|
-
};
|
|
2628
|
-
return t.set(A, z), z;
|
|
2629
|
-
}
|
|
2630
|
-
}, p = (v) => {
|
|
2631
|
-
v.dialog = void 0, delete o[v.url];
|
|
2632
|
-
const I = l[v.id];
|
|
2633
|
-
I && (I.destroy(), delete l[v.id], s(v));
|
|
2634
|
-
}, d = (v = []) => {
|
|
2635
|
-
v.forEach((I) => {
|
|
2636
|
-
p(I);
|
|
2637
|
-
});
|
|
2638
|
-
}, b = async (v) => {
|
|
2639
|
-
v.dialog = {
|
|
2640
|
-
...v.dialog,
|
|
2641
|
-
onMinimized: () => {
|
|
2642
|
-
p(v);
|
|
2643
|
-
},
|
|
2644
|
-
onClose: async () => {
|
|
2645
|
-
p(v), i.value = i.value.filter((A) => A.id !== v.id);
|
|
2646
|
-
}
|
|
2647
|
-
}, s(v);
|
|
2648
|
-
const I = Ge({
|
|
2649
|
-
title: v.title,
|
|
2650
|
-
icon: v.icon,
|
|
2651
|
-
modal: !1,
|
|
2652
|
-
resizable: !0,
|
|
2653
|
-
draggable: !0,
|
|
2654
|
-
...v.dialog,
|
|
2655
|
-
onOpen(A) {
|
|
2656
|
-
o[v.url] = A.refs.panelRef?.bodyRef?.$el;
|
|
2657
|
-
}
|
|
2658
|
-
});
|
|
2659
|
-
return await me(), c(v) && r(), l[v.id] = I, I;
|
|
2660
|
-
}, S = async (v) => {
|
|
2661
|
-
e.value = [v.name], await me(), e.value = [];
|
|
2662
|
-
}, w = async (v) => {
|
|
2663
|
-
e.value = v.map((I) => I.name), await me(), e.value = [];
|
|
2664
|
-
}, P = (v) => (v.preventDefault(), !1), x = (v) => {
|
|
2665
|
-
if (v.dataTransfer) {
|
|
2666
|
-
const I = v.dataTransfer.getData("tab"), A = i.value.find((U) => U.id === I);
|
|
2667
|
-
if (A) {
|
|
2668
|
-
const { clientX: U, clientY: z } = v;
|
|
2669
|
-
A.dialog = {
|
|
2670
|
-
left: U,
|
|
2671
|
-
top: z
|
|
2672
|
-
}, b(A);
|
|
2673
|
-
}
|
|
2674
|
-
}
|
|
2675
|
-
}, T = (v) => !!o[v];
|
|
2676
|
-
return Ie(document, "dragover", P), Ie(document, "drop", x), {
|
|
2677
|
-
createView: m,
|
|
2678
|
-
openDialog: b,
|
|
2679
|
-
refresh: S,
|
|
2680
|
-
exclude: e,
|
|
2681
|
-
cleanCache: w,
|
|
2682
|
-
hasDialog: T,
|
|
2683
|
-
closeDialog: p,
|
|
2684
|
-
closeDialogs: d
|
|
2685
|
-
};
|
|
2686
|
-
}
|
|
2687
|
-
const na = /* @__PURE__ */ M({
|
|
2688
|
-
name: "XMask",
|
|
2689
|
-
__name: "Mask",
|
|
2690
|
-
props: Gn,
|
|
2691
|
-
emits: ["select", "actionClick", "actionCommand"],
|
|
2692
|
-
setup(a, { emit: t }) {
|
|
2693
|
-
const e = a, o = t, l = qn(e), { collapsed: s, keyword: c, favorite: r } = Yn(), { menus: i, favorites: m, flatMenus: p, active: d, select: b, toggleFavorite: S } = ea(e, o), {
|
|
2694
|
-
tabRef: w,
|
|
2695
|
-
showTabs: P,
|
|
2696
|
-
currentTab: x,
|
|
2697
|
-
changeTab: T,
|
|
2698
|
-
removeTab: v,
|
|
2699
|
-
tabs: I,
|
|
2700
|
-
updateTab: A,
|
|
2701
|
-
isCurrentTab: U,
|
|
2702
|
-
activeHome: z,
|
|
2703
|
-
removeAllTabs: H,
|
|
2704
|
-
removeOtherTabs: X,
|
|
2705
|
-
dropdownTabs: le,
|
|
2706
|
-
moveToShow: _e
|
|
2707
|
-
} = ta(e, o, p, d, l), { createView: K, openDialog: G, refresh: ie, exclude: C, cleanCache: B, closeDialogs: V } = oa({
|
|
2708
|
-
tabs: I,
|
|
2709
|
-
updateTab: A,
|
|
2710
|
-
isCurrentTab: U,
|
|
2711
|
-
activeHome: z
|
|
2712
|
-
}), ze = async (O) => {
|
|
2713
|
-
await v(O) && await B([O]);
|
|
2714
|
-
}, Ce = async () => {
|
|
2715
|
-
const O = await H();
|
|
2716
|
-
O && (V(O), await B(O));
|
|
2717
|
-
}, Ve = async () => {
|
|
2718
|
-
const O = await X();
|
|
2719
|
-
O && (V(O), await B(O));
|
|
2720
|
-
}, De = (O) => {
|
|
2721
|
-
o("actionClick", O);
|
|
2722
|
-
}, Ot = (O, q) => {
|
|
2723
|
-
o("actionCommand", O, q);
|
|
2724
|
-
};
|
|
2725
|
-
return Se(It, {
|
|
2726
|
-
tabs: I,
|
|
2727
|
-
flatMenus: p,
|
|
2728
|
-
favorites: m,
|
|
2729
|
-
updateTab: A,
|
|
2730
|
-
active: d,
|
|
2731
|
-
currentTab: x
|
|
2732
|
-
}), (O, q) => (u(), g(n($), { class: "x-mask" }, {
|
|
2733
|
-
default: f(() => [
|
|
2734
|
-
e.disabled ? (u(), g(rt, {
|
|
2735
|
-
key: 1,
|
|
2736
|
-
createView: n(K),
|
|
2737
|
-
exclude: n(C)
|
|
2738
|
-
}, {
|
|
2739
|
-
default: f(() => [
|
|
2740
|
-
O.$slots.default ? _(O.$slots, "default", { key: 0 }) : y("", !0)
|
|
2741
|
-
]),
|
|
2742
|
-
_: 3
|
|
2743
|
-
}, 8, ["createView", "exclude"])) : (u(), E(Z, { key: 0 }, [
|
|
2744
|
-
k(Vn, { collapsed: n(s) }, {
|
|
2745
|
-
brand: f(() => [
|
|
2746
|
-
k(On, {
|
|
2747
|
-
logo: e.logo,
|
|
2748
|
-
title: e.title,
|
|
2749
|
-
url: n(l).url,
|
|
2750
|
-
collapsed: n(s)
|
|
2751
|
-
}, null, 8, ["logo", "title", "url", "collapsed"])
|
|
2752
|
-
]),
|
|
2753
|
-
default: f(() => [
|
|
2754
|
-
k(Dn, {
|
|
2755
|
-
collasped: n(s),
|
|
2756
|
-
"onUpdate:collasped": q[0] || (q[0] = (ke) => $e(s) ? s.value = ke : null),
|
|
2757
|
-
favorite: n(r),
|
|
2758
|
-
"onUpdate:favorite": q[1] || (q[1] = (ke) => $e(r) ? r.value = ke : null),
|
|
2759
|
-
keyword: n(c),
|
|
2760
|
-
"onUpdate:keyword": q[2] || (q[2] = (ke) => $e(c) ? c.value = ke : null)
|
|
2761
|
-
}, null, 8, ["collasped", "favorite", "keyword"]),
|
|
2762
|
-
k(jn, {
|
|
2763
|
-
collapse: n(s),
|
|
2764
|
-
keyword: n(c),
|
|
2765
|
-
favorite: n(r),
|
|
2766
|
-
favorites: n(m),
|
|
2767
|
-
flatMenus: n(p),
|
|
2768
|
-
menus: n(i),
|
|
2769
|
-
active: n(d),
|
|
2770
|
-
onSelect: n(b)
|
|
2771
|
-
}, null, 8, ["collapse", "keyword", "favorite", "favorites", "flatMenus", "menus", "active", "onSelect"])
|
|
2772
|
-
]),
|
|
2773
|
-
_: 1
|
|
2774
|
-
}, 8, ["collapsed"]),
|
|
2775
|
-
k(n($), {
|
|
2776
|
-
class: "x-mask__main",
|
|
2777
|
-
grow: "",
|
|
2778
|
-
shrink: "",
|
|
2779
|
-
flex: "",
|
|
2780
|
-
direction: "column"
|
|
2781
|
-
}, {
|
|
2782
|
-
default: f(() => [
|
|
2783
|
-
k(n($), {
|
|
2784
|
-
class: "x-mask-topbar",
|
|
2785
|
-
justify: "space-between",
|
|
2786
|
-
align: "center"
|
|
2787
|
-
}, {
|
|
2788
|
-
default: f(() => [
|
|
2789
|
-
k(Wn, {
|
|
2790
|
-
ref_key: "tabRef",
|
|
2791
|
-
ref: w,
|
|
2792
|
-
favorites: n(m),
|
|
2793
|
-
tabs: n(P),
|
|
2794
|
-
home: n(l),
|
|
2795
|
-
value: n(x)?.id,
|
|
2796
|
-
onClick: n(T),
|
|
2797
|
-
onToggleFavorite: n(S),
|
|
2798
|
-
onRemove: ze,
|
|
2799
|
-
onDialog: n(G),
|
|
2800
|
-
onRefresh: n(ie)
|
|
2801
|
-
}, null, 8, ["favorites", "tabs", "home", "value", "onClick", "onToggleFavorite", "onDialog", "onRefresh"]),
|
|
2802
|
-
k(Qn, {
|
|
2803
|
-
tabs: n(le),
|
|
2804
|
-
actions: e.actions,
|
|
2805
|
-
theme: e.theme,
|
|
2806
|
-
onCloseOtherTabs: Ve,
|
|
2807
|
-
onCloseAllTabs: Ce,
|
|
2808
|
-
onCloseTab: ze,
|
|
2809
|
-
onClickTab: n(_e),
|
|
2810
|
-
onActionClick: De,
|
|
2811
|
-
onActionCommand: Ot
|
|
2812
|
-
}, {
|
|
2813
|
-
default: f(() => [
|
|
2814
|
-
k(Zn, {
|
|
2815
|
-
avatar: e.avatar
|
|
2816
|
-
}, ye({ _: 2 }, [
|
|
2817
|
-
O.$slots.user ? {
|
|
2818
|
-
name: "default",
|
|
2819
|
-
fn: f(() => [
|
|
2820
|
-
_(O.$slots, "user")
|
|
2821
|
-
]),
|
|
2822
|
-
key: "0"
|
|
2823
|
-
} : void 0
|
|
2824
|
-
]), 1032, ["avatar"])
|
|
2825
|
-
]),
|
|
2826
|
-
_: 3
|
|
2827
|
-
}, 8, ["tabs", "actions", "theme", "onClickTab"])
|
|
2828
|
-
]),
|
|
2829
|
-
_: 3
|
|
2830
|
-
}),
|
|
2831
|
-
k(rt, {
|
|
2832
|
-
createView: n(K),
|
|
2833
|
-
exclude: n(C)
|
|
2834
|
-
}, {
|
|
2835
|
-
default: f(() => [
|
|
2836
|
-
O.$slots.default ? _(O.$slots, "default", { key: 0 }) : y("", !0)
|
|
2837
|
-
]),
|
|
2838
|
-
_: 3
|
|
2839
|
-
}, 8, ["createView", "exclude"])
|
|
2840
|
-
]),
|
|
2841
|
-
_: 3
|
|
2842
|
-
})
|
|
2843
|
-
], 64))
|
|
2844
|
-
]),
|
|
2845
|
-
_: 3
|
|
2846
|
-
}));
|
|
2847
|
-
}
|
|
2848
|
-
});
|
|
2849
|
-
function Ra(a = {}) {
|
|
2850
|
-
const t = Le(), e = we(Bt, null), o = we(It, null);
|
|
2851
|
-
if (e) {
|
|
2852
|
-
const s = typeof a == "function" ? a : async () => a;
|
|
2853
|
-
e[t.fullPath] = s;
|
|
2854
|
-
}
|
|
2855
|
-
return {
|
|
2856
|
-
tab: h(() => o ? o.tabs.value.find((s) => s.url === t.fullPath) : null),
|
|
2857
|
-
mask: o
|
|
2858
|
-
};
|
|
2859
|
-
}
|
|
2860
|
-
const aa = /* @__PURE__ */ M({
|
|
2861
|
-
__name: "SelectEditor",
|
|
2862
|
-
props: {
|
|
2863
|
-
options: { default: () => [] }
|
|
2864
|
-
},
|
|
2865
|
-
setup(a) {
|
|
2866
|
-
const t = a;
|
|
2867
|
-
return (e, o) => (u(), g(n(no), ce(ge(e.$attrs)), {
|
|
2868
|
-
default: f(() => [
|
|
2869
|
-
(u(!0), E(Z, null, se(t.options, (l, s) => (u(), g(n(ao), j({
|
|
2870
|
-
key: `item_${s}_${l.value}`
|
|
2871
|
-
}, l), ye({ _: 2 }, [
|
|
2872
|
-
e.$slots.option ? {
|
|
2873
|
-
name: "default",
|
|
2874
|
-
fn: f(() => [
|
|
2875
|
-
_(e.$slots, "option", { option: l })
|
|
2876
|
-
]),
|
|
2877
|
-
key: "0"
|
|
2878
|
-
} : void 0
|
|
2879
|
-
]), 1040))), 128))
|
|
2880
|
-
]),
|
|
2881
|
-
_: 3
|
|
2882
|
-
}, 16));
|
|
2883
|
-
}
|
|
2884
|
-
}), sa = /* @__PURE__ */ M({
|
|
2885
|
-
__name: "CheckboxEditor",
|
|
2886
|
-
props: {
|
|
2887
|
-
options: { default: () => [] },
|
|
2888
|
-
button: { type: Boolean, default: !1 }
|
|
2889
|
-
},
|
|
2890
|
-
setup(a) {
|
|
2891
|
-
const t = a, e = h(
|
|
2892
|
-
() => be(t.button ? so : lo)
|
|
2893
|
-
);
|
|
2894
|
-
return (o, l) => (u(), g(n(io), ce(ge(o.$attrs)), {
|
|
2895
|
-
default: f(() => [
|
|
2896
|
-
(u(!0), E(Z, null, se(t.options, (s, c) => (u(), g(W(e.value), {
|
|
2897
|
-
key: `item_${c}_${s.value}`,
|
|
2898
|
-
label: s.value
|
|
2899
|
-
}, {
|
|
2900
|
-
default: f(() => [
|
|
2901
|
-
N(F(s.label), 1)
|
|
2902
|
-
]),
|
|
2903
|
-
_: 2
|
|
2904
|
-
}, 1032, ["label"]))), 128))
|
|
2905
|
-
]),
|
|
2906
|
-
_: 1
|
|
2907
|
-
}, 16));
|
|
2908
|
-
}
|
|
2909
|
-
}), la = /* @__PURE__ */ M({
|
|
2910
|
-
__name: "RadioEditor",
|
|
2911
|
-
props: {
|
|
2912
|
-
options: { default: () => [] },
|
|
2913
|
-
button: { type: Boolean, default: !1 }
|
|
2914
|
-
},
|
|
2915
|
-
setup(a) {
|
|
2916
|
-
const t = a, e = h(
|
|
2917
|
-
() => be(t.button ? ro : co)
|
|
2918
|
-
);
|
|
2919
|
-
return (o, l) => (u(), g(n(uo), ce(ge(o.$attrs)), {
|
|
2920
|
-
default: f(() => [
|
|
2921
|
-
(u(!0), E(Z, null, se(t.options, (s, c) => (u(), g(W(e.value), {
|
|
2922
|
-
key: `item_${c}_${s.value}`,
|
|
2923
|
-
label: s.value
|
|
2924
|
-
}, {
|
|
2925
|
-
default: f(() => [
|
|
2926
|
-
N(F(s.label), 1)
|
|
2927
|
-
]),
|
|
2928
|
-
_: 2
|
|
2929
|
-
}, 1032, ["label"]))), 128))
|
|
2930
|
-
]),
|
|
2931
|
-
_: 1
|
|
2932
|
-
}, 16));
|
|
2933
|
-
}
|
|
2934
|
-
}), Pt = {
|
|
2935
|
-
none: {
|
|
2936
|
-
component: "div",
|
|
2937
|
-
props: {
|
|
2938
|
-
class: "x-field-none"
|
|
2939
|
-
}
|
|
2940
|
-
},
|
|
2941
|
-
text: {
|
|
2942
|
-
component: je,
|
|
2943
|
-
props: {
|
|
2944
|
-
clearable: !0
|
|
2945
|
-
},
|
|
2946
|
-
defaultValue: ""
|
|
2947
|
-
},
|
|
2948
|
-
textarea: {
|
|
2949
|
-
component: je,
|
|
2950
|
-
props: {
|
|
2951
|
-
type: "textarea",
|
|
2952
|
-
rows: 2
|
|
2953
|
-
},
|
|
2954
|
-
defaultValue: ""
|
|
2955
|
-
},
|
|
2956
|
-
select: {
|
|
2957
|
-
component: aa,
|
|
2958
|
-
props: {
|
|
2959
|
-
clearable: !0
|
|
2960
|
-
}
|
|
2961
|
-
},
|
|
2962
|
-
checkbox: {
|
|
2963
|
-
component: sa,
|
|
2964
|
-
props: {},
|
|
2965
|
-
defaultValue: []
|
|
2966
|
-
},
|
|
2967
|
-
radio: {
|
|
2968
|
-
component: la,
|
|
2969
|
-
props: {}
|
|
2970
|
-
},
|
|
2971
|
-
number: {
|
|
2972
|
-
component: po,
|
|
2973
|
-
props: {}
|
|
2974
|
-
},
|
|
2975
|
-
date: {
|
|
2976
|
-
component: tt,
|
|
2977
|
-
props: {}
|
|
2978
|
-
},
|
|
2979
|
-
time: {
|
|
2980
|
-
component: mo,
|
|
2981
|
-
props: {}
|
|
2982
|
-
},
|
|
2983
|
-
datetime: {
|
|
2984
|
-
component: tt,
|
|
2985
|
-
props: {
|
|
2986
|
-
type: "datetime"
|
|
2987
|
-
}
|
|
2988
|
-
},
|
|
2989
|
-
switch: {
|
|
2990
|
-
component: We,
|
|
2991
|
-
props: {}
|
|
2992
|
-
},
|
|
2993
|
-
rate: {
|
|
2994
|
-
component: fo,
|
|
2995
|
-
props: {}
|
|
2996
|
-
},
|
|
2997
|
-
slider: {
|
|
2998
|
-
component: go,
|
|
2999
|
-
props: {}
|
|
3000
|
-
},
|
|
3001
|
-
cascader: {
|
|
3002
|
-
component: yo,
|
|
3003
|
-
props: {}
|
|
3004
|
-
}
|
|
3005
|
-
}, ia = {
|
|
3006
|
-
/**
|
|
3007
|
-
* 字段名称
|
|
3008
|
-
*/
|
|
3009
|
-
name: {
|
|
3010
|
-
type: String
|
|
3011
|
-
},
|
|
3012
|
-
/**
|
|
3013
|
-
* 字段标题文本
|
|
3014
|
-
*/
|
|
3015
|
-
label: {
|
|
3016
|
-
type: String
|
|
3017
|
-
},
|
|
3018
|
-
/**
|
|
3019
|
-
* 编辑器组件
|
|
3020
|
-
*/
|
|
3021
|
-
editor: {
|
|
3022
|
-
type: [String, Object],
|
|
3023
|
-
default: "text"
|
|
3024
|
-
},
|
|
3025
|
-
/**
|
|
3026
|
-
* 编辑器组件参数
|
|
3027
|
-
*/
|
|
3028
|
-
props: {
|
|
3029
|
-
type: Object
|
|
3030
|
-
},
|
|
3031
|
-
/**
|
|
3032
|
-
* 字段值
|
|
3033
|
-
*/
|
|
3034
|
-
modelValue: {
|
|
3035
|
-
type: [String, Number, Boolean, Object, Array],
|
|
3036
|
-
default(a) {
|
|
3037
|
-
return Pt[a.editor]?.defaultValue;
|
|
3038
|
-
}
|
|
3039
|
-
},
|
|
3040
|
-
/**
|
|
3041
|
-
* 输入框尺寸
|
|
3042
|
-
*/
|
|
3043
|
-
size: {
|
|
3044
|
-
type: String
|
|
3045
|
-
},
|
|
3046
|
-
width: {
|
|
3047
|
-
type: [String, Number]
|
|
3048
|
-
},
|
|
3049
|
-
/**
|
|
3050
|
-
* 是否在tooltip显示校验信息
|
|
3051
|
-
*/
|
|
3052
|
-
tooltipMessage: {
|
|
3053
|
-
type: [Boolean, Object],
|
|
3054
|
-
default: !0
|
|
3055
|
-
},
|
|
3056
|
-
/**
|
|
3057
|
-
* tooltip信息显示相对输入框的位置
|
|
3058
|
-
*/
|
|
3059
|
-
tooltipPosition: {
|
|
3060
|
-
type: [String, Number],
|
|
3061
|
-
default: "outer"
|
|
3062
|
-
},
|
|
3063
|
-
/**
|
|
3064
|
-
* null 不显示 placeholder
|
|
3065
|
-
*/
|
|
3066
|
-
placeholder: {
|
|
3067
|
-
type: String
|
|
3068
|
-
},
|
|
3069
|
-
/**
|
|
3070
|
-
* 禁用
|
|
3071
|
-
*/
|
|
3072
|
-
disabled: {
|
|
3073
|
-
type: Boolean
|
|
3074
|
-
},
|
|
3075
|
-
/**
|
|
3076
|
-
* 只读
|
|
3077
|
-
*/
|
|
3078
|
-
readonly: {
|
|
3079
|
-
type: Boolean
|
|
3080
|
-
},
|
|
3081
|
-
/**
|
|
3082
|
-
* 选项数据
|
|
3083
|
-
*/
|
|
3084
|
-
options: {
|
|
3085
|
-
type: [Array, Function]
|
|
3086
|
-
},
|
|
3087
|
-
/**
|
|
3088
|
-
* 是否显示控制
|
|
3089
|
-
*/
|
|
3090
|
-
visible: {
|
|
3091
|
-
type: [Boolean, Object, Function],
|
|
3092
|
-
default: !0
|
|
3093
|
-
},
|
|
3094
|
-
/**
|
|
3095
|
-
* 级联字段,根据字段值变化刷新options
|
|
3096
|
-
*/
|
|
3097
|
-
cascader: {
|
|
3098
|
-
type: [String, Array]
|
|
3099
|
-
}
|
|
3100
|
-
};
|
|
3101
|
-
async function ra(a, t) {
|
|
3102
|
-
const e = a.options;
|
|
3103
|
-
return e ? typeof e == "function" ? await e(t) || [] : e : [];
|
|
3104
|
-
}
|
|
3105
|
-
function ca(a, t, e, o, l) {
|
|
3106
|
-
const s = D([]), c = h(() => !o || !l ? {} : Ho(a.cascader).reduce((m, p) => (m[p] = l[p], m), {}));
|
|
3107
|
-
return L(
|
|
3108
|
-
c,
|
|
3109
|
-
async (i) => {
|
|
3110
|
-
if (e.value) {
|
|
3111
|
-
s.value = await ra(a, i);
|
|
3112
|
-
const m = o?.exposed?.reset;
|
|
3113
|
-
m && a.name && m(a.name);
|
|
3114
|
-
}
|
|
3115
|
-
},
|
|
3116
|
-
{
|
|
3117
|
-
immediate: !0
|
|
3118
|
-
}
|
|
3119
|
-
), {
|
|
3120
|
-
editor: h(() => {
|
|
3121
|
-
const {
|
|
3122
|
-
editor: i = "text",
|
|
3123
|
-
placeholder: m,
|
|
3124
|
-
label: p = "...",
|
|
3125
|
-
disabled: d,
|
|
3126
|
-
readonly: b
|
|
3127
|
-
} = a, S = {
|
|
3128
|
-
...a.props,
|
|
3129
|
-
placeholder: m || (m === null ? void 0 : `请输入${p}`),
|
|
3130
|
-
disabled: d,
|
|
3131
|
-
readonly: b,
|
|
3132
|
-
options: s.value,
|
|
3133
|
-
onFocus: () => t("focus"),
|
|
3134
|
-
onBlur: () => t("blur"),
|
|
3135
|
-
onChange: (P) => t("change", P)
|
|
3136
|
-
}, w = typeof i == "string" ? Pt[i] : {
|
|
3137
|
-
component: i,
|
|
3138
|
-
props: {}
|
|
3139
|
-
};
|
|
3140
|
-
return Wo({}, w, {
|
|
3141
|
-
props: S
|
|
3142
|
-
});
|
|
3143
|
-
})
|
|
3144
|
-
};
|
|
3145
|
-
}
|
|
3146
|
-
const ua = { class: "x-field__editor_wrap" }, Vt = /* @__PURE__ */ M({
|
|
3147
|
-
name: "XField",
|
|
3148
|
-
__name: "Field",
|
|
3149
|
-
props: ia,
|
|
3150
|
-
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
3151
|
-
setup(a, { expose: t, emit: e }) {
|
|
3152
|
-
const o = a, l = e, s = we(Dt, null), c = we(ho, null), r = we(Rt, null), i = h(() => !s?.proxy || !r ? o.visible : typeof o.visible == "function" ? o.visible(r) : Qe(o.visible) ? Object.entries(o.visible).every(([H, X]) => r[H] === X) : o.visible), m = () => s?.proxy && r && o.name ? r[o.name] ?? o.modelValue : o.modelValue, p = D(m()), { editor: d } = ca(
|
|
3153
|
-
o,
|
|
3154
|
-
l,
|
|
3155
|
-
i,
|
|
3156
|
-
s,
|
|
3157
|
-
r
|
|
3158
|
-
), b = D(), S = D(), w = h(
|
|
3159
|
-
() => o.size || c?.size || "default"
|
|
3160
|
-
), P = h(() => Object.assign(
|
|
3161
|
-
{},
|
|
3162
|
-
typeof o.tooltipMessage == "boolean" ? {} : o.tooltipMessage
|
|
3163
|
-
)), x = h(() => ({
|
|
3164
|
-
[`is-tooltip-${o.tooltipPosition}`]: !!o.tooltipPosition
|
|
3165
|
-
})), T = h(() => {
|
|
3166
|
-
const z = s?.proxy;
|
|
3167
|
-
return {
|
|
3168
|
-
width: o.width ? oe(o.width) : z && z.inline && z.inlineColumns ? `${100 / z.inlineColumns}%` : null
|
|
3169
|
-
};
|
|
3170
|
-
}), v = h(() => ({
|
|
3171
|
-
right: typeof o.tooltipPosition == "number" ? `${o.tooltipPosition}px` : void 0
|
|
3172
|
-
})), I = h(() => ({
|
|
3173
|
-
...d.value.props,
|
|
3174
|
-
modelValue: p.value,
|
|
3175
|
-
"onUpdate:modelValue": (z) => {
|
|
3176
|
-
p.value = z;
|
|
3177
|
-
}
|
|
3178
|
-
}));
|
|
3179
|
-
return L(p, (z, H) => {
|
|
3180
|
-
i.value && !Ke(z, H) && (l("update:modelValue", z), s?.proxy && r && o.name && ot(r, o.name, z));
|
|
3181
|
-
}), L(
|
|
3182
|
-
() => !s?.proxy || !o.name || !r ? o.modelValue : r[o.name] ?? o.modelValue,
|
|
3183
|
-
(z) => {
|
|
3184
|
-
i.value && (p.value = z);
|
|
3185
|
-
},
|
|
3186
|
-
{
|
|
3187
|
-
immediate: !0
|
|
3188
|
-
}
|
|
3189
|
-
), L(
|
|
3190
|
-
i,
|
|
3191
|
-
(z) => {
|
|
3192
|
-
s?.proxy && r && o.name && (z ? (p.value = m(), ot(r, o.name, p.value)) : (p.value = void 0, delete r[o.name]));
|
|
3193
|
-
},
|
|
3194
|
-
{
|
|
3195
|
-
immediate: !0
|
|
3196
|
-
}
|
|
3197
|
-
), t({
|
|
3198
|
-
fieldValue: p,
|
|
3199
|
-
itemRef: b,
|
|
3200
|
-
editorRef: S,
|
|
3201
|
-
focus: () => {
|
|
3202
|
-
S.value?.focus && S.value.focus();
|
|
3203
|
-
},
|
|
3204
|
-
blur: () => {
|
|
3205
|
-
S.value?.foucs && S.value.blur();
|
|
3206
|
-
}
|
|
3207
|
-
}), (z, H) => i.value ? (u(), g(n(vo), j({
|
|
3208
|
-
key: 0,
|
|
3209
|
-
class: ["x-field", x.value],
|
|
3210
|
-
ref_key: "itemRef",
|
|
3211
|
-
ref: b,
|
|
3212
|
-
prop: o.name,
|
|
3213
|
-
label: z.label,
|
|
3214
|
-
size: w.value,
|
|
3215
|
-
style: T.value
|
|
3216
|
-
}, z.$attrs), ye({
|
|
3217
|
-
error: f(({ error: X }) => [
|
|
3218
|
-
_(z.$slots, "error", { error: X }, () => [
|
|
3219
|
-
o.tooltipMessage ? (u(), E("div", {
|
|
3220
|
-
key: 0,
|
|
3221
|
-
class: "x-field__info",
|
|
3222
|
-
style: ue(v.value)
|
|
3223
|
-
}, [
|
|
3224
|
-
k(n(ft), j({ content: X }, P.value), {
|
|
3225
|
-
default: f(() => [
|
|
3226
|
-
k(n(ae), {
|
|
3227
|
-
class: "x-field__trigger",
|
|
3228
|
-
icon: n(Io),
|
|
3229
|
-
size: w.value
|
|
3230
|
-
}, null, 8, ["icon", "size"])
|
|
3231
|
-
]),
|
|
3232
|
-
_: 2
|
|
3233
|
-
}, 1040, ["content"])
|
|
3234
|
-
], 4)) : y("", !0)
|
|
3235
|
-
])
|
|
3236
|
-
]),
|
|
3237
|
-
default: f(() => [
|
|
3238
|
-
R("div", ua, [
|
|
3239
|
-
_(z.$slots, "editor", { editor: I.value }, () => [
|
|
3240
|
-
n(d).component ? (u(), g(W(n(d).component), j({
|
|
3241
|
-
key: 0,
|
|
3242
|
-
class: "x-field__editor",
|
|
3243
|
-
ref_key: "editorRef",
|
|
3244
|
-
ref: S,
|
|
3245
|
-
modelValue: p.value,
|
|
3246
|
-
"onUpdate:modelValue": H[0] || (H[0] = (X) => p.value = X)
|
|
3247
|
-
}, n(d).props), ye({ _: 2 }, [
|
|
3248
|
-
z.$slots.option ? {
|
|
3249
|
-
name: "option",
|
|
3250
|
-
fn: f(({ option: X }) => [
|
|
3251
|
-
_(z.$slots, "option", { option: X })
|
|
3252
|
-
]),
|
|
3253
|
-
key: "0"
|
|
3254
|
-
} : void 0
|
|
3255
|
-
]), 1040, ["modelValue"])) : y("", !0)
|
|
3256
|
-
])
|
|
3257
|
-
]),
|
|
3258
|
-
_(z.$slots, "default")
|
|
3259
|
-
]),
|
|
3260
|
-
_: 2
|
|
3261
|
-
}, [
|
|
3262
|
-
z.$slots.label ? {
|
|
3263
|
-
name: "label",
|
|
3264
|
-
fn: f(() => [
|
|
3265
|
-
_(z.$slots, "label")
|
|
3266
|
-
]),
|
|
3267
|
-
key: "0"
|
|
3268
|
-
} : void 0
|
|
3269
|
-
]), 1040, ["prop", "label", "size", "class", "style"])) : y("", !0);
|
|
3270
|
-
}
|
|
3271
|
-
}), da = {
|
|
3272
|
-
/**
|
|
3273
|
-
* 表单模型
|
|
3274
|
-
*/
|
|
3275
|
-
model: {
|
|
3276
|
-
type: Object,
|
|
3277
|
-
default() {
|
|
3278
|
-
return /* @__PURE__ */ Object.create(null);
|
|
3279
|
-
}
|
|
3280
|
-
},
|
|
3281
|
-
/**
|
|
3282
|
-
* inline模式
|
|
3283
|
-
*/
|
|
3284
|
-
inline: {
|
|
3285
|
-
type: Boolean
|
|
3286
|
-
},
|
|
3287
|
-
/**
|
|
3288
|
-
* inline模式显示列数
|
|
3289
|
-
*/
|
|
3290
|
-
inlineColumns: {
|
|
3291
|
-
type: Number
|
|
3292
|
-
},
|
|
3293
|
-
/**
|
|
3294
|
-
* 显示底部操作按钮
|
|
3295
|
-
*/
|
|
3296
|
-
footer: {
|
|
3297
|
-
type: Boolean,
|
|
3298
|
-
default: !0
|
|
3299
|
-
},
|
|
3300
|
-
/**
|
|
3301
|
-
* 提交按钮文本
|
|
3302
|
-
*/
|
|
3303
|
-
submitText: {
|
|
3304
|
-
type: String,
|
|
3305
|
-
default: "提交"
|
|
3306
|
-
},
|
|
3307
|
-
/**
|
|
3308
|
-
* 重置按钮文本
|
|
3309
|
-
*/
|
|
3310
|
-
resetText: {
|
|
3311
|
-
type: String,
|
|
3312
|
-
default: "重置"
|
|
3313
|
-
},
|
|
3314
|
-
/**
|
|
3315
|
-
* 表单提交处理方法
|
|
3316
|
-
*/
|
|
3317
|
-
submitMethod: {
|
|
3318
|
-
type: Function
|
|
3319
|
-
}
|
|
3320
|
-
}, Dt = Symbol("formInstanceKey"), Rt = Symbol("formModelKey"), Ft = /* @__PURE__ */ M({
|
|
3321
|
-
name: "XForm",
|
|
3322
|
-
__name: "Form",
|
|
3323
|
-
props: da,
|
|
3324
|
-
emits: ["change", "submit", "reset"],
|
|
3325
|
-
setup(a, { expose: t, emit: e }) {
|
|
3326
|
-
const o = a, l = e, s = ve(), c = D(), r = He(o.model || {}), i = D(!1);
|
|
3327
|
-
Se(Dt, s), Se(Rt, r), L(r, () => {
|
|
3328
|
-
l("change", pe(r));
|
|
3329
|
-
}), L(
|
|
3330
|
-
() => o.model,
|
|
3331
|
-
(d) => {
|
|
3332
|
-
Object.assign(r, d);
|
|
3333
|
-
},
|
|
3334
|
-
{ deep: !0 }
|
|
3335
|
-
);
|
|
3336
|
-
const m = async () => {
|
|
3337
|
-
await c.value.validate().catch((b) => b) && o.model && (l("submit", pe(r)), o.submitMethod && (i.value = !0, await o.submitMethod(pe(r)), i.value = !1));
|
|
3338
|
-
}, p = (d) => {
|
|
3339
|
-
c.value.resetFields(d), l("reset");
|
|
3340
|
-
};
|
|
3341
|
-
return t({
|
|
3342
|
-
formRef: c,
|
|
3343
|
-
model: r,
|
|
3344
|
-
submit: m,
|
|
3345
|
-
reset: p
|
|
3346
|
-
}), (d, b) => (u(), g(n(bo), j({
|
|
3347
|
-
ref_key: "formRef",
|
|
3348
|
-
ref: c,
|
|
3349
|
-
class: "x-form",
|
|
3350
|
-
inline: o.inline,
|
|
3351
|
-
model: r
|
|
3352
|
-
}, d.$attrs), {
|
|
3353
|
-
default: f(() => [
|
|
3354
|
-
_(d.$slots, "default"),
|
|
3355
|
-
o.footer ? (u(), g(n(Vt), {
|
|
3356
|
-
key: 0,
|
|
3357
|
-
editor: "none",
|
|
3358
|
-
class: "x-form__footer",
|
|
3359
|
-
label: " "
|
|
3360
|
-
}, {
|
|
3361
|
-
editor: f(() => [
|
|
3362
|
-
_(d.$slots, "footer", {}, () => [
|
|
3363
|
-
o.submitText ? (u(), g(n(de), {
|
|
3364
|
-
key: 0,
|
|
3365
|
-
loading: i.value,
|
|
3366
|
-
type: "primary",
|
|
3367
|
-
onClick: m
|
|
3368
|
-
}, {
|
|
3369
|
-
default: f(() => [
|
|
3370
|
-
N(F(o.submitText), 1)
|
|
3371
|
-
]),
|
|
3372
|
-
_: 1
|
|
3373
|
-
}, 8, ["loading"])) : y("", !0),
|
|
3374
|
-
o.resetText ? (u(), g(n(de), {
|
|
3375
|
-
key: 1,
|
|
3376
|
-
type: "default",
|
|
3377
|
-
onClick: b[0] || (b[0] = () => p())
|
|
3378
|
-
}, {
|
|
3379
|
-
default: f(() => [
|
|
3380
|
-
N(F(o.resetText), 1)
|
|
3381
|
-
]),
|
|
3382
|
-
_: 1
|
|
3383
|
-
})) : y("", !0),
|
|
3384
|
-
_(d.$slots, "action")
|
|
3385
|
-
])
|
|
3386
|
-
]),
|
|
3387
|
-
_: 3
|
|
3388
|
-
})) : y("", !0)
|
|
3389
|
-
]),
|
|
3390
|
-
_: 3
|
|
3391
|
-
}, 16, ["inline", "model"]));
|
|
3392
|
-
}
|
|
3393
|
-
}), pa = {
|
|
3394
|
-
modelValue: {
|
|
3395
|
-
type: Boolean,
|
|
3396
|
-
default: !0
|
|
3397
|
-
},
|
|
3398
|
-
size: {
|
|
3399
|
-
type: String
|
|
3400
|
-
},
|
|
3401
|
-
formProps: {
|
|
3402
|
-
type: Object
|
|
3403
|
-
},
|
|
3404
|
-
submit: {
|
|
3405
|
-
type: [Boolean, String],
|
|
3406
|
-
default: "确定"
|
|
3407
|
-
},
|
|
3408
|
-
cancel: {
|
|
3409
|
-
type: [Boolean, String],
|
|
3410
|
-
default: "取消"
|
|
3411
|
-
},
|
|
3412
|
-
/**
|
|
3413
|
-
* 表单模型
|
|
3414
|
-
*/
|
|
3415
|
-
model: {
|
|
3416
|
-
type: Object,
|
|
3417
|
-
default() {
|
|
3418
|
-
return /* @__PURE__ */ Object.create(null);
|
|
3419
|
-
}
|
|
3420
|
-
},
|
|
3421
|
-
rules: {
|
|
3422
|
-
type: Object
|
|
3423
|
-
},
|
|
3424
|
-
/**
|
|
3425
|
-
* 表单提交处理方法, return true 关闭弹窗
|
|
3426
|
-
*/
|
|
3427
|
-
submitMethod: {
|
|
3428
|
-
type: Function
|
|
3429
|
-
}
|
|
3430
|
-
}, ma = /* @__PURE__ */ M({
|
|
3431
|
-
name: "XDialogForm",
|
|
3432
|
-
__name: "DialogForm",
|
|
3433
|
-
props: pa,
|
|
3434
|
-
emits: ["update:modelValue", "submit", "close"],
|
|
3435
|
-
setup(a, { expose: t, emit: e }) {
|
|
3436
|
-
const o = a, l = e, s = D(), c = D(), r = h(() => c.value?.$vtjEl), i = () => {
|
|
3437
|
-
s.value?.submit();
|
|
3438
|
-
}, m = () => {
|
|
3439
|
-
l("update:modelValue", !1), l("close");
|
|
3440
|
-
}, p = async (d) => {
|
|
3441
|
-
l("submit", d), o.submitMethod ? await o.submitMethod(d) && m() : m();
|
|
3442
|
-
};
|
|
3443
|
-
return t({
|
|
3444
|
-
$vtjEl: r,
|
|
3445
|
-
formRef: s,
|
|
3446
|
-
dialogRef: c
|
|
3447
|
-
}), (d, b) => (u(), g(n(Je), j({
|
|
3448
|
-
ref_key: "dialogRef",
|
|
3449
|
-
ref: c,
|
|
3450
|
-
"model-value": o.modelValue,
|
|
3451
|
-
submit: o.submit,
|
|
3452
|
-
cancel: o.cancel,
|
|
3453
|
-
size: o.size,
|
|
3454
|
-
onSubmit: i,
|
|
3455
|
-
onClose: m,
|
|
3456
|
-
minimizable: !1,
|
|
3457
|
-
maximizable: !1
|
|
3458
|
-
}, d.$attrs), ye({
|
|
3459
|
-
default: f(() => [
|
|
3460
|
-
k(n(Ft), j({
|
|
3461
|
-
ref_key: "formRef",
|
|
3462
|
-
ref: s,
|
|
3463
|
-
footer: !1,
|
|
3464
|
-
"label-width": "80px",
|
|
3465
|
-
size: o.size,
|
|
3466
|
-
model: o.model,
|
|
3467
|
-
rules: o.rules,
|
|
3468
|
-
"submit-method": p
|
|
3469
|
-
}, o.formProps), {
|
|
3470
|
-
default: f(() => [
|
|
3471
|
-
_(d.$slots, "default")
|
|
3472
|
-
]),
|
|
3473
|
-
_: 3
|
|
3474
|
-
}, 16, ["size", "model", "rules"])
|
|
3475
|
-
]),
|
|
3476
|
-
_: 2
|
|
3477
|
-
}, [
|
|
3478
|
-
d.$slots.extra ? {
|
|
3479
|
-
name: "extra",
|
|
3480
|
-
fn: f(() => [
|
|
3481
|
-
_(d.$slots, "extra")
|
|
3482
|
-
]),
|
|
3483
|
-
key: "0"
|
|
3484
|
-
} : void 0,
|
|
3485
|
-
d.$slots.handle ? {
|
|
3486
|
-
name: "handle",
|
|
3487
|
-
fn: f(() => [
|
|
3488
|
-
_(d.$slots, "handle")
|
|
3489
|
-
]),
|
|
3490
|
-
key: "1"
|
|
3491
|
-
} : void 0,
|
|
3492
|
-
d.$slots.footer ? {
|
|
3493
|
-
name: "footer",
|
|
3494
|
-
fn: f(() => [
|
|
3495
|
-
_(d.$slots, "footer")
|
|
3496
|
-
]),
|
|
3497
|
-
key: "2"
|
|
3498
|
-
} : void 0
|
|
3499
|
-
]), 1040, ["model-value", "submit", "cancel", "size"]));
|
|
3500
|
-
}
|
|
3501
|
-
}), fa = {
|
|
3502
|
-
items: {
|
|
3503
|
-
type: Array,
|
|
3504
|
-
default() {
|
|
3505
|
-
return [];
|
|
3506
|
-
}
|
|
3507
|
-
},
|
|
3508
|
-
border: {
|
|
3509
|
-
type: Boolean
|
|
3510
|
-
}
|
|
3511
|
-
}, ga = /* @__PURE__ */ M({
|
|
3512
|
-
name: "XTabs",
|
|
3513
|
-
__name: "Tabs",
|
|
3514
|
-
props: fa,
|
|
3515
|
-
setup(a) {
|
|
3516
|
-
const t = a, e = (l) => {
|
|
3517
|
-
const { label: s, name: c, value: r, disabled: i, closable: m, lazy: p } = l;
|
|
3518
|
-
return {
|
|
3519
|
-
label: s,
|
|
3520
|
-
name: r ?? c,
|
|
3521
|
-
disabled: i,
|
|
3522
|
-
closable: m,
|
|
3523
|
-
lazy: p
|
|
3524
|
-
};
|
|
3525
|
-
}, o = h(() => ({
|
|
3526
|
-
"is-no-border": !t.border
|
|
3527
|
-
}));
|
|
3528
|
-
return (l, s) => (u(), g(n(gt), j({
|
|
3529
|
-
class: ["x-tabs", o.value]
|
|
3530
|
-
}, l.$attrs), {
|
|
3531
|
-
default: f(() => [
|
|
3532
|
-
(u(!0), E(Z, null, se(t.items, (c) => (u(), g(n(Ne), j({
|
|
3533
|
-
key: c.value ?? c.name
|
|
3534
|
-
}, e(c)), {
|
|
3535
|
-
label: f(() => [
|
|
3536
|
-
_(l.$slots, "label", ce(ge(c)), () => [
|
|
3537
|
-
c.icon ? (u(), g(W(n(he)(c.icon)), {
|
|
3538
|
-
key: 0,
|
|
3539
|
-
class: "x-tabs__icon"
|
|
3540
|
-
})) : y("", !0),
|
|
3541
|
-
N(" " + F(c.label), 1)
|
|
3542
|
-
])
|
|
3543
|
-
]),
|
|
3544
|
-
default: f(() => [
|
|
3545
|
-
_(l.$slots, "default", ce(ge(c)), () => [
|
|
3546
|
-
c.component ? (u(), g(W(c.component), ce(j({ key: 0 }, c.props)), null, 16)) : y("", !0)
|
|
3547
|
-
])
|
|
3548
|
-
]),
|
|
3549
|
-
_: 2
|
|
3550
|
-
}, 1040))), 128))
|
|
3551
|
-
]),
|
|
3552
|
-
_: 3
|
|
3553
|
-
}, 16, ["class"]));
|
|
3554
|
-
}
|
|
3555
|
-
}), ya = {
|
|
3556
|
-
direction: {
|
|
3557
|
-
type: String,
|
|
3558
|
-
default: "column"
|
|
3559
|
-
},
|
|
3560
|
-
imageSrc: {
|
|
3561
|
-
type: String
|
|
3562
|
-
},
|
|
3563
|
-
imageWidth: {
|
|
3564
|
-
type: [Number, String]
|
|
3565
|
-
},
|
|
3566
|
-
imageHeight: {
|
|
3567
|
-
type: [Number, String]
|
|
3568
|
-
},
|
|
3569
|
-
icon: {
|
|
3570
|
-
type: [String, Object]
|
|
3571
|
-
},
|
|
3572
|
-
title: {
|
|
3573
|
-
type: String
|
|
3574
|
-
},
|
|
3575
|
-
description: {
|
|
3576
|
-
type: String
|
|
3577
|
-
},
|
|
3578
|
-
actions: {
|
|
3579
|
-
type: Array
|
|
3580
|
-
},
|
|
3581
|
-
actionBarProps: {
|
|
3582
|
-
type: Object
|
|
3583
|
-
},
|
|
3584
|
-
split: {
|
|
3585
|
-
type: Boolean
|
|
3586
|
-
},
|
|
3587
|
-
onImageClick: {
|
|
3588
|
-
type: Function
|
|
3589
|
-
},
|
|
3590
|
-
onTitleClick: {
|
|
3591
|
-
type: Function
|
|
3592
|
-
}
|
|
3593
|
-
}, ha = { class: "x-data-item__title" }, va = {
|
|
3594
|
-
key: 1,
|
|
3595
|
-
class: "x-data-item__section x-data-item__desc"
|
|
3596
|
-
}, ba = {
|
|
3597
|
-
key: 2,
|
|
3598
|
-
class: "x-data-item__section x-data-item__extra"
|
|
3599
|
-
}, _a = {
|
|
3600
|
-
key: 3,
|
|
3601
|
-
class: "x-data-item__section x-data-item__actions"
|
|
3602
|
-
}, ka = /* @__PURE__ */ M({
|
|
3603
|
-
name: "XDataItem",
|
|
3604
|
-
__name: "DataItem",
|
|
3605
|
-
props: ya,
|
|
3606
|
-
emits: ["imageClick", "titleClick", "actionClick", "actionCommand"],
|
|
3607
|
-
setup(a, { emit: t }) {
|
|
3608
|
-
const e = a, o = t, l = h(() => {
|
|
3609
|
-
const { imageWidth: d, imageHeight: b } = e;
|
|
3610
|
-
return {
|
|
3611
|
-
width: d ? oe(d) : void 0,
|
|
3612
|
-
height: b ? oe(b) : void 0
|
|
3613
|
-
};
|
|
3614
|
-
}), s = h(() => ({
|
|
3615
|
-
[`is-image-${e.direction}`]: !!e.direction,
|
|
3616
|
-
"is-split": !!e.split
|
|
3617
|
-
})), c = h(() => ({
|
|
3618
|
-
size: "small",
|
|
3619
|
-
mode: "text",
|
|
3620
|
-
justify: "flex-end",
|
|
3621
|
-
type: "info",
|
|
3622
|
-
items: e.actions,
|
|
3623
|
-
...e.actionBarProps
|
|
3624
|
-
})), r = () => o("imageClick"), i = () => o("titleClick"), m = (d) => o("actionClick", d), p = (d, b) => o("actionCommand", d, b);
|
|
3625
|
-
return (d, b) => (u(), g(n($), {
|
|
3626
|
-
class: Q(["x-data-item", s.value]),
|
|
3627
|
-
direction: e.direction
|
|
3628
|
-
}, {
|
|
3629
|
-
default: f(() => [
|
|
3630
|
-
e.imageSrc || d.$slots.image ? (u(), g(n($), {
|
|
3631
|
-
key: 0,
|
|
3632
|
-
class: "x-data-item__img",
|
|
3633
|
-
autoPointer: !0,
|
|
3634
|
-
onClick: e.onImageClick ? r : void 0
|
|
3635
|
-
}, {
|
|
3636
|
-
default: f(() => [
|
|
3637
|
-
_(d.$slots, "image", {}, () => [
|
|
3638
|
-
e.imageSrc ? (u(), g(n(_o), {
|
|
3639
|
-
key: 0,
|
|
3640
|
-
style: ue(l.value),
|
|
3641
|
-
src: e.imageSrc
|
|
3642
|
-
}, null, 8, ["style", "src"])) : y("", !0)
|
|
3643
|
-
])
|
|
3644
|
-
]),
|
|
3645
|
-
_: 3
|
|
3646
|
-
}, 8, ["onClick"])) : y("", !0),
|
|
3647
|
-
k(n($), {
|
|
3648
|
-
class: "x-data-item__content",
|
|
3649
|
-
direction: "column",
|
|
3650
|
-
grow: "",
|
|
3651
|
-
shrink: ""
|
|
3652
|
-
}, {
|
|
3653
|
-
default: f(() => [
|
|
3654
|
-
e.title || d.$slots.title ? (u(), g(n($), {
|
|
3655
|
-
key: 0,
|
|
3656
|
-
class: "x-data-item__section x-data-item__wrapper",
|
|
3657
|
-
align: "center",
|
|
3658
|
-
autoPointer: !0,
|
|
3659
|
-
onClick: e.onTitleClick ? i : void 0
|
|
3660
|
-
}, {
|
|
3661
|
-
default: f(() => [
|
|
3662
|
-
e.icon ? (u(), g(W(n(he)(e.icon)), {
|
|
3663
|
-
key: 0,
|
|
3664
|
-
class: "x-data-item__icon"
|
|
3665
|
-
})) : y("", !0),
|
|
3666
|
-
R("span", ha, [
|
|
3667
|
-
_(d.$slots, "title", {}, () => [
|
|
3668
|
-
N(F(e.title), 1)
|
|
3669
|
-
])
|
|
3670
|
-
])
|
|
3671
|
-
]),
|
|
3672
|
-
_: 3
|
|
3673
|
-
}, 8, ["onClick"])) : y("", !0),
|
|
3674
|
-
e.description || d.$slots.description ? (u(), E("div", va, [
|
|
3675
|
-
_(d.$slots, "description", {}, () => [
|
|
3676
|
-
N(F(e.description), 1)
|
|
3677
|
-
])
|
|
3678
|
-
])) : y("", !0),
|
|
3679
|
-
d.$slots.default ? (u(), E("div", ba, [
|
|
3680
|
-
_(d.$slots, "default")
|
|
3681
|
-
])) : y("", !0),
|
|
3682
|
-
e.actions || e.actionBarProps || d.$slots.actions ? (u(), E("div", _a, [
|
|
3683
|
-
_(d.$slots, "actions", {}, () => [
|
|
3684
|
-
k(n(Pe), j(c.value, {
|
|
3685
|
-
onClick: m,
|
|
3686
|
-
onCommand: p
|
|
3687
|
-
}), null, 16)
|
|
3688
|
-
])
|
|
3689
|
-
])) : y("", !0)
|
|
3690
|
-
]),
|
|
3691
|
-
_: 3
|
|
3692
|
-
})
|
|
3693
|
-
]),
|
|
3694
|
-
_: 3
|
|
3695
|
-
}, 8, ["direction", "class"]));
|
|
3696
|
-
}
|
|
3697
|
-
}), wa = {
|
|
3698
|
-
option: {
|
|
3699
|
-
type: Object
|
|
3700
|
-
},
|
|
3701
|
-
width: {
|
|
3702
|
-
type: [Number, String],
|
|
3703
|
-
default: "100%"
|
|
3704
|
-
},
|
|
3705
|
-
height: {
|
|
3706
|
-
type: [Number, String],
|
|
3707
|
-
default: "400px"
|
|
3708
|
-
}
|
|
3709
|
-
};
|
|
3710
|
-
function xa(a, t) {
|
|
3711
|
-
const e = D();
|
|
3712
|
-
return ut(() => {
|
|
3713
|
-
const o = n(a);
|
|
3714
|
-
o && (e.value || (e.value = be(nt.init(o))), e.value.setOption(t.option || {}));
|
|
3715
|
-
}), dt(() => {
|
|
3716
|
-
e.value && e.value.dispose();
|
|
3717
|
-
}), L(
|
|
3718
|
-
() => t.option,
|
|
3719
|
-
(o) => {
|
|
3720
|
-
e.value && e.value.setOption(o || {});
|
|
3721
|
-
},
|
|
3722
|
-
{ deep: !0 }
|
|
3723
|
-
), No(
|
|
3724
|
-
a,
|
|
3725
|
-
Lo(() => {
|
|
3726
|
-
e.value && e.value.resize();
|
|
3727
|
-
}, 150)
|
|
3728
|
-
), {
|
|
3729
|
-
echartsInstance: e,
|
|
3730
|
-
echarts: nt
|
|
3731
|
-
};
|
|
3732
|
-
}
|
|
3733
|
-
const Sa = /* @__PURE__ */ M({
|
|
3734
|
-
name: "XChart",
|
|
3735
|
-
__name: "Chart",
|
|
3736
|
-
props: wa,
|
|
3737
|
-
setup(a, { expose: t }) {
|
|
3738
|
-
const e = a, o = D(), { echartsInstance: l, echarts: s } = xa(o, e), c = h(() => ({
|
|
3739
|
-
width: oe(e.width),
|
|
3740
|
-
height: oe(e.height)
|
|
3741
|
-
}));
|
|
3742
|
-
return t({
|
|
3743
|
-
chartRef: o,
|
|
3744
|
-
echartsInstance: l,
|
|
3745
|
-
echarts: s
|
|
3746
|
-
}), (r, i) => (u(), E("div", {
|
|
3747
|
-
ref_key: "chartRef",
|
|
3748
|
-
ref: o,
|
|
3749
|
-
style: ue(c.value)
|
|
3750
|
-
}, null, 4));
|
|
3751
|
-
}
|
|
3752
|
-
}), za = [
|
|
3753
|
-
en,
|
|
3754
|
-
ae,
|
|
3755
|
-
ne,
|
|
3756
|
-
pn,
|
|
3757
|
-
Y,
|
|
3758
|
-
Pe,
|
|
3759
|
-
$,
|
|
3760
|
-
Et,
|
|
3761
|
-
Mt,
|
|
3762
|
-
Je,
|
|
3763
|
-
na,
|
|
3764
|
-
Vt,
|
|
3765
|
-
Ft,
|
|
3766
|
-
ma,
|
|
3767
|
-
ga,
|
|
3768
|
-
ka,
|
|
3769
|
-
Sa
|
|
3770
|
-
], Fa = "0.6.25", Ca = Ko(za), Oa = Ca.install;
|
|
3771
|
-
export {
|
|
3772
|
-
lt as Draggable,
|
|
3773
|
-
at as INSTALLED_KEY,
|
|
3774
|
-
It as MASK_KEY,
|
|
3775
|
-
Da as NOOP,
|
|
3776
|
-
it as Resizable,
|
|
3777
|
-
Bt as TAB_CREATORS_KEY,
|
|
3778
|
-
Jn as TAB_ITEM_WIDTH,
|
|
3779
|
-
Y as XAction,
|
|
3780
|
-
Pe as XActionBar,
|
|
3781
|
-
Sa as XChart,
|
|
3782
|
-
$ as XContainer,
|
|
3783
|
-
ka as XDataItem,
|
|
3784
|
-
Je as XDialog,
|
|
3785
|
-
ma as XDialogForm,
|
|
3786
|
-
Vt as XField,
|
|
3787
|
-
Ft as XForm,
|
|
3788
|
-
Et as XHeader,
|
|
3789
|
-
ae as XIcon,
|
|
3790
|
-
na as XMask,
|
|
3791
|
-
ne as XMenu,
|
|
3792
|
-
Mt as XPanel,
|
|
3793
|
-
pn as XSimpleMask,
|
|
3794
|
-
en as XStartup,
|
|
3795
|
-
ga as XTabs,
|
|
3796
|
-
bn as actionBarProps,
|
|
3797
|
-
Tt as actionProps,
|
|
3798
|
-
Pt as builtinFieldEditors,
|
|
3799
|
-
wa as chartProps,
|
|
3800
|
-
za as components,
|
|
3801
|
-
_n as containerProps,
|
|
3802
|
-
Ge as createDialog,
|
|
3803
|
-
ya as dataItemProps,
|
|
3804
|
-
Oa as default,
|
|
3805
|
-
Ra as defineTab,
|
|
3806
|
-
pa as dialogFormProps,
|
|
3807
|
-
Cn as dialogProps,
|
|
3808
|
-
ia as fieldProps,
|
|
3809
|
-
Dt as formInstanceKey,
|
|
3810
|
-
Rt as formModelKey,
|
|
3811
|
-
da as formProps,
|
|
3812
|
-
oe as getSizeValue,
|
|
3813
|
-
kn as headerProps,
|
|
3814
|
-
on as iconProps,
|
|
3815
|
-
tn as iconSizeMap,
|
|
3816
|
-
Oa as install,
|
|
3817
|
-
Ko as makeInstaller,
|
|
3818
|
-
Gn as maskProps,
|
|
3819
|
-
Pa as omit,
|
|
3820
|
-
Sn as panelProps,
|
|
3821
|
-
Te as parseSize,
|
|
3822
|
-
Va as pick,
|
|
3823
|
-
fa as tabsProps,
|
|
3824
|
-
Ze as useDisabled,
|
|
3825
|
-
he as useIcon,
|
|
3826
|
-
yn as useIconProps,
|
|
3827
|
-
zn as vDraggable,
|
|
3828
|
-
$t as vResizable,
|
|
3829
|
-
Fa as version
|
|
3830
|
-
};
|