@progress/kendo-react-grid 15.0.1-develop.9 → 15.1.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/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +2 -2
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +43 -43
- package/VirtualScroll.js +1 -1
- package/VirtualScroll.mjs +1 -1
- package/cells/groupcell/useGroupCellClientTdProps.js +1 -1
- package/cells/groupcell/useGroupCellClientTdProps.mjs +7 -7
- package/cells/hierarchycell/GridHierarchyCellToggle.js +1 -1
- package/cells/hierarchycell/GridHierarchyCellToggle.mjs +15 -15
- package/cells/selectioncell/GridSelectionCell.js +1 -1
- package/cells/selectioncell/GridSelectionCell.mjs +29 -8
- package/cells/selectioncell/GridSelectionCellInput.d.ts +6 -2
- package/cells/selectioncell/GridSelectionCellInput.js +1 -1
- package/cells/selectioncell/GridSelectionCellInput.mjs +16 -25
- package/cells/selectioncell/GridSelectionCellServer.js +1 -1
- package/cells/selectioncell/GridSelectionCellServer.mjs +18 -16
- package/components/GridEditDialog.js +1 -1
- package/components/GridEditDialog.mjs +19 -19
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +84 -84
- package/getRowContents.js +1 -1
- package/getRowContents.mjs +12 -12
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -17
- package/utils/index.js +1 -1
- package/utils/index.mjs +161 -161
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),y=require("../../utils/GridContext.js"),
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),y=require("../../utils/GridContext.js"),r=require("@progress/kendo-react-data-tools"),C=require("@progress/kendo-react-common"),u=require("../hooks.js");function g(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const d=g(f),m=(e,n)=>{const t=d.useContext(y.GridContext),a=r.useTableKeyboardNavigation(e.id),i=u.useContextMenuHandler(e.dataItem,e.field),s=u.usePositionStyle(e),c=d.useCallback(o=>{o.isDefaultPrevented()||o.keyCode===C.Keys.enter&&(t!=null&&t.itemChange)&&(o.preventDefault(),t.itemChange({dataItem:e.dataItem,dataIndex:e.dataIndex,syntheticEvent:o,field:void 0,value:!e.expanded}),t.dispatchGroupExpand({type:r.GROUP_EXPAND_ACTION.TOGGLE,group:e.group},o))},[t,e.dataItem,e.dataIndex,e.expanded,e.group]);return{...a,...n?{onKeyDown:c}:{},onContextMenu:i,style:s}};exports.useGroupCellClientTdProps=m;
|
|
@@ -10,9 +10,9 @@ import * as a from "react";
|
|
|
10
10
|
import { GridContext as m } from "../../utils/GridContext.mjs";
|
|
11
11
|
import { useTableKeyboardNavigation as s, GROUP_EXPAND_ACTION as f } from "@progress/kendo-react-data-tools";
|
|
12
12
|
import { Keys as y } from "@progress/kendo-react-common";
|
|
13
|
-
import { useContextMenuHandler as
|
|
14
|
-
const
|
|
15
|
-
const e = a.useContext(m), d = s(t.id), i =
|
|
13
|
+
import { useContextMenuHandler as x, usePositionStyle as C } from "../hooks.mjs";
|
|
14
|
+
const K = (t, o) => {
|
|
15
|
+
const e = a.useContext(m), d = s(t.id), i = x(t.dataItem, t.field), r = C(t), u = a.useCallback(
|
|
16
16
|
(n) => {
|
|
17
17
|
n.isDefaultPrevented() || n.keyCode === y.enter && (e != null && e.itemChange) && (n.preventDefault(), e.itemChange({
|
|
18
18
|
dataItem: t.dataItem,
|
|
@@ -20,7 +20,7 @@ const b = (t, o) => {
|
|
|
20
20
|
syntheticEvent: n,
|
|
21
21
|
field: void 0,
|
|
22
22
|
value: !t.expanded
|
|
23
|
-
}), e
|
|
23
|
+
}), e.dispatchGroupExpand(
|
|
24
24
|
{
|
|
25
25
|
type: f.TOGGLE,
|
|
26
26
|
group: t.group
|
|
@@ -33,12 +33,12 @@ const b = (t, o) => {
|
|
|
33
33
|
return {
|
|
34
34
|
...d,
|
|
35
35
|
...o ? {
|
|
36
|
-
onKeyDown:
|
|
36
|
+
onKeyDown: u
|
|
37
37
|
} : {},
|
|
38
38
|
onContextMenu: i,
|
|
39
|
-
style:
|
|
39
|
+
style: r
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
export {
|
|
43
|
-
|
|
43
|
+
K as useGroupCellClientTdProps
|
|
44
44
|
};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),u=require("../../utils/GridContext.js"),m=require("@progress/kendo-react-common"),
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),u=require("../../utils/GridContext.js"),m=require("@progress/kendo-react-common"),d=require("@progress/kendo-svg-icons"),g=require("@progress/kendo-react-intl"),o=require("../../messages/index.js"),f=require("@progress/kendo-react-data-tools");function I(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const c=I(s),b=e=>{const t=c.useContext(u.GridContext),n=g.useLocalization(),a=e.expanded,i=a?o.detailCollapse:o.detailExpand,l=n.toLanguageString(i,o.messages[i]);return c.createElement("a",{onClick:r=>{r.preventDefault(),t!=null&&t.itemChange&&t.itemChange({dataItem:e.dataItem,dataIndex:e.dataIndex,syntheticEvent:r,field:e.field,value:!a,_expand:!0}),t&&e.dataItem[t.dataItemKey]!==void 0&&t.dispatchDetailExpand({type:f.DETAIL_EXPAND_ACTION.TOGGLE,id:e.dataItem[t.dataItemKey]})},"aria-label":l,href:"#",tabIndex:-1},c.createElement(m.IconWrap,{name:a?"minus":"plus",icon:a?d.minusIcon:d.plusIcon}))};exports.GridHierarchyCellToggle=b;
|
|
@@ -7,35 +7,35 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as n from "react";
|
|
10
|
-
import { GridContext as
|
|
11
|
-
import { IconWrap as
|
|
10
|
+
import { GridContext as r } from "../../utils/GridContext.mjs";
|
|
11
|
+
import { IconWrap as l } from "@progress/kendo-react-common";
|
|
12
12
|
import { minusIcon as c, plusIcon as s } from "@progress/kendo-svg-icons";
|
|
13
13
|
import { useLocalization as I } from "@progress/kendo-react-intl";
|
|
14
14
|
import { detailCollapse as f, detailExpand as u, messages as p } from "../../messages/index.mjs";
|
|
15
15
|
import { DETAIL_EXPAND_ACTION as x } from "@progress/kendo-react-data-tools";
|
|
16
|
-
const D = (
|
|
17
|
-
const e = n.useContext(
|
|
16
|
+
const D = (t) => {
|
|
17
|
+
const e = n.useContext(r), m = I(), a = t.expanded, i = a ? f : u, d = m.toLanguageString(i, p[i]);
|
|
18
18
|
return /* @__PURE__ */ n.createElement(
|
|
19
19
|
"a",
|
|
20
20
|
{
|
|
21
|
-
onClick: (
|
|
22
|
-
|
|
23
|
-
dataItem:
|
|
24
|
-
dataIndex:
|
|
25
|
-
syntheticEvent:
|
|
26
|
-
field:
|
|
27
|
-
value: !
|
|
21
|
+
onClick: (o) => {
|
|
22
|
+
o.preventDefault(), e != null && e.itemChange && e.itemChange({
|
|
23
|
+
dataItem: t.dataItem,
|
|
24
|
+
dataIndex: t.dataIndex,
|
|
25
|
+
syntheticEvent: o,
|
|
26
|
+
field: t.field,
|
|
27
|
+
value: !a,
|
|
28
28
|
_expand: !0
|
|
29
|
-
}),
|
|
29
|
+
}), e && t.dataItem[e.dataItemKey] !== void 0 && e.dispatchDetailExpand({
|
|
30
30
|
type: x.TOGGLE,
|
|
31
|
-
id:
|
|
32
|
-
})
|
|
31
|
+
id: t.dataItem[e.dataItemKey]
|
|
32
|
+
});
|
|
33
33
|
},
|
|
34
34
|
"aria-label": d,
|
|
35
35
|
href: "#",
|
|
36
36
|
tabIndex: -1
|
|
37
37
|
},
|
|
38
|
-
/* @__PURE__ */ n.createElement(
|
|
38
|
+
/* @__PURE__ */ n.createElement(l, { name: a ? "minus" : "plus", icon: a ? c : s })
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
41
|
export {
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),P=require("@progress/kendo-react-common"),S=require("../../utils/GridContext.js"),y=require("./GridSelectionCellInput.js"),m=require("./utils.js"),b=require("../hooks.js"),I=require("./useSelectionCellClientTdProps.js");function T(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const l=T(f),k=t=>{var p;const{cellProps:e}=t,{tdProps:n}=m.getSelectionCellTdProps(e),o=I.useSelectionCellClientTdProps(e),g=b.useLegacyCellProps(e),c=l.useContext(S.GridContext),s=(p=e.isSelected)!=null?p:P.getNestedValue(e.field,e.dataItem),i=typeof s=="boolean"&&s,a=r=>{c==null||c.selectionChange({event:r,dataItem:e.dataItem,dataIndex:e.rowDataIndex,columnIndex:e.columnIndex})},u=r=>{i||a(r)},d=l.createElement(y.GridSelectionCellInput,{key:1,selected:i,onToggle:a}),C=m.getCustomCell(e);return C?l.createElement(C,{onClick:u,...e,...g,tdProps:{...n,...o}},d):e.rowType!=="groupHeader"?l.createElement("td",{onClick:u,...n,...o},d):null};exports.GridSelectionCell=k;
|
|
@@ -7,14 +7,35 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
import { getNestedValue as f } from "@progress/kendo-react-common";
|
|
11
|
+
import { GridContext as g } from "../../utils/GridContext.mjs";
|
|
12
|
+
import { GridSelectionCellInput as I } from "./GridSelectionCellInput.mjs";
|
|
13
|
+
import { getSelectionCellTdProps as P, getCustomCell as x } from "./utils.mjs";
|
|
14
|
+
import { useLegacyCellProps as y } from "../hooks.mjs";
|
|
15
|
+
import { useSelectionCellClientTdProps as S } from "./useSelectionCellClientTdProps.mjs";
|
|
16
|
+
const V = (C) => {
|
|
17
|
+
var p;
|
|
18
|
+
const { cellProps: e } = C, { tdProps: n } = P(e), r = S(e), u = y(e), o = t.useContext(g), c = (p = e.isSelected) != null ? p : f(e.field, e.dataItem), s = typeof c == "boolean" && c, a = (l) => {
|
|
19
|
+
o == null || o.selectionChange({
|
|
20
|
+
event: l,
|
|
21
|
+
dataItem: e.dataItem,
|
|
22
|
+
dataIndex: e.rowDataIndex,
|
|
23
|
+
columnIndex: e.columnIndex
|
|
24
|
+
});
|
|
25
|
+
}, d = (l) => {
|
|
26
|
+
s || a(l);
|
|
27
|
+
}, m = /* @__PURE__ */ t.createElement(I, { key: 1, selected: s, onToggle: a }), i = x(e);
|
|
28
|
+
return i ? /* @__PURE__ */ t.createElement(
|
|
29
|
+
i,
|
|
30
|
+
{
|
|
31
|
+
onClick: d,
|
|
32
|
+
...e,
|
|
33
|
+
...u,
|
|
34
|
+
tdProps: { ...n, ...r }
|
|
35
|
+
},
|
|
36
|
+
m
|
|
37
|
+
) : e.rowType !== "groupHeader" ? /* @__PURE__ */ t.createElement("td", { onClick: d, ...n, ...r }, m) : null;
|
|
17
38
|
};
|
|
18
39
|
export {
|
|
19
|
-
|
|
40
|
+
V as GridSelectionCell
|
|
20
41
|
};
|
|
@@ -5,9 +5,13 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { GridCellProps } from '../../interfaces/GridCellProps';
|
|
9
8
|
import * as React from 'react';
|
|
9
|
+
interface GridSelectionCellInputProps {
|
|
10
|
+
selected: boolean;
|
|
11
|
+
onToggle?: (e: React.SyntheticEvent<HTMLElement>) => void;
|
|
12
|
+
}
|
|
10
13
|
/**
|
|
11
14
|
* @hidden
|
|
12
15
|
*/
|
|
13
|
-
export declare const GridSelectionCellInput: (props:
|
|
16
|
+
export declare const GridSelectionCellInput: (props: GridSelectionCellInputProps) => React.JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),u=require("@progress/kendo-react-common"),d=require("@progress/kendo-react-intl"),o=require("../../messages/index.js");function p(t){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(c,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return c.default=t,Object.freeze(c)}const r=p(s),k=t=>{const{selected:c,onToggle:e}=t,n=u.useId(),l=d.useLocalization(),i=a=>{a.stopPropagation(),e==null||e(a)};return r.createElement("span",{className:"k-checkbox-wrap"},r.createElement("input",{id:n,tabIndex:-1,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md","aria-label":l.toLanguageString(o.selectRow,o.messages[o.selectRow]),"aria-checked":c,checked:c,readOnly:!0,onClick:i}))};exports.GridSelectionCellInput=k;
|
|
@@ -6,38 +6,29 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
t == null || t.selectionChange({
|
|
19
|
-
event: s,
|
|
20
|
-
dataItem: e.dataItem,
|
|
21
|
-
dataIndex: e.rowDataIndex,
|
|
22
|
-
columnIndex: e.columnIndex
|
|
23
|
-
});
|
|
24
|
-
},
|
|
25
|
-
[t, e.columnIndex, e.rowDataIndex, e.dataItem]
|
|
26
|
-
);
|
|
27
|
-
return /* @__PURE__ */ a.createElement("span", { className: "k-checkbox-wrap" }, /* @__PURE__ */ a.createElement(
|
|
9
|
+
import * as o from "react";
|
|
10
|
+
import { useId as l } from "@progress/kendo-react-common";
|
|
11
|
+
import { useLocalization as m } from "@progress/kendo-react-intl";
|
|
12
|
+
import { selectRow as a, messages as d } from "../../messages/index.mjs";
|
|
13
|
+
const h = (n) => {
|
|
14
|
+
const { selected: t, onToggle: e } = n, r = l(), i = m(), s = (c) => {
|
|
15
|
+
c.stopPropagation(), e == null || e(c);
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ o.createElement("span", { className: "k-checkbox-wrap" }, /* @__PURE__ */ o.createElement(
|
|
28
18
|
"input",
|
|
29
19
|
{
|
|
30
|
-
id:
|
|
20
|
+
id: r,
|
|
31
21
|
tabIndex: -1,
|
|
32
22
|
type: "checkbox",
|
|
33
23
|
className: "k-checkbox k-checkbox-md k-rounded-md",
|
|
34
|
-
"aria-label":
|
|
35
|
-
"aria-checked":
|
|
36
|
-
checked:
|
|
37
|
-
|
|
24
|
+
"aria-label": i.toLanguageString(a, d[a]),
|
|
25
|
+
"aria-checked": t,
|
|
26
|
+
checked: t,
|
|
27
|
+
readOnly: !0,
|
|
28
|
+
onClick: s
|
|
38
29
|
}
|
|
39
30
|
));
|
|
40
31
|
};
|
|
41
32
|
export {
|
|
42
|
-
|
|
33
|
+
h as GridSelectionCellInput
|
|
43
34
|
};
|
|
@@ -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 m=require("react"),f=require("@progress/kendo-react-common"),g=require("./GridSelectionCellInput.js"),u=require("./GridSelectionCellServerContainer.js"),a=require("../../utils/index.js"),d=require("./utils.js");function P(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const l=P(m),b=r=>{var s;const{cellProps:e}=r,{tdProps:t}=d.getSelectionCellTdProps(e),n=(s=e.isSelected)!=null?s:f.getNestedValue(e.field,e.dataItem),C=typeof n=="boolean"&&n,i=l.createElement(g.GridSelectionCellInput,{key:1,selected:C}),o=a.getClientCellProps(e),c=d.getCustomCell(e);if(c){const S=a.isClientReference(c);return l.createElement(u.GridSelectionCellServerContainer,{cellProps:o,tdProps:t,isCustom:!0,isClient:S},l.createElement(c,{...o,tdProps:t},i))}const p=e.rowType!=="groupHeader"?l.createElement("td",{...t},i):null;return l.createElement(u.GridSelectionCellServerContainer,{cellProps:o,tdProps:t},p)};exports.GridSelectionCellServer=b;
|
|
@@ -6,28 +6,30 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
import { getNestedValue as C } from "@progress/kendo-react-common";
|
|
10
|
+
import { GridSelectionCellInput as u } from "./GridSelectionCellInput.mjs";
|
|
11
|
+
import { GridSelectionCellServerContainer as i } from "./GridSelectionCellServerContainer.mjs";
|
|
12
|
+
import { getClientCellProps as f, isClientReference as P } from "../../utils/index.mjs";
|
|
13
|
+
import { getSelectionCellTdProps as S, getCustomCell as g } from "./utils.mjs";
|
|
14
|
+
const I = (m) => {
|
|
15
|
+
var s;
|
|
16
|
+
const { cellProps: e } = m, { tdProps: l } = S(e), n = (s = e.isSelected) != null ? s : C(e.field, e.dataItem), p = typeof n == "boolean" && n, c = /* @__PURE__ */ t.createElement(u, { key: 1, selected: p }), o = f(e), r = g(e);
|
|
17
|
+
if (r) {
|
|
18
|
+
const d = P(r);
|
|
17
19
|
return /* @__PURE__ */ t.createElement(
|
|
18
|
-
|
|
20
|
+
i,
|
|
19
21
|
{
|
|
20
|
-
cellProps:
|
|
21
|
-
tdProps:
|
|
22
|
+
cellProps: o,
|
|
23
|
+
tdProps: l,
|
|
22
24
|
isCustom: !0,
|
|
23
|
-
isClient:
|
|
25
|
+
isClient: d
|
|
24
26
|
},
|
|
25
|
-
/* @__PURE__ */ t.createElement(
|
|
27
|
+
/* @__PURE__ */ t.createElement(r, { ...o, tdProps: l }, c)
|
|
26
28
|
);
|
|
27
29
|
}
|
|
28
|
-
const
|
|
29
|
-
return /* @__PURE__ */ t.createElement(
|
|
30
|
+
const a = e.rowType !== "groupHeader" ? /* @__PURE__ */ t.createElement("td", { ...l }, c) : null;
|
|
31
|
+
return /* @__PURE__ */ t.createElement(i, { cellProps: o, tdProps: l }, a);
|
|
30
32
|
};
|
|
31
33
|
export {
|
|
32
|
-
|
|
34
|
+
I as GridSelectionCellServer
|
|
33
35
|
};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react"),x=require("react-dom"),I=require("@progress/kendo-react-layout"),u=require("@progress/kendo-react-buttons"),r=require("@progress/kendo-react-labels"),M=require("@progress/kendo-react-intl"),_=require("@progress/kendo-react-dateinputs"),O=require("@progress/kendo-react-common"),E=require("@progress/kendo-svg-icons"),D=require("@progress/kendo-react-inputs"),C=require("@progress/kendo-react-data-tools"),B=require("@progress/kendo-react-dialogs"),c=require("@progress/kendo-react-form"),w=require("../utils/GridContext.js"),o=require("../messages/index.js");function z(n){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react"),x=require("react-dom"),I=require("@progress/kendo-react-layout"),u=require("@progress/kendo-react-buttons"),r=require("@progress/kendo-react-labels"),M=require("@progress/kendo-react-intl"),_=require("@progress/kendo-react-dateinputs"),O=require("@progress/kendo-react-common"),E=require("@progress/kendo-svg-icons"),D=require("@progress/kendo-react-inputs"),C=require("@progress/kendo-react-data-tools"),B=require("@progress/kendo-react-dialogs"),c=require("@progress/kendo-react-form"),w=require("../utils/GridContext.js"),o=require("../messages/index.js");function z(n){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const i in n)if(i!=="default"){const l=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(d,i,l.get?l:{enumerable:!0,get:()=>n[i]})}}return d.default=n,Object.freeze(d)}const e=z(q),A=n=>{var h;const d=M.useLocalization(),i=O.useAdaptiveModeContext(),l=e.useContext(w.GridContext),g=(a,t)=>{l.onDialogEditSubmit&&l.onDialogEditSubmit({dataItem:a,syntheticEvent:t})},m=a=>{l.onDialogEditCancel&&l.onDialogEditCancel({syntheticEvent:a})},N=a=>{const{validationMessage:t,visited:P,id:f,valid:V,editor:F,value:b,label:k,...S}=a,T=l.mobileMode?"large":"medium";switch(F){case"numeric":return e.createElement(e.Fragment,null,e.createElement(r.Label,{editorId:f,className:"k-form-label"},k,":"),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(D.NumericTextBox,{...S,size:T,value:b,[C.TABLE_PREVENT_SELECTION_ELEMENT]:!0}),t&&e.createElement(r.Error,null,t)));case"date":return e.createElement(e.Fragment,null,e.createElement(r.Label,{editorId:f,className:"k-form-label"},k,":"),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(_.DatePicker,{valid:!0,...S,value:b,adaptive:l.mobileMode,size:T,[C.TABLE_PREVENT_SELECTION_ELEMENT]:!0}),t&&e.createElement(r.Error,null,t)));case"boolean":return e.createElement("div",{className:"k-form-field-wrap"},e.createElement(r.Label,{editorId:f,className:"k-form-label"},k,": ",e.createElement(D.Checkbox,{...S,size:T,value:b,[C.TABLE_PREVENT_SELECTION_ELEMENT]:!0}),t&&e.createElement(r.Error,null,t)));default:return e.createElement(e.Fragment,null,e.createElement(r.Label,{editorId:f,className:"k-form-label"},k,":"),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(D.TextBox,{...S,size:T,value:b||"",[C.TABLE_PREVENT_SELECTION_ELEMENT]:!0}),t&&e.createElement(r.Error,null,t)))}},p=d.toLanguageString(o.editDialogTitle,o.messages[o.editDialogTitle]),L=d.toLanguageString(o.editDialogSaveButtonTitle,o.messages[o.editDialogSaveButtonTitle]),y=d.toLanguageString(o.editDialogCancelButtonTitle,o.messages[o.editDialogCancelButtonTitle]),R={animation:!0,navigatable:!1,navigatableElements:[],expand:!0,title:l.adpativeTitle||p,suffixActions:e.createElement(u.Button,{svgIcon:E.xIcon,onClick:m,fillMode:"flat"}),animationStyles:i&&l.adaptiveColumnMenuRef<=i.small?{top:0,width:"100%",height:"100%"}:void 0,className:"k-adaptive-actionsheet",position:i&&l.adaptiveColumnMenuRef<=i.small?"fullscreen":void 0},{customEditDialog:v}=n,s=(h=n.columns)==null?void 0:h.filter(a=>a.editable);return e.createElement(e.Fragment,null,x.createPortal(e.createElement(e.Fragment,null,l.mobileMode?e.createElement(e.Fragment,null,v?e.createElement(v,{columns:n.columns,dataItem:n.dataItem,onSubmit:g,onCancel:m}):e.createElement(c.Form,{initialValues:n.dataItem,onSubmit:g,id:"kendo-grid-edit-dialog",render:a=>e.createElement(I.ActionSheet,{...R},e.createElement(I.ActionSheetContent,null,e.createElement(c.FormElement,null,s==null?void 0:s.map(t=>e.createElement(c.FieldWrapper,{key:t.field},e.createElement(c.Field,{name:t.field,id:t.field,editor:t.editor,component:N,label:t.title||t.field,validator:t.validator}))))),e.createElement(I.ActionSheetFooter,null,e.createElement(u.Button,{onClick:m,type:"reset",icon:"cancel",size:"large",svgIcon:E.cancelIcon},y),e.createElement(u.Button,{type:"submit",themeColor:"primary",size:"large",disabled:!a.allowSubmit||!a.valid,onClick:a.onSubmit,icon:"save",svgIcon:E.saveIcon},L)))})):v?e.createElement(v,{columns:n.columns,dataItem:n.dataItem,onSubmit:g,onCancel:m}):e.createElement(c.Form,{initialValues:n.dataItem,onSubmit:g,id:"kendo-grid-edit-dialog",render:a=>e.createElement(B.Dialog,{title:p,width:450,onClose:t=>m(t.syntheticEvent)},e.createElement(c.FormElement,null,s==null?void 0:s.map(t=>e.createElement(c.FieldWrapper,{key:t.field},e.createElement(c.Field,{name:t.field,id:t.field,editor:t.editor,component:N,label:t.title||t.field,validator:t.validator})))),e.createElement(B.DialogActionsBar,{layout:"start"},e.createElement(u.Button,{type:"submit",themeColor:"primary",disabled:!a.allowSubmit||!a.valid,onClick:a.onSubmit,icon:"save",svgIcon:E.saveIcon},L),e.createElement(u.Button,{onClick:m,type:"reset",icon:"cancel",svgIcon:E.cancelIcon},y)))})),document.body))};exports.GridEditDialog=A;
|
|
@@ -21,14 +21,14 @@ import { Dialog as Q, DialogActionsBar as U } from "@progress/kendo-react-dialog
|
|
|
21
21
|
import { Form as T, FormElement as F, FieldWrapper as M, Field as w } from "@progress/kendo-react-form";
|
|
22
22
|
import { GridContext as X } from "../utils/GridContext.mjs";
|
|
23
23
|
import { editDialogTitle as z, messages as S, editDialogSaveButtonTitle as B, editDialogCancelButtonTitle as L } from "../messages/index.mjs";
|
|
24
|
-
const ue = (
|
|
24
|
+
const ue = (i) => {
|
|
25
25
|
var y;
|
|
26
|
-
const C = W(), m = q(),
|
|
27
|
-
|
|
26
|
+
const C = W(), m = q(), l = e.useContext(X), c = (a, t) => {
|
|
27
|
+
l.onDialogEditSubmit && l.onDialogEditSubmit({ dataItem: a, syntheticEvent: t });
|
|
28
28
|
}, n = (a) => {
|
|
29
|
-
|
|
29
|
+
l.onDialogEditCancel && l.onDialogEditCancel({ syntheticEvent: a });
|
|
30
30
|
}, k = (a) => {
|
|
31
|
-
const { validationMessage: t, visited: Y, id: s, valid: Z, editor: R, value: E, label: u, ...f } = a, g =
|
|
31
|
+
const { validationMessage: t, visited: Y, id: s, valid: Z, editor: R, value: E, label: u, ...f } = a, g = l.mobileMode ? "large" : "medium";
|
|
32
32
|
switch (R) {
|
|
33
33
|
case "numeric":
|
|
34
34
|
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(v, { editorId: s, className: "k-form-label" }, u, ":"), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
@@ -47,7 +47,7 @@ const ue = (l) => {
|
|
|
47
47
|
valid: !0,
|
|
48
48
|
...f,
|
|
49
49
|
value: E,
|
|
50
|
-
adaptive:
|
|
50
|
+
adaptive: l.mobileMode,
|
|
51
51
|
size: g,
|
|
52
52
|
[p]: !0
|
|
53
53
|
}
|
|
@@ -84,28 +84,28 @@ const ue = (l) => {
|
|
|
84
84
|
navigatable: !1,
|
|
85
85
|
navigatableElements: [],
|
|
86
86
|
expand: !0,
|
|
87
|
-
title:
|
|
87
|
+
title: l.adpativeTitle || I,
|
|
88
88
|
suffixActions: /* @__PURE__ */ e.createElement(r, { svgIcon: H, onClick: n, fillMode: "flat" }),
|
|
89
|
-
animationStyles: m &&
|
|
89
|
+
animationStyles: m && l.adaptiveColumnMenuRef <= m.small ? { top: 0, width: "100%", height: "100%" } : void 0,
|
|
90
90
|
className: "k-adaptive-actionsheet",
|
|
91
|
-
position: m &&
|
|
92
|
-
}, { customEditDialog: d } =
|
|
91
|
+
position: m && l.adaptiveColumnMenuRef <= m.small ? "fullscreen" : void 0
|
|
92
|
+
}, { customEditDialog: d } = i, o = (y = i.columns) == null ? void 0 : y.filter((a) => a.editable);
|
|
93
93
|
return /* @__PURE__ */ e.createElement(e.Fragment, null, O.createPortal(
|
|
94
94
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
95
|
-
/* @__PURE__ */ e.createElement(e.Fragment, null,
|
|
95
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, l.mobileMode ? (
|
|
96
96
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
97
97
|
/* @__PURE__ */ e.createElement(e.Fragment, null, d ? /* @__PURE__ */ e.createElement(
|
|
98
98
|
d,
|
|
99
99
|
{
|
|
100
|
-
columns:
|
|
101
|
-
dataItem:
|
|
100
|
+
columns: i.columns,
|
|
101
|
+
dataItem: i.dataItem,
|
|
102
102
|
onSubmit: c,
|
|
103
103
|
onCancel: n
|
|
104
104
|
}
|
|
105
105
|
) : /* @__PURE__ */ e.createElement(
|
|
106
106
|
T,
|
|
107
107
|
{
|
|
108
|
-
initialValues:
|
|
108
|
+
initialValues: i.dataItem,
|
|
109
109
|
onSubmit: c,
|
|
110
110
|
id: "kendo-grid-edit-dialog",
|
|
111
111
|
render: (a) => /* @__PURE__ */ e.createElement(V, { ...A }, /* @__PURE__ */ e.createElement(_, null, /* @__PURE__ */ e.createElement(F, null, o == null ? void 0 : o.map((t) => /* @__PURE__ */ e.createElement(M, { key: t.field }, /* @__PURE__ */ e.createElement(
|
|
@@ -116,7 +116,7 @@ const ue = (l) => {
|
|
|
116
116
|
editor: t.editor,
|
|
117
117
|
component: k,
|
|
118
118
|
label: t.title || t.field,
|
|
119
|
-
validator: t
|
|
119
|
+
validator: t.validator
|
|
120
120
|
}
|
|
121
121
|
))))), /* @__PURE__ */ e.createElement(G, null, /* @__PURE__ */ e.createElement(
|
|
122
122
|
r,
|
|
@@ -146,15 +146,15 @@ const ue = (l) => {
|
|
|
146
146
|
) : d ? /* @__PURE__ */ e.createElement(
|
|
147
147
|
d,
|
|
148
148
|
{
|
|
149
|
-
columns:
|
|
150
|
-
dataItem:
|
|
149
|
+
columns: i.columns,
|
|
150
|
+
dataItem: i.dataItem,
|
|
151
151
|
onSubmit: c,
|
|
152
152
|
onCancel: n
|
|
153
153
|
}
|
|
154
154
|
) : /* @__PURE__ */ e.createElement(
|
|
155
155
|
T,
|
|
156
156
|
{
|
|
157
|
-
initialValues:
|
|
157
|
+
initialValues: i.dataItem,
|
|
158
158
|
onSubmit: c,
|
|
159
159
|
id: "kendo-grid-edit-dialog",
|
|
160
160
|
render: (a) => /* @__PURE__ */ e.createElement(
|
|
@@ -172,7 +172,7 @@ const ue = (l) => {
|
|
|
172
172
|
editor: t.editor,
|
|
173
173
|
component: k,
|
|
174
174
|
label: t.title || t.field,
|
|
175
|
-
validator: t
|
|
175
|
+
validator: t.validator
|
|
176
176
|
}
|
|
177
177
|
)))),
|
|
178
178
|
/* @__PURE__ */ e.createElement(U, { layout: "start" }, /* @__PURE__ */ e.createElement(
|