@progress/kendo-react-dropdowns 14.4.1-develop.9 → 14.5.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.
- package/AutoComplete/AutoComplete.d.ts +1 -1
- package/AutoComplete/AutoComplete.js +1 -1
- package/AutoComplete/AutoComplete.mjs +210 -210
- package/AutoComplete/AutoCompleteProps.d.ts +1 -1
- package/ComboBox/ComboBox.d.ts +1 -1
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +201 -201
- package/ComboBox/ComboBoxProps.d.ts +1 -1
- package/DropDownList/DropDownList.d.ts +1 -1
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +316 -316
- package/DropDownList/DropDownListProps.d.ts +1 -1
- package/DropDownList/models/index.d.ts +1 -1
- package/DropDownTree/DropDownTree.d.ts +1 -1
- package/DropDownTree/DropDownTreeProps.d.ts +1 -1
- package/DropDownTree/ListNoData.d.ts +1 -1
- package/MultiColumnComboBox/MultiColumnComboBox.d.ts +1 -1
- package/MultiSelect/MultiSelect.d.ts +1 -1
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +51 -51
- package/MultiSelect/MultiSelectProps.d.ts +1 -1
- package/MultiSelectTree/MultiSelectTree.d.ts +1 -1
- package/MultiSelectTree/MultiSelectTreeProps.d.ts +1 -1
- package/MultiSelectTree/utils.d.ts +1 -1
- package/common/events.d.ts +1 -1
- package/common/settings.d.ts +1 -1
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +6 -6
- package/index.d.ts +6 -6
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
|
@@ -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
|
|
9
|
-
import
|
|
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
|
|
13
|
+
import x from "../common/DropDownBase.mjs";
|
|
14
14
|
import L from "../common/GroupStickyHeader.mjs";
|
|
15
|
-
import { getFilteredData as b, getItemValue as
|
|
16
|
-
import { withIdHOC as A, withPropsContext as q, withAdaptiveModeContext as W, createPropsContext as G, classNames as
|
|
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
|
|
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:
|
|
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
|
|
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
|
|
29
|
-
|
|
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(
|
|
34
|
-
}, this.handleItemSelect = (e,
|
|
35
|
-
const
|
|
36
|
-
this.state.text && !this.mobileMode && (this.state.text && (
|
|
37
|
-
}, this.itemFocus = (e,
|
|
38
|
-
const { textField:
|
|
39
|
-
|
|
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,
|
|
47
|
+
const { windowWidth: e = 0 } = this.state, s = /* @__PURE__ */ c.createElement(
|
|
48
48
|
Z,
|
|
49
49
|
{
|
|
50
50
|
value: this.value,
|
|
51
|
-
ref: (
|
|
52
|
-
this._adaptiveInput =
|
|
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
|
-
),
|
|
61
|
+
), t = {
|
|
62
62
|
title: this.props.adaptiveTitle || this.props.label,
|
|
63
63
|
subTitle: this.props.adaptiveSubtitle,
|
|
64
64
|
expand: this.opened,
|
|
65
|
-
onClose: (
|
|
65
|
+
onClose: (n) => this.onCancel(n),
|
|
66
66
|
windowWidth: e,
|
|
67
|
-
mobileFilter:
|
|
67
|
+
mobileFilter: s
|
|
68
68
|
};
|
|
69
|
-
return /* @__PURE__ */
|
|
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
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
z(
|
|
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:
|
|
77
|
-
let { group:
|
|
78
|
-
return
|
|
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:
|
|
82
|
-
[`k-list-${this.mobileMode ? "lg" :
|
|
81
|
+
className: w("k-list", {
|
|
82
|
+
[`k-list-${this.mobileMode ? "lg" : D[t] || t}`]: this.mobileMode || t
|
|
83
83
|
})
|
|
84
84
|
},
|
|
85
|
-
!a &&
|
|
85
|
+
!a && o && d.length !== 0 && /* @__PURE__ */ c.createElement(L, { group: o, render: n }),
|
|
86
86
|
this.renderList()
|
|
87
|
-
),
|
|
87
|
+
), s && /* @__PURE__ */ c.createElement("div", { className: "k-list-footer" }, s));
|
|
88
88
|
}, this.onScroll = (e) => {
|
|
89
89
|
this._isScrolling = !0;
|
|
90
|
-
const { list:
|
|
91
|
-
let
|
|
92
|
-
if (!
|
|
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 || (
|
|
95
|
-
|
|
96
|
-
let
|
|
97
|
-
for (let r = 1; r <
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
group:
|
|
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,
|
|
103
|
-
this.base.handleItemClick(e,
|
|
102
|
+
}, this.handleItemClick = (e, s) => {
|
|
103
|
+
this.base.handleItemClick(e, s), this._valueDuringOnChange = void 0;
|
|
104
104
|
}, this.onChangeHandler = (e) => {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
const d = this._suggested,
|
|
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
|
|
111
|
-
this.triggerOnChange(
|
|
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,
|
|
114
|
-
(!h && i || h && !i) && this.togglePopup(
|
|
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
|
|
117
|
-
|
|
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,
|
|
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:
|
|
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],
|
|
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 &&
|
|
128
|
+
if (r && o === f.down)
|
|
129
129
|
this.setState({
|
|
130
130
|
opened: !0
|
|
131
131
|
});
|
|
132
|
-
else if (r &&
|
|
132
|
+
else if (r && o === f.up)
|
|
133
133
|
this.setState({
|
|
134
134
|
opened: !1
|
|
135
135
|
});
|
|
136
|
-
else if (p &&
|
|
136
|
+
else if (p && o === f.pageUp)
|
|
137
137
|
v(), this.base.scrollPopupByPageSize(-1);
|
|
138
|
-
else if (p &&
|
|
138
|
+
else if (p && o === f.pageDown)
|
|
139
139
|
v(), this.base.scrollPopupByPageSize(1);
|
|
140
|
-
else if (p && (
|
|
141
|
-
v(),
|
|
142
|
-
else if (!p &&
|
|
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 (
|
|
145
|
-
if (
|
|
144
|
+
else if (o === f.up || o === f.down) {
|
|
145
|
+
if (t !== "" && n)
|
|
146
146
|
if (!this.props.skipDisabledItems && p)
|
|
147
|
-
this.onNavigate(l,
|
|
147
|
+
this.onNavigate(l, o);
|
|
148
148
|
else {
|
|
149
149
|
let h = 0;
|
|
150
|
-
if (
|
|
151
|
-
const
|
|
152
|
-
h =
|
|
153
|
-
} else if (
|
|
154
|
-
let
|
|
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
|
-
|
|
156
|
+
g = i, h = i.findIndex((m) => !m.disabled);
|
|
157
157
|
else {
|
|
158
|
-
|
|
159
|
-
let
|
|
160
|
-
for (;
|
|
161
|
-
|
|
162
|
-
h =
|
|
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
|
|
167
|
-
this.onNavigate(l,
|
|
168
|
-
} else h === void 0 &&
|
|
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,
|
|
171
|
+
this.onNavigate(l, o);
|
|
172
172
|
else {
|
|
173
173
|
let h = null;
|
|
174
|
-
if (
|
|
175
|
-
h = i.slice(a + 1).find((
|
|
176
|
-
else if (
|
|
177
|
-
const
|
|
178
|
-
for (h =
|
|
179
|
-
h =
|
|
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
|
|
183
|
-
this.onNavigate(l,
|
|
182
|
+
const g = h.id - a - 1;
|
|
183
|
+
this.onNavigate(l, o, g);
|
|
184
184
|
} else
|
|
185
|
-
this.onNavigate(l,
|
|
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,
|
|
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 (
|
|
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,
|
|
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:
|
|
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
|
|
246
|
-
return !!(this.state.windowWidth && this.props._adaptiveMode && this.state.windowWidth <= ((
|
|
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 :
|
|
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 :
|
|
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,
|
|
263
|
+
componentDidUpdate(e, s) {
|
|
264
264
|
var h;
|
|
265
|
-
const { groupField:
|
|
266
|
-
if (
|
|
267
|
-
(p && (r ||
|
|
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
|
|
270
|
-
v && (
|
|
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
|
|
279
|
-
this.observerResize =
|
|
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: (
|
|
284
|
-
this.handleKendoPasteValue(
|
|
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:
|
|
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] =
|
|
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:
|
|
305
|
-
[`k-input-${
|
|
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":
|
|
309
|
+
"k-focus": P && !s,
|
|
310
310
|
"k-loading": a,
|
|
311
311
|
"k-required": this.required,
|
|
312
|
-
"k-disabled":
|
|
312
|
+
"k-disabled": s
|
|
313
313
|
}),
|
|
314
314
|
ref: (C) => {
|
|
315
315
|
this._element = C, v.wrapper = C;
|
|
316
316
|
},
|
|
317
|
-
style:
|
|
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__ */
|
|
324
|
-
this.renderSearchBar(h || "",
|
|
325
|
-
a && /* @__PURE__ */
|
|
326
|
-
|
|
327
|
-
this.props.suffix && /* @__PURE__ */
|
|
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
|
|
330
|
+
return t ? /* @__PURE__ */ c.createElement(
|
|
331
331
|
J,
|
|
332
332
|
{
|
|
333
|
-
label:
|
|
334
|
-
editorId:
|
|
333
|
+
label: t,
|
|
334
|
+
editorId: m,
|
|
335
335
|
editorValue: h,
|
|
336
336
|
editorValid: l,
|
|
337
|
-
editorDisabled:
|
|
337
|
+
editorDisabled: s,
|
|
338
338
|
style: { width: i ? i.width : void 0 },
|
|
339
|
-
children:
|
|
339
|
+
children: _
|
|
340
340
|
}
|
|
341
|
-
) :
|
|
341
|
+
) : _;
|
|
342
342
|
}
|
|
343
343
|
/**
|
|
344
344
|
* @hidden
|
|
345
345
|
*/
|
|
346
|
-
onNavigate(e,
|
|
347
|
-
const
|
|
348
|
-
keyCode:
|
|
349
|
-
current:
|
|
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:
|
|
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,
|
|
360
|
-
const
|
|
361
|
-
if (this._suggested = "",
|
|
362
|
-
const r =
|
|
363
|
-
this.triggerOnChange(r,
|
|
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
|
-
|
|
365
|
+
n && this.togglePopup(s), this.applyState(s);
|
|
366
366
|
}
|
|
367
|
-
renderSearchBar(e,
|
|
368
|
-
const
|
|
369
|
-
return /* @__PURE__ */
|
|
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:
|
|
373
|
-
placeholder:
|
|
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:
|
|
385
|
+
onFocus: t.handleFocus,
|
|
386
386
|
onBlur: this.handleBlur,
|
|
387
387
|
disabled: a,
|
|
388
388
|
readOnly: d,
|
|
389
389
|
expanded: p,
|
|
390
|
-
owns:
|
|
391
|
-
activedescendant: "option-" +
|
|
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:
|
|
397
|
+
inputAttributes: o
|
|
398
398
|
}
|
|
399
399
|
);
|
|
400
400
|
}
|
|
401
401
|
renderListContainer() {
|
|
402
|
-
const e = this.base, { dir:
|
|
403
|
-
let { group:
|
|
404
|
-
return
|
|
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:
|
|
412
|
+
popupClass: w(i.popupClass, "k-list-container", "k-autocomplete-popup")
|
|
413
413
|
},
|
|
414
|
-
dir:
|
|
415
|
-
itemsCount: [
|
|
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,
|
|
422
|
-
return /* @__PURE__ */
|
|
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:
|
|
430
|
-
textField:
|
|
431
|
-
valueField:
|
|
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:
|
|
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:
|
|
443
|
+
noDataRender: n,
|
|
444
444
|
onMouseDown: (p) => p.preventDefault(),
|
|
445
445
|
onScroll: this.onScroll
|
|
446
446
|
}
|
|
447
447
|
);
|
|
448
448
|
}
|
|
449
|
-
triggerOnChange(e,
|
|
450
|
-
this.value === e && !
|
|
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:
|
|
461
|
-
if (
|
|
462
|
-
const i =
|
|
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:
|
|
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((
|
|
471
|
-
if (
|
|
472
|
-
return
|
|
473
|
-
const d = i.indexOf(
|
|
474
|
-
return
|
|
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
|
|
478
|
-
this.setState({ windowWidth:
|
|
477
|
+
for (const s of e)
|
|
478
|
+
this.setState({ windowWidth: s.target.clientWidth });
|
|
479
479
|
}
|
|
480
480
|
};
|
|
481
|
-
|
|
482
|
-
...
|
|
483
|
-
size:
|
|
484
|
-
rounded:
|
|
485
|
-
fillMode:
|
|
486
|
-
groupField:
|
|
487
|
-
suggest:
|
|
488
|
-
placeholder:
|
|
489
|
-
value:
|
|
490
|
-
defaultValue:
|
|
491
|
-
validationMessage:
|
|
492
|
-
required:
|
|
493
|
-
readonly:
|
|
494
|
-
clearButton:
|
|
495
|
-
valueRender:
|
|
496
|
-
id:
|
|
497
|
-
ariaLabelledBy:
|
|
498
|
-
ariaDescribedBy:
|
|
499
|
-
list:
|
|
500
|
-
adaptive:
|
|
501
|
-
adaptiveTitle:
|
|
502
|
-
adaptiveSubtitle:
|
|
503
|
-
onCancel:
|
|
504
|
-
skipDisabledItems:
|
|
505
|
-
inputAttributes:
|
|
506
|
-
},
|
|
507
|
-
...
|
|
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
|
|
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
|
-
|
|
526
|
+
k as AutoCompleteWithoutContext
|
|
527
527
|
};
|