@silver-formily/element-plus 2.0.1 → 2.2.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 +32 -35
- package/esm/__builtins__/index.mjs +15 -16
- package/esm/__builtins__/shared/index.mjs +11 -12
- package/esm/__builtins__/shared/transform-component.d.ts +2 -6
- 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 +10 -10
- package/esm/__builtins__/shared/utils.mjs.map +1 -1
- package/esm/array-base/index.mjs +58 -58
- package/esm/array-base/index.mjs.map +1 -1
- package/esm/array-cards/index.mjs +44 -44
- package/esm/array-cards/index.mjs.map +1 -1
- package/esm/array-collapse/index.mjs +59 -58
- package/esm/array-collapse/index.mjs.map +1 -1
- package/esm/array-items/index.mjs +46 -43
- package/esm/array-items/index.mjs.map +1 -1
- package/esm/array-list-tabs/index.mjs +15 -14
- package/esm/array-list-tabs/index.mjs.map +1 -1
- package/esm/array-table/array-table.d.ts +28 -0
- package/esm/array-table/index.d.ts +28 -0
- package/esm/array-table/index.mjs +113 -111
- package/esm/array-table/index.mjs.map +1 -1
- package/esm/array-table/types.d.ts +1 -0
- package/esm/cascader/index.mjs +19 -20
- package/esm/cascader/index.mjs.map +1 -1
- package/esm/checkbox/checkbox-group.d.ts +1 -4
- package/esm/checkbox/index.d.ts +442 -379
- package/esm/checkbox/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 +110 -112
- package/esm/editable/index.mjs.map +1 -1
- package/esm/form-button-group/index.mjs +29 -28
- package/esm/form-button-group/index.mjs.map +1 -1
- package/esm/form-collapse/index.mjs +42 -43
- package/esm/form-collapse/index.mjs.map +1 -1
- package/esm/form-dialog/index.d.ts +1 -1
- package/esm/form-dialog/index.mjs +4 -4
- 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 +4 -4
- 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 +1 -1
- 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 +163 -155
- 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 +53 -52
- 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 +48 -43
- package/esm/form-layout/utils.mjs.map +1 -1
- package/esm/form-step/index.mjs +27 -25
- package/esm/form-step/index.mjs.map +1 -1
- package/esm/form-tab/index.d.ts +1 -26
- package/esm/form-tab/index.mjs +30 -30
- package/esm/form-tab/index.mjs.map +1 -1
- package/esm/index.d.ts +3 -0
- package/esm/index.mjs +44 -38
- package/esm/index.mjs.map +1 -1
- package/esm/input/index.mjs.map +1 -1
- package/esm/input-number/index.d.ts +258 -147
- package/esm/pagination/pagination.mjs +109 -110
- package/esm/pagination/pagination.mjs.map +1 -1
- package/esm/password/index.mjs.map +1 -1
- package/esm/preview-text/index.d.ts +5 -0
- package/esm/preview-text/index.mjs +165 -141
- package/esm/preview-text/index.mjs.map +1 -1
- package/esm/preview-text/rate.d.ts +5 -0
- package/esm/preview-text/utils.d.ts +5 -5
- package/esm/preview-text/utils.mjs.map +1 -1
- package/esm/radio/index.d.ts +344 -194
- package/esm/radio/index.mjs.map +1 -1
- package/esm/rate/index.d.ts +187 -0
- package/esm/rate/index.mjs +14 -0
- package/esm/rate/index.mjs.map +1 -0
- package/esm/reset/index.d.ts +1 -62
- package/esm/reset/index.mjs +1 -1
- package/esm/reset/index.mjs.map +1 -1
- package/esm/segmented/index.d.ts +26 -0
- package/esm/segmented/index.mjs +37 -0
- package/esm/segmented/index.mjs.map +1 -0
- package/esm/segmented/segmented.d.ts +25 -0
- package/esm/select/index.mjs +8 -8
- package/esm/select/index.mjs.map +1 -1
- package/esm/select-table/index.d.ts +28 -0
- package/esm/select-table/index.mjs +48 -47
- package/esm/select-table/index.mjs.map +1 -1
- package/esm/select-table/select-table.d.ts +56 -0
- package/esm/slider/index.d.ts +177 -0
- package/esm/slider/index.mjs +14 -0
- package/esm/slider/index.mjs.map +1 -0
- package/esm/submit/index.d.ts +1 -47
- package/esm/submit/index.mjs +1 -1
- package/esm/submit/index.mjs.map +1 -1
- package/esm/switch/index.d.ts +225 -189
- package/esm/time-select/index.d.ts +163 -103
- package/esm/transfer/index.d.ts +196 -115
- package/esm/transfer/index.mjs.map +1 -1
- package/esm/tree/index.mjs +26 -26
- package/esm/tree/index.mjs.map +1 -1
- package/esm/tree-select/index.mjs.map +1 -1
- package/esm/upload/index.d.ts +404 -399
- package/esm/upload/index.mjs.map +1 -1
- package/esm/upload/upload.d.ts +800 -790
- 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 -9
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\">\r\nimport type { RadioProps } from 'element-plus'\r\nimport type { PropType } from 'vue'\r\nimport { isPlainObj } from '@formily/shared'\r\nimport { ElRadio, ElRadioButton, ElRadioGroup, version } from 'element-plus'\r\nimport { computed, useSlots } from 'vue'\r\nimport { lt, useCleanAttrs } from '../__builtins__'\r\n\r\ndefineOptions({\r\n name: 'FRadioGroup',\r\n})\r\n\r\nconst props = defineProps({\r\n options: {\r\n type: Array as PropType<Array<RadioProps | string | number>>,\r\n default: () => [],\r\n },\r\n optionType: {\r\n type: String as PropType<'default' | 'button'>,\r\n default: 'default',\r\n },\r\n})\r\n\r\nconst { props: radioProps } = useCleanAttrs()\r\n\r\nconst OptionType = computed(() => {\r\n return props.optionType === 'button' ? ElRadioButton : ElRadio\r\n})\r\nconst IS_LESS_THAN_2_6_0 = lt(version, '2.6.0')\r\n\r\nfunction isRadioPropsObject(option: any): option is RadioProps {\r\n return isPlainObj(option)\r\n}\r\n\r\nfunction getOptionLabel(option: any, index: number) {\r\n if (isRadioPropsObject(props.options[index])) {\r\n return props.options[index].label\r\n }\r\n return option.label\r\n}\r\n\r\nconst compatiableProps = computed(() => {\r\n return props.options.map((option) => {\r\n if (!isRadioPropsObject(option)) {\r\n return {\r\n label: option,\r\n value: option,\r\n }\r\n }\r\n /* istanbul ignore if -- @preserve */\r\n if (IS_LESS_THAN_2_6_0) {\r\n return {\r\n ...option,\r\n label: option.value,\r\n }\r\n }\r\n return option\r\n })\r\n})\r\n\r\nconst slots = useSlots()\r\n</script>\r\n\r\n<template>\r\n <ElRadioGroup v-bind=\"radioProps\">\r\n <template v-if=\"!slots.option\">\r\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\r\n {{ getOptionLabel(option, index) }}\r\n </component>\r\n </template>\r\n <template v-else>\r\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\r\n <slot name=\"option\" :option=\"option\" />\r\n </component>\r\n </template>\r\n </ElRadioGroup>\r\n</template>\r\n","import { connect, mapProps } from '@silver-formily/vue'\r\nimport { ElRadio } from 'element-plus'\r\nimport { composeExport, mapReadPretty } from '../__builtins__'\r\nimport { PreviewText } from '../preview-text'\r\nimport FRadioGroup from './radio-group.vue'\r\nimport './style.scss'\r\n\r\nconst RadioGroup = connect(\r\n FRadioGroup,\r\n mapProps({ dataSource: 'options', disabled: true }),\r\n mapReadPretty(PreviewText.Select),\r\n)\r\nexport const Radio = composeExport(ElRadio, {\r\n Group: RadioGroup,\r\n})\r\n\r\nexport default Radio\r\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,IAAQC,EAAc7B,GAAS;AAAA,EAC1C,OAAOsB;AACT,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/radio/radio-group.vue","../../src/radio/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport type { RadioProps } from 'element-plus'\r\nimport type { PropType } from 'vue'\r\nimport { isPlainObj } from '@formily/shared'\r\nimport { ElRadio, ElRadioButton, ElRadioGroup, version } from 'element-plus'\r\nimport { computed, useSlots } from 'vue'\r\nimport { lt, useCleanAttrs } from '../__builtins__'\r\n\r\ndefineOptions({\r\n name: 'FRadioGroup',\r\n})\r\n\r\nconst props = defineProps({\r\n options: {\r\n type: Array as PropType<Array<RadioProps | string | number>>,\r\n default: () => [],\r\n },\r\n optionType: {\r\n type: String as PropType<'default' | 'button'>,\r\n default: 'default',\r\n },\r\n})\r\n\r\nconst { props: radioProps } = useCleanAttrs()\r\n\r\nconst OptionType = computed(() => {\r\n return props.optionType === 'button' ? ElRadioButton : ElRadio\r\n})\r\nconst IS_LESS_THAN_2_6_0 = lt(version, '2.6.0')\r\n\r\nfunction isRadioPropsObject(option: any): option is RadioProps {\r\n return isPlainObj(option)\r\n}\r\n\r\nfunction getOptionLabel(option: any, index: number) {\r\n if (isRadioPropsObject(props.options[index])) {\r\n return props.options[index].label\r\n }\r\n return option.label\r\n}\r\n\r\nconst compatiableProps = computed(() => {\r\n return props.options.map((option) => {\r\n if (!isRadioPropsObject(option)) {\r\n return {\r\n label: option,\r\n value: option,\r\n }\r\n }\r\n /* istanbul ignore if -- @preserve */\r\n if (IS_LESS_THAN_2_6_0) {\r\n return {\r\n ...option,\r\n label: option.value,\r\n }\r\n }\r\n return option\r\n })\r\n})\r\n\r\nconst slots = useSlots()\r\n</script>\r\n\r\n<template>\r\n <ElRadioGroup v-bind=\"radioProps\">\r\n <template v-if=\"!slots.option\">\r\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\r\n {{ getOptionLabel(option, index) }}\r\n </component>\r\n </template>\r\n <template v-else>\r\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\r\n <slot name=\"option\" :option=\"option\" />\r\n </component>\r\n </template>\r\n </ElRadioGroup>\r\n</template>\r\n","import { connect, mapProps } from '@silver-formily/vue'\r\nimport { ElRadio } from 'element-plus'\r\nimport { composeExport, mapReadPretty } from '../__builtins__'\r\nimport { PreviewText } from '../preview-text'\r\nimport FRadioGroup from './radio-group.vue'\r\nimport './style.scss'\r\n\r\nconst RadioGroup = connect<typeof FRadioGroup>(\r\n FRadioGroup,\r\n mapProps({ dataSource: 'options', disabled: true }),\r\n mapReadPretty(PreviewText.Select),\r\n)\r\nexport const Radio = composeExport(ElRadio, {\r\n Group: RadioGroup,\r\n})\r\n\r\nexport default Radio\r\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,IAAQC,EAAc7B,GAAS;AAAA,EAC1C,OAAOsB;AACT,CAAC;"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { ElRate } from 'element-plus';
|
|
2
|
+
export type RateProps = typeof ElRate;
|
|
3
|
+
export declare const Rate: import('element-plus/es/utils/index.mjs').SFCWithInstall<import('vue').DefineComponent<{
|
|
4
|
+
size: {
|
|
5
|
+
type: import('vue').PropType<"" | "small" | "default" | "large">;
|
|
6
|
+
};
|
|
7
|
+
max: {
|
|
8
|
+
type: import('vue').PropType<number>;
|
|
9
|
+
default: number;
|
|
10
|
+
};
|
|
11
|
+
disabled: {
|
|
12
|
+
type: import('vue').PropType<boolean>;
|
|
13
|
+
default: undefined;
|
|
14
|
+
};
|
|
15
|
+
id: {
|
|
16
|
+
type: import('vue').PropType<string>;
|
|
17
|
+
default: undefined;
|
|
18
|
+
};
|
|
19
|
+
modelValue: {
|
|
20
|
+
type: import('vue').PropType<number>;
|
|
21
|
+
default: number;
|
|
22
|
+
};
|
|
23
|
+
ariaLabel: {
|
|
24
|
+
type: import('vue').PropType<string>;
|
|
25
|
+
};
|
|
26
|
+
clearable: {
|
|
27
|
+
type: import('vue').PropType<boolean>;
|
|
28
|
+
};
|
|
29
|
+
lowThreshold: {
|
|
30
|
+
type: import('vue').PropType<number>;
|
|
31
|
+
default: number;
|
|
32
|
+
};
|
|
33
|
+
highThreshold: {
|
|
34
|
+
type: import('vue').PropType<number>;
|
|
35
|
+
default: number;
|
|
36
|
+
};
|
|
37
|
+
colors: {
|
|
38
|
+
type: import('vue').PropType<string[] | Record<number, string>>;
|
|
39
|
+
default: () => string[];
|
|
40
|
+
};
|
|
41
|
+
voidColor: {
|
|
42
|
+
type: import('vue').PropType<string>;
|
|
43
|
+
default: string;
|
|
44
|
+
};
|
|
45
|
+
disabledVoidColor: {
|
|
46
|
+
type: import('vue').PropType<string>;
|
|
47
|
+
default: string;
|
|
48
|
+
};
|
|
49
|
+
icons: {
|
|
50
|
+
type: import('vue').PropType<(string | import('vue').Component)[] | Record<number, string | import('vue').Component>>;
|
|
51
|
+
default: () => any[];
|
|
52
|
+
};
|
|
53
|
+
voidIcon: {
|
|
54
|
+
type: import('vue').PropType<string | import('vue').Component>;
|
|
55
|
+
default: () => any;
|
|
56
|
+
};
|
|
57
|
+
disabledVoidIcon: {
|
|
58
|
+
type: import('vue').PropType<string | import('vue').Component>;
|
|
59
|
+
default: () => any;
|
|
60
|
+
};
|
|
61
|
+
allowHalf: {
|
|
62
|
+
type: import('vue').PropType<boolean>;
|
|
63
|
+
};
|
|
64
|
+
showText: {
|
|
65
|
+
type: import('vue').PropType<boolean>;
|
|
66
|
+
};
|
|
67
|
+
showScore: {
|
|
68
|
+
type: import('vue').PropType<boolean>;
|
|
69
|
+
};
|
|
70
|
+
textColor: {
|
|
71
|
+
type: import('vue').PropType<string>;
|
|
72
|
+
default: string;
|
|
73
|
+
};
|
|
74
|
+
texts: {
|
|
75
|
+
type: import('vue').PropType<string[]>;
|
|
76
|
+
default: () => string[];
|
|
77
|
+
};
|
|
78
|
+
scoreTemplate: {
|
|
79
|
+
type: import('vue').PropType<string>;
|
|
80
|
+
default: string;
|
|
81
|
+
};
|
|
82
|
+
}, {
|
|
83
|
+
setCurrentValue: (value: number, event?: MouseEvent) => void;
|
|
84
|
+
resetCurrentValue: () => void;
|
|
85
|
+
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
86
|
+
"update:modelValue": (value: number) => void;
|
|
87
|
+
change: (value: number) => void;
|
|
88
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
89
|
+
size: {
|
|
90
|
+
type: import('vue').PropType<"" | "small" | "default" | "large">;
|
|
91
|
+
};
|
|
92
|
+
max: {
|
|
93
|
+
type: import('vue').PropType<number>;
|
|
94
|
+
default: number;
|
|
95
|
+
};
|
|
96
|
+
disabled: {
|
|
97
|
+
type: import('vue').PropType<boolean>;
|
|
98
|
+
default: undefined;
|
|
99
|
+
};
|
|
100
|
+
id: {
|
|
101
|
+
type: import('vue').PropType<string>;
|
|
102
|
+
default: undefined;
|
|
103
|
+
};
|
|
104
|
+
modelValue: {
|
|
105
|
+
type: import('vue').PropType<number>;
|
|
106
|
+
default: number;
|
|
107
|
+
};
|
|
108
|
+
ariaLabel: {
|
|
109
|
+
type: import('vue').PropType<string>;
|
|
110
|
+
};
|
|
111
|
+
clearable: {
|
|
112
|
+
type: import('vue').PropType<boolean>;
|
|
113
|
+
};
|
|
114
|
+
lowThreshold: {
|
|
115
|
+
type: import('vue').PropType<number>;
|
|
116
|
+
default: number;
|
|
117
|
+
};
|
|
118
|
+
highThreshold: {
|
|
119
|
+
type: import('vue').PropType<number>;
|
|
120
|
+
default: number;
|
|
121
|
+
};
|
|
122
|
+
colors: {
|
|
123
|
+
type: import('vue').PropType<string[] | Record<number, string>>;
|
|
124
|
+
default: () => string[];
|
|
125
|
+
};
|
|
126
|
+
voidColor: {
|
|
127
|
+
type: import('vue').PropType<string>;
|
|
128
|
+
default: string;
|
|
129
|
+
};
|
|
130
|
+
disabledVoidColor: {
|
|
131
|
+
type: import('vue').PropType<string>;
|
|
132
|
+
default: string;
|
|
133
|
+
};
|
|
134
|
+
icons: {
|
|
135
|
+
type: import('vue').PropType<(string | import('vue').Component)[] | Record<number, string | import('vue').Component>>;
|
|
136
|
+
default: () => any[];
|
|
137
|
+
};
|
|
138
|
+
voidIcon: {
|
|
139
|
+
type: import('vue').PropType<string | import('vue').Component>;
|
|
140
|
+
default: () => any;
|
|
141
|
+
};
|
|
142
|
+
disabledVoidIcon: {
|
|
143
|
+
type: import('vue').PropType<string | import('vue').Component>;
|
|
144
|
+
default: () => any;
|
|
145
|
+
};
|
|
146
|
+
allowHalf: {
|
|
147
|
+
type: import('vue').PropType<boolean>;
|
|
148
|
+
};
|
|
149
|
+
showText: {
|
|
150
|
+
type: import('vue').PropType<boolean>;
|
|
151
|
+
};
|
|
152
|
+
showScore: {
|
|
153
|
+
type: import('vue').PropType<boolean>;
|
|
154
|
+
};
|
|
155
|
+
textColor: {
|
|
156
|
+
type: import('vue').PropType<string>;
|
|
157
|
+
default: string;
|
|
158
|
+
};
|
|
159
|
+
texts: {
|
|
160
|
+
type: import('vue').PropType<string[]>;
|
|
161
|
+
default: () => string[];
|
|
162
|
+
};
|
|
163
|
+
scoreTemplate: {
|
|
164
|
+
type: import('vue').PropType<string>;
|
|
165
|
+
default: string;
|
|
166
|
+
};
|
|
167
|
+
}>> & {
|
|
168
|
+
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
169
|
+
onChange?: ((value: number) => any) | undefined;
|
|
170
|
+
}, {
|
|
171
|
+
disabled: boolean;
|
|
172
|
+
id: string;
|
|
173
|
+
modelValue: number;
|
|
174
|
+
max: number;
|
|
175
|
+
textColor: string;
|
|
176
|
+
colors: string[] | Record<number, string>;
|
|
177
|
+
lowThreshold: number;
|
|
178
|
+
highThreshold: number;
|
|
179
|
+
voidColor: string;
|
|
180
|
+
disabledVoidColor: string;
|
|
181
|
+
icons: Array<string | import('vue').Component> | Record<number, string | import('vue').Component>;
|
|
182
|
+
voidIcon: string | import('vue').Component;
|
|
183
|
+
disabledVoidIcon: string | import('vue').Component;
|
|
184
|
+
texts: string[];
|
|
185
|
+
scoreTemplate: string;
|
|
186
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>>;
|
|
187
|
+
export default Rate;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { connect as e, mapProps as r } from "@silver-formily/vue";
|
|
2
|
+
import { ElRate as t } from "element-plus";
|
|
3
|
+
import { PreviewText as o } from "../preview-text/index.mjs";
|
|
4
|
+
import { mapReadPretty as a } from "../__builtins__/shared/transform-component.mjs";
|
|
5
|
+
const f = e(
|
|
6
|
+
t,
|
|
7
|
+
r({ readOnly: "readonly", disabled: !0 }),
|
|
8
|
+
a(o.Rate)
|
|
9
|
+
);
|
|
10
|
+
export {
|
|
11
|
+
f as Rate,
|
|
12
|
+
f as default
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/rate/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\nimport { ElRate } from 'element-plus'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\n\nexport type RateProps = typeof ElRate\n\nexport const Rate = connect<typeof ElRate>(\n ElRate,\n mapProps({ readOnly: 'readonly', disabled: true }),\n mapReadPretty(PreviewText.Rate),\n)\n\nexport default Rate\n"],"names":["Rate","connect","ElRate","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;AAOO,MAAMA,IAAOC;AAAA,EAClBC;AAAA,EACAC,EAAS,EAAE,UAAU,YAAY,UAAU,IAAM;AAAA,EACjDC,EAAcC,EAAY,IAAI;AAChC;"}
|
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,4 +1,4 @@
|
|
|
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
3
|
import { useParentForm as C } from "@silver-formily/vue";
|
|
4
4
|
import { ElButton as k } from "element-plus";
|
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>\r\nimport type { PropType } from 'vue'\r\nimport { useParentForm } from '@silver-formily/vue'\r\nimport { ElButton } from 'element-plus'\r\n\r\ndefineOptions({\r\n name: 'FReset',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps({\r\n onClick: Function as PropType<(e: MouseEvent) => void | boolean>,\r\n forceClear: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n validate: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n onResetValidateSuccess: Function as PropType<(payload: any) => void>,\r\n onResetValidateFailed: Function as PropType<(error: any) => void>,\r\n})\r\n\r\nconst formRef = useParentForm()\r\n\r\nfunction handleClick(e: MouseEvent) {\r\n if (props.onClick && (props.onClick)?.(e) === false)\r\n return\r\n\r\n const form = formRef?.value\r\n form?.reset('*', {\r\n forceClear: props.forceClear,\r\n })\r\n props.validate && form?.validate()\r\n .then(props.onResetValidateSuccess)\r\n .catch(error => props.onResetValidateFailed?.(error))\r\n}\r\n</script>\r\n\r\n<template>\r\n <ElButton v-bind=\"$attrs\" @click=\"handleClick\">\r\n <slot />\r\n </ElButton>\r\n</template>\r\n","import { observer } from '@formily/reactive-vue'\r\nimport FReset from './reset.vue'\r\n\r\nexport const Reset = observer(FReset)\r\n\r\nexport default Reset\r\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>\r\nimport type { PropType } from 'vue'\r\nimport { useParentForm } from '@silver-formily/vue'\r\nimport { ElButton } from 'element-plus'\r\n\r\ndefineOptions({\r\n name: 'FReset',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps({\r\n onClick: Function as PropType<(e: MouseEvent) => void | boolean>,\r\n forceClear: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n validate: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n onResetValidateSuccess: Function as PropType<(payload: any) => void>,\r\n onResetValidateFailed: Function as PropType<(error: any) => void>,\r\n})\r\n\r\nconst formRef = useParentForm()\r\n\r\nfunction handleClick(e: MouseEvent) {\r\n if (props.onClick && (props.onClick)?.(e) === false)\r\n return\r\n\r\n const form = formRef?.value\r\n form?.reset('*', {\r\n forceClear: props.forceClear,\r\n })\r\n props.validate && form?.validate()\r\n .then(props.onResetValidateSuccess)\r\n .catch(error => props.onResetValidateFailed?.(error))\r\n}\r\n</script>\r\n\r\n<template>\r\n <ElButton v-bind=\"$attrs\" @click=\"handleClick\">\r\n <slot />\r\n </ElButton>\r\n</template>\r\n","import { observer } from '@silver-formily/reactive-vue'\r\nimport FReset from './reset.vue'\r\n\r\nexport const Reset = observer(FReset)\r\n\r\nexport default Reset\r\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;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const Segmented: {
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
3
|
+
options?: import('element-plus/es/components/segmented/src/types.mjs').Option[];
|
|
4
|
+
}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
5
|
+
P: {};
|
|
6
|
+
B: {};
|
|
7
|
+
D: {};
|
|
8
|
+
C: {};
|
|
9
|
+
M: {};
|
|
10
|
+
Defaults: {};
|
|
11
|
+
}, Readonly<{
|
|
12
|
+
options?: import('element-plus/es/components/segmented/src/types.mjs').Option[];
|
|
13
|
+
}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
14
|
+
__isFragment?: never;
|
|
15
|
+
__isTeleport?: never;
|
|
16
|
+
__isSuspense?: never;
|
|
17
|
+
} & import('vue').ComponentOptionsBase<Readonly<{
|
|
18
|
+
options?: import('element-plus/es/components/segmented/src/types.mjs').Option[];
|
|
19
|
+
}> & 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 () => {
|
|
20
|
+
$slots: {
|
|
21
|
+
default?(_: {
|
|
22
|
+
item: any;
|
|
23
|
+
}): any;
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
export default Segmented;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { connect as m, mapProps as a } from "@silver-formily/vue";
|
|
2
|
+
import { PreviewText as i } from "../preview-text/index.mjs";
|
|
3
|
+
import { defineComponent as c, useSlots as d, createBlock as l, openBlock as f, unref as e, mergeProps as u, createSlots as S, withCtx as g, renderSlot as P, normalizeProps as _, guardReactiveProps as h } from "vue";
|
|
4
|
+
import { ElSegmented as k } from "element-plus";
|
|
5
|
+
import { useCleanAttrs as v } from "../__builtins__/shared/utils.mjs";
|
|
6
|
+
import { mapReadPretty as x } from "../__builtins__/shared/transform-component.mjs";
|
|
7
|
+
const C = /* @__PURE__ */ c({
|
|
8
|
+
name: "FSegmented",
|
|
9
|
+
inheritAttrs: !1,
|
|
10
|
+
__name: "segmented",
|
|
11
|
+
props: {
|
|
12
|
+
options: {}
|
|
13
|
+
},
|
|
14
|
+
setup(t) {
|
|
15
|
+
const o = t, r = d(), { props: s } = v();
|
|
16
|
+
return (n, w) => (f(), l(e(k), u(e(s), {
|
|
17
|
+
options: o.options
|
|
18
|
+
}), S({ _: 2 }, [
|
|
19
|
+
e(r).default ? {
|
|
20
|
+
name: "default",
|
|
21
|
+
fn: g((p) => [
|
|
22
|
+
P(n.$slots, "default", _(h(p)))
|
|
23
|
+
]),
|
|
24
|
+
key: "0"
|
|
25
|
+
} : void 0
|
|
26
|
+
]), 1040, ["options"]));
|
|
27
|
+
}
|
|
28
|
+
}), E = m(
|
|
29
|
+
C,
|
|
30
|
+
a({ dataSource: "options", disabled: !0 }),
|
|
31
|
+
x(i.Select)
|
|
32
|
+
);
|
|
33
|
+
export {
|
|
34
|
+
E as Segmented,
|
|
35
|
+
E as default
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/segmented/segmented.vue","../../src/segmented/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ElSegmented } from 'element-plus'\nimport { useSlots } from 'vue'\nimport { useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FSegmented',\n inheritAttrs: false,\n})\n\nconst props = defineProps<{\n options?: SegmentedOptions\n}>()\n\ntype SegmentedOption = NonNullable<InstanceType<typeof ElSegmented>['$props']['options']>[number]\n\ntype SegmentedOptions = SegmentedOption[]\n\nconst slots = useSlots()\nconst { props: segmentedProps } = useCleanAttrs()\n</script>\n\n<template>\n <ElSegmented v-bind=\"segmentedProps\" :options=\"props.options\">\n <template v-if=\"slots.default\" #default=\"slotData\">\n <slot v-bind=\"slotData\" />\n </template>\n </ElSegmented>\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FSegmented from './segmented.vue'\n\nexport const Segmented = connect<typeof FSegmented>(\n FSegmented,\n mapProps({ dataSource: 'options', disabled: true }),\n mapReadPretty(PreviewText.Select),\n)\n\nexport default Segmented\n"],"names":["props","__props","slots","useSlots","segmentedProps","useCleanAttrs","_createBlock","_unref","ElSegmented","_mergeProps","_withCtx","slotData","_renderSlot","_ctx","Segmented","connect","FSegmented","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,GAQRC,IAAQC,EAAA,GACR,EAAE,OAAOC,EAAA,IAAmBC,EAAA;2BAIhCC,EAIcC,EAAAC,CAAA,GAJdC,EAIcF,EAAAH,CAAA,GAJqB;AAAA,MAAG,SAASJ,EAAM;AAAA,IAAA;MACnCO,EAAAL,CAAA,EAAM;cAAU;AAAA,QAC9B,IAAAQ,EAAA,CADuCC,MAAQ;AAAA,UAC/CC,EAA0BC,yBAAZF,CAAQ,CAAA,CAAA;AAAA,QAAA;;;;;ICpBfG,IAAYC;AAAA,EACvBC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,UAAU,IAAM;AAAA,EAClDC,EAAcC,EAAY,MAAM;AAClC;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ElSegmented } from 'element-plus';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
options?: SegmentedOptions;
|
|
4
|
+
};
|
|
5
|
+
type SegmentedOption = NonNullable<InstanceType<typeof ElSegmented>['$props']['options']>[number];
|
|
6
|
+
type SegmentedOptions = SegmentedOption[];
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: {
|
|
10
|
+
default?(_: {
|
|
11
|
+
item: any;
|
|
12
|
+
}): any;
|
|
13
|
+
};
|
|
14
|
+
refs: {};
|
|
15
|
+
rootEl: any;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
18
|
+
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>;
|
|
19
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
package/esm/select/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useField as S, connect as b, mapProps as P } from "@silver-formily/vue";
|
|
2
2
|
import { PreviewText as h } from "../preview-text/index.mjs";
|
|
3
|
-
import { defineComponent as C, useSlots as E, createBlock as f, openBlock as s, unref as e, normalizeProps as K, guardReactiveProps as _, createSlots as B, withCtx as t, createElementBlock as
|
|
3
|
+
import { defineComponent as C, useSlots as E, createBlock as f, openBlock as s, unref as e, normalizeProps as K, guardReactiveProps as _, createSlots as B, withCtx as t, createElementBlock as u, Fragment as m, renderList as y, mergeProps as d, renderSlot as n, createCommentVNode as c } from "vue";
|
|
4
4
|
import { ElSelect as F, ElOptionGroup as R, ElOption as k } from "element-plus";
|
|
5
5
|
import { o as w } from "../vendor/lodash.mjs";
|
|
6
6
|
import { useCleanAttrs as A } from "../__builtins__/shared/utils.mjs";
|
|
@@ -10,16 +10,16 @@ const O = /* @__PURE__ */ C({
|
|
|
10
10
|
inheritAttrs: !1,
|
|
11
11
|
__name: "select",
|
|
12
12
|
props: {
|
|
13
|
-
options:
|
|
13
|
+
options: {}
|
|
14
14
|
},
|
|
15
15
|
setup(v) {
|
|
16
|
-
const g = v, l = E(), { props: i } = A(),
|
|
16
|
+
const g = v, l = E(), { props: i } = A(), p = S();
|
|
17
17
|
function $(o) {
|
|
18
18
|
return o.options !== void 0;
|
|
19
19
|
}
|
|
20
20
|
return (o, z) => (s(), f(e(F), K(_(e(i))), B({
|
|
21
21
|
default: t(() => [
|
|
22
|
-
(s(!0),
|
|
22
|
+
(s(!0), u(m, null, y(g.options, (r) => (s(), u(m, null, [
|
|
23
23
|
$(r) ? (s(), f(e(R), d({
|
|
24
24
|
key: 0,
|
|
25
25
|
ref_for: !0
|
|
@@ -27,7 +27,7 @@ const O = /* @__PURE__ */ C({
|
|
|
27
27
|
key: r.label
|
|
28
28
|
}), {
|
|
29
29
|
default: t(() => [
|
|
30
|
-
(s(!0),
|
|
30
|
+
(s(!0), u(m, null, y(r.options, (a) => (s(), f(e(k), d({
|
|
31
31
|
key: e(i).valueKey ? a[e(i).valueKey] : a.label
|
|
32
32
|
}, { ref_for: !0 }, a), {
|
|
33
33
|
default: t(() => [
|
|
@@ -61,14 +61,14 @@ const O = /* @__PURE__ */ C({
|
|
|
61
61
|
l.header ? {
|
|
62
62
|
name: "header",
|
|
63
63
|
fn: t(() => [
|
|
64
|
-
n(o.$slots, "header", { field: e(
|
|
64
|
+
n(o.$slots, "header", { field: e(p) })
|
|
65
65
|
]),
|
|
66
66
|
key: "0"
|
|
67
67
|
} : void 0,
|
|
68
68
|
l.footer ? {
|
|
69
69
|
name: "footer",
|
|
70
70
|
fn: t(() => [
|
|
71
|
-
n(o.$slots, "footer", { field: e(
|
|
71
|
+
n(o.$slots, "footer", { field: e(p) })
|
|
72
72
|
]),
|
|
73
73
|
key: "1"
|
|
74
74
|
} : void 0,
|
|
@@ -89,7 +89,7 @@ const O = /* @__PURE__ */ C({
|
|
|
89
89
|
l.tag ? {
|
|
90
90
|
name: "tag",
|
|
91
91
|
fn: t(() => [
|
|
92
|
-
n(o.$slots, "tag", { field: e(
|
|
92
|
+
n(o.$slots, "tag", { field: e(p) })
|
|
93
93
|
]),
|
|
94
94
|
key: "4"
|
|
95
95
|
} : void 0,
|
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\">\r\nimport { useField } from '@silver-formily/vue'\r\nimport { ElOption, ElOptionGroup, ElSelect } from 'element-plus'\r\nimport { omit } from 'lodash-es'\r\nimport { useCleanAttrs } from '../__builtins__'\r\n\r\ndefineOptions({\r\n name: 'FSelect',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/select/select.vue","../../src/select/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { useField } from '@silver-formily/vue'\r\nimport { ElOption, ElOptionGroup, ElSelect } from 'element-plus'\r\nimport { omit } from 'lodash-es'\r\nimport { useCleanAttrs } from '../__builtins__'\r\n\r\ndefineOptions({\r\n name: 'FSelect',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps<{\r\n options?: Array<OptionType | OptionGroupType>\r\n}>()\r\n\r\nconst slots = defineSlots<{\r\n option?: (props: { option: OptionType }) => any\r\n header?: () => any\r\n footer?: () => any\r\n prefix?: () => any\r\n empty?: () => any\r\n tag?: () => any\r\n loading?: () => any\r\n label?: () => any\r\n}>()\r\n\r\ntype OptionType = InstanceType<typeof ElOption>['$props']\r\ntype OptionGroupType = InstanceType<typeof ElOptionGroup>['$props'] & {\r\n options: OptionType[]\r\n}\r\n\r\nconst { props: selectProps } = useCleanAttrs()\r\n\r\nconst fieldRef = useField()\r\n\r\nfunction isGroup(option: OptionType | OptionGroupType): option is OptionGroupType {\r\n return (option as OptionGroupType).options !== undefined\r\n}\r\n</script>\r\n\r\n<template>\r\n <ElSelect v-bind=\"selectProps\">\r\n <template v-for=\"option of props.options\">\r\n <template v-if=\"isGroup(option)\">\r\n <ElOptionGroup v-bind=\"omit(option, 'options')\" :key=\"option.label\">\r\n <ElOption v-for=\"i of option.options\" :key=\"selectProps.valueKey ? i[selectProps.valueKey] : i.label\" v-bind=\"i\">\r\n <slot v-if=\"slots.option\" name=\"option\" :option=\"i\" />\r\n </ElOption>\r\n </ElOptionGroup>\r\n </template>\r\n <ElOption v-else v-bind=\"option\" :key=\"selectProps.valueKey ? option[selectProps.valueKey] : option.label\">\r\n <slot v-if=\"slots.option\" name=\"option\" :option=\"option\" />\r\n </ElOption>\r\n </template>\r\n <template v-if=\"slots.header\" #header>\r\n <slot name=\"header\" :field=\"fieldRef\" />\r\n </template>\r\n <template v-if=\"slots.footer\" #footer>\r\n <slot name=\"footer\" :field=\"fieldRef\" />\r\n </template>\r\n <template v-if=\"slots.prefix\" #prefix>\r\n <slot name=\"prefix\" />\r\n </template>\r\n <template v-if=\"slots.empty\" #empty>\r\n <slot name=\"empty\" />\r\n </template>\r\n <template v-if=\"slots.tag\" #tag>\r\n <slot name=\"tag\" :field=\"fieldRef\" />\r\n </template>\r\n <template v-if=\"slots.loading\" #loading>\r\n <slot name=\"loading\" />\r\n </template>\r\n <template v-if=\"slots.label\" #label=\"{ label, value: labelValue }\">\r\n <slot name=\"label\" :label=\"label\" :value=\"labelValue\" />\r\n </template>\r\n </ElSelect>\r\n</template>\r\n","import { connect, mapProps } from '@silver-formily/vue'\r\nimport { mapReadPretty } from '../__builtins__'\r\nimport { PreviewText } from '../preview-text'\r\nimport FSelect from './select.vue'\r\n\r\nexport const Select = connect<typeof FSelect>(\r\n FSelect,\r\n mapProps({ dataSource: 'options', loading: true, disabled: true }),\r\n mapReadPretty(PreviewText.Select),\r\n)\r\n\r\nexport default Select\r\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;"}
|