@progress/kendo-react-dropdowns 9.5.0 → 10.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.
@@ -5,178 +5,177 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as h from "react";
9
- import u from "prop-types";
8
+ import * as c from "react";
9
+ import g from "prop-types";
10
10
  import N from "../common/SearchBar.mjs";
11
11
  import R from "../common/ListContainer.mjs";
12
12
  import z from "../common/List.mjs";
13
- import S from "../common/DropDownBase.mjs";
13
+ import C from "../common/DropDownBase.mjs";
14
14
  import L from "../common/GroupStickyHeader.mjs";
15
- import { getFilteredData as I, getItemValue as x, areSame as w, isPresent as H, getFocusedItem as D, itemIndexStartsWith as A } from "../common/utils.mjs";
16
- import { classNames as k, Keys as m, validatePackage as K, canUseDOM as E, IconWrap as q, createPropsContext as W, withIdHOC as G, withPropsContext as U, withAdaptiveModeContext as $, kendoThemeMaps as j } from "@progress/kendo-react-common";
17
- import { FloatingLabel as J } from "@progress/kendo-react-labels";
18
- import { packageMetadata as Q } from "../package-metadata.mjs";
19
- import X from "../common/ClearButton.mjs";
20
- import { AdaptiveMode as Y } from "../common/AdaptiveMode.mjs";
21
- import P from "../common/withCustomComponent.mjs";
22
- import { ActionSheetContent as Z } from "@progress/kendo-react-layout";
23
- import ee from "../common/ListFilter.mjs";
24
- const te = "Please enter a valid value!", { sizeMap: O, roundedMap: se } = j, y = class y extends h.Component {
25
- constructor(a) {
26
- super(a), this.state = {}, this.base = new S(this), this._element = null, this._suggested = "", this._input = null, this._adaptiveInput = null, this._skipFocusEvent = !1, this._isScrolling = !1, this.itemHeight = 0, this.focus = () => {
15
+ import { getFilteredData as b, getItemValue as y, areSame as S, isPresent as H, getFocusedItem as M, itemIndexStartsWith as A } from "../common/utils.mjs";
16
+ import { classNames as w, Keys as m, canUseDOM as D, IconWrap as K, createPropsContext as q, withIdHOC as W, withPropsContext as G, withAdaptiveModeContext as U, kendoThemeMaps as $ } from "@progress/kendo-react-common";
17
+ import { FloatingLabel as j } from "@progress/kendo-react-labels";
18
+ import J from "../common/ClearButton.mjs";
19
+ import { AdaptiveMode as Q } from "../common/AdaptiveMode.mjs";
20
+ import E from "../common/withCustomComponent.mjs";
21
+ import { ActionSheetContent as X } from "@progress/kendo-react-layout";
22
+ import Y from "../common/ListFilter.mjs";
23
+ const Z = "Please enter a valid value!", { sizeMap: O, roundedMap: ee } = $, I = class I extends c.Component {
24
+ constructor() {
25
+ super(...arguments), this.state = {}, this.base = new C(this), this._element = null, this._suggested = "", this._input = null, this._adaptiveInput = null, this._skipFocusEvent = !1, this._isScrolling = !1, this.itemHeight = 0, this.focus = () => {
27
26
  this._input && this._input.focus();
28
27
  }, this.handleItemSelect = (e, t) => {
29
- const s = I(this.props), i = x(s[e], this.props.textField);
30
- this.state.text && !this.mobileMode && (this.state.text && (t.data.text = ""), this.base.filterChanged("", t)), this._adaptiveInput && this._adaptiveInput.blur(), this.triggerOnChange(i, t);
28
+ const s = b(this.props), n = y(s[e], this.props.textField);
29
+ this.state.text && !this.mobileMode && (this.state.text && (t.data.text = ""), this.base.filterChanged("", t)), this._adaptiveInput && this._adaptiveInput.blur(), this.triggerOnChange(n, t);
31
30
  }, this.itemFocus = (e, t) => {
32
- const { textField: s } = this.props, o = I(this.props)[e];
33
- w(this.state.focusedItem, o, s) || (t.data.focusedItem = o);
31
+ const { textField: s } = this.props, i = b(this.props)[e];
32
+ S(this.state.focusedItem, i, s) || (t.data.focusedItem = i);
34
33
  }, this.togglePopup = (e) => {
35
34
  this.base.togglePopup(e);
36
35
  }, this.setValidity = () => {
37
36
  this._input && this._input.setCustomValidity && this._input.setCustomValidity(
38
- this.validity.valid ? "" : this.props.validationMessage || te
37
+ this.validity.valid ? "" : this.props.validationMessage || Z
39
38
  );
40
39
  }, this.renderAdaptiveListContainer = () => {
41
- const { adaptiveTitle: e } = this.props, { windowWidth: t = 0 } = this.state, s = /* @__PURE__ */ h.createElement(
42
- ee,
40
+ const { adaptiveTitle: e } = this.props, { windowWidth: t = 0 } = this.state, s = /* @__PURE__ */ c.createElement(
41
+ Y,
43
42
  {
44
43
  value: this.value,
45
- ref: (o) => this._adaptiveInput = o && o.element,
44
+ ref: (i) => this._adaptiveInput = i && i.element,
46
45
  onChange: this.onChangeHandler,
47
46
  onKeyDown: this.onInputKeyDown,
48
47
  size: this.props.size,
49
48
  rounded: this.props.rounded,
50
49
  fillMode: this.props.fillMode
51
50
  }
52
- ), i = {
51
+ ), n = {
53
52
  title: e,
54
53
  expand: this.opened,
55
- onClose: (o) => this.onCancel(o),
54
+ onClose: (i) => this.onCancel(i),
56
55
  windowWidth: t,
57
56
  mobileFilter: s
58
57
  };
59
- return /* @__PURE__ */ h.createElement(Y, { ...i }, /* @__PURE__ */ h.createElement(Z, { overflowHidden: !0 }, /* @__PURE__ */ h.createElement("div", { className: "k-list-container" }, this.listContainerContent())));
58
+ return /* @__PURE__ */ c.createElement(Q, { ...n }, /* @__PURE__ */ c.createElement(X, { overflowHidden: !0 }, /* @__PURE__ */ c.createElement("div", { className: "k-list-container" }, this.listContainerContent())));
60
59
  }, this.onCancel = (e) => {
61
60
  const t = this.base.initState();
62
61
  t.syntheticEvent = e, e.stopPropagation(), this.opened && this.base.togglePopup(t), t.events.push({ type: "onCancel" });
63
62
  const s = this.state.text;
64
63
  H(s) && s !== "" && this.base.filterChanged("", t), this.state.text && (t.data.text = ""), this.applyState(t);
65
64
  }, this.listContainerContent = () => {
66
- const { header: e, footer: t, size: s, groupStickyHeaderItemRender: i, groupField: o, list: d } = this.props, r = I(this.props);
67
- let { group: n } = this.state;
68
- return n === void 0 && o !== void 0 && (n = x(r[0], o)), /* @__PURE__ */ h.createElement(h.Fragment, null, e && /* @__PURE__ */ h.createElement("div", { className: "k-list-header" }, e), /* @__PURE__ */ h.createElement(
65
+ const { header: e, footer: t, size: s, groupStickyHeaderItemRender: n, groupField: i, list: a } = this.props, d = b(this.props);
66
+ let { group: o } = this.state;
67
+ return o === void 0 && i !== void 0 && (o = y(d[0], i)), /* @__PURE__ */ c.createElement(c.Fragment, null, e && /* @__PURE__ */ c.createElement("div", { className: "k-list-header" }, e), /* @__PURE__ */ c.createElement(
69
68
  "div",
70
69
  {
71
- className: k("k-list", {
70
+ className: w("k-list", {
72
71
  [`k-list-${this.mobileMode ? "lg" : O[s] || s}`]: s
73
72
  })
74
73
  },
75
- !d && n && r.length !== 0 && /* @__PURE__ */ h.createElement(L, { group: n, groupMode: "modern", render: i }),
74
+ !a && o && d.length !== 0 && /* @__PURE__ */ c.createElement(L, { group: o, groupMode: "modern", render: n }),
76
75
  this.renderList()
77
- ), t && /* @__PURE__ */ h.createElement("div", { className: "k-list-footer" }, t));
76
+ ), t && /* @__PURE__ */ c.createElement("div", { className: "k-list-footer" }, t));
78
77
  }, this.onScroll = (e) => {
79
78
  this._isScrolling = !0;
80
79
  const { list: t } = this.base, { groupField: s } = this.props;
81
- let i = I(this.props);
82
- if (!s || !i.length)
80
+ let n = b(this.props);
81
+ if (!s || !n.length)
83
82
  return;
84
- const o = this.itemHeight || (t ? t.children[0].offsetHeight : 0), r = e.target.scrollTop;
85
- s && (i = this.base.getGroupedDataModernMode(i, s));
86
- let n = i[0][s];
87
- for (let p = 1; p < i.length && !(o * p > r); p++)
88
- i[p] && i[p][s] && (n = i[p][s]);
89
- n !== this.state.group && this.setState({
90
- group: n
83
+ const i = this.itemHeight || (t ? t.children[0].offsetHeight : 0), d = e.target.scrollTop;
84
+ s && (n = this.base.getGroupedDataModernMode(n, s));
85
+ let o = n[0][s];
86
+ for (let r = 1; r < n.length && !(i * r > d); r++)
87
+ n[r] && n[r][s] && (o = n[r][s]);
88
+ o !== this.state.group && this.setState({
89
+ group: o
91
90
  });
92
91
  }, this.handleItemClick = (e, t) => {
93
92
  this.base.handleItemClick(e, t), this._valueDuringOnChange = void 0;
94
93
  }, this.onChangeHandler = (e) => {
95
- const s = this.base.initState(), i = this.mobileMode ? e.target.element : e.currentTarget, o = i.value, d = i.selectionEnd === o.length;
94
+ const s = this.base.initState(), n = this.mobileMode ? e.target.element : e.currentTarget, i = n.value, a = n.selectionEnd === i.length;
96
95
  s.syntheticEvent = e;
97
- const r = this._suggested, n = this.value, p = n && n.substring(0, n.length - r.length), f = p && p === o, g = p && p.length > o.length, { suggest: b } = this.props, l = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
98
- if (b !== void 0 && b !== !1) {
99
- f || g || !d ? this._suggested = "" : this.suggestValue(o);
100
- const c = o + this._suggested, v = { userInput: o, value: this._suggested };
101
- this.triggerOnChange(c, s, { suggestion: v });
96
+ const d = this._suggested, o = this.value, r = o && o.substring(0, o.length - d.length), l = r && r === i, h = r && r.length > i.length, { suggest: v } = this.props, p = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
97
+ if (v !== void 0 && v !== !1) {
98
+ l || h || !a ? this._suggested = "" : this.suggestValue(i);
99
+ const u = i + this._suggested, f = { userInput: i, value: this._suggested };
100
+ this.triggerOnChange(u, s, { suggestion: f });
102
101
  } else
103
- this._suggested = "", this.triggerOnChange(o, s);
104
- (!l && o || l && !o) && this.togglePopup(s), s.data.focusedItem = void 0, this.applyState(s), this.setState({ group: void 0 });
102
+ this._suggested = "", this.triggerOnChange(i, s);
103
+ (!p && i || p && !i) && this.togglePopup(s), s.data.focusedItem = void 0, this.applyState(s), this.setState({ group: void 0 });
105
104
  }, this.clearButtonClick = (e) => {
106
- const s = this.base.initState(), i = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
105
+ const s = this.base.initState(), n = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
107
106
  s.syntheticEvent = e;
108
- const o = "";
109
- this._suggested = "", this.triggerOnChange(o, s), this.state.focusedItem !== void 0 && (s.data.focusedItem = void 0), i && this.togglePopup(s), this.applyState(s);
107
+ const i = "";
108
+ this._suggested = "", this.triggerOnChange(i, s), this.state.focusedItem !== void 0 && (s.data.focusedItem = void 0), n && this.togglePopup(s), this.applyState(s);
110
109
  }, this.onInputKeyDown = (e) => {
111
- const { skipDisabledItems: t, groupField: s, textField: i } = this.props, o = I(this.props);
110
+ const { skipDisabledItems: t, groupField: s, textField: n } = this.props, i = b(this.props);
112
111
  this._isScrolling && (this._isScrolling = !1);
113
- const d = this.focusedIndex(), r = o[d], n = e.keyCode, p = e.altKey, f = this.props.opened !== void 0 ? this.props.opened : this.state.opened, g = this.base.initState();
114
- g.syntheticEvent = e;
115
- const b = () => {
116
- f && e.preventDefault();
112
+ const a = this.focusedIndex(), d = i[a], o = e.keyCode, r = e.altKey, l = this.props.opened !== void 0 ? this.props.opened : this.state.opened, h = this.base.initState();
113
+ h.syntheticEvent = e;
114
+ const v = () => {
115
+ l && e.preventDefault();
117
116
  };
118
- if (p && n === m.down)
117
+ if (r && o === m.down)
119
118
  this.setState({
120
119
  opened: !0
121
120
  });
122
- else if (p && n === m.up)
121
+ else if (r && o === m.up)
123
122
  this.setState({
124
123
  opened: !1
125
124
  });
126
- else if (f && n === m.pageUp)
127
- b(), this.base.scrollPopupByPageSize(-1);
128
- else if (f && n === m.pageDown)
129
- b(), this.base.scrollPopupByPageSize(1);
130
- else if (f && (n === m.enter || n === m.esc))
131
- b(), t === !1 && r && r.disabled ? (f && this.togglePopup(g), this.applyState(g)) : this.applyInputValue(e.currentTarget.value, g, e.keyCode);
132
- else if (!f && n === m.esc) {
133
- const l = "";
134
- this._suggested = "", this.triggerOnChange(l, g), this.state.focusedItem !== void 0 && (g.data.focusedItem = void 0), this.applyState(g);
135
- } else if (n === m.up || n === m.down) {
136
- if (s !== "" && i)
137
- if (!this.props.skipDisabledItems && f)
138
- this.onNavigate(g, n);
125
+ else if (l && o === m.pageUp)
126
+ v(), this.base.scrollPopupByPageSize(-1);
127
+ else if (l && o === m.pageDown)
128
+ v(), this.base.scrollPopupByPageSize(1);
129
+ else if (l && (o === m.enter || o === m.esc))
130
+ v(), t === !1 && d && d.disabled ? (l && this.togglePopup(h), this.applyState(h)) : this.applyInputValue(e.currentTarget.value, h, e.keyCode);
131
+ else if (!l && o === m.esc) {
132
+ const p = "";
133
+ this._suggested = "", this.triggerOnChange(p, h), this.state.focusedItem !== void 0 && (h.data.focusedItem = void 0), this.applyState(h);
134
+ } else if (o === m.up || o === m.down) {
135
+ if (s !== "" && n)
136
+ if (!this.props.skipDisabledItems && l)
137
+ this.onNavigate(h, o);
139
138
  else {
140
- let l = 0;
141
- if (n === m.down || n === m.right) {
142
- const c = o.slice(d + 1).find((v) => !v.disabled && v[i]);
143
- l = c && o.findIndex((v) => v[i] === c[i]);
144
- } else if (n === m.up || n === m.left) {
145
- let c;
146
- if (d === -1)
147
- c = o, l = o.findIndex((v) => !v.disabled && v[i]);
139
+ let p = 0;
140
+ if (o === m.down || o === m.right) {
141
+ const u = i.slice(a + 1).find((f) => !f.disabled && f[n]);
142
+ p = u && i.findIndex((f) => f[n] === u[n]);
143
+ } else if (o === m.up || o === m.left) {
144
+ let u;
145
+ if (a === -1)
146
+ u = i, p = i.findIndex((f) => !f.disabled && f[n]);
148
147
  else {
149
- c = o.slice(0, d);
150
- let v = c.pop();
151
- for (; v && v.disabled; )
152
- v = c.pop();
153
- l = v && o.findIndex((C) => C[i] === v[i]);
148
+ u = i.slice(0, a);
149
+ let f = u.pop();
150
+ for (; f && f.disabled; )
151
+ f = u.pop();
152
+ p = f && i.findIndex((x) => x[n] === f[n]);
154
153
  }
155
154
  }
156
- if (l !== void 0) {
157
- const c = l - d;
158
- this.onNavigate(g, n, c);
155
+ if (p !== void 0) {
156
+ const u = p - a;
157
+ this.onNavigate(h, o, u);
159
158
  } else
160
- l === void 0 && o.findIndex((c) => c[i]) === o.length - 1 && this.onNavigate(g, n);
159
+ p === void 0 && i.findIndex((u) => u[n]) === i.length - 1 && this.onNavigate(h, o);
161
160
  }
162
- else if (!this.props.skipDisabledItems && f)
163
- this.onNavigate(g, n);
161
+ else if (!this.props.skipDisabledItems && l)
162
+ this.onNavigate(h, o);
164
163
  else {
165
- let l = null;
166
- if (n === m.down || n === m.right)
167
- l = o.slice(d + 1).find((c) => !c.disabled);
168
- else if (n === m.up || n === m.left) {
169
- const c = o.slice(0, d);
170
- for (l = c.pop(); l && l.disabled; )
171
- l = c.pop();
164
+ let p = null;
165
+ if (o === m.down || o === m.right)
166
+ p = i.slice(a + 1).find((u) => !u.disabled);
167
+ else if (o === m.up || o === m.left) {
168
+ const u = i.slice(0, a);
169
+ for (p = u.pop(); p && p.disabled; )
170
+ p = u.pop();
172
171
  }
173
- if (l) {
174
- const c = l.id - d - 1;
175
- this.onNavigate(g, n, c);
172
+ if (p) {
173
+ const u = p.id - a - 1;
174
+ this.onNavigate(h, o, u);
176
175
  } else
177
- this.onNavigate(g, n);
176
+ this.onNavigate(h, o);
178
177
  }
179
- this.applyState(g), b();
178
+ this.applyState(h), v();
180
179
  }
181
180
  }, this.handleFocus = (e) => {
182
181
  this._skipFocusEvent || this.base.handleFocus(e);
@@ -188,13 +187,13 @@ const te = "Please enter a valid value!", { sizeMap: O, roundedMap: se } = j, y
188
187
  !this.opened && t && this.focusElement(t);
189
188
  const s = this.base.initState();
190
189
  s.syntheticEvent = e, !this.state.focused && !this.mobileMode && (s.events.push({ type: "onFocus" }), s.data.focused = !0), this.mobileMode && window.setTimeout(() => this._adaptiveInput && this._adaptiveInput.focus(), 300), this.base.togglePopup(s), this.applyState(s);
191
- }, K(Q);
190
+ };
192
191
  }
193
192
  get _inputId() {
194
193
  return this.props.id + "-accessibility-id";
195
194
  }
196
195
  get document() {
197
- if (E)
196
+ if (D)
198
197
  return this.element && this.element.ownerDocument || document;
199
198
  }
200
199
  /**
@@ -219,10 +218,10 @@ const te = "Please enter a valid value!", { sizeMap: O, roundedMap: se } = j, y
219
218
  * Represents the validity state into which the AutoComplete is set.
220
219
  */
221
220
  get validity() {
222
- const a = this.props.validationMessage !== void 0, e = !this.required || this.value !== "", t = this.props.valid !== void 0 ? this.props.valid : e;
221
+ const e = this.props.validationMessage !== void 0, t = !this.required || this.value !== "", s = this.props.valid !== void 0 ? this.props.valid : t;
223
222
  return {
224
- customError: a,
225
- valid: t,
223
+ customError: e,
224
+ valid: s,
226
225
  valueMissing: this.value === null
227
226
  };
228
227
  }
@@ -234,32 +233,32 @@ const te = "Please enter a valid value!", { sizeMap: O, roundedMap: se } = j, y
234
233
  * The mobile mode of the AutoComplete.
235
234
  */
236
235
  get mobileMode() {
237
- var e;
238
- return !!(this.state.windowWidth && this.props._adaptiveMode && this.state.windowWidth <= ((e = this.props._adaptiveMode) == null ? void 0 : e.medium) && this.props.adaptive);
236
+ var t;
237
+ return !!(this.state.windowWidth && this.props._adaptiveMode && this.state.windowWidth <= ((t = this.props._adaptiveMode) == null ? void 0 : t.medium) && this.props.adaptive);
239
238
  }
240
239
  /**
241
240
  * @hidden
242
241
  */
243
242
  get validityStyles() {
244
- return this.props.validityStyles !== void 0 ? this.props.validityStyles : y.defaultProps.validityStyles;
243
+ return this.props.validityStyles !== void 0 ? this.props.validityStyles : I.defaultProps.validityStyles;
245
244
  }
246
245
  /**
247
246
  * @hidden
248
247
  */
249
248
  get required() {
250
- return this.props.required !== void 0 ? this.props.required : y.defaultProps.required;
249
+ return this.props.required !== void 0 ? this.props.required : I.defaultProps.required;
251
250
  }
252
251
  /**
253
252
  * @hidden
254
253
  */
255
- componentDidUpdate(a, e) {
256
- var b;
257
- const { groupField: t = "" } = this.props, s = I(this.props), { data: i = [] } = a, o = this.focusedIndex(), d = s[o], r = i !== s, n = d !== void 0 && e.focusedItem !== d, p = this.props.opened !== void 0 ? this.props.opened : this.state.opened, f = a.opened !== void 0 ? a.opened : e.opened, g = !f && p;
258
- if (t === "")
259
- (p && (n || r) || g) && this.base.scrollToItem(o);
254
+ componentDidUpdate(e, t) {
255
+ var p;
256
+ const { groupField: s = "" } = this.props, n = b(this.props), { data: i = [] } = e, a = this.focusedIndex(), d = n[a], o = i !== n, r = d !== void 0 && t.focusedItem !== d, l = this.props.opened !== void 0 ? this.props.opened : this.state.opened, h = e.opened !== void 0 ? e.opened : t.opened, v = !h && l;
257
+ if (s === "")
258
+ (l && (r || o) || v) && this.base.scrollToItem(a);
260
259
  else if (!this._isScrolling) {
261
- const l = (b = this.base.getGroupedDataModernMode(s, t)) == null ? void 0 : b.indexOf(d);
262
- g && (s && s.length !== 0 && this.base.resetGroupStickyHeader(s[0][t], this), this.base.scrollToItem(l)), p && f && n && this.base.scrollToItem(l);
260
+ const u = (p = this.base.getGroupedDataModernMode(n, s)) == null ? void 0 : p.indexOf(d);
261
+ v && (n && n.length !== 0 && this.base.resetGroupStickyHeader(n[0][s], this), this.base.scrollToItem(u)), l && h && r && this.base.scrollToItem(u);
263
262
  }
264
263
  this.setValidity();
265
264
  }
@@ -267,8 +266,8 @@ const te = "Please enter a valid value!", { sizeMap: O, roundedMap: se } = j, y
267
266
  * @hidden
268
267
  */
269
268
  componentDidMount() {
270
- var a;
271
- this.observerResize = E && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this)), this.base.didMount(), this.setValidity(), (a = this.document) != null && a.body && this.observerResize && this.observerResize.observe(this.document.body);
269
+ var e;
270
+ this.observerResize = D && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this)), this.base.didMount(), this.setValidity(), (e = this.document) != null && e.body && this.observerResize && this.observerResize.observe(this.document.body);
272
271
  }
273
272
  /**
274
273
  * @hidden
@@ -280,211 +279,211 @@ const te = "Please enter a valid value!", { sizeMap: O, roundedMap: se } = j, y
280
279
  * @hidden
281
280
  */
282
281
  render() {
283
- const { dir: a, disabled: e, label: t, className: s, style: i, loading: o, suggest: d, size: r, rounded: n, fillMode: p } = this.props, f = !this.validityStyles || this.validity.valid, g = this.base, b = this.value, l = this.props.clearButton !== !1 && !o && !!b, c = this.props.id || this._inputId, v = this.state.focused;
282
+ const { dir: e, disabled: t, label: s, className: n, style: i, loading: a, suggest: d, size: o, rounded: r, fillMode: l } = this.props, h = !this.validityStyles || this.validity.valid, v = this.base, p = this.value, u = this.props.clearButton !== !1 && !a && !!p, f = this.props.id || this._inputId, x = this.state.focused;
284
283
  typeof d == "string" && (this._suggested = d);
285
- const [C, B] = P(this.props.prefix || h.Fragment), [T, V] = P(this.props.suffix || h.Fragment), F = /* @__PURE__ */ h.createElement(h.Fragment, null, /* @__PURE__ */ h.createElement(
284
+ const [P, B] = E(this.props.prefix || c.Fragment), [T, V] = E(this.props.suffix || c.Fragment), _ = /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(
286
285
  "span",
287
286
  {
288
- className: k("k-autocomplete k-input", s, {
289
- [`k-input-${O[r] || r}`]: r,
290
- [`k-rounded-${se[n] || n}`]: n,
291
- [`k-input-${p}`]: p,
292
- "k-invalid": !f,
293
- "k-focus": v && !e,
294
- "k-loading": o,
287
+ className: w("k-autocomplete k-input", n, {
288
+ [`k-input-${O[o] || o}`]: o,
289
+ [`k-rounded-${ee[r] || r}`]: r,
290
+ [`k-input-${l}`]: l,
291
+ "k-invalid": !h,
292
+ "k-focus": x && !t,
293
+ "k-loading": a,
295
294
  "k-required": this.required,
296
- "k-disabled": e
295
+ "k-disabled": t
297
296
  }),
298
- ref: (M) => {
299
- this._element = M, g.wrapper = M;
297
+ ref: (F) => {
298
+ this._element = F, v.wrapper = F;
300
299
  },
301
- style: t ? { ...i, width: void 0 } : i,
302
- dir: a,
300
+ style: s ? { ...i, width: void 0 } : i,
301
+ dir: e,
303
302
  onFocus: this.handleFocus,
304
303
  onBlur: this.handleBlur,
305
304
  onClick: this.handleWrapperClick
306
305
  },
307
- this.props.prefix && /* @__PURE__ */ h.createElement(C, { ...B }),
308
- this.renderSearchBar(b || "", c),
309
- o && /* @__PURE__ */ h.createElement(q, { className: "k-input-loading-icon", name: "loading" }),
310
- l && !o && /* @__PURE__ */ h.createElement(X, { onClick: this.clearButtonClick, key: "clearbutton" }),
311
- this.props.suffix && /* @__PURE__ */ h.createElement(T, { ...V }),
306
+ this.props.prefix && /* @__PURE__ */ c.createElement(P, { ...B }),
307
+ this.renderSearchBar(p || "", f),
308
+ a && /* @__PURE__ */ c.createElement(K, { className: "k-input-loading-icon", name: "loading" }),
309
+ u && !a && /* @__PURE__ */ c.createElement(J, { onClick: this.clearButtonClick, key: "clearbutton" }),
310
+ this.props.suffix && /* @__PURE__ */ c.createElement(T, { ...V }),
312
311
  !this.mobileMode && this.renderListContainer()
313
312
  ), this.mobileMode && this.renderAdaptiveListContainer());
314
- return t ? /* @__PURE__ */ h.createElement(
315
- J,
313
+ return s ? /* @__PURE__ */ c.createElement(
314
+ j,
316
315
  {
317
- label: t,
318
- editorId: c,
319
- editorValue: b,
320
- editorValid: f,
321
- editorDisabled: e,
316
+ label: s,
317
+ editorId: f,
318
+ editorValue: p,
319
+ editorValid: h,
320
+ editorDisabled: t,
322
321
  style: { width: i ? i.width : void 0 },
323
- children: F
322
+ children: _
324
323
  }
325
- ) : F;
324
+ ) : _;
326
325
  }
327
326
  /**
328
327
  * @hidden
329
328
  */
330
- onNavigate(a, e, t) {
331
- const s = this.value, { textField: i, focusedItemIndex: o } = this.props, d = I(this.props), r = this.state.focusedItem !== void 0 ? d.findIndex((p) => w(p, this.state.focusedItem, i)) : o ? o(d, s, i) : d.indexOf(D(d, s, i)), n = this.base.navigation.navigate({
332
- keyCode: e,
333
- current: r,
329
+ onNavigate(e, t, s) {
330
+ const n = this.value, { textField: i, focusedItemIndex: a } = this.props, d = b(this.props), o = this.state.focusedItem !== void 0 ? d.findIndex((l) => S(l, this.state.focusedItem, i)) : a ? a(d, n, i) : d.indexOf(M(d, n, i)), r = this.base.navigation.navigate({
331
+ keyCode: t,
332
+ current: o,
334
333
  max: d.length - 1,
335
334
  min: 0,
336
- skipItems: t || void 0
335
+ skipItems: s || void 0
337
336
  });
338
- n !== void 0 && this.itemFocus(n, a), this.applyState(a);
337
+ r !== void 0 && this.itemFocus(r, e), this.applyState(e);
339
338
  }
340
339
  /**
341
340
  * @hidden
342
341
  */
343
- applyInputValue(a, e, t) {
344
- const s = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { textField: i } = this.props, o = I(this.props), d = this.focusedIndex(), r = o[d];
345
- if (this._suggested = "", s && t === m.enter && r && !r.disabled) {
346
- const n = x(o[this.focusedIndex(a)], i);
347
- this.triggerOnChange(n, e);
342
+ applyInputValue(e, t, s) {
343
+ const n = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { textField: i } = this.props, a = b(this.props), d = this.focusedIndex(), o = a[d];
344
+ if (this._suggested = "", n && s === m.enter && o && !o.disabled) {
345
+ const r = y(a[this.focusedIndex(e)], i);
346
+ this.triggerOnChange(r, t);
348
347
  }
349
- s && this.togglePopup(e), this.applyState(e);
348
+ n && this.togglePopup(t), this.applyState(t);
350
349
  }
351
- renderSearchBar(a, e) {
352
- const t = this.base, { placeholder: s, tabIndex: i, disabled: o, readonly: d, inputAttributes: r } = this.props, { focused: n } = this.state, p = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
353
- return /* @__PURE__ */ h.createElement(
350
+ renderSearchBar(e, t) {
351
+ const s = this.base, { placeholder: n, tabIndex: i, disabled: a, readonly: d, inputAttributes: o } = this.props, { focused: r } = this.state, l = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
352
+ return /* @__PURE__ */ c.createElement(
354
353
  N,
355
354
  {
356
- id: e,
357
- placeholder: s,
355
+ id: t,
356
+ placeholder: n,
358
357
  tabIndex: i,
359
358
  accessKey: this.props.accessKey,
360
- value: a,
359
+ value: e,
361
360
  suggestedText: this._suggested,
362
- focused: n,
361
+ focused: r,
363
362
  name: this.props.name,
364
- ref: (f) => this._input = f && f.input,
363
+ ref: (h) => this._input = h && h.input,
365
364
  onKeyDown: this.onInputKeyDown,
366
365
  onChange: this.onChangeHandler,
367
- onFocus: t.handleFocus,
366
+ onFocus: s.handleFocus,
368
367
  onBlur: this.handleBlur,
369
- disabled: o,
368
+ disabled: a,
370
369
  readOnly: d,
371
- expanded: p,
372
- owns: t.listBoxId,
373
- activedescendant: "option-" + t.guid + "-" + this.focusedIndex(),
370
+ expanded: l,
371
+ owns: s.listBoxId,
372
+ activedescendant: "option-" + s.guid + "-" + this.focusedIndex(),
374
373
  role: "combobox",
375
374
  ariaLabelledBy: this.props.ariaLabelledBy,
376
375
  ariaDescribedBy: this.props.ariaDescribedBy,
377
376
  ariaRequired: this.required,
378
377
  render: this.props.valueRender,
379
- inputAttributes: r
378
+ inputAttributes: o
380
379
  }
381
380
  );
382
381
  }
383
382
  renderListContainer() {
384
- const a = this.base, { dir: e, groupField: t } = this.props, s = I(this.props), i = a.getPopupSettings(), o = this.props.opened !== void 0 ? this.props.opened : this.state.opened, d = i.width !== void 0 ? i.width : a.popupWidth;
385
- let { group: r } = this.state;
386
- return r === void 0 && t !== void 0 && (r = x(s[0], t)), /* @__PURE__ */ h.createElement(
383
+ const e = this.base, { dir: t, groupField: s } = this.props, n = b(this.props), i = e.getPopupSettings(), a = this.props.opened !== void 0 ? this.props.opened : this.state.opened, d = i.width !== void 0 ? i.width : e.popupWidth;
384
+ let { group: o } = this.state;
385
+ return o === void 0 && s !== void 0 && (o = y(n[0], s)), /* @__PURE__ */ c.createElement(
387
386
  R,
388
387
  {
389
388
  width: d,
390
389
  popupSettings: {
391
390
  ...i,
392
391
  anchor: i.anchor || this.element,
393
- show: o,
394
- popupClass: k(i.popupClass, "k-list-container", "k-autocomplete-popup")
392
+ show: a,
393
+ popupClass: w(i.popupClass, "k-list-container", "k-autocomplete-popup")
395
394
  },
396
- dir: e !== void 0 ? e : this.base.dirCalculated,
397
- itemsCount: [s.length]
395
+ dir: t !== void 0 ? t : this.base.dirCalculated,
396
+ itemsCount: [n.length]
398
397
  },
399
398
  this.listContainerContent()
400
399
  );
401
400
  }
402
401
  renderList() {
403
- const a = this.base, e = a.getPopupSettings(), { textField: t, listNoDataRender: s, itemRender: i, groupHeaderItemRender: o } = this.props, d = I(this.props), r = this.value, n = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
404
- return /* @__PURE__ */ h.createElement(
402
+ const e = this.base, t = e.getPopupSettings(), { textField: s, listNoDataRender: n, itemRender: i, groupHeaderItemRender: a } = this.props, d = b(this.props), o = this.value, r = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
403
+ return /* @__PURE__ */ c.createElement(
405
404
  z,
406
405
  {
407
- id: a.listBoxId,
408
- show: n,
406
+ id: e.listBoxId,
407
+ show: r,
409
408
  data: d.slice(),
410
409
  focusedIndex: this.focusedIndex(),
411
- value: r,
412
- textField: t,
413
- valueField: t,
410
+ value: o,
411
+ textField: s,
412
+ valueField: s,
414
413
  highlightSelected: !1,
415
- optionsGuid: a.guid,
414
+ optionsGuid: e.guid,
416
415
  groupField: this.props.groupField,
417
416
  groupMode: "modern",
418
- listRef: (p) => a.list = p,
419
- wrapperStyle: this.mobileMode ? {} : { maxHeight: e.height },
417
+ listRef: (l) => e.list = l,
418
+ wrapperStyle: this.mobileMode ? {} : { maxHeight: t.height },
420
419
  wrapperCssClass: "k-list-content",
421
420
  onClick: this.handleItemClick,
422
421
  itemRender: i,
423
- groupHeaderItemRender: o,
424
- noDataRender: s,
425
- onMouseDown: (p) => p.preventDefault(),
422
+ groupHeaderItemRender: a,
423
+ noDataRender: n,
424
+ onMouseDown: (l) => l.preventDefault(),
426
425
  onScroll: this.onScroll
427
426
  }
428
427
  );
429
428
  }
430
- triggerOnChange(a, e, t) {
431
- this.value === a && !t || (e.data.value = a, this._valueDuringOnChange = a, e.events.push({ type: "onChange", ...t || {} }));
429
+ triggerOnChange(e, t, s) {
430
+ this.value === e && !s || (t.data.value = e, this._valueDuringOnChange = e, t.events.push({ type: "onChange", ...s || {} }));
432
431
  }
433
- focusElement(a) {
434
- this._skipFocusEvent = !0, a.focus(), window.setTimeout(() => this._skipFocusEvent = !1, 0);
432
+ focusElement(e) {
433
+ this._skipFocusEvent = !0, e.focus(), window.setTimeout(() => this._skipFocusEvent = !1, 0);
435
434
  }
436
- applyState(a) {
437
- this.base.applyState(a), this._valueDuringOnChange = void 0;
435
+ applyState(e) {
436
+ this.base.applyState(e), this._valueDuringOnChange = void 0;
438
437
  }
439
- suggestValue(a) {
440
- if (this._suggested = "", a) {
441
- const { textField: e } = this.props, t = I(this.props), s = t[A(t, a, e)];
442
- if (s) {
443
- const i = x(s, e);
444
- a.toLowerCase() !== i.toLowerCase() && (this._suggested = i.substring(a.length));
438
+ suggestValue(e) {
439
+ if (this._suggested = "", e) {
440
+ const { textField: t } = this.props, s = b(this.props), n = s[A(s, e, t)];
441
+ if (n) {
442
+ const i = y(n, t);
443
+ e.toLowerCase() !== i.toLowerCase() && (this._suggested = i.substring(e.length));
445
444
  }
446
445
  }
447
446
  }
448
- focusedIndex(a) {
449
- const { textField: e, focusedItemIndex: t, skipDisabledItems: s } = this.props, i = I(this.props), o = a !== void 0 ? a : this.value;
447
+ focusedIndex(e) {
448
+ const { textField: t, focusedItemIndex: s, skipDisabledItems: n } = this.props, i = b(this.props), a = e !== void 0 ? e : this.value;
450
449
  if (this.state.focusedItem !== void 0)
451
- return i.findIndex((r) => w(r, this.state.focusedItem, e));
452
- if (t)
453
- return t(i, o, e);
454
- const d = i.indexOf(D(i, o, e));
455
- return s && e && d === -1 ? i.findIndex((r) => !r.disabled && r[e]) : Math.max(0, d);
450
+ return i.findIndex((o) => S(o, this.state.focusedItem, t));
451
+ if (s)
452
+ return s(i, a, t);
453
+ const d = i.indexOf(M(i, a, t));
454
+ return n && t && d === -1 ? i.findIndex((o) => !o.disabled && o[t]) : Math.max(0, d);
456
455
  }
457
- calculateMedia(a) {
458
- for (const e of a)
459
- this.setState({ windowWidth: e.target.clientWidth });
456
+ calculateMedia(e) {
457
+ for (const t of e)
458
+ this.setState({ windowWidth: t.target.clientWidth });
460
459
  }
461
460
  };
462
- y.displayName = "AutoComplete", y.propTypes = {
463
- ...S.basicPropTypes,
464
- size: u.oneOf([null, "small", "medium", "large"]),
465
- rounded: u.oneOf([null, "small", "medium", "large", "full"]),
466
- fillMode: u.oneOf([null, "solid", "flat", "outline"]),
467
- groupField: u.string,
468
- suggest: u.oneOfType([u.bool, u.string]),
469
- placeholder: u.string,
470
- value: u.string,
471
- defaultValue: u.string,
472
- validationMessage: u.string,
473
- required: u.bool,
474
- readonly: u.bool,
475
- clearButton: u.bool,
476
- valueRender: u.func,
477
- id: u.string,
478
- ariaLabelledBy: u.string,
479
- ariaDescribedBy: u.string,
480
- list: u.any,
481
- adaptive: u.bool,
482
- adaptiveTitle: u.string,
483
- onCancel: u.func,
484
- skipDisabledItems: u.bool,
485
- inputAttributes: u.object
486
- }, y.defaultProps = {
487
- ...S.defaultProps,
461
+ I.displayName = "AutoComplete", I.propTypes = {
462
+ ...C.basicPropTypes,
463
+ size: g.oneOf([null, "small", "medium", "large"]),
464
+ rounded: g.oneOf([null, "small", "medium", "large", "full"]),
465
+ fillMode: g.oneOf([null, "solid", "flat", "outline"]),
466
+ groupField: g.string,
467
+ suggest: g.oneOfType([g.bool, g.string]),
468
+ placeholder: g.string,
469
+ value: g.string,
470
+ defaultValue: g.string,
471
+ validationMessage: g.string,
472
+ required: g.bool,
473
+ readonly: g.bool,
474
+ clearButton: g.bool,
475
+ valueRender: g.func,
476
+ id: g.string,
477
+ ariaLabelledBy: g.string,
478
+ ariaDescribedBy: g.string,
479
+ list: g.any,
480
+ adaptive: g.bool,
481
+ adaptiveTitle: g.string,
482
+ onCancel: g.func,
483
+ skipDisabledItems: g.bool,
484
+ inputAttributes: g.object
485
+ }, I.defaultProps = {
486
+ ...C.defaultProps,
488
487
  size: "medium",
489
488
  rounded: "medium",
490
489
  fillMode: "solid",
@@ -492,16 +491,16 @@ y.displayName = "AutoComplete", y.propTypes = {
492
491
  prefix: void 0,
493
492
  suffix: void 0
494
493
  };
495
- let _ = y;
496
- const ie = W(), oe = G(
497
- U(
498
- ie,
499
- $(_)
494
+ let k = I;
495
+ const te = q(), se = W(
496
+ G(
497
+ te,
498
+ U(k)
500
499
  )
501
500
  );
502
- oe.displayName = "KendoReactAutoComplete";
501
+ se.displayName = "KendoReactAutoComplete";
503
502
  export {
504
- oe as AutoComplete,
505
- ie as AutoCompletePropsContext,
506
- _ as AutoCompleteWithoutContext
503
+ se as AutoComplete,
504
+ te as AutoCompletePropsContext,
505
+ k as AutoCompleteWithoutContext
507
506
  };