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