@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.
Files changed (112) hide show
  1. package/dist/bundled/v2/{OrCardCollection-ad2240ac.js → OrCardCollection-a10920a3.js} +1 -1
  2. package/dist/bundled/v2/{OrDateTimePicker-60e1a7ee.js → OrDateTimePicker-d6f327ad.js} +308 -176
  3. package/dist/bundled/v2/{OrMenu-cbb0c2c8.js → OrMenu-0c2c348c.js} +6 -1
  4. package/dist/bundled/v2/{OrPagination-cf47d71c.js → OrPagination-00ab6954.js} +1 -1
  5. package/dist/bundled/v2/{OrTabs-10f7e668.js → OrTabs-f7c9f754.js} +1 -1
  6. package/dist/bundled/v2/components/index.js +5 -5
  7. package/dist/bundled/v2/components/or-card-collection-v3/index.js +2 -2
  8. package/dist/bundled/v2/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +11 -1
  9. package/dist/bundled/v2/components/or-date-time-picker-v3/hooks/useDefaultDate.d.ts +1 -0
  10. package/dist/bundled/v2/components/or-date-time-picker-v3/hooks/useDefaultHours.d.ts +1 -0
  11. package/dist/bundled/v2/components/or-date-time-picker-v3/hooks/useDefaultMinutes.d.ts +1 -0
  12. package/dist/bundled/v2/components/or-date-time-picker-v3/hooks/useDefaultMonth.d.ts +1 -0
  13. package/dist/bundled/v2/components/or-date-time-picker-v3/hooks/useDefaultYear.d.ts +1 -0
  14. package/dist/bundled/v2/components/or-date-time-picker-v3/index.js +4 -4
  15. 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
  16. package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/styles.d.ts +3 -0
  17. package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +26 -34
  18. package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +8 -20
  19. package/dist/bundled/v2/components/or-menu-v3/OrMenu.vue.d.ts +2 -0
  20. package/dist/bundled/v2/components/or-menu-v3/index.js +1 -1
  21. package/dist/bundled/v2/components/or-pagination-v3/index.js +2 -2
  22. package/dist/bundled/v2/components/or-tabs-v3/index.js +2 -2
  23. package/dist/bundled/v2/index.js +6 -6
  24. package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-61f92c57.js → OrCardCollection.vue_vue_type_script_lang-93c84377.js} +2 -2
  25. package/dist/bundled/v3/{OrDateTimePicker.vue_vue_type_script_lang-fb197c2f.js → OrDateTimePicker.vue_vue_type_script_lang-ba3ac4fb.js} +281 -165
  26. package/dist/bundled/v3/{OrMenu-89afef68.js → OrMenu-101f1c62.js} +1 -1
  27. package/dist/bundled/v3/{OrMenu.vue_vue_type_script_lang-f6748a99.js → OrMenu.vue_vue_type_script_lang-7ba15d1d.js} +6 -1
  28. package/dist/bundled/v3/{OrPagination.vue_vue_type_script_lang-7673a00e.js → OrPagination.vue_vue_type_script_lang-d3e6732f.js} +2 -2
  29. package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-ebd2a59d.js → OrTabs.vue_vue_type_script_lang-513b1e98.js} +2 -2
  30. package/dist/bundled/v3/components/index.js +6 -6
  31. package/dist/bundled/v3/components/or-card-collection-v3/index.js +3 -3
  32. package/dist/bundled/v3/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +11 -1
  33. package/dist/bundled/v3/components/or-date-time-picker-v3/hooks/useDefaultDate.d.ts +1 -0
  34. package/dist/bundled/v3/components/or-date-time-picker-v3/hooks/useDefaultHours.d.ts +1 -0
  35. package/dist/bundled/v3/components/or-date-time-picker-v3/hooks/useDefaultMinutes.d.ts +1 -0
  36. package/dist/bundled/v3/components/or-date-time-picker-v3/hooks/useDefaultMonth.d.ts +1 -0
  37. package/dist/bundled/v3/components/or-date-time-picker-v3/hooks/useDefaultYear.d.ts +1 -0
  38. package/dist/bundled/v3/components/or-date-time-picker-v3/index.js +5 -5
  39. 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
  40. package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/styles.d.ts +3 -0
  41. package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +26 -34
  42. package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +8 -20
  43. package/dist/bundled/v3/components/or-menu-v3/OrMenu.vue.d.ts +2 -0
  44. package/dist/bundled/v3/components/or-menu-v3/index.js +1 -1
  45. package/dist/bundled/v3/components/or-pagination-v3/index.js +3 -3
  46. package/dist/bundled/v3/components/or-tabs-v3/index.js +3 -3
  47. package/dist/bundled/v3/index.js +50 -32
  48. package/dist/esm/v2/{OrCardCollection-662d5727.js → OrCardCollection-54079e79.js} +1 -1
  49. package/dist/esm/v2/{OrDateTimePicker-4b650aca.js → OrDateTimePicker-57094f24.js} +316 -184
  50. package/dist/esm/v2/{OrMenu-47b319a6.js → OrMenu-18a7f179.js} +6 -1
  51. package/dist/esm/v2/{OrPagination-4d330d4f.js → OrPagination-16f6d75b.js} +1 -1
  52. package/dist/esm/v2/{OrTabs-f0e4db08.js → OrTabs-18df1ce9.js} +1 -1
  53. package/dist/esm/v2/components/index.js +5 -5
  54. package/dist/esm/v2/components/or-card-collection-v3/index.js +2 -2
  55. package/dist/esm/v2/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +11 -1
  56. package/dist/esm/v2/components/or-date-time-picker-v3/hooks/useDefaultDate.d.ts +1 -0
  57. package/dist/esm/v2/components/or-date-time-picker-v3/hooks/useDefaultHours.d.ts +1 -0
  58. package/dist/esm/v2/components/or-date-time-picker-v3/hooks/useDefaultMinutes.d.ts +1 -0
  59. package/dist/esm/v2/components/or-date-time-picker-v3/hooks/useDefaultMonth.d.ts +1 -0
  60. package/dist/esm/v2/components/or-date-time-picker-v3/hooks/useDefaultYear.d.ts +1 -0
  61. package/dist/esm/v2/components/or-date-time-picker-v3/index.js +5 -5
  62. 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
  63. package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/styles.d.ts +3 -0
  64. package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +26 -34
  65. package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +8 -20
  66. package/dist/esm/v2/components/or-menu-v3/OrMenu.vue.d.ts +2 -0
  67. package/dist/esm/v2/components/or-menu-v3/index.js +1 -1
  68. package/dist/esm/v2/components/or-pagination-v3/index.js +2 -2
  69. package/dist/esm/v2/components/or-tabs-v3/index.js +2 -2
  70. package/dist/esm/v2/index.js +5 -5
  71. package/dist/esm/v3/{OrCardCollection-aa7f0c81.js → OrCardCollection-b937aa7a.js} +1 -1
  72. package/dist/esm/v3/{OrDateTimePicker-3e2dc067.js → OrDateTimePicker-a8247a84.js} +321 -187
  73. package/dist/esm/v3/{OrMenu-053a9ab7.js → OrMenu-70cee836.js} +6 -1
  74. package/dist/esm/v3/{OrPagination-f2d104d9.js → OrPagination-7f4ed166.js} +1 -1
  75. package/dist/esm/v3/{OrTabs-d9e2a07e.js → OrTabs-0a5c80be.js} +1 -1
  76. package/dist/esm/v3/components/index.js +5 -5
  77. package/dist/esm/v3/components/or-card-collection-v3/index.js +2 -2
  78. package/dist/esm/v3/components/or-date-time-picker-v3/OrDateTimePicker.vue.d.ts +11 -1
  79. package/dist/esm/v3/components/or-date-time-picker-v3/hooks/useDefaultDate.d.ts +1 -0
  80. package/dist/esm/v3/components/or-date-time-picker-v3/hooks/useDefaultHours.d.ts +1 -0
  81. package/dist/esm/v3/components/or-date-time-picker-v3/hooks/useDefaultMinutes.d.ts +1 -0
  82. package/dist/esm/v3/components/or-date-time-picker-v3/hooks/useDefaultMonth.d.ts +1 -0
  83. package/dist/esm/v3/components/or-date-time-picker-v3/hooks/useDefaultYear.d.ts +1 -0
  84. package/dist/esm/v3/components/or-date-time-picker-v3/index.js +4 -4
  85. 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
  86. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/styles.d.ts +3 -0
  87. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue.d.ts +26 -34
  88. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue.d.ts +8 -20
  89. package/dist/esm/v3/components/or-menu-v3/OrMenu.vue.d.ts +2 -0
  90. package/dist/esm/v3/components/or-menu-v3/index.js +1 -1
  91. package/dist/esm/v3/components/or-pagination-v3/index.js +2 -2
  92. package/dist/esm/v3/components/or-tabs-v3/index.js +2 -2
  93. package/dist/esm/v3/index.js +5 -5
  94. package/package.json +2 -2
  95. package/src/components/or-date-time-picker-v3/OrDateTimePicker.vue +88 -39
  96. package/src/components/or-date-time-picker-v3/hooks/useDefaultDate.ts +3 -0
  97. package/src/components/or-date-time-picker-v3/hooks/useDefaultHours.ts +3 -0
  98. package/src/components/or-date-time-picker-v3/hooks/useDefaultMinutes.ts +3 -0
  99. package/src/components/or-date-time-picker-v3/hooks/useDefaultMonth.ts +3 -0
  100. package/src/components/or-date-time-picker-v3/hooks/useDefaultYear.ts +3 -0
  101. package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/OrDateTimePickerDaySelect.vue +162 -0
  102. package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/styles.ts +31 -0
  103. package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-month-select/OrDateTimePickerMonthSelect.vue +101 -79
  104. package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-time-select/OrDateTimePickerTimeSelect.vue +58 -42
  105. package/src/components/or-date-time-picker-v3/styles.ts +5 -2
  106. package/src/components/or-menu-v3/OrMenu.vue +3 -0
  107. package/dist/bundled/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/styles.d.ts +0 -1
  108. package/dist/bundled/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/styles.d.ts +0 -1
  109. package/dist/esm/v2/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/styles.d.ts +0 -1
  110. package/dist/esm/v3/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/styles.d.ts +0 -1
  111. package/src/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/OrDateTimePickerDateSelect.vue +0 -63
  112. 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 { openBlock, createElementBlock, normalizeClass, resolveComponent, createVNode, withCtx, createTextVNode, toDisplayString, createElementVNode, renderSlot, withModifiers, Fragment, renderList, createBlock, resolveDirective, createCommentVNode, withDirectives, mergeProps, pushScopeId, popScopeId } from 'vue';
3
- import { s as styleInject } from './style-inject.es-4c6f2515.js';
4
- import { s as script$f, I as InputBoxSize } from './OrInputBox-901887a1.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,21 +6,59 @@ import { u as useValidationAttributes } from './useValidationAttributes-d1abbe34
9
6
  import { s as script$d } from './OrError-c01d0c29.js';
10
7
  import { s as script$e } from './OrHint-06ab89d7.js';
11
8
  import { s as script$a } from './OrIconButton-e3f4d060.js';
12
- import { s as script$7 } from './OrLabel-4da56db0.js';
9
+ import { s as script$f, I as InputBoxSize } from './OrInputBox-901887a1.js';
10
+ import { s as script$8 } from './OrLabel-4da56db0.js';
13
11
  import { s as script$g } from './OrPopover-3ac8f589.js';
14
- import { s as script$8 } from './OrButton-5a850657.js';
12
+ import { s as script$7 } from './OrButton-5a850657.js';
13
+ import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, createBlock, withModifiers, withCtx, createTextVNode, toDisplayString, createVNode, renderSlot, resolveDirective, createCommentVNode, withDirectives, mergeProps, pushScopeId, popScopeId } from 'vue';
15
14
  import { s as script$9 } from './OrIcon-62793572.js';
16
15
  import { s as script$c } from './OrMenuItem-dbee450f.js';
17
- import { s as script$b } from './OrMenu-053a9ab7.js';
16
+ import { s as script$b } from './OrMenu-70cee836.js';
17
+ import { s as styleInject } from './style-inject.es-4c6f2515.js';
18
18
 
19
- const DateTimePickerDateSelect = [
19
+ function useDefaultDate() {
20
+ return new Date().getUTCDate();
21
+ }
22
+
23
+ function useDefaultHours() {
24
+ return 0;
25
+ }
26
+
27
+ function useDefaultMinutes() {
28
+ return 0;
29
+ }
30
+
31
+ function useDefaultMonth() {
32
+ return new Date().getUTCMonth();
33
+ }
34
+
35
+ function useDefaultYear() {
36
+ return new Date().getUTCFullYear();
37
+ }
38
+
39
+ const DateTimePickerDaySelect = [
20
40
  // Layout
21
41
  'layout-column',
22
42
  // Spacing
23
43
  'px-md', 'py-md', 'gap-sm'];
44
+ const DateTimePickerDaySelectButtonGroup = [
45
+ // Layout
46
+ 'grid', 'grid-cols-7',
47
+ // Spacing
48
+ 'gap-xs'];
49
+ const DateTimePickerDaySelectButtonGroupItem = [
50
+ // Box
51
+ 'min-w-fit',
52
+ // Spacing
53
+ '!px-sm', '!py-sm',
54
+ // Typography
55
+ 'typography-caption-regular'];
24
56
 
25
57
  var script$6 = defineComponent({
26
- name: 'OrDateTimePickerDateSelect',
58
+ name: 'OrDateTimePickerDaySelect',
59
+ components: {
60
+ OrButton: script$7
61
+ },
27
62
  model: {
28
63
  prop: 'modelValue',
29
64
  event: 'update:modelValue'
@@ -40,31 +75,77 @@ var script$6 = defineComponent({
40
75
  // Refs
41
76
  const root = ref();
42
77
  // Styles
43
- const rootStyles = computed(() => ['or-date-time-picker-date-select', ...DateTimePickerDateSelect]);
78
+ const rootStyles = computed(() => ['or-date-time-picker-day-select', ...DateTimePickerDaySelect]);
79
+ const buttonGroupStyles = computed(() => [...DateTimePickerDaySelectButtonGroup]);
80
+ const buttonGroupItemStyles = computed(() => [...DateTimePickerDaySelectButtonGroupItem]);
44
81
  // State
45
82
  const proxyModelValue = computed({
46
- get: () => props.modelValue,
83
+ get: () => {
84
+ var _a;
85
+ return (_a = props.modelValue) !== null && _a !== void 0 ? _a : new Date(Date.UTC(useDefaultYear(), useDefaultMonth(), useDefaultDate(), useDefaultHours(), useDefaultMinutes()));
86
+ },
47
87
  set: value => {
48
88
  context.emit('update:modelValue', value);
49
89
  }
50
90
  });
91
+ const dayOptions = computed(() => {
92
+ const monthStartDate = new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth(), 1, proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
93
+ const monthEndDate = new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth() + 1, 0, proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
94
+ const calendarStartDate = new Date(Date.UTC(monthStartDate.getUTCFullYear(), monthStartDate.getUTCMonth(), 1 - (monthStartDate.getUTCDay() + 6) % 7, monthStartDate.getUTCHours(), monthStartDate.getUTCMinutes()));
95
+ const calendarEndDate = new Date(Date.UTC(monthEndDate.getUTCFullYear(), monthEndDate.getUTCMonth() + 1, (7 - monthEndDate.getUTCDay()) % 7, monthEndDate.getUTCHours(), monthEndDate.getUTCMinutes()));
96
+ return (() => {
97
+ let options = [],
98
+ value = calendarStartDate;
99
+ while (Number(value) !== Number(calendarEndDate)) {
100
+ options = [...options, value];
101
+ value = new Date(Date.UTC(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate() + 1, value.getUTCHours(), value.getUTCMinutes()));
102
+ }
103
+ return options;
104
+ })();
105
+ });
106
+ // Methods
107
+ function formatDay(value) {
108
+ return value.toLocaleString('default', {
109
+ day: 'numeric',
110
+ timeZone: 'UTC'
111
+ });
112
+ }
51
113
  return {
52
114
  root,
53
115
  rootStyles,
54
- proxyModelValue
116
+ buttonGroupStyles,
117
+ buttonGroupItemStyles,
118
+ proxyModelValue,
119
+ dayOptions,
120
+ formatDay
55
121
  };
56
122
  }
57
123
  });
58
124
 
59
125
  function render$6(_ctx, _cache, $props, $setup, $data, $options) {
126
+ const _component_OrButton = resolveComponent("OrButton");
60
127
  return openBlock(), createElementBlock("div", {
61
128
  ref: "root",
62
129
  class: normalizeClass(_ctx.rootStyles)
63
- }, " Calendar ", 2 /* CLASS */);
130
+ }, [createElementVNode("div", {
131
+ class: normalizeClass(_ctx.buttonGroupStyles)
132
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dayOptions, value => {
133
+ return openBlock(), createBlock(_component_OrButton, {
134
+ key: Number(value),
135
+ class: normalizeClass(_ctx.buttonGroupItemStyles),
136
+ variant: Number(value) === Number(_ctx.proxyModelValue) ? 'contained' : 'text',
137
+ color: Number(value) === Number(_ctx.proxyModelValue) ? 'primary' : 'inherit',
138
+ onClick: withModifiers($event => _ctx.proxyModelValue = value, ["stop"])
139
+ }, {
140
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.formatDay(value)), 1 /* TEXT */)]),
141
+
142
+ _: 2 /* DYNAMIC */
143
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class", "variant", "color", "onClick"]);
144
+ }), 128 /* KEYED_FRAGMENT */))], 2 /* CLASS */)], 2 /* CLASS */);
64
145
  }
65
146
 
66
147
  script$6.render = render$6;
67
- script$6.__file = "src/components/or-date-time-picker-v3/partials/or-date-time-picker-date-select/OrDateTimePickerDateSelect.vue";
148
+ script$6.__file = "src/components/or-date-time-picker-v3/partials/or-date-time-picker-day-select/OrDateTimePickerDaySelect.vue";
68
149
 
69
150
  const DateTimePickerMobileControl = [
70
151
  // Layout
@@ -80,7 +161,7 @@ const DateTimePickerMobileControlContent = [
80
161
  var script$5 = defineComponent({
81
162
  name: 'OrDateTimePickerMobileControl',
82
163
  components: {
83
- OrLabel: script$7
164
+ OrLabel: script$8
84
165
  },
85
166
  props: {
86
167
  label: {
@@ -129,7 +210,7 @@ const DateTimePickerMonthSelect = [
129
210
  var script$4 = defineComponent({
130
211
  name: 'OrDateTimePickerMonthSelect',
131
212
  components: {
132
- OrButton: script$8,
213
+ OrButton: script$7,
133
214
  OrIcon: script$9,
134
215
  OrIconButton: script$a,
135
216
  OrMenu: script$b,
@@ -150,107 +231,99 @@ var script$4 = defineComponent({
150
231
  setup(props, context) {
151
232
  // Refs
152
233
  const root = ref();
153
- const monthButton = ref();
154
234
  const yearButton = ref();
235
+ const monthButton = ref();
236
+ const yearButtonRoot = computed(() => {
237
+ var _a;
238
+ return (_a = yearButton.value) === null || _a === void 0 ? void 0 : _a.root;
239
+ });
155
240
  const monthButtonRoot = computed(() => {
156
241
  var _a;
157
242
  return (_a = monthButton.value) === null || _a === void 0 ? void 0 : _a.root;
158
243
  });
159
- const yearButtonRoot = computed(() => {
244
+ const yearMenu = ref();
245
+ const monthMenu = ref();
246
+ const yearMenuState = computed(() => {
160
247
  var _a;
161
- return (_a = yearButton.value) === null || _a === void 0 ? void 0 : _a.root;
248
+ return (_a = yearMenu.value) === null || _a === void 0 ? void 0 : _a.state;
249
+ });
250
+ const monthMenuState = computed(() => {
251
+ var _a;
252
+ return (_a = monthMenu.value) === null || _a === void 0 ? void 0 : _a.state;
162
253
  });
163
- const monthMenu = ref();
164
- const yearMenu = ref();
165
- // const monthMenuState = computed(() => monthMenu.value?.state);
166
- // const yearMenuState = computed(() => yearMenu.value?.state);
167
254
  // Styles
168
255
  const rootStyles = computed(() => ['or-date-time-picker-month-select', ...DateTimePickerMonthSelect]);
169
256
  // State
170
257
  const proxyModelValue = computed({
171
- get: () => props.modelValue,
172
- set: value => {
173
- context.emit('update:modelValue', value);
174
- }
175
- });
176
- const yearValue = computed({
177
- get: () => {
178
- var _a, _b;
179
- return (_b = (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.getUTCFullYear()) !== null && _b !== void 0 ? _b : new Date().getUTCFullYear();
180
- },
181
- set: value => {
182
- var _a, _b, _c, _d, _e, _f, _g, _h;
183
- 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));
184
- }
185
- });
186
- const monthValue = computed({
187
258
  get: () => {
188
- var _a, _b;
189
- return (_b = (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.getUTCMonth()) !== null && _b !== void 0 ? _b : new Date().getUTCMonth();
259
+ var _a;
260
+ return (_a = props.modelValue) !== null && _a !== void 0 ? _a : new Date(Date.UTC(useDefaultYear(), useDefaultMonth(), useDefaultDate(), useDefaultHours(), useDefaultMinutes()));
190
261
  },
191
262
  set: value => {
192
- var _a, _b, _c, _d, _e, _f, _g, _h;
193
- proxyModelValue.value = new Date(Date.UTC((_b = (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.getUTCFullYear()) !== null && _b !== void 0 ? _b : yearValue.value, 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));
263
+ context.emit('update:modelValue', value);
194
264
  }
195
265
  });
196
- const yearLabel = computed(() => {
197
- var _a;
198
- return (_a = yearOptions.find(({
199
- value
200
- }) => value === yearValue.value)) === null || _a === void 0 ? void 0 : _a.label;
266
+ const yearOptions = computed(() => {
267
+ return Array.from({
268
+ length: 11
269
+ }).map((_value, index, {
270
+ length
271
+ }) => {
272
+ const value = proxyModelValue.value.getUTCFullYear() - Math.floor(length / 2) + index;
273
+ return new Date(Date.UTC(value, proxyModelValue.value.getUTCMonth(), proxyModelValue.value.getUTCDate(), proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
274
+ });
201
275
  });
202
- const monthLabel = computed(() => {
203
- var _a;
204
- return (_a = monthOptions.find(({
205
- value
206
- }) => value === monthValue.value)) === null || _a === void 0 ? void 0 : _a.label;
207
- });
208
- const yearOptions = Array.from({
209
- length: 100
210
- }, (_value, index) => {
211
- const year = new Date().getUTCFullYear() - index;
212
- return {
213
- value: year,
214
- label: new Date(year, monthValue.value).toLocaleString([], {
215
- year: 'numeric'
216
- })
217
- };
218
- });
219
- const monthOptions = Array.from({
220
- length: 12
221
- }, (_value, index) => {
222
- const month = index;
223
- return {
224
- value: month,
225
- label: new Date(yearValue.value, month).toLocaleString([], {
226
- month: 'long'
227
- })
228
- };
276
+ const monthOptions = computed(() => {
277
+ return Array.from({
278
+ length: 12
279
+ }, (_value, index) => {
280
+ const value = index;
281
+ return new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), value, proxyModelValue.value.getUTCDate(), proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
282
+ });
229
283
  });
284
+ // Methods
285
+ function goToNextMonth() {
286
+ proxyModelValue.value = new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth() + 1, proxyModelValue.value.getUTCDate(), proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
287
+ }
288
+ function goToPreviousMonth() {
289
+ proxyModelValue.value = new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth() - 1, proxyModelValue.value.getUTCDate(), proxyModelValue.value.getUTCHours(), proxyModelValue.value.getUTCMinutes()));
290
+ }
291
+ function formatYear(value) {
292
+ return value.toLocaleString('default', {
293
+ year: 'numeric',
294
+ timeZone: 'UTC'
295
+ });
296
+ }
297
+ function formatMonth(value) {
298
+ return value.toLocaleString('default', {
299
+ month: 'long',
300
+ timeZone: 'UTC'
301
+ });
302
+ }
230
303
  return {
231
304
  root,
232
- monthButton,
233
305
  yearButton,
234
- monthButtonRoot,
306
+ monthButton,
235
307
  yearButtonRoot,
236
- monthMenu,
308
+ monthButtonRoot,
237
309
  yearMenu,
238
- // monthMenuState,
239
- // yearMenuState,
310
+ monthMenu,
311
+ yearMenuState,
312
+ monthMenuState,
240
313
  rootStyles,
241
314
  proxyModelValue,
242
- yearValue,
243
- monthValue,
244
- yearLabel,
245
- monthLabel,
246
315
  yearOptions,
247
- monthOptions
316
+ monthOptions,
317
+ goToNextMonth,
318
+ goToPreviousMonth,
319
+ formatYear,
320
+ formatMonth
248
321
  };
249
322
  }
250
323
  });
251
324
 
252
325
  const _hoisted_1$1 = {
253
- class: /*#__PURE__*/normalizeClass(['layout-row', 'gap-md'])
326
+ class: /*#__PURE__*/normalizeClass(['layout-row-reverse', 'gap-md'])
254
327
  };
255
328
  function render$4(_ctx, _cache, $props, $setup, $data, $options) {
256
329
  const _component_OrIconButton = resolveComponent("OrIconButton");
@@ -263,68 +336,70 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
263
336
  class: normalizeClass(_ctx.rootStyles)
264
337
  }, [createVNode(_component_OrIconButton, {
265
338
  icon: 'chevron_left',
266
- onClick: _cache[0] || (_cache[0] = withModifiers($event => _ctx.monthValue = _ctx.monthValue - 1, ["stop"]))
339
+ onClick: _cache[0] || (_cache[0] = withModifiers($event => _ctx.goToPreviousMonth(), ["stop"]))
267
340
  }), createElementVNode("div", _hoisted_1$1, [createVNode(_component_OrButton, {
268
- ref: "monthButton",
341
+ ref: "yearButton",
269
342
  variant: 'link',
270
343
  color: 'inherit',
271
- onClick: _cache[1] || (_cache[1] = withModifiers($event => _ctx.monthMenu.open(), ["stop"]))
344
+ onClick: _cache[1] || (_cache[1] = withModifiers($event => _ctx.yearMenu.open(), ["stop"]))
272
345
  }, {
273
- default: withCtx(() => [createTextVNode(toDisplayString(_ctx.monthLabel) + " ", 1 /* TEXT */), createVNode(_component_OrIcon, {
274
- icon: 'arrow_drop_down'
275
- })]),
346
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.formatYear(_ctx.proxyModelValue)) + " ", 1 /* TEXT */), createVNode(_component_OrIcon, {
347
+ icon: _ctx.yearMenuState === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
348
+ }, null, 8 /* PROPS */, ["icon"])]),
276
349
  _: 1 /* STABLE */
277
350
  }, 512 /* NEED_PATCH */), createVNode(_component_OrButton, {
278
- ref: "yearButton",
351
+ ref: "monthButton",
279
352
  variant: 'link',
280
353
  color: 'inherit',
281
- onClick: _cache[2] || (_cache[2] = withModifiers($event => _ctx.yearMenu.open(), ["stop"]))
354
+ onClick: _cache[2] || (_cache[2] = withModifiers($event => _ctx.monthMenu.open(), ["stop"]))
282
355
  }, {
283
- default: withCtx(() => [createTextVNode(toDisplayString(_ctx.yearLabel) + " ", 1 /* TEXT */), createVNode(_component_OrIcon, {
284
- icon: 'arrow_drop_down'
285
- })]),
356
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.formatMonth(_ctx.proxyModelValue)) + " ", 1 /* TEXT */), createVNode(_component_OrIcon, {
357
+ icon: _ctx.monthMenuState === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
358
+ }, null, 8 /* PROPS */, ["icon"])]),
286
359
  _: 1 /* STABLE */
287
360
  }, 512 /* NEED_PATCH */), createVNode(_component_OrMenu, {
288
- ref: "monthMenu",
289
- trigger: _ctx.monthButtonRoot
361
+ ref: "yearMenu",
362
+ trigger: _ctx.yearButtonRoot
290
363
  }, {
291
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.monthOptions, option => {
364
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.yearOptions, value => {
292
365
  return openBlock(), createBlock(_component_OrMenuItem, {
293
- key: option.value,
366
+ key: Number(value),
367
+ selected: Number(value) === Number(_ctx.proxyModelValue),
294
368
  onClick: withModifiers($event => {
295
- _ctx.monthValue = option.value;
296
- _ctx.monthMenu.close();
369
+ _ctx.proxyModelValue = value;
370
+ _ctx.yearMenu.close();
297
371
  }, ["stop"])
298
372
  }, {
299
- default: withCtx(() => [createTextVNode(toDisplayString(option.label), 1 /* TEXT */)]),
373
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.formatYear(value)), 1 /* TEXT */)]),
300
374
 
301
375
  _: 2 /* DYNAMIC */
302
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"]);
376
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["selected", "onClick"]);
303
377
  }), 128 /* KEYED_FRAGMENT */))]),
304
378
 
305
379
  _: 1 /* STABLE */
306
380
  }, 8 /* PROPS */, ["trigger"]), createVNode(_component_OrMenu, {
307
- ref: "yearMenu",
308
- trigger: _ctx.yearButtonRoot
381
+ ref: "monthMenu",
382
+ trigger: _ctx.monthButtonRoot
309
383
  }, {
310
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.yearOptions, option => {
384
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.monthOptions, value => {
311
385
  return openBlock(), createBlock(_component_OrMenuItem, {
312
- key: option.value,
386
+ key: Number(value),
387
+ selected: Number(value) === Number(_ctx.proxyModelValue),
313
388
  onClick: withModifiers($event => {
314
- _ctx.yearValue = option.value;
315
- _ctx.yearMenu.close();
389
+ _ctx.proxyModelValue = value;
390
+ _ctx.monthMenu.close();
316
391
  }, ["stop"])
317
392
  }, {
318
- default: withCtx(() => [createTextVNode(toDisplayString(option.label), 1 /* TEXT */)]),
393
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.formatMonth(value)), 1 /* TEXT */)]),
319
394
 
320
395
  _: 2 /* DYNAMIC */
321
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"]);
396
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["selected", "onClick"]);
322
397
  }), 128 /* KEYED_FRAGMENT */))]),
323
398
 
324
399
  _: 1 /* STABLE */
325
400
  }, 8 /* PROPS */, ["trigger"])]), createVNode(_component_OrIconButton, {
326
401
  icon: 'chevron_right',
327
- onClick: _cache[3] || (_cache[3] = withModifiers($event => _ctx.monthValue = _ctx.monthValue + 1, ["stop"]))
402
+ onClick: _cache[3] || (_cache[3] = withModifiers($event => _ctx.goToNextMonth(), ["stop"]))
328
403
  })], 2 /* CLASS */);
329
404
  }
330
405
 
@@ -342,7 +417,7 @@ const DateTimePickerPopoverFooter = [
342
417
  var script$3 = defineComponent({
343
418
  name: 'OrDateTimePickerPopoverFooter',
344
419
  components: {
345
- OrButton: script$8
420
+ OrButton: script$7
346
421
  },
347
422
  emits: ['resolve', 'reject'],
348
423
  expose: ['root'],
@@ -435,7 +510,7 @@ const DateTimePickerTimeSelectButtonGroupItem = [
435
510
  var script$1 = defineComponent({
436
511
  name: 'OrDateTimePickerTimeSelect',
437
512
  components: {
438
- OrButton: script$8
513
+ OrButton: script$7
439
514
  },
440
515
  model: {
441
516
  prop: 'modelValue',
@@ -458,53 +533,53 @@ var script$1 = defineComponent({
458
533
  const buttonGroupItemStyles = computed(() => [...DateTimePickerTimeSelectButtonGroupItem]);
459
534
  // State
460
535
  const proxyModelValue = computed({
461
- get: () => props.modelValue,
462
- set: value => {
463
- context.emit('update:modelValue', value);
464
- }
465
- });
466
- const hoursValue = computed({
467
536
  get: () => {
468
- var _a, _b;
469
- return (_b = (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.getUTCHours()) !== null && _b !== void 0 ? _b : 0;
537
+ var _a;
538
+ return (_a = props.modelValue) !== null && _a !== void 0 ? _a : new Date(Date.UTC(useDefaultYear(), useDefaultMonth(), useDefaultDate(), useDefaultHours(), useDefaultMinutes()));
470
539
  },
471
540
  set: value => {
472
- var _a, _b, _c, _d, _e, _f, _g, _h;
473
- 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));
541
+ context.emit('update:modelValue', value);
474
542
  }
475
543
  });
476
- const minutesValue = computed({
477
- get: () => {
478
- var _a, _b;
479
- return (_b = (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.getUTCMinutes()) !== null && _b !== void 0 ? _b : 0;
480
- },
481
- set: value => {
482
- var _a, _b, _c, _d, _e, _f, _g, _h;
483
- 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, (_h = (_g = proxyModelValue.value) === null || _g === void 0 ? void 0 : _g.getUTCHours()) !== null && _h !== void 0 ? _h : hoursValue.value, value));
484
- }
544
+ const hoursOptions = computed(() => {
545
+ return Array.from({
546
+ length: 24
547
+ }, (_value, index) => {
548
+ const value = index;
549
+ return new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth(), proxyModelValue.value.getUTCDate(), value, proxyModelValue.value.getUTCMinutes()));
550
+ });
551
+ });
552
+ const minutesOptions = computed(() => {
553
+ return Array.from({
554
+ length: 60
555
+ }, (_value, index) => {
556
+ const value = index;
557
+ return new Date(Date.UTC(proxyModelValue.value.getUTCFullYear(), proxyModelValue.value.getUTCMonth(), proxyModelValue.value.getUTCDate(), proxyModelValue.value.getUTCHours(), value));
558
+ });
485
559
  });
486
- const hoursOptions = Array.from({
487
- length: 24
488
- }, (_value, index) => ({
489
- value: index,
490
- label: String(index).padStart(2, '0')
491
- }));
492
- const minutesOptions = Array.from({
493
- length: 60
494
- }, (_value, index) => ({
495
- value: index,
496
- label: String(index).padStart(2, '0')
497
- }));
560
+ // Methods
561
+ function formatHours(value) {
562
+ return value.toLocaleString('default', {
563
+ hour: '2-digit',
564
+ timeZone: 'UTC'
565
+ });
566
+ }
567
+ function formatMinutes(value) {
568
+ return value.toLocaleString('default', {
569
+ minute: '2-digit',
570
+ timeZone: 'UTC'
571
+ });
572
+ }
498
573
  return {
499
574
  root,
500
575
  rootStyles,
501
576
  buttonGroupStyles,
502
577
  buttonGroupItemStyles,
503
578
  proxyModelValue,
504
- hoursValue,
505
- minutesValue,
506
579
  hoursOptions,
507
- minutesOptions
580
+ minutesOptions,
581
+ formatHours,
582
+ formatMinutes
508
583
  };
509
584
  }
510
585
  });
@@ -516,29 +591,29 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
516
591
  class: normalizeClass(_ctx.rootStyles)
517
592
  }, [createElementVNode("div", {
518
593
  class: normalizeClass(_ctx.buttonGroupStyles)
519
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.hoursOptions, option => {
594
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.hoursOptions, value => {
520
595
  return openBlock(), createBlock(_component_OrButton, {
521
- key: option.value,
596
+ key: Number(value),
522
597
  class: normalizeClass(_ctx.buttonGroupItemStyles),
523
- variant: _ctx.hoursValue === option.value ? 'contained' : 'text',
524
- color: _ctx.hoursValue === option.value ? 'primary' : 'inherit',
525
- onClick: withModifiers($event => _ctx.hoursValue = option.value, ["stop"])
598
+ variant: Number(value) === Number(_ctx.proxyModelValue) ? 'contained' : 'text',
599
+ color: Number(value) === Number(_ctx.proxyModelValue) ? 'primary' : 'inherit',
600
+ onClick: withModifiers($event => _ctx.proxyModelValue = value, ["stop"])
526
601
  }, {
527
- default: withCtx(() => [createTextVNode(toDisplayString(option.label), 1 /* TEXT */)]),
602
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.formatHours(value)), 1 /* TEXT */)]),
528
603
 
529
604
  _: 2 /* DYNAMIC */
530
605
  }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class", "variant", "color", "onClick"]);
531
606
  }), 128 /* KEYED_FRAGMENT */))], 2 /* CLASS */), createTextVNode(" : "), createElementVNode("div", {
532
607
  class: normalizeClass(_ctx.buttonGroupStyles)
533
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.minutesOptions, option => {
608
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.minutesOptions, value => {
534
609
  return openBlock(), createBlock(_component_OrButton, {
535
- key: option.value,
610
+ key: Number(value),
536
611
  class: normalizeClass(_ctx.buttonGroupItemStyles),
537
- variant: _ctx.minutesValue === option.value ? 'contained' : 'text',
538
- color: _ctx.minutesValue === option.value ? 'primary' : 'inherit',
539
- onClick: withModifiers($event => _ctx.minutesValue = option.value, ["stop"])
612
+ variant: Number(value) === Number(_ctx.proxyModelValue) ? 'contained' : 'text',
613
+ color: Number(value) === Number(_ctx.proxyModelValue) ? 'primary' : 'inherit',
614
+ onClick: withModifiers($event => _ctx.proxyModelValue = value, ["stop"])
540
615
  }, {
541
- default: withCtx(() => [createTextVNode(toDisplayString(option.label), 1 /* TEXT */)]),
616
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.formatMinutes(value)), 1 /* TEXT */)]),
542
617
 
543
618
  _: 2 /* DYNAMIC */
544
619
  }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class", "variant", "color", "onClick"]);
@@ -554,13 +629,15 @@ const DateTimePicker = [
554
629
  // Spacing
555
630
  'gap-xs'];
556
631
  const DateTimePickerControl = [
632
+ // Layout
633
+ 'layout-inline-row justify-center',
557
634
  // Theme (focus)
558
- 'focus:theme-border-1-current', 'dark:focus:theme-border-1-current-dark', 'focus:theme-border-underline', 'dark:focus:theme-border-underline'];
635
+ 'focus:theme-border-2-current', 'dark:focus:theme-border-2-current-dark', 'focus:theme-border-underline', 'dark:focus:theme-border-underline'];
559
636
 
560
637
  var script = defineComponent({
561
638
  name: 'OrDateTimePicker',
562
639
  components: {
563
- OrDateTimePickerDateSelect: script$6,
640
+ OrDateTimePickerDaySelect: script$6,
564
641
  OrDateTimePickerMobileControl: script$5,
565
642
  OrDateTimePickerMonthSelect: script$4,
566
643
  OrDateTimePickerPopoverFooter: script$3,
@@ -570,7 +647,7 @@ var script = defineComponent({
570
647
  OrHint: script$e,
571
648
  OrIconButton: script$a,
572
649
  OrInputBox: script$f,
573
- OrLabel: script$7,
650
+ OrLabel: script$8,
574
651
  OrPopover: script$g
575
652
  },
576
653
  directives: {
@@ -651,6 +728,12 @@ var script = defineComponent({
651
728
  context.emit('update:modelValue', value);
652
729
  }
653
730
  });
731
+ const draftModelValue = ref();
732
+ watch(proxyModelValue, value => {
733
+ draftModelValue.value = value;
734
+ }, {
735
+ immediate: true
736
+ });
654
737
  // Methods
655
738
  function toggleDatePopover() {
656
739
  if (!props.readonly && !props.disabled) {
@@ -688,6 +771,34 @@ var script = defineComponent({
688
771
  popoverInstance.close();
689
772
  }
690
773
  }
774
+ function formatDate(value) {
775
+ var _a;
776
+ return (_a = value === null || value === void 0 ? void 0 : value.toLocaleString('default', {
777
+ dateStyle: 'short',
778
+ timeZone: 'UTC'
779
+ })) !== null && _a !== void 0 ? _a : '--';
780
+ }
781
+ function formatTime(value) {
782
+ var _a;
783
+ return (_a = value === null || value === void 0 ? void 0 : value.toLocaleString('default', {
784
+ timeStyle: 'short',
785
+ timeZone: 'UTC'
786
+ })) !== null && _a !== void 0 ? _a : '--';
787
+ }
788
+ function formatDateAlt(value) {
789
+ var _a;
790
+ return (_a = value === null || value === void 0 ? void 0 : value.toLocaleString('default', {
791
+ dateStyle: 'medium',
792
+ timeZone: 'UTC'
793
+ })) !== null && _a !== void 0 ? _a : '--';
794
+ }
795
+ function formatTimeAlt(value) {
796
+ var _a;
797
+ return (_a = value === null || value === void 0 ? void 0 : value.toLocaleString('default', {
798
+ timeStyle: 'short',
799
+ timeZone: 'UTC'
800
+ })) !== null && _a !== void 0 ? _a : '--';
801
+ }
691
802
  return {
692
803
  root,
693
804
  dateControl,
@@ -700,10 +811,15 @@ var script = defineComponent({
700
811
  controlStyles,
701
812
  controlAttributes,
702
813
  proxyModelValue,
814
+ draftModelValue,
703
815
  toggleDatePopover,
704
816
  toggleTimePopover,
705
817
  closeDatePopover,
706
- closeTimePopover
818
+ closeTimePopover,
819
+ formatDate,
820
+ formatTime,
821
+ formatDateAlt,
822
+ formatTimeAlt
707
823
  };
708
824
  }
709
825
  });
@@ -722,7 +838,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
722
838
  const _component_OrDateTimePickerMobileControl = resolveComponent("OrDateTimePickerMobileControl");
723
839
  const _component_OrDateTimePickerPopoverHeader = resolveComponent("OrDateTimePickerPopoverHeader");
724
840
  const _component_OrDateTimePickerMonthSelect = resolveComponent("OrDateTimePickerMonthSelect");
725
- const _component_OrDateTimePickerDateSelect = resolveComponent("OrDateTimePickerDateSelect");
841
+ const _component_OrDateTimePickerDaySelect = resolveComponent("OrDateTimePickerDaySelect");
726
842
  const _component_OrDateTimePickerPopoverFooter = resolveComponent("OrDateTimePickerPopoverFooter");
727
843
  const _component_OrPopover = resolveComponent("OrPopover");
728
844
  const _component_OrDateTimePickerTimeSelect = resolveComponent("OrDateTimePickerTimeSelect");
@@ -753,23 +869,23 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
753
869
  readonly: _ctx.readonly,
754
870
  disabled: _ctx.disabled
755
871
  }, {
756
- default: withCtx(() => [withDirectives(createElementVNode("input", mergeProps({
872
+ default: withCtx(() => [createCommentVNode(" <input\n ref=\"dateControl\"\n v-dropdown-open=\"toggleDatePopover\"\n v-dropdown-close=\"closeDatePopover\"\n v-bind=\"controlAttributes\"\n :class=\"controlStyles\"\n :type=\"'text'\"\n :value=\"formatDate(proxyModelValue)\"\n :required=\"required\"\n :readonly=\"readonly\"\n :disabled=\"disabled\"\n > "), createCommentVNode(" <input\n ref=\"timeControl\"\n v-dropdown-open=\"toggleTimePopover\"\n v-dropdown-close=\"closeTimePopover\"\n v-bind=\"controlAttributes\"\n :class=\"controlStyles\"\n :type=\"'text'\"\n :value=\"formatTime(proxyModelValue)\"\n :required=\"required\"\n :readonly=\"readonly\"\n :disabled=\"disabled\"\n > "), withDirectives((openBlock(), createElementBlock("div", mergeProps({
757
873
  ref: "dateControl"
758
874
  }, _ctx.controlAttributes, {
759
875
  class: _ctx.controlStyles,
760
- type: 'date',
876
+ contenteditable: true,
761
877
  required: _ctx.required,
762
878
  readonly: _ctx.readonly,
763
879
  disabled: _ctx.disabled
764
- }), null, 16 /* FULL_PROPS */, _hoisted_1), [[_directive_dropdown_open, _ctx.toggleDatePopover], [_directive_dropdown_close, _ctx.closeDatePopover]]), withDirectives(createElementVNode("input", mergeProps({
880
+ }), [createTextVNode(toDisplayString(_ctx.formatDate(_ctx.proxyModelValue)), 1 /* TEXT */)], 16 /* FULL_PROPS */, _hoisted_1)), [[_directive_dropdown_open, _ctx.toggleDatePopover], [_directive_dropdown_close, _ctx.closeDatePopover]]), withDirectives((openBlock(), createElementBlock("div", mergeProps({
765
881
  ref: "timeControl"
766
882
  }, _ctx.controlAttributes, {
767
883
  class: _ctx.controlStyles,
768
- type: 'time',
884
+ contenteditable: true,
769
885
  required: _ctx.required,
770
886
  readonly: _ctx.readonly,
771
887
  disabled: _ctx.disabled
772
- }), null, 16 /* FULL_PROPS */, _hoisted_2), [[_directive_dropdown_open, _ctx.toggleTimePopover], [_directive_dropdown_close, _ctx.closeTimePopover]]), createVNode(_component_OrPopover, {
888
+ }), [createTextVNode(toDisplayString(_ctx.formatTime(_ctx.proxyModelValue)), 1 /* TEXT */)], 16 /* FULL_PROPS */, _hoisted_2)), [[_directive_dropdown_open, _ctx.toggleTimePopover], [_directive_dropdown_close, _ctx.closeTimePopover]]), createVNode(_component_OrPopover, {
773
889
  ref: "datePopover",
774
890
  variant: 'auto',
775
891
  trigger: _ctx.dateControl,
@@ -779,24 +895,33 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
779
895
  default: withCtx(() => [createVNode(_component_OrDateTimePickerMobileControl, {
780
896
  label: "Date"
781
897
  }, {
782
- default: withCtx(() => [createTextVNode(" Sep 12 ")]),
898
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.formatDateAlt(_ctx.draftModelValue)), 1 /* TEXT */)]),
899
+
783
900
  _: 1 /* STABLE */
784
901
  }), createVNode(_component_OrDateTimePickerMobileControl, {
785
902
  label: "Time"
786
903
  }, {
787
- default: withCtx(() => [createTextVNode(" 9:07 ")]),
904
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.formatTimeAlt(_ctx.draftModelValue)), 1 /* TEXT */)]),
905
+
788
906
  _: 1 /* STABLE */
789
907
  })]),
790
908
 
791
909
  _: 1 /* STABLE */
792
910
  }), createVNode(_component_OrDateTimePickerMonthSelect, {
793
- modelValue: _ctx.proxyModelValue,
794
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.proxyModelValue = $event)
795
- }, null, 8 /* PROPS */, ["modelValue"]), createVNode(_component_OrDateTimePickerDateSelect, {
796
- modelValue: _ctx.proxyModelValue,
797
- "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => _ctx.proxyModelValue = $event)
911
+ modelValue: _ctx.draftModelValue,
912
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.draftModelValue = $event)
913
+ }, null, 8 /* PROPS */, ["modelValue"]), createVNode(_component_OrDateTimePickerDaySelect, {
914
+ modelValue: _ctx.draftModelValue,
915
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => _ctx.draftModelValue = $event)
798
916
  }, null, 8 /* PROPS */, ["modelValue"]), createVNode(_component_OrDateTimePickerPopoverFooter, {
799
- onReject: _cache[2] || (_cache[2] = $event => _ctx.closeDatePopover())
917
+ onResolve: _cache[2] || (_cache[2] = $event => {
918
+ _ctx.proxyModelValue = _ctx.draftModelValue;
919
+ _ctx.datePopover.close();
920
+ }),
921
+ onReject: _cache[3] || (_cache[3] = $event => {
922
+ _ctx.draftModelValue = _ctx.proxyModelValue;
923
+ _ctx.datePopover.close();
924
+ })
800
925
  })]),
801
926
  _: 1 /* STABLE */
802
927
  }, 8 /* PROPS */, ["trigger"]), createVNode(_component_OrPopover, {
@@ -809,21 +934,30 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
809
934
  default: withCtx(() => [createVNode(_component_OrDateTimePickerMobileControl, {
810
935
  label: "Date"
811
936
  }, {
812
- default: withCtx(() => [createTextVNode(" Sep 12 ")]),
937
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.formatDateAlt(_ctx.draftModelValue)), 1 /* TEXT */)]),
938
+
813
939
  _: 1 /* STABLE */
814
940
  }), createVNode(_component_OrDateTimePickerMobileControl, {
815
941
  label: "Time"
816
942
  }, {
817
- default: withCtx(() => [createTextVNode(" 9:07 ")]),
943
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.formatTimeAlt(_ctx.draftModelValue)), 1 /* TEXT */)]),
944
+
818
945
  _: 1 /* STABLE */
819
946
  })]),
820
947
 
821
948
  _: 1 /* STABLE */
822
949
  }), createVNode(_component_OrDateTimePickerTimeSelect, {
823
- modelValue: _ctx.proxyModelValue,
824
- "onUpdate:modelValue": _cache[3] || (_cache[3] = $event => _ctx.proxyModelValue = $event)
950
+ modelValue: _ctx.draftModelValue,
951
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = $event => _ctx.draftModelValue = $event)
825
952
  }, null, 8 /* PROPS */, ["modelValue"]), createVNode(_component_OrDateTimePickerPopoverFooter, {
826
- onReject: _cache[4] || (_cache[4] = $event => _ctx.closeTimePopover())
953
+ onResolve: _cache[5] || (_cache[5] = $event => {
954
+ _ctx.proxyModelValue = _ctx.draftModelValue;
955
+ _ctx.timePopover.close();
956
+ }),
957
+ onReject: _cache[6] || (_cache[6] = $event => {
958
+ _ctx.draftModelValue = _ctx.proxyModelValue;
959
+ _ctx.timePopover.close();
960
+ })
827
961
  })]),
828
962
  _: 1 /* STABLE */
829
963
  }, 8 /* PROPS */, ["trigger"]), _hoisted_3, createElementVNode("div", _hoisted_4, [_ctx.modelValue ? (openBlock(), createBlock(_component_OrIconButton, {
@@ -831,7 +965,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
831
965
  icon: 'close',
832
966
  color: 'inherit',
833
967
  disabled: _ctx.readonly || _ctx.disabled,
834
- onClick: _cache[5] || (_cache[5] = withModifiers($event => _ctx.$emit('update:modelValue', undefined), ["stop"]))
968
+ onClick: _cache[7] || (_cache[7] = withModifiers($event => _ctx.$emit('update:modelValue', undefined), ["stop"]))
835
969
  }, null, 8 /* PROPS */, ["disabled"])) : createCommentVNode("v-if", true)])]),
836
970
  _: 1 /* STABLE */
837
971
  }, 8 /* PROPS */, ["variant", "size", "invalid", "readonly", "disabled"])), [[_directive_dropdown_open, _ctx.toggleDatePopover], [_directive_dropdown_close, _ctx.closeDatePopover]]), !_ctx.error ? (openBlock(), createElementBlock(Fragment, {
@@ -853,7 +987,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
853
987
  }, 8 /* PROPS */, ["disabled"])) : createCommentVNode("v-if", true)], 2 /* CLASS */);
854
988
  }
855
989
 
856
- var css_248z = "\ninput[data-v-4ab76bac] {\n min-width: 0;\n background: none;\n outline: none;\n}\ninput[type=\"date\"][data-v-4ab76bac]::-webkit-datetime-edit-day-field,\ninput[type=\"date\"][data-v-4ab76bac]::-webkit-datetime-edit-month-field,\ninput[type=\"date\"][data-v-4ab76bac]::-webkit-datetime-edit-year-field {\n display: none;\n}\ninput[type=\"time\"][data-v-4ab76bac]::-webkit-datetime-edit-hour-field,\ninput[type=\"time\"][data-v-4ab76bac]::-webkit-datetime-edit-minute-field,\ninput[type=\"time\"][data-v-4ab76bac]::-webkit-datetime-edit-ampm-field {\n display: none;\n}\ninput[type=\"date\"][data-v-4ab76bac]::-webkit-datetime-edit-text,\ninput[type=\"time\"][data-v-4ab76bac]::-webkit-datetime-edit-text {\n display: none;\n}\ninput[type=\"date\"][data-v-4ab76bac]::-webkit-calendar-picker-indicator,\ninput[type=\"time\"][data-v-4ab76bac]::-webkit-calendar-picker-indicator {\n display: none;\n}\n";
990
+ var css_248z = "\ninput[data-v-4ab76bac] {\n min-width: 0;\n background: none;\n outline: none;\n}\n";
857
991
  styleInject(css_248z);
858
992
 
859
993
  script.render = render;