@opentinyvue/vue-date-panel 2.21.0 → 3.21.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/lib/pc.js CHANGED
@@ -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, normalizeStyle, 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) {
@@ -50,7 +54,7 @@ function _extends() {
50
54
  return n;
51
55
  }, _extends.apply(null, arguments);
52
56
  }
53
- var __vue2_script = defineComponent({
57
+ var _sfc_main = defineComponent({
54
58
  name: $prefix + "DatePanel",
55
59
  directives: directive({
56
60
  Clickoutside
@@ -108,348 +112,316 @@ var __vue2_script = defineComponent({
108
112
  });
109
113
  }
110
114
  });
111
- var render = function render2() {
112
- var _vm = this;
113
- var _h = _vm.$createElement;
114
- var _c = _vm._self._c || _h;
115
- return _c("transition", {
116
- attrs: {
117
- "name": "tiny-zoom-in-top"
118
- },
119
- on: {
120
- "after-enter": _vm.handleEnter,
121
- "after-leave": _vm.handleLeave
122
- }
123
- }, [_c("div", {
124
- directives: [{
125
- name: "show",
126
- rawName: "v-show",
127
- value: _vm.state.visible,
128
- expression: "state.visible"
129
- }],
130
- staticClass: "tiny-picker-panel tiny-date-picker tiny-popper",
131
- class: [{
132
- "has-sidebar": _vm.slots.sidebar || _vm.state.shortcuts,
133
- "has-time": _vm.state.showTime
134
- }, _vm.state.popperClass]
135
- }, [_c("div", {
136
- staticClass: "tiny-picker-panel__body-wrapper"
137
- }, [_vm._t("sidebar"), _vm.state.shortcuts ? _c("div", {
138
- staticClass: "tiny-picker-panel__sidebar"
139
- }, _vm._l(_vm.state.shortcuts, function(shortcut, key) {
140
- return _c("button", {
141
- key,
142
- staticClass: "tiny-picker-panel__shortcut",
143
- attrs: {
144
- "type": "button",
145
- "title": shortcut.text
146
- },
147
- on: {
148
- "click": function click($event) {
149
- return _vm.handleShortcutClick(shortcut);
150
- }
151
- }
152
- }, [_vm._v(" " + _vm._s(shortcut.text) + " ")]);
153
- }), 0) : _vm._e(), _c("div", {
154
- staticClass: "tiny-picker-panel__body"
155
- }, [_vm.state.showTime ? _c("div", {
156
- staticClass: "tiny-date-picker__time-header"
157
- }, [_c("span", {
158
- staticClass: "tiny-date-picker__editor-wrap"
159
- }, [_c("tiny-input", {
160
- attrs: {
161
- "placeholder": _vm.t("ui.datepicker.selectDate"),
162
- "model-value": _vm.state.visibleDate,
163
- "size": "small"
164
- },
165
- on: {
166
- "update:modelValue": function updateModelValue(val) {
167
- return _vm.state.userInputDate = val;
168
- },
169
- "change": _vm.handleVisibleDateChange
170
- }
171
- })], 1), _c("span", {
172
- directives: [{
173
- name: "clickoutside",
174
- rawName: "v-clickoutside",
175
- value: _vm.handleTimePickClose,
176
- expression: "handleTimePickClose"
177
- }],
178
- staticClass: "tiny-date-picker__editor-wrap"
179
- }, [_c("tiny-input", {
180
- ref: "input",
181
- attrs: {
182
- "placeholder": _vm.t("ui.datepicker.selectTime"),
183
- "model-value": _vm.state.visibleTime,
184
- "size": "small",
185
- "readonly": !_vm.timeEditable
186
- },
187
- on: {
188
- "focus": function focus($event) {
189
- _vm.state.timePickerVisible = true;
190
- },
191
- "update:modelValue": function updateModelValue(val) {
192
- return _vm.state.userInputTime = val;
193
- },
194
- "change": _vm.handleVisibleTimeChange
195
- }
196
- }), _c("time-picker", {
197
- ref: "timepicker",
198
- attrs: {
199
- "step": _vm.step,
200
- "time-arrow-control": _vm.state.arrowControl,
201
- "show": _vm.state.timePickerVisible,
202
- "value": _vm.state.date
203
- },
204
- on: {
205
- "pick": _vm.handleTimePick
206
- }
207
- })], 1)]) : _vm._e(), _c("div", {
208
- directives: [{
209
- name: "show",
210
- rawName: "v-show",
211
- value: _vm.state.currentView !== "time",
212
- expression: "state.currentView !== 'time'"
213
- }],
214
- staticClass: "tiny-date-picker__header",
215
- class: {
216
- "tiny-date-picker__header--bordered": ["month", "year", "years", "yearrange"].includes(_vm.state.currentView)
217
- }
218
- }, [_c("button", {
219
- staticClass: "tiny-picker-panel__icon-btn tiny-date-picker__prev-btn tiny-icon-d-arrow-left",
220
- attrs: {
221
- "type": "button",
222
- "aria-label": _vm.t("ui.datepicker.prevYear")
223
- },
224
- on: {
225
- "click": _vm.cusPrevYear
226
- }
227
- }, [_c("icon-double-left")], 1), _c("button", {
228
- directives: [{
229
- name: "show",
230
- rawName: "v-show",
231
- value: _vm.state.currentView === "date",
232
- expression: "state.currentView === 'date'"
233
- }],
234
- staticClass: "tiny-picker-panel__icon-btn tiny-date-picker__prev-btn tiny-icon-arrow-left",
235
- attrs: {
236
- "type": "button",
237
- "aria-label": _vm.t("ui.datepicker.prevMonth")
238
- },
239
- on: {
240
- "click": _vm.cusPrevMonth
241
- }
242
- }, [_c("icon-chevron-left")], 1), _c("span", {
243
- staticClass: "tiny-date-picker__header-label",
244
- attrs: {
245
- "role": "button"
246
- },
247
- on: {
248
- "click": _vm.showYearPicker
249
- }
250
- }, [_vm._v(" " + _vm._s(_vm.state.yearLabel) + " ")]), _c("span", {
251
- directives: [{
252
- name: "show",
253
- rawName: "v-show",
254
- value: _vm.state.currentView === "date",
255
- expression: "state.currentView === 'date'"
256
- }],
257
- staticClass: "tiny-date-picker__header-label",
258
- class: {
259
- active: _vm.state.currentView === "month"
260
- },
261
- attrs: {
262
- "role": "button"
263
- },
264
- on: {
265
- "click": _vm.showMonthPicker
266
- }
267
- }, [_vm._v(_vm._s(_vm.t("ui.datepicker.month" + (_vm.state.month + 1))))]), _c("button", {
268
- staticClass: "tiny-picker-panel__icon-btn tiny-date-picker__next-btn tiny-icon-d-arrow-right",
269
- attrs: {
270
- "type": "button",
271
- "aria-label": _vm.t("ui.datepicker.nextYear")
272
- },
273
- on: {
274
- "click": _vm.cusNextYear
275
- }
276
- }, [_c("icon-double-right")], 1), _c("button", {
277
- directives: [{
278
- name: "show",
279
- rawName: "v-show",
280
- value: _vm.state.currentView === "date",
281
- expression: "state.currentView === 'date'"
282
- }],
283
- staticClass: "tiny-picker-panel__icon-btn tiny-date-picker__next-btn tiny-icon-arrow-right",
284
- attrs: {
285
- "type": "button",
286
- "aria-label": _vm.t("ui.datepicker.nextMonth")
287
- },
288
- on: {
289
- "click": _vm.cusNextMonth
290
- }
291
- }, [_c("icon-chevron-right")], 1)]), _c("div", {
292
- staticClass: "tiny-picker-panel__content"
293
- }, [_c("div", {
294
- staticClass: "tiny-picker-panel__table"
295
- }, [_vm.state.currentView === "date" ? _c("date-table", {
296
- ref: "dateTable",
297
- attrs: {
298
- "selection-mode": _vm.state.selectionMode,
299
- "first-day-of-week": _vm.state.firstDayOfWeek,
300
- "value": _vm.state.value,
301
- "default-value": _vm.state.defaultValue ? new Date(_vm.state.defaultValue) : null,
302
- "date": _vm.state.date,
303
- "cell-class-name": _vm.state.cellClassName,
304
- "disabled-date": _vm.state.disabledDate,
305
- "show-week-number": _vm.showWeekNumber,
306
- "format-weeks": _vm.formatWeeks
307
- },
308
- on: {
309
- "pick": _vm.handleDatePick
310
- }
311
- }) : _vm._e(), ["year", "years", "yearrange"].includes(_vm.state.currentView) ? _c("year-table", {
312
- ref: "yearTable",
313
- attrs: {
314
- "value": _vm.state.value,
315
- "default-value": _vm.state.defaultValue ? new Date(_vm.state.defaultValue) : null,
316
- "date": _vm.state.date,
317
- "disabled-date": _vm.state.disabledDate,
318
- "selection-mode": _vm.state.selectionMode,
319
- "start-year": _vm.state.startYear
320
- },
321
- on: {
322
- "pick": _vm.handleYearPick
323
- }
324
- }) : _vm._e(), _vm.state.currentView === "month" ? _c("month-table", {
325
- ref: "monthTable",
326
- attrs: {
327
- "value": _vm.state.value,
328
- "default-value": _vm.state.defaultValue ? new Date(_vm.state.defaultValue) : null,
329
- "date": _vm.state.date,
330
- "disabled-date": _vm.state.disabledDate
331
- },
332
- on: {
333
- "pick": _vm.handleMonthPick
334
- }
335
- }) : _vm._e()], 1)])])], 2), _vm.state.isShowTz || _vm.state.timezone.isServiceTimezone ? _c("div", {
336
- directives: [{
337
- name: "clickoutside",
338
- rawName: "v-clickoutside",
339
- value: _vm.handleTzPickClose,
340
- expression: "handleTzPickClose"
341
- }],
342
- staticClass: "tiny-picker-panel__timezone"
343
- }, [_c("tiny-input", {
344
- attrs: {
345
- "disabled": _vm.state.timezone.isServiceTimezone,
346
- "placeholder": _vm.t("ui.datepicker.timezone")
347
- },
348
- on: {
349
- "update:modelValue": _vm.searchTz
350
- },
351
- scopedSlots: _vm._u([{
352
- key: "suffix",
353
- fn: function fn() {
354
- return [_c(_vm.state.showpopup ? "IconChevronDown" : "IconChevronUp", {
355
- tag: "component",
356
- attrs: {
357
- "fill": "#ccc"
358
- },
359
- on: {
360
- "click": _vm.toggleTz
361
- }
362
- })];
363
- },
364
- proxy: true
365
- }], null, false, 3034754380),
366
- model: {
367
- value: _vm.state.tz,
368
- callback: function callback($$v) {
369
- _vm.$set(_vm.state, "tz", $$v);
370
- },
371
- expression: "state.tz"
372
- }
373
- }), _c("div", {
374
- staticClass: "tiny-picker-panel__tzlist"
375
- }, [_c("tiny-popup", {
376
- attrs: {
377
- "overlay": false,
378
- "position": "up",
379
- "duration": 0.2,
380
- "closeable": false
381
- },
382
- model: {
383
- value: _vm.state.showpopup,
384
- callback: function callback($$v) {
385
- _vm.$set(_vm.state, "showpopup", $$v);
386
- },
387
- expression: "state.showpopup"
388
- }
389
- }, [_c("div", {
390
- staticClass: "tzlist"
391
- }, [_c("ul", _vm._l(_vm.state.renderTzdata, function(tz, index) {
392
- return _c("li", {
393
- directives: [{
394
- name: "show",
395
- rawName: "v-show",
396
- value: !tz.visible,
397
- expression: "!tz.visible"
398
- }],
399
- key: index,
400
- staticClass: "tiny-picker-panel__tzlist-li",
401
- attrs: {
402
- "title": tz.name
403
- },
404
- on: {
405
- "click": function click($event) {
406
- return _vm.selectTz(tz);
407
- }
408
- }
409
- }, [_vm._v(" " + _vm._s(tz.name) + " ")]);
410
- }), 0)])])], 1)], 1) : _vm._e(), _vm.state.isShowFooter ? _c("div", {
411
- staticClass: "tiny-picker-panel__footer",
412
- style: {
413
- justifyContent: !["dates", "years"].includes(_vm.state.selectionMode) ? "space-between" : "right"
414
- }
415
- }, [_vm._t("default", function() {
416
- return [_c("tiny-button", {
417
- directives: [{
418
- name: "show",
419
- rawName: "v-show",
420
- value: !["dates", "years"].includes(_vm.state.selectionMode),
421
- expression: "!['dates', 'years'].includes(state.selectionMode)"
422
- }],
423
- staticClass: "tiny-picker-panel__link-btn",
424
- attrs: {
425
- "size": _vm.state.buttonSize,
426
- "type": "text"
427
- },
428
- on: {
429
- "click": _vm.changeToNow
430
- }
431
- }, [_vm._v(" " + _vm._s(_vm.t("ui.datepicker.now")) + " ")])];
432
- }), _c("tiny-button", {
433
- staticClass: "tiny-picker-panel__link-btn",
434
- attrs: {
435
- "type": _vm.state.buttonType,
436
- "size": _vm.state.buttonSize
437
- },
438
- on: {
439
- "click": _vm.confirm
440
- }
441
- }, [_vm._v(" " + _vm._s(_vm.t("ui.datepicker.confirm")) + " ")])], 2) : _vm._e()])]);
115
+ var _hoisted_1 = {
116
+ class: "tiny-picker-panel__body-wrapper"
442
117
  };
443
- var staticRenderFns = [];
444
- var __cssModules = {};
445
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
446
- function __vue2_injectStyles(context) {
447
- for (var o in __cssModules) {
448
- this[o] = __cssModules[o];
449
- }
118
+ var _hoisted_2 = {
119
+ key: 0,
120
+ class: "tiny-picker-panel__sidebar"
121
+ };
122
+ var _hoisted_3 = ["onClick", "title"];
123
+ var _hoisted_4 = {
124
+ class: "tiny-picker-panel__body"
125
+ };
126
+ var _hoisted_5 = {
127
+ key: 0,
128
+ class: "tiny-date-picker__time-header"
129
+ };
130
+ var _hoisted_6 = {
131
+ class: "tiny-date-picker__editor-wrap"
132
+ };
133
+ var _hoisted_7 = {
134
+ class: "tiny-date-picker__editor-wrap"
135
+ };
136
+ var _hoisted_8 = ["aria-label"];
137
+ var _hoisted_9 = ["aria-label"];
138
+ var _hoisted_10 = ["aria-label"];
139
+ var _hoisted_11 = ["aria-label"];
140
+ var _hoisted_12 = {
141
+ class: "tiny-picker-panel__content"
142
+ };
143
+ var _hoisted_13 = {
144
+ class: "tiny-picker-panel__table"
145
+ };
146
+ var _hoisted_14 = {
147
+ key: 0,
148
+ class: "tiny-picker-panel__timezone"
149
+ };
150
+ var _hoisted_15 = {
151
+ class: "tiny-picker-panel__tzlist"
152
+ };
153
+ var _hoisted_16 = {
154
+ class: "tzlist"
155
+ };
156
+ var _hoisted_17 = ["title", "onClick"];
157
+ function _sfc_render(_ctx, _cache, $props2, $setup, $data, $options) {
158
+ var _component_tiny_input = resolveComponent("tiny-input");
159
+ var _component_time_picker = resolveComponent("time-picker");
160
+ var _component_icon_double_left = resolveComponent("icon-double-left");
161
+ var _component_icon_chevron_left = resolveComponent("icon-chevron-left");
162
+ var _component_icon_double_right = resolveComponent("icon-double-right");
163
+ var _component_icon_chevron_right = resolveComponent("icon-chevron-right");
164
+ var _component_date_table = resolveComponent("date-table");
165
+ var _component_year_table = resolveComponent("year-table");
166
+ var _component_month_table = resolveComponent("month-table");
167
+ var _component_tiny_popup = resolveComponent("tiny-popup");
168
+ var _component_tiny_button = resolveComponent("tiny-button");
169
+ var _directive_clickoutside = resolveDirective("clickoutside");
170
+ return openBlock(), createBlock(Transition, {
171
+ name: "tiny-zoom-in-top",
172
+ onAfterEnter: _ctx.handleEnter,
173
+ onAfterLeave: _ctx.handleLeave,
174
+ persisted: ""
175
+ }, {
176
+ default: withCtx(function() {
177
+ return [withDirectives(createElementVNode(
178
+ "div",
179
+ {
180
+ class: normalizeClass(["tiny-picker-panel tiny-date-picker tiny-popper", [{
181
+ "has-sidebar": _ctx.slots.sidebar || _ctx.state.shortcuts,
182
+ "has-time": _ctx.state.showTime
183
+ }, _ctx.state.popperClass]])
184
+ },
185
+ [createElementVNode("div", _hoisted_1, [renderSlot(_ctx.$slots, "sidebar", {
186
+ class: "tiny-picker-panel__sidebar"
187
+ }), _ctx.state.shortcuts ? (openBlock(), createElementBlock("div", _hoisted_2, [(openBlock(true), createElementBlock(
188
+ Fragment,
189
+ null,
190
+ renderList(_ctx.state.shortcuts, function(shortcut, key) {
191
+ return openBlock(), createElementBlock("button", {
192
+ type: "button",
193
+ class: "tiny-picker-panel__shortcut",
194
+ key,
195
+ onClick: function onClick($event) {
196
+ return _ctx.handleShortcutClick(shortcut);
197
+ },
198
+ title: shortcut.text
199
+ }, toDisplayString(shortcut.text), 9, _hoisted_3);
200
+ }),
201
+ 128
202
+ /* KEYED_FRAGMENT */
203
+ ))])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_4, [_ctx.state.showTime ? (openBlock(), createElementBlock("div", _hoisted_5, [createElementVNode("span", _hoisted_6, [createVNode(_component_tiny_input, {
204
+ placeholder: _ctx.t("ui.datepicker.selectDate"),
205
+ "model-value": _ctx.state.visibleDate,
206
+ size: "small",
207
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = function(val) {
208
+ return _ctx.state.userInputDate = val;
209
+ }),
210
+ onChange: _ctx.handleVisibleDateChange
211
+ }, null, 8, ["placeholder", "model-value", "onChange"])]), withDirectives((openBlock(), createElementBlock("span", _hoisted_7, [createVNode(_component_tiny_input, {
212
+ ref: "input",
213
+ onFocus: _cache[1] || (_cache[1] = function($event) {
214
+ return _ctx.state.timePickerVisible = true;
215
+ }),
216
+ placeholder: _ctx.t("ui.datepicker.selectTime"),
217
+ "model-value": _ctx.state.visibleTime,
218
+ size: "small",
219
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = function(val) {
220
+ return _ctx.state.userInputTime = val;
221
+ }),
222
+ onChange: _ctx.handleVisibleTimeChange,
223
+ readonly: !_ctx.timeEditable
224
+ }, null, 8, ["placeholder", "model-value", "onChange", "readonly"]), createVNode(_component_time_picker, {
225
+ ref: "timepicker",
226
+ step: _ctx.step,
227
+ "time-arrow-control": _ctx.state.arrowControl,
228
+ show: _ctx.state.timePickerVisible,
229
+ value: _ctx.state.date,
230
+ onPick: _ctx.handleTimePick
231
+ }, null, 8, ["step", "time-arrow-control", "show", "value", "onPick"])])), [[_directive_clickoutside, _ctx.handleTimePickClose]])])) : createCommentVNode("v-if", true), withDirectives(createElementVNode(
232
+ "div",
233
+ {
234
+ class: normalizeClass(["tiny-date-picker__header", {
235
+ "tiny-date-picker__header--bordered": ["month", "year", "years", "yearrange"].includes(_ctx.state.currentView)
236
+ }])
237
+ },
238
+ [createElementVNode("button", {
239
+ type: "button",
240
+ onClick: _cache[3] || (_cache[3] = function() {
241
+ return _ctx.cusPrevYear && _ctx.cusPrevYear.apply(_ctx, arguments);
242
+ }),
243
+ "aria-label": _ctx.t("ui.datepicker.prevYear"),
244
+ class: "tiny-picker-panel__icon-btn tiny-date-picker__prev-btn tiny-icon-d-arrow-left"
245
+ }, [createVNode(_component_icon_double_left)], 8, _hoisted_8), withDirectives(createElementVNode("button", {
246
+ type: "button",
247
+ onClick: _cache[4] || (_cache[4] = function() {
248
+ return _ctx.cusPrevMonth && _ctx.cusPrevMonth.apply(_ctx, arguments);
249
+ }),
250
+ "aria-label": _ctx.t("ui.datepicker.prevMonth"),
251
+ class: "tiny-picker-panel__icon-btn tiny-date-picker__prev-btn tiny-icon-arrow-left"
252
+ }, [createVNode(_component_icon_chevron_left)], 8, _hoisted_9), [[vShow, _ctx.state.currentView === "date"]]), createElementVNode(
253
+ "span",
254
+ {
255
+ onClick: _cache[5] || (_cache[5] = function() {
256
+ return _ctx.showYearPicker && _ctx.showYearPicker.apply(_ctx, arguments);
257
+ }),
258
+ role: "button",
259
+ class: "tiny-date-picker__header-label"
260
+ },
261
+ toDisplayString(_ctx.state.yearLabel),
262
+ 1
263
+ /* TEXT */
264
+ ), withDirectives(createElementVNode(
265
+ "span",
266
+ {
267
+ onClick: _cache[6] || (_cache[6] = function() {
268
+ return _ctx.showMonthPicker && _ctx.showMonthPicker.apply(_ctx, arguments);
269
+ }),
270
+ role: "button",
271
+ class: normalizeClass(["tiny-date-picker__header-label", {
272
+ active: _ctx.state.currentView === "month"
273
+ }])
274
+ },
275
+ toDisplayString(_ctx.t("ui.datepicker.month" + (_ctx.state.month + 1))),
276
+ 3
277
+ /* TEXT, CLASS */
278
+ ), [[vShow, _ctx.state.currentView === "date"]]), createElementVNode("button", {
279
+ type: "button",
280
+ onClick: _cache[7] || (_cache[7] = function() {
281
+ return _ctx.cusNextYear && _ctx.cusNextYear.apply(_ctx, arguments);
282
+ }),
283
+ "aria-label": _ctx.t("ui.datepicker.nextYear"),
284
+ class: "tiny-picker-panel__icon-btn tiny-date-picker__next-btn tiny-icon-d-arrow-right"
285
+ }, [createVNode(_component_icon_double_right)], 8, _hoisted_10), withDirectives(createElementVNode("button", {
286
+ type: "button",
287
+ onClick: _cache[8] || (_cache[8] = function() {
288
+ return _ctx.cusNextMonth && _ctx.cusNextMonth.apply(_ctx, arguments);
289
+ }),
290
+ "aria-label": _ctx.t("ui.datepicker.nextMonth"),
291
+ class: "tiny-picker-panel__icon-btn tiny-date-picker__next-btn tiny-icon-arrow-right"
292
+ }, [createVNode(_component_icon_chevron_right)], 8, _hoisted_11), [[vShow, _ctx.state.currentView === "date"]])],
293
+ 2
294
+ /* CLASS */
295
+ ), [[vShow, _ctx.state.currentView !== "time"]]), createElementVNode("div", _hoisted_12, [createElementVNode("div", _hoisted_13, [_ctx.state.currentView === "date" ? (openBlock(), createBlock(_component_date_table, {
296
+ key: 0,
297
+ ref: "dateTable",
298
+ onPick: _ctx.handleDatePick,
299
+ "selection-mode": _ctx.state.selectionMode,
300
+ "first-day-of-week": _ctx.state.firstDayOfWeek,
301
+ value: _ctx.state.value,
302
+ "default-value": _ctx.state.defaultValue ? new Date(_ctx.state.defaultValue) : null,
303
+ date: _ctx.state.date,
304
+ "cell-class-name": _ctx.state.cellClassName,
305
+ "disabled-date": _ctx.state.disabledDate,
306
+ "show-week-number": _ctx.showWeekNumber,
307
+ "format-weeks": _ctx.formatWeeks
308
+ }, 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, {
309
+ key: 1,
310
+ ref: "yearTable",
311
+ value: _ctx.state.value,
312
+ "default-value": _ctx.state.defaultValue ? new Date(_ctx.state.defaultValue) : null,
313
+ date: _ctx.state.date,
314
+ "disabled-date": _ctx.state.disabledDate,
315
+ "selection-mode": _ctx.state.selectionMode,
316
+ "start-year": _ctx.state.startYear,
317
+ onPick: _ctx.handleYearPick
318
+ }, 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, {
319
+ key: 2,
320
+ ref: "monthTable",
321
+ onPick: _ctx.handleMonthPick,
322
+ value: _ctx.state.value,
323
+ "default-value": _ctx.state.defaultValue ? new Date(_ctx.state.defaultValue) : null,
324
+ date: _ctx.state.date,
325
+ "disabled-date": _ctx.state.disabledDate
326
+ }, null, 8, ["onPick", "value", "default-value", "date", "disabled-date"])) : createCommentVNode("v-if", true)])])])]), _ctx.state.isShowTz || _ctx.state.timezone.isServiceTimezone ? withDirectives((openBlock(), createElementBlock("div", _hoisted_14, [createVNode(_component_tiny_input, {
327
+ modelValue: _ctx.state.tz,
328
+ "onUpdate:modelValue": [_cache[9] || (_cache[9] = function($event) {
329
+ return _ctx.state.tz = $event;
330
+ }), _ctx.searchTz],
331
+ disabled: _ctx.state.timezone.isServiceTimezone,
332
+ placeholder: _ctx.t("ui.datepicker.timezone")
333
+ }, {
334
+ suffix: withCtx(function() {
335
+ return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.state.showpopup ? "IconChevronDown" : "IconChevronUp"), {
336
+ fill: "#ccc",
337
+ onClick: _ctx.toggleTz
338
+ }, null, 8, ["onClick"]))];
339
+ }),
340
+ _: 1
341
+ /* STABLE */
342
+ }, 8, ["modelValue", "disabled", "onUpdate:modelValue", "placeholder"]), createElementVNode("div", _hoisted_15, [createVNode(_component_tiny_popup, {
343
+ modelValue: _ctx.state.showpopup,
344
+ "onUpdate:modelValue": _cache[10] || (_cache[10] = function($event) {
345
+ return _ctx.state.showpopup = $event;
346
+ }),
347
+ overlay: false,
348
+ position: "up",
349
+ duration: 0.2,
350
+ closeable: false
351
+ }, {
352
+ default: withCtx(function() {
353
+ return [createElementVNode("div", _hoisted_16, [createElementVNode("ul", null, [(openBlock(true), createElementBlock(
354
+ Fragment,
355
+ null,
356
+ renderList(_ctx.state.renderTzdata, function(tz, index) {
357
+ return withDirectives((openBlock(), createElementBlock("li", {
358
+ class: "tiny-picker-panel__tzlist-li",
359
+ title: tz.name,
360
+ key: index,
361
+ onClick: function onClick($event) {
362
+ return _ctx.selectTz(tz);
363
+ }
364
+ }, toDisplayString(tz.name), 9, _hoisted_17)), [[vShow, !tz.visible]]);
365
+ }),
366
+ 128
367
+ /* KEYED_FRAGMENT */
368
+ ))])])];
369
+ }),
370
+ _: 1
371
+ /* STABLE */
372
+ }, 8, ["modelValue"])])])), [[_directive_clickoutside, _ctx.handleTzPickClose]]) : createCommentVNode("v-if", true), _ctx.state.isShowFooter ? (openBlock(), createElementBlock(
373
+ "div",
374
+ {
375
+ key: 1,
376
+ class: "tiny-picker-panel__footer",
377
+ style: normalizeStyle({
378
+ justifyContent: !["dates", "years"].includes(_ctx.state.selectionMode) ? "space-between" : "right"
379
+ })
380
+ },
381
+ [renderSlot(_ctx.$slots, "default", {}, function() {
382
+ return [withDirectives(createVNode(_component_tiny_button, {
383
+ size: _ctx.state.buttonSize,
384
+ type: "text",
385
+ class: "tiny-picker-panel__link-btn",
386
+ onClick: _ctx.changeToNow
387
+ }, {
388
+ default: withCtx(function() {
389
+ return [createTextVNode(
390
+ toDisplayString(_ctx.t("ui.datepicker.now")),
391
+ 1
392
+ /* TEXT */
393
+ )];
394
+ }),
395
+ _: 1
396
+ /* STABLE */
397
+ }, 8, ["size", "onClick"]), [[vShow, !["dates", "years"].includes(_ctx.state.selectionMode)]])];
398
+ }), createVNode(_component_tiny_button, {
399
+ type: _ctx.state.buttonType,
400
+ size: _ctx.state.buttonSize,
401
+ class: "tiny-picker-panel__link-btn",
402
+ onClick: _ctx.confirm
403
+ }, {
404
+ default: withCtx(function() {
405
+ return [createTextVNode(
406
+ toDisplayString(_ctx.t("ui.datepicker.confirm")),
407
+ 1
408
+ /* TEXT */
409
+ )];
410
+ }),
411
+ _: 1
412
+ /* STABLE */
413
+ }, 8, ["type", "size", "onClick"])],
414
+ 4
415
+ /* STYLE */
416
+ )) : createCommentVNode("v-if", true)],
417
+ 2
418
+ /* CLASS */
419
+ ), [[vShow, _ctx.state.visible]])];
420
+ }),
421
+ _: 3
422
+ /* FORWARDED */
423
+ }, 8, ["onAfterEnter", "onAfterLeave"]);
450
424
  }
451
- var pc = /* @__PURE__ */ function() {
452
- return __component__.exports;
453
- }();
425
+ var pc = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
454
426
 
455
427
  export { pc as default };