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