@silver-formily/element-plus 2.2.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.
- package/LICENSE +21 -21
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/esm/__builtins__/configs/index.mjs.map +1 -1
- package/esm/__builtins__/index.mjs +18 -21
- package/esm/__builtins__/index.mjs.map +1 -1
- package/esm/__builtins__/shared/index.d.ts +0 -1
- package/esm/__builtins__/shared/index.mjs +18 -21
- package/esm/__builtins__/shared/index.mjs.map +1 -1
- package/esm/__builtins__/shared/loading.mjs +5 -5
- package/esm/__builtins__/shared/loading.mjs.map +1 -1
- package/esm/__builtins__/shared/simple-version-compare.mjs.map +1 -1
- package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
- package/esm/__builtins__/shared/use-enter-submit.d.ts +9 -0
- package/esm/__builtins__/shared/use-enter-submit.mjs +25 -0
- package/esm/__builtins__/shared/use-enter-submit.mjs.map +1 -0
- package/esm/__builtins__/shared/utils.d.ts +1 -0
- package/esm/__builtins__/shared/utils.mjs +23 -17
- package/esm/__builtins__/shared/utils.mjs.map +1 -1
- package/esm/array-base/index.mjs +56 -52
- package/esm/array-base/index.mjs.map +1 -1
- package/esm/array-base/symbols.mjs.map +1 -1
- package/esm/array-base/utils.d.ts +0 -1
- package/esm/array-base/utils.mjs +45 -46
- package/esm/array-base/utils.mjs.map +1 -1
- package/esm/array-cards/index.mjs +36 -33
- package/esm/array-cards/index.mjs.map +1 -1
- package/esm/array-collapse/index.mjs +39 -37
- package/esm/array-collapse/index.mjs.map +1 -1
- package/esm/array-collapse/utils.mjs +9 -2
- package/esm/array-collapse/utils.mjs.map +1 -1
- package/esm/array-items/index.mjs +38 -34
- package/esm/array-items/index.mjs.map +1 -1
- package/esm/array-list-tabs/index.mjs +38 -36
- package/esm/array-list-tabs/index.mjs.map +1 -1
- package/esm/array-list-tabs/utils.mjs +12 -5
- package/esm/array-list-tabs/utils.mjs.map +1 -1
- package/esm/array-table/index.mjs +63 -60
- package/esm/array-table/index.mjs.map +1 -1
- package/esm/array-table/utils.mjs +18 -11
- package/esm/array-table/utils.mjs.map +1 -1
- package/esm/array-tabs/index.mjs +28 -25
- package/esm/array-tabs/index.mjs.map +1 -1
- package/esm/autocomplete/autocomplete.d.ts +1222 -0
- package/esm/autocomplete/index.d.ts +639 -0
- package/esm/autocomplete/index.mjs +116 -0
- package/esm/autocomplete/index.mjs.map +1 -0
- package/esm/cascader/index.mjs +22 -18
- package/esm/cascader/index.mjs.map +1 -1
- package/esm/checkbox/index.d.ts +42 -42
- package/esm/checkbox/index.mjs +20 -16
- package/esm/checkbox/index.mjs.map +1 -1
- package/esm/color-picker/index.d.ts +210 -0
- package/esm/color-picker/index.mjs +17 -0
- package/esm/color-picker/index.mjs.map +1 -0
- package/esm/color-picker-panel/index.d.ts +129 -0
- package/esm/color-picker-panel/index.mjs +25 -0
- package/esm/color-picker-panel/index.mjs.map +1 -0
- package/esm/date-picker/index.mjs +18 -37
- package/esm/date-picker/index.mjs.map +1 -1
- package/esm/date-picker/utils.d.ts +4 -0
- package/esm/date-picker/utils.mjs +27 -0
- package/esm/date-picker/utils.mjs.map +1 -0
- package/esm/date-picker-panel/index.d.ts +143 -0
- package/esm/date-picker-panel/index.mjs +30 -0
- package/esm/date-picker-panel/index.mjs.map +1 -0
- package/esm/editable/editable.d.ts +2 -0
- package/esm/editable/index.d.ts +1 -0
- package/esm/editable/index.mjs +71 -66
- package/esm/editable/index.mjs.map +1 -1
- package/esm/env.d.mjs +2 -0
- package/esm/env.d.mjs.map +1 -0
- package/esm/form/form.mjs +6 -6
- package/esm/form/form.mjs.map +1 -1
- package/esm/form-button-group/form-button-group.d.ts +10 -1
- package/esm/form-button-group/index.d.ts +18 -3
- package/esm/form-button-group/index.mjs +47 -28
- package/esm/form-button-group/index.mjs.map +1 -1
- package/esm/form-button-group/utils.mjs +9 -2
- package/esm/form-button-group/utils.mjs.map +1 -1
- package/esm/form-collapse/index.mjs +21 -18
- package/esm/form-collapse/index.mjs.map +1 -1
- package/esm/form-collapse/utils.mjs.map +1 -1
- package/esm/form-dialog/dialog-content.d.ts +789 -3
- package/esm/form-dialog/index.mjs +97 -86
- package/esm/form-dialog/index.mjs.map +1 -1
- package/esm/form-dialog/types.d.ts +1 -0
- package/esm/form-drawer/drawer-content.d.ts +919 -3
- package/esm/form-drawer/index.mjs +92 -82
- package/esm/form-drawer/index.mjs.map +1 -1
- package/esm/form-drawer/types.d.ts +1 -0
- package/esm/form-grid/hooks.mjs.map +1 -1
- package/esm/form-grid/index.mjs +26 -22
- package/esm/form-grid/index.mjs.map +1 -1
- package/esm/form-item/index.d.ts +1 -0
- package/esm/form-item/index.mjs +102 -99
- package/esm/form-item/index.mjs.map +1 -1
- package/esm/form-item/types.d.ts +4 -0
- package/esm/form-item/utils.mjs.map +1 -1
- package/esm/form-layout/form-layout.mjs +18 -14
- package/esm/form-layout/form-layout.mjs.map +1 -1
- package/esm/form-layout/utils.mjs +23 -23
- package/esm/form-layout/utils.mjs.map +1 -1
- package/esm/form-step/index.mjs +30 -27
- package/esm/form-step/index.mjs.map +1 -1
- package/esm/form-step/utils.mjs.map +1 -1
- package/esm/form-tab/hooks.mjs.map +1 -1
- package/esm/form-tab/index.mjs +24 -22
- package/esm/form-tab/index.mjs.map +1 -1
- package/esm/form-tab/utils.mjs.map +1 -1
- package/esm/index.d.ts +8 -0
- package/esm/index.mjs +90 -74
- package/esm/index.mjs.map +1 -1
- package/esm/input/index.mjs +30 -26
- package/esm/input/index.mjs.map +1 -1
- package/esm/input-number/index.d.ts +21 -21
- package/esm/input-number/index.mjs +11 -8
- package/esm/input-number/index.mjs.map +1 -1
- package/esm/input-tag/index.d.ts +32 -0
- package/esm/input-tag/index.mjs +50 -0
- package/esm/input-tag/index.mjs.map +1 -0
- package/esm/input-tag/input-tag.d.ts +32 -0
- package/esm/mention/index.d.ts +50 -0
- package/esm/mention/index.mjs +97 -0
- package/esm/mention/index.mjs.map +1 -0
- package/esm/mention/mention.d.ts +51 -0
- package/esm/pagination/components/jumper.mjs.map +1 -1
- package/esm/pagination/components/next.mjs.map +1 -1
- package/esm/pagination/components/pager.mjs.map +1 -1
- package/esm/pagination/components/prev.mjs.map +1 -1
- package/esm/pagination/components/total.mjs.map +1 -1
- package/esm/pagination/pagination.mjs.map +1 -1
- package/esm/password/index.mjs.map +1 -1
- package/esm/preview-text/color-picker.d.ts +5 -0
- package/esm/preview-text/index.d.ts +5 -0
- package/esm/preview-text/index.mjs +184 -145
- package/esm/preview-text/index.mjs.map +1 -1
- package/esm/preview-text/utils.mjs.map +1 -1
- package/esm/query-form/default-components.d.ts +5 -0
- package/esm/query-form/default-components.mjs +47 -0
- package/esm/query-form/default-components.mjs.map +1 -0
- package/esm/query-form/hooks.d.ts +25 -0
- package/esm/query-form/hooks.mjs +29 -0
- package/esm/query-form/hooks.mjs.map +1 -0
- package/esm/query-form/index.d.ts +117 -0
- package/esm/query-form/index.mjs +337 -0
- package/esm/query-form/index.mjs.map +1 -0
- package/esm/query-form/query-form-light.d.ts +27 -0
- package/esm/query-form/query-form.d.ts +52 -0
- package/esm/query-form/types.d.ts +44 -0
- package/esm/query-form/types.mjs +2 -0
- package/esm/query-form/types.mjs.map +1 -0
- package/esm/query-form-item/index.d.ts +151 -0
- package/esm/query-form-item/index.mjs +188 -0
- package/esm/query-form-item/index.mjs.map +1 -0
- package/esm/query-form-item/query-form-item.d.ts +96 -0
- package/esm/query-form-item/types.d.ts +46 -0
- package/esm/query-form-item/types.mjs +2 -0
- package/esm/query-form-item/types.mjs.map +1 -0
- package/esm/radio/index.d.ts +36 -36
- package/esm/radio/index.mjs +29 -25
- package/esm/radio/index.mjs.map +1 -1
- package/esm/rate/index.mjs +13 -10
- package/esm/rate/index.mjs.map +1 -1
- package/esm/reset/index.mjs.map +1 -1
- package/esm/segmented/index.mjs +16 -12
- package/esm/segmented/index.mjs.map +1 -1
- package/esm/select/index.mjs +26 -22
- package/esm/select/index.mjs.map +1 -1
- package/esm/select-table/index.mjs +36 -33
- package/esm/select-table/index.mjs.map +1 -1
- package/esm/shared/overlay-elements.d.ts +6 -0
- package/esm/shared/overlay-elements.mjs +19 -0
- package/esm/shared/overlay-elements.mjs.map +1 -0
- package/esm/slider/index.mjs +13 -10
- package/esm/slider/index.mjs.map +1 -1
- package/esm/styles/form-button-group/index.css +1 -1
- package/esm/styles/form-item/index.css +1 -1
- package/esm/styles/preview-text/index.css +1 -1
- package/esm/styles/query-form/index.css +1 -0
- package/esm/styles/query-form-item/index.css +1 -0
- package/esm/submit/index.mjs.map +1 -1
- package/esm/switch/index.d.ts +12 -12
- package/esm/switch/index.mjs.map +1 -1
- package/esm/time-picker/index.mjs +9 -6
- package/esm/time-picker/index.mjs.map +1 -1
- package/esm/time-select/index.mjs +9 -6
- package/esm/time-select/index.mjs.map +1 -1
- package/esm/transfer/index.mjs.map +1 -1
- package/esm/tree/index.mjs +33 -29
- package/esm/tree/index.mjs.map +1 -1
- package/esm/tree/utils.mjs.map +1 -1
- package/esm/tree-select/index.mjs +18 -14
- package/esm/tree-select/index.mjs.map +1 -1
- package/esm/upload/index.d.ts +1 -1
- package/esm/upload/index.mjs +10 -7
- package/esm/upload/index.mjs.map +1 -1
- package/esm/upload/upload.d.ts +2 -2
- package/esm/vendor/lodash.mjs +751 -663
- package/esm/vendor/lodash.mjs.map +1 -1
- package/esm/vendor/sizes.mjs.map +1 -1
- package/package.json +115 -113
- package/esm/__builtins__/shared/hooks.d.ts +0 -7
- package/esm/__builtins__/shared/hooks.mjs +0 -59
- package/esm/__builtins__/shared/hooks.mjs.map +0 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { useField as S, connect as $, mapProps as P } from "@silver-formily/vue";
|
|
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";
|
|
11
|
+
const j = /* @__PURE__ */ R({
|
|
12
|
+
name: "FAutocomplete",
|
|
13
|
+
inheritAttrs: !1,
|
|
14
|
+
__name: "autocomplete",
|
|
15
|
+
props: {
|
|
16
|
+
options: {}
|
|
17
|
+
},
|
|
18
|
+
setup(m) {
|
|
19
|
+
const u = m, o = w(), { props: i } = b(), t = S(), f = C();
|
|
20
|
+
t.value?.inject({
|
|
21
|
+
getElAutocompleteRef: () => f
|
|
22
|
+
});
|
|
23
|
+
const c = d(() => {
|
|
24
|
+
const e = i.value.fetchSuggestions;
|
|
25
|
+
if (e)
|
|
26
|
+
return ((a, s) => e(a, s, t.value));
|
|
27
|
+
/* istanbul ignore next -- @preserve defensive: allow autocomplete to run without options and remote fetch */
|
|
28
|
+
if (u.options)
|
|
29
|
+
return (a, s) => {
|
|
30
|
+
t.value.loading = !0;
|
|
31
|
+
const l = (a ?? "").toLowerCase(), y = i.value.valueKey ?? "value", k = l ? u.options.filter((h) => v(h, y, l)) : u.options;
|
|
32
|
+
s(k), t.value.loading = !1;
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
function v(e, a, s) {
|
|
36
|
+
const l = e?.[a];
|
|
37
|
+
/* istanbul ignore next -- @preserve defensive: tolerate invalid option shape from external data source */
|
|
38
|
+
return l == null ? !1 : String(l).toLowerCase().includes(s);
|
|
39
|
+
}
|
|
40
|
+
const g = d(() => ({
|
|
41
|
+
...i.value,
|
|
42
|
+
loading: i.value.loading ?? t.value?.loading,
|
|
43
|
+
fetchSuggestions: c.value
|
|
44
|
+
}));
|
|
45
|
+
return (e, a) => (x(), F(p(A), z({
|
|
46
|
+
ref_key: "autocompleteRef",
|
|
47
|
+
ref: f
|
|
48
|
+
}, g.value), B({ _: 2 }, [
|
|
49
|
+
o.default ? {
|
|
50
|
+
name: "default",
|
|
51
|
+
fn: n((s) => [
|
|
52
|
+
r(e.$slots, "default", E(K({ ...s, field: p(t) })))
|
|
53
|
+
]),
|
|
54
|
+
key: "0"
|
|
55
|
+
} : void 0,
|
|
56
|
+
o.header ? {
|
|
57
|
+
name: "header",
|
|
58
|
+
fn: n(() => [
|
|
59
|
+
r(e.$slots, "header", { field: p(t) })
|
|
60
|
+
]),
|
|
61
|
+
key: "1"
|
|
62
|
+
} : void 0,
|
|
63
|
+
o.footer ? {
|
|
64
|
+
name: "footer",
|
|
65
|
+
fn: n(() => [
|
|
66
|
+
r(e.$slots, "footer", { field: p(t) })
|
|
67
|
+
]),
|
|
68
|
+
key: "2"
|
|
69
|
+
} : void 0,
|
|
70
|
+
o.prefix ? {
|
|
71
|
+
name: "prefix",
|
|
72
|
+
fn: n(() => [
|
|
73
|
+
r(e.$slots, "prefix")
|
|
74
|
+
]),
|
|
75
|
+
key: "3"
|
|
76
|
+
} : void 0,
|
|
77
|
+
o.suffix ? {
|
|
78
|
+
name: "suffix",
|
|
79
|
+
fn: n(() => [
|
|
80
|
+
r(e.$slots, "suffix")
|
|
81
|
+
]),
|
|
82
|
+
key: "4"
|
|
83
|
+
} : void 0,
|
|
84
|
+
o.prepend ? {
|
|
85
|
+
name: "prepend",
|
|
86
|
+
fn: n(() => [
|
|
87
|
+
r(e.$slots, "prepend")
|
|
88
|
+
]),
|
|
89
|
+
key: "5"
|
|
90
|
+
} : void 0,
|
|
91
|
+
o.append ? {
|
|
92
|
+
name: "append",
|
|
93
|
+
fn: n(() => [
|
|
94
|
+
r(e.$slots, "append")
|
|
95
|
+
]),
|
|
96
|
+
key: "6"
|
|
97
|
+
} : void 0,
|
|
98
|
+
o.loading ? {
|
|
99
|
+
name: "loading",
|
|
100
|
+
fn: n(() => [
|
|
101
|
+
r(e.$slots, "loading")
|
|
102
|
+
]),
|
|
103
|
+
key: "7"
|
|
104
|
+
} : void 0
|
|
105
|
+
]), 1040));
|
|
106
|
+
}
|
|
107
|
+
}), U = $(
|
|
108
|
+
j,
|
|
109
|
+
P({ dataSource: "options", readOnly: "readonly", disabled: !0 }),
|
|
110
|
+
L(O.Input)
|
|
111
|
+
);
|
|
112
|
+
export {
|
|
113
|
+
U as Autocomplete,
|
|
114
|
+
U as default
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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,a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,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;"}
|
package/esm/cascader/index.mjs
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { connect as i, mapProps as c } from "@silver-formily/vue";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { mapReadPretty as
|
|
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 } =
|
|
16
|
-
return (
|
|
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
|
-
|
|
23
|
+
o.$slots.default ? {
|
|
20
24
|
name: "default",
|
|
21
|
-
fn: t(({ node:
|
|
22
|
-
r(
|
|
23
|
-
node:
|
|
24
|
-
data:
|
|
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
|
-
|
|
33
|
+
o.$slots.empty ? {
|
|
30
34
|
name: "empty",
|
|
31
35
|
fn: t(() => [
|
|
32
|
-
r(
|
|
36
|
+
r(o.$slots, "empty")
|
|
33
37
|
]),
|
|
34
38
|
key: "1"
|
|
35
39
|
} : void 0
|
|
36
40
|
]), 1040, ["options"]));
|
|
37
41
|
}
|
|
38
|
-
}),
|
|
42
|
+
}), T = i(
|
|
39
43
|
h,
|
|
40
44
|
c({ dataSource: "options", disabled: !0 }),
|
|
41
|
-
|
|
45
|
+
P(k.Cascader)
|
|
42
46
|
);
|
|
43
47
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
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\">\
|
|
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;"}
|
package/esm/checkbox/index.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
export declare const Checkbox: {
|
|
2
2
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
3
|
-
value: {
|
|
4
|
-
type: import('vue').PropType<string | number | boolean | object>;
|
|
5
|
-
default: undefined;
|
|
6
|
-
};
|
|
7
3
|
size: {
|
|
8
4
|
type: import('vue').PropType<"" | "small" | "default" | "large">;
|
|
9
5
|
};
|
|
@@ -11,10 +7,17 @@ export declare const Checkbox: {
|
|
|
11
7
|
type: import('vue').PropType<string | number | boolean | object>;
|
|
12
8
|
default: undefined;
|
|
13
9
|
};
|
|
10
|
+
border: {
|
|
11
|
+
type: import('vue').PropType<boolean>;
|
|
12
|
+
};
|
|
14
13
|
name: {
|
|
15
14
|
type: import('vue').PropType<string>;
|
|
16
15
|
default: undefined;
|
|
17
16
|
};
|
|
17
|
+
value: {
|
|
18
|
+
type: import('vue').PropType<string | number | boolean | object>;
|
|
19
|
+
default: undefined;
|
|
20
|
+
};
|
|
18
21
|
disabled: {
|
|
19
22
|
type: import('vue').PropType<boolean>;
|
|
20
23
|
default: undefined;
|
|
@@ -37,9 +40,6 @@ export declare const Checkbox: {
|
|
|
37
40
|
type: import('vue').PropType<boolean>;
|
|
38
41
|
default: true;
|
|
39
42
|
};
|
|
40
|
-
border: {
|
|
41
|
-
type: import('vue').PropType<boolean>;
|
|
42
|
-
};
|
|
43
43
|
ariaControls: {
|
|
44
44
|
type: import('vue').PropType<string>;
|
|
45
45
|
};
|
|
@@ -91,10 +91,6 @@ export declare const Checkbox: {
|
|
|
91
91
|
M: {};
|
|
92
92
|
Defaults: {};
|
|
93
93
|
}, Readonly<import('vue').ExtractPropTypes<{
|
|
94
|
-
value: {
|
|
95
|
-
type: import('vue').PropType<string | number | boolean | object>;
|
|
96
|
-
default: undefined;
|
|
97
|
-
};
|
|
98
94
|
size: {
|
|
99
95
|
type: import('vue').PropType<"" | "small" | "default" | "large">;
|
|
100
96
|
};
|
|
@@ -102,10 +98,17 @@ export declare const Checkbox: {
|
|
|
102
98
|
type: import('vue').PropType<string | number | boolean | object>;
|
|
103
99
|
default: undefined;
|
|
104
100
|
};
|
|
101
|
+
border: {
|
|
102
|
+
type: import('vue').PropType<boolean>;
|
|
103
|
+
};
|
|
105
104
|
name: {
|
|
106
105
|
type: import('vue').PropType<string>;
|
|
107
106
|
default: undefined;
|
|
108
107
|
};
|
|
108
|
+
value: {
|
|
109
|
+
type: import('vue').PropType<string | number | boolean | object>;
|
|
110
|
+
default: undefined;
|
|
111
|
+
};
|
|
109
112
|
disabled: {
|
|
110
113
|
type: import('vue').PropType<boolean>;
|
|
111
114
|
default: undefined;
|
|
@@ -128,9 +131,6 @@ export declare const Checkbox: {
|
|
|
128
131
|
type: import('vue').PropType<boolean>;
|
|
129
132
|
default: true;
|
|
130
133
|
};
|
|
131
|
-
border: {
|
|
132
|
-
type: import('vue').PropType<boolean>;
|
|
133
|
-
};
|
|
134
134
|
ariaControls: {
|
|
135
135
|
type: import('vue').PropType<string>;
|
|
136
136
|
};
|
|
@@ -176,10 +176,6 @@ export declare const Checkbox: {
|
|
|
176
176
|
__isTeleport?: never;
|
|
177
177
|
__isSuspense?: never;
|
|
178
178
|
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
179
|
-
value: {
|
|
180
|
-
type: import('vue').PropType<string | number | boolean | object>;
|
|
181
|
-
default: undefined;
|
|
182
|
-
};
|
|
183
179
|
size: {
|
|
184
180
|
type: import('vue').PropType<"" | "small" | "default" | "large">;
|
|
185
181
|
};
|
|
@@ -187,10 +183,17 @@ export declare const Checkbox: {
|
|
|
187
183
|
type: import('vue').PropType<string | number | boolean | object>;
|
|
188
184
|
default: undefined;
|
|
189
185
|
};
|
|
186
|
+
border: {
|
|
187
|
+
type: import('vue').PropType<boolean>;
|
|
188
|
+
};
|
|
190
189
|
name: {
|
|
191
190
|
type: import('vue').PropType<string>;
|
|
192
191
|
default: undefined;
|
|
193
192
|
};
|
|
193
|
+
value: {
|
|
194
|
+
type: import('vue').PropType<string | number | boolean | object>;
|
|
195
|
+
default: undefined;
|
|
196
|
+
};
|
|
194
197
|
disabled: {
|
|
195
198
|
type: import('vue').PropType<boolean>;
|
|
196
199
|
default: undefined;
|
|
@@ -213,9 +216,6 @@ export declare const Checkbox: {
|
|
|
213
216
|
type: import('vue').PropType<boolean>;
|
|
214
217
|
default: true;
|
|
215
218
|
};
|
|
216
|
-
border: {
|
|
217
|
-
type: import('vue').PropType<boolean>;
|
|
218
|
-
};
|
|
219
219
|
ariaControls: {
|
|
220
220
|
type: import('vue').PropType<string>;
|
|
221
221
|
};
|
|
@@ -266,10 +266,6 @@ export declare const Checkbox: {
|
|
|
266
266
|
}) & import('vue').ObjectPlugin & {
|
|
267
267
|
CheckboxButton: {
|
|
268
268
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
269
|
-
value: {
|
|
270
|
-
type: import('vue').PropType<string | number | boolean | object>;
|
|
271
|
-
default: undefined;
|
|
272
|
-
};
|
|
273
269
|
size: {
|
|
274
270
|
type: import('vue').PropType<"" | "small" | "default" | "large">;
|
|
275
271
|
};
|
|
@@ -277,10 +273,17 @@ export declare const Checkbox: {
|
|
|
277
273
|
type: import('vue').PropType<string | number | boolean | object>;
|
|
278
274
|
default: undefined;
|
|
279
275
|
};
|
|
276
|
+
border: {
|
|
277
|
+
type: import('vue').PropType<boolean>;
|
|
278
|
+
};
|
|
280
279
|
name: {
|
|
281
280
|
type: import('vue').PropType<string>;
|
|
282
281
|
default: undefined;
|
|
283
282
|
};
|
|
283
|
+
value: {
|
|
284
|
+
type: import('vue').PropType<string | number | boolean | object>;
|
|
285
|
+
default: undefined;
|
|
286
|
+
};
|
|
284
287
|
disabled: {
|
|
285
288
|
type: import('vue').PropType<boolean>;
|
|
286
289
|
default: undefined;
|
|
@@ -303,9 +306,6 @@ export declare const Checkbox: {
|
|
|
303
306
|
type: import('vue').PropType<boolean>;
|
|
304
307
|
default: true;
|
|
305
308
|
};
|
|
306
|
-
border: {
|
|
307
|
-
type: import('vue').PropType<boolean>;
|
|
308
|
-
};
|
|
309
309
|
ariaControls: {
|
|
310
310
|
type: import('vue').PropType<string>;
|
|
311
311
|
};
|
|
@@ -357,10 +357,6 @@ export declare const Checkbox: {
|
|
|
357
357
|
M: {};
|
|
358
358
|
Defaults: {};
|
|
359
359
|
}, Readonly<import('vue').ExtractPropTypes<{
|
|
360
|
-
value: {
|
|
361
|
-
type: import('vue').PropType<string | number | boolean | object>;
|
|
362
|
-
default: undefined;
|
|
363
|
-
};
|
|
364
360
|
size: {
|
|
365
361
|
type: import('vue').PropType<"" | "small" | "default" | "large">;
|
|
366
362
|
};
|
|
@@ -368,10 +364,17 @@ export declare const Checkbox: {
|
|
|
368
364
|
type: import('vue').PropType<string | number | boolean | object>;
|
|
369
365
|
default: undefined;
|
|
370
366
|
};
|
|
367
|
+
border: {
|
|
368
|
+
type: import('vue').PropType<boolean>;
|
|
369
|
+
};
|
|
371
370
|
name: {
|
|
372
371
|
type: import('vue').PropType<string>;
|
|
373
372
|
default: undefined;
|
|
374
373
|
};
|
|
374
|
+
value: {
|
|
375
|
+
type: import('vue').PropType<string | number | boolean | object>;
|
|
376
|
+
default: undefined;
|
|
377
|
+
};
|
|
375
378
|
disabled: {
|
|
376
379
|
type: import('vue').PropType<boolean>;
|
|
377
380
|
default: undefined;
|
|
@@ -394,9 +397,6 @@ export declare const Checkbox: {
|
|
|
394
397
|
type: import('vue').PropType<boolean>;
|
|
395
398
|
default: true;
|
|
396
399
|
};
|
|
397
|
-
border: {
|
|
398
|
-
type: import('vue').PropType<boolean>;
|
|
399
|
-
};
|
|
400
400
|
ariaControls: {
|
|
401
401
|
type: import('vue').PropType<string>;
|
|
402
402
|
};
|
|
@@ -442,10 +442,6 @@ export declare const Checkbox: {
|
|
|
442
442
|
__isTeleport?: never;
|
|
443
443
|
__isSuspense?: never;
|
|
444
444
|
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
445
|
-
value: {
|
|
446
|
-
type: import('vue').PropType<string | number | boolean | object>;
|
|
447
|
-
default: undefined;
|
|
448
|
-
};
|
|
449
445
|
size: {
|
|
450
446
|
type: import('vue').PropType<"" | "small" | "default" | "large">;
|
|
451
447
|
};
|
|
@@ -453,10 +449,17 @@ export declare const Checkbox: {
|
|
|
453
449
|
type: import('vue').PropType<string | number | boolean | object>;
|
|
454
450
|
default: undefined;
|
|
455
451
|
};
|
|
452
|
+
border: {
|
|
453
|
+
type: import('vue').PropType<boolean>;
|
|
454
|
+
};
|
|
456
455
|
name: {
|
|
457
456
|
type: import('vue').PropType<string>;
|
|
458
457
|
default: undefined;
|
|
459
458
|
};
|
|
459
|
+
value: {
|
|
460
|
+
type: import('vue').PropType<string | number | boolean | object>;
|
|
461
|
+
default: undefined;
|
|
462
|
+
};
|
|
460
463
|
disabled: {
|
|
461
464
|
type: import('vue').PropType<boolean>;
|
|
462
465
|
default: undefined;
|
|
@@ -479,9 +482,6 @@ export declare const Checkbox: {
|
|
|
479
482
|
type: import('vue').PropType<boolean>;
|
|
480
483
|
default: true;
|
|
481
484
|
};
|
|
482
|
-
border: {
|
|
483
|
-
type: import('vue').PropType<boolean>;
|
|
484
|
-
};
|
|
485
485
|
ariaControls: {
|
|
486
486
|
type: import('vue').PropType<string>;
|
|
487
487
|
};
|
package/esm/checkbox/index.mjs
CHANGED
|
@@ -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
|
|
4
|
-
import
|
|
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
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const j = /* @__PURE__ */
|
|
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
|
|
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 =
|
|
36
|
-
return (e, V) => (o(), a(
|
|
39
|
+
})), v = A(), { props: P } = L();
|
|
40
|
+
return (e, V) => (o(), a(n(g), B(G(n(P))), {
|
|
37
41
|
default: l(() => [
|
|
38
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
),
|
|
68
|
+
), te = N(H, {
|
|
65
69
|
Group: z
|
|
66
70
|
});
|
|
67
71
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
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\">\
|
|
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","C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