fast-element-plus 2.0.19 → 2.0.20
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/CHANGELOG.md +40 -20
- package/CONTRIBUTING.md +3 -4
- package/README.md +80 -27
- package/README.zh.md +66 -27
- package/dist/component.d.ts +110 -110
- package/dist/components/avatar/src/avatar.d.ts +26 -26
- package/dist/components/avatar/src/avatar.mjs +10 -10
- package/dist/components/avatar/src/avatar.mjs.map +1 -1
- package/dist/components/button/src/button.d.ts +32 -27
- package/dist/components/button/src/button.mjs +57 -36
- package/dist/components/button/src/button.mjs.map +1 -1
- package/dist/components/carNumber/src/carNumber.d.ts +8 -8
- package/dist/components/carNumber/src/carNumber.mjs +5 -5
- package/dist/components/carNumber/src/carNumber.mjs.map +1 -1
- package/dist/components/contextMenu/src/contextMenu.d.ts +6 -6
- package/dist/components/contextMenu/src/contextMenu.mjs +5 -5
- package/dist/components/contextMenu/src/contextMenu.mjs.map +1 -1
- package/dist/components/contextMenu/src/contextMenu.type.d.ts +7 -7
- package/dist/components/dialog/src/dialog.d.ts +74 -74
- package/dist/components/dialog/src/dialog.mjs +31 -31
- package/dist/components/dialog/src/dialog.mjs.map +1 -1
- package/dist/components/drawer/src/drawer.d.ts +57 -57
- package/dist/components/drawer/src/drawer.mjs +24 -24
- package/dist/components/drawer/src/drawer.mjs.map +1 -1
- package/dist/components/form/src/form.d.ts +30 -30
- package/dist/components/form/src/form.mjs +16 -16
- package/dist/components/form/src/form.mjs.map +1 -1
- package/dist/components/form/src/formItem.d.ts +30 -30
- package/dist/components/form/src/formItem.mjs +13 -13
- package/dist/components/form/src/formItem.mjs.map +1 -1
- package/dist/components/formItemTip/src/formItemTip.d.ts +9 -9
- package/dist/components/formItemTip/src/formItemTip.mjs +3 -3
- package/dist/components/formItemTip/src/formItemTip.mjs.map +1 -1
- package/dist/components/icon/src/icon.d.ts +10 -10
- package/dist/components/icon/src/icon.mjs +4 -4
- package/dist/components/icon/src/icon.mjs.map +1 -1
- package/dist/components/iconSelector/src/iconSelector.d.ts +6 -6
- package/dist/components/iconSelector/src/iconSelector.mjs +4 -4
- package/dist/components/iconSelector/src/iconSelector.mjs.map +1 -1
- package/dist/components/image/src/image.d.ts +36 -36
- package/dist/components/image/src/image.mjs +11 -11
- package/dist/components/image/src/image.mjs.map +1 -1
- package/dist/components/inputDialogPage/src/inputDialogPage.d.ts +37 -37
- package/dist/components/inputDialogPage/src/inputDialogPage.mjs +16 -16
- package/dist/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -1
- package/dist/components/layoutGrid/src/layoutGrid.d.ts +12 -12
- package/dist/components/layoutGrid/src/layoutGrid.mjs +6 -6
- package/dist/components/layoutGrid/src/layoutGrid.mjs.map +1 -1
- package/dist/components/layoutGrid/src/layoutGridItem.d.ts +18 -18
- package/dist/components/layoutGrid/src/layoutGridItem.mjs +8 -8
- package/dist/components/layoutGrid/src/layoutGridItem.mjs.map +1 -1
- package/dist/components/select/src/select.d.ts +88 -88
- package/dist/components/select/src/select.mjs +28 -28
- package/dist/components/select/src/select.mjs.map +1 -1
- package/dist/components/select/src/selectOption.d.ts +13 -13
- package/dist/components/select/src/selectOption.mjs +6 -6
- package/dist/components/select/src/selectOption.mjs.map +1 -1
- package/dist/components/selectPage/src/selectPage.d.ts +78 -84
- package/dist/components/selectPage/src/selectPage.mjs +49 -35
- package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
- package/dist/components/selectV2/index.mjs +2 -1
- package/dist/components/selectV2/index.mjs.map +1 -1
- package/dist/components/selectV2/src/selectV2.d.ts +160 -851
- package/dist/components/selectV2/src/selectV2.mjs +30 -338
- package/dist/components/selectV2/src/selectV2.mjs.map +1 -1
- package/dist/components/table/index.mjs +3 -2
- package/dist/components/table/index.mjs.map +1 -1
- package/dist/components/table/src/page.type.d.ts +1 -1
- package/dist/components/table/src/table.d.ts +211 -744
- package/dist/components/table/src/table.mjs +111 -307
- package/dist/components/table/src/table.mjs.map +1 -1
- package/dist/components/table/src/table.state.d.ts +3 -3
- package/dist/components/table/src/table.type.d.ts +1 -9
- package/dist/components/table/src/table.type.mjs.map +1 -1
- package/dist/components/table/src/tableColumn.d.ts +102 -399
- package/dist/components/table/src/tableColumn.mjs +28 -185
- package/dist/components/table/src/tableColumn.mjs.map +1 -1
- package/dist/components/table/src/tableColumnSettingDialog.d.ts +4 -4
- package/dist/components/table/src/tableColumnSettingDialog.mjs +3 -3
- package/dist/components/table/src/tableColumnSettingDialog.mjs.map +1 -1
- package/dist/components/table/src/tablePagination.d.ts +4 -4
- package/dist/components/table/src/tablePagination.mjs +3 -3
- package/dist/components/table/src/tablePagination.mjs.map +1 -1
- package/dist/components/table/src/tableSearchForm.d.ts +12 -12
- package/dist/components/table/src/tableSearchForm.mjs +6 -6
- package/dist/components/table/src/tableSearchForm.mjs.map +1 -1
- package/dist/components/table/src/tableSearchFormItem.d.ts +4 -4
- package/dist/components/table/src/tableSearchFormItem.mjs +2 -2
- package/dist/components/table/src/tableSearchFormItem.mjs.map +1 -1
- package/dist/components/table/src/useTable.d.ts +1 -0
- package/dist/components/table/src/useTable.mjs +109 -65
- package/dist/components/table/src/useTable.mjs.map +1 -1
- package/dist/components/table/utils/table.d.ts +4 -4
- package/dist/components/table/utils/table.mjs +4 -4
- package/dist/components/table/utils/table.mjs.map +1 -1
- package/dist/components/tree/src/tree.d.ts +86 -86
- package/dist/components/tree/src/tree.mjs +46 -46
- package/dist/components/tree/src/tree.mjs.map +1 -1
- package/dist/components/treeSelect/src/treeSelect.d.ts +144 -150
- package/dist/components/treeSelect/src/treeSelect.mjs +55 -55
- package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -1
- package/dist/components/upload/src/upload.d.ts +36 -36
- package/dist/components/upload/src/upload.mjs +17 -17
- package/dist/components/upload/src/upload.mjs.map +1 -1
- package/dist/components/uploadImage/src/uploadImage.d.ts +47 -47
- package/dist/components/uploadImage/src/uploadImage.mjs +23 -23
- package/dist/components/uploadImage/src/uploadImage.mjs.map +1 -1
- package/dist/components/uploadImages/src/uploadImages.d.ts +41 -41
- package/dist/components/uploadImages/src/uploadImages.mjs +21 -21
- package/dist/components/uploadImages/src/uploadImages.mjs.map +1 -1
- package/dist/directives/click-debounce/index.mjs +19 -11
- package/dist/directives/click-debounce/index.mjs.map +1 -1
- package/dist/directives/click-throttle/index.d.ts +4 -2
- package/dist/directives/click-throttle/index.mjs +21 -11
- package/dist/directives/click-throttle/index.mjs.map +1 -1
- package/dist/index.global.min.js +3 -3
- package/dist/index.global.min.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/internal/props.d.ts +685 -0
- package/dist/internal/props.mjs +683 -0
- package/dist/internal/props.mjs.map +1 -0
- package/dist/utils/loading-tasks.d.ts +5 -0
- package/dist/utils/loading-tasks.mjs +32 -0
- package/dist/utils/loading-tasks.mjs.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +5 -10
|
@@ -8,32 +8,32 @@ import { formUtil } from "../utils/form.mjs";
|
|
|
8
8
|
import { computed, createVNode, defineComponent, mergeProps, provide, reactive, shallowRef } from "vue";
|
|
9
9
|
import { ElForm, formEmits, formProps, useGlobalSize } from "element-plus";
|
|
10
10
|
//#region src/components/form/src/form.tsx
|
|
11
|
-
/** FaForm 的运行时 Props
|
|
11
|
+
/** FaForm 的运行时 Props 定义 */
|
|
12
12
|
const faFormProps = {
|
|
13
13
|
...formProps,
|
|
14
|
-
/**
|
|
14
|
+
/** Width of label, e.g. `'50px'`. All its direct child form items will inherit this value. `auto` is supported. */
|
|
15
15
|
labelWidth: {
|
|
16
16
|
type: [String, Number],
|
|
17
17
|
default: "auto"
|
|
18
18
|
},
|
|
19
|
-
/**
|
|
19
|
+
/** Suffix of the label. */
|
|
20
20
|
labelSuffix: {
|
|
21
21
|
type: String,
|
|
22
22
|
default: ":"
|
|
23
23
|
},
|
|
24
|
-
/**
|
|
24
|
+
/** When validation fails, scroll to the first error form entry. */
|
|
25
25
|
scrollToError: {
|
|
26
26
|
type: Boolean,
|
|
27
27
|
default: true
|
|
28
28
|
},
|
|
29
|
-
/**
|
|
29
|
+
/** 详情From,会删除 FormItem 的 paddinfa-bottom */
|
|
30
30
|
detailForm: Boolean,
|
|
31
|
-
/**
|
|
31
|
+
/** Grid布局 */
|
|
32
32
|
grid: {
|
|
33
33
|
type: Boolean,
|
|
34
34
|
default: true
|
|
35
35
|
},
|
|
36
|
-
/**
|
|
36
|
+
/** Grid布局列配置 */
|
|
37
37
|
cols: {
|
|
38
38
|
type: definePropType([
|
|
39
39
|
String,
|
|
@@ -91,23 +91,23 @@ var form_default = defineComponent({
|
|
|
91
91
|
"cols": state.cols
|
|
92
92
|
}, { default: () => [slots.default?.(state)] }) : slots.default?.(state) }));
|
|
93
93
|
return useExpose(expose, {
|
|
94
|
-
/**
|
|
94
|
+
/** 对整个表单的内容进行验证。 接收一个回调函数,或返回 Promise。 */
|
|
95
95
|
validate: (callback) => callback ? formRef.value?.validate(callback) ?? Promise.reject(/* @__PURE__ */ new Error("ElForm 实例尚未挂载。")) : formUtil.validate(formRef),
|
|
96
|
-
/**
|
|
96
|
+
/** 验证具体的某个字段。 */
|
|
97
97
|
validateField: computed(() => formRef.value?.validateField),
|
|
98
|
-
/**
|
|
98
|
+
/** 重置该表单项,将其值重置为初始值,并移除校验结果 */
|
|
99
99
|
resetFields: computed(() => formRef.value?.resetFields),
|
|
100
|
-
/**
|
|
100
|
+
/** 清理某个字段的表单验证信息。 */
|
|
101
101
|
clearValidate: computed(() => formRef.value?.clearValidate),
|
|
102
|
-
/**
|
|
102
|
+
/** 滚动到指定的字段 */
|
|
103
103
|
scrollToField: computed(() => formRef.value?.scrollToField),
|
|
104
|
-
/**
|
|
104
|
+
/** 获取所有字段的 context */
|
|
105
105
|
fields: computed(() => formRef.value?.fields),
|
|
106
|
-
/**
|
|
106
|
+
/** 获取指定字段的 context。 */
|
|
107
107
|
getField: computed(() => formRef.value?.getField),
|
|
108
|
-
/**
|
|
108
|
+
/** 设置表单字段的初始值。 */
|
|
109
109
|
setInitialValues: computed(() => formRef.value?.setInitialValues),
|
|
110
|
-
/**
|
|
110
|
+
/** 对整个表单的内容进行验证,带滚动。 接收一个回调函数,或返回 Promise。 */
|
|
111
111
|
validateScrollToField: () => formUtil.validateScrollToField(formRef)
|
|
112
112
|
});
|
|
113
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.mjs","names":[],"sources":["../../../../src/components/form/src/form.tsx"],"sourcesContent":["import { computed, defineComponent, provide, reactive, shallowRef } from \"vue\";\nimport { ElForm, formEmits, formProps, useGlobalSize } from \"element-plus\";\nimport { definePropType, makeSlots, useEmits, useExpose, useProps, useRender } from \"../../../utils\";\nimport { FaLayoutGrid } from \"../../layoutGrid\";\nimport { formUtil } from \"../utils/form\";\nimport type { FormInstance, FormValidateCallback } from \"element-plus\";\nimport type { FaLayoutGridBreakpoint } from \"../../layoutGrid\";\n\n/** FaForm 的运行时 Props
|
|
1
|
+
{"version":3,"file":"form.mjs","names":[],"sources":["../../../../src/components/form/src/form.tsx"],"sourcesContent":["import { computed, defineComponent, provide, reactive, shallowRef } from \"vue\";\nimport { ElForm, formEmits, formProps, useGlobalSize } from \"element-plus\";\nimport { definePropType, makeSlots, useEmits, useExpose, useProps, useRender } from \"../../../utils\";\nimport { FaLayoutGrid } from \"../../layoutGrid\";\nimport { formUtil } from \"../utils/form\";\nimport type { FormInstance, FormValidateCallback } from \"element-plus\";\nimport type { FaLayoutGridBreakpoint } from \"../../layoutGrid\";\n\n/** FaForm 的运行时 Props 定义 */\nexport const faFormProps = {\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- Element Plus 2.x 尚未提供可替代的公开运行时 props 定义。\n\t...formProps,\n\t/** Width of label, e.g. `'50px'`. All its direct child form items will inherit this value. `auto` is supported. */\n\tlabelWidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"auto\",\n\t},\n\t/** Suffix of the label. */\n\tlabelSuffix: {\n\t\ttype: String,\n\t\tdefault: \":\",\n\t},\n\t/** When validation fails, scroll to the first error form entry. */\n\tscrollToError: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 详情From,会删除 FormItem 的 paddinfa-bottom */\n\tdetailForm: Boolean,\n\t/** Grid布局 */\n\tgrid: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** Grid布局列配置 */\n\tcols: {\n\t\ttype: definePropType<string | number | Record<FaLayoutGridBreakpoint, number>>([String, Number, Object]),\n\t\tdefault: () => ({ xs: 1, sm: 2, md: 3, lg: 4, xl: 5 }),\n\t},\n};\n\n/** FaForm 的运行时事件定义。 */\nexport const faFormEmits = {\n\t...formEmits,\n};\n\n/** FaForm 的插槽参数 */\nexport interface FaFormSlots extends Record<string, unknown> {\n\t/** 默认内容插槽 */\n\tdefault: { cols: Record<FaLayoutGridBreakpoint, number>; gap: [number, number] };\n}\n\nexport default defineComponent({\n\tname: \"FaForm\",\n\tprops: faFormProps,\n\temits: faFormEmits,\n\tslots: makeSlots<FaFormSlots>(),\n\tsetup(props, { slots, expose, emit }) {\n\t\tconst globalSize = useGlobalSize();\n\t\tconst formRef = shallowRef<FormInstance | null>(null);\n\n\t\tconst state = reactive({\n\t\t\tcols: computed(() => {\n\t\t\t\tif (typeof props.cols === \"object\" && props.cols !== null) {\n\t\t\t\t\treturn props.cols;\n\t\t\t\t} else {\n\t\t\t\t\tconst colsNumber = typeof props.cols === \"number\" ? props.cols : Number(props.cols);\n\t\t\t\t\treturn { xs: 1, sm: colsNumber, md: colsNumber, lg: colsNumber, xl: colsNumber };\n\t\t\t\t}\n\t\t\t}),\n\t\t\tgap: computed<[number, number]>(() => (globalSize.value === \"small\" ? [15, 0] : [20, 0])),\n\t\t});\n\n\t\t// 注入 cols\n\t\tprovide(\"faFormCols\", state.cols);\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 透传范围必须与继承的 Element Plus 2.x 运行时 props 保持一致。\n\t\tconst elFormProps = useProps(props, formProps);\n\t\tconst elFormEmits = useEmits(formEmits, emit);\n\n\t\tuseRender(() => (\n\t\t\t<ElForm\n\t\t\t\t{...elFormProps.value}\n\t\t\t\t{...elFormEmits.value}\n\t\t\t\tref={formRef}\n\t\t\t\tclass={[\"fa-form\", `fa-form-${globalSize.value}`, { [`fa-form-detail fa-form-detail_${globalSize.value}`]: props.detailForm }]}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\tprops.grid ? (\n\t\t\t\t\t\t\t<FaLayoutGrid collapsed gap={state.gap} cols={state.cols}>\n\t\t\t\t\t\t\t\t{slots.default?.(state)}\n\t\t\t\t\t\t\t</FaLayoutGrid>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tslots.default?.(state)\n\t\t\t\t\t\t),\n\t\t\t\t}}\n\t\t\t</ElForm>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** 对整个表单的内容进行验证。 接收一个回调函数,或返回 Promise。 */\n\t\t\tvalidate: (callback?: FormValidateCallback) =>\n\t\t\t\tcallback ? (formRef.value?.validate(callback) ?? Promise.reject(new Error(\"ElForm 实例尚未挂载。\"))) : formUtil.validate(formRef),\n\t\t\t/** 验证具体的某个字段。 */\n\t\t\tvalidateField: computed(() => formRef.value?.validateField),\n\t\t\t/** 重置该表单项,将其值重置为初始值,并移除校验结果 */\n\t\t\tresetFields: computed(() => formRef.value?.resetFields),\n\t\t\t/** 清理某个字段的表单验证信息。 */\n\t\t\tclearValidate: computed(() => formRef.value?.clearValidate),\n\t\t\t/** 滚动到指定的字段 */\n\t\t\tscrollToField: computed(() => formRef.value?.scrollToField),\n\t\t\t/** 获取所有字段的 context */\n\t\t\tfields: computed(() => formRef.value?.fields),\n\t\t\t/** 获取指定字段的 context。 */\n\t\t\tgetField: computed(() => formRef.value?.getField),\n\t\t\t/** 设置表单字段的初始值。 */\n\t\t\tsetInitialValues: computed(() => formRef.value?.setInitialValues),\n\t\t\t/** 对整个表单的内容进行验证,带滚动。 接收一个回调函数,或返回 Promise。 */\n\t\t\tvalidateScrollToField: () => formUtil.validateScrollToField(formRef),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;AASA,MAAa,cAAc;CAE1B,GAAG;;CAEH,YAAY;EACX,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,eAAe;EACd,MAAM;EACN,SAAS;CACV;;CAEA,YAAY;;CAEZ,MAAM;EACL,MAAM;EACN,SAAS;CACV;;CAEA,MAAM;EACL,MAAM,eAAyE;GAAC;GAAQ;GAAQ;EAAM,CAAC;EACvG,gBAAgB;GAAE,IAAI;GAAG,IAAI;GAAG,IAAI;GAAG,IAAI;GAAG,IAAI;EAAE;CACrD;AACD;;AAGA,MAAa,cAAc,EAC1B,GAAG,UACJ;AAQA,IAAA,eAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO;CACP,OAAO,UAAuB;CAC9B,MAAM,OAAO,EAAE,OAAO,QAAQ,QAAQ;EACrC,MAAM,aAAa,cAAc;EACjC,MAAM,UAAU,WAAgC,IAAI;EAEpD,MAAM,QAAQ,SAAS;GACtB,MAAM,eAAe;IACpB,IAAI,OAAO,MAAM,SAAS,YAAY,MAAM,SAAS,MACpD,OAAO,MAAM;SACP;KACN,MAAM,aAAa,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO,OAAO,MAAM,IAAI;KAClF,OAAO;MAAE,IAAI;MAAG,IAAI;MAAY,IAAI;MAAY,IAAI;MAAY,IAAI;KAAW;IAChF;GACD,CAAC;GACD,KAAK,eAAkC,WAAW,UAAU,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE;EACzF,CAAC;EAGD,QAAQ,cAAc,MAAM,IAAI;EAGhC,MAAM,cAAc,SAAS,OAAO,SAAS;EAC7C,MAAM,cAAc,SAAS,WAAW,IAAI;EAE5C,gBAAU,YAAA,QAAA,WAEJ,YAAY,OACZ,YAAY,OAAK;GAAA,OAChB;GAAO,SACL;IAAC;IAAW,WAAW,WAAW;IAAS,GAAG,iCAAiC,WAAW,UAAU,MAAM,WAAW;GAAC;EAAC,CAAA,GAAA,EAG7H,eACC,MAAM,OAAI,YAAA,cAAA;GAAA,aAAA;GAAA,OACoB,MAAM;GAAG,QAAQ,MAAM;EAAI,GAAA,EAAA,eAAA,CACtD,MAAM,UAAU,KAAK,CAAC,EAAA,CAAA,IAGxB,MAAM,UAAU,KAAK,EACrB,CAAA,CAGJ;EAED,OAAO,UAAU,QAAQ;;GAExB,WAAW,aACV,WAAY,QAAQ,OAAO,SAAS,QAAQ,KAAK,QAAQ,uBAAO,IAAI,MAAM,gBAAgB,CAAC,IAAK,SAAS,SAAS,OAAO;;GAE1H,eAAe,eAAe,QAAQ,OAAO,aAAa;;GAE1D,aAAa,eAAe,QAAQ,OAAO,WAAW;;GAEtD,eAAe,eAAe,QAAQ,OAAO,aAAa;;GAE1D,eAAe,eAAe,QAAQ,OAAO,aAAa;;GAE1D,QAAQ,eAAe,QAAQ,OAAO,MAAM;;GAE5C,UAAU,eAAe,QAAQ,OAAO,QAAQ;;GAEhD,kBAAkB,eAAe,QAAQ,OAAO,gBAAgB;;GAEhE,6BAA6B,SAAS,sBAAsB,OAAO;EACpE,CAAC;CACF;AACD,CAAC"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/** FaFormItem 的运行时 Props
|
|
1
|
+
/** FaFormItem 的运行时 Props 定义 */
|
|
2
2
|
export declare const faFormItemProps: {
|
|
3
|
-
/**
|
|
3
|
+
/** Label tips 提示 */
|
|
4
4
|
tips: StringConstructor;
|
|
5
|
-
/**
|
|
5
|
+
/** Grid 布局 */
|
|
6
6
|
grid: {
|
|
7
7
|
type: BooleanConstructor;
|
|
8
8
|
default: boolean;
|
|
9
9
|
};
|
|
10
|
-
/**
|
|
10
|
+
/** 偏移量 */
|
|
11
11
|
offset: {
|
|
12
12
|
type: (NumberConstructor | StringConstructor)[];
|
|
13
13
|
default: number;
|
|
14
14
|
};
|
|
15
|
-
/**
|
|
15
|
+
/** 栅格跨度 */
|
|
16
16
|
span: {
|
|
17
17
|
type: (NumberConstructor | StringConstructor)[];
|
|
18
18
|
};
|
|
19
|
-
/**
|
|
19
|
+
/** 独占一行。如果设置 span 则无效 */
|
|
20
20
|
row: BooleanConstructor;
|
|
21
21
|
label: StringConstructor;
|
|
22
22
|
labelWidth: {
|
|
@@ -34,7 +34,7 @@ export declare const faFormItemProps: {
|
|
|
34
34
|
};
|
|
35
35
|
required: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
36
36
|
rules: {
|
|
37
|
-
readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemRule>) | (((new (...
|
|
37
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemRule>) | (((new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemRule>)) | null)[], unknown, unknown>>;
|
|
38
38
|
readonly required: false;
|
|
39
39
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
40
40
|
__epPropKey: true;
|
|
@@ -56,37 +56,37 @@ export declare const faFormItemProps: {
|
|
|
56
56
|
__epPropKey: true;
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
|
-
/** FaFormItem
|
|
59
|
+
/** FaFormItem 的插槽参数 */
|
|
60
60
|
export interface FaFormItemSlots extends Record<string, unknown> {
|
|
61
|
-
/**
|
|
61
|
+
/** 默认内容插槽 */
|
|
62
62
|
default: never;
|
|
63
|
-
/**
|
|
63
|
+
/** 标签位置显示的内容 */
|
|
64
64
|
label: {
|
|
65
65
|
label: string;
|
|
66
66
|
};
|
|
67
|
-
/**
|
|
67
|
+
/** 验证错误信息的显示内容 */
|
|
68
68
|
error: {
|
|
69
69
|
error: string;
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
73
|
-
/**
|
|
73
|
+
/** Label tips 提示 */
|
|
74
74
|
tips: StringConstructor;
|
|
75
|
-
/**
|
|
75
|
+
/** Grid 布局 */
|
|
76
76
|
grid: {
|
|
77
77
|
type: BooleanConstructor;
|
|
78
78
|
default: boolean;
|
|
79
79
|
};
|
|
80
|
-
/**
|
|
80
|
+
/** 偏移量 */
|
|
81
81
|
offset: {
|
|
82
82
|
type: (NumberConstructor | StringConstructor)[];
|
|
83
83
|
default: number;
|
|
84
84
|
};
|
|
85
|
-
/**
|
|
85
|
+
/** 栅格跨度 */
|
|
86
86
|
span: {
|
|
87
87
|
type: (NumberConstructor | StringConstructor)[];
|
|
88
88
|
};
|
|
89
|
-
/**
|
|
89
|
+
/** 独占一行。如果设置 span 则无效 */
|
|
90
90
|
row: BooleanConstructor;
|
|
91
91
|
label: StringConstructor;
|
|
92
92
|
labelWidth: {
|
|
@@ -104,7 +104,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
104
104
|
};
|
|
105
105
|
required: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
106
106
|
rules: {
|
|
107
|
-
readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemRule>) | (((new (...
|
|
107
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemRule>) | (((new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemRule>)) | null)[], unknown, unknown>>;
|
|
108
108
|
readonly required: false;
|
|
109
109
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
110
110
|
__epPropKey: true;
|
|
@@ -126,38 +126,38 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
126
126
|
__epPropKey: true;
|
|
127
127
|
};
|
|
128
128
|
}>, {
|
|
129
|
-
/**
|
|
129
|
+
/** 表单项大小 */
|
|
130
130
|
size: import("vue").ComputedRef<"" | "small" | "default" | "large" | undefined>;
|
|
131
|
-
/**
|
|
131
|
+
/** 校验消息 */
|
|
132
132
|
validateMessage: import("vue").ComputedRef<string | undefined>;
|
|
133
|
-
/**
|
|
133
|
+
/** 校验状态 */
|
|
134
134
|
validateState: import("vue").ComputedRef<"" | "error" | "success" | "validating" | undefined>;
|
|
135
|
-
/**
|
|
135
|
+
/** 验证表单项 */
|
|
136
136
|
validate: import("vue").ComputedRef<((trigger: string, callback?: import("element-plus").FormValidateCallback) => import("element-plus").FormValidationResult) | undefined>;
|
|
137
|
-
/**
|
|
137
|
+
/** 移除该表单项的校验结果 */
|
|
138
138
|
clearValidate: import("vue").ComputedRef<(() => void) | undefined>;
|
|
139
|
-
/**
|
|
139
|
+
/** 对该表单项进行重置,将其值重置为初始值并移除校验结果 */
|
|
140
140
|
resetField: import("vue").ComputedRef<(() => void) | undefined>;
|
|
141
|
-
/**
|
|
141
|
+
/** 设置该表单项的初始值。 */
|
|
142
142
|
setInitialValue: import("vue").ComputedRef<((value: any) => void) | undefined>;
|
|
143
143
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
144
|
-
/**
|
|
144
|
+
/** Label tips 提示 */
|
|
145
145
|
tips: StringConstructor;
|
|
146
|
-
/**
|
|
146
|
+
/** Grid 布局 */
|
|
147
147
|
grid: {
|
|
148
148
|
type: BooleanConstructor;
|
|
149
149
|
default: boolean;
|
|
150
150
|
};
|
|
151
|
-
/**
|
|
151
|
+
/** 偏移量 */
|
|
152
152
|
offset: {
|
|
153
153
|
type: (NumberConstructor | StringConstructor)[];
|
|
154
154
|
default: number;
|
|
155
155
|
};
|
|
156
|
-
/**
|
|
156
|
+
/** 栅格跨度 */
|
|
157
157
|
span: {
|
|
158
158
|
type: (NumberConstructor | StringConstructor)[];
|
|
159
159
|
};
|
|
160
|
-
/**
|
|
160
|
+
/** 独占一行。如果设置 span 则无效 */
|
|
161
161
|
row: BooleanConstructor;
|
|
162
162
|
label: StringConstructor;
|
|
163
163
|
labelWidth: {
|
|
@@ -175,7 +175,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
175
175
|
};
|
|
176
176
|
required: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
177
177
|
rules: {
|
|
178
|
-
readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemRule>) | (((new (...
|
|
178
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemRule>) | (((new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemRule>)) | null)[], unknown, unknown>>;
|
|
179
179
|
readonly required: false;
|
|
180
180
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
181
181
|
__epPropKey: true;
|
|
@@ -7,24 +7,24 @@ import { FaFormItemTip } from "../../formItemTip/index.mjs";
|
|
|
7
7
|
import { Fragment, computed, createVNode, defineComponent, inject, mergeProps, ref, shallowRef } from "vue";
|
|
8
8
|
import { ElFormItem, formItemProps } from "element-plus";
|
|
9
9
|
//#region src/components/form/src/formItem.tsx
|
|
10
|
-
/** FaFormItem 的运行时 Props
|
|
10
|
+
/** FaFormItem 的运行时 Props 定义 */
|
|
11
11
|
const faFormItemProps = {
|
|
12
12
|
...formItemProps,
|
|
13
|
-
/**
|
|
13
|
+
/** Label tips 提示 */
|
|
14
14
|
tips: String,
|
|
15
|
-
/**
|
|
15
|
+
/** Grid 布局 */
|
|
16
16
|
grid: {
|
|
17
17
|
type: Boolean,
|
|
18
18
|
default: true
|
|
19
19
|
},
|
|
20
|
-
/**
|
|
20
|
+
/** 偏移量 */
|
|
21
21
|
offset: {
|
|
22
22
|
type: [String, Number],
|
|
23
23
|
default: 0
|
|
24
24
|
},
|
|
25
|
-
/**
|
|
25
|
+
/** 栅格跨度 */
|
|
26
26
|
span: { type: [String, Number] },
|
|
27
|
-
/**
|
|
27
|
+
/** 独占一行。如果设置 span 则无效 */
|
|
28
28
|
row: Boolean
|
|
29
29
|
};
|
|
30
30
|
var formItem_default = defineComponent({
|
|
@@ -64,19 +64,19 @@ var formItem_default = defineComponent({
|
|
|
64
64
|
})] });
|
|
65
65
|
});
|
|
66
66
|
return useExpose(expose, {
|
|
67
|
-
/**
|
|
67
|
+
/** 表单项大小 */
|
|
68
68
|
size: computed(() => formItemRef.value?.size),
|
|
69
|
-
/**
|
|
69
|
+
/** 校验消息 */
|
|
70
70
|
validateMessage: computed(() => formItemRef.value?.validateMessage),
|
|
71
|
-
/**
|
|
71
|
+
/** 校验状态 */
|
|
72
72
|
validateState: computed(() => formItemRef.value?.validateState),
|
|
73
|
-
/**
|
|
73
|
+
/** 验证表单项 */
|
|
74
74
|
validate: computed(() => formItemRef.value?.validate),
|
|
75
|
-
/**
|
|
75
|
+
/** 移除该表单项的校验结果 */
|
|
76
76
|
clearValidate: computed(() => formItemRef.value?.clearValidate),
|
|
77
|
-
/**
|
|
77
|
+
/** 对该表单项进行重置,将其值重置为初始值并移除校验结果 */
|
|
78
78
|
resetField: computed(() => formItemRef.value?.resetField),
|
|
79
|
-
/**
|
|
79
|
+
/** 设置该表单项的初始值。 */
|
|
80
80
|
setInitialValue: computed(() => formItemRef.value?.setInitialValue)
|
|
81
81
|
});
|
|
82
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formItem.mjs","names":[],"sources":["../../../../src/components/form/src/formItem.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, inject, ref, shallowRef } from \"vue\";\nimport { ElFormItem, formItemProps } from \"element-plus\";\nimport { makeSlots, useExpose, useProps, useRender } from \"../../../utils\";\nimport { FaFormItemTip } from \"../../formItemTip\";\nimport { FaLayoutGridItem } from \"../../layoutGrid\";\nimport type { FormItemInstance } from \"element-plus\";\nimport type { Ref } from \"vue\";\n\n/** FaFormItem 的运行时 Props
|
|
1
|
+
{"version":3,"file":"formItem.mjs","names":[],"sources":["../../../../src/components/form/src/formItem.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, inject, ref, shallowRef } from \"vue\";\nimport { ElFormItem, formItemProps } from \"element-plus\";\nimport { makeSlots, useExpose, useProps, useRender } from \"../../../utils\";\nimport { FaFormItemTip } from \"../../formItemTip\";\nimport { FaLayoutGridItem } from \"../../layoutGrid\";\nimport type { FormItemInstance } from \"element-plus\";\nimport type { Ref } from \"vue\";\n\n/** FaFormItem 的运行时 Props 定义 */\nexport const faFormItemProps = {\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- Element Plus 2.x 尚未提供可替代的公开运行时 props 定义。\n\t...formItemProps,\n\t/** Label tips 提示 */\n\ttips: String,\n\t/** Grid 布局 */\n\tgrid: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 偏移量 */\n\toffset: {\n\t\ttype: [String, Number],\n\t\tdefault: 0,\n\t},\n\t/** 栅格跨度 */\n\tspan: {\n\t\ttype: [String, Number],\n\t},\n\t/** 独占一行。如果设置 span 则无效 */\n\trow: Boolean,\n};\n\n/** FaFormItem 的插槽参数 */\nexport interface FaFormItemSlots extends Record<string, unknown> {\n\t/** 默认内容插槽 */\n\tdefault: never;\n\t/** 标签位置显示的内容 */\n\tlabel: { label: string };\n\t/** 验证错误信息的显示内容 */\n\terror: { error: string };\n}\n\nexport default defineComponent({\n\tname: \"FaFormItem\",\n\tprops: faFormItemProps,\n\tslots: makeSlots<FaFormItemSlots>(),\n\tsetup(props, { slots, expose }) {\n\t\tconst formItemRef = shallowRef<FormItemInstance | null>(null);\n\n\t\tconst cols = inject<Ref<number>>(\"cols\", ref(4));\n\n\t\t// 获取响应式设置\n\t\tconst getResponsive = () => {\n\t\t\tif (!props.grid) return {};\n\t\t\tif (props.span) {\n\t\t\t\treturn {\n\t\t\t\t\tspan: typeof props.span === \"number\" ? props.span : Number(props.span),\n\t\t\t\t\toffset: typeof props.offset === \"number\" ? props.offset : Number(props.offset),\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst result = {\n\t\t\t\t\tspan: 1,\n\t\t\t\t\toffset: typeof props.offset === \"number\" ? props.offset : Number(props.offset),\n\t\t\t\t};\n\t\t\t\tif (props.row) {\n\t\t\t\t\tresult.span = cols.value;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 透传范围必须与继承的 Element Plus 2.x 运行时 props 保持一致。\n\t\tconst elFormItemProps = useProps(props, formItemProps);\n\n\t\tuseRender(() => {\n\t\t\tconst FormItemWrapper = props.grid ? FaLayoutGridItem : Fragment;\n\t\t\treturn (\n\t\t\t\t<FormItemWrapper {...getResponsive()}>\n\t\t\t\t\t<ElFormItem ref={formItemRef} {...elFormItemProps.value}>\n\t\t\t\t\t\t{{\n\t\t\t\t\t\t\tdefault: () => slots.default?.() ?? [],\n\t\t\t\t\t\t\t...(slots.label && !props.tips && { label: ({ label }: { label: string }) => slots.label?.({ label }) ?? [] }),\n\t\t\t\t\t\t\t...(slots.label &&\n\t\t\t\t\t\t\t\tprops.tips && {\n\t\t\t\t\t\t\t\t\tlabel: ({ label }: { label: string }) => [\n\t\t\t\t\t\t\t\t\t\t<FaFormItemTip>\n\t\t\t\t\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: () => slots.label?.({ label }) ?? [],\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t</FaFormItemTip>,\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t...(!slots.label &&\n\t\t\t\t\t\t\t\tprops.tips && {\n\t\t\t\t\t\t\t\t\tlabel: ({ label }: { label?: string }) => [<FaFormItemTip label={label ?? props.label} tips={props.tips} />],\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t...(slots.error && { error: ({ error }: { error: string }) => slots.error?.({ error }) ?? [] }),\n\t\t\t\t\t\t}}\n\t\t\t\t\t</ElFormItem>\n\t\t\t\t</FormItemWrapper>\n\t\t\t);\n\t\t});\n\n\t\treturn useExpose(expose, {\n\t\t\t/** 表单项大小 */\n\t\t\tsize: computed(() => formItemRef.value?.size),\n\t\t\t/** 校验消息 */\n\t\t\tvalidateMessage: computed(() => formItemRef.value?.validateMessage),\n\t\t\t/** 校验状态 */\n\t\t\tvalidateState: computed(() => formItemRef.value?.validateState),\n\t\t\t/** 验证表单项 */\n\t\t\tvalidate: computed(() => formItemRef.value?.validate),\n\t\t\t/** 移除该表单项的校验结果 */\n\t\t\tclearValidate: computed(() => formItemRef.value?.clearValidate),\n\t\t\t/** 对该表单项进行重置,将其值重置为初始值并移除校验结果 */\n\t\t\tresetField: computed(() => formItemRef.value?.resetField),\n\t\t\t/** 设置该表单项的初始值。 */\n\t\t\tsetInitialValue: computed(() => formItemRef.value?.setInitialValue),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;AASA,MAAa,kBAAkB;CAE9B,GAAG;;CAEH,MAAM;;CAEN,MAAM;EACL,MAAM;EACN,SAAS;CACV;;CAEA,QAAQ;EACP,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,MAAM,EACL,MAAM,CAAC,QAAQ,MAAM,EACtB;;CAEA,KAAK;AACN;AAYA,IAAA,mBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO,UAA2B;CAClC,MAAM,OAAO,EAAE,OAAO,UAAU;EAC/B,MAAM,cAAc,WAAoC,IAAI;EAE5D,MAAM,OAAO,OAAoB,QAAQ,IAAI,CAAC,CAAC;EAG/C,MAAM,sBAAsB;GAC3B,IAAI,CAAC,MAAM,MAAM,OAAO,CAAC;GACzB,IAAI,MAAM,MACT,OAAO;IACN,MAAM,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO,OAAO,MAAM,IAAI;IACrE,QAAQ,OAAO,MAAM,WAAW,WAAW,MAAM,SAAS,OAAO,MAAM,MAAM;GAC9E;QACM;IACN,MAAM,SAAS;KACd,MAAM;KACN,QAAQ,OAAO,MAAM,WAAW,WAAW,MAAM,SAAS,OAAO,MAAM,MAAM;IAC9E;IACA,IAAI,MAAM,KACT,OAAO,OAAO,KAAK;IAEpB,OAAO;GACR;EACD;EAGA,MAAM,kBAAkB,SAAS,OAAO,aAAa;EAErD,gBAAgB;GACf,MAAM,kBAAkB,MAAM,OAAO,mBAAmB;GACxD,OAAA,YAAA,iBACsB,cAAc,GAAC,EAAA,eAAA,CAAA,YAAA,YAAA,WAAA,EAAA,OAClB,YAAW,GAAM,gBAAgB,KAAK,GAAA;IAErD,eAAe,MAAM,UAAU,KAAK,CAAA;IACpC,GAAI,MAAM,SAAS,CAAC,MAAM,QAAQ,EAAE,QAAQ,EAAE,YAA+B,MAAM,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAA,EAAG;IAC5G,GAAI,MAAM,SACT,MAAM,QAAQ,EACb,QAAQ,EAAE,YAA+B,CAAA,YAAA,eAAA,MAAA,EAGtC,aAAa,MAAM,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAA,EAAE,CAAA,CAAA,EAI/C;IACD,GAAI,CAAC,MAAM,SACV,MAAM,QAAQ,EACb,QAAQ,EAAE,YAAgC,CAAA,YAAA,eAAA;KAAA,SAAuB,SAAS,MAAM;KAAK,QAAQ,MAAM;IAAI,GAAA,IAAA,CAAA,EACxG;IACD,GAAI,MAAM,SAAS,EAAE,QAAQ,EAAE,YAA+B,MAAM,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAA,EAAG;GAAE,CAAA,CAAA,EAAA,CAAA;EAKpG,CAAC;EAED,OAAO,UAAU,QAAQ;;GAExB,MAAM,eAAe,YAAY,OAAO,IAAI;;GAE5C,iBAAiB,eAAe,YAAY,OAAO,eAAe;;GAElE,eAAe,eAAe,YAAY,OAAO,aAAa;;GAE9D,UAAU,eAAe,YAAY,OAAO,QAAQ;;GAEpD,eAAe,eAAe,YAAY,OAAO,aAAa;;GAE9D,YAAY,eAAe,YAAY,OAAO,UAAU;;GAExD,iBAAiB,eAAe,YAAY,OAAO,eAAe;EACnE,CAAC;CACF;AACD,CAAC"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/** FaFormItemTip 的运行时 Props
|
|
1
|
+
/** FaFormItemTip 的运行时 Props 定义 */
|
|
2
2
|
export declare const faFormItemTipProps: {
|
|
3
|
-
/**
|
|
3
|
+
/** 提示 */
|
|
4
4
|
tips: StringConstructor;
|
|
5
|
-
/**
|
|
5
|
+
/** 显示 */
|
|
6
6
|
label: StringConstructor;
|
|
7
7
|
};
|
|
8
|
-
/** FaFormItemTip
|
|
8
|
+
/** FaFormItemTip 的插槽参数 */
|
|
9
9
|
export interface FaFormItemTipSlots extends Record<string, unknown> {
|
|
10
|
-
/**
|
|
10
|
+
/** 显示插槽 */
|
|
11
11
|
label: never;
|
|
12
12
|
}
|
|
13
13
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
14
|
-
/**
|
|
14
|
+
/** 提示 */
|
|
15
15
|
tips: StringConstructor;
|
|
16
|
-
/**
|
|
16
|
+
/** 显示 */
|
|
17
17
|
label: StringConstructor;
|
|
18
18
|
}>, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
-
/**
|
|
19
|
+
/** 提示 */
|
|
20
20
|
tips: StringConstructor;
|
|
21
|
-
/**
|
|
21
|
+
/** 显示 */
|
|
22
22
|
label: StringConstructor;
|
|
23
23
|
}>> & Readonly<{}>, {}, import("../../../utils").TypedSlotsDeclaration<FaFormItemTipSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
24
24
|
export default _default;
|
|
@@ -4,11 +4,11 @@ import { createVNode, defineComponent } from "vue";
|
|
|
4
4
|
import { QuestionFilled } from "@element-plus/icons-vue";
|
|
5
5
|
import { ElIcon, ElTooltip } from "element-plus";
|
|
6
6
|
//#region src/components/formItemTip/src/formItemTip.tsx
|
|
7
|
-
/** FaFormItemTip 的运行时 Props
|
|
7
|
+
/** FaFormItemTip 的运行时 Props 定义 */
|
|
8
8
|
const faFormItemTipProps = {
|
|
9
|
-
/**
|
|
9
|
+
/** 提示 */
|
|
10
10
|
tips: String,
|
|
11
|
-
/**
|
|
11
|
+
/** 显示 */
|
|
12
12
|
label: String
|
|
13
13
|
};
|
|
14
14
|
var formItemTip_default = defineComponent({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formItemTip.mjs","names":[],"sources":["../../../../src/components/formItemTip/src/formItemTip.tsx"],"sourcesContent":["import { defineComponent } from \"vue\";\nimport { QuestionFilled } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElTooltip } from \"element-plus\";\nimport { makeSlots, useRender } from \"../../../utils\";\n\n/** FaFormItemTip 的运行时 Props
|
|
1
|
+
{"version":3,"file":"formItemTip.mjs","names":[],"sources":["../../../../src/components/formItemTip/src/formItemTip.tsx"],"sourcesContent":["import { defineComponent } from \"vue\";\nimport { QuestionFilled } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElTooltip } from \"element-plus\";\nimport { makeSlots, useRender } from \"../../../utils\";\n\n/** FaFormItemTip 的运行时 Props 定义 */\nexport const faFormItemTipProps = {\n\t/** 提示 */\n\ttips: String,\n\t/** 显示 */\n\tlabel: String,\n};\n\n/** FaFormItemTip 的插槽参数 */\nexport interface FaFormItemTipSlots extends Record<string, unknown> {\n\t/** 显示插槽 */\n\tlabel: never;\n}\n\nexport default defineComponent({\n\tname: \"FaFormItemTip\",\n\tprops: faFormItemTipProps,\n\tslots: makeSlots<FaFormItemTipSlots>(),\n\tsetup(props, { slots }) {\n\t\tuseRender(() => (\n\t\t\t<div class=\"fa-form-item-tip\">\n\t\t\t\t<ElTooltip effect=\"dark\" rawContent content={props.tips} placement=\"top\">\n\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t<QuestionFilled />\n\t\t\t\t\t</ElIcon>\n\t\t\t\t</ElTooltip>\n\t\t\t\t<span class=\"fa-form-item-tip__label\">{slots.label ? slots.label() : props.label}</span>\n\t\t\t</div>\n\t\t));\n\t},\n});\n"],"mappings":";;;;;;;AAMA,MAAa,qBAAqB;;CAEjC,MAAM;;CAEN,OAAO;AACR;AAQA,IAAA,sBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO,UAA8B;CACrC,MAAM,OAAO,EAAE,SAAS;EACvB,gBAAU,YAAA,OAAA,EAAA,SAAA,mBAAA,GAAA,CAAA,YAAA,WAAA;GAAA,UAAA;GAAA,cAAA;GAAA,WAEqC,MAAM;GAAI,aAAA;EAAA,GAAA,EAAA,eAAA,CAAA,YAAA,QAAA,MAAA,EAAA,eAAA,CAAA,YAAA,gBAAA,MAAA,IAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,GAAA,YAAA,QAAA,EAAA,SAAA,0BAAA,GAAA,CAKhB,MAAM,QAAQ,MAAM,MAAM,IAAI,MAAM,KAAK,CAAA,CAAA,CAAA,CAEjF;CACF;AACD,CAAC"}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
/** FaIcon 的运行时 Props
|
|
1
|
+
/** FaIcon 的运行时 Props 定义 */
|
|
2
2
|
export declare const faIconProps: {
|
|
3
|
-
/**
|
|
3
|
+
/** el-icon- 使用 El-icon 的图标;fa-icon 使用 Fast 图标组件库; */
|
|
4
4
|
name: {
|
|
5
5
|
type: StringConstructor;
|
|
6
6
|
required: true;
|
|
7
7
|
};
|
|
8
|
-
/**
|
|
8
|
+
/** 大小 */
|
|
9
9
|
size: {
|
|
10
10
|
type: (NumberConstructor | StringConstructor)[];
|
|
11
11
|
};
|
|
12
|
-
/**
|
|
12
|
+
/** 颜色 */
|
|
13
13
|
color: StringConstructor;
|
|
14
14
|
};
|
|
15
15
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
16
|
-
/**
|
|
16
|
+
/** el-icon- 使用 El-icon 的图标;fa-icon 使用 Fast 图标组件库; */
|
|
17
17
|
name: {
|
|
18
18
|
type: StringConstructor;
|
|
19
19
|
required: true;
|
|
20
20
|
};
|
|
21
|
-
/**
|
|
21
|
+
/** 大小 */
|
|
22
22
|
size: {
|
|
23
23
|
type: (NumberConstructor | StringConstructor)[];
|
|
24
24
|
};
|
|
25
|
-
/**
|
|
25
|
+
/** 颜色 */
|
|
26
26
|
color: StringConstructor;
|
|
27
27
|
}>, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
|
-
/**
|
|
28
|
+
/** el-icon- 使用 El-icon 的图标;fa-icon 使用 Fast 图标组件库; */
|
|
29
29
|
name: {
|
|
30
30
|
type: StringConstructor;
|
|
31
31
|
required: true;
|
|
32
32
|
};
|
|
33
|
-
/**
|
|
33
|
+
/** 大小 */
|
|
34
34
|
size: {
|
|
35
35
|
type: (NumberConstructor | StringConstructor)[];
|
|
36
36
|
};
|
|
37
|
-
/**
|
|
37
|
+
/** 颜色 */
|
|
38
38
|
color: StringConstructor;
|
|
39
39
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
40
40
|
export default _default;
|
|
@@ -4,19 +4,19 @@ import { RegExps } from "../../../constants/regex.mjs";
|
|
|
4
4
|
import { computed, createVNode, defineComponent, h, isVNode, mergeProps, reactive, resolveComponent } from "vue";
|
|
5
5
|
import { ElIcon } from "element-plus";
|
|
6
6
|
//#region src/components/icon/src/icon.tsx
|
|
7
|
-
/** FaIcon 的运行时 Props
|
|
7
|
+
/** FaIcon 的运行时 Props 定义 */
|
|
8
8
|
function _isSlot(s) {
|
|
9
9
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
10
10
|
}
|
|
11
11
|
const faIconProps = {
|
|
12
|
-
/**
|
|
12
|
+
/** el-icon- 使用 El-icon 的图标;fa-icon 使用 Fast 图标组件库; */
|
|
13
13
|
name: {
|
|
14
14
|
type: String,
|
|
15
15
|
required: true
|
|
16
16
|
},
|
|
17
|
-
/**
|
|
17
|
+
/** 大小 */
|
|
18
18
|
size: { type: [String, Number] },
|
|
19
|
-
/**
|
|
19
|
+
/** 颜色 */
|
|
20
20
|
color: String
|
|
21
21
|
};
|
|
22
22
|
var icon_default = defineComponent({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.mjs","names":[],"sources":["../../../../src/components/icon/src/icon.tsx"],"sourcesContent":["import { computed, defineComponent, h, reactive, resolveComponent } from \"vue\";\nimport { ElIcon } from \"element-plus\";\nimport { RegExps } from \"../../../constants\";\nimport { addCssUnit, useRender } from \"../../../utils\";\nimport type { CSSProperties, ComponentObjectPropsOptions } from \"vue\";\n\n/** FaIcon 的运行时 Props
|
|
1
|
+
{"version":3,"file":"icon.mjs","names":[],"sources":["../../../../src/components/icon/src/icon.tsx"],"sourcesContent":["import { computed, defineComponent, h, reactive, resolveComponent } from \"vue\";\nimport { ElIcon } from \"element-plus\";\nimport { RegExps } from \"../../../constants\";\nimport { addCssUnit, useRender } from \"../../../utils\";\nimport type { CSSProperties, ComponentObjectPropsOptions } from \"vue\";\n\n/** FaIcon 的运行时 Props 定义 */\nexport const faIconProps = {\n\t/** el-icon- 使用 El-icon 的图标;fa-icon 使用 Fast 图标组件库; */\n\tname: {\n\t\ttype: String,\n\t\trequired: true,\n\t},\n\t/** 大小 */\n\tsize: {\n\t\ttype: [String, Number],\n\t},\n\t/** 颜色 */\n\tcolor: String,\n} satisfies ComponentObjectPropsOptions;\n\nexport default defineComponent({\n\tname: \"FaIcon\",\n\tprops: faIconProps,\n\tsetup(props, { attrs }) {\n\t\tconst state = reactive({\n\t\t\tisUrl: computed(() => RegExps.External.test(props.name)),\n\t\t\tstyle: computed(() => {\n\t\t\t\tconst result: CSSProperties & { \"-webkit-mask\"?: string } = {};\n\t\t\t\tif (props.size) {\n\t\t\t\t\tresult.fontSize = addCssUnit(props.size);\n\t\t\t\t}\n\t\t\t\tif (props.color) {\n\t\t\t\t\tresult.color = props.color;\n\t\t\t\t}\n\t\t\t\tif (state.isUrl) {\n\t\t\t\t\tresult.mask = `url(${props.name}) no-repeat 50% 50%`;\n\t\t\t\t\tresult[\"-webkit-mask\"] = `url(${props.name}) no-repeat 50% 50%`;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}),\n\t\t});\n\n\t\tuseRender(() =>\n\t\t\tprops.name.startsWith(\"el-icon-\") ? (\n\t\t\t\t<ElIcon {...attrs} {...props} class={[\"fa-icon\", props.name]}>\n\t\t\t\t\t{h(resolveComponent(props.name))}\n\t\t\t\t</ElIcon>\n\t\t\t) : props.name.startsWith(\"fa-icon\") ? (\n\t\t\t\t<ElIcon {...attrs} {...props} class={[\"fa-icon\", props.name]}>\n\t\t\t\t\t{h(resolveComponent(props.name))}\n\t\t\t\t</ElIcon>\n\t\t\t) : state.isUrl ? (\n\t\t\t\t<div {...attrs} class=\"el-icon fa-icon url-icon\" style={state.style} />\n\t\t\t) : (\n\t\t\t\t<i {...attrs} class={[\"el-icon fa-icon\", props.name]} style={state.style} />\n\t\t\t)\n\t\t);\n\t},\n});\n"],"mappings":";;;;;;;AAMA,SAAA,QAAA,GAAA;CAAA,OAAA,OAAA,MAAA,cAAA,OAAA,UAAA,SAAA,KAAA,CAAA,MAAA,qBAAA,CAAA,QAAA,CAAA;AAAA;AACA,MAAa,cAAc;;CAE1B,MAAM;EACL,MAAM;EACN,UAAU;CACX;;CAEA,MAAM,EACL,MAAM,CAAC,QAAQ,MAAM,EACtB;;CAEA,OAAO;AACR;AAEA,IAAA,eAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,MAAM,OAAO,EAAE,SAAS;EACvB,MAAM,QAAQ,SAAS;GACtB,OAAO,eAAe,QAAQ,SAAS,KAAK,MAAM,IAAI,CAAC;GACvD,OAAO,eAAe;IACrB,MAAM,SAAsD,CAAC;IAC7D,IAAI,MAAM,MACT,OAAO,WAAW,WAAW,MAAM,IAAI;IAExC,IAAI,MAAM,OACT,OAAO,QAAQ,MAAM;IAEtB,IAAI,MAAM,OAAO;KAChB,OAAO,OAAO,OAAO,MAAM,KAAI;KAC/B,OAAO,kBAAkB,OAAO,MAAM,KAAI;IAC3C;IACA,OAAO;GACR,CAAC;EACF,CAAC;EAED,gBAAU;GAAA,IAAA,OAAA;GAAA,OACT,MAAM,KAAK,WAAW,UAAU,IAAC,YAAA,QAAA,WACpB,OAAW,OAAK,EAAA,SAAS,CAAC,WAAW,MAAM,IAAI,EAAC,CAAA,GAAA,QAAA,QAC1D,EAAE,iBAAiB,MAAM,IAAI,CAAC,CAAC,IAAA,QAAA,EAAA,eAAA,CAAA,KAAA,EAAA,CAAA,IAE9B,MAAM,KAAK,WAAW,SAAS,IAAC,YAAA,QAAA,WACvB,OAAW,OAAK,EAAA,SAAS,CAAC,WAAW,MAAM,IAAI,EAAC,CAAA,GAAA,QAAA,SAC1D,EAAE,iBAAiB,MAAM,IAAI,CAAC,CAAC,IAAA,SAAA,EAAA,eAAA,CAAA,MAAA,EAAA,CAAA,IAE9B,MAAM,QAAK,YAAA,OAAA,WACL,OAAK;IAAA,SAAA;IAAA,SAA0C,MAAM;GAAK,CAAA,GAAA,IAAA,IAAA,YAAA,KAAA,WAE5D,OAAK;IAAA,SAAS,CAAC,mBAAmB,MAAM,IAAI;IAAC,SAAS,MAAM;GAAK,CAAA,GAAA,IAAA;EACxE,CACF;CACD;AACD,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { PropType } from "vue";
|
|
2
2
|
type IconType = "ele" | "fastEle" | "local";
|
|
3
3
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
-
/**
|
|
4
|
+
/** v-model 绑定值 */
|
|
5
5
|
modelValue: PropType<string | null>;
|
|
6
|
-
/**
|
|
6
|
+
/** 自定义图标 */
|
|
7
7
|
customIcons: {
|
|
8
8
|
type: PropType<string[]>;
|
|
9
9
|
default: () => never[];
|
|
@@ -14,14 +14,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
14
14
|
/** 当前选中的图标名称。 */
|
|
15
15
|
value: import("vue").ComputedRef<string | null>;
|
|
16
16
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
-
/**
|
|
17
|
+
/** v-model 回调 */
|
|
18
18
|
"update:modelValue": (value: string | null) => boolean;
|
|
19
|
-
/**
|
|
19
|
+
/** 改变 */
|
|
20
20
|
change: (value: string | null) => boolean;
|
|
21
21
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
-
/**
|
|
22
|
+
/** v-model 绑定值 */
|
|
23
23
|
modelValue: PropType<string | null>;
|
|
24
|
-
/**
|
|
24
|
+
/** 自定义图标 */
|
|
25
25
|
customIcons: {
|
|
26
26
|
type: PropType<string[]>;
|
|
27
27
|
default: () => never[];
|
|
@@ -15,18 +15,18 @@ function _isSlot(s) {
|
|
|
15
15
|
var iconSelector_default = defineComponent({
|
|
16
16
|
name: "FaIconSelector",
|
|
17
17
|
props: {
|
|
18
|
-
/**
|
|
18
|
+
/** v-model 绑定值 */
|
|
19
19
|
modelValue: String,
|
|
20
|
-
/**
|
|
20
|
+
/** 自定义图标 */
|
|
21
21
|
customIcons: {
|
|
22
22
|
type: definePropType(Array),
|
|
23
23
|
default: () => []
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
emits: {
|
|
27
|
-
/**
|
|
27
|
+
/** v-model 回调 */
|
|
28
28
|
"update:modelValue": (value) => typeof value === "string" || value === null,
|
|
29
|
-
/**
|
|
29
|
+
/** 改变 */
|
|
30
30
|
change: (value) => typeof value === "string" || value === null
|
|
31
31
|
},
|
|
32
32
|
setup(props, { emit, expose }) {
|