@onereach/ui-components 3.0.3-beta.2484.0 → 3.0.4-beta.2486.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-6e29db50.js → OrCardCollection-ad2240ac.js} +1 -1
- package/dist/bundled/v2/{OrConfirm-98d9a7b0.js → OrConfirm-d548aac0.js} +1 -1
- package/dist/bundled/v2/OrDateTimePicker-60e1a7ee.js +1083 -0
- package/dist/bundled/v2/{OrInput-900df60c.js → OrInput-ae333c94.js} +2 -2
- package/dist/bundled/v2/{OrInputBox-4d265915.js → OrInputBox-11b6ac9f.js} +1 -1
- package/dist/bundled/v2/{OrSearch-22e60302.js → OrSearch-86a009af.js} +2 -2
- package/dist/bundled/v2/{OrSelect-0675a404.js → OrSelect-2834d2bc.js} +4 -4
- package/dist/bundled/v2/{OrTextarea-5027c642.js → OrTextarea-8d35e641.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-518bff34.js → OrCardCollection.vue_vue_type_script_lang-61f92c57.js} +1 -1
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-9bfe8cdd.js → OrConfirm.vue_vue_type_script_lang-6bf48817.js} +2 -2
- package/dist/bundled/v3/OrDateTimePicker.vue_vue_type_script_lang-fb197c2f.js +718 -0
- package/dist/bundled/v3/{OrInput-d23f9223.js → OrInput-8171968f.js} +1 -1
- package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-fde0f78f.js → OrInput.vue_vue_type_script_lang-862ecd79.js} +3 -3
- package/dist/bundled/v3/{OrInputBox-66241142.js → OrInputBox-688eb48b.js} +1 -1
- package/dist/bundled/v3/{OrInputBox.vue_vue_type_script_lang-d07fa3ad.js → OrInputBox.vue_vue_type_script_lang-0e3ff329.js} +1 -1
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-2ac19dad.js → OrSearch.vue_vue_type_script_lang-b6e99b50.js} +3 -3
- package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-ee304265.js → OrSelect.vue_vue_type_script_lang-e497af2d.js} +6 -6
- package/dist/bundled/v3/{OrTextarea.vue_vue_type_script_lang-0ae5cda3.js → OrTextarea.vue_vue_type_script_lang-e5ae9a33.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-708ac4b5.js → OrCardCollection-662d5727.js} +2 -2
- package/dist/esm/v2/{OrConfirm-7eee1481.js → OrConfirm-1be17f86.js} +1 -1
- package/dist/esm/v2/OrDateTimePicker-4b650aca.js +1076 -0
- package/dist/esm/v2/{OrInput-a7903c0f.js → OrInput-5efcb134.js} +2 -2
- package/dist/esm/v2/{OrInputBox-6b1aec08.js → OrInputBox-0f4e8500.js} +1 -1
- package/dist/esm/v2/{OrInputBox.vue_rollup-plugin-vue_script-23426690.js → OrInputBox.vue_rollup-plugin-vue_script-b2d0c353.js} +1 -1
- package/dist/esm/v2/{OrSearch-97a701b0.js → OrSearch-12782f78.js} +2 -2
- package/dist/esm/v2/{OrSelect-2d48ddee.js → OrSelect-78c2adc6.js} +4 -4
- package/dist/esm/v2/{OrTextarea-2d5d0be6.js → OrTextarea-839a422d.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-62d1d8d5.js → OrCardCollection-aa7f0c81.js} +2 -2
- package/dist/esm/v3/{OrConfirm-b74191d6.js → OrConfirm-ecb8c576.js} +1 -1
- package/dist/esm/v3/OrDateTimePicker-3e2dc067.js +863 -0
- package/dist/esm/v3/{OrInput-f0748c95.js → OrInput-dae6e478.js} +1 -1
- package/dist/esm/v3/{OrInputBox-11389afd.js → OrInputBox-901887a1.js} +1 -1
- package/dist/esm/v3/{OrSearch-81b75244.js → OrSearch-9989bb31.js} +2 -2
- package/dist/esm/v3/{OrSelect-b9d45ab4.js → OrSelect-bb3c30ec.js} +3 -3
- package/dist/esm/v3/{OrTextarea-08b22d36.js → OrTextarea-2002e190.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 +2 -2
- 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 = {
|