@progress/kendo-react-dropdowns 8.2.0-develop.3 → 8.2.0-develop.31
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 +114 -112
- package/MultiColumnComboBox/MultiColumnComboBox.js +1 -1
- package/MultiColumnComboBox/MultiColumnComboBox.mjs +79 -85
- package/common/SearchBar.js +1 -1
- package/common/SearchBar.mjs +6 -5
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +6 -0
- package/index.d.ts +6 -0
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
|
@@ -8,29 +8,28 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as e from "react";
|
|
10
10
|
import se from "prop-types";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
const t = ce(ke, u), C = e.useRef(null), a = e.useRef(null), x = pe(), {
|
|
11
|
+
import { MultiColumnList as ue } from "../common/MultiColumnList.mjs";
|
|
12
|
+
import { createPropsContext as ie, usePropsContext as de, getScrollbarWidth as ce, getter as T, classNames as x, setScrollbarWidth as pe } from "@progress/kendo-react-common";
|
|
13
|
+
import { ComboBox as me, ComboBoxWithoutContext as fe } from "../ComboBox/ComboBox.mjs";
|
|
14
|
+
import { getItemValue as ge } from "../common/utils.mjs";
|
|
15
|
+
import W from "../common/withCustomComponent.mjs";
|
|
16
|
+
const he = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, Ce = ie(), P = e.forwardRef((u, h) => {
|
|
17
|
+
const t = de(Ce, u), C = e.useRef(null), a = e.useRef(null), y = ce(), {
|
|
19
18
|
columns: n = s.columns,
|
|
20
19
|
popupSettings: p = s.popupSettings,
|
|
21
20
|
size: z = s.size,
|
|
22
21
|
rounded: O = s.rounded,
|
|
23
|
-
fillMode:
|
|
24
|
-
className:
|
|
22
|
+
fillMode: L = s.fillMode,
|
|
23
|
+
className: $,
|
|
25
24
|
prefix: j = void 0,
|
|
26
25
|
suffix: V = void 0,
|
|
27
|
-
onOpen:
|
|
28
|
-
onClose:
|
|
29
|
-
onFocus:
|
|
30
|
-
onBlur:
|
|
31
|
-
onChange:
|
|
32
|
-
onFilterChange:
|
|
33
|
-
onPageChange:
|
|
26
|
+
onOpen: w,
|
|
27
|
+
onClose: E,
|
|
28
|
+
onFocus: F,
|
|
29
|
+
onBlur: H,
|
|
30
|
+
onChange: N,
|
|
31
|
+
onFilterChange: S,
|
|
32
|
+
onPageChange: M,
|
|
34
33
|
...A
|
|
35
34
|
} = t;
|
|
36
35
|
e.useImperativeHandle(C, () => ({
|
|
@@ -49,10 +48,10 @@ const Ce = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, ke = de(), W =
|
|
|
49
48
|
const c = e.useMemo(
|
|
50
49
|
() => {
|
|
51
50
|
if (t.groupField !== void 0 && t.data)
|
|
52
|
-
return
|
|
51
|
+
return ge(t.data[0], t.groupField);
|
|
53
52
|
},
|
|
54
53
|
[t.data, t.groupField]
|
|
55
|
-
), [k, m] = e.useState(c), [
|
|
54
|
+
), [k, m] = e.useState(c), [R, B] = e.useState(!0), [D] = j ? W(t.prefix || e.Fragment) : [], [J] = V ? W(t.suffix || e.Fragment) : [], Q = e.useMemo(
|
|
56
55
|
() => {
|
|
57
56
|
const r = /* @__PURE__ */ e.createElement("th", { className: "k-table-th", colSpan: n.length }, k);
|
|
58
57
|
return /* @__PURE__ */ e.createElement(e.Fragment, null, t.header, /* @__PURE__ */ e.createElement("div", { className: "k-table-header-wrap" }, /* @__PURE__ */ e.createElement("table", { className: "k-table", role: "presentation" }, /* @__PURE__ */ e.createElement("colgroup", null, n.map(
|
|
@@ -63,16 +62,16 @@ const Ce = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, ke = de(), W =
|
|
|
63
62
|
style: { width: o.width ? o.width : s.width }
|
|
64
63
|
}
|
|
65
64
|
)
|
|
66
|
-
)), /* @__PURE__ */ e.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ e.createElement("tr", { className: "k-table-row" }, n.map((o, i) => /* @__PURE__ */ e.createElement("th", { className: "k-table-th", key: o.uniqueKey ? o.uniqueKey : i }, o.header || " "))), k &&
|
|
65
|
+
)), /* @__PURE__ */ e.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ e.createElement("tr", { className: "k-table-row" }, n.map((o, i) => /* @__PURE__ */ e.createElement("th", { className: "k-table-th", key: o.uniqueKey ? o.uniqueKey : i }, o.header || " "))), k && R && /* @__PURE__ */ e.createElement("tr", { className: "k-table-group-row" }, t.groupStickyHeaderItemRender ? t.groupStickyHeaderItemRender.call(void 0, r, {}) : r)))));
|
|
67
66
|
},
|
|
68
|
-
[t.header, n, k,
|
|
67
|
+
[t.header, n, k, R]
|
|
69
68
|
), U = e.useMemo(
|
|
70
69
|
() => (
|
|
71
70
|
// These additional 4px are coming from the child elements side borders (fixes horizontal scrollbar)
|
|
72
|
-
`calc(${n.map((r) =>
|
|
71
|
+
`calc(${n.map((r) => he(r.width, s.width)).filter(Boolean).join(" + ")} + ${y}px + 4px)`
|
|
73
72
|
),
|
|
74
|
-
[n,
|
|
75
|
-
),
|
|
73
|
+
[n, y]
|
|
74
|
+
), q = t.virtual ? t.virtual.skip : 0, X = e.useCallback(
|
|
76
75
|
(r, o) => {
|
|
77
76
|
const i = n.map((d, le) => /* @__PURE__ */ e.createElement(
|
|
78
77
|
"span",
|
|
@@ -81,14 +80,14 @@ const Ce = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, ke = de(), W =
|
|
|
81
80
|
style: t.itemRender ? void 0 : { width: d.width ? d.width : s.width },
|
|
82
81
|
key: d.uniqueKey ? d.uniqueKey : le
|
|
83
82
|
},
|
|
84
|
-
d.field ? String(
|
|
83
|
+
d.field ? String(T(d.field)(o.dataItem)) : ""
|
|
85
84
|
));
|
|
86
|
-
let f, g, b, v,
|
|
87
|
-
const
|
|
88
|
-
t.groupField !== void 0 && (v =
|
|
89
|
-
const
|
|
85
|
+
let f, g, b, v, I = t.data || [];
|
|
86
|
+
const K = o.index - q;
|
|
87
|
+
t.groupField !== void 0 && (v = T(t.groupField), g = v(I[K]), b = v(I[K - 1]), g && b && g !== b && (f = g)), f && t.groupMode === "classic" && i.push(/* @__PURE__ */ e.createElement("div", { key: "group", className: "k-table-td k-table-group-td" }, /* @__PURE__ */ e.createElement("span", null, f)));
|
|
88
|
+
const G = e.cloneElement(r, {
|
|
90
89
|
...r.props,
|
|
91
|
-
className:
|
|
90
|
+
className: x("k-table-row", {
|
|
92
91
|
"k-table-alt-row": o.index % 2 !== 0,
|
|
93
92
|
"k-focus": o.focused,
|
|
94
93
|
"k-selected": o.selected,
|
|
@@ -96,9 +95,9 @@ const Ce = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, ke = de(), W =
|
|
|
96
95
|
"k-disabled": o.dataItem.disabled
|
|
97
96
|
})
|
|
98
97
|
}, i);
|
|
99
|
-
return t.itemRender ? t.itemRender.call(void 0,
|
|
98
|
+
return t.itemRender ? t.itemRender.call(void 0, G, o) : G;
|
|
100
99
|
},
|
|
101
|
-
[n, t.groupField, t.itemRender, t.data,
|
|
100
|
+
[n, t.groupField, t.itemRender, t.data, q]
|
|
102
101
|
), l = e.useCallback(
|
|
103
102
|
(r, o) => {
|
|
104
103
|
r && r.call(void 0, {
|
|
@@ -107,69 +106,64 @@ const Ce = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, ke = de(), W =
|
|
|
107
106
|
});
|
|
108
107
|
},
|
|
109
108
|
[]
|
|
110
|
-
), Y = e.useCallback((r) => (t.virtual || m(c), l(
|
|
109
|
+
), Y = e.useCallback((r) => (t.virtual || m(c), l(w, r)), [l, w, t.virtual, c]), Z = e.useCallback((r) => l(E, r), [E]), _ = e.useCallback((r) => l(F, r), [F]), ee = e.useCallback((r) => l(H, r), [H]), te = e.useCallback((r) => l(N, r), [N]), re = e.useCallback((r) => l(M, r), [M]), oe = e.useCallback((r) => (m(c), l(S, {
|
|
111
110
|
...r,
|
|
112
111
|
mobileMode: r.target.mobileMode
|
|
113
|
-
})), [
|
|
112
|
+
})), [S]), ae = e.useCallback(
|
|
114
113
|
(r) => {
|
|
115
114
|
m(r.group);
|
|
116
115
|
},
|
|
117
116
|
[]
|
|
118
117
|
);
|
|
119
118
|
e.useEffect(() => {
|
|
120
|
-
|
|
119
|
+
pe();
|
|
121
120
|
}), e.useEffect(() => {
|
|
122
121
|
const r = t.data;
|
|
123
|
-
m(c), r && r.length !== 0 ?
|
|
122
|
+
m(c), r && r.length !== 0 ? B(!0) : B(!1);
|
|
124
123
|
}, [t.data]);
|
|
125
|
-
const ne = e.useCallback((r) => /* @__PURE__ */ e.createElement(
|
|
124
|
+
const ne = e.useCallback((r) => /* @__PURE__ */ e.createElement(ue, { ...r }), []);
|
|
126
125
|
return /* @__PURE__ */ e.createElement(
|
|
127
|
-
|
|
126
|
+
me,
|
|
128
127
|
{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
footerClassName: "k-table-footer",
|
|
166
|
-
prefix: D,
|
|
167
|
-
suffix: J
|
|
168
|
-
}
|
|
169
|
-
)
|
|
128
|
+
...A,
|
|
129
|
+
list: ne,
|
|
130
|
+
popupSettings: {
|
|
131
|
+
...p,
|
|
132
|
+
popupClass: x("k-dropdowngrid-popup", p.popupClass),
|
|
133
|
+
width: p.width || U,
|
|
134
|
+
className: p.className
|
|
135
|
+
},
|
|
136
|
+
ref: a,
|
|
137
|
+
header: Q,
|
|
138
|
+
itemRender: X,
|
|
139
|
+
groupHeaderItemRender: t.groupHeaderItemRender,
|
|
140
|
+
size: z,
|
|
141
|
+
rounded: O,
|
|
142
|
+
fillMode: L,
|
|
143
|
+
groupMode: t.groupMode,
|
|
144
|
+
groupField: t.groupField,
|
|
145
|
+
isMultiColumn: !0,
|
|
146
|
+
onOpen: Y,
|
|
147
|
+
onClose: Z,
|
|
148
|
+
onFocus: _,
|
|
149
|
+
onBlur: ee,
|
|
150
|
+
onChange: te,
|
|
151
|
+
onFilterChange: oe,
|
|
152
|
+
onPageChange: re,
|
|
153
|
+
onGroupScroll: ae,
|
|
154
|
+
className: x("k-dropdowngrid", $),
|
|
155
|
+
required: t.required,
|
|
156
|
+
adaptive: t.adaptive,
|
|
157
|
+
adaptiveFilter: t.adaptiveFilter,
|
|
158
|
+
adaptiveTitle: t.adaptiveTitle,
|
|
159
|
+
footer: t.footer,
|
|
160
|
+
footerClassName: "k-table-footer",
|
|
161
|
+
prefix: D,
|
|
162
|
+
suffix: J
|
|
163
|
+
}
|
|
170
164
|
);
|
|
171
|
-
}),
|
|
172
|
-
...
|
|
165
|
+
}), ke = {
|
|
166
|
+
...fe.propTypes,
|
|
173
167
|
columns: se.any.isRequired
|
|
174
168
|
}, s = {
|
|
175
169
|
columns: [],
|
|
@@ -179,9 +173,9 @@ const Ce = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, ke = de(), W =
|
|
|
179
173
|
rounded: "medium",
|
|
180
174
|
fillMode: "solid"
|
|
181
175
|
};
|
|
182
|
-
|
|
183
|
-
|
|
176
|
+
P.displayName = "KendoMultiColumnComboBox";
|
|
177
|
+
P.propTypes = ke;
|
|
184
178
|
export {
|
|
185
|
-
|
|
186
|
-
|
|
179
|
+
P as MultiColumnComboBox,
|
|
180
|
+
Ce as MultiColumnComboBoxPropsContext
|
|
187
181
|
};
|
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
|
|
8
|
+
"use client";"use strict";const u=require("@progress/kendo-react-common"),h=require("react");function b(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const c=b(h);class g extends c.Component{constructor(){super(...arguments),this._input=null}get input(){return this._input}componentDidUpdate(t){const e=t.value,s=t.suggestedText,{value:n,suggestedText:i,focused:o}=this.props,r=this.input,p=e!==n||i!==s,l=p&&e.startsWith(n)&&!(s&&i&&s.endsWith(i)),d=u.getActiveElement(document);o&&r&&d!==r&&r.focus(),i&&p&&!l&&r&&r.setSelectionRange(n.length-i.length,n.length)}render(){const{expanded:t=!1,disabled:e,role:s="listbox",render:n}=this.props,i=c.createElement("input",{autoComplete:"off",id:this.props.id,type:"text",key:"searchbar",size:this.props.size,placeholder:this.props.placeholder,className:"k-input-inner",tabIndex:this.props.tabIndex,accessKey:this.props.accessKey,role:s,name:this.props.name,value:this.props.value,onChange:this.props.onChange,ref:o=>this._input=o,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});return n?n.call(void 0,i):i}}module.exports=g;
|
package/common/SearchBar.mjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import { getActiveElement as c } from "@progress/kendo-react-common";
|
|
10
10
|
import * as p from "react";
|
|
11
|
-
class
|
|
11
|
+
class b extends p.Component {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments), this._input = null;
|
|
14
14
|
}
|
|
@@ -19,8 +19,8 @@ class g extends p.Component {
|
|
|
19
19
|
return this._input;
|
|
20
20
|
}
|
|
21
21
|
componentDidUpdate(t) {
|
|
22
|
-
const i = t.value, a = t.suggestedText, { value: s, suggestedText: e, focused:
|
|
23
|
-
|
|
22
|
+
const i = t.value, a = t.suggestedText, { value: s, suggestedText: e, focused: r } = this.props, o = this.input, n = i !== s || e !== a, l = n && i.startsWith(s) && !(a && e && a.endsWith(e)), d = c(document);
|
|
23
|
+
r && o && d !== o && o.focus(), e && n && !l && o && o.setSelectionRange(s.length - e.length, s.length);
|
|
24
24
|
}
|
|
25
25
|
render() {
|
|
26
26
|
const { expanded: t = !1, disabled: i, role: a = "listbox", render: s } = this.props, e = /* @__PURE__ */ p.createElement(
|
|
@@ -39,7 +39,7 @@ class g extends p.Component {
|
|
|
39
39
|
name: this.props.name,
|
|
40
40
|
value: this.props.value,
|
|
41
41
|
onChange: this.props.onChange,
|
|
42
|
-
ref: (
|
|
42
|
+
ref: (r) => this._input = r,
|
|
43
43
|
onKeyDown: this.props.onKeyDown,
|
|
44
44
|
onFocus: this.props.onFocus,
|
|
45
45
|
onBlur: this.props.onBlur,
|
|
@@ -54,6 +54,7 @@ class g extends p.Component {
|
|
|
54
54
|
"aria-activedescendant": t ? this.props.activedescendant : void 0,
|
|
55
55
|
"aria-describedby": this.props.ariaDescribedBy,
|
|
56
56
|
"aria-labelledby": this.props.ariaLabelledBy,
|
|
57
|
+
"aria-label": this.props.ariaLabel,
|
|
57
58
|
"aria-required": this.props.ariaRequired
|
|
58
59
|
}
|
|
59
60
|
);
|
|
@@ -61,5 +62,5 @@ class g extends p.Component {
|
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
export {
|
|
64
|
-
|
|
65
|
+
b as default
|
|
65
66
|
};
|