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