-
Notifications
You must be signed in to change notification settings - Fork 11
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 #1048 from PrefectHQ/date-range-select
Feature: PDateRangeSelect
- Loading branch information
Showing
14 changed files
with
564 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<template> | ||
<ComponentPage title="Date Range Select" :demos="[{ title: 'Date Range Select' }]"> | ||
<template #description> | ||
<DemoState v-model:state="exampleState" v-model:disabled="disabled" /> | ||
</template> | ||
|
||
<template #date-range-select> | ||
<p-content> | ||
<p-date-range-select v-model="value" v-bind="{ min, max, clearable, disabled }" /> | ||
<p-code inline> | ||
value: {{ JSON.stringify(value) }} | ||
</p-code> | ||
<div class="flex justify-start gap-4"> | ||
<p-checkbox v-model="clearable" :disabled="disabled" label="Clearable" /> | ||
</div> | ||
<div class="flex gap-4 w-1/2"> | ||
<p-label label="Min Value" :message="min ? format(min, 'MMM do, yyyy h:mm a') : ''"> | ||
<p-native-date-input v-model="min" :disabled="disabled" :state="exampleState" /> | ||
</p-label> | ||
|
||
<p-label label="Max Value" :message="max ? format(max, 'MMM do, yyyy h:mm a') : ''"> | ||
<p-native-date-input v-model="max" :disabled="disabled" :state="exampleState" /> | ||
</p-label> | ||
</div> | ||
</p-content> | ||
</template> | ||
</ComponentPage> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { State } from '@/types' | ||
import { format } from 'date-fns' | ||
import { ref } from 'vue' | ||
import ComponentPage from '@/demo/components/ComponentPage.vue' | ||
import DemoState from '@/demo/components/DemoState.vue' | ||
const exampleState = ref<State>() | ||
const disabled = ref(false) | ||
const value = ref() | ||
const min = ref<Date>() | ||
const max = ref<Date>() | ||
const clearable = ref(true) | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,10 @@ | |
|
||
<style> | ||
.p-date-picker { @apply | ||
bg-floating | ||
my-1 | ||
rounded-default | ||
shadow-lg | ||
flex | ||
flex-col | ||
p-2 | ||
|
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.