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