@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.
- package/README.en-US.md +32 -0
- package/README.md +18 -21
- package/esm/__builtins__/index.mjs +15 -16
- package/esm/__builtins__/shared/index.mjs +11 -12
- package/esm/__builtins__/shared/transform-component.d.ts +2 -7
- package/esm/__builtins__/shared/transform-component.mjs +16 -33
- package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
- package/esm/__builtins__/shared/utils.mjs +11 -11
- package/esm/__builtins__/shared/utils.mjs.map +1 -1
- package/esm/array-base/index.mjs +62 -62
- package/esm/array-base/index.mjs.map +1 -1
- package/esm/array-base/utils.mjs +2 -2
- package/esm/array-cards/array-cards.d.ts +1 -1
- package/esm/array-cards/index.d.ts +3 -3
- package/esm/array-cards/index.mjs +49 -49
- package/esm/array-cards/index.mjs.map +1 -1
- package/esm/array-collapse/array-collapse.d.ts +2 -2
- package/esm/array-collapse/index.d.ts +3 -3
- package/esm/array-collapse/index.mjs +85 -84
- package/esm/array-collapse/index.mjs.map +1 -1
- package/esm/array-collapse/utils.mjs +2 -2
- package/esm/array-items/index.mjs +43 -40
- package/esm/array-items/index.mjs.map +1 -1
- package/esm/array-list-tabs/array-list-tabs.d.ts +3 -3
- package/esm/array-list-tabs/index.d.ts +6 -6
- package/esm/array-list-tabs/index.mjs +93 -89
- package/esm/array-list-tabs/index.mjs.map +1 -1
- package/esm/array-list-tabs/utils.mjs +2 -2
- package/esm/array-table/array-table.d.ts +29 -1
- package/esm/array-table/index.d.ts +31 -3
- package/esm/array-table/index.mjs +126 -125
- package/esm/array-table/index.mjs.map +1 -1
- package/esm/array-table/types.d.ts +2 -1
- package/esm/array-table/utils.mjs +2 -2
- package/esm/array-tabs/index.mjs +17 -17
- package/esm/array-tabs/index.mjs.map +1 -1
- package/esm/cascader/cascader.d.ts +1 -6
- package/esm/cascader/index.d.ts +3 -16
- package/esm/cascader/index.mjs +29 -33
- package/esm/cascader/index.mjs.map +1 -1
- package/esm/checkbox/checkbox-group.d.ts +3 -19
- package/esm/checkbox/index.d.ts +445 -407
- package/esm/checkbox/index.mjs +27 -36
- package/esm/checkbox/index.mjs.map +1 -1
- package/esm/date-picker/index.d.ts +442 -1
- package/esm/date-picker/index.mjs +12 -19
- package/esm/date-picker/index.mjs.map +1 -1
- package/esm/editable/editable.d.ts +16 -12
- package/esm/editable/index.d.ts +8 -6
- package/esm/editable/index.mjs +108 -110
- package/esm/editable/index.mjs.map +1 -1
- package/esm/form/form.mjs +1 -1
- package/esm/form/form.mjs.map +1 -1
- package/esm/form-button-group/index.mjs +31 -30
- package/esm/form-button-group/index.mjs.map +1 -1
- package/esm/form-button-group/utils.mjs +2 -2
- package/esm/form-collapse/index.mjs +40 -40
- package/esm/form-collapse/index.mjs.map +1 -1
- package/esm/form-dialog/index.d.ts +1 -1
- package/esm/form-dialog/index.mjs +5 -5
- package/esm/form-dialog/index.mjs.map +1 -1
- package/esm/form-dialog/types.d.ts +6 -6
- package/esm/form-drawer/index.d.ts +1 -1
- package/esm/form-drawer/index.mjs +5 -5
- package/esm/form-drawer/index.mjs.map +1 -1
- package/esm/form-drawer/types.d.ts +6 -6
- package/esm/form-grid/index.d.ts +1 -183
- package/esm/form-grid/index.mjs +2 -2
- package/esm/form-grid/index.mjs.map +1 -1
- package/esm/form-item/form-item.d.ts +2 -1
- package/esm/form-item/index.d.ts +12 -6
- package/esm/form-item/index.mjs +156 -152
- package/esm/form-item/index.mjs.map +1 -1
- package/esm/form-item/types.d.ts +0 -1
- package/esm/form-layout/form-layout.d.ts +0 -1
- package/esm/form-layout/form-layout.mjs +55 -53
- package/esm/form-layout/form-layout.mjs.map +1 -1
- package/esm/form-layout/types.d.ts +0 -2
- package/esm/form-layout/utils.d.ts +3 -3
- package/esm/form-layout/utils.mjs +47 -42
- package/esm/form-layout/utils.mjs.map +1 -1
- package/esm/form-step/index.mjs +26 -24
- package/esm/form-step/index.mjs.map +1 -1
- package/esm/form-tab/form-tab.d.ts +2 -2
- package/esm/form-tab/hooks.mjs +1 -1
- package/esm/form-tab/hooks.mjs.map +1 -1
- package/esm/form-tab/index.d.ts +1 -26
- package/esm/form-tab/index.mjs +31 -31
- package/esm/form-tab/index.mjs.map +1 -1
- package/esm/form-tab/types.d.ts +1 -1
- package/esm/input/index.d.ts +6 -38
- package/esm/input/index.mjs +38 -47
- package/esm/input/index.mjs.map +1 -1
- package/esm/input/input.d.ts +1 -8
- package/esm/input-number/index.d.ts +326 -1
- package/esm/input-number/index.mjs +10 -17
- package/esm/input-number/index.mjs.map +1 -1
- package/esm/pagination/pagination.mjs +110 -111
- package/esm/pagination/pagination.mjs.map +1 -1
- package/esm/password/index.d.ts +6 -38
- package/esm/password/index.mjs +1 -1
- package/esm/password/index.mjs.map +1 -1
- package/esm/preview-text/cascader.d.ts +1 -1
- package/esm/preview-text/date-picker.d.ts +1 -1
- package/esm/preview-text/index.d.ts +13 -13
- package/esm/preview-text/index.mjs +121 -121
- package/esm/preview-text/index.mjs.map +1 -1
- package/esm/preview-text/input.d.ts +1 -1
- package/esm/preview-text/select.d.ts +1 -1
- package/esm/preview-text/time-picker.d.ts +1 -1
- package/esm/preview-text/tree.d.ts +1 -1
- package/esm/radio/index.d.ts +347 -219
- package/esm/radio/index.mjs +37 -44
- package/esm/radio/index.mjs.map +1 -1
- package/esm/radio/radio-group.d.ts +2 -13
- package/esm/reset/index.d.ts +1 -62
- package/esm/reset/index.mjs +2 -2
- package/esm/reset/index.mjs.map +1 -1
- package/esm/select/index.d.ts +3 -16
- package/esm/select/index.mjs +65 -70
- package/esm/select/index.mjs.map +1 -1
- package/esm/select/select.d.ts +1 -6
- package/esm/select-table/index.d.ts +33 -5
- package/esm/select-table/index.mjs +90 -89
- package/esm/select-table/index.mjs.map +1 -1
- package/esm/select-table/select-table.d.ts +58 -2
- package/esm/select-table/types.d.ts +1 -1
- package/esm/submit/index.d.ts +1 -47
- package/esm/submit/index.mjs +2 -2
- package/esm/submit/index.mjs.map +1 -1
- package/esm/switch/index.d.ts +296 -1
- package/esm/switch/index.mjs +5 -11
- package/esm/switch/index.mjs.map +1 -1
- package/esm/time-picker/index.d.ts +442 -1
- package/esm/time-picker/index.mjs +9 -14
- package/esm/time-picker/index.mjs.map +1 -1
- package/esm/time-select/index.d.ts +184 -1
- package/esm/time-select/index.mjs +8 -13
- package/esm/time-select/index.mjs.map +1 -1
- package/esm/transfer/index.d.ts +196 -115
- package/esm/transfer/index.mjs +5 -5
- package/esm/transfer/index.mjs.map +1 -1
- package/esm/tree/index.d.ts +5 -5
- package/esm/tree/index.mjs +34 -34
- package/esm/tree/index.mjs.map +1 -1
- package/esm/tree/tree.d.ts +2 -2
- package/esm/tree/types.d.ts +1 -1
- package/esm/tree-select/index.d.ts +3 -19
- package/esm/tree-select/index.mjs +23 -30
- package/esm/tree-select/index.mjs.map +1 -1
- package/esm/tree-select/tree-select.d.ts +1 -8
- package/esm/upload/index.d.ts +409 -404
- package/esm/upload/index.mjs +9 -9
- package/esm/upload/index.mjs.map +1 -1
- package/esm/upload/upload.d.ts +802 -792
- package/esm/vendor/icon.mjs.map +1 -1
- package/esm/vendor/lodash.mjs +12 -20
- package/esm/vendor/lodash.mjs.map +1 -1
- package/esm/vendor/runtime.mjs +29 -24
- package/esm/vendor/runtime.mjs.map +1 -1
- package/esm/vendor/shared.esm-bundler.mjs +2 -2
- package/esm/vendor/sizes.mjs.map +1 -1
- package/esm/vendor/types.mjs +5 -5
- package/esm/vendor/types.mjs.map +1 -1
- package/package.json +8 -11
package/esm/tree/index.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { useField as
|
|
2
|
-
import { defineComponent as
|
|
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__ */
|
|
12
|
+
const W = /* @__PURE__ */ H({
|
|
13
13
|
name: "Tree",
|
|
14
14
|
inheritAttrs: !1,
|
|
15
15
|
__name: "tree",
|
|
16
16
|
props: {
|
|
17
|
-
nodeKey:
|
|
18
|
-
data:
|
|
19
|
-
|
|
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: {
|
|
29
|
-
height:
|
|
30
|
-
maxHeight:
|
|
28
|
+
optionFormatter: {},
|
|
29
|
+
height: {},
|
|
30
|
+
maxHeight: {}
|
|
31
31
|
},
|
|
32
|
-
emits: ["
|
|
33
|
-
setup(K, { emit:
|
|
34
|
-
const e = K,
|
|
35
|
-
async function
|
|
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
|
-
|
|
39
|
-
const { value:
|
|
40
|
-
flatData:
|
|
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) ?
|
|
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.
|
|
51
|
-
t !== void 0 && (
|
|
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:
|
|
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(
|
|
60
|
+
o.value && o.value.setCheckedKeys(d.value);
|
|
61
61
|
}));
|
|
62
62
|
}, { immediate: !0 }), v(() => [e.valueType, e.optionAsValue, e.includeHalfChecked], () => {
|
|
63
|
-
|
|
63
|
+
c();
|
|
64
64
|
}, { immediate: !1 });
|
|
65
|
-
const u =
|
|
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:
|
|
76
|
+
data: n.value,
|
|
77
77
|
props: e.props,
|
|
78
78
|
"node-key": e.nodeKey,
|
|
79
|
-
"default-checked-keys":
|
|
79
|
+
"default-checked-keys": d.value,
|
|
80
80
|
"show-checkbox": !0
|
|
81
|
-
}, a(l), { onCheck:
|
|
82
|
-
|
|
81
|
+
}, a(l), { onCheck: c }), F({ _: 2 }, [
|
|
82
|
+
B(a(b), (m, r) => ({
|
|
83
83
|
name: r,
|
|
84
|
-
fn: T((
|
|
85
|
-
E(t.$slots, r, L(j({ field: a(u), ...
|
|
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
|
-
}),
|
|
95
|
+
}), ie = A(
|
|
96
96
|
W,
|
|
97
|
-
|
|
97
|
+
D({ dataSource: "data", loading: "loading", disabled: !0 }),
|
|
98
98
|
O($.Tree)
|
|
99
99
|
);
|
|
100
100
|
export {
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
ie as Tree,
|
|
102
|
+
ie as default
|
|
103
103
|
};
|
|
104
104
|
//# sourceMappingURL=index.mjs.map
|
package/esm/tree/index.mjs.map
CHANGED
|
@@ -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
|
|
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":"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"}
|
package/esm/tree/tree.d.ts
CHANGED
|
@@ -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
|
-
|
|
5
|
+
"update:modelValue": (value: any) => any;
|
|
6
6
|
}, string, import('vue').PublicProps, Readonly<TreeValueTypeProps> & Readonly<{
|
|
7
|
-
|
|
7
|
+
"onUpdate:modelValue"?: (value: any) => any;
|
|
8
8
|
}>, {
|
|
9
9
|
props: any;
|
|
10
10
|
valueType: "all" | "parent" | "child" | "path";
|
package/esm/tree/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { TreeNodeData } from 'element-plus';
|
|
|
2
2
|
export interface TreeValueTypeProps {
|
|
3
3
|
nodeKey: string;
|
|
4
4
|
data?: TreeNodeData[];
|
|
5
|
-
|
|
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
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { ElTreeSelect as
|
|
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
|
|
6
|
-
import { PreviewText as
|
|
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
|
|
10
|
-
const
|
|
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
|
-
|
|
15
|
-
|
|
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
|
-
}), (
|
|
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(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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, ["
|
|
29
|
+
]), 1040, ["loading"]));
|
|
37
30
|
}
|
|
38
|
-
}),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
}), G = i(
|
|
32
|
+
w,
|
|
33
|
+
p({ readOnly: "readonly", dataSource: "data" }),
|
|
34
|
+
k(x.Select)
|
|
42
35
|
);
|
|
43
36
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
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<
|
|
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 & {
|