@silver-formily/element-plus 2.3.0 → 2.4.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 (169) hide show
  1. package/LICENSE +21 -21
  2. package/README.en-US.md +32 -32
  3. package/README.md +32 -32
  4. package/esm/__builtins__/configs/index.mjs.map +1 -1
  5. package/esm/__builtins__/index.mjs +12 -11
  6. package/esm/__builtins__/shared/index.mjs +11 -10
  7. package/esm/__builtins__/shared/loading.mjs.map +1 -1
  8. package/esm/__builtins__/shared/simple-version-compare.mjs.map +1 -1
  9. package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
  10. package/esm/__builtins__/shared/use-enter-submit.mjs.map +1 -1
  11. package/esm/__builtins__/shared/utils.d.ts +1 -0
  12. package/esm/__builtins__/shared/utils.mjs +23 -17
  13. package/esm/__builtins__/shared/utils.mjs.map +1 -1
  14. package/esm/array-base/index.mjs +56 -52
  15. package/esm/array-base/index.mjs.map +1 -1
  16. package/esm/array-base/symbols.mjs.map +1 -1
  17. package/esm/array-base/utils.d.ts +0 -1
  18. package/esm/array-base/utils.mjs +45 -46
  19. package/esm/array-base/utils.mjs.map +1 -1
  20. package/esm/array-cards/index.mjs +36 -33
  21. package/esm/array-cards/index.mjs.map +1 -1
  22. package/esm/array-collapse/index.mjs +39 -37
  23. package/esm/array-collapse/index.mjs.map +1 -1
  24. package/esm/array-collapse/utils.mjs +9 -2
  25. package/esm/array-collapse/utils.mjs.map +1 -1
  26. package/esm/array-items/index.mjs +38 -34
  27. package/esm/array-items/index.mjs.map +1 -1
  28. package/esm/array-list-tabs/index.mjs +38 -36
  29. package/esm/array-list-tabs/index.mjs.map +1 -1
  30. package/esm/array-list-tabs/utils.mjs +12 -5
  31. package/esm/array-list-tabs/utils.mjs.map +1 -1
  32. package/esm/array-table/index.mjs +63 -60
  33. package/esm/array-table/index.mjs.map +1 -1
  34. package/esm/array-table/utils.mjs +18 -11
  35. package/esm/array-table/utils.mjs.map +1 -1
  36. package/esm/array-tabs/index.mjs +28 -25
  37. package/esm/array-tabs/index.mjs.map +1 -1
  38. package/esm/autocomplete/index.mjs +24 -18
  39. package/esm/autocomplete/index.mjs.map +1 -1
  40. package/esm/cascader/index.mjs +22 -18
  41. package/esm/cascader/index.mjs.map +1 -1
  42. package/esm/checkbox/index.mjs +20 -16
  43. package/esm/checkbox/index.mjs.map +1 -1
  44. package/esm/color-picker/index.mjs +9 -6
  45. package/esm/color-picker/index.mjs.map +1 -1
  46. package/esm/color-picker-panel/index.mjs +9 -6
  47. package/esm/color-picker-panel/index.mjs.map +1 -1
  48. package/esm/date-picker/index.mjs +14 -11
  49. package/esm/date-picker/index.mjs.map +1 -1
  50. package/esm/date-picker/utils.mjs.map +1 -1
  51. package/esm/date-picker-panel/index.mjs +14 -11
  52. package/esm/date-picker-panel/index.mjs.map +1 -1
  53. package/esm/editable/editable.d.ts +2 -0
  54. package/esm/editable/index.d.ts +1 -0
  55. package/esm/editable/index.mjs +71 -66
  56. package/esm/editable/index.mjs.map +1 -1
  57. package/esm/form/form.mjs +6 -6
  58. package/esm/form/form.mjs.map +1 -1
  59. package/esm/form-button-group/form-button-group.d.ts +9 -0
  60. package/esm/form-button-group/index.d.ts +15 -0
  61. package/esm/form-button-group/index.mjs +47 -28
  62. package/esm/form-button-group/index.mjs.map +1 -1
  63. package/esm/form-button-group/utils.mjs +9 -2
  64. package/esm/form-button-group/utils.mjs.map +1 -1
  65. package/esm/form-collapse/index.mjs +21 -18
  66. package/esm/form-collapse/index.mjs.map +1 -1
  67. package/esm/form-collapse/utils.mjs.map +1 -1
  68. package/esm/form-dialog/index.mjs +22 -22
  69. package/esm/form-dialog/index.mjs.map +1 -1
  70. package/esm/form-drawer/index.mjs +21 -21
  71. package/esm/form-drawer/index.mjs.map +1 -1
  72. package/esm/form-grid/hooks.mjs.map +1 -1
  73. package/esm/form-grid/index.mjs +26 -22
  74. package/esm/form-grid/index.mjs.map +1 -1
  75. package/esm/form-item/index.d.ts +1 -0
  76. package/esm/form-item/index.mjs +102 -99
  77. package/esm/form-item/index.mjs.map +1 -1
  78. package/esm/form-item/types.d.ts +4 -0
  79. package/esm/form-item/utils.mjs.map +1 -1
  80. package/esm/form-layout/form-layout.mjs +14 -10
  81. package/esm/form-layout/form-layout.mjs.map +1 -1
  82. package/esm/form-layout/utils.mjs +23 -23
  83. package/esm/form-layout/utils.mjs.map +1 -1
  84. package/esm/form-step/index.mjs +30 -27
  85. package/esm/form-step/index.mjs.map +1 -1
  86. package/esm/form-step/utils.mjs.map +1 -1
  87. package/esm/form-tab/hooks.mjs.map +1 -1
  88. package/esm/form-tab/index.mjs +24 -22
  89. package/esm/form-tab/index.mjs.map +1 -1
  90. package/esm/form-tab/utils.mjs.map +1 -1
  91. package/esm/index.d.ts +2 -0
  92. package/esm/index.mjs +82 -78
  93. package/esm/index.mjs.map +1 -1
  94. package/esm/input/index.mjs +30 -26
  95. package/esm/input/index.mjs.map +1 -1
  96. package/esm/input-number/index.mjs +11 -8
  97. package/esm/input-number/index.mjs.map +1 -1
  98. package/esm/input-tag/index.mjs +20 -16
  99. package/esm/input-tag/index.mjs.map +1 -1
  100. package/esm/mention/index.mjs +24 -20
  101. package/esm/mention/index.mjs.map +1 -1
  102. package/esm/pagination/components/jumper.mjs.map +1 -1
  103. package/esm/pagination/components/next.mjs.map +1 -1
  104. package/esm/pagination/components/pager.mjs.map +1 -1
  105. package/esm/pagination/components/prev.mjs.map +1 -1
  106. package/esm/pagination/components/total.mjs.map +1 -1
  107. package/esm/pagination/pagination.mjs.map +1 -1
  108. package/esm/password/index.mjs.map +1 -1
  109. package/esm/preview-text/index.mjs +57 -53
  110. package/esm/preview-text/index.mjs.map +1 -1
  111. package/esm/preview-text/utils.mjs.map +1 -1
  112. package/esm/query-form/default-components.d.ts +5 -0
  113. package/esm/query-form/default-components.mjs +47 -0
  114. package/esm/query-form/default-components.mjs.map +1 -0
  115. package/esm/query-form/hooks.d.ts +25 -0
  116. package/esm/query-form/hooks.mjs +29 -0
  117. package/esm/query-form/hooks.mjs.map +1 -0
  118. package/esm/query-form/index.d.ts +117 -0
  119. package/esm/query-form/index.mjs +337 -0
  120. package/esm/query-form/index.mjs.map +1 -0
  121. package/esm/query-form/query-form-light.d.ts +27 -0
  122. package/esm/query-form/query-form.d.ts +52 -0
  123. package/esm/query-form/types.d.ts +44 -0
  124. package/esm/query-form/types.mjs +2 -0
  125. package/esm/query-form/types.mjs.map +1 -0
  126. package/esm/query-form-item/index.d.ts +151 -0
  127. package/esm/query-form-item/index.mjs +188 -0
  128. package/esm/query-form-item/index.mjs.map +1 -0
  129. package/esm/query-form-item/query-form-item.d.ts +96 -0
  130. package/esm/query-form-item/types.d.ts +46 -0
  131. package/esm/query-form-item/types.mjs +2 -0
  132. package/esm/query-form-item/types.mjs.map +1 -0
  133. package/esm/radio/index.mjs +29 -25
  134. package/esm/radio/index.mjs.map +1 -1
  135. package/esm/rate/index.mjs +13 -10
  136. package/esm/rate/index.mjs.map +1 -1
  137. package/esm/reset/index.mjs.map +1 -1
  138. package/esm/segmented/index.mjs +16 -12
  139. package/esm/segmented/index.mjs.map +1 -1
  140. package/esm/select/index.mjs +26 -22
  141. package/esm/select/index.mjs.map +1 -1
  142. package/esm/select-table/index.mjs +36 -33
  143. package/esm/select-table/index.mjs.map +1 -1
  144. package/esm/shared/overlay-elements.mjs +14 -11
  145. package/esm/shared/overlay-elements.mjs.map +1 -1
  146. package/esm/slider/index.mjs +13 -10
  147. package/esm/slider/index.mjs.map +1 -1
  148. package/esm/styles/form-button-group/index.css +1 -1
  149. package/esm/styles/form-item/index.css +1 -1
  150. package/esm/styles/query-form/index.css +1 -0
  151. package/esm/styles/query-form-item/index.css +1 -0
  152. package/esm/submit/index.mjs.map +1 -1
  153. package/esm/switch/index.mjs.map +1 -1
  154. package/esm/time-picker/index.mjs +9 -6
  155. package/esm/time-picker/index.mjs.map +1 -1
  156. package/esm/time-select/index.mjs +9 -6
  157. package/esm/time-select/index.mjs.map +1 -1
  158. package/esm/transfer/index.mjs.map +1 -1
  159. package/esm/tree/index.mjs +33 -29
  160. package/esm/tree/index.mjs.map +1 -1
  161. package/esm/tree/utils.mjs.map +1 -1
  162. package/esm/tree-select/index.mjs +18 -14
  163. package/esm/tree-select/index.mjs.map +1 -1
  164. package/esm/upload/index.mjs +10 -7
  165. package/esm/upload/index.mjs.map +1 -1
  166. package/esm/vendor/lodash.mjs +751 -663
  167. package/esm/vendor/lodash.mjs.map +1 -1
  168. package/esm/vendor/sizes.mjs.map +1 -1
  169. package/package.json +115 -115
@@ -1,11 +1,15 @@
1
1
  import { useField as S, connect as b, mapProps as P } from "@silver-formily/vue";
2
- import { PreviewText as h } from "../preview-text/index.mjs";
3
- import { defineComponent as C, useSlots as E, createBlock as f, openBlock as s, unref as e, normalizeProps as K, guardReactiveProps as _, createSlots as B, withCtx as t, createElementBlock as u, Fragment as m, renderList as y, mergeProps as d, renderSlot as n, createCommentVNode as c } from "vue";
4
- import { ElSelect as F, ElOptionGroup as R, ElOption as k } from "element-plus";
5
- import { o as w } from "../vendor/lodash.mjs";
2
+ import { ElSelect as h, ElOptionGroup as C, ElOption as y } from "element-plus";
3
+ import "@formily/reactive";
4
+ import "@vueuse/core";
5
+ import { defineComponent as E, useSlots as K, createBlock as p, openBlock as s, unref as e, normalizeProps as _, guardReactiveProps as B, createSlots as F, withCtx as t, createElementBlock as m, Fragment as u, renderList as c, mergeProps as d, renderSlot as n, createCommentVNode as k } from "vue";
6
+ import { mapReadPretty as R } from "../__builtins__/shared/transform-component.mjs";
7
+ import { PreviewText as w } from "../preview-text/index.mjs";
8
+ import "@formily/core";
9
+ import "@silver-formily/reactive-vue";
6
10
  import { useCleanAttrs as A } from "../__builtins__/shared/utils.mjs";
7
- import { mapReadPretty as G } from "../__builtins__/shared/transform-component.mjs";
8
- const O = /* @__PURE__ */ C({
11
+ import { o as G } from "../vendor/lodash.mjs";
12
+ const O = /* @__PURE__ */ E({
9
13
  name: "FSelect",
10
14
  inheritAttrs: !1,
11
15
  __name: "select",
@@ -13,34 +17,34 @@ const O = /* @__PURE__ */ C({
13
17
  options: {}
14
18
  },
15
19
  setup(v) {
16
- const g = v, l = E(), { props: i } = A(), p = S();
20
+ const g = v, l = K(), { props: i } = A(), f = S();
17
21
  function $(o) {
18
22
  return o.options !== void 0;
19
23
  }
20
- return (o, z) => (s(), f(e(F), K(_(e(i))), B({
24
+ return (o, z) => (s(), p(e(h), _(B(e(i))), F({
21
25
  default: t(() => [
22
- (s(!0), u(m, null, y(g.options, (r) => (s(), u(m, null, [
23
- $(r) ? (s(), f(e(R), d({
26
+ (s(!0), m(u, null, c(g.options, (r) => (s(), m(u, null, [
27
+ $(r) ? (s(), p(e(C), d({
24
28
  key: 0,
25
29
  ref_for: !0
26
- }, e(w)(r, "options"), {
30
+ }, e(G)(r, "options"), {
27
31
  key: r.label
28
32
  }), {
29
33
  default: t(() => [
30
- (s(!0), u(m, null, y(r.options, (a) => (s(), f(e(k), d({
34
+ (s(!0), m(u, null, c(r.options, (a) => (s(), p(e(y), d({
31
35
  key: e(i).valueKey ? a[e(i).valueKey] : a.label
32
36
  }, { ref_for: !0 }, a), {
33
37
  default: t(() => [
34
38
  l.option ? n(o.$slots, "option", {
35
39
  key: 0,
36
40
  option: a
37
- }) : c("", !0)
41
+ }) : k("", !0)
38
42
  ]),
39
43
  _: 2
40
44
  }, 1040))), 128))
41
45
  ]),
42
46
  _: 2
43
- }, 1040)) : (s(), f(e(k), d({
47
+ }, 1040)) : (s(), p(e(y), d({
44
48
  key: 1,
45
49
  ref_for: !0
46
50
  }, r, {
@@ -50,7 +54,7 @@ const O = /* @__PURE__ */ C({
50
54
  l.option ? n(o.$slots, "option", {
51
55
  key: 0,
52
56
  option: r
53
- }) : c("", !0)
57
+ }) : k("", !0)
54
58
  ]),
55
59
  _: 2
56
60
  }, 1040))
@@ -61,14 +65,14 @@ const O = /* @__PURE__ */ C({
61
65
  l.header ? {
62
66
  name: "header",
63
67
  fn: t(() => [
64
- n(o.$slots, "header", { field: e(p) })
68
+ n(o.$slots, "header", { field: e(f) })
65
69
  ]),
66
70
  key: "0"
67
71
  } : void 0,
68
72
  l.footer ? {
69
73
  name: "footer",
70
74
  fn: t(() => [
71
- n(o.$slots, "footer", { field: e(p) })
75
+ n(o.$slots, "footer", { field: e(f) })
72
76
  ]),
73
77
  key: "1"
74
78
  } : void 0,
@@ -89,7 +93,7 @@ const O = /* @__PURE__ */ C({
89
93
  l.tag ? {
90
94
  name: "tag",
91
95
  fn: t(() => [
92
- n(o.$slots, "tag", { field: e(p) })
96
+ n(o.$slots, "tag", { field: e(f) })
93
97
  ]),
94
98
  key: "4"
95
99
  } : void 0,
@@ -112,13 +116,13 @@ const O = /* @__PURE__ */ C({
112
116
  } : void 0
113
117
  ]), 1040));
114
118
  }
115
- }), H = b(
119
+ }), Q = b(
116
120
  O,
117
121
  P({ dataSource: "options", loading: !0, disabled: !0 }),
118
- G(h.Select)
122
+ R(w.Select)
119
123
  );
120
124
  export {
121
- H as Select,
122
- H as default
125
+ Q as Select,
126
+ Q as default
123
127
  };
124
128
  //# 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\">\r\nimport { useField } from '@silver-formily/vue'\r\nimport { ElOption, ElOptionGroup, ElSelect } from 'element-plus'\r\nimport { omit } from 'lodash-es'\r\nimport { useCleanAttrs } from '../__builtins__'\r\n\r\ndefineOptions({\r\n name: 'FSelect',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps<{\r\n options?: Array<OptionType | OptionGroupType>\r\n}>()\r\n\r\nconst slots = defineSlots<{\r\n option?: (props: { option: OptionType }) => any\r\n header?: () => any\r\n footer?: () => any\r\n prefix?: () => any\r\n empty?: () => any\r\n tag?: () => any\r\n loading?: () => any\r\n label?: () => any\r\n}>()\r\n\r\ntype OptionType = InstanceType<typeof ElOption>['$props']\r\ntype OptionGroupType = InstanceType<typeof ElOptionGroup>['$props'] & {\r\n options: OptionType[]\r\n}\r\n\r\nconst { props: selectProps } = useCleanAttrs()\r\n\r\nconst fieldRef = useField()\r\n\r\nfunction isGroup(option: OptionType | OptionGroupType): option is OptionGroupType {\r\n return (option as OptionGroupType).options !== undefined\r\n}\r\n</script>\r\n\r\n<template>\r\n <ElSelect v-bind=\"selectProps\">\r\n <template v-for=\"option of props.options\">\r\n <template v-if=\"isGroup(option)\">\r\n <ElOptionGroup v-bind=\"omit(option, 'options')\" :key=\"option.label\">\r\n <ElOption v-for=\"i of option.options\" :key=\"selectProps.valueKey ? i[selectProps.valueKey] : i.label\" v-bind=\"i\">\r\n <slot v-if=\"slots.option\" name=\"option\" :option=\"i\" />\r\n </ElOption>\r\n </ElOptionGroup>\r\n </template>\r\n <ElOption v-else v-bind=\"option\" :key=\"selectProps.valueKey ? option[selectProps.valueKey] : option.label\">\r\n <slot v-if=\"slots.option\" name=\"option\" :option=\"option\" />\r\n </ElOption>\r\n </template>\r\n <template v-if=\"slots.header\" #header>\r\n <slot name=\"header\" :field=\"fieldRef\" />\r\n </template>\r\n <template v-if=\"slots.footer\" #footer>\r\n <slot name=\"footer\" :field=\"fieldRef\" />\r\n </template>\r\n <template v-if=\"slots.prefix\" #prefix>\r\n <slot name=\"prefix\" />\r\n </template>\r\n <template v-if=\"slots.empty\" #empty>\r\n <slot name=\"empty\" />\r\n </template>\r\n <template v-if=\"slots.tag\" #tag>\r\n <slot name=\"tag\" :field=\"fieldRef\" />\r\n </template>\r\n <template v-if=\"slots.loading\" #loading>\r\n <slot name=\"loading\" />\r\n </template>\r\n <template v-if=\"slots.label\" #label=\"{ label, value: labelValue }\">\r\n <slot name=\"label\" :label=\"label\" :value=\"labelValue\" />\r\n </template>\r\n </ElSelect>\r\n</template>\r\n","import { connect, mapProps } from '@silver-formily/vue'\r\nimport { mapReadPretty } from '../__builtins__'\r\nimport { PreviewText } from '../preview-text'\r\nimport FSelect from './select.vue'\r\n\r\nexport const Select = connect<typeof FSelect>(\r\n FSelect,\r\n mapProps({ dataSource: 'options', loading: true, disabled: true }),\r\n mapReadPretty(PreviewText.Select),\r\n)\r\n\r\nexport default Select\r\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,cAAA,oBAAeA,CAAC,GAAA;AAAA,2BAC7G,MAAsD;AAAA,kBAA1CjB,EAAM,SAAlBkB,EAAsDC,EAAA,QAAA,UAAA;AAAA;oBAAb,QAAQF;AAAA,kBAAA;;;;;;uBAIvDT,EAAA,GAAAC,EAEWC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jEC,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,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AAAA,cAC9B,MAAuB;AAAA,UAAvBkB,EAAuBC,EAAA,QAAA,SAAA;AAAA,QAAA;;;MAETnB,EAAM;cAAQ;AAAA,cAC5B,CAAwD,EADnB,OAAAoB,GAAK,OAASC,QAAU;AAAA,UAC7DH,EAAwDC,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,10 +1,14 @@
1
1
  import { useField as W, connect as z, mapProps as G } from "@silver-formily/vue";
2
- import { defineComponent as U, ref as g, computed as j, watch as R, nextTick as v, createElementBlock as S, openBlock as c, normalizeClass as A, unref as n, createCommentVNode as J, withDirectives as Q, createElementVNode as X, createVNode as V, toDisplayString as Y, withCtx as f, createTextVNode as C, createBlock as y, mergeProps as w, renderSlot as Z, Fragment as ee, renderList as le } from "vue";
2
+ import { defineComponent as U, ref as g, computed as j, watch as R, nextTick as v, createElementBlock as S, openBlock as s, normalizeClass as A, unref as n, createCommentVNode as J, withDirectives as Q, createElementVNode as X, createVNode as V, toDisplayString as Y, withCtx as f, createTextVNode as C, createBlock as y, mergeProps as w, renderSlot as Z, Fragment as ee, renderList as le } from "vue";
3
3
  import { isValid as te, isEqual as oe, isFn as ae } from "@formily/shared";
4
4
  import { useAttrs as re, ElLink as ne, version as E, ElTable as ue, ElTableColumn as b, ElRadioGroup as ie, ElRadio as se, vLoading as ce } from "element-plus";
5
- import { u as x, x as de, d as me, a as fe, r as pe } from "../vendor/lodash.mjs";
6
- import { stylePrefix as K } from "../__builtins__/configs/index.mjs";
7
- import { lt as L } from "../__builtins__/shared/simple-version-compare.mjs";
5
+ import { stylePrefix as x } from "../__builtins__/configs/index.mjs";
6
+ import "@formily/reactive";
7
+ import "@vueuse/core";
8
+ import { lt as K } from "../__builtins__/shared/simple-version-compare.mjs";
9
+ import "@formily/core";
10
+ import "@silver-formily/reactive-vue";
11
+ import { u as L, x as de, d as me, a as fe, r as pe } from "../vendor/lodash.mjs";
8
12
  import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
9
13
  name: "FSelectTable",
10
14
  inheritAttrs: !1,
@@ -26,11 +30,11 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
26
30
  },
27
31
  emits: ["update:modelValue"],
28
32
  setup(B, { emit: D }) {
29
- const e = B, d = D, _ = re(), q = W();
33
+ const e = B, c = D, _ = re(), q = W();
30
34
  function F(l) {
31
- return L(E, "2.6.0") ? { label: l } : { value: l };
35
+ return K(E, "2.6.0") ? { label: l } : { value: l };
32
36
  }
33
- const s = g(), t = e.rowKey;
37
+ const d = g(), t = e.rowKey;
34
38
  function M() {
35
39
  return e.mode === "multiple" ? e.modelValue?.map((l) => e.optionAsValue ? l : {
36
40
  [t]: l
@@ -42,12 +46,12 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
42
46
  R(
43
47
  () => e.dataSource,
44
48
  async () => {
45
- const l = x(
49
+ const l = L(
46
50
  u.value.map((a) => a[t])
47
51
  );
48
- if (await v(), !!s.value)
49
- for (const a of e.dataSource)
50
- l.includes(a[t]) && (e.mode === "multiple" ? s.value?.toggleRowSelection(a, !0, e.ignoreSelectable) : (s.value?.setCurrentRow(a), T(a))), await v(), p = s.value?.getSelectionRows();
52
+ await v();
53
+ for (const a of e.dataSource)
54
+ l.includes(a[t]) && (e.mode === "multiple" ? d.value?.toggleRowSelection(a, !0, e.ignoreSelectable) : (d.value?.setCurrentRow(a), T(a))), await v(), p = d.value?.getSelectionRows();
51
55
  },
52
56
  { immediate: !0 }
53
57
  ), R(
@@ -57,9 +61,8 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
57
61
  if (e.mode === "single")
58
62
  m.value = e.optionAsValue ? l[t] : l;
59
63
  else {
60
- if (await v(), !s.value)
61
- return;
62
- const r = s.value?.getSelectionRows().map((i) => i[t]), o = e.optionAsValue ? l?.map((i) => i[t]) : l ?? [];
64
+ await v();
65
+ const r = d.value?.getSelectionRows().map((i) => i[t]), o = e.optionAsValue ? l?.map((i) => i[t]) : l ?? [];
63
66
  if (u.value = u.value.filter(
64
67
  (i) => o.includes(i[t])
65
68
  ), oe(o, r))
@@ -68,7 +71,7 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
68
71
  for (const i of e.dataSource)
69
72
  if (I.includes(i[t])) {
70
73
  const O = o.includes(i[t]);
71
- s.value.toggleRowSelection(i, O, e.ignoreSelectable);
74
+ d.value.toggleRowSelection(i, O, e.ignoreSelectable);
72
75
  }
73
76
  }
74
77
  },
@@ -89,20 +92,20 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
89
92
  [...u.value, ...l],
90
93
  (r, o) => r[t] === o[t]
91
94
  ), a.length > 0) {
92
- const r = x(a.map((o) => o[t]));
95
+ const r = L(a.map((o) => o[t]));
93
96
  pe(u.value, (o) => r.includes(o[t]));
94
97
  }
95
98
  if (e.optionAsValue)
96
- d("update:modelValue", u.value);
99
+ c("update:modelValue", u.value);
97
100
  else {
98
101
  const r = u.value.map(
99
102
  (o) => o[t]
100
103
  );
101
- d("update:modelValue", r);
104
+ c("update:modelValue", r);
102
105
  }
103
106
  }
104
107
  function T(l) {
105
- m.value = l[t], e.optionAsValue ? d("update:modelValue", l) : d("update:modelValue", l[t]);
108
+ m.value = l[t], e.optionAsValue ? c("update:modelValue", l) : c("update:modelValue", l[t]);
106
109
  }
107
110
  function P(l, a, r) {
108
111
  if (e.clickRowToSelect)
@@ -115,22 +118,22 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
115
118
  }
116
119
  }
117
120
  function $() {
118
- e.mode === "multiple" ? (d("update:modelValue", []), u.value = []) : (m.value = null, d("update:modelValue", null));
121
+ e.mode === "multiple" ? (c("update:modelValue", []), u.value = []) : (m.value = null, c("update:modelValue", null));
119
122
  }
120
123
  function H(l, a) {
121
124
  return e.selectable && ae(e.selectable) ? e.selectable(l, a, q.value) : !0;
122
125
  }
123
- return (l, a) => (c(), S("div", {
124
- class: A(`${n(K)}-select-table`)
126
+ return (l, a) => (s(), S("div", {
127
+ class: A(`${n(x)}-select-table`)
125
128
  }, [
126
- k.value > 0 && e.showAlertToolbar ? (c(), S("div", {
129
+ k.value > 0 && e.showAlertToolbar ? (s(), S("div", {
127
130
  key: 0,
128
- class: A(`${n(K)}-select-table-alert-container`)
131
+ class: A(`${n(x)}-select-table-alert-container`)
129
132
  }, [
130
133
  X("span", null, "已选择 " + Y(k.value) + " 项", 1),
131
134
  V(n(ne), {
132
135
  type: "primary",
133
- underline: n(L)(n(E), "2.9.9") ? !1 : "never",
136
+ underline: n(K)(n(E), "2.9.9") ? !1 : "never",
134
137
  style: { "margin-left": "8px" },
135
138
  onClick: $
136
139
  }, {
@@ -140,9 +143,9 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
140
143
  _: 1
141
144
  }, 8, ["underline"])
142
145
  ], 2)) : J("", !0),
143
- Q((c(), y(n(ue), w({
146
+ Q((s(), y(n(ue), w({
144
147
  ref_key: "elTableRef",
145
- ref: s
148
+ ref: d
146
149
  }, n(_), {
147
150
  "row-key": n(t),
148
151
  "row-class-name": e.clickRowToSelect ? "--click-row-select" : "",
@@ -153,11 +156,11 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
153
156
  onRowClick: P
154
157
  }), {
155
158
  default: f(() => [
156
- e.mode === "multiple" ? (c(), y(n(b), {
159
+ e.mode === "multiple" ? (s(), y(n(b), {
157
160
  key: 0,
158
161
  type: "selection",
159
162
  selectable: H
160
- })) : (c(), y(n(b), {
163
+ })) : (s(), y(n(b), {
161
164
  key: 1,
162
165
  width: "46"
163
166
  }, {
@@ -182,7 +185,7 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
182
185
  ]),
183
186
  _: 1
184
187
  })),
185
- e.columns.length === 0 ? Z(l.$slots, "default", { key: 2 }) : (c(!0), S(ee, { key: 3 }, le(e.columns, (r) => (c(), y(n(b), w({ ref_for: !0 }, r, {
188
+ e.columns.length === 0 ? Z(l.$slots, "default", { key: 2 }) : (s(!0), S(ee, { key: 3 }, le(e.columns, (r) => (s(), y(n(b), w({ ref_for: !0 }, r, {
186
189
  key: r.prop || r.type
187
190
  }), null, 16))), 128))
188
191
  ]),
@@ -192,12 +195,12 @@ import '../styles/select-table/index.css';const ye = /* @__PURE__ */ U({
192
195
  ])
193
196
  ], 2));
194
197
  }
195
- }), he = z(
198
+ }), Ce = z(
196
199
  ye,
197
200
  G({ dataSource: "dataSource", loading: "loading" })
198
201
  );
199
202
  export {
200
- he as SelectTable,
201
- he as default
203
+ Ce as SelectTable,
204
+ Ce as default
202
205
  };
203
206
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/select-table/select-table.vue","../../src/select-table/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport type { TableInstance } from 'element-plus'\r\nimport type { ISelectTableProps } from './types'\r\nimport { isEqual, isFn, isValid } from '@formily/shared'\r\nimport { useField } from '@silver-formily/vue'\r\nimport {\r\n ElLink,\r\n ElRadio,\r\n ElRadioGroup,\r\n ElTable,\r\n ElTableColumn,\r\n useAttrs,\r\n version,\r\n vLoading,\r\n} from 'element-plus'\r\nimport { differenceWith, remove, uniq, uniqWith, xor } from 'lodash-es'\r\nimport { computed, nextTick, ref, watch } from 'vue'\r\nimport { lt, stylePrefix } from '../__builtins__'\r\n\r\ndefineOptions({\r\n name: 'FSelectTable',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = withDefaults(defineProps<ISelectTableProps>(), {\r\n columns: () => [],\r\n mode: 'multiple',\r\n dataSource: () => [],\r\n optionAsValue: false,\r\n valueType: 'all',\r\n loading: false,\r\n clickRowToSelect: true,\r\n showAlertToolbar: true,\r\n ignoreSelectable: true,\r\n})\r\n\r\nconst emit = defineEmits(['update:modelValue'])\r\n\r\nconst elTableProps = useAttrs()\r\nconst field = useField()\r\n\r\nfunction compatibleRadioValue(key: string) {\r\n return lt(version, '2.6.0') ? { label: key } : { value: key }\r\n}\r\n\r\nconst elTableRef = ref<TableInstance>()\r\nconst rowKey = props.rowKey\r\nfunction getInitialSelectedList() {\r\n if (props.mode === 'multiple') {\r\n return props.modelValue?.map((item) => {\r\n if (!props.optionAsValue) {\r\n return {\r\n [rowKey]: item,\r\n }\r\n }\r\n return item\r\n }) ?? []\r\n }\r\n else {\r\n return props.optionAsValue ? [props.modelValue] : [{ [rowKey]: props.modelValue }]\r\n }\r\n}\r\nconst initialSelectedList = getInitialSelectedList()\r\nconst selectedFlatDataSource = ref(initialSelectedList)\r\n// 为了获取移除的项而缓存的当前页面的前一次选择。由于element-plus没有获取移除项的方法,需要通过这种方式移除field中移除的项\r\nlet prevSelection = []\r\n\r\nconst radioSelectedKey = ref()\r\n\r\nconst currentSelectLength = computed(() => {\r\n if (props.mode === 'multiple') {\r\n return Array.isArray(props.modelValue) ? props.modelValue.length : 0\r\n }\r\n else {\r\n return isValid(radioSelectedKey.value) ? 1 : 0\r\n }\r\n})\r\n\r\nwatch(\r\n () => props.dataSource,\r\n async () => {\n const selectedKeys = uniq(\n selectedFlatDataSource.value.map(item => item[rowKey]),\n )\n await nextTick()\n if (!elTableRef.value) {\n return\n }\n for (const item of props.dataSource) {\n if (selectedKeys.includes(item[rowKey])) {\n if (props.mode === 'multiple') {\n elTableRef.value?.toggleRowSelection(item, true, props.ignoreSelectable)\n }\n else {\n elTableRef.value?.setCurrentRow(item)\n onRadioClick(item)\n }\n }\n await nextTick()\n prevSelection = elTableRef.value?.getSelectionRows()\n }\n },\n { immediate: true },\n)\n\r\nwatch(\r\n () => [props.modelValue, props.loading],\r\n async ([value, loading]) => {\r\n if (loading) {\r\n return\r\n }\r\n if (props.mode === 'single') {\n radioSelectedKey.value = props.optionAsValue ? value[rowKey] : value\n }\n else {\n await nextTick()\n if (!elTableRef.value) {\n return\n }\n const currentDisplayDataKeys = elTableRef.value\n ?.getSelectionRows()\n .map(item => item[rowKey])\n const valueKeys = props.optionAsValue\r\n ? value?.map(item => item[rowKey])\r\n : value ?? []\r\n selectedFlatDataSource.value = selectedFlatDataSource.value.filter(\r\n item => valueKeys.includes(item[rowKey]),\r\n )\r\n if (isEqual(valueKeys, currentDisplayDataKeys)) {\r\n return\r\n }\r\n const diffItems = xor(valueKeys, currentDisplayDataKeys)\r\n for (const tableItem of props.dataSource) {\r\n if (diffItems.includes(tableItem[rowKey])) {\r\n const shouldSelect = valueKeys.includes(tableItem[rowKey])\r\n elTableRef.value.toggleRowSelection(tableItem, shouldSelect, props.ignoreSelectable)\r\n }\r\n }\r\n }\r\n },\r\n {\r\n immediate: true,\r\n },\r\n)\r\n\r\nfunction onSelect(newSelection: Record<string, any>[]) {\r\n /* istanbul ignore if -- @preserve */\r\n if (!rowKey) {\r\n throw new Error('rowKey is required')\r\n }\r\n\r\n const removedItemList\r\n = prevSelection.length > newSelection.length\r\n ? differenceWith(\r\n prevSelection,\r\n newSelection,\r\n (itemPrev, itemNext) => {\r\n return itemPrev[rowKey] === itemNext[rowKey]\r\n },\r\n )\r\n : []\r\n prevSelection = [...newSelection]\r\n selectedFlatDataSource.value = uniqWith(\r\n [...selectedFlatDataSource.value, ...newSelection],\r\n (itemPrev, itemNext) => {\r\n return itemPrev[rowKey] === itemNext[rowKey]\r\n },\r\n )\r\n if (removedItemList.length > 0) {\r\n const removedKeys = uniq(removedItemList.map(item => item[rowKey]))\r\n remove(selectedFlatDataSource.value, item =>\r\n removedKeys.includes(item[rowKey]))\r\n }\r\n\r\n if (props.optionAsValue) {\r\n emit('update:modelValue', selectedFlatDataSource.value)\r\n }\r\n else {\r\n const selectedKeys = selectedFlatDataSource.value.map(\r\n item => item[rowKey],\r\n )\r\n emit('update:modelValue', selectedKeys)\r\n }\r\n}\r\n\r\nfunction onRadioClick(item) {\r\n radioSelectedKey.value = item[rowKey]\r\n if (props.optionAsValue) {\r\n emit('update:modelValue', item)\r\n }\r\n else {\r\n emit('update:modelValue', item[rowKey])\r\n }\r\n}\r\n\r\nfunction onRowClick(row: Record<string, any>, _, event: Event) {\r\n if (!props.clickRowToSelect)\r\n return\r\n\r\n if (props.mode === 'multiple') {\r\n const checkboxDOM = (event.target as Element)\r\n .closest('tr')\r\n .querySelector('input[type=\"checkbox\"]')\r\n if (checkboxDOM instanceof HTMLElement) {\r\n checkboxDOM.click()\r\n }\r\n }\r\n else {\r\n const radioDOM = (event.target as Element)\r\n .closest('tr')\r\n .querySelector('input[type=\"radio\"]')\r\n if (radioDOM instanceof HTMLElement) {\r\n radioDOM.click()\r\n }\r\n }\r\n}\r\n\r\nfunction onClearSelectionClick() {\r\n if (props.mode === 'multiple') {\r\n emit('update:modelValue', [])\r\n selectedFlatDataSource.value = []\r\n }\r\n else {\r\n radioSelectedKey.value = null\r\n emit('update:modelValue', null)\r\n }\r\n}\r\n\r\nfunction selectable(row: Record<string, any>, index: number) {\r\n if (props.selectable && isFn(props.selectable)) {\r\n return props.selectable(row, index, field.value)\r\n }\r\n return true\r\n}\r\n</script>\r\n\r\n<template>\r\n <div :class=\"`${stylePrefix}-select-table`\">\r\n <div\r\n v-if=\"currentSelectLength > 0 && props.showAlertToolbar\"\r\n :class=\"`${stylePrefix}-select-table-alert-container`\"\r\n >\r\n <span>已选择 {{ currentSelectLength }} 项</span>\r\n <ElLink\r\n type=\"primary\"\r\n :underline=\"lt(version, '2.9.9') ? false : 'never'\"\r\n style=\"margin-left: 8px;\"\r\n @click=\"onClearSelectionClick\"\r\n >\r\n 取消选择\r\n </ElLink>\r\n </div>\r\n <ElTable\r\n ref=\"elTableRef\"\r\n v-loading=\"props.loading\"\r\n v-bind=\"elTableProps\"\r\n :row-key=\"rowKey\"\r\n :row-class-name=\"props.clickRowToSelect ? `--click-row-select` : ''\"\r\n :data=\"props.dataSource\"\r\n :highlight-current-row=\"props.mode === 'single'\"\r\n @select=\"onSelect\"\r\n @select-all=\"onSelect\"\r\n @row-click=\"onRowClick\"\r\n >\r\n <ElTableColumn\r\n v-if=\"props.mode === 'multiple'\"\r\n type=\"selection\"\r\n :selectable=\"selectable\"\r\n />\r\n <ElTableColumn\r\n v-else\r\n width=\"46\"\r\n >\r\n <template #default=\"{ row }\">\r\n <ElRadioGroup v-model=\"radioSelectedKey\" style=\"width: 100%;\">\r\n <ElRadio\r\n v-bind=\"compatibleRadioValue(row[rowKey])\"\r\n @change=\"() => onRadioClick(row)\"\r\n >\r\n &nbsp;\r\n </ElRadio>\r\n </ElRadioGroup>\r\n </template>\r\n </ElTableColumn>\r\n <template v-if=\"props.columns.length === 0\">\r\n <slot />\r\n </template>\r\n <template v-else>\r\n <ElTableColumn\r\n v-for=\"colItem of props.columns\"\r\n v-bind=\"colItem\"\r\n :key=\"colItem.prop || colItem.type\"\r\n />\r\n </template>\r\n </ElTable>\r\n </div>\r\n</template>\r\n","import { connect, mapProps } from '@silver-formily/vue'\r\nimport InnerSelectTable from './select-table.vue'\r\nimport './style.scss'\r\n\r\nconst SelectTable = connect<typeof InnerSelectTable>(\n InnerSelectTable,\n mapProps({ dataSource: 'dataSource', loading: 'loading' }),\r\n)\r\n\r\nexport { SelectTable }\r\n\r\nexport default SelectTable\r\n"],"names":["props","__props","emit","__emit","elTableProps","useAttrs","field","useField","compatibleRadioValue","key","lt","version","elTableRef","ref","rowKey","getInitialSelectedList","item","initialSelectedList","selectedFlatDataSource","prevSelection","radioSelectedKey","currentSelectLength","computed","isValid","watch","selectedKeys","uniq","nextTick","onRadioClick","value","loading","currentDisplayDataKeys","valueKeys","isEqual","diffItems","xor","tableItem","shouldSelect","onSelect","newSelection","removedItemList","differenceWith","itemPrev","itemNext","uniqWith","removedKeys","remove","onRowClick","row","_","event","checkboxDOM","radioDOM","onClearSelectionClick","selectable","index","isFn","_createElementBlock","_unref","stylePrefix","_createElementVNode","_toDisplayString","_createVNode","ElLink","_cache","_withDirectives","_openBlock","_createBlock","_mergeProps","ElTableColumn","_withCtx","ElRadioGroup","$event","_renderSlot","_ctx","_Fragment","_renderList","colItem","vLoading","SelectTable","connect","InnerSelectTable","mapProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,UAAMA,IAAQC,GAYRC,IAAOC,GAEPC,IAAeC,GAAA,GACfC,IAAQC,EAAA;AAEd,aAASC,EAAqBC,GAAa;AACzC,aAAOC,EAAGC,GAAS,OAAO,IAAI,EAAE,OAAOF,EAAA,IAAQ,EAAE,OAAOA,EAAA;AAAA,IAC1D;AAEA,UAAMG,IAAaC,EAAA,GACbC,IAASd,EAAM;AACrB,aAASe,IAAyB;AAChC,aAAIf,EAAM,SAAS,aACVA,EAAM,YAAY,IAAI,CAACgB,MACvBhB,EAAM,gBAKJgB,IAJE;AAAA,QACL,CAACF,CAAM,GAAGE;AAAA,MAAA,CAIf,KAAK,CAAA,IAGChB,EAAM,gBAAgB,CAACA,EAAM,UAAU,IAAI,CAAC,EAAE,CAACc,CAAM,GAAGd,EAAM,YAAY;AAAA,IAErF;AACA,UAAMiB,IAAsBF,EAAA,GACtBG,IAAyBL,EAAII,CAAmB;AAEtD,QAAIE,IAAgB,CAAA;AAEpB,UAAMC,IAAmBP,EAAA,GAEnBQ,IAAsBC,EAAS,MAC/BtB,EAAM,SAAS,aACV,MAAM,QAAQA,EAAM,UAAU,IAAIA,EAAM,WAAW,SAAS,IAG5DuB,GAAQH,EAAiB,KAAK,IAAI,IAAI,CAEhD;AAED,IAAAI;AAAA,MACE,MAAMxB,EAAM;AAAA,MACZ,YAAY;AACV,cAAMyB,IAAeC;AAAA,UACnBR,EAAuB,MAAM,IAAI,CAAAF,MAAQA,EAAKF,CAAM,CAAC;AAAA,QAAA;AAGvD,YADA,MAAMa,EAAA,GACF,EAACf,EAAW;AAGhB,qBAAWI,KAAQhB,EAAM;AACvB,YAAIyB,EAAa,SAAST,EAAKF,CAAM,CAAC,MAChCd,EAAM,SAAS,aACjBY,EAAW,OA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["../../src/select-table/select-table.vue","../../src/select-table/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { TableInstance } from 'element-plus'\nimport type { ISelectTableProps } from './types'\nimport { isEqual, isFn, isValid } from '@formily/shared'\nimport { useField } from '@silver-formily/vue'\nimport {\n ElLink,\n ElRadio,\n ElRadioGroup,\n ElTable,\n ElTableColumn,\n useAttrs,\n version,\n vLoading,\n} from 'element-plus'\nimport { differenceWith, remove, uniq, uniqWith, xor } from 'lodash-es'\nimport { computed, nextTick, ref, watch } from 'vue'\nimport { lt, stylePrefix } from '../__builtins__'\n\ndefineOptions({\n name: 'FSelectTable',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<ISelectTableProps>(), {\n columns: () => [],\n mode: 'multiple',\n dataSource: () => [],\n optionAsValue: false,\n valueType: 'all',\n loading: false,\n clickRowToSelect: true,\n showAlertToolbar: true,\n ignoreSelectable: true,\n})\n\nconst emit = defineEmits(['update:modelValue'])\n\nconst elTableProps = useAttrs()\nconst field = useField()\n\nfunction compatibleRadioValue(key: string) {\n return lt(version, '2.6.0') ? { label: key } : { value: key }\n}\n\nconst elTableRef = ref<TableInstance>()\nconst rowKey = props.rowKey\nfunction getInitialSelectedList() {\n if (props.mode === 'multiple') {\n return props.modelValue?.map((item) => {\n if (!props.optionAsValue) {\n return {\n [rowKey]: item,\n }\n }\n return item\n }) ?? []\n }\n else {\n return props.optionAsValue ? [props.modelValue] : [{ [rowKey]: props.modelValue }]\n }\n}\nconst initialSelectedList = getInitialSelectedList()\nconst selectedFlatDataSource = ref(initialSelectedList)\n// 为了获取移除的项而缓存的当前页面的前一次选择。由于element-plus没有获取移除项的方法,需要通过这种方式移除field中移除的项\nlet prevSelection = []\n\nconst radioSelectedKey = ref()\n\nconst currentSelectLength = computed(() => {\n if (props.mode === 'multiple') {\n return Array.isArray(props.modelValue) ? props.modelValue.length : 0\n }\n else {\n return isValid(radioSelectedKey.value) ? 1 : 0\n }\n})\n\nwatch(\n () => props.dataSource,\n async () => {\n const selectedKeys = uniq(\n selectedFlatDataSource.value.map(item => item[rowKey]),\n )\n await nextTick()\n for (const item of props.dataSource) {\n if (selectedKeys.includes(item[rowKey])) {\n if (props.mode === 'multiple') {\n elTableRef.value?.toggleRowSelection(item, true, props.ignoreSelectable)\n }\n else {\n elTableRef.value?.setCurrentRow(item)\n onRadioClick(item)\n }\n }\n await nextTick()\n prevSelection = elTableRef.value?.getSelectionRows()\n }\n },\n { immediate: true },\n)\n\nwatch(\n () => [props.modelValue, props.loading],\n async ([value, loading]) => {\n if (loading) {\n return\n }\n if (props.mode === 'single') {\n radioSelectedKey.value = props.optionAsValue ? value[rowKey] : value\n }\n else {\n await nextTick()\n const currentDisplayDataKeys = elTableRef.value\n ?.getSelectionRows()\n .map(item => item[rowKey])\n const valueKeys = props.optionAsValue\n ? value?.map(item => item[rowKey])\n : value ?? []\n selectedFlatDataSource.value = selectedFlatDataSource.value.filter(\n item => valueKeys.includes(item[rowKey]),\n )\n if (isEqual(valueKeys, currentDisplayDataKeys)) {\n return\n }\n const diffItems = xor(valueKeys, currentDisplayDataKeys)\n for (const tableItem of props.dataSource) {\n if (diffItems.includes(tableItem[rowKey])) {\n const shouldSelect = valueKeys.includes(tableItem[rowKey])\n elTableRef.value.toggleRowSelection(tableItem, shouldSelect, props.ignoreSelectable)\n }\n }\n }\n },\n {\n immediate: true,\n },\n)\n\nfunction onSelect(newSelection: Record<string, any>[]) {\n /* istanbul ignore if -- @preserve */\n if (!rowKey) {\n throw new Error('rowKey is required')\n }\n\n const removedItemList\n = prevSelection.length > newSelection.length\n ? differenceWith(\n prevSelection,\n newSelection,\n (itemPrev, itemNext) => {\n return itemPrev[rowKey] === itemNext[rowKey]\n },\n )\n : []\n prevSelection = [...newSelection]\n selectedFlatDataSource.value = uniqWith(\n [...selectedFlatDataSource.value, ...newSelection],\n (itemPrev, itemNext) => {\n return itemPrev[rowKey] === itemNext[rowKey]\n },\n )\n if (removedItemList.length > 0) {\n const removedKeys = uniq(removedItemList.map(item => item[rowKey]))\n remove(selectedFlatDataSource.value, item =>\n removedKeys.includes(item[rowKey]))\n }\n\n if (props.optionAsValue) {\n emit('update:modelValue', selectedFlatDataSource.value)\n }\n else {\n const selectedKeys = selectedFlatDataSource.value.map(\n item => item[rowKey],\n )\n emit('update:modelValue', selectedKeys)\n }\n}\n\nfunction onRadioClick(item) {\n radioSelectedKey.value = item[rowKey]\n if (props.optionAsValue) {\n emit('update:modelValue', item)\n }\n else {\n emit('update:modelValue', item[rowKey])\n }\n}\n\nfunction onRowClick(row: Record<string, any>, _, event: Event) {\n if (!props.clickRowToSelect)\n return\n\n if (props.mode === 'multiple') {\n const checkboxDOM = (event.target as Element)\n .closest('tr')\n .querySelector('input[type=\"checkbox\"]')\n if (checkboxDOM instanceof HTMLElement) {\n checkboxDOM.click()\n }\n }\n else {\n const radioDOM = (event.target as Element)\n .closest('tr')\n .querySelector('input[type=\"radio\"]')\n if (radioDOM instanceof HTMLElement) {\n radioDOM.click()\n }\n }\n}\n\nfunction onClearSelectionClick() {\n if (props.mode === 'multiple') {\n emit('update:modelValue', [])\n selectedFlatDataSource.value = []\n }\n else {\n radioSelectedKey.value = null\n emit('update:modelValue', null)\n }\n}\n\nfunction selectable(row: Record<string, any>, index: number) {\n if (props.selectable && isFn(props.selectable)) {\n return props.selectable(row, index, field.value)\n }\n return true\n}\n</script>\n\n<template>\n <div :class=\"`${stylePrefix}-select-table`\">\n <div\n v-if=\"currentSelectLength > 0 && props.showAlertToolbar\"\n :class=\"`${stylePrefix}-select-table-alert-container`\"\n >\n <span>已选择 {{ currentSelectLength }} 项</span>\n <ElLink\n type=\"primary\"\n :underline=\"lt(version, '2.9.9') ? false : 'never'\"\n style=\"margin-left: 8px;\"\n @click=\"onClearSelectionClick\"\n >\n 取消选择\n </ElLink>\n </div>\n <ElTable\n ref=\"elTableRef\"\n v-loading=\"props.loading\"\n v-bind=\"elTableProps\"\n :row-key=\"rowKey\"\n :row-class-name=\"props.clickRowToSelect ? `--click-row-select` : ''\"\n :data=\"props.dataSource\"\n :highlight-current-row=\"props.mode === 'single'\"\n @select=\"onSelect\"\n @select-all=\"onSelect\"\n @row-click=\"onRowClick\"\n >\n <ElTableColumn\n v-if=\"props.mode === 'multiple'\"\n type=\"selection\"\n :selectable=\"selectable\"\n />\n <ElTableColumn\n v-else\n width=\"46\"\n >\n <template #default=\"{ row }\">\n <ElRadioGroup v-model=\"radioSelectedKey\" style=\"width: 100%;\">\n <ElRadio\n v-bind=\"compatibleRadioValue(row[rowKey])\"\n @change=\"() => onRadioClick(row)\"\n >\n &nbsp;\n </ElRadio>\n </ElRadioGroup>\n </template>\n </ElTableColumn>\n <template v-if=\"props.columns.length === 0\">\n <slot />\n </template>\n <template v-else>\n <ElTableColumn\n v-for=\"colItem of props.columns\"\n v-bind=\"colItem\"\n :key=\"colItem.prop || colItem.type\"\n />\n </template>\n </ElTable>\n </div>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\r\nimport InnerSelectTable from './select-table.vue'\r\nimport './style.scss'\r\n\r\nconst SelectTable = connect<typeof InnerSelectTable>(\n InnerSelectTable,\n mapProps({ dataSource: 'dataSource', loading: 'loading' }),\r\n)\r\n\r\nexport { SelectTable }\r\n\r\nexport default SelectTable\r\n"],"names":["props","__props","emit","__emit","elTableProps","useAttrs","field","useField","compatibleRadioValue","key","lt","version","elTableRef","ref","rowKey","getInitialSelectedList","item","initialSelectedList","selectedFlatDataSource","prevSelection","radioSelectedKey","currentSelectLength","computed","isValid","watch","selectedKeys","uniq","nextTick","onRadioClick","value","loading","currentDisplayDataKeys","valueKeys","isEqual","diffItems","xor","tableItem","shouldSelect","onSelect","newSelection","removedItemList","differenceWith","itemPrev","itemNext","uniqWith","removedKeys","remove","onRowClick","row","_","event","checkboxDOM","radioDOM","onClearSelectionClick","selectable","index","isFn","_createElementBlock","_unref","stylePrefix","_createElementVNode","_toDisplayString","_createVNode","ElLink","_cache","_withDirectives","_openBlock","_createBlock","_mergeProps","ElTableColumn","_withCtx","ElRadioGroup","$event","_renderSlot","_ctx","_Fragment","_renderList","colItem","vLoading","SelectTable","connect","InnerSelectTable","mapProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,UAAMA,IAAQC,GAYRC,IAAOC,GAEPC,IAAeC,GAAA,GACfC,IAAQC,EAAA;AAEd,aAASC,EAAqBC,GAAa;AACzC,aAAOC,EAAGC,GAAS,OAAO,IAAI,EAAE,OAAOF,EAAA,IAAQ,EAAE,OAAOA,EAAA;AAAA,IAC1D;AAEA,UAAMG,IAAaC,EAAA,GACbC,IAASd,EAAM;AACrB,aAASe,IAAyB;AAChC,aAAIf,EAAM,SAAS,aACVA,EAAM,YAAY,IAAI,CAACgB,MACvBhB,EAAM,gBAKJgB,IAJE;AAAA,QACL,CAACF,CAAM,GAAGE;AAAA,MAAA,CAIf,KAAK,CAAA,IAGChB,EAAM,gBAAgB,CAACA,EAAM,UAAU,IAAI,CAAC,EAAE,CAACc,CAAM,GAAGd,EAAM,YAAY;AAAA,IAErF;AACA,UAAMiB,IAAsBF,EAAA,GACtBG,IAAyBL,EAAII,CAAmB;AAEtD,QAAIE,IAAgB,CAAA;AAEpB,UAAMC,IAAmBP,EAAA,GAEnBQ,IAAsBC,EAAS,MAC/BtB,EAAM,SAAS,aACV,MAAM,QAAQA,EAAM,UAAU,IAAIA,EAAM,WAAW,SAAS,IAG5DuB,GAAQH,EAAiB,KAAK,IAAI,IAAI,CAEhD;AAED,IAAAI;AAAA,MACE,MAAMxB,EAAM;AAAA,MACZ,YAAY;AACV,cAAMyB,IAAeC;AAAA,UACnBR,EAAuB,MAAM,IAAI,CAAAF,MAAQA,EAAKF,CAAM,CAAC;AAAA,QAAA;AAEvD,cAAMa,EAAA;AACN,mBAAWX,KAAQhB,EAAM;AACvB,UAAIyB,EAAa,SAAST,EAAKF,CAAM,CAAC,MAChCd,EAAM,SAAS,aACjBY,EAAW,OAAO,mBAAmBI,GAAM,IAAMhB,EAAM,gBAA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?? null);
1
+ function t(n) {
2
+ if (n instanceof HTMLElement)
3
+ return n;
4
+ const e = n?.$el;
5
+ return e instanceof HTMLElement ? e : null;
4
6
  }
5
- function n(e) {
6
- const r = e?.exposed?.drawerRef;
7
- if (r instanceof HTMLElement)
8
- return r;
9
- const o = e?.$refs?.drawerRef;
10
- return o instanceof HTMLElement ? o : e?.$el ?? null;
7
+ function o(n) {
8
+ const e = n;
9
+ return t(e?.dialogContentRef) ?? t(e?.exposed?.dialogContentRef) ?? t(e);
10
+ }
11
+ function r(n) {
12
+ const e = n;
13
+ return t(e?.exposed?.drawerRef) ?? t(e?.$refs?.drawerRef) ?? t(e);
11
14
  }
12
15
  export {
13
- l as resolveDialogElement,
14
- n as resolveDrawerElement
16
+ o as resolveDialogElement,
17
+ r as resolveDrawerElement
15
18
  };
16
19
  //# sourceMappingURL=overlay-elements.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"overlay-elements.mjs","sources":["../../src/shared/overlay-elements.ts"],"sourcesContent":["import type { ComponentPublicInstance } from 'vue'\r\n\r\nexport type DialogLikeInstance = ComponentPublicInstance<{ dialogContentRef?: ComponentPublicInstance | null }> | null\r\n\r\nexport function resolveDialogElement(instance: DialogLikeInstance): HTMLElement | null {\r\n const exposedDialogRef = (instance as ComponentPublicInstance & { dialogContentRef?: ComponentPublicInstance | null } | null)?.dialogContentRef\r\n ?? (instance as ComponentPublicInstance & { exposed?: Record<string, any> } | null)?.exposed?.dialogContentRef\r\n const dialogElement = exposedDialogRef?.$el as HTMLElement | undefined\r\n if (dialogElement)\r\n return dialogElement\r\n\r\n return (instance?.$el as HTMLElement | undefined) ?? null\r\n}\r\n\r\nexport function resolveDrawerElement(instance: ComponentPublicInstance | null): HTMLElement | null {\r\n const exposedDrawer = (instance as ComponentPublicInstance & { exposed?: Record<string, any> } | null)?.exposed?.drawerRef\r\n if (exposedDrawer instanceof HTMLElement)\r\n return exposedDrawer\r\n\r\n const drawerFromRefs = (instance as ComponentPublicInstance & { $refs?: Record<string, any> } | null)?.$refs?.drawerRef\r\n if (drawerFromRefs instanceof HTMLElement)\r\n return drawerFromRefs\r\n\r\n return (instance?.$el as HTMLElement | undefined) ?? null\r\n}\r\n"],"names":["resolveDialogElement","instance","dialogElement","resolveDrawerElement","exposedDrawer","drawerFromRefs"],"mappings":"AAIO,SAASA,EAAqBC,GAAkD;AAGrF,QAAMC,KAFoBD,GAAqG,oBACzHA,GAAiF,SAAS,mBACxD;AACxC,SAAIC,MAGID,GAAU,OAAmC;AACvD;AAEO,SAASE,EAAqBF,GAA8D;AACjG,QAAMG,IAAiBH,GAAiF,SAAS;AACjH,MAAIG,aAAyB;AAC3B,WAAOA;AAET,QAAMC,IAAkBJ,GAA+E,OAAO;AAC9G,SAAII,aAA0B,cACrBA,IAEDJ,GAAU,OAAmC;AACvD;"}
1
+ {"version":3,"file":"overlay-elements.mjs","sources":["../../src/shared/overlay-elements.ts"],"sourcesContent":["import type { ComponentPublicInstance } from 'vue'\n\nexport type DialogLikeInstance = ComponentPublicInstance<{ dialogContentRef?: ComponentPublicInstance | null }> | null\n\ntype OverlayLikeInstance = ComponentPublicInstance & {\n exposed?: Record<string, any>\n $refs?: Record<string, any>\n dialogContentRef?: ComponentPublicInstance | null\n}\n\nfunction toHTMLElement(target: unknown): HTMLElement | null {\n if (target instanceof HTMLElement)\n return target\n\n const element = (target as { $el?: unknown } | null | undefined)?.$el\n return element instanceof HTMLElement ? element : null\n}\n\nexport function resolveDialogElement(instance: DialogLikeInstance): HTMLElement | null {\n const vm = instance as OverlayLikeInstance | null\n return toHTMLElement(vm?.dialogContentRef)\n ?? toHTMLElement(vm?.exposed?.dialogContentRef)\n ?? toHTMLElement(vm)\n}\n\nexport function resolveDrawerElement(instance: ComponentPublicInstance | null): HTMLElement | null {\n const vm = instance as OverlayLikeInstance | null\n return toHTMLElement(vm?.exposed?.drawerRef)\n ?? toHTMLElement(vm?.$refs?.drawerRef)\n ?? toHTMLElement(vm)\n}\n"],"names":["toHTMLElement","target","element","resolveDialogElement","instance","vm","resolveDrawerElement"],"mappings":"AAUA,SAASA,EAAcC,GAAqC;AAC1D,MAAIA,aAAkB;AACpB,WAAOA;AAET,QAAMC,IAAWD,GAAiD;AAClE,SAAOC,aAAmB,cAAcA,IAAU;AACpD;AAEO,SAASC,EAAqBC,GAAkD;AACrF,QAAMC,IAAKD;AACX,SAAOJ,EAAcK,GAAI,gBAAgB,KACpCL,EAAcK,GAAI,SAAS,gBAAgB,KAC3CL,EAAcK,CAAE;AACvB;AAEO,SAASC,EAAqBF,GAA8D;AACjG,QAAMC,IAAKD;AACX,SAAOJ,EAAcK,GAAI,SAAS,SAAS,KACtCL,EAAcK,GAAI,OAAO,SAAS,KAClCL,EAAcK,CAAE;AACvB;"}
@@ -1,14 +1,17 @@
1
- import { connect as r, mapProps as e } from "@silver-formily/vue";
2
- import { ElSlider as o } from "element-plus";
3
- import { PreviewText as t } from "../preview-text/index.mjs";
4
- import { mapReadPretty as m } from "../__builtins__/shared/transform-component.mjs";
5
- const l = r(
6
- o,
7
- e({ readOnly: "readonly", disabled: !0 }),
8
- m(t.Input)
1
+ import { connect as r, mapProps as o } from "@silver-formily/vue";
2
+ import { ElSlider as t } from "element-plus";
3
+ import "@formily/reactive";
4
+ import "@vueuse/core";
5
+ import "vue";
6
+ import { mapReadPretty as e } from "../__builtins__/shared/transform-component.mjs";
7
+ import { PreviewText as m } from "../preview-text/index.mjs";
8
+ const s = r(
9
+ t,
10
+ o({ readOnly: "readonly", disabled: !0 }),
11
+ e(m.Input)
9
12
  );
10
13
  export {
11
- l as Slider,
12
- l as default
14
+ s as Slider,
15
+ s as default
13
16
  };
14
17
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/slider/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\r\nimport { ElSlider } from 'element-plus'\r\nimport { mapReadPretty } from '../__builtins__'\r\nimport { PreviewText } from '../preview-text'\r\n\r\nexport type SliderProps = typeof ElSlider\r\n\r\nexport const Slider = connect<typeof ElSlider>(\r\n ElSlider,\r\n mapProps({ readOnly: 'readonly', disabled: true }),\r\n mapReadPretty(PreviewText.Input),\r\n)\r\n\r\nexport default Slider\r\n"],"names":["Slider","connect","ElSlider","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;AAOO,MAAMA,IAASC;AAAA,EACpBC;AAAA,EACAC,EAAS,EAAE,UAAU,YAAY,UAAU,IAAM;AAAA,EACjDC,EAAcC,EAAY,KAAK;AACjC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/slider/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\nimport { ElSlider } from 'element-plus'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\n\nexport type SliderProps = typeof ElSlider\n\nexport const Slider = connect<typeof ElSlider>(\n ElSlider,\n mapProps({ readOnly: 'readonly', disabled: true }),\n mapReadPretty(PreviewText.Input),\n)\n\nexport default Slider\n"],"names":["Slider","connect","ElSlider","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;AAOO,MAAMA,IAASC;AAAA,EACpBC;AAAA,EACAC,EAAS,EAAE,UAAU,YAAY,UAAU,IAAM;AAAA,EACjDC,EAAcC,EAAY,KAAK;AACjC;"}
@@ -1 +1 @@
1
- .formily-element-plus-form-button-group{padding:10px 0;background-color:var(--el-bg-color)}.formily-element-plus-form-button-group__sticky .el-affix--fixed{border-top:1px solid var(--el-border-color)}
1
+ .formily-element-plus-form-item--isolated{display:flex;--font-size: 14px;--el-form-label-font-size: var(--font-size)}.formily-element-plus-form-item--isolated.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label-wrap>.el-form-item__label:before,.formily-element-plus-form-item--isolated.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label:before{color:var(--el-color-danger);content:"*";margin-right:4px}.formily-element-plus-form-item--isolated.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label-wrap>.el-form-item__label:after,.formily-element-plus-form-item--isolated.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label:after{color:var(--el-color-danger);content:"*";margin-left:4px}.formily-element-plus-form-item .el-form-item__content{display:block}.formily-element-plus-form-item.el-form-item--label-top .el-form-item__label{display:inline-flex;align-items:center}.formily-element-plus-form-item .formily-element-plus-form-item-col-0{display:none}.formily-element-plus-form-item .formily-element-plus-form-item-col-1{flex:0 0 4.1666666667%;max-width:4.1666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-2{flex:0 0 8.3333333333%;max-width:8.3333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-3{flex:0 0 12.5%;max-width:12.5%}.formily-element-plus-form-item .formily-element-plus-form-item-col-4{flex:0 0 16.6666666667%;max-width:16.6666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-5{flex:0 0 20.8333333333%;max-width:20.8333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-6{flex:0 0 25%;max-width:25%}.formily-element-plus-form-item .formily-element-plus-form-item-col-7{flex:0 0 29.1666666667%;max-width:29.1666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-8{flex:0 0 33.3333333333%;max-width:33.3333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-9{flex:0 0 37.5%;max-width:37.5%}.formily-element-plus-form-item .formily-element-plus-form-item-col-10{flex:0 0 41.6666666667%;max-width:41.6666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-11{flex:0 0 45.8333333333%;max-width:45.8333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-12{flex:0 0 50%;max-width:50%}.formily-element-plus-form-item .formily-element-plus-form-item-col-13{flex:0 0 54.1666666667%;max-width:54.1666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-14{flex:0 0 58.3333333333%;max-width:58.3333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-15{flex:0 0 62.5%;max-width:62.5%}.formily-element-plus-form-item .formily-element-plus-form-item-col-16{flex:0 0 66.6666666667%;max-width:66.6666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-17{flex:0 0 70.8333333333%;max-width:70.8333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-18{flex:0 0 75%;max-width:75%}.formily-element-plus-form-item .formily-element-plus-form-item-col-19{flex:0 0 79.1666666667%;max-width:79.1666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-20{flex:0 0 83.3333333333%;max-width:83.3333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-21{flex:0 0 87.5%;max-width:87.5%}.formily-element-plus-form-item .formily-element-plus-form-item-col-22{flex:0 0 91.6666666667%;max-width:91.6666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-23{flex:0 0 95.8333333333%;max-width:95.8333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-24{flex:0 0 100%;max-width:100%}.formily-element-plus-form-item-label__wrapper{display:flex;overflow:hidden}.is-warp .formily-element-plus-form-item-label-content>span{overflow:visible;white-space:wrap}.is-warp .el-form-item__content{align-items:flex-start;flex-direction:column}.is-warp .el-form-item__label{height:auto}.formily-element-plus-form-item-label-content{display:flex;align-items:center;flex:1;overflow:hidden}.formily-element-plus-form-item-label-content>span{display:inline;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.formily-element-plus-form-item-label-content.is-tooltip{border-bottom:1px dashed;border-color:var(--el-border-color)}.formily-element-plus-form-item-label-tooltip{margin-left:4px;color:var(--el-text-color-secondary);display:flex;align-items:center;height:32px;cursor:pointer}.formily-element-plus-form-item-colon{display:flex;margin-left:2px;line-height:2.3}.formily-element-plus-form-item-content__wrapper{display:flex;flex:1}.formily-element-plus-form-item-content__wrapper .is-fullness>div{width:100%}.formily-element-plus-form-item-addon-before{margin-right:8px;font-size:var(--el-font-size-base)}.formily-element-plus-form-item-addon-after{margin-left:8px}.formily-element-plus-form-item-addon-before,.formily-element-plus-form-item-addon-after{display:inline-flex;align-items:center;min-height:32px;flex-shrink:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular)}.el-form-item__content.is-addon-after{flex:unset}.formily-element-plus-form-item-feedback{color:var(--el-text-color-secondary);font-size:12px;line-height:1;padding-top:2px}.formily-element-plus-form-item-feedback.is-error{color:var(--el-color-danger)}.formily-element-plus-form-item-feedback.is-success{color:var(--el-color-success)}.formily-element-plus-form-item-feedback.is-warning{color:var(--el-color-warning)}.formily-element-plus-form-item-feedback.is-loose{position:absolute;top:100%;left:0}.formily-element-plus-form-item-feedback.is-tooltip{font-size:var(--el-font-size-base);display:inline-flex}.formily-element-plus-form-item-feedback.is-tooltip i{margin-right:4px}.formily-element-plus-form-item-extra{color:var(--el-text-color-secondary);font-size:12px;line-height:1;padding-top:2px}.formily-element-plus-form-item{margin-bottom:6px}.formily-element-plus-form-item.is-loose{margin-bottom:18px}.el-form-item.is-warning .el-input__wrapper,.el-form-item.is-warning .el-input__wrapper:hover,.el-form-item.is-warning .el-input__wrapper:focus,.el-form-item.is-warning .el-input__wrapper.is-focus,.el-form-item.is-warning .el-textarea__inner,.el-form-item.is-warning .el-textarea__inner:hover,.el-form-item.is-warning .el-textarea__inner:focus,.el-form-item.is-warning .el-textarea__inner.is-focus,.el-form-item.is-warning .el-select__wrapper,.el-form-item.is-warning .el-select__wrapper:hover,.el-form-item.is-warning .el-select__wrapper:focus,.el-form-item.is-warning .el-select__wrapper.is-focus,.el-form-item.is-warning .el-input-tag__wrapper,.el-form-item.is-warning .el-input-tag__wrapper:hover,.el-form-item.is-warning .el-input-tag__wrapper:focus,.el-form-item.is-warning .el-input-tag__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-color-warning) inset}.formily-element-plus-form-button-group{padding:10px 0;background-color:var(--el-bg-color)}.formily-element-plus-form-button-group .formily-element-plus-form-item-colon{visibility:hidden}.formily-element-plus-form-button-group--inline{padding:0;background-color:transparent}.formily-element-plus-form-button-group__sticky .el-affix--fixed{border-top:1px solid var(--el-border-color)}
@@ -1 +1 @@
1
- .formily-element-plus-form-item .el-form-item__content{display:block}.formily-element-plus-form-item.el-form-item--label-top .el-form-item__label{display:inline-flex;align-items:center}.formily-element-plus-form-item .formily-element-plus-form-item-col-0{display:none}.formily-element-plus-form-item .formily-element-plus-form-item-col-1{flex:0 0 4.1666666667%;max-width:4.1666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-2{flex:0 0 8.3333333333%;max-width:8.3333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-3{flex:0 0 12.5%;max-width:12.5%}.formily-element-plus-form-item .formily-element-plus-form-item-col-4{flex:0 0 16.6666666667%;max-width:16.6666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-5{flex:0 0 20.8333333333%;max-width:20.8333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-6{flex:0 0 25%;max-width:25%}.formily-element-plus-form-item .formily-element-plus-form-item-col-7{flex:0 0 29.1666666667%;max-width:29.1666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-8{flex:0 0 33.3333333333%;max-width:33.3333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-9{flex:0 0 37.5%;max-width:37.5%}.formily-element-plus-form-item .formily-element-plus-form-item-col-10{flex:0 0 41.6666666667%;max-width:41.6666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-11{flex:0 0 45.8333333333%;max-width:45.8333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-12{flex:0 0 50%;max-width:50%}.formily-element-plus-form-item .formily-element-plus-form-item-col-13{flex:0 0 54.1666666667%;max-width:54.1666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-14{flex:0 0 58.3333333333%;max-width:58.3333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-15{flex:0 0 62.5%;max-width:62.5%}.formily-element-plus-form-item .formily-element-plus-form-item-col-16{flex:0 0 66.6666666667%;max-width:66.6666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-17{flex:0 0 70.8333333333%;max-width:70.8333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-18{flex:0 0 75%;max-width:75%}.formily-element-plus-form-item .formily-element-plus-form-item-col-19{flex:0 0 79.1666666667%;max-width:79.1666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-20{flex:0 0 83.3333333333%;max-width:83.3333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-21{flex:0 0 87.5%;max-width:87.5%}.formily-element-plus-form-item .formily-element-plus-form-item-col-22{flex:0 0 91.6666666667%;max-width:91.6666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-23{flex:0 0 95.8333333333%;max-width:95.8333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-24{flex:0 0 100%;max-width:100%}.formily-element-plus-form-item-label__wrapper{display:flex;overflow:hidden}.is-warp .formily-element-plus-form-item-label-content>span{overflow:visible;white-space:wrap}.is-warp .el-form-item__content{align-items:flex-start;flex-direction:column}.is-warp .el-form-item__label{height:auto}.formily-element-plus-form-item-label-content{display:flex;align-items:center;flex:1;overflow:hidden}.formily-element-plus-form-item-label-content>span{display:inline;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.formily-element-plus-form-item-label-content.is-tooltip{border-bottom:1px dashed;border-color:var(--el-border-color)}.formily-element-plus-form-item-label-tooltip{margin-left:4px;color:var(--el-text-color-secondary);display:flex;align-items:center;height:32px;cursor:pointer}.formily-element-plus-form-item-colon{display:flex;margin-left:2px;line-height:2.3}.formily-element-plus-form-item-content__wrapper{display:flex;flex:1}.formily-element-plus-form-item-content__wrapper .is-fullness>div{width:100%}.formily-element-plus-form-item-addon-before{margin-right:8px;font-size:var(--el-font-size-base)}.formily-element-plus-form-item-addon-after{margin-left:8px}.formily-element-plus-form-item-addon-before,.formily-element-plus-form-item-addon-after{display:inline-flex;align-items:center;min-height:32px;flex-shrink:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular)}.el-form-item__content.is-addon-after{flex:unset}.formily-element-plus-form-item-feedback{color:var(--el-text-color-secondary);font-size:12px;line-height:1;padding-top:2px}.formily-element-plus-form-item-feedback.is-error{color:var(--el-color-danger)}.formily-element-plus-form-item-feedback.is-success{color:var(--el-color-success)}.formily-element-plus-form-item-feedback.is-warning{color:var(--el-color-warning)}.formily-element-plus-form-item-feedback.is-loose{position:absolute;top:100%;left:0}.formily-element-plus-form-item-feedback.is-tooltip{font-size:var(--el-font-size-base);display:inline-flex}.formily-element-plus-form-item-feedback.is-tooltip i{margin-right:4px}.formily-element-plus-form-item-extra{color:var(--el-text-color-secondary);font-size:12px;line-height:1;padding-top:2px}.formily-element-plus-form-item{margin-bottom:6px}.formily-element-plus-form-item.is-loose{margin-bottom:18px}.el-form-item.is-warning .el-input__wrapper,.el-form-item.is-warning .el-input__wrapper:hover,.el-form-item.is-warning .el-input__wrapper:focus,.el-form-item.is-warning .el-input__wrapper.is-focus,.el-form-item.is-warning .el-textarea__inner,.el-form-item.is-warning .el-textarea__inner:hover,.el-form-item.is-warning .el-textarea__inner:focus,.el-form-item.is-warning .el-textarea__inner.is-focus,.el-form-item.is-warning .el-select__wrapper,.el-form-item.is-warning .el-select__wrapper:hover,.el-form-item.is-warning .el-select__wrapper:focus,.el-form-item.is-warning .el-select__wrapper.is-focus,.el-form-item.is-warning .el-input-tag__wrapper,.el-form-item.is-warning .el-input-tag__wrapper:hover,.el-form-item.is-warning .el-input-tag__wrapper:focus,.el-form-item.is-warning .el-input-tag__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-color-warning) inset}
1
+ .formily-element-plus-form-item--isolated{display:flex;--font-size: 14px;--el-form-label-font-size: var(--font-size)}.formily-element-plus-form-item--isolated.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label-wrap>.el-form-item__label:before,.formily-element-plus-form-item--isolated.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label:before{color:var(--el-color-danger);content:"*";margin-right:4px}.formily-element-plus-form-item--isolated.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label-wrap>.el-form-item__label:after,.formily-element-plus-form-item--isolated.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label:after{color:var(--el-color-danger);content:"*";margin-left:4px}.formily-element-plus-form-item .el-form-item__content{display:block}.formily-element-plus-form-item.el-form-item--label-top .el-form-item__label{display:inline-flex;align-items:center}.formily-element-plus-form-item .formily-element-plus-form-item-col-0{display:none}.formily-element-plus-form-item .formily-element-plus-form-item-col-1{flex:0 0 4.1666666667%;max-width:4.1666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-2{flex:0 0 8.3333333333%;max-width:8.3333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-3{flex:0 0 12.5%;max-width:12.5%}.formily-element-plus-form-item .formily-element-plus-form-item-col-4{flex:0 0 16.6666666667%;max-width:16.6666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-5{flex:0 0 20.8333333333%;max-width:20.8333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-6{flex:0 0 25%;max-width:25%}.formily-element-plus-form-item .formily-element-plus-form-item-col-7{flex:0 0 29.1666666667%;max-width:29.1666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-8{flex:0 0 33.3333333333%;max-width:33.3333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-9{flex:0 0 37.5%;max-width:37.5%}.formily-element-plus-form-item .formily-element-plus-form-item-col-10{flex:0 0 41.6666666667%;max-width:41.6666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-11{flex:0 0 45.8333333333%;max-width:45.8333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-12{flex:0 0 50%;max-width:50%}.formily-element-plus-form-item .formily-element-plus-form-item-col-13{flex:0 0 54.1666666667%;max-width:54.1666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-14{flex:0 0 58.3333333333%;max-width:58.3333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-15{flex:0 0 62.5%;max-width:62.5%}.formily-element-plus-form-item .formily-element-plus-form-item-col-16{flex:0 0 66.6666666667%;max-width:66.6666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-17{flex:0 0 70.8333333333%;max-width:70.8333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-18{flex:0 0 75%;max-width:75%}.formily-element-plus-form-item .formily-element-plus-form-item-col-19{flex:0 0 79.1666666667%;max-width:79.1666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-20{flex:0 0 83.3333333333%;max-width:83.3333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-21{flex:0 0 87.5%;max-width:87.5%}.formily-element-plus-form-item .formily-element-plus-form-item-col-22{flex:0 0 91.6666666667%;max-width:91.6666666667%}.formily-element-plus-form-item .formily-element-plus-form-item-col-23{flex:0 0 95.8333333333%;max-width:95.8333333333%}.formily-element-plus-form-item .formily-element-plus-form-item-col-24{flex:0 0 100%;max-width:100%}.formily-element-plus-form-item-label__wrapper{display:flex;overflow:hidden}.is-warp .formily-element-plus-form-item-label-content>span{overflow:visible;white-space:wrap}.is-warp .el-form-item__content{align-items:flex-start;flex-direction:column}.is-warp .el-form-item__label{height:auto}.formily-element-plus-form-item-label-content{display:flex;align-items:center;flex:1;overflow:hidden}.formily-element-plus-form-item-label-content>span{display:inline;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.formily-element-plus-form-item-label-content.is-tooltip{border-bottom:1px dashed;border-color:var(--el-border-color)}.formily-element-plus-form-item-label-tooltip{margin-left:4px;color:var(--el-text-color-secondary);display:flex;align-items:center;height:32px;cursor:pointer}.formily-element-plus-form-item-colon{display:flex;margin-left:2px;line-height:2.3}.formily-element-plus-form-item-content__wrapper{display:flex;flex:1}.formily-element-plus-form-item-content__wrapper .is-fullness>div{width:100%}.formily-element-plus-form-item-addon-before{margin-right:8px;font-size:var(--el-font-size-base)}.formily-element-plus-form-item-addon-after{margin-left:8px}.formily-element-plus-form-item-addon-before,.formily-element-plus-form-item-addon-after{display:inline-flex;align-items:center;min-height:32px;flex-shrink:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular)}.el-form-item__content.is-addon-after{flex:unset}.formily-element-plus-form-item-feedback{color:var(--el-text-color-secondary);font-size:12px;line-height:1;padding-top:2px}.formily-element-plus-form-item-feedback.is-error{color:var(--el-color-danger)}.formily-element-plus-form-item-feedback.is-success{color:var(--el-color-success)}.formily-element-plus-form-item-feedback.is-warning{color:var(--el-color-warning)}.formily-element-plus-form-item-feedback.is-loose{position:absolute;top:100%;left:0}.formily-element-plus-form-item-feedback.is-tooltip{font-size:var(--el-font-size-base);display:inline-flex}.formily-element-plus-form-item-feedback.is-tooltip i{margin-right:4px}.formily-element-plus-form-item-extra{color:var(--el-text-color-secondary);font-size:12px;line-height:1;padding-top:2px}.formily-element-plus-form-item{margin-bottom:6px}.formily-element-plus-form-item.is-loose{margin-bottom:18px}.el-form-item.is-warning .el-input__wrapper,.el-form-item.is-warning .el-input__wrapper:hover,.el-form-item.is-warning .el-input__wrapper:focus,.el-form-item.is-warning .el-input__wrapper.is-focus,.el-form-item.is-warning .el-textarea__inner,.el-form-item.is-warning .el-textarea__inner:hover,.el-form-item.is-warning .el-textarea__inner:focus,.el-form-item.is-warning .el-textarea__inner.is-focus,.el-form-item.is-warning .el-select__wrapper,.el-form-item.is-warning .el-select__wrapper:hover,.el-form-item.is-warning .el-select__wrapper:focus,.el-form-item.is-warning .el-select__wrapper.is-focus,.el-form-item.is-warning .el-input-tag__wrapper,.el-form-item.is-warning .el-input-tag__wrapper:hover,.el-form-item.is-warning .el-input-tag__wrapper:focus,.el-form-item.is-warning .el-input-tag__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-color-warning) inset}
@@ -0,0 +1 @@
1
+ .formily-element-plus-query-form__actions{display:flex;justify-content:space-between;width:100%}.formily-element-plus-query-form__actions--row-end{justify-content:flex-end}.formily-element-plus-query-form__collapse-link .el-link__inner{display:inline-flex;align-items:center;gap:4px;margin:0 8px}.formily-element-plus-query-form__collapse-icon{font-size:12px}.formily-element-plus-query-form-light__content{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px 12px}
@@ -0,0 +1 @@
1
+ .formily-element-plus-query-form-item{display:flex;flex-direction:column}.formily-element-plus-query-form-item__pagination{justify-content:flex-end;margin-top:8px}.formily-element-plus-query-form-item__pagination .el-pagination__total{flex:1}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/submit/submit.vue","../../src/submit/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\r\nimport type { IFormFeedback } from '@formily/core'\r\nimport type { PropType } from 'vue'\r\nimport { useParentForm } from '@silver-formily/vue'\r\nimport { ElButton } from 'element-plus'\r\n\r\ndefineOptions({\r\n name: 'FSubmit',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps({\r\n onClick: Function as PropType<(e: MouseEvent) => any>,\r\n onSubmit: Function as PropType<(values: any) => Promise<any>>,\r\n onSubmitSuccess: Function as PropType<(payload: any) => void>,\r\n onSubmitFailed: Function as PropType<(feedbacks: IFormFeedback[]) => void>,\r\n submit: Boolean,\r\n loading: Boolean,\r\n})\r\n\r\nconst formRef = useParentForm()\r\n\r\nfunction handleClick(e: MouseEvent) {\r\n if (props.onClick?.(e) === false)\r\n return\r\n if (props.onSubmit) {\r\n const form = formRef?.value\r\n form?.submit(props.onSubmit)\r\n .then(props.onSubmitSuccess)\r\n .catch(props.onSubmitFailed ?? console.log)\r\n }\r\n}\r\n</script>\r\n\r\n<template>\r\n <ElButton\r\n :native-type=\"props.submit ? 'button' : 'submit'\"\r\n type=\"primary\"\r\n v-bind=\"$attrs\"\r\n :loading=\"formRef?.submitting ?? props.loading\"\r\n @click=\"handleClick\"\r\n >\r\n <template #default>\r\n <slot />\r\n </template>\r\n </ElButton>\r\n</template>\r\n","import { observer } from '@silver-formily/reactive-vue'\r\nimport FSubmit from './submit.vue'\r\n\r\nexport const Submit = observer(FSubmit)\r\n\r\nexport default Submit\r\n"],"names":["props","__props","formRef","useParentForm","handleClick","e","_openBlock","_createBlock","_unref","_mergeProps","$attrs","_renderSlot","_ctx","Submit","observer","FSubmit"],"mappings":";;;;;;;;;;;;;;;;;AAWA,UAAMA,IAAQC,GASRC,IAAUC,EAAA;AAEhB,aAASC,EAAYC,GAAe;AAClC,MAAIL,EAAM,UAAUK,CAAC,MAAM,MAEvBL,EAAM,YACKE,GAAS,OAChB,OAAOF,EAAM,QAAQ,EACxB,KAAKA,EAAM,eAAe,EAC1B,MAAMA,EAAM,kBAAkB,QAAQ,GAAG;AAAA,IAEhD;sBAIEM,KAAAC,EAUWC,MAVXC,EAUW;AAAA,MATR,eAAaT,EAAM,SAAM,WAAA;AAAA,MAC1B,MAAK;AAAA,IAAA,GACGU,EAAAA,QAAM;AAAA,MACb,SAASF,EAAAN,CAAA,GAAS,cAAcF,EAAM;AAAA,MACtC,SAAOI;AAAA,IAAA;MAEG,WACT,MAAQ;AAAA,QAARO,EAAQC,EAAA,QAAA,SAAA;AAAA,MAAA;;;;ICxCDC,IAASC,EAASC,CAAO;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/submit/submit.vue","../../src/submit/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { IFormFeedback } from '@formily/core'\nimport type { PropType } from 'vue'\nimport { useParentForm } from '@silver-formily/vue'\nimport { ElButton } from 'element-plus'\n\ndefineOptions({\n name: 'FSubmit',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n onClick: Function as PropType<(e: MouseEvent) => any>,\n onSubmit: Function as PropType<(values: any) => Promise<any>>,\n onSubmitSuccess: Function as PropType<(payload: any) => void>,\n onSubmitFailed: Function as PropType<(feedbacks: IFormFeedback[]) => void>,\n submit: Boolean,\n loading: Boolean,\n})\n\nconst formRef = useParentForm()\n\nfunction handleClick(e: MouseEvent) {\n if (props.onClick?.(e) === false)\n return\n if (props.onSubmit) {\n const form = formRef?.value\n form?.submit(props.onSubmit)\n .then(props.onSubmitSuccess)\n .catch(props.onSubmitFailed ?? console.log)\n }\n}\n</script>\n\n<template>\n <ElButton\n :native-type=\"props.submit ? 'button' : 'submit'\"\n type=\"primary\"\n v-bind=\"$attrs\"\n :loading=\"formRef?.submitting ?? props.loading\"\n @click=\"handleClick\"\n >\n <template #default>\n <slot />\n </template>\n </ElButton>\n</template>\n","import { observer } from '@silver-formily/reactive-vue'\nimport FSubmit from './submit.vue'\n\nexport const Submit = observer(FSubmit)\n\nexport default Submit\n"],"names":["props","__props","formRef","useParentForm","handleClick","e","_openBlock","_createBlock","_unref","_mergeProps","$attrs","_renderSlot","_ctx","Submit","observer","FSubmit"],"mappings":";;;;;;;;;;;;;;;;;AAWA,UAAMA,IAAQC,GASRC,IAAUC,EAAA;AAEhB,aAASC,EAAYC,GAAe;AAClC,MAAIL,EAAM,UAAUK,CAAC,MAAM,MAEvBL,EAAM,YACKE,GAAS,OAChB,OAAOF,EAAM,QAAQ,EACxB,KAAKA,EAAM,eAAe,EAC1B,MAAMA,EAAM,kBAAkB,QAAQ,GAAG;AAAA,IAEhD;sBAIEM,KAAAC,EAUWC,MAVXC,EAUW;AAAA,MATR,eAAaT,EAAM,SAAM,WAAA;AAAA,MAC1B,MAAK;AAAA,IAAA,GACGU,EAAAA,QAAM;AAAA,MACb,SAASF,EAAAN,CAAA,GAAS,cAAcF,EAAM;AAAA,MACtC,SAAOI;AAAA,IAAA;MAEG,WACT,MAAQ;AAAA,QAARO,EAAQC,EAAA,QAAA,SAAA;AAAA,MAAA;;;;ICxCDC,IAASC,EAASC,CAAO;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/switch/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\r\nimport { ElSwitch } from 'element-plus'\r\n\r\nexport type SwitchProps = typeof ElSwitch\r\n\r\nexport const Switch = connect<typeof ElSwitch>(\r\n ElSwitch,\r\n mapProps({\r\n readOnly: 'readonly',\r\n }),\r\n)\r\n\r\nexport default Switch\r\n"],"names":["Switch","connect","ElSwitch","mapProps"],"mappings":";;AAKO,MAAMA,IAASC;AAAA,EACpBC;AAAA,EACAC,EAAS;AAAA,IACP,UAAU;AAAA,EAAA,CACX;AACH;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/switch/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\nimport { ElSwitch } from 'element-plus'\n\nexport type SwitchProps = typeof ElSwitch\n\nexport const Switch = connect<typeof ElSwitch>(\n ElSwitch,\n mapProps({\n readOnly: 'readonly',\n }),\n)\n\nexport default Switch\n"],"names":["Switch","connect","ElSwitch","mapProps"],"mappings":";;AAKO,MAAMA,IAASC;AAAA,EACpBC;AAAA,EACAC,EAAS;AAAA,IACP,UAAU;AAAA,EAAA,CACX;AACH;"}
@@ -1,14 +1,17 @@
1
1
  import { connect as r, mapProps as e } from "@silver-formily/vue";
2
2
  import { ElTimePicker as m } from "element-plus";
3
- import { PreviewText as o } from "../preview-text/index.mjs";
4
- import { mapReadPretty as i } from "../__builtins__/shared/transform-component.mjs";
5
- const P = r(
3
+ import "@formily/reactive";
4
+ import "@vueuse/core";
5
+ import "vue";
6
+ import { mapReadPretty as o } from "../__builtins__/shared/transform-component.mjs";
7
+ import { PreviewText as i } from "../preview-text/index.mjs";
8
+ const d = r(
6
9
  m,
7
10
  e({ readOnly: "readonly" }),
8
- i(o.TimePicker)
11
+ o(i.TimePicker)
9
12
  );
10
13
  export {
11
- P as TimePicker,
12
- P as default
14
+ d as TimePicker,
15
+ d as default
13
16
  };
14
17
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/time-picker/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\r\nimport { ElTimePicker } from 'element-plus'\r\nimport { mapReadPretty } from '../__builtins__'\r\nimport { PreviewText } from '../preview-text'\r\n\r\nexport type TimePickerProps = typeof ElTimePicker\r\n\r\nexport const TimePicker = connect<typeof ElTimePicker>(\r\n ElTimePicker,\r\n mapProps({ readOnly: 'readonly' }),\r\n mapReadPretty(PreviewText.TimePicker),\r\n)\r\n\r\nexport default TimePicker\r\n"],"names":["TimePicker","connect","ElTimePicker","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;AAOO,MAAMA,IAAaC;AAAA,EACxBC;AAAA,EACAC,EAAS,EAAE,UAAU,YAAY;AAAA,EACjCC,EAAcC,EAAY,UAAU;AACtC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/time-picker/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\nimport { ElTimePicker } from 'element-plus'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\n\nexport type TimePickerProps = typeof ElTimePicker\n\nexport const TimePicker = connect<typeof ElTimePicker>(\n ElTimePicker,\n mapProps({ readOnly: 'readonly' }),\n mapReadPretty(PreviewText.TimePicker),\n)\n\nexport default TimePicker\n"],"names":["TimePicker","connect","ElTimePicker","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;AAOO,MAAMA,IAAaC;AAAA,EACxBC;AAAA,EACAC,EAAS,EAAE,UAAU,YAAY;AAAA,EACjCC,EAAcC,EAAY,UAAU;AACtC;"}