chore: trim unused form adapter components
This commit is contained in:
@@ -57,15 +57,6 @@ const ElRadioGroup = defineAsyncComponent(() =>
|
||||
const ElSpace = defineAsyncComponent(() =>
|
||||
import('element-plus/es/components/space/index').then((res) => res.ElSpace),
|
||||
);
|
||||
const ElSwitch = defineAsyncComponent(() =>
|
||||
import('element-plus/es/components/switch/index').then((res) => res.ElSwitch),
|
||||
);
|
||||
|
||||
const ElCascader = defineAsyncComponent(() =>
|
||||
import('element-plus/es/components/cascader/index').then(
|
||||
(res) => res.ElCascader,
|
||||
),
|
||||
);
|
||||
const ElDatePicker = defineAsyncComponent(() =>
|
||||
import('element-plus/es/components/date-picker/index').then(
|
||||
(res) => res.ElDatePicker,
|
||||
@@ -81,30 +72,17 @@ const ElSelectV2 = defineAsyncComponent(() =>
|
||||
(res) => res.ElSelectV2,
|
||||
),
|
||||
);
|
||||
const ElTimePicker = defineAsyncComponent(() =>
|
||||
import('element-plus/es/components/time-picker/index').then(
|
||||
(res) => res.ElTimePicker,
|
||||
),
|
||||
);
|
||||
const ElTreeSelect = defineAsyncComponent(() =>
|
||||
import('element-plus/es/components/tree-select/index').then(
|
||||
(res) => res.ElTreeSelect,
|
||||
),
|
||||
);
|
||||
const ElUpload = defineAsyncComponent(() =>
|
||||
import('element-plus/es/components/upload/index').then((res) => res.ElUpload),
|
||||
);
|
||||
|
||||
const RoleSelector = defineAsyncComponent(() =>
|
||||
import('#/components/zq-form/role-selector/role-selector.vue').then(
|
||||
(res) => res.default,
|
||||
),
|
||||
);
|
||||
const FileSelector = defineAsyncComponent(() =>
|
||||
import('#/components/zq-form/file-selector/file-selector.vue').then(
|
||||
(res) => res.default,
|
||||
),
|
||||
);
|
||||
const ImageSelector = defineAsyncComponent(() =>
|
||||
import('#/components/zq-form/image-selector/image-selector.vue').then(
|
||||
(res) => res.default,
|
||||
@@ -161,13 +139,11 @@ let initialized = false;
|
||||
export type ComponentType =
|
||||
| 'ApiSelect'
|
||||
| 'ApiTreeSelect'
|
||||
| 'Cascader'
|
||||
| 'Checkbox'
|
||||
| 'CheckboxGroup'
|
||||
| 'CodeEditor'
|
||||
| 'DatePicker'
|
||||
| 'Divider'
|
||||
| 'FileSelector'
|
||||
| 'IconPicker'
|
||||
| 'ImageSelector'
|
||||
| 'Input'
|
||||
@@ -176,11 +152,7 @@ export type ComponentType =
|
||||
| 'RoleSelector'
|
||||
| 'Select'
|
||||
| 'Space'
|
||||
| 'Switch'
|
||||
| 'Textarea'
|
||||
| 'TimePicker'
|
||||
| 'TreeSelect'
|
||||
| 'Upload'
|
||||
| 'UserSelector'
|
||||
| BaseFormComponentType;
|
||||
|
||||
@@ -220,7 +192,6 @@ function initComponentAdapter() {
|
||||
visibleEvent: 'onVisibleChange',
|
||||
},
|
||||
),
|
||||
Cascader: withDefaultPlaceholder(ElCascader, 'select'),
|
||||
Checkbox: ElCheckbox,
|
||||
CheckboxGroup: (props, { attrs, slots }) => {
|
||||
let defaultSlot;
|
||||
@@ -251,7 +222,6 @@ function initComponentAdapter() {
|
||||
},
|
||||
RoleSelector: withDefaultPlaceholder(RoleSelector, 'select'),
|
||||
Divider: ElDivider,
|
||||
FileSelector: withDefaultPlaceholder(FileSelector, 'select'),
|
||||
IconPicker: withDefaultPlaceholder(ZqIconPicker, 'select'),
|
||||
ImageSelector: withDefaultPlaceholder(ImageSelector, 'select'),
|
||||
Input: withDefaultPlaceholder(ElInput, 'input'),
|
||||
@@ -284,28 +254,6 @@ function initComponentAdapter() {
|
||||
return h(ElSelectV2, { ...props, attrs }, slots);
|
||||
},
|
||||
Space: ElSpace,
|
||||
Switch: ElSwitch,
|
||||
TimePicker: (props, { attrs, slots }) => {
|
||||
const { name, id, isRange } = props;
|
||||
const extraProps: Recordable<any> = {};
|
||||
if (isRange) {
|
||||
if (name && !Array.isArray(name)) {
|
||||
extraProps.name = [name, `${name}_end`];
|
||||
}
|
||||
if (id && !Array.isArray(id)) {
|
||||
extraProps.id = [id, `${id}_end`];
|
||||
}
|
||||
}
|
||||
return h(
|
||||
ElTimePicker,
|
||||
{
|
||||
...props,
|
||||
...attrs,
|
||||
...extraProps,
|
||||
},
|
||||
slots,
|
||||
);
|
||||
},
|
||||
DatePicker: (props, { attrs, slots }) => {
|
||||
const { name, id, type } = props;
|
||||
const extraProps: Recordable<any> = {};
|
||||
@@ -327,8 +275,6 @@ function initComponentAdapter() {
|
||||
slots,
|
||||
);
|
||||
},
|
||||
TreeSelect: withDefaultPlaceholder(ElTreeSelect, 'select'),
|
||||
Upload: ElUpload,
|
||||
UserSelector: withDefaultPlaceholder(UserSelector, 'select'),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user