@94ai/nf-double-week 3.1.13

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.
@@ -0,0 +1,3679 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const Vue = require("vue");
4
+ const vue2RuntimeHelpers = require("@94ai/vue2-runtime-helpers");
5
+ function _mergeNamespaces(n, m) {
6
+ for (var i = 0; i < m.length; i++) {
7
+ const e = m[i];
8
+ if (typeof e !== "string" && !Array.isArray(e)) {
9
+ for (const k in e) {
10
+ if (k !== "default" && !(k in n)) {
11
+ const d = Object.getOwnPropertyDescriptor(e, k);
12
+ if (d) {
13
+ Object.defineProperty(n, k, d.get ? d : {
14
+ enumerable: true,
15
+ get: () => e[k]
16
+ });
17
+ }
18
+ }
19
+ }
20
+ }
21
+ }
22
+ return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
23
+ }
24
+ const isServer = Vue.prototype.$isServer;
25
+ const trim = function(string) {
26
+ return (string || "").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, "");
27
+ };
28
+ const on = function() {
29
+ if (!isServer && document.addEventListener) {
30
+ return function(element, event, handler) {
31
+ if (element && event && handler) {
32
+ element.addEventListener(event, handler, false);
33
+ }
34
+ };
35
+ } else {
36
+ return function(element, event, handler) {
37
+ if (element && event && handler) {
38
+ element.attachEvent("on" + event, handler);
39
+ }
40
+ };
41
+ }
42
+ }();
43
+ function hasClass(el, cls) {
44
+ if (!el || !cls)
45
+ return false;
46
+ if (cls.indexOf(" ") !== -1)
47
+ throw new Error("className should not contain space.");
48
+ if (el.classList) {
49
+ return el.classList.contains(cls);
50
+ } else {
51
+ return (" " + el.className + " ").indexOf(" " + cls + " ") > -1;
52
+ }
53
+ }
54
+ function addClass(el, cls) {
55
+ if (!el)
56
+ return;
57
+ var curClass = el.className;
58
+ var classes = (cls || "").split(" ");
59
+ for (var i = 0, j = classes.length; i < j; i++) {
60
+ var clsName = classes[i];
61
+ if (!clsName)
62
+ continue;
63
+ if (el.classList) {
64
+ el.classList.add(clsName);
65
+ } else if (!hasClass(el, clsName)) {
66
+ curClass += " " + clsName;
67
+ }
68
+ }
69
+ if (!el.classList) {
70
+ el.className = curClass;
71
+ }
72
+ }
73
+ function removeClass(el, cls) {
74
+ if (!el || !cls)
75
+ return;
76
+ var classes = cls.split(" ");
77
+ var curClass = " " + el.className + " ";
78
+ for (var i = 0, j = classes.length; i < j; i++) {
79
+ var clsName = classes[i];
80
+ if (!clsName)
81
+ continue;
82
+ if (el.classList) {
83
+ el.classList.remove(clsName);
84
+ } else if (hasClass(el, clsName)) {
85
+ curClass = curClass.replace(" " + clsName + " ", " ");
86
+ }
87
+ }
88
+ if (!el.classList) {
89
+ el.className = trim(curClass);
90
+ }
91
+ }
92
+ const nodeList = [];
93
+ const ctx = "@@clickoutsideContext";
94
+ let startClick;
95
+ let seed = 0;
96
+ !Vue.prototype.$isServer && on(document, "mousedown", (e) => startClick = e);
97
+ !Vue.prototype.$isServer && on(document, "mouseup", (e) => {
98
+ nodeList.forEach((node) => node[ctx].documentHandler(e, startClick));
99
+ });
100
+ function createDocumentHandler(el, binding, vnode) {
101
+ return function(mouseup = {}, mousedown = {}) {
102
+ if (!vnode || !vnode.context || !mouseup.target || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target || vnode.context.popperElm && (vnode.context.popperElm.contains(mouseup.target) || vnode.context.popperElm.contains(mousedown.target)))
103
+ return;
104
+ if (binding.expression && el[ctx].methodName && vnode.context[el[ctx].methodName]) {
105
+ vnode.context[el[ctx].methodName]();
106
+ } else {
107
+ el[ctx].bindingFn && el[ctx].bindingFn();
108
+ }
109
+ };
110
+ }
111
+ const Clickoutside = {
112
+ bind(el, binding, vnode) {
113
+ nodeList.push(el);
114
+ const id = seed++;
115
+ el[ctx] = {
116
+ id,
117
+ documentHandler: createDocumentHandler(el, binding, vnode),
118
+ methodName: binding.expression,
119
+ bindingFn: binding.value
120
+ };
121
+ },
122
+ update(el, binding, vnode) {
123
+ el[ctx].documentHandler = createDocumentHandler(el, binding, vnode);
124
+ el[ctx].methodName = binding.expression;
125
+ el[ctx].bindingFn = binding.value;
126
+ },
127
+ unbind(el) {
128
+ let len = nodeList.length;
129
+ for (let i = 0; i < len; i++) {
130
+ if (nodeList[i][ctx].id === el[ctx].id) {
131
+ nodeList.splice(i, 1);
132
+ break;
133
+ }
134
+ }
135
+ delete el[ctx];
136
+ }
137
+ };
138
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
139
+ function getDefaultExportFromCjs(x) {
140
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
141
+ }
142
+ var date = { exports: {} };
143
+ (function(module2) {
144
+ (function(main) {
145
+ var fecha2 = {};
146
+ var token = /d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
147
+ var twoDigits = "\\d\\d?";
148
+ var threeDigits = "\\d{3}";
149
+ var fourDigits = "\\d{4}";
150
+ var word = "[^\\s]+";
151
+ var literal = /\[([^]*?)\]/gm;
152
+ var noop = function() {
153
+ };
154
+ function regexEscape(str) {
155
+ return str.replace(/[|\\{()[^$+*?.-]/g, "\\$&");
156
+ }
157
+ function shorten(arr, sLen) {
158
+ var newArr = [];
159
+ for (var i = 0, len = arr.length; i < len; i++) {
160
+ newArr.push(arr[i].substr(0, sLen));
161
+ }
162
+ return newArr;
163
+ }
164
+ function monthUpdate(arrName) {
165
+ return function(d, v, i18n) {
166
+ var index = i18n[arrName].indexOf(v.charAt(0).toUpperCase() + v.substr(1).toLowerCase());
167
+ if (~index) {
168
+ d.month = index;
169
+ }
170
+ };
171
+ }
172
+ function pad(val, len) {
173
+ val = String(val);
174
+ len = len || 2;
175
+ while (val.length < len) {
176
+ val = "0" + val;
177
+ }
178
+ return val;
179
+ }
180
+ var dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
181
+ var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
182
+ var monthNamesShort = shorten(monthNames, 3);
183
+ var dayNamesShort = shorten(dayNames, 3);
184
+ fecha2.i18n = {
185
+ dayNamesShort,
186
+ dayNames,
187
+ monthNamesShort,
188
+ monthNames,
189
+ amPm: ["am", "pm"],
190
+ DoFn: function DoFn(D) {
191
+ return D + ["th", "st", "nd", "rd"][D % 10 > 3 ? 0 : (D - D % 10 !== 10) * D % 10];
192
+ }
193
+ };
194
+ var formatFlags = {
195
+ D: function(dateObj) {
196
+ return dateObj.getDay();
197
+ },
198
+ DD: function(dateObj) {
199
+ return pad(dateObj.getDay());
200
+ },
201
+ Do: function(dateObj, i18n) {
202
+ return i18n.DoFn(dateObj.getDate());
203
+ },
204
+ d: function(dateObj) {
205
+ return dateObj.getDate();
206
+ },
207
+ dd: function(dateObj) {
208
+ return pad(dateObj.getDate());
209
+ },
210
+ ddd: function(dateObj, i18n) {
211
+ return i18n.dayNamesShort[dateObj.getDay()];
212
+ },
213
+ dddd: function(dateObj, i18n) {
214
+ return i18n.dayNames[dateObj.getDay()];
215
+ },
216
+ M: function(dateObj) {
217
+ return dateObj.getMonth() + 1;
218
+ },
219
+ MM: function(dateObj) {
220
+ return pad(dateObj.getMonth() + 1);
221
+ },
222
+ MMM: function(dateObj, i18n) {
223
+ return i18n.monthNamesShort[dateObj.getMonth()];
224
+ },
225
+ MMMM: function(dateObj, i18n) {
226
+ return i18n.monthNames[dateObj.getMonth()];
227
+ },
228
+ yy: function(dateObj) {
229
+ return pad(String(dateObj.getFullYear()), 4).substr(2);
230
+ },
231
+ yyyy: function(dateObj) {
232
+ return pad(dateObj.getFullYear(), 4);
233
+ },
234
+ h: function(dateObj) {
235
+ return dateObj.getHours() % 12 || 12;
236
+ },
237
+ hh: function(dateObj) {
238
+ return pad(dateObj.getHours() % 12 || 12);
239
+ },
240
+ H: function(dateObj) {
241
+ return dateObj.getHours();
242
+ },
243
+ HH: function(dateObj) {
244
+ return pad(dateObj.getHours());
245
+ },
246
+ m: function(dateObj) {
247
+ return dateObj.getMinutes();
248
+ },
249
+ mm: function(dateObj) {
250
+ return pad(dateObj.getMinutes());
251
+ },
252
+ s: function(dateObj) {
253
+ return dateObj.getSeconds();
254
+ },
255
+ ss: function(dateObj) {
256
+ return pad(dateObj.getSeconds());
257
+ },
258
+ S: function(dateObj) {
259
+ return Math.round(dateObj.getMilliseconds() / 100);
260
+ },
261
+ SS: function(dateObj) {
262
+ return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
263
+ },
264
+ SSS: function(dateObj) {
265
+ return pad(dateObj.getMilliseconds(), 3);
266
+ },
267
+ a: function(dateObj, i18n) {
268
+ return dateObj.getHours() < 12 ? i18n.amPm[0] : i18n.amPm[1];
269
+ },
270
+ A: function(dateObj, i18n) {
271
+ return dateObj.getHours() < 12 ? i18n.amPm[0].toUpperCase() : i18n.amPm[1].toUpperCase();
272
+ },
273
+ ZZ: function(dateObj) {
274
+ var o = dateObj.getTimezoneOffset();
275
+ return (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);
276
+ }
277
+ };
278
+ var parseFlags = {
279
+ d: [twoDigits, function(d, v) {
280
+ d.day = v;
281
+ }],
282
+ Do: [twoDigits + word, function(d, v) {
283
+ d.day = parseInt(v, 10);
284
+ }],
285
+ M: [twoDigits, function(d, v) {
286
+ d.month = v - 1;
287
+ }],
288
+ yy: [twoDigits, function(d, v) {
289
+ var da = /* @__PURE__ */ new Date(), cent = +("" + da.getFullYear()).substr(0, 2);
290
+ d.year = "" + (v > 68 ? cent - 1 : cent) + v;
291
+ }],
292
+ h: [twoDigits, function(d, v) {
293
+ d.hour = v;
294
+ }],
295
+ m: [twoDigits, function(d, v) {
296
+ d.minute = v;
297
+ }],
298
+ s: [twoDigits, function(d, v) {
299
+ d.second = v;
300
+ }],
301
+ yyyy: [fourDigits, function(d, v) {
302
+ d.year = v;
303
+ }],
304
+ S: ["\\d", function(d, v) {
305
+ d.millisecond = v * 100;
306
+ }],
307
+ SS: ["\\d{2}", function(d, v) {
308
+ d.millisecond = v * 10;
309
+ }],
310
+ SSS: [threeDigits, function(d, v) {
311
+ d.millisecond = v;
312
+ }],
313
+ D: [twoDigits, noop],
314
+ ddd: [word, noop],
315
+ MMM: [word, monthUpdate("monthNamesShort")],
316
+ MMMM: [word, monthUpdate("monthNames")],
317
+ a: [word, function(d, v, i18n) {
318
+ var val = v.toLowerCase();
319
+ if (val === i18n.amPm[0]) {
320
+ d.isPm = false;
321
+ } else if (val === i18n.amPm[1]) {
322
+ d.isPm = true;
323
+ }
324
+ }],
325
+ ZZ: ["[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z", function(d, v) {
326
+ var parts = (v + "").match(/([+-]|\d\d)/gi), minutes;
327
+ if (parts) {
328
+ minutes = +(parts[1] * 60) + parseInt(parts[2], 10);
329
+ d.timezoneOffset = parts[0] === "+" ? minutes : -minutes;
330
+ }
331
+ }]
332
+ };
333
+ parseFlags.dd = parseFlags.d;
334
+ parseFlags.dddd = parseFlags.ddd;
335
+ parseFlags.DD = parseFlags.D;
336
+ parseFlags.mm = parseFlags.m;
337
+ parseFlags.hh = parseFlags.H = parseFlags.HH = parseFlags.h;
338
+ parseFlags.MM = parseFlags.M;
339
+ parseFlags.ss = parseFlags.s;
340
+ parseFlags.A = parseFlags.a;
341
+ fecha2.masks = {
342
+ default: "ddd MMM dd yyyy HH:mm:ss",
343
+ shortDate: "M/D/yy",
344
+ mediumDate: "MMM d, yyyy",
345
+ longDate: "MMMM d, yyyy",
346
+ fullDate: "dddd, MMMM d, yyyy",
347
+ shortTime: "HH:mm",
348
+ mediumTime: "HH:mm:ss",
349
+ longTime: "HH:mm:ss.SSS"
350
+ };
351
+ fecha2.format = function(dateObj, mask, i18nSettings) {
352
+ var i18n = i18nSettings || fecha2.i18n;
353
+ if (typeof dateObj === "number") {
354
+ dateObj = new Date(dateObj);
355
+ }
356
+ if (Object.prototype.toString.call(dateObj) !== "[object Date]" || isNaN(dateObj.getTime())) {
357
+ throw new Error("Invalid Date in fecha.format");
358
+ }
359
+ mask = fecha2.masks[mask] || mask || fecha2.masks["default"];
360
+ var literals = [];
361
+ mask = mask.replace(literal, function($0, $1) {
362
+ literals.push($1);
363
+ return "@@@";
364
+ });
365
+ mask = mask.replace(token, function($0) {
366
+ return $0 in formatFlags ? formatFlags[$0](dateObj, i18n) : $0.slice(1, $0.length - 1);
367
+ });
368
+ return mask.replace(/@@@/g, function() {
369
+ return literals.shift();
370
+ });
371
+ };
372
+ fecha2.parse = function(dateStr, format2, i18nSettings) {
373
+ var i18n = i18nSettings || fecha2.i18n;
374
+ if (typeof format2 !== "string") {
375
+ throw new Error("Invalid format in fecha.parse");
376
+ }
377
+ format2 = fecha2.masks[format2] || format2;
378
+ if (dateStr.length > 1e3) {
379
+ return null;
380
+ }
381
+ var dateInfo = {};
382
+ var parseInfo = [];
383
+ var literals = [];
384
+ format2 = format2.replace(literal, function($0, $1) {
385
+ literals.push($1);
386
+ return "@@@";
387
+ });
388
+ var newFormat = regexEscape(format2).replace(token, function($0) {
389
+ if (parseFlags[$0]) {
390
+ var info = parseFlags[$0];
391
+ parseInfo.push(info[1]);
392
+ return "(" + info[0] + ")";
393
+ }
394
+ return $0;
395
+ });
396
+ newFormat = newFormat.replace(/@@@/g, function() {
397
+ return literals.shift();
398
+ });
399
+ var matches = dateStr.match(new RegExp(newFormat, "i"));
400
+ if (!matches) {
401
+ return null;
402
+ }
403
+ for (var i = 1; i < matches.length; i++) {
404
+ parseInfo[i - 1](dateInfo, matches[i], i18n);
405
+ }
406
+ var today = /* @__PURE__ */ new Date();
407
+ if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {
408
+ dateInfo.hour = +dateInfo.hour + 12;
409
+ } else if (dateInfo.isPm === false && +dateInfo.hour === 12) {
410
+ dateInfo.hour = 0;
411
+ }
412
+ var date2;
413
+ if (dateInfo.timezoneOffset != null) {
414
+ dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
415
+ 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));
416
+ } else {
417
+ 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);
418
+ }
419
+ return date2;
420
+ };
421
+ if (module2.exports) {
422
+ module2.exports = fecha2;
423
+ } else {
424
+ main.fecha = fecha2;
425
+ }
426
+ })(commonjsGlobal);
427
+ })(date);
428
+ var dateExports = date.exports;
429
+ const fecha = /* @__PURE__ */ getDefaultExportFromCjs(dateExports);
430
+ const defaultLang = {
431
+ el: {
432
+ colorpicker: {
433
+ confirm: "确定",
434
+ clear: "清空"
435
+ },
436
+ datepicker: {
437
+ now: "此刻",
438
+ today: "今天",
439
+ cancel: "取消",
440
+ clear: "清空",
441
+ confirm: "确定",
442
+ selectDate: "选择日期",
443
+ selectTime: "选择时间",
444
+ startDate: "开始日期",
445
+ startTime: "开始时间",
446
+ endDate: "结束日期",
447
+ endTime: "结束时间",
448
+ prevYear: "前一年",
449
+ nextYear: "后一年",
450
+ prevMonth: "上个月",
451
+ nextMonth: "下个月",
452
+ year: "年",
453
+ month1: "1 月",
454
+ month2: "2 月",
455
+ month3: "3 月",
456
+ month4: "4 月",
457
+ month5: "5 月",
458
+ month6: "6 月",
459
+ month7: "7 月",
460
+ month8: "8 月",
461
+ month9: "9 月",
462
+ month10: "10 月",
463
+ month11: "11 月",
464
+ month12: "12 月",
465
+ // week: '周次',
466
+ weeks: {
467
+ sun: "日",
468
+ mon: "一",
469
+ tue: "二",
470
+ wed: "三",
471
+ thu: "四",
472
+ fri: "五",
473
+ sat: "六"
474
+ },
475
+ months: {
476
+ jan: "一月",
477
+ feb: "二月",
478
+ mar: "三月",
479
+ apr: "四月",
480
+ may: "五月",
481
+ jun: "六月",
482
+ jul: "七月",
483
+ aug: "八月",
484
+ sep: "九月",
485
+ oct: "十月",
486
+ nov: "十一月",
487
+ dec: "十二月"
488
+ }
489
+ },
490
+ select: {
491
+ loading: "加载中",
492
+ noMatch: "无匹配数据",
493
+ noData: "无数据",
494
+ placeholder: "请选择"
495
+ },
496
+ cascader: {
497
+ noMatch: "无匹配数据",
498
+ loading: "加载中",
499
+ placeholder: "请选择",
500
+ noData: "暂无数据"
501
+ },
502
+ pagination: {
503
+ goto: "前往",
504
+ pagesize: "条/页",
505
+ total: "共 {total} 条",
506
+ pageClassifier: "页"
507
+ },
508
+ messagebox: {
509
+ title: "提示",
510
+ confirm: "确定",
511
+ cancel: "取消",
512
+ error: "输入的数据不合法!"
513
+ },
514
+ upload: {
515
+ deleteTip: "按 delete 键可删除",
516
+ delete: "删除",
517
+ preview: "查看图片",
518
+ continue: "继续上传"
519
+ },
520
+ table: {
521
+ emptyText: "暂无数据",
522
+ confirmFilter: "筛选",
523
+ resetFilter: "重置",
524
+ clearFilter: "全部",
525
+ sumText: "合计"
526
+ },
527
+ tree: {
528
+ emptyText: "暂无数据"
529
+ },
530
+ transfer: {
531
+ noMatch: "无匹配数据",
532
+ noData: "无数据",
533
+ titles: ["列表 1", "列表 2"],
534
+ filterPlaceholder: "请输入搜索内容",
535
+ noCheckedFormat: "共 {total} 项",
536
+ hasCheckedFormat: "已选 {checked}/{total} 项"
537
+ },
538
+ image: {
539
+ error: "加载失败"
540
+ },
541
+ pageHeader: {
542
+ title: "返回"
543
+ },
544
+ popconfirm: {
545
+ confirmButtonText: "确定",
546
+ cancelButtonText: "取消"
547
+ }
548
+ }
549
+ };
550
+ var isMergeableObject = function isMergeableObject2(value) {
551
+ return isNonNullObject(value) && !isSpecial(value);
552
+ };
553
+ function isNonNullObject(value) {
554
+ return !!value && typeof value === "object";
555
+ }
556
+ function isSpecial(value) {
557
+ var stringValue = Object.prototype.toString.call(value);
558
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
559
+ }
560
+ var canUseSymbol = typeof Symbol === "function" && Symbol.for;
561
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
562
+ function isReactElement(value) {
563
+ return value.$$typeof === REACT_ELEMENT_TYPE;
564
+ }
565
+ function emptyTarget(val) {
566
+ return Array.isArray(val) ? [] : {};
567
+ }
568
+ function cloneIfNecessary(value, optionsArgument) {
569
+ var clone = optionsArgument && optionsArgument.clone === true;
570
+ return clone && isMergeableObject(value) ? deepmerge(emptyTarget(value), value, optionsArgument) : value;
571
+ }
572
+ function defaultArrayMerge(target, source, optionsArgument) {
573
+ var destination = target.slice();
574
+ source.forEach(function(e, i) {
575
+ if (typeof destination[i] === "undefined") {
576
+ destination[i] = cloneIfNecessary(e, optionsArgument);
577
+ } else if (isMergeableObject(e)) {
578
+ destination[i] = deepmerge(target[i], e, optionsArgument);
579
+ } else if (target.indexOf(e) === -1) {
580
+ destination.push(cloneIfNecessary(e, optionsArgument));
581
+ }
582
+ });
583
+ return destination;
584
+ }
585
+ function mergeObject(target, source, optionsArgument) {
586
+ var destination = {};
587
+ if (isMergeableObject(target)) {
588
+ Object.keys(target).forEach(function(key) {
589
+ destination[key] = cloneIfNecessary(target[key], optionsArgument);
590
+ });
591
+ }
592
+ Object.keys(source).forEach(function(key) {
593
+ if (!isMergeableObject(source[key]) || !target[key]) {
594
+ destination[key] = cloneIfNecessary(source[key], optionsArgument);
595
+ } else {
596
+ destination[key] = deepmerge(target[key], source[key], optionsArgument);
597
+ }
598
+ });
599
+ return destination;
600
+ }
601
+ function deepmerge(target, source, optionsArgument) {
602
+ var sourceIsArray = Array.isArray(source);
603
+ var targetIsArray = Array.isArray(target);
604
+ var options = optionsArgument || {
605
+ arrayMerge: defaultArrayMerge
606
+ };
607
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
608
+ if (!sourceAndTargetTypesMatch) {
609
+ return cloneIfNecessary(source, optionsArgument);
610
+ } else if (sourceIsArray) {
611
+ var arrayMerge = options.arrayMerge || defaultArrayMerge;
612
+ return arrayMerge(target, source, optionsArgument);
613
+ } else {
614
+ return mergeObject(target, source, optionsArgument);
615
+ }
616
+ }
617
+ deepmerge.all = function deepmergeAll(array, optionsArgument) {
618
+ if (!Array.isArray(array) || array.length < 2) {
619
+ throw new Error("first argument should be an array with at least two elements");
620
+ }
621
+ return array.reduce(function(prev, next) {
622
+ return deepmerge(prev, next, optionsArgument);
623
+ });
624
+ };
625
+ var deepmerge_1 = deepmerge;
626
+ const hasOwnProperty = Object.prototype.hasOwnProperty;
627
+ function hasOwn(obj, key) {
628
+ return hasOwnProperty.call(obj, key);
629
+ }
630
+ const arrayFindIndex = function(arr, pred) {
631
+ for (let i = 0; i !== arr.length; ++i) {
632
+ if (pred(arr[i])) {
633
+ return i;
634
+ }
635
+ }
636
+ return -1;
637
+ };
638
+ const arrayFind = function(arr, pred) {
639
+ const idx = arrayFindIndex(arr, pred);
640
+ return idx !== -1 ? arr[idx] : void 0;
641
+ };
642
+ const coerceTruthyValueToArray = function(val) {
643
+ if (Array.isArray(val)) {
644
+ return val;
645
+ } else if (val) {
646
+ return [val];
647
+ } else {
648
+ return [];
649
+ }
650
+ };
651
+ const RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
652
+ function Format(Vue2) {
653
+ function template(string, ...args) {
654
+ if (args.length === 1 && typeof args[0] === "object") {
655
+ args = args[0];
656
+ }
657
+ if (!args || !args.hasOwnProperty) {
658
+ args = {};
659
+ }
660
+ return string.replace(RE_NARGS, (match, prefix, i, index) => {
661
+ let result;
662
+ if (string[index - 1] === "{" && string[index + match.length] === "}") {
663
+ return i;
664
+ } else {
665
+ result = hasOwn(args, i) ? args[i] : null;
666
+ if (result === null || result === void 0) {
667
+ return "";
668
+ }
669
+ return result;
670
+ }
671
+ });
672
+ }
673
+ return template;
674
+ }
675
+ const format = Format();
676
+ let lang = defaultLang;
677
+ let merged = false;
678
+ let i18nHandler = function() {
679
+ const vuei18n = Object.getPrototypeOf(this || Vue).$t;
680
+ if (typeof vuei18n === "function" && !!Vue.locale) {
681
+ if (!merged) {
682
+ merged = true;
683
+ Vue.locale(Vue.config.lang, deepmerge_1(lang, Vue.locale(Vue.config.lang) || {}, {
684
+ clone: true
685
+ }));
686
+ }
687
+ return vuei18n.apply(this, arguments);
688
+ }
689
+ };
690
+ const t = function(path, options) {
691
+ let value = i18nHandler.apply(this, arguments);
692
+ if (value !== null && value !== void 0)
693
+ return value;
694
+ const array = path.split(".");
695
+ let current = lang;
696
+ for (let i = 0, j = array.length; i < j; i++) {
697
+ const property = array[i];
698
+ value = current[property];
699
+ if (i === j - 1)
700
+ return format(value, options);
701
+ if (!value)
702
+ return "";
703
+ current = value;
704
+ }
705
+ return "";
706
+ };
707
+ const weeks = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
708
+ const months = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"];
709
+ const getI18nSettings = () => {
710
+ return {
711
+ dayNamesShort: weeks.map((week) => t(`el.datepicker.weeks.${week}`)),
712
+ dayNames: weeks.map((week) => t(`el.datepicker.weeks.${week}`)),
713
+ monthNamesShort: months.map((month) => t(`el.datepicker.months.${month}`)),
714
+ monthNames: months.map((month, index) => t(`el.datepicker.month${index + 1}`)),
715
+ amPm: ["am", "pm"]
716
+ };
717
+ };
718
+ const toDate = function(date2) {
719
+ return isDate(date2) ? new Date(date2) : null;
720
+ };
721
+ const isDate = function(date2) {
722
+ if (date2 === null || date2 === void 0)
723
+ return false;
724
+ if (isNaN(new Date(date2).getTime()))
725
+ return false;
726
+ if (Array.isArray(date2))
727
+ return false;
728
+ return true;
729
+ };
730
+ const isDateObject = function(val) {
731
+ return val instanceof Date;
732
+ };
733
+ const formatDate = function(date2, format2) {
734
+ date2 = toDate(date2);
735
+ if (!date2)
736
+ return "";
737
+ return fecha.format(date2, format2 || "yyyy-MM-dd", getI18nSettings());
738
+ };
739
+ const parseDate = function(string, format2) {
740
+ return fecha.parse(string, format2 || "yyyy-MM-dd", getI18nSettings());
741
+ };
742
+ const getDayCountOfMonth = function(year, month) {
743
+ if (month === 3 || month === 5 || month === 8 || month === 10) {
744
+ return 30;
745
+ }
746
+ if (month === 1) {
747
+ if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) {
748
+ return 29;
749
+ } else {
750
+ return 28;
751
+ }
752
+ }
753
+ return 31;
754
+ };
755
+ const getFirstDayOfMonth = function(date2) {
756
+ const temp = new Date(date2.getTime());
757
+ temp.setDate(1);
758
+ return temp.getDay();
759
+ };
760
+ const prevDate = function(date2, amount = 1) {
761
+ return new Date(date2.getFullYear(), date2.getMonth(), date2.getDate() - amount);
762
+ };
763
+ const nextDate = function(date2, amount = 1) {
764
+ return new Date(date2.getFullYear(), date2.getMonth(), date2.getDate() + amount);
765
+ };
766
+ const getStartDateOfMonth = function(year, month) {
767
+ const result = new Date(year, month, 1);
768
+ const day = result.getDay();
769
+ if (day === 0) {
770
+ return prevDate(result, 7);
771
+ } else {
772
+ return prevDate(result, day);
773
+ }
774
+ };
775
+ const getWeekNumber = function(src) {
776
+ if (!isDate(src))
777
+ return null;
778
+ const date2 = new Date(src.getTime());
779
+ date2.setHours(0, 0, 0, 0);
780
+ date2.setDate(date2.getDate() + 3 - (date2.getDay() + 6) % 7);
781
+ const week1 = new Date(date2.getFullYear(), 0, 4);
782
+ return 1 + Math.round(((date2.getTime() - week1.getTime()) / 864e5 - 3 + (week1.getDay() + 6) % 7) / 7);
783
+ };
784
+ const modifyDate = function(date2, y, m, d) {
785
+ return new Date(y, m, d, date2.getHours(), date2.getMinutes(), date2.getSeconds(), date2.getMilliseconds());
786
+ };
787
+ const modifyTime = function(date2, h, m, s) {
788
+ return new Date(date2.getFullYear(), date2.getMonth(), date2.getDate(), h, m, s, date2.getMilliseconds());
789
+ };
790
+ const modifyWithTimeString = (date2, time) => {
791
+ if (date2 == null || !time) {
792
+ return date2;
793
+ }
794
+ time = parseDate(time, "HH:mm:ss");
795
+ return modifyTime(date2, time.getHours(), time.getMinutes(), time.getSeconds());
796
+ };
797
+ const clearTime = function(date2) {
798
+ return new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
799
+ };
800
+ const changeYearMonthAndClampDate = function(date2, year, month) {
801
+ const monthDate = Math.min(date2.getDate(), getDayCountOfMonth(year, month));
802
+ return modifyDate(date2, year, month, monthDate);
803
+ };
804
+ const prevMonth = function(date2) {
805
+ const year = date2.getFullYear();
806
+ const month = date2.getMonth();
807
+ return month === 0 ? changeYearMonthAndClampDate(date2, year - 1, 11) : changeYearMonthAndClampDate(date2, year, month - 1);
808
+ };
809
+ const nextMonth = function(date2) {
810
+ const year = date2.getFullYear();
811
+ const month = date2.getMonth();
812
+ return month === 11 ? changeYearMonthAndClampDate(date2, year + 1, 0) : changeYearMonthAndClampDate(date2, year, month + 1);
813
+ };
814
+ const prevYear = function(date2, amount = 1) {
815
+ const year = date2.getFullYear();
816
+ const month = date2.getMonth();
817
+ return changeYearMonthAndClampDate(date2, year - amount, month);
818
+ };
819
+ const nextYear = function(date2, amount = 1) {
820
+ const year = date2.getFullYear();
821
+ const month = date2.getMonth();
822
+ return changeYearMonthAndClampDate(date2, year + amount, month);
823
+ };
824
+ function merge(target) {
825
+ for (let i = 1, j = arguments.length; i < j; i++) {
826
+ let source = arguments[i] || {};
827
+ for (let prop in source) {
828
+ if (source.hasOwnProperty(prop)) {
829
+ let value = source[prop];
830
+ if (value !== void 0) {
831
+ target[prop] = value;
832
+ }
833
+ }
834
+ }
835
+ }
836
+ return target;
837
+ }
838
+ let hasModal = false;
839
+ let hasInitZIndex = false;
840
+ let zIndex;
841
+ const getModal = function() {
842
+ if (Vue.prototype.$isServer)
843
+ return;
844
+ let modalDom = PopupManager.modalDom;
845
+ if (modalDom) {
846
+ hasModal = true;
847
+ } else {
848
+ hasModal = false;
849
+ modalDom = document.createElement("div");
850
+ PopupManager.modalDom = modalDom;
851
+ modalDom.addEventListener("touchmove", function(event) {
852
+ event.preventDefault();
853
+ event.stopPropagation();
854
+ });
855
+ modalDom.addEventListener("click", function() {
856
+ PopupManager.doOnModalClick && PopupManager.doOnModalClick();
857
+ });
858
+ }
859
+ return modalDom;
860
+ };
861
+ const instances = {};
862
+ const PopupManager = {
863
+ modalFade: true,
864
+ getInstance: function(id) {
865
+ return instances[id];
866
+ },
867
+ register: function(id, instance) {
868
+ if (id && instance) {
869
+ instances[id] = instance;
870
+ }
871
+ },
872
+ deregister: function(id) {
873
+ if (id) {
874
+ instances[id] = null;
875
+ delete instances[id];
876
+ }
877
+ },
878
+ nextZIndex: function() {
879
+ return PopupManager.zIndex++;
880
+ },
881
+ modalStack: [],
882
+ doOnModalClick: function() {
883
+ const topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
884
+ if (!topItem)
885
+ return;
886
+ const instance = PopupManager.getInstance(topItem.id);
887
+ if (instance && instance.closeOnClickModal) {
888
+ instance.close();
889
+ }
890
+ },
891
+ openModal: function(id, zIndex2, dom, modalClass, modalFade) {
892
+ if (Vue.prototype.$isServer)
893
+ return;
894
+ if (!id || zIndex2 === void 0)
895
+ return;
896
+ this.modalFade = modalFade;
897
+ const modalStack = this.modalStack;
898
+ for (let i = 0, j = modalStack.length; i < j; i++) {
899
+ const item = modalStack[i];
900
+ if (item.id === id) {
901
+ return;
902
+ }
903
+ }
904
+ const modalDom = getModal();
905
+ addClass(modalDom, "v-modal");
906
+ if (this.modalFade && !hasModal) {
907
+ addClass(modalDom, "v-modal-enter");
908
+ }
909
+ if (modalClass) {
910
+ let classArr = modalClass.trim().split(/\s+/);
911
+ classArr.forEach((item) => addClass(modalDom, item));
912
+ }
913
+ setTimeout(() => {
914
+ removeClass(modalDom, "v-modal-enter");
915
+ }, 200);
916
+ if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
917
+ dom.parentNode.appendChild(modalDom);
918
+ } else {
919
+ document.body.appendChild(modalDom);
920
+ }
921
+ if (zIndex2) {
922
+ modalDom.style.zIndex = zIndex2;
923
+ }
924
+ modalDom.tabIndex = 0;
925
+ modalDom.style.display = "";
926
+ this.modalStack.push({
927
+ id,
928
+ zIndex: zIndex2,
929
+ modalClass
930
+ });
931
+ },
932
+ closeModal: function(id) {
933
+ const modalStack = this.modalStack;
934
+ const modalDom = getModal();
935
+ if (modalStack.length > 0) {
936
+ const topItem = modalStack[modalStack.length - 1];
937
+ if (topItem.id === id) {
938
+ if (topItem.modalClass) {
939
+ let classArr = topItem.modalClass.trim().split(/\s+/);
940
+ classArr.forEach((item) => removeClass(modalDom, item));
941
+ }
942
+ modalStack.pop();
943
+ if (modalStack.length > 0) {
944
+ modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
945
+ }
946
+ } else {
947
+ for (let i = modalStack.length - 1; i >= 0; i--) {
948
+ if (modalStack[i].id === id) {
949
+ modalStack.splice(i, 1);
950
+ break;
951
+ }
952
+ }
953
+ }
954
+ }
955
+ if (modalStack.length === 0) {
956
+ if (this.modalFade) {
957
+ addClass(modalDom, "v-modal-leave");
958
+ }
959
+ setTimeout(() => {
960
+ if (modalStack.length === 0) {
961
+ if (modalDom.parentNode)
962
+ modalDom.parentNode.removeChild(modalDom);
963
+ modalDom.style.display = "none";
964
+ PopupManager.modalDom = void 0;
965
+ }
966
+ removeClass(modalDom, "v-modal-leave");
967
+ }, 200);
968
+ }
969
+ }
970
+ };
971
+ Object.defineProperty(PopupManager, "zIndex", {
972
+ configurable: true,
973
+ get() {
974
+ if (!hasInitZIndex) {
975
+ zIndex = zIndex || (Vue.prototype.$ELEMENT || {}).zIndex || 2e3;
976
+ hasInitZIndex = true;
977
+ }
978
+ return zIndex;
979
+ },
980
+ set(value) {
981
+ zIndex = value;
982
+ }
983
+ });
984
+ const getTopPopup = function() {
985
+ if (Vue.prototype.$isServer)
986
+ return;
987
+ if (PopupManager.modalStack.length > 0) {
988
+ const topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
989
+ if (!topPopup)
990
+ return;
991
+ const instance = PopupManager.getInstance(topPopup.id);
992
+ return instance;
993
+ }
994
+ };
995
+ if (!Vue.prototype.$isServer) {
996
+ window.addEventListener("keydown", function(event) {
997
+ if (event.keyCode === 27) {
998
+ const topPopup = getTopPopup();
999
+ if (topPopup && topPopup.closeOnPressEscape) {
1000
+ topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction("cancel") : topPopup.close();
1001
+ }
1002
+ }
1003
+ });
1004
+ }
1005
+ var popper$1 = { exports: {} };
1006
+ /**
1007
+ * @fileOverview Kickass library to create and place poppers near their reference elements.
1008
+ * @version {{version}}
1009
+ * @license
1010
+ * Copyright (c) 2016 Federico Zivolo and contributors
1011
+ *
1012
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
1013
+ * of this software and associated documentation files (the "Software"), to deal
1014
+ * in the Software without restriction, including without limitation the rights
1015
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1016
+ * copies of the Software, and to permit persons to whom the Software is
1017
+ * furnished to do so, subject to the following conditions:
1018
+ *
1019
+ * The above copyright notice and this permission notice shall be included in all
1020
+ * copies or substantial portions of the Software.
1021
+ *
1022
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1023
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1024
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1025
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1026
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1027
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1028
+ * SOFTWARE.
1029
+ */
1030
+ (function(module2) {
1031
+ (function(root, factory) {
1032
+ if (module2.exports) {
1033
+ module2.exports = factory();
1034
+ } else {
1035
+ root.Popper = factory();
1036
+ }
1037
+ })(commonjsGlobal, function() {
1038
+ var root = window;
1039
+ var DEFAULTS = {
1040
+ // placement of the popper
1041
+ placement: "bottom",
1042
+ gpuAcceleration: true,
1043
+ // shift popper from its origin by the given amount of pixels (can be negative)
1044
+ offset: 0,
1045
+ // the element which will act as boundary of the popper
1046
+ boundariesElement: "viewport",
1047
+ // amount of pixel used to define a minimum distance between the boundaries and the popper
1048
+ boundariesPadding: 5,
1049
+ // popper will try to prevent overflow following this order,
1050
+ // by default, then, it could overflow on the left and on top of the boundariesElement
1051
+ preventOverflowOrder: ["left", "right", "top", "bottom"],
1052
+ // the behavior used by flip to change the placement of the popper
1053
+ flipBehavior: "flip",
1054
+ arrowElement: "[x-arrow]",
1055
+ arrowOffset: 0,
1056
+ // list of functions used to modify the offsets before they are applied to the popper
1057
+ modifiers: ["shift", "offset", "preventOverflow", "keepTogether", "arrow", "flip", "applyStyle"],
1058
+ modifiersIgnored: [],
1059
+ forceAbsolute: false
1060
+ };
1061
+ function Popper2(reference, popper2, options) {
1062
+ this._reference = reference.jquery ? reference[0] : reference;
1063
+ this.state = {};
1064
+ var isNotDefined = typeof popper2 === "undefined" || popper2 === null;
1065
+ var isConfig = popper2 && Object.prototype.toString.call(popper2) === "[object Object]";
1066
+ if (isNotDefined || isConfig) {
1067
+ this._popper = this.parse(isConfig ? popper2 : {});
1068
+ } else {
1069
+ this._popper = popper2.jquery ? popper2[0] : popper2;
1070
+ }
1071
+ this._options = Object.assign({}, DEFAULTS, options);
1072
+ this._options.modifiers = this._options.modifiers.map((function(modifier) {
1073
+ if (this._options.modifiersIgnored.indexOf(modifier) !== -1)
1074
+ return;
1075
+ if (modifier === "applyStyle") {
1076
+ this._popper.setAttribute("x-placement", this._options.placement);
1077
+ }
1078
+ return this.modifiers[modifier] || modifier;
1079
+ }).bind(this));
1080
+ this.state.position = this._getPosition(this._popper, this._reference);
1081
+ setStyle(this._popper, {
1082
+ position: this.state.position,
1083
+ top: 0
1084
+ });
1085
+ this.update();
1086
+ this._setupEventListeners();
1087
+ return this;
1088
+ }
1089
+ Popper2.prototype.destroy = function() {
1090
+ this._popper.removeAttribute("x-placement");
1091
+ this._popper.style.left = "";
1092
+ this._popper.style.position = "";
1093
+ this._popper.style.top = "";
1094
+ this._popper.style[getSupportedPropertyName("transform")] = "";
1095
+ this._removeEventListeners();
1096
+ if (this._options.removeOnDestroy) {
1097
+ this._popper.remove();
1098
+ }
1099
+ return this;
1100
+ };
1101
+ Popper2.prototype.update = function() {
1102
+ var data = {
1103
+ instance: this,
1104
+ styles: {}
1105
+ };
1106
+ data.placement = this._options.placement;
1107
+ data._originalPlacement = this._options.placement;
1108
+ data.offsets = this._getOffsets(this._popper, this._reference, data.placement);
1109
+ data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);
1110
+ data = this.runModifiers(data, this._options.modifiers);
1111
+ if (typeof this.state.updateCallback === "function") {
1112
+ this.state.updateCallback(data);
1113
+ }
1114
+ };
1115
+ Popper2.prototype.onCreate = function(callback) {
1116
+ callback(this);
1117
+ return this;
1118
+ };
1119
+ Popper2.prototype.onUpdate = function(callback) {
1120
+ this.state.updateCallback = callback;
1121
+ return this;
1122
+ };
1123
+ Popper2.prototype.parse = function(config) {
1124
+ var defaultConfig = {
1125
+ tagName: "div",
1126
+ classNames: ["popper"],
1127
+ attributes: [],
1128
+ parent: root.document.body,
1129
+ content: "",
1130
+ contentType: "text",
1131
+ arrowTagName: "div",
1132
+ arrowClassNames: ["popper__arrow"],
1133
+ arrowAttributes: ["x-arrow"]
1134
+ };
1135
+ config = Object.assign({}, defaultConfig, config);
1136
+ var d = root.document;
1137
+ var popper2 = d.createElement(config.tagName);
1138
+ addClassNames(popper2, config.classNames);
1139
+ addAttributes(popper2, config.attributes);
1140
+ if (config.contentType === "node") {
1141
+ popper2.appendChild(config.content.jquery ? config.content[0] : config.content);
1142
+ } else if (config.contentType === "html") {
1143
+ popper2.innerHTML = config.content;
1144
+ } else {
1145
+ popper2.textContent = config.content;
1146
+ }
1147
+ if (config.arrowTagName) {
1148
+ var arrow = d.createElement(config.arrowTagName);
1149
+ addClassNames(arrow, config.arrowClassNames);
1150
+ addAttributes(arrow, config.arrowAttributes);
1151
+ popper2.appendChild(arrow);
1152
+ }
1153
+ var parent = config.parent.jquery ? config.parent[0] : config.parent;
1154
+ if (typeof parent === "string") {
1155
+ parent = d.querySelectorAll(config.parent);
1156
+ if (parent.length > 1) {
1157
+ console.warn("WARNING: the given `parent` query(" + config.parent + ") matched more than one element, the first one will be used");
1158
+ }
1159
+ if (parent.length === 0) {
1160
+ throw "ERROR: the given `parent` doesn't exists!";
1161
+ }
1162
+ parent = parent[0];
1163
+ }
1164
+ if (parent.length > 1 && parent instanceof Element === false) {
1165
+ console.warn("WARNING: you have passed as parent a list of elements, the first one will be used");
1166
+ parent = parent[0];
1167
+ }
1168
+ parent.appendChild(popper2);
1169
+ return popper2;
1170
+ function addClassNames(element, classNames) {
1171
+ classNames.forEach(function(className) {
1172
+ element.classList.add(className);
1173
+ });
1174
+ }
1175
+ function addAttributes(element, attributes) {
1176
+ attributes.forEach(function(attribute) {
1177
+ element.setAttribute(attribute.split(":")[0], attribute.split(":")[1] || "");
1178
+ });
1179
+ }
1180
+ };
1181
+ Popper2.prototype._getPosition = function(popper2, reference) {
1182
+ getOffsetParent(reference);
1183
+ if (this._options.forceAbsolute) {
1184
+ return "absolute";
1185
+ }
1186
+ var isParentFixed = isFixed(reference);
1187
+ return isParentFixed ? "fixed" : "absolute";
1188
+ };
1189
+ Popper2.prototype._getOffsets = function(popper2, reference, placement) {
1190
+ placement = placement.split("-")[0];
1191
+ var popperOffsets = {};
1192
+ popperOffsets.position = this.state.position;
1193
+ var isParentFixed = popperOffsets.position === "fixed";
1194
+ var referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper2), isParentFixed);
1195
+ var popperRect = getOuterSizes(popper2);
1196
+ if (["right", "left"].indexOf(placement) !== -1) {
1197
+ popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - popperRect.height / 2;
1198
+ if (placement === "left") {
1199
+ popperOffsets.left = referenceOffsets.left - popperRect.width;
1200
+ } else {
1201
+ popperOffsets.left = referenceOffsets.right;
1202
+ }
1203
+ } else {
1204
+ popperOffsets.left = referenceOffsets.left + referenceOffsets.width / 2 - popperRect.width / 2;
1205
+ if (placement === "top") {
1206
+ popperOffsets.top = referenceOffsets.top - popperRect.height;
1207
+ } else {
1208
+ popperOffsets.top = referenceOffsets.bottom;
1209
+ }
1210
+ }
1211
+ popperOffsets.width = popperRect.width;
1212
+ popperOffsets.height = popperRect.height;
1213
+ return {
1214
+ popper: popperOffsets,
1215
+ reference: referenceOffsets
1216
+ };
1217
+ };
1218
+ Popper2.prototype._setupEventListeners = function() {
1219
+ this.state.updateBound = this.update.bind(this);
1220
+ root.addEventListener("resize", this.state.updateBound);
1221
+ if (this._options.boundariesElement !== "window") {
1222
+ var target = getScrollParent(this._reference);
1223
+ if (target === root.document.body || target === root.document.documentElement) {
1224
+ target = root;
1225
+ }
1226
+ target.addEventListener("scroll", this.state.updateBound);
1227
+ this.state.scrollTarget = target;
1228
+ }
1229
+ };
1230
+ Popper2.prototype._removeEventListeners = function() {
1231
+ root.removeEventListener("resize", this.state.updateBound);
1232
+ if (this._options.boundariesElement !== "window" && this.state.scrollTarget) {
1233
+ this.state.scrollTarget.removeEventListener("scroll", this.state.updateBound);
1234
+ this.state.scrollTarget = null;
1235
+ }
1236
+ this.state.updateBound = null;
1237
+ };
1238
+ Popper2.prototype._getBoundaries = function(data, padding, boundariesElement) {
1239
+ var boundaries = {};
1240
+ var width, height;
1241
+ if (boundariesElement === "window") {
1242
+ var body = root.document.body, html = root.document.documentElement;
1243
+ height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
1244
+ width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);
1245
+ boundaries = {
1246
+ top: 0,
1247
+ right: width,
1248
+ bottom: height,
1249
+ left: 0
1250
+ };
1251
+ } else if (boundariesElement === "viewport") {
1252
+ var offsetParent = getOffsetParent(this._popper);
1253
+ var scrollParent = getScrollParent(this._popper);
1254
+ var offsetParentRect = getOffsetRect(offsetParent);
1255
+ var getScrollTopValue = function(element) {
1256
+ return element == document.body ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) : element.scrollTop;
1257
+ };
1258
+ var getScrollLeftValue = function(element) {
1259
+ return element == document.body ? Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) : element.scrollLeft;
1260
+ };
1261
+ var scrollTop = data.offsets.popper.position === "fixed" ? 0 : getScrollTopValue(scrollParent);
1262
+ var scrollLeft = data.offsets.popper.position === "fixed" ? 0 : getScrollLeftValue(scrollParent);
1263
+ boundaries = {
1264
+ top: 0 - (offsetParentRect.top - scrollTop),
1265
+ right: root.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),
1266
+ bottom: root.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),
1267
+ left: 0 - (offsetParentRect.left - scrollLeft)
1268
+ };
1269
+ } else {
1270
+ if (getOffsetParent(this._popper) === boundariesElement) {
1271
+ boundaries = {
1272
+ top: 0,
1273
+ left: 0,
1274
+ right: boundariesElement.clientWidth,
1275
+ bottom: boundariesElement.clientHeight
1276
+ };
1277
+ } else {
1278
+ boundaries = getOffsetRect(boundariesElement);
1279
+ }
1280
+ }
1281
+ boundaries.left += padding;
1282
+ boundaries.right -= padding;
1283
+ boundaries.top = boundaries.top + padding;
1284
+ boundaries.bottom = boundaries.bottom - padding;
1285
+ return boundaries;
1286
+ };
1287
+ Popper2.prototype.runModifiers = function(data, modifiers, ends) {
1288
+ var modifiersToRun = modifiers.slice();
1289
+ if (ends !== void 0) {
1290
+ modifiersToRun = this._options.modifiers.slice(0, getArrayKeyIndex(this._options.modifiers, ends));
1291
+ }
1292
+ modifiersToRun.forEach((function(modifier) {
1293
+ if (isFunction(modifier)) {
1294
+ data = modifier.call(this, data);
1295
+ }
1296
+ }).bind(this));
1297
+ return data;
1298
+ };
1299
+ Popper2.prototype.isModifierRequired = function(requesting, requested) {
1300
+ var index = getArrayKeyIndex(this._options.modifiers, requesting);
1301
+ return !!this._options.modifiers.slice(0, index).filter(function(modifier) {
1302
+ return modifier === requested;
1303
+ }).length;
1304
+ };
1305
+ Popper2.prototype.modifiers = {};
1306
+ Popper2.prototype.modifiers.applyStyle = function(data) {
1307
+ var styles = {
1308
+ position: data.offsets.popper.position
1309
+ };
1310
+ var left = Math.round(data.offsets.popper.left);
1311
+ var top = Math.round(data.offsets.popper.top);
1312
+ var prefixedProperty;
1313
+ if (this._options.gpuAcceleration && (prefixedProperty = getSupportedPropertyName("transform"))) {
1314
+ styles[prefixedProperty] = "translate3d(" + left + "px, " + top + "px, 0)";
1315
+ styles.top = 0;
1316
+ styles.left = 0;
1317
+ } else {
1318
+ styles.left = left;
1319
+ styles.top = top;
1320
+ }
1321
+ Object.assign(styles, data.styles);
1322
+ setStyle(this._popper, styles);
1323
+ this._popper.setAttribute("x-placement", data.placement);
1324
+ if (this.isModifierRequired(this.modifiers.applyStyle, this.modifiers.arrow) && data.offsets.arrow) {
1325
+ setStyle(data.arrowElement, data.offsets.arrow);
1326
+ }
1327
+ return data;
1328
+ };
1329
+ Popper2.prototype.modifiers.shift = function(data) {
1330
+ var placement = data.placement;
1331
+ var basePlacement = placement.split("-")[0];
1332
+ var shiftVariation = placement.split("-")[1];
1333
+ if (shiftVariation) {
1334
+ var reference = data.offsets.reference;
1335
+ var popper2 = getPopperClientRect(data.offsets.popper);
1336
+ var shiftOffsets = {
1337
+ y: {
1338
+ start: {
1339
+ top: reference.top
1340
+ },
1341
+ end: {
1342
+ top: reference.top + reference.height - popper2.height
1343
+ }
1344
+ },
1345
+ x: {
1346
+ start: {
1347
+ left: reference.left
1348
+ },
1349
+ end: {
1350
+ left: reference.left + reference.width - popper2.width
1351
+ }
1352
+ }
1353
+ };
1354
+ var axis = ["bottom", "top"].indexOf(basePlacement) !== -1 ? "x" : "y";
1355
+ data.offsets.popper = Object.assign(popper2, shiftOffsets[axis][shiftVariation]);
1356
+ }
1357
+ return data;
1358
+ };
1359
+ Popper2.prototype.modifiers.preventOverflow = function(data) {
1360
+ var order = this._options.preventOverflowOrder;
1361
+ var popper2 = getPopperClientRect(data.offsets.popper);
1362
+ var check = {
1363
+ left: function() {
1364
+ var left = popper2.left;
1365
+ if (popper2.left < data.boundaries.left) {
1366
+ left = Math.max(popper2.left, data.boundaries.left);
1367
+ }
1368
+ return {
1369
+ left
1370
+ };
1371
+ },
1372
+ right: function() {
1373
+ var left = popper2.left;
1374
+ if (popper2.right > data.boundaries.right) {
1375
+ left = Math.min(popper2.left, data.boundaries.right - popper2.width);
1376
+ }
1377
+ return {
1378
+ left
1379
+ };
1380
+ },
1381
+ top: function() {
1382
+ var top = popper2.top;
1383
+ if (popper2.top < data.boundaries.top) {
1384
+ top = Math.max(popper2.top, data.boundaries.top);
1385
+ }
1386
+ return {
1387
+ top
1388
+ };
1389
+ },
1390
+ bottom: function() {
1391
+ var top = popper2.top;
1392
+ if (popper2.bottom > data.boundaries.bottom) {
1393
+ top = Math.min(popper2.top, data.boundaries.bottom - popper2.height);
1394
+ }
1395
+ return {
1396
+ top
1397
+ };
1398
+ }
1399
+ };
1400
+ order.forEach(function(direction) {
1401
+ data.offsets.popper = Object.assign(popper2, check[direction]());
1402
+ });
1403
+ return data;
1404
+ };
1405
+ Popper2.prototype.modifiers.keepTogether = function(data) {
1406
+ var popper2 = getPopperClientRect(data.offsets.popper);
1407
+ var reference = data.offsets.reference;
1408
+ var f = Math.floor;
1409
+ if (popper2.right < f(reference.left)) {
1410
+ data.offsets.popper.left = f(reference.left) - popper2.width;
1411
+ }
1412
+ if (popper2.left > f(reference.right)) {
1413
+ data.offsets.popper.left = f(reference.right);
1414
+ }
1415
+ if (popper2.bottom < f(reference.top)) {
1416
+ data.offsets.popper.top = f(reference.top) - popper2.height;
1417
+ }
1418
+ if (popper2.top > f(reference.bottom)) {
1419
+ data.offsets.popper.top = f(reference.bottom);
1420
+ }
1421
+ return data;
1422
+ };
1423
+ Popper2.prototype.modifiers.flip = function(data) {
1424
+ if (!this.isModifierRequired(this.modifiers.flip, this.modifiers.preventOverflow)) {
1425
+ console.warn("WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!");
1426
+ return data;
1427
+ }
1428
+ if (data.flipped && data.placement === data._originalPlacement) {
1429
+ return data;
1430
+ }
1431
+ var placement = data.placement.split("-")[0];
1432
+ var placementOpposite = getOppositePlacement(placement);
1433
+ var variation = data.placement.split("-")[1] || "";
1434
+ var flipOrder = [];
1435
+ if (this._options.flipBehavior === "flip") {
1436
+ flipOrder = [placement, placementOpposite];
1437
+ } else {
1438
+ flipOrder = this._options.flipBehavior;
1439
+ }
1440
+ flipOrder.forEach((function(step, index) {
1441
+ if (placement !== step || flipOrder.length === index + 1) {
1442
+ return;
1443
+ }
1444
+ placement = data.placement.split("-")[0];
1445
+ placementOpposite = getOppositePlacement(placement);
1446
+ var popperOffsets = getPopperClientRect(data.offsets.popper);
1447
+ var a = ["right", "bottom"].indexOf(placement) !== -1;
1448
+ if (a && Math.floor(data.offsets.reference[placement]) > Math.floor(popperOffsets[placementOpposite]) || !a && Math.floor(data.offsets.reference[placement]) < Math.floor(popperOffsets[placementOpposite])) {
1449
+ data.flipped = true;
1450
+ data.placement = flipOrder[index + 1];
1451
+ if (variation) {
1452
+ data.placement += "-" + variation;
1453
+ }
1454
+ data.offsets.popper = this._getOffsets(this._popper, this._reference, data.placement).popper;
1455
+ data = this.runModifiers(data, this._options.modifiers, this._flip);
1456
+ }
1457
+ }).bind(this));
1458
+ return data;
1459
+ };
1460
+ Popper2.prototype.modifiers.offset = function(data) {
1461
+ var offset = this._options.offset;
1462
+ var popper2 = data.offsets.popper;
1463
+ if (data.placement.indexOf("left") !== -1) {
1464
+ popper2.top -= offset;
1465
+ } else if (data.placement.indexOf("right") !== -1) {
1466
+ popper2.top += offset;
1467
+ } else if (data.placement.indexOf("top") !== -1) {
1468
+ popper2.left -= offset;
1469
+ } else if (data.placement.indexOf("bottom") !== -1) {
1470
+ popper2.left += offset;
1471
+ }
1472
+ return data;
1473
+ };
1474
+ Popper2.prototype.modifiers.arrow = function(data) {
1475
+ var arrow = this._options.arrowElement;
1476
+ var arrowOffset = this._options.arrowOffset;
1477
+ if (typeof arrow === "string") {
1478
+ arrow = this._popper.querySelector(arrow);
1479
+ }
1480
+ if (!arrow) {
1481
+ return data;
1482
+ }
1483
+ if (!this._popper.contains(arrow)) {
1484
+ console.warn("WARNING: `arrowElement` must be child of its popper element!");
1485
+ return data;
1486
+ }
1487
+ if (!this.isModifierRequired(this.modifiers.arrow, this.modifiers.keepTogether)) {
1488
+ console.warn("WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!");
1489
+ return data;
1490
+ }
1491
+ var arrowStyle = {};
1492
+ var placement = data.placement.split("-")[0];
1493
+ var popper2 = getPopperClientRect(data.offsets.popper);
1494
+ var reference = data.offsets.reference;
1495
+ var isVertical = ["left", "right"].indexOf(placement) !== -1;
1496
+ var len = isVertical ? "height" : "width";
1497
+ var side = isVertical ? "top" : "left";
1498
+ var altSide = isVertical ? "left" : "top";
1499
+ var opSide = isVertical ? "bottom" : "right";
1500
+ var arrowSize = getOuterSizes(arrow)[len];
1501
+ if (reference[opSide] - arrowSize < popper2[side]) {
1502
+ data.offsets.popper[side] -= popper2[side] - (reference[opSide] - arrowSize);
1503
+ }
1504
+ if (reference[side] + arrowSize > popper2[opSide]) {
1505
+ data.offsets.popper[side] += reference[side] + arrowSize - popper2[opSide];
1506
+ }
1507
+ var center = reference[side] + (arrowOffset || reference[len] / 2 - arrowSize / 2);
1508
+ var sideValue = center - popper2[side];
1509
+ sideValue = Math.max(Math.min(popper2[len] - arrowSize - 8, sideValue), 8);
1510
+ arrowStyle[side] = sideValue;
1511
+ arrowStyle[altSide] = "";
1512
+ data.offsets.arrow = arrowStyle;
1513
+ data.arrowElement = arrow;
1514
+ return data;
1515
+ };
1516
+ function getOuterSizes(element) {
1517
+ var _display = element.style.display, _visibility = element.style.visibility;
1518
+ element.style.display = "block";
1519
+ element.style.visibility = "hidden";
1520
+ element.offsetWidth;
1521
+ var styles = root.getComputedStyle(element);
1522
+ var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
1523
+ var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
1524
+ var result = {
1525
+ width: element.offsetWidth + y,
1526
+ height: element.offsetHeight + x
1527
+ };
1528
+ element.style.display = _display;
1529
+ element.style.visibility = _visibility;
1530
+ return result;
1531
+ }
1532
+ function getOppositePlacement(placement) {
1533
+ var hash = {
1534
+ left: "right",
1535
+ right: "left",
1536
+ bottom: "top",
1537
+ top: "bottom"
1538
+ };
1539
+ return placement.replace(/left|right|bottom|top/g, function(matched) {
1540
+ return hash[matched];
1541
+ });
1542
+ }
1543
+ function getPopperClientRect(popperOffsets) {
1544
+ var offsets = Object.assign({}, popperOffsets);
1545
+ offsets.right = offsets.left + offsets.width;
1546
+ offsets.bottom = offsets.top + offsets.height;
1547
+ return offsets;
1548
+ }
1549
+ function getArrayKeyIndex(arr, keyToFind) {
1550
+ var i = 0, key;
1551
+ for (key in arr) {
1552
+ if (arr[key] === keyToFind) {
1553
+ return i;
1554
+ }
1555
+ i++;
1556
+ }
1557
+ return null;
1558
+ }
1559
+ function getStyleComputedProperty(element, property) {
1560
+ var css = root.getComputedStyle(element, null);
1561
+ return css[property];
1562
+ }
1563
+ function getOffsetParent(element) {
1564
+ var offsetParent = element.offsetParent;
1565
+ return offsetParent === root.document.body || !offsetParent ? root.document.documentElement : offsetParent;
1566
+ }
1567
+ function getScrollParent(element) {
1568
+ var parent = element.parentNode;
1569
+ if (!parent) {
1570
+ return element;
1571
+ }
1572
+ if (parent === root.document) {
1573
+ if (root.document.body.scrollTop || root.document.body.scrollLeft) {
1574
+ return root.document.body;
1575
+ } else {
1576
+ return root.document.documentElement;
1577
+ }
1578
+ }
1579
+ if (["scroll", "auto"].indexOf(getStyleComputedProperty(parent, "overflow")) !== -1 || ["scroll", "auto"].indexOf(getStyleComputedProperty(parent, "overflow-x")) !== -1 || ["scroll", "auto"].indexOf(getStyleComputedProperty(parent, "overflow-y")) !== -1) {
1580
+ return parent;
1581
+ }
1582
+ return getScrollParent(element.parentNode);
1583
+ }
1584
+ function isFixed(element) {
1585
+ if (element === root.document.body) {
1586
+ return false;
1587
+ }
1588
+ if (getStyleComputedProperty(element, "position") === "fixed") {
1589
+ return true;
1590
+ }
1591
+ return element.parentNode ? isFixed(element.parentNode) : element;
1592
+ }
1593
+ function setStyle(element, styles) {
1594
+ function is_numeric(n) {
1595
+ return n !== "" && !isNaN(parseFloat(n)) && isFinite(n);
1596
+ }
1597
+ Object.keys(styles).forEach(function(prop) {
1598
+ var unit = "";
1599
+ if (["width", "height", "top", "right", "bottom", "left"].indexOf(prop) !== -1 && is_numeric(styles[prop])) {
1600
+ unit = "px";
1601
+ }
1602
+ element.style[prop] = styles[prop] + unit;
1603
+ });
1604
+ }
1605
+ function isFunction(functionToCheck) {
1606
+ var getType = {};
1607
+ return functionToCheck && getType.toString.call(functionToCheck) === "[object Function]";
1608
+ }
1609
+ function getOffsetRect(element) {
1610
+ var elementRect = {
1611
+ width: element.offsetWidth,
1612
+ height: element.offsetHeight,
1613
+ left: element.offsetLeft,
1614
+ top: element.offsetTop
1615
+ };
1616
+ elementRect.right = elementRect.left + elementRect.width;
1617
+ elementRect.bottom = elementRect.top + elementRect.height;
1618
+ return elementRect;
1619
+ }
1620
+ function getBoundingClientRect(element) {
1621
+ var rect = element.getBoundingClientRect();
1622
+ var isIE = navigator.userAgent.indexOf("MSIE") != -1;
1623
+ var rectTop = isIE && element.tagName === "HTML" ? -element.scrollTop : rect.top;
1624
+ return {
1625
+ left: rect.left,
1626
+ top: rectTop,
1627
+ right: rect.right,
1628
+ bottom: rect.bottom,
1629
+ width: rect.right - rect.left,
1630
+ height: rect.bottom - rectTop
1631
+ };
1632
+ }
1633
+ function getOffsetRectRelativeToCustomParent(element, parent, fixed) {
1634
+ var elementRect = getBoundingClientRect(element);
1635
+ var parentRect = getBoundingClientRect(parent);
1636
+ if (fixed) {
1637
+ var scrollParent = getScrollParent(parent);
1638
+ parentRect.top += scrollParent.scrollTop;
1639
+ parentRect.bottom += scrollParent.scrollTop;
1640
+ parentRect.left += scrollParent.scrollLeft;
1641
+ parentRect.right += scrollParent.scrollLeft;
1642
+ }
1643
+ var rect = {
1644
+ top: elementRect.top - parentRect.top,
1645
+ left: elementRect.left - parentRect.left,
1646
+ bottom: elementRect.top - parentRect.top + elementRect.height,
1647
+ right: elementRect.left - parentRect.left + elementRect.width,
1648
+ width: elementRect.width,
1649
+ height: elementRect.height
1650
+ };
1651
+ return rect;
1652
+ }
1653
+ function getSupportedPropertyName(property) {
1654
+ var prefixes = ["", "ms", "webkit", "moz", "o"];
1655
+ for (var i = 0; i < prefixes.length; i++) {
1656
+ var toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;
1657
+ if (typeof root.document.body.style[toCheck] !== "undefined") {
1658
+ return toCheck;
1659
+ }
1660
+ }
1661
+ return null;
1662
+ }
1663
+ if (!Object.assign) {
1664
+ Object.defineProperty(Object, "assign", {
1665
+ enumerable: false,
1666
+ configurable: true,
1667
+ writable: true,
1668
+ value: function(target) {
1669
+ if (target === void 0 || target === null) {
1670
+ throw new TypeError("Cannot convert first argument to object");
1671
+ }
1672
+ var to = Object(target);
1673
+ for (var i = 1; i < arguments.length; i++) {
1674
+ var nextSource = arguments[i];
1675
+ if (nextSource === void 0 || nextSource === null) {
1676
+ continue;
1677
+ }
1678
+ nextSource = Object(nextSource);
1679
+ var keysArray = Object.keys(nextSource);
1680
+ for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
1681
+ var nextKey = keysArray[nextIndex];
1682
+ var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
1683
+ if (desc !== void 0 && desc.enumerable) {
1684
+ to[nextKey] = nextSource[nextKey];
1685
+ }
1686
+ }
1687
+ }
1688
+ return to;
1689
+ }
1690
+ });
1691
+ }
1692
+ return Popper2;
1693
+ });
1694
+ })(popper$1);
1695
+ var popperExports = popper$1.exports;
1696
+ const popper = /* @__PURE__ */ getDefaultExportFromCjs(popperExports);
1697
+ const _vite_plugin_require_transform_popper_0 = /* @__PURE__ */ _mergeNamespaces({
1698
+ __proto__: null,
1699
+ default: popper
1700
+ }, [popperExports]);
1701
+ const PopperJS = Vue.prototype.$isServer ? function() {
1702
+ } : popper || _vite_plugin_require_transform_popper_0;
1703
+ const stop = (e) => e.stopPropagation();
1704
+ const Popper = {
1705
+ props: {
1706
+ transformOrigin: {
1707
+ type: [Boolean, String],
1708
+ default: true
1709
+ },
1710
+ placement: {
1711
+ type: String,
1712
+ default: "bottom"
1713
+ },
1714
+ boundariesPadding: {
1715
+ type: Number,
1716
+ default: 5
1717
+ },
1718
+ reference: {},
1719
+ popper: {},
1720
+ offset: {
1721
+ default: 0
1722
+ },
1723
+ value: Boolean,
1724
+ visibleArrow: Boolean,
1725
+ arrowOffset: {
1726
+ type: Number,
1727
+ default: 35
1728
+ },
1729
+ appendToBody: {
1730
+ type: Boolean,
1731
+ default: true
1732
+ },
1733
+ popperOptions: {
1734
+ type: Object,
1735
+ default() {
1736
+ return {
1737
+ gpuAcceleration: false
1738
+ };
1739
+ }
1740
+ }
1741
+ },
1742
+ data() {
1743
+ return {
1744
+ showPopper: false,
1745
+ currentPlacement: ""
1746
+ };
1747
+ },
1748
+ watch: {
1749
+ value: {
1750
+ immediate: true,
1751
+ handler(val) {
1752
+ this.showPopper = val;
1753
+ this.$emit("input", val);
1754
+ }
1755
+ },
1756
+ showPopper(val) {
1757
+ if (this.disabled)
1758
+ return;
1759
+ val ? this.updatePopper() : this.destroyPopper();
1760
+ this.$emit("input", val);
1761
+ }
1762
+ },
1763
+ methods: {
1764
+ createPopper() {
1765
+ if (this.$isServer)
1766
+ return;
1767
+ this.currentPlacement = this.currentPlacement || this.placement;
1768
+ if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(this.currentPlacement)) {
1769
+ return;
1770
+ }
1771
+ const options = this.popperOptions;
1772
+ const popper2 = this.popperElm = this.popperElm || this.popper || this.$refs.popper;
1773
+ let reference = this.referenceElm = this.referenceElm || this.reference || this.$refs.reference;
1774
+ if (!reference && this.$slots.reference && this.$slots.reference[0]) {
1775
+ reference = this.referenceElm = this.$slots.reference[0].elm;
1776
+ }
1777
+ if (!popper2 || !reference)
1778
+ return;
1779
+ if (this.visibleArrow)
1780
+ this.appendArrow(popper2);
1781
+ if (this.appendToBody)
1782
+ document.body.appendChild(this.popperElm);
1783
+ if (this.popperJS && this.popperJS.destroy) {
1784
+ this.popperJS.destroy();
1785
+ }
1786
+ options.placement = this.currentPlacement;
1787
+ options.offset = this.offset;
1788
+ options.arrowOffset = this.arrowOffset;
1789
+ this.popperJS = new PopperJS(reference, popper2, options);
1790
+ this.popperJS.onCreate((_) => {
1791
+ this.$emit("created", this);
1792
+ this.resetTransformOrigin();
1793
+ this.$nextTick(this.updatePopper);
1794
+ });
1795
+ if (typeof options.onUpdate === "function") {
1796
+ this.popperJS.onUpdate(options.onUpdate);
1797
+ }
1798
+ this.popperJS._popper.style.zIndex = PopupManager.nextZIndex();
1799
+ this.popperElm.addEventListener("click", stop);
1800
+ },
1801
+ updatePopper() {
1802
+ const popperJS = this.popperJS;
1803
+ if (popperJS) {
1804
+ popperJS.update();
1805
+ if (popperJS._popper) {
1806
+ popperJS._popper.style.zIndex = PopupManager.nextZIndex();
1807
+ }
1808
+ } else {
1809
+ this.createPopper();
1810
+ }
1811
+ },
1812
+ doDestroy(forceDestroy) {
1813
+ if (!this.popperJS || this.showPopper && !forceDestroy)
1814
+ return;
1815
+ this.popperJS.destroy();
1816
+ this.popperJS = null;
1817
+ },
1818
+ destroyPopper() {
1819
+ if (this.popperJS) {
1820
+ this.resetTransformOrigin();
1821
+ }
1822
+ },
1823
+ resetTransformOrigin() {
1824
+ if (!this.transformOrigin)
1825
+ return;
1826
+ let placementMap = {
1827
+ top: "bottom",
1828
+ bottom: "top",
1829
+ left: "right",
1830
+ right: "left"
1831
+ };
1832
+ let placement = this.popperJS._popper.getAttribute("x-placement").split("-")[0];
1833
+ let origin = placementMap[placement];
1834
+ this.popperJS._popper.style.transformOrigin = typeof this.transformOrigin === "string" ? this.transformOrigin : ["top", "bottom"].indexOf(placement) > -1 ? `center ${origin}` : `${origin} center`;
1835
+ },
1836
+ appendArrow(element) {
1837
+ let hash;
1838
+ if (this.appended) {
1839
+ return;
1840
+ }
1841
+ this.appended = true;
1842
+ for (let item in element.attributes) {
1843
+ if (/^_v-/.test(element.attributes[item].name)) {
1844
+ hash = element.attributes[item].name;
1845
+ break;
1846
+ }
1847
+ }
1848
+ const arrow = document.createElement("div");
1849
+ if (hash) {
1850
+ arrow.setAttribute(hash, "");
1851
+ }
1852
+ arrow.setAttribute("x-arrow", "");
1853
+ arrow.className = "popper__arrow";
1854
+ element.appendChild(arrow);
1855
+ }
1856
+ },
1857
+ beforeDestroy() {
1858
+ this.doDestroy(true);
1859
+ if (this.popperElm && this.popperElm.parentNode === document.body) {
1860
+ this.popperElm.removeEventListener("click", stop);
1861
+ document.body.removeChild(this.popperElm);
1862
+ }
1863
+ },
1864
+ // call destroy in keep-alive mode
1865
+ deactivated() {
1866
+ this.$options.beforeDestroy[0].call(this);
1867
+ }
1868
+ };
1869
+ function broadcast(componentName, eventName, params) {
1870
+ this.$children.forEach((child) => {
1871
+ var name = child.$options.componentName;
1872
+ if (name === componentName) {
1873
+ child.$emit.apply(child, [eventName].concat(params));
1874
+ } else {
1875
+ broadcast.apply(child, [componentName, eventName].concat([params]));
1876
+ }
1877
+ });
1878
+ }
1879
+ const Emitter = {
1880
+ methods: {
1881
+ dispatch(componentName, eventName, params) {
1882
+ var parent = this.$parent || this.$root;
1883
+ var name = parent.$options.componentName;
1884
+ while (parent && (!name || name !== componentName)) {
1885
+ parent = parent.$parent;
1886
+ if (parent) {
1887
+ name = parent.$options.componentName;
1888
+ }
1889
+ }
1890
+ if (parent) {
1891
+ parent.$emit.apply(parent, [eventName].concat(params));
1892
+ }
1893
+ },
1894
+ broadcast(componentName, eventName, params) {
1895
+ broadcast.call(this, componentName, eventName, params);
1896
+ }
1897
+ }
1898
+ };
1899
+ const NewPopper = {
1900
+ props: {
1901
+ appendToBody: Popper.props.appendToBody,
1902
+ offset: Popper.props.offset,
1903
+ boundariesPadding: Popper.props.boundariesPadding,
1904
+ arrowOffset: Popper.props.arrowOffset
1905
+ },
1906
+ methods: Popper.methods,
1907
+ data() {
1908
+ return merge({
1909
+ visibleArrow: true,
1910
+ type: "weekrange"
1911
+ }, Popper.data);
1912
+ },
1913
+ beforeDestroy: Popper.beforeDestroy
1914
+ };
1915
+ const DEFAULT_FORMATS = {
1916
+ weekrange: "WW周(yyyy年)"
1917
+ };
1918
+ const DATE_PARSER = function(text, format2) {
1919
+ if (format2 === "timestamp")
1920
+ return new Date(Number(text));
1921
+ return parseDate(text, format2);
1922
+ };
1923
+ const RANGE_PARSER = function(array, format2) {
1924
+ if (array.length === 2) {
1925
+ const range1 = array[0];
1926
+ const range2 = array[1];
1927
+ return [DATE_PARSER(range1, format2), DATE_PARSER(range2, format2)];
1928
+ }
1929
+ return [];
1930
+ };
1931
+ const TYPE_VALUE_RESOLVER_MAP = {
1932
+ default: {
1933
+ formatter(value) {
1934
+ if (!value)
1935
+ return "";
1936
+ return "" + value;
1937
+ },
1938
+ parser(text) {
1939
+ if (text === void 0 || text === "")
1940
+ return null;
1941
+ return text;
1942
+ }
1943
+ },
1944
+ weekrange: {
1945
+ formatter(value, format2) {
1946
+ function getDate(value2) {
1947
+ function isLeapYear(year) {
1948
+ return year % 4 == 0 && year % 100 != 0 || year % 400 == 0;
1949
+ }
1950
+ function getDays(date3) {
1951
+ const year = date3.getFullYear();
1952
+ const month2 = date3.getMonth() + 1;
1953
+ const day = date3.getDate();
1954
+ let days2 = day;
1955
+ const monthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1956
+ for (let i = 0; i < month2 - 1; i++) {
1957
+ days2 += monthDays[i];
1958
+ }
1959
+ if (isLeapYear(year) && month2 > 2) {
1960
+ days2++;
1961
+ }
1962
+ return days2++;
1963
+ }
1964
+ if (!value2) {
1965
+ return;
1966
+ }
1967
+ const y = value2.getFullYear();
1968
+ const yearOneDateSun = (/* @__PURE__ */ new Date(y + "-01-01")).getDay() || 7;
1969
+ const days = getDays(value2);
1970
+ const week = getWeekNumber(value2);
1971
+ const month = value2.getMonth();
1972
+ const trueDate = new Date(value2);
1973
+ if (week === 1 && month === 11) {
1974
+ trueDate.setHours(0, 0, 0, 0);
1975
+ trueDate.setDate(trueDate.getDate() + 3 - (trueDate.getDay() + 6) % 7);
1976
+ }
1977
+ let date2 = formatDate(trueDate, format2);
1978
+ if (7 - yearOneDateSun < 4 && 7 - yearOneDateSun >= days) {
1979
+ date2 = date2.replace(new RegExp(y, "ig"), y - 1);
1980
+ }
1981
+ date2 = /WW/.test(date2) ? date2.replace(/WW/, week < 10 ? "0" + week : week) : date2.replace(/W/, week);
1982
+ return date2;
1983
+ }
1984
+ if (!Array.isArray(value)) {
1985
+ return getDate(value);
1986
+ }
1987
+ const dateList = [];
1988
+ for (const val of value) {
1989
+ dateList.push(getDate(val));
1990
+ }
1991
+ return dateList;
1992
+ },
1993
+ parser: RANGE_PARSER
1994
+ }
1995
+ };
1996
+ const PLACEMENT_MAP = {
1997
+ left: "bottom-start",
1998
+ center: "bottom",
1999
+ right: "bottom-end"
2000
+ };
2001
+ const parseAsFormatAndType = (value, customFormat, type) => {
2002
+ if (!value)
2003
+ return null;
2004
+ const parser = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP["default"]).parser;
2005
+ const format2 = customFormat || DEFAULT_FORMATS[type];
2006
+ return parser(value, format2);
2007
+ };
2008
+ const formatAsFormatAndType = (value, customFormat, type = "weekrange") => {
2009
+ if (!value)
2010
+ return null;
2011
+ const formatter = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP["default"]).formatter;
2012
+ const format2 = customFormat || DEFAULT_FORMATS[type];
2013
+ return formatter(value, format2);
2014
+ };
2015
+ const valueEquals = function(a, b) {
2016
+ const dateEquals = function(a2, b2) {
2017
+ const aIsDate = a2 instanceof Date;
2018
+ const bIsDate = b2 instanceof Date;
2019
+ if (aIsDate && bIsDate) {
2020
+ return a2.getTime() === b2.getTime();
2021
+ }
2022
+ if (!aIsDate && !bIsDate) {
2023
+ return a2 === b2;
2024
+ }
2025
+ return false;
2026
+ };
2027
+ const aIsArray = a instanceof Array;
2028
+ const bIsArray = b instanceof Array;
2029
+ if (aIsArray && bIsArray) {
2030
+ if (a.length !== b.length) {
2031
+ return false;
2032
+ }
2033
+ return a.every((item, index) => dateEquals(item, b[index]));
2034
+ }
2035
+ if (!aIsArray && !bIsArray) {
2036
+ return dateEquals(a, b);
2037
+ }
2038
+ return false;
2039
+ };
2040
+ const isString = function(val) {
2041
+ return typeof val === "string" || val instanceof String;
2042
+ };
2043
+ const validator = function(val) {
2044
+ return val === null || val === void 0 || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString);
2045
+ };
2046
+ const _sfc_main$4 = {
2047
+ directives: {
2048
+ Clickoutside
2049
+ },
2050
+ mixins: [Emitter, NewPopper],
2051
+ inject: {
2052
+ elForm: {
2053
+ default: ""
2054
+ },
2055
+ elFormItem: {
2056
+ default: ""
2057
+ }
2058
+ },
2059
+ props: {
2060
+ size: {
2061
+ type: String,
2062
+ default: void 0
2063
+ },
2064
+ format: String,
2065
+ valueFormat: String,
2066
+ readonly: Boolean,
2067
+ startPlaceholder: {
2068
+ type: String,
2069
+ default: "开始周"
2070
+ },
2071
+ endPlaceholder: {
2072
+ type: String,
2073
+ default: "结束周"
2074
+ },
2075
+ prefixIcon: String,
2076
+ clearIcon: {
2077
+ type: String,
2078
+ default: "el-icon-circle-close"
2079
+ },
2080
+ name: {
2081
+ default: "",
2082
+ validator
2083
+ },
2084
+ disabled: Boolean,
2085
+ clearable: {
2086
+ type: Boolean,
2087
+ default: true
2088
+ },
2089
+ id: {
2090
+ default: "",
2091
+ validator
2092
+ },
2093
+ popperClass: String,
2094
+ editable: {
2095
+ type: Boolean,
2096
+ default: true
2097
+ },
2098
+ align: {
2099
+ type: String,
2100
+ default: "left"
2101
+ },
2102
+ value: {},
2103
+ defaultValue: {},
2104
+ defaultTime: {},
2105
+ rangeSeparator: {
2106
+ default: "-"
2107
+ },
2108
+ pickerOptions: {},
2109
+ unlinkPanels: Boolean,
2110
+ validateEvent: {
2111
+ type: Boolean,
2112
+ default: true
2113
+ }
2114
+ },
2115
+ data() {
2116
+ return {
2117
+ pickerVisible: false,
2118
+ showClose: false,
2119
+ userInput: null,
2120
+ valueOnOpen: null,
2121
+ // value when picker opens, used to determine whether to emit change
2122
+ unwatchPickerOptions: null,
2123
+ dateList: []
2124
+ };
2125
+ },
2126
+ computed: {
2127
+ reference() {
2128
+ const reference = this.$refs.reference;
2129
+ return reference.$el || reference;
2130
+ },
2131
+ refInput() {
2132
+ if (this.reference) {
2133
+ return [].slice.call(this.reference.querySelectorAll("input"));
2134
+ }
2135
+ return [];
2136
+ },
2137
+ valueIsEmpty() {
2138
+ const val = this.value;
2139
+ if (Array.isArray(val)) {
2140
+ for (let i = 0, len = val.length; i < len; i++) {
2141
+ if (val[i]) {
2142
+ return false;
2143
+ }
2144
+ }
2145
+ } else {
2146
+ if (val) {
2147
+ return false;
2148
+ }
2149
+ }
2150
+ return true;
2151
+ },
2152
+ triggerClass() {
2153
+ return this.prefixIcon || "el-icon-date";
2154
+ },
2155
+ haveTrigger() {
2156
+ if (typeof this.showTrigger !== "undefined") {
2157
+ return this.showTrigger;
2158
+ }
2159
+ return true;
2160
+ },
2161
+ displayValue() {
2162
+ const formattedValue = formatAsFormatAndType(this.parsedValue, this.format);
2163
+ if (Array.isArray(this.userInput)) {
2164
+ return [this.userInput[0] || formattedValue && formattedValue[0] || "", this.userInput[1] || formattedValue && formattedValue[1] || ""];
2165
+ } else if (this.userInput !== null) {
2166
+ return this.userInput;
2167
+ } else if (formattedValue && !Array.isArray(formattedValue) || Array.isArray(formattedValue) && formattedValue.length >= 2) {
2168
+ return formattedValue;
2169
+ } else {
2170
+ return "";
2171
+ }
2172
+ },
2173
+ parsedValue() {
2174
+ var _a;
2175
+ if (!this.value)
2176
+ return this.value;
2177
+ const valueIsDateObject = isDateObject(this.value) || Array.isArray(this.value) && this.value.every(isDateObject);
2178
+ if (valueIsDateObject) {
2179
+ return this.value;
2180
+ }
2181
+ if (this.valueFormat) {
2182
+ if ((_a = this.dateList) == null ? void 0 : _a.length) {
2183
+ return this.dateList;
2184
+ } else {
2185
+ if (Array.isArray(this.value)) {
2186
+ this.value.forEach((v) => {
2187
+ this.dateList.push(new Date(v));
2188
+ });
2189
+ } else {
2190
+ this.dateList = this.value || [];
2191
+ }
2192
+ return this.dateList;
2193
+ }
2194
+ }
2195
+ return Array.isArray(this.value) ? this.value.map((val) => new Date(val)) : new Date(this.value);
2196
+ },
2197
+ _elFormItemSize() {
2198
+ return (this.elFormItem || {}).elFormItemSize;
2199
+ },
2200
+ pickerSize() {
2201
+ return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
2202
+ },
2203
+ pickerDisabled() {
2204
+ return this.disabled || (this.elForm || {}).disabled;
2205
+ },
2206
+ firstInputId() {
2207
+ const obj = {};
2208
+ const id = this.id && this.id[0];
2209
+ if (id)
2210
+ obj.id = id;
2211
+ return obj;
2212
+ },
2213
+ secondInputId() {
2214
+ const obj = {};
2215
+ const id = this.id && this.id[1];
2216
+ if (id)
2217
+ obj.id = id;
2218
+ return obj;
2219
+ }
2220
+ },
2221
+ watch: {
2222
+ pickerVisible(val) {
2223
+ if (this.readonly || this.pickerDisabled)
2224
+ return;
2225
+ if (val) {
2226
+ this.showPicker();
2227
+ this.valueOnOpen = Array.isArray(this.value) ? [...this.value] : this.value;
2228
+ } else {
2229
+ this.hidePicker();
2230
+ this.emitChange(this.value);
2231
+ this.userInput = null;
2232
+ if (this.validateEvent) {
2233
+ this.dispatch("ElFormItem", "el.form.blur");
2234
+ }
2235
+ this.$emit("blur", this);
2236
+ this.blur();
2237
+ }
2238
+ },
2239
+ parsedValue: {
2240
+ immediate: true,
2241
+ handler(val) {
2242
+ if (this.picker) {
2243
+ this.picker.value = val;
2244
+ }
2245
+ }
2246
+ },
2247
+ defaultValue(val) {
2248
+ if (this.picker) {
2249
+ this.picker.defaultValue = val;
2250
+ }
2251
+ },
2252
+ value(val, oldVal) {
2253
+ if (!valueEquals(val, oldVal) && !this.pickerVisible && this.validateEvent) {
2254
+ this.dispatch("ElFormItem", "el.form.change", val);
2255
+ }
2256
+ }
2257
+ },
2258
+ created() {
2259
+ this.popperOptions = {
2260
+ boundariesPadding: 0,
2261
+ gpuAcceleration: false
2262
+ };
2263
+ this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left;
2264
+ this.$on("fieldReset", this.handleFieldReset);
2265
+ },
2266
+ methods: {
2267
+ focus() {
2268
+ this.handleFocus();
2269
+ },
2270
+ blur() {
2271
+ this.refInput.forEach((input) => input.blur());
2272
+ },
2273
+ // {parse, formatTo} Value deals maps component value with internal Date
2274
+ parseValue(value) {
2275
+ const isParsed = isDateObject(value) || Array.isArray(value) && value.every(isDateObject);
2276
+ if (this.valueFormat && !isParsed) {
2277
+ return parseAsFormatAndType(value, this.valueFormat, this.type) || value;
2278
+ } else {
2279
+ return value;
2280
+ }
2281
+ },
2282
+ formatToValue(date2) {
2283
+ const isFormattable = isDateObject(date2) || Array.isArray(date2) && date2.every(isDateObject);
2284
+ if (this.valueFormat && isFormattable) {
2285
+ return formatAsFormatAndType(date2, this.valueFormat);
2286
+ } else {
2287
+ return date2;
2288
+ }
2289
+ },
2290
+ // {parse, formatTo} String deals with user input
2291
+ parseString(value) {
2292
+ return parseAsFormatAndType(value, this.format, this.type);
2293
+ },
2294
+ formatToString(value) {
2295
+ return formatAsFormatAndType(value, this.format);
2296
+ },
2297
+ handleMouseEnter() {
2298
+ if (this.readonly || this.pickerDisabled)
2299
+ return;
2300
+ if (!this.valueIsEmpty && this.clearable) {
2301
+ this.showClose = true;
2302
+ }
2303
+ },
2304
+ handleChange() {
2305
+ if (this.userInput) {
2306
+ const value = this.parseString(this.displayValue);
2307
+ if (value) {
2308
+ this.picker.value = value;
2309
+ if (this.isValidValue(value)) {
2310
+ this.emitInput(value);
2311
+ this.userInput = null;
2312
+ }
2313
+ }
2314
+ }
2315
+ if (this.userInput === "") {
2316
+ this.emitInput(null);
2317
+ this.emitChange(null);
2318
+ this.userInput = null;
2319
+ }
2320
+ },
2321
+ handleClickIcon(event) {
2322
+ if (this.readonly || this.pickerDisabled)
2323
+ return;
2324
+ if (this.showClose) {
2325
+ this.valueOnOpen = this.value;
2326
+ event.stopPropagation();
2327
+ this.emitInput(null);
2328
+ this.emitChange(null);
2329
+ this.showClose = false;
2330
+ if (this.picker && typeof this.picker.handleClear === "function") {
2331
+ this.picker.handleClear();
2332
+ }
2333
+ } else {
2334
+ this.pickerVisible = !this.pickerVisible;
2335
+ }
2336
+ },
2337
+ handleClose() {
2338
+ if (!this.pickerVisible)
2339
+ return;
2340
+ this.pickerVisible = false;
2341
+ },
2342
+ handleFieldReset(initialValue) {
2343
+ this.userInput = initialValue === "" ? null : initialValue;
2344
+ },
2345
+ handleFocus() {
2346
+ if (!this.pickerVisible) {
2347
+ this.pickerVisible = true;
2348
+ }
2349
+ this.$emit("focus", this);
2350
+ },
2351
+ handleKeydown(event) {
2352
+ const keyCode = event.keyCode;
2353
+ if (keyCode === 27) {
2354
+ this.pickerVisible = false;
2355
+ event.stopPropagation();
2356
+ return;
2357
+ }
2358
+ if (keyCode === 9) {
2359
+ let timer = setTimeout(() => {
2360
+ if (this.refInput.indexOf(document.activeElement) === -1) {
2361
+ this.pickerVisible = false;
2362
+ this.blur();
2363
+ event.stopPropagation();
2364
+ }
2365
+ clearTimeout(timer);
2366
+ timer = null;
2367
+ }, 0);
2368
+ return;
2369
+ }
2370
+ if (keyCode === 13) {
2371
+ if (this.userInput === "" || this.isValidValue(this.parseString(this.displayValue))) {
2372
+ this.handleChange();
2373
+ this.pickerVisible = this.picker.visible = false;
2374
+ this.blur();
2375
+ }
2376
+ event.stopPropagation();
2377
+ return;
2378
+ }
2379
+ if (this.userInput) {
2380
+ event.stopPropagation();
2381
+ return;
2382
+ }
2383
+ if (this.picker && this.picker.handleKeydown) {
2384
+ this.picker.handleKeydown(event);
2385
+ }
2386
+ },
2387
+ handleRangeClick() {
2388
+ if (!this.pickerVisible) {
2389
+ this.pickerVisible = true;
2390
+ }
2391
+ this.$emit("focus", this);
2392
+ },
2393
+ hidePicker() {
2394
+ if (this.picker) {
2395
+ let timer = setTimeout(() => {
2396
+ this.picker.resetView && this.picker.resetView();
2397
+ }, 100);
2398
+ this.pickerVisible = this.picker.visible = false;
2399
+ this.destroyPopper();
2400
+ clearTimeout(timer);
2401
+ timer = null;
2402
+ }
2403
+ },
2404
+ showPicker() {
2405
+ if (this.$isServer)
2406
+ return;
2407
+ if (!this.picker) {
2408
+ this.mountPicker();
2409
+ }
2410
+ this.pickerVisible = this.picker.visible = true;
2411
+ this.updatePopper();
2412
+ this.picker.value = this.parsedValue;
2413
+ this.picker.resetView && this.picker.resetView();
2414
+ this.$nextTick(() => {
2415
+ this.picker.adjustSpinners && this.picker.adjustSpinners();
2416
+ });
2417
+ },
2418
+ mountPicker() {
2419
+ this.picker = new Vue(this.panel).$mount();
2420
+ this.picker.defaultValue = this.defaultValue;
2421
+ this.picker.defaultTime = this.defaultTime;
2422
+ this.picker.popperClass = this.popperClass;
2423
+ this.popperElm = this.picker.$el;
2424
+ this.picker.width = this.reference.getBoundingClientRect().width;
2425
+ this.picker.showTime = false;
2426
+ this.picker.unlinkPanels = this.unlinkPanels;
2427
+ this.picker.arrowControl = this.arrowControl || this.timeArrowControl || false;
2428
+ this.$watch("format", (format2) => {
2429
+ this.picker.format = format2;
2430
+ });
2431
+ const updateOptions = () => {
2432
+ const options = this.pickerOptions;
2433
+ if (options && options.selectableRange) {
2434
+ let ranges = options.selectableRange;
2435
+ const parser = TYPE_VALUE_RESOLVER_MAP.datetimerange.parser;
2436
+ const format2 = DEFAULT_FORMATS.timerange;
2437
+ ranges = Array.isArray(ranges) ? ranges : [ranges];
2438
+ this.picker.selectableRange = ranges.map((range) => parser(range, format2, this.rangeSeparator));
2439
+ }
2440
+ for (const option in options) {
2441
+ if (Object.hasOwnProperty.call(options, option) && // 忽略 time-picker 的该配置项
2442
+ option !== "selectableRange") {
2443
+ this.picker[option] = options[option];
2444
+ }
2445
+ }
2446
+ if (this.format) {
2447
+ this.picker.format = this.format;
2448
+ }
2449
+ };
2450
+ updateOptions();
2451
+ this.unwatchPickerOptions = this.$watch("pickerOptions", () => updateOptions(), {
2452
+ deep: true
2453
+ });
2454
+ this.$el.appendChild(this.picker.$el);
2455
+ this.picker.resetView && this.picker.resetView();
2456
+ this.picker.$on("dodestroy", this.doDestroy);
2457
+ this.picker.$on("pick", (date2 = "", visible = false) => {
2458
+ this.userInput = null;
2459
+ this.pickerVisible = this.picker.visible = visible;
2460
+ this.emitInput(date2);
2461
+ this.picker.resetView && this.picker.resetView();
2462
+ });
2463
+ this.picker.$on("select-range", (start, end, pos) => {
2464
+ if (this.refInput.length === 0)
2465
+ return;
2466
+ if (!pos || pos === "min") {
2467
+ this.refInput[0].setSelectionRange(start, end);
2468
+ this.refInput[0].focus();
2469
+ } else if (pos === "max") {
2470
+ this.refInput[1].setSelectionRange(start, end);
2471
+ this.refInput[1].focus();
2472
+ }
2473
+ });
2474
+ },
2475
+ unmountPicker() {
2476
+ if (this.picker) {
2477
+ this.picker.$destroy();
2478
+ this.picker.$off();
2479
+ if (typeof this.unwatchPickerOptions === "function") {
2480
+ this.unwatchPickerOptions();
2481
+ }
2482
+ this.picker.$el.parentNode.removeChild(this.picker.$el);
2483
+ }
2484
+ },
2485
+ emitChange(val) {
2486
+ if (!valueEquals(val, this.valueOnOpen)) {
2487
+ this.$emit("change", val);
2488
+ this.$emit("update:value", val);
2489
+ this.valueOnOpen = val;
2490
+ if (this.validateEvent) {
2491
+ this.dispatch("ElFormItem", "el.form.change", val);
2492
+ }
2493
+ }
2494
+ },
2495
+ emitInput(val) {
2496
+ this.dateList = val;
2497
+ const formatted = this.formatToValue(val);
2498
+ if (!valueEquals(this.value, formatted)) {
2499
+ this.$emit("input", formatted);
2500
+ this.$emit("update:value", formatted);
2501
+ }
2502
+ },
2503
+ isValidValue(value) {
2504
+ if (!this.picker) {
2505
+ this.mountPicker();
2506
+ }
2507
+ if (this.picker.isValidValue) {
2508
+ return value && this.picker.isValidValue(value);
2509
+ } else {
2510
+ return true;
2511
+ }
2512
+ }
2513
+ }
2514
+ };
2515
+ var _sfc_render$4 = function render() {
2516
+ var _vm = this, _c = _vm._self._c;
2517
+ return _c("div", {
2518
+ directives: [{
2519
+ name: "clickoutside",
2520
+ rawName: "v-clickoutside",
2521
+ value: _vm.handleClose,
2522
+ expression: "handleClose"
2523
+ }],
2524
+ ref: "reference",
2525
+ staticClass: "el-date-editor nf-double-week el-range-editor el-input__inner nf-double-week-picker",
2526
+ class: ["el-date-editor--daterange", _vm.pickerSize ? `el-range-editor--${_vm.pickerSize}` : "", _vm.pickerDisabled ? "is-disabled" : "", _vm.pickerVisible ? "is-active" : ""],
2527
+ on: {
2528
+ "click": _vm.handleRangeClick,
2529
+ "mouseenter": _vm.handleMouseEnter,
2530
+ "mouseleave": function($event) {
2531
+ _vm.showClose = false;
2532
+ },
2533
+ "keydown": _vm.handleKeydown
2534
+ }
2535
+ }, [_c("i", {
2536
+ class: ["el-input__icon", "el-range__icon", _vm.triggerClass]
2537
+ }), _c("input", _vm._b({
2538
+ staticClass: "el-range-input",
2539
+ attrs: {
2540
+ "readonly": !_vm.editable || _vm.readonly,
2541
+ "autocomplete": "off",
2542
+ "placeholder": _vm.startPlaceholder,
2543
+ "disabled": _vm.pickerDisabled,
2544
+ "name": _vm.name && _vm.name[0],
2545
+ "size": _vm.pickerSize
2546
+ },
2547
+ domProps: {
2548
+ "value": _vm.displayValue && _vm.displayValue[0]
2549
+ }
2550
+ }, "input", _vm.firstInputId, false)), _vm._t("range-separator", function() {
2551
+ return [_c("span", {
2552
+ staticClass: "el-range-separator"
2553
+ }, [_vm._v(_vm._s(_vm.rangeSeparator))])];
2554
+ }), _c("input", _vm._b({
2555
+ staticClass: "el-range-input",
2556
+ attrs: {
2557
+ "autocomplete": "off",
2558
+ "placeholder": _vm.endPlaceholder,
2559
+ "disabled": _vm.pickerDisabled,
2560
+ "size": _vm.pickerSize,
2561
+ "name": _vm.name && _vm.name[1],
2562
+ "readonly": !_vm.editable || _vm.readonly
2563
+ },
2564
+ domProps: {
2565
+ "value": _vm.displayValue && _vm.displayValue[1]
2566
+ }
2567
+ }, "input", _vm.secondInputId, false)), _vm.haveTrigger ? _c("i", {
2568
+ staticClass: "el-input__icon el-range__close-icon",
2569
+ class: [_vm.showClose ? "" + _vm.clearIcon : ""],
2570
+ on: {
2571
+ "click": _vm.handleClickIcon
2572
+ }
2573
+ }) : _vm._e()], 2);
2574
+ };
2575
+ var _sfc_staticRenderFns$4 = [];
2576
+ var __component__$4 = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(_sfc_main$4, _sfc_render$4, _sfc_staticRenderFns$4, false, null, null, null, null);
2577
+ const Picker = __component__$4.exports;
2578
+ const Locale = {
2579
+ methods: {
2580
+ t(...args) {
2581
+ return t.apply(this, args);
2582
+ }
2583
+ }
2584
+ };
2585
+ const WEEKS = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
2586
+ const getDateTimestamp$1 = function(time) {
2587
+ if (typeof time === "number" || typeof time === "string") {
2588
+ return clearTime(new Date(time)).getTime();
2589
+ } else if (time instanceof Date) {
2590
+ return clearTime(time).getTime();
2591
+ } else {
2592
+ return NaN;
2593
+ }
2594
+ };
2595
+ const removeFromArray = function(arr, pred) {
2596
+ const idx = typeof pred === "function" ? arrayFindIndex(arr, pred) : arr.indexOf(pred);
2597
+ return idx >= 0 ? [...arr.slice(0, idx), ...arr.slice(idx + 1)] : arr;
2598
+ };
2599
+ const _sfc_main$3 = {
2600
+ mixins: [Locale],
2601
+ props: {
2602
+ firstDayOfWeek: {
2603
+ default: 7,
2604
+ type: Number,
2605
+ validator: (val) => val >= 1 && val <= 7
2606
+ },
2607
+ value: {},
2608
+ defaultValue: {
2609
+ validator(val) {
2610
+ return val === null || isDate(val) || Array.isArray(val) && val.every(isDate);
2611
+ }
2612
+ },
2613
+ date: {},
2614
+ selectionMode: {
2615
+ default: "day"
2616
+ },
2617
+ showWeekNumber: {
2618
+ type: Boolean,
2619
+ default: false
2620
+ },
2621
+ disabledDate: {},
2622
+ cellClassName: {},
2623
+ minDate: {},
2624
+ maxDate: {},
2625
+ rangeState: {
2626
+ default() {
2627
+ return {
2628
+ endDate: null,
2629
+ selecting: false
2630
+ };
2631
+ }
2632
+ }
2633
+ },
2634
+ computed: {
2635
+ offsetDay() {
2636
+ const week = this.firstDayOfWeek;
2637
+ return week > 3 ? 7 - week : -week;
2638
+ },
2639
+ WEEKS() {
2640
+ const week = this.firstDayOfWeek;
2641
+ return WEEKS.concat(WEEKS).slice(week, week + 7);
2642
+ },
2643
+ year() {
2644
+ return this.date.getFullYear();
2645
+ },
2646
+ month() {
2647
+ return this.date.getMonth();
2648
+ },
2649
+ startDate() {
2650
+ return getStartDateOfMonth(this.year, this.month);
2651
+ },
2652
+ rows() {
2653
+ const date2 = new Date(this.year, this.month, 1);
2654
+ let day = getFirstDayOfMonth(date2);
2655
+ const dateCountOfMonth = getDayCountOfMonth(date2.getFullYear(), date2.getMonth());
2656
+ const dateCountOfLastMonth = getDayCountOfMonth(date2.getFullYear(), date2.getMonth() === 0 ? 11 : date2.getMonth() - 1);
2657
+ day = day === 0 ? 7 : day;
2658
+ const offset = this.offsetDay;
2659
+ const rows = this.tableRows;
2660
+ let count = 1;
2661
+ const startDate = this.startDate;
2662
+ const disabledDate = this.disabledDate;
2663
+ const cellClassName = this.cellClassName;
2664
+ const selectedDate = this.selectionMode === "dates" ? coerceTruthyValueToArray(this.value) : [];
2665
+ const now = getDateTimestamp$1(/* @__PURE__ */ new Date());
2666
+ for (let i = 0; i < 6; i++) {
2667
+ const row = rows[i];
2668
+ if (this.showWeekNumber) {
2669
+ if (!row[0]) {
2670
+ row[0] = {
2671
+ type: "week",
2672
+ text: getWeekNumber(nextDate(startDate, i * 7 + 1))
2673
+ };
2674
+ }
2675
+ }
2676
+ for (let j = 0; j < 7; j++) {
2677
+ let cell = row[this.showWeekNumber ? j + 1 : j];
2678
+ if (!cell) {
2679
+ cell = {
2680
+ row: i,
2681
+ column: j,
2682
+ type: "normal",
2683
+ inRange: false,
2684
+ start: false,
2685
+ end: false
2686
+ };
2687
+ }
2688
+ cell.type = "normal";
2689
+ const index = i * 7 + j;
2690
+ const time = nextDate(startDate, index - offset).getTime();
2691
+ cell.inRange = time >= getDateTimestamp$1(this.minDate) && time <= getDateTimestamp$1(this.maxDate);
2692
+ cell.start = this.minDate && time === getDateTimestamp$1(this.minDate);
2693
+ cell.end = this.maxDate && time === getDateTimestamp$1(this.maxDate);
2694
+ const isToday = time === now;
2695
+ if (isToday) {
2696
+ cell.type = "today";
2697
+ }
2698
+ if (i >= 0 && i <= 1) {
2699
+ const numberOfDaysFromPreviousMonth = day + offset < 0 ? 7 + day + offset : day + offset;
2700
+ if (j + i * 7 >= numberOfDaysFromPreviousMonth) {
2701
+ cell.text = count++;
2702
+ } else {
2703
+ cell.text = dateCountOfLastMonth - (numberOfDaysFromPreviousMonth - j % 7) + 1 + i * 7;
2704
+ cell.type = "prev-month";
2705
+ }
2706
+ } else {
2707
+ if (count <= dateCountOfMonth) {
2708
+ cell.text = count++;
2709
+ } else {
2710
+ cell.text = count++ - dateCountOfMonth;
2711
+ cell.type = "next-month";
2712
+ }
2713
+ }
2714
+ let cellDate = new Date(time);
2715
+ cell.disabled = typeof disabledDate === "function" && disabledDate(cellDate);
2716
+ cell.selected = arrayFind(selectedDate, (date3) => date3.getTime() === cellDate.getTime());
2717
+ cell.customClass = typeof cellClassName === "function" && cellClassName(cellDate);
2718
+ this.$set(row, this.showWeekNumber ? j + 1 : j, cell);
2719
+ }
2720
+ if (this.selectionMode === "week") {
2721
+ const start = this.showWeekNumber ? 1 : 0;
2722
+ const end = this.showWeekNumber ? 7 : 6;
2723
+ const isWeekActive = this.isWeekActive(row[start + 1]);
2724
+ row[start].inRange = isWeekActive;
2725
+ row[start].start = isWeekActive;
2726
+ row[end].inRange = isWeekActive;
2727
+ row[end].end = isWeekActive;
2728
+ }
2729
+ }
2730
+ return rows;
2731
+ }
2732
+ },
2733
+ watch: {
2734
+ "rangeState.endDate"(newVal) {
2735
+ this.markRange(this.minDate, newVal);
2736
+ },
2737
+ minDate(newVal, oldVal) {
2738
+ if (getDateTimestamp$1(newVal) !== getDateTimestamp$1(oldVal)) {
2739
+ this.markRange(this.minDate, this.maxDate);
2740
+ }
2741
+ },
2742
+ maxDate(newVal, oldVal) {
2743
+ if (getDateTimestamp$1(newVal) !== getDateTimestamp$1(oldVal)) {
2744
+ this.markRange(this.minDate, this.maxDate);
2745
+ }
2746
+ }
2747
+ },
2748
+ data() {
2749
+ return {
2750
+ tableRows: [[], [], [], [], [], []],
2751
+ lastRow: null,
2752
+ lastColumn: null
2753
+ };
2754
+ },
2755
+ methods: {
2756
+ cellMatchesDate(cell, date2) {
2757
+ const value = new Date(date2);
2758
+ return this.year === value.getFullYear() && this.month === value.getMonth() && Number(cell.text) === value.getDate();
2759
+ },
2760
+ getCellClasses(cell) {
2761
+ const selectionMode = this.selectionMode;
2762
+ const defaultValue = this.defaultValue ? Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue] : [];
2763
+ let classes = [];
2764
+ if ((cell.type === "normal" || cell.type === "today") && !cell.disabled) {
2765
+ classes.push("available");
2766
+ if (cell.type === "today") {
2767
+ classes.push("today");
2768
+ }
2769
+ } else {
2770
+ classes.push(cell.type);
2771
+ }
2772
+ if (cell.type === "normal" && defaultValue.some((date2) => this.cellMatchesDate(cell, date2))) {
2773
+ classes.push("default");
2774
+ }
2775
+ if (selectionMode === "day" && (cell.type === "normal" || cell.type === "today") && this.cellMatchesDate(cell, this.value)) {
2776
+ classes.push("current");
2777
+ }
2778
+ if (cell.inRange && (cell.type === "normal" || cell.type === "today" || this.selectionMode === "week")) {
2779
+ classes.push("in-range");
2780
+ if (cell.start) {
2781
+ classes.push("start-date");
2782
+ }
2783
+ if (cell.end) {
2784
+ classes.push("end-date");
2785
+ }
2786
+ }
2787
+ if (cell.disabled) {
2788
+ classes.push("disabled");
2789
+ }
2790
+ if (cell.selected) {
2791
+ classes.push("selected");
2792
+ }
2793
+ if (cell.customClass) {
2794
+ classes.push(cell.customClass);
2795
+ }
2796
+ return classes.join(" ");
2797
+ },
2798
+ getDateOfCell(row, column) {
2799
+ const offsetFromStart = row * 7 + (column - (this.showWeekNumber ? 1 : 0)) - this.offsetDay;
2800
+ return nextDate(this.startDate, offsetFromStart);
2801
+ },
2802
+ isWeekActive(cell) {
2803
+ if (this.selectionMode !== "week")
2804
+ return false;
2805
+ const newDate = new Date(this.year, this.month, 1);
2806
+ const year = newDate.getFullYear();
2807
+ const month = newDate.getMonth();
2808
+ if (cell.type === "prev-month") {
2809
+ newDate.setMonth(month === 0 ? 11 : month - 1);
2810
+ newDate.setFullYear(month === 0 ? year - 1 : year);
2811
+ }
2812
+ if (cell.type === "next-month") {
2813
+ newDate.setMonth(month === 11 ? 0 : month + 1);
2814
+ newDate.setFullYear(month === 11 ? year + 1 : year);
2815
+ }
2816
+ newDate.setDate(parseInt(cell.text, 10));
2817
+ if (isDate(this.value)) {
2818
+ const dayOffset = (this.value.getDay() - this.firstDayOfWeek + 7) % 7 - 1;
2819
+ const weekDate = prevDate(this.value, dayOffset);
2820
+ return weekDate.getTime() === newDate.getTime();
2821
+ }
2822
+ return false;
2823
+ },
2824
+ markRange(minDate, maxDate) {
2825
+ minDate = getDateTimestamp$1(minDate);
2826
+ maxDate = getDateTimestamp$1(maxDate) || minDate;
2827
+ [minDate, maxDate] = [Math.min(minDate, maxDate), Math.max(minDate, maxDate)];
2828
+ const startDate = this.startDate;
2829
+ const rows = this.rows;
2830
+ for (let i = 0, k = rows.length; i < k; i++) {
2831
+ const row = rows[i];
2832
+ for (let j = 0, l = row.length; j < l; j++) {
2833
+ if (this.showWeekNumber && j === 0)
2834
+ continue;
2835
+ const cell = row[j];
2836
+ const index = i * 7 + j + (this.showWeekNumber ? -1 : 0);
2837
+ const time = nextDate(startDate, index - this.offsetDay).getTime();
2838
+ cell.inRange = minDate && time >= minDate && time <= maxDate;
2839
+ cell.start = minDate && time === minDate;
2840
+ cell.end = maxDate && time === maxDate;
2841
+ }
2842
+ }
2843
+ },
2844
+ handleMouseMove(event) {
2845
+ if (!this.rangeState.selecting)
2846
+ return;
2847
+ let target = event.target;
2848
+ if (target.tagName === "SPAN") {
2849
+ target = target.parentNode.parentNode;
2850
+ }
2851
+ if (target.tagName === "DIV") {
2852
+ target = target.parentNode;
2853
+ }
2854
+ if (target.tagName !== "TD")
2855
+ return;
2856
+ const row = target.parentNode.rowIndex - 1;
2857
+ const column = target.cellIndex;
2858
+ if (this.rows[row][column].disabled)
2859
+ return;
2860
+ if (row !== this.lastRow || column !== this.lastColumn) {
2861
+ this.lastRow = row;
2862
+ this.lastColumn = column;
2863
+ this.$emit("changerange", {
2864
+ minDate: this.minDate,
2865
+ maxDate: this.maxDate,
2866
+ rangeState: {
2867
+ selecting: true,
2868
+ endDate: this.getDateOfCell(row, column)
2869
+ }
2870
+ });
2871
+ }
2872
+ },
2873
+ handleClick(event) {
2874
+ let target = event.target;
2875
+ if (target.tagName === "SPAN") {
2876
+ target = target.parentNode.parentNode;
2877
+ }
2878
+ if (target.tagName === "DIV") {
2879
+ target = target.parentNode;
2880
+ }
2881
+ if (target.tagName !== "TD")
2882
+ return;
2883
+ const row = target.parentNode.rowIndex - 1;
2884
+ const column = this.selectionMode === "week" ? 1 : target.cellIndex;
2885
+ const cell = this.rows[row][column];
2886
+ if (cell.disabled || cell.type === "week")
2887
+ return;
2888
+ const newDate = this.getDateOfCell(row, column);
2889
+ if (this.selectionMode === "range") {
2890
+ if (!this.rangeState.selecting) {
2891
+ this.$emit("pick", {
2892
+ minDate: newDate,
2893
+ maxDate: null
2894
+ });
2895
+ this.rangeState.selecting = true;
2896
+ } else {
2897
+ if (newDate >= this.minDate) {
2898
+ this.$emit("pick", {
2899
+ minDate: this.minDate,
2900
+ maxDate: newDate
2901
+ });
2902
+ } else {
2903
+ this.$emit("pick", {
2904
+ minDate: newDate,
2905
+ maxDate: this.minDate
2906
+ });
2907
+ }
2908
+ this.rangeState.selecting = false;
2909
+ }
2910
+ } else if (this.selectionMode === "day") {
2911
+ this.$emit("pick", newDate);
2912
+ } else if (this.selectionMode === "week") {
2913
+ const weekNumber = getWeekNumber(newDate);
2914
+ const value = newDate.getFullYear() + "w" + weekNumber;
2915
+ this.$emit("pick", {
2916
+ year: newDate.getFullYear(),
2917
+ week: weekNumber,
2918
+ value,
2919
+ date: newDate
2920
+ });
2921
+ } else if (this.selectionMode === "dates") {
2922
+ const value = this.value || [];
2923
+ const newValue = cell.selected ? removeFromArray(value, (date2) => date2.getTime() === newDate.getTime()) : [...value, newDate];
2924
+ this.$emit("pick", newValue);
2925
+ }
2926
+ }
2927
+ }
2928
+ };
2929
+ var _sfc_render$3 = function render2() {
2930
+ var _vm = this, _c = _vm._self._c;
2931
+ return _c("table", {
2932
+ staticClass: "el-date-table",
2933
+ class: {
2934
+ "is-week-mode": _vm.selectionMode === "week"
2935
+ },
2936
+ attrs: {
2937
+ "cellspacing": "0",
2938
+ "cellpadding": "0"
2939
+ },
2940
+ on: {
2941
+ "click": _vm.handleClick,
2942
+ "mousemove": _vm.handleMouseMove
2943
+ }
2944
+ }, [_c("tbody", [_c("tr", [_vm.showWeekNumber ? _c("th", [_vm._v(_vm._s(_vm.t("el.datepicker.week")))]) : _vm._e(), _vm._l(_vm.WEEKS, function(week, key) {
2945
+ return _c("th", {
2946
+ key
2947
+ }, [_vm._v(_vm._s(_vm.t("el.datepicker.weeks." + week)))]);
2948
+ })], 2), _vm._l(_vm.rows, function(row, key) {
2949
+ return _c("tr", {
2950
+ key,
2951
+ staticClass: "el-date-table__row",
2952
+ class: {
2953
+ current: _vm.isWeekActive(row[1])
2954
+ }
2955
+ }, _vm._l(row, function(cell, key2) {
2956
+ return _c("td", {
2957
+ key: key2,
2958
+ class: _vm.getCellClasses(cell)
2959
+ }, [_c("div", [_c("span", [_vm._v(" " + _vm._s(cell.text) + " ")])])]);
2960
+ }), 0);
2961
+ })], 2)]);
2962
+ };
2963
+ var _sfc_staticRenderFns$3 = [];
2964
+ var __component__$3 = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(_sfc_main$3, _sfc_render$3, _sfc_staticRenderFns$3, false, null, null, null, null);
2965
+ const DateTable = __component__$3.exports;
2966
+ const getDateTimestamp = function(time) {
2967
+ if (typeof time === "number" || typeof time === "string") {
2968
+ return clearTime(new Date(time)).getTime();
2969
+ } else if (time instanceof Date) {
2970
+ return clearTime(time).getTime();
2971
+ } else {
2972
+ return NaN;
2973
+ }
2974
+ };
2975
+ const _sfc_main$2 = {
2976
+ mixins: [DateTable],
2977
+ computed: {
2978
+ minDateTimestamp() {
2979
+ return getDateTimestamp(this.minDate);
2980
+ },
2981
+ maxDateTimestamp() {
2982
+ return getDateTimestamp(this.maxDate);
2983
+ },
2984
+ rows() {
2985
+ const date2 = new Date(this.year, this.month, 1);
2986
+ let day = getFirstDayOfMonth(date2);
2987
+ const dateCountOfMonth = getDayCountOfMonth(date2.getFullYear(), date2.getMonth());
2988
+ const dateCountOfLastMonth = getDayCountOfMonth(date2.getFullYear(), date2.getMonth() === 0 ? 11 : date2.getMonth() - 1);
2989
+ day = day === 0 ? 7 : day;
2990
+ const offset = this.offsetDay;
2991
+ const rows = this.tableRows;
2992
+ let count = 1;
2993
+ const startDate = this.startDate;
2994
+ const disabledDate = this.disabledDate;
2995
+ const cellClassName = this.cellClassName;
2996
+ const selectedDate = [];
2997
+ const now = getDateTimestamp(/* @__PURE__ */ new Date());
2998
+ for (let i = 0; i < 6; i++) {
2999
+ const row = rows[i];
3000
+ if (this.showWeekNumber) {
3001
+ if (!row[0]) {
3002
+ row[0] = {
3003
+ type: "week",
3004
+ text: getWeekNumber(nextDate(startDate, i * 7 + 1))
3005
+ };
3006
+ }
3007
+ }
3008
+ for (let j = 0; j < 7; j++) {
3009
+ let cell = row[this.showWeekNumber ? j + 1 : j];
3010
+ if (!cell) {
3011
+ cell = {
3012
+ row: i,
3013
+ column: j,
3014
+ type: "normal",
3015
+ inRange: false,
3016
+ start: false,
3017
+ end: false
3018
+ };
3019
+ }
3020
+ cell.type = "normal";
3021
+ const index = i * 7 + j;
3022
+ const time = nextDate(startDate, index - offset).getTime();
3023
+ cell.inRange = time >= this.minDateTimestamp && time <= this.maxDateTimestamp;
3024
+ cell.start = this.minDate && time === this.minDateTimestamp;
3025
+ cell.end = this.maxDate && time === this.maxDateTimestamp;
3026
+ const isToday = time === now;
3027
+ if (isToday) {
3028
+ cell.type = "today";
3029
+ }
3030
+ if (i >= 0 && i <= 1) {
3031
+ const numberOfDaysFromPreviousMonth = day + offset < 0 ? 7 + day + offset : day + offset;
3032
+ if (j + i * 7 >= numberOfDaysFromPreviousMonth) {
3033
+ cell.text = count++;
3034
+ } else {
3035
+ cell.text = dateCountOfLastMonth - (numberOfDaysFromPreviousMonth - j % 7) + 1 + i * 7;
3036
+ cell.type = "prev-month";
3037
+ }
3038
+ } else {
3039
+ if (count <= dateCountOfMonth) {
3040
+ cell.text = count++;
3041
+ } else {
3042
+ cell.text = count++ - dateCountOfMonth;
3043
+ cell.type = "next-month";
3044
+ }
3045
+ }
3046
+ const cellDate = new Date(time);
3047
+ cell.disabled = typeof disabledDate === "function" && disabledDate(cellDate);
3048
+ cell.selected = arrayFind(selectedDate, (date3) => date3.getTime() === cellDate.getTime());
3049
+ cell.customClass = typeof cellClassName === "function" && cellClassName(cellDate);
3050
+ this.$set(row, this.showWeekNumber ? j + 1 : j, cell);
3051
+ }
3052
+ }
3053
+ return rows;
3054
+ }
3055
+ },
3056
+ methods: {
3057
+ getCellClasses(cell) {
3058
+ const defaultValue = this.defaultValue ? Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue] : [];
3059
+ const classes = [];
3060
+ if ((cell.type === "normal" || cell.type === "today") && !cell.disabled) {
3061
+ classes.push("available");
3062
+ if (cell.type === "today") {
3063
+ classes.push("today");
3064
+ }
3065
+ } else {
3066
+ classes.push(cell.type);
3067
+ }
3068
+ if (cell.type === "normal" && defaultValue.some((date2) => this.cellMatchesDate(cell, date2))) {
3069
+ classes.push("default");
3070
+ }
3071
+ if (cell.inRange && (cell.type === "normal" || cell.type === "today")) {
3072
+ if (isDate(this.minDate) && isDate(this.maxDate) || this.rangeState.selecting) {
3073
+ classes.push("in-range");
3074
+ }
3075
+ if (cell.start) {
3076
+ classes.push("start-date");
3077
+ } else if (cell.end) {
3078
+ classes.push("end-date");
3079
+ }
3080
+ }
3081
+ if (cell.disabled) {
3082
+ classes.push("disabled");
3083
+ }
3084
+ if (cell.selected) {
3085
+ classes.push("selected");
3086
+ }
3087
+ if (cell.customClass) {
3088
+ classes.push(cell.customClass);
3089
+ }
3090
+ return classes.join(" ");
3091
+ },
3092
+ isWeekActive(cell) {
3093
+ const newDate = new Date(this.year, this.month, 1);
3094
+ const year = newDate.getFullYear();
3095
+ const month = newDate.getMonth();
3096
+ if (cell.type === "prev-month") {
3097
+ newDate.setMonth(month === 0 ? 11 : month - 1);
3098
+ newDate.setFullYear(month === 0 ? year - 1 : year);
3099
+ }
3100
+ if (cell.type === "next-month") {
3101
+ newDate.setMonth(month === 11 ? 0 : month + 1);
3102
+ newDate.setFullYear(month === 11 ? year + 1 : year);
3103
+ }
3104
+ newDate.setDate(parseInt(cell.text, 10));
3105
+ if (isDate(this.value)) {
3106
+ const dayOffset = (this.value.getDay() - this.firstDayOfWeek + 7) % 7 - 1;
3107
+ const weekDate = prevDate(this.value, dayOffset);
3108
+ return weekDate.getTime() === newDate.getTime();
3109
+ }
3110
+ return false;
3111
+ },
3112
+ handleMouseMove(event, isManual) {
3113
+ var _a, _b;
3114
+ if (!this.rangeState.selecting)
3115
+ return;
3116
+ let target = event.target;
3117
+ if (target.tagName === "SPAN") {
3118
+ target = target.parentNode.parentNode;
3119
+ }
3120
+ if (target.tagName === "DIV") {
3121
+ target = target.parentNode;
3122
+ }
3123
+ if (target.tagName !== "TD")
3124
+ return;
3125
+ const row = target.parentNode.rowIndex - 1;
3126
+ const isMinGreatMax = +new Date(this.rangeState.startDate) >= +new Date(this.getDateOfCell(row, 6));
3127
+ let column = isMinGreatMax ? 0 : 6;
3128
+ const findIndex = this.rows[row].findIndex((item) => !item.disabled);
3129
+ const isExistDis = this.rows[row].some((item) => item.disabled);
3130
+ if (isExistDis && findIndex >= 0) {
3131
+ column = findIndex;
3132
+ }
3133
+ if (this.rows[row][column].disabled)
3134
+ return;
3135
+ if (row !== this.lastRow || column !== this.lastColumn) {
3136
+ const minDateList = this.rangeState.minDateList;
3137
+ const endDate = this.getDateOfCell(row, column);
3138
+ if (!isManual) {
3139
+ if (isMinGreatMax && !this.isMinGreatMax && minDateList.length === 2 || ((_a = this.minDate) == null ? void 0 : _a.getTime()) > (endDate == null ? void 0 : endDate.getTime())) {
3140
+ this.$emit("pick", {
3141
+ minDate: minDateList[1],
3142
+ maxDate: null
3143
+ });
3144
+ this.isMinGreatMax = true;
3145
+ } else if (this.isMinGreatMax && !isMinGreatMax || ((_b = this.minDate) == null ? void 0 : _b.getTime()) < (endDate == null ? void 0 : endDate.getTime())) {
3146
+ this.$emit("pick", {
3147
+ minDate: minDateList[0],
3148
+ maxDate: null
3149
+ });
3150
+ this.isMinGreatMax = false;
3151
+ }
3152
+ }
3153
+ this.$nextTick(() => {
3154
+ this.$emit("changerange", {
3155
+ minDate: this.minDate,
3156
+ maxDate: this.maxDate,
3157
+ rangeState: {
3158
+ selecting: true,
3159
+ endDate,
3160
+ startDate: this.rangeState.startDate,
3161
+ minDateList: this.rangeState.minDateList
3162
+ }
3163
+ });
3164
+ this.lastRow = row;
3165
+ this.lastColumn = target.cellIndex;
3166
+ });
3167
+ }
3168
+ },
3169
+ handleClick(event) {
3170
+ let target = event.target;
3171
+ if (target.tagName === "SPAN") {
3172
+ target = target.parentNode.parentNode;
3173
+ }
3174
+ if (target.tagName === "DIV") {
3175
+ target = target.parentNode;
3176
+ }
3177
+ if (target.tagName !== "TD")
3178
+ return;
3179
+ const row = target.parentNode.rowIndex - 1;
3180
+ let column = this.rangeState.selecting ? 6 : 0;
3181
+ const findIndex = this.rows[row].findIndex((item) => !item.disabled);
3182
+ const isExistDis = this.rows[row].some((item) => item.disabled);
3183
+ if (this.rangeState.startDate && this.rangeState.selecting) {
3184
+ column = +new Date(this.rangeState.startDate) >= +new Date(this.getDateOfCell(row, 6)) ? 0 : 6;
3185
+ }
3186
+ if (isExistDis && findIndex >= 0) {
3187
+ column = findIndex;
3188
+ }
3189
+ const cell = this.rows[row][column];
3190
+ if (cell.disabled || cell.type === "week")
3191
+ return;
3192
+ const newDate = this.getDateOfCell(row, column);
3193
+ if (!this.rangeState.selecting) {
3194
+ this.rangeState.startDate = newDate;
3195
+ this.rangeState.minDateList = [this.getDateOfCell(row, 0), this.getDateOfCell(row, 6)];
3196
+ this.$emit("pick", {
3197
+ minDate: newDate,
3198
+ maxDate: null
3199
+ });
3200
+ this.rangeState.selecting = true;
3201
+ this.$nextTick(() => {
3202
+ this.handleMouseMove({
3203
+ target: {
3204
+ tagName: "TD",
3205
+ parentNode: {
3206
+ rowIndex: row + 1,
3207
+ cellIndex: column
3208
+ }
3209
+ }
3210
+ }, true);
3211
+ });
3212
+ } else {
3213
+ if (newDate >= this.minDate) {
3214
+ this.$emit("pick", {
3215
+ minDate: this.minDate,
3216
+ maxDate: newDate
3217
+ });
3218
+ } else {
3219
+ this.$emit("pick", {
3220
+ minDate: newDate,
3221
+ maxDate: this.minDate
3222
+ });
3223
+ }
3224
+ this.rangeState.selecting = false;
3225
+ }
3226
+ this.handleMouseMove(event);
3227
+ }
3228
+ }
3229
+ };
3230
+ const _sfc_render$2 = null;
3231
+ const _sfc_staticRenderFns$2 = null;
3232
+ var __component__$2 = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(_sfc_main$2, _sfc_render$2, _sfc_staticRenderFns$2, false, null, null, null, null);
3233
+ const WeekTable = __component__$2.exports;
3234
+ const calcDefaultValue = (defaultValue) => {
3235
+ if (Array.isArray(defaultValue)) {
3236
+ return [new Date(defaultValue[0]), new Date(defaultValue[1])];
3237
+ } else if (defaultValue) {
3238
+ return [new Date(defaultValue), nextDate(new Date(defaultValue), 1)];
3239
+ } else {
3240
+ return [/* @__PURE__ */ new Date(), nextDate(/* @__PURE__ */ new Date(), 1)];
3241
+ }
3242
+ };
3243
+ const _sfc_main$1 = {
3244
+ directives: {
3245
+ Clickoutside
3246
+ },
3247
+ components: {
3248
+ WeekTable
3249
+ },
3250
+ mixins: [Locale],
3251
+ data() {
3252
+ return {
3253
+ popperClass: "",
3254
+ value: [],
3255
+ defaultValue: null,
3256
+ defaultTime: null,
3257
+ minDate: "",
3258
+ maxDate: "",
3259
+ leftDate: /* @__PURE__ */ new Date(),
3260
+ rightDate: nextMonth(/* @__PURE__ */ new Date()),
3261
+ rangeState: {
3262
+ endDate: null,
3263
+ selecting: false,
3264
+ row: null,
3265
+ column: null
3266
+ },
3267
+ shortcuts: "",
3268
+ visible: "",
3269
+ disabledDate: "",
3270
+ cellClassName: "",
3271
+ firstDayOfWeek: 7,
3272
+ format: "",
3273
+ arrowControl: false,
3274
+ unlinkPanels: false,
3275
+ dateUserInput: {
3276
+ min: null,
3277
+ max: null
3278
+ },
3279
+ timeUserInput: {
3280
+ min: null,
3281
+ max: null
3282
+ }
3283
+ };
3284
+ },
3285
+ computed: {
3286
+ leftLabel() {
3287
+ return this.leftDate.getFullYear() + " " + this.t("el.datepicker.year") + " " + this.t(`el.datepicker.month${this.leftDate.getMonth() + 1}`);
3288
+ },
3289
+ rightLabel() {
3290
+ return this.rightDate.getFullYear() + " " + this.t("el.datepicker.year") + " " + this.t(`el.datepicker.month${this.rightDate.getMonth() + 1}`);
3291
+ },
3292
+ leftYear() {
3293
+ return this.leftDate.getFullYear();
3294
+ },
3295
+ leftMonth() {
3296
+ return this.leftDate.getMonth();
3297
+ },
3298
+ rightYear() {
3299
+ return this.rightDate.getFullYear();
3300
+ },
3301
+ rightMonth() {
3302
+ return this.rightDate.getMonth();
3303
+ },
3304
+ enableMonthArrow() {
3305
+ const nextMonth2 = (this.leftMonth + 1) % 12;
3306
+ const yearOffset = this.leftMonth + 1 >= 12 ? 1 : 0;
3307
+ return this.unlinkPanels && new Date(this.leftYear + yearOffset, nextMonth2) < new Date(this.rightYear, this.rightMonth);
3308
+ },
3309
+ enableYearArrow() {
3310
+ return this.unlinkPanels && this.rightYear * 12 + this.rightMonth - (this.leftYear * 12 + this.leftMonth + 1) >= 12;
3311
+ }
3312
+ },
3313
+ watch: {
3314
+ minDate() {
3315
+ this.dateUserInput.min = null;
3316
+ this.timeUserInput.min = null;
3317
+ this.$nextTick(() => {
3318
+ if (this.$refs.maxTimePicker && this.maxDate && this.maxDate < this.minDate) {
3319
+ const format2 = "HH:mm:ss";
3320
+ this.$refs.maxTimePicker.selectableRange = [[parseDate(formatDate(this.minDate, format2), format2), parseDate("23:59:59", format2)]];
3321
+ }
3322
+ });
3323
+ },
3324
+ maxDate(val) {
3325
+ this.dateUserInput.max = null;
3326
+ this.timeUserInput.max = null;
3327
+ if (val && this.$refs.maxTimePicker) {
3328
+ this.$refs.maxTimePicker.date = val;
3329
+ this.$refs.maxTimePicker.value = val;
3330
+ }
3331
+ },
3332
+ value(newVal) {
3333
+ if (!newVal) {
3334
+ this.minDate = null;
3335
+ this.maxDate = null;
3336
+ } else if (Array.isArray(newVal)) {
3337
+ if ((newVal == null ? void 0 : newVal.length) < 2) {
3338
+ return;
3339
+ }
3340
+ this.minDate = isDate(newVal[0]) ? new Date(newVal[0]) : null;
3341
+ this.maxDate = isDate(newVal[1]) ? new Date(newVal[1]) : null;
3342
+ if (this.minDate && this.maxDate) {
3343
+ if (this.minDate.getTime() > this.maxDate.getTime()) {
3344
+ const maxDate = this.minDate;
3345
+ this.minDate = this.maxDate;
3346
+ this.maxDate = maxDate;
3347
+ }
3348
+ const prevWeekDay = Math.abs(7 - this.firstDayOfWeek + this.minDate.getDay()) % 7;
3349
+ this.minDate = new Date(this.minDate.getTime() - prevWeekDay * 60 * 60 * 24 * 1e3);
3350
+ const nextWeekDay = Math.abs(this.firstDayOfWeek - 1 - this.maxDate.getDay()) % 7;
3351
+ this.maxDate = new Date(this.maxDate.getTime() + nextWeekDay * 60 * 60 * 24 * 1e3);
3352
+ }
3353
+ this.handleMinMaxDateWeek();
3354
+ if (this.minDate) {
3355
+ this.leftDate = this.minDate;
3356
+ if (this.unlinkPanels && this.maxDate) {
3357
+ const minDateYear = this.minDate.getFullYear();
3358
+ const minDateMonth = this.minDate.getMonth();
3359
+ const maxDateYear = this.maxDate.getFullYear();
3360
+ const maxDateMonth = this.maxDate.getMonth();
3361
+ this.rightDate = minDateYear === maxDateYear && minDateMonth === maxDateMonth ? nextMonth(this.maxDate) : this.maxDate;
3362
+ } else {
3363
+ this.rightDate = nextMonth(this.leftDate);
3364
+ }
3365
+ } else {
3366
+ this.leftDate = calcDefaultValue(this.defaultValue)[0];
3367
+ this.rightDate = nextMonth(this.leftDate);
3368
+ }
3369
+ }
3370
+ },
3371
+ defaultValue(val) {
3372
+ if (!Array.isArray(this.value)) {
3373
+ const [left, right] = calcDefaultValue(val);
3374
+ this.leftDate = left;
3375
+ this.rightDate = val && val[1] && this.unlinkPanels ? right : nextMonth(this.leftDate);
3376
+ }
3377
+ }
3378
+ },
3379
+ methods: {
3380
+ handleMinMaxDateWeek() {
3381
+ if (this.minDate && this.maxDate) {
3382
+ if (this.minDate.getTime() > this.maxDate.getTime()) {
3383
+ const maxDate = this.minDate;
3384
+ this.minDate = this.maxDate;
3385
+ this.maxDate = maxDate;
3386
+ }
3387
+ const prevWeekDay = Math.abs(7 - this.firstDayOfWeek + this.minDate.getDay()) % 7;
3388
+ this.minDate = new Date(this.minDate.getTime() - prevWeekDay * 60 * 60 * 24 * 1e3);
3389
+ const nextWeekDay = Math.abs(this.firstDayOfWeek - 1 - this.maxDate.getDay()) % 7;
3390
+ this.maxDate = new Date(this.maxDate.getTime() + nextWeekDay * 60 * 60 * 24 * 1e3);
3391
+ }
3392
+ },
3393
+ handleChangeRange(val) {
3394
+ this.minDate = val.minDate;
3395
+ this.maxDate = val.maxDate;
3396
+ this.rangeState = val.rangeState;
3397
+ },
3398
+ handleRangePick(val, close = true) {
3399
+ const defaultTime = this.defaultTime || [];
3400
+ const minDate = modifyWithTimeString(val.minDate, defaultTime[0]);
3401
+ const maxDate = modifyWithTimeString(val.maxDate, defaultTime[1]);
3402
+ if (this.maxDate === maxDate && this.minDate === minDate) {
3403
+ return;
3404
+ }
3405
+ this.onPick && this.onPick(val);
3406
+ this.maxDate = maxDate;
3407
+ this.minDate = minDate;
3408
+ let timer = setTimeout(() => {
3409
+ this.maxDate = maxDate;
3410
+ this.minDate = minDate;
3411
+ clearTimeout(timer);
3412
+ timer = null;
3413
+ }, 10);
3414
+ if (!close)
3415
+ return;
3416
+ this.handleConfirm();
3417
+ },
3418
+ handleShortcutClick(shortcut) {
3419
+ if (shortcut.onClick) {
3420
+ shortcut.onClick(this);
3421
+ }
3422
+ },
3423
+ // leftPrev*, rightNext* need to take care of `unlinkPanels`
3424
+ leftPrevYear() {
3425
+ this.leftDate = prevYear(this.leftDate);
3426
+ if (!this.unlinkPanels) {
3427
+ this.rightDate = nextMonth(this.leftDate);
3428
+ }
3429
+ },
3430
+ leftPrevMonth() {
3431
+ this.leftDate = prevMonth(this.leftDate);
3432
+ if (!this.unlinkPanels) {
3433
+ this.rightDate = nextMonth(this.leftDate);
3434
+ }
3435
+ },
3436
+ rightNextYear() {
3437
+ if (!this.unlinkPanels) {
3438
+ this.leftDate = nextYear(this.leftDate);
3439
+ this.rightDate = nextMonth(this.leftDate);
3440
+ } else {
3441
+ this.rightDate = nextYear(this.rightDate);
3442
+ }
3443
+ },
3444
+ rightNextMonth() {
3445
+ if (!this.unlinkPanels) {
3446
+ this.leftDate = nextMonth(this.leftDate);
3447
+ this.rightDate = nextMonth(this.leftDate);
3448
+ } else {
3449
+ this.rightDate = nextMonth(this.rightDate);
3450
+ }
3451
+ },
3452
+ // leftNext*, rightPrev* are called when `unlinkPanels` is true
3453
+ leftNextYear() {
3454
+ this.leftDate = nextYear(this.leftDate);
3455
+ },
3456
+ leftNextMonth() {
3457
+ this.leftDate = nextMonth(this.leftDate);
3458
+ },
3459
+ rightPrevYear() {
3460
+ this.rightDate = prevYear(this.rightDate);
3461
+ },
3462
+ rightPrevMonth() {
3463
+ this.rightDate = prevMonth(this.rightDate);
3464
+ },
3465
+ handleConfirm(visible = false) {
3466
+ if (this.isValidValue([this.minDate, this.maxDate])) {
3467
+ this.$emit("pick", [this.minDate, this.maxDate], visible);
3468
+ }
3469
+ },
3470
+ isValidValue(value) {
3471
+ 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);
3472
+ },
3473
+ resetView() {
3474
+ if (this.minDate && this.maxDate == null)
3475
+ this.rangeState.selecting = false;
3476
+ this.minDate = this.value && isDate(this.value[0]) ? new Date(this.value[0]) : null;
3477
+ this.maxDate = this.value && isDate(this.value[0]) ? new Date(this.value[1]) : null;
3478
+ this.handleMinMaxDateWeek();
3479
+ }
3480
+ }
3481
+ };
3482
+ var _sfc_render$1 = function render3() {
3483
+ var _vm = this, _c = _vm._self._c;
3484
+ return _c("transition", {
3485
+ attrs: {
3486
+ "name": "el-zoom-in-top"
3487
+ },
3488
+ on: {
3489
+ "after-leave": function($event) {
3490
+ return _vm.$emit("dodestroy");
3491
+ }
3492
+ }
3493
+ }, [_c("div", {
3494
+ directives: [{
3495
+ name: "show",
3496
+ rawName: "v-show",
3497
+ value: _vm.visible,
3498
+ expression: "visible"
3499
+ }],
3500
+ staticClass: "el-picker-panel el-date-range-picker el-popper nf-double-week nf-double-week-week-range",
3501
+ class: [{
3502
+ "has-sidebar": _vm.$slots.sidebar || _vm.shortcuts
3503
+ }, _vm.popperClass]
3504
+ }, [_c("div", {
3505
+ staticClass: "el-picker-panel__body-wrapper"
3506
+ }, [_vm._t("sidebar"), _vm.shortcuts ? _c("div", {
3507
+ staticClass: "el-picker-panel__sidebar"
3508
+ }, _vm._l(_vm.shortcuts, function(shortcut, key) {
3509
+ return _c("button", {
3510
+ key,
3511
+ staticClass: "el-picker-panel__shortcut",
3512
+ attrs: {
3513
+ "type": "button"
3514
+ },
3515
+ on: {
3516
+ "click": function($event) {
3517
+ return _vm.handleShortcutClick(shortcut);
3518
+ }
3519
+ }
3520
+ }, [_vm._v(_vm._s(shortcut.text))]);
3521
+ }), 0) : _vm._e(), _c("div", {
3522
+ staticClass: "el-picker-panel__body"
3523
+ }, [_c("div", {
3524
+ staticClass: "el-picker-panel__content el-date-range-picker__content is-left"
3525
+ }, [_c("div", {
3526
+ staticClass: "el-date-range-picker__header"
3527
+ }, [_c("button", {
3528
+ staticClass: "el-picker-panel__icon-btn el-icon-d-arrow-left",
3529
+ attrs: {
3530
+ "type": "button"
3531
+ },
3532
+ on: {
3533
+ "click": _vm.leftPrevYear
3534
+ }
3535
+ }), _c("button", {
3536
+ staticClass: "el-picker-panel__icon-btn el-icon-arrow-left",
3537
+ attrs: {
3538
+ "type": "button"
3539
+ },
3540
+ on: {
3541
+ "click": _vm.leftPrevMonth
3542
+ }
3543
+ }), _vm.unlinkPanels ? _c("button", {
3544
+ staticClass: "el-picker-panel__icon-btn el-icon-d-arrow-right",
3545
+ class: {
3546
+ "is-disabled": !_vm.enableYearArrow
3547
+ },
3548
+ attrs: {
3549
+ "type": "button",
3550
+ "disabled": !_vm.enableYearArrow
3551
+ },
3552
+ on: {
3553
+ "click": _vm.leftNextYear
3554
+ }
3555
+ }) : _vm._e(), _vm.unlinkPanels ? _c("button", {
3556
+ staticClass: "el-picker-panel__icon-btn el-icon-arrow-right",
3557
+ class: {
3558
+ "is-disabled": !_vm.enableMonthArrow
3559
+ },
3560
+ attrs: {
3561
+ "type": "button",
3562
+ "disabled": !_vm.enableMonthArrow
3563
+ },
3564
+ on: {
3565
+ "click": _vm.leftNextMonth
3566
+ }
3567
+ }) : _vm._e(), _c("div", [_vm._v(_vm._s(_vm.leftLabel))])]), _c("week-table", {
3568
+ attrs: {
3569
+ "selection-mode": "weekrange",
3570
+ "date": _vm.leftDate,
3571
+ "default-value": _vm.defaultValue,
3572
+ "min-date": _vm.minDate,
3573
+ "max-date": _vm.maxDate,
3574
+ "range-state": _vm.rangeState,
3575
+ "disabled-date": _vm.disabledDate,
3576
+ "cell-class-name": _vm.cellClassName,
3577
+ "first-day-of-week": _vm.firstDayOfWeek
3578
+ },
3579
+ on: {
3580
+ "changerange": _vm.handleChangeRange,
3581
+ "pick": _vm.handleRangePick
3582
+ }
3583
+ })], 1), _c("div", {
3584
+ staticClass: "el-picker-panel__content el-date-range-picker__content is-right"
3585
+ }, [_c("div", {
3586
+ staticClass: "el-date-range-picker__header"
3587
+ }, [_vm.unlinkPanels ? _c("button", {
3588
+ staticClass: "el-picker-panel__icon-btn el-icon-d-arrow-left",
3589
+ class: {
3590
+ "is-disabled": !_vm.enableYearArrow
3591
+ },
3592
+ attrs: {
3593
+ "type": "button",
3594
+ "disabled": !_vm.enableYearArrow
3595
+ },
3596
+ on: {
3597
+ "click": _vm.rightPrevYear
3598
+ }
3599
+ }) : _vm._e(), _vm.unlinkPanels ? _c("button", {
3600
+ staticClass: "el-picker-panel__icon-btn el-icon-arrow-left",
3601
+ class: {
3602
+ "is-disabled": !_vm.enableMonthArrow
3603
+ },
3604
+ attrs: {
3605
+ "type": "button",
3606
+ "disabled": !_vm.enableMonthArrow
3607
+ },
3608
+ on: {
3609
+ "click": _vm.rightPrevMonth
3610
+ }
3611
+ }) : _vm._e(), _c("button", {
3612
+ staticClass: "el-picker-panel__icon-btn el-icon-d-arrow-right",
3613
+ attrs: {
3614
+ "type": "button"
3615
+ },
3616
+ on: {
3617
+ "click": _vm.rightNextYear
3618
+ }
3619
+ }), _c("button", {
3620
+ staticClass: "el-picker-panel__icon-btn el-icon-arrow-right",
3621
+ attrs: {
3622
+ "type": "button"
3623
+ },
3624
+ on: {
3625
+ "click": _vm.rightNextMonth
3626
+ }
3627
+ }), _c("div", [_vm._v(_vm._s(_vm.rightLabel))])]), _c("week-table", {
3628
+ attrs: {
3629
+ "selection-mode": "weekrange",
3630
+ "date": _vm.rightDate,
3631
+ "default-value": _vm.defaultValue,
3632
+ "min-date": _vm.minDate,
3633
+ "max-date": _vm.maxDate,
3634
+ "range-state": _vm.rangeState,
3635
+ "disabled-date": _vm.disabledDate,
3636
+ "cell-class-name": _vm.cellClassName,
3637
+ "first-day-of-week": _vm.firstDayOfWeek
3638
+ },
3639
+ on: {
3640
+ "changerange": _vm.handleChangeRange,
3641
+ "pick": _vm.handleRangePick
3642
+ }
3643
+ })], 1)])], 2)])]);
3644
+ };
3645
+ var _sfc_staticRenderFns$1 = [];
3646
+ var __component__$1 = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(_sfc_main$1, _sfc_render$1, _sfc_staticRenderFns$1, false, null, null, null, null);
3647
+ const WeekRangePanel = __component__$1.exports;
3648
+ const getPanel = function() {
3649
+ return WeekRangePanel;
3650
+ };
3651
+ const _sfc_main = {
3652
+ mixins: [Picker],
3653
+ name: "NfDoubleWeek",
3654
+ props: {
3655
+ timeArrowControl: Boolean
3656
+ },
3657
+ watch: {
3658
+ type(type) {
3659
+ if (this.picker) {
3660
+ this.unmountPicker();
3661
+ this.panel = getPanel();
3662
+ this.mountPicker();
3663
+ } else {
3664
+ this.panel = getPanel();
3665
+ }
3666
+ }
3667
+ },
3668
+ created() {
3669
+ this.panel = getPanel(this.type);
3670
+ }
3671
+ };
3672
+ const _sfc_render = null;
3673
+ const _sfc_staticRenderFns = null;
3674
+ var __component__ = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, null, null, null);
3675
+ const NfDoubleWeek = __component__.exports;
3676
+ NfDoubleWeek.install = (app) => {
3677
+ app.component("nf-double-week", NfDoubleWeek);
3678
+ };
3679
+ exports.default = NfDoubleWeek;