@progress/kendo-react-dropdowns 14.4.1-develop.12 → 14.4.1-develop.14

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