@opentinyvue/vue-date-panel 2.22.0 → 3.22.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.
@@ -10,36 +10,40 @@ import Input from '@opentinyvue/vue-input';
10
10
  import Button from '@opentinyvue/vue-button';
11
11
  import { IconDoubleRight, IconDoubleLeft, IconChevronLeft, IconChevronRight, IconChevronDown, IconChevronUp } from '@opentinyvue/vue-icon';
12
12
  import Popup from '@opentinyvue/vue-popup';
13
+ import { resolveComponent, resolveDirective, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, renderSlot, createElementBlock, Fragment, renderList, toDisplayString, createCommentVNode, createVNode, vShow, resolveDynamicComponent, createTextVNode } from 'vue';
13
14
 
14
- function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
15
- var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
16
- if (render) {
17
- options.render = render;
18
- options.staticRenderFns = staticRenderFns;
19
- options._compiled = true;
15
+ function _createForOfIteratorHelperLoose(r, e) {
16
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
17
+ if (t) return (t = t.call(r)).next.bind(t);
18
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
19
+ t && (r = t);
20
+ var o = 0;
21
+ return function() {
22
+ return o >= r.length ? { done: true } : { done: false, value: r[o++] };
23
+ };
20
24
  }
21
- var hook;
22
- if (injectStyles) {
23
- hook = injectStyles;
24
- }
25
- if (hook) {
26
- if (options.functional) {
27
- options._injectStyles = hook;
28
- var originalRender = options.render;
29
- options.render = function renderWithStyleInjection(h, context) {
30
- hook.call(context);
31
- return originalRender(h, context);
32
- };
33
- } else {
34
- var existing = options.beforeCreate;
35
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
36
- }
25
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
26
+ }
27
+ function _unsupportedIterableToArray(r, a) {
28
+ if (r) {
29
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
30
+ var t = {}.toString.call(r).slice(8, -1);
31
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
37
32
  }
38
- return {
39
- exports: scriptExports,
40
- options
41
- };
42
33
  }
34
+ function _arrayLikeToArray(r, a) {
35
+ (null == a || a > r.length) && (a = r.length);
36
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
37
+ return n;
38
+ }
39
+ var _export_sfc = function _export_sfc2(sfc, props) {
40
+ var target = sfc.__vccOpts || sfc;
41
+ for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) {
42
+ var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
43
+ target[key] = val;
44
+ }
45
+ return target;
46
+ };
43
47
 
44
48
  function _extends() {
45
49
  return _extends = Object.assign ? Object.assign.bind() : function(n) {
@@ -68,385 +72,7 @@ var classes = {
68
72
  "sidebar": "absolute top-0 bottom-0 w-28 border-r border-r-color-bg-3 box-border pt-5 bg-color-bg-1 overflow-auto",
69
73
  "sidebar-btn": "block w-24 my-0 mx-auto rounded border-0 bg-transparent leading-8 text-xs text-color-text-primary pl-4 text-left outline-0 cursor-pointer truncate hover:bg-color-bg-2"
70
74
  };
71
- var render = function render2() {
72
- var _vm$state$shortcuts, _vm$state$shortcuts2;
73
- var _vm = this;
74
- var _h = _vm.$createElement;
75
- var _c = _vm._self._c || _h;
76
- return _c("transition", {
77
- on: {
78
- "after-enter": _vm.handleEnter,
79
- "after-leave": _vm.handleLeave
80
- }
81
- }, [_c("div", {
82
- directives: [{
83
- name: "show",
84
- rawName: "v-show",
85
- value: _vm.state.visible,
86
- expression: "state.visible"
87
- }],
88
- class: _vm.m([_vm.gcls("picker-panel"), {
89
- "w-80": _vm.state.currentView === "year"
90
- }, _vm.state.popperClass]),
91
- attrs: {
92
- "data-tag": "tiny-picker-panel tiny-date-picker tiny-popper"
93
- }
94
- }, [_c("div", {
95
- class: _vm.gcls("picker-panel-body"),
96
- attrs: {
97
- "data-tag": "tiny-picker-panel__body-wrapper"
98
- }
99
- }, [_vm._t("sidebar", null, {
100
- "dataTag": "tiny-picker-panel__sidebar"
101
- }), (_vm$state$shortcuts = _vm.state.shortcuts) !== null && _vm$state$shortcuts !== void 0 && _vm$state$shortcuts.length ? _c("div", {
102
- class: _vm.gcls("sidebar"),
103
- attrs: {
104
- "data-tag": "tiny-picker-panel__sidebar"
105
- }
106
- }, _vm._l(_vm.state.shortcuts, function(shortcut, key) {
107
- return _c("button", {
108
- key,
109
- class: _vm.gcls("sidebar-btn"),
110
- attrs: {
111
- "type": "button",
112
- "data-tag": "tiny-picker-panel__shortcut"
113
- },
114
- on: {
115
- "click": function click($event) {
116
- return _vm.handleShortcutClick(shortcut);
117
- }
118
- }
119
- }, [_vm._v(" " + _vm._s(shortcut.text) + " ")]);
120
- }), 0) : _vm._e(), _c("div", {
121
- class: [_vm.gcls("picker-panel-body"), {
122
- "ml-28": _vm.slots.sidebar || ((_vm$state$shortcuts2 = _vm.state.shortcuts) === null || _vm$state$shortcuts2 === void 0 ? void 0 : _vm$state$shortcuts2.length)
123
- }],
124
- attrs: {
125
- "data-tag": "tiny-picker-panel__body"
126
- }
127
- }, [_vm.state.showTime ? _c("div", {
128
- class: _vm.gcls("time-header"),
129
- attrs: {
130
- "data-tag": "tiny-date-picker__time-header"
131
- }
132
- }, [_c("span", {
133
- class: _vm.gcls("editor-wrap"),
134
- attrs: {
135
- "data-tag": "tiny-date-picker__editor-wrap"
136
- }
137
- }, [_c("tiny-input", {
138
- attrs: {
139
- "placeholder": _vm.t("ui.datepicker.selectDate"),
140
- "modelValue": _vm.state.visibleDate,
141
- "size": "small"
142
- },
143
- on: {
144
- "update:modelValue": function updateModelValue(val) {
145
- return _vm.state.userInputDate = val;
146
- },
147
- "change": _vm.handleVisibleDateChange
148
- }
149
- })], 1), _c("span", {
150
- directives: [{
151
- name: "clickoutside",
152
- rawName: "v-clickoutside",
153
- value: _vm.handleTimePickClose,
154
- expression: "handleTimePickClose"
155
- }],
156
- class: _vm.gcls("editor-wrap"),
157
- attrs: {
158
- "data-tag": "tiny-date-picker__editor-wrap"
159
- }
160
- }, [_c("tiny-input", {
161
- ref: "input",
162
- attrs: {
163
- "placeholder": _vm.t("ui.datepicker.selectTime"),
164
- "modelValue": _vm.state.visibleTime,
165
- "size": "small"
166
- },
167
- on: {
168
- "focus": function focus($event) {
169
- _vm.state.timePickerVisible = true;
170
- },
171
- "update:modelValue": function updateModelValue(val) {
172
- return _vm.state.userInputTime = val;
173
- },
174
- "change": _vm.handleVisibleTimeChange
175
- }
176
- }), _c("time-picker", {
177
- ref: "timepicker",
178
- attrs: {
179
- "step": _vm.step,
180
- "time-arrow-control": _vm.state.arrowControl,
181
- "show": _vm.state.timePickerVisible,
182
- "value": _vm.state.date
183
- },
184
- on: {
185
- "pick": _vm.handleTimePick
186
- }
187
- })], 1)]) : _vm._e(), _c("div", {
188
- directives: [{
189
- name: "show",
190
- rawName: "v-show",
191
- value: _vm.state.currentView !== "time",
192
- expression: "state.currentView !== 'time'"
193
- }],
194
- class: [_vm.gcls("header"), ["month", "year", "years", "yearrange"].includes(_vm.state.currentView) && _vm.gcls("bordered")],
195
- attrs: {
196
- "data-tag": "tiny-date-picker__header"
197
- }
198
- }, [_c("button", {
199
- class: [_vm.gcls("icon-btn"), "float-left"],
200
- attrs: {
201
- "type": "button",
202
- "aria-label": _vm.t("ui.datepicker.prevYear"),
203
- "data-tag": "tiny-picker-panel__icon-btn tiny-date-picker__prev-btn tiny-icon-arrow-left"
204
- },
205
- on: {
206
- "click": _vm.cusPrevYear
207
- }
208
- }, [_c("icon-double-left")], 1), _c("button", {
209
- directives: [{
210
- name: "show",
211
- rawName: "v-show",
212
- value: _vm.state.currentView === "date",
213
- expression: "state.currentView === 'date'"
214
- }],
215
- class: [_vm.gcls("icon-btn"), "float-left"],
216
- attrs: {
217
- "type": "button",
218
- "aria-label": _vm.t("ui.datepicker.prevMonth"),
219
- "data-tag": "tiny-picker-panel__icon-btn tiny-date-picker__prev-btn tiny-icon-arrow-left"
220
- },
221
- on: {
222
- "click": _vm.cusPrevMonth
223
- }
224
- }, [_c("icon-chevron-left")], 1), _c("span", {
225
- class: [_vm.gcls("header-label")],
226
- attrs: {
227
- "role": "button",
228
- "data-tag": "tiny-date-picker__header-label"
229
- },
230
- on: {
231
- "click": function click($event) {
232
- return _vm.showHeaderPicker("Year");
233
- }
234
- }
235
- }, [_vm._v(_vm._s(_vm.state.yearLabel))]), _c("span", {
236
- directives: [{
237
- name: "show",
238
- rawName: "v-show",
239
- value: _vm.state.currentView === "date",
240
- expression: "state.currentView === 'date'"
241
- }],
242
- class: [_vm.gcls("header-label"), {
243
- "text-color-brand": _vm.state.currentView === "month"
244
- }],
245
- attrs: {
246
- "role": "button",
247
- "data-tag": "tiny-date-picker__header-label"
248
- },
249
- on: {
250
- "click": function click($event) {
251
- return _vm.showHeaderPicker("Month");
252
- }
253
- }
254
- }, [_vm._v(_vm._s(_vm.t("ui.datepicker.month" + (_vm.state.month + 1))))]), _c("button", {
255
- class: [_vm.gcls("icon-btn"), "float-right"],
256
- attrs: {
257
- "type": "button",
258
- "aria-label": _vm.t("ui.datepicker.nextYear"),
259
- "data-tag": "tiny-picker-panel__icon-btn tiny-date-picker__next-btn tiny-icon-arrow-right"
260
- },
261
- on: {
262
- "click": _vm.cusNextYear
263
- }
264
- }, [_c("icon-double-right")], 1), _c("button", {
265
- directives: [{
266
- name: "show",
267
- rawName: "v-show",
268
- value: _vm.state.currentView === "date",
269
- expression: "state.currentView === 'date'"
270
- }],
271
- class: [_vm.gcls("icon-btn"), "float-right"],
272
- attrs: {
273
- "type": "button",
274
- "aria-label": _vm.t("ui.datepicker.nextMonth"),
275
- "data-tag": "tiny-picker-panel__icon-btn tiny-date-picker__next-btn tiny-icon-arrow-right"
276
- },
277
- on: {
278
- "click": _vm.cusNextMonth
279
- }
280
- }, [_c("icon-chevron-right")], 1)]), _c("div", {
281
- class: _vm.gcls("content"),
282
- attrs: {
283
- "data-tag": "tiny-picker-panel__content"
284
- }
285
- }, [_vm.state.currentView === "date" ? _c("date-table", {
286
- ref: "dateTable",
287
- attrs: {
288
- "selection-mode": _vm.state.selectionMode,
289
- "first-day-of-week": _vm.state.firstDayOfWeek,
290
- "value": _vm.state.value,
291
- "default-value": _vm.state.defaultValue ? new Date(_vm.state.defaultValue) : null,
292
- "date": _vm.state.date,
293
- "cell-class-name": _vm.state.cellClassName,
294
- "disabled-date": _vm.state.disabledDate,
295
- "show-week-number": _vm.showWeekNumber,
296
- "format-weeks": _vm.formatWeeks
297
- },
298
- on: {
299
- "pick": _vm.handleDatePick
300
- }
301
- }) : _vm._e(), ["year", "years", "yearrange"].includes(_vm.state.currentView) ? _c("year-table", {
302
- ref: "yearTable",
303
- attrs: {
304
- "value": _vm.state.value,
305
- "default-value": _vm.state.defaultValue ? new Date(_vm.state.defaultValue) : null,
306
- "date": _vm.state.date,
307
- "disabled-date": _vm.state.disabledDate,
308
- "selection-mode": _vm.state.selectionMode,
309
- "start-year": _vm.state.startYear
310
- },
311
- on: {
312
- "pick": _vm.handleYearPick
313
- }
314
- }) : _vm._e(), _vm.state.currentView === "month" ? _c("month-table", {
315
- ref: "monthTable",
316
- attrs: {
317
- "value": _vm.state.value,
318
- "default-value": _vm.state.defaultValue ? new Date(_vm.state.defaultValue) : null,
319
- "date": _vm.state.date,
320
- "disabled-date": _vm.state.disabledDate
321
- },
322
- on: {
323
- "pick": _vm.handleMonthPick
324
- }
325
- }) : _vm._e()], 1)])], 2), _vm.state.isShowTz || _vm.state.timezone.isServiceTimezone ? _c("div", {
326
- directives: [{
327
- name: "clickoutside",
328
- rawName: "v-clickoutside",
329
- value: _vm.handleTzPickClose,
330
- expression: "handleTzPickClose"
331
- }],
332
- attrs: {
333
- "data-tag": "tiny-picker-panel__timezone"
334
- }
335
- }, [_c("tiny-input", {
336
- attrs: {
337
- "disabled": _vm.state.timezone.isServiceTimezone,
338
- "placeholder": _vm.t("ui.datepicker.timezone")
339
- },
340
- on: {
341
- "update:modelValue": _vm.searchTz
342
- },
343
- scopedSlots: _vm._u([{
344
- key: "suffix",
345
- fn: function fn() {
346
- return [_c(_vm.state.showpopup ? "IconChevronDown" : "IconChevronUp", {
347
- tag: "component",
348
- attrs: {
349
- "fill": "#ccc"
350
- },
351
- on: {
352
- "click": _vm.toggleTz
353
- }
354
- })];
355
- },
356
- proxy: true
357
- }], null, false, 3034754380),
358
- model: {
359
- value: _vm.state.tz,
360
- callback: function callback($$v) {
361
- _vm.$set(_vm.state, "tz", $$v);
362
- },
363
- expression: "state.tz"
364
- }
365
- }), _c("div", {
366
- attrs: {
367
- "data-tag": "tiny-picker-panel__tzlist"
368
- }
369
- }, [_c("tiny-popup", {
370
- attrs: {
371
- "overlay": false,
372
- "aui_mode": "mobile",
373
- "position": "bottom",
374
- "duration": 0.2,
375
- "closeable": false
376
- },
377
- model: {
378
- value: _vm.state.showpopup,
379
- callback: function callback($$v) {
380
- _vm.$set(_vm.state, "showpopup", $$v);
381
- },
382
- expression: "state.showpopup"
383
- }
384
- }, [_c("div", {
385
- attrs: {
386
- "data-tag": "tzlist"
387
- }
388
- }, [_c("ul", _vm._l(_vm.state.renderTzdata, function(tz, index) {
389
- return _c("li", {
390
- directives: [{
391
- name: "show",
392
- rawName: "v-show",
393
- value: !tz.visible,
394
- expression: "!tz.visible"
395
- }],
396
- key: index,
397
- attrs: {
398
- "data-tag": "tiny-picker-panel__tzlist-li",
399
- "title": tz.name
400
- },
401
- on: {
402
- "click": function click($event) {
403
- return _vm.selectTz(tz);
404
- }
405
- }
406
- }, [_vm._v(" " + _vm._s(tz.name) + " ")]);
407
- }), 0)])])], 1)], 1) : _vm._e(), _c("div", {
408
- directives: [{
409
- name: "show",
410
- rawName: "v-show",
411
- value: _vm.state.isShowFooter,
412
- expression: "state.isShowFooter"
413
- }],
414
- class: _vm.gcls("footer"),
415
- attrs: {
416
- "data-tag": "tiny-picker-panel__footer"
417
- }
418
- }, [_vm._t("default", function() {
419
- return [_c("tiny-button", {
420
- directives: [{
421
- name: "show",
422
- rawName: "v-show",
423
- value: !["dates", "years"].includes(_vm.state.selectionMode),
424
- expression: "!['dates', 'years'].includes(state.selectionMode)"
425
- }],
426
- class: _vm.gcls("link-btn"),
427
- attrs: {
428
- "size": "mini",
429
- "type": "text",
430
- "data-tag": "tiny-picker-panel__link-btn"
431
- },
432
- on: {
433
- "click": _vm.changeToNow
434
- }
435
- }, [_vm._v(" " + _vm._s(_vm.t("ui.datepicker.now")) + " ")])];
436
- }), _c("tiny-button", {
437
- class: ["float-right", _vm.gcls("link-btn")],
438
- attrs: {
439
- "type": "primary",
440
- "size": "mini",
441
- "data-tag": "tiny-picker-panel__link-btn"
442
- },
443
- on: {
444
- "click": _vm.confirm
445
- }
446
- }, [_vm._v(" " + _vm._s(_vm.t("ui.datepicker.confirm")) + " ")])], 2)])]);
447
- };
448
- var staticRenderFns = [];
449
- var __vue2_script = {
75
+ var _sfc_main = {
450
76
  directives: directive({
451
77
  Clickoutside
452
78
  }),
@@ -500,15 +126,362 @@ var __vue2_script = {
500
126
  });
501
127
  }
502
128
  };
503
- var __cssModules = {};
504
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
505
- function __vue2_injectStyles(context) {
506
- for (var o in __cssModules) {
507
- this[o] = __cssModules[o];
508
- }
129
+ var _hoisted_1 = ["onClick"];
130
+ var _hoisted_2 = ["aria-label"];
131
+ var _hoisted_3 = ["aria-label"];
132
+ var _hoisted_4 = ["aria-label"];
133
+ var _hoisted_5 = ["aria-label"];
134
+ var _hoisted_6 = {
135
+ key: 0,
136
+ "data-tag": "tiny-picker-panel__timezone"
137
+ };
138
+ var _hoisted_7 = {
139
+ "data-tag": "tiny-picker-panel__tzlist"
140
+ };
141
+ var _hoisted_8 = {
142
+ "data-tag": "tzlist"
143
+ };
144
+ var _hoisted_9 = ["title", "onClick"];
145
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
146
+ var _component_tiny_input = resolveComponent("tiny-input");
147
+ var _component_time_picker = resolveComponent("time-picker");
148
+ var _component_icon_double_left = resolveComponent("icon-double-left");
149
+ var _component_icon_chevron_left = resolveComponent("icon-chevron-left");
150
+ var _component_icon_double_right = resolveComponent("icon-double-right");
151
+ var _component_icon_chevron_right = resolveComponent("icon-chevron-right");
152
+ var _component_date_table = resolveComponent("date-table");
153
+ var _component_year_table = resolveComponent("year-table");
154
+ var _component_month_table = resolveComponent("month-table");
155
+ var _component_tiny_popup = resolveComponent("tiny-popup");
156
+ var _component_tiny_button = resolveComponent("tiny-button");
157
+ var _directive_clickoutside = resolveDirective("clickoutside");
158
+ return openBlock(), createBlock(Transition, {
159
+ onAfterEnter: _ctx.handleEnter,
160
+ onAfterLeave: _ctx.handleLeave,
161
+ persisted: ""
162
+ }, {
163
+ default: withCtx(function() {
164
+ var _ctx$state$shortcuts, _ctx$state$shortcuts2;
165
+ return [withDirectives(createElementVNode(
166
+ "div",
167
+ {
168
+ "data-tag": "tiny-picker-panel tiny-date-picker tiny-popper",
169
+ class: normalizeClass(_ctx.m([_ctx.gcls("picker-panel"), {
170
+ "w-80": _ctx.state.currentView === "year"
171
+ }, _ctx.state.popperClass]))
172
+ },
173
+ [createElementVNode(
174
+ "div",
175
+ {
176
+ "data-tag": "tiny-picker-panel__body-wrapper",
177
+ class: normalizeClass(_ctx.gcls("picker-panel-body"))
178
+ },
179
+ [renderSlot(_ctx.$slots, "sidebar", {
180
+ dataTag: "tiny-picker-panel__sidebar",
181
+ class: normalizeClass(_ctx.gcls("sidebar"))
182
+ }), (_ctx$state$shortcuts = _ctx.state.shortcuts) != null && _ctx$state$shortcuts.length ? (openBlock(), createElementBlock(
183
+ "div",
184
+ {
185
+ key: 0,
186
+ "data-tag": "tiny-picker-panel__sidebar",
187
+ class: normalizeClass(_ctx.gcls("sidebar"))
188
+ },
189
+ [(openBlock(true), createElementBlock(
190
+ Fragment,
191
+ null,
192
+ renderList(_ctx.state.shortcuts, function(shortcut, key) {
193
+ return openBlock(), createElementBlock("button", {
194
+ type: "button",
195
+ "data-tag": "tiny-picker-panel__shortcut",
196
+ class: normalizeClass(_ctx.gcls("sidebar-btn")),
197
+ key,
198
+ onClick: function onClick($event) {
199
+ return _ctx.handleShortcutClick(shortcut);
200
+ }
201
+ }, toDisplayString(shortcut.text), 11, _hoisted_1);
202
+ }),
203
+ 128
204
+ /* KEYED_FRAGMENT */
205
+ ))],
206
+ 2
207
+ /* CLASS */
208
+ )) : createCommentVNode("v-if", true), createElementVNode(
209
+ "div",
210
+ {
211
+ "data-tag": "tiny-picker-panel__body",
212
+ class: normalizeClass([_ctx.gcls("picker-panel-body"), {
213
+ "ml-28": _ctx.slots.sidebar || ((_ctx$state$shortcuts2 = _ctx.state.shortcuts) == null ? void 0 : _ctx$state$shortcuts2.length)
214
+ }])
215
+ },
216
+ [_ctx.state.showTime ? (openBlock(), createElementBlock(
217
+ "div",
218
+ {
219
+ key: 0,
220
+ "data-tag": "tiny-date-picker__time-header",
221
+ class: normalizeClass(_ctx.gcls("time-header"))
222
+ },
223
+ [createElementVNode(
224
+ "span",
225
+ {
226
+ "data-tag": "tiny-date-picker__editor-wrap",
227
+ class: normalizeClass(_ctx.gcls("editor-wrap"))
228
+ },
229
+ [createVNode(_component_tiny_input, {
230
+ placeholder: _ctx.t("ui.datepicker.selectDate"),
231
+ modelValue: _ctx.state.visibleDate,
232
+ size: "small",
233
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = function(val) {
234
+ return _ctx.state.userInputDate = val;
235
+ }),
236
+ onChange: _ctx.handleVisibleDateChange
237
+ }, null, 8, ["placeholder", "modelValue", "onChange"])],
238
+ 2
239
+ /* CLASS */
240
+ ), withDirectives((openBlock(), createElementBlock(
241
+ "span",
242
+ {
243
+ "data-tag": "tiny-date-picker__editor-wrap",
244
+ class: normalizeClass(_ctx.gcls("editor-wrap"))
245
+ },
246
+ [createVNode(_component_tiny_input, {
247
+ ref: "input",
248
+ onFocus: _cache[1] || (_cache[1] = function($event) {
249
+ return _ctx.state.timePickerVisible = true;
250
+ }),
251
+ placeholder: _ctx.t("ui.datepicker.selectTime"),
252
+ modelValue: _ctx.state.visibleTime,
253
+ size: "small",
254
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = function(val) {
255
+ return _ctx.state.userInputTime = val;
256
+ }),
257
+ onChange: _ctx.handleVisibleTimeChange
258
+ }, null, 8, ["placeholder", "modelValue", "onChange"]), createVNode(_component_time_picker, {
259
+ ref: "timepicker",
260
+ step: $props.step,
261
+ "time-arrow-control": _ctx.state.arrowControl,
262
+ show: _ctx.state.timePickerVisible,
263
+ value: _ctx.state.date,
264
+ onPick: _ctx.handleTimePick
265
+ }, null, 8, ["step", "time-arrow-control", "show", "value", "onPick"])],
266
+ 2
267
+ /* CLASS */
268
+ )), [[_directive_clickoutside, _ctx.handleTimePickClose]])],
269
+ 2
270
+ /* CLASS */
271
+ )) : createCommentVNode("v-if", true), withDirectives(createElementVNode(
272
+ "div",
273
+ {
274
+ "data-tag": "tiny-date-picker__header",
275
+ class: normalizeClass([_ctx.gcls("header"), ["month", "year", "years", "yearrange"].includes(_ctx.state.currentView) && _ctx.gcls("bordered")])
276
+ },
277
+ [createElementVNode("button", {
278
+ type: "button",
279
+ onClick: _cache[3] || (_cache[3] = function() {
280
+ return _ctx.cusPrevYear && _ctx.cusPrevYear.apply(_ctx, arguments);
281
+ }),
282
+ "aria-label": _ctx.t("ui.datepicker.prevYear"),
283
+ "data-tag": "tiny-picker-panel__icon-btn tiny-date-picker__prev-btn tiny-icon-arrow-left",
284
+ class: normalizeClass([_ctx.gcls("icon-btn"), "float-left"])
285
+ }, [createVNode(_component_icon_double_left)], 10, _hoisted_2), withDirectives(createElementVNode("button", {
286
+ type: "button",
287
+ onClick: _cache[4] || (_cache[4] = function() {
288
+ return _ctx.cusPrevMonth && _ctx.cusPrevMonth.apply(_ctx, arguments);
289
+ }),
290
+ "aria-label": _ctx.t("ui.datepicker.prevMonth"),
291
+ "data-tag": "tiny-picker-panel__icon-btn tiny-date-picker__prev-btn tiny-icon-arrow-left",
292
+ class: normalizeClass([_ctx.gcls("icon-btn"), "float-left"])
293
+ }, [createVNode(_component_icon_chevron_left)], 10, _hoisted_3), [[vShow, _ctx.state.currentView === "date"]]), createElementVNode(
294
+ "span",
295
+ {
296
+ role: "button",
297
+ onClick: _cache[5] || (_cache[5] = function($event) {
298
+ return _ctx.showHeaderPicker("Year");
299
+ }),
300
+ "data-tag": "tiny-date-picker__header-label",
301
+ class: normalizeClass([_ctx.gcls("header-label")])
302
+ },
303
+ toDisplayString(_ctx.state.yearLabel),
304
+ 3
305
+ /* TEXT, CLASS */
306
+ ), withDirectives(createElementVNode(
307
+ "span",
308
+ {
309
+ role: "button",
310
+ onClick: _cache[6] || (_cache[6] = function($event) {
311
+ return _ctx.showHeaderPicker("Month");
312
+ }),
313
+ "data-tag": "tiny-date-picker__header-label",
314
+ class: normalizeClass([_ctx.gcls("header-label"), {
315
+ "text-color-brand": _ctx.state.currentView === "month"
316
+ }])
317
+ },
318
+ toDisplayString(_ctx.t("ui.datepicker.month" + (_ctx.state.month + 1))),
319
+ 3
320
+ /* TEXT, CLASS */
321
+ ), [[vShow, _ctx.state.currentView === "date"]]), createElementVNode("button", {
322
+ type: "button",
323
+ onClick: _cache[7] || (_cache[7] = function() {
324
+ return _ctx.cusNextYear && _ctx.cusNextYear.apply(_ctx, arguments);
325
+ }),
326
+ "aria-label": _ctx.t("ui.datepicker.nextYear"),
327
+ "data-tag": "tiny-picker-panel__icon-btn tiny-date-picker__next-btn tiny-icon-arrow-right",
328
+ class: normalizeClass([_ctx.gcls("icon-btn"), "float-right"])
329
+ }, [createVNode(_component_icon_double_right)], 10, _hoisted_4), withDirectives(createElementVNode("button", {
330
+ type: "button",
331
+ onClick: _cache[8] || (_cache[8] = function() {
332
+ return _ctx.cusNextMonth && _ctx.cusNextMonth.apply(_ctx, arguments);
333
+ }),
334
+ "aria-label": _ctx.t("ui.datepicker.nextMonth"),
335
+ "data-tag": "tiny-picker-panel__icon-btn tiny-date-picker__next-btn tiny-icon-arrow-right",
336
+ class: normalizeClass([_ctx.gcls("icon-btn"), "float-right"])
337
+ }, [createVNode(_component_icon_chevron_right)], 10, _hoisted_5), [[vShow, _ctx.state.currentView === "date"]])],
338
+ 2
339
+ /* CLASS */
340
+ ), [[vShow, _ctx.state.currentView !== "time"]]), createElementVNode(
341
+ "div",
342
+ {
343
+ "data-tag": "tiny-picker-panel__content",
344
+ class: normalizeClass(_ctx.gcls("content"))
345
+ },
346
+ [_ctx.state.currentView === "date" ? (openBlock(), createBlock(_component_date_table, {
347
+ key: 0,
348
+ ref: "dateTable",
349
+ onPick: _ctx.handleDatePick,
350
+ "selection-mode": _ctx.state.selectionMode,
351
+ "first-day-of-week": _ctx.state.firstDayOfWeek,
352
+ value: _ctx.state.value,
353
+ "default-value": _ctx.state.defaultValue ? new Date(_ctx.state.defaultValue) : null,
354
+ date: _ctx.state.date,
355
+ "cell-class-name": _ctx.state.cellClassName,
356
+ "disabled-date": _ctx.state.disabledDate,
357
+ "show-week-number": $props.showWeekNumber,
358
+ "format-weeks": $props.formatWeeks
359
+ }, null, 8, ["onPick", "selection-mode", "first-day-of-week", "value", "default-value", "date", "cell-class-name", "disabled-date", "show-week-number", "format-weeks"])) : createCommentVNode("v-if", true), ["year", "years", "yearrange"].includes(_ctx.state.currentView) ? (openBlock(), createBlock(_component_year_table, {
360
+ key: 1,
361
+ ref: "yearTable",
362
+ value: _ctx.state.value,
363
+ "default-value": _ctx.state.defaultValue ? new Date(_ctx.state.defaultValue) : null,
364
+ date: _ctx.state.date,
365
+ "disabled-date": _ctx.state.disabledDate,
366
+ "selection-mode": _ctx.state.selectionMode,
367
+ "start-year": _ctx.state.startYear,
368
+ onPick: _ctx.handleYearPick
369
+ }, null, 8, ["value", "default-value", "date", "disabled-date", "selection-mode", "start-year", "onPick"])) : createCommentVNode("v-if", true), _ctx.state.currentView === "month" ? (openBlock(), createBlock(_component_month_table, {
370
+ key: 2,
371
+ ref: "monthTable",
372
+ onPick: _ctx.handleMonthPick,
373
+ value: _ctx.state.value,
374
+ "default-value": _ctx.state.defaultValue ? new Date(_ctx.state.defaultValue) : null,
375
+ date: _ctx.state.date,
376
+ "disabled-date": _ctx.state.disabledDate
377
+ }, null, 8, ["onPick", "value", "default-value", "date", "disabled-date"])) : createCommentVNode("v-if", true)],
378
+ 2
379
+ /* CLASS */
380
+ )],
381
+ 2
382
+ /* CLASS */
383
+ )],
384
+ 2
385
+ /* CLASS */
386
+ ), _ctx.state.isShowTz || _ctx.state.timezone.isServiceTimezone ? withDirectives((openBlock(), createElementBlock("div", _hoisted_6, [createVNode(_component_tiny_input, {
387
+ modelValue: _ctx.state.tz,
388
+ "onUpdate:modelValue": [_cache[9] || (_cache[9] = function($event) {
389
+ return _ctx.state.tz = $event;
390
+ }), _ctx.searchTz],
391
+ disabled: _ctx.state.timezone.isServiceTimezone,
392
+ placeholder: _ctx.t("ui.datepicker.timezone")
393
+ }, {
394
+ suffix: withCtx(function() {
395
+ return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.state.showpopup ? "IconChevronDown" : "IconChevronUp"), {
396
+ fill: "#ccc",
397
+ onClick: _ctx.toggleTz
398
+ }, null, 8, ["onClick"]))];
399
+ }),
400
+ _: 1
401
+ /* STABLE */
402
+ }, 8, ["modelValue", "disabled", "onUpdate:modelValue", "placeholder"]), createElementVNode("div", _hoisted_7, [createVNode(_component_tiny_popup, {
403
+ modelValue: _ctx.state.showpopup,
404
+ "onUpdate:modelValue": _cache[10] || (_cache[10] = function($event) {
405
+ return _ctx.state.showpopup = $event;
406
+ }),
407
+ overlay: false,
408
+ aui_mode: "mobile",
409
+ position: "bottom",
410
+ duration: 0.2,
411
+ closeable: false
412
+ }, {
413
+ default: withCtx(function() {
414
+ return [createElementVNode("div", _hoisted_8, [createElementVNode("ul", null, [(openBlock(true), createElementBlock(
415
+ Fragment,
416
+ null,
417
+ renderList(_ctx.state.renderTzdata, function(tz, index) {
418
+ return withDirectives((openBlock(), createElementBlock("li", {
419
+ "data-tag": "tiny-picker-panel__tzlist-li",
420
+ title: tz.name,
421
+ key: index,
422
+ onClick: function onClick($event) {
423
+ return _ctx.selectTz(tz);
424
+ }
425
+ }, toDisplayString(tz.name), 9, _hoisted_9)), [[vShow, !tz.visible]]);
426
+ }),
427
+ 128
428
+ /* KEYED_FRAGMENT */
429
+ ))])])];
430
+ }),
431
+ _: 1
432
+ /* STABLE */
433
+ }, 8, ["modelValue"])])])), [[_directive_clickoutside, _ctx.handleTzPickClose]]) : createCommentVNode("v-if", true), withDirectives(createElementVNode(
434
+ "div",
435
+ {
436
+ "data-tag": "tiny-picker-panel__footer",
437
+ class: normalizeClass(_ctx.gcls("footer"))
438
+ },
439
+ [renderSlot(_ctx.$slots, "default", {}, function() {
440
+ return [withDirectives(createVNode(_component_tiny_button, {
441
+ size: "mini",
442
+ type: "text",
443
+ "data-tag": "tiny-picker-panel__link-btn",
444
+ class: normalizeClass(_ctx.gcls("link-btn")),
445
+ onClick: _ctx.changeToNow
446
+ }, {
447
+ default: withCtx(function() {
448
+ return [createTextVNode(
449
+ toDisplayString(_ctx.t("ui.datepicker.now")),
450
+ 1
451
+ /* TEXT */
452
+ )];
453
+ }),
454
+ _: 1
455
+ /* STABLE */
456
+ }, 8, ["class", "onClick"]), [[vShow, !["dates", "years"].includes(_ctx.state.selectionMode)]])];
457
+ }), createVNode(_component_tiny_button, {
458
+ type: "primary",
459
+ size: "mini",
460
+ "data-tag": "tiny-picker-panel__link-btn",
461
+ class: normalizeClass(["float-right", _ctx.gcls("link-btn")]),
462
+ onClick: _ctx.confirm
463
+ }, {
464
+ default: withCtx(function() {
465
+ return [createTextVNode(
466
+ toDisplayString(_ctx.t("ui.datepicker.confirm")),
467
+ 1
468
+ /* TEXT */
469
+ )];
470
+ }),
471
+ _: 1
472
+ /* STABLE */
473
+ }, 8, ["class", "onClick"])],
474
+ 2
475
+ /* CLASS */
476
+ ), [[vShow, _ctx.state.isShowFooter]])],
477
+ 2
478
+ /* CLASS */
479
+ ), [[vShow, _ctx.state.visible]])];
480
+ }),
481
+ _: 3
482
+ /* FORWARDED */
483
+ }, 8, ["onAfterEnter", "onAfterLeave"]);
509
484
  }
510
- var mobileFirst = /* @__PURE__ */ function() {
511
- return __component__.exports;
512
- }();
485
+ var mobileFirst = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
513
486
 
514
487
  export { mobileFirst as default };