refactor(editor): Continue porting components over to composition API (no-changelog) (#8893)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-03-15 12:43:08 +01:00
committed by GitHub
parent 80c4bc443a
commit 6c693e1afd
39 changed files with 989 additions and 1253 deletions

View File

@@ -30,16 +30,11 @@
<script lang="ts">
import { ElSelect } from 'element-plus';
import { defineComponent } from 'vue';
import { type PropType, defineComponent } from 'vue';
import type { SelectSize } from '@/types';
type InnerSelectRef = InstanceType<typeof ElSelect>;
export interface IProps {
size?: string;
limitPopperWidth?: string;
popperClass?: string;
}
export default defineComponent({
name: 'N8nSelect',
components: {
@@ -49,10 +44,8 @@ export default defineComponent({
...ElSelect.props,
modelValue: {},
size: {
type: String,
type: String as PropType<SelectSize>,
default: 'large',
validator: (value: string): boolean =>
['mini', 'small', 'medium', 'large', 'xlarge'].includes(value),
},
placeholder: {
type: String,
@@ -101,7 +94,7 @@ export default defineComponent({
return acc;
}, {});
},
computedSize(): string | undefined {
computedSize(): InnerSelectRef['$props']['size'] {
if (this.size === 'medium') {
return 'default';
}