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