@myunisoft/design-system 0.8.1 → 0.8.2

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
@@ -728,8 +728,7 @@ var $4ad53d6cb96277c8$var$_default = {
728
728
  text: 'Status',
729
729
  refused: 'Refused'
730
730
  },
731
- to: 'to',
732
- total: 'TOTAL'
731
+ to: 'to'
733
732
  },
734
733
  columnsSetting: {
735
734
  title: 'Columns setting',
@@ -855,8 +854,7 @@ var $757d47e205026167$var$_default = {
855
854
  text: 'Status',
856
855
  refused: 'Refusé'
857
856
  },
858
- to: 'au',
859
- total: 'TOTAL'
857
+ to: 'au'
860
858
  },
861
859
  columnsSetting: {
862
860
  title: 'Paramétrage des colonnes',
@@ -1779,7 +1777,7 @@ var $bd57180c0aaf6443$var$BodyCell = function BodyCell(_ref) {
1779
1777
  }), (!isSecuredRow || showLockInfo) && children));
1780
1778
  }
1781
1779
  var renderCell = function renderCell1(_ref4) {
1782
- var displayableRow = _ref4.displayableRow, typeCell1 = _ref4.typeCell, keyColumn1 = _ref4.keyColumn, columnIndex1 = _ref4.columnIndex, rowIndex1 = _ref4.rowIndex;
1780
+ var displayableRow = _ref4.displayableRow, typeCell1 = _ref4.typeCell, keyColumn1 = _ref4.keyColumn, columnIndex1 = _ref4.columnIndex, rowIndex1 = _ref4.rowIndex, isFocused1 = _ref4.isFocused;
1783
1781
  var currentTypeCell = function currentTypeCell1(rowData) {
1784
1782
  if ($bd57180c0aaf6443$var$_typeof2["default"](typeCell1) === $3l7YX.OPERAND.FUNCTION) return typeCell1(rowData);
1785
1783
  return typeCell1;
@@ -1808,7 +1806,8 @@ var $bd57180c0aaf6443$var$BodyCell = function BodyCell(_ref) {
1808
1806
  onDoubleClick: onDoubleClick,
1809
1807
  rowIndex: rowIndex1,
1810
1808
  column: columns[columnIndex1],
1811
- vtContext: VTContext
1809
+ vtContext: VTContext,
1810
+ isFocused: isFocused1
1812
1811
  }, cellProps))));
1813
1812
  };
1814
1813
  var alignCell = $1iQdU.defineCellAlign(typeCell, alignText);
@@ -1838,13 +1837,15 @@ var $bd57180c0aaf6443$var$BodyCell = function BodyCell(_ref) {
1838
1837
  typeCell: typeCell,
1839
1838
  keyColumn: keyColumn,
1840
1839
  columnIndex: columnIndex,
1841
- rowIndex: rowIndex
1840
+ rowIndex: rowIndex,
1841
+ isFocused: isFocused
1842
1842
  }))) : securedRender(renderCell({
1843
1843
  displayableRow: displayableRows[rowIndex],
1844
1844
  typeCell: typeCell,
1845
1845
  keyColumn: keyColumn,
1846
1846
  columnIndex: columnIndex,
1847
- rowIndex: rowIndex
1847
+ rowIndex: rowIndex,
1848
+ isFocused: isFocused
1848
1849
  })));
1849
1850
  function renderIfTooltip() {
1850
1851
  if (tooltipMessage && [
@@ -2332,7 +2333,8 @@ var $7ac33646021a7e72$var$_excluded = [
2332
2333
  "onClick",
2333
2334
  "onDoubleClick",
2334
2335
  "vtContext",
2335
- "column"
2336
+ "column",
2337
+ "isFocused"
2336
2338
  ];
2337
2339
  function $7ac33646021a7e72$var$_getRequireWildcardCache(nodeInterop) {
2338
2340
  if (typeof WeakMap !== "function") return null;
@@ -2399,7 +2401,7 @@ var $7ac33646021a7e72$var$CellRender = function CellRender(_ref) {
2399
2401
  send: function send() {
2400
2402
  }
2401
2403
  } : _ref$vtContext, _ref$column = _ref.column, column = _ref$column === void 0 ? {
2402
- } : _ref$column, rest = $7ac33646021a7e72$var$_objectWithoutProperties2["default"](_ref, $7ac33646021a7e72$var$_excluded);
2404
+ } : _ref$column, isFocused = _ref.isFocused, rest = $7ac33646021a7e72$var$_objectWithoutProperties2["default"](_ref, $7ac33646021a7e72$var$_excluded);
2403
2405
  var send = vtContext.send, _vtContext$config = vtContext.config, config = _vtContext$config === void 0 ? {
2404
2406
  } : _vtContext$config, state = vtContext.state, _vtContext$context = vtContext.context, context = _vtContext$context === void 0 ? {
2405
2407
  } : _vtContext$context;
@@ -2475,7 +2477,10 @@ var $7ac33646021a7e72$var$CellRender = function CellRender(_ref) {
2475
2477
  case $fjngL.TYPE_CELL.SELECT:
2476
2478
  return(/*#__PURE__*/ $7ac33646021a7e72$var$_react["default"].createElement($7ac33646021a7e72$var$_SelectCell["default"], commonProps));
2477
2479
  case $fjngL.TYPE_CELL.AMOUNT:
2478
- return(/*#__PURE__*/ $7ac33646021a7e72$var$_react["default"].createElement($7ac33646021a7e72$var$_AmountCell["default"], commonProps));
2480
+ return(/*#__PURE__*/ $7ac33646021a7e72$var$_react["default"].createElement($7ac33646021a7e72$var$_AmountCell["default"], $7ac33646021a7e72$var$_extends2["default"]({
2481
+ }, commonProps, {
2482
+ isFocused: isFocused
2483
+ })));
2479
2484
  case $fjngL.TYPE_CELL.NUMBER:
2480
2485
  return(/*#__PURE__*/ $7ac33646021a7e72$var$_react["default"].createElement($7ac33646021a7e72$var$_NumberCell["default"], commonProps));
2481
2486
  case $fjngL.TYPE_CELL.BADGE_STATUS:
@@ -2699,7 +2704,8 @@ var $b576ab7cb84899c8$var$_numeral = $ByO3L$babelruntimehelpersinteropRequireDef
2699
2704
  var $b576ab7cb84899c8$var$_min2 = $ByO3L$babelruntimehelpersinteropRequireDefault($ByO3L$lodashmin);
2700
2705
  function $b576ab7cb84899c8$var$formatNumberAndRoundMaxTwoDigits(value) {
2701
2706
  if (!value) return '0,00';
2702
- var regex = new RegExp(/(\d*)([.|,]?)(\d{0,3})/);
2707
+ var isNegative = value < 0;
2708
+ var regex = new RegExp(/(?:-?)(\d*)([.|,]?)(\d{0,3})/);
2703
2709
  var matches = regex.exec(value);
2704
2710
  if (matches) {
2705
2711
  if (matches[3]) {
@@ -2709,7 +2715,7 @@ function $b576ab7cb84899c8$var$formatNumberAndRoundMaxTwoDigits(value) {
2709
2715
  2
2710
2716
  ])).toString().replace('.', ',');
2711
2717
  }
2712
- return "".concat(matches[1]).concat(matches[2] ? ',' : '');
2718
+ return "".concat(isNegative ? '-' : '').concat(matches[1]).concat(matches[2] ? ',' : '');
2713
2719
  }
2714
2720
  return value;
2715
2721
  }
@@ -2795,15 +2801,16 @@ var $f0668b8edb6e03a9$var$_classnames = $ByO3L$babelruntimehelpersinteropRequire
2795
2801
 
2796
2802
  var $f0668b8edb6e03a9$var$_isNil2 = $ByO3L$babelruntimehelpersinteropRequireDefault($ByO3L$lodashisNil);
2797
2803
 
2798
- var $fzVqt = parcelRequire("fzVqt");
2799
-
2800
2804
  var $f0668b8edb6e03a9$var$_styles = $ByO3L$babelruntimehelpersinteropRequireDefault((parcelRequire("boIk5")));
2805
+
2806
+ var $eDSzM = parcelRequire("eDSzM");
2801
2807
  var $f0668b8edb6e03a9$var$_excluded = [
2802
2808
  "data",
2803
2809
  "dataKey",
2804
2810
  "columnIndex",
2805
2811
  "onChange",
2806
- "column"
2812
+ "column",
2813
+ "isFocused"
2807
2814
  ];
2808
2815
  function $f0668b8edb6e03a9$var$_getRequireWildcardCache(nodeInterop) {
2809
2816
  if (typeof WeakMap !== "function") return null;
@@ -2833,14 +2840,11 @@ function $f0668b8edb6e03a9$var$_interopRequireWildcard(obj, nodeInterop) {
2833
2840
  return newObj;
2834
2841
  }
2835
2842
  var $f0668b8edb6e03a9$var$AmountEditCell = /*#__PURE__*/ $f0668b8edb6e03a9$var$_react.memo(function AmountEditCell(_ref) {
2836
- var data = _ref.data, dataKey = _ref.dataKey, columnIndex = _ref.columnIndex, onChange = _ref.onChange, column = _ref.column, rest = $f0668b8edb6e03a9$var$_objectWithoutProperties2["default"](_ref, $f0668b8edb6e03a9$var$_excluded);
2843
+ var data = _ref.data, dataKey = _ref.dataKey, columnIndex = _ref.columnIndex, onChange = _ref.onChange, column = _ref.column, isFocused = _ref.isFocused, rest = $f0668b8edb6e03a9$var$_objectWithoutProperties2["default"](_ref, $f0668b8edb6e03a9$var$_excluded);
2837
2844
  var styles = $f0668b8edb6e03a9$var$_styles["default"]();
2838
2845
  var _column$isDisabled = column.isDisabled, isDisabled = _column$isDisabled === void 0 ? function() {
2839
2846
  return false;
2840
- } : _column$isDisabled, _column$formatAmount = column.formatAmount, formatAmount = _column$formatAmount === void 0 ? $fzVqt.formatNumberAndRoundMaxTwoDigits : _column$formatAmount;
2841
- var getReturnValue = function getReturnValue1(v) {
2842
- return v === '' ? '' : formatAmount(v);
2843
- };
2847
+ } : _column$isDisabled;
2844
2848
  var _useState = $f0668b8edb6e03a9$var$_react.useState(data[dataKey]), _useState2 = $f0668b8edb6e03a9$var$_slicedToArray2["default"](_useState, 2), value = _useState2[0], setValue = _useState2[1];
2845
2849
  var handleChangeInput = function handleChangeInput1(e) {
2846
2850
  var val = e.target.value;
@@ -2849,14 +2853,23 @@ var $f0668b8edb6e03a9$var$AmountEditCell = /*#__PURE__*/ $f0668b8edb6e03a9$var$_
2849
2853
  };
2850
2854
  return(/*#__PURE__*/ $f0668b8edb6e03a9$var$_react["default"].createElement("div", {
2851
2855
  className: styles.amountCell
2852
- }, /*#__PURE__*/ $f0668b8edb6e03a9$var$_react["default"].createElement("input", $f0668b8edb6e03a9$var$_extends2["default"]({
2856
+ }, isFocused ? /*#__PURE__*/ $f0668b8edb6e03a9$var$_react["default"].createElement("input", $f0668b8edb6e03a9$var$_extends2["default"]({
2853
2857
  type: "text",
2854
2858
  disabled: isDisabled(data),
2855
2859
  className: $f0668b8edb6e03a9$var$_classnames["default"](styles.input, $f0668b8edb6e03a9$var$_defineProperty2["default"]({
2856
2860
  }, styles.disabled, isDisabled(data))),
2857
2861
  onChange: handleChangeInput,
2858
- value: getReturnValue(value)
2859
- }, rest))));
2862
+ value: value
2863
+ }, rest)) : /*#__PURE__*/ $f0668b8edb6e03a9$var$_react["default"].createElement("div", {
2864
+ className: styles.amountCell,
2865
+ tabIndex: "0",
2866
+ onFocus: function onFocus() {
2867
+ return rest.onFocus();
2868
+ },
2869
+ onClick: function onClick() {
2870
+ return rest.onFocus();
2871
+ }
2872
+ }, $eDSzM.getViewData(value, column))));
2860
2873
  });
2861
2874
  $f0668b8edb6e03a9$var$AmountEditCell.propTypes = {
2862
2875
  };
@@ -2995,7 +3008,8 @@ var $48de11c1b8ebd932$var$EditStringCell = /*#__PURE__*/ $48de11c1b8ebd932$var$_
2995
3008
  }
2996
3009
  };
2997
3010
  return(/*#__PURE__*/ $48de11c1b8ebd932$var$_react["default"].createElement("div", {
2998
- className: styles.stringCell
3011
+ className: styles.stringCell,
3012
+ title: value
2999
3013
  }, /*#__PURE__*/ $48de11c1b8ebd932$var$_react["default"].createElement("input", $48de11c1b8ebd932$var$_extends2["default"]({
3000
3014
  type: "text",
3001
3015
  disabled: isDisabled(data),
@@ -3036,12 +3050,17 @@ var $30fd03b17b7bd45b$var$useStyles = $ByO3L$materialuicore.makeStyles(function(
3036
3050
  padding: 0,
3037
3051
  border: 'none',
3038
3052
  width: '100%',
3039
- background: 'transparent'
3053
+ background: 'transparent',
3054
+ textOverflow: 'ellipsis',
3055
+ whiteSpace: 'nowrap',
3056
+ overflow: 'hidden'
3040
3057
  },
3041
3058
  stringCell: {
3042
3059
  paddingRight: 4,
3043
3060
  paddingLeft: 4,
3044
- whiteSpace: 'nowrap'
3061
+ textOverflow: 'ellipsis',
3062
+ whiteSpace: 'nowrap',
3063
+ overflow: 'hidden'
3045
3064
  }
3046
3065
  };
3047
3066
  });
@@ -3068,7 +3087,8 @@ var $f1bd003e230d9502$var$ViewStringCell = function ViewStringCell(_ref) {
3068
3087
  var data = _ref.data;
3069
3088
  var styles = $f1bd003e230d9502$var$_styles["default"]();
3070
3089
  return(/*#__PURE__*/ $f1bd003e230d9502$var$_react["default"].createElement("div", {
3071
- className: styles.stringCell
3090
+ className: styles.stringCell,
3091
+ title: data === null || data === void 0 ? void 0 : data.toString()
3072
3092
  }, data === null || data === void 0 ? void 0 : data.toString()));
3073
3093
  };
3074
3094
  $f1bd003e230d9502$var$ViewStringCell.propTypes = {
@@ -5720,6 +5740,8 @@ var $iTJPc = parcelRequire("iTJPc");
5720
5740
 
5721
5741
  var $gNAlh = parcelRequire("gNAlh");
5722
5742
 
5743
+ var $9CaLt = parcelRequire("9CaLt");
5744
+
5723
5745
  var $fjngL = parcelRequire("fjngL");
5724
5746
 
5725
5747
  var $8OJFB = parcelRequire("8OJFB");
@@ -5757,8 +5779,10 @@ var $8614a7f4dd6dc787$var$formatDataToCSV = function formatDataToCSV(row, _ref)
5757
5779
  case $fjngL.TYPE_CELL.BADGE_STATUS:
5758
5780
  case $fjngL.TYPE_CELL.SWITCH_BADGE_STATUS:
5759
5781
  var _find2;
5782
+ var status = value.status;
5783
+ if (status === $gNAlh.BADGE_STATUS.IN_PROGRESS.value && value !== null && value !== void 0 && value.value) return (value === null || value === void 0 ? void 0 : value.value) > $9CaLt.MAX_COUNT_NOTIFY ? '+99' : value === null || value === void 0 ? void 0 : value.value;
5760
5784
  return (_find2 = $8614a7f4dd6dc787$var$_find3["default"]($gNAlh.BADGE_STATUS, function(badge) {
5761
- return badge.value === value;
5785
+ return badge.value === (value === null || value === void 0 ? void 0 : value.status);
5762
5786
  })) === null || _find2 === void 0 ? void 0 : _find2.label;
5763
5787
  case $fjngL.TYPE_CELL.CHECKBOX:
5764
5788
  return value ? 'X' : '';
@@ -7967,8 +7991,9 @@ function $d2b79ee7f17ea28a$var$_interopRequireWildcard(obj, nodeInterop) {
7967
7991
  }
7968
7992
  var $d2b79ee7f17ea28a$var$Footer = /*#__PURE__*/ $d2b79ee7f17ea28a$var$_react["default"].forwardRef(function(_ref, ref) {
7969
7993
  var modeEdit = _ref.modeEdit, displayableRows = _ref.displayableRows, rest = $d2b79ee7f17ea28a$var$_objectWithoutProperties2["default"](_ref, $d2b79ee7f17ea28a$var$_excluded);
7970
- var styles = $d2b79ee7f17ea28a$var$_styles["default"]();
7971
- var _useConfig = $gtEaY.useConfig(), columns = _useConfig.config.columns;
7994
+ var _useConfig = $gtEaY.useConfig(), _useConfig$config = _useConfig.config, columns = _useConfig$config.columns, _useConfig$config$foo = _useConfig$config.footerStyle, footerStyle = _useConfig$config$foo === void 0 ? {
7995
+ } : _useConfig$config$foo;
7996
+ var styles = $d2b79ee7f17ea28a$var$_styles["default"](footerStyle);
7972
7997
  var _renderFooterCell = $d2b79ee7f17ea28a$var$_react.useCallback(function(_ref2) {
7973
7998
  var columnIndex = _ref2.columnIndex, key = _ref2.key, style = _ref2.style;
7974
7999
  return(/*#__PURE__*/ $d2b79ee7f17ea28a$var$_react["default"].createElement($d2b79ee7f17ea28a$var$_Cell["default"], {
@@ -8018,7 +8043,15 @@ var $a8d04a05faf88b2c$var$useStyles = $ByO3L$materialuicore.makeStyles(function(
8018
8043
  }
8019
8044
  },
8020
8045
  defaultStyle: {
8021
- outline: 'none'
8046
+ outline: 'none',
8047
+ backgroundColor: function backgroundColor(props) {
8048
+ var _props$backgroundColo;
8049
+ return (_props$backgroundColo = props.backgroundColor) !== null && _props$backgroundColo !== void 0 ? _props$backgroundColo : '#9ae8e8';
8050
+ },
8051
+ color: function color(props) {
8052
+ var _props$color;
8053
+ return (_props$color = props.color) !== null && _props$color !== void 0 ? _props$color : '#000000';
8054
+ }
8022
8055
  },
8023
8056
  footer_wrap: {
8024
8057
  display: 'flex',
@@ -8058,10 +8091,35 @@ var $90298f27da800938$var$_styles = $ByO3L$babelruntimehelpersinteropRequireDefa
8058
8091
  var $1iQdU = parcelRequire("1iQdU");
8059
8092
 
8060
8093
  var $fzVqt = parcelRequire("fzVqt");
8094
+ function $90298f27da800938$var$ownKeys(object, enumerableOnly) {
8095
+ var keys = Object.keys(object);
8096
+ if (Object.getOwnPropertySymbols) {
8097
+ var symbols = Object.getOwnPropertySymbols(object);
8098
+ if (enumerableOnly) symbols = symbols.filter(function(sym) {
8099
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
8100
+ });
8101
+ keys.push.apply(keys, symbols);
8102
+ }
8103
+ return keys;
8104
+ }
8105
+ function $90298f27da800938$var$_objectSpread(target) {
8106
+ for(var i = 1; i < arguments.length; i++){
8107
+ var source = arguments[i] != null ? arguments[i] : {
8108
+ };
8109
+ if (i % 2) $90298f27da800938$var$ownKeys(Object(source), true).forEach(function(key) {
8110
+ $90298f27da800938$var$_defineProperty2["default"](target, key, source[key]);
8111
+ });
8112
+ else if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
8113
+ else $90298f27da800938$var$ownKeys(Object(source)).forEach(function(key) {
8114
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
8115
+ });
8116
+ }
8117
+ return target;
8118
+ }
8061
8119
  var $90298f27da800938$var$FooterCell = function FooterCell(_ref) {
8062
8120
  var column = _ref.column, style = _ref.style, displayableRows = _ref.displayableRows;
8063
8121
  var styles = $90298f27da800938$var$_styles["default"]();
8064
- var typeFooter = column.typeFooter, tooltipFooter = column.tooltipFooter, typeCell = column.typeCell, footerValue = column.footerValue, keyColumn = column.key, alignText = column.alignText;
8122
+ var typeFooter = column.typeFooter, tooltipFooter = column.tooltipFooter, typeCell = column.typeCell, footerValue = column.footerValue, footerStyle = column.footerStyle, keyColumn = column.key, alignText = column.alignText, noFooter = column.noFooter;
8065
8123
  var renderCustom = function renderCustom1() {
8066
8124
  if (typeof footerValue === 'function') return footerValue(displayableRows);
8067
8125
  return footerValue;
@@ -8084,11 +8142,13 @@ var $90298f27da800938$var$FooterCell = function FooterCell(_ref) {
8084
8142
  className: $90298f27da800938$var$_classnames["default"](styles.cell, styles.footer, $90298f27da800938$var$_defineProperty2["default"]({
8085
8143
  }, styles["align".concat($90298f27da800938$var$_upperFirst2["default"](alignCell))], alignCell)),
8086
8144
  key: keyColumn,
8087
- style: style
8145
+ style: $90298f27da800938$var$_objectSpread($90298f27da800938$var$_objectSpread({
8146
+ }, footerStyle), style)
8088
8147
  }, /*#__PURE__*/ $90298f27da800938$var$_react["default"].createElement("div", {
8089
8148
  className: $90298f27da800938$var$_classnames["default"](styles.footerCell)
8090
8149
  }, footerValue ? renderCustom() : _getValue())));
8091
8150
  };
8151
+ if (noFooter) return null;
8092
8152
  if (tooltipFooter) return(/*#__PURE__*/ $90298f27da800938$var$_react["default"].createElement(Tooltip, {
8093
8153
  title: tooltipFooter,
8094
8154
  placement: "top"
@@ -8114,7 +8174,6 @@ var $a7f827c5274ba1be$var$useStyles = $ByO3L$materialuicore.makeStyles(function(
8114
8174
  fontStyle: 'normal',
8115
8175
  lineHeight: '32px',
8116
8176
  letterSpacing: 'normal',
8117
- color: '#000000',
8118
8177
  overflow: 'hidden'
8119
8178
  },
8120
8179
  alignRight: {
@@ -8158,7 +8217,6 @@ var $a7f827c5274ba1be$var$useStyles = $ByO3L$materialuicore.makeStyles(function(
8158
8217
  }
8159
8218
  },
8160
8219
  footer: {
8161
- backgroundColor: '#9ae8e8',
8162
8220
  fontWeight: 'bold',
8163
8221
  '&_fakeCheckboxCell': {
8164
8222
  // @extend footer,