Skip to content

Commit

Permalink
Refactor ParameterInput to composition API + fix all TS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
elsmr committed Mar 29, 2024
1 parent c204995 commit afdad4d
Show file tree
Hide file tree
Showing 4 changed files with 1,292 additions and 1,289 deletions.
8 changes: 3 additions & 5 deletions packages/design-system/src/components/N8nInput/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@
import { computed, ref } from 'vue';
import { ElInput } from 'element-plus';
import { uid } from '../../utils';
const INPUT = ['text', 'textarea', 'number', 'password', 'email'] as const;
const SIZE = ['mini', 'small', 'medium', 'large', 'xlarge'] as const;
import type { InputSize, InputType } from '@/types/input';
interface InputProps {
modelValue?: string | number;
type?: (typeof INPUT)[number];
size?: (typeof SIZE)[number];
type?: InputType;
size?: InputSize;
placeholder?: string;
disabled?: boolean;
readonly?: boolean;
Expand Down
1 change: 1 addition & 0 deletions packages/design-system/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export * from './button';
export * from './datatable';
export * from './form';
export * from './i18n';
export * from './input';
export * from './menu';
export * from './select';
export * from './user';
Expand Down
5 changes: 5 additions & 0 deletions packages/design-system/src/types/input.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const INPUT_TYPES = ['text', 'textarea', 'number', 'password', 'email'] as const;
const INPUT_SIZES = ['mini', 'small', 'medium', 'large', 'xlarge'] as const;

export type InputType = (typeof INPUT_TYPES)[number];
export type InputSize = (typeof INPUT_SIZES)[number];
Loading

0 comments on commit afdad4d

Please sign in to comment.