es-grid-template 1.5.7 → 1.5.8

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.
@@ -13,7 +13,7 @@ getDatepickerFormat, getTemplate, isDisable, isEmpty, isNullOrUndefined, customW
13
13
  // import dayjs from "dayjs";
14
14
  // import {TreeSelect} from "antd";
15
15
  import classNames from "classnames";
16
- import { NumericFormat } from "react-numeric-component";
16
+ import { NumericFormat, numericFormatter } from "react-numeric-component";
17
17
  import { TableContext } from "./useContext";
18
18
  import dayjs from "dayjs";
19
19
  import moment from "moment";
@@ -872,7 +872,7 @@ const EditableCell = props => {
872
872
  // let floatValue = value
873
873
 
874
874
  const numericFormatProps = {
875
- value,
875
+ // value,
876
876
  thousandSeparator: checkThousandSeparator(thousandSeparator, decimalSeparator),
877
877
  decimalSeparator: checkDecimalSeparator(thousandSeparator, decimalSeparator),
878
878
  decimalScale: cellFormat?.decimalScale ?? undefined,
@@ -882,7 +882,9 @@ const EditableCell = props => {
882
882
  suffix: cellFormat?.suffix ?? undefined
883
883
  };
884
884
  return /*#__PURE__*/React.createElement(NumericFormat, _extends({
885
- id: `col${indexCol}-record${indexRow}`
885
+ id: `col${indexCol}-record${indexRow}`,
886
+ value: value ? numericFormatter(value.toString(), numericFormatProps) : ''
887
+ // value={value}
886
888
  }, numericFormatProps, {
887
889
  min: column.min,
888
890
  max: column.max,
@@ -898,7 +900,7 @@ const EditableCell = props => {
898
900
  'be-cell-edit-align-right': !column.align || column.align === 'right'
899
901
  }),
900
902
  onValueChange: values => {
901
- onChange(values?.floatValue);
903
+ onChange(values?.floatValue || 0);
902
904
  },
903
905
  onBlur: () => {
904
906
  const formState = getValues();
@@ -65,7 +65,9 @@ export const getValueCell = (column, value, format) => {
65
65
  // const contentNumber = !isEmpty(value) ? ((dec || dec === 0) ? parseFloat(Number(value).toFixed(dec)).toString() : value.toString()) : '0'
66
66
 
67
67
  const tmpval = typeof value === 'string' ? Number(value) : value;
68
- const contentNumber = !isEmpty(value) ? dec || dec === 0 ? parseFloat(tmpval.toFixed(dec)).toString() : tmpval.toString() : '0';
68
+
69
+ // const contentNumber = !isEmpty(value) ? ((dec || dec === 0) ? parseFloat(tmpval.toFixed(dec)).toString() : tmpval.toString()) : '0'
70
+ const contentNumber = !isEmpty(value) ? dec || dec === 0 ? tmpval.toString() : tmpval.toString() : '0';
69
71
  const numericFormatProps = {
70
72
  thousandSeparator: checkThousandSeparator(thousandSeparator, decimalSeparator),
71
73
  decimalSeparator: checkDecimalSeparator(thousandSeparator, decimalSeparator),