@progress/kendo-react-dropdowns 13.4.0-develop.4 → 14.0.0-develop.1

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.
@@ -7,124 +7,139 @@
7
7
  */
8
8
  import * as g from "react";
9
9
  import v from "prop-types";
10
- import { withIdHOC as J, createPropsContext as Q, withPropsContext as X, withAdaptiveModeContext as Z, Keys as u, classNames as S, kendoThemeMaps as ee, IconWrap as B, WatermarkOverlay as te, getLicenseMessage as se, canUseDOM as V, validatePackage as ie } from "@progress/kendo-react-common";
11
- import { plusIcon as oe } from "@progress/kendo-svg-icons";
12
- import { FloatingLabel as ae } from "@progress/kendo-react-labels";
13
- import ne from "../common/ListContainer.mjs";
14
- import le from "../common/List.mjs";
15
- import de from "../common/GroupStickyHeader.mjs";
16
- import re from "./TagList.mjs";
17
- import he from "../common/SearchBar.mjs";
10
+ import { withIdHOC as J, createPropsContext as Q, withPropsContext as X, withAdaptiveModeContext as Z, Keys as u, classNames as S, kendoThemeMaps as tt, IconWrap as B, WatermarkOverlay as et, getLicenseMessage as st, canUseDOM as V, validatePackage as it, subscribeToKendoPaste as ot } from "@progress/kendo-react-common";
11
+ import { plusIcon as at } from "@progress/kendo-svg-icons";
12
+ import { FloatingLabel as nt } from "@progress/kendo-react-labels";
13
+ import lt from "../common/ListContainer.mjs";
14
+ import dt from "../common/List.mjs";
15
+ import rt from "../common/GroupStickyHeader.mjs";
16
+ import ht from "./TagList.mjs";
17
+ import pt from "../common/SearchBar.mjs";
18
18
  import O from "../common/DropDownBase.mjs";
19
19
  import { ActiveDescendant as w } from "../common/settings.mjs";
20
- import { getFilteredData as x, areSame as P, removeDataItems as D, isPresent as _, getItemValue as K, preventDefaultNonInputs as pe, matchTags as z, itemIndexStartsWith as ce } from "../common/utils.mjs";
20
+ import { getFilteredData as x, getItemIndexByText as ct, areSame as D, removeDataItems as P, isPresent as K, getItemValue as _, preventDefaultNonInputs as ut, matchTags as z, itemIndexStartsWith as ft } from "../common/utils.mjs";
21
21
  import { packageMetadata as A } from "../package-metadata.mjs";
22
- import ue from "../common/ClearButton.mjs";
23
- import { AdaptiveMode as fe } from "../common/AdaptiveMode.mjs";
24
- import { ActionSheetContent as ge } from "@progress/kendo-react-layout";
25
- import me from "../common/ListFilter.mjs";
22
+ import gt from "../common/ClearButton.mjs";
23
+ import { AdaptiveMode as mt } from "../common/AdaptiveMode.mjs";
24
+ import { ActionSheetContent as vt } from "@progress/kendo-react-layout";
25
+ import bt from "../common/ListFilter.mjs";
26
26
  import H from "../common/withCustomComponent.mjs";
27
- const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W = (E) => E.preventDefault(), $ = (E) => E === 2, C = class C extends g.Component {
28
- constructor(n) {
29
- super(n), this.state = {
27
+ const { sizeMap: M, roundedMap: It } = tt, yt = "Please enter a valid value!", W = (E) => E.preventDefault(), $ = (E) => E === 2, C = class C extends g.Component {
28
+ constructor(l) {
29
+ super(l), this.state = {
30
30
  activedescendant: w.PopupList,
31
31
  currentValue: []
32
32
  }, this._element = null, this._valueItemsDuringOnChange = null, this.base = new O(this), this._tags = [], this._input = null, this._adaptiveInput = null, this._skipFocusEvent = !1, this._lastSelectedOrDeslectedItemIndex = null, this.itemHeight = 0, this.scrollToFocused = !1, this.showLicenseWatermark = !1, this.focus = () => {
33
33
  this._input && this._input.focus();
34
- }, this.handleItemSelect = (e, t) => {
35
- const { dataItemKey: o, virtual: s } = this.props, a = x(this.props), i = s ? s.skip : 0, p = a[e - i], r = this.value.findIndex((h) => P(h, p, o));
36
- this._lastSelectedOrDeslectedItemIndex = a.findIndex((h) => P(h, p, o));
34
+ }, this.handleKendoPasteValue = (t) => {
35
+ if (t == null)
36
+ return;
37
+ const e = x(this.props), { textField: o, dataItemKey: s } = this.props, a = String(t).split(",").map((h) => h.trim()).filter((h) => h).reduce((h, r) => {
38
+ const d = ct(e, r, o, !1, !0);
39
+ if (d !== -1) {
40
+ const n = e[d];
41
+ h.some((p) => D(p, n, s)) || h.push(n);
42
+ }
43
+ return h;
44
+ }, []);
45
+ if (a.length === 0)
46
+ return;
47
+ const i = this.base.initState();
48
+ i.syntheticEvent = { target: this._element }, this.triggerOnChange(a, i), this.applyState(i);
49
+ }, this.handleItemSelect = (t, e) => {
50
+ const { dataItemKey: o, virtual: s } = this.props, a = x(this.props), i = s ? s.skip : 0, h = a[t - i], r = this.value.findIndex((p) => D(p, h, o));
51
+ this._lastSelectedOrDeslectedItemIndex = a.findIndex((p) => D(p, h, o));
37
52
  let d = [];
38
- r !== -1 ? (d = this.value, d.splice(r, 1)) : d = [...this.value, p], (this.props.filter !== void 0 ? this.props.filter : this.state.text) && !this.mobileMode && (this.state.text && (t.data.text = ""), this.base.filterChanged("", t)), this._adaptiveInput && this._adaptiveInput.blur(), this.state.focusedIndex !== void 0 && (t.data.focusedIndex = void 0), this.triggerOnChange(d, t), this.base.triggerPageChangeCornerItems(p, t);
39
- }, this.onTagDelete = (e, t) => {
53
+ r !== -1 ? (d = this.value, d.splice(r, 1)) : d = [...this.value, h], (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(d, e), this.base.triggerPageChangeCornerItems(h, e);
54
+ }, this.onTagDelete = (t, e) => {
40
55
  const o = this.base.initState();
41
- o.syntheticEvent = t, this.opened && this.base.togglePopup(o), !this.state.focused && !this.mobileMode && (o.data.focused = !0, this.focus());
56
+ o.syntheticEvent = e, this.opened && this.base.togglePopup(o), !this.state.focused && !this.mobileMode && (o.data.focused = !0, this.focus());
42
57
  const s = this.value;
43
- D(s, e, this.props.dataItemKey), this.triggerOnChange(s, o), this.applyState(o);
44
- }, this.itemFocus = (e, t) => {
45
- const { allowCustom: o, virtual: s } = this.props, a = x(this.props), i = s ? s.skip : 0, p = s ? s.pageSize : 0, r = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedIndex: d } = this.getFocusedState(), l = o && r, h = a[e - i];
46
- if (s && !h && e >= 0 && d !== e) {
47
- const f = Math.floor(e / p) * p;
58
+ P(s, t, this.props.dataItemKey), this.triggerOnChange(s, o), this.applyState(o);
59
+ }, this.itemFocus = (t, e) => {
60
+ const { allowCustom: o, virtual: s } = this.props, a = x(this.props), i = s ? s.skip : 0, h = s ? s.pageSize : 0, r = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedIndex: d } = this.getFocusedState(), n = o && r, p = a[t - i];
61
+ if (s && !p && t >= 0 && d !== t) {
62
+ const f = Math.floor(t / h) * h;
48
63
  if (f !== i) {
49
- this.state.focusedIndex !== e && (t.data.focusedIndex = e, t.data.activedescendant = w.PopupList), this.base.triggerOnPageChange(t, f, p);
64
+ this.state.focusedIndex !== t && (e.data.focusedIndex = t, e.data.activedescendant = w.PopupList), this.base.triggerOnPageChange(e, f, h);
50
65
  return;
51
66
  }
52
67
  }
53
- h && d !== e ? this.state.focusedIndex !== e && (t.data.focusedIndex = e, t.data.activedescendant = w.PopupList) : l && e === -1 && this.state.focusedIndex !== void 0 && (t.data.focusedIndex = void 0), this.base.triggerPageChangeCornerItems(h, t);
54
- }, this.componentRef = (e) => {
55
- this._element = e, this.base.wrapper = e;
56
- }, this.searchbarRef = (e) => {
57
- const t = this._input = e && e.input;
58
- t && this.state.focused && window.setTimeout(() => t.focus(), 0);
59
- }, this.onChangeHandler = (e) => {
60
- const t = this.base.initState(), o = e.target.value;
61
- t.syntheticEvent = e, this.props.filter === void 0 && (t.data.text = o), t.data.focusedIndex = void 0, this.opened ? this.scrollToFocused = !0 : (this.base.togglePopup(t), this.setState({ currentValue: this.value })), this.base.filterChanged(o, t), this.applyState(t), this.setState({ group: void 0 });
62
- }, this.clearButtonClick = (e) => {
63
- const t = this.base.initState();
64
- t.syntheticEvent = e, e.stopPropagation(), this.value.length > 0 && this.triggerOnChange([], t), this.state.focusedIndex !== void 0 && (t.data.focusedIndex = void 0), this.opened && this.base.togglePopup(t);
68
+ p && d !== t ? this.state.focusedIndex !== t && (e.data.focusedIndex = t, e.data.activedescendant = w.PopupList) : n && t === -1 && this.state.focusedIndex !== void 0 && (e.data.focusedIndex = void 0), this.base.triggerPageChangeCornerItems(p, e);
69
+ }, this.componentRef = (t) => {
70
+ this._element = t, this.base.wrapper = t;
71
+ }, this.searchbarRef = (t) => {
72
+ const e = this._input = t && t.input;
73
+ e && this.state.focused && window.setTimeout(() => e.focus(), 0);
74
+ }, this.onChangeHandler = (t) => {
75
+ const e = this.base.initState(), o = t.target.value;
76
+ e.syntheticEvent = t, this.props.filter === void 0 && (e.data.text = o), e.data.focusedIndex = void 0, this.opened ? this.scrollToFocused = !0 : (this.base.togglePopup(e), this.setState({ currentValue: this.value })), this.base.filterChanged(o, e), this.applyState(e), this.setState({ group: void 0 });
77
+ }, this.clearButtonClick = (t) => {
78
+ const e = this.base.initState();
79
+ e.syntheticEvent = t, t.stopPropagation(), this.value.length > 0 && this.triggerOnChange([], e), this.state.focusedIndex !== void 0 && (e.data.focusedIndex = void 0), this.opened && this.base.togglePopup(e);
65
80
  const o = this.props.filter !== void 0 ? this.props.filter : this.state.text;
66
- _(o) && o !== "" && this.base.filterChanged("", t), this.state.text && (t.data.text = ""), this._lastSelectedOrDeslectedItemIndex = null, this.applyState(t);
67
- }, this.onInputKeyDown = (e) => {
68
- const { textField: t, groupField: o, virtual: s } = this.props, a = x(this.props), i = e.keyCode, p = this.props.filter !== void 0 ? this.props.filter : this.state.text, r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { focusedItem: d, focusedIndex: l } = this.getFocusedState(), h = this.base.initState();
69
- if (h.syntheticEvent = e, !p && this.value.length > 0 && (i === u.left || i === u.right || i === u.home || i === u.end || i === u.delete || i === u.backspace) && !e.shiftKey)
70
- return this.onTagsNavigate(e, h);
81
+ K(o) && o !== "" && this.base.filterChanged("", e), this.state.text && (e.data.text = ""), this._lastSelectedOrDeslectedItemIndex = null, this.applyState(e);
82
+ }, this.onInputKeyDown = (t) => {
83
+ const { textField: e, groupField: o, virtual: s } = this.props, a = x(this.props), i = t.keyCode, h = this.props.filter !== void 0 ? this.props.filter : this.state.text, r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { focusedItem: d, focusedIndex: n } = this.getFocusedState(), p = this.base.initState();
84
+ if (p.syntheticEvent = t, !h && this.value.length > 0 && (i === u.left || i === u.right || i === u.home || i === u.end || i === u.delete || i === u.backspace) && !t.shiftKey)
85
+ return this.onTagsNavigate(t, p);
71
86
  const f = () => {
72
- e.preventDefault(), this.base.togglePopup(h), this.applyState(h);
87
+ t.preventDefault(), this.base.togglePopup(p), this.applyState(p);
73
88
  };
74
89
  if (this.opened)
75
90
  if (i === u.pageUp)
76
- e.preventDefault(), this.base.scrollPopupByPageSize(-1);
91
+ t.preventDefault(), this.base.scrollPopupByPageSize(-1);
77
92
  else if (i === u.pageDown)
78
- e.preventDefault(), this.base.scrollPopupByPageSize(1);
79
- else if ((e.ctrlKey || e.metaKey) && e.code === "KeyA") {
93
+ t.preventDefault(), this.base.scrollPopupByPageSize(1);
94
+ else if ((t.ctrlKey || t.metaKey) && t.code === "KeyA") {
80
95
  const b = (this.state.value && this.state.value.length) === a.length ? [] : a;
81
- this.updateStateOnKeyboardNavigation(b, h);
82
- } else if ((e.ctrlKey || e.metaKey) && e.shiftKey && e.keyCode === u.end) {
96
+ this.updateStateOnKeyboardNavigation(b, p);
97
+ } else if ((t.ctrlKey || t.metaKey) && t.shiftKey && t.keyCode === u.end) {
83
98
  const c = a.slice(this.getFocusedState().focusedIndex);
84
- this.itemFocus(a.length - 1, h), this.updateStateOnKeyboardNavigation(c, h);
85
- } else if ((e.ctrlKey || e.metaKey) && e.shiftKey && e.keyCode === u.home) {
99
+ this.itemFocus(a.length - 1, p), this.updateStateOnKeyboardNavigation(c, p);
100
+ } else if ((t.ctrlKey || t.metaKey) && t.shiftKey && t.keyCode === u.home) {
86
101
  const c = a.slice(0, this.getFocusedState().focusedIndex + 1);
87
- this.itemFocus(0, h), this.updateStateOnKeyboardNavigation(c, h);
88
- } else if (e.shiftKey && e.keyCode === u.up) {
102
+ this.itemFocus(0, p), this.updateStateOnKeyboardNavigation(c, p);
103
+ } else if (t.shiftKey && t.keyCode === u.up) {
89
104
  let c;
90
- const b = this.getLastSelectedOrDeselectedIndex(1, l);
91
- b === null ? c = l !== 0 ? a.slice(l - 1, l) : [a[l]] : b === l ? c = [a[b - 1]] : l >= 0 && (c = b > l ? a.slice(l - 1, b) : a.slice(b - 1, l)), c && c.length > 0 && (l >= 1 && this.itemFocus(l - 1, h), this.updateStateOnKeyboardNavigation(c, h));
92
- } else if (e.shiftKey && e.keyCode === u.down) {
105
+ const b = this.getLastSelectedOrDeselectedIndex(1, n);
106
+ b === null ? c = n !== 0 ? a.slice(n - 1, n) : [a[n]] : b === n ? c = [a[b - 1]] : n >= 0 && (c = b > n ? a.slice(n - 1, b) : a.slice(b - 1, n)), c && c.length > 0 && (n >= 1 && this.itemFocus(n - 1, p), this.updateStateOnKeyboardNavigation(c, p));
107
+ } else if (t.shiftKey && t.keyCode === u.down) {
93
108
  let c;
94
- const b = this.getLastSelectedOrDeselectedIndex(0, l);
95
- b === null ? c = l !== a.length - 1 ? a.slice(l, l + 1) : [a[l]] : b === l ? c = a.slice(l, l + 2) : l >= 0 && (c = b > l ? a.slice(l + 1, b + 1) : a.slice(b, l + 2)), c && c.length >= 1 && (this.itemFocus(l + 1, h), this.updateStateOnKeyboardNavigation(c, h));
96
- } else if (e.altKey && i === u.up)
109
+ const b = this.getLastSelectedOrDeselectedIndex(0, n);
110
+ b === null ? c = n !== a.length - 1 ? a.slice(n, n + 1) : [a[n]] : b === n ? c = a.slice(n, n + 2) : n >= 0 && (c = b > n ? a.slice(n + 1, b + 1) : a.slice(b, n + 2)), c && c.length >= 1 && (this.itemFocus(n + 1, p), this.updateStateOnKeyboardNavigation(c, p));
111
+ } else if (t.altKey && i === u.up)
97
112
  f();
98
113
  else if (i === u.up || i === u.down) {
99
- const c = s ? s.skip : 0, b = l - c;
100
- if (o !== "" && t)
114
+ const c = s ? s.skip : 0, b = n - c;
115
+ if (o !== "" && e)
101
116
  if (!this.props.skipDisabledItems && r)
102
- this.onNavigate(h, i);
117
+ this.onNavigate(p, i);
103
118
  else {
104
119
  let m = 0;
105
120
  if (i === u.down || i === u.right) {
106
- const y = a.slice(b + 1).find((I) => !I.disabled && I[t]);
107
- m = y && a.findIndex((I) => I[t] === y[t]), m && m !== -1 && (m = m + c);
121
+ const y = a.slice(b + 1).find((I) => !I.disabled && I[e]);
122
+ m = y && a.findIndex((I) => I[e] === y[e]), m && m !== -1 && (m = m + c);
108
123
  } else if (i === u.up || i === u.left) {
109
124
  let y;
110
- if (l === -1)
111
- y = a, m = a.findIndex((I) => !I.disabled && I[t]), m !== -1 && (m = m + c);
125
+ if (n === -1)
126
+ y = a, m = a.findIndex((I) => !I.disabled && I[e]), m !== -1 && (m = m + c);
112
127
  else {
113
128
  y = a.slice(0, b);
114
129
  let I = y.pop();
115
130
  for (; I && I.disabled; )
116
131
  I = y.pop();
117
- m = I && a.findIndex((T) => T[t] === I[t]), m && m !== -1 && (m = m + c);
132
+ m = I && a.findIndex((T) => T[e] === I[e]), m && m !== -1 && (m = m + c);
118
133
  }
119
134
  }
120
135
  if (m) {
121
- const y = m - l;
122
- this.onNavigate(h, i, y);
136
+ const y = m - n;
137
+ this.onNavigate(p, i, y);
123
138
  } else
124
- this.onNavigate(h, i);
139
+ this.onNavigate(p, i);
125
140
  }
126
141
  else if (!this.props.skipDisabledItems && r)
127
- this.onNavigate(h, i);
142
+ this.onNavigate(p, i);
128
143
  else {
129
144
  let m = null;
130
145
  if (i === u.down || i === u.right)
@@ -137,18 +152,18 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
137
152
  if (m) {
138
153
  const y = a.indexOf(m);
139
154
  if (y !== -1) {
140
- const I = c + y - l;
141
- this.onNavigate(h, i, I);
155
+ const I = c + y - n;
156
+ this.onNavigate(p, i, I);
142
157
  } else
143
- this.onNavigate(h, i);
158
+ this.onNavigate(p, i);
144
159
  } else
145
- this.onNavigate(h, i);
160
+ this.onNavigate(p, i);
146
161
  }
147
- this.applyState(h), e.preventDefault();
148
- } else i === u.enter ? (e.preventDefault(), this.props.allowCustom && p && d === null ? this.customItemSelect(e) : d && d.disabled ? f() : this.selectFocusedItem(e)) : i === u.esc && f();
149
- else e.altKey && i === u.down ? f() : i === u.esc && this.clearButtonClick(e);
162
+ this.applyState(p), t.preventDefault();
163
+ } else i === u.enter ? (t.preventDefault(), this.props.allowCustom && h && d === null ? this.customItemSelect(t) : d && d.disabled ? f() : this.selectFocusedItem(t)) : i === u.esc && f();
164
+ else t.altKey && i === u.down ? f() : i === u.esc && this.clearButtonClick(t);
150
165
  }, this.listContainerContent = () => {
151
- const { header: e, footer: t, allowCustom: o, size: s, groupStickyHeaderItemRender: a, groupField: i, list: p } = this.props, r = x(this.props), d = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedType: l } = this.getFocusedState(), h = o && d && /* @__PURE__ */ g.createElement(
166
+ const { header: t, footer: e, allowCustom: o, size: s, groupStickyHeaderItemRender: a, groupField: i, list: h } = this.props, r = x(this.props), d = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedType: n } = this.getFocusedState(), p = o && d && /* @__PURE__ */ g.createElement(
152
167
  "div",
153
168
  {
154
169
  className: S("k-list", {
@@ -161,15 +176,15 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
161
176
  /* @__PURE__ */ g.createElement(
162
177
  "div",
163
178
  {
164
- className: S("k-list-item k-custom-item", { "k-focus": $(l) }),
179
+ className: S("k-list-item k-custom-item", { "k-focus": $(n) }),
165
180
  style: { fontStyle: "italic" }
166
181
  },
167
182
  d,
168
- /* @__PURE__ */ g.createElement(B, { name: "plus", icon: oe, style: { position: "absolute", right: "0.5em" } })
183
+ /* @__PURE__ */ g.createElement(B, { name: "plus", icon: at, style: { position: "absolute", right: "0.5em" } })
169
184
  )
170
185
  );
171
186
  let { group: f } = this.state;
172
- return f === void 0 && i !== void 0 && (f = K(r[0], i)), /* @__PURE__ */ g.createElement(g.Fragment, null, e && /* @__PURE__ */ g.createElement("div", { className: "k-list-header" }, e), h, /* @__PURE__ */ g.createElement(
187
+ return f === void 0 && i !== void 0 && (f = _(r[0], i)), /* @__PURE__ */ g.createElement(g.Fragment, null, t && /* @__PURE__ */ g.createElement("div", { className: "k-list-header" }, t), p, /* @__PURE__ */ g.createElement(
173
188
  "div",
174
189
  {
175
190
  className: S("k-list", {
@@ -177,12 +192,12 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
177
192
  "k-virtual-list": this.base.vs.enabled
178
193
  })
179
194
  },
180
- !p && f && r.length !== 0 && /* @__PURE__ */ g.createElement(de, { group: f, render: a }),
195
+ !h && f && r.length !== 0 && /* @__PURE__ */ g.createElement(rt, { group: f, render: a }),
181
196
  this.renderList()
182
- ), this.showLicenseWatermark && /* @__PURE__ */ g.createElement(te, { message: this.licenseMessage }), t && /* @__PURE__ */ g.createElement("div", { className: "k-list-footer" }, t));
197
+ ), this.showLicenseWatermark && /* @__PURE__ */ g.createElement(et, { message: this.licenseMessage }), e && /* @__PURE__ */ g.createElement("div", { className: "k-list-footer" }, e));
183
198
  }, this.renderListContainer = () => {
184
- const e = this.base, { dir: t } = this.props, o = x(this.props), s = this.base.getPopupSettings(), a = s.width !== void 0 ? s.width : e.popupWidth, i = {
185
- dir: t !== void 0 ? t : e.dirCalculated,
199
+ const t = this.base, { dir: e } = this.props, o = x(this.props), s = this.base.getPopupSettings(), a = s.width !== void 0 ? s.width : t.popupWidth, i = {
200
+ dir: e !== void 0 ? e : t.dirCalculated,
186
201
  width: a,
187
202
  popupSettings: {
188
203
  ...s,
@@ -194,10 +209,10 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
194
209
  },
195
210
  itemsCount: [o.length, this.value.length]
196
211
  };
197
- return /* @__PURE__ */ g.createElement(ne, { ...i }, this.listContainerContent());
212
+ return /* @__PURE__ */ g.createElement(lt, { ...i }, this.listContainerContent());
198
213
  }, this.renderAdaptiveListContainer = () => {
199
- const { adaptiveTitle: e, adaptiveSubtitle: t, filterable: o, filter: s } = this.props, { windowWidth: a = 0 } = this.state, i = s !== void 0 ? s : this.state.text, p = o ? /* @__PURE__ */ g.createElement(
200
- me,
214
+ const { adaptiveTitle: t, adaptiveSubtitle: e, filterable: o, filter: s } = this.props, { windowWidth: a = 0 } = this.state, i = s !== void 0 ? s : this.state.text, h = o ? /* @__PURE__ */ g.createElement(
215
+ bt,
201
216
  {
202
217
  value: i,
203
218
  ref: (d) => {
@@ -211,57 +226,57 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
211
226
  placeholder: this.props.placeholder
212
227
  }
213
228
  ) : null, r = {
214
- title: e || this.props.label,
215
- subTitle: t,
229
+ title: t || this.props.label,
230
+ subTitle: e,
216
231
  expand: this.opened,
217
232
  onClose: (d) => this.closePopup(d),
218
233
  windowWidth: a,
219
- mobileFilter: p
234
+ mobileFilter: h
220
235
  };
221
- return /* @__PURE__ */ g.createElement(fe, { ...r }, /* @__PURE__ */ g.createElement(ge, null, /* @__PURE__ */ g.createElement("div", { className: "k-list-container" }, this.listContainerContent())));
222
- }, this.closePopup = (e) => {
223
- const t = this.base.initState();
224
- t.syntheticEvent = e, e.stopPropagation(), this.state.focusedIndex !== void 0 && (t.data.focusedIndex = void 0), this.opened && this.base.togglePopup(t), t.events.push({ type: "onClose" });
236
+ return /* @__PURE__ */ g.createElement(mt, { ...r }, /* @__PURE__ */ g.createElement(vt, null, /* @__PURE__ */ g.createElement("div", { className: "k-list-container" }, this.listContainerContent())));
237
+ }, this.closePopup = (t) => {
238
+ const e = this.base.initState();
239
+ 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" });
225
240
  const o = this.props.filter !== void 0 ? this.props.filter : this.state.text;
226
- _(o) && o !== "" && this.base.filterChanged("", t), this.state.text && (t.data.text = ""), this.applyState(t);
227
- }, this.onCancel = (e) => {
228
- const t = this.base.initState();
229
- t.syntheticEvent = e, e.stopPropagation(), this.state.focusedIndex !== void 0 && (t.data.focusedIndex = void 0), this.opened && this.base.togglePopup(t), t.events.push({ type: "onCancel" });
241
+ K(o) && o !== "" && this.base.filterChanged("", e), this.state.text && (e.data.text = ""), this.applyState(e);
242
+ }, this.onCancel = (t) => {
243
+ const e = this.base.initState();
244
+ 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: "onCancel" });
230
245
  const o = this.props.filter !== void 0 ? this.props.filter : this.state.text;
231
- _(o) && o !== "" && this.base.filterChanged("", t), this.state.text && (t.data.text = ""), this.applyState(t);
246
+ K(o) && o !== "" && this.base.filterChanged("", e), this.state.text && (e.data.text = ""), this.applyState(e);
232
247
  }, this.renderList = () => {
233
248
  const {
234
- textField: e,
235
- listNoDataRender: t,
249
+ textField: t,
250
+ listNoDataRender: e,
236
251
  itemRender: o,
237
252
  groupHeaderItemRender: s,
238
253
  dataItemKey: a,
239
254
  virtual: i = { skip: 0, total: void 0 }
240
- } = this.props, p = x(this.props), r = this.base.vs, { focusedIndex: d } = this.getFocusedState(), l = this.base.getPopupSettings(), h = `translateY(${r.translate}px)`;
255
+ } = this.props, h = x(this.props), r = this.base.vs, { focusedIndex: d } = this.getFocusedState(), n = this.base.getPopupSettings(), p = `translateY(${r.translate}px)`;
241
256
  return /* @__PURE__ */ g.createElement(
242
- le,
257
+ dt,
243
258
  {
244
259
  id: this.base.listBoxId,
245
260
  show: this.opened,
246
- data: p.slice(),
261
+ data: h.slice(),
247
262
  focusedIndex: d - i.skip,
248
263
  value: this.value,
249
- textField: e,
264
+ textField: t,
250
265
  valueField: a,
251
266
  optionsGuid: this.base.guid,
252
267
  groupField: this.props.groupField,
253
268
  listRef: (f) => {
254
269
  r.list = this.base.list = f;
255
270
  },
256
- wrapperStyle: this.mobileMode ? {} : { maxHeight: l.height },
271
+ wrapperStyle: this.mobileMode ? {} : { maxHeight: n.height },
257
272
  wrapperCssClass: "k-list-content",
258
- listStyle: r.enabled ? { transform: h } : void 0,
273
+ listStyle: r.enabled ? { transform: p } : void 0,
259
274
  key: "listKey",
260
275
  skip: i.skip,
261
276
  onClick: this.handleItemClick,
262
277
  itemRender: o,
263
278
  groupHeaderItemRender: s,
264
- noDataRender: t,
279
+ noDataRender: e,
265
280
  onMouseDown: W,
266
281
  onBlur: this.handleBlur,
267
282
  onScroll: this.onScroll,
@@ -270,46 +285,46 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
270
285
  ariaSetSize: i.total
271
286
  }
272
287
  );
273
- }, this.onScroll = (e) => {
274
- const { vs: t, list: o } = this.base;
275
- t.scrollHandler(e);
288
+ }, this.onScroll = (t) => {
289
+ const { vs: e, list: o } = this.base;
290
+ e.scrollHandler(t);
276
291
  const { groupField: s } = this.props;
277
292
  let a = x(this.props);
278
293
  if (!(!s || !a.length) && s) {
279
- const i = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight : o ? o.children[0].offsetHeight : 0), r = e.target.scrollTop - t.skip * i;
294
+ const i = this.itemHeight = this.itemHeight || (e.enabled ? e.itemHeight : o ? o.children[0].offsetHeight : 0), r = t.target.scrollTop - e.skip * i;
280
295
  a = this.base.getGroupedDataModernMode(a, s);
281
296
  let d = a[0][s];
282
- for (let l = 1; l < a.length && !(i * l > r); l++)
283
- a[l] && a[l][s] && (d = a[l][s]);
297
+ for (let n = 1; n < a.length && !(i * n > r); n++)
298
+ a[n] && a[n][s] && (d = a[n][s]);
284
299
  d !== this.state.group && this.setState({
285
300
  group: d
286
301
  });
287
302
  }
288
- }, this.customItemSelect = (e) => {
289
- const t = this.props.filter !== void 0 ? this.props.filter : this.state.text, { textField: o } = this.props;
290
- if (!t)
303
+ }, this.customItemSelect = (t) => {
304
+ const e = this.props.filter !== void 0 ? this.props.filter : this.state.text, { textField: o } = this.props;
305
+ if (!e)
291
306
  return;
292
307
  const s = this.base.initState();
293
- s.syntheticEvent = e;
294
- const a = o ? { [o]: t } : t;
308
+ s.syntheticEvent = t;
309
+ const a = o ? { [o]: e } : e;
295
310
  this.state.text !== void 0 && (s.data.text = ""), s.data.focusedIndex = void 0, this.base.filterChanged("", s);
296
311
  const i = [...this.value, a];
297
312
  this.triggerOnChange(i, s), this.base.togglePopup(s), this.applyState(s);
298
- }, this.handleWrapperClick = (e) => {
299
- const t = this._input;
300
- !this.opened && t && this.focusElement(t);
313
+ }, this.handleWrapperClick = (t) => {
314
+ const e = this._input;
315
+ !this.opened && e && this.focusElement(e);
301
316
  const o = this.base.initState();
302
- o.syntheticEvent = e, !this.state.focused && !this.mobileMode && (o.events.push({ type: "onFocus" }), o.data.focused = !0), this.mobileMode && (this.setState({ currentValue: this.tagsToRender }), this.mobileMode && window.setTimeout(() => this._adaptiveInput && this._adaptiveInput.focus(), 300)), this.base.togglePopup(o), this.applyState(o);
303
- }, this.handleItemClick = (e, t) => {
317
+ o.syntheticEvent = t, !this.state.focused && !this.mobileMode && (o.events.push({ type: "onFocus" }), o.data.focused = !0), this.mobileMode && (this.setState({ currentValue: this.tagsToRender }), this.mobileMode && window.setTimeout(() => this._adaptiveInput && this._adaptiveInput.focus(), 300)), this.base.togglePopup(o), this.applyState(o);
318
+ }, this.handleItemClick = (t, e) => {
304
319
  const o = this.base.initState();
305
- o.syntheticEvent = t, this.handleItemSelect(e, o), this.props.autoClose && this.base.togglePopup(o), t.stopPropagation(), this.applyState(o);
306
- }, this.handleBlur = (e) => {
320
+ o.syntheticEvent = e, this.handleItemSelect(t, o), this.props.autoClose && this.base.togglePopup(o), e.stopPropagation(), this.applyState(o);
321
+ }, this.handleBlur = (t) => {
307
322
  if (!this.state.focused || this._skipFocusEvent)
308
323
  return;
309
- const t = this.base.initState(), { allowCustom: o, filterable: s } = this.props;
310
- t.syntheticEvent = e, t.data.focused = !1, t.events.push({ type: "onBlur" }), this.opened && !this.mobileMode && (this.state.opened && (t.data.opened = !1), t.events.push({ type: "onClose" })), !o && !s && this.state.text && (t.data.text = ""), this.applyState(t);
311
- }, this.handleFocus = (e) => {
312
- this._skipFocusEvent || this.base.handleFocus(e);
324
+ const e = this.base.initState(), { allowCustom: o, filterable: s } = this.props;
325
+ e.syntheticEvent = t, e.data.focused = !1, e.events.push({ type: "onBlur" }), this.opened && !this.mobileMode && (this.state.opened && (e.data.opened = !1), e.events.push({ type: "onClose" })), !o && !s && this.state.text && (e.data.text = ""), this.applyState(e);
326
+ }, this.handleFocus = (t) => {
327
+ this._skipFocusEvent || this.base.handleFocus(t);
313
328
  }, this.onPopupOpened = () => {
314
329
  this._input && this.state.focused && !this.mobileMode && this.focusElement(this._input);
315
330
  }, this.onPopupClosed = () => {
@@ -318,9 +333,9 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
318
333
  }, 0);
319
334
  }, this.setValidity = () => {
320
335
  this._input && this._input.setCustomValidity && this._input.setCustomValidity(
321
- this.validity.valid ? "" : this.props.validationMessage || be
336
+ this.validity.valid ? "" : this.props.validationMessage || yt
322
337
  );
323
- }, this.validate(n), this.licenseMessage = se(A);
338
+ }, this.validate(l), this.licenseMessage = st(A);
324
339
  }
325
340
  get _inputId() {
326
341
  return this.props.id;
@@ -329,12 +344,12 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
329
344
  if (V)
330
345
  return this.element && this.element.ownerDocument || document;
331
346
  }
332
- validate(n) {
333
- if (n.filterable || n.virtual) {
334
- const e = [];
335
- n.filterable && e.push("filterable"), n.virtual && e.push("virtualization"), this.showLicenseWatermark = !ie(A, {
347
+ validate(l) {
348
+ if (l.filterable || l.virtual) {
349
+ const t = [];
350
+ l.filterable && t.push("filterable"), l.virtual && t.push("virtualization"), this.showLicenseWatermark = !it(A, {
336
351
  component: "MultiSelect",
337
- features: e
352
+ features: t
338
353
  });
339
354
  }
340
355
  }
@@ -348,24 +363,24 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
348
363
  }
349
364
  /** @hidden */
350
365
  get tagsToRender() {
351
- const { tags: n, textField: e } = this.props, t = [];
352
- return n === void 0 ? this.value.forEach((o) => {
353
- t.push({ text: K(o, e), data: [o] });
354
- }) : t.push(...n), t;
366
+ const { tags: l, textField: t } = this.props, e = [];
367
+ return l === void 0 ? this.value.forEach((o) => {
368
+ e.push({ text: _(o, t), data: [o] });
369
+ }) : e.push(...l), e;
355
370
  }
356
371
  /**
357
372
  * The mobile mode of the MultiSelect.
358
373
  */
359
374
  get mobileMode() {
360
- var e;
361
- return !!(this.state.windowWidth && this.props._adaptiveMode && this.state.windowWidth <= ((e = this.props._adaptiveMode) == null ? void 0 : e.medium) && this.props.adaptive);
375
+ var t;
376
+ return !!(this.state.windowWidth && this.props._adaptiveMode && this.state.windowWidth <= ((t = this.props._adaptiveMode) == null ? void 0 : t.medium) && this.props.adaptive);
362
377
  }
363
378
  /**
364
379
  * Represents the value of the MultiSelect.
365
380
  */
366
381
  get value() {
367
- const n = [];
368
- return this._valueItemsDuringOnChange ? n.push(...this._valueItemsDuringOnChange) : this.props.value ? n.push(...this.props.value) : this.state.value ? n.push(...this.state.value) : this.props.defaultValue && n.push(...this.props.defaultValue), n;
382
+ const l = [];
383
+ return this._valueItemsDuringOnChange ? l.push(...this._valueItemsDuringOnChange) : this.props.value ? l.push(...this.props.value) : this.state.value ? l.push(...this.state.value) : this.props.defaultValue && l.push(...this.props.defaultValue), l;
369
384
  }
370
385
  /**
371
386
  * Gets the `name` property of the MultiSelect.
@@ -377,10 +392,10 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
377
392
  * Represents the validity state into which the MultiSelect is set.
378
393
  */
379
394
  get validity() {
380
- const n = this.props.validationMessage !== void 0, e = !this.required || this.value !== null && this.value.length > 0 && this.value !== void 0, t = this.props.valid !== void 0 ? this.props.valid : e;
395
+ const l = this.props.validationMessage !== void 0, t = !this.required || this.value !== null && this.value.length > 0 && this.value !== void 0, e = this.props.valid !== void 0 ? this.props.valid : t;
381
396
  return {
382
- customError: n,
383
- valid: t,
397
+ customError: l,
398
+ valid: e,
384
399
  valueMissing: this.value === null
385
400
  };
386
401
  }
@@ -392,86 +407,93 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
392
407
  return this.props.validityStyles !== void 0 ? this.props.validityStyles : C.defaultProps.validityStyles;
393
408
  }
394
409
  /** @hidden */
395
- componentDidUpdate(n, e) {
396
- var h;
397
- const { virtual: t, groupField: o = "" } = this.props, s = x(this.props), a = t ? t.skip : 0, i = n.virtual ? n.virtual.total : 0, p = n.opened !== void 0 ? n.opened : e.opened, r = !p && this.opened, d = p && !this.opened, l = this.base.getPopupSettings();
398
- if (this.validate(this.props), this.base.didUpdate(), !l.animate && d && this.onPopupClosed(), t && t.total !== i)
410
+ componentDidUpdate(l, t) {
411
+ var p;
412
+ const { virtual: e, groupField: o = "" } = this.props, s = x(this.props), a = e ? e.skip : 0, i = l.virtual ? l.virtual.total : 0, h = l.opened !== void 0 ? l.opened : t.opened, r = !h && this.opened, d = h && !this.opened, n = this.base.getPopupSettings();
413
+ if (this.validate(this.props), this.base.didUpdate(), !n.animate && d && this.onPopupClosed(), e && e.total !== i)
399
414
  this.base.vs.calcScrollElementHeight(), this.base.vs.reset();
400
415
  else {
401
416
  let { focusedItem: f, focusedIndex: c } = this.getFocusedState();
402
- o !== "" && (c = (h = this.base.getGroupedDataModernMode(s, o)) == null ? void 0 : h.indexOf(f)), r && t ? this.base.scrollToVirtualItem(t, c - a) : r && !t ? (s && s.length !== 0 && this.base.resetGroupStickyHeader(s[0][o], this), this.base.scrollToItem(c)) : this.opened && p && f && this.scrollToFocused && this.base.scrollToItem(c - a);
417
+ o !== "" && (c = (p = this.base.getGroupedDataModernMode(s, o)) == null ? void 0 : p.indexOf(f)), r && e ? this.base.scrollToVirtualItem(e, c - a) : r && !e ? (s && s.length !== 0 && this.base.resetGroupStickyHeader(s[0][o], this), this.base.scrollToItem(c)) : this.opened && h && f && this.scrollToFocused && this.base.scrollToItem(c - a);
403
418
  }
404
419
  this.scrollToFocused = !1, this.setValidity();
405
420
  }
406
421
  /** @hidden */
407
422
  componentDidMount() {
408
- var n;
409
- this.observerResize = V && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this)), this.base.didMount(), this.setValidity(), (n = this.document) != null && n.body && this.observerResize && this.observerResize.observe(this.document.body);
423
+ var t;
424
+ this.observerResize = V && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this)), this.base.didMount(), this.setValidity(), (t = this.document) != null && t.body && this.observerResize && this.observerResize.observe(this.document.body);
425
+ const l = this.props.name || this.props.id;
426
+ this.KendoPasteSubscription = ot(this._element, {
427
+ fieldName: l,
428
+ onValueChange: (e) => {
429
+ this.handleKendoPasteValue(e);
430
+ }
431
+ });
410
432
  }
411
433
  /** @hidden */
412
434
  componentWillUnmount() {
413
- var n;
414
- (n = this.document) != null && n.body && this.observerResize && this.observerResize.disconnect();
435
+ var l, t;
436
+ (l = this.document) != null && l.body && this.observerResize && this.observerResize.disconnect(), (t = this.KendoPasteSubscription) == null || t.unsubscribe();
415
437
  }
416
438
  /** @hidden */
417
- onNavigate(n, e, t) {
418
- const { allowCustom: o } = this.props, s = x(this.props), a = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedType: i, focusedIndex: p } = this.getFocusedState(), r = o && a, d = $(i), l = this.base, h = l.vs;
419
- if (this.opened && e === u.up && d)
420
- this.state.focusedIndex !== void 0 && (n.data.focusedIndex = void 0);
439
+ onNavigate(l, t, e) {
440
+ const { allowCustom: o } = this.props, s = x(this.props), a = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedType: i, focusedIndex: h } = this.getFocusedState(), r = o && a, d = $(i), n = this.base, p = n.vs;
441
+ if (this.opened && t === u.up && d)
442
+ this.state.focusedIndex !== void 0 && (l.data.focusedIndex = void 0);
421
443
  else {
422
- const f = l.navigation.navigate({
423
- keyCode: e,
424
- current: p,
425
- max: (h.enabled ? h.total : s.length) - 1,
444
+ const f = n.navigation.navigate({
445
+ keyCode: t,
446
+ current: h,
447
+ max: (p.enabled ? p.total : s.length) - 1,
426
448
  min: r ? -1 : 0,
427
- skipItems: t || void 0
449
+ skipItems: e || void 0
428
450
  });
429
- f !== void 0 && (this.itemFocus(f, n), this.scrollToFocused = !0);
451
+ f !== void 0 && (this.itemFocus(f, l), this.scrollToFocused = !0);
430
452
  }
431
- this.applyState(n);
453
+ this.applyState(l);
432
454
  }
433
455
  /** @hidden */
434
456
  render() {
435
457
  const {
436
- style: n,
437
- className: e,
438
- label: t,
458
+ style: l,
459
+ className: t,
460
+ label: e,
439
461
  dir: o,
440
462
  disabled: s,
441
463
  textField: a,
442
464
  dataItemKey: i,
443
- virtual: p,
465
+ virtual: h,
444
466
  size: r,
445
467
  rounded: d,
446
- fillMode: l,
447
- loading: h,
468
+ fillMode: n,
469
+ loading: p,
448
470
  filter: f
449
471
  } = this.props, { text: c, focused: b, focusedTag: m, currentValue: y } = this.state, I = this.base.vs, T = this.props.id || this._inputId;
450
- I.enabled = p !== void 0, p !== void 0 && (I.skip = p.skip, I.total = p.total, I.pageSize = p.pageSize);
472
+ I.enabled = h !== void 0, h !== void 0 && (I.skip = h.skip, I.total = h.total, I.pageSize = h.pageSize);
451
473
  const k = this.mobileMode && this.opened ? y : this.tagsToRender;
452
474
  this.setItems(this.tagsToRender, this._tags);
453
475
  const R = !this.validityStyles || this.validity.valid, q = !!(f !== void 0 ? f : c) || k && k.length > 0, [G, U] = H(this.props.prefix || g.Fragment), [j, Y] = H(this.props.suffix || g.Fragment), L = /* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement(
454
476
  "div",
455
477
  {
456
478
  ref: this.componentRef,
457
- className: S("k-multiselect k-input", e, {
479
+ className: S("k-multiselect k-input", t, {
458
480
  [`k-input-${M[r] || r}`]: r,
459
- [`k-rounded-${ve[d] || d}`]: d,
460
- [`k-input-${l}`]: l,
481
+ [`k-rounded-${It[d] || d}`]: d,
482
+ [`k-input-${n}`]: n,
461
483
  "k-focus": b && !s,
462
484
  "k-invalid": !R,
463
485
  "k-disabled": s,
464
- "k-loading": h,
486
+ "k-loading": p,
465
487
  "k-required": this.required
466
488
  }),
467
- style: t ? { ...n, width: void 0 } : n,
489
+ style: e ? { ...l, width: void 0 } : l,
468
490
  dir: o,
469
491
  onFocus: (F) => {
470
492
  this.mobileMode ? this.handleWrapperClick(F) : this.handleFocus(F);
471
493
  },
472
494
  onBlur: this.handleBlur,
473
495
  onClick: this.handleWrapperClick,
474
- onMouseDown: pe
496
+ onMouseDown: ut
475
497
  },
476
498
  this.props.prefix && /* @__PURE__ */ g.createElement(G, { ...U }),
477
499
  /* @__PURE__ */ g.createElement("div", { className: S("k-input-values") }, /* @__PURE__ */ g.createElement(
@@ -482,7 +504,7 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
482
504
  id: "tagslist-" + this.base.guid
483
505
  },
484
506
  k && k.length > 0 && /* @__PURE__ */ g.createElement(
485
- re,
507
+ ht,
486
508
  {
487
509
  tagRender: this.props.tagRender,
488
510
  onTagDelete: this.onTagDelete,
@@ -493,36 +515,36 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
493
515
  }
494
516
  )
495
517
  ), this.renderSearchBar(T)),
496
- h && /* @__PURE__ */ g.createElement(B, { className: "k-input-loading-icon", name: "loading" }),
518
+ p && /* @__PURE__ */ g.createElement(B, { className: "k-input-loading-icon", name: "loading" }),
497
519
  this.props.suffix && /* @__PURE__ */ g.createElement(j, { ...Y }),
498
- q && /* @__PURE__ */ g.createElement(ue, { onClick: this.clearButtonClick }),
520
+ q && /* @__PURE__ */ g.createElement(gt, { onClick: this.clearButtonClick }),
499
521
  !this.mobileMode && this.renderListContainer()
500
522
  ), this.mobileMode && this.renderAdaptiveListContainer());
501
- return t ? /* @__PURE__ */ g.createElement(
502
- ae,
523
+ return e ? /* @__PURE__ */ g.createElement(
524
+ nt,
503
525
  {
504
- label: t,
526
+ label: e,
505
527
  editorId: T,
506
- editorValue: c || K(this.value[0], a),
528
+ editorValue: c || _(this.value[0], a),
507
529
  editorValid: R,
508
530
  editorDisabled: s,
509
- style: { width: n ? n.width : void 0 },
531
+ style: { width: l ? l.width : void 0 },
510
532
  children: L
511
533
  }
512
534
  ) : L;
513
535
  }
514
- renderSearchBar(n) {
515
- const { activedescendant: e, focusedTag: t, currentValue: o } = this.state, { disabled: s, placeholder: a, ariaDescribedBy: i, ariaLabelledBy: p, ariaLabel: r, inputAttributes: d } = this.props, l = !this.mobileMode && (this.props.filter !== void 0 ? this.props.filter : this.state.text) || "", { focusedIndex: h } = this.getFocusedState(), f = this.value.length === 0 && !l ? a : void 0, c = o && o.length > 0 ? void 0 : a, b = e === w.TagsList && t !== void 0 ? `tag-${this.base.guid}-${t.text.replace(/\s+/g, "-")}` : `option-${this.base.guid}-${h}`, m = {
536
+ renderSearchBar(l) {
537
+ const { activedescendant: t, focusedTag: e, currentValue: o } = this.state, { disabled: s, placeholder: a, ariaDescribedBy: i, ariaLabelledBy: h, ariaLabel: r, inputAttributes: d } = this.props, n = !this.mobileMode && (this.props.filter !== void 0 ? this.props.filter : this.state.text) || "", { focusedIndex: p } = this.getFocusedState(), f = this.value.length === 0 && !n ? a : void 0, c = o && o.length > 0 ? void 0 : a, b = t === w.TagsList && e !== void 0 ? `tag-${this.base.guid}-${e.text.replace(/\s+/g, "-")}` : `option-${this.base.guid}-${p}`, m = {
516
538
  accessKey: this.props.accessKey,
517
539
  tabIndex: this.props.tabIndex
518
540
  };
519
541
  return /* @__PURE__ */ g.createElement(
520
- he,
542
+ pt,
521
543
  {
522
- id: n,
523
- size: Math.max((f || "").length, l.length, 1),
544
+ id: l,
545
+ size: Math.max((f || "").length, n.length, 1),
524
546
  placeholder: this.mobileMode && this.opened ? c : f,
525
- value: l,
547
+ value: n,
526
548
  onChange: this.onChangeHandler,
527
549
  onKeyDown: this.onInputKeyDown,
528
550
  ref: this.searchbarRef,
@@ -532,7 +554,7 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
532
554
  role: "combobox",
533
555
  activedescendant: b,
534
556
  ariaDescribedBy: `tagslist-${this.base.guid}${i ? " " + i : ""}`,
535
- ariaLabelledBy: p,
557
+ ariaLabelledBy: h,
536
558
  ariaRequired: this.required,
537
559
  ariaLabel: r,
538
560
  inputAttributes: d,
@@ -540,85 +562,85 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
540
562
  }
541
563
  );
542
564
  }
543
- onTagsNavigate(n, e) {
544
- const t = n.keyCode, { focusedTag: o } = this.state, s = this._tags, a = this.props.dataItemKey;
545
- let i = o ? s.findIndex((d) => z(d, o, a)) : -1, p;
565
+ onTagsNavigate(l, t) {
566
+ const e = l.keyCode, { focusedTag: o } = this.state, s = this._tags, a = this.props.dataItemKey;
567
+ let i = o ? s.findIndex((d) => z(d, o, a)) : -1, h;
546
568
  const r = i !== -1;
547
- if (t === u.left)
548
- r ? i = Math.max(0, i - 1) : i = s.length - 1, p = s[i];
549
- else if (t === u.right)
550
- i === s.length - 1 ? p = void 0 : r && (i = Math.min(s.length - 1, i + 1), p = s[i]);
551
- else if (t === u.home && !n.shiftKey)
552
- p = s[0];
553
- else if (t === u.end && !n.shiftKey)
554
- p = s[s.length - 1];
555
- else if (t === u.delete) {
569
+ if (e === u.left)
570
+ r ? i = Math.max(0, i - 1) : i = s.length - 1, h = s[i];
571
+ else if (e === u.right)
572
+ i === s.length - 1 ? h = void 0 : r && (i = Math.min(s.length - 1, i + 1), h = s[i]);
573
+ else if (e === u.home && !l.shiftKey)
574
+ h = s[0];
575
+ else if (e === u.end && !l.shiftKey)
576
+ h = s[s.length - 1];
577
+ else if (e === u.delete) {
556
578
  if (r) {
557
579
  const d = this.value;
558
- D(d, s[i].data, a), this.triggerOnChange(d, e);
580
+ P(d, s[i].data, a), this.triggerOnChange(d, t);
559
581
  }
560
- } else if (t === u.backspace) {
582
+ } else if (e === u.backspace) {
561
583
  const d = this.value;
562
584
  if (r)
563
- D(d, s[i].data, a), this.triggerOnChange(d, e);
585
+ P(d, s[i].data, a), this.triggerOnChange(d, t);
564
586
  else if (!r && s.length) {
565
- const l = s.pop();
566
- D(d, l.data, a), this.triggerOnChange(d, e);
587
+ const n = s.pop();
588
+ P(d, n.data, a), this.triggerOnChange(d, t);
567
589
  }
568
590
  }
569
- p !== o && (e.data.focusedTag = p, e.data.activedescendant = w.TagsList), this.applyState(e);
591
+ h !== o && (t.data.focusedTag = h, t.data.activedescendant = w.TagsList), this.applyState(t);
570
592
  }
571
- triggerOnChange(n, e) {
572
- this.props.value === void 0 && (e.data.value = [...n]), this._valueItemsDuringOnChange = [], this.setItems(n, this._valueItemsDuringOnChange), e.events.push({ type: "onChange" });
593
+ triggerOnChange(l, t) {
594
+ this.props.value === void 0 && (t.data.value = [...l]), this._valueItemsDuringOnChange = [], this.setItems(l, this._valueItemsDuringOnChange), t.events.push({ type: "onChange" });
573
595
  }
574
- selectFocusedItem(n, e) {
575
- const { virtual: t } = this.props, o = x(this.props), { focusedIndex: s } = e || this.getFocusedState(), a = t ? t.skip : 0;
576
- o[s - a] !== void 0 && this.handleItemClick(s, n);
596
+ selectFocusedItem(l, t) {
597
+ const { virtual: e } = this.props, o = x(this.props), { focusedIndex: s } = t || this.getFocusedState(), a = e ? e.skip : 0;
598
+ o[s - a] !== void 0 && this.handleItemClick(s, l);
577
599
  }
578
- setItems(n, e) {
579
- e.length = 0, e.push(...n);
600
+ setItems(l, t) {
601
+ t.length = 0, t.push(...l);
580
602
  }
581
603
  getFocusedState() {
582
- const { focusedIndex: n } = this.state, e = this.props.filter !== void 0 ? this.props.filter : this.state.text, {
583
- allowCustom: t,
604
+ const { focusedIndex: l } = this.state, t = this.props.filter !== void 0 ? this.props.filter : this.state.text, {
605
+ allowCustom: e,
584
606
  dataItemKey: o,
585
607
  virtual: s,
586
608
  textField: a,
587
- focusedItemIndex: i = ce,
588
- skipDisabledItems: p
609
+ focusedItemIndex: i = ft,
610
+ skipDisabledItems: h
589
611
  } = this.props, r = x(this.props), d = s && s.skip || 0;
590
- let l;
591
- if (n !== void 0)
612
+ let n;
613
+ if (l !== void 0)
592
614
  return {
593
- focusedIndex: n,
594
- focusedItem: r[n - d],
615
+ focusedIndex: l,
616
+ focusedItem: r[l - d],
595
617
  focusedType: 1
596
618
  /* ListItem */
597
619
  };
598
- const h = this.value;
599
- if (t && e)
620
+ const p = this.value;
621
+ if (e && t)
600
622
  return {
601
623
  focusedItem: null,
602
624
  focusedIndex: -1,
603
625
  focusedType: 2
604
626
  /* CustomItem */
605
627
  };
606
- if (e)
607
- return l = i(r, e, a), {
608
- focusedItem: r[l],
609
- focusedIndex: l + d,
628
+ if (t)
629
+ return n = i(r, t, a), {
630
+ focusedItem: r[n],
631
+ focusedIndex: n + d,
610
632
  focusedType: 1
611
633
  /* ListItem */
612
634
  };
613
- if (h.length) {
614
- const f = h[h.length - 1];
615
- return l = r.findIndex((c) => P(c, f, o)), r[l] !== void 0 ? {
616
- focusedIndex: l + d,
617
- focusedItem: r[l],
635
+ if (p.length) {
636
+ const f = p[p.length - 1];
637
+ return n = r.findIndex((c) => D(c, f, o)), r[n] !== void 0 ? {
638
+ focusedIndex: n + d,
639
+ focusedItem: r[n],
618
640
  focusedType: 1
619
641
  /* ListItem */
620
642
  } : { focusedType: 0, focusedIndex: -1 };
621
- } else if (p && a && !e && d === 0) {
643
+ } else if (h && a && !t && d === 0) {
622
644
  const f = r.findIndex((c) => !c.disabled && c[a]);
623
645
  return {
624
646
  focusedIndex: f,
@@ -634,15 +656,15 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
634
656
  /* ListItem */
635
657
  } : { focusedType: 0, focusedIndex: -1 };
636
658
  }
637
- focusElement(n) {
638
- this._skipFocusEvent = !0, n.focus(), window.setTimeout(() => this._skipFocusEvent = !1, 0);
659
+ focusElement(l) {
660
+ this._skipFocusEvent = !0, l.focus(), window.setTimeout(() => this._skipFocusEvent = !1, 0);
639
661
  }
640
- applyState(n) {
641
- this.base.applyState(n), this._valueItemsDuringOnChange = null;
662
+ applyState(l) {
663
+ this.base.applyState(l), this._valueItemsDuringOnChange = null;
642
664
  }
643
- calculateMedia(n) {
644
- for (const e of n)
645
- this.setState({ windowWidth: e.target.clientWidth });
665
+ calculateMedia(l) {
666
+ for (const t of l)
667
+ this.setState({ windowWidth: t.target.clientWidth });
646
668
  }
647
669
  /**
648
670
  * Updates the state of the MultiSelect when the complex keyboard navigation that
@@ -651,16 +673,16 @@ const { sizeMap: M, roundedMap: ve } = ee, be = "Please enter a valid value!", W
651
673
  * @param {Array<string | Object>} dataToSet Defines the array of new values that will be applied to the MultiSelect
652
674
  * @param {MultiSelectInternalState} state The current state of the MultiSelect
653
675
  */
654
- updateStateOnKeyboardNavigation(n, e) {
655
- this.setState({ value: n }), this.triggerOnChange(n, e), this.applyState(e);
676
+ updateStateOnKeyboardNavigation(l, t) {
677
+ this.setState({ value: l }), this.triggerOnChange(l, t), this.applyState(t);
656
678
  }
657
679
  /**
658
680
  * Returns the last element that was selected or deselected. Needed for the keyboard navigation specifications
659
681
  *
660
682
  * @param {number} correction A correction is needed depending on if UP or DOWN key is pressed
661
683
  */
662
- getLastSelectedOrDeselectedIndex(n, e) {
663
- return this._lastSelectedOrDeslectedItemIndex === null && (this._lastSelectedOrDeslectedItemIndex = e), this._lastSelectedOrDeslectedItemIndex !== null ? this._lastSelectedOrDeslectedItemIndex + n : null;
684
+ getLastSelectedOrDeselectedIndex(l, t) {
685
+ return this._lastSelectedOrDeslectedItemIndex === null && (this._lastSelectedOrDeslectedItemIndex = t), this._lastSelectedOrDeslectedItemIndex !== null ? this._lastSelectedOrDeslectedItemIndex + l : null;
664
686
  }
665
687
  };
666
688
  C.displayName = "MultiSelect", C.propTypes = {
@@ -700,15 +722,15 @@ C.displayName = "MultiSelect", C.propTypes = {
700
722
  suffix: void 0
701
723
  };
702
724
  let N = C;
703
- const Ie = Q(), ye = J(
725
+ const xt = Q(), St = J(
704
726
  X(
705
- Ie,
727
+ xt,
706
728
  Z(N)
707
729
  )
708
730
  );
709
- ye.displayName = "KendoReactMultiSelect";
731
+ St.displayName = "KendoReactMultiSelect";
710
732
  export {
711
- ye as MultiSelect,
712
- Ie as MultiSelectPropsContext,
733
+ St as MultiSelect,
734
+ xt as MultiSelectPropsContext,
713
735
  N as MultiSelectWithoutContext
714
736
  };