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