@featherk/composables 0.10.0 → 0.10.2
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 +7 -0
- package/dist/featherk-composables.es.js +922 -843
- 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/package.json +6 -1
|
@@ -1,40 +1,40 @@
|
|
|
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
|
|
15
|
-
const
|
|
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
|
+
const p = o.closest(
|
|
16
16
|
".k-grid-header, .k-grid-content, .k-grid-content-locked"
|
|
17
17
|
);
|
|
18
|
-
return
|
|
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
|
-
const
|
|
37
|
+
const p = [
|
|
38
38
|
// ".k-filter-menu-container .k-dropdownlist[tabindex='0']",
|
|
39
39
|
// ".k-filter-menu-container input.k-input-inner:not([tabindex='-1']):not([disabled])",
|
|
40
40
|
// ".k-filter-menu-container button:not([tabindex='-1']):not([disabled])",
|
|
@@ -43,88 +43,88 @@ 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
|
|
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") {
|
|
66
66
|
o.preventDefault(), o.stopPropagation();
|
|
67
|
-
const
|
|
68
|
-
(o.shiftKey ?
|
|
67
|
+
const p = l.value?.parentElement;
|
|
68
|
+
(o.shiftKey ? p?.previousElementSibling : p?.nextElementSibling)?.querySelector(
|
|
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
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
o.forEach((w) => {
|
|
75
|
+
w.addedNodes.forEach((c) => {
|
|
76
|
+
if (c.nodeType === Node.ELEMENT_NODE) {
|
|
77
|
+
const p = c;
|
|
78
|
+
if (p.classList.contains("k-animation-container")) {
|
|
79
|
+
const y = l.value;
|
|
80
|
+
y && (y.dataset.featherKSortable === "true" || B(() => {
|
|
81
|
+
p.querySelectorAll(
|
|
82
82
|
".k-columnmenu-item-wrapper"
|
|
83
83
|
).forEach((Y) => {
|
|
84
84
|
Y.textContent?.toLowerCase().includes("sort") && Y.remove();
|
|
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
|
|
119
|
-
|
|
116
|
+
}), w.removedNodes.forEach((c) => {
|
|
117
|
+
if (c.nodeType === Node.ELEMENT_NODE) {
|
|
118
|
+
const p = c;
|
|
119
|
+
p.classList.contains("k-animation-container") && p.removeEventListener(
|
|
120
120
|
"keydown",
|
|
121
|
-
|
|
122
|
-
),
|
|
121
|
+
u
|
|
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
|
}
|
|
@@ -135,37 +135,37 @@ const ct = (e, t) => {
|
|
|
135
135
|
subtree: !0
|
|
136
136
|
});
|
|
137
137
|
}, Z = (o) => {
|
|
138
|
-
const
|
|
139
|
-
return !!(["input", "textarea", "select", "button"].includes(
|
|
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
|
-
const
|
|
152
|
+
const p = ["ArrowLeft", "ArrowRight"].includes(
|
|
153
153
|
o.code
|
|
154
154
|
);
|
|
155
|
-
if (!(Z(
|
|
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,307 +197,307 @@ 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)
|
|
232
232
|
try {
|
|
233
233
|
const o = () => {
|
|
234
234
|
try {
|
|
235
|
-
const
|
|
235
|
+
const p = Array.from(
|
|
236
236
|
e.value.$el.querySelectorAll(
|
|
237
237
|
".k-table-row[data-grid-row-index]"
|
|
238
238
|
)
|
|
239
239
|
);
|
|
240
|
-
if (!
|
|
241
|
-
(
|
|
240
|
+
if (!p || p.length === 0 || p.filter(
|
|
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 (
|
|
247
|
-
|
|
246
|
+
if (p.forEach((C) => C.setAttribute("tabindex", "-1")), y) {
|
|
247
|
+
y.setAttribute("tabindex", "0");
|
|
248
248
|
return;
|
|
249
249
|
}
|
|
250
|
-
|
|
251
|
-
} catch (
|
|
252
|
-
console.error("ensureSingleTabindex error:",
|
|
250
|
+
p[0].setAttribute("tabindex", "0");
|
|
251
|
+
} catch (p) {
|
|
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
|
-
|
|
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
279
|
}, Q = () => {
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
|
|
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),
|
|
286
|
+
}), m && (m.disconnect(), m = null), g && (g.disconnect(), g = null), I.forEach((c) => c()), I.length = 0;
|
|
287
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(),
|
|
368
|
+
typeof w == "function" && B(() => {
|
|
369
|
+
l.value && l.value.focus(), w(o), B(() => {
|
|
370
370
|
J();
|
|
371
371
|
});
|
|
372
372
|
});
|
|
373
373
|
}
|
|
374
374
|
}, oe = () => {
|
|
375
|
-
if (!
|
|
375
|
+
if (!A)
|
|
376
376
|
try {
|
|
377
|
-
|
|
377
|
+
k(), V(), H(), A = !0;
|
|
378
378
|
} catch (o) {
|
|
379
379
|
console.error("initA11y failed:", o), Q();
|
|
380
380
|
}
|
|
381
381
|
};
|
|
382
|
-
return
|
|
382
|
+
return Le(() => {
|
|
383
383
|
Q();
|
|
384
384
|
}), {
|
|
385
385
|
activeFilterButton: l,
|
|
386
|
-
handleGridKeyDown:
|
|
386
|
+
handleGridKeyDown: v,
|
|
387
387
|
handleSortChange: ee,
|
|
388
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 Z =
|
|
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
|
-
|
|
427
|
-
) :
|
|
428
|
-
t.value =
|
|
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
|
+
) : V.replace(/\D/g, "").length;
|
|
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,134 +566,134 @@ 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:
|
|
646
|
-
strictCityValid:
|
|
647
|
-
strictStateValid:
|
|
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
|
+
strictCityValid: V,
|
|
647
|
+
strictStateValid: H,
|
|
648
648
|
strictZipValid: Q,
|
|
649
649
|
strictAddressValid: J
|
|
650
|
-
} =
|
|
650
|
+
} = et({
|
|
651
651
|
formData: g,
|
|
652
|
-
isZipValid:
|
|
653
|
-
}), ee =
|
|
652
|
+
isZipValid: u
|
|
653
|
+
}), ee = Ge(t, {
|
|
654
654
|
submitted: l,
|
|
655
655
|
isValid: () => J.value
|
|
656
|
-
}), { touched: oe, fieldsetValidate: o, onFocusout:
|
|
657
|
-
address1:
|
|
658
|
-
city:
|
|
659
|
-
state:
|
|
656
|
+
}), { touched: oe, fieldsetValidate: o, onFocusout: w, reset: c } = ee, p = ee.createFieldValidationsMap({
|
|
657
|
+
address1: k,
|
|
658
|
+
city: V,
|
|
659
|
+
state: H,
|
|
660
660
|
zip: Q,
|
|
661
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
|
-
} =
|
|
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
|
-
),
|
|
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
|
-
}), X =
|
|
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,
|
|
@@ -701,120 +701,332 @@ function ft(e) {
|
|
|
701
701
|
addressValidate: ae,
|
|
702
702
|
address1Valid: se,
|
|
703
703
|
cityValid: a,
|
|
704
|
-
stateValid:
|
|
705
|
-
zipValid:
|
|
706
|
-
addressValid:
|
|
704
|
+
stateValid: d,
|
|
705
|
+
zipValid: F,
|
|
706
|
+
addressValid: K,
|
|
707
707
|
optionalFeedbackActive: O,
|
|
708
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:
|
|
713
|
+
zipDisplay: E,
|
|
714
|
+
zipWrapperClass: S,
|
|
715
|
+
onAddress1Input: I,
|
|
716
|
+
onAddress2Input: b,
|
|
717
|
+
onCityInput: M,
|
|
718
|
+
onStateChange: $,
|
|
719
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
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
|
+
}
|
|
735
|
+
};
|
|
736
|
+
}
|
|
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);
|
|
734
837
|
}
|
|
735
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;
|
|
736
867
|
}
|
|
737
|
-
|
|
738
|
-
|
|
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
959
|
}), Z = (a) => {
|
|
748
|
-
if (
|
|
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 (J(n,
|
|
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 (J(W,
|
|
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
|
-
}),
|
|
775
|
-
const
|
|
776
|
-
return
|
|
777
|
-
}, Q = (a,
|
|
986
|
+
}), V = f(() => (t.value ?? "").length === 10 && h.value.length === 8), H = (a, d, F) => {
|
|
987
|
+
const K = /* @__PURE__ */ new Date(0);
|
|
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 =
|
|
991
|
+
const d = a.event?.target;
|
|
992
|
+
l.value = d?.selectionStart ?? 0, Z(a);
|
|
781
993
|
}, oe = (a) => {
|
|
782
994
|
l.value = a.target.selectionStart ?? 0;
|
|
783
|
-
}, o = (a,
|
|
784
|
-
const
|
|
785
|
-
l.value =
|
|
786
|
-
let
|
|
787
|
-
if (!(
|
|
788
|
-
const
|
|
789
|
-
|
|
995
|
+
}, o = (a, d, F) => {
|
|
996
|
+
const K = d?.selectionStart ?? l.value ?? 0;
|
|
997
|
+
l.value = K;
|
|
998
|
+
let N = parseInt(E.value), W = parseInt(u.value), n = parseInt(S.value);
|
|
999
|
+
if (!(h.value.length >= 8) || !J(n, N, W)) {
|
|
1000
|
+
const z = e.defaultValue ?? /* @__PURE__ */ new Date();
|
|
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
|
|
802
|
-
W = a === "ArrowUp" ? W <
|
|
803
|
-
} else
|
|
804
|
-
t.value = `${String(
|
|
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();
|
|
1014
|
+
W = a === "ArrowUp" ? W < z ? W + 1 : 1 : W > 1 ? W - 1 : z;
|
|
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, _, X] = t.value.split("/"), O =
|
|
1020
|
+
const [q, _, X] = t.value.split("/"), O = H(
|
|
809
1021
|
parseInt(X),
|
|
810
1022
|
parseInt(q),
|
|
811
1023
|
parseInt(_)
|
|
812
1024
|
);
|
|
813
1025
|
O.toString() !== "Invalid Date" && parseInt(X) >= 1e3 ? e.onChange({
|
|
814
|
-
value:
|
|
815
|
-
event:
|
|
816
|
-
}) : e.onChange({ value: null, event:
|
|
817
|
-
},
|
|
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(
|
|
837
|
-
},
|
|
838
|
-
const
|
|
839
|
-
if (
|
|
840
|
-
l.value =
|
|
1047
|
+
const d = a.deltaY < 0 ? "ArrowUp" : "ArrowDown";
|
|
1048
|
+
o(d, a.target, a);
|
|
1049
|
+
}, p = (a) => {
|
|
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
|
|
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
|
-
if (!
|
|
911
|
-
const
|
|
912
|
-
return
|
|
1122
|
+
if (!V.value) return !0;
|
|
1123
|
+
const d = k.value;
|
|
1124
|
+
return d ? v(d) : !1;
|
|
913
1125
|
}
|
|
914
|
-
if (!
|
|
915
|
-
const a =
|
|
916
|
-
return !
|
|
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
|
-
if (!
|
|
920
|
-
const
|
|
921
|
-
return
|
|
1131
|
+
if (!V.value) 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,84 +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
1196
|
reason: G(Y),
|
|
985
1197
|
validationMessage: ae,
|
|
986
|
-
digitsOnly:
|
|
987
|
-
month: G(
|
|
988
|
-
day: G(
|
|
989
|
-
year: G(
|
|
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:
|
|
994
|
-
handleKeyUp:
|
|
1204
|
+
handleKeyDown: w,
|
|
1205
|
+
handleWheel: c,
|
|
1206
|
+
handleKeyUp: p,
|
|
995
1207
|
handleClick: oe,
|
|
996
|
-
handleBlur:
|
|
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
|
-
}, Z = (r, s) => e.allowReverse ?? !1 ? !0 : r <= s,
|
|
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
|
-
},
|
|
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
|
-
}), J =
|
|
1017
|
-
if (!
|
|
1228
|
+
}), J = f(() => {
|
|
1229
|
+
if (!v.value) return;
|
|
1018
1230
|
const r = Q.value.start, s = Q.value.end;
|
|
1019
1231
|
if (!r || !s) return;
|
|
1020
|
-
const
|
|
1021
|
-
return Math.round(
|
|
1022
|
-
}), ee = U(!1), oe =
|
|
1232
|
+
const D = Math.abs(u(s) - u(r));
|
|
1233
|
+
return Math.round(D / 864e5 + 1);
|
|
1234
|
+
}), ee = U(!1), oe = f(() => {
|
|
1023
1235
|
if (!ee.value) return;
|
|
1024
|
-
const { start: r, end: s } =
|
|
1025
|
-
if (!
|
|
1236
|
+
const { start: r, end: s } = H.value;
|
|
1237
|
+
if (!v.value) return "incomplete";
|
|
1026
1238
|
if (!r || !s) return "invalid-date";
|
|
1027
1239
|
if (!Q.value.start || !Q.value.end) return "out-of-bounds";
|
|
1028
|
-
const
|
|
1029
|
-
return Z(
|
|
1030
|
-
}), o =
|
|
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(() => {
|
|
1031
1243
|
const r = oe.value;
|
|
1032
1244
|
return r === void 0 || r === "valid";
|
|
1033
|
-
}),
|
|
1034
|
-
const { min: r, max: s } = e,
|
|
1035
|
-
if (!
|
|
1036
|
-
switch (
|
|
1245
|
+
}), w = f(() => {
|
|
1246
|
+
const { min: r, max: s } = e, D = oe.value;
|
|
1247
|
+
if (!D) return "";
|
|
1248
|
+
switch (D) {
|
|
1037
1249
|
case "incomplete":
|
|
1038
1250
|
return "Required";
|
|
1039
1251
|
case "invalid-date":
|
|
@@ -1041,22 +1253,22 @@ function vt(e) {
|
|
|
1041
1253
|
case "reversed-range":
|
|
1042
1254
|
return "End Date must be on or after Start Date.";
|
|
1043
1255
|
case "out-of-bounds":
|
|
1044
|
-
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.";
|
|
1045
1257
|
case "span-exceeds-limit":
|
|
1046
1258
|
return typeof e.maxSpanDays == "number" ? `Date range exceeds ${e.maxSpanDays} days.` : "Date range exceeds maximum allowed span.";
|
|
1047
1259
|
default:
|
|
1048
1260
|
return "";
|
|
1049
1261
|
}
|
|
1050
|
-
}),
|
|
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(
|
|
1051
1263
|
r.getFullYear(),
|
|
1052
1264
|
4
|
|
1053
|
-
)}`,
|
|
1054
|
-
const
|
|
1055
|
-
l.value =
|
|
1056
|
-
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);
|
|
1057
1269
|
if (!te && !ne) {
|
|
1058
|
-
const j = /* @__PURE__ */ new Date(),
|
|
1059
|
-
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(() => {
|
|
1060
1272
|
requestAnimationFrame(() => {
|
|
1061
1273
|
const re = document.getElementById(
|
|
1062
1274
|
e.id
|
|
@@ -1066,61 +1278,61 @@ function vt(e) {
|
|
|
1066
1278
|
});
|
|
1067
1279
|
return;
|
|
1068
1280
|
}
|
|
1069
|
-
const fe = /* @__PURE__ */ new Date(), ve =
|
|
1281
|
+
const fe = /* @__PURE__ */ new Date(), ve = C(R);
|
|
1070
1282
|
let me = te ? new Date(te) : new Date(fe), ge = ne ? new Date(ne) : new Date(fe);
|
|
1071
|
-
const he = (j,
|
|
1072
|
-
if (
|
|
1283
|
+
const he = (j, de) => {
|
|
1284
|
+
if (de === "mm") {
|
|
1073
1285
|
const re = j.getMonth() + 1, ie = r === "ArrowUp" ? re < 12 ? re + 1 : 1 : re > 1 ? re - 1 : 12;
|
|
1074
1286
|
j.setMonth(ie - 1);
|
|
1075
|
-
const Se =
|
|
1287
|
+
const Se = P(j.getFullYear(), ie);
|
|
1076
1288
|
j.getDate() > Se && j.setDate(Se);
|
|
1077
|
-
} else if (
|
|
1078
|
-
const re =
|
|
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;
|
|
1079
1291
|
j.setDate(Se);
|
|
1080
|
-
} else if (
|
|
1292
|
+
} else if (de === "yyyy") {
|
|
1081
1293
|
const re = j.getFullYear();
|
|
1082
1294
|
j.setFullYear(r === "ArrowUp" ? re + 1 : Math.max(1, re - 1));
|
|
1083
|
-
const ie =
|
|
1295
|
+
const ie = P(j.getFullYear(), j.getMonth() + 1);
|
|
1084
1296
|
j.getDate() > ie && j.setDate(ie);
|
|
1085
1297
|
}
|
|
1086
1298
|
};
|
|
1087
1299
|
ve.side === "start" ? he(me, ve.part) : he(ge, ve.part);
|
|
1088
|
-
const we =
|
|
1300
|
+
const we = y(me), Ae = y(ge);
|
|
1089
1301
|
t.value = `${we} - ${Ae}`;
|
|
1090
|
-
const pe =
|
|
1091
|
-
pe && ke && Z(pe, ke) ? e.onChange({ value: { start: pe, end: ke }, event:
|
|
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(() => {
|
|
1092
1304
|
requestAnimationFrame(() => {
|
|
1093
1305
|
const j = document.getElementById(
|
|
1094
1306
|
e.id
|
|
1095
|
-
),
|
|
1096
|
-
j && (j.focus(), j.setSelectionRange(
|
|
1307
|
+
), de = l.value ?? 0;
|
|
1308
|
+
j && (j.focus(), j.setSelectionRange(de, de));
|
|
1097
1309
|
});
|
|
1098
1310
|
});
|
|
1099
1311
|
}, Y = (r) => {
|
|
1100
|
-
const { start: s, end:
|
|
1101
|
-
if (!s || !
|
|
1312
|
+
const { start: s, end: D } = k(t.value);
|
|
1313
|
+
if (!s || !D) {
|
|
1102
1314
|
e.onChange({ value: null, event: r });
|
|
1103
1315
|
return;
|
|
1104
1316
|
}
|
|
1105
|
-
const
|
|
1106
|
-
if (!
|
|
1317
|
+
const R = S(s), te = S(D);
|
|
1318
|
+
if (!R || !te) {
|
|
1107
1319
|
e.onChange({ value: null, event: r });
|
|
1108
1320
|
return;
|
|
1109
1321
|
}
|
|
1110
|
-
if (!Z(
|
|
1322
|
+
if (!Z(R, te)) {
|
|
1111
1323
|
e.onChange({ value: null, event: r });
|
|
1112
1324
|
return;
|
|
1113
1325
|
}
|
|
1114
|
-
e.onChange({ value: { start:
|
|
1326
|
+
e.onChange({ value: { start: R, end: te }, event: r });
|
|
1115
1327
|
}, ae = (r) => {
|
|
1116
|
-
const s = r.value ?? "",
|
|
1117
|
-
if (!s &&
|
|
1118
|
-
W(
|
|
1328
|
+
const s = r.value ?? "", D = r.event;
|
|
1329
|
+
if (!s && D && D.type === "click") {
|
|
1330
|
+
W(D);
|
|
1119
1331
|
return;
|
|
1120
1332
|
}
|
|
1121
1333
|
t.value = s;
|
|
1122
|
-
const
|
|
1123
|
-
l.value =
|
|
1334
|
+
const R = D?.target;
|
|
1335
|
+
l.value = R?.selectionStart ?? 0, Y(r);
|
|
1124
1336
|
}, se = (r) => {
|
|
1125
1337
|
l.value = r.target.selectionStart ?? 0;
|
|
1126
1338
|
}, a = (r) => {
|
|
@@ -1132,63 +1344,63 @@ function vt(e) {
|
|
|
1132
1344
|
r.preventDefault(), r.stopPropagation(), e.onShowCalendar(r);
|
|
1133
1345
|
return;
|
|
1134
1346
|
}
|
|
1135
|
-
if (
|
|
1347
|
+
if (c.includes(r.key)) {
|
|
1136
1348
|
r.preventDefault(), r.stopPropagation();
|
|
1137
1349
|
const s = r.target;
|
|
1138
1350
|
L(r.key, s, r);
|
|
1139
1351
|
return;
|
|
1140
1352
|
}
|
|
1141
|
-
},
|
|
1353
|
+
}, d = (r) => {
|
|
1142
1354
|
r.preventDefault();
|
|
1143
1355
|
const s = r.deltaY < 0 ? "ArrowUp" : "ArrowDown";
|
|
1144
1356
|
L(s, r.target, r);
|
|
1145
|
-
},
|
|
1146
|
-
if (
|
|
1357
|
+
}, F = (r) => {
|
|
1358
|
+
if (p.includes(r.key) || c.includes(r.key)) {
|
|
1147
1359
|
const s = r.target;
|
|
1148
1360
|
l.value = s?.selectionStart ?? 0;
|
|
1149
1361
|
}
|
|
1150
|
-
},
|
|
1151
|
-
ee.value = !0, (e.manageValid ?? !0) && (
|
|
1152
|
-
},
|
|
1153
|
-
|
|
1362
|
+
}, K = () => {
|
|
1363
|
+
ee.value = !0, (e.manageValid ?? !0) && (V.value = o.value);
|
|
1364
|
+
}, N = (r) => {
|
|
1365
|
+
K();
|
|
1154
1366
|
}, W = (r) => {
|
|
1155
|
-
|
|
1367
|
+
t.value = "", l.value = 0, e.onChange({ value: null, event: r }), K(), B(() => {
|
|
1156
1368
|
const s = document.getElementById(
|
|
1157
1369
|
e.id
|
|
1158
1370
|
);
|
|
1159
1371
|
s && (s.focus(), s.setSelectionRange(0, 0));
|
|
1160
1372
|
});
|
|
1161
1373
|
};
|
|
1162
|
-
e.externalValue &&
|
|
1374
|
+
e.externalValue && ue(
|
|
1163
1375
|
e.externalValue,
|
|
1164
1376
|
(r) => {
|
|
1165
|
-
const s = r?.start ?? null,
|
|
1166
|
-
if (s &&
|
|
1167
|
-
if (t.value = `${
|
|
1168
|
-
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;
|
|
1169
1381
|
setTimeout(() => {
|
|
1170
|
-
e.onRequestClose?.(), m.value = !1,
|
|
1171
|
-
},
|
|
1382
|
+
e.onRequestClose?.(), m.value = !1, K();
|
|
1383
|
+
}, R);
|
|
1172
1384
|
}
|
|
1173
1385
|
return;
|
|
1174
1386
|
}
|
|
1175
1387
|
},
|
|
1176
1388
|
{ immediate: !0 }
|
|
1177
1389
|
);
|
|
1178
|
-
const n =
|
|
1390
|
+
const n = f(
|
|
1179
1391
|
() => t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0"
|
|
1180
|
-
), i =
|
|
1392
|
+
), i = f(
|
|
1181
1393
|
() => t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0"
|
|
1182
|
-
),
|
|
1394
|
+
), T = f(
|
|
1183
1395
|
() => t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0"
|
|
1184
|
-
), q =
|
|
1396
|
+
), q = f(
|
|
1185
1397
|
() => t.value && t.value.substring(13, 15).replace(/\D/g, "0") || "0"
|
|
1186
|
-
), _ =
|
|
1398
|
+
), _ = f(
|
|
1187
1399
|
() => t.value && t.value.substring(16, 18).replace(/\D/g, "0") || "0"
|
|
1188
|
-
), X =
|
|
1400
|
+
), X = f(
|
|
1189
1401
|
() => t.value && t.value.substring(19, 23).replace(/\D/g, "0") || "0"
|
|
1190
|
-
), O =
|
|
1191
|
-
const { start: r, end: s } =
|
|
1402
|
+
), O = f(() => {
|
|
1403
|
+
const { start: r, end: s } = k(t.value);
|
|
1192
1404
|
return [
|
|
1193
1405
|
{
|
|
1194
1406
|
label: "Raw",
|
|
@@ -1206,7 +1418,7 @@ function vt(e) {
|
|
|
1206
1418
|
label: "Start",
|
|
1207
1419
|
value: `${String(n.value).padStart(2, "0")} / ${String(
|
|
1208
1420
|
i.value
|
|
1209
|
-
).padStart(2, "0")} / ${String(
|
|
1421
|
+
).padStart(2, "0")} / ${String(T.value).padStart(4, "0")}`
|
|
1210
1422
|
},
|
|
1211
1423
|
{
|
|
1212
1424
|
label: "End",
|
|
@@ -1214,15 +1426,15 @@ function vt(e) {
|
|
|
1214
1426
|
_.value
|
|
1215
1427
|
).padStart(2, "0")} / ${String(X.value).padStart(4, "0")}`
|
|
1216
1428
|
},
|
|
1217
|
-
{ label: "Digits only", value:
|
|
1218
|
-
{ label: "Mask complete", value: `${
|
|
1429
|
+
{ label: "Digits only", value: h.value },
|
|
1430
|
+
{ label: "Mask complete", value: `${v.value}` },
|
|
1219
1431
|
{
|
|
1220
1432
|
label: "Parsed",
|
|
1221
1433
|
value: `${r ? r.toDateString() : "-"} | ${s ? s.toDateString() : "-"}`
|
|
1222
1434
|
},
|
|
1223
1435
|
{
|
|
1224
1436
|
label: "Valid (managed)",
|
|
1225
|
-
value: `${
|
|
1437
|
+
value: `${V.value ?? "-"}`
|
|
1226
1438
|
},
|
|
1227
1439
|
{ label: "Span (days)", value: `${J.value ?? "-"}` },
|
|
1228
1440
|
{
|
|
@@ -1232,13 +1444,13 @@ function vt(e) {
|
|
|
1232
1444
|
{
|
|
1233
1445
|
label: "Cursor in",
|
|
1234
1446
|
value: `${l.value ?? "-"} (${(() => {
|
|
1235
|
-
const
|
|
1236
|
-
return `${
|
|
1447
|
+
const D = l.value ?? 0, R = C(D);
|
|
1448
|
+
return `${R.side}.${R.part}`;
|
|
1237
1449
|
})()})`
|
|
1238
1450
|
}
|
|
1239
1451
|
];
|
|
1240
|
-
}),
|
|
1241
|
-
|
|
1452
|
+
}), z = () => {
|
|
1453
|
+
B(() => {
|
|
1242
1454
|
const r = document.getElementById(e.id);
|
|
1243
1455
|
if (!r) {
|
|
1244
1456
|
console.warn(`#${e.id} not found for styling.`);
|
|
@@ -1252,25 +1464,25 @@ function vt(e) {
|
|
|
1252
1464
|
s.classList.contains("fk-daterangepicker") || s.classList.add("fk-daterangepicker");
|
|
1253
1465
|
});
|
|
1254
1466
|
};
|
|
1255
|
-
|
|
1256
|
-
|
|
1467
|
+
Ie(() => {
|
|
1468
|
+
z();
|
|
1257
1469
|
});
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1470
|
+
const ce = () => {
|
|
1471
|
+
B(() => {
|
|
1260
1472
|
try {
|
|
1261
1473
|
const r = Array.from(
|
|
1262
1474
|
document.querySelectorAll(".k-animation-container")
|
|
1263
1475
|
);
|
|
1264
1476
|
if (!r.length) return;
|
|
1265
|
-
const
|
|
1477
|
+
const D = [...r].reverse().find((ne) => ne.querySelector(".k-calendar"))?.querySelector(
|
|
1266
1478
|
".k-calendar"
|
|
1267
1479
|
);
|
|
1268
|
-
if (!
|
|
1269
|
-
const
|
|
1480
|
+
if (!D) return;
|
|
1481
|
+
const R = D.querySelectorAll(
|
|
1270
1482
|
".k-calendar-table"
|
|
1271
1483
|
);
|
|
1272
1484
|
let te = !1;
|
|
1273
|
-
|
|
1485
|
+
R.forEach((ne) => {
|
|
1274
1486
|
ne.tabIndex === 0 && (te ? ne.tabIndex = -1 : te = !0);
|
|
1275
1487
|
});
|
|
1276
1488
|
} catch (r) {
|
|
@@ -1278,105 +1490,105 @@ function vt(e) {
|
|
|
1278
1490
|
}
|
|
1279
1491
|
});
|
|
1280
1492
|
};
|
|
1281
|
-
return e.isOpen &&
|
|
1493
|
+
return e.isOpen && ue(
|
|
1282
1494
|
e.isOpen,
|
|
1283
1495
|
(r) => {
|
|
1284
|
-
r && setTimeout(() =>
|
|
1496
|
+
r && setTimeout(() => ce(), 0);
|
|
1285
1497
|
},
|
|
1286
1498
|
{ immediate: !1 }
|
|
1287
1499
|
), {
|
|
1288
1500
|
raw: t,
|
|
1289
1501
|
cursorPos: l,
|
|
1290
|
-
debugEnabled:
|
|
1502
|
+
debugEnabled: A,
|
|
1291
1503
|
debugLines: O,
|
|
1292
|
-
digitsOnly:
|
|
1293
|
-
valid:
|
|
1504
|
+
digitsOnly: h,
|
|
1505
|
+
valid: V,
|
|
1294
1506
|
validComputed: G(o),
|
|
1295
1507
|
reason: G(oe),
|
|
1296
|
-
validationMessage: G(
|
|
1508
|
+
validationMessage: G(w),
|
|
1297
1509
|
spanDays: G(J),
|
|
1298
1510
|
month1: G(n),
|
|
1299
1511
|
day1: G(i),
|
|
1300
|
-
year1: G(
|
|
1512
|
+
year1: G(T),
|
|
1301
1513
|
month2: G(q),
|
|
1302
1514
|
day2: G(_),
|
|
1303
1515
|
year2: G(X),
|
|
1304
1516
|
handleChange: ae,
|
|
1305
1517
|
handleKeyDown: a,
|
|
1306
|
-
handleWheel:
|
|
1307
|
-
handleKeyUp:
|
|
1518
|
+
handleWheel: d,
|
|
1519
|
+
handleKeyUp: F,
|
|
1308
1520
|
handleClick: se,
|
|
1309
|
-
handleBlur:
|
|
1521
|
+
handleBlur: N,
|
|
1310
1522
|
handleClear: W,
|
|
1311
1523
|
onCalendarChange: () => {
|
|
1312
1524
|
m.value = !0;
|
|
1313
1525
|
},
|
|
1314
|
-
initStyling:
|
|
1526
|
+
initStyling: z
|
|
1315
1527
|
};
|
|
1316
1528
|
}
|
|
1317
|
-
function
|
|
1318
|
-
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 = {
|
|
1319
1531
|
H: /[0-9]/,
|
|
1320
1532
|
h: /[0-9]/,
|
|
1321
1533
|
M: /[0-9]/,
|
|
1322
1534
|
m: /[0-9]/,
|
|
1323
1535
|
A: /[AaPp]/,
|
|
1324
1536
|
a: /[Mm]/
|
|
1325
|
-
},
|
|
1537
|
+
}, P = (n) => n <= 2 ? "hh" : n <= 5 ? "mm" : "ampm", E = f(() => {
|
|
1326
1538
|
const n = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0", i = parseInt(n);
|
|
1327
1539
|
return Math.min(Math.max(i, 0), 23);
|
|
1328
|
-
}),
|
|
1540
|
+
}), u = f(() => {
|
|
1329
1541
|
const n = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0", i = parseInt(n);
|
|
1330
1542
|
return Math.min(Math.max(i, 0), 59);
|
|
1331
|
-
}),
|
|
1332
|
-
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;
|
|
1333
1545
|
return n === 12 ? i === "AM" ? 0 : 12 : i === "PM" ? n + 12 : n;
|
|
1334
|
-
}),
|
|
1546
|
+
}), v = f(() => k.value ? `${String(Z.value).padStart(2, "0")}:${String(u.value).padStart(2, "0")}:00` : null), k = f(
|
|
1335
1547
|
() => /^(\d{2}):(\d{2})\s([AP]M)$/i.test(t.value ?? "")
|
|
1336
|
-
),
|
|
1548
|
+
), V = (n, i, T) => {
|
|
1337
1549
|
let q = n % 12;
|
|
1338
1550
|
return q === 0 && (q = 12), `${String(q).padStart(2, "0")}:${String(i).padStart(
|
|
1339
1551
|
2,
|
|
1340
1552
|
"0"
|
|
1341
|
-
)} ${
|
|
1342
|
-
},
|
|
1553
|
+
)} ${T}`;
|
|
1554
|
+
}, H = (n) => {
|
|
1343
1555
|
const i = n.match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
|
|
1344
1556
|
if (!i) return null;
|
|
1345
|
-
const
|
|
1346
|
-
if (
|
|
1347
|
-
let X =
|
|
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;
|
|
1348
1560
|
_ === "PM" && (X += 12);
|
|
1349
1561
|
const O = /* @__PURE__ */ new Date();
|
|
1350
1562
|
return O.setSeconds(0, 0), O.setHours(X), O.setMinutes(q), O;
|
|
1351
1563
|
}, Q = (n) => {
|
|
1352
|
-
if (
|
|
1564
|
+
if ($.value.length === 0) {
|
|
1353
1565
|
e.onChange({ value: null, event: n });
|
|
1354
1566
|
return;
|
|
1355
1567
|
}
|
|
1356
|
-
if (!
|
|
1568
|
+
if (!k.value) {
|
|
1357
1569
|
e.onChange({ value: null, event: n });
|
|
1358
1570
|
return;
|
|
1359
1571
|
}
|
|
1360
|
-
const i =
|
|
1572
|
+
const i = H(t.value);
|
|
1361
1573
|
i && ee(i) ? e.onChange({ value: i, event: n }) : e.onChange({ value: null, event: n });
|
|
1362
1574
|
}, J = (n) => n.getHours() * 60 + n.getMinutes(), ee = (n) => {
|
|
1363
|
-
const i = e.min ?? void 0,
|
|
1575
|
+
const i = e.min ?? void 0, T = e.max ?? void 0, q = J(n);
|
|
1364
1576
|
if (i) {
|
|
1365
1577
|
const _ = J(i);
|
|
1366
1578
|
if (q < _) return !1;
|
|
1367
1579
|
}
|
|
1368
|
-
if (
|
|
1369
|
-
const _ = J(
|
|
1580
|
+
if (T) {
|
|
1581
|
+
const _ = J(T);
|
|
1370
1582
|
if (q > _) return !1;
|
|
1371
1583
|
}
|
|
1372
1584
|
return !0;
|
|
1373
1585
|
}, oe = (n) => {
|
|
1374
|
-
const i = n.getHours(),
|
|
1375
|
-
t.value =
|
|
1586
|
+
const i = n.getHours(), T = i >= 12 ? "PM" : "AM";
|
|
1587
|
+
t.value = V(i, n.getMinutes(), T);
|
|
1376
1588
|
}, o = (n, i) => {
|
|
1377
1589
|
e.onChange({ value: n, event: i });
|
|
1378
|
-
},
|
|
1379
|
-
|
|
1590
|
+
}, w = () => {
|
|
1591
|
+
B(() => {
|
|
1380
1592
|
requestAnimationFrame(() => {
|
|
1381
1593
|
requestAnimationFrame(() => {
|
|
1382
1594
|
const n = document.getElementById(
|
|
@@ -1390,23 +1602,23 @@ function mt(e) {
|
|
|
1390
1602
|
});
|
|
1391
1603
|
});
|
|
1392
1604
|
});
|
|
1393
|
-
},
|
|
1605
|
+
}, c = (n) => {
|
|
1394
1606
|
const i = n?.event?.target;
|
|
1395
1607
|
return i ? i.closest(".k-time-now") ? "now" : i.closest(".k-time-accept") ? "set" : null : null;
|
|
1396
|
-
},
|
|
1608
|
+
}, p = (n, i) => {
|
|
1397
1609
|
n && ee(n) ? o(n, i) : o(null, i);
|
|
1398
|
-
},
|
|
1610
|
+
}, x = (...n) => {
|
|
1399
1611
|
const i = n[0];
|
|
1400
1612
|
if (!i) return;
|
|
1401
|
-
const
|
|
1402
|
-
if (
|
|
1613
|
+
const T = c(i);
|
|
1614
|
+
if (T === "now") {
|
|
1403
1615
|
const _ = /* @__PURE__ */ new Date();
|
|
1404
|
-
oe(_),
|
|
1616
|
+
oe(_), p(_, i), w();
|
|
1405
1617
|
return;
|
|
1406
1618
|
}
|
|
1407
1619
|
if (i?.value instanceof Date) {
|
|
1408
1620
|
const _ = new Date(i.value);
|
|
1409
|
-
oe(_),
|
|
1621
|
+
oe(_), p(_, i), T === "set" && w();
|
|
1410
1622
|
return;
|
|
1411
1623
|
}
|
|
1412
1624
|
if (i?.value === null) {
|
|
@@ -1418,16 +1630,16 @@ function mt(e) {
|
|
|
1418
1630
|
l.value = q?.selectionStart ?? 0;
|
|
1419
1631
|
try {
|
|
1420
1632
|
const _ = l.value ?? 0;
|
|
1421
|
-
if (
|
|
1633
|
+
if (P(_) === "ampm" && (t.value ?? "").length >= 8) {
|
|
1422
1634
|
const X = t.value.charAt(6);
|
|
1423
|
-
/[Aa]/.test(X) ? (t.value = `${t.value.slice(0, 6)}AM${t.value.slice(8)}`,
|
|
1635
|
+
/[Aa]/.test(X) ? (t.value = `${t.value.slice(0, 6)}AM${t.value.slice(8)}`, B(() => {
|
|
1424
1636
|
requestAnimationFrame(() => {
|
|
1425
1637
|
const O = document.getElementById(
|
|
1426
1638
|
e.id
|
|
1427
1639
|
);
|
|
1428
1640
|
O && (O.focus(), O.setSelectionRange(8, 8));
|
|
1429
1641
|
});
|
|
1430
|
-
})) : /[Pp]/.test(X) && (t.value = `${t.value.slice(0, 6)}PM${t.value.slice(8)}`,
|
|
1642
|
+
})) : /[Pp]/.test(X) && (t.value = `${t.value.slice(0, 6)}PM${t.value.slice(8)}`, B(() => {
|
|
1431
1643
|
requestAnimationFrame(() => {
|
|
1432
1644
|
const O = document.getElementById(
|
|
1433
1645
|
e.id
|
|
@@ -1439,18 +1651,18 @@ function mt(e) {
|
|
|
1439
1651
|
} catch {
|
|
1440
1652
|
}
|
|
1441
1653
|
Q(i);
|
|
1442
|
-
},
|
|
1654
|
+
}, y = (n) => {
|
|
1443
1655
|
l.value = n.target.selectionStart ?? 0;
|
|
1444
|
-
},
|
|
1656
|
+
}, C = (n, i, T) => {
|
|
1445
1657
|
const q = i?.selectionStart ?? l.value ?? 0;
|
|
1446
1658
|
l.value = q;
|
|
1447
|
-
const _ =
|
|
1659
|
+
const _ = P(q), X = (t.value ?? "").match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
|
|
1448
1660
|
if (!X) {
|
|
1449
|
-
if ((t.value ?? "").length === 0 ||
|
|
1450
|
-
const s = /* @__PURE__ */ new Date(),
|
|
1451
|
-
t.value =
|
|
1452
|
-
const te =
|
|
1453
|
-
|
|
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(() => {
|
|
1454
1666
|
requestAnimationFrame(() => {
|
|
1455
1667
|
const ne = document.getElementById(
|
|
1456
1668
|
e.id
|
|
@@ -1461,34 +1673,34 @@ function mt(e) {
|
|
|
1461
1673
|
}
|
|
1462
1674
|
return;
|
|
1463
1675
|
}
|
|
1464
|
-
let O = parseInt(X[1]),
|
|
1676
|
+
let O = parseInt(X[1]), z = parseInt(X[2]), ce = X[3].toUpperCase();
|
|
1465
1677
|
if (_ === "hh")
|
|
1466
1678
|
n === "ArrowUp" ? O = O < 12 ? O + 1 : 1 : O = O > 1 ? O - 1 : 12;
|
|
1467
1679
|
else if (_ === "mm") {
|
|
1468
1680
|
const s = e.minuteStepRef?.value ?? e.minuteStep ?? 1;
|
|
1469
1681
|
if (s === 1)
|
|
1470
|
-
n === "ArrowUp" ?
|
|
1682
|
+
n === "ArrowUp" ? z = z < 59 ? z + 1 : 0 : z = z > 0 ? z - 1 : 59;
|
|
1471
1683
|
else if (n === "ArrowUp") {
|
|
1472
|
-
const
|
|
1473
|
-
let
|
|
1474
|
-
|
|
1684
|
+
const D = z % s;
|
|
1685
|
+
let R = D === 0 ? z + s : z + (s - D);
|
|
1686
|
+
R >= 60 && (R = 0), z = R;
|
|
1475
1687
|
} else {
|
|
1476
|
-
const
|
|
1477
|
-
let
|
|
1478
|
-
|
|
1688
|
+
const D = z % s;
|
|
1689
|
+
let R = D === 0 ? z - s : z - D;
|
|
1690
|
+
R < 0 && (R = 60 - s), z = R;
|
|
1479
1691
|
}
|
|
1480
|
-
} else _ === "ampm" && (
|
|
1481
|
-
t.value = `${String(O).padStart(2, "0")}:${String(
|
|
1692
|
+
} else _ === "ampm" && (ce = ce === "AM" ? "PM" : "AM");
|
|
1693
|
+
t.value = `${String(O).padStart(2, "0")}:${String(z).padStart(
|
|
1482
1694
|
2,
|
|
1483
1695
|
"0"
|
|
1484
|
-
)} ${
|
|
1485
|
-
const r =
|
|
1486
|
-
|
|
1696
|
+
)} ${ce}`;
|
|
1697
|
+
const r = H(t.value);
|
|
1698
|
+
p(r, T), B(() => {
|
|
1487
1699
|
requestAnimationFrame(() => {
|
|
1488
1700
|
const s = document.getElementById(
|
|
1489
1701
|
e.id
|
|
1490
|
-
),
|
|
1491
|
-
s && (s.focus(), s.setSelectionRange(
|
|
1702
|
+
), D = l.value ?? 0;
|
|
1703
|
+
s && (s.focus(), s.setSelectionRange(D, D));
|
|
1492
1704
|
});
|
|
1493
1705
|
});
|
|
1494
1706
|
}, L = (n) => {
|
|
@@ -1500,57 +1712,57 @@ function mt(e) {
|
|
|
1500
1712
|
n.preventDefault(), n.stopPropagation(), e.onShowPicker(n);
|
|
1501
1713
|
return;
|
|
1502
1714
|
}
|
|
1503
|
-
if (
|
|
1715
|
+
if (b.includes(n.key)) {
|
|
1504
1716
|
if (n.altKey) return;
|
|
1505
1717
|
n.preventDefault(), n.stopPropagation();
|
|
1506
1718
|
const i = n.target;
|
|
1507
|
-
|
|
1719
|
+
C(n.key, i, n);
|
|
1508
1720
|
return;
|
|
1509
1721
|
}
|
|
1510
1722
|
}, Y = (n) => {
|
|
1511
1723
|
n.preventDefault();
|
|
1512
1724
|
const i = n.deltaY < 0 ? "ArrowUp" : "ArrowDown";
|
|
1513
|
-
|
|
1725
|
+
C(i, n.target, n);
|
|
1514
1726
|
}, ae = (n) => {
|
|
1515
1727
|
const i = n.target;
|
|
1516
|
-
if (
|
|
1728
|
+
if (M.includes(n.key)) {
|
|
1517
1729
|
l.value = i?.selectionStart ?? 0;
|
|
1518
1730
|
return;
|
|
1519
1731
|
}
|
|
1520
|
-
if (
|
|
1732
|
+
if (b.includes(n.key)) {
|
|
1521
1733
|
if (n.altKey) return;
|
|
1522
1734
|
l.value = i?.selectionStart ?? 0;
|
|
1523
1735
|
}
|
|
1524
1736
|
}, se = (n) => {
|
|
1525
|
-
|
|
1737
|
+
I.value = !0, g.value && e.externalValue && e.externalValue.value === void 0 && $.value.length === 0 && (e.externalValue.value = "");
|
|
1526
1738
|
const i = n.target;
|
|
1527
1739
|
i && (l.value = i.selectionStart ?? 0);
|
|
1528
1740
|
};
|
|
1529
|
-
e.externalValue &&
|
|
1741
|
+
e.externalValue && ue(
|
|
1530
1742
|
e.externalValue,
|
|
1531
1743
|
(n) => {
|
|
1532
1744
|
if (n) {
|
|
1533
1745
|
const i = new Date(n);
|
|
1534
1746
|
if (i.toString() !== "Invalid Date") {
|
|
1535
|
-
const
|
|
1536
|
-
t.value =
|
|
1747
|
+
const T = i.getHours(), q = T >= 12 ? "PM" : "AM";
|
|
1748
|
+
t.value = V(T, i.getMinutes(), q);
|
|
1537
1749
|
return;
|
|
1538
1750
|
}
|
|
1539
1751
|
}
|
|
1540
1752
|
},
|
|
1541
1753
|
{ immediate: !0 }
|
|
1542
1754
|
);
|
|
1543
|
-
const a =
|
|
1755
|
+
const a = f(() => [
|
|
1544
1756
|
["Time", t.value || "--:-- --"],
|
|
1545
|
-
["Hour (12h)",
|
|
1757
|
+
["Hour (12h)", E.value],
|
|
1546
1758
|
["Hour (24h)", Z.value],
|
|
1547
|
-
["Minute",
|
|
1548
|
-
["Period",
|
|
1549
|
-
["Time (24h)",
|
|
1550
|
-
["Digits only",
|
|
1759
|
+
["Minute", u.value],
|
|
1760
|
+
["Period", S.value],
|
|
1761
|
+
["Time (24h)", v.value ?? "--:--:--"],
|
|
1762
|
+
["Digits only", $.value],
|
|
1551
1763
|
[
|
|
1552
1764
|
"Parsed Date",
|
|
1553
|
-
|
|
1765
|
+
d.value?.toLocaleDateString("en-US", {
|
|
1554
1766
|
hour: "2-digit",
|
|
1555
1767
|
minute: "2-digit"
|
|
1556
1768
|
}) ?? null
|
|
@@ -1569,33 +1781,33 @@ function mt(e) {
|
|
|
1569
1781
|
minute: "2-digit"
|
|
1570
1782
|
}) ?? null
|
|
1571
1783
|
],
|
|
1572
|
-
["valid",
|
|
1573
|
-
["reason",
|
|
1574
|
-
["validationMessage",
|
|
1575
|
-
]),
|
|
1576
|
-
() =>
|
|
1577
|
-
),
|
|
1784
|
+
["valid", F.value],
|
|
1785
|
+
["reason", K.value],
|
|
1786
|
+
["validationMessage", N.value]
|
|
1787
|
+
]), d = f(
|
|
1788
|
+
() => H(t.value) ?? null
|
|
1789
|
+
), F = f(() => {
|
|
1578
1790
|
if (!g.value) {
|
|
1579
|
-
if (!
|
|
1580
|
-
const i =
|
|
1791
|
+
if (!k.value) return !0;
|
|
1792
|
+
const i = d.value;
|
|
1581
1793
|
return i ? ee(i) : !1;
|
|
1582
1794
|
}
|
|
1583
|
-
if (!
|
|
1584
|
-
const n =
|
|
1585
|
-
return !
|
|
1586
|
-
}),
|
|
1795
|
+
if (!I.value) return !0;
|
|
1796
|
+
const n = d.value;
|
|
1797
|
+
return !k.value || !n ? !1 : ee(n);
|
|
1798
|
+
}), K = f(() => {
|
|
1587
1799
|
if (!g.value) {
|
|
1588
|
-
if (!
|
|
1589
|
-
const i =
|
|
1800
|
+
if (!k.value) return;
|
|
1801
|
+
const i = d.value;
|
|
1590
1802
|
return i ? ee(i) ? "valid" : "out-of-bounds" : "invalid-time";
|
|
1591
1803
|
}
|
|
1592
|
-
if (!
|
|
1593
|
-
if (
|
|
1804
|
+
if (!I.value) return;
|
|
1805
|
+
if ($.value.length === 0 || !k.value)
|
|
1594
1806
|
return "incomplete";
|
|
1595
|
-
const n =
|
|
1807
|
+
const n = d.value;
|
|
1596
1808
|
return n ? ee(n) ? "valid" : "out-of-bounds" : "invalid-time";
|
|
1597
|
-
}),
|
|
1598
|
-
const n =
|
|
1809
|
+
}), N = f(() => {
|
|
1810
|
+
const n = K.value;
|
|
1599
1811
|
if (!n || n === "valid") return "";
|
|
1600
1812
|
if (n === "incomplete")
|
|
1601
1813
|
return "Required";
|
|
@@ -1604,15 +1816,15 @@ function mt(e) {
|
|
|
1604
1816
|
const i = {
|
|
1605
1817
|
hour: "2-digit",
|
|
1606
1818
|
minute: "2-digit"
|
|
1607
|
-
},
|
|
1819
|
+
}, T = e.min ? e.min.toLocaleTimeString("en-US", i) : null, q = e.max ? e.max.toLocaleTimeString("en-US", i) : null;
|
|
1608
1820
|
if (n === "out-of-bounds") {
|
|
1609
|
-
if (
|
|
1610
|
-
if (
|
|
1821
|
+
if (T && q) return `Must be between ${T} and ${q}.`;
|
|
1822
|
+
if (T) return `Must be ${T} or later.`;
|
|
1611
1823
|
if (q) return `Must be ${q} or earlier.`;
|
|
1612
1824
|
}
|
|
1613
1825
|
return "";
|
|
1614
1826
|
}), W = () => {
|
|
1615
|
-
|
|
1827
|
+
B(() => {
|
|
1616
1828
|
const n = document.getElementById(e.id);
|
|
1617
1829
|
if (!n) {
|
|
1618
1830
|
console.warn(`#${e.id} not found for styling.`);
|
|
@@ -1625,259 +1837,126 @@ function mt(e) {
|
|
|
1625
1837
|
);
|
|
1626
1838
|
return;
|
|
1627
1839
|
}
|
|
1628
|
-
const
|
|
1629
|
-
if (!
|
|
1840
|
+
const T = i.parentElement;
|
|
1841
|
+
if (!T) {
|
|
1630
1842
|
console.warn(
|
|
1631
1843
|
`Parent of .k-timepicker not found for #${e.id} styling.`
|
|
1632
1844
|
);
|
|
1633
1845
|
return;
|
|
1634
1846
|
}
|
|
1635
|
-
|
|
1847
|
+
T.classList.contains("fk-timepicker") || T.classList.add("fk-timepicker");
|
|
1636
1848
|
});
|
|
1637
1849
|
};
|
|
1638
|
-
return
|
|
1850
|
+
return Ie(() => {
|
|
1639
1851
|
W();
|
|
1640
1852
|
}), {
|
|
1641
1853
|
raw: t,
|
|
1642
|
-
rules:
|
|
1643
|
-
debugEnabled:
|
|
1854
|
+
rules: h,
|
|
1855
|
+
debugEnabled: A,
|
|
1644
1856
|
debugLines: a,
|
|
1645
1857
|
placeholder: m,
|
|
1646
|
-
isValid:
|
|
1647
|
-
reason: G(
|
|
1648
|
-
validationMessage:
|
|
1649
|
-
isComplete:
|
|
1858
|
+
isValid: F,
|
|
1859
|
+
reason: G(K),
|
|
1860
|
+
validationMessage: N,
|
|
1861
|
+
isComplete: k,
|
|
1650
1862
|
inRangeTime: ee,
|
|
1651
1863
|
cursorPos: l,
|
|
1652
|
-
hour: G(
|
|
1864
|
+
hour: G(E),
|
|
1653
1865
|
hour24: G(Z),
|
|
1654
|
-
minute: G(
|
|
1655
|
-
period: G(
|
|
1656
|
-
time24: G(
|
|
1657
|
-
parsedRawTime: G(
|
|
1658
|
-
handleChange:
|
|
1866
|
+
minute: G(u),
|
|
1867
|
+
period: G(S),
|
|
1868
|
+
time24: G(v),
|
|
1869
|
+
parsedRawTime: G(d),
|
|
1870
|
+
handleChange: x,
|
|
1659
1871
|
handleKeyDown: L,
|
|
1660
1872
|
handleKeyUp: ae,
|
|
1661
|
-
handleClick:
|
|
1873
|
+
handleClick: y,
|
|
1662
1874
|
handleWheel: Y,
|
|
1663
1875
|
handleBlur: se,
|
|
1664
1876
|
// Expose so consumers can reapply theming when Kendo updates DOM
|
|
1665
1877
|
initStyling: W
|
|
1666
1878
|
};
|
|
1667
1879
|
}
|
|
1668
|
-
function
|
|
1669
|
-
|
|
1670
|
-
}
|
|
1671
|
-
const Te = typeof window < "u" && typeof document < "u";
|
|
1672
|
-
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
1673
|
-
const nt = Object.prototype.toString, at = (e) => nt.call(e) === "[object Object]", ye = () => {
|
|
1674
|
-
}, rt = /* @__PURE__ */ lt();
|
|
1675
|
-
function lt() {
|
|
1676
|
-
var e, t;
|
|
1677
|
-
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));
|
|
1678
|
-
}
|
|
1679
|
-
function Ee(e) {
|
|
1680
|
-
return Array.isArray(e) ? e : [e];
|
|
1681
|
-
}
|
|
1682
|
-
function ot(e, t, l) {
|
|
1683
|
-
return de(
|
|
1684
|
-
e,
|
|
1685
|
-
t,
|
|
1686
|
-
{
|
|
1687
|
-
...l,
|
|
1688
|
-
immediate: !0
|
|
1689
|
-
}
|
|
1690
|
-
);
|
|
1691
|
-
}
|
|
1692
|
-
const Pe = Te ? window : void 0;
|
|
1693
|
-
function be(e) {
|
|
1694
|
-
var t;
|
|
1695
|
-
const l = le(e);
|
|
1696
|
-
return (t = l?.$el) != null ? t : l;
|
|
1697
|
-
}
|
|
1698
|
-
function xe(...e) {
|
|
1699
|
-
const t = [], l = () => {
|
|
1700
|
-
t.forEach((A) => A()), t.length = 0;
|
|
1701
|
-
}, D = (A, x, T, y) => (A.addEventListener(x, T, y), () => A.removeEventListener(x, T, y)), m = d(() => {
|
|
1702
|
-
const A = Ee(le(e[0])).filter((x) => x != null);
|
|
1703
|
-
return A.every((x) => typeof x != "string") ? A : void 0;
|
|
1704
|
-
}), g = ot(
|
|
1705
|
-
() => {
|
|
1706
|
-
var A, x;
|
|
1707
|
-
return [
|
|
1708
|
-
(x = (A = m.value) == null ? void 0 : A.map((T) => be(T))) != null ? x : [Pe].filter((T) => T != null),
|
|
1709
|
-
Ee(le(m.value ? e[1] : e[0])),
|
|
1710
|
-
Ee(Oe(m.value ? e[2] : e[1])),
|
|
1711
|
-
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
1712
|
-
le(m.value ? e[3] : e[2])
|
|
1713
|
-
];
|
|
1714
|
-
},
|
|
1715
|
-
([A, x, T, y]) => {
|
|
1716
|
-
if (l(), !A?.length || !x?.length || !T?.length)
|
|
1717
|
-
return;
|
|
1718
|
-
const R = at(y) ? { ...y } : y;
|
|
1719
|
-
t.push(
|
|
1720
|
-
...A.flatMap(
|
|
1721
|
-
(k) => x.flatMap(
|
|
1722
|
-
(h) => T.map((I) => D(k, h, I, R))
|
|
1723
|
-
)
|
|
1724
|
-
)
|
|
1725
|
-
);
|
|
1726
|
-
},
|
|
1727
|
-
{ flush: "post" }
|
|
1728
|
-
), C = () => {
|
|
1729
|
-
g(), l();
|
|
1730
|
-
};
|
|
1731
|
-
return tt(l), C;
|
|
1732
|
-
}
|
|
1733
|
-
let Ce = !1;
|
|
1734
|
-
function it(e, t, l = {}) {
|
|
1735
|
-
const { window: D = Pe, ignore: m = [], capture: g = !0, detectIframe: C = !1, controls: A = !1 } = l;
|
|
1736
|
-
if (!D)
|
|
1737
|
-
return A ? { stop: ye, cancel: ye, trigger: ye } : ye;
|
|
1738
|
-
if (rt && !Ce) {
|
|
1739
|
-
Ce = !0;
|
|
1740
|
-
const p = { passive: !0 };
|
|
1741
|
-
Array.from(D.document.body.children).forEach((S) => S.addEventListener("click", ye, p)), D.document.documentElement.addEventListener("click", ye, p);
|
|
1742
|
-
}
|
|
1743
|
-
let x = !0;
|
|
1744
|
-
const T = (p) => le(m).some((S) => {
|
|
1745
|
-
if (typeof S == "string")
|
|
1746
|
-
return Array.from(D.document.querySelectorAll(S)).some((P) => P === p.target || p.composedPath().includes(P));
|
|
1747
|
-
{
|
|
1748
|
-
const P = be(S);
|
|
1749
|
-
return P && (p.target === P || p.composedPath().includes(P));
|
|
1750
|
-
}
|
|
1751
|
-
});
|
|
1752
|
-
function y(p) {
|
|
1753
|
-
const S = le(p);
|
|
1754
|
-
return S && S.$.subTree.shapeFlag === 16;
|
|
1755
|
-
}
|
|
1756
|
-
function R(p, S) {
|
|
1757
|
-
const P = le(p), z = P.$.subTree && P.$.subTree.children;
|
|
1758
|
-
return z == null || !Array.isArray(z) ? !1 : z.some((Q) => Q.el === S.target || S.composedPath().includes(Q.el));
|
|
1759
|
-
}
|
|
1760
|
-
const k = (p) => {
|
|
1761
|
-
const S = be(e);
|
|
1762
|
-
if (p.target != null && !(!(S instanceof Element) && y(e) && R(e, p)) && !(!S || S === p.target || p.composedPath().includes(S))) {
|
|
1763
|
-
if ("detail" in p && p.detail === 0 && (x = !T(p)), !x) {
|
|
1764
|
-
x = !0;
|
|
1765
|
-
return;
|
|
1766
|
-
}
|
|
1767
|
-
t(p);
|
|
1768
|
-
}
|
|
1769
|
-
};
|
|
1770
|
-
let h = !1;
|
|
1771
|
-
const I = [
|
|
1772
|
-
xe(D, "click", (p) => {
|
|
1773
|
-
h || (h = !0, setTimeout(() => {
|
|
1774
|
-
h = !1;
|
|
1775
|
-
}, 0), k(p));
|
|
1776
|
-
}, { passive: !0, capture: g }),
|
|
1777
|
-
xe(D, "pointerdown", (p) => {
|
|
1778
|
-
const S = be(e);
|
|
1779
|
-
x = !T(p) && !!(S && !p.composedPath().includes(S));
|
|
1780
|
-
}, { passive: !0 }),
|
|
1781
|
-
C && xe(D, "blur", (p) => {
|
|
1782
|
-
setTimeout(() => {
|
|
1783
|
-
var S;
|
|
1784
|
-
const P = be(e);
|
|
1785
|
-
((S = D.document.activeElement) == null ? void 0 : S.tagName) === "IFRAME" && !P?.contains(D.document.activeElement) && t(p);
|
|
1786
|
-
}, 0);
|
|
1787
|
-
}, { passive: !0 })
|
|
1788
|
-
].filter(Boolean), Z = () => I.forEach((p) => p());
|
|
1789
|
-
return A ? {
|
|
1790
|
-
stop: Z,
|
|
1791
|
-
cancel: () => {
|
|
1792
|
-
x = !1;
|
|
1793
|
-
},
|
|
1794
|
-
trigger: (p) => {
|
|
1795
|
-
x = !0, k(p), x = !1;
|
|
1796
|
-
}
|
|
1797
|
-
} : Z;
|
|
1798
|
-
}
|
|
1799
|
-
function gt(e) {
|
|
1800
|
-
const t = Ue(null), l = [
|
|
1880
|
+
function bt(e) {
|
|
1881
|
+
const t = Ke(null), l = [
|
|
1801
1882
|
".k-animation-container .k-popup",
|
|
1802
1883
|
".k-popup",
|
|
1803
1884
|
".k-timepicker-popup",
|
|
1804
1885
|
".k-menu-popup"
|
|
1805
|
-
],
|
|
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(
|
|
1806
1887
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
1807
|
-
) ??
|
|
1888
|
+
) ?? h : null, { activate: g, deactivate: I } = Ne(t, {
|
|
1808
1889
|
escapeDeactivates: !1,
|
|
1809
1890
|
clickOutsideDeactivates: !1,
|
|
1810
1891
|
fallbackFocus: () => t.value,
|
|
1811
1892
|
initialFocus: () => m(t.value),
|
|
1812
1893
|
...e.focusTrapOptions ?? {}
|
|
1813
1894
|
});
|
|
1814
|
-
let
|
|
1815
|
-
const
|
|
1895
|
+
let b = null, M = U(null);
|
|
1896
|
+
const $ = () => {
|
|
1816
1897
|
if (e.resolvePopupEl) return e.resolvePopupEl();
|
|
1817
|
-
const
|
|
1818
|
-
const
|
|
1819
|
-
if (!
|
|
1820
|
-
const Z =
|
|
1821
|
-
(
|
|
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
|
|
1822
1903
|
);
|
|
1823
|
-
return Z[Z.length - 1] ??
|
|
1824
|
-
},
|
|
1825
|
-
for (const
|
|
1826
|
-
const
|
|
1827
|
-
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;
|
|
1828
1909
|
}
|
|
1829
|
-
for (const
|
|
1830
|
-
const
|
|
1831
|
-
if (
|
|
1910
|
+
for (const E of A) {
|
|
1911
|
+
const u = h(document, E);
|
|
1912
|
+
if (u) return u;
|
|
1832
1913
|
}
|
|
1833
1914
|
return null;
|
|
1834
1915
|
};
|
|
1835
|
-
return
|
|
1836
|
-
|
|
1837
|
-
}),
|
|
1916
|
+
return Re(t, (h) => {
|
|
1917
|
+
M.value = "outside", e.isOpen.value && e.onRequestClose?.("outside", h);
|
|
1918
|
+
}), ue(
|
|
1838
1919
|
() => e.isOpen.value,
|
|
1839
|
-
(
|
|
1840
|
-
|
|
1841
|
-
const
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
}, document.addEventListener("keydown",
|
|
1845
|
-
})) : (
|
|
1846
|
-
const
|
|
1847
|
-
const
|
|
1848
|
-
|
|
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?.();
|
|
1849
1930
|
};
|
|
1850
|
-
requestAnimationFrame(() => setTimeout(
|
|
1851
|
-
}), e.returnFocusToTrigger !== !1 &&
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
const k = e.triggerEl?.value;
|
|
1857
|
-
if (!k) return;
|
|
1858
|
-
(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?.();
|
|
1859
1937
|
};
|
|
1860
|
-
requestAnimationFrame(() => setTimeout(
|
|
1861
|
-
}))
|
|
1938
|
+
requestAnimationFrame(() => setTimeout(P, 0));
|
|
1939
|
+
}));
|
|
1862
1940
|
}
|
|
1863
1941
|
), {
|
|
1864
1942
|
popupRef: t,
|
|
1865
1943
|
activate: g,
|
|
1866
|
-
deactivate:
|
|
1867
|
-
lastCloseReason: G(
|
|
1868
|
-
setPopupEl: (
|
|
1944
|
+
deactivate: I,
|
|
1945
|
+
lastCloseReason: G(M),
|
|
1946
|
+
setPopupEl: (h) => t.value = h
|
|
1869
1947
|
};
|
|
1870
1948
|
}
|
|
1871
1949
|
export {
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
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
|
|
1882
1961
|
};
|
|
1883
1962
|
//# sourceMappingURL=featherk-composables.es.js.map
|