react-table-edit 1.3.5 → 1.3.6

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.
@@ -85,7 +85,7 @@ export type IColumnTable = {
85
85
  validate?: (value: any, row: any) => boolean;
86
86
  disabledCondition?: (row: any) => boolean;
87
87
  callback?: (value: any, indexRow: number) => void;
88
- template?: (row: any, indexRow: number) => JSX.Element | string | number;
88
+ template?: (row: any, indexRow: number) => JSX.Element | string | number | undefined;
89
89
  editTypeCondition?: (row: any) => string;
90
90
  onPaste?: (dataRow: any, dataPaste: any) => void;
91
91
  onPasteValidate?: (dataPaste: string, dataRow: any, rowIndex: number) => Promise<any>;
package/dist/index.d.ts CHANGED
@@ -153,7 +153,7 @@ type IColumnTable = {
153
153
  validate?: (value: any, row: any) => boolean;
154
154
  disabledCondition?: (row: any) => boolean;
155
155
  callback?: (value: any, indexRow: number) => void;
156
- template?: (row: any, indexRow: number) => JSX.Element | string | number;
156
+ template?: (row: any, indexRow: number) => JSX.Element | string | number | undefined;
157
157
  editTypeCondition?: (row: any) => string;
158
158
  onPaste?: (dataRow: any, dataPaste: any) => void;
159
159
  onPasteValidate?: (dataPaste: string, dataRow: any, rowIndex: number) => Promise<any>;
package/dist/index.js CHANGED
@@ -43104,7 +43104,7 @@ const TableEdit = React$5.forwardRef((props, ref) => {
43104
43104
  }
43105
43105
  }, children: jsxRuntime.jsx("div", { className: classnames('r-rowcell-div'), children: jsxRuntime.jsxs("div", { id: indexFocus === indexRow && typeDis !== 1 ? `${idTable}-col${indexCol + 1}-row${indexRow + 1}` : '', className: classnames('r-rowcell-content', { 'r-is-invalid': errorMessage }), style: {
43106
43106
  margin: typeDis === 1 ? 2 : !errorMessage ? '7px 9px' : 2
43107
- }, children: [typeDis === 1 && !refreshRow ? RenderEdit(row, col, indexCol, indexRow) : jsxRuntime.jsx("div", { id: `content-${idTable}-row${indexRow}col-${indexCol}`, className: "r-cell-text", children: typeDis === 2 ? (col.template && col.template(row, indexRow)) : (col.editType === 'numeric' && Number(row[col.field]) < 0 ? jsxRuntime.jsxs("div", { style: { color: formatSetting?.colorNegative ?? 'red' }, children: [" ", `${formatSetting?.prefixNegative ?? '-'}${value}${formatSetting?.suffixNegative ?? ''}`] }) : value) }), jsxRuntime.jsx("span", { id: `error-${indexRow}-${indexCol}`, className: classnames('cursor-pointer text-primary icon-table', { 'd-none': !errorMessage }), children: jsxRuntime.jsx(SvgAlertCircle, { fontSize: 15.5 }) }), (!(typeDis === 1 && !refreshRow)) && jsxRuntime.jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: `content-${idTable}-row${indexRow}col-${indexCol}`, children: typeDis === 2 ? (col.template && col.template(row, indexRow)) : (col.editType === 'numeric' && Number(row[col.field]) < 0 ? jsxRuntime.jsxs("div", { style: { color: formatSetting?.colorNegative ?? 'red' }, children: [" ", `${formatSetting?.prefixNegative ?? '-'}${value}${formatSetting?.suffixNegative ?? ''}`] }) : value) }), jsxRuntime.jsx(UncontrolledTooltip, { target: `error-${indexRow}-${indexCol}`, className: "r-tooltip tooltip-error", children: errorMessage?.toString() ?? '' })] }) }) }, `col-${indexRow}-${indexCol}`) }, indexCol));
43107
+ }, children: [typeDis === 1 && !refreshRow ? RenderEdit(row, col, indexCol, indexRow) : jsxRuntime.jsx("div", { id: `content-${idTable}-row${indexRow}col-${indexCol}`, className: "r-cell-text", children: typeDis === 2 ? (col.template && col.template(row, indexRow)) ?? '' : (col.editType === 'numeric' && Number(row[col.field]) < 0 ? jsxRuntime.jsxs("div", { style: { color: formatSetting?.colorNegative ?? 'red' }, children: [" ", `${formatSetting?.prefixNegative ?? '-'}${value}${formatSetting?.suffixNegative ?? ''}`] }) : value) }), jsxRuntime.jsx("span", { id: `error-${indexRow}-${indexCol}`, className: classnames('cursor-pointer text-primary icon-table', { 'd-none': !errorMessage }), children: jsxRuntime.jsx(SvgAlertCircle, { fontSize: 15.5 }) }), (!(typeDis === 1 && !refreshRow)) && jsxRuntime.jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: `content-${idTable}-row${indexRow}col-${indexCol}`, children: typeDis === 2 ? (col.template && col.template(row, indexRow)) ?? '' : (col.editType === 'numeric' && Number(row[col.field]) < 0 ? jsxRuntime.jsxs("div", { style: { color: formatSetting?.colorNegative ?? 'red' }, children: [" ", `${formatSetting?.prefixNegative ?? '-'}${value}${formatSetting?.suffixNegative ?? ''}`] }) : value) }), jsxRuntime.jsx(UncontrolledTooltip, { target: `error-${indexRow}-${indexCol}`, className: "r-tooltip tooltip-error", children: errorMessage?.toString() ?? '' })] }) }) }, `col-${indexRow}-${indexCol}`) }, indexCol));
43108
43108
  }
43109
43109
  };
43110
43110
  const renderFooterCol = (col, indexCol) => {