@myunisoft/design-system 0.8.0 → 0.8.4
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 +135 -66
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -251,11 +251,14 @@ var $66459c55c70cea69$var$VirtualTable = /*#__PURE__*/ $66459c55c70cea69$var$_re
|
|
|
251
251
|
var _useNavigation = $66459c55c70cea69$var$_useNavigation2["default"]({
|
|
252
252
|
hasCheckBox: hasCheckBox,
|
|
253
253
|
onFocusChange: onFocusChange,
|
|
254
|
-
columns:
|
|
254
|
+
columns: _columns.filter(function(_ref2) {
|
|
255
|
+
var display = _ref2.display;
|
|
256
|
+
return display !== false;
|
|
257
|
+
})
|
|
255
258
|
}), handleCellBlur = _useNavigation.handleCellBlur, handleCellFocus = _useNavigation.handleCellFocus, currentCell = _useNavigation.currentCell, setCurrentCell = _useNavigation.setCurrentCell;
|
|
256
259
|
var columns = $66459c55c70cea69$var$_react.useMemo(function() {
|
|
257
|
-
var filteredColumns = _columns.filter(function(
|
|
258
|
-
var display =
|
|
260
|
+
var filteredColumns = _columns.filter(function(_ref3) {
|
|
261
|
+
var display = _ref3.display;
|
|
259
262
|
return display !== false;
|
|
260
263
|
});
|
|
261
264
|
if (hasCheckBox) return [
|
|
@@ -463,17 +466,17 @@ var $66459c55c70cea69$var$VirtualTable = /*#__PURE__*/ $66459c55c70cea69$var$_re
|
|
|
463
466
|
handleValidateEdit: handleValidateEdit,
|
|
464
467
|
handleValidateAdd: handleValidateAdd,
|
|
465
468
|
onChangeColumnsSetting: dispatchColumnsSetting
|
|
466
|
-
}), /*#__PURE__*/ $66459c55c70cea69$var$_react["default"].createElement($ByO3L$reactvirtualized.ScrollSync, null, function(
|
|
467
|
-
var onScroll =
|
|
469
|
+
}), /*#__PURE__*/ $66459c55c70cea69$var$_react["default"].createElement($ByO3L$reactvirtualized.ScrollSync, null, function(_ref4) {
|
|
470
|
+
var onScroll = _ref4.onScroll, scrollLeft = _ref4.scrollLeft;
|
|
468
471
|
return(/*#__PURE__*/ $66459c55c70cea69$var$_react["default"].createElement($ByO3L$reactvirtualized.AutoSizer, {
|
|
469
472
|
onResize: handleResize,
|
|
470
473
|
style: size
|
|
471
|
-
}, function(
|
|
472
|
-
var height =
|
|
474
|
+
}, function(_ref5) {
|
|
475
|
+
var height = _ref5.height, width = _ref5.width;
|
|
473
476
|
if (dynamicHeight && displayableRows.length * rowHeight <= calculateHeightGridBody(height)) height = displayableRows.length * rowHeight + verticalPadding;
|
|
474
477
|
else height = calculateHeightGridBody(height);
|
|
475
|
-
var _getColumnWidth = function _getColumnWidth1(
|
|
476
|
-
var index =
|
|
478
|
+
var _getColumnWidth = function _getColumnWidth1(_ref6) {
|
|
479
|
+
var index = _ref6.index;
|
|
477
480
|
var _columns$index = columns[index], _columns$index$width = _columns$index.width, widthColumn = _columns$index$width === void 0 ? -1 : _columns$index$width, _columns$index$size = _columns$index.size, size1 = _columns$index$size === void 0 ? -1 : _columns$index$size;
|
|
478
481
|
if (size1 !== -1 && width > totalColumnsWidth) {
|
|
479
482
|
var averageColumn = (width - totalColumnsWidth) / totalColumnsSize;
|
|
@@ -514,8 +517,8 @@ var $66459c55c70cea69$var$VirtualTable = /*#__PURE__*/ $66459c55c70cea69$var$_re
|
|
|
514
517
|
onScroll: onScroll,
|
|
515
518
|
rowHeight: cache.rowHeight,
|
|
516
519
|
fixedColumnCount: fixedColumns + +hasCheckBox,
|
|
517
|
-
onScrollbarPresenceChange: function onScrollbarPresenceChange(
|
|
518
|
-
var horizontal =
|
|
520
|
+
onScrollbarPresenceChange: function onScrollbarPresenceChange(_ref7) {
|
|
521
|
+
var horizontal = _ref7.horizontal, size1 = _ref7.size, vertical = _ref7.vertical;
|
|
519
522
|
setVerticalPadding(horizontal ? size1 : 0);
|
|
520
523
|
setHorizontalPadding(vertical ? size1 : 0);
|
|
521
524
|
},
|
|
@@ -728,8 +731,7 @@ var $4ad53d6cb96277c8$var$_default = {
|
|
|
728
731
|
text: 'Status',
|
|
729
732
|
refused: 'Refused'
|
|
730
733
|
},
|
|
731
|
-
to: 'to'
|
|
732
|
-
total: 'TOTAL'
|
|
734
|
+
to: 'to'
|
|
733
735
|
},
|
|
734
736
|
columnsSetting: {
|
|
735
737
|
title: 'Columns setting',
|
|
@@ -855,8 +857,7 @@ var $757d47e205026167$var$_default = {
|
|
|
855
857
|
text: 'Status',
|
|
856
858
|
refused: 'Refusé'
|
|
857
859
|
},
|
|
858
|
-
to: 'au'
|
|
859
|
-
total: 'TOTAL'
|
|
860
|
+
to: 'au'
|
|
860
861
|
},
|
|
861
862
|
columnsSetting: {
|
|
862
863
|
title: 'Paramétrage des colonnes',
|
|
@@ -1779,7 +1780,7 @@ var $bd57180c0aaf6443$var$BodyCell = function BodyCell(_ref) {
|
|
|
1779
1780
|
}), (!isSecuredRow || showLockInfo) && children));
|
|
1780
1781
|
}
|
|
1781
1782
|
var renderCell = function renderCell1(_ref4) {
|
|
1782
|
-
var displayableRow = _ref4.displayableRow, typeCell1 = _ref4.typeCell, keyColumn1 = _ref4.keyColumn, columnIndex1 = _ref4.columnIndex, rowIndex1 = _ref4.rowIndex;
|
|
1783
|
+
var displayableRow = _ref4.displayableRow, typeCell1 = _ref4.typeCell, keyColumn1 = _ref4.keyColumn, columnIndex1 = _ref4.columnIndex, rowIndex1 = _ref4.rowIndex, isFocused1 = _ref4.isFocused;
|
|
1783
1784
|
var currentTypeCell = function currentTypeCell1(rowData) {
|
|
1784
1785
|
if ($bd57180c0aaf6443$var$_typeof2["default"](typeCell1) === $3l7YX.OPERAND.FUNCTION) return typeCell1(rowData);
|
|
1785
1786
|
return typeCell1;
|
|
@@ -1795,7 +1796,7 @@ var $bd57180c0aaf6443$var$BodyCell = function BodyCell(_ref) {
|
|
|
1795
1796
|
data: displayableRow,
|
|
1796
1797
|
dataKey: keyColumn1,
|
|
1797
1798
|
columnIndex: columnIndex1,
|
|
1798
|
-
|
|
1799
|
+
typeCell: currentTypeCell(displayableRow),
|
|
1799
1800
|
spaceBetween: spaceBetween,
|
|
1800
1801
|
onBlur: function onBlur() {
|
|
1801
1802
|
return onCellBlur(rowIndex1, columnIndex1);
|
|
@@ -1808,7 +1809,8 @@ var $bd57180c0aaf6443$var$BodyCell = function BodyCell(_ref) {
|
|
|
1808
1809
|
onDoubleClick: onDoubleClick,
|
|
1809
1810
|
rowIndex: rowIndex1,
|
|
1810
1811
|
column: columns[columnIndex1],
|
|
1811
|
-
vtContext: VTContext
|
|
1812
|
+
vtContext: VTContext,
|
|
1813
|
+
isFocused: isFocused1
|
|
1812
1814
|
}, cellProps))));
|
|
1813
1815
|
};
|
|
1814
1816
|
var alignCell = $1iQdU.defineCellAlign(typeCell, alignText);
|
|
@@ -1838,13 +1840,15 @@ var $bd57180c0aaf6443$var$BodyCell = function BodyCell(_ref) {
|
|
|
1838
1840
|
typeCell: typeCell,
|
|
1839
1841
|
keyColumn: keyColumn,
|
|
1840
1842
|
columnIndex: columnIndex,
|
|
1841
|
-
rowIndex: rowIndex
|
|
1843
|
+
rowIndex: rowIndex,
|
|
1844
|
+
isFocused: isFocused
|
|
1842
1845
|
}))) : securedRender(renderCell({
|
|
1843
1846
|
displayableRow: displayableRows[rowIndex],
|
|
1844
1847
|
typeCell: typeCell,
|
|
1845
1848
|
keyColumn: keyColumn,
|
|
1846
1849
|
columnIndex: columnIndex,
|
|
1847
|
-
rowIndex: rowIndex
|
|
1850
|
+
rowIndex: rowIndex,
|
|
1851
|
+
isFocused: isFocused
|
|
1848
1852
|
})));
|
|
1849
1853
|
function renderIfTooltip() {
|
|
1850
1854
|
if (tooltipMessage && [
|
|
@@ -2319,7 +2323,7 @@ var $NOfOf = parcelRequire("NOfOf");
|
|
|
2319
2323
|
|
|
2320
2324
|
var $hUH45 = parcelRequire("hUH45");
|
|
2321
2325
|
var $7ac33646021a7e72$var$_excluded = [
|
|
2322
|
-
"
|
|
2326
|
+
"typeCell",
|
|
2323
2327
|
"subtype",
|
|
2324
2328
|
"data",
|
|
2325
2329
|
"dataKey",
|
|
@@ -2332,7 +2336,8 @@ var $7ac33646021a7e72$var$_excluded = [
|
|
|
2332
2336
|
"onClick",
|
|
2333
2337
|
"onDoubleClick",
|
|
2334
2338
|
"vtContext",
|
|
2335
|
-
"column"
|
|
2339
|
+
"column",
|
|
2340
|
+
"isFocused"
|
|
2336
2341
|
];
|
|
2337
2342
|
function $7ac33646021a7e72$var$_getRequireWildcardCache(nodeInterop) {
|
|
2338
2343
|
if (typeof WeakMap !== "function") return null;
|
|
@@ -2387,7 +2392,7 @@ function $7ac33646021a7e72$var$_objectSpread(target) {
|
|
|
2387
2392
|
return target;
|
|
2388
2393
|
}
|
|
2389
2394
|
var $7ac33646021a7e72$var$CellRender = function CellRender(_ref) {
|
|
2390
|
-
var
|
|
2395
|
+
var typeCell = _ref.typeCell, subtype = _ref.subtype, _ref$data = _ref.data, data = _ref$data === void 0 ? {
|
|
2391
2396
|
} : _ref$data, dataKey = _ref.dataKey, columnIndex = _ref.columnIndex, spaceBetween = _ref.spaceBetween, rowIndex = _ref.rowIndex, _ref$onKeyDown = _ref.onKeyDown, onKeyDown = _ref$onKeyDown === void 0 ? function() {
|
|
2392
2397
|
} : _ref$onKeyDown, _ref$onBlur = _ref.onBlur, onBlur = _ref$onBlur === void 0 ? function() {
|
|
2393
2398
|
} : _ref$onBlur, _ref$onFocus = _ref.onFocus, onFocus = _ref$onFocus === void 0 ? function() {
|
|
@@ -2399,7 +2404,7 @@ var $7ac33646021a7e72$var$CellRender = function CellRender(_ref) {
|
|
|
2399
2404
|
send: function send() {
|
|
2400
2405
|
}
|
|
2401
2406
|
} : _ref$vtContext, _ref$column = _ref.column, column = _ref$column === void 0 ? {
|
|
2402
|
-
} : _ref$column, rest = $7ac33646021a7e72$var$_objectWithoutProperties2["default"](_ref, $7ac33646021a7e72$var$_excluded);
|
|
2407
|
+
} : _ref$column, isFocused = _ref.isFocused, rest = $7ac33646021a7e72$var$_objectWithoutProperties2["default"](_ref, $7ac33646021a7e72$var$_excluded);
|
|
2403
2408
|
var send = vtContext.send, _vtContext$config = vtContext.config, config = _vtContext$config === void 0 ? {
|
|
2404
2409
|
} : _vtContext$config, state = vtContext.state, _vtContext$context = vtContext.context, context = _vtContext$context === void 0 ? {
|
|
2405
2410
|
} : _vtContext$context;
|
|
@@ -2461,7 +2466,7 @@ var $7ac33646021a7e72$var$CellRender = function CellRender(_ref) {
|
|
|
2461
2466
|
vtContext: vtContext
|
|
2462
2467
|
}, rest);
|
|
2463
2468
|
function switchCell() {
|
|
2464
|
-
switch(
|
|
2469
|
+
switch(typeCell){
|
|
2465
2470
|
case $fjngL.TYPE_CELL.ATTACHMENT:
|
|
2466
2471
|
return(/*#__PURE__*/ $7ac33646021a7e72$var$_react["default"].createElement($7ac33646021a7e72$var$_AttachmentCell["default"], $7ac33646021a7e72$var$_extends2["default"]({
|
|
2467
2472
|
subtype: subtype
|
|
@@ -2475,7 +2480,10 @@ var $7ac33646021a7e72$var$CellRender = function CellRender(_ref) {
|
|
|
2475
2480
|
case $fjngL.TYPE_CELL.SELECT:
|
|
2476
2481
|
return(/*#__PURE__*/ $7ac33646021a7e72$var$_react["default"].createElement($7ac33646021a7e72$var$_SelectCell["default"], commonProps));
|
|
2477
2482
|
case $fjngL.TYPE_CELL.AMOUNT:
|
|
2478
|
-
return(/*#__PURE__*/ $7ac33646021a7e72$var$_react["default"].createElement($7ac33646021a7e72$var$_AmountCell["default"],
|
|
2483
|
+
return(/*#__PURE__*/ $7ac33646021a7e72$var$_react["default"].createElement($7ac33646021a7e72$var$_AmountCell["default"], $7ac33646021a7e72$var$_extends2["default"]({
|
|
2484
|
+
}, commonProps, {
|
|
2485
|
+
isFocused: isFocused
|
|
2486
|
+
})));
|
|
2479
2487
|
case $fjngL.TYPE_CELL.NUMBER:
|
|
2480
2488
|
return(/*#__PURE__*/ $7ac33646021a7e72$var$_react["default"].createElement($7ac33646021a7e72$var$_NumberCell["default"], commonProps));
|
|
2481
2489
|
case $fjngL.TYPE_CELL.BADGE_STATUS:
|
|
@@ -2521,7 +2529,7 @@ var $7ac33646021a7e72$var$CellRender = function CellRender(_ref) {
|
|
|
2521
2529
|
}
|
|
2522
2530
|
if ([
|
|
2523
2531
|
$fjngL.TYPE_CELL.CHECKBOX
|
|
2524
|
-
].includes(
|
|
2532
|
+
].includes(typeCell)) return switchCell();
|
|
2525
2533
|
return(/*#__PURE__*/ $7ac33646021a7e72$var$_react["default"].createElement("div", {
|
|
2526
2534
|
style: {
|
|
2527
2535
|
margin: "0 ".concat(spaceBetween / 2, "px"),
|
|
@@ -2532,13 +2540,13 @@ var $7ac33646021a7e72$var$CellRender = function CellRender(_ref) {
|
|
|
2532
2540
|
}, switchCell()));
|
|
2533
2541
|
};
|
|
2534
2542
|
$7ac33646021a7e72$var$CellRender.propTypes = {
|
|
2535
|
-
|
|
2543
|
+
typeCell: $7ac33646021a7e72$var$_propTypes["default"].string,
|
|
2536
2544
|
data: $7ac33646021a7e72$var$_propTypes["default"].object.isRequired,
|
|
2537
2545
|
dataKey: $7ac33646021a7e72$var$_propTypes["default"].string.isRequired,
|
|
2538
2546
|
columnIndex: $7ac33646021a7e72$var$_propTypes["default"].number
|
|
2539
2547
|
};
|
|
2540
2548
|
$7ac33646021a7e72$var$CellRender.defaultProps = {
|
|
2541
|
-
|
|
2549
|
+
typeCell: $fjngL.TYPE_CELL.STRING
|
|
2542
2550
|
};
|
|
2543
2551
|
var $7ac33646021a7e72$var$_default = $7ac33646021a7e72$var$CellRender;
|
|
2544
2552
|
module.exports["default"] = $7ac33646021a7e72$var$_default;
|
|
@@ -2699,7 +2707,8 @@ var $b576ab7cb84899c8$var$_numeral = $ByO3L$babelruntimehelpersinteropRequireDef
|
|
|
2699
2707
|
var $b576ab7cb84899c8$var$_min2 = $ByO3L$babelruntimehelpersinteropRequireDefault($ByO3L$lodashmin);
|
|
2700
2708
|
function $b576ab7cb84899c8$var$formatNumberAndRoundMaxTwoDigits(value) {
|
|
2701
2709
|
if (!value) return '0,00';
|
|
2702
|
-
var
|
|
2710
|
+
var isNegative = value < 0;
|
|
2711
|
+
var regex = new RegExp(/(?:-?)(\d*)([.|,]?)(\d{0,3})/);
|
|
2703
2712
|
var matches = regex.exec(value);
|
|
2704
2713
|
if (matches) {
|
|
2705
2714
|
if (matches[3]) {
|
|
@@ -2709,7 +2718,7 @@ function $b576ab7cb84899c8$var$formatNumberAndRoundMaxTwoDigits(value) {
|
|
|
2709
2718
|
2
|
|
2710
2719
|
])).toString().replace('.', ',');
|
|
2711
2720
|
}
|
|
2712
|
-
return "".concat(matches[1]).concat(matches[2] ? ',' : '');
|
|
2721
|
+
return "".concat(isNegative ? '-' : '').concat(matches[1]).concat(matches[2] ? ',' : '');
|
|
2713
2722
|
}
|
|
2714
2723
|
return value;
|
|
2715
2724
|
}
|
|
@@ -2752,7 +2761,8 @@ module.exports["default"] = void 0;
|
|
|
2752
2761
|
var $84c4513cb6863285$var$useStyles = $ByO3L$materialuicore.makeStyles(function() {
|
|
2753
2762
|
return {
|
|
2754
2763
|
amountCell: {
|
|
2755
|
-
paddingRight: 10
|
|
2764
|
+
paddingRight: 10,
|
|
2765
|
+
height: '100%'
|
|
2756
2766
|
},
|
|
2757
2767
|
disabled: {
|
|
2758
2768
|
opacity: 0.5
|
|
@@ -2795,15 +2805,16 @@ var $f0668b8edb6e03a9$var$_classnames = $ByO3L$babelruntimehelpersinteropRequire
|
|
|
2795
2805
|
|
|
2796
2806
|
var $f0668b8edb6e03a9$var$_isNil2 = $ByO3L$babelruntimehelpersinteropRequireDefault($ByO3L$lodashisNil);
|
|
2797
2807
|
|
|
2798
|
-
var $fzVqt = parcelRequire("fzVqt");
|
|
2799
|
-
|
|
2800
2808
|
var $f0668b8edb6e03a9$var$_styles = $ByO3L$babelruntimehelpersinteropRequireDefault((parcelRequire("boIk5")));
|
|
2809
|
+
|
|
2810
|
+
var $eDSzM = parcelRequire("eDSzM");
|
|
2801
2811
|
var $f0668b8edb6e03a9$var$_excluded = [
|
|
2802
2812
|
"data",
|
|
2803
2813
|
"dataKey",
|
|
2804
2814
|
"columnIndex",
|
|
2805
2815
|
"onChange",
|
|
2806
|
-
"column"
|
|
2816
|
+
"column",
|
|
2817
|
+
"isFocused"
|
|
2807
2818
|
];
|
|
2808
2819
|
function $f0668b8edb6e03a9$var$_getRequireWildcardCache(nodeInterop) {
|
|
2809
2820
|
if (typeof WeakMap !== "function") return null;
|
|
@@ -2833,14 +2844,11 @@ function $f0668b8edb6e03a9$var$_interopRequireWildcard(obj, nodeInterop) {
|
|
|
2833
2844
|
return newObj;
|
|
2834
2845
|
}
|
|
2835
2846
|
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);
|
|
2847
|
+
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
2848
|
var styles = $f0668b8edb6e03a9$var$_styles["default"]();
|
|
2838
2849
|
var _column$isDisabled = column.isDisabled, isDisabled = _column$isDisabled === void 0 ? function() {
|
|
2839
2850
|
return false;
|
|
2840
|
-
} : _column$isDisabled
|
|
2841
|
-
var getReturnValue = function getReturnValue1(v) {
|
|
2842
|
-
return v === '' ? '' : formatAmount(v);
|
|
2843
|
-
};
|
|
2851
|
+
} : _column$isDisabled;
|
|
2844
2852
|
var _useState = $f0668b8edb6e03a9$var$_react.useState(data[dataKey]), _useState2 = $f0668b8edb6e03a9$var$_slicedToArray2["default"](_useState, 2), value = _useState2[0], setValue = _useState2[1];
|
|
2845
2853
|
var handleChangeInput = function handleChangeInput1(e) {
|
|
2846
2854
|
var val = e.target.value;
|
|
@@ -2849,14 +2857,23 @@ var $f0668b8edb6e03a9$var$AmountEditCell = /*#__PURE__*/ $f0668b8edb6e03a9$var$_
|
|
|
2849
2857
|
};
|
|
2850
2858
|
return(/*#__PURE__*/ $f0668b8edb6e03a9$var$_react["default"].createElement("div", {
|
|
2851
2859
|
className: styles.amountCell
|
|
2852
|
-
}, /*#__PURE__*/ $f0668b8edb6e03a9$var$_react["default"].createElement("input", $f0668b8edb6e03a9$var$_extends2["default"]({
|
|
2860
|
+
}, isFocused ? /*#__PURE__*/ $f0668b8edb6e03a9$var$_react["default"].createElement("input", $f0668b8edb6e03a9$var$_extends2["default"]({
|
|
2853
2861
|
type: "text",
|
|
2854
2862
|
disabled: isDisabled(data),
|
|
2855
2863
|
className: $f0668b8edb6e03a9$var$_classnames["default"](styles.input, $f0668b8edb6e03a9$var$_defineProperty2["default"]({
|
|
2856
2864
|
}, styles.disabled, isDisabled(data))),
|
|
2857
2865
|
onChange: handleChangeInput,
|
|
2858
|
-
value:
|
|
2859
|
-
}, rest))
|
|
2866
|
+
value: value
|
|
2867
|
+
}, rest)) : /*#__PURE__*/ $f0668b8edb6e03a9$var$_react["default"].createElement("div", {
|
|
2868
|
+
className: styles.amountCell,
|
|
2869
|
+
tabIndex: "0",
|
|
2870
|
+
onFocus: function onFocus() {
|
|
2871
|
+
return rest.onFocus();
|
|
2872
|
+
},
|
|
2873
|
+
onClick: function onClick() {
|
|
2874
|
+
return rest.onFocus();
|
|
2875
|
+
}
|
|
2876
|
+
}, $eDSzM.getViewData(value, column))));
|
|
2860
2877
|
});
|
|
2861
2878
|
$f0668b8edb6e03a9$var$AmountEditCell.propTypes = {
|
|
2862
2879
|
};
|
|
@@ -2942,6 +2959,9 @@ var $48de11c1b8ebd932$var$_excluded = [
|
|
|
2942
2959
|
"data",
|
|
2943
2960
|
"dataKey",
|
|
2944
2961
|
"column",
|
|
2962
|
+
"columnIndex",
|
|
2963
|
+
"vtContext",
|
|
2964
|
+
"typeCell",
|
|
2945
2965
|
"onChange",
|
|
2946
2966
|
"keyId"
|
|
2947
2967
|
];
|
|
@@ -2973,7 +2993,7 @@ function $48de11c1b8ebd932$var$_interopRequireWildcard(obj, nodeInterop) {
|
|
|
2973
2993
|
return newObj;
|
|
2974
2994
|
}
|
|
2975
2995
|
var $48de11c1b8ebd932$var$EditStringCell = /*#__PURE__*/ $48de11c1b8ebd932$var$_react["default"].memo(function EditStringCell(_ref) {
|
|
2976
|
-
var data = _ref.data, dataKey = _ref.dataKey, column = _ref.column, onChange = _ref.onChange, keyId = _ref.keyId, rest = $48de11c1b8ebd932$var$_objectWithoutProperties2["default"](_ref, $48de11c1b8ebd932$var$_excluded);
|
|
2996
|
+
var data = _ref.data, dataKey = _ref.dataKey, column = _ref.column, columnIndex = _ref.columnIndex, vtContext = _ref.vtContext, typeCell = _ref.typeCell, onChange = _ref.onChange, keyId = _ref.keyId, rest = $48de11c1b8ebd932$var$_objectWithoutProperties2["default"](_ref, $48de11c1b8ebd932$var$_excluded);
|
|
2977
2997
|
var styles = $48de11c1b8ebd932$var$_styles["default"]();
|
|
2978
2998
|
var _column$isDisabled = column.isDisabled, isDisabled = _column$isDisabled === void 0 ? function() {
|
|
2979
2999
|
return false;
|
|
@@ -2995,7 +3015,8 @@ var $48de11c1b8ebd932$var$EditStringCell = /*#__PURE__*/ $48de11c1b8ebd932$var$_
|
|
|
2995
3015
|
}
|
|
2996
3016
|
};
|
|
2997
3017
|
return(/*#__PURE__*/ $48de11c1b8ebd932$var$_react["default"].createElement("div", {
|
|
2998
|
-
className: styles.stringCell
|
|
3018
|
+
className: styles.stringCell,
|
|
3019
|
+
title: value
|
|
2999
3020
|
}, /*#__PURE__*/ $48de11c1b8ebd932$var$_react["default"].createElement("input", $48de11c1b8ebd932$var$_extends2["default"]({
|
|
3000
3021
|
type: "text",
|
|
3001
3022
|
disabled: isDisabled(data),
|
|
@@ -3036,12 +3057,17 @@ var $30fd03b17b7bd45b$var$useStyles = $ByO3L$materialuicore.makeStyles(function(
|
|
|
3036
3057
|
padding: 0,
|
|
3037
3058
|
border: 'none',
|
|
3038
3059
|
width: '100%',
|
|
3039
|
-
background: 'transparent'
|
|
3060
|
+
background: 'transparent',
|
|
3061
|
+
textOverflow: 'ellipsis',
|
|
3062
|
+
whiteSpace: 'nowrap',
|
|
3063
|
+
overflow: 'hidden'
|
|
3040
3064
|
},
|
|
3041
3065
|
stringCell: {
|
|
3042
3066
|
paddingRight: 4,
|
|
3043
3067
|
paddingLeft: 4,
|
|
3044
|
-
|
|
3068
|
+
textOverflow: 'ellipsis',
|
|
3069
|
+
whiteSpace: 'nowrap',
|
|
3070
|
+
overflow: 'hidden'
|
|
3045
3071
|
}
|
|
3046
3072
|
};
|
|
3047
3073
|
});
|
|
@@ -3068,7 +3094,8 @@ var $f1bd003e230d9502$var$ViewStringCell = function ViewStringCell(_ref) {
|
|
|
3068
3094
|
var data = _ref.data;
|
|
3069
3095
|
var styles = $f1bd003e230d9502$var$_styles["default"]();
|
|
3070
3096
|
return(/*#__PURE__*/ $f1bd003e230d9502$var$_react["default"].createElement("div", {
|
|
3071
|
-
className: styles.stringCell
|
|
3097
|
+
className: styles.stringCell,
|
|
3098
|
+
title: data === null || data === void 0 ? void 0 : data.toString()
|
|
3072
3099
|
}, data === null || data === void 0 ? void 0 : data.toString()));
|
|
3073
3100
|
};
|
|
3074
3101
|
$f1bd003e230d9502$var$ViewStringCell.propTypes = {
|
|
@@ -5720,6 +5747,8 @@ var $iTJPc = parcelRequire("iTJPc");
|
|
|
5720
5747
|
|
|
5721
5748
|
var $gNAlh = parcelRequire("gNAlh");
|
|
5722
5749
|
|
|
5750
|
+
var $9CaLt = parcelRequire("9CaLt");
|
|
5751
|
+
|
|
5723
5752
|
var $fjngL = parcelRequire("fjngL");
|
|
5724
5753
|
|
|
5725
5754
|
var $8OJFB = parcelRequire("8OJFB");
|
|
@@ -5757,8 +5786,10 @@ var $8614a7f4dd6dc787$var$formatDataToCSV = function formatDataToCSV(row, _ref)
|
|
|
5757
5786
|
case $fjngL.TYPE_CELL.BADGE_STATUS:
|
|
5758
5787
|
case $fjngL.TYPE_CELL.SWITCH_BADGE_STATUS:
|
|
5759
5788
|
var _find2;
|
|
5789
|
+
var status = value.status;
|
|
5790
|
+
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
5791
|
return (_find2 = $8614a7f4dd6dc787$var$_find3["default"]($gNAlh.BADGE_STATUS, function(badge) {
|
|
5761
|
-
return badge.value === value;
|
|
5792
|
+
return badge.value === (value === null || value === void 0 ? void 0 : value.status);
|
|
5762
5793
|
})) === null || _find2 === void 0 ? void 0 : _find2.label;
|
|
5763
5794
|
case $fjngL.TYPE_CELL.CHECKBOX:
|
|
5764
5795
|
return value ? 'X' : '';
|
|
@@ -7300,10 +7331,13 @@ var $21ca0ef7fb6000f8$var$edit = function edit(ctx, _ref3) {
|
|
|
7300
7331
|
var addIndex = addTab.findIndex(function(e) {
|
|
7301
7332
|
return e[selectableRowKey] === keyId;
|
|
7302
7333
|
});
|
|
7303
|
-
if (addIndex > -1)
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7334
|
+
if (addIndex > -1) {
|
|
7335
|
+
var _objectSpread5;
|
|
7336
|
+
addTab[addIndex] = $21ca0ef7fb6000f8$var$_objectSpread($21ca0ef7fb6000f8$var$_objectSpread({
|
|
7337
|
+
}, addTab[addIndex]), {
|
|
7338
|
+
}, (_objectSpread5 = {
|
|
7339
|
+
}, $21ca0ef7fb6000f8$var$_defineProperty2["default"](_objectSpread5, key, data), $21ca0ef7fb6000f8$var$_defineProperty2["default"](_objectSpread5, "_touched", true), _objectSpread5));
|
|
7340
|
+
}
|
|
7307
7341
|
return $21ca0ef7fb6000f8$var$_objectSpread($21ca0ef7fb6000f8$var$_objectSpread({
|
|
7308
7342
|
}, ctx), {
|
|
7309
7343
|
}, {
|
|
@@ -7967,8 +8001,9 @@ function $d2b79ee7f17ea28a$var$_interopRequireWildcard(obj, nodeInterop) {
|
|
|
7967
8001
|
}
|
|
7968
8002
|
var $d2b79ee7f17ea28a$var$Footer = /*#__PURE__*/ $d2b79ee7f17ea28a$var$_react["default"].forwardRef(function(_ref, ref) {
|
|
7969
8003
|
var modeEdit = _ref.modeEdit, displayableRows = _ref.displayableRows, rest = $d2b79ee7f17ea28a$var$_objectWithoutProperties2["default"](_ref, $d2b79ee7f17ea28a$var$_excluded);
|
|
7970
|
-
var
|
|
7971
|
-
|
|
8004
|
+
var _useConfig = $gtEaY.useConfig(), _useConfig$config = _useConfig.config, columns = _useConfig$config.columns, _useConfig$config$foo = _useConfig$config.footerStyle, footerStyle = _useConfig$config$foo === void 0 ? {
|
|
8005
|
+
} : _useConfig$config$foo;
|
|
8006
|
+
var styles = $d2b79ee7f17ea28a$var$_styles["default"](footerStyle);
|
|
7972
8007
|
var _renderFooterCell = $d2b79ee7f17ea28a$var$_react.useCallback(function(_ref2) {
|
|
7973
8008
|
var columnIndex = _ref2.columnIndex, key = _ref2.key, style = _ref2.style;
|
|
7974
8009
|
return(/*#__PURE__*/ $d2b79ee7f17ea28a$var$_react["default"].createElement($d2b79ee7f17ea28a$var$_Cell["default"], {
|
|
@@ -8018,7 +8053,15 @@ var $a8d04a05faf88b2c$var$useStyles = $ByO3L$materialuicore.makeStyles(function(
|
|
|
8018
8053
|
}
|
|
8019
8054
|
},
|
|
8020
8055
|
defaultStyle: {
|
|
8021
|
-
outline: 'none'
|
|
8056
|
+
outline: 'none',
|
|
8057
|
+
backgroundColor: function backgroundColor(props) {
|
|
8058
|
+
var _props$backgroundColo;
|
|
8059
|
+
return (_props$backgroundColo = props.backgroundColor) !== null && _props$backgroundColo !== void 0 ? _props$backgroundColo : '#9ae8e8';
|
|
8060
|
+
},
|
|
8061
|
+
color: function color(props) {
|
|
8062
|
+
var _props$color;
|
|
8063
|
+
return (_props$color = props.color) !== null && _props$color !== void 0 ? _props$color : '#000000';
|
|
8064
|
+
}
|
|
8022
8065
|
},
|
|
8023
8066
|
footer_wrap: {
|
|
8024
8067
|
display: 'flex',
|
|
@@ -8058,10 +8101,35 @@ var $90298f27da800938$var$_styles = $ByO3L$babelruntimehelpersinteropRequireDefa
|
|
|
8058
8101
|
var $1iQdU = parcelRequire("1iQdU");
|
|
8059
8102
|
|
|
8060
8103
|
var $fzVqt = parcelRequire("fzVqt");
|
|
8104
|
+
function $90298f27da800938$var$ownKeys(object, enumerableOnly) {
|
|
8105
|
+
var keys = Object.keys(object);
|
|
8106
|
+
if (Object.getOwnPropertySymbols) {
|
|
8107
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
8108
|
+
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
8109
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
8110
|
+
});
|
|
8111
|
+
keys.push.apply(keys, symbols);
|
|
8112
|
+
}
|
|
8113
|
+
return keys;
|
|
8114
|
+
}
|
|
8115
|
+
function $90298f27da800938$var$_objectSpread(target) {
|
|
8116
|
+
for(var i = 1; i < arguments.length; i++){
|
|
8117
|
+
var source = arguments[i] != null ? arguments[i] : {
|
|
8118
|
+
};
|
|
8119
|
+
if (i % 2) $90298f27da800938$var$ownKeys(Object(source), true).forEach(function(key) {
|
|
8120
|
+
$90298f27da800938$var$_defineProperty2["default"](target, key, source[key]);
|
|
8121
|
+
});
|
|
8122
|
+
else if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
8123
|
+
else $90298f27da800938$var$ownKeys(Object(source)).forEach(function(key) {
|
|
8124
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
8125
|
+
});
|
|
8126
|
+
}
|
|
8127
|
+
return target;
|
|
8128
|
+
}
|
|
8061
8129
|
var $90298f27da800938$var$FooterCell = function FooterCell(_ref) {
|
|
8062
8130
|
var column = _ref.column, style = _ref.style, displayableRows = _ref.displayableRows;
|
|
8063
8131
|
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;
|
|
8132
|
+
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
8133
|
var renderCustom = function renderCustom1() {
|
|
8066
8134
|
if (typeof footerValue === 'function') return footerValue(displayableRows);
|
|
8067
8135
|
return footerValue;
|
|
@@ -8084,11 +8152,13 @@ var $90298f27da800938$var$FooterCell = function FooterCell(_ref) {
|
|
|
8084
8152
|
className: $90298f27da800938$var$_classnames["default"](styles.cell, styles.footer, $90298f27da800938$var$_defineProperty2["default"]({
|
|
8085
8153
|
}, styles["align".concat($90298f27da800938$var$_upperFirst2["default"](alignCell))], alignCell)),
|
|
8086
8154
|
key: keyColumn,
|
|
8087
|
-
style:
|
|
8155
|
+
style: $90298f27da800938$var$_objectSpread($90298f27da800938$var$_objectSpread({
|
|
8156
|
+
}, footerStyle), style)
|
|
8088
8157
|
}, /*#__PURE__*/ $90298f27da800938$var$_react["default"].createElement("div", {
|
|
8089
8158
|
className: $90298f27da800938$var$_classnames["default"](styles.footerCell)
|
|
8090
8159
|
}, footerValue ? renderCustom() : _getValue())));
|
|
8091
8160
|
};
|
|
8161
|
+
if (noFooter) return null;
|
|
8092
8162
|
if (tooltipFooter) return(/*#__PURE__*/ $90298f27da800938$var$_react["default"].createElement(Tooltip, {
|
|
8093
8163
|
title: tooltipFooter,
|
|
8094
8164
|
placement: "top"
|
|
@@ -8114,7 +8184,6 @@ var $a7f827c5274ba1be$var$useStyles = $ByO3L$materialuicore.makeStyles(function(
|
|
|
8114
8184
|
fontStyle: 'normal',
|
|
8115
8185
|
lineHeight: '32px',
|
|
8116
8186
|
letterSpacing: 'normal',
|
|
8117
|
-
color: '#000000',
|
|
8118
8187
|
overflow: 'hidden'
|
|
8119
8188
|
},
|
|
8120
8189
|
alignRight: {
|
|
@@ -8158,7 +8227,6 @@ var $a7f827c5274ba1be$var$useStyles = $ByO3L$materialuicore.makeStyles(function(
|
|
|
8158
8227
|
}
|
|
8159
8228
|
},
|
|
8160
8229
|
footer: {
|
|
8161
|
-
backgroundColor: '#9ae8e8',
|
|
8162
8230
|
fontWeight: 'bold',
|
|
8163
8231
|
'&_fakeCheckboxCell': {
|
|
8164
8232
|
// @extend footer,
|
|
@@ -8757,7 +8825,8 @@ function $ec19f4945a6280f4$var$_objectSpread(target) {
|
|
|
8757
8825
|
$fjngL.TYPE_CELL.AMOUNT,
|
|
8758
8826
|
$fjngL.TYPE_CELL.NUMBER,
|
|
8759
8827
|
$fjngL.TYPE_CELL.STATUS,
|
|
8760
|
-
$fjngL.TYPE_CELL.SELECT
|
|
8828
|
+
$fjngL.TYPE_CELL.SELECT,
|
|
8829
|
+
$fjngL.TYPE_CELL.STRING
|
|
8761
8830
|
];
|
|
8762
8831
|
module.exports.allowedTypes = $ec19f4945a6280f4$var$allowedTypes;
|
|
8763
8832
|
var $ec19f4945a6280f4$var$mapStatusListToDataList = function mapStatusListToDataList(listStatus) {
|
|
@@ -8774,7 +8843,7 @@ var $ec19f4945a6280f4$var$mapStatusListToDataList = function mapStatusListToData
|
|
|
8774
8843
|
* @param {array} columns - Columns array from VT config
|
|
8775
8844
|
*/ function $ec19f4945a6280f4$var$parseConfig(columns) {
|
|
8776
8845
|
return columns.reduce(function(prev, curr) {
|
|
8777
|
-
if (curr.typeCell && !$ec19f4945a6280f4$var$allowedTypes.includes(curr.typeCell)) return prev;
|
|
8846
|
+
if (curr.typeCell && !$ec19f4945a6280f4$var$allowedTypes.includes(curr.typeCell) || !curr.header) return prev;
|
|
8778
8847
|
return $ec19f4945a6280f4$var$_objectSpread($ec19f4945a6280f4$var$_objectSpread({
|
|
8779
8848
|
}, prev), {
|
|
8780
8849
|
}, $ec19f4945a6280f4$var$_defineProperty2["default"]({
|
|
@@ -9521,7 +9590,7 @@ var $deb6f3e66712962d$var$useStorage = function useStorage(_tableKeyName) {
|
|
|
9521
9590
|
var _storage = (_config$storage = config.storage) !== null && _config$storage !== void 0 ? _config$storage : localStorage;
|
|
9522
9591
|
function getStorage() {
|
|
9523
9592
|
var _JSON$parse;
|
|
9524
|
-
if (!tableKeyName)
|
|
9593
|
+
if (!tableKeyName) console.error('The `tableKeyName` key is not defined in VirtualTable config.');
|
|
9525
9594
|
return ((_JSON$parse = JSON.parse(_storage === null || _storage === void 0 ? void 0 : _storage.getItem('virtualTable'))) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse[tableKeyName]) || {
|
|
9526
9595
|
};
|
|
9527
9596
|
}
|
|
@@ -9812,13 +9881,13 @@ var $6a171a876dde67ea$var$ToolbarButtons = function ToolbarButtons(_ref) {
|
|
|
9812
9881
|
return [
|
|
9813
9882
|
$NOfOf.ROW_TYPE.NEW,
|
|
9814
9883
|
$NOfOf.ROW_TYPE.EDIT
|
|
9815
|
-
].includes(e.rowType);
|
|
9884
|
+
].includes(e.rowType) && e._touched;
|
|
9816
9885
|
}).length === 0,
|
|
9817
9886
|
onClick: function onClick() {
|
|
9818
9887
|
switch(state){
|
|
9819
9888
|
case $NOfOf.TABLE_STATE.ADD:
|
|
9820
9889
|
handleValidateAdd(allRows.filter(function(e) {
|
|
9821
|
-
return e.rowType === $NOfOf.ROW_TYPE.NEW;
|
|
9890
|
+
return e.rowType === $NOfOf.ROW_TYPE.NEW && e._touched;
|
|
9822
9891
|
}), insertPosition === $NOfOf.INSERT_POSITION.BOTTOM ? displayableRows.length : 0);
|
|
9823
9892
|
break;
|
|
9824
9893
|
case $NOfOf.TABLE_STATE.EDIT:
|
|
@@ -9831,7 +9900,7 @@ var $6a171a876dde67ea$var$ToolbarButtons = function ToolbarButtons(_ref) {
|
|
|
9831
9900
|
return [
|
|
9832
9901
|
$NOfOf.ROW_TYPE.EDIT,
|
|
9833
9902
|
$NOfOf.ROW_TYPE.NEW
|
|
9834
|
-
].includes(e.rowType);
|
|
9903
|
+
].includes(e.rowType) && e._touched;
|
|
9835
9904
|
}), insertPosition === $NOfOf.INSERT_POSITION.BOTTOM ? displayableRows.length : 0);
|
|
9836
9905
|
break;
|
|
9837
9906
|
}
|