@done-coding/admin-core 0.16.0 → 0.17.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 +1 -1
- package/es/components/app-layout/AppBody.vue2.mjs +43 -39
- package/es/components/app-layout/AppPage.vue.mjs +2 -2
- package/es/components/app-layout/AppPage.vue2.mjs +114 -105
- package/es/components/display/TabsHeader.vue.mjs +2 -2
- package/es/components/display/TabsHeader.vue2.mjs +31 -32
- package/es/components/display/TabsRefineFlow.vue.mjs +30 -32
- package/es/components/display/TabsTile.vue.mjs +2 -2
- package/es/components/display/WatchSize.vue.mjs +34 -31
- package/es/components/form/FormMain.vue.mjs +2 -2
- package/es/components/form/FormMain.vue2.mjs +80 -75
- package/es/components/form/FormSearch.vue.mjs +1 -1
- package/es/components/form/FormSearch.vue2.mjs +82 -80
- package/es/components/form/FormSubmitPanel.vue2.mjs +11 -10
- package/es/components/form/use-layout-by-container.mjs +20 -0
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +167 -137
- package/es/components/list-page/use-sticky.mjs +41 -0
- package/es/components/modal/ConfirmModal.vue.mjs +3 -2
- package/es/components/modal/ConfirmModal.vue2.mjs +104 -55
- package/es/components/modal/DetailModal.vue.mjs +40 -34
- package/es/components/modal/ModalPorter.vue.mjs +20 -23
- package/es/components/table/TableMain.vue.mjs +1 -1
- package/es/components/table/TableMain.vue2.mjs +27 -28
- package/es/hooks/activated.mjs +16 -24
- package/es/hooks/use-breakpoint.mjs +17 -21
- package/es/hooks/use-channel-viewport-height.mjs +26 -8
- package/es/hooks/use-observe-size.mjs +26 -0
- package/es/index.mjs +177 -173
- package/es/inject/key.mjs +18 -15
- package/es/style.css +1 -1
- package/es/utils/dom.mjs +11 -1
- package/package.json +2 -2
- package/types/components/app-layout/AppPage.vue.d.ts +8 -0
- package/types/components/display/TabsTile.vue.d.ts +2 -2
- package/types/components/display/WatchSize.vue.d.ts +4 -0
- package/types/components/display/types.d.ts +1 -5
- package/types/components/form/FormItem.vue.d.ts +8 -8
- package/types/components/form/FormMain.vue.d.ts +1 -12
- package/types/components/form/FormSubmitPanel.vue.d.ts +1 -1
- package/types/components/form/types.d.ts +1 -0
- package/types/components/form/use-layout-by-container.d.ts +11 -0
- package/types/components/list-page/ListPage.vue.d.ts +6 -1
- package/types/components/list-page/types.d.ts +5 -0
- package/types/components/list-page/use-sticky.d.ts +19 -0
- package/types/components/modal/ConfirmModal.vue.d.ts +15 -3
- package/types/components/modal/DetailModal.vue.d.ts +4 -1
- package/types/components/panel/PanelItemNestForm.vue.d.ts +1 -1
- package/types/hooks/index.d.ts +1 -0
- package/types/hooks/use-channel-viewport-height.d.ts +2 -1
- package/types/hooks/use-observe-size.d.ts +7 -0
- package/types/inject/key.d.ts +8 -2
- package/types/injectInfo.json.d.ts +1 -1
- package/types/utils/dom.d.ts +1 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as T, useAttrs as U, ref as x, computed as o, shallowRef as j, openBlock as
|
|
1
|
+
import { defineComponent as T, useAttrs as U, ref as x, computed as o, shallowRef as j, openBlock as p, createBlock as v, normalizeClass as q, withCtx as r, withDirectives as J, createVNode as u, mergeProps as K, unref as l, createSlots as X, normalizeProps as B, guardReactiveProps as F, createElementVNode as Y, createTextVNode as b, toDisplayString as Z, createCommentVNode as ee, renderList as te, renderSlot as ae, vShow as oe } from "vue";
|
|
2
2
|
import { resolveFormLayout as L, stringifyFormData as re } from "./utils.mjs";
|
|
3
|
-
import { resolveSearchLayout as le, resolveSearchLabelPosition as
|
|
4
|
-
import { ElCol as me, ElButton as
|
|
5
|
-
import { ArrowDown as
|
|
3
|
+
import { resolveSearchLayout as le, resolveSearchLabelPosition as ne, resolveSearchItemOccupancy as se, computeSearchGeometry as ie, getCurrentSpan as ue, packSearchFormList as ce } from "./form-search-utils.mjs";
|
|
4
|
+
import { ElCol as me, ElButton as g, ElIcon as de } from "element-plus";
|
|
5
|
+
import { ArrowDown as pe, ArrowUp as ve } from "@element-plus/icons-vue";
|
|
6
6
|
import fe from "./FormMain.vue.mjs";
|
|
7
|
-
import
|
|
8
|
-
import { useBreakpoint as
|
|
7
|
+
import ye from "../display/WatchSize.vue.mjs";
|
|
8
|
+
import { useBreakpoint as he } from "../../hooks/use-breakpoint.mjs";
|
|
9
9
|
import { useCustomBreakpoint as we } from "../../hooks/use-custom-breakpoint.mjs";
|
|
10
|
-
const
|
|
10
|
+
const be = { class: "btn-box" }, Re = /* @__PURE__ */ T({
|
|
11
11
|
name: "FormSearch",
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
__name: "FormSearch",
|
|
@@ -27,141 +27,143 @@ const ge = { class: "btn-box" }, Re = /* @__PURE__ */ T({
|
|
|
27
27
|
xl: 6
|
|
28
28
|
}) },
|
|
29
29
|
rowGutter: { default: 14 },
|
|
30
|
-
layoutScale: {}
|
|
30
|
+
layoutScale: {},
|
|
31
|
+
layoutByContainer: { type: Boolean, default: !1 }
|
|
31
32
|
},
|
|
32
33
|
emits: ["search", "heightChange", "visibleChange"],
|
|
33
|
-
setup(
|
|
34
|
-
const
|
|
35
|
-
() =>
|
|
36
|
-
),
|
|
37
|
-
() => le(
|
|
38
|
-
),
|
|
39
|
-
() =>
|
|
40
|
-
),
|
|
34
|
+
setup(i, { expose: P, emit: R }) {
|
|
35
|
+
const t = i, c = R, E = U(), f = x(!1), { activeBreakpoint: M } = he(), { elRef: V, activeBreakpoint: D } = we(), y = o(
|
|
36
|
+
() => t.compact || t.layoutByContainer ? D.value : M.value
|
|
37
|
+
), n = x(!0), A = o(() => t.data), m = o(
|
|
38
|
+
() => le(t.compact, t.layout, y.value)
|
|
39
|
+
), N = o(
|
|
40
|
+
() => ne(t.compact, t.labelPosition)
|
|
41
|
+
), W = o(() => {
|
|
41
42
|
const e = L(m.value);
|
|
42
|
-
return
|
|
43
|
-
(
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
return t.list.filter((a) => a.hide !== !0).map(
|
|
44
|
+
(a) => se(
|
|
45
|
+
t.compact ? e : { ...e, ...L(a.layout) },
|
|
46
|
+
y.value
|
|
46
47
|
)
|
|
47
48
|
);
|
|
48
|
-
}),
|
|
49
|
+
}), h = o(
|
|
49
50
|
() => ie({
|
|
50
|
-
spans:
|
|
51
|
+
spans: W.value,
|
|
51
52
|
buttonMinSpan: ue(
|
|
52
53
|
m.value,
|
|
53
|
-
|
|
54
|
+
y.value
|
|
54
55
|
),
|
|
55
|
-
maxRows:
|
|
56
|
-
collapsed:
|
|
56
|
+
maxRows: t.maxRows,
|
|
57
|
+
collapsed: n.value
|
|
57
58
|
})
|
|
58
|
-
),
|
|
59
|
-
() =>
|
|
60
|
-
),
|
|
61
|
-
() => ce(
|
|
62
|
-
compact:
|
|
59
|
+
), $ = o(
|
|
60
|
+
() => t.maxRows > 0 && h.value.needsFold
|
|
61
|
+
), G = o(() => ({ span: h.value.buttonSpan })), I = o(
|
|
62
|
+
() => ce(t.list, {
|
|
63
|
+
compact: t.compact,
|
|
63
64
|
itemLayout: m.value ?? {},
|
|
64
|
-
collapsing:
|
|
65
|
-
threshold:
|
|
65
|
+
collapsing: n.value && t.maxRows > 0,
|
|
66
|
+
threshold: h.value.showCount
|
|
66
67
|
})
|
|
67
|
-
), k = (e = !
|
|
68
|
-
|
|
69
|
-
},
|
|
68
|
+
), k = (e = !n.value) => {
|
|
69
|
+
n.value = e;
|
|
70
|
+
}, Q = (e) => {
|
|
70
71
|
c("heightChange", e);
|
|
71
|
-
},
|
|
72
|
-
...
|
|
73
|
-
...re(e,
|
|
74
|
-
}),
|
|
72
|
+
}, s = j(), C = (e) => ({
|
|
73
|
+
...t.staticQuery || {},
|
|
74
|
+
...re(e, t.list)
|
|
75
|
+
}), S = () => {
|
|
75
76
|
var e;
|
|
76
|
-
(e =
|
|
77
|
+
(e = s.value) == null || e.resetFields(), c("search", C(t.data), "reset");
|
|
77
78
|
}, w = (e = "search") => {
|
|
78
|
-
var
|
|
79
|
-
(
|
|
80
|
-
c("search",
|
|
79
|
+
var a;
|
|
80
|
+
(a = s.value) == null || a.validate().then(() => {
|
|
81
|
+
c("search", C(t.data), e);
|
|
81
82
|
});
|
|
82
|
-
},
|
|
83
|
+
}, _ = (e) => {
|
|
83
84
|
w(e);
|
|
84
85
|
}, z = {
|
|
85
86
|
validate: () => {
|
|
86
|
-
if (
|
|
87
|
-
return
|
|
87
|
+
if (s.value)
|
|
88
|
+
return s.value.validate();
|
|
88
89
|
throw new Error("实例化未完成");
|
|
89
90
|
},
|
|
90
91
|
resetFields: () => {
|
|
91
92
|
var e;
|
|
92
|
-
return (e =
|
|
93
|
+
return (e = s.value) == null ? void 0 : e.resetFields();
|
|
93
94
|
},
|
|
94
95
|
clearValidate: (e) => {
|
|
95
|
-
var
|
|
96
|
-
return (
|
|
96
|
+
var a;
|
|
97
|
+
return (a = s.value) == null ? void 0 : a.clearValidate(e);
|
|
97
98
|
},
|
|
98
|
-
triggerReset:
|
|
99
|
+
triggerReset: S,
|
|
99
100
|
triggerSearch: () => w(),
|
|
100
101
|
toggleCollapse: k,
|
|
101
|
-
isCollapsed: o(() =>
|
|
102
|
+
isCollapsed: o(() => n.value)
|
|
102
103
|
};
|
|
103
104
|
P(z);
|
|
104
105
|
const H = (e) => {
|
|
105
106
|
f.value = e, c("visibleChange", e);
|
|
106
107
|
};
|
|
107
|
-
return (e,
|
|
108
|
+
return (e, a) => (p(), v(ye, {
|
|
108
109
|
ref_key: "breakpointEl",
|
|
109
110
|
ref: V,
|
|
110
111
|
class: q(["form-search", {
|
|
111
112
|
"form-search_show": f.value
|
|
112
113
|
}]),
|
|
113
|
-
onHeightChange:
|
|
114
|
+
onHeightChange: Q
|
|
114
115
|
}, {
|
|
115
116
|
default: r(() => [
|
|
116
|
-
J(
|
|
117
|
+
J(u(fe, K({
|
|
117
118
|
ref_key: "formMain",
|
|
118
|
-
ref:
|
|
119
|
-
list:
|
|
120
|
-
data:
|
|
121
|
-
"row-gutter":
|
|
119
|
+
ref: s,
|
|
120
|
+
list: I.value,
|
|
121
|
+
data: A.value,
|
|
122
|
+
"row-gutter": i.rowGutter
|
|
122
123
|
}, l(E), {
|
|
123
124
|
layout: m.value,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
"layout-by-container": i.layoutByContainer,
|
|
126
|
+
labelPosition: N.value,
|
|
127
|
+
labelWidth: i.labelWidth,
|
|
128
|
+
onSubmit: _,
|
|
127
129
|
onVisibleChange: H
|
|
128
130
|
}), X({
|
|
129
131
|
default: r(() => [
|
|
130
|
-
|
|
132
|
+
u(l(me), B(F(G.value)), {
|
|
131
133
|
default: r(() => [
|
|
132
|
-
Y("div",
|
|
133
|
-
|
|
134
|
+
Y("div", be, [
|
|
135
|
+
$.value ? (p(), v(l(g), {
|
|
134
136
|
key: 0,
|
|
135
137
|
type: "primary",
|
|
136
138
|
link: "",
|
|
137
|
-
onMousedown:
|
|
139
|
+
onMousedown: a[0] || (a[0] = (d) => k())
|
|
138
140
|
}, {
|
|
139
141
|
default: r(() => [
|
|
140
|
-
|
|
142
|
+
u(l(de), { class: "btn-box-expand-icon" }, {
|
|
141
143
|
default: r(() => [
|
|
142
|
-
|
|
144
|
+
n.value ? (p(), v(l(pe), { key: 0 })) : (p(), v(l(ve), { key: 1 }))
|
|
143
145
|
]),
|
|
144
146
|
_: 1
|
|
145
147
|
}),
|
|
146
|
-
|
|
148
|
+
b(" " + Z(n.value ? "展开更多" : "收起更多"), 1)
|
|
147
149
|
]),
|
|
148
150
|
_: 1
|
|
149
151
|
})) : ee("", !0),
|
|
150
|
-
|
|
152
|
+
u(l(g), {
|
|
151
153
|
type: "warning",
|
|
152
|
-
onMousedown:
|
|
154
|
+
onMousedown: S
|
|
153
155
|
}, {
|
|
154
|
-
default: r(() => [...
|
|
155
|
-
|
|
156
|
+
default: r(() => [...a[2] || (a[2] = [
|
|
157
|
+
b("重置", -1)
|
|
156
158
|
])]),
|
|
157
159
|
_: 1
|
|
158
160
|
}),
|
|
159
|
-
|
|
161
|
+
u(l(g), {
|
|
160
162
|
type: "primary",
|
|
161
|
-
onMousedown:
|
|
163
|
+
onMousedown: a[1] || (a[1] = (d) => w())
|
|
162
164
|
}, {
|
|
163
|
-
default: r(() => [...
|
|
164
|
-
|
|
165
|
+
default: r(() => [...a[3] || (a[3] = [
|
|
166
|
+
b("查询", -1)
|
|
165
167
|
])]),
|
|
166
168
|
_: 1
|
|
167
169
|
})
|
|
@@ -172,13 +174,13 @@ const ge = { class: "btn-box" }, Re = /* @__PURE__ */ T({
|
|
|
172
174
|
]),
|
|
173
175
|
_: 2
|
|
174
176
|
}, [
|
|
175
|
-
te(
|
|
176
|
-
name:
|
|
177
|
+
te(i.list, (d) => ({
|
|
178
|
+
name: d.key,
|
|
177
179
|
fn: r((O) => [
|
|
178
|
-
ae(e.$slots,
|
|
180
|
+
ae(e.$slots, d.key, B(F(O)), void 0, !0)
|
|
179
181
|
])
|
|
180
182
|
}))
|
|
181
|
-
]), 1040, ["list", "data", "row-gutter", "layout", "labelPosition", "labelWidth"]), [
|
|
183
|
+
]), 1040, ["list", "data", "row-gutter", "layout", "layout-by-container", "labelPosition", "labelWidth"]), [
|
|
182
184
|
[oe, f.value]
|
|
183
185
|
])
|
|
184
186
|
]),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as W, useAttrs as E, shallowRef as R, ref as T, computed as r, watch as
|
|
1
|
+
import { defineComponent as W, useAttrs as E, shallowRef as R, ref as T, computed as r, watch as C, openBlock as n, createElementBlock as j, normalizeClass as z, createVNode as G, mergeProps as c, unref as i, createSlots as H, renderList as I, withCtx as l, renderSlot as m, normalizeProps as L, guardReactiveProps as O, createBlock as u, resolveDynamicComponent as q, createElementVNode as J, createTextVNode as F, toDisplayString as P, createCommentVNode as S } from "vue";
|
|
2
2
|
import { ElAffix as K } from "element-plus";
|
|
3
3
|
import Q from "./FormMain.vue.mjs";
|
|
4
4
|
import U from "./FormSubmitBtn.vue.mjs";
|
|
5
5
|
import { useFormSubmit as X } from "./use-form-submit.mjs";
|
|
6
|
-
import
|
|
6
|
+
import h from "../display/ActionBtn.vue.mjs";
|
|
7
7
|
import { parseFormData as Y, generateFormData as Z } from "./utils.mjs";
|
|
8
8
|
const _ = { class: "form-submit-panel-operation-inner" }, lt = /* @__PURE__ */ W({
|
|
9
9
|
name: "FormSubmitPanel",
|
|
@@ -16,6 +16,7 @@ const _ = { class: "form-submit-panel-operation-inner" }, lt = /* @__PURE__ */ W
|
|
|
16
16
|
}) },
|
|
17
17
|
rowGutter: {},
|
|
18
18
|
layoutScale: {},
|
|
19
|
+
layoutByContainer: { type: Boolean },
|
|
19
20
|
stringifyData: {},
|
|
20
21
|
submitText: {},
|
|
21
22
|
submitFn: {},
|
|
@@ -47,9 +48,9 @@ const _ = { class: "form-submit-panel-operation-inner" }, lt = /* @__PURE__ */ W
|
|
|
47
48
|
onSuccess: B,
|
|
48
49
|
onFail: v
|
|
49
50
|
});
|
|
50
|
-
return
|
|
51
|
+
return C(s, (e) => {
|
|
51
52
|
o("parseDataChange", e);
|
|
52
|
-
}),
|
|
53
|
+
}), C(
|
|
53
54
|
[() => t.stringifyData, () => t.list],
|
|
54
55
|
() => {
|
|
55
56
|
s.value = d();
|
|
@@ -83,27 +84,27 @@ const _ = { class: "form-submit-panel-operation-inner" }, lt = /* @__PURE__ */ W
|
|
|
83
84
|
default: l(() => [
|
|
84
85
|
J("div", _, [
|
|
85
86
|
m(e.$slots, "cancelBtn", { cancel: p }, () => [
|
|
86
|
-
a.cancelBtn ? (n(), u(i(
|
|
87
|
+
a.cancelBtn ? (n(), u(i(h), {
|
|
87
88
|
key: 0,
|
|
88
89
|
onClick: p
|
|
89
90
|
}, {
|
|
90
91
|
default: l(() => [
|
|
91
|
-
P(
|
|
92
|
+
F(P(a.cancelBtn), 1)
|
|
92
93
|
]),
|
|
93
94
|
_: 1
|
|
94
|
-
})) :
|
|
95
|
+
})) : S("", !0)
|
|
95
96
|
], !0),
|
|
96
97
|
m(e.$slots, "resetBtn", { reset: y }, () => [
|
|
97
|
-
a.resetBtn ? (n(), u(i(
|
|
98
|
+
a.resetBtn ? (n(), u(i(h), {
|
|
98
99
|
key: 0,
|
|
99
100
|
type: "warning",
|
|
100
101
|
onClick: y
|
|
101
102
|
}, {
|
|
102
103
|
default: l(() => [
|
|
103
|
-
P(
|
|
104
|
+
F(P(a.resetBtn), 1)
|
|
104
105
|
]),
|
|
105
106
|
_: 1
|
|
106
|
-
})) :
|
|
107
|
+
})) : S("", !0)
|
|
107
108
|
], !0),
|
|
108
109
|
e.$slots.submitBtn ? m(e.$slots, "submitBtn", {
|
|
109
110
|
key: 0,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { watch as m } from "vue";
|
|
2
|
+
import { useCustomBreakpoint as l } from "../../hooks/use-custom-breakpoint.mjs";
|
|
3
|
+
const c = (r, o) => {
|
|
4
|
+
const { xs: n, sm: i, md: e, lg: a, xl: s, ...u } = r, t = { xs: n, sm: i, md: e, lg: a, xl: s }[o];
|
|
5
|
+
return t === void 0 ? u : typeof t == "number" ? { ...u, span: t } : { ...u, ...t };
|
|
6
|
+
};
|
|
7
|
+
function y(r) {
|
|
8
|
+
const { elRef: o, activeBreakpoint: n } = l();
|
|
9
|
+
return m(
|
|
10
|
+
() => [r.enabled(), r.getForm()],
|
|
11
|
+
([e, a]) => {
|
|
12
|
+
o.value = e ? a : void 0;
|
|
13
|
+
},
|
|
14
|
+
{ immediate: !0 }
|
|
15
|
+
), { resolveLayoutByContainer: (e) => r.enabled() ? c(e, n.value) : e };
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
c as resolveFormLayoutAtBreakpoint,
|
|
19
|
+
y as useFormLayoutByContainer
|
|
20
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ListPage.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a488e79a"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|