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