@cloudtower/eagle 0.25.20 → 0.25.23

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.
@@ -1,3 +1,3 @@
1
- import { UnitFn } from "../../spec";
2
- declare const Percent: UnitFn;
1
+ import { PercentFn } from "../../spec";
2
+ declare const Percent: PercentFn;
3
3
  export default Percent;
@@ -1841,19 +1841,6 @@ html body {
1841
1841
  font-size: 18px;
1842
1842
  }
1843
1843
 
1844
- .iap75of {
1845
- height: 18px;
1846
- line-height: 18px;
1847
- padding: 0 4px;
1848
- border-radius: 4px;
1849
- background: rgba(235, 239, 245, 0.6);
1850
- border: 1px solid rgba(223, 228, 235, 0.6);
1851
- display: flex;
1852
- align-items: center;
1853
- white-space: nowrap;
1854
- margin-right: 4px;
1855
- }
1856
-
1857
1844
  .i1mrf09m {
1858
1845
  display: inline-flex;
1859
1846
  align-items: center;
@@ -1872,6 +1859,19 @@ html body {
1872
1859
  animation: rotate 680ms linear infinite;
1873
1860
  }
1874
1861
 
1862
+ .iap75of {
1863
+ height: 18px;
1864
+ line-height: 18px;
1865
+ padding: 0 4px;
1866
+ border-radius: 4px;
1867
+ background: rgba(235, 239, 245, 0.6);
1868
+ border: 1px solid rgba(223, 228, 235, 0.6);
1869
+ display: flex;
1870
+ align-items: center;
1871
+ white-space: nowrap;
1872
+ margin-right: 4px;
1873
+ }
1874
+
1875
1875
  .obf05yr {
1876
1876
  display: inline-block;
1877
1877
  }
@@ -3245,6 +3245,10 @@ input.rrg1fkn.ant-input {
3245
3245
  background: #fff;
3246
3246
  }
3247
3247
 
3248
+ .i1e4sgug {
3249
+ display: inline-block;
3250
+ }
3251
+
3248
3252
  .s1fc623g {
3249
3253
  width: 430px !important;
3250
3254
  }
@@ -3326,10 +3330,6 @@ input.rrg1fkn.ant-input {
3326
3330
  opacity: 0;
3327
3331
  }
3328
3332
 
3329
- .i1e4sgug {
3330
- display: inline-block;
3331
- }
3332
-
3333
3333
  .d6j0lbj {
3334
3334
  font-family: Inter;
3335
3335
  font-style: normal;
@@ -3876,6 +3876,16 @@ input.rrg1fkn.ant-input {
3876
3876
  margin-left: 24px;
3877
3877
  }
3878
3878
 
3879
+ .igz4le8 {
3880
+ height: 24px;
3881
+ width: 56px !important;
3882
+ margin-right: 4px;
3883
+ }
3884
+
3885
+ .c1riexje {
3886
+ color: rgba(44, 56, 82, 0.6);
3887
+ }
3888
+
3879
3889
  .shq1k1g.ant-select, .shq1k1g.ant-select .ant-select-selector {
3880
3890
  border-radius: 6px;
3881
3891
  }
@@ -3931,16 +3941,6 @@ input.rrg1fkn.ant-input {
3931
3941
  transform: rotate(180deg);
3932
3942
  }
3933
3943
 
3934
- .igz4le8 {
3935
- height: 24px;
3936
- width: 56px !important;
3937
- margin-right: 4px;
3938
- }
3939
-
3940
- .c1riexje {
3941
- color: rgba(44, 56, 82, 0.6);
3942
- }
3943
-
3944
3944
  .iiqau4c.ant-input-group.ant-input-group-compact {
3945
3945
  display: flex;
3946
3946
  }
@@ -4167,6 +4167,52 @@ input.rrg1fkn.ant-input {
4167
4167
  min-height: 0px;
4168
4168
  }
4169
4169
 
4170
+ .at4ovwe .ant-input-number-handler-wrap {
4171
+ display: var(--at4ovwe-0);
4172
+ }
4173
+ .at4ovwe .ant-input-number-input-wrap {
4174
+ padding: 5px 12px;
4175
+ display: inline-flex;
4176
+ line-height: 1.5715;
4177
+ height: 100%;
4178
+ width: 100%;
4179
+ }
4180
+ .at4ovwe .ant-input-number-input-wrap::after {
4181
+ content: var(--at4ovwe-1);
4182
+ display: var(--at4ovwe-2);
4183
+ flex: none;
4184
+ align-items: center;
4185
+ margin-left: 4px;
4186
+ color: rgba(44, 56, 82, 0.6);
4187
+ }
4188
+ .at4ovwe .ant-input-number-input-wrap::before {
4189
+ content: var(--at4ovwe-3);
4190
+ display: var(--at4ovwe-4);
4191
+ flex: none;
4192
+ align-items: center;
4193
+ margin-right: 4px;
4194
+ cursor: auto;
4195
+ color: rgba(44, 56, 82, 0.6);
4196
+ }
4197
+ .at4ovwe.ant-input-number {
4198
+ width: 100%;
4199
+ border-radius: 6px;
4200
+ }
4201
+ .at4ovwe.ant-input-number:not([disabled]):focus, .at4ovwe.ant-input-number:not([disabled]):active, .at4ovwe.ant-input-number:not([disabled]).ant-input-number-focused {
4202
+ border-color: #0096ff;
4203
+ box-shadow: 0px 0px 0px 4px rgba(0, 136, 255, 0.16);
4204
+ }
4205
+ .at4ovwe.ant-input-number.error:not([disabled]):hover, .at4ovwe.ant-input-number.error:not([disabled]).ant-input-number-focused {
4206
+ border-color: #e75a3a;
4207
+ box-shadow: 0px 0px 0px 4px rgba(255, 74, 74, 0.16);
4208
+ }
4209
+ .at4ovwe .ant-input-number-input {
4210
+ padding: 0;
4211
+ margin: 0;
4212
+ height: auto;
4213
+ font-size: inherit;
4214
+ }
4215
+
4170
4216
  .tc40oxa {
4171
4217
  margin-bottom: 4px;
4172
4218
  color: rgba(44, 56, 82, 0.6);
@@ -4363,52 +4409,6 @@ input.rrg1fkn.ant-input {
4363
4409
  margin-right: 8px;
4364
4410
  }
4365
4411
 
4366
- .at4ovwe .ant-input-number-handler-wrap {
4367
- display: var(--at4ovwe-0);
4368
- }
4369
- .at4ovwe .ant-input-number-input-wrap {
4370
- padding: 5px 12px;
4371
- display: inline-flex;
4372
- line-height: 1.5715;
4373
- height: 100%;
4374
- width: 100%;
4375
- }
4376
- .at4ovwe .ant-input-number-input-wrap::after {
4377
- content: var(--at4ovwe-1);
4378
- display: var(--at4ovwe-2);
4379
- flex: none;
4380
- align-items: center;
4381
- margin-left: 4px;
4382
- color: rgba(44, 56, 82, 0.6);
4383
- }
4384
- .at4ovwe .ant-input-number-input-wrap::before {
4385
- content: var(--at4ovwe-3);
4386
- display: var(--at4ovwe-4);
4387
- flex: none;
4388
- align-items: center;
4389
- margin-right: 4px;
4390
- cursor: auto;
4391
- color: rgba(44, 56, 82, 0.6);
4392
- }
4393
- .at4ovwe.ant-input-number {
4394
- width: 100%;
4395
- border-radius: 6px;
4396
- }
4397
- .at4ovwe.ant-input-number:not([disabled]):focus, .at4ovwe.ant-input-number:not([disabled]):active, .at4ovwe.ant-input-number:not([disabled]).ant-input-number-focused {
4398
- border-color: #0096ff;
4399
- box-shadow: 0px 0px 0px 4px rgba(0, 136, 255, 0.16);
4400
- }
4401
- .at4ovwe.ant-input-number.error:not([disabled]):hover, .at4ovwe.ant-input-number.error:not([disabled]).ant-input-number-focused {
4402
- border-color: #e75a3a;
4403
- box-shadow: 0px 0px 0px 4px rgba(255, 74, 74, 0.16);
4404
- }
4405
- .at4ovwe .ant-input-number-input {
4406
- padding: 0;
4407
- margin: 0;
4408
- height: auto;
4409
- font-size: inherit;
4410
- }
4411
-
4412
4412
  .a6dbbkm .ant-input-number-handler-wrap {
4413
4413
  display: var(--a6dbbkm-0);
4414
4414
  }
package/dist/esm/index.js CHANGED
@@ -172,12 +172,17 @@ function formatBytes(bytes, decimals = 2) {
172
172
  unit: units[i]
173
173
  };
174
174
  }
175
- function formatPercent(input, decimals = 2) {
176
- if (input <= 0 || input === MAGIC_METRIC_NULL) {
175
+ function formatPercent(input, decimals = 2, saturated = true) {
176
+ if (input === MAGIC_METRIC_NULL) {
177
177
  input = 0;
178
178
  }
179
- if (input > 100) {
180
- input = 100;
179
+ if (saturated) {
180
+ if (input <= 0) {
181
+ input = 0;
182
+ }
183
+ if (input > 100) {
184
+ input = 100;
185
+ }
181
186
  }
182
187
  const value = input.toFixed(decimals);
183
188
  if (parseFloat(value) === 0 && input > 0) {
@@ -3066,6 +3071,7 @@ var __spreadValues$h = (a, b) => {
3066
3071
  const Percent = ({
3067
3072
  rawValue,
3068
3073
  decimals,
3074
+ saturated,
3069
3075
  valueClassName,
3070
3076
  unitClassName,
3071
3077
  emptyProps
@@ -3073,7 +3079,7 @@ const Percent = ({
3073
3079
  if (isEmpty(rawValue)) {
3074
3080
  return /* @__PURE__ */ React__default.createElement(Empty, __spreadValues$h({}, emptyProps));
3075
3081
  }
3076
- const { value, unit } = formatPercent(rawValue, decimals);
3082
+ const { value, unit } = formatPercent(rawValue, decimals, saturated);
3077
3083
  return /* @__PURE__ */ React__default.createElement("span", null, /* @__PURE__ */ React__default.createElement("span", { className: cx("value", valueClassName) }, value), /* @__PURE__ */ React__default.createElement("span", { className: cx("unit", unitClassName) }, unit));
3078
3084
  };
3079
3085
 
@@ -3626,7 +3632,8 @@ const Table = props => {
3626
3632
  initLoading,
3627
3633
  rowKey,
3628
3634
  wrapper,
3629
- pagination
3635
+ pagination,
3636
+ onRow
3630
3637
  } = props;
3631
3638
  const orderRef = useRef(null);
3632
3639
  const hasScrollBard = useTableBodyHasScrollBar(wrapper, dataSource);
@@ -3668,9 +3675,9 @@ const Table = props => {
3668
3675
  onSorterChange == null ? void 0 : onSorterChange(orderRef.current, sorter.columnKey);
3669
3676
  }
3670
3677
  },
3671
- onRow: (record, index) => ({
3678
+ onRow: (record, index) => __spreadValues$9({
3672
3679
  onClick: evt => onRowClick == null ? void 0 : onRowClick(record, index, evt)
3673
- }),
3680
+ }, onRow == null ? void 0 : onRow(record, index)),
3674
3681
  rowClassName,
3675
3682
  scroll,
3676
3683
  rowSelection: rowSelection && __spreadProps$9(__spreadValues$9({}, rowSelection), {