@done-coding/admin-core 0.15.1-alpha.0 → 0.16.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.
Files changed (54) hide show
  1. package/es/components/app-layout/AppBody.vue.mjs +1 -1
  2. package/es/components/app-layout/AppBody.vue2.mjs +43 -39
  3. package/es/components/app-layout/AppPage.vue.mjs +2 -2
  4. package/es/components/app-layout/AppPage.vue2.mjs +114 -105
  5. package/es/components/display/TabsHeader.vue.mjs +2 -2
  6. package/es/components/display/TabsHeader.vue2.mjs +31 -32
  7. package/es/components/display/TabsRefineFlow.vue.mjs +30 -32
  8. package/es/components/display/TabsTile.vue.mjs +2 -2
  9. package/es/components/display/WatchSize.vue.mjs +34 -31
  10. package/es/components/form/FormMain.vue.mjs +2 -2
  11. package/es/components/form/FormMain.vue2.mjs +80 -75
  12. package/es/components/form/FormSearch.vue.mjs +1 -1
  13. package/es/components/form/FormSearch.vue2.mjs +82 -80
  14. package/es/components/form/FormSubmitPanel.vue2.mjs +11 -10
  15. package/es/components/form/use-layout-by-container.mjs +20 -0
  16. package/es/components/list-page/ListPage.vue.mjs +2 -2
  17. package/es/components/list-page/ListPage.vue2.mjs +167 -137
  18. package/es/components/list-page/use-sticky.mjs +41 -0
  19. package/es/components/modal/ConfirmModal.vue.mjs +3 -2
  20. package/es/components/modal/ConfirmModal.vue2.mjs +104 -55
  21. package/es/components/modal/DetailModal.vue.mjs +40 -34
  22. package/es/components/modal/ModalPorter.vue.mjs +20 -23
  23. package/es/components/table/TableMain.vue.mjs +1 -1
  24. package/es/components/table/TableMain.vue2.mjs +27 -28
  25. package/es/hooks/activated.mjs +16 -24
  26. package/es/hooks/use-breakpoint.mjs +17 -21
  27. package/es/hooks/use-channel-viewport-height.mjs +26 -8
  28. package/es/hooks/use-observe-size.mjs +26 -0
  29. package/es/index.mjs +177 -173
  30. package/es/inject/key.mjs +18 -15
  31. package/es/style.css +1 -1
  32. package/es/utils/dom.mjs +11 -1
  33. package/package.json +2 -2
  34. package/types/components/app-layout/AppPage.vue.d.ts +8 -0
  35. package/types/components/display/TabsTile.vue.d.ts +2 -2
  36. package/types/components/display/WatchSize.vue.d.ts +4 -0
  37. package/types/components/display/types.d.ts +1 -5
  38. package/types/components/form/FormItem.vue.d.ts +8 -8
  39. package/types/components/form/FormMain.vue.d.ts +1 -12
  40. package/types/components/form/FormSubmitPanel.vue.d.ts +1 -1
  41. package/types/components/form/types.d.ts +1 -0
  42. package/types/components/form/use-layout-by-container.d.ts +11 -0
  43. package/types/components/list-page/ListPage.vue.d.ts +6 -1
  44. package/types/components/list-page/types.d.ts +5 -0
  45. package/types/components/list-page/use-sticky.d.ts +19 -0
  46. package/types/components/modal/ConfirmModal.vue.d.ts +15 -3
  47. package/types/components/modal/DetailModal.vue.d.ts +4 -1
  48. package/types/components/panel/PanelItemNestForm.vue.d.ts +1 -1
  49. package/types/hooks/index.d.ts +1 -0
  50. package/types/hooks/use-channel-viewport-height.d.ts +2 -1
  51. package/types/hooks/use-observe-size.d.ts +7 -0
  52. package/types/inject/key.d.ts +8 -2
  53. package/types/injectInfo.json.d.ts +1 -1
  54. 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 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";
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 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
- import { ArrowDown as de, ArrowUp as ve } from "@element-plus/icons-vue";
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 he from "../display/WatchSize.vue.mjs";
8
- import { useBreakpoint as ye } from "../../hooks/use-breakpoint.mjs";
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 ge = { class: "btn-box" }, Re = /* @__PURE__ */ T({
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(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(() => {
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 a.list.filter((t) => t.hide !== !0).map(
43
- (t) => ne(
44
- a.compact ? e : { ...e, ...L(t.layout) },
45
- h.value
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
- }), y = o(
49
+ }), h = o(
49
50
  () => ie({
50
- spans: N.value,
51
+ spans: W.value,
51
52
  buttonMinSpan: ue(
52
53
  m.value,
53
- h.value
54
+ y.value
54
55
  ),
55
- maxRows: a.maxRows,
56
- collapsed: s.value
56
+ maxRows: t.maxRows,
57
+ collapsed: n.value
57
58
  })
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,
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: s.value && a.maxRows > 0,
65
- threshold: y.value.showCount
65
+ collapsing: n.value && t.maxRows > 0,
66
+ threshold: h.value.showCount
66
67
  })
67
- ), k = (e = !s.value) => {
68
- s.value = e;
69
- }, I = (e) => {
68
+ ), k = (e = !n.value) => {
69
+ n.value = e;
70
+ }, Q = (e) => {
70
71
  c("heightChange", e);
71
- }, n = j(), S = (e) => ({
72
- ...a.staticQuery || {},
73
- ...re(e, a.list)
74
- }), C = () => {
72
+ }, s = j(), C = (e) => ({
73
+ ...t.staticQuery || {},
74
+ ...re(e, t.list)
75
+ }), S = () => {
75
76
  var e;
76
- (e = n.value) == null || e.resetFields(), c("search", S(a.data), "reset");
77
+ (e = s.value) == null || e.resetFields(), c("search", C(t.data), "reset");
77
78
  }, w = (e = "search") => {
78
- var t;
79
- (t = n.value) == null || t.validate().then(() => {
80
- c("search", S(a.data), e);
79
+ var a;
80
+ (a = s.value) == null || a.validate().then(() => {
81
+ c("search", C(t.data), e);
81
82
  });
82
- }, Q = (e) => {
83
+ }, _ = (e) => {
83
84
  w(e);
84
85
  }, z = {
85
86
  validate: () => {
86
- if (n.value)
87
- return n.value.validate();
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 = n.value) == null ? void 0 : e.resetFields();
93
+ return (e = s.value) == null ? void 0 : e.resetFields();
93
94
  },
94
95
  clearValidate: (e) => {
95
- var t;
96
- return (t = n.value) == null ? void 0 : t.clearValidate(e);
96
+ var a;
97
+ return (a = s.value) == null ? void 0 : a.clearValidate(e);
97
98
  },
98
- triggerReset: C,
99
+ triggerReset: S,
99
100
  triggerSearch: () => w(),
100
101
  toggleCollapse: k,
101
- isCollapsed: o(() => s.value)
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, t) => (d(), v(he, {
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: I
114
+ onHeightChange: Q
114
115
  }, {
115
116
  default: r(() => [
116
- J(i(fe, K({
117
+ J(u(fe, K({
117
118
  ref_key: "formMain",
118
- ref: n,
119
- list: G.value,
120
- data: _.value,
121
- "row-gutter": u.rowGutter
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
- labelPosition: A.value,
125
- labelWidth: u.labelWidth,
126
- onSubmit: Q,
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
- i(l(me), B(F($.value)), {
132
+ u(l(me), B(F(G.value)), {
131
133
  default: r(() => [
132
- Y("div", ge, [
133
- W.value ? (d(), v(l(b), {
134
+ Y("div", be, [
135
+ $.value ? (p(), v(l(g), {
134
136
  key: 0,
135
137
  type: "primary",
136
138
  link: "",
137
- onMousedown: t[0] || (t[0] = (p) => k())
139
+ onMousedown: a[0] || (a[0] = (d) => k())
138
140
  }, {
139
141
  default: r(() => [
140
- i(l(pe), { class: "btn-box-expand-icon" }, {
142
+ u(l(de), { class: "btn-box-expand-icon" }, {
141
143
  default: r(() => [
142
- s.value ? (d(), v(l(de), { key: 0 })) : (d(), v(l(ve), { key: 1 }))
144
+ n.value ? (p(), v(l(pe), { key: 0 })) : (p(), v(l(ve), { key: 1 }))
143
145
  ]),
144
146
  _: 1
145
147
  }),
146
- g(" " + Z(s.value ? "展开更多" : "收起更多"), 1)
148
+ b(" " + Z(n.value ? "展开更多" : "收起更多"), 1)
147
149
  ]),
148
150
  _: 1
149
151
  })) : ee("", !0),
150
- i(l(b), {
152
+ u(l(g), {
151
153
  type: "warning",
152
- onMousedown: C
154
+ onMousedown: S
153
155
  }, {
154
- default: r(() => [...t[2] || (t[2] = [
155
- g("重置", -1)
156
+ default: r(() => [...a[2] || (a[2] = [
157
+ b("重置", -1)
156
158
  ])]),
157
159
  _: 1
158
160
  }),
159
- i(l(b), {
161
+ u(l(g), {
160
162
  type: "primary",
161
- onMousedown: t[1] || (t[1] = (p) => w())
163
+ onMousedown: a[1] || (a[1] = (d) => w())
162
164
  }, {
163
- default: r(() => [...t[3] || (t[3] = [
164
- g("查询", -1)
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(u.list, (p) => ({
176
- name: p.key,
177
+ te(i.list, (d) => ({
178
+ name: d.key,
177
179
  fn: r((O) => [
178
- ae(e.$slots, p.key, B(F(O)), void 0, !0)
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 F, 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 P, toDisplayString as S, createCommentVNode as h } from "vue";
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 C from "../display/ActionBtn.vue.mjs";
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 F(s, (e) => {
51
+ return C(s, (e) => {
51
52
  o("parseDataChange", e);
52
- }), F(
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(C), {
87
+ a.cancelBtn ? (n(), u(i(h), {
87
88
  key: 0,
88
89
  onClick: p
89
90
  }, {
90
91
  default: l(() => [
91
- P(S(a.cancelBtn), 1)
92
+ F(P(a.cancelBtn), 1)
92
93
  ]),
93
94
  _: 1
94
- })) : h("", !0)
95
+ })) : S("", !0)
95
96
  ], !0),
96
97
  m(e.$slots, "resetBtn", { reset: y }, () => [
97
- a.resetBtn ? (n(), u(i(C), {
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(S(a.resetBtn), 1)
104
+ F(P(a.resetBtn), 1)
104
105
  ]),
105
106
  _: 1
106
- })) : h("", !0)
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 p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-386c1374"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a488e79a"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };