@progress/kendo-react-dropdowns 13.3.0-develop.1 → 13.3.0-develop.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +159 -152
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +1 -1
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
package/ComboBox/ComboBox.mjs
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
import * as g from "react";
|
|
9
9
|
import m from "prop-types";
|
|
10
10
|
import _ from "../common/DropDownBase.mjs";
|
|
11
|
-
import { classNames as S, uComboBox as
|
|
11
|
+
import { classNames as S, uComboBox as F, Keys as I, validatePackage as et, getLicenseMessage as st, svgIconPropType as it, canUseDOM as A, IconWrap as ot, WatermarkOverlay as at, createPropsContext as nt, withIdHOC as lt, withPropsContext as rt, withUnstyledHOC as pt, withAdaptiveModeContext as dt } from "@progress/kendo-react-common";
|
|
12
12
|
import { FloatingLabel as ht } from "@progress/kendo-react-labels";
|
|
13
|
-
import { getPlainDataDuplicates as
|
|
13
|
+
import { getPlainDataDuplicates as ct, getFilteredData as y, areSame as D, getItemValue as w, isPresent as k, getItemIndexByText as z, suggestValue as ut, itemIndexStartsWith as P } from "../common/utils.mjs";
|
|
14
14
|
import gt from "../common/SearchBar.mjs";
|
|
15
15
|
import mt from "../common/ListContainer.mjs";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
16
|
+
import ft from "../common/List.mjs";
|
|
17
|
+
import vt from "../common/ListFilter.mjs";
|
|
18
18
|
import K from "../common/GroupStickyHeader.mjs";
|
|
19
19
|
import { packageMetadata as H } from "../package-metadata.mjs";
|
|
20
20
|
import bt from "../common/ClearButton.mjs";
|
|
@@ -25,18 +25,18 @@ import { provideLocalizationService as U } from "@progress/kendo-react-intl";
|
|
|
25
25
|
import { ActionSheetContent as yt } from "@progress/kendo-react-layout";
|
|
26
26
|
import j from "../common/withCustomComponent.mjs";
|
|
27
27
|
import { AdaptiveMode as Ct } from "../common/AdaptiveMode.mjs";
|
|
28
|
-
const St = "Please enter a valid value!",
|
|
28
|
+
const St = "Please enter a valid value!", E = class E extends g.Component {
|
|
29
29
|
constructor(s) {
|
|
30
|
-
super(s), this.state = {}, this.base = new _(this), this._element = null, this._suggested = "", this._skipBlur = !1, this._input = null, this._adaptiveFilterInput = null, this._skipFocus = !1, this.itemHeight = 0, this.duplicates = [], this.hasDuplicates = !1, this.showLicenseWatermark = !1, this.focus = () => {
|
|
30
|
+
super(s), this.state = {}, this.base = new _(this), this._element = null, this._suggested = "", this._skipBlur = !1, this._input = null, this._adaptiveFilterInput = null, this._skipFocus = !1, this.itemHeight = 0, this.duplicates = [], this.hasDuplicates = !1, this.scrollToFocused = !1, this.showLicenseWatermark = !1, this.focus = () => {
|
|
31
31
|
this._input && this._input.focus();
|
|
32
32
|
}, this.checkForDuplicatePlainTextRecords = () => {
|
|
33
33
|
const t = this.props.textField !== void 0, e = this.props.dataItemKey !== void 0;
|
|
34
34
|
if (this.props.data && this.props.data.length > 0 && !t && !e) {
|
|
35
35
|
const i = this.props.data;
|
|
36
|
-
this.duplicates =
|
|
36
|
+
this.duplicates = ct(i), this.hasDuplicates = this.duplicates.length > 0;
|
|
37
37
|
}
|
|
38
38
|
}, this.handleItemSelect = (t, e) => {
|
|
39
|
-
const { virtual: i, dataItemKey: r } = this.props, n =
|
|
39
|
+
const { virtual: i, dataItemKey: r } = this.props, n = y(this.props), a = i ? i.skip : 0, p = n[t - a], l = this.hasDuplicates || !D(p, this.value, r);
|
|
40
40
|
this.triggerOnChange(p, e), this.state.text !== void 0 && (e.data.text = void 0), l && this.base.triggerPageChangeCornerItems(p, e);
|
|
41
41
|
}, this.onPopupOpened = () => {
|
|
42
42
|
setTimeout(() => {
|
|
@@ -46,7 +46,7 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
46
46
|
this._element = t, this.base.wrapper = t;
|
|
47
47
|
}, this.toggleBtnClick = (t) => {
|
|
48
48
|
this._skipFocus = !0;
|
|
49
|
-
const { skipDisabledItems: e, textField: i } = this.props, r =
|
|
49
|
+
const { skipDisabledItems: e, textField: i } = this.props, r = y(this.props), n = this.getFocusedIndex(), a = this.getCurrentValueDisabledStatus(i, r, n), p = this.props.opened !== void 0 ? this.props.opened : this.state.opened, l = this.base.initState();
|
|
50
50
|
if (l.syntheticEvent = t, !e && i && a && this.clearValueOnToggleBtnClick(t), this.base.togglePopup(l), !p && this.mobileMode) {
|
|
51
51
|
const o = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text || null;
|
|
52
52
|
this.base.filterChanged(o, l);
|
|
@@ -57,9 +57,9 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
57
57
|
}, this.closeOpenedApplyStateNonMobileMode = (t, e) => {
|
|
58
58
|
e && !this.mobileMode && this.base.togglePopup(t);
|
|
59
59
|
}, this.renderMobileListFilter = () => {
|
|
60
|
-
const t = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text, e = w(this.value, this.props.textField), i =
|
|
60
|
+
const t = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text, e = w(this.value, this.props.textField), i = k(t) ? t : e;
|
|
61
61
|
return /* @__PURE__ */ g.createElement(
|
|
62
|
-
|
|
62
|
+
vt,
|
|
63
63
|
{
|
|
64
64
|
value: i,
|
|
65
65
|
ref: (r) => {
|
|
@@ -74,13 +74,13 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
76
|
}, this.listContainerContent = () => {
|
|
77
|
-
const { header: t, footer: e, size: i, groupStickyHeaderItemRender: r, groupField: n, list: a, groupMode: p, unstyled: l, virtual: o } = this.props,
|
|
78
|
-
let { group:
|
|
79
|
-
return
|
|
77
|
+
const { header: t, footer: e, size: i, groupStickyHeaderItemRender: r, groupField: n, list: a, groupMode: p, unstyled: l, virtual: o } = this.props, c = y(this.props), d = l && l.uComboBox;
|
|
78
|
+
let { group: b } = this.state;
|
|
79
|
+
return b === void 0 && n !== void 0 && (b = w(c[0], n)), /* @__PURE__ */ g.createElement(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
className: S(
|
|
83
|
-
|
|
83
|
+
F.list({
|
|
84
84
|
c: d,
|
|
85
85
|
list: a,
|
|
86
86
|
size: "large",
|
|
@@ -89,13 +89,13 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
89
89
|
})
|
|
90
90
|
)
|
|
91
91
|
},
|
|
92
|
-
t && /* @__PURE__ */ g.createElement("div", { className: S(
|
|
93
|
-
!a &&
|
|
92
|
+
t && /* @__PURE__ */ g.createElement("div", { className: S(F.listHeader({ c: d })) }, t),
|
|
93
|
+
!a && b && c.length !== 0 && /* @__PURE__ */ g.createElement(K, { group: b, groupMode: p, render: r }),
|
|
94
94
|
this.renderList(),
|
|
95
95
|
e && /* @__PURE__ */ g.createElement(
|
|
96
96
|
"div",
|
|
97
97
|
{
|
|
98
|
-
className: S(
|
|
98
|
+
className: S(F.listFooter({ c: d }), this.props.footerClassName)
|
|
99
99
|
},
|
|
100
100
|
e
|
|
101
101
|
)
|
|
@@ -107,14 +107,14 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
107
107
|
const { vs: e, list: i } = this.base;
|
|
108
108
|
e.scrollHandler(t);
|
|
109
109
|
const { groupField: r } = this.props;
|
|
110
|
-
let n =
|
|
110
|
+
let n = y(this.props);
|
|
111
111
|
if (!r || !n.length)
|
|
112
112
|
return;
|
|
113
113
|
const a = this.itemHeight = this.itemHeight || (e.enabled ? e.itemHeight : i ? i.children[0].offsetHeight : 0), l = t.target.scrollTop - e.skip * a;
|
|
114
114
|
this.props.groupMode === "modern" && (n = this.base.getGroupedDataModernMode(n, r));
|
|
115
115
|
let o = n[0][r];
|
|
116
|
-
for (let
|
|
117
|
-
n[
|
|
116
|
+
for (let c = 1; c < n.length && !(a * c > l); c++)
|
|
117
|
+
n[c] && n[c][r] && (o = n[c][r]);
|
|
118
118
|
o !== this.state.group && (this.setState({
|
|
119
119
|
group: o
|
|
120
120
|
}), this.props.onGroupScroll && this.props.onGroupScroll.call(void 0, { group: o }));
|
|
@@ -122,7 +122,7 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
122
122
|
this.navigationIndex = t, this.base.handleItemClick(t, e), this._valueDuringOnChange = void 0;
|
|
123
123
|
}, this.handleBlur = (t) => {
|
|
124
124
|
if (this.state.focused && !this._skipBlur) {
|
|
125
|
-
const e = this.base.initState(), { textField: i } = this.props, r =
|
|
125
|
+
const e = this.base.initState(), { textField: i } = this.props, r = y(this.props), n = this.getFocusedIndex(), p = !(n === -1) && this.getCurrentValueDisabledStatus(i, r, n);
|
|
126
126
|
e.data.focused = !1, e.events.push({ type: "onBlur" }), e.syntheticEvent = t, i && p && this.clearValueOnBlur(t), this.applyValueOnRejectSuggestions(t.currentTarget.value, e);
|
|
127
127
|
}
|
|
128
128
|
}, this.onInputClick = (t) => {
|
|
@@ -132,59 +132,59 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
132
132
|
r.syntheticEvent = t, this.base.togglePopup(r), this.base.filterChanged(i, r), this.applyState(r);
|
|
133
133
|
}
|
|
134
134
|
}, this.onInputKeyDown = (t) => {
|
|
135
|
-
const { skipDisabledItems: e, textField: i, dataItemKey: r, groupField: n } = this.props, a =
|
|
135
|
+
const { skipDisabledItems: e, textField: i, dataItemKey: r, groupField: n } = this.props, a = y(this.props), p = this.value, l = Math.max(
|
|
136
136
|
0,
|
|
137
137
|
a.findIndex((u) => D(u, p, r))
|
|
138
|
-
), o = t.keyCode,
|
|
139
|
-
if (d.syntheticEvent = t, !t.altKey && (o ===
|
|
138
|
+
), o = t.keyCode, c = this.props.opened !== void 0 ? this.props.opened : this.state.opened, d = this.base.initState();
|
|
139
|
+
if (d.syntheticEvent = t, !t.altKey && (o === I.up || o === I.down)) {
|
|
140
140
|
if (t.preventDefault(), n !== "" && i)
|
|
141
|
-
if (!this.props.skipDisabledItems &&
|
|
141
|
+
if (!this.props.skipDisabledItems && c)
|
|
142
142
|
this.onNavigate(d, o);
|
|
143
143
|
else {
|
|
144
144
|
let u = 0;
|
|
145
|
-
if (o ===
|
|
146
|
-
const
|
|
147
|
-
u =
|
|
148
|
-
} else if (o ===
|
|
149
|
-
let
|
|
145
|
+
if (o === I.down || o === I.right) {
|
|
146
|
+
const h = a.slice(l + 1 < a.length ? l + 1 : l).find((v) => !v.disabled && v[i]);
|
|
147
|
+
u = h && a.findIndex((v) => v[i] === h[i]);
|
|
148
|
+
} else if (o === I.up || o === I.left) {
|
|
149
|
+
let h;
|
|
150
150
|
if (l === 0)
|
|
151
|
-
|
|
151
|
+
h = a, u = a.findIndex((v) => !v.disabled && v[i]);
|
|
152
152
|
else {
|
|
153
|
-
|
|
154
|
-
let
|
|
155
|
-
for (;
|
|
156
|
-
|
|
157
|
-
u =
|
|
153
|
+
h = a.slice(0, l);
|
|
154
|
+
let v = h.pop();
|
|
155
|
+
for (; v && v.disabled; )
|
|
156
|
+
v = h.pop();
|
|
157
|
+
u = v && a.findIndex((M) => M[i] === v[i]);
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
if (u !== void 0) {
|
|
161
|
-
const
|
|
162
|
-
this.onNavigate(d, o,
|
|
163
|
-
} else u === void 0 && a.findIndex((
|
|
161
|
+
const h = u - l;
|
|
162
|
+
this.onNavigate(d, o, h);
|
|
163
|
+
} else u === void 0 && a.findIndex((h) => h[i] === p[i]) === a.length - 1 && this.onNavigate(d, o);
|
|
164
164
|
}
|
|
165
|
-
else if (!this.props.skipDisabledItems &&
|
|
165
|
+
else if (!this.props.skipDisabledItems && c)
|
|
166
166
|
this.onNavigate(d, o);
|
|
167
167
|
else {
|
|
168
168
|
let u = null;
|
|
169
|
-
if (o ===
|
|
170
|
-
u = a.slice(l + 1).find((
|
|
171
|
-
else if (o ===
|
|
172
|
-
const
|
|
173
|
-
for (u =
|
|
174
|
-
u =
|
|
169
|
+
if (o === I.down || o === I.right)
|
|
170
|
+
u = a.slice(l + 1).find((h) => !h.disabled);
|
|
171
|
+
else if (o === I.up || o === I.left) {
|
|
172
|
+
const h = a.slice(0, l);
|
|
173
|
+
for (u = h.pop(); u && u.disabled; )
|
|
174
|
+
u = h.pop();
|
|
175
175
|
}
|
|
176
176
|
if (u) {
|
|
177
|
-
const
|
|
178
|
-
this.onNavigate(d, o,
|
|
177
|
+
const h = u.id - l - 1;
|
|
178
|
+
this.onNavigate(d, o, h);
|
|
179
179
|
} else
|
|
180
180
|
this.onNavigate(d, o);
|
|
181
181
|
}
|
|
182
182
|
this.applyState(d);
|
|
183
183
|
}
|
|
184
|
-
const
|
|
184
|
+
const b = () => {
|
|
185
185
|
t.preventDefault(), this.base.togglePopup(d), this.applyState(d);
|
|
186
|
-
}, x = this.getFocusedIndex(),
|
|
187
|
-
|
|
186
|
+
}, x = this.getFocusedIndex(), C = x === -1, f = !C && this.getCurrentValueDisabledStatus(i, a, x);
|
|
187
|
+
c ? o === I.pageUp ? (t.preventDefault(), this.base.scrollPopupByPageSize(-1)) : o === I.pageDown ? (t.preventDefault(), this.base.scrollPopupByPageSize(1)) : t.altKey && o === I.up ? b() : o === I.enter ? (t.preventDefault(), (i && !C && t.currentTarget.value ? a[x][i] : void 0) ? !e && i && f ? this.clearValueOnEnterOrEsc(t) : f || this.applyValueOnEnter(t.currentTarget.value, d) : this.applyValueOnEnter(t.currentTarget.value, d)) : o === I.esc && (!e && i && f && this.clearValueOnEnterOrEsc(t), this.applyValueOnRejectSuggestions(t.currentTarget.value, d)) : !c && o === I.esc ? this.clearValueOnEnterOrEsc(t) : t.altKey && o === I.down && b();
|
|
188
188
|
}, this.inputOnChange = (t) => {
|
|
189
189
|
const e = this.base.initState();
|
|
190
190
|
e.syntheticEvent = t;
|
|
@@ -192,11 +192,11 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
192
192
|
if (this.props.suggest) {
|
|
193
193
|
const a = r.selectionEnd === n.length;
|
|
194
194
|
let p = this.props.filter !== void 0 ? this.props.filter : this.state.text;
|
|
195
|
-
|
|
195
|
+
k(p) || (p = w(this.value, this.props.textField) || "");
|
|
196
196
|
const l = p && p === n, o = p && p.length > n.length;
|
|
197
197
|
l || o || !a ? this._suggested = "" : this.suggestValue(n);
|
|
198
198
|
}
|
|
199
|
-
this.props.filter === void 0 && (e.data.text = n), this.state.focusedItem !== void 0 && (e.data.focusedItem = void 0), i
|
|
199
|
+
this.props.filter === void 0 && (e.data.text = n), this.state.focusedItem !== void 0 && (e.data.focusedItem = void 0), i ? this.scrollToFocused = !0 : this.base.togglePopup(e), this.base.filterChanged(n, e), this.applyState(e), this.setState({ group: void 0 });
|
|
200
200
|
}, this.clearButtonClick = (t) => {
|
|
201
201
|
const e = this.base.initState();
|
|
202
202
|
e.syntheticEvent = t, t.stopPropagation(), this.clearValue();
|
|
@@ -226,7 +226,7 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
226
226
|
return this.props.id;
|
|
227
227
|
}
|
|
228
228
|
get document() {
|
|
229
|
-
if (
|
|
229
|
+
if (A)
|
|
230
230
|
return this.element && this.element.ownerDocument || document;
|
|
231
231
|
}
|
|
232
232
|
/** @hidden */
|
|
@@ -257,7 +257,7 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
257
257
|
* The index of the selected item.
|
|
258
258
|
*/
|
|
259
259
|
get index() {
|
|
260
|
-
const { dataItemKey: s } = this.props, t =
|
|
260
|
+
const { dataItemKey: s } = this.props, t = y(this.props), e = this.value;
|
|
261
261
|
return t.findIndex((i) => D(i, e, s));
|
|
262
262
|
}
|
|
263
263
|
/**
|
|
@@ -278,33 +278,40 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
278
278
|
};
|
|
279
279
|
}
|
|
280
280
|
get validityStyles() {
|
|
281
|
-
return this.props.validityStyles !== void 0 ? this.props.validityStyles :
|
|
281
|
+
return this.props.validityStyles !== void 0 ? this.props.validityStyles : E.defaultProps.validityStyles;
|
|
282
282
|
}
|
|
283
283
|
/** @hidden */
|
|
284
284
|
get required() {
|
|
285
|
-
return this.props.required !== void 0 ? this.props.required :
|
|
285
|
+
return this.props.required !== void 0 ? this.props.required : E.defaultProps.required;
|
|
286
286
|
}
|
|
287
287
|
/** @hidden */
|
|
288
288
|
componentDidUpdate(s, t) {
|
|
289
|
-
var
|
|
290
|
-
const { dataItemKey: e, virtual: i, groupField: r = "", textField: n } = this.props, a =
|
|
289
|
+
var b, x;
|
|
290
|
+
const { dataItemKey: e, virtual: i, groupField: r = "", textField: n } = this.props, a = y(this.props), p = s.virtual ? s.virtual.total : 0, l = this.props.opened !== void 0 ? this.props.opened : this.state.opened, o = s.opened !== void 0 ? s.opened : t.opened;
|
|
291
291
|
s.data !== a && this.checkForDuplicatePlainTextRecords();
|
|
292
|
-
const
|
|
292
|
+
const c = !o && l, d = this.value;
|
|
293
293
|
if (this._valueOnDidUpdate = d, this.base.didUpdate(), i && i.total !== p)
|
|
294
294
|
this.base.vs.calcScrollElementHeight(), this.base.vs.reset();
|
|
295
295
|
else {
|
|
296
|
-
const
|
|
297
|
-
let
|
|
298
|
-
this.props.groupMode === "modern" && n && d && (
|
|
299
|
-
const
|
|
300
|
-
|
|
296
|
+
const C = s.value !== void 0 ? s.value : t.value;
|
|
297
|
+
let f = this.hasDuplicates ? this.navigationIndex || 0 : a.findIndex((h) => D(h, d, e));
|
|
298
|
+
this.props.groupMode === "modern" && n && d && (f = (b = this.base.getGroupedDataModernMode(a, r)) == null ? void 0 : b.map((h) => h[n]).indexOf(d[n]));
|
|
299
|
+
const u = !D(C, d, e);
|
|
300
|
+
if (c && i ? this.base.scrollToVirtualItem(i, f) : c && !i ? (this.onPopupOpened(), a && a.length !== 0 && this.base.resetGroupStickyHeader(a[0][r], this), this.base.scrollToItem(f)) : (this.hasDuplicates || l && o && d && u) && this.base.scrollToItem(f), l && o && this.scrollToFocused) {
|
|
301
|
+
const h = (x = this.props.filter ? this.props.filter : this.state.text) != null ? x : "";
|
|
302
|
+
if (h) {
|
|
303
|
+
const { focusedItemIndex: v = P } = this.props, M = v(a, h, n);
|
|
304
|
+
this.base.scrollToItem(M);
|
|
305
|
+
} else
|
|
306
|
+
this.base.scrollToItem(0);
|
|
307
|
+
}
|
|
301
308
|
}
|
|
302
|
-
|
|
309
|
+
this.scrollToFocused = !1, c && this._input && this._input.focus(), this.setValidity();
|
|
303
310
|
}
|
|
304
311
|
/** @hidden */
|
|
305
312
|
componentDidMount() {
|
|
306
313
|
var s;
|
|
307
|
-
this.observerResize =
|
|
314
|
+
this.observerResize = A && 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();
|
|
308
315
|
}
|
|
309
316
|
/** @hidden */
|
|
310
317
|
componentWillUnmount() {
|
|
@@ -322,34 +329,34 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
322
329
|
), {
|
|
323
330
|
dir: e,
|
|
324
331
|
disabled: i,
|
|
325
|
-
clearButton: r =
|
|
332
|
+
clearButton: r = E.defaultProps.clearButton,
|
|
326
333
|
label: n,
|
|
327
334
|
textField: a,
|
|
328
335
|
className: p,
|
|
329
336
|
style: l,
|
|
330
337
|
loading: o,
|
|
331
|
-
iconClassName:
|
|
338
|
+
iconClassName: c,
|
|
332
339
|
virtual: d,
|
|
333
|
-
size:
|
|
340
|
+
size: b,
|
|
334
341
|
rounded: x,
|
|
335
|
-
fillMode:
|
|
336
|
-
opened:
|
|
342
|
+
fillMode: C,
|
|
343
|
+
opened: f = this.state.opened,
|
|
337
344
|
placeholder: u,
|
|
338
|
-
svgIcon:
|
|
339
|
-
unstyled:
|
|
340
|
-
} = this.props,
|
|
345
|
+
svgIcon: h,
|
|
346
|
+
unstyled: v
|
|
347
|
+
} = this.props, M = !this.validityStyles || this.validity.valid, O = this.props.filter !== void 0 ? this.props.filter : this.state.text, $ = w(this.value, a), T = k(O) ? O : $, Y = r && (!!T || k(this.value)), B = this.base.vs, N = this.props.id || this._inputId, V = v && v.uComboBox;
|
|
341
348
|
B.enabled = d !== void 0, d !== void 0 && (B.skip = d.skip, B.total = d.total, B.pageSize = d.pageSize);
|
|
342
|
-
const [J, Q] = j(this.props.prefix || g.Fragment), [X, Z] = j(this.props.suffix || g.Fragment),
|
|
349
|
+
const [J, Q] = j(this.props.prefix || g.Fragment), [X, Z] = j(this.props.suffix || g.Fragment), R = /* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement(
|
|
343
350
|
"span",
|
|
344
351
|
{
|
|
345
352
|
className: S(
|
|
346
|
-
|
|
347
|
-
c:
|
|
348
|
-
size:
|
|
353
|
+
F.wrapper({
|
|
354
|
+
c: V,
|
|
355
|
+
size: b,
|
|
349
356
|
rounded: x,
|
|
350
|
-
fillMode:
|
|
357
|
+
fillMode: C,
|
|
351
358
|
disabled: i,
|
|
352
|
-
invalid: !
|
|
359
|
+
invalid: !M,
|
|
353
360
|
loading: o,
|
|
354
361
|
required: this.required
|
|
355
362
|
}),
|
|
@@ -361,12 +368,12 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
361
368
|
onFocus: this.handleFocus
|
|
362
369
|
},
|
|
363
370
|
this.props.prefix && /* @__PURE__ */ g.createElement(J, { ...Q }),
|
|
364
|
-
this.renderSearchBar(
|
|
371
|
+
this.renderSearchBar(T || "", N, u),
|
|
365
372
|
Y && !o && /* @__PURE__ */ g.createElement(bt, { onClick: this.clearButtonClick, key: "clearbutton" }),
|
|
366
373
|
o && /* @__PURE__ */ g.createElement(
|
|
367
374
|
ot,
|
|
368
375
|
{
|
|
369
|
-
className: S(
|
|
376
|
+
className: S(F.loadingIcon({ c: V })),
|
|
370
377
|
name: "loading",
|
|
371
378
|
key: "loading"
|
|
372
379
|
}
|
|
@@ -377,15 +384,15 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
377
384
|
{
|
|
378
385
|
tabIndex: -1,
|
|
379
386
|
type: "button",
|
|
380
|
-
"aria-label":
|
|
381
|
-
icon:
|
|
382
|
-
svgIcon:
|
|
383
|
-
iconClass:
|
|
384
|
-
size:
|
|
385
|
-
fillMode:
|
|
387
|
+
"aria-label": f ? t : s,
|
|
388
|
+
icon: c ? void 0 : "caret-alt-down",
|
|
389
|
+
svgIcon: h || It,
|
|
390
|
+
iconClass: c,
|
|
391
|
+
size: b,
|
|
392
|
+
fillMode: C,
|
|
386
393
|
rounded: null,
|
|
387
394
|
themeColor: "base",
|
|
388
|
-
className: S(
|
|
395
|
+
className: S(F.inputButton({ c: V })),
|
|
389
396
|
onClick: this.toggleBtnClick,
|
|
390
397
|
onMouseDown: (tt) => tt.preventDefault()
|
|
391
398
|
}
|
|
@@ -396,24 +403,24 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
396
403
|
ht,
|
|
397
404
|
{
|
|
398
405
|
label: n,
|
|
399
|
-
editorId:
|
|
400
|
-
editorValue:
|
|
401
|
-
editorValid:
|
|
406
|
+
editorId: N,
|
|
407
|
+
editorValue: T,
|
|
408
|
+
editorValid: M,
|
|
402
409
|
editorDisabled: i,
|
|
403
410
|
style: { width: l ? l.width : void 0 },
|
|
404
|
-
children:
|
|
405
|
-
unstyled:
|
|
411
|
+
children: R,
|
|
412
|
+
unstyled: v
|
|
406
413
|
}
|
|
407
|
-
) :
|
|
414
|
+
) : R;
|
|
408
415
|
}
|
|
409
416
|
/** @hidden */
|
|
410
417
|
onNavigate(s, t, e) {
|
|
411
|
-
const { virtual: i = { skip: 0 } } = this.props, r =
|
|
418
|
+
const { virtual: i = { skip: 0 } } = this.props, r = y(this.props), n = this.props.filter ? this.props.filter : this.state.text;
|
|
412
419
|
let a = -1, p;
|
|
413
420
|
const l = this.base.vs, o = this.value;
|
|
414
421
|
this._suggested = "";
|
|
415
|
-
const
|
|
416
|
-
if (a = this.getFocusedIndex(
|
|
422
|
+
const c = this.hasDuplicates && this.duplicates.indexOf(o) !== -1;
|
|
423
|
+
if (a = this.getFocusedIndex(c), a !== -1 && !k(o))
|
|
417
424
|
this.handleItemSelect(a, s);
|
|
418
425
|
else if (n === "")
|
|
419
426
|
this.handleItemSelect(0, s);
|
|
@@ -433,7 +440,7 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
433
440
|
return s && t && t[e] && t[e].disabled;
|
|
434
441
|
}
|
|
435
442
|
applyValueOnEnter(s, t) {
|
|
436
|
-
const { textField: e, allowCustom: i } = this.props, r =
|
|
443
|
+
const { textField: e, allowCustom: i } = this.props, r = y(this.props), n = this.props.opened !== void 0 ? this.props.opened : this.state.opened, p = w(this.value, e) === s ? this.index : z(r, s, e), l = p !== -1;
|
|
437
444
|
let o;
|
|
438
445
|
if (this._suggested = "", l)
|
|
439
446
|
o = r[p];
|
|
@@ -444,19 +451,19 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
444
451
|
this.triggerOnChange(o, t), n && this.base.togglePopup(t), this.props.filter === void 0 && this.state.text !== void 0 && (t.data.text = void 0), this.applyState(t);
|
|
445
452
|
}
|
|
446
453
|
applyValueOnRejectSuggestions(s, t) {
|
|
447
|
-
const { textField: e, allowCustom: i } = this.props, r =
|
|
448
|
-
if (this._suggested = "", s === a || s === "" && !
|
|
454
|
+
const { textField: e, allowCustom: i } = this.props, r = y(this.props), n = this.props.opened !== void 0 ? this.props.opened : this.state.opened, a = w(this.value, e);
|
|
455
|
+
if (this._suggested = "", s === a || s === "" && !k(a))
|
|
449
456
|
return this.closeOpenedApplyStateNonMobileMode(t, n), this.applyState(t);
|
|
450
|
-
const p =
|
|
457
|
+
const p = z(r, s, e, !0), l = p !== -1;
|
|
451
458
|
let o = null;
|
|
452
459
|
l ? o = r[p] : i && (o = s ? e ? { [e]: s } : s : null), this.triggerOnChange(o, t), this.state.text !== void 0 && (t.data.text = void 0, this.base.filterChanged("", t)), this.closeOpenedApplyStateNonMobileMode(t, n), this.applyState(t);
|
|
453
460
|
}
|
|
454
461
|
selectFocusedItem(s, t) {
|
|
455
|
-
const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { textField: i, virtual: r = { skip: 0 }, focusedItemIndex: n =
|
|
462
|
+
const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { textField: i, virtual: r = { skip: 0 }, focusedItemIndex: n = P } = this.props, a = y(this.props), p = r.skip, l = s === "" && p === 0 ? 0 : n(a, s, i);
|
|
456
463
|
return l !== -1 ? this.handleItemSelect(l + p, t) : (this.triggerOnChange(null, t), this.state.text !== void 0 && (t.data.text = void 0)), e && this.base.togglePopup(t), this.applyState(t);
|
|
457
464
|
}
|
|
458
465
|
renderAdaptiveListContainer() {
|
|
459
|
-
const { windowWidth: s = 0 } = this.state, { groupField: t, adaptiveTitle: e = this.props.label, adaptiveSubtitle: i } = this.props, r =
|
|
466
|
+
const { windowWidth: s = 0 } = this.state, { groupField: t, adaptiveTitle: e = this.props.label, adaptiveSubtitle: i } = this.props, r = y(this.props), n = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
|
|
460
467
|
let { group: a } = this.state;
|
|
461
468
|
a === void 0 && t !== void 0 && (a = w(r[0], t));
|
|
462
469
|
const p = {
|
|
@@ -480,21 +487,21 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
480
487
|
list: p,
|
|
481
488
|
virtual: l,
|
|
482
489
|
groupStickyHeaderItemRender: o,
|
|
483
|
-
unstyled:
|
|
484
|
-
} = this.props, d =
|
|
490
|
+
unstyled: c
|
|
491
|
+
} = this.props, d = y(this.props), b = this.props.opened !== void 0 ? this.props.opened : this.state.opened, x = s.getPopupSettings(), C = x.width !== void 0 ? x.width : s.popupWidth, f = c && c.uComboBox;
|
|
485
492
|
let { group: u } = this.state;
|
|
486
493
|
return u === void 0 && r !== void 0 && (u = w(d[0], r)), /* @__PURE__ */ g.createElement(
|
|
487
494
|
mt,
|
|
488
495
|
{
|
|
489
|
-
width:
|
|
496
|
+
width: C,
|
|
490
497
|
popupSettings: {
|
|
491
498
|
...x,
|
|
492
499
|
anchor: x.anchor || this.element,
|
|
493
|
-
show:
|
|
500
|
+
show: b,
|
|
494
501
|
popupClass: S(
|
|
495
502
|
x.popupClass,
|
|
496
|
-
|
|
497
|
-
c:
|
|
503
|
+
F.listContainer({
|
|
504
|
+
c: f,
|
|
498
505
|
popup: !0
|
|
499
506
|
})
|
|
500
507
|
)
|
|
@@ -506,8 +513,8 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
506
513
|
"div",
|
|
507
514
|
{
|
|
508
515
|
className: S(
|
|
509
|
-
|
|
510
|
-
c:
|
|
516
|
+
F.list({
|
|
517
|
+
c: f,
|
|
511
518
|
list: p,
|
|
512
519
|
size: a,
|
|
513
520
|
tableSize: a,
|
|
@@ -515,14 +522,14 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
515
522
|
})
|
|
516
523
|
)
|
|
517
524
|
},
|
|
518
|
-
e && /* @__PURE__ */ g.createElement("div", { className: S(
|
|
525
|
+
e && /* @__PURE__ */ g.createElement("div", { className: S(F.listHeader({ c: f })) }, e),
|
|
519
526
|
!p && u && d.length !== 0 && /* @__PURE__ */ g.createElement(K, { group: u, groupMode: n, render: o }),
|
|
520
527
|
this.renderList(),
|
|
521
528
|
i && /* @__PURE__ */ g.createElement(
|
|
522
529
|
"div",
|
|
523
530
|
{
|
|
524
531
|
className: S(
|
|
525
|
-
|
|
532
|
+
F.listFooter({ c: f }),
|
|
526
533
|
this.props.footerClassName
|
|
527
534
|
)
|
|
528
535
|
},
|
|
@@ -541,16 +548,16 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
541
548
|
groupHeaderItemRender: n,
|
|
542
549
|
virtual: a = { skip: 0, total: void 0 },
|
|
543
550
|
unstyled: p
|
|
544
|
-
} = this.props, l =
|
|
551
|
+
} = this.props, l = y(this.props), o = s.getPopupSettings(), c = s.vs, d = a.skip, b = this.props.opened !== void 0 ? this.props.opened : this.state.opened, x = `translateY(${c.translate}px)`, C = b ? this.getFocusedIndex(this.hasDuplicates) : void 0, f = this.props.filter !== void 0 ? this.props.filter : this.state.text, u = w(this.value, t), h = k(f) && f !== u ? null : this.value, v = this.props.list || ft, M = p && p.uComboBox;
|
|
545
552
|
return /* @__PURE__ */ g.createElement(
|
|
546
|
-
|
|
553
|
+
v,
|
|
547
554
|
{
|
|
548
555
|
id: s.listBoxId,
|
|
549
556
|
virtual: !!a,
|
|
550
|
-
show:
|
|
557
|
+
show: b,
|
|
551
558
|
data: l,
|
|
552
|
-
focusedIndex:
|
|
553
|
-
value:
|
|
559
|
+
focusedIndex: C,
|
|
560
|
+
value: h,
|
|
554
561
|
textField: t,
|
|
555
562
|
valueField: e,
|
|
556
563
|
groupField: this.props.groupField,
|
|
@@ -559,16 +566,16 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
559
566
|
optionsGuid: s.guid,
|
|
560
567
|
hasDuplicates: this.hasDuplicates,
|
|
561
568
|
listRef: (O) => {
|
|
562
|
-
|
|
569
|
+
c.list = this.base.list = O, this.itemHeight = 0;
|
|
563
570
|
},
|
|
564
571
|
wrapperStyle: this.mobileMode ? {} : { maxHeight: o.height },
|
|
565
572
|
wrapperCssClass: S(
|
|
566
|
-
|
|
567
|
-
c:
|
|
573
|
+
F.listContent({
|
|
574
|
+
c: M,
|
|
568
575
|
virtual: a
|
|
569
576
|
})
|
|
570
577
|
),
|
|
571
|
-
listStyle:
|
|
578
|
+
listStyle: c.enabled ? { transform: x } : void 0,
|
|
572
579
|
key: "listkey",
|
|
573
580
|
skip: d,
|
|
574
581
|
onClick: this.handleItemClick,
|
|
@@ -577,7 +584,7 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
577
584
|
noDataRender: i,
|
|
578
585
|
onMouseDown: (O) => O.preventDefault(),
|
|
579
586
|
onScroll: this.onScroll,
|
|
580
|
-
wrapperRef:
|
|
587
|
+
wrapperRef: c.scrollerRef,
|
|
581
588
|
scroller: this.base.renderScrollElement(),
|
|
582
589
|
ariaSetSize: a.total
|
|
583
590
|
}
|
|
@@ -592,26 +599,26 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
592
599
|
ariaLabelledBy: p,
|
|
593
600
|
ariaDescribedBy: l,
|
|
594
601
|
dataItemKey: o,
|
|
595
|
-
virtual:
|
|
602
|
+
virtual: c = { skip: 0 },
|
|
596
603
|
unstyled: d,
|
|
597
|
-
inputAttributes:
|
|
598
|
-
} = this.props, x =
|
|
604
|
+
inputAttributes: b
|
|
605
|
+
} = this.props, x = y(this.props), C = this.props.opened !== void 0 ? this.props.opened : this.state.opened, f = this.value, u = Math.max(
|
|
599
606
|
0,
|
|
600
|
-
x.findIndex((
|
|
607
|
+
x.findIndex((h) => D(h, f, o))
|
|
601
608
|
);
|
|
602
|
-
return this._suggested && !D(this._valueOnDidUpdate,
|
|
609
|
+
return this._suggested && !D(this._valueOnDidUpdate, f, o) && (this._suggested = ""), /* @__PURE__ */ g.createElement(
|
|
603
610
|
gt,
|
|
604
611
|
{
|
|
605
612
|
id: t,
|
|
606
|
-
readOnly:
|
|
613
|
+
readOnly: C && this.mobileMode,
|
|
607
614
|
placeholder: e,
|
|
608
615
|
tabIndex: i,
|
|
609
616
|
accessKey: r,
|
|
610
617
|
title: a,
|
|
611
618
|
value: s + this._suggested,
|
|
612
619
|
suggestedText: this._suggested,
|
|
613
|
-
ref: (
|
|
614
|
-
this._input =
|
|
620
|
+
ref: (h) => {
|
|
621
|
+
this._input = h && h.input;
|
|
615
622
|
},
|
|
616
623
|
onClick: this.onInputClick,
|
|
617
624
|
onKeyDown: this.onInputKeyDown,
|
|
@@ -619,9 +626,9 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
619
626
|
onFocus: this.base.handleFocus,
|
|
620
627
|
onBlur: this.handleBlur,
|
|
621
628
|
disabled: n,
|
|
622
|
-
expanded:
|
|
629
|
+
expanded: C,
|
|
623
630
|
owns: this.base.listBoxId,
|
|
624
|
-
activedescendant: `option-${this.base.guid}-${u +
|
|
631
|
+
activedescendant: `option-${this.base.guid}-${u + c.skip}`,
|
|
625
632
|
role: "combobox",
|
|
626
633
|
ariaLabelledBy: p,
|
|
627
634
|
ariaLabel: this.props.ariaLabel,
|
|
@@ -630,7 +637,7 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
630
637
|
render: this.props.valueRender,
|
|
631
638
|
ariaControls: this.base.listBoxId,
|
|
632
639
|
unstyled: d,
|
|
633
|
-
inputAttributes:
|
|
640
|
+
inputAttributes: b
|
|
634
641
|
}
|
|
635
642
|
);
|
|
636
643
|
}
|
|
@@ -642,21 +649,21 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
642
649
|
}
|
|
643
650
|
triggerOnChange(s, t) {
|
|
644
651
|
const e = this.value;
|
|
645
|
-
!this.hasDuplicates && (!
|
|
652
|
+
!this.hasDuplicates && (!k(e) && !k(s) || D(e, s, this.props.dataItemKey)) || (this.props.value === void 0 && (t.data.value = s), this._valueDuringOnChange = s, t.events.push({ type: "onChange" }));
|
|
646
653
|
}
|
|
647
654
|
getFocusedIndex(s) {
|
|
648
655
|
const t = this.value, {
|
|
649
656
|
textField: e,
|
|
650
657
|
dataItemKey: i,
|
|
651
658
|
virtual: r = { skip: 0 },
|
|
652
|
-
focusedItemIndex: n =
|
|
659
|
+
focusedItemIndex: n = P,
|
|
653
660
|
skipDisabledItems: a
|
|
654
|
-
} = this.props, p =
|
|
655
|
-
return s && this.navigationIndex !== void 0 ? this.navigationIndex :
|
|
661
|
+
} = this.props, p = y(this.props), l = this.props.filter ? this.props.filter : this.state.text;
|
|
662
|
+
return s && this.navigationIndex !== void 0 ? this.navigationIndex : k(t) && l === void 0 ? p.findIndex((o) => D(o, t, i)) : l ? n(p, l, e) : a && e && !l && r.skip === 0 ? p.findIndex((o) => !o.disabled && o[e]) : r.skip === 0 ? 0 : -1;
|
|
656
663
|
}
|
|
657
664
|
suggestValue(s) {
|
|
658
665
|
const { data: t, textField: e } = this.props;
|
|
659
|
-
this._suggested =
|
|
666
|
+
this._suggested = ut(s, t, e);
|
|
660
667
|
}
|
|
661
668
|
applyState(s) {
|
|
662
669
|
this.base.applyState(s), this._valueDuringOnChange = void 0;
|
|
@@ -666,7 +673,7 @@ const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
|
666
673
|
this.setState({ windowWidth: t.target.clientWidth });
|
|
667
674
|
}
|
|
668
675
|
};
|
|
669
|
-
|
|
676
|
+
E.displayName = "ComboBox", E.propTypes = {
|
|
670
677
|
..._.propTypes,
|
|
671
678
|
size: m.oneOf([null, "small", "medium", "large"]),
|
|
672
679
|
rounded: m.oneOf([null, "small", "medium", "large", "full"]),
|
|
@@ -692,7 +699,7 @@ M.displayName = "ComboBox", M.propTypes = {
|
|
|
692
699
|
valueRender: m.func,
|
|
693
700
|
skipDisabledItems: m.bool,
|
|
694
701
|
inputAttributes: m.object
|
|
695
|
-
},
|
|
702
|
+
}, E.defaultProps = {
|
|
696
703
|
..._.defaultProps,
|
|
697
704
|
size: "medium",
|
|
698
705
|
rounded: "medium",
|
|
@@ -706,18 +713,18 @@ M.displayName = "ComboBox", M.propTypes = {
|
|
|
706
713
|
prefix: void 0,
|
|
707
714
|
suffix: void 0
|
|
708
715
|
};
|
|
709
|
-
let
|
|
710
|
-
const
|
|
716
|
+
let L = E;
|
|
717
|
+
const Ft = nt(), kt = lt(
|
|
711
718
|
rt(
|
|
712
|
-
|
|
719
|
+
Ft,
|
|
713
720
|
pt(
|
|
714
|
-
dt(
|
|
721
|
+
dt(L)
|
|
715
722
|
)
|
|
716
723
|
)
|
|
717
724
|
);
|
|
718
|
-
|
|
725
|
+
kt.displayName = "KendoReactComboBox";
|
|
719
726
|
export {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
727
|
+
kt as ComboBox,
|
|
728
|
+
Ft as ComboBoxPropsContext,
|
|
729
|
+
L as ComboBoxWithoutContext
|
|
723
730
|
};
|