@cloudtower/eagle 0.26.3-vpc-0.0.1 → 0.26.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/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Alert as Alert$1, Badge as Badge$1, Button as Button$1, Tooltip as Tooltip$1, Checkbox as Checkbox$1, DatePicker, Select as Select$1, InputNumber as InputNumber$1, Input as Input$1, TimePicker as TimePicker$1, Form as Form$1, Modal as Modal$1, Steps as Steps$1, Dropdown, Menu, Progress as Progress$1, Radio as Radio$1, Switch as Switch$1, Table as Table$1, Space, List, Tag, Row, Col, Tree, Divider, Skeleton, Layout, AutoComplete, Popover, Timeline, Typography, Cascader, Upload, Calendar, Tabs, message, Empty as Empty$1, Collapse, TreeSelect, Drawer, ConfigProvider } from 'antd';
2
2
  export { Col, Row } from 'antd';
3
3
  import * as React from 'react';
4
- import React__default, { useState, useMemo, useRef, useCallback, useEffect, forwardRef, Fragment, useLayoutEffect, createContext, memo, useImperativeHandle, useContext } from 'react';
4
+ import React__default, { useState, useMemo, useRef, useCallback, useEffect, Fragment, useLayoutEffect, createContext, memo, useImperativeHandle, useContext } from 'react';
5
5
  import cs from 'classnames';
6
6
  import _, { uniqBy, groupBy, sortBy, toPairs } from 'lodash';
7
7
  import { SVGUniqueID } from 'react-svg-unique-id';
@@ -10,7 +10,6 @@ export * from '@cloudtower/parrot';
10
10
  import { useTranslation, withTranslation } from 'react-i18next';
11
11
  import { cx } from '@linaria/core';
12
12
  import { styled } from '@linaria/react';
13
- import { ArrowRightGrayIcon, HandlePoint816SecondaryIcon, HandlePoint816BlueIcon, XmarkRemove16SecondaryIcon, XmarkRemove16RegularRedIcon, CheckmarkDoneSuccessCorrect16BlueIcon } from '@cloudtower/icons-react';
14
13
  import moment from 'moment';
15
14
  import { findDOMNode } from 'react-dom';
16
15
  import { isElement } from 'react-is';
@@ -24,6 +23,7 @@ import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
24
23
  import RCNotification from '@cloudtower/rc-notification';
25
24
  import { combineReducers, createStore } from 'redux';
26
25
  import { createDispatchHook, createSelectorHook, Provider } from 'react-redux';
26
+ import { XmarkRemove16SecondaryIcon, XmarkRemove16RegularRedIcon, HandlePoint816SecondaryIcon, HandlePoint816BlueIcon, CheckmarkDoneSuccessCorrect16BlueIcon } from '@cloudtower/icons-react';
27
27
  import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
28
28
  import TimeZones from 'timezones.json';
29
29
  import dayjs from 'dayjs';
@@ -253,30 +253,30 @@ function getAlertIcon(type) {
253
253
  }
254
254
  }
255
255
 
256
- var __defProp$P = Object.defineProperty;
257
- var __getOwnPropSymbols$Q = Object.getOwnPropertySymbols;
258
- var __hasOwnProp$Q = Object.prototype.hasOwnProperty;
259
- var __propIsEnum$Q = Object.prototype.propertyIsEnumerable;
260
- var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
261
- var __spreadValues$P = (a, b) => {
256
+ var __defProp$O = Object.defineProperty;
257
+ var __getOwnPropSymbols$P = Object.getOwnPropertySymbols;
258
+ var __hasOwnProp$P = Object.prototype.hasOwnProperty;
259
+ var __propIsEnum$P = Object.prototype.propertyIsEnumerable;
260
+ var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
261
+ var __spreadValues$O = (a, b) => {
262
262
  for (var prop in b || (b = {}))
263
- if (__hasOwnProp$Q.call(b, prop))
264
- __defNormalProp$P(a, prop, b[prop]);
265
- if (__getOwnPropSymbols$Q)
266
- for (var prop of __getOwnPropSymbols$Q(b)) {
267
- if (__propIsEnum$Q.call(b, prop))
268
- __defNormalProp$P(a, prop, b[prop]);
263
+ if (__hasOwnProp$P.call(b, prop))
264
+ __defNormalProp$O(a, prop, b[prop]);
265
+ if (__getOwnPropSymbols$P)
266
+ for (var prop of __getOwnPropSymbols$P(b)) {
267
+ if (__propIsEnum$P.call(b, prop))
268
+ __defNormalProp$O(a, prop, b[prop]);
269
269
  }
270
270
  return a;
271
271
  };
272
- var __objRest$t = (source, exclude) => {
272
+ var __objRest$s = (source, exclude) => {
273
273
  var target = {};
274
274
  for (var prop in source)
275
- if (__hasOwnProp$Q.call(source, prop) && exclude.indexOf(prop) < 0)
275
+ if (__hasOwnProp$P.call(source, prop) && exclude.indexOf(prop) < 0)
276
276
  target[prop] = source[prop];
277
- if (source != null && __getOwnPropSymbols$Q)
278
- for (var prop of __getOwnPropSymbols$Q(source)) {
279
- if (exclude.indexOf(prop) < 0 && __propIsEnum$Q.call(source, prop))
277
+ if (source != null && __getOwnPropSymbols$P)
278
+ for (var prop of __getOwnPropSymbols$P(source)) {
279
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$P.call(source, prop))
280
280
  target[prop] = source[prop];
281
281
  }
282
282
  return target;
@@ -294,7 +294,7 @@ const BaseIcon = React__default.forwardRef(
294
294
  prefixNode,
295
295
  suffixIconSrc: SuffixSrc,
296
296
  src: Src
297
- } = _a, HTMLSpanElementProps = __objRest$t(_a, [
297
+ } = _a, HTMLSpanElementProps = __objRest$s(_a, [
298
298
  "alt",
299
299
  "className",
300
300
  "width",
@@ -308,10 +308,10 @@ const BaseIcon = React__default.forwardRef(
308
308
  ]);
309
309
  return /* @__PURE__ */ React__default.createElement(
310
310
  "span",
311
- __spreadValues$P({
311
+ __spreadValues$O({
312
312
  ref,
313
313
  className,
314
- style: _.pickBy(__spreadValues$P({ cursor }, style))
314
+ style: _.pickBy(__spreadValues$O({ cursor }, style))
315
315
  }, HTMLSpanElementProps),
316
316
  prefixNode,
317
317
  /* @__PURE__ */ React__default.createElement("span", { className: "icon-inner" }, typeof Src === "string" ? /* @__PURE__ */ React__default.createElement("img", { alt, src: Src, width, height }) : /* @__PURE__ */ React__default.createElement(SVGUniqueID, null, Src({ width, height }))),
@@ -321,31 +321,31 @@ const BaseIcon = React__default.forwardRef(
321
321
  }
322
322
  );
323
323
 
324
- var __defProp$O = Object.defineProperty;
325
- var __defProps$y = Object.defineProperties;
326
- var __getOwnPropDescs$y = Object.getOwnPropertyDescriptors;
327
- var __getOwnPropSymbols$P = Object.getOwnPropertySymbols;
328
- var __hasOwnProp$P = Object.prototype.hasOwnProperty;
329
- var __propIsEnum$P = Object.prototype.propertyIsEnumerable;
330
- var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, {
324
+ var __defProp$N = Object.defineProperty;
325
+ var __defProps$x = Object.defineProperties;
326
+ var __getOwnPropDescs$x = Object.getOwnPropertyDescriptors;
327
+ var __getOwnPropSymbols$O = Object.getOwnPropertySymbols;
328
+ var __hasOwnProp$O = Object.prototype.hasOwnProperty;
329
+ var __propIsEnum$O = Object.prototype.propertyIsEnumerable;
330
+ var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, {
331
331
  enumerable: true,
332
332
  configurable: true,
333
333
  writable: true,
334
334
  value
335
335
  }) : obj[key] = value;
336
- var __spreadValues$O = (a, b) => {
337
- for (var prop in b || (b = {})) if (__hasOwnProp$P.call(b, prop)) __defNormalProp$O(a, prop, b[prop]);
338
- if (__getOwnPropSymbols$P) for (var prop of __getOwnPropSymbols$P(b)) {
339
- if (__propIsEnum$P.call(b, prop)) __defNormalProp$O(a, prop, b[prop]);
336
+ var __spreadValues$N = (a, b) => {
337
+ for (var prop in b || (b = {})) if (__hasOwnProp$O.call(b, prop)) __defNormalProp$N(a, prop, b[prop]);
338
+ if (__getOwnPropSymbols$O) for (var prop of __getOwnPropSymbols$O(b)) {
339
+ if (__propIsEnum$O.call(b, prop)) __defNormalProp$N(a, prop, b[prop]);
340
340
  }
341
341
  return a;
342
342
  };
343
- var __spreadProps$y = (a, b) => __defProps$y(a, __getOwnPropDescs$y(b));
344
- var __objRest$s = (source, exclude) => {
343
+ var __spreadProps$x = (a, b) => __defProps$x(a, __getOwnPropDescs$x(b));
344
+ var __objRest$r = (source, exclude) => {
345
345
  var target = {};
346
- for (var prop in source) if (__hasOwnProp$P.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
347
- if (source != null && __getOwnPropSymbols$P) for (var prop of __getOwnPropSymbols$P(source)) {
348
- if (exclude.indexOf(prop) < 0 && __propIsEnum$P.call(source, prop)) target[prop] = source[prop];
346
+ for (var prop in source) if (__hasOwnProp$O.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
347
+ if (source != null && __getOwnPropSymbols$O) for (var prop of __getOwnPropSymbols$O(source)) {
348
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$O.call(source, prop)) target[prop] = source[prop];
349
349
  }
350
350
  return target;
351
351
  };
@@ -369,7 +369,7 @@ const Icon = React__default.forwardRef((props, ref) => {
369
369
  prefix,
370
370
  suffix
371
371
  } = _a,
372
- restProps = __objRest$s(_a, ["src", "hoverSrc", "active", "activeSrc", "onMouseEnter", "onMouseLeave", "onMouseMove", "className", "iconWidth", "iconHeight", "cursor", "style", "isRotate", "prefix", "suffix"]);
372
+ restProps = __objRest$r(_a, ["src", "hoverSrc", "active", "activeSrc", "onMouseEnter", "onMouseLeave", "onMouseMove", "className", "iconWidth", "iconHeight", "cursor", "style", "isRotate", "prefix", "suffix"]);
373
373
  const [hover, setHover] = useState(false);
374
374
  const _src = useMemo(() => {
375
375
  if (active && activeSrc) {
@@ -397,14 +397,14 @@ const Icon = React__default.forwardRef((props, ref) => {
397
397
  }
398
398
  return src2;
399
399
  }, [active, hover, suffix]);
400
- return /* @__PURE__ */React__default.createElement(BaseIcon, __spreadProps$y(__spreadValues$O({
400
+ return /* @__PURE__ */React__default.createElement(BaseIcon, __spreadProps$x(__spreadValues$N({
401
401
  src: _src,
402
402
  className: cs(IconWrapper, "icon-wrapper", className, isRotate && "is-rotate"),
403
403
  suffixIconSrc,
404
404
  height: iconHeight,
405
405
  width: iconWidth,
406
406
  prefixNode: prefix,
407
- style: _.pickBy(__spreadValues$O({
407
+ style: _.pickBy(__spreadValues$N({
408
408
  cursor
409
409
  }, style))
410
410
  }, restProps), {
@@ -429,33 +429,33 @@ const Icon = React__default.forwardRef((props, ref) => {
429
429
  }));
430
430
  });
431
431
 
432
- var __defProp$N = Object.defineProperty;
433
- var __defProps$x = Object.defineProperties;
434
- var __getOwnPropDescs$x = Object.getOwnPropertyDescriptors;
435
- var __getOwnPropSymbols$O = Object.getOwnPropertySymbols;
436
- var __hasOwnProp$O = Object.prototype.hasOwnProperty;
437
- var __propIsEnum$O = Object.prototype.propertyIsEnumerable;
438
- var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
439
- var __spreadValues$N = (a, b) => {
432
+ var __defProp$M = Object.defineProperty;
433
+ var __defProps$w = Object.defineProperties;
434
+ var __getOwnPropDescs$w = Object.getOwnPropertyDescriptors;
435
+ var __getOwnPropSymbols$N = Object.getOwnPropertySymbols;
436
+ var __hasOwnProp$N = Object.prototype.hasOwnProperty;
437
+ var __propIsEnum$N = Object.prototype.propertyIsEnumerable;
438
+ var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
439
+ var __spreadValues$M = (a, b) => {
440
440
  for (var prop in b || (b = {}))
441
- if (__hasOwnProp$O.call(b, prop))
442
- __defNormalProp$N(a, prop, b[prop]);
443
- if (__getOwnPropSymbols$O)
444
- for (var prop of __getOwnPropSymbols$O(b)) {
445
- if (__propIsEnum$O.call(b, prop))
446
- __defNormalProp$N(a, prop, b[prop]);
441
+ if (__hasOwnProp$N.call(b, prop))
442
+ __defNormalProp$M(a, prop, b[prop]);
443
+ if (__getOwnPropSymbols$N)
444
+ for (var prop of __getOwnPropSymbols$N(b)) {
445
+ if (__propIsEnum$N.call(b, prop))
446
+ __defNormalProp$M(a, prop, b[prop]);
447
447
  }
448
448
  return a;
449
449
  };
450
- var __spreadProps$x = (a, b) => __defProps$x(a, __getOwnPropDescs$x(b));
451
- var __objRest$r = (source, exclude) => {
450
+ var __spreadProps$w = (a, b) => __defProps$w(a, __getOwnPropDescs$w(b));
451
+ var __objRest$q = (source, exclude) => {
452
452
  var target = {};
453
453
  for (var prop in source)
454
- if (__hasOwnProp$O.call(source, prop) && exclude.indexOf(prop) < 0)
454
+ if (__hasOwnProp$N.call(source, prop) && exclude.indexOf(prop) < 0)
455
455
  target[prop] = source[prop];
456
- if (source != null && __getOwnPropSymbols$O)
457
- for (var prop of __getOwnPropSymbols$O(source)) {
458
- if (exclude.indexOf(prop) < 0 && __propIsEnum$O.call(source, prop))
456
+ if (source != null && __getOwnPropSymbols$N)
457
+ for (var prop of __getOwnPropSymbols$N(source)) {
458
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$N.call(source, prop))
459
459
  target[prop] = source[prop];
460
460
  }
461
461
  return target;
@@ -468,7 +468,7 @@ const Alert = (_a) => {
468
468
  className,
469
469
  onClose,
470
470
  closeText
471
- } = _b, props = __objRest$r(_b, [
471
+ } = _b, props = __objRest$q(_b, [
472
472
  "type",
473
473
  "icon",
474
474
  "showIcon",
@@ -480,7 +480,7 @@ const Alert = (_a) => {
480
480
  const _type = type === "normal" ? "info" : type;
481
481
  return /* @__PURE__ */ React__default.createElement(
482
482
  Alert$1,
483
- __spreadProps$x(__spreadValues$N({}, props), {
483
+ __spreadProps$w(__spreadValues$M({}, props), {
484
484
  className: cs(type ? `alert-${type}` : "", className),
485
485
  type: _type,
486
486
  icon: icon || _icon,
@@ -508,42 +508,42 @@ const Arch = (props) => {
508
508
  return /* @__PURE__ */ React__default.createElement("span", null, text);
509
509
  };
510
510
 
511
- var __defProp$M = Object.defineProperty;
512
- var __defProps$w = Object.defineProperties;
513
- var __getOwnPropDescs$w = Object.getOwnPropertyDescriptors;
514
- var __getOwnPropSymbols$N = Object.getOwnPropertySymbols;
515
- var __hasOwnProp$N = Object.prototype.hasOwnProperty;
516
- var __propIsEnum$N = Object.prototype.propertyIsEnumerable;
517
- var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
518
- var __spreadValues$M = (a, b) => {
511
+ var __defProp$L = Object.defineProperty;
512
+ var __defProps$v = Object.defineProperties;
513
+ var __getOwnPropDescs$v = Object.getOwnPropertyDescriptors;
514
+ var __getOwnPropSymbols$M = Object.getOwnPropertySymbols;
515
+ var __hasOwnProp$M = Object.prototype.hasOwnProperty;
516
+ var __propIsEnum$M = Object.prototype.propertyIsEnumerable;
517
+ var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
518
+ var __spreadValues$L = (a, b) => {
519
519
  for (var prop in b || (b = {}))
520
- if (__hasOwnProp$N.call(b, prop))
521
- __defNormalProp$M(a, prop, b[prop]);
522
- if (__getOwnPropSymbols$N)
523
- for (var prop of __getOwnPropSymbols$N(b)) {
524
- if (__propIsEnum$N.call(b, prop))
525
- __defNormalProp$M(a, prop, b[prop]);
520
+ if (__hasOwnProp$M.call(b, prop))
521
+ __defNormalProp$L(a, prop, b[prop]);
522
+ if (__getOwnPropSymbols$M)
523
+ for (var prop of __getOwnPropSymbols$M(b)) {
524
+ if (__propIsEnum$M.call(b, prop))
525
+ __defNormalProp$L(a, prop, b[prop]);
526
526
  }
527
527
  return a;
528
528
  };
529
- var __spreadProps$w = (a, b) => __defProps$w(a, __getOwnPropDescs$w(b));
530
- var __objRest$q = (source, exclude) => {
529
+ var __spreadProps$v = (a, b) => __defProps$v(a, __getOwnPropDescs$v(b));
530
+ var __objRest$p = (source, exclude) => {
531
531
  var target = {};
532
532
  for (var prop in source)
533
- if (__hasOwnProp$N.call(source, prop) && exclude.indexOf(prop) < 0)
533
+ if (__hasOwnProp$M.call(source, prop) && exclude.indexOf(prop) < 0)
534
534
  target[prop] = source[prop];
535
- if (source != null && __getOwnPropSymbols$N)
536
- for (var prop of __getOwnPropSymbols$N(source)) {
537
- if (exclude.indexOf(prop) < 0 && __propIsEnum$N.call(source, prop))
535
+ if (source != null && __getOwnPropSymbols$M)
536
+ for (var prop of __getOwnPropSymbols$M(source)) {
537
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$M.call(source, prop))
538
538
  target[prop] = source[prop];
539
539
  }
540
540
  return target;
541
541
  };
542
542
  const Badge = (_a) => {
543
- var _b = _a, { type = "error", className } = _b, props = __objRest$q(_b, ["type", "className"]);
543
+ var _b = _a, { type = "error", className } = _b, props = __objRest$p(_b, ["type", "className"]);
544
544
  return /* @__PURE__ */ React__default.createElement(
545
545
  Badge$1,
546
- __spreadProps$w(__spreadValues$M({
546
+ __spreadProps$v(__spreadValues$L({
547
547
  className: cx(`badge-${type}`, className)
548
548
  }, props), {
549
549
  showZero: false
@@ -563,36 +563,6 @@ const Empty = (props) => {
563
563
  return /* @__PURE__ */ React__default.createElement("span", { className, style }, "-");
564
564
  };
565
565
 
566
- var __defProp$L = Object.defineProperty;
567
- var __getOwnPropSymbols$M = Object.getOwnPropertySymbols;
568
- var __hasOwnProp$M = Object.prototype.hasOwnProperty;
569
- var __propIsEnum$M = Object.prototype.propertyIsEnumerable;
570
- var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
571
- var __spreadValues$L = (a, b) => {
572
- for (var prop in b || (b = {}))
573
- if (__hasOwnProp$M.call(b, prop))
574
- __defNormalProp$L(a, prop, b[prop]);
575
- if (__getOwnPropSymbols$M)
576
- for (var prop of __getOwnPropSymbols$M(b)) {
577
- if (__propIsEnum$M.call(b, prop))
578
- __defNormalProp$L(a, prop, b[prop]);
579
- }
580
- return a;
581
- };
582
- const Bit = ({
583
- rawValue,
584
- decimals,
585
- unitClassName,
586
- valueClassName,
587
- emptyProps
588
- }) => {
589
- if (isEmpty(rawValue)) {
590
- return /* @__PURE__ */ React__default.createElement(Empty, __spreadValues$L({}, emptyProps));
591
- }
592
- const { value, unit } = formatBits(rawValue, decimals);
593
- 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}`));
594
- };
595
-
596
566
  var __defProp$K = Object.defineProperty;
597
567
  var __getOwnPropSymbols$L = Object.getOwnPropertySymbols;
598
568
  var __hasOwnProp$L = Object.prototype.hasOwnProperty;
@@ -609,17 +579,17 @@ var __spreadValues$K = (a, b) => {
609
579
  }
610
580
  return a;
611
581
  };
612
- const BitPerSeconds = ({
582
+ const Bit = ({
613
583
  rawValue,
614
584
  decimals,
615
- valueClassName,
616
585
  unitClassName,
586
+ valueClassName,
617
587
  emptyProps
618
588
  }) => {
619
589
  if (isEmpty(rawValue)) {
620
590
  return /* @__PURE__ */ React__default.createElement(Empty, __spreadValues$K({}, emptyProps));
621
591
  }
622
- const { value, unit } = formatBitPerSecond(rawValue, decimals);
592
+ const { value, unit } = formatBits(rawValue, decimals);
623
593
  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}`));
624
594
  };
625
595
 
@@ -639,7 +609,7 @@ var __spreadValues$J = (a, b) => {
639
609
  }
640
610
  return a;
641
611
  };
642
- const Bps = ({
612
+ const BitPerSeconds = ({
643
613
  rawValue,
644
614
  decimals,
645
615
  valueClassName,
@@ -649,6 +619,36 @@ const Bps = ({
649
619
  if (isEmpty(rawValue)) {
650
620
  return /* @__PURE__ */ React__default.createElement(Empty, __spreadValues$J({}, emptyProps));
651
621
  }
622
+ const { value, unit } = formatBitPerSecond(rawValue, decimals);
623
+ 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}`));
624
+ };
625
+
626
+ var __defProp$I = Object.defineProperty;
627
+ var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
628
+ var __hasOwnProp$J = Object.prototype.hasOwnProperty;
629
+ var __propIsEnum$J = Object.prototype.propertyIsEnumerable;
630
+ var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
631
+ var __spreadValues$I = (a, b) => {
632
+ for (var prop in b || (b = {}))
633
+ if (__hasOwnProp$J.call(b, prop))
634
+ __defNormalProp$I(a, prop, b[prop]);
635
+ if (__getOwnPropSymbols$J)
636
+ for (var prop of __getOwnPropSymbols$J(b)) {
637
+ if (__propIsEnum$J.call(b, prop))
638
+ __defNormalProp$I(a, prop, b[prop]);
639
+ }
640
+ return a;
641
+ };
642
+ const Bps = ({
643
+ rawValue,
644
+ decimals,
645
+ valueClassName,
646
+ unitClassName,
647
+ emptyProps
648
+ }) => {
649
+ if (isEmpty(rawValue)) {
650
+ return /* @__PURE__ */ React__default.createElement(Empty, __spreadValues$I({}, emptyProps));
651
+ }
652
652
  const { value, unit } = formatBps(rawValue, decimals);
653
653
  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}`));
654
654
  };
@@ -788,28 +788,28 @@ const HoverableElement = (props) => {
788
788
  return icon != null ? React__default.cloneElement(icon, { className }) : null;
789
789
  };
790
790
 
791
- var __defProp$I = Object.defineProperty;
792
- var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
793
- var __hasOwnProp$J = Object.prototype.hasOwnProperty;
794
- var __propIsEnum$J = Object.prototype.propertyIsEnumerable;
795
- var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, {
791
+ var __defProp$H = Object.defineProperty;
792
+ var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
793
+ var __hasOwnProp$I = Object.prototype.hasOwnProperty;
794
+ var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
795
+ var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, {
796
796
  enumerable: true,
797
797
  configurable: true,
798
798
  writable: true,
799
799
  value
800
800
  }) : obj[key] = value;
801
- var __spreadValues$I = (a, b) => {
802
- for (var prop in b || (b = {})) if (__hasOwnProp$J.call(b, prop)) __defNormalProp$I(a, prop, b[prop]);
803
- if (__getOwnPropSymbols$J) for (var prop of __getOwnPropSymbols$J(b)) {
804
- if (__propIsEnum$J.call(b, prop)) __defNormalProp$I(a, prop, b[prop]);
801
+ var __spreadValues$H = (a, b) => {
802
+ for (var prop in b || (b = {})) if (__hasOwnProp$I.call(b, prop)) __defNormalProp$H(a, prop, b[prop]);
803
+ if (__getOwnPropSymbols$I) for (var prop of __getOwnPropSymbols$I(b)) {
804
+ if (__propIsEnum$I.call(b, prop)) __defNormalProp$H(a, prop, b[prop]);
805
805
  }
806
806
  return a;
807
807
  };
808
- var __objRest$p = (source, exclude) => {
808
+ var __objRest$o = (source, exclude) => {
809
809
  var target = {};
810
- for (var prop in source) if (__hasOwnProp$J.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
811
- if (source != null && __getOwnPropSymbols$J) for (var prop of __getOwnPropSymbols$J(source)) {
812
- if (exclude.indexOf(prop) < 0 && __propIsEnum$J.call(source, prop)) target[prop] = source[prop];
810
+ for (var prop in source) if (__hasOwnProp$I.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
811
+ if (source != null && __getOwnPropSymbols$I) for (var prop of __getOwnPropSymbols$I(source)) {
812
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$I.call(source, prop)) target[prop] = source[prop];
813
813
  }
814
814
  return target;
815
815
  };
@@ -832,11 +832,11 @@ const Button = React__default.forwardRef((props, ref) => {
832
832
  onMouseLeave,
833
833
  size = "middle"
834
834
  } = _a,
835
- restProps = __objRest$p(_a, ["type", "className", "children", "prefixIcon", "hoverPrefixIcon", "suffixIcon", "hoverSuffixIcon", "onMouseEnter", "onMouseLeave", "size"]);
835
+ restProps = __objRest$o(_a, ["type", "className", "children", "prefixIcon", "hoverPrefixIcon", "suffixIcon", "hoverSuffixIcon", "onMouseEnter", "onMouseLeave", "size"]);
836
836
  const [status, setStatus] = useState("normal");
837
837
  const hasIcon = prefixIcon || suffixIcon;
838
838
  const hasHoverIcon = hoverPrefixIcon || hoverSuffixIcon;
839
- return /* @__PURE__ */React__default.createElement(Button$1, __spreadValues$I({
839
+ return /* @__PURE__ */React__default.createElement(Button$1, __spreadValues$H({
840
840
  ref,
841
841
  className: cs(className, ButtonStyle$1, type === "link" && NoPadding, (prefixIcon || suffixIcon) && "has-icon", size === "large" && Typo.Label.l1_regular_title, size === "middle" && Typo.Label.l2_regular_title, size === "small" && Typo.Label.l3_regular_title, type && `ant-btn-${type}`, !children && children !== 0 && restProps.icon && "ant-btn-icon-only"),
842
842
  type: isAntdButtonTypes(type) ? type : void 0,
@@ -866,33 +866,33 @@ const Button = React__default.forwardRef((props, ref) => {
866
866
  }));
867
867
  });
868
868
 
869
- var __defProp$H = Object.defineProperty;
870
- var __defProps$v = Object.defineProperties;
871
- var __getOwnPropDescs$v = Object.getOwnPropertyDescriptors;
872
- var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
873
- var __hasOwnProp$I = Object.prototype.hasOwnProperty;
874
- var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
875
- var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
876
- var __spreadValues$H = (a, b) => {
869
+ var __defProp$G = Object.defineProperty;
870
+ var __defProps$u = Object.defineProperties;
871
+ var __getOwnPropDescs$u = Object.getOwnPropertyDescriptors;
872
+ var __getOwnPropSymbols$H = Object.getOwnPropertySymbols;
873
+ var __hasOwnProp$H = Object.prototype.hasOwnProperty;
874
+ var __propIsEnum$H = Object.prototype.propertyIsEnumerable;
875
+ var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
876
+ var __spreadValues$G = (a, b) => {
877
877
  for (var prop in b || (b = {}))
878
- if (__hasOwnProp$I.call(b, prop))
879
- __defNormalProp$H(a, prop, b[prop]);
880
- if (__getOwnPropSymbols$I)
881
- for (var prop of __getOwnPropSymbols$I(b)) {
882
- if (__propIsEnum$I.call(b, prop))
883
- __defNormalProp$H(a, prop, b[prop]);
878
+ if (__hasOwnProp$H.call(b, prop))
879
+ __defNormalProp$G(a, prop, b[prop]);
880
+ if (__getOwnPropSymbols$H)
881
+ for (var prop of __getOwnPropSymbols$H(b)) {
882
+ if (__propIsEnum$H.call(b, prop))
883
+ __defNormalProp$G(a, prop, b[prop]);
884
884
  }
885
885
  return a;
886
886
  };
887
- var __spreadProps$v = (a, b) => __defProps$v(a, __getOwnPropDescs$v(b));
888
- var __objRest$o = (source, exclude) => {
887
+ var __spreadProps$u = (a, b) => __defProps$u(a, __getOwnPropDescs$u(b));
888
+ var __objRest$n = (source, exclude) => {
889
889
  var target = {};
890
890
  for (var prop in source)
891
- if (__hasOwnProp$I.call(source, prop) && exclude.indexOf(prop) < 0)
891
+ if (__hasOwnProp$H.call(source, prop) && exclude.indexOf(prop) < 0)
892
892
  target[prop] = source[prop];
893
- if (source != null && __getOwnPropSymbols$I)
894
- for (var prop of __getOwnPropSymbols$I(source)) {
895
- if (exclude.indexOf(prop) < 0 && __propIsEnum$I.call(source, prop))
893
+ if (source != null && __getOwnPropSymbols$H)
894
+ for (var prop of __getOwnPropSymbols$H(source)) {
895
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$H.call(source, prop))
896
896
  target[prop] = source[prop];
897
897
  }
898
898
  return target;
@@ -904,7 +904,7 @@ const Tooltip = (props) => {
904
904
  overlayClassName,
905
905
  overlayStyle,
906
906
  children
907
- } = _a, restProps = __objRest$o(_a, [
907
+ } = _a, restProps = __objRest$n(_a, [
908
908
  "followMouse",
909
909
  "overlayClassName",
910
910
  "overlayStyle",
@@ -946,10 +946,10 @@ const Tooltip = (props) => {
946
946
  }, [followMouse, onmousemove, uniqueContainerClass]);
947
947
  return /* @__PURE__ */ React__default.createElement(
948
948
  Tooltip$1,
949
- __spreadProps$v(__spreadValues$H({}, restProps), {
949
+ __spreadProps$u(__spreadValues$G({}, restProps), {
950
950
  overlayClassName: followMouse ? cs(overlayClassName, uniquePopupClass) : overlayClassName,
951
951
  children: _children,
952
- overlayStyle: followMouse ? __spreadValues$H({
952
+ overlayStyle: followMouse ? __spreadValues$G({
953
953
  transform: "translate(-50%, -100%)",
954
954
  pointerEvents: "none"
955
955
  }, overlayStyle) : overlayStyle
@@ -957,28 +957,28 @@ const Tooltip = (props) => {
957
957
  );
958
958
  };
959
959
 
960
- var __defProp$G = Object.defineProperty;
961
- var __getOwnPropSymbols$H = Object.getOwnPropertySymbols;
962
- var __hasOwnProp$H = Object.prototype.hasOwnProperty;
963
- var __propIsEnum$H = Object.prototype.propertyIsEnumerable;
964
- var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, {
960
+ var __defProp$F = Object.defineProperty;
961
+ var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
962
+ var __hasOwnProp$G = Object.prototype.hasOwnProperty;
963
+ var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
964
+ var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, {
965
965
  enumerable: true,
966
966
  configurable: true,
967
967
  writable: true,
968
968
  value
969
969
  }) : obj[key] = value;
970
- var __spreadValues$G = (a, b) => {
971
- for (var prop in b || (b = {})) if (__hasOwnProp$H.call(b, prop)) __defNormalProp$G(a, prop, b[prop]);
972
- if (__getOwnPropSymbols$H) for (var prop of __getOwnPropSymbols$H(b)) {
973
- if (__propIsEnum$H.call(b, prop)) __defNormalProp$G(a, prop, b[prop]);
970
+ var __spreadValues$F = (a, b) => {
971
+ for (var prop in b || (b = {})) if (__hasOwnProp$G.call(b, prop)) __defNormalProp$F(a, prop, b[prop]);
972
+ if (__getOwnPropSymbols$G) for (var prop of __getOwnPropSymbols$G(b)) {
973
+ if (__propIsEnum$G.call(b, prop)) __defNormalProp$F(a, prop, b[prop]);
974
974
  }
975
975
  return a;
976
976
  };
977
- var __objRest$n = (source, exclude) => {
977
+ var __objRest$m = (source, exclude) => {
978
978
  var target = {};
979
- for (var prop in source) if (__hasOwnProp$H.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
980
- if (source != null && __getOwnPropSymbols$H) for (var prop of __getOwnPropSymbols$H(source)) {
981
- if (exclude.indexOf(prop) < 0 && __propIsEnum$H.call(source, prop)) target[prop] = source[prop];
979
+ for (var prop in source) if (__hasOwnProp$G.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
980
+ if (source != null && __getOwnPropSymbols$G) for (var prop of __getOwnPropSymbols$G(source)) {
981
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$G.call(source, prop)) target[prop] = source[prop];
982
982
  }
983
983
  return target;
984
984
  };
@@ -1013,7 +1013,7 @@ const ButtonGroup = React__default.forwardRef((props, ref) => {
1013
1013
  hideTitle,
1014
1014
  title
1015
1015
  } = _a,
1016
- buttonPropArgs = __objRest$n(_a, ["key", "icon", "type", "children", "danger", "ghost", "className", "hideTitle", "title"]);
1016
+ buttonPropArgs = __objRest$m(_a, ["key", "icon", "type", "children", "danger", "ghost", "className", "hideTitle", "title"]);
1017
1017
  if (hideTitle) {
1018
1018
  return /* @__PURE__ */React__default.createElement(Tooltip, {
1019
1019
  key: key || index,
@@ -1022,7 +1022,7 @@ const ButtonGroup = React__default.forwardRef((props, ref) => {
1022
1022
  style: {
1023
1023
  cursor: "not-allowed"
1024
1024
  }
1025
- }, /* @__PURE__ */React__default.createElement(Button, __spreadValues$G({
1025
+ }, /* @__PURE__ */React__default.createElement(Button, __spreadValues$F({
1026
1026
  style: {
1027
1027
  pointerEvents: "none"
1028
1028
  },
@@ -1032,7 +1032,7 @@ const ButtonGroup = React__default.forwardRef((props, ref) => {
1032
1032
  ghost,
1033
1033
  className: cx(ButtonStyle, className2),
1034
1034
  prefixIcon: icon
1035
- }, buttonPropArgs))) : /* @__PURE__ */React__default.createElement(Button, __spreadValues$G({
1035
+ }, buttonPropArgs))) : /* @__PURE__ */React__default.createElement(Button, __spreadValues$F({
1036
1036
  type,
1037
1037
  size,
1038
1038
  danger,
@@ -1041,7 +1041,7 @@ const ButtonGroup = React__default.forwardRef((props, ref) => {
1041
1041
  prefixIcon: icon
1042
1042
  }, buttonPropArgs)));
1043
1043
  }
1044
- return /* @__PURE__ */React__default.createElement(Button, __spreadValues$G({
1044
+ return /* @__PURE__ */React__default.createElement(Button, __spreadValues$F({
1045
1045
  key: key || index,
1046
1046
  type,
1047
1047
  size,
@@ -1055,19 +1055,19 @@ const ButtonGroup = React__default.forwardRef((props, ref) => {
1055
1055
  }));
1056
1056
  });
1057
1057
 
1058
- var __defProp$F = Object.defineProperty;
1059
- var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
1060
- var __hasOwnProp$G = Object.prototype.hasOwnProperty;
1061
- var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
1062
- var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1063
- var __spreadValues$F = (a, b) => {
1058
+ var __defProp$E = Object.defineProperty;
1059
+ var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
1060
+ var __hasOwnProp$F = Object.prototype.hasOwnProperty;
1061
+ var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
1062
+ var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1063
+ var __spreadValues$E = (a, b) => {
1064
1064
  for (var prop in b || (b = {}))
1065
- if (__hasOwnProp$G.call(b, prop))
1066
- __defNormalProp$F(a, prop, b[prop]);
1067
- if (__getOwnPropSymbols$G)
1068
- for (var prop of __getOwnPropSymbols$G(b)) {
1069
- if (__propIsEnum$G.call(b, prop))
1070
- __defNormalProp$F(a, prop, b[prop]);
1065
+ if (__hasOwnProp$F.call(b, prop))
1066
+ __defNormalProp$E(a, prop, b[prop]);
1067
+ if (__getOwnPropSymbols$F)
1068
+ for (var prop of __getOwnPropSymbols$F(b)) {
1069
+ if (__propIsEnum$F.call(b, prop))
1070
+ __defNormalProp$E(a, prop, b[prop]);
1071
1071
  }
1072
1072
  return a;
1073
1073
  };
@@ -1081,7 +1081,7 @@ const Byte = ({
1081
1081
  }) => {
1082
1082
  const { t } = useParrotTranslation();
1083
1083
  if (isEmpty(rawValue)) {
1084
- return /* @__PURE__ */ React__default.createElement(Empty, __spreadValues$F({}, emptyProps));
1084
+ return /* @__PURE__ */ React__default.createElement(Empty, __spreadValues$E({}, emptyProps));
1085
1085
  }
1086
1086
  if (rawValue === -1) {
1087
1087
  return /* @__PURE__ */ React__default.createElement("span", null, t("common.calculation"));
@@ -1093,118 +1093,6 @@ const Byte = ({
1093
1093
  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}`));
1094
1094
  };
1095
1095
 
1096
- const CardBody = /*#__PURE__*/styled('div')({
1097
- name: "CardBody",
1098
- class: "c1k4vanq",
1099
- propsAsIs: false
1100
- });
1101
-
1102
- const CardTitle = /*#__PURE__*/styled('div')({
1103
- name: "CardTitle",
1104
- class: "c1udgdh2",
1105
- propsAsIs: false
1106
- });
1107
-
1108
- const boxShadow = "bab9xum";
1109
- const Wrapper = forwardRef(props => {
1110
- const {
1111
- children,
1112
- className,
1113
- shadow
1114
- } = props;
1115
- return /* @__PURE__ */React__default.createElement("div", {
1116
- className: cs({
1117
- [boxShadow]: shadow
1118
- }, className)
1119
- }, children);
1120
- });
1121
- const _exp$3 = () => Wrapper;
1122
- const CardWrapper = /*#__PURE__*/styled(_exp$3())({
1123
- name: "CardWrapper",
1124
- class: "cav4gt6",
1125
- propsAsIs: true
1126
- });
1127
-
1128
- var __defProp$E = Object.defineProperty;
1129
- var __defProps$u = Object.defineProperties;
1130
- var __getOwnPropDescs$u = Object.getOwnPropertyDescriptors;
1131
- var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
1132
- var __hasOwnProp$F = Object.prototype.hasOwnProperty;
1133
- var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
1134
- var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1135
- var __spreadValues$E = (a, b) => {
1136
- for (var prop in b || (b = {}))
1137
- if (__hasOwnProp$F.call(b, prop))
1138
- __defNormalProp$E(a, prop, b[prop]);
1139
- if (__getOwnPropSymbols$F)
1140
- for (var prop of __getOwnPropSymbols$F(b)) {
1141
- if (__propIsEnum$F.call(b, prop))
1142
- __defNormalProp$E(a, prop, b[prop]);
1143
- }
1144
- return a;
1145
- };
1146
- var __spreadProps$u = (a, b) => __defProps$u(a, __getOwnPropDescs$u(b));
1147
- var __objRest$m = (source, exclude) => {
1148
- var target = {};
1149
- for (var prop in source)
1150
- if (__hasOwnProp$F.call(source, prop) && exclude.indexOf(prop) < 0)
1151
- target[prop] = source[prop];
1152
- if (source != null && __getOwnPropSymbols$F)
1153
- for (var prop of __getOwnPropSymbols$F(source)) {
1154
- if (exclude.indexOf(prop) < 0 && __propIsEnum$F.call(source, prop))
1155
- target[prop] = source[prop];
1156
- }
1157
- return target;
1158
- };
1159
- const Card = React__default.forwardRef(
1160
- (props, ref) => {
1161
- const _a = props, {
1162
- collapsible = false,
1163
- title,
1164
- subInfo,
1165
- className,
1166
- defaultOpen = false,
1167
- shadow = true
1168
- } = _a, domProps = __objRest$m(_a, [
1169
- "collapsible",
1170
- "title",
1171
- "subInfo",
1172
- "className",
1173
- "defaultOpen",
1174
- "shadow"
1175
- ]);
1176
- const [open, setOpen] = useState(defaultOpen);
1177
- return /* @__PURE__ */ React__default.createElement(
1178
- CardWrapper,
1179
- __spreadProps$u(__spreadValues$E({
1180
- ref,
1181
- className: cs(["card-wrapper", className])
1182
- }, domProps), {
1183
- shadow
1184
- }),
1185
- title && /* @__PURE__ */ React__default.createElement(
1186
- CardTitle,
1187
- {
1188
- className: cs(["card-title", collapsible ? "has-arrow" : ""])
1189
- },
1190
- /* @__PURE__ */ React__default.createElement(
1191
- "div",
1192
- {
1193
- className: cs(["title-wrapper", open ? "is-open" : ""]),
1194
- onClick: () => {
1195
- collapsible && setOpen(!open);
1196
- }
1197
- },
1198
- collapsible && /* @__PURE__ */ React__default.createElement(Icon, { className: "collapse-arrow", src: ArrowRightGrayIcon }),
1199
- title
1200
- ),
1201
- subInfo && /* @__PURE__ */ React__default.createElement("div", { className: "sub-info" }, subInfo)
1202
- ),
1203
- (!collapsible || open) && /* @__PURE__ */ React__default.createElement(CardBody, { className: "card-body" }, props.children)
1204
- );
1205
- }
1206
- );
1207
-
1208
1096
  var __defProp$D = Object.defineProperty;
1209
1097
  var __defProps$t = Object.defineProperties;
1210
1098
  var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
@@ -4381,35 +4269,7 @@ var __spreadValues$5 = (a, b) => {
4381
4269
  return a;
4382
4270
  };
4383
4271
  var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
4384
- const TableFormRowDeleteAction = (props) => {
4385
- var _a, _b, _c, _d;
4386
- const { deleteConfig, row, updateData, rowIndex, data } = props;
4387
- const { t } = useParrotTranslation();
4388
- if (typeof (row == null ? void 0 : row.deletable) === "function" && !row.deletable(rowIndex, data)) {
4389
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null);
4390
- }
4391
- const disableActionsFromRowConfig = typeof (row == null ? void 0 : row.disableActions) === "object" ? row.disableActions : (_b = (_a = row == null ? void 0 : row.disableActions) == null ? void 0 : _a.call(row, rowIndex, data)) != null ? _b : [];
4392
- const isRowDeleteDisabled = (_d = disableActionsFromRowConfig.includes("delete") || ((_c = deleteConfig == null ? void 0 : deleteConfig.specifyRowDeleteDisabled) == null ? void 0 : _c.call(deleteConfig, rowIndex, data))) != null ? _d : false;
4393
- const DeleteIcon = /* @__PURE__ */ React__default.createElement(
4394
- Icon,
4395
- {
4396
- className: cx("delete-row-icon", isRowDeleteDisabled && "disabled"),
4397
- src: XmarkRemove16SecondaryIcon,
4398
- hoverSrc: isRowDeleteDisabled ? void 0 : XmarkRemove16RegularRedIcon,
4399
- onClick: () => {
4400
- if (isRowDeleteDisabled)
4401
- return;
4402
- const newData = [...data];
4403
- newData.splice(rowIndex, 1);
4404
- updateData(newData);
4405
- }
4406
- }
4407
- );
4408
- const DeleteAction = isRowDeleteDisabled ? DeleteIcon : /* @__PURE__ */ React__default.createElement(Tooltip, { title: t("components.remove") }, DeleteIcon);
4409
- return DeleteAction;
4410
- };
4411
4272
  const TableFormRow = (props) => {
4412
- var _a;
4413
4273
  const {
4414
4274
  data,
4415
4275
  columns,
@@ -4422,21 +4282,49 @@ const TableFormRow = (props) => {
4422
4282
  provided,
4423
4283
  snapshot,
4424
4284
  validateTriggerType = ValidateTriggerType.Normal,
4425
- row,
4426
4285
  updateData,
4427
4286
  onBodyBlur,
4428
4287
  renderRowDescription,
4288
+ rowValidator,
4429
4289
  validateAll
4430
4290
  } = props;
4291
+ const { t } = useParrotTranslation();
4431
4292
  const rowData = data[rowIndex];
4432
4293
  const [rowError, setRowError] = useState();
4433
- const rowValidator = (row == null ? void 0 : row.validator) || props.rowValidator;
4434
- const rowDeletable = typeof (row == null ? void 0 : row.deletable) === "boolean" ? row.deletable : (_a = typeof (row == null ? void 0 : row.deletable) === "function" || (deleteConfig == null ? void 0 : deleteConfig.deletable)) != null ? _a : false;
4294
+ const deleteRow = useCallback(
4295
+ (index, data2) => {
4296
+ const newData = [...data2];
4297
+ newData.splice(index, 1);
4298
+ updateData(newData);
4299
+ },
4300
+ [updateData]
4301
+ );
4302
+ const RowActions = useMemo(() => {
4303
+ var _a;
4304
+ const isRowDeleteDisabled = (_a = deleteConfig == null ? void 0 : deleteConfig.specifyRowDeleteDisabled) == null ? void 0 : _a.call(
4305
+ deleteConfig,
4306
+ rowIndex,
4307
+ data
4308
+ );
4309
+ const DeleteIcon = /* @__PURE__ */ React__default.createElement(
4310
+ Icon,
4311
+ {
4312
+ className: cx("delete-row-icon", isRowDeleteDisabled && "disabled"),
4313
+ src: XmarkRemove16SecondaryIcon,
4314
+ hoverSrc: isRowDeleteDisabled ? void 0 : XmarkRemove16RegularRedIcon,
4315
+ onClick: () => {
4316
+ if (isRowDeleteDisabled)
4317
+ return;
4318
+ deleteRow(rowIndex, data);
4319
+ }
4320
+ }
4321
+ );
4322
+ const FinalRenderIcon = isRowDeleteDisabled ? DeleteIcon : /* @__PURE__ */ React__default.createElement(Tooltip, { title: t("components.remove") }, DeleteIcon);
4323
+ return (deleteConfig == null ? void 0 : deleteConfig.deletable) ? [FinalRenderIcon] : void 0;
4324
+ }, [deleteConfig, rowIndex, data, t, deleteRow]);
4435
4325
  const getRowValidateResult = useCallback(
4436
4326
  (rowData2) => {
4437
- if (!rowValidator)
4438
- return;
4439
- const result = rowValidator(rowIndex, rowData2);
4327
+ const result = rowValidator == null ? void 0 : rowValidator(rowIndex, rowData2);
4440
4328
  setRowError(result);
4441
4329
  return result;
4442
4330
  },
@@ -4473,14 +4361,13 @@ const TableFormRow = (props) => {
4473
4361
  [draggable, provided]
4474
4362
  );
4475
4363
  const RowDescription = useMemo(() => {
4476
- const rowDescFuncParams = {
4364
+ const RenderResult = (renderRowDescription == null ? void 0 : renderRowDescription({
4477
4365
  rowIndex,
4478
4366
  rowData,
4479
4367
  latestData
4480
- };
4481
- const DescriptionResult = typeof (row == null ? void 0 : row.descriptions) == "object" ? row.descriptions[rowIndex] : typeof (row == null ? void 0 : row.customizedDescription) === "function" ? row.customizedDescription(rowDescFuncParams) : (renderRowDescription == null ? void 0 : renderRowDescription(rowDescFuncParams)) || null;
4482
- return typeof DescriptionResult === "string" ? /* @__PURE__ */ React__default.createElement("p", { className: cx(Typo.Label.l4_regular, "row-description") }, DescriptionResult) : DescriptionResult;
4483
- }, [rowIndex, rowData, latestData, renderRowDescription, row]);
4368
+ })) || null;
4369
+ return typeof RenderResult === "string" ? /* @__PURE__ */ React__default.createElement("p", { className: cx(Typo.Label.l4_regular, "row-description") }, RenderResult) : RenderResult;
4370
+ }, [rowIndex, rowData, latestData, renderRowDescription]);
4484
4371
  return /* @__PURE__ */ React__default.createElement(
4485
4372
  List.Item,
4486
4373
  {
@@ -4489,18 +4376,7 @@ const TableFormRow = (props) => {
4489
4376
  "eagle-table-form-row",
4490
4377
  (snapshot == null ? void 0 : snapshot.isDragging) && "isDragging"
4491
4378
  ),
4492
- actions: rowDeletable ? [
4493
- /* @__PURE__ */ React__default.createElement(
4494
- TableFormRowDeleteAction,
4495
- {
4496
- data,
4497
- rowIndex,
4498
- deleteConfig,
4499
- row,
4500
- updateData
4501
- }
4502
- )
4503
- ] : void 0
4379
+ actions: RowActions
4504
4380
  },
4505
4381
  DraggableHandle,
4506
4382
  Cells,
@@ -4651,33 +4527,30 @@ var __spreadValues$3 = (a, b) => {
4651
4527
  var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
4652
4528
  const DEFAULT_ROW_COUNT = 3;
4653
4529
  const TableForm = React__default.forwardRef(
4654
- (props, ref) => {
4655
- var _a, _b;
4656
- const {
4657
- defaultData,
4658
- columns,
4659
- disabled,
4660
- rowAddConfig,
4661
- deleteConfig,
4662
- size = "default",
4663
- className,
4664
- disableBatchFilling = false,
4665
- validateTriggerType,
4666
- maxHeight,
4667
- renderRowDescription,
4668
- rowValidator,
4669
- onHeaderChange,
4670
- onHeaderBlur,
4671
- onBodyChange,
4672
- onBodyBlur,
4673
- row
4674
- } = props;
4675
- const [data, setData] = useState(defaultData || []);
4530
+ ({
4531
+ defaultData = [],
4532
+ columns,
4533
+ disabled,
4534
+ rowAddConfig,
4535
+ deleteConfig,
4536
+ size = "default",
4537
+ className,
4538
+ draggable,
4539
+ disableBatchFilling = false,
4540
+ rowSplitType = "border",
4541
+ validateTriggerType,
4542
+ maxHeight,
4543
+ renderRowDescription,
4544
+ rowValidator,
4545
+ onHeaderChange,
4546
+ onHeaderBlur,
4547
+ onBodyChange,
4548
+ onBodyBlur
4549
+ }, ref) => {
4550
+ const [data, setData] = useState(defaultData);
4676
4551
  const [passwordVisible, setPasswordVisible] = useState(false);
4677
- const [latestData, setLatestData] = useState(defaultData || []);
4552
+ const [latestData, setLatestData] = useState(defaultData);
4678
4553
  const [validateAll, setValidateAll] = useState(false);
4679
- const rowSplitType = (row == null ? void 0 : row.splitType) || props.rowSplitType || "border";
4680
- const draggable = (_b = (_a = row == null ? void 0 : row.draggable) != null ? _a : props.draggable) != null ? _b : false;
4681
4554
  const updateData = useCallback(
4682
4555
  (value, rowIndex, columnKey) => {
4683
4556
  setLatestData(value);
@@ -4687,7 +4560,7 @@ const TableForm = React__default.forwardRef(
4687
4560
  [onBodyChange]
4688
4561
  );
4689
4562
  useLayoutEffect(() => {
4690
- if (!defaultData) {
4563
+ if (defaultData.length === 0) {
4691
4564
  updateData(
4692
4565
  [...Array(DEFAULT_ROW_COUNT)].map(() => genEmptyRow(columns))
4693
4566
  );
@@ -4782,7 +4655,6 @@ const TableForm = React__default.forwardRef(
4782
4655
  draggable,
4783
4656
  rowSplitType,
4784
4657
  validateTriggerType,
4785
- row,
4786
4658
  onBodyBlur,
4787
4659
  updateData,
4788
4660
  renderRowDescription,
@@ -5039,8 +4911,7 @@ function getAntdKit() {
5039
4911
  antdSwitch: Switch$1,
5040
4912
  antdCollapse: Collapse,
5041
4913
  antdTreeSelect: TreeSelect,
5042
- antdDrawer: Drawer,
5043
- card: Card
4914
+ antdDrawer: Drawer
5044
4915
  };
5045
4916
  kit.option.isSelectOption = true;
5046
4917
  kit.button.__ANT_BUTTON = true;