react-table-edit 1.5.25 → 1.5.26

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.mjs CHANGED
@@ -40216,6 +40216,18 @@ const TableEdit = forwardRef((props, ref) => {
40216
40216
  const toggleSidebar = useCallback(() => {
40217
40217
  setOpenPopupSetupColumn((prev) => !prev);
40218
40218
  }, []);
40219
+ const handleSetColumn = useCallback((newColumns) => {
40220
+ if (saveSettingColumn) {
40221
+ saveSettingColumn(newColumns.map((x, index) => ({
40222
+ field: x.field,
40223
+ headerText: x.headerDisplay,
40224
+ visible: x.visible,
40225
+ fixedType: x.fixedType,
40226
+ width: x.width,
40227
+ sortOrder: index + 1
40228
+ })));
40229
+ }
40230
+ }, [saveSettingColumn]);
40219
40231
  return (jsx(Fragment, { children: jsxs("div", { className: "r-table-edit", children: [jsxs("div", { className: "r-grid", ref: gridRef, children: [toolbarSetting?.showTopToolbar && jsx(RenderToolbarTop, { toolbarTopOption: toolbarTopOption }), jsx(TableComponent, { idTable: idTable, height: height, dataSource: dataSource, contentColumns: contentColumns, headerColumns: headerColumns, selectedRows: selectedRows, setSelectedRows: setSelectedRows, selectedCell: selectedCell, startCell: startCell, editCell: editCell, gridRef: gridRef, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, fisrtObjWidthFixRight: fisrtObjWidthFixRight, totalCount: totalCount, isMulti: isMulti, selectEnable: selectEnable, editDisable: editDisable, addDisable: addDisable, defaultValue: defaultValue, fieldKey: fieldKey, fieldUniKey: fieldUniKey, formatSetting: formatSetting, toolbarSetting: toolbarSetting, buttonSetting: buttonSetting, containerRef: containerRef, optionsFilter: optionsFilter, allowFiltering: allowFiltering, allowSorting: allowSorting, searchSetting: searchSetting, searchTerm: searchTerm, haveSum: haveSum, isCopying: isCopying, typeDragging: typeDragging, visibleContentColumns: visibleContentColumns, rowHeight: rowHeight, changeDataSource: changeDataSource, handleCommandClick: handleCommandClick, handleKeyDown: handleKeyDown, handeCopyCell: handeCopyCell, onDuplicate: onDuplicate, setSelectedCell: setSelectedCell, setStartCell: setStartCell, focusEditElementCell: focusEditElementCell, rowChange: rowChange, filterBy: filterBy, setFilterBy: setFilterBy, orderBy: orderBy, setOrderBy: setOrderBy, searchClient: searchClient, handleDataChange: handleDataChange, handleDuplicate: () => {
40220
40232
  handleDuplicate(dataSource, startCell.row, fieldKey, defaultValue, fieldUniKey, changeDataSource, containerRef, totalCount, toolbarSetting, buttonSetting, editDisable, addDisable, onDuplicate);
40221
40233
  }, setContentColumns: (newColumns) => {
@@ -40239,11 +40251,7 @@ const TableEdit = forwardRef((props, ref) => {
40239
40251
  handleInsertBefore(dataSource, startCell.row, defaultValue, changeDataSource, toolbarSetting, buttonSetting, editDisable, addDisable);
40240
40252
  }, handleDeleteAll: () => {
40241
40253
  handleDeleteAll(t, messageBoxConfirmDelete, handleFocusCell, changeDataSource, editDisable, addDisable, toolbarSetting, buttonSetting);
40242
- }, setOpenPopupSetupColumn: setOpenPopupSetupColumn, focusRow: startCell.row, editDisable: editDisable, addDisable: addDisable, buttonSetting: buttonSetting, toolbarSetting: toolbarSetting, headerColumns: headerColumns }))] }), pagingSetting?.allowPaging && (jsx(PagingComponent, { gridRef: gridRef, onChangePage: onChangePage, pageSize: pagingSetting?.pageSize ?? 0, currentPage: pagingSetting?.currentPage ?? 0, pageOptions: pagingSetting?.pageOptions ?? [20, 30, 50, 100], totalItem: pagingSetting?.totalItem ?? 0, onChangePageSize: onChangePageSize })), jsx(SettingColumn, { gridRef: gridRef, handleSidebar: toggleSidebar, settingColumns: settingColumns, openSidebar: openPopupSetupColumn, column: contentColumns, resetDefaultColumns: resetDefaultColumns, setColumn: (newColumns) => {
40243
- if (saveSettingColumn) {
40244
- saveSettingColumn(newColumns.map((x, index) => ({ field: x.field, headerText: x.headerDisplay, visible: x.visible, fixedType: x.fixedType, width: x.width, sortOrder: index + 1 })));
40245
- }
40246
- } })] }) }));
40254
+ }, setOpenPopupSetupColumn: setOpenPopupSetupColumn, focusRow: startCell.row, editDisable: editDisable, addDisable: addDisable, buttonSetting: buttonSetting, toolbarSetting: toolbarSetting, headerColumns: headerColumns }))] }), pagingSetting?.allowPaging && (jsx(PagingComponent, { gridRef: gridRef, onChangePage: onChangePage, pageSize: pagingSetting?.pageSize ?? 0, currentPage: pagingSetting?.currentPage ?? 0, pageOptions: pagingSetting?.pageOptions ?? [20, 30, 50, 100], totalItem: pagingSetting?.totalItem ?? 0, onChangePageSize: onChangePageSize })), jsx(SettingColumn, { gridRef: gridRef, handleSidebar: toggleSidebar, settingColumns: settingColumns, openSidebar: openPopupSetupColumn, column: contentColumns, resetDefaultColumns: resetDefaultColumns, setColumn: handleSetColumn })] }) }));
40247
40255
  });
40248
40256
 
40249
40257
  const OptionFont = [