@cloudtower/eagle 0.26.10 → 0.26.11
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/components/Tag/__test__/h5_css.test.d.ts +1 -0
- package/dist/components/Tag/index.d.ts +3 -5
- package/dist/components/Token/__test__/h5_css.test.d.ts +1 -0
- package/dist/components/Token/index.d.ts +2 -2
- package/dist/components/Token/style.d.ts +1 -0
- package/dist/components.css +349 -337
- package/dist/esm/index.js +224 -164
- package/dist/esm/stats1.html +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/spec/base.d.ts +10 -4
- package/dist/style.css +1005 -993
- package/dist/umd/index.js +223 -162
- package/dist/umd/stats1.html +1 -1
- package/package.json +5 -5
package/dist/umd/index.js
CHANGED
|
@@ -507,22 +507,6 @@
|
|
|
507
507
|
}));
|
|
508
508
|
};
|
|
509
509
|
|
|
510
|
-
const useParrotTranslation = () => {
|
|
511
|
-
return reactI18next.useTranslation(void 0, {
|
|
512
|
-
i18n: parrot.parrotI18n
|
|
513
|
-
});
|
|
514
|
-
};
|
|
515
|
-
|
|
516
|
-
const Arch = (props) => {
|
|
517
|
-
const { t } = useParrotTranslation();
|
|
518
|
-
const { architecture } = props;
|
|
519
|
-
let text = "";
|
|
520
|
-
if (architecture) {
|
|
521
|
-
text = t(`components.Architecture_${architecture}`);
|
|
522
|
-
}
|
|
523
|
-
return /* @__PURE__ */ React__namespace.default.createElement("span", null, text);
|
|
524
|
-
};
|
|
525
|
-
|
|
526
510
|
var __defProp$P = Object.defineProperty;
|
|
527
511
|
var __defProps$z = Object.defineProperties;
|
|
528
512
|
var __getOwnPropDescs$z = Object.getOwnPropertyDescriptors;
|
|
@@ -554,31 +538,126 @@
|
|
|
554
538
|
}
|
|
555
539
|
return target;
|
|
556
540
|
};
|
|
557
|
-
|
|
558
|
-
|
|
541
|
+
let componentId = 0;
|
|
542
|
+
const Tooltip = (props) => {
|
|
543
|
+
const _a = props, {
|
|
544
|
+
followMouse,
|
|
545
|
+
overlayClassName,
|
|
546
|
+
overlayStyle,
|
|
547
|
+
children
|
|
548
|
+
} = _a, restProps = __objRest$t(_a, [
|
|
549
|
+
"followMouse",
|
|
550
|
+
"overlayClassName",
|
|
551
|
+
"overlayStyle",
|
|
552
|
+
"children"
|
|
553
|
+
]);
|
|
554
|
+
const id = React.useRef(++componentId);
|
|
555
|
+
const uniquePopupClass = `kit-popup-${id.current}`;
|
|
556
|
+
const uniqueContainerClass = `kit-tooltip-${id.current}`;
|
|
557
|
+
const _children = React.useMemo(() => {
|
|
558
|
+
if (followMouse) {
|
|
559
|
+
const child = React__namespace.default.isValidElement(children) ? children : /* @__PURE__ */ React__namespace.default.createElement("span", null, children);
|
|
560
|
+
return React__namespace.default.cloneElement(child, {
|
|
561
|
+
className: cs__default.default(child.props.className, uniqueContainerClass)
|
|
562
|
+
});
|
|
563
|
+
} else {
|
|
564
|
+
return children;
|
|
565
|
+
}
|
|
566
|
+
}, [children, followMouse, uniqueContainerClass]);
|
|
567
|
+
const onmousemove = React.useCallback(
|
|
568
|
+
(event) => {
|
|
569
|
+
const popup = document.querySelector(`.${uniquePopupClass}`);
|
|
570
|
+
if (!popup)
|
|
571
|
+
return;
|
|
572
|
+
popup.style.left = event.pageX + "px";
|
|
573
|
+
popup.style.top = event.pageY + "px";
|
|
574
|
+
},
|
|
575
|
+
[uniquePopupClass]
|
|
576
|
+
);
|
|
577
|
+
React.useEffect(() => {
|
|
578
|
+
if (followMouse) {
|
|
579
|
+
const container = document.querySelector(
|
|
580
|
+
`.${uniqueContainerClass}`
|
|
581
|
+
);
|
|
582
|
+
container == null ? void 0 : container.addEventListener("mousemove", onmousemove);
|
|
583
|
+
return () => {
|
|
584
|
+
container == null ? void 0 : container.removeEventListener("mousemove", onmousemove);
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
}, [followMouse, onmousemove, uniqueContainerClass]);
|
|
559
588
|
return /* @__PURE__ */ React__namespace.default.createElement(
|
|
560
|
-
antd.
|
|
561
|
-
__spreadProps$z(__spreadValues$P({
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
589
|
+
antd.Tooltip,
|
|
590
|
+
__spreadProps$z(__spreadValues$P({}, restProps), {
|
|
591
|
+
overlayClassName: followMouse ? cs__default.default(overlayClassName, uniquePopupClass) : overlayClassName,
|
|
592
|
+
children: _children,
|
|
593
|
+
overlayStyle: followMouse ? __spreadValues$P({
|
|
594
|
+
transform: "translate(-50%, -100%)",
|
|
595
|
+
pointerEvents: "none"
|
|
596
|
+
}, overlayStyle) : overlayStyle
|
|
565
597
|
})
|
|
566
598
|
);
|
|
567
599
|
};
|
|
568
600
|
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
601
|
+
const Inline = "i1e4sgug";
|
|
602
|
+
const Truncate = props => {
|
|
603
|
+
const {
|
|
604
|
+
text,
|
|
605
|
+
len = 100,
|
|
606
|
+
frontLen,
|
|
607
|
+
backLen = 4,
|
|
608
|
+
hoverShowFullText = true,
|
|
609
|
+
className,
|
|
610
|
+
inline
|
|
611
|
+
} = props;
|
|
612
|
+
if (len <= 0) {
|
|
613
|
+
console.error("[Truncate] prop len can not be 0 or negative number");
|
|
614
|
+
return null;
|
|
572
615
|
}
|
|
573
|
-
|
|
574
|
-
|
|
616
|
+
if (backLen < 0) {
|
|
617
|
+
console.error("[Truncate] prop backLen can not be negative number");
|
|
618
|
+
return null;
|
|
619
|
+
}
|
|
620
|
+
if (frontLen && frontLen < 0) {
|
|
621
|
+
console.error("[Truncate] prop frontLen can not be negative number");
|
|
622
|
+
return null;
|
|
623
|
+
}
|
|
624
|
+
const ellipse = "...";
|
|
625
|
+
let _backLen = Math.min(backLen, text.length - ellipse.length, len - ellipse.length);
|
|
626
|
+
const _frontLen = frontLen !== void 0 ? Math.min(frontLen, text.length - ellipse.length, len - ellipse.length) : Math.max(len - _backLen - ellipse.length, 0);
|
|
627
|
+
if (_frontLen + _backLen + ellipse.length > len) {
|
|
628
|
+
_backLen = len - _frontLen - ellipse.length;
|
|
629
|
+
}
|
|
630
|
+
const truncated = text.length <= len ? text : text.slice(0, _frontLen) + ellipse + text.slice(text.length - _backLen);
|
|
631
|
+
const Text = /* @__PURE__ */React__namespace.default.createElement("div", {
|
|
632
|
+
className: cs__default.default([className, inline && Inline])
|
|
633
|
+
}, truncated);
|
|
634
|
+
if (!hoverShowFullText || text.length <= len) {
|
|
635
|
+
return Text;
|
|
636
|
+
}
|
|
637
|
+
return /* @__PURE__ */React__namespace.default.createElement(Tooltip, {
|
|
638
|
+
title: text
|
|
639
|
+
}, Text);
|
|
640
|
+
};
|
|
575
641
|
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
|
|
642
|
+
const useParrotTranslation = () => {
|
|
643
|
+
return reactI18next.useTranslation(void 0, {
|
|
644
|
+
i18n: parrot.parrotI18n
|
|
645
|
+
});
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
const Arch = (props) => {
|
|
649
|
+
const { t } = useParrotTranslation();
|
|
650
|
+
const { architecture } = props;
|
|
651
|
+
let text = "";
|
|
652
|
+
if (architecture) {
|
|
653
|
+
text = t(`components.Architecture_${architecture}`);
|
|
654
|
+
}
|
|
655
|
+
return /* @__PURE__ */ React__namespace.default.createElement("span", null, text);
|
|
579
656
|
};
|
|
580
657
|
|
|
581
658
|
var __defProp$O = Object.defineProperty;
|
|
659
|
+
var __defProps$y = Object.defineProperties;
|
|
660
|
+
var __getOwnPropDescs$y = Object.getOwnPropertyDescriptors;
|
|
582
661
|
var __getOwnPropSymbols$P = Object.getOwnPropertySymbols;
|
|
583
662
|
var __hasOwnProp$P = Object.prototype.hasOwnProperty;
|
|
584
663
|
var __propIsEnum$P = Object.prototype.propertyIsEnumerable;
|
|
@@ -594,18 +673,41 @@
|
|
|
594
673
|
}
|
|
595
674
|
return a;
|
|
596
675
|
};
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
676
|
+
var __spreadProps$y = (a, b) => __defProps$y(a, __getOwnPropDescs$y(b));
|
|
677
|
+
var __objRest$s = (source, exclude) => {
|
|
678
|
+
var target = {};
|
|
679
|
+
for (var prop in source)
|
|
680
|
+
if (__hasOwnProp$P.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
681
|
+
target[prop] = source[prop];
|
|
682
|
+
if (source != null && __getOwnPropSymbols$P)
|
|
683
|
+
for (var prop of __getOwnPropSymbols$P(source)) {
|
|
684
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$P.call(source, prop))
|
|
685
|
+
target[prop] = source[prop];
|
|
686
|
+
}
|
|
687
|
+
return target;
|
|
688
|
+
};
|
|
689
|
+
const Badge = (_a) => {
|
|
690
|
+
var _b = _a, { type = "error", className } = _b, props = __objRest$s(_b, ["type", "className"]);
|
|
691
|
+
return /* @__PURE__ */ React__namespace.default.createElement(
|
|
692
|
+
antd.Badge,
|
|
693
|
+
__spreadProps$y(__spreadValues$O({
|
|
694
|
+
className: core.cx(`badge-${type}`, className)
|
|
695
|
+
}, props), {
|
|
696
|
+
showZero: false
|
|
697
|
+
})
|
|
698
|
+
);
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
function isEmpty(rawValue) {
|
|
702
|
+
if (rawValue === null || rawValue === void 0 || rawValue === MAGIC_METRIC_NULL || Number.isNaN(rawValue) || !Number.isFinite(rawValue)) {
|
|
703
|
+
return true;
|
|
606
704
|
}
|
|
607
|
-
|
|
608
|
-
|
|
705
|
+
return false;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
const Empty = (props) => {
|
|
709
|
+
const { className, style } = props;
|
|
710
|
+
return /* @__PURE__ */ React__namespace.default.createElement("span", { className, style }, "-");
|
|
609
711
|
};
|
|
610
712
|
|
|
611
713
|
var __defProp$N = Object.defineProperty;
|
|
@@ -624,17 +726,17 @@
|
|
|
624
726
|
}
|
|
625
727
|
return a;
|
|
626
728
|
};
|
|
627
|
-
const
|
|
729
|
+
const Bit = ({
|
|
628
730
|
rawValue,
|
|
629
731
|
decimals,
|
|
630
|
-
valueClassName,
|
|
631
732
|
unitClassName,
|
|
733
|
+
valueClassName,
|
|
632
734
|
emptyProps
|
|
633
735
|
}) => {
|
|
634
736
|
if (isEmpty(rawValue)) {
|
|
635
737
|
return /* @__PURE__ */ React__namespace.default.createElement(Empty, __spreadValues$N({}, emptyProps));
|
|
636
738
|
}
|
|
637
|
-
const { value, unit } =
|
|
739
|
+
const { value, unit } = formatBits(rawValue, decimals);
|
|
638
740
|
return /* @__PURE__ */ React__namespace.default.createElement("span", null, /* @__PURE__ */ React__namespace.default.createElement("span", { className: core.cx("value", valueClassName) }, value), /* @__PURE__ */ React__namespace.default.createElement("span", { className: core.cx("unit", unitClassName) }, ` ${unit}`));
|
|
639
741
|
};
|
|
640
742
|
|
|
@@ -654,7 +756,7 @@
|
|
|
654
756
|
}
|
|
655
757
|
return a;
|
|
656
758
|
};
|
|
657
|
-
const
|
|
759
|
+
const BitPerSeconds = ({
|
|
658
760
|
rawValue,
|
|
659
761
|
decimals,
|
|
660
762
|
valueClassName,
|
|
@@ -664,6 +766,36 @@
|
|
|
664
766
|
if (isEmpty(rawValue)) {
|
|
665
767
|
return /* @__PURE__ */ React__namespace.default.createElement(Empty, __spreadValues$M({}, emptyProps));
|
|
666
768
|
}
|
|
769
|
+
const { value, unit } = formatBitPerSecond(rawValue, decimals);
|
|
770
|
+
return /* @__PURE__ */ React__namespace.default.createElement("span", null, /* @__PURE__ */ React__namespace.default.createElement("span", { className: core.cx("value", valueClassName) }, value), /* @__PURE__ */ React__namespace.default.createElement("span", { className: core.cx("unit", unitClassName) }, ` ${unit}`));
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
var __defProp$L = Object.defineProperty;
|
|
774
|
+
var __getOwnPropSymbols$M = Object.getOwnPropertySymbols;
|
|
775
|
+
var __hasOwnProp$M = Object.prototype.hasOwnProperty;
|
|
776
|
+
var __propIsEnum$M = Object.prototype.propertyIsEnumerable;
|
|
777
|
+
var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
778
|
+
var __spreadValues$L = (a, b) => {
|
|
779
|
+
for (var prop in b || (b = {}))
|
|
780
|
+
if (__hasOwnProp$M.call(b, prop))
|
|
781
|
+
__defNormalProp$L(a, prop, b[prop]);
|
|
782
|
+
if (__getOwnPropSymbols$M)
|
|
783
|
+
for (var prop of __getOwnPropSymbols$M(b)) {
|
|
784
|
+
if (__propIsEnum$M.call(b, prop))
|
|
785
|
+
__defNormalProp$L(a, prop, b[prop]);
|
|
786
|
+
}
|
|
787
|
+
return a;
|
|
788
|
+
};
|
|
789
|
+
const Bps = ({
|
|
790
|
+
rawValue,
|
|
791
|
+
decimals,
|
|
792
|
+
valueClassName,
|
|
793
|
+
unitClassName,
|
|
794
|
+
emptyProps
|
|
795
|
+
}) => {
|
|
796
|
+
if (isEmpty(rawValue)) {
|
|
797
|
+
return /* @__PURE__ */ React__namespace.default.createElement(Empty, __spreadValues$L({}, emptyProps));
|
|
798
|
+
}
|
|
667
799
|
const { value, unit } = formatBps(rawValue, decimals);
|
|
668
800
|
return /* @__PURE__ */ React__namespace.default.createElement("span", null, /* @__PURE__ */ React__namespace.default.createElement("span", { className: core.cx("value", valueClassName) }, value), /* @__PURE__ */ React__namespace.default.createElement("span", { className: core.cx("unit", unitClassName) }, ` ${unit}`));
|
|
669
801
|
};
|
|
@@ -803,28 +935,28 @@
|
|
|
803
935
|
return icon != null ? React__namespace.default.cloneElement(icon, { className }) : null;
|
|
804
936
|
};
|
|
805
937
|
|
|
806
|
-
var __defProp$
|
|
807
|
-
var __getOwnPropSymbols$
|
|
808
|
-
var __hasOwnProp$
|
|
809
|
-
var __propIsEnum$
|
|
810
|
-
var __defNormalProp$
|
|
938
|
+
var __defProp$K = Object.defineProperty;
|
|
939
|
+
var __getOwnPropSymbols$L = Object.getOwnPropertySymbols;
|
|
940
|
+
var __hasOwnProp$L = Object.prototype.hasOwnProperty;
|
|
941
|
+
var __propIsEnum$L = Object.prototype.propertyIsEnumerable;
|
|
942
|
+
var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, {
|
|
811
943
|
enumerable: true,
|
|
812
944
|
configurable: true,
|
|
813
945
|
writable: true,
|
|
814
946
|
value
|
|
815
947
|
}) : obj[key] = value;
|
|
816
|
-
var __spreadValues$
|
|
817
|
-
for (var prop in b || (b = {})) if (__hasOwnProp$
|
|
818
|
-
if (__getOwnPropSymbols$
|
|
819
|
-
if (__propIsEnum$
|
|
948
|
+
var __spreadValues$K = (a, b) => {
|
|
949
|
+
for (var prop in b || (b = {})) if (__hasOwnProp$L.call(b, prop)) __defNormalProp$K(a, prop, b[prop]);
|
|
950
|
+
if (__getOwnPropSymbols$L) for (var prop of __getOwnPropSymbols$L(b)) {
|
|
951
|
+
if (__propIsEnum$L.call(b, prop)) __defNormalProp$K(a, prop, b[prop]);
|
|
820
952
|
}
|
|
821
953
|
return a;
|
|
822
954
|
};
|
|
823
|
-
var __objRest$
|
|
955
|
+
var __objRest$r = (source, exclude) => {
|
|
824
956
|
var target = {};
|
|
825
|
-
for (var prop in source) if (__hasOwnProp$
|
|
826
|
-
if (source != null && __getOwnPropSymbols$
|
|
827
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
957
|
+
for (var prop in source) if (__hasOwnProp$L.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
|
|
958
|
+
if (source != null && __getOwnPropSymbols$L) for (var prop of __getOwnPropSymbols$L(source)) {
|
|
959
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$L.call(source, prop)) target[prop] = source[prop];
|
|
828
960
|
}
|
|
829
961
|
return target;
|
|
830
962
|
};
|
|
@@ -847,11 +979,11 @@
|
|
|
847
979
|
onMouseLeave,
|
|
848
980
|
size = "middle"
|
|
849
981
|
} = _a,
|
|
850
|
-
restProps = __objRest$
|
|
982
|
+
restProps = __objRest$r(_a, ["type", "className", "children", "prefixIcon", "hoverPrefixIcon", "suffixIcon", "hoverSuffixIcon", "onMouseEnter", "onMouseLeave", "size"]);
|
|
851
983
|
const [status, setStatus] = React.useState("normal");
|
|
852
984
|
const hasIcon = prefixIcon || suffixIcon;
|
|
853
985
|
const hasHoverIcon = hoverPrefixIcon || hoverSuffixIcon;
|
|
854
|
-
return /* @__PURE__ */React__namespace.default.createElement(antd.Button, __spreadValues$
|
|
986
|
+
return /* @__PURE__ */React__namespace.default.createElement(antd.Button, __spreadValues$K({
|
|
855
987
|
ref,
|
|
856
988
|
className: cs__default.default(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"),
|
|
857
989
|
type: isAntdButtonTypes(type) ? type : void 0,
|
|
@@ -881,97 +1013,6 @@
|
|
|
881
1013
|
}));
|
|
882
1014
|
});
|
|
883
1015
|
|
|
884
|
-
var __defProp$K = Object.defineProperty;
|
|
885
|
-
var __defProps$y = Object.defineProperties;
|
|
886
|
-
var __getOwnPropDescs$y = Object.getOwnPropertyDescriptors;
|
|
887
|
-
var __getOwnPropSymbols$L = Object.getOwnPropertySymbols;
|
|
888
|
-
var __hasOwnProp$L = Object.prototype.hasOwnProperty;
|
|
889
|
-
var __propIsEnum$L = Object.prototype.propertyIsEnumerable;
|
|
890
|
-
var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
891
|
-
var __spreadValues$K = (a, b) => {
|
|
892
|
-
for (var prop in b || (b = {}))
|
|
893
|
-
if (__hasOwnProp$L.call(b, prop))
|
|
894
|
-
__defNormalProp$K(a, prop, b[prop]);
|
|
895
|
-
if (__getOwnPropSymbols$L)
|
|
896
|
-
for (var prop of __getOwnPropSymbols$L(b)) {
|
|
897
|
-
if (__propIsEnum$L.call(b, prop))
|
|
898
|
-
__defNormalProp$K(a, prop, b[prop]);
|
|
899
|
-
}
|
|
900
|
-
return a;
|
|
901
|
-
};
|
|
902
|
-
var __spreadProps$y = (a, b) => __defProps$y(a, __getOwnPropDescs$y(b));
|
|
903
|
-
var __objRest$r = (source, exclude) => {
|
|
904
|
-
var target = {};
|
|
905
|
-
for (var prop in source)
|
|
906
|
-
if (__hasOwnProp$L.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
907
|
-
target[prop] = source[prop];
|
|
908
|
-
if (source != null && __getOwnPropSymbols$L)
|
|
909
|
-
for (var prop of __getOwnPropSymbols$L(source)) {
|
|
910
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$L.call(source, prop))
|
|
911
|
-
target[prop] = source[prop];
|
|
912
|
-
}
|
|
913
|
-
return target;
|
|
914
|
-
};
|
|
915
|
-
let componentId = 0;
|
|
916
|
-
const Tooltip = (props) => {
|
|
917
|
-
const _a = props, {
|
|
918
|
-
followMouse,
|
|
919
|
-
overlayClassName,
|
|
920
|
-
overlayStyle,
|
|
921
|
-
children
|
|
922
|
-
} = _a, restProps = __objRest$r(_a, [
|
|
923
|
-
"followMouse",
|
|
924
|
-
"overlayClassName",
|
|
925
|
-
"overlayStyle",
|
|
926
|
-
"children"
|
|
927
|
-
]);
|
|
928
|
-
const id = React.useRef(++componentId);
|
|
929
|
-
const uniquePopupClass = `kit-popup-${id.current}`;
|
|
930
|
-
const uniqueContainerClass = `kit-tooltip-${id.current}`;
|
|
931
|
-
const _children = React.useMemo(() => {
|
|
932
|
-
if (followMouse) {
|
|
933
|
-
const child = React__namespace.default.isValidElement(children) ? children : /* @__PURE__ */ React__namespace.default.createElement("span", null, children);
|
|
934
|
-
return React__namespace.default.cloneElement(child, {
|
|
935
|
-
className: cs__default.default(child.props.className, uniqueContainerClass)
|
|
936
|
-
});
|
|
937
|
-
} else {
|
|
938
|
-
return children;
|
|
939
|
-
}
|
|
940
|
-
}, [children, followMouse, uniqueContainerClass]);
|
|
941
|
-
const onmousemove = React.useCallback(
|
|
942
|
-
(event) => {
|
|
943
|
-
const popup = document.querySelector(`.${uniquePopupClass}`);
|
|
944
|
-
if (!popup)
|
|
945
|
-
return;
|
|
946
|
-
popup.style.left = event.pageX + "px";
|
|
947
|
-
popup.style.top = event.pageY + "px";
|
|
948
|
-
},
|
|
949
|
-
[uniquePopupClass]
|
|
950
|
-
);
|
|
951
|
-
React.useEffect(() => {
|
|
952
|
-
if (followMouse) {
|
|
953
|
-
const container = document.querySelector(
|
|
954
|
-
`.${uniqueContainerClass}`
|
|
955
|
-
);
|
|
956
|
-
container == null ? void 0 : container.addEventListener("mousemove", onmousemove);
|
|
957
|
-
return () => {
|
|
958
|
-
container == null ? void 0 : container.removeEventListener("mousemove", onmousemove);
|
|
959
|
-
};
|
|
960
|
-
}
|
|
961
|
-
}, [followMouse, onmousemove, uniqueContainerClass]);
|
|
962
|
-
return /* @__PURE__ */ React__namespace.default.createElement(
|
|
963
|
-
antd.Tooltip,
|
|
964
|
-
__spreadProps$y(__spreadValues$K({}, restProps), {
|
|
965
|
-
overlayClassName: followMouse ? cs__default.default(overlayClassName, uniquePopupClass) : overlayClassName,
|
|
966
|
-
children: _children,
|
|
967
|
-
overlayStyle: followMouse ? __spreadValues$K({
|
|
968
|
-
transform: "translate(-50%, -100%)",
|
|
969
|
-
pointerEvents: "none"
|
|
970
|
-
}, overlayStyle) : overlayStyle
|
|
971
|
-
})
|
|
972
|
-
);
|
|
973
|
-
};
|
|
974
|
-
|
|
975
1016
|
var __defProp$J = Object.defineProperty;
|
|
976
1017
|
var __getOwnPropSymbols$K = Object.getOwnPropertySymbols;
|
|
977
1018
|
var __hasOwnProp$K = Object.prototype.hasOwnProperty;
|
|
@@ -4841,7 +4882,7 @@
|
|
|
4841
4882
|
medium: "mfsz1jz"
|
|
4842
4883
|
};
|
|
4843
4884
|
const TagStyle$1 = "tnd6h4m";
|
|
4844
|
-
const IconStyle = "i1qw4clm";
|
|
4885
|
+
const IconStyle$1 = "i1qw4clm";
|
|
4845
4886
|
|
|
4846
4887
|
var __defProp$5 = Object.defineProperty;
|
|
4847
4888
|
var __defProps$5 = Object.defineProperties;
|
|
@@ -4892,7 +4933,7 @@
|
|
|
4892
4933
|
[`ant-tag-${color}`]: PresetColors$2.includes(color)
|
|
4893
4934
|
}, "inside-tag")
|
|
4894
4935
|
}, icon && /* @__PURE__ */React__namespace.default.createElement("span", {
|
|
4895
|
-
className: cs__default.default("ui-kit-tag-icon", IconStyle)
|
|
4936
|
+
className: cs__default.default("ui-kit-tag-icon", IconStyle$1)
|
|
4896
4937
|
}, icon), primaryContent), secondaryContent);
|
|
4897
4938
|
};
|
|
4898
4939
|
|
|
@@ -4927,7 +4968,18 @@
|
|
|
4927
4968
|
}
|
|
4928
4969
|
return target;
|
|
4929
4970
|
};
|
|
4930
|
-
const PresetColors$1 = [
|
|
4971
|
+
const PresetColors$1 = [
|
|
4972
|
+
...PresetColors$2,
|
|
4973
|
+
"red-ontint",
|
|
4974
|
+
"green-ontint"
|
|
4975
|
+
];
|
|
4976
|
+
const AntdColorMap = {
|
|
4977
|
+
processing: "blue",
|
|
4978
|
+
success: "green",
|
|
4979
|
+
error: "red",
|
|
4980
|
+
warn: "yellow",
|
|
4981
|
+
default: "gray"
|
|
4982
|
+
};
|
|
4931
4983
|
const Tag = (_a) => {
|
|
4932
4984
|
var _b = _a, {
|
|
4933
4985
|
size = "small",
|
|
@@ -4944,17 +4996,18 @@
|
|
|
4944
4996
|
"icon",
|
|
4945
4997
|
"children"
|
|
4946
4998
|
]);
|
|
4999
|
+
const computedColor = AntdColorMap[color] || color;
|
|
4947
5000
|
return /* @__PURE__ */ React__namespace.default.createElement(
|
|
4948
5001
|
antd.Tag,
|
|
4949
5002
|
__spreadProps$4(__spreadValues$4({}, props), {
|
|
4950
5003
|
className: cs__default.default(className, Size$1[size], TagStyle$1, Typo.Label.l4_regular, {
|
|
4951
|
-
[`ant-tag-${
|
|
5004
|
+
[`ant-tag-${computedColor}`]: PresetColors$1.includes(computedColor),
|
|
4952
5005
|
"tag-hover": hoverable
|
|
4953
5006
|
}),
|
|
4954
5007
|
closable: false,
|
|
4955
|
-
color:
|
|
5008
|
+
color: computedColor === "gray" ? void 0 : computedColor
|
|
4956
5009
|
}),
|
|
4957
|
-
icon && /* @__PURE__ */ React__namespace.default.createElement("span", { className:
|
|
5010
|
+
icon && /* @__PURE__ */ React__namespace.default.createElement("span", { className: IconStyle$1 }, icon),
|
|
4958
5011
|
children
|
|
4959
5012
|
);
|
|
4960
5013
|
};
|
|
@@ -5110,6 +5163,8 @@
|
|
|
5110
5163
|
})));
|
|
5111
5164
|
};
|
|
5112
5165
|
|
|
5166
|
+
const IconStyle = "iwsze0q";
|
|
5167
|
+
|
|
5113
5168
|
var __defProp$3 = Object.defineProperty;
|
|
5114
5169
|
var __defProps$3 = Object.defineProperties;
|
|
5115
5170
|
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
@@ -5151,9 +5206,11 @@
|
|
|
5151
5206
|
size = "small",
|
|
5152
5207
|
color = "gray",
|
|
5153
5208
|
className,
|
|
5154
|
-
|
|
5209
|
+
icon,
|
|
5210
|
+
checked,
|
|
5211
|
+
children
|
|
5155
5212
|
} = _b,
|
|
5156
|
-
props = __objRest(_b, ["size", "color", "className", "checked"]);
|
|
5213
|
+
props = __objRest(_b, ["size", "color", "className", "icon", "checked", "children"]);
|
|
5157
5214
|
return /* @__PURE__ */React__namespace.default.createElement(antd.Tag, __spreadProps$3(__spreadValues$3({}, props), {
|
|
5158
5215
|
className: cs__default.default(className, Size[size], TokenStyle, {
|
|
5159
5216
|
[Typo.Label.l4_regular]: size === "small" || size === "medium",
|
|
@@ -5167,7 +5224,9 @@
|
|
|
5167
5224
|
iconWidth: 16
|
|
5168
5225
|
}),
|
|
5169
5226
|
color: color === "gray" ? void 0 : color
|
|
5170
|
-
})
|
|
5227
|
+
}), icon && /* @__PURE__ */React__namespace.default.createElement("span", {
|
|
5228
|
+
className: cs__default.default("ui-kit-tag-icon", IconStyle)
|
|
5229
|
+
}, icon), children);
|
|
5171
5230
|
};
|
|
5172
5231
|
|
|
5173
5232
|
function getAntdKit() {
|
|
@@ -5260,7 +5319,8 @@
|
|
|
5260
5319
|
antdTreeSelect: antd.TreeSelect,
|
|
5261
5320
|
antdDrawer: antd.Drawer,
|
|
5262
5321
|
antdSteps: antd.Steps,
|
|
5263
|
-
card: Card
|
|
5322
|
+
card: Card,
|
|
5323
|
+
truncate: Truncate
|
|
5264
5324
|
};
|
|
5265
5325
|
kit.option.isSelectOption = true;
|
|
5266
5326
|
kit.button.__ANT_BUTTON = true;
|
|
@@ -5589,6 +5649,7 @@
|
|
|
5589
5649
|
exports.KitStoreProvider = KitStoreProvider;
|
|
5590
5650
|
exports.ModalActions = ModalActions;
|
|
5591
5651
|
exports.ModalStack = ModalStack;
|
|
5652
|
+
exports.Truncate = Truncate;
|
|
5592
5653
|
exports.Typo = Typo;
|
|
5593
5654
|
exports.UIKitProvider = UIKitProvider;
|
|
5594
5655
|
exports.UIKitStore = UIKitStore;
|