@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
package/modal/Modal.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as E, jsx as o, Fragment as Ke } from "react/jsx-runtime";
|
|
2
2
|
import _e from "@unicom-cloud/icons/IconUiClose";
|
|
3
3
|
import ue from "lodash/isFunction";
|
|
4
|
-
import Ge, { forwardRef as Je,
|
|
4
|
+
import Ge, { forwardRef as Je, useContext as Qe, useRef as i, useState as T, useCallback as k, useEffect as q } from "react";
|
|
5
5
|
import de from "../button/index.js";
|
|
6
6
|
import en from "../config-provider/ConfigProvider.js";
|
|
7
7
|
import nn from "../components/common/hooks/useIsFirstRender.js";
|
|
8
8
|
import tn from "../components/common/hooks/useMergeProps.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import rn from "../components/common/hooks/useMergeValue.js";
|
|
10
|
+
import on from "../components/common/hooks/useOverflowHidden.js";
|
|
11
11
|
import ln from "../icon-hover/index.js";
|
|
12
12
|
import sn from "../portal/index.js";
|
|
13
13
|
import { PqbCSSTransition as me } from "../components/common/utils/PqbCSSTransition.js";
|
|
@@ -41,9 +41,8 @@ const bn = {
|
|
|
41
41
|
getPopupContainer: () => document.body,
|
|
42
42
|
alignCenter: !0
|
|
43
43
|
};
|
|
44
|
-
function xn(l,
|
|
45
|
-
|
|
46
|
-
const d = Qe(gn), o = tn(
|
|
44
|
+
function xn(l, y) {
|
|
45
|
+
const d = Qe(gn), r = tn(
|
|
47
46
|
l,
|
|
48
47
|
bn,
|
|
49
48
|
d.componentConfig?.Modal
|
|
@@ -52,7 +51,7 @@ function xn(l, b) {
|
|
|
52
51
|
style: Ce,
|
|
53
52
|
visible: s,
|
|
54
53
|
simple: Z,
|
|
55
|
-
title:
|
|
54
|
+
title: b,
|
|
56
55
|
subtitle: N,
|
|
57
56
|
children: be,
|
|
58
57
|
cancelText: xe,
|
|
@@ -60,7 +59,7 @@ function xn(l, b) {
|
|
|
60
59
|
okButtonProps: ve,
|
|
61
60
|
cancelButtonProps: Me,
|
|
62
61
|
getPopupContainer: D = () => document.body,
|
|
63
|
-
footer:
|
|
62
|
+
footer: x,
|
|
64
63
|
afterClose: we,
|
|
65
64
|
confirmLoading: Ee,
|
|
66
65
|
mountOnEnter: $,
|
|
@@ -68,7 +67,7 @@ function xn(l, b) {
|
|
|
68
67
|
afterOpen: Te,
|
|
69
68
|
hideCancel: ke,
|
|
70
69
|
maskClosable: ye,
|
|
71
|
-
mask:
|
|
70
|
+
mask: h,
|
|
72
71
|
alignCenter: Ne,
|
|
73
72
|
getChildrenPopupContainer: j,
|
|
74
73
|
wrapClassName: De,
|
|
@@ -80,31 +79,31 @@ function xn(l, b) {
|
|
|
80
79
|
fullscreenable: hn,
|
|
81
80
|
okButton: m,
|
|
82
81
|
..._
|
|
83
|
-
} =
|
|
82
|
+
} = r, f = i(null), G = i(null), a = i(null), [J, Q] = T(), [ee, Re] = T(), v = i(null), p = i(!1), [Be, ne] = T(""), [te, re] = T("");
|
|
84
83
|
nn();
|
|
85
|
-
const B =
|
|
84
|
+
const B = i(!0);
|
|
86
85
|
s && B.current && (B.current = !1);
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
const [Ie, I] =
|
|
86
|
+
const M = i();
|
|
87
|
+
M.current || (M.current = Cn++);
|
|
88
|
+
const [Ie, I] = rn(!1, {
|
|
90
89
|
defaultValue: !1,
|
|
91
90
|
value: Ee
|
|
92
|
-
}), t = d.getPrefixCls?.("modal",
|
|
93
|
-
|
|
91
|
+
}), t = d.getPrefixCls?.("modal", r.prefixCls), { locale: O, rtl: oe } = d, Oe = !Z || _.noticeType === "show", Xe = "closable" in r ? r.closable : Oe, Ye = k(() => mn(D()), [D]);
|
|
92
|
+
on(Ye, { hidden: s && h });
|
|
94
93
|
function X(e) {
|
|
95
94
|
e.stopPropagation(), Y();
|
|
96
95
|
}
|
|
97
96
|
function Y() {
|
|
98
|
-
|
|
97
|
+
r.onCancel?.();
|
|
99
98
|
}
|
|
100
99
|
const Le = (e) => {
|
|
101
100
|
R && s && e.key === un.key && (e.stopPropagation(), Y());
|
|
102
|
-
}, L =
|
|
103
|
-
p.current && (p.current = !1, !L.current && ye &&
|
|
101
|
+
}, L = i(!1), Se = (e) => {
|
|
102
|
+
p.current && (p.current = !1, !L.current && ye && h && e.target === e.currentTarget && setTimeout(() => {
|
|
104
103
|
Y();
|
|
105
104
|
}, 100));
|
|
106
105
|
}, He = (e) => {
|
|
107
|
-
const n = (
|
|
106
|
+
const n = (r.onOk ?? r.onConfirm)?.(e);
|
|
108
107
|
n?.then && (I(!0), n.then(
|
|
109
108
|
() => {
|
|
110
109
|
I(!1);
|
|
@@ -128,17 +127,17 @@ function xn(l, b) {
|
|
|
128
127
|
isNaN(e) || Re(e + 1);
|
|
129
128
|
}
|
|
130
129
|
}, Ve = () => {
|
|
131
|
-
if (
|
|
130
|
+
if (x === null)
|
|
132
131
|
return;
|
|
133
|
-
const e =
|
|
132
|
+
const e = r.cancelButton?.visible !== !1 && /* @__PURE__ */ o(
|
|
134
133
|
de,
|
|
135
134
|
{
|
|
136
135
|
onClick: X,
|
|
137
136
|
...Me,
|
|
138
|
-
...
|
|
139
|
-
children:
|
|
137
|
+
...r.cancelButton?.props,
|
|
138
|
+
children: r.cancelButton?.props?.children || r.cancelButton?.label || r.cancelButton?.text || xe || O?.Modal.cancelText
|
|
140
139
|
}
|
|
141
|
-
), n = m?.visible !== !1 && /* @__PURE__ */
|
|
140
|
+
), n = m?.visible !== !1 && /* @__PURE__ */ o(
|
|
142
141
|
de,
|
|
143
142
|
{
|
|
144
143
|
loading: Ie,
|
|
@@ -148,27 +147,27 @@ function xn(l, b) {
|
|
|
148
147
|
...m?.props,
|
|
149
148
|
children: m?.props?.children || m?.label || m?.text || he || O?.Modal.okText
|
|
150
149
|
}
|
|
151
|
-
), c = ue(
|
|
150
|
+
), c = ue(x) ? x(e, n) : x || /* @__PURE__ */ E(Ke, { children: [
|
|
152
151
|
!ke && e,
|
|
153
152
|
n
|
|
154
153
|
] });
|
|
155
|
-
return /* @__PURE__ */
|
|
156
|
-
}, S =
|
|
154
|
+
return /* @__PURE__ */ o("div", { className: `${t}-footer`, children: c });
|
|
155
|
+
}, S = i(
|
|
157
156
|
ae()
|
|
158
|
-
), ze =
|
|
159
|
-
if (!
|
|
157
|
+
), ze = k((e) => {
|
|
158
|
+
if (!a.current) return;
|
|
160
159
|
e.preventDefault();
|
|
161
160
|
const n = S.current;
|
|
162
|
-
n.screenX = e.screenX, n.screenY = e.screenY, n.prewTranslateX = n.translateX, n.prewTranslateY = n.translateY, n.boundingClientRect =
|
|
163
|
-
}, []), le =
|
|
161
|
+
n.screenX = e.screenX, n.screenY = e.screenY, n.prewTranslateX = n.translateX, n.prewTranslateY = n.translateY, n.boundingClientRect = a.current?.getBoundingClientRect?.() ?? {}, n.offsetParentBoundingClientRect = a.current?.offsetParent?.getBoundingClientRect?.() ?? {}, w(), qe();
|
|
162
|
+
}, []), le = k((e) => {
|
|
164
163
|
e.preventDefault();
|
|
165
164
|
const n = S.current, { left: c, right: V, top: z, bottom: Ze } = n.boundingClientRect ?? {}, { width: je, height: Ae } = n.offsetParentBoundingClientRect ?? {};
|
|
166
165
|
let g = Math.max(e.screenX - n.screenX, -c);
|
|
167
166
|
g = Math.min(g, je - V);
|
|
168
167
|
let C = Math.max(e.screenY - n.screenY, -z);
|
|
169
168
|
C = Math.min(C, Ae - Ze), g += n.prewTranslateX, C += n.prewTranslateY, n.translateX = g, n.translateY = C, ne(`translate(${g}px, ${C}px)`);
|
|
170
|
-
}, []), se =
|
|
171
|
-
e.preventDefault(),
|
|
169
|
+
}, []), se = k((e) => {
|
|
170
|
+
e.preventDefault(), w();
|
|
172
171
|
}, []);
|
|
173
172
|
function qe() {
|
|
174
173
|
document.documentElement.addEventListener(
|
|
@@ -179,7 +178,7 @@ function xn(l, b) {
|
|
|
179
178
|
se
|
|
180
179
|
);
|
|
181
180
|
}
|
|
182
|
-
function
|
|
181
|
+
function w() {
|
|
183
182
|
document.documentElement.removeEventListener(
|
|
184
183
|
"mousemove",
|
|
185
184
|
le
|
|
@@ -201,36 +200,36 @@ function xn(l, b) {
|
|
|
201
200
|
};
|
|
202
201
|
}
|
|
203
202
|
function H() {
|
|
204
|
-
S.current = ae(), ne(""),
|
|
203
|
+
S.current = ae(), ne(""), re("");
|
|
205
204
|
}
|
|
206
205
|
q(() => () => {
|
|
207
|
-
H(),
|
|
208
|
-
}, []), q(() => (
|
|
209
|
-
}), [
|
|
210
|
-
const Ue = /* @__PURE__ */
|
|
206
|
+
H(), w();
|
|
207
|
+
}, []), q(() => (a.current || (H(), w()), () => {
|
|
208
|
+
}), [a.current]);
|
|
209
|
+
const Ue = /* @__PURE__ */ E(
|
|
211
210
|
en,
|
|
212
211
|
{
|
|
213
212
|
...d,
|
|
214
213
|
childrenName: "Modal",
|
|
215
|
-
prefixCls:
|
|
214
|
+
prefixCls: r.prefixCls || d.prefixCls,
|
|
216
215
|
locale: O,
|
|
217
216
|
zIndex: ee || 1050,
|
|
218
217
|
getPopupContainer: (e) => typeof j == "function" ? j(e) : G.current,
|
|
219
218
|
children: [
|
|
220
|
-
(!!
|
|
221
|
-
!!
|
|
219
|
+
(!!b || !!N) && /* @__PURE__ */ E("div", { className: `${t}-header`, children: [
|
|
220
|
+
!!b && /* @__PURE__ */ o(
|
|
222
221
|
"div",
|
|
223
222
|
{
|
|
224
223
|
className: `${t}-title`,
|
|
225
|
-
id: `pqb-dialog-${
|
|
226
|
-
children:
|
|
224
|
+
id: `pqb-dialog-${M.current}`,
|
|
225
|
+
children: b
|
|
227
226
|
}
|
|
228
227
|
),
|
|
229
|
-
!!N && /* @__PURE__ */
|
|
228
|
+
!!N && /* @__PURE__ */ o("div", { className: `${t}-subtitle`, children: N })
|
|
230
229
|
] }),
|
|
231
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ o("div", { ref: G, className: `${t}-content`, children: be }),
|
|
232
231
|
Ve(),
|
|
233
|
-
!
|
|
232
|
+
!r.fullscreenable && r.draggable !== !1 && /* @__PURE__ */ o(
|
|
234
233
|
"div",
|
|
235
234
|
{
|
|
236
235
|
className: `${t}-drag-icon`,
|
|
@@ -238,14 +237,14 @@ function xn(l, b) {
|
|
|
238
237
|
onDoubleClick: H
|
|
239
238
|
}
|
|
240
239
|
),
|
|
241
|
-
(Xe || !!
|
|
240
|
+
(Xe || !!r.fullscreenable) && (K !== void 0 ? /* @__PURE__ */ o(
|
|
242
241
|
"span",
|
|
243
242
|
{
|
|
244
243
|
className: `${t}-close-icon`,
|
|
245
244
|
onClick: X,
|
|
246
245
|
children: K
|
|
247
246
|
}
|
|
248
|
-
) : /* @__PURE__ */
|
|
247
|
+
) : /* @__PURE__ */ o(
|
|
249
248
|
ln,
|
|
250
249
|
{
|
|
251
250
|
tabIndex: -1,
|
|
@@ -253,12 +252,12 @@ function xn(l, b) {
|
|
|
253
252
|
onClick: X,
|
|
254
253
|
role: "button",
|
|
255
254
|
"aria-label": "Close",
|
|
256
|
-
children: /* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ o(_e, {})
|
|
257
256
|
}
|
|
258
257
|
))
|
|
259
258
|
]
|
|
260
259
|
}
|
|
261
|
-
), We =
|
|
260
|
+
), We = b ? { "aria-labelledby": `pqb-dialog-${M.current}` } : {}, ie = /* @__PURE__ */ o(
|
|
262
261
|
"div",
|
|
263
262
|
{
|
|
264
263
|
role: "dialog",
|
|
@@ -268,8 +267,8 @@ function xn(l, b) {
|
|
|
268
267
|
t,
|
|
269
268
|
{
|
|
270
269
|
[`${t}-simple`]: Z,
|
|
271
|
-
[`${t}-rtl`]:
|
|
272
|
-
[`${t}-fullscreenable`]:
|
|
270
|
+
[`${t}-rtl`]: oe,
|
|
271
|
+
[`${t}-fullscreenable`]: r.fullscreenable
|
|
273
272
|
},
|
|
274
273
|
ge
|
|
275
274
|
),
|
|
@@ -278,32 +277,32 @@ function xn(l, b) {
|
|
|
278
277
|
transform: Be,
|
|
279
278
|
transformOrigin: te
|
|
280
279
|
},
|
|
281
|
-
ref:
|
|
280
|
+
ref: a,
|
|
282
281
|
children: Ue
|
|
283
282
|
}
|
|
284
283
|
), F = (e) => {
|
|
285
284
|
if (te)
|
|
286
285
|
return;
|
|
287
286
|
let n = "";
|
|
288
|
-
if (
|
|
289
|
-
const c = e.getBoundingClientRect(), { left: V, top: z } =
|
|
287
|
+
if (v.current) {
|
|
288
|
+
const c = e.getBoundingClientRect(), { left: V, top: z } = v.current;
|
|
290
289
|
n = `${V - c.left}px ${z - c.top}px`;
|
|
291
290
|
}
|
|
292
|
-
|
|
293
|
-
}, ce = B.current ? !$ : !!
|
|
294
|
-
return s || ce ? /* @__PURE__ */
|
|
291
|
+
re(n);
|
|
292
|
+
}, ce = B.current ? !$ : !!a.current;
|
|
293
|
+
return s || ce ? /* @__PURE__ */ o(
|
|
295
294
|
sn,
|
|
296
295
|
{
|
|
297
296
|
visible: s,
|
|
298
297
|
forceRender: ce,
|
|
299
298
|
getContainer: D,
|
|
300
|
-
children: /* @__PURE__ */
|
|
299
|
+
children: /* @__PURE__ */ E(
|
|
301
300
|
"div",
|
|
302
301
|
{
|
|
303
|
-
ref:
|
|
302
|
+
ref: y,
|
|
304
303
|
className: `${t}-container`,
|
|
305
304
|
children: [
|
|
306
|
-
|
|
305
|
+
h ? /* @__PURE__ */ o(
|
|
307
306
|
me,
|
|
308
307
|
{
|
|
309
308
|
in: s,
|
|
@@ -318,7 +317,7 @@ function xn(l, b) {
|
|
|
318
317
|
onExited: (e) => {
|
|
319
318
|
e && (e.style.display = "none");
|
|
320
319
|
},
|
|
321
|
-
children: /* @__PURE__ */
|
|
320
|
+
children: /* @__PURE__ */ o(
|
|
322
321
|
"div",
|
|
323
322
|
{
|
|
324
323
|
"aria-hidden": !0,
|
|
@@ -328,7 +327,7 @@ function xn(l, b) {
|
|
|
328
327
|
)
|
|
329
328
|
}
|
|
330
329
|
) : null,
|
|
331
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ o(
|
|
332
331
|
"div",
|
|
333
332
|
{
|
|
334
333
|
...dn(_, [
|
|
@@ -350,9 +349,9 @@ function xn(l, b) {
|
|
|
350
349
|
className: fe(
|
|
351
350
|
`${t}-wrapper`,
|
|
352
351
|
{
|
|
353
|
-
[`${t}-wrapper-no-mask`]: !
|
|
352
|
+
[`${t}-wrapper-no-mask`]: !h,
|
|
354
353
|
[`${t}-wrapper-align-center`]: Ne,
|
|
355
|
-
[`${t}-wrapper-rtl`]:
|
|
354
|
+
[`${t}-wrapper-rtl`]: oe
|
|
356
355
|
},
|
|
357
356
|
De
|
|
358
357
|
),
|
|
@@ -367,7 +366,7 @@ function xn(l, b) {
|
|
|
367
366
|
p.current = e.target === e.currentTarget;
|
|
368
367
|
},
|
|
369
368
|
onClick: Se,
|
|
370
|
-
children: /* @__PURE__ */
|
|
369
|
+
children: /* @__PURE__ */ o(
|
|
371
370
|
me,
|
|
372
371
|
{
|
|
373
372
|
in: s,
|
|
@@ -377,16 +376,16 @@ function xn(l, b) {
|
|
|
377
376
|
unmountOnExit: P,
|
|
378
377
|
mountOnEnter: $,
|
|
379
378
|
onEnter: (e) => {
|
|
380
|
-
e && (Q(!0),
|
|
379
|
+
e && (Q(!0), v.current = U, F(e), a.current = e);
|
|
381
380
|
},
|
|
382
381
|
onEntered: (e) => {
|
|
383
|
-
e && (F(e),
|
|
382
|
+
e && (F(e), v.current = null, Te?.());
|
|
384
383
|
},
|
|
385
384
|
onExit: () => {
|
|
386
385
|
L.current = !0;
|
|
387
386
|
},
|
|
388
387
|
onExited: (e) => {
|
|
389
|
-
e && (Q(!1), F(e), we?.(), L.current = !1, P && (
|
|
388
|
+
e && (Q(!1), F(e), we?.(), L.current = !1, P && (a.current = null));
|
|
390
389
|
},
|
|
391
390
|
children: Ge.cloneElement(
|
|
392
391
|
ue(A) ? A(ie) : ie,
|
|
@@ -418,8 +417,8 @@ u.show = (l) => W({ ...l, noticeType: "show" });
|
|
|
418
417
|
u.confirm = (l) => W(l);
|
|
419
418
|
u.useModal = pn;
|
|
420
419
|
["info", "success", "warning", "error"].forEach((l) => {
|
|
421
|
-
u[l] = (
|
|
422
|
-
...
|
|
420
|
+
u[l] = (y) => W({
|
|
421
|
+
...y,
|
|
423
422
|
isNotice: !0,
|
|
424
423
|
noticeType: l
|
|
425
424
|
});
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unicom-cloud/ui","version":"0.8.
|
|
1
|
+
{"name":"@unicom-cloud/ui","version":"0.8.101","dependencies":{"@unicom-cloud/icons":"latest"},"peerDependencies":{"dayjs":"^1.11.10","lodash":"^4.17.21","react":"^18.3.1","react-dom":"^18.3.1"},"peerDependenciesMeta":{},"type":"module","types":"types/pc/index.d.ts","main":"./index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/qr-code/index.js
CHANGED
|
@@ -50,6 +50,7 @@ import "../dist/react-transition-group/src/TransitionGroup.js";
|
|
|
50
50
|
import "@unicom-cloud/utils/file/saveAs";
|
|
51
51
|
import "@unicom-cloud/utils/screenfull";
|
|
52
52
|
import "@unicom-cloud/utils/constant/ui.js";
|
|
53
|
+
import "react-is";
|
|
53
54
|
import "@unicom-cloud/utils/tree";
|
|
54
55
|
import "@unicom-cloud/utils/is";
|
|
55
56
|
import "uuid";
|
|
@@ -64,7 +65,7 @@ const q = {
|
|
|
64
65
|
bgColor: "#ffffff",
|
|
65
66
|
marginSize: 0,
|
|
66
67
|
value: "qr-code"
|
|
67
|
-
},
|
|
68
|
+
}, $o = (e) => {
|
|
68
69
|
const { getPrefixCls: s, componentConfig: n } = Q(h), d = R(
|
|
69
70
|
e,
|
|
70
71
|
q,
|
|
@@ -112,5 +113,5 @@ const q = {
|
|
|
112
113
|
);
|
|
113
114
|
};
|
|
114
115
|
export {
|
|
115
|
-
|
|
116
|
+
$o as default
|
|
116
117
|
};
|