@onereach/ui-components 3.0.4-beta.2497.0 → 3.0.4-beta.2502.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/OrDatePicker-19e467e2.js +330 -0
- package/dist/bundled/v2/OrDateTimePicker-1011dc69.js +440 -0
- package/dist/bundled/v2/OrDateTimePickerMonthSelect-9e64d257.js +408 -0
- package/dist/bundled/v2/OrDateTimePickerPopoverHeader-c8672c0d.js +239 -0
- package/dist/bundled/v2/OrDateTimePickerTimeSelect-158d717b.js +179 -0
- package/dist/bundled/v2/OrTimePicker-1b3a758a.js +318 -0
- package/dist/bundled/v2/components/index.d.ts +2 -0
- package/dist/bundled/v2/components/index.js +7 -2
- package/dist/bundled/v2/components/or-date-picker-v3/OrDatePicker.vue.d.ts +183 -0
- package/dist/bundled/v2/components/or-date-picker-v3/index.d.ts +2 -0
- package/dist/bundled/v2/components/or-date-picker-v3/index.js +31 -0
- package/dist/bundled/v2/components/or-date-picker-v3/props.d.ts +1 -0
- package/dist/bundled/v2/components/or-date-picker-v3/styles.d.ts +2 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +11 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/index.js +7 -5
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/OrDateTimePickerDaySelect.vue.d.ts +12 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +12 -0
- package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +12 -0
- package/dist/bundled/v2/components/or-time-picker-v3/OrTimePicker.vue.d.ts +183 -0
- package/dist/bundled/v2/components/or-time-picker-v3/index.d.ts +2 -0
- package/dist/bundled/v2/components/or-time-picker-v3/index.js +29 -0
- package/dist/bundled/v2/components/or-time-picker-v3/props.d.ts +1 -0
- package/dist/bundled/v2/components/or-time-picker-v3/styles.d.ts +2 -0
- package/dist/bundled/v2/index.js +8 -3
- package/dist/bundled/v3/OrDatePicker.vue_vue_type_script_lang-8eafbe6b.js +177 -0
- package/dist/bundled/v3/OrDateTimePicker.vue_vue_type_script_lang-b2a9ef8d.js +226 -0
- package/dist/bundled/v3/OrDateTimePickerMonthSelect-8989be5a.js +341 -0
- package/dist/bundled/v3/OrDateTimePickerPopoverHeader-caffcc00.js +162 -0
- package/dist/bundled/v3/OrDateTimePickerTimeSelect-e3a89bed.js +148 -0
- package/dist/bundled/v3/OrTimePicker.vue_vue_type_script_lang-f46eb37f.js +176 -0
- package/dist/bundled/v3/components/index.d.ts +2 -0
- package/dist/bundled/v3/components/index.js +8 -3
- package/dist/bundled/v3/components/or-date-picker-v3/OrDatePicker.vue.d.ts +183 -0
- package/dist/bundled/v3/components/or-date-picker-v3/index.d.ts +2 -0
- package/dist/bundled/v3/components/or-date-picker-v3/index.js +37 -0
- package/dist/bundled/v3/components/or-date-picker-v3/props.d.ts +1 -0
- package/dist/bundled/v3/components/or-date-picker-v3/styles.d.ts +2 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +11 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/index.js +7 -4
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/OrDateTimePickerDaySelect.vue.d.ts +12 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +12 -0
- package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +12 -0
- package/dist/bundled/v3/components/or-time-picker-v3/OrTimePicker.vue.d.ts +183 -0
- package/dist/bundled/v3/components/or-time-picker-v3/index.d.ts +2 -0
- package/dist/bundled/v3/components/or-time-picker-v3/index.js +33 -0
- package/dist/bundled/v3/components/or-time-picker-v3/props.d.ts +1 -0
- package/dist/bundled/v3/components/or-time-picker-v3/styles.d.ts +2 -0
- package/dist/bundled/v3/index.js +638 -408
- package/dist/esm/v2/OrDatePicker-454f5267.js +329 -0
- package/dist/esm/v2/OrDateTimePicker-3f533d0c.js +439 -0
- package/dist/esm/v2/OrDateTimePickerMonthSelect-380d9c90.js +406 -0
- package/dist/esm/v2/OrDateTimePickerPopoverHeader-e11d3222.js +235 -0
- package/dist/esm/v2/OrDateTimePickerTimeSelect-83dd1e81.js +177 -0
- package/dist/esm/v2/OrTimePicker-f23c8577.js +317 -0
- package/dist/esm/v2/components/index.d.ts +2 -0
- package/dist/esm/v2/components/index.js +8 -3
- package/dist/esm/v2/components/or-date-picker-v3/OrDatePicker.vue.d.ts +183 -0
- package/dist/esm/v2/components/or-date-picker-v3/index.d.ts +2 -0
- package/dist/esm/v2/components/or-date-picker-v3/index.js +29 -0
- package/dist/esm/v2/components/or-date-picker-v3/props.d.ts +1 -0
- package/dist/esm/v2/components/or-date-picker-v3/styles.d.ts +2 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +11 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/index.js +4 -2
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/OrDateTimePickerDaySelect.vue.d.ts +12 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +12 -0
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +12 -0
- package/dist/esm/v2/components/or-time-picker-v3/OrTimePicker.vue.d.ts +183 -0
- package/dist/esm/v2/components/or-time-picker-v3/index.d.ts +2 -0
- package/dist/esm/v2/components/or-time-picker-v3/index.js +27 -0
- package/dist/esm/v2/components/or-time-picker-v3/props.d.ts +1 -0
- package/dist/esm/v2/components/or-time-picker-v3/styles.d.ts +2 -0
- package/dist/esm/v2/index.js +8 -3
- package/dist/esm/v3/OrDatePicker-390f7f11.js +288 -0
- package/dist/esm/v3/OrDateTimePicker-54db4170.js +390 -0
- package/dist/esm/v3/OrDateTimePickerMonthSelect-709b673d.js +338 -0
- package/dist/esm/v3/OrDateTimePickerPopoverHeader-c771a251.js +161 -0
- package/dist/esm/v3/OrDateTimePickerTimeSelect-2c8a7f9c.js +148 -0
- package/dist/esm/v3/OrTimePicker-362ca566.js +282 -0
- package/dist/esm/v3/components/index.d.ts +2 -0
- package/dist/esm/v3/components/index.js +7 -2
- package/dist/esm/v3/components/or-date-picker-v3/OrDatePicker.vue.d.ts +183 -0
- package/dist/esm/v3/components/or-date-picker-v3/index.d.ts +2 -0
- package/dist/esm/v3/components/or-date-picker-v3/index.js +27 -0
- package/dist/esm/v3/components/or-date-picker-v3/props.d.ts +1 -0
- package/dist/esm/v3/components/or-date-picker-v3/styles.d.ts +2 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +11 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/index.js +4 -2
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/OrDateTimePickerDaySelect.vue.d.ts +12 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +12 -0
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +12 -0
- package/dist/esm/v3/components/or-time-picker-v3/OrTimePicker.vue.d.ts +183 -0
- package/dist/esm/v3/components/or-time-picker-v3/index.d.ts +2 -0
- package/dist/esm/v3/components/or-time-picker-v3/index.js +25 -0
- package/dist/esm/v3/components/or-time-picker-v3/props.d.ts +1 -0
- package/dist/esm/v3/components/or-time-picker-v3/styles.d.ts +2 -0
- package/dist/esm/v3/index.js +7 -2
- package/package.json +2 -2
- package/src/components/index.ts +2 -0
- package/src/components/or-date-picker-v3/OrDatePicker.docs.mdx +7 -0
- package/src/components/or-date-picker-v3/OrDatePicker.stories3.ts +160 -0
- package/src/components/or-date-picker-v3/OrDatePicker.vue +308 -0
- package/src/components/or-date-picker-v3/index.ts +2 -0
- package/src/components/or-date-picker-v3/props.ts +1 -0
- package/src/components/or-date-picker-v3/styles.ts +12 -0
- package/src/components/or-date-time-picker-v3/OrDateTimePicker.stories3.ts +4 -0
- package/src/components/or-date-time-picker-v3/OrDateTimePicker.vue +17 -37
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/OrDateTimePickerDaySelect.vue +7 -1
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue +8 -1
- package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue +8 -1
- package/src/components/or-time-picker-v3/OrTimePicker.docs.mdx +7 -0
- package/src/components/or-time-picker-v3/OrTimePicker.stories3.ts +160 -0
- package/src/components/or-time-picker-v3/OrTimePicker.vue +302 -0
- package/src/components/or-time-picker-v3/index.ts +2 -0
- package/src/components/or-time-picker-v3/props.ts +1 -0
- package/src/components/or-time-picker-v3/styles.ts +12 -0
- package/dist/bundled/v2/OrDateTimePicker-d6f327ad.js +0 -1215
- package/dist/bundled/v3/OrDateTimePicker.vue_vue_type_script_lang-ba3ac4fb.js +0 -834
- package/dist/esm/v2/OrDateTimePicker-57094f24.js +0 -1208
- package/dist/esm/v3/OrDateTimePicker-a8247a84.js +0 -997
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
import { defineComponent, ref, computed } from 'vue-demi';
|
|
2
|
+
import { _ as __vue_component__$2 } from './OrButton-2283df1c.js';
|
|
3
|
+
import { u as useDefaultYear, c as useDefaultMonth, d as useDefaultDate, e as useDefaultHours, f as useDefaultMinutes } from './OrDateTimePickerPopoverHeader-e11d3222.js';
|
|
4
|
+
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
5
|
+
import { _ as __vue_component__$4 } from './OrIconButton-ec2e21aa.js';
|
|
6
|
+
import { _ as __vue_component__$3 } from './OrIcon-d35a84d8.js';
|
|
7
|
+
import { _ as __vue_component__$6 } from './OrMenuItem-6f9b8a93.js';
|
|
8
|
+
import { _ as __vue_component__$5 } from './OrMenu-18a7f179.js';
|
|
9
|
+
import './OrPopover-83c885d0.js';
|
|
10
|
+
|
|
11
|
+
const DateTimePickerDaySelect = [
|
|
12
|
+
// Layout
|
|
13
|
+
'layout-column',
|
|
14
|
+
// Spacing
|
|
15
|
+
'px-md', 'py-md', 'gap-sm'];
|
|
16
|
+
const DateTimePickerDaySelectButtonGroup = [
|
|
17
|
+
// Layout
|
|
18
|
+
'grid', 'grid-cols-7',
|
|
19
|
+
// Spacing
|
|
20
|
+
'gap-xs'];
|
|
21
|
+
const DateTimePickerDaySelectButtonGroupItem = [
|
|
22
|
+
// Box
|
|
23
|
+
'min-w-fit',
|
|
24
|
+
// Spacing
|
|
25
|
+
'!px-sm', '!py-sm',
|
|
26
|
+
// Typography
|
|
27
|
+
'typography-caption-regular'];
|
|
28
|
+
|
|
29
|
+
var script$1 = defineComponent({
|
|
30
|
+
name: 'OrDateTimePickerDaySelect',
|
|
31
|
+
components: {
|
|
32
|
+
OrButton: __vue_component__$2
|
|
33
|
+
},
|
|
34
|
+
model: {
|
|
35
|
+
prop: 'modelValue',
|
|
36
|
+
event: 'update:modelValue'
|
|
37
|
+
},
|
|
38
|
+
props: {
|
|
39
|
+
modelValue: {
|
|
40
|
+
type: Date,
|
|
41
|
+
default: undefined
|
|
42
|
+
},
|
|
43
|
+
filter: {
|
|
44
|
+
type: Function,
|
|
45
|
+
default: undefined
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
emits: ['update:modelValue'],
|
|
49
|
+
expose: ['root'],
|
|
50
|
+
setup(props, context) {
|
|
51
|
+
// Refs
|
|
52
|
+
const root = ref();
|
|
53
|
+
// Styles
|
|
54
|
+
const rootStyles = computed(() => ['or-date-time-picker-day-select', ...DateTimePickerDaySelect]);
|
|
55
|
+
const buttonGroupStyles = computed(() => [...DateTimePickerDaySelectButtonGroup]);
|
|
56
|
+
const buttonGroupItemStyles = computed(() => [...DateTimePickerDaySelectButtonGroupItem]);
|
|
57
|
+
// State
|
|
58
|
+
const proxyModelValue = computed({
|
|
59
|
+
get: () => {
|
|
60
|
+
var _a;
|
|
61
|
+
return (_a = props.modelValue) !== null && _a !== void 0 ? _a : new Date(Date.UTC(useDefaultYear(), useDefaultMonth(), useDefaultDate(), useDefaultHours(), useDefaultMinutes()));
|
|
62
|
+
},
|
|
63
|
+
set: value => {
|
|
64
|
+
context.emit('update:modelValue', value);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const dayOptions = computed(() => {
|
|
68
|
+
const monthStartDate = new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth(), 1, proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
|
|
69
|
+
const monthEndDate = new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth() + 1, 0, proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
|
|
70
|
+
const calendarStartDate = new Date(Date.UTC(monthStartDate.getUTCFullYear(), monthStartDate.getUTCMonth(), 1 - (monthStartDate.getUTCDay() + 6) % 7, monthStartDate.getUTCHours(), monthStartDate.getUTCMinutes()));
|
|
71
|
+
const calendarEndDate = new Date(Date.UTC(monthEndDate.getUTCFullYear(), monthEndDate.getUTCMonth() + 1, (7 - monthEndDate.getUTCDay()) % 7, monthEndDate.getUTCHours(), monthEndDate.getUTCMinutes()));
|
|
72
|
+
return (() => {
|
|
73
|
+
let options = [],
|
|
74
|
+
value = calendarStartDate;
|
|
75
|
+
while (Number(value) !== Number(calendarEndDate)) {
|
|
76
|
+
options = [...options, value];
|
|
77
|
+
value = new Date(Date.UTC(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate() + 1, value.getUTCHours(), value.getUTCMinutes()));
|
|
78
|
+
}
|
|
79
|
+
return options;
|
|
80
|
+
})();
|
|
81
|
+
});
|
|
82
|
+
// Methods
|
|
83
|
+
function formatDay(value) {
|
|
84
|
+
return value.toLocaleString('default', {
|
|
85
|
+
day: 'numeric',
|
|
86
|
+
timeZone: 'UTC'
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
root,
|
|
91
|
+
rootStyles,
|
|
92
|
+
buttonGroupStyles,
|
|
93
|
+
buttonGroupItemStyles,
|
|
94
|
+
proxyModelValue,
|
|
95
|
+
dayOptions,
|
|
96
|
+
formatDay
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
/* script */
|
|
102
|
+
const __vue_script__$1 = script$1;
|
|
103
|
+
|
|
104
|
+
/* template */
|
|
105
|
+
var __vue_render__$1 = function () {
|
|
106
|
+
var _vm = this;
|
|
107
|
+
var _h = _vm.$createElement;
|
|
108
|
+
var _c = _vm._self._c || _h;
|
|
109
|
+
return _c('div', {
|
|
110
|
+
ref: "root",
|
|
111
|
+
class: _vm.rootStyles
|
|
112
|
+
}, [_c('div', {
|
|
113
|
+
class: _vm.buttonGroupStyles
|
|
114
|
+
}, _vm._l(_vm.dayOptions, function (value) {
|
|
115
|
+
return _c('OrButton', {
|
|
116
|
+
key: Number(value),
|
|
117
|
+
class: _vm.buttonGroupItemStyles,
|
|
118
|
+
attrs: {
|
|
119
|
+
"variant": Number(value) === Number(_vm.proxyModelValue) ? 'contained' : 'text',
|
|
120
|
+
"color": Number(value) === Number(_vm.proxyModelValue) ? 'primary' : 'inherit',
|
|
121
|
+
"disabled": _vm.filter && !_vm.filter(value)
|
|
122
|
+
},
|
|
123
|
+
on: {
|
|
124
|
+
"click": function ($event) {
|
|
125
|
+
$event.stopPropagation();
|
|
126
|
+
_vm.proxyModelValue = value;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatDay(value)) + "\n ")]);
|
|
130
|
+
}), 1)]);
|
|
131
|
+
};
|
|
132
|
+
var __vue_staticRenderFns__$1 = [];
|
|
133
|
+
|
|
134
|
+
/* style */
|
|
135
|
+
const __vue_inject_styles__$1 = undefined;
|
|
136
|
+
/* scoped */
|
|
137
|
+
const __vue_scope_id__$1 = undefined;
|
|
138
|
+
/* module identifier */
|
|
139
|
+
const __vue_module_identifier__$1 = undefined;
|
|
140
|
+
/* functional template */
|
|
141
|
+
const __vue_is_functional_template__$1 = false;
|
|
142
|
+
/* style inject */
|
|
143
|
+
|
|
144
|
+
/* style inject SSR */
|
|
145
|
+
|
|
146
|
+
/* style inject shadow dom */
|
|
147
|
+
|
|
148
|
+
const __vue_component__$1 = /*#__PURE__*/normalizeComponent({
|
|
149
|
+
render: __vue_render__$1,
|
|
150
|
+
staticRenderFns: __vue_staticRenderFns__$1
|
|
151
|
+
}, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, false, undefined, undefined, undefined);
|
|
152
|
+
|
|
153
|
+
const DateTimePickerMonthSelect = [
|
|
154
|
+
// Layout
|
|
155
|
+
'layout-row justify-between',
|
|
156
|
+
// Spacing
|
|
157
|
+
'px-md', 'py-md', 'gap-md'];
|
|
158
|
+
|
|
159
|
+
var script = defineComponent({
|
|
160
|
+
name: 'OrDateTimePickerMonthSelect',
|
|
161
|
+
components: {
|
|
162
|
+
OrButton: __vue_component__$2,
|
|
163
|
+
OrIcon: __vue_component__$3,
|
|
164
|
+
OrIconButton: __vue_component__$4,
|
|
165
|
+
OrMenu: __vue_component__$5,
|
|
166
|
+
OrMenuItem: __vue_component__$6
|
|
167
|
+
},
|
|
168
|
+
model: {
|
|
169
|
+
prop: 'modelValue',
|
|
170
|
+
event: 'update:modelValue'
|
|
171
|
+
},
|
|
172
|
+
props: {
|
|
173
|
+
modelValue: {
|
|
174
|
+
type: Date,
|
|
175
|
+
default: undefined
|
|
176
|
+
},
|
|
177
|
+
filter: {
|
|
178
|
+
type: Function,
|
|
179
|
+
default: undefined
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
emits: ['update:modelValue'],
|
|
183
|
+
expose: ['root'],
|
|
184
|
+
setup(props, context) {
|
|
185
|
+
// Refs
|
|
186
|
+
const root = ref();
|
|
187
|
+
const yearButton = ref();
|
|
188
|
+
const monthButton = ref();
|
|
189
|
+
const yearButtonRoot = computed(() => {
|
|
190
|
+
var _a;
|
|
191
|
+
return (_a = yearButton.value) === null || _a === void 0 ? void 0 : _a.root;
|
|
192
|
+
});
|
|
193
|
+
const monthButtonRoot = computed(() => {
|
|
194
|
+
var _a;
|
|
195
|
+
return (_a = monthButton.value) === null || _a === void 0 ? void 0 : _a.root;
|
|
196
|
+
});
|
|
197
|
+
const yearMenu = ref();
|
|
198
|
+
const monthMenu = ref();
|
|
199
|
+
const yearMenuState = computed(() => {
|
|
200
|
+
var _a;
|
|
201
|
+
return (_a = yearMenu.value) === null || _a === void 0 ? void 0 : _a.state;
|
|
202
|
+
});
|
|
203
|
+
const monthMenuState = computed(() => {
|
|
204
|
+
var _a;
|
|
205
|
+
return (_a = monthMenu.value) === null || _a === void 0 ? void 0 : _a.state;
|
|
206
|
+
});
|
|
207
|
+
// Styles
|
|
208
|
+
const rootStyles = computed(() => ['or-date-time-picker-month-select', ...DateTimePickerMonthSelect]);
|
|
209
|
+
// State
|
|
210
|
+
const proxyModelValue = computed({
|
|
211
|
+
get: () => {
|
|
212
|
+
var _a;
|
|
213
|
+
return (_a = props.modelValue) !== null && _a !== void 0 ? _a : new Date(Date.UTC(useDefaultYear(), useDefaultMonth(), useDefaultDate(), useDefaultHours(), useDefaultMinutes()));
|
|
214
|
+
},
|
|
215
|
+
set: value => {
|
|
216
|
+
context.emit('update:modelValue', value);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
const yearOptions = computed(() => {
|
|
220
|
+
return Array.from({
|
|
221
|
+
length: 11
|
|
222
|
+
}).map((_value, index, {
|
|
223
|
+
length
|
|
224
|
+
}) => {
|
|
225
|
+
const value = proxyModelValue.value.getUTCFullYear() - Math.floor(length / 2) + index;
|
|
226
|
+
return new Date(Date.UTC(value, proxyModelValue.value.getUTCMonth(), proxyModelValue.value.getUTCDate(), proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
const monthOptions = computed(() => {
|
|
230
|
+
return Array.from({
|
|
231
|
+
length: 12
|
|
232
|
+
}, (_value, index) => {
|
|
233
|
+
const value = index;
|
|
234
|
+
return new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), value, proxyModelValue.value.getUTCDate(), proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
// Methods
|
|
238
|
+
function goToNextMonth() {
|
|
239
|
+
proxyModelValue.value = new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth() + 1, proxyModelValue.value.getUTCDate(), proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
|
|
240
|
+
}
|
|
241
|
+
function goToPreviousMonth() {
|
|
242
|
+
proxyModelValue.value = new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth() - 1, proxyModelValue.value.getUTCDate(), proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
|
|
243
|
+
}
|
|
244
|
+
function formatYear(value) {
|
|
245
|
+
return value.toLocaleString('default', {
|
|
246
|
+
year: 'numeric',
|
|
247
|
+
timeZone: 'UTC'
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
function formatMonth(value) {
|
|
251
|
+
return value.toLocaleString('default', {
|
|
252
|
+
month: 'long',
|
|
253
|
+
timeZone: 'UTC'
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
root,
|
|
258
|
+
yearButton,
|
|
259
|
+
monthButton,
|
|
260
|
+
yearButtonRoot,
|
|
261
|
+
monthButtonRoot,
|
|
262
|
+
yearMenu,
|
|
263
|
+
monthMenu,
|
|
264
|
+
yearMenuState,
|
|
265
|
+
monthMenuState,
|
|
266
|
+
rootStyles,
|
|
267
|
+
proxyModelValue,
|
|
268
|
+
yearOptions,
|
|
269
|
+
monthOptions,
|
|
270
|
+
goToNextMonth,
|
|
271
|
+
goToPreviousMonth,
|
|
272
|
+
formatYear,
|
|
273
|
+
formatMonth
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
/* script */
|
|
279
|
+
const __vue_script__ = script;
|
|
280
|
+
|
|
281
|
+
/* template */
|
|
282
|
+
var __vue_render__ = function () {
|
|
283
|
+
var _vm = this;
|
|
284
|
+
var _h = _vm.$createElement;
|
|
285
|
+
var _c = _vm._self._c || _h;
|
|
286
|
+
return _c('div', {
|
|
287
|
+
ref: "root",
|
|
288
|
+
class: _vm.rootStyles
|
|
289
|
+
}, [_c('OrIconButton', {
|
|
290
|
+
attrs: {
|
|
291
|
+
"icon": 'chevron_left'
|
|
292
|
+
},
|
|
293
|
+
on: {
|
|
294
|
+
"click": function ($event) {
|
|
295
|
+
$event.stopPropagation();
|
|
296
|
+
return _vm.goToPreviousMonth();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}), _vm._v(" "), _c('div', {
|
|
300
|
+
class: ['layout-row-reverse', 'gap-md']
|
|
301
|
+
}, [_c('OrButton', {
|
|
302
|
+
ref: "yearButton",
|
|
303
|
+
attrs: {
|
|
304
|
+
"variant": 'link',
|
|
305
|
+
"color": 'inherit'
|
|
306
|
+
},
|
|
307
|
+
on: {
|
|
308
|
+
"click": function ($event) {
|
|
309
|
+
$event.stopPropagation();
|
|
310
|
+
return _vm.yearMenu.open();
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatYear(_vm.proxyModelValue)) + " "), _c('OrIcon', {
|
|
314
|
+
attrs: {
|
|
315
|
+
"icon": _vm.yearMenuState === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
|
|
316
|
+
}
|
|
317
|
+
})], 1), _vm._v(" "), _c('OrButton', {
|
|
318
|
+
ref: "monthButton",
|
|
319
|
+
attrs: {
|
|
320
|
+
"variant": 'link',
|
|
321
|
+
"color": 'inherit'
|
|
322
|
+
},
|
|
323
|
+
on: {
|
|
324
|
+
"click": function ($event) {
|
|
325
|
+
$event.stopPropagation();
|
|
326
|
+
return _vm.monthMenu.open();
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatMonth(_vm.proxyModelValue)) + " "), _c('OrIcon', {
|
|
330
|
+
attrs: {
|
|
331
|
+
"icon": _vm.monthMenuState === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
|
|
332
|
+
}
|
|
333
|
+
})], 1), _vm._v(" "), _c('OrMenu', {
|
|
334
|
+
ref: "yearMenu",
|
|
335
|
+
attrs: {
|
|
336
|
+
"trigger": _vm.yearButtonRoot
|
|
337
|
+
}
|
|
338
|
+
}, _vm._l(_vm.yearOptions, function (value) {
|
|
339
|
+
return _c('OrMenuItem', {
|
|
340
|
+
key: Number(value),
|
|
341
|
+
attrs: {
|
|
342
|
+
"selected": Number(value) === Number(_vm.proxyModelValue),
|
|
343
|
+
"disabled": _vm.filter && !_vm.filter(value)
|
|
344
|
+
},
|
|
345
|
+
on: {
|
|
346
|
+
"click": function ($event) {
|
|
347
|
+
$event.stopPropagation();
|
|
348
|
+
_vm.proxyModelValue = value;
|
|
349
|
+
_vm.yearMenu.close();
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatYear(value)) + "\n ")]);
|
|
353
|
+
}), 1), _vm._v(" "), _c('OrMenu', {
|
|
354
|
+
ref: "monthMenu",
|
|
355
|
+
attrs: {
|
|
356
|
+
"trigger": _vm.monthButtonRoot
|
|
357
|
+
}
|
|
358
|
+
}, _vm._l(_vm.monthOptions, function (value) {
|
|
359
|
+
return _c('OrMenuItem', {
|
|
360
|
+
key: Number(value),
|
|
361
|
+
attrs: {
|
|
362
|
+
"selected": Number(value) === Number(_vm.proxyModelValue),
|
|
363
|
+
"disabled": _vm.filter && !_vm.filter(value)
|
|
364
|
+
},
|
|
365
|
+
on: {
|
|
366
|
+
"click": function ($event) {
|
|
367
|
+
$event.stopPropagation();
|
|
368
|
+
_vm.proxyModelValue = value;
|
|
369
|
+
_vm.monthMenu.close();
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}, [_vm._v("\n " + _vm._s(_vm.formatMonth(value)) + "\n ")]);
|
|
373
|
+
}), 1)], 1), _vm._v(" "), _c('OrIconButton', {
|
|
374
|
+
attrs: {
|
|
375
|
+
"icon": 'chevron_right'
|
|
376
|
+
},
|
|
377
|
+
on: {
|
|
378
|
+
"click": function ($event) {
|
|
379
|
+
$event.stopPropagation();
|
|
380
|
+
return _vm.goToNextMonth();
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
})], 1);
|
|
384
|
+
};
|
|
385
|
+
var __vue_staticRenderFns__ = [];
|
|
386
|
+
|
|
387
|
+
/* style */
|
|
388
|
+
const __vue_inject_styles__ = undefined;
|
|
389
|
+
/* scoped */
|
|
390
|
+
const __vue_scope_id__ = undefined;
|
|
391
|
+
/* module identifier */
|
|
392
|
+
const __vue_module_identifier__ = undefined;
|
|
393
|
+
/* functional template */
|
|
394
|
+
const __vue_is_functional_template__ = false;
|
|
395
|
+
/* style inject */
|
|
396
|
+
|
|
397
|
+
/* style inject SSR */
|
|
398
|
+
|
|
399
|
+
/* style inject shadow dom */
|
|
400
|
+
|
|
401
|
+
const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
402
|
+
render: __vue_render__,
|
|
403
|
+
staticRenderFns: __vue_staticRenderFns__
|
|
404
|
+
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
405
|
+
|
|
406
|
+
export { __vue_component__$1 as _, __vue_component__ as a };
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { defineComponent, ref, computed } from 'vue-demi';
|
|
2
|
+
import { _ as __vue_component__$3 } from './OrLabel-63380256.js';
|
|
3
|
+
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
4
|
+
import { _ as __vue_component__$4 } from './OrButton-2283df1c.js';
|
|
5
|
+
|
|
6
|
+
function useDefaultDate() {
|
|
7
|
+
return new Date().getUTCDate();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function useDefaultHours() {
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function useDefaultMinutes() {
|
|
15
|
+
return 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function useDefaultMonth() {
|
|
19
|
+
return new Date().getUTCMonth();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function useDefaultYear() {
|
|
23
|
+
return new Date().getUTCFullYear();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const DateTimePickerMobileControl = [
|
|
27
|
+
// Layout
|
|
28
|
+
'layout-column',
|
|
29
|
+
// Spacing
|
|
30
|
+
'gap-xs'];
|
|
31
|
+
const DateTimePickerMobileControlContent = [
|
|
32
|
+
// Typography
|
|
33
|
+
'typography-headline-1',
|
|
34
|
+
// Theme
|
|
35
|
+
'theme-foreground-outline', 'dark:theme-foreground-outline-dark'];
|
|
36
|
+
|
|
37
|
+
var script$2 = defineComponent({
|
|
38
|
+
name: 'OrDateTimePickerMobileControl',
|
|
39
|
+
components: {
|
|
40
|
+
OrLabel: __vue_component__$3
|
|
41
|
+
},
|
|
42
|
+
props: {
|
|
43
|
+
label: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: true
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
expose: ['root'],
|
|
49
|
+
setup() {
|
|
50
|
+
// Refs
|
|
51
|
+
const root = ref();
|
|
52
|
+
// Styles
|
|
53
|
+
const rootStyles = computed(() => ['or-date-time-picker-mobile-control', ...DateTimePickerMobileControl]);
|
|
54
|
+
const contentStyles = computed(() => [...DateTimePickerMobileControlContent]);
|
|
55
|
+
return {
|
|
56
|
+
root,
|
|
57
|
+
rootStyles,
|
|
58
|
+
contentStyles
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
/* script */
|
|
64
|
+
const __vue_script__$2 = script$2;
|
|
65
|
+
|
|
66
|
+
/* template */
|
|
67
|
+
var __vue_render__$2 = function () {
|
|
68
|
+
var _vm = this;
|
|
69
|
+
var _h = _vm.$createElement;
|
|
70
|
+
var _c = _vm._self._c || _h;
|
|
71
|
+
return _c('div', {
|
|
72
|
+
ref: "root",
|
|
73
|
+
class: _vm.rootStyles
|
|
74
|
+
}, [_c('OrLabel', [_vm._v(_vm._s(_vm.label))]), _vm._v(" "), _c('div', {
|
|
75
|
+
class: _vm.contentStyles
|
|
76
|
+
}, [_vm._t("default")], 2)], 1);
|
|
77
|
+
};
|
|
78
|
+
var __vue_staticRenderFns__$2 = [];
|
|
79
|
+
|
|
80
|
+
/* style */
|
|
81
|
+
const __vue_inject_styles__$2 = undefined;
|
|
82
|
+
/* scoped */
|
|
83
|
+
const __vue_scope_id__$2 = undefined;
|
|
84
|
+
/* module identifier */
|
|
85
|
+
const __vue_module_identifier__$2 = undefined;
|
|
86
|
+
/* functional template */
|
|
87
|
+
const __vue_is_functional_template__$2 = false;
|
|
88
|
+
/* style inject */
|
|
89
|
+
|
|
90
|
+
/* style inject SSR */
|
|
91
|
+
|
|
92
|
+
/* style inject shadow dom */
|
|
93
|
+
|
|
94
|
+
const __vue_component__$2 = /*#__PURE__*/normalizeComponent({
|
|
95
|
+
render: __vue_render__$2,
|
|
96
|
+
staticRenderFns: __vue_staticRenderFns__$2
|
|
97
|
+
}, __vue_inject_styles__$2, __vue_script__$2, __vue_scope_id__$2, __vue_is_functional_template__$2, __vue_module_identifier__$2, false, undefined, undefined, undefined);
|
|
98
|
+
|
|
99
|
+
const DateTimePickerPopoverFooter = [
|
|
100
|
+
// Layout
|
|
101
|
+
'layout-row-reverse',
|
|
102
|
+
// Layout (children)
|
|
103
|
+
'children:grow',
|
|
104
|
+
// Spacing
|
|
105
|
+
'px-md md:px-sm', 'py-md md:py-sm', 'gap-md md:gap-sm'];
|
|
106
|
+
|
|
107
|
+
var script$1 = defineComponent({
|
|
108
|
+
name: 'OrDateTimePickerPopoverFooter',
|
|
109
|
+
components: {
|
|
110
|
+
OrButton: __vue_component__$4
|
|
111
|
+
},
|
|
112
|
+
emits: ['resolve', 'reject'],
|
|
113
|
+
expose: ['root'],
|
|
114
|
+
setup() {
|
|
115
|
+
// Refs
|
|
116
|
+
const root = ref();
|
|
117
|
+
// Styles
|
|
118
|
+
const rootStyles = computed(() => ['or-date-time-picker-popover-footer', ...DateTimePickerPopoverFooter]);
|
|
119
|
+
return {
|
|
120
|
+
root,
|
|
121
|
+
rootStyles
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
/* script */
|
|
127
|
+
const __vue_script__$1 = script$1;
|
|
128
|
+
|
|
129
|
+
/* template */
|
|
130
|
+
var __vue_render__$1 = function () {
|
|
131
|
+
var _vm = this;
|
|
132
|
+
var _h = _vm.$createElement;
|
|
133
|
+
var _c = _vm._self._c || _h;
|
|
134
|
+
return _c('footer', {
|
|
135
|
+
ref: "root",
|
|
136
|
+
class: _vm.rootStyles
|
|
137
|
+
}, [_c('OrButton', {
|
|
138
|
+
attrs: {
|
|
139
|
+
"variant": 'outlined'
|
|
140
|
+
},
|
|
141
|
+
on: {
|
|
142
|
+
"click": function ($event) {
|
|
143
|
+
$event.stopPropagation();
|
|
144
|
+
return _vm.$emit('resolve');
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}, [_vm._v("\n Done\n ")]), _vm._v(" "), _c('OrButton', {
|
|
148
|
+
attrs: {
|
|
149
|
+
"variant": 'text'
|
|
150
|
+
},
|
|
151
|
+
on: {
|
|
152
|
+
"click": function ($event) {
|
|
153
|
+
$event.stopPropagation();
|
|
154
|
+
return _vm.$emit('reject');
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}, [_vm._v("\n Cancel\n ")])], 1);
|
|
158
|
+
};
|
|
159
|
+
var __vue_staticRenderFns__$1 = [];
|
|
160
|
+
|
|
161
|
+
/* style */
|
|
162
|
+
const __vue_inject_styles__$1 = undefined;
|
|
163
|
+
/* scoped */
|
|
164
|
+
const __vue_scope_id__$1 = undefined;
|
|
165
|
+
/* module identifier */
|
|
166
|
+
const __vue_module_identifier__$1 = undefined;
|
|
167
|
+
/* functional template */
|
|
168
|
+
const __vue_is_functional_template__$1 = false;
|
|
169
|
+
/* style inject */
|
|
170
|
+
|
|
171
|
+
/* style inject SSR */
|
|
172
|
+
|
|
173
|
+
/* style inject shadow dom */
|
|
174
|
+
|
|
175
|
+
const __vue_component__$1 = /*#__PURE__*/normalizeComponent({
|
|
176
|
+
render: __vue_render__$1,
|
|
177
|
+
staticRenderFns: __vue_staticRenderFns__$1
|
|
178
|
+
}, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, false, undefined, undefined, undefined);
|
|
179
|
+
|
|
180
|
+
const DateTimePickerPopoverHeader = [
|
|
181
|
+
// Layout
|
|
182
|
+
'layout-row md:hidden',
|
|
183
|
+
// Spacing
|
|
184
|
+
'px-md', 'py-md', 'gap-xl'];
|
|
185
|
+
|
|
186
|
+
var script = defineComponent({
|
|
187
|
+
name: 'OrDateTimePickerPopoverHeader',
|
|
188
|
+
expose: ['root'],
|
|
189
|
+
setup() {
|
|
190
|
+
// Refs
|
|
191
|
+
const root = ref();
|
|
192
|
+
// Styles
|
|
193
|
+
const rootStyles = computed(() => ['or-date-time-picker-popover-header', ...DateTimePickerPopoverHeader]);
|
|
194
|
+
return {
|
|
195
|
+
root,
|
|
196
|
+
rootStyles
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
/* script */
|
|
202
|
+
const __vue_script__ = script;
|
|
203
|
+
|
|
204
|
+
/* template */
|
|
205
|
+
var __vue_render__ = function () {
|
|
206
|
+
var _vm = this;
|
|
207
|
+
var _h = _vm.$createElement;
|
|
208
|
+
var _c = _vm._self._c || _h;
|
|
209
|
+
return _c('header', {
|
|
210
|
+
ref: "root",
|
|
211
|
+
class: _vm.rootStyles
|
|
212
|
+
}, [_vm._t("default")], 2);
|
|
213
|
+
};
|
|
214
|
+
var __vue_staticRenderFns__ = [];
|
|
215
|
+
|
|
216
|
+
/* style */
|
|
217
|
+
const __vue_inject_styles__ = undefined;
|
|
218
|
+
/* scoped */
|
|
219
|
+
const __vue_scope_id__ = undefined;
|
|
220
|
+
/* module identifier */
|
|
221
|
+
const __vue_module_identifier__ = undefined;
|
|
222
|
+
/* functional template */
|
|
223
|
+
const __vue_is_functional_template__ = false;
|
|
224
|
+
/* style inject */
|
|
225
|
+
|
|
226
|
+
/* style inject SSR */
|
|
227
|
+
|
|
228
|
+
/* style inject shadow dom */
|
|
229
|
+
|
|
230
|
+
const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
231
|
+
render: __vue_render__,
|
|
232
|
+
staticRenderFns: __vue_staticRenderFns__
|
|
233
|
+
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
234
|
+
|
|
235
|
+
export { __vue_component__$2 as _, __vue_component__$1 as a, __vue_component__ as b, useDefaultMonth as c, useDefaultDate as d, useDefaultHours as e, useDefaultMinutes as f, useDefaultYear as u };
|