generated from cp-20/nuxt3-template
-
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.
Merge pull request #19 from traPtitech/feat/new-questionnaire-form-2
`/questionnaires/new` の実装
- Loading branch information
Showing
15 changed files
with
632 additions
and
395 deletions.
There are no files selected for viewing
88 changes: 88 additions & 0 deletions
88
components/new-questionnaire-form/add-question-buttons.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<script lang="ts" setup> | ||
import type { QuestionSettings } from '~/components/new-questionnaire-form/type'; | ||
defineEmits<{ | ||
(e: 'add-question', type: QuestionSettings['type']): void; | ||
}>(); | ||
</script> | ||
|
||
<template> | ||
<Panel header="新しい質問を追加する"> | ||
<div class="add-question-buttons"> | ||
<Button | ||
class="add-question-button" | ||
outlined | ||
@click="$emit('add-question', 'text')" | ||
> | ||
<Icon size="24px" name="ic:outline-short-text" /> | ||
<span>1行テキスト</span> | ||
</Button> | ||
<Button | ||
class="add-question-button" | ||
outlined | ||
@click="$emit('add-question', 'text-long')" | ||
> | ||
<Icon size="24px" name="mdi:text" /> | ||
<span>長文テキスト</span> | ||
</Button> | ||
<Button | ||
class="add-question-button" | ||
outlined | ||
@click="$emit('add-question', 'number')" | ||
> | ||
<Icon size="24px" name="mdi:numeric" /> | ||
<span>数値</span> | ||
</Button> | ||
<Button | ||
class="add-question-button" | ||
outlined | ||
@click="$emit('add-question', 'multiple-choice')" | ||
> | ||
<Icon size="24px" name="mdi:checkbox-outline" /> | ||
<span>チェックボックス</span> | ||
</Button> | ||
<Button | ||
class="add-question-button" | ||
outlined | ||
@click="$emit('add-question', 'single-choice')" | ||
> | ||
<Icon size="24px" name="mdi:radiobox-marked" /> | ||
<span>ラジオボタン</span> | ||
</Button> | ||
<Button | ||
class="add-question-button" | ||
outlined | ||
@click="$emit('add-question', 'scale')" | ||
> | ||
<Icon size="24px" name="ic:outline-linear-scale" /> | ||
<span>目盛り</span> | ||
</Button> | ||
</div> | ||
</Panel> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.add-question-buttons { | ||
display: grid; | ||
grid-template-columns: repeat(3, 1fr); | ||
gap: 16px; | ||
} | ||
@media screen and (max-width: $breakpoint-lg) { | ||
.add-question-buttons { | ||
grid-template-columns: repeat(2, 1fr); | ||
} | ||
} | ||
@media screen and (max-width: 620px) { | ||
.add-question-buttons { | ||
grid-template-columns: 1fr; | ||
} | ||
} | ||
.add-question-button { | ||
display: flex; | ||
gap: 8px; | ||
padding: 8px 12px; | ||
} | ||
</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
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
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
2 changes: 2 additions & 0 deletions
2
...ts/new-questionnaire-form/scale-input.vue → ...form/form-control-element/scale-input.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
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
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
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
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
Oops, something went wrong.