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