-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add calendars to histogramSlider (#30)
Add calendars in the computer view #8
- Loading branch information
1 parent
2ae24a6
commit 761b94a
Showing
6 changed files
with
158 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,78 @@ | ||
<template> | ||
<div v-if="visible"> | ||
<div class="z-100 fixed top-0 left-0 w-screen h-screen bg-black bg-opacity-50"></div> | ||
<div id="popUpDate" | ||
class="z-100 fixed top-0 left-0 w-screen h-screen flex items-center justify-center transform transition-transform duration-300"> | ||
<div class="bg-white rounded-3xl p-6"> | ||
<div class="flex justify-between mb-5"> | ||
<h1 class="font-bold text-secondary">Filter date</h1> | ||
<button id="dateCloseButton" type="button" class="focus:outline-none text-grayClose" @click="toggleVisible">X</button> | ||
</div> | ||
<Datepicker v-model="date" @update:modelValue="handleDate" inline autoApply/> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { store } from "@/Store" | ||
import Datepicker from "@vuepic/vue-datepicker" | ||
import { defineComponent } from "vue" | ||
import "@vuepic/vue-datepicker/dist/main.css" | ||
export default defineComponent({ | ||
components: { | ||
Datepicker | ||
}, | ||
name: "Date", | ||
props: { | ||
visible: Boolean, | ||
toggleVisible: Function, | ||
isMinDate: Boolean | ||
}, | ||
data (): { date: Date, isVisible: boolean } { | ||
if (this.isMinDate) { | ||
return { date: store.state.minDate, isVisible: false } | ||
} else { | ||
return { date: store.state.maxDate, isVisible: false } | ||
} | ||
}, | ||
methods: { | ||
handleDate (modelData: Date): void { | ||
if (this.isMinDate) { | ||
store.state.minDate = modelData | ||
} else { | ||
store.state.maxDate = modelData | ||
} | ||
store.filterData(store.state.minDate, store.state.maxDate) | ||
store.updateHistogramSliderFromTo() | ||
} | ||
} | ||
}) | ||
</script> | ||
|
||
<!-- Add "scoped" attribute to limit CSS to this component only --> | ||
<style scoped> | ||
h1 { | ||
font-size: x-large; | ||
} | ||
|
||
p, span { | ||
color: var(--text-color); | ||
} | ||
|
||
.text-3xs { | ||
font-size: 0.5rem; | ||
line-height: 0.5rem; | ||
} | ||
|
||
.vertical-separator { | ||
border-right: 1px solid; | ||
} | ||
|
||
button { | ||
left: 100%; | ||
} | ||
</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