@done-coding/admin-core 0.14.0 → 0.15.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/form/FormSearch.vue.mjs +2 -2
- package/es/components/form/FormSearch.vue2.mjs +94 -84
- package/es/components/form/form-search-utils.mjs +27 -18
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +157 -135
- package/es/components/modal/ConfirmModal.vue.mjs +3 -3
- package/es/components/modal/ConfirmModal.vue2.mjs +44 -43
- package/es/components/slot-layout/SlotLayoutFlowAside.vue.mjs +7 -0
- package/es/components/slot-layout/SlotLayoutFlowAside.vue2.mjs +55 -0
- package/es/components/slot-layout/SlotLayoutTemplate.vue.mjs +28 -0
- package/es/components/slot-layout/SlotLayoutTemplate.vue2.mjs +4 -0
- package/es/hooks/use-custom-breakpoint.mjs +42 -0
- package/es/index.mjs +190 -182
- package/es/style.css +1 -1
- package/package.json +2 -2
- package/types/components/form/form-search-utils.d.ts +8 -0
- package/types/components/form/types.d.ts +1 -0
- package/types/components/list-page/ListPage.vue.d.ts +3 -1
- package/types/components/list-page/types.d.ts +4 -1
- package/types/components/modal/ConfirmModal.vue.d.ts +4 -0
- package/types/components/slot-layout/SlotLayoutFlowAside.vue.d.ts +32 -0
- package/types/components/slot-layout/SlotLayoutTemplate.vue.d.ts +27 -0
- package/types/components/slot-layout/index.d.ts +4 -0
- package/types/components/slot-layout/types.d.ts +6 -0
- package/types/hooks/index.d.ts +1 -0
- package/types/hooks/use-custom-breakpoint.d.ts +9 -0
- package/types/index.d.ts +1 -0
- package/types/injectInfo.json.d.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FormSearch.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-290fe11f"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { stringifyFormData as
|
|
3
|
-
import { getCurrentSpan as
|
|
4
|
-
import { ElCol as
|
|
5
|
-
import { ArrowDown as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { useBreakpoint as
|
|
9
|
-
|
|
1
|
+
import { defineComponent as H, useAttrs as U, ref as S, computed as a, shallowRef as j, openBlock as v, createBlock as f, normalizeClass as q, withCtx as r, withDirectives as J, createVNode as u, mergeProps as K, unref as l, createSlots as O, normalizeProps as B, guardReactiveProps as P, createElementVNode as X, createTextVNode as g, toDisplayString as Y, createCommentVNode as Z, renderList as ee, renderSlot as te, vShow as oe } from "vue";
|
|
2
|
+
import { stringifyFormData as ae } from "./utils.mjs";
|
|
3
|
+
import { resolveSearchLayout as re, resolveSearchLabelPosition as le, getCurrentSpan as se, computeButtonColProps as ne, packSearchFormList as ie, computeItemsPerRow as ue } from "./form-search-utils.mjs";
|
|
4
|
+
import { ElCol as ce, ElButton as y, ElIcon as me } from "element-plus";
|
|
5
|
+
import { ArrowDown as de, ArrowUp as ve } from "@element-plus/icons-vue";
|
|
6
|
+
import fe from "./FormMain.vue.mjs";
|
|
7
|
+
import pe from "../display/WatchSize.vue.mjs";
|
|
8
|
+
import { useBreakpoint as he } from "../../hooks/use-breakpoint.mjs";
|
|
9
|
+
import { useCustomBreakpoint as we } from "../../hooks/use-custom-breakpoint.mjs";
|
|
10
|
+
const ge = { class: "btn-box" }, Fe = /* @__PURE__ */ H({
|
|
10
11
|
name: "FormSearch",
|
|
11
12
|
inheritAttrs: !1,
|
|
12
13
|
__name: "FormSearch",
|
|
@@ -15,6 +16,7 @@ const ue = { class: "btn-box" }, ge = /* @__PURE__ */ z({
|
|
|
15
16
|
labelWidth: { default: "auto" },
|
|
16
17
|
staticQuery: {},
|
|
17
18
|
maxRows: { default: 2 },
|
|
19
|
+
compact: { type: Boolean, default: !1 },
|
|
18
20
|
list: {},
|
|
19
21
|
data: {},
|
|
20
22
|
layout: { default: () => ({
|
|
@@ -28,43 +30,49 @@ const ue = { class: "btn-box" }, ge = /* @__PURE__ */ z({
|
|
|
28
30
|
layoutScale: {}
|
|
29
31
|
},
|
|
30
32
|
emits: ["search", "heightChange", "visibleChange"],
|
|
31
|
-
setup(
|
|
32
|
-
const o =
|
|
33
|
+
setup(c, { expose: R, emit: F }) {
|
|
34
|
+
const o = c, m = F, E = U(), p = S(!1), { activeBreakpoint: L } = he(), { elRef: M, activeBreakpoint: V } = we(), b = a(
|
|
35
|
+
() => o.compact ? V.value : L.value
|
|
36
|
+
), s = S(!0), D = a(() => o.data), d = a(
|
|
37
|
+
() => re(o.compact, o.layout, b.value)
|
|
38
|
+
), I = a(
|
|
39
|
+
() => le(o.compact, o.labelPosition)
|
|
40
|
+
), h = a(() => {
|
|
33
41
|
if (o.maxRows <= 0) return 1 / 0;
|
|
34
|
-
const e =
|
|
35
|
-
return Math.max(0, o.maxRows * t -
|
|
36
|
-
}),
|
|
42
|
+
const e = se(d.value, b.value), t = ue(e), i = t > 1 ? 1 : 0;
|
|
43
|
+
return Math.max(0, o.maxRows * t - i);
|
|
44
|
+
}), _ = a(() => o.maxRows <= 0 ? !1 : o.list.filter(
|
|
37
45
|
(t) => t.hide !== !0
|
|
38
|
-
).length >
|
|
46
|
+
).length > h.value), A = a(() => {
|
|
39
47
|
let e = 0;
|
|
40
48
|
for (let t = 0; t < o.list.length; t++)
|
|
41
|
-
o.list[t].hide !== !0 && (s.value && o.maxRows > 0 && t >=
|
|
49
|
+
o.list[t].hide !== !0 && (s.value && o.maxRows > 0 && t >= h.value || e++);
|
|
42
50
|
return e;
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
+
}), N = a(() => ne(d.value, A.value)), W = a(
|
|
52
|
+
() => ie(o.list, {
|
|
53
|
+
compact: o.compact,
|
|
54
|
+
itemLayout: d.value ?? {},
|
|
55
|
+
collapsing: s.value && o.maxRows > 0,
|
|
56
|
+
threshold: h.value
|
|
57
|
+
})
|
|
58
|
+
), k = (e = !s.value) => {
|
|
51
59
|
s.value = e;
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
}, n =
|
|
60
|
+
}, $ = (e) => {
|
|
61
|
+
m("heightChange", e);
|
|
62
|
+
}, n = j(), C = (e) => ({
|
|
55
63
|
...o.staticQuery || {},
|
|
56
|
-
...
|
|
57
|
-
}),
|
|
64
|
+
...ae(e, o.list)
|
|
65
|
+
}), x = () => {
|
|
58
66
|
var e;
|
|
59
|
-
(e = n.value) == null || e.resetFields(),
|
|
60
|
-
},
|
|
67
|
+
(e = n.value) == null || e.resetFields(), m("search", C(o.data), "reset");
|
|
68
|
+
}, w = (e = "search") => {
|
|
61
69
|
var t;
|
|
62
70
|
(t = n.value) == null || t.validate().then(() => {
|
|
63
|
-
|
|
71
|
+
m("search", C(o.data), e);
|
|
64
72
|
});
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
},
|
|
73
|
+
}, Q = (e) => {
|
|
74
|
+
w(e);
|
|
75
|
+
}, z = {
|
|
68
76
|
validate: () => {
|
|
69
77
|
if (n.value)
|
|
70
78
|
return n.value.validate();
|
|
@@ -78,71 +86,73 @@ const ue = { class: "btn-box" }, ge = /* @__PURE__ */ z({
|
|
|
78
86
|
var t;
|
|
79
87
|
return (t = n.value) == null ? void 0 : t.clearValidate(e);
|
|
80
88
|
},
|
|
81
|
-
triggerReset:
|
|
82
|
-
triggerSearch: () =>
|
|
83
|
-
toggleCollapse:
|
|
84
|
-
isCollapsed:
|
|
89
|
+
triggerReset: x,
|
|
90
|
+
triggerSearch: () => w(),
|
|
91
|
+
toggleCollapse: k,
|
|
92
|
+
isCollapsed: a(() => s.value)
|
|
85
93
|
};
|
|
86
|
-
R(
|
|
87
|
-
const
|
|
88
|
-
|
|
94
|
+
R(z);
|
|
95
|
+
const G = (e) => {
|
|
96
|
+
p.value = e, m("visibleChange", e);
|
|
89
97
|
};
|
|
90
|
-
return (e, t) => (
|
|
91
|
-
|
|
92
|
-
|
|
98
|
+
return (e, t) => (v(), f(pe, {
|
|
99
|
+
ref_key: "breakpointEl",
|
|
100
|
+
ref: M,
|
|
101
|
+
class: q(["form-search", {
|
|
102
|
+
"form-search_show": p.value
|
|
93
103
|
}]),
|
|
94
|
-
onHeightChange:
|
|
104
|
+
onHeightChange: $
|
|
95
105
|
}, {
|
|
96
|
-
default:
|
|
97
|
-
|
|
106
|
+
default: r(() => [
|
|
107
|
+
J(u(fe, K({
|
|
98
108
|
ref_key: "formMain",
|
|
99
109
|
ref: n,
|
|
100
|
-
list:
|
|
101
|
-
data:
|
|
102
|
-
"row-gutter":
|
|
103
|
-
}, l(
|
|
104
|
-
layout:
|
|
105
|
-
labelPosition:
|
|
106
|
-
labelWidth:
|
|
107
|
-
onSubmit:
|
|
108
|
-
onVisibleChange:
|
|
109
|
-
}),
|
|
110
|
-
default:
|
|
111
|
-
|
|
112
|
-
default:
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
list: W.value,
|
|
111
|
+
data: D.value,
|
|
112
|
+
"row-gutter": c.rowGutter
|
|
113
|
+
}, l(E), {
|
|
114
|
+
layout: d.value,
|
|
115
|
+
labelPosition: I.value,
|
|
116
|
+
labelWidth: c.labelWidth,
|
|
117
|
+
onSubmit: Q,
|
|
118
|
+
onVisibleChange: G
|
|
119
|
+
}), O({
|
|
120
|
+
default: r(() => [
|
|
121
|
+
u(l(ce), B(P(N.value)), {
|
|
122
|
+
default: r(() => [
|
|
123
|
+
X("div", ge, [
|
|
124
|
+
_.value ? (v(), f(l(y), {
|
|
115
125
|
key: 0,
|
|
116
126
|
type: "primary",
|
|
117
127
|
link: "",
|
|
118
|
-
onMousedown: t[0] || (t[0] = (
|
|
128
|
+
onMousedown: t[0] || (t[0] = (i) => k())
|
|
119
129
|
}, {
|
|
120
|
-
default:
|
|
121
|
-
|
|
122
|
-
default:
|
|
123
|
-
s.value ? (
|
|
130
|
+
default: r(() => [
|
|
131
|
+
u(l(me), { class: "btn-box-expand-icon" }, {
|
|
132
|
+
default: r(() => [
|
|
133
|
+
s.value ? (v(), f(l(de), { key: 0 })) : (v(), f(l(ve), { key: 1 }))
|
|
124
134
|
]),
|
|
125
135
|
_: 1
|
|
126
136
|
}),
|
|
127
|
-
|
|
137
|
+
g(" " + Y(s.value ? "展开更多" : "收起更多"), 1)
|
|
128
138
|
]),
|
|
129
139
|
_: 1
|
|
130
|
-
})) :
|
|
131
|
-
|
|
140
|
+
})) : Z("", !0),
|
|
141
|
+
u(l(y), {
|
|
132
142
|
type: "warning",
|
|
133
|
-
onMousedown:
|
|
143
|
+
onMousedown: x
|
|
134
144
|
}, {
|
|
135
|
-
default:
|
|
136
|
-
|
|
145
|
+
default: r(() => [...t[2] || (t[2] = [
|
|
146
|
+
g("重置", -1)
|
|
137
147
|
])]),
|
|
138
148
|
_: 1
|
|
139
149
|
}),
|
|
140
|
-
|
|
150
|
+
u(l(y), {
|
|
141
151
|
type: "primary",
|
|
142
|
-
onMousedown: t[1] || (t[1] = (
|
|
152
|
+
onMousedown: t[1] || (t[1] = (i) => w())
|
|
143
153
|
}, {
|
|
144
|
-
default:
|
|
145
|
-
|
|
154
|
+
default: r(() => [...t[3] || (t[3] = [
|
|
155
|
+
g("查询", -1)
|
|
146
156
|
])]),
|
|
147
157
|
_: 1
|
|
148
158
|
})
|
|
@@ -153,14 +163,14 @@ const ue = { class: "btn-box" }, ge = /* @__PURE__ */ z({
|
|
|
153
163
|
]),
|
|
154
164
|
_: 2
|
|
155
165
|
}, [
|
|
156
|
-
|
|
157
|
-
name:
|
|
158
|
-
fn:
|
|
159
|
-
|
|
166
|
+
ee(c.list, (i) => ({
|
|
167
|
+
name: i.key,
|
|
168
|
+
fn: r((T) => [
|
|
169
|
+
te(e.$slots, i.key, B(P(T)), void 0, !0)
|
|
160
170
|
])
|
|
161
171
|
}))
|
|
162
172
|
]), 1040, ["list", "data", "row-gutter", "layout", "labelPosition", "labelWidth"]), [
|
|
163
|
-
[
|
|
173
|
+
[oe, p.value]
|
|
164
174
|
])
|
|
165
175
|
]),
|
|
166
176
|
_: 3
|
|
@@ -168,5 +178,5 @@ const ue = { class: "btn-box" }, ge = /* @__PURE__ */ z({
|
|
|
168
178
|
}
|
|
169
179
|
});
|
|
170
180
|
export {
|
|
171
|
-
|
|
181
|
+
Fe as default
|
|
172
182
|
};
|
|
@@ -1,25 +1,34 @@
|
|
|
1
|
-
import { resolveFormLayout as
|
|
2
|
-
const
|
|
1
|
+
import { resolveFormLayout as a } from "./utils.mjs";
|
|
2
|
+
const f = ["xs", "sm", "md", "lg", "xl"], i = (o) => Math.max(1, Math.floor(24 / o)), p = (o, t) => {
|
|
3
3
|
if (o <= 0 || t >= 24) return 0;
|
|
4
|
-
const
|
|
5
|
-
return
|
|
6
|
-
},
|
|
7
|
-
const
|
|
8
|
-
for (const
|
|
9
|
-
const s = n
|
|
10
|
-
|
|
11
|
-
span:
|
|
12
|
-
offset:
|
|
4
|
+
const e = i(t), r = o % e;
|
|
5
|
+
return r === 0 ? 24 - t : 24 - r * t - t;
|
|
6
|
+
}, S = (o, t) => {
|
|
7
|
+
const e = a(o), r = {};
|
|
8
|
+
for (const n of f) {
|
|
9
|
+
const s = e[n], u = typeof s == "number" ? s : e.span ?? 6;
|
|
10
|
+
r[n] = {
|
|
11
|
+
span: u,
|
|
12
|
+
offset: p(t, u)
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return r;
|
|
16
16
|
}, l = (o, t) => {
|
|
17
|
-
const
|
|
18
|
-
return typeof
|
|
17
|
+
const e = a(o), r = e[t];
|
|
18
|
+
return typeof r == "number" ? r : e.span ?? 6;
|
|
19
|
+
}, L = (o, t, e) => o ? { span: l(t, e) } : t, b = (o, t) => o ? "top" : t, d = (o, t) => {
|
|
20
|
+
const { compact: e, itemLayout: r, collapsing: n, threshold: s } = t;
|
|
21
|
+
return !e && !n ? o : o.map((u, m) => {
|
|
22
|
+
let c = u;
|
|
23
|
+
return e && (c = { ...c, layout: r }), n && m >= s && (c = { ...c, hide: !0 }), c;
|
|
24
|
+
});
|
|
19
25
|
};
|
|
20
26
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
l as getCurrentSpan
|
|
27
|
+
S as computeButtonColProps,
|
|
28
|
+
p as computeButtonOffset,
|
|
29
|
+
i as computeItemsPerRow,
|
|
30
|
+
l as getCurrentSpan,
|
|
31
|
+
d as packSearchFormList,
|
|
32
|
+
b as resolveSearchLabelPosition,
|
|
33
|
+
L as resolveSearchLayout
|
|
25
34
|
};
|
|
@@ -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 p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-386c1374"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|