@94ai/nf-timezone-picker 5.0.29 → 5.0.36
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/nf-timezone-picker.cjs.js +247 -1521
- package/lib/nf-timezone-picker.esm-bundler.js +122 -1396
- package/package.json +3 -3
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"use strict";
|
|
14
14
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
15
15
|
const Vue = require("vue");
|
|
16
|
+
const dateUtil = require("element-ui/src/utils/date-util");
|
|
16
17
|
const vue2RuntimeHelpers = require("@94ai/vue2-runtime-helpers");
|
|
18
|
+
const Locale = require("element-ui/lib/mixins/locale");
|
|
17
19
|
require("fs");
|
|
18
20
|
require("path");
|
|
19
21
|
require("vue-demi");
|
|
@@ -174,818 +176,6 @@ const Clickoutside = {
|
|
|
174
176
|
delete el[ctx];
|
|
175
177
|
}
|
|
176
178
|
};
|
|
177
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
178
|
-
function getDefaultExportFromCjs(x) {
|
|
179
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
180
|
-
}
|
|
181
|
-
function getAugmentedNamespace(n) {
|
|
182
|
-
if (n.__esModule)
|
|
183
|
-
return n;
|
|
184
|
-
var f = n.default;
|
|
185
|
-
if (typeof f == "function") {
|
|
186
|
-
var a = function a2() {
|
|
187
|
-
if (this instanceof a2) {
|
|
188
|
-
return Reflect.construct(f, arguments, this.constructor);
|
|
189
|
-
}
|
|
190
|
-
return f.apply(this, arguments);
|
|
191
|
-
};
|
|
192
|
-
a.prototype = f.prototype;
|
|
193
|
-
} else
|
|
194
|
-
a = {};
|
|
195
|
-
Object.defineProperty(a, "__esModule", {
|
|
196
|
-
value: true
|
|
197
|
-
});
|
|
198
|
-
Object.keys(n).forEach(function(k) {
|
|
199
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
200
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
201
|
-
enumerable: true,
|
|
202
|
-
get: function() {
|
|
203
|
-
return n[k];
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
return a;
|
|
208
|
-
}
|
|
209
|
-
var date = { exports: {} };
|
|
210
|
-
(function(module2) {
|
|
211
|
-
(function(main) {
|
|
212
|
-
var fecha2 = {};
|
|
213
|
-
var token = /d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
|
|
214
|
-
var twoDigits = "\\d\\d?";
|
|
215
|
-
var threeDigits = "\\d{3}";
|
|
216
|
-
var fourDigits = "\\d{4}";
|
|
217
|
-
var word = "[^\\s]+";
|
|
218
|
-
var literal = /\[([^]*?)\]/gm;
|
|
219
|
-
var noop2 = function() {
|
|
220
|
-
};
|
|
221
|
-
function regexEscape(str) {
|
|
222
|
-
return str.replace(/[|\\{()[^$+*?.-]/g, "\\$&");
|
|
223
|
-
}
|
|
224
|
-
function shorten(arr, sLen) {
|
|
225
|
-
var newArr = [];
|
|
226
|
-
for (var i = 0, len = arr.length; i < len; i++) {
|
|
227
|
-
newArr.push(arr[i].substr(0, sLen));
|
|
228
|
-
}
|
|
229
|
-
return newArr;
|
|
230
|
-
}
|
|
231
|
-
function monthUpdate(arrName) {
|
|
232
|
-
return function(d, v, i18n3) {
|
|
233
|
-
var index = i18n3[arrName].indexOf(v.charAt(0).toUpperCase() + v.substr(1).toLowerCase());
|
|
234
|
-
if (~index) {
|
|
235
|
-
d.month = index;
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
function pad(val, len) {
|
|
240
|
-
val = String(val);
|
|
241
|
-
len = len || 2;
|
|
242
|
-
while (val.length < len) {
|
|
243
|
-
val = "0" + val;
|
|
244
|
-
}
|
|
245
|
-
return val;
|
|
246
|
-
}
|
|
247
|
-
var dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
248
|
-
var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
249
|
-
var monthNamesShort = shorten(monthNames, 3);
|
|
250
|
-
var dayNamesShort = shorten(dayNames, 3);
|
|
251
|
-
fecha2.i18n = {
|
|
252
|
-
dayNamesShort,
|
|
253
|
-
dayNames,
|
|
254
|
-
monthNamesShort,
|
|
255
|
-
monthNames,
|
|
256
|
-
amPm: ["am", "pm"],
|
|
257
|
-
DoFn: function DoFn(D) {
|
|
258
|
-
return D + ["th", "st", "nd", "rd"][D % 10 > 3 ? 0 : (D - D % 10 !== 10) * D % 10];
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
var formatFlags = {
|
|
262
|
-
D: function(dateObj) {
|
|
263
|
-
return dateObj.getDay();
|
|
264
|
-
},
|
|
265
|
-
DD: function(dateObj) {
|
|
266
|
-
return pad(dateObj.getDay());
|
|
267
|
-
},
|
|
268
|
-
Do: function(dateObj, i18n3) {
|
|
269
|
-
return i18n3.DoFn(dateObj.getDate());
|
|
270
|
-
},
|
|
271
|
-
d: function(dateObj) {
|
|
272
|
-
return dateObj.getDate();
|
|
273
|
-
},
|
|
274
|
-
dd: function(dateObj) {
|
|
275
|
-
return pad(dateObj.getDate());
|
|
276
|
-
},
|
|
277
|
-
ddd: function(dateObj, i18n3) {
|
|
278
|
-
return i18n3.dayNamesShort[dateObj.getDay()];
|
|
279
|
-
},
|
|
280
|
-
dddd: function(dateObj, i18n3) {
|
|
281
|
-
return i18n3.dayNames[dateObj.getDay()];
|
|
282
|
-
},
|
|
283
|
-
M: function(dateObj) {
|
|
284
|
-
return dateObj.getMonth() + 1;
|
|
285
|
-
},
|
|
286
|
-
MM: function(dateObj) {
|
|
287
|
-
return pad(dateObj.getMonth() + 1);
|
|
288
|
-
},
|
|
289
|
-
MMM: function(dateObj, i18n3) {
|
|
290
|
-
return i18n3.monthNamesShort[dateObj.getMonth()];
|
|
291
|
-
},
|
|
292
|
-
MMMM: function(dateObj, i18n3) {
|
|
293
|
-
return i18n3.monthNames[dateObj.getMonth()];
|
|
294
|
-
},
|
|
295
|
-
yy: function(dateObj) {
|
|
296
|
-
return pad(String(dateObj.getFullYear()), 4).substr(2);
|
|
297
|
-
},
|
|
298
|
-
yyyy: function(dateObj) {
|
|
299
|
-
return pad(dateObj.getFullYear(), 4);
|
|
300
|
-
},
|
|
301
|
-
h: function(dateObj) {
|
|
302
|
-
return dateObj.getHours() % 12 || 12;
|
|
303
|
-
},
|
|
304
|
-
hh: function(dateObj) {
|
|
305
|
-
return pad(dateObj.getHours() % 12 || 12);
|
|
306
|
-
},
|
|
307
|
-
H: function(dateObj) {
|
|
308
|
-
return dateObj.getHours();
|
|
309
|
-
},
|
|
310
|
-
HH: function(dateObj) {
|
|
311
|
-
return pad(dateObj.getHours());
|
|
312
|
-
},
|
|
313
|
-
m: function(dateObj) {
|
|
314
|
-
return dateObj.getMinutes();
|
|
315
|
-
},
|
|
316
|
-
mm: function(dateObj) {
|
|
317
|
-
return pad(dateObj.getMinutes());
|
|
318
|
-
},
|
|
319
|
-
s: function(dateObj) {
|
|
320
|
-
return dateObj.getSeconds();
|
|
321
|
-
},
|
|
322
|
-
ss: function(dateObj) {
|
|
323
|
-
return pad(dateObj.getSeconds());
|
|
324
|
-
},
|
|
325
|
-
S: function(dateObj) {
|
|
326
|
-
return Math.round(dateObj.getMilliseconds() / 100);
|
|
327
|
-
},
|
|
328
|
-
SS: function(dateObj) {
|
|
329
|
-
return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
|
|
330
|
-
},
|
|
331
|
-
SSS: function(dateObj) {
|
|
332
|
-
return pad(dateObj.getMilliseconds(), 3);
|
|
333
|
-
},
|
|
334
|
-
a: function(dateObj, i18n3) {
|
|
335
|
-
return dateObj.getHours() < 12 ? i18n3.amPm[0] : i18n3.amPm[1];
|
|
336
|
-
},
|
|
337
|
-
A: function(dateObj, i18n3) {
|
|
338
|
-
return dateObj.getHours() < 12 ? i18n3.amPm[0].toUpperCase() : i18n3.amPm[1].toUpperCase();
|
|
339
|
-
},
|
|
340
|
-
ZZ: function(dateObj) {
|
|
341
|
-
var o = dateObj.getTimezoneOffset();
|
|
342
|
-
return (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
var parseFlags = {
|
|
346
|
-
d: [twoDigits, function(d, v) {
|
|
347
|
-
d.day = v;
|
|
348
|
-
}],
|
|
349
|
-
Do: [twoDigits + word, function(d, v) {
|
|
350
|
-
d.day = parseInt(v, 10);
|
|
351
|
-
}],
|
|
352
|
-
M: [twoDigits, function(d, v) {
|
|
353
|
-
d.month = v - 1;
|
|
354
|
-
}],
|
|
355
|
-
yy: [twoDigits, function(d, v) {
|
|
356
|
-
var da = /* @__PURE__ */ new Date(), cent = +("" + da.getFullYear()).substr(0, 2);
|
|
357
|
-
d.year = "" + (v > 68 ? cent - 1 : cent) + v;
|
|
358
|
-
}],
|
|
359
|
-
h: [twoDigits, function(d, v) {
|
|
360
|
-
d.hour = v;
|
|
361
|
-
}],
|
|
362
|
-
m: [twoDigits, function(d, v) {
|
|
363
|
-
d.minute = v;
|
|
364
|
-
}],
|
|
365
|
-
s: [twoDigits, function(d, v) {
|
|
366
|
-
d.second = v;
|
|
367
|
-
}],
|
|
368
|
-
yyyy: [fourDigits, function(d, v) {
|
|
369
|
-
d.year = v;
|
|
370
|
-
}],
|
|
371
|
-
S: ["\\d", function(d, v) {
|
|
372
|
-
d.millisecond = v * 100;
|
|
373
|
-
}],
|
|
374
|
-
SS: ["\\d{2}", function(d, v) {
|
|
375
|
-
d.millisecond = v * 10;
|
|
376
|
-
}],
|
|
377
|
-
SSS: [threeDigits, function(d, v) {
|
|
378
|
-
d.millisecond = v;
|
|
379
|
-
}],
|
|
380
|
-
D: [twoDigits, noop2],
|
|
381
|
-
ddd: [word, noop2],
|
|
382
|
-
MMM: [word, monthUpdate("monthNamesShort")],
|
|
383
|
-
MMMM: [word, monthUpdate("monthNames")],
|
|
384
|
-
a: [word, function(d, v, i18n3) {
|
|
385
|
-
var val = v.toLowerCase();
|
|
386
|
-
if (val === i18n3.amPm[0]) {
|
|
387
|
-
d.isPm = false;
|
|
388
|
-
} else if (val === i18n3.amPm[1]) {
|
|
389
|
-
d.isPm = true;
|
|
390
|
-
}
|
|
391
|
-
}],
|
|
392
|
-
ZZ: ["[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z", function(d, v) {
|
|
393
|
-
var parts = (v + "").match(/([+-]|\d\d)/gi), minutes;
|
|
394
|
-
if (parts) {
|
|
395
|
-
minutes = +(parts[1] * 60) + parseInt(parts[2], 10);
|
|
396
|
-
d.timezoneOffset = parts[0] === "+" ? minutes : -minutes;
|
|
397
|
-
}
|
|
398
|
-
}]
|
|
399
|
-
};
|
|
400
|
-
parseFlags.dd = parseFlags.d;
|
|
401
|
-
parseFlags.dddd = parseFlags.ddd;
|
|
402
|
-
parseFlags.DD = parseFlags.D;
|
|
403
|
-
parseFlags.mm = parseFlags.m;
|
|
404
|
-
parseFlags.hh = parseFlags.H = parseFlags.HH = parseFlags.h;
|
|
405
|
-
parseFlags.MM = parseFlags.M;
|
|
406
|
-
parseFlags.ss = parseFlags.s;
|
|
407
|
-
parseFlags.A = parseFlags.a;
|
|
408
|
-
fecha2.masks = {
|
|
409
|
-
default: "ddd MMM dd yyyy HH:mm:ss",
|
|
410
|
-
shortDate: "M/D/yy",
|
|
411
|
-
mediumDate: "MMM d, yyyy",
|
|
412
|
-
longDate: "MMMM d, yyyy",
|
|
413
|
-
fullDate: "dddd, MMMM d, yyyy",
|
|
414
|
-
shortTime: "HH:mm",
|
|
415
|
-
mediumTime: "HH:mm:ss",
|
|
416
|
-
longTime: "HH:mm:ss.SSS"
|
|
417
|
-
};
|
|
418
|
-
fecha2.format = function(dateObj, mask, i18nSettings) {
|
|
419
|
-
var i18n3 = i18nSettings || fecha2.i18n;
|
|
420
|
-
if (typeof dateObj === "number") {
|
|
421
|
-
dateObj = new Date(dateObj);
|
|
422
|
-
}
|
|
423
|
-
if (Object.prototype.toString.call(dateObj) !== "[object Date]" || isNaN(dateObj.getTime())) {
|
|
424
|
-
throw new Error("Invalid Date in fecha.format");
|
|
425
|
-
}
|
|
426
|
-
mask = fecha2.masks[mask] || mask || fecha2.masks["default"];
|
|
427
|
-
var literals = [];
|
|
428
|
-
mask = mask.replace(literal, function($0, $1) {
|
|
429
|
-
literals.push($1);
|
|
430
|
-
return "@@@";
|
|
431
|
-
});
|
|
432
|
-
mask = mask.replace(token, function($0) {
|
|
433
|
-
return $0 in formatFlags ? formatFlags[$0](dateObj, i18n3) : $0.slice(1, $0.length - 1);
|
|
434
|
-
});
|
|
435
|
-
return mask.replace(/@@@/g, function() {
|
|
436
|
-
return literals.shift();
|
|
437
|
-
});
|
|
438
|
-
};
|
|
439
|
-
fecha2.parse = function(dateStr, format2, i18nSettings) {
|
|
440
|
-
var i18n3 = i18nSettings || fecha2.i18n;
|
|
441
|
-
if (typeof format2 !== "string") {
|
|
442
|
-
throw new Error("Invalid format in fecha.parse");
|
|
443
|
-
}
|
|
444
|
-
format2 = fecha2.masks[format2] || format2;
|
|
445
|
-
if (dateStr.length > 1e3) {
|
|
446
|
-
return null;
|
|
447
|
-
}
|
|
448
|
-
var dateInfo = {};
|
|
449
|
-
var parseInfo = [];
|
|
450
|
-
var literals = [];
|
|
451
|
-
format2 = format2.replace(literal, function($0, $1) {
|
|
452
|
-
literals.push($1);
|
|
453
|
-
return "@@@";
|
|
454
|
-
});
|
|
455
|
-
var newFormat = regexEscape(format2).replace(token, function($0) {
|
|
456
|
-
if (parseFlags[$0]) {
|
|
457
|
-
var info = parseFlags[$0];
|
|
458
|
-
parseInfo.push(info[1]);
|
|
459
|
-
return "(" + info[0] + ")";
|
|
460
|
-
}
|
|
461
|
-
return $0;
|
|
462
|
-
});
|
|
463
|
-
newFormat = newFormat.replace(/@@@/g, function() {
|
|
464
|
-
return literals.shift();
|
|
465
|
-
});
|
|
466
|
-
var matches = dateStr.match(new RegExp(newFormat, "i"));
|
|
467
|
-
if (!matches) {
|
|
468
|
-
return null;
|
|
469
|
-
}
|
|
470
|
-
for (var i = 1; i < matches.length; i++) {
|
|
471
|
-
parseInfo[i - 1](dateInfo, matches[i], i18n3);
|
|
472
|
-
}
|
|
473
|
-
var today = /* @__PURE__ */ new Date();
|
|
474
|
-
if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {
|
|
475
|
-
dateInfo.hour = +dateInfo.hour + 12;
|
|
476
|
-
} else if (dateInfo.isPm === false && +dateInfo.hour === 12) {
|
|
477
|
-
dateInfo.hour = 0;
|
|
478
|
-
}
|
|
479
|
-
var date2;
|
|
480
|
-
if (dateInfo.timezoneOffset != null) {
|
|
481
|
-
dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
|
|
482
|
-
date2 = new Date(Date.UTC(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0));
|
|
483
|
-
} else {
|
|
484
|
-
date2 = new Date(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0);
|
|
485
|
-
}
|
|
486
|
-
return date2;
|
|
487
|
-
};
|
|
488
|
-
if (module2.exports) {
|
|
489
|
-
module2.exports = fecha2;
|
|
490
|
-
} else {
|
|
491
|
-
main.fecha = fecha2;
|
|
492
|
-
}
|
|
493
|
-
})(commonjsGlobal);
|
|
494
|
-
})(date);
|
|
495
|
-
var dateExports = date.exports;
|
|
496
|
-
const fecha = /* @__PURE__ */ getDefaultExportFromCjs(dateExports);
|
|
497
|
-
const defaultLang = {
|
|
498
|
-
el: {
|
|
499
|
-
colorpicker: {
|
|
500
|
-
confirm: "确定",
|
|
501
|
-
clear: "清空"
|
|
502
|
-
},
|
|
503
|
-
datepicker: {
|
|
504
|
-
now: "此刻",
|
|
505
|
-
today: "今天",
|
|
506
|
-
cancel: "取消",
|
|
507
|
-
clear: "清空",
|
|
508
|
-
confirm: "确定",
|
|
509
|
-
selectDate: "选择日期",
|
|
510
|
-
selectTime: "选择时间",
|
|
511
|
-
startDate: "开始日期",
|
|
512
|
-
startTime: "开始时间",
|
|
513
|
-
endDate: "结束日期",
|
|
514
|
-
endTime: "结束时间",
|
|
515
|
-
prevYear: "前一年",
|
|
516
|
-
nextYear: "后一年",
|
|
517
|
-
prevMonth: "上个月",
|
|
518
|
-
nextMonth: "下个月",
|
|
519
|
-
year: "年",
|
|
520
|
-
month1: "1 月",
|
|
521
|
-
month2: "2 月",
|
|
522
|
-
month3: "3 月",
|
|
523
|
-
month4: "4 月",
|
|
524
|
-
month5: "5 月",
|
|
525
|
-
month6: "6 月",
|
|
526
|
-
month7: "7 月",
|
|
527
|
-
month8: "8 月",
|
|
528
|
-
month9: "9 月",
|
|
529
|
-
month10: "10 月",
|
|
530
|
-
month11: "11 月",
|
|
531
|
-
month12: "12 月",
|
|
532
|
-
// week: '周次',
|
|
533
|
-
weeks: {
|
|
534
|
-
sun: "日",
|
|
535
|
-
mon: "一",
|
|
536
|
-
tue: "二",
|
|
537
|
-
wed: "三",
|
|
538
|
-
thu: "四",
|
|
539
|
-
fri: "五",
|
|
540
|
-
sat: "六"
|
|
541
|
-
},
|
|
542
|
-
months: {
|
|
543
|
-
jan: "一月",
|
|
544
|
-
feb: "二月",
|
|
545
|
-
mar: "三月",
|
|
546
|
-
apr: "四月",
|
|
547
|
-
may: "五月",
|
|
548
|
-
jun: "六月",
|
|
549
|
-
jul: "七月",
|
|
550
|
-
aug: "八月",
|
|
551
|
-
sep: "九月",
|
|
552
|
-
oct: "十月",
|
|
553
|
-
nov: "十一月",
|
|
554
|
-
dec: "十二月"
|
|
555
|
-
}
|
|
556
|
-
},
|
|
557
|
-
select: {
|
|
558
|
-
loading: "加载中",
|
|
559
|
-
noMatch: "无匹配数据",
|
|
560
|
-
noData: "无数据",
|
|
561
|
-
placeholder: "请选择"
|
|
562
|
-
},
|
|
563
|
-
cascader: {
|
|
564
|
-
noMatch: "无匹配数据",
|
|
565
|
-
loading: "加载中",
|
|
566
|
-
placeholder: "请选择",
|
|
567
|
-
noData: "暂无数据"
|
|
568
|
-
},
|
|
569
|
-
pagination: {
|
|
570
|
-
goto: "前往",
|
|
571
|
-
pagesize: "条/页",
|
|
572
|
-
total: "共 {total} 条",
|
|
573
|
-
pageClassifier: "页"
|
|
574
|
-
},
|
|
575
|
-
messagebox: {
|
|
576
|
-
title: "提示",
|
|
577
|
-
confirm: "确定",
|
|
578
|
-
cancel: "取消",
|
|
579
|
-
error: "输入的数据不合法!"
|
|
580
|
-
},
|
|
581
|
-
upload: {
|
|
582
|
-
deleteTip: "按 delete 键可删除",
|
|
583
|
-
delete: "删除",
|
|
584
|
-
preview: "查看图片",
|
|
585
|
-
continue: "继续上传"
|
|
586
|
-
},
|
|
587
|
-
table: {
|
|
588
|
-
emptyText: "暂无数据",
|
|
589
|
-
confirmFilter: "筛选",
|
|
590
|
-
resetFilter: "重置",
|
|
591
|
-
clearFilter: "全部",
|
|
592
|
-
sumText: "合计"
|
|
593
|
-
},
|
|
594
|
-
tree: {
|
|
595
|
-
emptyText: "暂无数据"
|
|
596
|
-
},
|
|
597
|
-
transfer: {
|
|
598
|
-
noMatch: "无匹配数据",
|
|
599
|
-
noData: "无数据",
|
|
600
|
-
titles: ["列表 1", "列表 2"],
|
|
601
|
-
filterPlaceholder: "请输入搜索内容",
|
|
602
|
-
noCheckedFormat: "共 {total} 项",
|
|
603
|
-
hasCheckedFormat: "已选 {checked}/{total} 项"
|
|
604
|
-
},
|
|
605
|
-
image: {
|
|
606
|
-
error: "加载失败"
|
|
607
|
-
},
|
|
608
|
-
pageHeader: {
|
|
609
|
-
title: "返回"
|
|
610
|
-
},
|
|
611
|
-
popconfirm: {
|
|
612
|
-
confirmButtonText: "确定",
|
|
613
|
-
cancelButtonText: "取消"
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
};
|
|
617
|
-
var isMergeableObject = function isMergeableObject2(value) {
|
|
618
|
-
return isNonNullObject(value) && !isSpecial(value);
|
|
619
|
-
};
|
|
620
|
-
function isNonNullObject(value) {
|
|
621
|
-
return !!value && typeof value === "object";
|
|
622
|
-
}
|
|
623
|
-
function isSpecial(value) {
|
|
624
|
-
var stringValue = Object.prototype.toString.call(value);
|
|
625
|
-
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
|
|
626
|
-
}
|
|
627
|
-
var canUseSymbol = typeof Symbol === "function" && Symbol.for;
|
|
628
|
-
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
|
|
629
|
-
function isReactElement(value) {
|
|
630
|
-
return value.$$typeof === REACT_ELEMENT_TYPE;
|
|
631
|
-
}
|
|
632
|
-
function emptyTarget(val) {
|
|
633
|
-
return Array.isArray(val) ? [] : {};
|
|
634
|
-
}
|
|
635
|
-
function cloneIfNecessary(value, optionsArgument) {
|
|
636
|
-
var clone = optionsArgument && optionsArgument.clone === true;
|
|
637
|
-
return clone && isMergeableObject(value) ? deepmerge(emptyTarget(value), value, optionsArgument) : value;
|
|
638
|
-
}
|
|
639
|
-
function defaultArrayMerge(target, source, optionsArgument) {
|
|
640
|
-
var destination = target.slice();
|
|
641
|
-
source.forEach(function(e, i) {
|
|
642
|
-
if (typeof destination[i] === "undefined") {
|
|
643
|
-
destination[i] = cloneIfNecessary(e, optionsArgument);
|
|
644
|
-
} else if (isMergeableObject(e)) {
|
|
645
|
-
destination[i] = deepmerge(target[i], e, optionsArgument);
|
|
646
|
-
} else if (target.indexOf(e) === -1) {
|
|
647
|
-
destination.push(cloneIfNecessary(e, optionsArgument));
|
|
648
|
-
}
|
|
649
|
-
});
|
|
650
|
-
return destination;
|
|
651
|
-
}
|
|
652
|
-
function mergeObject(target, source, optionsArgument) {
|
|
653
|
-
var destination = {};
|
|
654
|
-
if (isMergeableObject(target)) {
|
|
655
|
-
Object.keys(target).forEach(function(key) {
|
|
656
|
-
destination[key] = cloneIfNecessary(target[key], optionsArgument);
|
|
657
|
-
});
|
|
658
|
-
}
|
|
659
|
-
Object.keys(source).forEach(function(key) {
|
|
660
|
-
if (!isMergeableObject(source[key]) || !target[key]) {
|
|
661
|
-
destination[key] = cloneIfNecessary(source[key], optionsArgument);
|
|
662
|
-
} else {
|
|
663
|
-
destination[key] = deepmerge(target[key], source[key], optionsArgument);
|
|
664
|
-
}
|
|
665
|
-
});
|
|
666
|
-
return destination;
|
|
667
|
-
}
|
|
668
|
-
function deepmerge(target, source, optionsArgument) {
|
|
669
|
-
var sourceIsArray = Array.isArray(source);
|
|
670
|
-
var targetIsArray = Array.isArray(target);
|
|
671
|
-
var options = optionsArgument || {
|
|
672
|
-
arrayMerge: defaultArrayMerge
|
|
673
|
-
};
|
|
674
|
-
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
675
|
-
if (!sourceAndTargetTypesMatch) {
|
|
676
|
-
return cloneIfNecessary(source, optionsArgument);
|
|
677
|
-
} else if (sourceIsArray) {
|
|
678
|
-
var arrayMerge = options.arrayMerge || defaultArrayMerge;
|
|
679
|
-
return arrayMerge(target, source, optionsArgument);
|
|
680
|
-
} else {
|
|
681
|
-
return mergeObject(target, source, optionsArgument);
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
deepmerge.all = function deepmergeAll(array, optionsArgument) {
|
|
685
|
-
if (!Array.isArray(array) || array.length < 2) {
|
|
686
|
-
throw new Error("first argument should be an array with at least two elements");
|
|
687
|
-
}
|
|
688
|
-
return array.reduce(function(prev, next) {
|
|
689
|
-
return deepmerge(prev, next, optionsArgument);
|
|
690
|
-
});
|
|
691
|
-
};
|
|
692
|
-
var deepmerge_1 = deepmerge;
|
|
693
|
-
const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
694
|
-
__proto__: null,
|
|
695
|
-
default: deepmerge_1
|
|
696
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
697
|
-
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
698
|
-
function hasOwn$1(obj, key) {
|
|
699
|
-
return hasOwnProperty$1.call(obj, key);
|
|
700
|
-
}
|
|
701
|
-
const arrayFindIndex$1 = function(arr, pred) {
|
|
702
|
-
for (let i = 0; i !== arr.length; ++i) {
|
|
703
|
-
if (pred(arr[i])) {
|
|
704
|
-
return i;
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
return -1;
|
|
708
|
-
};
|
|
709
|
-
const arrayFind = function(arr, pred) {
|
|
710
|
-
const idx = arrayFindIndex$1(arr, pred);
|
|
711
|
-
return idx !== -1 ? arr[idx] : void 0;
|
|
712
|
-
};
|
|
713
|
-
const coerceTruthyValueToArray = function(val) {
|
|
714
|
-
if (Array.isArray(val)) {
|
|
715
|
-
return val;
|
|
716
|
-
} else if (val) {
|
|
717
|
-
return [val];
|
|
718
|
-
} else {
|
|
719
|
-
return [];
|
|
720
|
-
}
|
|
721
|
-
};
|
|
722
|
-
const RE_NARGS$1 = /(%|)\{([0-9a-zA-Z_]+)\}/g;
|
|
723
|
-
function Format(Vue2) {
|
|
724
|
-
function template(string, ...args) {
|
|
725
|
-
if (args.length === 1 && typeof args[0] === "object") {
|
|
726
|
-
args = args[0];
|
|
727
|
-
}
|
|
728
|
-
if (!args || !args.hasOwnProperty) {
|
|
729
|
-
args = {};
|
|
730
|
-
}
|
|
731
|
-
return string.replace(RE_NARGS$1, (match, prefix, i, index) => {
|
|
732
|
-
let result;
|
|
733
|
-
if (string[index - 1] === "{" && string[index + match.length] === "}") {
|
|
734
|
-
return i;
|
|
735
|
-
} else {
|
|
736
|
-
result = hasOwn$1(args, i) ? args[i] : null;
|
|
737
|
-
if (result === null || result === void 0) {
|
|
738
|
-
return "";
|
|
739
|
-
}
|
|
740
|
-
return result;
|
|
741
|
-
}
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
return template;
|
|
745
|
-
}
|
|
746
|
-
const format$2 = Format();
|
|
747
|
-
let lang$1 = defaultLang;
|
|
748
|
-
let merged$1 = false;
|
|
749
|
-
let i18nHandler$1 = function() {
|
|
750
|
-
const vuei18n = Object.getPrototypeOf(this || Vue).$t;
|
|
751
|
-
if (typeof vuei18n === "function" && !!Vue.locale) {
|
|
752
|
-
if (!merged$1) {
|
|
753
|
-
merged$1 = true;
|
|
754
|
-
Vue.locale(Vue.config.lang, deepmerge_1(lang$1, Vue.locale(Vue.config.lang) || {}, {
|
|
755
|
-
clone: true
|
|
756
|
-
}));
|
|
757
|
-
}
|
|
758
|
-
return vuei18n.apply(this, arguments);
|
|
759
|
-
}
|
|
760
|
-
};
|
|
761
|
-
const t$1 = function(path, options) {
|
|
762
|
-
let value = i18nHandler$1.apply(this, arguments);
|
|
763
|
-
if (value !== null && value !== void 0)
|
|
764
|
-
return value;
|
|
765
|
-
const array = path.split(".");
|
|
766
|
-
let current = lang$1;
|
|
767
|
-
for (let i = 0, j = array.length; i < j; i++) {
|
|
768
|
-
const property = array[i];
|
|
769
|
-
value = current[property];
|
|
770
|
-
if (i === j - 1)
|
|
771
|
-
return format$2(value, options);
|
|
772
|
-
if (!value)
|
|
773
|
-
return "";
|
|
774
|
-
current = value;
|
|
775
|
-
}
|
|
776
|
-
return "";
|
|
777
|
-
};
|
|
778
|
-
const weeks = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
|
|
779
|
-
const months = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"];
|
|
780
|
-
const newArray = function(start, end) {
|
|
781
|
-
let result = [];
|
|
782
|
-
for (let i = start; i <= end; i++) {
|
|
783
|
-
result.push(i);
|
|
784
|
-
}
|
|
785
|
-
return result;
|
|
786
|
-
};
|
|
787
|
-
const getI18nSettings = () => {
|
|
788
|
-
return {
|
|
789
|
-
dayNamesShort: weeks.map((week) => t$1(`el.datepicker.weeks.${week}`)),
|
|
790
|
-
dayNames: weeks.map((week) => t$1(`el.datepicker.weeks.${week}`)),
|
|
791
|
-
monthNamesShort: months.map((month) => t$1(`el.datepicker.months.${month}`)),
|
|
792
|
-
monthNames: months.map((month, index) => t$1(`el.datepicker.month${index + 1}`)),
|
|
793
|
-
amPm: ["am", "pm"]
|
|
794
|
-
};
|
|
795
|
-
};
|
|
796
|
-
const toDate = function(date2) {
|
|
797
|
-
return isDate(date2) ? new Date(date2) : null;
|
|
798
|
-
};
|
|
799
|
-
const isDate = function(date2) {
|
|
800
|
-
if (date2 === null || date2 === void 0)
|
|
801
|
-
return false;
|
|
802
|
-
if (isNaN(new Date(date2).getTime()))
|
|
803
|
-
return false;
|
|
804
|
-
if (Array.isArray(date2))
|
|
805
|
-
return false;
|
|
806
|
-
return true;
|
|
807
|
-
};
|
|
808
|
-
const isDateObject = function(val) {
|
|
809
|
-
return val instanceof Date;
|
|
810
|
-
};
|
|
811
|
-
const formatDate = function(date2, format2) {
|
|
812
|
-
date2 = toDate(date2);
|
|
813
|
-
if (!date2)
|
|
814
|
-
return "";
|
|
815
|
-
return fecha.format(date2, format2 || "yyyy-MM-dd", getI18nSettings());
|
|
816
|
-
};
|
|
817
|
-
const parseDate = function(string, format2) {
|
|
818
|
-
return fecha.parse(string, format2 || "yyyy-MM-dd", getI18nSettings());
|
|
819
|
-
};
|
|
820
|
-
const getDayCountOfMonth = function(year, month) {
|
|
821
|
-
if (month === 3 || month === 5 || month === 8 || month === 10) {
|
|
822
|
-
return 30;
|
|
823
|
-
}
|
|
824
|
-
if (month === 1) {
|
|
825
|
-
if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) {
|
|
826
|
-
return 29;
|
|
827
|
-
} else {
|
|
828
|
-
return 28;
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
return 31;
|
|
832
|
-
};
|
|
833
|
-
const getDayCountOfYear = function(year) {
|
|
834
|
-
const isLeapYear = year % 400 === 0 || year % 100 !== 0 && year % 4 === 0;
|
|
835
|
-
return isLeapYear ? 366 : 365;
|
|
836
|
-
};
|
|
837
|
-
const getFirstDayOfMonth = function(date2) {
|
|
838
|
-
const temp = new Date(date2.getTime());
|
|
839
|
-
temp.setDate(1);
|
|
840
|
-
return temp.getDay();
|
|
841
|
-
};
|
|
842
|
-
const prevDate = function(date2, amount = 1) {
|
|
843
|
-
return new Date(date2.getFullYear(), date2.getMonth(), date2.getDate() - amount);
|
|
844
|
-
};
|
|
845
|
-
const nextDate = function(date2, amount = 1) {
|
|
846
|
-
return new Date(date2.getFullYear(), date2.getMonth(), date2.getDate() + amount);
|
|
847
|
-
};
|
|
848
|
-
const getStartDateOfMonth = function(year, month) {
|
|
849
|
-
const result = new Date(year, month, 1);
|
|
850
|
-
const day = result.getDay();
|
|
851
|
-
if (day === 0) {
|
|
852
|
-
return prevDate(result, 7);
|
|
853
|
-
} else {
|
|
854
|
-
return prevDate(result, day);
|
|
855
|
-
}
|
|
856
|
-
};
|
|
857
|
-
const getWeekNumber = function(src) {
|
|
858
|
-
if (!isDate(src))
|
|
859
|
-
return null;
|
|
860
|
-
const date2 = new Date(src.getTime());
|
|
861
|
-
date2.setHours(0, 0, 0, 0);
|
|
862
|
-
date2.setDate(date2.getDate() + 3 - (date2.getDay() + 6) % 7);
|
|
863
|
-
const week1 = new Date(date2.getFullYear(), 0, 4);
|
|
864
|
-
return 1 + Math.round(((date2.getTime() - week1.getTime()) / 864e5 - 3 + (week1.getDay() + 6) % 7) / 7);
|
|
865
|
-
};
|
|
866
|
-
const getRangeHours = function(ranges) {
|
|
867
|
-
const hours = [];
|
|
868
|
-
let disabledHours = [];
|
|
869
|
-
(ranges || []).forEach((range2) => {
|
|
870
|
-
const value = range2.map((date2) => date2.getHours());
|
|
871
|
-
disabledHours = disabledHours.concat(newArray(value[0], value[1]));
|
|
872
|
-
});
|
|
873
|
-
if (disabledHours.length) {
|
|
874
|
-
for (let i = 0; i < 24; i++) {
|
|
875
|
-
hours[i] = disabledHours.indexOf(i) === -1;
|
|
876
|
-
}
|
|
877
|
-
} else {
|
|
878
|
-
for (let i = 0; i < 24; i++) {
|
|
879
|
-
hours[i] = false;
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
return hours;
|
|
883
|
-
};
|
|
884
|
-
function setRangeData(arr, start, end, value) {
|
|
885
|
-
for (let i = start; i < end; i++) {
|
|
886
|
-
arr[i] = value;
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
const getRangeMinutes = function(ranges, hour) {
|
|
890
|
-
const minutes = new Array(60);
|
|
891
|
-
if (ranges.length > 0) {
|
|
892
|
-
ranges.forEach((range2) => {
|
|
893
|
-
const start = range2[0];
|
|
894
|
-
const end = range2[1];
|
|
895
|
-
const startHour = start.getHours();
|
|
896
|
-
const startMinute = start.getMinutes();
|
|
897
|
-
const endHour = end.getHours();
|
|
898
|
-
const endMinute = end.getMinutes();
|
|
899
|
-
if (startHour === hour && endHour !== hour) {
|
|
900
|
-
setRangeData(minutes, startMinute, 60, true);
|
|
901
|
-
} else if (startHour === hour && endHour === hour) {
|
|
902
|
-
setRangeData(minutes, startMinute, endMinute + 1, true);
|
|
903
|
-
} else if (startHour !== hour && endHour === hour) {
|
|
904
|
-
setRangeData(minutes, 0, endMinute + 1, true);
|
|
905
|
-
} else if (startHour < hour && endHour > hour) {
|
|
906
|
-
setRangeData(minutes, 0, 60, true);
|
|
907
|
-
}
|
|
908
|
-
});
|
|
909
|
-
} else {
|
|
910
|
-
setRangeData(minutes, 0, 60, true);
|
|
911
|
-
}
|
|
912
|
-
return minutes;
|
|
913
|
-
};
|
|
914
|
-
const range = function(n) {
|
|
915
|
-
return Array.apply(null, {
|
|
916
|
-
length: n
|
|
917
|
-
}).map((_, n2) => n2);
|
|
918
|
-
};
|
|
919
|
-
const modifyDate = function(date2, y, m, d) {
|
|
920
|
-
return new Date(y, m, d, date2.getHours(), date2.getMinutes(), date2.getSeconds(), date2.getMilliseconds());
|
|
921
|
-
};
|
|
922
|
-
const modifyTime = function(date2, h, m, s) {
|
|
923
|
-
return new Date(date2.getFullYear(), date2.getMonth(), date2.getDate(), h, m, s, date2.getMilliseconds());
|
|
924
|
-
};
|
|
925
|
-
const modifyWithTimeString = (date2, time) => {
|
|
926
|
-
if (date2 == null || !time) {
|
|
927
|
-
return date2;
|
|
928
|
-
}
|
|
929
|
-
time = parseDate(time, "HH:mm:ss");
|
|
930
|
-
return modifyTime(date2, time.getHours(), time.getMinutes(), time.getSeconds());
|
|
931
|
-
};
|
|
932
|
-
const clearTime = function(date2) {
|
|
933
|
-
return new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
|
|
934
|
-
};
|
|
935
|
-
const clearMilliseconds = function(date2) {
|
|
936
|
-
return new Date(date2.getFullYear(), date2.getMonth(), date2.getDate(), date2.getHours(), date2.getMinutes(), date2.getSeconds(), 0);
|
|
937
|
-
};
|
|
938
|
-
const limitTimeRange = function(date2, ranges, format2 = "HH:mm:ss") {
|
|
939
|
-
if (ranges.length === 0)
|
|
940
|
-
return date2;
|
|
941
|
-
const normalizeDate = (date3) => fecha.parse(fecha.format(date3, format2), format2);
|
|
942
|
-
const ndate = normalizeDate(date2);
|
|
943
|
-
const nranges = ranges.map((range2) => range2.map(normalizeDate));
|
|
944
|
-
if (nranges.some((nrange) => ndate >= nrange[0] && ndate <= nrange[1]))
|
|
945
|
-
return date2;
|
|
946
|
-
let minDate = nranges[0][0];
|
|
947
|
-
let maxDate = nranges[0][0];
|
|
948
|
-
nranges.forEach((nrange) => {
|
|
949
|
-
minDate = new Date(Math.min(nrange[0], minDate));
|
|
950
|
-
maxDate = new Date(Math.max(nrange[1], minDate));
|
|
951
|
-
});
|
|
952
|
-
const ret = ndate < minDate ? minDate : maxDate;
|
|
953
|
-
return modifyDate(ret, date2.getFullYear(), date2.getMonth(), date2.getDate());
|
|
954
|
-
};
|
|
955
|
-
const timeWithinRange = function(date2, selectableRange, format2) {
|
|
956
|
-
const limitedDate = limitTimeRange(date2, selectableRange, format2);
|
|
957
|
-
return limitedDate.getTime() === date2.getTime();
|
|
958
|
-
};
|
|
959
|
-
const changeYearMonthAndClampDate = function(date2, year, month) {
|
|
960
|
-
const monthDate = Math.min(date2.getDate(), getDayCountOfMonth(year, month));
|
|
961
|
-
return modifyDate(date2, year, month, monthDate);
|
|
962
|
-
};
|
|
963
|
-
const prevMonth = function(date2) {
|
|
964
|
-
const year = date2.getFullYear();
|
|
965
|
-
const month = date2.getMonth();
|
|
966
|
-
return month === 0 ? changeYearMonthAndClampDate(date2, year - 1, 11) : changeYearMonthAndClampDate(date2, year, month - 1);
|
|
967
|
-
};
|
|
968
|
-
const nextMonth = function(date2) {
|
|
969
|
-
const year = date2.getFullYear();
|
|
970
|
-
const month = date2.getMonth();
|
|
971
|
-
return month === 11 ? changeYearMonthAndClampDate(date2, year + 1, 0) : changeYearMonthAndClampDate(date2, year, month + 1);
|
|
972
|
-
};
|
|
973
|
-
const prevYear = function(date2, amount = 1) {
|
|
974
|
-
const year = date2.getFullYear();
|
|
975
|
-
const month = date2.getMonth();
|
|
976
|
-
return changeYearMonthAndClampDate(date2, year - amount, month);
|
|
977
|
-
};
|
|
978
|
-
const nextYear = function(date2, amount = 1) {
|
|
979
|
-
const year = date2.getFullYear();
|
|
980
|
-
const month = date2.getMonth();
|
|
981
|
-
return changeYearMonthAndClampDate(date2, year + amount, month);
|
|
982
|
-
};
|
|
983
|
-
const extractDateFormat = function(format2) {
|
|
984
|
-
return format2.replace(/\W?m{1,2}|\W?ZZ/g, "").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, "").trim();
|
|
985
|
-
};
|
|
986
|
-
const extractTimeFormat = function(format2) {
|
|
987
|
-
return format2.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g, "").trim();
|
|
988
|
-
};
|
|
989
179
|
function merge(target) {
|
|
990
180
|
for (let i = 1, j = arguments.length; i < j; i++) {
|
|
991
181
|
let source = arguments[i] || {};
|
|
@@ -1167,6 +357,10 @@ if (!Vue.prototype.$isServer) {
|
|
|
1167
357
|
}
|
|
1168
358
|
});
|
|
1169
359
|
}
|
|
360
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
361
|
+
function getDefaultExportFromCjs(x) {
|
|
362
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
363
|
+
}
|
|
1170
364
|
var popper$1 = { exports: {} };
|
|
1171
365
|
/**
|
|
1172
366
|
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
|
@@ -1455,7 +649,7 @@ var popper$1 = { exports: {} };
|
|
|
1455
649
|
modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));
|
|
1456
650
|
}
|
|
1457
651
|
modifiersToRun.forEach((function(modifier) {
|
|
1458
|
-
if (
|
|
652
|
+
if (isFunction(modifier)) {
|
|
1459
653
|
data = modifier.call(this, data);
|
|
1460
654
|
}
|
|
1461
655
|
}).bind(this));
|
|
@@ -1767,7 +961,7 @@ var popper$1 = { exports: {} };
|
|
|
1767
961
|
element.style[prop] = styles[prop] + unit;
|
|
1768
962
|
});
|
|
1769
963
|
}
|
|
1770
|
-
function
|
|
964
|
+
function isFunction(functionToCheck) {
|
|
1771
965
|
var getType = {};
|
|
1772
966
|
return functionToCheck && getType.toString.call(functionToCheck) === "[object Function]";
|
|
1773
967
|
}
|
|
@@ -1784,8 +978,8 @@ var popper$1 = { exports: {} };
|
|
|
1784
978
|
}
|
|
1785
979
|
function getBoundingClientRect(element) {
|
|
1786
980
|
var rect = element.getBoundingClientRect();
|
|
1787
|
-
var
|
|
1788
|
-
var rectTop =
|
|
981
|
+
var isIE = navigator.userAgent.indexOf("MSIE") != -1;
|
|
982
|
+
var rectTop = isIE && element.tagName === "HTML" ? -element.scrollTop : rect.top;
|
|
1789
983
|
return {
|
|
1790
984
|
left: rect.left,
|
|
1791
985
|
top: rectTop,
|
|
@@ -2089,34 +1283,34 @@ const DEFAULT_FORMATS = {
|
|
|
2089
1283
|
year: "yyyy"
|
|
2090
1284
|
};
|
|
2091
1285
|
const HAVE_TRIGGER_TYPES = ["date", "datetime", "time", "time-select", "week", "month", "year", "daterange", "monthrange", "timerange", "datetimerange", "dates"];
|
|
2092
|
-
const DATE_FORMATTER = function(value,
|
|
2093
|
-
if (
|
|
1286
|
+
const DATE_FORMATTER = function(value, format) {
|
|
1287
|
+
if (format === "timestamp")
|
|
2094
1288
|
return value.getTime();
|
|
2095
|
-
return formatDate(value,
|
|
1289
|
+
return dateUtil.formatDate(value, format);
|
|
2096
1290
|
};
|
|
2097
|
-
const DATE_PARSER = function(text,
|
|
2098
|
-
if (
|
|
1291
|
+
const DATE_PARSER = function(text, format) {
|
|
1292
|
+
if (format === "timestamp")
|
|
2099
1293
|
return new Date(Number(text));
|
|
2100
|
-
return parseDate(text,
|
|
1294
|
+
return dateUtil.parseDate(text, format);
|
|
2101
1295
|
};
|
|
2102
|
-
const RANGE_FORMATTER = function(value,
|
|
1296
|
+
const RANGE_FORMATTER = function(value, format) {
|
|
2103
1297
|
if (Array.isArray(value) && value.length === 2) {
|
|
2104
1298
|
const start = value[0];
|
|
2105
1299
|
const end = value[1];
|
|
2106
1300
|
if (start && end) {
|
|
2107
|
-
return [DATE_FORMATTER(start,
|
|
1301
|
+
return [DATE_FORMATTER(start, format), DATE_FORMATTER(end, format)];
|
|
2108
1302
|
}
|
|
2109
1303
|
}
|
|
2110
1304
|
return "";
|
|
2111
1305
|
};
|
|
2112
|
-
const RANGE_PARSER = function(array,
|
|
1306
|
+
const RANGE_PARSER = function(array, format, separator) {
|
|
2113
1307
|
if (!Array.isArray(array)) {
|
|
2114
1308
|
array = array.split(separator);
|
|
2115
1309
|
}
|
|
2116
1310
|
if (array.length === 2) {
|
|
2117
1311
|
const range1 = array[0];
|
|
2118
1312
|
const range2 = array[1];
|
|
2119
|
-
return [DATE_PARSER(range1,
|
|
1313
|
+
return [DATE_PARSER(range1, format), DATE_PARSER(range2, format)];
|
|
2120
1314
|
}
|
|
2121
1315
|
return [];
|
|
2122
1316
|
};
|
|
@@ -2134,20 +1328,20 @@ const TYPE_VALUE_RESOLVER_MAP = {
|
|
|
2134
1328
|
}
|
|
2135
1329
|
},
|
|
2136
1330
|
week: {
|
|
2137
|
-
formatter(value,
|
|
2138
|
-
const week = getWeekNumber(value);
|
|
1331
|
+
formatter(value, format) {
|
|
1332
|
+
const week = dateUtil.getWeekNumber(value);
|
|
2139
1333
|
const month = value.getMonth();
|
|
2140
1334
|
const trueDate = new Date(value);
|
|
2141
1335
|
if (week === 1 && month === 11) {
|
|
2142
1336
|
trueDate.setHours(0, 0, 0, 0);
|
|
2143
1337
|
trueDate.setDate(trueDate.getDate() + 3 - (trueDate.getDay() + 6) % 7);
|
|
2144
1338
|
}
|
|
2145
|
-
let
|
|
2146
|
-
|
|
2147
|
-
return
|
|
1339
|
+
let date = dateUtil.formatDate(trueDate, format);
|
|
1340
|
+
date = /WW/.test(date) ? date.replace(/WW/, week < 10 ? "0" + week : week) : date.replace(/W/, week);
|
|
1341
|
+
return date;
|
|
2148
1342
|
},
|
|
2149
|
-
parser(text,
|
|
2150
|
-
return TYPE_VALUE_RESOLVER_MAP.date.parser(text,
|
|
1343
|
+
parser(text, format) {
|
|
1344
|
+
return TYPE_VALUE_RESOLVER_MAP.date.parser(text, format);
|
|
2151
1345
|
}
|
|
2152
1346
|
},
|
|
2153
1347
|
date: {
|
|
@@ -2202,11 +1396,11 @@ const TYPE_VALUE_RESOLVER_MAP = {
|
|
|
2202
1396
|
}
|
|
2203
1397
|
},
|
|
2204
1398
|
dates: {
|
|
2205
|
-
formatter(value,
|
|
2206
|
-
return value.map((
|
|
1399
|
+
formatter(value, format) {
|
|
1400
|
+
return value.map((date) => DATE_FORMATTER(date, format));
|
|
2207
1401
|
},
|
|
2208
|
-
parser(value,
|
|
2209
|
-
return (typeof value === "string" ? value.split(", ") : value).map((
|
|
1402
|
+
parser(value, format) {
|
|
1403
|
+
return (typeof value === "string" ? value.split(", ") : value).map((date) => date instanceof Date ? date : DATE_PARSER(date, format));
|
|
2210
1404
|
}
|
|
2211
1405
|
}
|
|
2212
1406
|
};
|
|
@@ -2219,15 +1413,15 @@ const parseAsFormatAndType = (value, customFormat, type, rangeSeparator = "-") =
|
|
|
2219
1413
|
if (!value)
|
|
2220
1414
|
return null;
|
|
2221
1415
|
const parser = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP["default"]).parser;
|
|
2222
|
-
const
|
|
2223
|
-
return parser(value,
|
|
1416
|
+
const format = customFormat || DEFAULT_FORMATS[type];
|
|
1417
|
+
return parser(value, format, rangeSeparator);
|
|
2224
1418
|
};
|
|
2225
1419
|
const formatAsFormatAndType = (value, customFormat, type) => {
|
|
2226
1420
|
if (!value)
|
|
2227
1421
|
return null;
|
|
2228
1422
|
const formatter = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP["default"]).formatter;
|
|
2229
|
-
const
|
|
2230
|
-
return formatter(value,
|
|
1423
|
+
const format = customFormat || DEFAULT_FORMATS[type];
|
|
1424
|
+
return formatter(value, format);
|
|
2231
1425
|
};
|
|
2232
1426
|
const valueEquals = function(a, b) {
|
|
2233
1427
|
const dateEquals = function(a2, b2) {
|
|
@@ -2254,11 +1448,11 @@ const valueEquals = function(a, b) {
|
|
|
2254
1448
|
}
|
|
2255
1449
|
return false;
|
|
2256
1450
|
};
|
|
2257
|
-
const isString
|
|
1451
|
+
const isString = function(val) {
|
|
2258
1452
|
return typeof val === "string" || val instanceof String;
|
|
2259
1453
|
};
|
|
2260
1454
|
const validator = function(val) {
|
|
2261
|
-
return val === null || val === void 0 || isString
|
|
1455
|
+
return val === null || val === void 0 || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString);
|
|
2262
1456
|
};
|
|
2263
1457
|
const _sfc_main$9 = {
|
|
2264
1458
|
directives: {
|
|
@@ -2404,7 +1598,7 @@ const _sfc_main$9 = {
|
|
|
2404
1598
|
return this.value;
|
|
2405
1599
|
if (this.type === "time-select")
|
|
2406
1600
|
return this.value;
|
|
2407
|
-
const valueIsDateObject = isDateObject(this.value) || Array.isArray(this.value) && this.value.every(isDateObject);
|
|
1601
|
+
const valueIsDateObject = dateUtil.isDateObject(this.value) || Array.isArray(this.value) && this.value.every(dateUtil.isDateObject);
|
|
2408
1602
|
if (valueIsDateObject) {
|
|
2409
1603
|
return this.value;
|
|
2410
1604
|
}
|
|
@@ -2503,19 +1697,19 @@ const _sfc_main$9 = {
|
|
|
2503
1697
|
},
|
|
2504
1698
|
// {parse, formatTo} Value deals maps component value with internal Date
|
|
2505
1699
|
parseValue(value) {
|
|
2506
|
-
const isParsed = isDateObject(value) || Array.isArray(value) && value.every(isDateObject);
|
|
1700
|
+
const isParsed = dateUtil.isDateObject(value) || Array.isArray(value) && value.every(dateUtil.isDateObject);
|
|
2507
1701
|
if (this.valueFormat && !isParsed) {
|
|
2508
1702
|
return parseAsFormatAndType(value, this.valueFormat, this.type, this.rangeSeparator) || value;
|
|
2509
1703
|
} else {
|
|
2510
1704
|
return value;
|
|
2511
1705
|
}
|
|
2512
1706
|
},
|
|
2513
|
-
formatToValue(
|
|
2514
|
-
const isFormattable = isDateObject(
|
|
1707
|
+
formatToValue(date) {
|
|
1708
|
+
const isFormattable = dateUtil.isDateObject(date) || Array.isArray(date) && date.every(dateUtil.isDateObject);
|
|
2515
1709
|
if (this.valueFormat && isFormattable) {
|
|
2516
|
-
return formatAsFormatAndType(
|
|
1710
|
+
return formatAsFormatAndType(date, this.valueFormat, this.type, this.rangeSeparator);
|
|
2517
1711
|
} else {
|
|
2518
|
-
return
|
|
1712
|
+
return date;
|
|
2519
1713
|
}
|
|
2520
1714
|
},
|
|
2521
1715
|
// {parse, formatTo} String deals with user input
|
|
@@ -2712,17 +1906,17 @@ const _sfc_main$9 = {
|
|
|
2712
1906
|
this.picker.selectionMode = this.selectionMode;
|
|
2713
1907
|
this.picker.unlinkPanels = this.unlinkPanels;
|
|
2714
1908
|
this.picker.arrowControl = this.arrowControl || this.timeArrowControl || false;
|
|
2715
|
-
this.$watch("format", (
|
|
2716
|
-
this.picker.format =
|
|
1909
|
+
this.$watch("format", (format) => {
|
|
1910
|
+
this.picker.format = format;
|
|
2717
1911
|
});
|
|
2718
1912
|
const updateOptions = () => {
|
|
2719
1913
|
const options = this.pickerOptions;
|
|
2720
1914
|
if (options && options.selectableRange) {
|
|
2721
1915
|
let ranges = options.selectableRange;
|
|
2722
1916
|
const parser = TYPE_VALUE_RESOLVER_MAP.datetimerange.parser;
|
|
2723
|
-
const
|
|
1917
|
+
const format = DEFAULT_FORMATS.timerange;
|
|
2724
1918
|
ranges = Array.isArray(ranges) ? ranges : [ranges];
|
|
2725
|
-
this.picker.selectableRange = ranges.map((
|
|
1919
|
+
this.picker.selectableRange = ranges.map((range) => parser(range, format, this.rangeSeparator));
|
|
2726
1920
|
}
|
|
2727
1921
|
for (const option in options) {
|
|
2728
1922
|
if (options.hasOwnProperty(option) && // 忽略 time-picker 的该配置项
|
|
@@ -2741,10 +1935,10 @@ const _sfc_main$9 = {
|
|
|
2741
1935
|
this.$el.appendChild(this.picker.$el);
|
|
2742
1936
|
this.picker.resetView && this.picker.resetView();
|
|
2743
1937
|
this.picker.$on("dodestroy", this.doDestroy);
|
|
2744
|
-
this.picker.$on("pick", (
|
|
1938
|
+
this.picker.$on("pick", (date = "", visible = false) => {
|
|
2745
1939
|
this.userInput = null;
|
|
2746
1940
|
this.pickerVisible = this.picker.visible = visible;
|
|
2747
|
-
this.emitInput(
|
|
1941
|
+
this.emitInput(date);
|
|
2748
1942
|
this.picker.resetView && this.picker.resetView();
|
|
2749
1943
|
});
|
|
2750
1944
|
this.picker.$on("select-range", (start, end, pos) => {
|
|
@@ -2922,495 +2116,6 @@ var _sfc_render$9 = function render() {
|
|
|
2922
2116
|
var _sfc_staticRenderFns$9 = [];
|
|
2923
2117
|
var __component__$9 = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(_sfc_main$9, _sfc_render$9, _sfc_staticRenderFns$9, false, null, null, null, null);
|
|
2924
2118
|
const Picker = __component__$9.exports;
|
|
2925
|
-
var locale = {};
|
|
2926
|
-
var zhCN = {};
|
|
2927
|
-
zhCN.__esModule = true;
|
|
2928
|
-
zhCN.default = {
|
|
2929
|
-
el: {
|
|
2930
|
-
colorpicker: {
|
|
2931
|
-
confirm: "确定",
|
|
2932
|
-
clear: "清空"
|
|
2933
|
-
},
|
|
2934
|
-
datepicker: {
|
|
2935
|
-
now: "此刻",
|
|
2936
|
-
today: "今天",
|
|
2937
|
-
cancel: "取消",
|
|
2938
|
-
clear: "清空",
|
|
2939
|
-
confirm: "确定",
|
|
2940
|
-
selectDate: "选择日期",
|
|
2941
|
-
selectTime: "选择时间",
|
|
2942
|
-
startDate: "开始日期",
|
|
2943
|
-
startTime: "开始时间",
|
|
2944
|
-
endDate: "结束日期",
|
|
2945
|
-
endTime: "结束时间",
|
|
2946
|
-
prevYear: "前一年",
|
|
2947
|
-
nextYear: "后一年",
|
|
2948
|
-
prevMonth: "上个月",
|
|
2949
|
-
nextMonth: "下个月",
|
|
2950
|
-
year: "年",
|
|
2951
|
-
month1: "1 月",
|
|
2952
|
-
month2: "2 月",
|
|
2953
|
-
month3: "3 月",
|
|
2954
|
-
month4: "4 月",
|
|
2955
|
-
month5: "5 月",
|
|
2956
|
-
month6: "6 月",
|
|
2957
|
-
month7: "7 月",
|
|
2958
|
-
month8: "8 月",
|
|
2959
|
-
month9: "9 月",
|
|
2960
|
-
month10: "10 月",
|
|
2961
|
-
month11: "11 月",
|
|
2962
|
-
month12: "12 月",
|
|
2963
|
-
// week: '周次',
|
|
2964
|
-
weeks: {
|
|
2965
|
-
sun: "日",
|
|
2966
|
-
mon: "一",
|
|
2967
|
-
tue: "二",
|
|
2968
|
-
wed: "三",
|
|
2969
|
-
thu: "四",
|
|
2970
|
-
fri: "五",
|
|
2971
|
-
sat: "六"
|
|
2972
|
-
},
|
|
2973
|
-
months: {
|
|
2974
|
-
jan: "一月",
|
|
2975
|
-
feb: "二月",
|
|
2976
|
-
mar: "三月",
|
|
2977
|
-
apr: "四月",
|
|
2978
|
-
may: "五月",
|
|
2979
|
-
jun: "六月",
|
|
2980
|
-
jul: "七月",
|
|
2981
|
-
aug: "八月",
|
|
2982
|
-
sep: "九月",
|
|
2983
|
-
oct: "十月",
|
|
2984
|
-
nov: "十一月",
|
|
2985
|
-
dec: "十二月"
|
|
2986
|
-
}
|
|
2987
|
-
},
|
|
2988
|
-
select: {
|
|
2989
|
-
loading: "加载中",
|
|
2990
|
-
noMatch: "无匹配数据",
|
|
2991
|
-
noData: "无数据",
|
|
2992
|
-
placeholder: "请选择"
|
|
2993
|
-
},
|
|
2994
|
-
cascader: {
|
|
2995
|
-
noMatch: "无匹配数据",
|
|
2996
|
-
loading: "加载中",
|
|
2997
|
-
placeholder: "请选择",
|
|
2998
|
-
noData: "暂无数据"
|
|
2999
|
-
},
|
|
3000
|
-
pagination: {
|
|
3001
|
-
goto: "前往",
|
|
3002
|
-
pagesize: "条/页",
|
|
3003
|
-
total: "共 {total} 条",
|
|
3004
|
-
pageClassifier: "页"
|
|
3005
|
-
},
|
|
3006
|
-
messagebox: {
|
|
3007
|
-
title: "提示",
|
|
3008
|
-
confirm: "确定",
|
|
3009
|
-
cancel: "取消",
|
|
3010
|
-
error: "输入的数据不合法!"
|
|
3011
|
-
},
|
|
3012
|
-
upload: {
|
|
3013
|
-
deleteTip: "按 delete 键可删除",
|
|
3014
|
-
delete: "删除",
|
|
3015
|
-
preview: "查看图片",
|
|
3016
|
-
continue: "继续上传"
|
|
3017
|
-
},
|
|
3018
|
-
table: {
|
|
3019
|
-
emptyText: "暂无数据",
|
|
3020
|
-
confirmFilter: "筛选",
|
|
3021
|
-
resetFilter: "重置",
|
|
3022
|
-
clearFilter: "全部",
|
|
3023
|
-
sumText: "合计"
|
|
3024
|
-
},
|
|
3025
|
-
tree: {
|
|
3026
|
-
emptyText: "暂无数据"
|
|
3027
|
-
},
|
|
3028
|
-
transfer: {
|
|
3029
|
-
noMatch: "无匹配数据",
|
|
3030
|
-
noData: "无数据",
|
|
3031
|
-
titles: ["列表 1", "列表 2"],
|
|
3032
|
-
filterPlaceholder: "请输入搜索内容",
|
|
3033
|
-
noCheckedFormat: "共 {total} 项",
|
|
3034
|
-
hasCheckedFormat: "已选 {checked}/{total} 项"
|
|
3035
|
-
},
|
|
3036
|
-
image: {
|
|
3037
|
-
error: "加载失败"
|
|
3038
|
-
},
|
|
3039
|
-
pageHeader: {
|
|
3040
|
-
title: "返回"
|
|
3041
|
-
},
|
|
3042
|
-
popconfirm: {
|
|
3043
|
-
confirmButtonText: "确定",
|
|
3044
|
-
cancelButtonText: "取消"
|
|
3045
|
-
}
|
|
3046
|
-
}
|
|
3047
|
-
};
|
|
3048
|
-
const require$$2 = /* @__PURE__ */ getAugmentedNamespace(es);
|
|
3049
|
-
var format$1 = {};
|
|
3050
|
-
var util = {};
|
|
3051
|
-
var types = {};
|
|
3052
|
-
types.__esModule = true;
|
|
3053
|
-
types.isString = isString;
|
|
3054
|
-
types.isObject = isObject;
|
|
3055
|
-
types.isHtmlElement = isHtmlElement;
|
|
3056
|
-
function isString(obj) {
|
|
3057
|
-
return Object.prototype.toString.call(obj) === "[object String]";
|
|
3058
|
-
}
|
|
3059
|
-
function isObject(obj) {
|
|
3060
|
-
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
3061
|
-
}
|
|
3062
|
-
function isHtmlElement(node) {
|
|
3063
|
-
return node && node.nodeType === Node.ELEMENT_NODE;
|
|
3064
|
-
}
|
|
3065
|
-
types.isFunction = function isFunction(functionToCheck) {
|
|
3066
|
-
var getType = {};
|
|
3067
|
-
return functionToCheck && getType.toString.call(functionToCheck) === "[object Function]";
|
|
3068
|
-
};
|
|
3069
|
-
types.isUndefined = function isUndefined(val) {
|
|
3070
|
-
return val === void 0;
|
|
3071
|
-
};
|
|
3072
|
-
types.isDefined = function isDefined(val) {
|
|
3073
|
-
return val !== void 0 && val !== null;
|
|
3074
|
-
};
|
|
3075
|
-
util.__esModule = true;
|
|
3076
|
-
util.isEmpty = util.isEqual = util.arrayEquals = util.looseEqual = util.capitalize = util.kebabCase = util.autoprefixer = util.isFirefox = util.isEdge = util.isIE = util.coerceTruthyValueToArray = util.arrayFind = util.arrayFindIndex = util.escapeRegexpString = util.valueEquals = util.generateId = util.getValueByPath = void 0;
|
|
3077
|
-
var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
|
|
3078
|
-
return typeof obj;
|
|
3079
|
-
} : function(obj) {
|
|
3080
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
3081
|
-
};
|
|
3082
|
-
util.noop = noop;
|
|
3083
|
-
util.hasOwn = hasOwn;
|
|
3084
|
-
util.toObject = toObject;
|
|
3085
|
-
util.getPropByPath = getPropByPath;
|
|
3086
|
-
util.rafThrottle = rafThrottle;
|
|
3087
|
-
util.objToArray = objToArray;
|
|
3088
|
-
var _vue$1 = Vue;
|
|
3089
|
-
var _vue2$1 = _interopRequireDefault$1(_vue$1);
|
|
3090
|
-
var _types = types;
|
|
3091
|
-
function _interopRequireDefault$1(obj) {
|
|
3092
|
-
return obj && obj.__esModule ? obj : {
|
|
3093
|
-
default: obj
|
|
3094
|
-
};
|
|
3095
|
-
}
|
|
3096
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
3097
|
-
function noop() {
|
|
3098
|
-
}
|
|
3099
|
-
function hasOwn(obj, key) {
|
|
3100
|
-
return hasOwnProperty.call(obj, key);
|
|
3101
|
-
}
|
|
3102
|
-
function extend(to, _from) {
|
|
3103
|
-
for (var key in _from) {
|
|
3104
|
-
to[key] = _from[key];
|
|
3105
|
-
}
|
|
3106
|
-
return to;
|
|
3107
|
-
}
|
|
3108
|
-
function toObject(arr) {
|
|
3109
|
-
var res = {};
|
|
3110
|
-
for (var i = 0; i < arr.length; i++) {
|
|
3111
|
-
if (arr[i]) {
|
|
3112
|
-
extend(res, arr[i]);
|
|
3113
|
-
}
|
|
3114
|
-
}
|
|
3115
|
-
return res;
|
|
3116
|
-
}
|
|
3117
|
-
util.getValueByPath = function getValueByPath(object, prop) {
|
|
3118
|
-
prop = prop || "";
|
|
3119
|
-
var paths = prop.split(".");
|
|
3120
|
-
var current = object;
|
|
3121
|
-
var result = null;
|
|
3122
|
-
for (var i = 0, j = paths.length; i < j; i++) {
|
|
3123
|
-
var path = paths[i];
|
|
3124
|
-
if (!current)
|
|
3125
|
-
break;
|
|
3126
|
-
if (i === j - 1) {
|
|
3127
|
-
result = current[path];
|
|
3128
|
-
break;
|
|
3129
|
-
}
|
|
3130
|
-
current = current[path];
|
|
3131
|
-
}
|
|
3132
|
-
return result;
|
|
3133
|
-
};
|
|
3134
|
-
function getPropByPath(obj, path, strict) {
|
|
3135
|
-
var tempObj = obj;
|
|
3136
|
-
path = path.replace(/\[(\w+)\]/g, ".$1");
|
|
3137
|
-
path = path.replace(/^\./, "");
|
|
3138
|
-
var keyArr = path.split(".");
|
|
3139
|
-
var i = 0;
|
|
3140
|
-
for (var len = keyArr.length; i < len - 1; ++i) {
|
|
3141
|
-
if (!tempObj && !strict)
|
|
3142
|
-
break;
|
|
3143
|
-
var key = keyArr[i];
|
|
3144
|
-
if (key in tempObj) {
|
|
3145
|
-
tempObj = tempObj[key];
|
|
3146
|
-
} else {
|
|
3147
|
-
if (strict) {
|
|
3148
|
-
throw new Error("please transfer a valid prop path to form item!");
|
|
3149
|
-
}
|
|
3150
|
-
break;
|
|
3151
|
-
}
|
|
3152
|
-
}
|
|
3153
|
-
return {
|
|
3154
|
-
o: tempObj,
|
|
3155
|
-
k: keyArr[i],
|
|
3156
|
-
v: tempObj ? tempObj[keyArr[i]] : null
|
|
3157
|
-
};
|
|
3158
|
-
}
|
|
3159
|
-
util.generateId = function generateId() {
|
|
3160
|
-
return Math.floor(Math.random() * 1e4);
|
|
3161
|
-
};
|
|
3162
|
-
util.valueEquals = function valueEquals2(a, b) {
|
|
3163
|
-
if (a === b)
|
|
3164
|
-
return true;
|
|
3165
|
-
if (!(a instanceof Array))
|
|
3166
|
-
return false;
|
|
3167
|
-
if (!(b instanceof Array))
|
|
3168
|
-
return false;
|
|
3169
|
-
if (a.length !== b.length)
|
|
3170
|
-
return false;
|
|
3171
|
-
for (var i = 0; i !== a.length; ++i) {
|
|
3172
|
-
if (a[i] !== b[i])
|
|
3173
|
-
return false;
|
|
3174
|
-
}
|
|
3175
|
-
return true;
|
|
3176
|
-
};
|
|
3177
|
-
util.escapeRegexpString = function escapeRegexpString() {
|
|
3178
|
-
var value = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
3179
|
-
return String(value).replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
|
|
3180
|
-
};
|
|
3181
|
-
var arrayFindIndex = util.arrayFindIndex = function arrayFindIndex2(arr, pred) {
|
|
3182
|
-
for (var i = 0; i !== arr.length; ++i) {
|
|
3183
|
-
if (pred(arr[i])) {
|
|
3184
|
-
return i;
|
|
3185
|
-
}
|
|
3186
|
-
}
|
|
3187
|
-
return -1;
|
|
3188
|
-
};
|
|
3189
|
-
util.arrayFind = function arrayFind2(arr, pred) {
|
|
3190
|
-
var idx = arrayFindIndex(arr, pred);
|
|
3191
|
-
return idx !== -1 ? arr[idx] : void 0;
|
|
3192
|
-
};
|
|
3193
|
-
util.coerceTruthyValueToArray = function coerceTruthyValueToArray2(val) {
|
|
3194
|
-
if (Array.isArray(val)) {
|
|
3195
|
-
return val;
|
|
3196
|
-
} else if (val) {
|
|
3197
|
-
return [val];
|
|
3198
|
-
} else {
|
|
3199
|
-
return [];
|
|
3200
|
-
}
|
|
3201
|
-
};
|
|
3202
|
-
util.isIE = function isIE() {
|
|
3203
|
-
return !_vue2$1.default.prototype.$isServer && !isNaN(Number(document.documentMode));
|
|
3204
|
-
};
|
|
3205
|
-
util.isEdge = function isEdge() {
|
|
3206
|
-
return !_vue2$1.default.prototype.$isServer && navigator.userAgent.indexOf("Edge") > -1;
|
|
3207
|
-
};
|
|
3208
|
-
util.isFirefox = function isFirefox() {
|
|
3209
|
-
return !_vue2$1.default.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
|
|
3210
|
-
};
|
|
3211
|
-
util.autoprefixer = function autoprefixer(style) {
|
|
3212
|
-
if ((typeof style === "undefined" ? "undefined" : _typeof$1(style)) !== "object")
|
|
3213
|
-
return style;
|
|
3214
|
-
var rules = ["transform", "transition", "animation"];
|
|
3215
|
-
var prefixes = ["ms-", "webkit-"];
|
|
3216
|
-
rules.forEach(function(rule) {
|
|
3217
|
-
var value = style[rule];
|
|
3218
|
-
if (rule && value) {
|
|
3219
|
-
prefixes.forEach(function(prefix) {
|
|
3220
|
-
style[prefix + rule] = value;
|
|
3221
|
-
});
|
|
3222
|
-
}
|
|
3223
|
-
});
|
|
3224
|
-
return style;
|
|
3225
|
-
};
|
|
3226
|
-
util.kebabCase = function kebabCase(str) {
|
|
3227
|
-
var hyphenateRE = /([^-])([A-Z])/g;
|
|
3228
|
-
return str.replace(hyphenateRE, "$1-$2").replace(hyphenateRE, "$1-$2").toLowerCase();
|
|
3229
|
-
};
|
|
3230
|
-
util.capitalize = function capitalize(str) {
|
|
3231
|
-
if (!(0, _types.isString)(str))
|
|
3232
|
-
return str;
|
|
3233
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
3234
|
-
};
|
|
3235
|
-
var looseEqual = util.looseEqual = function looseEqual2(a, b) {
|
|
3236
|
-
var isObjectA = (0, _types.isObject)(a);
|
|
3237
|
-
var isObjectB = (0, _types.isObject)(b);
|
|
3238
|
-
if (isObjectA && isObjectB) {
|
|
3239
|
-
return JSON.stringify(a) === JSON.stringify(b);
|
|
3240
|
-
} else if (!isObjectA && !isObjectB) {
|
|
3241
|
-
return String(a) === String(b);
|
|
3242
|
-
} else {
|
|
3243
|
-
return false;
|
|
3244
|
-
}
|
|
3245
|
-
};
|
|
3246
|
-
var arrayEquals = util.arrayEquals = function arrayEquals2(arrayA, arrayB) {
|
|
3247
|
-
arrayA = arrayA || [];
|
|
3248
|
-
arrayB = arrayB || [];
|
|
3249
|
-
if (arrayA.length !== arrayB.length) {
|
|
3250
|
-
return false;
|
|
3251
|
-
}
|
|
3252
|
-
for (var i = 0; i < arrayA.length; i++) {
|
|
3253
|
-
if (!looseEqual(arrayA[i], arrayB[i])) {
|
|
3254
|
-
return false;
|
|
3255
|
-
}
|
|
3256
|
-
}
|
|
3257
|
-
return true;
|
|
3258
|
-
};
|
|
3259
|
-
util.isEqual = function isEqual(value1, value2) {
|
|
3260
|
-
if (Array.isArray(value1) && Array.isArray(value2)) {
|
|
3261
|
-
return arrayEquals(value1, value2);
|
|
3262
|
-
}
|
|
3263
|
-
return looseEqual(value1, value2);
|
|
3264
|
-
};
|
|
3265
|
-
var isEmpty = util.isEmpty = function isEmpty2(val) {
|
|
3266
|
-
if (val == null)
|
|
3267
|
-
return true;
|
|
3268
|
-
if (typeof val === "boolean")
|
|
3269
|
-
return false;
|
|
3270
|
-
if (typeof val === "number")
|
|
3271
|
-
return !val;
|
|
3272
|
-
if (val instanceof Error)
|
|
3273
|
-
return val.message === "";
|
|
3274
|
-
switch (Object.prototype.toString.call(val)) {
|
|
3275
|
-
case "[object String]":
|
|
3276
|
-
case "[object Array]":
|
|
3277
|
-
return !val.length;
|
|
3278
|
-
case "[object File]":
|
|
3279
|
-
case "[object Map]":
|
|
3280
|
-
case "[object Set]": {
|
|
3281
|
-
return !val.size;
|
|
3282
|
-
}
|
|
3283
|
-
case "[object Object]": {
|
|
3284
|
-
return !Object.keys(val).length;
|
|
3285
|
-
}
|
|
3286
|
-
}
|
|
3287
|
-
return false;
|
|
3288
|
-
};
|
|
3289
|
-
function rafThrottle(fn) {
|
|
3290
|
-
var locked = false;
|
|
3291
|
-
return function() {
|
|
3292
|
-
var _this = this;
|
|
3293
|
-
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
3294
|
-
args[_key] = arguments[_key];
|
|
3295
|
-
}
|
|
3296
|
-
if (locked)
|
|
3297
|
-
return;
|
|
3298
|
-
locked = true;
|
|
3299
|
-
window.requestAnimationFrame(function(_) {
|
|
3300
|
-
fn.apply(_this, args);
|
|
3301
|
-
locked = false;
|
|
3302
|
-
});
|
|
3303
|
-
};
|
|
3304
|
-
}
|
|
3305
|
-
function objToArray(obj) {
|
|
3306
|
-
if (Array.isArray(obj)) {
|
|
3307
|
-
return obj;
|
|
3308
|
-
}
|
|
3309
|
-
return isEmpty(obj) ? [] : [obj];
|
|
3310
|
-
}
|
|
3311
|
-
format$1.__esModule = true;
|
|
3312
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
|
|
3313
|
-
return typeof obj;
|
|
3314
|
-
} : function(obj) {
|
|
3315
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
3316
|
-
};
|
|
3317
|
-
format$1.default = function(Vue2) {
|
|
3318
|
-
function template(string) {
|
|
3319
|
-
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
3320
|
-
args[_key - 1] = arguments[_key];
|
|
3321
|
-
}
|
|
3322
|
-
if (args.length === 1 && _typeof(args[0]) === "object") {
|
|
3323
|
-
args = args[0];
|
|
3324
|
-
}
|
|
3325
|
-
if (!args || !args.hasOwnProperty) {
|
|
3326
|
-
args = {};
|
|
3327
|
-
}
|
|
3328
|
-
return string.replace(RE_NARGS, function(match, prefix, i, index) {
|
|
3329
|
-
var result = void 0;
|
|
3330
|
-
if (string[index - 1] === "{" && string[index + match.length] === "}") {
|
|
3331
|
-
return i;
|
|
3332
|
-
} else {
|
|
3333
|
-
result = (0, _util.hasOwn)(args, i) ? args[i] : null;
|
|
3334
|
-
if (result === null || result === void 0) {
|
|
3335
|
-
return "";
|
|
3336
|
-
}
|
|
3337
|
-
return result;
|
|
3338
|
-
}
|
|
3339
|
-
});
|
|
3340
|
-
}
|
|
3341
|
-
return template;
|
|
3342
|
-
};
|
|
3343
|
-
var _util = util;
|
|
3344
|
-
var RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
|
|
3345
|
-
locale.__esModule = true;
|
|
3346
|
-
locale.i18n = locale.use = locale.t = void 0;
|
|
3347
|
-
var _zhCN = zhCN;
|
|
3348
|
-
var _zhCN2 = _interopRequireDefault(_zhCN);
|
|
3349
|
-
var _vue = Vue;
|
|
3350
|
-
var _vue2 = _interopRequireDefault(_vue);
|
|
3351
|
-
var _deepmerge = require$$2;
|
|
3352
|
-
var _deepmerge2 = _interopRequireDefault(_deepmerge);
|
|
3353
|
-
var _format = format$1;
|
|
3354
|
-
var _format2 = _interopRequireDefault(_format);
|
|
3355
|
-
function _interopRequireDefault(obj) {
|
|
3356
|
-
return obj && obj.__esModule ? obj : {
|
|
3357
|
-
default: obj
|
|
3358
|
-
};
|
|
3359
|
-
}
|
|
3360
|
-
var format = (0, _format2.default)(_vue2.default);
|
|
3361
|
-
var lang = _zhCN2.default;
|
|
3362
|
-
var merged = false;
|
|
3363
|
-
var i18nHandler = function i18nHandler2() {
|
|
3364
|
-
var vuei18n = Object.getPrototypeOf(this || _vue2.default).$t;
|
|
3365
|
-
if (typeof vuei18n === "function" && !!_vue2.default.locale) {
|
|
3366
|
-
if (!merged) {
|
|
3367
|
-
merged = true;
|
|
3368
|
-
_vue2.default.locale(_vue2.default.config.lang, (0, _deepmerge2.default)(lang, _vue2.default.locale(_vue2.default.config.lang) || {}, {
|
|
3369
|
-
clone: true
|
|
3370
|
-
}));
|
|
3371
|
-
}
|
|
3372
|
-
return vuei18n.apply(this, arguments);
|
|
3373
|
-
}
|
|
3374
|
-
};
|
|
3375
|
-
var t = locale.t = function t2(path, options) {
|
|
3376
|
-
var value = i18nHandler.apply(this, arguments);
|
|
3377
|
-
if (value !== null && value !== void 0)
|
|
3378
|
-
return value;
|
|
3379
|
-
var array = path.split(".");
|
|
3380
|
-
var current = lang;
|
|
3381
|
-
for (var i = 0, j = array.length; i < j; i++) {
|
|
3382
|
-
var property = array[i];
|
|
3383
|
-
value = current[property];
|
|
3384
|
-
if (i === j - 1)
|
|
3385
|
-
return format(value, options);
|
|
3386
|
-
if (!value)
|
|
3387
|
-
return "";
|
|
3388
|
-
current = value;
|
|
3389
|
-
}
|
|
3390
|
-
return "";
|
|
3391
|
-
};
|
|
3392
|
-
var use = locale.use = function use2(l) {
|
|
3393
|
-
lang = l || lang;
|
|
3394
|
-
};
|
|
3395
|
-
var i18n = locale.i18n = function i18n2(fn) {
|
|
3396
|
-
i18nHandler = fn || i18nHandler;
|
|
3397
|
-
};
|
|
3398
|
-
locale.default = {
|
|
3399
|
-
use,
|
|
3400
|
-
t,
|
|
3401
|
-
i18n
|
|
3402
|
-
};
|
|
3403
|
-
var _locale = locale;
|
|
3404
|
-
var _default = {
|
|
3405
|
-
methods: {
|
|
3406
|
-
t: function t3() {
|
|
3407
|
-
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
3408
|
-
args[_key] = arguments[_key];
|
|
3409
|
-
}
|
|
3410
|
-
return _locale.t.apply(this, args);
|
|
3411
|
-
}
|
|
3412
|
-
}
|
|
3413
|
-
};
|
|
3414
2119
|
const RepeatClick = {
|
|
3415
2120
|
bind(el, binding, vnode) {
|
|
3416
2121
|
let interval = null;
|
|
@@ -3470,10 +2175,10 @@ const _sfc_main$8 = {
|
|
|
3470
2175
|
return this.date.getSeconds();
|
|
3471
2176
|
},
|
|
3472
2177
|
hoursList() {
|
|
3473
|
-
return getRangeHours(this.selectableRange);
|
|
2178
|
+
return dateUtil.getRangeHours(this.selectableRange);
|
|
3474
2179
|
},
|
|
3475
2180
|
minutesList() {
|
|
3476
|
-
return getRangeMinutes(this.selectableRange, this.hours);
|
|
2181
|
+
return dateUtil.getRangeMinutes(this.selectableRange, this.hours);
|
|
3477
2182
|
},
|
|
3478
2183
|
arrowHourList() {
|
|
3479
2184
|
const hours = this.hours;
|
|
@@ -3503,13 +2208,13 @@ const _sfc_main$8 = {
|
|
|
3503
2208
|
modifyDateField(type, value) {
|
|
3504
2209
|
switch (type) {
|
|
3505
2210
|
case "hours":
|
|
3506
|
-
this.$emit("change", modifyTime(this.date, value, this.minutes, this.seconds));
|
|
2211
|
+
this.$emit("change", dateUtil.modifyTime(this.date, value, this.minutes, this.seconds));
|
|
3507
2212
|
break;
|
|
3508
2213
|
case "minutes":
|
|
3509
|
-
this.$emit("change", modifyTime(this.date, this.hours, value, this.seconds));
|
|
2214
|
+
this.$emit("change", dateUtil.modifyTime(this.date, this.hours, value, this.seconds));
|
|
3510
2215
|
break;
|
|
3511
2216
|
case "seconds":
|
|
3512
|
-
this.$emit("change", modifyTime(this.date, this.hours, this.minutes, value));
|
|
2217
|
+
this.$emit("change", dateUtil.modifyTime(this.date, this.hours, this.minutes, value));
|
|
3513
2218
|
break;
|
|
3514
2219
|
}
|
|
3515
2220
|
},
|
|
@@ -3837,7 +2542,7 @@ const _sfc_main$7 = {
|
|
|
3837
2542
|
components: {
|
|
3838
2543
|
TimeSpinner
|
|
3839
2544
|
},
|
|
3840
|
-
mixins: [
|
|
2545
|
+
mixins: [Locale],
|
|
3841
2546
|
props: {
|
|
3842
2547
|
visible: Boolean,
|
|
3843
2548
|
timeArrowControl: Boolean
|
|
@@ -3882,13 +2587,13 @@ const _sfc_main$7 = {
|
|
|
3882
2587
|
}
|
|
3883
2588
|
},
|
|
3884
2589
|
value(newVal) {
|
|
3885
|
-
let
|
|
2590
|
+
let date;
|
|
3886
2591
|
if (newVal instanceof Date) {
|
|
3887
|
-
|
|
2592
|
+
date = dateUtil.limitTimeRange(newVal, this.selectableRange, this.format);
|
|
3888
2593
|
} else if (!newVal) {
|
|
3889
|
-
|
|
2594
|
+
date = this.defaultValue ? new Date(this.defaultValue) : /* @__PURE__ */ new Date();
|
|
3890
2595
|
}
|
|
3891
|
-
this.date =
|
|
2596
|
+
this.date = date;
|
|
3892
2597
|
if (this.visible && this.needInitAdjust) {
|
|
3893
2598
|
this.$nextTick((_) => this.adjustSpinners());
|
|
3894
2599
|
this.needInitAdjust = false;
|
|
@@ -3898,7 +2603,7 @@ const _sfc_main$7 = {
|
|
|
3898
2603
|
this.$refs.spinner.selectableRange = val;
|
|
3899
2604
|
},
|
|
3900
2605
|
defaultValue(val) {
|
|
3901
|
-
if (!isDate(this.value)) {
|
|
2606
|
+
if (!dateUtil.isDate(this.value)) {
|
|
3902
2607
|
this.date = val ? new Date(val) : /* @__PURE__ */ new Date();
|
|
3903
2608
|
}
|
|
3904
2609
|
}
|
|
@@ -3911,9 +2616,9 @@ const _sfc_main$7 = {
|
|
|
3911
2616
|
handleCancel() {
|
|
3912
2617
|
this.$emit("pick", this.oldValue, false);
|
|
3913
2618
|
},
|
|
3914
|
-
handleChange(
|
|
2619
|
+
handleChange(date) {
|
|
3915
2620
|
if (this.visible) {
|
|
3916
|
-
this.date = clearMilliseconds(
|
|
2621
|
+
this.date = dateUtil.clearMilliseconds(date);
|
|
3917
2622
|
if (this.isValidValue(this.date)) {
|
|
3918
2623
|
this.$emit("pick", this.date, true);
|
|
3919
2624
|
}
|
|
@@ -3926,8 +2631,8 @@ const _sfc_main$7 = {
|
|
|
3926
2631
|
handleConfirm(visible = false, first) {
|
|
3927
2632
|
if (first)
|
|
3928
2633
|
return;
|
|
3929
|
-
const
|
|
3930
|
-
this.$emit("pick",
|
|
2634
|
+
const date = dateUtil.clearMilliseconds(dateUtil.limitTimeRange(this.date, this.selectableRange, this.format));
|
|
2635
|
+
this.$emit("pick", date, visible, first);
|
|
3931
2636
|
},
|
|
3932
2637
|
handleKeydown(event) {
|
|
3933
2638
|
const keyCode = event.keyCode;
|
|
@@ -3950,8 +2655,8 @@ const _sfc_main$7 = {
|
|
|
3950
2655
|
return;
|
|
3951
2656
|
}
|
|
3952
2657
|
},
|
|
3953
|
-
isValidValue(
|
|
3954
|
-
return timeWithinRange(
|
|
2658
|
+
isValidValue(date) {
|
|
2659
|
+
return dateUtil.timeWithinRange(date, this.selectableRange, this.format);
|
|
3955
2660
|
},
|
|
3956
2661
|
adjustSpinners() {
|
|
3957
2662
|
return this.$refs.spinner.adjustSpinners();
|
|
@@ -4030,10 +2735,31 @@ var _sfc_render$7 = function render3() {
|
|
|
4030
2735
|
var _sfc_staticRenderFns$7 = [];
|
|
4031
2736
|
var __component__$7 = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(_sfc_main$7, _sfc_render$7, _sfc_staticRenderFns$7, false, null, null, null, null);
|
|
4032
2737
|
const TimePicker = __component__$7.exports;
|
|
2738
|
+
const arrayFindIndex = function(arr, pred) {
|
|
2739
|
+
for (let i = 0; i !== arr.length; ++i) {
|
|
2740
|
+
if (pred(arr[i])) {
|
|
2741
|
+
return i;
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
return -1;
|
|
2745
|
+
};
|
|
2746
|
+
const arrayFind = function(arr, pred) {
|
|
2747
|
+
const idx = arrayFindIndex(arr, pred);
|
|
2748
|
+
return idx !== -1 ? arr[idx] : void 0;
|
|
2749
|
+
};
|
|
2750
|
+
const coerceTruthyValueToArray = function(val) {
|
|
2751
|
+
if (Array.isArray(val)) {
|
|
2752
|
+
return val;
|
|
2753
|
+
} else if (val) {
|
|
2754
|
+
return [val];
|
|
2755
|
+
} else {
|
|
2756
|
+
return [];
|
|
2757
|
+
}
|
|
2758
|
+
};
|
|
4033
2759
|
const datesInYear = (year) => {
|
|
4034
|
-
const numOfDays = getDayCountOfYear(year);
|
|
2760
|
+
const numOfDays = dateUtil.getDayCountOfYear(year);
|
|
4035
2761
|
const firstDay = new Date(year, 0, 1);
|
|
4036
|
-
return range(numOfDays).map((n) => nextDate(firstDay, n));
|
|
2762
|
+
return dateUtil.range(numOfDays).map((n) => dateUtil.nextDate(firstDay, n));
|
|
4037
2763
|
};
|
|
4038
2764
|
const _sfc_main$6 = {
|
|
4039
2765
|
props: {
|
|
@@ -4041,7 +2767,7 @@ const _sfc_main$6 = {
|
|
|
4041
2767
|
value: {},
|
|
4042
2768
|
defaultValue: {
|
|
4043
2769
|
validator(val) {
|
|
4044
|
-
return val === null || val instanceof Date && isDate(val);
|
|
2770
|
+
return val === null || val instanceof Date && dateUtil.isDate(val);
|
|
4045
2771
|
}
|
|
4046
2772
|
},
|
|
4047
2773
|
date: {}
|
|
@@ -4056,7 +2782,7 @@ const _sfc_main$6 = {
|
|
|
4056
2782
|
const style = {};
|
|
4057
2783
|
const today = /* @__PURE__ */ new Date();
|
|
4058
2784
|
style.disabled = typeof this.disabledDate === "function" ? datesInYear(year).every(this.disabledDate) : false;
|
|
4059
|
-
style.current = arrayFindIndex
|
|
2785
|
+
style.current = arrayFindIndex(coerceTruthyValueToArray(this.value), (date) => date.getFullYear() === year) >= 0;
|
|
4060
2786
|
style.today = today.getFullYear() === year;
|
|
4061
2787
|
style.default = this.defaultValue && this.defaultValue.getFullYear() === year;
|
|
4062
2788
|
return style;
|
|
@@ -4135,12 +2861,12 @@ var _sfc_staticRenderFns$6 = [];
|
|
|
4135
2861
|
var __component__$6 = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(_sfc_main$6, _sfc_render$6, _sfc_staticRenderFns$6, false, null, null, null, null);
|
|
4136
2862
|
const YearTable = __component__$6.exports;
|
|
4137
2863
|
const datesInMonth = (year, month) => {
|
|
4138
|
-
const numOfDays = getDayCountOfMonth(year, month);
|
|
2864
|
+
const numOfDays = dateUtil.getDayCountOfMonth(year, month);
|
|
4139
2865
|
const firstDay = new Date(year, month, 1);
|
|
4140
|
-
return range(numOfDays).map((n) => nextDate(firstDay, n));
|
|
2866
|
+
return dateUtil.range(numOfDays).map((n) => dateUtil.nextDate(firstDay, n));
|
|
4141
2867
|
};
|
|
4142
|
-
const clearDate = (
|
|
4143
|
-
return new Date(
|
|
2868
|
+
const clearDate = (date) => {
|
|
2869
|
+
return new Date(date.getFullYear(), date.getMonth());
|
|
4144
2870
|
};
|
|
4145
2871
|
const getMonthTimestamp = function(time) {
|
|
4146
2872
|
if (typeof time === "number" || typeof time === "string") {
|
|
@@ -4152,7 +2878,7 @@ const getMonthTimestamp = function(time) {
|
|
|
4152
2878
|
}
|
|
4153
2879
|
};
|
|
4154
2880
|
const _sfc_main$5 = {
|
|
4155
|
-
mixins: [
|
|
2881
|
+
mixins: [Locale],
|
|
4156
2882
|
props: {
|
|
4157
2883
|
disabledDate: {},
|
|
4158
2884
|
value: {},
|
|
@@ -4163,7 +2889,7 @@ const _sfc_main$5 = {
|
|
|
4163
2889
|
maxDate: {},
|
|
4164
2890
|
defaultValue: {
|
|
4165
2891
|
validator(val) {
|
|
4166
|
-
return val === null || isDate(val) || Array.isArray(val) && val.every(isDate);
|
|
2892
|
+
return val === null || dateUtil.isDate(val) || Array.isArray(val) && val.every(dateUtil.isDate);
|
|
4167
2893
|
}
|
|
4168
2894
|
},
|
|
4169
2895
|
date: {},
|
|
@@ -4217,7 +2943,7 @@ const _sfc_main$5 = {
|
|
|
4217
2943
|
cell.text = index;
|
|
4218
2944
|
const cellDate = new Date(time);
|
|
4219
2945
|
cell.disabled = typeof disabledDate === "function" && disabledDate(cellDate);
|
|
4220
|
-
cell.selected = arrayFind(selectedDate, (
|
|
2946
|
+
cell.selected = arrayFind(selectedDate, (date) => date.getTime() === cellDate.getTime());
|
|
4221
2947
|
this.$set(row, j, cell);
|
|
4222
2948
|
}
|
|
4223
2949
|
}
|
|
@@ -4240,8 +2966,8 @@ const _sfc_main$5 = {
|
|
|
4240
2966
|
}
|
|
4241
2967
|
},
|
|
4242
2968
|
methods: {
|
|
4243
|
-
cellMatchesDate(cell,
|
|
4244
|
-
const value = new Date(
|
|
2969
|
+
cellMatchesDate(cell, date) {
|
|
2970
|
+
const value = new Date(date);
|
|
4245
2971
|
return this.date.getFullYear() === value.getFullYear() && Number(cell.text) === value.getMonth();
|
|
4246
2972
|
},
|
|
4247
2973
|
getCellStyle(cell) {
|
|
@@ -4251,9 +2977,9 @@ const _sfc_main$5 = {
|
|
|
4251
2977
|
const month = cell.text;
|
|
4252
2978
|
const defaultValue = this.defaultValue ? Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue] : [];
|
|
4253
2979
|
style.disabled = typeof this.disabledDate === "function" ? datesInMonth(year, month).every(this.disabledDate) : false;
|
|
4254
|
-
style.current = arrayFindIndex
|
|
2980
|
+
style.current = arrayFindIndex(coerceTruthyValueToArray(this.value), (date) => date.getFullYear() === year && date.getMonth() === month) >= 0;
|
|
4255
2981
|
style.today = today.getFullYear() === year && today.getMonth() === month;
|
|
4256
|
-
style.default = defaultValue.some((
|
|
2982
|
+
style.default = defaultValue.some((date) => this.cellMatchesDate(cell, date));
|
|
4257
2983
|
if (cell.inRange) {
|
|
4258
2984
|
style["in-range"] = true;
|
|
4259
2985
|
if (cell.start) {
|
|
@@ -4407,10 +3133,10 @@ const mul = (arg1, arg2) => {
|
|
|
4407
3133
|
};
|
|
4408
3134
|
const div = (arg1, arg2) => {
|
|
4409
3135
|
const t1 = (arg1.toString().split(".")[1] || "").length;
|
|
4410
|
-
const
|
|
3136
|
+
const t2 = (arg2.toString().split(".")[1] || "").length;
|
|
4411
3137
|
const r1 = Number(arg1.toString().replace(".", ""));
|
|
4412
3138
|
const r2 = Number(arg2.toString().replace(".", ""));
|
|
4413
|
-
return r1 / r2 * Math.pow(10,
|
|
3139
|
+
return r1 / r2 * Math.pow(10, t2 - t1);
|
|
4414
3140
|
};
|
|
4415
3141
|
function getLocalTime(i) {
|
|
4416
3142
|
let time = i;
|
|
@@ -4433,19 +3159,19 @@ function getLocalTime(i) {
|
|
|
4433
3159
|
const WEEKS = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
|
|
4434
3160
|
const getDateTimestamp = function(time) {
|
|
4435
3161
|
if (typeof time === "number" || typeof time === "string") {
|
|
4436
|
-
return clearTime(new Date(time)).getTime();
|
|
3162
|
+
return dateUtil.clearTime(new Date(time)).getTime();
|
|
4437
3163
|
} else if (time instanceof Date) {
|
|
4438
|
-
return clearTime(time).getTime();
|
|
3164
|
+
return dateUtil.clearTime(time).getTime();
|
|
4439
3165
|
} else {
|
|
4440
3166
|
return NaN;
|
|
4441
3167
|
}
|
|
4442
3168
|
};
|
|
4443
3169
|
const removeFromArray = function(arr, pred) {
|
|
4444
|
-
const idx = typeof pred === "function" ? arrayFindIndex
|
|
3170
|
+
const idx = typeof pred === "function" ? arrayFindIndex(arr, pred) : arr.indexOf(pred);
|
|
4445
3171
|
return idx >= 0 ? [...arr.slice(0, idx), ...arr.slice(idx + 1)] : arr;
|
|
4446
3172
|
};
|
|
4447
3173
|
const _sfc_main$4 = {
|
|
4448
|
-
mixins: [
|
|
3174
|
+
mixins: [Locale],
|
|
4449
3175
|
props: {
|
|
4450
3176
|
firstDayOfWeek: {
|
|
4451
3177
|
default: 7,
|
|
@@ -4455,7 +3181,7 @@ const _sfc_main$4 = {
|
|
|
4455
3181
|
value: {},
|
|
4456
3182
|
defaultValue: {
|
|
4457
3183
|
validator(val) {
|
|
4458
|
-
return val === null || isDate(val) || Array.isArray(val) && val.every(isDate);
|
|
3184
|
+
return val === null || dateUtil.isDate(val) || Array.isArray(val) && val.every(dateUtil.isDate);
|
|
4459
3185
|
}
|
|
4460
3186
|
},
|
|
4461
3187
|
date: {},
|
|
@@ -4507,13 +3233,13 @@ const _sfc_main$4 = {
|
|
|
4507
3233
|
return this.date.getMonth();
|
|
4508
3234
|
},
|
|
4509
3235
|
startDate() {
|
|
4510
|
-
return getStartDateOfMonth(this.year, this.month);
|
|
3236
|
+
return dateUtil.getStartDateOfMonth(this.year, this.month);
|
|
4511
3237
|
},
|
|
4512
3238
|
rows() {
|
|
4513
|
-
const
|
|
4514
|
-
let day = getFirstDayOfMonth(
|
|
4515
|
-
const dateCountOfMonth = getDayCountOfMonth(
|
|
4516
|
-
const dateCountOfLastMonth = getDayCountOfMonth(
|
|
3239
|
+
const date = new Date(this.year, this.month, 1);
|
|
3240
|
+
let day = dateUtil.getFirstDayOfMonth(date);
|
|
3241
|
+
const dateCountOfMonth = dateUtil.getDayCountOfMonth(date.getFullYear(), date.getMonth());
|
|
3242
|
+
const dateCountOfLastMonth = dateUtil.getDayCountOfMonth(date.getFullYear(), date.getMonth() === 0 ? 11 : date.getMonth() - 1);
|
|
4517
3243
|
day = day === 0 ? 7 : day;
|
|
4518
3244
|
const offset = this.offsetDay;
|
|
4519
3245
|
const rows = this.tableRows;
|
|
@@ -4529,7 +3255,7 @@ const _sfc_main$4 = {
|
|
|
4529
3255
|
if (!row[0]) {
|
|
4530
3256
|
row[0] = {
|
|
4531
3257
|
type: "week",
|
|
4532
|
-
text: getWeekNumber(nextDate(startDate, i * 7 + 1))
|
|
3258
|
+
text: dateUtil.getWeekNumber(dateUtil.nextDate(startDate, i * 7 + 1))
|
|
4533
3259
|
};
|
|
4534
3260
|
}
|
|
4535
3261
|
}
|
|
@@ -4547,7 +3273,7 @@ const _sfc_main$4 = {
|
|
|
4547
3273
|
}
|
|
4548
3274
|
cell.type = "normal";
|
|
4549
3275
|
const index = i * 7 + j;
|
|
4550
|
-
const time = nextDate(startDate, index - offset).getTime();
|
|
3276
|
+
const time = dateUtil.nextDate(startDate, index - offset).getTime();
|
|
4551
3277
|
cell.inRange = time >= getDateTimestamp(this.minDate) && time <= getDateTimestamp(this.maxDate);
|
|
4552
3278
|
cell.start = this.minDate && time === getDateTimestamp(this.minDate);
|
|
4553
3279
|
cell.end = this.maxDate && time === getDateTimestamp(this.maxDate);
|
|
@@ -4573,7 +3299,7 @@ const _sfc_main$4 = {
|
|
|
4573
3299
|
}
|
|
4574
3300
|
const cellDate = new Date(time);
|
|
4575
3301
|
cell.disabled = typeof disabledDate === "function" && disabledDate(cellDate);
|
|
4576
|
-
cell.selected = arrayFind(selectedDate, (
|
|
3302
|
+
cell.selected = arrayFind(selectedDate, (date2) => date2.getTime() === cellDate.getTime());
|
|
4577
3303
|
cell.customClass = typeof cellClassName === "function" && cellClassName(cellDate);
|
|
4578
3304
|
this.$set(row, this.showWeekNumber ? j + 1 : j, cell);
|
|
4579
3305
|
}
|
|
@@ -4606,8 +3332,8 @@ const _sfc_main$4 = {
|
|
|
4606
3332
|
}
|
|
4607
3333
|
},
|
|
4608
3334
|
methods: {
|
|
4609
|
-
cellMatchesDate(cell,
|
|
4610
|
-
const value = new Date(
|
|
3335
|
+
cellMatchesDate(cell, date) {
|
|
3336
|
+
const value = new Date(date);
|
|
4611
3337
|
return this.year === value.getFullYear() && this.month === value.getMonth() && Number(cell.text) === value.getDate();
|
|
4612
3338
|
},
|
|
4613
3339
|
getCellClasses(cell) {
|
|
@@ -4622,7 +3348,7 @@ const _sfc_main$4 = {
|
|
|
4622
3348
|
} else {
|
|
4623
3349
|
classes.push(cell.type);
|
|
4624
3350
|
}
|
|
4625
|
-
if (cell.type === "normal" && defaultValue.some((
|
|
3351
|
+
if (cell.type === "normal" && defaultValue.some((date) => this.cellMatchesDate(cell, date))) {
|
|
4626
3352
|
classes.push("default");
|
|
4627
3353
|
}
|
|
4628
3354
|
if (selectionMode === "day" && (cell.type === "normal" || cell.type === "today") && this.cellMatchesDate(cell, this.value)) {
|
|
@@ -4650,7 +3376,7 @@ const _sfc_main$4 = {
|
|
|
4650
3376
|
},
|
|
4651
3377
|
getDateOfCell(row, column) {
|
|
4652
3378
|
const offsetFromStart = row * 7 + (column - (this.showWeekNumber ? 1 : 0)) - this.offsetDay;
|
|
4653
|
-
return nextDate(this.startDate, offsetFromStart);
|
|
3379
|
+
return dateUtil.nextDate(this.startDate, offsetFromStart);
|
|
4654
3380
|
},
|
|
4655
3381
|
isWeekActive(cell) {
|
|
4656
3382
|
if (this.selectionMode !== "week")
|
|
@@ -4667,9 +3393,9 @@ const _sfc_main$4 = {
|
|
|
4667
3393
|
newDate.setFullYear(month === 11 ? year + 1 : year);
|
|
4668
3394
|
}
|
|
4669
3395
|
newDate.setDate(parseInt(cell.text, 10));
|
|
4670
|
-
if (isDate(this.value)) {
|
|
3396
|
+
if (dateUtil.isDate(this.value)) {
|
|
4671
3397
|
const dayOffset = (this.value.getDay() - this.firstDayOfWeek + 7) % 7 - 1;
|
|
4672
|
-
const weekDate = prevDate(this.value, dayOffset);
|
|
3398
|
+
const weekDate = dateUtil.prevDate(this.value, dayOffset);
|
|
4673
3399
|
return weekDate.getTime() === newDate.getTime();
|
|
4674
3400
|
}
|
|
4675
3401
|
return false;
|
|
@@ -4687,7 +3413,7 @@ const _sfc_main$4 = {
|
|
|
4687
3413
|
continue;
|
|
4688
3414
|
const cell = row[j];
|
|
4689
3415
|
const index = i * 7 + j + (this.showWeekNumber ? -1 : 0);
|
|
4690
|
-
const time = nextDate(startDate, index - this.offsetDay).getTime();
|
|
3416
|
+
const time = dateUtil.nextDate(startDate, index - this.offsetDay).getTime();
|
|
4691
3417
|
cell.inRange = minDate && time >= minDate && time <= maxDate;
|
|
4692
3418
|
cell.start = minDate && time === minDate;
|
|
4693
3419
|
cell.end = maxDate && time === maxDate;
|
|
@@ -4763,7 +3489,7 @@ const _sfc_main$4 = {
|
|
|
4763
3489
|
} else if (this.selectionMode === "day") {
|
|
4764
3490
|
this.$emit("pick", newDate);
|
|
4765
3491
|
} else if (this.selectionMode === "week") {
|
|
4766
|
-
const weekNumber = getWeekNumber(newDate);
|
|
3492
|
+
const weekNumber = dateUtil.getWeekNumber(newDate);
|
|
4767
3493
|
const value = newDate.getFullYear() + "w" + weekNumber;
|
|
4768
3494
|
this.$emit("pick", {
|
|
4769
3495
|
year: newDate.getFullYear(),
|
|
@@ -4773,7 +3499,7 @@ const _sfc_main$4 = {
|
|
|
4773
3499
|
});
|
|
4774
3500
|
} else if (this.selectionMode === "dates") {
|
|
4775
3501
|
const value = this.value || [];
|
|
4776
|
-
const newValue = cell.selected ? removeFromArray(value, (
|
|
3502
|
+
const newValue = cell.selected ? removeFromArray(value, (date) => date.getTime() === newDate.getTime()) : [...value, newDate];
|
|
4777
3503
|
this.$emit("pick", newValue);
|
|
4778
3504
|
}
|
|
4779
3505
|
}
|
|
@@ -4826,7 +3552,7 @@ const _sfc_main$3 = {
|
|
|
4826
3552
|
MonthTable,
|
|
4827
3553
|
DateTable
|
|
4828
3554
|
},
|
|
4829
|
-
mixins: [
|
|
3555
|
+
mixins: [Locale],
|
|
4830
3556
|
data() {
|
|
4831
3557
|
return {
|
|
4832
3558
|
timezone: "",
|
|
@@ -4861,7 +3587,7 @@ const _sfc_main$3 = {
|
|
|
4861
3587
|
return this.date.getMonth();
|
|
4862
3588
|
},
|
|
4863
3589
|
week() {
|
|
4864
|
-
return getWeekNumber(this.date);
|
|
3590
|
+
return dateUtil.getWeekNumber(this.date);
|
|
4865
3591
|
},
|
|
4866
3592
|
monthDate() {
|
|
4867
3593
|
return this.date.getDate();
|
|
@@ -4873,14 +3599,14 @@ const _sfc_main$3 = {
|
|
|
4873
3599
|
if (this.userInputTime !== null) {
|
|
4874
3600
|
return this.userInputTime;
|
|
4875
3601
|
} else {
|
|
4876
|
-
return formatDate(this.value || this.defaultValue, this.timeFormat);
|
|
3602
|
+
return dateUtil.formatDate(this.value || this.defaultValue, this.timeFormat);
|
|
4877
3603
|
}
|
|
4878
3604
|
},
|
|
4879
3605
|
visibleDate() {
|
|
4880
3606
|
if (this.userInputDate !== null) {
|
|
4881
3607
|
return this.userInputDate;
|
|
4882
3608
|
} else {
|
|
4883
|
-
return formatDate(this.value || this.defaultValue, this.dateFormat);
|
|
3609
|
+
return dateUtil.formatDate(this.value || this.defaultValue, this.dateFormat);
|
|
4884
3610
|
}
|
|
4885
3611
|
},
|
|
4886
3612
|
yearLabel() {
|
|
@@ -4896,14 +3622,14 @@ const _sfc_main$3 = {
|
|
|
4896
3622
|
},
|
|
4897
3623
|
timeFormat() {
|
|
4898
3624
|
if (this.format) {
|
|
4899
|
-
return extractTimeFormat(this.format);
|
|
3625
|
+
return dateUtil.extractTimeFormat(this.format);
|
|
4900
3626
|
} else {
|
|
4901
3627
|
return "HH:mm:ss";
|
|
4902
3628
|
}
|
|
4903
3629
|
},
|
|
4904
3630
|
dateFormat() {
|
|
4905
3631
|
if (this.format) {
|
|
4906
|
-
return extractDateFormat(this.format);
|
|
3632
|
+
return dateUtil.extractDateFormat(this.format);
|
|
4907
3633
|
} else {
|
|
4908
3634
|
return "yyyy-MM-dd";
|
|
4909
3635
|
}
|
|
@@ -4923,14 +3649,14 @@ const _sfc_main$3 = {
|
|
|
4923
3649
|
value(val) {
|
|
4924
3650
|
if (this.selectionMode === "dates" && this.value)
|
|
4925
3651
|
return;
|
|
4926
|
-
if (isDate(val)) {
|
|
3652
|
+
if (dateUtil.isDate(val)) {
|
|
4927
3653
|
this.date = new Date(val);
|
|
4928
3654
|
} else {
|
|
4929
3655
|
this.date = this.getDefaultValue();
|
|
4930
3656
|
}
|
|
4931
3657
|
},
|
|
4932
3658
|
defaultValue(val) {
|
|
4933
|
-
if (!isDate(this.value)) {
|
|
3659
|
+
if (!dateUtil.isDate(this.value)) {
|
|
4934
3660
|
this.date = val ? new Date(val) : /* @__PURE__ */ new Date();
|
|
4935
3661
|
}
|
|
4936
3662
|
},
|
|
@@ -4950,24 +3676,24 @@ const _sfc_main$3 = {
|
|
|
4950
3676
|
},
|
|
4951
3677
|
methods: {
|
|
4952
3678
|
proxyTimePickerDataProperties() {
|
|
4953
|
-
const
|
|
3679
|
+
const format = (timeFormat) => {
|
|
4954
3680
|
this.$refs.timepicker.format = timeFormat;
|
|
4955
3681
|
};
|
|
4956
3682
|
const value = (value2) => {
|
|
4957
3683
|
this.$refs.timepicker.value = value2;
|
|
4958
3684
|
};
|
|
4959
|
-
const
|
|
4960
|
-
this.$refs.timepicker.date =
|
|
3685
|
+
const date = (date2) => {
|
|
3686
|
+
this.$refs.timepicker.date = date2;
|
|
4961
3687
|
};
|
|
4962
3688
|
const selectableRange = (selectableRange2) => {
|
|
4963
3689
|
this.$refs.timepicker.selectableRange = selectableRange2;
|
|
4964
3690
|
};
|
|
4965
3691
|
this.$watch("value", value);
|
|
4966
|
-
this.$watch("date",
|
|
3692
|
+
this.$watch("date", date);
|
|
4967
3693
|
this.$watch("selectableRange", selectableRange);
|
|
4968
|
-
|
|
3694
|
+
format(this.timeFormat);
|
|
4969
3695
|
value(this.value);
|
|
4970
|
-
|
|
3696
|
+
date(this.date);
|
|
4971
3697
|
selectableRange(this.selectableRange);
|
|
4972
3698
|
},
|
|
4973
3699
|
handleClear() {
|
|
@@ -4978,10 +3704,10 @@ const _sfc_main$3 = {
|
|
|
4978
3704
|
if (!value) {
|
|
4979
3705
|
this.$emit("pick", value, ...args);
|
|
4980
3706
|
} else if (Array.isArray(value)) {
|
|
4981
|
-
const dates = value.map((
|
|
3707
|
+
const dates = value.map((date) => this.showTime ? dateUtil.clearMilliseconds(date) : dateUtil.clearTime(date));
|
|
4982
3708
|
this.$emit("pick", dates, ...args);
|
|
4983
3709
|
} else {
|
|
4984
|
-
this.$emit("pick", this.showTime ? clearMilliseconds(value) : clearTime(value), ...args);
|
|
3710
|
+
this.$emit("pick", this.showTime ? dateUtil.clearMilliseconds(value) : dateUtil.clearTime(value), ...args);
|
|
4985
3711
|
}
|
|
4986
3712
|
this.userInputDate = null;
|
|
4987
3713
|
this.userInputTime = null;
|
|
@@ -5004,23 +3730,23 @@ const _sfc_main$3 = {
|
|
|
5004
3730
|
// }
|
|
5005
3731
|
// },
|
|
5006
3732
|
prevMonth() {
|
|
5007
|
-
this.date = prevMonth(this.date);
|
|
3733
|
+
this.date = dateUtil.prevMonth(this.date);
|
|
5008
3734
|
},
|
|
5009
3735
|
nextMonth() {
|
|
5010
|
-
this.date = nextMonth(this.date);
|
|
3736
|
+
this.date = dateUtil.nextMonth(this.date);
|
|
5011
3737
|
},
|
|
5012
3738
|
prevYear() {
|
|
5013
3739
|
if (this.currentView === "year") {
|
|
5014
|
-
this.date = prevYear(this.date, 10);
|
|
3740
|
+
this.date = dateUtil.prevYear(this.date, 10);
|
|
5015
3741
|
} else {
|
|
5016
|
-
this.date = prevYear(this.date);
|
|
3742
|
+
this.date = dateUtil.prevYear(this.date);
|
|
5017
3743
|
}
|
|
5018
3744
|
},
|
|
5019
3745
|
nextYear() {
|
|
5020
3746
|
if (this.currentView === "year") {
|
|
5021
|
-
this.date = nextYear(this.date, 10);
|
|
3747
|
+
this.date = dateUtil.nextYear(this.date, 10);
|
|
5022
3748
|
} else {
|
|
5023
|
-
this.date = nextYear(this.date);
|
|
3749
|
+
this.date = dateUtil.nextYear(this.date);
|
|
5024
3750
|
}
|
|
5025
3751
|
},
|
|
5026
3752
|
handleShortcutClick(shortcut) {
|
|
@@ -5029,8 +3755,8 @@ const _sfc_main$3 = {
|
|
|
5029
3755
|
}
|
|
5030
3756
|
},
|
|
5031
3757
|
handleTimePick(value, visible, first) {
|
|
5032
|
-
if (isDate(value)) {
|
|
5033
|
-
const newDate = this.value ? modifyTime(this.value, value.getHours(), value.getMinutes(), value.getSeconds()) : modifyWithTimeString(this.getDefaultValue(), this.defaultTime);
|
|
3758
|
+
if (dateUtil.isDate(value)) {
|
|
3759
|
+
const newDate = this.value ? dateUtil.modifyTime(this.value, value.getHours(), value.getMinutes(), value.getSeconds()) : dateUtil.modifyWithTimeString(this.getDefaultValue(), this.defaultTime);
|
|
5034
3760
|
this.date = newDate;
|
|
5035
3761
|
this.emit(this.date, true);
|
|
5036
3762
|
} else {
|
|
@@ -5045,18 +3771,18 @@ const _sfc_main$3 = {
|
|
|
5045
3771
|
},
|
|
5046
3772
|
handleMonthPick(month) {
|
|
5047
3773
|
if (this.selectionMode === "month") {
|
|
5048
|
-
this.date = modifyDate(this.date, this.year, month, 1);
|
|
3774
|
+
this.date = dateUtil.modifyDate(this.date, this.year, month, 1);
|
|
5049
3775
|
this.emit(this.date);
|
|
5050
3776
|
} else {
|
|
5051
|
-
this.date = changeYearMonthAndClampDate(this.date, this.year, month);
|
|
3777
|
+
this.date = dateUtil.changeYearMonthAndClampDate(this.date, this.year, month);
|
|
5052
3778
|
this.currentView = "date";
|
|
5053
3779
|
}
|
|
5054
3780
|
},
|
|
5055
3781
|
handleDatePick(value) {
|
|
5056
3782
|
if (this.selectionMode === "day") {
|
|
5057
|
-
let newDate = this.value ? modifyDate(this.value, value.getFullYear(), value.getMonth(), value.getDate()) : modifyWithTimeString(value, this.defaultTime);
|
|
3783
|
+
let newDate = this.value ? dateUtil.modifyDate(this.value, value.getFullYear(), value.getMonth(), value.getDate()) : dateUtil.modifyWithTimeString(value, this.defaultTime);
|
|
5058
3784
|
if (!this.checkDateWithinRange(newDate)) {
|
|
5059
|
-
newDate = modifyDate(this.selectableRange[0][0], value.getFullYear(), value.getMonth(), value.getDate());
|
|
3785
|
+
newDate = dateUtil.modifyDate(this.selectableRange[0][0], value.getFullYear(), value.getMonth(), value.getDate());
|
|
5060
3786
|
}
|
|
5061
3787
|
this.date = newDate;
|
|
5062
3788
|
this.emit(this.date, this.showTime);
|
|
@@ -5068,10 +3794,10 @@ const _sfc_main$3 = {
|
|
|
5068
3794
|
},
|
|
5069
3795
|
handleYearPick(year) {
|
|
5070
3796
|
if (this.selectionMode === "year") {
|
|
5071
|
-
this.date = modifyDate(this.date, year, 0, 1);
|
|
3797
|
+
this.date = dateUtil.modifyDate(this.date, year, 0, 1);
|
|
5072
3798
|
this.emit(this.date);
|
|
5073
3799
|
} else {
|
|
5074
|
-
this.date = changeYearMonthAndClampDate(this.date, year, this.month);
|
|
3800
|
+
this.date = dateUtil.changeYearMonthAndClampDate(this.date, year, this.month);
|
|
5075
3801
|
this.currentView = "month";
|
|
5076
3802
|
}
|
|
5077
3803
|
},
|
|
@@ -5085,7 +3811,7 @@ const _sfc_main$3 = {
|
|
|
5085
3811
|
if (this.selectionMode === "dates") {
|
|
5086
3812
|
this.emit(this.value);
|
|
5087
3813
|
} else {
|
|
5088
|
-
const value = this.value ? this.value : modifyWithTimeString(this.getDefaultValue(), this.defaultTime);
|
|
3814
|
+
const value = this.value ? this.value : dateUtil.modifyWithTimeString(this.getDefaultValue(), this.defaultTime);
|
|
5089
3815
|
this.date = new Date(value);
|
|
5090
3816
|
this.emit(value);
|
|
5091
3817
|
}
|
|
@@ -5127,28 +3853,28 @@ const _sfc_main$3 = {
|
|
|
5127
3853
|
40: 4,
|
|
5128
3854
|
37: -1,
|
|
5129
3855
|
39: 1,
|
|
5130
|
-
offset: (
|
|
3856
|
+
offset: (date, step) => date.setFullYear(date.getFullYear() + step)
|
|
5131
3857
|
},
|
|
5132
3858
|
"month": {
|
|
5133
3859
|
38: -4,
|
|
5134
3860
|
40: 4,
|
|
5135
3861
|
37: -1,
|
|
5136
3862
|
39: 1,
|
|
5137
|
-
offset: (
|
|
3863
|
+
offset: (date, step) => date.setMonth(date.getMonth() + step)
|
|
5138
3864
|
},
|
|
5139
3865
|
"week": {
|
|
5140
3866
|
38: -1,
|
|
5141
3867
|
40: 1,
|
|
5142
3868
|
37: -1,
|
|
5143
3869
|
39: 1,
|
|
5144
|
-
offset: (
|
|
3870
|
+
offset: (date, step) => date.setDate(date.getDate() + step * 7)
|
|
5145
3871
|
},
|
|
5146
3872
|
"day": {
|
|
5147
3873
|
38: -7,
|
|
5148
3874
|
40: 7,
|
|
5149
3875
|
37: -1,
|
|
5150
3876
|
39: 1,
|
|
5151
|
-
offset: (
|
|
3877
|
+
offset: (date, step) => date.setDate(date.getDate() + step)
|
|
5152
3878
|
}
|
|
5153
3879
|
};
|
|
5154
3880
|
const mode = this.selectionMode;
|
|
@@ -5167,9 +3893,9 @@ const _sfc_main$3 = {
|
|
|
5167
3893
|
}
|
|
5168
3894
|
},
|
|
5169
3895
|
handleVisibleTimeChange(value) {
|
|
5170
|
-
const time = parseDate(value, this.timeFormat);
|
|
3896
|
+
const time = dateUtil.parseDate(value, this.timeFormat);
|
|
5171
3897
|
if (time && this.checkDateWithinRange(time)) {
|
|
5172
|
-
this.date = modifyDate(time, this.year, this.month, this.monthDate);
|
|
3898
|
+
this.date = dateUtil.modifyDate(time, this.year, this.month, this.monthDate);
|
|
5173
3899
|
this.userInputTime = null;
|
|
5174
3900
|
this.$refs.timepicker.value = this.date;
|
|
5175
3901
|
this.timePickerVisible = false;
|
|
@@ -5177,12 +3903,12 @@ const _sfc_main$3 = {
|
|
|
5177
3903
|
}
|
|
5178
3904
|
},
|
|
5179
3905
|
handleVisibleDateChange(value) {
|
|
5180
|
-
const
|
|
5181
|
-
if (
|
|
5182
|
-
if (typeof this.disabledDate === "function" && this.disabledDate(
|
|
3906
|
+
const date = dateUtil.parseDate(value, this.dateFormat);
|
|
3907
|
+
if (date) {
|
|
3908
|
+
if (typeof this.disabledDate === "function" && this.disabledDate(date)) {
|
|
5183
3909
|
return;
|
|
5184
3910
|
}
|
|
5185
|
-
this.date = modifyTime(
|
|
3911
|
+
this.date = dateUtil.modifyTime(date, this.date.getHours(), this.date.getMinutes(), this.date.getSeconds());
|
|
5186
3912
|
this.userInputDate = null;
|
|
5187
3913
|
this.resetView();
|
|
5188
3914
|
this.emit(this.date, true);
|
|
@@ -5194,8 +3920,8 @@ const _sfc_main$3 = {
|
|
|
5194
3920
|
getDefaultValue() {
|
|
5195
3921
|
return this.defaultValue ? new Date(this.defaultValue) : /* @__PURE__ */ new Date();
|
|
5196
3922
|
},
|
|
5197
|
-
checkDateWithinRange(
|
|
5198
|
-
return this.selectableRange.length > 0 ? timeWithinRange(
|
|
3923
|
+
checkDateWithinRange(date) {
|
|
3924
|
+
return this.selectableRange.length > 0 ? dateUtil.timeWithinRange(date, this.selectableRange, this.format || "HH:mm:ss") : true;
|
|
5199
3925
|
}
|
|
5200
3926
|
}
|
|
5201
3927
|
};
|
|
@@ -5466,9 +4192,9 @@ const calcDefaultValue$1 = (defaultValue) => {
|
|
|
5466
4192
|
if (Array.isArray(defaultValue)) {
|
|
5467
4193
|
return [new Date(defaultValue[0]), new Date(defaultValue[1])];
|
|
5468
4194
|
} else if (defaultValue) {
|
|
5469
|
-
return [new Date(defaultValue), nextDate(new Date(defaultValue), 1)];
|
|
4195
|
+
return [new Date(defaultValue), dateUtil.nextDate(new Date(defaultValue), 1)];
|
|
5470
4196
|
} else {
|
|
5471
|
-
return [/* @__PURE__ */ new Date(), nextDate(/* @__PURE__ */ new Date(), 1)];
|
|
4197
|
+
return [/* @__PURE__ */ new Date(), dateUtil.nextDate(/* @__PURE__ */ new Date(), 1)];
|
|
5472
4198
|
}
|
|
5473
4199
|
};
|
|
5474
4200
|
const _sfc_main$2 = {
|
|
@@ -5479,7 +4205,7 @@ const _sfc_main$2 = {
|
|
|
5479
4205
|
TimePicker,
|
|
5480
4206
|
DateTable
|
|
5481
4207
|
},
|
|
5482
|
-
mixins: [
|
|
4208
|
+
mixins: [Locale],
|
|
5483
4209
|
data() {
|
|
5484
4210
|
return {
|
|
5485
4211
|
timezone: "",
|
|
@@ -5490,7 +4216,7 @@ const _sfc_main$2 = {
|
|
|
5490
4216
|
minDate: "",
|
|
5491
4217
|
maxDate: "",
|
|
5492
4218
|
leftDate: /* @__PURE__ */ new Date(),
|
|
5493
|
-
rightDate: nextMonth(/* @__PURE__ */ new Date()),
|
|
4219
|
+
rightDate: dateUtil.nextMonth(/* @__PURE__ */ new Date()),
|
|
5494
4220
|
rangeState: {
|
|
5495
4221
|
endDate: null,
|
|
5496
4222
|
selecting: false,
|
|
@@ -5550,48 +4276,48 @@ const _sfc_main$2 = {
|
|
|
5550
4276
|
if (this.dateUserInput.min !== null)
|
|
5551
4277
|
return this.dateUserInput.min;
|
|
5552
4278
|
if (this.minDate)
|
|
5553
|
-
return formatDate(this.minDate, this.dateFormat);
|
|
4279
|
+
return dateUtil.formatDate(this.minDate, this.dateFormat);
|
|
5554
4280
|
return "";
|
|
5555
4281
|
},
|
|
5556
4282
|
maxVisibleDate() {
|
|
5557
4283
|
if (this.dateUserInput.max !== null)
|
|
5558
4284
|
return this.dateUserInput.max;
|
|
5559
4285
|
if (this.maxDate || this.minDate)
|
|
5560
|
-
return formatDate(this.maxDate || this.minDate, this.dateFormat);
|
|
4286
|
+
return dateUtil.formatDate(this.maxDate || this.minDate, this.dateFormat);
|
|
5561
4287
|
return "";
|
|
5562
4288
|
},
|
|
5563
4289
|
minVisibleTime() {
|
|
5564
4290
|
if (this.timeUserInput.min !== null)
|
|
5565
4291
|
return this.timeUserInput.min;
|
|
5566
4292
|
if (this.minDate)
|
|
5567
|
-
return formatDate(this.minDate, this.timeFormat);
|
|
4293
|
+
return dateUtil.formatDate(this.minDate, this.timeFormat);
|
|
5568
4294
|
return "";
|
|
5569
4295
|
},
|
|
5570
4296
|
maxVisibleTime() {
|
|
5571
4297
|
if (this.timeUserInput.max !== null)
|
|
5572
4298
|
return this.timeUserInput.max;
|
|
5573
4299
|
if (this.maxDate || this.minDate)
|
|
5574
|
-
return formatDate(this.maxDate || this.minDate, this.timeFormat);
|
|
4300
|
+
return dateUtil.formatDate(this.maxDate || this.minDate, this.timeFormat);
|
|
5575
4301
|
return "";
|
|
5576
4302
|
},
|
|
5577
4303
|
timeFormat() {
|
|
5578
4304
|
if (this.format) {
|
|
5579
|
-
return extractTimeFormat(this.format);
|
|
4305
|
+
return dateUtil.extractTimeFormat(this.format);
|
|
5580
4306
|
} else {
|
|
5581
4307
|
return "HH:mm:ss";
|
|
5582
4308
|
}
|
|
5583
4309
|
},
|
|
5584
4310
|
dateFormat() {
|
|
5585
4311
|
if (this.format) {
|
|
5586
|
-
return extractDateFormat(this.format);
|
|
4312
|
+
return dateUtil.extractDateFormat(this.format);
|
|
5587
4313
|
} else {
|
|
5588
4314
|
return "yyyy-MM-dd";
|
|
5589
4315
|
}
|
|
5590
4316
|
},
|
|
5591
4317
|
enableMonthArrow() {
|
|
5592
|
-
const
|
|
4318
|
+
const nextMonth = (this.leftMonth + 1) % 12;
|
|
5593
4319
|
const yearOffset = this.leftMonth + 1 >= 12 ? 1 : 0;
|
|
5594
|
-
return this.unlinkPanels && new Date(this.leftYear + yearOffset,
|
|
4320
|
+
return this.unlinkPanels && new Date(this.leftYear + yearOffset, nextMonth) < new Date(this.rightYear, this.rightMonth);
|
|
5595
4321
|
},
|
|
5596
4322
|
enableYearArrow() {
|
|
5597
4323
|
return this.unlinkPanels && this.rightYear * 12 + this.rightMonth - (this.leftYear * 12 + this.leftMonth + 1) >= 12;
|
|
@@ -5603,8 +4329,8 @@ const _sfc_main$2 = {
|
|
|
5603
4329
|
this.timeUserInput.min = null;
|
|
5604
4330
|
this.$nextTick(() => {
|
|
5605
4331
|
if (this.$refs.maxTimePicker && this.maxDate && this.maxDate < this.minDate) {
|
|
5606
|
-
const
|
|
5607
|
-
this.$refs.maxTimePicker.selectableRange = [[parseDate(formatDate(this.minDate,
|
|
4332
|
+
const format = "HH:mm:ss";
|
|
4333
|
+
this.$refs.maxTimePicker.selectableRange = [[dateUtil.parseDate(dateUtil.formatDate(this.minDate, format), format), dateUtil.parseDate("23:59:59", format)]];
|
|
5608
4334
|
}
|
|
5609
4335
|
});
|
|
5610
4336
|
if (val && this.$refs.minTimePicker) {
|
|
@@ -5643,8 +4369,8 @@ const _sfc_main$2 = {
|
|
|
5643
4369
|
this.minDate = null;
|
|
5644
4370
|
this.maxDate = null;
|
|
5645
4371
|
} else if (Array.isArray(newVal)) {
|
|
5646
|
-
this.minDate = isDate(newVal[0]) ? new Date(newVal[0]) : null;
|
|
5647
|
-
this.maxDate = isDate(newVal[1]) ? new Date(newVal[1]) : null;
|
|
4372
|
+
this.minDate = dateUtil.isDate(newVal[0]) ? new Date(newVal[0]) : null;
|
|
4373
|
+
this.maxDate = dateUtil.isDate(newVal[1]) ? new Date(newVal[1]) : null;
|
|
5648
4374
|
if (this.minDate) {
|
|
5649
4375
|
this.leftDate = this.minDate;
|
|
5650
4376
|
if (this.unlinkPanels && this.maxDate) {
|
|
@@ -5652,13 +4378,13 @@ const _sfc_main$2 = {
|
|
|
5652
4378
|
const minDateMonth = this.minDate.getMonth();
|
|
5653
4379
|
const maxDateYear = this.maxDate.getFullYear();
|
|
5654
4380
|
const maxDateMonth = this.maxDate.getMonth();
|
|
5655
|
-
this.rightDate = minDateYear === maxDateYear && minDateMonth === maxDateMonth ? nextMonth(this.maxDate) : this.maxDate;
|
|
4381
|
+
this.rightDate = minDateYear === maxDateYear && minDateMonth === maxDateMonth ? dateUtil.nextMonth(this.maxDate) : this.maxDate;
|
|
5656
4382
|
} else {
|
|
5657
|
-
this.rightDate = nextMonth(this.leftDate);
|
|
4383
|
+
this.rightDate = dateUtil.nextMonth(this.leftDate);
|
|
5658
4384
|
}
|
|
5659
4385
|
} else {
|
|
5660
4386
|
this.leftDate = calcDefaultValue$1(this.defaultValue)[0];
|
|
5661
|
-
this.rightDate = nextMonth(this.leftDate);
|
|
4387
|
+
this.rightDate = dateUtil.nextMonth(this.leftDate);
|
|
5662
4388
|
}
|
|
5663
4389
|
}
|
|
5664
4390
|
},
|
|
@@ -5666,7 +4392,7 @@ const _sfc_main$2 = {
|
|
|
5666
4392
|
if (!Array.isArray(this.value)) {
|
|
5667
4393
|
const [left, right] = calcDefaultValue$1(val);
|
|
5668
4394
|
this.leftDate = left;
|
|
5669
|
-
this.rightDate = val && val[1] && this.unlinkPanels ? right : nextMonth(this.leftDate);
|
|
4395
|
+
this.rightDate = val && val[1] && this.unlinkPanels ? right : dateUtil.nextMonth(this.leftDate);
|
|
5670
4396
|
}
|
|
5671
4397
|
}
|
|
5672
4398
|
},
|
|
@@ -5675,7 +4401,7 @@ const _sfc_main$2 = {
|
|
|
5675
4401
|
this.minDate = null;
|
|
5676
4402
|
this.maxDate = null;
|
|
5677
4403
|
this.leftDate = calcDefaultValue$1(this.defaultValue)[0];
|
|
5678
|
-
this.rightDate = nextMonth(this.leftDate);
|
|
4404
|
+
this.rightDate = dateUtil.nextMonth(this.leftDate);
|
|
5679
4405
|
this.$emit("pick", null);
|
|
5680
4406
|
},
|
|
5681
4407
|
handleChangeRange(val) {
|
|
@@ -5687,36 +4413,36 @@ const _sfc_main$2 = {
|
|
|
5687
4413
|
this.dateUserInput[type] = value;
|
|
5688
4414
|
if (value.length !== this.dateFormat.length)
|
|
5689
4415
|
return;
|
|
5690
|
-
const parsedValue = parseDate(value, this.dateFormat);
|
|
4416
|
+
const parsedValue = dateUtil.parseDate(value, this.dateFormat);
|
|
5691
4417
|
if (parsedValue) {
|
|
5692
4418
|
if (typeof this.disabledDate === "function" && this.disabledDate(new Date(parsedValue))) {
|
|
5693
4419
|
return;
|
|
5694
4420
|
}
|
|
5695
4421
|
if (type === "min") {
|
|
5696
|
-
this.minDate = modifyDate(this.minDate || /* @__PURE__ */ new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
|
|
4422
|
+
this.minDate = dateUtil.modifyDate(this.minDate || /* @__PURE__ */ new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
|
|
5697
4423
|
this.leftDate = new Date(parsedValue);
|
|
5698
4424
|
if (!this.unlinkPanels) {
|
|
5699
|
-
this.rightDate = nextMonth(this.leftDate);
|
|
4425
|
+
this.rightDate = dateUtil.nextMonth(this.leftDate);
|
|
5700
4426
|
}
|
|
5701
4427
|
} else {
|
|
5702
|
-
this.maxDate = modifyDate(this.maxDate || /* @__PURE__ */ new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
|
|
4428
|
+
this.maxDate = dateUtil.modifyDate(this.maxDate || /* @__PURE__ */ new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
|
|
5703
4429
|
this.rightDate = new Date(parsedValue);
|
|
5704
4430
|
if (!this.unlinkPanels) {
|
|
5705
|
-
this.leftDate = prevMonth(parsedValue);
|
|
4431
|
+
this.leftDate = dateUtil.prevMonth(parsedValue);
|
|
5706
4432
|
}
|
|
5707
4433
|
}
|
|
5708
4434
|
}
|
|
5709
4435
|
},
|
|
5710
4436
|
handleDateChange(value, type) {
|
|
5711
|
-
const parsedValue = parseDate(value, this.dateFormat);
|
|
4437
|
+
const parsedValue = dateUtil.parseDate(value, this.dateFormat);
|
|
5712
4438
|
if (parsedValue) {
|
|
5713
4439
|
if (type === "min") {
|
|
5714
|
-
this.minDate = modifyDate(this.minDate, parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
|
|
4440
|
+
this.minDate = dateUtil.modifyDate(this.minDate, parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
|
|
5715
4441
|
if (this.minDate > this.maxDate) {
|
|
5716
4442
|
this.maxDate = this.minDate;
|
|
5717
4443
|
}
|
|
5718
4444
|
} else {
|
|
5719
|
-
this.maxDate = modifyDate(this.maxDate, parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
|
|
4445
|
+
this.maxDate = dateUtil.modifyDate(this.maxDate, parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
|
|
5720
4446
|
if (this.maxDate < this.minDate) {
|
|
5721
4447
|
this.minDate = this.maxDate;
|
|
5722
4448
|
}
|
|
@@ -5727,29 +4453,29 @@ const _sfc_main$2 = {
|
|
|
5727
4453
|
this.timeUserInput[type] = value;
|
|
5728
4454
|
if (value.length !== this.timeFormat.length)
|
|
5729
4455
|
return;
|
|
5730
|
-
const parsedValue = parseDate(value, this.timeFormat);
|
|
4456
|
+
const parsedValue = dateUtil.parseDate(value, this.timeFormat);
|
|
5731
4457
|
if (parsedValue) {
|
|
5732
4458
|
if (type === "min") {
|
|
5733
|
-
this.minDate = modifyTime(this.minDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
|
|
4459
|
+
this.minDate = dateUtil.modifyTime(this.minDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
|
|
5734
4460
|
this.$nextTick((_) => this.$refs.minTimePicker.adjustSpinners());
|
|
5735
4461
|
} else {
|
|
5736
|
-
this.maxDate = modifyTime(this.maxDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
|
|
4462
|
+
this.maxDate = dateUtil.modifyTime(this.maxDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
|
|
5737
4463
|
this.$nextTick((_) => this.$refs.maxTimePicker.adjustSpinners());
|
|
5738
4464
|
}
|
|
5739
4465
|
}
|
|
5740
4466
|
},
|
|
5741
4467
|
handleTimeChange(value, type) {
|
|
5742
|
-
const parsedValue = parseDate(value, this.timeFormat);
|
|
4468
|
+
const parsedValue = dateUtil.parseDate(value, this.timeFormat);
|
|
5743
4469
|
if (parsedValue) {
|
|
5744
4470
|
if (type === "min") {
|
|
5745
|
-
this.minDate = modifyTime(this.minDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
|
|
4471
|
+
this.minDate = dateUtil.modifyTime(this.minDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
|
|
5746
4472
|
if (this.minDate > this.maxDate) {
|
|
5747
4473
|
this.maxDate = this.minDate;
|
|
5748
4474
|
}
|
|
5749
4475
|
this.$refs.minTimePicker.value = this.minDate;
|
|
5750
4476
|
this.minTimePickerVisible = false;
|
|
5751
4477
|
} else {
|
|
5752
|
-
this.maxDate = modifyTime(this.maxDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
|
|
4478
|
+
this.maxDate = dateUtil.modifyTime(this.maxDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
|
|
5753
4479
|
if (this.maxDate < this.minDate) {
|
|
5754
4480
|
this.minDate = this.maxDate;
|
|
5755
4481
|
}
|
|
@@ -5760,8 +4486,8 @@ const _sfc_main$2 = {
|
|
|
5760
4486
|
},
|
|
5761
4487
|
handleRangePick(val, close = true) {
|
|
5762
4488
|
const defaultTime = this.defaultTime || [];
|
|
5763
|
-
const minDate = modifyWithTimeString(val.minDate, defaultTime[0]);
|
|
5764
|
-
const maxDate = modifyWithTimeString(val.maxDate, defaultTime[1]);
|
|
4489
|
+
const minDate = dateUtil.modifyWithTimeString(val.minDate, defaultTime[0]);
|
|
4490
|
+
const maxDate = dateUtil.modifyWithTimeString(val.maxDate, defaultTime[1]);
|
|
5765
4491
|
if (this.maxDate === maxDate && this.minDate === minDate) {
|
|
5766
4492
|
return;
|
|
5767
4493
|
}
|
|
@@ -5784,7 +4510,7 @@ const _sfc_main$2 = {
|
|
|
5784
4510
|
handleMinTimePick(value, visible, first) {
|
|
5785
4511
|
this.minDate = this.minDate || /* @__PURE__ */ new Date();
|
|
5786
4512
|
if (value) {
|
|
5787
|
-
this.minDate = modifyTime(this.minDate, value.getHours(), value.getMinutes(), value.getSeconds());
|
|
4513
|
+
this.minDate = dateUtil.modifyTime(this.minDate, value.getHours(), value.getMinutes(), value.getSeconds());
|
|
5788
4514
|
}
|
|
5789
4515
|
if (!first) {
|
|
5790
4516
|
this.minTimePickerVisible = visible;
|
|
@@ -5798,7 +4524,7 @@ const _sfc_main$2 = {
|
|
|
5798
4524
|
},
|
|
5799
4525
|
handleMaxTimePick(value, visible, first) {
|
|
5800
4526
|
if (this.maxDate && value) {
|
|
5801
|
-
this.maxDate = modifyTime(this.maxDate, value.getHours(), value.getMinutes(), value.getSeconds());
|
|
4527
|
+
this.maxDate = dateUtil.modifyTime(this.maxDate, value.getHours(), value.getMinutes(), value.getSeconds());
|
|
5802
4528
|
}
|
|
5803
4529
|
if (!first) {
|
|
5804
4530
|
this.maxTimePickerVisible = visible;
|
|
@@ -5812,45 +4538,45 @@ const _sfc_main$2 = {
|
|
|
5812
4538
|
},
|
|
5813
4539
|
// leftPrev*, rightNext* need to take care of `unlinkPanels`
|
|
5814
4540
|
leftPrevYear() {
|
|
5815
|
-
this.leftDate = prevYear(this.leftDate);
|
|
4541
|
+
this.leftDate = dateUtil.prevYear(this.leftDate);
|
|
5816
4542
|
if (!this.unlinkPanels) {
|
|
5817
|
-
this.rightDate = nextMonth(this.leftDate);
|
|
4543
|
+
this.rightDate = dateUtil.nextMonth(this.leftDate);
|
|
5818
4544
|
}
|
|
5819
4545
|
},
|
|
5820
4546
|
leftPrevMonth() {
|
|
5821
|
-
this.leftDate = prevMonth(this.leftDate);
|
|
4547
|
+
this.leftDate = dateUtil.prevMonth(this.leftDate);
|
|
5822
4548
|
if (!this.unlinkPanels) {
|
|
5823
|
-
this.rightDate = nextMonth(this.leftDate);
|
|
4549
|
+
this.rightDate = dateUtil.nextMonth(this.leftDate);
|
|
5824
4550
|
}
|
|
5825
4551
|
},
|
|
5826
4552
|
rightNextYear() {
|
|
5827
4553
|
if (!this.unlinkPanels) {
|
|
5828
|
-
this.leftDate = nextYear(this.leftDate);
|
|
5829
|
-
this.rightDate = nextMonth(this.leftDate);
|
|
4554
|
+
this.leftDate = dateUtil.nextYear(this.leftDate);
|
|
4555
|
+
this.rightDate = dateUtil.nextMonth(this.leftDate);
|
|
5830
4556
|
} else {
|
|
5831
|
-
this.rightDate = nextYear(this.rightDate);
|
|
4557
|
+
this.rightDate = dateUtil.nextYear(this.rightDate);
|
|
5832
4558
|
}
|
|
5833
4559
|
},
|
|
5834
4560
|
rightNextMonth() {
|
|
5835
4561
|
if (!this.unlinkPanels) {
|
|
5836
|
-
this.leftDate = nextMonth(this.leftDate);
|
|
5837
|
-
this.rightDate = nextMonth(this.leftDate);
|
|
4562
|
+
this.leftDate = dateUtil.nextMonth(this.leftDate);
|
|
4563
|
+
this.rightDate = dateUtil.nextMonth(this.leftDate);
|
|
5838
4564
|
} else {
|
|
5839
|
-
this.rightDate = nextMonth(this.rightDate);
|
|
4565
|
+
this.rightDate = dateUtil.nextMonth(this.rightDate);
|
|
5840
4566
|
}
|
|
5841
4567
|
},
|
|
5842
4568
|
// leftNext*, rightPrev* are called when `unlinkPanels` is true
|
|
5843
4569
|
leftNextYear() {
|
|
5844
|
-
this.leftDate = nextYear(this.leftDate);
|
|
4570
|
+
this.leftDate = dateUtil.nextYear(this.leftDate);
|
|
5845
4571
|
},
|
|
5846
4572
|
leftNextMonth() {
|
|
5847
|
-
this.leftDate = nextMonth(this.leftDate);
|
|
4573
|
+
this.leftDate = dateUtil.nextMonth(this.leftDate);
|
|
5848
4574
|
},
|
|
5849
4575
|
rightPrevYear() {
|
|
5850
|
-
this.rightDate = prevYear(this.rightDate);
|
|
4576
|
+
this.rightDate = dateUtil.prevYear(this.rightDate);
|
|
5851
4577
|
},
|
|
5852
4578
|
rightPrevMonth() {
|
|
5853
|
-
this.rightDate = prevMonth(this.rightDate);
|
|
4579
|
+
this.rightDate = dateUtil.prevMonth(this.rightDate);
|
|
5854
4580
|
},
|
|
5855
4581
|
handleConfirm(visible = false) {
|
|
5856
4582
|
if (this.isValidValue([this.minDate, this.maxDate])) {
|
|
@@ -5858,13 +4584,13 @@ const _sfc_main$2 = {
|
|
|
5858
4584
|
}
|
|
5859
4585
|
},
|
|
5860
4586
|
isValidValue(value) {
|
|
5861
|
-
return Array.isArray(value) && value && value[0] && value[1] && isDate(value[0]) && isDate(value[1]) && value[0].getTime() <= value[1].getTime() && (typeof this.disabledDate === "function" ? !this.disabledDate(value[0]) && !this.disabledDate(value[1]) : true);
|
|
4587
|
+
return Array.isArray(value) && value && value[0] && value[1] && dateUtil.isDate(value[0]) && dateUtil.isDate(value[1]) && value[0].getTime() <= value[1].getTime() && (typeof this.disabledDate === "function" ? !this.disabledDate(value[0]) && !this.disabledDate(value[1]) : true);
|
|
5862
4588
|
},
|
|
5863
4589
|
resetView() {
|
|
5864
4590
|
if (this.minDate && this.maxDate == null)
|
|
5865
4591
|
this.rangeState.selecting = false;
|
|
5866
|
-
this.minDate = this.value && isDate(this.value[0]) ? new Date(this.value[0]) : null;
|
|
5867
|
-
this.maxDate = this.value && isDate(this.value[0]) ? new Date(this.value[1]) : null;
|
|
4592
|
+
this.minDate = this.value && dateUtil.isDate(this.value[0]) ? new Date(this.value[0]) : null;
|
|
4593
|
+
this.maxDate = this.value && dateUtil.isDate(this.value[0]) ? new Date(this.value[1]) : null;
|
|
5868
4594
|
}
|
|
5869
4595
|
}
|
|
5870
4596
|
};
|
|
@@ -6173,9 +4899,9 @@ const calcDefaultValue = (defaultValue) => {
|
|
|
6173
4899
|
if (Array.isArray(defaultValue)) {
|
|
6174
4900
|
return [new Date(defaultValue[0]), new Date(defaultValue[1])];
|
|
6175
4901
|
} else if (defaultValue) {
|
|
6176
|
-
return [new Date(defaultValue), nextMonth(new Date(defaultValue))];
|
|
4902
|
+
return [new Date(defaultValue), dateUtil.nextMonth(new Date(defaultValue))];
|
|
6177
4903
|
} else {
|
|
6178
|
-
return [/* @__PURE__ */ new Date(), nextMonth(/* @__PURE__ */ new Date())];
|
|
4904
|
+
return [/* @__PURE__ */ new Date(), dateUtil.nextMonth(/* @__PURE__ */ new Date())];
|
|
6179
4905
|
}
|
|
6180
4906
|
};
|
|
6181
4907
|
const _sfc_main$1 = {
|
|
@@ -6185,7 +4911,7 @@ const _sfc_main$1 = {
|
|
|
6185
4911
|
components: {
|
|
6186
4912
|
MonthTable
|
|
6187
4913
|
},
|
|
6188
|
-
mixins: [
|
|
4914
|
+
mixins: [Locale],
|
|
6189
4915
|
data() {
|
|
6190
4916
|
return {
|
|
6191
4917
|
popperClass: "",
|
|
@@ -6195,7 +4921,7 @@ const _sfc_main$1 = {
|
|
|
6195
4921
|
minDate: "",
|
|
6196
4922
|
maxDate: "",
|
|
6197
4923
|
leftDate: /* @__PURE__ */ new Date(),
|
|
6198
|
-
rightDate: nextYear(/* @__PURE__ */ new Date()),
|
|
4924
|
+
rightDate: dateUtil.nextYear(/* @__PURE__ */ new Date()),
|
|
6199
4925
|
rangeState: {
|
|
6200
4926
|
endDate: null,
|
|
6201
4927
|
selecting: false,
|
|
@@ -6236,20 +4962,20 @@ const _sfc_main$1 = {
|
|
|
6236
4962
|
this.minDate = null;
|
|
6237
4963
|
this.maxDate = null;
|
|
6238
4964
|
} else if (Array.isArray(newVal)) {
|
|
6239
|
-
this.minDate = isDate(newVal[0]) ? new Date(newVal[0]) : null;
|
|
6240
|
-
this.maxDate = isDate(newVal[1]) ? new Date(newVal[1]) : null;
|
|
4965
|
+
this.minDate = dateUtil.isDate(newVal[0]) ? new Date(newVal[0]) : null;
|
|
4966
|
+
this.maxDate = dateUtil.isDate(newVal[1]) ? new Date(newVal[1]) : null;
|
|
6241
4967
|
if (this.minDate) {
|
|
6242
4968
|
this.leftDate = this.minDate;
|
|
6243
4969
|
if (this.unlinkPanels && this.maxDate) {
|
|
6244
4970
|
const minDateYear = this.minDate.getFullYear();
|
|
6245
4971
|
const maxDateYear = this.maxDate.getFullYear();
|
|
6246
|
-
this.rightDate = minDateYear === maxDateYear ? nextYear(this.maxDate) : this.maxDate;
|
|
4972
|
+
this.rightDate = minDateYear === maxDateYear ? dateUtil.nextYear(this.maxDate) : this.maxDate;
|
|
6247
4973
|
} else {
|
|
6248
|
-
this.rightDate = nextYear(this.leftDate);
|
|
4974
|
+
this.rightDate = dateUtil.nextYear(this.leftDate);
|
|
6249
4975
|
}
|
|
6250
4976
|
} else {
|
|
6251
4977
|
this.leftDate = calcDefaultValue(this.defaultValue)[0];
|
|
6252
|
-
this.rightDate = nextYear(this.leftDate);
|
|
4978
|
+
this.rightDate = dateUtil.nextYear(this.leftDate);
|
|
6253
4979
|
}
|
|
6254
4980
|
}
|
|
6255
4981
|
},
|
|
@@ -6257,7 +4983,7 @@ const _sfc_main$1 = {
|
|
|
6257
4983
|
if (!Array.isArray(this.value)) {
|
|
6258
4984
|
const [left, right] = calcDefaultValue(val);
|
|
6259
4985
|
this.leftDate = left;
|
|
6260
|
-
this.rightDate = val && val[1] && left.getFullYear() !== right.getFullYear() && this.unlinkPanels ? right : nextYear(this.leftDate);
|
|
4986
|
+
this.rightDate = val && val[1] && left.getFullYear() !== right.getFullYear() && this.unlinkPanels ? right : dateUtil.nextYear(this.leftDate);
|
|
6261
4987
|
}
|
|
6262
4988
|
}
|
|
6263
4989
|
},
|
|
@@ -6266,7 +4992,7 @@ const _sfc_main$1 = {
|
|
|
6266
4992
|
this.minDate = null;
|
|
6267
4993
|
this.maxDate = null;
|
|
6268
4994
|
this.leftDate = calcDefaultValue(this.defaultValue)[0];
|
|
6269
|
-
this.rightDate = nextYear(this.leftDate);
|
|
4995
|
+
this.rightDate = dateUtil.nextYear(this.leftDate);
|
|
6270
4996
|
this.$emit("pick", null);
|
|
6271
4997
|
},
|
|
6272
4998
|
handleChangeRange(val) {
|
|
@@ -6276,8 +5002,8 @@ const _sfc_main$1 = {
|
|
|
6276
5002
|
},
|
|
6277
5003
|
handleRangePick(val, close = true) {
|
|
6278
5004
|
const defaultTime = this.defaultTime || [];
|
|
6279
|
-
const minDate = modifyWithTimeString(val.minDate, defaultTime[0]);
|
|
6280
|
-
const maxDate = modifyWithTimeString(val.maxDate, defaultTime[1]);
|
|
5005
|
+
const minDate = dateUtil.modifyWithTimeString(val.minDate, defaultTime[0]);
|
|
5006
|
+
const maxDate = dateUtil.modifyWithTimeString(val.maxDate, defaultTime[1]);
|
|
6281
5007
|
if (this.maxDate === maxDate && this.minDate === minDate) {
|
|
6282
5008
|
return;
|
|
6283
5009
|
}
|
|
@@ -6299,23 +5025,23 @@ const _sfc_main$1 = {
|
|
|
6299
5025
|
},
|
|
6300
5026
|
// leftPrev*, rightNext* need to take care of `unlinkPanels`
|
|
6301
5027
|
leftPrevYear() {
|
|
6302
|
-
this.leftDate = prevYear(this.leftDate);
|
|
5028
|
+
this.leftDate = dateUtil.prevYear(this.leftDate);
|
|
6303
5029
|
if (!this.unlinkPanels) {
|
|
6304
|
-
this.rightDate = prevYear(this.rightDate);
|
|
5030
|
+
this.rightDate = dateUtil.prevYear(this.rightDate);
|
|
6305
5031
|
}
|
|
6306
5032
|
},
|
|
6307
5033
|
rightNextYear() {
|
|
6308
5034
|
if (!this.unlinkPanels) {
|
|
6309
|
-
this.leftDate = nextYear(this.leftDate);
|
|
5035
|
+
this.leftDate = dateUtil.nextYear(this.leftDate);
|
|
6310
5036
|
}
|
|
6311
|
-
this.rightDate = nextYear(this.rightDate);
|
|
5037
|
+
this.rightDate = dateUtil.nextYear(this.rightDate);
|
|
6312
5038
|
},
|
|
6313
5039
|
// leftNext*, rightPrev* are called when `unlinkPanels` is true
|
|
6314
5040
|
leftNextYear() {
|
|
6315
|
-
this.leftDate = nextYear(this.leftDate);
|
|
5041
|
+
this.leftDate = dateUtil.nextYear(this.leftDate);
|
|
6316
5042
|
},
|
|
6317
5043
|
rightPrevYear() {
|
|
6318
|
-
this.rightDate = prevYear(this.rightDate);
|
|
5044
|
+
this.rightDate = dateUtil.prevYear(this.rightDate);
|
|
6319
5045
|
},
|
|
6320
5046
|
handleConfirm(visible = false) {
|
|
6321
5047
|
if (this.isValidValue([this.minDate, this.maxDate])) {
|
|
@@ -6323,11 +5049,11 @@ const _sfc_main$1 = {
|
|
|
6323
5049
|
}
|
|
6324
5050
|
},
|
|
6325
5051
|
isValidValue(value) {
|
|
6326
|
-
return Array.isArray(value) && value && value[0] && value[1] && isDate(value[0]) && isDate(value[1]) && value[0].getTime() <= value[1].getTime() && (typeof this.disabledDate === "function" ? !this.disabledDate(value[0]) && !this.disabledDate(value[1]) : true);
|
|
5052
|
+
return Array.isArray(value) && value && value[0] && value[1] && dateUtil.isDate(value[0]) && dateUtil.isDate(value[1]) && value[0].getTime() <= value[1].getTime() && (typeof this.disabledDate === "function" ? !this.disabledDate(value[0]) && !this.disabledDate(value[1]) : true);
|
|
6327
5053
|
},
|
|
6328
5054
|
resetView() {
|
|
6329
|
-
this.minDate = this.value && isDate(this.value[0]) ? new Date(this.value[0]) : null;
|
|
6330
|
-
this.maxDate = this.value && isDate(this.value[0]) ? new Date(this.value[1]) : null;
|
|
5055
|
+
this.minDate = this.value && dateUtil.isDate(this.value[0]) ? new Date(this.value[0]) : null;
|
|
5056
|
+
this.maxDate = this.value && dateUtil.isDate(this.value[0]) ? new Date(this.value[1]) : null;
|
|
6331
5057
|
}
|
|
6332
5058
|
}
|
|
6333
5059
|
};
|