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