@progress/kendo-react-dropdowns 7.3.0 → 7.4.0-develop.10
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/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +233 -217
- package/common/List.js +1 -1
- package/common/List.mjs +70 -69
- package/common/utils.js +1 -1
- package/common/utils.mjs +28 -24
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +22 -12
- package/index.d.ts +22 -12
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
package/ComboBox/ComboBox.mjs
CHANGED
|
@@ -6,33 +6,39 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
9
|
+
import * as h from "react";
|
|
10
10
|
import f from "prop-types";
|
|
11
|
-
import
|
|
12
|
-
import { Keys as x, validatePackage as
|
|
13
|
-
import { FloatingLabel as
|
|
14
|
-
import { areSame as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
11
|
+
import V from "../common/DropDownBase.mjs";
|
|
12
|
+
import { Keys as x, validatePackage as se, svgIconPropType as ie, canUseDOM as L, classNames as E, IconWrap as oe, createPropsContext as ae, withIdHOC as ne, withPropsContext as le, kendoThemeMaps as re } from "@progress/kendo-react-common";
|
|
13
|
+
import { FloatingLabel as de } from "@progress/kendo-react-labels";
|
|
14
|
+
import { getPlainDataDuplicates as pe, areSame as S, getItemValue as C, isPresent as k, getItemIndexByText as R, suggestValue as he, itemIndexStartsWith as A } from "../common/utils.mjs";
|
|
15
|
+
import ce from "../common/SearchBar.mjs";
|
|
16
|
+
import ue from "../common/ListContainer.mjs";
|
|
17
17
|
import ge from "../common/List.mjs";
|
|
18
18
|
import me from "../common/ListFilter.mjs";
|
|
19
|
-
import
|
|
19
|
+
import K from "../common/GroupStickyHeader.mjs";
|
|
20
20
|
import { packageMetadata as ve } from "../package-metadata.mjs";
|
|
21
21
|
import fe from "../common/ClearButton.mjs";
|
|
22
|
-
import { Button as
|
|
22
|
+
import { Button as z } from "@progress/kendo-react-buttons";
|
|
23
23
|
import { caretAltDownIcon as be, xIcon as xe } from "@progress/kendo-svg-icons";
|
|
24
|
-
import { comboArrowBtnAriaLabelExpand as
|
|
25
|
-
import { provideLocalizationService as
|
|
24
|
+
import { comboArrowBtnAriaLabelExpand as H, messages as q, comboArrowBtnAriaLabelCollapse as $ } from "../messages/index.mjs";
|
|
25
|
+
import { provideLocalizationService as G } from "@progress/kendo-react-intl";
|
|
26
26
|
import { ActionSheet as Ie, ActionSheetHeader as ye, ActionSheetContent as ke } from "@progress/kendo-react-layout";
|
|
27
|
-
import { MOBILE_MEDIUM_DEVISE as
|
|
28
|
-
import
|
|
29
|
-
const
|
|
27
|
+
import { MOBILE_MEDIUM_DEVISE as W, MOBILE_SMALL_DEVISE as U } from "../common/constants.mjs";
|
|
28
|
+
import j from "../common/withCustomComponent.mjs";
|
|
29
|
+
const Se = "Please enter a valid value!", { sizeMap: F, roundedMap: Ce } = re, D = class D extends h.Component {
|
|
30
30
|
constructor(s) {
|
|
31
|
-
super(s), this.state = {}, this.base = new
|
|
31
|
+
super(s), this.state = {}, this.base = new V(this), this._element = null, this._suggested = "", this._skipBlur = !1, this._input = null, this._adaptiveFilterInput = null, this.itemHeight = 0, this.duplicates = [], this.hasDuplicates = !1, this.focus = () => {
|
|
32
32
|
this._input && this._input.focus();
|
|
33
|
+
}, this.checkForDuplicatePlainTextRecords = () => {
|
|
34
|
+
const e = this.props.textField !== void 0, t = this.props.dataItemKey !== void 0;
|
|
35
|
+
if (this.props.data && this.props.data.length > 0 && !e && !t) {
|
|
36
|
+
const a = this.props.data;
|
|
37
|
+
this.duplicates = pe(a), this.hasDuplicates = this.duplicates.length > 0;
|
|
38
|
+
}
|
|
33
39
|
}, this.handleItemSelect = (e, t) => {
|
|
34
|
-
const { data:
|
|
35
|
-
this.triggerOnChange(
|
|
40
|
+
const { data: a = [], virtual: o, dataItemKey: n } = this.props, d = o ? o.skip : 0, l = a[e - d], r = this.hasDuplicates || !S(l, this.value, n);
|
|
41
|
+
this.triggerOnChange(l, t), this.state.text !== void 0 && (t.data.text = void 0), r && this.base.triggerPageChangeCornerItems(l, t);
|
|
36
42
|
}, this.onPopupOpened = () => {
|
|
37
43
|
setTimeout(() => {
|
|
38
44
|
this.mobileMode && this._adaptiveFilterInput && (this._skipBlur = !0, this._adaptiveFilterInput.focus(), this._skipBlur = !1);
|
|
@@ -40,19 +46,21 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
|
|
|
40
46
|
}, this.componentRef = (e) => {
|
|
41
47
|
this._element = e, this.base.wrapper = e;
|
|
42
48
|
}, this.toggleBtnClick = (e) => {
|
|
43
|
-
const { data: t = [], skipDisabledItems:
|
|
44
|
-
if (r.syntheticEvent = e, !
|
|
45
|
-
const
|
|
46
|
-
this.base.filterChanged(
|
|
49
|
+
const { data: t = [], skipDisabledItems: a, textField: o } = this.props, n = this.getFocusedIndex(), d = this.getCurrentValueDisabledStatus(o, t, n), l = this.props.opened !== void 0 ? this.props.opened : this.state.opened, r = this.base.initState();
|
|
50
|
+
if (r.syntheticEvent = e, !a && o && d && this.clearValueOnToggleBtnClick(e), this.base.togglePopup(r), !l && this.mobileMode) {
|
|
51
|
+
const i = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text || null;
|
|
52
|
+
this.base.filterChanged(i, r);
|
|
47
53
|
}
|
|
48
54
|
this.applyState(r);
|
|
55
|
+
}, this.closeOpenedApplyStateNonMobileMode = (e, t) => {
|
|
56
|
+
t && !this.mobileMode && this.base.togglePopup(e);
|
|
49
57
|
}, this.renderMobileListFilter = () => {
|
|
50
|
-
const e = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text, t =
|
|
51
|
-
return /* @__PURE__ */
|
|
58
|
+
const e = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text, t = C(this.value, this.props.textField), a = k(e) ? e : t;
|
|
59
|
+
return /* @__PURE__ */ h.createElement(
|
|
52
60
|
me,
|
|
53
61
|
{
|
|
54
|
-
value:
|
|
55
|
-
ref: (
|
|
62
|
+
value: a,
|
|
63
|
+
ref: (o) => this._adaptiveFilterInput = o && o.element,
|
|
56
64
|
onChange: this.handleMobileFilterChange,
|
|
57
65
|
onKeyDown: this.onInputKeyDown,
|
|
58
66
|
size: this.props.size,
|
|
@@ -64,97 +72,97 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
|
|
|
64
72
|
const t = this.base.initState();
|
|
65
73
|
t.syntheticEvent = e.syntheticEvent, t.data.text = e.target.value, this.base.filterChanged(e.target.value, t), this.applyState(t);
|
|
66
74
|
}, this.onScroll = (e) => {
|
|
67
|
-
const { vs: t, list:
|
|
75
|
+
const { vs: t, list: a } = this.base;
|
|
68
76
|
t.scrollHandler(e);
|
|
69
|
-
const { groupField:
|
|
70
|
-
let { data:
|
|
71
|
-
if (!
|
|
77
|
+
const { groupField: o } = this.props;
|
|
78
|
+
let { data: n = [] } = this.props;
|
|
79
|
+
if (!o || !n.length)
|
|
72
80
|
return;
|
|
73
|
-
const d = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight :
|
|
74
|
-
this.props.groupMode === "modern" && (
|
|
75
|
-
let
|
|
76
|
-
for (let
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
group:
|
|
80
|
-
}), this.props.onGroupScroll && this.props.onGroupScroll.call(void 0, { group:
|
|
81
|
+
const d = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight : a ? a.children[0].offsetHeight : 0), r = e.target.scrollTop - t.skip * d;
|
|
82
|
+
this.props.groupMode === "modern" && (n = this.base.getGroupedDataModernMode(n, o));
|
|
83
|
+
let i = n[0][o];
|
|
84
|
+
for (let c = 1; c < n.length && !(d * c > r); c++)
|
|
85
|
+
n[c] && n[c][o] && (i = n[c][o]);
|
|
86
|
+
i !== this.state.group && (this.setState({
|
|
87
|
+
group: i
|
|
88
|
+
}), this.props.onGroupScroll && this.props.onGroupScroll.call(void 0, { group: i }));
|
|
81
89
|
}, this.handleItemClick = (e, t) => {
|
|
82
|
-
this.base.handleItemClick(e, t), this._valueDuringOnChange = void 0;
|
|
90
|
+
this.navigationIndex = e, this.base.handleItemClick(e, t), this._valueDuringOnChange = void 0;
|
|
83
91
|
}, this.handleBlur = (e) => {
|
|
84
92
|
if (this.state.focused && !this._skipBlur) {
|
|
85
|
-
const t = this.base.initState(), { textField:
|
|
86
|
-
t.data.focused = !1, t.events.push({ type: "onBlur" }), t.syntheticEvent = e,
|
|
93
|
+
const t = this.base.initState(), { textField: a, data: o = [] } = this.props, n = this.getFocusedIndex(), l = !(n === -1) && this.getCurrentValueDisabledStatus(a, o, n);
|
|
94
|
+
t.data.focused = !1, t.events.push({ type: "onBlur" }), t.syntheticEvent = e, a && l && this.clearValueOnBlur(e), this.applyValueOnRejectSuggestions(e.currentTarget.value, t);
|
|
87
95
|
}
|
|
88
96
|
}, this.onInputClick = (e) => {
|
|
89
|
-
const t = this.props.opened !== void 0 ? this.props.opened : this.state.opened,
|
|
97
|
+
const t = this.props.opened !== void 0 ? this.props.opened : this.state.opened, a = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text || null;
|
|
90
98
|
if (!t && this.mobileMode) {
|
|
91
|
-
const
|
|
92
|
-
|
|
99
|
+
const o = this.base.initState();
|
|
100
|
+
o.syntheticEvent = e, this.base.togglePopup(o), this.base.filterChanged(a, o), this.applyState(o);
|
|
93
101
|
}
|
|
94
102
|
}, this.onInputKeyDown = (e) => {
|
|
95
|
-
const { data: t = [], skipDisabledItems:
|
|
96
|
-
if (p.syntheticEvent = e, !e.altKey && (
|
|
97
|
-
if (e.preventDefault(), d !== "" &&
|
|
98
|
-
if (!this.props.skipDisabledItems &&
|
|
99
|
-
this.onNavigate(p,
|
|
103
|
+
const { data: t = [], skipDisabledItems: a, textField: o, dataItemKey: n, groupField: d } = this.props, l = this.value, r = Math.max(0, t.findIndex((u) => S(u, l, n))), i = e.keyCode, c = this.props.opened !== void 0 ? this.props.opened : this.state.opened, p = this.base.initState();
|
|
104
|
+
if (p.syntheticEvent = e, !e.altKey && (i === x.up || i === x.down)) {
|
|
105
|
+
if (e.preventDefault(), d !== "" && o)
|
|
106
|
+
if (!this.props.skipDisabledItems && c)
|
|
107
|
+
this.onNavigate(p, i);
|
|
100
108
|
else {
|
|
101
|
-
let
|
|
102
|
-
if (
|
|
103
|
-
const m = t.slice(r + 1 < t.length ? r + 1 : r).find((b) => !b.disabled && b[
|
|
104
|
-
|
|
105
|
-
} else if (
|
|
109
|
+
let u = 0;
|
|
110
|
+
if (i === x.down || i === x.right) {
|
|
111
|
+
const m = t.slice(r + 1 < t.length ? r + 1 : r).find((b) => !b.disabled && b[o]);
|
|
112
|
+
u = m && t.findIndex((b) => b[o] === m[o]);
|
|
113
|
+
} else if (i === x.up || i === x.left) {
|
|
106
114
|
let m;
|
|
107
115
|
if (r === 0)
|
|
108
|
-
m = t,
|
|
116
|
+
m = t, u = t.findIndex((b) => !b.disabled && b[o]);
|
|
109
117
|
else {
|
|
110
118
|
m = t.slice(0, r);
|
|
111
119
|
let b = m.pop();
|
|
112
120
|
for (; b && b.disabled; )
|
|
113
121
|
b = m.pop();
|
|
114
|
-
|
|
122
|
+
u = b && t.findIndex((w) => w[o] === b[o]);
|
|
115
123
|
}
|
|
116
124
|
}
|
|
117
|
-
if (
|
|
118
|
-
const m =
|
|
119
|
-
this.onNavigate(p,
|
|
125
|
+
if (u !== void 0) {
|
|
126
|
+
const m = u - r;
|
|
127
|
+
this.onNavigate(p, i, m);
|
|
120
128
|
} else
|
|
121
|
-
|
|
129
|
+
u === void 0 && t.findIndex((m) => m[o] === l[o]) === t.length - 1 && this.onNavigate(p, i);
|
|
122
130
|
}
|
|
123
|
-
else if (!this.props.skipDisabledItems &&
|
|
124
|
-
this.onNavigate(p,
|
|
131
|
+
else if (!this.props.skipDisabledItems && c)
|
|
132
|
+
this.onNavigate(p, i);
|
|
125
133
|
else {
|
|
126
|
-
let
|
|
127
|
-
if (
|
|
128
|
-
|
|
129
|
-
else if (
|
|
134
|
+
let u = null;
|
|
135
|
+
if (i === x.down || i === x.right)
|
|
136
|
+
u = t.slice(r + 1).find((m) => !m.disabled);
|
|
137
|
+
else if (i === x.up || i === x.left) {
|
|
130
138
|
const m = t.slice(0, r);
|
|
131
|
-
for (
|
|
132
|
-
|
|
139
|
+
for (u = m.pop(); u && u.disabled; )
|
|
140
|
+
u = m.pop();
|
|
133
141
|
}
|
|
134
|
-
if (
|
|
135
|
-
const m =
|
|
136
|
-
this.onNavigate(p,
|
|
142
|
+
if (u) {
|
|
143
|
+
const m = u.id - r - 1;
|
|
144
|
+
this.onNavigate(p, i, m);
|
|
137
145
|
} else
|
|
138
|
-
this.onNavigate(p,
|
|
146
|
+
this.onNavigate(p, i);
|
|
139
147
|
}
|
|
140
148
|
this.applyState(p);
|
|
141
149
|
}
|
|
142
150
|
const g = () => {
|
|
143
151
|
e.preventDefault(), this.base.togglePopup(p), this.applyState(p);
|
|
144
|
-
}, I = this.getFocusedIndex(), v = I === -1, y = !v && this.getCurrentValueDisabledStatus(
|
|
145
|
-
|
|
152
|
+
}, I = this.getFocusedIndex(), v = I === -1, y = !v && this.getCurrentValueDisabledStatus(o, t, I);
|
|
153
|
+
c ? i === x.pageUp ? this.base.scrollPopupByPageSize(-1) : i === x.pageDown ? this.base.scrollPopupByPageSize(1) : e.altKey && i === x.up ? g() : i === x.enter ? (e.preventDefault(), (o && !v && e.currentTarget.value ? t[I][o] : void 0) ? !a && o && y ? this.clearValueOnEnterOrEsc(e) : y || this.applyValueOnEnter(e.currentTarget.value, p) : this.applyValueOnEnter(e.currentTarget.value, p)) : i === x.esc && (!a && o && y && this.clearValueOnEnterOrEsc(e), this.applyValueOnRejectSuggestions(e.currentTarget.value, p)) : !c && i === x.esc ? this.clearValueOnEnterOrEsc(e) : e.altKey && i === x.down && g();
|
|
146
154
|
}, this.inputOnChange = (e) => {
|
|
147
155
|
const t = this.base.initState();
|
|
148
156
|
t.syntheticEvent = e;
|
|
149
|
-
const
|
|
157
|
+
const a = this.props.opened !== void 0 ? this.props.opened : this.state.opened, o = e.currentTarget, n = o.value;
|
|
150
158
|
if (this.props.suggest) {
|
|
151
|
-
const d =
|
|
152
|
-
let
|
|
153
|
-
k(
|
|
154
|
-
const r =
|
|
155
|
-
r ||
|
|
159
|
+
const d = o.selectionEnd === n.length;
|
|
160
|
+
let l = this.props.filter !== void 0 ? this.props.filter : this.state.text;
|
|
161
|
+
k(l) || (l = C(this.value, this.props.textField) || "");
|
|
162
|
+
const r = l && l === n, i = l && l.length > n.length;
|
|
163
|
+
r || i || !d ? this._suggested = "" : this.suggestValue(n);
|
|
156
164
|
}
|
|
157
|
-
this.props.filter === void 0 && (t.data.text =
|
|
165
|
+
this.props.filter === void 0 && (t.data.text = n), this.state.focusedItem !== void 0 && (t.data.focusedItem = void 0), a || this.base.togglePopup(t), this.base.filterChanged(n, t), this.applyState(t), this.setState({ group: void 0 });
|
|
158
166
|
}, this.clearButtonClick = (e) => {
|
|
159
167
|
const t = this.base.initState();
|
|
160
168
|
t.syntheticEvent = e, e.stopPropagation(), this.clearValue();
|
|
@@ -169,15 +177,15 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
|
|
|
169
177
|
t.syntheticEvent = e, e.stopPropagation(), this.clearValue();
|
|
170
178
|
}, this.setValidity = () => {
|
|
171
179
|
this._input && this._input.setCustomValidity && this._input.setCustomValidity(
|
|
172
|
-
this.validity.valid ? "" : this.props.validationMessage ||
|
|
180
|
+
this.validity.valid ? "" : this.props.validationMessage || Se
|
|
173
181
|
);
|
|
174
|
-
},
|
|
182
|
+
}, se(ve);
|
|
175
183
|
}
|
|
176
184
|
get _inputId() {
|
|
177
185
|
return this.props.id;
|
|
178
186
|
}
|
|
179
187
|
get document() {
|
|
180
|
-
if (
|
|
188
|
+
if (L)
|
|
181
189
|
return this.element && this.element.ownerDocument || document;
|
|
182
190
|
}
|
|
183
191
|
/** @hidden */
|
|
@@ -188,7 +196,7 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
|
|
|
188
196
|
* The mobile mode of the ComboBox.
|
|
189
197
|
*/
|
|
190
198
|
get mobileMode() {
|
|
191
|
-
return !!(this.state.windowWidth && this.state.windowWidth <=
|
|
199
|
+
return !!(this.state.windowWidth && this.state.windowWidth <= W && this.props.adaptive);
|
|
192
200
|
}
|
|
193
201
|
/**
|
|
194
202
|
* The value of the ComboBox.
|
|
@@ -208,7 +216,7 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
|
|
|
208
216
|
*/
|
|
209
217
|
get index() {
|
|
210
218
|
const { data: s = [], dataItemKey: e } = this.props, t = this.value;
|
|
211
|
-
return s.findIndex((
|
|
219
|
+
return s.findIndex((a) => S(a, t, e));
|
|
212
220
|
}
|
|
213
221
|
/**
|
|
214
222
|
* Gets the `name` property of the ComboBox.
|
|
@@ -228,31 +236,33 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
|
|
|
228
236
|
};
|
|
229
237
|
}
|
|
230
238
|
get validityStyles() {
|
|
231
|
-
return this.props.validityStyles !== void 0 ? this.props.validityStyles :
|
|
239
|
+
return this.props.validityStyles !== void 0 ? this.props.validityStyles : D.defaultProps.validityStyles;
|
|
232
240
|
}
|
|
233
241
|
/** @hidden */
|
|
234
242
|
get required() {
|
|
235
|
-
return this.props.required !== void 0 ? this.props.required :
|
|
243
|
+
return this.props.required !== void 0 ? this.props.required : D.defaultProps.required;
|
|
236
244
|
}
|
|
237
245
|
/** @hidden */
|
|
238
246
|
componentDidUpdate(s, e) {
|
|
239
247
|
var g;
|
|
240
|
-
const { dataItemKey: t, virtual:
|
|
241
|
-
|
|
248
|
+
const { dataItemKey: t, virtual: a, groupField: o = "", data: n = [], textField: d } = this.props, l = s.virtual ? s.virtual.total : 0, r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, i = s.opened !== void 0 ? s.opened : e.opened;
|
|
249
|
+
s.data !== n && this.checkForDuplicatePlainTextRecords();
|
|
250
|
+
const c = !i && r, p = this.value;
|
|
251
|
+
if (this._valueOnDidUpdate = p, a && a.total !== l)
|
|
242
252
|
this.base.vs.calcScrollElementHeight(), this.base.vs.reset();
|
|
243
253
|
else {
|
|
244
254
|
const I = s.value !== void 0 ? s.value : e.value;
|
|
245
|
-
let v =
|
|
246
|
-
this.props.groupMode === "modern" && d && p && (v = (g = this.base.getGroupedDataModernMode(
|
|
247
|
-
const y = !
|
|
248
|
-
|
|
255
|
+
let v = this.hasDuplicates ? this.navigationIndex || 0 : n.findIndex((u) => S(u, p, t));
|
|
256
|
+
this.props.groupMode === "modern" && d && p && (v = (g = this.base.getGroupedDataModernMode(n, o)) == null ? void 0 : g.map((u) => u[d]).indexOf(p[d]));
|
|
257
|
+
const y = !S(I, p, t);
|
|
258
|
+
c && a ? this.base.scrollToVirtualItem(a, v) : c && !a ? (this.onPopupOpened(), n && n.length !== 0 && this.base.resetGroupStickyHeader(n[0][o], this), this.base.scrollToItem(v)) : (this.hasDuplicates || r && i && p && y) && this.base.scrollToItem(v);
|
|
249
259
|
}
|
|
250
|
-
|
|
260
|
+
c && this._input && this._input.focus(), this.setValidity();
|
|
251
261
|
}
|
|
252
262
|
/** @hidden */
|
|
253
263
|
componentDidMount() {
|
|
254
264
|
var s;
|
|
255
|
-
this.observerResize =
|
|
265
|
+
this.observerResize = L && 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), this.checkForDuplicatePlainTextRecords();
|
|
256
266
|
}
|
|
257
267
|
/** @hidden */
|
|
258
268
|
componentWillUnmount() {
|
|
@@ -261,60 +271,60 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
|
|
|
261
271
|
}
|
|
262
272
|
/** @hidden */
|
|
263
273
|
render() {
|
|
264
|
-
const s =
|
|
265
|
-
|
|
266
|
-
$
|
|
274
|
+
const s = G(this).toLanguageString(H, q[H]), e = G(this).toLanguageString(
|
|
275
|
+
$,
|
|
276
|
+
q[$]
|
|
267
277
|
), {
|
|
268
278
|
dir: t,
|
|
269
|
-
disabled:
|
|
270
|
-
clearButton:
|
|
271
|
-
label:
|
|
279
|
+
disabled: a,
|
|
280
|
+
clearButton: o = D.defaultProps.clearButton,
|
|
281
|
+
label: n,
|
|
272
282
|
textField: d,
|
|
273
|
-
adaptive:
|
|
283
|
+
adaptive: l,
|
|
274
284
|
className: r,
|
|
275
|
-
style:
|
|
276
|
-
loading:
|
|
285
|
+
style: i,
|
|
286
|
+
loading: c,
|
|
277
287
|
iconClassName: p,
|
|
278
288
|
virtual: g,
|
|
279
289
|
size: I,
|
|
280
290
|
rounded: v,
|
|
281
291
|
fillMode: y,
|
|
282
|
-
opened:
|
|
292
|
+
opened: u = this.state.opened,
|
|
283
293
|
placeholder: m,
|
|
284
294
|
svgIcon: b
|
|
285
|
-
} = this.props,
|
|
295
|
+
} = this.props, w = !this.validityStyles || this.validity.valid, T = this.props.filter !== void 0 ? this.props.filter : this.state.text, Y = C(this.value, d), O = k(T) ? T : Y, J = o && (!!O || k(this.value)), M = this.base.vs, _ = this.props.id || this._inputId, N = this.mobileMode;
|
|
286
296
|
M.enabled = g !== void 0, g !== void 0 && (M.skip = g.skip, M.total = g.total, M.pageSize = g.pageSize);
|
|
287
|
-
const [
|
|
297
|
+
const [Q, X] = j(this.props.prefix || h.Fragment), [Z, ee] = j(this.props.suffix || h.Fragment), P = /* @__PURE__ */ h.createElement(h.Fragment, null, /* @__PURE__ */ h.createElement(
|
|
288
298
|
"span",
|
|
289
299
|
{
|
|
290
300
|
className: E(
|
|
291
301
|
"k-combobox k-input",
|
|
292
302
|
{
|
|
293
|
-
[`k-input-${
|
|
294
|
-
[`k-rounded-${
|
|
303
|
+
[`k-input-${F[I] || I}`]: I,
|
|
304
|
+
[`k-rounded-${Ce[v] || v}`]: v,
|
|
295
305
|
[`k-input-${y}`]: y,
|
|
296
|
-
"k-invalid": !
|
|
297
|
-
"k-loading":
|
|
306
|
+
"k-invalid": !w,
|
|
307
|
+
"k-loading": c,
|
|
298
308
|
"k-required": this.required,
|
|
299
|
-
"k-disabled":
|
|
309
|
+
"k-disabled": a
|
|
300
310
|
},
|
|
301
311
|
r
|
|
302
312
|
),
|
|
303
313
|
ref: this.componentRef,
|
|
304
|
-
style:
|
|
314
|
+
style: n ? { ...i, width: void 0 } : i,
|
|
305
315
|
dir: t
|
|
306
316
|
},
|
|
307
|
-
this.props.prefix && /* @__PURE__ */
|
|
308
|
-
this.renderSearchBar(O || "",
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
this.props.suffix && /* @__PURE__ */
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
|
|
317
|
+
this.props.prefix && /* @__PURE__ */ h.createElement(Q, { ...X }),
|
|
318
|
+
this.renderSearchBar(O || "", _, m),
|
|
319
|
+
J && !c && /* @__PURE__ */ h.createElement(fe, { onClick: this.clearButtonClick, key: "clearbutton" }),
|
|
320
|
+
c && /* @__PURE__ */ h.createElement(oe, { className: "k-input-loading-icon", name: "loading", key: "loading" }),
|
|
321
|
+
this.props.suffix && /* @__PURE__ */ h.createElement(Z, { ...ee }),
|
|
322
|
+
/* @__PURE__ */ h.createElement(
|
|
323
|
+
z,
|
|
314
324
|
{
|
|
315
325
|
tabIndex: -1,
|
|
316
326
|
type: "button",
|
|
317
|
-
"aria-label":
|
|
327
|
+
"aria-label": u ? e : s,
|
|
318
328
|
icon: p ? void 0 : "caret-alt-down",
|
|
319
329
|
svgIcon: b || be,
|
|
320
330
|
iconClass: p,
|
|
@@ -324,83 +334,88 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
|
|
|
324
334
|
themeColor: "base",
|
|
325
335
|
className: "k-input-button",
|
|
326
336
|
onClick: this.toggleBtnClick,
|
|
327
|
-
onMouseDown: (
|
|
337
|
+
onMouseDown: (te) => te.preventDefault()
|
|
328
338
|
}
|
|
329
339
|
),
|
|
330
|
-
!
|
|
331
|
-
),
|
|
332
|
-
return
|
|
333
|
-
|
|
340
|
+
!N && this.renderListContainer()
|
|
341
|
+
), N && this.renderAdaptiveListContainer());
|
|
342
|
+
return n ? /* @__PURE__ */ h.createElement(
|
|
343
|
+
de,
|
|
334
344
|
{
|
|
335
|
-
label:
|
|
336
|
-
editorId:
|
|
345
|
+
label: n,
|
|
346
|
+
editorId: _,
|
|
337
347
|
editorValue: O,
|
|
338
|
-
editorValid:
|
|
339
|
-
editorDisabled:
|
|
340
|
-
style: { width:
|
|
341
|
-
children:
|
|
348
|
+
editorValid: w,
|
|
349
|
+
editorDisabled: a,
|
|
350
|
+
style: { width: i ? i.width : void 0 },
|
|
351
|
+
children: P
|
|
342
352
|
}
|
|
343
|
-
) :
|
|
353
|
+
) : P;
|
|
344
354
|
}
|
|
345
355
|
/** @hidden */
|
|
346
356
|
onNavigate(s, e, t) {
|
|
347
|
-
const { data:
|
|
348
|
-
|
|
357
|
+
const { data: a = [], virtual: o = { skip: 0 } } = this.props, n = this.props.filter ? this.props.filter : this.state.text;
|
|
358
|
+
let d = -1, l;
|
|
359
|
+
const r = this.base.vs, i = this.value;
|
|
360
|
+
this._suggested = "";
|
|
361
|
+
const c = this.hasDuplicates && this.duplicates.indexOf(i) !== -1;
|
|
362
|
+
if (d = this.getFocusedIndex(c), d !== -1 && !k(i))
|
|
349
363
|
this.handleItemSelect(d, s);
|
|
350
|
-
else if (
|
|
364
|
+
else if (n === "")
|
|
351
365
|
this.handleItemSelect(0, s);
|
|
352
366
|
else {
|
|
353
|
-
const
|
|
367
|
+
const p = o.skip + d;
|
|
368
|
+
l = this.base.navigation.navigate({
|
|
354
369
|
keyCode: e,
|
|
355
|
-
current:
|
|
356
|
-
max: (
|
|
370
|
+
current: p,
|
|
371
|
+
max: (r.enabled ? r.total : a.length) - 1,
|
|
357
372
|
min: 0,
|
|
358
373
|
skipItems: t || void 0
|
|
359
|
-
});
|
|
360
|
-
h !== void 0 && this.handleItemSelect(h, s);
|
|
374
|
+
}), l !== void 0 && this.handleItemSelect(l, s);
|
|
361
375
|
}
|
|
376
|
+
this.navigationIndex = l;
|
|
362
377
|
}
|
|
363
378
|
getCurrentValueDisabledStatus(s, e, t) {
|
|
364
379
|
return s && e && e[t] && e[t].disabled;
|
|
365
380
|
}
|
|
366
381
|
applyValueOnEnter(s, e) {
|
|
367
|
-
const { data: t = [], textField:
|
|
368
|
-
let
|
|
382
|
+
const { data: t = [], textField: a, allowCustom: o } = this.props, n = this.props.opened !== void 0 ? this.props.opened : this.state.opened, l = C(this.value, a) === s ? this.index : R(t, s, a), r = l !== -1;
|
|
383
|
+
let i;
|
|
369
384
|
if (this._suggested = "", r)
|
|
370
|
-
|
|
371
|
-
else if (
|
|
372
|
-
|
|
385
|
+
i = t[l];
|
|
386
|
+
else if (o)
|
|
387
|
+
i = a !== void 0 ? { [a]: s } : s;
|
|
373
388
|
else
|
|
374
389
|
return this.selectFocusedItem(s, e);
|
|
375
|
-
this.triggerOnChange(
|
|
390
|
+
this.triggerOnChange(i, e), n && this.base.togglePopup(e), this.props.filter === void 0 && this.state.text !== void 0 && (e.data.text = void 0), this.applyState(e);
|
|
376
391
|
}
|
|
377
392
|
applyValueOnRejectSuggestions(s, e) {
|
|
378
|
-
const { data: t = [], textField:
|
|
393
|
+
const { data: t = [], textField: a, allowCustom: o } = this.props, n = this.props.opened !== void 0 ? this.props.opened : this.state.opened, d = C(this.value, a);
|
|
379
394
|
if (this._suggested = "", s === d || s === "" && !k(d))
|
|
380
|
-
return
|
|
381
|
-
const
|
|
382
|
-
let
|
|
383
|
-
|
|
395
|
+
return this.closeOpenedApplyStateNonMobileMode(e, n), this.applyState(e);
|
|
396
|
+
const l = R(t, s, a, !0), r = l !== -1;
|
|
397
|
+
let i = null;
|
|
398
|
+
r ? i = t[l] : o && (i = s ? a ? { [a]: s } : s : null), this.triggerOnChange(i, e), this.state.text !== void 0 && (e.data.text = void 0, this.base.filterChanged("", e)), this.closeOpenedApplyStateNonMobileMode(e, n), this.applyState(e);
|
|
384
399
|
}
|
|
385
400
|
selectFocusedItem(s, e) {
|
|
386
|
-
const t = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { data:
|
|
387
|
-
return r !== -1 ? this.handleItemSelect(r +
|
|
401
|
+
const t = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { data: a = [], textField: o, virtual: n = { skip: 0 }, focusedItemIndex: d = A } = this.props, l = n.skip, r = s === "" && l === 0 ? 0 : d(a, s, o);
|
|
402
|
+
return r !== -1 ? this.handleItemSelect(r + l, e) : (this.triggerOnChange(null, e), this.state.text !== void 0 && (e.data.text = void 0)), t && this.base.togglePopup(e), this.applyState(e);
|
|
388
403
|
}
|
|
389
404
|
renderAdaptiveListContainer() {
|
|
390
|
-
const { windowWidth: s = 0 } = this.state, { header: e, footer: t, size:
|
|
405
|
+
const { windowWidth: s = 0 } = this.state, { header: e, footer: t, size: a, data: o = [], groupField: n, groupMode: d, list: l, virtual: r, adaptiveTitle: i, groupStickyHeaderItemRender: c } = this.props, p = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
|
|
391
406
|
let { group: g } = this.state;
|
|
392
|
-
g === void 0 &&
|
|
407
|
+
g === void 0 && n !== void 0 && (g = C(o[0], n));
|
|
393
408
|
const I = {
|
|
394
409
|
navigatable: !1,
|
|
395
410
|
navigatableElements: [],
|
|
396
411
|
expand: p,
|
|
397
412
|
animation: !0,
|
|
398
413
|
onClose: (v) => this.toggleBtnClick(v),
|
|
399
|
-
animationStyles: s <=
|
|
400
|
-
className: s <=
|
|
414
|
+
animationStyles: s <= U ? { top: 0, width: "100%", height: "100%" } : void 0,
|
|
415
|
+
className: s <= U ? "k-adaptive-actionsheet k-actionsheet-fullscreen" : "k-adaptive-actionsheet k-actionsheet-bottom"
|
|
401
416
|
};
|
|
402
|
-
return /* @__PURE__ */
|
|
403
|
-
|
|
417
|
+
return /* @__PURE__ */ h.createElement(Ie, { ...I }, /* @__PURE__ */ h.createElement(ye, { className: "k-text-center" }, /* @__PURE__ */ h.createElement("div", { className: "k-actionsheet-titlebar-group k-hbox" }, /* @__PURE__ */ h.createElement("div", { className: "k-actionsheet-title" }, /* @__PURE__ */ h.createElement("div", null, i)), /* @__PURE__ */ h.createElement("div", { className: "k-actionsheet-actions" }, /* @__PURE__ */ h.createElement(
|
|
418
|
+
z,
|
|
404
419
|
{
|
|
405
420
|
tabIndex: 0,
|
|
406
421
|
"aria-label": "Cancel",
|
|
@@ -411,21 +426,21 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
|
|
|
411
426
|
icon: "x",
|
|
412
427
|
svgIcon: xe
|
|
413
428
|
}
|
|
414
|
-
))), /* @__PURE__ */
|
|
429
|
+
))), /* @__PURE__ */ h.createElement("div", { className: "k-actionsheet-titlebar-group k-actionsheet-filter" }, this.renderMobileListFilter())), /* @__PURE__ */ h.createElement(ke, { className: "!k-overflow-hidden" }, /* @__PURE__ */ h.createElement("div", { className: "k-list-container" }, /* @__PURE__ */ h.createElement("div", { className: E(
|
|
415
430
|
{
|
|
416
|
-
"k-list": !
|
|
431
|
+
"k-list": !l,
|
|
417
432
|
"k-list-lg": !0,
|
|
418
433
|
"k-virtual-list": r,
|
|
419
|
-
"k-data-table":
|
|
420
|
-
[`k-table-${
|
|
434
|
+
"k-data-table": l,
|
|
435
|
+
[`k-table-${F[a] || a}`]: l && a
|
|
421
436
|
}
|
|
422
|
-
) }, e && /* @__PURE__ */
|
|
437
|
+
) }, e && /* @__PURE__ */ h.createElement("div", { className: "k-table-header" }, e), !l && g && o.length !== 0 && /* @__PURE__ */ h.createElement(K, { group: g, groupMode: d, render: c }), this.renderList(), t && /* @__PURE__ */ h.createElement("div", { className: "k-list-footer" }, t)))));
|
|
423
438
|
}
|
|
424
439
|
renderListContainer() {
|
|
425
|
-
const s = this.base, { dir: e, header: t, footer:
|
|
440
|
+
const s = this.base, { dir: e, header: t, footer: a, data: o = [], groupField: n, groupMode: d, size: l, list: r, virtual: i, groupStickyHeaderItemRender: c } = this.props, p = this.props.opened !== void 0 ? this.props.opened : this.state.opened, g = s.getPopupSettings(), I = g.width !== void 0 ? g.width : s.popupWidth;
|
|
426
441
|
let { group: v } = this.state;
|
|
427
|
-
return v === void 0 &&
|
|
428
|
-
|
|
442
|
+
return v === void 0 && n !== void 0 && (v = C(o[0], n)), /* @__PURE__ */ h.createElement(
|
|
443
|
+
ue,
|
|
429
444
|
{
|
|
430
445
|
width: I,
|
|
431
446
|
popupSettings: {
|
|
@@ -439,89 +454,90 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
|
|
|
439
454
|
)
|
|
440
455
|
},
|
|
441
456
|
dir: e !== void 0 ? e : this.base.dirCalculated,
|
|
442
|
-
itemsCount: [
|
|
457
|
+
itemsCount: [o.length]
|
|
443
458
|
},
|
|
444
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ h.createElement("div", { className: E(
|
|
445
460
|
{
|
|
446
461
|
"k-list": !r,
|
|
447
|
-
[`k-list-${
|
|
448
|
-
"k-virtual-list":
|
|
462
|
+
[`k-list-${F[l] || l}`]: !r && l,
|
|
463
|
+
"k-virtual-list": i,
|
|
449
464
|
"k-data-table": r,
|
|
450
|
-
[`k-table-${
|
|
465
|
+
[`k-table-${F[l] || l}`]: r && l
|
|
451
466
|
}
|
|
452
|
-
) }, t && /* @__PURE__ */
|
|
467
|
+
) }, t && /* @__PURE__ */ h.createElement("div", { className: "k-table-header" }, t), !r && v && o.length !== 0 && /* @__PURE__ */ h.createElement(K, { group: v, groupMode: d, render: c }), this.renderList(), a && /* @__PURE__ */ h.createElement("div", { className: E(
|
|
453
468
|
{
|
|
454
469
|
"k-list-footer": !this.props.footerClassName
|
|
455
470
|
},
|
|
456
471
|
this.props.footerClassName
|
|
457
|
-
) },
|
|
472
|
+
) }, a))
|
|
458
473
|
);
|
|
459
474
|
}
|
|
460
475
|
renderList() {
|
|
461
476
|
const s = this.base, {
|
|
462
477
|
textField: e,
|
|
463
478
|
dataItemKey: t,
|
|
464
|
-
listNoDataRender:
|
|
465
|
-
itemRender:
|
|
466
|
-
groupHeaderItemRender:
|
|
479
|
+
listNoDataRender: a,
|
|
480
|
+
itemRender: o,
|
|
481
|
+
groupHeaderItemRender: n,
|
|
467
482
|
data: d = [],
|
|
468
|
-
virtual:
|
|
469
|
-
} = this.props, r = s.getPopupSettings(),
|
|
470
|
-
return /* @__PURE__ */
|
|
483
|
+
virtual: l = { skip: 0, total: void 0 }
|
|
484
|
+
} = this.props, r = s.getPopupSettings(), i = s.vs, c = l.skip, p = this.props.opened !== void 0 ? this.props.opened : this.state.opened, g = `translateY(${i.translate}px)`, I = p ? this.getFocusedIndex(this.hasDuplicates) : void 0, v = this.props.filter !== void 0 ? this.props.filter : this.state.text, y = C(this.value, e), u = k(v) && v !== y ? null : this.value, m = this.props.list || ge;
|
|
485
|
+
return /* @__PURE__ */ h.createElement(
|
|
471
486
|
m,
|
|
472
487
|
{
|
|
473
488
|
id: s.listBoxId,
|
|
474
|
-
virtual: !!
|
|
489
|
+
virtual: !!l,
|
|
475
490
|
show: p,
|
|
476
491
|
data: d,
|
|
477
492
|
focusedIndex: I,
|
|
478
|
-
value:
|
|
493
|
+
value: u,
|
|
479
494
|
textField: e,
|
|
480
495
|
valueField: t,
|
|
481
496
|
groupField: this.props.groupField,
|
|
482
497
|
groupMode: this.props.groupMode,
|
|
483
498
|
isMultiColumn: this.props.isMultiColumn,
|
|
484
499
|
optionsGuid: s.guid,
|
|
500
|
+
hasDuplicates: this.hasDuplicates,
|
|
485
501
|
listRef: (b) => {
|
|
486
|
-
|
|
502
|
+
i.list = this.base.list = b, this.itemHeight = 0;
|
|
487
503
|
},
|
|
488
|
-
wrapperStyle: this.state.windowWidth && this.state.windowWidth >
|
|
504
|
+
wrapperStyle: this.state.windowWidth && this.state.windowWidth > W ? { maxHeight: r.height } : {},
|
|
489
505
|
wrapperCssClass: E(
|
|
490
506
|
"k-list-content",
|
|
491
507
|
{
|
|
492
|
-
"k-list-scroller": !
|
|
508
|
+
"k-list-scroller": !l
|
|
493
509
|
}
|
|
494
510
|
),
|
|
495
|
-
listStyle:
|
|
511
|
+
listStyle: i.enabled ? { transform: g } : void 0,
|
|
496
512
|
key: "listkey",
|
|
497
|
-
skip:
|
|
513
|
+
skip: c,
|
|
498
514
|
onClick: this.handleItemClick,
|
|
499
|
-
itemRender:
|
|
500
|
-
groupHeaderItemRender:
|
|
501
|
-
noDataRender:
|
|
515
|
+
itemRender: o,
|
|
516
|
+
groupHeaderItemRender: n,
|
|
517
|
+
noDataRender: a,
|
|
502
518
|
onMouseDown: (b) => b.preventDefault(),
|
|
503
519
|
onScroll: this.onScroll,
|
|
504
|
-
wrapperRef:
|
|
520
|
+
wrapperRef: i.scrollerRef,
|
|
505
521
|
scroller: this.base.renderScrollElement(),
|
|
506
|
-
ariaSetSize:
|
|
522
|
+
ariaSetSize: l.total
|
|
507
523
|
}
|
|
508
524
|
);
|
|
509
525
|
}
|
|
510
526
|
renderSearchBar(s, e, t) {
|
|
511
527
|
const {
|
|
512
|
-
tabIndex:
|
|
513
|
-
disabled:
|
|
514
|
-
data:
|
|
528
|
+
tabIndex: a,
|
|
529
|
+
disabled: o,
|
|
530
|
+
data: n = [],
|
|
515
531
|
dataItemKey: d,
|
|
516
|
-
virtual:
|
|
517
|
-
} = this.props, r = this.props.opened !== void 0 ? this.props.opened : this.state.opened,
|
|
518
|
-
return this._suggested && !
|
|
519
|
-
|
|
532
|
+
virtual: l = { skip: 0 }
|
|
533
|
+
} = this.props, r = this.props.opened !== void 0 ? this.props.opened : this.state.opened, i = this.value, c = Math.max(0, n.findIndex((p) => S(p, i, d)));
|
|
534
|
+
return this._suggested && !S(this._valueOnDidUpdate, i, d) && (this._suggested = ""), /* @__PURE__ */ h.createElement(
|
|
535
|
+
ce,
|
|
520
536
|
{
|
|
521
537
|
id: e,
|
|
522
538
|
readOnly: r && this.mobileMode,
|
|
523
539
|
placeholder: t,
|
|
524
|
-
tabIndex:
|
|
540
|
+
tabIndex: a,
|
|
525
541
|
title: this.props.title,
|
|
526
542
|
accessKey: this.props.accessKey,
|
|
527
543
|
value: s + this._suggested,
|
|
@@ -532,10 +548,10 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
|
|
|
532
548
|
onChange: this.inputOnChange,
|
|
533
549
|
onFocus: this.base.handleFocus,
|
|
534
550
|
onBlur: this.handleBlur,
|
|
535
|
-
disabled:
|
|
551
|
+
disabled: o,
|
|
536
552
|
expanded: r,
|
|
537
553
|
owns: this.base.listBoxId,
|
|
538
|
-
activedescendant: `option-${this.base.guid}-${
|
|
554
|
+
activedescendant: `option-${this.base.guid}-${c + l.skip}`,
|
|
539
555
|
role: "combobox",
|
|
540
556
|
ariaLabelledBy: this.props.ariaLabelledBy,
|
|
541
557
|
ariaDescribedBy: this.props.ariaDescribedBy,
|
|
@@ -546,17 +562,17 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
|
|
|
546
562
|
}
|
|
547
563
|
clearValue() {
|
|
548
564
|
const s = this.base.initState();
|
|
549
|
-
this._suggested = "", this.base.filterChanged("", s), this.props.filter === void 0 && this.state.text !== void 0 && (s.data.text = void 0), this.triggerOnChange(null, s);
|
|
565
|
+
this._suggested = "", this.navigationIndex = void 0, this.base.filterChanged("", s), this.props.filter === void 0 && this.state.text !== void 0 && (s.data.text = void 0), this.triggerOnChange(null, s);
|
|
550
566
|
const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, t = this.mobileMode;
|
|
551
567
|
e && !t && this.base.togglePopup(s), this.applyState(s);
|
|
552
568
|
}
|
|
553
569
|
triggerOnChange(s, e) {
|
|
554
570
|
const t = this.value;
|
|
555
|
-
!k(t) && !k(s) ||
|
|
571
|
+
!this.hasDuplicates && (!k(t) && !k(s) || S(t, s, this.props.dataItemKey)) || (this.props.value === void 0 && (e.data.value = s), this._valueDuringOnChange = s, e.events.push({ type: "onChange" }));
|
|
556
572
|
}
|
|
557
|
-
getFocusedIndex() {
|
|
558
|
-
const
|
|
559
|
-
return k(
|
|
573
|
+
getFocusedIndex(s) {
|
|
574
|
+
const e = this.value, { data: t = [], textField: a, dataItemKey: o, virtual: n = { skip: 0 }, focusedItemIndex: d = A, skipDisabledItems: l } = this.props, r = this.props.filter ? this.props.filter : this.state.text;
|
|
575
|
+
return s && this.navigationIndex !== void 0 ? this.navigationIndex : k(e) && r === void 0 ? t.findIndex((i) => S(i, e, o)) : r ? d(t, r, a) : l && a && !r && n.skip === 0 ? t.findIndex((i) => !i.disabled && i[a]) : n.skip === 0 ? 0 : -1;
|
|
560
576
|
}
|
|
561
577
|
suggestValue(s) {
|
|
562
578
|
const { data: e, textField: t } = this.props;
|
|
@@ -570,8 +586,8 @@ const Ce = "Please enter a valid value!", { sizeMap: V, roundedMap: Se } = de, w
|
|
|
570
586
|
this.setState({ windowWidth: e.target.clientWidth });
|
|
571
587
|
}
|
|
572
588
|
};
|
|
573
|
-
|
|
574
|
-
...
|
|
589
|
+
D.displayName = "ComboBox", D.propTypes = {
|
|
590
|
+
...V.propTypes,
|
|
575
591
|
size: f.oneOf([null, "small", "medium", "large"]),
|
|
576
592
|
rounded: f.oneOf([null, "small", "medium", "large", "full"]),
|
|
577
593
|
fillMode: f.oneOf([null, "solid", "flat", "outline"]),
|
|
@@ -585,7 +601,7 @@ w.displayName = "ComboBox", w.propTypes = {
|
|
|
585
601
|
allowCustom: f.bool,
|
|
586
602
|
clearButton: f.bool,
|
|
587
603
|
iconClassName: f.string,
|
|
588
|
-
svgIcon:
|
|
604
|
+
svgIcon: ie,
|
|
589
605
|
validationMessage: f.string,
|
|
590
606
|
required: f.bool,
|
|
591
607
|
id: f.string,
|
|
@@ -594,8 +610,8 @@ w.displayName = "ComboBox", w.propTypes = {
|
|
|
594
610
|
list: f.any,
|
|
595
611
|
valueRender: f.func,
|
|
596
612
|
skipDisabledItems: f.bool
|
|
597
|
-
},
|
|
598
|
-
...
|
|
613
|
+
}, D.defaultProps = {
|
|
614
|
+
...V.defaultProps,
|
|
599
615
|
size: "medium",
|
|
600
616
|
rounded: "medium",
|
|
601
617
|
fillMode: "solid",
|
|
@@ -608,11 +624,11 @@ w.displayName = "ComboBox", w.propTypes = {
|
|
|
608
624
|
prefix: void 0,
|
|
609
625
|
suffix: void 0
|
|
610
626
|
};
|
|
611
|
-
let
|
|
612
|
-
const
|
|
627
|
+
let B = D;
|
|
628
|
+
const De = ae(), Ee = ne(le(De, B));
|
|
613
629
|
Ee.displayName = "KendoReactComboBox";
|
|
614
630
|
export {
|
|
615
631
|
Ee as ComboBox,
|
|
616
|
-
|
|
617
|
-
|
|
632
|
+
De as ComboBoxPropsContext,
|
|
633
|
+
B as ComboBoxWithoutContext
|
|
618
634
|
};
|