Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextInputにtypeとdisabledを指定できるように修正 #280

Merged
merged 2 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ yarn-error.log*
*.sln
*.sw?

dist/
2 changes: 1 addition & 1 deletion dist/lapras-frontend.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lapras-frontend.js
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

distフォルダはgit管理不要なので削除しました

Large diffs are not rendered by default.

104 changes: 57 additions & 47 deletions dist/lapras-frontend.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lapras-frontend.umd.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/components/TextInput/TextInput.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ const meta: Meta<TextInputPropsAndCustomArgs> = {
autoExpand: false,
baseTextareaHeight: 56,
},
argTypes: {
type: {
control: { type: 'select' },
options: ['text', 'password', 'email', 'number', 'tel', 'date'],
defaultValue: 'text',
},
},
render: (args) => ({
components: { TextInput },
setup() {
Expand Down
12 changes: 11 additions & 1 deletion src/components/TextInput/TextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:value="modelValue"
class="text-input is-multi-line"
:class="{ 'has-error': error }"
:disabled="disabled"
v-if="multiline"
@input="onInput"
@focus="$emit('focus')"
Expand All @@ -15,7 +16,8 @@
:value="modelValue"
class="text-input is-single-line"
:class="{ 'has-error': error }"
type="text"
:disabled="disabled"
:type="type"
@input="onInput"
@focus="$emit('focus')"
@blur="$emit('blur')"
Expand Down Expand Up @@ -49,6 +51,14 @@ export default defineComponent({
type: Number,
default: 56,
},
type: {
type: String,
default: 'text',
},
disabled: {
type: Boolean,
default: false,
},
},
emits: {
'update:modelValue': null,
Expand Down
18 changes: 18 additions & 0 deletions types/components/TextInput/TextInput.vue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ declare const _default: import("vue").DefineComponent<{
type: NumberConstructor;
default: number;
};
type: {
type: StringConstructor;
default: string;
};
disabled: {
type: BooleanConstructor;
default: boolean;
};
}, {
textarea: import("vue").Ref<HTMLElement | null>;
onInput: (e: Event) => void;
Expand Down Expand Up @@ -47,12 +55,22 @@ declare const _default: import("vue").DefineComponent<{
type: NumberConstructor;
default: number;
};
type: {
type: StringConstructor;
default: string;
};
disabled: {
type: BooleanConstructor;
default: boolean;
};
}>> & {
onFocus?: ((...args: any[]) => any) | undefined;
onBlur?: ((...args: any[]) => any) | undefined;
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
}, {
type: string;
error: boolean;
disabled: boolean;
multiline: boolean;
modelValue: string;
autoExpand: boolean;
Expand Down