@progress/kendo-react-dropdowns 8.2.0 → 8.2.1-develop.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoComplete/AutoComplete.js +1 -1
- package/AutoComplete/AutoComplete.mjs +206 -208
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +222 -227
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +329 -330
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +9 -2
- package/index.d.ts +9 -2
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
|
@@ -8,142 +8,142 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as I from "react";
|
|
10
10
|
import c from "prop-types";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { getItemValue as
|
|
17
|
-
import { Keys as m, validatePackage as
|
|
18
|
-
import { FloatingLabel as
|
|
19
|
-
import { packageMetadata as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
const
|
|
11
|
+
import T from "../common/SearchBar.mjs";
|
|
12
|
+
import N from "../common/ListContainer.mjs";
|
|
13
|
+
import L from "../common/List.mjs";
|
|
14
|
+
import C from "../common/DropDownBase.mjs";
|
|
15
|
+
import H from "../common/GroupStickyHeader.mjs";
|
|
16
|
+
import { getFilteredData as y, getItemValue as x, areSame as k, getFocusedItem as O, itemIndexStartsWith as R } from "../common/utils.mjs";
|
|
17
|
+
import { Keys as m, validatePackage as q, classNames as w, IconWrap as K, createPropsContext as z, withIdHOC as G, withPropsContext as $, kendoThemeMaps as A } from "@progress/kendo-react-common";
|
|
18
|
+
import { FloatingLabel as U } from "@progress/kendo-react-labels";
|
|
19
|
+
import { packageMetadata as j } from "../package-metadata.mjs";
|
|
20
|
+
import J from "../common/ClearButton.mjs";
|
|
21
|
+
import P from "../common/withCustomComponent.mjs";
|
|
22
|
+
const Q = "Please enter a valid value!", { sizeMap: B, roundedMap: W } = A, b = class b extends I.Component {
|
|
23
23
|
constructor(a) {
|
|
24
|
-
super(a), this.state = {}, this.base = new
|
|
24
|
+
super(a), this.state = {}, this.base = new C(this), this._element = null, this._suggested = "", this._input = null, this._isScrolling = !1, this.itemHeight = 0, this.focus = () => {
|
|
25
25
|
this._input && this._input.focus();
|
|
26
|
-
}, this.handleItemSelect = (
|
|
27
|
-
const
|
|
28
|
-
this.triggerOnChange(
|
|
29
|
-
}, this.itemFocus = (
|
|
30
|
-
const {
|
|
31
|
-
|
|
32
|
-
}, this.togglePopup = (
|
|
33
|
-
this.base.togglePopup(
|
|
26
|
+
}, this.handleItemSelect = (e, o) => {
|
|
27
|
+
const s = y(this.props), t = x(s[e], this.props.textField);
|
|
28
|
+
this.triggerOnChange(t, o);
|
|
29
|
+
}, this.itemFocus = (e, o) => {
|
|
30
|
+
const { textField: s } = this.props, i = y(this.props)[e];
|
|
31
|
+
k(this.state.focusedItem, i, s) || (o.data.focusedItem = i);
|
|
32
|
+
}, this.togglePopup = (e) => {
|
|
33
|
+
this.base.togglePopup(e);
|
|
34
34
|
}, this.setValidity = () => {
|
|
35
35
|
this._input && this._input.setCustomValidity && this._input.setCustomValidity(
|
|
36
|
-
this.validity.valid ? "" : this.props.validationMessage ||
|
|
36
|
+
this.validity.valid ? "" : this.props.validationMessage || Q
|
|
37
37
|
);
|
|
38
|
-
}, this.onScroll = (
|
|
38
|
+
}, this.onScroll = (e) => {
|
|
39
39
|
this._isScrolling = !0;
|
|
40
|
-
const { list:
|
|
41
|
-
let
|
|
42
|
-
if (!s || !
|
|
40
|
+
const { list: o } = this.base, { groupField: s } = this.props;
|
|
41
|
+
let t = y(this.props);
|
|
42
|
+
if (!s || !t.length)
|
|
43
43
|
return;
|
|
44
|
-
const i = this.itemHeight || (
|
|
45
|
-
s && (
|
|
46
|
-
let
|
|
47
|
-
for (let
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
group:
|
|
44
|
+
const i = this.itemHeight || (o ? o.children[0].offsetHeight : 0), p = e.target.scrollTop;
|
|
45
|
+
s && (t = this.base.getGroupedDataModernMode(t, s));
|
|
46
|
+
let n = t[0][s];
|
|
47
|
+
for (let r = 1; r < t.length && !(i * r > p); r++)
|
|
48
|
+
t[r] && t[r][s] && (n = t[r][s]);
|
|
49
|
+
n !== this.state.group && this.setState({
|
|
50
|
+
group: n
|
|
51
51
|
});
|
|
52
|
-
}, this.handleItemClick = (
|
|
53
|
-
this.base.handleItemClick(
|
|
54
|
-
}, this.onChangeHandler = (
|
|
55
|
-
const s = this.base.initState(),
|
|
56
|
-
s.syntheticEvent =
|
|
57
|
-
const
|
|
52
|
+
}, this.handleItemClick = (e, o) => {
|
|
53
|
+
this.base.handleItemClick(e, o), this._valueDuringOnChange = void 0;
|
|
54
|
+
}, this.onChangeHandler = (e) => {
|
|
55
|
+
const s = this.base.initState(), t = e.currentTarget, i = t.value, d = t.selectionEnd === i.length;
|
|
56
|
+
s.syntheticEvent = e;
|
|
57
|
+
const p = this._suggested, n = this.value, r = n && n.substring(0, n.length - p.length), f = r && r === i, h = r && r.length > i.length, { suggest: g } = this.props, l = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
|
|
58
58
|
if (g !== void 0 && g !== !1) {
|
|
59
|
-
f || h || !
|
|
59
|
+
f || h || !d ? this._suggested = "" : this.suggestValue(i);
|
|
60
60
|
const u = i + this._suggested, v = { userInput: i, value: this._suggested };
|
|
61
61
|
this.triggerOnChange(u, s, { suggestion: v });
|
|
62
62
|
} else
|
|
63
63
|
this._suggested = "", this.triggerOnChange(i, s);
|
|
64
|
-
(!
|
|
65
|
-
}, this.clearButtonClick = (
|
|
66
|
-
const s = this.base.initState(),
|
|
67
|
-
s.syntheticEvent =
|
|
64
|
+
(!l && i || l && !i) && this.togglePopup(s), s.data.focusedItem = void 0, this.applyState(s), this.setState({ group: void 0 });
|
|
65
|
+
}, this.clearButtonClick = (e) => {
|
|
66
|
+
const s = this.base.initState(), t = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
|
|
67
|
+
s.syntheticEvent = e;
|
|
68
68
|
const i = "";
|
|
69
|
-
this._suggested = "", this.triggerOnChange(i, s), this.state.focusedItem !== void 0 && (s.data.focusedItem = void 0),
|
|
70
|
-
}, this.onInputKeyDown = (
|
|
71
|
-
const {
|
|
69
|
+
this._suggested = "", this.triggerOnChange(i, s), this.state.focusedItem !== void 0 && (s.data.focusedItem = void 0), t && this.togglePopup(s), this.applyState(s);
|
|
70
|
+
}, this.onInputKeyDown = (e) => {
|
|
71
|
+
const { skipDisabledItems: o, groupField: s, textField: t } = this.props, i = y(this.props);
|
|
72
72
|
this._isScrolling && (this._isScrolling = !1);
|
|
73
|
-
const
|
|
74
|
-
h.syntheticEvent =
|
|
73
|
+
const d = this.focusedIndex(), p = i[d], n = e.keyCode, r = e.altKey, f = this.props.opened !== void 0 ? this.props.opened : this.state.opened, h = this.base.initState();
|
|
74
|
+
h.syntheticEvent = e;
|
|
75
75
|
const g = () => {
|
|
76
|
-
f &&
|
|
76
|
+
f && e.preventDefault();
|
|
77
77
|
};
|
|
78
|
-
if (
|
|
78
|
+
if (r && n === m.down)
|
|
79
79
|
this.setState({
|
|
80
80
|
opened: !0
|
|
81
81
|
});
|
|
82
|
-
else if (
|
|
82
|
+
else if (r && n === m.up)
|
|
83
83
|
this.setState({
|
|
84
84
|
opened: !1
|
|
85
85
|
});
|
|
86
|
-
else if (f &&
|
|
86
|
+
else if (f && n === m.pageUp)
|
|
87
87
|
g(), this.base.scrollPopupByPageSize(-1);
|
|
88
|
-
else if (f &&
|
|
88
|
+
else if (f && n === m.pageDown)
|
|
89
89
|
g(), this.base.scrollPopupByPageSize(1);
|
|
90
|
-
else if (f && (
|
|
91
|
-
g(),
|
|
92
|
-
else if (!f &&
|
|
93
|
-
const
|
|
94
|
-
this._suggested = "", this.triggerOnChange(
|
|
95
|
-
} else if (
|
|
96
|
-
if (
|
|
90
|
+
else if (f && (n === m.enter || n === m.esc))
|
|
91
|
+
g(), o === !1 && p && p.disabled ? (f && this.togglePopup(h), this.applyState(h)) : this.applyInputValue(e.currentTarget.value, h, e.keyCode);
|
|
92
|
+
else if (!f && n === m.esc) {
|
|
93
|
+
const l = "";
|
|
94
|
+
this._suggested = "", this.triggerOnChange(l, h), this.state.focusedItem !== void 0 && (h.data.focusedItem = void 0), this.applyState(h);
|
|
95
|
+
} else if (n === m.up || n === m.down) {
|
|
96
|
+
if (s !== "" && t)
|
|
97
97
|
if (!this.props.skipDisabledItems && f)
|
|
98
|
-
this.onNavigate(h,
|
|
98
|
+
this.onNavigate(h, n);
|
|
99
99
|
else {
|
|
100
|
-
let
|
|
101
|
-
if (
|
|
102
|
-
const u =
|
|
103
|
-
|
|
104
|
-
} else if (
|
|
100
|
+
let l = 0;
|
|
101
|
+
if (n === m.down || n === m.right) {
|
|
102
|
+
const u = i.slice(d + 1).find((v) => !v.disabled && v[t]);
|
|
103
|
+
l = u && i.findIndex((v) => v[t] === u[t]);
|
|
104
|
+
} else if (n === m.up || n === m.left) {
|
|
105
105
|
let u;
|
|
106
|
-
if (
|
|
107
|
-
u =
|
|
106
|
+
if (d === -1)
|
|
107
|
+
u = i, l = i.findIndex((v) => !v.disabled && v[t]);
|
|
108
108
|
else {
|
|
109
|
-
u =
|
|
109
|
+
u = i.slice(0, d);
|
|
110
110
|
let v = u.pop();
|
|
111
111
|
for (; v && v.disabled; )
|
|
112
112
|
v = u.pop();
|
|
113
|
-
|
|
113
|
+
l = v && i.findIndex((S) => S[t] === v[t]);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
if (
|
|
117
|
-
const u =
|
|
118
|
-
this.onNavigate(h,
|
|
116
|
+
if (l !== void 0) {
|
|
117
|
+
const u = l - d;
|
|
118
|
+
this.onNavigate(h, n, u);
|
|
119
119
|
} else
|
|
120
|
-
|
|
120
|
+
l === void 0 && i.findIndex((u) => u[t]) === i.length - 1 && this.onNavigate(h, n);
|
|
121
121
|
}
|
|
122
122
|
else if (!this.props.skipDisabledItems && f)
|
|
123
|
-
this.onNavigate(h,
|
|
123
|
+
this.onNavigate(h, n);
|
|
124
124
|
else {
|
|
125
|
-
let
|
|
126
|
-
if (
|
|
127
|
-
|
|
128
|
-
else if (
|
|
129
|
-
const u =
|
|
130
|
-
for (
|
|
131
|
-
|
|
125
|
+
let l = null;
|
|
126
|
+
if (n === m.down || n === m.right)
|
|
127
|
+
l = i.slice(d + 1).find((u) => !u.disabled);
|
|
128
|
+
else if (n === m.up || n === m.left) {
|
|
129
|
+
const u = i.slice(0, d);
|
|
130
|
+
for (l = u.pop(); l && l.disabled; )
|
|
131
|
+
l = u.pop();
|
|
132
132
|
}
|
|
133
|
-
if (
|
|
134
|
-
const u =
|
|
135
|
-
this.onNavigate(h,
|
|
133
|
+
if (l) {
|
|
134
|
+
const u = l.id - d - 1;
|
|
135
|
+
this.onNavigate(h, n, u);
|
|
136
136
|
} else
|
|
137
|
-
this.onNavigate(h,
|
|
137
|
+
this.onNavigate(h, n);
|
|
138
138
|
}
|
|
139
139
|
this.applyState(h), g();
|
|
140
140
|
}
|
|
141
|
-
}, this.handleBlur = (
|
|
141
|
+
}, this.handleBlur = (e) => {
|
|
142
142
|
if (this.state.focused) {
|
|
143
|
-
const
|
|
144
|
-
|
|
143
|
+
const o = this.base.initState();
|
|
144
|
+
o.data.focused = !1, o.events.push({ type: "onBlur" }), o.syntheticEvent = e, this.applyInputValue(e.currentTarget.value, o);
|
|
145
145
|
}
|
|
146
|
-
},
|
|
146
|
+
}, q(j);
|
|
147
147
|
}
|
|
148
148
|
get _inputId() {
|
|
149
149
|
return this.props.id + "-accessibility-id";
|
|
@@ -170,10 +170,10 @@ const J = "Please enter a valid value!", { sizeMap: P, roundedMap: Q } = $, y =
|
|
|
170
170
|
* Represents the validity state into which the AutoComplete is set.
|
|
171
171
|
*/
|
|
172
172
|
get validity() {
|
|
173
|
-
const a = this.props.validationMessage !== void 0,
|
|
173
|
+
const a = this.props.validationMessage !== void 0, e = !this.required || this.value !== "", o = this.props.valid !== void 0 ? this.props.valid : e;
|
|
174
174
|
return {
|
|
175
175
|
customError: a,
|
|
176
|
-
valid:
|
|
176
|
+
valid: o,
|
|
177
177
|
valueMissing: this.value === null
|
|
178
178
|
};
|
|
179
179
|
}
|
|
@@ -181,25 +181,25 @@ const J = "Please enter a valid value!", { sizeMap: P, roundedMap: Q } = $, y =
|
|
|
181
181
|
* @hidden
|
|
182
182
|
*/
|
|
183
183
|
get validityStyles() {
|
|
184
|
-
return this.props.validityStyles !== void 0 ? this.props.validityStyles :
|
|
184
|
+
return this.props.validityStyles !== void 0 ? this.props.validityStyles : b.defaultProps.validityStyles;
|
|
185
185
|
}
|
|
186
186
|
/**
|
|
187
187
|
* @hidden
|
|
188
188
|
*/
|
|
189
189
|
get required() {
|
|
190
|
-
return this.props.required !== void 0 ? this.props.required :
|
|
190
|
+
return this.props.required !== void 0 ? this.props.required : b.defaultProps.required;
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
193
193
|
* @hidden
|
|
194
194
|
*/
|
|
195
|
-
componentDidUpdate(a,
|
|
195
|
+
componentDidUpdate(a, e) {
|
|
196
196
|
var g;
|
|
197
|
-
const { groupField:
|
|
198
|
-
if (
|
|
199
|
-
(
|
|
197
|
+
const { groupField: o = "" } = this.props, s = y(this.props), { data: t = [] } = a, i = this.focusedIndex(), d = s[i], p = t !== s, n = d !== void 0 && e.focusedItem !== d, r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, f = a.opened !== void 0 ? a.opened : e.opened, h = !f && r;
|
|
198
|
+
if (o === "")
|
|
199
|
+
(r && (n || p) || h) && this.base.scrollToItem(i);
|
|
200
200
|
else if (!this._isScrolling) {
|
|
201
|
-
const
|
|
202
|
-
h && (s && s.length !== 0 && this.base.resetGroupStickyHeader(s[0][
|
|
201
|
+
const l = (g = this.base.getGroupedDataModernMode(s, o)) == null ? void 0 : g.indexOf(d);
|
|
202
|
+
h && (s && s.length !== 0 && this.base.resetGroupStickyHeader(s[0][o], this), this.base.scrollToItem(l)), r && f && n && this.base.scrollToItem(l);
|
|
203
203
|
}
|
|
204
204
|
this.setValidity();
|
|
205
205
|
}
|
|
@@ -213,98 +213,98 @@ const J = "Please enter a valid value!", { sizeMap: P, roundedMap: Q } = $, y =
|
|
|
213
213
|
* @hidden
|
|
214
214
|
*/
|
|
215
215
|
render() {
|
|
216
|
-
const { dir: a, disabled:
|
|
217
|
-
typeof
|
|
218
|
-
const [
|
|
216
|
+
const { dir: a, disabled: e, label: o, className: s, style: t, loading: i, suggest: d, size: p, rounded: n, fillMode: r } = this.props, f = !this.validityStyles || this.validity.valid, h = this.base, g = this.value, l = this.props.clearButton !== !1 && !i && !!g, u = this.props.id || this._inputId, v = this.state.focused;
|
|
217
|
+
typeof d == "string" && (this._suggested = d);
|
|
218
|
+
const [S, V] = P(this.props.prefix || I.Fragment), [E, M] = P(this.props.suffix || I.Fragment), _ = /* @__PURE__ */ I.createElement(
|
|
219
219
|
"span",
|
|
220
220
|
{
|
|
221
|
-
className:
|
|
221
|
+
className: w(
|
|
222
222
|
"k-autocomplete k-input",
|
|
223
223
|
s,
|
|
224
224
|
{
|
|
225
|
-
[`k-input-${
|
|
226
|
-
[`k-rounded-${
|
|
227
|
-
[`k-input-${
|
|
225
|
+
[`k-input-${B[p] || p}`]: p,
|
|
226
|
+
[`k-rounded-${W[n] || n}`]: n,
|
|
227
|
+
[`k-input-${r}`]: r,
|
|
228
228
|
"k-invalid": !f,
|
|
229
|
-
"k-focus": v && !
|
|
229
|
+
"k-focus": v && !e,
|
|
230
230
|
"k-loading": i,
|
|
231
231
|
"k-required": this.required,
|
|
232
|
-
"k-disabled":
|
|
232
|
+
"k-disabled": e
|
|
233
233
|
}
|
|
234
234
|
),
|
|
235
|
-
ref: (
|
|
236
|
-
this._element =
|
|
235
|
+
ref: (F) => {
|
|
236
|
+
this._element = F, h.wrapper = F;
|
|
237
237
|
},
|
|
238
|
-
style:
|
|
238
|
+
style: o ? { ...t, width: void 0 } : t,
|
|
239
239
|
dir: a
|
|
240
240
|
},
|
|
241
|
-
this.props.prefix && /* @__PURE__ */ I.createElement(
|
|
241
|
+
this.props.prefix && /* @__PURE__ */ I.createElement(S, { ...V }),
|
|
242
242
|
this.renderSearchBar(g || "", u),
|
|
243
|
-
i && /* @__PURE__ */ I.createElement(
|
|
244
|
-
|
|
245
|
-
this.props.suffix && /* @__PURE__ */ I.createElement(
|
|
243
|
+
i && /* @__PURE__ */ I.createElement(K, { className: "k-input-loading-icon", name: "loading" }),
|
|
244
|
+
l && !i && /* @__PURE__ */ I.createElement(J, { onClick: this.clearButtonClick, key: "clearbutton" }),
|
|
245
|
+
this.props.suffix && /* @__PURE__ */ I.createElement(E, { ...M }),
|
|
246
246
|
this.renderListContainer()
|
|
247
247
|
);
|
|
248
|
-
return
|
|
249
|
-
|
|
248
|
+
return o ? /* @__PURE__ */ I.createElement(
|
|
249
|
+
U,
|
|
250
250
|
{
|
|
251
|
-
label:
|
|
251
|
+
label: o,
|
|
252
252
|
editorId: u,
|
|
253
253
|
editorValue: g,
|
|
254
254
|
editorValid: f,
|
|
255
|
-
editorDisabled:
|
|
256
|
-
style: { width:
|
|
257
|
-
children:
|
|
255
|
+
editorDisabled: e,
|
|
256
|
+
style: { width: t ? t.width : void 0 },
|
|
257
|
+
children: _
|
|
258
258
|
}
|
|
259
|
-
) :
|
|
259
|
+
) : _;
|
|
260
260
|
}
|
|
261
261
|
/**
|
|
262
262
|
* @hidden
|
|
263
263
|
*/
|
|
264
|
-
onNavigate(a,
|
|
265
|
-
const s = this.value, {
|
|
266
|
-
keyCode:
|
|
267
|
-
current:
|
|
268
|
-
max:
|
|
264
|
+
onNavigate(a, e, o) {
|
|
265
|
+
const s = this.value, { textField: t, focusedItemIndex: i } = this.props, d = y(this.props), p = this.state.focusedItem !== void 0 ? d.findIndex((r) => k(r, this.state.focusedItem, t)) : i ? i(d, s, t) : d.indexOf(O(d, s, t)), n = this.base.navigation.navigate({
|
|
266
|
+
keyCode: e,
|
|
267
|
+
current: p,
|
|
268
|
+
max: d.length - 1,
|
|
269
269
|
min: 0,
|
|
270
|
-
skipItems:
|
|
270
|
+
skipItems: o || void 0
|
|
271
271
|
});
|
|
272
|
-
|
|
272
|
+
n !== void 0 && this.itemFocus(n, a), this.applyState(a);
|
|
273
273
|
}
|
|
274
274
|
/**
|
|
275
275
|
* @hidden
|
|
276
276
|
*/
|
|
277
|
-
applyInputValue(a,
|
|
278
|
-
const s = this.props.opened !== void 0 ? this.props.opened : this.state.opened, {
|
|
279
|
-
if (this._suggested = "", s &&
|
|
280
|
-
const
|
|
281
|
-
this.triggerOnChange(
|
|
277
|
+
applyInputValue(a, e, o) {
|
|
278
|
+
const s = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { textField: t } = this.props, i = y(this.props), d = this.focusedIndex(), p = i[d];
|
|
279
|
+
if (this._suggested = "", s && o === m.enter && p && !p.disabled) {
|
|
280
|
+
const n = x(i[this.focusedIndex(a)], t);
|
|
281
|
+
this.triggerOnChange(n, e);
|
|
282
282
|
}
|
|
283
|
-
s && this.togglePopup(
|
|
283
|
+
s && this.togglePopup(e), this.applyState(e);
|
|
284
284
|
}
|
|
285
|
-
renderSearchBar(a,
|
|
286
|
-
const
|
|
285
|
+
renderSearchBar(a, e) {
|
|
286
|
+
const o = this.base, { placeholder: s, tabIndex: t, disabled: i, readonly: d } = this.props, { focused: p } = this.state, n = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
|
|
287
287
|
return /* @__PURE__ */ I.createElement(
|
|
288
|
-
|
|
288
|
+
T,
|
|
289
289
|
{
|
|
290
|
-
id:
|
|
290
|
+
id: e,
|
|
291
291
|
placeholder: s,
|
|
292
|
-
tabIndex:
|
|
292
|
+
tabIndex: t,
|
|
293
293
|
accessKey: this.props.accessKey,
|
|
294
294
|
value: a,
|
|
295
295
|
suggestedText: this._suggested,
|
|
296
|
-
focused:
|
|
296
|
+
focused: p,
|
|
297
297
|
name: this.props.name,
|
|
298
|
-
ref: (
|
|
298
|
+
ref: (r) => this._input = r && r.input,
|
|
299
299
|
onKeyDown: this.onInputKeyDown,
|
|
300
300
|
onChange: this.onChangeHandler,
|
|
301
|
-
onFocus:
|
|
301
|
+
onFocus: o.handleFocus,
|
|
302
302
|
onBlur: this.handleBlur,
|
|
303
303
|
disabled: i,
|
|
304
|
-
readOnly:
|
|
305
|
-
expanded:
|
|
306
|
-
owns:
|
|
307
|
-
activedescendant: "option-" +
|
|
304
|
+
readOnly: d,
|
|
305
|
+
expanded: n,
|
|
306
|
+
owns: o.listBoxId,
|
|
307
|
+
activedescendant: "option-" + o.guid + "-" + this.focusedIndex(),
|
|
308
308
|
role: "combobox",
|
|
309
309
|
ariaLabelledBy: this.props.ariaLabelledBy,
|
|
310
310
|
ariaDescribedBy: this.props.ariaDescribedBy,
|
|
@@ -315,113 +315,111 @@ const J = "Please enter a valid value!", { sizeMap: P, roundedMap: Q } = $, y =
|
|
|
315
315
|
}
|
|
316
316
|
renderListContainer() {
|
|
317
317
|
const a = this.base, {
|
|
318
|
-
dir:
|
|
319
|
-
header:
|
|
318
|
+
dir: e,
|
|
319
|
+
header: o,
|
|
320
320
|
footer: s,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
} = this.props, d = a.getPopupSettings(), f = this.props.opened !== void 0 ? this.props.opened : this.state.opened, h = d.width !== void 0 ? d.width : a.popupWidth;
|
|
321
|
+
size: t,
|
|
322
|
+
groupField: i,
|
|
323
|
+
list: d,
|
|
324
|
+
groupStickyHeaderItemRender: p
|
|
325
|
+
} = this.props, n = y(this.props), r = a.getPopupSettings(), f = this.props.opened !== void 0 ? this.props.opened : this.state.opened, h = r.width !== void 0 ? r.width : a.popupWidth;
|
|
327
326
|
let { group: g } = this.state;
|
|
328
|
-
return g === void 0 &&
|
|
329
|
-
|
|
327
|
+
return g === void 0 && i !== void 0 && (g = x(n[0], i)), /* @__PURE__ */ I.createElement(
|
|
328
|
+
N,
|
|
330
329
|
{
|
|
331
330
|
width: h,
|
|
332
331
|
popupSettings: {
|
|
333
|
-
...
|
|
334
|
-
anchor:
|
|
332
|
+
...r,
|
|
333
|
+
anchor: r.anchor || this.element,
|
|
335
334
|
show: f,
|
|
336
|
-
popupClass:
|
|
337
|
-
|
|
335
|
+
popupClass: w(
|
|
336
|
+
r.popupClass,
|
|
338
337
|
"k-list-container",
|
|
339
338
|
"k-autocomplete-popup"
|
|
340
339
|
)
|
|
341
340
|
},
|
|
342
|
-
dir:
|
|
341
|
+
dir: e !== void 0 ? e : this.base.dirCalculated,
|
|
343
342
|
itemsCount: [n.length]
|
|
344
343
|
},
|
|
345
|
-
|
|
344
|
+
o && /* @__PURE__ */ I.createElement("div", { className: "k-list-header" }, o),
|
|
346
345
|
/* @__PURE__ */ I.createElement(
|
|
347
346
|
"div",
|
|
348
347
|
{
|
|
349
|
-
className:
|
|
348
|
+
className: w(
|
|
350
349
|
"k-list",
|
|
351
350
|
{
|
|
352
|
-
[`k-list-${
|
|
351
|
+
[`k-list-${B[t] || t}`]: t
|
|
353
352
|
}
|
|
354
353
|
)
|
|
355
354
|
},
|
|
356
|
-
!
|
|
355
|
+
!d && g && n.length !== 0 && /* @__PURE__ */ I.createElement(H, { group: g, groupMode: "modern", render: p }),
|
|
357
356
|
this.renderList()
|
|
358
357
|
),
|
|
359
358
|
s && /* @__PURE__ */ I.createElement("div", { className: "k-list-footer" }, s)
|
|
360
359
|
);
|
|
361
360
|
}
|
|
362
361
|
renderList() {
|
|
363
|
-
const a = this.base,
|
|
364
|
-
textField:
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
} = this.props, l = this.value, o = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
|
|
362
|
+
const a = this.base, e = a.getPopupSettings(), {
|
|
363
|
+
textField: o,
|
|
364
|
+
listNoDataRender: s,
|
|
365
|
+
itemRender: t,
|
|
366
|
+
groupHeaderItemRender: i
|
|
367
|
+
} = this.props, d = y(this.props), p = this.value, n = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
|
|
370
368
|
return /* @__PURE__ */ I.createElement(
|
|
371
|
-
|
|
369
|
+
L,
|
|
372
370
|
{
|
|
373
371
|
id: a.listBoxId,
|
|
374
|
-
show:
|
|
375
|
-
data:
|
|
372
|
+
show: n,
|
|
373
|
+
data: d.slice(),
|
|
376
374
|
focusedIndex: this.focusedIndex(),
|
|
377
|
-
value:
|
|
378
|
-
textField:
|
|
379
|
-
valueField:
|
|
375
|
+
value: p,
|
|
376
|
+
textField: o,
|
|
377
|
+
valueField: o,
|
|
380
378
|
highlightSelected: !1,
|
|
381
379
|
optionsGuid: a.guid,
|
|
382
380
|
groupField: this.props.groupField,
|
|
383
381
|
groupMode: "modern",
|
|
384
|
-
listRef: (
|
|
385
|
-
wrapperStyle: { maxHeight:
|
|
382
|
+
listRef: (r) => a.list = r,
|
|
383
|
+
wrapperStyle: { maxHeight: e.height },
|
|
386
384
|
wrapperCssClass: "k-list-content",
|
|
387
385
|
onClick: this.handleItemClick,
|
|
388
|
-
itemRender:
|
|
389
|
-
groupHeaderItemRender:
|
|
390
|
-
noDataRender:
|
|
391
|
-
onMouseDown: (
|
|
386
|
+
itemRender: t,
|
|
387
|
+
groupHeaderItemRender: i,
|
|
388
|
+
noDataRender: s,
|
|
389
|
+
onMouseDown: (r) => r.preventDefault(),
|
|
392
390
|
onScroll: this.onScroll
|
|
393
391
|
}
|
|
394
392
|
);
|
|
395
393
|
}
|
|
396
|
-
triggerOnChange(a,
|
|
397
|
-
this.value === a && !
|
|
394
|
+
triggerOnChange(a, e, o) {
|
|
395
|
+
this.value === a && !o || (e.data.value = a, this._valueDuringOnChange = a, e.events.push({ type: "onChange", ...o || {} }));
|
|
398
396
|
}
|
|
399
397
|
applyState(a) {
|
|
400
398
|
this.base.applyState(a), this._valueDuringOnChange = void 0;
|
|
401
399
|
}
|
|
402
400
|
suggestValue(a) {
|
|
403
401
|
if (this._suggested = "", a) {
|
|
404
|
-
const {
|
|
402
|
+
const { textField: e } = this.props, o = y(this.props), s = o[R(o, a, e)];
|
|
405
403
|
if (s) {
|
|
406
|
-
const
|
|
407
|
-
a.toLowerCase() !==
|
|
404
|
+
const t = x(s, e);
|
|
405
|
+
a.toLowerCase() !== t.toLowerCase() && (this._suggested = t.substring(a.length));
|
|
408
406
|
}
|
|
409
407
|
}
|
|
410
408
|
}
|
|
411
409
|
focusedIndex(a) {
|
|
412
|
-
const {
|
|
410
|
+
const { textField: e, focusedItemIndex: o, skipDisabledItems: s } = this.props, t = y(this.props), i = a !== void 0 ? a : this.value;
|
|
413
411
|
if (this.state.focusedItem !== void 0)
|
|
414
|
-
return t.findIndex((
|
|
415
|
-
if (
|
|
416
|
-
return
|
|
412
|
+
return t.findIndex((d) => k(d, this.state.focusedItem, e));
|
|
413
|
+
if (o)
|
|
414
|
+
return o(t, i, e);
|
|
417
415
|
{
|
|
418
|
-
const
|
|
419
|
-
return
|
|
416
|
+
const d = t.indexOf(O(t, i, e));
|
|
417
|
+
return s && e && d === -1 ? t.findIndex((p) => !p.disabled && p[e]) : Math.max(0, d);
|
|
420
418
|
}
|
|
421
419
|
}
|
|
422
420
|
};
|
|
423
|
-
|
|
424
|
-
...
|
|
421
|
+
b.displayName = "AutoComplete", b.propTypes = {
|
|
422
|
+
...C.basicPropTypes,
|
|
425
423
|
size: c.oneOf([null, "small", "medium", "large"]),
|
|
426
424
|
rounded: c.oneOf([null, "small", "medium", "large", "full"]),
|
|
427
425
|
fillMode: c.oneOf([null, "solid", "flat", "outline"]),
|
|
@@ -440,8 +438,8 @@ y.displayName = "AutoComplete", y.propTypes = {
|
|
|
440
438
|
ariaDescribedBy: c.string,
|
|
441
439
|
list: c.any,
|
|
442
440
|
skipDisabledItems: c.bool
|
|
443
|
-
},
|
|
444
|
-
...
|
|
441
|
+
}, b.defaultProps = {
|
|
442
|
+
...C.defaultProps,
|
|
445
443
|
size: "medium",
|
|
446
444
|
rounded: "medium",
|
|
447
445
|
fillMode: "solid",
|
|
@@ -449,11 +447,11 @@ y.displayName = "AutoComplete", y.propTypes = {
|
|
|
449
447
|
prefix: void 0,
|
|
450
448
|
suffix: void 0
|
|
451
449
|
};
|
|
452
|
-
let
|
|
453
|
-
const
|
|
454
|
-
|
|
450
|
+
let D = b;
|
|
451
|
+
const X = z(), Y = G($(X, D));
|
|
452
|
+
Y.displayName = "KendoReactAutoComplete";
|
|
455
453
|
export {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
454
|
+
Y as AutoComplete,
|
|
455
|
+
X as AutoCompletePropsContext,
|
|
456
|
+
D as AutoCompleteWithoutContext
|
|
459
457
|
};
|