@progress/kendo-react-dropdowns 8.2.1-develop.5 → 8.3.0-develop.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +185 -176
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +1 -0
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +130 -127
- 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 +5 -0
- package/index.d.ts +5 -0
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
|
@@ -36,18 +36,18 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
36
36
|
}, this._element = null, this._valueItemsDuringOnChange = null, this.base = new F(this), this._tags = [], this._input = null, this._adaptiveInput = null, this._skipFocusEvent = !1, this._lastSelectedOrDeslectedItemIndex = null, this.itemHeight = 0, this.scrollToFocused = !1, this.localization = null, this.focus = () => {
|
|
37
37
|
this._input && this._input.focus();
|
|
38
38
|
}, this.handleItemSelect = (e, t) => {
|
|
39
|
-
const { dataItemKey: o, virtual: s } = this.props, a = I(this.props),
|
|
39
|
+
const { dataItemKey: o, virtual: s } = this.props, a = I(this.props), p = s ? s.skip : 0, c = a[e - p], r = this.value.findIndex((g) => E(g, c, o));
|
|
40
40
|
this._lastSelectedOrDeslectedItemIndex = a.findIndex((g) => E(g, c, o));
|
|
41
41
|
let i = [];
|
|
42
|
-
|
|
42
|
+
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);
|
|
43
43
|
}, this.onTagDelete = (e, t) => {
|
|
44
44
|
const o = this.base.initState();
|
|
45
45
|
o.syntheticEvent = t, this.opened && this.base.togglePopup(o), !this.state.focused && !this.mobileMode && (o.data.focused = !0, this.focus());
|
|
46
46
|
const s = this.value;
|
|
47
47
|
w(s, e, this.props.dataItemKey), this.triggerOnChange(s, o), this.applyState(o);
|
|
48
48
|
}, this.itemFocus = (e, t) => {
|
|
49
|
-
const { allowCustom: o, virtual: s } = this.props, a = I(this.props),
|
|
50
|
-
|
|
49
|
+
const { allowCustom: o, virtual: s } = this.props, a = I(this.props), p = s ? s.skip : 0, c = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedIndex: r } = this.getFocusedState(), i = o && c, d = a[e - p];
|
|
50
|
+
d && r !== e ? this.state.focusedIndex !== e && (t.data.focusedIndex = e, t.data.activedescendant = k.PopupList) : i && e === -1 && this.state.focusedIndex !== void 0 && (t.data.focusedIndex = void 0), this.base.triggerPageChangeCornerItems(d, t);
|
|
51
51
|
}, this.componentRef = (e) => {
|
|
52
52
|
this._element = e, this.base.wrapper = e;
|
|
53
53
|
}, this.searchbarRef = (e) => {
|
|
@@ -62,11 +62,11 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
62
62
|
const o = this.props.filter !== void 0 ? this.props.filter : this.state.text;
|
|
63
63
|
M(o) && o !== "" && this.base.filterChanged("", t), this.state.text && (t.data.text = ""), this._lastSelectedOrDeslectedItemIndex = null, this.applyState(t);
|
|
64
64
|
}, this.onInputKeyDown = (e) => {
|
|
65
|
-
const { textField: t, groupField: o } = this.props, s = I(this.props), a = e.keyCode,
|
|
66
|
-
if (
|
|
67
|
-
return this.onTagsNavigate(e,
|
|
65
|
+
const { textField: t, groupField: o } = this.props, s = I(this.props), a = 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(), d = this.base.initState();
|
|
66
|
+
if (d.syntheticEvent = e, !p && this.value.length > 0 && (a === u.left || a === u.right || a === u.home || a === u.end || a === u.delete || a === u.backspace) && !e.shiftKey)
|
|
67
|
+
return this.onTagsNavigate(e, d);
|
|
68
68
|
const g = () => {
|
|
69
|
-
e.preventDefault(), this.base.togglePopup(
|
|
69
|
+
e.preventDefault(), this.base.togglePopup(d), this.applyState(d);
|
|
70
70
|
};
|
|
71
71
|
if (this.opened)
|
|
72
72
|
if (a === u.pageUp)
|
|
@@ -74,75 +74,75 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
74
74
|
else if (a === u.pageDown)
|
|
75
75
|
e.preventDefault(), this.base.scrollPopupByPageSize(1);
|
|
76
76
|
else if ((e.ctrlKey || e.metaKey) && e.code === "KeyA") {
|
|
77
|
-
const
|
|
78
|
-
this.updateStateOnKeyboardNavigation(
|
|
77
|
+
const h = (this.state.value && this.state.value.length) === s.length ? [] : s;
|
|
78
|
+
this.updateStateOnKeyboardNavigation(h, d);
|
|
79
79
|
} else if ((e.ctrlKey || e.metaKey) && e.shiftKey && e.keyCode === u.end) {
|
|
80
|
-
const
|
|
81
|
-
this.itemFocus(s.length - 1,
|
|
80
|
+
const l = s.slice(this.getFocusedState().focusedIndex);
|
|
81
|
+
this.itemFocus(s.length - 1, d), this.updateStateOnKeyboardNavigation(l, d);
|
|
82
82
|
} else if ((e.ctrlKey || e.metaKey) && e.shiftKey && e.keyCode === u.home) {
|
|
83
|
-
const
|
|
84
|
-
this.itemFocus(0,
|
|
83
|
+
const l = s.slice(0, this.getFocusedState().focusedIndex + 1);
|
|
84
|
+
this.itemFocus(0, d), this.updateStateOnKeyboardNavigation(l, d);
|
|
85
85
|
} else if (e.shiftKey && e.keyCode === u.up) {
|
|
86
|
-
let
|
|
87
|
-
const
|
|
88
|
-
|
|
86
|
+
let l;
|
|
87
|
+
const h = this.getLastSelectedOrDeselectedIndex(1, i);
|
|
88
|
+
h === null ? l = i !== 0 ? s.slice(i - 1, i) : [s[i]] : h === i ? l = [s[h - 1]] : i >= 0 && (l = h > i ? s.slice(i - 1, h) : s.slice(h - 1, i)), l && l.length > 0 && (i >= 1 && this.itemFocus(i - 1, d), this.updateStateOnKeyboardNavigation(l, d));
|
|
89
89
|
} else if (e.shiftKey && e.keyCode === u.down) {
|
|
90
|
-
let
|
|
91
|
-
const
|
|
92
|
-
|
|
90
|
+
let l;
|
|
91
|
+
const h = this.getLastSelectedOrDeselectedIndex(0, i);
|
|
92
|
+
h === null ? l = i !== s.length - 1 ? s.slice(i, i + 1) : [s[i]] : h === i ? l = s.slice(i, i + 2) : i >= 0 && (l = h > i ? s.slice(i + 1, h + 1) : s.slice(h, i + 2)), l && l.length >= 1 && (this.itemFocus(i + 1, d), this.updateStateOnKeyboardNavigation(l, d));
|
|
93
93
|
} else if (e.altKey && a === u.up)
|
|
94
94
|
g();
|
|
95
95
|
else if (a === u.up || a === u.down) {
|
|
96
96
|
if (o !== "" && t)
|
|
97
97
|
if (!this.props.skipDisabledItems && c)
|
|
98
|
-
this.onNavigate(
|
|
98
|
+
this.onNavigate(d, a);
|
|
99
99
|
else {
|
|
100
|
-
let
|
|
100
|
+
let l = 0;
|
|
101
101
|
if (a === u.down || a === u.right) {
|
|
102
|
-
const
|
|
103
|
-
|
|
102
|
+
const h = s.slice(i + 1).find((v) => !v.disabled && v[t]);
|
|
103
|
+
l = h && s.findIndex((v) => v[t] === h[t]);
|
|
104
104
|
} else if (a === u.up || a === u.left) {
|
|
105
|
-
let
|
|
105
|
+
let h;
|
|
106
106
|
if (i === -1)
|
|
107
|
-
|
|
107
|
+
h = s, l = s.findIndex((v) => !v.disabled && v[t]);
|
|
108
108
|
else {
|
|
109
|
-
|
|
110
|
-
let v =
|
|
109
|
+
h = s.slice(0, i);
|
|
110
|
+
let v = h.pop();
|
|
111
111
|
for (; v && v.disabled; )
|
|
112
|
-
v =
|
|
113
|
-
|
|
112
|
+
v = h.pop();
|
|
113
|
+
l = v && s.findIndex((S) => S[t] === v[t]);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
if (
|
|
117
|
-
const
|
|
118
|
-
this.onNavigate(
|
|
116
|
+
if (l) {
|
|
117
|
+
const h = l - i;
|
|
118
|
+
this.onNavigate(d, a, h);
|
|
119
119
|
} else
|
|
120
|
-
|
|
120
|
+
l !== void 0 && this.onNavigate(d, a);
|
|
121
121
|
}
|
|
122
122
|
else if (!this.props.skipDisabledItems && c)
|
|
123
|
-
this.onNavigate(
|
|
123
|
+
this.onNavigate(d, a);
|
|
124
124
|
else {
|
|
125
|
-
let
|
|
125
|
+
let l = null;
|
|
126
126
|
if (a === u.down || a === u.right)
|
|
127
|
-
|
|
127
|
+
l = s.slice(i + 1).find((h) => !h.disabled);
|
|
128
128
|
else if (a === u.up || a === u.left) {
|
|
129
|
-
const
|
|
130
|
-
for (
|
|
131
|
-
|
|
129
|
+
const h = s.slice(0, i);
|
|
130
|
+
for (l = h.pop(); l && l.disabled; )
|
|
131
|
+
l = h.pop();
|
|
132
132
|
}
|
|
133
|
-
if (
|
|
134
|
-
const
|
|
135
|
-
this.onNavigate(
|
|
133
|
+
if (l) {
|
|
134
|
+
const h = l.id - i - 1;
|
|
135
|
+
this.onNavigate(d, a, h);
|
|
136
136
|
} else
|
|
137
|
-
this.onNavigate(
|
|
137
|
+
this.onNavigate(d, a);
|
|
138
138
|
}
|
|
139
|
-
this.applyState(
|
|
139
|
+
this.applyState(d), e.preventDefault();
|
|
140
140
|
} else
|
|
141
|
-
a === u.enter ? (e.preventDefault(), this.props.allowCustom &&
|
|
141
|
+
a === u.enter ? (e.preventDefault(), this.props.allowCustom && p && r === null ? this.customItemSelect(e) : r && r.disabled ? g() : this.selectFocusedItem(e)) : a === u.esc && g();
|
|
142
142
|
else
|
|
143
143
|
e.altKey && a === u.down ? g() : a === u.esc && this.clearButtonClick(e);
|
|
144
144
|
}, this.listContainerContent = () => {
|
|
145
|
-
const { header: e, footer: t, allowCustom: o, size: s, groupStickyHeaderItemRender: a, groupField:
|
|
145
|
+
const { header: e, footer: t, allowCustom: o, size: s, groupStickyHeaderItemRender: a, groupField: p, list: c } = this.props, r = I(this.props), i = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedType: d } = this.getFocusedState(), g = o && i && /* @__PURE__ */ f.createElement(
|
|
146
146
|
"div",
|
|
147
147
|
{
|
|
148
148
|
className: y("k-list", {
|
|
@@ -155,15 +155,15 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
155
155
|
/* @__PURE__ */ f.createElement(
|
|
156
156
|
"div",
|
|
157
157
|
{
|
|
158
|
-
className: y("k-list-item k-custom-item", { "k-focus": q(
|
|
158
|
+
className: y("k-list-item k-custom-item", { "k-focus": q(d) }),
|
|
159
159
|
style: { fontStyle: "italic" }
|
|
160
160
|
},
|
|
161
161
|
i,
|
|
162
162
|
/* @__PURE__ */ f.createElement(R, { name: "plus", icon: it, style: { position: "absolute", right: "0.5em" } })
|
|
163
163
|
)
|
|
164
164
|
);
|
|
165
|
-
let { group:
|
|
166
|
-
return
|
|
165
|
+
let { group: l } = this.state;
|
|
166
|
+
return l === void 0 && p !== void 0 && (l = O(r[0], p)), /* @__PURE__ */ f.createElement(f.Fragment, null, e && /* @__PURE__ */ f.createElement("div", { className: "k-list-header" }, e), g, /* @__PURE__ */ f.createElement(
|
|
167
167
|
"div",
|
|
168
168
|
{
|
|
169
169
|
className: y(
|
|
@@ -174,11 +174,11 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
174
174
|
}
|
|
175
175
|
)
|
|
176
176
|
},
|
|
177
|
-
!c &&
|
|
177
|
+
!c && l && r.length !== 0 && /* @__PURE__ */ f.createElement(lt, { group: l, groupMode: "modern", render: a }),
|
|
178
178
|
this.renderList()
|
|
179
179
|
), t && /* @__PURE__ */ f.createElement("div", { className: "k-list-footer" }, t));
|
|
180
180
|
}, this.renderListContainer = () => {
|
|
181
|
-
const e = this.base, { dir: t } = this.props, o = I(this.props), s = this.base.getPopupSettings(), a = s.width !== void 0 ? s.width : e.popupWidth,
|
|
181
|
+
const e = this.base, { dir: t } = this.props, o = I(this.props), s = this.base.getPopupSettings(), a = s.width !== void 0 ? s.width : e.popupWidth, p = {
|
|
182
182
|
dir: t !== void 0 ? t : e.dirCalculated,
|
|
183
183
|
width: a,
|
|
184
184
|
popupSettings: {
|
|
@@ -195,15 +195,15 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
195
195
|
},
|
|
196
196
|
itemsCount: [o.length, this.value.length]
|
|
197
197
|
};
|
|
198
|
-
return /* @__PURE__ */ f.createElement(at, { ...
|
|
198
|
+
return /* @__PURE__ */ f.createElement(at, { ...p }, this.listContainerContent());
|
|
199
199
|
}, this.renderAdaptiveListContainer = () => {
|
|
200
200
|
const { adaptiveTitle: e, filterable: t, filter: o } = this.props, { windowWidth: s = 0 } = this.state, a = o !== void 0 ? o : this.state.text;
|
|
201
201
|
this.localization = vt(this);
|
|
202
|
-
const
|
|
202
|
+
const p = t ? /* @__PURE__ */ f.createElement(
|
|
203
203
|
It,
|
|
204
204
|
{
|
|
205
205
|
value: a,
|
|
206
|
-
ref: (
|
|
206
|
+
ref: (r) => this._adaptiveInput = r && r.element,
|
|
207
207
|
onChange: this.onChangeHandler,
|
|
208
208
|
onKeyDown: this.onInputKeyDown,
|
|
209
209
|
size: this.props.size,
|
|
@@ -213,9 +213,9 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
213
213
|
) : null, c = {
|
|
214
214
|
adaptiveTitle: e,
|
|
215
215
|
expand: this.opened,
|
|
216
|
-
onClose: (
|
|
216
|
+
onClose: (r) => this.onCancel(r),
|
|
217
217
|
windowWidth: s,
|
|
218
|
-
mobileFilter:
|
|
218
|
+
mobileFilter: p,
|
|
219
219
|
footer: {
|
|
220
220
|
cancelText: this.localization.toLanguageString(z, V[z]),
|
|
221
221
|
onCancel: this.onCancel,
|
|
@@ -241,29 +241,29 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
241
241
|
itemRender: o,
|
|
242
242
|
groupHeaderItemRender: s,
|
|
243
243
|
dataItemKey: a,
|
|
244
|
-
virtual:
|
|
245
|
-
} = this.props, c = I(this.props),
|
|
244
|
+
virtual: p = { skip: 0, total: void 0 }
|
|
245
|
+
} = this.props, c = I(this.props), r = this.base.vs, { focusedIndex: i } = this.getFocusedState(), d = this.base.getPopupSettings(), g = `translateY(${r.translate}px)`;
|
|
246
246
|
return /* @__PURE__ */ f.createElement(
|
|
247
247
|
nt,
|
|
248
248
|
{
|
|
249
249
|
id: this.base.listBoxId,
|
|
250
250
|
show: this.opened,
|
|
251
251
|
data: c.slice(),
|
|
252
|
-
focusedIndex: i -
|
|
252
|
+
focusedIndex: i - p.skip,
|
|
253
253
|
value: this.value,
|
|
254
254
|
textField: e,
|
|
255
255
|
valueField: a,
|
|
256
256
|
optionsGuid: this.base.guid,
|
|
257
257
|
groupField: this.props.groupField,
|
|
258
258
|
groupMode: "modern",
|
|
259
|
-
listRef: (
|
|
260
|
-
|
|
259
|
+
listRef: (l) => {
|
|
260
|
+
r.list = this.base.list = l;
|
|
261
261
|
},
|
|
262
|
-
wrapperStyle: this.mobileMode ? {} : { maxHeight:
|
|
262
|
+
wrapperStyle: this.mobileMode ? {} : { maxHeight: d.height },
|
|
263
263
|
wrapperCssClass: "k-list-content",
|
|
264
|
-
listStyle:
|
|
264
|
+
listStyle: r.enabled ? { transform: g } : void 0,
|
|
265
265
|
key: "listKey",
|
|
266
|
-
skip:
|
|
266
|
+
skip: p.skip,
|
|
267
267
|
onClick: this.handleItemClick,
|
|
268
268
|
itemRender: o,
|
|
269
269
|
groupHeaderItemRender: s,
|
|
@@ -271,9 +271,9 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
271
271
|
onMouseDown: $,
|
|
272
272
|
onBlur: this.handleBlur,
|
|
273
273
|
onScroll: this.onScroll,
|
|
274
|
-
wrapperRef:
|
|
274
|
+
wrapperRef: r.scrollerRef,
|
|
275
275
|
scroller: this.base.renderScrollElement(),
|
|
276
|
-
ariaSetSize:
|
|
276
|
+
ariaSetSize: p.total
|
|
277
277
|
}
|
|
278
278
|
);
|
|
279
279
|
}, this.onScroll = (e) => {
|
|
@@ -282,11 +282,11 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
282
282
|
const { groupField: s } = this.props;
|
|
283
283
|
let a = I(this.props);
|
|
284
284
|
if (!(!s || !a.length) && s) {
|
|
285
|
-
const
|
|
285
|
+
const p = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight : o ? o.children[0].offsetHeight : 0), r = e.target.scrollTop - t.skip * p;
|
|
286
286
|
a = this.base.getGroupedDataModernMode(a, s);
|
|
287
287
|
let i = a[0][s];
|
|
288
|
-
for (let
|
|
289
|
-
a[
|
|
288
|
+
for (let d = 1; d < a.length && !(p * d > r); d++)
|
|
289
|
+
a[d] && a[d][s] && (i = a[d][s]);
|
|
290
290
|
i !== this.state.group && this.setState({
|
|
291
291
|
group: i
|
|
292
292
|
});
|
|
@@ -299,8 +299,8 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
299
299
|
s.syntheticEvent = e;
|
|
300
300
|
const a = o ? { [o]: t } : t;
|
|
301
301
|
this.state.text !== void 0 && (s.data.text = ""), s.data.focusedIndex = void 0, this.base.filterChanged("", s);
|
|
302
|
-
const
|
|
303
|
-
this.triggerOnChange(
|
|
302
|
+
const p = [...this.value, a];
|
|
303
|
+
this.triggerOnChange(p, s), this.base.togglePopup(s), this.applyState(s);
|
|
304
304
|
}, this.handleWrapperClick = (e) => {
|
|
305
305
|
const t = this._input;
|
|
306
306
|
!this.opened && t && this.focusElement(t);
|
|
@@ -390,12 +390,12 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
390
390
|
/** @hidden */
|
|
391
391
|
componentDidUpdate(n, e) {
|
|
392
392
|
var g;
|
|
393
|
-
const { virtual: t, groupField: o = "" } = this.props, s = I(this.props), a = t ? t.skip : 0,
|
|
394
|
-
if (this.base.didUpdate(), !
|
|
393
|
+
const { virtual: t, groupField: o = "" } = this.props, s = I(this.props), a = 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, d = this.base.getPopupSettings();
|
|
394
|
+
if (this.base.didUpdate(), !d.animate && i && this.onPopupClosed(), t && t.total !== p)
|
|
395
395
|
this.base.vs.calcScrollElementHeight(), this.base.vs.reset();
|
|
396
396
|
else {
|
|
397
|
-
let { focusedItem:
|
|
398
|
-
o !== "" && (
|
|
397
|
+
let { focusedItem: l, focusedIndex: h } = this.getFocusedState();
|
|
398
|
+
o !== "" && (h = (g = this.base.getGroupedDataModernMode(s, o)) == null ? void 0 : g.indexOf(l)), r && t ? this.base.scrollToVirtualItem(t, h - a) : r && !t ? (s && s.length !== 0 && this.base.resetGroupStickyHeader(s[0][o], this), this.base.scrollToItem(h)) : this.opened && c && l && this.scrollToFocused && this.base.scrollToItem(h - a);
|
|
399
399
|
}
|
|
400
400
|
this.scrollToFocused = !1, this.setValidity();
|
|
401
401
|
}
|
|
@@ -411,18 +411,18 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
411
411
|
}
|
|
412
412
|
/** @hidden */
|
|
413
413
|
onNavigate(n, e, t) {
|
|
414
|
-
const { allowCustom: o } = this.props, s = I(this.props), a = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedType:
|
|
414
|
+
const { allowCustom: o } = this.props, s = I(this.props), a = this.props.filter !== void 0 ? this.props.filter : this.state.text, { focusedType: p, focusedIndex: c } = this.getFocusedState(), r = o && a, i = q(p), d = this.base, g = d.vs;
|
|
415
415
|
if (this.opened && e === u.up && i)
|
|
416
416
|
this.state.focusedIndex !== void 0 && (n.data.focusedIndex = void 0);
|
|
417
417
|
else {
|
|
418
|
-
const
|
|
418
|
+
const l = d.navigation.navigate({
|
|
419
419
|
keyCode: e,
|
|
420
420
|
current: c,
|
|
421
421
|
max: (g.enabled ? g.total : s.length) - 1,
|
|
422
|
-
min:
|
|
422
|
+
min: r ? -1 : 0,
|
|
423
423
|
skipItems: t || void 0
|
|
424
424
|
});
|
|
425
|
-
|
|
425
|
+
l !== void 0 && (this.itemFocus(l, n), this.scrollToFocused = !0);
|
|
426
426
|
}
|
|
427
427
|
this.applyState(n);
|
|
428
428
|
}
|
|
@@ -435,25 +435,25 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
435
435
|
dir: o,
|
|
436
436
|
disabled: s,
|
|
437
437
|
textField: a,
|
|
438
|
-
dataItemKey:
|
|
438
|
+
dataItemKey: p,
|
|
439
439
|
virtual: c,
|
|
440
|
-
size:
|
|
440
|
+
size: r,
|
|
441
441
|
rounded: i,
|
|
442
|
-
fillMode:
|
|
442
|
+
fillMode: d,
|
|
443
443
|
loading: g,
|
|
444
|
-
filter:
|
|
445
|
-
} = this.props, { text:
|
|
444
|
+
filter: l
|
|
445
|
+
} = this.props, { text: h, focused: v, focusedTag: S, currentValue: W } = this.state, C = this.base.vs, _ = this.props.id || this._inputId;
|
|
446
446
|
C.enabled = c !== void 0, c !== void 0 && (C.skip = c.skip, C.total = c.total, C.pageSize = c.pageSize);
|
|
447
447
|
const x = this.mobileMode && this.opened ? W : this.tagsToRender;
|
|
448
448
|
this.setItems(this.tagsToRender, this._tags);
|
|
449
|
-
const K = !this.validityStyles || this.validity.valid, G = !!(
|
|
449
|
+
const K = !this.validityStyles || this.validity.valid, G = !!(l !== void 0 ? l : h) || x && x.length > 0, [U, Y] = A(this.props.prefix || f.Fragment), [j, J] = A(this.props.suffix || f.Fragment), N = /* @__PURE__ */ f.createElement(f.Fragment, null, /* @__PURE__ */ f.createElement(
|
|
450
450
|
"div",
|
|
451
451
|
{
|
|
452
452
|
ref: this.componentRef,
|
|
453
453
|
className: y("k-multiselect k-input", e, {
|
|
454
|
-
[`k-input-${D[
|
|
454
|
+
[`k-input-${D[r] || r}`]: r,
|
|
455
455
|
[`k-rounded-${yt[i] || i}`]: i,
|
|
456
|
-
[`k-input-${
|
|
456
|
+
[`k-input-${d}`]: d,
|
|
457
457
|
"k-focus": v && !s,
|
|
458
458
|
"k-invalid": !K,
|
|
459
459
|
"k-disabled": s,
|
|
@@ -473,7 +473,7 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
473
473
|
{
|
|
474
474
|
className: y(
|
|
475
475
|
"k-chip-list",
|
|
476
|
-
{ [`k-chip-list-${D[
|
|
476
|
+
{ [`k-chip-list-${D[r] || r}`]: r }
|
|
477
477
|
),
|
|
478
478
|
role: "listbox",
|
|
479
479
|
id: "tagslist-" + this.base.guid
|
|
@@ -485,8 +485,8 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
485
485
|
onTagDelete: this.onTagDelete,
|
|
486
486
|
data: x,
|
|
487
487
|
guid: this.base.guid,
|
|
488
|
-
focused: S ? x.find((Q) => B(Q, S,
|
|
489
|
-
size:
|
|
488
|
+
focused: S ? x.find((Q) => B(Q, S, p)) : void 0,
|
|
489
|
+
size: r
|
|
490
490
|
}
|
|
491
491
|
)
|
|
492
492
|
), this.renderSearchBar(_)),
|
|
@@ -500,7 +500,7 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
500
500
|
{
|
|
501
501
|
label: t,
|
|
502
502
|
editorId: _,
|
|
503
|
-
editorValue:
|
|
503
|
+
editorValue: h || O(this.value[0], a),
|
|
504
504
|
editorValid: K,
|
|
505
505
|
editorDisabled: s,
|
|
506
506
|
style: { width: n ? n.width : void 0 },
|
|
@@ -509,16 +509,17 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
509
509
|
) : N;
|
|
510
510
|
}
|
|
511
511
|
renderSearchBar(n) {
|
|
512
|
-
const { activedescendant: e, focusedTag: t, currentValue: o } = this.state, { disabled: s, placeholder: a, ariaDescribedBy:
|
|
512
|
+
const { activedescendant: e, focusedTag: t, currentValue: o } = this.state, { disabled: s, placeholder: a, ariaDescribedBy: p, ariaLabelledBy: c, ariaLabel: r } = this.props, i = !this.mobileMode && (this.props.filter !== void 0 ? this.props.filter : this.state.text) || "", { focusedIndex: d } = this.getFocusedState(), g = this.value.length === 0 && !i ? a : void 0, l = o && o.length > 0 ? void 0 : a, h = e === k.TagsList && t !== void 0 ? `tag-${this.base.guid}-${t.text.replace(/\s+/g, "-")}` : `option-${this.base.guid}-${d}`, v = {
|
|
513
|
+
accessKey: this.props.accessKey,
|
|
514
|
+
tabIndex: this.props.tabIndex
|
|
515
|
+
};
|
|
513
516
|
return /* @__PURE__ */ f.createElement(
|
|
514
517
|
rt,
|
|
515
518
|
{
|
|
516
519
|
id: n,
|
|
517
|
-
size: Math.max((
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
placeholder: this.mobileMode && this.opened ? l : i,
|
|
521
|
-
value: c,
|
|
520
|
+
size: Math.max((g || "").length, i.length, 1),
|
|
521
|
+
placeholder: this.mobileMode && this.opened ? l : g,
|
|
522
|
+
value: i,
|
|
522
523
|
onChange: this.onChangeHandler,
|
|
523
524
|
onKeyDown: this.onInputKeyDown,
|
|
524
525
|
ref: this.searchbarRef,
|
|
@@ -526,37 +527,39 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
526
527
|
expanded: this.opened,
|
|
527
528
|
owns: this.base.listBoxId,
|
|
528
529
|
role: "combobox",
|
|
529
|
-
activedescendant:
|
|
530
|
-
ariaDescribedBy: `tagslist-${this.base.guid}${
|
|
531
|
-
ariaLabelledBy:
|
|
532
|
-
ariaRequired: this.required
|
|
530
|
+
activedescendant: h,
|
|
531
|
+
ariaDescribedBy: `tagslist-${this.base.guid}${p ? " " + p : ""}`,
|
|
532
|
+
ariaLabelledBy: c,
|
|
533
|
+
ariaRequired: this.required,
|
|
534
|
+
ariaLabel: r,
|
|
535
|
+
...v
|
|
533
536
|
}
|
|
534
537
|
);
|
|
535
538
|
}
|
|
536
539
|
onTagsNavigate(n, e) {
|
|
537
540
|
const t = n.keyCode, { focusedTag: o } = this.state, s = this._tags, a = this.props.dataItemKey;
|
|
538
|
-
let
|
|
539
|
-
const
|
|
541
|
+
let p = o ? s.findIndex((i) => B(i, o, a)) : -1, c;
|
|
542
|
+
const r = p !== -1;
|
|
540
543
|
if (t === u.left)
|
|
541
|
-
|
|
544
|
+
r ? p = Math.max(0, p - 1) : p = s.length - 1, c = s[p];
|
|
542
545
|
else if (t === u.right)
|
|
543
|
-
|
|
546
|
+
p === s.length - 1 ? c = void 0 : r && (p = Math.min(s.length - 1, p + 1), c = s[p]);
|
|
544
547
|
else if (t === u.home && !n.shiftKey)
|
|
545
548
|
c = s[0];
|
|
546
549
|
else if (t === u.end && !n.shiftKey)
|
|
547
550
|
c = s[s.length - 1];
|
|
548
551
|
else if (t === u.delete) {
|
|
549
|
-
if (
|
|
552
|
+
if (r) {
|
|
550
553
|
const i = this.value;
|
|
551
|
-
w(i, s[
|
|
554
|
+
w(i, s[p].data, a), this.triggerOnChange(i, e);
|
|
552
555
|
}
|
|
553
556
|
} else if (t === u.backspace) {
|
|
554
557
|
const i = this.value;
|
|
555
|
-
if (
|
|
556
|
-
w(i, s[
|
|
557
|
-
else if (!
|
|
558
|
-
const
|
|
559
|
-
w(i,
|
|
558
|
+
if (r)
|
|
559
|
+
w(i, s[p].data, a), this.triggerOnChange(i, e);
|
|
560
|
+
else if (!r && s.length) {
|
|
561
|
+
const d = s.pop();
|
|
562
|
+
w(i, d.data, a), this.triggerOnChange(i, e);
|
|
560
563
|
}
|
|
561
564
|
}
|
|
562
565
|
c !== o && (e.data.focusedTag = c, e.data.activedescendant = k.TagsList), this.applyState(e);
|
|
@@ -572,12 +575,12 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
572
575
|
e.length = 0, e.push(...n);
|
|
573
576
|
}
|
|
574
577
|
getFocusedState() {
|
|
575
|
-
const { focusedIndex: n } = this.state, e = this.props.filter !== void 0 ? this.props.filter : this.state.text, { allowCustom: t, dataItemKey: o, virtual: s, textField: a, focusedItemIndex:
|
|
576
|
-
let
|
|
578
|
+
const { focusedIndex: n } = this.state, e = this.props.filter !== void 0 ? this.props.filter : this.state.text, { allowCustom: t, dataItemKey: o, virtual: s, textField: a, focusedItemIndex: p = pt, skipDisabledItems: c } = this.props, r = I(this.props), i = s && s.skip || 0;
|
|
579
|
+
let d;
|
|
577
580
|
if (n !== void 0)
|
|
578
581
|
return {
|
|
579
582
|
focusedIndex: n,
|
|
580
|
-
focusedItem:
|
|
583
|
+
focusedItem: r[n - i],
|
|
581
584
|
focusedType: 1
|
|
582
585
|
/* ListItem */
|
|
583
586
|
};
|
|
@@ -590,31 +593,31 @@ const { sizeMap: D, roundedMap: yt } = st, bt = "Please enter a valid value!", $
|
|
|
590
593
|
/* CustomItem */
|
|
591
594
|
};
|
|
592
595
|
if (e)
|
|
593
|
-
return
|
|
594
|
-
focusedItem: d
|
|
595
|
-
focusedIndex:
|
|
596
|
+
return d = p(r, e, a), {
|
|
597
|
+
focusedItem: r[d],
|
|
598
|
+
focusedIndex: d + i,
|
|
596
599
|
focusedType: 1
|
|
597
600
|
/* ListItem */
|
|
598
601
|
};
|
|
599
602
|
if (g.length) {
|
|
600
|
-
const
|
|
601
|
-
return
|
|
602
|
-
focusedIndex:
|
|
603
|
-
focusedItem: d
|
|
603
|
+
const l = g[g.length - 1];
|
|
604
|
+
return d = r.findIndex((h) => E(h, l, o)), r[d] !== void 0 ? {
|
|
605
|
+
focusedIndex: d + i,
|
|
606
|
+
focusedItem: r[d],
|
|
604
607
|
focusedType: 1
|
|
605
608
|
/* ListItem */
|
|
606
609
|
} : { focusedType: 0, focusedIndex: -1 };
|
|
607
610
|
} else if (c && a && !e && i === 0) {
|
|
608
|
-
const
|
|
611
|
+
const l = r.findIndex((h) => !h.disabled && h[a]);
|
|
609
612
|
return {
|
|
610
|
-
focusedIndex:
|
|
611
|
-
focusedItem:
|
|
613
|
+
focusedIndex: l,
|
|
614
|
+
focusedItem: r[l - i],
|
|
612
615
|
focusedType: 1
|
|
613
616
|
/* ListItem */
|
|
614
617
|
};
|
|
615
618
|
}
|
|
616
619
|
return i === 0 ? {
|
|
617
|
-
focusedItem:
|
|
620
|
+
focusedItem: r[0],
|
|
618
621
|
focusedIndex: 0,
|
|
619
622
|
focusedType: 1
|
|
620
623
|
/* ListItem */
|
package/common/SearchBar.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";const u=require("@progress/kendo-react-common"),h=require("react");function b(
|
|
8
|
+
"use client";"use strict";const u=require("@progress/kendo-react-common"),h=require("react");function b(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const l=b(h);class g extends l.Component{constructor(){super(...arguments),this._input=null}get input(){return this._input}componentDidUpdate(t){const e=t.value,s=t.suggestedText,{value:r,suggestedText:a,focused:p}=this.props,i=this.input,o=e!==r||a!==s,c=o&&e.startsWith(r)&&!(s&&a&&s.endsWith(a)),d=u.getActiveElement(document);p&&i&&d!==i&&i.focus(),a&&o&&!c&&i&&i.setSelectionRange(r.length-a.length,r.length)}render(){const{expanded:t=!1,disabled:e,role:s="listbox",render:r,tabIndex:a,accessKey:p}=this.props,i={tabIndex:a,accessKey:p},o=l.createElement("input",{autoComplete:"off",id:this.props.id,type:"text",key:"searchbar",size:this.props.size,placeholder:this.props.placeholder,className:"k-input-inner",role:s,name:this.props.name,value:this.props.value,onChange:this.props.onChange,ref:c=>this._input=c,onKeyDown:this.props.onKeyDown,onFocus:this.props.onFocus,onBlur:this.props.onBlur,onClick:this.props.onClick,"aria-disabled":e||void 0,disabled:e||void 0,readOnly:this.props.readOnly||void 0,title:this.props.title,"aria-haspopup":"listbox","aria-expanded":t,"aria-owns":this.props.owns,"aria-activedescendant":t?this.props.activedescendant:void 0,"aria-describedby":this.props.ariaDescribedBy,"aria-labelledby":this.props.ariaLabelledBy,"aria-label":this.props.ariaLabel,"aria-required":this.props.ariaRequired,"aria-controls":this.props.ariaControls,...i});return r?r.call(void 0,o):o}}module.exports=g;
|
package/common/SearchBar.mjs
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import { getActiveElement as c } from "@progress/kendo-react-common";
|
|
10
|
-
import * as
|
|
11
|
-
class
|
|
10
|
+
import * as l from "react";
|
|
11
|
+
class g extends l.Component {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments), this._input = null;
|
|
14
14
|
}
|
|
@@ -18,12 +18,15 @@ class b extends p.Component {
|
|
|
18
18
|
get input() {
|
|
19
19
|
return this._input;
|
|
20
20
|
}
|
|
21
|
-
componentDidUpdate(
|
|
22
|
-
const
|
|
23
|
-
|
|
21
|
+
componentDidUpdate(i) {
|
|
22
|
+
const a = i.value, r = i.suggestedText, { value: e, suggestedText: t, focused: n } = this.props, s = this.input, o = a !== e || t !== r, p = o && a.startsWith(e) && !(r && t && r.endsWith(t)), d = c(document);
|
|
23
|
+
n && s && d !== s && s.focus(), t && o && !p && s && s.setSelectionRange(e.length - t.length, e.length);
|
|
24
24
|
}
|
|
25
25
|
render() {
|
|
26
|
-
const { expanded:
|
|
26
|
+
const { expanded: i = !1, disabled: a, role: r = "listbox", render: e, tabIndex: t, accessKey: n } = this.props, s = {
|
|
27
|
+
tabIndex: t,
|
|
28
|
+
accessKey: n
|
|
29
|
+
}, o = /* @__PURE__ */ l.createElement(
|
|
27
30
|
"input",
|
|
28
31
|
{
|
|
29
32
|
autoComplete: "off",
|
|
@@ -33,34 +36,34 @@ class b extends p.Component {
|
|
|
33
36
|
size: this.props.size,
|
|
34
37
|
placeholder: this.props.placeholder,
|
|
35
38
|
className: "k-input-inner",
|
|
36
|
-
|
|
37
|
-
accessKey: this.props.accessKey,
|
|
38
|
-
role: a,
|
|
39
|
+
role: r,
|
|
39
40
|
name: this.props.name,
|
|
40
41
|
value: this.props.value,
|
|
41
42
|
onChange: this.props.onChange,
|
|
42
|
-
ref: (
|
|
43
|
+
ref: (p) => this._input = p,
|
|
43
44
|
onKeyDown: this.props.onKeyDown,
|
|
44
45
|
onFocus: this.props.onFocus,
|
|
45
46
|
onBlur: this.props.onBlur,
|
|
46
47
|
onClick: this.props.onClick,
|
|
47
|
-
"aria-disabled":
|
|
48
|
-
disabled:
|
|
48
|
+
"aria-disabled": a || void 0,
|
|
49
|
+
disabled: a || void 0,
|
|
49
50
|
readOnly: this.props.readOnly || void 0,
|
|
50
51
|
title: this.props.title,
|
|
51
52
|
"aria-haspopup": "listbox",
|
|
52
|
-
"aria-expanded":
|
|
53
|
+
"aria-expanded": i,
|
|
53
54
|
"aria-owns": this.props.owns,
|
|
54
|
-
"aria-activedescendant":
|
|
55
|
+
"aria-activedescendant": i ? this.props.activedescendant : void 0,
|
|
55
56
|
"aria-describedby": this.props.ariaDescribedBy,
|
|
56
57
|
"aria-labelledby": this.props.ariaLabelledBy,
|
|
57
58
|
"aria-label": this.props.ariaLabel,
|
|
58
|
-
"aria-required": this.props.ariaRequired
|
|
59
|
+
"aria-required": this.props.ariaRequired,
|
|
60
|
+
"aria-controls": this.props.ariaControls,
|
|
61
|
+
...s
|
|
59
62
|
}
|
|
60
63
|
);
|
|
61
|
-
return
|
|
64
|
+
return e ? e.call(void 0, o) : o;
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
export {
|
|
65
|
-
|
|
68
|
+
g as default
|
|
66
69
|
};
|