@silver-formily/element-plus 2.0.0 → 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 (165) hide show
  1. package/README.en-US.md +32 -0
  2. package/README.md +18 -21
  3. package/esm/__builtins__/index.mjs +15 -16
  4. package/esm/__builtins__/shared/index.mjs +11 -12
  5. package/esm/__builtins__/shared/transform-component.d.ts +2 -7
  6. package/esm/__builtins__/shared/transform-component.mjs +16 -33
  7. package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
  8. package/esm/__builtins__/shared/utils.mjs +11 -11
  9. package/esm/__builtins__/shared/utils.mjs.map +1 -1
  10. package/esm/array-base/index.mjs +62 -62
  11. package/esm/array-base/index.mjs.map +1 -1
  12. package/esm/array-base/utils.mjs +2 -2
  13. package/esm/array-cards/array-cards.d.ts +1 -1
  14. package/esm/array-cards/index.d.ts +3 -3
  15. package/esm/array-cards/index.mjs +49 -49
  16. package/esm/array-cards/index.mjs.map +1 -1
  17. package/esm/array-collapse/array-collapse.d.ts +2 -2
  18. package/esm/array-collapse/index.d.ts +3 -3
  19. package/esm/array-collapse/index.mjs +85 -84
  20. package/esm/array-collapse/index.mjs.map +1 -1
  21. package/esm/array-collapse/utils.mjs +2 -2
  22. package/esm/array-items/index.mjs +43 -40
  23. package/esm/array-items/index.mjs.map +1 -1
  24. package/esm/array-list-tabs/array-list-tabs.d.ts +3 -3
  25. package/esm/array-list-tabs/index.d.ts +6 -6
  26. package/esm/array-list-tabs/index.mjs +93 -89
  27. package/esm/array-list-tabs/index.mjs.map +1 -1
  28. package/esm/array-list-tabs/utils.mjs +2 -2
  29. package/esm/array-table/array-table.d.ts +29 -1
  30. package/esm/array-table/index.d.ts +31 -3
  31. package/esm/array-table/index.mjs +126 -125
  32. package/esm/array-table/index.mjs.map +1 -1
  33. package/esm/array-table/types.d.ts +2 -1
  34. package/esm/array-table/utils.mjs +2 -2
  35. package/esm/array-tabs/index.mjs +17 -17
  36. package/esm/array-tabs/index.mjs.map +1 -1
  37. package/esm/cascader/cascader.d.ts +1 -6
  38. package/esm/cascader/index.d.ts +3 -16
  39. package/esm/cascader/index.mjs +29 -33
  40. package/esm/cascader/index.mjs.map +1 -1
  41. package/esm/checkbox/checkbox-group.d.ts +3 -19
  42. package/esm/checkbox/index.d.ts +445 -407
  43. package/esm/checkbox/index.mjs +27 -36
  44. package/esm/checkbox/index.mjs.map +1 -1
  45. package/esm/date-picker/index.d.ts +442 -1
  46. package/esm/date-picker/index.mjs +12 -19
  47. package/esm/date-picker/index.mjs.map +1 -1
  48. package/esm/editable/editable.d.ts +16 -12
  49. package/esm/editable/index.d.ts +8 -6
  50. package/esm/editable/index.mjs +108 -110
  51. package/esm/editable/index.mjs.map +1 -1
  52. package/esm/form/form.mjs +1 -1
  53. package/esm/form/form.mjs.map +1 -1
  54. package/esm/form-button-group/index.mjs +31 -30
  55. package/esm/form-button-group/index.mjs.map +1 -1
  56. package/esm/form-button-group/utils.mjs +2 -2
  57. package/esm/form-collapse/index.mjs +40 -40
  58. package/esm/form-collapse/index.mjs.map +1 -1
  59. package/esm/form-dialog/index.d.ts +1 -1
  60. package/esm/form-dialog/index.mjs +5 -5
  61. package/esm/form-dialog/index.mjs.map +1 -1
  62. package/esm/form-dialog/types.d.ts +6 -6
  63. package/esm/form-drawer/index.d.ts +1 -1
  64. package/esm/form-drawer/index.mjs +5 -5
  65. package/esm/form-drawer/index.mjs.map +1 -1
  66. package/esm/form-drawer/types.d.ts +6 -6
  67. package/esm/form-grid/index.d.ts +1 -183
  68. package/esm/form-grid/index.mjs +2 -2
  69. package/esm/form-grid/index.mjs.map +1 -1
  70. package/esm/form-item/form-item.d.ts +2 -1
  71. package/esm/form-item/index.d.ts +12 -6
  72. package/esm/form-item/index.mjs +156 -152
  73. package/esm/form-item/index.mjs.map +1 -1
  74. package/esm/form-item/types.d.ts +0 -1
  75. package/esm/form-layout/form-layout.d.ts +0 -1
  76. package/esm/form-layout/form-layout.mjs +55 -53
  77. package/esm/form-layout/form-layout.mjs.map +1 -1
  78. package/esm/form-layout/types.d.ts +0 -2
  79. package/esm/form-layout/utils.d.ts +3 -3
  80. package/esm/form-layout/utils.mjs +47 -42
  81. package/esm/form-layout/utils.mjs.map +1 -1
  82. package/esm/form-step/index.mjs +26 -24
  83. package/esm/form-step/index.mjs.map +1 -1
  84. package/esm/form-tab/form-tab.d.ts +2 -2
  85. package/esm/form-tab/hooks.mjs +1 -1
  86. package/esm/form-tab/hooks.mjs.map +1 -1
  87. package/esm/form-tab/index.d.ts +1 -26
  88. package/esm/form-tab/index.mjs +31 -31
  89. package/esm/form-tab/index.mjs.map +1 -1
  90. package/esm/form-tab/types.d.ts +1 -1
  91. package/esm/input/index.d.ts +6 -38
  92. package/esm/input/index.mjs +38 -47
  93. package/esm/input/index.mjs.map +1 -1
  94. package/esm/input/input.d.ts +1 -8
  95. package/esm/input-number/index.d.ts +326 -1
  96. package/esm/input-number/index.mjs +10 -17
  97. package/esm/input-number/index.mjs.map +1 -1
  98. package/esm/pagination/pagination.mjs +110 -111
  99. package/esm/pagination/pagination.mjs.map +1 -1
  100. package/esm/password/index.d.ts +6 -38
  101. package/esm/password/index.mjs +1 -1
  102. package/esm/password/index.mjs.map +1 -1
  103. package/esm/preview-text/cascader.d.ts +1 -1
  104. package/esm/preview-text/date-picker.d.ts +1 -1
  105. package/esm/preview-text/index.d.ts +13 -13
  106. package/esm/preview-text/index.mjs +121 -121
  107. package/esm/preview-text/index.mjs.map +1 -1
  108. package/esm/preview-text/input.d.ts +1 -1
  109. package/esm/preview-text/select.d.ts +1 -1
  110. package/esm/preview-text/time-picker.d.ts +1 -1
  111. package/esm/preview-text/tree.d.ts +1 -1
  112. package/esm/radio/index.d.ts +347 -219
  113. package/esm/radio/index.mjs +37 -44
  114. package/esm/radio/index.mjs.map +1 -1
  115. package/esm/radio/radio-group.d.ts +2 -13
  116. package/esm/reset/index.d.ts +1 -62
  117. package/esm/reset/index.mjs +2 -2
  118. package/esm/reset/index.mjs.map +1 -1
  119. package/esm/select/index.d.ts +3 -16
  120. package/esm/select/index.mjs +65 -70
  121. package/esm/select/index.mjs.map +1 -1
  122. package/esm/select/select.d.ts +1 -6
  123. package/esm/select-table/index.d.ts +33 -5
  124. package/esm/select-table/index.mjs +90 -89
  125. package/esm/select-table/index.mjs.map +1 -1
  126. package/esm/select-table/select-table.d.ts +58 -2
  127. package/esm/select-table/types.d.ts +1 -1
  128. package/esm/submit/index.d.ts +1 -47
  129. package/esm/submit/index.mjs +2 -2
  130. package/esm/submit/index.mjs.map +1 -1
  131. package/esm/switch/index.d.ts +296 -1
  132. package/esm/switch/index.mjs +5 -11
  133. package/esm/switch/index.mjs.map +1 -1
  134. package/esm/time-picker/index.d.ts +442 -1
  135. package/esm/time-picker/index.mjs +9 -14
  136. package/esm/time-picker/index.mjs.map +1 -1
  137. package/esm/time-select/index.d.ts +184 -1
  138. package/esm/time-select/index.mjs +8 -13
  139. package/esm/time-select/index.mjs.map +1 -1
  140. package/esm/transfer/index.d.ts +196 -115
  141. package/esm/transfer/index.mjs +5 -5
  142. package/esm/transfer/index.mjs.map +1 -1
  143. package/esm/tree/index.d.ts +5 -5
  144. package/esm/tree/index.mjs +34 -34
  145. package/esm/tree/index.mjs.map +1 -1
  146. package/esm/tree/tree.d.ts +2 -2
  147. package/esm/tree/types.d.ts +1 -1
  148. package/esm/tree-select/index.d.ts +3 -19
  149. package/esm/tree-select/index.mjs +23 -30
  150. package/esm/tree-select/index.mjs.map +1 -1
  151. package/esm/tree-select/tree-select.d.ts +1 -8
  152. package/esm/upload/index.d.ts +409 -404
  153. package/esm/upload/index.mjs +9 -9
  154. package/esm/upload/index.mjs.map +1 -1
  155. package/esm/upload/upload.d.ts +802 -792
  156. package/esm/vendor/icon.mjs.map +1 -1
  157. package/esm/vendor/lodash.mjs +12 -20
  158. package/esm/vendor/lodash.mjs.map +1 -1
  159. package/esm/vendor/runtime.mjs +29 -24
  160. package/esm/vendor/runtime.mjs.map +1 -1
  161. package/esm/vendor/shared.esm-bundler.mjs +2 -2
  162. package/esm/vendor/sizes.mjs.map +1 -1
  163. package/esm/vendor/types.mjs +5 -5
  164. package/esm/vendor/types.mjs.map +1 -1
  165. package/package.json +8 -11
@@ -1,21 +1,18 @@
1
- import { connect as T, mapProps as B } from "@formily/vue";
2
- import { ElRadioButton as G, ElRadio as b, ElRadioGroup as O, version as x } from "element-plus";
3
- import { defineComponent as C, computed as s, useSlots as L, createBlock as u, openBlock as a, unref as d, withCtx as l, createElementBlock as f, Fragment as c, renderList as v, resolveDynamicComponent as y, mergeProps as _, createTextVNode as h, toDisplayString as j, renderSlot as w } from "vue";
1
+ import { connect as E, mapProps as T } from "@silver-formily/vue";
2
+ import { ElRadioButton as B, ElRadio as v, ElRadioGroup as C, version as G } from "element-plus";
3
+ import { defineComponent as O, computed as c, useSlots as x, createBlock as p, openBlock as t, unref as u, normalizeProps as A, guardReactiveProps as L, withCtx as i, createElementBlock as f, Fragment as d, renderList as _, resolveDynamicComponent as y, mergeProps as b, createTextVNode as h, toDisplayString as j, renderSlot as w } from "vue";
4
4
  import "@formily/reactive";
5
- import { mapReadPretty as A } from "../__builtins__/shared/transform-component.mjs";
6
- import { composeExport as D } from "../__builtins__/shared/utils.mjs";
7
- import { PreviewText as F } from "../preview-text/index.mjs";
8
- import { isPlainObj as N } from "@formily/shared";
9
- import { lt as V } from "../__builtins__/shared/simple-version-compare.mjs";
5
+ import { mapReadPretty as D } from "../__builtins__/shared/transform-component.mjs";
6
+ import { useCleanAttrs as F, composeExport as N } from "../__builtins__/shared/utils.mjs";
7
+ import { PreviewText as z } from "../preview-text/index.mjs";
8
+ import { isPlainObj as H } from "@formily/shared";
9
+ import { lt as I } from "../__builtins__/shared/simple-version-compare.mjs";
10
10
  import "@formily/core";
11
- import "@formily/reactive-vue";
12
- import '../styles/radio/index.css';const H = /* @__PURE__ */ C({
11
+ import "@silver-formily/reactive-vue";
12
+ import '../styles/radio/index.css';const V = /* @__PURE__ */ O({
13
13
  name: "FRadioGroup",
14
14
  __name: "radio-group",
15
15
  props: {
16
- value: {
17
- default: void 0
18
- },
19
16
  options: {
20
17
  type: Array,
21
18
  default: () => []
@@ -25,56 +22,52 @@ import '../styles/radio/index.css';const H = /* @__PURE__ */ C({
25
22
  default: "default"
26
23
  }
27
24
  },
28
- emits: ["change"],
29
- setup(S, { emit: g }) {
30
- const o = S, R = g, p = s(() => o.optionType === "button" ? G : b), k = V(x, "2.6.0");
31
- function i(e) {
32
- return N(e);
25
+ setup(P) {
26
+ const o = P, { props: R } = F(), s = c(() => o.optionType === "button" ? B : v), S = I(G, "2.6.0");
27
+ function l(e) {
28
+ return H(e);
33
29
  }
34
- function P(e, r) {
35
- return i(o.options[r]) ? o.options[r].label : e.label;
30
+ function g(e, n) {
31
+ return l(o.options[n]) ? o.options[n].label : e.label;
36
32
  }
37
- const m = s(() => o.options.map((e) => {
38
- if (!i(e))
33
+ const m = c(() => o.options.map((e) => {
34
+ if (!l(e))
39
35
  return {
40
36
  label: e,
41
37
  value: e
42
38
  };
43
39
  /* istanbul ignore if -- @preserve */
44
- return k ? {
40
+ return S ? {
45
41
  ...e,
46
42
  label: e.value
47
43
  } : e;
48
- })), E = L();
49
- return (e, r) => (a(), u(d(O), {
50
- "model-value": o.value,
51
- "onUpdate:modelValue": r[0] || (r[0] = (t) => R("change", t))
52
- }, {
53
- default: l(() => [
54
- d(E).option ? (a(!0), f(c, { key: 1 }, v(m.value, (t, n) => (a(), u(y(p.value), _({ key: n }, { ref_for: !0 }, t), {
55
- default: l(() => [
56
- w(e.$slots, "option", { option: t })
44
+ })), k = x();
45
+ return (e, n) => (t(), p(u(C), A(L(u(R))), {
46
+ default: i(() => [
47
+ u(k).option ? (t(!0), f(d, { key: 1 }, _(m.value, (r, a) => (t(), p(y(s.value), b({ key: a }, { ref_for: !0 }, r), {
48
+ default: i(() => [
49
+ w(e.$slots, "option", { option: r })
57
50
  ]),
58
51
  _: 2
59
- }, 1040))), 128)) : (a(!0), f(c, { key: 0 }, v(m.value, (t, n) => (a(), u(y(p.value), _({ key: n }, { ref_for: !0 }, t), {
60
- default: l(() => [
61
- h(j(P(t, n)), 1)
52
+ }, 1040))), 128)) : (t(!0), f(d, { key: 0 }, _(m.value, (r, a) => (t(), p(y(s.value), b({ key: a }, { ref_for: !0 }, r), {
53
+ default: i(() => [
54
+ h(j(g(r, a)), 1)
62
55
  ]),
63
56
  _: 2
64
57
  }, 1040))), 128))
65
58
  ]),
66
59
  _: 3
67
- }, 8, ["model-value"]));
60
+ }, 16));
68
61
  }
69
- }), I = T(
70
- H,
71
- B({ dataSource: "options", disabled: !0 }),
72
- A(F.Select)
73
- ), Z = D(b, {
74
- Group: I
62
+ }), $ = E(
63
+ V,
64
+ T({ dataSource: "options", disabled: !0 }),
65
+ D(z.Select)
66
+ ), re = N(v, {
67
+ Group: $
75
68
  });
76
69
  export {
77
- Z as Radio,
78
- Z as default
70
+ re as Radio,
71
+ re as default
79
72
  };
80
73
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/radio/radio-group.vue","../../src/radio/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { RadioProps } from 'element-plus'\nimport type { PropType } from 'vue'\nimport { isPlainObj } from '@formily/shared'\nimport { ElRadio, ElRadioButton, ElRadioGroup, version } from 'element-plus'\nimport { computed, useSlots } from 'vue'\nimport { lt } from '../__builtins__'\n\ndefineOptions({\n name: 'FRadioGroup',\n})\n\nconst props = defineProps({\n value: {\n default: undefined,\n },\n options: {\n type: Array as PropType<Array<RadioProps | string | number>>,\n default: () => [],\n },\n optionType: {\n type: String as PropType<'default' | 'button'>,\n default: 'default',\n },\n})\n\nconst emits = defineEmits(['change'])\nconst OptionType = computed(() => {\n return props.optionType === 'button' ? ElRadioButton : ElRadio\n})\nconst IS_LESS_THAN_2_6_0 = lt(version, '2.6.0')\n\nfunction isRadioPropsObject(option: any): option is RadioProps {\n return isPlainObj(option)\n}\n\nfunction getOptionLabel(option: any, index: number) {\n if (isRadioPropsObject(props.options[index])) {\n return props.options[index].label\n }\n return option.label\n}\n\nconst compatiableProps = computed(() => {\n return props.options.map((option) => {\n if (!isRadioPropsObject(option)) {\n return {\n label: option,\n value: option,\n }\n }\n /* istanbul ignore if -- @preserve */\n if (IS_LESS_THAN_2_6_0) {\n return {\n ...option,\n label: option.value,\n }\n }\n return option\n })\n})\n\nconst slots = useSlots()\n</script>\n\n<template>\n <ElRadioGroup :model-value=\"props.value\" @update:model-value=\"(value) => emits('change', value)\">\n <template v-if=\"!slots.option\">\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\n {{ getOptionLabel(option, index) }}\n </component>\n </template>\n <template v-else>\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\n <slot name=\"option\" :option=\"option\" />\n </component>\n </template>\n </ElRadioGroup>\n</template>\n","import { connect, mapProps } from '@formily/vue'\nimport { ElRadio } from 'element-plus'\nimport { composeExport, mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FRadioGroup from './radio-group.vue'\nimport './style.scss'\n\nconst RadioGroup = connect(\n FRadioGroup,\n mapProps({ dataSource: 'options', disabled: true }),\n mapReadPretty(PreviewText.Select),\n)\nexport const Radio = composeExport(ElRadio, {\n Group: RadioGroup,\n})\n\nexport default Radio\n"],"names":["props","__props","emits","__emit","OptionType","computed","ElRadioButton","ElRadio","IS_LESS_THAN_2_6_0","lt","version","isRadioPropsObject","option","isPlainObj","getOptionLabel","index","compatiableProps","slots","useSlots","_createBlock","_unref","ElRadioGroup","_cache","value","_openBlock","_createElementBlock","_Fragment","_renderList","_resolveDynamicComponent","_mergeProps","_renderSlot","_ctx","RadioGroup","connect","FRadioGroup","mapProps","mapReadPretty","PreviewText","Radio","composeExport"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,UAAMA,IAAQC,GAcRC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EAFIxB,OAAU,GAA1ByB,EAEY,EAF6D,KAAKd,KAAK,EAAA,SAAA,GAAA,GAAUH,CAAM,GAAA;AAAA,qBACjG,MAAmC;AAAA,gBAAhCE,EAAeF,GAAQG,CAAK,CAAA,GAAA,CAAA;AAAA,UAAA;;;;;;;IC9DjCiB,IAAaC;AAAA,EACjBC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,UAAU,IAAM;AAAA,EAClDC,EAAcC,EAAY,MAAM;AAClC,GACaC,IAAQC,EAAchC,GAAS;AAAA,EAC1C,OAAOyB;AACT,CAAC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/radio/radio-group.vue","../../src/radio/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { RadioProps } from 'element-plus'\nimport type { PropType } from 'vue'\nimport { isPlainObj } from '@formily/shared'\nimport { ElRadio, ElRadioButton, ElRadioGroup, version } from 'element-plus'\nimport { computed, useSlots } from 'vue'\nimport { lt, useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FRadioGroup',\n})\n\nconst props = defineProps({\n options: {\n type: Array as PropType<Array<RadioProps | string | number>>,\n default: () => [],\n },\n optionType: {\n type: String as PropType<'default' | 'button'>,\n default: 'default',\n },\n})\n\nconst { props: radioProps } = useCleanAttrs()\n\nconst OptionType = computed(() => {\n return props.optionType === 'button' ? ElRadioButton : ElRadio\n})\nconst IS_LESS_THAN_2_6_0 = lt(version, '2.6.0')\n\nfunction isRadioPropsObject(option: any): option is RadioProps {\n return isPlainObj(option)\n}\n\nfunction getOptionLabel(option: any, index: number) {\n if (isRadioPropsObject(props.options[index])) {\n return props.options[index].label\n }\n return option.label\n}\n\nconst compatiableProps = computed(() => {\n return props.options.map((option) => {\n if (!isRadioPropsObject(option)) {\n return {\n label: option,\n value: option,\n }\n }\n /* istanbul ignore if -- @preserve */\n if (IS_LESS_THAN_2_6_0) {\n return {\n ...option,\n label: option.value,\n }\n }\n return option\n })\n})\n\nconst slots = useSlots()\n</script>\n\n<template>\n <ElRadioGroup v-bind=\"radioProps\">\n <template v-if=\"!slots.option\">\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\n {{ getOptionLabel(option, index) }}\n </component>\n </template>\n <template v-else>\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\n <slot name=\"option\" :option=\"option\" />\n </component>\n </template>\n </ElRadioGroup>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\nimport { ElRadio } from 'element-plus'\nimport { composeExport, mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FRadioGroup from './radio-group.vue'\nimport './style.scss'\n\nconst RadioGroup = connect<typeof FRadioGroup>(\n FRadioGroup,\n mapProps({ dataSource: 'options', disabled: true }),\n mapReadPretty(PreviewText.Select),\n)\nexport const Radio = composeExport(ElRadio, {\n Group: RadioGroup,\n})\n\nexport default Radio\n"],"names":["props","__props","radioProps","useCleanAttrs","OptionType","computed","ElRadioButton","ElRadio","IS_LESS_THAN_2_6_0","lt","version","isRadioPropsObject","option","isPlainObj","getOptionLabel","index","compatiableProps","slots","useSlots","_openBlock","_createBlock","_unref","_createElementBlock","_Fragment","_renderList","_resolveDynamicComponent","_mergeProps","_renderSlot","_ctx","RadioGroup","connect","FRadioGroup","mapProps","mapReadPretty","PreviewText","Radio","composeExport"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAYA,UAAMA,IAAQC,GAWR,EAAE,OAAOC,EAAA,IAAeC,EAAA,GAExBC,IAAaC,EAAS,MACnBL,EAAM,eAAe,WAAWM,IAAgBC,CACxD,GACKC,IAAqBC,EAAGC,GAAS,OAAO;AAE9C,aAASC,EAAmBC,GAAmC;AAC7D,aAAOC,EAAWD,CAAM;AAAA,IAC1B;AAEA,aAASE,EAAeF,GAAaG,GAAe;AAClD,aAAIJ,EAAmBX,EAAM,QAAQe,CAAK,CAAC,IAClCf,EAAM,QAAQe,CAAK,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3,9 +3,6 @@ import { PropType } from 'vue';
3
3
  declare function __VLS_template(): any;
4
4
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
5
5
  declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
6
- value: {
7
- default: any;
8
- };
9
6
  options: {
10
7
  type: PropType<Array<RadioProps | string | number>>;
11
8
  default: () => any[];
@@ -14,12 +11,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
14
11
  type: PropType<"default" | "button">;
15
12
  default: string;
16
13
  };
17
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
18
- change: (...args: any[]) => void;
19
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
20
- value: {
21
- default: any;
22
- };
14
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
23
15
  options: {
24
16
  type: PropType<Array<RadioProps | string | number>>;
25
17
  default: () => any[];
@@ -28,10 +20,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
28
20
  type: PropType<"default" | "button">;
29
21
  default: string;
30
22
  };
31
- }>> & Readonly<{
32
- onChange?: (...args: any[]) => any;
33
- }>, {
34
- value: any;
23
+ }>> & Readonly<{}>, {
35
24
  options: (string | number | RadioProps)[];
36
25
  optionType: "button" | "default";
37
26
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -1,63 +1,2 @@
1
- export declare const Reset: {
2
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
3
- onClick: import('vue').PropType<(e: MouseEvent) => void | boolean>;
4
- forceClear: {
5
- type: BooleanConstructor;
6
- default: boolean;
7
- };
8
- validate: {
9
- type: BooleanConstructor;
10
- default: boolean;
11
- };
12
- onResetValidateSuccess: import('vue').PropType<(payload: any) => void>;
13
- onResetValidateFailed: import('vue').PropType<(error: any) => void>;
14
- }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
15
- validate: boolean;
16
- forceClear: boolean;
17
- }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
18
- P: {};
19
- B: {};
20
- D: {};
21
- C: {};
22
- M: {};
23
- Defaults: {};
24
- }, Readonly<import('vue').ExtractPropTypes<{
25
- onClick: import('vue').PropType<(e: MouseEvent) => void | boolean>;
26
- forceClear: {
27
- type: BooleanConstructor;
28
- default: boolean;
29
- };
30
- validate: {
31
- type: BooleanConstructor;
32
- default: boolean;
33
- };
34
- onResetValidateSuccess: import('vue').PropType<(payload: any) => void>;
35
- onResetValidateFailed: import('vue').PropType<(error: any) => void>;
36
- }>> & Readonly<{}>, {}, {}, {}, {}, {
37
- validate: boolean;
38
- forceClear: boolean;
39
- }>;
40
- __isFragment?: never;
41
- __isTeleport?: never;
42
- __isSuspense?: never;
43
- } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
44
- onClick: import('vue').PropType<(e: MouseEvent) => void | boolean>;
45
- forceClear: {
46
- type: BooleanConstructor;
47
- default: boolean;
48
- };
49
- validate: {
50
- type: BooleanConstructor;
51
- default: boolean;
52
- };
53
- onResetValidateSuccess: import('vue').PropType<(payload: any) => void>;
54
- onResetValidateFailed: import('vue').PropType<(error: any) => void>;
55
- }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
56
- validate: boolean;
57
- forceClear: boolean;
58
- }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
59
- $slots: {
60
- default?(_: {}): any;
61
- };
62
- });
1
+ export declare const Reset: any;
63
2
  export default Reset;
@@ -1,6 +1,6 @@
1
- import { observer as s } from "@formily/reactive-vue";
1
+ import { observer as s } from "@silver-formily/reactive-vue";
2
2
  import { defineComponent as c, createBlock as i, openBlock as f, unref as u, mergeProps as d, withCtx as m, renderSlot as p } from "vue";
3
- import { useParentForm as C } from "@formily/vue";
3
+ import { useParentForm as C } from "@silver-formily/vue";
4
4
  import { ElButton as k } from "element-plus";
5
5
  const F = /* @__PURE__ */ c({
6
6
  name: "FReset",
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/reset/reset.vue","../../src/reset/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { PropType } from 'vue'\nimport { useParentForm } from '@formily/vue'\nimport { ElButton } from 'element-plus'\n\ndefineOptions({\n name: 'FReset',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n onClick: Function as PropType<(e: MouseEvent) => void | boolean>,\n forceClear: {\n type: Boolean,\n default: false,\n },\n validate: {\n type: Boolean,\n default: false,\n },\n onResetValidateSuccess: Function as PropType<(payload: any) => void>,\n onResetValidateFailed: Function as PropType<(error: any) => void>,\n})\n\nconst formRef = useParentForm()\n\nfunction handleClick(e: MouseEvent) {\n if (props.onClick && (props.onClick)?.(e) === false)\n return\n\n const form = formRef?.value\n form?.reset('*', {\n forceClear: props.forceClear,\n })\n props.validate && form?.validate()\n .then(props.onResetValidateSuccess)\n .catch(error => props.onResetValidateFailed?.(error))\n}\n</script>\n\n<template>\n <ElButton v-bind=\"$attrs\" @click=\"handleClick\">\n <slot />\n </ElButton>\n</template>\n","import { observer } from '@formily/reactive-vue'\nimport FReset from './reset.vue'\n\nexport const Reset = observer(FReset)\n\nexport default Reset\n"],"names":["props","__props","formRef","useParentForm","handleClick","e","form","error","_openBlock","_createBlock","_unref","_mergeProps","_ctx","_renderSlot","Reset","observer","FReset"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,GAcRC,IAAUC,EAAA;AAEhB,aAASC,EAAYC,GAAe;AAClC,UAAIL,EAAM,WAAYA,EAAM,UAAWK,CAAC,MAAM;AAC5C;AAEF,YAAMC,IAAOJ,GAAS;AACtB,MAAAI,GAAM,MAAM,KAAK;AAAA,QACf,YAAYN,EAAM;AAAA,MAAA,CACnB,GACDA,EAAM,YAAYM,GAAM,SAAA,EACrB,KAAKN,EAAM,sBAAsB,EACjC,MAAM,CAAAO,MAASP,EAAM,wBAAwBO,CAAK,CAAC;AAAA,IACxD;sBAIEC,EAAA,GAAAC,EAEWC,MAFXC,EAEWC,UAFa,EAAG,SAAOR,EAAA,CAAW,GAAA;AAAA,iBAC3C,MAAQ;AAAA,QAARS,EAAQD,EAAA,QAAA,SAAA;AAAA,MAAA;;;;ICvCCE,IAAQC,EAASC,CAAM;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/reset/reset.vue","../../src/reset/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { PropType } from 'vue'\nimport { useParentForm } from '@silver-formily/vue'\nimport { ElButton } from 'element-plus'\n\ndefineOptions({\n name: 'FReset',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n onClick: Function as PropType<(e: MouseEvent) => void | boolean>,\n forceClear: {\n type: Boolean,\n default: false,\n },\n validate: {\n type: Boolean,\n default: false,\n },\n onResetValidateSuccess: Function as PropType<(payload: any) => void>,\n onResetValidateFailed: Function as PropType<(error: any) => void>,\n})\n\nconst formRef = useParentForm()\n\nfunction handleClick(e: MouseEvent) {\n if (props.onClick && (props.onClick)?.(e) === false)\n return\n\n const form = formRef?.value\n form?.reset('*', {\n forceClear: props.forceClear,\n })\n props.validate && form?.validate()\n .then(props.onResetValidateSuccess)\n .catch(error => props.onResetValidateFailed?.(error))\n}\n</script>\n\n<template>\n <ElButton v-bind=\"$attrs\" @click=\"handleClick\">\n <slot />\n </ElButton>\n</template>\n","import { observer } from '@silver-formily/reactive-vue'\nimport FReset from './reset.vue'\n\nexport const Reset = observer(FReset)\n\nexport default Reset\n"],"names":["props","__props","formRef","useParentForm","handleClick","e","form","error","_openBlock","_createBlock","_unref","_mergeProps","_ctx","_renderSlot","Reset","observer","FReset"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,GAcRC,IAAUC,EAAA;AAEhB,aAASC,EAAYC,GAAe;AAClC,UAAIL,EAAM,WAAYA,EAAM,UAAWK,CAAC,MAAM;AAC5C;AAEF,YAAMC,IAAOJ,GAAS;AACtB,MAAAI,GAAM,MAAM,KAAK;AAAA,QACf,YAAYN,EAAM;AAAA,MAAA,CACnB,GACDA,EAAM,YAAYM,GAAM,SAAA,EACrB,KAAKN,EAAM,sBAAsB,EACjC,MAAM,CAAAO,MAASP,EAAM,wBAAwBO,CAAK,CAAC;AAAA,IACxD;sBAIEC,EAAA,GAAAC,EAEWC,MAFXC,EAEWC,UAFa,EAAG,SAAOR,EAAA,CAAW,GAAA;AAAA,iBAC3C,MAAQ;AAAA,QAARS,EAAQD,EAAA,QAAA,SAAA;AAAA,MAAA;;;;ICvCCE,IAAQC,EAASC,CAAM;"}
@@ -1,6 +1,5 @@
1
1
  export declare const Select: {
2
2
  new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
3
- value?: any;
4
3
  options?: Array<(Partial<{
5
4
  disabled: boolean;
6
5
  created: boolean;
@@ -25,11 +24,7 @@ export declare const Select: {
25
24
  readonly label?: import('element-plus/es/utils/index.mjs').EpPropMergeType<(StringConstructor | NumberConstructor)[], unknown, unknown>;
26
25
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "disabled" | "created">)[];
27
26
  })>;
28
- }> & Readonly<{
29
- onChange?: (value: any) => any;
30
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
31
- change: (value: any) => any;
32
- }, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
27
+ }> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
33
28
  P: {};
34
29
  B: {};
35
30
  D: {};
@@ -37,7 +32,6 @@ export declare const Select: {
37
32
  M: {};
38
33
  Defaults: {};
39
34
  }, Readonly<{
40
- value?: any;
41
35
  options?: Array<(Partial<{
42
36
  disabled: boolean;
43
37
  created: boolean;
@@ -62,14 +56,11 @@ export declare const Select: {
62
56
  readonly label?: import('element-plus/es/utils/index.mjs').EpPropMergeType<(StringConstructor | NumberConstructor)[], unknown, unknown>;
63
57
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "disabled" | "created">)[];
64
58
  })>;
65
- }> & Readonly<{
66
- onChange?: (value: any) => any;
67
- }>, {}, {}, {}, {}, {}>;
59
+ }> & Readonly<{}>, {}, {}, {}, {}, {}>;
68
60
  __isFragment?: never;
69
61
  __isTeleport?: never;
70
62
  __isSuspense?: never;
71
63
  } & import('vue').ComponentOptionsBase<Readonly<{
72
- value?: any;
73
64
  options?: Array<(Partial<{
74
65
  disabled: boolean;
75
66
  created: boolean;
@@ -94,11 +85,7 @@ export declare const Select: {
94
85
  readonly label?: import('element-plus/es/utils/index.mjs').EpPropMergeType<(StringConstructor | NumberConstructor)[], unknown, unknown>;
95
86
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "disabled" | "created">)[];
96
87
  })>;
97
- }> & Readonly<{
98
- onChange?: (value: any) => any;
99
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
100
- change: (value: any) => any;
101
- }, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
88
+ }> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
102
89
  $slots: Readonly<{
103
90
  option?: (props: {
104
91
  option: Partial<{
@@ -1,64 +1,59 @@
1
- import { useField as P, connect as C, mapProps as E } from "@formily/vue";
2
- import { defineComponent as K, useSlots as B, createBlock as m, openBlock as a, unref as e, mergeProps as u, createSlots as F, withCtx as l, createElementBlock as p, Fragment as d, renderList as c, renderSlot as n, createCommentVNode as k } from "vue";
3
- import { ElSelect as w, ElOptionGroup as A, ElOption as g } from "element-plus";
1
+ import { useField as S, connect as b, mapProps as P } from "@silver-formily/vue";
2
+ import { defineComponent as h, useSlots as C, createBlock as f, openBlock as s, unref as e, normalizeProps as E, guardReactiveProps as K, createSlots as _, withCtx as t, createElementBlock as m, Fragment as u, renderList as y, mergeProps as d, renderSlot as n, createCommentVNode as c } from "vue";
3
+ import { ElSelect as B, ElOptionGroup as F, ElOption as k } from "element-plus";
4
4
  import "@formily/reactive";
5
- import { mapReadPretty as G } from "../__builtins__/shared/transform-component.mjs";
6
- import { PreviewText as O } from "../preview-text/index.mjs";
5
+ import { mapReadPretty as R } from "../__builtins__/shared/transform-component.mjs";
6
+ import { PreviewText as w } from "../preview-text/index.mjs";
7
7
  import "@formily/core";
8
- import "@formily/reactive-vue";
9
- import { useCleanAttrs as R } from "../__builtins__/shared/utils.mjs";
10
- import { o as V } from "../vendor/lodash.mjs";
11
- const _ = /* @__PURE__ */ K({
8
+ import "@silver-formily/reactive-vue";
9
+ import { useCleanAttrs as A } from "../__builtins__/shared/utils.mjs";
10
+ import { o as G } from "../vendor/lodash.mjs";
11
+ const O = /* @__PURE__ */ h({
12
12
  name: "FSelect",
13
13
  inheritAttrs: !1,
14
14
  __name: "select",
15
15
  props: {
16
- value: null,
17
- options: null
16
+ options: {}
18
17
  },
19
- emits: ["change"],
20
- setup($, { emit: S }) {
21
- const y = $, b = S, r = B(), { props: i } = R(), f = P();
22
- function h(t) {
23
- return t.options !== void 0;
18
+ setup(v) {
19
+ const g = v, l = C(), { props: i } = A(), p = S();
20
+ function $(o) {
21
+ return o.options !== void 0;
24
22
  }
25
- return (t, v) => (a(), m(e(w), u(e(i), {
26
- "model-value": y.value,
27
- "onUpdate:modelValue": v[0] || (v[0] = (o) => b("change", o))
28
- }), F({
29
- default: l(() => [
30
- (a(!0), p(d, null, c(y.options, (o) => (a(), p(d, null, [
31
- h(o) ? (a(), m(e(A), u({
23
+ return (o, z) => (s(), f(e(B), E(K(e(i))), _({
24
+ default: t(() => [
25
+ (s(!0), m(u, null, y(g.options, (r) => (s(), m(u, null, [
26
+ $(r) ? (s(), f(e(F), d({
32
27
  key: 0,
33
28
  ref_for: !0
34
- }, e(V)(o, "options"), {
35
- key: o.label
29
+ }, e(G)(r, "options"), {
30
+ key: r.label
36
31
  }), {
37
- default: l(() => [
38
- (a(!0), p(d, null, c(o.options, (s) => (a(), m(e(g), u({
39
- key: e(i).valueKey ? s[e(i).valueKey] : s.label
40
- }, { ref_for: !0 }, s), {
41
- default: l(() => [
42
- r.option ? n(t.$slots, "option", {
32
+ default: t(() => [
33
+ (s(!0), m(u, null, y(r.options, (a) => (s(), f(e(k), d({
34
+ key: e(i).valueKey ? a[e(i).valueKey] : a.label
35
+ }, { ref_for: !0 }, a), {
36
+ default: t(() => [
37
+ l.option ? n(o.$slots, "option", {
43
38
  key: 0,
44
- option: s
45
- }) : k("", !0)
39
+ option: a
40
+ }) : c("", !0)
46
41
  ]),
47
42
  _: 2
48
43
  }, 1040))), 128))
49
44
  ]),
50
45
  _: 2
51
- }, 1040)) : (a(), m(e(g), u({
46
+ }, 1040)) : (s(), f(e(k), d({
52
47
  key: 1,
53
48
  ref_for: !0
54
- }, o, {
55
- key: e(i).valueKey ? o[e(i).valueKey] : o.label
49
+ }, r, {
50
+ key: e(i).valueKey ? r[e(i).valueKey] : r.label
56
51
  }), {
57
- default: l(() => [
58
- r.option ? n(t.$slots, "option", {
52
+ default: t(() => [
53
+ l.option ? n(o.$slots, "option", {
59
54
  key: 0,
60
- option: o
61
- }) : k("", !0)
55
+ option: r
56
+ }) : c("", !0)
62
57
  ]),
63
58
  _: 2
64
59
  }, 1040))
@@ -66,67 +61,67 @@ const _ = /* @__PURE__ */ K({
66
61
  ]),
67
62
  _: 2
68
63
  }, [
69
- r.header ? {
64
+ l.header ? {
70
65
  name: "header",
71
- fn: l(() => [
72
- n(t.$slots, "header", { field: e(f) })
66
+ fn: t(() => [
67
+ n(o.$slots, "header", { field: e(p) })
73
68
  ]),
74
69
  key: "0"
75
70
  } : void 0,
76
- r.footer ? {
71
+ l.footer ? {
77
72
  name: "footer",
78
- fn: l(() => [
79
- n(t.$slots, "footer", { field: e(f) })
73
+ fn: t(() => [
74
+ n(o.$slots, "footer", { field: e(p) })
80
75
  ]),
81
76
  key: "1"
82
77
  } : void 0,
83
- r.prefix ? {
78
+ l.prefix ? {
84
79
  name: "prefix",
85
- fn: l(() => [
86
- n(t.$slots, "prefix")
80
+ fn: t(() => [
81
+ n(o.$slots, "prefix")
87
82
  ]),
88
83
  key: "2"
89
84
  } : void 0,
90
- r.empty ? {
85
+ l.empty ? {
91
86
  name: "empty",
92
- fn: l(() => [
93
- n(t.$slots, "empty")
87
+ fn: t(() => [
88
+ n(o.$slots, "empty")
94
89
  ]),
95
90
  key: "3"
96
91
  } : void 0,
97
- r.tag ? {
92
+ l.tag ? {
98
93
  name: "tag",
99
- fn: l(() => [
100
- n(t.$slots, "tag", { field: e(f) })
94
+ fn: t(() => [
95
+ n(o.$slots, "tag", { field: e(p) })
101
96
  ]),
102
97
  key: "4"
103
98
  } : void 0,
104
- r.loading ? {
99
+ l.loading ? {
105
100
  name: "loading",
106
- fn: l(() => [
107
- n(t.$slots, "loading")
101
+ fn: t(() => [
102
+ n(o.$slots, "loading")
108
103
  ]),
109
104
  key: "5"
110
105
  } : void 0,
111
- r.label ? {
106
+ l.label ? {
112
107
  name: "label",
113
- fn: l(({ label: o, value: s }) => [
114
- n(t.$slots, "label", {
115
- label: o,
116
- value: s
108
+ fn: t(({ label: r, value: a }) => [
109
+ n(o.$slots, "label", {
110
+ label: r,
111
+ value: a
117
112
  })
118
113
  ]),
119
114
  key: "6"
120
115
  } : void 0
121
- ]), 1040, ["model-value"]));
116
+ ]), 1040));
122
117
  }
123
- }), J = C(
124
- _,
125
- E({ dataSource: "options", loading: !0, disabled: !0 }),
126
- G(O.Select)
118
+ }), M = b(
119
+ O,
120
+ P({ dataSource: "options", loading: !0, disabled: !0 }),
121
+ R(w.Select)
127
122
  );
128
123
  export {
129
- J as Select,
130
- J as default
124
+ M as Select,
125
+ M as default
131
126
  };
132
127
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/select/select.vue","../../src/select/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useField } from '@formily/vue'\nimport { ElOption, ElOptionGroup, ElSelect } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FSelect',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n value: null,\n options: null\n})\n\nconst emit = defineEmits([\"change\"])\n\nconst slots = defineSlots<{\n option?: (props: { option: OptionType }) => any\n header?: () => any\n footer?: () => any\n prefix?: () => any\n empty?: () => any\n tag?: () => any\n loading?: () => any\n label?: () => any\n}>()\n\ntype OptionType = InstanceType<typeof ElOption>['$props']\ntype OptionGroupType = InstanceType<typeof ElOptionGroup>['$props'] & {\n options: OptionType[]\n}\n\nconst { props: selectProps } = useCleanAttrs()\n\nconst fieldRef = useField()\n\nfunction isGroup(option: OptionType | OptionGroupType): option is OptionGroupType {\n return (option as OptionGroupType).options !== undefined\n}\n</script>\n\n<template>\n <ElSelect v-bind=\"selectProps\" :model-value=\"props.value\" @update:model-value=\"(val) => emit('change', val)\">\n <template v-for=\"option of props.options\">\n <template v-if=\"isGroup(option)\">\n <ElOptionGroup v-bind=\"omit(option, 'options')\" :key=\"option.label\">\n <ElOption v-for=\"i of option.options\" :key=\"selectProps.valueKey ? i[selectProps.valueKey] : i.label\" v-bind=\"i\">\n <slot v-if=\"slots.option\" name=\"option\" :option=\"i\" />\n </ElOption>\n </ElOptionGroup>\n </template>\n <ElOption v-else v-bind=\"option\" :key=\"selectProps.valueKey ? option[selectProps.valueKey] : option.label\">\n <slot v-if=\"slots.option\" name=\"option\" :option=\"option\" />\n </ElOption>\n </template>\n <template v-if=\"slots.header\" #header>\n <slot name=\"header\" :field=\"fieldRef\" />\n </template>\n <template v-if=\"slots.footer\" #footer>\n <slot name=\"footer\" :field=\"fieldRef\" />\n </template>\n <template v-if=\"slots.prefix\" #prefix>\n <slot name=\"prefix\" />\n </template>\n <template v-if=\"slots.empty\" #empty>\n <slot name=\"empty\" />\n </template>\n <template v-if=\"slots.tag\" #tag>\n <slot name=\"tag\" :field=\"fieldRef\" />\n </template>\n <template v-if=\"slots.loading\" #loading>\n <slot name=\"loading\" />\n </template>\n <template v-if=\"slots.label\" #label=\"{ label, value: labelValue }\">\n <slot name=\"label\" :label=\"label\" :value=\"labelValue\" />\n </template>\n </ElSelect>\n</template>\n","import { connect, mapProps } from '@formily/vue'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FSelect from './select.vue'\n\nexport const Select = connect(\n FSelect,\n mapProps({ dataSource: 'options', loading: true, disabled: true }),\n mapReadPretty(PreviewText.Select),\n)\n\nexport default Select\n"],"names":["props","__props","emit","__emit","slots","_useSlots","selectProps","useCleanAttrs","fieldRef","useField","isGroup","option","_createBlock","_unref","ElSelect","_mergeProps","_cache","val","_openBlock","_createElementBlock","_Fragment","_renderList","omit","i","_renderSlot","_ctx","label","labelValue","Select","connect","FSelect","mapProps","mapReadPretty","PreviewText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AM,SAAlBoB,EAA2DC,EAAA,QAAA,UAAA;AAAA;gBAAlB,QAAAd;AAAA,cAAA;;;;;;;;MAG7BP,EAAM;cAAS;AAAA,cAC7B,MAAwC;AAAA,UAAxCoB,EAAwCC,EAAA,QAAA,UAAA,EAAnB,OAAOZ,EAAAL,CAAA,EAAA,CAAQ;AAAA,QAAA;;;MAEtBJ,EAAM;cAAS;AAAA,cAC7B,MAAwC;AAAA,UAAxCoB,EAAwCC,EAAA,QAAA,UAAA,EAAnB,OAAOZ,EAAAL,CAAA,EAAA,CAAQ;AAAA,QAAA;;;MAEtBJ,EAAM;cAAS;AAAA,cAC7B,MAAsB;AAAA,UAAtBoB,EAAsBC,EAAA,QAAA,QAAA;AAAA,QAAA;;;MAERrB,EAAM;cAAQ;AAAA,cAC5B,MAAqB;AAAA,UAArBoB,EAAqBC,EAAA,QAAA,OAAA;AAAA,QAAA;;;MAEPrB,EAAM;cAAM;AAAA,cAC1B,MAAqC;AAAA,UAArCoB,EAAqCC,EAAA,QAAA,OAAA,EAAnB,OAAOZ,EAAAL,CAAA,EAAA,CAAQ;AAAA,QAAA;;;MAEnBJ,EAAM;cAAU;AAAA,cAC9B,MAAuB;AAAA,UAAvBoB,EAAuBC,EAAA,QAAA,SAAA;AAAA,QAAA;;;MAETrB,EAAM;cAAQ;AAAA,cAC5B,CAAwD,EADnB,OAAAsB,GAAK,OAASC,QAAU;AAAA,UAC7DH,EAAwDC,EAAA,QAAA,SAAA;AAAA,YAApC,OAAAC;AAAA,YAAe,OAAOC;AAAA,UAAA;;;;;;ICvEnCC,IAASC;AAAA,EACpBC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,SAAS,IAAM,UAAU,IAAM;AAAA,EACjEC,EAAcC,EAAY,MAAM;AAClC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/select/select.vue","../../src/select/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useField } from '@silver-formily/vue'\nimport { ElOption, ElOptionGroup, ElSelect } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FSelect',\n inheritAttrs: false,\n})\n\nconst props = defineProps<{\n options?: Array<OptionType | OptionGroupType>\n}>()\n\nconst slots = defineSlots<{\n option?: (props: { option: OptionType }) => any\n header?: () => any\n footer?: () => any\n prefix?: () => any\n empty?: () => any\n tag?: () => any\n loading?: () => any\n label?: () => any\n}>()\n\ntype OptionType = InstanceType<typeof ElOption>['$props']\ntype OptionGroupType = InstanceType<typeof ElOptionGroup>['$props'] & {\n options: OptionType[]\n}\n\nconst { props: selectProps } = useCleanAttrs()\n\nconst fieldRef = useField()\n\nfunction isGroup(option: OptionType | OptionGroupType): option is OptionGroupType {\n return (option as OptionGroupType).options !== undefined\n}\n</script>\n\n<template>\n <ElSelect v-bind=\"selectProps\">\n <template v-for=\"option of props.options\">\n <template v-if=\"isGroup(option)\">\n <ElOptionGroup v-bind=\"omit(option, 'options')\" :key=\"option.label\">\n <ElOption v-for=\"i of option.options\" :key=\"selectProps.valueKey ? i[selectProps.valueKey] : i.label\" v-bind=\"i\">\n <slot v-if=\"slots.option\" name=\"option\" :option=\"i\" />\n </ElOption>\n </ElOptionGroup>\n </template>\n <ElOption v-else v-bind=\"option\" :key=\"selectProps.valueKey ? option[selectProps.valueKey] : option.label\">\n <slot v-if=\"slots.option\" name=\"option\" :option=\"option\" />\n </ElOption>\n </template>\n <template v-if=\"slots.header\" #header>\n <slot name=\"header\" :field=\"fieldRef\" />\n </template>\n <template v-if=\"slots.footer\" #footer>\n <slot name=\"footer\" :field=\"fieldRef\" />\n </template>\n <template v-if=\"slots.prefix\" #prefix>\n <slot name=\"prefix\" />\n </template>\n <template v-if=\"slots.empty\" #empty>\n <slot name=\"empty\" />\n </template>\n <template v-if=\"slots.tag\" #tag>\n <slot name=\"tag\" :field=\"fieldRef\" />\n </template>\n <template v-if=\"slots.loading\" #loading>\n <slot name=\"loading\" />\n </template>\n <template v-if=\"slots.label\" #label=\"{ label, value: labelValue }\">\n <slot name=\"label\" :label=\"label\" :value=\"labelValue\" />\n </template>\n </ElSelect>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FSelect from './select.vue'\n\nexport const Select = connect<typeof FSelect>(\n FSelect,\n mapProps({ dataSource: 'options', loading: true, disabled: true }),\n mapReadPretty(PreviewText.Select),\n)\n\nexport default Select\n"],"names":["props","__props","slots","_useSlots","selectProps","useCleanAttrs","fieldRef","useField","isGroup","option","_openBlock","_createBlock","_unref","_createSlots","_createElementBlock","_Fragment","_renderList","_mergeProps","omit","i","_renderSlot","_ctx","label","labelValue","Select","connect","FSelect","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;;;;;AAWA,UAAMA,IAAQC,GAIRC,IAAQC,EAAA,GAgBR,EAAE,OAAOC,EAAA,IAAgBC,EAAA,GAEzBC,IAAWC,EAAA;AAEjB,aAASC,EAAQC,GAAiE;AAChF,aAAQA,EAA2B,YAAY;AAAA,IACjD;sBAIEC,EAAA,GAAAC,EAkCWC,UAlCOA,EAAAR,CAAA,CAAW,CAAA,GAAAS,EAAA;AAAA,iBACjB,MAA+B;AAAA,SAAzCH,EAAA,EAAA,GAAAI,EAWWC,GAAA,MAAAC,EAXgBhB,EAAM,UAAhBS;UACCD,EAAQC,CAAM,KAC5BC,EAAA,GAAAC,EAIgBC,MAJhBK,EAIgB;AAAA;;aAJOL,EAAAM,CAAA,EAAKT,GAAM,SAAA,GAAA;AAAA,YAAe,KAAKA,EAAO;AAAA,UAAA;uBACjD,MAA2B;AAAA,eAArCC,EAAA,EAAA,GAAAI,EAEWC,GAAA,MAAAC,EAFWP,EAAO,UAAZU,OAAjBT,KAAAC,EAEWC,MAFXK,EAEW;AAAA,gBAF4B,KAAKL,EAAAR,CAAA,EAAY,WAAWe,EAAEP,EAAAR,CAAA,EAAY,QAAQ,IAAIe,EAAE;AAAA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DC,EAAA,QAAA,SAAA;AAAA,YAApC,OAAAC;AAAA,YAAe,OAAOC;AAAA,UAAA;;;;;;ICpEnCC,IAASC;AAAA,EACpBC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,SAAS,IAAM,UAAU,IAAM;AAAA,EACjEC,EAAcC,EAAY,MAAM;AAClC;"}
@@ -1,6 +1,5 @@
1
1
  import { ElOption, ElOptionGroup } from 'element-plus';
2
2
  type __VLS_Props = {
3
- value?: any;
4
3
  options?: Array<OptionType | OptionGroupType>;
5
4
  };
6
5
  type OptionType = InstanceType<typeof ElOption>['$props'];
@@ -36,11 +35,7 @@ declare function __VLS_template(): {
36
35
  rootEl: any;
37
36
  };
38
37
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
39
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
40
- change: (value: any) => any;
41
- }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
42
- onChange?: (value: any) => any;
43
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
38
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
44
39
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
45
40
  export default _default;
46
41
  type __VLS_WithTemplateSlots<T, S> = T & {