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