@silver-formily/element-plus 4.0.3 → 5.0.1

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 (150) hide show
  1. package/esm/__builtins__/shared/loading.mjs.map +1 -1
  2. package/esm/__builtins__/shared/transform-component.mjs +1 -1
  3. package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
  4. package/esm/__builtins__/shared/utils.mjs +7 -5
  5. package/esm/__builtins__/shared/utils.mjs.map +1 -1
  6. package/esm/array-base/array-base-inner.mjs.map +1 -1
  7. package/esm/array-base/array-base-move-down.mjs +1 -1
  8. package/esm/array-base/array-base-move-down.mjs.map +1 -1
  9. package/esm/array-base/array-base-move-up.mjs +1 -1
  10. package/esm/array-base/array-base-move-up.mjs.map +1 -1
  11. package/esm/array-base/array-base-remove.mjs +1 -1
  12. package/esm/array-base/array-base-remove.mjs.map +1 -1
  13. package/esm/array-base/types.d.ts +2 -2
  14. package/esm/array-base/utils.d.ts +1 -1
  15. package/esm/array-base/utils.mjs +1 -1
  16. package/esm/array-base/utils.mjs.map +1 -1
  17. package/esm/array-cards/array-cards.mjs +1 -1
  18. package/esm/array-cards/array-cards.mjs.map +1 -1
  19. package/esm/array-collapse/array-collapse-item.mjs +1 -1
  20. package/esm/array-collapse/array-collapse-item.mjs.map +1 -1
  21. package/esm/array-collapse/array-collapse.mjs +3 -4
  22. package/esm/array-collapse/array-collapse.mjs.map +1 -1
  23. package/esm/array-items/array-items.mjs +3 -8
  24. package/esm/array-items/array-items.mjs.map +1 -1
  25. package/esm/array-list-tabs/array-list-tabs.mjs +57 -51
  26. package/esm/array-list-tabs/array-list-tabs.mjs.map +1 -1
  27. package/esm/array-list-tabs/utils.mjs.map +1 -1
  28. package/esm/array-table/array-table.mjs +4 -18
  29. package/esm/array-table/array-table.mjs.map +1 -1
  30. package/esm/array-table/utils.mjs.map +1 -1
  31. package/esm/array-tabs/array-tabs.mjs +1 -1
  32. package/esm/array-tabs/array-tabs.mjs.map +1 -1
  33. package/esm/autocomplete/autocomplete.mjs.map +1 -1
  34. package/esm/autocomplete/index.d.ts +1 -41
  35. package/esm/cascader/index.d.ts +1 -31
  36. package/esm/checkbox/checkbox-group.mjs +1 -1
  37. package/esm/checkbox/checkbox-group.mjs.map +1 -1
  38. package/esm/checkbox/index.d.ts +1 -819
  39. package/esm/color-picker/index.d.ts +1 -210
  40. package/esm/color-picker-panel/index.d.ts +1 -130
  41. package/esm/date-picker/index.d.ts +1 -447
  42. package/esm/date-picker-panel/index.d.ts +1 -147
  43. package/esm/editable/editable-popover.mjs +1 -1
  44. package/esm/editable/editable-popover.mjs.map +1 -1
  45. package/esm/editable/editable.mjs +1 -1
  46. package/esm/editable/editable.mjs.map +1 -1
  47. package/esm/editable/index.d.ts +1 -60
  48. package/esm/form/form.mjs.map +1 -1
  49. package/esm/form/form.vue.d.ts +1 -1
  50. package/esm/form-collapse/form-collapse.mjs +1 -1
  51. package/esm/form-collapse/form-collapse.mjs.map +1 -1
  52. package/esm/form-collapse/index.d.ts +3 -3
  53. package/esm/form-collapse/utils.d.ts +2 -2
  54. package/esm/form-collapse/utils.mjs +2 -2
  55. package/esm/form-collapse/utils.mjs.map +1 -1
  56. package/esm/form-dialog/dialog-content.mjs +1 -1
  57. package/esm/form-dialog/dialog-content.mjs.map +1 -1
  58. package/esm/form-dialog/index.mjs +3 -3
  59. package/esm/form-dialog/index.mjs.map +1 -1
  60. package/esm/form-dialog/types.d.ts +2 -2
  61. package/esm/form-drawer/drawer-content.mjs +1 -1
  62. package/esm/form-drawer/drawer-content.mjs.map +1 -1
  63. package/esm/form-drawer/index.mjs +3 -3
  64. package/esm/form-drawer/index.mjs.map +1 -1
  65. package/esm/form-drawer/types.d.ts +2 -2
  66. package/esm/form-item/form-item.mjs +1 -1
  67. package/esm/form-item/form-item.mjs.map +1 -1
  68. package/esm/form-item/index.d.ts +1 -83
  69. package/esm/form-item/index.mjs +1 -1
  70. package/esm/form-item/index.mjs.map +1 -1
  71. package/esm/form-item/utils.mjs +1 -1
  72. package/esm/form-item/utils.mjs.map +1 -1
  73. package/esm/form-layout/form-layout.mjs +1 -1
  74. package/esm/form-layout/form-layout.mjs.map +1 -1
  75. package/esm/form-layout/form-layout.vue.d.ts +1 -1
  76. package/esm/form-layout/utils.mjs +1 -1
  77. package/esm/form-layout/utils.mjs.map +1 -1
  78. package/esm/form-step/form-step.mjs +1 -1
  79. package/esm/form-step/form-step.mjs.map +1 -1
  80. package/esm/form-step/types.d.ts +1 -1
  81. package/esm/form-step/utils.d.ts +1 -1
  82. package/esm/form-step/utils.mjs +1 -1
  83. package/esm/form-step/utils.mjs.map +1 -1
  84. package/esm/form-tab/hooks.mjs.map +1 -1
  85. package/esm/form-tab/utils.mjs +1 -1
  86. package/esm/form-tab/utils.mjs.map +1 -1
  87. package/esm/input/index.d.ts +1 -43
  88. package/esm/input-number/index.d.ts +1 -328
  89. package/esm/input-tag/index.d.ts +1 -26
  90. package/esm/input-tag/input-tag.mjs.map +1 -1
  91. package/esm/mention/index.d.ts +1 -36
  92. package/esm/mention/mention.mjs.map +1 -1
  93. package/esm/pagination/components/pager2.mjs.map +1 -1
  94. package/esm/pagination/components/sizes2.mjs +1 -1
  95. package/esm/pagination/components/sizes2.mjs.map +1 -1
  96. package/esm/password/index.d.ts +1 -42
  97. package/esm/picker-select/index.d.ts +1 -41
  98. package/esm/picker-select/picker-select.mjs +1 -1
  99. package/esm/picker-select/picker-select.mjs.map +1 -1
  100. package/esm/picker-select/types.d.ts +1 -1
  101. package/esm/preview-text/cascader.mjs.map +1 -1
  102. package/esm/preview-text/color-picker.mjs +1 -1
  103. package/esm/preview-text/color-picker.mjs.map +1 -1
  104. package/esm/preview-text/input.mjs +1 -1
  105. package/esm/preview-text/input.mjs.map +1 -1
  106. package/esm/preview-text/rate.mjs +1 -1
  107. package/esm/preview-text/rate.mjs.map +1 -1
  108. package/esm/preview-text/select.mjs +1 -1
  109. package/esm/preview-text/select.mjs.map +1 -1
  110. package/esm/preview-text/time-picker.mjs +1 -1
  111. package/esm/preview-text/time-picker.mjs.map +1 -1
  112. package/esm/preview-text/tree.mjs.map +1 -1
  113. package/esm/query-form/hooks.mjs +1 -1
  114. package/esm/query-form/hooks.mjs.map +1 -1
  115. package/esm/query-form/index.d.ts +5 -5
  116. package/esm/query-form/query-form-light.mjs +1 -1
  117. package/esm/query-form/query-form-light.mjs.map +1 -1
  118. package/esm/query-form/query-form.mjs +1 -1
  119. package/esm/query-form/query-form.mjs.map +1 -1
  120. package/esm/query-form/types.d.ts +2 -2
  121. package/esm/query-form-item/index.d.ts +1 -152
  122. package/esm/query-form-item/query-form-item.mjs +2 -2
  123. package/esm/query-form-item/query-form-item.mjs.map +1 -1
  124. package/esm/query-form-item/types.d.ts +2 -2
  125. package/esm/radio/index.d.ts +67 -121
  126. package/esm/radio/radio-group.mjs +1 -1
  127. package/esm/radio/radio-group.mjs.map +1 -1
  128. package/esm/rate/index.d.ts +1 -186
  129. package/esm/segmented/index.d.ts +1 -28
  130. package/esm/select/index.d.ts +1 -112
  131. package/esm/select-table/index.d.ts +1 -61
  132. package/esm/select-table/select-table.mjs +1 -1
  133. package/esm/select-table/select-table.mjs.map +1 -1
  134. package/esm/slider/index.d.ts +1 -178
  135. package/esm/submit/submit.mjs.map +1 -1
  136. package/esm/switch/index.d.ts +1 -298
  137. package/esm/time-picker/index.d.ts +1 -446
  138. package/esm/time-select/index.d.ts +1 -188
  139. package/esm/transfer/index.d.ts +1 -268
  140. package/esm/tree/index.d.ts +1 -45
  141. package/esm/tree/tree.mjs +1 -1
  142. package/esm/tree/tree.mjs.map +1 -1
  143. package/esm/tree-select/index.d.ts +1 -19
  144. package/esm/tree-select/tree-select.mjs.map +1 -1
  145. package/esm/upload/index.d.ts +1 -129
  146. package/esm/upload/upload.mjs +1 -1
  147. package/esm/upload/upload.mjs.map +1 -1
  148. package/package.json +18 -14
  149. package/esm/select-table/types.d.ts +0 -22
  150. package/esm/tree/types.d.ts +0 -18
@@ -1,91 +1,9 @@
1
1
  import { IFormItemProps } from "./types.js";
2
2
  import { _default } from "./form-item.vue.js";
3
- import * as _$element_plus0 from "element-plus";
4
- import * as _$vue from "vue";
5
3
 
6
4
  //#region src/form-item/index.d.ts
7
5
  declare function fieldFeedbackMapper(props: any, field: any): any;
8
- declare const FormItem: {
9
- new (...args: any[]): _$vue.CreateComponentPublicInstanceWithMixins<Readonly<IFormItemProps> & Readonly<{}>, {
10
- feedbackTooltipRef: _$vue.Ref<_$element_plus0.TooltipInstance, _$element_plus0.TooltipInstance>;
11
- }, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, _$vue.PublicProps, {
12
- asterisk: boolean;
13
- colon: boolean;
14
- labelWrap: boolean;
15
- fullness: boolean;
16
- }, true, {}, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, {}, any, _$vue.ComponentProvideOptions, {
17
- P: {};
18
- B: {};
19
- D: {};
20
- C: {};
21
- M: {};
22
- Defaults: {};
23
- }, Readonly<IFormItemProps> & Readonly<{}>, {
24
- feedbackTooltipRef: _$vue.Ref<_$element_plus0.TooltipInstance, _$element_plus0.TooltipInstance>;
25
- }, {}, {}, {}, {
26
- asterisk: boolean;
27
- colon: boolean;
28
- labelWrap: boolean;
29
- fullness: boolean;
30
- }>;
31
- __isFragment?: never;
32
- __isTeleport?: never;
33
- __isSuspense?: never;
34
- } & _$vue.ComponentOptionsBase<Readonly<IFormItemProps> & Readonly<{}>, {
35
- feedbackTooltipRef: _$vue.Ref<_$element_plus0.TooltipInstance, _$element_plus0.TooltipInstance>;
36
- }, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, {
37
- asterisk: boolean;
38
- colon: boolean;
39
- labelWrap: boolean;
40
- fullness: boolean;
41
- }, {}, string, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, _$vue.ComponentProvideOptions> & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps & (new () => {
42
- $slots: {
43
- default?: (props: {}) => any;
44
- } & {
45
- default?: (props: {}) => any;
46
- };
47
- }) & {
48
- BaseItem: {
49
- new (...args: any[]): _$vue.CreateComponentPublicInstanceWithMixins<Readonly<IFormItemProps> & Readonly<{}>, {
50
- feedbackTooltipRef: _$vue.Ref<_$element_plus0.TooltipInstance, _$element_plus0.TooltipInstance>;
51
- }, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, _$vue.PublicProps, {
52
- asterisk: boolean;
53
- colon: boolean;
54
- labelWrap: boolean;
55
- fullness: boolean;
56
- }, true, {}, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, {}, any, _$vue.ComponentProvideOptions, {
57
- P: {};
58
- B: {};
59
- D: {};
60
- C: {};
61
- M: {};
62
- Defaults: {};
63
- }, Readonly<IFormItemProps> & Readonly<{}>, {
64
- feedbackTooltipRef: _$vue.Ref<_$element_plus0.TooltipInstance, _$element_plus0.TooltipInstance>;
65
- }, {}, {}, {}, {
66
- asterisk: boolean;
67
- colon: boolean;
68
- labelWrap: boolean;
69
- fullness: boolean;
70
- }>;
71
- __isFragment?: never;
72
- __isTeleport?: never;
73
- __isSuspense?: never;
74
- } & _$vue.ComponentOptionsBase<Readonly<IFormItemProps> & Readonly<{}>, {
75
- feedbackTooltipRef: _$vue.Ref<_$element_plus0.TooltipInstance, _$element_plus0.TooltipInstance>;
76
- }, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, {
77
- asterisk: boolean;
78
- colon: boolean;
79
- labelWrap: boolean;
80
- fullness: boolean;
81
- }, {}, string, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, _$vue.ComponentProvideOptions> & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps & (new () => {
82
- $slots: {
83
- default?: (props: {}) => any;
84
- } & {
85
- default?: (props: {}) => any;
86
- };
87
- });
88
- };
6
+ declare const FormItem: any;
89
7
  //#endregion
90
8
  export { FormItem, fieldFeedbackMapper };
91
9
  //# sourceMappingURL=index.d.ts.map
@@ -2,7 +2,7 @@ import { composeExport } from "../__builtins__/shared/utils.mjs";
2
2
  import _sfc_main from "./form-item.mjs";
3
3
  import { determineFeedbackStatus, getFeedbackMessage } from "./utils.mjs";
4
4
  import "./style.css";
5
- import { isVoidField } from "@formily/core";
5
+ import { isVoidField } from "@silver-formily/core";
6
6
  import { connect, mapProps } from "@silver-formily/vue";
7
7
  //#region src/form-item/index.ts
8
8
  function fieldFeedbackMapper(props, field) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["FormBaseItem"],"sources":["../../src/form-item/index.ts"],"sourcesContent":["import { isVoidField } from '@formily/core'\nimport { connect, mapProps } from '@silver-formily/vue'\nimport { composeExport } from '../__builtins__'\nimport FormBaseItem from './form-item.vue'\nimport { determineFeedbackStatus, getFeedbackMessage } from './utils'\nimport './style.scss'\n\nexport function fieldFeedbackMapper(props, field) {\n if (isVoidField(field) || !field) {\n return props\n }\n\n const feedbackText = getFeedbackMessage(field)\n const feedbackStatus = determineFeedbackStatus(field)\n const asterisk = 'asterisk' in props\n ? props.asterisk\n : field.required && field.pattern !== 'readPretty'\n\n return {\n ...props,\n feedbackText,\n feedbackStatus,\n asterisk,\n }\n}\n\nconst Item = connect<typeof FormBaseItem>(\n FormBaseItem,\n mapProps(\n {\n validateStatus: true,\n title: 'label',\n required: true,\n description: 'extra',\n },\n fieldFeedbackMapper,\n ),\n)\n\nexport const FormItem = composeExport(Item, {\n BaseItem: FormBaseItem,\n})\n\nexport default FormItem\n\nexport { default as FormBaseItem } from './form-item.vue'\nexport type { IFormItemProps } from './types'\n"],"mappings":";;;;;;;AAOA,SAAgB,oBAAoB,OAAO,OAAO;AAChD,KAAI,YAAY,MAAM,IAAI,CAAC,MACzB,QAAO;CAGT,MAAM,eAAe,mBAAmB,MAAM;CAC9C,MAAM,iBAAiB,wBAAwB,MAAM;CACrD,MAAM,WAAW,cAAc,QAC3B,MAAM,WACN,MAAM,YAAY,MAAM,YAAY;AAExC,QAAO;EACL,GAAG;EACH;EACA;EACA;EACD;;AAgBH,MAAa,WAAW,cAbX,QACXA,WACA,SACE;CACE,gBAAgB;CAChB,OAAO;CACP,UAAU;CACV,aAAa;CACd,EACD,oBACD,CACF,EAE2C,EAC1C,UAAUA,WACX,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":["FormBaseItem"],"sources":["../../src/form-item/index.ts"],"sourcesContent":["import { isVoidField } from '@silver-formily/core'\nimport { connect, mapProps } from '@silver-formily/vue'\nimport { composeExport } from '../__builtins__'\nimport FormBaseItem from './form-item.vue'\nimport { determineFeedbackStatus, getFeedbackMessage } from './utils'\nimport './style.scss'\n\nexport function fieldFeedbackMapper(props, field) {\n if (isVoidField(field) || !field) {\n return props\n }\n\n const feedbackText = getFeedbackMessage(field)\n const feedbackStatus = determineFeedbackStatus(field)\n const asterisk = 'asterisk' in props\n ? props.asterisk\n : field.required && field.pattern !== 'readPretty'\n\n return {\n ...props,\n feedbackText,\n feedbackStatus,\n asterisk,\n }\n}\n\nconst Item = connect<typeof FormBaseItem>(\n FormBaseItem,\n mapProps(\n {\n validateStatus: true,\n title: 'label',\n required: true,\n description: 'extra',\n },\n fieldFeedbackMapper,\n ),\n)\n\nexport const FormItem = composeExport(Item, {\n BaseItem: FormBaseItem,\n})\n\nexport default FormItem\n\nexport { default as FormBaseItem } from './form-item.vue'\nexport type { IFormItemProps } from './types'\n"],"mappings":";;;;;;;AAOA,SAAgB,oBAAoB,OAAO,OAAO;AAChD,KAAI,YAAY,MAAM,IAAI,CAAC,MACzB,QAAO;CAGT,MAAM,eAAe,mBAAmB,MAAM;CAC9C,MAAM,iBAAiB,wBAAwB,MAAM;CACrD,MAAM,WAAW,cAAc,QAC3B,MAAM,WACN,MAAM,YAAY,MAAM,YAAY;AAExC,QAAO;EACL,GAAG;EACH;EACA;EACA;EACD;;AAgBH,MAAa,WAAW,cAbX,QACXA,WACA,SACE;CACE,gBAAgB;CAChB,OAAO;CACP,UAAU;CACV,aAAa;CACd,EACD,oBACD,CACF,EAE2C,EAC1C,UAAUA,WACX,CAAC"}
@@ -1,4 +1,4 @@
1
- import { isArr } from "@formily/shared";
1
+ import { isArr } from "@silver-formily/shared";
2
2
  //#region src/form-item/utils.ts
3
3
  function getFeedbackMessage(field) {
4
4
  const messages = {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","names":[],"sources":["../../src/form-item/utils.ts"],"sourcesContent":["import type { Field } from '@formily/core'\nimport { isArr } from '@formily/shared'\n\nexport function getFeedbackMessage(field: Field) {\n const messages = {\n errors: field.selfErrors.join(', '),\n warnings: field.selfWarnings.join(', '),\n successes: field.selfSuccesses.join(', '),\n }\n\n return messages.errors || messages.warnings || messages.successes\n}\n\nexport function determineFeedbackStatus(field: Field) {\n return isArr(field.decorator)\n ? (field.decorator[1]?.feedbackStatus ?? field.validateStatus)\n : field.validateStatus\n}\n"],"mappings":";;AAGA,SAAgB,mBAAmB,OAAc;CAC/C,MAAM,WAAW;EACf,QAAQ,MAAM,WAAW,KAAK,KAAK;EACnC,UAAU,MAAM,aAAa,KAAK,KAAK;EACvC,WAAW,MAAM,cAAc,KAAK,KAAK;EAC1C;AAED,QAAO,SAAS,UAAU,SAAS,YAAY,SAAS;;AAG1D,SAAgB,wBAAwB,OAAc;AACpD,QAAO,MAAM,MAAM,UAAU,GACxB,MAAM,UAAU,IAAI,kBAAkB,MAAM,iBAC7C,MAAM"}
1
+ {"version":3,"file":"utils.mjs","names":[],"sources":["../../src/form-item/utils.ts"],"sourcesContent":["import type { Field } from '@silver-formily/core'\nimport { isArr } from '@silver-formily/shared'\n\nexport function getFeedbackMessage(field: Field) {\n const messages = {\n errors: field.selfErrors.join(', '),\n warnings: field.selfWarnings.join(', '),\n successes: field.selfSuccesses.join(', '),\n }\n\n return messages.errors || messages.warnings || messages.successes\n}\n\nexport function determineFeedbackStatus(field: Field) {\n return isArr(field.decorator)\n ? (field.decorator[1]?.feedbackStatus ?? field.validateStatus)\n : field.validateStatus\n}\n"],"mappings":";;AAGA,SAAgB,mBAAmB,OAAc;CAC/C,MAAM,WAAW;EACf,QAAQ,MAAM,WAAW,KAAK,KAAK;EACnC,UAAU,MAAM,aAAa,KAAK,KAAK;EACvC,WAAW,MAAM,cAAc,KAAK,KAAK;EAC1C;AAED,QAAO,SAAS,UAAU,SAAS,YAAY,SAAS;;AAG1D,SAAgB,wBAAwB,OAAc;AACpD,QAAO,MAAM,MAAM,UAAU,GACxB,MAAM,UAAU,IAAI,kBAAkB,MAAM,iBAC7C,MAAM"}
@@ -4,7 +4,7 @@ import { filterValidFormLayoutProps, formLayoutDeepContext, formLayoutIdContext,
4
4
  import { formContextKey, useId } from "element-plus";
5
5
  import { useThrottleFn } from "@vueuse/core";
6
6
  import { computed, createBlock, defineComponent, mergeProps, openBlock, provide, reactive, ref, renderSlot, resolveDynamicComponent, toRef, unref, watch, withCtx, withModifiers } from "vue";
7
- import { isEmpty, isValid } from "@formily/shared";
7
+ import { isEmpty, isValid } from "@silver-formily/shared";
8
8
  //#region src/form-layout/form-layout.vue
9
9
  const _sfc_main = /* @__PURE__ */ defineComponent({
10
10
  name: "FFormLayout",
@@ -1 +1 @@
1
- {"version":3,"file":"form-layout.mjs","names":[],"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 { useThrottleFn } from '@vueuse/core'\nimport { formContextKey, useId } from 'element-plus'\nimport { computed, provide, reactive, ref, toRef, watch } from 'vue'\nimport { stylePrefix, useCleanAttrs } 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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeA,MAAM,QAAQ;EAWd,MAAM,gBAAgB,GAAG,YAAY;EACrC,MAAM,EAAE,OAAO,UAAU,eAAc;EACvC,MAAM,cAAc,KAAiB;EACrC,MAAM,YAAY,MAAM,QAAQ;EAChC,MAAM,mBAAmB,OAAM;EAC/B,MAAM,eAAe,eAAe,MAAM,MAAM,MAAM,WAAW,iBAAiB,QAAO;EACzF,MAAM,kBAAkB,eAAgB,YAAY,aAAa,QAAQ,MAAM,MAAM,GAAG;AACxF,MAAI,UACF,SAAQ,qBAAqB,aAAY;EAG3C,MAAM,uBAAuB,mBAAkB;EAC/C,MAAM,EAAE,OAAO,oBAAoB,wBAAwB,OAAO,YAAW;AAW7E,UAAQ,uBATW,IAAI;GACrB,GAAG,qBAAqB;GACxB,GAAI,MAAM,UACN;IACE,MAAM,MAAM;IACZ,GAAI,QAAQ,MAAM,MAAM,IAAI,EAAE,OAAO,MAAM,OAAO;IACpD,GACA,2BAA2B,MAAM;GACtC,CAAA,CACwC;EAEzC,MAAM,gBAAgB,IAAI,MAAM,UAAU,2BAA2B,MAAM,GAAG,EAAE,CAAA;AAChF,UAAQ,0BAA0B,cAAa;AAS/C,cAAY,CAAC,OAAO,gBAAgB,EAPf,oBAAoB;AACvC,OAAI,CAAC,QAAQ,gBAAgB,MAAM,EAAE;IACnC,MAAM,mBAAmB,2BAA2B,gBAAgB,MAAK;AACzE,kBAAc,QAAQ,2BAA2B;KAAE,GAAG;KAAO,GAAG;KAAkB,CAAA;;KAEnF,KAAK,KAAI,EAEwC;GAClD,MAAM;GACN,WAAW;GACZ,CAAA;AAQD,UAAQ,gBANY,SAAS;GAC3B,MAAM,MAAM,OAAO,OAAO;GAC1B,YAAY,MAAM,OAAO,aAAa;GACtC,sBAAsB,MAAM,OAAO,uBAAuB;GAC1D,yBAAyB,MAAM,OAAO,0BAA0B;GACjE,CAAA,CACiD;;uBAIhD,YASY,wBARL,MAAM,IAAG,EADhB,WASY;IAPT,IAAI,gBAAA;aACD;IAAJ,KAAI;IACH,OAAO;MACA,MAAA,MAAK,EAAA,EACZ,UAAM,OAAA,OAAA,OAAA,KAAA,oBAAP,IAAoB,CAAA,WAAA,OAAA,CAAA,GAAA,CAAA,EAAA;2BAEZ,CAAR,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"form-layout.mjs","names":[],"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 '@silver-formily/shared'\nimport { useThrottleFn } from '@vueuse/core'\nimport { formContextKey, useId } from 'element-plus'\nimport { computed, provide, reactive, ref, toRef, watch } from 'vue'\nimport { stylePrefix, useCleanAttrs } 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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeA,MAAM,QAAQ;EAWd,MAAM,gBAAgB,GAAG,YAAY;EACrC,MAAM,EAAE,OAAO,UAAU,eAAc;EACvC,MAAM,cAAc,KAAiB;EACrC,MAAM,YAAY,MAAM,QAAQ;EAChC,MAAM,mBAAmB,OAAM;EAC/B,MAAM,eAAe,eAAe,MAAM,MAAM,MAAM,WAAW,iBAAiB,QAAO;EACzF,MAAM,kBAAkB,eAAgB,YAAY,aAAa,QAAQ,MAAM,MAAM,GAAG;AACxF,MAAI,UACF,SAAQ,qBAAqB,aAAY;EAG3C,MAAM,uBAAuB,mBAAkB;EAC/C,MAAM,EAAE,OAAO,oBAAoB,wBAAwB,OAAO,YAAW;AAW7E,UAAQ,uBATW,IAAI;GACrB,GAAG,qBAAqB;GACxB,GAAI,MAAM,UACN;IACE,MAAM,MAAM;IACZ,GAAI,QAAQ,MAAM,MAAM,IAAI,EAAE,OAAO,MAAM,OAAO;IACpD,GACA,2BAA2B,MAAM;GACtC,CAAA,CACwC;EAEzC,MAAM,gBAAgB,IAAI,MAAM,UAAU,2BAA2B,MAAM,GAAG,EAAE,CAAA;AAChF,UAAQ,0BAA0B,cAAa;AAS/C,cAAY,CAAC,OAAO,gBAAgB,EAPf,oBAAoB;AACvC,OAAI,CAAC,QAAQ,gBAAgB,MAAM,EAAE;IACnC,MAAM,mBAAmB,2BAA2B,gBAAgB,MAAK;AACzE,kBAAc,QAAQ,2BAA2B;KAAE,GAAG;KAAO,GAAG;KAAkB,CAAA;;KAEnF,KAAK,KAAI,EAEwC;GAClD,MAAM;GACN,WAAW;GACZ,CAAA;AAQD,UAAQ,gBANY,SAAS;GAC3B,MAAM,MAAM,OAAO,OAAO;GAC1B,YAAY,MAAM,OAAO,aAAa;GACtC,sBAAsB,MAAM,OAAO,uBAAuB;GAC1D,yBAAyB,MAAM,OAAO,0BAA0B;GACjE,CAAA,CACiD;;uBAIhD,YASY,wBARL,MAAM,IAAG,EADhB,WASY;IAPT,IAAI,gBAAA;aACD;IAAJ,KAAI;IACH,OAAO;MACA,MAAA,MAAK,EAAA,EACZ,UAAM,OAAA,OAAA,OAAA,KAAA,oBAAP,IAAoB,CAAA,WAAA,OAAA,CAAA,GAAA,CAAA,EAAA;2BAEZ,CAAR,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA"}
@@ -9,10 +9,10 @@ type __VLS_Slots = {} & {
9
9
  declare const __VLS_base: _$vue.DefineComponent<IFormLayoutProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<IFormLayoutProps> & Readonly<{}>, {
10
10
  layout: "vertical" | "horizontal" | "inline" | ("vertical" | "horizontal" | "inline")[];
11
11
  size: "small" | "default" | "large";
12
- tag: string;
13
12
  colon: boolean;
14
13
  labelWrap: boolean;
15
14
  fullness: boolean;
15
+ tag: string;
16
16
  shallow: boolean;
17
17
  statusIcon: boolean;
18
18
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
@@ -1,6 +1,6 @@
1
1
  import { useResizeObserver } from "@vueuse/core";
2
2
  import { computed, inject, ref } from "vue";
3
- import { isArr, isValid } from "@formily/shared";
3
+ import { isArr, isValid } from "@silver-formily/shared";
4
4
  //#region src/form-layout/utils.ts
5
5
  function calcBreakpointIndex(breakpoints, width) {
6
6
  for (const [i, breakpoint] of breakpoints.entries()) if (width <= breakpoint) return i;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","names":[],"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 { useResizeObserver } from '@vueuse/core'\nimport { computed, inject, ref } from 'vue'\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)\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"],"mappings":";;;;AAMA,SAAgB,oBAAoB,aAAuB,OAAuB;AAChF,MAAK,MAAM,CAAC,GAAG,eAAe,YAAY,SAAS,CACjD,KAAI,SAAS,WACX,QAAO;AAGX,QAAO;;AAGT,SAAgB,WAAc,OAAyB,iBAA4B;AACjF,KAAI,CAAC,MAAM,QAAQ,MAAM,IAAI,MAAM,WAAW,EAC5C,QAAO;CAET,MAAM,YAAY,KAAK,IAAI,IAAI,KAAK,IAAI,iBAAiB,MAAM,SAAS,EAAE,CAAC;AAC3E,QAAO,MAAM,GAAG,UAAU;;AAG5B,SAAgB,OAAU,OAAgB,iBAA4B;AACpE,QAAO,QAAQ,MAAM,GAAG,WAAc,OAAO,gBAAgB,GAAG;;AAGlE,SAAgB,eAAe,QAAiB,OAA2C;CACzF,MAAM,EAAE,gBAAgB;CACxB,MAAM,EACJ,aACA,QACA,YACA,cACA,UACA,YACA,GAAG,eACD;CACJ,MAAM,kBAAkB,oBACtB,aACA,YACD;AAED,QAAO;EACL,QAAQ,OAAO,QAAQ,gBAAgB;EACvC,YAAY,OAAO,YAAY,gBAAgB;EAC/C,cAAc,OAAO,cAAc,gBAAgB;EACnD,UAAU,OAAO,UAAU,gBAAgB;EAC3C,YAAY,OAAO,YAAY,gBAAgB;EAC/C,GAAG;EACJ;;AAGH,SAAgB,wBAAwB,OAAyB,MAA+B;CAC9F,MAAM,EAAE,gBAAgB;AACxB,KAAI,CAAC,MAAM,YAAY,CACrB,QAAO,EACL,OAAO,IAAI,MAAM,EAClB;CAGH,MAAM,cAAc,IAAsB,EAAE,CAAC;AAE7C,mBAAkB,YAAY;AAC5B,cAAY,QAAQ,eAAe,KAAK,OAAO,MAAM;GACrD;AAEF,QAAO,EACL,OAAO,aACR;;AAGH,MAAa,wBAA6D,OACxE,wBACD;AAED,MAAa,2BACT,OAAO,2BAA2B;AAEtC,MAAa,sBACT,OAAO,sBAAsB;AAEjC,SAAgB,oBAA2C;AACzD,QAAO,OAAO,uBAAuB,IAAI,EAAE,CAAC,CAAC;;AAG/C,SAAgB,gBAAuC;CACrD,MAAM,gBAAgB,OAAO,0BAA0B,IAAI,EAAE,CAAC,CAAC;CAC/D,MAAM,aAAa,OAAO,uBAAuB,IAAI,EAAE,CAAC,CAAC;AASzD,QAPmB,eAAe;AAChC,SAAO;GACL,GAAG,WAAW;GACd,GAAG,cAAc;GAClB;GACD;;AAKJ,SAAgB,kBAAuC;AACrD,QAAO,OAAO,oBAAoB;;AAGpC,MAAa,yBAAgE;CAC3E;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAgB,2BAA2B,OAA2C;AACpF,QAAO,OAAO,YACZ,OAAO,QAAQ,MAAM,CAClB,QAAQ,CAAC,GAAG,WAAW,QAAQ,MAAM,CAAC,CAC1C"}
1
+ {"version":3,"file":"utils.mjs","names":[],"sources":["../../src/form-layout/utils.ts"],"sourcesContent":["import type { ComputedRef, InjectionKey, Ref } from 'vue'\nimport type { IFormLayoutProps } from './types'\nimport { isArr, isValid } from '@silver-formily/shared'\nimport { useResizeObserver } from '@vueuse/core'\nimport { computed, inject, ref } from 'vue'\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)\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"],"mappings":";;;;AAMA,SAAgB,oBAAoB,aAAuB,OAAuB;AAChF,MAAK,MAAM,CAAC,GAAG,eAAe,YAAY,SAAS,CACjD,KAAI,SAAS,WACX,QAAO;AAGX,QAAO;;AAGT,SAAgB,WAAc,OAAyB,iBAA4B;AACjF,KAAI,CAAC,MAAM,QAAQ,MAAM,IAAI,MAAM,WAAW,EAC5C,QAAO;CAET,MAAM,YAAY,KAAK,IAAI,IAAI,KAAK,IAAI,iBAAiB,MAAM,SAAS,EAAE,CAAC;AAC3E,QAAO,MAAM,GAAG,UAAU;;AAG5B,SAAgB,OAAU,OAAgB,iBAA4B;AACpE,QAAO,QAAQ,MAAM,GAAG,WAAc,OAAO,gBAAgB,GAAG;;AAGlE,SAAgB,eAAe,QAAiB,OAA2C;CACzF,MAAM,EAAE,gBAAgB;CACxB,MAAM,EACJ,aACA,QACA,YACA,cACA,UACA,YACA,GAAG,eACD;CACJ,MAAM,kBAAkB,oBACtB,aACA,YACD;AAED,QAAO;EACL,QAAQ,OAAO,QAAQ,gBAAgB;EACvC,YAAY,OAAO,YAAY,gBAAgB;EAC/C,cAAc,OAAO,cAAc,gBAAgB;EACnD,UAAU,OAAO,UAAU,gBAAgB;EAC3C,YAAY,OAAO,YAAY,gBAAgB;EAC/C,GAAG;EACJ;;AAGH,SAAgB,wBAAwB,OAAyB,MAA+B;CAC9F,MAAM,EAAE,gBAAgB;AACxB,KAAI,CAAC,MAAM,YAAY,CACrB,QAAO,EACL,OAAO,IAAI,MAAM,EAClB;CAGH,MAAM,cAAc,IAAsB,EAAE,CAAC;AAE7C,mBAAkB,YAAY;AAC5B,cAAY,QAAQ,eAAe,KAAK,OAAO,MAAM;GACrD;AAEF,QAAO,EACL,OAAO,aACR;;AAGH,MAAa,wBAA6D,OACxE,wBACD;AAED,MAAa,2BACT,OAAO,2BAA2B;AAEtC,MAAa,sBACT,OAAO,sBAAsB;AAEjC,SAAgB,oBAA2C;AACzD,QAAO,OAAO,uBAAuB,IAAI,EAAE,CAAC,CAAC;;AAG/C,SAAgB,gBAAuC;CACrD,MAAM,gBAAgB,OAAO,0BAA0B,IAAI,EAAE,CAAC,CAAC;CAC/D,MAAM,aAAa,OAAO,uBAAuB,IAAI,EAAE,CAAC,CAAC;AASzD,QAPmB,eAAe;AAChC,SAAO;GACL,GAAG,WAAW;GACd,GAAG,cAAc;GAClB;GACD;;AAKJ,SAAgB,kBAAuC;AACrD,QAAO,OAAO,oBAAoB;;AAGpC,MAAa,yBAAgE;CAC3E;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAgB,2BAA2B,OAA2C;AACpF,QAAO,OAAO,YACZ,OAAO,QAAQ,MAAM,CAClB,QAAQ,CAAC,GAAG,WAAW,QAAQ,MAAM,CAAC,CAC1C"}
@@ -4,7 +4,7 @@ import { ElStep, ElSteps } from "element-plus";
4
4
  import { useObserver } from "@silver-formily/reactive-vue";
5
5
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createSlots, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, renderList, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
6
6
  import { RecursionField, useField, useFieldSchema } from "@silver-formily/vue";
7
- import { isObj } from "@formily/shared";
7
+ import { isObj } from "@silver-formily/shared";
8
8
  //#region src/form-step/form-step.vue
9
9
  const _sfc_main = /* @__PURE__ */ defineComponent({
10
10
  name: "FFormStep",
@@ -1 +1 @@
1
- {"version":3,"file":"form-step.mjs","names":["$attrs"],"sources":["../../src/form-step/form-step.vue"],"sourcesContent":["<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"],"mappings":";;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ;AAId,eAAY;EAEZ,MAAM,QAAQ,UAAqB,CAAC;EACpC,MAAM,YAAY,GAAG,YAAY;EAGjC,MAAM,QAAQ,WAFS,gBAAe,CAEE,MAAK;AAE7C,QAAM,SAAS,UAAU,OAAO,MAAK;EAErC,MAAM,UAAU,eAAe,MAAM,UAAU,MAAM,UAAU,WAAW,EAAC;;uBAIzE,mBA6CM,OAAA,EA7CA,OAAK,eAAE,UAAS,EAAA,EAAA,CACpB,YAmCU,MAAA,QAAA,EAnCV,WACUA,KAkCA,QAlCM;IACb,QAAQ,QAAA;IACR,OAAO,CAAA,EAAA,cAAA,QAAA,CAA0B;;2BAG8B,EAAA,UAAA,KAAA,EADhE,mBA6BS,UAAA,MAAA,WA5BiD,MAAA,MAAK,GAAA,EAAA,OAA5C,WAAS,OAAS,aAAa,QAAG;yBADrD,YA6BS,MAAA,OAAA,EA7BT,WA6BS,EA3BD,KAAG,EAAA,EAAA,SAAA,MAAA,EACD,UAAS,EAAA,YAAA,EAAA,GAAA,GAAA,EAAA;MAED,WAAW,QAAA;aAAQ;yBAGtB,CAFK,MAAA,MAAK,CAAC,UAAU,MAAK,IAAA,WAAA,EACnC,YAAmC,wBAAnB,UAAU,MAAK,EAAA,EAAA,KAAA,GAAA,CAAA,KAAA,WAAA,EAEjC,mBAEW,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAA,gBADN,UAAU,MAAK,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA;;;MAGN,WAAW,OAAA;aAAO;yBAGrB,CAFK,MAAA,MAAK,CAAC,UAAU,KAAI,IAAA,WAAA,EAClC,YAAkC,wBAAlB,UAAU,KAAI,EAAA,EAAA,KAAA,GAAA,CAAA,KAAA,WAAA,EAEhC,mBAEW,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAA,gBADN,UAAU,KAAI,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA;;;MAGL,WAAW,cAAA;aAAc;yBAG5B,CAFK,MAAA,MAAK,CAAC,UAAU,YAAW,IAAA,WAAA,EACzC,YAAyC,wBAAzB,UAAU,YAAW,EAAA,EAAA,KAAA,GAAA,CAAA,KAAA,WAAA,EAEvC,mBAEW,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAA,gBADN,UAAU,YAAW,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA;;;;;;yCAMhC,mBAMW,UAAA,MAAA,WANiC,MAAA,MAAK,GAAA,EAA7B,MAAM,UAAU,QAAG;4DAAkB,MAAI,EAAA,CAEnD,QAAQ,QAAA,SAAA,WAAA,EADhB,YAIE,MAAA,eAAA,EAAA;;KAFO;KACE"}
1
+ {"version":3,"file":"form-step.mjs","names":["$attrs"],"sources":["../../src/form-step/form-step.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { VoidField } from '@silver-formily/core'\nimport type { IFormStepProps } from './types'\nimport { useObserver } from '@silver-formily/reactive-vue'\nimport { isObj } from '@silver-formily/shared'\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"],"mappings":";;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ;AAId,eAAY;EAEZ,MAAM,QAAQ,UAAqB,CAAC;EACpC,MAAM,YAAY,GAAG,YAAY;EAGjC,MAAM,QAAQ,WAFS,gBAAe,CAEE,MAAK;AAE7C,QAAM,SAAS,UAAU,OAAO,MAAK;EAErC,MAAM,UAAU,eAAe,MAAM,UAAU,MAAM,UAAU,WAAW,EAAC;;uBAIzE,mBA6CM,OAAA,EA7CA,OAAK,eAAE,UAAS,EAAA,EAAA,CACpB,YAmCU,MAAA,QAAA,EAnCV,WACUA,KAkCA,QAlCM;IACb,QAAQ,QAAA;IACR,OAAO,CAAA,EAAA,cAAA,QAAA,CAA0B;;2BAG8B,EAAA,UAAA,KAAA,EADhE,mBA6BS,UAAA,MAAA,WA5BiD,MAAA,MAAK,GAAA,EAAA,OAA5C,WAAS,OAAS,aAAa,QAAG;yBADrD,YA6BS,MAAA,OAAA,EA7BT,WA6BS,EA3BD,KAAG,EAAA,EAAA,SAAA,MAAA,EACD,UAAS,EAAA,YAAA,EAAA,GAAA,GAAA,EAAA;MAED,WAAW,QAAA;aAAQ;yBAGtB,CAFK,MAAA,MAAK,CAAC,UAAU,MAAK,IAAA,WAAA,EACnC,YAAmC,wBAAnB,UAAU,MAAK,EAAA,EAAA,KAAA,GAAA,CAAA,KAAA,WAAA,EAEjC,mBAEW,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAA,gBADN,UAAU,MAAK,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA;;;MAGN,WAAW,OAAA;aAAO;yBAGrB,CAFK,MAAA,MAAK,CAAC,UAAU,KAAI,IAAA,WAAA,EAClC,YAAkC,wBAAlB,UAAU,KAAI,EAAA,EAAA,KAAA,GAAA,CAAA,KAAA,WAAA,EAEhC,mBAEW,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAA,gBADN,UAAU,KAAI,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA;;;MAGL,WAAW,cAAA;aAAc;yBAG5B,CAFK,MAAA,MAAK,CAAC,UAAU,YAAW,IAAA,WAAA,EACzC,YAAyC,wBAAzB,UAAU,YAAW,EAAA,EAAA,KAAA,GAAA,CAAA,KAAA,WAAA,EAEvC,mBAEW,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAA,gBADN,UAAU,YAAW,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA;;;;;;yCAMhC,mBAMW,UAAA,MAAA,WANiC,MAAA,MAAK,GAAA,EAA7B,MAAM,UAAU,QAAG;4DAAkB,MAAI,EAAA,CAEnD,QAAQ,QAAA,SAAA,WAAA,EADhB,YAIE,MAAA,eAAA,EAAA;;KAFO;KACE"}
@@ -1,5 +1,5 @@
1
1
  import { SchemaStep } from "./utils.js";
2
- import { Form, VoidField } from "@formily/core";
2
+ import { Form, VoidField } from "@silver-formily/core";
3
3
 
4
4
  //#region src/form-step/types.d.ts
5
5
  interface IFormStep {
@@ -1,6 +1,6 @@
1
1
  import { IFormStep } from "./types.js";
2
2
  import { Slots } from "vue";
3
- import { Schema, SchemaKey } from "@formily/json-schema";
3
+ import { Schema, SchemaKey } from "@silver-formily/json-schema";
4
4
 
5
5
  //#region src/form-step/utils.d.ts
6
6
  interface SchemaStep {
@@ -1,4 +1,4 @@
1
- import { action, model, observable } from "@formily/reactive";
1
+ import { action, model, observable } from "@silver-formily/reactive";
2
2
  //#region src/form-step/utils.ts
3
3
  function createFormStep(defaultCurrent = 0) {
4
4
  const env = observable({
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","names":[],"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"],"mappings":";;AAYA,SAAgB,eAAe,iBAAiB,GAAc;CAC5D,MAAM,MAAmB,WAAW;EAClC,MAAM;EACN,OAAO;EACP,OAAO,EAAE;EACV,CAAC;CAEF,MAAM,aAAa,OAAO,OAAO,WAAmB;EAClD,MAAM,cAAc,IAAI,MAAM;AAC9B,OAAK,MAAM,EAAE,UAAU,IAAI,MACzB,KAAI,KAAK,MAAM,GAAG,IAAI,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,UAAU;AAC7D,OAAI,SAAS,YAAY,KACvB,OAAM,WAAW,UAAU;OAG3B,OAAM,WAAW,SAAS;IAE5B;GAEJ;CAEF,MAAM,WAAsB,MAAM;EAChC,QAAQ,OAAO,OAAO;AACpB,OAAI,QAAQ;AACZ,OAAI,OAAO,OAAO;AAClB,OAAI,QAAQ;;EAEd,SAAS;EACT,WAAW,KAAa;AACtB,YAAS,UAAU;;EAErB,IAAI,YAAY;AACd,UAAO,SAAS,UAAU,IAAI,MAAM,SAAS;;EAE/C,IAAI,YAAY;AACd,UAAO,SAAS,UAAU;;EAE5B,MAAM,OAAO;AACX,OAAI;AACF,UAAM,IAAI,KAAK,UAAU;AAEzB,UAAM;WAEF;;EAER,MAAM,OAAO;AAEX,SAAM;;EAER,MAAM,OAAO,UAAU;AACrB,UAAO,IAAI,MAAM,SAAS,SAAS;;EAEtC,CAAC;CAEF,MAAM,OAAO,OAAO,YAAY;;AAE9B,MAAI,SAAS,WAAW;AACtB,cAAW,SAAS,UAAU,EAAE;AAChC,YAAS,WAAW,SAAS,UAAU,EAAE;;GAE3C;CAEF,MAAM,OAAO,OAAO,YAAY;;AAE9B,MAAI,SAAS,WAAW;AACtB,cAAW,SAAS,UAAU,EAAE;AAChC,YAAS,WAAW,SAAS,UAAU,EAAE;;GAE3C;AACF,QAAO;;AAGT,SAAgB,WAAW,QAAgB;CACzC,MAAM,QAAsB,EAAE;AAC9B,QAAO,eAAe,QAAQ,SAAS;;AAErC,MAAI,OAAO,gBAAgB,QAAQ,WAAW,GAAG,GAC/C,OAAM,KAAK;GACT;GACA,OAAO,OAAO;GACd;GACA,OAAO,OAAO;GACf,CAAC;GAEJ;AACF,QAAO"}
1
+ {"version":3,"file":"utils.mjs","names":[],"sources":["../../src/form-step/utils.ts"],"sourcesContent":["import type { Schema, SchemaKey } from '@silver-formily/json-schema'\nimport type { Slots } from 'vue'\nimport type { FormStepEnv, IFormStep } from './types'\nimport { action, model, observable } from '@silver-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"],"mappings":";;AAYA,SAAgB,eAAe,iBAAiB,GAAc;CAC5D,MAAM,MAAmB,WAAW;EAClC,MAAM;EACN,OAAO;EACP,OAAO,EAAE;EACV,CAAC;CAEF,MAAM,aAAa,OAAO,OAAO,WAAmB;EAClD,MAAM,cAAc,IAAI,MAAM;AAC9B,OAAK,MAAM,EAAE,UAAU,IAAI,MACzB,KAAI,KAAK,MAAM,GAAG,IAAI,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,UAAU;AAC7D,OAAI,SAAS,YAAY,KACvB,OAAM,WAAW,UAAU;OAG3B,OAAM,WAAW,SAAS;IAE5B;GAEJ;CAEF,MAAM,WAAsB,MAAM;EAChC,QAAQ,OAAO,OAAO;AACpB,OAAI,QAAQ;AACZ,OAAI,OAAO,OAAO;AAClB,OAAI,QAAQ;;EAEd,SAAS;EACT,WAAW,KAAa;AACtB,YAAS,UAAU;;EAErB,IAAI,YAAY;AACd,UAAO,SAAS,UAAU,IAAI,MAAM,SAAS;;EAE/C,IAAI,YAAY;AACd,UAAO,SAAS,UAAU;;EAE5B,MAAM,OAAO;AACX,OAAI;AACF,UAAM,IAAI,KAAK,UAAU;AAEzB,UAAM;WAEF;;EAER,MAAM,OAAO;AAEX,SAAM;;EAER,MAAM,OAAO,UAAU;AACrB,UAAO,IAAI,MAAM,SAAS,SAAS;;EAEtC,CAAC;CAEF,MAAM,OAAO,OAAO,YAAY;;AAE9B,MAAI,SAAS,WAAW;AACtB,cAAW,SAAS,UAAU,EAAE;AAChC,YAAS,WAAW,SAAS,UAAU,EAAE;;GAE3C;CAEF,MAAM,OAAO,OAAO,YAAY;;AAE9B,MAAI,SAAS,WAAW;AACtB,cAAW,SAAS,UAAU,EAAE;AAChC,YAAS,WAAW,SAAS,UAAU,EAAE;;GAE3C;AACF,QAAO;;AAGT,SAAgB,WAAW,QAAgB;CACzC,MAAM,QAAsB,EAAE;AAC9B,QAAO,eAAe,QAAQ,SAAS;;AAErC,MAAI,OAAO,gBAAgB,QAAQ,WAAW,GAAG,GAC/C,OAAM,KAAK;GACT;GACA,OAAO,OAAO;GACd;GACA,OAAO,OAAO;GACf,CAAC;GAEJ;AACF,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.mjs","names":[],"sources":["../../src/form-tab/hooks.ts"],"sourcesContent":["import type { GeneralField } from '@formily/core'\nimport type { Schema, SchemaKey } from '@formily/json-schema'\n\nexport type Tabs = { name: SchemaKey, props: any, schema: Schema }[]\n\nexport function useTabs(tabField: GeneralField, schema: Schema) {\n const schemaList = schema.mapProperties((item, name) => ({\n name,\n props: {\n name: item?.['x-component-props']?.name || name,\n ...item?.['x-component-props'],\n },\n schema: item,\n }))\n\n const tabs: Tabs = schemaList.filter((item) => {\n const field = tabField.query(tabField.address.concat(item.name)).take()\n const isHidden = field?.display === 'none' || field?.display === 'hidden'\n if (isHidden)\n return false\n return item?.schema?.['x-component']?.includes('TabPane') ?? false\n })\n\n return tabs\n}\n"],"mappings":";AAKA,SAAgB,QAAQ,UAAwB,QAAgB;AAkB9D,QAjBmB,OAAO,eAAe,MAAM,UAAU;EACvD;EACA,OAAO;GACL,MAAM,OAAO,sBAAsB,QAAQ;GAC3C,GAAG,OAAO;GACX;EACD,QAAQ;EACT,EAAE,CAE2B,QAAQ,SAAS;EAC7C,MAAM,QAAQ,SAAS,MAAM,SAAS,QAAQ,OAAO,KAAK,KAAK,CAAC,CAAC,MAAM;AAEvE,MADiB,OAAO,YAAY,UAAU,OAAO,YAAY,SAE/D,QAAO;AACT,SAAO,MAAM,SAAS,gBAAgB,SAAS,UAAU,IAAI;GAC7D"}
1
+ {"version":3,"file":"hooks.mjs","names":[],"sources":["../../src/form-tab/hooks.ts"],"sourcesContent":["import type { GeneralField } from '@silver-formily/core'\nimport type { Schema, SchemaKey } from '@silver-formily/json-schema'\n\nexport type Tabs = { name: SchemaKey, props: any, schema: Schema }[]\n\nexport function useTabs(tabField: GeneralField, schema: Schema) {\n const schemaList = schema.mapProperties((item, name) => ({\n name,\n props: {\n name: item?.['x-component-props']?.name || name,\n ...item?.['x-component-props'],\n },\n schema: item,\n }))\n\n const tabs: Tabs = schemaList.filter((item) => {\n const field = tabField.query(tabField.address.concat(item.name)).take()\n const isHidden = field?.display === 'none' || field?.display === 'hidden'\n if (isHidden)\n return false\n return item?.schema?.['x-component']?.includes('TabPane') ?? false\n })\n\n return tabs\n}\n"],"mappings":";AAKA,SAAgB,QAAQ,UAAwB,QAAgB;AAkB9D,QAjBmB,OAAO,eAAe,MAAM,UAAU;EACvD;EACA,OAAO;GACL,MAAM,OAAO,sBAAsB,QAAQ;GAC3C,GAAG,OAAO;GACX;EACD,QAAQ;EACT,EAAE,CAE2B,QAAQ,SAAS;EAC7C,MAAM,QAAQ,SAAS,MAAM,SAAS,QAAQ,OAAO,KAAK,KAAK,CAAC,CAAC,MAAM;AAEvE,MADiB,OAAO,YAAY,UAAU,OAAO,YAAY,SAE/D,QAAO;AACT,SAAO,MAAM,SAAS,gBAAgB,SAAS,UAAU,IAAI;GAC7D"}
@@ -1,4 +1,4 @@
1
- import { model } from "@formily/reactive";
1
+ import { model } from "@silver-formily/reactive";
2
2
  //#region src/form-tab/utils.ts
3
3
  function createFormTab(defaultActiveKey) {
4
4
  const formTab = model({
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","names":[],"sources":["../../src/form-tab/utils.ts"],"sourcesContent":["import { model } from '@formily/reactive'\n\nexport function createFormTab(defaultActiveKey?: string) {\n const formTab = model({\n activeKey: defaultActiveKey,\n setActiveKey(key: string) {\n formTab.activeKey = key\n },\n })\n return formTab\n}\n"],"mappings":";;AAEA,SAAgB,cAAc,kBAA2B;CACvD,MAAM,UAAU,MAAM;EACpB,WAAW;EACX,aAAa,KAAa;AACxB,WAAQ,YAAY;;EAEvB,CAAC;AACF,QAAO"}
1
+ {"version":3,"file":"utils.mjs","names":[],"sources":["../../src/form-tab/utils.ts"],"sourcesContent":["import { model } from '@silver-formily/reactive'\n\nexport function createFormTab(defaultActiveKey?: string) {\n const formTab = model({\n activeKey: defaultActiveKey,\n setActiveKey(key: string) {\n formTab.activeKey = key\n },\n })\n return formTab\n}\n"],"mappings":";;AAEA,SAAgB,cAAc,kBAA2B;CACvD,MAAM,UAAU,MAAM;EACpB,WAAW;EACX,aAAa,KAAa;AACxB,WAAQ,YAAY;;EAEvB,CAAC;AACF,QAAO"}
@@ -1,47 +1,5 @@
1
- import * as _$vue from "vue";
2
-
3
1
  //#region src/input/index.d.ts
4
- declare const Input: {
5
- new (...args: any[]): _$vue.CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, _$vue.PublicProps, {}, true, {}, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, {}, any, _$vue.ComponentProvideOptions, {
6
- P: {};
7
- B: {};
8
- D: {};
9
- C: {};
10
- M: {};
11
- Defaults: {};
12
- }, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
13
- __isFragment?: never;
14
- __isTeleport?: never;
15
- __isSuspense?: never;
16
- } & _$vue.ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, {}, {}, string, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, _$vue.ComponentProvideOptions> & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps & (new () => {
17
- $slots: {
18
- prefix?: () => any;
19
- suffix?: () => any;
20
- prepend?: () => any;
21
- append?: () => any;
22
- };
23
- }) & {
24
- TextArea: {
25
- new (...args: any[]): _$vue.CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, _$vue.PublicProps, {}, true, {}, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, {}, any, _$vue.ComponentProvideOptions, {
26
- P: {};
27
- B: {};
28
- D: {};
29
- C: {};
30
- M: {};
31
- Defaults: {};
32
- }, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
33
- __isFragment?: never;
34
- __isTeleport?: never;
35
- __isSuspense?: never;
36
- } & _$vue.ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, {}, {}, string, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, _$vue.ComponentProvideOptions> & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps & (new () => {
37
- $slots: {
38
- prefix?: () => any;
39
- suffix?: () => any;
40
- prepend?: () => any;
41
- append?: () => any;
42
- };
43
- });
44
- };
2
+ declare const Input: any;
45
3
  //#endregion
46
4
  export { Input };
47
5
  //# sourceMappingURL=index.d.ts.map