Repository navigation
feat(event): implement preview with drafts #1739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 66 commits
f48e617
28dd7a0
c26354e
5f3d695
e872b07
4e9fdbe
d640db4
314bb74
13ba0e4
413bde7
f96ffd5
3a206ab
5342d89
8250d91
af6a3f9
4a44961
1729506
59ae889
c620da6
a294a7c
3a1a626
97bc136
ef58067
4b46569
b28fc3e
f29710c
5b92946
866c4b2
217bfc0
bf9dd44
8718709
bb25d6c
ced2792
92d818e
b0c1772
6da1237
efa5e75
ed6cdf5
56cc799
cf8da75
7d1d6be
a2c5d1f
f7d44c3
c5da088
04f0c84
35b3d6e
7aa7518
dcf014c
5e1d1b1
3da4586
44d2dce
9b372f1
f940385
bfde40e
18400c5
7ff6998
3b9efa9
c932340
f7f5358
3dc907c
8cd29ad
63c497c
da5ee1d
43f8b03
dc50fcd
de8993b
2c2573d
d463c8b
e5e1bd5
9c1e1c0
cab0326
3b91fda
82ef6fc
91910c0
c028d8d
65b6346
bf23f90
85cd403
ecbba00
7f15c7f
f177ede
c324388
a353225
ed5320c
c1829da
4b8e4b8
0b4d622
c944a70
220c2b5
8edeee8
c91056f
d9d85e4
3e5a1bd
d0a3370
b281aee
4ebbbc4
2e3cceb
4e3fca3
4346d94
1743a53
b27f9ee
9b3c478
5ce8e12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Colored icons should go the the |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,93 @@ | ||||||||||||||
| <template> | ||||||||||||||
| <div class="flex w-full"> | ||||||||||||||
| <div class="grid w-full grid-cols-2 gap-0"> | ||||||||||||||
| <Popover> | ||||||||||||||
| <PopoverTrigger class="w-full"> | ||||||||||||||
| <div | ||||||||||||||
| class="flex h-14 w-full items-center rounded-l-xl border border-gray-200 bg-white px-4 py-2 dark:border-[--semantic-base-line] dark:bg-[--semantic-base-background]" | ||||||||||||||
| > | ||||||||||||||
| <div class="min-w-0 flex-1"> | ||||||||||||||
| <span | ||||||||||||||
| class="block truncate text-sm text-gray-600 dark:text-[--semantic-base-text-primary]" | ||||||||||||||
| >{{ | ||||||||||||||
| modelValue | ||||||||||||||
| ? df.format( | ||||||||||||||
| modelValue instanceof Date | ||||||||||||||
| ? modelValue | ||||||||||||||
| : new Date(String(modelValue)), | ||||||||||||||
| ) | ||||||||||||||
| : placeholder | ||||||||||||||
| }}</span | ||||||||||||||
| > | ||||||||||||||
| </div> | ||||||||||||||
| <CalendarIcon | ||||||||||||||
| class="ml-2 h-6 w-6 flex-shrink-0 text-gray-300 dark:text-[--semantic-base-text-secondary]" | ||||||||||||||
| /> | ||||||||||||||
| </div> | ||||||||||||||
| </PopoverTrigger> | ||||||||||||||
| <PopoverContent | ||||||||||||||
| class="w-auto border border-gray-200 p-0 dark:border-[--semantic-base-line] dark:bg-[--semantic-base-background]" | ||||||||||||||
| hide-close | ||||||||||||||
| > | ||||||||||||||
| <Calendar | ||||||||||||||
| class="bg-white dark:bg-[--semantic-base-background] [&_.rdp]:p-3 [&_.rdp-button]:dark:text-[--semantic-base-text-primary] [&_.rdp-button:hover]:dark:bg-[--semantic-base-surface-1] [&_.rdp-caption]:dark:text-[--semantic-base-text-primary] [&_.rdp-day_selected]:dark:bg-[--accent-fancy] [&_.rdp-head_cell]:dark:text-[--semantic-base-text-secondary] [&_.rdp-head_th]:p-2 [&_.rdp-table]:w-full [&_.rdp-tbody_td]:p-2" | ||||||||||||||
| :selected="modelValue" | ||||||||||||||
| @update:model-value=" | ||||||||||||||
| (date) => | ||||||||||||||
| emit('update:modelValue', date as unknown as CalendarDate) | ||||||||||||||
| " | ||||||||||||||
| /> | ||||||||||||||
| </PopoverContent> | ||||||||||||||
| </Popover> | ||||||||||||||
|
|
||||||||||||||
| <div | ||||||||||||||
| class="flex h-14 w-full items-center rounded-r-xl border border-l-0 border-gray-200 bg-white px-4 py-2 dark:border-[--semantic-base-line] dark:bg-[--semantic-base-background]" | ||||||||||||||
| > | ||||||||||||||
| <input | ||||||||||||||
| v-model="selectedTime" | ||||||||||||||
| type="time" | ||||||||||||||
| class="w-full border-0 px-0 py-2 text-xl text-gray-600 placeholder:text-gray-400 focus:border-transparent focus:ring-0 focus:outline-none dark:bg-[--semantic-base-background] dark:text-[--semantic-base-text-primary] dark:placeholder:text-[--semantic-base-text-secondary]" | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||||||||||||||
| :placeholder="timePlaceholder || '10:00'" | ||||||||||||||
| /> | ||||||||||||||
| </div> | ||||||||||||||
| </div> | ||||||||||||||
| </div> | ||||||||||||||
| </template> | ||||||||||||||
|
|
||||||||||||||
| <script setup lang="ts"> | ||||||||||||||
| import { Calendar } from '~/components/scn/calendar' | ||||||||||||||
| import { | ||||||||||||||
| Popover, | ||||||||||||||
| PopoverTrigger, | ||||||||||||||
| PopoverContent, | ||||||||||||||
| } from '~/components/scn/popover' | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Autoimported |
||||||||||||||
| import { CalendarIcon } from 'lucide-vue-next' | ||||||||||||||
| import type { CalendarDate } from '@internationalized/date' | ||||||||||||||
| import { DateFormatter } from '@internationalized/date' | ||||||||||||||
| const { locale } = useI18n() | ||||||||||||||
|
|
||||||||||||||
| interface Props { | ||||||||||||||
| modelValue: CalendarDate | ||||||||||||||
| placeholder?: string | ||||||||||||||
| timePlaceholder?: string | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is |
||||||||||||||
| initialTime?: string | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| const props = defineProps<Props>() | ||||||||||||||
|
|
||||||||||||||
| const emit = defineEmits<{ | ||||||||||||||
| (e: 'update:modelValue', date: CalendarDate): void | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use |
||||||||||||||
| (e: 'update:time', time: string): void | ||||||||||||||
| (e: 'update', value: { date: CalendarDate; time: string }): void | ||||||||||||||
| }>() | ||||||||||||||
|
|
||||||||||||||
| const selectedTime = ref<string>(props.initialTime || '') | ||||||||||||||
| const df = new DateFormatter(locale.value, { dateStyle: 'long' }) | ||||||||||||||
|
|
||||||||||||||
| watch([() => props.modelValue, selectedTime], () => { | ||||||||||||||
| emit('update', { | ||||||||||||||
| date: props.modelValue, | ||||||||||||||
| time: selectedTime.value, | ||||||||||||||
| }) | ||||||||||||||
| }) | ||||||||||||||
| </script> | ||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this removed?