react-table-edit 1.4.15 → 1.4.16
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/component/table/header.d.ts +2 -0
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -41736,7 +41736,7 @@ var css_248z$1 = ".react-resizable {\n position: relative;\n}\n.react-resizable
|
|
|
41736
41736
|
styleInject(css_248z$1);
|
|
41737
41737
|
|
|
41738
41738
|
const HeaderTableCol = (props) => {
|
|
41739
|
-
const { selectEnable, dataSource, setSelectedRows, col, indexCol, indexParent, objWidthFixLeft, objWidthFixRight, totalCount, selectedRows, column, setColumn, isMulti } = props;
|
|
41739
|
+
const { selectEnable, dataSource, setSelectedRows, col, indexCol, indexParent, objWidthFixLeft, objWidthFixRight, totalCount, selectedRows, column, setColumn, fisrtObjWidthFixRight, lastObjWidthFixLeft, isMulti } = props;
|
|
41740
41740
|
const { t } = reactI18next.useTranslation();
|
|
41741
41741
|
const handleResize = (e, { size }) => {
|
|
41742
41742
|
// Update the column width here
|
|
@@ -41753,7 +41753,7 @@ const HeaderTableCol = (props) => {
|
|
|
41753
41753
|
setColumn(newColumns);
|
|
41754
41754
|
}
|
|
41755
41755
|
};
|
|
41756
|
-
return (jsxRuntime.jsx(React$5.Fragment, { children: col.visible !== false && (jsxRuntime.jsx(Resizable, { className: "r-resize", width: typeof col.width === 'number' ? col.width : Number((col.width ?? "").replaceAll(new RegExp(`[^0-9]`, "g"), '')), height: 0, onResize: handleResize, draggableOpts: { enableUserSelectHack: false }, children: jsxRuntime.jsx("th", { rowSpan: col.rowspan !== 1 ? col.rowspan : undefined, colSpan: col.columns?.filter(x => x.visible !== false)?.length ?? 1, className: classnames(`r-headercell fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }), style: {
|
|
41756
|
+
return (jsxRuntime.jsx(React$5.Fragment, { children: col.visible !== false && (jsxRuntime.jsx(Resizable, { className: "r-resize", width: typeof col.width === 'number' ? col.width : Number((col.width ?? "").replaceAll(new RegExp(`[^0-9]`, "g"), '')), height: 0, onResize: handleResize, draggableOpts: { enableUserSelectHack: false }, children: jsxRuntime.jsx("th", { rowSpan: col.rowspan !== 1 ? col.rowspan : undefined, colSpan: col.columns?.filter(x => x.visible !== false)?.length ?? 1, className: classnames(`r-headercell fix-${col.fixedType}`, { 'fixed-last': (col.fixedType === 'left' && indexCol === lastObjWidthFixLeft) || (col.fixedType === 'right' && indexCol === fisrtObjWidthFixRight) }, { 'cell-fixed': col.fixedType }), style: {
|
|
41757
41757
|
top: `${indexParent * 42}px`,
|
|
41758
41758
|
left: col.fixedType === 'left' ? objWidthFixLeft[col.index ?? 0] : undefined,
|
|
41759
41759
|
right: col.fixedType === 'right' ? objWidthFixRight[col.index ?? 0] : undefined,
|
|
@@ -42302,10 +42302,10 @@ const isSelectMenuOpen = (element) => {
|
|
|
42302
42302
|
};
|
|
42303
42303
|
const handleArrowUp = (e, params) => {
|
|
42304
42304
|
const { idElement, indexCol, indexRow, pagingClient, pagingSetting, setIndexFocus, focusNewElement, rowChange, changeDataSource, contentColumns, dataSource, row } = params;
|
|
42305
|
-
if ((e.ctrlKey || e.metaKey) && e.shiftKey) {
|
|
42305
|
+
if ((e.ctrlKey || e.metaKey || e.altKey) && e.shiftKey) {
|
|
42306
42306
|
if (indexRow > 0) {
|
|
42307
42307
|
const column = contentColumns[indexCol - 1];
|
|
42308
|
-
for (let index = indexRow -
|
|
42308
|
+
for (let index = indexRow - 2; index >= 0; index--) {
|
|
42309
42309
|
const element = dataSource[index];
|
|
42310
42310
|
element[column.field ?? ''] = row[column.field ?? ''];
|
|
42311
42311
|
if (column.callback && column.callbackValue) {
|
|
@@ -42313,7 +42313,7 @@ const handleArrowUp = (e, params) => {
|
|
|
42313
42313
|
column.callback(value, index, element);
|
|
42314
42314
|
}
|
|
42315
42315
|
if (rowChange) {
|
|
42316
|
-
rowChange(element,
|
|
42316
|
+
rowChange(element, index, column.field);
|
|
42317
42317
|
}
|
|
42318
42318
|
}
|
|
42319
42319
|
changeDataSource(dataSource);
|
|
@@ -42338,7 +42338,7 @@ const handleArrowUp = (e, params) => {
|
|
|
42338
42338
|
};
|
|
42339
42339
|
const handleArrowDown = (e, params) => {
|
|
42340
42340
|
const { idElement, indexCol, indexRow, totalCount, pagingClient, pagingSetting, setIndexFocus, focusNewElement, rowChange, changeDataSource, dataSource, contentColumns, row } = params;
|
|
42341
|
-
if ((e.ctrlKey || e.metaKey) && e.shiftKey) {
|
|
42341
|
+
if ((e.ctrlKey || e.metaKey || e.altKey) && e.shiftKey) {
|
|
42342
42342
|
if (indexRow < totalCount) {
|
|
42343
42343
|
const column = contentColumns[indexCol - 1];
|
|
42344
42344
|
for (let index = indexRow; index < totalCount; index++) {
|
|
@@ -42349,7 +42349,7 @@ const handleArrowDown = (e, params) => {
|
|
|
42349
42349
|
column.callback(value, index, element);
|
|
42350
42350
|
}
|
|
42351
42351
|
if (rowChange) {
|
|
42352
|
-
rowChange(element,
|
|
42352
|
+
rowChange(element, index, column.field);
|
|
42353
42353
|
}
|
|
42354
42354
|
}
|
|
42355
42355
|
changeDataSource(dataSource);
|
|
@@ -43453,7 +43453,7 @@ const TableEdit = React$5.forwardRef((props, ref) => {
|
|
|
43453
43453
|
}, [searchTerm, searchSetting?.searchTerm]);
|
|
43454
43454
|
return (jsxRuntime.jsxs(React$5.Fragment, { children: [jsxRuntime.jsxs("div", { className: "react-table-edit", children: [jsxRuntime.jsxs("div", { className: 'r-grid', ref: gridRef, children: [toolbarSetting?.showTopToolbar && jsxRuntime.jsx(RenderToolbarTop, { toolbarTopOption: toolbarTopOption }), jsxRuntime.jsx("div", { ref: tableElement, className: "r-gridtable", style: { height: `${height ? `${height}px` : 'auto'}`, minHeight: `${minHeight ? `${minHeight}px` : ''}`, maxHeight: `${maxHeight ? `${maxHeight}px` : '400px'}` }, children: jsxRuntime.jsxs("table", { style: { width: '100%' }, children: [jsxRuntime.jsx("thead", { className: 'r-gridheader', children: headerColumns.map((element, indexParent) => {
|
|
43455
43455
|
return (jsxRuntime.jsx("tr", { className: "r-row", role: "row", children: element?.map((col, index) => {
|
|
43456
|
-
return (jsxRuntime.jsx(HeaderTableCol, { col: col, dataSource: dataSource, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, column: contentColumns, setColumn: setContentColumns, totalCount: totalCount }, `header-${indexParent}-${index}`));
|
|
43456
|
+
return (jsxRuntime.jsx(HeaderTableCol, { col: col, dataSource: dataSource, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, selectEnable: selectEnable ?? false, selectedRows: selectedRows, setSelectedRows: setSelectedRows, column: contentColumns, setColumn: setContentColumns, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, totalCount: totalCount }, `header-${indexParent}-${index}`));
|
|
43457
43457
|
}) }, `header-${-indexParent}`));
|
|
43458
43458
|
}) }), jsxRuntime.jsx("tbody", { className: 'r-gridcontent', children: renderData() }), jsxRuntime.jsx("tfoot", { className: "r-gridfoot", children: haveSum == true ? jsxRuntime.jsx("tr", { className: 'r-row', children: contentColumns.map((col, index) => {
|
|
43459
43459
|
return (renderFooterCol(col, index));
|