@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/radio/index.mjs
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import { connect as
|
|
2
|
-
import { ElRadioButton as
|
|
3
|
-
import { defineComponent as
|
|
1
|
+
import { connect as E, mapProps as T } from "@silver-formily/vue";
|
|
2
|
+
import { ElRadioButton as B, ElRadio as v, ElRadioGroup as C, version as G } from "element-plus";
|
|
3
|
+
import { defineComponent as O, computed as c, useSlots as x, createBlock as p, openBlock as t, unref as u, normalizeProps as A, guardReactiveProps as L, withCtx as i, createElementBlock as f, Fragment as d, renderList as _, resolveDynamicComponent as y, mergeProps as b, createTextVNode as h, toDisplayString as j, renderSlot as w } from "vue";
|
|
4
4
|
import "@formily/reactive";
|
|
5
|
-
import { mapReadPretty as
|
|
6
|
-
import { composeExport as
|
|
7
|
-
import { PreviewText as
|
|
8
|
-
import { isPlainObj as
|
|
9
|
-
import { lt as
|
|
5
|
+
import { mapReadPretty as D } from "../__builtins__/shared/transform-component.mjs";
|
|
6
|
+
import { useCleanAttrs as F, composeExport as N } from "../__builtins__/shared/utils.mjs";
|
|
7
|
+
import { PreviewText as z } from "../preview-text/index.mjs";
|
|
8
|
+
import { isPlainObj as H } from "@formily/shared";
|
|
9
|
+
import { lt as I } from "../__builtins__/shared/simple-version-compare.mjs";
|
|
10
10
|
import "@formily/core";
|
|
11
|
-
import "@formily/reactive-vue";
|
|
12
|
-
import '../styles/radio/index.css';const
|
|
11
|
+
import "@silver-formily/reactive-vue";
|
|
12
|
+
import '../styles/radio/index.css';const V = /* @__PURE__ */ O({
|
|
13
13
|
name: "FRadioGroup",
|
|
14
14
|
__name: "radio-group",
|
|
15
15
|
props: {
|
|
16
|
-
value: {
|
|
17
|
-
default: void 0
|
|
18
|
-
},
|
|
19
16
|
options: {
|
|
20
17
|
type: Array,
|
|
21
18
|
default: () => []
|
|
@@ -25,56 +22,52 @@ import '../styles/radio/index.css';const H = /* @__PURE__ */ C({
|
|
|
25
22
|
default: "default"
|
|
26
23
|
}
|
|
27
24
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return N(e);
|
|
25
|
+
setup(P) {
|
|
26
|
+
const o = P, { props: R } = F(), s = c(() => o.optionType === "button" ? B : v), S = I(G, "2.6.0");
|
|
27
|
+
function l(e) {
|
|
28
|
+
return H(e);
|
|
33
29
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
30
|
+
function g(e, n) {
|
|
31
|
+
return l(o.options[n]) ? o.options[n].label : e.label;
|
|
36
32
|
}
|
|
37
|
-
const m =
|
|
38
|
-
if (!
|
|
33
|
+
const m = c(() => o.options.map((e) => {
|
|
34
|
+
if (!l(e))
|
|
39
35
|
return {
|
|
40
36
|
label: e,
|
|
41
37
|
value: e
|
|
42
38
|
};
|
|
43
39
|
/* istanbul ignore if -- @preserve */
|
|
44
|
-
return
|
|
40
|
+
return S ? {
|
|
45
41
|
...e,
|
|
46
42
|
label: e.value
|
|
47
43
|
} : e;
|
|
48
|
-
})),
|
|
49
|
-
return (e,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
d(E).option ? (a(!0), f(c, { key: 1 }, v(m.value, (t, n) => (a(), u(y(p.value), _({ key: n }, { ref_for: !0 }, t), {
|
|
55
|
-
default: l(() => [
|
|
56
|
-
w(e.$slots, "option", { option: t })
|
|
44
|
+
})), k = x();
|
|
45
|
+
return (e, n) => (t(), p(u(C), A(L(u(R))), {
|
|
46
|
+
default: i(() => [
|
|
47
|
+
u(k).option ? (t(!0), f(d, { key: 1 }, _(m.value, (r, a) => (t(), p(y(s.value), b({ key: a }, { ref_for: !0 }, r), {
|
|
48
|
+
default: i(() => [
|
|
49
|
+
w(e.$slots, "option", { option: r })
|
|
57
50
|
]),
|
|
58
51
|
_: 2
|
|
59
|
-
}, 1040))), 128)) : (
|
|
60
|
-
default:
|
|
61
|
-
h(j(
|
|
52
|
+
}, 1040))), 128)) : (t(!0), f(d, { key: 0 }, _(m.value, (r, a) => (t(), p(y(s.value), b({ key: a }, { ref_for: !0 }, r), {
|
|
53
|
+
default: i(() => [
|
|
54
|
+
h(j(g(r, a)), 1)
|
|
62
55
|
]),
|
|
63
56
|
_: 2
|
|
64
57
|
}, 1040))), 128))
|
|
65
58
|
]),
|
|
66
59
|
_: 3
|
|
67
|
-
},
|
|
60
|
+
}, 16));
|
|
68
61
|
}
|
|
69
|
-
}),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
),
|
|
74
|
-
Group:
|
|
62
|
+
}), $ = E(
|
|
63
|
+
V,
|
|
64
|
+
T({ dataSource: "options", disabled: !0 }),
|
|
65
|
+
D(z.Select)
|
|
66
|
+
), re = N(v, {
|
|
67
|
+
Group: $
|
|
75
68
|
});
|
|
76
69
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
70
|
+
re as Radio,
|
|
71
|
+
re as default
|
|
79
72
|
};
|
|
80
73
|
//# sourceMappingURL=index.mjs.map
|
package/esm/radio/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/radio/radio-group.vue","../../src/radio/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { RadioProps } from 'element-plus'\nimport type { PropType } from 'vue'\nimport { isPlainObj } from '@formily/shared'\nimport { ElRadio, ElRadioButton, ElRadioGroup, version } from 'element-plus'\nimport { computed, useSlots } from 'vue'\nimport { lt } from '../__builtins__'\n\ndefineOptions({\n name: 'FRadioGroup',\n})\n\nconst props = defineProps({\n
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/radio/radio-group.vue","../../src/radio/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { RadioProps } from 'element-plus'\nimport type { PropType } from 'vue'\nimport { isPlainObj } from '@formily/shared'\nimport { ElRadio, ElRadioButton, ElRadioGroup, version } from 'element-plus'\nimport { computed, useSlots } from 'vue'\nimport { lt, useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FRadioGroup',\n})\n\nconst props = defineProps({\n options: {\n type: Array as PropType<Array<RadioProps | string | number>>,\n default: () => [],\n },\n optionType: {\n type: String as PropType<'default' | 'button'>,\n default: 'default',\n },\n})\n\nconst { props: radioProps } = useCleanAttrs()\n\nconst OptionType = computed(() => {\n return props.optionType === 'button' ? ElRadioButton : ElRadio\n})\nconst IS_LESS_THAN_2_6_0 = lt(version, '2.6.0')\n\nfunction isRadioPropsObject(option: any): option is RadioProps {\n return isPlainObj(option)\n}\n\nfunction getOptionLabel(option: any, index: number) {\n if (isRadioPropsObject(props.options[index])) {\n return props.options[index].label\n }\n return option.label\n}\n\nconst compatiableProps = computed(() => {\n return props.options.map((option) => {\n if (!isRadioPropsObject(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()\n</script>\n\n<template>\n <ElRadioGroup v-bind=\"radioProps\">\n <template v-if=\"!slots.option\">\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\n {{ getOptionLabel(option, index) }}\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 </ElRadioGroup>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\nimport { ElRadio } from 'element-plus'\nimport { composeExport, mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FRadioGroup from './radio-group.vue'\nimport './style.scss'\n\nconst RadioGroup = connect<typeof FRadioGroup>(\n FRadioGroup,\n mapProps({ dataSource: 'options', disabled: true }),\n mapReadPretty(PreviewText.Select),\n)\nexport const Radio = composeExport(ElRadio, {\n Group: RadioGroup,\n})\n\nexport default Radio\n"],"names":["props","__props","radioProps","useCleanAttrs","OptionType","computed","ElRadioButton","ElRadio","IS_LESS_THAN_2_6_0","lt","version","isRadioPropsObject","option","isPlainObj","getOptionLabel","index","compatiableProps","slots","useSlots","_openBlock","_createBlock","_unref","_createElementBlock","_Fragment","_renderList","_resolveDynamicComponent","_mergeProps","_renderSlot","_ctx","RadioGroup","connect","FRadioGroup","mapProps","mapReadPretty","PreviewText","Radio","composeExport"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAYA,UAAMA,IAAQC,GAWR,EAAE,OAAOC,EAAA,IAAeC,EAAA,GAExBC,IAAaC,EAAS,MACnBL,EAAM,eAAe,WAAWM,IAAgBC,CACxD,GACKC,IAAqBC,EAAGC,GAAS,OAAO;AAE9C,aAASC,EAAmBC,GAAmC;AAC7D,aAAOC,EAAWD,CAAM;AAAA,IAC1B;AAEA,aAASE,EAAeF,GAAaG,GAAe;AAClD,aAAIJ,EAAmBX,EAAM,QAAQe,CAAK,CAAC,IAClCf,EAAM,QAAQe,CAAK,EAAE,QAEvBH,EAAO;AAAA,IAChB;AAEA,UAAMI,IAAmBX,EAAS,MACzBL,EAAM,QAAQ,IAAI,CAACY,MAAW;AACnC,UAAI,CAACD,EAAmBC,CAAM;AAC5B,eAAO;AAAA,UACL,OAAOA;AAAA,UACP,OAAOA;AAAA,QAAA;AAAA,MAEX;AAEA,aAAIJ,IACK;AAAA,QACL,GAAGI;AAAA,QACH,OAAOA,EAAO;AAAA,MAAA,IAGXA;AAAA,IACT,CAAC,CACF,GAEKK,IAAQC,EAAA;sBAIZC,EAAA,GAAAC,EAWeC,UAXOA,EAAAnB,CAAA,CAAU,CAAA,GAAA;AAAA,iBAC9B,MAIW;AAAA,QAJMmB,EAAAJ,CAAA,EAAM,UAMrBE,EAAA,EAAA,GAAAG,EAEYC,GAAA,EAAA,KAAA,KAAAC,EAF0CR,EAAA,OAAgB,CAAlCJ,GAAQG,YAA5CK,EAEYK,EAFIrB,OAAU,GAA1BsB,EAEY,EAF6D,KAAKX,KAAK,EAAA,SAAA,GAAA,GAAUH,CAAM,GAAA;AAAA,qBACjG,MAAuC;AAAA,YAAvCe,EAAuCC,EAAA,QAAA,UAAA,EAAlB,QAAAhB,GAAc;AAAA,UAAA;;6BANrCO,EAAA,EAAA,GAAAG,EAEYC,GAAA,EAAA,KAAA,KAAAC,EAF0CR,EAAA,OAAgB,CAAlCJ,GAAQG,YAA5CK,EAEYK,EAFIrB,OAAU,GAA1BsB,EAEY,EAF6D,KAAKX,KAAK,EAAA,SAAA,GAAA,GAAUH,CAAM,GAAA;AAAA,qBACjG,MAAmC;AAAA,gBAAhCE,EAAeF,GAAQG,CAAK,CAAA,GAAA,CAAA;AAAA,UAAA;;;;;;;IC5DjCc,IAAaC;AAAA,EACjBC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,UAAU,IAAM;AAAA,EAClDC,EAAcC,EAAY,MAAM;AAClC,GACaC,KAAQC,EAAc7B,GAAS;AAAA,EAC1C,OAAOsB;AACT,CAAC;"}
|
|
@@ -3,9 +3,6 @@ import { PropType } from 'vue';
|
|
|
3
3
|
declare function __VLS_template(): any;
|
|
4
4
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
5
5
|
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
6
|
-
value: {
|
|
7
|
-
default: any;
|
|
8
|
-
};
|
|
9
6
|
options: {
|
|
10
7
|
type: PropType<Array<RadioProps | string | number>>;
|
|
11
8
|
default: () => any[];
|
|
@@ -14,12 +11,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
14
11
|
type: PropType<"default" | "button">;
|
|
15
12
|
default: string;
|
|
16
13
|
};
|
|
17
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
18
|
-
change: (...args: any[]) => void;
|
|
19
|
-
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
-
value: {
|
|
21
|
-
default: any;
|
|
22
|
-
};
|
|
14
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
23
15
|
options: {
|
|
24
16
|
type: PropType<Array<RadioProps | string | number>>;
|
|
25
17
|
default: () => any[];
|
|
@@ -28,10 +20,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
28
20
|
type: PropType<"default" | "button">;
|
|
29
21
|
default: string;
|
|
30
22
|
};
|
|
31
|
-
}>> & Readonly<{
|
|
32
|
-
onChange?: (...args: any[]) => any;
|
|
33
|
-
}>, {
|
|
34
|
-
value: any;
|
|
23
|
+
}>> & Readonly<{}>, {
|
|
35
24
|
options: (string | number | RadioProps)[];
|
|
36
25
|
optionType: "button" | "default";
|
|
37
26
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
package/esm/reset/index.d.ts
CHANGED
|
@@ -1,63 +1,2 @@
|
|
|
1
|
-
export declare const Reset:
|
|
2
|
-
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
3
|
-
onClick: import('vue').PropType<(e: MouseEvent) => void | boolean>;
|
|
4
|
-
forceClear: {
|
|
5
|
-
type: BooleanConstructor;
|
|
6
|
-
default: boolean;
|
|
7
|
-
};
|
|
8
|
-
validate: {
|
|
9
|
-
type: BooleanConstructor;
|
|
10
|
-
default: boolean;
|
|
11
|
-
};
|
|
12
|
-
onResetValidateSuccess: import('vue').PropType<(payload: any) => void>;
|
|
13
|
-
onResetValidateFailed: import('vue').PropType<(error: any) => void>;
|
|
14
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
15
|
-
validate: boolean;
|
|
16
|
-
forceClear: boolean;
|
|
17
|
-
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
18
|
-
P: {};
|
|
19
|
-
B: {};
|
|
20
|
-
D: {};
|
|
21
|
-
C: {};
|
|
22
|
-
M: {};
|
|
23
|
-
Defaults: {};
|
|
24
|
-
}, Readonly<import('vue').ExtractPropTypes<{
|
|
25
|
-
onClick: import('vue').PropType<(e: MouseEvent) => void | boolean>;
|
|
26
|
-
forceClear: {
|
|
27
|
-
type: BooleanConstructor;
|
|
28
|
-
default: boolean;
|
|
29
|
-
};
|
|
30
|
-
validate: {
|
|
31
|
-
type: BooleanConstructor;
|
|
32
|
-
default: boolean;
|
|
33
|
-
};
|
|
34
|
-
onResetValidateSuccess: import('vue').PropType<(payload: any) => void>;
|
|
35
|
-
onResetValidateFailed: import('vue').PropType<(error: any) => void>;
|
|
36
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, {
|
|
37
|
-
validate: boolean;
|
|
38
|
-
forceClear: boolean;
|
|
39
|
-
}>;
|
|
40
|
-
__isFragment?: never;
|
|
41
|
-
__isTeleport?: never;
|
|
42
|
-
__isSuspense?: never;
|
|
43
|
-
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
44
|
-
onClick: import('vue').PropType<(e: MouseEvent) => void | boolean>;
|
|
45
|
-
forceClear: {
|
|
46
|
-
type: BooleanConstructor;
|
|
47
|
-
default: boolean;
|
|
48
|
-
};
|
|
49
|
-
validate: {
|
|
50
|
-
type: BooleanConstructor;
|
|
51
|
-
default: boolean;
|
|
52
|
-
};
|
|
53
|
-
onResetValidateSuccess: import('vue').PropType<(payload: any) => void>;
|
|
54
|
-
onResetValidateFailed: import('vue').PropType<(error: any) => void>;
|
|
55
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
56
|
-
validate: boolean;
|
|
57
|
-
forceClear: boolean;
|
|
58
|
-
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
59
|
-
$slots: {
|
|
60
|
-
default?(_: {}): any;
|
|
61
|
-
};
|
|
62
|
-
});
|
|
1
|
+
export declare const Reset: any;
|
|
63
2
|
export default Reset;
|
package/esm/reset/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { observer as s } from "@formily/reactive-vue";
|
|
1
|
+
import { observer as s } from "@silver-formily/reactive-vue";
|
|
2
2
|
import { defineComponent as c, createBlock as i, openBlock as f, unref as u, mergeProps as d, withCtx as m, renderSlot as p } from "vue";
|
|
3
|
-
import { useParentForm as C } from "@formily/vue";
|
|
3
|
+
import { useParentForm as C } from "@silver-formily/vue";
|
|
4
4
|
import { ElButton as k } from "element-plus";
|
|
5
5
|
const F = /* @__PURE__ */ c({
|
|
6
6
|
name: "FReset",
|
package/esm/reset/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/reset/reset.vue","../../src/reset/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { PropType } from 'vue'\nimport { useParentForm } from '@formily/vue'\nimport { ElButton } from 'element-plus'\n\ndefineOptions({\n name: 'FReset',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n onClick: Function as PropType<(e: MouseEvent) => void | boolean>,\n forceClear: {\n type: Boolean,\n default: false,\n },\n validate: {\n type: Boolean,\n default: false,\n },\n onResetValidateSuccess: Function as PropType<(payload: any) => void>,\n onResetValidateFailed: Function as PropType<(error: any) => void>,\n})\n\nconst formRef = useParentForm()\n\nfunction handleClick(e: MouseEvent) {\n if (props.onClick && (props.onClick)?.(e) === false)\n return\n\n const form = formRef?.value\n form?.reset('*', {\n forceClear: props.forceClear,\n })\n props.validate && form?.validate()\n .then(props.onResetValidateSuccess)\n .catch(error => props.onResetValidateFailed?.(error))\n}\n</script>\n\n<template>\n <ElButton v-bind=\"$attrs\" @click=\"handleClick\">\n <slot />\n </ElButton>\n</template>\n","import { observer } from '@formily/reactive-vue'\nimport FReset from './reset.vue'\n\nexport const Reset = observer(FReset)\n\nexport default Reset\n"],"names":["props","__props","formRef","useParentForm","handleClick","e","form","error","_openBlock","_createBlock","_unref","_mergeProps","_ctx","_renderSlot","Reset","observer","FReset"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,GAcRC,IAAUC,EAAA;AAEhB,aAASC,EAAYC,GAAe;AAClC,UAAIL,EAAM,WAAYA,EAAM,UAAWK,CAAC,MAAM;AAC5C;AAEF,YAAMC,IAAOJ,GAAS;AACtB,MAAAI,GAAM,MAAM,KAAK;AAAA,QACf,YAAYN,EAAM;AAAA,MAAA,CACnB,GACDA,EAAM,YAAYM,GAAM,SAAA,EACrB,KAAKN,EAAM,sBAAsB,EACjC,MAAM,CAAAO,MAASP,EAAM,wBAAwBO,CAAK,CAAC;AAAA,IACxD;sBAIEC,EAAA,GAAAC,EAEWC,MAFXC,EAEWC,UAFa,EAAG,SAAOR,EAAA,CAAW,GAAA;AAAA,iBAC3C,MAAQ;AAAA,QAARS,EAAQD,EAAA,QAAA,SAAA;AAAA,MAAA;;;;ICvCCE,IAAQC,EAASC,CAAM;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/reset/reset.vue","../../src/reset/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { PropType } from 'vue'\nimport { useParentForm } from '@silver-formily/vue'\nimport { ElButton } from 'element-plus'\n\ndefineOptions({\n name: 'FReset',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n onClick: Function as PropType<(e: MouseEvent) => void | boolean>,\n forceClear: {\n type: Boolean,\n default: false,\n },\n validate: {\n type: Boolean,\n default: false,\n },\n onResetValidateSuccess: Function as PropType<(payload: any) => void>,\n onResetValidateFailed: Function as PropType<(error: any) => void>,\n})\n\nconst formRef = useParentForm()\n\nfunction handleClick(e: MouseEvent) {\n if (props.onClick && (props.onClick)?.(e) === false)\n return\n\n const form = formRef?.value\n form?.reset('*', {\n forceClear: props.forceClear,\n })\n props.validate && form?.validate()\n .then(props.onResetValidateSuccess)\n .catch(error => props.onResetValidateFailed?.(error))\n}\n</script>\n\n<template>\n <ElButton v-bind=\"$attrs\" @click=\"handleClick\">\n <slot />\n </ElButton>\n</template>\n","import { observer } from '@silver-formily/reactive-vue'\nimport FReset from './reset.vue'\n\nexport const Reset = observer(FReset)\n\nexport default Reset\n"],"names":["props","__props","formRef","useParentForm","handleClick","e","form","error","_openBlock","_createBlock","_unref","_mergeProps","_ctx","_renderSlot","Reset","observer","FReset"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,GAcRC,IAAUC,EAAA;AAEhB,aAASC,EAAYC,GAAe;AAClC,UAAIL,EAAM,WAAYA,EAAM,UAAWK,CAAC,MAAM;AAC5C;AAEF,YAAMC,IAAOJ,GAAS;AACtB,MAAAI,GAAM,MAAM,KAAK;AAAA,QACf,YAAYN,EAAM;AAAA,MAAA,CACnB,GACDA,EAAM,YAAYM,GAAM,SAAA,EACrB,KAAKN,EAAM,sBAAsB,EACjC,MAAM,CAAAO,MAASP,EAAM,wBAAwBO,CAAK,CAAC;AAAA,IACxD;sBAIEC,EAAA,GAAAC,EAEWC,MAFXC,EAEWC,UAFa,EAAG,SAAOR,EAAA,CAAW,GAAA;AAAA,iBAC3C,MAAQ;AAAA,QAARS,EAAQD,EAAA,QAAA,SAAA;AAAA,MAAA;;;;ICvCCE,IAAQC,EAASC,CAAM;"}
|
package/esm/select/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare const Select: {
|
|
2
2
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
3
|
-
value?: any;
|
|
4
3
|
options?: Array<(Partial<{
|
|
5
4
|
disabled: boolean;
|
|
6
5
|
created: boolean;
|
|
@@ -25,11 +24,7 @@ export declare const Select: {
|
|
|
25
24
|
readonly label?: import('element-plus/es/utils/index.mjs').EpPropMergeType<(StringConstructor | NumberConstructor)[], unknown, unknown>;
|
|
26
25
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "disabled" | "created">)[];
|
|
27
26
|
})>;
|
|
28
|
-
}> & Readonly<{
|
|
29
|
-
onChange?: (value: any) => any;
|
|
30
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
31
|
-
change: (value: any) => any;
|
|
32
|
-
}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
27
|
+
}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
33
28
|
P: {};
|
|
34
29
|
B: {};
|
|
35
30
|
D: {};
|
|
@@ -37,7 +32,6 @@ export declare const Select: {
|
|
|
37
32
|
M: {};
|
|
38
33
|
Defaults: {};
|
|
39
34
|
}, Readonly<{
|
|
40
|
-
value?: any;
|
|
41
35
|
options?: Array<(Partial<{
|
|
42
36
|
disabled: boolean;
|
|
43
37
|
created: boolean;
|
|
@@ -62,14 +56,11 @@ export declare const Select: {
|
|
|
62
56
|
readonly label?: import('element-plus/es/utils/index.mjs').EpPropMergeType<(StringConstructor | NumberConstructor)[], unknown, unknown>;
|
|
63
57
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "disabled" | "created">)[];
|
|
64
58
|
})>;
|
|
65
|
-
}> & Readonly<{
|
|
66
|
-
onChange?: (value: any) => any;
|
|
67
|
-
}>, {}, {}, {}, {}, {}>;
|
|
59
|
+
}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
68
60
|
__isFragment?: never;
|
|
69
61
|
__isTeleport?: never;
|
|
70
62
|
__isSuspense?: never;
|
|
71
63
|
} & import('vue').ComponentOptionsBase<Readonly<{
|
|
72
|
-
value?: any;
|
|
73
64
|
options?: Array<(Partial<{
|
|
74
65
|
disabled: boolean;
|
|
75
66
|
created: boolean;
|
|
@@ -94,11 +85,7 @@ export declare const Select: {
|
|
|
94
85
|
readonly label?: import('element-plus/es/utils/index.mjs').EpPropMergeType<(StringConstructor | NumberConstructor)[], unknown, unknown>;
|
|
95
86
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "disabled" | "created">)[];
|
|
96
87
|
})>;
|
|
97
|
-
}> & Readonly<{
|
|
98
|
-
onChange?: (value: any) => any;
|
|
99
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
100
|
-
change: (value: any) => any;
|
|
101
|
-
}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
88
|
+
}> & 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 () => {
|
|
102
89
|
$slots: Readonly<{
|
|
103
90
|
option?: (props: {
|
|
104
91
|
option: Partial<{
|
package/esm/select/index.mjs
CHANGED
|
@@ -1,64 +1,59 @@
|
|
|
1
|
-
import { useField as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { ElSelect as
|
|
1
|
+
import { useField as S, connect as b, mapProps as P } from "@silver-formily/vue";
|
|
2
|
+
import { defineComponent as h, useSlots as C, createBlock as f, openBlock as s, unref as e, normalizeProps as E, guardReactiveProps as K, createSlots as _, withCtx as t, createElementBlock as m, Fragment as u, renderList as y, mergeProps as d, renderSlot as n, createCommentVNode as c } from "vue";
|
|
3
|
+
import { ElSelect as B, ElOptionGroup as F, ElOption as k } from "element-plus";
|
|
4
4
|
import "@formily/reactive";
|
|
5
|
-
import { mapReadPretty as
|
|
6
|
-
import { PreviewText as
|
|
5
|
+
import { mapReadPretty as R } from "../__builtins__/shared/transform-component.mjs";
|
|
6
|
+
import { PreviewText as w } from "../preview-text/index.mjs";
|
|
7
7
|
import "@formily/core";
|
|
8
|
-
import "@formily/reactive-vue";
|
|
9
|
-
import { useCleanAttrs as
|
|
10
|
-
import { o as
|
|
11
|
-
const
|
|
8
|
+
import "@silver-formily/reactive-vue";
|
|
9
|
+
import { useCleanAttrs as A } from "../__builtins__/shared/utils.mjs";
|
|
10
|
+
import { o as G } from "../vendor/lodash.mjs";
|
|
11
|
+
const O = /* @__PURE__ */ h({
|
|
12
12
|
name: "FSelect",
|
|
13
13
|
inheritAttrs: !1,
|
|
14
14
|
__name: "select",
|
|
15
15
|
props: {
|
|
16
|
-
|
|
17
|
-
options: null
|
|
16
|
+
options: {}
|
|
18
17
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return t.options !== void 0;
|
|
18
|
+
setup(v) {
|
|
19
|
+
const g = v, l = C(), { props: i } = A(), p = S();
|
|
20
|
+
function $(o) {
|
|
21
|
+
return o.options !== void 0;
|
|
24
22
|
}
|
|
25
|
-
return (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
default: l(() => [
|
|
30
|
-
(a(!0), p(d, null, c(y.options, (o) => (a(), p(d, null, [
|
|
31
|
-
h(o) ? (a(), m(e(A), u({
|
|
23
|
+
return (o, z) => (s(), f(e(B), E(K(e(i))), _({
|
|
24
|
+
default: t(() => [
|
|
25
|
+
(s(!0), m(u, null, y(g.options, (r) => (s(), m(u, null, [
|
|
26
|
+
$(r) ? (s(), f(e(F), d({
|
|
32
27
|
key: 0,
|
|
33
28
|
ref_for: !0
|
|
34
|
-
}, e(
|
|
35
|
-
key:
|
|
29
|
+
}, e(G)(r, "options"), {
|
|
30
|
+
key: r.label
|
|
36
31
|
}), {
|
|
37
|
-
default:
|
|
38
|
-
(
|
|
39
|
-
key: e(i).valueKey ?
|
|
40
|
-
}, { ref_for: !0 },
|
|
41
|
-
default:
|
|
42
|
-
|
|
32
|
+
default: t(() => [
|
|
33
|
+
(s(!0), m(u, null, y(r.options, (a) => (s(), f(e(k), d({
|
|
34
|
+
key: e(i).valueKey ? a[e(i).valueKey] : a.label
|
|
35
|
+
}, { ref_for: !0 }, a), {
|
|
36
|
+
default: t(() => [
|
|
37
|
+
l.option ? n(o.$slots, "option", {
|
|
43
38
|
key: 0,
|
|
44
|
-
option:
|
|
45
|
-
}) :
|
|
39
|
+
option: a
|
|
40
|
+
}) : c("", !0)
|
|
46
41
|
]),
|
|
47
42
|
_: 2
|
|
48
43
|
}, 1040))), 128))
|
|
49
44
|
]),
|
|
50
45
|
_: 2
|
|
51
|
-
}, 1040)) : (
|
|
46
|
+
}, 1040)) : (s(), f(e(k), d({
|
|
52
47
|
key: 1,
|
|
53
48
|
ref_for: !0
|
|
54
|
-
},
|
|
55
|
-
key: e(i).valueKey ?
|
|
49
|
+
}, r, {
|
|
50
|
+
key: e(i).valueKey ? r[e(i).valueKey] : r.label
|
|
56
51
|
}), {
|
|
57
|
-
default:
|
|
58
|
-
|
|
52
|
+
default: t(() => [
|
|
53
|
+
l.option ? n(o.$slots, "option", {
|
|
59
54
|
key: 0,
|
|
60
|
-
option:
|
|
61
|
-
}) :
|
|
55
|
+
option: r
|
|
56
|
+
}) : c("", !0)
|
|
62
57
|
]),
|
|
63
58
|
_: 2
|
|
64
59
|
}, 1040))
|
|
@@ -66,67 +61,67 @@ const _ = /* @__PURE__ */ K({
|
|
|
66
61
|
]),
|
|
67
62
|
_: 2
|
|
68
63
|
}, [
|
|
69
|
-
|
|
64
|
+
l.header ? {
|
|
70
65
|
name: "header",
|
|
71
|
-
fn:
|
|
72
|
-
n(
|
|
66
|
+
fn: t(() => [
|
|
67
|
+
n(o.$slots, "header", { field: e(p) })
|
|
73
68
|
]),
|
|
74
69
|
key: "0"
|
|
75
70
|
} : void 0,
|
|
76
|
-
|
|
71
|
+
l.footer ? {
|
|
77
72
|
name: "footer",
|
|
78
|
-
fn:
|
|
79
|
-
n(
|
|
73
|
+
fn: t(() => [
|
|
74
|
+
n(o.$slots, "footer", { field: e(p) })
|
|
80
75
|
]),
|
|
81
76
|
key: "1"
|
|
82
77
|
} : void 0,
|
|
83
|
-
|
|
78
|
+
l.prefix ? {
|
|
84
79
|
name: "prefix",
|
|
85
|
-
fn:
|
|
86
|
-
n(
|
|
80
|
+
fn: t(() => [
|
|
81
|
+
n(o.$slots, "prefix")
|
|
87
82
|
]),
|
|
88
83
|
key: "2"
|
|
89
84
|
} : void 0,
|
|
90
|
-
|
|
85
|
+
l.empty ? {
|
|
91
86
|
name: "empty",
|
|
92
|
-
fn:
|
|
93
|
-
n(
|
|
87
|
+
fn: t(() => [
|
|
88
|
+
n(o.$slots, "empty")
|
|
94
89
|
]),
|
|
95
90
|
key: "3"
|
|
96
91
|
} : void 0,
|
|
97
|
-
|
|
92
|
+
l.tag ? {
|
|
98
93
|
name: "tag",
|
|
99
|
-
fn:
|
|
100
|
-
n(
|
|
94
|
+
fn: t(() => [
|
|
95
|
+
n(o.$slots, "tag", { field: e(p) })
|
|
101
96
|
]),
|
|
102
97
|
key: "4"
|
|
103
98
|
} : void 0,
|
|
104
|
-
|
|
99
|
+
l.loading ? {
|
|
105
100
|
name: "loading",
|
|
106
|
-
fn:
|
|
107
|
-
n(
|
|
101
|
+
fn: t(() => [
|
|
102
|
+
n(o.$slots, "loading")
|
|
108
103
|
]),
|
|
109
104
|
key: "5"
|
|
110
105
|
} : void 0,
|
|
111
|
-
|
|
106
|
+
l.label ? {
|
|
112
107
|
name: "label",
|
|
113
|
-
fn:
|
|
114
|
-
n(
|
|
115
|
-
label:
|
|
116
|
-
value:
|
|
108
|
+
fn: t(({ label: r, value: a }) => [
|
|
109
|
+
n(o.$slots, "label", {
|
|
110
|
+
label: r,
|
|
111
|
+
value: a
|
|
117
112
|
})
|
|
118
113
|
]),
|
|
119
114
|
key: "6"
|
|
120
115
|
} : void 0
|
|
121
|
-
]), 1040
|
|
116
|
+
]), 1040));
|
|
122
117
|
}
|
|
123
|
-
}),
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
118
|
+
}), M = b(
|
|
119
|
+
O,
|
|
120
|
+
P({ dataSource: "options", loading: !0, disabled: !0 }),
|
|
121
|
+
R(w.Select)
|
|
127
122
|
);
|
|
128
123
|
export {
|
|
129
|
-
|
|
130
|
-
|
|
124
|
+
M as Select,
|
|
125
|
+
M as default
|
|
131
126
|
};
|
|
132
127
|
//# sourceMappingURL=index.mjs.map
|
package/esm/select/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/select/select.vue","../../src/select/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useField } from '@formily/vue'\nimport { ElOption, ElOptionGroup, ElSelect } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FSelect',\n inheritAttrs: false,\n})\n\nconst props = defineProps
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/select/select.vue","../../src/select/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useField } from '@silver-formily/vue'\nimport { ElOption, ElOptionGroup, ElSelect } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FSelect',\n inheritAttrs: false,\n})\n\nconst props = defineProps<{\n options?: Array<OptionType | OptionGroupType>\n}>()\n\nconst slots = defineSlots<{\n option?: (props: { option: OptionType }) => any\n header?: () => any\n footer?: () => any\n prefix?: () => any\n empty?: () => any\n tag?: () => any\n loading?: () => any\n label?: () => any\n}>()\n\ntype OptionType = InstanceType<typeof ElOption>['$props']\ntype OptionGroupType = InstanceType<typeof ElOptionGroup>['$props'] & {\n options: OptionType[]\n}\n\nconst { props: selectProps } = useCleanAttrs()\n\nconst fieldRef = useField()\n\nfunction isGroup(option: OptionType | OptionGroupType): option is OptionGroupType {\n return (option as OptionGroupType).options !== undefined\n}\n</script>\n\n<template>\n <ElSelect v-bind=\"selectProps\">\n <template v-for=\"option of props.options\">\n <template v-if=\"isGroup(option)\">\n <ElOptionGroup v-bind=\"omit(option, 'options')\" :key=\"option.label\">\n <ElOption v-for=\"i of option.options\" :key=\"selectProps.valueKey ? i[selectProps.valueKey] : i.label\" v-bind=\"i\">\n <slot v-if=\"slots.option\" name=\"option\" :option=\"i\" />\n </ElOption>\n </ElOptionGroup>\n </template>\n <ElOption v-else v-bind=\"option\" :key=\"selectProps.valueKey ? option[selectProps.valueKey] : option.label\">\n <slot v-if=\"slots.option\" name=\"option\" :option=\"option\" />\n </ElOption>\n </template>\n <template v-if=\"slots.header\" #header>\n <slot name=\"header\" :field=\"fieldRef\" />\n </template>\n <template v-if=\"slots.footer\" #footer>\n <slot name=\"footer\" :field=\"fieldRef\" />\n </template>\n <template v-if=\"slots.prefix\" #prefix>\n <slot name=\"prefix\" />\n </template>\n <template v-if=\"slots.empty\" #empty>\n <slot name=\"empty\" />\n </template>\n <template v-if=\"slots.tag\" #tag>\n <slot name=\"tag\" :field=\"fieldRef\" />\n </template>\n <template v-if=\"slots.loading\" #loading>\n <slot name=\"loading\" />\n </template>\n <template v-if=\"slots.label\" #label=\"{ label, value: labelValue }\">\n <slot name=\"label\" :label=\"label\" :value=\"labelValue\" />\n </template>\n </ElSelect>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FSelect from './select.vue'\n\nexport const Select = connect<typeof FSelect>(\n FSelect,\n mapProps({ dataSource: 'options', loading: true, disabled: true }),\n mapReadPretty(PreviewText.Select),\n)\n\nexport default Select\n"],"names":["props","__props","slots","_useSlots","selectProps","useCleanAttrs","fieldRef","useField","isGroup","option","_openBlock","_createBlock","_unref","_createSlots","_createElementBlock","_Fragment","_renderList","_mergeProps","omit","i","_renderSlot","_ctx","label","labelValue","Select","connect","FSelect","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;;;;;AAWA,UAAMA,IAAQC,GAIRC,IAAQC,EAAA,GAgBR,EAAE,OAAOC,EAAA,IAAgBC,EAAA,GAEzBC,IAAWC,EAAA;AAEjB,aAASC,EAAQC,GAAiE;AAChF,aAAQA,EAA2B,YAAY;AAAA,IACjD;sBAIEC,EAAA,GAAAC,EAkCWC,UAlCOA,EAAAR,CAAA,CAAW,CAAA,GAAAS,EAAA;AAAA,iBACjB,MAA+B;AAAA,SAAzCH,EAAA,EAAA,GAAAI,EAWWC,GAAA,MAAAC,EAXgBhB,EAAM,UAAhBS;UACCD,EAAQC,CAAM,KAC5BC,EAAA,GAAAC,EAIgBC,MAJhBK,EAIgB;AAAA;;aAJOL,EAAAM,CAAA,EAAKT,GAAM,SAAA,GAAA;AAAA,YAAe,KAAKA,EAAO;AAAA,UAAA;uBACjD,MAA2B;AAAA,eAArCC,EAAA,EAAA,GAAAI,EAEWC,GAAA,MAAAC,EAFWP,EAAO,UAAZU,OAAjBT,KAAAC,EAEWC,MAFXK,EAEW;AAAA,gBAF4B,KAAKL,EAAAR,CAAA,EAAY,WAAWe,EAAEP,EAAAR,CAAA,EAAY,QAAQ,IAAIe,EAAE;AAAA,cAAA,oBAAeA,CAAC,GAAA;AAAA,2BAC7G,MAAsD;AAAA,kBAA1CjB,EAAM,SAAlBkB,EAAsDC,EAAA,QAAA,UAAA;AAAA;oBAAb,QAAQF;AAAA,kBAAA;;;;;;uBAIvDT,EAAA,GAAAC,EAEWC,MAFXK,EAEW;AAAA;;aAFcR,GAAM;AAAA,YAAG,KAAKG,EAAAR,CAAA,EAAY,WAAWK,EAAOG,EAAAR,CAAA,EAAY,QAAQ,IAAIK,EAAO;AAAA,UAAA;uBAClG,MAA2D;AAAA,cAA/CP,EAAM,SAAlBkB,EAA2DC,EAAA,QAAA,UAAA;AAAA;gBAAlB,QAAAZ;AAAA,cAAA;;;;;;;;MAG7BP,EAAM;cAAS;AAAA,cAC7B,MAAwC;AAAA,UAAxCkB,EAAwCC,EAAA,QAAA,UAAA,EAAnB,OAAOT,EAAAN,CAAA,EAAA,CAAQ;AAAA,QAAA;;;MAEtBJ,EAAM;cAAS;AAAA,cAC7B,MAAwC;AAAA,UAAxCkB,EAAwCC,EAAA,QAAA,UAAA,EAAnB,OAAOT,EAAAN,CAAA,EAAA,CAAQ;AAAA,QAAA;;;MAEtBJ,EAAM;cAAS;AAAA,cAC7B,MAAsB;AAAA,UAAtBkB,EAAsBC,EAAA,QAAA,QAAA;AAAA,QAAA;;;MAERnB,EAAM;cAAQ;AAAA,cAC5B,MAAqB;AAAA,UAArBkB,EAAqBC,EAAA,QAAA,OAAA;AAAA,QAAA;;;MAEPnB,EAAM;cAAM;AAAA,cAC1B,MAAqC;AAAA,UAArCkB,EAAqCC,EAAA,QAAA,OAAA,EAAnB,OAAOT,EAAAN,CAAA,EAAA,CAAQ;AAAA,QAAA;;;MAEnBJ,EAAM;cAAU;AAAA,cAC9B,MAAuB;AAAA,UAAvBkB,EAAuBC,EAAA,QAAA,SAAA;AAAA,QAAA;;;MAETnB,EAAM;cAAQ;AAAA,cAC5B,CAAwD,EADnB,OAAAoB,GAAK,OAASC,QAAU;AAAA,UAC7DH,EAAwDC,EAAA,QAAA,SAAA;AAAA,YAApC,OAAAC;AAAA,YAAe,OAAOC;AAAA,UAAA;;;;;;ICpEnCC,IAASC;AAAA,EACpBC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,SAAS,IAAM,UAAU,IAAM;AAAA,EACjEC,EAAcC,EAAY,MAAM;AAClC;"}
|
package/esm/select/select.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ElOption, ElOptionGroup } from 'element-plus';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
value?: any;
|
|
4
3
|
options?: Array<OptionType | OptionGroupType>;
|
|
5
4
|
};
|
|
6
5
|
type OptionType = InstanceType<typeof ElOption>['$props'];
|
|
@@ -36,11 +35,7 @@ declare function __VLS_template(): {
|
|
|
36
35
|
rootEl: any;
|
|
37
36
|
};
|
|
38
37
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
39
|
-
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
40
|
-
change: (value: any) => any;
|
|
41
|
-
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
42
|
-
onChange?: (value: any) => any;
|
|
43
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
38
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
44
39
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
45
40
|
export default _default;
|
|
46
41
|
type __VLS_WithTemplateSlots<T, S> = T & {
|