@done-coding/admin-core 0.14.1-alpha.0 → 0.15.1-alpha.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/es/components/app-layout/AppBody.vue.mjs +2 -2
- package/es/components/app-layout/AppBody.vue2.mjs +47 -44
- package/es/components/app-layout/AppPage.vue.mjs +1 -1
- package/es/components/app-layout/AppPage.vue2.mjs +146 -90
- package/es/components/app-layout/app-page-geometry.mjs +42 -15
- package/es/components/display/TabsMain.vue.mjs +114 -59
- package/es/components/display/TabsTile.vue.mjs +7 -0
- package/es/components/display/TabsTile.vue2.mjs +182 -0
- package/es/components/display/use-tabs-query-sync.mjs +26 -0
- package/es/components/form/FormSearch.vue.mjs +2 -2
- package/es/components/form/FormSearch.vue2.mjs +84 -75
- package/es/components/form/form-search-utils.mjs +58 -29
- package/es/components/panel/PanelMain.vue.mjs +1 -1
- package/es/components/panel/PanelMain.vue2.mjs +15 -15
- package/es/hooks/use-channel-viewport-height.mjs +1 -4
- package/es/hooks/use-theme-apply.mjs +65 -54
- package/es/index.mjs +203 -196
- package/es/inject/key.mjs +19 -13
- package/es/store/app.mjs +77 -68
- package/es/style.css +1 -1
- package/es/utils/dom.mjs +12 -0
- package/package.json +2 -2
- package/types/components/app-layout/app-page-geometry.d.ts +15 -0
- package/types/components/display/TabsTile.vue.d.ts +208 -0
- package/types/components/display/types.d.ts +7 -0
- package/types/components/display/use-tabs-query-sync.d.ts +16 -0
- package/types/components/form/form-search-utils.d.ts +13 -6
- package/types/components/modal/ConfirmModal.vue.d.ts +1 -1
- package/types/inject/key.d.ts +13 -1
- package/types/injectInfo.json.d.ts +1 -1
- package/types/store/app.d.ts +19 -1
- package/types/utils/dom.d.ts +1 -0
- package/types/utils/index.d.ts +1 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { stringifyFormData as
|
|
3
|
-
import { resolveSearchLayout as
|
|
4
|
-
import { ElCol as
|
|
1
|
+
import { defineComponent as T, useAttrs as U, ref as x, computed as o, shallowRef as j, openBlock as d, createBlock as v, normalizeClass as q, withCtx as r, withDirectives as J, createVNode as i, mergeProps as K, unref as l, createSlots as X, normalizeProps as B, guardReactiveProps as F, createElementVNode as Y, createTextVNode as g, toDisplayString as Z, createCommentVNode as ee, renderList as te, renderSlot as ae, vShow as oe } from "vue";
|
|
2
|
+
import { resolveFormLayout as L, stringifyFormData as re } from "./utils.mjs";
|
|
3
|
+
import { resolveSearchLayout as le, resolveSearchLabelPosition as se, resolveSearchItemOccupancy as ne, computeSearchGeometry as ie, getCurrentSpan as ue, packSearchFormList as ce } from "./form-search-utils.mjs";
|
|
4
|
+
import { ElCol as me, ElButton as b, ElIcon as pe } from "element-plus";
|
|
5
5
|
import { ArrowDown as de, ArrowUp as ve } from "@element-plus/icons-vue";
|
|
6
6
|
import fe from "./FormMain.vue.mjs";
|
|
7
|
-
import
|
|
8
|
-
import { useBreakpoint as
|
|
7
|
+
import he from "../display/WatchSize.vue.mjs";
|
|
8
|
+
import { useBreakpoint as ye } from "../../hooks/use-breakpoint.mjs";
|
|
9
9
|
import { useCustomBreakpoint as we } from "../../hooks/use-custom-breakpoint.mjs";
|
|
10
|
-
const ge = { class: "btn-box" },
|
|
10
|
+
const ge = { class: "btn-box" }, Re = /* @__PURE__ */ T({
|
|
11
11
|
name: "FormSearch",
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
__name: "FormSearch",
|
|
@@ -30,45 +30,54 @@ const ge = { class: "btn-box" }, Fe = /* @__PURE__ */ H({
|
|
|
30
30
|
layoutScale: {}
|
|
31
31
|
},
|
|
32
32
|
emits: ["search", "heightChange", "visibleChange"],
|
|
33
|
-
setup(
|
|
34
|
-
const
|
|
35
|
-
() =>
|
|
36
|
-
), s =
|
|
37
|
-
() =>
|
|
38
|
-
),
|
|
39
|
-
() =>
|
|
40
|
-
),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
33
|
+
setup(u, { expose: P, emit: R }) {
|
|
34
|
+
const a = u, c = R, E = U(), f = x(!1), { activeBreakpoint: M } = ye(), { elRef: V, activeBreakpoint: D } = we(), h = o(
|
|
35
|
+
() => a.compact ? D.value : M.value
|
|
36
|
+
), s = x(!0), _ = o(() => a.data), m = o(
|
|
37
|
+
() => le(a.compact, a.layout, h.value)
|
|
38
|
+
), A = o(
|
|
39
|
+
() => se(a.compact, a.labelPosition)
|
|
40
|
+
), N = o(() => {
|
|
41
|
+
const e = L(m.value);
|
|
42
|
+
return a.list.filter((t) => t.hide !== !0).map(
|
|
43
|
+
(t) => ne(
|
|
44
|
+
a.compact ? e : { ...e, ...L(t.layout) },
|
|
45
|
+
h.value
|
|
46
|
+
)
|
|
47
|
+
);
|
|
48
|
+
}), y = o(
|
|
49
|
+
() => ie({
|
|
50
|
+
spans: N.value,
|
|
51
|
+
buttonMinSpan: ue(
|
|
52
|
+
m.value,
|
|
53
|
+
h.value
|
|
54
|
+
),
|
|
55
|
+
maxRows: a.maxRows,
|
|
56
|
+
collapsed: s.value
|
|
57
|
+
})
|
|
58
|
+
), W = o(
|
|
59
|
+
() => a.maxRows > 0 && y.value.needsFold
|
|
60
|
+
), $ = o(() => ({ span: y.value.buttonSpan })), G = o(
|
|
61
|
+
() => ce(a.list, {
|
|
62
|
+
compact: a.compact,
|
|
63
|
+
itemLayout: m.value ?? {},
|
|
64
|
+
collapsing: s.value && a.maxRows > 0,
|
|
65
|
+
threshold: y.value.showCount
|
|
57
66
|
})
|
|
58
67
|
), k = (e = !s.value) => {
|
|
59
68
|
s.value = e;
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
}, n = j(),
|
|
63
|
-
...
|
|
64
|
-
...
|
|
65
|
-
}),
|
|
69
|
+
}, I = (e) => {
|
|
70
|
+
c("heightChange", e);
|
|
71
|
+
}, n = j(), S = (e) => ({
|
|
72
|
+
...a.staticQuery || {},
|
|
73
|
+
...re(e, a.list)
|
|
74
|
+
}), C = () => {
|
|
66
75
|
var e;
|
|
67
|
-
(e = n.value) == null || e.resetFields(),
|
|
76
|
+
(e = n.value) == null || e.resetFields(), c("search", S(a.data), "reset");
|
|
68
77
|
}, w = (e = "search") => {
|
|
69
78
|
var t;
|
|
70
79
|
(t = n.value) == null || t.validate().then(() => {
|
|
71
|
-
|
|
80
|
+
c("search", S(a.data), e);
|
|
72
81
|
});
|
|
73
82
|
}, Q = (e) => {
|
|
74
83
|
w(e);
|
|
@@ -86,70 +95,70 @@ const ge = { class: "btn-box" }, Fe = /* @__PURE__ */ H({
|
|
|
86
95
|
var t;
|
|
87
96
|
return (t = n.value) == null ? void 0 : t.clearValidate(e);
|
|
88
97
|
},
|
|
89
|
-
triggerReset:
|
|
98
|
+
triggerReset: C,
|
|
90
99
|
triggerSearch: () => w(),
|
|
91
100
|
toggleCollapse: k,
|
|
92
|
-
isCollapsed:
|
|
101
|
+
isCollapsed: o(() => s.value)
|
|
93
102
|
};
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
103
|
+
P(z);
|
|
104
|
+
const H = (e) => {
|
|
105
|
+
f.value = e, c("visibleChange", e);
|
|
97
106
|
};
|
|
98
|
-
return (e, t) => (
|
|
107
|
+
return (e, t) => (d(), v(he, {
|
|
99
108
|
ref_key: "breakpointEl",
|
|
100
|
-
ref:
|
|
109
|
+
ref: V,
|
|
101
110
|
class: q(["form-search", {
|
|
102
|
-
"form-search_show":
|
|
111
|
+
"form-search_show": f.value
|
|
103
112
|
}]),
|
|
104
|
-
onHeightChange:
|
|
113
|
+
onHeightChange: I
|
|
105
114
|
}, {
|
|
106
115
|
default: r(() => [
|
|
107
|
-
J(
|
|
116
|
+
J(i(fe, K({
|
|
108
117
|
ref_key: "formMain",
|
|
109
118
|
ref: n,
|
|
110
|
-
list:
|
|
111
|
-
data:
|
|
112
|
-
"row-gutter":
|
|
119
|
+
list: G.value,
|
|
120
|
+
data: _.value,
|
|
121
|
+
"row-gutter": u.rowGutter
|
|
113
122
|
}, l(E), {
|
|
114
|
-
layout:
|
|
115
|
-
labelPosition:
|
|
116
|
-
labelWidth:
|
|
123
|
+
layout: m.value,
|
|
124
|
+
labelPosition: A.value,
|
|
125
|
+
labelWidth: u.labelWidth,
|
|
117
126
|
onSubmit: Q,
|
|
118
|
-
onVisibleChange:
|
|
119
|
-
}),
|
|
127
|
+
onVisibleChange: H
|
|
128
|
+
}), X({
|
|
120
129
|
default: r(() => [
|
|
121
|
-
|
|
130
|
+
i(l(me), B(F($.value)), {
|
|
122
131
|
default: r(() => [
|
|
123
|
-
|
|
124
|
-
|
|
132
|
+
Y("div", ge, [
|
|
133
|
+
W.value ? (d(), v(l(b), {
|
|
125
134
|
key: 0,
|
|
126
135
|
type: "primary",
|
|
127
136
|
link: "",
|
|
128
|
-
onMousedown: t[0] || (t[0] = (
|
|
137
|
+
onMousedown: t[0] || (t[0] = (p) => k())
|
|
129
138
|
}, {
|
|
130
139
|
default: r(() => [
|
|
131
|
-
|
|
140
|
+
i(l(pe), { class: "btn-box-expand-icon" }, {
|
|
132
141
|
default: r(() => [
|
|
133
|
-
s.value ? (
|
|
142
|
+
s.value ? (d(), v(l(de), { key: 0 })) : (d(), v(l(ve), { key: 1 }))
|
|
134
143
|
]),
|
|
135
144
|
_: 1
|
|
136
145
|
}),
|
|
137
|
-
g(" " +
|
|
146
|
+
g(" " + Z(s.value ? "展开更多" : "收起更多"), 1)
|
|
138
147
|
]),
|
|
139
148
|
_: 1
|
|
140
|
-
})) :
|
|
141
|
-
|
|
149
|
+
})) : ee("", !0),
|
|
150
|
+
i(l(b), {
|
|
142
151
|
type: "warning",
|
|
143
|
-
onMousedown:
|
|
152
|
+
onMousedown: C
|
|
144
153
|
}, {
|
|
145
154
|
default: r(() => [...t[2] || (t[2] = [
|
|
146
155
|
g("重置", -1)
|
|
147
156
|
])]),
|
|
148
157
|
_: 1
|
|
149
158
|
}),
|
|
150
|
-
|
|
159
|
+
i(l(b), {
|
|
151
160
|
type: "primary",
|
|
152
|
-
onMousedown: t[1] || (t[1] = (
|
|
161
|
+
onMousedown: t[1] || (t[1] = (p) => w())
|
|
153
162
|
}, {
|
|
154
163
|
default: r(() => [...t[3] || (t[3] = [
|
|
155
164
|
g("查询", -1)
|
|
@@ -163,14 +172,14 @@ const ge = { class: "btn-box" }, Fe = /* @__PURE__ */ H({
|
|
|
163
172
|
]),
|
|
164
173
|
_: 2
|
|
165
174
|
}, [
|
|
166
|
-
|
|
167
|
-
name:
|
|
168
|
-
fn: r((
|
|
169
|
-
|
|
175
|
+
te(u.list, (p) => ({
|
|
176
|
+
name: p.key,
|
|
177
|
+
fn: r((O) => [
|
|
178
|
+
ae(e.$slots, p.key, B(F(O)), void 0, !0)
|
|
170
179
|
])
|
|
171
180
|
}))
|
|
172
181
|
]), 1040, ["list", "data", "row-gutter", "layout", "labelPosition", "labelWidth"]), [
|
|
173
|
-
[oe,
|
|
182
|
+
[oe, f.value]
|
|
174
183
|
])
|
|
175
184
|
]),
|
|
176
185
|
_: 3
|
|
@@ -178,5 +187,5 @@ const ge = { class: "btn-box" }, Fe = /* @__PURE__ */ H({
|
|
|
178
187
|
}
|
|
179
188
|
});
|
|
180
189
|
export {
|
|
181
|
-
|
|
190
|
+
Re as default
|
|
182
191
|
};
|
|
@@ -1,34 +1,63 @@
|
|
|
1
|
-
import { resolveFormLayout as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
r[n] = {
|
|
11
|
-
span: u,
|
|
12
|
-
offset: p(t, u)
|
|
13
|
-
};
|
|
1
|
+
import { resolveFormLayout as p } from "./utils.mjs";
|
|
2
|
+
const i = (t, e) => {
|
|
3
|
+
const n = p(t), o = n[e];
|
|
4
|
+
return typeof o == "number" ? o : n.span ?? 6;
|
|
5
|
+
}, h = (t, e) => {
|
|
6
|
+
if (typeof t == "number") return t;
|
|
7
|
+
if (t && typeof t == "object") {
|
|
8
|
+
const n = t;
|
|
9
|
+
return (n.span ?? 24) + (n.offset ?? 0);
|
|
14
10
|
}
|
|
15
|
-
return
|
|
16
|
-
},
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
return e;
|
|
12
|
+
}, m = (t, e) => {
|
|
13
|
+
const n = typeof t.span == "number" ? t.span : 24, o = h(
|
|
14
|
+
t[e],
|
|
15
|
+
n
|
|
16
|
+
);
|
|
17
|
+
return Math.min(24, Math.max(1, o));
|
|
18
|
+
}, f = (t) => {
|
|
19
|
+
let e = 0, n = 0;
|
|
20
|
+
for (const o of t)
|
|
21
|
+
e === 0 || n + o > 24 ? (e += 1, n = o) : n += o;
|
|
22
|
+
return { rows: e, lastRowUsed: n };
|
|
23
|
+
}, l = (t, e) => {
|
|
24
|
+
const { rows: n, lastRowUsed: o } = f(t), r = 24 - o;
|
|
25
|
+
return n > 0 && r >= e ? { totalRows: n, buttonSpan: r } : { totalRows: n + 1, buttonSpan: 24 };
|
|
26
|
+
}, b = ({
|
|
27
|
+
spans: t,
|
|
28
|
+
buttonMinSpan: e,
|
|
29
|
+
maxRows: n,
|
|
30
|
+
collapsed: o
|
|
31
|
+
}) => {
|
|
32
|
+
const r = Math.min(24, Math.max(1, e)), a = l(t, r);
|
|
33
|
+
if (n <= 0)
|
|
34
|
+
return {
|
|
35
|
+
showCount: t.length,
|
|
36
|
+
needsFold: !1,
|
|
37
|
+
buttonSpan: a.buttonSpan
|
|
38
|
+
};
|
|
39
|
+
let c = t.length, s = a;
|
|
40
|
+
for (; c > 0 && s.totalRows > n; )
|
|
41
|
+
c -= 1, s = l(t.slice(0, c), r);
|
|
42
|
+
return {
|
|
43
|
+
showCount: o ? c : t.length,
|
|
44
|
+
needsFold: c < t.length,
|
|
45
|
+
buttonSpan: o ? s.buttonSpan : a.buttonSpan
|
|
46
|
+
};
|
|
47
|
+
}, y = (t, e, n) => t ? { span: i(e, n) } : e, d = (t, e) => t ? "top" : e, w = (t, e) => {
|
|
48
|
+
const { compact: n, itemLayout: o, collapsing: r, threshold: a } = e;
|
|
49
|
+
if (!n && !r) return t;
|
|
50
|
+
let c = 0;
|
|
51
|
+
return t.map((s) => {
|
|
52
|
+
let u = s;
|
|
53
|
+
return n && (u = { ...u, layout: o }), s.hide !== !0 && (c += 1, r && c > a && (u = { ...u, hide: !0 })), u;
|
|
24
54
|
});
|
|
25
55
|
};
|
|
26
56
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
d as
|
|
32
|
-
|
|
33
|
-
L as resolveSearchLayout
|
|
57
|
+
b as computeSearchGeometry,
|
|
58
|
+
i as getCurrentSpan,
|
|
59
|
+
w as packSearchFormList,
|
|
60
|
+
m as resolveSearchItemOccupancy,
|
|
61
|
+
d as resolveSearchLabelPosition,
|
|
62
|
+
y as resolveSearchLayout
|
|
34
63
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./PanelMain.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9e060e8b"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as w, useCssVars as B, computed as o, provide as
|
|
1
|
+
import { defineComponent as w, useCssVars as B, computed as o, provide as L, ref as M, watch as x, openBlock as l, createBlock as u, unref as d, withCtx as c, createElementBlock as F, Fragment as j, renderList as O, withDirectives as P, mergeProps as T, resolveDynamicComponent as U, normalizeClass as A, createVNode as D, vShow as G } from "vue";
|
|
2
2
|
import H from "./PanelItem.vue.mjs";
|
|
3
3
|
import { ElCard as f, ElRow as N, ElCol as V } from "element-plus";
|
|
4
4
|
import { NEST_LAYOUT_SCALE_KEY as W } from "../../inject/key.mjs";
|
|
@@ -12,18 +12,18 @@ const q = /* @__PURE__ */ w({
|
|
|
12
12
|
layout: { default: () => ({ span: 24 }) },
|
|
13
13
|
layoutScale: { default: 1 },
|
|
14
14
|
list: {},
|
|
15
|
-
itemCard: { type: [Boolean, Object]
|
|
15
|
+
itemCard: { type: [Boolean, Object] },
|
|
16
16
|
refreshFn: {}
|
|
17
17
|
},
|
|
18
18
|
emits: ["submitSuccess"],
|
|
19
19
|
setup(s, { emit: y }) {
|
|
20
20
|
B((a) => ({
|
|
21
|
-
|
|
21
|
+
v6dd4af74: h.value
|
|
22
22
|
}));
|
|
23
|
-
const r = s,
|
|
24
|
-
|
|
25
|
-
const n =
|
|
26
|
-
() => `panel-main-item-col-wrap_${m.value === f ? "card" : "
|
|
23
|
+
const r = s, v = y, C = o(() => r.layoutScale ?? 1);
|
|
24
|
+
L(W, C);
|
|
25
|
+
const n = M({}), m = o(() => r.itemCard ? f : "div"), S = o(
|
|
26
|
+
() => `panel-main-item-col-wrap_${m.value === f ? "card" : "plain"}`
|
|
27
27
|
), h = o(
|
|
28
28
|
() => typeof r.itemCard == "object" && r.itemCard.lastMarginBottom ? r.itemCard.lastMarginBottom : 0
|
|
29
29
|
), k = (a) => {
|
|
@@ -43,13 +43,13 @@ const q = /* @__PURE__ */ w({
|
|
|
43
43
|
...p(r.layout, t),
|
|
44
44
|
...p(a, t)
|
|
45
45
|
};
|
|
46
|
-
},
|
|
46
|
+
}, E = (a, t) => {
|
|
47
47
|
n.value = {}, t && (n.value[a] = t);
|
|
48
|
-
},
|
|
48
|
+
}, b = (a) => (t) => {
|
|
49
49
|
var e;
|
|
50
50
|
return (e = r.refreshFn) == null ? void 0 : e.call(r, t, a);
|
|
51
|
-
},
|
|
52
|
-
|
|
51
|
+
}, g = (a, t) => {
|
|
52
|
+
v("submitSuccess", t, a);
|
|
53
53
|
};
|
|
54
54
|
return x(
|
|
55
55
|
() => r.list,
|
|
@@ -70,16 +70,16 @@ const q = /* @__PURE__ */ w({
|
|
|
70
70
|
}, { ref_for: !0 }, _(e.layout), { class: "panel-main-item-col" }), {
|
|
71
71
|
default: c(() => [
|
|
72
72
|
(l(), u(U(m.value), {
|
|
73
|
-
class: A(
|
|
73
|
+
class: A(S.value)
|
|
74
74
|
}, {
|
|
75
75
|
default: c(() => [
|
|
76
76
|
D(H, {
|
|
77
77
|
data: s.data,
|
|
78
78
|
config: e,
|
|
79
79
|
editing: n.value[e.key] ?? !1,
|
|
80
|
-
"refresh-fn":
|
|
81
|
-
"onUpdate:editing": (i) =>
|
|
82
|
-
onSubmitSuccess: (i) =>
|
|
80
|
+
"refresh-fn": b(e.key),
|
|
81
|
+
"onUpdate:editing": (i) => E(e.key, i),
|
|
82
|
+
onSubmitSuccess: (i) => g(e.key, i)
|
|
83
83
|
}, null, 8, ["data", "config", "editing", "refresh-fn", "onUpdate:editing", "onSubmitSuccess"])
|
|
84
84
|
]),
|
|
85
85
|
_: 2
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { inject as i, computed as o, watch as v } from "vue";
|
|
2
2
|
import { BODY_CONTENT_VIEWPORT_HEIGHT as p } from "../inject/key.mjs";
|
|
3
3
|
const f = (e, l = {}) => {
|
|
4
|
-
const h = l.fallback ?? 0, n = e.parentChannel ? Symbol.for(e.parentChannel) : void 0, t = n ? i(n, void 0) : void 0, r = i(
|
|
5
|
-
p,
|
|
6
|
-
void 0
|
|
7
|
-
), a = o(() => t ? t.viewportHeight.value : e.viewportHeight !== void 0 ? e.viewportHeight : r ? r.value : h), c = o(() => (t == null ? void 0 : t.level) ?? 0);
|
|
4
|
+
const h = l.fallback ?? 0, n = e.parentChannel ? Symbol.for(e.parentChannel) : void 0, t = n ? i(n, void 0) : void 0, r = i(p, void 0), a = o(() => t ? t.viewportHeight.value : e.viewportHeight !== void 0 ? e.viewportHeight : r ? r.value : h), c = o(() => (t == null ? void 0 : t.level) ?? 0);
|
|
8
5
|
return v(
|
|
9
6
|
// eslint-disable-next-line vue/no-setup-props-destructure
|
|
10
7
|
() => e.parentChannel,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { watch as
|
|
2
|
-
import { themeScaleDerive as y, themeScaleParseHex as
|
|
3
|
-
const
|
|
1
|
+
import { watch as p, onScopeDispose as C } from "vue";
|
|
2
|
+
import { themeScaleDerive as y, themeScaleParseHex as E, themeScaleMix as S, themeScaleToRgba as $ } from "../utils/theme-scale.mjs";
|
|
3
|
+
const v = "dc-core-theme", L = () => Math.random().toString(36).slice(2, 9), A = [
|
|
4
4
|
["primaryColor", { scale: !0, el: "--el-color-primary" }],
|
|
5
5
|
["successColor", { scale: !0, el: "--el-color-success" }],
|
|
6
6
|
["warningColor", { scale: !0, el: "--el-color-warning" }],
|
|
@@ -18,60 +18,60 @@ const L = "dc-core-theme", A = () => Math.random().toString(36).slice(2, 9), T =
|
|
|
18
18
|
["blur", {}],
|
|
19
19
|
["focusRing", {}],
|
|
20
20
|
["surface", {}]
|
|
21
|
-
],
|
|
21
|
+
], m = [
|
|
22
22
|
"light-3",
|
|
23
23
|
"light-5",
|
|
24
24
|
"light-7",
|
|
25
25
|
"light-8",
|
|
26
26
|
"light-9",
|
|
27
27
|
"dark-2"
|
|
28
|
-
],
|
|
28
|
+
], T = (o) => o.replace(/([A-Z])/g, "-$1").toLowerCase(), g = (o, t) => {
|
|
29
29
|
const e = [];
|
|
30
|
-
for (const [
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
33
|
-
const i = `--dc-core-${
|
|
34
|
-
if (
|
|
35
|
-
const s = y(
|
|
36
|
-
e.push(`${i}: ${
|
|
37
|
-
for (const r of
|
|
30
|
+
for (const [l, n] of A) {
|
|
31
|
+
const c = o[l];
|
|
32
|
+
if (c === void 0 || c === "") continue;
|
|
33
|
+
const i = `--dc-core-${T(l)}`, d = n.el === void 0 ? [] : Array.isArray(n.el) ? n.el : [n.el];
|
|
34
|
+
if (n.scale) {
|
|
35
|
+
const s = y(c, t);
|
|
36
|
+
e.push(`${i}: ${c};`);
|
|
37
|
+
for (const r of m)
|
|
38
38
|
e.push(`${i}-${r}: ${s[r]};`);
|
|
39
39
|
for (const r of d) {
|
|
40
|
-
e.push(`${r}: ${
|
|
41
|
-
for (const a of
|
|
40
|
+
e.push(`${r}: ${c};`);
|
|
41
|
+
for (const a of m)
|
|
42
42
|
e.push(`${r}-${a}: ${s[a]};`);
|
|
43
43
|
}
|
|
44
44
|
} else {
|
|
45
|
-
e.push(`${i}: ${
|
|
46
|
-
for (const s of d) e.push(`${s}: ${
|
|
45
|
+
e.push(`${i}: ${c};`);
|
|
46
|
+
for (const s of d) e.push(`${s}: ${c};`);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
return e.join(`
|
|
50
50
|
`);
|
|
51
|
-
},
|
|
51
|
+
}, k = 0.4, D = 10, P = {
|
|
52
52
|
light: 0.5,
|
|
53
53
|
dark: 0.72
|
|
54
54
|
}, f = (o, t) => {
|
|
55
55
|
if (!o) return "";
|
|
56
|
-
const e =
|
|
56
|
+
const e = E(o);
|
|
57
57
|
if (!e) return "";
|
|
58
|
-
const
|
|
58
|
+
const l = Math.max(...e), n = l === 0 ? 0 : Math.min(k, D / l), c = S(o, "#000000", n);
|
|
59
59
|
return `--el-overlay-color-lighter: ${$(
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
c,
|
|
61
|
+
P[t]
|
|
62
62
|
)};`;
|
|
63
|
-
},
|
|
63
|
+
}, w = { light: 0.9, dark: 0.8 }, h = (o, t) => {
|
|
64
64
|
if (!o) return "";
|
|
65
|
-
const e = $(o,
|
|
65
|
+
const e = $(o, w[t]);
|
|
66
66
|
return e === o ? "" : `--el-mask-color: ${e};`;
|
|
67
|
-
},
|
|
68
|
-
const t = o.light, e = o.dark,
|
|
69
|
-
|
|
67
|
+
}, I = 0.88, B = (o, t) => !o || !E(o) ? "" : `--dc-core-dialog-surface: ${S(o, "#ffffff", I)};`, R = (o) => {
|
|
68
|
+
const t = o.light, e = o.dark, l = g(t, "light"), n = g(e, "dark"), i = [
|
|
69
|
+
l,
|
|
70
70
|
"color: var(--dc-core-base-color);",
|
|
71
71
|
f(t.bodyColor, "light"),
|
|
72
72
|
h(t.bodyColor, "light")
|
|
73
73
|
].filter(Boolean), d = [
|
|
74
|
-
|
|
74
|
+
n,
|
|
75
75
|
f(e.bodyColor, "dark"),
|
|
76
76
|
h(e.bodyColor, "dark"),
|
|
77
77
|
B(e.bodyColor)
|
|
@@ -87,13 +87,24 @@ const L = "dc-core-theme", A = () => Math.random().toString(36).slice(2, 9), T =
|
|
|
87
87
|
`)}
|
|
88
88
|
}
|
|
89
89
|
`;
|
|
90
|
-
}, H = "dc-core-rhythm",
|
|
90
|
+
}, H = "dc-core-rhythm", x = "dc-core-ep-bridge", b = "dc-core-ep-structural", M = [
|
|
91
|
+
// 居中浮层(Dialog / MessageBox)+ 抽屉(Drawer,含 ConfirmModal drawer 形态 + 消费方直接
|
|
92
|
+
// 用的 ElDrawer):暗色下面板底 ≈ 页面底 + EP 黑投影不可见 → 边界糊。统一两手保底:
|
|
93
|
+
// ① elevation 提亮面(--dc-core-dialog-surface,仅暗色派生;亮色退 --el-bg-color 零改动);
|
|
94
|
+
// ② 1px 主题描边硬边界(--el-border-color 类明暗自换:亮色浅灰近隐形、暗色中灰清晰)——
|
|
95
|
+
// 融不融底都有区别度,不再仅靠提亮(抽屉与弹窗保底一致)。
|
|
91
96
|
".el-dialog,",
|
|
92
|
-
".el-message-box
|
|
93
|
-
|
|
94
|
-
// 让整块面板亮于页面底而浮起;缺省(亮色 / 非 hex)退 --el-bg-color,亮色零改动。
|
|
97
|
+
".el-message-box,",
|
|
98
|
+
".el-drawer {",
|
|
95
99
|
" background-color: var(--dc-core-dialog-surface, var(--el-bg-color));",
|
|
96
100
|
" border: 1px solid var(--dc-core-border-color, var(--el-border-color));",
|
|
101
|
+
"}",
|
|
102
|
+
// 表格固定列分隔阴影:EP 原值 inset ±10px 0 10px -10px rgba(0,0,0,.15) 为黑投影,暗色近黑底
|
|
103
|
+
// 上不可见 → 横向滚动时固定列无边界。仅**暗色** override 为随主题的边框色(中灰、暗底可见);
|
|
104
|
+
// 亮色保留 EP 默认(黑投影在白底本就可见)。规则 14:优先 --dc-core-border-color、退 --el-border-color。
|
|
105
|
+
":root.dark .el-table {",
|
|
106
|
+
" --el-table-fixed-left-column: inset 10px 0 10px -10px var(--dc-core-border-color, var(--el-border-color));",
|
|
107
|
+
" --el-table-fixed-right-column: inset -10px 0 10px -10px var(--dc-core-border-color, var(--el-border-color));",
|
|
97
108
|
"}"
|
|
98
109
|
].join(`
|
|
99
110
|
`), Y = [
|
|
@@ -166,7 +177,7 @@ const L = "dc-core-theme", A = () => Math.random().toString(36).slice(2, 9), T =
|
|
|
166
177
|
}
|
|
167
178
|
};
|
|
168
179
|
function O(o, t) {
|
|
169
|
-
const e = z[o],
|
|
180
|
+
const e = z[o], l = U[t], n = [
|
|
170
181
|
`--dc-core-space-unit: ${e.spaceUnit};`,
|
|
171
182
|
`--dc-core-content-gap: ${e.gap};`,
|
|
172
183
|
`--dc-core-control-height: ${e.controlHeight};`,
|
|
@@ -177,26 +188,26 @@ function O(o, t) {
|
|
|
177
188
|
`--dc-core-font-size-base: ${e.fontSizeBase};`,
|
|
178
189
|
`--el-font-size-base: ${e.fontSizeBase};`,
|
|
179
190
|
`--dc-core-font-scale: ${e.fontScale};`,
|
|
180
|
-
`--dc-core-motion-duration: ${
|
|
181
|
-
`--el-transition-duration-fast: ${
|
|
182
|
-
`--dc-core-motion-duration-slow: ${
|
|
183
|
-
`--el-transition-duration: ${
|
|
191
|
+
`--dc-core-motion-duration: ${l.duration};`,
|
|
192
|
+
`--el-transition-duration-fast: ${l.duration};`,
|
|
193
|
+
`--dc-core-motion-duration-slow: ${l.durationSlow};`,
|
|
194
|
+
`--el-transition-duration: ${l.durationSlow};`,
|
|
184
195
|
// easing 仅挂 dc-core,[MUST NOT] dual-write 覆盖 EP 两条 bezier——
|
|
185
196
|
// EP ease-in-out / fast 曲线各异,覆盖会让默认档动画曲线漂移;motion 档对 EP 只经 duration 生效。
|
|
186
|
-
`--dc-core-motion-easing: ${
|
|
187
|
-
],
|
|
197
|
+
`--dc-core-motion-easing: ${l.easing};`
|
|
198
|
+
], c = [
|
|
188
199
|
"--dc-core-motion-duration: 0.01ms;",
|
|
189
200
|
"--dc-core-motion-duration-slow: 0.01ms;",
|
|
190
201
|
"--el-transition-duration: 0.01ms;",
|
|
191
202
|
"--el-transition-duration-fast: 0.01ms;"
|
|
192
203
|
];
|
|
193
204
|
return `:root {
|
|
194
|
-
${
|
|
205
|
+
${n.join(`
|
|
195
206
|
`)}
|
|
196
207
|
}
|
|
197
208
|
@media (prefers-reduced-motion: reduce) {
|
|
198
209
|
:root {
|
|
199
|
-
${
|
|
210
|
+
${c.join(
|
|
200
211
|
`
|
|
201
212
|
`
|
|
202
213
|
)}
|
|
@@ -207,23 +218,23 @@ function O(o, t) {
|
|
|
207
218
|
function V(o) {
|
|
208
219
|
const t = o.document ?? (typeof document < "u" ? document : void 0);
|
|
209
220
|
if (!t) return;
|
|
210
|
-
const e =
|
|
221
|
+
const e = L(), l = [], n = (r) => {
|
|
211
222
|
const a = t.createElement("style");
|
|
212
|
-
return a.id = `${r}-${e}`, t.head.appendChild(a),
|
|
223
|
+
return a.id = `${r}-${e}`, t.head.appendChild(a), l.push(a), a;
|
|
213
224
|
};
|
|
214
|
-
let
|
|
215
|
-
const i = () => (
|
|
216
|
-
if (!t.getElementById(
|
|
225
|
+
let c = null;
|
|
226
|
+
const i = () => (c || (c = n(v)), c);
|
|
227
|
+
if (!t.getElementById(b)) {
|
|
217
228
|
const r = t.createElement("style");
|
|
218
|
-
r.id =
|
|
229
|
+
r.id = b, r.textContent = M, t.head.appendChild(r);
|
|
219
230
|
}
|
|
220
|
-
|
|
231
|
+
p(
|
|
221
232
|
o.getThemeConfig,
|
|
222
233
|
(r) => {
|
|
223
234
|
i().textContent = R(r);
|
|
224
235
|
},
|
|
225
236
|
{ deep: !0, immediate: !0 }
|
|
226
|
-
),
|
|
237
|
+
), p(
|
|
227
238
|
o.getThemeIsDark,
|
|
228
239
|
(r) => {
|
|
229
240
|
t.documentElement.classList.toggle("dark", r);
|
|
@@ -232,13 +243,13 @@ function V(o) {
|
|
|
232
243
|
);
|
|
233
244
|
const { getThemeDensity: d, getThemeMotion: s } = o;
|
|
234
245
|
if (d && s) {
|
|
235
|
-
if (!t.getElementById(
|
|
246
|
+
if (!t.getElementById(x)) {
|
|
236
247
|
const u = t.createElement("style");
|
|
237
|
-
u.id =
|
|
248
|
+
u.id = x, u.textContent = Y, t.head.appendChild(u);
|
|
238
249
|
}
|
|
239
250
|
let r = null;
|
|
240
|
-
const a = () => (r || (r =
|
|
241
|
-
|
|
251
|
+
const a = () => (r || (r = n(H)), r);
|
|
252
|
+
p(
|
|
242
253
|
() => [d(), s()],
|
|
243
254
|
([u, _]) => {
|
|
244
255
|
a().textContent = O(u, _);
|
|
@@ -247,7 +258,7 @@ function V(o) {
|
|
|
247
258
|
);
|
|
248
259
|
}
|
|
249
260
|
C(() => {
|
|
250
|
-
|
|
261
|
+
l.forEach((r) => r.remove()), l.length = 0;
|
|
251
262
|
});
|
|
252
263
|
}
|
|
253
264
|
export {
|