@done-coding/admin-core 0.8.3-alpha.0 → 0.9.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 (127) hide show
  1. package/docs/nested-config-paradigm.md +80 -0
  2. package/es/bridge/config-hook.mjs +37 -0
  3. package/es/bridge/index.mjs +157 -62
  4. package/es/bridge/plugin.mjs +29 -0
  5. package/es/bridge/theme.mjs +65 -0
  6. package/es/components/app-layout/AppBody.vue.mjs +1 -1
  7. package/es/components/app-layout/AppBody.vue2.mjs +47 -49
  8. package/es/components/app-layout/AppBreadcrumb.vue.mjs +1 -1
  9. package/es/components/app-layout/AppBreadcrumb.vue2.mjs +35 -41
  10. package/es/components/app-layout/AppFooter.vue.mjs +2 -2
  11. package/es/components/app-layout/AppFooter.vue2.mjs +8 -8
  12. package/es/components/app-layout/AppHeader.vue.mjs +1 -1
  13. package/es/components/app-layout/AppHeader.vue2.mjs +60 -69
  14. package/es/components/app-layout/AppLayout.vue.mjs +2 -2
  15. package/es/components/app-layout/AppLayout.vue2.mjs +95 -93
  16. package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
  17. package/es/components/app-layout/AppSidebar.vue2.mjs +79 -82
  18. package/es/components/app-layout/AppTheme.vue.mjs +7 -0
  19. package/es/components/app-layout/AppTheme.vue2.mjs +38 -0
  20. package/es/components/data-view/DataListView.vue.mjs +2 -2
  21. package/es/components/data-view/DataListView.vue2.mjs +36 -36
  22. package/es/components/display/ActionConfirm.vue2.mjs +16 -16
  23. package/es/components/display/HeightProvider.vue.mjs +10 -10
  24. package/es/components/display/TabsHeader.vue.mjs +4 -4
  25. package/es/components/display/TabsHeader.vue2.mjs +34 -34
  26. package/es/components/display/TabsMain.vue.mjs +40 -39
  27. package/es/components/display/TabsRefineFlow.vue.mjs +30 -28
  28. package/es/components/form/FormItem.vue.mjs +1 -1
  29. package/es/components/form/FormItem.vue2.mjs +75 -81
  30. package/es/components/form/FormItemNestForm.vue.mjs +7 -0
  31. package/es/components/form/FormItemNestForm.vue2.mjs +49 -0
  32. package/es/components/form/FormItemNestFormList.vue.mjs +7 -0
  33. package/es/components/form/FormItemNestFormList.vue2.mjs +137 -0
  34. package/es/components/form/FormMain.vue.mjs +5 -147
  35. package/es/components/form/FormMain.vue2.mjs +160 -2
  36. package/es/components/form/FormRadioGroup.vue.mjs +42 -49
  37. package/es/components/form/FormSearch.vue.mjs +2 -2
  38. package/es/components/form/FormSearch.vue2.mjs +122 -128
  39. package/es/components/form/FormSelect.vue.mjs +34 -40
  40. package/es/components/form/FormSubmitBtn.vue.mjs +23 -28
  41. package/es/components/form/FormSubmitPanel.vue.mjs +2 -2
  42. package/es/components/form/FormSubmitPanel.vue2.mjs +29 -28
  43. package/es/components/form/FormTree.vue.mjs +16 -21
  44. package/es/components/form/FormVerifyCode.vue.mjs +37 -43
  45. package/es/components/form/FormVerifyImage.vue.mjs +2 -2
  46. package/es/components/form/FormVerifyImage.vue2.mjs +36 -41
  47. package/es/components/form/nest-form-item-list.mjs +71 -0
  48. package/es/components/form/nest-form-item.mjs +42 -0
  49. package/es/components/form/nest-registry.mjs +7 -0
  50. package/es/components/form/use-nest-form-list.mjs +22 -0
  51. package/es/components/form/use-nest-form.mjs +34 -0
  52. package/es/components/form/use-nest-layout-scale.mjs +14 -0
  53. package/es/components/form/utils.mjs +77 -61
  54. package/es/components/list-page/ListPage.vue.mjs +2 -2
  55. package/es/components/list-page/ListPage.vue2.mjs +134 -139
  56. package/es/components/menu/MenuItemSub.vue.mjs +41 -48
  57. package/es/components/menu/MenuTree.vue.mjs +58 -65
  58. package/es/components/misc/AutoRefresh.vue.mjs +2 -2
  59. package/es/components/misc/AutoRefresh.vue2.mjs +44 -51
  60. package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
  61. package/es/components/misc/AutoRefreshGroup.vue2.mjs +37 -43
  62. package/es/components/modal/ConfirmModal.vue.mjs +3 -4
  63. package/es/components/modal/ConfirmModal.vue2.mjs +83 -111
  64. package/es/components/modal/DetailModal.vue.mjs +38 -41
  65. package/es/components/panel/PanelEditSwitch.vue.mjs +1 -1
  66. package/es/components/panel/PanelEditSwitch.vue2.mjs +50 -55
  67. package/es/components/panel/PanelItemNestForm.vue.mjs +7 -0
  68. package/es/components/panel/PanelItemNestForm.vue2.mjs +69 -0
  69. package/es/components/panel/PanelItemNestPanel.vue.mjs +34 -0
  70. package/es/components/panel/PanelItemNestPanel.vue2.mjs +4 -0
  71. package/es/components/panel/PanelMain.vue.mjs +1 -1
  72. package/es/components/panel/PanelMain.vue2.mjs +72 -72
  73. package/es/components/panel/nest-panel-form.mjs +53 -0
  74. package/es/components/panel/nest-panel-item.mjs +25 -0
  75. package/es/components/table/TableMain.vue.mjs +2 -2
  76. package/es/components/table/TableMain.vue2.mjs +221 -229
  77. package/es/components/table/TableToolbar.vue.mjs +2 -2
  78. package/es/components/table/TableToolbar.vue2.mjs +115 -126
  79. package/es/hooks/use-admin-theme-apply.mjs +84 -0
  80. package/es/hooks/use-admin-viewport-apply.mjs +27 -0
  81. package/es/index.mjs +190 -153
  82. package/es/inject/key.mjs +15 -6
  83. package/es/store/app.mjs +75 -84
  84. package/es/style.css +1 -1
  85. package/es/utils/theme-scale.mjs +37 -0
  86. package/package.json +2 -4
  87. package/types/bridge/config-hook.d.ts +91 -0
  88. package/types/bridge/index.d.ts +108 -8
  89. package/types/bridge/plugin.d.ts +39 -0
  90. package/types/bridge/theme.d.ts +85 -0
  91. package/types/components/app-layout/AppTheme.vue.d.ts +2 -0
  92. package/types/components/app-layout/types.d.ts +1 -1
  93. package/types/components/form/FormItem.vue.d.ts +12 -12
  94. package/types/components/form/FormItemNestForm.vue.d.ts +36 -0
  95. package/types/components/form/FormItemNestFormList.vue.d.ts +63 -0
  96. package/types/components/form/FormMain.vue.d.ts +2 -2
  97. package/types/components/form/FormSearch.vue.d.ts +2 -2
  98. package/types/components/form/FormTree.vue.d.ts +50 -50
  99. package/types/components/form/index.d.ts +9 -1
  100. package/types/components/form/nest-form-item-list.d.ts +63 -0
  101. package/types/components/form/nest-form-item.d.ts +36 -0
  102. package/types/components/form/nest-registry.d.ts +22 -0
  103. package/types/components/form/types.d.ts +2 -0
  104. package/types/components/form/use-nest-form-list.d.ts +20 -0
  105. package/types/components/form/use-nest-form.d.ts +26 -0
  106. package/types/components/form/use-nest-layout-scale.d.ts +17 -0
  107. package/types/components/form/utils.d.ts +26 -1
  108. package/types/components/menu/MenuTree.vue.d.ts +10 -10
  109. package/types/components/modal/ModalShelf.vue.d.ts +1 -1
  110. package/types/components/panel/PanelItemNestForm.vue.d.ts +35 -0
  111. package/types/components/panel/PanelItemNestPanel.vue.d.ts +22 -0
  112. package/types/components/panel/index.d.ts +5 -1
  113. package/types/components/panel/nest-panel-form.d.ts +38 -0
  114. package/types/components/panel/nest-panel-item.d.ts +28 -0
  115. package/types/components/panel/types.d.ts +2 -0
  116. package/types/components/table/TableMain.vue.d.ts +3 -3
  117. package/types/hooks/activated.d.ts +2 -2
  118. package/types/hooks/feel-size.d.ts +1 -1
  119. package/types/hooks/index.d.ts +2 -0
  120. package/types/hooks/menus-dispatch.d.ts +5 -5
  121. package/types/hooks/use-admin-theme-apply.d.ts +17 -0
  122. package/types/hooks/use-admin-viewport-apply.d.ts +15 -0
  123. package/types/hooks/use-breakpoint.d.ts +1 -1
  124. package/types/inject/key.d.ts +46 -1
  125. package/types/store/app.d.ts +138 -59
  126. package/types/utils/index.d.ts +1 -0
  127. package/types/utils/theme-scale.d.ts +35 -0
@@ -1,11 +1,6 @@
1
- import { ElDialog as N, ElButton as O, ElIcon as S } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/dialog/style/css";
4
- import "element-plus/es/components/icon/style/css";
5
- import "element-plus/es/components/button/style/css";
6
- import { defineComponent as V, ref as $, computed as F, openBlock as l, createBlock as i, withCtx as d, createElementVNode as c, renderSlot as u, resolveDynamicComponent as w, createElementBlock as m, Fragment as B, createTextVNode as r, toDisplayString as f, unref as y, createCommentVNode as x, createVNode as C } from "vue";
7
- import { Close as L } from "@element-plus/icons-vue";
8
- const M = { class: "main" }, I = { class: "shim" }, P = { class: "title" }, z = { class: "content" }, A = ["reverse"], W = /* @__PURE__ */ V({
1
+ import { defineComponent as E, ref as N, computed as O, openBlock as l, createBlock as s, unref as r, withCtx as a, createElementVNode as u, renderSlot as m, resolveDynamicComponent as v, createElementBlock as w, Fragment as k, createTextVNode as i, toDisplayString as d, createCommentVNode as S, createVNode as V } from "vue";
2
+ import { ElDialog as D, ElButton as g } from "element-plus";
3
+ const F = { class: "confirm-modal__title" }, H = { class: "confirm-modal__content" }, L = ["reverse"], P = /* @__PURE__ */ E({
9
4
  inheritAttrs: !1,
10
5
  __name: "ConfirmModal",
11
6
  props: {
@@ -19,7 +14,7 @@ const M = { class: "main" }, I = { class: "shim" }, P = { class: "title" }, z =
19
14
  cancelText: { type: [String, Function], default: "取消" },
20
15
  confirmText: { type: [String, Function], default: "确定" },
21
16
  hiddenCancel: { type: Boolean, default: !1 },
22
- width: { default: 418 },
17
+ width: { default: 420 },
23
18
  reverse: { type: Boolean, default: !1 },
24
19
  closeOnPressEscape: { type: Boolean, default: !0 },
25
20
  closeOnClickModal: { type: Boolean, default: !0 },
@@ -27,116 +22,93 @@ const M = { class: "main" }, I = { class: "shim" }, P = { class: "title" }, z =
27
22
  type: { default: "primary" }
28
23
  },
29
24
  emits: ["update:show"],
30
- setup(e, { emit: E }) {
31
- const o = e, T = E, a = $(!1), h = F(() => o.useLoading && a.value), s = (n) => {
32
- var t;
33
- console.log("close", n), T("update:show", !1), (t = o.onClose) == null || t.call(o, n);
34
- }, g = async () => {
35
- var t;
36
- if (await ((t = o.onCancel) == null ? void 0 : t.call(o)) === !1) {
37
- console.log("确认弹窗 onCancel 返回false,不关闭弹窗");
38
- return;
39
- }
40
- s(!1);
41
- }, v = async () => {
25
+ setup(e, { emit: B }) {
26
+ const t = e, x = B, c = N(!1), y = O(() => t.useLoading && c.value), f = (o) => {
27
+ var n;
28
+ x("update:show", !1), (n = t.onClose) == null || n.call(t, o);
29
+ }, h = async () => {
42
30
  var n;
43
- a.value = !0;
31
+ await ((n = t.onCancel) == null ? void 0 : n.call(t)) !== !1 && f(!1);
32
+ }, C = async () => {
33
+ var o;
34
+ c.value = !0;
44
35
  try {
45
- const t = await ((n = o.onConfirm) == null ? void 0 : n.call(o));
46
- if (a.value = !1, t === !1) {
47
- console.log("确认弹窗 onConfirm 返回false,不关闭弹窗");
48
- return;
49
- }
50
- s(!0);
36
+ const n = await ((o = t.onConfirm) == null ? void 0 : o.call(t));
37
+ if (c.value = !1, n === !1) return;
38
+ f(!0);
51
39
  } catch {
52
- a.value = !1;
40
+ c.value = !1;
53
41
  }
54
- }, b = () => {
55
- console.log("closeHandler"), s(!1);
42
+ }, T = () => {
43
+ f(!1);
56
44
  };
57
- return (n, t) => {
58
- const k = O, H = S, D = N;
59
- return l(), i(D, {
60
- "model-value": e.show,
61
- class: "confirm-dialog",
62
- width: e.width,
63
- "show-close": !1,
64
- "append-to-body": "",
65
- "align-center": "",
66
- "close-on-click-modal": e.closeOnClickModal,
67
- "close-on-press-escape": e.closeOnPressEscape,
68
- onClose: b
69
- }, {
70
- default: d(() => [
71
- c("div", M, [
72
- c("div", I, [
73
- c("div", P, [
74
- u(n.$slots, "title", {}, () => [
75
- typeof e.title == "function" ? (l(), i(w(e.title), { key: 0 })) : (l(), m(B, { key: 1 }, [
76
- r(f(e.title), 1)
77
- ], 64))
78
- ], !0)
45
+ return (o, n) => (l(), s(r(D), {
46
+ "model-value": e.show,
47
+ class: "confirm-modal",
48
+ width: e.width,
49
+ "show-close": e.showClose,
50
+ "append-to-body": "",
51
+ "align-center": "",
52
+ "close-on-click-modal": e.closeOnClickModal,
53
+ "close-on-press-escape": e.closeOnPressEscape,
54
+ onClose: T
55
+ }, {
56
+ header: a(() => [
57
+ u("div", F, [
58
+ m(o.$slots, "title", {}, () => [
59
+ typeof e.title == "function" ? (l(), s(v(e.title), { key: 0 })) : (l(), w(k, { key: 1 }, [
60
+ i(d(e.title), 1)
61
+ ], 64))
62
+ ], !0)
63
+ ])
64
+ ]),
65
+ footer: a(() => [
66
+ u("div", {
67
+ class: "confirm-modal__footer",
68
+ reverse: e.reverse
69
+ }, [
70
+ m(o.$slots, "footer", {
71
+ cancelHandler: h,
72
+ confirmHandler: C,
73
+ loading: y.value
74
+ }, () => [
75
+ e.hiddenCancel ? S("", !0) : (l(), s(r(g), {
76
+ key: 0,
77
+ class: "confirm-modal__cancel",
78
+ onClick: h
79
+ }, {
80
+ default: a(() => [
81
+ i(d(typeof e.cancelText == "function" ? e.cancelText() : e.cancelText), 1)
79
82
  ]),
80
- c("div", z, [
81
- u(n.$slots, "default", {}, () => [
82
- typeof e.content == "function" ? (l(), i(w(e.content), { key: 0 })) : (l(), m(B, { key: 1 }, [
83
- r(f(e.content), 1)
84
- ], 64))
85
- ], !0)
83
+ _: 1
84
+ })),
85
+ V(r(g), {
86
+ class: "confirm-modal__confirm",
87
+ type: e.type,
88
+ loading: y.value,
89
+ onClick: C
90
+ }, {
91
+ default: a(() => [
92
+ i(d(typeof e.confirmText == "function" ? e.confirmText() : e.confirmText), 1)
86
93
  ]),
87
- c("div", {
88
- class: "footer",
89
- reverse: e.reverse
90
- }, [
91
- u(n.$slots, "footer", {
92
- cancelHandler: g,
93
- confirmHandler: v,
94
- loading: y(h)
95
- }, () => [
96
- e.hiddenCancel ? x("", !0) : (l(), i(k, {
97
- key: 0,
98
- class: "btn cancel-btn",
99
- btnHover: "",
100
- onClick: g
101
- }, {
102
- default: d(() => [
103
- r(f(typeof e.cancelText == "function" ? e.cancelText() : e.cancelText), 1)
104
- ]),
105
- _: 1
106
- })),
107
- C(k, {
108
- type: e.type,
109
- class: "btn confirm-btn",
110
- loading: y(h),
111
- onClick: v
112
- }, {
113
- default: d(() => [
114
- r(f(typeof e.confirmText == "function" ? e.confirmText() : e.confirmText), 1)
115
- ]),
116
- _: 1
117
- }, 8, ["type", "loading"])
118
- ], !0)
119
- ], 8, A)
120
- ]),
121
- e.showClose ? (l(), m("div", {
122
- key: 0,
123
- class: "close-box",
124
- onClick: t[0] || (t[0] = (j) => s())
125
- }, [
126
- C(H, { size: 22 }, {
127
- default: d(() => [
128
- C(y(L))
129
- ]),
130
- _: 1
131
- })
132
- ])) : x("", !0)
133
- ])
134
- ]),
135
- _: 3
136
- }, 8, ["model-value", "width", "close-on-click-modal", "close-on-press-escape"]);
137
- };
94
+ _: 1
95
+ }, 8, ["type", "loading"])
96
+ ], !0)
97
+ ], 8, L)
98
+ ]),
99
+ default: a(() => [
100
+ u("div", H, [
101
+ m(o.$slots, "default", {}, () => [
102
+ typeof e.content == "function" ? (l(), s(v(e.content), { key: 0 })) : (l(), w(k, { key: 1 }, [
103
+ i(d(e.content), 1)
104
+ ], 64))
105
+ ], !0)
106
+ ])
107
+ ]),
108
+ _: 3
109
+ }, 8, ["model-value", "width", "show-close", "close-on-click-modal", "close-on-press-escape"]));
138
110
  }
139
111
  });
140
112
  export {
141
- W as default
113
+ P as default
142
114
  };
@@ -1,8 +1,8 @@
1
- import y from "./ConfirmModal.vue.mjs";
2
- import p from "../form/FormMain.vue.mjs";
3
- import { defineComponent as g, ref as b, computed as r, watch as A, openBlock as W, createBlock as C, unref as s, withCtx as M, createVNode as D, mergeProps as _ } from "vue";
4
- import { stringifyFormData as k } from "../form/utils.mjs";
5
- const L = /* @__PURE__ */ g({
1
+ import { defineComponent as w, ref as y, computed as n, watch as g, openBlock as b, createBlock as p, withCtx as A, createVNode as W, unref as v, mergeProps as C } from "vue";
2
+ import M from "../form/FormMain.vue.mjs";
3
+ import { stringifyFormData as D } from "../form/utils.mjs";
4
+ import k from "./ConfirmModal.vue.mjs";
5
+ const P = /* @__PURE__ */ w({
6
6
  __name: "DetailModal",
7
7
  props: {
8
8
  data: {},
@@ -20,51 +20,48 @@ const L = /* @__PURE__ */ g({
20
20
  },
21
21
  emits: ["update:show", "afterAdd", "afterEdit"],
22
22
  setup(a, { emit: f }) {
23
- const t = a, l = f, d = b(), m = r(() => t.data), c = r(() => `${t.type === "add" ? "新增" : "编辑"}${t.subTitle || ""}`), u = (o) => {
24
- l("update:show", o);
25
- }, h = () => {
23
+ const t = a, i = f, l = y(), s = n(() => t.data), u = n(() => `${t.type === "add" ? "新增" : "编辑"}${t.subTitle || ""}`), m = (o) => {
24
+ i("update:show", o);
25
+ }, c = () => {
26
26
  var o;
27
- return (o = d.value) == null ? void 0 : o.validate().then(async () => {
28
- var i, n;
29
- const e = k(t.data, t.list);
30
- console.log("confirm", e), t.type === "add" ? (await ((i = t.addApi) == null ? void 0 : i.call(t, e)), l("afterAdd", e)) : (await ((n = t.editApi) == null ? void 0 : n.call(t, e)), l("afterEdit", e));
27
+ return (o = l.value) == null ? void 0 : o.validate().then(async () => {
28
+ var d, r;
29
+ const e = D(t.data, t.list);
30
+ console.log("confirm", e), t.type === "add" ? (await ((d = t.addApi) == null ? void 0 : d.call(t, e)), i("afterAdd", e)) : (await ((r = t.editApi) == null ? void 0 : r.call(t, e)), i("afterEdit", e));
31
31
  });
32
- }, w = () => {
32
+ }, h = () => {
33
33
  console.log("cancel");
34
34
  };
35
- return A(
35
+ return g(
36
36
  () => t.show,
37
37
  (o) => {
38
38
  var e;
39
- o || (e = d.value) == null || e.clearValidate();
39
+ o || (e = l.value) == null || e.clearValidate();
40
40
  }
41
- ), (o, e) => {
42
- const i = p, n = y;
43
- return W(), C(n, {
44
- title: s(c),
45
- show: a.show,
46
- onConfirm: h,
47
- onCancel: w,
48
- useLoading: "",
49
- width: a.modalWidth,
50
- "onUpdate:show": u
51
- }, {
52
- default: M(() => [
53
- D(i, _({
54
- ref_key: "formMain",
55
- ref: d,
56
- list: a.list,
57
- data: s(m),
58
- layout: a.formLayout,
59
- labelWidth: a.labelWidth,
60
- "row-gutter": a.formRowGutter
61
- }, a.formProps), null, 16, ["list", "data", "layout", "labelWidth", "row-gutter"])
62
- ]),
63
- _: 1
64
- }, 8, ["title", "show", "width"]);
65
- };
41
+ ), (o, e) => (b(), p(k, {
42
+ title: u.value,
43
+ show: a.show,
44
+ onConfirm: c,
45
+ onCancel: h,
46
+ useLoading: "",
47
+ width: a.modalWidth,
48
+ "onUpdate:show": m
49
+ }, {
50
+ default: A(() => [
51
+ W(v(M), C({
52
+ ref_key: "formMain",
53
+ ref: l,
54
+ list: a.list,
55
+ data: s.value,
56
+ layout: a.formLayout,
57
+ labelWidth: a.labelWidth,
58
+ "row-gutter": a.formRowGutter
59
+ }, a.formProps), null, 16, ["list", "data", "layout", "labelWidth", "row-gutter"])
60
+ ]),
61
+ _: 1
62
+ }, 8, ["title", "show", "width"]));
66
63
  }
67
64
  });
68
65
  export {
69
- L as default
66
+ P as default
70
67
  };
@@ -1,7 +1,7 @@
1
1
  import t from "./PanelEditSwitch.vue2.mjs";
2
2
  /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-7bb14fd1"]]);
4
+ const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-65f056ab"]]);
5
5
  export {
6
6
  i as default
7
7
  };
@@ -1,13 +1,11 @@
1
- import { ElButton as C } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/button/style/css";
4
- import { defineComponent as h, useModel as w, ref as F, computed as B, watch as c, openBlock as r, createElementBlock as u, createBlock as d, withCtx as E, createTextVNode as P, createCommentVNode as M, renderSlot as l, Fragment as $, unref as o, mergeModels as m } from "vue";
5
- import N from "lodash/cloneDeep";
6
- import T from "../form/FormSubmitPanel.vue.mjs";
7
- const V = { class: "panel-edit-switch" }, A = /* @__PURE__ */ h({
1
+ import { defineComponent as S, useModel as C, ref as h, computed as w, watch as l, openBlock as s, createElementBlock as u, createBlock as d, unref as c, withCtx as F, createTextVNode as B, createCommentVNode as E, renderSlot as r, Fragment as P, mergeModels as f } from "vue";
2
+ import { ElButton as M } from "element-plus";
3
+ import $ from "lodash/cloneDeep";
4
+ import N from "../form/FormSubmitPanel.vue.mjs";
5
+ const T = { class: "panel-edit-switch" }, R = /* @__PURE__ */ S({
8
6
  name: "PanelEditSwitch",
9
7
  __name: "PanelEditSwitch",
10
- props: /* @__PURE__ */ m({
8
+ props: /* @__PURE__ */ f({
11
9
  data: {},
12
10
  config: {},
13
11
  editable: { type: Boolean },
@@ -16,28 +14,28 @@ const V = { class: "panel-edit-switch" }, A = /* @__PURE__ */ h({
16
14
  editing: { type: Boolean, default: !1 },
17
15
  editingModifiers: {}
18
16
  }),
19
- emits: /* @__PURE__ */ m(["submitSuccess"], ["update:editing"]),
20
- setup(i, { emit: f }) {
21
- const n = i, g = f, e = w(i, "editing"), a = F(
17
+ emits: /* @__PURE__ */ f(["submitSuccess"], ["update:editing"]),
18
+ setup(i, { emit: m }) {
19
+ const n = i, g = m, e = C(i, "editing"), a = h(
22
20
  {}
23
- ), p = B(() => [n.config.editorConfig]), y = (t) => t, b = () => {
21
+ ), y = w(() => [n.config.editorConfig]), b = (t) => t, p = () => {
24
22
  e.value = !0;
25
- }, k = () => {
23
+ }, v = () => {
26
24
  e.value = !1;
27
- }, v = (t) => {
25
+ }, k = (t) => {
28
26
  if (!n.submitFn)
29
27
  throw new Error("可编辑 那么必须提供 submitFn");
30
28
  return n.submitFn(t);
31
29
  }, D = (t) => {
32
30
  e.value = !1, g("submitSuccess", t);
33
31
  };
34
- return c(
32
+ return l(
35
33
  e,
36
- (t, s) => {
37
- t && !s && (a.value = N(n.data));
34
+ (t, o) => {
35
+ t && !o && (a.value = $(n.data));
38
36
  },
39
37
  { immediate: !0 }
40
- ), c(
38
+ ), l(
41
39
  () => n.editable,
42
40
  (t) => {
43
41
  t || (e.value = !1);
@@ -45,47 +43,44 @@ const V = { class: "panel-edit-switch" }, A = /* @__PURE__ */ h({
45
43
  {
46
44
  immediate: !0
47
45
  }
48
- ), (t, s) => {
49
- const S = C;
50
- return r(), u("div", V, [
51
- i.editable && !e.value ? (r(), d(S, {
46
+ ), (t, o) => (s(), u("div", T, [
47
+ i.editable && !e.value ? (s(), d(c(M), {
48
+ key: 0,
49
+ class: "panel-edit-switch-edit-btn",
50
+ type: "primary",
51
+ link: "",
52
+ size: "small",
53
+ onClick: p
54
+ }, {
55
+ default: F(() => [...o[0] || (o[0] = [
56
+ B(" 编辑", -1)
57
+ ])]),
58
+ _: 1
59
+ })) : E("", !0),
60
+ e.value ? (s(), u(P, { key: 2 }, [
61
+ i.config.editorRender ? r(t.$slots, "editor", {
52
62
  key: 0,
53
- class: "panel-edit-switch-edit-btn",
54
- type: "primary",
55
- link: "",
56
- size: "small",
57
- onClick: b
58
- }, {
59
- default: E(() => [...s[0] || (s[0] = [
60
- P(" 编辑", -1)
61
- ])]),
62
- _: 1
63
- })) : M("", !0),
64
- e.value ? (r(), u($, { key: 2 }, [
65
- i.config.editorRender ? l(t.$slots, "editor", {
66
- key: 0,
67
- stringifyDraftData: o(a)
68
- }, void 0, !0) : i.config.editorConfig ? (r(), d(o(T), {
69
- key: 1,
70
- list: o(p),
71
- "stringify-data": y(o(a)),
72
- "cancel-btn": "取消",
73
- "operation-position": "bottom-right",
74
- "submit-fn": v,
75
- onCancel: k,
76
- onSuccess: D
77
- }, null, 8, ["list", "stringify-data"])) : l(t.$slots, "default", {
78
- key: 2,
79
- stringifyDraftData: o(a)
80
- }, void 0, !0)
81
- ], 64)) : l(t.$slots, "default", {
63
+ stringifyDraftData: a.value
64
+ }, void 0, !0) : i.config.editorConfig ? (s(), d(c(N), {
82
65
  key: 1,
83
- stringifyDraftData: i.data
66
+ list: y.value,
67
+ "stringify-data": b(a.value),
68
+ "cancel-btn": "取消",
69
+ "operation-position": "bottom-right",
70
+ "submit-fn": k,
71
+ onCancel: v,
72
+ onSuccess: D
73
+ }, null, 8, ["list", "stringify-data"])) : r(t.$slots, "default", {
74
+ key: 2,
75
+ stringifyDraftData: a.value
84
76
  }, void 0, !0)
85
- ]);
86
- };
77
+ ], 64)) : r(t.$slots, "default", {
78
+ key: 1,
79
+ stringifyDraftData: i.data
80
+ }, void 0, !0)
81
+ ]));
87
82
  }
88
83
  });
89
84
  export {
90
- A as default
85
+ R as default
91
86
  };
@@ -0,0 +1,7 @@
1
+ import o from "./PanelItemNestForm.vue2.mjs";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3af1d77a"]]);
5
+ export {
6
+ e as default
7
+ };
@@ -0,0 +1,69 @@
1
+ import { defineComponent as y, ref as h, openBlock as b, createElementBlock as x, createVNode as n, unref as l, createElementVNode as w, withCtx as c, createTextVNode as i, toDisplayString as r } from "vue";
2
+ import N from "../form/FormMain.vue.mjs";
3
+ import { useNestForm as S } from "../form/use-nest-form.mjs";
4
+ import { useNestLayoutScale as C } from "../form/use-nest-layout-scale.mjs";
5
+ import s from "../display/ActionBtn.vue.mjs";
6
+ const k = { class: "panel-item-nest-form" }, p = { class: "panel-item-nest-form-actions" }, _ = /* @__PURE__ */ y({
7
+ name: "PanelItemNestForm",
8
+ inheritAttrs: !1,
9
+ __name: "PanelItemNestForm",
10
+ props: {
11
+ data: {},
12
+ list: {},
13
+ layout: {},
14
+ rowGutter: {},
15
+ submitText: { default: "提交" },
16
+ cancelText: { default: "取消" },
17
+ submit: {},
18
+ cancel: {},
19
+ parentSpan: {},
20
+ rebase: { type: Boolean, default: !0 }
21
+ },
22
+ setup(e) {
23
+ const t = e, m = C({
24
+ parentSpan: () => t.parentSpan,
25
+ rebase: () => t.rebase
26
+ }), o = h(), { validateChild: u } = S({ childRef: o }), d = async () => {
27
+ var a;
28
+ await u(), await ((a = t.submit) == null ? void 0 : a.call(t));
29
+ }, f = () => {
30
+ var a;
31
+ (a = t.cancel) == null || a.call(t);
32
+ };
33
+ return (a, T) => (b(), x("div", k, [
34
+ n(l(N), {
35
+ ref_key: "childRef",
36
+ ref: o,
37
+ list: e.list,
38
+ data: e.data,
39
+ layout: e.layout,
40
+ "layout-scale": l(m),
41
+ "row-gutter": e.rowGutter
42
+ }, null, 8, ["list", "data", "layout", "layout-scale", "row-gutter"]),
43
+ w("div", p, [
44
+ n(l(s), {
45
+ size: "small",
46
+ onClick: f
47
+ }, {
48
+ default: c(() => [
49
+ i(r(e.cancelText), 1)
50
+ ]),
51
+ _: 1
52
+ }),
53
+ n(l(s), {
54
+ size: "small",
55
+ type: "primary",
56
+ onClick: d
57
+ }, {
58
+ default: c(() => [
59
+ i(r(e.submitText), 1)
60
+ ]),
61
+ _: 1
62
+ })
63
+ ])
64
+ ]));
65
+ }
66
+ });
67
+ export {
68
+ _ as default
69
+ };
@@ -0,0 +1,34 @@
1
+ import { defineComponent as r, openBlock as l, createBlock as n, unref as o } from "vue";
2
+ import u from "./PanelMain.vue.mjs";
3
+ import { useNestLayoutScale as c } from "../form/use-nest-layout-scale.mjs";
4
+ const p = /* @__PURE__ */ r({
5
+ name: "PanelItemNestPanel",
6
+ inheritAttrs: !1,
7
+ __name: "PanelItemNestPanel",
8
+ props: {
9
+ data: {},
10
+ list: {},
11
+ itemCard: { type: [Boolean, Object] },
12
+ layout: {},
13
+ rowGutter: {},
14
+ parentSpan: {},
15
+ rebase: { type: Boolean, default: !0 }
16
+ },
17
+ setup(t) {
18
+ const e = t, a = c({
19
+ parentSpan: () => e.parentSpan,
20
+ rebase: () => e.rebase
21
+ });
22
+ return (s, i) => (l(), n(u, {
23
+ list: t.list,
24
+ data: t.data,
25
+ "item-card": t.itemCard,
26
+ layout: t.layout,
27
+ "layout-scale": o(a),
28
+ "row-gutter": t.rowGutter
29
+ }, null, 8, ["list", "data", "item-card", "layout", "layout-scale", "row-gutter"]));
30
+ }
31
+ });
32
+ export {
33
+ p as default
34
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./PanelItemNestPanel.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -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 p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-25951dc8"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9c14b584"]]);
5
5
  export {
6
6
  p as default
7
7
  };