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.mjs
CHANGED
|
@@ -41708,7 +41708,7 @@ var css_248z$1 = ".react-resizable {\n position: relative;\n}\n.react-resizable
|
|
|
41708
41708
|
styleInject(css_248z$1);
|
|
41709
41709
|
|
|
41710
41710
|
const HeaderTableCol = (props) => {
|
|
41711
|
-
const { selectEnable, dataSource, setSelectedRows, col, indexCol, indexParent, objWidthFixLeft, objWidthFixRight, totalCount, selectedRows, column, setColumn, isMulti } = props;
|
|
41711
|
+
const { selectEnable, dataSource, setSelectedRows, col, indexCol, indexParent, objWidthFixLeft, objWidthFixRight, totalCount, selectedRows, column, setColumn, fisrtObjWidthFixRight, lastObjWidthFixLeft, isMulti } = props;
|
|
41712
41712
|
const { t } = useTranslation();
|
|
41713
41713
|
const handleResize = (e, { size }) => {
|
|
41714
41714
|
// Update the column width here
|
|
@@ -41725,7 +41725,7 @@ const HeaderTableCol = (props) => {
|
|
|
41725
41725
|
setColumn(newColumns);
|
|
41726
41726
|
}
|
|
41727
41727
|
};
|
|
41728
|
-
return (jsx(Fragment, { children: col.visible !== false && (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: 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: {
|
|
41728
|
+
return (jsx(Fragment, { children: col.visible !== false && (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: 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: {
|
|
41729
41729
|
top: `${indexParent * 42}px`,
|
|
41730
41730
|
left: col.fixedType === 'left' ? objWidthFixLeft[col.index ?? 0] : undefined,
|
|
41731
41731
|
right: col.fixedType === 'right' ? objWidthFixRight[col.index ?? 0] : undefined,
|
|
@@ -42274,10 +42274,10 @@ const isSelectMenuOpen = (element) => {
|
|
|
42274
42274
|
};
|
|
42275
42275
|
const handleArrowUp = (e, params) => {
|
|
42276
42276
|
const { idElement, indexCol, indexRow, pagingClient, pagingSetting, setIndexFocus, focusNewElement, rowChange, changeDataSource, contentColumns, dataSource, row } = params;
|
|
42277
|
-
if ((e.ctrlKey || e.metaKey) && e.shiftKey) {
|
|
42277
|
+
if ((e.ctrlKey || e.metaKey || e.altKey) && e.shiftKey) {
|
|
42278
42278
|
if (indexRow > 0) {
|
|
42279
42279
|
const column = contentColumns[indexCol - 1];
|
|
42280
|
-
for (let index = indexRow -
|
|
42280
|
+
for (let index = indexRow - 2; index >= 0; index--) {
|
|
42281
42281
|
const element = dataSource[index];
|
|
42282
42282
|
element[column.field ?? ''] = row[column.field ?? ''];
|
|
42283
42283
|
if (column.callback && column.callbackValue) {
|
|
@@ -42285,7 +42285,7 @@ const handleArrowUp = (e, params) => {
|
|
|
42285
42285
|
column.callback(value, index, element);
|
|
42286
42286
|
}
|
|
42287
42287
|
if (rowChange) {
|
|
42288
|
-
rowChange(element,
|
|
42288
|
+
rowChange(element, index, column.field);
|
|
42289
42289
|
}
|
|
42290
42290
|
}
|
|
42291
42291
|
changeDataSource(dataSource);
|
|
@@ -42310,7 +42310,7 @@ const handleArrowUp = (e, params) => {
|
|
|
42310
42310
|
};
|
|
42311
42311
|
const handleArrowDown = (e, params) => {
|
|
42312
42312
|
const { idElement, indexCol, indexRow, totalCount, pagingClient, pagingSetting, setIndexFocus, focusNewElement, rowChange, changeDataSource, dataSource, contentColumns, row } = params;
|
|
42313
|
-
if ((e.ctrlKey || e.metaKey) && e.shiftKey) {
|
|
42313
|
+
if ((e.ctrlKey || e.metaKey || e.altKey) && e.shiftKey) {
|
|
42314
42314
|
if (indexRow < totalCount) {
|
|
42315
42315
|
const column = contentColumns[indexCol - 1];
|
|
42316
42316
|
for (let index = indexRow; index < totalCount; index++) {
|
|
@@ -42321,7 +42321,7 @@ const handleArrowDown = (e, params) => {
|
|
|
42321
42321
|
column.callback(value, index, element);
|
|
42322
42322
|
}
|
|
42323
42323
|
if (rowChange) {
|
|
42324
|
-
rowChange(element,
|
|
42324
|
+
rowChange(element, index, column.field);
|
|
42325
42325
|
}
|
|
42326
42326
|
}
|
|
42327
42327
|
changeDataSource(dataSource);
|
|
@@ -43425,7 +43425,7 @@ const TableEdit = forwardRef((props, ref) => {
|
|
|
43425
43425
|
}, [searchTerm, searchSetting?.searchTerm]);
|
|
43426
43426
|
return (jsxs(Fragment, { children: [jsxs("div", { className: "react-table-edit", children: [jsxs("div", { className: 'r-grid', ref: gridRef, children: [toolbarSetting?.showTopToolbar && jsx(RenderToolbarTop, { toolbarTopOption: toolbarTopOption }), jsx("div", { ref: tableElement, className: "r-gridtable", style: { height: `${height ? `${height}px` : 'auto'}`, minHeight: `${minHeight ? `${minHeight}px` : ''}`, maxHeight: `${maxHeight ? `${maxHeight}px` : '400px'}` }, children: jsxs("table", { style: { width: '100%' }, children: [jsx("thead", { className: 'r-gridheader', children: headerColumns.map((element, indexParent) => {
|
|
43427
43427
|
return (jsx("tr", { className: "r-row", role: "row", children: element?.map((col, index) => {
|
|
43428
|
-
return (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}`));
|
|
43428
|
+
return (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}`));
|
|
43429
43429
|
}) }, `header-${-indexParent}`));
|
|
43430
43430
|
}) }), jsx("tbody", { className: 'r-gridcontent', children: renderData() }), jsx("tfoot", { className: "r-gridfoot", children: haveSum == true ? jsx("tr", { className: 'r-row', children: contentColumns.map((col, index) => {
|
|
43431
43431
|
return (renderFooterCol(col, index));
|