@silver-formily/element-plus 2.0.1 → 2.1.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 (154) hide show
  1. package/LICENSE +21 -21
  2. package/README.en-US.md +32 -0
  3. package/README.md +32 -35
  4. package/esm/__builtins__/configs/index.mjs.map +1 -1
  5. package/esm/__builtins__/index.mjs +15 -16
  6. package/esm/__builtins__/shared/hooks.mjs.map +1 -1
  7. package/esm/__builtins__/shared/index.mjs +11 -12
  8. package/esm/__builtins__/shared/loading.mjs.map +1 -1
  9. package/esm/__builtins__/shared/simple-version-compare.mjs.map +1 -1
  10. package/esm/__builtins__/shared/transform-component.d.ts +2 -6
  11. package/esm/__builtins__/shared/transform-component.mjs +16 -33
  12. package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
  13. package/esm/__builtins__/shared/utils.mjs +10 -10
  14. package/esm/__builtins__/shared/utils.mjs.map +1 -1
  15. package/esm/array-base/index.mjs +76 -73
  16. package/esm/array-base/index.mjs.map +1 -1
  17. package/esm/array-base/symbols.mjs.map +1 -1
  18. package/esm/array-base/utils.mjs +33 -29
  19. package/esm/array-base/utils.mjs.map +1 -1
  20. package/esm/array-cards/index.mjs +56 -54
  21. package/esm/array-cards/index.mjs.map +1 -1
  22. package/esm/array-collapse/index.mjs +64 -62
  23. package/esm/array-collapse/index.mjs.map +1 -1
  24. package/esm/array-collapse/utils.mjs +8 -2
  25. package/esm/array-collapse/utils.mjs.map +1 -1
  26. package/esm/array-items/index.mjs +53 -47
  27. package/esm/array-items/index.mjs.map +1 -1
  28. package/esm/array-list-tabs/index.mjs +36 -34
  29. package/esm/array-list-tabs/index.mjs.map +1 -1
  30. package/esm/array-list-tabs/utils.mjs +11 -5
  31. package/esm/array-list-tabs/utils.mjs.map +1 -1
  32. package/esm/array-table/array-table.d.ts +28 -0
  33. package/esm/array-table/index.d.ts +28 -0
  34. package/esm/array-table/index.mjs +126 -123
  35. package/esm/array-table/index.mjs.map +1 -1
  36. package/esm/array-table/types.d.ts +1 -0
  37. package/esm/array-table/utils.mjs +18 -12
  38. package/esm/array-table/utils.mjs.map +1 -1
  39. package/esm/array-tabs/index.mjs +19 -17
  40. package/esm/array-tabs/index.mjs.map +1 -1
  41. package/esm/cascader/index.mjs +26 -24
  42. package/esm/cascader/index.mjs.map +1 -1
  43. package/esm/checkbox/checkbox-group.d.ts +1 -4
  44. package/esm/checkbox/index.d.ts +442 -379
  45. package/esm/checkbox/index.mjs +19 -16
  46. package/esm/checkbox/index.mjs.map +1 -1
  47. package/esm/date-picker/index.mjs +14 -12
  48. package/esm/date-picker/index.mjs.map +1 -1
  49. package/esm/editable/editable.d.ts +16 -12
  50. package/esm/editable/index.d.ts +8 -6
  51. package/esm/editable/index.mjs +113 -113
  52. package/esm/editable/index.mjs.map +1 -1
  53. package/esm/form/form.mjs +6 -6
  54. package/esm/form/form.mjs.map +1 -1
  55. package/esm/form-button-group/index.mjs +33 -29
  56. package/esm/form-button-group/index.mjs.map +1 -1
  57. package/esm/form-button-group/utils.mjs +8 -2
  58. package/esm/form-button-group/utils.mjs.map +1 -1
  59. package/esm/form-collapse/index.mjs +43 -42
  60. package/esm/form-collapse/index.mjs.map +1 -1
  61. package/esm/form-collapse/utils.mjs.map +1 -1
  62. package/esm/form-dialog/index.d.ts +1 -1
  63. package/esm/form-dialog/index.mjs +22 -22
  64. package/esm/form-dialog/index.mjs.map +1 -1
  65. package/esm/form-dialog/types.d.ts +6 -6
  66. package/esm/form-drawer/index.d.ts +1 -1
  67. package/esm/form-drawer/index.mjs +21 -21
  68. package/esm/form-drawer/index.mjs.map +1 -1
  69. package/esm/form-drawer/types.d.ts +6 -6
  70. package/esm/form-grid/hooks.mjs.map +1 -1
  71. package/esm/form-grid/index.d.ts +1 -183
  72. package/esm/form-grid/index.mjs +23 -20
  73. package/esm/form-grid/index.mjs.map +1 -1
  74. package/esm/form-item/form-item.d.ts +2 -1
  75. package/esm/form-item/index.d.ts +12 -6
  76. package/esm/form-item/index.mjs +157 -151
  77. package/esm/form-item/index.mjs.map +1 -1
  78. package/esm/form-item/types.d.ts +0 -1
  79. package/esm/form-item/utils.mjs.map +1 -1
  80. package/esm/form-layout/form-layout.d.ts +0 -1
  81. package/esm/form-layout/form-layout.mjs +56 -51
  82. package/esm/form-layout/form-layout.mjs.map +1 -1
  83. package/esm/form-layout/types.d.ts +0 -2
  84. package/esm/form-layout/utils.d.ts +3 -3
  85. package/esm/form-layout/utils.mjs +55 -45
  86. package/esm/form-layout/utils.mjs.map +1 -1
  87. package/esm/form-step/index.mjs +38 -34
  88. package/esm/form-step/index.mjs.map +1 -1
  89. package/esm/form-step/utils.mjs.map +1 -1
  90. package/esm/form-tab/hooks.mjs.map +1 -1
  91. package/esm/form-tab/index.d.ts +1 -26
  92. package/esm/form-tab/index.mjs +36 -35
  93. package/esm/form-tab/index.mjs.map +1 -1
  94. package/esm/form-tab/utils.mjs.map +1 -1
  95. package/esm/index.mjs +58 -58
  96. package/esm/input/index.mjs +23 -20
  97. package/esm/input/index.mjs.map +1 -1
  98. package/esm/input-number/index.d.ts +258 -147
  99. package/esm/input-number/index.mjs +9 -7
  100. package/esm/input-number/index.mjs.map +1 -1
  101. package/esm/pagination/components/jumper.mjs.map +1 -1
  102. package/esm/pagination/components/next.mjs.map +1 -1
  103. package/esm/pagination/components/pager.mjs.map +1 -1
  104. package/esm/pagination/components/prev.mjs.map +1 -1
  105. package/esm/pagination/components/total.mjs.map +1 -1
  106. package/esm/pagination/pagination.mjs +109 -110
  107. package/esm/pagination/pagination.mjs.map +1 -1
  108. package/esm/password/index.mjs.map +1 -1
  109. package/esm/preview-text/index.mjs +35 -32
  110. package/esm/preview-text/index.mjs.map +1 -1
  111. package/esm/preview-text/utils.mjs.map +1 -1
  112. package/esm/radio/index.d.ts +344 -194
  113. package/esm/radio/index.mjs +28 -25
  114. package/esm/radio/index.mjs.map +1 -1
  115. package/esm/reset/index.d.ts +1 -62
  116. package/esm/reset/index.mjs +1 -1
  117. package/esm/reset/index.mjs.map +1 -1
  118. package/esm/select/index.mjs +23 -20
  119. package/esm/select/index.mjs.map +1 -1
  120. package/esm/select-table/index.d.ts +28 -0
  121. package/esm/select-table/index.mjs +59 -55
  122. package/esm/select-table/index.mjs.map +1 -1
  123. package/esm/select-table/select-table.d.ts +56 -0
  124. package/esm/submit/index.d.ts +1 -47
  125. package/esm/submit/index.mjs +1 -1
  126. package/esm/submit/index.mjs.map +1 -1
  127. package/esm/switch/index.d.ts +225 -189
  128. package/esm/switch/index.mjs.map +1 -1
  129. package/esm/time-picker/index.mjs +8 -6
  130. package/esm/time-picker/index.mjs.map +1 -1
  131. package/esm/time-select/index.d.ts +163 -103
  132. package/esm/time-select/index.mjs +8 -6
  133. package/esm/time-select/index.mjs.map +1 -1
  134. package/esm/transfer/index.d.ts +196 -115
  135. package/esm/transfer/index.mjs.map +1 -1
  136. package/esm/tree/index.mjs +43 -40
  137. package/esm/tree/index.mjs.map +1 -1
  138. package/esm/tree/utils.mjs.map +1 -1
  139. package/esm/tree-select/index.mjs +20 -17
  140. package/esm/tree-select/index.mjs.map +1 -1
  141. package/esm/upload/index.d.ts +404 -399
  142. package/esm/upload/index.mjs +9 -7
  143. package/esm/upload/index.mjs.map +1 -1
  144. package/esm/upload/upload.d.ts +800 -790
  145. package/esm/vendor/icon.mjs.map +1 -1
  146. package/esm/vendor/lodash.mjs +12 -20
  147. package/esm/vendor/lodash.mjs.map +1 -1
  148. package/esm/vendor/runtime.mjs +29 -24
  149. package/esm/vendor/runtime.mjs.map +1 -1
  150. package/esm/vendor/shared.esm-bundler.mjs +2 -2
  151. package/esm/vendor/sizes.mjs.map +1 -1
  152. package/esm/vendor/types.mjs +5 -5
  153. package/esm/vendor/types.mjs.map +1 -1
  154. package/package.json +113 -114
@@ -16,7 +16,6 @@ declare const __VLS_component: import('vue').DefineComponent<IFormLayoutProps, {
16
16
  layout: "vertical" | "horizontal" | "inline" | ("vertical" | "horizontal" | "inline")[];
17
17
  colon: boolean;
18
18
  labelWrap: boolean;
19
- wrapperWrap: boolean;
20
19
  fullness: boolean;
21
20
  shallow: boolean;
22
21
  statusIcon: boolean;
@@ -1,80 +1,85 @@
1
- import { defineComponent as w, ref as l, provide as s, watch as k, createBlock as C, openBlock as v, resolveDynamicComponent as A, mergeProps as B, unref as a, withModifiers as P, withCtx as b, renderSlot as x } from "vue";
2
- import { isValid as f, isEmpty as F } from "@formily/shared";
3
- import { useForm as R } from "@silver-formily/vue";
4
- import { formContextKey as _ } from "element-plus";
5
- import { useFormDeepLayout as g, useResponsiveFormLayout as q, filterValidFormLayoutProps as o, formLayoutDeepContext as z, formLayoutShallowContext as D } from "./utils.mjs";
1
+ import { defineComponent as A, ref as l, computed as d, provide as e, watch as x, reactive as B, toRef as t, createBlock as P, openBlock as g, resolveDynamicComponent as I, mergeProps as b, unref as F, withModifiers as R, withCtx as _, renderSlot as q } from "vue";
2
+ import { isValid as z, isEmpty as D } from "@formily/shared";
3
+ import { useId as T, formContextKey as M } from "element-plus";
4
+ import { stylePrefix as S } from "../__builtins__/configs/index.mjs";
6
5
  import { useThrottleFn as W } from "../__builtins__/shared/hooks.mjs";
7
- import { useCleanAttrs as I } from "../__builtins__/shared/utils.mjs";
8
- import { stylePrefix as M } from "../__builtins__/configs/index.mjs";
9
- const G = /* @__PURE__ */ w({
6
+ import "@formily/reactive";
7
+ import "@formily/core";
8
+ import "@silver-formily/reactive-vue";
9
+ import "@silver-formily/vue";
10
+ import { useCleanAttrs as $ } from "../__builtins__/shared/utils.mjs";
11
+ import { formLayoutIdContext as H, useFormDeepLayout as V, useResponsiveFormLayout as E, filterValidFormLayoutProps as r, formLayoutDeepContext as K, formLayoutShallowContext as j } from "./utils.mjs";
12
+ const to = /* @__PURE__ */ A({
10
13
  name: "FFormLayout",
11
14
  inheritAttrs: !1,
12
15
  __name: "form-layout",
13
16
  props: {
14
17
  tag: { default: "form" },
15
- colon: { type: Boolean, default: !0 },
16
- labelAlign: null,
17
- wrapperAlign: null,
18
- labelWrap: { type: Boolean, default: !0 },
19
- labelWidth: null,
20
- wrapperWidth: null,
21
- wrapperWrap: { type: Boolean, default: !1 },
22
- labelCol: null,
23
- wrapperCol: null,
24
- fullness: { type: Boolean, default: !1 },
18
+ colon: { type: Boolean, default: void 0 },
19
+ labelAlign: {},
20
+ wrapperAlign: {},
21
+ labelWrap: { type: Boolean, default: void 0 },
22
+ labelWidth: {},
23
+ wrapperWidth: {},
24
+ labelCol: {},
25
+ wrapperCol: {},
26
+ fullness: { type: Boolean, default: void 0 },
25
27
  size: { default: "default" },
26
28
  layout: { default: "horizontal" },
27
- feedbackLayout: null,
28
- tooltipLayout: null,
29
- breakpoints: null,
29
+ feedbackLayout: {},
30
+ tooltipLayout: {},
31
+ breakpoints: {},
30
32
  shallow: { type: Boolean, default: !0 },
31
33
  hideRequiredAsterisk: { type: Boolean },
32
34
  statusIcon: { type: Boolean, default: !0 },
33
- requireAsteriskPosition: null
35
+ requireAsteriskPosition: {}
34
36
  },
35
- setup(m) {
36
- const e = m, d = `${M}-form`, { props: y } = I(), i = l(), c = g(), { props: t } = q(e, i), h = l({
37
- ...c.value,
38
- ...e.shallow ? {
39
- ...f(e.size) && { size: e.size },
40
- ...f(e.colon) && { colon: e.colon }
41
- } : o(e)
37
+ setup(c) {
38
+ const o = c, y = `${S}-form`, { props: s } = $(), n = l(), u = o.tag === "form", v = T(), p = d(() => s.value.id ?? `formily-${v.value}`), L = d(() => u ? p.value : s.value.id);
39
+ u && e(H, p);
40
+ const h = V(), { props: a } = E(o, n), C = l({
41
+ ...h.value,
42
+ ...o.shallow ? {
43
+ size: o.size,
44
+ ...z(o.colon) && { colon: o.colon }
45
+ } : r(o)
42
46
  });
43
- s(z, h);
44
- const n = l(e.shallow ? o(e) : {});
45
- s(D, n);
46
- const L = W(() => {
47
- if (!F(t.value)) {
48
- const r = o(t.value);
49
- n.value = o({ ...e, ...r });
47
+ e(K, C);
48
+ const f = l(o.shallow ? r(o) : {});
49
+ e(j, f);
50
+ const k = W(() => {
51
+ if (!D(a.value)) {
52
+ const i = r(a.value);
53
+ f.value = r({ ...o, ...i });
50
54
  }
51
55
  }, 200, !0);
52
- k(() => [e, t], L, {
56
+ x(() => [o, a], k, {
53
57
  deep: !0,
54
58
  immediate: !0
55
- }), s(_, {
56
- statusIcon: e.statusIcon,
57
- hideRequiredAsterisk: e.hideRequiredAsterisk,
58
- requireAsteriskPosition: e.requireAsteriskPosition
59
59
  });
60
- const u = R();
61
- return (r, p) => (v(), C(A(e.tag), B({
62
- id: a(u)?.id && `formily-${a(u)?.id}`,
60
+ const w = B({
61
+ size: t(o, "size"),
62
+ statusIcon: t(o, "statusIcon"),
63
+ hideRequiredAsterisk: t(o, "hideRequiredAsterisk"),
64
+ requireAsteriskPosition: t(o, "requireAsteriskPosition")
65
+ });
66
+ return e(M, w), (i, m) => (g(), P(I(o.tag), b({
67
+ id: L.value,
63
68
  ref_key: "rootHTMLRef",
64
- ref: i,
65
- class: d
66
- }, a(y), {
67
- onSubmit: p[0] || (p[0] = P(() => {
69
+ ref: n,
70
+ class: y
71
+ }, F(s), {
72
+ onSubmit: m[0] || (m[0] = R(() => {
68
73
  }, ["prevent", "stop"]))
69
74
  }), {
70
- default: b(() => [
71
- x(r.$slots, "default")
75
+ default: _(() => [
76
+ q(i.$slots, "default")
72
77
  ]),
73
78
  _: 3
74
79
  }, 16, ["id"]));
75
80
  }
76
81
  });
77
82
  export {
78
- G as _
83
+ to as _
79
84
  };
80
85
  //# sourceMappingURL=form-layout.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-layout.mjs","sources":["../../src/form-layout/form-layout.vue"],"sourcesContent":["<script lang=\"ts\" setup>\r\nimport type { FormContext } from 'element-plus'\r\nimport type { IFormLayoutProps } from './types'\r\nimport { isEmpty, isValid } from '@formily/shared'\r\nimport { useForm } from '@silver-formily/vue'\r\nimport { formContextKey } from 'element-plus'\r\nimport { provide, ref, watch } from 'vue'\r\nimport { stylePrefix, useCleanAttrs, useThrottleFn } from '../__builtins__'\r\nimport { filterValidFormLayoutProps, formLayoutDeepContext, formLayoutShallowContext, useFormDeepLayout, useResponsiveFormLayout } from './utils'\r\n\r\ndefineOptions({\r\n name: 'FFormLayout',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps({\n tag: { default: 'form' },\n colon: { type: Boolean, default: true },\n labelAlign: null,\n wrapperAlign: null,\n labelWrap: { type: Boolean, default: true },\n labelWidth: null,\n wrapperWidth: null,\n wrapperWrap: { type: Boolean, default: false },\n labelCol: null,\n wrapperCol: null,\n fullness: { type: Boolean, default: false },\n size: { default: 'default' },\n layout: { default: 'horizontal' },\n feedbackLayout: null,\n tooltipLayout: null,\n breakpoints: null,\n shallow: { type: Boolean, default: true },\n hideRequiredAsterisk: { type: Boolean },\n statusIcon: { type: Boolean, default: true },\n requireAsteriskPosition: null\n})\r\nconst formPrefixCls = `${stylePrefix}-form`\r\nconst { props: attrs } = useCleanAttrs()\r\nconst rootHTMLRef = ref<HTMLElement>()\r\n\r\nconst formLayoutDeepConfig = useFormDeepLayout()\r\nconst { props: responsiveProps } = useResponsiveFormLayout(props, rootHTMLRef)\r\n\r\nconst deepLayout = ref({\r\n ...formLayoutDeepConfig.value,\r\n ...(props.shallow\r\n ? {\r\n ...(isValid(props.size) && { size: props.size }),\r\n ...(isValid(props.colon) && { colon: props.colon }),\r\n }\r\n : filterValidFormLayoutProps(props)),\r\n})\r\nprovide(formLayoutDeepContext, deepLayout)\r\n\r\nconst shallowLayout = ref(props.shallow ? filterValidFormLayoutProps(props) : {})\r\nprovide(formLayoutShallowContext, shallowLayout)\r\n\r\nconst updateLayout = useThrottleFn(() => {\r\n if (!isEmpty(responsiveProps.value)) {\r\n const _responsiveProps = filterValidFormLayoutProps(responsiveProps.value)\r\n shallowLayout.value = filterValidFormLayoutProps({ ...props, ..._responsiveProps })\r\n }\r\n}, 200, true)\r\n\r\nwatch(() => [props, responsiveProps], updateLayout, {\r\n deep: true,\r\n immediate: true,\r\n})\r\n\r\nprovide(formContextKey, {\r\n statusIcon: props.statusIcon,\r\n hideRequiredAsterisk: props.hideRequiredAsterisk,\r\n requireAsteriskPosition: props.requireAsteriskPosition,\r\n} as FormContext)\r\n\r\nconst formRef = useForm()\r\n</script>\r\n\r\n<template>\r\n <component\r\n :is=\"props.tag\"\r\n :id=\"formRef?.id && `formily-${formRef?.id}`\"\r\n ref=\"rootHTMLRef\"\r\n :class=\"formPrefixCls\"\r\n v-bind=\"attrs\"\r\n @submit.prevent.stop\r\n >\r\n <slot />\r\n </component>\r\n</template>\r\n"],"names":["props","__props","formPrefixCls","stylePrefix","attrs","useCleanAttrs","rootHTMLRef","ref","formLayoutDeepConfig","useFormDeepLayout","responsiveProps","useResponsiveFormLayout","deepLayout","isValid","filterValidFormLayoutProps","provide","formLayoutDeepContext","shallowLayout","formLayoutShallowContext","updateLayout","useThrottleFn","isEmpty","_responsiveProps","watch","formContextKey","formRef","useForm","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_unref","_renderSlot","_ctx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,UAAMA,IAAQC,GAsBRC,IAAgB,GAAGC,CAAW,SAC9B,EAAE,OAAOC,EAAA,IAAUC,EAAA,GACnBC,IAAcC,EAAA,GAEdC,IAAuBC,EAAA,GACvB,EAAE,OAAOC,EAAA,IAAoBC,EAAwBX,GAAOM,CAAW,GAEvEM,IAAaL,EAAI;AAAA,MACrB,GAAGC,EAAqB;AAAA,MACxB,GAAIR,EAAM,UACN;AAAA,QACE,GAAIa,EAAQb,EAAM,IAAI,KAAK,EAAE,MAAMA,EAAM,KAAA;AAAA,QACzC,GAAIa,EAAQb,EAAM,KAAK,KAAK,EAAE,OAAOA,EAAM,MAAA;AAAA,MAAM,IAEnDc,EAA2Bd,CAAK;AAAA,IAAA,CACrC;AACD,IAAAe,EAAQC,GAAuBJ,CAAU;AAEzC,UAAMK,IAAgBV,EAAIP,EAAM,UAAUc,EAA2Bd,CAAK,IAAI,EAAE;AAChF,IAAAe,EAAQG,GAA0BD,CAAa;AAE/C,UAAME,IAAeC,EAAc,MAAM;AACvC,UAAI,CAACC,EAAQX,EAAgB,KAAK,GAAG;AACnC,cAAMY,IAAmBR,EAA2BJ,EAAgB,KAAK;AACzE,QAAAO,EAAc,QAAQH,EAA2B,EAAE,GAAGd,GAAO,GAAGsB,GAAkB;AAAA,MACpF;AAAA,IACF,GAAG,KAAK,EAAI;AAEZ,IAAAC,EAAM,MAAM,CAACvB,GAAOU,CAAe,GAAGS,GAAc;AAAA,MAClD,MAAM;AAAA,MACN,WAAW;AAAA,IAAA,CACZ,GAEDJ,EAAQS,GAAgB;AAAA,MACtB,YAAYxB,EAAM;AAAA,MAClB,sBAAsBA,EAAM;AAAA,MAC5B,yBAAyBA,EAAM;AAAA,IAAA,CACjB;AAEhB,UAAMyB,IAAUC,EAAA;sBAIdC,KAAAC,EASYC,EARL7B,EAAM,GAAG,GADhB8B,EASY;AAAA,MAPT,IAAIC,EAAAN,CAAA,GAAS,MAAE,WAAeM,EAAAN,CAAA,GAAS,EAAE;AAAA,eACtC;AAAA,MAAJ,KAAInB;AAAA,MACH,OAAOJ;AAAA,IAAA,GACA6B,EAAA3B,CAAA,GAAK;AAAA,MACZ,4BAAD,MAAA;AAAA,MAAA,GAAoB,CAAA,WAAA,MAAA,CAAA;AAAA,IAAA;iBAEpB,MAAQ;AAAA,QAAR4B,EAAQC,EAAA,QAAA,SAAA;AAAA,MAAA;;;;;"}
1
+ {"version":3,"file":"form-layout.mjs","sources":["../../src/form-layout/form-layout.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { FormContext } from 'element-plus'\nimport type { IFormLayoutProps } from './types'\nimport { isEmpty, isValid } from '@formily/shared'\nimport { formContextKey, useId } from 'element-plus'\nimport { computed, provide, reactive, ref, toRef, watch } from 'vue'\nimport { stylePrefix, useCleanAttrs, useThrottleFn } from '../__builtins__'\nimport { filterValidFormLayoutProps, formLayoutDeepContext, formLayoutIdContext, formLayoutShallowContext, useFormDeepLayout, useResponsiveFormLayout } from './utils'\n\ndefineOptions({\n name: 'FFormLayout',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<IFormLayoutProps>(), {\n tag: 'form',\n colon: undefined,\n labelWrap: undefined,\n fullness: undefined,\n size: 'default',\n layout: 'horizontal',\n shallow: true,\n statusIcon: true,\n asterisk: undefined,\n})\nconst formPrefixCls = `${stylePrefix}-form`\nconst { props: attrs } = useCleanAttrs()\nconst rootHTMLRef = ref<HTMLElement>()\nconst isFormTag = props.tag === 'form'\nconst formLayoutBaseId = useId()\nconst formLayoutId = computed(() => attrs.value.id ?? `formily-${formLayoutBaseId.value}`)\nconst formLayoutDomId = computed(() => (isFormTag ? formLayoutId.value : attrs.value.id))\nif (isFormTag) {\n provide(formLayoutIdContext, formLayoutId)\n}\n\nconst formLayoutDeepConfig = useFormDeepLayout()\nconst { props: responsiveProps } = useResponsiveFormLayout(props, rootHTMLRef)\n\nconst deepLayout = ref({\n ...formLayoutDeepConfig.value,\n ...(props.shallow\n ? {\n size: props.size,\n ...(isValid(props.colon) && { colon: props.colon }),\n }\n : filterValidFormLayoutProps(props)),\n})\nprovide(formLayoutDeepContext, deepLayout)\n\nconst shallowLayout = ref(props.shallow ? filterValidFormLayoutProps(props) : {})\nprovide(formLayoutShallowContext, shallowLayout)\n\nconst updateLayout = useThrottleFn(() => {\n if (!isEmpty(responsiveProps.value)) {\n const _responsiveProps = filterValidFormLayoutProps(responsiveProps.value)\n shallowLayout.value = filterValidFormLayoutProps({ ...props, ..._responsiveProps })\n }\n}, 200, true)\n\nwatch(() => [props, responsiveProps], updateLayout, {\n deep: true,\n immediate: true,\n})\n\nconst formContext = reactive({\n size: toRef(props, 'size'),\n statusIcon: toRef(props, 'statusIcon'),\n hideRequiredAsterisk: toRef(props, 'hideRequiredAsterisk'),\n requireAsteriskPosition: toRef(props, 'requireAsteriskPosition'),\n})\nprovide(formContextKey, formContext as FormContext)\n</script>\n\n<template>\n <component\n :is=\"props.tag\"\n :id=\"formLayoutDomId\"\n ref=\"rootHTMLRef\"\n :class=\"formPrefixCls\"\n v-bind=\"attrs\"\n @submit.prevent.stop\n >\n <slot />\n </component>\n</template>\n"],"names":["props","__props","formPrefixCls","stylePrefix","attrs","useCleanAttrs","rootHTMLRef","ref","isFormTag","formLayoutBaseId","useId","formLayoutId","computed","formLayoutDomId","provide","formLayoutIdContext","formLayoutDeepConfig","useFormDeepLayout","responsiveProps","useResponsiveFormLayout","deepLayout","isValid","filterValidFormLayoutProps","formLayoutDeepContext","shallowLayout","formLayoutShallowContext","updateLayout","useThrottleFn","isEmpty","_responsiveProps","watch","formContext","reactive","toRef","formContextKey","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_unref","_renderSlot","_ctx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,UAAMA,IAAQC,GAWRC,IAAgB,GAAGC,CAAW,SAC9B,EAAE,OAAOC,EAAA,IAAUC,EAAA,GACnBC,IAAcC,EAAA,GACdC,IAAYR,EAAM,QAAQ,QAC1BS,IAAmBC,EAAA,GACnBC,IAAeC,EAAS,MAAMR,EAAM,MAAM,MAAM,WAAWK,EAAiB,KAAK,EAAE,GACnFI,IAAkBD,EAAS,MAAOJ,IAAYG,EAAa,QAAQP,EAAM,MAAM,EAAG;AACxF,IAAII,KACFM,EAAQC,GAAqBJ,CAAY;AAG3C,UAAMK,IAAuBC,EAAA,GACvB,EAAE,OAAOC,EAAA,IAAoBC,EAAwBnB,GAAOM,CAAW,GAEvEc,IAAab,EAAI;AAAA,MACrB,GAAGS,EAAqB;AAAA,MACxB,GAAIhB,EAAM,UACN;AAAA,QACE,MAAMA,EAAM;AAAA,QACZ,GAAIqB,EAAQrB,EAAM,KAAK,KAAK,EAAE,OAAOA,EAAM,MAAA;AAAA,MAAM,IAEnDsB,EAA2BtB,CAAK;AAAA,IAAA,CACrC;AACD,IAAAc,EAAQS,GAAuBH,CAAU;AAEzC,UAAMI,IAAgBjB,EAAIP,EAAM,UAAUsB,EAA2BtB,CAAK,IAAI,EAAE;AAChF,IAAAc,EAAQW,GAA0BD,CAAa;AAE/C,UAAME,IAAeC,EAAc,MAAM;AACvC,UAAI,CAACC,EAAQV,EAAgB,KAAK,GAAG;AACnC,cAAMW,IAAmBP,EAA2BJ,EAAgB,KAAK;AACzE,QAAAM,EAAc,QAAQF,EAA2B,EAAE,GAAGtB,GAAO,GAAG6B,GAAkB;AAAA,MACpF;AAAA,IACF,GAAG,KAAK,EAAI;AAEZ,IAAAC,EAAM,MAAM,CAAC9B,GAAOkB,CAAe,GAAGQ,GAAc;AAAA,MAClD,MAAM;AAAA,MACN,WAAW;AAAA,IAAA,CACZ;AAED,UAAMK,IAAcC,EAAS;AAAA,MAC3B,MAAMC,EAAMjC,GAAO,MAAM;AAAA,MACzB,YAAYiC,EAAMjC,GAAO,YAAY;AAAA,MACrC,sBAAsBiC,EAAMjC,GAAO,sBAAsB;AAAA,MACzD,yBAAyBiC,EAAMjC,GAAO,yBAAyB;AAAA,IAAA,CAChE;AACD,WAAAc,EAAQoB,GAAgBH,CAA0B,cAIhDI,KAAAC,EASYC,EARLrC,EAAM,GAAG,GADhBsC,EASY;AAAA,MAPT,IAAIzB,EAAA;AAAA,eACD;AAAA,MAAJ,KAAIP;AAAA,MACH,OAAOJ;AAAA,IAAA,GACAqC,EAAAnC,CAAA,GAAK;AAAA,MACZ,4BAAD,MAAA;AAAA,MAAA,GAAoB,CAAA,WAAA,MAAA,CAAA;AAAA,IAAA;iBAEpB,MAAQ;AAAA,QAARoC,EAAQC,EAAA,QAAA,SAAA;AAAA,MAAA;;;;;"}
@@ -6,7 +6,6 @@ export interface IFormLayoutProps {
6
6
  labelWrap?: boolean;
7
7
  labelWidth?: number;
8
8
  wrapperWidth?: number;
9
- wrapperWrap?: boolean;
10
9
  labelCol?: number | number[];
11
10
  wrapperCol?: number | number[];
12
11
  fullness?: boolean;
@@ -27,7 +26,6 @@ export interface ICalculatedFormLayoutProps {
27
26
  labelWrap?: boolean;
28
27
  labelWidth?: number | string;
29
28
  wrapperWidth?: number | string;
30
- wrapperWrap?: boolean;
31
29
  labelCol?: number;
32
30
  wrapperCol?: number;
33
31
  fullness?: boolean;
@@ -1,4 +1,4 @@
1
- import { InjectionKey, Ref } from 'vue';
1
+ import { ComputedRef, InjectionKey, Ref } from 'vue';
2
2
  import { IFormLayoutProps } from './types';
3
3
  export declare function calcBreakpointIndex(breakpoints: number[], width: number): number;
4
4
  export declare function calcFactor<T>(value: T | readonly T[], breakpointIndex: number): T;
@@ -13,7 +13,6 @@ export declare function useResponsiveFormLayout(props: IFormLayoutProps, root: R
13
13
  labelWrap?: boolean;
14
14
  labelWidth?: number;
15
15
  wrapperWidth?: number;
16
- wrapperWrap?: boolean;
17
16
  labelCol?: number | number[];
18
17
  wrapperCol?: number | number[];
19
18
  fullness?: boolean;
@@ -34,7 +33,6 @@ export declare function useResponsiveFormLayout(props: IFormLayoutProps, root: R
34
33
  labelWrap?: boolean;
35
34
  labelWidth?: number;
36
35
  wrapperWidth?: number;
37
- wrapperWrap?: boolean;
38
36
  labelCol?: number | number[];
39
37
  wrapperCol?: number | number[];
40
38
  fullness?: boolean;
@@ -51,7 +49,9 @@ export declare function useResponsiveFormLayout(props: IFormLayoutProps, root: R
51
49
  };
52
50
  export declare const formLayoutDeepContext: InjectionKey<Ref<IFormLayoutProps>>;
53
51
  export declare const formLayoutShallowContext: InjectionKey<Ref<IFormLayoutProps>>;
52
+ export declare const formLayoutIdContext: InjectionKey<ComputedRef<string>>;
54
53
  export declare function useFormDeepLayout(): Ref<IFormLayoutProps>;
55
54
  export declare function useFormLayout(): Ref<IFormLayoutProps>;
55
+ export declare function useFormLayoutId(): ComputedRef<string>;
56
56
  export declare const FORM_LAYOUT_PROPS_KEYS: ReadonlyArray<keyof IFormLayoutProps>;
57
57
  export declare function filterValidFormLayoutProps(props: IFormLayoutProps): IFormLayoutProps;
@@ -1,77 +1,84 @@
1
- import { isArr as L, isValid as u } from "@formily/shared";
2
- import { inject as i, ref as l, computed as d } from "vue";
1
+ import { isArr as d, isValid as u } from "@formily/shared";
2
+ import { inject as l, ref as i, computed as s } from "vue";
3
3
  import { useResizeObserver as h } from "../__builtins__/shared/hooks.mjs";
4
- function w(t, o) {
4
+ import "element-plus";
5
+ import "@formily/reactive";
6
+ import "@formily/core";
7
+ import "@silver-formily/reactive-vue";
8
+ import "@silver-formily/vue";
9
+ function A(t, o) {
5
10
  for (const [r, e] of t.entries())
6
11
  if (o <= e)
7
12
  return r;
8
13
  return -1;
9
14
  }
10
- function A(t, o) {
15
+ function C(t, o) {
11
16
  if (!Array.isArray(t) || t.length === 0)
12
17
  return t;
13
18
  const r = Math.max(-1, Math.min(o, t.length - 1));
14
19
  return t.at(r);
15
20
  }
16
21
  function a(t, o) {
17
- return u(t) ? A(t, o) : t;
22
+ return u(t) ? C(t, o) : t;
18
23
  }
19
- function C(t, o) {
24
+ function x(t, o) {
20
25
  const { clientWidth: r } = t, {
21
26
  breakpoints: e,
22
- layout: p,
23
- labelAlign: c,
24
- wrapperAlign: f,
25
- labelCol: m,
26
- wrapperCol: y,
27
- ...b
28
- } = o, n = w(
27
+ layout: c,
28
+ labelAlign: f,
29
+ wrapperAlign: m,
30
+ labelCol: y,
31
+ wrapperCol: b,
32
+ ...L
33
+ } = o, n = A(
29
34
  e,
30
35
  r
31
36
  );
32
37
  return {
33
- layout: a(p, n),
34
- labelAlign: a(c, n),
35
- wrapperAlign: a(f, n),
36
- labelCol: a(m, n),
37
- wrapperCol: a(y, n),
38
- ...b
38
+ layout: a(c, n),
39
+ labelAlign: a(f, n),
40
+ wrapperAlign: a(m, n),
41
+ labelCol: a(y, n),
42
+ wrapperCol: a(b, n),
43
+ ...L
39
44
  };
40
45
  }
41
- function O(t, o) {
46
+ function _(t, o) {
42
47
  const { breakpoints: r } = t;
43
- if (!L(r))
48
+ if (!d(r))
44
49
  return {
45
- props: l(t)
50
+ props: i(t)
46
51
  };
47
- const e = l({});
52
+ const e = i({});
48
53
  return h(o, () => {
49
- e.value = C(o.value, t);
54
+ e.value = x(o.value, t);
50
55
  }), {
51
56
  props: e
52
57
  };
53
58
  }
54
- const s = Symbol(
59
+ const p = Symbol(
55
60
  "formLayoutDeepContext"
56
- ), x = Symbol("formLayoutShallowContext");
57
- function P() {
58
- return i(s, l({}));
61
+ ), w = Symbol("formLayoutShallowContext"), k = Symbol("formLayoutIdContext");
62
+ function j() {
63
+ return l(p, i({}));
59
64
  }
60
- function S() {
61
- const t = i(x, l({})), o = i(s, l({}));
62
- return d(() => ({
65
+ function D() {
66
+ const t = l(w, i({})), o = l(p, i({}));
67
+ return s(() => ({
63
68
  ...o.value,
64
69
  ...t.value
65
70
  }));
66
71
  }
67
- const R = [
72
+ function M() {
73
+ return l(k, s(() => ""));
74
+ }
75
+ const q = [
68
76
  "colon",
69
77
  "labelAlign",
70
78
  "wrapperAlign",
71
79
  "labelWrap",
72
80
  "labelWidth",
73
81
  "wrapperWidth",
74
- "wrapperWrap",
75
82
  "labelCol",
76
83
  "wrapperCol",
77
84
  "fullness",
@@ -81,24 +88,27 @@ const R = [
81
88
  "tooltipLayout",
82
89
  "breakpoints",
83
90
  "hideRequiredAsterisk",
84
- "statusIcon"
91
+ "statusIcon",
92
+ "requireAsteriskPosition"
85
93
  ];
86
- function W(t) {
94
+ function z(t) {
87
95
  return Object.fromEntries(
88
96
  Object.entries(t).filter(([o, r]) => u(r))
89
97
  );
90
98
  }
91
99
  export {
92
- R as FORM_LAYOUT_PROPS_KEYS,
93
- w as calcBreakpointIndex,
94
- A as calcFactor,
95
- C as calculateProps,
100
+ q as FORM_LAYOUT_PROPS_KEYS,
101
+ A as calcBreakpointIndex,
102
+ C as calcFactor,
103
+ x as calculateProps,
96
104
  a as factor,
97
- W as filterValidFormLayoutProps,
98
- s as formLayoutDeepContext,
99
- x as formLayoutShallowContext,
100
- P as useFormDeepLayout,
101
- S as useFormLayout,
102
- O as useResponsiveFormLayout
105
+ z as filterValidFormLayoutProps,
106
+ p as formLayoutDeepContext,
107
+ k as formLayoutIdContext,
108
+ w as formLayoutShallowContext,
109
+ j as useFormDeepLayout,
110
+ D as useFormLayout,
111
+ M as useFormLayoutId,
112
+ _ as useResponsiveFormLayout
103
113
  };
104
114
  //# sourceMappingURL=utils.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","sources":["../../src/form-layout/utils.ts"],"sourcesContent":["import type { InjectionKey, Ref } from 'vue'\r\nimport type { IFormLayoutProps } from './types'\r\nimport { isArr, isValid } from '@formily/shared'\r\nimport { computed, inject, ref } from 'vue'\r\nimport { useResizeObserver } from '../__builtins__'\r\n\r\nexport function calcBreakpointIndex(breakpoints: number[], width: number): number {\r\n for (const [i, breakpoint] of breakpoints.entries()) {\r\n if (width <= breakpoint) {\r\n return i\r\n }\r\n }\r\n return -1\r\n}\r\n\r\nexport function calcFactor<T>(value: T | readonly T[], breakpointIndex: number): T {\r\n if (!Array.isArray(value) || value.length === 0) {\r\n return value as T\r\n }\r\n const safeIndex = Math.max(-1, Math.min(breakpointIndex, value.length - 1))\r\n return value.at(safeIndex)\r\n}\r\n\r\nexport function factor<T>(value: T | T[], breakpointIndex: number): T {\r\n return isValid(value) ? calcFactor<T>(value, breakpointIndex) : value as T\r\n}\r\n\r\nexport function calculateProps(target: Element, props: IFormLayoutProps): IFormLayoutProps {\r\n const { clientWidth } = target\r\n const {\r\n breakpoints,\r\n layout,\r\n labelAlign,\r\n wrapperAlign,\r\n labelCol,\r\n wrapperCol,\r\n ...otherProps\r\n } = props\r\n const breakpointIndex = calcBreakpointIndex(\r\n breakpoints as number[],\r\n clientWidth,\r\n )\r\n\r\n return {\r\n layout: factor(layout, breakpointIndex),\r\n labelAlign: factor(labelAlign, breakpointIndex),\r\n wrapperAlign: factor(wrapperAlign, breakpointIndex),\r\n labelCol: factor(labelCol, breakpointIndex),\r\n wrapperCol: factor(wrapperCol, breakpointIndex),\r\n ...otherProps,\r\n }\r\n}\r\n\r\nexport function useResponsiveFormLayout(props: IFormLayoutProps, root: Ref<HTMLElement | null>) {\r\n const { breakpoints } = props\r\n if (!isArr(breakpoints)) {\r\n return {\r\n props: ref(props),\r\n }\r\n }\r\n\r\n const layoutProps = ref<IFormLayoutProps>({})\r\n\r\n useResizeObserver(root, () => {\r\n layoutProps.value = calculateProps(root.value, props)\r\n })\r\n\r\n return {\r\n props: layoutProps,\r\n }\r\n}\r\n\r\nexport const formLayoutDeepContext: InjectionKey<Ref<IFormLayoutProps>> = Symbol(\r\n 'formLayoutDeepContext',\r\n)\r\n\r\nexport const formLayoutShallowContext: InjectionKey<Ref<IFormLayoutProps>>\r\n = Symbol('formLayoutShallowContext')\r\n\r\nexport function useFormDeepLayout(): Ref<IFormLayoutProps> {\r\n return inject(formLayoutDeepContext, ref({}))\r\n}\r\n\r\nexport function useFormLayout(): Ref<IFormLayoutProps> {\r\n const shallowLayout = inject(formLayoutShallowContext, ref({}))\r\n const deepLayout = inject(formLayoutDeepContext, ref({}))\r\n\r\n const formLayout = computed(() => {\r\n return {\r\n ...deepLayout.value,\r\n ...shallowLayout.value,\r\n }\r\n })\r\n\r\n return formLayout\r\n}\r\n\r\nexport const FORM_LAYOUT_PROPS_KEYS: ReadonlyArray<keyof IFormLayoutProps> = [\r\n 'colon',\r\n 'labelAlign',\r\n 'wrapperAlign',\r\n 'labelWrap',\r\n 'labelWidth',\r\n 'wrapperWidth',\r\n 'wrapperWrap',\r\n 'labelCol',\r\n 'wrapperCol',\r\n 'fullness',\r\n 'size',\r\n 'layout',\r\n 'feedbackLayout',\r\n 'tooltipLayout',\r\n 'breakpoints',\r\n 'hideRequiredAsterisk',\r\n 'statusIcon',\r\n] as const\r\n\r\nexport function filterValidFormLayoutProps(props: IFormLayoutProps): IFormLayoutProps {\r\n return Object.fromEntries(\r\n Object.entries(props)\r\n .filter(([_, value]) => isValid(value)),\r\n )\r\n}\r\n"],"names":["calcBreakpointIndex","breakpoints","width","i","breakpoint","calcFactor","value","breakpointIndex","safeIndex","factor","isValid","calculateProps","target","props","clientWidth","layout","labelAlign","wrapperAlign","labelCol","wrapperCol","otherProps","useResponsiveFormLayout","root","isArr","ref","layoutProps","useResizeObserver","formLayoutDeepContext","formLayoutShallowContext","useFormDeepLayout","inject","useFormLayout","shallowLayout","deepLayout","computed","FORM_LAYOUT_PROPS_KEYS","filterValidFormLayoutProps","_"],"mappings":";;;AAMO,SAASA,EAAoBC,GAAuBC,GAAuB;AAChF,aAAW,CAACC,GAAGC,CAAU,KAAKH,EAAY;AACxC,QAAIC,KAASE;AACX,aAAOD;AAGX,SAAO;AACT;AAEO,SAASE,EAAcC,GAAyBC,GAA4B;AACjF,MAAI,CAAC,MAAM,QAAQD,CAAK,KAAKA,EAAM,WAAW;AAC5C,WAAOA;AAET,QAAME,IAAY,KAAK,IAAI,IAAI,KAAK,IAAID,GAAiBD,EAAM,SAAS,CAAC,CAAC;AAC1E,SAAOA,EAAM,GAAGE,CAAS;AAC3B;AAEO,SAASC,EAAUH,GAAgBC,GAA4B;AACpE,SAAOG,EAAQJ,CAAK,IAAID,EAAcC,GAAOC,CAAe,IAAID;AAClE;AAEO,SAASK,EAAeC,GAAiBC,GAA2C;AACzF,QAAM,EAAE,aAAAC,MAAgBF,GAClB;AAAA,IACJ,aAAAX;AAAA,IACA,QAAAc;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDP,GACEN,IAAkBP;AAAA,IACtBC;AAAA,IACAa;AAAA,EAAA;AAGF,SAAO;AAAA,IACL,QAAQL,EAAOM,GAAQR,CAAe;AAAA,IACtC,YAAYE,EAAOO,GAAYT,CAAe;AAAA,IAC9C,cAAcE,EAAOQ,GAAcV,CAAe;AAAA,IAClD,UAAUE,EAAOS,GAAUX,CAAe;AAAA,IAC1C,YAAYE,EAAOU,GAAYZ,CAAe;AAAA,IAC9C,GAAGa;AAAA,EAAA;AAEP;AAEO,SAASC,EAAwBR,GAAyBS,GAA+B;AAC9F,QAAM,EAAE,aAAArB,MAAgBY;AACxB,MAAI,CAACU,EAAMtB,CAAW;AACpB,WAAO;AAAA,MACL,OAAOuB,EAAIX,CAAK;AAAA,IAAA;AAIpB,QAAMY,IAAcD,EAAsB,EAAE;AAE5C,SAAAE,EAAkBJ,GAAM,MAAM;AAC5B,IAAAG,EAAY,QAAQd,EAAeW,EAAK,OAAOT,CAAK;AAAA,EACtD,CAAC,GAEM;AAAA,IACL,OAAOY;AAAA,EAAA;AAEX;AAEO,MAAME,IAA6D;AAAA,EACxE;AACF,GAEaC,IACT,OAAO,0BAA0B;AAE9B,SAASC,IAA2C;AACzD,SAAOC,EAAOH,GAAuBH,EAAI,CAAA,CAAE,CAAC;AAC9C;AAEO,SAASO,IAAuC;AACrD,QAAMC,IAAgBF,EAAOF,GAA0BJ,EAAI,CAAA,CAAE,CAAC,GACxDS,IAAaH,EAAOH,GAAuBH,EAAI,CAAA,CAAE,CAAC;AASxD,SAPmBU,EAAS,OACnB;AAAA,IACL,GAAGD,EAAW;AAAA,IACd,GAAGD,EAAc;AAAA,EAAA,EAEpB;AAGH;AAEO,MAAMG,IAAgE;AAAA,EAC3E;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,SAASC,EAA2BvB,GAA2C;AACpF,SAAO,OAAO;AAAA,IACZ,OAAO,QAAQA,CAAK,EACjB,OAAO,CAAC,CAACwB,GAAG/B,CAAK,MAAMI,EAAQJ,CAAK,CAAC;AAAA,EAAA;AAE5C;"}
1
+ {"version":3,"file":"utils.mjs","sources":["../../src/form-layout/utils.ts"],"sourcesContent":["import type { ComputedRef, InjectionKey, Ref } from 'vue'\nimport type { IFormLayoutProps } from './types'\nimport { isArr, isValid } from '@formily/shared'\nimport { computed, inject, ref } from 'vue'\nimport { useResizeObserver } from '../__builtins__'\n\nexport function calcBreakpointIndex(breakpoints: number[], width: number): number {\n for (const [i, breakpoint] of breakpoints.entries()) {\n if (width <= breakpoint) {\n return i\n }\n }\n return -1\n}\n\nexport function calcFactor<T>(value: T | readonly T[], breakpointIndex: number): T {\n if (!Array.isArray(value) || value.length === 0) {\n return value as T\n }\n const safeIndex = Math.max(-1, Math.min(breakpointIndex, value.length - 1))\n return value.at(safeIndex)\n}\n\nexport function factor<T>(value: T | T[], breakpointIndex: number): T {\n return isValid(value) ? calcFactor<T>(value, breakpointIndex) : value as T\n}\n\nexport function calculateProps(target: Element, props: IFormLayoutProps): IFormLayoutProps {\n const { clientWidth } = target\n const {\n breakpoints,\n layout,\n labelAlign,\n wrapperAlign,\n labelCol,\n wrapperCol,\n ...otherProps\n } = props\n const breakpointIndex = calcBreakpointIndex(\n breakpoints as number[],\n clientWidth,\n )\n\n return {\n layout: factor(layout, breakpointIndex),\n labelAlign: factor(labelAlign, breakpointIndex),\n wrapperAlign: factor(wrapperAlign, breakpointIndex),\n labelCol: factor(labelCol, breakpointIndex),\n wrapperCol: factor(wrapperCol, breakpointIndex),\n ...otherProps,\n }\n}\n\nexport function useResponsiveFormLayout(props: IFormLayoutProps, root: Ref<HTMLElement | null>) {\n const { breakpoints } = props\n if (!isArr(breakpoints)) {\n return {\n props: ref(props),\n }\n }\n\n const layoutProps = ref<IFormLayoutProps>({})\n\n useResizeObserver(root, () => {\n layoutProps.value = calculateProps(root.value, props)\n })\n\n return {\n props: layoutProps,\n }\n}\n\nexport const formLayoutDeepContext: InjectionKey<Ref<IFormLayoutProps>> = Symbol(\n 'formLayoutDeepContext',\n)\n\nexport const formLayoutShallowContext: InjectionKey<Ref<IFormLayoutProps>>\n = Symbol('formLayoutShallowContext')\n\nexport const formLayoutIdContext: InjectionKey<ComputedRef<string>>\n = Symbol('formLayoutIdContext')\n\nexport function useFormDeepLayout(): Ref<IFormLayoutProps> {\n return inject(formLayoutDeepContext, ref({}))\n}\n\nexport function useFormLayout(): Ref<IFormLayoutProps> {\n const shallowLayout = inject(formLayoutShallowContext, ref({}))\n const deepLayout = inject(formLayoutDeepContext, ref({}))\n\n const formLayout = computed(() => {\n return {\n ...deepLayout.value,\n ...shallowLayout.value,\n }\n })\n\n return formLayout\n}\n\nexport function useFormLayoutId(): ComputedRef<string> {\n return inject(formLayoutIdContext, computed(() => ''))\n}\n\nexport const FORM_LAYOUT_PROPS_KEYS: ReadonlyArray<keyof IFormLayoutProps> = [\n 'colon',\n 'labelAlign',\n 'wrapperAlign',\n 'labelWrap',\n 'labelWidth',\n 'wrapperWidth',\n 'labelCol',\n 'wrapperCol',\n 'fullness',\n 'size',\n 'layout',\n 'feedbackLayout',\n 'tooltipLayout',\n 'breakpoints',\n 'hideRequiredAsterisk',\n 'statusIcon',\n 'requireAsteriskPosition',\n] as const\n\nexport function filterValidFormLayoutProps(props: IFormLayoutProps): IFormLayoutProps {\n return Object.fromEntries(\n Object.entries(props)\n .filter(([_, value]) => isValid(value)),\n )\n}\n"],"names":["calcBreakpointIndex","breakpoints","width","i","breakpoint","calcFactor","value","breakpointIndex","safeIndex","factor","isValid","calculateProps","target","props","clientWidth","layout","labelAlign","wrapperAlign","labelCol","wrapperCol","otherProps","useResponsiveFormLayout","root","isArr","ref","layoutProps","useResizeObserver","formLayoutDeepContext","formLayoutShallowContext","formLayoutIdContext","useFormDeepLayout","inject","useFormLayout","shallowLayout","deepLayout","computed","useFormLayoutId","FORM_LAYOUT_PROPS_KEYS","filterValidFormLayoutProps","_"],"mappings":";;;;;;;;AAMO,SAASA,EAAoBC,GAAuBC,GAAuB;AAChF,aAAW,CAACC,GAAGC,CAAU,KAAKH,EAAY;AACxC,QAAIC,KAASE;AACX,aAAOD;AAGX,SAAO;AACT;AAEO,SAASE,EAAcC,GAAyBC,GAA4B;AACjF,MAAI,CAAC,MAAM,QAAQD,CAAK,KAAKA,EAAM,WAAW;AAC5C,WAAOA;AAET,QAAME,IAAY,KAAK,IAAI,IAAI,KAAK,IAAID,GAAiBD,EAAM,SAAS,CAAC,CAAC;AAC1E,SAAOA,EAAM,GAAGE,CAAS;AAC3B;AAEO,SAASC,EAAUH,GAAgBC,GAA4B;AACpE,SAAOG,EAAQJ,CAAK,IAAID,EAAcC,GAAOC,CAAe,IAAID;AAClE;AAEO,SAASK,EAAeC,GAAiBC,GAA2C;AACzF,QAAM,EAAE,aAAAC,MAAgBF,GAClB;AAAA,IACJ,aAAAX;AAAA,IACA,QAAAc;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDP,GACEN,IAAkBP;AAAA,IACtBC;AAAA,IACAa;AAAA,EAAA;AAGF,SAAO;AAAA,IACL,QAAQL,EAAOM,GAAQR,CAAe;AAAA,IACtC,YAAYE,EAAOO,GAAYT,CAAe;AAAA,IAC9C,cAAcE,EAAOQ,GAAcV,CAAe;AAAA,IAClD,UAAUE,EAAOS,GAAUX,CAAe;AAAA,IAC1C,YAAYE,EAAOU,GAAYZ,CAAe;AAAA,IAC9C,GAAGa;AAAA,EAAA;AAEP;AAEO,SAASC,EAAwBR,GAAyBS,GAA+B;AAC9F,QAAM,EAAE,aAAArB,MAAgBY;AACxB,MAAI,CAACU,EAAMtB,CAAW;AACpB,WAAO;AAAA,MACL,OAAOuB,EAAIX,CAAK;AAAA,IAAA;AAIpB,QAAMY,IAAcD,EAAsB,EAAE;AAE5C,SAAAE,EAAkBJ,GAAM,MAAM;AAC5B,IAAAG,EAAY,QAAQd,EAAeW,EAAK,OAAOT,CAAK;AAAA,EACtD,CAAC,GAEM;AAAA,IACL,OAAOY;AAAA,EAAA;AAEX;AAEO,MAAME,IAA6D;AAAA,EACxE;AACF,GAEaC,IACT,OAAO,0BAA0B,GAExBC,IACT,OAAO,qBAAqB;AAEzB,SAASC,IAA2C;AACzD,SAAOC,EAAOJ,GAAuBH,EAAI,CAAA,CAAE,CAAC;AAC9C;AAEO,SAASQ,IAAuC;AACrD,QAAMC,IAAgBF,EAAOH,GAA0BJ,EAAI,CAAA,CAAE,CAAC,GACxDU,IAAaH,EAAOJ,GAAuBH,EAAI,CAAA,CAAE,CAAC;AASxD,SAPmBW,EAAS,OACnB;AAAA,IACL,GAAGD,EAAW;AAAA,IACd,GAAGD,EAAc;AAAA,EAAA,EAEpB;AAGH;AAEO,SAASG,IAAuC;AACrD,SAAOL,EAAOF,GAAqBM,EAAS,MAAM,EAAE,CAAC;AACvD;AAEO,MAAME,IAAgE;AAAA,EAC3E;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,SAASC,EAA2BzB,GAA2C;AACpF,SAAO,OAAO;AAAA,IACZ,OAAO,QAAQA,CAAK,EACjB,OAAO,CAAC,CAAC0B,GAAGjC,CAAK,MAAMI,EAAQJ,CAAK,CAAC;AAAA,EAAA;AAE5C;"}
@@ -1,48 +1,52 @@
1
- import { observer as g } from "@formily/reactive-vue";
2
- import { defineComponent as $, renderSlot as P, computed as B, createElementBlock as o, openBlock as r, normalizeClass as E, createVNode as N, unref as t, mergeProps as h, withCtx as u, Fragment as c, renderList as x, createBlock as m, createSlots as V, resolveDynamicComponent as _, createTextVNode as v, toDisplayString as y, createCommentVNode as b } from "vue";
1
+ import { defineComponent as $, renderSlot as g, computed as P, createElementBlock as o, openBlock as r, normalizeClass as B, createVNode as E, unref as t, mergeProps as h, withCtx as u, Fragment as c, renderList as x, createBlock as a, createSlots as N, resolveDynamicComponent as _, createTextVNode as v, toDisplayString as y, createCommentVNode as O } from "vue";
2
+ import { ElSteps as V, ElStep as b } from "element-plus";
3
+ import "@formily/reactive";
4
+ import "@formily/core";
5
+ import { useObserver as A } from "@silver-formily/reactive-vue";
6
+ import { useField as D, useFieldSchema as R, RecursionField as j } from "@silver-formily/vue";
7
+ import { composeExport as w } from "../__builtins__/shared/utils.mjs";
3
8
  import { isObj as k } from "@formily/shared";
4
- import { useField as A, useFieldSchema as D, RecursionField as O } from "@silver-formily/vue";
5
- import { ElSteps as R, ElStep as j } from "element-plus";
6
- import { createFormStep as S, parseSteps as w } from "./utils.mjs";
7
9
  import { stylePrefix as z } from "../__builtins__/configs/index.mjs";
8
- import { composeExport as I } from "../__builtins__/shared/utils.mjs";
9
- const L = $({
10
+ import { createFormStep as C, parseSteps as L } from "./utils.mjs";
11
+ const T = $({
10
12
  name: "FFormStepPane",
11
13
  inheritAttrs: !1
12
- }), T = (n, i) => {
13
- const a = n.__vccOpts || n;
14
- for (const [s, p] of i)
15
- a[s] = p;
16
- return a;
14
+ }), q = (n, i) => {
15
+ const m = n.__vccOpts || n;
16
+ for (const [p, s] of i)
17
+ m[p] = s;
18
+ return m;
17
19
  };
18
- function q(n, i, a, s, p, f) {
19
- return P(n.$slots, "default");
20
+ function G(n, i, m, p, s, f) {
21
+ return g(n.$slots, "default");
20
22
  }
21
- const G = /* @__PURE__ */ T(L, [["render", q]]), H = /* @__PURE__ */ $({
23
+ const H = /* @__PURE__ */ q(T, [["render", G]]), I = /* @__PURE__ */ $({
22
24
  name: "FFormStep",
23
25
  inheritAttrs: !1,
24
26
  __name: "form-step",
25
27
  props: {
26
- formStep: { default: () => S() },
27
- active: null
28
+ formStep: { default: () => C() },
29
+ active: {}
28
30
  },
29
31
  setup(n) {
30
- const i = n, a = A().value, s = `${z}-form-step`, p = D(), f = w(p.value);
31
- i.formStep.connect?.(f, a);
32
- const F = B(() => i.active ?? i.formStep?.current ?? 0);
33
- return (C, K) => (r(), o("div", {
34
- class: E(s)
32
+ const i = n;
33
+ A();
34
+ const m = D().value, p = `${z}-form-step`, s = R(), f = L(s.value);
35
+ i.formStep.connect?.(f, m);
36
+ const F = P(() => i.active ?? i.formStep?.current ?? 0);
37
+ return (S, J) => (r(), o("div", {
38
+ class: B(p)
35
39
  }, [
36
- N(t(R), h(C.$attrs, {
40
+ E(t(V), h(S.$attrs, {
37
41
  active: F.value,
38
42
  style: [{ marginBottom: "10px" }]
39
43
  }), {
40
44
  default: u(() => [
41
- (r(!0), o(c, null, x(t(f), ({ props: l, slots: e }, d) => (r(), m(t(j), h({ key: d }, { ref_for: !0 }, l), V({ _: 2 }, [
45
+ (r(!0), o(c, null, x(t(f), ({ props: l, slots: e }, d) => (r(), a(t(b), h({ key: d }, { ref_for: !0 }, l), N({ _: 2 }, [
42
46
  e?.title ? {
43
47
  name: "title",
44
48
  fn: u(() => [
45
- t(k)(e.title) ? (r(), m(_(e.title), { key: 0 })) : (r(), o(c, { key: 1 }, [
49
+ t(k)(e.title) ? (r(), a(_(e.title), { key: 0 })) : (r(), o(c, { key: 1 }, [
46
50
  v(y(e.title), 1)
47
51
  ], 64))
48
52
  ]),
@@ -51,7 +55,7 @@ const G = /* @__PURE__ */ T(L, [["render", q]]), H = /* @__PURE__ */ $({
51
55
  e?.icon ? {
52
56
  name: "icon",
53
57
  fn: u(() => [
54
- t(k)(e.icon) ? (r(), m(_(e.icon), { key: 0 })) : (r(), o(c, { key: 1 }, [
58
+ t(k)(e.icon) ? (r(), a(_(e.icon), { key: 0 })) : (r(), o(c, { key: 1 }, [
55
59
  v(y(e.icon), 1)
56
60
  ], 64))
57
61
  ]),
@@ -60,7 +64,7 @@ const G = /* @__PURE__ */ T(L, [["render", q]]), H = /* @__PURE__ */ $({
60
64
  e?.description ? {
61
65
  name: "description",
62
66
  fn: u(() => [
63
- t(k)(e.description) ? (r(), m(_(e.description), { key: 0 })) : (r(), o(c, { key: 1 }, [
67
+ t(k)(e.description) ? (r(), a(_(e.description), { key: 0 })) : (r(), o(c, { key: 1 }, [
64
68
  v(y(e.description), 1)
65
69
  ], 64))
66
70
  ]),
@@ -71,20 +75,20 @@ const G = /* @__PURE__ */ T(L, [["render", q]]), H = /* @__PURE__ */ $({
71
75
  _: 1
72
76
  }, 16, ["active"]),
73
77
  (r(!0), o(c, null, x(t(f), ({ name: l, schema: e }, d) => (r(), o(c, { key: l }, [
74
- d === F.value ? (r(), m(t(O), {
78
+ d === F.value ? (r(), a(t(j), {
75
79
  key: 0,
76
80
  name: l,
77
81
  schema: e
78
- }, null, 8, ["name", "schema"])) : b("", !0)
82
+ }, null, 8, ["name", "schema"])) : O("", !0)
79
83
  ], 64))), 128))
80
84
  ]));
81
85
  }
82
- }), J = g(H), re = I(J, {
83
- StepPane: G,
84
- createFormStep: S
86
+ }), te = w(I, {
87
+ StepPane: H,
88
+ createFormStep: C
85
89
  });
86
90
  export {
87
- re as FormStep,
88
- re as default
91
+ te as FormStep,
92
+ te as default
89
93
  };
90
94
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/form-step/form-step-pane.vue","../../src/form-step/form-step-pane.vue","../../src/form-step/form-step.vue","../../src/form-step/index.ts"],"sourcesContent":["<script lang=\"ts\">\r\nimport { defineComponent } from 'vue'\r\n\r\nexport default defineComponent({\r\n name: 'FFormStepPane',\r\n inheritAttrs: false,\r\n})\r\n</script>\r\n\r\n<template>\r\n <slot />\r\n</template>\r\n","<script lang=\"ts\">\r\nimport { defineComponent } from 'vue'\r\n\r\nexport default defineComponent({\r\n name: 'FFormStepPane',\r\n inheritAttrs: false,\r\n})\r\n</script>\r\n\r\n<template>\r\n <slot />\r\n</template>\r\n","<script setup lang=\"ts\">\r\nimport type { VoidField } from '@formily/core'\r\nimport type { IFormStepProps } from './types'\r\nimport { isObj } from '@formily/shared'\r\nimport { RecursionField, useField, useFieldSchema } from '@silver-formily/vue'\r\nimport { ElStep, ElSteps } from 'element-plus'\r\nimport { computed } from 'vue'\r\nimport { stylePrefix } from '../__builtins__'\r\nimport { createFormStep, parseSteps } from './utils'\r\n\r\ndefineOptions({\r\n name: 'FFormStep',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps({\n formStep: { default: () => createFormStep() },\n active: null\n})\r\n\r\nconst field = useField<VoidField>().value\r\nconst prefixCls = `${stylePrefix}-form-step`\r\nconst fieldSchemaRef = useFieldSchema()\r\n\r\nconst steps = parseSteps(fieldSchemaRef.value)\r\n\r\nprops.formStep.connect?.(steps, field)\r\n\r\nconst current = computed(() => props.active ?? props.formStep?.current ?? 0)\r\n</script>\r\n\r\n<template>\r\n <div :class=\"prefixCls\">\r\n <ElSteps\r\n v-bind=\"$attrs\"\r\n :active=\"current\"\r\n :style=\"[{ marginBottom: '10px' }]\"\r\n >\r\n <ElStep\r\n v-for=\"({ props: stepProps, slots: stepSlots }, key) of steps\"\r\n :key=\"key\"\r\n v-bind=\"stepProps\"\r\n >\r\n <template v-if=\"stepSlots?.title\" #title>\r\n <template v-if=\"isObj(stepSlots.title)\">\r\n <component :is=\"stepSlots.title\" />\r\n </template>\r\n <template v-else>\r\n {{ stepSlots.title }}\r\n </template>\r\n </template>\r\n <template v-if=\"stepSlots?.icon\" #icon>\r\n <template v-if=\"isObj(stepSlots.icon)\">\r\n <component :is=\"stepSlots.icon\" />\r\n </template>\r\n <template v-else>\r\n {{ stepSlots.icon }}\r\n </template>\r\n </template>\r\n <template v-if=\"stepSlots?.description\" #description>\r\n <template v-if=\"isObj(stepSlots.description)\">\r\n <component :is=\"stepSlots.description\" />\r\n </template>\r\n <template v-else>\r\n {{ stepSlots.description }}\r\n </template>\r\n </template>\r\n </ElStep>\r\n </ElSteps>\r\n\r\n <template v-for=\"({ name, schema }, key) of steps\" :key=\"name\">\r\n <RecursionField\r\n v-if=\"key === current\"\r\n :name=\"name\"\r\n :schema=\"schema\"\r\n />\r\n </template>\r\n </div>\r\n</template>\r\n","import { observer } from '@formily/reactive-vue'\r\nimport { composeExport } from '../__builtins__'\r\nimport FFormStepPane from './form-step-pane.vue'\r\nimport FFormStep from './form-step.vue'\r\nimport { createFormStep } from './utils'\r\n\r\nconst FormStepInner = observer(FFormStep)\r\n\r\nexport const FormStep = composeExport(FormStepInner, {\r\n StepPane: FFormStepPane,\r\n createFormStep,\r\n})\r\n\r\nexport default FormStep\r\n"],"names":["_sfc_main$1","defineComponent","_renderSlot","_ctx","props","__props","field","useField","prefixCls","stylePrefix","fieldSchemaRef","useFieldSchema","steps","parseSteps","current","computed","_createElementBlock","_createVNode","_unref","ElSteps","_mergeProps","_openBlock","_Fragment","stepProps","stepSlots","key","_createBlock","_createSlots","isObj","_resolveDynamicComponent","_createTextVNode","_toDisplayString","name","schema","RecursionField","FormStepInner","observer","FFormStep","FormStep","composeExport","FFormStepPane","createFormStep"],"mappings":";;;;;;;;AAGA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;;;;;SCICC,EAAQC,EAAA,QAAA,SAAA;;;;;;;;;;;ACKV,UAAMC,IAAQC,GAKRC,IAAQC,IAAsB,OAC9BC,IAAY,GAAGC,CAAW,cAC1BC,IAAiBC,EAAA,GAEjBC,IAAQC,EAAWH,EAAe,KAAK;AAE7C,IAAAN,EAAM,SAAS,UAAUQ,GAAON,CAAK;AAErC,UAAMQ,IAAUC,EAAS,MAAMX,EAAM,UAAUA,EAAM,UAAU,WAAW,CAAC;2BAIzEY,EA6CM,OAAA;AAAA,MA7CA,SAAOR,CAAS;AAAA,IAAA;MACpBS,EAmCUC,EAAAC,CAAA,GAnCVC,EAmCUjB,EAAA,QAlCM;AAAA,QACb,QAAQW,EAAA;AAAA,QACR,OAAO,CAAA,EAAA,cAAA,QAAA;AAAA,MAAA;mBAGN,MAA8D;AAAA,WADhEO,EAAA,EAAA,GAAAL,EA6BSM,WA5BiDJ,EAAAN,CAAA,GAAK,CAAA,EAAA,OAA5CW,GAAS,OAASC,EAAA,GAAaC,OADlDJ,EAAA,GAAAK,EA6BSR,MA7BTE,EA6BS,EA3BN,KAAAK,EAAA,oBACOF,CAAS,GAAAI,EAAA,EAAA,GAAA,KAAA;AAAA,YAEDH,GAAW;oBAAQ;AAAA,oBAAvC,MAEW;AAAA,gBADWN,EAAAU,CAAA,EAAMJ,EAAU,KAAK,UACnCE,EAAmCG,EAAnBL,EAAU,KAAK,GAAA,EAAA,KAAA,EAAA,CAAA,WAEjCR,EAEWM,GAAA,EAAA,KAAA,KAAA;AAAA,kBADNQ,EAAAC,EAAAP,EAAU,KAAK,GAAA,CAAA;AAAA,gBAAA;;;;YAGNA,GAAW;oBAAO;AAAA,oBAAtC,MAEW;AAAA,gBADWN,EAAAU,CAAA,EAAMJ,EAAU,IAAI,UAClCE,EAAkCG,EAAlBL,EAAU,IAAI,GAAA,EAAA,KAAA,EAAA,CAAA,WAEhCR,EAEWM,GAAA,EAAA,KAAA,KAAA;AAAA,kBADNQ,EAAAC,EAAAP,EAAU,IAAI,GAAA,CAAA;AAAA,gBAAA;;;;YAGLA,GAAW;oBAAc;AAAA,oBAA7C,MAEW;AAAA,gBADWN,EAAAU,CAAA,EAAMJ,EAAU,WAAW,UACzCE,EAAyCG,EAAzBL,EAAU,WAAW,GAAA,EAAA,KAAA,EAAA,CAAA,WAEvCR,EAEWM,GAAA,EAAA,KAAA,KAAA;AAAA,kBADNQ,EAAAC,EAAAP,EAAU,WAAW,GAAA,CAAA;AAAA,gBAAA;;;;;;;;OAMhCH,EAAA,EAAA,GAAAL,EAMWM,WANiCJ,EAAAN,CAAA,GAAK,CAAA,EAA7B,MAAAoB,GAAM,QAAAC,EAAA,GAAUR,wBAAqBO,KAAI;AAAA,QAEnDP,MAAQX,EAAA,cADhBY,EAIER,EAAAgB,CAAA,GAAA;AAAA;UAFC,MAAAF;AAAA,UACA,QAAAC;AAAA,QAAA;;;;ICpEHE,IAAgBC,EAASC,CAAS,GAE3BC,KAAWC,EAAcJ,GAAe;AAAA,EACnD,UAAUK;AAAA,EACV,gBAAAC;AACF,CAAC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/form-step/form-step-pane.vue","../../src/form-step/form-step.vue","../../src/form-step/index.ts"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent } from 'vue'\n\nexport default defineComponent({\n name: 'FFormStepPane',\n inheritAttrs: false,\n})\n</script>\n\n<template>\n <slot />\n</template>\n","<script setup lang=\"ts\">\nimport type { VoidField } from '@formily/core'\nimport type { IFormStepProps } from './types'\nimport { isObj } from '@formily/shared'\nimport { useObserver } from '@silver-formily/reactive-vue'\nimport { RecursionField, useField, useFieldSchema } from '@silver-formily/vue'\nimport { ElStep, ElSteps } from 'element-plus'\nimport { computed } from 'vue'\nimport { stylePrefix } from '../__builtins__'\nimport { createFormStep, parseSteps } from './utils'\n\ndefineOptions({\n name: 'FFormStep',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<IFormStepProps>(), {\n formStep: () => createFormStep(),\n})\n\nuseObserver()\n\nconst field = useField<VoidField>().value\nconst prefixCls = `${stylePrefix}-form-step`\nconst fieldSchemaRef = useFieldSchema()\n\nconst steps = parseSteps(fieldSchemaRef.value)\n\nprops.formStep.connect?.(steps, field)\n\nconst current = computed(() => props.active ?? props.formStep?.current ?? 0)\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <ElSteps\n v-bind=\"$attrs\"\n :active=\"current\"\n :style=\"[{ marginBottom: '10px' }]\"\n >\n <ElStep\n v-for=\"({ props: stepProps, slots: stepSlots }, key) of steps\"\n :key=\"key\"\n v-bind=\"stepProps\"\n >\n <template v-if=\"stepSlots?.title\" #title>\n <template v-if=\"isObj(stepSlots.title)\">\n <component :is=\"stepSlots.title\" />\n </template>\n <template v-else>\n {{ stepSlots.title }}\n </template>\n </template>\n <template v-if=\"stepSlots?.icon\" #icon>\n <template v-if=\"isObj(stepSlots.icon)\">\n <component :is=\"stepSlots.icon\" />\n </template>\n <template v-else>\n {{ stepSlots.icon }}\n </template>\n </template>\n <template v-if=\"stepSlots?.description\" #description>\n <template v-if=\"isObj(stepSlots.description)\">\n <component :is=\"stepSlots.description\" />\n </template>\n <template v-else>\n {{ stepSlots.description }}\n </template>\n </template>\n </ElStep>\n </ElSteps>\n\n <template v-for=\"({ name, schema }, key) of steps\" :key=\"name\">\n <RecursionField\n v-if=\"key === current\"\n :name=\"name\"\n :schema=\"schema\"\n />\n </template>\n </div>\n</template>\n","import { composeExport } from '../__builtins__'\nimport FFormStepPane from './form-step-pane.vue'\nimport FFormStep from './form-step.vue'\nimport { createFormStep } from './utils'\n\nexport const FormStep = composeExport(FFormStep, {\n StepPane: FFormStepPane,\n createFormStep,\n})\n\nexport default FormStep\n"],"names":["_sfc_main$1","defineComponent","_renderSlot","_ctx","props","__props","useObserver","field","useField","prefixCls","stylePrefix","fieldSchemaRef","useFieldSchema","steps","parseSteps","current","computed","_createElementBlock","_createVNode","_unref","ElSteps","_mergeProps","_openBlock","_Fragment","stepProps","stepSlots","key","_createBlock","_createSlots","isObj","_resolveDynamicComponent","_createTextVNode","_toDisplayString","name","schema","RecursionField","FormStep","composeExport","FFormStep","FFormStepPane","createFormStep"],"mappings":";;;;;;;;;;AAGA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;;;;;SAICC,EAAQC,EAAA,QAAA,SAAA;;;;;;;;;;;ACMV,UAAMC,IAAQC;AAId,IAAAC,EAAA;AAEA,UAAMC,IAAQC,IAAsB,OAC9BC,IAAY,GAAGC,CAAW,cAC1BC,IAAiBC,EAAA,GAEjBC,IAAQC,EAAWH,EAAe,KAAK;AAE7C,IAAAP,EAAM,SAAS,UAAUS,GAAON,CAAK;AAErC,UAAMQ,IAAUC,EAAS,MAAMZ,EAAM,UAAUA,EAAM,UAAU,WAAW,CAAC;2BAIzEa,EA6CM,OAAA;AAAA,MA7CA,SAAOR,CAAS;AAAA,IAAA;MACpBS,EAmCUC,EAAAC,CAAA,GAnCVC,EAmCUlB,EAAA,QAlCM;AAAA,QACb,QAAQY,EAAA;AAAA,QACR,OAAO,CAAA,EAAA,cAAA,QAAA;AAAA,MAAA;mBAGN,MAA8D;AAAA,WADhEO,EAAA,EAAA,GAAAL,EA6BSM,WA5BiDJ,EAAAN,CAAA,GAAK,CAAA,EAAA,OAA5CW,GAAS,OAASC,EAAA,GAAaC,OADlDJ,EAAA,GAAAK,EA6BSR,MA7BTE,EA6BS,EA3BN,KAAAK,EAAA,oBACOF,CAAS,GAAAI,EAAA,EAAA,GAAA,KAAA;AAAA,YAEDH,GAAW;oBAAQ;AAAA,oBACjC,MAEW;AAAA,gBAFKN,EAAAU,CAAA,EAAMJ,EAAU,KAAK,UACnCE,EAAmCG,EAAnBL,EAAU,KAAK,GAAA,EAAA,KAAA,EAAA,CAAA,WAEjCR,EAEWM,GAAA,EAAA,KAAA,KAAA;AAAA,kBADNQ,EAAAC,EAAAP,EAAU,KAAK,GAAA,CAAA;AAAA,gBAAA;;;;YAGNA,GAAW;oBAAO;AAAA,oBAChC,MAEW;AAAA,gBAFKN,EAAAU,CAAA,EAAMJ,EAAU,IAAI,UAClCE,EAAkCG,EAAlBL,EAAU,IAAI,GAAA,EAAA,KAAA,EAAA,CAAA,WAEhCR,EAEWM,GAAA,EAAA,KAAA,KAAA;AAAA,kBADNQ,EAAAC,EAAAP,EAAU,IAAI,GAAA,CAAA;AAAA,gBAAA;;;;YAGLA,GAAW;oBAAc;AAAA,oBACvC,MAEW;AAAA,gBAFKN,EAAAU,CAAA,EAAMJ,EAAU,WAAW,UACzCE,EAAyCG,EAAzBL,EAAU,WAAW,GAAA,EAAA,KAAA,EAAA,CAAA,WAEvCR,EAEWM,GAAA,EAAA,KAAA,KAAA;AAAA,kBADNQ,EAAAC,EAAAP,EAAU,WAAW,GAAA,CAAA;AAAA,gBAAA;;;;;;;;OAMhCH,EAAA,EAAA,GAAAL,EAMWM,WANiCJ,EAAAN,CAAA,GAAK,CAAA,EAA7B,MAAAoB,GAAM,QAAAC,EAAA,GAAUR,wBAAqBO,KAAI;AAAA,QAEnDP,MAAQX,EAAA,cADhBY,EAIER,EAAAgB,CAAA,GAAA;AAAA;UAFC,MAAAF;AAAA,UACA,QAAAC;AAAA,QAAA;;;;ICvEIE,KAAWC,EAAcC,GAAW;AAAA,EAC/C,UAAUC;AAAA,EACV,gBAAAC;AACF,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","sources":["../../src/form-step/utils.ts"],"sourcesContent":["import type { Schema, SchemaKey } from '@formily/json-schema'\r\nimport type { Slots } from 'vue'\r\nimport type { FormStepEnv, IFormStep } from './types'\r\nimport { action, model, observable } from '@formily/reactive'\r\n\r\nexport interface SchemaStep {\r\n name: SchemaKey\r\n props: any\r\n schema: Schema\r\n slots: Slots\r\n}\r\n\r\nexport function createFormStep(defaultCurrent = 0): IFormStep {\r\n const env: FormStepEnv = observable({\r\n form: null,\r\n field: null,\r\n steps: [],\r\n })\r\n\r\n const setDisplay = action.bound((target: number) => {\r\n const currentStep = env.steps[target]\r\n for (const { name } of env.steps) {\r\n env.form.query(`${env.field.address}.${name}`).take((field) => {\r\n if (name === currentStep.name) {\r\n field.setDisplay('visible')\r\n }\r\n else {\r\n field.setDisplay('hidden')\r\n }\r\n })\r\n }\r\n })\r\n\r\n const formStep: IFormStep = model({\r\n connect(steps, field) {\r\n env.steps = steps\r\n env.form = field?.form\r\n env.field = field\r\n },\r\n current: defaultCurrent,\r\n setCurrent(key: number) {\r\n formStep.current = key\r\n },\r\n get allowNext() {\r\n return formStep.current < env.steps.length - 1\r\n },\r\n get allowBack() {\r\n return formStep.current > 0\r\n },\r\n async next() {\r\n try {\r\n await env.form.validate()\r\n // eslint-disable-next-line ts/no-use-before-define\r\n next()\r\n }\r\n catch {}\r\n },\r\n async back() {\r\n // eslint-disable-next-line ts/no-use-before-define\r\n back()\r\n },\r\n async submit(onSubmit) {\r\n return env.form?.submit?.(onSubmit)\r\n },\r\n })\r\n\r\n const next = action.bound(() => {\r\n /* istanbul ignore else -- @preserve */\r\n if (formStep.allowNext) {\r\n setDisplay(formStep.current + 1)\r\n formStep.setCurrent(formStep.current + 1)\r\n }\r\n })\r\n\r\n const back = action.bound(() => {\r\n /* istanbul ignore else -- @preserve */\r\n if (formStep.allowBack) {\r\n setDisplay(formStep.current - 1)\r\n formStep.setCurrent(formStep.current - 1)\r\n }\r\n })\r\n return formStep\r\n}\r\n\r\nexport function parseSteps(schema: Schema) {\r\n const steps: SchemaStep[] = []\r\n schema.mapProperties((schema, name) => {\r\n /* istanbul ignore else -- @preserve */\r\n if (schema['x-component']?.indexOf('StepPane') > -1) {\r\n steps.push({\r\n name,\r\n props: schema['x-component-props'],\r\n schema,\r\n slots: schema['x-content'],\r\n })\r\n }\r\n })\r\n return steps\r\n}\r\n"],"names":["createFormStep","defaultCurrent","env","observable","setDisplay","action","target","currentStep","name","field","formStep","model","steps","key","next","back","onSubmit","parseSteps","schema"],"mappings":";AAYO,SAASA,EAAeC,IAAiB,GAAc;AAC5D,QAAMC,IAAmBC,EAAW;AAAA,IAClC,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO,CAAA;AAAA,EAAC,CACT,GAEKC,IAAaC,EAAO,MAAM,CAACC,MAAmB;AAClD,UAAMC,IAAcL,EAAI,MAAMI,CAAM;AACpC,eAAW,EAAE,MAAAE,OAAUN,EAAI;AACzB,MAAAA,EAAI,KAAK,MAAM,GAAGA,EAAI,MAAM,OAAO,IAAIM,CAAI,EAAE,EAAE,KAAK,CAACC,MAAU;AAC7D,QAAID,MAASD,EAAY,OACvBE,EAAM,WAAW,SAAS,IAG1BA,EAAM,WAAW,QAAQ;AAAA,MAE7B,CAAC;AAAA,EAEL,CAAC,GAEKC,IAAsBC,EAAM;AAAA,IAChC,QAAQC,GAAOH,GAAO;AACpB,MAAAP,EAAI,QAAQU,GACZV,EAAI,OAAOO,GAAO,MAClBP,EAAI,QAAQO;AAAA,IACd;AAAA,IACA,SAASR;AAAA,IACT,WAAWY,GAAa;AACtB,MAAAH,EAAS,UAAUG;AAAA,IACrB;AAAA,IACA,IAAI,YAAY;AACd,aAAOH,EAAS,UAAUR,EAAI,MAAM,SAAS;AAAA,IAC/C;AAAA,IACA,IAAI,YAAY;AACd,aAAOQ,EAAS,UAAU;AAAA,IAC5B;AAAA,IACA,MAAM,OAAO;AACX,UAAI;AACF,cAAMR,EAAI,KAAK,SAAA,GAEfY,EAAA;AAAA,MACF,QACM;AAAA,MAAC;AAAA,IACT;AAAA,IACA,MAAM,OAAO;AAEX,MAAAC,EAAA;AAAA,IACF;AAAA,IACA,MAAM,OAAOC,GAAU;AACrB,aAAOd,EAAI,MAAM,SAASc,CAAQ;AAAA,IACpC;AAAA,EAAA,CACD,GAEKF,IAAOT,EAAO,MAAM,MAAM;AAAA,IAAA;AAE9B,IAAIK,EAAS,cACXN,EAAWM,EAAS,UAAU,CAAC,GAC/BA,EAAS,WAAWA,EAAS,UAAU,CAAC;AAAA,EAE5C,CAAC,GAEKK,IAAOV,EAAO,MAAM,MAAM;AAAA,IAAA;AAE9B,IAAIK,EAAS,cACXN,EAAWM,EAAS,UAAU,CAAC,GAC/BA,EAAS,WAAWA,EAAS,UAAU,CAAC;AAAA,EAE5C,CAAC;AACD,SAAOA;AACT;AAEO,SAASO,EAAWC,GAAgB;AACzC,QAAMN,IAAsB,CAAA;AAC5B,SAAAM,EAAO,cAAc,CAACA,GAAQV,MAAS;AAAA,IAAA;AAErC,IAAIU,EAAO,aAAa,GAAG,QAAQ,UAAU,IAAI,MAC/CN,EAAM,KAAK;AAAA,MACT,MAAAJ;AAAA,MACA,OAAOU,EAAO,mBAAmB;AAAA,MACjC,QAAAA;AAAAA,MACA,OAAOA,EAAO,WAAW;AAAA,IAAA,CAC1B;AAAA,EAEL,CAAC,GACMN;AACT;"}
1
+ {"version":3,"file":"utils.mjs","sources":["../../src/form-step/utils.ts"],"sourcesContent":["import type { Schema, SchemaKey } from '@formily/json-schema'\nimport type { Slots } from 'vue'\nimport type { FormStepEnv, IFormStep } from './types'\nimport { action, model, observable } from '@formily/reactive'\n\nexport interface SchemaStep {\n name: SchemaKey\n props: any\n schema: Schema\n slots: Slots\n}\n\nexport function createFormStep(defaultCurrent = 0): IFormStep {\n const env: FormStepEnv = observable({\n form: null,\n field: null,\n steps: [],\n })\n\n const setDisplay = action.bound((target: number) => {\n const currentStep = env.steps[target]\n for (const { name } of env.steps) {\n env.form.query(`${env.field.address}.${name}`).take((field) => {\n if (name === currentStep.name) {\n field.setDisplay('visible')\n }\n else {\n field.setDisplay('hidden')\n }\n })\n }\n })\n\n const formStep: IFormStep = model({\n connect(steps, field) {\n env.steps = steps\n env.form = field?.form\n env.field = field\n },\n current: defaultCurrent,\n setCurrent(key: number) {\n formStep.current = key\n },\n get allowNext() {\n return formStep.current < env.steps.length - 1\n },\n get allowBack() {\n return formStep.current > 0\n },\n async next() {\n try {\n await env.form.validate()\n // eslint-disable-next-line ts/no-use-before-define\n next()\n }\n catch {}\n },\n async back() {\n // eslint-disable-next-line ts/no-use-before-define\n back()\n },\n async submit(onSubmit) {\n return env.form?.submit?.(onSubmit)\n },\n })\n\n const next = action.bound(() => {\n /* istanbul ignore else -- @preserve */\n if (formStep.allowNext) {\n setDisplay(formStep.current + 1)\n formStep.setCurrent(formStep.current + 1)\n }\n })\n\n const back = action.bound(() => {\n /* istanbul ignore else -- @preserve */\n if (formStep.allowBack) {\n setDisplay(formStep.current - 1)\n formStep.setCurrent(formStep.current - 1)\n }\n })\n return formStep\n}\n\nexport function parseSteps(schema: Schema) {\n const steps: SchemaStep[] = []\n schema.mapProperties((schema, name) => {\n /* istanbul ignore else -- @preserve */\n if (schema['x-component']?.indexOf('StepPane') > -1) {\n steps.push({\n name,\n props: schema['x-component-props'],\n schema,\n slots: schema['x-content'],\n })\n }\n })\n return steps\n}\n"],"names":["createFormStep","defaultCurrent","env","observable","setDisplay","action","target","currentStep","name","field","formStep","model","steps","key","next","back","onSubmit","parseSteps","schema"],"mappings":";AAYO,SAASA,EAAeC,IAAiB,GAAc;AAC5D,QAAMC,IAAmBC,EAAW;AAAA,IAClC,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO,CAAA;AAAA,EAAC,CACT,GAEKC,IAAaC,EAAO,MAAM,CAACC,MAAmB;AAClD,UAAMC,IAAcL,EAAI,MAAMI,CAAM;AACpC,eAAW,EAAE,MAAAE,OAAUN,EAAI;AACzB,MAAAA,EAAI,KAAK,MAAM,GAAGA,EAAI,MAAM,OAAO,IAAIM,CAAI,EAAE,EAAE,KAAK,CAACC,MAAU;AAC7D,QAAID,MAASD,EAAY,OACvBE,EAAM,WAAW,SAAS,IAG1BA,EAAM,WAAW,QAAQ;AAAA,MAE7B,CAAC;AAAA,EAEL,CAAC,GAEKC,IAAsBC,EAAM;AAAA,IAChC,QAAQC,GAAOH,GAAO;AACpB,MAAAP,EAAI,QAAQU,GACZV,EAAI,OAAOO,GAAO,MAClBP,EAAI,QAAQO;AAAA,IACd;AAAA,IACA,SAASR;AAAA,IACT,WAAWY,GAAa;AACtB,MAAAH,EAAS,UAAUG;AAAA,IACrB;AAAA,IACA,IAAI,YAAY;AACd,aAAOH,EAAS,UAAUR,EAAI,MAAM,SAAS;AAAA,IAC/C;AAAA,IACA,IAAI,YAAY;AACd,aAAOQ,EAAS,UAAU;AAAA,IAC5B;AAAA,IACA,MAAM,OAAO;AACX,UAAI;AACF,cAAMR,EAAI,KAAK,SAAA,GAEfY,EAAA;AAAA,MACF,QACM;AAAA,MAAC;AAAA,IACT;AAAA,IACA,MAAM,OAAO;AAEX,MAAAC,EAAA;AAAA,IACF;AAAA,IACA,MAAM,OAAOC,GAAU;AACrB,aAAOd,EAAI,MAAM,SAASc,CAAQ;AAAA,IACpC;AAAA,EAAA,CACD,GAEKF,IAAOT,EAAO,MAAM,MAAM;AAAA,IAAA;AAE9B,IAAIK,EAAS,cACXN,EAAWM,EAAS,UAAU,CAAC,GAC/BA,EAAS,WAAWA,EAAS,UAAU,CAAC;AAAA,EAE5C,CAAC,GAEKK,IAAOV,EAAO,MAAM,MAAM;AAAA,IAAA;AAE9B,IAAIK,EAAS,cACXN,EAAWM,EAAS,UAAU,CAAC,GAC/BA,EAAS,WAAWA,EAAS,UAAU,CAAC;AAAA,EAE5C,CAAC;AACD,SAAOA;AACT;AAEO,SAASO,EAAWC,GAAgB;AACzC,QAAMN,IAAsB,CAAA;AAC5B,SAAAM,EAAO,cAAc,CAACA,GAAQV,MAAS;AAAA,IAAA;AAErC,IAAIU,EAAO,aAAa,GAAG,QAAQ,UAAU,IAAI,MAC/CN,EAAM,KAAK;AAAA,MACT,MAAAJ;AAAA,MACA,OAAOU,EAAO,mBAAmB;AAAA,MACjC,QAAAA;AAAAA,MACA,OAAOA,EAAO,WAAW;AAAA,IAAA,CAC1B;AAAA,EAEL,CAAC,GACMN;AACT;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.mjs","sources":["../../src/form-tab/hooks.ts"],"sourcesContent":["import type { Schema, SchemaKey } from '@formily/json-schema'\r\nimport { observable, reaction } from '@formily/reactive'\r\nimport { useField, useFieldSchema } from '@silver-formily/vue'\r\n\r\nexport type Tabs = { name: SchemaKey, props: any, schema: Schema }[]\r\n\r\nexport function useTabs() {\r\n const tabsField = useField()\r\n const schema = useFieldSchema()\r\n const tabs: Tabs = observable([])\r\n reaction(() => {\r\n const tabDisplayStatus = schema.value?.mapProperties((schema, name) => {\r\n const field = tabsField.value\r\n .query(tabsField.value.address.concat(name))\r\n .take()\r\n return field?.display\r\n })\r\n return tabDisplayStatus\r\n }, () => {\r\n tabs.length = 0\r\n schema.value?.mapProperties((schema, name) => {\r\n const field = tabsField.value\r\n .query(tabsField.value.address.concat(name))\r\n .take()\r\n if (field?.display === 'none' || field?.display === 'hidden')\r\n return\r\n\r\n if (schema['x-component']?.indexOf('TabPane') > -1) {\r\n tabs.push({\r\n name,\r\n props: {\r\n name: schema?.['x-component-props']?.name || name,\r\n ...schema?.['x-component-props'],\r\n },\r\n schema,\r\n })\r\n }\r\n })\r\n }, {\r\n fireImmediately: true,\r\n })\r\n\r\n return tabs\r\n}\r\n"],"names":["useTabs","tabsField","useField","schema","useFieldSchema","tabs","observable","reaction","name","field"],"mappings":";;AAMO,SAASA,IAAU;AACxB,QAAMC,IAAYC,EAAA,GACZC,IAASC,EAAA,GACTC,IAAaC,EAAW,EAAE;AAChC,SAAAC,EAAS,MACkBJ,EAAO,OAAO,cAAc,CAACA,GAAQK,MAC9CP,EAAU,MACrB,MAAMA,EAAU,MAAM,QAAQ,OAAOO,CAAI,CAAC,EAC1C,KAAA,GACW,OACf,GAEA,MAAM;AACP,IAAAH,EAAK,SAAS,GACdF,EAAO,OAAO,cAAc,CAACA,GAAQK,MAAS;AAC5C,YAAMC,IAAQR,EAAU,MACrB,MAAMA,EAAU,MAAM,QAAQ,OAAOO,CAAI,CAAC,EAC1C,KAAA;AACH,MAAIC,GAAO,YAAY,UAAUA,GAAO,YAAY,YAGhDN,EAAO,aAAa,GAAG,QAAQ,SAAS,IAAI,MAC9CE,EAAK,KAAK;AAAA,QACR,MAAAG;AAAA,QACA,OAAO;AAAA,UACL,MAAML,IAAS,mBAAmB,GAAG,QAAQK;AAAA,UAC7C,GAAGL,IAAS,mBAAmB;AAAA,QAAA;AAAA,QAEjC,QAAAA;AAAAA,MAAA,CACD;AAAA,IAEL,CAAC;AAAA,EACH,GAAG;AAAA,IACD,iBAAiB;AAAA,EAAA,CAClB,GAEME;AACT;"}
1
+ {"version":3,"file":"hooks.mjs","sources":["../../src/form-tab/hooks.ts"],"sourcesContent":["import type { Schema, SchemaKey } from '@formily/json-schema'\nimport { observable, reaction } from '@formily/reactive'\nimport { useField, useFieldSchema } from '@silver-formily/vue'\n\nexport type Tabs = { name: SchemaKey, props: any, schema: Schema }[]\n\nexport function useTabs() {\n const tabsField = useField()\n const schema = useFieldSchema()\n const tabs: Tabs = observable([])\n reaction(() => {\n const tabDisplayStatus = schema.value?.mapProperties((schema, name) => {\n const field = tabsField.value\n .query(tabsField.value.address.concat(name))\n .take()\n return field?.display\n })\n return tabDisplayStatus\n }, () => {\n tabs.length = 0\n schema.value?.mapProperties((schema, name) => {\n const field = tabsField.value\n .query(tabsField.value.address.concat(name))\n .take()\n if (field?.display === 'none' || field?.display === 'hidden')\n return\n\n if (schema['x-component']?.indexOf('TabPane') > -1) {\n tabs.push({\n name,\n props: {\n name: schema?.['x-component-props']?.name || name,\n ...schema?.['x-component-props'],\n },\n schema,\n })\n }\n })\n }, {\n fireImmediately: true,\n })\n\n return tabs\n}\n"],"names":["useTabs","tabsField","useField","schema","useFieldSchema","tabs","observable","reaction","name","field"],"mappings":";;AAMO,SAASA,IAAU;AACxB,QAAMC,IAAYC,EAAA,GACZC,IAASC,EAAA,GACTC,IAAaC,EAAW,EAAE;AAChC,SAAAC,EAAS,MACkBJ,EAAO,OAAO,cAAc,CAACA,GAAQK,MAC9CP,EAAU,MACrB,MAAMA,EAAU,MAAM,QAAQ,OAAOO,CAAI,CAAC,EAC1C,KAAA,GACW,OACf,GAEA,MAAM;AACP,IAAAH,EAAK,SAAS,GACdF,EAAO,OAAO,cAAc,CAACA,GAAQK,MAAS;AAC5C,YAAMC,IAAQR,EAAU,MACrB,MAAMA,EAAU,MAAM,QAAQ,OAAOO,CAAI,CAAC,EAC1C,KAAA;AACH,MAAIC,GAAO,YAAY,UAAUA,GAAO,YAAY,YAGhDN,EAAO,aAAa,GAAG,QAAQ,SAAS,IAAI,MAC9CE,EAAK,KAAK;AAAA,QACR,MAAAG;AAAA,QACA,OAAO;AAAA,UACL,MAAML,IAAS,mBAAmB,GAAG,QAAQK;AAAA,UAC7C,GAAGL,IAAS,mBAAmB;AAAA,QAAA;AAAA,QAEjC,QAAAA;AAAAA,MAAA,CACD;AAAA,IAEL,CAAC;AAAA,EACH,GAAG;AAAA,IACD,iBAAiB;AAAA,EAAA,CAClB,GAEME;AACT;"}