@featherk/composables 0.9.8 → 0.10.1
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/README.md +11 -0
- package/dist/featherk-composables.es.js +939 -863
- package/dist/featherk-composables.es.js.map +1 -1
- package/dist/featherk-composables.umd.js +1 -1
- package/dist/featherk-composables.umd.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/menu/index.d.ts +1 -0
- package/dist/menu/usePopupMenu.d.ts +81 -0
- package/dist/menu/usePopupMenu.test.d.ts +1 -0
- package/docs/menu/usePopupMenu.md +146 -0
- package/docs/range/useMaskedDateRangeInput.md +6 -3
- package/package.json +6 -1
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { ref as U, onBeforeUnmount as
|
|
1
|
+
import { ref as U, onBeforeUnmount as Le, nextTick as B, computed as f, watchEffect as Fe, toValue as le, reactive as qe, watch as ue, getCurrentScope as Oe, onScopeDispose as Ue, unref as Be, onMounted as Ie, readonly as G, shallowRef as Ke } from "vue";
|
|
2
2
|
import { useFocusTrap as Ne } from "@vueuse/integrations/useFocusTrap";
|
|
3
|
-
const
|
|
3
|
+
const ft = (e, t) => {
|
|
4
4
|
const l = U(null);
|
|
5
|
-
let
|
|
6
|
-
const
|
|
5
|
+
let A = !1, m = null, g = null;
|
|
6
|
+
const I = [], b = ".k-table-row[data-grid-row-index] [tabindex]", M = () => {
|
|
7
7
|
const o = e?.value?.$el;
|
|
8
8
|
return o ? o.closest(".k-grid") : null;
|
|
9
|
-
},
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
return
|
|
9
|
+
}, $ = (o) => {
|
|
10
|
+
const w = M();
|
|
11
|
+
if (!w) return !1;
|
|
12
|
+
const c = o.closest(".k-grid-aria-root");
|
|
13
|
+
if (c)
|
|
14
|
+
return w.contains(c);
|
|
15
15
|
const p = o.closest(
|
|
16
16
|
".k-grid-header, .k-grid-content, .k-grid-content-locked"
|
|
17
17
|
);
|
|
18
|
-
return p ?
|
|
19
|
-
},
|
|
20
|
-
const
|
|
21
|
-
([" ", "Spacebar", "Space"].includes(
|
|
22
|
-
},
|
|
18
|
+
return p ? w.contains(p) : !1;
|
|
19
|
+
}, h = (o) => o.key === "Enter" || o.code === "Enter" || o.code === "NumpadEnter", P = () => e?.value?.columns, E = (o) => {
|
|
20
|
+
const w = o.key || o.code;
|
|
21
|
+
([" ", "Spacebar", "Space"].includes(w) || h(o)) && (o.preventDefault(), o.stopPropagation(), l.value = o.target, o.target.click());
|
|
22
|
+
}, u = (o) => {
|
|
23
23
|
if (!l.value) return;
|
|
24
24
|
if (o.code === "Escape") {
|
|
25
25
|
o.stopPropagation(), l.value && l.value.focus();
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const w = Array.from(
|
|
29
29
|
document.querySelectorAll(
|
|
30
30
|
".k-animation-container .k-popup .k-column-menu .k-columnmenu-item-wrapper .k-columnmenu-item"
|
|
31
31
|
)
|
|
32
|
-
),
|
|
32
|
+
), c = document.querySelector(
|
|
33
33
|
".k-animation-container .k-popup .k-column-menu .k-filter-menu-container"
|
|
34
34
|
);
|
|
35
|
-
if (
|
|
35
|
+
if (c) {
|
|
36
36
|
if (o.code === "Tab") {
|
|
37
37
|
const p = [
|
|
38
38
|
// ".k-filter-menu-container .k-dropdownlist[tabindex='0']",
|
|
@@ -43,23 +43,23 @@ const ct = (e, t) => {
|
|
|
43
43
|
"input.k-input-inner:not([tabindex='-1']):not([disabled])",
|
|
44
44
|
"button:not([tabindex='-1']):not([disabled])",
|
|
45
45
|
".k-checkbox"
|
|
46
|
-
],
|
|
47
|
-
|
|
46
|
+
], x = t?.focusableMenuSelectors ?? p, y = Array.from(
|
|
47
|
+
c.querySelectorAll(x.join(","))
|
|
48
48
|
);
|
|
49
|
-
if (
|
|
50
|
-
const
|
|
49
|
+
if (y.length === 0) return;
|
|
50
|
+
const C = y.findIndex(
|
|
51
51
|
(Y) => Y === document.activeElement
|
|
52
52
|
);
|
|
53
53
|
let L;
|
|
54
|
-
|
|
54
|
+
C === -1 ? L = 0 : o.shiftKey ? L = (C - 1 + y.length) % y.length : L = (C + 1) % y.length, o.preventDefault(), o.stopPropagation(), y[L]?.focus();
|
|
55
55
|
}
|
|
56
56
|
} else if (o.code === "ArrowUp" || o.code === "ArrowDown") {
|
|
57
57
|
o.preventDefault(), o.stopPropagation();
|
|
58
|
-
const p =
|
|
59
|
-
(
|
|
58
|
+
const p = w.findIndex(
|
|
59
|
+
(y) => y === document.activeElement
|
|
60
60
|
);
|
|
61
|
-
let
|
|
62
|
-
o.code === "ArrowUp" ?
|
|
61
|
+
let x = p;
|
|
62
|
+
o.code === "ArrowUp" ? x = p > 0 ? p - 1 : w.length - 1 : o.code === "ArrowDown" && (x = p < w.length - 1 ? p + 1 : 0), w[x]?.focus();
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
if (o.code === "Tab") {
|
|
@@ -69,15 +69,15 @@ const ct = (e, t) => {
|
|
|
69
69
|
"button, [role='button'], .k-link"
|
|
70
70
|
)?.focus();
|
|
71
71
|
}
|
|
72
|
-
},
|
|
72
|
+
}, S = () => {
|
|
73
73
|
m = new MutationObserver((o) => {
|
|
74
|
-
o.forEach((
|
|
75
|
-
|
|
76
|
-
if (
|
|
77
|
-
const p =
|
|
74
|
+
o.forEach((w) => {
|
|
75
|
+
w.addedNodes.forEach((c) => {
|
|
76
|
+
if (c.nodeType === Node.ELEMENT_NODE) {
|
|
77
|
+
const p = c;
|
|
78
78
|
if (p.classList.contains("k-animation-container")) {
|
|
79
|
-
const
|
|
80
|
-
|
|
79
|
+
const y = l.value;
|
|
80
|
+
y && (y.dataset.featherKSortable === "true" || B(() => {
|
|
81
81
|
p.querySelectorAll(
|
|
82
82
|
".k-columnmenu-item-wrapper"
|
|
83
83
|
).forEach((Y) => {
|
|
@@ -85,46 +85,46 @@ const ct = (e, t) => {
|
|
|
85
85
|
});
|
|
86
86
|
})), p.addEventListener(
|
|
87
87
|
"keydown",
|
|
88
|
-
|
|
89
|
-
),
|
|
90
|
-
const
|
|
88
|
+
u
|
|
89
|
+
), B(() => {
|
|
90
|
+
const C = () => {
|
|
91
91
|
const L = Array.from(
|
|
92
92
|
p.querySelectorAll(
|
|
93
93
|
".k-animation-container .k-popup .k-column-menu .k-columnmenu-item-wrapper .k-columnmenu-item"
|
|
94
94
|
)
|
|
95
95
|
);
|
|
96
96
|
if (L.length === 1)
|
|
97
|
-
L[0].focus(), L[0].click(),
|
|
97
|
+
L[0].focus(), L[0].click(), C.attempts = 0;
|
|
98
98
|
else if (L.length > 1) {
|
|
99
|
-
|
|
99
|
+
C.attempts = 0;
|
|
100
100
|
return;
|
|
101
101
|
} else
|
|
102
|
-
|
|
102
|
+
C.attempts === void 0 && (C.attempts = 0), C.attempts++ < 3 && setTimeout(C, 200);
|
|
103
103
|
};
|
|
104
|
-
|
|
104
|
+
C();
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
p.querySelectorAll(
|
|
108
108
|
".k-animation-container"
|
|
109
|
-
).forEach((
|
|
110
|
-
|
|
109
|
+
).forEach((y) => {
|
|
110
|
+
y.addEventListener(
|
|
111
111
|
"keydown",
|
|
112
|
-
|
|
112
|
+
u
|
|
113
113
|
);
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
}),
|
|
117
|
-
if (
|
|
118
|
-
const p =
|
|
116
|
+
}), w.removedNodes.forEach((c) => {
|
|
117
|
+
if (c.nodeType === Node.ELEMENT_NODE) {
|
|
118
|
+
const p = c;
|
|
119
119
|
p.classList.contains("k-animation-container") && p.removeEventListener(
|
|
120
120
|
"keydown",
|
|
121
|
-
|
|
121
|
+
u
|
|
122
122
|
), p.querySelectorAll(
|
|
123
123
|
".k-animation-container"
|
|
124
|
-
).forEach((
|
|
125
|
-
|
|
124
|
+
).forEach((y) => {
|
|
125
|
+
y.removeEventListener(
|
|
126
126
|
"keydown",
|
|
127
|
-
|
|
127
|
+
u
|
|
128
128
|
);
|
|
129
129
|
});
|
|
130
130
|
}
|
|
@@ -134,38 +134,38 @@ const ct = (e, t) => {
|
|
|
134
134
|
childList: !0,
|
|
135
135
|
subtree: !0
|
|
136
136
|
});
|
|
137
|
-
},
|
|
138
|
-
const
|
|
139
|
-
return !!(["input", "textarea", "select", "button"].includes(
|
|
137
|
+
}, Z = (o) => {
|
|
138
|
+
const w = o.tagName.toLowerCase();
|
|
139
|
+
return !!(["input", "textarea", "select", "button"].includes(w) || o.closest(
|
|
140
140
|
'.k-picker-wrap, .k-input-inner, .k-textbox, [role="combobox"]'
|
|
141
141
|
));
|
|
142
|
-
},
|
|
142
|
+
}, v = (o) => {
|
|
143
143
|
if (!o.type || !o)
|
|
144
144
|
return;
|
|
145
|
-
const
|
|
146
|
-
if (!
|
|
147
|
-
const
|
|
145
|
+
const w = o.target;
|
|
146
|
+
if (!w) return;
|
|
147
|
+
const c = w.closest(
|
|
148
148
|
".k-table-row[data-grid-row-index]"
|
|
149
149
|
);
|
|
150
|
-
if (
|
|
150
|
+
if (!$(w))
|
|
151
151
|
return;
|
|
152
152
|
const p = ["ArrowLeft", "ArrowRight"].includes(
|
|
153
153
|
o.code
|
|
154
154
|
);
|
|
155
|
-
if (!(
|
|
155
|
+
if (!(Z(w) && !(c && p))) {
|
|
156
156
|
if (o.code === "Escape") {
|
|
157
|
-
const
|
|
158
|
-
if (
|
|
157
|
+
const x = document.activeElement?.closest(".k-table-row[data-grid-row-index]");
|
|
158
|
+
if (x) {
|
|
159
159
|
o.preventDefault(), o.stopPropagation();
|
|
160
160
|
try {
|
|
161
161
|
Array.from(
|
|
162
162
|
e?.value.$el.querySelectorAll(
|
|
163
163
|
".k-table-row[data-grid-row-index]"
|
|
164
164
|
)
|
|
165
|
-
).forEach((
|
|
165
|
+
).forEach((C) => C.setAttribute("tabindex", "-1"));
|
|
166
166
|
} catch {
|
|
167
167
|
}
|
|
168
|
-
|
|
168
|
+
x.setAttribute("tabindex", "0"), x.focus();
|
|
169
169
|
return;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
@@ -178,15 +178,15 @@ const ct = (e, t) => {
|
|
|
178
178
|
"NumpadEnter",
|
|
179
179
|
"Space"
|
|
180
180
|
].includes(o.code)) {
|
|
181
|
-
if (
|
|
182
|
-
l.value =
|
|
181
|
+
if (w.classList.contains("k-grid-header-menu") && w.classList.contains("k-grid-column-menu")) {
|
|
182
|
+
l.value = w;
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
if (
|
|
185
|
+
if (c) {
|
|
186
186
|
if (["ArrowDown", "ArrowUp"].includes(o.code)) {
|
|
187
187
|
o.preventDefault(), o.stopPropagation();
|
|
188
|
-
const
|
|
189
|
-
let Y = L === "next" ?
|
|
188
|
+
const x = (C, L) => {
|
|
189
|
+
let Y = L === "next" ? C.nextElementSibling : C.previousElementSibling;
|
|
190
190
|
for (; Y; ) {
|
|
191
191
|
const ae = Y;
|
|
192
192
|
try {
|
|
@@ -197,35 +197,35 @@ const ct = (e, t) => {
|
|
|
197
197
|
Y = L === "next" ? Y.nextElementSibling : Y.previousElementSibling;
|
|
198
198
|
}
|
|
199
199
|
return null;
|
|
200
|
-
},
|
|
201
|
-
|
|
200
|
+
}, y = o.code === "ArrowDown" ? x(c, "next") : x(c, "previous");
|
|
201
|
+
y && (c.setAttribute("tabindex", "-1"), y.setAttribute("tabindex", "0"), y.focus());
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
204
|
if (["ArrowLeft", "ArrowRight"].includes(o.code)) {
|
|
205
205
|
o.preventDefault(), o.stopPropagation();
|
|
206
|
-
const
|
|
207
|
-
|
|
206
|
+
const x = c.querySelectorAll(
|
|
207
|
+
b
|
|
208
208
|
);
|
|
209
|
-
if (
|
|
210
|
-
let
|
|
211
|
-
(
|
|
209
|
+
if (x.length === 0) return;
|
|
210
|
+
let y = Array.from(x).findIndex(
|
|
211
|
+
(C) => C === document.activeElement
|
|
212
212
|
);
|
|
213
|
-
if (
|
|
214
|
-
|
|
213
|
+
if (y === -1 && document.activeElement === c) {
|
|
214
|
+
x[0].focus();
|
|
215
215
|
return;
|
|
216
216
|
}
|
|
217
|
-
o.code === "ArrowRight" ?
|
|
217
|
+
o.code === "ArrowRight" ? y = y === x.length - 1 ? 0 : y + 1 : o.code === "ArrowLeft" && (y = y === 0 ? x.length - 1 : y - 1), x[y].focus();
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
},
|
|
224
|
-
|
|
223
|
+
}, k = () => {
|
|
224
|
+
B(() => {
|
|
225
225
|
const o = e.value?.$el;
|
|
226
226
|
if (!o || typeof o.closest != "function") return;
|
|
227
|
-
const
|
|
228
|
-
|
|
227
|
+
const w = o.closest(".k-grid");
|
|
228
|
+
w && w.classList.add("fk-grid");
|
|
229
229
|
});
|
|
230
230
|
}, V = () => {
|
|
231
231
|
if (!g)
|
|
@@ -238,266 +238,266 @@ const ct = (e, t) => {
|
|
|
238
238
|
)
|
|
239
239
|
);
|
|
240
240
|
if (!p || p.length === 0 || p.filter(
|
|
241
|
-
(
|
|
241
|
+
(C) => C.getAttribute("tabindex") === "0"
|
|
242
242
|
).length === 1) return;
|
|
243
|
-
const
|
|
244
|
-
(
|
|
243
|
+
const y = p.find(
|
|
244
|
+
(C) => C === document.activeElement || C.contains(document.activeElement)
|
|
245
245
|
);
|
|
246
|
-
if (p.forEach((
|
|
247
|
-
|
|
246
|
+
if (p.forEach((C) => C.setAttribute("tabindex", "-1")), y) {
|
|
247
|
+
y.setAttribute("tabindex", "0");
|
|
248
248
|
return;
|
|
249
249
|
}
|
|
250
250
|
p[0].setAttribute("tabindex", "0");
|
|
251
251
|
} catch (p) {
|
|
252
252
|
console.error("ensureSingleTabindex error:", p);
|
|
253
253
|
}
|
|
254
|
-
},
|
|
254
|
+
}, w = Array.from(
|
|
255
255
|
e.value.$el.querySelectorAll(
|
|
256
256
|
".k-table-row[data-grid-row-index]"
|
|
257
257
|
)
|
|
258
258
|
);
|
|
259
|
-
|
|
260
|
-
p.setAttribute("tabindex",
|
|
259
|
+
w.length > 0 && w.forEach((p, x) => {
|
|
260
|
+
p.setAttribute("tabindex", x === 0 ? "0" : "-1");
|
|
261
261
|
});
|
|
262
|
-
const
|
|
263
|
-
|
|
262
|
+
const c = e.value.$el.querySelector(".k-table-tbody");
|
|
263
|
+
c && (g = new MutationObserver(() => {
|
|
264
264
|
o();
|
|
265
|
-
}), g.observe(
|
|
265
|
+
}), g.observe(c, { childList: !0, subtree: !0 }));
|
|
266
266
|
} catch (o) {
|
|
267
267
|
console.error("Error setting up row navigation:", o);
|
|
268
268
|
}
|
|
269
|
-
},
|
|
270
|
-
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
|
|
269
|
+
}, H = () => {
|
|
270
|
+
B(() => {
|
|
271
|
+
const w = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
|
|
272
|
+
w && w.forEach((c) => {
|
|
273
|
+
c.setAttribute("role", "button"), c.addEventListener(
|
|
274
274
|
"keydown",
|
|
275
|
-
|
|
275
|
+
E
|
|
276
276
|
);
|
|
277
|
-
}),
|
|
277
|
+
}), S(), J();
|
|
278
278
|
});
|
|
279
|
-
},
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
|
|
279
|
+
}, Q = () => {
|
|
280
|
+
const w = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
|
|
281
|
+
w && w.forEach((c) => {
|
|
282
|
+
c.removeEventListener(
|
|
283
283
|
"keydown",
|
|
284
|
-
|
|
284
|
+
E
|
|
285
285
|
);
|
|
286
|
-
}), m && (m.disconnect(), m = null), g && (g.disconnect(), g = null),
|
|
287
|
-
},
|
|
286
|
+
}), m && (m.disconnect(), m = null), g && (g.disconnect(), g = null), I.forEach((c) => c()), I.length = 0;
|
|
287
|
+
}, J = () => {
|
|
288
288
|
document.querySelectorAll(
|
|
289
289
|
".k-grid-header .k-table-thead th"
|
|
290
|
-
).forEach((
|
|
291
|
-
if (
|
|
290
|
+
).forEach((c, p) => {
|
|
291
|
+
if (c.dataset.featherKHeaderBound === "true")
|
|
292
292
|
return;
|
|
293
|
-
const
|
|
293
|
+
const x = c.querySelector(
|
|
294
294
|
".k-grid-header-menu.k-grid-column-menu"
|
|
295
295
|
);
|
|
296
|
-
if (!
|
|
297
|
-
const
|
|
298
|
-
if (
|
|
299
|
-
const a =
|
|
300
|
-
|
|
296
|
+
if (!x) return;
|
|
297
|
+
const y = P();
|
|
298
|
+
if (y && y[p]) {
|
|
299
|
+
const a = y[p].field ?? "";
|
|
300
|
+
c.setAttribute("data-feather-k-field", a), c.setAttribute(
|
|
301
301
|
"data-feather-k-filterable",
|
|
302
|
-
|
|
303
|
-
),
|
|
302
|
+
y[p].filterable === !1 ? "false" : "true"
|
|
303
|
+
), c.setAttribute(
|
|
304
304
|
"data-feather-k-sortable",
|
|
305
|
-
|
|
305
|
+
y[p].sortable === !1 ? "false" : "true"
|
|
306
306
|
);
|
|
307
307
|
}
|
|
308
|
-
const
|
|
309
|
-
|
|
308
|
+
const C = c.dataset.featherKFilterable !== "false", L = c.dataset.featherKSortable !== "false";
|
|
309
|
+
x.setAttribute("tabindex", "-1"), C || L ? c.style.cursor = "pointer" : c.style.cursor = "default", C ? (c.setAttribute("tabindex", "0"), c.setAttribute("role", "button"), c.setAttribute("aria-haspopup", "menu")) : (c.setAttribute("tabindex", "0"), c.setAttribute("role", "columnheader"), c.removeAttribute("aria-haspopup"));
|
|
310
310
|
const Y = (a) => {
|
|
311
|
-
a.target?.closest(".k-column-resizer") || (l.value =
|
|
311
|
+
a.target?.closest(".k-column-resizer") || (l.value = c, x.click());
|
|
312
312
|
}, ae = (a) => {
|
|
313
|
-
if (
|
|
314
|
-
l.value =
|
|
313
|
+
if (C)
|
|
314
|
+
l.value = c, a.preventDefault(), a.stopPropagation(), Y(a);
|
|
315
315
|
else if (L) {
|
|
316
|
-
l.value =
|
|
317
|
-
const
|
|
318
|
-
|
|
316
|
+
l.value = c;
|
|
317
|
+
const d = c.querySelector(".k-link");
|
|
318
|
+
d && d.click();
|
|
319
319
|
}
|
|
320
320
|
};
|
|
321
|
-
|
|
322
|
-
|
|
321
|
+
c.addEventListener("click", ae), I.push(() => {
|
|
322
|
+
c.removeEventListener("click", ae);
|
|
323
323
|
});
|
|
324
324
|
const se = (a) => {
|
|
325
|
-
if ((
|
|
326
|
-
if (a.preventDefault(), a.stopPropagation(), l.value =
|
|
325
|
+
if ((h(a) || a.code === "Space") && (C || L)) {
|
|
326
|
+
if (a.preventDefault(), a.stopPropagation(), l.value = c, l.value.focus(), C)
|
|
327
327
|
Y(a);
|
|
328
328
|
else if (L) {
|
|
329
|
-
const
|
|
330
|
-
|
|
329
|
+
const d = c.querySelector(".k-link");
|
|
330
|
+
d && d.click();
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
};
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}),
|
|
334
|
+
c.addEventListener("keydown", se, !0), I.push(() => {
|
|
335
|
+
c.removeEventListener("keydown", se, !0);
|
|
336
|
+
}), c.dataset.featherKHeaderBound = "true";
|
|
337
337
|
});
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
340
|
-
const
|
|
341
|
-
const
|
|
342
|
-
|
|
338
|
+
const w = document.querySelector(".k-grid-header .k-table-thead");
|
|
339
|
+
if (w && w.dataset.featherKHeaderBound !== "true") {
|
|
340
|
+
const c = (p) => {
|
|
341
|
+
const x = p.target.closest("th");
|
|
342
|
+
x && (h(p) || p.code === "Space") && x.dataset.featherKFilterable === "false" && x.dataset.featherKSortable === "false" && (p.preventDefault(), p.stopImmediatePropagation());
|
|
343
343
|
};
|
|
344
|
-
|
|
344
|
+
w.addEventListener(
|
|
345
345
|
"keydown",
|
|
346
|
-
|
|
346
|
+
c,
|
|
347
347
|
!0
|
|
348
348
|
// NOTE: capture phase
|
|
349
|
-
),
|
|
350
|
-
|
|
349
|
+
), I.push(() => {
|
|
350
|
+
w.removeEventListener(
|
|
351
351
|
"keydown",
|
|
352
|
-
|
|
352
|
+
c,
|
|
353
353
|
!0
|
|
354
354
|
);
|
|
355
|
-
}),
|
|
355
|
+
}), w.dataset.featherKHeaderBound = "true";
|
|
356
356
|
}
|
|
357
|
-
}, ee = function(o,
|
|
358
|
-
const
|
|
359
|
-
if (!
|
|
360
|
-
const
|
|
361
|
-
if (!
|
|
362
|
-
if (
|
|
357
|
+
}, ee = function(o, w) {
|
|
358
|
+
const c = o?.event?.event.target, p = P();
|
|
359
|
+
if (!c || !p) return;
|
|
360
|
+
const x = c.classList.contains("k-grid-header-menu"), y = c.classList.contains("k-columnmenu-item"), C = p.find((L) => L.field === o?.event?.field)?.sortable && !0;
|
|
361
|
+
if (!x) {
|
|
362
|
+
if (y && !C) {
|
|
363
363
|
o?.event?.sort?.filter(
|
|
364
364
|
(Y) => Y.field !== o?.event?.field
|
|
365
365
|
);
|
|
366
366
|
return;
|
|
367
367
|
}
|
|
368
|
-
typeof
|
|
369
|
-
l.value && l.value.focus(),
|
|
370
|
-
|
|
368
|
+
typeof w == "function" && B(() => {
|
|
369
|
+
l.value && l.value.focus(), w(o), B(() => {
|
|
370
|
+
J();
|
|
371
371
|
});
|
|
372
372
|
});
|
|
373
373
|
}
|
|
374
|
-
},
|
|
375
|
-
if (!
|
|
374
|
+
}, oe = () => {
|
|
375
|
+
if (!A)
|
|
376
376
|
try {
|
|
377
|
-
|
|
377
|
+
k(), V(), H(), A = !0;
|
|
378
378
|
} catch (o) {
|
|
379
|
-
console.error("initA11y failed:", o),
|
|
379
|
+
console.error("initA11y failed:", o), Q();
|
|
380
380
|
}
|
|
381
381
|
};
|
|
382
|
-
return
|
|
383
|
-
|
|
382
|
+
return Le(() => {
|
|
383
|
+
Q();
|
|
384
384
|
}), {
|
|
385
385
|
activeFilterButton: l,
|
|
386
|
-
handleGridKeyDown:
|
|
386
|
+
handleGridKeyDown: v,
|
|
387
387
|
handleSortChange: ee,
|
|
388
|
-
initA11y:
|
|
388
|
+
initA11y: oe
|
|
389
389
|
};
|
|
390
|
-
},
|
|
390
|
+
}, ze = (e) => !!e && typeof e == "object" && "filters" in e && Array.isArray(e.filters), He = (e) => !!e && typeof e == "object" && "field" in e, $e = (e, t) => !e || typeof e != "object" ? !1 : ze(e) ? e.filters.some(
|
|
391
391
|
(l) => $e(l, t)
|
|
392
|
-
) :
|
|
392
|
+
) : He(e) ? e.field === t : !1, pt = (e) => (t) => e.value?.filters && e.value.filters.some(
|
|
393
393
|
(l) => $e(l, t)
|
|
394
|
-
) ? "active" : "",
|
|
394
|
+
) ? "active" : "", Ze = "Enter a valid ZIP code with exactly 5 or 9 digits.", Ce = (e) => {
|
|
395
395
|
const t = e.replace(/\D/g, "").slice(0, 9);
|
|
396
396
|
return t.length > 5 ? `${t.slice(0, 5)}-${t.slice(5)}` : t;
|
|
397
|
-
},
|
|
398
|
-
const t = U(
|
|
399
|
-
e.errorMessage?.trim() ||
|
|
400
|
-
), m =
|
|
401
|
-
const
|
|
402
|
-
return
|
|
403
|
-
}),
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
|
|
397
|
+
}, Ye = (e, t) => e.slice(0, Math.max(0, t)).replace(/\D/g, "").length, We = (e) => e <= 5 ? e : Math.min(e + 1, 10), _e = (e) => {
|
|
398
|
+
const t = U(Ce(e.initialValue ?? "")), l = U(!1), A = U(
|
|
399
|
+
e.errorMessage?.trim() || Ze
|
|
400
|
+
), m = f(() => t.value.replace(/\D/g, "")), g = f(() => {
|
|
401
|
+
const u = m.value.length;
|
|
402
|
+
return u === 5 || u === 9;
|
|
403
|
+
}), I = f(() => l.value && !g.value), b = f(() => !l.value || g.value), M = f(() => l.value), $ = (u, S) => {
|
|
404
|
+
const Z = We(S);
|
|
405
|
+
B(() => {
|
|
406
|
+
u.isConnected && u.setSelectionRange(Z, Z);
|
|
407
407
|
});
|
|
408
408
|
};
|
|
409
409
|
return {
|
|
410
410
|
// writable state
|
|
411
411
|
zipDisplay: t,
|
|
412
412
|
submitted: l,
|
|
413
|
-
errorMessage:
|
|
413
|
+
errorMessage: A,
|
|
414
414
|
// bindings
|
|
415
415
|
wrapperClass: "fk-zip-textbox",
|
|
416
416
|
// derived state
|
|
417
417
|
zipRaw: m,
|
|
418
418
|
isZipValid: g,
|
|
419
|
-
showZipError:
|
|
420
|
-
textBoxValid:
|
|
421
|
-
textBoxValidate:
|
|
419
|
+
showZipError: I,
|
|
420
|
+
textBoxValid: b,
|
|
421
|
+
textBoxValidate: M,
|
|
422
422
|
// actions
|
|
423
|
-
handleZipInput: (...
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
|
|
423
|
+
handleZipInput: (...u) => {
|
|
424
|
+
const S = u[0], v = S?.event?.target, k = S?.value, V = Array.isArray(k) ? k.join("") : String(k ?? ""), H = v?.selectionStart !== void 0 && v.selectionStart !== null ? Ye(
|
|
425
|
+
v.value,
|
|
426
|
+
v.selectionStart
|
|
427
427
|
) : V.replace(/\D/g, "").length;
|
|
428
|
-
t.value =
|
|
428
|
+
t.value = Ce(V), v && $(v, H);
|
|
429
429
|
},
|
|
430
|
-
submitAndValidate: (
|
|
430
|
+
submitAndValidate: (u) => {
|
|
431
431
|
l.value = !0;
|
|
432
|
-
const
|
|
433
|
-
return !
|
|
432
|
+
const S = g.value;
|
|
433
|
+
return !S && u?.focus && B(() => {
|
|
434
434
|
document.getElementById(
|
|
435
435
|
e.id
|
|
436
436
|
)?.focus();
|
|
437
|
-
}),
|
|
437
|
+
}), S;
|
|
438
438
|
},
|
|
439
439
|
buildPayload: () => ({ zip: m.value })
|
|
440
440
|
};
|
|
441
441
|
};
|
|
442
|
-
function
|
|
442
|
+
function je(e, t) {
|
|
443
443
|
const l = U(!1);
|
|
444
444
|
Fe(() => {
|
|
445
445
|
e.value?.setAttribute("aria-invalid", String(!t.isValid()));
|
|
446
446
|
});
|
|
447
|
-
function
|
|
448
|
-
const
|
|
449
|
-
(!
|
|
447
|
+
function A(g) {
|
|
448
|
+
const I = e.value ?? g.currentTarget, b = g.relatedTarget;
|
|
449
|
+
(!I || !I.contains(b)) && (l.value = !0);
|
|
450
450
|
}
|
|
451
451
|
function m() {
|
|
452
452
|
l.value = !1;
|
|
453
453
|
}
|
|
454
|
-
return { touched: l, onFocusout:
|
|
454
|
+
return { touched: l, onFocusout: A, reset: m };
|
|
455
455
|
}
|
|
456
|
-
function
|
|
457
|
-
const l = U(!1),
|
|
456
|
+
function Ge(e, t) {
|
|
457
|
+
const l = U(!1), A = U(!1), m = f(
|
|
458
458
|
() => le(t.submitted) || l.value
|
|
459
|
-
), g =
|
|
459
|
+
), g = f(() => !m.value || t.isValid()), I = je(e, {
|
|
460
460
|
isValid: () => g.value
|
|
461
461
|
});
|
|
462
|
-
function
|
|
463
|
-
return
|
|
462
|
+
function b(E) {
|
|
463
|
+
return f(() => !m.value || le(E));
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function M(E) {
|
|
466
466
|
return Object.fromEntries(
|
|
467
|
-
Object.entries(
|
|
468
|
-
|
|
469
|
-
|
|
467
|
+
Object.entries(E).map(([u, S]) => [
|
|
468
|
+
u,
|
|
469
|
+
b(S)
|
|
470
470
|
])
|
|
471
471
|
);
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
const
|
|
475
|
-
if (!
|
|
476
|
-
|
|
473
|
+
function $(E) {
|
|
474
|
+
const u = le(E);
|
|
475
|
+
if (!u) return;
|
|
476
|
+
u.querySelector(
|
|
477
477
|
'.k-invalid input, .k-invalid[tabindex="0"]'
|
|
478
478
|
)?.focus();
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
if (
|
|
482
|
-
|
|
480
|
+
function h(E) {
|
|
481
|
+
if (A.value) {
|
|
482
|
+
A.value = !1;
|
|
483
483
|
return;
|
|
484
484
|
}
|
|
485
|
-
|
|
485
|
+
I.onFocusout(E), I.touched.value && (l.value = !0);
|
|
486
486
|
}
|
|
487
|
-
function
|
|
488
|
-
l.value = !1,
|
|
487
|
+
function P() {
|
|
488
|
+
l.value = !1, A.value = !0, I.reset();
|
|
489
489
|
}
|
|
490
490
|
return {
|
|
491
491
|
touched: l,
|
|
492
492
|
fieldsetValidate: m,
|
|
493
|
-
onFocusout:
|
|
494
|
-
reset:
|
|
495
|
-
createFieldValidity:
|
|
496
|
-
createFieldValidationsMap:
|
|
497
|
-
focusFirstInvalidField:
|
|
493
|
+
onFocusout: h,
|
|
494
|
+
reset: P,
|
|
495
|
+
createFieldValidity: b,
|
|
496
|
+
createFieldValidationsMap: M,
|
|
497
|
+
focusFirstInvalidField: $
|
|
498
498
|
};
|
|
499
499
|
}
|
|
500
|
-
const
|
|
500
|
+
const Je = [
|
|
501
501
|
{ label: "Alabama", value: "AL" },
|
|
502
502
|
{ label: "Alaska", value: "AK" },
|
|
503
503
|
{ label: "Arizona", value: "AZ" },
|
|
@@ -556,8 +556,8 @@ function De(e) {
|
|
|
556
556
|
}
|
|
557
557
|
return "";
|
|
558
558
|
}
|
|
559
|
-
function
|
|
560
|
-
const e =
|
|
559
|
+
function Xe() {
|
|
560
|
+
const e = qe({
|
|
561
561
|
address1: "",
|
|
562
562
|
address2: "",
|
|
563
563
|
city: "",
|
|
@@ -566,255 +566,467 @@ function Ge() {
|
|
|
566
566
|
});
|
|
567
567
|
return {
|
|
568
568
|
formData: e,
|
|
569
|
-
onAddress1Input: (...
|
|
570
|
-
e.address1 = De(
|
|
569
|
+
onAddress1Input: (...I) => {
|
|
570
|
+
e.address1 = De(I[0]);
|
|
571
571
|
},
|
|
572
|
-
onAddress2Input: (...
|
|
573
|
-
e.address2 = De(
|
|
572
|
+
onAddress2Input: (...I) => {
|
|
573
|
+
e.address2 = De(I[0]);
|
|
574
574
|
},
|
|
575
|
-
onCityInput: (...
|
|
576
|
-
e.city = De(
|
|
575
|
+
onCityInput: (...I) => {
|
|
576
|
+
e.city = De(I[0]);
|
|
577
577
|
},
|
|
578
|
-
onStateChange: (
|
|
579
|
-
e.state =
|
|
578
|
+
onStateChange: (I) => {
|
|
579
|
+
e.state = I.value;
|
|
580
580
|
},
|
|
581
581
|
resetFormData: () => {
|
|
582
582
|
e.address1 = "", e.address2 = "", e.city = "", e.state = null, e.zip = "";
|
|
583
583
|
}
|
|
584
584
|
};
|
|
585
585
|
}
|
|
586
|
-
function
|
|
587
|
-
const l =
|
|
588
|
-
zipDisplay:
|
|
586
|
+
function Qe(e, t = "zip") {
|
|
587
|
+
const l = _e({ id: t }), {
|
|
588
|
+
zipDisplay: A,
|
|
589
589
|
zipRaw: m,
|
|
590
590
|
isZipValid: g,
|
|
591
|
-
wrapperClass:
|
|
592
|
-
handleZipInput:
|
|
591
|
+
wrapperClass: I,
|
|
592
|
+
handleZipInput: b
|
|
593
593
|
} = l;
|
|
594
|
-
return
|
|
595
|
-
e.zip =
|
|
594
|
+
return ue(m, ($) => {
|
|
595
|
+
e.zip = $;
|
|
596
596
|
}), {
|
|
597
|
-
zipDisplay:
|
|
597
|
+
zipDisplay: A,
|
|
598
598
|
isZipValid: g,
|
|
599
|
-
zipWrapperClass:
|
|
600
|
-
onZipInput:
|
|
599
|
+
zipWrapperClass: I,
|
|
600
|
+
onZipInput: b,
|
|
601
601
|
resetZip: () => {
|
|
602
|
-
|
|
602
|
+
A.value = "", e.zip = "";
|
|
603
603
|
}
|
|
604
604
|
};
|
|
605
605
|
}
|
|
606
|
-
function
|
|
607
|
-
const t =
|
|
606
|
+
function et(e) {
|
|
607
|
+
const t = f(
|
|
608
608
|
() => e.formData.address1.trim() !== ""
|
|
609
|
-
), l =
|
|
610
|
-
() => t.value && l.value &&
|
|
609
|
+
), l = f(() => e.formData.city.trim() !== ""), A = f(() => !!e.formData.state), m = f(() => le(e.isZipValid)), g = f(
|
|
610
|
+
() => t.value && l.value && A.value && m.value
|
|
611
611
|
);
|
|
612
612
|
return {
|
|
613
613
|
strictAddress1Valid: t,
|
|
614
614
|
strictCityValid: l,
|
|
615
|
-
strictStateValid:
|
|
615
|
+
strictStateValid: A,
|
|
616
616
|
strictZipValid: m,
|
|
617
617
|
strictAddressValid: g
|
|
618
618
|
};
|
|
619
619
|
}
|
|
620
|
-
function
|
|
620
|
+
function tt(e) {
|
|
621
621
|
if (!e) return;
|
|
622
622
|
e.querySelector(
|
|
623
623
|
'.k-invalid input, .k-invalid[tabindex="0"]'
|
|
624
624
|
)?.focus();
|
|
625
625
|
}
|
|
626
|
-
function
|
|
627
|
-
const l = e ?? t.currentTarget,
|
|
628
|
-
return !l || !l.contains(
|
|
626
|
+
function nt(e, t) {
|
|
627
|
+
const l = e ?? t.currentTarget, A = t.relatedTarget;
|
|
628
|
+
return !l || !l.contains(A);
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function vt(e) {
|
|
631
631
|
const t = U(
|
|
632
632
|
le(e.fieldsetRef)
|
|
633
633
|
);
|
|
634
634
|
Fe(() => {
|
|
635
635
|
t.value = le(e.fieldsetRef);
|
|
636
636
|
});
|
|
637
|
-
const l = U(!1),
|
|
637
|
+
const l = U(!1), A = U(!1), m = f(() => le(e.required) ?? !0), {
|
|
638
638
|
formData: g,
|
|
639
|
-
onAddress1Input:
|
|
640
|
-
onAddress2Input:
|
|
641
|
-
onCityInput:
|
|
642
|
-
onStateChange:
|
|
643
|
-
resetFormData:
|
|
644
|
-
} =
|
|
645
|
-
strictAddress1Valid:
|
|
639
|
+
onAddress1Input: I,
|
|
640
|
+
onAddress2Input: b,
|
|
641
|
+
onCityInput: M,
|
|
642
|
+
onStateChange: $,
|
|
643
|
+
resetFormData: h
|
|
644
|
+
} = Xe(), P = `${e.addressId}-zip`, { zipDisplay: E, isZipValid: u, zipWrapperClass: S, onZipInput: Z, resetZip: v } = Qe(g, P), {
|
|
645
|
+
strictAddress1Valid: k,
|
|
646
646
|
strictCityValid: V,
|
|
647
|
-
strictStateValid:
|
|
648
|
-
strictZipValid:
|
|
649
|
-
strictAddressValid:
|
|
650
|
-
} =
|
|
647
|
+
strictStateValid: H,
|
|
648
|
+
strictZipValid: Q,
|
|
649
|
+
strictAddressValid: J
|
|
650
|
+
} = et({
|
|
651
651
|
formData: g,
|
|
652
|
-
isZipValid:
|
|
653
|
-
}), ee =
|
|
652
|
+
isZipValid: u
|
|
653
|
+
}), ee = Ge(t, {
|
|
654
654
|
submitted: l,
|
|
655
|
-
isValid: () =>
|
|
656
|
-
}), { touched:
|
|
657
|
-
address1:
|
|
655
|
+
isValid: () => J.value
|
|
656
|
+
}), { touched: oe, fieldsetValidate: o, onFocusout: w, reset: c } = ee, p = ee.createFieldValidationsMap({
|
|
657
|
+
address1: k,
|
|
658
658
|
city: V,
|
|
659
|
-
state:
|
|
660
|
-
zip:
|
|
661
|
-
address:
|
|
659
|
+
state: H,
|
|
660
|
+
zip: Q,
|
|
661
|
+
address: J
|
|
662
662
|
}), {
|
|
663
|
-
address1:
|
|
664
|
-
city:
|
|
665
|
-
state:
|
|
663
|
+
address1: x,
|
|
664
|
+
city: y,
|
|
665
|
+
state: C,
|
|
666
666
|
zip: L,
|
|
667
667
|
address: Y
|
|
668
|
-
} = p, ae =
|
|
668
|
+
} = p, ae = f(
|
|
669
669
|
() => m.value ? o.value : !1
|
|
670
|
-
), se =
|
|
671
|
-
() => m.value ?
|
|
672
|
-
), a =
|
|
673
|
-
() => m.value ?
|
|
674
|
-
),
|
|
675
|
-
() => m.value ?
|
|
676
|
-
),
|
|
670
|
+
), se = f(
|
|
671
|
+
() => m.value ? x.value : !0
|
|
672
|
+
), a = f(
|
|
673
|
+
() => m.value ? y.value : !0
|
|
674
|
+
), d = f(
|
|
675
|
+
() => m.value ? C.value : !0
|
|
676
|
+
), F = f(
|
|
677
677
|
() => m.value ? L.value : !0
|
|
678
|
-
), K =
|
|
678
|
+
), K = f(
|
|
679
679
|
() => m.value ? Y.value : !0
|
|
680
|
-
),
|
|
680
|
+
), N = { value: null, label: "State" }, W = Je.map(({ label: s, value: D }) => ({
|
|
681
681
|
label: s,
|
|
682
|
-
value:
|
|
683
|
-
})), n =
|
|
682
|
+
value: D
|
|
683
|
+
})), n = f(() => ({
|
|
684
684
|
address1: g.address1.trim(),
|
|
685
685
|
address2: g.address2.trim(),
|
|
686
686
|
city: g.city.trim(),
|
|
687
687
|
state: (g.state ?? "").trim().toUpperCase(),
|
|
688
688
|
zip: g.zip.replace(/\D/g, "")
|
|
689
|
-
})), i =
|
|
689
|
+
})), i = f(() => g.address1.trim() === "" && g.address2.trim() === "" && g.city.trim() === "" && (g.state ?? "").trim() === "" && g.zip.replace(/\D/g, "") === ""), T = f(() => !i.value), q = f(() => !m.value && T.value && (!k.value || !V.value || !H.value)), _ = f(() => {
|
|
690
690
|
const s = g.zip.replace(/\D/g, "");
|
|
691
|
-
return !m.value &&
|
|
692
|
-
}),
|
|
693
|
-
return
|
|
694
|
-
m.value || (
|
|
695
|
-
}),
|
|
696
|
-
s || (l.value = !1,
|
|
691
|
+
return !m.value && T.value && s.length !== 5 && s.length !== 9;
|
|
692
|
+
}), X = f(() => !m.value && T.value && !J.value), O = f(() => !m.value && X.value && (A.value || l.value));
|
|
693
|
+
return ue(n, () => {
|
|
694
|
+
m.value || (A.value = !1);
|
|
695
|
+
}), ue(m, (s) => {
|
|
696
|
+
s || (l.value = !1, A.value = !1, c());
|
|
697
697
|
}), {
|
|
698
698
|
formData: g,
|
|
699
699
|
submitted: l,
|
|
700
|
-
touched:
|
|
700
|
+
touched: oe,
|
|
701
701
|
addressValidate: ae,
|
|
702
702
|
address1Valid: se,
|
|
703
703
|
cityValid: a,
|
|
704
|
-
stateValid:
|
|
705
|
-
zipValid:
|
|
704
|
+
stateValid: d,
|
|
705
|
+
zipValid: F,
|
|
706
706
|
addressValid: K,
|
|
707
707
|
optionalFeedbackActive: O,
|
|
708
|
-
optionalPartialInvalid:
|
|
708
|
+
optionalPartialInvalid: X,
|
|
709
709
|
optionalMissingRequiredFields: q,
|
|
710
710
|
optionalZipInvalid: _,
|
|
711
|
-
stateDefaultItem:
|
|
711
|
+
stateDefaultItem: N,
|
|
712
712
|
stateOptions: W,
|
|
713
|
-
zipDisplay:
|
|
714
|
-
zipWrapperClass:
|
|
715
|
-
onAddress1Input:
|
|
716
|
-
onAddress2Input:
|
|
717
|
-
onCityInput:
|
|
718
|
-
onStateChange:
|
|
719
|
-
onZipInput:
|
|
713
|
+
zipDisplay: E,
|
|
714
|
+
zipWrapperClass: S,
|
|
715
|
+
onAddress1Input: I,
|
|
716
|
+
onAddress2Input: b,
|
|
717
|
+
onCityInput: M,
|
|
718
|
+
onStateChange: $,
|
|
719
|
+
onZipInput: Z,
|
|
720
720
|
onFieldsetFocusout: (s) => {
|
|
721
|
-
const
|
|
722
|
-
|
|
721
|
+
const D = nt(t.value, s);
|
|
722
|
+
w(s), !m.value && D && (A.value = !0);
|
|
723
723
|
},
|
|
724
724
|
normalizedPayload: n,
|
|
725
|
-
validateForSubmit: async () => m.value ? (l.value = !0,
|
|
725
|
+
validateForSubmit: async () => m.value ? (l.value = !0, J.value ? {
|
|
726
726
|
isValid: !0,
|
|
727
727
|
payload: n.value
|
|
728
|
-
} : (await
|
|
728
|
+
} : (await B(), tt(t.value), { isValid: !1, payload: null })) : i.value || J.value ? (l.value = !1, {
|
|
729
729
|
isValid: !0,
|
|
730
730
|
payload: n.value
|
|
731
731
|
}) : (l.value = !0, { isValid: !1, payload: null }),
|
|
732
732
|
reset: () => {
|
|
733
|
-
l.value = !1,
|
|
733
|
+
l.value = !1, A.value = !1, c(), h(), v();
|
|
734
734
|
}
|
|
735
735
|
};
|
|
736
736
|
}
|
|
737
|
-
function
|
|
738
|
-
|
|
737
|
+
function at(e) {
|
|
738
|
+
return Oe() ? (Ue(e), !0) : !1;
|
|
739
|
+
}
|
|
740
|
+
const Pe = typeof window < "u" && typeof document < "u";
|
|
741
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
742
|
+
const rt = Object.prototype.toString, lt = (e) => rt.call(e) === "[object Object]", ye = () => {
|
|
743
|
+
}, ot = /* @__PURE__ */ it();
|
|
744
|
+
function it() {
|
|
745
|
+
var e, t;
|
|
746
|
+
return Pe && ((e = window?.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window?.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
|
|
747
|
+
}
|
|
748
|
+
function Ee(e) {
|
|
749
|
+
return Array.isArray(e) ? e : [e];
|
|
750
|
+
}
|
|
751
|
+
function st(e, t, l) {
|
|
752
|
+
return ue(
|
|
753
|
+
e,
|
|
754
|
+
t,
|
|
755
|
+
{
|
|
756
|
+
...l,
|
|
757
|
+
immediate: !0
|
|
758
|
+
}
|
|
759
|
+
);
|
|
760
|
+
}
|
|
761
|
+
const Ve = Pe ? window : void 0;
|
|
762
|
+
function be(e) {
|
|
763
|
+
var t;
|
|
764
|
+
const l = le(e);
|
|
765
|
+
return (t = l?.$el) != null ? t : l;
|
|
766
|
+
}
|
|
767
|
+
function Me(...e) {
|
|
768
|
+
const t = [], l = () => {
|
|
769
|
+
t.forEach((b) => b()), t.length = 0;
|
|
770
|
+
}, A = (b, M, $, h) => (b.addEventListener(M, $, h), () => b.removeEventListener(M, $, h)), m = f(() => {
|
|
771
|
+
const b = Ee(le(e[0])).filter((M) => M != null);
|
|
772
|
+
return b.every((M) => typeof M != "string") ? b : void 0;
|
|
773
|
+
}), g = st(
|
|
774
|
+
() => {
|
|
775
|
+
var b, M;
|
|
776
|
+
return [
|
|
777
|
+
(M = (b = m.value) == null ? void 0 : b.map(($) => be($))) != null ? M : [Ve].filter(($) => $ != null),
|
|
778
|
+
Ee(le(m.value ? e[1] : e[0])),
|
|
779
|
+
Ee(Be(m.value ? e[2] : e[1])),
|
|
780
|
+
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
781
|
+
le(m.value ? e[3] : e[2])
|
|
782
|
+
];
|
|
783
|
+
},
|
|
784
|
+
([b, M, $, h]) => {
|
|
785
|
+
if (l(), !b?.length || !M?.length || !$?.length)
|
|
786
|
+
return;
|
|
787
|
+
const P = lt(h) ? { ...h } : h;
|
|
788
|
+
t.push(
|
|
789
|
+
...b.flatMap(
|
|
790
|
+
(E) => M.flatMap(
|
|
791
|
+
(u) => $.map((S) => A(E, u, S, P))
|
|
792
|
+
)
|
|
793
|
+
)
|
|
794
|
+
);
|
|
795
|
+
},
|
|
796
|
+
{ flush: "post" }
|
|
797
|
+
), I = () => {
|
|
798
|
+
g(), l();
|
|
799
|
+
};
|
|
800
|
+
return at(l), I;
|
|
801
|
+
}
|
|
802
|
+
let Te = !1;
|
|
803
|
+
function Re(e, t, l = {}) {
|
|
804
|
+
const { window: A = Ve, ignore: m = [], capture: g = !0, detectIframe: I = !1, controls: b = !1 } = l;
|
|
805
|
+
if (!A)
|
|
806
|
+
return b ? { stop: ye, cancel: ye, trigger: ye } : ye;
|
|
807
|
+
if (ot && !Te) {
|
|
808
|
+
Te = !0;
|
|
809
|
+
const v = { passive: !0 };
|
|
810
|
+
Array.from(A.document.body.children).forEach((k) => k.addEventListener("click", ye, v)), A.document.documentElement.addEventListener("click", ye, v);
|
|
811
|
+
}
|
|
812
|
+
let M = !0;
|
|
813
|
+
const $ = (v) => le(m).some((k) => {
|
|
814
|
+
if (typeof k == "string")
|
|
815
|
+
return Array.from(A.document.querySelectorAll(k)).some((V) => V === v.target || v.composedPath().includes(V));
|
|
816
|
+
{
|
|
817
|
+
const V = be(k);
|
|
818
|
+
return V && (v.target === V || v.composedPath().includes(V));
|
|
819
|
+
}
|
|
820
|
+
});
|
|
821
|
+
function h(v) {
|
|
822
|
+
const k = le(v);
|
|
823
|
+
return k && k.$.subTree.shapeFlag === 16;
|
|
824
|
+
}
|
|
825
|
+
function P(v, k) {
|
|
826
|
+
const V = le(v), H = V.$.subTree && V.$.subTree.children;
|
|
827
|
+
return H == null || !Array.isArray(H) ? !1 : H.some((Q) => Q.el === k.target || k.composedPath().includes(Q.el));
|
|
828
|
+
}
|
|
829
|
+
const E = (v) => {
|
|
830
|
+
const k = be(e);
|
|
831
|
+
if (v.target != null && !(!(k instanceof Element) && h(e) && P(e, v)) && !(!k || k === v.target || v.composedPath().includes(k))) {
|
|
832
|
+
if ("detail" in v && v.detail === 0 && (M = !$(v)), !M) {
|
|
833
|
+
M = !0;
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
t(v);
|
|
837
|
+
}
|
|
838
|
+
};
|
|
839
|
+
let u = !1;
|
|
840
|
+
const S = [
|
|
841
|
+
Me(A, "click", (v) => {
|
|
842
|
+
u || (u = !0, setTimeout(() => {
|
|
843
|
+
u = !1;
|
|
844
|
+
}, 0), E(v));
|
|
845
|
+
}, { passive: !0, capture: g }),
|
|
846
|
+
Me(A, "pointerdown", (v) => {
|
|
847
|
+
const k = be(e);
|
|
848
|
+
M = !$(v) && !!(k && !v.composedPath().includes(k));
|
|
849
|
+
}, { passive: !0 }),
|
|
850
|
+
I && Me(A, "blur", (v) => {
|
|
851
|
+
setTimeout(() => {
|
|
852
|
+
var k;
|
|
853
|
+
const V = be(e);
|
|
854
|
+
((k = A.document.activeElement) == null ? void 0 : k.tagName) === "IFRAME" && !V?.contains(A.document.activeElement) && t(v);
|
|
855
|
+
}, 0);
|
|
856
|
+
}, { passive: !0 })
|
|
857
|
+
].filter(Boolean), Z = () => S.forEach((v) => v());
|
|
858
|
+
return b ? {
|
|
859
|
+
stop: Z,
|
|
860
|
+
cancel: () => {
|
|
861
|
+
M = !1;
|
|
862
|
+
},
|
|
863
|
+
trigger: (v) => {
|
|
864
|
+
M = !0, E(v), M = !1;
|
|
865
|
+
}
|
|
866
|
+
} : Z;
|
|
867
|
+
}
|
|
868
|
+
const xe = (e) => {
|
|
869
|
+
if (e instanceof HTMLElement) return e;
|
|
870
|
+
const t = e?.$el;
|
|
871
|
+
return t instanceof HTMLElement ? t : null;
|
|
872
|
+
}, ut = (e) => e instanceof HTMLButtonElement || e.getAttribute("role") === "button" || e.hasAttribute("aria-haspopup"), mt = (e) => {
|
|
873
|
+
const t = U(null), l = e.menuItemSelector ?? ".k-menu-item:not(.k-disabled)", A = () => xe(e.triggerRef.value), m = () => e.resolveFocusTarget?.() ?? xe(e.focusTargetRef?.value), g = () => {
|
|
874
|
+
const u = m();
|
|
875
|
+
if (u)
|
|
876
|
+
return u.focus(), !0;
|
|
877
|
+
const S = A();
|
|
878
|
+
return S?.focus(), !!S;
|
|
879
|
+
}, I = () => {
|
|
880
|
+
xe(e.menuRef.value)?.querySelector(l)?.focus();
|
|
881
|
+
}, b = (u) => {
|
|
882
|
+
e.isOpen.value && (t.value = u, e.requestHide());
|
|
883
|
+
};
|
|
884
|
+
Re(e.menuRef, () => b("outside-click"), {
|
|
885
|
+
ignore: [e.triggerRef]
|
|
886
|
+
}), e.manageAriaExpanded !== !1 && ue(
|
|
887
|
+
[e.isOpen, e.triggerRef],
|
|
888
|
+
([u]) => {
|
|
889
|
+
const S = A();
|
|
890
|
+
!S || !ut(S) || S.setAttribute("aria-expanded", u ? "true" : "false");
|
|
891
|
+
},
|
|
892
|
+
{ immediate: !0, flush: "post" }
|
|
893
|
+
);
|
|
894
|
+
const M = () => {
|
|
895
|
+
if (e.isOpen.value) {
|
|
896
|
+
b("trigger-click");
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
899
|
+
e.requestShow(), B(I);
|
|
900
|
+
};
|
|
901
|
+
return {
|
|
902
|
+
/**
|
|
903
|
+
* Handles Kendo Menu selection: records keyboard or mouse modality,
|
|
904
|
+
* requests popup close, then runs the optional caller-owned action.
|
|
905
|
+
*/
|
|
906
|
+
handleMenuSelect: (u, S) => {
|
|
907
|
+
b(
|
|
908
|
+
u.event?.type?.startsWith("key") ? "keyboard" : "mouse-selection"
|
|
909
|
+
), S?.(u);
|
|
910
|
+
},
|
|
911
|
+
/**
|
|
912
|
+
* Toggles the action menu. When opening, focuses the first enabled Kendo
|
|
913
|
+
* Menu item after Vue renders the popup.
|
|
914
|
+
*/
|
|
915
|
+
handleActionButtonClick: M,
|
|
916
|
+
/**
|
|
917
|
+
* Handles trigger keyboard input: Enter and Space toggle the menu; Escape
|
|
918
|
+
* closes an open menu or focuses the configured target when already closed.
|
|
919
|
+
*/
|
|
920
|
+
handleActionButtonKeydown: (u) => {
|
|
921
|
+
if (u.key === "Enter" || u.code === "Space") {
|
|
922
|
+
u.preventDefault(), M();
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
if (u.key === "Escape") {
|
|
926
|
+
if (u.preventDefault(), u.stopPropagation(), e.isOpen.value) {
|
|
927
|
+
b("keyboard");
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
g();
|
|
931
|
+
}
|
|
932
|
+
},
|
|
933
|
+
/** Closes the open menu through the keyboard path when Escape is pressed inside it. */
|
|
934
|
+
handleActionMenuEscape: (u) => {
|
|
935
|
+
u.preventDefault(), u.stopPropagation(), b("keyboard");
|
|
936
|
+
},
|
|
937
|
+
/**
|
|
938
|
+
* Restores focus after Kendo Popup closes: keyboard closes prefer the
|
|
939
|
+
* configured focus target, mouse selections return to the trigger, and
|
|
940
|
+
* outside clicks do not move focus.
|
|
941
|
+
*/
|
|
942
|
+
handlePopupClose: () => {
|
|
943
|
+
B(() => {
|
|
944
|
+
t.value === "keyboard" ? g() : t.value === "mouse-selection" && A()?.focus(), t.value = null;
|
|
945
|
+
});
|
|
946
|
+
}
|
|
947
|
+
};
|
|
948
|
+
};
|
|
949
|
+
function gt(e) {
|
|
950
|
+
const t = U(""), l = U(void 0), A = U(!!e.debug), m = U(e.dateFormat ?? "mm/dd/yyyy"), g = f(() => !!e.required), I = 1e3, b = U(!1), M = ["ArrowUp", "ArrowDown"], $ = ["ArrowLeft", "ArrowRight"], h = f(() => (t.value ?? "").replace(/\D/g, "")), P = (a) => a <= 2 ? "mm" : a <= 5 ? "dd" : h.value.length <= 10 ? "yyyy" : "mm", E = f(() => {
|
|
739
951
|
const a = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0";
|
|
740
952
|
return parseInt(a).toString().padStart(2, "0");
|
|
741
|
-
}),
|
|
953
|
+
}), u = f(() => {
|
|
742
954
|
const a = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0";
|
|
743
955
|
return parseInt(a).toString().padStart(2, "0");
|
|
744
|
-
}),
|
|
956
|
+
}), S = f(() => {
|
|
745
957
|
const a = t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0";
|
|
746
958
|
return parseInt(a).toString().padStart(4, "0");
|
|
747
|
-
}),
|
|
748
|
-
if (
|
|
959
|
+
}), Z = (a) => {
|
|
960
|
+
if (h.value.length === 0) {
|
|
749
961
|
e.onChange({ value: null, event: a });
|
|
750
962
|
return;
|
|
751
963
|
}
|
|
752
|
-
if (
|
|
964
|
+
if (h.value.length < 8) {
|
|
753
965
|
e.onChange({ value: null, event: a });
|
|
754
966
|
return;
|
|
755
967
|
}
|
|
756
|
-
if ((t.value ?? "").length === 10 &&
|
|
757
|
-
const [
|
|
758
|
-
if (
|
|
759
|
-
const i =
|
|
760
|
-
|
|
968
|
+
if ((t.value ?? "").length === 10 && h.value.length === 8) {
|
|
969
|
+
const [d, F, K] = t.value.split("/"), N = parseInt(d), W = parseInt(F), n = parseInt(K);
|
|
970
|
+
if (J(n, N, W)) {
|
|
971
|
+
const i = H(n, N, W);
|
|
972
|
+
v(i) ? e.onChange({ value: i, event: a }) : e.onChange({ value: null, event: a });
|
|
761
973
|
} else
|
|
762
974
|
e.onChange({ value: null, event: a });
|
|
763
975
|
}
|
|
764
|
-
},
|
|
765
|
-
const
|
|
766
|
-
return !(
|
|
767
|
-
},
|
|
768
|
-
if ((t.value ?? "").length === 10 &&
|
|
769
|
-
const [a,
|
|
770
|
-
if (
|
|
771
|
-
return
|
|
976
|
+
}, v = (a) => {
|
|
977
|
+
const d = e.min ?? void 0, F = e.max ?? void 0;
|
|
978
|
+
return !(d && a < d || F && a > F);
|
|
979
|
+
}, k = f(() => {
|
|
980
|
+
if ((t.value ?? "").length === 10 && h.value.length === 8) {
|
|
981
|
+
const [a, d, F] = (t.value ?? "").split("/"), K = parseInt(a), N = parseInt(d), W = parseInt(F);
|
|
982
|
+
if (J(W, K, N))
|
|
983
|
+
return H(W, K, N);
|
|
772
984
|
}
|
|
773
985
|
return null;
|
|
774
|
-
}), V =
|
|
986
|
+
}), V = f(() => (t.value ?? "").length === 10 && h.value.length === 8), H = (a, d, F) => {
|
|
775
987
|
const K = /* @__PURE__ */ new Date(0);
|
|
776
|
-
return K.setFullYear(a,
|
|
777
|
-
},
|
|
988
|
+
return K.setFullYear(a, d - 1, F), K.setHours(0, 0, 0, 0), K;
|
|
989
|
+
}, Q = (a, d) => H(a, d + 1, 0).getDate(), J = (a, d, F) => d >= 1 && d <= 12 && a >= I && F >= 1 && F <= Q(a, d), ee = (a) => {
|
|
778
990
|
t.value = a.value;
|
|
779
|
-
const
|
|
780
|
-
l.value =
|
|
781
|
-
},
|
|
991
|
+
const d = a.event?.target;
|
|
992
|
+
l.value = d?.selectionStart ?? 0, Z(a);
|
|
993
|
+
}, oe = (a) => {
|
|
782
994
|
l.value = a.target.selectionStart ?? 0;
|
|
783
|
-
}, o = (a,
|
|
784
|
-
const K =
|
|
995
|
+
}, o = (a, d, F) => {
|
|
996
|
+
const K = d?.selectionStart ?? l.value ?? 0;
|
|
785
997
|
l.value = K;
|
|
786
|
-
let
|
|
787
|
-
if (!(
|
|
998
|
+
let N = parseInt(E.value), W = parseInt(u.value), n = parseInt(S.value);
|
|
999
|
+
if (!(h.value.length >= 8) || !J(n, N, W)) {
|
|
788
1000
|
const z = e.defaultValue ?? /* @__PURE__ */ new Date();
|
|
789
|
-
|
|
1001
|
+
N = z.getMonth() + 1, W = z.getDate(), n = z.getFullYear(), t.value = `${String(N).padStart(2, "0")}/${String(W).padStart(
|
|
790
1002
|
2,
|
|
791
1003
|
"0"
|
|
792
1004
|
)}/${String(n)}`;
|
|
793
|
-
const
|
|
794
|
-
e.onChange({ value:
|
|
1005
|
+
const ce = H(n, N, W);
|
|
1006
|
+
e.onChange({ value: v(ce) ? ce : null, event: F }), y({ useRAF: !0 });
|
|
795
1007
|
return;
|
|
796
1008
|
}
|
|
797
|
-
const
|
|
798
|
-
if (
|
|
799
|
-
|
|
800
|
-
else if (
|
|
801
|
-
const z = new Date(n,
|
|
1009
|
+
const T = P(K);
|
|
1010
|
+
if (T === "mm")
|
|
1011
|
+
N = a === "ArrowUp" ? N < 12 ? N + 1 : 1 : N > 1 ? N - 1 : 12;
|
|
1012
|
+
else if (T === "dd") {
|
|
1013
|
+
const z = new Date(n, N, 0).getDate();
|
|
802
1014
|
W = a === "ArrowUp" ? W < z ? W + 1 : 1 : W > 1 ? W - 1 : z;
|
|
803
|
-
} else
|
|
804
|
-
t.value = `${String(
|
|
1015
|
+
} else T === "yyyy" && (n = a === "ArrowUp" ? n + 1 : Math.max(1, n - 1));
|
|
1016
|
+
t.value = `${String(N).padStart(2, "0")}/${String(W).padStart(
|
|
805
1017
|
2,
|
|
806
1018
|
"0"
|
|
807
1019
|
)}/${String(n)}`;
|
|
808
|
-
const [q, _,
|
|
809
|
-
parseInt(
|
|
1020
|
+
const [q, _, X] = t.value.split("/"), O = H(
|
|
1021
|
+
parseInt(X),
|
|
810
1022
|
parseInt(q),
|
|
811
1023
|
parseInt(_)
|
|
812
1024
|
);
|
|
813
|
-
O.toString() !== "Invalid Date" && parseInt(
|
|
814
|
-
value:
|
|
815
|
-
event:
|
|
816
|
-
}) : e.onChange({ value: null, event:
|
|
817
|
-
},
|
|
1025
|
+
O.toString() !== "Invalid Date" && parseInt(X) >= 1e3 ? e.onChange({
|
|
1026
|
+
value: v(O) ? O : null,
|
|
1027
|
+
event: F
|
|
1028
|
+
}) : e.onChange({ value: null, event: F }), y({ useRAF: !0 });
|
|
1029
|
+
}, w = (a) => {
|
|
818
1030
|
if (a.code === "Space" || a.key === " ") {
|
|
819
1031
|
a.preventDefault(), a.stopPropagation(), e.onShowCalendar(a);
|
|
820
1032
|
return;
|
|
@@ -823,72 +1035,72 @@ function pt(e) {
|
|
|
823
1035
|
a.preventDefault(), a.stopPropagation(), e.onShowCalendar(a);
|
|
824
1036
|
return;
|
|
825
1037
|
}
|
|
826
|
-
if (
|
|
1038
|
+
if (M.includes(a.key)) {
|
|
827
1039
|
if (a.altKey) return;
|
|
828
1040
|
a.preventDefault(), a.stopPropagation();
|
|
829
|
-
const
|
|
830
|
-
o(a.key,
|
|
1041
|
+
const d = a.target;
|
|
1042
|
+
o(a.key, d, a);
|
|
831
1043
|
return;
|
|
832
1044
|
}
|
|
833
|
-
},
|
|
1045
|
+
}, c = (a) => {
|
|
834
1046
|
a.preventDefault();
|
|
835
|
-
const
|
|
836
|
-
o(
|
|
1047
|
+
const d = a.deltaY < 0 ? "ArrowUp" : "ArrowDown";
|
|
1048
|
+
o(d, a.target, a);
|
|
837
1049
|
}, p = (a) => {
|
|
838
|
-
const
|
|
839
|
-
if (
|
|
840
|
-
l.value =
|
|
1050
|
+
const d = a.target;
|
|
1051
|
+
if ($.includes(a.key)) {
|
|
1052
|
+
l.value = d?.selectionStart ?? 0;
|
|
841
1053
|
return;
|
|
842
1054
|
}
|
|
843
|
-
if (
|
|
1055
|
+
if (M.includes(a.key)) {
|
|
844
1056
|
if (a.altKey) return;
|
|
845
|
-
l.value =
|
|
1057
|
+
l.value = d?.selectionStart ?? 0;
|
|
846
1058
|
}
|
|
847
|
-
},
|
|
848
|
-
|
|
849
|
-
const
|
|
850
|
-
|
|
851
|
-
},
|
|
852
|
-
const
|
|
853
|
-
const
|
|
1059
|
+
}, x = (a) => {
|
|
1060
|
+
b.value = !0, g.value && !e.defaultValue && e.externalValue && e.externalValue.value === void 0 && h.value.length === 0 && (e.externalValue.value = "");
|
|
1061
|
+
const d = a.target;
|
|
1062
|
+
d && (l.value = d.selectionStart ?? 0);
|
|
1063
|
+
}, y = (a) => {
|
|
1064
|
+
const d = () => {
|
|
1065
|
+
const F = document.getElementById(
|
|
854
1066
|
e.id
|
|
855
1067
|
);
|
|
856
|
-
if (
|
|
857
|
-
const K = a?.pos ?? l.value ??
|
|
1068
|
+
if (!F) return;
|
|
1069
|
+
const K = a?.pos ?? l.value ?? F.value.length;
|
|
858
1070
|
try {
|
|
859
|
-
|
|
1071
|
+
F.focus(), F.setSelectionRange(K, K);
|
|
860
1072
|
} catch {
|
|
861
1073
|
}
|
|
862
1074
|
};
|
|
863
|
-
|
|
1075
|
+
B(() => {
|
|
864
1076
|
if (a?.delay && a.delay > 0) {
|
|
865
|
-
setTimeout(
|
|
1077
|
+
setTimeout(d, a.delay);
|
|
866
1078
|
return;
|
|
867
1079
|
}
|
|
868
1080
|
if (a?.useRAF) {
|
|
869
|
-
requestAnimationFrame(
|
|
1081
|
+
requestAnimationFrame(d);
|
|
870
1082
|
return;
|
|
871
1083
|
}
|
|
872
|
-
|
|
1084
|
+
d();
|
|
873
1085
|
});
|
|
874
1086
|
};
|
|
875
|
-
e.externalValue &&
|
|
1087
|
+
e.externalValue && ue(
|
|
876
1088
|
e.externalValue,
|
|
877
1089
|
(a) => {
|
|
878
1090
|
if (a) {
|
|
879
|
-
const
|
|
880
|
-
if (
|
|
881
|
-
const
|
|
882
|
-
t.value = `${
|
|
1091
|
+
const d = new Date(a);
|
|
1092
|
+
if (d.toString() !== "Invalid Date") {
|
|
1093
|
+
const F = (d.getMonth() + 1).toString().padStart(2, "0"), K = d.getDate().toString().padStart(2, "0"), N = d.getFullYear().toString();
|
|
1094
|
+
t.value = `${F}/${K}/${N}`, y({ delay: 50 });
|
|
883
1095
|
return;
|
|
884
1096
|
}
|
|
885
1097
|
}
|
|
886
1098
|
},
|
|
887
1099
|
{ immediate: !0 }
|
|
888
1100
|
);
|
|
889
|
-
const
|
|
890
|
-
["Date", `${
|
|
891
|
-
["Digits only",
|
|
1101
|
+
const C = f(() => [
|
|
1102
|
+
["Date", `${E.value} / ${u.value} / ${S.value}`],
|
|
1103
|
+
["Digits only", h.value],
|
|
892
1104
|
[
|
|
893
1105
|
"min",
|
|
894
1106
|
e.min?.toLocaleDateString("en-US", {
|
|
@@ -905,50 +1117,50 @@ function pt(e) {
|
|
|
905
1117
|
day: "2-digit"
|
|
906
1118
|
}) ?? null
|
|
907
1119
|
]
|
|
908
|
-
]), L =
|
|
1120
|
+
]), L = f(() => {
|
|
909
1121
|
if (!g.value) {
|
|
910
1122
|
if (!V.value) return !0;
|
|
911
|
-
const
|
|
912
|
-
return
|
|
1123
|
+
const d = k.value;
|
|
1124
|
+
return d ? v(d) : !1;
|
|
913
1125
|
}
|
|
914
|
-
if (!
|
|
915
|
-
const a =
|
|
916
|
-
return !V.value || !a ? !1 :
|
|
917
|
-
}), Y =
|
|
1126
|
+
if (!b.value) return !0;
|
|
1127
|
+
const a = k.value;
|
|
1128
|
+
return !V.value || !a ? !1 : v(a);
|
|
1129
|
+
}), Y = f(() => {
|
|
918
1130
|
if (!g.value) {
|
|
919
1131
|
if (!V.value) return;
|
|
920
|
-
const
|
|
921
|
-
return
|
|
1132
|
+
const d = k.value;
|
|
1133
|
+
return d ? v(d) ? "valid" : "out-of-bounds" : "invalid-date";
|
|
922
1134
|
}
|
|
923
|
-
if (!
|
|
924
|
-
if (
|
|
1135
|
+
if (!b.value) return;
|
|
1136
|
+
if (h.value.length === 0 || !V.value)
|
|
925
1137
|
return "incomplete";
|
|
926
|
-
const a =
|
|
927
|
-
return a ?
|
|
928
|
-
}), ae =
|
|
1138
|
+
const a = k.value;
|
|
1139
|
+
return a ? v(a) ? "valid" : "out-of-bounds" : "invalid-date";
|
|
1140
|
+
}), ae = f(() => {
|
|
929
1141
|
const a = Y.value;
|
|
930
1142
|
if (!a || a === "valid") return "";
|
|
931
1143
|
if (a === "incomplete")
|
|
932
1144
|
return "Required";
|
|
933
1145
|
if (a === "invalid-date")
|
|
934
1146
|
return `Must be in ${m.value} format.`;
|
|
935
|
-
const
|
|
1147
|
+
const d = e.min ? e.min.toLocaleDateString("en-US", {
|
|
936
1148
|
year: "numeric",
|
|
937
1149
|
month: "2-digit",
|
|
938
1150
|
day: "2-digit"
|
|
939
|
-
}) : null,
|
|
1151
|
+
}) : null, F = e.max ? e.max.toLocaleDateString("en-US", {
|
|
940
1152
|
year: "numeric",
|
|
941
1153
|
month: "2-digit",
|
|
942
1154
|
day: "2-digit"
|
|
943
1155
|
}) : null;
|
|
944
1156
|
if (a === "out-of-bounds") {
|
|
945
|
-
if (
|
|
946
|
-
if (
|
|
947
|
-
if (
|
|
1157
|
+
if (d && F) return `Must be between ${d} and ${F}.`;
|
|
1158
|
+
if (d) return `Must be on or after ${d}.`;
|
|
1159
|
+
if (F) return `Must be on or before ${F}.`;
|
|
948
1160
|
}
|
|
949
1161
|
return "";
|
|
950
1162
|
}), se = () => {
|
|
951
|
-
|
|
1163
|
+
B(() => {
|
|
952
1164
|
const a = document.getElementById(
|
|
953
1165
|
e.id
|
|
954
1166
|
);
|
|
@@ -956,87 +1168,84 @@ function pt(e) {
|
|
|
956
1168
|
console.warn(`ID (#${e.id}) not found for styling.`);
|
|
957
1169
|
return;
|
|
958
1170
|
}
|
|
959
|
-
const
|
|
960
|
-
if (!
|
|
1171
|
+
const d = a.closest(".k-datepicker");
|
|
1172
|
+
if (!d) {
|
|
961
1173
|
console.warn(`.k-datepicker parent not found for #${e.id} styling.`);
|
|
962
1174
|
return;
|
|
963
1175
|
}
|
|
964
|
-
const
|
|
965
|
-
if (
|
|
966
|
-
if (
|
|
1176
|
+
const F = d.parentElement;
|
|
1177
|
+
if (F) {
|
|
1178
|
+
if (F.classList.contains("fk-datepicker"))
|
|
967
1179
|
return;
|
|
968
|
-
|
|
1180
|
+
F.classList.add("fk-datepicker");
|
|
969
1181
|
} else
|
|
970
1182
|
console.warn(
|
|
971
1183
|
`Parent of .k-datepicker not found for #${e.id} styling.`
|
|
972
1184
|
);
|
|
973
1185
|
});
|
|
974
1186
|
};
|
|
975
|
-
return
|
|
1187
|
+
return Ie(() => {
|
|
976
1188
|
se();
|
|
977
1189
|
}), {
|
|
978
1190
|
raw: t,
|
|
979
1191
|
cursorPos: l,
|
|
980
|
-
debugEnabled:
|
|
981
|
-
debugLines:
|
|
1192
|
+
debugEnabled: A,
|
|
1193
|
+
debugLines: C,
|
|
982
1194
|
placeholder: m,
|
|
983
1195
|
isValid: L,
|
|
984
|
-
reason:
|
|
1196
|
+
reason: G(Y),
|
|
985
1197
|
validationMessage: ae,
|
|
986
|
-
digitsOnly:
|
|
987
|
-
month:
|
|
988
|
-
day:
|
|
989
|
-
year:
|
|
990
|
-
datePart:
|
|
1198
|
+
digitsOnly: h,
|
|
1199
|
+
month: G(E),
|
|
1200
|
+
day: G(u),
|
|
1201
|
+
year: G(S),
|
|
1202
|
+
datePart: P,
|
|
991
1203
|
handleChange: ee,
|
|
992
|
-
handleKeyDown:
|
|
993
|
-
handleWheel:
|
|
1204
|
+
handleKeyDown: w,
|
|
1205
|
+
handleWheel: c,
|
|
994
1206
|
handleKeyUp: p,
|
|
995
|
-
handleClick:
|
|
996
|
-
handleBlur:
|
|
1207
|
+
handleClick: oe,
|
|
1208
|
+
handleBlur: x,
|
|
997
1209
|
// Expose so consumers can re-run styling when needed
|
|
998
1210
|
initStyling: se
|
|
999
1211
|
};
|
|
1000
1212
|
}
|
|
1001
|
-
function
|
|
1002
|
-
const t = U(""), l = U(void 0),
|
|
1003
|
-
e.min = e.min ??
|
|
1004
|
-
const
|
|
1213
|
+
function yt(e) {
|
|
1214
|
+
const t = U(""), l = U(void 0), A = U(!!e.debug), m = U(!1), g = 1440 * 60 * 1e3, I = 365 * g, b = /* @__PURE__ */ new Date(), M = new Date(b.getTime() - I), $ = new Date(b.getTime() + I);
|
|
1215
|
+
e.min = e.min ?? M, e.max = e.max ?? $;
|
|
1216
|
+
const h = f(() => (t.value ?? "").replace(/\D/g, "")), P = (r, s) => new Date(r, s, 0).getDate(), E = (r, s, D) => s >= 1 && s <= 12 && r >= 1e3 && D >= 1 && D <= P(r, s), u = (r) => Date.UTC(r.getFullYear(), r.getMonth(), r.getDate()), S = (r) => {
|
|
1005
1217
|
if (!r) return null;
|
|
1006
|
-
const s = e.min ?? new Date(Date.now() - 90 * g),
|
|
1007
|
-
return
|
|
1008
|
-
},
|
|
1009
|
-
if ((r ?? "").length < 23 ||
|
|
1218
|
+
const s = e.min ?? new Date(Date.now() - 90 * g), D = e.max ?? /* @__PURE__ */ new Date(), R = u(r);
|
|
1219
|
+
return R < u(s) || R > u(D) ? null : r;
|
|
1220
|
+
}, Z = (r, s) => e.allowReverse ?? !1 ? !0 : r <= s, v = f(() => (t.value?.length ?? 0) >= 23 && h.value.length >= 16), k = (r) => {
|
|
1221
|
+
if ((r ?? "").length < 23 || h.value.length < 16)
|
|
1010
1222
|
return { start: null, end: null };
|
|
1011
|
-
const s = r.substring(0, 10),
|
|
1223
|
+
const s = r.substring(0, 10), D = r.substring(13, 23), [R, te, ne] = s.split("/").map((pe) => parseInt(pe || "0", 10)), [fe, ve, me] = D.split("/").map((pe) => parseInt(pe || "0", 10)), ge = new Date(ne, R - 1, te), he = new Date(me, fe - 1, ve), we = E(ne, R, te) && ge.toString() !== "Invalid Date", Ae = E(me, fe, ve) && he.toString() !== "Invalid Date";
|
|
1012
1224
|
return { start: we ? ge : null, end: Ae ? he : null };
|
|
1013
|
-
}, V = e.externalValid ?? U(!0),
|
|
1014
|
-
const r =
|
|
1225
|
+
}, V = e.externalValid ?? U(!0), H = f(() => k(t.value)), Q = f(() => {
|
|
1226
|
+
const r = S(H.value.start), s = S(H.value.end);
|
|
1015
1227
|
return { start: r, end: s };
|
|
1016
|
-
}),
|
|
1017
|
-
if (!
|
|
1018
|
-
const r =
|
|
1228
|
+
}), J = f(() => {
|
|
1229
|
+
if (!v.value) return;
|
|
1230
|
+
const r = Q.value.start, s = Q.value.end;
|
|
1019
1231
|
if (!r || !s) return;
|
|
1020
|
-
const
|
|
1021
|
-
return Math.round(
|
|
1022
|
-
}), ee =
|
|
1023
|
-
if (!
|
|
1024
|
-
const { start: r, end: s } =
|
|
1025
|
-
if (!
|
|
1026
|
-
const S = J.value.start, P = J.value.end;
|
|
1027
|
-
return !(!H(S, P) || typeof e.maxSpanDays == "number" && j.value !== void 0 && j.value > e.maxSpanDays);
|
|
1028
|
-
}), ie = d(() => {
|
|
1029
|
-
const { start: r, end: s } = N.value;
|
|
1030
|
-
if (!f.value) return "incomplete";
|
|
1232
|
+
const D = Math.abs(u(s) - u(r));
|
|
1233
|
+
return Math.round(D / 864e5 + 1);
|
|
1234
|
+
}), ee = U(!1), oe = f(() => {
|
|
1235
|
+
if (!ee.value) return;
|
|
1236
|
+
const { start: r, end: s } = H.value;
|
|
1237
|
+
if (!v.value) return "incomplete";
|
|
1031
1238
|
if (!r || !s) return "invalid-date";
|
|
1032
|
-
if (!
|
|
1033
|
-
const
|
|
1034
|
-
return
|
|
1035
|
-
}), o =
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1239
|
+
if (!Q.value.start || !Q.value.end) return "out-of-bounds";
|
|
1240
|
+
const D = Q.value.start, R = Q.value.end;
|
|
1241
|
+
return Z(D, R) ? typeof e.maxSpanDays == "number" && J.value !== void 0 && J.value > e.maxSpanDays ? "span-exceeds-limit" : "valid" : "reversed-range";
|
|
1242
|
+
}), o = f(() => {
|
|
1243
|
+
const r = oe.value;
|
|
1244
|
+
return r === void 0 || r === "valid";
|
|
1245
|
+
}), w = f(() => {
|
|
1246
|
+
const { min: r, max: s } = e, D = oe.value;
|
|
1247
|
+
if (!D) return "";
|
|
1248
|
+
switch (D) {
|
|
1040
1249
|
case "incomplete":
|
|
1041
1250
|
return "Required";
|
|
1042
1251
|
case "invalid-date":
|
|
@@ -1044,86 +1253,86 @@ function vt(e) {
|
|
|
1044
1253
|
case "reversed-range":
|
|
1045
1254
|
return "End Date must be on or after Start Date.";
|
|
1046
1255
|
case "out-of-bounds":
|
|
1047
|
-
return r && s ? `Dates must be between ${
|
|
1256
|
+
return r && s ? `Dates must be between ${y(r)} and ${y(s)}.` : "Dates must be within the allowed range.";
|
|
1048
1257
|
case "span-exceeds-limit":
|
|
1049
1258
|
return typeof e.maxSpanDays == "number" ? `Date range exceeds ${e.maxSpanDays} days.` : "Date range exceeds maximum allowed span.";
|
|
1050
1259
|
default:
|
|
1051
1260
|
return "";
|
|
1052
1261
|
}
|
|
1053
|
-
}),
|
|
1262
|
+
}), c = ["ArrowUp", "ArrowDown"], p = ["ArrowLeft", "ArrowRight"], x = (r, s) => String(r).padStart(s, "0"), y = (r) => `${x(r.getMonth() + 1, 2)}/${x(r.getDate(), 2)}/${x(
|
|
1054
1263
|
r.getFullYear(),
|
|
1055
1264
|
4
|
|
1056
|
-
)}`,
|
|
1057
|
-
const
|
|
1058
|
-
l.value =
|
|
1059
|
-
const { start: te, end: ne } =
|
|
1265
|
+
)}`, C = (r) => r <= 2 ? { side: "start", part: "mm" } : r <= 5 ? { side: "start", part: (r <= 3, "dd") } : r <= 11 ? { side: "start", part: "yyyy" } : r <= 15 ? { side: "end", part: "mm" } : r <= 18 ? { side: "end", part: "dd" } : { side: "end", part: "yyyy" }, L = (r, s, D) => {
|
|
1266
|
+
const R = s?.selectionStart ?? l.value ?? 0;
|
|
1267
|
+
l.value = R;
|
|
1268
|
+
const { start: te, end: ne } = k(t.value);
|
|
1060
1269
|
if (!te && !ne) {
|
|
1061
|
-
const
|
|
1062
|
-
t.value = `${
|
|
1270
|
+
const j = /* @__PURE__ */ new Date(), de = y(j);
|
|
1271
|
+
t.value = `${de} - ${de}`, e.onChange({ value: { start: j, end: j }, event: D }), B(() => {
|
|
1063
1272
|
requestAnimationFrame(() => {
|
|
1064
1273
|
const re = document.getElementById(
|
|
1065
1274
|
e.id
|
|
1066
|
-
),
|
|
1067
|
-
re && (re.focus(), re.setSelectionRange(
|
|
1275
|
+
), ie = l.value ?? 0;
|
|
1276
|
+
re && (re.focus(), re.setSelectionRange(ie, ie));
|
|
1068
1277
|
});
|
|
1069
1278
|
});
|
|
1070
1279
|
return;
|
|
1071
1280
|
}
|
|
1072
|
-
const fe = /* @__PURE__ */ new Date(), ve =
|
|
1281
|
+
const fe = /* @__PURE__ */ new Date(), ve = C(R);
|
|
1073
1282
|
let me = te ? new Date(te) : new Date(fe), ge = ne ? new Date(ne) : new Date(fe);
|
|
1074
|
-
const he = (
|
|
1075
|
-
if (
|
|
1076
|
-
const re =
|
|
1077
|
-
|
|
1078
|
-
const Se =
|
|
1079
|
-
|
|
1080
|
-
} else if (
|
|
1081
|
-
const re =
|
|
1082
|
-
|
|
1083
|
-
} else if (
|
|
1084
|
-
const re =
|
|
1085
|
-
|
|
1086
|
-
const
|
|
1087
|
-
|
|
1283
|
+
const he = (j, de) => {
|
|
1284
|
+
if (de === "mm") {
|
|
1285
|
+
const re = j.getMonth() + 1, ie = r === "ArrowUp" ? re < 12 ? re + 1 : 1 : re > 1 ? re - 1 : 12;
|
|
1286
|
+
j.setMonth(ie - 1);
|
|
1287
|
+
const Se = P(j.getFullYear(), ie);
|
|
1288
|
+
j.getDate() > Se && j.setDate(Se);
|
|
1289
|
+
} else if (de === "dd") {
|
|
1290
|
+
const re = P(j.getFullYear(), j.getMonth() + 1), ie = j.getDate(), Se = r === "ArrowUp" ? ie < re ? ie + 1 : 1 : ie > 1 ? ie - 1 : re;
|
|
1291
|
+
j.setDate(Se);
|
|
1292
|
+
} else if (de === "yyyy") {
|
|
1293
|
+
const re = j.getFullYear();
|
|
1294
|
+
j.setFullYear(r === "ArrowUp" ? re + 1 : Math.max(1, re - 1));
|
|
1295
|
+
const ie = P(j.getFullYear(), j.getMonth() + 1);
|
|
1296
|
+
j.getDate() > ie && j.setDate(ie);
|
|
1088
1297
|
}
|
|
1089
1298
|
};
|
|
1090
1299
|
ve.side === "start" ? he(me, ve.part) : he(ge, ve.part);
|
|
1091
|
-
const we =
|
|
1300
|
+
const we = y(me), Ae = y(ge);
|
|
1092
1301
|
t.value = `${we} - ${Ae}`;
|
|
1093
|
-
const pe =
|
|
1094
|
-
pe && ke &&
|
|
1302
|
+
const pe = S(me), ke = S(ge);
|
|
1303
|
+
pe && ke && Z(pe, ke) ? e.onChange({ value: { start: pe, end: ke }, event: D }) : e.onChange({ value: null, event: D }), B(() => {
|
|
1095
1304
|
requestAnimationFrame(() => {
|
|
1096
|
-
const
|
|
1305
|
+
const j = document.getElementById(
|
|
1097
1306
|
e.id
|
|
1098
|
-
),
|
|
1099
|
-
|
|
1307
|
+
), de = l.value ?? 0;
|
|
1308
|
+
j && (j.focus(), j.setSelectionRange(de, de));
|
|
1100
1309
|
});
|
|
1101
1310
|
});
|
|
1102
1311
|
}, Y = (r) => {
|
|
1103
|
-
const { start: s, end:
|
|
1104
|
-
if (!s || !
|
|
1312
|
+
const { start: s, end: D } = k(t.value);
|
|
1313
|
+
if (!s || !D) {
|
|
1105
1314
|
e.onChange({ value: null, event: r });
|
|
1106
1315
|
return;
|
|
1107
1316
|
}
|
|
1108
|
-
const
|
|
1109
|
-
if (!
|
|
1317
|
+
const R = S(s), te = S(D);
|
|
1318
|
+
if (!R || !te) {
|
|
1110
1319
|
e.onChange({ value: null, event: r });
|
|
1111
1320
|
return;
|
|
1112
1321
|
}
|
|
1113
|
-
if (!
|
|
1322
|
+
if (!Z(R, te)) {
|
|
1114
1323
|
e.onChange({ value: null, event: r });
|
|
1115
1324
|
return;
|
|
1116
1325
|
}
|
|
1117
|
-
e.onChange({ value: { start:
|
|
1326
|
+
e.onChange({ value: { start: R, end: te }, event: r });
|
|
1118
1327
|
}, ae = (r) => {
|
|
1119
|
-
const s = r.value ?? "",
|
|
1120
|
-
if (!s &&
|
|
1121
|
-
W(
|
|
1328
|
+
const s = r.value ?? "", D = r.event;
|
|
1329
|
+
if (!s && D && D.type === "click") {
|
|
1330
|
+
W(D);
|
|
1122
1331
|
return;
|
|
1123
1332
|
}
|
|
1124
1333
|
t.value = s;
|
|
1125
|
-
const
|
|
1126
|
-
l.value =
|
|
1334
|
+
const R = D?.target;
|
|
1335
|
+
l.value = R?.selectionStart ?? 0, Y(r);
|
|
1127
1336
|
}, se = (r) => {
|
|
1128
1337
|
l.value = r.target.selectionStart ?? 0;
|
|
1129
1338
|
}, a = (r) => {
|
|
@@ -1135,63 +1344,63 @@ function vt(e) {
|
|
|
1135
1344
|
r.preventDefault(), r.stopPropagation(), e.onShowCalendar(r);
|
|
1136
1345
|
return;
|
|
1137
1346
|
}
|
|
1138
|
-
if (
|
|
1347
|
+
if (c.includes(r.key)) {
|
|
1139
1348
|
r.preventDefault(), r.stopPropagation();
|
|
1140
1349
|
const s = r.target;
|
|
1141
1350
|
L(r.key, s, r);
|
|
1142
1351
|
return;
|
|
1143
1352
|
}
|
|
1144
|
-
},
|
|
1353
|
+
}, d = (r) => {
|
|
1145
1354
|
r.preventDefault();
|
|
1146
1355
|
const s = r.deltaY < 0 ? "ArrowUp" : "ArrowDown";
|
|
1147
1356
|
L(s, r.target, r);
|
|
1148
|
-
},
|
|
1149
|
-
if (p.includes(r.key) ||
|
|
1357
|
+
}, F = (r) => {
|
|
1358
|
+
if (p.includes(r.key) || c.includes(r.key)) {
|
|
1150
1359
|
const s = r.target;
|
|
1151
1360
|
l.value = s?.selectionStart ?? 0;
|
|
1152
1361
|
}
|
|
1153
1362
|
}, K = () => {
|
|
1154
|
-
|
|
1155
|
-
},
|
|
1363
|
+
ee.value = !0, (e.manageValid ?? !0) && (V.value = o.value);
|
|
1364
|
+
}, N = (r) => {
|
|
1156
1365
|
K();
|
|
1157
1366
|
}, W = (r) => {
|
|
1158
|
-
|
|
1367
|
+
t.value = "", l.value = 0, e.onChange({ value: null, event: r }), K(), B(() => {
|
|
1159
1368
|
const s = document.getElementById(
|
|
1160
1369
|
e.id
|
|
1161
1370
|
);
|
|
1162
1371
|
s && (s.focus(), s.setSelectionRange(0, 0));
|
|
1163
1372
|
});
|
|
1164
1373
|
};
|
|
1165
|
-
e.externalValue &&
|
|
1374
|
+
e.externalValue && ue(
|
|
1166
1375
|
e.externalValue,
|
|
1167
1376
|
(r) => {
|
|
1168
|
-
const s = r?.start ?? null,
|
|
1169
|
-
if (s &&
|
|
1170
|
-
if (t.value = `${
|
|
1171
|
-
const
|
|
1377
|
+
const s = r?.start ?? null, D = r?.end ?? null;
|
|
1378
|
+
if (s && D) {
|
|
1379
|
+
if (t.value = `${y(s)} - ${y(D)}`, e.isOpen?.value && m.value && e.onRequestClose) {
|
|
1380
|
+
const R = typeof e.closeDelay == "number" ? e.closeDelay : e.closeDelay?.value ?? 0;
|
|
1172
1381
|
setTimeout(() => {
|
|
1173
1382
|
e.onRequestClose?.(), m.value = !1, K();
|
|
1174
|
-
},
|
|
1383
|
+
}, R);
|
|
1175
1384
|
}
|
|
1176
1385
|
return;
|
|
1177
1386
|
}
|
|
1178
1387
|
},
|
|
1179
1388
|
{ immediate: !0 }
|
|
1180
1389
|
);
|
|
1181
|
-
const n =
|
|
1390
|
+
const n = f(
|
|
1182
1391
|
() => t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0"
|
|
1183
|
-
), i =
|
|
1392
|
+
), i = f(
|
|
1184
1393
|
() => t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0"
|
|
1185
|
-
),
|
|
1394
|
+
), T = f(
|
|
1186
1395
|
() => t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0"
|
|
1187
|
-
), q =
|
|
1396
|
+
), q = f(
|
|
1188
1397
|
() => t.value && t.value.substring(13, 15).replace(/\D/g, "0") || "0"
|
|
1189
|
-
), _ =
|
|
1398
|
+
), _ = f(
|
|
1190
1399
|
() => t.value && t.value.substring(16, 18).replace(/\D/g, "0") || "0"
|
|
1191
|
-
),
|
|
1400
|
+
), X = f(
|
|
1192
1401
|
() => t.value && t.value.substring(19, 23).replace(/\D/g, "0") || "0"
|
|
1193
|
-
), O =
|
|
1194
|
-
const { start: r, end: s } =
|
|
1402
|
+
), O = f(() => {
|
|
1403
|
+
const { start: r, end: s } = k(t.value);
|
|
1195
1404
|
return [
|
|
1196
1405
|
{
|
|
1197
1406
|
label: "Raw",
|
|
@@ -1209,16 +1418,16 @@ function vt(e) {
|
|
|
1209
1418
|
label: "Start",
|
|
1210
1419
|
value: `${String(n.value).padStart(2, "0")} / ${String(
|
|
1211
1420
|
i.value
|
|
1212
|
-
).padStart(2, "0")} / ${String(
|
|
1421
|
+
).padStart(2, "0")} / ${String(T.value).padStart(4, "0")}`
|
|
1213
1422
|
},
|
|
1214
1423
|
{
|
|
1215
1424
|
label: "End",
|
|
1216
1425
|
value: `${String(q.value).padStart(2, "0")} / ${String(
|
|
1217
1426
|
_.value
|
|
1218
|
-
).padStart(2, "0")} / ${String(
|
|
1427
|
+
).padStart(2, "0")} / ${String(X.value).padStart(4, "0")}`
|
|
1219
1428
|
},
|
|
1220
|
-
{ label: "Digits only", value:
|
|
1221
|
-
{ label: "Mask complete", value: `${
|
|
1429
|
+
{ label: "Digits only", value: h.value },
|
|
1430
|
+
{ label: "Mask complete", value: `${v.value}` },
|
|
1222
1431
|
{
|
|
1223
1432
|
label: "Parsed",
|
|
1224
1433
|
value: `${r ? r.toDateString() : "-"} | ${s ? s.toDateString() : "-"}`
|
|
@@ -1227,21 +1436,21 @@ function vt(e) {
|
|
|
1227
1436
|
label: "Valid (managed)",
|
|
1228
1437
|
value: `${V.value ?? "-"}`
|
|
1229
1438
|
},
|
|
1230
|
-
{ label: "Span (days)", value: `${
|
|
1439
|
+
{ label: "Span (days)", value: `${J.value ?? "-"}` },
|
|
1231
1440
|
{
|
|
1232
1441
|
label: "Reason",
|
|
1233
|
-
value: `${
|
|
1442
|
+
value: `${oe.value ?? "-"}`
|
|
1234
1443
|
},
|
|
1235
1444
|
{
|
|
1236
1445
|
label: "Cursor in",
|
|
1237
1446
|
value: `${l.value ?? "-"} (${(() => {
|
|
1238
|
-
const
|
|
1239
|
-
return `${
|
|
1447
|
+
const D = l.value ?? 0, R = C(D);
|
|
1448
|
+
return `${R.side}.${R.part}`;
|
|
1240
1449
|
})()})`
|
|
1241
1450
|
}
|
|
1242
1451
|
];
|
|
1243
1452
|
}), z = () => {
|
|
1244
|
-
|
|
1453
|
+
B(() => {
|
|
1245
1454
|
const r = document.getElementById(e.id);
|
|
1246
1455
|
if (!r) {
|
|
1247
1456
|
console.warn(`#${e.id} not found for styling.`);
|
|
@@ -1255,25 +1464,25 @@ function vt(e) {
|
|
|
1255
1464
|
s.classList.contains("fk-daterangepicker") || s.classList.add("fk-daterangepicker");
|
|
1256
1465
|
});
|
|
1257
1466
|
};
|
|
1258
|
-
|
|
1467
|
+
Ie(() => {
|
|
1259
1468
|
z();
|
|
1260
1469
|
});
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1470
|
+
const ce = () => {
|
|
1471
|
+
B(() => {
|
|
1263
1472
|
try {
|
|
1264
1473
|
const r = Array.from(
|
|
1265
1474
|
document.querySelectorAll(".k-animation-container")
|
|
1266
1475
|
);
|
|
1267
1476
|
if (!r.length) return;
|
|
1268
|
-
const
|
|
1477
|
+
const D = [...r].reverse().find((ne) => ne.querySelector(".k-calendar"))?.querySelector(
|
|
1269
1478
|
".k-calendar"
|
|
1270
1479
|
);
|
|
1271
|
-
if (!
|
|
1272
|
-
const
|
|
1480
|
+
if (!D) return;
|
|
1481
|
+
const R = D.querySelectorAll(
|
|
1273
1482
|
".k-calendar-table"
|
|
1274
1483
|
);
|
|
1275
1484
|
let te = !1;
|
|
1276
|
-
|
|
1485
|
+
R.forEach((ne) => {
|
|
1277
1486
|
ne.tabIndex === 0 && (te ? ne.tabIndex = -1 : te = !0);
|
|
1278
1487
|
});
|
|
1279
1488
|
} catch (r) {
|
|
@@ -1281,35 +1490,35 @@ function vt(e) {
|
|
|
1281
1490
|
}
|
|
1282
1491
|
});
|
|
1283
1492
|
};
|
|
1284
|
-
return e.isOpen &&
|
|
1493
|
+
return e.isOpen && ue(
|
|
1285
1494
|
e.isOpen,
|
|
1286
1495
|
(r) => {
|
|
1287
|
-
r && setTimeout(() =>
|
|
1496
|
+
r && setTimeout(() => ce(), 0);
|
|
1288
1497
|
},
|
|
1289
1498
|
{ immediate: !1 }
|
|
1290
1499
|
), {
|
|
1291
1500
|
raw: t,
|
|
1292
1501
|
cursorPos: l,
|
|
1293
|
-
debugEnabled:
|
|
1502
|
+
debugEnabled: A,
|
|
1294
1503
|
debugLines: O,
|
|
1295
|
-
digitsOnly:
|
|
1504
|
+
digitsOnly: h,
|
|
1296
1505
|
valid: V,
|
|
1297
|
-
validComputed:
|
|
1298
|
-
reason:
|
|
1299
|
-
validationMessage:
|
|
1300
|
-
spanDays:
|
|
1301
|
-
month1:
|
|
1302
|
-
day1:
|
|
1303
|
-
year1:
|
|
1304
|
-
month2:
|
|
1305
|
-
day2:
|
|
1306
|
-
year2: X
|
|
1506
|
+
validComputed: G(o),
|
|
1507
|
+
reason: G(oe),
|
|
1508
|
+
validationMessage: G(w),
|
|
1509
|
+
spanDays: G(J),
|
|
1510
|
+
month1: G(n),
|
|
1511
|
+
day1: G(i),
|
|
1512
|
+
year1: G(T),
|
|
1513
|
+
month2: G(q),
|
|
1514
|
+
day2: G(_),
|
|
1515
|
+
year2: G(X),
|
|
1307
1516
|
handleChange: ae,
|
|
1308
1517
|
handleKeyDown: a,
|
|
1309
|
-
handleWheel:
|
|
1310
|
-
handleKeyUp:
|
|
1518
|
+
handleWheel: d,
|
|
1519
|
+
handleKeyUp: F,
|
|
1311
1520
|
handleClick: se,
|
|
1312
|
-
handleBlur:
|
|
1521
|
+
handleBlur: N,
|
|
1313
1522
|
handleClear: W,
|
|
1314
1523
|
onCalendarChange: () => {
|
|
1315
1524
|
m.value = !0;
|
|
@@ -1317,69 +1526,69 @@ function vt(e) {
|
|
|
1317
1526
|
initStyling: z
|
|
1318
1527
|
};
|
|
1319
1528
|
}
|
|
1320
|
-
function
|
|
1321
|
-
const t = U(""), l = U(void 0),
|
|
1529
|
+
function ht(e) {
|
|
1530
|
+
const t = U(""), l = U(void 0), A = U(!!e.debug), m = U(e.timeFormat ?? "hh:mm AM"), g = f(() => !!e.required), I = U(!1), b = ["ArrowUp", "ArrowDown"], M = ["ArrowLeft", "ArrowRight"], $ = f(() => (t.value ?? "").replace(/\D/g, "")), h = {
|
|
1322
1531
|
H: /[0-9]/,
|
|
1323
1532
|
h: /[0-9]/,
|
|
1324
1533
|
M: /[0-9]/,
|
|
1325
1534
|
m: /[0-9]/,
|
|
1326
1535
|
A: /[AaPp]/,
|
|
1327
1536
|
a: /[Mm]/
|
|
1328
|
-
},
|
|
1537
|
+
}, P = (n) => n <= 2 ? "hh" : n <= 5 ? "mm" : "ampm", E = f(() => {
|
|
1329
1538
|
const n = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0", i = parseInt(n);
|
|
1330
1539
|
return Math.min(Math.max(i, 0), 23);
|
|
1331
|
-
}),
|
|
1540
|
+
}), u = f(() => {
|
|
1332
1541
|
const n = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0", i = parseInt(n);
|
|
1333
1542
|
return Math.min(Math.max(i, 0), 59);
|
|
1334
|
-
}),
|
|
1335
|
-
const n = parseInt(t.value?.substring(0, 2).replace(/\D/g, "0") || "0"), i =
|
|
1543
|
+
}), S = f(() => (t.value?.substring(6, 8) || "AM").toUpperCase().startsWith("P") ? "PM" : "AM"), Z = f(() => {
|
|
1544
|
+
const n = parseInt(t.value?.substring(0, 2).replace(/\D/g, "0") || "0"), i = S.value;
|
|
1336
1545
|
return n === 12 ? i === "AM" ? 0 : 12 : i === "PM" ? n + 12 : n;
|
|
1337
|
-
}),
|
|
1546
|
+
}), v = f(() => k.value ? `${String(Z.value).padStart(2, "0")}:${String(u.value).padStart(2, "0")}:00` : null), k = f(
|
|
1338
1547
|
() => /^(\d{2}):(\d{2})\s([AP]M)$/i.test(t.value ?? "")
|
|
1339
|
-
), V = (n, i,
|
|
1548
|
+
), V = (n, i, T) => {
|
|
1340
1549
|
let q = n % 12;
|
|
1341
1550
|
return q === 0 && (q = 12), `${String(q).padStart(2, "0")}:${String(i).padStart(
|
|
1342
1551
|
2,
|
|
1343
1552
|
"0"
|
|
1344
|
-
)} ${
|
|
1345
|
-
},
|
|
1553
|
+
)} ${T}`;
|
|
1554
|
+
}, H = (n) => {
|
|
1346
1555
|
const i = n.match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
|
|
1347
1556
|
if (!i) return null;
|
|
1348
|
-
const
|
|
1349
|
-
if (
|
|
1350
|
-
let
|
|
1351
|
-
_ === "PM" && (
|
|
1557
|
+
const T = parseInt(i[1]), q = parseInt(i[2]), _ = i[3].toUpperCase();
|
|
1558
|
+
if (T < 1 || T > 12 || q < 0 || q > 59) return null;
|
|
1559
|
+
let X = T % 12;
|
|
1560
|
+
_ === "PM" && (X += 12);
|
|
1352
1561
|
const O = /* @__PURE__ */ new Date();
|
|
1353
|
-
return O.setSeconds(0, 0), O.setHours(
|
|
1354
|
-
},
|
|
1355
|
-
if (
|
|
1562
|
+
return O.setSeconds(0, 0), O.setHours(X), O.setMinutes(q), O;
|
|
1563
|
+
}, Q = (n) => {
|
|
1564
|
+
if ($.value.length === 0) {
|
|
1356
1565
|
e.onChange({ value: null, event: n });
|
|
1357
1566
|
return;
|
|
1358
1567
|
}
|
|
1359
|
-
if (!
|
|
1568
|
+
if (!k.value) {
|
|
1360
1569
|
e.onChange({ value: null, event: n });
|
|
1361
1570
|
return;
|
|
1362
1571
|
}
|
|
1363
|
-
const i =
|
|
1572
|
+
const i = H(t.value);
|
|
1364
1573
|
i && ee(i) ? e.onChange({ value: i, event: n }) : e.onChange({ value: null, event: n });
|
|
1365
|
-
},
|
|
1366
|
-
const i = e.min ?? void 0,
|
|
1574
|
+
}, J = (n) => n.getHours() * 60 + n.getMinutes(), ee = (n) => {
|
|
1575
|
+
const i = e.min ?? void 0, T = e.max ?? void 0, q = J(n);
|
|
1367
1576
|
if (i) {
|
|
1368
|
-
const _ =
|
|
1577
|
+
const _ = J(i);
|
|
1369
1578
|
if (q < _) return !1;
|
|
1370
1579
|
}
|
|
1371
|
-
if (
|
|
1372
|
-
const _ =
|
|
1580
|
+
if (T) {
|
|
1581
|
+
const _ = J(T);
|
|
1373
1582
|
if (q > _) return !1;
|
|
1374
1583
|
}
|
|
1375
1584
|
return !0;
|
|
1376
|
-
},
|
|
1377
|
-
const i = n.getHours(),
|
|
1378
|
-
t.value = V(i, n.getMinutes(),
|
|
1585
|
+
}, oe = (n) => {
|
|
1586
|
+
const i = n.getHours(), T = i >= 12 ? "PM" : "AM";
|
|
1587
|
+
t.value = V(i, n.getMinutes(), T);
|
|
1379
1588
|
}, o = (n, i) => {
|
|
1380
1589
|
e.onChange({ value: n, event: i });
|
|
1381
|
-
},
|
|
1382
|
-
|
|
1590
|
+
}, w = () => {
|
|
1591
|
+
B(() => {
|
|
1383
1592
|
requestAnimationFrame(() => {
|
|
1384
1593
|
requestAnimationFrame(() => {
|
|
1385
1594
|
const n = document.getElementById(
|
|
@@ -1393,23 +1602,23 @@ function mt(e) {
|
|
|
1393
1602
|
});
|
|
1394
1603
|
});
|
|
1395
1604
|
});
|
|
1396
|
-
},
|
|
1605
|
+
}, c = (n) => {
|
|
1397
1606
|
const i = n?.event?.target;
|
|
1398
1607
|
return i ? i.closest(".k-time-now") ? "now" : i.closest(".k-time-accept") ? "set" : null : null;
|
|
1399
1608
|
}, p = (n, i) => {
|
|
1400
1609
|
n && ee(n) ? o(n, i) : o(null, i);
|
|
1401
|
-
},
|
|
1610
|
+
}, x = (...n) => {
|
|
1402
1611
|
const i = n[0];
|
|
1403
1612
|
if (!i) return;
|
|
1404
|
-
const
|
|
1405
|
-
if (
|
|
1613
|
+
const T = c(i);
|
|
1614
|
+
if (T === "now") {
|
|
1406
1615
|
const _ = /* @__PURE__ */ new Date();
|
|
1407
|
-
|
|
1616
|
+
oe(_), p(_, i), w();
|
|
1408
1617
|
return;
|
|
1409
1618
|
}
|
|
1410
1619
|
if (i?.value instanceof Date) {
|
|
1411
1620
|
const _ = new Date(i.value);
|
|
1412
|
-
|
|
1621
|
+
oe(_), p(_, i), T === "set" && w();
|
|
1413
1622
|
return;
|
|
1414
1623
|
}
|
|
1415
1624
|
if (i?.value === null) {
|
|
@@ -1421,16 +1630,16 @@ function mt(e) {
|
|
|
1421
1630
|
l.value = q?.selectionStart ?? 0;
|
|
1422
1631
|
try {
|
|
1423
1632
|
const _ = l.value ?? 0;
|
|
1424
|
-
if (
|
|
1425
|
-
const
|
|
1426
|
-
/[Aa]/.test(
|
|
1633
|
+
if (P(_) === "ampm" && (t.value ?? "").length >= 8) {
|
|
1634
|
+
const X = t.value.charAt(6);
|
|
1635
|
+
/[Aa]/.test(X) ? (t.value = `${t.value.slice(0, 6)}AM${t.value.slice(8)}`, B(() => {
|
|
1427
1636
|
requestAnimationFrame(() => {
|
|
1428
1637
|
const O = document.getElementById(
|
|
1429
1638
|
e.id
|
|
1430
1639
|
);
|
|
1431
1640
|
O && (O.focus(), O.setSelectionRange(8, 8));
|
|
1432
1641
|
});
|
|
1433
|
-
})) : /[Pp]/.test(
|
|
1642
|
+
})) : /[Pp]/.test(X) && (t.value = `${t.value.slice(0, 6)}PM${t.value.slice(8)}`, B(() => {
|
|
1434
1643
|
requestAnimationFrame(() => {
|
|
1435
1644
|
const O = document.getElementById(
|
|
1436
1645
|
e.id
|
|
@@ -1441,19 +1650,19 @@ function mt(e) {
|
|
|
1441
1650
|
}
|
|
1442
1651
|
} catch {
|
|
1443
1652
|
}
|
|
1444
|
-
|
|
1445
|
-
},
|
|
1653
|
+
Q(i);
|
|
1654
|
+
}, y = (n) => {
|
|
1446
1655
|
l.value = n.target.selectionStart ?? 0;
|
|
1447
|
-
},
|
|
1656
|
+
}, C = (n, i, T) => {
|
|
1448
1657
|
const q = i?.selectionStart ?? l.value ?? 0;
|
|
1449
1658
|
l.value = q;
|
|
1450
|
-
const _ =
|
|
1451
|
-
if (!
|
|
1452
|
-
if ((t.value ?? "").length === 0 ||
|
|
1453
|
-
const s = /* @__PURE__ */ new Date(),
|
|
1454
|
-
t.value = V(
|
|
1455
|
-
const te =
|
|
1456
|
-
p(te,
|
|
1659
|
+
const _ = P(q), X = (t.value ?? "").match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
|
|
1660
|
+
if (!X) {
|
|
1661
|
+
if ((t.value ?? "").length === 0 || $.value.length === 0) {
|
|
1662
|
+
const s = /* @__PURE__ */ new Date(), D = s.getHours(), R = D >= 12 ? "PM" : "AM";
|
|
1663
|
+
t.value = V(D, s.getMinutes(), R);
|
|
1664
|
+
const te = H(t.value);
|
|
1665
|
+
p(te, T), B(() => {
|
|
1457
1666
|
requestAnimationFrame(() => {
|
|
1458
1667
|
const ne = document.getElementById(
|
|
1459
1668
|
e.id
|
|
@@ -1464,7 +1673,7 @@ function mt(e) {
|
|
|
1464
1673
|
}
|
|
1465
1674
|
return;
|
|
1466
1675
|
}
|
|
1467
|
-
let O = parseInt(
|
|
1676
|
+
let O = parseInt(X[1]), z = parseInt(X[2]), ce = X[3].toUpperCase();
|
|
1468
1677
|
if (_ === "hh")
|
|
1469
1678
|
n === "ArrowUp" ? O = O < 12 ? O + 1 : 1 : O = O > 1 ? O - 1 : 12;
|
|
1470
1679
|
else if (_ === "mm") {
|
|
@@ -1472,26 +1681,26 @@ function mt(e) {
|
|
|
1472
1681
|
if (s === 1)
|
|
1473
1682
|
n === "ArrowUp" ? z = z < 59 ? z + 1 : 0 : z = z > 0 ? z - 1 : 59;
|
|
1474
1683
|
else if (n === "ArrowUp") {
|
|
1475
|
-
const
|
|
1476
|
-
let
|
|
1477
|
-
|
|
1684
|
+
const D = z % s;
|
|
1685
|
+
let R = D === 0 ? z + s : z + (s - D);
|
|
1686
|
+
R >= 60 && (R = 0), z = R;
|
|
1478
1687
|
} else {
|
|
1479
|
-
const
|
|
1480
|
-
let
|
|
1481
|
-
|
|
1688
|
+
const D = z % s;
|
|
1689
|
+
let R = D === 0 ? z - s : z - D;
|
|
1690
|
+
R < 0 && (R = 60 - s), z = R;
|
|
1482
1691
|
}
|
|
1483
|
-
} else _ === "ampm" && (
|
|
1692
|
+
} else _ === "ampm" && (ce = ce === "AM" ? "PM" : "AM");
|
|
1484
1693
|
t.value = `${String(O).padStart(2, "0")}:${String(z).padStart(
|
|
1485
1694
|
2,
|
|
1486
1695
|
"0"
|
|
1487
|
-
)} ${
|
|
1488
|
-
const r =
|
|
1489
|
-
p(r,
|
|
1696
|
+
)} ${ce}`;
|
|
1697
|
+
const r = H(t.value);
|
|
1698
|
+
p(r, T), B(() => {
|
|
1490
1699
|
requestAnimationFrame(() => {
|
|
1491
1700
|
const s = document.getElementById(
|
|
1492
1701
|
e.id
|
|
1493
|
-
),
|
|
1494
|
-
s && (s.focus(), s.setSelectionRange(
|
|
1702
|
+
), D = l.value ?? 0;
|
|
1703
|
+
s && (s.focus(), s.setSelectionRange(D, D));
|
|
1495
1704
|
});
|
|
1496
1705
|
});
|
|
1497
1706
|
}, L = (n) => {
|
|
@@ -1503,57 +1712,57 @@ function mt(e) {
|
|
|
1503
1712
|
n.preventDefault(), n.stopPropagation(), e.onShowPicker(n);
|
|
1504
1713
|
return;
|
|
1505
1714
|
}
|
|
1506
|
-
if (
|
|
1715
|
+
if (b.includes(n.key)) {
|
|
1507
1716
|
if (n.altKey) return;
|
|
1508
1717
|
n.preventDefault(), n.stopPropagation();
|
|
1509
1718
|
const i = n.target;
|
|
1510
|
-
|
|
1719
|
+
C(n.key, i, n);
|
|
1511
1720
|
return;
|
|
1512
1721
|
}
|
|
1513
1722
|
}, Y = (n) => {
|
|
1514
1723
|
n.preventDefault();
|
|
1515
1724
|
const i = n.deltaY < 0 ? "ArrowUp" : "ArrowDown";
|
|
1516
|
-
|
|
1725
|
+
C(i, n.target, n);
|
|
1517
1726
|
}, ae = (n) => {
|
|
1518
1727
|
const i = n.target;
|
|
1519
|
-
if (
|
|
1728
|
+
if (M.includes(n.key)) {
|
|
1520
1729
|
l.value = i?.selectionStart ?? 0;
|
|
1521
1730
|
return;
|
|
1522
1731
|
}
|
|
1523
|
-
if (
|
|
1732
|
+
if (b.includes(n.key)) {
|
|
1524
1733
|
if (n.altKey) return;
|
|
1525
1734
|
l.value = i?.selectionStart ?? 0;
|
|
1526
1735
|
}
|
|
1527
1736
|
}, se = (n) => {
|
|
1528
|
-
|
|
1737
|
+
I.value = !0, g.value && e.externalValue && e.externalValue.value === void 0 && $.value.length === 0 && (e.externalValue.value = "");
|
|
1529
1738
|
const i = n.target;
|
|
1530
1739
|
i && (l.value = i.selectionStart ?? 0);
|
|
1531
1740
|
};
|
|
1532
|
-
e.externalValue &&
|
|
1741
|
+
e.externalValue && ue(
|
|
1533
1742
|
e.externalValue,
|
|
1534
1743
|
(n) => {
|
|
1535
1744
|
if (n) {
|
|
1536
1745
|
const i = new Date(n);
|
|
1537
1746
|
if (i.toString() !== "Invalid Date") {
|
|
1538
|
-
const
|
|
1539
|
-
t.value = V(
|
|
1747
|
+
const T = i.getHours(), q = T >= 12 ? "PM" : "AM";
|
|
1748
|
+
t.value = V(T, i.getMinutes(), q);
|
|
1540
1749
|
return;
|
|
1541
1750
|
}
|
|
1542
1751
|
}
|
|
1543
1752
|
},
|
|
1544
1753
|
{ immediate: !0 }
|
|
1545
1754
|
);
|
|
1546
|
-
const a =
|
|
1755
|
+
const a = f(() => [
|
|
1547
1756
|
["Time", t.value || "--:-- --"],
|
|
1548
|
-
["Hour (12h)",
|
|
1549
|
-
["Hour (24h)",
|
|
1550
|
-
["Minute",
|
|
1551
|
-
["Period",
|
|
1552
|
-
["Time (24h)",
|
|
1553
|
-
["Digits only",
|
|
1757
|
+
["Hour (12h)", E.value],
|
|
1758
|
+
["Hour (24h)", Z.value],
|
|
1759
|
+
["Minute", u.value],
|
|
1760
|
+
["Period", S.value],
|
|
1761
|
+
["Time (24h)", v.value ?? "--:--:--"],
|
|
1762
|
+
["Digits only", $.value],
|
|
1554
1763
|
[
|
|
1555
1764
|
"Parsed Date",
|
|
1556
|
-
|
|
1765
|
+
d.value?.toLocaleDateString("en-US", {
|
|
1557
1766
|
hour: "2-digit",
|
|
1558
1767
|
minute: "2-digit"
|
|
1559
1768
|
}) ?? null
|
|
@@ -1572,32 +1781,32 @@ function mt(e) {
|
|
|
1572
1781
|
minute: "2-digit"
|
|
1573
1782
|
}) ?? null
|
|
1574
1783
|
],
|
|
1575
|
-
["valid",
|
|
1784
|
+
["valid", F.value],
|
|
1576
1785
|
["reason", K.value],
|
|
1577
|
-
["validationMessage",
|
|
1578
|
-
]),
|
|
1579
|
-
() =>
|
|
1580
|
-
),
|
|
1786
|
+
["validationMessage", N.value]
|
|
1787
|
+
]), d = f(
|
|
1788
|
+
() => H(t.value) ?? null
|
|
1789
|
+
), F = f(() => {
|
|
1581
1790
|
if (!g.value) {
|
|
1582
|
-
if (!
|
|
1583
|
-
const i =
|
|
1791
|
+
if (!k.value) return !0;
|
|
1792
|
+
const i = d.value;
|
|
1584
1793
|
return i ? ee(i) : !1;
|
|
1585
1794
|
}
|
|
1586
|
-
if (!
|
|
1587
|
-
const n =
|
|
1588
|
-
return !
|
|
1589
|
-
}), K =
|
|
1795
|
+
if (!I.value) return !0;
|
|
1796
|
+
const n = d.value;
|
|
1797
|
+
return !k.value || !n ? !1 : ee(n);
|
|
1798
|
+
}), K = f(() => {
|
|
1590
1799
|
if (!g.value) {
|
|
1591
|
-
if (!
|
|
1592
|
-
const i =
|
|
1800
|
+
if (!k.value) return;
|
|
1801
|
+
const i = d.value;
|
|
1593
1802
|
return i ? ee(i) ? "valid" : "out-of-bounds" : "invalid-time";
|
|
1594
1803
|
}
|
|
1595
|
-
if (!
|
|
1596
|
-
if (
|
|
1804
|
+
if (!I.value) return;
|
|
1805
|
+
if ($.value.length === 0 || !k.value)
|
|
1597
1806
|
return "incomplete";
|
|
1598
|
-
const n =
|
|
1807
|
+
const n = d.value;
|
|
1599
1808
|
return n ? ee(n) ? "valid" : "out-of-bounds" : "invalid-time";
|
|
1600
|
-
}),
|
|
1809
|
+
}), N = f(() => {
|
|
1601
1810
|
const n = K.value;
|
|
1602
1811
|
if (!n || n === "valid") return "";
|
|
1603
1812
|
if (n === "incomplete")
|
|
@@ -1607,15 +1816,15 @@ function mt(e) {
|
|
|
1607
1816
|
const i = {
|
|
1608
1817
|
hour: "2-digit",
|
|
1609
1818
|
minute: "2-digit"
|
|
1610
|
-
},
|
|
1819
|
+
}, T = e.min ? e.min.toLocaleTimeString("en-US", i) : null, q = e.max ? e.max.toLocaleTimeString("en-US", i) : null;
|
|
1611
1820
|
if (n === "out-of-bounds") {
|
|
1612
|
-
if (
|
|
1613
|
-
if (
|
|
1821
|
+
if (T && q) return `Must be between ${T} and ${q}.`;
|
|
1822
|
+
if (T) return `Must be ${T} or later.`;
|
|
1614
1823
|
if (q) return `Must be ${q} or earlier.`;
|
|
1615
1824
|
}
|
|
1616
1825
|
return "";
|
|
1617
1826
|
}), W = () => {
|
|
1618
|
-
|
|
1827
|
+
B(() => {
|
|
1619
1828
|
const n = document.getElementById(e.id);
|
|
1620
1829
|
if (!n) {
|
|
1621
1830
|
console.warn(`#${e.id} not found for styling.`);
|
|
@@ -1628,259 +1837,126 @@ function mt(e) {
|
|
|
1628
1837
|
);
|
|
1629
1838
|
return;
|
|
1630
1839
|
}
|
|
1631
|
-
const
|
|
1632
|
-
if (!
|
|
1840
|
+
const T = i.parentElement;
|
|
1841
|
+
if (!T) {
|
|
1633
1842
|
console.warn(
|
|
1634
1843
|
`Parent of .k-timepicker not found for #${e.id} styling.`
|
|
1635
1844
|
);
|
|
1636
1845
|
return;
|
|
1637
1846
|
}
|
|
1638
|
-
|
|
1847
|
+
T.classList.contains("fk-timepicker") || T.classList.add("fk-timepicker");
|
|
1639
1848
|
});
|
|
1640
1849
|
};
|
|
1641
|
-
return
|
|
1850
|
+
return Ie(() => {
|
|
1642
1851
|
W();
|
|
1643
1852
|
}), {
|
|
1644
1853
|
raw: t,
|
|
1645
|
-
rules:
|
|
1646
|
-
debugEnabled:
|
|
1854
|
+
rules: h,
|
|
1855
|
+
debugEnabled: A,
|
|
1647
1856
|
debugLines: a,
|
|
1648
1857
|
placeholder: m,
|
|
1649
|
-
isValid:
|
|
1650
|
-
reason:
|
|
1651
|
-
validationMessage:
|
|
1652
|
-
isComplete:
|
|
1858
|
+
isValid: F,
|
|
1859
|
+
reason: G(K),
|
|
1860
|
+
validationMessage: N,
|
|
1861
|
+
isComplete: k,
|
|
1653
1862
|
inRangeTime: ee,
|
|
1654
1863
|
cursorPos: l,
|
|
1655
|
-
hour:
|
|
1656
|
-
hour24:
|
|
1657
|
-
minute:
|
|
1658
|
-
period:
|
|
1659
|
-
time24:
|
|
1660
|
-
parsedRawTime:
|
|
1661
|
-
handleChange:
|
|
1864
|
+
hour: G(E),
|
|
1865
|
+
hour24: G(Z),
|
|
1866
|
+
minute: G(u),
|
|
1867
|
+
period: G(S),
|
|
1868
|
+
time24: G(v),
|
|
1869
|
+
parsedRawTime: G(d),
|
|
1870
|
+
handleChange: x,
|
|
1662
1871
|
handleKeyDown: L,
|
|
1663
1872
|
handleKeyUp: ae,
|
|
1664
|
-
handleClick:
|
|
1873
|
+
handleClick: y,
|
|
1665
1874
|
handleWheel: Y,
|
|
1666
1875
|
handleBlur: se,
|
|
1667
1876
|
// Expose so consumers can reapply theming when Kendo updates DOM
|
|
1668
1877
|
initStyling: W
|
|
1669
1878
|
};
|
|
1670
1879
|
}
|
|
1671
|
-
function
|
|
1672
|
-
|
|
1673
|
-
}
|
|
1674
|
-
const Te = typeof window < "u" && typeof document < "u";
|
|
1675
|
-
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
1676
|
-
const nt = Object.prototype.toString, at = (e) => nt.call(e) === "[object Object]", ye = () => {
|
|
1677
|
-
}, rt = /* @__PURE__ */ lt();
|
|
1678
|
-
function lt() {
|
|
1679
|
-
var e, t;
|
|
1680
|
-
return Te && ((e = window?.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window?.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
|
|
1681
|
-
}
|
|
1682
|
-
function Ee(e) {
|
|
1683
|
-
return Array.isArray(e) ? e : [e];
|
|
1684
|
-
}
|
|
1685
|
-
function ot(e, t, l) {
|
|
1686
|
-
return de(
|
|
1687
|
-
e,
|
|
1688
|
-
t,
|
|
1689
|
-
{
|
|
1690
|
-
...l,
|
|
1691
|
-
immediate: !0
|
|
1692
|
-
}
|
|
1693
|
-
);
|
|
1694
|
-
}
|
|
1695
|
-
const Pe = Te ? window : void 0;
|
|
1696
|
-
function be(e) {
|
|
1697
|
-
var t;
|
|
1698
|
-
const l = le(e);
|
|
1699
|
-
return (t = l?.$el) != null ? t : l;
|
|
1700
|
-
}
|
|
1701
|
-
function xe(...e) {
|
|
1702
|
-
const t = [], l = () => {
|
|
1703
|
-
t.forEach((A) => A()), t.length = 0;
|
|
1704
|
-
}, D = (A, x, T, y) => (A.addEventListener(x, T, y), () => A.removeEventListener(x, T, y)), m = d(() => {
|
|
1705
|
-
const A = Ee(le(e[0])).filter((x) => x != null);
|
|
1706
|
-
return A.every((x) => typeof x != "string") ? A : void 0;
|
|
1707
|
-
}), g = ot(
|
|
1708
|
-
() => {
|
|
1709
|
-
var A, x;
|
|
1710
|
-
return [
|
|
1711
|
-
(x = (A = m.value) == null ? void 0 : A.map((T) => be(T))) != null ? x : [Pe].filter((T) => T != null),
|
|
1712
|
-
Ee(le(m.value ? e[1] : e[0])),
|
|
1713
|
-
Ee(Oe(m.value ? e[2] : e[1])),
|
|
1714
|
-
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
1715
|
-
le(m.value ? e[3] : e[2])
|
|
1716
|
-
];
|
|
1717
|
-
},
|
|
1718
|
-
([A, x, T, y]) => {
|
|
1719
|
-
if (l(), !A?.length || !x?.length || !T?.length)
|
|
1720
|
-
return;
|
|
1721
|
-
const R = at(y) ? { ...y } : y;
|
|
1722
|
-
t.push(
|
|
1723
|
-
...A.flatMap(
|
|
1724
|
-
(k) => x.flatMap(
|
|
1725
|
-
(h) => T.map((I) => D(k, h, I, R))
|
|
1726
|
-
)
|
|
1727
|
-
)
|
|
1728
|
-
);
|
|
1729
|
-
},
|
|
1730
|
-
{ flush: "post" }
|
|
1731
|
-
), C = () => {
|
|
1732
|
-
g(), l();
|
|
1733
|
-
};
|
|
1734
|
-
return tt(l), C;
|
|
1735
|
-
}
|
|
1736
|
-
let Ce = !1;
|
|
1737
|
-
function it(e, t, l = {}) {
|
|
1738
|
-
const { window: D = Pe, ignore: m = [], capture: g = !0, detectIframe: C = !1, controls: A = !1 } = l;
|
|
1739
|
-
if (!D)
|
|
1740
|
-
return A ? { stop: ye, cancel: ye, trigger: ye } : ye;
|
|
1741
|
-
if (rt && !Ce) {
|
|
1742
|
-
Ce = !0;
|
|
1743
|
-
const f = { passive: !0 };
|
|
1744
|
-
Array.from(D.document.body.children).forEach((w) => w.addEventListener("click", ye, f)), D.document.documentElement.addEventListener("click", ye, f);
|
|
1745
|
-
}
|
|
1746
|
-
let x = !0;
|
|
1747
|
-
const T = (f) => le(m).some((w) => {
|
|
1748
|
-
if (typeof w == "string")
|
|
1749
|
-
return Array.from(D.document.querySelectorAll(w)).some((V) => V === f.target || f.composedPath().includes(V));
|
|
1750
|
-
{
|
|
1751
|
-
const V = be(w);
|
|
1752
|
-
return V && (f.target === V || f.composedPath().includes(V));
|
|
1753
|
-
}
|
|
1754
|
-
});
|
|
1755
|
-
function y(f) {
|
|
1756
|
-
const w = le(f);
|
|
1757
|
-
return w && w.$.subTree.shapeFlag === 16;
|
|
1758
|
-
}
|
|
1759
|
-
function R(f, w) {
|
|
1760
|
-
const V = le(f), N = V.$.subTree && V.$.subTree.children;
|
|
1761
|
-
return N == null || !Array.isArray(N) ? !1 : N.some((J) => J.el === w.target || w.composedPath().includes(J.el));
|
|
1762
|
-
}
|
|
1763
|
-
const k = (f) => {
|
|
1764
|
-
const w = be(e);
|
|
1765
|
-
if (f.target != null && !(!(w instanceof Element) && y(e) && R(e, f)) && !(!w || w === f.target || f.composedPath().includes(w))) {
|
|
1766
|
-
if ("detail" in f && f.detail === 0 && (x = !T(f)), !x) {
|
|
1767
|
-
x = !0;
|
|
1768
|
-
return;
|
|
1769
|
-
}
|
|
1770
|
-
t(f);
|
|
1771
|
-
}
|
|
1772
|
-
};
|
|
1773
|
-
let h = !1;
|
|
1774
|
-
const I = [
|
|
1775
|
-
xe(D, "click", (f) => {
|
|
1776
|
-
h || (h = !0, setTimeout(() => {
|
|
1777
|
-
h = !1;
|
|
1778
|
-
}, 0), k(f));
|
|
1779
|
-
}, { passive: !0, capture: g }),
|
|
1780
|
-
xe(D, "pointerdown", (f) => {
|
|
1781
|
-
const w = be(e);
|
|
1782
|
-
x = !T(f) && !!(w && !f.composedPath().includes(w));
|
|
1783
|
-
}, { passive: !0 }),
|
|
1784
|
-
C && xe(D, "blur", (f) => {
|
|
1785
|
-
setTimeout(() => {
|
|
1786
|
-
var w;
|
|
1787
|
-
const V = be(e);
|
|
1788
|
-
((w = D.document.activeElement) == null ? void 0 : w.tagName) === "IFRAME" && !V?.contains(D.document.activeElement) && t(f);
|
|
1789
|
-
}, 0);
|
|
1790
|
-
}, { passive: !0 })
|
|
1791
|
-
].filter(Boolean), H = () => I.forEach((f) => f());
|
|
1792
|
-
return A ? {
|
|
1793
|
-
stop: H,
|
|
1794
|
-
cancel: () => {
|
|
1795
|
-
x = !1;
|
|
1796
|
-
},
|
|
1797
|
-
trigger: (f) => {
|
|
1798
|
-
x = !0, k(f), x = !1;
|
|
1799
|
-
}
|
|
1800
|
-
} : H;
|
|
1801
|
-
}
|
|
1802
|
-
function gt(e) {
|
|
1803
|
-
const t = Ue(null), l = [
|
|
1880
|
+
function bt(e) {
|
|
1881
|
+
const t = Ke(null), l = [
|
|
1804
1882
|
".k-animation-container .k-popup",
|
|
1805
1883
|
".k-popup",
|
|
1806
1884
|
".k-timepicker-popup",
|
|
1807
1885
|
".k-menu-popup"
|
|
1808
|
-
],
|
|
1886
|
+
], A = Array.isArray(e.popupSelector) ? e.popupSelector : [e.popupSelector ?? l].flat(), m = (h) => h ? typeof e.initialFocus == "string" ? h.querySelector(e.initialFocus) ?? h : typeof e.initialFocus == "function" ? e.initialFocus(h) ?? h : h.querySelector(
|
|
1809
1887
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
1810
|
-
) ??
|
|
1888
|
+
) ?? h : null, { activate: g, deactivate: I } = Ne(t, {
|
|
1811
1889
|
escapeDeactivates: !1,
|
|
1812
1890
|
clickOutsideDeactivates: !1,
|
|
1813
1891
|
fallbackFocus: () => t.value,
|
|
1814
1892
|
initialFocus: () => m(t.value),
|
|
1815
1893
|
...e.focusTrapOptions ?? {}
|
|
1816
1894
|
});
|
|
1817
|
-
let
|
|
1818
|
-
const
|
|
1895
|
+
let b = null, M = U(null);
|
|
1896
|
+
const $ = () => {
|
|
1819
1897
|
if (e.resolvePopupEl) return e.resolvePopupEl();
|
|
1820
|
-
const
|
|
1821
|
-
const
|
|
1822
|
-
if (!
|
|
1823
|
-
const
|
|
1824
|
-
(
|
|
1898
|
+
const h = (E, u) => {
|
|
1899
|
+
const S = Array.from(E.querySelectorAll(u));
|
|
1900
|
+
if (!S.length) return null;
|
|
1901
|
+
const Z = S.filter(
|
|
1902
|
+
(v) => v.offsetParent !== null || v.getClientRects().length > 0
|
|
1825
1903
|
);
|
|
1826
|
-
return
|
|
1827
|
-
},
|
|
1828
|
-
for (const
|
|
1829
|
-
const
|
|
1830
|
-
if (
|
|
1904
|
+
return Z[Z.length - 1] ?? S[S.length - 1] ?? null;
|
|
1905
|
+
}, P = e.triggerEl?.value?.closest?.(".k-animation-container") ?? document.body;
|
|
1906
|
+
for (const E of A) {
|
|
1907
|
+
const u = h(P, E);
|
|
1908
|
+
if (u) return u;
|
|
1831
1909
|
}
|
|
1832
|
-
for (const
|
|
1833
|
-
const
|
|
1834
|
-
if (
|
|
1910
|
+
for (const E of A) {
|
|
1911
|
+
const u = h(document, E);
|
|
1912
|
+
if (u) return u;
|
|
1835
1913
|
}
|
|
1836
1914
|
return null;
|
|
1837
1915
|
};
|
|
1838
|
-
return
|
|
1839
|
-
|
|
1840
|
-
}),
|
|
1916
|
+
return Re(t, (h) => {
|
|
1917
|
+
M.value = "outside", e.isOpen.value && e.onRequestClose?.("outside", h);
|
|
1918
|
+
}), ue(
|
|
1841
1919
|
() => e.isOpen.value,
|
|
1842
|
-
(
|
|
1843
|
-
|
|
1844
|
-
const
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
}, document.addEventListener("keydown",
|
|
1848
|
-
})) : (
|
|
1849
|
-
const
|
|
1850
|
-
const
|
|
1851
|
-
|
|
1920
|
+
(h) => {
|
|
1921
|
+
h ? (M.value = null, B(() => {
|
|
1922
|
+
const P = $();
|
|
1923
|
+
P && (t.value = P, setTimeout(() => g(), 0), b || (b = (E) => {
|
|
1924
|
+
E.key === "Escape" && (M.value = "escape", e.isOpen.value && e.onRequestClose?.("escape", E));
|
|
1925
|
+
}, document.addEventListener("keydown", b, !0)));
|
|
1926
|
+
})) : (I(), b && (document.removeEventListener("keydown", b, !0), b = null), t.value = null, M.value === "outside" && B(() => {
|
|
1927
|
+
const P = () => {
|
|
1928
|
+
const E = e.triggerEl?.value, u = E?.querySelector("input"), S = document.activeElement;
|
|
1929
|
+
S && (S === u || E && E.contains(S)) && (u ?? E)?.blur?.();
|
|
1852
1930
|
};
|
|
1853
|
-
requestAnimationFrame(() => setTimeout(
|
|
1854
|
-
}), e.returnFocusToTrigger !== !1 &&
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
const k = e.triggerEl?.value;
|
|
1860
|
-
if (!k) return;
|
|
1861
|
-
(k.querySelector("input") ?? k)?.focus?.();
|
|
1931
|
+
requestAnimationFrame(() => setTimeout(P, 0));
|
|
1932
|
+
}), e.returnFocusToTrigger !== !1 && M.value === "escape" && e.triggerEl?.value && B(() => {
|
|
1933
|
+
const P = () => {
|
|
1934
|
+
const E = e.triggerEl?.value;
|
|
1935
|
+
if (!E) return;
|
|
1936
|
+
(E.querySelector("input") ?? E)?.focus?.();
|
|
1862
1937
|
};
|
|
1863
|
-
requestAnimationFrame(() => setTimeout(
|
|
1864
|
-
}))
|
|
1938
|
+
requestAnimationFrame(() => setTimeout(P, 0));
|
|
1939
|
+
}));
|
|
1865
1940
|
}
|
|
1866
1941
|
), {
|
|
1867
1942
|
popupRef: t,
|
|
1868
1943
|
activate: g,
|
|
1869
|
-
deactivate:
|
|
1870
|
-
lastCloseReason:
|
|
1871
|
-
setPopupEl: (
|
|
1944
|
+
deactivate: I,
|
|
1945
|
+
lastCloseReason: G(M),
|
|
1946
|
+
setPopupEl: (h) => t.value = h
|
|
1872
1947
|
};
|
|
1873
1948
|
}
|
|
1874
1949
|
export {
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1950
|
+
je as useFieldsetTouchTracker,
|
|
1951
|
+
Ge as useFieldsetValidationKit,
|
|
1952
|
+
ft as useGridA11y,
|
|
1953
|
+
pt as useGridActiveFilter,
|
|
1954
|
+
gt as useMaskedDateInput,
|
|
1955
|
+
yt as useMaskedDateRangeInput,
|
|
1956
|
+
ht as useMaskedTimeInput,
|
|
1957
|
+
mt as usePopupMenu,
|
|
1958
|
+
bt as usePopupTrap,
|
|
1959
|
+
vt as useUSAddress,
|
|
1960
|
+
_e as useZipTextBox
|
|
1885
1961
|
};
|
|
1886
1962
|
//# sourceMappingURL=featherk-composables.es.js.map
|