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