@progress/kendo-react-grid 8.1.0-develop.8 → 8.1.0
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/Grid.js +1 -1
- package/Grid.mjs +141 -121
- package/GridColumn.js +1 -1
- package/GridColumn.mjs +6 -3
- package/columnMenu/GridColumnMenuColumnsList.js +1 -1
- package/columnMenu/GridColumnMenuColumnsList.mjs +38 -35
- package/columnMenu/GridColumnMenuItemContent.js +1 -1
- package/columnMenu/GridColumnMenuItemContent.mjs +4 -3
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/index.d.mts +13 -0
- package/index.d.ts +13 -0
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/utils/index.js +1 -1
- package/utils/index.mjs +10 -10
package/GridColumn.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";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("prop-types"),l=
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("prop-types"),l=o=>null;l.displayName="KendoReactGridColumn";const r={filterable:!0,editable:!0,sortable:!0,resizable:!0,reorderable:!0,groupable:!0};l.propTypes={field:e.string,title:e.string,editable:e.bool,sortable:e.oneOfType([e.bool,e.shape({allowUnsort:e.bool.isRequired})]),cell:e.any,filterCell:e.any,filterTitle:e.string,filterable:e.bool,filter:e.oneOf(["text","numeric","boolean","date"]),editor:e.oneOf(["text","numeric","boolean","date"]),width:e.oneOfType([e.string,e.number]),minResizableWidth:e.number,headerCell:e.any,footerCell:e.any,headerSelectionValue:e.bool,format:e.string,headerClassName:e.string,className:e.string,reorderable:e.bool,resizable:e.bool,orderIndex:e.number,groupable:e.bool,columnMenu:e.any,menuIcon:e.any,locked:e.bool,hidden:e.bool,media:e.string};exports.GridColumn=l;exports.gridDefaultProps=r;
|
package/GridColumn.mjs
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import e from "prop-types";
|
|
10
10
|
const l = (o) => null;
|
|
11
11
|
l.displayName = "KendoReactGridColumn";
|
|
12
|
-
|
|
12
|
+
const t = {
|
|
13
13
|
filterable: !0,
|
|
14
14
|
editable: !0,
|
|
15
15
|
sortable: !0,
|
|
@@ -47,8 +47,11 @@ l.propTypes = {
|
|
|
47
47
|
groupable: e.bool,
|
|
48
48
|
columnMenu: e.any,
|
|
49
49
|
menuIcon: e.any,
|
|
50
|
-
locked: e.bool
|
|
50
|
+
locked: e.bool,
|
|
51
|
+
hidden: e.bool,
|
|
52
|
+
media: e.string
|
|
51
53
|
};
|
|
52
54
|
export {
|
|
53
|
-
l as GridColumn
|
|
55
|
+
l as GridColumn,
|
|
56
|
+
t as gridDefaultProps
|
|
54
57
|
};
|
|
@@ -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";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),m=require("@progress/kendo-react-inputs"),M=require("@progress/kendo-react-common"),N=require("@progress/kendo-svg-icons"),C=require("@progress/kendo-react-buttons");function x(n){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const s in n)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(o,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}return o.default=n,Object.freeze(o)}const t=x(v),f=n=>{const[o,s]=t.useState(""),i=n.columns.reduce((e,l)=>({...e,[l.id||""]:!!n.columnsState.find(a=>a.id===l.id)}),{}),[c,d]=t.useState(i),h=t.useMemo(()=>n.columns.filter(e=>{var l;return(l=e.title||e.field)==null?void 0:l.toLowerCase().includes(o.toLowerCase())}),[n.columns,o]),b=t.useCallback(()=>{const e=n.columns.filter(l=>c[l.id||""]);n.onColumnsChange.call(void 0,e),n.onCloseMenu.call(void 0)},[c,n.columns,n.onColumnsChange,n.onCloseMenu]),g=()=>{d(i)},r=t.useMemo(()=>Object.values(c).filter(e=>e).length,[c]),u=t.useMemo(()=>r===n.columns.length,[n.columns,r]),S=t.useCallback(()=>{const e={...c};Object.keys(e).forEach((l,a)=>e[l]=u&&a===0?!0:!u),d(e)},[c,u]),E=t.useCallback((e,l)=>{const a={...c};a[l||""]=e,d(a)},[c]),y=e=>{s(String(e.target.value))};return t.createElement("form",{className:"k-filter-menu"},t.createElement("div",{className:"k-filter-menu-container"},t.createElement(m.TextBox,{className:"k-searchbox",value:o,onChange:y,prefix:()=>t.createElement(m.InputPrefix,null,t.createElement(M.IconWrap,{name:"search",icon:N.searchIcon}))}),t.createElement("ul",{className:"k-reset k-multicheck-wrap"},!o&&t.createElement("li",{className:"k-item k-check-all-wrap"},t.createElement(m.Checkbox,{checked:u,onChange:S,label:"(Select all)"})),h.map((e,l)=>t.createElement("li",{key:e.id,className:"k-item"},t.createElement(m.Checkbox,{disabled:c[e.id||""]&&r===1,checked:c[e.id||""],onChange:a=>{var k;return E(!!((k=a.target.element)!=null&&k.checked),e.id)},label:e.title||e.field})))),t.createElement("div",{className:"k-filter-selected-items"},r," selected items"),t.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal"},t.createElement(C.Button,{type:"button",themeColor:"primary",onClick:b},"Apply"),t.createElement(C.Button,{type:"button",onClick:g},"Reset"))))};f.displayName="GridColumnMenuColumnsList";exports.GridColumnMenuColumnsList=f;
|
|
@@ -6,55 +6,58 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import { TextBox as
|
|
11
|
-
import { IconWrap as
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import { TextBox as N, InputPrefix as x, Checkbox as d } from "@progress/kendo-react-inputs";
|
|
11
|
+
import { IconWrap as y } from "@progress/kendo-react-common";
|
|
12
12
|
import { searchIcon as v } from "@progress/kendo-svg-icons";
|
|
13
|
-
import { Button as
|
|
14
|
-
const
|
|
15
|
-
const [o, k] =
|
|
13
|
+
import { Button as C } from "@progress/kendo-react-buttons";
|
|
14
|
+
const M = (l) => {
|
|
15
|
+
const [o, k] = t.useState(""), r = l.columns.reduce((e, n) => ({ ...e, [n.id || ""]: !!l.columnsState.find((a) => a.id === n.id) }), {}), [c, i] = t.useState(r), h = t.useMemo(() => l.columns.filter((e) => {
|
|
16
16
|
var n;
|
|
17
|
-
return (n =
|
|
18
|
-
}), [l.columns, o]),
|
|
19
|
-
const
|
|
20
|
-
l.onColumnsChange.call(void 0,
|
|
21
|
-
}, [
|
|
22
|
-
i(
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
return (n = e.title || e.field) == null ? void 0 : n.toLowerCase().includes(o.toLowerCase());
|
|
18
|
+
}), [l.columns, o]), f = t.useCallback(() => {
|
|
19
|
+
const e = l.columns.filter((n) => c[n.id || ""]);
|
|
20
|
+
l.onColumnsChange.call(void 0, e), l.onCloseMenu.call(void 0);
|
|
21
|
+
}, [c, l.columns, l.onColumnsChange, l.onCloseMenu]), E = () => {
|
|
22
|
+
i(r);
|
|
23
|
+
}, s = t.useMemo(() => Object.values(c).filter((e) => e).length, [c]), m = t.useMemo(() => s === l.columns.length, [l.columns, s]), b = t.useCallback(() => {
|
|
24
|
+
const e = { ...c };
|
|
25
|
+
Object.keys(e).forEach((n, a) => e[n] = m && a === 0 ? !0 : !m), i(e);
|
|
26
|
+
}, [c, m]), g = t.useCallback((e, n) => {
|
|
27
|
+
const a = { ...c };
|
|
28
|
+
a[n || ""] = e, i(a);
|
|
29
|
+
}, [c]), S = (e) => {
|
|
30
|
+
k(String(e.target.value));
|
|
31
|
+
};
|
|
32
|
+
return /* @__PURE__ */ t.createElement("form", { className: "k-filter-menu" }, /* @__PURE__ */ t.createElement("div", { className: "k-filter-menu-container" }, /* @__PURE__ */ t.createElement(
|
|
33
|
+
N,
|
|
31
34
|
{
|
|
32
35
|
className: "k-searchbox",
|
|
33
36
|
value: o,
|
|
34
|
-
onChange:
|
|
35
|
-
prefix: () => /* @__PURE__ */
|
|
37
|
+
onChange: S,
|
|
38
|
+
prefix: () => /* @__PURE__ */ t.createElement(x, null, /* @__PURE__ */ t.createElement(y, { name: "search", icon: v }))
|
|
36
39
|
}
|
|
37
|
-
), /* @__PURE__ */
|
|
38
|
-
|
|
40
|
+
), /* @__PURE__ */ t.createElement("ul", { className: "k-reset k-multicheck-wrap" }, !o && /* @__PURE__ */ t.createElement("li", { className: "k-item k-check-all-wrap" }, /* @__PURE__ */ t.createElement(
|
|
41
|
+
d,
|
|
39
42
|
{
|
|
40
|
-
checked:
|
|
43
|
+
checked: m,
|
|
41
44
|
onChange: b,
|
|
42
45
|
label: "(Select all)"
|
|
43
46
|
}
|
|
44
|
-
)), h.map((
|
|
45
|
-
|
|
47
|
+
)), h.map((e, n) => /* @__PURE__ */ t.createElement("li", { key: e.id, className: "k-item" }, /* @__PURE__ */ t.createElement(
|
|
48
|
+
d,
|
|
46
49
|
{
|
|
47
|
-
disabled:
|
|
48
|
-
checked:
|
|
49
|
-
onChange: (
|
|
50
|
+
disabled: c[e.id || ""] && s === 1,
|
|
51
|
+
checked: c[e.id || ""],
|
|
52
|
+
onChange: (a) => {
|
|
50
53
|
var u;
|
|
51
|
-
return g(!!((u =
|
|
54
|
+
return g(!!((u = a.target.element) != null && u.checked), e.id);
|
|
52
55
|
},
|
|
53
|
-
label:
|
|
56
|
+
label: e.title || e.field
|
|
54
57
|
}
|
|
55
|
-
)))), /* @__PURE__ */
|
|
58
|
+
)))), /* @__PURE__ */ t.createElement("div", { className: "k-filter-selected-items" }, s, " selected items"), /* @__PURE__ */ t.createElement("div", { className: "k-actions k-actions-start k-actions-horizontal" }, /* @__PURE__ */ t.createElement(C, { type: "button", themeColor: "primary", onClick: f }, "Apply"), /* @__PURE__ */ t.createElement(C, { type: "button", onClick: E }, "Reset"))));
|
|
56
59
|
};
|
|
57
|
-
|
|
60
|
+
M.displayName = "GridColumnMenuColumnsList";
|
|
58
61
|
export {
|
|
59
|
-
|
|
62
|
+
M as GridColumnMenuColumnsList
|
|
60
63
|
};
|
|
@@ -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";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),c=require("@progress/kendo-react-animation"),i=require("@progress/kendo-react-common");function l(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const o=l(s);class a extends o.Component{render(){return o.createElement("div",{id:this.props.id,className:i.classNames("k-columnmenu-item-content",this.props.className),style:this.props.style},o.createElement(c.Reveal,{style:{position:"relative",display:"block"}},this.props.show?this.props.children:null))}}exports.GridColumnMenuItemContent=a;
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),c=require("@progress/kendo-react-animation"),i=require("@progress/kendo-react-common");function l(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const o=l(s);class a extends o.Component{render(){return o.createElement("div",{id:this.props.id,className:i.classNames("k-columnmenu-item-content",this.props.className),style:this.props.style,tabIndex:0},o.createElement(c.Reveal,{style:{position:"relative",display:"block"}},this.props.show?this.props.children:null))}}exports.GridColumnMenuItemContent=a;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import * as e from "react";
|
|
10
10
|
import { Reveal as t } from "@progress/kendo-react-animation";
|
|
11
11
|
import { classNames as s } from "@progress/kendo-react-common";
|
|
12
|
-
class
|
|
12
|
+
class i extends e.Component {
|
|
13
13
|
/**
|
|
14
14
|
* @hidden
|
|
15
15
|
*/
|
|
@@ -19,12 +19,13 @@ class l extends e.Component {
|
|
|
19
19
|
{
|
|
20
20
|
id: this.props.id,
|
|
21
21
|
className: s("k-columnmenu-item-content", this.props.className),
|
|
22
|
-
style: this.props.style
|
|
22
|
+
style: this.props.style,
|
|
23
|
+
tabIndex: 0
|
|
23
24
|
},
|
|
24
25
|
/* @__PURE__ */ e.createElement(t, { style: { position: "relative", display: "block" } }, this.props.show ? this.props.children : null)
|
|
25
26
|
);
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
+
i as GridColumnMenuItemContent
|
|
30
31
|
};
|