DTL dialogs : style optimization-request-dialog + fix project-request-dialog
This commit is contained in:
parent
67f41757f5
commit
f92dc8ac85
3 changed files with 122 additions and 34 deletions
|
|
@ -228,25 +228,43 @@
|
|||
}
|
||||
|
||||
/* Project Request Dialog */
|
||||
#project-request-dialog {
|
||||
#project-request-dialog,
|
||||
#optimization-request-dialog {
|
||||
--dialog-max-w: 704px;
|
||||
--dialog-max-h: 712px;
|
||||
--dialog-header-h: 6rem;
|
||||
--dialog-background: var(--color-white);
|
||||
color: var(--color-black);
|
||||
align-items: stretch;
|
||||
overflow: hidden;
|
||||
}
|
||||
#project-request-dialog [data-pc-section="header"] h2 {
|
||||
left: 0 !important;
|
||||
right: 0 !important;
|
||||
#optimization-request-dialog {
|
||||
--dialog-max-h: 676px;
|
||||
--dialog-header-h: 8rem;
|
||||
}
|
||||
#optimization-request-dialog [data-pc-section="header"] {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0;
|
||||
}
|
||||
#optimization-request-dialog [data-pc-section="header"] [data-icon="leaf"] {
|
||||
|
||||
}
|
||||
#project-request-dialog h2,
|
||||
#optimization-request-dialog h2 {
|
||||
position: static !important;
|
||||
color: var(--color-black);
|
||||
margin-block: var(--space-16) !important;
|
||||
}
|
||||
#project-request-dialog [data-pc-name="pcclosebutton"] {
|
||||
#project-request-dialog [data-pc-name="pcclosebutton"],
|
||||
#optimization-request-dialog [data-pc-name="pcclosebutton"] {
|
||||
display: none;
|
||||
}
|
||||
#project-request-dialog form {
|
||||
max-width: unset;
|
||||
#project-request-dialog form,
|
||||
#optimization-request-dialog form {
|
||||
max-width: var(--dialog-max-w);
|
||||
height: calc(var(--dialog-max-h) - var(--dialog-header-h));
|
||||
background: none;
|
||||
}
|
||||
#project-request-dialog #project-dtl {
|
||||
position: relative;
|
||||
|
|
@ -263,9 +281,22 @@
|
|||
appearance: auto;
|
||||
accent-color: var(--color-primary);
|
||||
}
|
||||
#project-request-dialog [data-icon="leaf"] {
|
||||
padding: var(--space-4) var(--space-8);
|
||||
#optimization-request-dialog select {
|
||||
background-image: var(--icon-chevron-single-down-grey);
|
||||
background-position: center right 1rem;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
#project-request-dialog [data-icon="leaf"],
|
||||
#optimization-request-dialog [data-icon="leaf"] {
|
||||
--column-gap: var(--space-4);
|
||||
padding: 0.25rem var(--space-8) 0.375rem;
|
||||
background: var(--color-dtl-15);
|
||||
color: var(--color-dtl);
|
||||
border-radius: var(--rounded-md);
|
||||
line-height: 1;
|
||||
font-weight: 500;
|
||||
}
|
||||
#project-request-dialog [data-icon="leaf"]::before,
|
||||
#optimization-request-dialog [data-icon="leaf"]::before {
|
||||
transform: translateY(.125rem);
|
||||
}
|
||||
|
|
@ -35,8 +35,8 @@
|
|||
v-model="details"
|
||||
cols="30"
|
||||
rows="10"
|
||||
placeholder="Détails du projet"
|
||||
class="w-full h-full rounded-md border border-grey-200 px-16 py-12"
|
||||
placeholder="Détails du projet…"
|
||||
class="w-full flex-1 rounded-md border border-grey-200 px-16 py-12"
|
||||
required
|
||||
></textarea>
|
||||
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
>
|
||||
</div>
|
||||
|
||||
<footer class="flex-columns w-full mt-auto" style="column-gap: 0.5rem">
|
||||
<footer class="flex-columns w-full mt-16" style="column-gap: 0.5rem">
|
||||
<button class="btn btn--black-10" @click="emits('close')">
|
||||
Annuler
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -1,38 +1,95 @@
|
|||
<template>
|
||||
<form @submit.prevent="handleSubmit">
|
||||
<select name="projects" id="projects" v-model="projectUri">
|
||||
<option
|
||||
v-for="project in currentProjects"
|
||||
:key="project.uri"
|
||||
:value="project.uri.substring(1)"
|
||||
<Dialog
|
||||
id="optimization-request-dialog"
|
||||
v-model:visible="isOpen"
|
||||
modal
|
||||
:draggable="false"
|
||||
dismissableMask="true"
|
||||
header="Demander un rendez-vous"
|
||||
class="dialog"
|
||||
:closeOnEscape="true"
|
||||
>
|
||||
<template #header>
|
||||
<h2 class="font-serif text-lg">Demander un rendez-vous</h2>
|
||||
<p class="flex justify-center text-sm" data-icon="leaf">Design to Light</p>
|
||||
</template>
|
||||
|
||||
<form
|
||||
@submit.prevent="handleSubmit"
|
||||
class="w-full p-16 flex flex-col"
|
||||
style="--row-gap: 1rem"
|
||||
>
|
||||
|
||||
<label for="projects" class="sr-only">Projet</label>
|
||||
<select
|
||||
name="projects"
|
||||
id="projects"
|
||||
v-model="projectUri"
|
||||
class="w-full rounded-md border border-grey-200 px-16 py-12"
|
||||
required
|
||||
>
|
||||
{{ project.title }}
|
||||
</option>
|
||||
</select>
|
||||
<input type="text" v-model="subject" />
|
||||
<textarea
|
||||
name="details"
|
||||
v-model="details"
|
||||
cols="30"
|
||||
rows="10"
|
||||
placeholder="Décrivez votre demande…"
|
||||
required
|
||||
></textarea>
|
||||
<button type="submit">Soumettre</button>
|
||||
</form>
|
||||
<option value="">Sélectionnez le projet</option>
|
||||
<option
|
||||
v-for="project in currentProjects"
|
||||
:key="project.uri"
|
||||
:value="project.uri.substring(1)"
|
||||
>
|
||||
{{ project.title }}
|
||||
</option>
|
||||
</select>
|
||||
|
||||
<label for="appointment-subject" class="sr-only">Objet du rendez-vous</label>
|
||||
<input
|
||||
type="text"
|
||||
v-model="subject"
|
||||
id="appointment-subject"
|
||||
placeholder="Objet du rendez-vous"
|
||||
class="w-full rounded-md border border-grey-200 px-16 py-12"
|
||||
required
|
||||
/>
|
||||
|
||||
<label for="appointment-details" class="sr-only">Détails du projet</label>
|
||||
<textarea
|
||||
id="appointment-details"
|
||||
name="details"
|
||||
v-model="details"
|
||||
cols="30"
|
||||
rows="10"
|
||||
placeholder="Décrivez votre demande…"
|
||||
class="w-full flex-1 rounded-md border border-grey-200 px-16 py-12"
|
||||
required
|
||||
></textarea>
|
||||
|
||||
<footer class="flex-columns w-full mt-16" style="column-gap: 0.5rem">
|
||||
<button class="btn btn--black-10" @click="emits('close')">
|
||||
Annuler
|
||||
</button>
|
||||
<button class="btn" type="submit">Soumettre</button>
|
||||
</footer>
|
||||
</form>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Dialog from "primevue/dialog";
|
||||
import { useApiStore } from "../../stores/api";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { useProjectsStore } from "../../stores/projects";
|
||||
import { ref } from "vue";
|
||||
import { ref, watch } from "vue";
|
||||
|
||||
const { currentProjects } = storeToRefs(useProjectsStore());
|
||||
const projectUri = ref("");
|
||||
const subject = ref("Design to Light");
|
||||
const subject = ref("");
|
||||
const details = ref("");
|
||||
const api = useApiStore();
|
||||
const isOpen = ref(true);
|
||||
const emits = defineEmits("close");
|
||||
|
||||
watch(isOpen, (newValue) => {
|
||||
if (!newValue) {
|
||||
emits("close");
|
||||
}
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
const formData = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue