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