@cloudtower/eagle 0.26.14 → 0.26.15

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,4 +1,4 @@
1
- import { Alert as Alert$1, Tooltip as Tooltip$1, Badge as Badge$1, Button as Button$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 as Tag$1, 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';
1
+ import { Alert as Alert$1, Badge as Badge$1, Button as Button$1, Tooltip as Tooltip$1, Checkbox as Checkbox$1, Card as Card$1, Collapse, 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 as Tag$1, Row, Col, Tree, Divider, Skeleton, Layout, AutoComplete, Popover, Timeline, Typography, Cascader, Upload, Calendar, Tabs, message, Empty as Empty$1, TreeSelect, Drawer, ConfigProvider } from 'antd';
2
2
  export { Col, Row } from 'antd';
3
3
  import * as React from 'react';
4
4
  import React__default, { useState, useMemo, useRef, useCallback, useEffect, forwardRef, Fragment, useLayoutEffect, createContext, memo, useImperativeHandle, useContext } from 'react';
@@ -10,7 +10,7 @@ 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, PlusAddCreateNew16SecondaryIcon, HandlePoint816SecondaryIcon, HandlePoint816BlueIcon, XmarkRemove16SecondaryIcon, XmarkRemove16RegularRedIcon, CheckmarkDoneSuccessCorrect16BlueIcon, XmarkRemoveSmall16RegularInheritIcon } from '@cloudtower/icons-react';
13
+ import { ArrowRightGrayIcon, ArrowChevronUp16SecondaryIcon, ArrowChevronDown16SecondaryIcon, PlusAddCreateNew16SecondaryIcon, HandlePoint816SecondaryIcon, HandlePoint816BlueIcon, XmarkRemove16SecondaryIcon, XmarkRemove16RegularRedIcon, CheckmarkDoneSuccessCorrect16BlueIcon, XmarkRemoveSmall16RegularInheritIcon } from '@cloudtower/icons-react';
14
14
  import moment from 'moment';
15
15
  import { findDOMNode } from 'react-dom';
16
16
  import { isElement } from 'react-is';
@@ -498,6 +498,22 @@ const Alert = _a => {
498
498
  }));
499
499
  };
500
500
 
501
+ const useParrotTranslation = () => {
502
+ return useTranslation(void 0, {
503
+ i18n: parrotI18n
504
+ });
505
+ };
506
+
507
+ const Arch = (props) => {
508
+ const { t } = useParrotTranslation();
509
+ const { architecture } = props;
510
+ let text = "";
511
+ if (architecture) {
512
+ text = t(`components.Architecture_${architecture}`);
513
+ }
514
+ return /* @__PURE__ */ React__default.createElement("span", null, text);
515
+ };
516
+
501
517
  var __defProp$P = Object.defineProperty;
502
518
  var __defProps$z = Object.defineProperties;
503
519
  var __getOwnPropDescs$z = Object.getOwnPropertyDescriptors;
@@ -529,126 +545,31 @@ var __objRest$t = (source, exclude) => {
529
545
  }
530
546
  return target;
531
547
  };
532
- let componentId = 0;
533
- const Tooltip = (props) => {
534
- const _a = props, {
535
- followMouse,
536
- overlayClassName,
537
- overlayStyle,
538
- children
539
- } = _a, restProps = __objRest$t(_a, [
540
- "followMouse",
541
- "overlayClassName",
542
- "overlayStyle",
543
- "children"
544
- ]);
545
- const id = useRef(++componentId);
546
- const uniquePopupClass = `kit-popup-${id.current}`;
547
- const uniqueContainerClass = `kit-tooltip-${id.current}`;
548
- const _children = useMemo(() => {
549
- if (followMouse) {
550
- const child = React__default.isValidElement(children) ? children : /* @__PURE__ */ React__default.createElement("span", null, children);
551
- return React__default.cloneElement(child, {
552
- className: cs(child.props.className, uniqueContainerClass)
553
- });
554
- } else {
555
- return children;
556
- }
557
- }, [children, followMouse, uniqueContainerClass]);
558
- const onmousemove = useCallback(
559
- (event) => {
560
- const popup = document.querySelector(`.${uniquePopupClass}`);
561
- if (!popup)
562
- return;
563
- popup.style.left = event.pageX + "px";
564
- popup.style.top = event.pageY + "px";
565
- },
566
- [uniquePopupClass]
567
- );
568
- useEffect(() => {
569
- if (followMouse) {
570
- const container = document.querySelector(
571
- `.${uniqueContainerClass}`
572
- );
573
- container == null ? void 0 : container.addEventListener("mousemove", onmousemove);
574
- return () => {
575
- container == null ? void 0 : container.removeEventListener("mousemove", onmousemove);
576
- };
577
- }
578
- }, [followMouse, onmousemove, uniqueContainerClass]);
548
+ const Badge = (_a) => {
549
+ var _b = _a, { type = "error", className } = _b, props = __objRest$t(_b, ["type", "className"]);
579
550
  return /* @__PURE__ */ React__default.createElement(
580
- Tooltip$1,
581
- __spreadProps$z(__spreadValues$P({}, restProps), {
582
- overlayClassName: followMouse ? cs(overlayClassName, uniquePopupClass) : overlayClassName,
583
- children: _children,
584
- overlayStyle: followMouse ? __spreadValues$P({
585
- transform: "translate(-50%, -100%)",
586
- pointerEvents: "none"
587
- }, overlayStyle) : overlayStyle
551
+ Badge$1,
552
+ __spreadProps$z(__spreadValues$P({
553
+ className: cx(`badge-${type}`, className)
554
+ }, props), {
555
+ showZero: false
588
556
  })
589
557
  );
590
558
  };
591
559
 
592
- const Inline = "i1e4sgug";
593
- const Truncate = props => {
594
- const {
595
- text,
596
- len = 100,
597
- frontLen,
598
- backLen = 4,
599
- hoverShowFullText = true,
600
- className,
601
- inline
602
- } = props;
603
- if (len <= 0) {
604
- console.error("[Truncate] prop len can not be 0 or negative number");
605
- return null;
606
- }
607
- if (backLen < 0) {
608
- console.error("[Truncate] prop backLen can not be negative number");
609
- return null;
610
- }
611
- if (frontLen && frontLen < 0) {
612
- console.error("[Truncate] prop frontLen can not be negative number");
613
- return null;
614
- }
615
- const ellipse = "...";
616
- let _backLen = Math.min(backLen, text.length - ellipse.length, len - ellipse.length);
617
- const _frontLen = frontLen !== void 0 ? Math.min(frontLen, text.length - ellipse.length, len - ellipse.length) : Math.max(len - _backLen - ellipse.length, 0);
618
- if (_frontLen + _backLen + ellipse.length > len) {
619
- _backLen = len - _frontLen - ellipse.length;
620
- }
621
- const truncated = text.length <= len ? text : text.slice(0, _frontLen) + ellipse + text.slice(text.length - _backLen);
622
- const Text = /* @__PURE__ */React__default.createElement("div", {
623
- className: cs([className, inline && Inline])
624
- }, truncated);
625
- if (!hoverShowFullText || text.length <= len) {
626
- return Text;
560
+ function isEmpty(rawValue) {
561
+ if (rawValue === null || rawValue === void 0 || rawValue === MAGIC_METRIC_NULL || Number.isNaN(rawValue) || !Number.isFinite(rawValue)) {
562
+ return true;
627
563
  }
628
- return /* @__PURE__ */React__default.createElement(Tooltip, {
629
- title: text
630
- }, Text);
631
- };
632
-
633
- const useParrotTranslation = () => {
634
- return useTranslation(void 0, {
635
- i18n: parrotI18n
636
- });
637
- };
564
+ return false;
565
+ }
638
566
 
639
- const Arch = (props) => {
640
- const { t } = useParrotTranslation();
641
- const { architecture } = props;
642
- let text = "";
643
- if (architecture) {
644
- text = t(`components.Architecture_${architecture}`);
645
- }
646
- return /* @__PURE__ */ React__default.createElement("span", null, text);
567
+ const Empty = (props) => {
568
+ const { className, style } = props;
569
+ return /* @__PURE__ */ React__default.createElement("span", { className, style }, "-");
647
570
  };
648
571
 
649
572
  var __defProp$O = Object.defineProperty;
650
- var __defProps$y = Object.defineProperties;
651
- var __getOwnPropDescs$y = Object.getOwnPropertyDescriptors;
652
573
  var __getOwnPropSymbols$P = Object.getOwnPropertySymbols;
653
574
  var __hasOwnProp$P = Object.prototype.hasOwnProperty;
654
575
  var __propIsEnum$P = Object.prototype.propertyIsEnumerable;
@@ -664,41 +585,18 @@ var __spreadValues$O = (a, b) => {
664
585
  }
665
586
  return a;
666
587
  };
667
- var __spreadProps$y = (a, b) => __defProps$y(a, __getOwnPropDescs$y(b));
668
- var __objRest$s = (source, exclude) => {
669
- var target = {};
670
- for (var prop in source)
671
- if (__hasOwnProp$P.call(source, prop) && exclude.indexOf(prop) < 0)
672
- target[prop] = source[prop];
673
- if (source != null && __getOwnPropSymbols$P)
674
- for (var prop of __getOwnPropSymbols$P(source)) {
675
- if (exclude.indexOf(prop) < 0 && __propIsEnum$P.call(source, prop))
676
- target[prop] = source[prop];
677
- }
678
- return target;
679
- };
680
- const Badge = (_a) => {
681
- var _b = _a, { type = "error", className } = _b, props = __objRest$s(_b, ["type", "className"]);
682
- return /* @__PURE__ */ React__default.createElement(
683
- Badge$1,
684
- __spreadProps$y(__spreadValues$O({
685
- className: cx(`badge-${type}`, className)
686
- }, props), {
687
- showZero: false
688
- })
689
- );
690
- };
691
-
692
- function isEmpty(rawValue) {
693
- if (rawValue === null || rawValue === void 0 || rawValue === MAGIC_METRIC_NULL || Number.isNaN(rawValue) || !Number.isFinite(rawValue)) {
694
- return true;
588
+ const Bit = ({
589
+ rawValue,
590
+ decimals,
591
+ unitClassName,
592
+ valueClassName,
593
+ emptyProps
594
+ }) => {
595
+ if (isEmpty(rawValue)) {
596
+ return /* @__PURE__ */ React__default.createElement(Empty, __spreadValues$O({}, emptyProps));
695
597
  }
696
- return false;
697
- }
698
-
699
- const Empty = (props) => {
700
- const { className, style } = props;
701
- return /* @__PURE__ */ React__default.createElement("span", { className, style }, "-");
598
+ const { value, unit } = formatBits(rawValue, decimals);
599
+ 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}`));
702
600
  };
703
601
 
704
602
  var __defProp$N = Object.defineProperty;
@@ -717,17 +615,17 @@ var __spreadValues$N = (a, b) => {
717
615
  }
718
616
  return a;
719
617
  };
720
- const Bit = ({
618
+ const BitPerSeconds = ({
721
619
  rawValue,
722
620
  decimals,
723
- unitClassName,
724
621
  valueClassName,
622
+ unitClassName,
725
623
  emptyProps
726
624
  }) => {
727
625
  if (isEmpty(rawValue)) {
728
626
  return /* @__PURE__ */ React__default.createElement(Empty, __spreadValues$N({}, emptyProps));
729
627
  }
730
- const { value, unit } = formatBits(rawValue, decimals);
628
+ const { value, unit } = formatBitPerSecond(rawValue, decimals);
731
629
  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}`));
732
630
  };
733
631
 
@@ -747,36 +645,6 @@ var __spreadValues$M = (a, b) => {
747
645
  }
748
646
  return a;
749
647
  };
750
- const BitPerSeconds = ({
751
- rawValue,
752
- decimals,
753
- valueClassName,
754
- unitClassName,
755
- emptyProps
756
- }) => {
757
- if (isEmpty(rawValue)) {
758
- return /* @__PURE__ */ React__default.createElement(Empty, __spreadValues$M({}, emptyProps));
759
- }
760
- const { value, unit } = formatBitPerSecond(rawValue, decimals);
761
- 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}`));
762
- };
763
-
764
- var __defProp$L = Object.defineProperty;
765
- var __getOwnPropSymbols$M = Object.getOwnPropertySymbols;
766
- var __hasOwnProp$M = Object.prototype.hasOwnProperty;
767
- var __propIsEnum$M = Object.prototype.propertyIsEnumerable;
768
- var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
769
- var __spreadValues$L = (a, b) => {
770
- for (var prop in b || (b = {}))
771
- if (__hasOwnProp$M.call(b, prop))
772
- __defNormalProp$L(a, prop, b[prop]);
773
- if (__getOwnPropSymbols$M)
774
- for (var prop of __getOwnPropSymbols$M(b)) {
775
- if (__propIsEnum$M.call(b, prop))
776
- __defNormalProp$L(a, prop, b[prop]);
777
- }
778
- return a;
779
- };
780
648
  const Bps = ({
781
649
  rawValue,
782
650
  decimals,
@@ -785,7 +653,7 @@ const Bps = ({
785
653
  emptyProps
786
654
  }) => {
787
655
  if (isEmpty(rawValue)) {
788
- return /* @__PURE__ */ React__default.createElement(Empty, __spreadValues$L({}, emptyProps));
656
+ return /* @__PURE__ */ React__default.createElement(Empty, __spreadValues$M({}, emptyProps));
789
657
  }
790
658
  const { value, unit } = formatBps(rawValue, decimals);
791
659
  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}`));
@@ -926,28 +794,28 @@ const HoverableElement = (props) => {
926
794
  return icon != null ? React__default.cloneElement(icon, { className }) : null;
927
795
  };
928
796
 
929
- var __defProp$K = Object.defineProperty;
930
- var __getOwnPropSymbols$L = Object.getOwnPropertySymbols;
931
- var __hasOwnProp$L = Object.prototype.hasOwnProperty;
932
- var __propIsEnum$L = Object.prototype.propertyIsEnumerable;
933
- var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, {
797
+ var __defProp$L = Object.defineProperty;
798
+ var __getOwnPropSymbols$M = Object.getOwnPropertySymbols;
799
+ var __hasOwnProp$M = Object.prototype.hasOwnProperty;
800
+ var __propIsEnum$M = Object.prototype.propertyIsEnumerable;
801
+ var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, {
934
802
  enumerable: true,
935
803
  configurable: true,
936
804
  writable: true,
937
805
  value
938
806
  }) : obj[key] = value;
939
- var __spreadValues$K = (a, b) => {
940
- for (var prop in b || (b = {})) if (__hasOwnProp$L.call(b, prop)) __defNormalProp$K(a, prop, b[prop]);
941
- if (__getOwnPropSymbols$L) for (var prop of __getOwnPropSymbols$L(b)) {
942
- if (__propIsEnum$L.call(b, prop)) __defNormalProp$K(a, prop, b[prop]);
807
+ var __spreadValues$L = (a, b) => {
808
+ for (var prop in b || (b = {})) if (__hasOwnProp$M.call(b, prop)) __defNormalProp$L(a, prop, b[prop]);
809
+ if (__getOwnPropSymbols$M) for (var prop of __getOwnPropSymbols$M(b)) {
810
+ if (__propIsEnum$M.call(b, prop)) __defNormalProp$L(a, prop, b[prop]);
943
811
  }
944
812
  return a;
945
813
  };
946
- var __objRest$r = (source, exclude) => {
814
+ var __objRest$s = (source, exclude) => {
947
815
  var target = {};
948
- for (var prop in source) if (__hasOwnProp$L.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
949
- if (source != null && __getOwnPropSymbols$L) for (var prop of __getOwnPropSymbols$L(source)) {
950
- if (exclude.indexOf(prop) < 0 && __propIsEnum$L.call(source, prop)) target[prop] = source[prop];
816
+ for (var prop in source) if (__hasOwnProp$M.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
817
+ if (source != null && __getOwnPropSymbols$M) for (var prop of __getOwnPropSymbols$M(source)) {
818
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$M.call(source, prop)) target[prop] = source[prop];
951
819
  }
952
820
  return target;
953
821
  };
@@ -970,12 +838,12 @@ const Button = React__default.forwardRef((props, ref) => {
970
838
  onMouseLeave,
971
839
  size = "middle"
972
840
  } = _a,
973
- restProps = __objRest$r(_a, ["type", "className", "children", "prefixIcon", "hoverPrefixIcon", "suffixIcon", "hoverSuffixIcon", "onMouseEnter", "onMouseLeave", "size"]);
841
+ restProps = __objRest$s(_a, ["type", "className", "children", "prefixIcon", "hoverPrefixIcon", "suffixIcon", "hoverSuffixIcon", "onMouseEnter", "onMouseLeave", "size"]);
974
842
  const [status, setStatus] = useState("normal");
975
843
  const hasIcon = prefixIcon || suffixIcon;
976
844
  const hasHoverIcon = hoverPrefixIcon || hoverSuffixIcon;
977
845
  const onlyIcon = !children && (prefixIcon || suffixIcon);
978
- return /* @__PURE__ */React__default.createElement(Button$1, __spreadValues$K({
846
+ return /* @__PURE__ */React__default.createElement(Button$1, __spreadValues$L({
979
847
  ref,
980
848
  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}`, onlyIcon && "ant-btn-icon-only"),
981
849
  type: isAntdButtonTypes(type) ? type : void 0,
@@ -1005,6 +873,97 @@ const Button = React__default.forwardRef((props, ref) => {
1005
873
  }));
1006
874
  });
1007
875
 
876
+ var __defProp$K = Object.defineProperty;
877
+ var __defProps$y = Object.defineProperties;
878
+ var __getOwnPropDescs$y = Object.getOwnPropertyDescriptors;
879
+ var __getOwnPropSymbols$L = Object.getOwnPropertySymbols;
880
+ var __hasOwnProp$L = Object.prototype.hasOwnProperty;
881
+ var __propIsEnum$L = Object.prototype.propertyIsEnumerable;
882
+ var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
883
+ var __spreadValues$K = (a, b) => {
884
+ for (var prop in b || (b = {}))
885
+ if (__hasOwnProp$L.call(b, prop))
886
+ __defNormalProp$K(a, prop, b[prop]);
887
+ if (__getOwnPropSymbols$L)
888
+ for (var prop of __getOwnPropSymbols$L(b)) {
889
+ if (__propIsEnum$L.call(b, prop))
890
+ __defNormalProp$K(a, prop, b[prop]);
891
+ }
892
+ return a;
893
+ };
894
+ var __spreadProps$y = (a, b) => __defProps$y(a, __getOwnPropDescs$y(b));
895
+ var __objRest$r = (source, exclude) => {
896
+ var target = {};
897
+ for (var prop in source)
898
+ if (__hasOwnProp$L.call(source, prop) && exclude.indexOf(prop) < 0)
899
+ target[prop] = source[prop];
900
+ if (source != null && __getOwnPropSymbols$L)
901
+ for (var prop of __getOwnPropSymbols$L(source)) {
902
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$L.call(source, prop))
903
+ target[prop] = source[prop];
904
+ }
905
+ return target;
906
+ };
907
+ let componentId = 0;
908
+ const Tooltip = (props) => {
909
+ const _a = props, {
910
+ followMouse,
911
+ overlayClassName,
912
+ overlayStyle,
913
+ children
914
+ } = _a, restProps = __objRest$r(_a, [
915
+ "followMouse",
916
+ "overlayClassName",
917
+ "overlayStyle",
918
+ "children"
919
+ ]);
920
+ const id = useRef(++componentId);
921
+ const uniquePopupClass = `kit-popup-${id.current}`;
922
+ const uniqueContainerClass = `kit-tooltip-${id.current}`;
923
+ const _children = useMemo(() => {
924
+ if (followMouse) {
925
+ const child = React__default.isValidElement(children) ? children : /* @__PURE__ */ React__default.createElement("span", null, children);
926
+ return React__default.cloneElement(child, {
927
+ className: cs(child.props.className, uniqueContainerClass)
928
+ });
929
+ } else {
930
+ return children;
931
+ }
932
+ }, [children, followMouse, uniqueContainerClass]);
933
+ const onmousemove = useCallback(
934
+ (event) => {
935
+ const popup = document.querySelector(`.${uniquePopupClass}`);
936
+ if (!popup)
937
+ return;
938
+ popup.style.left = event.pageX + "px";
939
+ popup.style.top = event.pageY + "px";
940
+ },
941
+ [uniquePopupClass]
942
+ );
943
+ useEffect(() => {
944
+ if (followMouse) {
945
+ const container = document.querySelector(
946
+ `.${uniqueContainerClass}`
947
+ );
948
+ container == null ? void 0 : container.addEventListener("mousemove", onmousemove);
949
+ return () => {
950
+ container == null ? void 0 : container.removeEventListener("mousemove", onmousemove);
951
+ };
952
+ }
953
+ }, [followMouse, onmousemove, uniqueContainerClass]);
954
+ return /* @__PURE__ */ React__default.createElement(
955
+ Tooltip$1,
956
+ __spreadProps$y(__spreadValues$K({}, restProps), {
957
+ overlayClassName: followMouse ? cs(overlayClassName, uniquePopupClass) : overlayClassName,
958
+ children: _children,
959
+ overlayStyle: followMouse ? __spreadValues$K({
960
+ transform: "translate(-50%, -100%)",
961
+ pointerEvents: "none"
962
+ }, overlayStyle) : overlayStyle
963
+ })
964
+ );
965
+ };
966
+
1008
967
  var __defProp$J = Object.defineProperty;
1009
968
  var __getOwnPropSymbols$K = Object.getOwnPropertySymbols;
1010
969
  var __hasOwnProp$K = Object.prototype.hasOwnProperty;
@@ -1301,6 +1260,74 @@ const Checkbox = _a => {
1301
1260
  }, description) : null) : null);
1302
1261
  };
1303
1262
 
1263
+ const card = "c10crapj";
1264
+ const ExpandableContainer = props => {
1265
+ const {
1266
+ children
1267
+ } = props;
1268
+ return /* @__PURE__ */React__default.createElement(Card$1, {
1269
+ className: card
1270
+ }, children);
1271
+ };
1272
+
1273
+ const ExpandIcon = (props) => {
1274
+ const { isActive } = props;
1275
+ return isActive ? /* @__PURE__ */ React__default.createElement(ArrowChevronUp16SecondaryIcon, null) : /* @__PURE__ */ React__default.createElement(ArrowChevronDown16SecondaryIcon, null);
1276
+ };
1277
+
1278
+ const RoundedOrderStyle = "rrwcpby";
1279
+ const RoundedOrder = props => {
1280
+ const {
1281
+ children,
1282
+ order
1283
+ } = props;
1284
+ return /* @__PURE__ */React__default.createElement("div", {
1285
+ className: RoundedOrderStyle
1286
+ }, order != null ? /* @__PURE__ */React__default.createElement("span", {
1287
+ className: "order"
1288
+ }, /* @__PURE__ */React__default.createElement("span", {
1289
+ className: Typo.Label.l2_bold
1290
+ }, order)) : null, children);
1291
+ };
1292
+
1293
+ const CollapseStyle = "cav9p2m";
1294
+ const CollapseDisabled = "csf0p6c";
1295
+ const ExpandableItem = props => {
1296
+ const {
1297
+ children,
1298
+ disableExpand = false,
1299
+ defaultActive = false,
1300
+ header,
1301
+ order
1302
+ } = props;
1303
+ const showExpandOnDisable = useMemo(() => {
1304
+ return disableExpand && defaultActive;
1305
+ }, [defaultActive, disableExpand]);
1306
+ const [activeKey, setActiveKey] = useState(showExpandOnDisable ? ["expandPanelKey"] : []);
1307
+ return /* @__PURE__ */React__default.createElement(Collapse, {
1308
+ className: cs(CollapseStyle, {
1309
+ [CollapseDisabled]: disableExpand
1310
+ }),
1311
+ expandIcon: ExpandIcon,
1312
+ expandIconPosition: "right",
1313
+ defaultActiveKey: showExpandOnDisable ? ["expandPanelKey"] : [],
1314
+ bordered: false,
1315
+ activeKey,
1316
+ onChange: v => {
1317
+ if (disableExpand) {
1318
+ return;
1319
+ }
1320
+ setActiveKey(v);
1321
+ }
1322
+ }, /* @__PURE__ */React__default.createElement(Collapse.Panel, {
1323
+ key: "expandPanelKey",
1324
+ header: /* @__PURE__ */React__default.createElement(RoundedOrder, {
1325
+ order
1326
+ }, header),
1327
+ showArrow: !disableExpand
1328
+ }, children));
1329
+ };
1330
+
1304
1331
  var __defProp$F = Object.defineProperty;
1305
1332
  var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
1306
1333
  var __hasOwnProp$G = Object.prototype.hasOwnProperty;
@@ -5221,6 +5248,47 @@ const Token = _a => {
5221
5248
  }, icon), children);
5222
5249
  };
5223
5250
 
5251
+ const Inline = "i1e4sgug";
5252
+ const Truncate = props => {
5253
+ const {
5254
+ text,
5255
+ len = 100,
5256
+ frontLen,
5257
+ backLen = 4,
5258
+ hoverShowFullText = true,
5259
+ className,
5260
+ inline
5261
+ } = props;
5262
+ if (len <= 0) {
5263
+ console.error("[Truncate] prop len can not be 0 or negative number");
5264
+ return null;
5265
+ }
5266
+ if (backLen < 0) {
5267
+ console.error("[Truncate] prop backLen can not be negative number");
5268
+ return null;
5269
+ }
5270
+ if (frontLen && frontLen < 0) {
5271
+ console.error("[Truncate] prop frontLen can not be negative number");
5272
+ return null;
5273
+ }
5274
+ const ellipse = "...";
5275
+ let _backLen = Math.min(backLen, text.length - ellipse.length, len - ellipse.length);
5276
+ const _frontLen = frontLen !== void 0 ? Math.min(frontLen, text.length - ellipse.length, len - ellipse.length) : Math.max(len - _backLen - ellipse.length, 0);
5277
+ if (_frontLen + _backLen + ellipse.length > len) {
5278
+ _backLen = len - _frontLen - ellipse.length;
5279
+ }
5280
+ const truncated = text.length <= len ? text : text.slice(0, _frontLen) + ellipse + text.slice(text.length - _backLen);
5281
+ const Text = /* @__PURE__ */React__default.createElement("div", {
5282
+ className: cs([className, inline && Inline])
5283
+ }, truncated);
5284
+ if (!hoverShowFullText || text.length <= len) {
5285
+ return Text;
5286
+ }
5287
+ return /* @__PURE__ */React__default.createElement(Tooltip, {
5288
+ title: text
5289
+ }, Text);
5290
+ };
5291
+
5224
5292
  function getAntdKit() {
5225
5293
  const kit = {
5226
5294
  loading: Loading,
@@ -5312,7 +5380,11 @@ function getAntdKit() {
5312
5380
  antdDrawer: Drawer,
5313
5381
  antdSteps: Steps$1,
5314
5382
  card: Card,
5315
- truncate: Truncate
5383
+ truncate: Truncate,
5384
+ expandableList: {
5385
+ ExpandableContainer,
5386
+ ExpandableItem
5387
+ }
5316
5388
  };
5317
5389
  kit.option.isSelectOption = true;
5318
5390
  kit.button.__ANT_BUTTON = true;