react-table-edit 1.5.45 → 1.5.46
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/dist/index.js +56 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +56 -26
- package/dist/index.mjs.map +1 -1
- package/dist/styles/date-picker.css +74 -771
- package/dist/styles/date-picker.css.map +1 -1
- package/dist/styles/form-wizard.css.map +1 -1
- package/dist/styles/index.css +341 -840
- package/dist/styles/index.css.map +1 -1
- package/dist/styles/select-table.css.map +1 -1
- package/dist/styles/sidebar.css +14 -0
- package/dist/styles/sidebar.css.map +1 -1
- package/dist/styles/tab-menu.css.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -69671,7 +69671,7 @@ const RenderContentCol = React__default["default"].memo((props) => {
|
|
|
69671
69671
|
});
|
|
69672
69672
|
|
|
69673
69673
|
const TableElement = React__default["default"].memo((props) => {
|
|
69674
|
-
const { contentColumns, dataSource, fieldKey, filterBy, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, orderBy, selectedRows, setContentColumns, setSelectedRows, formatSetting, gridRef, idTable, headerColumns, objHeaderWidthFixLeft, objHeaderWidthFixRight, isMulti, querySetting, searchSetting, searchTerm, columnsAggregate, haveSum, expandsAll, zeroVisiable, setFilterBy, setOrderBy, setExpandsAll, handleDoubleClick, handleCellClick, contextMenuItems, handleContextMenuClick, isLoading } = props;
|
|
69674
|
+
const { contentColumns, dataSource, fieldKey, filterBy, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, orderBy, selectedRows, setContentColumns, setSelectedRows, formatSetting, gridRef, idTable, headerColumns, objHeaderWidthFixLeft, objHeaderWidthFixRight, isMulti, querySetting, searchSetting, searchTerm, columnsAggregate, haveSum, expandsAll, zeroVisiable, setFilterBy, setOrderBy, setExpandsAll, handleDoubleClick, handleCellClick, contextMenuItems, handleContextMenuClick, isLoading, } = props;
|
|
69675
69675
|
const { t } = reactI18next.useTranslation();
|
|
69676
69676
|
const [context, setContext] = React$5.useState(null);
|
|
69677
69677
|
const virtualDivRef = React$5.useRef(null);
|
|
@@ -69717,7 +69717,10 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69717
69717
|
if (searchTerm) {
|
|
69718
69718
|
datas = datas.filter((row) => {
|
|
69719
69719
|
return searchSetting?.keyField?.some((key) => {
|
|
69720
|
-
return row[key]
|
|
69720
|
+
return row[key]
|
|
69721
|
+
?.toString()
|
|
69722
|
+
.toLowerCase()
|
|
69723
|
+
.includes(searchTerm.trim().toLowerCase());
|
|
69721
69724
|
});
|
|
69722
69725
|
});
|
|
69723
69726
|
}
|
|
@@ -69726,7 +69729,10 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69726
69729
|
return filterBy.every((filter) => {
|
|
69727
69730
|
const { key, value, ope } = filter;
|
|
69728
69731
|
const rowValue = row[key];
|
|
69729
|
-
if (rowValue === undefined ||
|
|
69732
|
+
if (rowValue === undefined ||
|
|
69733
|
+
rowValue === null ||
|
|
69734
|
+
value === undefined ||
|
|
69735
|
+
value === null) {
|
|
69730
69736
|
return false;
|
|
69731
69737
|
}
|
|
69732
69738
|
const valStr = String(rowValue).toLowerCase();
|
|
@@ -69792,52 +69798,68 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69792
69798
|
}
|
|
69793
69799
|
let value = row[col.field];
|
|
69794
69800
|
if (col.type === 'numeric') {
|
|
69795
|
-
value =
|
|
69801
|
+
value =
|
|
69802
|
+
formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
|
|
69796
69803
|
}
|
|
69797
69804
|
else if (col.type === 'date') {
|
|
69798
|
-
value = value
|
|
69805
|
+
value = value
|
|
69806
|
+
? formatDateTime(value, formatSetting?.dateFormat)
|
|
69807
|
+
: '';
|
|
69799
69808
|
}
|
|
69800
69809
|
else if (col.type === 'datetime') {
|
|
69801
|
-
value = value
|
|
69810
|
+
value = value
|
|
69811
|
+
? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
|
|
69812
|
+
: '';
|
|
69802
69813
|
}
|
|
69803
69814
|
if (col.template) {
|
|
69804
69815
|
value = col.template(row, indexRow) ?? '';
|
|
69805
69816
|
}
|
|
69806
69817
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("tr", { "aria-rowindex": indexRow + 1, role: "row", className: "r-row", children: [jsxRuntime.jsx("td", { className: "r-rowcell r-cell-group", colSpan: 3, children: jsxRuntime.jsxs("div", { className: "r-rowcell-div", children: [jsxRuntime.jsx(SvgChevronRight, { style: {
|
|
69807
69818
|
marginLeft: level * 20,
|
|
69808
|
-
transform: expand ? 'rotate(90deg)' : 'rotate(0deg)'
|
|
69819
|
+
transform: expand ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
69809
69820
|
}, fontSize: 15, onClick: () => {
|
|
69810
69821
|
setExpand(!expand);
|
|
69811
69822
|
setExpandsAll(undefined);
|
|
69812
69823
|
row.expand = !expand;
|
|
69813
69824
|
} }), t(col.headerDisplay ?? col.headerText ?? ''), ": ", value, " (", row.children.length, ")"] }) }), contentColumns.map((colSum, indexCol) => {
|
|
69814
|
-
if (indexCol <= firstColSpan ||
|
|
69825
|
+
if (indexCol <= firstColSpan ||
|
|
69826
|
+
colSum.visible === false ||
|
|
69827
|
+
colSum.isGroup === true) {
|
|
69815
69828
|
return;
|
|
69816
69829
|
}
|
|
69817
69830
|
let sumValue = row[colSum.field];
|
|
69818
|
-
const haveSum = row[colSum.field] !== undefined &&
|
|
69819
|
-
|
|
69831
|
+
const haveSum = row[colSum.field] !== undefined &&
|
|
69832
|
+
row[colSum.field] !== null;
|
|
69833
|
+
if (!haveSum &&
|
|
69834
|
+
colSum.haveSum === true &&
|
|
69835
|
+
colSum.type === 'numeric') {
|
|
69820
69836
|
sumValue = row.children.reduce(function (accumulator, currentValue) {
|
|
69821
|
-
return Number(accumulator ?? 0) +
|
|
69837
|
+
return (Number(accumulator ?? 0) +
|
|
69838
|
+
Number(currentValue[colSum.field] ?? 0));
|
|
69822
69839
|
}, 0);
|
|
69823
69840
|
}
|
|
69824
69841
|
if (colSum.type === 'numeric') {
|
|
69825
69842
|
sumValue = formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', colSum.numericSettings?.fraction, true, false);
|
|
69826
|
-
if (!zeroVisiable &&
|
|
69843
|
+
if (!zeroVisiable &&
|
|
69844
|
+
!col.zeroVisiable &&
|
|
69845
|
+
(sumValue === '0' || sumValue === 0)) {
|
|
69827
69846
|
sumValue = '';
|
|
69828
69847
|
}
|
|
69829
69848
|
}
|
|
69830
69849
|
return (jsxRuntime.jsx("td", { className: "r-rowcell r-cell-sum-group", children: jsxRuntime.jsx("div", { className: "r-rowcell-div", style: {
|
|
69831
|
-
justifyContent: colSum.textAlign
|
|
69832
|
-
|
|
69833
|
-
|
|
69834
|
-
|
|
69835
|
-
|
|
69850
|
+
justifyContent: colSum.textAlign
|
|
69851
|
+
? colSum.textAlign
|
|
69852
|
+
: 'left',
|
|
69853
|
+
}, children: (haveSum || colSum.haveSum === true) &&
|
|
69854
|
+
Number(row[colSum.field] ?? '0') < 0 ? (jsxRuntime.jsx("div", { style: {
|
|
69855
|
+
color: formatSetting?.colorNegative ?? 'red',
|
|
69856
|
+
}, children: `${formatSetting?.prefixNegative ?? '-'}${sumValue}${formatSetting?.suffixNegative ?? ''}` })) : (sumValue) }) }, `group-sum-cell-${level}-${indexRow}-${indexCol}`));
|
|
69857
|
+
})] }), expand && (jsxRuntime.jsx(RenderContent, { datas: row.children, level: level + 1 }))] }, `row-${level}-${indexRow}`));
|
|
69836
69858
|
}
|
|
69837
69859
|
else {
|
|
69838
69860
|
const isSelected = selectedRows?.some((x) => x[fieldKey] === row[fieldKey]);
|
|
69839
69861
|
return (jsxRuntime.jsx("tr", { id: `row-content-${indexRow}`, "aria-rowindex": indexRow + 1, role: "row", className: classNames$1('r-row', {
|
|
69840
|
-
'r-last-row': level === 0 && indexRow === viewData.length - 1
|
|
69862
|
+
'r-last-row': level === 0 && indexRow === viewData.length - 1,
|
|
69841
69863
|
}), onContextMenu: (e) => {
|
|
69842
69864
|
e.preventDefault();
|
|
69843
69865
|
handleContextMenu(e, row);
|
|
@@ -69853,7 +69875,7 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69853
69875
|
x: e.clientX,
|
|
69854
69876
|
y: e.clientY,
|
|
69855
69877
|
row,
|
|
69856
|
-
show: true
|
|
69878
|
+
show: true,
|
|
69857
69879
|
});
|
|
69858
69880
|
}, 100);
|
|
69859
69881
|
};
|
|
@@ -69877,20 +69899,28 @@ const TableElement = React__default["default"].memo((props) => {
|
|
|
69877
69899
|
let sumValue = item?.value;
|
|
69878
69900
|
if (!item && col.haveSum === true && col.type === 'numeric') {
|
|
69879
69901
|
sumValue = viewData.reduce(function (accumulator, currentValue) {
|
|
69880
|
-
return Number(accumulator ?? 0) +
|
|
69902
|
+
return (Number(accumulator ?? 0) +
|
|
69903
|
+
Number(currentValue[col.field] ?? 0));
|
|
69881
69904
|
}, 0);
|
|
69882
69905
|
}
|
|
69883
69906
|
if (col.type === 'numeric') {
|
|
69884
69907
|
sumValue = formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false);
|
|
69885
69908
|
}
|
|
69886
69909
|
return (jsxRuntime.jsx("td", { className: classNames$1(`p-0 px-50 r-footer fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }), style: {
|
|
69887
|
-
left: col.fixedType === 'left'
|
|
69888
|
-
|
|
69889
|
-
|
|
69890
|
-
|
|
69891
|
-
|
|
69910
|
+
left: col.fixedType === 'left'
|
|
69911
|
+
? objWidthFixLeft[indexCol]
|
|
69912
|
+
: undefined,
|
|
69913
|
+
right: col.fixedType === 'right'
|
|
69914
|
+
? objWidthFixRight[indexCol]
|
|
69915
|
+
: undefined,
|
|
69916
|
+
textAlign: col.textAlign ? col.textAlign : 'left',
|
|
69917
|
+
}, children: jsxRuntime.jsx("div", { className: "r-footer-div", children: (item || col.haveSum === true) &&
|
|
69918
|
+
Number(item?.value ?? '0') < 0 ? (jsxRuntime.jsxs("div", { style: {
|
|
69919
|
+
color: formatSetting?.colorNegative ?? 'red',
|
|
69892
69920
|
}, children: [' ', `${formatSetting?.prefixNegative ?? '-'}${sumValue}${formatSetting?.suffixNegative ?? ''}`] })) : (sumValue) }) }, `summarycell-${indexCol}`));
|
|
69893
|
-
}) })) })] }), jsxRuntime.jsx("div", { ref: virtualDivRef }), context &&
|
|
69921
|
+
}) })) })] }), jsxRuntime.jsx("div", { ref: virtualDivRef }), context &&
|
|
69922
|
+
(contextMenuItems?.length ?? 0) > 0 &&
|
|
69923
|
+
handleContextMenuClick && (jsxRuntime.jsx(Popover$1, { className: "r-context-popover", placement: "right-start", isOpen: context.show, target: virtualDivRef.current, toggle: handleCloseContext, fade: false, children: jsxRuntime.jsx(PopoverBody$1, { children: contextMenuItems?.map((item, index) => {
|
|
69894
69924
|
return (jsxRuntime.jsxs("div", { className: "r-context-item", onClick: () => {
|
|
69895
69925
|
handleCloseContext();
|
|
69896
69926
|
handleContextMenuClick?.(item, context.row);
|