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

日付コンポーネントの実装 #56

Merged
merged 6 commits into from
Mar 22, 2023
Merged

日付コンポーネントの実装 #56

merged 6 commits into from
Mar 22, 2023

Conversation

mehm8128
Copy link
Contributor

@mehm8128 mehm8128 commented Jan 4, 2023

close #55

sinceとuntilがセットで使われていることが多そうなので、単体コンポーネントを2つ使ってセットのも作りました
必須アイコンはsinceのみ必須の場合は「~から」の横に、sinceもuntilも必須の場合は「日時」の横につけていそうなので、sinceのみの場合だけ対応しました(untilのみの場合は存在しないはず)
formDurationは以下のような感じで動くと思います(formDateはstring型の変数でv-model使うだけです)

<script lang="ts" setup>
import PageContainer from '/@/components/Layout/PageContainer.vue'
import FormDuration from '/@/components/UI/FormDuration.vue'
import { ref } from 'vue'
import { Duration } from '/@/lib/apis'

const value = ref<Duration>({ since: '', until: '' })
</script>

<template>
  <page-container>
    <form-duration v-model="value" />
  </page-container>
</template>

@mehm8128 mehm8128 requested review from tesso57 and toshi-pono January 4, 2023 08:14
@mehm8128 mehm8128 self-assigned this Jan 4, 2023
Copy link
Member

@tesso57 tesso57 left a comment

Choose a reason for hiding this comment

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

気になるところ書きました。:pray:


<template>
<div :class="$style.container">
<icon name="mdi:calendar-clock" :class="$style.icon" />
Copy link
Member

Choose a reason for hiding this comment

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

カレンダーっぽいアイコンが2つ並んでて微妙だと思ったので、消すことにします。

Comment on lines +21 to +26
<input
:class="$style.input"
:data-is-blank="props.modelValue === ''"
type="datetime-local"
:value="props.modelValue"
@input="handleInput"
Copy link
Member

Choose a reason for hiding this comment

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

いい感じにデフォルトのアイコンもfocusしたときに色変わったらいいなって思ってます。

.container {
display: flex;
align-items: center;
padding: 8px;
Copy link
Member

Choose a reason for hiding this comment

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

rem がいいかも?

@mehm8128
Copy link
Contributor Author

mehm8128 commented Mar 8, 2023

image
デフォルトであるアイコンの色変えるの大変そうだったので、Iconifyのアイコンを元の場所に代わりに表示するようにしてフォーカス時に色が変わるようにしてみました(svgを直接入れないといけないのはちょっと微妙ですが)

@mehm8128 mehm8128 requested a review from tesso57 March 8, 2023 13:54
Copy link
Member

@tesso57 tesso57 left a comment

Choose a reason for hiding this comment

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

コンポーネントの動きは良さそうです。いい感じに動いててすごい!
Index.vueが置き換わってしまっているので、それだけ直してください。

Comment on lines 1 to 14
<script lang="ts" setup>
import ContentHeader from '/@/components/Layout/ContentHeader.vue'
import PageInfoPanels from '/@/components/Index/PageInfoPanels.vue'
import PageContainer from '/@/components/Layout/PageContainer.vue'
import FormDuration from '/@/components/UI/FormDuration.vue'
import { ref } from 'vue'
import { Duration } from '/@/lib/apis'

const value = ref<Duration>({ since: '', until: '' })
</script>

<template>
<page-container>
<content-header
icon-name="mdi:apps"
:header-texts="[{ title: 'Top', url: '/' }]"
detail="ポートフォリオの設定を変更します"
:class="$style.header"
/>
<page-info-panels />
<form-duration v-model="value" />
</page-container>
</template>
Copy link
Member

Choose a reason for hiding this comment

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

書き換わっているので、直してください

@mehm8128 mehm8128 merged commit 367ef55 into main Mar 22, 2023
@mehm8128 mehm8128 deleted the feat/date_component branch March 22, 2023 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

日付入力コンポーネントの作成
2 participants