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