@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.
Files changed (42) hide show
  1. package/dist/cjs/core/BytePerSecond/index.js +45 -0
  2. package/dist/cjs/core/TableForm/Columns/AffixColumn.js +1 -1
  3. package/dist/cjs/core/TableForm/Columns/CheckboxColumn.js +1 -1
  4. package/dist/cjs/core/TableForm/Columns/InputColumn.js +1 -0
  5. package/dist/cjs/core/TableForm/TableFormHeaderCell.js +40 -20
  6. package/dist/cjs/core/TableForm/index.js +4 -11
  7. package/dist/cjs/core/index.js +15 -12
  8. package/dist/cjs/coreX/ChartWithTooltip/index.js +14 -12
  9. package/dist/cjs/coreX/UnitWithChart/index.js +14 -12
  10. package/dist/cjs/index.js +239 -237
  11. package/dist/cjs/legacy-antd.js +111 -109
  12. package/dist/cjs/stats1.html +1 -1
  13. package/dist/cjs/utils/tower.js +17 -0
  14. package/dist/components.css +2841 -2812
  15. package/dist/esm/core/BytePerSecond/index.js +39 -0
  16. package/dist/esm/core/TableForm/Columns/AffixColumn.js +1 -1
  17. package/dist/esm/core/TableForm/Columns/CheckboxColumn.js +1 -1
  18. package/dist/esm/core/TableForm/Columns/InputColumn.js +1 -0
  19. package/dist/esm/core/TableForm/TableFormHeaderCell.js +37 -17
  20. package/dist/esm/core/TableForm/index.js +5 -12
  21. package/dist/esm/core/index.js +3 -1
  22. package/dist/esm/coreX/ChartWithTooltip/index.js +2 -0
  23. package/dist/esm/coreX/UnitWithChart/index.js +2 -0
  24. package/dist/esm/index.js +1 -0
  25. package/dist/esm/legacy-antd.js +2 -0
  26. package/dist/esm/stats1.html +1 -1
  27. package/dist/esm/utils/tower.js +17 -1
  28. package/dist/src/core/BytePerSecond/index.d.ts +3 -0
  29. package/dist/src/core/TableForm/types.d.ts +92 -1
  30. package/dist/src/core/Tooltip/EllipsisTooltipContent.d.ts +4 -0
  31. package/dist/src/core/Tooltip/index.d.ts +1 -0
  32. package/dist/src/core/Tooltip/tooltip.type.d.ts +22 -0
  33. package/dist/src/core/Tooltip/tooltip.widget.d.ts +5 -0
  34. package/dist/src/core/index.d.ts +3 -0
  35. package/dist/src/coreX/UnitWithChart/index.d.ts +1 -0
  36. package/dist/src/spec/base.d.ts +1 -0
  37. package/dist/src/utils/tower.d.ts +1 -0
  38. package/dist/stories/docs/core/BytePerSecond.stories.d.ts +17 -0
  39. package/dist/stories/docs/core/EllipsisTooltipContent.stories.d.ts +24 -0
  40. package/dist/stories/docs/core/TableForm.stories.d.ts +45 -13
  41. package/dist/style.css +2780 -2756
  42. package/package.json +4 -4
@@ -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;