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