@avakhula/ui 0.1.22 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.js +23 -0
- package/dist/EventEmmiter.js +33 -0
- package/dist/chunks/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/chunks/floating-ui.dom-D8OVFdyL.js +861 -0
- package/dist/chunks/vue-quill.esm-bundler-FvTqp_xR.js +9070 -0
- package/dist/components/Accordion/Accordion.js +81 -0
- package/dist/components/Alert/Alert.js +121 -0
- package/dist/components/Alert/constants.js +10 -0
- package/dist/components/Avatar/Avatar.js +75 -0
- package/dist/components/Avatar/constants.js +12 -0
- package/dist/components/Badge/Badge.js +29 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +117 -0
- package/dist/components/Button/Button.js +140 -0
- package/dist/components/Button/constants.js +11 -0
- package/dist/components/ButtonGroup/ButtonGroup.js +14 -0
- package/dist/components/Chips/Chips.js +65 -0
- package/dist/components/Dropdown/Dropdown.js +228 -0
- package/dist/components/Dropdown/DropdownDivider.js +10 -0
- package/dist/components/Dropdown/DropdownItem.js +50 -0
- package/dist/components/Dropdown/DropdownList.js +104 -0
- package/dist/components/Dropdown/constants.js +12 -0
- package/dist/components/Form/CharactersCount.js +33 -0
- package/dist/components/Form/Checkbox/Checkbox.js +171 -0
- package/dist/components/Form/CheckboxGroup/CheckboxGroup.js +81 -0
- package/dist/components/Form/DatePicker/DatePicker.js +1782 -0
- package/dist/components/Form/DatePicker/Icons/chevron-back.js +8 -0
- package/dist/components/Form/DatePicker/Icons/chevron-forward.js +8 -0
- package/dist/components/Form/FormGroup/FormGroup.js +30 -0
- package/dist/components/Form/FormGroup/FormGroupSet.js +44 -0
- package/dist/components/Form/Input/Input.js +375 -0
- package/dist/components/Form/Input/constants.js +9 -0
- package/dist/components/Form/Label/Label.js +87 -0
- package/dist/components/Form/PhoneInput/PhoneInput.js +3811 -0
- package/dist/components/Form/Radio/Radio.js +91 -0
- package/dist/components/Form/TextEditor/TextEditor.js +422 -0
- package/dist/components/Form/TextEditor/Toolbar.js +291 -0
- package/dist/components/Form/TextEditor/icons/toolbarIcons.js +109 -0
- package/dist/components/Form/TextEditor/plugins/alphabetList.js +31 -0
- package/dist/components/Form/TextEditor/plugins/imageBlot.js +16 -0
- package/dist/components/Form/TextEditor/setupTextEditor.js +27 -0
- package/dist/components/Form/Textarea/Textarea.js +121 -0
- package/dist/components/Form/Toggle/Toggle.js +134 -0
- package/dist/components/Icon.js +37 -0
- package/dist/components/IconButton/IconButton.js +93 -0
- package/dist/components/IconButton/constants.js +15 -0
- package/dist/components/List.js +66 -0
- package/dist/components/Modal/Modal.js +198 -0
- package/dist/components/Modal/constants.js +9 -0
- package/dist/components/Pagination/LimitSelector.js +73 -0
- package/dist/components/Pagination/Pagination.js +226 -0
- package/dist/components/Panel/Panel.js +107 -0
- package/dist/components/Popover/Popover.js +105 -0
- package/dist/components/Popover/constants.js +17 -0
- package/dist/components/ProgressBar/ProgressBar.js +63 -0
- package/dist/components/ProgressBar/constants.js +10 -0
- package/dist/components/Sorting/Sorting.js +182 -0
- package/dist/components/Sorting/constants.js +12 -0
- package/dist/components/SplitButton/SplitButton.js +145 -0
- package/dist/components/SplitButton/SplitButtonItem.js +34 -0
- package/dist/components/SplitButton/constants.js +7 -0
- package/dist/components/StatusIndicator/StatusIndicator.js +29 -0
- package/dist/components/StatusIndicator/constants.js +13 -0
- package/dist/components/StatusIndicator/icons.js +44 -0
- package/dist/components/Table/Cells/Cell.js +39 -0
- package/dist/components/Table/Cells/CheckboxCell.js +37 -0
- package/dist/components/Table/Row.js +14 -0
- package/dist/components/Table/Table.js +24 -0
- package/dist/components/Tabs/Tab.js +47 -0
- package/dist/components/Tabs/TabDropdown.js +94 -0
- package/dist/components/Tabs/Tabs.js +128 -0
- package/dist/components/TagPill/TagPill.js +61 -0
- package/dist/components/TagPill/constants.js +12 -0
- package/dist/components/ToggleTip/ToggleTip.js +91 -0
- package/dist/components/ToggleTip/constants.js +17 -0
- package/dist/components/Tooltip/Tooltip.js +46 -0
- package/dist/components/TreeSelect/Option.js +302 -0
- package/dist/components/TreeSelect/Select.js +1871 -0
- package/dist/components/TreeSelect/mixins/InfinityLoaderMixin.js +32 -0
- package/dist/constants/events.js +5 -0
- package/dist/constants/keyCodes.js +12 -0
- package/dist/directives/outside/outside.js +37 -0
- package/dist/directives/tooltip/TooltipController.js +116 -0
- package/dist/directives/tooltip/textOverflowTooltip.js +23 -0
- package/dist/directives/tooltip/tooltip.js +48 -0
- package/dist/helpers/debounce.js +14 -0
- package/dist/helpers/generateUID.js +6 -0
- package/dist/helpers/getHrefFromID.js +6 -0
- package/dist/helpers/multiLineOverflows.js +6 -0
- package/dist/helpers/removeEvents.js +8 -0
- package/dist/helpers/stripHtml.js +6 -0
- package/dist/index.css +1 -1
- package/dist/index.js +103 -22665
- package/dist/main.js +10 -0
- package/dist/mixins/expandAnimation.js +24 -0
- package/package.json +7 -4
- package/src/components/Form/Textarea/Textarea.vue +8 -4
- package/.babelrc.json +0 -14
- package/.eslintrc.cjs +0 -22
- package/.nvmrc +0 -1
- package/.prettierrc.json +0 -1
- package/.storybook/intelliboardTheme.js +0 -10
- package/.storybook/main.js +0 -25
- package/.storybook/manager.js +0 -7
- package/.storybook/preview-head.html +0 -12
- package/.storybook/preview.js +0 -25
- package/.storybook/scss-loader.scss +0 -6
- package/.storybook/withSource.js +0 -97
- package/dist/index.umd.cjs +0 -238
- package/index.html +0 -21
- package/static/Logo.svg +0 -25
- package/static/docks/button.pdf +0 -147566
- package/static/favicon.ico +0 -0
- package/vite.config.js +0 -47
|
@@ -0,0 +1,1782 @@
|
|
|
1
|
+
import jn from "../../Icon.js";
|
|
2
|
+
import Rn from "../Label/Label.js";
|
|
3
|
+
import Vn from "../../Alert/Alert.js";
|
|
4
|
+
import { g as Wn } from "../../../chunks/_commonjsHelpers-DaMA6jEr.js";
|
|
5
|
+
import Kn from "./Icons/chevron-back.js";
|
|
6
|
+
import Bn from "./Icons/chevron-forward.js";
|
|
7
|
+
import { BACKSPACE_KEY_CODE as qn, ESC_KEY_CODE as Jn } from "../../../constants/keyCodes.js";
|
|
8
|
+
import { resolveComponent as Ie, createElementBlock as he, openBlock as U, normalizeClass as Oe, createBlock as Fe, createCommentVNode as ee, createElementVNode as W, withCtx as Ae, createTextVNode as Ne, toDisplayString as oe, createVNode as en } from "vue";
|
|
9
|
+
import { _ as Un } from "../../../chunks/_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
|
+
var Pe = [
|
|
11
|
+
"onChange",
|
|
12
|
+
"onClose",
|
|
13
|
+
"onDayCreate",
|
|
14
|
+
"onDestroy",
|
|
15
|
+
"onKeyDown",
|
|
16
|
+
"onMonthChange",
|
|
17
|
+
"onOpen",
|
|
18
|
+
"onParseConfig",
|
|
19
|
+
"onReady",
|
|
20
|
+
"onValueUpdate",
|
|
21
|
+
"onYearChange",
|
|
22
|
+
"onPreCalendarPosition"
|
|
23
|
+
], ne = {
|
|
24
|
+
_disable: [],
|
|
25
|
+
allowInput: !1,
|
|
26
|
+
allowInvalidPreload: !1,
|
|
27
|
+
altFormat: "F j, Y",
|
|
28
|
+
altInput: !1,
|
|
29
|
+
altInputClass: "form-control input",
|
|
30
|
+
animate: typeof window == "object" && window.navigator.userAgent.indexOf("MSIE") === -1,
|
|
31
|
+
ariaDateFormat: "F j, Y",
|
|
32
|
+
autoFillDefaultTime: !0,
|
|
33
|
+
clickOpens: !0,
|
|
34
|
+
closeOnSelect: !0,
|
|
35
|
+
conjunction: ", ",
|
|
36
|
+
dateFormat: "Y-m-d",
|
|
37
|
+
defaultHour: 12,
|
|
38
|
+
defaultMinute: 0,
|
|
39
|
+
defaultSeconds: 0,
|
|
40
|
+
disable: [],
|
|
41
|
+
disableMobile: !1,
|
|
42
|
+
enableSeconds: !1,
|
|
43
|
+
enableTime: !1,
|
|
44
|
+
errorHandler: function(a) {
|
|
45
|
+
return typeof console < "u" && console.warn(a);
|
|
46
|
+
},
|
|
47
|
+
getWeek: function(a) {
|
|
48
|
+
var r = new Date(a.getTime());
|
|
49
|
+
r.setHours(0, 0, 0, 0), r.setDate(r.getDate() + 3 - (r.getDay() + 6) % 7);
|
|
50
|
+
var e = new Date(r.getFullYear(), 0, 4);
|
|
51
|
+
return 1 + Math.round(((r.getTime() - e.getTime()) / 864e5 - 3 + (e.getDay() + 6) % 7) / 7);
|
|
52
|
+
},
|
|
53
|
+
hourIncrement: 1,
|
|
54
|
+
ignoredFocusElements: [],
|
|
55
|
+
inline: !1,
|
|
56
|
+
locale: "default",
|
|
57
|
+
minuteIncrement: 5,
|
|
58
|
+
mode: "single",
|
|
59
|
+
monthSelectorType: "dropdown",
|
|
60
|
+
nextArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",
|
|
61
|
+
noCalendar: !1,
|
|
62
|
+
now: /* @__PURE__ */ new Date(),
|
|
63
|
+
onChange: [],
|
|
64
|
+
onClose: [],
|
|
65
|
+
onDayCreate: [],
|
|
66
|
+
onDestroy: [],
|
|
67
|
+
onKeyDown: [],
|
|
68
|
+
onMonthChange: [],
|
|
69
|
+
onOpen: [],
|
|
70
|
+
onParseConfig: [],
|
|
71
|
+
onReady: [],
|
|
72
|
+
onValueUpdate: [],
|
|
73
|
+
onYearChange: [],
|
|
74
|
+
onPreCalendarPosition: [],
|
|
75
|
+
plugins: [],
|
|
76
|
+
position: "auto",
|
|
77
|
+
positionElement: void 0,
|
|
78
|
+
prevArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",
|
|
79
|
+
shorthandCurrentMonth: !1,
|
|
80
|
+
showMonths: 1,
|
|
81
|
+
static: !1,
|
|
82
|
+
time_24hr: !1,
|
|
83
|
+
weekNumbers: !1,
|
|
84
|
+
wrap: !1
|
|
85
|
+
}, ue = {
|
|
86
|
+
weekdays: {
|
|
87
|
+
shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
88
|
+
longhand: [
|
|
89
|
+
"Sunday",
|
|
90
|
+
"Monday",
|
|
91
|
+
"Tuesday",
|
|
92
|
+
"Wednesday",
|
|
93
|
+
"Thursday",
|
|
94
|
+
"Friday",
|
|
95
|
+
"Saturday"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
months: {
|
|
99
|
+
shorthand: [
|
|
100
|
+
"Jan",
|
|
101
|
+
"Feb",
|
|
102
|
+
"Mar",
|
|
103
|
+
"Apr",
|
|
104
|
+
"May",
|
|
105
|
+
"Jun",
|
|
106
|
+
"Jul",
|
|
107
|
+
"Aug",
|
|
108
|
+
"Sep",
|
|
109
|
+
"Oct",
|
|
110
|
+
"Nov",
|
|
111
|
+
"Dec"
|
|
112
|
+
],
|
|
113
|
+
longhand: [
|
|
114
|
+
"January",
|
|
115
|
+
"February",
|
|
116
|
+
"March",
|
|
117
|
+
"April",
|
|
118
|
+
"May",
|
|
119
|
+
"June",
|
|
120
|
+
"July",
|
|
121
|
+
"August",
|
|
122
|
+
"September",
|
|
123
|
+
"October",
|
|
124
|
+
"November",
|
|
125
|
+
"December"
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
|
|
129
|
+
firstDayOfWeek: 0,
|
|
130
|
+
ordinal: function(a) {
|
|
131
|
+
var r = a % 100;
|
|
132
|
+
if (r > 3 && r < 21)
|
|
133
|
+
return "th";
|
|
134
|
+
switch (r % 10) {
|
|
135
|
+
case 1:
|
|
136
|
+
return "st";
|
|
137
|
+
case 2:
|
|
138
|
+
return "nd";
|
|
139
|
+
case 3:
|
|
140
|
+
return "rd";
|
|
141
|
+
default:
|
|
142
|
+
return "th";
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
rangeSeparator: " to ",
|
|
146
|
+
weekAbbreviation: "Wk",
|
|
147
|
+
scrollTitle: "Scroll to increment",
|
|
148
|
+
toggleTitle: "Click to toggle",
|
|
149
|
+
amPM: ["AM", "PM"],
|
|
150
|
+
yearAriaLabel: "Year",
|
|
151
|
+
monthAriaLabel: "Month",
|
|
152
|
+
hourAriaLabel: "Hour",
|
|
153
|
+
minuteAriaLabel: "Minute",
|
|
154
|
+
time_24hr: !1
|
|
155
|
+
}, F = function(a, r) {
|
|
156
|
+
return r === void 0 && (r = 2), ("000" + a).slice(r * -1);
|
|
157
|
+
}, H = function(a) {
|
|
158
|
+
return a === !0 ? 1 : 0;
|
|
159
|
+
};
|
|
160
|
+
function nn(a, r) {
|
|
161
|
+
var e;
|
|
162
|
+
return function() {
|
|
163
|
+
var p = this, m = arguments;
|
|
164
|
+
clearTimeout(e), e = setTimeout(function() {
|
|
165
|
+
return a.apply(p, m);
|
|
166
|
+
}, r);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
var Ye = function(a) {
|
|
170
|
+
return a instanceof Array ? a : [a];
|
|
171
|
+
};
|
|
172
|
+
function O(a, r, e) {
|
|
173
|
+
if (e === !0)
|
|
174
|
+
return a.classList.add(r);
|
|
175
|
+
a.classList.remove(r);
|
|
176
|
+
}
|
|
177
|
+
function y(a, r, e) {
|
|
178
|
+
var p = window.document.createElement(a);
|
|
179
|
+
return r = r || "", e = e || "", p.className = r, e !== void 0 && (p.textContent = e), p;
|
|
180
|
+
}
|
|
181
|
+
function ve(a) {
|
|
182
|
+
for (; a.firstChild; )
|
|
183
|
+
a.removeChild(a.firstChild);
|
|
184
|
+
}
|
|
185
|
+
function rn(a, r) {
|
|
186
|
+
if (r(a))
|
|
187
|
+
return a;
|
|
188
|
+
if (a.parentNode)
|
|
189
|
+
return rn(a.parentNode, r);
|
|
190
|
+
}
|
|
191
|
+
function De(a, r) {
|
|
192
|
+
var e = y("div", "numInputWrapper"), p = y("input", "numInput " + a), m = y("span", "arrowUp"), l = y("span", "arrowDown");
|
|
193
|
+
if (navigator.userAgent.indexOf("MSIE 9.0") === -1 ? p.type = "number" : (p.type = "text", p.pattern = "\\d*"), r !== void 0)
|
|
194
|
+
for (var D in r)
|
|
195
|
+
p.setAttribute(D, r[D]);
|
|
196
|
+
return e.appendChild(p), e.appendChild(m), e.appendChild(l), e;
|
|
197
|
+
}
|
|
198
|
+
function N(a) {
|
|
199
|
+
try {
|
|
200
|
+
if (typeof a.composedPath == "function") {
|
|
201
|
+
var r = a.composedPath();
|
|
202
|
+
return r[0];
|
|
203
|
+
}
|
|
204
|
+
return a.target;
|
|
205
|
+
} catch {
|
|
206
|
+
return a.target;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
var He = function() {
|
|
210
|
+
}, ye = function(a, r, e) {
|
|
211
|
+
return e.months[r ? "shorthand" : "longhand"][a];
|
|
212
|
+
}, zn = {
|
|
213
|
+
D: He,
|
|
214
|
+
F: function(a, r, e) {
|
|
215
|
+
a.setMonth(e.months.longhand.indexOf(r));
|
|
216
|
+
},
|
|
217
|
+
G: function(a, r) {
|
|
218
|
+
a.setHours((a.getHours() >= 12 ? 12 : 0) + parseFloat(r));
|
|
219
|
+
},
|
|
220
|
+
H: function(a, r) {
|
|
221
|
+
a.setHours(parseFloat(r));
|
|
222
|
+
},
|
|
223
|
+
J: function(a, r) {
|
|
224
|
+
a.setDate(parseFloat(r));
|
|
225
|
+
},
|
|
226
|
+
K: function(a, r, e) {
|
|
227
|
+
a.setHours(a.getHours() % 12 + 12 * H(new RegExp(e.amPM[1], "i").test(r)));
|
|
228
|
+
},
|
|
229
|
+
M: function(a, r, e) {
|
|
230
|
+
a.setMonth(e.months.shorthand.indexOf(r));
|
|
231
|
+
},
|
|
232
|
+
S: function(a, r) {
|
|
233
|
+
a.setSeconds(parseFloat(r));
|
|
234
|
+
},
|
|
235
|
+
U: function(a, r) {
|
|
236
|
+
return new Date(parseFloat(r) * 1e3);
|
|
237
|
+
},
|
|
238
|
+
W: function(a, r, e) {
|
|
239
|
+
var p = parseInt(r), m = new Date(a.getFullYear(), 0, 2 + (p - 1) * 7, 0, 0, 0, 0);
|
|
240
|
+
return m.setDate(m.getDate() - m.getDay() + e.firstDayOfWeek), m;
|
|
241
|
+
},
|
|
242
|
+
Y: function(a, r) {
|
|
243
|
+
a.setFullYear(parseFloat(r));
|
|
244
|
+
},
|
|
245
|
+
Z: function(a, r) {
|
|
246
|
+
return new Date(r);
|
|
247
|
+
},
|
|
248
|
+
d: function(a, r) {
|
|
249
|
+
a.setDate(parseFloat(r));
|
|
250
|
+
},
|
|
251
|
+
h: function(a, r) {
|
|
252
|
+
a.setHours((a.getHours() >= 12 ? 12 : 0) + parseFloat(r));
|
|
253
|
+
},
|
|
254
|
+
i: function(a, r) {
|
|
255
|
+
a.setMinutes(parseFloat(r));
|
|
256
|
+
},
|
|
257
|
+
j: function(a, r) {
|
|
258
|
+
a.setDate(parseFloat(r));
|
|
259
|
+
},
|
|
260
|
+
l: He,
|
|
261
|
+
m: function(a, r) {
|
|
262
|
+
a.setMonth(parseFloat(r) - 1);
|
|
263
|
+
},
|
|
264
|
+
n: function(a, r) {
|
|
265
|
+
a.setMonth(parseFloat(r) - 1);
|
|
266
|
+
},
|
|
267
|
+
s: function(a, r) {
|
|
268
|
+
a.setSeconds(parseFloat(r));
|
|
269
|
+
},
|
|
270
|
+
u: function(a, r) {
|
|
271
|
+
return new Date(parseFloat(r));
|
|
272
|
+
},
|
|
273
|
+
w: He,
|
|
274
|
+
y: function(a, r) {
|
|
275
|
+
a.setFullYear(2e3 + parseFloat(r));
|
|
276
|
+
}
|
|
277
|
+
}, z = {
|
|
278
|
+
D: "",
|
|
279
|
+
F: "",
|
|
280
|
+
G: "(\\d\\d|\\d)",
|
|
281
|
+
H: "(\\d\\d|\\d)",
|
|
282
|
+
J: "(\\d\\d|\\d)\\w+",
|
|
283
|
+
K: "",
|
|
284
|
+
M: "",
|
|
285
|
+
S: "(\\d\\d|\\d)",
|
|
286
|
+
U: "(.+)",
|
|
287
|
+
W: "(\\d\\d|\\d)",
|
|
288
|
+
Y: "(\\d{4})",
|
|
289
|
+
Z: "(.+)",
|
|
290
|
+
d: "(\\d\\d|\\d)",
|
|
291
|
+
h: "(\\d\\d|\\d)",
|
|
292
|
+
i: "(\\d\\d|\\d)",
|
|
293
|
+
j: "(\\d\\d|\\d)",
|
|
294
|
+
l: "",
|
|
295
|
+
m: "(\\d\\d|\\d)",
|
|
296
|
+
n: "(\\d\\d|\\d)",
|
|
297
|
+
s: "(\\d\\d|\\d)",
|
|
298
|
+
u: "(.+)",
|
|
299
|
+
w: "(\\d\\d|\\d)",
|
|
300
|
+
y: "(\\d{2})"
|
|
301
|
+
}, le = {
|
|
302
|
+
Z: function(a) {
|
|
303
|
+
return a.toISOString();
|
|
304
|
+
},
|
|
305
|
+
D: function(a, r, e) {
|
|
306
|
+
return r.weekdays.shorthand[le.w(a, r, e)];
|
|
307
|
+
},
|
|
308
|
+
F: function(a, r, e) {
|
|
309
|
+
return ye(le.n(a, r, e) - 1, !1, r);
|
|
310
|
+
},
|
|
311
|
+
G: function(a, r, e) {
|
|
312
|
+
return F(le.h(a, r, e));
|
|
313
|
+
},
|
|
314
|
+
H: function(a) {
|
|
315
|
+
return F(a.getHours());
|
|
316
|
+
},
|
|
317
|
+
J: function(a, r) {
|
|
318
|
+
return r.ordinal !== void 0 ? a.getDate() + r.ordinal(a.getDate()) : a.getDate();
|
|
319
|
+
},
|
|
320
|
+
K: function(a, r) {
|
|
321
|
+
return r.amPM[H(a.getHours() > 11)];
|
|
322
|
+
},
|
|
323
|
+
M: function(a, r) {
|
|
324
|
+
return ye(a.getMonth(), !0, r);
|
|
325
|
+
},
|
|
326
|
+
S: function(a) {
|
|
327
|
+
return F(a.getSeconds());
|
|
328
|
+
},
|
|
329
|
+
U: function(a) {
|
|
330
|
+
return a.getTime() / 1e3;
|
|
331
|
+
},
|
|
332
|
+
W: function(a, r, e) {
|
|
333
|
+
return e.getWeek(a);
|
|
334
|
+
},
|
|
335
|
+
Y: function(a) {
|
|
336
|
+
return F(a.getFullYear(), 4);
|
|
337
|
+
},
|
|
338
|
+
d: function(a) {
|
|
339
|
+
return F(a.getDate());
|
|
340
|
+
},
|
|
341
|
+
h: function(a) {
|
|
342
|
+
return a.getHours() % 12 ? a.getHours() % 12 : 12;
|
|
343
|
+
},
|
|
344
|
+
i: function(a) {
|
|
345
|
+
return F(a.getMinutes());
|
|
346
|
+
},
|
|
347
|
+
j: function(a) {
|
|
348
|
+
return a.getDate();
|
|
349
|
+
},
|
|
350
|
+
l: function(a, r) {
|
|
351
|
+
return r.weekdays.longhand[a.getDay()];
|
|
352
|
+
},
|
|
353
|
+
m: function(a) {
|
|
354
|
+
return F(a.getMonth() + 1);
|
|
355
|
+
},
|
|
356
|
+
n: function(a) {
|
|
357
|
+
return a.getMonth() + 1;
|
|
358
|
+
},
|
|
359
|
+
s: function(a) {
|
|
360
|
+
return a.getSeconds();
|
|
361
|
+
},
|
|
362
|
+
u: function(a) {
|
|
363
|
+
return a.getTime();
|
|
364
|
+
},
|
|
365
|
+
w: function(a) {
|
|
366
|
+
return a.getDay();
|
|
367
|
+
},
|
|
368
|
+
y: function(a) {
|
|
369
|
+
return String(a.getFullYear()).substring(2);
|
|
370
|
+
}
|
|
371
|
+
}, on = function(a) {
|
|
372
|
+
var r = a.config, e = r === void 0 ? ne : r, p = a.l10n, m = p === void 0 ? ue : p, l = a.isMobile, D = l === void 0 ? !1 : l;
|
|
373
|
+
return function(f, w, E) {
|
|
374
|
+
var M = E || m;
|
|
375
|
+
return e.formatDate !== void 0 && !D ? e.formatDate(f, w, M) : w.split("").map(function(T, x, S) {
|
|
376
|
+
return le[T] && S[x - 1] !== "\\" ? le[T](f, M, e) : T !== "\\" ? T : "";
|
|
377
|
+
}).join("");
|
|
378
|
+
};
|
|
379
|
+
}, Ve = function(a) {
|
|
380
|
+
var r = a.config, e = r === void 0 ? ne : r, p = a.l10n, m = p === void 0 ? ue : p;
|
|
381
|
+
return function(l, D, f, w) {
|
|
382
|
+
if (!(l !== 0 && !l)) {
|
|
383
|
+
var E = w || m, M, T = l;
|
|
384
|
+
if (l instanceof Date)
|
|
385
|
+
M = new Date(l.getTime());
|
|
386
|
+
else if (typeof l != "string" && l.toFixed !== void 0)
|
|
387
|
+
M = new Date(l);
|
|
388
|
+
else if (typeof l == "string") {
|
|
389
|
+
var x = D || (e || ne).dateFormat, S = String(l).trim();
|
|
390
|
+
if (S === "today")
|
|
391
|
+
M = /* @__PURE__ */ new Date(), f = !0;
|
|
392
|
+
else if (e && e.parseDate)
|
|
393
|
+
M = e.parseDate(l, x);
|
|
394
|
+
else if (/Z$/.test(S) || /GMT$/.test(S))
|
|
395
|
+
M = new Date(l);
|
|
396
|
+
else {
|
|
397
|
+
for (var K = void 0, b = [], L = 0, Y = 0, j = ""; L < x.length; L++) {
|
|
398
|
+
var B = x[L], G = B === "\\", we = x[L - 1] === "\\" || G;
|
|
399
|
+
if (z[B] && !we) {
|
|
400
|
+
j += z[B];
|
|
401
|
+
var q = new RegExp(j).exec(l);
|
|
402
|
+
q && (K = !0) && b[B !== "Y" ? "push" : "unshift"]({
|
|
403
|
+
fn: zn[B],
|
|
404
|
+
val: q[++Y]
|
|
405
|
+
});
|
|
406
|
+
} else G || (j += ".");
|
|
407
|
+
}
|
|
408
|
+
M = !e || !e.noCalendar ? new Date((/* @__PURE__ */ new Date()).getFullYear(), 0, 1, 0, 0, 0, 0) : new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0)), b.forEach(function(Z) {
|
|
409
|
+
var Q = Z.fn, Ce = Z.val;
|
|
410
|
+
return M = Q(M, Ce, E) || M;
|
|
411
|
+
}), M = K ? M : void 0;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
if (!(M instanceof Date && !isNaN(M.getTime()))) {
|
|
415
|
+
e.errorHandler(new Error("Invalid date provided: " + T));
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
return f === !0 && M.setHours(0, 0, 0, 0), M;
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
function P(a, r, e) {
|
|
423
|
+
return e === void 0 && (e = !0), e !== !1 ? new Date(a.getTime()).setHours(0, 0, 0, 0) - new Date(r.getTime()).setHours(0, 0, 0, 0) : a.getTime() - r.getTime();
|
|
424
|
+
}
|
|
425
|
+
var Gn = function(a, r, e) {
|
|
426
|
+
return a > Math.min(r, e) && a < Math.max(r, e);
|
|
427
|
+
}, Le = function(a, r, e) {
|
|
428
|
+
return a * 3600 + r * 60 + e;
|
|
429
|
+
}, Zn = function(a) {
|
|
430
|
+
var r = Math.floor(a / 3600), e = (a - r * 3600) / 60;
|
|
431
|
+
return [r, e, a - r * 3600 - e * 60];
|
|
432
|
+
}, Qn = {
|
|
433
|
+
DAY: 864e5
|
|
434
|
+
};
|
|
435
|
+
function je(a) {
|
|
436
|
+
var r = a.defaultHour, e = a.defaultMinute, p = a.defaultSeconds;
|
|
437
|
+
if (a.minDate !== void 0) {
|
|
438
|
+
var m = a.minDate.getHours(), l = a.minDate.getMinutes(), D = a.minDate.getSeconds();
|
|
439
|
+
r < m && (r = m), r === m && e < l && (e = l), r === m && e === l && p < D && (p = a.minDate.getSeconds());
|
|
440
|
+
}
|
|
441
|
+
if (a.maxDate !== void 0) {
|
|
442
|
+
var f = a.maxDate.getHours(), w = a.maxDate.getMinutes();
|
|
443
|
+
r = Math.min(r, f), r === f && (e = Math.min(w, e)), r === f && e === w && (p = a.maxDate.getSeconds());
|
|
444
|
+
}
|
|
445
|
+
return { hours: r, minutes: e, seconds: p };
|
|
446
|
+
}
|
|
447
|
+
typeof Object.assign != "function" && (Object.assign = function(a) {
|
|
448
|
+
for (var r = [], e = 1; e < arguments.length; e++)
|
|
449
|
+
r[e - 1] = arguments[e];
|
|
450
|
+
if (!a)
|
|
451
|
+
throw TypeError("Cannot convert undefined or null to object");
|
|
452
|
+
for (var p = function(f) {
|
|
453
|
+
f && Object.keys(f).forEach(function(w) {
|
|
454
|
+
return a[w] = f[w];
|
|
455
|
+
});
|
|
456
|
+
}, m = 0, l = r; m < l.length; m++) {
|
|
457
|
+
var D = l[m];
|
|
458
|
+
p(D);
|
|
459
|
+
}
|
|
460
|
+
return a;
|
|
461
|
+
});
|
|
462
|
+
var I = function() {
|
|
463
|
+
return I = Object.assign || function(a) {
|
|
464
|
+
for (var r, e = 1, p = arguments.length; e < p; e++) {
|
|
465
|
+
r = arguments[e];
|
|
466
|
+
for (var m in r) Object.prototype.hasOwnProperty.call(r, m) && (a[m] = r[m]);
|
|
467
|
+
}
|
|
468
|
+
return a;
|
|
469
|
+
}, I.apply(this, arguments);
|
|
470
|
+
}, tn = function() {
|
|
471
|
+
for (var a = 0, r = 0, e = arguments.length; r < e; r++) a += arguments[r].length;
|
|
472
|
+
for (var p = Array(a), m = 0, r = 0; r < e; r++)
|
|
473
|
+
for (var l = arguments[r], D = 0, f = l.length; D < f; D++, m++)
|
|
474
|
+
p[m] = l[D];
|
|
475
|
+
return p;
|
|
476
|
+
}, Xn = 300;
|
|
477
|
+
function $n(a, r) {
|
|
478
|
+
var e = {
|
|
479
|
+
config: I(I({}, ne), _.defaultConfig),
|
|
480
|
+
l10n: ue
|
|
481
|
+
};
|
|
482
|
+
e.parseDate = Ve({ config: e.config, l10n: e.l10n }), e._handlers = [], e.pluginElements = [], e.loadedPlugins = [], e._bind = b, e._setHoursFromDate = x, e._positionCalendar = me, e.changeMonth = Me, e.changeYear = de, e.clear = fn, e.close = mn, e.onMouseOver = fe, e._createElement = y, e.createDay = q, e.destroy = gn, e.isEnabled = J, e.jumpToDate = j, e.updateValue = V, e.open = vn, e.redraw = Ge, e.set = wn, e.setDate = Cn, e.toggle = xn;
|
|
483
|
+
function p() {
|
|
484
|
+
e.utils = {
|
|
485
|
+
getDaysInMonth: function(n, t) {
|
|
486
|
+
return n === void 0 && (n = e.currentMonth), t === void 0 && (t = e.currentYear), n === 1 && (t % 4 === 0 && t % 100 !== 0 || t % 400 === 0) ? 29 : e.l10n.daysInMonth[n];
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
function m() {
|
|
491
|
+
e.element = e.input = a, e.isOpen = !1, Dn(), ze(), En(), Mn(), p(), e.isMobile || we(), Y(), (e.selectedDates.length || e.config.noCalendar) && (e.config.enableTime && x(e.config.noCalendar ? e.latestSelectedDateObj : void 0), V(!1)), f();
|
|
492
|
+
var n = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
493
|
+
!e.isMobile && n && me(), k("onReady");
|
|
494
|
+
}
|
|
495
|
+
function l() {
|
|
496
|
+
var n;
|
|
497
|
+
return ((n = e.calendarContainer) === null || n === void 0 ? void 0 : n.getRootNode()).activeElement || document.activeElement;
|
|
498
|
+
}
|
|
499
|
+
function D(n) {
|
|
500
|
+
return n.bind(e);
|
|
501
|
+
}
|
|
502
|
+
function f() {
|
|
503
|
+
var n = e.config;
|
|
504
|
+
n.weekNumbers === !1 && n.showMonths === 1 || n.noCalendar !== !0 && window.requestAnimationFrame(function() {
|
|
505
|
+
if (e.calendarContainer !== void 0 && (e.calendarContainer.style.visibility = "hidden", e.calendarContainer.style.display = "block"), e.daysContainer !== void 0) {
|
|
506
|
+
var t = (e.days.offsetWidth + 1) * n.showMonths;
|
|
507
|
+
e.daysContainer.style.width = t + "px", e.calendarContainer.style.width = t + (e.weekWrapper !== void 0 ? e.weekWrapper.offsetWidth : 0) + "px", e.calendarContainer.style.removeProperty("visibility"), e.calendarContainer.style.removeProperty("display");
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
function w(n) {
|
|
512
|
+
if (e.selectedDates.length === 0) {
|
|
513
|
+
var t = e.config.minDate === void 0 || P(/* @__PURE__ */ new Date(), e.config.minDate) >= 0 ? /* @__PURE__ */ new Date() : new Date(e.config.minDate.getTime()), i = je(e.config);
|
|
514
|
+
t.setHours(i.hours, i.minutes, i.seconds, t.getMilliseconds()), e.selectedDates = [t], e.latestSelectedDateObj = t;
|
|
515
|
+
}
|
|
516
|
+
n !== void 0 && n.type !== "blur" && Tn(n);
|
|
517
|
+
var o = e._input.value;
|
|
518
|
+
T(), V(), e._input.value !== o && e._debouncedChange();
|
|
519
|
+
}
|
|
520
|
+
function E(n, t) {
|
|
521
|
+
return n % 12 + 12 * H(t === e.l10n.amPM[1]);
|
|
522
|
+
}
|
|
523
|
+
function M(n) {
|
|
524
|
+
switch (n % 24) {
|
|
525
|
+
case 0:
|
|
526
|
+
case 12:
|
|
527
|
+
return 12;
|
|
528
|
+
default:
|
|
529
|
+
return n % 12;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
function T() {
|
|
533
|
+
if (!(e.hourElement === void 0 || e.minuteElement === void 0)) {
|
|
534
|
+
var n = (parseInt(e.hourElement.value.slice(-2), 10) || 0) % 24, t = (parseInt(e.minuteElement.value, 10) || 0) % 60, i = e.secondElement !== void 0 ? (parseInt(e.secondElement.value, 10) || 0) % 60 : 0;
|
|
535
|
+
e.amPM !== void 0 && (n = E(n, e.amPM.textContent));
|
|
536
|
+
var o = e.config.minTime !== void 0 || e.config.minDate && e.minDateHasTime && e.latestSelectedDateObj && P(e.latestSelectedDateObj, e.config.minDate, !0) === 0, u = e.config.maxTime !== void 0 || e.config.maxDate && e.maxDateHasTime && e.latestSelectedDateObj && P(e.latestSelectedDateObj, e.config.maxDate, !0) === 0;
|
|
537
|
+
if (e.config.maxTime !== void 0 && e.config.minTime !== void 0 && e.config.minTime > e.config.maxTime) {
|
|
538
|
+
var s = Le(e.config.minTime.getHours(), e.config.minTime.getMinutes(), e.config.minTime.getSeconds()), h = Le(e.config.maxTime.getHours(), e.config.maxTime.getMinutes(), e.config.maxTime.getSeconds()), c = Le(n, t, i);
|
|
539
|
+
if (c > h && c < s) {
|
|
540
|
+
var v = Zn(s);
|
|
541
|
+
n = v[0], t = v[1], i = v[2];
|
|
542
|
+
}
|
|
543
|
+
} else {
|
|
544
|
+
if (u) {
|
|
545
|
+
var d = e.config.maxTime !== void 0 ? e.config.maxTime : e.config.maxDate;
|
|
546
|
+
n = Math.min(n, d.getHours()), n === d.getHours() && (t = Math.min(t, d.getMinutes())), t === d.getMinutes() && (i = Math.min(i, d.getSeconds()));
|
|
547
|
+
}
|
|
548
|
+
if (o) {
|
|
549
|
+
var g = e.config.minTime !== void 0 ? e.config.minTime : e.config.minDate;
|
|
550
|
+
n = Math.max(n, g.getHours()), n === g.getHours() && t < g.getMinutes() && (t = g.getMinutes()), t === g.getMinutes() && (i = Math.max(i, g.getSeconds()));
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
S(n, t, i);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
function x(n) {
|
|
557
|
+
var t = n || e.latestSelectedDateObj;
|
|
558
|
+
t && t instanceof Date && S(t.getHours(), t.getMinutes(), t.getSeconds());
|
|
559
|
+
}
|
|
560
|
+
function S(n, t, i) {
|
|
561
|
+
e.latestSelectedDateObj !== void 0 && e.latestSelectedDateObj.setHours(n % 24, t, i || 0, 0), !(!e.hourElement || !e.minuteElement || e.isMobile) && (e.hourElement.value = F(e.config.time_24hr ? n : (12 + n) % 12 + 12 * H(n % 12 === 0)), e.minuteElement.value = F(t), e.amPM !== void 0 && (e.amPM.textContent = e.l10n.amPM[H(n >= 12)]), e.secondElement !== void 0 && (e.secondElement.value = F(i)));
|
|
562
|
+
}
|
|
563
|
+
function K(n) {
|
|
564
|
+
var t = N(n), i = parseInt(t.value) + (n.delta || 0);
|
|
565
|
+
(i / 1e3 > 1 || n.key === "Enter" && !/[^\d]/.test(i.toString())) && de(i);
|
|
566
|
+
}
|
|
567
|
+
function b(n, t, i, o) {
|
|
568
|
+
if (t instanceof Array)
|
|
569
|
+
return t.forEach(function(u) {
|
|
570
|
+
return b(n, u, i, o);
|
|
571
|
+
});
|
|
572
|
+
if (n instanceof Array)
|
|
573
|
+
return n.forEach(function(u) {
|
|
574
|
+
return b(u, t, i, o);
|
|
575
|
+
});
|
|
576
|
+
n.addEventListener(t, i, o), e._handlers.push({
|
|
577
|
+
remove: function() {
|
|
578
|
+
return n.removeEventListener(t, i, o);
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
function L() {
|
|
583
|
+
k("onChange");
|
|
584
|
+
}
|
|
585
|
+
function Y() {
|
|
586
|
+
if (e.config.wrap && ["open", "close", "toggle", "clear"].forEach(function(i) {
|
|
587
|
+
Array.prototype.forEach.call(e.element.querySelectorAll("[data-" + i + "]"), function(o) {
|
|
588
|
+
return b(o, "click", e[i]);
|
|
589
|
+
});
|
|
590
|
+
}), e.isMobile) {
|
|
591
|
+
kn();
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
var n = nn(hn, 50);
|
|
595
|
+
if (e._debouncedChange = nn(L, Xn), e.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent) && b(e.daysContainer, "mouseover", function(i) {
|
|
596
|
+
e.config.mode === "range" && fe(N(i));
|
|
597
|
+
}), b(e._input, "keydown", qe), e.calendarContainer !== void 0 && b(e.calendarContainer, "keydown", qe), !e.config.inline && !e.config.static && b(window, "resize", n), window.ontouchstart !== void 0 ? b(window.document, "touchstart", Ee) : b(window.document, "mousedown", Ee), b(window.document, "focus", Ee, { capture: !0 }), e.config.clickOpens === !0 && (b(e._input, "focus", e.open), b(e._input, "click", e.open)), e.daysContainer !== void 0 && (b(e.monthNav, "click", Sn), b(e.monthNav, ["keyup", "increment"], K), b(e.daysContainer, "click", Ze)), e.timeContainer !== void 0 && e.minuteElement !== void 0 && e.hourElement !== void 0) {
|
|
598
|
+
var t = function(i) {
|
|
599
|
+
return N(i).select();
|
|
600
|
+
};
|
|
601
|
+
b(e.timeContainer, ["increment"], w), b(e.timeContainer, "blur", w, { capture: !0 }), b(e.timeContainer, "click", B), b([e.hourElement, e.minuteElement], ["focus", "click"], t), e.secondElement !== void 0 && b(e.secondElement, "focus", function() {
|
|
602
|
+
return e.secondElement && e.secondElement.select();
|
|
603
|
+
}), e.amPM !== void 0 && b(e.amPM, "click", function(i) {
|
|
604
|
+
w(i);
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
e.config.allowInput && b(e._input, "blur", pn);
|
|
608
|
+
}
|
|
609
|
+
function j(n, t) {
|
|
610
|
+
var i = n !== void 0 ? e.parseDate(n) : e.latestSelectedDateObj || (e.config.minDate && e.config.minDate > e.now ? e.config.minDate : e.config.maxDate && e.config.maxDate < e.now ? e.config.maxDate : e.now), o = e.currentYear, u = e.currentMonth;
|
|
611
|
+
try {
|
|
612
|
+
i !== void 0 && (e.currentYear = i.getFullYear(), e.currentMonth = i.getMonth());
|
|
613
|
+
} catch (s) {
|
|
614
|
+
s.message = "Invalid date supplied: " + i, e.config.errorHandler(s);
|
|
615
|
+
}
|
|
616
|
+
t && e.currentYear !== o && (k("onYearChange"), X()), t && (e.currentYear !== o || e.currentMonth !== u) && k("onMonthChange"), e.redraw();
|
|
617
|
+
}
|
|
618
|
+
function B(n) {
|
|
619
|
+
var t = N(n);
|
|
620
|
+
~t.className.indexOf("arrow") && G(n, t.classList.contains("arrowUp") ? 1 : -1);
|
|
621
|
+
}
|
|
622
|
+
function G(n, t, i) {
|
|
623
|
+
var o = n && N(n), u = i || o && o.parentNode && o.parentNode.firstChild, s = xe("increment");
|
|
624
|
+
s.delta = t, u && u.dispatchEvent(s);
|
|
625
|
+
}
|
|
626
|
+
function we() {
|
|
627
|
+
var n = window.document.createDocumentFragment();
|
|
628
|
+
if (e.calendarContainer = y("div", "flatpickr-calendar"), e.calendarContainer.tabIndex = -1, !e.config.noCalendar) {
|
|
629
|
+
if (n.appendChild(sn()), e.innerContainer = y("div", "flatpickr-innerContainer"), e.config.weekNumbers) {
|
|
630
|
+
var t = cn(), i = t.weekWrapper, o = t.weekNumbers;
|
|
631
|
+
e.innerContainer.appendChild(i), e.weekNumbers = o, e.weekWrapper = i;
|
|
632
|
+
}
|
|
633
|
+
e.rContainer = y("div", "flatpickr-rContainer"), e.rContainer.appendChild(Ke()), e.daysContainer || (e.daysContainer = y("div", "flatpickr-days"), e.daysContainer.tabIndex = -1), se(), e.rContainer.appendChild(e.daysContainer), e.innerContainer.appendChild(e.rContainer), n.appendChild(e.innerContainer);
|
|
634
|
+
}
|
|
635
|
+
e.config.enableTime && n.appendChild(dn()), O(e.calendarContainer, "rangeMode", e.config.mode === "range"), O(e.calendarContainer, "animate", e.config.animate === !0), O(e.calendarContainer, "multiMonth", e.config.showMonths > 1), e.calendarContainer.appendChild(n);
|
|
636
|
+
var u = e.config.appendTo !== void 0 && e.config.appendTo.nodeType !== void 0;
|
|
637
|
+
if ((e.config.inline || e.config.static) && (e.calendarContainer.classList.add(e.config.inline ? "inline" : "static"), e.config.inline && (!u && e.element.parentNode ? e.element.parentNode.insertBefore(e.calendarContainer, e._input.nextSibling) : e.config.appendTo !== void 0 && e.config.appendTo.appendChild(e.calendarContainer)), e.config.static)) {
|
|
638
|
+
var s = y("div", "flatpickr-wrapper");
|
|
639
|
+
e.element.parentNode && e.element.parentNode.insertBefore(s, e.element), s.appendChild(e.element), e.altInput && s.appendChild(e.altInput), s.appendChild(e.calendarContainer);
|
|
640
|
+
}
|
|
641
|
+
!e.config.static && !e.config.inline && (e.config.appendTo !== void 0 ? e.config.appendTo : window.document.body).appendChild(e.calendarContainer);
|
|
642
|
+
}
|
|
643
|
+
function q(n, t, i, o) {
|
|
644
|
+
var u = J(t, !0), s = y("span", n, t.getDate().toString());
|
|
645
|
+
return s.dateObj = t, s.$i = o, s.setAttribute("aria-label", e.formatDate(t, e.config.ariaDateFormat)), n.indexOf("hidden") === -1 && P(t, e.now) === 0 && (e.todayDateElem = s, s.classList.add("today"), s.setAttribute("aria-current", "date")), u ? (s.tabIndex = -1, _e(t) && (s.classList.add("selected"), e.selectedDateElem = s, e.config.mode === "range" && (O(s, "startRange", e.selectedDates[0] && P(t, e.selectedDates[0], !0) === 0), O(s, "endRange", e.selectedDates[1] && P(t, e.selectedDates[1], !0) === 0), n === "nextMonthDay" && s.classList.add("inRange")))) : s.classList.add("flatpickr-disabled"), e.config.mode === "range" && _n(t) && !_e(t) && s.classList.add("inRange"), e.weekNumbers && e.config.showMonths === 1 && n !== "prevMonthDay" && o % 7 === 6 && e.weekNumbers.insertAdjacentHTML("beforeend", "<span class='flatpickr-day'>" + e.config.getWeek(t) + "</span>"), k("onDayCreate", s), s;
|
|
646
|
+
}
|
|
647
|
+
function Z(n) {
|
|
648
|
+
n.focus(), e.config.mode === "range" && fe(n);
|
|
649
|
+
}
|
|
650
|
+
function Q(n) {
|
|
651
|
+
for (var t = n > 0 ? 0 : e.config.showMonths - 1, i = n > 0 ? e.config.showMonths : -1, o = t; o != i; o += n)
|
|
652
|
+
for (var u = e.daysContainer.children[o], s = n > 0 ? 0 : u.children.length - 1, h = n > 0 ? u.children.length : -1, c = s; c != h; c += n) {
|
|
653
|
+
var v = u.children[c];
|
|
654
|
+
if (v.className.indexOf("hidden") === -1 && J(v.dateObj))
|
|
655
|
+
return v;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
function Ce(n, t) {
|
|
659
|
+
for (var i = n.className.indexOf("Month") === -1 ? n.dateObj.getMonth() : e.currentMonth, o = t > 0 ? e.config.showMonths : -1, u = t > 0 ? 1 : -1, s = i - e.currentMonth; s != o; s += u)
|
|
660
|
+
for (var h = e.daysContainer.children[s], c = i - e.currentMonth === s ? n.$i + t : t < 0 ? h.children.length - 1 : 0, v = h.children.length, d = c; d >= 0 && d < v && d != (t > 0 ? v : -1); d += u) {
|
|
661
|
+
var g = h.children[d];
|
|
662
|
+
if (g.className.indexOf("hidden") === -1 && J(g.dateObj) && Math.abs(n.$i - d) >= Math.abs(t))
|
|
663
|
+
return Z(g);
|
|
664
|
+
}
|
|
665
|
+
e.changeMonth(u), ae(Q(u), 0);
|
|
666
|
+
}
|
|
667
|
+
function ae(n, t) {
|
|
668
|
+
var i = l(), o = ce(i || document.body), u = n !== void 0 ? n : o ? i : e.selectedDateElem !== void 0 && ce(e.selectedDateElem) ? e.selectedDateElem : e.todayDateElem !== void 0 && ce(e.todayDateElem) ? e.todayDateElem : Q(t > 0 ? 1 : -1);
|
|
669
|
+
u === void 0 ? e._input.focus() : o ? Ce(u, t) : Z(u);
|
|
670
|
+
}
|
|
671
|
+
function ln(n, t) {
|
|
672
|
+
for (var i = (new Date(n, t, 1).getDay() - e.l10n.firstDayOfWeek + 7) % 7, o = e.utils.getDaysInMonth((t - 1 + 12) % 12, n), u = e.utils.getDaysInMonth(t, n), s = window.document.createDocumentFragment(), h = e.config.showMonths > 1, c = h ? "prevMonthDay hidden" : "prevMonthDay", v = h ? "nextMonthDay hidden" : "nextMonthDay", d = o + 1 - i, g = 0; d <= o; d++, g++)
|
|
673
|
+
s.appendChild(q("flatpickr-day " + c, new Date(n, t - 1, d), d, g));
|
|
674
|
+
for (d = 1; d <= u; d++, g++)
|
|
675
|
+
s.appendChild(q("flatpickr-day", new Date(n, t, d), d, g));
|
|
676
|
+
for (var C = u + 1; C <= 42 - i && (e.config.showMonths === 1 || g % 7 !== 0); C++, g++)
|
|
677
|
+
s.appendChild(q("flatpickr-day " + v, new Date(n, t + 1, C % u), C, g));
|
|
678
|
+
var R = y("div", "dayContainer");
|
|
679
|
+
return R.appendChild(s), R;
|
|
680
|
+
}
|
|
681
|
+
function se() {
|
|
682
|
+
if (e.daysContainer !== void 0) {
|
|
683
|
+
ve(e.daysContainer), e.weekNumbers && ve(e.weekNumbers);
|
|
684
|
+
for (var n = document.createDocumentFragment(), t = 0; t < e.config.showMonths; t++) {
|
|
685
|
+
var i = new Date(e.currentYear, e.currentMonth, 1);
|
|
686
|
+
i.setMonth(e.currentMonth + t), n.appendChild(ln(i.getFullYear(), i.getMonth()));
|
|
687
|
+
}
|
|
688
|
+
e.daysContainer.appendChild(n), e.days = e.daysContainer.firstChild, e.config.mode === "range" && e.selectedDates.length === 1 && fe();
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
function X() {
|
|
692
|
+
if (!(e.config.showMonths > 1 || e.config.monthSelectorType !== "dropdown")) {
|
|
693
|
+
var n = function(o) {
|
|
694
|
+
return e.config.minDate !== void 0 && e.currentYear === e.config.minDate.getFullYear() && o < e.config.minDate.getMonth() ? !1 : !(e.config.maxDate !== void 0 && e.currentYear === e.config.maxDate.getFullYear() && o > e.config.maxDate.getMonth());
|
|
695
|
+
};
|
|
696
|
+
e.monthsDropdownContainer.tabIndex = -1, e.monthsDropdownContainer.innerHTML = "";
|
|
697
|
+
for (var t = 0; t < 12; t++)
|
|
698
|
+
if (n(t)) {
|
|
699
|
+
var i = y("option", "flatpickr-monthDropdown-month");
|
|
700
|
+
i.value = new Date(e.currentYear, t).getMonth().toString(), i.textContent = ye(t, e.config.shorthandCurrentMonth, e.l10n), i.tabIndex = -1, e.currentMonth === t && (i.selected = !0), e.monthsDropdownContainer.appendChild(i);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
function un() {
|
|
705
|
+
var n = y("div", "flatpickr-month"), t = window.document.createDocumentFragment(), i;
|
|
706
|
+
e.config.showMonths > 1 || e.config.monthSelectorType === "static" ? i = y("span", "cur-month") : (e.monthsDropdownContainer = y("select", "flatpickr-monthDropdown-months"), e.monthsDropdownContainer.setAttribute("aria-label", e.l10n.monthAriaLabel), b(e.monthsDropdownContainer, "change", function(h) {
|
|
707
|
+
var c = N(h), v = parseInt(c.value, 10);
|
|
708
|
+
e.changeMonth(v - e.currentMonth), k("onMonthChange");
|
|
709
|
+
}), X(), i = e.monthsDropdownContainer);
|
|
710
|
+
var o = De("cur-year", { tabindex: "-1" }), u = o.getElementsByTagName("input")[0];
|
|
711
|
+
u.setAttribute("aria-label", e.l10n.yearAriaLabel), e.config.minDate && u.setAttribute("min", e.config.minDate.getFullYear().toString()), e.config.maxDate && (u.setAttribute("max", e.config.maxDate.getFullYear().toString()), u.disabled = !!e.config.minDate && e.config.minDate.getFullYear() === e.config.maxDate.getFullYear());
|
|
712
|
+
var s = y("div", "flatpickr-current-month");
|
|
713
|
+
return s.appendChild(i), s.appendChild(o), t.appendChild(s), n.appendChild(t), {
|
|
714
|
+
container: n,
|
|
715
|
+
yearElement: u,
|
|
716
|
+
monthElement: i
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
function We() {
|
|
720
|
+
ve(e.monthNav), e.monthNav.appendChild(e.prevMonthNav), e.config.showMonths && (e.yearElements = [], e.monthElements = []);
|
|
721
|
+
for (var n = e.config.showMonths; n--; ) {
|
|
722
|
+
var t = un();
|
|
723
|
+
e.yearElements.push(t.yearElement), e.monthElements.push(t.monthElement), e.monthNav.appendChild(t.container);
|
|
724
|
+
}
|
|
725
|
+
e.monthNav.appendChild(e.nextMonthNav);
|
|
726
|
+
}
|
|
727
|
+
function sn() {
|
|
728
|
+
return e.monthNav = y("div", "flatpickr-months"), e.yearElements = [], e.monthElements = [], e.prevMonthNav = y("span", "flatpickr-prev-month"), e.prevMonthNav.innerHTML = e.config.prevArrow, e.nextMonthNav = y("span", "flatpickr-next-month"), e.nextMonthNav.innerHTML = e.config.nextArrow, We(), Object.defineProperty(e, "_hidePrevMonthArrow", {
|
|
729
|
+
get: function() {
|
|
730
|
+
return e.__hidePrevMonthArrow;
|
|
731
|
+
},
|
|
732
|
+
set: function(n) {
|
|
733
|
+
e.__hidePrevMonthArrow !== n && (O(e.prevMonthNav, "flatpickr-disabled", n), e.__hidePrevMonthArrow = n);
|
|
734
|
+
}
|
|
735
|
+
}), Object.defineProperty(e, "_hideNextMonthArrow", {
|
|
736
|
+
get: function() {
|
|
737
|
+
return e.__hideNextMonthArrow;
|
|
738
|
+
},
|
|
739
|
+
set: function(n) {
|
|
740
|
+
e.__hideNextMonthArrow !== n && (O(e.nextMonthNav, "flatpickr-disabled", n), e.__hideNextMonthArrow = n);
|
|
741
|
+
}
|
|
742
|
+
}), e.currentYearElement = e.yearElements[0], pe(), e.monthNav;
|
|
743
|
+
}
|
|
744
|
+
function dn() {
|
|
745
|
+
e.calendarContainer.classList.add("hasTime"), e.config.noCalendar && e.calendarContainer.classList.add("noCalendar");
|
|
746
|
+
var n = je(e.config);
|
|
747
|
+
e.timeContainer = y("div", "flatpickr-time"), e.timeContainer.tabIndex = -1;
|
|
748
|
+
var t = y("span", "flatpickr-time-separator", ":"), i = De("flatpickr-hour", {
|
|
749
|
+
"aria-label": e.l10n.hourAriaLabel
|
|
750
|
+
});
|
|
751
|
+
e.hourElement = i.getElementsByTagName("input")[0];
|
|
752
|
+
var o = De("flatpickr-minute", {
|
|
753
|
+
"aria-label": e.l10n.minuteAriaLabel
|
|
754
|
+
});
|
|
755
|
+
if (e.minuteElement = o.getElementsByTagName("input")[0], e.hourElement.tabIndex = e.minuteElement.tabIndex = -1, e.hourElement.value = F(e.latestSelectedDateObj ? e.latestSelectedDateObj.getHours() : e.config.time_24hr ? n.hours : M(n.hours)), e.minuteElement.value = F(e.latestSelectedDateObj ? e.latestSelectedDateObj.getMinutes() : n.minutes), e.hourElement.setAttribute("step", e.config.hourIncrement.toString()), e.minuteElement.setAttribute("step", e.config.minuteIncrement.toString()), e.hourElement.setAttribute("min", e.config.time_24hr ? "0" : "1"), e.hourElement.setAttribute("max", e.config.time_24hr ? "23" : "12"), e.hourElement.setAttribute("maxlength", "2"), e.minuteElement.setAttribute("min", "0"), e.minuteElement.setAttribute("max", "59"), e.minuteElement.setAttribute("maxlength", "2"), e.timeContainer.appendChild(i), e.timeContainer.appendChild(t), e.timeContainer.appendChild(o), e.config.time_24hr && e.timeContainer.classList.add("time24hr"), e.config.enableSeconds) {
|
|
756
|
+
e.timeContainer.classList.add("hasSeconds");
|
|
757
|
+
var u = De("flatpickr-second");
|
|
758
|
+
e.secondElement = u.getElementsByTagName("input")[0], e.secondElement.value = F(e.latestSelectedDateObj ? e.latestSelectedDateObj.getSeconds() : n.seconds), e.secondElement.setAttribute("step", e.minuteElement.getAttribute("step")), e.secondElement.setAttribute("min", "0"), e.secondElement.setAttribute("max", "59"), e.secondElement.setAttribute("maxlength", "2"), e.timeContainer.appendChild(y("span", "flatpickr-time-separator", ":")), e.timeContainer.appendChild(u);
|
|
759
|
+
}
|
|
760
|
+
return e.config.time_24hr || (e.amPM = y("span", "flatpickr-am-pm", e.l10n.amPM[H((e.latestSelectedDateObj ? e.hourElement.value : e.config.defaultHour) > 11)]), e.amPM.title = e.l10n.toggleTitle, e.amPM.tabIndex = -1, e.timeContainer.appendChild(e.amPM)), e.timeContainer;
|
|
761
|
+
}
|
|
762
|
+
function Ke() {
|
|
763
|
+
e.weekdayContainer ? ve(e.weekdayContainer) : e.weekdayContainer = y("div", "flatpickr-weekdays");
|
|
764
|
+
for (var n = e.config.showMonths; n--; ) {
|
|
765
|
+
var t = y("div", "flatpickr-weekdaycontainer");
|
|
766
|
+
e.weekdayContainer.appendChild(t);
|
|
767
|
+
}
|
|
768
|
+
return Be(), e.weekdayContainer;
|
|
769
|
+
}
|
|
770
|
+
function Be() {
|
|
771
|
+
if (e.weekdayContainer) {
|
|
772
|
+
var n = e.l10n.firstDayOfWeek, t = tn(e.l10n.weekdays.shorthand);
|
|
773
|
+
n > 0 && n < t.length && (t = tn(t.splice(n, t.length), t.splice(0, n)));
|
|
774
|
+
for (var i = e.config.showMonths; i--; )
|
|
775
|
+
e.weekdayContainer.children[i].innerHTML = `
|
|
776
|
+
<span class='flatpickr-weekday'>
|
|
777
|
+
` + t.join("</span><span class='flatpickr-weekday'>") + `
|
|
778
|
+
</span>
|
|
779
|
+
`;
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
function cn() {
|
|
783
|
+
e.calendarContainer.classList.add("hasWeeks");
|
|
784
|
+
var n = y("div", "flatpickr-weekwrapper");
|
|
785
|
+
n.appendChild(y("span", "flatpickr-weekday", e.l10n.weekAbbreviation));
|
|
786
|
+
var t = y("div", "flatpickr-weeks");
|
|
787
|
+
return n.appendChild(t), {
|
|
788
|
+
weekWrapper: n,
|
|
789
|
+
weekNumbers: t
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
function Me(n, t) {
|
|
793
|
+
t === void 0 && (t = !0);
|
|
794
|
+
var i = t ? n : n - e.currentMonth;
|
|
795
|
+
i < 0 && e._hidePrevMonthArrow === !0 || i > 0 && e._hideNextMonthArrow === !0 || (e.currentMonth += i, (e.currentMonth < 0 || e.currentMonth > 11) && (e.currentYear += e.currentMonth > 11 ? 1 : -1, e.currentMonth = (e.currentMonth + 12) % 12, k("onYearChange"), X()), se(), k("onMonthChange"), pe());
|
|
796
|
+
}
|
|
797
|
+
function fn(n, t) {
|
|
798
|
+
if (n === void 0 && (n = !0), t === void 0 && (t = !0), e.input.value = "", e.altInput !== void 0 && (e.altInput.value = ""), e.mobileInput !== void 0 && (e.mobileInput.value = ""), e.selectedDates = [], e.latestSelectedDateObj = void 0, t === !0 && (e.currentYear = e._initialDate.getFullYear(), e.currentMonth = e._initialDate.getMonth()), e.config.enableTime === !0) {
|
|
799
|
+
var i = je(e.config), o = i.hours, u = i.minutes, s = i.seconds;
|
|
800
|
+
S(o, u, s);
|
|
801
|
+
}
|
|
802
|
+
e.redraw(), n && k("onChange");
|
|
803
|
+
}
|
|
804
|
+
function mn() {
|
|
805
|
+
e.isOpen = !1, e.isMobile || (e.calendarContainer !== void 0 && e.calendarContainer.classList.remove("open"), e._input !== void 0 && e._input.classList.remove("active")), k("onClose");
|
|
806
|
+
}
|
|
807
|
+
function gn() {
|
|
808
|
+
e.config !== void 0 && k("onDestroy");
|
|
809
|
+
for (var n = e._handlers.length; n--; )
|
|
810
|
+
e._handlers[n].remove();
|
|
811
|
+
if (e._handlers = [], e.mobileInput)
|
|
812
|
+
e.mobileInput.parentNode && e.mobileInput.parentNode.removeChild(e.mobileInput), e.mobileInput = void 0;
|
|
813
|
+
else if (e.calendarContainer && e.calendarContainer.parentNode)
|
|
814
|
+
if (e.config.static && e.calendarContainer.parentNode) {
|
|
815
|
+
var t = e.calendarContainer.parentNode;
|
|
816
|
+
if (t.lastChild && t.removeChild(t.lastChild), t.parentNode) {
|
|
817
|
+
for (; t.firstChild; )
|
|
818
|
+
t.parentNode.insertBefore(t.firstChild, t);
|
|
819
|
+
t.parentNode.removeChild(t);
|
|
820
|
+
}
|
|
821
|
+
} else
|
|
822
|
+
e.calendarContainer.parentNode.removeChild(e.calendarContainer);
|
|
823
|
+
e.altInput && (e.input.type = "text", e.altInput.parentNode && e.altInput.parentNode.removeChild(e.altInput), delete e.altInput), e.input && (e.input.type = e.input._type, e.input.classList.remove("flatpickr-input"), e.input.removeAttribute("readonly")), [
|
|
824
|
+
"_showTimeInput",
|
|
825
|
+
"latestSelectedDateObj",
|
|
826
|
+
"_hideNextMonthArrow",
|
|
827
|
+
"_hidePrevMonthArrow",
|
|
828
|
+
"__hideNextMonthArrow",
|
|
829
|
+
"__hidePrevMonthArrow",
|
|
830
|
+
"isMobile",
|
|
831
|
+
"isOpen",
|
|
832
|
+
"selectedDateElem",
|
|
833
|
+
"minDateHasTime",
|
|
834
|
+
"maxDateHasTime",
|
|
835
|
+
"days",
|
|
836
|
+
"daysContainer",
|
|
837
|
+
"_input",
|
|
838
|
+
"_positionElement",
|
|
839
|
+
"innerContainer",
|
|
840
|
+
"rContainer",
|
|
841
|
+
"monthNav",
|
|
842
|
+
"todayDateElem",
|
|
843
|
+
"calendarContainer",
|
|
844
|
+
"weekdayContainer",
|
|
845
|
+
"prevMonthNav",
|
|
846
|
+
"nextMonthNav",
|
|
847
|
+
"monthsDropdownContainer",
|
|
848
|
+
"currentMonthElement",
|
|
849
|
+
"currentYearElement",
|
|
850
|
+
"navigationCurrentMonth",
|
|
851
|
+
"selectedDateElem",
|
|
852
|
+
"config"
|
|
853
|
+
].forEach(function(i) {
|
|
854
|
+
try {
|
|
855
|
+
delete e[i];
|
|
856
|
+
} catch {
|
|
857
|
+
}
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
function ie(n) {
|
|
861
|
+
return e.calendarContainer.contains(n);
|
|
862
|
+
}
|
|
863
|
+
function Ee(n) {
|
|
864
|
+
if (e.isOpen && !e.config.inline) {
|
|
865
|
+
var t = N(n), i = ie(t), o = t === e.input || t === e.altInput || e.element.contains(t) || n.path && n.path.indexOf && (~n.path.indexOf(e.input) || ~n.path.indexOf(e.altInput)), u = !o && !i && !ie(n.relatedTarget), s = !e.config.ignoredFocusElements.some(function(h) {
|
|
866
|
+
return h.contains(t);
|
|
867
|
+
});
|
|
868
|
+
u && s && (e.config.allowInput && e.setDate(e._input.value, !1, e.config.altInput ? e.config.altFormat : e.config.dateFormat), e.timeContainer !== void 0 && e.minuteElement !== void 0 && e.hourElement !== void 0 && e.input.value !== "" && e.input.value !== void 0 && w(), e.close(), e.config && e.config.mode === "range" && e.selectedDates.length === 1 && e.clear(!1));
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
function de(n) {
|
|
872
|
+
if (!(!n || e.config.minDate && n < e.config.minDate.getFullYear() || e.config.maxDate && n > e.config.maxDate.getFullYear())) {
|
|
873
|
+
var t = n, i = e.currentYear !== t;
|
|
874
|
+
e.currentYear = t || e.currentYear, e.config.maxDate && e.currentYear === e.config.maxDate.getFullYear() ? e.currentMonth = Math.min(e.config.maxDate.getMonth(), e.currentMonth) : e.config.minDate && e.currentYear === e.config.minDate.getFullYear() && (e.currentMonth = Math.max(e.config.minDate.getMonth(), e.currentMonth)), i && (e.redraw(), k("onYearChange"), X());
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
function J(n, t) {
|
|
878
|
+
var i;
|
|
879
|
+
t === void 0 && (t = !0);
|
|
880
|
+
var o = e.parseDate(n, void 0, t);
|
|
881
|
+
if (e.config.minDate && o && P(o, e.config.minDate, t !== void 0 ? t : !e.minDateHasTime) < 0 || e.config.maxDate && o && P(o, e.config.maxDate, t !== void 0 ? t : !e.maxDateHasTime) > 0)
|
|
882
|
+
return !1;
|
|
883
|
+
if (!e.config.enable && e.config.disable.length === 0)
|
|
884
|
+
return !0;
|
|
885
|
+
if (o === void 0)
|
|
886
|
+
return !1;
|
|
887
|
+
for (var u = !!e.config.enable, s = (i = e.config.enable) !== null && i !== void 0 ? i : e.config.disable, h = 0, c = void 0; h < s.length; h++) {
|
|
888
|
+
if (c = s[h], typeof c == "function" && c(o))
|
|
889
|
+
return u;
|
|
890
|
+
if (c instanceof Date && o !== void 0 && c.getTime() === o.getTime())
|
|
891
|
+
return u;
|
|
892
|
+
if (typeof c == "string") {
|
|
893
|
+
var v = e.parseDate(c, void 0, !0);
|
|
894
|
+
return v && v.getTime() === o.getTime() ? u : !u;
|
|
895
|
+
} else if (typeof c == "object" && o !== void 0 && c.from && c.to && o.getTime() >= c.from.getTime() && o.getTime() <= c.to.getTime())
|
|
896
|
+
return u;
|
|
897
|
+
}
|
|
898
|
+
return !u;
|
|
899
|
+
}
|
|
900
|
+
function ce(n) {
|
|
901
|
+
return e.daysContainer !== void 0 ? n.className.indexOf("hidden") === -1 && n.className.indexOf("flatpickr-disabled") === -1 && e.daysContainer.contains(n) : !1;
|
|
902
|
+
}
|
|
903
|
+
function pn(n) {
|
|
904
|
+
var t = n.target === e._input, i = e._input.value.trimEnd() !== Se();
|
|
905
|
+
t && i && !(n.relatedTarget && ie(n.relatedTarget)) && e.setDate(e._input.value, !0, n.target === e.altInput ? e.config.altFormat : e.config.dateFormat);
|
|
906
|
+
}
|
|
907
|
+
function qe(n) {
|
|
908
|
+
var t = N(n), i = e.config.wrap ? a.contains(t) : t === e._input, o = e.config.allowInput, u = e.isOpen && (!o || !i), s = e.config.inline && i && !o;
|
|
909
|
+
if (n.keyCode === 13 && i) {
|
|
910
|
+
if (o)
|
|
911
|
+
return e.setDate(e._input.value, !0, t === e.altInput ? e.config.altFormat : e.config.dateFormat), e.close(), t.blur();
|
|
912
|
+
e.open();
|
|
913
|
+
} else if (ie(t) || u || s) {
|
|
914
|
+
var h = !!e.timeContainer && e.timeContainer.contains(t);
|
|
915
|
+
switch (n.keyCode) {
|
|
916
|
+
case 13:
|
|
917
|
+
h ? (n.preventDefault(), w(), ke()) : Ze(n);
|
|
918
|
+
break;
|
|
919
|
+
case 27:
|
|
920
|
+
n.preventDefault(), ke();
|
|
921
|
+
break;
|
|
922
|
+
case 8:
|
|
923
|
+
case 46:
|
|
924
|
+
i && !e.config.allowInput && (n.preventDefault(), e.clear());
|
|
925
|
+
break;
|
|
926
|
+
case 37:
|
|
927
|
+
case 39:
|
|
928
|
+
if (!h && !i) {
|
|
929
|
+
n.preventDefault();
|
|
930
|
+
var c = l();
|
|
931
|
+
if (e.daysContainer !== void 0 && (o === !1 || c && ce(c))) {
|
|
932
|
+
var v = n.keyCode === 39 ? 1 : -1;
|
|
933
|
+
n.ctrlKey ? (n.stopPropagation(), Me(v), ae(Q(1), 0)) : ae(void 0, v);
|
|
934
|
+
}
|
|
935
|
+
} else e.hourElement && e.hourElement.focus();
|
|
936
|
+
break;
|
|
937
|
+
case 38:
|
|
938
|
+
case 40:
|
|
939
|
+
n.preventDefault();
|
|
940
|
+
var d = n.keyCode === 40 ? 1 : -1;
|
|
941
|
+
e.daysContainer && t.$i !== void 0 || t === e.input || t === e.altInput ? n.ctrlKey ? (n.stopPropagation(), de(e.currentYear - d), ae(Q(1), 0)) : h || ae(void 0, d * 7) : t === e.currentYearElement ? de(e.currentYear - d) : e.config.enableTime && (!h && e.hourElement && e.hourElement.focus(), w(n), e._debouncedChange());
|
|
942
|
+
break;
|
|
943
|
+
case 9:
|
|
944
|
+
if (h) {
|
|
945
|
+
var g = [
|
|
946
|
+
e.hourElement,
|
|
947
|
+
e.minuteElement,
|
|
948
|
+
e.secondElement,
|
|
949
|
+
e.amPM
|
|
950
|
+
].concat(e.pluginElements).filter(function(A) {
|
|
951
|
+
return A;
|
|
952
|
+
}), C = g.indexOf(t);
|
|
953
|
+
if (C !== -1) {
|
|
954
|
+
var R = g[C + (n.shiftKey ? -1 : 1)];
|
|
955
|
+
n.preventDefault(), (R || e._input).focus();
|
|
956
|
+
}
|
|
957
|
+
} else !e.config.noCalendar && e.daysContainer && e.daysContainer.contains(t) && n.shiftKey && (n.preventDefault(), e._input.focus());
|
|
958
|
+
break;
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
if (e.amPM !== void 0 && t === e.amPM)
|
|
962
|
+
switch (n.key) {
|
|
963
|
+
case e.l10n.amPM[0].charAt(0):
|
|
964
|
+
case e.l10n.amPM[0].charAt(0).toLowerCase():
|
|
965
|
+
e.amPM.textContent = e.l10n.amPM[0], T(), V();
|
|
966
|
+
break;
|
|
967
|
+
case e.l10n.amPM[1].charAt(0):
|
|
968
|
+
case e.l10n.amPM[1].charAt(0).toLowerCase():
|
|
969
|
+
e.amPM.textContent = e.l10n.amPM[1], T(), V();
|
|
970
|
+
break;
|
|
971
|
+
}
|
|
972
|
+
(i || ie(t)) && k("onKeyDown", n);
|
|
973
|
+
}
|
|
974
|
+
function fe(n, t) {
|
|
975
|
+
if (t === void 0 && (t = "flatpickr-day"), !(e.selectedDates.length !== 1 || n && (!n.classList.contains(t) || n.classList.contains("flatpickr-disabled")))) {
|
|
976
|
+
for (var i = n ? n.dateObj.getTime() : e.days.firstElementChild.dateObj.getTime(), o = e.parseDate(e.selectedDates[0], void 0, !0).getTime(), u = Math.min(i, e.selectedDates[0].getTime()), s = Math.max(i, e.selectedDates[0].getTime()), h = !1, c = 0, v = 0, d = u; d < s; d += Qn.DAY)
|
|
977
|
+
J(new Date(d), !0) || (h = h || d > u && d < s, d < o && (!c || d > c) ? c = d : d > o && (!v || d < v) && (v = d));
|
|
978
|
+
var g = Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+" + e.config.showMonths + ") > ." + t));
|
|
979
|
+
g.forEach(function(C) {
|
|
980
|
+
var R = C.dateObj, A = R.getTime(), re = c > 0 && A < c || v > 0 && A > v;
|
|
981
|
+
if (re) {
|
|
982
|
+
C.classList.add("notAllowed"), ["inRange", "startRange", "endRange"].forEach(function($) {
|
|
983
|
+
C.classList.remove($);
|
|
984
|
+
});
|
|
985
|
+
return;
|
|
986
|
+
} else if (h && !re)
|
|
987
|
+
return;
|
|
988
|
+
["startRange", "inRange", "endRange", "notAllowed"].forEach(function($) {
|
|
989
|
+
C.classList.remove($);
|
|
990
|
+
}), n !== void 0 && (n.classList.add(i <= e.selectedDates[0].getTime() ? "startRange" : "endRange"), o < i && A === o ? C.classList.add("startRange") : o > i && A === o && C.classList.add("endRange"), A >= c && (v === 0 || A <= v) && Gn(A, o, i) && C.classList.add("inRange"));
|
|
991
|
+
});
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
function hn() {
|
|
995
|
+
e.isOpen && !e.config.static && !e.config.inline && me();
|
|
996
|
+
}
|
|
997
|
+
function vn(n, t) {
|
|
998
|
+
if (t === void 0 && (t = e._positionElement), e.isMobile === !0) {
|
|
999
|
+
if (n) {
|
|
1000
|
+
n.preventDefault();
|
|
1001
|
+
var i = N(n);
|
|
1002
|
+
i && i.blur();
|
|
1003
|
+
}
|
|
1004
|
+
e.mobileInput !== void 0 && (e.mobileInput.focus(), e.mobileInput.click()), k("onOpen");
|
|
1005
|
+
return;
|
|
1006
|
+
} else if (e._input.disabled || e.config.inline)
|
|
1007
|
+
return;
|
|
1008
|
+
var o = e.isOpen;
|
|
1009
|
+
e.isOpen = !0, o || (e.calendarContainer.classList.add("open"), e._input.classList.add("active"), k("onOpen"), me(t)), e.config.enableTime === !0 && e.config.noCalendar === !0 && e.config.allowInput === !1 && (n === void 0 || !e.timeContainer.contains(n.relatedTarget)) && setTimeout(function() {
|
|
1010
|
+
return e.hourElement.select();
|
|
1011
|
+
}, 50);
|
|
1012
|
+
}
|
|
1013
|
+
function Je(n) {
|
|
1014
|
+
return function(t) {
|
|
1015
|
+
var i = e.config["_" + n + "Date"] = e.parseDate(t, e.config.dateFormat), o = e.config["_" + (n === "min" ? "max" : "min") + "Date"];
|
|
1016
|
+
i !== void 0 && (e[n === "min" ? "minDateHasTime" : "maxDateHasTime"] = i.getHours() > 0 || i.getMinutes() > 0 || i.getSeconds() > 0), e.selectedDates && (e.selectedDates = e.selectedDates.filter(function(u) {
|
|
1017
|
+
return J(u);
|
|
1018
|
+
}), !e.selectedDates.length && n === "min" && x(i), V()), e.daysContainer && (Ge(), i !== void 0 ? e.currentYearElement[n] = i.getFullYear().toString() : e.currentYearElement.removeAttribute(n), e.currentYearElement.disabled = !!o && i !== void 0 && o.getFullYear() === i.getFullYear());
|
|
1019
|
+
};
|
|
1020
|
+
}
|
|
1021
|
+
function Dn() {
|
|
1022
|
+
var n = [
|
|
1023
|
+
"wrap",
|
|
1024
|
+
"weekNumbers",
|
|
1025
|
+
"allowInput",
|
|
1026
|
+
"allowInvalidPreload",
|
|
1027
|
+
"clickOpens",
|
|
1028
|
+
"time_24hr",
|
|
1029
|
+
"enableTime",
|
|
1030
|
+
"noCalendar",
|
|
1031
|
+
"altInput",
|
|
1032
|
+
"shorthandCurrentMonth",
|
|
1033
|
+
"inline",
|
|
1034
|
+
"static",
|
|
1035
|
+
"enableSeconds",
|
|
1036
|
+
"disableMobile"
|
|
1037
|
+
], t = I(I({}, JSON.parse(JSON.stringify(a.dataset || {}))), r), i = {};
|
|
1038
|
+
e.config.parseDate = t.parseDate, e.config.formatDate = t.formatDate, Object.defineProperty(e.config, "enable", {
|
|
1039
|
+
get: function() {
|
|
1040
|
+
return e.config._enable;
|
|
1041
|
+
},
|
|
1042
|
+
set: function(g) {
|
|
1043
|
+
e.config._enable = Xe(g);
|
|
1044
|
+
}
|
|
1045
|
+
}), Object.defineProperty(e.config, "disable", {
|
|
1046
|
+
get: function() {
|
|
1047
|
+
return e.config._disable;
|
|
1048
|
+
},
|
|
1049
|
+
set: function(g) {
|
|
1050
|
+
e.config._disable = Xe(g);
|
|
1051
|
+
}
|
|
1052
|
+
});
|
|
1053
|
+
var o = t.mode === "time";
|
|
1054
|
+
if (!t.dateFormat && (t.enableTime || o)) {
|
|
1055
|
+
var u = _.defaultConfig.dateFormat || ne.dateFormat;
|
|
1056
|
+
i.dateFormat = t.noCalendar || o ? "H:i" + (t.enableSeconds ? ":S" : "") : u + " H:i" + (t.enableSeconds ? ":S" : "");
|
|
1057
|
+
}
|
|
1058
|
+
if (t.altInput && (t.enableTime || o) && !t.altFormat) {
|
|
1059
|
+
var s = _.defaultConfig.altFormat || ne.altFormat;
|
|
1060
|
+
i.altFormat = t.noCalendar || o ? "h:i" + (t.enableSeconds ? ":S K" : " K") : s + (" h:i" + (t.enableSeconds ? ":S" : "") + " K");
|
|
1061
|
+
}
|
|
1062
|
+
Object.defineProperty(e.config, "minDate", {
|
|
1063
|
+
get: function() {
|
|
1064
|
+
return e.config._minDate;
|
|
1065
|
+
},
|
|
1066
|
+
set: Je("min")
|
|
1067
|
+
}), Object.defineProperty(e.config, "maxDate", {
|
|
1068
|
+
get: function() {
|
|
1069
|
+
return e.config._maxDate;
|
|
1070
|
+
},
|
|
1071
|
+
set: Je("max")
|
|
1072
|
+
});
|
|
1073
|
+
var h = function(g) {
|
|
1074
|
+
return function(C) {
|
|
1075
|
+
e.config[g === "min" ? "_minTime" : "_maxTime"] = e.parseDate(C, "H:i:S");
|
|
1076
|
+
};
|
|
1077
|
+
};
|
|
1078
|
+
Object.defineProperty(e.config, "minTime", {
|
|
1079
|
+
get: function() {
|
|
1080
|
+
return e.config._minTime;
|
|
1081
|
+
},
|
|
1082
|
+
set: h("min")
|
|
1083
|
+
}), Object.defineProperty(e.config, "maxTime", {
|
|
1084
|
+
get: function() {
|
|
1085
|
+
return e.config._maxTime;
|
|
1086
|
+
},
|
|
1087
|
+
set: h("max")
|
|
1088
|
+
}), t.mode === "time" && (e.config.noCalendar = !0, e.config.enableTime = !0), Object.assign(e.config, i, t);
|
|
1089
|
+
for (var c = 0; c < n.length; c++)
|
|
1090
|
+
e.config[n[c]] = e.config[n[c]] === !0 || e.config[n[c]] === "true";
|
|
1091
|
+
Pe.filter(function(g) {
|
|
1092
|
+
return e.config[g] !== void 0;
|
|
1093
|
+
}).forEach(function(g) {
|
|
1094
|
+
e.config[g] = Ye(e.config[g] || []).map(D);
|
|
1095
|
+
}), e.isMobile = !e.config.disableMobile && !e.config.inline && e.config.mode === "single" && !e.config.disable.length && !e.config.enable && !e.config.weekNumbers && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
1096
|
+
for (var c = 0; c < e.config.plugins.length; c++) {
|
|
1097
|
+
var v = e.config.plugins[c](e) || {};
|
|
1098
|
+
for (var d in v)
|
|
1099
|
+
Pe.indexOf(d) > -1 ? e.config[d] = Ye(v[d]).map(D).concat(e.config[d]) : typeof t[d] > "u" && (e.config[d] = v[d]);
|
|
1100
|
+
}
|
|
1101
|
+
t.altInputClass || (e.config.altInputClass = Ue().className + " " + e.config.altInputClass), k("onParseConfig");
|
|
1102
|
+
}
|
|
1103
|
+
function Ue() {
|
|
1104
|
+
return e.config.wrap ? a.querySelector("[data-input]") : a;
|
|
1105
|
+
}
|
|
1106
|
+
function ze() {
|
|
1107
|
+
typeof e.config.locale != "object" && typeof _.l10ns[e.config.locale] > "u" && e.config.errorHandler(new Error("flatpickr: invalid locale " + e.config.locale)), e.l10n = I(I({}, _.l10ns.default), typeof e.config.locale == "object" ? e.config.locale : e.config.locale !== "default" ? _.l10ns[e.config.locale] : void 0), z.D = "(" + e.l10n.weekdays.shorthand.join("|") + ")", z.l = "(" + e.l10n.weekdays.longhand.join("|") + ")", z.M = "(" + e.l10n.months.shorthand.join("|") + ")", z.F = "(" + e.l10n.months.longhand.join("|") + ")", z.K = "(" + e.l10n.amPM[0] + "|" + e.l10n.amPM[1] + "|" + e.l10n.amPM[0].toLowerCase() + "|" + e.l10n.amPM[1].toLowerCase() + ")";
|
|
1108
|
+
var n = I(I({}, r), JSON.parse(JSON.stringify(a.dataset || {})));
|
|
1109
|
+
n.time_24hr === void 0 && _.defaultConfig.time_24hr === void 0 && (e.config.time_24hr = e.l10n.time_24hr), e.formatDate = on(e), e.parseDate = Ve({ config: e.config, l10n: e.l10n });
|
|
1110
|
+
}
|
|
1111
|
+
function me(n) {
|
|
1112
|
+
if (typeof e.config.position == "function")
|
|
1113
|
+
return void e.config.position(e, n);
|
|
1114
|
+
if (e.calendarContainer !== void 0) {
|
|
1115
|
+
k("onPreCalendarPosition");
|
|
1116
|
+
var t = n || e._positionElement, i = Array.prototype.reduce.call(e.calendarContainer.children, (function(Hn, Ln) {
|
|
1117
|
+
return Hn + Ln.offsetHeight;
|
|
1118
|
+
}), 0), o = e.calendarContainer.offsetWidth, u = e.config.position.split(" "), s = u[0], h = u.length > 1 ? u[1] : null, c = t.getBoundingClientRect(), v = window.innerHeight - c.bottom, d = s === "above" || s !== "below" && v < i && c.top > i, g = window.pageYOffset + c.top + (d ? -i - 2 : t.offsetHeight + 2);
|
|
1119
|
+
if (O(e.calendarContainer, "arrowTop", !d), O(e.calendarContainer, "arrowBottom", d), !e.config.inline) {
|
|
1120
|
+
var C = window.pageXOffset + c.left, R = !1, A = !1;
|
|
1121
|
+
h === "center" ? (C -= (o - c.width) / 2, R = !0) : h === "right" && (C -= o - c.width, A = !0), O(e.calendarContainer, "arrowLeft", !R && !A), O(e.calendarContainer, "arrowCenter", R), O(e.calendarContainer, "arrowRight", A);
|
|
1122
|
+
var re = window.document.body.offsetWidth - (window.pageXOffset + c.right), $ = C + o > window.document.body.offsetWidth, In = re + o > window.document.body.offsetWidth;
|
|
1123
|
+
if (O(e.calendarContainer, "rightMost", $), !e.config.static)
|
|
1124
|
+
if (e.calendarContainer.style.top = g + "px", !$)
|
|
1125
|
+
e.calendarContainer.style.left = C + "px", e.calendarContainer.style.right = "auto";
|
|
1126
|
+
else if (!In)
|
|
1127
|
+
e.calendarContainer.style.left = "auto", e.calendarContainer.style.right = re + "px";
|
|
1128
|
+
else {
|
|
1129
|
+
var Te = bn();
|
|
1130
|
+
if (Te === void 0)
|
|
1131
|
+
return;
|
|
1132
|
+
var On = window.document.body.offsetWidth, Fn = Math.max(0, On / 2 - o / 2), An = ".flatpickr-calendar.centerMost:before", Nn = ".flatpickr-calendar.centerMost:after", Pn = Te.cssRules.length, Yn = "{left:" + c.left + "px;right:auto;}";
|
|
1133
|
+
O(e.calendarContainer, "rightMost", !1), O(e.calendarContainer, "centerMost", !0), Te.insertRule(An + "," + Nn + Yn, Pn), e.calendarContainer.style.left = Fn + "px", e.calendarContainer.style.right = "auto";
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
function bn() {
|
|
1139
|
+
for (var n = null, t = 0; t < document.styleSheets.length; t++) {
|
|
1140
|
+
var i = document.styleSheets[t];
|
|
1141
|
+
if (i.cssRules) {
|
|
1142
|
+
try {
|
|
1143
|
+
i.cssRules;
|
|
1144
|
+
} catch {
|
|
1145
|
+
continue;
|
|
1146
|
+
}
|
|
1147
|
+
n = i;
|
|
1148
|
+
break;
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
return n ?? yn();
|
|
1152
|
+
}
|
|
1153
|
+
function yn() {
|
|
1154
|
+
var n = document.createElement("style");
|
|
1155
|
+
return document.head.appendChild(n), n.sheet;
|
|
1156
|
+
}
|
|
1157
|
+
function Ge() {
|
|
1158
|
+
e.config.noCalendar || e.isMobile || (X(), pe(), se());
|
|
1159
|
+
}
|
|
1160
|
+
function ke() {
|
|
1161
|
+
e._input.focus(), window.navigator.userAgent.indexOf("MSIE") !== -1 || navigator.msMaxTouchPoints !== void 0 ? setTimeout(e.close, 0) : e.close();
|
|
1162
|
+
}
|
|
1163
|
+
function Ze(n) {
|
|
1164
|
+
n.preventDefault(), n.stopPropagation();
|
|
1165
|
+
var t = function(g) {
|
|
1166
|
+
return g.classList && g.classList.contains("flatpickr-day") && !g.classList.contains("flatpickr-disabled") && !g.classList.contains("notAllowed");
|
|
1167
|
+
}, i = rn(N(n), t);
|
|
1168
|
+
if (i !== void 0) {
|
|
1169
|
+
var o = i, u = e.latestSelectedDateObj = new Date(o.dateObj.getTime()), s = (u.getMonth() < e.currentMonth || u.getMonth() > e.currentMonth + e.config.showMonths - 1) && e.config.mode !== "range";
|
|
1170
|
+
if (e.selectedDateElem = o, e.config.mode === "single")
|
|
1171
|
+
e.selectedDates = [u];
|
|
1172
|
+
else if (e.config.mode === "multiple") {
|
|
1173
|
+
var h = _e(u);
|
|
1174
|
+
h ? e.selectedDates.splice(parseInt(h), 1) : e.selectedDates.push(u);
|
|
1175
|
+
} else e.config.mode === "range" && (e.selectedDates.length === 2 && e.clear(!1, !1), e.latestSelectedDateObj = u, e.selectedDates.push(u), P(u, e.selectedDates[0], !0) !== 0 && e.selectedDates.sort(function(g, C) {
|
|
1176
|
+
return g.getTime() - C.getTime();
|
|
1177
|
+
}));
|
|
1178
|
+
if (T(), s) {
|
|
1179
|
+
var c = e.currentYear !== u.getFullYear();
|
|
1180
|
+
e.currentYear = u.getFullYear(), e.currentMonth = u.getMonth(), c && (k("onYearChange"), X()), k("onMonthChange");
|
|
1181
|
+
}
|
|
1182
|
+
if (pe(), se(), V(), !s && e.config.mode !== "range" && e.config.showMonths === 1 ? Z(o) : e.selectedDateElem !== void 0 && e.hourElement === void 0 && e.selectedDateElem && e.selectedDateElem.focus(), e.hourElement !== void 0 && e.hourElement !== void 0 && e.hourElement.focus(), e.config.closeOnSelect) {
|
|
1183
|
+
var v = e.config.mode === "single" && !e.config.enableTime, d = e.config.mode === "range" && e.selectedDates.length === 2 && !e.config.enableTime;
|
|
1184
|
+
(v || d) && ke();
|
|
1185
|
+
}
|
|
1186
|
+
L();
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
var ge = {
|
|
1190
|
+
locale: [ze, Be],
|
|
1191
|
+
showMonths: [We, f, Ke],
|
|
1192
|
+
minDate: [j],
|
|
1193
|
+
maxDate: [j],
|
|
1194
|
+
positionElement: [$e],
|
|
1195
|
+
clickOpens: [
|
|
1196
|
+
function() {
|
|
1197
|
+
e.config.clickOpens === !0 ? (b(e._input, "focus", e.open), b(e._input, "click", e.open)) : (e._input.removeEventListener("focus", e.open), e._input.removeEventListener("click", e.open));
|
|
1198
|
+
}
|
|
1199
|
+
]
|
|
1200
|
+
};
|
|
1201
|
+
function wn(n, t) {
|
|
1202
|
+
if (n !== null && typeof n == "object") {
|
|
1203
|
+
Object.assign(e.config, n);
|
|
1204
|
+
for (var i in n)
|
|
1205
|
+
ge[i] !== void 0 && ge[i].forEach(function(o) {
|
|
1206
|
+
return o();
|
|
1207
|
+
});
|
|
1208
|
+
} else
|
|
1209
|
+
e.config[n] = t, ge[n] !== void 0 ? ge[n].forEach(function(o) {
|
|
1210
|
+
return o();
|
|
1211
|
+
}) : Pe.indexOf(n) > -1 && (e.config[n] = Ye(t));
|
|
1212
|
+
e.redraw(), V(!0);
|
|
1213
|
+
}
|
|
1214
|
+
function Qe(n, t) {
|
|
1215
|
+
var i = [];
|
|
1216
|
+
if (n instanceof Array)
|
|
1217
|
+
i = n.map(function(o) {
|
|
1218
|
+
return e.parseDate(o, t);
|
|
1219
|
+
});
|
|
1220
|
+
else if (n instanceof Date || typeof n == "number")
|
|
1221
|
+
i = [e.parseDate(n, t)];
|
|
1222
|
+
else if (typeof n == "string")
|
|
1223
|
+
switch (e.config.mode) {
|
|
1224
|
+
case "single":
|
|
1225
|
+
case "time":
|
|
1226
|
+
i = [e.parseDate(n, t)];
|
|
1227
|
+
break;
|
|
1228
|
+
case "multiple":
|
|
1229
|
+
i = n.split(e.config.conjunction).map(function(o) {
|
|
1230
|
+
return e.parseDate(o, t);
|
|
1231
|
+
});
|
|
1232
|
+
break;
|
|
1233
|
+
case "range":
|
|
1234
|
+
i = n.split(e.l10n.rangeSeparator).map(function(o) {
|
|
1235
|
+
return e.parseDate(o, t);
|
|
1236
|
+
});
|
|
1237
|
+
break;
|
|
1238
|
+
}
|
|
1239
|
+
else
|
|
1240
|
+
e.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(n)));
|
|
1241
|
+
e.selectedDates = e.config.allowInvalidPreload ? i : i.filter(function(o) {
|
|
1242
|
+
return o instanceof Date && J(o, !1);
|
|
1243
|
+
}), e.config.mode === "range" && e.selectedDates.sort(function(o, u) {
|
|
1244
|
+
return o.getTime() - u.getTime();
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1247
|
+
function Cn(n, t, i) {
|
|
1248
|
+
if (t === void 0 && (t = !1), i === void 0 && (i = e.config.dateFormat), n !== 0 && !n || n instanceof Array && n.length === 0)
|
|
1249
|
+
return e.clear(t);
|
|
1250
|
+
Qe(n, i), e.latestSelectedDateObj = e.selectedDates[e.selectedDates.length - 1], e.redraw(), j(void 0, t), x(), e.selectedDates.length === 0 && e.clear(!1), V(t), t && k("onChange");
|
|
1251
|
+
}
|
|
1252
|
+
function Xe(n) {
|
|
1253
|
+
return n.slice().map(function(t) {
|
|
1254
|
+
return typeof t == "string" || typeof t == "number" || t instanceof Date ? e.parseDate(t, void 0, !0) : t && typeof t == "object" && t.from && t.to ? {
|
|
1255
|
+
from: e.parseDate(t.from, void 0),
|
|
1256
|
+
to: e.parseDate(t.to, void 0)
|
|
1257
|
+
} : t;
|
|
1258
|
+
}).filter(function(t) {
|
|
1259
|
+
return t;
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
function Mn() {
|
|
1263
|
+
e.selectedDates = [], e.now = e.parseDate(e.config.now) || /* @__PURE__ */ new Date();
|
|
1264
|
+
var n = e.config.defaultDate || ((e.input.nodeName === "INPUT" || e.input.nodeName === "TEXTAREA") && e.input.placeholder && e.input.value === e.input.placeholder ? null : e.input.value);
|
|
1265
|
+
n && Qe(n, e.config.dateFormat), e._initialDate = e.selectedDates.length > 0 ? e.selectedDates[0] : e.config.minDate && e.config.minDate.getTime() > e.now.getTime() ? e.config.minDate : e.config.maxDate && e.config.maxDate.getTime() < e.now.getTime() ? e.config.maxDate : e.now, e.currentYear = e._initialDate.getFullYear(), e.currentMonth = e._initialDate.getMonth(), e.selectedDates.length > 0 && (e.latestSelectedDateObj = e.selectedDates[0]), e.config.minTime !== void 0 && (e.config.minTime = e.parseDate(e.config.minTime, "H:i")), e.config.maxTime !== void 0 && (e.config.maxTime = e.parseDate(e.config.maxTime, "H:i")), e.minDateHasTime = !!e.config.minDate && (e.config.minDate.getHours() > 0 || e.config.minDate.getMinutes() > 0 || e.config.minDate.getSeconds() > 0), e.maxDateHasTime = !!e.config.maxDate && (e.config.maxDate.getHours() > 0 || e.config.maxDate.getMinutes() > 0 || e.config.maxDate.getSeconds() > 0);
|
|
1266
|
+
}
|
|
1267
|
+
function En() {
|
|
1268
|
+
if (e.input = Ue(), !e.input) {
|
|
1269
|
+
e.config.errorHandler(new Error("Invalid input element specified"));
|
|
1270
|
+
return;
|
|
1271
|
+
}
|
|
1272
|
+
e.input._type = e.input.type, e.input.type = "text", e.input.classList.add("flatpickr-input"), e._input = e.input, e.config.altInput && (e.altInput = y(e.input.nodeName, e.config.altInputClass), e._input = e.altInput, e.altInput.placeholder = e.input.placeholder, e.altInput.disabled = e.input.disabled, e.altInput.required = e.input.required, e.altInput.tabIndex = e.input.tabIndex, e.altInput.type = "text", e.input.setAttribute("type", "hidden"), !e.config.static && e.input.parentNode && e.input.parentNode.insertBefore(e.altInput, e.input.nextSibling)), e.config.allowInput || e._input.setAttribute("readonly", "readonly"), $e();
|
|
1273
|
+
}
|
|
1274
|
+
function $e() {
|
|
1275
|
+
e._positionElement = e.config.positionElement || e._input;
|
|
1276
|
+
}
|
|
1277
|
+
function kn() {
|
|
1278
|
+
var n = e.config.enableTime ? e.config.noCalendar ? "time" : "datetime-local" : "date";
|
|
1279
|
+
e.mobileInput = y("input", e.input.className + " flatpickr-mobile"), e.mobileInput.tabIndex = 1, e.mobileInput.type = n, e.mobileInput.disabled = e.input.disabled, e.mobileInput.required = e.input.required, e.mobileInput.placeholder = e.input.placeholder, e.mobileFormatStr = n === "datetime-local" ? "Y-m-d\\TH:i:S" : n === "date" ? "Y-m-d" : "H:i:S", e.selectedDates.length > 0 && (e.mobileInput.defaultValue = e.mobileInput.value = e.formatDate(e.selectedDates[0], e.mobileFormatStr)), e.config.minDate && (e.mobileInput.min = e.formatDate(e.config.minDate, "Y-m-d")), e.config.maxDate && (e.mobileInput.max = e.formatDate(e.config.maxDate, "Y-m-d")), e.input.getAttribute("step") && (e.mobileInput.step = String(e.input.getAttribute("step"))), e.input.type = "hidden", e.altInput !== void 0 && (e.altInput.type = "hidden");
|
|
1280
|
+
try {
|
|
1281
|
+
e.input.parentNode && e.input.parentNode.insertBefore(e.mobileInput, e.input.nextSibling);
|
|
1282
|
+
} catch {
|
|
1283
|
+
}
|
|
1284
|
+
b(e.mobileInput, "change", function(t) {
|
|
1285
|
+
e.setDate(N(t).value, !1, e.mobileFormatStr), k("onChange"), k("onClose");
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
function xn(n) {
|
|
1289
|
+
if (e.isOpen === !0)
|
|
1290
|
+
return e.close();
|
|
1291
|
+
e.open(n);
|
|
1292
|
+
}
|
|
1293
|
+
function k(n, t) {
|
|
1294
|
+
if (e.config !== void 0) {
|
|
1295
|
+
var i = e.config[n];
|
|
1296
|
+
if (i !== void 0 && i.length > 0)
|
|
1297
|
+
for (var o = 0; i[o] && o < i.length; o++)
|
|
1298
|
+
i[o](e.selectedDates, e.input.value, e, t);
|
|
1299
|
+
n === "onChange" && (e.input.dispatchEvent(xe("change")), e.input.dispatchEvent(xe("input")));
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
function xe(n) {
|
|
1303
|
+
var t = document.createEvent("Event");
|
|
1304
|
+
return t.initEvent(n, !0, !0), t;
|
|
1305
|
+
}
|
|
1306
|
+
function _e(n) {
|
|
1307
|
+
for (var t = 0; t < e.selectedDates.length; t++) {
|
|
1308
|
+
var i = e.selectedDates[t];
|
|
1309
|
+
if (i instanceof Date && P(i, n) === 0)
|
|
1310
|
+
return "" + t;
|
|
1311
|
+
}
|
|
1312
|
+
return !1;
|
|
1313
|
+
}
|
|
1314
|
+
function _n(n) {
|
|
1315
|
+
return e.config.mode !== "range" || e.selectedDates.length < 2 ? !1 : P(n, e.selectedDates[0]) >= 0 && P(n, e.selectedDates[1]) <= 0;
|
|
1316
|
+
}
|
|
1317
|
+
function pe() {
|
|
1318
|
+
e.config.noCalendar || e.isMobile || !e.monthNav || (e.yearElements.forEach(function(n, t) {
|
|
1319
|
+
var i = new Date(e.currentYear, e.currentMonth, 1);
|
|
1320
|
+
i.setMonth(e.currentMonth + t), e.config.showMonths > 1 || e.config.monthSelectorType === "static" ? e.monthElements[t].textContent = ye(i.getMonth(), e.config.shorthandCurrentMonth, e.l10n) + " " : e.monthsDropdownContainer.value = i.getMonth().toString(), n.value = i.getFullYear().toString();
|
|
1321
|
+
}), e._hidePrevMonthArrow = e.config.minDate !== void 0 && (e.currentYear === e.config.minDate.getFullYear() ? e.currentMonth <= e.config.minDate.getMonth() : e.currentYear < e.config.minDate.getFullYear()), e._hideNextMonthArrow = e.config.maxDate !== void 0 && (e.currentYear === e.config.maxDate.getFullYear() ? e.currentMonth + 1 > e.config.maxDate.getMonth() : e.currentYear > e.config.maxDate.getFullYear()));
|
|
1322
|
+
}
|
|
1323
|
+
function Se(n) {
|
|
1324
|
+
var t = n || (e.config.altInput ? e.config.altFormat : e.config.dateFormat);
|
|
1325
|
+
return e.selectedDates.map(function(i) {
|
|
1326
|
+
return e.formatDate(i, t);
|
|
1327
|
+
}).filter(function(i, o, u) {
|
|
1328
|
+
return e.config.mode !== "range" || e.config.enableTime || u.indexOf(i) === o;
|
|
1329
|
+
}).join(e.config.mode !== "range" ? e.config.conjunction : e.l10n.rangeSeparator);
|
|
1330
|
+
}
|
|
1331
|
+
function V(n) {
|
|
1332
|
+
n === void 0 && (n = !0), e.mobileInput !== void 0 && e.mobileFormatStr && (e.mobileInput.value = e.latestSelectedDateObj !== void 0 ? e.formatDate(e.latestSelectedDateObj, e.mobileFormatStr) : ""), e.input.value = Se(e.config.dateFormat), e.altInput !== void 0 && (e.altInput.value = Se(e.config.altFormat)), n !== !1 && k("onValueUpdate");
|
|
1333
|
+
}
|
|
1334
|
+
function Sn(n) {
|
|
1335
|
+
var t = N(n), i = e.prevMonthNav.contains(t), o = e.nextMonthNav.contains(t);
|
|
1336
|
+
i || o ? Me(i ? -1 : 1) : e.yearElements.indexOf(t) >= 0 ? t.select() : t.classList.contains("arrowUp") ? e.changeYear(e.currentYear + 1) : t.classList.contains("arrowDown") && e.changeYear(e.currentYear - 1);
|
|
1337
|
+
}
|
|
1338
|
+
function Tn(n) {
|
|
1339
|
+
n.preventDefault();
|
|
1340
|
+
var t = n.type === "keydown", i = N(n), o = i;
|
|
1341
|
+
e.amPM !== void 0 && i === e.amPM && (e.amPM.textContent = e.l10n.amPM[H(e.amPM.textContent === e.l10n.amPM[0])]);
|
|
1342
|
+
var u = parseFloat(o.getAttribute("min")), s = parseFloat(o.getAttribute("max")), h = parseFloat(o.getAttribute("step")), c = parseInt(o.value, 10), v = n.delta || (t ? n.which === 38 ? 1 : -1 : 0), d = c + h * v;
|
|
1343
|
+
if (typeof o.value < "u" && o.value.length === 2) {
|
|
1344
|
+
var g = o === e.hourElement, C = o === e.minuteElement;
|
|
1345
|
+
d < u ? (d = s + d + H(!g) + (H(g) && H(!e.amPM)), C && G(void 0, -1, e.hourElement)) : d > s && (d = o === e.hourElement ? d - s - H(!e.amPM) : u, C && G(void 0, 1, e.hourElement)), e.amPM && g && (h === 1 ? d + c === 23 : Math.abs(d - c) > h) && (e.amPM.textContent = e.l10n.amPM[H(e.amPM.textContent === e.l10n.amPM[0])]), o.value = F(d);
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
return m(), e;
|
|
1349
|
+
}
|
|
1350
|
+
function te(a, r) {
|
|
1351
|
+
for (var e = Array.prototype.slice.call(a).filter(function(D) {
|
|
1352
|
+
return D instanceof HTMLElement;
|
|
1353
|
+
}), p = [], m = 0; m < e.length; m++) {
|
|
1354
|
+
var l = e[m];
|
|
1355
|
+
try {
|
|
1356
|
+
if (l.getAttribute("data-fp-omit") !== null)
|
|
1357
|
+
continue;
|
|
1358
|
+
l._flatpickr !== void 0 && (l._flatpickr.destroy(), l._flatpickr = void 0), l._flatpickr = $n(l, r || {}), p.push(l._flatpickr);
|
|
1359
|
+
} catch (D) {
|
|
1360
|
+
console.error(D);
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
return p.length === 1 ? p[0] : p;
|
|
1364
|
+
}
|
|
1365
|
+
typeof HTMLElement < "u" && typeof HTMLCollection < "u" && typeof NodeList < "u" && (HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function(a) {
|
|
1366
|
+
return te(this, a);
|
|
1367
|
+
}, HTMLElement.prototype.flatpickr = function(a) {
|
|
1368
|
+
return te([this], a);
|
|
1369
|
+
});
|
|
1370
|
+
var _ = function(a, r) {
|
|
1371
|
+
return typeof a == "string" ? te(window.document.querySelectorAll(a), r) : a instanceof Node ? te([a], r) : te(a, r);
|
|
1372
|
+
};
|
|
1373
|
+
_.defaultConfig = {};
|
|
1374
|
+
_.l10ns = {
|
|
1375
|
+
en: I({}, ue),
|
|
1376
|
+
default: I({}, ue)
|
|
1377
|
+
};
|
|
1378
|
+
_.localize = function(a) {
|
|
1379
|
+
_.l10ns.default = I(I({}, _.l10ns.default), a);
|
|
1380
|
+
};
|
|
1381
|
+
_.setDefaults = function(a) {
|
|
1382
|
+
_.defaultConfig = I(I({}, _.defaultConfig), a);
|
|
1383
|
+
};
|
|
1384
|
+
_.parseDate = Ve({});
|
|
1385
|
+
_.formatDate = on({});
|
|
1386
|
+
_.compareDates = P;
|
|
1387
|
+
typeof jQuery < "u" && typeof jQuery.fn < "u" && (jQuery.fn.flatpickr = function(a) {
|
|
1388
|
+
return te(this, a);
|
|
1389
|
+
});
|
|
1390
|
+
Date.prototype.fp_incr = function(a) {
|
|
1391
|
+
return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof a == "string" ? parseInt(a, 10) : a));
|
|
1392
|
+
};
|
|
1393
|
+
typeof window < "u" && (window.flatpickr = _);
|
|
1394
|
+
var be = { exports: {} }, et = be.exports, an;
|
|
1395
|
+
function nt() {
|
|
1396
|
+
return an || (an = 1, (function(a, r) {
|
|
1397
|
+
(function(e, p) {
|
|
1398
|
+
a.exports = p();
|
|
1399
|
+
})(et, (function() {
|
|
1400
|
+
/*! *****************************************************************************
|
|
1401
|
+
Copyright (c) Microsoft Corporation.
|
|
1402
|
+
|
|
1403
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
1404
|
+
purpose with or without fee is hereby granted.
|
|
1405
|
+
|
|
1406
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1407
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1408
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1409
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1410
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1411
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1412
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
1413
|
+
***************************************************************************** */
|
|
1414
|
+
function e() {
|
|
1415
|
+
for (var m = 0, l = 0, D = arguments.length; l < D; l++) m += arguments[l].length;
|
|
1416
|
+
for (var f = Array(m), w = 0, l = 0; l < D; l++)
|
|
1417
|
+
for (var E = arguments[l], M = 0, T = E.length; M < T; M++, w++)
|
|
1418
|
+
f[w] = E[M];
|
|
1419
|
+
return f;
|
|
1420
|
+
}
|
|
1421
|
+
function p(m) {
|
|
1422
|
+
return m === void 0 && (m = {}), function(l) {
|
|
1423
|
+
var D = "", f, w, E, M = function() {
|
|
1424
|
+
if (m.input) {
|
|
1425
|
+
if (f = m.input instanceof Element ? m.input : window.document.querySelector(m.input), !f) {
|
|
1426
|
+
l.config.errorHandler(new Error("Invalid input element specified"));
|
|
1427
|
+
return;
|
|
1428
|
+
}
|
|
1429
|
+
l.config.wrap && (f = f.querySelector("[data-input]"));
|
|
1430
|
+
} else
|
|
1431
|
+
f = l._input.cloneNode(), f.removeAttribute("id"), f._flatpickr = void 0;
|
|
1432
|
+
if (f.value) {
|
|
1433
|
+
var x = l.parseDate(f.value);
|
|
1434
|
+
x && l.selectedDates.push(x);
|
|
1435
|
+
}
|
|
1436
|
+
f.setAttribute("data-fp-omit", ""), l.config.clickOpens && (l._bind(f, ["focus", "click"], function() {
|
|
1437
|
+
l.selectedDates[1] && (l.latestSelectedDateObj = l.selectedDates[1], l._setHoursFromDate(l.selectedDates[1]), l.jumpToDate(l.selectedDates[1])), w = !0, l.isOpen = !1, l.open(void 0, m.position === "left" ? l._input : f);
|
|
1438
|
+
}), l._bind(l._input, ["focus", "click"], function(S) {
|
|
1439
|
+
S.preventDefault(), l.isOpen = !1, l.open();
|
|
1440
|
+
})), l.config.allowInput && l._bind(f, "keydown", function(S) {
|
|
1441
|
+
S.key === "Enter" && (l.setDate([l.selectedDates[0], f.value], !0, D), f.click());
|
|
1442
|
+
}), m.input || l._input.parentNode && l._input.parentNode.insertBefore(f, l._input.nextSibling);
|
|
1443
|
+
}, T = {
|
|
1444
|
+
onParseConfig: function() {
|
|
1445
|
+
l.config.mode = "range", D = l.config.altInput ? l.config.altFormat : l.config.dateFormat;
|
|
1446
|
+
},
|
|
1447
|
+
onReady: function() {
|
|
1448
|
+
M(), l.config.ignoredFocusElements.push(f), l.config.allowInput ? (l._input.removeAttribute("readonly"), f.removeAttribute("readonly")) : f.setAttribute("readonly", "readonly"), l._bind(l._input, "focus", function() {
|
|
1449
|
+
l.latestSelectedDateObj = l.selectedDates[0], l._setHoursFromDate(l.selectedDates[0]), w = !1, l.jumpToDate(l.selectedDates[0]);
|
|
1450
|
+
}), l.config.allowInput && l._bind(l._input, "keydown", function(x) {
|
|
1451
|
+
x.key === "Enter" && l.setDate([l._input.value, l.selectedDates[1]], !0, D);
|
|
1452
|
+
}), l.setDate(l.selectedDates, !1), T.onValueUpdate(l.selectedDates), l.loadedPlugins.push("range");
|
|
1453
|
+
},
|
|
1454
|
+
onPreCalendarPosition: function() {
|
|
1455
|
+
w && (l._positionElement = f, setTimeout(function() {
|
|
1456
|
+
l._positionElement = l._input;
|
|
1457
|
+
}, 0));
|
|
1458
|
+
},
|
|
1459
|
+
onChange: function() {
|
|
1460
|
+
l.selectedDates.length || setTimeout(function() {
|
|
1461
|
+
l.selectedDates.length || (f.value = "", E = []);
|
|
1462
|
+
}, 10), w && setTimeout(function() {
|
|
1463
|
+
f.focus();
|
|
1464
|
+
}, 0);
|
|
1465
|
+
},
|
|
1466
|
+
onDestroy: function() {
|
|
1467
|
+
m.input || f.parentNode && f.parentNode.removeChild(f);
|
|
1468
|
+
},
|
|
1469
|
+
onValueUpdate: function(x) {
|
|
1470
|
+
var S, K, b;
|
|
1471
|
+
if (f) {
|
|
1472
|
+
if (E = !E || x.length >= E.length ? e(x) : E, E.length > x.length) {
|
|
1473
|
+
var L = x[0], Y = w ? [E[0], L] : [L, E[1]];
|
|
1474
|
+
Y[0].getTime() > Y[1].getTime() && (w ? Y[0] = Y[1] : Y[1] = Y[0]), l.setDate(Y, !1), E = e(Y);
|
|
1475
|
+
}
|
|
1476
|
+
S = l.selectedDates.map(function(j) {
|
|
1477
|
+
return l.formatDate(j, D);
|
|
1478
|
+
}), K = S[0], l._input.value = K === void 0 ? "" : K, b = S[1], f.value = b === void 0 ? "" : b;
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
};
|
|
1482
|
+
return T;
|
|
1483
|
+
};
|
|
1484
|
+
}
|
|
1485
|
+
return p;
|
|
1486
|
+
}));
|
|
1487
|
+
})(be)), be.exports;
|
|
1488
|
+
}
|
|
1489
|
+
var tt = nt();
|
|
1490
|
+
const at = /* @__PURE__ */ Wn(tt), it = "single", Re = "range", rt = {
|
|
1491
|
+
props: {
|
|
1492
|
+
name: {
|
|
1493
|
+
type: String,
|
|
1494
|
+
default: "Date"
|
|
1495
|
+
},
|
|
1496
|
+
modelValue: [String, Array],
|
|
1497
|
+
value: [String, Array],
|
|
1498
|
+
placeholder: {
|
|
1499
|
+
type: String,
|
|
1500
|
+
default: ""
|
|
1501
|
+
},
|
|
1502
|
+
endDatePlaceholder: {
|
|
1503
|
+
type: String,
|
|
1504
|
+
default: ""
|
|
1505
|
+
},
|
|
1506
|
+
required: {
|
|
1507
|
+
type: Boolean,
|
|
1508
|
+
default: !1
|
|
1509
|
+
},
|
|
1510
|
+
config: {
|
|
1511
|
+
type: Object,
|
|
1512
|
+
default: () => {
|
|
1513
|
+
}
|
|
1514
|
+
},
|
|
1515
|
+
mode: {
|
|
1516
|
+
type: String,
|
|
1517
|
+
default: it
|
|
1518
|
+
},
|
|
1519
|
+
ariaLabel: {
|
|
1520
|
+
type: String,
|
|
1521
|
+
default: ""
|
|
1522
|
+
},
|
|
1523
|
+
endDateAriaLabel: {
|
|
1524
|
+
type: String,
|
|
1525
|
+
default: ""
|
|
1526
|
+
},
|
|
1527
|
+
label: {
|
|
1528
|
+
type: String,
|
|
1529
|
+
default: ""
|
|
1530
|
+
},
|
|
1531
|
+
endDateLabel: {
|
|
1532
|
+
type: String,
|
|
1533
|
+
default: ""
|
|
1534
|
+
},
|
|
1535
|
+
supportText: {
|
|
1536
|
+
type: String,
|
|
1537
|
+
default: ""
|
|
1538
|
+
},
|
|
1539
|
+
endDateSupportText: {
|
|
1540
|
+
type: String,
|
|
1541
|
+
default: ""
|
|
1542
|
+
},
|
|
1543
|
+
errorMessage: {
|
|
1544
|
+
type: String,
|
|
1545
|
+
default: ""
|
|
1546
|
+
},
|
|
1547
|
+
disabled: {
|
|
1548
|
+
type: Boolean,
|
|
1549
|
+
default: !1
|
|
1550
|
+
}
|
|
1551
|
+
},
|
|
1552
|
+
mounted() {
|
|
1553
|
+
document.addEventListener("keyup", this.onDocumentKeyDown, !0), this.$refs.inputsWrapper.addEventListener("keyup", this.backspaceHandler), this.$nextTick(() => {
|
|
1554
|
+
this.initFlatpickr();
|
|
1555
|
+
});
|
|
1556
|
+
},
|
|
1557
|
+
watch: {
|
|
1558
|
+
config() {
|
|
1559
|
+
this.initFlatpickr();
|
|
1560
|
+
},
|
|
1561
|
+
value() {
|
|
1562
|
+
this.initFlatpickr();
|
|
1563
|
+
},
|
|
1564
|
+
disabled() {
|
|
1565
|
+
this.$nextTick(() => {
|
|
1566
|
+
this.initFlatpickr();
|
|
1567
|
+
});
|
|
1568
|
+
},
|
|
1569
|
+
modelValue() {
|
|
1570
|
+
var r;
|
|
1571
|
+
if (JSON.stringify(this.modelValue) === JSON.stringify(this.data)) return;
|
|
1572
|
+
let a;
|
|
1573
|
+
Array.isArray(this.modelValue) ? a = this.modelValue[0] && this.modelValue[1] ? this.modelValue : [] : a = this.modelValue, (r = this.flat) == null || r.setDate(a, !0);
|
|
1574
|
+
}
|
|
1575
|
+
},
|
|
1576
|
+
data() {
|
|
1577
|
+
return {
|
|
1578
|
+
pickerOptions: {},
|
|
1579
|
+
data: this.modelValue,
|
|
1580
|
+
flat: null,
|
|
1581
|
+
isOpen: !1,
|
|
1582
|
+
isOpenEndDate: !1
|
|
1583
|
+
};
|
|
1584
|
+
},
|
|
1585
|
+
methods: {
|
|
1586
|
+
initFlatpickr() {
|
|
1587
|
+
this.flat = new _(this.$refs.date, this.pickerConfigs());
|
|
1588
|
+
},
|
|
1589
|
+
pickerConfigs() {
|
|
1590
|
+
var p, m;
|
|
1591
|
+
const a = document.querySelectorAll(".calendar-icon");
|
|
1592
|
+
let r = {
|
|
1593
|
+
dateFormat: "Y-m-d",
|
|
1594
|
+
altInput: !0,
|
|
1595
|
+
altFormat: "Y-m-d",
|
|
1596
|
+
position: "left",
|
|
1597
|
+
mode: this.mode,
|
|
1598
|
+
appendTo: this.$refs.dropdown,
|
|
1599
|
+
prevArrow: Kn,
|
|
1600
|
+
nextArrow: Bn,
|
|
1601
|
+
ignoredFocusElements: Array.from(a),
|
|
1602
|
+
locale: {
|
|
1603
|
+
weekdays: {
|
|
1604
|
+
shorthand: ["S", "M", "T", "W", "T", "F", "S"],
|
|
1605
|
+
longhand: [
|
|
1606
|
+
"Sunday",
|
|
1607
|
+
"Monday",
|
|
1608
|
+
"Tuesday",
|
|
1609
|
+
"Wednesday",
|
|
1610
|
+
"Thursday",
|
|
1611
|
+
"Friday",
|
|
1612
|
+
"Saturday"
|
|
1613
|
+
]
|
|
1614
|
+
}
|
|
1615
|
+
},
|
|
1616
|
+
onReady(l, D, f) {
|
|
1617
|
+
f.setDate(D, !0);
|
|
1618
|
+
},
|
|
1619
|
+
onChange: (l, D) => this.onChange(D),
|
|
1620
|
+
onClose: () => this.onClose()
|
|
1621
|
+
};
|
|
1622
|
+
this.mode === Re && (r.plugins = [new at({ input: this.$refs.toDate })]), (this.value || this.modelValue) && (this.mode === Re ? r.defaultDate = this.modelValue.length ? [this.modelValue[0], this.modelValue[1]] : [(p = this.value) == null ? void 0 : p[0], (m = this.value) == null ? void 0 : m[1]] : r.defaultDate = this.modelValue ? this.modelValue : this.value);
|
|
1623
|
+
const e = Object.assign({}, r, this.config);
|
|
1624
|
+
return this.pickerOptions = e, e;
|
|
1625
|
+
},
|
|
1626
|
+
onClose() {
|
|
1627
|
+
this.triggerChange(), this.$nextTick(() => {
|
|
1628
|
+
this.isOpen = !1, this.isOpenEndDate = !1, this.$emit("blur");
|
|
1629
|
+
});
|
|
1630
|
+
},
|
|
1631
|
+
onChange(a) {
|
|
1632
|
+
this.mode === Re ? this.data = a.split(" to ") : this.data = a;
|
|
1633
|
+
},
|
|
1634
|
+
onDocumentKeyDown(a) {
|
|
1635
|
+
a.keyCode === Jn && this.onClose();
|
|
1636
|
+
},
|
|
1637
|
+
onKeydownEndField(a) {
|
|
1638
|
+
a.key === "ArrowDown" && this.flat.selectedDateElem.focus();
|
|
1639
|
+
},
|
|
1640
|
+
backspaceHandler(a) {
|
|
1641
|
+
a.keyCode === qn && (this.$emit("input", ""), this.$emit("update:modelValue", ""));
|
|
1642
|
+
},
|
|
1643
|
+
triggerChange() {
|
|
1644
|
+
setTimeout(() => {
|
|
1645
|
+
if (this.pickerOptions.mode === "range") {
|
|
1646
|
+
let a = this.data;
|
|
1647
|
+
a.length < 2 ? (this.$emit("input", ""), this.$emit("update:modelValue", this.data)) : (this.$emit("input", [a[0], a[1]]), this.$emit("update:modelValue", this.data));
|
|
1648
|
+
} else
|
|
1649
|
+
this.data === "" ? (this.$emit("input", ""), this.$emit("update:modelValue", this.data)) : (this.$emit("input", this.data), this.$emit("update:modelValue", this.data)), this.$emit("blur");
|
|
1650
|
+
});
|
|
1651
|
+
},
|
|
1652
|
+
open() {
|
|
1653
|
+
this.isOpen || (this.isOpen = !0, this.isOpenEndDate = !1, this.flat.open());
|
|
1654
|
+
},
|
|
1655
|
+
openEndDate() {
|
|
1656
|
+
this.isOpen = !1, this.isOpenEndDate = !0, this.$refs.toDate.click();
|
|
1657
|
+
}
|
|
1658
|
+
},
|
|
1659
|
+
computed: {
|
|
1660
|
+
values() {
|
|
1661
|
+
var a;
|
|
1662
|
+
return this.data ? (a = this.data) == null ? void 0 : a.split(" to ") : [];
|
|
1663
|
+
}
|
|
1664
|
+
},
|
|
1665
|
+
beforeUnmount() {
|
|
1666
|
+
document.removeEventListener("keyup", this.onDocumentKeyDown), this.$refs.inputsWrapper.removeEventListener("keyup", this.backspaceHandler);
|
|
1667
|
+
},
|
|
1668
|
+
components: {
|
|
1669
|
+
IbIcon: jn,
|
|
1670
|
+
IbLabel: Rn,
|
|
1671
|
+
IbAlert: Vn
|
|
1672
|
+
},
|
|
1673
|
+
emits: ["input", "update:modelValue"]
|
|
1674
|
+
}, ot = {
|
|
1675
|
+
ref: "inputsWrapper",
|
|
1676
|
+
class: "inputs-wrapper"
|
|
1677
|
+
}, lt = { class: "input-group-wrapper" }, ut = ["aria-label"], st = ["placeholder", "name", "disabled"], dt = {
|
|
1678
|
+
ref: "dropdown",
|
|
1679
|
+
class: "dropdown"
|
|
1680
|
+
}, ct = {
|
|
1681
|
+
key: 1,
|
|
1682
|
+
class: "support-text"
|
|
1683
|
+
}, ft = {
|
|
1684
|
+
key: 0,
|
|
1685
|
+
class: "input-group-wrapper"
|
|
1686
|
+
}, mt = ["aria-label"], gt = ["placeholder"], pt = {
|
|
1687
|
+
key: 1,
|
|
1688
|
+
class: "support-text"
|
|
1689
|
+
};
|
|
1690
|
+
function ht(a, r, e, p, m, l) {
|
|
1691
|
+
const D = Ie("ib-alert"), f = Ie("ib-label"), w = Ie("ib-icon");
|
|
1692
|
+
return U(), he("div", {
|
|
1693
|
+
class: Oe(["ib-flatpickr-wrapper", {
|
|
1694
|
+
"has-labels": e.label.length || e.endDateLabel.length,
|
|
1695
|
+
"has-label": e.label.length,
|
|
1696
|
+
"has-error": e.errorMessage.length,
|
|
1697
|
+
"is-disabled": e.disabled,
|
|
1698
|
+
"is-range": e.mode === "range"
|
|
1699
|
+
}])
|
|
1700
|
+
}, [
|
|
1701
|
+
e.errorMessage.length ? (U(), Fe(D, {
|
|
1702
|
+
key: 0,
|
|
1703
|
+
class: "error-message"
|
|
1704
|
+
}, {
|
|
1705
|
+
default: Ae(() => [
|
|
1706
|
+
Ne(oe(e.errorMessage), 1)
|
|
1707
|
+
]),
|
|
1708
|
+
_: 1
|
|
1709
|
+
})) : ee("", !0),
|
|
1710
|
+
W("div", ot, [
|
|
1711
|
+
W("div", lt, [
|
|
1712
|
+
e.label.length ? (U(), Fe(f, {
|
|
1713
|
+
key: 0,
|
|
1714
|
+
class: "label",
|
|
1715
|
+
required: e.required
|
|
1716
|
+
}, {
|
|
1717
|
+
default: Ae(() => [
|
|
1718
|
+
Ne(oe(e.label), 1)
|
|
1719
|
+
]),
|
|
1720
|
+
_: 1
|
|
1721
|
+
}, 8, ["required"])) : ee("", !0),
|
|
1722
|
+
W("div", {
|
|
1723
|
+
class: Oe(["input-wrapper", { active: m.isOpen }]),
|
|
1724
|
+
onClick: r[0] || (r[0] = (...E) => l.open && l.open(...E))
|
|
1725
|
+
}, [
|
|
1726
|
+
W("label", { "aria-label": e.ariaLabel }, [
|
|
1727
|
+
W("input", {
|
|
1728
|
+
placeholder: e.placeholder,
|
|
1729
|
+
name: e.name,
|
|
1730
|
+
ref: "date",
|
|
1731
|
+
id: "date",
|
|
1732
|
+
disabled: e.disabled,
|
|
1733
|
+
class: "date-picker-input"
|
|
1734
|
+
}, null, 8, st)
|
|
1735
|
+
], 8, ut),
|
|
1736
|
+
en(w, {
|
|
1737
|
+
name: "today-outline",
|
|
1738
|
+
class: "calendar-icon"
|
|
1739
|
+
})
|
|
1740
|
+
], 2),
|
|
1741
|
+
W("div", dt, null, 512),
|
|
1742
|
+
e.supportText.length ? (U(), he("p", ct, oe(e.supportText), 1)) : ee("", !0)
|
|
1743
|
+
]),
|
|
1744
|
+
e.mode === "range" ? (U(), he("div", ft, [
|
|
1745
|
+
e.endDateLabel.length ? (U(), Fe(f, {
|
|
1746
|
+
key: 0,
|
|
1747
|
+
class: "end-date-label label",
|
|
1748
|
+
required: e.required
|
|
1749
|
+
}, {
|
|
1750
|
+
default: Ae(() => [
|
|
1751
|
+
Ne(oe(e.endDateLabel), 1)
|
|
1752
|
+
]),
|
|
1753
|
+
_: 1
|
|
1754
|
+
}, 8, ["required"])) : ee("", !0),
|
|
1755
|
+
W("div", {
|
|
1756
|
+
class: Oe(["input-wrapper", { active: m.isOpenEndDate }]),
|
|
1757
|
+
onClick: r[2] || (r[2] = (...E) => l.openEndDate && l.openEndDate(...E))
|
|
1758
|
+
}, [
|
|
1759
|
+
W("label", { "aria-label": e.endDateAriaLabel }, [
|
|
1760
|
+
W("input", {
|
|
1761
|
+
class: "date-picker-input",
|
|
1762
|
+
placeholder: e.endDatePlaceholder,
|
|
1763
|
+
ref: "toDate",
|
|
1764
|
+
onKeydown: r[1] || (r[1] = (...E) => l.onKeydownEndField && l.onKeydownEndField(...E))
|
|
1765
|
+
}, null, 40, gt)
|
|
1766
|
+
], 8, mt),
|
|
1767
|
+
en(w, {
|
|
1768
|
+
name: "today-outline",
|
|
1769
|
+
class: "calendar-icon"
|
|
1770
|
+
})
|
|
1771
|
+
], 2),
|
|
1772
|
+
e.endDateSupportText.length ? (U(), he("p", pt, oe(e.endDateSupportText), 1)) : ee("", !0)
|
|
1773
|
+
])) : ee("", !0)
|
|
1774
|
+
], 512)
|
|
1775
|
+
], 2);
|
|
1776
|
+
}
|
|
1777
|
+
const xt = /* @__PURE__ */ Un(rt, [["render", ht]]);
|
|
1778
|
+
export {
|
|
1779
|
+
Re as RANGE_MODE,
|
|
1780
|
+
it as SINGLE_MODE,
|
|
1781
|
+
xt as default
|
|
1782
|
+
};
|