@unicom-cloud/ui 0.8.99 → 0.8.101
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/Anchor.js +3 -1
- package/Badge.js +7 -6
- package/Copy.js +49 -2
- package/Details.js +13 -2
- package/Divider.js +3 -2
- package/Flex.js +22 -0
- package/Grid.js +1 -1
- package/LiquidFill.js +3 -2
- package/Loading.js +16 -3
- package/Marquee.js +3 -2
- package/QrCode.js +3 -2
- package/Space.js +3 -3
- package/Splitter.js +5 -5
- package/SuspenseFallbackTest.js +2 -4
- package/Tag.js +3 -2
- package/Tour.js +3 -2
- package/alert/index.js +61 -64
- package/anchor/index.js +5 -3
- package/back-top/index.js +32 -33
- package/badge/index.js +19 -18
- package/calendar/index.js +85 -84
- package/components/common/development/index.js +44 -29
- package/components/common/empty/index.js +35 -23
- package/components/common/flex/index.js +64 -0
- package/components/common/flex/interface.js +9 -0
- package/components/common/higher-order/with-speech-synthesis/index.js +79 -55
- package/components/common/space/index.js +71 -91
- package/components/common/suspense-fallback-test/index.js +16 -0
- package/components/common/utils/toArray.js +12 -0
- package/copy/index.js +83 -35
- package/details/index.js +102 -62
- package/divider/index.js +27 -21
- package/empty/index.js +13 -13
- package/flex/index.js +47 -0
- package/flex/interface.js +1 -0
- package/grid/{GridItem.js → Item.js} +15 -15
- package/grid/index.js +1 -1
- package/icon/interface.js +1 -0
- package/icon-hover/interface.js +1 -0
- package/index.js +610 -599
- package/input/Button.js +39 -34
- package/input/Textarea.js +108 -104
- package/liquid-fill/index.js +3 -2
- package/loading/index.js +72 -53
- package/loading/interface.js +1 -0
- package/marquee/index.js +3 -2
- package/modal/Modal.js +73 -74
- package/package.json +1 -1
- package/portal/interface.js +1 -0
- package/qr-code/index.js +3 -2
- package/segmented/index.js +113 -105
- package/space/index.js +41 -35
- package/speech-synthesis/interface.js +1 -0
- package/spin/index.js +75 -62
- package/splitter/Panel.js +39 -0
- package/splitter/SplitBar.js +157 -0
- package/splitter/Splitter.js +135 -0
- package/splitter/hooks/useEvent.js +12 -0
- package/splitter/hooks/useItems.js +26 -0
- package/splitter/hooks/useResizable.js +26 -0
- package/splitter/hooks/useResize.js +68 -0
- package/splitter/hooks/useSizes.js +60 -0
- package/splitter/index.js +6 -115
- package/style.css +1 -1
- package/suspense-fallback-test/index.js +2 -11
- package/suspense-fallback-test/interface.js +1 -0
- package/table/Table.js +38 -38
- package/table/hook/useThResizable.js +72 -26
- package/table/tbody/Td.js +80 -77
- package/table/th-resizable/index.js +92 -35
- package/tag/index.js +42 -41
- package/tooltip/index.js +89 -82
- package/tour/index.js +5 -6
- package/trigger/index.js +67 -70
- package/types/common/development/index.d.ts +7 -1
- package/types/common/development/interface.d.ts +22 -0
- package/types/common/empty/index.d.ts +2 -1
- package/types/common/flex/index.d.ts +14 -0
- package/types/common/flex/interface.d.ts +62 -0
- package/types/common/higher-order/with-speech-synthesis/index.d.ts +6 -1
- package/types/common/higher-order/with-speech-synthesis/interface.d.ts +13 -0
- package/types/common/space/index.d.ts +4 -3
- package/types/common/space/interface.d.ts +10 -18
- package/types/common/suspense-fallback-test/index.d.ts +7 -0
- package/types/common/suspense-fallback-test/interface.d.ts +1 -0
- package/types/common/utils/PqbCSSTransition.d.ts +1 -1
- package/types/common/utils/toArray.d.ts +13 -0
- package/types/pc/affix/interface.d.ts +0 -2
- package/types/pc/alert/index.d.ts +3 -2
- package/types/pc/alert/interface.d.ts +7 -1
- package/types/pc/anchor/index.d.ts +2 -1
- package/types/pc/anchor/interface.d.ts +0 -2
- package/types/pc/auto-complete/interface.d.ts +0 -6
- package/types/pc/avatar/interface.d.ts +0 -4
- package/types/pc/badge/Count.d.ts +1 -1
- package/types/pc/breadcrumb/Item.d.ts +1 -1
- package/types/pc/breadcrumb/interface.d.ts +0 -3
- package/types/pc/calendar/Month.d.ts +1 -1
- package/types/pc/calendar/WeekList.d.ts +1 -1
- package/types/pc/calendar/Year.d.ts +1 -1
- package/types/pc/calendar/header/Panel.d.ts +1 -1
- package/types/pc/calendar/header/index.d.ts +1 -1
- package/types/pc/calendar/index.d.ts +1 -1
- package/types/pc/calendar/interface.d.ts +2 -1
- package/types/pc/carousel/interface.d.ts +2 -6
- package/types/pc/cascader/interface.d.ts +7 -19
- package/types/pc/cascader/panel/List.d.ts +1 -1
- package/types/pc/cascader/panel/Option.d.ts +1 -1
- package/types/pc/cascader/panel/Search.d.ts +1 -1
- package/types/pc/checkbox/Group.d.ts +2 -2
- package/types/pc/checkbox/GroupBlock.d.ts +1 -1
- package/types/pc/checkbox/IconCheck.d.ts +1 -1
- package/types/pc/checkbox/interface.d.ts +0 -1
- package/types/pc/collapse/interface.d.ts +0 -2
- package/types/pc/color-picker/InputRgb.d.ts +1 -1
- package/types/pc/color-picker/Palette.d.ts +1 -1
- package/types/pc/color-picker/interface.d.ts +0 -2
- package/types/pc/config-provider/ConfigProvider.d.ts +1 -1
- package/types/pc/config-provider/interface.d.ts +17 -17
- package/types/pc/copy/index.d.ts +1 -1
- package/types/pc/copy/interface.d.ts +2 -1
- package/types/pc/date-picker/interface.d.ts +0 -17
- package/types/pc/date-picker/panel/Body.d.ts +1 -1
- package/types/pc/date-picker/panel/Footer.d.ts +1 -1
- package/types/pc/date-picker/panel/Header.d.ts +1 -1
- package/types/pc/date-picker/panel/WeekList.d.ts +1 -1
- package/types/pc/date-picker/panel/date/index.d.ts +1 -1
- package/types/pc/date-picker/panel/month/index.d.ts +1 -1
- package/types/pc/date-picker/panel/quarter/index.d.ts +1 -1
- package/types/pc/date-picker/panel/range/index.d.ts +1 -1
- package/types/pc/date-picker/panel/week/index.d.ts +1 -1
- package/types/pc/date-picker/panel/year/index.d.ts +1 -1
- package/types/pc/descriptions/index.d.ts +1 -1
- package/types/pc/descriptions/interface.d.ts +0 -1
- package/types/pc/details/index.d.ts +3 -2
- package/types/pc/details/interface.d.ts +16 -0
- package/types/pc/development/index.d.ts +2 -1
- package/types/pc/development/interface.d.ts +15 -0
- package/types/pc/divider/index.d.ts +7 -2
- package/types/pc/draggable/Item.d.ts +1 -1
- package/types/pc/draggable/index.d.ts +1 -1
- package/types/pc/drawer/interface.d.ts +0 -7
- package/types/pc/dropdown/interface.d.ts +0 -1
- package/types/pc/flex/index.d.ts +9 -0
- package/types/pc/flex/interface.d.ts +16 -0
- package/types/pc/form/Control.d.ts +1 -1
- package/types/pc/form/FormList.d.ts +1 -1
- package/types/pc/form/IconSymbol.d.ts +1 -1
- package/types/pc/form/interface.d.ts +9 -22
- package/types/pc/form/util.d.ts +1 -1
- package/types/pc/grid/index.d.ts +3 -3
- package/types/pc/grid/interface.d.ts +1 -6
- package/types/pc/icon/addFromIconFontCn.d.ts +1 -7
- package/types/pc/icon/index.d.ts +2 -7
- package/types/pc/icon/interface.d.ts +13 -0
- package/types/pc/icon-hover/index.d.ts +2 -8
- package/types/pc/icon-hover/interface.d.ts +8 -0
- package/types/pc/image/ImageFooter.d.ts +1 -1
- package/types/pc/image/ImagePreviewArrow.d.ts +1 -1
- package/types/pc/image/TriggerForToolbar.d.ts +1 -1
- package/types/pc/image/interface.d.ts +0 -13
- package/types/pc/index.d.ts +63 -50
- package/types/pc/input/Textarea.d.ts +2 -6
- package/types/pc/input/interface.d.ts +5 -13
- package/types/pc/input-number/interface.d.ts +0 -4
- package/types/pc/input-tag/interface.d.ts +0 -13
- package/types/pc/layout/interface.d.ts +0 -1
- package/types/pc/link/interface.d.ts +0 -1
- package/types/pc/list/interface.d.ts +0 -4
- package/types/pc/loading/index.d.ts +4 -3
- package/types/pc/loading/interface.d.ts +6 -0
- package/types/pc/menu/Indent.d.ts +1 -1
- package/types/pc/menu/OverflowWrap.d.ts +1 -1
- package/types/pc/menu/interface.d.ts +0 -8
- package/types/pc/menu/sub-menu/Inline.d.ts +1 -1
- package/types/pc/menu/sub-menu/Pop.d.ts +1 -1
- package/types/pc/message/interface.d.ts +0 -2
- package/types/pc/modal/interface.d.ts +0 -5
- package/types/pc/notification/interface.d.ts +0 -1
- package/types/pc/overflow-ellipsis/OverflowItem.d.ts +1 -1
- package/types/pc/overflow-ellipsis/index.d.ts +1 -1
- package/types/pc/pagination/PageItem.d.ts +3 -3
- package/types/pc/pagination/PageJumper.d.ts +1 -1
- package/types/pc/pagination/PageOption.d.ts +1 -1
- package/types/pc/pagination/interface.d.ts +0 -2
- package/types/pc/popconfirm/interface.d.ts +8 -10
- package/types/pc/popover/interface.d.ts +0 -1
- package/types/pc/portal/Portal.d.ts +2 -6
- package/types/pc/portal/index.d.ts +2 -9
- package/types/pc/portal/interface.d.ts +14 -0
- package/types/pc/progress/CircleProgress.d.ts +1 -1
- package/types/pc/progress/LineProgess.d.ts +1 -1
- package/types/pc/progress/StepProgress.d.ts +1 -1
- package/types/pc/progress/interface.d.ts +0 -3
- package/types/pc/radio/Group.d.ts +2 -2
- package/types/pc/radio/GroupBlock.d.ts +1 -1
- package/types/pc/radio/Radio.d.ts +1 -1
- package/types/pc/resize-box/ResizeTrigger.d.ts +1 -1
- package/types/pc/resize-box/interface.d.ts +1 -7
- package/types/pc/result/403.d.ts +1 -1
- package/types/pc/result/404.d.ts +1 -1
- package/types/pc/result/500.d.ts +1 -1
- package/types/pc/segmented/interface.d.ts +6 -6
- package/types/pc/select/interface.d.ts +0 -12
- package/types/pc/select-view/interface.d.ts +0 -7
- package/types/pc/skeleton/Image.d.ts +1 -1
- package/types/pc/skeleton/Text.d.ts +2 -1
- package/types/pc/slider/Button.d.ts +1 -1
- package/types/pc/slider/Input.d.ts +1 -1
- package/types/pc/slider/Tick.d.ts +1 -1
- package/types/pc/slider/interface.d.ts +0 -4
- package/types/pc/space/index.d.ts +7 -5
- package/types/pc/speech-synthesis/index.d.ts +3 -1
- package/types/pc/speech-synthesis/interface.d.ts +7 -0
- package/types/pc/spin/DotLoading.d.ts +1 -1
- package/types/pc/spin/interface.d.ts +4 -1
- package/types/pc/splitter/Panel.d.ts +8 -0
- package/types/pc/splitter/SplitBar.d.ts +21 -0
- package/types/pc/splitter/Splitter.d.ts +4 -0
- package/types/pc/splitter/hooks/useEvent.d.ts +3 -0
- package/types/pc/splitter/hooks/useItems.d.ts +10 -0
- package/types/pc/splitter/hooks/useResizable.d.ts +8 -0
- package/types/pc/splitter/hooks/useResize.d.ts +4 -0
- package/types/pc/splitter/hooks/useSizes.d.ts +5 -0
- package/types/pc/splitter/index.d.ts +8 -3
- package/types/pc/splitter/interface.d.ts +181 -38
- package/types/pc/statistic/interface.d.ts +0 -4
- package/types/pc/steps/interface.d.ts +0 -3
- package/types/pc/suspense-fallback-test/index.d.ts +2 -3
- package/types/pc/suspense-fallback-test/interface.d.ts +2 -0
- package/types/pc/table/ColGroup.d.ts +1 -1
- package/types/pc/table/hook/useThResizable.d.ts +2 -2
- package/types/pc/table/interface.d.ts +4 -15
- package/types/pc/table/summary/Cell.d.ts +1 -1
- package/types/pc/table/summary/Row.d.ts +1 -1
- package/types/pc/table/tbody/Td.d.ts +1 -1
- package/types/pc/table/tbody/index.d.ts +1 -1
- package/types/pc/table/tfoot/index.d.ts +1 -1
- package/types/pc/table/th-resizable/index.d.ts +1 -1
- package/types/pc/table/thead/Column.d.ts +1 -1
- package/types/pc/table/thead/index.d.ts +1 -1
- package/types/pc/tabs/TabContent.d.ts +1 -1
- package/types/pc/tabs/interface.d.ts +0 -7
- package/types/pc/tabs/tab-header/DropdownIcon.d.ts +1 -1
- package/types/pc/tabs/tab-header/TabInk.d.ts +1 -1
- package/types/pc/tabs/tab-header/TabNavIcon.d.ts +1 -1
- package/types/pc/tag/index.d.ts +2 -0
- package/types/pc/tag/interface.d.ts +0 -1
- package/types/pc/time-picker/Picker.d.ts +1 -1
- package/types/pc/time-picker/RangePicker.d.ts +1 -1
- package/types/pc/time-picker/TimeColumn.d.ts +1 -1
- package/types/pc/time-picker/TimePicker.d.ts +1 -1
- package/types/pc/time-picker/index.d.ts +1 -1
- package/types/pc/time-picker/interface.d.ts +0 -7
- package/types/pc/tooltip/interface.d.ts +4 -1
- package/types/pc/transfer/Item.d.ts +1 -1
- package/types/pc/transfer/List.d.ts +1 -1
- package/types/pc/transfer/interface.d.ts +2 -9
- package/types/pc/tree/Animation.d.ts +1 -1
- package/types/pc/tree/interface.d.ts +2 -8
- package/types/pc/tree-select/interface.d.ts +0 -8
- package/types/pc/trigger/interface.d.ts +0 -5
- package/types/pc/typography/EditContent.d.ts +2 -1
- package/types/pc/typography/Operations.d.ts +1 -1
- package/types/pc/typography/interface.d.ts +45 -30
- package/types/pc/upload/interface.d.ts +6 -11
- package/types/pc/upload/list/index.d.ts +1 -1
- package/types/pc/utils/index.d.ts +1 -0
- package/types/pc/utils/names.d.ts +6 -0
- package/types/pc/utils/toArray.d.ts +3 -0
- package/types/pc/verification-code/VerificationCode.d.ts +1 -1
- package/types/pc/verification-code/interface.d.ts +0 -2
- package/types/pc/virtual-list/VirtualList.d.ts +2 -38
- package/types/pc/virtual-list/index.d.ts +2 -1
- package/types/pc/virtual-list/interface.d.ts +56 -0
- package/types/pc/watermark/Watermark.d.ts +1 -1
- package/types/pc/watermark/interface.d.ts +0 -2
- package/typography/Base.js +73 -73
- package/typography/EditContent.js +43 -33
- package/typography/Ellipsis.js +117 -184
- package/typography/Operations.js +97 -49
- package/typography/useCssEllipsis.js +7 -6
- package/utils/index.js +117 -115
- package/utils/names.js +4 -0
- package/utils/toArray.js +5 -0
- package/version/index.js +1 -1
- package/virtual-list/interface.js +1 -0
- package/components/common/space/toArray.js +0 -11
- package/loading/style/index.module.less.js +0 -4
- package/types/common/space/toArray.d.ts +0 -3
- package/types/pc/suspense-fallback-test/style/index.d.ts +0 -1
- /package/{suspense-fallback-test/style/index.less.js → development/interface.js} +0 -0
- /package/types/pc/grid/{GridItem.d.ts → Item.d.ts} +0 -0
|
@@ -1,58 +1,82 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { useButton:
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import P from "@unicom-cloud/icons/IconUiMute";
|
|
3
|
+
import U from "@unicom-cloud/icons/IconUiPauseCircleFill";
|
|
4
|
+
import b from "@unicom-cloud/icons/IconUiPlayCircleFill";
|
|
5
|
+
import N from "@unicom-cloud/icons/IconUiSound";
|
|
6
|
+
import { forwardRef as v, useState as x, useMemo as E, useCallback as c, useImperativeHandle as F, useEffect as M, memo as R } from "react";
|
|
7
|
+
const T = (S) => {
|
|
8
|
+
const d = v((g, C) => {
|
|
9
|
+
const { useButton: I = !0, buttonProps: f = {}, ...s } = g, [l, i] = x(!1), [a, m] = x(
|
|
10
|
+
null
|
|
11
|
+
), e = E(
|
|
12
|
+
() => "speechSynthesis" in window && "SpeechSynthesisUtterance" in window,
|
|
13
|
+
[]
|
|
14
|
+
), o = c(() => {
|
|
15
|
+
e && (window.speechSynthesis.cancel(), i(!1), m(null));
|
|
16
|
+
}, [e]), p = c(() => {
|
|
17
|
+
if (!e) return;
|
|
18
|
+
o();
|
|
19
|
+
const n = s.getText?.() ?? s.text;
|
|
20
|
+
if (!n) return;
|
|
21
|
+
const t = new SpeechSynthesisUtterance(n);
|
|
22
|
+
m(t);
|
|
23
|
+
const r = () => {
|
|
24
|
+
i(!1), m(null);
|
|
25
|
+
};
|
|
26
|
+
t.onstart = () => i(!0), t.onend = r, t.onerror = r, t.onpause = () => i(!1), t.onresume = () => i(!0);
|
|
27
|
+
try {
|
|
28
|
+
window.speechSynthesis.speak(t);
|
|
29
|
+
} catch (y) {
|
|
30
|
+
console.error("Speech synthesis failed:", y), r();
|
|
31
|
+
}
|
|
32
|
+
}, [o, e, s.getText, s.text]), u = c(() => {
|
|
33
|
+
e && a && window.speechSynthesis.pause();
|
|
34
|
+
}, [e, a]), w = c(() => {
|
|
35
|
+
e && a && window.speechSynthesis.resume();
|
|
36
|
+
}, [e, a]), k = c(
|
|
37
|
+
(n) => {
|
|
38
|
+
n.preventDefault(), n.stopPropagation(), l ? u() : p(), f.onClick?.(n);
|
|
39
|
+
},
|
|
40
|
+
[l, u, p, f.onClick]
|
|
41
|
+
);
|
|
42
|
+
if (F(
|
|
43
|
+
C,
|
|
44
|
+
() => ({
|
|
45
|
+
cancel: o,
|
|
46
|
+
speak: p,
|
|
47
|
+
pause: u,
|
|
48
|
+
resume: w
|
|
49
|
+
}),
|
|
50
|
+
[o, p, u, w]
|
|
51
|
+
), M(() => o, [o]), !e)
|
|
52
|
+
return null;
|
|
53
|
+
if (I) {
|
|
54
|
+
const { label: n, text: t, children: r, ...y } = f;
|
|
55
|
+
return /* @__PURE__ */ h(
|
|
56
|
+
S,
|
|
57
|
+
{
|
|
58
|
+
...s,
|
|
59
|
+
type: "text",
|
|
60
|
+
size: "mini",
|
|
61
|
+
icon: l ? /* @__PURE__ */ h(P, {}) : /* @__PURE__ */ h(N, {}),
|
|
62
|
+
...y,
|
|
63
|
+
onClick: k,
|
|
64
|
+
children: n || t || r
|
|
65
|
+
}
|
|
66
|
+
);
|
|
12
67
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, e.onend = () => {
|
|
26
|
-
t(!1);
|
|
27
|
-
}, window.speechSynthesis?.speak?.(e);
|
|
28
|
-
}
|
|
29
|
-
function a(n) {
|
|
30
|
-
l(), s || S(), c?.onClick?.(n);
|
|
31
|
-
}
|
|
32
|
-
let r;
|
|
33
|
-
if (window.speechSynthesis && window.SpeechSynthesisUtterance)
|
|
34
|
-
if (h) {
|
|
35
|
-
let { label: n, text: e, children: d, ...k } = c ?? {};
|
|
36
|
-
r = /* @__PURE__ */ i(
|
|
37
|
-
u,
|
|
38
|
-
{
|
|
39
|
-
...o,
|
|
40
|
-
type: "text",
|
|
41
|
-
size: "mini",
|
|
42
|
-
icon: s ? /* @__PURE__ */ i(w, {}) : /* @__PURE__ */ i(x, {}),
|
|
43
|
-
...k,
|
|
44
|
-
onClick: a,
|
|
45
|
-
children: n || e || d
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
} else
|
|
49
|
-
r = /* @__PURE__ */ i(s ? y : I, { ...o.iconProps, onClick: a });
|
|
50
|
-
return g(() => () => {
|
|
51
|
-
l();
|
|
52
|
-
}, []), b(m, () => ({})), r;
|
|
53
|
-
}
|
|
54
|
-
return C(P(p));
|
|
55
|
-
}
|
|
68
|
+
return /* @__PURE__ */ h(
|
|
69
|
+
l ? U : b,
|
|
70
|
+
{
|
|
71
|
+
...s.iconProps,
|
|
72
|
+
onClick: k,
|
|
73
|
+
style: { cursor: "pointer" }
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
return d.displayName = `WithSpeechSynthesis(${S.displayName || S.name || "SpeechSynthesis"})`, R(d);
|
|
78
|
+
};
|
|
79
|
+
T.displayName = "withSpeechSynthesis";
|
|
56
80
|
export {
|
|
57
|
-
|
|
81
|
+
T as default
|
|
58
82
|
};
|
|
@@ -1,96 +1,76 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { UI_COMMON_PREFIX as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
1
|
+
import { jsx as o, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
+
import { UI_COMMON_PREFIX as b } from "@unicom-cloud/utils/constant/ui";
|
|
3
|
+
import O from "lodash/isArray";
|
|
4
|
+
import R from "lodash/isNumber";
|
|
5
|
+
import { forwardRef as f, Fragment as k } from "react";
|
|
6
|
+
import E from "../hooks/useMergeProps.js";
|
|
7
|
+
import F from "@unicom-cloud/utils/class-name";
|
|
8
|
+
import { toArray as L } from "../utils/toArray.js";
|
|
9
|
+
const u = {
|
|
10
|
+
mini: 4,
|
|
11
|
+
small: 8,
|
|
12
|
+
medium: 16,
|
|
13
|
+
large: 24
|
|
14
|
+
}, U = {
|
|
10
15
|
size: "small",
|
|
11
16
|
direction: "horizontal"
|
|
12
|
-
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
marginBottom: t
|
|
63
|
-
} : n ? {} : {
|
|
64
|
-
[s === "vertical" ? "marginBottom" : o]: t
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
if (P(i)) {
|
|
68
|
-
const t = f(i[0]), u = f(i[1]);
|
|
69
|
-
return l ? n ? { marginBottom: u } : {
|
|
70
|
-
[`${o}`]: t,
|
|
71
|
-
marginBottom: u
|
|
72
|
-
} : s === "vertical" ? { marginBottom: u } : { [`${o}`]: t };
|
|
73
|
-
}
|
|
17
|
+
}, d = f(
|
|
18
|
+
function(a, y) {
|
|
19
|
+
const $ = E(a, U, {}), {
|
|
20
|
+
className: N,
|
|
21
|
+
style: S,
|
|
22
|
+
children: h,
|
|
23
|
+
gap: G,
|
|
24
|
+
size: x,
|
|
25
|
+
direction: n = "horizontal",
|
|
26
|
+
align: P,
|
|
27
|
+
alignItems: V,
|
|
28
|
+
justifyContent: l,
|
|
29
|
+
wrap: j,
|
|
30
|
+
split: p,
|
|
31
|
+
rtl: w,
|
|
32
|
+
...z
|
|
33
|
+
} = $, e = `${b}-space`, r = G ?? x, m = V ?? P ?? (n === "horizontal" ? "center" : ""), A = F(
|
|
34
|
+
e,
|
|
35
|
+
{
|
|
36
|
+
[`${e}-${n}`]: n,
|
|
37
|
+
[`${e}-justify-content-${l}`]: l,
|
|
38
|
+
[`${e}-align-items-${m}`]: m,
|
|
39
|
+
[`${e}-wrap`]: j,
|
|
40
|
+
[`${e}-rtl`]: w
|
|
41
|
+
},
|
|
42
|
+
N
|
|
43
|
+
), i = (t) => R(t) ? t : u[t] ?? u.small, C = {
|
|
44
|
+
...(() => {
|
|
45
|
+
if (typeof r == "string" || typeof r == "number")
|
|
46
|
+
return {
|
|
47
|
+
gap: `${i(r)}px`
|
|
48
|
+
};
|
|
49
|
+
if (O(r)) {
|
|
50
|
+
const t = i(r[1]), s = i(r[0]);
|
|
51
|
+
return {
|
|
52
|
+
rowGap: `${t}px`,
|
|
53
|
+
columnGap: `${s}px`
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return {};
|
|
57
|
+
})(),
|
|
58
|
+
...S
|
|
59
|
+
}, v = L(h);
|
|
60
|
+
return /* @__PURE__ */ o("div", { ref: y, className: A, style: C, ...z, children: v.map((t, s) => {
|
|
61
|
+
const I = t?.key ?? s, M = p != null && s > 0;
|
|
62
|
+
return /* @__PURE__ */ _(k, { children: [
|
|
63
|
+
M && /* @__PURE__ */ o("div", { className: `${e}-item-split`, children: p }),
|
|
64
|
+
/* @__PURE__ */ o("div", { className: `${e}-item`, children: t })
|
|
65
|
+
] }, I);
|
|
66
|
+
}) });
|
|
74
67
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
] }, o);
|
|
81
|
-
}) });
|
|
82
|
-
}
|
|
83
|
-
const g = N(
|
|
84
|
-
E
|
|
85
|
-
);
|
|
86
|
-
g.displayName = "Space";
|
|
87
|
-
function H(a, m) {
|
|
88
|
-
return /* @__PURE__ */ c(g, { ref: m, ...a, direction: "vertical", children: a.children });
|
|
89
|
-
}
|
|
90
|
-
const v = N(H);
|
|
91
|
-
v.displayName = "SpaceVertical";
|
|
92
|
-
g.Vertical = v;
|
|
68
|
+
), g = f((c, a) => /* @__PURE__ */ o(d, { ref: a, ...c, direction: "vertical" })), T = Object.assign(d, {
|
|
69
|
+
displayName: "Space",
|
|
70
|
+
Vertical: g
|
|
71
|
+
});
|
|
72
|
+
g.displayName = "Space.Vertical";
|
|
93
73
|
export {
|
|
94
|
-
|
|
95
|
-
|
|
74
|
+
g as SpaceVertical,
|
|
75
|
+
T as default
|
|
96
76
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import e from "react";
|
|
3
|
+
const a = (n, r) => {
|
|
4
|
+
const s = e.useMemo(
|
|
5
|
+
() => e.lazy(
|
|
6
|
+
() => new Promise(() => {
|
|
7
|
+
})
|
|
8
|
+
),
|
|
9
|
+
[]
|
|
10
|
+
);
|
|
11
|
+
return /* @__PURE__ */ o(s, {});
|
|
12
|
+
}, t = e.forwardRef(a);
|
|
13
|
+
t.displayName = "SuspenseFallbackTest";
|
|
14
|
+
export {
|
|
15
|
+
t as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import o from "react";
|
|
2
|
+
import { isFragment as a } from "react-is";
|
|
3
|
+
function t(s, p = {}) {
|
|
4
|
+
const e = [];
|
|
5
|
+
return o.Children.forEach(s, (r) => {
|
|
6
|
+
r == null && !p.keepEmpty || (Array.isArray(r) ? e.push(...t(r, p)) : a(r) && "props" in r && r.props ? e.push(...t(r.props.children, p)) : e.push(r));
|
|
7
|
+
}), e;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
t as default,
|
|
11
|
+
t as toArray
|
|
12
|
+
};
|
package/copy/index.js
CHANGED
|
@@ -1,62 +1,110 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useContext as
|
|
1
|
+
import { jsx as e, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import g from "@unicom-cloud/icons/IconUiCheckCircleFill";
|
|
3
|
+
import T from "@unicom-cloud/icons/IconUiCopy";
|
|
4
|
+
import { useContext as h, useState as b, useRef as P, useEffect as w } from "react";
|
|
5
5
|
import "../config-provider/ConfigProvider.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import k from "@unicom-cloud/utils/
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
import E from "../components/common/hooks/useKeyboardEvent.js";
|
|
7
|
+
import N from "../tooltip/index.js";
|
|
8
|
+
import "@unicom-cloud/utils/case-name";
|
|
9
|
+
import k from "@unicom-cloud/utils/class-name";
|
|
10
|
+
import "../dist/tinycolor/chunk/BOzCVdr0.js";
|
|
11
|
+
import "@unicom-cloud/utils/constant/ui";
|
|
12
|
+
import "../utils/contextHolder.js";
|
|
13
|
+
import "@unicom-cloud/utils/dayjs";
|
|
14
|
+
import I from "@unicom-cloud/utils/clipboard-copy";
|
|
15
|
+
import "../components/common/utils/dayjs.js";
|
|
16
|
+
import "../components/common/utils/dom.js";
|
|
17
|
+
import "@unicom-cloud/utils/file/fileToURL";
|
|
18
|
+
import "lodash/escapeRegExp";
|
|
19
|
+
import "lodash/isArray";
|
|
20
|
+
import "lodash/isNumber";
|
|
21
|
+
import "lodash/isString";
|
|
22
|
+
import "lodash/isFunction";
|
|
23
|
+
import "lodash/throttle";
|
|
24
|
+
import "../components/common/utils/is.js";
|
|
25
|
+
import "lodash/camelCase";
|
|
26
|
+
import "lodash/capitalize";
|
|
27
|
+
import "lodash/cloneDeep";
|
|
28
|
+
import "lodash/debounce";
|
|
29
|
+
import "lodash/get";
|
|
30
|
+
import "lodash/has";
|
|
31
|
+
import "lodash/kebabCase";
|
|
32
|
+
import "lodash/merge";
|
|
33
|
+
import "lodash/mergeWith";
|
|
34
|
+
import "lodash/set";
|
|
35
|
+
import "lodash/setWith";
|
|
36
|
+
import "lodash/snakeCase";
|
|
37
|
+
import "lodash/startCase";
|
|
38
|
+
import "lodash/uniq";
|
|
39
|
+
import "lodash/upperFirst";
|
|
40
|
+
import "@unicom-cloud/utils/math";
|
|
41
|
+
import { mergedToString as j } from "../components/common/utils/mergedToString.js";
|
|
42
|
+
import "../dist/react-transition-group/src/CSSTransition.js";
|
|
43
|
+
import "../dist/react-transition-group/src/ReplaceTransition.js";
|
|
44
|
+
import "../dist/react-transition-group/src/SwitchTransition.js";
|
|
45
|
+
import "../dist/react-transition-group/chunk/CPfP7aNL.js";
|
|
46
|
+
import "../dist/react-transition-group/src/TransitionGroup.js";
|
|
47
|
+
import "../components/common/utils/reactDOM.js";
|
|
48
|
+
import "@unicom-cloud/utils/file/saveAs";
|
|
49
|
+
import "@unicom-cloud/utils/screenfull";
|
|
50
|
+
import "@unicom-cloud/utils/constant/ui.js";
|
|
51
|
+
import "lodash/isPlainObject";
|
|
52
|
+
import "react-is";
|
|
53
|
+
import "@unicom-cloud/utils/tree";
|
|
54
|
+
import { isFunction as v } from "@unicom-cloud/utils/is";
|
|
55
|
+
import "uuid";
|
|
56
|
+
import "../dist/validate/src/index.js";
|
|
57
|
+
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
58
|
+
import F from "../config-provider/context.js";
|
|
59
|
+
function S(o) {
|
|
60
|
+
const { children: n } = o, u = E(), C = h(F), { getPrefixCls: d, locale: c, rtl: y } = C, r = d?.("copy"), [i, l] = b(!1), m = P(-1), p = o.tooltips || [
|
|
14
61
|
c?.Typography?.copy,
|
|
15
62
|
c?.Typography?.copied
|
|
16
63
|
];
|
|
17
|
-
let
|
|
18
|
-
o.icon !== null && o.icon !== !1 && (
|
|
19
|
-
function a
|
|
20
|
-
if (
|
|
64
|
+
let s = null;
|
|
65
|
+
o.icon !== null && o.icon !== !1 && (s = i ? /* @__PURE__ */ e(g, {}) : o.icon || /* @__PURE__ */ e(T, {}));
|
|
66
|
+
function f(a) {
|
|
67
|
+
if (a.stopPropagation(), i)
|
|
21
68
|
return;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
69
|
+
let t = o.text;
|
|
70
|
+
v(t) && (t = t()), t || (t = j(n)), I(t), l(!0), o.onCopy?.(t, a), m.current = window.setTimeout(() => {
|
|
71
|
+
l(!1);
|
|
25
72
|
}, 3e3);
|
|
26
73
|
}
|
|
27
|
-
return
|
|
28
|
-
clearTimeout(
|
|
29
|
-
}, []), /* @__PURE__ */
|
|
30
|
-
|
|
74
|
+
return w(() => () => {
|
|
75
|
+
clearTimeout(m.current), m.current = -1;
|
|
76
|
+
}, []), /* @__PURE__ */ e(
|
|
77
|
+
N,
|
|
31
78
|
{
|
|
32
|
-
content:
|
|
79
|
+
content: i ? p[1] : p[0],
|
|
33
80
|
getPopupContainer: () => window.document.body,
|
|
34
81
|
...o.tooltipProps,
|
|
35
|
-
children: /* @__PURE__ */
|
|
82
|
+
children: /* @__PURE__ */ x(
|
|
36
83
|
"span",
|
|
37
84
|
{
|
|
38
|
-
className:
|
|
39
|
-
|
|
40
|
-
!!
|
|
85
|
+
className: k(
|
|
86
|
+
r,
|
|
87
|
+
!!y && `${r}-rtl`,
|
|
88
|
+
!!i && `${r}-copied`,
|
|
41
89
|
o.className
|
|
42
90
|
),
|
|
43
91
|
role: "button",
|
|
44
|
-
"aria-label":
|
|
92
|
+
"aria-label": p[0],
|
|
45
93
|
tabIndex: 0,
|
|
46
|
-
onClick:
|
|
94
|
+
onClick: f,
|
|
47
95
|
...u({
|
|
48
|
-
onPressEnter:
|
|
96
|
+
onPressEnter: f
|
|
49
97
|
}),
|
|
50
98
|
children: [
|
|
51
|
-
|
|
52
|
-
|
|
99
|
+
n,
|
|
100
|
+
s
|
|
53
101
|
]
|
|
54
102
|
}
|
|
55
103
|
)
|
|
56
104
|
}
|
|
57
105
|
);
|
|
58
106
|
}
|
|
59
|
-
|
|
107
|
+
S.displayName = "Copy";
|
|
60
108
|
export {
|
|
61
|
-
|
|
109
|
+
S as default
|
|
62
110
|
};
|