@silver-formily/element-plus 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/README.en-US.md +32 -0
  2. package/README.md +18 -21
  3. package/esm/__builtins__/index.mjs +15 -16
  4. package/esm/__builtins__/shared/index.mjs +11 -12
  5. package/esm/__builtins__/shared/transform-component.d.ts +2 -7
  6. package/esm/__builtins__/shared/transform-component.mjs +16 -33
  7. package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
  8. package/esm/__builtins__/shared/utils.mjs +11 -11
  9. package/esm/__builtins__/shared/utils.mjs.map +1 -1
  10. package/esm/array-base/index.mjs +62 -62
  11. package/esm/array-base/index.mjs.map +1 -1
  12. package/esm/array-base/utils.mjs +2 -2
  13. package/esm/array-cards/array-cards.d.ts +1 -1
  14. package/esm/array-cards/index.d.ts +3 -3
  15. package/esm/array-cards/index.mjs +49 -49
  16. package/esm/array-cards/index.mjs.map +1 -1
  17. package/esm/array-collapse/array-collapse.d.ts +2 -2
  18. package/esm/array-collapse/index.d.ts +3 -3
  19. package/esm/array-collapse/index.mjs +85 -84
  20. package/esm/array-collapse/index.mjs.map +1 -1
  21. package/esm/array-collapse/utils.mjs +2 -2
  22. package/esm/array-items/index.mjs +43 -40
  23. package/esm/array-items/index.mjs.map +1 -1
  24. package/esm/array-list-tabs/array-list-tabs.d.ts +3 -3
  25. package/esm/array-list-tabs/index.d.ts +6 -6
  26. package/esm/array-list-tabs/index.mjs +93 -89
  27. package/esm/array-list-tabs/index.mjs.map +1 -1
  28. package/esm/array-list-tabs/utils.mjs +2 -2
  29. package/esm/array-table/array-table.d.ts +29 -1
  30. package/esm/array-table/index.d.ts +31 -3
  31. package/esm/array-table/index.mjs +126 -125
  32. package/esm/array-table/index.mjs.map +1 -1
  33. package/esm/array-table/types.d.ts +2 -1
  34. package/esm/array-table/utils.mjs +2 -2
  35. package/esm/array-tabs/index.mjs +17 -17
  36. package/esm/array-tabs/index.mjs.map +1 -1
  37. package/esm/cascader/cascader.d.ts +1 -6
  38. package/esm/cascader/index.d.ts +3 -16
  39. package/esm/cascader/index.mjs +29 -33
  40. package/esm/cascader/index.mjs.map +1 -1
  41. package/esm/checkbox/checkbox-group.d.ts +3 -19
  42. package/esm/checkbox/index.d.ts +445 -407
  43. package/esm/checkbox/index.mjs +27 -36
  44. package/esm/checkbox/index.mjs.map +1 -1
  45. package/esm/date-picker/index.d.ts +442 -1
  46. package/esm/date-picker/index.mjs +12 -19
  47. package/esm/date-picker/index.mjs.map +1 -1
  48. package/esm/editable/editable.d.ts +16 -12
  49. package/esm/editable/index.d.ts +8 -6
  50. package/esm/editable/index.mjs +108 -110
  51. package/esm/editable/index.mjs.map +1 -1
  52. package/esm/form/form.mjs +1 -1
  53. package/esm/form/form.mjs.map +1 -1
  54. package/esm/form-button-group/index.mjs +31 -30
  55. package/esm/form-button-group/index.mjs.map +1 -1
  56. package/esm/form-button-group/utils.mjs +2 -2
  57. package/esm/form-collapse/index.mjs +40 -40
  58. package/esm/form-collapse/index.mjs.map +1 -1
  59. package/esm/form-dialog/index.d.ts +1 -1
  60. package/esm/form-dialog/index.mjs +5 -5
  61. package/esm/form-dialog/index.mjs.map +1 -1
  62. package/esm/form-dialog/types.d.ts +6 -6
  63. package/esm/form-drawer/index.d.ts +1 -1
  64. package/esm/form-drawer/index.mjs +5 -5
  65. package/esm/form-drawer/index.mjs.map +1 -1
  66. package/esm/form-drawer/types.d.ts +6 -6
  67. package/esm/form-grid/index.d.ts +1 -183
  68. package/esm/form-grid/index.mjs +2 -2
  69. package/esm/form-grid/index.mjs.map +1 -1
  70. package/esm/form-item/form-item.d.ts +2 -1
  71. package/esm/form-item/index.d.ts +12 -6
  72. package/esm/form-item/index.mjs +156 -152
  73. package/esm/form-item/index.mjs.map +1 -1
  74. package/esm/form-item/types.d.ts +0 -1
  75. package/esm/form-layout/form-layout.d.ts +0 -1
  76. package/esm/form-layout/form-layout.mjs +55 -53
  77. package/esm/form-layout/form-layout.mjs.map +1 -1
  78. package/esm/form-layout/types.d.ts +0 -2
  79. package/esm/form-layout/utils.d.ts +3 -3
  80. package/esm/form-layout/utils.mjs +47 -42
  81. package/esm/form-layout/utils.mjs.map +1 -1
  82. package/esm/form-step/index.mjs +26 -24
  83. package/esm/form-step/index.mjs.map +1 -1
  84. package/esm/form-tab/form-tab.d.ts +2 -2
  85. package/esm/form-tab/hooks.mjs +1 -1
  86. package/esm/form-tab/hooks.mjs.map +1 -1
  87. package/esm/form-tab/index.d.ts +1 -26
  88. package/esm/form-tab/index.mjs +31 -31
  89. package/esm/form-tab/index.mjs.map +1 -1
  90. package/esm/form-tab/types.d.ts +1 -1
  91. package/esm/input/index.d.ts +6 -38
  92. package/esm/input/index.mjs +38 -47
  93. package/esm/input/index.mjs.map +1 -1
  94. package/esm/input/input.d.ts +1 -8
  95. package/esm/input-number/index.d.ts +326 -1
  96. package/esm/input-number/index.mjs +10 -17
  97. package/esm/input-number/index.mjs.map +1 -1
  98. package/esm/pagination/pagination.mjs +110 -111
  99. package/esm/pagination/pagination.mjs.map +1 -1
  100. package/esm/password/index.d.ts +6 -38
  101. package/esm/password/index.mjs +1 -1
  102. package/esm/password/index.mjs.map +1 -1
  103. package/esm/preview-text/cascader.d.ts +1 -1
  104. package/esm/preview-text/date-picker.d.ts +1 -1
  105. package/esm/preview-text/index.d.ts +13 -13
  106. package/esm/preview-text/index.mjs +121 -121
  107. package/esm/preview-text/index.mjs.map +1 -1
  108. package/esm/preview-text/input.d.ts +1 -1
  109. package/esm/preview-text/select.d.ts +1 -1
  110. package/esm/preview-text/time-picker.d.ts +1 -1
  111. package/esm/preview-text/tree.d.ts +1 -1
  112. package/esm/radio/index.d.ts +347 -219
  113. package/esm/radio/index.mjs +37 -44
  114. package/esm/radio/index.mjs.map +1 -1
  115. package/esm/radio/radio-group.d.ts +2 -13
  116. package/esm/reset/index.d.ts +1 -62
  117. package/esm/reset/index.mjs +2 -2
  118. package/esm/reset/index.mjs.map +1 -1
  119. package/esm/select/index.d.ts +3 -16
  120. package/esm/select/index.mjs +65 -70
  121. package/esm/select/index.mjs.map +1 -1
  122. package/esm/select/select.d.ts +1 -6
  123. package/esm/select-table/index.d.ts +33 -5
  124. package/esm/select-table/index.mjs +90 -89
  125. package/esm/select-table/index.mjs.map +1 -1
  126. package/esm/select-table/select-table.d.ts +58 -2
  127. package/esm/select-table/types.d.ts +1 -1
  128. package/esm/submit/index.d.ts +1 -47
  129. package/esm/submit/index.mjs +2 -2
  130. package/esm/submit/index.mjs.map +1 -1
  131. package/esm/switch/index.d.ts +296 -1
  132. package/esm/switch/index.mjs +5 -11
  133. package/esm/switch/index.mjs.map +1 -1
  134. package/esm/time-picker/index.d.ts +442 -1
  135. package/esm/time-picker/index.mjs +9 -14
  136. package/esm/time-picker/index.mjs.map +1 -1
  137. package/esm/time-select/index.d.ts +184 -1
  138. package/esm/time-select/index.mjs +8 -13
  139. package/esm/time-select/index.mjs.map +1 -1
  140. package/esm/transfer/index.d.ts +196 -115
  141. package/esm/transfer/index.mjs +5 -5
  142. package/esm/transfer/index.mjs.map +1 -1
  143. package/esm/tree/index.d.ts +5 -5
  144. package/esm/tree/index.mjs +34 -34
  145. package/esm/tree/index.mjs.map +1 -1
  146. package/esm/tree/tree.d.ts +2 -2
  147. package/esm/tree/types.d.ts +1 -1
  148. package/esm/tree-select/index.d.ts +3 -19
  149. package/esm/tree-select/index.mjs +23 -30
  150. package/esm/tree-select/index.mjs.map +1 -1
  151. package/esm/tree-select/tree-select.d.ts +1 -8
  152. package/esm/upload/index.d.ts +409 -404
  153. package/esm/upload/index.mjs +9 -9
  154. package/esm/upload/index.mjs.map +1 -1
  155. package/esm/upload/upload.d.ts +802 -792
  156. package/esm/vendor/icon.mjs.map +1 -1
  157. package/esm/vendor/lodash.mjs +12 -20
  158. package/esm/vendor/lodash.mjs.map +1 -1
  159. package/esm/vendor/runtime.mjs +29 -24
  160. package/esm/vendor/runtime.mjs.map +1 -1
  161. package/esm/vendor/shared.esm-bundler.mjs +2 -2
  162. package/esm/vendor/sizes.mjs.map +1 -1
  163. package/esm/vendor/types.mjs +5 -5
  164. package/esm/vendor/types.mjs.map +1 -1
  165. package/package.json +8 -11
@@ -1,22 +1,22 @@
1
- import { useField as A, connect as D, mapProps as H } from "@formily/vue";
2
- import { defineComponent as F, useSlots as P, ref as m, computed as y, watch as v, nextTick as k, createBlock as g, openBlock as C, unref as a, withCtx as T, withDirectives as R, mergeProps as w, createSlots as B, renderList as V, renderSlot as E, normalizeProps as L, guardReactiveProps as j } from "vue";
1
+ import { useField as _, connect as A, mapProps as D } from "@silver-formily/vue";
2
+ import { defineComponent as H, useSlots as P, ref as h, computed as y, watch as v, nextTick as k, createBlock as g, openBlock as C, unref as a, withCtx as T, withDirectives as R, mergeProps as w, createSlots as F, renderList as B, renderSlot as E, normalizeProps as L, guardReactiveProps as j } from "vue";
3
3
  import { ElScrollbar as z, ElTree as I, vLoading as N } from "element-plus";
4
4
  import "@formily/reactive";
5
5
  import { mapReadPretty as O } from "../__builtins__/shared/transform-component.mjs";
6
6
  import { PreviewText as $ } from "../preview-text/index.mjs";
7
7
  import { isFn as q } from "@formily/shared";
8
8
  import "@formily/core";
9
- import "@formily/reactive-vue";
9
+ import "@silver-formily/reactive-vue";
10
10
  import { useCleanAttrs as G } from "../__builtins__/shared/utils.mjs";
11
11
  import { addDisabledToNodes as J, flattenTree as M, getInputKeys as Q, getOutputData as U } from "./utils.mjs";
12
- const W = /* @__PURE__ */ F({
12
+ const W = /* @__PURE__ */ H({
13
13
  name: "Tree",
14
14
  inheritAttrs: !1,
15
15
  __name: "tree",
16
16
  props: {
17
- nodeKey: null,
18
- data: null,
19
- value: null,
17
+ nodeKey: {},
18
+ data: {},
19
+ modelValue: {},
20
20
  valueType: { default: "all" },
21
21
  includeHalfChecked: { type: Boolean, default: !1 },
22
22
  optionAsValue: { type: Boolean, default: !1 },
@@ -25,19 +25,19 @@ const W = /* @__PURE__ */ F({
25
25
  label: "label",
26
26
  disabled: "disabled"
27
27
  } },
28
- optionFormatter: { type: Function },
29
- height: null,
30
- maxHeight: null
28
+ optionFormatter: {},
29
+ height: {},
30
+ maxHeight: {}
31
31
  },
32
- emits: ["change"],
33
- setup(K, { emit: b }) {
34
- const e = K, i = b, x = P(), { props: l } = G(), o = m(), n = m([]), c = y(() => J(e.data ?? [], l.value.disabled, e.props)), d = y(() => M(c.value ?? [], [], e.props.children));
35
- async function p() {
32
+ emits: ["update:modelValue"],
33
+ setup(K, { emit: V }) {
34
+ const e = K, s = V, b = P(), { props: l } = G(), o = h(), d = h([]), n = y(() => J(e.data ?? [], l.value.disabled, e.props)), p = y(() => M(n.value ?? [], [], e.props.children));
35
+ async function c() {
36
36
  await k();
37
37
  const t = o.value.getCheckedKeys(), f = o.value.getHalfCheckedKeys() || [];
38
- n.value = t;
39
- const { value: h, nodes: r } = U(t, f, {
40
- flatData: d.value,
38
+ d.value = t;
39
+ const { value: m, nodes: r } = U(t, f, {
40
+ flatData: p.value,
41
41
  nodeKey: e.nodeKey,
42
42
  propsConfig: e.props,
43
43
  data: e.data ?? [],
@@ -45,24 +45,24 @@ const W = /* @__PURE__ */ F({
45
45
  includeHalfChecked: e.includeHalfChecked,
46
46
  checkStrictly: l.value.checkStrictly
47
47
  });
48
- e.optionAsValue ? q(e.optionFormatter) ? i("change", r.map((s, S, _) => e.optionFormatter(s, S, _))) : i("change", r) : i("change", h);
48
+ e.optionAsValue ? q(e.optionFormatter) ? s("update:modelValue", r.map((i, x, S) => e.optionFormatter(i, x, S))) : s("update:modelValue", r) : s("update:modelValue", m);
49
49
  }
50
- v(() => e.value, (t) => {
51
- t !== void 0 && (n.value = Q(t, {
50
+ v(() => e.modelValue, (t) => {
51
+ t !== void 0 && (d.value = Q(t, {
52
52
  optionAsValue: e.optionAsValue,
53
53
  nodeKey: e.nodeKey,
54
- flatData: d.value,
54
+ flatData: p.value,
55
55
  propsConfig: e.props,
56
56
  data: e.data ?? [],
57
57
  valueType: e.valueType,
58
58
  checkStrictly: l.value.checkStrictly
59
59
  }), k(() => {
60
- o.value && o.value.setCheckedKeys(n.value);
60
+ o.value && o.value.setCheckedKeys(d.value);
61
61
  }));
62
62
  }, { immediate: !0 }), v(() => [e.valueType, e.optionAsValue, e.includeHalfChecked], () => {
63
- p();
63
+ c();
64
64
  }, { immediate: !1 });
65
- const u = A();
65
+ const u = _();
66
66
  return u.value?.inject({
67
67
  getTreeRef: () => o
68
68
  }), (t, f) => (C(), g(a(z), {
@@ -73,16 +73,16 @@ const W = /* @__PURE__ */ F({
73
73
  R((C(), g(a(I), w({
74
74
  ref_key: "treeRef",
75
75
  ref: o,
76
- data: c.value,
76
+ data: n.value,
77
77
  props: e.props,
78
78
  "node-key": e.nodeKey,
79
- "default-checked-keys": n.value,
79
+ "default-checked-keys": d.value,
80
80
  "show-checkbox": !0
81
- }, a(l), { onCheck: p }), B({ _: 2 }, [
82
- V(a(x), (h, r) => ({
81
+ }, a(l), { onCheck: c }), F({ _: 2 }, [
82
+ B(a(b), (m, r) => ({
83
83
  name: r,
84
- fn: T((s) => [
85
- E(t.$slots, r, L(j({ field: a(u), ...s })))
84
+ fn: T((i) => [
85
+ E(t.$slots, r, L(j({ field: a(u), ...i })))
86
86
  ])
87
87
  }))
88
88
  ]), 1040, ["data", "props", "node-key", "default-checked-keys"])), [
@@ -92,13 +92,13 @@ const W = /* @__PURE__ */ F({
92
92
  _: 3
93
93
  }, 8, ["height", "max-height"]));
94
94
  }
95
- }), se = D(
95
+ }), ie = A(
96
96
  W,
97
- H({ dataSource: "data", loading: "loading", disabled: !0 }),
97
+ D({ dataSource: "data", loading: "loading", disabled: !0 }),
98
98
  O($.Tree)
99
99
  );
100
100
  export {
101
- se as Tree,
102
- se as default
101
+ ie as Tree,
102
+ ie as default
103
103
  };
104
104
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/tree/tree.vue","../../src/tree/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Field } from '@formily/core'\nimport type { TreeValueTypeProps } from './types'\nimport { isFn } from '@formily/shared'\nimport { useField } from '@formily/vue'\nimport { ElScrollbar, ElTree, vLoading } from 'element-plus'\nimport { computed, nextTick, ref, useSlots, watch } from 'vue'\nimport { useCleanAttrs } from '../__builtins__'\nimport { addDisabledToNodes, flattenTree, getInputKeys, getOutputData } from './utils'\n\ndefineOptions({\n name: 'Tree',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n nodeKey: null,\n data: null,\n value: null,\n valueType: { default: 'all' },\n includeHalfChecked: { type: Boolean, default: false },\n optionAsValue: { type: Boolean, default: false },\n props: { default: {\n children: 'children',\n label: 'label',\n disabled: 'disabled',\n } },\n optionFormatter: { type: Function },\n height: null,\n maxHeight: null\n})\n\nconst emit = defineEmits([\"change\"])\n\nconst slots = useSlots()\n\nconst { props: attrs } = useCleanAttrs()\nconst treeRef = ref<InstanceType<typeof ElTree>>()\nconst checkedKeys = ref<any[]>([])\n\nconst processedData = computed(() => {\n return addDisabledToNodes(props.data ?? [], attrs.value.disabled, props.props)\n})\n\nconst flatData = computed(() => flattenTree(processedData.value ?? [], [], props.props.children))\n\nasync function handleCheck() {\n await nextTick()\n const keys = treeRef.value.getCheckedKeys()\n const halfCheckedKeys = treeRef.value.getHalfCheckedKeys() || []\n checkedKeys.value = keys\n\n const { value, nodes } = getOutputData(keys, halfCheckedKeys, {\n flatData: flatData.value,\n nodeKey: props.nodeKey,\n propsConfig: props.props,\n data: props.data ?? [],\n valueType: props.valueType,\n includeHalfChecked: props.includeHalfChecked,\n checkStrictly: attrs.value.checkStrictly,\n })\n\n if (props.optionAsValue) {\n isFn(props.optionFormatter)\n ? emit('change', nodes.map((element, index, array) => {\n return props.optionFormatter(element, index, array)\n }))\n : emit('change', nodes)\n }\n else {\n emit('change', value)\n }\n}\n\nwatch(() => props.value, (newValue) => {\n if (newValue !== undefined) {\n checkedKeys.value = getInputKeys(newValue, {\n optionAsValue: props.optionAsValue,\n nodeKey: props.nodeKey,\n flatData: flatData.value,\n propsConfig: props.props,\n data: props.data ?? [],\n valueType: props.valueType,\n checkStrictly: attrs.value.checkStrictly,\n })\n nextTick(() => {\n if (treeRef.value) {\n treeRef.value.setCheckedKeys(checkedKeys.value)\n }\n })\n }\n}, { immediate: true })\n\nwatch(() => [props.valueType, props.optionAsValue, props.includeHalfChecked], () => {\n handleCheck()\n}, { immediate: false })\n\nconst fieldRef = useField<Field>()\nfieldRef.value?.inject({\n getTreeRef: () => {\n return treeRef\n },\n})\n</script>\n\n<template>\n <ElScrollbar :height=\"props.height\" :max-height=\"props.maxHeight\">\n <ElTree\n ref=\"treeRef\"\n v-loading=\"attrs.loading\"\n :data=\"processedData\"\n :props=\"props.props\"\n :node-key=\"props.nodeKey\"\n :default-checked-keys=\"checkedKeys\"\n :show-checkbox=\"true\"\n v-bind=\"attrs\"\n @check=\"handleCheck\"\n >\n <template v-for=\"(_, name) of slots\" #[name]=\"slotData\">\n <slot :name=\"name\" v-bind=\"{ field: fieldRef, ...slotData }\" />\n </template>\n </ElTree>\n </ElScrollbar>\n</template>\n","import { connect, mapProps } from '@formily/vue'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport InnerTree from './tree.vue'\n\nconst Tree = connect(\n InnerTree,\n mapProps({ dataSource: 'data', loading: 'loading', disabled: true }),\n mapReadPretty(PreviewText.Tree),\n)\n\nexport { Tree }\n\nexport default Tree\n"],"names":["props","__props","emit","__emit","slots","useSlots","attrs","useCleanAttrs","treeRef","ref","checkedKeys","processedData","computed","addDisabledToNodes","flatData","flattenTree","handleCheck","nextTick","keys","halfCheckedKeys","value","nodes","getOutputData","isFn","element","index","array","watch","newValue","getInputKeys","fieldRef","useField","_createBlock","_unref","ElScrollbar","_withDirectives","_openBlock","_mergeProps","_createSlots","_","name","_withCtx","slotData","_renderSlot","_ctx","_normalizeProps","_guardReactiveProps","vLoading","Tree","connect","InnerTree","mapProps","map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AA,QAAA;;;;;ICxGxB0C,KAAOC;AAAA,EACXC;AAAAA,EACAC,EAAS,EAAE,YAAY,QAAQ,SAAS,WAAW,UAAU,IAAM;AAAA,EACnEC,EAAcC,EAAY,IAAI;AAChC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/tree/tree.vue","../../src/tree/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Field } from '@formily/core'\nimport type { TreeValueTypeProps } from './types'\nimport { isFn } from '@formily/shared'\nimport { useField } from '@silver-formily/vue'\nimport { ElScrollbar, ElTree, vLoading } from 'element-plus'\nimport { computed, nextTick, ref, useSlots, watch } from 'vue'\nimport { useCleanAttrs } from '../__builtins__'\nimport { addDisabledToNodes, flattenTree, getInputKeys, getOutputData } from './utils'\n\ndefineOptions({\n name: 'Tree',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<TreeValueTypeProps>(), {\n valueType: 'all',\n optionAsValue: false,\n includeHalfChecked: false,\n props: {\n children: 'children',\n label: 'label',\n disabled: 'disabled',\n },\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: any]\n}>()\n\nconst slots = useSlots()\n\nconst { props: attrs } = useCleanAttrs()\nconst treeRef = ref<InstanceType<typeof ElTree>>()\nconst checkedKeys = ref<any[]>([])\n\nconst processedData = computed(() => {\n return addDisabledToNodes(props.data ?? [], attrs.value.disabled, props.props)\n})\n\nconst flatData = computed(() => flattenTree(processedData.value ?? [], [], props.props.children))\n\nasync function handleCheck() {\n await nextTick()\n const keys = treeRef.value.getCheckedKeys()\n const halfCheckedKeys = treeRef.value.getHalfCheckedKeys() || []\n checkedKeys.value = keys\n\n const { value, nodes } = getOutputData(keys, halfCheckedKeys, {\n flatData: flatData.value,\n nodeKey: props.nodeKey,\n propsConfig: props.props,\n data: props.data ?? [],\n valueType: props.valueType,\n includeHalfChecked: props.includeHalfChecked,\n checkStrictly: attrs.value.checkStrictly,\n })\n\n if (props.optionAsValue) {\n isFn(props.optionFormatter)\n ? emit('update:modelValue', nodes.map((element, index, array) => {\n return props.optionFormatter(element, index, array)\n }))\n : emit('update:modelValue', nodes)\n }\n else {\n emit('update:modelValue', value)\n }\n}\n\nwatch(() => props.modelValue, (newValue) => {\n if (newValue !== undefined) {\n checkedKeys.value = getInputKeys(newValue, {\n optionAsValue: props.optionAsValue,\n nodeKey: props.nodeKey,\n flatData: flatData.value,\n propsConfig: props.props,\n data: props.data ?? [],\n valueType: props.valueType,\n checkStrictly: attrs.value.checkStrictly,\n })\n nextTick(() => {\n if (treeRef.value) {\n treeRef.value.setCheckedKeys(checkedKeys.value)\n }\n })\n }\n}, { immediate: true })\n\nwatch(() => [props.valueType, props.optionAsValue, props.includeHalfChecked], () => {\n handleCheck()\n}, { immediate: false })\n\nconst fieldRef = useField<Field>()\nfieldRef.value?.inject({\n getTreeRef: () => {\n return treeRef\n },\n})\n</script>\n\n<template>\n <ElScrollbar :height=\"props.height\" :max-height=\"props.maxHeight\">\n <ElTree\n ref=\"treeRef\"\n v-loading=\"attrs.loading\"\n :data=\"processedData\"\n :props=\"props.props\"\n :node-key=\"props.nodeKey\"\n :default-checked-keys=\"checkedKeys\"\n :show-checkbox=\"true\"\n v-bind=\"attrs\"\n @check=\"handleCheck\"\n >\n <template v-for=\"(_, name) of slots\" #[name]=\"slotData\">\n <slot :name=\"name\" v-bind=\"{ field: fieldRef, ...slotData }\" />\n </template>\n </ElTree>\n </ElScrollbar>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport InnerTree from './tree.vue'\n\nconst Tree = connect<typeof InnerTree>(\n InnerTree,\n mapProps({ dataSource: 'data', loading: 'loading', disabled: true }),\n mapReadPretty(PreviewText.Tree),\n)\n\nexport { Tree }\n\nexport default Tree\n"],"names":["props","__props","emit","__emit","slots","useSlots","attrs","useCleanAttrs","treeRef","ref","checkedKeys","processedData","computed","addDisabledToNodes","flatData","flattenTree","handleCheck","nextTick","keys","halfCheckedKeys","value","nodes","getOutputData","isFn","element","index","array","watch","newValue","getInputKeys","fieldRef","useField","_createBlock","_unref","ElScrollbar","_withDirectives","_openBlock","_mergeProps","_createSlots","_","name","_withCtx","slotData","_renderSlot","_ctx","_normalizeProps","_guardReactiveProps","vLoading","Tree","connect","InnerTree","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,UAAMA,IAAQC,GAWRC,IAAOC,GAIPC,IAAQC,EAAA,GAER,EAAE,OAAOC,EAAA,IAAUC,EAAA,GACnBC,IAAUC,EAAA,GACVC,IAAcD,EAAW,EAAE,GAE3BE,IAAgBC,EAAS,MACtBC,EAAmBb,EAAM,QAAQ,CAAA,GAAIM,EAAM,MAAM,UAAUN,EAAM,KAAK,CAC9E,GAEKc,IAAWF,EAAS,MAAMG,EAAYJ,EAAc,SAAS,CAAA,GAAI,IAAIX,EAAM,MAAM,QAAQ,CAAC;AAEhG,mBAAegB,IAAc;AAC3B,YAAMC,EAAA;AACN,YAAMC,IAAOV,EAAQ,MAAM,eAAA,GACrBW,IAAkBX,EAAQ,MAAM,mBAAA,KAAwB,CAAA;AAC9D,MAAAE,EAAY,QAAQQ;AAEpB,YAAM,EAAE,OAAAE,GAAO,OAAAC,EAAA,IAAUC,EAAcJ,GAAMC,GAAiB;AAAA,QAC5D,UAAUL,EAAS;AAAA,QACnB,SAASd,EAAM;AAAA,QACf,aAAaA,EAAM;AAAA,QACnB,MAAMA,EAAM,QAAQ,CAAA;AAAA,QACpB,WAAWA,EAAM;AAAA,QACjB,oBAAoBA,EAAM;AAAA,QAC1B,eAAeM,EAAM,MAAM;AAAA,MAAA,CAC5B;AAED,MAAIN,EAAM,gBACRuB,EAAKvB,EAAM,eAAe,IACtBE,EAAK,qBAAqBmB,EAAM,IAAI,CAACG,GAASC,GAAOC,MAC5C1B,EAAM,gBAAgBwB,GAASC,GAAOC,CAAK,CACnD,CAAC,IACFxB,EAAK,qBAAqBmB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AD4CC,MAAQ;AAAA,cACpDC,EAA+DC,EAAA,QAAlDJ,GAAIK,EAAAC,EAAA,EAAA,OAAmBb,EAAAH,CAAA,MAAaY,EAAA,CAAQ,CAAA,CAAA;AAAA,YAAA;;;UAVhD,CAAAT,EAAAc,CAAA,GAAAd,EAAA3B,CAAA,EAAM,OAAO;AAAA,QAAA;;;;;ICpGxB0C,KAAOC;AAAA,EACXC;AAAAA,EACAC,EAAS,EAAE,YAAY,QAAQ,SAAS,WAAW,UAAU,IAAM;AAAA,EACnEC,EAAcC,EAAY,IAAI;AAChC;"}
@@ -2,9 +2,9 @@ import { TreeValueTypeProps } from './types';
2
2
  declare function __VLS_template(): any;
3
3
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
4
4
  declare const __VLS_component: import('vue').DefineComponent<TreeValueTypeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
5
- change: (value: any) => any;
5
+ "update:modelValue": (value: any) => any;
6
6
  }, string, import('vue').PublicProps, Readonly<TreeValueTypeProps> & Readonly<{
7
- onChange?: (value: any) => any;
7
+ "onUpdate:modelValue"?: (value: any) => any;
8
8
  }>, {
9
9
  props: any;
10
10
  valueType: "all" | "parent" | "child" | "path";
@@ -2,7 +2,7 @@ import { TreeNodeData } from 'element-plus';
2
2
  export interface TreeValueTypeProps {
3
3
  nodeKey: string;
4
4
  data?: TreeNodeData[];
5
- value?: any;
5
+ modelValue?: any;
6
6
  valueType?: 'all' | 'parent' | 'child' | 'path';
7
7
  includeHalfChecked?: boolean;
8
8
  optionAsValue?: boolean;
@@ -1,32 +1,16 @@
1
1
  export declare const TreeSelect: {
2
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
3
- value: any;
4
- }> & Readonly<{
5
- onChange?: (...args: any[]) => any;
6
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
- change: (...args: any[]) => void;
8
- }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, any, any, import('vue').ComponentProvideOptions, {
2
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, any, any, import('vue').ComponentProvideOptions, {
9
3
  P: {};
10
4
  B: {};
11
5
  D: {};
12
6
  C: {};
13
7
  M: {};
14
8
  Defaults: {};
15
- }, Readonly<{
16
- value: any;
17
- }> & Readonly<{
18
- onChange?: (...args: any[]) => any;
19
- }>, {}, {}, {}, {}, {}>;
9
+ }, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
20
10
  __isFragment?: never;
21
11
  __isTeleport?: never;
22
12
  __isSuspense?: never;
23
- } & import('vue').ComponentOptionsBase<Readonly<{
24
- value: any;
25
- }> & Readonly<{
26
- onChange?: (...args: any[]) => any;
27
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
28
- change: (...args: any[]) => void;
29
- }, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
13
+ } & import('vue').ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
30
14
  $slots: any;
31
15
  });
32
16
  export default TreeSelect;
@@ -1,47 +1,40 @@
1
- import { useField as f, connect as S, mapProps as v } from "@formily/vue";
2
- import { defineComponent as g, useSlots as P, ref as R, createBlock as _, openBlock as T, unref as e, mergeProps as y, createSlots as h, renderList as k, withCtx as x, renderSlot as C, normalizeProps as w, guardReactiveProps as A } from "vue";
3
- import { ElTreeSelect as B } from "element-plus";
1
+ import { useField as c, connect as i, mapProps as p } from "@silver-formily/vue";
2
+ import { defineComponent as m, useSlots as f, ref as d, createBlock as u, openBlock as S, unref as e, mergeProps as _, createSlots as g, renderList as P, withCtx as R, renderSlot as T, normalizeProps as v, guardReactiveProps as y } from "vue";
3
+ import { ElTreeSelect as h } from "element-plus";
4
4
  import "@formily/reactive";
5
- import { mapReadPretty as F } from "../__builtins__/shared/transform-component.mjs";
6
- import { PreviewText as V } from "../preview-text/index.mjs";
5
+ import { mapReadPretty as k } from "../__builtins__/shared/transform-component.mjs";
6
+ import { PreviewText as x } from "../preview-text/index.mjs";
7
7
  import "@formily/core";
8
- import "@formily/reactive-vue";
9
- import { useCleanAttrs as j } from "../__builtins__/shared/utils.mjs";
10
- const z = /* @__PURE__ */ g({
8
+ import "@silver-formily/reactive-vue";
9
+ import { useCleanAttrs as C } from "../__builtins__/shared/utils.mjs";
10
+ const w = /* @__PURE__ */ m({
11
11
  name: "FSelectTree",
12
12
  inheritAttrs: !1,
13
13
  __name: "tree-select",
14
- props: {
15
- value: null
16
- },
17
- emits: ["change"],
18
- setup(a, { emit: s }) {
19
- const m = a, i = s, c = P(), { props: p } = j(), r = R(), t = f();
14
+ setup(A) {
15
+ const n = f(), { props: l } = C(), r = d(), t = c();
20
16
  return t.value?.inject({
21
17
  getTreeSelectRef: () => r
22
- }), (u, o) => (T(), _(e(B), y({
18
+ }), (s, B) => (S(), u(e(h), _({
23
19
  ref_key: "treeSelectRef",
24
20
  ref: r,
25
- "model-value": m.value,
26
21
  loading: e(t).value?.loading
27
- }, e(p), {
28
- "onUpdate:modelValue": o[0] || (o[0] = (l) => i("change", l))
29
- }), h({ _: 2 }, [
30
- k(e(c), (l, n) => ({
31
- name: n,
32
- fn: x((d) => [
33
- C(u.$slots, n, w(A({ field: e(t), ...d })))
22
+ }, e(l)), g({ _: 2 }, [
23
+ P(e(n), (F, o) => ({
24
+ name: o,
25
+ fn: R((a) => [
26
+ T(s.$slots, o, v(y({ field: e(t), ...a })))
34
27
  ])
35
28
  }))
36
- ]), 1040, ["model-value", "loading"]));
29
+ ]), 1040, ["loading"]));
37
30
  }
38
- }), H = S(
39
- z,
40
- v({ value: "modelValue", readOnly: "readonly", dataSource: "data" }),
41
- F(V.Select)
31
+ }), G = i(
32
+ w,
33
+ p({ readOnly: "readonly", dataSource: "data" }),
34
+ k(x.Select)
42
35
  );
43
36
  export {
44
- H as TreeSelect,
45
- H as default
37
+ G as TreeSelect,
38
+ G as default
46
39
  };
47
40
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/tree-select/tree-select.vue","../../src/tree-select/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Field } from '@formily/core'\nimport { useField } from '@formily/vue'\nimport { ElTreeSelect } from 'element-plus'\nimport { ref, useSlots } from 'vue'\nimport { useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FSelectTree',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n value: null\n})\n\nconst emit = defineEmits(['change'])\n\nconst slots = useSlots()\n\nconst { props: attrs } = useCleanAttrs()\n\nconst treeSelectRef = ref()\n\nconst fieldRef = useField<Field>()\n\nfieldRef.value?.inject({\n getTreeSelectRef: () => {\n return treeSelectRef\n },\n})\n</script>\n\n<template>\n <ElTreeSelect\n ref=\"treeSelectRef\"\n :model-value=\"props.value\"\n :loading=\"fieldRef.value?.loading\"\n v-bind=\"attrs\"\n @update:model-value=\"emit('change', $event)\"\n >\n <template v-for=\"(_, name) of slots\" #[name]=\"slotData\">\n <slot :name=\"name\" v-bind=\"{ field: fieldRef, ...slotData }\" />\n </template>\n </ElTreeSelect>\n</template>\n","import { connect, mapProps } from '@formily/vue'\r\nimport { mapReadPretty } from '../__builtins__'\r\nimport { PreviewText } from '../preview-text'\r\nimport FTreeSelect from './tree-select.vue'\r\n\r\nexport const TreeSelect = connect(\r\n FTreeSelect,\r\n mapProps({ value: 'modelValue', readOnly: 'readonly', dataSource: 'data' }),\r\n mapReadPretty(PreviewText.Select),\r\n)\r\n\r\nexport default TreeSelect\r\n"],"names":["props","__props","emit","__emit","slots","useSlots","attrs","useCleanAttrs","treeSelectRef","ref","fieldRef","useField","_openBlock","_createBlock","_unref","_mergeProps","_cache","$event","_","name","_withCtx","slotData","_renderSlot","_ctx","_normalizeProps","_guardReactiveProps","TreeSelect","connect","FTreeSelect","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;;;;;AAYA,UAAMA,IAAQC,GAIRC,IAAOC,GAEPC,IAAQC,EAAA,GAER,EAAE,OAAOC,EAAA,IAAUC,EAAA,GAEnBC,IAAgBC,EAAA,GAEhBC,IAAWC,EAAA;AAEjB,WAAAD,EAAS,OAAO,OAAO;AAAA,MACrB,kBAAkB,MACTF;AAAA,IACT,CACD,cAICI,KAAAC,EAUeC,MAVfC,EAUe;AAAA,eATT;AAAA,MAAJ,KAAIP;AAAA,MACH,eAAaR,EAAM;AAAA,MACnB,SAASc,EAAAJ,CAAA,EAAS,OAAO;AAAA,IAAA,GAClBI,EAAAR,CAAA,GAAK;AAAA,MACZ,uBAAkBU,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEf,EAAI,UAAWe,CAAM;AAAA,IAAA;QAEZH,EAAAV,CAAA,GAAK,CAAjBc,GAAGC;;QACnB,IAAAC,EAAA,CAD4CC,MAAQ;AAAA,UACpDC,EAA+DC,EAAA,QAAlDJ,GAAIK,EAAAC,EAAA,EAAA,OAAmBX,EAAAJ,CAAA,MAAaW,EAAA,CAAQ,CAAA,CAAA;AAAA,QAAA;;;;ICrClDK,IAAaC;AAAA,EACxBC;AAAAA,EACAC,EAAS,EAAE,OAAO,cAAc,UAAU,YAAY,YAAY,QAAQ;AAAA,EAC1EC,EAAcC,EAAY,MAAM;AAClC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/tree-select/tree-select.vue","../../src/tree-select/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Field } from '@formily/core'\nimport { useField } from '@silver-formily/vue'\nimport { ElTreeSelect } from 'element-plus'\nimport { ref, useSlots } from 'vue'\nimport { useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FSelectTree',\n inheritAttrs: false,\n})\n\nconst slots = useSlots()\n\nconst { props: attrs } = useCleanAttrs()\n\nconst treeSelectRef = ref()\n\nconst fieldRef = useField<Field>()\n\nfieldRef.value?.inject({\n getTreeSelectRef: () => {\n return treeSelectRef\n },\n})\n</script>\n\n<template>\n <ElTreeSelect\n ref=\"treeSelectRef\"\n :loading=\"fieldRef.value?.loading\"\n v-bind=\"attrs\"\n >\n <template v-for=\"(_, name) of slots\" #[name]=\"slotData\">\n <slot :name=\"name\" v-bind=\"{ field: fieldRef, ...slotData }\" />\n </template>\n </ElTreeSelect>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\r\nimport { mapReadPretty } from '../__builtins__'\r\nimport { PreviewText } from '../preview-text'\r\nimport FTreeSelect from './tree-select.vue'\r\n\r\nexport const TreeSelect = connect<typeof FTreeSelect>(\n FTreeSelect,\n mapProps({ readOnly: 'readonly', dataSource: 'data' }),\r\n mapReadPretty(PreviewText.Select),\r\n)\r\n\r\nexport default TreeSelect\r\n"],"names":["slots","useSlots","attrs","useCleanAttrs","treeSelectRef","ref","fieldRef","useField","_openBlock","_createBlock","_unref","_mergeProps","_createSlots","_","name","_withCtx","slotData","_renderSlot","_ctx","_normalizeProps","_guardReactiveProps","TreeSelect","connect","FTreeSelect","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;AAYA,UAAMA,IAAQC,EAAA,GAER,EAAE,OAAOC,EAAA,IAAUC,EAAA,GAEnBC,IAAgBC,EAAA,GAEhBC,IAAWC,EAAA;AAEjB,WAAAD,EAAS,OAAO,OAAO;AAAA,MACrB,kBAAkB,MACTF;AAAA,IACT,CACD,cAICI,KAAAC,EAQeC,MARfC,EAQe;AAAA,eAPT;AAAA,MAAJ,KAAIP;AAAA,MACH,SAASM,EAAAJ,CAAA,EAAS,OAAO;AAAA,IAAA,GAClBI,EAAAR,CAAA,CAAK,GAAAU,EAAA,EAAA,GAAA,KAAA;AAAA,QAEiBF,EAAAV,CAAA,GAAK,CAAjBa,GAAGC;;QACnB,IAAAC,EAAA,CAD4CC,MAAQ;AAAA,UACpDC,EAA+DC,EAAA,QAAlDJ,GAAIK,EAAAC,EAAA,EAAA,OAAmBV,EAAAJ,CAAA,MAAaU,EAAA,CAAQ,CAAA,CAAA;AAAA,QAAA;;;;IC7BlDK,IAAaC;AAAA,EACxBC;AAAAA,EACAC,EAAS,EAAE,UAAU,YAAY,YAAY,QAAQ;AAAA,EACrDC,EAAcC,EAAY,MAAM;AAClC;"}
@@ -1,13 +1,6 @@
1
- type __VLS_Props = {
2
- value: any;
3
- };
4
1
  declare function __VLS_template(): any;
5
2
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
6
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
- change: (...args: any[]) => void;
8
- }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
9
- onChange?: (...args: any[]) => any;
10
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, any, any>;
3
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, any, any>;
11
4
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
12
5
  export default _default;
13
6
  type __VLS_WithTemplateSlots<T, S> = T & {