fix(editor): Fix design system typecheck errors (no-changelog) (#9447)

This commit is contained in:
Alex Grozav
2024-05-21 20:53:19 +03:00
committed by GitHub
parent d21ad15c1f
commit eef5479e96
20 changed files with 161 additions and 65 deletions

View File

@@ -32,6 +32,7 @@
import { ElSelect } from 'element-plus';
import { type PropType, defineComponent } from 'vue';
import type { SelectSize } from '@/types';
import { isEventBindingElementAttribute } from '../../utils';
type InnerSelectRef = InstanceType<typeof ElSelect>;
@@ -86,13 +87,16 @@ export default defineComponent({
},
computed: {
listeners() {
return Object.entries(this.$attrs).reduce<Record<string, () => {}>>((acc, [key, value]) => {
if (/^on[A-Z]/.test(key)) {
acc[key] = value;
}
return Object.entries(this.$attrs).reduce<Record<string, (...args: unknown[]) => {}>>(
(acc, [key, value]) => {
if (isEventBindingElementAttribute(value, key)) {
acc[key] = value;
}
return acc;
}, {});
return acc;
},
{},
);
},
computedSize(): InnerSelectRef['$props']['size'] {
if (this.size === 'medium') {