@jsenv/core 41.2.10 → 41.2.11
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.
|
@@ -10435,9 +10435,14 @@ const renderTable = (
|
|
|
10435
10435
|
const cell = row[x];
|
|
10436
10436
|
const { value, format } = cell;
|
|
10437
10437
|
|
|
10438
|
-
|
|
10439
|
-
|
|
10440
|
-
|
|
10438
|
+
const numericValue =
|
|
10439
|
+
typeof value === "string"
|
|
10440
|
+
? Number(value.replace(/_/g, ""))
|
|
10441
|
+
: value;
|
|
10442
|
+
if (format !== "size" && isFinite(numericValue) && value !== "") {
|
|
10443
|
+
const isNegative = numericValue < 0;
|
|
10444
|
+
if (numericValue % 1 === 0) {
|
|
10445
|
+
const { integer } = tokenizeInteger(Math.abs(numericValue));
|
|
10441
10446
|
const integerFormatted = groupDigits(integer);
|
|
10442
10447
|
const integerWidth = measureTextWidth(integerFormatted);
|
|
10443
10448
|
const largestIntegerInColumn =
|
|
@@ -10456,11 +10461,18 @@ const renderTable = (
|
|
|
10456
10461
|
if (floatWidth) {
|
|
10457
10462
|
integerText += " ".repeat(floatWidth);
|
|
10458
10463
|
}
|
|
10464
|
+
if (isNegative) {
|
|
10465
|
+
const firstDigitIdx = integerText.search(/\S/);
|
|
10466
|
+
integerText =
|
|
10467
|
+
firstDigitIdx > 0
|
|
10468
|
+
? `${integerText.slice(0, firstDigitIdx - 1)}-${integerText.slice(firstDigitIdx)}`
|
|
10469
|
+
: `-${integerText}`;
|
|
10470
|
+
}
|
|
10459
10471
|
cell.updateValue(integerText);
|
|
10460
10472
|
});
|
|
10461
10473
|
} else {
|
|
10462
10474
|
const { integer, decimalSeparator, decimal } = tokenizeFloat(
|
|
10463
|
-
Math.abs(
|
|
10475
|
+
Math.abs(numericValue),
|
|
10464
10476
|
);
|
|
10465
10477
|
const integerFormatted = groupDigits(integer);
|
|
10466
10478
|
const integerWidth = measureTextWidth(integerFormatted);
|
|
@@ -10484,6 +10496,13 @@ const renderTable = (
|
|
|
10484
10496
|
const padding = floatColumnWidth - floatWidth;
|
|
10485
10497
|
floatText += " ".repeat(padding - 1);
|
|
10486
10498
|
}
|
|
10499
|
+
if (isNegative) {
|
|
10500
|
+
const firstDigitIdx = floatText.search(/\S/);
|
|
10501
|
+
floatText =
|
|
10502
|
+
firstDigitIdx > 0
|
|
10503
|
+
? `${floatText.slice(0, firstDigitIdx - 1)}-${floatText.slice(firstDigitIdx)}`
|
|
10504
|
+
: `-${floatText}`;
|
|
10505
|
+
}
|
|
10487
10506
|
cell.updateValue(floatText);
|
|
10488
10507
|
});
|
|
10489
10508
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/core",
|
|
3
|
-
"version": "41.2.
|
|
3
|
+
"version": "41.2.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Tool to develop, test and build js projects",
|
|
6
6
|
"repository": {
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@jsenv/plugin-minification": "1.7.4",
|
|
79
79
|
"@jsenv/plugin-supervisor": "1.8.4",
|
|
80
80
|
"@jsenv/plugin-transpilation": "1.5.75",
|
|
81
|
-
"@jsenv/server": "17.3.
|
|
81
|
+
"@jsenv/server": "17.3.1",
|
|
82
82
|
"@jsenv/sourcemap": "1.3.19",
|
|
83
83
|
"react-table": "7.8.0"
|
|
84
84
|
},
|