@onereach/ui-components 3.0.4-beta.2486.0 → 3.0.4-beta.2497.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-ad2240ac.js → OrCardCollection-a10920a3.js} +1 -1
- package/dist/bundled/v2/{OrDateTimePicker-60e1a7ee.js → OrDateTimePicker-d6f327ad.js} +308 -176
- package/dist/bundled/v2/{OrMenu-cbb0c2c8.js → OrMenu-0c2c348c.js} +6 -1
- package/dist/bundled/v2/{OrPagination-cf47d71c.js → OrPagination-00ab6954.js} +1 -1
- package/dist/bundled/v2/{OrTabs-10f7e668.js → OrTabs-f7c9f754.js} +1 -1
- package/dist/bundled/v2/components/index.js +5 -5
- package/dist/bundled/v2/components/or-card-collection-v3/index.js +2 -2
- package/dist/bundled/v2/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +11 -1
- package/dist/bundled/v2/components/or-date-time-picker-v3/hooks/useDefaultDate.d.ts +1 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/hooks/useDefaultHours.d.ts +1 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/hooks/useDefaultMinutes.d.ts +1 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/hooks/useDefaultMonth.d.ts +1 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/hooks/useDefaultYear.d.ts +1 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/index.js +4 -4
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/{or-date-time-picker-date-select/OrDateTimePickerDateSelect.vue.d.ts → or-date-time-picker-day-select/OrDateTimePickerDaySelect.vue.d.ts} +8 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/styles.d.ts +3 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +26 -34
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +8 -20
- package/dist/bundled/v2/components/or-menu-v3/OrMenu.vue.d.ts +2 -0
- package/dist/bundled/v2/components/or-menu-v3/index.js +1 -1
- package/dist/bundled/v2/components/or-pagination-v3/index.js +2 -2
- package/dist/bundled/v2/components/or-tabs-v3/index.js +2 -2
- package/dist/bundled/v2/index.js +6 -6
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-61f92c57.js → OrCardCollection.vue_vue_type_script_lang-93c84377.js} +2 -2
- package/dist/bundled/v3/{OrDateTimePicker.vue_vue_type_script_lang-fb197c2f.js → OrDateTimePicker.vue_vue_type_script_lang-ba3ac4fb.js} +281 -165
- package/dist/bundled/v3/{OrMenu-89afef68.js → OrMenu-101f1c62.js} +1 -1
- package/dist/bundled/v3/{OrMenu.vue_vue_type_script_lang-f6748a99.js → OrMenu.vue_vue_type_script_lang-7ba15d1d.js} +6 -1
- package/dist/bundled/v3/{OrPagination.vue_vue_type_script_lang-7673a00e.js → OrPagination.vue_vue_type_script_lang-d3e6732f.js} +2 -2
- package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-ebd2a59d.js → OrTabs.vue_vue_type_script_lang-513b1e98.js} +2 -2
- package/dist/bundled/v3/components/index.js +6 -6
- package/dist/bundled/v3/components/or-card-collection-v3/index.js +3 -3
- package/dist/bundled/v3/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +11 -1
- package/dist/bundled/v3/components/or-date-time-picker-v3/hooks/useDefaultDate.d.ts +1 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/hooks/useDefaultHours.d.ts +1 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/hooks/useDefaultMinutes.d.ts +1 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/hooks/useDefaultMonth.d.ts +1 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/hooks/useDefaultYear.d.ts +1 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/index.js +5 -5
- package/dist/{esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/OrDateTimePickerDateSelect.vue.d.ts → bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/OrDateTimePickerDaySelect.vue.d.ts} +8 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/styles.d.ts +3 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +26 -34
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +8 -20
- package/dist/bundled/v3/components/or-menu-v3/OrMenu.vue.d.ts +2 -0
- package/dist/bundled/v3/components/or-menu-v3/index.js +1 -1
- package/dist/bundled/v3/components/or-pagination-v3/index.js +3 -3
- package/dist/bundled/v3/components/or-tabs-v3/index.js +3 -3
- package/dist/bundled/v3/index.js +50 -32
- package/dist/esm/v2/{OrCardCollection-662d5727.js → OrCardCollection-54079e79.js} +1 -1
- package/dist/esm/v2/{OrDateTimePicker-4b650aca.js → OrDateTimePicker-57094f24.js} +316 -184
- package/dist/esm/v2/{OrMenu-47b319a6.js → OrMenu-18a7f179.js} +6 -1
- package/dist/esm/v2/{OrPagination-4d330d4f.js → OrPagination-16f6d75b.js} +1 -1
- package/dist/esm/v2/{OrTabs-f0e4db08.js → OrTabs-18df1ce9.js} +1 -1
- package/dist/esm/v2/components/index.js +5 -5
- package/dist/esm/v2/components/or-card-collection-v3/index.js +2 -2
- package/dist/esm/v2/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +11 -1
- package/dist/esm/v2/components/or-date-time-picker-v3/hooks/useDefaultDate.d.ts +1 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/hooks/useDefaultHours.d.ts +1 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/hooks/useDefaultMinutes.d.ts +1 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/hooks/useDefaultMonth.d.ts +1 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/hooks/useDefaultYear.d.ts +1 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/index.js +5 -5
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/{or-date-time-picker-date-select/OrDateTimePickerDateSelect.vue.d.ts → or-date-time-picker-day-select/OrDateTimePickerDaySelect.vue.d.ts} +8 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/styles.d.ts +3 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +26 -34
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +8 -20
- package/dist/esm/v2/components/or-menu-v3/OrMenu.vue.d.ts +2 -0
- package/dist/esm/v2/components/or-menu-v3/index.js +1 -1
- package/dist/esm/v2/components/or-pagination-v3/index.js +2 -2
- package/dist/esm/v2/components/or-tabs-v3/index.js +2 -2
- package/dist/esm/v2/index.js +5 -5
- package/dist/esm/v3/{OrCardCollection-aa7f0c81.js → OrCardCollection-b937aa7a.js} +1 -1
- package/dist/esm/v3/{OrDateTimePicker-3e2dc067.js → OrDateTimePicker-a8247a84.js} +321 -187
- package/dist/esm/v3/{OrMenu-053a9ab7.js → OrMenu-70cee836.js} +6 -1
- package/dist/esm/v3/{OrPagination-f2d104d9.js → OrPagination-7f4ed166.js} +1 -1
- package/dist/esm/v3/{OrTabs-d9e2a07e.js → OrTabs-0a5c80be.js} +1 -1
- package/dist/esm/v3/components/index.js +5 -5
- package/dist/esm/v3/components/or-card-collection-v3/index.js +2 -2
- package/dist/esm/v3/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +11 -1
- package/dist/esm/v3/components/or-date-time-picker-v3/hooks/useDefaultDate.d.ts +1 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/hooks/useDefaultHours.d.ts +1 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/hooks/useDefaultMinutes.d.ts +1 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/hooks/useDefaultMonth.d.ts +1 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/hooks/useDefaultYear.d.ts +1 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/index.js +4 -4
- package/dist/{bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/OrDateTimePickerDateSelect.vue.d.ts → esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/OrDateTimePickerDaySelect.vue.d.ts} +8 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/styles.d.ts +3 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +26 -34
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +8 -20
- package/dist/esm/v3/components/or-menu-v3/OrMenu.vue.d.ts +2 -0
- package/dist/esm/v3/components/or-menu-v3/index.js +1 -1
- package/dist/esm/v3/components/or-pagination-v3/index.js +2 -2
- package/dist/esm/v3/components/or-tabs-v3/index.js +2 -2
- package/dist/esm/v3/index.js +5 -5
- package/package.json +2 -2
- package/src/components/or-date-time-picker-v3/OrDateTimePicker.vue +88 -39
- package/src/components/or-date-time-picker-v3/hooks/useDefaultDate.ts +3 -0
- package/src/components/or-date-time-picker-v3/hooks/useDefaultHours.ts +3 -0
- package/src/components/or-date-time-picker-v3/hooks/useDefaultMinutes.ts +3 -0
- package/src/components/or-date-time-picker-v3/hooks/useDefaultMonth.ts +3 -0
- package/src/components/or-date-time-picker-v3/hooks/useDefaultYear.ts +3 -0
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/OrDateTimePickerDaySelect.vue +162 -0
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/styles.ts +31 -0
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue +101 -79
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue +58 -42
- package/src/components/or-date-time-picker-v3/styles.ts +5 -2
- package/src/components/or-menu-v3/OrMenu.vue +3 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/styles.d.ts +0 -1
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/styles.d.ts +0 -1
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/styles.d.ts +0 -1
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/styles.d.ts +0 -1
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/OrDateTimePickerDateSelect.vue +0 -63
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/styles.ts +0 -10
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, reactive } from 'vue-demi';
|
|
2
|
-
import { s as styleInject } from './style-inject.es-4c6f2515.js';
|
|
3
|
-
import { _ as __vue_component__$f } from './OrInputBox-0f4e8500.js';
|
|
4
|
-
import { I as InputBoxSize } from './OrInputBox.vue_rollup-plugin-vue_script-b2d0c353.js';
|
|
1
|
+
import { defineComponent, ref, computed, reactive, watch } from 'vue-demi';
|
|
5
2
|
import { D as DropdownClose, a as DropdownOpen } from './dropdown-open-e1f90e0a.js';
|
|
6
3
|
import { a as useIdAttribute, u as useControlAttributes } from './useIdAttribute-859439f0.js';
|
|
7
4
|
import '@vueuse/core';
|
|
@@ -9,22 +6,60 @@ import { u as useValidationAttributes } from './useValidationAttributes-d1abbe34
|
|
|
9
6
|
import { _ as __vue_component__$d } from './OrError-4ffc1c39.js';
|
|
10
7
|
import { _ as __vue_component__$e } from './OrHint-aa221198.js';
|
|
11
8
|
import { _ as __vue_component__$a } from './OrIconButton-ec2e21aa.js';
|
|
12
|
-
import { _ as __vue_component__$
|
|
9
|
+
import { _ as __vue_component__$f } from './OrInputBox-0f4e8500.js';
|
|
10
|
+
import { I as InputBoxSize } from './OrInputBox.vue_rollup-plugin-vue_script-b2d0c353.js';
|
|
11
|
+
import { _ as __vue_component__$8 } from './OrLabel-63380256.js';
|
|
13
12
|
import { _ as __vue_component__$g } from './OrPopover-83c885d0.js';
|
|
13
|
+
import { _ as __vue_component__$7 } from './OrButton-2283df1c.js';
|
|
14
14
|
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
15
|
-
import { _ as __vue_component__$8 } from './OrButton-2283df1c.js';
|
|
16
15
|
import { _ as __vue_component__$9 } from './OrIcon-d35a84d8.js';
|
|
17
16
|
import { _ as __vue_component__$c } from './OrMenuItem-6f9b8a93.js';
|
|
18
|
-
import { _ as __vue_component__$b } from './OrMenu-
|
|
17
|
+
import { _ as __vue_component__$b } from './OrMenu-18a7f179.js';
|
|
18
|
+
import { s as styleInject } from './style-inject.es-4c6f2515.js';
|
|
19
|
+
|
|
20
|
+
function useDefaultDate() {
|
|
21
|
+
return new Date().getUTCDate();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function useDefaultHours() {
|
|
25
|
+
return 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function useDefaultMinutes() {
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
19
31
|
|
|
20
|
-
|
|
32
|
+
function useDefaultMonth() {
|
|
33
|
+
return new Date().getUTCMonth();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function useDefaultYear() {
|
|
37
|
+
return new Date().getUTCFullYear();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const DateTimePickerDaySelect = [
|
|
21
41
|
// Layout
|
|
22
42
|
'layout-column',
|
|
23
43
|
// Spacing
|
|
24
44
|
'px-md', 'py-md', 'gap-sm'];
|
|
45
|
+
const DateTimePickerDaySelectButtonGroup = [
|
|
46
|
+
// Layout
|
|
47
|
+
'grid', 'grid-cols-7',
|
|
48
|
+
// Spacing
|
|
49
|
+
'gap-xs'];
|
|
50
|
+
const DateTimePickerDaySelectButtonGroupItem = [
|
|
51
|
+
// Box
|
|
52
|
+
'min-w-fit',
|
|
53
|
+
// Spacing
|
|
54
|
+
'!px-sm', '!py-sm',
|
|
55
|
+
// Typography
|
|
56
|
+
'typography-caption-regular'];
|
|
25
57
|
|
|
26
58
|
var script$6 = defineComponent({
|
|
27
|
-
name: '
|
|
59
|
+
name: 'OrDateTimePickerDaySelect',
|
|
60
|
+
components: {
|
|
61
|
+
OrButton: __vue_component__$7
|
|
62
|
+
},
|
|
28
63
|
model: {
|
|
29
64
|
prop: 'modelValue',
|
|
30
65
|
event: 'update:modelValue'
|
|
@@ -41,18 +76,49 @@ var script$6 = defineComponent({
|
|
|
41
76
|
// Refs
|
|
42
77
|
const root = ref();
|
|
43
78
|
// Styles
|
|
44
|
-
const rootStyles = computed(() => ['or-date-time-picker-
|
|
79
|
+
const rootStyles = computed(() => ['or-date-time-picker-day-select', ...DateTimePickerDaySelect]);
|
|
80
|
+
const buttonGroupStyles = computed(() => [...DateTimePickerDaySelectButtonGroup]);
|
|
81
|
+
const buttonGroupItemStyles = computed(() => [...DateTimePickerDaySelectButtonGroupItem]);
|
|
45
82
|
// State
|
|
46
83
|
const proxyModelValue = computed({
|
|
47
|
-
get: () =>
|
|
84
|
+
get: () => {
|
|
85
|
+
var _a;
|
|
86
|
+
return (_a = props.modelValue) !== null && _a !== void 0 ? _a : new Date(Date.UTC(useDefaultYear(), useDefaultMonth(), useDefaultDate(), useDefaultHours(), useDefaultMinutes()));
|
|
87
|
+
},
|
|
48
88
|
set: value => {
|
|
49
89
|
context.emit('update:modelValue', value);
|
|
50
90
|
}
|
|
51
91
|
});
|
|
92
|
+
const dayOptions = computed(() => {
|
|
93
|
+
const monthStartDate = new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth(), 1, proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
|
|
94
|
+
const monthEndDate = new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth() + 1, 0, proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
|
|
95
|
+
const calendarStartDate = new Date(Date.UTC(monthStartDate.getUTCFullYear(), monthStartDate.getUTCMonth(), 1 - (monthStartDate.getUTCDay() + 6) % 7, monthStartDate.getUTCHours(), monthStartDate.getUTCMinutes()));
|
|
96
|
+
const calendarEndDate = new Date(Date.UTC(monthEndDate.getUTCFullYear(), monthEndDate.getUTCMonth() + 1, (7 - monthEndDate.getUTCDay()) % 7, monthEndDate.getUTCHours(), monthEndDate.getUTCMinutes()));
|
|
97
|
+
return (() => {
|
|
98
|
+
let options = [],
|
|
99
|
+
value = calendarStartDate;
|
|
100
|
+
while (Number(value) !== Number(calendarEndDate)) {
|
|
101
|
+
options = [...options, value];
|
|
102
|
+
value = new Date(Date.UTC(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate() + 1, value.getUTCHours(), value.getUTCMinutes()));
|
|
103
|
+
}
|
|
104
|
+
return options;
|
|
105
|
+
})();
|
|
106
|
+
});
|
|
107
|
+
// Methods
|
|
108
|
+
function formatDay(value) {
|
|
109
|
+
return value.toLocaleString('default', {
|
|
110
|
+
day: 'numeric',
|
|
111
|
+
timeZone: 'UTC'
|
|
112
|
+
});
|
|
113
|
+
}
|
|
52
114
|
return {
|
|
53
115
|
root,
|
|
54
116
|
rootStyles,
|
|
55
|
-
|
|
117
|
+
buttonGroupStyles,
|
|
118
|
+
buttonGroupItemStyles,
|
|
119
|
+
proxyModelValue,
|
|
120
|
+
dayOptions,
|
|
121
|
+
formatDay
|
|
56
122
|
};
|
|
57
123
|
}
|
|
58
124
|
});
|
|
@@ -68,7 +134,24 @@ var __vue_render__$6 = function () {
|
|
|
68
134
|
return _c('div', {
|
|
69
135
|
ref: "root",
|
|
70
136
|
class: _vm.rootStyles
|
|
71
|
-
}, [
|
|
137
|
+
}, [_c('div', {
|
|
138
|
+
class: _vm.buttonGroupStyles
|
|
139
|
+
}, _vm._l(_vm.dayOptions, function (value) {
|
|
140
|
+
return _c('OrButton', {
|
|
141
|
+
key: Number(value),
|
|
142
|
+
class: _vm.buttonGroupItemStyles,
|
|
143
|
+
attrs: {
|
|
144
|
+
"variant": Number(value) === Number(_vm.proxyModelValue) ? 'contained' : 'text',
|
|
145
|
+
"color": Number(value) === Number(_vm.proxyModelValue) ? 'primary' : 'inherit'
|
|
146
|
+
},
|
|
147
|
+
on: {
|
|
148
|
+
"click": function ($event) {
|
|
149
|
+
$event.stopPropagation();
|
|
150
|
+
_vm.proxyModelValue = value;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatDay(value)) + "\n ")]);
|
|
154
|
+
}), 1)]);
|
|
72
155
|
};
|
|
73
156
|
var __vue_staticRenderFns__$6 = [];
|
|
74
157
|
|
|
@@ -105,7 +188,7 @@ const DateTimePickerMobileControlContent = [
|
|
|
105
188
|
var script$5 = defineComponent({
|
|
106
189
|
name: 'OrDateTimePickerMobileControl',
|
|
107
190
|
components: {
|
|
108
|
-
OrLabel: __vue_component__$
|
|
191
|
+
OrLabel: __vue_component__$8
|
|
109
192
|
},
|
|
110
193
|
props: {
|
|
111
194
|
label: {
|
|
@@ -173,7 +256,7 @@ const DateTimePickerMonthSelect = [
|
|
|
173
256
|
var script$4 = defineComponent({
|
|
174
257
|
name: 'OrDateTimePickerMonthSelect',
|
|
175
258
|
components: {
|
|
176
|
-
OrButton: __vue_component__$
|
|
259
|
+
OrButton: __vue_component__$7,
|
|
177
260
|
OrIcon: __vue_component__$9,
|
|
178
261
|
OrIconButton: __vue_component__$a,
|
|
179
262
|
OrMenu: __vue_component__$b,
|
|
@@ -194,101 +277,93 @@ var script$4 = defineComponent({
|
|
|
194
277
|
setup(props, context) {
|
|
195
278
|
// Refs
|
|
196
279
|
const root = ref();
|
|
197
|
-
const monthButton = ref();
|
|
198
280
|
const yearButton = ref();
|
|
281
|
+
const monthButton = ref();
|
|
282
|
+
const yearButtonRoot = computed(() => {
|
|
283
|
+
var _a;
|
|
284
|
+
return (_a = yearButton.value) === null || _a === void 0 ? void 0 : _a.root;
|
|
285
|
+
});
|
|
199
286
|
const monthButtonRoot = computed(() => {
|
|
200
287
|
var _a;
|
|
201
288
|
return (_a = monthButton.value) === null || _a === void 0 ? void 0 : _a.root;
|
|
202
289
|
});
|
|
203
|
-
const
|
|
290
|
+
const yearMenu = ref();
|
|
291
|
+
const monthMenu = ref();
|
|
292
|
+
const yearMenuState = computed(() => {
|
|
204
293
|
var _a;
|
|
205
|
-
return (_a =
|
|
294
|
+
return (_a = yearMenu.value) === null || _a === void 0 ? void 0 : _a.state;
|
|
295
|
+
});
|
|
296
|
+
const monthMenuState = computed(() => {
|
|
297
|
+
var _a;
|
|
298
|
+
return (_a = monthMenu.value) === null || _a === void 0 ? void 0 : _a.state;
|
|
206
299
|
});
|
|
207
|
-
const monthMenu = ref();
|
|
208
|
-
const yearMenu = ref();
|
|
209
|
-
// const monthMenuState = computed(() => monthMenu.value?.state);
|
|
210
|
-
// const yearMenuState = computed(() => yearMenu.value?.state);
|
|
211
300
|
// Styles
|
|
212
301
|
const rootStyles = computed(() => ['or-date-time-picker-month-select', ...DateTimePickerMonthSelect]);
|
|
213
302
|
// State
|
|
214
303
|
const proxyModelValue = computed({
|
|
215
|
-
get: () => props.modelValue,
|
|
216
|
-
set: value => {
|
|
217
|
-
context.emit('update:modelValue', value);
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
const yearValue = computed({
|
|
221
304
|
get: () => {
|
|
222
|
-
var _a
|
|
223
|
-
return (
|
|
305
|
+
var _a;
|
|
306
|
+
return (_a = props.modelValue) !== null && _a !== void 0 ? _a : new Date(Date.UTC(useDefaultYear(), useDefaultMonth(), useDefaultDate(), useDefaultHours(), useDefaultMinutes()));
|
|
224
307
|
},
|
|
225
308
|
set: value => {
|
|
226
|
-
|
|
227
|
-
proxyModelValue.value = new Date(Date.UTC(value, (_b = (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.getUTCMonth()) !== null && _b !== void 0 ? _b : monthValue.value, (_d = (_c = proxyModelValue.value) === null || _c === void 0 ? void 0 : _c.getUTCDate()) !== null && _d !== void 0 ? _d : 1, (_f = (_e = proxyModelValue.value) === null || _e === void 0 ? void 0 : _e.getUTCHours()) !== null && _f !== void 0 ? _f : 0, (_h = (_g = proxyModelValue.value) === null || _g === void 0 ? void 0 : _g.getUTCMinutes()) !== null && _h !== void 0 ? _h : 0));
|
|
309
|
+
context.emit('update:modelValue', value);
|
|
228
310
|
}
|
|
229
311
|
});
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}
|
|
312
|
+
const yearOptions = computed(() => {
|
|
313
|
+
return Array.from({
|
|
314
|
+
length: 11
|
|
315
|
+
}).map((_value, index, {
|
|
316
|
+
length
|
|
317
|
+
}) => {
|
|
318
|
+
const value = proxyModelValue.value.getUTCFullYear() - Math.floor(length / 2) + index;
|
|
319
|
+
return new Date(Date.UTC(value, proxyModelValue.value.getUTCMonth(), proxyModelValue.value.getUTCDate(), proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
|
|
320
|
+
});
|
|
239
321
|
});
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
var _a;
|
|
248
|
-
return (_a = monthOptions.find(({
|
|
249
|
-
value
|
|
250
|
-
}) => value === monthValue.value)) === null || _a === void 0 ? void 0 : _a.label;
|
|
251
|
-
});
|
|
252
|
-
const yearOptions = Array.from({
|
|
253
|
-
length: 100
|
|
254
|
-
}, (_value, index) => {
|
|
255
|
-
const year = new Date().getUTCFullYear() - index;
|
|
256
|
-
return {
|
|
257
|
-
value: year,
|
|
258
|
-
label: new Date(year, monthValue.value).toLocaleString([], {
|
|
259
|
-
year: 'numeric'
|
|
260
|
-
})
|
|
261
|
-
};
|
|
262
|
-
});
|
|
263
|
-
const monthOptions = Array.from({
|
|
264
|
-
length: 12
|
|
265
|
-
}, (_value, index) => {
|
|
266
|
-
const month = index;
|
|
267
|
-
return {
|
|
268
|
-
value: month,
|
|
269
|
-
label: new Date(yearValue.value, month).toLocaleString([], {
|
|
270
|
-
month: 'long'
|
|
271
|
-
})
|
|
272
|
-
};
|
|
322
|
+
const monthOptions = computed(() => {
|
|
323
|
+
return Array.from({
|
|
324
|
+
length: 12
|
|
325
|
+
}, (_value, index) => {
|
|
326
|
+
const value = index;
|
|
327
|
+
return new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), value, proxyModelValue.value.getUTCDate(), proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
|
|
328
|
+
});
|
|
273
329
|
});
|
|
330
|
+
// Methods
|
|
331
|
+
function goToNextMonth() {
|
|
332
|
+
proxyModelValue.value = new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth() + 1, proxyModelValue.value.getUTCDate(), proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
|
|
333
|
+
}
|
|
334
|
+
function goToPreviousMonth() {
|
|
335
|
+
proxyModelValue.value = new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth() - 1, proxyModelValue.value.getUTCDate(), proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
|
|
336
|
+
}
|
|
337
|
+
function formatYear(value) {
|
|
338
|
+
return value.toLocaleString('default', {
|
|
339
|
+
year: 'numeric',
|
|
340
|
+
timeZone: 'UTC'
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
function formatMonth(value) {
|
|
344
|
+
return value.toLocaleString('default', {
|
|
345
|
+
month: 'long',
|
|
346
|
+
timeZone: 'UTC'
|
|
347
|
+
});
|
|
348
|
+
}
|
|
274
349
|
return {
|
|
275
350
|
root,
|
|
276
|
-
monthButton,
|
|
277
351
|
yearButton,
|
|
278
|
-
|
|
352
|
+
monthButton,
|
|
279
353
|
yearButtonRoot,
|
|
280
|
-
|
|
354
|
+
monthButtonRoot,
|
|
281
355
|
yearMenu,
|
|
282
|
-
|
|
283
|
-
|
|
356
|
+
monthMenu,
|
|
357
|
+
yearMenuState,
|
|
358
|
+
monthMenuState,
|
|
284
359
|
rootStyles,
|
|
285
360
|
proxyModelValue,
|
|
286
|
-
yearValue,
|
|
287
|
-
monthValue,
|
|
288
|
-
yearLabel,
|
|
289
|
-
monthLabel,
|
|
290
361
|
yearOptions,
|
|
291
|
-
monthOptions
|
|
362
|
+
monthOptions,
|
|
363
|
+
goToNextMonth,
|
|
364
|
+
goToPreviousMonth,
|
|
365
|
+
formatYear,
|
|
366
|
+
formatMonth
|
|
292
367
|
};
|
|
293
368
|
}
|
|
294
369
|
});
|
|
@@ -311,13 +386,13 @@ var __vue_render__$4 = function () {
|
|
|
311
386
|
on: {
|
|
312
387
|
"click": function ($event) {
|
|
313
388
|
$event.stopPropagation();
|
|
314
|
-
|
|
389
|
+
return _vm.goToPreviousMonth();
|
|
315
390
|
}
|
|
316
391
|
}
|
|
317
392
|
}), _vm._v(" "), _c('div', {
|
|
318
|
-
class: ['layout-row', 'gap-md']
|
|
393
|
+
class: ['layout-row-reverse', 'gap-md']
|
|
319
394
|
}, [_c('OrButton', {
|
|
320
|
-
ref: "
|
|
395
|
+
ref: "yearButton",
|
|
321
396
|
attrs: {
|
|
322
397
|
"variant": 'link',
|
|
323
398
|
"color": 'inherit'
|
|
@@ -325,15 +400,15 @@ var __vue_render__$4 = function () {
|
|
|
325
400
|
on: {
|
|
326
401
|
"click": function ($event) {
|
|
327
402
|
$event.stopPropagation();
|
|
328
|
-
return _vm.
|
|
403
|
+
return _vm.yearMenu.open();
|
|
329
404
|
}
|
|
330
405
|
}
|
|
331
|
-
}, [_vm._v("\n " + _vm._s(_vm.
|
|
406
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatYear(_vm.proxyModelValue)) + " "), _c('OrIcon', {
|
|
332
407
|
attrs: {
|
|
333
|
-
"icon": 'arrow_drop_down'
|
|
408
|
+
"icon": _vm.yearMenuState === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
|
|
334
409
|
}
|
|
335
410
|
})], 1), _vm._v(" "), _c('OrButton', {
|
|
336
|
-
ref: "
|
|
411
|
+
ref: "monthButton",
|
|
337
412
|
attrs: {
|
|
338
413
|
"variant": 'link',
|
|
339
414
|
"color": 'inherit'
|
|
@@ -341,45 +416,51 @@ var __vue_render__$4 = function () {
|
|
|
341
416
|
on: {
|
|
342
417
|
"click": function ($event) {
|
|
343
418
|
$event.stopPropagation();
|
|
344
|
-
return _vm.
|
|
419
|
+
return _vm.monthMenu.open();
|
|
345
420
|
}
|
|
346
421
|
}
|
|
347
|
-
}, [_vm._v("\n " + _vm._s(_vm.
|
|
422
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatMonth(_vm.proxyModelValue)) + " "), _c('OrIcon', {
|
|
348
423
|
attrs: {
|
|
349
|
-
"icon": 'arrow_drop_down'
|
|
424
|
+
"icon": _vm.monthMenuState === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
|
|
350
425
|
}
|
|
351
426
|
})], 1), _vm._v(" "), _c('OrMenu', {
|
|
352
|
-
ref: "
|
|
427
|
+
ref: "yearMenu",
|
|
353
428
|
attrs: {
|
|
354
|
-
"trigger": _vm.
|
|
429
|
+
"trigger": _vm.yearButtonRoot
|
|
355
430
|
}
|
|
356
|
-
}, _vm._l(_vm.
|
|
431
|
+
}, _vm._l(_vm.yearOptions, function (value) {
|
|
357
432
|
return _c('OrMenuItem', {
|
|
358
|
-
key:
|
|
433
|
+
key: Number(value),
|
|
434
|
+
attrs: {
|
|
435
|
+
"selected": Number(value) === Number(_vm.proxyModelValue)
|
|
436
|
+
},
|
|
359
437
|
on: {
|
|
360
438
|
"click": function ($event) {
|
|
361
439
|
$event.stopPropagation();
|
|
362
|
-
_vm.
|
|
363
|
-
_vm.
|
|
440
|
+
_vm.proxyModelValue = value;
|
|
441
|
+
_vm.yearMenu.close();
|
|
364
442
|
}
|
|
365
443
|
}
|
|
366
|
-
}, [_vm._v("\n " + _vm._s(
|
|
444
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatYear(value)) + "\n ")]);
|
|
367
445
|
}), 1), _vm._v(" "), _c('OrMenu', {
|
|
368
|
-
ref: "
|
|
446
|
+
ref: "monthMenu",
|
|
369
447
|
attrs: {
|
|
370
|
-
"trigger": _vm.
|
|
448
|
+
"trigger": _vm.monthButtonRoot
|
|
371
449
|
}
|
|
372
|
-
}, _vm._l(_vm.
|
|
450
|
+
}, _vm._l(_vm.monthOptions, function (value) {
|
|
373
451
|
return _c('OrMenuItem', {
|
|
374
|
-
key:
|
|
452
|
+
key: Number(value),
|
|
453
|
+
attrs: {
|
|
454
|
+
"selected": Number(value) === Number(_vm.proxyModelValue)
|
|
455
|
+
},
|
|
375
456
|
on: {
|
|
376
457
|
"click": function ($event) {
|
|
377
458
|
$event.stopPropagation();
|
|
378
|
-
_vm.
|
|
379
|
-
_vm.
|
|
459
|
+
_vm.proxyModelValue = value;
|
|
460
|
+
_vm.monthMenu.close();
|
|
380
461
|
}
|
|
381
462
|
}
|
|
382
|
-
}, [_vm._v("\n " + _vm._s(
|
|
463
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatMonth(value)) + "\n ")]);
|
|
383
464
|
}), 1)], 1), _vm._v(" "), _c('OrIconButton', {
|
|
384
465
|
attrs: {
|
|
385
466
|
"icon": 'chevron_right'
|
|
@@ -387,7 +468,7 @@ var __vue_render__$4 = function () {
|
|
|
387
468
|
on: {
|
|
388
469
|
"click": function ($event) {
|
|
389
470
|
$event.stopPropagation();
|
|
390
|
-
|
|
471
|
+
return _vm.goToNextMonth();
|
|
391
472
|
}
|
|
392
473
|
}
|
|
393
474
|
})], 1);
|
|
@@ -424,7 +505,7 @@ const DateTimePickerPopoverFooter = [
|
|
|
424
505
|
var script$3 = defineComponent({
|
|
425
506
|
name: 'OrDateTimePickerPopoverFooter',
|
|
426
507
|
components: {
|
|
427
|
-
OrButton: __vue_component__$
|
|
508
|
+
OrButton: __vue_component__$7
|
|
428
509
|
},
|
|
429
510
|
emits: ['resolve', 'reject'],
|
|
430
511
|
expose: ['root'],
|
|
@@ -572,7 +653,7 @@ const DateTimePickerTimeSelectButtonGroupItem = [
|
|
|
572
653
|
var script$1 = defineComponent({
|
|
573
654
|
name: 'OrDateTimePickerTimeSelect',
|
|
574
655
|
components: {
|
|
575
|
-
OrButton: __vue_component__$
|
|
656
|
+
OrButton: __vue_component__$7
|
|
576
657
|
},
|
|
577
658
|
model: {
|
|
578
659
|
prop: 'modelValue',
|
|
@@ -595,53 +676,53 @@ var script$1 = defineComponent({
|
|
|
595
676
|
const buttonGroupItemStyles = computed(() => [...DateTimePickerTimeSelectButtonGroupItem]);
|
|
596
677
|
// State
|
|
597
678
|
const proxyModelValue = computed({
|
|
598
|
-
get: () => props.modelValue,
|
|
599
|
-
set: value => {
|
|
600
|
-
context.emit('update:modelValue', value);
|
|
601
|
-
}
|
|
602
|
-
});
|
|
603
|
-
const hoursValue = computed({
|
|
604
679
|
get: () => {
|
|
605
|
-
var _a
|
|
606
|
-
return (
|
|
680
|
+
var _a;
|
|
681
|
+
return (_a = props.modelValue) !== null && _a !== void 0 ? _a : new Date(Date.UTC(useDefaultYear(), useDefaultMonth(), useDefaultDate(), useDefaultHours(), useDefaultMinutes()));
|
|
607
682
|
},
|
|
608
683
|
set: value => {
|
|
609
|
-
|
|
610
|
-
proxyModelValue.value = new Date(Date.UTC((_b = (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.getUTCFullYear()) !== null && _b !== void 0 ? _b : 1970, (_d = (_c = proxyModelValue.value) === null || _c === void 0 ? void 0 : _c.getUTCMonth()) !== null && _d !== void 0 ? _d : 0, (_f = (_e = proxyModelValue.value) === null || _e === void 0 ? void 0 : _e.getUTCDate()) !== null && _f !== void 0 ? _f : 1, value, (_h = (_g = proxyModelValue.value) === null || _g === void 0 ? void 0 : _g.getUTCMinutes()) !== null && _h !== void 0 ? _h : minutesValue.value));
|
|
684
|
+
context.emit('update:modelValue', value);
|
|
611
685
|
}
|
|
612
686
|
});
|
|
613
|
-
const
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
687
|
+
const hoursOptions = computed(() => {
|
|
688
|
+
return Array.from({
|
|
689
|
+
length: 24
|
|
690
|
+
}, (_value, index) => {
|
|
691
|
+
const value = index;
|
|
692
|
+
return new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth(), proxyModelValue.value.getUTCDate(), value, proxyModelValue.value.getUTCMinutes()));
|
|
693
|
+
});
|
|
694
|
+
});
|
|
695
|
+
const minutesOptions = computed(() => {
|
|
696
|
+
return Array.from({
|
|
697
|
+
length: 60
|
|
698
|
+
}, (_value, index) => {
|
|
699
|
+
const value = index;
|
|
700
|
+
return new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth(), proxyModelValue.value.getUTCDate(), proxyModelValue.value.getUTCHours(), value));
|
|
701
|
+
});
|
|
622
702
|
});
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
703
|
+
// Methods
|
|
704
|
+
function formatHours(value) {
|
|
705
|
+
return value.toLocaleString('default', {
|
|
706
|
+
hour: '2-digit',
|
|
707
|
+
timeZone: 'UTC'
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
function formatMinutes(value) {
|
|
711
|
+
return value.toLocaleString('default', {
|
|
712
|
+
minute: '2-digit',
|
|
713
|
+
timeZone: 'UTC'
|
|
714
|
+
});
|
|
715
|
+
}
|
|
635
716
|
return {
|
|
636
717
|
root,
|
|
637
718
|
rootStyles,
|
|
638
719
|
buttonGroupStyles,
|
|
639
720
|
buttonGroupItemStyles,
|
|
640
721
|
proxyModelValue,
|
|
641
|
-
hoursValue,
|
|
642
|
-
minutesValue,
|
|
643
722
|
hoursOptions,
|
|
644
|
-
minutesOptions
|
|
723
|
+
minutesOptions,
|
|
724
|
+
formatHours,
|
|
725
|
+
formatMinutes
|
|
645
726
|
};
|
|
646
727
|
}
|
|
647
728
|
});
|
|
@@ -659,38 +740,38 @@ var __vue_render__$1 = function () {
|
|
|
659
740
|
class: _vm.rootStyles
|
|
660
741
|
}, [_c('div', {
|
|
661
742
|
class: _vm.buttonGroupStyles
|
|
662
|
-
}, _vm._l(_vm.hoursOptions, function (
|
|
743
|
+
}, _vm._l(_vm.hoursOptions, function (value) {
|
|
663
744
|
return _c('OrButton', {
|
|
664
|
-
key:
|
|
745
|
+
key: Number(value),
|
|
665
746
|
class: _vm.buttonGroupItemStyles,
|
|
666
747
|
attrs: {
|
|
667
|
-
"variant":
|
|
668
|
-
"color":
|
|
748
|
+
"variant": Number(value) === Number(_vm.proxyModelValue) ? 'contained' : 'text',
|
|
749
|
+
"color": Number(value) === Number(_vm.proxyModelValue) ? 'primary' : 'inherit'
|
|
669
750
|
},
|
|
670
751
|
on: {
|
|
671
752
|
"click": function ($event) {
|
|
672
753
|
$event.stopPropagation();
|
|
673
|
-
_vm.
|
|
754
|
+
_vm.proxyModelValue = value;
|
|
674
755
|
}
|
|
675
756
|
}
|
|
676
|
-
}, [_vm._v("\n " + _vm._s(
|
|
757
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatHours(value)) + "\n ")]);
|
|
677
758
|
}), 1), _vm._v("\n\n :\n\n "), _c('div', {
|
|
678
759
|
class: _vm.buttonGroupStyles
|
|
679
|
-
}, _vm._l(_vm.minutesOptions, function (
|
|
760
|
+
}, _vm._l(_vm.minutesOptions, function (value) {
|
|
680
761
|
return _c('OrButton', {
|
|
681
|
-
key:
|
|
762
|
+
key: Number(value),
|
|
682
763
|
class: _vm.buttonGroupItemStyles,
|
|
683
764
|
attrs: {
|
|
684
|
-
"variant":
|
|
685
|
-
"color":
|
|
765
|
+
"variant": Number(value) === Number(_vm.proxyModelValue) ? 'contained' : 'text',
|
|
766
|
+
"color": Number(value) === Number(_vm.proxyModelValue) ? 'primary' : 'inherit'
|
|
686
767
|
},
|
|
687
768
|
on: {
|
|
688
769
|
"click": function ($event) {
|
|
689
770
|
$event.stopPropagation();
|
|
690
|
-
_vm.
|
|
771
|
+
_vm.proxyModelValue = value;
|
|
691
772
|
}
|
|
692
773
|
}
|
|
693
|
-
}, [_vm._v("\n " + _vm._s(
|
|
774
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatMinutes(value)) + "\n ")]);
|
|
694
775
|
}), 1)]);
|
|
695
776
|
};
|
|
696
777
|
var __vue_staticRenderFns__$1 = [];
|
|
@@ -720,13 +801,15 @@ const DateTimePicker = [
|
|
|
720
801
|
// Spacing
|
|
721
802
|
'gap-xs'];
|
|
722
803
|
const DateTimePickerControl = [
|
|
804
|
+
// Layout
|
|
805
|
+
'layout-inline-row justify-center',
|
|
723
806
|
// Theme (focus)
|
|
724
|
-
'focus:theme-border-
|
|
807
|
+
'focus:theme-border-2-current', 'dark:focus:theme-border-2-current-dark', 'focus:theme-border-underline', 'dark:focus:theme-border-underline'];
|
|
725
808
|
|
|
726
809
|
var script = defineComponent({
|
|
727
810
|
name: 'OrDateTimePicker',
|
|
728
811
|
components: {
|
|
729
|
-
|
|
812
|
+
OrDateTimePickerDaySelect: __vue_component__$6,
|
|
730
813
|
OrDateTimePickerMobileControl: __vue_component__$5,
|
|
731
814
|
OrDateTimePickerMonthSelect: __vue_component__$4,
|
|
732
815
|
OrDateTimePickerPopoverFooter: __vue_component__$3,
|
|
@@ -736,7 +819,7 @@ var script = defineComponent({
|
|
|
736
819
|
OrHint: __vue_component__$e,
|
|
737
820
|
OrIconButton: __vue_component__$a,
|
|
738
821
|
OrInputBox: __vue_component__$f,
|
|
739
|
-
OrLabel: __vue_component__$
|
|
822
|
+
OrLabel: __vue_component__$8,
|
|
740
823
|
OrPopover: __vue_component__$g
|
|
741
824
|
},
|
|
742
825
|
directives: {
|
|
@@ -817,6 +900,12 @@ var script = defineComponent({
|
|
|
817
900
|
context.emit('update:modelValue', value);
|
|
818
901
|
}
|
|
819
902
|
});
|
|
903
|
+
const draftModelValue = ref();
|
|
904
|
+
watch(proxyModelValue, value => {
|
|
905
|
+
draftModelValue.value = value;
|
|
906
|
+
}, {
|
|
907
|
+
immediate: true
|
|
908
|
+
});
|
|
820
909
|
// Methods
|
|
821
910
|
function toggleDatePopover() {
|
|
822
911
|
if (!props.readonly && !props.disabled) {
|
|
@@ -854,6 +943,34 @@ var script = defineComponent({
|
|
|
854
943
|
popoverInstance.close();
|
|
855
944
|
}
|
|
856
945
|
}
|
|
946
|
+
function formatDate(value) {
|
|
947
|
+
var _a;
|
|
948
|
+
return (_a = value === null || value === void 0 ? void 0 : value.toLocaleString('default', {
|
|
949
|
+
dateStyle: 'short',
|
|
950
|
+
timeZone: 'UTC'
|
|
951
|
+
})) !== null && _a !== void 0 ? _a : '--';
|
|
952
|
+
}
|
|
953
|
+
function formatTime(value) {
|
|
954
|
+
var _a;
|
|
955
|
+
return (_a = value === null || value === void 0 ? void 0 : value.toLocaleString('default', {
|
|
956
|
+
timeStyle: 'short',
|
|
957
|
+
timeZone: 'UTC'
|
|
958
|
+
})) !== null && _a !== void 0 ? _a : '--';
|
|
959
|
+
}
|
|
960
|
+
function formatDateAlt(value) {
|
|
961
|
+
var _a;
|
|
962
|
+
return (_a = value === null || value === void 0 ? void 0 : value.toLocaleString('default', {
|
|
963
|
+
dateStyle: 'medium',
|
|
964
|
+
timeZone: 'UTC'
|
|
965
|
+
})) !== null && _a !== void 0 ? _a : '--';
|
|
966
|
+
}
|
|
967
|
+
function formatTimeAlt(value) {
|
|
968
|
+
var _a;
|
|
969
|
+
return (_a = value === null || value === void 0 ? void 0 : value.toLocaleString('default', {
|
|
970
|
+
timeStyle: 'short',
|
|
971
|
+
timeZone: 'UTC'
|
|
972
|
+
})) !== null && _a !== void 0 ? _a : '--';
|
|
973
|
+
}
|
|
857
974
|
return {
|
|
858
975
|
root,
|
|
859
976
|
dateControl,
|
|
@@ -866,15 +983,20 @@ var script = defineComponent({
|
|
|
866
983
|
controlStyles,
|
|
867
984
|
controlAttributes,
|
|
868
985
|
proxyModelValue,
|
|
986
|
+
draftModelValue,
|
|
869
987
|
toggleDatePopover,
|
|
870
988
|
toggleTimePopover,
|
|
871
989
|
closeDatePopover,
|
|
872
|
-
closeTimePopover
|
|
990
|
+
closeTimePopover,
|
|
991
|
+
formatDate,
|
|
992
|
+
formatTime,
|
|
993
|
+
formatDateAlt,
|
|
994
|
+
formatTimeAlt
|
|
873
995
|
};
|
|
874
996
|
}
|
|
875
997
|
});
|
|
876
998
|
|
|
877
|
-
var css_248z = "input[data-v-
|
|
999
|
+
var css_248z = "input[data-v-183da045]{min-width:0;background:0 0;outline:0}";
|
|
878
1000
|
styleInject(css_248z);
|
|
879
1001
|
|
|
880
1002
|
/* script */
|
|
@@ -920,7 +1042,7 @@ var __vue_render__ = function () {
|
|
|
920
1042
|
"readonly": _vm.readonly,
|
|
921
1043
|
"disabled": _vm.disabled
|
|
922
1044
|
}
|
|
923
|
-
}, [_c('
|
|
1045
|
+
}, [_c('div', _vm._b({
|
|
924
1046
|
directives: [{
|
|
925
1047
|
name: "dropdown-open",
|
|
926
1048
|
rawName: "v-dropdown-open",
|
|
@@ -935,12 +1057,12 @@ var __vue_render__ = function () {
|
|
|
935
1057
|
ref: "dateControl",
|
|
936
1058
|
class: _vm.controlStyles,
|
|
937
1059
|
attrs: {
|
|
938
|
-
"
|
|
1060
|
+
"contenteditable": true,
|
|
939
1061
|
"required": _vm.required,
|
|
940
1062
|
"readonly": _vm.readonly,
|
|
941
1063
|
"disabled": _vm.disabled
|
|
942
1064
|
}
|
|
943
|
-
}, '
|
|
1065
|
+
}, 'div', _vm.controlAttributes, false), [_vm._v("\n " + _vm._s(_vm.formatDate(_vm.proxyModelValue)) + "\n ")]), _vm._v(" "), _c('div', _vm._b({
|
|
944
1066
|
directives: [{
|
|
945
1067
|
name: "dropdown-open",
|
|
946
1068
|
rawName: "v-dropdown-open",
|
|
@@ -955,12 +1077,12 @@ var __vue_render__ = function () {
|
|
|
955
1077
|
ref: "timeControl",
|
|
956
1078
|
class: _vm.controlStyles,
|
|
957
1079
|
attrs: {
|
|
958
|
-
"
|
|
1080
|
+
"contenteditable": true,
|
|
959
1081
|
"required": _vm.required,
|
|
960
1082
|
"readonly": _vm.readonly,
|
|
961
1083
|
"disabled": _vm.disabled
|
|
962
1084
|
}
|
|
963
|
-
}, '
|
|
1085
|
+
}, 'div', _vm.controlAttributes, false), [_vm._v("\n " + _vm._s(_vm.formatTime(_vm.proxyModelValue)) + "\n ")]), _vm._v(" "), _c('OrPopover', {
|
|
964
1086
|
ref: "datePopover",
|
|
965
1087
|
attrs: {
|
|
966
1088
|
"variant": 'auto',
|
|
@@ -971,30 +1093,35 @@ var __vue_render__ = function () {
|
|
|
971
1093
|
attrs: {
|
|
972
1094
|
"label": "Date"
|
|
973
1095
|
}
|
|
974
|
-
}, [_vm._v("\n
|
|
1096
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatDateAlt(_vm.draftModelValue)) + "\n ")]), _vm._v(" "), _c('OrDateTimePickerMobileControl', {
|
|
975
1097
|
attrs: {
|
|
976
1098
|
"label": "Time"
|
|
977
1099
|
}
|
|
978
|
-
}, [_vm._v("\n
|
|
1100
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatTimeAlt(_vm.draftModelValue)) + "\n ")])], 1), _vm._v(" "), _c('OrDateTimePickerMonthSelect', {
|
|
979
1101
|
model: {
|
|
980
|
-
value: _vm.
|
|
1102
|
+
value: _vm.draftModelValue,
|
|
981
1103
|
callback: function ($$v) {
|
|
982
|
-
_vm.
|
|
1104
|
+
_vm.draftModelValue = $$v;
|
|
983
1105
|
},
|
|
984
|
-
expression: "
|
|
1106
|
+
expression: "draftModelValue"
|
|
985
1107
|
}
|
|
986
|
-
}), _vm._v(" "), _c('
|
|
1108
|
+
}), _vm._v(" "), _c('OrDateTimePickerDaySelect', {
|
|
987
1109
|
model: {
|
|
988
|
-
value: _vm.
|
|
1110
|
+
value: _vm.draftModelValue,
|
|
989
1111
|
callback: function ($$v) {
|
|
990
|
-
_vm.
|
|
1112
|
+
_vm.draftModelValue = $$v;
|
|
991
1113
|
},
|
|
992
|
-
expression: "
|
|
1114
|
+
expression: "draftModelValue"
|
|
993
1115
|
}
|
|
994
1116
|
}), _vm._v(" "), _c('OrDateTimePickerPopoverFooter', {
|
|
995
1117
|
on: {
|
|
1118
|
+
"resolve": function ($event) {
|
|
1119
|
+
_vm.proxyModelValue = _vm.draftModelValue;
|
|
1120
|
+
_vm.datePopover.close();
|
|
1121
|
+
},
|
|
996
1122
|
"reject": function ($event) {
|
|
997
|
-
|
|
1123
|
+
_vm.draftModelValue = _vm.proxyModelValue;
|
|
1124
|
+
_vm.datePopover.close();
|
|
998
1125
|
}
|
|
999
1126
|
}
|
|
1000
1127
|
})], 1), _vm._v(" "), _c('OrPopover', {
|
|
@@ -1008,22 +1135,27 @@ var __vue_render__ = function () {
|
|
|
1008
1135
|
attrs: {
|
|
1009
1136
|
"label": "Date"
|
|
1010
1137
|
}
|
|
1011
|
-
}, [_vm._v("\n
|
|
1138
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatDateAlt(_vm.draftModelValue)) + "\n ")]), _vm._v(" "), _c('OrDateTimePickerMobileControl', {
|
|
1012
1139
|
attrs: {
|
|
1013
1140
|
"label": "Time"
|
|
1014
1141
|
}
|
|
1015
|
-
}, [_vm._v("\n
|
|
1142
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatTimeAlt(_vm.draftModelValue)) + "\n ")])], 1), _vm._v(" "), _c('OrDateTimePickerTimeSelect', {
|
|
1016
1143
|
model: {
|
|
1017
|
-
value: _vm.
|
|
1144
|
+
value: _vm.draftModelValue,
|
|
1018
1145
|
callback: function ($$v) {
|
|
1019
|
-
_vm.
|
|
1146
|
+
_vm.draftModelValue = $$v;
|
|
1020
1147
|
},
|
|
1021
|
-
expression: "
|
|
1148
|
+
expression: "draftModelValue"
|
|
1022
1149
|
}
|
|
1023
1150
|
}), _vm._v(" "), _c('OrDateTimePickerPopoverFooter', {
|
|
1024
1151
|
on: {
|
|
1152
|
+
"resolve": function ($event) {
|
|
1153
|
+
_vm.proxyModelValue = _vm.draftModelValue;
|
|
1154
|
+
_vm.timePopover.close();
|
|
1155
|
+
},
|
|
1025
1156
|
"reject": function ($event) {
|
|
1026
|
-
|
|
1157
|
+
_vm.draftModelValue = _vm.proxyModelValue;
|
|
1158
|
+
_vm.timePopover.close();
|
|
1027
1159
|
}
|
|
1028
1160
|
}
|
|
1029
1161
|
})], 1), _vm._v(" "), _c('div', {
|
|
@@ -1057,7 +1189,7 @@ var __vue_staticRenderFns__ = [];
|
|
|
1057
1189
|
/* style */
|
|
1058
1190
|
const __vue_inject_styles__ = undefined;
|
|
1059
1191
|
/* scoped */
|
|
1060
|
-
const __vue_scope_id__ = "data-v-
|
|
1192
|
+
const __vue_scope_id__ = "data-v-183da045";
|
|
1061
1193
|
/* module identifier */
|
|
1062
1194
|
const __vue_module_identifier__ = undefined;
|
|
1063
1195
|
/* functional template */
|