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