@progress/kendo-react-grid 7.2.4-develop.2 → 7.2.4-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/Grid.js +8 -0
- package/Grid.mjs +1108 -0
- package/GridColumn.js +8 -0
- package/GridColumn.mjs +53 -0
- package/GridNoRecords.js +8 -0
- package/GridNoRecords.mjs +25 -0
- package/GridToolbar.js +8 -0
- package/GridToolbar.mjs +39 -0
- package/StatusBar.js +8 -0
- package/StatusBar.mjs +53 -0
- package/VirtualScroll.js +8 -0
- package/VirtualScroll.mjs +128 -0
- package/VirtualScrollFixed.js +8 -0
- package/VirtualScrollFixed.mjs +86 -0
- package/cells/GridCell.js +8 -0
- package/cells/GridCell.mjs +57 -0
- package/cells/GridDetailCell.js +8 -0
- package/cells/GridDetailCell.mjs +30 -0
- package/cells/GridDetailHierarchyCell.js +8 -0
- package/cells/GridDetailHierarchyCell.mjs +17 -0
- package/cells/GridEditCell.js +8 -0
- package/cells/GridEditCell.mjs +172 -0
- package/cells/GridFilterCell.js +8 -0
- package/cells/GridFilterCell.mjs +145 -0
- package/cells/GridGroupCell.js +8 -0
- package/cells/GridGroupCell.mjs +115 -0
- package/cells/GridHierarchyCell.js +8 -0
- package/cells/GridHierarchyCell.mjs +84 -0
- package/cells/GridSelectionCell.js +8 -0
- package/cells/GridSelectionCell.mjs +54 -0
- package/columnMenu/GridColumnMenuCheckboxFilter.js +8 -0
- package/columnMenu/GridColumnMenuCheckboxFilter.mjs +199 -0
- package/columnMenu/GridColumnMenuColumnsList.js +8 -0
- package/columnMenu/GridColumnMenuColumnsList.mjs +60 -0
- package/columnMenu/GridColumnMenuFilter.js +8 -0
- package/columnMenu/GridColumnMenuFilter.mjs +188 -0
- package/columnMenu/GridColumnMenuFilterCell.js +8 -0
- package/columnMenu/GridColumnMenuFilterCell.mjs +96 -0
- package/columnMenu/GridColumnMenuFilterUI.js +8 -0
- package/columnMenu/GridColumnMenuFilterUI.mjs +36 -0
- package/columnMenu/GridColumnMenuGroup.js +8 -0
- package/columnMenu/GridColumnMenuGroup.mjs +50 -0
- package/columnMenu/GridColumnMenuItem.js +8 -0
- package/columnMenu/GridColumnMenuItem.mjs +22 -0
- package/columnMenu/GridColumnMenuItemContent.js +8 -0
- package/columnMenu/GridColumnMenuItemContent.mjs +30 -0
- package/columnMenu/GridColumnMenuItemGroup.js +8 -0
- package/columnMenu/GridColumnMenuItemGroup.mjs +30 -0
- package/columnMenu/GridColumnMenuSort.js +8 -0
- package/columnMenu/GridColumnMenuSort.mjs +75 -0
- package/columnMenu/GridColumnMenuWrapper.js +8 -0
- package/columnMenu/GridColumnMenuWrapper.mjs +91 -0
- package/constants/index.js +8 -0
- package/constants/index.mjs +15 -0
- package/dist/cdn/js/kendo-react-grid.js +8 -5
- package/drag/ColumnDraggable.js +8 -0
- package/drag/ColumnDraggable.mjs +43 -0
- package/drag/ColumnResize.js +8 -0
- package/drag/ColumnResize.mjs +128 -0
- package/drag/CommonDragLogic.js +8 -0
- package/drag/CommonDragLogic.mjs +104 -0
- package/drag/GroupingIndicator.js +8 -0
- package/drag/GroupingIndicator.mjs +91 -0
- package/filterCommon.js +8 -0
- package/filterCommon.mjs +103 -0
- package/footer/Footer.js +8 -0
- package/footer/Footer.mjs +76 -0
- package/footer/FooterRow.js +8 -0
- package/footer/FooterRow.mjs +46 -0
- package/header/FilterRow.js +8 -0
- package/header/FilterRow.mjs +96 -0
- package/header/GridHeaderCell.js +8 -0
- package/header/GridHeaderCell.mjs +38 -0
- package/header/GridHeaderSelectionCell.js +8 -0
- package/header/GridHeaderSelectionCell.mjs +44 -0
- package/header/GroupPanel.js +8 -0
- package/header/GroupPanel.mjs +60 -0
- package/header/Header.js +8 -0
- package/header/Header.mjs +107 -0
- package/header/HeaderRow.js +8 -0
- package/header/HeaderRow.mjs +155 -0
- package/index.d.mts +2771 -5
- package/index.d.ts +2771 -57
- package/index.js +8 -5
- package/index.mjs +89 -3845
- package/interfaces/GridSortSettings.js +8 -0
- package/interfaces/GridSortSettings.mjs +12 -0
- package/messages/index.js +8 -0
- package/messages/index.mjs +105 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +10 -10
- package/paging/GridPagerSettings.js +8 -0
- package/paging/GridPagerSettings.mjs +28 -0
- package/rows/GridDetailRow.js +8 -0
- package/rows/GridDetailRow.mjs +20 -0
- package/rows/GridRow.js +8 -0
- package/rows/GridRow.mjs +51 -0
- package/utils/index.js +8 -0
- package/utils/index.mjs +180 -0
- package/Grid.d.ts +0 -267
- package/GridColumn.d.ts +0 -28
- package/GridNoRecords.d.ts +0 -40
- package/GridToolbar.d.ts +0 -54
- package/ScrollMode.d.ts +0 -5
- package/StatusBar.d.ts +0 -51
- package/VirtualScroll.d.ts +0 -51
- package/VirtualScrollFixed.d.ts +0 -53
- package/cells/GridCell.d.ts +0 -6
- package/cells/GridDetailCell.d.ts +0 -18
- package/cells/GridDetailHierarchyCell.d.ts +0 -10
- package/cells/GridEditCell.d.ts +0 -9
- package/cells/GridFilterCell.d.ts +0 -20
- package/cells/GridGroupCell.d.ts +0 -9
- package/cells/GridHierarchyCell.d.ts +0 -9
- package/cells/GridSelectionCell.d.ts +0 -9
- package/columnMenu/GridColumnMenuCheckboxFilter.d.ts +0 -122
- package/columnMenu/GridColumnMenuColumnsList.d.ts +0 -31
- package/columnMenu/GridColumnMenuFilter.d.ts +0 -165
- package/columnMenu/GridColumnMenuFilterCell.d.ts +0 -37
- package/columnMenu/GridColumnMenuFilterUI.d.ts +0 -12
- package/columnMenu/GridColumnMenuGroup.d.ts +0 -77
- package/columnMenu/GridColumnMenuItem.d.ts +0 -40
- package/columnMenu/GridColumnMenuItemContent.d.ts +0 -24
- package/columnMenu/GridColumnMenuItemGroup.d.ts +0 -20
- package/columnMenu/GridColumnMenuSort.d.ts +0 -89
- package/columnMenu/GridColumnMenuWrapper.d.ts +0 -49
- package/constants/index.d.ts +0 -10
- package/drag/ColumnDraggable.d.ts +0 -38
- package/drag/ColumnResize.d.ts +0 -37
- package/drag/CommonDragLogic.d.ts +0 -44
- package/drag/GroupingIndicator.d.ts +0 -41
- package/filterCommon.d.ts +0 -73
- package/footer/Footer.d.ts +0 -38
- package/footer/FooterRow.d.ts +0 -25
- package/header/FilterRow.d.ts +0 -38
- package/header/GridHeaderCell.d.ts +0 -56
- package/header/GridHeaderSelectionCell.d.ts +0 -10
- package/header/GroupPanel.d.ts +0 -26
- package/header/Header.d.ts +0 -46
- package/header/HeaderRow.d.ts +0 -51
- package/interfaces/GridCellProps.d.ts +0 -73
- package/interfaces/GridCellsSettings.d.ts +0 -115
- package/interfaces/GridColumnMenuBaseProps.d.ts +0 -18
- package/interfaces/GridColumnMenuColumnProps.d.ts +0 -29
- package/interfaces/GridColumnMenuFilterBaseProps.d.ts +0 -28
- package/interfaces/GridColumnMenuFilterUIProps.d.ts +0 -35
- package/interfaces/GridColumnMenuGroupBaseProps.d.ts +0 -23
- package/interfaces/GridColumnMenuProps.d.ts +0 -12
- package/interfaces/GridColumnMenuSortBaseProps.d.ts +0 -24
- package/interfaces/GridColumnProps.d.ts +0 -92
- package/interfaces/GridDetailRowProps.d.ts +0 -17
- package/interfaces/GridFilterCellProps.d.ts +0 -68
- package/interfaces/GridFilterOperator.d.ts +0 -10
- package/interfaces/GridFilterOperators.d.ts +0 -53
- package/interfaces/GridFooterCellProps.d.ts +0 -26
- package/interfaces/GridGroupableSettings.d.ts +0 -17
- package/interfaces/GridHeaderCellProps.d.ts +0 -24
- package/interfaces/GridNoRecordsProps.d.ts +0 -13
- package/interfaces/GridProps.d.ts +0 -333
- package/interfaces/GridRowProps.d.ts +0 -67
- package/interfaces/GridRowType.d.ts +0 -13
- package/interfaces/GridSelectableSettings.d.ts +0 -22
- package/interfaces/GridSortSettings.d.ts +0 -17
- package/interfaces/GridToolbarProps.d.ts +0 -37
- package/interfaces/VirtualScrollInterface.d.ts +0 -31
- package/interfaces/events.d.ts +0 -232
- package/messages/index.d.ts +0 -199
- package/package-metadata.d.ts +0 -9
- package/paging/GridPagerSettings.d.ts +0 -71
- package/paging/Page.d.ts +0 -17
- package/rows/GridDetailRow.d.ts +0 -55
- package/rows/GridRow.d.ts +0 -15
- package/utils/index.d.ts +0 -73
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=1,u=20;class g{constructor(f){this.columns=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=c=>{this.isRtl=c},this.dragHandler=(c,l,e,r)=>{const t=c.originalEvent;r||(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation());const o=e.closest("th");if(!o||!o)return;const s=o.clientWidth;let n=s;if(this.isRtl?n+=e.getBoundingClientRect().right-e.offsetWidth/2-c.clientX:n+=c.clientX-e.getBoundingClientRect().left-e.offsetWidth/2,!r&&Math.abs(n-s)<1)return;this.fixateInitialWidths(o.parentElement.clientWidth),this.setWidths(l,Math.floor(n)/s);const d=this.columns.filter(i=>!i.children.length).findIndex(i=>i.id===l.id);this.onResize(d,s,n,t,r,l.id)},this.dblClickHandler=(c,l)=>{const e=this.columns.filter(h=>l.indexOf(h.id)>-1);if(!this.colGroupMain||!e.length)return;const r={},t=e;for(;t.length>0;){const h=t.pop();if(!h)break;h.children.length?t.push(...h.children):r[h.id]=h}const o=this.columns.filter(h=>!h.children.length),s=[];o.forEach((h,a)=>{r[h.id]&&s.push(a)});const n=[this.colGroupMain.parentElement],d=[this.colGroupMain];this.colGroupHeader&&(n.push(this.colGroupHeader.parentElement),d.push(this.colGroupHeader)),this.colGroupFooter&&(n.push(this.colGroupFooter.parentElement),d.push(this.colGroupFooter)),n.forEach(h=>h.classList.add("k-autofitting"));let i=[];d.forEach(h=>{s.forEach(a=>{h.children[a]&&(h.children[a].width="",i[a]=Math.max(i[a]||0,h.children[a].offsetWidth+p))})}),d.forEach(h=>{s.forEach(a=>{h.children[a]&&(h.children[a].width=i[a]+"px",o[a].width=i[a])})}),n.forEach(h=>h.classList.remove("k-autofitting")),this.onResize(s[0],0,0,c,!0,l[0])},this.updateColElements=c=>{const l=this.columns.filter(r=>!r.children.length);let e=1e-10;for(let r=0;r<c.length;r++){const t=c[r],o=l.findIndex(i=>i.id===t.id),s=parseFloat((t.width||0).toString()),n=Math.floor(s);e+=s-n;const d=n+Math.floor(e);if(e-=Math.floor(e),this.colGroupMain&&this.colGroupMain.children[o]){const i=parseInt(this.colGroupMain.children[o].width,10);this.colGroupMain.children[o].width=d+"px",this.updateNextLockedCol(this.colGroupMain.parentElement,t,i-d)}if(this.colGroupHeader&&this.colGroupHeader.children[o]){const i=parseInt(this.colGroupHeader.children[o].width,10);this.colGroupHeader.children[o].width=d+"px",this.updateNextLockedCol(this.colGroupHeader.parentElement,t,i-d)}if(this.colGroupFooter&&this.colGroupFooter.children[o]){const i=parseInt(this.colGroupFooter.children[o].width,10);this.colGroupFooter.children[o].width=d+"px",this.updateNextLockedCol(this.colGroupFooter.parentElement,t,i-d)}}},this.onResize=f}fixateInitialWidths(f){const c=this.columns.filter(t=>!t.children.length);let l=0,e=this.colGroupMain?this.colGroupMain.children:[];for(let t=0;t<e.length;t++)e[t].width?f-=parseFloat(e[t].width):l++;if(l===0)return;const r=Math.floor(f/l);for(let t=0;t<e.length;t++){const o=e[t];o.width||(o.width=r,c[t].width=r.toString(),this.colGroupHeader&&(this.colGroupHeader.children[t].width=r),this.colGroupFooter&&(this.colGroupFooter.children[t].width=r))}}setWidths(f,c){const l=this.columns.findIndex(t=>t.id===f.id),e=[];let r=f.children.length;for(let t=l+1;r>0&&t<this.columns.length;t++,r--){const o=this.columns[t];o.children.length?r+=o.children.length:e.push(o)}return e.length===0&&e.push(f),e.forEach(t=>{let o=t.width?parseFloat(t.width.toString())*c:0;const s=t.minResizableWidth===void 0?10:t.minResizableWidth;o<s&&(o=s),t.width=o}),this.updateColElements(e),e}updateNextLockedCol(f,c,l){const e=c.index,r=this.colGroupMain.parentElement.closest(".k-grid"),t=r==null?void 0:r.clientWidth,o=this.columns.filter(s=>s.locked).map(s=>parseInt(s.width+"",10)).reduce((s,n)=>s+n,0);!c.locked||t<=o+u||this.columns.forEach(s=>{if(s!=null&&s.locked&&l){const n=f==null?void 0:f.querySelectorAll('[aria-colindex="'+s.ariaColumnIndex+'"]');n==null||n.forEach(d=>{const i=d.style;this.isRtl?(s.index>e&&i&&i.right&&(i.right=parseInt(i.right,10)-l+"px"),s.index<e&&i&&i.left&&(i.left=parseInt(i.left,10)-l+"px")):(s.index>e&&i&&i.left&&(i.left=parseInt(i.left,10)-l+"px"),s.index<e&&i&&i.right&&(i.right=parseInt(i.right,10)-l+"px"))})}})}}exports.ColumnResize=g;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
class u {
|
|
10
|
+
constructor(f) {
|
|
11
|
+
this.columns = [], this.resizable = !1, this.isRtl = !1, this.setIsRtl = (c) => {
|
|
12
|
+
this.isRtl = c;
|
|
13
|
+
}, this.dragHandler = (c, l, e, h) => {
|
|
14
|
+
const t = c.originalEvent;
|
|
15
|
+
h || (t.preventDefault(), t.stopPropagation(), t.stopImmediatePropagation());
|
|
16
|
+
const o = e.closest("th");
|
|
17
|
+
if (!o || !o)
|
|
18
|
+
return;
|
|
19
|
+
const s = o.clientWidth;
|
|
20
|
+
let n = s;
|
|
21
|
+
if (this.isRtl ? n += e.getBoundingClientRect().right - e.offsetWidth / 2 - c.clientX : n += c.clientX - e.getBoundingClientRect().left - e.offsetWidth / 2, !h && Math.abs(n - s) < 1)
|
|
22
|
+
return;
|
|
23
|
+
this.fixateInitialWidths(o.parentElement.clientWidth), this.setWidths(l, Math.floor(n) / s);
|
|
24
|
+
const d = this.columns.filter((i) => !i.children.length).findIndex((i) => i.id === l.id);
|
|
25
|
+
this.onResize(d, s, n, t, h, l.id);
|
|
26
|
+
}, this.dblClickHandler = (c, l) => {
|
|
27
|
+
const e = this.columns.filter((r) => l.indexOf(r.id) > -1);
|
|
28
|
+
if (!this.colGroupMain || !e.length)
|
|
29
|
+
return;
|
|
30
|
+
const h = {}, t = e;
|
|
31
|
+
for (; t.length > 0; ) {
|
|
32
|
+
const r = t.pop();
|
|
33
|
+
if (!r)
|
|
34
|
+
break;
|
|
35
|
+
r.children.length ? t.push(...r.children) : h[r.id] = r;
|
|
36
|
+
}
|
|
37
|
+
const o = this.columns.filter((r) => !r.children.length), s = [];
|
|
38
|
+
o.forEach((r, a) => {
|
|
39
|
+
h[r.id] && s.push(a);
|
|
40
|
+
});
|
|
41
|
+
const n = [this.colGroupMain.parentElement], d = [this.colGroupMain];
|
|
42
|
+
this.colGroupHeader && (n.push(this.colGroupHeader.parentElement), d.push(this.colGroupHeader)), this.colGroupFooter && (n.push(this.colGroupFooter.parentElement), d.push(this.colGroupFooter)), n.forEach((r) => r.classList.add("k-autofitting"));
|
|
43
|
+
let i = [];
|
|
44
|
+
d.forEach((r) => {
|
|
45
|
+
s.forEach((a) => {
|
|
46
|
+
r.children[a] && (r.children[a].width = "", i[a] = Math.max(i[a] || 0, r.children[a].offsetWidth + 1));
|
|
47
|
+
});
|
|
48
|
+
}), d.forEach((r) => {
|
|
49
|
+
s.forEach((a) => {
|
|
50
|
+
r.children[a] && (r.children[a].width = i[a] + "px", o[a].width = i[a]);
|
|
51
|
+
});
|
|
52
|
+
}), n.forEach((r) => r.classList.remove("k-autofitting")), this.onResize(s[0], 0, 0, c, !0, l[0]);
|
|
53
|
+
}, this.updateColElements = (c) => {
|
|
54
|
+
const l = this.columns.filter((h) => !h.children.length);
|
|
55
|
+
let e = 1e-10;
|
|
56
|
+
for (let h = 0; h < c.length; h++) {
|
|
57
|
+
const t = c[h], o = l.findIndex((i) => i.id === t.id), s = parseFloat((t.width || 0).toString()), n = Math.floor(s);
|
|
58
|
+
e += s - n;
|
|
59
|
+
const d = n + Math.floor(e);
|
|
60
|
+
if (e -= Math.floor(e), this.colGroupMain && this.colGroupMain.children[o]) {
|
|
61
|
+
const i = parseInt(this.colGroupMain.children[o].width, 10);
|
|
62
|
+
this.colGroupMain.children[o].width = d + "px", this.updateNextLockedCol(
|
|
63
|
+
this.colGroupMain.parentElement,
|
|
64
|
+
t,
|
|
65
|
+
i - d
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
if (this.colGroupHeader && this.colGroupHeader.children[o]) {
|
|
69
|
+
const i = parseInt(this.colGroupHeader.children[o].width, 10);
|
|
70
|
+
this.colGroupHeader.children[o].width = d + "px", this.updateNextLockedCol(
|
|
71
|
+
this.colGroupHeader.parentElement,
|
|
72
|
+
t,
|
|
73
|
+
i - d
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
if (this.colGroupFooter && this.colGroupFooter.children[o]) {
|
|
77
|
+
const i = parseInt(this.colGroupFooter.children[o].width, 10);
|
|
78
|
+
this.colGroupFooter.children[o].width = d + "px", this.updateNextLockedCol(
|
|
79
|
+
this.colGroupFooter.parentElement,
|
|
80
|
+
t,
|
|
81
|
+
i - d
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, this.onResize = f;
|
|
86
|
+
}
|
|
87
|
+
fixateInitialWidths(f) {
|
|
88
|
+
const c = this.columns.filter((t) => !t.children.length);
|
|
89
|
+
let l = 0, e = this.colGroupMain ? this.colGroupMain.children : [];
|
|
90
|
+
for (let t = 0; t < e.length; t++)
|
|
91
|
+
e[t].width ? f -= parseFloat(e[t].width) : l++;
|
|
92
|
+
if (l === 0)
|
|
93
|
+
return;
|
|
94
|
+
const h = Math.floor(f / l);
|
|
95
|
+
for (let t = 0; t < e.length; t++) {
|
|
96
|
+
const o = e[t];
|
|
97
|
+
o.width || (o.width = h, c[t].width = h.toString(), this.colGroupHeader && (this.colGroupHeader.children[t].width = h), this.colGroupFooter && (this.colGroupFooter.children[t].width = h));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
setWidths(f, c) {
|
|
101
|
+
const l = this.columns.findIndex((t) => t.id === f.id), e = [];
|
|
102
|
+
let h = f.children.length;
|
|
103
|
+
for (let t = l + 1; h > 0 && t < this.columns.length; t++, h--) {
|
|
104
|
+
const o = this.columns[t];
|
|
105
|
+
o.children.length ? h += o.children.length : e.push(o);
|
|
106
|
+
}
|
|
107
|
+
return e.length === 0 && e.push(f), e.forEach((t) => {
|
|
108
|
+
let o = t.width ? parseFloat(t.width.toString()) * c : 0;
|
|
109
|
+
const s = t.minResizableWidth === void 0 ? 10 : t.minResizableWidth;
|
|
110
|
+
o < s && (o = s), t.width = o;
|
|
111
|
+
}), this.updateColElements(e), e;
|
|
112
|
+
}
|
|
113
|
+
updateNextLockedCol(f, c, l) {
|
|
114
|
+
const e = c.index, h = this.colGroupMain.parentElement.closest(".k-grid"), t = h == null ? void 0 : h.clientWidth, o = this.columns.filter((s) => s.locked).map((s) => parseInt(s.width + "", 10)).reduce((s, n) => s + n, 0);
|
|
115
|
+
!c.locked || t <= o + 20 || this.columns.forEach((s) => {
|
|
116
|
+
if (s != null && s.locked && l) {
|
|
117
|
+
const n = f == null ? void 0 : f.querySelectorAll('[aria-colindex="' + s.ariaColumnIndex + '"]');
|
|
118
|
+
n == null || n.forEach((d) => {
|
|
119
|
+
const i = d.style;
|
|
120
|
+
this.isRtl ? (s.index > e && i && i.right && (i.right = parseInt(i.right, 10) - l + "px"), s.index < e && i && i.left && (i.left = parseInt(i.left, 10) - l + "px")) : (s.index > e && i && i.left && (i.left = parseInt(i.left, 10) - l + "px"), s.index < e && i && i.right && (i.right = parseInt(i.right, 10) - l + "px"));
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
u as ColumnResize
|
|
128
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),h=require("@progress/kendo-react-data-tools");function g(l){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const e in l)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(l,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:()=>l[e]})}}return r.default=l,Object.freeze(r)}const c=g(p);class d{constructor(r,e,i){this.refDragElementClue=c.createRef(),this.refDropElementClue=c.createRef(),this.columns=[],this.reorderable=!1,this.groupable=!1,this.startColumn=-1,this.startGroup=-1,this.currentColumn=-1,this.currentGroup=-1,this.groupPanelDivElement=null,this.refGroupPanelDiv=t=>{this.groupPanelDivElement=t&&t.children?t.children[0]:t},this.pressHandler=(t,n)=>{const u=this.getColumnIndex(t,n);if(this.startGroup=this.getGroupIndex(t),u>=0){const s=this.columns[u];(s.reorderable&&this.reorderable||s.groupable&&this.groupable)&&(this.startColumn=u)}},this.dragHandler=(t,n)=>{if(t.isTouch||t.originalEvent.preventDefault(),t.originalEvent.stopPropagation(),this.startColumn===-1&&this.startGroup===-1)return;this.currentColumn=this.getColumnIndex(t,n);const u=this.groupPanelDivElement&&this.groupPanelDivElement.children;this.currentGroup=this.isTargetGroupingContainer(t)?u&&u.length?u.length:0:this.getGroupIndex(t);const s=!this.isValid();s&&(this.currentColumn=-1,this.currentGroup=-1);const o=this.currentColumn>=0?n.children[this.columns[this.currentColumn].index]:this.isTargetGroupingContainer(t)?t.originalEvent.target:this.groupPanelDivElement&&this.groupPanelDivElement.children[this.currentGroup];this.updateDragElementClue(t,n,o,s),this.updateDropElementClue(t,n,o,s)},this.releaseHandler=t=>{const n=this.startColumn,u=this.currentColumn,s=this.startGroup,o=this.currentGroup;t.originalEvent.preventDefault(),this.dropElementClue&&this.dropElementClue.setState({visible:!1}),this.dragElementClue&&this.dragElementClue.setState({visible:!1});const a=this.isValid();this.startColumn=this.startGroup=this.currentColumn=this.currentGroup=-1,a&&(n>=0&&u>=0?this.columnReorder(n,u,t.originalEvent):s>=0&&o>=0?this.groupReorder(s,o,t.originalEvent):n>=0&&o>=0&&this.columnToGroup(n,o,t.originalEvent))},this.columnReorder=r,this.groupReorder=e,this.columnToGroup=i}get dragClueRef(){return this.refDragElementClue}get dropClueRef(){return this.refDropElementClue}get dragElementClue(){return this.refDragElementClue.current}get dropElementClue(){return this.refDropElementClue.current}getColumnIndex(r,e){if(!e||e.parentElement===this.groupPanelDivElement)return-1;const i=h.getIndex(r,e);if(i===-1)return-1;for(let t=0;t<e.parentNode.children.length;t++)if(e.parentNode.children[t]===e)return this.columns.findIndex(n=>n.index===i&&n.depth===t);return-1}isTargetGroupingContainer(r){const e=r.originalEvent.target;return e.className.indexOf?e.className.indexOf("k-grouping-drop-container")!==-1:!1}getGroupIndex(r){return h.getIndex(r,this.groupPanelDivElement)}isValid(){return this.startGroup>=0?this.currentGroup>=0&&this.currentGroup!==this.startGroup:this.startColumn===-1?!1:this.currentGroup>=0?this.columns[this.startColumn].groupable===!0&&this.groupable===!0:this.reorderable===!0&&this.currentColumn>=0&&this.currentColumn!==this.startColumn&&this.columns[this.startColumn].reorderable===!0&&this.columns[this.currentColumn].parentIndex===this.columns[this.startColumn].parentIndex}updateDragElementClue(r,e,i,t){if(!this.dragElementClue)return;const n=this.startColumn>=0?e.children[this.columns[this.startColumn].index].innerText:e.innerText;this.dragElementClue.setState({visible:!0,top:r.pageY+10,left:r.pageX,innerText:n,status:t||!i?"k-i-cancel":"k-i-plus"})}updateDropElementClue(r,e,i,t){if(!this.dropElementClue)return;if(t||!i){this.dropElementClue.setState({visible:!1});return}const n=i.getBoundingClientRect(),s=(i.closest(".k-grouping-header")||i).getBoundingClientRect();let o=n.left+r.pageX-r.clientX-6;!this.isTargetGroupingContainer(r)&&(this.currentColumn>this.startColumn||this.currentGroup>this.startGroup&&this.startGroup!==-1)&&(o+=n.width);const a=s.top+r.pageY-r.clientY;this.dropElementClue.setState({visible:!0,top:a,left:o,height:this.currentColumn>=0?e.clientHeight:s.height})}}exports.CommonDragLogic=d;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as h from "react";
|
|
10
|
+
import { getIndex as a } from "@progress/kendo-react-data-tools";
|
|
11
|
+
class g {
|
|
12
|
+
constructor(r, i, s) {
|
|
13
|
+
this.refDragElementClue = h.createRef(), this.refDropElementClue = h.createRef(), this.columns = [], this.reorderable = !1, this.groupable = !1, this.startColumn = -1, this.startGroup = -1, this.currentColumn = -1, this.currentGroup = -1, this.groupPanelDivElement = null, this.refGroupPanelDiv = (t) => {
|
|
14
|
+
this.groupPanelDivElement = t && t.children ? t.children[0] : t;
|
|
15
|
+
}, this.pressHandler = (t, e) => {
|
|
16
|
+
const u = this.getColumnIndex(t, e);
|
|
17
|
+
if (this.startGroup = this.getGroupIndex(t), u >= 0) {
|
|
18
|
+
const n = this.columns[u];
|
|
19
|
+
(n.reorderable && this.reorderable || n.groupable && this.groupable) && (this.startColumn = u);
|
|
20
|
+
}
|
|
21
|
+
}, this.dragHandler = (t, e) => {
|
|
22
|
+
if (t.isTouch || t.originalEvent.preventDefault(), t.originalEvent.stopPropagation(), this.startColumn === -1 && this.startGroup === -1)
|
|
23
|
+
return;
|
|
24
|
+
this.currentColumn = this.getColumnIndex(t, e);
|
|
25
|
+
const u = this.groupPanelDivElement && this.groupPanelDivElement.children;
|
|
26
|
+
this.currentGroup = this.isTargetGroupingContainer(t) ? u && u.length ? u.length : 0 : this.getGroupIndex(t);
|
|
27
|
+
const n = !this.isValid();
|
|
28
|
+
n && (this.currentColumn = -1, this.currentGroup = -1);
|
|
29
|
+
const l = this.currentColumn >= 0 ? e.children[this.columns[this.currentColumn].index] : this.isTargetGroupingContainer(t) ? t.originalEvent.target : this.groupPanelDivElement && this.groupPanelDivElement.children[this.currentGroup];
|
|
30
|
+
this.updateDragElementClue(t, e, l, n), this.updateDropElementClue(t, e, l, n);
|
|
31
|
+
}, this.releaseHandler = (t) => {
|
|
32
|
+
const e = this.startColumn, u = this.currentColumn, n = this.startGroup, l = this.currentGroup;
|
|
33
|
+
t.originalEvent.preventDefault(), this.dropElementClue && this.dropElementClue.setState({ visible: !1 }), this.dragElementClue && this.dragElementClue.setState({ visible: !1 });
|
|
34
|
+
const o = this.isValid();
|
|
35
|
+
this.startColumn = this.startGroup = this.currentColumn = this.currentGroup = -1, o && (e >= 0 && u >= 0 ? this.columnReorder(e, u, t.originalEvent) : n >= 0 && l >= 0 ? this.groupReorder(n, l, t.originalEvent) : e >= 0 && l >= 0 && this.columnToGroup(e, l, t.originalEvent));
|
|
36
|
+
}, this.columnReorder = r, this.groupReorder = i, this.columnToGroup = s;
|
|
37
|
+
}
|
|
38
|
+
get dragClueRef() {
|
|
39
|
+
return this.refDragElementClue;
|
|
40
|
+
}
|
|
41
|
+
get dropClueRef() {
|
|
42
|
+
return this.refDropElementClue;
|
|
43
|
+
}
|
|
44
|
+
get dragElementClue() {
|
|
45
|
+
return this.refDragElementClue.current;
|
|
46
|
+
}
|
|
47
|
+
get dropElementClue() {
|
|
48
|
+
return this.refDropElementClue.current;
|
|
49
|
+
}
|
|
50
|
+
getColumnIndex(r, i) {
|
|
51
|
+
if (!i || i.parentElement === this.groupPanelDivElement)
|
|
52
|
+
return -1;
|
|
53
|
+
const s = a(r, i);
|
|
54
|
+
if (s === -1)
|
|
55
|
+
return -1;
|
|
56
|
+
for (let t = 0; t < i.parentNode.children.length; t++)
|
|
57
|
+
if (i.parentNode.children[t] === i)
|
|
58
|
+
return this.columns.findIndex((e) => e.index === s && e.depth === t);
|
|
59
|
+
return -1;
|
|
60
|
+
}
|
|
61
|
+
isTargetGroupingContainer(r) {
|
|
62
|
+
const i = r.originalEvent.target;
|
|
63
|
+
return i.className.indexOf ? i.className.indexOf("k-grouping-drop-container") !== -1 : !1;
|
|
64
|
+
}
|
|
65
|
+
getGroupIndex(r) {
|
|
66
|
+
return a(r, this.groupPanelDivElement);
|
|
67
|
+
}
|
|
68
|
+
isValid() {
|
|
69
|
+
return this.startGroup >= 0 ? this.currentGroup >= 0 && this.currentGroup !== this.startGroup : this.startColumn === -1 ? !1 : this.currentGroup >= 0 ? this.columns[this.startColumn].groupable === !0 && this.groupable === !0 : this.reorderable === !0 && this.currentColumn >= 0 && this.currentColumn !== this.startColumn && this.columns[this.startColumn].reorderable === !0 && this.columns[this.currentColumn].parentIndex === this.columns[this.startColumn].parentIndex;
|
|
70
|
+
}
|
|
71
|
+
updateDragElementClue(r, i, s, t) {
|
|
72
|
+
if (!this.dragElementClue)
|
|
73
|
+
return;
|
|
74
|
+
const e = this.startColumn >= 0 ? i.children[this.columns[this.startColumn].index].innerText : i.innerText;
|
|
75
|
+
this.dragElementClue.setState({
|
|
76
|
+
visible: !0,
|
|
77
|
+
top: r.pageY + 10,
|
|
78
|
+
left: r.pageX,
|
|
79
|
+
innerText: e,
|
|
80
|
+
status: t || !s ? "k-i-cancel" : "k-i-plus"
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
updateDropElementClue(r, i, s, t) {
|
|
84
|
+
if (!this.dropElementClue)
|
|
85
|
+
return;
|
|
86
|
+
if (t || !s) {
|
|
87
|
+
this.dropElementClue.setState({ visible: !1 });
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const e = s.getBoundingClientRect(), n = (s.closest(".k-grouping-header") || s).getBoundingClientRect();
|
|
91
|
+
let l = e.left + r.pageX - r.clientX - 6;
|
|
92
|
+
!this.isTargetGroupingContainer(r) && (this.currentColumn > this.startColumn || this.currentGroup > this.startGroup && this.startGroup !== -1) && (l += e.width);
|
|
93
|
+
const o = n.top + r.pageY - r.clientY;
|
|
94
|
+
this.dropElementClue.setState({
|
|
95
|
+
visible: !0,
|
|
96
|
+
top: o,
|
|
97
|
+
left: l,
|
|
98
|
+
height: this.currentColumn >= 0 ? i.clientHeight : n.height
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
g as CommonDragLogic
|
|
104
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),o=require("@progress/kendo-react-common"),l=require("@progress/kendo-react-intl"),r=require("@progress/kendo-svg-icons");function p(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const s=p(c);class a extends s.Component{constructor(){super(...arguments),this.draggable=null,this.onPress=e=>{const t=this.draggable&&this.draggable.element;t&&this.props.onPress&&this.props.onPress(e.event,t)},this.onDrag=e=>{const t=this.draggable&&this.draggable.element;t&&this.props.onDrag&&this.props.onDrag(e.event,t)},this.onRelease=e=>{this.draggable&&this.draggable.element&&this.props.onRelease&&this.props.onRelease(e.event)},this.sortChange=e=>{if(e.preventDefault(),this.props.onSortChange){const t=this.props.dir==="asc"?"desc":"asc";this.props.onSortChange(e,t)}},this.groupRemove=e=>{e.preventDefault(),e.stopPropagation(),this.props.onRemove&&this.props.onRemove(e)},this.onContextMenu=e=>{const t={title:this.props.title,dir:this.props.dir,index:this.props.index};this.props.onContextMenu&&this.props.onContextMenu.call(void 0,e,{dataItem:{...t}})}}render(){const{dir:e}=this.props;return s.createElement(o.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,ref:t=>{this.draggable=t}},s.createElement("div",{className:"k-chip k-chip-md k-chip-solid k-chip-solid-base k-rounded-md",onClick:this.sortChange,onContextMenu:this.onContextMenu,role:"button",style:{touchAction:"none"}},s.createElement("span",null,s.createElement(o.IconWrap,{name:"sort-"+e+"-small",icon:e==="asc"?r.sortAscSmallIcon:r.sortDescSmallIcon,size:"small"})),s.createElement("span",{className:"k-chip-content"},this.props.title),s.createElement("span",{className:"k-chip-actions"},s.createElement("span",{className:"k-chip-action k-chip-remove-action",onClick:this.groupRemove},s.createElement(o.IconWrap,{name:"x-circle",icon:r.xCircleIcon,size:"small"})))))}}l.registerForLocalization(a);exports.GroupingIndicator=a;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as s from "react";
|
|
10
|
+
import { Draggable as n, IconWrap as o } from "@progress/kendo-react-common";
|
|
11
|
+
import { registerForLocalization as r } from "@progress/kendo-react-intl";
|
|
12
|
+
import { sortAscSmallIcon as i, sortDescSmallIcon as a, xCircleIcon as l } from "@progress/kendo-svg-icons";
|
|
13
|
+
class p extends s.Component {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.draggable = null, this.onPress = (e) => {
|
|
16
|
+
const t = this.draggable && this.draggable.element;
|
|
17
|
+
t && this.props.onPress && this.props.onPress(e.event, t);
|
|
18
|
+
}, this.onDrag = (e) => {
|
|
19
|
+
const t = this.draggable && this.draggable.element;
|
|
20
|
+
t && this.props.onDrag && this.props.onDrag(e.event, t);
|
|
21
|
+
}, this.onRelease = (e) => {
|
|
22
|
+
this.draggable && this.draggable.element && this.props.onRelease && this.props.onRelease(e.event);
|
|
23
|
+
}, this.sortChange = (e) => {
|
|
24
|
+
if (e.preventDefault(), this.props.onSortChange) {
|
|
25
|
+
const t = this.props.dir === "asc" ? "desc" : "asc";
|
|
26
|
+
this.props.onSortChange(e, t);
|
|
27
|
+
}
|
|
28
|
+
}, this.groupRemove = (e) => {
|
|
29
|
+
e.preventDefault(), e.stopPropagation(), this.props.onRemove && this.props.onRemove(e);
|
|
30
|
+
}, this.onContextMenu = (e) => {
|
|
31
|
+
const t = {
|
|
32
|
+
title: this.props.title,
|
|
33
|
+
dir: this.props.dir,
|
|
34
|
+
index: this.props.index
|
|
35
|
+
};
|
|
36
|
+
this.props.onContextMenu && this.props.onContextMenu.call(void 0, e, { dataItem: { ...t } });
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
const { dir: e } = this.props;
|
|
41
|
+
return /* @__PURE__ */ s.createElement(
|
|
42
|
+
n,
|
|
43
|
+
{
|
|
44
|
+
onPress: this.onPress,
|
|
45
|
+
onDrag: this.onDrag,
|
|
46
|
+
onRelease: this.onRelease,
|
|
47
|
+
ref: (t) => {
|
|
48
|
+
this.draggable = t;
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
/* @__PURE__ */ s.createElement(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
className: "k-chip k-chip-md k-chip-solid k-chip-solid-base k-rounded-md",
|
|
55
|
+
onClick: this.sortChange,
|
|
56
|
+
onContextMenu: this.onContextMenu,
|
|
57
|
+
role: "button",
|
|
58
|
+
style: { touchAction: "none" }
|
|
59
|
+
},
|
|
60
|
+
/* @__PURE__ */ s.createElement("span", null, /* @__PURE__ */ s.createElement(
|
|
61
|
+
o,
|
|
62
|
+
{
|
|
63
|
+
name: "sort-" + e + "-small",
|
|
64
|
+
icon: e === "asc" ? i : a,
|
|
65
|
+
size: "small"
|
|
66
|
+
}
|
|
67
|
+
)),
|
|
68
|
+
/* @__PURE__ */ s.createElement("span", { className: "k-chip-content" }, this.props.title),
|
|
69
|
+
/* @__PURE__ */ s.createElement("span", { className: "k-chip-actions" }, /* @__PURE__ */ s.createElement(
|
|
70
|
+
"span",
|
|
71
|
+
{
|
|
72
|
+
className: "k-chip-action k-chip-remove-action",
|
|
73
|
+
onClick: this.groupRemove
|
|
74
|
+
},
|
|
75
|
+
/* @__PURE__ */ s.createElement(
|
|
76
|
+
o,
|
|
77
|
+
{
|
|
78
|
+
name: "x-circle",
|
|
79
|
+
icon: l,
|
|
80
|
+
size: "small"
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
))
|
|
84
|
+
)
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
r(p);
|
|
89
|
+
export {
|
|
90
|
+
p as GroupingIndicator
|
|
91
|
+
};
|
package/filterCommon.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./messages/index.js"),s=[{text:"grid.filterAndLogic",operator:"and"},{text:"grid.filterOrLogic",operator:"or"}],f={text:[{text:"grid.filterContainsOperator",operator:"contains"},{text:"grid.filterNotContainsOperator",operator:"doesnotcontain"},{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterStartsWithOperator",operator:"startswith"},{text:"grid.filterEndsWithOperator",operator:"endswith"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"},{text:"grid.filterIsEmptyOperator",operator:"isempty"},{text:"grid.filterIsNotEmptyOperator",operator:"isnotempty"}],numeric:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterGteOperator",operator:"gte"},{text:"grid.filterGtOperator",operator:"gt"},{text:"grid.filterLteOperator",operator:"lte"},{text:"grid.filterLtOperator",operator:"lt"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],date:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterAfterOrEqualOperator",operator:"gte"},{text:"grid.filterAfterOperator",operator:"gt"},{text:"grid.filterBeforeOperator",operator:"lt"},{text:"grid.filterBeforeOrEqualOperator",operator:"lte"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],boolean:[{text:"grid.filterEqOperator",operator:"eq"}]},i=t=>t==="isnull"||t==="isnotnull"||t==="isempty"||t==="isnotempty",g=(t,o)=>t.map(r=>({text:o.toLanguageString(r.text,p.messages[r.text]),operator:r.operator})),l="eq",d=[{text:"grid.filterBooleanAll",operator:""},{text:"grid.filterIsTrue",operator:!0},{text:"grid.filterIsFalse",operator:!1}],u={text:!1,numeric:!1,date:!1,boolean:!0},c=(t,o,r)=>{const a=n(r.operators);let e=r.operator;switch(r.filterType){case"numeric":(!e||i(e))&&(e=a),t===null&&e===a&&(e="");break;case"date":(!e||i(e))&&(e=a),t===null&&e===a&&(e="");break;case"text":(!e||i(e))&&(e=a),!t&&e===a&&(e="");break;default:return}r.onChange({value:t,operator:e,syntheticEvent:o})},n=(t,o)=>o?t[o][0].operator:t[0].operator,x=t=>t||"text",O=(t,o)=>{const r=t.target.value;o({value:r.operator,operator:r.operator===""?"":l,syntheticEvent:t.syntheticEvent})},q=(t,o,r)=>{let a=o;const e=t.target.value;t.target.state.opened&&(i(e.operator)&&(a=null),o===null&&!i(e.operator)&&(a=void 0),r({value:a,operator:e.operator,syntheticEvent:t.syntheticEvent}))};exports.IsUnaryFilter=i;exports.booleanFilterValues=d;exports.cellBoolDropdownChange=O;exports.cellInputChange=c;exports.cellOperatorChange=q;exports.defaultBooleanOperator=l;exports.defaultHideSecondFilter=u;exports.filterLogicList=s;exports.getDefaultOperator=n;exports.getFilterType=x;exports.operatorMap=g;exports.operators=f;
|
package/filterCommon.mjs
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import { messages as l } from "./messages/index.mjs";
|
|
10
|
+
const f = [
|
|
11
|
+
{ text: "grid.filterAndLogic", operator: "and" },
|
|
12
|
+
{ text: "grid.filterOrLogic", operator: "or" }
|
|
13
|
+
], g = {
|
|
14
|
+
text: [
|
|
15
|
+
{ text: "grid.filterContainsOperator", operator: "contains" },
|
|
16
|
+
{ text: "grid.filterNotContainsOperator", operator: "doesnotcontain" },
|
|
17
|
+
{ text: "grid.filterEqOperator", operator: "eq" },
|
|
18
|
+
{ text: "grid.filterNotEqOperator", operator: "neq" },
|
|
19
|
+
{ text: "grid.filterStartsWithOperator", operator: "startswith" },
|
|
20
|
+
{ text: "grid.filterEndsWithOperator", operator: "endswith" },
|
|
21
|
+
{ text: "grid.filterIsNullOperator", operator: "isnull" },
|
|
22
|
+
{ text: "grid.filterIsNotNullOperator", operator: "isnotnull" },
|
|
23
|
+
{ text: "grid.filterIsEmptyOperator", operator: "isempty" },
|
|
24
|
+
{ text: "grid.filterIsNotEmptyOperator", operator: "isnotempty" }
|
|
25
|
+
],
|
|
26
|
+
numeric: [
|
|
27
|
+
{ text: "grid.filterEqOperator", operator: "eq" },
|
|
28
|
+
{ text: "grid.filterNotEqOperator", operator: "neq" },
|
|
29
|
+
{ text: "grid.filterGteOperator", operator: "gte" },
|
|
30
|
+
{ text: "grid.filterGtOperator", operator: "gt" },
|
|
31
|
+
{ text: "grid.filterLteOperator", operator: "lte" },
|
|
32
|
+
{ text: "grid.filterLtOperator", operator: "lt" },
|
|
33
|
+
{ text: "grid.filterIsNullOperator", operator: "isnull" },
|
|
34
|
+
{ text: "grid.filterIsNotNullOperator", operator: "isnotnull" }
|
|
35
|
+
],
|
|
36
|
+
date: [
|
|
37
|
+
{ text: "grid.filterEqOperator", operator: "eq" },
|
|
38
|
+
{ text: "grid.filterNotEqOperator", operator: "neq" },
|
|
39
|
+
{ text: "grid.filterAfterOrEqualOperator", operator: "gte" },
|
|
40
|
+
{ text: "grid.filterAfterOperator", operator: "gt" },
|
|
41
|
+
{ text: "grid.filterBeforeOperator", operator: "lt" },
|
|
42
|
+
{ text: "grid.filterBeforeOrEqualOperator", operator: "lte" },
|
|
43
|
+
{ text: "grid.filterIsNullOperator", operator: "isnull" },
|
|
44
|
+
{ text: "grid.filterIsNotNullOperator", operator: "isnotnull" }
|
|
45
|
+
],
|
|
46
|
+
boolean: [
|
|
47
|
+
{ text: "grid.filterEqOperator", operator: "eq" }
|
|
48
|
+
]
|
|
49
|
+
}, i = (t) => t === "isnull" || t === "isnotnull" || t === "isempty" || t === "isnotempty", d = (t, o) => t.map((e) => ({
|
|
50
|
+
text: o.toLanguageString(e.text, l[e.text]),
|
|
51
|
+
operator: e.operator
|
|
52
|
+
})), n = "eq", u = [
|
|
53
|
+
{ text: "grid.filterBooleanAll", operator: "" },
|
|
54
|
+
{ text: "grid.filterIsTrue", operator: !0 },
|
|
55
|
+
{ text: "grid.filterIsFalse", operator: !1 }
|
|
56
|
+
], x = {
|
|
57
|
+
text: !1,
|
|
58
|
+
numeric: !1,
|
|
59
|
+
date: !1,
|
|
60
|
+
boolean: !0
|
|
61
|
+
}, c = (t, o, e) => {
|
|
62
|
+
const a = p(e.operators);
|
|
63
|
+
let r = e.operator;
|
|
64
|
+
switch (e.filterType) {
|
|
65
|
+
case "numeric":
|
|
66
|
+
(!r || i(r)) && (r = a), t === null && r === a && (r = "");
|
|
67
|
+
break;
|
|
68
|
+
case "date":
|
|
69
|
+
(!r || i(r)) && (r = a), t === null && r === a && (r = "");
|
|
70
|
+
break;
|
|
71
|
+
case "text":
|
|
72
|
+
(!r || i(r)) && (r = a), !t && r === a && (r = "");
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
e.onChange({ value: t, operator: r, syntheticEvent: o });
|
|
78
|
+
}, p = (t, o) => o ? t[o][0].operator : t[0].operator, O = (t) => t || "text", q = (t, o) => {
|
|
79
|
+
const e = t.target.value;
|
|
80
|
+
o({
|
|
81
|
+
value: e.operator,
|
|
82
|
+
operator: e.operator === "" ? "" : n,
|
|
83
|
+
syntheticEvent: t.syntheticEvent
|
|
84
|
+
});
|
|
85
|
+
}, E = (t, o, e) => {
|
|
86
|
+
let a = o;
|
|
87
|
+
const r = t.target.value;
|
|
88
|
+
t.target.state.opened && (i(r.operator) && (a = null), o === null && !i(r.operator) && (a = void 0), e({ value: a, operator: r.operator, syntheticEvent: t.syntheticEvent }));
|
|
89
|
+
};
|
|
90
|
+
export {
|
|
91
|
+
i as IsUnaryFilter,
|
|
92
|
+
u as booleanFilterValues,
|
|
93
|
+
q as cellBoolDropdownChange,
|
|
94
|
+
c as cellInputChange,
|
|
95
|
+
E as cellOperatorChange,
|
|
96
|
+
n as defaultBooleanOperator,
|
|
97
|
+
x as defaultHideSecondFilter,
|
|
98
|
+
f as filterLogicList,
|
|
99
|
+
p as getDefaultOperator,
|
|
100
|
+
O as getFilterType,
|
|
101
|
+
d as operatorMap,
|
|
102
|
+
g as operators
|
|
103
|
+
};
|
package/footer/Footer.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@progress/kendo-react-common"),l=require("react");function i(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const o in r)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(r,o);Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>r[o]})}}return e.default=r,Object.freeze(e)}const t=i(l);class n extends t.Component{constructor(){super(...arguments),this.footerWrap=null,this.table=null,this.scrollbarWidth=s.getScrollbarWidth()}componentDidMount(){this.setState({})}setScrollLeft(e){this.footerWrap&&(this.footerWrap.scrollLeft=e)}setWidth(e){this.table&&(this.table.style.width=e+"px")}render(){return this.props.staticHeaders?t.createElement("div",{className:"k-grid-footer",role:"presentation"},t.createElement("div",{ref:e=>{this.footerWrap=e},className:"k-grid-footer-wrap",style:this.scrollbarWidth?{}:{borderWidth:0},role:"presentation"},t.createElement("table",{ref:e=>{this.table=e},className:s.classNames("k-table k-grid-footer-table",{"k-table-md":!this.props.size,[`k-table-${s.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),role:"presentation"},t.createElement("colgroup",{ref:e=>{this.props.columnResize.colGroupFooter=e},role:"presentation"},this.props.cols),t.createElement("tfoot",{className:"k-table-tfoot",role:"presentation"},this.props.row)))):t.createElement("tfoot",{className:"k-table-tfoot"},this.props.row)}}exports.Footer=n;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import { getScrollbarWidth as s, classNames as r, kendoThemeMaps as o } from "@progress/kendo-react-common";
|
|
10
|
+
import * as t from "react";
|
|
11
|
+
class l extends t.Component {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.footerWrap = null, this.table = null, this.scrollbarWidth = s();
|
|
14
|
+
}
|
|
15
|
+
componentDidMount() {
|
|
16
|
+
this.setState({});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param scrollLeft - Scrolls to the left (in pixels).
|
|
21
|
+
*/
|
|
22
|
+
setScrollLeft(e) {
|
|
23
|
+
this.footerWrap && (this.footerWrap.scrollLeft = e);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param width - Scrolls the width (in pixels).
|
|
28
|
+
*/
|
|
29
|
+
setWidth(e) {
|
|
30
|
+
this.table && (this.table.style.width = e + "px");
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
return this.props.staticHeaders ? /* @__PURE__ */ t.createElement(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
className: "k-grid-footer",
|
|
37
|
+
role: "presentation"
|
|
38
|
+
},
|
|
39
|
+
/* @__PURE__ */ t.createElement(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
ref: (e) => {
|
|
43
|
+
this.footerWrap = e;
|
|
44
|
+
},
|
|
45
|
+
className: "k-grid-footer-wrap",
|
|
46
|
+
style: this.scrollbarWidth ? {} : { borderWidth: 0 },
|
|
47
|
+
role: "presentation"
|
|
48
|
+
},
|
|
49
|
+
/* @__PURE__ */ t.createElement(
|
|
50
|
+
"table",
|
|
51
|
+
{
|
|
52
|
+
ref: (e) => {
|
|
53
|
+
this.table = e;
|
|
54
|
+
},
|
|
55
|
+
className: r(
|
|
56
|
+
"k-table k-grid-footer-table",
|
|
57
|
+
{
|
|
58
|
+
"k-table-md": !this.props.size,
|
|
59
|
+
[`k-table-${o.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
60
|
+
},
|
|
61
|
+
this.props.className
|
|
62
|
+
),
|
|
63
|
+
role: "presentation"
|
|
64
|
+
},
|
|
65
|
+
/* @__PURE__ */ t.createElement("colgroup", { ref: (e) => {
|
|
66
|
+
this.props.columnResize.colGroupFooter = e;
|
|
67
|
+
}, role: "presentation" }, this.props.cols),
|
|
68
|
+
/* @__PURE__ */ t.createElement("tfoot", { className: "k-table-tfoot", role: "presentation" }, this.props.row)
|
|
69
|
+
)
|
|
70
|
+
)
|
|
71
|
+
) : /* @__PURE__ */ t.createElement("tfoot", { className: "k-table-tfoot" }, this.props.row);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
l as Footer
|
|
76
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),a=require("../utils/index.js"),d=require("@progress/kendo-react-common");function f(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,l.get?l:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const o=f(c);class p extends o.Component{constructor(){super(...arguments),this._element=null,this.renderCell=(e,t)=>{const l={colSpan:e.colSpan!==1?e.colSpan:void 0,style:e.left!==void 0?this.props.isRtl?{left:e.right,right:e.left}:{left:e.left,right:e.right}:{},className:d.classNames("k-table-td",e.locked&&e.left!==void 0?"k-grid-footer-sticky":""),key:t,role:"gridcell","aria-colindex":e.ariaColumnIndex},n={field:e.field,ariaColumnIndex:e.ariaColumnIndex,...l},s=a.resolveCells(this.props.cells,e.cells);if(s&&s.footerCell){const i=s.footerCell;return o.createElement(i,{...n,tdProps:l,index:t})}return e.footerCell&&o.createElement(e.footerCell,{...n,key:t})||o.createElement("td",{...l})}}get element(){return this._element}render(){return o.createElement("tr",{className:"k-table-row",role:"row","aria-rowindex":this.props.ariaRowIndex},a.footerColumns(this.props.columns).map(this.renderCell))}}exports.FooterRow=p;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import { resolveCells as i, footerColumns as n } from "../utils/index.mjs";
|
|
11
|
+
import { classNames as p } from "@progress/kendo-react-common";
|
|
12
|
+
class c extends t.Component {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments), this._element = null, this.renderCell = (e, r) => {
|
|
15
|
+
const l = {
|
|
16
|
+
colSpan: e.colSpan !== 1 ? e.colSpan : void 0,
|
|
17
|
+
style: e.left !== void 0 ? this.props.isRtl ? { left: e.right, right: e.left } : { left: e.left, right: e.right } : {},
|
|
18
|
+
className: p(
|
|
19
|
+
"k-table-td",
|
|
20
|
+
e.locked && e.left !== void 0 ? "k-grid-footer-sticky" : ""
|
|
21
|
+
),
|
|
22
|
+
key: r,
|
|
23
|
+
role: "gridcell",
|
|
24
|
+
"aria-colindex": e.ariaColumnIndex
|
|
25
|
+
}, o = {
|
|
26
|
+
field: e.field,
|
|
27
|
+
ariaColumnIndex: e.ariaColumnIndex,
|
|
28
|
+
...l
|
|
29
|
+
}, s = i(this.props.cells, e.cells);
|
|
30
|
+
if (s && s.footerCell) {
|
|
31
|
+
const a = s.footerCell;
|
|
32
|
+
return /* @__PURE__ */ t.createElement(a, { ...o, tdProps: l, index: r });
|
|
33
|
+
}
|
|
34
|
+
return e.footerCell && /* @__PURE__ */ t.createElement(e.footerCell, { ...o, key: r }) || /* @__PURE__ */ t.createElement("td", { ...l });
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
get element() {
|
|
38
|
+
return this._element;
|
|
39
|
+
}
|
|
40
|
+
render() {
|
|
41
|
+
return /* @__PURE__ */ t.createElement("tr", { className: "k-table-row", role: "row", "aria-rowindex": this.props.ariaRowIndex }, n(this.props.columns).map(this.renderCell));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
c as FooterRow
|
|
46
|
+
};
|