@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,19 +1,26 @@
1
- import { isOperationComponent as r, isAdditionComponent as t } from "../array-base/utils.mjs";
2
1
  import { stylePrefix as i } from "../__builtins__/configs/index.mjs";
3
- const m = `${i}-array-table`;
4
- function p(n) {
5
- return n["x-component"]?.indexOf("Column") > -1;
2
+ import "element-plus";
3
+ import "@formily/reactive";
4
+ import "@vueuse/core";
5
+ import "vue";
6
+ import "@formily/core";
7
+ import "@silver-formily/reactive-vue";
8
+ import "@silver-formily/vue";
9
+ import { isOperationComponent as n, isAdditionComponent as e } from "../array-base/utils.mjs";
10
+ const c = `${i}-array-table`;
11
+ function p(o) {
12
+ return o["x-component"]?.indexOf("Column") > -1;
6
13
  }
7
- function s(n) {
8
- return p(n) || r(n) || t(n);
14
+ function y(o) {
15
+ return p(o) || n(o) || e(o);
9
16
  }
10
- function l(n) {
11
- return n.reduceProperties((o, e) => o || !!e.required, !1);
17
+ function P(o) {
18
+ return o.reduceProperties((r, t) => r || !!t.required, !1);
12
19
  }
13
20
  export {
14
- l as hasRequiredProperty,
21
+ P as hasRequiredProperty,
15
22
  p as isColumnComponent,
16
- s as isTableComponent,
17
- m as prefixCls
23
+ y as isTableComponent,
24
+ c as prefixCls
18
25
  };
19
26
  //# sourceMappingURL=utils.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","sources":["../../src/array-table/utils.ts"],"sourcesContent":["import type { Schema } from '@formily/json-schema'\r\nimport { stylePrefix } from '../__builtins__'\r\nimport { isAdditionComponent, isOperationComponent } from '../array-base/utils'\r\n\r\nexport const prefixCls = `${stylePrefix}-array-table`\r\n\r\nexport function isColumnComponent(schema: Schema) {\r\n return schema['x-component']?.indexOf('Column') > -1\r\n}\r\n\r\nexport function isTableComponent(schema: Schema): boolean {\r\n return isColumnComponent(schema) || isOperationComponent(schema) || isAdditionComponent(schema)\r\n}\r\n\r\nexport function hasRequiredProperty(schema: Schema): boolean {\r\n return schema.reduceProperties((hasRequired, property) =>\r\n hasRequired || !!property.required, false)\r\n}\r\n"],"names":["prefixCls","stylePrefix","isColumnComponent","schema","isTableComponent","isOperationComponent","isAdditionComponent","hasRequiredProperty","hasRequired","property"],"mappings":";;AAIO,MAAMA,IAAY,GAAGC,CAAW;AAEhC,SAASC,EAAkBC,GAAgB;AAChD,SAAOA,EAAO,aAAa,GAAG,QAAQ,QAAQ,IAAI;AACpD;AAEO,SAASC,EAAiBD,GAAyB;AACxD,SAAOD,EAAkBC,CAAM,KAAKE,EAAqBF,CAAM,KAAKG,EAAoBH,CAAM;AAChG;AAEO,SAASI,EAAoBJ,GAAyB;AAC3D,SAAOA,EAAO,iBAAiB,CAACK,GAAaC,MAC3CD,KAAe,CAAC,CAACC,EAAS,UAAU,EAAK;AAC7C;"}
1
+ {"version":3,"file":"utils.mjs","sources":["../../src/array-table/utils.ts"],"sourcesContent":["import type { Schema } from '@formily/json-schema'\nimport { stylePrefix } from '../__builtins__'\nimport { isAdditionComponent, isOperationComponent } from '../array-base/utils'\n\nexport const prefixCls = `${stylePrefix}-array-table`\n\nexport function isColumnComponent(schema: Schema) {\n return schema['x-component']?.indexOf('Column') > -1\n}\n\nexport function isTableComponent(schema: Schema): boolean {\n return isColumnComponent(schema) || isOperationComponent(schema) || isAdditionComponent(schema)\n}\n\nexport function hasRequiredProperty(schema: Schema): boolean {\n return schema.reduceProperties((hasRequired, property) =>\n hasRequired || !!property.required, false)\n}\n"],"names":["prefixCls","stylePrefix","isColumnComponent","schema","isTableComponent","isOperationComponent","isAdditionComponent","hasRequiredProperty","hasRequired","property"],"mappings":";;;;;;;;;AAIO,MAAMA,IAAY,GAAGC,CAAW;AAEhC,SAASC,EAAkBC,GAAgB;AAChD,SAAOA,EAAO,aAAa,GAAG,QAAQ,QAAQ,IAAI;AACpD;AAEO,SAASC,EAAiBD,GAAyB;AACxD,SAAOD,EAAkBC,CAAM,KAAKE,EAAqBF,CAAM,KAAKG,EAAoBH,CAAM;AAChG;AAEO,SAASI,EAAoBJ,GAAyB;AAC3D,SAAOA,EAAO,iBAAiB,CAACK,GAAaC,MAC3CD,KAAe,CAAC,CAACC,EAAS,UAAU,EAAK;AAC7C;"}
@@ -1,11 +1,14 @@
1
- import { defineComponent as C, ref as p, onUnmounted as E, createBlock as f, openBlock as s, unref as e, mergeProps as F, withCtx as u, createElementBlock as i, Fragment as _, renderList as A, createVNode as b, normalizeClass as B, createTextVNode as N, toDisplayString as v } from "vue";
1
+ import { defineComponent as C, ref as p, onUnmounted as E, createBlock as f, openBlock as s, unref as e, mergeProps as F, withCtx as m, createElementBlock as i, Fragment as _, renderList as A, createVNode as b, normalizeClass as B, createTextVNode as N, toDisplayString as v } from "vue";
2
2
  import { reaction as P } from "@formily/reactive";
3
3
  import { isEqual as R, isFn as h } from "@formily/shared";
4
4
  import { useField as S, useFieldSchema as V, RecursionField as q } from "@silver-formily/vue";
5
5
  import { ElTabs as U, ElTabPane as L, ElBadge as w } from "element-plus";
6
6
  import { stylePrefix as z } from "../__builtins__/configs/index.mjs";
7
- import { getArrayItemSchema as D } from "../array-base/utils.mjs";
8
- import { useCleanAttrs as I } from "../__builtins__/shared/utils.mjs";
7
+ import "@vueuse/core";
8
+ import "@formily/core";
9
+ import "@silver-formily/reactive-vue";
10
+ import { useCleanAttrs as D } from "../__builtins__/shared/utils.mjs";
11
+ import { getArrayItemSchema as I } from "../array-base/utils.mjs";
9
12
  import '../styles/array-tabs/index.css';const K = { key: 0 }, j = { key: 1 }, G = /* @__PURE__ */ C({
10
13
  name: "FArrayTabs",
11
14
  inheritAttrs: !1,
@@ -18,53 +21,53 @@ import '../styles/array-tabs/index.css';const K = { key: 0 }, j = { key: 1 }, G
18
21
  function d(r) {
19
22
  return `${t.title || "Untitled"} ${r + 1}`;
20
23
  }
21
- const m = p([]), T = P(() => t.value.map((r, o) => t.form.queryFeedbacks({
24
+ const u = p([]), T = P(() => t.value.map((r, l) => t.form.queryFeedbacks({
22
25
  type: "error",
23
- address: `${t.address.concat(o)}.**`
26
+ address: `${t.address.concat(l)}.**`
24
27
  }).length), (r) => {
25
- m.value = r;
28
+ u.value = r;
26
29
  }, {
27
30
  equals: R
28
31
  });
29
32
  E(() => {
30
33
  T();
31
34
  });
32
- const { props: k } = I(["value", "modelValue", "onUpdate:modelValue"]);
33
- return (r, o) => (s(), f(e(U), F(e(k), {
35
+ const { props: k } = D(["value", "modelValue", "onUpdate:modelValue"]);
36
+ return (r, l) => (s(), f(e(U), F(e(k), {
34
37
  "model-value": n.value,
35
38
  class: c,
36
39
  type: "card",
37
40
  addable: !0,
38
- onTabRemove: o[0] || (o[0] = (l) => {
39
- const a = l.toString().match(/tab-(\d+)/)?.[1];
40
- e(t).remove(Number(a)), n.value === l && (n.value = `tab-${Number(a) - 1}`), e(h)(r.$attrs["tab-remove"]) && r.$attrs["tab-remove"](l);
41
+ onTabRemove: l[0] || (l[0] = (o) => {
42
+ const a = o.toString().match(/tab-(\d+)/)?.[1];
43
+ e(t).remove(Number(a)), n.value === o && (n.value = `tab-${Number(a) - 1}`), e(h)(r.$attrs["tab-remove"]) && r.$attrs["tab-remove"](o);
41
44
  }),
42
- onTabAdd: o[1] || (o[1] = () => {
43
- const l = e(t).value.length;
44
- e(t).value.push(null), n.value = `tab-${l}`, e(h)(r.$attrs["tab-add"]) && r.$attrs["tab-add"]();
45
+ onTabAdd: l[1] || (l[1] = () => {
46
+ const o = e(t).value.length;
47
+ e(t).value.push(null), n.value = `tab-${o}`, e(h)(r.$attrs["tab-add"]) && r.$attrs["tab-add"]();
45
48
  }),
46
49
  onChange: () => {
47
50
  }
48
51
  }), {
49
- default: u(() => [
50
- (s(!0), i(_, null, A(e(t).value, (l, a) => (s(), f(e(L), {
52
+ default: m(() => [
53
+ (s(!0), i(_, null, A(e(t).value, (o, a) => (s(), f(e(L), {
51
54
  key: `tab-${a}`,
52
55
  closable: a !== 0,
53
56
  name: `tab-${a}`
54
57
  }, {
55
- default: u(() => [
58
+ default: m(() => [
56
59
  b(e(q), {
57
- schema: e(D)(e(g), a),
60
+ schema: e(I)(e(g), a),
58
61
  name: a
59
62
  }, null, 8, ["schema", "name"])
60
63
  ]),
61
- label: u(() => [
62
- m.value[a] > 0 ? (s(), i("span", K, [
64
+ label: m(() => [
65
+ u.value[a] > 0 ? (s(), i("span", K, [
63
66
  b(e(w), {
64
67
  class: B([`${c}-errors-badge`]),
65
- value: m.value[a]
68
+ value: u.value[a]
66
69
  }, {
67
- default: u(() => [
70
+ default: m(() => [
68
71
  N(v(d(a)), 1)
69
72
  ]),
70
73
  _: 2
@@ -77,9 +80,9 @@ import '../styles/array-tabs/index.css';const K = { key: 0 }, j = { key: 1 }, G
77
80
  _: 1
78
81
  }, 16, ["model-value"]));
79
82
  }
80
- }), x = G;
83
+ }), te = G;
81
84
  export {
82
- x as ArrayTabs,
83
- x as default
85
+ te as ArrayTabs,
86
+ te as default
84
87
  };
85
88
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/array-tabs/array-tabs.vue","../../src/array-tabs/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\r\nimport type { ArrayField } from '@formily/core'\r\nimport type { TabPaneName } from 'element-plus'\r\nimport { reaction } from '@formily/reactive'\r\nimport { isEqual, isFn } from '@formily/shared'\r\nimport { RecursionField, useField, useFieldSchema } from '@silver-formily/vue'\r\nimport { ElBadge, ElTabPane, ElTabs } from 'element-plus'\r\nimport { onUnmounted, ref } from 'vue'\r\nimport { useCleanAttrs } from '../__builtins__'\r\nimport { stylePrefix } from '../__builtins__/configs'\r\nimport { getArrayItemSchema } from '../array-base/utils'\r\n\r\ndefineOptions({\r\n name: 'FArrayTabs',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst fieldRef = useField<ArrayField>()\r\nconst schemaRef = useFieldSchema()\r\n\r\nconst prefixCls = `${stylePrefix}-array-tabs`\r\nconst activeKey = ref<TabPaneName>('tab-0')\r\n\r\nconst field = fieldRef.value\r\n/* istanbul ignore else -- @preserve */\r\nif (field.value.length === 0) {\r\n field.value.push(null)\r\n}\r\nconst schema = schemaRef.value\r\nfunction getTabTitle(index: number) {\r\n return `${field.title || 'Untitled'} ${index + 1}`\r\n}\r\n\r\nconst errorCountList = ref([])\r\nconst dispose = reaction(() => {\r\n return field.value.map((item, index) => {\r\n const panelErrors = field.form.queryFeedbacks({\r\n type: 'error',\r\n address: `${field.address.concat(index)}.**`,\r\n })\r\n return panelErrors.length\r\n })\r\n}, (newVal) => {\r\n errorCountList.value = newVal\r\n}, {\r\n equals: isEqual,\r\n})\r\nonUnmounted(() => {\r\n dispose()\r\n})\r\nconst { props: elTabProps } = useCleanAttrs(['value', 'modelValue', 'onUpdate:modelValue'])\r\n</script>\r\n\r\n<template>\r\n <ElTabs\r\n v-bind=\"elTabProps\"\r\n :model-value=\"activeKey\"\r\n :class=\"prefixCls\"\r\n type=\"card\"\r\n :addable=\"true\"\r\n @tab-remove=\"(target) => {\r\n const index = target.toString().match(/tab-(\\d+)/)?.[1]\r\n field.remove(Number(index))\r\n if (activeKey === target) {\r\n activeKey = `tab-${Number(index) - 1}`\r\n }\r\n\r\n if (isFn($attrs['tab-remove'])) {\r\n $attrs['tab-remove'](target)\r\n }\r\n }\"\r\n @tab-add=\"() => {\r\n const id = field.value.length\r\n field.value.push(null)\r\n activeKey = `tab-${id}`\r\n if (isFn($attrs['tab-add'])) {\r\n $attrs['tab-add']()\r\n }\r\n }\"\r\n @change=\"() => {}\"\r\n >\r\n <ElTabPane\r\n v-for=\"(item, index) of field.value\"\r\n :key=\"`tab-${index}`\"\r\n :closable=\"index !== 0\"\r\n :name=\"`tab-${index}`\"\r\n >\r\n <template #default>\r\n <RecursionField\r\n :schema=\"getArrayItemSchema(schema, index)\"\r\n :name=\"index\"\r\n />\r\n </template>\r\n <template #label>\r\n <span v-if=\"errorCountList[index] > 0\">\r\n <ElBadge\r\n :class=\"[`${prefixCls}-errors-badge`]\"\r\n :value=\"errorCountList[index]\"\r\n >\r\n {{ getTabTitle(index) }}\r\n </ElBadge>\r\n </span>\r\n <span v-else>\r\n {{ getTabTitle(index) }}\r\n </span>\r\n </template>\r\n </ElTabPane>\r\n </ElTabs>\r\n</template>\r\n","import FArrayTabs from './array-tabs.vue'\r\nimport './style.scss'\r\n\r\nexport const ArrayTabs = FArrayTabs\r\n\r\nexport default ArrayTabs\r\n"],"names":["fieldRef","useField","schemaRef","useFieldSchema","prefixCls","stylePrefix","activeKey","ref","field","schema","getTabTitle","index","errorCountList","dispose","reaction","item","newVal","isEqual","onUnmounted","elTabProps","useCleanAttrs","_createBlock","_unref","ElTabs","_mergeProps","target","isFn","$attrs","_cache","id","_openBlock","_createElementBlock","_Fragment","ElTabPane","_createVNode","RecursionField","getArrayItemSchema","_hoisted_1","ElBadge","_createTextVNode","_toDisplayString","_hoisted_2","ArrayTabs","FArrayTabs"],"mappings":"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"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/array-tabs/array-tabs.vue","../../src/array-tabs/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ArrayField } from '@formily/core'\nimport type { TabPaneName } from 'element-plus'\nimport { reaction } from '@formily/reactive'\nimport { isEqual, isFn } from '@formily/shared'\nimport { RecursionField, useField, useFieldSchema } from '@silver-formily/vue'\nimport { ElBadge, ElTabPane, ElTabs } from 'element-plus'\nimport { onUnmounted, ref } from 'vue'\nimport { useCleanAttrs } from '../__builtins__'\nimport { stylePrefix } from '../__builtins__/configs'\nimport { getArrayItemSchema } from '../array-base/utils'\n\ndefineOptions({\n name: 'FArrayTabs',\n inheritAttrs: false,\n})\n\nconst fieldRef = useField<ArrayField>()\nconst schemaRef = useFieldSchema()\n\nconst prefixCls = `${stylePrefix}-array-tabs`\nconst activeKey = ref<TabPaneName>('tab-0')\n\nconst field = fieldRef.value\n/* istanbul ignore else -- @preserve */\nif (field.value.length === 0) {\n field.value.push(null)\n}\nconst schema = schemaRef.value\nfunction getTabTitle(index: number) {\n return `${field.title || 'Untitled'} ${index + 1}`\n}\n\nconst errorCountList = ref([])\nconst dispose = reaction(() => {\n return field.value.map((item, index) => {\n const panelErrors = field.form.queryFeedbacks({\n type: 'error',\n address: `${field.address.concat(index)}.**`,\n })\n return panelErrors.length\n })\n}, (newVal) => {\n errorCountList.value = newVal\n}, {\n equals: isEqual,\n})\nonUnmounted(() => {\n dispose()\n})\nconst { props: elTabProps } = useCleanAttrs(['value', 'modelValue', 'onUpdate:modelValue'])\n</script>\n\n<template>\n <ElTabs\n v-bind=\"elTabProps\"\n :model-value=\"activeKey\"\n :class=\"prefixCls\"\n type=\"card\"\n :addable=\"true\"\n @tab-remove=\"(target) => {\n const index = target.toString().match(/tab-(\\d+)/)?.[1]\n field.remove(Number(index))\n if (activeKey === target) {\n activeKey = `tab-${Number(index) - 1}`\n }\n\n if (isFn($attrs['tab-remove'])) {\n $attrs['tab-remove'](target)\n }\n }\"\n @tab-add=\"() => {\n const id = field.value.length\n field.value.push(null)\n activeKey = `tab-${id}`\n if (isFn($attrs['tab-add'])) {\n $attrs['tab-add']()\n }\n }\"\n @change=\"() => {}\"\n >\n <ElTabPane\n v-for=\"(item, index) of field.value\"\n :key=\"`tab-${index}`\"\n :closable=\"index !== 0\"\n :name=\"`tab-${index}`\"\n >\n <template #default>\n <RecursionField\n :schema=\"getArrayItemSchema(schema, index)\"\n :name=\"index\"\n />\n </template>\n <template #label>\n <span v-if=\"errorCountList[index] > 0\">\n <ElBadge\n :class=\"[`${prefixCls}-errors-badge`]\"\n :value=\"errorCountList[index]\"\n >\n {{ getTabTitle(index) }}\n </ElBadge>\n </span>\n <span v-else>\n {{ getTabTitle(index) }}\n </span>\n </template>\n </ElTabPane>\n </ElTabs>\n</template>\n","import FArrayTabs from './array-tabs.vue'\nimport './style.scss'\n\nexport const ArrayTabs = FArrayTabs\n\nexport default ArrayTabs\n"],"names":["fieldRef","useField","schemaRef","useFieldSchema","prefixCls","stylePrefix","activeKey","ref","field","schema","getTabTitle","index","errorCountList","dispose","reaction","item","newVal","isEqual","onUnmounted","elTabProps","useCleanAttrs","_createBlock","_unref","ElTabs","_mergeProps","target","isFn","$attrs","_cache","id","_openBlock","_createElementBlock","_Fragment","ElTabPane","_createVNode","RecursionField","getArrayItemSchema","_hoisted_1","ElBadge","_createTextVNode","_toDisplayString","_hoisted_2","ArrayTabs","FArrayTabs"],"mappings":"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"}
@@ -1,9 +1,13 @@
1
1
  import { useField as S, connect as $, mapProps as P } from "@silver-formily/vue";
2
- import { PreviewText as A } from "../preview-text/index.mjs";
3
- import { defineComponent as R, useSlots as w, ref as C, computed as d, createBlock as F, openBlock as x, unref as u, mergeProps as z, createSlots as B, withCtx as n, renderSlot as r, normalizeProps as E, guardReactiveProps as K } from "vue";
4
- import { ElAutocomplete as L } from "element-plus";
5
- import { useCleanAttrs as O } from "../__builtins__/shared/utils.mjs";
6
- import { mapReadPretty as b } from "../__builtins__/shared/transform-component.mjs";
2
+ import { ElAutocomplete as A } from "element-plus";
3
+ import "@formily/reactive";
4
+ import "@vueuse/core";
5
+ import { defineComponent as R, useSlots as w, ref as C, computed as d, createBlock as F, openBlock as x, unref as p, mergeProps as z, createSlots as B, withCtx as n, renderSlot as r, normalizeProps as E, guardReactiveProps as K } from "vue";
6
+ import { mapReadPretty as L } from "../__builtins__/shared/transform-component.mjs";
7
+ import { PreviewText as O } from "../preview-text/index.mjs";
8
+ import "@formily/core";
9
+ import "@silver-formily/reactive-vue";
10
+ import { useCleanAttrs as b } from "../__builtins__/shared/utils.mjs";
7
11
  const j = /* @__PURE__ */ R({
8
12
  name: "FAutocomplete",
9
13
  inheritAttrs: !1,
@@ -12,23 +16,25 @@ const j = /* @__PURE__ */ R({
12
16
  options: {}
13
17
  },
14
18
  setup(m) {
15
- const f = m, o = w(), { props: i } = O(), t = S(), p = C();
19
+ const u = m, o = w(), { props: i } = b(), t = S(), f = C();
16
20
  t.value?.inject({
17
- getElAutocompleteRef: () => p
21
+ getElAutocompleteRef: () => f
18
22
  });
19
23
  const c = d(() => {
20
24
  const e = i.value.fetchSuggestions;
21
25
  if (e)
22
26
  return ((a, s) => e(a, s, t.value));
23
- if (f.options)
27
+ /* istanbul ignore next -- @preserve defensive: allow autocomplete to run without options and remote fetch */
28
+ if (u.options)
24
29
  return (a, s) => {
25
30
  t.value.loading = !0;
26
- const l = (a ?? "").toLowerCase(), y = i.value.valueKey ?? "value", k = l ? f.options.filter((h) => v(h, y, l)) : f.options;
31
+ const l = (a ?? "").toLowerCase(), y = i.value.valueKey ?? "value", k = l ? u.options.filter((h) => v(h, y, l)) : u.options;
27
32
  s(k), t.value.loading = !1;
28
33
  };
29
34
  });
30
35
  function v(e, a, s) {
31
36
  const l = e?.[a];
37
+ /* istanbul ignore next -- @preserve defensive: tolerate invalid option shape from external data source */
32
38
  return l == null ? !1 : String(l).toLowerCase().includes(s);
33
39
  }
34
40
  const g = d(() => ({
@@ -36,28 +42,28 @@ const j = /* @__PURE__ */ R({
36
42
  loading: i.value.loading ?? t.value?.loading,
37
43
  fetchSuggestions: c.value
38
44
  }));
39
- return (e, a) => (x(), F(u(L), z({
45
+ return (e, a) => (x(), F(p(A), z({
40
46
  ref_key: "autocompleteRef",
41
- ref: p
47
+ ref: f
42
48
  }, g.value), B({ _: 2 }, [
43
49
  o.default ? {
44
50
  name: "default",
45
51
  fn: n((s) => [
46
- r(e.$slots, "default", E(K({ ...s, field: u(t) })))
52
+ r(e.$slots, "default", E(K({ ...s, field: p(t) })))
47
53
  ]),
48
54
  key: "0"
49
55
  } : void 0,
50
56
  o.header ? {
51
57
  name: "header",
52
58
  fn: n(() => [
53
- r(e.$slots, "header", { field: u(t) })
59
+ r(e.$slots, "header", { field: p(t) })
54
60
  ]),
55
61
  key: "1"
56
62
  } : void 0,
57
63
  o.footer ? {
58
64
  name: "footer",
59
65
  fn: n(() => [
60
- r(e.$slots, "footer", { field: u(t) })
66
+ r(e.$slots, "footer", { field: p(t) })
61
67
  ]),
62
68
  key: "2"
63
69
  } : void 0,
@@ -98,13 +104,13 @@ const j = /* @__PURE__ */ R({
98
104
  } : void 0
99
105
  ]), 1040));
100
106
  }
101
- }), J = $(
107
+ }), U = $(
102
108
  j,
103
109
  P({ dataSource: "options", readOnly: "readonly", disabled: !0 }),
104
- b(A.Input)
110
+ L(O.Input)
105
111
  );
106
112
  export {
107
- J as Autocomplete,
108
- J as default
113
+ U as Autocomplete,
114
+ U as default
109
115
  };
110
116
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/autocomplete/autocomplete.vue","../../src/autocomplete/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport type { Field } from '@formily/core'\r\nimport type { AutocompleteInstance } from 'element-plus'\r\nimport type { AutocompleteData, AutocompleteFetchSuggestions } from 'element-plus/es/components/autocomplete'\r\nimport { useField } from '@silver-formily/vue'\r\nimport { ElAutocomplete } from 'element-plus'\r\nimport { computed, ref } from 'vue'\r\nimport { useCleanAttrs } from '../__builtins__'\r\n\r\ndefineOptions({\r\n name: 'FAutocomplete',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps<{\r\n options?: AutocompleteData\r\n}>()\r\n\r\nconst slots = defineSlots<{\r\n default?: (scope: { item: AutocompleteData[number], field: Field | undefined }) => any\r\n header?: (scope: { field: Field | undefined }) => any\r\n footer?: (scope: { field: Field | undefined }) => any\r\n loading?: () => any\r\n prefix?: () => any\r\n suffix?: () => any\r\n prepend?: () => any\r\n append?: () => any\r\n}>()\r\n\r\nconst { props: attrs } = useCleanAttrs()\r\nconst fieldRef = useField<Field>()\r\nconst autocompleteRef = ref<AutocompleteInstance>()\r\n\r\nfieldRef.value?.inject({\r\n getElAutocompleteRef: () => autocompleteRef,\r\n})\r\n\r\nconst normalizedFetchSuggestions = computed<AutocompleteFetchSuggestions | undefined>(() => {\r\n const attrFetch = attrs.value.fetchSuggestions as AutocompleteFetchSuggestions | undefined\r\n if (attrFetch) {\r\n return ((queryString, cb) => {\r\n return (attrFetch as (...args: any[]) => any)(queryString, cb, fieldRef.value)\r\n }) as AutocompleteFetchSuggestions\r\n }\r\n\r\n if (!props.options) {\r\n return\r\n }\r\n\r\n return (queryString: string, cb) => {\r\n fieldRef.value.loading = true\r\n const keyword = (queryString ?? '').toLowerCase()\r\n const valueKey = (attrs.value.valueKey ?? 'value') as string\r\n const results = keyword\r\n ? props.options!.filter(option => matchOption(option, valueKey, keyword))\r\n : props.options!\r\n cb(results)\r\n fieldRef.value.loading = false\r\n }\r\n})\r\n\r\nfunction matchOption(option: AutocompleteData[number], valueKey: string, keyword: string) {\r\n const target = option?.[valueKey]\r\n if (target === undefined || target === null) {\r\n return false\r\n }\r\n return String(target).toLowerCase().includes(keyword)\r\n}\r\n\r\nconst autocompleteProps = computed(() => ({\r\n ...attrs.value,\r\n loading: attrs.value.loading ?? fieldRef.value?.loading,\r\n fetchSuggestions: normalizedFetchSuggestions.value,\r\n}))\r\n</script>\r\n\r\n<template>\r\n <ElAutocomplete ref=\"autocompleteRef\" v-bind=\"autocompleteProps\">\r\n <template v-if=\"slots.default\" #default=\"slotProps\">\r\n <slot name=\"default\" v-bind=\"{ ...slotProps, field: fieldRef }\" />\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.suffix\" #suffix>\r\n <slot name=\"suffix\" />\r\n </template>\r\n <template v-if=\"slots.prepend\" #prepend>\r\n <slot name=\"prepend\" />\r\n </template>\r\n <template v-if=\"slots.append\" #append>\r\n <slot name=\"append\" />\r\n </template>\r\n <template v-if=\"slots.loading\" #loading>\r\n <slot name=\"loading\" />\r\n </template>\r\n </ElAutocomplete>\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 FAutocomplete from './autocomplete.vue'\r\n\r\nexport const Autocomplete = connect<typeof FAutocomplete>(\r\n FAutocomplete,\r\n mapProps({ dataSource: 'options', readOnly: 'readonly', disabled: true }),\r\n mapReadPretty(PreviewText.Input),\r\n)\r\n\r\nexport default Autocomplete\r\n"],"names":["props","__props","slots","_useSlots","attrs","useCleanAttrs","fieldRef","useField","autocompleteRef","ref","normalizedFetchSuggestions","computed","attrFetch","queryString","cb","keyword","valueKey","results","option","matchOption","target","autocompleteProps","_openBlock","_createBlock","_unref","_mergeProps","_createSlots","_withCtx","slotProps","_renderSlot","_ctx","_normalizeProps","_guardReactiveProps","Autocomplete","connect","FAutocomplete","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;AAcA,UAAMA,IAAQC,GAIRC,IAAQC,EAAA,GAWR,EAAE,OAAOC,EAAA,IAAUC,EAAA,GACnBC,IAAWC,EAAA,GACXC,IAAkBC,EAAA;AAExB,IAAAH,EAAS,OAAO,OAAO;AAAA,MACrB,sBAAsB,MAAME;AAAA,IAAA,CAC7B;AAED,UAAME,IAA6BC,EAAmD,MAAM;AAC1F,YAAMC,IAAYR,EAAM,MAAM;AAC9B,UAAIQ;AACF,gBAAQ,CAACC,GAAaC,MACZF,EAAsCC,GAAaC,GAAIR,EAAS,KAAK;AAIjF,UAAKN,EAAM;AAIX,eAAO,CAACa,GAAqBC,MAAO;AAClC,UAAAR,EAAS,MAAM,UAAU;AACzB,gBAAMS,KAAWF,KAAe,IAAI,YAAA,GAC9BG,IAAYZ,EAAM,MAAM,YAAY,SACpCa,IAAUF,IACZf,EAAM,QAAS,OAAO,CAAAkB,MAAUC,EAAYD,GAAQF,GAAUD,CAAO,CAAC,IACtEf,EAAM;AACV,UAAAc,EAAGG,CAAO,GACVX,EAAS,MAAM,UAAU;AAAA,QAC3B;AAAA,IACF,CAAC;AAED,aAASa,EAAYD,GAAkCF,GAAkBD,GAAiB;AACxF,YAAMK,IAASF,IAASF,CAAQ;AAChC,aAA4BI,KAAW,OAC9B,KAEF,OAAOA,CAAM,EAAE,YAAA,EAAc,SAASL,CAAO;AAAA,IACtD;AAEA,UAAMM,IAAoBV,EAAS,OAAO;AAAA,MACxC,GAAGP,EAAM;AAAA,MACT,SAASA,EAAM,MAAM,WAAWE,EAAS,OAAO;AAAA,MAChD,kBAAkBI,EAA2B;AAAA,IAAA,EAC7C;sBAIAY,KAAAC,EAyBiBC,MAzBjBC,EAyBiB;AAAA,eAzBG;AAAA,MAAJ,KAAIjB;AAAA,IAAA,GAA0Ba,EAAA,KAAiB,GAAAK,EAAA,EAAA,GAAA,KAAA;AAAA,MAC7CxB,EAAM;cAAU;AAAA,QAC9B,IAAAyB,EAAA,CADuCC,MAAS;AAAA,UAChDC,EAAkEC,EAAA,QAAA,WAAAC,EAAAC,EAAA,EAAA,GAAhCJ,GAAS,OAASJ,EAAAlB,CAAA,EAAA,CAAQ,CAAA,CAAA;AAAA,QAAA;;;MAE9CJ,EAAM;cAAS;AAAA,cAC7B,MAAwC;AAAA,UAAxC2B,EAAwCC,EAAA,QAAA,UAAA,EAAnB,OAAON,EAAAlB,CAAA,EAAA,CAAQ;AAAA,QAAA;;;MAEtBJ,EAAM;cAAS;AAAA,cAC7B,MAAwC;AAAA,UAAxC2B,EAAwCC,EAAA,QAAA,UAAA,EAAnB,OAAON,EAAAlB,CAAA,EAAA,CAAQ;AAAA,QAAA;;;MAEtBJ,EAAM;cAAS;AAAA,cAC7B,MAAsB;AAAA,UAAtB2B,EAAsBC,EAAA,QAAA,QAAA;AAAA,QAAA;;;MAER5B,EAAM;cAAS;AAAA,cAC7B,MAAsB;AAAA,UAAtB2B,EAAsBC,EAAA,QAAA,QAAA;AAAA,QAAA;;;MAER5B,EAAM;cAAU;AAAA,cAC9B,MAAuB;AAAA,UAAvB2B,EAAuBC,EAAA,QAAA,SAAA;AAAA,QAAA;;;MAET5B,EAAM;cAAS;AAAA,cAC7B,MAAsB;AAAA,UAAtB2B,EAAsBC,EAAA,QAAA,QAAA;AAAA,QAAA;;;MAER5B,EAAM;cAAU;AAAA,cAC9B,MAAuB;AAAA,UAAvB2B,EAAuBC,EAAA,QAAA,SAAA;AAAA,QAAA;;;;;IC/FhBG,IAAeC;AAAA,EAC1BC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,UAAU,YAAY,UAAU,IAAM;AAAA,EACxEC,EAAcC,EAAY,KAAK;AACjC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/autocomplete/autocomplete.vue","../../src/autocomplete/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Field } from '@formily/core'\nimport type { AutocompleteInstance } from 'element-plus'\nimport type { AutocompleteData, AutocompleteFetchSuggestions } from 'element-plus/es/components/autocomplete'\nimport { useField } from '@silver-formily/vue'\nimport { ElAutocomplete } from 'element-plus'\nimport { computed, ref } from 'vue'\nimport { useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FAutocomplete',\n inheritAttrs: false,\n})\n\nconst props = defineProps<{\n options?: AutocompleteData\n}>()\n\nconst slots = defineSlots<{\n default?: (scope: { item: AutocompleteData[number], field: Field | undefined }) => any\n header?: (scope: { field: Field | undefined }) => any\n footer?: (scope: { field: Field | undefined }) => any\n loading?: () => any\n prefix?: () => any\n suffix?: () => any\n prepend?: () => any\n append?: () => any\n}>()\n\nconst { props: attrs } = useCleanAttrs()\nconst fieldRef = useField<Field>()\nconst autocompleteRef = ref<AutocompleteInstance>()\n\nfieldRef.value?.inject({\n getElAutocompleteRef: () => autocompleteRef,\n})\n\nconst normalizedFetchSuggestions = computed<AutocompleteFetchSuggestions | undefined>(() => {\n const attrFetch = attrs.value.fetchSuggestions as AutocompleteFetchSuggestions | undefined\n if (attrFetch) {\n return ((queryString, cb) => {\n return (attrFetch as (...args: any[]) => any)(queryString, cb, fieldRef.value)\n }) as AutocompleteFetchSuggestions\n }\n\n /* istanbul ignore next -- @preserve defensive: allow autocomplete to run without options and remote fetch */\n if (!props.options) {\n return\n }\n\n return (queryString: string, cb) => {\n fieldRef.value.loading = true\n const keyword = (queryString ?? '').toLowerCase()\n const valueKey = (attrs.value.valueKey ?? 'value') as string\n const results = keyword\n ? props.options!.filter(option => matchOption(option, valueKey, keyword))\n : props.options!\n cb(results)\n fieldRef.value.loading = false\n }\n})\n\nfunction matchOption(option: AutocompleteData[number], valueKey: string, keyword: string) {\n const target = option?.[valueKey]\n /* istanbul ignore next -- @preserve defensive: tolerate invalid option shape from external data source */\n if (target === undefined || target === null) {\n return false\n }\n return String(target).toLowerCase().includes(keyword)\n}\n\nconst autocompleteProps = computed(() => ({\n ...attrs.value,\n loading: attrs.value.loading ?? fieldRef.value?.loading,\n fetchSuggestions: normalizedFetchSuggestions.value,\n}))\n</script>\n\n<template>\n <ElAutocomplete ref=\"autocompleteRef\" v-bind=\"autocompleteProps\">\n <template v-if=\"slots.default\" #default=\"slotProps\">\n <slot name=\"default\" v-bind=\"{ ...slotProps, field: fieldRef }\" />\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.suffix\" #suffix>\n <slot name=\"suffix\" />\n </template>\n <template v-if=\"slots.prepend\" #prepend>\n <slot name=\"prepend\" />\n </template>\n <template v-if=\"slots.append\" #append>\n <slot name=\"append\" />\n </template>\n <template v-if=\"slots.loading\" #loading>\n <slot name=\"loading\" />\n </template>\n </ElAutocomplete>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FAutocomplete from './autocomplete.vue'\n\nexport const Autocomplete = connect<typeof FAutocomplete>(\n FAutocomplete,\n mapProps({ dataSource: 'options', readOnly: 'readonly', disabled: true }),\n mapReadPretty(PreviewText.Input),\n)\n\nexport default Autocomplete\n"],"names":["props","__props","slots","_useSlots","attrs","useCleanAttrs","fieldRef","useField","autocompleteRef","ref","normalizedFetchSuggestions","computed","attrFetch","queryString","cb","keyword","valueKey","results","option","matchOption","target","autocompleteProps","_openBlock","_createBlock","_unref","_mergeProps","_createSlots","_withCtx","slotProps","_renderSlot","_ctx","_normalizeProps","_guardReactiveProps","Autocomplete","connect","FAutocomplete","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;;;;;AAcA,UAAMA,IAAQC,GAIRC,IAAQC,EAAA,GAWR,EAAE,OAAOC,EAAA,IAAUC,EAAA,GACnBC,IAAWC,EAAA,GACXC,IAAkBC,EAAA;AAExB,IAAAH,EAAS,OAAO,OAAO;AAAA,MACrB,sBAAsB,MAAME;AAAA,IAAA,CAC7B;AAED,UAAME,IAA6BC,EAAmD,MAAM;AAC1F,YAAMC,IAAYR,EAAM,MAAM;AAC9B,UAAIQ;AACF,gBAAQ,CAACC,GAAaC,MACZF,EAAsCC,GAAaC,GAAIR,EAAS,KAAK;AAAA,MAEjF;AAGA,UAAKN,EAAM;AAIX,eAAO,CAACa,GAAqBC,MAAO;AAClC,UAAAR,EAAS,MAAM,UAAU;AACzB,gBAAMS,KAAWF,KAAe,IAAI,YAAA,GAC9BG,IAAYZ,EAAM,MAAM,YAAY,SACpCa,IAAUF,IACZf,EAAM,QAAS,OAAO,CAAAkB,MAAUC,EAAYD,GAAQF,GAAUD,CAAO,CAAC,IACtEf,EAAM;AACV,UAAAc,EAAGG,CAAO,GACVX,EAAS,MAAM,UAAU;AAAA,QAC3B;AAAA,IACF,CAAC;AAED,aAASa,EAAYD,GAAkCF,GAAkBD,GAAiB;AACxF,YAAMK,IAASF,IAASF,CAAQ;AAAA,MAAA;AAEhC,aAA4BI,KAAW,OAC9B,KAEF,OAAOA,CAAM,EAAE,YAAA,EAAc,SAASL,CAAO;AAAA,IACtD;AAEA,UAAMM,IAAoBV,EAAS,OAAO;AAAA,MACxC,GAAGP,EAAM;AAAA,MACT,SAASA,EAAM,MAAM,WAAWE,EAAS,OAAO;AAAA,MAChD,kBAAkBI,EAA2B;AAAA,IAAA,EAC7C;sBAIAY,KAAAC,EAyBiBC,MAzBjBC,EAyBiB;AAAA,eAzBG;AAAA,MAAJ,KAAIjB;AAAA,IAAA,GAA0Ba,EAAA,KAAiB,GAAAK,EAAA,EAAA,GAAA,KAAA;AAAA,MAC7CxB,EAAM;cAAU;AAAA,QAC9B,IAAAyB,EAAA,CADuCC,MAAS;AAAA,UAChDC,EAAkEC,EAAA,QAAA,WAAAC,EAAAC,EAAA,EAAA,GAAhCJ,GAAS,OAASJ,EAAAlB,CAAA,EAAA,CAAQ,CAAA,CAAA;AAAA,QAAA;;;MAE9CJ,EAAM;cAAS;AAAA,cAC7B,MAAwC;AAAA,UAAxC2B,EAAwCC,EAAA,QAAA,UAAA,EAAnB,OAAON,EAAAlB,CAAA,EAAA,CAAQ;AAAA,QAAA;;;MAEtBJ,EAAM;cAAS;AAAA,cAC7B,MAAwC;AAAA,UAAxC2B,EAAwCC,EAAA,QAAA,UAAA,EAAnB,OAAON,EAAAlB,CAAA,EAAA,CAAQ;AAAA,QAAA;;;MAEtBJ,EAAM;cAAS;AAAA,cAC7B,MAAsB;AAAA,UAAtB2B,EAAsBC,EAAA,QAAA,QAAA;AAAA,QAAA;;;MAER5B,EAAM;cAAS;AAAA,cAC7B,MAAsB;AAAA,UAAtB2B,EAAsBC,EAAA,QAAA,QAAA;AAAA,QAAA;;;MAER5B,EAAM;cAAU;AAAA,cAC9B,MAAuB;AAAA,UAAvB2B,EAAuBC,EAAA,QAAA,SAAA;AAAA,QAAA;;;MAET5B,EAAM;cAAS;AAAA,cAC7B,MAAsB;AAAA,UAAtB2B,EAAsBC,EAAA,QAAA,QAAA;AAAA,QAAA;;;MAER5B,EAAM;cAAU;AAAA,cAC9B,MAAuB;AAAA,UAAvB2B,EAAuBC,EAAA,QAAA,SAAA;AAAA,QAAA;;;;;ICjGhBG,IAAeC;AAAA,EAC1BC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,UAAU,YAAY,UAAU,IAAM;AAAA,EACxEC,EAAcC,EAAY,KAAK;AACjC;"}
@@ -1,9 +1,13 @@
1
1
  import { connect as i, mapProps as c } from "@silver-formily/vue";
2
- import { PreviewText as d } from "../preview-text/index.mjs";
3
- import { defineComponent as f, createBlock as l, openBlock as u, unref as o, mergeProps as C, createSlots as y, withCtx as t, renderSlot as r } from "vue";
4
- import { ElCascader as P } from "element-plus";
5
- import { useCleanAttrs as k } from "../__builtins__/shared/utils.mjs";
6
- import { mapReadPretty as $ } from "../__builtins__/shared/transform-component.mjs";
2
+ import { ElCascader as d } from "element-plus";
3
+ import "@formily/reactive";
4
+ import "@vueuse/core";
5
+ import { defineComponent as f, createBlock as l, openBlock as u, unref as e, mergeProps as C, createSlots as y, withCtx as t, renderSlot as r } from "vue";
6
+ import { mapReadPretty as P } from "../__builtins__/shared/transform-component.mjs";
7
+ import { PreviewText as k } from "../preview-text/index.mjs";
8
+ import "@formily/core";
9
+ import "@silver-formily/reactive-vue";
10
+ import { useCleanAttrs as $ } from "../__builtins__/shared/utils.mjs";
7
11
  const h = /* @__PURE__ */ f({
8
12
  name: "FCascader",
9
13
  inheritAttrs: !1,
@@ -12,36 +16,36 @@ const h = /* @__PURE__ */ f({
12
16
  options: {}
13
17
  },
14
18
  setup(s) {
15
- const a = s, { props: p } = k();
16
- return (e, v) => (u(), l(o(P), C(o(p), {
19
+ const a = s, { props: p } = $();
20
+ return (o, v) => (u(), l(e(d), C(e(p), {
17
21
  options: a.options
18
22
  }), y({ _: 2 }, [
19
- e.$slots.default ? {
23
+ o.$slots.default ? {
20
24
  name: "default",
21
- fn: t(({ node: n, data: m }) => [
22
- r(e.$slots, "default", {
23
- node: n,
24
- data: m
25
+ fn: t(({ node: m, data: n }) => [
26
+ r(o.$slots, "default", {
27
+ node: m,
28
+ data: n
25
29
  })
26
30
  ]),
27
31
  key: "0"
28
32
  } : void 0,
29
- e.$slots.empty ? {
33
+ o.$slots.empty ? {
30
34
  name: "empty",
31
35
  fn: t(() => [
32
- r(e.$slots, "empty")
36
+ r(o.$slots, "empty")
33
37
  ]),
34
38
  key: "1"
35
39
  } : void 0
36
40
  ]), 1040, ["options"]));
37
41
  }
38
- }), g = i(
42
+ }), T = i(
39
43
  h,
40
44
  c({ dataSource: "options", disabled: !0 }),
41
- $(d.Cascader)
45
+ P(k.Cascader)
42
46
  );
43
47
  export {
44
- g as Cascader,
45
- g as default
48
+ T as Cascader,
49
+ T as default
46
50
  };
47
51
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/cascader/cascader.vue","../../src/cascader/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport type { CascaderOption } from 'element-plus'\r\nimport { ElCascader } from 'element-plus'\r\nimport { useCleanAttrs } from '../__builtins__'\r\n\r\ndefineOptions({\r\n name: 'FCascader',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps<{\r\n options?: CascaderOption[]\r\n}>()\r\n\r\nconst { props: cascaderProps } = useCleanAttrs()\r\n</script>\r\n\r\n<template>\r\n <ElCascader\r\n v-bind=\"cascaderProps\"\r\n :options=\"props.options\"\r\n >\r\n <template v-if=\"$slots.default\" #default=\"{ node, data }\">\r\n <slot :node=\"node\" :data=\"data\" />\r\n </template>\r\n <template v-if=\"$slots.empty\" #empty>\r\n <slot name=\"empty\" />\r\n </template>\r\n </ElCascader>\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 FCascader from './cascader.vue'\r\n\r\nexport const Cascader = connect<typeof FCascader>(\r\n FCascader,\r\n mapProps({ dataSource: 'options', disabled: true }),\r\n mapReadPretty(PreviewText.Cascader),\r\n)\r\n\r\nexport default Cascader\r\n"],"names":["props","__props","cascaderProps","useCleanAttrs","_createBlock","_unref","ElCascader","_mergeProps","$slots","node","data","_renderSlot","_ctx","Cascader","connect","FCascader","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,GAIR,EAAE,OAAOC,EAAA,IAAkBC,EAAA;2BAI/BC,EAUaC,EAAAC,CAAA,GAVbC,EAUaF,EAAAH,CAAA,GATU;AAAA,MACpB,SAASF,EAAM;AAAA,IAAA;MAEAQ,EAAAA,OAAO;cAAU;AAAA,cAC/B,CAAkC,EADQ,MAAAC,GAAM,MAAAC,QAAI;AAAA,UACpDC,EAAkCC,EAAA,QAAA,WAAA;AAAA,YAA3B,MAAAH;AAAA,YAAa,MAAAC;AAAA,UAAA;;;;MAENF,EAAAA,OAAO;cAAQ;AAAA,cAC7B,MAAqB;AAAA,UAArBG,EAAqBC,EAAA,QAAA,OAAA;AAAA,QAAA;;;;;ICrBdC,IAAWC;AAAA,EACtBC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,UAAU,IAAM;AAAA,EAClDC,EAAcC,EAAY,QAAQ;AACpC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/cascader/cascader.vue","../../src/cascader/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CascaderOption } from 'element-plus'\nimport { ElCascader } from 'element-plus'\nimport { useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FCascader',\n inheritAttrs: false,\n})\n\nconst props = defineProps<{\n options?: CascaderOption[]\n}>()\n\nconst { props: cascaderProps } = useCleanAttrs()\n</script>\n\n<template>\n <ElCascader\n v-bind=\"cascaderProps\"\n :options=\"props.options\"\n >\n <template v-if=\"$slots.default\" #default=\"{ node, data }\">\n <slot :node=\"node\" :data=\"data\" />\n </template>\n <template v-if=\"$slots.empty\" #empty>\n <slot name=\"empty\" />\n </template>\n </ElCascader>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FCascader from './cascader.vue'\n\nexport const Cascader = connect<typeof FCascader>(\n FCascader,\n mapProps({ dataSource: 'options', disabled: true }),\n mapReadPretty(PreviewText.Cascader),\n)\n\nexport default Cascader\n"],"names":["props","__props","cascaderProps","useCleanAttrs","_createBlock","_unref","ElCascader","_mergeProps","$slots","node","data","_renderSlot","_ctx","Cascader","connect","FCascader","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,GAIR,EAAE,OAAOC,EAAA,IAAkBC,EAAA;2BAI/BC,EAUaC,EAAAC,CAAA,GAVbC,EAUaF,EAAAH,CAAA,GATU;AAAA,MACpB,SAASF,EAAM;AAAA,IAAA;MAEAQ,EAAAA,OAAO;cAAU;AAAA,cAC/B,CAAkC,EADQ,MAAAC,GAAM,MAAAC,QAAI;AAAA,UACpDC,EAAkCC,EAAA,QAAA,WAAA;AAAA,YAA3B,MAAAH;AAAA,YAAa,MAAAC;AAAA,UAAA;;;;MAENF,EAAAA,OAAO;cAAQ;AAAA,cAC7B,MAAqB;AAAA,UAArBG,EAAqBC,EAAA,QAAA,OAAA;AAAA,QAAA;;;;;ICrBdC,IAAWC;AAAA,EACtBC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,UAAU,IAAM;AAAA,EAClDC,EAAcC,EAAY,QAAQ;AACpC;"}
@@ -1,12 +1,16 @@
1
1
  import { connect as _, mapProps as y } from "@silver-formily/vue";
2
2
  import { ElCheckboxButton as S, ElCheckbox as h, ElCheckboxGroup as g, version as E } from "element-plus";
3
- import { PreviewText as T } from "../preview-text/index.mjs";
4
- import { defineComponent as A, computed as c, useSlots as B, createBlock as a, openBlock as o, unref as p, normalizeProps as G, guardReactiveProps as w, withCtx as l, createElementBlock as m, Fragment as i, renderList as f, resolveDynamicComponent as b, mergeProps as d, createTextVNode as D, toDisplayString as F, renderSlot as I } from "vue";
3
+ import "@formily/reactive";
4
+ import "@vueuse/core";
5
+ import { defineComponent as T, computed as c, useSlots as A, createBlock as a, openBlock as o, unref as n, normalizeProps as B, guardReactiveProps as G, withCtx as l, createElementBlock as m, Fragment as i, renderList as f, resolveDynamicComponent as b, mergeProps as d, createTextVNode as w, toDisplayString as D, renderSlot as F } from "vue";
6
+ import { mapReadPretty as I } from "../__builtins__/shared/transform-component.mjs";
7
+ import { useCleanAttrs as L, composeExport as N } from "../__builtins__/shared/utils.mjs";
8
+ import { PreviewText as O } from "../preview-text/index.mjs";
5
9
  import { isPlainObj as k } from "@formily/shared";
6
- import { lt as L } from "../__builtins__/shared/simple-version-compare.mjs";
7
- import { useCleanAttrs as N, composeExport as O } from "../__builtins__/shared/utils.mjs";
8
- import { mapReadPretty as R } from "../__builtins__/shared/transform-component.mjs";
9
- const j = /* @__PURE__ */ A({
10
+ import { lt as R } from "../__builtins__/shared/simple-version-compare.mjs";
11
+ import "@formily/core";
12
+ import "@silver-formily/reactive-vue";
13
+ const j = /* @__PURE__ */ T({
10
14
  name: "FCheckboxGroup",
11
15
  inheritAttrs: !1,
12
16
  __name: "checkbox-group",
@@ -21,7 +25,7 @@ const j = /* @__PURE__ */ A({
21
25
  }
22
26
  },
23
27
  setup(x) {
24
- const n = x, s = c(() => n.optionType === "button" ? S : h), C = L(E, "2.6.0"), u = c(() => n.options.map((e) => {
28
+ const p = x, s = c(() => p.optionType === "button" ? S : h), C = R(E, "2.6.0"), u = c(() => p.options.map((e) => {
25
29
  if (!k(e))
26
30
  return {
27
31
  label: e,
@@ -32,17 +36,17 @@ const j = /* @__PURE__ */ A({
32
36
  ...e,
33
37
  label: e.value
34
38
  } : e;
35
- })), v = B(), { props: P } = N();
36
- return (e, V) => (o(), a(p(g), G(w(p(P))), {
39
+ })), v = A(), { props: P } = L();
40
+ return (e, V) => (o(), a(n(g), B(G(n(P))), {
37
41
  default: l(() => [
38
- p(v).option ? (o(!0), m(i, { key: 1 }, f(u.value, (t, r) => (o(), a(b(s.value), d({ key: r }, { ref_for: !0 }, t), {
42
+ n(v).option ? (o(!0), m(i, { key: 1 }, f(u.value, (t, r) => (o(), a(b(s.value), d({ key: r }, { ref_for: !0 }, t), {
39
43
  default: l(() => [
40
- I(e.$slots, "option", { option: t })
44
+ F(e.$slots, "option", { option: t })
41
45
  ]),
42
46
  _: 2
43
47
  }, 1040))), 128)) : (o(!0), m(i, { key: 0 }, f(u.value, (t, r) => (o(), a(b(s.value), d({ key: r }, { ref_for: !0 }, t), {
44
48
  default: l(() => [
45
- D(F(p(k)(n.options[r]) ? n.options[r]?.label : t.label), 1)
49
+ w(D(n(k)(p.options[r]) ? p.options[r]?.label : t.label), 1)
46
50
  ]),
47
51
  _: 2
48
52
  }, 1040))), 128))
@@ -53,7 +57,7 @@ const j = /* @__PURE__ */ A({
53
57
  }), z = _(
54
58
  j,
55
59
  y({ dataSource: "options", disabled: !0 }),
56
- R(T.Select, {
60
+ I(O.Select, {
57
61
  multiple: !0
58
62
  })
59
63
  ), H = _(
@@ -61,11 +65,11 @@ const j = /* @__PURE__ */ A({
61
65
  y({
62
66
  disabled: !0
63
67
  })
64
- ), X = O(H, {
68
+ ), te = N(H, {
65
69
  Group: z
66
70
  });
67
71
  export {
68
- X as Checkbox,
69
- X as default
72
+ te as Checkbox,
73
+ te as default
70
74
  };
71
75
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/checkbox/checkbox-group.vue","../../src/checkbox/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport type { CheckboxProps } from 'element-plus'\r\nimport type { PropType } from 'vue'\r\nimport { isPlainObj } from '@formily/shared'\r\nimport { ElCheckbox, ElCheckboxButton, ElCheckboxGroup, version } from 'element-plus'\r\nimport { computed, useSlots } from 'vue'\r\nimport { lt, useCleanAttrs } from '../__builtins__'\r\n\r\ndefineOptions({\r\n name: 'FCheckboxGroup',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps({\r\n options: {\r\n type: Array as PropType<Array<CheckboxProps>>,\r\n default: () => [],\r\n },\r\n optionType: {\r\n type: String as PropType<'default' | 'button'>,\r\n default: 'default',\r\n },\r\n})\r\n\r\nconst OptionType = computed(() => {\r\n return props.optionType === 'button' ? ElCheckboxButton : ElCheckbox\r\n})\r\nconst IS_LESS_THAN_2_6_0 = lt(version, '2.6.0')\r\nconst compatiableProps = computed(() => {\r\n return props.options.map((option) => {\r\n if (!isPlainObj(option)) {\r\n return {\r\n label: option,\r\n value: option,\r\n }\r\n }\r\n /* istanbul ignore if -- @preserve */\r\n if (IS_LESS_THAN_2_6_0) {\r\n return {\r\n ...option,\r\n label: option.value,\r\n }\r\n }\r\n return option\r\n })\r\n})\r\n\r\nconst slots = useSlots()\r\nconst { props: checkboxProps } = useCleanAttrs()\r\n</script>\r\n\r\n<template>\r\n <ElCheckboxGroup v-bind=\"checkboxProps\">\r\n <template v-if=\"!slots.option\">\r\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\r\n {{ isPlainObj(props.options[index]) ? props.options[index]?.label : option.label }}\r\n </component>\r\n </template>\r\n <template v-else>\r\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\r\n <slot name=\"option\" :option=\"option\" />\r\n </component>\r\n </template>\r\n </ElCheckboxGroup>\r\n</template>\r\n","import { connect, mapProps } from '@silver-formily/vue'\r\nimport { ElCheckbox } from 'element-plus'\r\nimport { composeExport, mapReadPretty } from '../__builtins__'\r\nimport { PreviewText } from '../preview-text'\r\nimport FCheckboxGroup from './checkbox-group.vue'\r\n\r\nconst CheckboxGroup = connect<typeof FCheckboxGroup>(\r\n FCheckboxGroup,\r\n mapProps({ dataSource: 'options', disabled: true }),\r\n mapReadPretty(PreviewText.Select, {\r\n multiple: true,\r\n }),\r\n)\r\n\r\nconst InnerCheckbox = connect<typeof ElCheckbox>(\r\n ElCheckbox,\r\n mapProps({\r\n disabled: true,\r\n }),\r\n)\r\n\r\nexport const Checkbox = composeExport(InnerCheckbox, {\r\n Group: CheckboxGroup,\r\n})\r\n\r\nexport default Checkbox\r\n"],"names":["props","__props","OptionType","computed","ElCheckboxButton","ElCheckbox","IS_LESS_THAN_2_6_0","lt","version","compatiableProps","option","isPlainObj","slots","useSlots","checkboxProps","useCleanAttrs","_openBlock","_createBlock","_unref","_createElementBlock","_Fragment","_renderList","index","_resolveDynamicComponent","_mergeProps","_renderSlot","_ctx","_createTextVNode","_toDisplayString","CheckboxGroup","connect","FCheckboxGroup","mapProps","mapReadPretty","PreviewText","InnerCheckbox","Checkbox","composeExport"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAaA,UAAMA,IAAQC,GAWRC,IAAaC,EAAS,MACnBH,EAAM,eAAe,WAAWI,IAAmBC,CAC3D,GACKC,IAAqBC,EAAGC,GAAS,OAAO,GACxCC,IAAmBN,EAAS,MACzBH,EAAM,QAAQ,IAAI,CAACU,MAAW;AACnC,UAAI,CAACC,EAAWD,CAAM;AACpB,eAAO;AAAA,UACL,OAAOA;AAAA,UACP,OAAOA;AAAA,QAAA;AAAA,MAEX;AAEA,aAAIJ,IACK;AAAA,QACL,GAAGI;AAAA,QACH,OAAOA,EAAO;AAAA,MAAA,IAGXA;AAAA,IACT,CAAC,CACF,GAEKE,IAAQC,EAAA,GACR,EAAE,OAAOC,EAAA,IAAkBC,EAAA;sBAI/BC,EAAA,GAAAC,EAWkBC,UAXOA,EAAAJ,CAAA,CAAa,CAAA,GAAA;AAAA,iBACpC,MAIW;AAAA,QAJMI,EAAAN,CAAA,EAAM,UAMrBI,EAAA,EAAA,GAAAG,EAEYC,GAAA,EAAA,KAAA,KAAAC,EAF0CZ,EAAA,OAAgB,CAAlCC,GAAQY,YAA5CL,EAEYM,EAFIrB,OAAU,GAA1BsB,EAEY,EAF6D,KAAKF,KAAK,EAAA,SAAA,GAAA,GAAUZ,CAAM,GAAA;AAAA,qBACjG,MAAuC;AAAA,YAAvCe,EAAuCC,EAAA,QAAA,UAAA,EAAlB,QAAAhB,GAAc;AAAA,UAAA;;6BANrCM,EAAA,EAAA,GAAAG,EAEYC,GAAA,EAAA,KAAA,KAAAC,EAF0CZ,EAAA,OAAgB,CAAlCC,GAAQY,YAA5CL,EAEYM,EAFIrB,OAAU,GAA1BsB,EAEY,EAF6D,KAAKF,KAAK,EAAA,SAAA,GAAA,GAAUZ,CAAM,GAAA;AAAA,qBACjG,MAAmF;AAAA,YAAhFiB,EAAAC,EAAAV,EAAAP,CAAA,EAAWX,EAAM,QAAQsB,CAAK,CAAA,IAAKtB,EAAM,QAAQsB,CAAK,GAAG,QAAQZ,EAAO,KAAK,GAAA,CAAA;AAAA,UAAA;;;;;;;ICjDlFmB,IAAgBC;AAAA,EACpBC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,UAAU,IAAM;AAAA,EAClDC,EAAcC,EAAY,QAAQ;AAAA,IAChC,UAAU;AAAA,EAAA,CACX;AACH,GAEMC,IAAgBL;AAAA,EACpBzB;AAAA,EACA2B,EAAS;AAAA,IACP,UAAU;AAAA,EAAA,CACX;AACH,GAEaI,IAAWC,EAAcF,GAAe;AAAA,EACnD,OAAON;AACT,CAAC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/checkbox/checkbox-group.vue","../../src/checkbox/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CheckboxProps } from 'element-plus'\nimport type { PropType } from 'vue'\nimport { isPlainObj } from '@formily/shared'\nimport { ElCheckbox, ElCheckboxButton, ElCheckboxGroup, version } from 'element-plus'\nimport { computed, useSlots } from 'vue'\nimport { lt, useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FCheckboxGroup',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n options: {\n type: Array as PropType<Array<CheckboxProps>>,\n default: () => [],\n },\n optionType: {\n type: String as PropType<'default' | 'button'>,\n default: 'default',\n },\n})\n\nconst OptionType = computed(() => {\n return props.optionType === 'button' ? ElCheckboxButton : ElCheckbox\n})\nconst IS_LESS_THAN_2_6_0 = lt(version, '2.6.0')\nconst compatiableProps = computed(() => {\n return props.options.map((option) => {\n if (!isPlainObj(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()\nconst { props: checkboxProps } = useCleanAttrs()\n</script>\n\n<template>\n <ElCheckboxGroup v-bind=\"checkboxProps\">\n <template v-if=\"!slots.option\">\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\n {{ isPlainObj(props.options[index]) ? props.options[index]?.label : option.label }}\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 </ElCheckboxGroup>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\nimport { ElCheckbox } from 'element-plus'\nimport { composeExport, mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FCheckboxGroup from './checkbox-group.vue'\n\nconst CheckboxGroup = connect<typeof FCheckboxGroup>(\n FCheckboxGroup,\n mapProps({ dataSource: 'options', disabled: true }),\n mapReadPretty(PreviewText.Select, {\n multiple: true,\n }),\n)\n\nconst InnerCheckbox = connect<typeof ElCheckbox>(\n ElCheckbox,\n mapProps({\n disabled: true,\n }),\n)\n\nexport const Checkbox = composeExport(InnerCheckbox, {\n Group: CheckboxGroup,\n})\n\nexport default Checkbox\n"],"names":["props","__props","OptionType","computed","ElCheckboxButton","ElCheckbox","IS_LESS_THAN_2_6_0","lt","version","compatiableProps","option","isPlainObj","slots","useSlots","checkboxProps","useCleanAttrs","_openBlock","_createBlock","_unref","_createElementBlock","_Fragment","_renderList","index","_resolveDynamicComponent","_mergeProps","_renderSlot","_ctx","_createTextVNode","_toDisplayString","CheckboxGroup","connect","FCheckboxGroup","mapProps","mapReadPretty","PreviewText","InnerCheckbox","Checkbox","composeExport"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,UAAMA,IAAQC,GAWRC,IAAaC,EAAS,MACnBH,EAAM,eAAe,WAAWI,IAAmBC,CAC3D,GACKC,IAAqBC,EAAGC,GAAS,OAAO,GACxCC,IAAmBN,EAAS,MACzBH,EAAM,QAAQ,IAAI,CAACU,MAAW;AACnC,UAAI,CAACC,EAAWD,CAAM;AACpB,eAAO;AAAA,UACL,OAAOA;AAAA,UACP,OAAOA;AAAA,QAAA;AAAA,MAEX;AAEA,aAAIJ,IACK;AAAA,QACL,GAAGI;AAAA,QACH,OAAOA,EAAO;AAAA,MAAA,IAGXA;AAAA,IACT,CAAC,CACF,GAEKE,IAAQC,EAAA,GACR,EAAE,OAAOC,EAAA,IAAkBC,EAAA;sBAI/BC,EAAA,GAAAC,EAWkBC,UAXOA,EAAAJ,CAAA,CAAa,CAAA,GAAA;AAAA,iBACpC,MAIW;AAAA,QAJMI,EAAAN,CAAA,EAAM,UAMrBI,EAAA,EAAA,GAAAG,EAEYC,GAAA,EAAA,KAAA,KAAAC,EAF0CZ,EAAA,OAAgB,CAAlCC,GAAQY,YAA5CL,EAEYM,EAFIrB,OAAU,GAA1BsB,EAEY,EAF6D,KAAKF,KAAK,EAAA,SAAA,GAAA,GAAUZ,CAAM,GAAA;AAAA,qBACjG,MAAuC;AAAA,YAAvCe,EAAuCC,EAAA,QAAA,UAAA,EAAlB,QAAAhB,GAAc;AAAA,UAAA;;6BANrCM,EAAA,EAAA,GAAAG,EAEYC,GAAA,EAAA,KAAA,KAAAC,EAF0CZ,EAAA,OAAgB,CAAlCC,GAAQY,YAA5CL,EAEYM,EAFIrB,OAAU,GAA1BsB,EAEY,EAF6D,KAAKF,KAAK,EAAA,SAAA,GAAA,GAAUZ,CAAM,GAAA;AAAA,qBACjG,MAAmF;AAAA,YAAhFiB,EAAAC,EAAAV,EAAAP,CAAA,EAAWX,EAAM,QAAQsB,CAAK,CAAA,IAAKtB,EAAM,QAAQsB,CAAK,GAAG,QAAQZ,EAAO,KAAK,GAAA,CAAA;AAAA,UAAA;;;;;;;ICjDlFmB,IAAgBC;AAAA,EACpBC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,UAAU,IAAM;AAAA,EAClDC,EAAcC,EAAY,QAAQ;AAAA,IAChC,UAAU;AAAA,EAAA,CACX;AACH,GAEMC,IAAgBL;AAAA,EACpBzB;AAAA,EACA2B,EAAS;AAAA,IACP,UAAU;AAAA,EAAA,CACX;AACH,GAEaI,KAAWC,EAAcF,GAAe;AAAA,EACnD,OAAON;AACT,CAAC;"}
@@ -1,14 +1,17 @@
1
1
  import { connect as r, mapProps as o } from "@silver-formily/vue";
2
2
  import { ElColorPicker as e } 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 c = r(
3
+ import "@formily/reactive";
4
+ import "@vueuse/core";
5
+ import "vue";
6
+ import { mapReadPretty as t } from "../__builtins__/shared/transform-component.mjs";
7
+ import { PreviewText as m } from "../preview-text/index.mjs";
8
+ const f = r(
6
9
  e,
7
10
  o({ readOnly: "readonly", disabled: !0 }),
8
- m(t.ColorPicker)
11
+ t(m.ColorPicker)
9
12
  );
10
13
  export {
11
- c as ColorPicker,
12
- c as default
14
+ f as ColorPicker,
15
+ f as default
13
16
  };
14
17
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/color-picker/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\r\nimport { ElColorPicker } from 'element-plus'\r\nimport { mapReadPretty } from '../__builtins__'\r\nimport { PreviewText } from '../preview-text'\r\n\r\nexport type ColorPickerProps = typeof ElColorPicker\r\n\r\nexport const ColorPicker = connect<typeof ElColorPicker>(\r\n ElColorPicker,\r\n mapProps({ readOnly: 'readonly', disabled: true }),\r\n mapReadPretty(PreviewText.ColorPicker),\r\n)\r\n\r\nexport default ColorPicker\r\n"],"names":["ColorPicker","connect","ElColorPicker","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;AAOO,MAAMA,IAAcC;AAAA,EACzBC;AAAA,EACAC,EAAS,EAAE,UAAU,YAAY,UAAU,IAAM;AAAA,EACjDC,EAAcC,EAAY,WAAW;AACvC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/color-picker/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\nimport { ElColorPicker } from 'element-plus'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\n\nexport type ColorPickerProps = typeof ElColorPicker\n\nexport const ColorPicker = connect<typeof ElColorPicker>(\n ElColorPicker,\n mapProps({ readOnly: 'readonly', disabled: true }),\n mapReadPretty(PreviewText.ColorPicker),\n)\n\nexport default ColorPicker\n"],"names":["ColorPicker","connect","ElColorPicker","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;AAOO,MAAMA,IAAcC;AAAA,EACzBC;AAAA,EACAC,EAAS,EAAE,UAAU,YAAY,UAAU,IAAM;AAAA,EACjDC,EAAcC,EAAY,WAAW;AACvC;"}
@@ -1,8 +1,11 @@
1
1
  import { connect as e, mapProps as o } from "@silver-formily/vue";
2
2
  import { ElColorPickerPanel as t } from "element-plus";
3
- import { PreviewText as i } from "../preview-text/index.mjs";
4
- import { mapReadPretty as a } from "../__builtins__/shared/transform-component.mjs";
5
- const d = e(
3
+ import "@formily/reactive";
4
+ import "@vueuse/core";
5
+ import "vue";
6
+ import { mapReadPretty as i } from "../__builtins__/shared/transform-component.mjs";
7
+ import { PreviewText as m } from "../preview-text/index.mjs";
8
+ const f = e(
6
9
  t,
7
10
  o(
8
11
  {
@@ -13,10 +16,10 @@ const d = e(
13
16
  disabled: !0
14
17
  } : r
15
18
  ),
16
- a(i.ColorPicker)
19
+ i(m.ColorPicker)
17
20
  );
18
21
  export {
19
- d as ColorPickerPanel,
20
- d as default
22
+ f as ColorPickerPanel,
23
+ f as default
21
24
  };
22
25
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/color-picker-panel/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\r\nimport { ElColorPickerPanel } from 'element-plus'\r\nimport { mapReadPretty } from '../__builtins__'\r\nimport { PreviewText } from '../preview-text'\r\n\r\nexport type ColorPickerPanelProps = typeof ElColorPickerPanel\r\n\r\nexport const ColorPickerPanel = connect<typeof ElColorPickerPanel>(\r\n ElColorPickerPanel,\r\n mapProps(\r\n {\r\n disabled: true,\r\n },\r\n (props: any) => {\r\n if (!props.readOnly) {\r\n return props\r\n }\r\n\r\n return {\r\n ...props,\r\n disabled: true,\r\n }\r\n },\r\n ),\r\n mapReadPretty(PreviewText.ColorPicker),\r\n)\r\n\r\nexport default ColorPickerPanel\r\n"],"names":["ColorPickerPanel","connect","ElColorPickerPanel","mapProps","props","mapReadPretty","PreviewText"],"mappings":";;;;AAOO,MAAMA,IAAmBC;AAAA,EAC9BC;AAAA,EACAC;AAAA,IACE;AAAA,MACE,UAAU;AAAA,IAAA;AAAA,IAEZ,CAACC,MACMA,EAAM,WAIJ;AAAA,MACL,GAAGA;AAAA,MACH,UAAU;AAAA,IAAA,IALHA;AAAA,EAOX;AAAA,EAEFC,EAAcC,EAAY,WAAW;AACvC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/color-picker-panel/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\nimport { ElColorPickerPanel } from 'element-plus'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\n\nexport type ColorPickerPanelProps = typeof ElColorPickerPanel\n\nexport const ColorPickerPanel = connect<typeof ElColorPickerPanel>(\n ElColorPickerPanel,\n mapProps(\n {\n disabled: true,\n },\n (props: any) => {\n if (!props.readOnly) {\n return props\n }\n\n return {\n ...props,\n disabled: true,\n }\n },\n ),\n mapReadPretty(PreviewText.ColorPicker),\n)\n\nexport default ColorPickerPanel\n"],"names":["ColorPickerPanel","connect","ElColorPickerPanel","mapProps","props","mapReadPretty","PreviewText"],"mappings":";;;;;;;AAOO,MAAMA,IAAmBC;AAAA,EAC9BC;AAAA,EACAC;AAAA,IACE;AAAA,MACE,UAAU;AAAA,IAAA;AAAA,IAEZ,CAACC,MACMA,EAAM,WAIJ;AAAA,MACL,GAAGA;AAAA,MACH,UAAU;AAAA,IAAA,IALHA;AAAA,EAOX;AAAA,EAEFC,EAAcC,EAAY,WAAW;AACvC;"}