react-table-edit 1.5.48 → 1.5.49

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 CHANGED
@@ -69013,7 +69013,7 @@ const UnExpandAllIcon = ({ className, color = '#7F7F7F', size = 24, onClick, sty
69013
69013
  };
69014
69014
 
69015
69015
  const RenderContentCol = React__default["default"].memo((props) => {
69016
- const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, handleCellClick, fieldKey, isMulti } = props;
69016
+ const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, handleCellClick, fieldKey, isMulti, } = props;
69017
69017
  const cellId = `content-${idTable}-row${indexRow}col-${indexCol}`;
69018
69018
  const checkOverflow = () => {
69019
69019
  const element = document.getElementById(cellId);
@@ -69035,10 +69035,12 @@ const RenderContentCol = React__default["default"].memo((props) => {
69035
69035
  const RenderElement = () => {
69036
69036
  if (col.field === '#' || col.type === '#') {
69037
69037
  return (jsxRuntime.jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer text-center', {
69038
- 'r-active-cell': isSelected
69038
+ 'r-active-cell': isSelected,
69039
69039
  }), style: {
69040
- fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType ? 600 : 400,
69041
- fontStyle: row.haveItalicType ? 'italic' : 'normal'
69040
+ fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
69041
+ ? 600
69042
+ : 400,
69043
+ fontStyle: row.haveItalicType ? 'italic' : 'normal',
69042
69044
  }, onDoubleClick: (e) => {
69043
69045
  e.preventDefault();
69044
69046
  handleCloseContext();
@@ -69047,11 +69049,15 @@ const RenderContentCol = React__default["default"].memo((props) => {
69047
69049
  }
69048
69050
  else if (col.type === 'checkbox' || col.field === 'checkbox') {
69049
69051
  return (jsxRuntime.jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer', {
69050
- 'r-active-cell': isSelected
69052
+ 'r-active-cell': isSelected,
69051
69053
  }), style: {
69052
69054
  display: 'flex',
69053
- justifyContent: col.textAlign === 'center' ? 'center' : col.textAlign === 'right' ? 'flex-end' : 'flex-start',
69054
- alignItems: 'center'
69055
+ justifyContent: col.textAlign === 'center'
69056
+ ? 'center'
69057
+ : col.textAlign === 'right'
69058
+ ? 'flex-end'
69059
+ : 'flex-start',
69060
+ alignItems: 'center',
69055
69061
  }, onClick: (e) => {
69056
69062
  setSelectedRows(toggleSelect());
69057
69063
  e.stopPropagation();
@@ -69061,8 +69067,11 @@ const RenderContentCol = React__default["default"].memo((props) => {
69061
69067
  let value = row[col.field];
69062
69068
  // ✅ Format dữ liệu theo loại cột
69063
69069
  if (col.type === 'numeric') {
69064
- value = formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
69065
- if (!zeroVisiable && !col.zeroVisiable && !(row?.sortOrder < 0 || row?.sortOrder > 100000) && (value === '0' || value === 0)) {
69070
+ value =
69071
+ formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
69072
+ if (!zeroVisiable &&
69073
+ !col.zeroVisiable &&
69074
+ (value === '0' || value === 0)) {
69066
69075
  value = '';
69067
69076
  }
69068
69077
  }
@@ -69070,31 +69079,43 @@ const RenderContentCol = React__default["default"].memo((props) => {
69070
69079
  value = value ? formatDateTime(value, formatSetting?.dateFormat) : '';
69071
69080
  }
69072
69081
  else if (col.type === 'datetime') {
69073
- value = value ? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm') : '';
69082
+ value = value
69083
+ ? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
69084
+ : '';
69074
69085
  }
69075
69086
  if (col.template) {
69076
69087
  value = col.template(row, indexRow) ?? '';
69077
69088
  }
69078
69089
  const isNegative = col.type === 'numeric' && Number(row[col.field]) < 0;
69079
- const textColor = isNegative ? formatSetting?.colorNegative ?? 'red' : undefined;
69080
- const prefix = isNegative ? formatSetting?.prefixNegative ?? '-' : '';
69081
- const suffix = isNegative ? formatSetting?.suffixNegative ?? '' : '';
69082
- const displayText = isNegative ? `${prefix}${value}${suffix}` : value ?? '';
69090
+ const textColor = isNegative
69091
+ ? (formatSetting?.colorNegative ?? 'red')
69092
+ : undefined;
69093
+ const prefix = isNegative ? (formatSetting?.prefixNegative ?? '-') : '';
69094
+ const suffix = isNegative ? (formatSetting?.suffixNegative ?? '') : '';
69095
+ const displayText = isNegative
69096
+ ? `${prefix}${value}${suffix}`
69097
+ : (value ?? '');
69083
69098
  return (jsxRuntime.jsxs("div", { className: classNames$1('r-rowcell-div cursor-pointer', {
69084
- 'r-active-cell': isSelected
69099
+ 'r-active-cell': isSelected,
69085
69100
  }), style: {
69086
- fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType ? 600 : 400,
69087
- fontStyle: row.haveItalicType ? 'italic' : 'normal'
69101
+ fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
69102
+ ? 600
69103
+ : 400,
69104
+ fontStyle: row.haveItalicType ? 'italic' : 'normal',
69088
69105
  }, children: [jsxRuntime.jsx("div", { className: "r-cell-text", style: {
69089
69106
  display: 'flex',
69090
- justifyContent: col.textAlign === 'center' ? 'center' : col.textAlign === 'right' ? 'flex-end' : 'flex-start',
69091
- alignItems: 'center'
69107
+ justifyContent: col.textAlign === 'center'
69108
+ ? 'center'
69109
+ : col.textAlign === 'right'
69110
+ ? 'flex-end'
69111
+ : 'flex-start',
69112
+ alignItems: 'center',
69092
69113
  }, children: jsxRuntime.jsx("div", { id: cellId, style: {
69093
69114
  color: textColor,
69094
69115
  overflow: 'hidden',
69095
69116
  textOverflow: 'ellipsis',
69096
69117
  whiteSpace: 'pre',
69097
- maxWidth: '100%'
69118
+ maxWidth: '100%',
69098
69119
  }, children: displayText }) }), checkOverflow() && (jsxRuntime.jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: cellId, placement: "top", children: jsxRuntime.jsx("div", { style: { color: textColor }, onClick: (e) => {
69099
69120
  e.stopPropagation();
69100
69121
  e.preventDefault();
@@ -69103,10 +69124,15 @@ const RenderContentCol = React__default["default"].memo((props) => {
69103
69124
  };
69104
69125
  const clickTimerRef = React$5.useRef(null);
69105
69126
  return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: col.visible !== false && col.isGroup !== true && (jsxRuntime.jsx("td", { className: classNames$1(`r-rowcell fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }, {
69106
- 'fixed-last': (col.fixedType === 'left' && indexCol === lastObjWidthFixLeft) || (col.fixedType === 'right' && indexCol === fisrtObjWidthFixRight)
69127
+ 'fixed-last': (col.fixedType === 'left' &&
69128
+ indexCol === lastObjWidthFixLeft) ||
69129
+ (col.fixedType === 'right' &&
69130
+ indexCol === fisrtObjWidthFixRight),
69107
69131
  }, { 'r-active': isSelected }), style: {
69108
69132
  left: col.fixedType === 'left' ? objWidthFixLeft[indexCol] : undefined,
69109
- right: col.fixedType === 'right' ? objWidthFixRight[indexCol] : undefined
69133
+ right: col.fixedType === 'right'
69134
+ ? objWidthFixRight[indexCol]
69135
+ : undefined,
69110
69136
  }, onClick: (e) => {
69111
69137
  const tag = e.target?.nodeName;
69112
69138
  if (tag !== 'DIV' && tag !== 'TD') {