@progress/kendo-react-dropdowns 7.0.0-develop.3 → 7.0.0-develop.4
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/common/List.d.ts +1 -0
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.js +1 -1
- package/index.mjs +634 -620
- package/package.json +9 -9
package/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as o from "react";
|
|
6
6
|
import * as l from "prop-types";
|
|
7
|
-
import { IconWrap as ke, classNames as B, Keys as
|
|
7
|
+
import { IconWrap as ke, classNames as B, Keys as f, guid as Fe, svgIconPropType as gs, createPropsContext as Ke, withPropsContext as wt, validatePackage as qe, canUseDOM as Me, getTabIndex as $t, kendoThemeMaps as $e, getActiveElement as Ss, usePropsContext as Gt, getScrollbarWidth as ws, getter as kt, setScrollbarWidth as Es, useRtl as fs, noop as De, mapTree as Ds, extendDataItem as Ts } from "@progress/kendo-react-common";
|
|
8
8
|
import { FloatingLabel as Ge } from "@progress/kendo-react-labels";
|
|
9
9
|
import { searchIcon as Fs, caretAltDownIcon as Ut, xIcon as at, plusIcon as Ms } from "@progress/kendo-svg-icons";
|
|
10
10
|
import { Popup as jt, PopupPropsContext as Ns } from "@progress/kendo-react-popup";
|
|
@@ -90,12 +90,12 @@ const G = (i) => i != null, Bs = (i, t) => {
|
|
|
90
90
|
let s = String(i);
|
|
91
91
|
return e && (s = s.toLowerCase()), s.indexOf(t) === 0;
|
|
92
92
|
}, Ks = (i, t, e, s, n) => {
|
|
93
|
-
const a = i.offsetHeight,
|
|
93
|
+
const a = i.offsetHeight, p = t.children.item(e), c = p.offsetTop + (n ? s - i.scrollTop : 0), d = p.offsetHeight;
|
|
94
94
|
if (n) {
|
|
95
95
|
let r = 0;
|
|
96
|
-
|
|
96
|
+
c + d > a ? r = c + d - a : c < 0 && (r = c), r !== 0 ? i.scrollTop += r : i.scrollTop === 0 && s !== 0 && (i.scrollTop = s);
|
|
97
97
|
} else
|
|
98
|
-
|
|
98
|
+
c + d > a + i.scrollTop ? i.scrollTop = c + d - a : c < i.scrollTop && (i.scrollTop -= i.scrollTop - c);
|
|
99
99
|
}, Ve = (i, t, e) => {
|
|
100
100
|
let s = -1;
|
|
101
101
|
if (t) {
|
|
@@ -141,7 +141,7 @@ const G = (i) => i != null, Bs = (i, t) => {
|
|
|
141
141
|
return s !== -1 ? i[s] : i[Ve(i, t, e)];
|
|
142
142
|
}
|
|
143
143
|
return i[0];
|
|
144
|
-
},
|
|
144
|
+
}, zs = (i, t = [], e) => {
|
|
145
145
|
let s = "";
|
|
146
146
|
if (i) {
|
|
147
147
|
const n = t[Ve(t, i, e)];
|
|
@@ -151,7 +151,7 @@ const G = (i) => i != null, Bs = (i, t) => {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
return s;
|
|
154
|
-
},
|
|
154
|
+
}, Hs = (i) => {
|
|
155
155
|
i.target.nodeName !== "INPUT" && i.preventDefault();
|
|
156
156
|
}, xt = (i, t, e) => !!i != !!t || i.text !== t.text ? !1 : i === t || Ls(i.data, t.data, e), As = (i) => i.preventDefault();
|
|
157
157
|
class Ws extends o.Component {
|
|
@@ -186,20 +186,20 @@ class qs extends o.Component {
|
|
|
186
186
|
dataItem: s,
|
|
187
187
|
virtual: n,
|
|
188
188
|
groupMode: a,
|
|
189
|
-
disabled:
|
|
190
|
-
render:
|
|
189
|
+
disabled: p,
|
|
190
|
+
render: c
|
|
191
191
|
} = this.props, d = /* @__PURE__ */ o.createElement(
|
|
192
192
|
"li",
|
|
193
193
|
{
|
|
194
194
|
id: this.props.id,
|
|
195
195
|
role: "option",
|
|
196
196
|
"aria-selected": t,
|
|
197
|
-
"aria-disabled":
|
|
197
|
+
"aria-disabled": p ? !0 : void 0,
|
|
198
198
|
className: B("k-list-item", {
|
|
199
199
|
"k-selected": t,
|
|
200
200
|
"k-focus": this.props.focused,
|
|
201
201
|
"k-first": !!e && a === "classic",
|
|
202
|
-
"k-disabled":
|
|
202
|
+
"k-disabled": p
|
|
203
203
|
}),
|
|
204
204
|
onClick: this.handleClick,
|
|
205
205
|
style: { position: n ? "relative" : "unset" }
|
|
@@ -207,7 +207,7 @@ class qs extends o.Component {
|
|
|
207
207
|
/* @__PURE__ */ o.createElement("span", { className: "k-list-item-text" }, V(s, this.props.textField).toString()),
|
|
208
208
|
e !== void 0 && a === "classic" ? /* @__PURE__ */ o.createElement("div", { className: "k-list-item-group-label" }, e) : null
|
|
209
209
|
);
|
|
210
|
-
return
|
|
210
|
+
return c !== void 0 ? c.call(void 0, d, this.props) : d;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
class $s extends o.Component {
|
|
@@ -230,12 +230,12 @@ class $s extends o.Component {
|
|
|
230
230
|
return s !== void 0 ? s.call(void 0, a, this.props) : a;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
const fe = "dropdowns.nodata", it = "dropdowns.clear", Lt = "dropdowns.comboArrowBtnAriaLabelExpand",
|
|
233
|
+
const fe = "dropdowns.nodata", it = "dropdowns.clear", Lt = "dropdowns.comboArrowBtnAriaLabelExpand", zt = "dropdowns.comboArrowBtnAriaLabelCollapse", Ht = "dropdowns.dropDownListArrowBtnAriaLabel", nt = "dropdowns.apply", ot = "dropdowns.cancel", le = {
|
|
234
234
|
[it]: "clear",
|
|
235
235
|
[fe]: "NO DATA FOUND.",
|
|
236
236
|
[Lt]: "expand combobox",
|
|
237
|
-
[
|
|
238
|
-
[
|
|
237
|
+
[zt]: "collapse combobox",
|
|
238
|
+
[Ht]: "select",
|
|
239
239
|
[nt]: "Apply",
|
|
240
240
|
[ot]: "Cancel"
|
|
241
241
|
};
|
|
@@ -247,25 +247,25 @@ class Ue extends o.Component {
|
|
|
247
247
|
groupField: s,
|
|
248
248
|
groupMode: n,
|
|
249
249
|
isMultiColumn: a,
|
|
250
|
-
optionsGuid:
|
|
251
|
-
skip:
|
|
250
|
+
optionsGuid: p,
|
|
251
|
+
skip: c = 0,
|
|
252
252
|
virtual: d,
|
|
253
253
|
focusedIndex: r,
|
|
254
254
|
highlightSelected: h = !0,
|
|
255
|
-
value:
|
|
256
|
-
data:
|
|
257
|
-
itemRender:
|
|
255
|
+
value: u,
|
|
256
|
+
data: g,
|
|
257
|
+
itemRender: m,
|
|
258
258
|
groupHeaderItemRender: v
|
|
259
|
-
} = this.props, b = Array.isArray(
|
|
259
|
+
} = this.props, b = Array.isArray(u);
|
|
260
260
|
let w = 0;
|
|
261
|
-
return
|
|
262
|
-
const N =
|
|
261
|
+
return g.map((S, D) => {
|
|
262
|
+
const N = c + D, O = c + D + w, _ = S.disabled ? !1 : h && (!b && R(S, u, e) || b && u.findIndex((E) => R(E, S, e)) !== -1);
|
|
263
263
|
let C, F, x;
|
|
264
|
-
return D > 0 && s !== void 0 && (F = V(S, s), x = V(
|
|
264
|
+
return D > 0 && s !== void 0 && (F = V(S, s), x = V(g[D - 1], s), F && x && F !== x && (C = F)), C !== void 0 && n === "modern" && (w += 1), [
|
|
265
265
|
C !== void 0 && n === "modern" && /* @__PURE__ */ o.createElement(
|
|
266
266
|
$s,
|
|
267
267
|
{
|
|
268
|
-
id: `option-${
|
|
268
|
+
id: `option-${p}-${O}`,
|
|
269
269
|
virtual: d,
|
|
270
270
|
key: N + "-group-item",
|
|
271
271
|
group: C,
|
|
@@ -276,7 +276,7 @@ class Ue extends o.Component {
|
|
|
276
276
|
/* @__PURE__ */ o.createElement(
|
|
277
277
|
qs,
|
|
278
278
|
{
|
|
279
|
-
id: `option-${
|
|
279
|
+
id: `option-${p}-${C !== void 0 && n === "modern" ? O + 1 : O}`,
|
|
280
280
|
virtual: d,
|
|
281
281
|
dataItem: S,
|
|
282
282
|
groupMode: n,
|
|
@@ -287,7 +287,7 @@ class Ue extends o.Component {
|
|
|
287
287
|
onClick: this.props.onClick,
|
|
288
288
|
textField: t,
|
|
289
289
|
group: C,
|
|
290
|
-
render:
|
|
290
|
+
render: m,
|
|
291
291
|
disabled: S.disabled
|
|
292
292
|
}
|
|
293
293
|
)
|
|
@@ -299,8 +299,18 @@ class Ue extends o.Component {
|
|
|
299
299
|
return e ? e.call(void 0, s) : s;
|
|
300
300
|
}
|
|
301
301
|
render() {
|
|
302
|
-
const t = Ae(this), {
|
|
303
|
-
|
|
302
|
+
const t = Ae(this), {
|
|
303
|
+
id: e,
|
|
304
|
+
show: s,
|
|
305
|
+
wrapperCssClass: n,
|
|
306
|
+
wrapperStyle: a,
|
|
307
|
+
listStyle: p,
|
|
308
|
+
listRef: c,
|
|
309
|
+
wrapperRef: d,
|
|
310
|
+
listClassName: r = "k-list-ul",
|
|
311
|
+
ariaSetSize: h
|
|
312
|
+
} = this.props, u = this.renderItems();
|
|
313
|
+
return u.length ? /* @__PURE__ */ o.createElement(
|
|
304
314
|
"div",
|
|
305
315
|
{
|
|
306
316
|
className: n,
|
|
@@ -317,11 +327,12 @@ class Ue extends o.Component {
|
|
|
317
327
|
id: e,
|
|
318
328
|
role: "listbox",
|
|
319
329
|
"aria-hidden": s ? void 0 : !0,
|
|
330
|
+
"aria-setsize": h,
|
|
320
331
|
className: r,
|
|
321
|
-
ref:
|
|
322
|
-
style:
|
|
332
|
+
ref: c,
|
|
333
|
+
style: p
|
|
323
334
|
},
|
|
324
|
-
|
|
335
|
+
u
|
|
325
336
|
),
|
|
326
337
|
this.props.scroller && /* @__PURE__ */ o.createElement("div", { className: "k-height-container" }, this.props.scroller)
|
|
327
338
|
) : this.renderNoValueElement(t);
|
|
@@ -360,9 +371,9 @@ class Us {
|
|
|
360
371
|
}
|
|
361
372
|
localScrollUp(t) {
|
|
362
373
|
const e = this.itemHeight, s = this.container.scrollTop;
|
|
363
|
-
let n = this.listTranslate, a,
|
|
364
|
-
if (!(
|
|
365
|
-
for (a = 0; a < this.skip && !(n + e +
|
|
374
|
+
let n = this.listTranslate, a, p = s - n;
|
|
375
|
+
if (!(p > e)) {
|
|
376
|
+
for (a = 0; a < this.skip && !(n + e + p <= s); a++)
|
|
366
377
|
n -= e;
|
|
367
378
|
if (n = this.validateTranslate(n), this.skip - a <= 0 && n >= s) {
|
|
368
379
|
this.translateTo(0), this.changePage(0, t), this.container.scrollTop = 0;
|
|
@@ -375,10 +386,10 @@ class Us {
|
|
|
375
386
|
const e = this.itemHeight;
|
|
376
387
|
let s = this.container.scrollTop, n = this.listTranslate;
|
|
377
388
|
const a = this.list.children.length;
|
|
378
|
-
let
|
|
379
|
-
for (
|
|
389
|
+
let p;
|
|
390
|
+
for (p = 0; p < a && !(n + e >= s); p++)
|
|
380
391
|
n += e;
|
|
381
|
-
n = this.validateTranslate(n),
|
|
392
|
+
n = this.validateTranslate(n), p >= a && this.skip + p >= this.total ? (this.translateTo(n), this.changePage(this.total - 1, t)) : n !== this.listTranslate && (this.translateTo(n), this.changePage(this.skip + p, t));
|
|
382
393
|
}
|
|
383
394
|
scrollNonStrict(t) {
|
|
384
395
|
const e = this.total * this.prevScrollPos / this.containerHeight, s = Math.min(Math.floor(e), this.total - 1);
|
|
@@ -396,13 +407,13 @@ class Us {
|
|
|
396
407
|
class js {
|
|
397
408
|
navigate(t) {
|
|
398
409
|
const e = t.keyCode;
|
|
399
|
-
if (e ===
|
|
410
|
+
if (e === f.up || e === f.left)
|
|
400
411
|
return this.next({ current: t.current, min: t.min, max: t.max, step: t.skipItems ? t.skipItems : -1 });
|
|
401
|
-
if (e ===
|
|
412
|
+
if (e === f.down || e === f.right)
|
|
402
413
|
return this.next({ current: t.current, min: t.min, max: t.max, step: t.skipItems ? t.skipItems : 1 });
|
|
403
|
-
if (e ===
|
|
414
|
+
if (e === f.home)
|
|
404
415
|
return 0;
|
|
405
|
-
if (e ===
|
|
416
|
+
if (e === f.end)
|
|
406
417
|
return t.max;
|
|
407
418
|
}
|
|
408
419
|
next(t) {
|
|
@@ -448,9 +459,9 @@ const Xt = class {
|
|
|
448
459
|
}
|
|
449
460
|
window.setTimeout(() => s.enabled = !0, 10);
|
|
450
461
|
}, this.scrollPopupByPageSize = (t) => {
|
|
451
|
-
var
|
|
452
|
-
const e = this.vs, s = (
|
|
453
|
-
s !== void 0 && a !== void 0 && ((
|
|
462
|
+
var p, c, d, r, h, u;
|
|
463
|
+
const e = this.vs, s = (c = (p = this.list) == null ? void 0 : p.parentElement) == null ? void 0 : c.scrollTop, n = e.enabled && e.itemHeight ? e.itemHeight : this.list ? this.list.children[0].offsetHeight : 0, a = (r = (d = this.list) == null ? void 0 : d.parentElement) == null ? void 0 : r.offsetHeight;
|
|
464
|
+
s !== void 0 && a !== void 0 && ((u = (h = this.list) == null ? void 0 : h.parentElement) == null || u.scroll({ top: s + t * Math.floor(a / n) * n }));
|
|
454
465
|
}, this.renderScrollElement = () => {
|
|
455
466
|
const t = this.vs;
|
|
456
467
|
return t.enabled && /* @__PURE__ */ o.createElement(
|
|
@@ -481,8 +492,8 @@ const Xt = class {
|
|
|
481
492
|
if (!s && !e && setTimeout(() => {
|
|
482
493
|
this.scrollToItem(i, t, !0);
|
|
483
494
|
}, 10), s && i >= 0) {
|
|
484
|
-
const n = this.vs, a = n.container || s.parentNode,
|
|
485
|
-
Ks(a, s, i, n.translate,
|
|
495
|
+
const n = this.vs, a = n.container || s.parentNode, p = t !== void 0 ? t : n.enabled;
|
|
496
|
+
Ks(a, s, i, n.translate, p);
|
|
486
497
|
}
|
|
487
498
|
}
|
|
488
499
|
initState() {
|
|
@@ -521,8 +532,8 @@ const Xt = class {
|
|
|
521
532
|
}
|
|
522
533
|
}
|
|
523
534
|
triggerPageChangeCornerItems(i, t) {
|
|
524
|
-
const e = this.component.props, { data: s = [], dataItemKey: n, virtual: a } = e,
|
|
525
|
-
i && a && this.vs.enabled && (a.skip > 0 && R(i, s[0], n) ? this.triggerOnPageChange(t, a.skip - 1, a.pageSize) : !
|
|
535
|
+
const e = this.component.props, { data: s = [], dataItemKey: n, virtual: a } = e, p = e.opened !== void 0 ? e.opened : this.component.state.opened;
|
|
536
|
+
i && a && this.vs.enabled && (a.skip > 0 && R(i, s[0], n) ? this.triggerOnPageChange(t, a.skip - 1, a.pageSize) : !p && a.skip + a.pageSize < a.total && R(i, s[s.length - 1], n) && this.triggerOnPageChange(t, a.skip + 1, a.pageSize));
|
|
526
537
|
}
|
|
527
538
|
getPopupSettings() {
|
|
528
539
|
return Object.assign({}, Xt.defaultProps.popupSettings, this.component.props.popupSettings);
|
|
@@ -593,7 +604,7 @@ const je = {
|
|
|
593
604
|
name: "@progress/kendo-react-dropdowns",
|
|
594
605
|
productName: "KendoReact",
|
|
595
606
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
596
|
-
publishDate:
|
|
607
|
+
publishDate: 1700659903,
|
|
597
608
|
version: "",
|
|
598
609
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
|
|
599
610
|
}, St = 500, Se = 768, Ys = "Please select a value from the list!", { sizeMap: Vt, roundedMap: Js } = $e, At = class extends o.Component {
|
|
@@ -601,7 +612,7 @@ const je = {
|
|
|
601
612
|
super(i), this.state = {}, this._element = null, this.base = new ie(this), this.searchState = { word: "", last: "" }, this._select = null, this._skipFocusEvent = !1, this._filterInput = null, this._navigated = !1, this._lastKeypressIsFilter = !1, this._inputId = Fe(), this.itemHeight = 0, this.focus = () => {
|
|
602
613
|
this.base.wrapper && this.base.wrapper.focus();
|
|
603
614
|
}, this.handleItemSelect = (t, e) => {
|
|
604
|
-
const { data: s = [], virtual: n, dataItemKey: a, defaultItem:
|
|
615
|
+
const { data: s = [], virtual: n, dataItemKey: a, defaultItem: p } = this.props, c = n ? n.skip : 0, d = t === -1 && p !== void 0 ? p : s[t - c], r = !R(d, this.value, a);
|
|
605
616
|
this.triggerOnChange(d, e), r && this.base.triggerPageChangeCornerItems(d, e);
|
|
606
617
|
}, this.componentRef = (t) => {
|
|
607
618
|
this._element = t, this.base.wrapper = t;
|
|
@@ -624,9 +635,9 @@ const je = {
|
|
|
624
635
|
}
|
|
625
636
|
)
|
|
626
637
|
), this.renderListContainer = () => {
|
|
627
|
-
const { header: t, footer: e, dir: s, data: n = [], size: a, groupField:
|
|
638
|
+
const { header: t, footer: e, dir: s, data: n = [], size: a, groupField: p, groupStickyHeaderItemRender: c, list: d } = this.props, r = this.base, h = r.getPopupSettings(), u = this.props.opened !== void 0 ? this.props.opened : this.state.opened, g = h.width !== void 0 ? h.width : r.popupWidth, m = {
|
|
628
639
|
dir: s !== void 0 ? s : r.dirCalculated,
|
|
629
|
-
width:
|
|
640
|
+
width: g,
|
|
630
641
|
popupSettings: {
|
|
631
642
|
popupClass: B(
|
|
632
643
|
h.popupClass,
|
|
@@ -636,7 +647,7 @@ const je = {
|
|
|
636
647
|
className: h.className,
|
|
637
648
|
animate: h.animate,
|
|
638
649
|
anchor: this.element,
|
|
639
|
-
show:
|
|
650
|
+
show: u,
|
|
640
651
|
onOpen: this.onPopupOpened,
|
|
641
652
|
onClose: this.onPopupClosed,
|
|
642
653
|
appendTo: h.appendTo
|
|
@@ -644,7 +655,7 @@ const je = {
|
|
|
644
655
|
itemsCount: [n.length]
|
|
645
656
|
};
|
|
646
657
|
let { group: v } = this.state;
|
|
647
|
-
return v === void 0 &&
|
|
658
|
+
return v === void 0 && p !== void 0 && (v = V(n[0], p)), /* @__PURE__ */ o.createElement(Et, { ...m }, this.renderListFilter(), t && /* @__PURE__ */ o.createElement("div", { className: "k-list-header" }, t), /* @__PURE__ */ o.createElement(
|
|
648
659
|
"div",
|
|
649
660
|
{
|
|
650
661
|
className: B(
|
|
@@ -656,7 +667,7 @@ const je = {
|
|
|
656
667
|
)
|
|
657
668
|
},
|
|
658
669
|
this.renderDefaultItem(),
|
|
659
|
-
!d && v && n.length !== 0 && /* @__PURE__ */ o.createElement(We, { group: v, groupMode: "modern", render:
|
|
670
|
+
!d && v && n.length !== 0 && /* @__PURE__ */ o.createElement(We, { group: v, groupMode: "modern", render: c }),
|
|
660
671
|
this.renderList()
|
|
661
672
|
), e && /* @__PURE__ */ o.createElement("div", { className: "k-list-footer" }, e));
|
|
662
673
|
}, this.renderList = () => {
|
|
@@ -664,11 +675,11 @@ const je = {
|
|
|
664
675
|
data: t = [],
|
|
665
676
|
textField: e,
|
|
666
677
|
dataItemKey: s,
|
|
667
|
-
virtual: n = { skip: 0 },
|
|
678
|
+
virtual: n = { skip: 0, total: void 0 },
|
|
668
679
|
groupHeaderItemRender: a,
|
|
669
|
-
listNoDataRender:
|
|
670
|
-
itemRender:
|
|
671
|
-
} = this.props, d = this.base.vs, r = n.skip, h = this.props.opened !== void 0 ? this.props.opened : this.state.opened,
|
|
680
|
+
listNoDataRender: p,
|
|
681
|
+
itemRender: c
|
|
682
|
+
} = this.props, d = this.base.vs, r = n.skip, h = this.props.opened !== void 0 ? this.props.opened : this.state.opened, u = this.base.getPopupSettings(), g = `translateY(${d.translate}px)`;
|
|
672
683
|
return /* @__PURE__ */ o.createElement(
|
|
673
684
|
Ue,
|
|
674
685
|
{
|
|
@@ -682,19 +693,20 @@ const je = {
|
|
|
682
693
|
optionsGuid: this.base.guid,
|
|
683
694
|
groupField: this.props.groupField,
|
|
684
695
|
groupMode: "modern",
|
|
685
|
-
listRef: (
|
|
686
|
-
wrapperStyle: { maxHeight:
|
|
696
|
+
listRef: (m) => d.list = this.base.list = m,
|
|
697
|
+
wrapperStyle: { maxHeight: u.height },
|
|
687
698
|
wrapperCssClass: "k-list-content",
|
|
688
|
-
listStyle: d.enabled ? { transform:
|
|
699
|
+
listStyle: d.enabled ? { transform: g } : void 0,
|
|
689
700
|
key: "listkey",
|
|
690
701
|
skip: r,
|
|
691
702
|
onClick: this.handleItemClick,
|
|
692
|
-
itemRender:
|
|
703
|
+
itemRender: c,
|
|
693
704
|
groupHeaderItemRender: a,
|
|
694
|
-
noDataRender:
|
|
705
|
+
noDataRender: p,
|
|
695
706
|
onScroll: this.onScroll,
|
|
696
707
|
wrapperRef: d.scrollerRef,
|
|
697
|
-
scroller: this.base.renderScrollElement()
|
|
708
|
+
scroller: this.base.renderScrollElement(),
|
|
709
|
+
ariaSetSize: n.total
|
|
698
710
|
}
|
|
699
711
|
);
|
|
700
712
|
}, this.onScroll = (t) => {
|
|
@@ -703,10 +715,10 @@ const je = {
|
|
|
703
715
|
const { groupField: n } = this.props;
|
|
704
716
|
let { data: a = [] } = this.props;
|
|
705
717
|
if (!(!n || !a.length) && n) {
|
|
706
|
-
const
|
|
718
|
+
const p = this.itemHeight = this.itemHeight || (e.enabled ? e.itemHeight : s ? s.children[0].offsetHeight : 0), d = t.target.scrollTop - e.skip * p;
|
|
707
719
|
a = this.base.getGroupedDataModernMode(a, n);
|
|
708
720
|
let r = a[0][n];
|
|
709
|
-
for (let h = 1; h < a.length && !(
|
|
721
|
+
for (let h = 1; h < a.length && !(p * h > d); h++)
|
|
710
722
|
a[h] && a[h][n] && (r = a[h][n]);
|
|
711
723
|
r !== this.state.group && this.setState({
|
|
712
724
|
group: r
|
|
@@ -743,13 +755,13 @@ const je = {
|
|
|
743
755
|
}, this.selectNext = (t) => {
|
|
744
756
|
const { data: e = [], dataItemKey: s } = this.props;
|
|
745
757
|
let n = e.map((S, D) => ({ item: S, itemIndex: D }));
|
|
746
|
-
const a = this.searchState.word,
|
|
758
|
+
const a = this.searchState.word, p = this.searchState.last, c = Bs(a, p);
|
|
747
759
|
let d = n.length, r = Math.max(0, e.findIndex((S) => R(S, this.value, s))), h;
|
|
748
|
-
this.props.defaultItem && (h = { item: this.props.defaultItem, itemIndex: -1 }, d += 1, r += 1), r +=
|
|
749
|
-
let
|
|
760
|
+
this.props.defaultItem && (h = { item: this.props.defaultItem, itemIndex: -1 }, d += 1, r += 1), r += c ? 1 : 0, n = Vs(n, r, h);
|
|
761
|
+
let u, g, m, v = 0;
|
|
750
762
|
const { textField: b, ignoreCase: w } = this.props;
|
|
751
763
|
for (; v < d; v++)
|
|
752
|
-
if (
|
|
764
|
+
if (u = V(n[v].item, b), g = c && os(u, p, w), m = os(u, a, w), g || m) {
|
|
753
765
|
v = n[v].itemIndex;
|
|
754
766
|
break;
|
|
755
767
|
}
|
|
@@ -764,42 +776,42 @@ const je = {
|
|
|
764
776
|
filterable: s,
|
|
765
777
|
disabled: n,
|
|
766
778
|
defaultItem: a,
|
|
767
|
-
leftRightKeysNavigation:
|
|
768
|
-
virtual:
|
|
779
|
+
leftRightKeysNavigation: p = !0,
|
|
780
|
+
virtual: c = { skip: 0, total: 0, pageSize: 0 },
|
|
769
781
|
dataItemKey: d,
|
|
770
782
|
groupField: r = "",
|
|
771
783
|
textField: h,
|
|
772
|
-
skipDisabledItems:
|
|
773
|
-
} = this.props,
|
|
784
|
+
skipDisabledItems: u = !0
|
|
785
|
+
} = this.props, g = this.value, m = e.findIndex((F) => R(F, g, d)), v = this.props.opened !== void 0 ? this.props.opened : this.state.opened, b = t.keyCode, w = b === f.home || b === f.end, S = b === f.up || b === f.down, D = !v && (t.altKey && b === f.down || b === f.enter || b === f.space), N = v && (t.altKey && b === f.up || b === f.esc), O = p && (b === f.left || b === f.right), _ = S || O && !s || w, C = this.base.initState();
|
|
774
786
|
if (C.syntheticEvent = t, !n) {
|
|
775
787
|
if (w && this.base.vs.enabled)
|
|
776
|
-
b ===
|
|
777
|
-
else if (v && b ===
|
|
788
|
+
b === f.home ? c.skip !== 0 ? (this.base.triggerOnPageChange(C, 0, c.pageSize), this._navigated = !0) : this.triggerOnChange(e[0], C) : c.skip < c.total - c.pageSize ? (this.base.triggerOnPageChange(C, c.total - c.pageSize, c.pageSize), this._navigated = !0) : this.triggerOnChange(e[e.length - 1], C);
|
|
789
|
+
else if (v && b === f.pageUp)
|
|
778
790
|
this.base.scrollPopupByPageSize(-1);
|
|
779
|
-
else if (v && b ===
|
|
791
|
+
else if (v && b === f.pageDown)
|
|
780
792
|
this.base.scrollPopupByPageSize(1);
|
|
781
|
-
else if (v && b ===
|
|
793
|
+
else if (v && b === f.enter) {
|
|
782
794
|
const F = this.getFocusedIndex();
|
|
783
795
|
this.haveFocusedItemAndDataNotEmpty(e, F) ? (this.triggerOnChange(null, C), this.applyState(C)) : this.handleItemSelect(F, C), this.base.togglePopup(C), t.preventDefault();
|
|
784
796
|
} else if (D || N)
|
|
785
797
|
N && this.resetValueIfDisabledItem(), this.base.togglePopup(C), t.preventDefault();
|
|
786
798
|
else if (_) {
|
|
787
799
|
if (this._lastKeypressIsFilter = !1, r !== "" && h)
|
|
788
|
-
if (!
|
|
800
|
+
if (!u && v)
|
|
789
801
|
this.onNavigate(C, b);
|
|
790
802
|
else {
|
|
791
803
|
let F;
|
|
792
|
-
if (b ===
|
|
793
|
-
const x = e.slice(
|
|
804
|
+
if (b === f.down || b === f.right) {
|
|
805
|
+
const x = e.slice(m + 1).find((E) => !E.disabled && E[h]);
|
|
794
806
|
F = x && e.findIndex((E) => E[h] === x[h]);
|
|
795
|
-
} else if (b ===
|
|
807
|
+
} else if (b === f.up || b === f.left) {
|
|
796
808
|
let x;
|
|
797
|
-
if (
|
|
809
|
+
if (m === 0 && a)
|
|
798
810
|
F = -1;
|
|
799
|
-
else if (
|
|
811
|
+
else if (m === -1)
|
|
800
812
|
x = e, F = e.findIndex((E) => !E.disabled && E[h]);
|
|
801
813
|
else {
|
|
802
|
-
x = e.slice(0,
|
|
814
|
+
x = e.slice(0, m);
|
|
803
815
|
let E = x.pop();
|
|
804
816
|
for (; E && E.disabled; )
|
|
805
817
|
E = x.pop();
|
|
@@ -807,26 +819,26 @@ const je = {
|
|
|
807
819
|
}
|
|
808
820
|
}
|
|
809
821
|
if (F !== void 0) {
|
|
810
|
-
const x = F -
|
|
822
|
+
const x = F - m;
|
|
811
823
|
this.onNavigate(C, b, x);
|
|
812
824
|
} else
|
|
813
|
-
F === void 0 && e.findIndex((x) => x[h] ===
|
|
825
|
+
F === void 0 && e.findIndex((x) => x[h] === g[h]) === e.length - 1 && this.onNavigate(C, b);
|
|
814
826
|
}
|
|
815
|
-
else if (!
|
|
827
|
+
else if (!u && v || w)
|
|
816
828
|
this.onNavigate(C, b);
|
|
817
829
|
else if (h) {
|
|
818
830
|
let F;
|
|
819
|
-
if (b ===
|
|
820
|
-
const x = e.slice(
|
|
831
|
+
if (b === f.down || b === f.right) {
|
|
832
|
+
const x = e.slice(m + 1).find((E) => !E.disabled && E[h]);
|
|
821
833
|
F = x && e.findIndex((E) => E[h] === x[h]);
|
|
822
|
-
} else if (b ===
|
|
834
|
+
} else if (b === f.up || b === f.left) {
|
|
823
835
|
let x;
|
|
824
|
-
if (
|
|
836
|
+
if (m === 0 && a)
|
|
825
837
|
F = -1;
|
|
826
|
-
else if (
|
|
838
|
+
else if (m === -1)
|
|
827
839
|
x = e, F = e.find((E) => !E.disabled && E[h]);
|
|
828
840
|
else {
|
|
829
|
-
x = e.slice(0,
|
|
841
|
+
x = e.slice(0, m);
|
|
830
842
|
let E = x.pop();
|
|
831
843
|
for (; E && E.disabled; )
|
|
832
844
|
E = x.pop();
|
|
@@ -834,10 +846,10 @@ const je = {
|
|
|
834
846
|
}
|
|
835
847
|
}
|
|
836
848
|
if (F !== void 0) {
|
|
837
|
-
const x = F -
|
|
849
|
+
const x = F - m;
|
|
838
850
|
this.onNavigate(C, b, x);
|
|
839
851
|
} else
|
|
840
|
-
F === void 0 && e.findIndex((x) => x[h] ===
|
|
852
|
+
F === void 0 && e.findIndex((x) => x[h] === g[h]) === e.length - 1 && this.onNavigate(C, b);
|
|
841
853
|
} else
|
|
842
854
|
this.onNavigate(C, b);
|
|
843
855
|
t.preventDefault();
|
|
@@ -851,8 +863,8 @@ const je = {
|
|
|
851
863
|
}, this.handleBlur = (t) => {
|
|
852
864
|
if (this._skipFocusEvent || !this.state.focused)
|
|
853
865
|
return;
|
|
854
|
-
const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { adaptive: s } = this.props, { windowWidth: n = 0 } = this.state, a = n <= Se && s,
|
|
855
|
-
|
|
866
|
+
const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { adaptive: s } = this.props, { windowWidth: n = 0 } = this.state, a = n <= Se && s, p = this.base.initState();
|
|
867
|
+
p.syntheticEvent = t, p.data.focused = !1, p.events.push({ type: "onBlur" }), e && this.resetValueIfDisabledItem(), e && !a && this.base.togglePopup(p), this.applyState(p);
|
|
856
868
|
}, this.handleDefaultItemClick = (t) => {
|
|
857
869
|
const e = this.base.initState();
|
|
858
870
|
e.syntheticEvent = t, this.base.togglePopup(e), this.triggerOnChange(this.props.defaultItem, e), this.applyState(e);
|
|
@@ -862,7 +874,7 @@ const je = {
|
|
|
862
874
|
const e = this.base.initState();
|
|
863
875
|
e.syntheticEvent = t, this.state.focused || (e.data.focused = !0), this.resetValueIfDisabledItem(), this.base.togglePopup(e), this.applyState(e);
|
|
864
876
|
}, this.handleKeyPress = (t) => {
|
|
865
|
-
if (this.props.filterable || t.which === 0 || t.keyCode ===
|
|
877
|
+
if (this.props.filterable || t.which === 0 || t.keyCode === f.enter)
|
|
866
878
|
return;
|
|
867
879
|
let e = String.fromCharCode(t.charCode || t.keyCode);
|
|
868
880
|
this.props.ignoreCase && (e = e.toLowerCase()), e === " " && t.preventDefault(), this.searchState = {
|
|
@@ -942,18 +954,18 @@ const je = {
|
|
|
942
954
|
* @hidden
|
|
943
955
|
*/
|
|
944
956
|
componentDidUpdate(i, t) {
|
|
945
|
-
var
|
|
957
|
+
var u;
|
|
946
958
|
const { dataItemKey: e, virtual: s, groupField: n = "", textField: a } = this.props;
|
|
947
|
-
let { data:
|
|
948
|
-
const
|
|
949
|
-
if (this.base.getPopupSettings().animate || h && this.onPopupOpened(), s && s.total !==
|
|
959
|
+
let { data: p = [] } = this.props;
|
|
960
|
+
const c = i.virtual ? i.virtual.total : 0, d = this.props.opened !== void 0 ? this.props.opened : this.state.opened, r = i.opened !== void 0 ? i.opened : t.opened, h = !r && d;
|
|
961
|
+
if (this.base.getPopupSettings().animate || h && this.onPopupOpened(), s && s.total !== c)
|
|
950
962
|
this.base.vs.calcScrollElementHeight(), this.base.vs.reset();
|
|
951
963
|
else {
|
|
952
|
-
const
|
|
953
|
-
let v =
|
|
954
|
-
n !== "" &&
|
|
955
|
-
const b = !R(
|
|
956
|
-
h && s ? this.base.scrollToVirtualItem(s, v) : h && !s ? (this.onPopupOpened(),
|
|
964
|
+
const g = this.value, m = i.value !== void 0 ? i.value : t.value;
|
|
965
|
+
let v = p.findIndex((w) => R(w, g, e));
|
|
966
|
+
n !== "" && g && a && (v = (u = this.base.getGroupedDataModernMode(p, n)) == null ? void 0 : u.map((w) => w[a]).indexOf(g[a]));
|
|
967
|
+
const b = !R(m, g, e);
|
|
968
|
+
h && s ? this.base.scrollToVirtualItem(s, v) : h && !s ? (this.onPopupOpened(), p && p.length !== 0 && this.base.resetGroupStickyHeader(p[0][n], this), this.base.scrollToItem(v)) : d && r && g && b && !this._navigated ? this.base.scrollToItem(v) : d && r && this._navigated && (this._navigated && s && s.skip === 0 ? this.base.vs.reset() : this._navigated && s && s.skip === s.total - s.pageSize && this.base.vs.scrollToEnd());
|
|
957
969
|
}
|
|
958
970
|
this._navigated = !1, this.setValidity();
|
|
959
971
|
}
|
|
@@ -973,7 +985,7 @@ const je = {
|
|
|
973
985
|
* @hidden
|
|
974
986
|
*/
|
|
975
987
|
render() {
|
|
976
|
-
const i = Ae(this).toLanguageString(
|
|
988
|
+
const i = Ae(this).toLanguageString(Ht, le[Ht]), { style: t, className: e, label: s, dir: n, virtual: a, size: p, rounded: c, fillMode: d, adaptive: r } = this.props, { windowWidth: h = 0 } = this.state, u = this.props.opened !== void 0 ? this.props.opened : this.state.opened, g = this.value, m = V(g, this.props.textField), v = !this.validityStyles || this.validity.valid, b = this.base, w = b.vs, S = h <= Se && r;
|
|
977
989
|
w.enabled = a !== void 0, a !== void 0 && (b.vs.skip = a.skip, b.vs.total = a.total, b.vs.pageSize = a.pageSize);
|
|
978
990
|
const {
|
|
979
991
|
dataItemKey: D,
|
|
@@ -983,7 +995,7 @@ const je = {
|
|
|
983
995
|
loading: C,
|
|
984
996
|
iconClassName: F,
|
|
985
997
|
valueRender: x
|
|
986
|
-
} = this.props, { focused: E } = this.state, M = N.findIndex((Y) => R(Y,
|
|
998
|
+
} = this.props, { focused: E } = this.state, M = N.findIndex((Y) => R(Y, g, D)), K = /* @__PURE__ */ o.createElement("span", { id: this._inputId, className: "k-input-inner" }, /* @__PURE__ */ o.createElement("span", { className: "k-input-value-text" }, m)), U = x !== void 0 ? x.call(void 0, K, g) : K, j = /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
987
999
|
"span",
|
|
988
1000
|
{
|
|
989
1001
|
ref: this.componentRef,
|
|
@@ -991,8 +1003,8 @@ const je = {
|
|
|
991
1003
|
"k-dropdownlist k-picker",
|
|
992
1004
|
e,
|
|
993
1005
|
{
|
|
994
|
-
[`k-picker-${Vt[
|
|
995
|
-
[`k-rounded-${Js[
|
|
1006
|
+
[`k-picker-${Vt[p] || p}`]: p,
|
|
1007
|
+
[`k-rounded-${Js[c] || c}`]: c,
|
|
996
1008
|
[`k-picker-${d}`]: d,
|
|
997
1009
|
"k-focus": E,
|
|
998
1010
|
"k-disabled": O,
|
|
@@ -1003,7 +1015,7 @@ const je = {
|
|
|
1003
1015
|
),
|
|
1004
1016
|
style: s ? { ...t, width: void 0 } : t,
|
|
1005
1017
|
dir: n,
|
|
1006
|
-
onMouseDown:
|
|
1018
|
+
onMouseDown: u ? (Y) => {
|
|
1007
1019
|
Y.target.nodeName !== "INPUT" && (this.focusElement(this.base.wrapper), Y.preventDefault());
|
|
1008
1020
|
} : void 0,
|
|
1009
1021
|
onFocus: this.handleFocus,
|
|
@@ -1017,9 +1029,9 @@ const je = {
|
|
|
1017
1029
|
"aria-required": this.required,
|
|
1018
1030
|
"aria-disabled": O || void 0,
|
|
1019
1031
|
"aria-haspopup": "listbox",
|
|
1020
|
-
"aria-expanded":
|
|
1032
|
+
"aria-expanded": u || !1,
|
|
1021
1033
|
"aria-owns": this.base.listBoxId,
|
|
1022
|
-
"aria-activedescendant":
|
|
1034
|
+
"aria-activedescendant": u ? "option-" + this.base.guid + "-" + (M + (a ? a.skip : 0)) : void 0,
|
|
1023
1035
|
"aria-label": this.props.ariaLabel || this.props.label,
|
|
1024
1036
|
"aria-labelledby": this.props.ariaLabelledBy,
|
|
1025
1037
|
"aria-describedby": this.props.ariaDescribedBy || this._inputId,
|
|
@@ -1035,7 +1047,7 @@ const je = {
|
|
|
1035
1047
|
type: "button",
|
|
1036
1048
|
"aria-label": i,
|
|
1037
1049
|
"aria-hidden": !0,
|
|
1038
|
-
size:
|
|
1050
|
+
size: p,
|
|
1039
1051
|
fillMode: d,
|
|
1040
1052
|
iconClass: F,
|
|
1041
1053
|
className: "k-input-button",
|
|
@@ -1046,14 +1058,14 @@ const je = {
|
|
|
1046
1058
|
onMouseDown: (Y) => this.state.focused && Y.preventDefault()
|
|
1047
1059
|
}
|
|
1048
1060
|
),
|
|
1049
|
-
this.dummySelect(
|
|
1061
|
+
this.dummySelect(g),
|
|
1050
1062
|
!S && this.renderListContainer()
|
|
1051
1063
|
), S && this.renderAdaptiveListContainer());
|
|
1052
1064
|
return s ? /* @__PURE__ */ o.createElement(
|
|
1053
1065
|
Ge,
|
|
1054
1066
|
{
|
|
1055
1067
|
label: s,
|
|
1056
|
-
editorValue:
|
|
1068
|
+
editorValue: m,
|
|
1057
1069
|
editorValid: v,
|
|
1058
1070
|
editorDisabled: this.props.disabled,
|
|
1059
1071
|
style: { width: t ? t.width : void 0 },
|
|
@@ -1069,10 +1081,10 @@ const je = {
|
|
|
1069
1081
|
data: s = [],
|
|
1070
1082
|
defaultItem: n,
|
|
1071
1083
|
dataItemKey: a,
|
|
1072
|
-
virtual:
|
|
1073
|
-
} = this.props,
|
|
1074
|
-
current:
|
|
1075
|
-
max: (
|
|
1084
|
+
virtual: p = { skip: 0, total: 0, pageSize: 0 }
|
|
1085
|
+
} = this.props, c = this.base.vs, d = this.value, r = s.findIndex((u) => R(u, d, a)), h = this.base.navigation.navigate({
|
|
1086
|
+
current: p.skip + r,
|
|
1087
|
+
max: (c.enabled ? p.total : s.length) - 1,
|
|
1076
1088
|
min: n !== void 0 ? -1 : 0,
|
|
1077
1089
|
keyCode: t,
|
|
1078
1090
|
skipItems: e || void 0
|
|
@@ -1080,17 +1092,17 @@ const je = {
|
|
|
1080
1092
|
h !== void 0 && this.handleItemSelect(h, i), this.applyState(i);
|
|
1081
1093
|
}
|
|
1082
1094
|
renderAdaptiveListContainer() {
|
|
1083
|
-
const { windowWidth: i = 0 } = this.state, { header: t, footer: e, size: s, adaptiveTitle: n, groupField: a, groupStickyHeaderItemRender:
|
|
1095
|
+
const { windowWidth: i = 0 } = this.state, { header: t, footer: e, size: s, adaptiveTitle: n, groupField: a, groupStickyHeaderItemRender: p, list: c, data: d = [] } = this.props, r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, h = {
|
|
1084
1096
|
navigatable: !1,
|
|
1085
1097
|
navigatableElements: [],
|
|
1086
1098
|
expand: r,
|
|
1087
1099
|
animation: !0,
|
|
1088
|
-
onClose: (
|
|
1100
|
+
onClose: (g) => this.handleWrapperClick(g),
|
|
1089
1101
|
animationStyles: i <= St ? { top: 0, width: "100%", height: "100%" } : void 0,
|
|
1090
1102
|
className: i <= St ? "k-adaptive-actionsheet k-actionsheet-fullscreen" : "k-adaptive-actionsheet k-actionsheet-bottom"
|
|
1091
1103
|
};
|
|
1092
|
-
let { group:
|
|
1093
|
-
return
|
|
1104
|
+
let { group: u } = this.state;
|
|
1105
|
+
return u === void 0 && a !== void 0 && (u = V(d[0], a)), /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(Yt, { ...h }, /* @__PURE__ */ o.createElement(Jt, { className: "k-text-center" }, /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-titlebar-group k-hbox" }, /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-title" }, /* @__PURE__ */ o.createElement("div", null, n)), /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-actions" }, /* @__PURE__ */ o.createElement(
|
|
1094
1106
|
Te,
|
|
1095
1107
|
{
|
|
1096
1108
|
tabIndex: 0,
|
|
@@ -1114,7 +1126,7 @@ const je = {
|
|
|
1114
1126
|
)
|
|
1115
1127
|
},
|
|
1116
1128
|
this.renderDefaultItem(),
|
|
1117
|
-
!
|
|
1129
|
+
!c && u && d.length !== 0 && /* @__PURE__ */ o.createElement(We, { group: u, groupMode: "modern", render: p }),
|
|
1118
1130
|
this.renderList()
|
|
1119
1131
|
), e && /* @__PURE__ */ o.createElement("div", { className: "k-list-footer" }, e))));
|
|
1120
1132
|
}
|
|
@@ -1125,10 +1137,10 @@ const je = {
|
|
|
1125
1137
|
dataItemKey: s,
|
|
1126
1138
|
virtual: n = { skip: 0 },
|
|
1127
1139
|
focusedItemIndex: a = Ve,
|
|
1128
|
-
filterable:
|
|
1129
|
-
skipDisabledItems:
|
|
1140
|
+
filterable: p,
|
|
1141
|
+
skipDisabledItems: c = !0
|
|
1130
1142
|
} = this.props, d = this.props.filter ? this.props.filter : this.state.text;
|
|
1131
|
-
return
|
|
1143
|
+
return c && e && !d && !i ? t.findIndex((r) => !r.disabled && r[e]) : G(i) && d === void 0 || p && d === "" ? t.findIndex((r) => R(r, i, s)) : d ? this._lastKeypressIsFilter ? a(t, d, e) : t.findIndex((r) => R(r, i, s)) : n.skip === 0 ? 0 : -1;
|
|
1132
1144
|
}
|
|
1133
1145
|
focusElement(i) {
|
|
1134
1146
|
this._skipFocusEvent = !0, i.focus(), window.setTimeout(() => this._skipFocusEvent = !1, 30);
|
|
@@ -1201,8 +1213,8 @@ class Zt extends o.Component {
|
|
|
1201
1213
|
return this._input;
|
|
1202
1214
|
}
|
|
1203
1215
|
componentDidUpdate(t) {
|
|
1204
|
-
const e = t.value, s = t.suggestedText, { value: n, suggestedText: a, focused:
|
|
1205
|
-
|
|
1216
|
+
const e = t.value, s = t.suggestedText, { value: n, suggestedText: a, focused: p } = this.props, c = this.input, d = e !== n || a !== s, r = d && e.startsWith(n) && !(s && a && s.endsWith(a)), h = Ss(document);
|
|
1217
|
+
p && c && h !== c && c.focus(), a && d && !r && c && c.setSelectionRange(n.length - a.length, n.length);
|
|
1206
1218
|
}
|
|
1207
1219
|
render() {
|
|
1208
1220
|
const { expanded: t = !1, disabled: e, role: s = "listbox", render: n } = this.props, a = /* @__PURE__ */ o.createElement(
|
|
@@ -1221,7 +1233,7 @@ class Zt extends o.Component {
|
|
|
1221
1233
|
name: this.props.name,
|
|
1222
1234
|
value: this.props.value,
|
|
1223
1235
|
onChange: this.props.onChange,
|
|
1224
|
-
ref: (
|
|
1236
|
+
ref: (p) => this._input = p,
|
|
1225
1237
|
onKeyDown: this.props.onKeyDown,
|
|
1226
1238
|
onFocus: this.props.onFocus,
|
|
1227
1239
|
onBlur: this.props.onBlur,
|
|
@@ -1269,8 +1281,8 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1269
1281
|
super(i), this.state = {}, this.base = new ie(this), this._element = null, this._inputId = Fe(), this._suggested = "", this._skipBlur = !1, this._input = null, this._adaptiveFilterInput = null, this.itemHeight = 0, this.focus = () => {
|
|
1270
1282
|
this._input && this._input.focus();
|
|
1271
1283
|
}, this.handleItemSelect = (t, e) => {
|
|
1272
|
-
const { data: s = [], virtual: n, dataItemKey: a } = this.props,
|
|
1273
|
-
this.triggerOnChange(
|
|
1284
|
+
const { data: s = [], virtual: n, dataItemKey: a } = this.props, p = n ? n.skip : 0, c = s[t - p], d = !R(c, this.value, a);
|
|
1285
|
+
this.triggerOnChange(c, e), this.state.text !== void 0 && (e.data.text = void 0), d && this.base.triggerPageChangeCornerItems(c, e);
|
|
1274
1286
|
}, this.onPopupOpened = () => {
|
|
1275
1287
|
setTimeout(() => {
|
|
1276
1288
|
this.mobileMode && this._adaptiveFilterInput && (this._skipBlur = !0, this._adaptiveFilterInput.focus(), this._skipBlur = !1);
|
|
@@ -1278,8 +1290,8 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1278
1290
|
}, this.componentRef = (t) => {
|
|
1279
1291
|
this._element = t, this.base.wrapper = t;
|
|
1280
1292
|
}, this.toggleBtnClick = (t) => {
|
|
1281
|
-
const { data: e = [], skipDisabledItems: s, textField: n } = this.props, a = this.getFocusedIndex(),
|
|
1282
|
-
if (d.syntheticEvent = t, !s && n &&
|
|
1293
|
+
const { data: e = [], skipDisabledItems: s, textField: n } = this.props, a = this.getFocusedIndex(), p = this.getCurrentValueDisabledStatus(n, e, a), c = this.props.opened !== void 0 ? this.props.opened : this.state.opened, d = this.base.initState();
|
|
1294
|
+
if (d.syntheticEvent = t, !s && n && p && this.clearValueOnToggleBtnClick(t), this.base.togglePopup(d), !c && this.mobileMode) {
|
|
1283
1295
|
const r = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text || null;
|
|
1284
1296
|
this.base.filterChanged(r, d);
|
|
1285
1297
|
}
|
|
@@ -1308,10 +1320,10 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1308
1320
|
let { data: a = [] } = this.props;
|
|
1309
1321
|
if (!n || !a.length)
|
|
1310
1322
|
return;
|
|
1311
|
-
const
|
|
1323
|
+
const p = this.itemHeight = this.itemHeight || (e.enabled ? e.itemHeight : s ? s.children[0].offsetHeight : 0), d = t.target.scrollTop - e.skip * p;
|
|
1312
1324
|
this.props.groupMode === "modern" && (a = this.base.getGroupedDataModernMode(a, n));
|
|
1313
1325
|
let r = a[0][n];
|
|
1314
|
-
for (let h = 1; h < a.length && !(
|
|
1326
|
+
for (let h = 1; h < a.length && !(p * h > d); h++)
|
|
1315
1327
|
a[h] && a[h][n] && (r = a[h][n]);
|
|
1316
1328
|
r !== this.state.group && (this.setState({
|
|
1317
1329
|
group: r
|
|
@@ -1320,8 +1332,8 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1320
1332
|
this.base.handleItemClick(t, e), this._valueDuringOnChange = void 0;
|
|
1321
1333
|
}, this.handleBlur = (t) => {
|
|
1322
1334
|
if (this.state.focused && !this._skipBlur) {
|
|
1323
|
-
const e = this.base.initState(), { textField: s, data: n = [] } = this.props, a = this.getFocusedIndex(),
|
|
1324
|
-
e.data.focused = !1, e.events.push({ type: "onBlur" }), e.syntheticEvent = t, s &&
|
|
1335
|
+
const e = this.base.initState(), { textField: s, data: n = [] } = this.props, a = this.getFocusedIndex(), c = !(a === -1) && this.getCurrentValueDisabledStatus(s, n, a);
|
|
1336
|
+
e.data.focused = !1, e.events.push({ type: "onBlur" }), e.syntheticEvent = t, s && c && this.clearValueOnBlur(t), this.applyValueOnRejectSuggestions(t.currentTarget.value, e);
|
|
1325
1337
|
}
|
|
1326
1338
|
}, this.onInputClick = (t) => {
|
|
1327
1339
|
const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, s = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text || null;
|
|
@@ -1330,17 +1342,17 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1330
1342
|
n.syntheticEvent = t, this.base.togglePopup(n), this.base.filterChanged(s, n), this.applyState(n);
|
|
1331
1343
|
}
|
|
1332
1344
|
}, this.onInputKeyDown = (t) => {
|
|
1333
|
-
const { data: e = [], skipDisabledItems: s, textField: n, dataItemKey: a, groupField:
|
|
1334
|
-
if (
|
|
1335
|
-
if (t.preventDefault(),
|
|
1345
|
+
const { data: e = [], skipDisabledItems: s, textField: n, dataItemKey: a, groupField: p } = this.props, c = this.value, d = Math.max(0, e.findIndex((w) => R(w, c, a))), r = t.keyCode, h = this.props.opened !== void 0 ? this.props.opened : this.state.opened, u = this.base.initState();
|
|
1346
|
+
if (u.syntheticEvent = t, !t.altKey && (r === f.up || r === f.down)) {
|
|
1347
|
+
if (t.preventDefault(), p !== "" && n)
|
|
1336
1348
|
if (!this.props.skipDisabledItems && h)
|
|
1337
|
-
this.onNavigate(
|
|
1349
|
+
this.onNavigate(u, r);
|
|
1338
1350
|
else {
|
|
1339
1351
|
let w = 0;
|
|
1340
|
-
if (r ===
|
|
1352
|
+
if (r === f.down || r === f.right) {
|
|
1341
1353
|
const S = e.slice(d + 1).find((D) => !D.disabled && D[n]);
|
|
1342
1354
|
w = S && e.findIndex((D) => D[n] === S[n]);
|
|
1343
|
-
} else if (r ===
|
|
1355
|
+
} else if (r === f.up || r === f.left) {
|
|
1344
1356
|
let S;
|
|
1345
1357
|
if (d === 0)
|
|
1346
1358
|
S = e, w = e.findIndex((D) => !D.disabled && D[n]);
|
|
@@ -1354,43 +1366,43 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1354
1366
|
}
|
|
1355
1367
|
if (w !== void 0) {
|
|
1356
1368
|
const S = w - d;
|
|
1357
|
-
this.onNavigate(
|
|
1369
|
+
this.onNavigate(u, r, S);
|
|
1358
1370
|
} else
|
|
1359
|
-
w === void 0 && e.findIndex((S) => S[n] ===
|
|
1371
|
+
w === void 0 && e.findIndex((S) => S[n] === c[n]) === e.length - 1 && this.onNavigate(u, r);
|
|
1360
1372
|
}
|
|
1361
1373
|
else if (!this.props.skipDisabledItems && h)
|
|
1362
|
-
this.onNavigate(
|
|
1374
|
+
this.onNavigate(u, r);
|
|
1363
1375
|
else {
|
|
1364
1376
|
let w = null;
|
|
1365
|
-
if (r ===
|
|
1377
|
+
if (r === f.down || r === f.right)
|
|
1366
1378
|
w = e.slice(d + 1).find((S) => !S.disabled);
|
|
1367
|
-
else if (r ===
|
|
1379
|
+
else if (r === f.up || r === f.left) {
|
|
1368
1380
|
const S = e.slice(0, d);
|
|
1369
1381
|
for (w = S.pop(); w && w.disabled; )
|
|
1370
1382
|
w = S.pop();
|
|
1371
1383
|
}
|
|
1372
1384
|
if (w) {
|
|
1373
1385
|
const S = w.id - d - 1;
|
|
1374
|
-
this.onNavigate(
|
|
1386
|
+
this.onNavigate(u, r, S);
|
|
1375
1387
|
} else
|
|
1376
|
-
this.onNavigate(
|
|
1388
|
+
this.onNavigate(u, r);
|
|
1377
1389
|
}
|
|
1378
|
-
this.applyState(
|
|
1390
|
+
this.applyState(u);
|
|
1379
1391
|
}
|
|
1380
|
-
const
|
|
1381
|
-
t.preventDefault(), this.base.togglePopup(
|
|
1382
|
-
},
|
|
1383
|
-
h ? r ===
|
|
1392
|
+
const g = () => {
|
|
1393
|
+
t.preventDefault(), this.base.togglePopup(u), this.applyState(u);
|
|
1394
|
+
}, m = this.getFocusedIndex(), v = m === -1, b = !v && this.getCurrentValueDisabledStatus(n, e, m);
|
|
1395
|
+
h ? r === f.pageUp ? this.base.scrollPopupByPageSize(-1) : r === f.pageDown ? this.base.scrollPopupByPageSize(1) : t.altKey && r === f.up ? g() : r === f.enter ? (t.preventDefault(), (n && !v && t.currentTarget.value ? e[m][n] : void 0) ? !s && n && b ? this.clearValueOnEnterOrEsc(t) : b || this.applyValueOnEnter(t.currentTarget.value, u) : this.applyValueOnEnter(t.currentTarget.value, u)) : r === f.esc && (!s && n && b && this.clearValueOnEnterOrEsc(t), this.applyValueOnRejectSuggestions(t.currentTarget.value, u)) : !h && r === f.esc ? this.clearValueOnEnterOrEsc(t) : t.altKey && r === f.down && g();
|
|
1384
1396
|
}, this.inputOnChange = (t) => {
|
|
1385
1397
|
const e = this.base.initState();
|
|
1386
1398
|
e.syntheticEvent = t;
|
|
1387
1399
|
const s = this.props.opened !== void 0 ? this.props.opened : this.state.opened, n = t.currentTarget, a = n.value;
|
|
1388
1400
|
if (this.props.suggest) {
|
|
1389
|
-
const
|
|
1390
|
-
let
|
|
1391
|
-
G(
|
|
1392
|
-
const d =
|
|
1393
|
-
d || r || !
|
|
1401
|
+
const p = n.selectionEnd === a.length;
|
|
1402
|
+
let c = this.props.filter !== void 0 ? this.props.filter : this.state.text;
|
|
1403
|
+
G(c) || (c = V(this.value, this.props.textField) || "");
|
|
1404
|
+
const d = c && c === a, r = c && c.length > a.length;
|
|
1405
|
+
d || r || !p ? this._suggested = "" : this.suggestValue(a);
|
|
1394
1406
|
}
|
|
1395
1407
|
this.props.filter === void 0 && (e.data.text = a), this.state.focusedItem !== void 0 && (e.data.focusedItem = void 0), s || this.base.togglePopup(e), this.base.filterChanged(a, e), this.applyState(e), this.setState({ group: void 0 });
|
|
1396
1408
|
}, this.clearButtonClick = (t) => {
|
|
@@ -1471,16 +1483,16 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1471
1483
|
}
|
|
1472
1484
|
/** @hidden */
|
|
1473
1485
|
componentDidUpdate(i, t) {
|
|
1474
|
-
var
|
|
1475
|
-
const { dataItemKey: e, virtual: s, groupField: n = "", data: a = [], textField:
|
|
1476
|
-
if (this._valueOnDidUpdate =
|
|
1486
|
+
var g;
|
|
1487
|
+
const { dataItemKey: e, virtual: s, groupField: n = "", data: a = [], textField: p } = this.props, c = i.virtual ? i.virtual.total : 0, d = this.props.opened !== void 0 ? this.props.opened : this.state.opened, r = i.opened !== void 0 ? i.opened : t.opened, h = !r && d, u = this.value;
|
|
1488
|
+
if (this._valueOnDidUpdate = u, s && s.total !== c)
|
|
1477
1489
|
this.base.vs.calcScrollElementHeight(), this.base.vs.reset();
|
|
1478
1490
|
else {
|
|
1479
|
-
const
|
|
1480
|
-
let v = a.findIndex((w) => R(w,
|
|
1481
|
-
this.props.groupMode === "modern" &&
|
|
1482
|
-
const b = !R(
|
|
1483
|
-
h && s ? this.base.scrollToVirtualItem(s, v) : h && !s ? (this.onPopupOpened(), a && a.length !== 0 && this.base.resetGroupStickyHeader(a[0][n], this), this.base.scrollToItem(v)) : d && r &&
|
|
1491
|
+
const m = i.value !== void 0 ? i.value : t.value;
|
|
1492
|
+
let v = a.findIndex((w) => R(w, u, e));
|
|
1493
|
+
this.props.groupMode === "modern" && p && u && (v = (g = this.base.getGroupedDataModernMode(a, n)) == null ? void 0 : g.map((w) => w[p]).indexOf(u[p]));
|
|
1494
|
+
const b = !R(m, u, e);
|
|
1495
|
+
h && s ? this.base.scrollToVirtualItem(s, v) : h && !s ? (this.onPopupOpened(), a && a.length !== 0 && this.base.resetGroupStickyHeader(a[0][n], this), this.base.scrollToItem(v)) : d && r && u && b && this.base.scrollToItem(v);
|
|
1484
1496
|
}
|
|
1485
1497
|
h && this._input && this._input.focus(), this.setValidity();
|
|
1486
1498
|
}
|
|
@@ -1497,34 +1509,34 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1497
1509
|
/** @hidden */
|
|
1498
1510
|
render() {
|
|
1499
1511
|
const i = Ae(this).toLanguageString(Lt, le[Lt]), t = Ae(this).toLanguageString(
|
|
1500
|
-
|
|
1501
|
-
le[
|
|
1512
|
+
zt,
|
|
1513
|
+
le[zt]
|
|
1502
1514
|
), {
|
|
1503
1515
|
dir: e,
|
|
1504
1516
|
disabled: s,
|
|
1505
1517
|
clearButton: n = It.defaultProps.clearButton,
|
|
1506
1518
|
label: a,
|
|
1507
|
-
textField:
|
|
1508
|
-
adaptive:
|
|
1519
|
+
textField: p,
|
|
1520
|
+
adaptive: c,
|
|
1509
1521
|
className: d,
|
|
1510
1522
|
style: r,
|
|
1511
1523
|
loading: h,
|
|
1512
|
-
iconClassName:
|
|
1513
|
-
virtual:
|
|
1514
|
-
size:
|
|
1524
|
+
iconClassName: u,
|
|
1525
|
+
virtual: g,
|
|
1526
|
+
size: m,
|
|
1515
1527
|
rounded: v,
|
|
1516
1528
|
fillMode: b,
|
|
1517
1529
|
opened: w = this.state.opened,
|
|
1518
1530
|
placeholder: S
|
|
1519
|
-
} = this.props, { windowWidth: D = 0 } = this.state, N = !this.validityStyles || this.validity.valid, O = this.props.filter !== void 0 ? this.props.filter : this.state.text, _ = V(this.value,
|
|
1520
|
-
E.enabled =
|
|
1531
|
+
} = this.props, { windowWidth: D = 0 } = this.state, N = !this.validityStyles || this.validity.valid, O = this.props.filter !== void 0 ? this.props.filter : this.state.text, _ = V(this.value, p), C = G(O) ? O : _, F = n && (!!C || G(this.value)), E = this.base.vs, M = this.props.id || this._inputId, K = D <= Se && c;
|
|
1532
|
+
E.enabled = g !== void 0, g !== void 0 && (E.skip = g.skip, E.total = g.total, E.pageSize = g.pageSize);
|
|
1521
1533
|
const U = /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
1522
1534
|
"span",
|
|
1523
1535
|
{
|
|
1524
1536
|
className: B(
|
|
1525
1537
|
"k-combobox k-input",
|
|
1526
1538
|
{
|
|
1527
|
-
[`k-input-${bt[
|
|
1539
|
+
[`k-input-${bt[m] || m}`]: m,
|
|
1528
1540
|
[`k-rounded-${ei[v] || v}`]: v,
|
|
1529
1541
|
[`k-input-${b}`]: b,
|
|
1530
1542
|
"k-invalid": !N,
|
|
@@ -1547,10 +1559,10 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1547
1559
|
tabIndex: -1,
|
|
1548
1560
|
type: "button",
|
|
1549
1561
|
"aria-label": w ? t : i,
|
|
1550
|
-
icon:
|
|
1551
|
-
svgIcon:
|
|
1552
|
-
iconClass:
|
|
1553
|
-
size:
|
|
1562
|
+
icon: u ? void 0 : "caret-alt-down",
|
|
1563
|
+
svgIcon: u ? this.props.svgIcon : Ut,
|
|
1564
|
+
iconClass: u,
|
|
1565
|
+
size: m,
|
|
1554
1566
|
fillMode: b,
|
|
1555
1567
|
rounded: null,
|
|
1556
1568
|
themeColor: "base",
|
|
@@ -1576,17 +1588,17 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1576
1588
|
}
|
|
1577
1589
|
/** @hidden */
|
|
1578
1590
|
onNavigate(i, t, e) {
|
|
1579
|
-
const { data: s = [], virtual: n = { skip: 0 } } = this.props, a = this.props.filter ? this.props.filter : this.state.text,
|
|
1580
|
-
if (this._suggested = "",
|
|
1581
|
-
this.handleItemSelect(
|
|
1591
|
+
const { data: s = [], virtual: n = { skip: 0 } } = this.props, a = this.props.filter ? this.props.filter : this.state.text, p = this.getFocusedIndex(), c = this.base.vs, d = this.value;
|
|
1592
|
+
if (this._suggested = "", p !== -1 && !G(d))
|
|
1593
|
+
this.handleItemSelect(p, i);
|
|
1582
1594
|
else if (a === "")
|
|
1583
1595
|
this.handleItemSelect(0, i);
|
|
1584
1596
|
else {
|
|
1585
|
-
let r = n.skip +
|
|
1597
|
+
let r = n.skip + p;
|
|
1586
1598
|
const h = this.base.navigation.navigate({
|
|
1587
1599
|
keyCode: t,
|
|
1588
1600
|
current: r,
|
|
1589
|
-
max: (
|
|
1601
|
+
max: (c.enabled ? c.total : s.length) - 1,
|
|
1590
1602
|
min: 0,
|
|
1591
1603
|
skipItems: e || void 0
|
|
1592
1604
|
});
|
|
@@ -1597,10 +1609,10 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1597
1609
|
return i && t && t[e] && t[e].disabled;
|
|
1598
1610
|
}
|
|
1599
1611
|
applyValueOnEnter(i, t) {
|
|
1600
|
-
const { data: e = [], textField: s, allowCustom: n } = this.props, a = this.props.opened !== void 0 ? this.props.opened : this.state.opened,
|
|
1612
|
+
const { data: e = [], textField: s, allowCustom: n } = this.props, a = this.props.opened !== void 0 ? this.props.opened : this.state.opened, c = V(this.value, s) === i ? this.index : Kt(e, i, s), d = c !== -1;
|
|
1601
1613
|
let r;
|
|
1602
1614
|
if (this._suggested = "", d)
|
|
1603
|
-
r = e[
|
|
1615
|
+
r = e[c];
|
|
1604
1616
|
else if (n)
|
|
1605
1617
|
r = s !== void 0 ? { [s]: i } : i;
|
|
1606
1618
|
else
|
|
@@ -1608,31 +1620,31 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1608
1620
|
this.triggerOnChange(r, t), a && this.base.togglePopup(t), this.props.filter === void 0 && this.state.text !== void 0 && (t.data.text = void 0), this.applyState(t);
|
|
1609
1621
|
}
|
|
1610
1622
|
applyValueOnRejectSuggestions(i, t) {
|
|
1611
|
-
const { data: e = [], textField: s, allowCustom: n } = this.props, a = this.props.opened !== void 0 ? this.props.opened : this.state.opened,
|
|
1612
|
-
if (this._suggested = "", i ===
|
|
1613
|
-
return a && !
|
|
1623
|
+
const { data: e = [], textField: s, allowCustom: n } = this.props, a = this.props.opened !== void 0 ? this.props.opened : this.state.opened, p = V(this.value, s), c = this.state.windowWidth && this.state.windowWidth <= Se;
|
|
1624
|
+
if (this._suggested = "", i === p || i === "" && !G(p))
|
|
1625
|
+
return a && !c && this.base.togglePopup(t), this.applyState(t);
|
|
1614
1626
|
const d = Kt(e, i, s, !0), r = d !== -1;
|
|
1615
1627
|
let h = null;
|
|
1616
|
-
r ? h = e[d] : n && (h = i ? s ? { [s]: i } : i : null), this.triggerOnChange(h, t), this.state.text !== void 0 && (t.data.text = void 0, this.base.filterChanged("", t)), a && !
|
|
1628
|
+
r ? h = e[d] : n && (h = i ? s ? { [s]: i } : i : null), this.triggerOnChange(h, t), this.state.text !== void 0 && (t.data.text = void 0, this.base.filterChanged("", t)), a && !c && this.base.togglePopup(t), this.applyState(t);
|
|
1617
1629
|
}
|
|
1618
1630
|
selectFocusedItem(i, t) {
|
|
1619
|
-
const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { data: s = [], textField: n, virtual: a = { skip: 0 }, focusedItemIndex:
|
|
1620
|
-
return d !== -1 ? this.handleItemSelect(d +
|
|
1631
|
+
const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { data: s = [], textField: n, virtual: a = { skip: 0 }, focusedItemIndex: p = Ve } = this.props, c = a.skip, d = i === "" && c === 0 ? 0 : p(s, i, n);
|
|
1632
|
+
return d !== -1 ? this.handleItemSelect(d + c, t) : (this.triggerOnChange(null, t), this.state.text !== void 0 && (t.data.text = void 0)), e && this.base.togglePopup(t), this.applyState(t);
|
|
1621
1633
|
}
|
|
1622
1634
|
renderAdaptiveListContainer() {
|
|
1623
|
-
const { windowWidth: i = 0 } = this.state, { header: t, footer: e, size: s, data: n = [], groupField: a, groupMode:
|
|
1624
|
-
let { group:
|
|
1625
|
-
|
|
1626
|
-
const
|
|
1635
|
+
const { windowWidth: i = 0 } = this.state, { header: t, footer: e, size: s, data: n = [], groupField: a, groupMode: p, list: c, virtual: d, adaptiveTitle: r, groupStickyHeaderItemRender: h } = this.props, u = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
|
|
1636
|
+
let { group: g } = this.state;
|
|
1637
|
+
g === void 0 && a !== void 0 && (g = V(n[0], a));
|
|
1638
|
+
const m = {
|
|
1627
1639
|
navigatable: !1,
|
|
1628
1640
|
navigatableElements: [],
|
|
1629
|
-
expand:
|
|
1641
|
+
expand: u,
|
|
1630
1642
|
animation: !0,
|
|
1631
1643
|
onClose: (v) => this.toggleBtnClick(v),
|
|
1632
1644
|
animationStyles: i <= St ? { top: 0, width: "100%", height: "100%" } : void 0,
|
|
1633
1645
|
className: i <= St ? "k-adaptive-actionsheet k-actionsheet-fullscreen" : "k-adaptive-actionsheet k-actionsheet-bottom"
|
|
1634
1646
|
};
|
|
1635
|
-
return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(Yt, { ...
|
|
1647
|
+
return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(Yt, { ...m }, /* @__PURE__ */ o.createElement(Jt, { className: "k-text-center" }, /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-titlebar-group k-hbox" }, /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-title" }, /* @__PURE__ */ o.createElement("div", null, r)), /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-actions" }, /* @__PURE__ */ o.createElement(
|
|
1636
1648
|
Te,
|
|
1637
1649
|
{
|
|
1638
1650
|
tabIndex: 0,
|
|
@@ -1646,32 +1658,32 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1646
1658
|
}
|
|
1647
1659
|
))), /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-titlebar-group k-actionsheet-filter" }, this.renderMobileListFilter())), /* @__PURE__ */ o.createElement(lt, { className: "!k-overflow-hidden" }, /* @__PURE__ */ o.createElement("div", { className: "k-list-container" }, /* @__PURE__ */ o.createElement("div", { className: B(
|
|
1648
1660
|
{
|
|
1649
|
-
["k-list"]: !
|
|
1661
|
+
["k-list"]: !c,
|
|
1650
1662
|
["k-list-lg"]: !0,
|
|
1651
1663
|
["k-virtual-list"]: d,
|
|
1652
|
-
["k-data-table"]:
|
|
1653
|
-
[`k-table-${bt[s] || s}`]:
|
|
1664
|
+
["k-data-table"]: c,
|
|
1665
|
+
[`k-table-${bt[s] || s}`]: c && s
|
|
1654
1666
|
}
|
|
1655
|
-
) }, t && /* @__PURE__ */ o.createElement("div", { className: "k-table-header" }, t), !
|
|
1667
|
+
) }, t && /* @__PURE__ */ o.createElement("div", { className: "k-table-header" }, t), !c && g && n.length !== 0 && /* @__PURE__ */ o.createElement(We, { group: g, groupMode: p, render: h }), this.renderList(), e && /* @__PURE__ */ o.createElement("div", { className: "k-list-footer" }, e))))));
|
|
1656
1668
|
}
|
|
1657
1669
|
renderListContainer() {
|
|
1658
|
-
const i = this.base, { dir: t, header: e, footer: s, data: n = [], groupField: a, groupMode:
|
|
1670
|
+
const i = this.base, { dir: t, header: e, footer: s, data: n = [], groupField: a, groupMode: p, size: c, list: d, virtual: r, groupStickyHeaderItemRender: h } = this.props, u = this.props.opened !== void 0 ? this.props.opened : this.state.opened, g = i.getPopupSettings(), m = g.width !== void 0 ? g.width : i.popupWidth;
|
|
1659
1671
|
let { group: v } = this.state;
|
|
1660
1672
|
return v === void 0 && a !== void 0 && (v = V(n[0], a)), /* @__PURE__ */ o.createElement(
|
|
1661
1673
|
Et,
|
|
1662
1674
|
{
|
|
1663
|
-
width:
|
|
1675
|
+
width: m,
|
|
1664
1676
|
popupSettings: {
|
|
1665
|
-
animate:
|
|
1677
|
+
animate: g.animate,
|
|
1666
1678
|
anchor: this.element,
|
|
1667
|
-
show:
|
|
1679
|
+
show: u,
|
|
1668
1680
|
popupClass: B(
|
|
1669
|
-
|
|
1681
|
+
g.popupClass,
|
|
1670
1682
|
"k-list-container",
|
|
1671
1683
|
"k-combobox-popup"
|
|
1672
1684
|
),
|
|
1673
|
-
className:
|
|
1674
|
-
appendTo:
|
|
1685
|
+
className: g.className,
|
|
1686
|
+
appendTo: g.appendTo
|
|
1675
1687
|
},
|
|
1676
1688
|
dir: t !== void 0 ? t : this.base.dirCalculated,
|
|
1677
1689
|
itemsCount: [n.length]
|
|
@@ -1679,12 +1691,12 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1679
1691
|
/* @__PURE__ */ o.createElement("div", { className: B(
|
|
1680
1692
|
{
|
|
1681
1693
|
["k-list"]: !d,
|
|
1682
|
-
[`k-list-${bt[
|
|
1694
|
+
[`k-list-${bt[c] || c}`]: !d && c,
|
|
1683
1695
|
["k-virtual-list"]: r,
|
|
1684
1696
|
["k-data-table"]: d,
|
|
1685
|
-
[`k-table-${bt[
|
|
1697
|
+
[`k-table-${bt[c] || c}`]: d && c
|
|
1686
1698
|
}
|
|
1687
|
-
) }, e && /* @__PURE__ */ o.createElement("div", { className: "k-table-header" }, e), !d && v && n.length !== 0 && /* @__PURE__ */ o.createElement(We, { group: v, groupMode:
|
|
1699
|
+
) }, e && /* @__PURE__ */ o.createElement("div", { className: "k-table-header" }, e), !d && v && n.length !== 0 && /* @__PURE__ */ o.createElement(We, { group: v, groupMode: p, render: h }), this.renderList(), s && /* @__PURE__ */ o.createElement("div", { className: B(
|
|
1688
1700
|
{
|
|
1689
1701
|
["k-list-footer"]: !this.props.footerClassName
|
|
1690
1702
|
},
|
|
@@ -1699,17 +1711,17 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1699
1711
|
listNoDataRender: s,
|
|
1700
1712
|
itemRender: n,
|
|
1701
1713
|
groupHeaderItemRender: a,
|
|
1702
|
-
data:
|
|
1703
|
-
virtual:
|
|
1704
|
-
} = this.props, d = i.getPopupSettings(), r = i.vs, h =
|
|
1714
|
+
data: p = [],
|
|
1715
|
+
virtual: c = { skip: 0, total: void 0 }
|
|
1716
|
+
} = this.props, d = i.getPopupSettings(), r = i.vs, h = c.skip, u = this.props.opened !== void 0 ? this.props.opened : this.state.opened, g = `translateY(${r.translate}px)`, m = u ? this.getFocusedIndex() : void 0, v = this.props.filter !== void 0 ? this.props.filter : this.state.text, b = V(this.value, t), w = G(v) && v !== b ? null : this.value, S = this.props.list || Ue;
|
|
1705
1717
|
return /* @__PURE__ */ o.createElement(
|
|
1706
1718
|
S,
|
|
1707
1719
|
{
|
|
1708
1720
|
id: i.listBoxId,
|
|
1709
|
-
virtual: !!
|
|
1710
|
-
show:
|
|
1711
|
-
data:
|
|
1712
|
-
focusedIndex:
|
|
1721
|
+
virtual: !!c,
|
|
1722
|
+
show: u,
|
|
1723
|
+
data: p,
|
|
1724
|
+
focusedIndex: m,
|
|
1713
1725
|
value: w,
|
|
1714
1726
|
textField: t,
|
|
1715
1727
|
valueField: e,
|
|
@@ -1724,10 +1736,10 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1724
1736
|
wrapperCssClass: B(
|
|
1725
1737
|
"k-list-content",
|
|
1726
1738
|
{
|
|
1727
|
-
["k-list-scroller"]: !
|
|
1739
|
+
["k-list-scroller"]: !c
|
|
1728
1740
|
}
|
|
1729
1741
|
),
|
|
1730
|
-
listStyle: r.enabled ? { transform:
|
|
1742
|
+
listStyle: r.enabled ? { transform: g } : void 0,
|
|
1731
1743
|
key: "listkey",
|
|
1732
1744
|
skip: h,
|
|
1733
1745
|
onClick: this.handleItemClick,
|
|
@@ -1737,7 +1749,8 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1737
1749
|
onMouseDown: (D) => D.preventDefault(),
|
|
1738
1750
|
onScroll: this.onScroll,
|
|
1739
1751
|
wrapperRef: r.scrollerRef,
|
|
1740
|
-
scroller: this.base.renderScrollElement()
|
|
1752
|
+
scroller: this.base.renderScrollElement(),
|
|
1753
|
+
ariaSetSize: c.total
|
|
1741
1754
|
}
|
|
1742
1755
|
);
|
|
1743
1756
|
}
|
|
@@ -1746,10 +1759,10 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1746
1759
|
tabIndex: s,
|
|
1747
1760
|
disabled: n,
|
|
1748
1761
|
data: a = [],
|
|
1749
|
-
dataItemKey:
|
|
1750
|
-
virtual:
|
|
1751
|
-
} = this.props, d = this.props.opened !== void 0 ? this.props.opened : this.state.opened, r = this.value, h = Math.max(0, a.findIndex((
|
|
1752
|
-
return this._suggested && !R(this._valueOnDidUpdate, r,
|
|
1762
|
+
dataItemKey: p,
|
|
1763
|
+
virtual: c = { skip: 0 }
|
|
1764
|
+
} = this.props, d = this.props.opened !== void 0 ? this.props.opened : this.state.opened, r = this.value, h = Math.max(0, a.findIndex((u) => R(u, r, p)));
|
|
1765
|
+
return this._suggested && !R(this._valueOnDidUpdate, r, p) && (this._suggested = ""), /* @__PURE__ */ o.createElement(
|
|
1753
1766
|
Zt,
|
|
1754
1767
|
{
|
|
1755
1768
|
id: t,
|
|
@@ -1760,7 +1773,7 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1760
1773
|
accessKey: this.props.accessKey,
|
|
1761
1774
|
value: i + this._suggested,
|
|
1762
1775
|
suggestedText: this._suggested,
|
|
1763
|
-
ref: (
|
|
1776
|
+
ref: (u) => this._input = u && u.input,
|
|
1764
1777
|
onClick: this.onInputClick,
|
|
1765
1778
|
onKeyDown: this.onInputKeyDown,
|
|
1766
1779
|
onChange: this.inputOnChange,
|
|
@@ -1769,7 +1782,7 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1769
1782
|
disabled: n,
|
|
1770
1783
|
expanded: d,
|
|
1771
1784
|
owns: this.base.listBoxId,
|
|
1772
|
-
activedescendant: `option-${this.base.guid}-${h +
|
|
1785
|
+
activedescendant: `option-${this.base.guid}-${h + c.skip}`,
|
|
1773
1786
|
role: "combobox",
|
|
1774
1787
|
ariaLabelledBy: this.props.ariaLabelledBy,
|
|
1775
1788
|
ariaDescribedBy: this.props.ariaDescribedBy,
|
|
@@ -1789,12 +1802,12 @@ const Zs = "Please enter a valid value!", { sizeMap: bt, roundedMap: ei } = $e,
|
|
|
1789
1802
|
!G(e) && !G(i) || R(e, i, this.props.dataItemKey) || (this.props.value === void 0 && (t.data.value = i), this._valueDuringOnChange = i, t.events.push({ type: "onChange" }));
|
|
1790
1803
|
}
|
|
1791
1804
|
getFocusedIndex() {
|
|
1792
|
-
const i = this.value, { data: t = [], textField: e, dataItemKey: s, virtual: n = { skip: 0 }, focusedItemIndex: a = Ve, skipDisabledItems:
|
|
1793
|
-
return G(i) &&
|
|
1805
|
+
const i = this.value, { data: t = [], textField: e, dataItemKey: s, virtual: n = { skip: 0 }, focusedItemIndex: a = Ve, skipDisabledItems: p } = this.props, c = this.props.filter ? this.props.filter : this.state.text;
|
|
1806
|
+
return G(i) && c === void 0 ? t.findIndex((d) => R(d, i, s)) : c ? a(t, c, e) : p && e && !c && n.skip === 0 ? t.findIndex((d) => !d.disabled && d[e]) : n.skip === 0 ? 0 : -1;
|
|
1794
1807
|
}
|
|
1795
1808
|
suggestValue(i) {
|
|
1796
1809
|
const { data: t, textField: e } = this.props;
|
|
1797
|
-
this._suggested =
|
|
1810
|
+
this._suggested = zs(i, t, e);
|
|
1798
1811
|
}
|
|
1799
1812
|
applyState(i) {
|
|
1800
1813
|
this.base.applyState(i), this._valueDuringOnChange = void 0;
|
|
@@ -1867,10 +1880,10 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
1867
1880
|
let { data: n = [] } = this.props;
|
|
1868
1881
|
if (!s || !n.length)
|
|
1869
1882
|
return;
|
|
1870
|
-
const a = this.itemHeight || (e ? e.children[0].offsetHeight : 0),
|
|
1883
|
+
const a = this.itemHeight || (e ? e.children[0].offsetHeight : 0), c = t.target.scrollTop;
|
|
1871
1884
|
s && (n = this.base.getGroupedDataModernMode(n, s));
|
|
1872
1885
|
let d = n[0][s];
|
|
1873
|
-
for (let r = 1; r < n.length && !(a * r >
|
|
1886
|
+
for (let r = 1; r < n.length && !(a * r > c); r++)
|
|
1874
1887
|
n[r] && n[r][s] && (d = n[r][s]);
|
|
1875
1888
|
d !== this.state.group && this.setState({
|
|
1876
1889
|
group: d
|
|
@@ -1878,16 +1891,16 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
1878
1891
|
}, this.handleItemClick = (t, e) => {
|
|
1879
1892
|
this.base.handleItemClick(t, e), this._valueDuringOnChange = void 0;
|
|
1880
1893
|
}, this.onChangeHandler = (t) => {
|
|
1881
|
-
const s = this.base.initState(), n = t.currentTarget, a = n.value,
|
|
1894
|
+
const s = this.base.initState(), n = t.currentTarget, a = n.value, p = n.selectionEnd === a.length;
|
|
1882
1895
|
s.syntheticEvent = t;
|
|
1883
|
-
const
|
|
1884
|
-
if (
|
|
1885
|
-
h ||
|
|
1896
|
+
const c = this._suggested, d = this.value, r = d && d.substring(0, d.length - c.length), h = r && r === a, u = r && r.length > a.length, { suggest: g } = this.props, m = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
|
|
1897
|
+
if (g !== void 0 && g !== !1) {
|
|
1898
|
+
h || u || !p ? this._suggested = "" : this.suggestValue(a);
|
|
1886
1899
|
const v = a + this._suggested, b = { userInput: a, value: this._suggested };
|
|
1887
1900
|
this.triggerOnChange(v, s, { suggestion: b });
|
|
1888
1901
|
} else
|
|
1889
1902
|
this._suggested = "", this.triggerOnChange(a, s);
|
|
1890
|
-
(!
|
|
1903
|
+
(!m && a || m && !a) && this.togglePopup(s), s.data.focusedItem = void 0, this.applyState(s), this.setState({ group: void 0 });
|
|
1891
1904
|
}, this.clearButtonClick = (t) => {
|
|
1892
1905
|
const s = this.base.initState(), n = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
|
|
1893
1906
|
s.syntheticEvent = t;
|
|
@@ -1896,73 +1909,73 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
1896
1909
|
}, this.onInputKeyDown = (t) => {
|
|
1897
1910
|
const { data: e = [], skipDisabledItems: s, groupField: n, textField: a } = this.props;
|
|
1898
1911
|
this._isScrolling && (this._isScrolling = !1);
|
|
1899
|
-
const
|
|
1900
|
-
|
|
1901
|
-
const
|
|
1912
|
+
const p = this.focusedIndex(), c = e[p], d = t.keyCode, r = t.altKey, h = this.props.opened !== void 0 ? this.props.opened : this.state.opened, u = this.base.initState();
|
|
1913
|
+
u.syntheticEvent = t;
|
|
1914
|
+
const g = () => {
|
|
1902
1915
|
h && t.preventDefault();
|
|
1903
1916
|
};
|
|
1904
|
-
if (r && d ===
|
|
1917
|
+
if (r && d === f.down)
|
|
1905
1918
|
this.setState({
|
|
1906
1919
|
opened: !0
|
|
1907
1920
|
});
|
|
1908
|
-
else if (r && d ===
|
|
1921
|
+
else if (r && d === f.up)
|
|
1909
1922
|
this.setState({
|
|
1910
1923
|
opened: !1
|
|
1911
1924
|
});
|
|
1912
|
-
else if (h && d ===
|
|
1925
|
+
else if (h && d === f.pageUp)
|
|
1913
1926
|
this.base.scrollPopupByPageSize(-1);
|
|
1914
|
-
else if (h && d ===
|
|
1927
|
+
else if (h && d === f.pageDown)
|
|
1915
1928
|
this.base.scrollPopupByPageSize(1);
|
|
1916
|
-
else if (h && (d ===
|
|
1917
|
-
|
|
1918
|
-
else if (!h && d ===
|
|
1919
|
-
const
|
|
1920
|
-
this._suggested = "", this.triggerOnChange(
|
|
1921
|
-
} else if (d ===
|
|
1929
|
+
else if (h && (d === f.enter || d === f.esc))
|
|
1930
|
+
g(), s === !1 && c && c.disabled ? (h && this.togglePopup(u), this.applyState(u)) : this.applyInputValue(t.currentTarget.value, u, t.keyCode);
|
|
1931
|
+
else if (!h && d === f.esc) {
|
|
1932
|
+
const m = "";
|
|
1933
|
+
this._suggested = "", this.triggerOnChange(m, u), this.state.focusedItem !== void 0 && (u.data.focusedItem = void 0), this.applyState(u);
|
|
1934
|
+
} else if (d === f.up || d === f.down) {
|
|
1922
1935
|
if (n !== "" && a)
|
|
1923
1936
|
if (!this.props.skipDisabledItems && h)
|
|
1924
|
-
this.onNavigate(
|
|
1937
|
+
this.onNavigate(u, d);
|
|
1925
1938
|
else {
|
|
1926
|
-
let
|
|
1927
|
-
if (d ===
|
|
1928
|
-
const v = e.slice(
|
|
1929
|
-
|
|
1930
|
-
} else if (d ===
|
|
1939
|
+
let m = 0;
|
|
1940
|
+
if (d === f.down || d === f.right) {
|
|
1941
|
+
const v = e.slice(p + 1).find((b) => !b.disabled && b[a]);
|
|
1942
|
+
m = v && e.findIndex((b) => b[a] === v[a]);
|
|
1943
|
+
} else if (d === f.up || d === f.left) {
|
|
1931
1944
|
let v;
|
|
1932
|
-
if (
|
|
1933
|
-
v = e,
|
|
1945
|
+
if (p === -1)
|
|
1946
|
+
v = e, m = e.findIndex((b) => !b.disabled && b[a]);
|
|
1934
1947
|
else {
|
|
1935
|
-
v = e.slice(0,
|
|
1948
|
+
v = e.slice(0, p);
|
|
1936
1949
|
let b = v.pop();
|
|
1937
1950
|
for (; b && b.disabled; )
|
|
1938
1951
|
b = v.pop();
|
|
1939
|
-
|
|
1952
|
+
m = b && e.findIndex((w) => w[a] === b[a]);
|
|
1940
1953
|
}
|
|
1941
1954
|
}
|
|
1942
|
-
if (
|
|
1943
|
-
const v =
|
|
1944
|
-
this.onNavigate(
|
|
1955
|
+
if (m !== void 0) {
|
|
1956
|
+
const v = m - p;
|
|
1957
|
+
this.onNavigate(u, d, v);
|
|
1945
1958
|
} else
|
|
1946
|
-
|
|
1959
|
+
m === void 0 && e.findIndex((v) => v[a]) === e.length - 1 && this.onNavigate(u, d);
|
|
1947
1960
|
}
|
|
1948
1961
|
else if (!this.props.skipDisabledItems && h)
|
|
1949
|
-
this.onNavigate(
|
|
1962
|
+
this.onNavigate(u, d);
|
|
1950
1963
|
else {
|
|
1951
|
-
let
|
|
1952
|
-
if (d ===
|
|
1953
|
-
|
|
1954
|
-
else if (d ===
|
|
1955
|
-
const v = e.slice(0,
|
|
1956
|
-
for (
|
|
1957
|
-
|
|
1964
|
+
let m = null;
|
|
1965
|
+
if (d === f.down || d === f.right)
|
|
1966
|
+
m = e.slice(p + 1).find((v) => !v.disabled);
|
|
1967
|
+
else if (d === f.up || d === f.left) {
|
|
1968
|
+
const v = e.slice(0, p);
|
|
1969
|
+
for (m = v.pop(); m && m.disabled; )
|
|
1970
|
+
m = v.pop();
|
|
1958
1971
|
}
|
|
1959
|
-
if (
|
|
1960
|
-
const v =
|
|
1961
|
-
this.onNavigate(
|
|
1972
|
+
if (m) {
|
|
1973
|
+
const v = m.id - p - 1;
|
|
1974
|
+
this.onNavigate(u, d, v);
|
|
1962
1975
|
} else
|
|
1963
|
-
this.onNavigate(
|
|
1976
|
+
this.onNavigate(u, d);
|
|
1964
1977
|
}
|
|
1965
|
-
this.applyState(
|
|
1978
|
+
this.applyState(u), g();
|
|
1966
1979
|
}
|
|
1967
1980
|
}, this.handleBlur = (t) => {
|
|
1968
1981
|
if (this.state.focused) {
|
|
@@ -2016,13 +2029,13 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
2016
2029
|
* @hidden
|
|
2017
2030
|
*/
|
|
2018
2031
|
componentDidUpdate(i, t) {
|
|
2019
|
-
var
|
|
2020
|
-
const { groupField: e = "", data: s = [] } = this.props, { data: n = [] } = i, a = this.focusedIndex(),
|
|
2032
|
+
var g;
|
|
2033
|
+
const { groupField: e = "", data: s = [] } = this.props, { data: n = [] } = i, a = this.focusedIndex(), p = s[a], c = n !== s, d = p !== void 0 && t.focusedItem !== p, r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, h = i.opened !== void 0 ? i.opened : t.opened, u = !h && r;
|
|
2021
2034
|
if (e === "")
|
|
2022
|
-
(r && (d ||
|
|
2035
|
+
(r && (d || c) || u) && this.base.scrollToItem(a);
|
|
2023
2036
|
else if (!this._isScrolling) {
|
|
2024
|
-
let
|
|
2025
|
-
|
|
2037
|
+
let m = (g = this.base.getGroupedDataModernMode(s, e)) == null ? void 0 : g.indexOf(p);
|
|
2038
|
+
u && (s && s.length !== 0 && this.base.resetGroupStickyHeader(s[0][e], this), this.base.scrollToItem(m)), r && h && d && this.base.scrollToItem(m);
|
|
2026
2039
|
}
|
|
2027
2040
|
this.setValidity();
|
|
2028
2041
|
}
|
|
@@ -2036,8 +2049,8 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
2036
2049
|
* @hidden
|
|
2037
2050
|
*/
|
|
2038
2051
|
render() {
|
|
2039
|
-
const { dir: i, disabled: t, label: e, className: s, style: n, loading: a, suggest:
|
|
2040
|
-
typeof
|
|
2052
|
+
const { dir: i, disabled: t, label: e, className: s, style: n, loading: a, suggest: p, size: c, rounded: d, fillMode: r } = this.props, h = !this.validityStyles || this.validity.valid, u = this.base, g = this.value, m = this.props.clearButton !== !1 && !a && !!g, v = this.props.id || this._inputId;
|
|
2053
|
+
typeof p == "string" && (this._suggested = p);
|
|
2041
2054
|
const b = /* @__PURE__ */ o.createElement(
|
|
2042
2055
|
"span",
|
|
2043
2056
|
{
|
|
@@ -2045,7 +2058,7 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
2045
2058
|
"k-autocomplete k-input",
|
|
2046
2059
|
s,
|
|
2047
2060
|
{
|
|
2048
|
-
[`k-input-${ls[
|
|
2061
|
+
[`k-input-${ls[c] || c}`]: c,
|
|
2049
2062
|
[`k-rounded-${ii[d] || d}`]: d,
|
|
2050
2063
|
[`k-input-${r}`]: r,
|
|
2051
2064
|
"k-invalid": !h,
|
|
@@ -2055,14 +2068,14 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
2055
2068
|
}
|
|
2056
2069
|
),
|
|
2057
2070
|
ref: (w) => {
|
|
2058
|
-
this._element = w,
|
|
2071
|
+
this._element = w, u.wrapper = w;
|
|
2059
2072
|
},
|
|
2060
2073
|
style: e ? { ...n, width: void 0 } : n,
|
|
2061
2074
|
dir: i
|
|
2062
2075
|
},
|
|
2063
|
-
this.renderSearchBar(
|
|
2076
|
+
this.renderSearchBar(g || "", v),
|
|
2064
2077
|
a && /* @__PURE__ */ o.createElement(ke, { className: "k-input-loading-icon", name: "loading" }),
|
|
2065
|
-
|
|
2078
|
+
m && !a && /* @__PURE__ */ o.createElement(rt, { onClick: this.clearButtonClick, key: "clearbutton" }),
|
|
2066
2079
|
this.renderListContainer()
|
|
2067
2080
|
);
|
|
2068
2081
|
return e ? /* @__PURE__ */ o.createElement(
|
|
@@ -2070,7 +2083,7 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
2070
2083
|
{
|
|
2071
2084
|
label: e,
|
|
2072
2085
|
editorId: v,
|
|
2073
|
-
editorValue:
|
|
2086
|
+
editorValue: g,
|
|
2074
2087
|
editorValid: h,
|
|
2075
2088
|
editorDisabled: t,
|
|
2076
2089
|
style: { width: n ? n.width : void 0 },
|
|
@@ -2082,9 +2095,9 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
2082
2095
|
* @hidden
|
|
2083
2096
|
*/
|
|
2084
2097
|
onNavigate(i, t, e) {
|
|
2085
|
-
const s = this.value, { data: n = [], textField: a, focusedItemIndex:
|
|
2098
|
+
const s = this.value, { data: n = [], textField: a, focusedItemIndex: p } = this.props, c = this.state.focusedItem !== void 0 ? n.findIndex((r) => R(r, this.state.focusedItem, a)) : p ? p(n, s, a) : n.indexOf(as(n, s, a)), d = this.base.navigation.navigate({
|
|
2086
2099
|
keyCode: t,
|
|
2087
|
-
current:
|
|
2100
|
+
current: c,
|
|
2088
2101
|
max: n.length - 1,
|
|
2089
2102
|
min: 0,
|
|
2090
2103
|
skipItems: e || void 0
|
|
@@ -2095,15 +2108,15 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
2095
2108
|
* @hidden
|
|
2096
2109
|
*/
|
|
2097
2110
|
applyInputValue(i, t, e) {
|
|
2098
|
-
const s = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { data: n = [], textField: a } = this.props,
|
|
2099
|
-
if (this._suggested = "", s && e ===
|
|
2111
|
+
const s = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { data: n = [], textField: a } = this.props, p = this.focusedIndex(), c = n[p];
|
|
2112
|
+
if (this._suggested = "", s && e === f.enter && c && !c.disabled) {
|
|
2100
2113
|
const d = V(n[this.focusedIndex(i)], a);
|
|
2101
2114
|
this.triggerOnChange(d, t);
|
|
2102
2115
|
}
|
|
2103
2116
|
s && this.togglePopup(t), this.applyState(t);
|
|
2104
2117
|
}
|
|
2105
2118
|
renderSearchBar(i, t) {
|
|
2106
|
-
const e = this.base, { placeholder: s, tabIndex: n, disabled: a, readonly:
|
|
2119
|
+
const e = this.base, { placeholder: s, tabIndex: n, disabled: a, readonly: p } = this.props, { focused: c } = this.state, d = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
|
|
2107
2120
|
return /* @__PURE__ */ o.createElement(
|
|
2108
2121
|
Zt,
|
|
2109
2122
|
{
|
|
@@ -2113,7 +2126,7 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
2113
2126
|
accessKey: this.props.accessKey,
|
|
2114
2127
|
value: i,
|
|
2115
2128
|
suggestedText: this._suggested,
|
|
2116
|
-
focused:
|
|
2129
|
+
focused: c,
|
|
2117
2130
|
name: this.props.name,
|
|
2118
2131
|
ref: (r) => this._input = r && r.input,
|
|
2119
2132
|
onKeyDown: this.onInputKeyDown,
|
|
@@ -2121,7 +2134,7 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
2121
2134
|
onFocus: e.handleFocus,
|
|
2122
2135
|
onBlur: this.handleBlur,
|
|
2123
2136
|
disabled: a,
|
|
2124
|
-
readOnly:
|
|
2137
|
+
readOnly: p,
|
|
2125
2138
|
expanded: d,
|
|
2126
2139
|
owns: e.listBoxId,
|
|
2127
2140
|
activedescendant: "option-" + e.guid + "-" + this.focusedIndex(),
|
|
@@ -2140,15 +2153,15 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
2140
2153
|
footer: s,
|
|
2141
2154
|
data: n = [],
|
|
2142
2155
|
size: a,
|
|
2143
|
-
groupField:
|
|
2144
|
-
list:
|
|
2156
|
+
groupField: p,
|
|
2157
|
+
list: c,
|
|
2145
2158
|
groupStickyHeaderItemRender: d
|
|
2146
|
-
} = this.props, r = i.getPopupSettings(), h = this.props.opened !== void 0 ? this.props.opened : this.state.opened,
|
|
2147
|
-
let { group:
|
|
2148
|
-
return
|
|
2159
|
+
} = this.props, r = i.getPopupSettings(), h = this.props.opened !== void 0 ? this.props.opened : this.state.opened, u = r.width !== void 0 ? r.width : i.popupWidth;
|
|
2160
|
+
let { group: g } = this.state;
|
|
2161
|
+
return g === void 0 && p !== void 0 && (g = V(n[0], p)), /* @__PURE__ */ o.createElement(
|
|
2149
2162
|
Et,
|
|
2150
2163
|
{
|
|
2151
|
-
width:
|
|
2164
|
+
width: u,
|
|
2152
2165
|
popupSettings: {
|
|
2153
2166
|
animate: r.animate,
|
|
2154
2167
|
anchor: this.element,
|
|
@@ -2175,7 +2188,7 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
2175
2188
|
}
|
|
2176
2189
|
)
|
|
2177
2190
|
},
|
|
2178
|
-
!
|
|
2191
|
+
!c && g && n.length !== 0 && /* @__PURE__ */ o.createElement(We, { group: g, groupMode: "modern", render: d }),
|
|
2179
2192
|
this.renderList()
|
|
2180
2193
|
),
|
|
2181
2194
|
s && /* @__PURE__ */ o.createElement("div", { className: "k-list-footer" }, s)
|
|
@@ -2187,8 +2200,8 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
2187
2200
|
data: s = [],
|
|
2188
2201
|
listNoDataRender: n,
|
|
2189
2202
|
itemRender: a,
|
|
2190
|
-
groupHeaderItemRender:
|
|
2191
|
-
} = this.props,
|
|
2203
|
+
groupHeaderItemRender: p
|
|
2204
|
+
} = this.props, c = this.value, d = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
|
|
2192
2205
|
return /* @__PURE__ */ o.createElement(
|
|
2193
2206
|
Ue,
|
|
2194
2207
|
{
|
|
@@ -2196,7 +2209,7 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
2196
2209
|
show: d,
|
|
2197
2210
|
data: s.slice(),
|
|
2198
2211
|
focusedIndex: this.focusedIndex(),
|
|
2199
|
-
value:
|
|
2212
|
+
value: c,
|
|
2200
2213
|
textField: e,
|
|
2201
2214
|
valueField: e,
|
|
2202
2215
|
highlightSelected: !1,
|
|
@@ -2208,7 +2221,7 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
2208
2221
|
wrapperCssClass: "k-list-content",
|
|
2209
2222
|
onClick: this.handleItemClick,
|
|
2210
2223
|
itemRender: a,
|
|
2211
|
-
groupHeaderItemRender:
|
|
2224
|
+
groupHeaderItemRender: p,
|
|
2212
2225
|
noDataRender: n,
|
|
2213
2226
|
onMouseDown: (r) => r.preventDefault(),
|
|
2214
2227
|
onScroll: this.onScroll
|
|
@@ -2233,12 +2246,12 @@ const si = "Please enter a valid value!", { sizeMap: ls, roundedMap: ii } = $e,
|
|
|
2233
2246
|
focusedIndex(i) {
|
|
2234
2247
|
const { data: t = [], textField: e, focusedItemIndex: s, skipDisabledItems: n } = this.props, a = i !== void 0 ? i : this.value;
|
|
2235
2248
|
if (this.state.focusedItem !== void 0)
|
|
2236
|
-
return t.findIndex((
|
|
2249
|
+
return t.findIndex((p) => R(p, this.state.focusedItem, e));
|
|
2237
2250
|
if (s)
|
|
2238
2251
|
return s(t, a, e);
|
|
2239
2252
|
{
|
|
2240
|
-
const
|
|
2241
|
-
return n && e &&
|
|
2253
|
+
const p = t.indexOf(as(t, a, e));
|
|
2254
|
+
return n && e && p === -1 ? t.findIndex((c) => !c.disabled && c[e]) : Math.max(0, p);
|
|
2242
2255
|
}
|
|
2243
2256
|
}
|
|
2244
2257
|
};
|
|
@@ -2277,7 +2290,7 @@ oi.displayName = "KendoReactAutoComplete";
|
|
|
2277
2290
|
const ai = (i) => i.syntheticEvent.preventDefault(), li = (i) => i.syntheticEvent.stopPropagation();
|
|
2278
2291
|
class ys extends o.Component {
|
|
2279
2292
|
render() {
|
|
2280
|
-
const { data: t, guid: e, focused: s, tagRender: n, tag: a, onTagDelete:
|
|
2293
|
+
const { data: t, guid: e, focused: s, tagRender: n, tag: a, onTagDelete: p, size: c } = this.props;
|
|
2281
2294
|
return /* @__PURE__ */ o.createElement(o.Fragment, null, t.map((d, r) => {
|
|
2282
2295
|
const h = a ? /* @__PURE__ */ o.createElement(
|
|
2283
2296
|
a,
|
|
@@ -2286,7 +2299,7 @@ class ys extends o.Component {
|
|
|
2286
2299
|
tagData: d,
|
|
2287
2300
|
guid: e,
|
|
2288
2301
|
focusedTag: s,
|
|
2289
|
-
onTagDelete:
|
|
2302
|
+
onTagDelete: p
|
|
2290
2303
|
}
|
|
2291
2304
|
) : /* @__PURE__ */ o.createElement(
|
|
2292
2305
|
_s,
|
|
@@ -2298,11 +2311,11 @@ class ys extends o.Component {
|
|
|
2298
2311
|
key: d.text + r,
|
|
2299
2312
|
text: d.text,
|
|
2300
2313
|
removable: !0,
|
|
2301
|
-
onRemove: (
|
|
2314
|
+
onRemove: (u) => p.call(void 0, d.data, u.syntheticEvent),
|
|
2302
2315
|
onMouseDown: ai,
|
|
2303
2316
|
onClick: li,
|
|
2304
2317
|
className: d === s ? "k-focus" : void 0,
|
|
2305
|
-
size:
|
|
2318
|
+
size: c
|
|
2306
2319
|
}
|
|
2307
2320
|
);
|
|
2308
2321
|
return n ? n(d, h) : h;
|
|
@@ -2317,21 +2330,21 @@ const rs = 500, es = (i) => {
|
|
|
2317
2330
|
windowWidth: s = 0,
|
|
2318
2331
|
navigatable: n,
|
|
2319
2332
|
navigatableElements: a,
|
|
2320
|
-
expand:
|
|
2321
|
-
animation:
|
|
2333
|
+
expand: p,
|
|
2334
|
+
animation: c,
|
|
2322
2335
|
onClose: d,
|
|
2323
2336
|
adaptiveTitle: r,
|
|
2324
2337
|
mobileFilter: h
|
|
2325
|
-
} = i,
|
|
2338
|
+
} = i, u = {
|
|
2326
2339
|
navigatable: n || !1,
|
|
2327
2340
|
navigatableElements: a || [],
|
|
2328
|
-
expand:
|
|
2329
|
-
animation:
|
|
2341
|
+
expand: p,
|
|
2342
|
+
animation: c !== !1,
|
|
2330
2343
|
onClose: d,
|
|
2331
2344
|
animationStyles: s <= rs ? { top: 0, width: "100%", height: "100%" } : void 0,
|
|
2332
2345
|
className: s <= rs ? "k-adaptive-actionsheet k-actionsheet-fullscreen" : "k-adaptive-actionsheet k-actionsheet-bottom"
|
|
2333
2346
|
};
|
|
2334
|
-
return /* @__PURE__ */ o.createElement(Yt, { ...
|
|
2347
|
+
return /* @__PURE__ */ o.createElement(Yt, { ...u }, /* @__PURE__ */ o.createElement(Jt, { className: "k-text-center" }, /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-titlebar-group k-hbox" }, /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-title" }, /* @__PURE__ */ o.createElement("div", null, r)), /* @__PURE__ */ o.createElement("div", { className: "k-actionsheet-actions" }, /* @__PURE__ */ o.createElement(
|
|
2335
2348
|
Te,
|
|
2336
2349
|
{
|
|
2337
2350
|
tabIndex: 0,
|
|
@@ -2375,17 +2388,17 @@ const rs = 500, es = (i) => {
|
|
|
2375
2388
|
}, this._element = null, this._valueItemsDuringOnChange = null, this._inputId = Fe(), this.base = new ie(this), this._tags = [], this._input = null, this._adaptiveInput = null, this._skipFocusEvent = !1, this._lastSelectedOrDeslectedItemIndex = null, this.itemHeight = 0, this.scrollToFocused = !1, this.localization = null, this.focus = () => {
|
|
2376
2389
|
this._input && this._input.focus();
|
|
2377
2390
|
}, this.handleItemSelect = (t, e) => {
|
|
2378
|
-
const { data: s = [], dataItemKey: n, virtual: a } = this.props,
|
|
2379
|
-
this._lastSelectedOrDeslectedItemIndex = s.findIndex((
|
|
2391
|
+
const { data: s = [], dataItemKey: n, virtual: a } = this.props, p = a ? a.skip : 0, c = s[t - p], d = this.value.findIndex((u) => R(u, c, n));
|
|
2392
|
+
this._lastSelectedOrDeslectedItemIndex = s.findIndex((u) => R(u, c, n));
|
|
2380
2393
|
let r = [];
|
|
2381
|
-
d !== -1 ? (r = this.value, r.splice(d, 1)) : r = [...this.value,
|
|
2394
|
+
d !== -1 ? (r = this.value, r.splice(d, 1)) : r = [...this.value, c], (this.props.filter !== void 0 ? this.props.filter : this.state.text) && !this.mobileMode && (this.state.text && (e.data.text = ""), this.base.filterChanged("", e)), this._adaptiveInput && this._adaptiveInput.blur(), this.state.focusedIndex !== void 0 && (e.data.focusedIndex = void 0), this.triggerOnChange(r, e), this.base.triggerPageChangeCornerItems(c, e);
|
|
2382
2395
|
}, this.onTagDelete = (t, e) => {
|
|
2383
2396
|
const s = this.base.initState();
|
|
2384
2397
|
s.syntheticEvent = e, this.opened && this.base.togglePopup(s), !this.state.focused && !this.mobileMode && (s.data.focused = !0, this.focus());
|
|
2385
2398
|
const n = this.value;
|
|
2386
2399
|
vt(n, t, this.props.dataItemKey), this.triggerOnChange(n, s), this.applyState(s);
|
|
2387
2400
|
}, this.itemFocus = (t, e) => {
|
|
2388
|
-
const { data: s = [], allowCustom: n, virtual: a } = this.props,
|
|
2401
|
+
const { data: s = [], allowCustom: n, virtual: a } = this.props, p = a ? a.skip : 0, c = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedIndex: d } = this.getFocusedState(), r = n && c, h = s[t - p];
|
|
2389
2402
|
h && d !== t ? this.state.focusedIndex !== t && (e.data.focusedIndex = t, e.data.activedescendant = st.PopupList) : r && t === -1 && this.state.focusedIndex !== void 0 && (e.data.focusedIndex = void 0), this.base.triggerPageChangeCornerItems(h, e);
|
|
2390
2403
|
}, this.componentRef = (t) => {
|
|
2391
2404
|
this._element = t, this.base.wrapper = t;
|
|
@@ -2401,87 +2414,87 @@ const rs = 500, es = (i) => {
|
|
|
2401
2414
|
const s = this.props.filter !== void 0 ? this.props.filter : this.state.text;
|
|
2402
2415
|
G(s) && s !== "" && this.base.filterChanged("", e), this.state.text && (e.data.text = ""), this._lastSelectedOrDeslectedItemIndex = null, this.applyState(e);
|
|
2403
2416
|
}, this.onInputKeyDown = (t) => {
|
|
2404
|
-
const { data: e = [], textField: s, groupField: n } = this.props, a = t.keyCode,
|
|
2405
|
-
if (h.syntheticEvent = t, !
|
|
2417
|
+
const { data: e = [], textField: s, groupField: n } = this.props, a = t.keyCode, p = this.props.filter !== void 0 ? this.props.filter : this.state.text, c = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { focusedItem: d, focusedIndex: r } = this.getFocusedState(), h = this.base.initState();
|
|
2418
|
+
if (h.syntheticEvent = t, !p && this.value.length > 0 && (a === f.left || a === f.right || a === f.home || a === f.end || a === f.delete || a === f.backspace) && !t.shiftKey)
|
|
2406
2419
|
return this.onTagsNavigate(t, h);
|
|
2407
|
-
const
|
|
2420
|
+
const u = () => {
|
|
2408
2421
|
t.preventDefault(), this.base.togglePopup(h), this.applyState(h);
|
|
2409
2422
|
};
|
|
2410
2423
|
if (this.opened)
|
|
2411
|
-
if (a ===
|
|
2424
|
+
if (a === f.pageUp)
|
|
2412
2425
|
this.base.scrollPopupByPageSize(-1);
|
|
2413
|
-
else if (a ===
|
|
2426
|
+
else if (a === f.pageDown)
|
|
2414
2427
|
this.base.scrollPopupByPageSize(1);
|
|
2415
2428
|
else if ((t.ctrlKey || t.metaKey) && t.code === "KeyA") {
|
|
2416
|
-
const
|
|
2417
|
-
this.updateStateOnKeyboardNavigation(
|
|
2418
|
-
} else if ((t.ctrlKey || t.metaKey) && t.shiftKey && t.keyCode ===
|
|
2419
|
-
const
|
|
2420
|
-
this.itemFocus(e.length - 1, h), this.updateStateOnKeyboardNavigation(
|
|
2421
|
-
} else if ((t.ctrlKey || t.metaKey) && t.shiftKey && t.keyCode ===
|
|
2422
|
-
const
|
|
2423
|
-
this.itemFocus(0, h), this.updateStateOnKeyboardNavigation(
|
|
2424
|
-
} else if (t.shiftKey && t.keyCode ===
|
|
2425
|
-
let
|
|
2426
|
-
const
|
|
2427
|
-
|
|
2428
|
-
} else if (t.shiftKey && t.keyCode ===
|
|
2429
|
-
let
|
|
2430
|
-
const
|
|
2431
|
-
|
|
2432
|
-
} else if (t.altKey && a ===
|
|
2433
|
-
|
|
2434
|
-
else if (a ===
|
|
2429
|
+
const m = (this.state.value && this.state.value.length) === e.length ? [] : e;
|
|
2430
|
+
this.updateStateOnKeyboardNavigation(m, h);
|
|
2431
|
+
} else if ((t.ctrlKey || t.metaKey) && t.shiftKey && t.keyCode === f.end) {
|
|
2432
|
+
const g = e.slice(this.getFocusedState().focusedIndex);
|
|
2433
|
+
this.itemFocus(e.length - 1, h), this.updateStateOnKeyboardNavigation(g, h);
|
|
2434
|
+
} else if ((t.ctrlKey || t.metaKey) && t.shiftKey && t.keyCode === f.home) {
|
|
2435
|
+
const g = e.slice(0, this.getFocusedState().focusedIndex + 1);
|
|
2436
|
+
this.itemFocus(0, h), this.updateStateOnKeyboardNavigation(g, h);
|
|
2437
|
+
} else if (t.shiftKey && t.keyCode === f.up) {
|
|
2438
|
+
let g;
|
|
2439
|
+
const m = this.getLastSelectedOrDeselectedIndex(1, r);
|
|
2440
|
+
m === null ? g = r !== 0 ? e.slice(r - 1, r) : [e[r]] : m === r ? g = [e[m - 1]] : r >= 0 && (g = m > r ? e.slice(r - 1, m) : e.slice(m - 1, r)), g && g.length > 0 && (r >= 1 && this.itemFocus(r - 1, h), this.updateStateOnKeyboardNavigation(g, h));
|
|
2441
|
+
} else if (t.shiftKey && t.keyCode === f.down) {
|
|
2442
|
+
let g;
|
|
2443
|
+
const m = this.getLastSelectedOrDeselectedIndex(0, r);
|
|
2444
|
+
m === null ? g = r !== e.length - 1 ? e.slice(r, r + 1) : [e[r]] : m === r ? g = e.slice(r, r + 2) : r >= 0 && (g = m > r ? e.slice(r + 1, m + 1) : e.slice(m, r + 2)), g && g.length >= 1 && (this.itemFocus(r + 1, h), this.updateStateOnKeyboardNavigation(g, h));
|
|
2445
|
+
} else if (t.altKey && a === f.up)
|
|
2446
|
+
u();
|
|
2447
|
+
else if (a === f.up || a === f.down) {
|
|
2435
2448
|
if (n !== "" && s)
|
|
2436
|
-
if (!this.props.skipDisabledItems &&
|
|
2449
|
+
if (!this.props.skipDisabledItems && c)
|
|
2437
2450
|
this.onNavigate(h, a);
|
|
2438
2451
|
else {
|
|
2439
|
-
let
|
|
2440
|
-
if (a ===
|
|
2441
|
-
const
|
|
2442
|
-
|
|
2443
|
-
} else if (a ===
|
|
2444
|
-
let
|
|
2452
|
+
let g = 0;
|
|
2453
|
+
if (a === f.down || a === f.right) {
|
|
2454
|
+
const m = e.slice(r + 1).find((v) => !v.disabled && v[s]);
|
|
2455
|
+
g = m && e.findIndex((v) => v[s] === m[s]);
|
|
2456
|
+
} else if (a === f.up || a === f.left) {
|
|
2457
|
+
let m;
|
|
2445
2458
|
if (r === -1)
|
|
2446
|
-
|
|
2459
|
+
m = e, g = e.findIndex((v) => !v.disabled && v[s]);
|
|
2447
2460
|
else {
|
|
2448
|
-
|
|
2449
|
-
let v =
|
|
2461
|
+
m = e.slice(0, r);
|
|
2462
|
+
let v = m.pop();
|
|
2450
2463
|
for (; v && v.disabled; )
|
|
2451
|
-
v =
|
|
2452
|
-
|
|
2464
|
+
v = m.pop();
|
|
2465
|
+
g = v && e.findIndex((b) => b[s] === v[s]);
|
|
2453
2466
|
}
|
|
2454
2467
|
}
|
|
2455
|
-
if (
|
|
2456
|
-
const
|
|
2457
|
-
this.onNavigate(h, a,
|
|
2468
|
+
if (g) {
|
|
2469
|
+
const m = g - r;
|
|
2470
|
+
this.onNavigate(h, a, m);
|
|
2458
2471
|
} else
|
|
2459
|
-
|
|
2472
|
+
g !== void 0 && this.onNavigate(h, a);
|
|
2460
2473
|
}
|
|
2461
|
-
else if (!this.props.skipDisabledItems &&
|
|
2474
|
+
else if (!this.props.skipDisabledItems && c)
|
|
2462
2475
|
this.onNavigate(h, a);
|
|
2463
2476
|
else {
|
|
2464
|
-
let
|
|
2465
|
-
if (a ===
|
|
2466
|
-
|
|
2467
|
-
else if (a ===
|
|
2468
|
-
const
|
|
2469
|
-
for (
|
|
2470
|
-
|
|
2477
|
+
let g = null;
|
|
2478
|
+
if (a === f.down || a === f.right)
|
|
2479
|
+
g = e.slice(r + 1).find((m) => !m.disabled);
|
|
2480
|
+
else if (a === f.up || a === f.left) {
|
|
2481
|
+
const m = e.slice(0, r);
|
|
2482
|
+
for (g = m.pop(); g && g.disabled; )
|
|
2483
|
+
g = m.pop();
|
|
2471
2484
|
}
|
|
2472
|
-
if (
|
|
2473
|
-
const
|
|
2474
|
-
this.onNavigate(h, a,
|
|
2485
|
+
if (g) {
|
|
2486
|
+
const m = g.id - r - 1;
|
|
2487
|
+
this.onNavigate(h, a, m);
|
|
2475
2488
|
} else
|
|
2476
2489
|
this.onNavigate(h, a);
|
|
2477
2490
|
}
|
|
2478
2491
|
this.applyState(h), t.preventDefault();
|
|
2479
2492
|
} else
|
|
2480
|
-
a ===
|
|
2493
|
+
a === f.enter ? (t.preventDefault(), this.props.allowCustom && p && d === null ? this.customItemSelect(t) : d && d.disabled ? u() : this.selectFocusedItem(t)) : a === f.esc && u();
|
|
2481
2494
|
else
|
|
2482
|
-
t.altKey && a ===
|
|
2495
|
+
t.altKey && a === f.down && u();
|
|
2483
2496
|
}, this.listContainerContent = () => {
|
|
2484
|
-
const { header: t, footer: e, allowCustom: s, size: n, data: a = [], groupStickyHeaderItemRender:
|
|
2497
|
+
const { header: t, footer: e, allowCustom: s, size: n, data: a = [], groupStickyHeaderItemRender: p, groupField: c, list: d } = this.props, r = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedType: h } = this.getFocusedState(), u = s && r && /* @__PURE__ */ o.createElement(
|
|
2485
2498
|
"div",
|
|
2486
2499
|
{
|
|
2487
2500
|
className: B("k-list", {
|
|
@@ -2501,8 +2514,8 @@ const rs = 500, es = (i) => {
|
|
|
2501
2514
|
/* @__PURE__ */ o.createElement(ke, { name: "plus", icon: Ms, style: { position: "absolute", right: "0.5em" } })
|
|
2502
2515
|
)
|
|
2503
2516
|
);
|
|
2504
|
-
let { group:
|
|
2505
|
-
return
|
|
2517
|
+
let { group: g } = this.state;
|
|
2518
|
+
return g === void 0 && c !== void 0 && (g = V(a[0], c)), /* @__PURE__ */ o.createElement(o.Fragment, null, t && /* @__PURE__ */ o.createElement("div", { className: "k-list-header" }, t), u, /* @__PURE__ */ o.createElement(
|
|
2506
2519
|
"div",
|
|
2507
2520
|
{
|
|
2508
2521
|
className: B(
|
|
@@ -2513,11 +2526,11 @@ const rs = 500, es = (i) => {
|
|
|
2513
2526
|
}
|
|
2514
2527
|
)
|
|
2515
2528
|
},
|
|
2516
|
-
!d &&
|
|
2529
|
+
!d && g && a.length !== 0 && /* @__PURE__ */ o.createElement(We, { group: g, groupMode: "modern", render: p }),
|
|
2517
2530
|
this.renderList()
|
|
2518
2531
|
), e && /* @__PURE__ */ o.createElement("div", { className: "k-list-footer" }, e));
|
|
2519
2532
|
}, this.renderListContainer = () => {
|
|
2520
|
-
const t = this.base, { dir: e, data: s = [] } = this.props, n = this.base.getPopupSettings(), a = n.width !== void 0 ? n.width : t.popupWidth,
|
|
2533
|
+
const t = this.base, { dir: e, data: s = [] } = this.props, n = this.base.getPopupSettings(), a = n.width !== void 0 ? n.width : t.popupWidth, p = {
|
|
2521
2534
|
dir: e !== void 0 ? e : t.dirCalculated,
|
|
2522
2535
|
width: a,
|
|
2523
2536
|
popupSettings: {
|
|
@@ -2536,11 +2549,11 @@ const rs = 500, es = (i) => {
|
|
|
2536
2549
|
},
|
|
2537
2550
|
itemsCount: [s.length, this.value.length]
|
|
2538
2551
|
};
|
|
2539
|
-
return /* @__PURE__ */ o.createElement(Et, { ...
|
|
2552
|
+
return /* @__PURE__ */ o.createElement(Et, { ...p }, this.listContainerContent());
|
|
2540
2553
|
}, this.renderAdaptiveListContainer = () => {
|
|
2541
2554
|
const { adaptiveTitle: t, filterable: e, filter: s } = this.props, { windowWidth: n = 0 } = this.state, a = s !== void 0 ? s : this.state.text;
|
|
2542
2555
|
this.localization = Ae(this);
|
|
2543
|
-
const
|
|
2556
|
+
const p = e ? /* @__PURE__ */ o.createElement(
|
|
2544
2557
|
Be,
|
|
2545
2558
|
{
|
|
2546
2559
|
value: a,
|
|
@@ -2551,12 +2564,12 @@ const rs = 500, es = (i) => {
|
|
|
2551
2564
|
rounded: this.props.rounded,
|
|
2552
2565
|
fillMode: this.props.fillMode
|
|
2553
2566
|
}
|
|
2554
|
-
) : null,
|
|
2567
|
+
) : null, c = {
|
|
2555
2568
|
adaptiveTitle: t,
|
|
2556
2569
|
expand: this.opened,
|
|
2557
2570
|
onClose: (d) => this.onCancel(d),
|
|
2558
2571
|
windowWidth: n,
|
|
2559
|
-
mobileFilter:
|
|
2572
|
+
mobileFilter: p,
|
|
2560
2573
|
footer: {
|
|
2561
2574
|
cancelText: this.localization.toLanguageString(ot, le[ot]),
|
|
2562
2575
|
onCancel: this.onCancel,
|
|
@@ -2564,7 +2577,7 @@ const rs = 500, es = (i) => {
|
|
|
2564
2577
|
onApply: this.closePopup
|
|
2565
2578
|
}
|
|
2566
2579
|
};
|
|
2567
|
-
return /* @__PURE__ */ o.createElement(es, { ...
|
|
2580
|
+
return /* @__PURE__ */ o.createElement(es, { ...c }, /* @__PURE__ */ o.createElement(lt, { className: "!k-overflow-hidden" }, /* @__PURE__ */ o.createElement("div", { className: "k-list-container" }, this.listContainerContent())));
|
|
2568
2581
|
}, this.closePopup = (t) => {
|
|
2569
2582
|
const e = this.base.initState();
|
|
2570
2583
|
e.syntheticEvent = t, t.stopPropagation(), this.state.focusedIndex !== void 0 && (e.data.focusedIndex = void 0), this.opened && this.base.togglePopup(e), e.events.push({ type: "onClose" });
|
|
@@ -2582,30 +2595,30 @@ const rs = 500, es = (i) => {
|
|
|
2582
2595
|
listNoDataRender: s,
|
|
2583
2596
|
itemRender: n,
|
|
2584
2597
|
groupHeaderItemRender: a,
|
|
2585
|
-
dataItemKey:
|
|
2586
|
-
virtual:
|
|
2587
|
-
} = this.props, d = this.base.vs,
|
|
2598
|
+
dataItemKey: p,
|
|
2599
|
+
virtual: c = { skip: 0, total: void 0 }
|
|
2600
|
+
} = this.props, d = this.base.vs, { focusedIndex: r } = this.getFocusedState(), h = this.base.getPopupSettings(), u = `translateY(${d.translate}px)`;
|
|
2588
2601
|
return /* @__PURE__ */ o.createElement(
|
|
2589
2602
|
Ue,
|
|
2590
2603
|
{
|
|
2591
2604
|
id: this.base.listBoxId,
|
|
2592
2605
|
show: this.opened,
|
|
2593
2606
|
data: t.slice(),
|
|
2594
|
-
focusedIndex:
|
|
2607
|
+
focusedIndex: r - c.skip,
|
|
2595
2608
|
value: this.value,
|
|
2596
2609
|
textField: e,
|
|
2597
|
-
valueField:
|
|
2610
|
+
valueField: p,
|
|
2598
2611
|
optionsGuid: this.base.guid,
|
|
2599
2612
|
groupField: this.props.groupField,
|
|
2600
2613
|
groupMode: "modern",
|
|
2601
|
-
listRef: (
|
|
2602
|
-
d.list = this.base.list =
|
|
2614
|
+
listRef: (g) => {
|
|
2615
|
+
d.list = this.base.list = g;
|
|
2603
2616
|
},
|
|
2604
|
-
wrapperStyle: this.mobileMode ? {} : { maxHeight:
|
|
2617
|
+
wrapperStyle: this.mobileMode ? {} : { maxHeight: h.height },
|
|
2605
2618
|
wrapperCssClass: "k-list-content",
|
|
2606
2619
|
listStyle: d.enabled ? { transform: u } : void 0,
|
|
2607
2620
|
key: "listKey",
|
|
2608
|
-
skip:
|
|
2621
|
+
skip: c.skip,
|
|
2609
2622
|
onClick: this.handleItemClick,
|
|
2610
2623
|
itemRender: n,
|
|
2611
2624
|
groupHeaderItemRender: a,
|
|
@@ -2614,7 +2627,8 @@ const rs = 500, es = (i) => {
|
|
|
2614
2627
|
onBlur: this.handleBlur,
|
|
2615
2628
|
onScroll: this.onScroll,
|
|
2616
2629
|
wrapperRef: d.scrollerRef,
|
|
2617
|
-
scroller: this.base.renderScrollElement()
|
|
2630
|
+
scroller: this.base.renderScrollElement(),
|
|
2631
|
+
ariaSetSize: c.total
|
|
2618
2632
|
}
|
|
2619
2633
|
);
|
|
2620
2634
|
}, this.onScroll = (t) => {
|
|
@@ -2623,10 +2637,10 @@ const rs = 500, es = (i) => {
|
|
|
2623
2637
|
const { groupField: n } = this.props;
|
|
2624
2638
|
let { data: a = [] } = this.props;
|
|
2625
2639
|
if (!(!n || !a.length) && n) {
|
|
2626
|
-
const
|
|
2640
|
+
const p = this.itemHeight = this.itemHeight || (e.enabled ? e.itemHeight : s ? s.children[0].offsetHeight : 0), d = t.target.scrollTop - e.skip * p;
|
|
2627
2641
|
a = this.base.getGroupedDataModernMode(a, n);
|
|
2628
2642
|
let r = a[0][n];
|
|
2629
|
-
for (let h = 1; h < a.length && !(
|
|
2643
|
+
for (let h = 1; h < a.length && !(p * h > d); h++)
|
|
2630
2644
|
a[h] && a[h][n] && (r = a[h][n]);
|
|
2631
2645
|
r !== this.state.group && this.setState({
|
|
2632
2646
|
group: r
|
|
@@ -2640,8 +2654,8 @@ const rs = 500, es = (i) => {
|
|
|
2640
2654
|
n.syntheticEvent = t;
|
|
2641
2655
|
const a = s ? { [s]: e } : e;
|
|
2642
2656
|
this.state.text !== void 0 && (n.data.text = ""), n.data.focusedIndex = void 0, this.base.filterChanged("", n);
|
|
2643
|
-
const
|
|
2644
|
-
this.triggerOnChange(
|
|
2657
|
+
const p = [...this.value, a];
|
|
2658
|
+
this.triggerOnChange(p, n), this.base.togglePopup(n), this.applyState(n);
|
|
2645
2659
|
}, this.handleWrapperClick = (t) => {
|
|
2646
2660
|
const e = this._input;
|
|
2647
2661
|
!this.opened && e && this.focusElement(e);
|
|
@@ -2728,13 +2742,13 @@ const rs = 500, es = (i) => {
|
|
|
2728
2742
|
}
|
|
2729
2743
|
/** @hidden */
|
|
2730
2744
|
componentDidUpdate(i, t) {
|
|
2731
|
-
var
|
|
2732
|
-
const { virtual: e, groupField: s = "", data: n = [] } = this.props, a = e ? e.skip : 0,
|
|
2733
|
-
if (!this.base.getPopupSettings().animate && r && this.onPopupClosed(), e && e.total !==
|
|
2745
|
+
var u;
|
|
2746
|
+
const { virtual: e, groupField: s = "", data: n = [] } = this.props, a = e ? e.skip : 0, p = i.virtual ? i.virtual.total : 0, c = i.opened !== void 0 ? i.opened : t.opened, d = !c && this.opened, r = c && !this.opened;
|
|
2747
|
+
if (!this.base.getPopupSettings().animate && r && this.onPopupClosed(), e && e.total !== p)
|
|
2734
2748
|
this.base.vs.calcScrollElementHeight(), this.base.vs.reset();
|
|
2735
2749
|
else {
|
|
2736
|
-
let { focusedItem:
|
|
2737
|
-
s !== "" && (
|
|
2750
|
+
let { focusedItem: g, focusedIndex: m } = this.getFocusedState();
|
|
2751
|
+
s !== "" && (m = (u = this.base.getGroupedDataModernMode(n, s)) == null ? void 0 : u.indexOf(g)), d && e ? this.base.scrollToVirtualItem(e, m - a) : d && !e ? (n && n.length !== 0 && this.base.resetGroupStickyHeader(n[0][s], this), this.base.scrollToItem(m)) : this.opened && c && g && this.scrollToFocused && this.base.scrollToItem(m - a);
|
|
2738
2752
|
}
|
|
2739
2753
|
this.scrollToFocused = !1, this.setValidity();
|
|
2740
2754
|
}
|
|
@@ -2750,18 +2764,18 @@ const rs = 500, es = (i) => {
|
|
|
2750
2764
|
}
|
|
2751
2765
|
/** @hidden */
|
|
2752
2766
|
onNavigate(i, t, e) {
|
|
2753
|
-
const { allowCustom: s, data: n = [] } = this.props, a = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedType:
|
|
2754
|
-
if (this.opened && t ===
|
|
2767
|
+
const { allowCustom: s, data: n = [] } = this.props, a = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedType: p, focusedIndex: c } = this.getFocusedState(), d = s && a, r = cs(p), h = this.base, u = h.vs;
|
|
2768
|
+
if (this.opened && t === f.up && r)
|
|
2755
2769
|
this.state.focusedIndex !== void 0 && (i.data.focusedIndex = void 0);
|
|
2756
2770
|
else {
|
|
2757
|
-
const
|
|
2771
|
+
const g = h.navigation.navigate({
|
|
2758
2772
|
keyCode: t,
|
|
2759
|
-
current:
|
|
2760
|
-
max: (
|
|
2773
|
+
current: c,
|
|
2774
|
+
max: (u.enabled ? u.total : n.length) - 1,
|
|
2761
2775
|
min: d ? -1 : 0,
|
|
2762
2776
|
skipItems: e || void 0
|
|
2763
2777
|
});
|
|
2764
|
-
|
|
2778
|
+
g !== void 0 && (this.itemFocus(g, i), this.scrollToFocused = !0);
|
|
2765
2779
|
}
|
|
2766
2780
|
this.applyState(i);
|
|
2767
2781
|
}
|
|
@@ -2774,18 +2788,18 @@ const rs = 500, es = (i) => {
|
|
|
2774
2788
|
dir: s,
|
|
2775
2789
|
disabled: n,
|
|
2776
2790
|
textField: a,
|
|
2777
|
-
dataItemKey:
|
|
2778
|
-
virtual:
|
|
2791
|
+
dataItemKey: p,
|
|
2792
|
+
virtual: c,
|
|
2779
2793
|
size: d,
|
|
2780
2794
|
rounded: r,
|
|
2781
2795
|
fillMode: h,
|
|
2782
|
-
loading:
|
|
2783
|
-
filter:
|
|
2784
|
-
} = this.props, { text:
|
|
2785
|
-
S.enabled =
|
|
2796
|
+
loading: u,
|
|
2797
|
+
filter: g
|
|
2798
|
+
} = this.props, { text: m, focused: v, focusedTag: b, currentValue: w } = this.state, S = this.base.vs, D = this.props.id || this._inputId;
|
|
2799
|
+
S.enabled = c !== void 0, c !== void 0 && (S.skip = c.skip, S.total = c.total, S.pageSize = c.pageSize);
|
|
2786
2800
|
const N = this.mobileMode && this.opened ? w : this.tagsToRender;
|
|
2787
2801
|
this.setItems(this.tagsToRender, this._tags);
|
|
2788
|
-
const O = !this.validityStyles || this.validity.valid, _ = !!(
|
|
2802
|
+
const O = !this.validityStyles || this.validity.valid, _ = !!(g !== void 0 ? g : m) || N && N.length > 0, C = /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
2789
2803
|
"div",
|
|
2790
2804
|
{
|
|
2791
2805
|
ref: this.componentRef,
|
|
@@ -2796,7 +2810,7 @@ const rs = 500, es = (i) => {
|
|
|
2796
2810
|
"k-focus": v && !n,
|
|
2797
2811
|
"k-invalid": !O,
|
|
2798
2812
|
"k-disabled": n,
|
|
2799
|
-
"k-loading":
|
|
2813
|
+
"k-loading": u,
|
|
2800
2814
|
"k-required": this.required
|
|
2801
2815
|
}),
|
|
2802
2816
|
style: e ? { ...i, width: void 0 } : i,
|
|
@@ -2804,7 +2818,7 @@ const rs = 500, es = (i) => {
|
|
|
2804
2818
|
onFocus: this.handleFocus,
|
|
2805
2819
|
onBlur: this.handleBlur,
|
|
2806
2820
|
onClick: this.handleWrapperClick,
|
|
2807
|
-
onMouseDown:
|
|
2821
|
+
onMouseDown: Hs
|
|
2808
2822
|
},
|
|
2809
2823
|
/* @__PURE__ */ o.createElement("div", { className: B("k-input-values") }, /* @__PURE__ */ o.createElement(
|
|
2810
2824
|
"div",
|
|
@@ -2823,12 +2837,12 @@ const rs = 500, es = (i) => {
|
|
|
2823
2837
|
onTagDelete: this.onTagDelete,
|
|
2824
2838
|
data: N,
|
|
2825
2839
|
guid: this.base.guid,
|
|
2826
|
-
focused: b ? N.find((F) => xt(F, b,
|
|
2840
|
+
focused: b ? N.find((F) => xt(F, b, p)) : void 0,
|
|
2827
2841
|
size: d
|
|
2828
2842
|
}
|
|
2829
2843
|
)
|
|
2830
2844
|
), this.renderSearchBar(D)),
|
|
2831
|
-
|
|
2845
|
+
u && /* @__PURE__ */ o.createElement(ke, { className: "k-input-loading-icon", name: "loading" }),
|
|
2832
2846
|
_ && /* @__PURE__ */ o.createElement(rt, { onClick: this.clearButtonClick }),
|
|
2833
2847
|
!this.mobileMode && this.renderListContainer()
|
|
2834
2848
|
), this.mobileMode && this.renderAdaptiveListContainer());
|
|
@@ -2837,7 +2851,7 @@ const rs = 500, es = (i) => {
|
|
|
2837
2851
|
{
|
|
2838
2852
|
label: e,
|
|
2839
2853
|
editorId: D,
|
|
2840
|
-
editorValue:
|
|
2854
|
+
editorValue: m || V(this.value[0], a),
|
|
2841
2855
|
editorValid: O,
|
|
2842
2856
|
editorDisabled: n,
|
|
2843
2857
|
style: { width: i ? i.width : void 0 },
|
|
@@ -2846,16 +2860,16 @@ const rs = 500, es = (i) => {
|
|
|
2846
2860
|
) : C;
|
|
2847
2861
|
}
|
|
2848
2862
|
renderSearchBar(i) {
|
|
2849
|
-
const { activedescendant: t, focusedTag: e, currentValue: s } = this.state, { disabled: n, placeholder: a, ariaDescribedBy:
|
|
2863
|
+
const { activedescendant: t, focusedTag: e, currentValue: s } = this.state, { disabled: n, placeholder: a, ariaDescribedBy: p } = this.props, c = !this.mobileMode && (this.props.filter !== void 0 ? this.props.filter : this.state.text) || "", { focusedIndex: d } = this.getFocusedState(), r = this.value.length === 0 && !c ? a : void 0, h = s && s.length > 0 ? void 0 : a, u = t === st.TagsList && e !== void 0 ? `tag-${this.base.guid}-${e.text.replace(/\s+/g, "-")}` : `option-${this.base.guid}-${d}`;
|
|
2850
2864
|
return /* @__PURE__ */ o.createElement(
|
|
2851
2865
|
Zt,
|
|
2852
2866
|
{
|
|
2853
2867
|
id: i,
|
|
2854
|
-
size: Math.max((r || "").length,
|
|
2868
|
+
size: Math.max((r || "").length, c.length, 1),
|
|
2855
2869
|
tabIndex: this.props.tabIndex,
|
|
2856
2870
|
accessKey: this.props.accessKey,
|
|
2857
2871
|
placeholder: this.mobileMode && this.opened ? h : r,
|
|
2858
|
-
value:
|
|
2872
|
+
value: c,
|
|
2859
2873
|
onChange: this.onChangeHandler,
|
|
2860
2874
|
onKeyDown: this.onInputKeyDown,
|
|
2861
2875
|
ref: this.searchbarRef,
|
|
@@ -2863,8 +2877,8 @@ const rs = 500, es = (i) => {
|
|
|
2863
2877
|
expanded: this.opened,
|
|
2864
2878
|
owns: this.base.listBoxId,
|
|
2865
2879
|
role: "combobox",
|
|
2866
|
-
activedescendant:
|
|
2867
|
-
ariaDescribedBy: `tagslist-${this.base.guid}${
|
|
2880
|
+
activedescendant: u,
|
|
2881
|
+
ariaDescribedBy: `tagslist-${this.base.guid}${p ? " " + p : ""}`,
|
|
2868
2882
|
ariaLabelledBy: this.props.ariaLabelledBy,
|
|
2869
2883
|
ariaRequired: this.required
|
|
2870
2884
|
}
|
|
@@ -2872,31 +2886,31 @@ const rs = 500, es = (i) => {
|
|
|
2872
2886
|
}
|
|
2873
2887
|
onTagsNavigate(i, t) {
|
|
2874
2888
|
const e = i.keyCode, { focusedTag: s } = this.state, n = this._tags, a = this.props.dataItemKey;
|
|
2875
|
-
let
|
|
2876
|
-
const d =
|
|
2877
|
-
if (e ===
|
|
2878
|
-
d ?
|
|
2879
|
-
else if (e ===
|
|
2880
|
-
|
|
2881
|
-
else if (e ===
|
|
2882
|
-
|
|
2883
|
-
else if (e ===
|
|
2884
|
-
|
|
2885
|
-
else if (e ===
|
|
2889
|
+
let p = s ? n.findIndex((r) => xt(r, s, a)) : -1, c;
|
|
2890
|
+
const d = p !== -1;
|
|
2891
|
+
if (e === f.left)
|
|
2892
|
+
d ? p = Math.max(0, p - 1) : p = n.length - 1, c = n[p];
|
|
2893
|
+
else if (e === f.right)
|
|
2894
|
+
p === n.length - 1 ? c = void 0 : d && (p = Math.min(n.length - 1, p + 1), c = n[p]);
|
|
2895
|
+
else if (e === f.home && !i.shiftKey)
|
|
2896
|
+
c = n[0];
|
|
2897
|
+
else if (e === f.end && !i.shiftKey)
|
|
2898
|
+
c = n[n.length - 1];
|
|
2899
|
+
else if (e === f.delete) {
|
|
2886
2900
|
if (d) {
|
|
2887
2901
|
const r = this.value;
|
|
2888
|
-
vt(r, n[
|
|
2902
|
+
vt(r, n[p].data, a), this.triggerOnChange(r, t);
|
|
2889
2903
|
}
|
|
2890
|
-
} else if (e ===
|
|
2904
|
+
} else if (e === f.backspace) {
|
|
2891
2905
|
const r = this.value;
|
|
2892
2906
|
if (d)
|
|
2893
|
-
vt(r, n[
|
|
2907
|
+
vt(r, n[p].data, a), this.triggerOnChange(r, t);
|
|
2894
2908
|
else if (!d && n.length) {
|
|
2895
2909
|
const h = n.pop();
|
|
2896
2910
|
vt(r, h.data, a), this.triggerOnChange(r, t);
|
|
2897
2911
|
}
|
|
2898
2912
|
}
|
|
2899
|
-
|
|
2913
|
+
c !== s && (t.data.focusedTag = c, t.data.activedescendant = st.TagsList), this.applyState(t);
|
|
2900
2914
|
}
|
|
2901
2915
|
triggerOnChange(i, t) {
|
|
2902
2916
|
this.props.value === void 0 && (t.data.value = [...i]), this._valueItemsDuringOnChange = [], this.setItems(i, this._valueItemsDuringOnChange), t.events.push({ type: "onChange" });
|
|
@@ -2909,7 +2923,7 @@ const rs = 500, es = (i) => {
|
|
|
2909
2923
|
t.length = 0, t.push(...i);
|
|
2910
2924
|
}
|
|
2911
2925
|
getFocusedState() {
|
|
2912
|
-
const { focusedIndex: i } = this.state, t = this.props.filter !== void 0 ? this.props.filter : this.state.text, { allowCustom: e, data: s = [], dataItemKey: n, virtual: a, textField:
|
|
2926
|
+
const { focusedIndex: i } = this.state, t = this.props.filter !== void 0 ? this.props.filter : this.state.text, { allowCustom: e, data: s = [], dataItemKey: n, virtual: a, textField: p, focusedItemIndex: c = Ve, skipDisabledItems: d } = this.props, r = a && a.skip || 0;
|
|
2913
2927
|
let h;
|
|
2914
2928
|
if (i !== void 0)
|
|
2915
2929
|
return {
|
|
@@ -2918,7 +2932,7 @@ const rs = 500, es = (i) => {
|
|
|
2918
2932
|
focusedType: 1
|
|
2919
2933
|
/* ListItem */
|
|
2920
2934
|
};
|
|
2921
|
-
const
|
|
2935
|
+
const u = this.value;
|
|
2922
2936
|
if (e && t)
|
|
2923
2937
|
return {
|
|
2924
2938
|
focusedItem: null,
|
|
@@ -2927,25 +2941,25 @@ const rs = 500, es = (i) => {
|
|
|
2927
2941
|
/* CustomItem */
|
|
2928
2942
|
};
|
|
2929
2943
|
if (t)
|
|
2930
|
-
return h =
|
|
2944
|
+
return h = c(s, t, p), {
|
|
2931
2945
|
focusedItem: s[h],
|
|
2932
2946
|
focusedIndex: h + r,
|
|
2933
2947
|
focusedType: 1
|
|
2934
2948
|
/* ListItem */
|
|
2935
2949
|
};
|
|
2936
|
-
if (
|
|
2937
|
-
const
|
|
2938
|
-
return h = s.findIndex((
|
|
2950
|
+
if (u.length) {
|
|
2951
|
+
const g = u[u.length - 1];
|
|
2952
|
+
return h = s.findIndex((m) => R(m, g, n)), s[h] !== void 0 ? {
|
|
2939
2953
|
focusedIndex: h + r,
|
|
2940
2954
|
focusedItem: s[h],
|
|
2941
2955
|
focusedType: 1
|
|
2942
2956
|
/* ListItem */
|
|
2943
2957
|
} : { focusedType: 0, focusedIndex: -1 };
|
|
2944
|
-
} else if (d &&
|
|
2945
|
-
const
|
|
2958
|
+
} else if (d && p && !t && r === 0) {
|
|
2959
|
+
const g = s.findIndex((m) => !m.disabled && m[p]);
|
|
2946
2960
|
return {
|
|
2947
|
-
focusedIndex:
|
|
2948
|
-
focusedItem: s[
|
|
2961
|
+
focusedIndex: g,
|
|
2962
|
+
focusedItem: s[g - r],
|
|
2949
2963
|
focusedType: 1
|
|
2950
2964
|
/* ListItem */
|
|
2951
2965
|
};
|
|
@@ -3037,14 +3051,14 @@ const hi = (i) => /* @__PURE__ */ o.createElement(
|
|
|
3037
3051
|
}
|
|
3038
3052
|
), ui = (i, t) => i ? typeof i == "number" ? i + "px" : i : t, gi = Ke(), ts = o.forwardRef((i, t) => {
|
|
3039
3053
|
const e = Gt(gi, i), s = o.useRef(null), n = o.useRef(null), a = ws(), {
|
|
3040
|
-
columns:
|
|
3041
|
-
popupSettings:
|
|
3054
|
+
columns: p = He.columns,
|
|
3055
|
+
popupSettings: c = He.popupSettings,
|
|
3042
3056
|
className: d,
|
|
3043
3057
|
size: r,
|
|
3044
3058
|
onOpen: h,
|
|
3045
|
-
onClose:
|
|
3046
|
-
onFocus:
|
|
3047
|
-
onBlur:
|
|
3059
|
+
onClose: u,
|
|
3060
|
+
onFocus: g,
|
|
3061
|
+
onBlur: m,
|
|
3048
3062
|
onChange: v,
|
|
3049
3063
|
onFilterChange: b,
|
|
3050
3064
|
onPageChange: w,
|
|
@@ -3071,60 +3085,60 @@ const hi = (i) => /* @__PURE__ */ o.createElement(
|
|
|
3071
3085
|
[e.data, e.groupField]
|
|
3072
3086
|
), [N, O] = o.useState(D), [_, C] = o.useState(!0), F = o.useMemo(
|
|
3073
3087
|
() => {
|
|
3074
|
-
const P = /* @__PURE__ */ o.createElement("th", { className: "k-table-th", colSpan:
|
|
3075
|
-
return /* @__PURE__ */ o.createElement(o.Fragment, null, e.header, /* @__PURE__ */ o.createElement("div", { className: "k-table-header-wrap" }, /* @__PURE__ */ o.createElement("table", { className: "k-table", role: "presentation" }, /* @__PURE__ */ o.createElement("colgroup", null,
|
|
3076
|
-
(
|
|
3088
|
+
const P = /* @__PURE__ */ o.createElement("th", { className: "k-table-th", colSpan: p.length }, N);
|
|
3089
|
+
return /* @__PURE__ */ o.createElement(o.Fragment, null, e.header, /* @__PURE__ */ o.createElement("div", { className: "k-table-header-wrap" }, /* @__PURE__ */ o.createElement("table", { className: "k-table", role: "presentation" }, /* @__PURE__ */ o.createElement("colgroup", null, p.map(
|
|
3090
|
+
(H, L) => /* @__PURE__ */ o.createElement(
|
|
3077
3091
|
"col",
|
|
3078
3092
|
{
|
|
3079
|
-
key:
|
|
3080
|
-
style: { width:
|
|
3093
|
+
key: H.uniqueKey ? H.uniqueKey : L,
|
|
3094
|
+
style: { width: H.width ? H.width : He.width }
|
|
3081
3095
|
}
|
|
3082
3096
|
)
|
|
3083
|
-
)), /* @__PURE__ */ o.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ o.createElement("tr", { className: "k-table-row" },
|
|
3097
|
+
)), /* @__PURE__ */ o.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ o.createElement("tr", { className: "k-table-row" }, p.map((H, L) => /* @__PURE__ */ o.createElement("th", { className: "k-table-th", key: H.uniqueKey ? H.uniqueKey : L }, H.header || " "))), N && _ && /* @__PURE__ */ o.createElement("tr", { className: "k-table-group-row" }, e.groupStickyHeaderItemRender ? e.groupStickyHeaderItemRender.call(void 0, P, {}) : P)))));
|
|
3084
3098
|
},
|
|
3085
|
-
[e.header,
|
|
3099
|
+
[e.header, p, N, _]
|
|
3086
3100
|
), x = o.useMemo(
|
|
3087
3101
|
() => (
|
|
3088
3102
|
// These additional 4px are coming from the child elements side borders (fixes horizontal scrollbar)
|
|
3089
|
-
`calc(${
|
|
3103
|
+
`calc(${p.map((P) => ui(P.width, He.width)).filter(Boolean).join(" + ")} + ${a}px + 4px)`
|
|
3090
3104
|
),
|
|
3091
|
-
[
|
|
3105
|
+
[p, a]
|
|
3092
3106
|
), E = e.virtual ? e.virtual.skip : 0, M = o.useCallback(
|
|
3093
|
-
(P,
|
|
3094
|
-
const L =
|
|
3107
|
+
(P, H) => {
|
|
3108
|
+
const L = p.map((J, W) => /* @__PURE__ */ o.createElement(
|
|
3095
3109
|
"span",
|
|
3096
3110
|
{
|
|
3097
3111
|
className: e.itemRender ? void 0 : "k-table-td",
|
|
3098
|
-
style: e.itemRender ? void 0 : { width: J.width ? J.width :
|
|
3112
|
+
style: e.itemRender ? void 0 : { width: J.width ? J.width : He.width },
|
|
3099
3113
|
key: J.uniqueKey ? J.uniqueKey : W
|
|
3100
3114
|
},
|
|
3101
|
-
J.field ? String(kt(J.field)(
|
|
3115
|
+
J.field ? String(kt(J.field)(H.dataItem)) : ""
|
|
3102
3116
|
));
|
|
3103
3117
|
let me, Ce, Ne, Oe, Pe = e.data || [];
|
|
3104
|
-
const A =
|
|
3118
|
+
const A = H.index - E;
|
|
3105
3119
|
e.groupField !== void 0 && (Oe = kt(e.groupField), Ce = Oe(Pe[A]), Ne = Oe(Pe[A - 1]), Ce && Ne && Ce !== Ne && (me = Ce)), me && e.groupMode === "classic" && L.push(/* @__PURE__ */ o.createElement("div", { key: "group", className: "k-table-td k-table-group-td" }, /* @__PURE__ */ o.createElement("span", null, me)));
|
|
3106
3120
|
const X = o.cloneElement(P, {
|
|
3107
3121
|
...P.props,
|
|
3108
3122
|
className: B("k-table-row", {
|
|
3109
|
-
"k-table-alt-row":
|
|
3110
|
-
"k-focus":
|
|
3111
|
-
"k-selected":
|
|
3123
|
+
"k-table-alt-row": H.index % 2 !== 0,
|
|
3124
|
+
"k-focus": H.focused,
|
|
3125
|
+
"k-selected": H.selected,
|
|
3112
3126
|
"k-first": !!me,
|
|
3113
|
-
"k-disabled":
|
|
3127
|
+
"k-disabled": H.dataItem.disabled
|
|
3114
3128
|
})
|
|
3115
3129
|
}, L);
|
|
3116
|
-
return e.itemRender ? e.itemRender.call(void 0, X,
|
|
3130
|
+
return e.itemRender ? e.itemRender.call(void 0, X, H) : X;
|
|
3117
3131
|
},
|
|
3118
|
-
[
|
|
3132
|
+
[p, e.groupField, e.itemRender, e.data, E]
|
|
3119
3133
|
), K = o.useCallback(
|
|
3120
|
-
(P,
|
|
3134
|
+
(P, H) => {
|
|
3121
3135
|
P && P.call(void 0, {
|
|
3122
|
-
...
|
|
3136
|
+
...H,
|
|
3123
3137
|
target: s.current
|
|
3124
3138
|
});
|
|
3125
3139
|
},
|
|
3126
3140
|
[]
|
|
3127
|
-
), U = o.useCallback((P) => (e.virtual || O(D), K(h, P)), [K, h, e.virtual, D]), j = o.useCallback((P) => K(
|
|
3141
|
+
), U = o.useCallback((P) => (e.virtual || O(D), K(h, P)), [K, h, e.virtual, D]), j = o.useCallback((P) => K(u, P), [u]), Y = o.useCallback((P) => K(g, P), [g]), re = o.useCallback((P) => K(m, P), [m]), we = o.useCallback((P) => K(v, P), [v]), ne = o.useCallback((P) => K(w, P), [w]), Q = o.useCallback((P) => (O(D), K(b, {
|
|
3128
3142
|
...P,
|
|
3129
3143
|
mobileMode: P.target.mobileMode
|
|
3130
3144
|
})), [b]), oe = o.useCallback(
|
|
@@ -3143,7 +3157,7 @@ const hi = (i) => /* @__PURE__ */ o.createElement(
|
|
|
3143
3157
|
return /* @__PURE__ */ o.createElement(
|
|
3144
3158
|
Ns.Provider,
|
|
3145
3159
|
{
|
|
3146
|
-
value: (P) => ({ ...P, popupClass: `k-dropdowngrid-popup ${
|
|
3160
|
+
value: (P) => ({ ...P, popupClass: `k-dropdowngrid-popup ${c.popupClass}` })
|
|
3147
3161
|
},
|
|
3148
3162
|
/* @__PURE__ */ o.createElement(
|
|
3149
3163
|
bs,
|
|
@@ -3152,8 +3166,8 @@ const hi = (i) => /* @__PURE__ */ o.createElement(
|
|
|
3152
3166
|
list: Le,
|
|
3153
3167
|
popupSettings: {
|
|
3154
3168
|
width: x,
|
|
3155
|
-
...
|
|
3156
|
-
className:
|
|
3169
|
+
...c,
|
|
3170
|
+
className: c.className
|
|
3157
3171
|
},
|
|
3158
3172
|
ref: n,
|
|
3159
3173
|
header: F,
|
|
@@ -3186,7 +3200,7 @@ const hi = (i) => /* @__PURE__ */ o.createElement(
|
|
|
3186
3200
|
}), fi = {
|
|
3187
3201
|
...dt.propTypes,
|
|
3188
3202
|
columns: l.any.isRequired
|
|
3189
|
-
},
|
|
3203
|
+
}, He = {
|
|
3190
3204
|
columns: [],
|
|
3191
3205
|
popupSettings: {},
|
|
3192
3206
|
width: "200px",
|
|
@@ -3196,7 +3210,7 @@ const hi = (i) => /* @__PURE__ */ o.createElement(
|
|
|
3196
3210
|
};
|
|
3197
3211
|
ts.displayName = "KendoMultiColumnComboBox";
|
|
3198
3212
|
ts.propTypes = fi;
|
|
3199
|
-
ts.defaultProps =
|
|
3213
|
+
ts.defaultProps = He;
|
|
3200
3214
|
function Is(i, t, e) {
|
|
3201
3215
|
const [s, n] = o.useState(t);
|
|
3202
3216
|
return o.useEffect(
|
|
@@ -3234,14 +3248,14 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3234
3248
|
...hs,
|
|
3235
3249
|
...e
|
|
3236
3250
|
}, n = o.useMemo(() => Fe(), []), a = s.id || n, {
|
|
3237
|
-
data:
|
|
3238
|
-
dataItemKey:
|
|
3251
|
+
data: p,
|
|
3252
|
+
dataItemKey: c,
|
|
3239
3253
|
popupSettings: d,
|
|
3240
3254
|
style: r,
|
|
3241
3255
|
opened: h,
|
|
3242
|
-
disabled:
|
|
3243
|
-
onOpen:
|
|
3244
|
-
onClose:
|
|
3256
|
+
disabled: u,
|
|
3257
|
+
onOpen: g = De,
|
|
3258
|
+
onClose: m = De,
|
|
3245
3259
|
placeholder: v,
|
|
3246
3260
|
label: b,
|
|
3247
3261
|
name: w,
|
|
@@ -3251,13 +3265,13 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3251
3265
|
valid: O,
|
|
3252
3266
|
required: _,
|
|
3253
3267
|
validityStyles: C
|
|
3254
|
-
} = s, F = $t(s.tabIndex,
|
|
3268
|
+
} = s, F = $t(s.tabIndex, u), x = o.useRef(null), E = o.useRef(null), M = o.useRef(null), K = o.useRef(null), U = o.useRef(null), j = o.useRef(null), Y = o.useRef(!1), [re, we] = o.useState(void 0), ne = s.value !== void 0, Q = ne ? s.value : re !== void 0 ? re : s.defaultValue, oe = G(Q), Le = oe ? V(Q, s.textField) : "", P = Ii({ validationMessage: N, valid: O, required: _ }, oe), H = o.useCallback(() => E.current && E.current.focus(), []);
|
|
3255
3269
|
o.useImperativeHandle(
|
|
3256
3270
|
x,
|
|
3257
3271
|
() => ({
|
|
3258
3272
|
props: s,
|
|
3259
3273
|
element: E.current,
|
|
3260
|
-
focus:
|
|
3274
|
+
focus: H
|
|
3261
3275
|
})
|
|
3262
3276
|
), o.useImperativeHandle(t, () => x.current);
|
|
3263
3277
|
const L = fs(E, s.dir), me = d.width !== void 0 ? d.width : r.width !== void 0 ? r.width : hs.popupSettings.width, Ne = {
|
|
@@ -3280,20 +3294,20 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3280
3294
|
const ct = o.useCallback(
|
|
3281
3295
|
(I) => {
|
|
3282
3296
|
if (!A) {
|
|
3283
|
-
if (
|
|
3297
|
+
if (g) {
|
|
3284
3298
|
const T = { ...I };
|
|
3285
|
-
|
|
3299
|
+
g.call(void 0, T);
|
|
3286
3300
|
}
|
|
3287
3301
|
h === void 0 && Pe(!0);
|
|
3288
3302
|
}
|
|
3289
3303
|
},
|
|
3290
|
-
[A, h,
|
|
3304
|
+
[A, h, g]
|
|
3291
3305
|
), xe = o.useCallback(
|
|
3292
3306
|
(I) => {
|
|
3293
3307
|
if (A) {
|
|
3294
|
-
if (
|
|
3308
|
+
if (m) {
|
|
3295
3309
|
const T = { ...I };
|
|
3296
|
-
|
|
3310
|
+
m.call(void 0, T);
|
|
3297
3311
|
}
|
|
3298
3312
|
h === void 0 && (Pe(!1), ue && setTimeout(() => {
|
|
3299
3313
|
var T;
|
|
@@ -3301,7 +3315,7 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3301
3315
|
}, 300));
|
|
3302
3316
|
}
|
|
3303
3317
|
},
|
|
3304
|
-
[A, h,
|
|
3318
|
+
[A, h, m, ue]
|
|
3305
3319
|
), Nt = o.useCallback(
|
|
3306
3320
|
(I) => {
|
|
3307
3321
|
if (!I.isDefaultPrevented() && x.current) {
|
|
@@ -3314,15 +3328,15 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3314
3328
|
(A ? xe : ct)(T);
|
|
3315
3329
|
}
|
|
3316
3330
|
},
|
|
3317
|
-
[A, h,
|
|
3331
|
+
[A, h, g, m]
|
|
3318
3332
|
), se = o.useCallback(
|
|
3319
3333
|
(I) => {
|
|
3320
3334
|
Y.current = !0, I(), window.setTimeout(() => Y.current = !1, 0);
|
|
3321
3335
|
},
|
|
3322
3336
|
[]
|
|
3323
|
-
),
|
|
3337
|
+
), ze = o.useCallback(
|
|
3324
3338
|
(I) => {
|
|
3325
|
-
var k,
|
|
3339
|
+
var k, z;
|
|
3326
3340
|
const { keyCode: T, altKey: $ } = I, de = j.current && j.current.element;
|
|
3327
3341
|
if (!x.current || I.isDefaultPrevented() && ((k = M.current) == null ? void 0 : k.element) === I.target)
|
|
3328
3342
|
return;
|
|
@@ -3332,10 +3346,10 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3332
3346
|
target: x.current
|
|
3333
3347
|
};
|
|
3334
3348
|
if (A)
|
|
3335
|
-
if (T ===
|
|
3349
|
+
if (T === f.esc || $ && T === f.up)
|
|
3336
3350
|
I.preventDefault(), xe(y);
|
|
3337
|
-
else if (de && de.querySelector(".k-focus") && (T ===
|
|
3338
|
-
if (T ===
|
|
3351
|
+
else if (de && de.querySelector(".k-focus") && (T === f.up || T === f.down || T === f.left || T === f.right || T === f.home || T === f.end)) {
|
|
3352
|
+
if (T === f.up && ((z = M.current) != null && z.element)) {
|
|
3339
3353
|
const ee = Array.from(de.querySelectorAll(".k-treeview-item")), ye = [...ee].reverse().find((Ie) => !!(Ie && Ie.querySelector(".k-focus")));
|
|
3340
3354
|
if (ye && ee.indexOf(ye) === 0)
|
|
3341
3355
|
return se(() => {
|
|
@@ -3345,19 +3359,19 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3345
3359
|
}
|
|
3346
3360
|
se(De);
|
|
3347
3361
|
} else
|
|
3348
|
-
T ===
|
|
3362
|
+
T === f.down && se(() => {
|
|
3349
3363
|
var ee;
|
|
3350
3364
|
q(((ee = M.current) == null ? void 0 : ee.element) || de);
|
|
3351
3365
|
});
|
|
3352
3366
|
else
|
|
3353
|
-
$ && T ===
|
|
3367
|
+
$ && T === f.down ? (I.preventDefault(), ct(y)) : A || T === f.esc && ut(I);
|
|
3354
3368
|
},
|
|
3355
|
-
[A, h,
|
|
3369
|
+
[A, h, g, m]
|
|
3356
3370
|
), _e = o.useCallback(
|
|
3357
3371
|
(I) => {
|
|
3358
3372
|
const { keyCode: T, altKey: $ } = I;
|
|
3359
|
-
$ || T !==
|
|
3360
|
-
T ===
|
|
3373
|
+
$ || T !== f.up && T !== f.down || (I.preventDefault(), se(
|
|
3374
|
+
T === f.up ? () => {
|
|
3361
3375
|
q(E.current);
|
|
3362
3376
|
} : () => {
|
|
3363
3377
|
q(j.current && j.current.element);
|
|
@@ -3375,7 +3389,7 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3375
3389
|
var I;
|
|
3376
3390
|
!X && A && !h ? xe({ target: x.current }) : e.filterable ? q((I = M.current) == null ? void 0 : I.element) : q(j.current && j.current.element);
|
|
3377
3391
|
},
|
|
3378
|
-
[
|
|
3392
|
+
[m, e.filterable, X, h, A]
|
|
3379
3393
|
), Z = o.useCallback(
|
|
3380
3394
|
() => {
|
|
3381
3395
|
X && q(E.current);
|
|
@@ -3409,7 +3423,7 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3409
3423
|
ue || xe(T);
|
|
3410
3424
|
}
|
|
3411
3425
|
},
|
|
3412
|
-
[X, e.onBlur, A, h,
|
|
3426
|
+
[X, e.onBlur, A, h, m]
|
|
3413
3427
|
), _t = o.useCallback(
|
|
3414
3428
|
() => {
|
|
3415
3429
|
X && se(De), ue && setTimeout(() => {
|
|
@@ -3433,7 +3447,7 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3433
3447
|
[e.onChange, ne]
|
|
3434
3448
|
), ht = o.useCallback(
|
|
3435
3449
|
(I) => {
|
|
3436
|
-
if (R(I.item, Q,
|
|
3450
|
+
if (R(I.item, Q, c) || !x.current)
|
|
3437
3451
|
return;
|
|
3438
3452
|
const { item: T, itemHierarchicalIndex: $, nativeEvent: de, syntheticEvent: y } = I, k = {
|
|
3439
3453
|
syntheticEvent: y,
|
|
@@ -3442,7 +3456,7 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3442
3456
|
};
|
|
3443
3457
|
pt(k, T, $), xe(k);
|
|
3444
3458
|
},
|
|
3445
|
-
[ne, Q, e.onChange,
|
|
3459
|
+
[ne, Q, e.onChange, c, A, h, m]
|
|
3446
3460
|
), ut = o.useCallback(
|
|
3447
3461
|
(I) => {
|
|
3448
3462
|
if (!x.current)
|
|
@@ -3454,7 +3468,7 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3454
3468
|
};
|
|
3455
3469
|
pt(T, null), xe(T), I.preventDefault();
|
|
3456
3470
|
},
|
|
3457
|
-
[ne, e.onChange, A, h,
|
|
3471
|
+
[ne, e.onChange, A, h, m]
|
|
3458
3472
|
), gt = o.useCallback(
|
|
3459
3473
|
(I) => {
|
|
3460
3474
|
if (I.syntheticEvent.stopPropagation(), e.onExpandChange && x.current) {
|
|
@@ -3501,13 +3515,13 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3501
3515
|
windowWidth: W,
|
|
3502
3516
|
mobileFilter: I
|
|
3503
3517
|
};
|
|
3504
|
-
return /* @__PURE__ */ o.createElement(es, { ...T }, /* @__PURE__ */ o.createElement(lt, { className: "!k-overflow-hidden" }, /* @__PURE__ */ o.createElement("div", { className: "k-list-container" }, /* @__PURE__ */ o.createElement("div", { className: "k-list k-list-lg" },
|
|
3518
|
+
return /* @__PURE__ */ o.createElement(es, { ...T }, /* @__PURE__ */ o.createElement(lt, { className: "!k-overflow-hidden" }, /* @__PURE__ */ o.createElement("div", { className: "k-list-container" }, /* @__PURE__ */ o.createElement("div", { className: "k-list k-list-lg" }, p.length > 0 ? /* @__PURE__ */ o.createElement(
|
|
3505
3519
|
Ct,
|
|
3506
3520
|
{
|
|
3507
3521
|
ref: j,
|
|
3508
3522
|
tabIndex: F,
|
|
3509
3523
|
data: Xe,
|
|
3510
|
-
focusIdField:
|
|
3524
|
+
focusIdField: c,
|
|
3511
3525
|
textField: s.textField,
|
|
3512
3526
|
selectField: S,
|
|
3513
3527
|
expandField: s.expandField,
|
|
@@ -3527,16 +3541,16 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3527
3541
|
},
|
|
3528
3542
|
[]
|
|
3529
3543
|
), Xe = o.useMemo(
|
|
3530
|
-
() => ne || !oe ?
|
|
3531
|
-
|
|
3544
|
+
() => ne || !oe ? p : Ds(
|
|
3545
|
+
p,
|
|
3532
3546
|
D,
|
|
3533
3547
|
(I) => Ts(
|
|
3534
3548
|
I,
|
|
3535
3549
|
D,
|
|
3536
|
-
{ [S]: R(I, Q,
|
|
3550
|
+
{ [S]: R(I, Q, c) }
|
|
3537
3551
|
)
|
|
3538
3552
|
),
|
|
3539
|
-
[
|
|
3553
|
+
[p, Q, ne, oe, S, D]
|
|
3540
3554
|
), Ze = s.listNoData || ks, ft = s.valueHolder || yi, et = vs(), mt = !C || P.valid, { size: ge, rounded: be, fillMode: Ee } = s, ae = /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
3541
3555
|
"span",
|
|
3542
3556
|
{
|
|
@@ -3556,15 +3570,15 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3556
3570
|
style: b ? { ...r, width: void 0 } : r,
|
|
3557
3571
|
dir: L,
|
|
3558
3572
|
ref: E,
|
|
3559
|
-
onKeyDown:
|
|
3573
|
+
onKeyDown: u ? void 0 : ze,
|
|
3560
3574
|
onMouseDown: _t,
|
|
3561
|
-
onClick:
|
|
3575
|
+
onClick: u ? void 0 : Nt,
|
|
3562
3576
|
onFocus: Ot,
|
|
3563
3577
|
onBlur: Pt,
|
|
3564
3578
|
role: "combobox",
|
|
3565
3579
|
"aria-haspopup": "tree",
|
|
3566
3580
|
"aria-expanded": A,
|
|
3567
|
-
"aria-disabled":
|
|
3581
|
+
"aria-disabled": u,
|
|
3568
3582
|
"aria-label": b,
|
|
3569
3583
|
"aria-labelledby": s.ariaLabelledBy,
|
|
3570
3584
|
"aria-describedby": s.ariaDescribedBy,
|
|
@@ -3572,7 +3586,7 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3572
3586
|
},
|
|
3573
3587
|
/* @__PURE__ */ o.createElement("span", { className: "k-input-inner" }, /* @__PURE__ */ o.createElement(ft, { item: Q }, Le || v)),
|
|
3574
3588
|
s.loading && /* @__PURE__ */ o.createElement(ke, { className: "k-input-loading-icon", name: "loading" }),
|
|
3575
|
-
oe && !
|
|
3589
|
+
oe && !u && /* @__PURE__ */ o.createElement(
|
|
3576
3590
|
"span",
|
|
3577
3591
|
{
|
|
3578
3592
|
onClick: ut,
|
|
@@ -3639,13 +3653,13 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3639
3653
|
fillMode: Ee
|
|
3640
3654
|
}
|
|
3641
3655
|
),
|
|
3642
|
-
|
|
3656
|
+
p.length > 0 ? /* @__PURE__ */ o.createElement(
|
|
3643
3657
|
Ct,
|
|
3644
3658
|
{
|
|
3645
3659
|
ref: j,
|
|
3646
3660
|
tabIndex: F,
|
|
3647
3661
|
data: Xe,
|
|
3648
|
-
focusIdField:
|
|
3662
|
+
focusIdField: c,
|
|
3649
3663
|
textField: s.textField,
|
|
3650
3664
|
selectField: S,
|
|
3651
3665
|
expandField: s.expandField,
|
|
@@ -3667,7 +3681,7 @@ const ks = (i) => /* @__PURE__ */ o.createElement("div", { className: "k-nodata"
|
|
|
3667
3681
|
editorValue: Le,
|
|
3668
3682
|
editorPlaceholder: v,
|
|
3669
3683
|
editorValid: mt,
|
|
3670
|
-
editorDisabled:
|
|
3684
|
+
editorDisabled: u,
|
|
3671
3685
|
editorId: a,
|
|
3672
3686
|
style: { width: r ? r.width : void 0 },
|
|
3673
3687
|
children: ae,
|
|
@@ -3755,14 +3769,14 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
3755
3769
|
qe(je);
|
|
3756
3770
|
const s = o.useMemo(() => Fe(), []), n = e.id || s, {
|
|
3757
3771
|
data: a = [],
|
|
3758
|
-
dataItemKey:
|
|
3759
|
-
popupSettings:
|
|
3772
|
+
dataItemKey: p,
|
|
3773
|
+
popupSettings: c = {},
|
|
3760
3774
|
style: d = {},
|
|
3761
3775
|
opened: r,
|
|
3762
3776
|
disabled: h,
|
|
3763
|
-
onOpen:
|
|
3764
|
-
onClose:
|
|
3765
|
-
placeholder:
|
|
3777
|
+
onOpen: u = De,
|
|
3778
|
+
onClose: g = De,
|
|
3779
|
+
placeholder: m,
|
|
3766
3780
|
label: v,
|
|
3767
3781
|
name: b,
|
|
3768
3782
|
checkField: w = Re.checkField,
|
|
@@ -3774,7 +3788,7 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
3774
3788
|
value: C,
|
|
3775
3789
|
required: F = Re.required,
|
|
3776
3790
|
validityStyles: x = Re.validityStyles
|
|
3777
|
-
} = e, E = $t(e.tabIndex, h), M = o.useRef(null), K = o.useRef(null), U = o.useRef(null), j = o.useRef(null), Y = o.useRef(null), re = o.useRef(null), we = o.useRef(!1), ne = o.useRef([]), Q = o.useRef(null), [oe, Le] = o.useState(), [P,
|
|
3791
|
+
} = e, E = $t(e.tabIndex, h), M = o.useRef(null), K = o.useRef(null), U = o.useRef(null), j = o.useRef(null), Y = o.useRef(null), re = o.useRef(null), we = o.useRef(!1), ne = o.useRef([]), Q = o.useRef(null), [oe, Le] = o.useState(), [P, H] = o.useState(!1), [L, me] = o.useState(!1), [Ce, Ne] = o.useState(), [Oe, Pe] = o.useState([]), [A, X] = o.useState(""), J = !!(Ce && Ce <= Se && e.adaptive), W = r !== void 0 ? r : P, Ye = !!(Array.isArray(C) && C.length), ue = Ei({ validationMessage: N, valid: O, required: F }, Ye), ve = fs(K, e.dir), Mt = c.width !== void 0 ? c.width : d.width !== void 0 ? d.width : Re.popupSettings.width, ct = {
|
|
3778
3792
|
width: Is(K, Mt),
|
|
3779
3793
|
...ve !== void 0 ? { direction: ve } : {}
|
|
3780
3794
|
}, xe = o.useCallback(() => K.current && K.current.focus(), []);
|
|
@@ -3806,54 +3820,54 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
3806
3820
|
[C, W]
|
|
3807
3821
|
);
|
|
3808
3822
|
const se = o.useCallback(
|
|
3809
|
-
(y, k,
|
|
3823
|
+
(y, k, z) => {
|
|
3810
3824
|
if (e.onChange) {
|
|
3811
3825
|
const ee = {
|
|
3812
3826
|
items: k,
|
|
3813
|
-
operation:
|
|
3827
|
+
operation: z,
|
|
3814
3828
|
...y
|
|
3815
3829
|
};
|
|
3816
3830
|
e.onChange.call(void 0, ee);
|
|
3817
3831
|
}
|
|
3818
3832
|
},
|
|
3819
3833
|
[e.onChange]
|
|
3820
|
-
),
|
|
3834
|
+
), ze = o.useCallback(
|
|
3821
3835
|
(y) => {
|
|
3822
|
-
if (R(y.item, C,
|
|
3836
|
+
if (R(y.item, C, p) || !M.current)
|
|
3823
3837
|
return;
|
|
3824
|
-
const { item: k, nativeEvent:
|
|
3838
|
+
const { item: k, nativeEvent: z, syntheticEvent: ee } = y, ye = {
|
|
3825
3839
|
syntheticEvent: ee,
|
|
3826
|
-
nativeEvent:
|
|
3840
|
+
nativeEvent: z,
|
|
3827
3841
|
target: M.current
|
|
3828
3842
|
};
|
|
3829
3843
|
se(ye, [k], "toggle");
|
|
3830
3844
|
},
|
|
3831
|
-
[C,
|
|
3845
|
+
[C, p, se]
|
|
3832
3846
|
), _e = o.useCallback(
|
|
3833
3847
|
(y) => {
|
|
3834
3848
|
if (!W) {
|
|
3835
|
-
if (
|
|
3849
|
+
if (u) {
|
|
3836
3850
|
const k = { ...y };
|
|
3837
|
-
|
|
3851
|
+
u.call(void 0, k);
|
|
3838
3852
|
}
|
|
3839
|
-
r === void 0 && (
|
|
3853
|
+
r === void 0 && (H(!0), Pe(C || []), J && setTimeout(() => {
|
|
3840
3854
|
var k;
|
|
3841
3855
|
Z((k = j.current) == null ? void 0 : k.element);
|
|
3842
3856
|
}, 300));
|
|
3843
3857
|
}
|
|
3844
3858
|
},
|
|
3845
|
-
[W, r,
|
|
3859
|
+
[W, r, u, J, j]
|
|
3846
3860
|
), q = o.useCallback(
|
|
3847
3861
|
(y) => {
|
|
3848
3862
|
if (W) {
|
|
3849
|
-
if (
|
|
3863
|
+
if (g) {
|
|
3850
3864
|
const k = { ...y };
|
|
3851
|
-
|
|
3865
|
+
g.call(void 0, k);
|
|
3852
3866
|
}
|
|
3853
|
-
r === void 0 &&
|
|
3867
|
+
r === void 0 && H(!1);
|
|
3854
3868
|
}
|
|
3855
3869
|
},
|
|
3856
|
-
[W, r,
|
|
3870
|
+
[W, r, g]
|
|
3857
3871
|
), he = o.useCallback(
|
|
3858
3872
|
(y) => {
|
|
3859
3873
|
we.current = !0, y(), window.setTimeout(() => we.current = !1, 0);
|
|
@@ -3897,13 +3911,13 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
3897
3911
|
target: M.current
|
|
3898
3912
|
};
|
|
3899
3913
|
if (e.onBlur) {
|
|
3900
|
-
const
|
|
3901
|
-
e.onBlur.call(void 0,
|
|
3914
|
+
const z = { ...k };
|
|
3915
|
+
e.onBlur.call(void 0, z);
|
|
3902
3916
|
}
|
|
3903
3917
|
J || q(k);
|
|
3904
3918
|
}
|
|
3905
3919
|
},
|
|
3906
|
-
[L, e.onBlur, W, r,
|
|
3920
|
+
[L, e.onBlur, W, r, g]
|
|
3907
3921
|
), ht = o.useCallback(
|
|
3908
3922
|
() => {
|
|
3909
3923
|
L && he(De);
|
|
@@ -3925,7 +3939,7 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
3925
3939
|
), gt = o.useCallback(
|
|
3926
3940
|
(y) => {
|
|
3927
3941
|
var Ie, ns;
|
|
3928
|
-
const { keyCode: k, altKey:
|
|
3942
|
+
const { keyCode: k, altKey: z } = y, ee = re.current && re.current.element;
|
|
3929
3943
|
if (!M.current || y.isDefaultPrevented() && ((Ie = U.current) == null ? void 0 : Ie.element) === y.target)
|
|
3930
3944
|
return;
|
|
3931
3945
|
const ye = {
|
|
@@ -3933,17 +3947,17 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
3933
3947
|
nativeEvent: y.nativeEvent,
|
|
3934
3948
|
target: M.current
|
|
3935
3949
|
};
|
|
3936
|
-
if (C && C.length > 0 && (k ===
|
|
3950
|
+
if (C && C.length > 0 && (k === f.left || k === f.right || k === f.home || k === f.end || k === f.delete)) {
|
|
3937
3951
|
const te = ne.current;
|
|
3938
|
-
let ce = oe ? te.findIndex((xs) => xt(xs, oe,
|
|
3952
|
+
let ce = oe ? te.findIndex((xs) => xt(xs, oe, p)) : -1, pe;
|
|
3939
3953
|
const Bt = ce !== -1;
|
|
3940
|
-
k ===
|
|
3954
|
+
k === f.left ? (Bt ? ce = Math.max(0, ce - 1) : ce = te.length - 1, pe = te[ce]) : k === f.right ? ce === te.length - 1 ? pe = void 0 : Bt && (ce = Math.min(te.length - 1, ce + 1), pe = te[ce]) : k === f.home ? pe = te[0] : k === f.end ? pe = te[te.length - 1] : k === f.delete && Bt && se(ye, te[ce].data, "delete"), pe !== oe && Le(pe);
|
|
3941
3955
|
}
|
|
3942
3956
|
if (W)
|
|
3943
|
-
if (k ===
|
|
3957
|
+
if (k === f.esc || z && k === f.up)
|
|
3944
3958
|
y.preventDefault(), q(ye);
|
|
3945
|
-
else if (ee && ee.querySelector(".k-focus") && (k ===
|
|
3946
|
-
if (k ===
|
|
3959
|
+
else if (ee && ee.querySelector(".k-focus") && (k === f.up || k === f.down || k === f.left || k === f.right || k === f.home || k === f.end)) {
|
|
3960
|
+
if (k === f.up && ((ns = U.current) != null && ns.element)) {
|
|
3947
3961
|
const te = Array.from(ee.querySelectorAll(".k-treeview-item")), ce = [...te].reverse().find((pe) => !!(pe && pe.querySelector(".k-focus")));
|
|
3948
3962
|
if (ce && te.indexOf(ce) === 0)
|
|
3949
3963
|
return he(() => {
|
|
@@ -3953,19 +3967,19 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
3953
3967
|
}
|
|
3954
3968
|
he(De);
|
|
3955
3969
|
} else
|
|
3956
|
-
k ===
|
|
3970
|
+
k === f.down && he(() => {
|
|
3957
3971
|
var te;
|
|
3958
3972
|
Z(((te = U.current) == null ? void 0 : te.element) || ee);
|
|
3959
3973
|
});
|
|
3960
3974
|
else
|
|
3961
|
-
|
|
3975
|
+
z && k === f.down && (y.preventDefault(), _e(ye));
|
|
3962
3976
|
},
|
|
3963
|
-
[W, q, Z, he, _e, oe,
|
|
3977
|
+
[W, q, Z, he, _e, oe, p, C, se]
|
|
3964
3978
|
), Je = o.useCallback(
|
|
3965
3979
|
(y) => {
|
|
3966
|
-
const { keyCode: k, altKey:
|
|
3967
|
-
|
|
3968
|
-
k ===
|
|
3980
|
+
const { keyCode: k, altKey: z } = y;
|
|
3981
|
+
z || k !== f.up && k !== f.down || (y.preventDefault(), he(
|
|
3982
|
+
k === f.up ? () => {
|
|
3969
3983
|
Z(K.current);
|
|
3970
3984
|
} : () => {
|
|
3971
3985
|
Z(re.current && re.current.element);
|
|
@@ -3987,8 +4001,8 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
3987
4001
|
[se, q]
|
|
3988
4002
|
), Rt = o.useCallback(
|
|
3989
4003
|
(y, k) => {
|
|
3990
|
-
var
|
|
3991
|
-
q({ target: M.current }), L || Z((
|
|
4004
|
+
var z;
|
|
4005
|
+
q({ target: M.current }), L || Z((z = U.current) == null ? void 0 : z.element), se({
|
|
3992
4006
|
syntheticEvent: k,
|
|
3993
4007
|
nativeEvent: k.nativeEvent,
|
|
3994
4008
|
target: M.current
|
|
@@ -3998,8 +4012,8 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
3998
4012
|
), Xe = o.useCallback(
|
|
3999
4013
|
(y) => {
|
|
4000
4014
|
if (e.onExpandChange && M.current) {
|
|
4001
|
-
const { item: k, itemHierarchicalIndex:
|
|
4002
|
-
level: wi(
|
|
4015
|
+
const { item: k, itemHierarchicalIndex: z, nativeEvent: ee, syntheticEvent: ye } = y, Ie = {
|
|
4016
|
+
level: wi(z),
|
|
4003
4017
|
item: k,
|
|
4004
4018
|
nativeEvent: ee,
|
|
4005
4019
|
syntheticEvent: ye,
|
|
@@ -4012,13 +4026,13 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
4012
4026
|
), Ze = o.useCallback(
|
|
4013
4027
|
(y) => {
|
|
4014
4028
|
if (e.onFilterChange && M.current) {
|
|
4015
|
-
const
|
|
4029
|
+
const z = {
|
|
4016
4030
|
filter: { field: e.textField, operator: "contains", value: y.target.value },
|
|
4017
4031
|
syntheticEvent: y.syntheticEvent,
|
|
4018
4032
|
nativeEvent: y.nativeEvent,
|
|
4019
4033
|
target: M.current
|
|
4020
4034
|
};
|
|
4021
|
-
e.onFilterChange.call(void 0,
|
|
4035
|
+
e.onFilterChange.call(void 0, z), e.filter === void 0 && X(y.target.value);
|
|
4022
4036
|
}
|
|
4023
4037
|
},
|
|
4024
4038
|
[e.onFilterChange, e.filter, e.textField]
|
|
@@ -4049,14 +4063,14 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
4049
4063
|
) : null, k = {
|
|
4050
4064
|
adaptiveTitle: e.adaptiveTitle,
|
|
4051
4065
|
expand: W,
|
|
4052
|
-
onClose: (
|
|
4066
|
+
onClose: (z) => e.onCancel ? ft(z) : Qe(z),
|
|
4053
4067
|
windowWidth: Ce,
|
|
4054
4068
|
mobileFilter: y,
|
|
4055
4069
|
footer: {
|
|
4056
4070
|
cancelText: be.toLanguageString(ot, le[ot]),
|
|
4057
|
-
onCancel: (
|
|
4071
|
+
onCancel: (z) => e.onCancel ? ft(z) : Qe(z),
|
|
4058
4072
|
applyText: be.toLanguageString(nt, le[nt]),
|
|
4059
|
-
onApply: (
|
|
4073
|
+
onApply: (z) => q(z)
|
|
4060
4074
|
}
|
|
4061
4075
|
};
|
|
4062
4076
|
return /* @__PURE__ */ o.createElement(es, { ...k }, /* @__PURE__ */ o.createElement(lt, { className: "!k-overflow-hidden" }, /* @__PURE__ */ o.createElement("div", { className: "k-list-container" }, /* @__PURE__ */ o.createElement("div", { className: "k-list k-list-lg" }, a.length > 0 ? /* @__PURE__ */ o.createElement(
|
|
@@ -4065,15 +4079,15 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
4065
4079
|
ref: re,
|
|
4066
4080
|
tabIndex: E,
|
|
4067
4081
|
data: a,
|
|
4068
|
-
focusIdField:
|
|
4082
|
+
focusIdField: p,
|
|
4069
4083
|
textField: e.textField,
|
|
4070
4084
|
checkField: w,
|
|
4071
4085
|
checkIndeterminateField: S,
|
|
4072
4086
|
expandField: e.expandField,
|
|
4073
4087
|
childrenField: D,
|
|
4074
4088
|
expandIcons: !0,
|
|
4075
|
-
onItemClick:
|
|
4076
|
-
onCheckChange:
|
|
4089
|
+
onItemClick: ze,
|
|
4090
|
+
onCheckChange: ze,
|
|
4077
4091
|
onExpandChange: Xe,
|
|
4078
4092
|
checkboxes: !0,
|
|
4079
4093
|
size: ae,
|
|
@@ -4135,10 +4149,10 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
4135
4149
|
onTagDelete: Rt,
|
|
4136
4150
|
data: $,
|
|
4137
4151
|
guid: n,
|
|
4138
|
-
focused: oe ? ne.current.find((y) => xt(y, oe,
|
|
4152
|
+
focused: oe ? ne.current.find((y) => xt(y, oe, p)) : void 0,
|
|
4139
4153
|
size: ae
|
|
4140
4154
|
}
|
|
4141
|
-
) :
|
|
4155
|
+
) : m
|
|
4142
4156
|
),
|
|
4143
4157
|
/* @__PURE__ */ o.createElement("span", { className: "k-input-inner" }, /* @__PURE__ */ o.createElement("span", { className: "k-input-value-text" }, " ")),
|
|
4144
4158
|
e.loading && /* @__PURE__ */ o.createElement(ke, { className: "k-input-loading-icon", name: "loading" }),
|
|
@@ -4164,17 +4178,17 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
4164
4178
|
jt,
|
|
4165
4179
|
{
|
|
4166
4180
|
popupClass: B(
|
|
4167
|
-
|
|
4181
|
+
c.popupClass,
|
|
4168
4182
|
"k-multiselecttree-popup"
|
|
4169
4183
|
),
|
|
4170
|
-
className: B(
|
|
4184
|
+
className: B(c.className, { "k-rtl": ve === "rtl" }),
|
|
4171
4185
|
style: ct,
|
|
4172
|
-
animate:
|
|
4186
|
+
animate: c.animate,
|
|
4173
4187
|
anchor: K.current,
|
|
4174
4188
|
show: W,
|
|
4175
4189
|
onOpen: Ot,
|
|
4176
4190
|
onClose: Pt,
|
|
4177
|
-
appendTo:
|
|
4191
|
+
appendTo: c.appendTo,
|
|
4178
4192
|
ref: Q
|
|
4179
4193
|
},
|
|
4180
4194
|
e.filterable && /* @__PURE__ */ o.createElement(
|
|
@@ -4196,15 +4210,15 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
4196
4210
|
ref: re,
|
|
4197
4211
|
tabIndex: E,
|
|
4198
4212
|
data: a,
|
|
4199
|
-
focusIdField:
|
|
4213
|
+
focusIdField: p,
|
|
4200
4214
|
textField: e.textField,
|
|
4201
4215
|
checkField: w,
|
|
4202
4216
|
checkIndeterminateField: S,
|
|
4203
4217
|
expandField: e.expandField,
|
|
4204
4218
|
childrenField: D,
|
|
4205
4219
|
expandIcons: !0,
|
|
4206
|
-
onItemClick:
|
|
4207
|
-
onCheckChange:
|
|
4220
|
+
onItemClick: ze,
|
|
4221
|
+
onCheckChange: ze,
|
|
4208
4222
|
onExpandChange: Xe,
|
|
4209
4223
|
checkboxes: !0,
|
|
4210
4224
|
size: ae,
|
|
@@ -4219,7 +4233,7 @@ const xi = "Please select a value from the list!", { sizeMap: us, roundedMap: Si
|
|
|
4219
4233
|
{
|
|
4220
4234
|
label: v,
|
|
4221
4235
|
editorValue: Ye,
|
|
4222
|
-
editorPlaceholder:
|
|
4236
|
+
editorPlaceholder: m,
|
|
4223
4237
|
editorValid: Ee,
|
|
4224
4238
|
editorDisabled: h,
|
|
4225
4239
|
editorId: n,
|
|
@@ -4300,50 +4314,50 @@ const tt = (i, t) => {
|
|
|
4300
4314
|
dataItemKey: s,
|
|
4301
4315
|
value: n,
|
|
4302
4316
|
subItemsField: a = "items",
|
|
4303
|
-
operation:
|
|
4304
|
-
} = t,
|
|
4305
|
-
if (
|
|
4317
|
+
operation: p
|
|
4318
|
+
} = t, c = kt(s), d = tt(n, c);
|
|
4319
|
+
if (p === "clear")
|
|
4306
4320
|
return [];
|
|
4307
|
-
if (
|
|
4308
|
-
const O = tt(e,
|
|
4309
|
-
return n.filter((_) => !O[
|
|
4321
|
+
if (p === "delete") {
|
|
4322
|
+
const O = tt(e, c);
|
|
4323
|
+
return n.filter((_) => !O[c(_)]);
|
|
4310
4324
|
}
|
|
4311
|
-
const r = e[0], h =
|
|
4325
|
+
const r = e[0], h = c(r), u = kt(a), g = [...i], m = [];
|
|
4312
4326
|
let v = [], b;
|
|
4313
|
-
for (;
|
|
4314
|
-
const O =
|
|
4315
|
-
if (h ===
|
|
4316
|
-
v =
|
|
4327
|
+
for (; g.length; ) {
|
|
4328
|
+
const O = g.pop();
|
|
4329
|
+
if (h === c(O)) {
|
|
4330
|
+
v = m.map((_) => _.item), b = O;
|
|
4317
4331
|
break;
|
|
4318
4332
|
} else {
|
|
4319
|
-
|
|
4320
|
-
const _ =
|
|
4321
|
-
_ && _.length && (
|
|
4333
|
+
m && m.length && m[m.length - 1].parentPosition === g.length && m.pop();
|
|
4334
|
+
const _ = u(O);
|
|
4335
|
+
_ && _.length && (m.push({ item: O, parentPosition: g.length }), g.push(..._));
|
|
4322
4336
|
}
|
|
4323
4337
|
}
|
|
4324
|
-
const w = [...
|
|
4338
|
+
const w = [...u(b) || []];
|
|
4325
4339
|
let S = [];
|
|
4326
4340
|
for (; w.length; ) {
|
|
4327
4341
|
const O = w.pop();
|
|
4328
4342
|
S.push(O);
|
|
4329
|
-
const _ =
|
|
4343
|
+
const _ = u(O);
|
|
4330
4344
|
_ && _.length && w.push(..._);
|
|
4331
4345
|
}
|
|
4332
4346
|
const D = !d[h], N = [];
|
|
4333
4347
|
if (D) {
|
|
4334
|
-
N.push(...n), N.push(b), N.push(...S.filter((C) => !d[
|
|
4335
|
-
const O = v.filter((C) => !d[
|
|
4348
|
+
N.push(...n), N.push(b), N.push(...S.filter((C) => !d[c(C)]));
|
|
4349
|
+
const O = v.filter((C) => !d[c(C)]), _ = tt(N, c);
|
|
4336
4350
|
for (let C = O.length - 1; C > -1; C--) {
|
|
4337
|
-
const F = O[C], x =
|
|
4338
|
-
if (x.filter((M) => _[
|
|
4351
|
+
const F = O[C], x = u(F);
|
|
4352
|
+
if (x.filter((M) => _[c(M)]).length < x.length)
|
|
4339
4353
|
break;
|
|
4340
|
-
N.push(F), _[
|
|
4354
|
+
N.push(F), _[c(F)] = !0;
|
|
4341
4355
|
}
|
|
4342
4356
|
} else {
|
|
4343
|
-
const O =
|
|
4357
|
+
const O = c(b), _ = tt(S, c), C = tt(v, c);
|
|
4344
4358
|
N.push(
|
|
4345
4359
|
...n.filter((F) => {
|
|
4346
|
-
const x =
|
|
4360
|
+
const x = c(F);
|
|
4347
4361
|
return !_[x] && O !== x && !C[x];
|
|
4348
4362
|
})
|
|
4349
4363
|
);
|