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