@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,8 +1,6 @@
1
- import { ElTree as c } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/tree/style/css";
4
- import { defineComponent as m, openBlock as r, createBlock as u } from "vue";
5
- const i = /* @__PURE__ */ m({
1
+ import { defineComponent as n, openBlock as u, createBlock as c, unref as r } from "vue";
2
+ import { ElTree as m } from "element-plus";
3
+ const s = /* @__PURE__ */ n({
6
4
  __name: "FormTree",
7
5
  props: {
8
6
  modelValue: {},
@@ -11,24 +9,21 @@ const i = /* @__PURE__ */ m({
11
9
  defaultExpandAll: { type: Boolean }
12
10
  },
13
11
  emits: ["update:modelValue"],
14
- setup(e, { emit: o }) {
15
- const l = o, a = (d, { checkedKeys: t }) => {
16
- l("update:modelValue", t);
17
- };
18
- return (d, t) => {
19
- const n = c;
20
- return r(), u(n, {
21
- ref: "elTree",
22
- data: e.tree,
23
- showCheckbox: e.showCheckbox,
24
- nodeKey: "id",
25
- defaultCheckedKeys: e.modelValue,
26
- defaultExpandAll: e.defaultExpandAll,
27
- onCheck: a
28
- }, null, 8, ["data", "showCheckbox", "defaultCheckedKeys", "defaultExpandAll"]);
12
+ setup(e, { emit: a }) {
13
+ const t = a, o = (d, { checkedKeys: l }) => {
14
+ t("update:modelValue", l);
29
15
  };
16
+ return (d, l) => (u(), c(r(m), {
17
+ ref: "elTree",
18
+ data: e.tree,
19
+ showCheckbox: e.showCheckbox,
20
+ nodeKey: "id",
21
+ defaultCheckedKeys: e.modelValue,
22
+ defaultExpandAll: e.defaultExpandAll,
23
+ onCheck: o
24
+ }, null, 8, ["data", "showCheckbox", "defaultCheckedKeys", "defaultExpandAll"]));
30
25
  }
31
26
  });
32
27
  export {
33
- i as default
28
+ s as default
34
29
  };
@@ -1,10 +1,7 @@
1
- import { ElInput as B, ElButton as g } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/input/style/css";
4
- import "element-plus/es/components/button/style/css";
5
- import { defineComponent as h, ref as u, computed as x, onBeforeUnmount as _, watch as E, openBlock as n, createBlock as I, withCtx as r, createVNode as T, unref as a, createElementBlock as p, toDisplayString as c } from "vue";
1
+ import { defineComponent as b, ref as u, computed as k, onBeforeUnmount as g, watch as h, openBlock as d, createBlock as x, unref as m, withCtx as r, createVNode as B, createElementBlock as f, toDisplayString as p } from "vue";
2
+ import { ElInput as E, ElButton as T } from "element-plus";
6
3
  import { timeCountDown as z } from "../../utils/time.mjs";
7
- const K = { key: 0 }, U = { key: 1 }, A = /* @__PURE__ */ h({
4
+ const I = { key: 0 }, K = { key: 1 }, F = /* @__PURE__ */ b({
8
5
  __name: "FormVerifyCode",
9
6
  props: {
10
7
  modelValue: {},
@@ -16,57 +13,54 @@ const K = { key: 0 }, U = { key: 1 }, A = /* @__PURE__ */ h({
16
13
  btnText: { default: "发送验证码" }
17
14
  },
18
15
  emits: ["update:modelValue"],
19
- setup(o, { emit: f }) {
20
- const l = o, y = f, t = u(0), d = u(!1), i = x(() => t.value > 0);
16
+ setup(t, { emit: c }) {
17
+ const a = t, v = c, l = u(0), o = u(!1), i = k(() => l.value > 0);
21
18
  let e;
22
- const V = () => {
23
- d.value = !0, console.log("发送验证码"), l.api(l.params).then(() => {
24
- t.value = l.hz, e == null || e(), e = z(
25
- t.value,
19
+ const y = () => {
20
+ o.value = !0, console.log("发送验证码"), a.api(a.params).then(() => {
21
+ l.value = a.hz, e == null || e(), e = z(
22
+ l.value,
26
23
  (s) => {
27
- t.value = s;
24
+ l.value = s;
28
25
  },
29
26
  () => {
30
27
  console.log("倒计时结束");
31
28
  }
32
29
  );
33
30
  }).finally(() => {
34
- d.value = !1;
31
+ o.value = !1;
35
32
  });
36
33
  };
37
- return _(() => {
34
+ return g(() => {
38
35
  e == null || e();
39
- }), E(
40
- () => l.resetKey,
36
+ }), h(
37
+ () => a.resetKey,
41
38
  () => {
42
- e == null || e(), t.value = 0;
39
+ e == null || e(), l.value = 0;
43
40
  }
44
- ), (s, m) => {
45
- const b = g, v = B;
46
- return n(), I(v, {
47
- modelValue: o.modelValue,
48
- disabled: o.disabled,
49
- "onUpdate:modelValue": m[0] || (m[0] = (k) => y("update:modelValue", k))
50
- }, {
51
- suffix: r(() => [
52
- T(b, {
53
- type: "primary",
54
- link: "",
55
- loading: a(d),
56
- disabled: a(i) || o.disabled,
57
- onClick: V
58
- }, {
59
- default: r(() => [
60
- a(i) ? (n(), p("span", K, c(a(t)) + "s后可重新发送", 1)) : (n(), p("span", U, c(o.btnText), 1))
61
- ]),
62
- _: 1
63
- }, 8, ["loading", "disabled"])
64
- ]),
65
- _: 1
66
- }, 8, ["modelValue", "disabled"]);
67
- };
41
+ ), (s, n) => (d(), x(m(E), {
42
+ modelValue: t.modelValue,
43
+ disabled: t.disabled,
44
+ "onUpdate:modelValue": n[0] || (n[0] = (V) => v("update:modelValue", V))
45
+ }, {
46
+ suffix: r(() => [
47
+ B(m(T), {
48
+ type: "primary",
49
+ link: "",
50
+ loading: o.value,
51
+ disabled: i.value || t.disabled,
52
+ onClick: y
53
+ }, {
54
+ default: r(() => [
55
+ i.value ? (d(), f("span", I, p(l.value) + "s后可重新发送", 1)) : (d(), f("span", K, p(t.btnText), 1))
56
+ ]),
57
+ _: 1
58
+ }, 8, ["loading", "disabled"])
59
+ ]),
60
+ _: 1
61
+ }, 8, ["modelValue", "disabled"]));
68
62
  }
69
63
  });
70
64
  export {
71
- A as default
65
+ F as default
72
66
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./FormVerifyImage.vue2.mjs";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-a4baf877"]]);
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-669b7ad9"]]);
5
5
  export {
6
- f as default
6
+ e as default
7
7
  };
@@ -1,8 +1,6 @@
1
- import { ElInput as x } from "element-plus/es";
2
- import "element-plus/es/components/base/style/css";
3
- import "element-plus/es/components/input/style/css";
4
- import { defineComponent as V, ref as r, computed as s, onMounted as _, openBlock as k, createBlock as U, normalizeStyle as u, unref as o, withCtx as I, createElementVNode as c } from "vue";
5
- const R = ["disabled"], $ = ["src"], d = "9px", E = /* @__PURE__ */ V({
1
+ import { defineComponent as y, ref as m, computed as n, onMounted as h, openBlock as x, createBlock as V, unref as _, normalizeStyle as s, withCtx as k, createElementVNode as u } from "vue";
2
+ import { ElInput as U } from "element-plus";
3
+ const R = ["disabled"], $ = ["src"], d = "9px", B = /* @__PURE__ */ y({
6
4
  __name: "FormVerifyImage",
7
5
  props: {
8
6
  modelValue: {},
@@ -12,49 +10,46 @@ const R = ["disabled"], $ = ["src"], d = "9px", E = /* @__PURE__ */ V({
12
10
  autoRevokeUrl: { type: Boolean }
13
11
  },
14
12
  emits: ["update:modelValue"],
15
- setup(a, { emit: f }) {
16
- const e = a, p = f, t = r(!1), l = r(""), g = s(() => ({
13
+ setup(a, { emit: c }) {
14
+ const e = a, f = c, l = m(!1), t = m(""), p = n(() => ({
17
15
  left: `calc(100% + ${d})`,
18
16
  width: `${e.imgWidth}px`
19
- })), v = s(() => ({
17
+ })), v = n(() => ({
20
18
  width: `calc(100% - ${d} - ${e.imgWidth}px)`
21
- })), i = () => {
22
- t.value || (console.log("获取图片验证码"), t.value = !0, l.value && e.autoRevokeUrl && URL.revokeObjectURL(l.value), e.api(e.params).then((n) => {
23
- l.value = n;
19
+ })), o = () => {
20
+ l.value || (console.log("获取图片验证码"), l.value = !0, t.value && e.autoRevokeUrl && URL.revokeObjectURL(t.value), e.api(e.params).then((i) => {
21
+ t.value = i;
24
22
  }).finally(() => {
25
- t.value = !1;
23
+ l.value = !1;
26
24
  }));
27
25
  };
28
- return _(() => {
29
- i();
30
- }), (n, m) => {
31
- const y = x;
32
- return k(), U(y, {
33
- placeholder: "验证码",
34
- modelValue: a.modelValue,
35
- class: "form-verify-image",
36
- style: u(o(v)),
37
- "onUpdate:modelValue": m[0] || (m[0] = (h) => p("update:modelValue", h))
38
- }, {
39
- suffix: I(() => [
40
- c("div", {
41
- class: "form-verify-image-suffix",
42
- style: u(o(g)),
43
- disabled: o(t),
44
- onClick: i
45
- }, [
46
- c("img", {
47
- class: "form-verify-image-suffix-main",
48
- src: o(l),
49
- alt: ""
50
- }, null, 8, $)
51
- ], 12, R)
52
- ]),
53
- _: 1
54
- }, 8, ["modelValue", "style"]);
55
- };
26
+ return h(() => {
27
+ o();
28
+ }), (i, r) => (x(), V(_(U), {
29
+ placeholder: "验证码",
30
+ modelValue: a.modelValue,
31
+ class: "form-verify-image",
32
+ style: s(v.value),
33
+ "onUpdate:modelValue": r[0] || (r[0] = (g) => f("update:modelValue", g))
34
+ }, {
35
+ suffix: k(() => [
36
+ u("div", {
37
+ class: "form-verify-image-suffix",
38
+ style: s(p.value),
39
+ disabled: l.value,
40
+ onClick: o
41
+ }, [
42
+ u("img", {
43
+ class: "form-verify-image-suffix-main",
44
+ src: t.value,
45
+ alt: ""
46
+ }, null, 8, $)
47
+ ], 12, R)
48
+ ]),
49
+ _: 1
50
+ }, 8, ["modelValue", "style"]));
56
51
  }
57
52
  });
58
53
  export {
59
- E as default
54
+ B as default
60
55
  };
@@ -0,0 +1,71 @@
1
+ import { markRaw as K } from "vue";
2
+ import M from "./FormItemNestFormList.vue.mjs";
3
+ import { resolveLayoutSpan as N, parseFormData as S, stringifyFormData as T } from "./utils.mjs";
4
+ const v = K(M);
5
+ function k(l) {
6
+ const {
7
+ key: m,
8
+ label: n,
9
+ list: o,
10
+ rowKey: d,
11
+ itemFactory: h,
12
+ min: f,
13
+ max: y,
14
+ layout: p,
15
+ rowGutter: c,
16
+ addText: F,
17
+ removeText: R,
18
+ headerRender: w,
19
+ footerRender: A,
20
+ shadowColor: L,
21
+ rules: t,
22
+ init: x,
23
+ stringify: I,
24
+ parse: $,
25
+ rebase: C,
26
+ removeConfirm: D
27
+ } = l, i = f ?? 0, s = y ?? 1 / 0, u = {
28
+ validator: (r, e, a) => {
29
+ const g = Array.isArray(e) ? e.length : 0;
30
+ return g < i ? a(new Error(`${n}至少需要 ${i} 项`)) : g > s ? a(new Error(`${n}最多 ${s} 项`)) : a();
31
+ },
32
+ trigger: "change"
33
+ }, E = i > 0 || s !== 1 / 0 ? typeof t == "function" ? (r) => [u, ...t(r)] : [u, ...t ?? []] : t;
34
+ return {
35
+ key: m,
36
+ label: n,
37
+ layout: p,
38
+ rules: E,
39
+ // 自动 pack(可覆盖):父 generate/stringify/parse 对数组逐项递归。
40
+ // init 缺省 = 空数组 []([MUST NOT] 补 min 行改初始值;min/max 由上方 rules 校验)
41
+ init: x ?? (() => []),
42
+ stringify: I ?? ((r) => (Array.isArray(r) ? r : []).map(
43
+ (e) => T(e, o)
44
+ )),
45
+ parse: $ ?? ((r) => (Array.isArray(r) ? r : []).map((e) => S(e, o))),
46
+ // render 用【组件本体引用】(非包裹 fn):FormItem 经 vModel sugar 注入 modelValue/onUpdate,
47
+ // 固定配置走 props。便于消费方按 `config.render === FormItemNestFormList` 判定"是联结组件"。
48
+ render: v,
49
+ props: {
50
+ nestKey: m,
51
+ list: o,
52
+ rowKey: d,
53
+ itemFactory: h,
54
+ min: f,
55
+ max: y,
56
+ rowGutter: c,
57
+ addText: F,
58
+ removeText: R,
59
+ headerRender: w,
60
+ footerRender: A,
61
+ shadowColor: L,
62
+ // P3:把父 item 代表 span 传薄壳,供其叠 rebase 因子算每行子 FormMain 的 layoutScale
63
+ parentSpan: N(p),
64
+ rebase: C,
65
+ removeConfirm: D
66
+ }
67
+ };
68
+ }
69
+ export {
70
+ k as nestFormItemList
71
+ };
@@ -0,0 +1,42 @@
1
+ import { markRaw as y } from "vue";
2
+ import l from "./FormItemNestForm.vue.mjs";
3
+ import { resolveLayoutSpan as u, parseFormData as g, stringifyFormData as w, generateFormData as c } from "./utils.mjs";
4
+ const D = y(l);
5
+ function k(a) {
6
+ const {
7
+ key: e,
8
+ label: m,
9
+ list: r,
10
+ layout: o,
11
+ rowGutter: n,
12
+ shadowColor: s,
13
+ init: i,
14
+ stringify: p,
15
+ parse: F,
16
+ rebase: f
17
+ } = a;
18
+ return {
19
+ key: e,
20
+ label: m,
21
+ layout: o,
22
+ // 自动 pack(可覆盖):父 generate/stringify/parse 递归进子 list
23
+ init: i ?? (() => c(r)),
24
+ stringify: p ?? ((t) => w(t ?? {}, r)),
25
+ parse: F ?? ((t) => g(t ?? {}, r)),
26
+ // render 用【组件本体引用】(非包裹 fn):FormItem 经 vModel sugar 注入 modelValue/onUpdate,
27
+ // 固定配置走 props。便于消费方按 `config.render === FormItemNestForm` 判定"是联结组件"。
28
+ render: D,
29
+ props: {
30
+ nestKey: e,
31
+ list: r,
32
+ rowGutter: n,
33
+ shadowColor: s,
34
+ // P3:把父 item 代表 span 传薄壳,供其叠 rebase 因子算子 FormMain 的 layoutScale
35
+ parentSpan: u(o),
36
+ rebase: f
37
+ }
38
+ };
39
+ }
40
+ export {
41
+ k as nestFormItem
42
+ };
@@ -0,0 +1,7 @@
1
+ import { shallowReactive as e } from "vue";
2
+ function r() {
3
+ return e({});
4
+ }
5
+ export {
6
+ r as createNestFormExposeMap
7
+ };
@@ -0,0 +1,22 @@
1
+ import { inject as s, onMounted as l, toValue as a, onBeforeUnmount as c } from "vue";
2
+ import { FORM_NEST_REGISTRY_KEY as d } from "../../inject/key.mjs";
3
+ function u(n) {
4
+ const { rowInstances: t, key: r } = n, o = s(d, null);
5
+ if (!o) return;
6
+ const i = {
7
+ validate: () => Promise.all(t().map((e) => e.validate())).then(() => {
8
+ }),
9
+ clearValidate: () => t().forEach((e) => e.clearValidate()),
10
+ resetFields: () => t().forEach((e) => e.resetFields())
11
+ };
12
+ l(() => {
13
+ const e = a(r);
14
+ e !== void 0 && (o[e] = i);
15
+ }), c(() => {
16
+ const e = a(r);
17
+ e !== void 0 && delete o[e];
18
+ });
19
+ }
20
+ export {
21
+ u as useNestFormList
22
+ };
@@ -0,0 +1,34 @@
1
+ import { inject as d, onMounted as u, toValue as a, onBeforeUnmount as f } from "vue";
2
+ import { FORM_NEST_REGISTRY_KEY as p } from "../../inject/key.mjs";
3
+ function x(c) {
4
+ const { childRef: s, key: i } = c, l = () => {
5
+ var o;
6
+ return ((o = s.value) == null ? void 0 : o.validate()) ?? Promise.resolve();
7
+ }, r = (o) => {
8
+ var e;
9
+ return (e = s.value) == null ? void 0 : e.clearValidate(o);
10
+ }, n = () => {
11
+ var o;
12
+ return (o = s.value) == null ? void 0 : o.resetFields();
13
+ }, t = d(p, null);
14
+ if (t) {
15
+ const o = {
16
+ validate: () => l(),
17
+ clearValidate: (e) => r(e),
18
+ resetFields: () => n()
19
+ };
20
+ u(() => {
21
+ const e = a(i);
22
+ e !== void 0 && (e in t && t[e] === o && console.error(
23
+ `[useNestForm] 嵌套 exposeMap 重复注册同一 expose(key="${e}"),疑似生命周期重复挂载;已继续挂载。`
24
+ ), t[e] = o);
25
+ }), f(() => {
26
+ const e = a(i);
27
+ e !== void 0 && delete t[e];
28
+ });
29
+ }
30
+ return { validateChild: l, clearChild: r, resetChild: n };
31
+ }
32
+ export {
33
+ x as useNestForm
34
+ };
@@ -0,0 +1,14 @@
1
+ import { inject as u, computed as c, toValue as o } from "vue";
2
+ import { NEST_LAYOUT_SCALE_KEY as f } from "../../inject/key.mjs";
3
+ function m(t) {
4
+ const r = u(f, void 0);
5
+ return c(() => {
6
+ const n = r ? r.value : 1;
7
+ if (o(t.rebase) === !1) return n;
8
+ const e = o(t.parentSpan), a = typeof e == "number" && e > 0 ? e : 24;
9
+ return n * (24 / a);
10
+ });
11
+ }
12
+ export {
13
+ m as useNestLayoutScale
14
+ };