@onereach/ui-components 2.76.6 → 2.76.7-beta.2437.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundled/v2/{OrCardCollection-5be7bd7b.js → OrCardCollection-9b9a27e2.js} +1 -1
- package/dist/bundled/v2/{OrConfirm-b12b5b01.js → OrConfirm-d9869784.js} +1 -1
- package/dist/bundled/v2/OrDateTimePicker-50333b2a.js +1083 -0
- package/dist/bundled/v2/{OrInput-913c682d.js → OrInput-a829ce97.js} +2 -2
- package/dist/bundled/v2/{OrInputBox-9a31d211.js → OrInputBox-3f886a00.js} +1 -1
- package/dist/bundled/v2/{OrSearch-ade6bf12.js → OrSearch-8d2a36b8.js} +2 -2
- package/dist/bundled/v2/{OrSelect-f85aecd5.js → OrSelect-ec9260d5.js} +4 -4
- package/dist/bundled/v2/{OrTextarea-e606a1f5.js → OrTextarea-2925c150.js} +2 -2
- package/dist/bundled/v2/components/index.d.ts +4 -3
- package/dist/bundled/v2/components/index.js +13 -12
- package/dist/bundled/v2/components/or-card-collection-v3/index.js +5 -5
- package/dist/bundled/v2/components/or-combined-input-v3/index.js +2 -2
- package/dist/bundled/v2/components/or-confirm-v3/index.js +4 -4
- package/dist/bundled/v2/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +184 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/index.d.ts +2 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/index.js +30 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/OrDateTimePickerDateSelect.vue.d.ts +30 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/styles.d.ts +1 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-mobile-control/OrDateTimePickerMobileControl.vue.d.ts +24 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-mobile-control/styles.d.ts +2 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +98 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/styles.d.ts +1 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-footer/OrDateTimePickerPopoverFooter.vue.d.ts +12 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-footer/styles.d.ts +1 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-header/OrDateTimePickerPopoverHeader.vue.d.ts +8 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-header/styles.d.ts +1 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +54 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/styles.d.ts +3 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/props.d.ts +1 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/styles.d.ts +2 -0
- package/dist/bundled/v2/components/or-input-box-v3/index.js +2 -2
- package/dist/bundled/v2/components/or-input-v3/index.js +3 -3
- package/dist/bundled/v2/components/or-search-v3/index.js +4 -4
- package/dist/bundled/v2/components/or-select-v3/index.js +5 -5
- package/dist/bundled/v2/components/or-textarea-v3/index.js +3 -3
- package/dist/bundled/v2/directives/index.js +1 -1
- package/dist/bundled/v2/{dropdown-open-e2a93aaf.js → dropdown-open-10460fec.js} +7 -1
- package/dist/bundled/v2/index.js +13 -12
- package/dist/bundled/v2/{props-78496a2d.js → props-c966ae5f.js} +1 -1
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-9f48249b.js → OrCardCollection.vue_vue_type_script_lang-5a295c7c.js} +1 -1
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-ede2f483.js → OrConfirm.vue_vue_type_script_lang-6ad3a25b.js} +2 -2
- package/dist/bundled/v3/OrDateTimePicker.vue_vue_type_script_lang-ead330d0.js +718 -0
- package/dist/bundled/v3/{OrInput-e980b0c5.js → OrInput-9deb9d78.js} +1 -1
- package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-4285176c.js → OrInput.vue_vue_type_script_lang-ff77fb1f.js} +3 -3
- package/dist/bundled/v3/{OrInputBox-44f37541.js → OrInputBox-73cb16b2.js} +1 -1
- package/dist/bundled/v3/{OrInputBox.vue_vue_type_script_lang-c4f9c8ef.js → OrInputBox.vue_vue_type_script_lang-b94e3d29.js} +1 -1
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-04675cdd.js → OrSearch.vue_vue_type_script_lang-c0c711e3.js} +3 -3
- package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-949f5893.js → OrSelect.vue_vue_type_script_lang-f920dc5a.js} +6 -6
- package/dist/bundled/v3/{OrTextarea.vue_vue_type_script_lang-043a2a9d.js → OrTextarea.vue_vue_type_script_lang-5a3d824a.js} +3 -3
- package/dist/bundled/v3/components/index.d.ts +4 -3
- package/dist/bundled/v3/components/index.js +17 -16
- package/dist/bundled/v3/components/or-card-collection-v3/index.js +7 -7
- package/dist/bundled/v3/components/or-combined-input-v3/index.js +2 -2
- package/dist/bundled/v3/components/or-confirm-v3/index.js +6 -6
- package/dist/bundled/v3/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +184 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/index.d.ts +2 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/index.js +35 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/OrDateTimePickerDateSelect.vue.d.ts +30 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/styles.d.ts +1 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-mobile-control/OrDateTimePickerMobileControl.vue.d.ts +24 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-mobile-control/styles.d.ts +2 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +98 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/styles.d.ts +1 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-footer/OrDateTimePickerPopoverFooter.vue.d.ts +12 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-footer/styles.d.ts +1 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-header/OrDateTimePickerPopoverHeader.vue.d.ts +8 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-header/styles.d.ts +1 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +54 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/styles.d.ts +3 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/props.d.ts +1 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/styles.d.ts +2 -0
- package/dist/bundled/v3/components/or-input-box-v3/index.js +2 -2
- package/dist/bundled/v3/components/or-input-v3/index.js +4 -4
- package/dist/bundled/v3/components/or-search-v3/index.js +6 -6
- package/dist/bundled/v3/components/or-select-v3/index.js +7 -7
- package/dist/bundled/v3/components/or-textarea-v3/index.js +4 -4
- package/dist/bundled/v3/directives/index.js +1 -1
- package/dist/bundled/v3/{dropdown-open-293d2de2.js → dropdown-open-0a494cc1.js} +7 -1
- package/dist/bundled/v3/index.js +478 -324
- package/dist/bundled/v3/{props-78496a2d.js → props-c966ae5f.js} +1 -1
- package/dist/esm/v2/{OrCardCollection-88451f3f.js → OrCardCollection-fd3cf877.js} +2 -2
- package/dist/esm/v2/{OrConfirm-d9fb300f.js → OrConfirm-6fa5b7af.js} +1 -1
- package/dist/esm/v2/OrDateTimePicker-f68ad985.js +1076 -0
- package/dist/esm/v2/{OrInput-0a40888a.js → OrInput-ff77b040.js} +2 -2
- package/dist/esm/v2/{OrInputBox-5c4b3104.js → OrInputBox-be814696.js} +1 -1
- package/dist/esm/v2/{OrInputBox.vue_rollup-plugin-vue_script-4ba46db4.js → OrInputBox.vue_rollup-plugin-vue_script-cc0bf870.js} +1 -1
- package/dist/esm/v2/{OrSearch-429d7386.js → OrSearch-a269c191.js} +2 -2
- package/dist/esm/v2/{OrSelect-de0ad257.js → OrSelect-16b38bb4.js} +4 -4
- package/dist/esm/v2/{OrTextarea-a51a7959.js → OrTextarea-aa52ecfe.js} +2 -2
- package/dist/esm/v2/components/index.d.ts +4 -3
- package/dist/esm/v2/components/index.js +13 -12
- package/dist/esm/v2/components/or-card-collection-v3/index.js +5 -5
- package/dist/esm/v2/components/or-combined-input-v3/index.js +2 -2
- package/dist/esm/v2/components/or-confirm-v3/index.js +4 -4
- package/dist/esm/v2/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +184 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/index.d.ts +2 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/index.js +28 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/OrDateTimePickerDateSelect.vue.d.ts +30 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/styles.d.ts +1 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-mobile-control/OrDateTimePickerMobileControl.vue.d.ts +24 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-mobile-control/styles.d.ts +2 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +98 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/styles.d.ts +1 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-footer/OrDateTimePickerPopoverFooter.vue.d.ts +12 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-footer/styles.d.ts +1 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-header/OrDateTimePickerPopoverHeader.vue.d.ts +8 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-header/styles.d.ts +1 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +54 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/styles.d.ts +3 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/props.d.ts +1 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/styles.d.ts +2 -0
- package/dist/esm/v2/components/or-input-box-v3/index.js +2 -2
- package/dist/esm/v2/components/or-input-v3/index.js +3 -3
- package/dist/esm/v2/components/or-search-v3/index.js +4 -4
- package/dist/esm/v2/components/or-select-v3/index.js +5 -5
- package/dist/esm/v2/components/or-textarea-v3/index.js +3 -3
- package/dist/esm/v2/directives/index.js +1 -1
- package/dist/esm/v2/{dropdown-open-0d314aa4.js → dropdown-open-e1f90e0a.js} +7 -1
- package/dist/esm/v2/index.js +12 -11
- package/dist/esm/v3/{OrCardCollection-8339ebe2.js → OrCardCollection-3e469384.js} +2 -2
- package/dist/esm/v3/{OrConfirm-e821e06e.js → OrConfirm-b52b8135.js} +1 -1
- package/dist/esm/v3/OrDateTimePicker-2d71e737.js +863 -0
- package/dist/esm/v3/{OrInput-d16b7930.js → OrInput-64f9797c.js} +1 -1
- package/dist/esm/v3/{OrInputBox-2467d7e4.js → OrInputBox-e1ee2130.js} +1 -1
- package/dist/esm/v3/{OrSearch-4568eb9d.js → OrSearch-a4a8f33f.js} +2 -2
- package/dist/esm/v3/{OrSelect-2e683ddd.js → OrSelect-b7498180.js} +3 -3
- package/dist/esm/v3/{OrTextarea-f10160cb.js → OrTextarea-e7896ed1.js} +1 -1
- package/dist/esm/v3/components/index.d.ts +4 -3
- package/dist/esm/v3/components/index.js +12 -11
- package/dist/esm/v3/components/or-card-collection-v3/index.js +4 -4
- package/dist/esm/v3/components/or-combined-input-v3/index.js +2 -2
- package/dist/esm/v3/components/or-confirm-v3/index.js +3 -3
- package/dist/esm/v3/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +184 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/index.d.ts +2 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/index.js +26 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/OrDateTimePickerDateSelect.vue.d.ts +30 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/styles.d.ts +1 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-mobile-control/OrDateTimePickerMobileControl.vue.d.ts +24 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-mobile-control/styles.d.ts +2 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +98 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/styles.d.ts +1 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-footer/OrDateTimePickerPopoverFooter.vue.d.ts +12 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-footer/styles.d.ts +1 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-header/OrDateTimePickerPopoverHeader.vue.d.ts +8 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-header/styles.d.ts +1 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +54 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/styles.d.ts +3 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/props.d.ts +1 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/styles.d.ts +2 -0
- package/dist/esm/v3/components/or-input-box-v3/index.js +1 -1
- package/dist/esm/v3/components/or-input-v3/index.js +2 -2
- package/dist/esm/v3/components/or-search-v3/index.js +3 -3
- package/dist/esm/v3/components/or-select-v3/index.js +4 -4
- package/dist/esm/v3/components/or-textarea-v3/index.js +2 -2
- package/dist/esm/v3/directives/index.js +1 -1
- package/dist/esm/v3/{dropdown-open-0d314aa4.js → dropdown-open-e1f90e0a.js} +7 -1
- package/dist/esm/v3/index.js +11 -10
- package/package.json +3 -4
- package/src/components/index.ts +4 -3
- package/src/components/or-date-time-picker-v3/OrDateTimePicker.docs.mdx +7 -0
- package/src/components/or-date-time-picker-v3/OrDateTimePicker.stories3.ts +156 -0
- package/src/components/or-date-time-picker-v3/OrDateTimePicker.vue +373 -0
- package/src/components/or-date-time-picker-v3/index.ts +2 -0
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/OrDateTimePickerDateSelect.vue +63 -0
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/styles.ts +10 -0
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-mobile-control/OrDateTimePickerMobileControl.vue +58 -0
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-mobile-control/styles.ts +16 -0
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue +210 -0
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/styles.ts +10 -0
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-footer/OrDateTimePickerPopoverFooter.vue +59 -0
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-footer/styles.ts +13 -0
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-header/OrDateTimePickerPopoverHeader.vue +37 -0
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-popover-header/styles.ts +10 -0
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue +146 -0
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/styles.ts +34 -0
- package/src/components/or-date-time-picker-v3/props.ts +1 -0
- package/src/components/or-date-time-picker-v3/styles.ts +16 -0
- package/src/directives/dropdown-close.ts +1 -0
- package/src/directives/dropdown-open.ts +7 -1
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="root"
|
|
4
|
+
:class="rootStyles"
|
|
5
|
+
>
|
|
6
|
+
<OrIconButton
|
|
7
|
+
:icon="'chevron_left'"
|
|
8
|
+
@click.stop="monthValue = monthValue - 1"
|
|
9
|
+
/>
|
|
10
|
+
|
|
11
|
+
<div :class="['layout-row', 'gap-md']">
|
|
12
|
+
<OrButton
|
|
13
|
+
ref="monthButton"
|
|
14
|
+
:variant="'link'"
|
|
15
|
+
:color="'inherit'"
|
|
16
|
+
@click.stop="monthMenu.open()"
|
|
17
|
+
>
|
|
18
|
+
{{ monthLabel }} <OrIcon :icon="'arrow_drop_down'" />
|
|
19
|
+
</OrButton>
|
|
20
|
+
|
|
21
|
+
<OrButton
|
|
22
|
+
ref="yearButton"
|
|
23
|
+
:variant="'link'"
|
|
24
|
+
:color="'inherit'"
|
|
25
|
+
@click.stop="yearMenu.open()"
|
|
26
|
+
>
|
|
27
|
+
{{ yearLabel }} <OrIcon :icon="'arrow_drop_down'" />
|
|
28
|
+
</OrButton>
|
|
29
|
+
|
|
30
|
+
<OrMenu
|
|
31
|
+
ref="monthMenu"
|
|
32
|
+
:trigger="monthButtonRoot"
|
|
33
|
+
>
|
|
34
|
+
<OrMenuItem
|
|
35
|
+
v-for="option in monthOptions"
|
|
36
|
+
:key="option.value"
|
|
37
|
+
@click.stop="monthValue = option.value; monthMenu.close()"
|
|
38
|
+
>
|
|
39
|
+
{{ option.label }}
|
|
40
|
+
</OrMenuItem>
|
|
41
|
+
</OrMenu>
|
|
42
|
+
|
|
43
|
+
<OrMenu
|
|
44
|
+
ref="yearMenu"
|
|
45
|
+
:trigger="yearButtonRoot"
|
|
46
|
+
>
|
|
47
|
+
<OrMenuItem
|
|
48
|
+
v-for="option in yearOptions"
|
|
49
|
+
:key="option.value"
|
|
50
|
+
@click.stop="yearValue = option.value; yearMenu.close()"
|
|
51
|
+
>
|
|
52
|
+
{{ option.label }}
|
|
53
|
+
</OrMenuItem>
|
|
54
|
+
</OrMenu>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<OrIconButton
|
|
58
|
+
:icon="'chevron_right'"
|
|
59
|
+
@click.stop="monthValue = monthValue + 1"
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<script lang="ts">
|
|
65
|
+
import { computed, defineComponent, ref } from 'vue-demi';
|
|
66
|
+
import { OrButtonV3 as OrButton } from '../../../or-button-v3';
|
|
67
|
+
import { OrIconButtonV3 as OrIconButton } from '../../../or-icon-button-v3';
|
|
68
|
+
import { OrIconV3 as OrIcon } from '../../../or-icon-v3';
|
|
69
|
+
import { OrMenuItemV3 as OrMenuItem } from '../../../or-menu-item-v3';
|
|
70
|
+
import { OrMenuV3 as OrMenu } from '../../../or-menu-v3';
|
|
71
|
+
import { DateTimePickerMonthSelect } from './styles';
|
|
72
|
+
|
|
73
|
+
export default defineComponent({
|
|
74
|
+
name: 'OrDateTimePickerMonthSelect',
|
|
75
|
+
|
|
76
|
+
components: {
|
|
77
|
+
OrButton,
|
|
78
|
+
OrIcon,
|
|
79
|
+
OrIconButton,
|
|
80
|
+
OrMenu,
|
|
81
|
+
OrMenuItem,
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
model: {
|
|
85
|
+
prop: 'modelValue',
|
|
86
|
+
event: 'update:modelValue',
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
props: {
|
|
90
|
+
modelValue: {
|
|
91
|
+
type: Date,
|
|
92
|
+
default: undefined,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
emits: [
|
|
97
|
+
'update:modelValue',
|
|
98
|
+
],
|
|
99
|
+
|
|
100
|
+
expose: [
|
|
101
|
+
'root',
|
|
102
|
+
],
|
|
103
|
+
|
|
104
|
+
setup(props, context) {
|
|
105
|
+
// Refs
|
|
106
|
+
const root = ref<HTMLElement>();
|
|
107
|
+
|
|
108
|
+
const monthButton = ref<InstanceType<typeof OrButton>>();
|
|
109
|
+
const yearButton = ref<InstanceType<typeof OrButton>>();
|
|
110
|
+
|
|
111
|
+
const monthButtonRoot = computed(() => monthButton.value?.root);
|
|
112
|
+
const yearButtonRoot = computed(() => yearButton.value?.root);
|
|
113
|
+
|
|
114
|
+
const monthMenu = ref<InstanceType<typeof OrMenu>>();
|
|
115
|
+
const yearMenu = ref<InstanceType<typeof OrMenu>>();
|
|
116
|
+
|
|
117
|
+
// const monthMenuState = computed(() => monthMenu.value?.state);
|
|
118
|
+
// const yearMenuState = computed(() => yearMenu.value?.state);
|
|
119
|
+
|
|
120
|
+
// Styles
|
|
121
|
+
const rootStyles = computed(() => [
|
|
122
|
+
'or-date-time-picker-month-select',
|
|
123
|
+
...DateTimePickerMonthSelect,
|
|
124
|
+
]);
|
|
125
|
+
|
|
126
|
+
// State
|
|
127
|
+
const proxyModelValue = computed({
|
|
128
|
+
get: () => props.modelValue,
|
|
129
|
+
|
|
130
|
+
set: (value) => {
|
|
131
|
+
context.emit('update:modelValue', value);
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
const yearValue = computed({
|
|
136
|
+
get: () => proxyModelValue.value?.getUTCFullYear() ?? new Date().getUTCFullYear(),
|
|
137
|
+
|
|
138
|
+
set: (value) => {
|
|
139
|
+
proxyModelValue.value = new Date(Date.UTC(
|
|
140
|
+
value,
|
|
141
|
+
proxyModelValue.value?.getUTCMonth() ?? monthValue.value,
|
|
142
|
+
proxyModelValue.value?.getUTCDate() ?? 1,
|
|
143
|
+
proxyModelValue.value?.getUTCHours() ?? 0,
|
|
144
|
+
proxyModelValue.value?.getUTCMinutes() ?? 0,
|
|
145
|
+
));
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
const monthValue = computed({
|
|
150
|
+
get: () => proxyModelValue.value?.getUTCMonth() ?? new Date().getUTCMonth(),
|
|
151
|
+
|
|
152
|
+
set: (value) => {
|
|
153
|
+
proxyModelValue.value = new Date(Date.UTC(
|
|
154
|
+
proxyModelValue.value?.getUTCFullYear() ?? yearValue.value,
|
|
155
|
+
value,
|
|
156
|
+
proxyModelValue.value?.getUTCDate() ?? 1,
|
|
157
|
+
proxyModelValue.value?.getUTCHours() ?? 0,
|
|
158
|
+
proxyModelValue.value?.getUTCMinutes() ?? 0,
|
|
159
|
+
));
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
const yearLabel = computed(() => {
|
|
164
|
+
return yearOptions.find(({ value }) => value === yearValue.value)?.label;
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
const monthLabel = computed(() => {
|
|
168
|
+
return monthOptions.find(({ value }) => value === monthValue.value)?.label;
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
const yearOptions = Array.from({ length: 100 }, (_value, index) => {
|
|
172
|
+
const year = new Date().getUTCFullYear() - index;
|
|
173
|
+
|
|
174
|
+
return {
|
|
175
|
+
value: year,
|
|
176
|
+
label: new Date(year, monthValue.value).toLocaleString([], { year: 'numeric' }),
|
|
177
|
+
};
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
const monthOptions = Array.from({ length: 12 }, (_value, index) => {
|
|
181
|
+
const month = index;
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
value: month,
|
|
185
|
+
label: new Date(yearValue.value, month).toLocaleString([], { month: 'long' }),
|
|
186
|
+
};
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
return {
|
|
190
|
+
root,
|
|
191
|
+
monthButton,
|
|
192
|
+
yearButton,
|
|
193
|
+
monthButtonRoot,
|
|
194
|
+
yearButtonRoot,
|
|
195
|
+
monthMenu,
|
|
196
|
+
yearMenu,
|
|
197
|
+
// monthMenuState,
|
|
198
|
+
// yearMenuState,
|
|
199
|
+
rootStyles,
|
|
200
|
+
proxyModelValue,
|
|
201
|
+
yearValue,
|
|
202
|
+
monthValue,
|
|
203
|
+
yearLabel,
|
|
204
|
+
monthLabel,
|
|
205
|
+
yearOptions,
|
|
206
|
+
monthOptions,
|
|
207
|
+
};
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
</script>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<footer
|
|
3
|
+
ref="root"
|
|
4
|
+
:class="rootStyles"
|
|
5
|
+
>
|
|
6
|
+
<OrButton
|
|
7
|
+
:variant="'outlined'"
|
|
8
|
+
@click.stop="$emit('resolve')"
|
|
9
|
+
>
|
|
10
|
+
Done
|
|
11
|
+
</OrButton>
|
|
12
|
+
|
|
13
|
+
<OrButton
|
|
14
|
+
:variant="'text'"
|
|
15
|
+
@click.stop="$emit('reject')"
|
|
16
|
+
>
|
|
17
|
+
Cancel
|
|
18
|
+
</OrButton>
|
|
19
|
+
</footer>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script lang="ts">
|
|
23
|
+
import { computed, defineComponent, ref } from 'vue-demi';
|
|
24
|
+
import { OrButtonV3 as OrButton } from '../../../or-button-v3';
|
|
25
|
+
import { DateTimePickerPopoverFooter } from './styles';
|
|
26
|
+
|
|
27
|
+
export default defineComponent({
|
|
28
|
+
name: 'OrDateTimePickerPopoverFooter',
|
|
29
|
+
|
|
30
|
+
components: {
|
|
31
|
+
OrButton,
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
emits: [
|
|
35
|
+
'resolve',
|
|
36
|
+
'reject',
|
|
37
|
+
],
|
|
38
|
+
|
|
39
|
+
expose: [
|
|
40
|
+
'root',
|
|
41
|
+
],
|
|
42
|
+
|
|
43
|
+
setup() {
|
|
44
|
+
// Refs
|
|
45
|
+
const root = ref<HTMLElement>();
|
|
46
|
+
|
|
47
|
+
// Styles
|
|
48
|
+
const rootStyles = computed(() => [
|
|
49
|
+
'or-date-time-picker-popover-footer',
|
|
50
|
+
...DateTimePickerPopoverFooter,
|
|
51
|
+
]);
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
root,
|
|
55
|
+
rootStyles,
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
</script>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<header
|
|
3
|
+
ref="root"
|
|
4
|
+
:class="rootStyles"
|
|
5
|
+
>
|
|
6
|
+
<slot />
|
|
7
|
+
</header>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import { computed, defineComponent, ref } from 'vue-demi';
|
|
12
|
+
import { DateTimePickerPopoverHeader } from './styles';
|
|
13
|
+
|
|
14
|
+
export default defineComponent({
|
|
15
|
+
name: 'OrDateTimePickerPopoverHeader',
|
|
16
|
+
|
|
17
|
+
expose: [
|
|
18
|
+
'root',
|
|
19
|
+
],
|
|
20
|
+
|
|
21
|
+
setup() {
|
|
22
|
+
// Refs
|
|
23
|
+
const root = ref<HTMLElement>();
|
|
24
|
+
|
|
25
|
+
// Styles
|
|
26
|
+
const rootStyles = computed(() => [
|
|
27
|
+
'or-date-time-picker-popover-header',
|
|
28
|
+
...DateTimePickerPopoverHeader,
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
root,
|
|
33
|
+
rootStyles,
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="root"
|
|
4
|
+
:class="rootStyles"
|
|
5
|
+
>
|
|
6
|
+
<div :class="buttonGroupStyles">
|
|
7
|
+
<OrButton
|
|
8
|
+
v-for="option in hoursOptions"
|
|
9
|
+
:key="option.value"
|
|
10
|
+
:class="buttonGroupItemStyles"
|
|
11
|
+
:variant="hoursValue === option.value ? 'contained' : 'text'"
|
|
12
|
+
:color="hoursValue === option.value ? 'primary' : 'inherit'"
|
|
13
|
+
@click.stop="hoursValue = option.value"
|
|
14
|
+
>
|
|
15
|
+
{{ option.label }}
|
|
16
|
+
</OrButton>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
:
|
|
20
|
+
|
|
21
|
+
<div :class="buttonGroupStyles">
|
|
22
|
+
<OrButton
|
|
23
|
+
v-for="option in minutesOptions"
|
|
24
|
+
:key="option.value"
|
|
25
|
+
:class="buttonGroupItemStyles"
|
|
26
|
+
:variant="minutesValue === option.value ? 'contained' : 'text'"
|
|
27
|
+
:color="minutesValue === option.value ? 'primary' : 'inherit'"
|
|
28
|
+
@click.stop="minutesValue = option.value"
|
|
29
|
+
>
|
|
30
|
+
{{ option.label }}
|
|
31
|
+
</OrButton>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script lang="ts">
|
|
37
|
+
import { computed, defineComponent, ref } from 'vue-demi';
|
|
38
|
+
import { OrButtonV3 as OrButton } from '../../../or-button-v3';
|
|
39
|
+
import { DateTimePickerTimeSelect, DateTimePickerTimeSelectButtonGroup, DateTimePickerTimeSelectButtonGroupItem } from './styles';
|
|
40
|
+
|
|
41
|
+
export default defineComponent({
|
|
42
|
+
name: 'OrDateTimePickerTimeSelect',
|
|
43
|
+
|
|
44
|
+
components: {
|
|
45
|
+
OrButton,
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
model: {
|
|
49
|
+
prop: 'modelValue',
|
|
50
|
+
event: 'update:modelValue',
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
props: {
|
|
54
|
+
modelValue: {
|
|
55
|
+
type: Date,
|
|
56
|
+
default: undefined,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
emits: [
|
|
61
|
+
'update:modelValue',
|
|
62
|
+
],
|
|
63
|
+
|
|
64
|
+
expose: [
|
|
65
|
+
'root',
|
|
66
|
+
],
|
|
67
|
+
|
|
68
|
+
setup(props, context) {
|
|
69
|
+
// Refs
|
|
70
|
+
const root = ref<HTMLElement>();
|
|
71
|
+
|
|
72
|
+
// Styles
|
|
73
|
+
const rootStyles = computed(() => [
|
|
74
|
+
'or-date-time-picker-time-select',
|
|
75
|
+
...DateTimePickerTimeSelect,
|
|
76
|
+
]);
|
|
77
|
+
|
|
78
|
+
const buttonGroupStyles = computed(() => [
|
|
79
|
+
...DateTimePickerTimeSelectButtonGroup,
|
|
80
|
+
]);
|
|
81
|
+
|
|
82
|
+
const buttonGroupItemStyles = computed(() => [
|
|
83
|
+
...DateTimePickerTimeSelectButtonGroupItem,
|
|
84
|
+
]);
|
|
85
|
+
|
|
86
|
+
// State
|
|
87
|
+
const proxyModelValue = computed({
|
|
88
|
+
get: () => props.modelValue,
|
|
89
|
+
|
|
90
|
+
set: (value) => {
|
|
91
|
+
context.emit('update:modelValue', value);
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const hoursValue = computed({
|
|
96
|
+
get: () => proxyModelValue.value?.getUTCHours() ?? 0,
|
|
97
|
+
|
|
98
|
+
set: (value) => {
|
|
99
|
+
proxyModelValue.value = new Date(Date.UTC(
|
|
100
|
+
proxyModelValue.value?.getUTCFullYear() ?? 1970,
|
|
101
|
+
proxyModelValue.value?.getUTCMonth() ?? 0,
|
|
102
|
+
proxyModelValue.value?.getUTCDate() ?? 1,
|
|
103
|
+
value,
|
|
104
|
+
proxyModelValue.value?.getUTCMinutes() ?? minutesValue.value,
|
|
105
|
+
));
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const minutesValue = computed({
|
|
110
|
+
get: () => proxyModelValue.value?.getUTCMinutes() ?? 0,
|
|
111
|
+
|
|
112
|
+
set: (value) => {
|
|
113
|
+
proxyModelValue.value = new Date(Date.UTC(
|
|
114
|
+
proxyModelValue.value?.getUTCFullYear() ?? 1970,
|
|
115
|
+
proxyModelValue.value?.getUTCMonth() ?? 0,
|
|
116
|
+
proxyModelValue.value?.getUTCDate() ?? 1,
|
|
117
|
+
proxyModelValue.value?.getUTCHours() ?? hoursValue.value,
|
|
118
|
+
value,
|
|
119
|
+
));
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
const hoursOptions = Array.from({ length: 24 }, (_value, index) => ({
|
|
124
|
+
value: index,
|
|
125
|
+
label: String(index).padStart(2, '0'),
|
|
126
|
+
}));
|
|
127
|
+
|
|
128
|
+
const minutesOptions = Array.from({ length: 60 }, (_value, index) => ({
|
|
129
|
+
value: index,
|
|
130
|
+
label: String(index).padStart(2, '0'),
|
|
131
|
+
}));
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
root,
|
|
135
|
+
rootStyles,
|
|
136
|
+
buttonGroupStyles,
|
|
137
|
+
buttonGroupItemStyles,
|
|
138
|
+
proxyModelValue,
|
|
139
|
+
hoursValue,
|
|
140
|
+
minutesValue,
|
|
141
|
+
hoursOptions,
|
|
142
|
+
minutesOptions,
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
</script>
|
package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/styles.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const DateTimePickerTimeSelect: string[] = [
|
|
2
|
+
// Layout
|
|
3
|
+
'layout-row justify-center',
|
|
4
|
+
|
|
5
|
+
// Spacing
|
|
6
|
+
'px-md',
|
|
7
|
+
'py-md',
|
|
8
|
+
|
|
9
|
+
'gap-sm',
|
|
10
|
+
|
|
11
|
+
// Typography
|
|
12
|
+
'typography-body-2-regular',
|
|
13
|
+
|
|
14
|
+
// Theme
|
|
15
|
+
'theme-foreground-default',
|
|
16
|
+
'dark:theme-foreground-default-dark',
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export const DateTimePickerTimeSelectButtonGroup: string[] = [
|
|
20
|
+
// Layout
|
|
21
|
+
'layout-column',
|
|
22
|
+
|
|
23
|
+
// Box
|
|
24
|
+
'max-h-[224px]',
|
|
25
|
+
|
|
26
|
+
// Overflow
|
|
27
|
+
'overflow-x-hidden',
|
|
28
|
+
'overflow-y-auto',
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
export const DateTimePickerTimeSelectButtonGroupItem: string[] = [
|
|
32
|
+
// Typography
|
|
33
|
+
'typography-caption-regular',
|
|
34
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputBoxSize as DateTimePickerSize } from '../or-input-box-v3';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const DateTimePicker: string[] = [
|
|
2
|
+
// Layout
|
|
3
|
+
'layout-column',
|
|
4
|
+
|
|
5
|
+
// Spacing
|
|
6
|
+
'gap-xs',
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
export const DateTimePickerControl: string[] = [
|
|
10
|
+
// Theme (focus)
|
|
11
|
+
'focus:theme-border-1-current',
|
|
12
|
+
'dark:focus:theme-border-1-current-dark',
|
|
13
|
+
|
|
14
|
+
'focus:theme-border-underline',
|
|
15
|
+
'dark:focus:theme-border-underline',
|
|
16
|
+
];
|
|
@@ -3,6 +3,7 @@ import { DirectiveBinding, DirectiveHook, isVue3 } from 'vue-demi';
|
|
|
3
3
|
const created: DirectiveHook = (element: HTMLElement, binding: DirectiveBinding<(event: Event) => void>) => {
|
|
4
4
|
element.addEventListener('keydown', (event) => {
|
|
5
5
|
event.preventDefault();
|
|
6
|
+
event.stopPropagation();
|
|
6
7
|
|
|
7
8
|
if (['Escape'].includes(event.key)) {
|
|
8
9
|
binding.value(event);
|
|
@@ -3,13 +3,19 @@ import { DirectiveBinding, DirectiveHook, isVue3 } from 'vue-demi';
|
|
|
3
3
|
const created: DirectiveHook = (element: HTMLElement, binding: DirectiveBinding<(event: Event) => void>) => {
|
|
4
4
|
element.addEventListener('keydown', (event) => {
|
|
5
5
|
event.preventDefault();
|
|
6
|
+
event.stopPropagation();
|
|
6
7
|
|
|
7
8
|
if (['Enter', ' '].includes(event.key)) {
|
|
8
9
|
binding.value(event);
|
|
9
10
|
}
|
|
10
11
|
});
|
|
11
12
|
|
|
12
|
-
element.addEventListener('click',
|
|
13
|
+
element.addEventListener('click', (event) => {
|
|
14
|
+
event.preventDefault();
|
|
15
|
+
event.stopPropagation();
|
|
16
|
+
|
|
17
|
+
binding.value(event);
|
|
18
|
+
});
|
|
13
19
|
};
|
|
14
20
|
|
|
15
21
|
export const DropdownOpen = {
|