@progress/kendo-react-dropdowns 12.0.0-develop.1 → 12.0.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 +166 -164
- package/MultiColumnComboBox/MultiColumnComboBox.js +1 -1
- package/MultiColumnComboBox/MultiColumnComboBox.mjs +13 -13
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +43 -58
- package/index.d.ts +43 -58
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
package/ComboBox/ComboBox.mjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
8
|
+
import * as g from "react";
|
|
9
9
|
import m from "prop-types";
|
|
10
10
|
import _ from "../common/DropDownBase.mjs";
|
|
11
11
|
import { classNames as S, uComboBox as k, Keys as y, validatePackage as et, getLicenseMessage as st, svgIconPropType as it, canUseDOM as R, 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";
|
|
@@ -25,7 +25,7 @@ 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!", M = class M extends
|
|
28
|
+
const St = "Please enter a valid value!", M = class M extends g.Component {
|
|
29
29
|
constructor(s) {
|
|
30
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 = () => {
|
|
31
31
|
this._input && this._input.focus();
|
|
@@ -36,8 +36,8 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
36
36
|
this.duplicates = ut(i), this.hasDuplicates = this.duplicates.length > 0;
|
|
37
37
|
}
|
|
38
38
|
}, this.handleItemSelect = (t, e) => {
|
|
39
|
-
const { virtual: i, dataItemKey: r } = this.props,
|
|
40
|
-
this.triggerOnChange(p, e), this.state.text !== void 0 && (e.data.text = void 0),
|
|
39
|
+
const { virtual: i, dataItemKey: r } = this.props, n = C(this.props), a = i ? i.skip : 0, p = n[t - a], l = this.hasDuplicates || !F(p, this.value, r);
|
|
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(() => {
|
|
43
43
|
this.mobileMode && this._adaptiveFilterInput && (this._skipBlur = !0, this._adaptiveFilterInput.focus(), this._skipBlur = !1);
|
|
@@ -46,19 +46,19 @@ const St = "Please enter a valid value!", M = class M extends c.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 = C(this.props),
|
|
50
|
-
if (
|
|
49
|
+
const { skipDisabledItems: e, textField: i } = this.props, r = C(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
|
+
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
|
-
this.base.filterChanged(o,
|
|
52
|
+
this.base.filterChanged(o, l);
|
|
53
53
|
}
|
|
54
|
-
this.applyState(
|
|
54
|
+
this.applyState(l), setTimeout(() => {
|
|
55
55
|
this._skipFocus = !1;
|
|
56
56
|
}, 300);
|
|
57
57
|
}, this.closeOpenedApplyStateNonMobileMode = (t, e) => {
|
|
58
58
|
e && !this.mobileMode && this.base.togglePopup(t);
|
|
59
59
|
}, this.renderMobileListFilter = () => {
|
|
60
60
|
const t = this.props.adaptiveFilter !== void 0 ? this.props.adaptiveFilter : this.state.text, e = D(this.value, this.props.textField), i = w(t) ? t : e;
|
|
61
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ g.createElement(
|
|
62
62
|
ft,
|
|
63
63
|
{
|
|
64
64
|
value: i,
|
|
@@ -74,9 +74,9 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
76
|
}, this.listContainerContent = () => {
|
|
77
|
-
const { header: t, footer: e, size: i, groupStickyHeaderItemRender: r, groupField:
|
|
77
|
+
const { header: t, footer: e, size: i, groupStickyHeaderItemRender: r, groupField: n, list: a, groupMode: p, unstyled: l, virtual: o } = this.props, h = C(this.props), d = l && l.uComboBox;
|
|
78
78
|
let { group: v } = this.state;
|
|
79
|
-
return v === void 0 &&
|
|
79
|
+
return v === void 0 && n !== void 0 && (v = D(h[0], n)), /* @__PURE__ */ g.createElement(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
className: S(
|
|
@@ -89,10 +89,10 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
89
89
|
})
|
|
90
90
|
)
|
|
91
91
|
},
|
|
92
|
-
t && /* @__PURE__ */
|
|
93
|
-
!a && v &&
|
|
92
|
+
t && /* @__PURE__ */ g.createElement("div", { className: S(k.listHeader({ c: d })) }, t),
|
|
93
|
+
!a && v && h.length !== 0 && /* @__PURE__ */ g.createElement(K, { group: v, groupMode: p, render: r }),
|
|
94
94
|
this.renderList(),
|
|
95
|
-
e && /* @__PURE__ */
|
|
95
|
+
e && /* @__PURE__ */ g.createElement(
|
|
96
96
|
"div",
|
|
97
97
|
{
|
|
98
98
|
className: S(k.listFooter({ c: d }), this.props.footerClassName)
|
|
@@ -107,14 +107,14 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
107
107
|
const { vs: e, list: i } = this.base;
|
|
108
108
|
e.scrollHandler(t);
|
|
109
109
|
const { groupField: r } = this.props;
|
|
110
|
-
let
|
|
111
|
-
if (!r || !
|
|
110
|
+
let n = C(this.props);
|
|
111
|
+
if (!r || !n.length)
|
|
112
112
|
return;
|
|
113
|
-
const a = this.itemHeight = this.itemHeight || (e.enabled ? e.itemHeight : i ? i.children[0].offsetHeight : 0),
|
|
114
|
-
this.props.groupMode === "modern" && (
|
|
115
|
-
let o =
|
|
116
|
-
for (let
|
|
117
|
-
|
|
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
|
+
this.props.groupMode === "modern" && (n = this.base.getGroupedDataModernMode(n, r));
|
|
115
|
+
let o = n[0][r];
|
|
116
|
+
for (let h = 1; h < n.length && !(a * h > l); h++)
|
|
117
|
+
n[h] && n[h][r] && (o = n[h][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 c.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 = C(this.props),
|
|
125
|
+
const e = this.base.initState(), { textField: i } = this.props, r = C(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,50 +132,50 @@ const St = "Please enter a valid value!", M = class M extends c.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:
|
|
135
|
+
const { skipDisabledItems: e, textField: i, dataItemKey: r, groupField: n } = this.props, a = C(this.props), p = this.value, l = Math.max(
|
|
136
136
|
0,
|
|
137
|
-
a.findIndex((
|
|
138
|
-
), o = t.keyCode,
|
|
137
|
+
a.findIndex((u) => F(u, p, r))
|
|
138
|
+
), o = t.keyCode, h = this.props.opened !== void 0 ? this.props.opened : this.state.opened, d = this.base.initState();
|
|
139
139
|
if (d.syntheticEvent = t, !t.altKey && (o === y.up || o === y.down)) {
|
|
140
|
-
if (t.preventDefault(),
|
|
141
|
-
if (!this.props.skipDisabledItems &&
|
|
140
|
+
if (t.preventDefault(), n !== "" && i)
|
|
141
|
+
if (!this.props.skipDisabledItems && h)
|
|
142
142
|
this.onNavigate(d, o);
|
|
143
143
|
else {
|
|
144
|
-
let
|
|
144
|
+
let u = 0;
|
|
145
145
|
if (o === y.down || o === y.right) {
|
|
146
|
-
const
|
|
147
|
-
|
|
146
|
+
const c = a.slice(l + 1 < a.length ? l + 1 : l).find((f) => !f.disabled && f[i]);
|
|
147
|
+
u = c && a.findIndex((f) => f[i] === c[i]);
|
|
148
148
|
} else if (o === y.up || o === y.left) {
|
|
149
|
-
let
|
|
150
|
-
if (
|
|
151
|
-
|
|
149
|
+
let c;
|
|
150
|
+
if (l === 0)
|
|
151
|
+
c = a, u = a.findIndex((f) => !f.disabled && f[i]);
|
|
152
152
|
else {
|
|
153
|
-
|
|
154
|
-
let f =
|
|
153
|
+
c = a.slice(0, l);
|
|
154
|
+
let f = c.pop();
|
|
155
155
|
for (; f && f.disabled; )
|
|
156
|
-
f =
|
|
157
|
-
|
|
156
|
+
f = c.pop();
|
|
157
|
+
u = f && a.findIndex((E) => E[i] === f[i]);
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
162
|
-
this.onNavigate(d, o,
|
|
163
|
-
} else
|
|
160
|
+
if (u !== void 0) {
|
|
161
|
+
const c = u - l;
|
|
162
|
+
this.onNavigate(d, o, c);
|
|
163
|
+
} else u === void 0 && a.findIndex((c) => c[i] === p[i]) === a.length - 1 && this.onNavigate(d, o);
|
|
164
164
|
}
|
|
165
|
-
else if (!this.props.skipDisabledItems &&
|
|
165
|
+
else if (!this.props.skipDisabledItems && h)
|
|
166
166
|
this.onNavigate(d, o);
|
|
167
167
|
else {
|
|
168
|
-
let
|
|
168
|
+
let u = null;
|
|
169
169
|
if (o === y.down || o === y.right)
|
|
170
|
-
|
|
170
|
+
u = a.slice(l + 1).find((c) => !c.disabled);
|
|
171
171
|
else if (o === y.up || o === y.left) {
|
|
172
|
-
const
|
|
173
|
-
for (
|
|
174
|
-
|
|
172
|
+
const c = a.slice(0, l);
|
|
173
|
+
for (u = c.pop(); u && u.disabled; )
|
|
174
|
+
u = c.pop();
|
|
175
175
|
}
|
|
176
|
-
if (
|
|
177
|
-
const
|
|
178
|
-
this.onNavigate(d, o,
|
|
176
|
+
if (u) {
|
|
177
|
+
const c = u.id - l - 1;
|
|
178
|
+
this.onNavigate(d, o, c);
|
|
179
179
|
} else
|
|
180
180
|
this.onNavigate(d, o);
|
|
181
181
|
}
|
|
@@ -183,20 +183,20 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
183
183
|
}
|
|
184
184
|
const v = () => {
|
|
185
185
|
t.preventDefault(), this.base.togglePopup(d), this.applyState(d);
|
|
186
|
-
},
|
|
187
|
-
|
|
186
|
+
}, x = this.getFocusedIndex(), I = x === -1, b = !I && this.getCurrentValueDisabledStatus(i, a, x);
|
|
187
|
+
h ? o === y.pageUp ? (t.preventDefault(), this.base.scrollPopupByPageSize(-1)) : o === y.pageDown ? (t.preventDefault(), this.base.scrollPopupByPageSize(1)) : t.altKey && o === y.up ? v() : o === y.enter ? (t.preventDefault(), (i && !I && t.currentTarget.value ? a[x][i] : void 0) ? !e && i && b ? this.clearValueOnEnterOrEsc(t) : b || this.applyValueOnEnter(t.currentTarget.value, d) : this.applyValueOnEnter(t.currentTarget.value, d)) : o === y.esc && (!e && i && b && this.clearValueOnEnterOrEsc(t), this.applyValueOnRejectSuggestions(t.currentTarget.value, d)) : !h && o === y.esc ? this.clearValueOnEnterOrEsc(t) : t.altKey && o === y.down && v();
|
|
188
188
|
}, this.inputOnChange = (t) => {
|
|
189
189
|
const e = this.base.initState();
|
|
190
190
|
e.syntheticEvent = t;
|
|
191
|
-
const i = this.props.opened !== void 0 ? this.props.opened : this.state.opened, r = t.currentTarget,
|
|
191
|
+
const i = this.props.opened !== void 0 ? this.props.opened : this.state.opened, r = t.currentTarget, n = r.value;
|
|
192
192
|
if (this.props.suggest) {
|
|
193
|
-
const a = r.selectionEnd ===
|
|
193
|
+
const a = r.selectionEnd === n.length;
|
|
194
194
|
let p = this.props.filter !== void 0 ? this.props.filter : this.state.text;
|
|
195
195
|
w(p) || (p = D(this.value, this.props.textField) || "");
|
|
196
|
-
const
|
|
197
|
-
|
|
196
|
+
const l = p && p === n, o = p && p.length > n.length;
|
|
197
|
+
l || o || !a ? this._suggested = "" : this.suggestValue(n);
|
|
198
198
|
}
|
|
199
|
-
this.props.filter === void 0 && (e.data.text =
|
|
199
|
+
this.props.filter === void 0 && (e.data.text = n), this.state.focusedItem !== void 0 && (e.data.focusedItem = void 0), i || 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();
|
|
@@ -287,19 +287,19 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
287
287
|
/** @hidden */
|
|
288
288
|
componentDidUpdate(s, t) {
|
|
289
289
|
var v;
|
|
290
|
-
const { dataItemKey: e, virtual: i, groupField: r = "", textField:
|
|
290
|
+
const { dataItemKey: e, virtual: i, groupField: r = "", textField: n } = this.props, a = C(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 h = !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" &&
|
|
299
|
-
const
|
|
300
|
-
|
|
296
|
+
const x = s.value !== void 0 ? s.value : t.value;
|
|
297
|
+
let I = this.hasDuplicates ? this.navigationIndex || 0 : a.findIndex((u) => F(u, d, e));
|
|
298
|
+
this.props.groupMode === "modern" && n && d && (I = (v = this.base.getGroupedDataModernMode(a, r)) == null ? void 0 : v.map((u) => u[n]).indexOf(d[n]));
|
|
299
|
+
const b = !F(x, d, e);
|
|
300
|
+
h && i ? this.base.scrollToVirtualItem(i, I) : h && !i ? (this.onPopupOpened(), a && a.length !== 0 && this.base.resetGroupStickyHeader(a[0][r], this), this.base.scrollToItem(I)) : (this.hasDuplicates || l && o && d && b) && this.base.scrollToItem(I);
|
|
301
301
|
}
|
|
302
|
-
|
|
302
|
+
h && this._input && this._input.focus(), this.setValidity();
|
|
303
303
|
}
|
|
304
304
|
/** @hidden */
|
|
305
305
|
componentDidMount() {
|
|
@@ -323,31 +323,31 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
323
323
|
dir: e,
|
|
324
324
|
disabled: i,
|
|
325
325
|
clearButton: r = M.defaultProps.clearButton,
|
|
326
|
-
label:
|
|
326
|
+
label: n,
|
|
327
327
|
textField: a,
|
|
328
328
|
className: p,
|
|
329
|
-
style:
|
|
329
|
+
style: l,
|
|
330
330
|
loading: o,
|
|
331
|
-
iconClassName:
|
|
331
|
+
iconClassName: h,
|
|
332
332
|
virtual: d,
|
|
333
333
|
size: v,
|
|
334
|
-
rounded:
|
|
335
|
-
fillMode:
|
|
336
|
-
opened:
|
|
337
|
-
placeholder:
|
|
338
|
-
svgIcon:
|
|
334
|
+
rounded: x,
|
|
335
|
+
fillMode: I,
|
|
336
|
+
opened: b = this.state.opened,
|
|
337
|
+
placeholder: u,
|
|
338
|
+
svgIcon: c,
|
|
339
339
|
unstyled: f
|
|
340
340
|
} = this.props, E = !this.validityStyles || this.validity.valid, O = this.props.filter !== void 0 ? this.props.filter : this.state.text, $ = D(this.value, a), V = w(O) ? O : $, Y = r && (!!V || w(this.value)), B = this.base.vs, L = this.props.id || this._inputId, T = f && f.uComboBox;
|
|
341
341
|
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 ||
|
|
342
|
+
const [J, Q] = j(this.props.prefix || g.Fragment), [X, Z] = j(this.props.suffix || g.Fragment), N = /* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement(
|
|
343
343
|
"span",
|
|
344
344
|
{
|
|
345
345
|
className: S(
|
|
346
346
|
k.wrapper({
|
|
347
347
|
c: T,
|
|
348
348
|
size: v,
|
|
349
|
-
rounded:
|
|
350
|
-
fillMode:
|
|
349
|
+
rounded: x,
|
|
350
|
+
fillMode: I,
|
|
351
351
|
disabled: i,
|
|
352
352
|
invalid: !E,
|
|
353
353
|
loading: o,
|
|
@@ -356,14 +356,14 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
356
356
|
p
|
|
357
357
|
),
|
|
358
358
|
ref: this.componentRef,
|
|
359
|
-
style:
|
|
359
|
+
style: n ? { ...l, width: void 0 } : l,
|
|
360
360
|
dir: e,
|
|
361
361
|
onFocus: this.handleFocus
|
|
362
362
|
},
|
|
363
|
-
this.props.prefix && /* @__PURE__ */
|
|
364
|
-
this.renderSearchBar(V || "", L,
|
|
365
|
-
Y && !o && /* @__PURE__ */
|
|
366
|
-
o && /* @__PURE__ */
|
|
363
|
+
this.props.prefix && /* @__PURE__ */ g.createElement(J, { ...Q }),
|
|
364
|
+
this.renderSearchBar(V || "", L, u),
|
|
365
|
+
Y && !o && /* @__PURE__ */ g.createElement(bt, { onClick: this.clearButtonClick, key: "clearbutton" }),
|
|
366
|
+
o && /* @__PURE__ */ g.createElement(
|
|
367
367
|
ot,
|
|
368
368
|
{
|
|
369
369
|
className: S(k.loadingIcon({ c: T })),
|
|
@@ -371,18 +371,18 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
371
371
|
key: "loading"
|
|
372
372
|
}
|
|
373
373
|
),
|
|
374
|
-
this.props.suffix && /* @__PURE__ */
|
|
375
|
-
/* @__PURE__ */
|
|
374
|
+
this.props.suffix && /* @__PURE__ */ g.createElement(X, { ...Z }),
|
|
375
|
+
/* @__PURE__ */ g.createElement(
|
|
376
376
|
xt,
|
|
377
377
|
{
|
|
378
378
|
tabIndex: -1,
|
|
379
379
|
type: "button",
|
|
380
|
-
"aria-label":
|
|
381
|
-
icon:
|
|
382
|
-
svgIcon:
|
|
383
|
-
iconClass:
|
|
380
|
+
"aria-label": b ? t : s,
|
|
381
|
+
icon: h ? void 0 : "caret-alt-down",
|
|
382
|
+
svgIcon: c || It,
|
|
383
|
+
iconClass: h,
|
|
384
384
|
size: v,
|
|
385
|
-
fillMode:
|
|
385
|
+
fillMode: I,
|
|
386
386
|
rounded: null,
|
|
387
387
|
themeColor: "base",
|
|
388
388
|
className: S(k.inputButton({ c: T })),
|
|
@@ -392,15 +392,15 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
392
392
|
),
|
|
393
393
|
!this.mobileMode && this.renderListContainer()
|
|
394
394
|
), this.mobileMode && this.renderAdaptiveListContainer());
|
|
395
|
-
return
|
|
395
|
+
return n ? /* @__PURE__ */ g.createElement(
|
|
396
396
|
ht,
|
|
397
397
|
{
|
|
398
|
-
label:
|
|
398
|
+
label: n,
|
|
399
399
|
editorId: L,
|
|
400
400
|
editorValue: V,
|
|
401
401
|
editorValid: E,
|
|
402
402
|
editorDisabled: i,
|
|
403
|
-
style: { width:
|
|
403
|
+
style: { width: l ? l.width : void 0 },
|
|
404
404
|
children: N,
|
|
405
405
|
unstyled: f
|
|
406
406
|
}
|
|
@@ -408,21 +408,21 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
408
408
|
}
|
|
409
409
|
/** @hidden */
|
|
410
410
|
onNavigate(s, t, e) {
|
|
411
|
-
const { virtual: i = { skip: 0 } } = this.props, r = C(this.props),
|
|
411
|
+
const { virtual: i = { skip: 0 } } = this.props, r = C(this.props), n = this.props.filter ? this.props.filter : this.state.text;
|
|
412
412
|
let a = -1, p;
|
|
413
|
-
const
|
|
413
|
+
const l = this.base.vs, o = this.value;
|
|
414
414
|
this._suggested = "";
|
|
415
|
-
const
|
|
416
|
-
if (a = this.getFocusedIndex(
|
|
415
|
+
const h = this.hasDuplicates && this.duplicates.indexOf(o) !== -1;
|
|
416
|
+
if (a = this.getFocusedIndex(h), a !== -1 && !w(o))
|
|
417
417
|
this.handleItemSelect(a, s);
|
|
418
|
-
else if (
|
|
418
|
+
else if (n === "")
|
|
419
419
|
this.handleItemSelect(0, s);
|
|
420
420
|
else {
|
|
421
421
|
const d = i.skip + a;
|
|
422
422
|
p = this.base.navigation.navigate({
|
|
423
423
|
keyCode: t,
|
|
424
424
|
current: d,
|
|
425
|
-
max: (
|
|
425
|
+
max: (l.enabled ? l.total : r.length) - 1,
|
|
426
426
|
min: 0,
|
|
427
427
|
skipItems: e || void 0
|
|
428
428
|
}), p !== void 0 && this.handleItemSelect(p, s);
|
|
@@ -433,41 +433,41 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
433
433
|
return s && t && t[e] && t[e].disabled;
|
|
434
434
|
}
|
|
435
435
|
applyValueOnEnter(s, t) {
|
|
436
|
-
const { textField: e, allowCustom: i } = this.props, r = C(this.props),
|
|
436
|
+
const { textField: e, allowCustom: i } = this.props, r = C(this.props), n = this.props.opened !== void 0 ? this.props.opened : this.state.opened, p = D(this.value, e) === s ? this.index : A(r, s, e), l = p !== -1;
|
|
437
437
|
let o;
|
|
438
|
-
if (this._suggested = "",
|
|
438
|
+
if (this._suggested = "", l)
|
|
439
439
|
o = r[p];
|
|
440
440
|
else if (i)
|
|
441
441
|
o = e !== void 0 ? { [e]: s } : s;
|
|
442
442
|
else
|
|
443
443
|
return this.selectFocusedItem(s, t);
|
|
444
|
-
this.triggerOnChange(o, t),
|
|
444
|
+
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
445
|
}
|
|
446
446
|
applyValueOnRejectSuggestions(s, t) {
|
|
447
|
-
const { textField: e, allowCustom: i } = this.props, r = C(this.props),
|
|
447
|
+
const { textField: e, allowCustom: i } = this.props, r = C(this.props), n = this.props.opened !== void 0 ? this.props.opened : this.state.opened, a = D(this.value, e);
|
|
448
448
|
if (this._suggested = "", s === a || s === "" && !w(a))
|
|
449
|
-
return this.closeOpenedApplyStateNonMobileMode(t,
|
|
450
|
-
const p = A(r, s, e, !0),
|
|
449
|
+
return this.closeOpenedApplyStateNonMobileMode(t, n), this.applyState(t);
|
|
450
|
+
const p = A(r, s, e, !0), l = p !== -1;
|
|
451
451
|
let o = null;
|
|
452
|
-
|
|
452
|
+
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
453
|
}
|
|
454
454
|
selectFocusedItem(s, t) {
|
|
455
|
-
const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { textField: i, virtual: r = { skip: 0 }, focusedItemIndex:
|
|
456
|
-
return
|
|
455
|
+
const e = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { textField: i, virtual: r = { skip: 0 }, focusedItemIndex: n = z } = this.props, a = C(this.props), p = r.skip, l = s === "" && p === 0 ? 0 : n(a, s, i);
|
|
456
|
+
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
457
|
}
|
|
458
458
|
renderAdaptiveListContainer() {
|
|
459
|
-
const { windowWidth: s = 0 } = this.state, { groupField: t, adaptiveTitle: e = this.props.label, adaptiveSubtitle: i } = this.props, r = C(this.props),
|
|
459
|
+
const { windowWidth: s = 0 } = this.state, { groupField: t, adaptiveTitle: e = this.props.label, adaptiveSubtitle: i } = this.props, r = C(this.props), n = this.props.opened !== void 0 ? this.props.opened : this.state.opened;
|
|
460
460
|
let { group: a } = this.state;
|
|
461
461
|
a === void 0 && t !== void 0 && (a = D(r[0], t));
|
|
462
462
|
const p = {
|
|
463
463
|
title: e || this.props.label,
|
|
464
464
|
subTitle: i,
|
|
465
|
-
expand:
|
|
466
|
-
onClose: (
|
|
465
|
+
expand: n,
|
|
466
|
+
onClose: (l) => this.toggleBtnClick(l),
|
|
467
467
|
windowWidth: s,
|
|
468
468
|
mobileFilter: this.renderMobileListFilter()
|
|
469
469
|
};
|
|
470
|
-
return /* @__PURE__ */
|
|
470
|
+
return /* @__PURE__ */ g.createElement(Ct, { ...p }, /* @__PURE__ */ g.createElement(yt, null, /* @__PURE__ */ g.createElement("div", { className: "k-list-container" }, this.listContainerContent())));
|
|
471
471
|
}
|
|
472
472
|
renderListContainer() {
|
|
473
473
|
const s = this.base, {
|
|
@@ -475,26 +475,26 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
475
475
|
header: e,
|
|
476
476
|
footer: i,
|
|
477
477
|
groupField: r,
|
|
478
|
-
groupMode:
|
|
478
|
+
groupMode: n,
|
|
479
479
|
size: a,
|
|
480
480
|
list: p,
|
|
481
|
-
virtual:
|
|
481
|
+
virtual: l,
|
|
482
482
|
groupStickyHeaderItemRender: o,
|
|
483
|
-
unstyled:
|
|
484
|
-
} = this.props, d = C(this.props), v = this.props.opened !== void 0 ? this.props.opened : this.state.opened,
|
|
485
|
-
let { group:
|
|
486
|
-
return
|
|
483
|
+
unstyled: h
|
|
484
|
+
} = this.props, d = C(this.props), v = this.props.opened !== void 0 ? this.props.opened : this.state.opened, x = s.getPopupSettings(), I = x.width !== void 0 ? x.width : s.popupWidth, b = h && h.uComboBox;
|
|
485
|
+
let { group: u } = this.state;
|
|
486
|
+
return u === void 0 && r !== void 0 && (u = D(d[0], r)), /* @__PURE__ */ g.createElement(
|
|
487
487
|
mt,
|
|
488
488
|
{
|
|
489
|
-
width:
|
|
489
|
+
width: I,
|
|
490
490
|
popupSettings: {
|
|
491
|
-
...
|
|
492
|
-
anchor:
|
|
491
|
+
...x,
|
|
492
|
+
anchor: x.anchor || this.element,
|
|
493
493
|
show: v,
|
|
494
494
|
popupClass: S(
|
|
495
|
-
|
|
495
|
+
x.popupClass,
|
|
496
496
|
k.listContainer({
|
|
497
|
-
c:
|
|
497
|
+
c: b,
|
|
498
498
|
popup: !0
|
|
499
499
|
})
|
|
500
500
|
)
|
|
@@ -502,34 +502,34 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
502
502
|
dir: t !== void 0 ? t : this.base.dirCalculated,
|
|
503
503
|
itemsCount: [d.length]
|
|
504
504
|
},
|
|
505
|
-
/* @__PURE__ */
|
|
505
|
+
/* @__PURE__ */ g.createElement(
|
|
506
506
|
"div",
|
|
507
507
|
{
|
|
508
508
|
className: S(
|
|
509
509
|
k.list({
|
|
510
|
-
c:
|
|
510
|
+
c: b,
|
|
511
511
|
list: p,
|
|
512
512
|
size: a,
|
|
513
513
|
tableSize: a,
|
|
514
|
-
virtual:
|
|
514
|
+
virtual: l
|
|
515
515
|
})
|
|
516
516
|
)
|
|
517
517
|
},
|
|
518
|
-
e && /* @__PURE__ */
|
|
519
|
-
!p &&
|
|
518
|
+
e && /* @__PURE__ */ g.createElement("div", { className: S(k.listHeader({ c: b })) }, e),
|
|
519
|
+
!p && u && d.length !== 0 && /* @__PURE__ */ g.createElement(K, { group: u, groupMode: n, render: o }),
|
|
520
520
|
this.renderList(),
|
|
521
|
-
i && /* @__PURE__ */
|
|
521
|
+
i && /* @__PURE__ */ g.createElement(
|
|
522
522
|
"div",
|
|
523
523
|
{
|
|
524
524
|
className: S(
|
|
525
|
-
k.listFooter({ c:
|
|
525
|
+
k.listFooter({ c: b }),
|
|
526
526
|
this.props.footerClassName
|
|
527
527
|
)
|
|
528
528
|
},
|
|
529
529
|
i
|
|
530
530
|
)
|
|
531
531
|
),
|
|
532
|
-
this.showLicenseWatermark && /* @__PURE__ */
|
|
532
|
+
this.showLicenseWatermark && /* @__PURE__ */ g.createElement(at, { message: this.licenseMessage })
|
|
533
533
|
);
|
|
534
534
|
}
|
|
535
535
|
renderList() {
|
|
@@ -538,19 +538,19 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
538
538
|
dataItemKey: e,
|
|
539
539
|
listNoDataRender: i,
|
|
540
540
|
itemRender: r,
|
|
541
|
-
groupHeaderItemRender:
|
|
541
|
+
groupHeaderItemRender: n,
|
|
542
542
|
virtual: a = { skip: 0, total: void 0 },
|
|
543
543
|
unstyled: p
|
|
544
|
-
} = this.props,
|
|
545
|
-
return /* @__PURE__ */
|
|
544
|
+
} = this.props, l = C(this.props), o = s.getPopupSettings(), h = s.vs, d = a.skip, v = this.props.opened !== void 0 ? this.props.opened : this.state.opened, x = `translateY(${h.translate}px)`, I = v ? this.getFocusedIndex(this.hasDuplicates) : void 0, b = this.props.filter !== void 0 ? this.props.filter : this.state.text, u = D(this.value, t), c = w(b) && b !== u ? null : this.value, f = this.props.list || vt, E = p && p.uComboBox;
|
|
545
|
+
return /* @__PURE__ */ g.createElement(
|
|
546
546
|
f,
|
|
547
547
|
{
|
|
548
548
|
id: s.listBoxId,
|
|
549
549
|
virtual: !!a,
|
|
550
550
|
show: v,
|
|
551
|
-
data:
|
|
552
|
-
focusedIndex:
|
|
553
|
-
value:
|
|
551
|
+
data: l,
|
|
552
|
+
focusedIndex: I,
|
|
553
|
+
value: c,
|
|
554
554
|
textField: t,
|
|
555
555
|
valueField: e,
|
|
556
556
|
groupField: this.props.groupField,
|
|
@@ -559,7 +559,7 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
559
559
|
optionsGuid: s.guid,
|
|
560
560
|
hasDuplicates: this.hasDuplicates,
|
|
561
561
|
listRef: (O) => {
|
|
562
|
-
|
|
562
|
+
h.list = this.base.list = O, this.itemHeight = 0;
|
|
563
563
|
},
|
|
564
564
|
wrapperStyle: this.state.windowWidth && this.props._adaptiveMode && this.state.windowWidth > this.props._adaptiveMode.medium ? { maxHeight: o.height } : {},
|
|
565
565
|
wrapperCssClass: S(
|
|
@@ -568,16 +568,16 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
568
568
|
virtual: a
|
|
569
569
|
})
|
|
570
570
|
),
|
|
571
|
-
listStyle:
|
|
571
|
+
listStyle: h.enabled ? { transform: x } : void 0,
|
|
572
572
|
key: "listkey",
|
|
573
573
|
skip: d,
|
|
574
574
|
onClick: this.handleItemClick,
|
|
575
575
|
itemRender: r,
|
|
576
|
-
groupHeaderItemRender:
|
|
576
|
+
groupHeaderItemRender: n,
|
|
577
577
|
noDataRender: i,
|
|
578
578
|
onMouseDown: (O) => O.preventDefault(),
|
|
579
579
|
onScroll: this.onScroll,
|
|
580
|
-
wrapperRef:
|
|
580
|
+
wrapperRef: h.scrollerRef,
|
|
581
581
|
scroller: this.base.renderScrollElement(),
|
|
582
582
|
ariaSetSize: a.total
|
|
583
583
|
}
|
|
@@ -586,49 +586,51 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
586
586
|
renderSearchBar(s, t, e) {
|
|
587
587
|
const {
|
|
588
588
|
tabIndex: i,
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
589
|
+
accessKey: r,
|
|
590
|
+
disabled: n,
|
|
591
|
+
title: a,
|
|
592
|
+
ariaLabelledBy: p,
|
|
593
|
+
ariaDescribedBy: l,
|
|
594
|
+
dataItemKey: o,
|
|
595
|
+
virtual: h = { skip: 0 },
|
|
596
|
+
unstyled: d,
|
|
597
|
+
inputAttributes: v
|
|
598
|
+
} = this.props, x = C(this.props), I = this.props.opened !== void 0 ? this.props.opened : this.state.opened, b = this.value, u = Math.max(
|
|
598
599
|
0,
|
|
599
|
-
|
|
600
|
+
x.findIndex((c) => F(c, b, o))
|
|
600
601
|
);
|
|
601
|
-
return this._suggested && !F(this._valueOnDidUpdate,
|
|
602
|
+
return this._suggested && !F(this._valueOnDidUpdate, b, o) && (this._suggested = ""), /* @__PURE__ */ g.createElement(
|
|
602
603
|
gt,
|
|
603
604
|
{
|
|
604
605
|
id: t,
|
|
605
|
-
readOnly:
|
|
606
|
+
readOnly: I && this.mobileMode,
|
|
606
607
|
placeholder: e,
|
|
607
608
|
tabIndex: i,
|
|
608
|
-
|
|
609
|
+
accessKey: r,
|
|
610
|
+
title: a,
|
|
609
611
|
value: s + this._suggested,
|
|
610
612
|
suggestedText: this._suggested,
|
|
611
|
-
ref: (
|
|
612
|
-
this._input =
|
|
613
|
+
ref: (c) => {
|
|
614
|
+
this._input = c && c.input;
|
|
613
615
|
},
|
|
614
616
|
onClick: this.onInputClick,
|
|
615
617
|
onKeyDown: this.onInputKeyDown,
|
|
616
618
|
onChange: this.inputOnChange,
|
|
617
619
|
onFocus: this.base.handleFocus,
|
|
618
620
|
onBlur: this.handleBlur,
|
|
619
|
-
disabled:
|
|
620
|
-
expanded:
|
|
621
|
+
disabled: n,
|
|
622
|
+
expanded: I,
|
|
621
623
|
owns: this.base.listBoxId,
|
|
622
|
-
activedescendant: `option-${this.base.guid}-${
|
|
624
|
+
activedescendant: `option-${this.base.guid}-${u + h.skip}`,
|
|
623
625
|
role: "combobox",
|
|
624
|
-
ariaLabelledBy:
|
|
626
|
+
ariaLabelledBy: p,
|
|
625
627
|
ariaLabel: this.props.ariaLabel,
|
|
626
|
-
ariaDescribedBy:
|
|
628
|
+
ariaDescribedBy: l,
|
|
627
629
|
ariaRequired: this.required,
|
|
628
630
|
render: this.props.valueRender,
|
|
629
631
|
ariaControls: this.base.listBoxId,
|
|
630
|
-
unstyled:
|
|
631
|
-
inputAttributes:
|
|
632
|
+
unstyled: d,
|
|
633
|
+
inputAttributes: v
|
|
632
634
|
}
|
|
633
635
|
);
|
|
634
636
|
}
|
|
@@ -647,10 +649,10 @@ const St = "Please enter a valid value!", M = class M extends c.Component {
|
|
|
647
649
|
textField: e,
|
|
648
650
|
dataItemKey: i,
|
|
649
651
|
virtual: r = { skip: 0 },
|
|
650
|
-
focusedItemIndex:
|
|
652
|
+
focusedItemIndex: n = z,
|
|
651
653
|
skipDisabledItems: a
|
|
652
|
-
} = this.props, p = C(this.props),
|
|
653
|
-
return s && this.navigationIndex !== void 0 ? this.navigationIndex : w(t) &&
|
|
654
|
+
} = this.props, p = C(this.props), l = this.props.filter ? this.props.filter : this.state.text;
|
|
655
|
+
return s && this.navigationIndex !== void 0 ? this.navigationIndex : w(t) && l === void 0 ? p.findIndex((o) => F(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;
|
|
654
656
|
}
|
|
655
657
|
suggestValue(s) {
|
|
656
658
|
const { data: t, textField: e } = this.props;
|