@majoo-ui/react 1.60.16-rc.4 → 1.60.16-rc.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.
package/index.esm.js CHANGED
@@ -13247,6 +13247,7 @@ const InputSelect = /*#__PURE__*/React.forwardRef((_a, ref) => {
13247
13247
  },
13248
13248
  inputProps: getInputProps({
13249
13249
  onChange: event => {
13250
+ setOpenOptions(true);
13250
13251
  if (event.type !== 'change') return;
13251
13252
  const query = event.target.value;
13252
13253
  if (!fetchData) handleInputValue(query);else debouncedSearch(query);
@@ -24367,12 +24368,15 @@ DecimalColumn.displayName = 'DecimalColumn';
24367
24368
  // import PropTypes from 'prop-types';
24368
24369
 
24369
24370
  const currency$1 = ({
24370
- value,
24371
+ value: val,
24371
24372
  type: _type = 'Rp',
24372
24373
  thousandSeparator: _thousandSeparator = '.',
24373
24374
  decimal: _decimal = false,
24374
- convertMinus: _convertMinus = false
24375
+ convertMinus: _convertMinus = false,
24376
+ forSummary: _forSummary = false
24375
24377
  }) => {
24378
+ let value = val;
24379
+ if (!value) value = 0;
24376
24380
  // const formattedNumber = Math.round(num).toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,');
24377
24381
  // return (type === 'rp') ? `Rp ${formattedNumber}` : ((type == 'nonPrefix') ? formattedNumber : `${type} ${formattedNumber}`);
24378
24382
 
@@ -24387,9 +24391,14 @@ const currency$1 = ({
24387
24391
  }
24388
24392
  if (_convertMinus && parseFloat(value) < 0) {
24389
24393
  const numberWithoutMinus = formattedNumber.toString().replace('-', '');
24394
+ if (_forSummary) return _type.length > 0 ? `(${_type} ${numberWithoutMinus})` : `(${numberWithoutMinus})`;
24390
24395
  return _type.length > 0 ? `( ${_type} ${numberWithoutMinus} )` : `( ${numberWithoutMinus} )`;
24391
24396
  }
24392
- return _type.length > 0 ? `${_type} ${formattedNumber},00` : formattedNumber;
24397
+ const returnValue = _type.length > 0 ? `${_type} ${formattedNumber}` : formattedNumber;
24398
+ if (value === 0) {
24399
+ return returnValue.replace(',00', '');
24400
+ }
24401
+ return returnValue;
24393
24402
 
24394
24403
  // if (thousandSeparator === '.') {
24395
24404
  // return (type === 'rp') ? `Rp ${decimalSplit.join(',')}` : ((type == 'nonPrefix') ? newNum : `${type} ${decimalSplit.join(',')}`);
@@ -24398,8 +24407,10 @@ const currency$1 = ({
24398
24407
  // return (type === 'rp') ? `Rp ${decimalSplit.join('.')}` : ((type == 'nonPrefix') ? newNum : `${type} ${decimalSplit.join('.')}`);
24399
24408
  };
24400
24409
 
24401
- const addThousandSeparator = value => currency$1({
24402
- value
24410
+ const addThousandSeparator = (value, decimal, convertMinus) => currency$1({
24411
+ value,
24412
+ decimal: decimal === undefined ? value !== 0 : decimal,
24413
+ convertMinus: convertMinus === undefined ? true : convertMinus
24403
24414
  });
24404
24415
  const PriceColumn = props => {
24405
24416
  let param = 0;
package/index.umd.js CHANGED
@@ -13391,6 +13391,7 @@
13391
13391
  },
13392
13392
  inputProps: getInputProps({
13393
13393
  onChange: function (event) {
13394
+ setOpenOptions(true);
13394
13395
  if (event.type !== 'change') return;
13395
13396
  var query = event.target.value;
13396
13397
  if (!fetchData) handleInputValue(query);else debouncedSearch(query);
@@ -24852,12 +24853,15 @@
24852
24853
  // import PropTypes from 'prop-types';
24853
24854
 
24854
24855
  const currency$1 = ({
24855
- value,
24856
+ value: val,
24856
24857
  type: _type = 'Rp',
24857
24858
  thousandSeparator: _thousandSeparator = '.',
24858
24859
  decimal: _decimal = false,
24859
- convertMinus: _convertMinus = false
24860
+ convertMinus: _convertMinus = false,
24861
+ forSummary: _forSummary = false
24860
24862
  }) => {
24863
+ let value = val;
24864
+ if (!value) value = 0;
24861
24865
  // const formattedNumber = Math.round(num).toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,');
24862
24866
  // return (type === 'rp') ? `Rp ${formattedNumber}` : ((type == 'nonPrefix') ? formattedNumber : `${type} ${formattedNumber}`);
24863
24867
 
@@ -24872,9 +24876,14 @@
24872
24876
  }
24873
24877
  if (_convertMinus && parseFloat(value) < 0) {
24874
24878
  const numberWithoutMinus = formattedNumber.toString().replace('-', '');
24879
+ if (_forSummary) return _type.length > 0 ? `(${_type} ${numberWithoutMinus})` : `(${numberWithoutMinus})`;
24875
24880
  return _type.length > 0 ? `( ${_type} ${numberWithoutMinus} )` : `( ${numberWithoutMinus} )`;
24876
24881
  }
24877
- return _type.length > 0 ? `${_type} ${formattedNumber},00` : formattedNumber;
24882
+ const returnValue = _type.length > 0 ? `${_type} ${formattedNumber}` : formattedNumber;
24883
+ if (value === 0) {
24884
+ return returnValue.replace(',00', '');
24885
+ }
24886
+ return returnValue;
24878
24887
 
24879
24888
  // if (thousandSeparator === '.') {
24880
24889
  // return (type === 'rp') ? `Rp ${decimalSplit.join(',')}` : ((type == 'nonPrefix') ? newNum : `${type} ${decimalSplit.join(',')}`);
@@ -24883,8 +24892,10 @@
24883
24892
  // return (type === 'rp') ? `Rp ${decimalSplit.join('.')}` : ((type == 'nonPrefix') ? newNum : `${type} ${decimalSplit.join('.')}`);
24884
24893
  };
24885
24894
 
24886
- const addThousandSeparator = value => currency$1({
24887
- value
24895
+ const addThousandSeparator = (value, decimal, convertMinus) => currency$1({
24896
+ value,
24897
+ decimal: decimal === undefined ? value !== 0 : decimal,
24898
+ convertMinus: convertMinus === undefined ? true : convertMinus
24888
24899
  });
24889
24900
  const PriceColumn = props => {
24890
24901
  let param = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@majoo-ui/react",
3
- "version": "1.60.16-rc.4",
3
+ "version": "1.60.16-rc.6",
4
4
  "dependencies": {
5
5
  "@majoo-ui/core": "^1.31.3",
6
6
  "@majoo-ui/helpers": "^1.30.5",