-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
コンポーネント分割・BasicTextboxを廃止・autocomplete追加
- Loading branch information
Showing
4 changed files
with
109 additions
and
53 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<script setup lang="ts"> | ||
import MaterialIcon from '@/components/MaterialIcon.vue' | ||
import TextboxLabel from '@/components/Controls/Textbox/TextboxLabel.vue' | ||
const { errorMessage = '', label = '' } = defineProps<{ | ||
disabled?: boolean | ||
errorMessage?: string | ||
isRequired?: boolean | ||
label?: string | ||
placeholder?: string | ||
autocomplete?: string | ||
}>() | ||
const value = defineModel<string>() | ||
</script> | ||
|
||
<template> | ||
<div class="flex flex-col gap-2"> | ||
<TextboxLabel v-if="label != ''" :is-required="isRequired" :label="label" /> | ||
<input | ||
v-model="value" | ||
:autocomplete="autocomplete" | ||
:class="[ | ||
{ | ||
'border-border-secondary outline-text-primary focus:border-text-primary': | ||
errorMessage == '' | ||
}, | ||
{ 'border-status-error outline outline-1 outline-status-error': errorMessage != '' }, | ||
'fontstyle-ui-body w-full rounded border bg-background-primary py-1 pl-4 text-text-primary placeholder:text-text-tertiary focus:outline focus:outline-1 disabled:bg-background-secondary' | ||
]" | ||
:disabled="disabled" | ||
:placeholder="placeholder" | ||
type="email" | ||
/> | ||
<div v-if="errorMessage != ''" class="flex items-start gap-2 pl-1 text-status-error"> | ||
<MaterialIcon icon="error" size="1.25rem" /> | ||
<span class="fontstyle-ui-control">{{ errorMessage }}</span> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<script setup lang="ts"> | ||
import MaterialIcon from '@/components/MaterialIcon.vue' | ||
import TextboxLabel from '@/components/Controls/Textbox/TextboxLabel.vue' | ||
import { ref } from 'vue' | ||
const { errorMessage = '', label = '' } = defineProps<{ | ||
disabled?: boolean | ||
errorMessage?: string | ||
isRequired?: boolean | ||
label?: string | ||
placeholder?: string | ||
autocomplete?: string | ||
}>() | ||
const value = defineModel<string>() | ||
const passwordShown = ref<boolean>(false) | ||
</script> | ||
|
||
<template> | ||
<div class="flex flex-col gap-2"> | ||
<TextboxLabel v-if="label != ''" :is-required="isRequired" :label="label" /> | ||
<span class="relative"> | ||
<input | ||
v-model="value" | ||
:class="[ | ||
{ | ||
'border-border-secondary outline-text-primary focus:border-text-primary': | ||
errorMessage == '' | ||
}, | ||
{ 'border-status-error outline outline-1 outline-status-error': errorMessage != '' }, | ||
'fontstyle-ui-body w-full rounded border bg-background-primary py-1 pl-4 pr-11.5 text-text-primary placeholder:text-text-tertiary focus:outline focus:outline-1 disabled:bg-background-secondary' | ||
]" | ||
:disabled="disabled" | ||
:placeholder="placeholder" | ||
:type="passwordShown ? 'text' : 'password'" | ||
:autocomplete="autocomplete" | ||
/> | ||
<span | ||
class="absolute right-4 top-1.75 select-none" | ||
@click="() => (passwordShown = !passwordShown)" | ||
> | ||
<MaterialIcon :icon="passwordShown ? 'visibility_off' : 'visibility'" size="1.25rem" /> | ||
</span> | ||
</span> | ||
<div v-if="errorMessage != ''" class="flex items-start gap-2 pl-1 text-status-error"> | ||
<MaterialIcon icon="error" size="1.25rem" /> | ||
<span class="fontstyle-ui-control">{{ errorMessage }}</span> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped></style> |
30 changes: 17 additions & 13 deletions
30
...nts/Controls/Textbox/DecoratedTextbox.vue → ...ponents/Controls/Textbox/PlainTextbox.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters