@progress/kendo-react-dropdowns 15.0.1-develop.2 → 15.0.1-develop.4
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/AutoCompleteMcpWrapper.d.ts +3 -1
- package/ComboBoxMcpWrapper.d.ts +3 -1
- package/MultiColumnComboBox/MultiColumnComboBox.js +1 -1
- package/MultiColumnComboBox/MultiColumnComboBox.mjs +64 -59
- package/MultiSelectMcpWrapper.d.ts +3 -1
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +7 -10
- package/index.d.ts +7 -10
- package/index.js +1 -1
- package/index.mjs +50 -51
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { AutoCompleteHandle } from './AutoComplete/AutoComplete.js';
|
|
8
|
+
import { AutoComplete as AutoCompleteOriginal, AutoCompleteHandle } from './AutoComplete/AutoComplete.js';
|
|
9
9
|
import { AutoCompleteProps } from './AutoComplete/AutoCompleteProps';
|
|
10
10
|
/**
|
|
11
11
|
* AutoComplete wrapper that integrates the Web MCP hook.
|
|
@@ -15,3 +15,5 @@ import { AutoCompleteProps } from './AutoComplete/AutoCompleteProps';
|
|
|
15
15
|
import * as React from 'react';
|
|
16
16
|
/** @hidden */
|
|
17
17
|
export declare const AutoCompleteWrapper: React.ForwardRefExoticComponent<AutoCompleteProps & React.RefAttributes<AutoCompleteHandle>>;
|
|
18
|
+
/** @hidden */
|
|
19
|
+
export type AutoCompleteWrapper = AutoCompleteOriginal;
|
package/ComboBoxMcpWrapper.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { ComboBoxHandle } from './ComboBox/ComboBox.js';
|
|
8
|
+
import { ComboBox as ComboBoxOriginal, ComboBoxHandle } from './ComboBox/ComboBox.js';
|
|
9
9
|
import { ComboBoxProps } from './ComboBox/ComboBoxProps';
|
|
10
10
|
/**
|
|
11
11
|
* ComboBox wrapper that integrates the Web MCP hook.
|
|
@@ -15,3 +15,5 @@ import { ComboBoxProps } from './ComboBox/ComboBoxProps';
|
|
|
15
15
|
import * as React from 'react';
|
|
16
16
|
/** @hidden */
|
|
17
17
|
export declare const ComboBoxWrapper: React.ForwardRefExoticComponent<ComboBoxProps & React.RefAttributes<ComboBoxHandle>>;
|
|
18
|
+
/** @hidden */
|
|
19
|
+
export type ComboBoxWrapper = ComboBoxOriginal;
|
|
@@ -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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ie=require("react"),ce=require("prop-types"),de=require("../common/MultiColumnList.js"),l=require("@progress/kendo-react-common"),pe=require("../ComboBox/ComboBox.js"),me=require("../common/utils.js"),W=require("../common/withCustomComponent.js");function fe(n){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const c=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(i,e,c.get?c:{enumerable:!0,get:()=>n[e]})}}return i.default=n,Object.freeze(i)}const t=fe(ie),ge=(n,i)=>n?typeof n=="number"?n+"px":n:i,j=l.createPropsContext(),y=t.forwardRef((n,i)=>{const e=l.usePropsContext(j,n),c=t.useRef(null),p=t.useRef(null),S=l.getScrollbarWidth(),{columns:s=u.columns,popupSettings:g=u.popupSettings,size:G=u.size,rounded:L=u.rounded,fillMode:z=u.fillMode,className:_,prefix:D=void 0,suffix:$=void 0,onOpen:w,onClose:R,onFocus:M,onBlur:F,onChange:H,onFilterChange:N,onPageChange:E,...V}=e;t.useImperativeHandle(c,()=>{var o;return{element:((o=p.current)==null?void 0:o.element)||null,focus(){p.current&&p.current.focus()},get value(){var r;return(r=p.current)==null?void 0:r.value},get name(){var r;return(r=p.current)==null?void 0:r.name},props:e}}),l.useWebMcpRegister("multicolumncombobox",c,e,e.webMcp),t.useImperativeHandle(i,()=>c.current);const d=t.useMemo(()=>{if(e.groupField!==void 0&&e.data)return me.getItemValue(e.data[0],e.groupField)},[e.data,e.groupField]),[h,b]=t.useState(d),[q,B]=t.useState(!0),k=t.useRef(null),[A]=D?W(e.prefix||t.Fragment):[],[J]=$?W(e.suffix||t.Fragment):[],Q=t.useMemo(()=>{const o=t.createElement("th",{className:"k-table-th",colSpan:s.length},h);return t.createElement(t.Fragment,null,e.header,t.createElement("div",{ref:k,className:"k-table-header-wrap"},t.createElement("table",{className:"k-table",role:"presentation"},t.createElement("colgroup",null,s.map((r,f)=>t.createElement("col",{key:r.uniqueKey?r.uniqueKey:f,style:{width:r.width?r.width:u.width}}))),t.createElement("thead",{className:"k-table-thead"},t.createElement("tr",{className:"k-table-row"},s.map((r,f)=>t.createElement("th",{className:"k-table-th",key:r.uniqueKey?r.uniqueKey:f},r.header||" "))),h&&q&&t.createElement("tr",{className:"k-table-group-row"},e.groupStickyHeaderItemRender?e.groupStickyHeaderItemRender.call(void 0,o,{}):o)))))},[e.header,s,h,q,e.groupStickyHeaderItemRender]),U=t.useMemo(()=>`calc(${s.map(o=>ge(o.width,u.width)).filter(Boolean).join(" + ")} + ${S}px + 4px)`,[s,S]),I=e.virtual?e.virtual.skip:0,X=t.useCallback((o,r)=>{const f=s.map((m,ue)=>t.createElement("span",{className:e.itemRender?void 0:"k-table-td",style:e.itemRender?void 0:{width:m.width?m.width:u.width},key:m.uniqueKey?m.uniqueKey:ue},m.field?String(l.getter(m.field)(r.dataItem)):""));let O,C,v,x;const P=e.data||[],K=r.index-I;e.groupField!==void 0&&(x=l.getter(e.groupField),C=x(P[K]),v=x(P[K-1]),C&&v&&C!==v&&(O=C));const T=t.cloneElement(o,{...o.props,className:l.classNames("k-table-row",{"k-table-alt-row":r.index%2!==0,"k-focus":r.focused,"k-selected":r.selected,"k-first":!!O,"k-disabled":r.dataItem.disabled})},f);return e.itemRender?e.itemRender.call(void 0,T,r):T},[s,e.groupField,e.itemRender,e.data,I]),a=t.useCallback((o,r)=>{o&&o.call(void 0,{...r,target:c.current})},[]),Y=t.useCallback(o=>(e.virtual||b(d),a(w,o)),[a,w,e.virtual,d]),Z=t.useCallback(o=>a(R,o),[a,R]),ee=t.useCallback(o=>a(M,o),[a,M]),te=t.useCallback(o=>a(F,o),[a,F]),oe=t.useCallback(o=>a(H,o),[a,H]),re=t.useCallback(o=>a(E,o),[a,E]),ae=t.useCallback(o=>(b(d),a(N,{...o,mobileMode:o.target.mobileMode})),[a,d,N]),ne=t.useCallback(o=>{b(o.group)},[]),le=t.useCallback(o=>{k.current&&(k.current.scrollLeft=o.target.scrollLeft)},[]);t.useEffect(()=>{l.setScrollbarWidth()}),t.useEffect(()=>{const o=e.data;b(d),o&&o.length!==0?B(!0):B(!1)},[e.data,d]);const se=t.useCallback(o=>t.createElement(de.MultiColumnList,{...o}),[]);return t.createElement(pe.ComboBox,{...V,list:se,popupSettings:{...g,popupClass:l.classNames("k-dropdowngrid-popup",g.popupClass),width:g.width||U,className:g.className},ref:p,header:Q,itemRender:X,groupHeaderItemRender:e.groupHeaderItemRender,size:G,rounded:L,fillMode:z,groupField:e.groupField,isMultiColumn:!0,onOpen:Y,onClose:Z,onFocus:ee,onBlur:te,onChange:oe,onFilterChange:ae,onPageChange:re,onGroupScroll:ne,onListScroll:le,className:l.classNames("k-dropdowngrid",_),required:e.required,adaptive:e.adaptive,adaptiveFilter:e.adaptiveFilter,adaptiveTitle:e.adaptiveTitle,adaptiveSubtitle:e.adaptiveSubtitle,footer:e.footer,footerClassName:"k-table-footer",prefix:A,suffix:J})}),be={columns:ce.any.isRequired},u={columns:[],popupSettings:{},width:"200px",size:void 0,rounded:void 0,fillMode:void 0};y.displayName="KendoMultiColumnComboBox";y.propTypes=be;exports.MultiColumnComboBox=y;exports.MultiColumnComboBoxPropsContext=j;
|
|
@@ -8,83 +8,83 @@
|
|
|
8
8
|
import * as e from "react";
|
|
9
9
|
import ue from "prop-types";
|
|
10
10
|
import { MultiColumnList as de } from "../common/MultiColumnList.mjs";
|
|
11
|
-
import { usePropsContext as ce, getScrollbarWidth as pe, getter as
|
|
12
|
-
import { ComboBox as
|
|
13
|
-
import { getItemValue as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
16
|
-
(
|
|
17
|
-
const t = ce(ke,
|
|
18
|
-
columns:
|
|
19
|
-
popupSettings:
|
|
11
|
+
import { usePropsContext as ce, getScrollbarWidth as pe, useWebMcpRegister as me, getter as L, classNames as x, setScrollbarWidth as fe, createPropsContext as ge } from "@progress/kendo-react-common";
|
|
12
|
+
import { ComboBox as be } from "../ComboBox/ComboBox.mjs";
|
|
13
|
+
import { getItemValue as he } from "../common/utils.mjs";
|
|
14
|
+
import T from "../common/withCustomComponent.mjs";
|
|
15
|
+
const Ce = (i, b) => i ? typeof i == "number" ? i + "px" : i : b, ke = ge(), P = e.forwardRef(
|
|
16
|
+
(i, b) => {
|
|
17
|
+
const t = ce(ke, i), p = e.useRef(null), u = e.useRef(null), w = pe(), {
|
|
18
|
+
columns: n = l.columns,
|
|
19
|
+
popupSettings: m = l.popupSettings,
|
|
20
20
|
size: z = l.size,
|
|
21
21
|
rounded: O = l.rounded,
|
|
22
22
|
fillMode: $ = l.fillMode,
|
|
23
23
|
className: j,
|
|
24
24
|
prefix: V = void 0,
|
|
25
25
|
suffix: A = void 0,
|
|
26
|
-
onOpen:
|
|
26
|
+
onOpen: y,
|
|
27
27
|
onClose: S,
|
|
28
|
-
onFocus:
|
|
29
|
-
onBlur:
|
|
30
|
-
onChange:
|
|
28
|
+
onFocus: R,
|
|
29
|
+
onBlur: F,
|
|
30
|
+
onChange: H,
|
|
31
31
|
onFilterChange: E,
|
|
32
32
|
onPageChange: N,
|
|
33
33
|
...D
|
|
34
34
|
} = t;
|
|
35
|
-
e.useImperativeHandle(
|
|
35
|
+
e.useImperativeHandle(p, () => {
|
|
36
36
|
var r;
|
|
37
37
|
return {
|
|
38
|
-
element: ((r =
|
|
38
|
+
element: ((r = u.current) == null ? void 0 : r.element) || null,
|
|
39
39
|
focus() {
|
|
40
|
-
|
|
40
|
+
u.current && u.current.focus();
|
|
41
41
|
},
|
|
42
42
|
get value() {
|
|
43
43
|
var o;
|
|
44
|
-
return (o =
|
|
44
|
+
return (o = u.current) == null ? void 0 : o.value;
|
|
45
45
|
},
|
|
46
46
|
get name() {
|
|
47
47
|
var o;
|
|
48
|
-
return (o =
|
|
48
|
+
return (o = u.current) == null ? void 0 : o.name;
|
|
49
49
|
},
|
|
50
50
|
props: t
|
|
51
51
|
};
|
|
52
|
-
}), e.useImperativeHandle(
|
|
53
|
-
|
|
54
|
-
() =>
|
|
52
|
+
}), me("multicolumncombobox", p, t, t.webMcp), e.useImperativeHandle(
|
|
53
|
+
b,
|
|
54
|
+
() => p.current
|
|
55
55
|
);
|
|
56
|
-
const
|
|
56
|
+
const s = e.useMemo(() => {
|
|
57
57
|
if (t.groupField !== void 0 && t.data)
|
|
58
|
-
return
|
|
59
|
-
}, [t.data, t.groupField]), [
|
|
60
|
-
const r = /* @__PURE__ */ e.createElement("th", { className: "k-table-th", colSpan:
|
|
61
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null, t.header, /* @__PURE__ */ e.createElement("div", { ref:
|
|
58
|
+
return he(t.data[0], t.groupField);
|
|
59
|
+
}, [t.data, t.groupField]), [h, f] = e.useState(s), [M, B] = e.useState(!0), C = e.useRef(null), [J] = V ? T(t.prefix || e.Fragment) : [], [Q] = A ? T(t.suffix || e.Fragment) : [], U = e.useMemo(() => {
|
|
60
|
+
const r = /* @__PURE__ */ e.createElement("th", { className: "k-table-th", colSpan: n.length }, h);
|
|
61
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, t.header, /* @__PURE__ */ e.createElement("div", { ref: C, className: "k-table-header-wrap" }, /* @__PURE__ */ e.createElement("table", { className: "k-table", role: "presentation" }, /* @__PURE__ */ e.createElement("colgroup", null, n.map((o, c) => /* @__PURE__ */ e.createElement(
|
|
62
62
|
"col",
|
|
63
63
|
{
|
|
64
64
|
key: o.uniqueKey ? o.uniqueKey : c,
|
|
65
65
|
style: { width: o.width ? o.width : l.width }
|
|
66
66
|
}
|
|
67
|
-
))), /* @__PURE__ */ e.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ e.createElement("tr", { className: "k-table-row" },
|
|
68
|
-
}, [t.header,
|
|
67
|
+
))), /* @__PURE__ */ e.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ e.createElement("tr", { className: "k-table-row" }, n.map((o, c) => /* @__PURE__ */ e.createElement("th", { className: "k-table-th", key: o.uniqueKey ? o.uniqueKey : c }, o.header || " "))), h && M && /* @__PURE__ */ e.createElement("tr", { className: "k-table-group-row" }, t.groupStickyHeaderItemRender ? t.groupStickyHeaderItemRender.call(void 0, r, {}) : r)))));
|
|
68
|
+
}, [t.header, n, h, M, t.groupStickyHeaderItemRender]), X = e.useMemo(
|
|
69
69
|
() => (
|
|
70
70
|
// These additional 4px are coming from the child elements side borders (fixes horizontal scrollbar)
|
|
71
|
-
`calc(${
|
|
71
|
+
`calc(${n.map((r) => Ce(r.width, l.width)).filter(Boolean).join(" + ")} + ${w}px + 4px)`
|
|
72
72
|
),
|
|
73
|
-
[
|
|
74
|
-
),
|
|
73
|
+
[n, w]
|
|
74
|
+
), I = t.virtual ? t.virtual.skip : 0, Y = e.useCallback(
|
|
75
75
|
(r, o) => {
|
|
76
|
-
const c =
|
|
76
|
+
const c = n.map((d, ie) => /* @__PURE__ */ e.createElement(
|
|
77
77
|
"span",
|
|
78
78
|
{
|
|
79
79
|
className: t.itemRender ? void 0 : "k-table-td",
|
|
80
|
-
style: t.itemRender ? void 0 : { width:
|
|
81
|
-
key:
|
|
80
|
+
style: t.itemRender ? void 0 : { width: d.width ? d.width : l.width },
|
|
81
|
+
key: d.uniqueKey ? d.uniqueKey : ie
|
|
82
82
|
},
|
|
83
|
-
|
|
83
|
+
d.field ? String(L(d.field)(o.dataItem)) : ""
|
|
84
84
|
));
|
|
85
|
-
let
|
|
86
|
-
const W = o.index -
|
|
87
|
-
t.groupField !== void 0 && (v =
|
|
85
|
+
let q, g, k, v;
|
|
86
|
+
const K = t.data || [], W = o.index - I;
|
|
87
|
+
t.groupField !== void 0 && (v = L(t.groupField), g = v(K[W]), k = v(K[W - 1]), g && k && g !== k && (q = g));
|
|
88
88
|
const G = e.cloneElement(
|
|
89
89
|
r,
|
|
90
90
|
{
|
|
@@ -93,7 +93,7 @@ const be = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, ke = fe(), P =
|
|
|
93
93
|
"k-table-alt-row": o.index % 2 !== 0,
|
|
94
94
|
"k-focus": o.focused,
|
|
95
95
|
"k-selected": o.selected,
|
|
96
|
-
"k-first": !!
|
|
96
|
+
"k-first": !!q,
|
|
97
97
|
"k-disabled": o.dataItem.disabled
|
|
98
98
|
})
|
|
99
99
|
},
|
|
@@ -101,45 +101,51 @@ const be = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, ke = fe(), P =
|
|
|
101
101
|
);
|
|
102
102
|
return t.itemRender ? t.itemRender.call(void 0, G, o) : G;
|
|
103
103
|
},
|
|
104
|
-
[
|
|
105
|
-
),
|
|
104
|
+
[n, t.groupField, t.itemRender, t.data, I]
|
|
105
|
+
), a = e.useCallback((r, o) => {
|
|
106
106
|
r && r.call(void 0, {
|
|
107
107
|
...o,
|
|
108
|
-
target:
|
|
108
|
+
target: p.current
|
|
109
109
|
});
|
|
110
110
|
}, []), Z = e.useCallback(
|
|
111
|
-
(r) => (t.virtual ||
|
|
112
|
-
[
|
|
113
|
-
), _ = e.useCallback((r) =>
|
|
114
|
-
(r) => (
|
|
111
|
+
(r) => (t.virtual || f(s), a(y, r)),
|
|
112
|
+
[a, y, t.virtual, s]
|
|
113
|
+
), _ = e.useCallback((r) => a(S, r), [a, S]), ee = e.useCallback((r) => a(R, r), [a, R]), te = e.useCallback((r) => a(F, r), [a, F]), re = e.useCallback(
|
|
114
|
+
(r) => a(H, r),
|
|
115
|
+
[a, H]
|
|
116
|
+
), oe = e.useCallback(
|
|
117
|
+
(r) => a(N, r),
|
|
118
|
+
[a, N]
|
|
119
|
+
), ae = e.useCallback(
|
|
120
|
+
(r) => (f(s), a(E, {
|
|
115
121
|
...r,
|
|
116
122
|
mobileMode: r.target.mobileMode
|
|
117
123
|
})),
|
|
118
|
-
[E]
|
|
124
|
+
[a, s, E]
|
|
119
125
|
), ne = e.useCallback((r) => {
|
|
120
|
-
|
|
126
|
+
f(r.group);
|
|
121
127
|
}, []), le = e.useCallback((r) => {
|
|
122
|
-
|
|
128
|
+
C.current && (C.current.scrollLeft = r.target.scrollLeft);
|
|
123
129
|
}, []);
|
|
124
130
|
e.useEffect(() => {
|
|
125
|
-
|
|
131
|
+
fe();
|
|
126
132
|
}), e.useEffect(() => {
|
|
127
133
|
const r = t.data;
|
|
128
|
-
|
|
129
|
-
}, [t.data]);
|
|
134
|
+
f(s), r && r.length !== 0 ? B(!0) : B(!1);
|
|
135
|
+
}, [t.data, s]);
|
|
130
136
|
const se = e.useCallback((r) => /* @__PURE__ */ e.createElement(de, { ...r }), []);
|
|
131
137
|
return /* @__PURE__ */ e.createElement(
|
|
132
|
-
|
|
138
|
+
be,
|
|
133
139
|
{
|
|
134
140
|
...D,
|
|
135
141
|
list: se,
|
|
136
142
|
popupSettings: {
|
|
137
|
-
...
|
|
138
|
-
popupClass: x("k-dropdowngrid-popup",
|
|
139
|
-
width:
|
|
140
|
-
className:
|
|
143
|
+
...m,
|
|
144
|
+
popupClass: x("k-dropdowngrid-popup", m.popupClass),
|
|
145
|
+
width: m.width || X,
|
|
146
|
+
className: m.className
|
|
141
147
|
},
|
|
142
|
-
ref:
|
|
148
|
+
ref: u,
|
|
143
149
|
header: U,
|
|
144
150
|
itemRender: Y,
|
|
145
151
|
groupHeaderItemRender: t.groupHeaderItemRender,
|
|
@@ -171,7 +177,6 @@ const be = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, ke = fe(), P =
|
|
|
171
177
|
);
|
|
172
178
|
}
|
|
173
179
|
), ve = {
|
|
174
|
-
...he.propTypes,
|
|
175
180
|
columns: ue.any.isRequired
|
|
176
181
|
}, l = {
|
|
177
182
|
columns: [],
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { MultiSelectHandle } from './MultiSelect/MultiSelect.js';
|
|
8
|
+
import { MultiSelect as MultiSelectOriginal, MultiSelectHandle } from './MultiSelect/MultiSelect.js';
|
|
9
9
|
import { MultiSelectProps } from './MultiSelect/MultiSelectProps';
|
|
10
10
|
/**
|
|
11
11
|
* MultiSelect wrapper that integrates the Web MCP hook.
|
|
@@ -15,3 +15,5 @@ import { MultiSelectProps } from './MultiSelect/MultiSelectProps';
|
|
|
15
15
|
import * as React from 'react';
|
|
16
16
|
/** @hidden */
|
|
17
17
|
export declare const MultiSelectWrapper: React.ForwardRefExoticComponent<MultiSelectProps & React.RefAttributes<MultiSelectHandle>>;
|
|
18
|
+
/** @hidden */
|
|
19
|
+
export type MultiSelectWrapper = MultiSelectOriginal;
|