-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Affiche les quantités pour une date précise dans la page du matériel (#…
…93)
- Loading branch information
Showing
18 changed files
with
317 additions
and
65 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.PromptDate { | ||
&__header { | ||
display: flex; | ||
align-items: center; | ||
padding: $content-padding-small-horizontal $content-padding-large-vertical; | ||
background-color: $bg-color-main-header; | ||
|
||
&__title { | ||
flex: 1; | ||
font-size: 1.4rem; | ||
} | ||
|
||
&__btn-close { | ||
flex: 0 0 auto; | ||
background: none; | ||
border: none; | ||
} | ||
} | ||
|
||
&__main { | ||
padding: $content-padding-large-vertical $content-padding-small-vertical; | ||
} | ||
|
||
&__datepicker { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
&__input { | ||
width: 100%; | ||
max-width: 300px; | ||
font-size: 1.1rem; | ||
} | ||
} | ||
|
||
hr { | ||
opacity: .15; | ||
margin: 0; | ||
} | ||
|
||
&__footer { | ||
padding: $content-padding-large-vertical; | ||
text-align: center; | ||
} | ||
} |
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,75 @@ | ||
<template> | ||
<div class="PromptDate"> | ||
<div class="PromptDate__header"> | ||
<h2 class="PromptDate__header__title"> | ||
{{ title }} | ||
</h2> | ||
<button class="PromptDate__header__btn-close" @click="$emit('close')"> | ||
<i class="fas fa-times" /> | ||
</button> | ||
</div> | ||
<div class="PromptDate__main"> | ||
<Datepicker | ||
:value="currentDate" | ||
:language="datepickerLang" | ||
:format="formatDate" | ||
:placeholder="$t(placeholder)" | ||
class="PromptDate__datepicker" | ||
input-class="PromptDate__datepicker__input" | ||
monday-first | ||
v-on:input="handleChange" | ||
/> | ||
</div> | ||
<hr /> | ||
<div class="PromptDate__footer"> | ||
<button @click="handleSubmit" class="success"> | ||
<i class="fas fa-check" /> | ||
{{ $t('choose-date') }} | ||
</button> | ||
<button @click="$emit('close')"> | ||
<i class="fas fa-times" /> | ||
{{ $t('close') }} | ||
</button> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss"> | ||
@import '../../themes/default/index'; | ||
@import './PromptDate'; | ||
</style> | ||
|
||
<script> | ||
import moment from 'moment'; | ||
import Datepicker from 'vuejs-datepicker'; | ||
import * as lang from 'vuejs-datepicker/src/locale'; | ||
import store from '@/store'; | ||
export default { | ||
name: 'PromptDate', | ||
components: { Datepicker }, | ||
props: { | ||
title: String, | ||
defaultDate: [String, Date], | ||
format: String, | ||
placeholder: String, | ||
}, | ||
data() { | ||
return { | ||
currentDate: this.defaultDate, | ||
datepickerLang: lang[store.state.i18n.locale], | ||
}; | ||
}, | ||
methods: { | ||
formatDate(date) { | ||
return this.format || moment(date).format('LL'); | ||
}, | ||
handleChange(newDate) { | ||
this.currentDate = newDate; | ||
}, | ||
handleSubmit() { | ||
this.$emit('close', { date: this.currentDate }); | ||
}, | ||
}, | ||
}; | ||
</script> |
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
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.