@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.
Files changed (28) hide show
  1. package/es/components/form/FormSearch.vue.mjs +2 -2
  2. package/es/components/form/FormSearch.vue2.mjs +94 -84
  3. package/es/components/form/form-search-utils.mjs +27 -18
  4. package/es/components/list-page/ListPage.vue.mjs +2 -2
  5. package/es/components/list-page/ListPage.vue2.mjs +157 -135
  6. package/es/components/modal/ConfirmModal.vue.mjs +3 -3
  7. package/es/components/modal/ConfirmModal.vue2.mjs +44 -43
  8. package/es/components/slot-layout/SlotLayoutFlowAside.vue.mjs +7 -0
  9. package/es/components/slot-layout/SlotLayoutFlowAside.vue2.mjs +55 -0
  10. package/es/components/slot-layout/SlotLayoutTemplate.vue.mjs +28 -0
  11. package/es/components/slot-layout/SlotLayoutTemplate.vue2.mjs +4 -0
  12. package/es/hooks/use-custom-breakpoint.mjs +42 -0
  13. package/es/index.mjs +190 -182
  14. package/es/style.css +1 -1
  15. package/package.json +2 -2
  16. package/types/components/form/form-search-utils.d.ts +8 -0
  17. package/types/components/form/types.d.ts +1 -0
  18. package/types/components/list-page/ListPage.vue.d.ts +3 -1
  19. package/types/components/list-page/types.d.ts +4 -1
  20. package/types/components/modal/ConfirmModal.vue.d.ts +4 -0
  21. package/types/components/slot-layout/SlotLayoutFlowAside.vue.d.ts +32 -0
  22. package/types/components/slot-layout/SlotLayoutTemplate.vue.d.ts +27 -0
  23. package/types/components/slot-layout/index.d.ts +4 -0
  24. package/types/components/slot-layout/types.d.ts +6 -0
  25. package/types/hooks/index.d.ts +1 -0
  26. package/types/hooks/use-custom-breakpoint.d.ts +9 -0
  27. package/types/index.d.ts +1 -0
  28. 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 p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-4d4d2642"]]);
4
+ const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-290fe11f"]]);
5
5
  export {
6
- p as default
6
+ a as default
7
7
  };
@@ -1,12 +1,13 @@
1
- import { defineComponent as z, useAttrs as G, ref as x, computed as i, shallowRef as L, openBlock as d, createBlock as f, normalizeClass as T, withCtx as a, withDirectives as H, createVNode as m, mergeProps as U, unref as l, createSlots as j, normalizeProps as S, guardReactiveProps as k, createElementVNode as q, createTextVNode as w, toDisplayString as J, createCommentVNode as K, renderList as O, renderSlot as X, vShow as Y } from "vue";
2
- import { stringifyFormData as Z } from "./utils.mjs";
3
- import { getCurrentSpan as _, computeButtonColProps as ee, computeItemsPerRow as te } from "./form-search-utils.mjs";
4
- import { ElCol as oe, ElButton as g, ElIcon as re } from "element-plus";
5
- import { ArrowDown as ae, ArrowUp as le } from "@element-plus/icons-vue";
6
- import se from "./FormMain.vue.mjs";
7
- import ne from "../display/WatchSize.vue.mjs";
8
- import { useBreakpoint as ie } from "../../hooks/use-breakpoint.mjs";
9
- const ue = { class: "btn-box" }, ge = /* @__PURE__ */ z({
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(u, { expose: R, emit: P }) {
32
- const o = u, c = P, F = G(), h = x(!1), { activeBreakpoint: B } = ie(), s = x(!0), M = i(() => o.data), v = i(() => {
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 = _(o.layout, B.value), t = te(e), r = t > 1 ? 1 : 0;
35
- return Math.max(0, o.maxRows * t - r);
36
- }), V = i(() => o.maxRows <= 0 ? !1 : o.list.filter(
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 > v.value), E = i(() => {
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 >= v.value || e++);
49
+ o.list[t].hide !== !0 && (s.value && o.maxRows > 0 && t >= h.value || e++);
42
50
  return e;
43
- }), D = i(() => ee(o.layout, E.value)), I = i(() => {
44
- if (!s.value || o.maxRows <= 0)
45
- return o.list;
46
- const e = v.value;
47
- return o.list.map(
48
- (t, r) => r >= e ? { ...t, hide: !0 } : t
49
- );
50
- }), y = (e = !s.value) => {
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
- }, A = (e) => {
53
- c("heightChange", e);
54
- }, n = L(), b = (e) => ({
60
+ }, $ = (e) => {
61
+ m("heightChange", e);
62
+ }, n = j(), C = (e) => ({
55
63
  ...o.staticQuery || {},
56
- ...Z(e, o.list)
57
- }), C = () => {
64
+ ...ae(e, o.list)
65
+ }), x = () => {
58
66
  var e;
59
- (e = n.value) == null || e.resetFields(), c("search", b(o.data), "reset");
60
- }, p = (e = "search") => {
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
- c("search", b(o.data), e);
71
+ m("search", C(o.data), e);
64
72
  });
65
- }, N = (e) => {
66
- p(e);
67
- }, W = {
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: C,
82
- triggerSearch: () => p(),
83
- toggleCollapse: y,
84
- isCollapsed: i(() => s.value)
89
+ triggerReset: x,
90
+ triggerSearch: () => w(),
91
+ toggleCollapse: k,
92
+ isCollapsed: a(() => s.value)
85
93
  };
86
- R(W);
87
- const $ = (e) => {
88
- h.value = e, c("visibleChange", e);
94
+ R(z);
95
+ const G = (e) => {
96
+ p.value = e, m("visibleChange", e);
89
97
  };
90
- return (e, t) => (d(), f(ne, {
91
- class: T(["form-search", {
92
- "form-search_show": h.value
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: A
104
+ onHeightChange: $
95
105
  }, {
96
- default: a(() => [
97
- H(m(se, U({
106
+ default: r(() => [
107
+ J(u(fe, K({
98
108
  ref_key: "formMain",
99
109
  ref: n,
100
- list: I.value,
101
- data: M.value,
102
- "row-gutter": u.rowGutter
103
- }, l(F), {
104
- layout: u.layout,
105
- labelPosition: u.labelPosition,
106
- labelWidth: u.labelWidth,
107
- onSubmit: N,
108
- onVisibleChange: $
109
- }), j({
110
- default: a(() => [
111
- m(l(oe), S(k(D.value)), {
112
- default: a(() => [
113
- q("div", ue, [
114
- V.value ? (d(), f(l(g), {
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] = (r) => y())
128
+ onMousedown: t[0] || (t[0] = (i) => k())
119
129
  }, {
120
- default: a(() => [
121
- m(l(re), { class: "btn-box-expand-icon" }, {
122
- default: a(() => [
123
- s.value ? (d(), f(l(ae), { key: 0 })) : (d(), f(l(le), { key: 1 }))
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
- w(" " + J(s.value ? "展开更多" : "收起更多"), 1)
137
+ g(" " + Y(s.value ? "展开更多" : "收起更多"), 1)
128
138
  ]),
129
139
  _: 1
130
- })) : K("", !0),
131
- m(l(g), {
140
+ })) : Z("", !0),
141
+ u(l(y), {
132
142
  type: "warning",
133
- onMousedown: C
143
+ onMousedown: x
134
144
  }, {
135
- default: a(() => [...t[2] || (t[2] = [
136
- w("重置", -1)
145
+ default: r(() => [...t[2] || (t[2] = [
146
+ g("重置", -1)
137
147
  ])]),
138
148
  _: 1
139
149
  }),
140
- m(l(g), {
150
+ u(l(y), {
141
151
  type: "primary",
142
- onMousedown: t[1] || (t[1] = (r) => p())
152
+ onMousedown: t[1] || (t[1] = (i) => w())
143
153
  }, {
144
- default: a(() => [...t[3] || (t[3] = [
145
- w("查询", -1)
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
- O(u.list, (r) => ({
157
- name: r.key,
158
- fn: a((Q) => [
159
- X(e.$slots, r.key, S(k(Q)), void 0, !0)
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
- [Y, h.value]
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
- ge as default
181
+ Fe as default
172
182
  };
@@ -1,25 +1,34 @@
1
- import { resolveFormLayout as u } from "./utils.mjs";
2
- const m = ["xs", "sm", "md", "lg", "xl"], f = (o) => Math.max(1, Math.floor(24 / o)), a = (o, t) => {
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 n = f(t), e = o % n;
5
- return e === 0 ? 24 - t : 24 - e * t - t;
6
- }, i = (o, t) => {
7
- const n = u(o), e = {};
8
- for (const r of m) {
9
- const s = n[r], c = typeof s == "number" ? s : n.span ?? 6;
10
- e[r] = {
11
- span: c,
12
- offset: a(t, c)
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 e;
15
+ return r;
16
16
  }, l = (o, t) => {
17
- const n = u(o), e = n[t];
18
- return typeof e == "number" ? e : n.span ?? 6;
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
- i as computeButtonColProps,
22
- a as computeButtonOffset,
23
- f as computeItemsPerRow,
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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0e94ce51"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-386c1374"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };