@progress/kendo-react-dropdowns 11.4.0-develop.5 → 11.4.0-develop.7
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 +52 -52
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +109 -109
- package/DropDownTree/DropDownTree.js +1 -1
- package/DropDownTree/DropDownTree.mjs +175 -175
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +224 -224
- package/MultiSelectTree/MultiSelectTree.js +1 -1
- package/MultiSelectTree/MultiSelectTree.mjs +95 -95
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +2 -1
- package/index.d.ts +2 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +11 -11
|
@@ -6,107 +6,107 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as f from "react";
|
|
9
|
-
import
|
|
10
|
-
import { Keys as u, classNames as I, IconWrap as L, WatermarkOverlay as
|
|
11
|
-
import { plusIcon as
|
|
12
|
-
import { FloatingLabel as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
9
|
+
import m from "prop-types";
|
|
10
|
+
import { Keys as u, classNames as I, IconWrap as L, WatermarkOverlay as J, getLicenseMessage as Q, canUseDOM as B, validatePackage as X, createPropsContext as Z, withIdHOC as ee, withPropsContext as te, withAdaptiveModeContext as se, kendoThemeMaps as ie } from "@progress/kendo-react-common";
|
|
11
|
+
import { plusIcon as oe } from "@progress/kendo-svg-icons";
|
|
12
|
+
import { FloatingLabel as ae } from "@progress/kendo-react-labels";
|
|
13
|
+
import ne from "../common/ListContainer.mjs";
|
|
14
|
+
import le from "../common/List.mjs";
|
|
15
|
+
import de from "../common/GroupStickyHeader.mjs";
|
|
16
|
+
import re from "./TagList.mjs";
|
|
17
|
+
import he from "../common/SearchBar.mjs";
|
|
18
|
+
import M from "../common/DropDownBase.mjs";
|
|
19
19
|
import { ActiveDescendant as w } from "../common/settings.mjs";
|
|
20
|
-
import { getFilteredData as b, areSame as
|
|
21
|
-
import { packageMetadata as
|
|
22
|
-
import
|
|
23
|
-
import { AdaptiveMode as
|
|
24
|
-
import { ActionSheetContent as
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
const { sizeMap: D, roundedMap:
|
|
20
|
+
import { getFilteredData as b, areSame as E, removeDataItems as T, isPresent as O, getItemValue as P, preventDefaultNonInputs as pe, matchTags as V, itemIndexStartsWith as ce } from "../common/utils.mjs";
|
|
21
|
+
import { packageMetadata as z } from "../package-metadata.mjs";
|
|
22
|
+
import ue from "../common/ClearButton.mjs";
|
|
23
|
+
import { AdaptiveMode as fe } from "../common/AdaptiveMode.mjs";
|
|
24
|
+
import { ActionSheetContent as ge } from "@progress/kendo-react-layout";
|
|
25
|
+
import me from "../common/ListFilter.mjs";
|
|
26
|
+
import A from "../common/withCustomComponent.mjs";
|
|
27
|
+
const { sizeMap: D, roundedMap: ve } = ie, be = "Please enter a valid value!", H = (F) => F.preventDefault(), W = (F) => F === 2, y = class y extends f.Component {
|
|
28
28
|
constructor(n) {
|
|
29
29
|
super(n), this.state = {
|
|
30
30
|
activedescendant: w.PopupList,
|
|
31
31
|
currentValue: []
|
|
32
|
-
}, this._element = null, this._valueItemsDuringOnChange = null, this.base = new
|
|
32
|
+
}, this._element = null, this._valueItemsDuringOnChange = null, this.base = new M(this), this._tags = [], this._input = null, this._adaptiveInput = null, this._skipFocusEvent = !1, this._lastSelectedOrDeslectedItemIndex = null, this.itemHeight = 0, this.scrollToFocused = !1, this.showLicenseWatermark = !1, this.focus = () => {
|
|
33
33
|
this._input && this._input.focus();
|
|
34
|
-
}, this.handleItemSelect = (
|
|
35
|
-
const { dataItemKey: a, virtual: s } = this.props, o = b(this.props), p = s ? s.skip : 0, c = o[
|
|
36
|
-
this._lastSelectedOrDeslectedItemIndex = o.findIndex((
|
|
34
|
+
}, this.handleItemSelect = (e, t) => {
|
|
35
|
+
const { dataItemKey: a, virtual: s } = this.props, o = b(this.props), p = s ? s.skip : 0, c = o[e - p], r = this.value.findIndex((g) => E(g, c, a));
|
|
36
|
+
this._lastSelectedOrDeslectedItemIndex = o.findIndex((g) => E(g, c, a));
|
|
37
37
|
let i = [];
|
|
38
|
-
r !== -1 ? (i = this.value, i.splice(r, 1)) : i = [...this.value, c], (this.props.filter !== void 0 ? this.props.filter : this.state.text) && !this.mobileMode && (this.state.text && (
|
|
39
|
-
}, this.onTagDelete = (
|
|
38
|
+
r !== -1 ? (i = this.value, i.splice(r, 1)) : i = [...this.value, c], (this.props.filter !== void 0 ? this.props.filter : this.state.text) && !this.mobileMode && (this.state.text && (t.data.text = ""), this.base.filterChanged("", t)), this._adaptiveInput && this._adaptiveInput.blur(), this.state.focusedIndex !== void 0 && (t.data.focusedIndex = void 0), this.triggerOnChange(i, t), this.base.triggerPageChangeCornerItems(c, t);
|
|
39
|
+
}, this.onTagDelete = (e, t) => {
|
|
40
40
|
const a = this.base.initState();
|
|
41
|
-
a.syntheticEvent =
|
|
41
|
+
a.syntheticEvent = t, this.opened && this.base.togglePopup(a), !this.state.focused && !this.mobileMode && (a.data.focused = !0, this.focus());
|
|
42
42
|
const s = this.value;
|
|
43
|
-
T(s,
|
|
44
|
-
}, this.itemFocus = (
|
|
45
|
-
const { allowCustom: a, virtual: s } = this.props, o = b(this.props), p = s ? s.skip : 0, c = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedIndex: r } = this.getFocusedState(), i = a && c, l = o[
|
|
46
|
-
l && r !==
|
|
47
|
-
}, this.componentRef = (
|
|
48
|
-
this._element =
|
|
49
|
-
}, this.searchbarRef = (
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
}, this.onChangeHandler = (
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
}, this.clearButtonClick = (
|
|
56
|
-
const
|
|
57
|
-
|
|
43
|
+
T(s, e, this.props.dataItemKey), this.triggerOnChange(s, a), this.applyState(a);
|
|
44
|
+
}, this.itemFocus = (e, t) => {
|
|
45
|
+
const { allowCustom: a, virtual: s } = this.props, o = b(this.props), p = s ? s.skip : 0, c = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedIndex: r } = this.getFocusedState(), i = a && c, l = o[e - p];
|
|
46
|
+
l && r !== e ? this.state.focusedIndex !== e && (t.data.focusedIndex = e, t.data.activedescendant = w.PopupList) : i && e === -1 && this.state.focusedIndex !== void 0 && (t.data.focusedIndex = void 0), this.base.triggerPageChangeCornerItems(l, t);
|
|
47
|
+
}, this.componentRef = (e) => {
|
|
48
|
+
this._element = e, this.base.wrapper = e;
|
|
49
|
+
}, this.searchbarRef = (e) => {
|
|
50
|
+
const t = this._input = e && e.input;
|
|
51
|
+
t && this.state.focused && window.setTimeout(() => t.focus(), 0);
|
|
52
|
+
}, this.onChangeHandler = (e) => {
|
|
53
|
+
const t = this.base.initState(), a = e.target.value;
|
|
54
|
+
t.syntheticEvent = e, this.props.filter === void 0 && (t.data.text = a), t.data.focusedIndex = void 0, this.opened || (this.base.togglePopup(t), this.setState({ currentValue: this.value })), this.base.filterChanged(a, t), this.applyState(t), this.setState({ group: void 0 });
|
|
55
|
+
}, this.clearButtonClick = (e) => {
|
|
56
|
+
const t = this.base.initState();
|
|
57
|
+
t.syntheticEvent = e, e.stopPropagation(), this.value.length > 0 && this.triggerOnChange([], t), this.state.focusedIndex !== void 0 && (t.data.focusedIndex = void 0), this.opened && this.base.togglePopup(t);
|
|
58
58
|
const a = this.props.filter !== void 0 ? this.props.filter : this.state.text;
|
|
59
|
-
O(a) && a !== "" && this.base.filterChanged("",
|
|
60
|
-
}, this.onInputKeyDown = (
|
|
61
|
-
const { textField:
|
|
62
|
-
if (l.syntheticEvent =
|
|
63
|
-
return this.onTagsNavigate(
|
|
64
|
-
const
|
|
65
|
-
|
|
59
|
+
O(a) && a !== "" && this.base.filterChanged("", t), this.state.text && (t.data.text = ""), this._lastSelectedOrDeslectedItemIndex = null, this.applyState(t);
|
|
60
|
+
}, this.onInputKeyDown = (e) => {
|
|
61
|
+
const { textField: t, groupField: a } = this.props, s = b(this.props), o = e.keyCode, p = this.props.filter !== void 0 ? this.props.filter : this.state.text, c = this.props.opened !== void 0 ? this.props.opened : this.state.opened, { focusedItem: r, focusedIndex: i } = this.getFocusedState(), l = this.base.initState();
|
|
62
|
+
if (l.syntheticEvent = e, !p && this.value.length > 0 && (o === u.left || o === u.right || o === u.home || o === u.end || o === u.delete || o === u.backspace) && !e.shiftKey)
|
|
63
|
+
return this.onTagsNavigate(e, l);
|
|
64
|
+
const g = () => {
|
|
65
|
+
e.preventDefault(), this.base.togglePopup(l), this.applyState(l);
|
|
66
66
|
};
|
|
67
67
|
if (this.opened)
|
|
68
68
|
if (o === u.pageUp)
|
|
69
|
-
|
|
69
|
+
e.preventDefault(), this.base.scrollPopupByPageSize(-1);
|
|
70
70
|
else if (o === u.pageDown)
|
|
71
|
-
|
|
72
|
-
else if ((
|
|
71
|
+
e.preventDefault(), this.base.scrollPopupByPageSize(1);
|
|
72
|
+
else if ((e.ctrlKey || e.metaKey) && e.code === "KeyA") {
|
|
73
73
|
const h = (this.state.value && this.state.value.length) === s.length ? [] : s;
|
|
74
74
|
this.updateStateOnKeyboardNavigation(h, l);
|
|
75
|
-
} else if ((
|
|
75
|
+
} else if ((e.ctrlKey || e.metaKey) && e.shiftKey && e.keyCode === u.end) {
|
|
76
76
|
const d = s.slice(this.getFocusedState().focusedIndex);
|
|
77
77
|
this.itemFocus(s.length - 1, l), this.updateStateOnKeyboardNavigation(d, l);
|
|
78
|
-
} else if ((
|
|
78
|
+
} else if ((e.ctrlKey || e.metaKey) && e.shiftKey && e.keyCode === u.home) {
|
|
79
79
|
const d = s.slice(0, this.getFocusedState().focusedIndex + 1);
|
|
80
80
|
this.itemFocus(0, l), this.updateStateOnKeyboardNavigation(d, l);
|
|
81
|
-
} else if (
|
|
81
|
+
} else if (e.shiftKey && e.keyCode === u.up) {
|
|
82
82
|
let d;
|
|
83
83
|
const h = this.getLastSelectedOrDeselectedIndex(1, i);
|
|
84
84
|
h === null ? d = i !== 0 ? s.slice(i - 1, i) : [s[i]] : h === i ? d = [s[h - 1]] : i >= 0 && (d = h > i ? s.slice(i - 1, h) : s.slice(h - 1, i)), d && d.length > 0 && (i >= 1 && this.itemFocus(i - 1, l), this.updateStateOnKeyboardNavigation(d, l));
|
|
85
|
-
} else if (
|
|
85
|
+
} else if (e.shiftKey && e.keyCode === u.down) {
|
|
86
86
|
let d;
|
|
87
87
|
const h = this.getLastSelectedOrDeselectedIndex(0, i);
|
|
88
88
|
h === null ? d = i !== s.length - 1 ? s.slice(i, i + 1) : [s[i]] : h === i ? d = s.slice(i, i + 2) : i >= 0 && (d = h > i ? s.slice(i + 1, h + 1) : s.slice(h, i + 2)), d && d.length >= 1 && (this.itemFocus(i + 1, l), this.updateStateOnKeyboardNavigation(d, l));
|
|
89
|
-
} else if (
|
|
90
|
-
|
|
89
|
+
} else if (e.altKey && o === u.up)
|
|
90
|
+
g();
|
|
91
91
|
else if (o === u.up || o === u.down) {
|
|
92
|
-
if (a !== "" &&
|
|
92
|
+
if (a !== "" && t)
|
|
93
93
|
if (!this.props.skipDisabledItems && c)
|
|
94
94
|
this.onNavigate(l, o);
|
|
95
95
|
else {
|
|
96
96
|
let d = 0;
|
|
97
97
|
if (o === u.down || o === u.right) {
|
|
98
|
-
const h = s.slice(i + 1).find((v) => !v.disabled && v[
|
|
99
|
-
d = h && s.findIndex((v) => v[
|
|
98
|
+
const h = s.slice(i + 1).find((v) => !v.disabled && v[t]);
|
|
99
|
+
d = h && s.findIndex((v) => v[t] === h[t]);
|
|
100
100
|
} else if (o === u.up || o === u.left) {
|
|
101
101
|
let h;
|
|
102
102
|
if (i === -1)
|
|
103
|
-
h = s, d = s.findIndex((v) => !v.disabled && v[
|
|
103
|
+
h = s, d = s.findIndex((v) => !v.disabled && v[t]);
|
|
104
104
|
else {
|
|
105
105
|
h = s.slice(0, i);
|
|
106
106
|
let v = h.pop();
|
|
107
107
|
for (; v && v.disabled; )
|
|
108
108
|
v = h.pop();
|
|
109
|
-
d = v && s.findIndex((x) => x[
|
|
109
|
+
d = v && s.findIndex((x) => x[t] === v[t]);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
if (d) {
|
|
@@ -131,11 +131,11 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
131
131
|
} else
|
|
132
132
|
this.onNavigate(l, o);
|
|
133
133
|
}
|
|
134
|
-
this.applyState(l),
|
|
135
|
-
} else o === u.enter ? (
|
|
136
|
-
else
|
|
134
|
+
this.applyState(l), e.preventDefault();
|
|
135
|
+
} else o === u.enter ? (e.preventDefault(), this.props.allowCustom && p && r === null ? this.customItemSelect(e) : r && r.disabled ? g() : this.selectFocusedItem(e)) : o === u.esc && g();
|
|
136
|
+
else e.altKey && o === u.down ? g() : o === u.esc && this.clearButtonClick(e);
|
|
137
137
|
}, this.listContainerContent = () => {
|
|
138
|
-
const { header:
|
|
138
|
+
const { header: e, footer: t, allowCustom: a, size: s, groupStickyHeaderItemRender: o, groupField: p, list: c } = this.props, r = b(this.props), i = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedType: l } = this.getFocusedState(), g = a && i && /* @__PURE__ */ f.createElement(
|
|
139
139
|
"div",
|
|
140
140
|
{
|
|
141
141
|
className: I("k-list", {
|
|
@@ -143,20 +143,20 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
143
143
|
}),
|
|
144
144
|
key: "customitem",
|
|
145
145
|
onClick: this.customItemSelect,
|
|
146
|
-
onMouseDown:
|
|
146
|
+
onMouseDown: H
|
|
147
147
|
},
|
|
148
148
|
/* @__PURE__ */ f.createElement(
|
|
149
149
|
"div",
|
|
150
150
|
{
|
|
151
|
-
className: I("k-list-item k-custom-item", { "k-focus":
|
|
151
|
+
className: I("k-list-item k-custom-item", { "k-focus": W(l) }),
|
|
152
152
|
style: { fontStyle: "italic" }
|
|
153
153
|
},
|
|
154
154
|
i,
|
|
155
|
-
/* @__PURE__ */ f.createElement(L, { name: "plus", icon:
|
|
155
|
+
/* @__PURE__ */ f.createElement(L, { name: "plus", icon: oe, style: { position: "absolute", right: "0.5em" } })
|
|
156
156
|
)
|
|
157
157
|
);
|
|
158
158
|
let { group: d } = this.state;
|
|
159
|
-
return d === void 0 && p !== void 0 && (d = P(r[0], p)), /* @__PURE__ */ f.createElement(f.Fragment, null,
|
|
159
|
+
return d === void 0 && p !== void 0 && (d = P(r[0], p)), /* @__PURE__ */ f.createElement(f.Fragment, null, e && /* @__PURE__ */ f.createElement("div", { className: "k-list-header" }, e), g, /* @__PURE__ */ f.createElement(
|
|
160
160
|
"div",
|
|
161
161
|
{
|
|
162
162
|
className: I("k-list", {
|
|
@@ -164,12 +164,12 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
164
164
|
"k-virtual-list": this.base.vs.enabled
|
|
165
165
|
})
|
|
166
166
|
},
|
|
167
|
-
!c && d && r.length !== 0 && /* @__PURE__ */ f.createElement(
|
|
167
|
+
!c && d && r.length !== 0 && /* @__PURE__ */ f.createElement(de, { group: d, groupMode: "modern", render: o }),
|
|
168
168
|
this.renderList()
|
|
169
|
-
), this.showLicenseWatermark && /* @__PURE__ */ f.createElement(
|
|
169
|
+
), this.showLicenseWatermark && /* @__PURE__ */ f.createElement(J, { message: this.licenseMessage }), t && /* @__PURE__ */ f.createElement("div", { className: "k-list-footer" }, t));
|
|
170
170
|
}, this.renderListContainer = () => {
|
|
171
|
-
const
|
|
172
|
-
dir:
|
|
171
|
+
const e = this.base, { dir: t } = this.props, a = b(this.props), s = this.base.getPopupSettings(), o = s.width !== void 0 ? s.width : e.popupWidth, p = {
|
|
172
|
+
dir: t !== void 0 ? t : e.dirCalculated,
|
|
173
173
|
width: o,
|
|
174
174
|
popupSettings: {
|
|
175
175
|
...s,
|
|
@@ -181,10 +181,10 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
181
181
|
},
|
|
182
182
|
itemsCount: [a.length, this.value.length]
|
|
183
183
|
};
|
|
184
|
-
return /* @__PURE__ */ f.createElement(
|
|
184
|
+
return /* @__PURE__ */ f.createElement(ne, { ...p }, this.listContainerContent());
|
|
185
185
|
}, this.renderAdaptiveListContainer = () => {
|
|
186
|
-
const { adaptiveTitle:
|
|
187
|
-
|
|
186
|
+
const { adaptiveTitle: e, adaptiveSubtitle: t, filterable: a, filter: s } = this.props, { windowWidth: o = 0 } = this.state, p = s !== void 0 ? s : this.state.text, c = a ? /* @__PURE__ */ f.createElement(
|
|
187
|
+
me,
|
|
188
188
|
{
|
|
189
189
|
value: p,
|
|
190
190
|
ref: (i) => {
|
|
@@ -198,42 +198,42 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
198
198
|
placeholder: this.props.placeholder
|
|
199
199
|
}
|
|
200
200
|
) : null, r = {
|
|
201
|
-
title:
|
|
202
|
-
subTitle:
|
|
201
|
+
title: e || this.props.label,
|
|
202
|
+
subTitle: t,
|
|
203
203
|
expand: this.opened,
|
|
204
204
|
onClose: (i) => this.closePopup(i),
|
|
205
205
|
windowWidth: o,
|
|
206
206
|
mobileFilter: c
|
|
207
207
|
};
|
|
208
|
-
return /* @__PURE__ */ f.createElement(
|
|
209
|
-
}, this.closePopup = (
|
|
210
|
-
const
|
|
211
|
-
|
|
208
|
+
return /* @__PURE__ */ f.createElement(fe, { ...r }, /* @__PURE__ */ f.createElement(ge, null, /* @__PURE__ */ f.createElement("div", { className: "k-list-container" }, this.listContainerContent())));
|
|
209
|
+
}, this.closePopup = (e) => {
|
|
210
|
+
const t = this.base.initState();
|
|
211
|
+
t.syntheticEvent = e, e.stopPropagation(), this.state.focusedIndex !== void 0 && (t.data.focusedIndex = void 0), this.opened && this.base.togglePopup(t), t.events.push({ type: "onClose" });
|
|
212
212
|
const a = this.props.filter !== void 0 ? this.props.filter : this.state.text;
|
|
213
|
-
O(a) && a !== "" && this.base.filterChanged("",
|
|
214
|
-
}, this.onCancel = (
|
|
215
|
-
const
|
|
216
|
-
|
|
213
|
+
O(a) && a !== "" && this.base.filterChanged("", t), this.state.text && (t.data.text = ""), this.applyState(t);
|
|
214
|
+
}, this.onCancel = (e) => {
|
|
215
|
+
const t = this.base.initState();
|
|
216
|
+
t.syntheticEvent = e, e.stopPropagation(), this.state.focusedIndex !== void 0 && (t.data.focusedIndex = void 0), this.opened && this.base.togglePopup(t), t.events.push({ type: "onCancel" });
|
|
217
217
|
const a = this.props.filter !== void 0 ? this.props.filter : this.state.text;
|
|
218
|
-
O(a) && a !== "" && this.base.filterChanged("",
|
|
218
|
+
O(a) && a !== "" && this.base.filterChanged("", t), this.state.text && (t.data.text = ""), this.applyState(t);
|
|
219
219
|
}, this.renderList = () => {
|
|
220
220
|
const {
|
|
221
|
-
textField:
|
|
222
|
-
listNoDataRender:
|
|
221
|
+
textField: e,
|
|
222
|
+
listNoDataRender: t,
|
|
223
223
|
itemRender: a,
|
|
224
224
|
groupHeaderItemRender: s,
|
|
225
225
|
dataItemKey: o,
|
|
226
226
|
virtual: p = { skip: 0, total: void 0 }
|
|
227
|
-
} = this.props, c = b(this.props), r = this.base.vs, { focusedIndex: i } = this.getFocusedState(), l = this.base.getPopupSettings(),
|
|
227
|
+
} = this.props, c = b(this.props), r = this.base.vs, { focusedIndex: i } = this.getFocusedState(), l = this.base.getPopupSettings(), g = `translateY(${r.translate}px)`;
|
|
228
228
|
return /* @__PURE__ */ f.createElement(
|
|
229
|
-
|
|
229
|
+
le,
|
|
230
230
|
{
|
|
231
231
|
id: this.base.listBoxId,
|
|
232
232
|
show: this.opened,
|
|
233
233
|
data: c.slice(),
|
|
234
234
|
focusedIndex: i - p.skip,
|
|
235
235
|
value: this.value,
|
|
236
|
-
textField:
|
|
236
|
+
textField: e,
|
|
237
237
|
valueField: o,
|
|
238
238
|
optionsGuid: this.base.guid,
|
|
239
239
|
groupField: this.props.groupField,
|
|
@@ -243,14 +243,14 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
243
243
|
},
|
|
244
244
|
wrapperStyle: this.mobileMode ? {} : { maxHeight: l.height },
|
|
245
245
|
wrapperCssClass: "k-list-content",
|
|
246
|
-
listStyle: r.enabled ? { transform:
|
|
246
|
+
listStyle: r.enabled ? { transform: g } : void 0,
|
|
247
247
|
key: "listKey",
|
|
248
248
|
skip: p.skip,
|
|
249
249
|
onClick: this.handleItemClick,
|
|
250
250
|
itemRender: a,
|
|
251
251
|
groupHeaderItemRender: s,
|
|
252
|
-
noDataRender:
|
|
253
|
-
onMouseDown:
|
|
252
|
+
noDataRender: t,
|
|
253
|
+
onMouseDown: H,
|
|
254
254
|
onBlur: this.handleBlur,
|
|
255
255
|
onScroll: this.onScroll,
|
|
256
256
|
wrapperRef: r.scrollerRef,
|
|
@@ -258,13 +258,13 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
258
258
|
ariaSetSize: p.total
|
|
259
259
|
}
|
|
260
260
|
);
|
|
261
|
-
}, this.onScroll = (
|
|
262
|
-
const { vs:
|
|
263
|
-
|
|
261
|
+
}, this.onScroll = (e) => {
|
|
262
|
+
const { vs: t, list: a } = this.base;
|
|
263
|
+
t.scrollHandler(e);
|
|
264
264
|
const { groupField: s } = this.props;
|
|
265
265
|
let o = b(this.props);
|
|
266
266
|
if (!(!s || !o.length) && s) {
|
|
267
|
-
const p = this.itemHeight = this.itemHeight || (
|
|
267
|
+
const p = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight : a ? a.children[0].offsetHeight : 0), r = e.target.scrollTop - t.skip * p;
|
|
268
268
|
o = this.base.getGroupedDataModernMode(o, s);
|
|
269
269
|
let i = o[0][s];
|
|
270
270
|
for (let l = 1; l < o.length && !(p * l > r); l++)
|
|
@@ -273,31 +273,31 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
273
273
|
group: i
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
|
-
}, this.customItemSelect = (
|
|
277
|
-
const
|
|
278
|
-
if (!
|
|
276
|
+
}, this.customItemSelect = (e) => {
|
|
277
|
+
const t = this.props.filter !== void 0 ? this.props.filter : this.state.text, { textField: a } = this.props;
|
|
278
|
+
if (!t)
|
|
279
279
|
return;
|
|
280
280
|
const s = this.base.initState();
|
|
281
|
-
s.syntheticEvent =
|
|
282
|
-
const o = a ? { [a]:
|
|
281
|
+
s.syntheticEvent = e;
|
|
282
|
+
const o = a ? { [a]: t } : t;
|
|
283
283
|
this.state.text !== void 0 && (s.data.text = ""), s.data.focusedIndex = void 0, this.base.filterChanged("", s);
|
|
284
284
|
const p = [...this.value, o];
|
|
285
285
|
this.triggerOnChange(p, s), this.base.togglePopup(s), this.applyState(s);
|
|
286
|
-
}, this.handleWrapperClick = (
|
|
287
|
-
const
|
|
288
|
-
!this.opened &&
|
|
286
|
+
}, this.handleWrapperClick = (e) => {
|
|
287
|
+
const t = this._input;
|
|
288
|
+
!this.opened && t && this.focusElement(t);
|
|
289
289
|
const a = this.base.initState();
|
|
290
|
-
a.syntheticEvent =
|
|
291
|
-
}, this.handleItemClick = (
|
|
290
|
+
a.syntheticEvent = e, !this.state.focused && !this.mobileMode && (a.events.push({ type: "onFocus" }), a.data.focused = !0), this.mobileMode && (this.setState({ currentValue: this.tagsToRender }), this.mobileMode && window.setTimeout(() => this._adaptiveInput && this._adaptiveInput.focus(), 300)), this.base.togglePopup(a), this.applyState(a);
|
|
291
|
+
}, this.handleItemClick = (e, t) => {
|
|
292
292
|
const a = this.base.initState();
|
|
293
|
-
a.syntheticEvent =
|
|
294
|
-
}, this.handleBlur = (
|
|
293
|
+
a.syntheticEvent = t, this.handleItemSelect(e, a), this.props.autoClose && this.base.togglePopup(a), t.stopPropagation(), this.applyState(a);
|
|
294
|
+
}, this.handleBlur = (e) => {
|
|
295
295
|
if (!this.state.focused || this._skipFocusEvent)
|
|
296
296
|
return;
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
}, this.handleFocus = (
|
|
300
|
-
this._skipFocusEvent || this.base.handleFocus(
|
|
297
|
+
const t = this.base.initState(), { allowCustom: a, filterable: s } = this.props;
|
|
298
|
+
t.syntheticEvent = e, t.data.focused = !1, t.events.push({ type: "onBlur" }), this.opened && !this.mobileMode && (this.state.opened && (t.data.opened = !1), t.events.push({ type: "onClose" })), !a && !s && this.state.text && (t.data.text = ""), this.applyState(t);
|
|
299
|
+
}, this.handleFocus = (e) => {
|
|
300
|
+
this._skipFocusEvent || this.base.handleFocus(e);
|
|
301
301
|
}, this.onPopupOpened = () => {
|
|
302
302
|
this._input && this.state.focused && !this.mobileMode && this.focusElement(this._input);
|
|
303
303
|
}, this.onPopupClosed = () => {
|
|
@@ -306,9 +306,9 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
306
306
|
}, 0);
|
|
307
307
|
}, this.setValidity = () => {
|
|
308
308
|
this._input && this._input.setCustomValidity && this._input.setCustomValidity(
|
|
309
|
-
this.validity.valid ? "" : this.props.validationMessage ||
|
|
309
|
+
this.validity.valid ? "" : this.props.validationMessage || be
|
|
310
310
|
);
|
|
311
|
-
}, this.validate(n);
|
|
311
|
+
}, this.validate(n), this.licenseMessage = Q(z);
|
|
312
312
|
}
|
|
313
313
|
get _inputId() {
|
|
314
314
|
return this.props.id;
|
|
@@ -319,10 +319,10 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
319
319
|
}
|
|
320
320
|
validate(n) {
|
|
321
321
|
if (n.filterable || n.virtual) {
|
|
322
|
-
const
|
|
323
|
-
n.filterable &&
|
|
322
|
+
const e = [];
|
|
323
|
+
n.filterable && e.push("filterable"), n.virtual && e.push("virtualization"), this.showLicenseWatermark = !X(z, {
|
|
324
324
|
component: "MultiSelect",
|
|
325
|
-
features:
|
|
325
|
+
features: e
|
|
326
326
|
});
|
|
327
327
|
}
|
|
328
328
|
}
|
|
@@ -336,17 +336,17 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
336
336
|
}
|
|
337
337
|
/** @hidden */
|
|
338
338
|
get tagsToRender() {
|
|
339
|
-
const { tags: n, textField:
|
|
339
|
+
const { tags: n, textField: e } = this.props, t = [];
|
|
340
340
|
return n === void 0 ? this.value.forEach((a) => {
|
|
341
|
-
|
|
342
|
-
}) :
|
|
341
|
+
t.push({ text: P(a, e), data: [a] });
|
|
342
|
+
}) : t.push(...n), t;
|
|
343
343
|
}
|
|
344
344
|
/**
|
|
345
345
|
* The mobile mode of the MultiSelect.
|
|
346
346
|
*/
|
|
347
347
|
get mobileMode() {
|
|
348
|
-
var
|
|
349
|
-
return !!(this.state.windowWidth && this.props._adaptiveMode && this.state.windowWidth <= ((
|
|
348
|
+
var e;
|
|
349
|
+
return !!(this.state.windowWidth && this.props._adaptiveMode && this.state.windowWidth <= ((e = this.props._adaptiveMode) == null ? void 0 : e.medium) && this.props.adaptive);
|
|
350
350
|
}
|
|
351
351
|
/**
|
|
352
352
|
* Represents the value of the MultiSelect.
|
|
@@ -365,10 +365,10 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
365
365
|
* Represents the validity state into which the MultiSelect is set.
|
|
366
366
|
*/
|
|
367
367
|
get validity() {
|
|
368
|
-
const n = this.props.validationMessage !== void 0,
|
|
368
|
+
const n = this.props.validationMessage !== void 0, e = !this.required || this.value !== null && this.value.length > 0 && this.value !== void 0, t = this.props.valid !== void 0 ? this.props.valid : e;
|
|
369
369
|
return {
|
|
370
370
|
customError: n,
|
|
371
|
-
valid:
|
|
371
|
+
valid: t,
|
|
372
372
|
valueMissing: this.value === null
|
|
373
373
|
};
|
|
374
374
|
}
|
|
@@ -380,14 +380,14 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
380
380
|
return this.props.validityStyles !== void 0 ? this.props.validityStyles : y.defaultProps.validityStyles;
|
|
381
381
|
}
|
|
382
382
|
/** @hidden */
|
|
383
|
-
componentDidUpdate(n,
|
|
384
|
-
var
|
|
385
|
-
const { virtual:
|
|
386
|
-
if (this.validate(this.props), this.base.didUpdate(), !l.animate && i && this.onPopupClosed(),
|
|
383
|
+
componentDidUpdate(n, e) {
|
|
384
|
+
var g;
|
|
385
|
+
const { virtual: t, groupField: a = "" } = this.props, s = b(this.props), o = t ? t.skip : 0, p = n.virtual ? n.virtual.total : 0, c = n.opened !== void 0 ? n.opened : e.opened, r = !c && this.opened, i = c && !this.opened, l = this.base.getPopupSettings();
|
|
386
|
+
if (this.validate(this.props), this.base.didUpdate(), !l.animate && i && this.onPopupClosed(), t && t.total !== p)
|
|
387
387
|
this.base.vs.calcScrollElementHeight(), this.base.vs.reset();
|
|
388
388
|
else {
|
|
389
389
|
let { focusedItem: d, focusedIndex: h } = this.getFocusedState();
|
|
390
|
-
a !== "" && (h = (
|
|
390
|
+
a !== "" && (h = (g = this.base.getGroupedDataModernMode(s, a)) == null ? void 0 : g.indexOf(d)), r && t ? this.base.scrollToVirtualItem(t, h - o) : r && !t ? (s && s.length !== 0 && this.base.resetGroupStickyHeader(s[0][a], this), this.base.scrollToItem(h)) : this.opened && c && d && this.scrollToFocused && this.base.scrollToItem(h - o);
|
|
391
391
|
}
|
|
392
392
|
this.scrollToFocused = !1, this.setValidity();
|
|
393
393
|
}
|
|
@@ -402,17 +402,17 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
402
402
|
(n = this.document) != null && n.body && this.observerResize && this.observerResize.disconnect();
|
|
403
403
|
}
|
|
404
404
|
/** @hidden */
|
|
405
|
-
onNavigate(n,
|
|
406
|
-
const { allowCustom: a } = this.props, s = b(this.props), o = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedType: p, focusedIndex: c } = this.getFocusedState(), r = a && o, i =
|
|
407
|
-
if (this.opened &&
|
|
405
|
+
onNavigate(n, e, t) {
|
|
406
|
+
const { allowCustom: a } = this.props, s = b(this.props), o = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedType: p, focusedIndex: c } = this.getFocusedState(), r = a && o, i = W(p), l = this.base, g = l.vs;
|
|
407
|
+
if (this.opened && e === u.up && i)
|
|
408
408
|
this.state.focusedIndex !== void 0 && (n.data.focusedIndex = void 0);
|
|
409
409
|
else {
|
|
410
410
|
const d = l.navigation.navigate({
|
|
411
|
-
keyCode:
|
|
411
|
+
keyCode: e,
|
|
412
412
|
current: c,
|
|
413
|
-
max: (
|
|
413
|
+
max: (g.enabled ? g.total : s.length) - 1,
|
|
414
414
|
min: r ? -1 : 0,
|
|
415
|
-
skipItems:
|
|
415
|
+
skipItems: t || void 0
|
|
416
416
|
});
|
|
417
417
|
d !== void 0 && (this.itemFocus(d, n), this.scrollToFocused = !0);
|
|
418
418
|
}
|
|
@@ -422,8 +422,8 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
422
422
|
render() {
|
|
423
423
|
const {
|
|
424
424
|
style: n,
|
|
425
|
-
className:
|
|
426
|
-
label:
|
|
425
|
+
className: e,
|
|
426
|
+
label: t,
|
|
427
427
|
dir: a,
|
|
428
428
|
disabled: s,
|
|
429
429
|
textField: o,
|
|
@@ -432,36 +432,36 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
432
432
|
size: r,
|
|
433
433
|
rounded: i,
|
|
434
434
|
fillMode: l,
|
|
435
|
-
loading:
|
|
435
|
+
loading: g,
|
|
436
436
|
filter: d
|
|
437
|
-
} = this.props, { text: h, focused: v, focusedTag: x, currentValue:
|
|
437
|
+
} = this.props, { text: h, focused: v, focusedTag: x, currentValue: $ } = this.state, C = this.base.vs, K = this.props.id || this._inputId;
|
|
438
438
|
C.enabled = c !== void 0, c !== void 0 && (C.skip = c.skip, C.total = c.total, C.pageSize = c.pageSize);
|
|
439
|
-
const S = this.mobileMode && this.opened ?
|
|
439
|
+
const S = this.mobileMode && this.opened ? $ : this.tagsToRender;
|
|
440
440
|
this.setItems(this.tagsToRender, this._tags);
|
|
441
|
-
const N = !this.validityStyles || this.validity.valid,
|
|
441
|
+
const N = !this.validityStyles || this.validity.valid, q = !!(d !== void 0 ? d : h) || S && S.length > 0, [G, U] = A(this.props.prefix || f.Fragment), [j, Y] = A(this.props.suffix || f.Fragment), R = /* @__PURE__ */ f.createElement(f.Fragment, null, /* @__PURE__ */ f.createElement(
|
|
442
442
|
"div",
|
|
443
443
|
{
|
|
444
444
|
ref: this.componentRef,
|
|
445
|
-
className: I("k-multiselect k-input",
|
|
445
|
+
className: I("k-multiselect k-input", e, {
|
|
446
446
|
[`k-input-${D[r] || r}`]: r,
|
|
447
|
-
[`k-rounded-${
|
|
447
|
+
[`k-rounded-${ve[i] || i}`]: i,
|
|
448
448
|
[`k-input-${l}`]: l,
|
|
449
449
|
"k-focus": v && !s,
|
|
450
450
|
"k-invalid": !N,
|
|
451
451
|
"k-disabled": s,
|
|
452
|
-
"k-loading":
|
|
452
|
+
"k-loading": g,
|
|
453
453
|
"k-required": this.required
|
|
454
454
|
}),
|
|
455
|
-
style:
|
|
455
|
+
style: t ? { ...n, width: void 0 } : n,
|
|
456
456
|
dir: a,
|
|
457
457
|
onFocus: (k) => {
|
|
458
458
|
this.mobileMode ? this.handleWrapperClick(k) : this.handleFocus(k);
|
|
459
459
|
},
|
|
460
460
|
onBlur: this.handleBlur,
|
|
461
461
|
onClick: this.handleWrapperClick,
|
|
462
|
-
onMouseDown:
|
|
462
|
+
onMouseDown: pe
|
|
463
463
|
},
|
|
464
|
-
this.props.prefix && /* @__PURE__ */ f.createElement(
|
|
464
|
+
this.props.prefix && /* @__PURE__ */ f.createElement(G, { ...U }),
|
|
465
465
|
/* @__PURE__ */ f.createElement("div", { className: I("k-input-values") }, /* @__PURE__ */ f.createElement(
|
|
466
466
|
"div",
|
|
467
467
|
{
|
|
@@ -470,7 +470,7 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
470
470
|
id: "tagslist-" + this.base.guid
|
|
471
471
|
},
|
|
472
472
|
S && S.length > 0 && /* @__PURE__ */ f.createElement(
|
|
473
|
-
|
|
473
|
+
re,
|
|
474
474
|
{
|
|
475
475
|
tagRender: this.props.tagRender,
|
|
476
476
|
onTagDelete: this.onTagDelete,
|
|
@@ -481,15 +481,15 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
481
481
|
}
|
|
482
482
|
)
|
|
483
483
|
), this.renderSearchBar(K)),
|
|
484
|
-
|
|
485
|
-
this.props.suffix && /* @__PURE__ */ f.createElement(
|
|
486
|
-
|
|
484
|
+
g && /* @__PURE__ */ f.createElement(L, { className: "k-input-loading-icon", name: "loading" }),
|
|
485
|
+
this.props.suffix && /* @__PURE__ */ f.createElement(j, { ...Y }),
|
|
486
|
+
q && /* @__PURE__ */ f.createElement(ue, { onClick: this.clearButtonClick }),
|
|
487
487
|
!this.mobileMode && this.renderListContainer()
|
|
488
488
|
), this.mobileMode && this.renderAdaptiveListContainer());
|
|
489
|
-
return
|
|
490
|
-
|
|
489
|
+
return t ? /* @__PURE__ */ f.createElement(
|
|
490
|
+
ae,
|
|
491
491
|
{
|
|
492
|
-
label:
|
|
492
|
+
label: t,
|
|
493
493
|
editorId: K,
|
|
494
494
|
editorValue: h || P(this.value[0], o),
|
|
495
495
|
editorValid: N,
|
|
@@ -500,12 +500,12 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
500
500
|
) : R;
|
|
501
501
|
}
|
|
502
502
|
renderSearchBar(n) {
|
|
503
|
-
const { activedescendant:
|
|
503
|
+
const { activedescendant: e, focusedTag: t, currentValue: a } = this.state, { disabled: s, placeholder: o, ariaDescribedBy: p, ariaLabelledBy: c, ariaLabel: r, inputAttributes: i } = this.props, l = !this.mobileMode && (this.props.filter !== void 0 ? this.props.filter : this.state.text) || "", { focusedIndex: g } = this.getFocusedState(), d = this.value.length === 0 && !l ? o : void 0, h = a && a.length > 0 ? void 0 : o, v = e === w.TagsList && t !== void 0 ? `tag-${this.base.guid}-${t.text.replace(/\s+/g, "-")}` : `option-${this.base.guid}-${g}`, x = {
|
|
504
504
|
accessKey: this.props.accessKey,
|
|
505
505
|
tabIndex: this.props.tabIndex
|
|
506
506
|
};
|
|
507
507
|
return /* @__PURE__ */ f.createElement(
|
|
508
|
-
|
|
508
|
+
he,
|
|
509
509
|
{
|
|
510
510
|
id: n,
|
|
511
511
|
size: Math.max((d || "").length, l.length, 1),
|
|
@@ -528,51 +528,51 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
528
528
|
}
|
|
529
529
|
);
|
|
530
530
|
}
|
|
531
|
-
onTagsNavigate(n,
|
|
532
|
-
const
|
|
531
|
+
onTagsNavigate(n, e) {
|
|
532
|
+
const t = n.keyCode, { focusedTag: a } = this.state, s = this._tags, o = this.props.dataItemKey;
|
|
533
533
|
let p = a ? s.findIndex((i) => V(i, a, o)) : -1, c;
|
|
534
534
|
const r = p !== -1;
|
|
535
|
-
if (
|
|
535
|
+
if (t === u.left)
|
|
536
536
|
r ? p = Math.max(0, p - 1) : p = s.length - 1, c = s[p];
|
|
537
|
-
else if (
|
|
537
|
+
else if (t === u.right)
|
|
538
538
|
p === s.length - 1 ? c = void 0 : r && (p = Math.min(s.length - 1, p + 1), c = s[p]);
|
|
539
|
-
else if (
|
|
539
|
+
else if (t === u.home && !n.shiftKey)
|
|
540
540
|
c = s[0];
|
|
541
|
-
else if (
|
|
541
|
+
else if (t === u.end && !n.shiftKey)
|
|
542
542
|
c = s[s.length - 1];
|
|
543
|
-
else if (
|
|
543
|
+
else if (t === u.delete) {
|
|
544
544
|
if (r) {
|
|
545
545
|
const i = this.value;
|
|
546
|
-
T(i, s[p].data, o), this.triggerOnChange(i,
|
|
546
|
+
T(i, s[p].data, o), this.triggerOnChange(i, e);
|
|
547
547
|
}
|
|
548
|
-
} else if (
|
|
548
|
+
} else if (t === u.backspace) {
|
|
549
549
|
const i = this.value;
|
|
550
550
|
if (r)
|
|
551
|
-
T(i, s[p].data, o), this.triggerOnChange(i,
|
|
551
|
+
T(i, s[p].data, o), this.triggerOnChange(i, e);
|
|
552
552
|
else if (!r && s.length) {
|
|
553
553
|
const l = s.pop();
|
|
554
|
-
T(i, l.data, o), this.triggerOnChange(i,
|
|
554
|
+
T(i, l.data, o), this.triggerOnChange(i, e);
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
c !== a && (
|
|
557
|
+
c !== a && (e.data.focusedTag = c, e.data.activedescendant = w.TagsList), this.applyState(e);
|
|
558
558
|
}
|
|
559
|
-
triggerOnChange(n,
|
|
560
|
-
this.props.value === void 0 && (
|
|
559
|
+
triggerOnChange(n, e) {
|
|
560
|
+
this.props.value === void 0 && (e.data.value = [...n]), this._valueItemsDuringOnChange = [], this.setItems(n, this._valueItemsDuringOnChange), e.events.push({ type: "onChange" });
|
|
561
561
|
}
|
|
562
|
-
selectFocusedItem(n,
|
|
563
|
-
const { virtual:
|
|
562
|
+
selectFocusedItem(n, e) {
|
|
563
|
+
const { virtual: t } = this.props, a = b(this.props), { focusedIndex: s } = e || this.getFocusedState(), o = t ? t.skip : 0;
|
|
564
564
|
a[s - o] !== void 0 && this.handleItemClick(s, n);
|
|
565
565
|
}
|
|
566
|
-
setItems(n,
|
|
567
|
-
|
|
566
|
+
setItems(n, e) {
|
|
567
|
+
e.length = 0, e.push(...n);
|
|
568
568
|
}
|
|
569
569
|
getFocusedState() {
|
|
570
|
-
const { focusedIndex: n } = this.state,
|
|
571
|
-
allowCustom:
|
|
570
|
+
const { focusedIndex: n } = this.state, e = this.props.filter !== void 0 ? this.props.filter : this.state.text, {
|
|
571
|
+
allowCustom: t,
|
|
572
572
|
dataItemKey: a,
|
|
573
573
|
virtual: s,
|
|
574
574
|
textField: o,
|
|
575
|
-
focusedItemIndex: p =
|
|
575
|
+
focusedItemIndex: p = ce,
|
|
576
576
|
skipDisabledItems: c
|
|
577
577
|
} = this.props, r = b(this.props), i = s && s.skip || 0;
|
|
578
578
|
let l;
|
|
@@ -583,30 +583,30 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
583
583
|
focusedType: 1
|
|
584
584
|
/* ListItem */
|
|
585
585
|
};
|
|
586
|
-
const
|
|
587
|
-
if (
|
|
586
|
+
const g = this.value;
|
|
587
|
+
if (t && e)
|
|
588
588
|
return {
|
|
589
589
|
focusedItem: null,
|
|
590
590
|
focusedIndex: -1,
|
|
591
591
|
focusedType: 2
|
|
592
592
|
/* CustomItem */
|
|
593
593
|
};
|
|
594
|
-
if (
|
|
595
|
-
return l = p(r,
|
|
594
|
+
if (e)
|
|
595
|
+
return l = p(r, e, o), {
|
|
596
596
|
focusedItem: r[l],
|
|
597
597
|
focusedIndex: l + i,
|
|
598
598
|
focusedType: 1
|
|
599
599
|
/* ListItem */
|
|
600
600
|
};
|
|
601
|
-
if (
|
|
602
|
-
const d =
|
|
603
|
-
return l = r.findIndex((h) =>
|
|
601
|
+
if (g.length) {
|
|
602
|
+
const d = g[g.length - 1];
|
|
603
|
+
return l = r.findIndex((h) => E(h, d, a)), r[l] !== void 0 ? {
|
|
604
604
|
focusedIndex: l + i,
|
|
605
605
|
focusedItem: r[l],
|
|
606
606
|
focusedType: 1
|
|
607
607
|
/* ListItem */
|
|
608
608
|
} : { focusedType: 0, focusedIndex: -1 };
|
|
609
|
-
} else if (c && o && !
|
|
609
|
+
} else if (c && o && !e && i === 0) {
|
|
610
610
|
const d = r.findIndex((h) => !h.disabled && h[o]);
|
|
611
611
|
return {
|
|
612
612
|
focusedIndex: d,
|
|
@@ -629,8 +629,8 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
629
629
|
this.base.applyState(n), this._valueItemsDuringOnChange = null;
|
|
630
630
|
}
|
|
631
631
|
calculateMedia(n) {
|
|
632
|
-
for (const
|
|
633
|
-
this.setState({ windowWidth:
|
|
632
|
+
for (const e of n)
|
|
633
|
+
this.setState({ windowWidth: e.target.clientWidth });
|
|
634
634
|
}
|
|
635
635
|
/**
|
|
636
636
|
* Updates the state of the MultiSelect when the complex keyboard navigation that
|
|
@@ -639,45 +639,45 @@ const { sizeMap: D, roundedMap: gt } = et, vt = "Please enter a valid value!", A
|
|
|
639
639
|
* @param {Array<string | Object>} dataToSet Defines the array of new values that will be applied to the MultiSelect
|
|
640
640
|
* @param {MultiSelectInternalState} state The current state of the MultiSelect
|
|
641
641
|
*/
|
|
642
|
-
updateStateOnKeyboardNavigation(n,
|
|
643
|
-
this.setState({ value: n }), this.triggerOnChange(n,
|
|
642
|
+
updateStateOnKeyboardNavigation(n, e) {
|
|
643
|
+
this.setState({ value: n }), this.triggerOnChange(n, e), this.applyState(e);
|
|
644
644
|
}
|
|
645
645
|
/**
|
|
646
646
|
* Returns the last element that was selected or deselected. Needed for the keyboard navigation specifications
|
|
647
647
|
*
|
|
648
648
|
* @param {number} correction A correction is needed depending on if UP or DOWN key is pressed
|
|
649
649
|
*/
|
|
650
|
-
getLastSelectedOrDeselectedIndex(n,
|
|
651
|
-
return this._lastSelectedOrDeslectedItemIndex === null && (this._lastSelectedOrDeslectedItemIndex =
|
|
650
|
+
getLastSelectedOrDeselectedIndex(n, e) {
|
|
651
|
+
return this._lastSelectedOrDeslectedItemIndex === null && (this._lastSelectedOrDeslectedItemIndex = e), this._lastSelectedOrDeslectedItemIndex !== null ? this._lastSelectedOrDeslectedItemIndex + n : null;
|
|
652
652
|
}
|
|
653
653
|
};
|
|
654
654
|
y.displayName = "MultiSelect", y.propTypes = {
|
|
655
|
-
...
|
|
656
|
-
autoClose:
|
|
657
|
-
value:
|
|
658
|
-
defaultValue:
|
|
659
|
-
dataItemKey:
|
|
660
|
-
placeholder:
|
|
661
|
-
tags:
|
|
662
|
-
|
|
663
|
-
text:
|
|
664
|
-
data:
|
|
655
|
+
...M.propTypes,
|
|
656
|
+
autoClose: m.bool,
|
|
657
|
+
value: m.arrayOf(m.any),
|
|
658
|
+
defaultValue: m.arrayOf(m.any),
|
|
659
|
+
dataItemKey: m.string,
|
|
660
|
+
placeholder: m.string,
|
|
661
|
+
tags: m.arrayOf(
|
|
662
|
+
m.shape({
|
|
663
|
+
text: m.string,
|
|
664
|
+
data: m.arrayOf(m.any)
|
|
665
665
|
})
|
|
666
666
|
),
|
|
667
|
-
tagRender:
|
|
668
|
-
id:
|
|
669
|
-
ariaLabelledBy:
|
|
670
|
-
ariaDescribedBy:
|
|
671
|
-
groupField:
|
|
672
|
-
list:
|
|
673
|
-
adaptive:
|
|
674
|
-
adaptiveTitle:
|
|
675
|
-
adaptiveSubtitle:
|
|
676
|
-
onCancel:
|
|
677
|
-
skipDisabledItems:
|
|
678
|
-
inputAttributes:
|
|
667
|
+
tagRender: m.func,
|
|
668
|
+
id: m.string,
|
|
669
|
+
ariaLabelledBy: m.string,
|
|
670
|
+
ariaDescribedBy: m.string,
|
|
671
|
+
groupField: m.string,
|
|
672
|
+
list: m.any,
|
|
673
|
+
adaptive: m.bool,
|
|
674
|
+
adaptiveTitle: m.string,
|
|
675
|
+
adaptiveSubtitle: m.string,
|
|
676
|
+
onCancel: m.func,
|
|
677
|
+
skipDisabledItems: m.bool,
|
|
678
|
+
inputAttributes: m.object
|
|
679
679
|
}, y.defaultProps = {
|
|
680
|
-
...
|
|
680
|
+
...M.defaultProps,
|
|
681
681
|
autoClose: !0,
|
|
682
682
|
required: !1,
|
|
683
683
|
size: "medium",
|
|
@@ -689,15 +689,15 @@ y.displayName = "MultiSelect", y.propTypes = {
|
|
|
689
689
|
suffix: void 0
|
|
690
690
|
};
|
|
691
691
|
let _ = y;
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
692
|
+
const Ie = Z(), ye = ee(
|
|
693
|
+
te(
|
|
694
|
+
Ie,
|
|
695
|
+
se(_)
|
|
696
696
|
)
|
|
697
697
|
);
|
|
698
|
-
|
|
698
|
+
ye.displayName = "KendoReactMultiSelect";
|
|
699
699
|
export {
|
|
700
|
-
|
|
701
|
-
|
|
700
|
+
ye as MultiSelect,
|
|
701
|
+
Ie as MultiSelectPropsContext,
|
|
702
702
|
_ as MultiSelectWithoutContext
|
|
703
703
|
};
|