@cloudtower/eagle 0.31.7 → 0.31.9
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/cjs/core/BytePerSecond/index.js +45 -0
- package/dist/cjs/core/TableForm/Columns/AffixColumn.js +1 -1
- package/dist/cjs/core/TableForm/Columns/CheckboxColumn.js +1 -1
- package/dist/cjs/core/TableForm/Columns/InputColumn.js +1 -0
- package/dist/cjs/core/TableForm/TableFormHeaderCell.js +40 -20
- package/dist/cjs/core/TableForm/index.js +4 -11
- package/dist/cjs/core/index.js +15 -12
- package/dist/cjs/coreX/ChartWithTooltip/index.js +14 -12
- package/dist/cjs/coreX/UnitWithChart/index.js +14 -12
- package/dist/cjs/index.js +239 -237
- package/dist/cjs/legacy-antd.js +111 -109
- package/dist/cjs/stats1.html +1 -1
- package/dist/cjs/utils/tower.js +17 -0
- package/dist/components.css +2841 -2812
- package/dist/esm/core/BytePerSecond/index.js +39 -0
- package/dist/esm/core/TableForm/Columns/AffixColumn.js +1 -1
- package/dist/esm/core/TableForm/Columns/CheckboxColumn.js +1 -1
- package/dist/esm/core/TableForm/Columns/InputColumn.js +1 -0
- package/dist/esm/core/TableForm/TableFormHeaderCell.js +37 -17
- package/dist/esm/core/TableForm/index.js +5 -12
- package/dist/esm/core/index.js +3 -1
- package/dist/esm/coreX/ChartWithTooltip/index.js +2 -0
- package/dist/esm/coreX/UnitWithChart/index.js +2 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/legacy-antd.js +2 -0
- package/dist/esm/stats1.html +1 -1
- package/dist/esm/utils/tower.js +17 -1
- package/dist/src/core/BytePerSecond/index.d.ts +3 -0
- package/dist/src/core/TableForm/types.d.ts +92 -1
- package/dist/src/core/Tooltip/EllipsisTooltipContent.d.ts +4 -0
- package/dist/src/core/Tooltip/index.d.ts +1 -0
- package/dist/src/core/Tooltip/tooltip.type.d.ts +22 -0
- package/dist/src/core/Tooltip/tooltip.widget.d.ts +5 -0
- package/dist/src/core/index.d.ts +3 -0
- package/dist/src/coreX/UnitWithChart/index.d.ts +1 -0
- package/dist/src/spec/base.d.ts +1 -0
- package/dist/src/utils/tower.d.ts +1 -0
- package/dist/stories/docs/core/BytePerSecond.stories.d.ts +17 -0
- package/dist/stories/docs/core/EllipsisTooltipContent.stories.d.ts +24 -0
- package/dist/stories/docs/core/TableForm.stories.d.ts +45 -13
- package/dist/style.css +2780 -2756
- package/package.json +4 -4
package/dist/cjs/utils/tower.js
CHANGED
|
@@ -125,6 +125,22 @@ function formatBytes(bytes, decimals = 2) {
|
|
|
125
125
|
unit: units[i]
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
+
function formatBytePerSecond(bytes, decimals = 2) {
|
|
129
|
+
if (bytes <= 0 || bytes === MAGIC_METRIC_NULL) {
|
|
130
|
+
return {
|
|
131
|
+
value: 0,
|
|
132
|
+
unit: "B/s"
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
const k = 1024;
|
|
136
|
+
const units = ["B/s", "KiB/s", "MiB/s", "GiB/s", "TiB/s", "PiB/s"];
|
|
137
|
+
let i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
138
|
+
i = i < 0 ? 0 : i > units.length - 1 ? units.length - 1 : i;
|
|
139
|
+
return {
|
|
140
|
+
value: parseFloat((bytes / Math.pow(k, i)).toFixed(decimals)),
|
|
141
|
+
unit: units[i]
|
|
142
|
+
};
|
|
143
|
+
}
|
|
128
144
|
function formatPercent(input, decimals = 2, saturated = true) {
|
|
129
145
|
if (input === MAGIC_METRIC_NULL) {
|
|
130
146
|
input = 0;
|
|
@@ -181,6 +197,7 @@ exports.WEEK = WEEK;
|
|
|
181
197
|
exports.formatBitPerSecond = formatBitPerSecond;
|
|
182
198
|
exports.formatBits = formatBits;
|
|
183
199
|
exports.formatBps = formatBps;
|
|
200
|
+
exports.formatBytePerSecond = formatBytePerSecond;
|
|
184
201
|
exports.formatBytes = formatBytes;
|
|
185
202
|
exports.formatFrequency = formatFrequency;
|
|
186
203
|
exports.formatPercent = formatPercent;
|