@unicom-cloud/ui 0.8.95 → 0.8.97
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/Affix.js +1 -1
- package/Carousel.js +1 -1
- package/LiquidFill.js +4 -0
- package/Message.js +1 -1
- package/Notification.js +1 -1
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/QrCode.js +57 -0
- package/Switch.js +1 -1
- package/Tour.js +63 -0
- package/Trigger.js +2 -2
- package/_virtual/_commonjsHelpers.js +6 -0
- package/_virtual/index.js +7 -0
- package/_virtual/index2.js +4 -0
- package/affix/index.js +70 -72
- package/alert/index.js +52 -51
- package/anchor/Anchor.js +55 -55
- package/anchor/Link.js +34 -34
- package/anchor/util.js +5 -5
- package/auto-complete/index.js +116 -122
- package/avatar/Avatar.js +33 -33
- package/avatar/Group.js +26 -26
- package/back-top/index.js +58 -61
- package/badge/index.js +46 -46
- package/breadcrumb/Item.js +42 -43
- package/breadcrumb/index.js +47 -47
- package/button/Group.js +6 -6
- package/button/index.js +91 -91
- package/calendar/Month.js +75 -75
- package/calendar/Year.js +35 -35
- package/calendar/header/index.js +25 -25
- package/calendar/index.js +103 -103
- package/card/Grid.js +8 -8
- package/card/Meta.js +16 -16
- package/card/index.js +49 -49
- package/carousel/Arrow.js +19 -19
- package/carousel/Indicator.js +26 -26
- package/carousel/index.js +108 -108
- package/cascader/Cascader.js +178 -191
- package/cascader/base/node.js +133 -136
- package/cascader/base/store.js +82 -85
- package/cascader/panel/List.js +126 -130
- package/cascader/panel/Search.js +79 -81
- package/cascader/util.js +13 -13
- package/checkbox/Checkbox.js +94 -96
- package/checkbox/Group.js +54 -56
- package/checkbox/GroupBlock.js +28 -29
- package/collapse/Collapse.js +45 -45
- package/collapse/Item.js +53 -55
- package/color-picker/ControlBar.js +43 -43
- package/color-picker/InputAlpha.js +12 -12
- package/color-picker/InputHex.js +30 -31
- package/color-picker/InputRgb.js +24 -24
- package/color-picker/Palette.js +18 -18
- package/color-picker/Panel.js +122 -125
- package/color-picker/hooks/useColorPicker.js +85 -88
- package/color-picker/hooks/useControlBlock.js +38 -40
- package/color-picker/index.js +47 -47
- package/comment/index.js +29 -29
- package/components/common/higher-order/with-speech-synthesis/index.js +37 -40
- package/components/common/hooks/useForceUpdate.js +6 -2
- package/components/common/hooks/useId.js +4 -4
- package/components/common/hooks/useInView.js +16 -16
- package/components/common/hooks/useIntersectionObserver.js +1 -1
- package/components/common/hooks/useKeyboardEvent.js +9 -10
- package/components/common/hooks/useOverflowHidden.js +1 -4
- package/components/common/hooks/usePersistCallback.js +7 -7
- package/components/common/hooks/useStateCallback.js +9 -10
- package/components/common/hooks/useWindowSize.js +8 -8
- package/components/common/space/index.js +11 -10
- package/components/common/utils/PqbCSSTransition.js +1 -1
- package/components/common/utils/convertToDurationBasedOnTimeUnits.js +6 -0
- package/components/common/utils/dom.js +27 -29
- package/components/common/utils/findScrollParent.js +17 -0
- package/components/common/utils/intersectionObserver.js +21 -0
- package/components/common/utils/is.js +99 -109
- package/components/common/utils/mutationObserver.js +19 -0
- package/components/common/utils/reactDOM.js +34 -34
- package/components/common/utils/resizeObserver.js +21 -0
- package/copy/index.js +38 -40
- package/date-picker/Picker.js +290 -295
- package/date-picker/RangePicker.js +367 -372
- package/date-picker/index.js +33 -35
- package/date-picker/panel/Body.js +46 -47
- package/date-picker/panel/Header.js +33 -33
- package/date-picker/panel/Shortcut.js +31 -31
- package/date-picker/panel/date/index.js +85 -85
- package/date-picker/panel/month/index.js +59 -59
- package/date-picker/panel/quarter/index.js +67 -70
- package/date-picker/panel/range/index.js +101 -101
- package/date-picker/panel/year/index.js +39 -39
- package/date-picker/util.js +17 -18
- package/descriptions/index.js +62 -62
- package/details/index.js +55 -56
- package/development/index.js +9 -9
- package/dist/react-transition-group/src/CSSTransition.js +1 -1
- package/dist/react-transition-group/src/SwitchTransition.js +1 -1
- package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
- package/dist/tween/src/tween.js +24 -25
- package/dist/validate/src/index.js +5 -5
- package/dist/validate/src/util.js +1 -1
- package/divider/index.js +21 -21
- package/draggable/Item.js +35 -35
- package/draggable/index.js +22 -22
- package/drawer/Drawer.js +142 -147
- package/dropdown/Button.js +48 -48
- package/dropdown/index.js +88 -92
- package/empty/index.js +16 -16
- package/form/Control.js +211 -225
- package/form/Form.js +109 -113
- package/form/FormItem.js +118 -120
- package/form/FormList.js +60 -66
- package/form/FormProvider.js +31 -34
- package/form/hook/useContext.js +17 -19
- package/form/hook/useState.js +22 -23
- package/form/hook/useWatch.js +26 -27
- package/form/promisify.js +14 -18
- package/form/store.js +304 -316
- package/form/util.js +14 -15
- package/grid/Col.js +64 -64
- package/grid/Grid.js +51 -51
- package/grid/GridItem.js +48 -48
- package/grid/Row.js +39 -39
- package/hooks/index.js +50 -52
- package/hooks/useVerificationCode.js +41 -43
- package/hooks/useWatermark.js +89 -92
- package/icon/index.js +23 -24
- package/icon-hover/index.js +16 -16
- package/icons/file.js +11 -11
- package/image/Image.js +140 -141
- package/image/ImagePreview.js +252 -255
- package/image/ImagePreviewArrow.js +25 -25
- package/image/ImagePreviewGroup.js +62 -62
- package/image/util/getScale.js +25 -28
- package/index.js +682 -679
- package/input/Button.js +48 -50
- package/input/Group.js +9 -9
- package/input/Input.js +145 -154
- package/input/InputElement.js +108 -115
- package/input/Password.js +38 -38
- package/input/Search.js +51 -55
- package/input/Textarea.js +80 -81
- package/input/useComposition.js +23 -23
- package/input-number/decimal.js +59 -62
- package/input-number/index.js +139 -141
- package/input-tag/InputTag.js +223 -231
- package/layout/Content.js +6 -6
- package/layout/Footer.js +8 -8
- package/layout/Header.js +7 -7
- package/layout/Sider.js +88 -90
- package/layout/index.js +30 -30
- package/link/index.js +45 -46
- package/liquid-fill/LiquidFill.js +189 -0
- package/liquid-fill/LiquidFill2.js +3 -0
- package/liquid-fill/index.js +4 -0
- package/liquid-fill/interface.js +1 -0
- package/list/Item.js +28 -28
- package/list/Meta.js +12 -12
- package/list/index.js +146 -148
- package/mentions/index.js +75 -76
- package/menu/Item.js +58 -58
- package/menu/Menu.js +125 -127
- package/menu/OverflowWrap.js +39 -40
- package/menu/sub-menu/Inline.js +45 -45
- package/menu/util.js +26 -28
- package/message/index.js +97 -100
- package/message/useMessage.js +26 -27
- package/modal/Confirm.js +47 -49
- package/modal/Modal.js +250 -257
- package/modal/use-modal/Hook.js +26 -28
- package/modal/use-modal/index.js +46 -49
- package/notice/index.js +89 -90
- package/notification/index.js +61 -66
- package/notification/withNotification.js +35 -35
- package/overflow-ellipsis/OverflowItem.js +19 -20
- package/overflow-ellipsis/index.js +45 -46
- package/package.json +1 -1
- package/page-header/index.js +45 -45
- package/pagination/PageItem.js +87 -91
- package/pagination/PageJumper.js +40 -41
- package/pagination/PageOption.js +31 -35
- package/pagination/Pagination.js +162 -163
- package/picker/Input.js +90 -96
- package/picker/InputRange.js +115 -122
- package/popconfirm/index.js +98 -100
- package/popover/index.js +28 -28
- package/portal/Portal.js +10 -11
- package/progress/index.js +36 -36
- package/qr-code/index.js +99 -0
- package/qr-code/interface.js +1 -0
- package/radio/Group.js +48 -48
- package/radio/GroupBlock.js +32 -33
- package/radio/Radio.js +62 -64
- package/rate/index.js +88 -88
- package/resize-box/ResizeTrigger.js +39 -39
- package/resize-box/Split.js +92 -96
- package/resize-box/SplitGroup.js +116 -122
- package/resize-box/index.js +112 -115
- package/result/index.js +44 -44
- package/select/Option.js +53 -56
- package/select/Select.js +365 -381
- package/select/util.js +95 -99
- package/select-view/Core.js +159 -160
- package/skeleton/index.js +23 -23
- package/slider/Button.js +84 -92
- package/slider/Input.js +47 -49
- package/slider/Tick.js +28 -31
- package/slider/index.js +108 -108
- package/slider/util.js +1 -1
- package/space/index.js +26 -26
- package/space-/index.js +51 -51
- package/spin/DotLoading.js +8 -8
- package/spin/index.js +47 -47
- package/statistic/Countdown.js +37 -37
- package/statistic/index.js +61 -61
- package/steps/Step.js +42 -42
- package/steps/index.js +54 -54
- package/style.css +1 -1
- package/switch/index.js +78 -79
- package/table/ColGroup.js +36 -37
- package/table/Table.js +447 -450
- package/table/hook/useExpand.js +24 -24
- package/table/hook/useRowSelection.js +62 -62
- package/table/summary/Row.js +16 -17
- package/table/tbody/Td.js +119 -118
- package/table/tbody/Tr.js +119 -121
- package/table/tbody/index.js +62 -63
- package/table/th-resizable/index.js +30 -30
- package/table/thead/Column.js +148 -148
- package/table/thead/index.js +87 -88
- package/tabs/Tab.js +55 -55
- package/tabs/TabContent.js +8 -8
- package/tabs/TabPane.js +15 -15
- package/tabs/hook/useHeaderScroll.js +36 -36
- package/tabs/tab-header/TabInk.js +31 -33
- package/tabs/tab-header/TabNavIcon.js +34 -35
- package/tabs/tab-header/index.js +192 -195
- package/tag/index.js +94 -97
- package/time-picker/Picker.js +167 -172
- package/time-picker/RangePicker.js +28 -28
- package/time-picker/TimePicker.js +146 -146
- package/time-picker/util.js +4 -4
- package/timeline/Item.js +46 -46
- package/timeline/Timeline.js +52 -52
- package/tooltip/index.js +89 -95
- package/tour/index.js +289 -0
- package/transfer/Item.js +54 -54
- package/transfer/List.js +134 -136
- package/transfer/index.js +91 -91
- package/tree/Animation.js +49 -52
- package/tree/Node.js +114 -122
- package/tree/NodeList.js +51 -51
- package/tree/Tree.js +386 -393
- package/tree-select/List.js +71 -72
- package/tree-select/Select.js +135 -143
- package/tree-select/hook/useKeyCache.js +39 -39
- package/tree-select/hook/useStateValue.js +12 -12
- package/trigger/getPopupStyle.js +60 -61
- package/trigger/index.js +338 -347
- package/types/common/space/interface.d.ts +1 -1
- package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
- package/types/common/utils/findScrollParent.d.ts +2 -0
- package/types/common/utils/index.d.ts +5 -0
- package/types/common/utils/intersectionObserver.d.ts +2 -0
- package/types/common/utils/math.d.ts +1 -1
- package/types/common/utils/mutationObserver.d.ts +2 -0
- package/types/common/utils/resizeObserver.d.ts +2 -0
- package/types/pc/alert/interface.d.ts +2 -2
- package/types/pc/details/interface.d.ts +2 -2
- package/types/pc/hooks/index.d.ts +0 -1
- package/types/pc/index.d.ts +3 -0
- package/types/pc/liquid-fill/LiquidFill.d.ts +30 -0
- package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
- package/types/pc/liquid-fill/index.d.ts +4 -0
- package/types/pc/liquid-fill/interface.d.ts +0 -0
- package/types/pc/qr-code/index.d.ts +34 -0
- package/types/pc/qr-code/interface.d.ts +39 -0
- package/types/pc/table/interface.d.ts +2 -2
- package/types/pc/tour/index.d.ts +42 -0
- package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
- package/types/pc/utils/findScrollParent.d.ts +2 -0
- package/types/pc/utils/index.d.ts +5 -0
- package/types/pc/utils/intersectionObserver.d.ts +2 -0
- package/types/pc/utils/math.d.ts +1 -1
- package/types/pc/utils/mutationObserver.d.ts +2 -0
- package/types/pc/utils/names.d.ts +18 -0
- package/types/pc/utils/resizeObserver.d.ts +2 -0
- package/typography/Base.js +79 -81
- package/typography/EditContent.js +30 -33
- package/typography/Ellipsis.js +78 -75
- package/typography/Operations.js +50 -52
- package/typography/Paragraph.js +7 -7
- package/typography/Typography.js +7 -7
- package/typography/useEllipsis.js +105 -106
- package/upload/TriggerNode.js +69 -76
- package/upload/Upload.js +84 -87
- package/upload/Uploader.js +115 -118
- package/upload/list/PictureItem.js +61 -71
- package/upload/list/TextItem.js +61 -67
- package/upload/list/UploadProgress.js +42 -49
- package/upload/list/index.js +49 -50
- package/upload/request_.js +37 -38
- package/upload/util.js +39 -39
- package/utils/convertToDurationBasedOnTimeUnits.js +6 -0
- package/utils/findScrollParent.js +4 -0
- package/utils/index.js +274 -275
- package/utils/intersectionObserver.js +4 -0
- package/utils/math.js +7 -11
- package/utils/mutationObserver.js +4 -0
- package/utils/names.js +12 -0
- package/utils/reactTransitionGroup.js +1 -1
- package/utils/resizeObserver.js +4 -0
- package/verification-code/VerificationCode.js +50 -51
- package/version/index.js +1 -1
- package/virtual-list/VirtualList.js +243 -244
- package/virtual-list/util/item.js +3 -4
- package/watermark/Watermark.js +27 -31
- package/components/common/hooks/useComputedState.js +0 -11
- package/components/common/utils/resizeObserverEffect.js +0 -23
- package/hooks/useComputedState.js +0 -4
- package/types/common/hooks/useComputedState.d.ts +0 -4
- package/types/common/utils/resizeObserverEffect.d.ts +0 -2
- package/types/pc/hooks/useComputedState.d.ts +0 -1
- package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
- package/utils/resizeObserverEffect.js +0 -4
- /package/dist/react-transition-group/chunk/{C6QwjD4L.js → CPfP7aNL.js} +0 -0
package/modal/use-modal/Hook.js
CHANGED
|
@@ -1,52 +1,50 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
function
|
|
5
|
-
const [
|
|
6
|
-
|
|
7
|
-
update: (
|
|
8
|
-
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d, useState as i, useImperativeHandle as p } from "react";
|
|
3
|
+
import g from "../Modal.js";
|
|
4
|
+
function k(s, f) {
|
|
5
|
+
const [a, e] = i(!0), [n, t] = i(s);
|
|
6
|
+
p(f, () => ({
|
|
7
|
+
update: (o) => {
|
|
8
|
+
t(o);
|
|
9
9
|
},
|
|
10
10
|
close: () => {
|
|
11
|
-
|
|
11
|
+
e(!1);
|
|
12
12
|
}
|
|
13
13
|
}));
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
e && e.then && (n((r) => ({
|
|
14
|
+
function l() {
|
|
15
|
+
const o = n.onOk?.();
|
|
16
|
+
o && o.then && (t((r) => ({
|
|
18
17
|
...r,
|
|
19
18
|
confirmLoading: !0
|
|
20
|
-
})),
|
|
19
|
+
})), o.then(
|
|
21
20
|
() => {
|
|
22
|
-
|
|
21
|
+
e(!1);
|
|
23
22
|
},
|
|
24
23
|
(r) => {
|
|
25
|
-
console.error(r),
|
|
26
|
-
...
|
|
24
|
+
console.error(r), t((u) => ({
|
|
25
|
+
...u,
|
|
27
26
|
confirmLoading: !1
|
|
28
27
|
}));
|
|
29
28
|
}
|
|
30
|
-
)),
|
|
29
|
+
)), o || e(!1);
|
|
31
30
|
}
|
|
32
31
|
function c() {
|
|
33
|
-
|
|
34
|
-
(e = o.onCancel) == null || e.call(o), t(!1);
|
|
32
|
+
n.onCancel?.(), e(!1);
|
|
35
33
|
}
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
34
|
+
return /* @__PURE__ */ m(
|
|
35
|
+
g,
|
|
38
36
|
{
|
|
39
37
|
unmountOnExit: !0,
|
|
40
38
|
simple: !0,
|
|
41
|
-
...
|
|
42
|
-
visible:
|
|
43
|
-
onOk:
|
|
39
|
+
...n,
|
|
40
|
+
visible: a,
|
|
41
|
+
onOk: l,
|
|
44
42
|
onCancel: c,
|
|
45
|
-
children:
|
|
43
|
+
children: n.content
|
|
46
44
|
}
|
|
47
45
|
);
|
|
48
46
|
}
|
|
49
|
-
const
|
|
47
|
+
const H = d(k);
|
|
50
48
|
export {
|
|
51
|
-
|
|
49
|
+
H as default
|
|
52
50
|
};
|
package/modal/use-modal/index.js
CHANGED
|
@@ -1,68 +1,65 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { normalizeConfig as
|
|
4
|
-
import { destroyList as
|
|
5
|
-
import { ContextHolderElement as
|
|
6
|
-
import
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
let
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var r;
|
|
16
|
-
(r = e.afterClose) == null || r.call(e), h();
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as x } from "react";
|
|
3
|
+
import { normalizeConfig as m } from "../Confirm.js";
|
|
4
|
+
import { destroyList as M } from "../config.js";
|
|
5
|
+
import { ContextHolderElement as w } from "../../utils/contextHolder.js";
|
|
6
|
+
import E from "./Hook.js";
|
|
7
|
+
function j() {
|
|
8
|
+
const r = x(), d = /* @__PURE__ */ l(w, { ref: r });
|
|
9
|
+
let c = 0;
|
|
10
|
+
function u(o) {
|
|
11
|
+
c += 1;
|
|
12
|
+
let e, t = { ...o };
|
|
13
|
+
function p() {
|
|
14
|
+
o.afterClose?.(), C();
|
|
17
15
|
}
|
|
18
|
-
const
|
|
19
|
-
|
|
16
|
+
const i = /* @__PURE__ */ l(
|
|
17
|
+
E,
|
|
20
18
|
{
|
|
21
|
-
ref: (
|
|
22
|
-
|
|
19
|
+
ref: (n) => {
|
|
20
|
+
e = n;
|
|
23
21
|
},
|
|
24
|
-
...
|
|
25
|
-
afterClose:
|
|
22
|
+
...m({ ...o }),
|
|
23
|
+
afterClose: p
|
|
26
24
|
},
|
|
27
|
-
|
|
25
|
+
c
|
|
28
26
|
);
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
(r = t.current) == null || r.removeInstance(a);
|
|
27
|
+
r.current?.addInstance(i);
|
|
28
|
+
function C() {
|
|
29
|
+
r.current?.removeInstance(i);
|
|
33
30
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
31
|
+
function a() {
|
|
32
|
+
e?.close();
|
|
36
33
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
...
|
|
40
|
-
...
|
|
41
|
-
},
|
|
34
|
+
function h(n) {
|
|
35
|
+
t = {
|
|
36
|
+
...t,
|
|
37
|
+
...n
|
|
38
|
+
}, e?.update(m({ ...t }));
|
|
42
39
|
}
|
|
43
|
-
return
|
|
44
|
-
close:
|
|
45
|
-
update:
|
|
40
|
+
return M.push(a), {
|
|
41
|
+
close: a,
|
|
42
|
+
update: h
|
|
46
43
|
};
|
|
47
44
|
}
|
|
48
|
-
function
|
|
49
|
-
return
|
|
50
|
-
...
|
|
45
|
+
function f(o) {
|
|
46
|
+
return u({
|
|
47
|
+
...o
|
|
51
48
|
});
|
|
52
49
|
}
|
|
53
|
-
const
|
|
54
|
-
confirm:
|
|
55
|
-
show:
|
|
50
|
+
const s = {
|
|
51
|
+
confirm: f,
|
|
52
|
+
show: f
|
|
56
53
|
// 潘启宝添加于 2023年10月18日 星期三 10时31分58秒 CST
|
|
57
54
|
};
|
|
58
|
-
return ["info", "success", "warning", "error"].forEach((
|
|
59
|
-
|
|
60
|
-
...
|
|
55
|
+
return ["info", "success", "warning", "error"].forEach((o) => {
|
|
56
|
+
s[o] = (e) => u({
|
|
57
|
+
...e,
|
|
61
58
|
isNotice: !0,
|
|
62
|
-
noticeType:
|
|
59
|
+
noticeType: o
|
|
63
60
|
});
|
|
64
|
-
}), [
|
|
61
|
+
}), [s, d];
|
|
65
62
|
}
|
|
66
63
|
export {
|
|
67
|
-
|
|
64
|
+
j as default
|
|
68
65
|
};
|
package/notice/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as N, Fragment as F, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import M from "@unicom-cloud/icons/context";
|
|
3
3
|
import Z from "@unicom-cloud/icons/IconUiCheckCircleFill";
|
|
4
|
-
import
|
|
4
|
+
import R from "@unicom-cloud/icons/IconUiClose";
|
|
5
5
|
import ee from "@unicom-cloud/icons/IconUiCloseCircleFill";
|
|
6
6
|
import oe from "@unicom-cloud/icons/IconUiExclamationCircleFill";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { forwardRef as ie, useContext as
|
|
7
|
+
import ne from "@unicom-cloud/icons/IconUiInfoCircleFill";
|
|
8
|
+
import re from "@unicom-cloud/icons/IconUiLoading";
|
|
9
|
+
import { forwardRef as ie, useContext as E, useRef as f, useImperativeHandle as te, useEffect as j } from "react";
|
|
10
10
|
import ce from "../config-provider/ConfigProvider.js";
|
|
11
|
-
import
|
|
11
|
+
import D from "../config-provider/context.js";
|
|
12
12
|
import "lodash/isEqualWith";
|
|
13
13
|
import "../components/common/utils/is.js";
|
|
14
14
|
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
@@ -20,7 +20,7 @@ import se from "../components/common/hooks/useMergeProps.js";
|
|
|
20
20
|
import "../components/common/utils/reactDOM.js";
|
|
21
21
|
import "@unicom-cloud/utils/constant";
|
|
22
22
|
import "lodash/debounce";
|
|
23
|
-
import
|
|
23
|
+
import H from "../icon-hover/index.js";
|
|
24
24
|
import le from "@unicom-cloud/utils/class-name";
|
|
25
25
|
const ae = {
|
|
26
26
|
type: "info",
|
|
@@ -28,150 +28,149 @@ const ae = {
|
|
|
28
28
|
noticeType: "message",
|
|
29
29
|
duration: 3e3
|
|
30
30
|
};
|
|
31
|
-
function me(
|
|
31
|
+
function me(L, O) {
|
|
32
32
|
const {
|
|
33
|
-
getPrefixCls:
|
|
34
|
-
componentConfig:
|
|
33
|
+
getPrefixCls: _,
|
|
34
|
+
componentConfig: q,
|
|
35
35
|
rtl: z
|
|
36
|
-
} = D
|
|
37
|
-
|
|
36
|
+
} = E(D), n = se(
|
|
37
|
+
L,
|
|
38
38
|
ae,
|
|
39
|
-
|
|
40
|
-
), A = D
|
|
39
|
+
q?.Notice
|
|
40
|
+
), A = E(D), B = _?.("notice");
|
|
41
41
|
f();
|
|
42
|
-
const
|
|
43
|
-
title:
|
|
44
|
-
content:
|
|
42
|
+
const s = f(), v = f(), $ = f(), {
|
|
43
|
+
title: I,
|
|
44
|
+
content: b,
|
|
45
45
|
showIcon: G,
|
|
46
46
|
className: J,
|
|
47
47
|
style: K,
|
|
48
|
-
type:
|
|
49
|
-
btn:
|
|
48
|
+
type: g,
|
|
49
|
+
btn: w,
|
|
50
50
|
icon: Q,
|
|
51
51
|
prefixCls: o,
|
|
52
|
-
closable:
|
|
53
|
-
noticeType:
|
|
54
|
-
iconPrefix:
|
|
52
|
+
closable: p,
|
|
53
|
+
noticeType: d,
|
|
54
|
+
iconPrefix: P,
|
|
55
55
|
rtl: S = z,
|
|
56
|
-
closeIcon:
|
|
57
|
-
classPrefixCls:
|
|
58
|
-
} =
|
|
56
|
+
closeIcon: l,
|
|
57
|
+
classPrefixCls: k
|
|
58
|
+
} = n, V = le(
|
|
59
59
|
o,
|
|
60
|
-
`${o}-${
|
|
60
|
+
`${o}-${g}`,
|
|
61
61
|
{
|
|
62
|
-
[`${o}-closable`]:
|
|
62
|
+
[`${o}-closable`]: p,
|
|
63
63
|
[`${o}-rtl`]: S
|
|
64
64
|
},
|
|
65
65
|
J
|
|
66
66
|
);
|
|
67
|
-
let
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
67
|
+
let u = "closable" in n ? p : !0, C = G;
|
|
68
|
+
g === "normal" && !Q && (C = !1);
|
|
69
|
+
const y = { ...A };
|
|
70
|
+
k && (y.prefixCls = k);
|
|
71
71
|
function W() {
|
|
72
|
-
return
|
|
72
|
+
return v.current;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const { duration:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
74
|
+
function h() {
|
|
75
|
+
const { duration: i, onClose: m, id: x } = n;
|
|
76
|
+
i !== 0 && (s.current = window.setTimeout(() => {
|
|
77
|
+
m?.(x), c();
|
|
78
|
+
}, i));
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
|
|
80
|
+
function c() {
|
|
81
|
+
s.current && (window.clearTimeout(s.current), s.current = null);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
|
|
85
|
-
(n = r.onClose) == null || n.call(r, r.id);
|
|
83
|
+
function a() {
|
|
84
|
+
n.onClose?.(n.id);
|
|
86
85
|
}
|
|
87
|
-
function
|
|
88
|
-
const { showIcon:
|
|
89
|
-
let
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
else if (
|
|
93
|
-
switch (
|
|
86
|
+
function T() {
|
|
87
|
+
const { showIcon: i, icon: m, type: x, iconPrefix: U } = n;
|
|
88
|
+
let r;
|
|
89
|
+
if (m)
|
|
90
|
+
r = m;
|
|
91
|
+
else if (i) {
|
|
92
|
+
switch (x) {
|
|
94
93
|
case "info":
|
|
95
|
-
|
|
94
|
+
r = /* @__PURE__ */ e(ne, {});
|
|
96
95
|
break;
|
|
97
96
|
case "success":
|
|
98
|
-
|
|
97
|
+
r = /* @__PURE__ */ e(Z, {});
|
|
99
98
|
break;
|
|
100
99
|
case "error":
|
|
101
|
-
|
|
100
|
+
r = /* @__PURE__ */ e(ee, {});
|
|
102
101
|
break;
|
|
103
102
|
case "warning":
|
|
104
|
-
|
|
103
|
+
r = /* @__PURE__ */ e(oe, {});
|
|
105
104
|
break;
|
|
106
105
|
case "loading":
|
|
107
|
-
|
|
106
|
+
r = /* @__PURE__ */ e(re, {});
|
|
108
107
|
break;
|
|
109
108
|
}
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
r = /* @__PURE__ */ e(
|
|
110
|
+
M.Provider,
|
|
112
111
|
{
|
|
113
|
-
value:
|
|
114
|
-
children:
|
|
112
|
+
value: U ? { prefixCls: U } : {},
|
|
113
|
+
children: r
|
|
115
114
|
}
|
|
116
115
|
);
|
|
117
116
|
}
|
|
118
|
-
return /* @__PURE__ */ e("span", { className: `${o}-icon`, children:
|
|
117
|
+
return /* @__PURE__ */ e("span", { className: `${o}-icon`, children: r });
|
|
119
118
|
}
|
|
120
119
|
function X() {
|
|
121
|
-
|
|
120
|
+
c();
|
|
122
121
|
}
|
|
123
122
|
function Y() {
|
|
124
|
-
|
|
123
|
+
c(), h();
|
|
125
124
|
}
|
|
126
|
-
te(
|
|
125
|
+
te(O, () => ({
|
|
127
126
|
getRootDOMNode: W
|
|
128
|
-
}), []),
|
|
129
|
-
const
|
|
130
|
-
return (
|
|
127
|
+
}), []), j(() => {
|
|
128
|
+
const i = $.current;
|
|
129
|
+
return (i && i?.duration !== n.duration || n.update) && (c(), h()), $.current = n, () => {
|
|
131
130
|
};
|
|
132
|
-
}, [
|
|
133
|
-
|
|
131
|
+
}, [n.duration, n.update]), j(() => (h(), () => {
|
|
132
|
+
c();
|
|
134
133
|
}), []);
|
|
135
134
|
let t;
|
|
136
|
-
return
|
|
137
|
-
|
|
138
|
-
/* @__PURE__ */ e("span", { className: `${o}-content`, children:
|
|
139
|
-
|
|
140
|
-
|
|
135
|
+
return d === "message" && (u = p, t = /* @__PURE__ */ N(F, { children: [
|
|
136
|
+
C && T(),
|
|
137
|
+
/* @__PURE__ */ e("span", { className: `${o}-content`, children: b }),
|
|
138
|
+
u && (l !== void 0 ? /* @__PURE__ */ e("span", { onClick: a, className: `${o}-close-btn`, children: l }) : /* @__PURE__ */ e(
|
|
139
|
+
H,
|
|
141
140
|
{
|
|
142
141
|
prefix: o,
|
|
143
142
|
className: `${o}-close-btn`,
|
|
144
|
-
onClick:
|
|
145
|
-
children: /* @__PURE__ */ e(
|
|
143
|
+
onClick: a,
|
|
144
|
+
children: /* @__PURE__ */ e(R, {})
|
|
146
145
|
}
|
|
147
146
|
))
|
|
148
|
-
] })),
|
|
149
|
-
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
|
|
152
|
-
/* @__PURE__ */ e("div", { className: `${o}-content`, children:
|
|
153
|
-
|
|
147
|
+
] })), d === "notification" && (t = /* @__PURE__ */ N(F, { children: [
|
|
148
|
+
C && /* @__PURE__ */ e("div", { className: `${o}-left`, children: T() }),
|
|
149
|
+
/* @__PURE__ */ N("div", { className: `${o}-right`, children: [
|
|
150
|
+
I && /* @__PURE__ */ e("div", { className: `${o}-title`, children: I }),
|
|
151
|
+
/* @__PURE__ */ e("div", { className: `${o}-content`, children: b }),
|
|
152
|
+
w && /* @__PURE__ */ e("div", { className: `${o}-btn-wrapper`, children: w })
|
|
154
153
|
] }),
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
u && (l !== void 0 ? /* @__PURE__ */ e("span", { onClick: a, className: `${o}-close-btn`, children: l }) : /* @__PURE__ */ e(
|
|
155
|
+
H,
|
|
157
156
|
{
|
|
158
157
|
prefix: o,
|
|
159
158
|
className: `${o}-close-btn`,
|
|
160
|
-
onClick:
|
|
159
|
+
onClick: a,
|
|
161
160
|
children: /* @__PURE__ */ e(
|
|
162
|
-
|
|
161
|
+
M.Provider,
|
|
163
162
|
{
|
|
164
|
-
value:
|
|
165
|
-
children: /* @__PURE__ */ e(
|
|
163
|
+
value: P ? { prefixCls: P } : {},
|
|
164
|
+
children: /* @__PURE__ */ e(R, {})
|
|
166
165
|
}
|
|
167
166
|
)
|
|
168
167
|
}
|
|
169
168
|
))
|
|
170
|
-
] })), t && (t = /* @__PURE__ */ e(ce, { ...
|
|
169
|
+
] })), t && (t = /* @__PURE__ */ e(ce, { ...y, childrenName: "notice", children: /* @__PURE__ */ e(
|
|
171
170
|
"div",
|
|
172
171
|
{
|
|
173
|
-
ref:
|
|
174
|
-
className: `${B}-${
|
|
172
|
+
ref: v,
|
|
173
|
+
className: `${B}-${d}`,
|
|
175
174
|
onMouseEnter: X,
|
|
176
175
|
onMouseLeave: Y,
|
|
177
176
|
children: /* @__PURE__ */ e("div", { className: V, style: K, role: "alert", children: t })
|
package/notification/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import "../dist/react-transition-group/src/CSSTransition.js";
|
|
3
3
|
import "../dist/react-transition-group/src/ReplaceTransition.js";
|
|
4
4
|
import "../dist/react-transition-group/src/SwitchTransition.js";
|
|
5
|
-
import "../dist/react-transition-group/chunk/
|
|
5
|
+
import "../dist/react-transition-group/chunk/CPfP7aNL.js";
|
|
6
6
|
import L from "../dist/react-transition-group/src/TransitionGroup.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import v from "lodash/isNumber";
|
|
8
|
+
import b from "lodash/isUndefined";
|
|
9
9
|
import { useEffect as R } from "react";
|
|
10
10
|
import { createPortal as T } from "react-dom";
|
|
11
11
|
import { createRoot as _ } from "react-dom/client";
|
|
@@ -22,32 +22,32 @@ const Q = [
|
|
|
22
22
|
"loading",
|
|
23
23
|
"normal"
|
|
24
24
|
];
|
|
25
|
-
let a = {},
|
|
26
|
-
function
|
|
27
|
-
return
|
|
25
|
+
let a = {}, h = [], y, E, $, g, d;
|
|
26
|
+
function w(t, e) {
|
|
27
|
+
return b(t) && (t = e || d ? "topLeft" : "topRight"), t;
|
|
28
28
|
}
|
|
29
29
|
function U(t) {
|
|
30
|
-
const { prefixCls: e, rtl:
|
|
30
|
+
const { prefixCls: e, rtl: o, getContainer: u, notices: r } = t, c = b(o) ? d : o, n = w(t.position, c), l = e || E, p = l ? `${l}-notification` : "pqb-notification";
|
|
31
31
|
let C;
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
`${
|
|
35
|
-
`${
|
|
36
|
-
{ [`${
|
|
37
|
-
),
|
|
38
|
-
function
|
|
39
|
-
const i =
|
|
32
|
+
n === "topLeft" || n === "bottomLeft" ? C = "slideNoticeLeft" : C = "slideNoticeRight";
|
|
33
|
+
const P = S(
|
|
34
|
+
`${p}-wrapper`,
|
|
35
|
+
`${p}-wrapper-${n}`,
|
|
36
|
+
{ [`${p}-wrapper-rtl`]: d }
|
|
37
|
+
), x = u?.();
|
|
38
|
+
function j(s) {
|
|
39
|
+
const i = r.find((I) => I.id === s);
|
|
40
40
|
i && t.update({
|
|
41
41
|
...i,
|
|
42
42
|
style: { ...i.style, opacity: 0 }
|
|
43
43
|
}), setTimeout(() => {
|
|
44
|
-
t.remove(
|
|
44
|
+
t.remove(s);
|
|
45
45
|
}, 200);
|
|
46
46
|
}
|
|
47
47
|
R(() => (t.add(t), () => {
|
|
48
48
|
t.clear();
|
|
49
49
|
}), []);
|
|
50
|
-
const
|
|
50
|
+
const N = /* @__PURE__ */ m("div", { className: P, children: /* @__PURE__ */ m(L, { component: null, children: r.map((s) => /* @__PURE__ */ m(
|
|
51
51
|
q,
|
|
52
52
|
{
|
|
53
53
|
timeout: {
|
|
@@ -62,73 +62,68 @@ function U(t) {
|
|
|
62
62
|
i && (i.style.height = 0);
|
|
63
63
|
},
|
|
64
64
|
onExited: (i) => {
|
|
65
|
-
|
|
66
|
-
i && (i.style.height = 0, (p = m.onClose) == null || p.call(m));
|
|
65
|
+
i && (i.style.height = 0, s.onClose?.());
|
|
67
66
|
},
|
|
68
|
-
children: /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ m(
|
|
69
68
|
O,
|
|
70
69
|
{
|
|
71
|
-
...
|
|
72
|
-
onClose:
|
|
73
|
-
prefixCls:
|
|
74
|
-
iconPrefix:
|
|
75
|
-
classPrefixCls:
|
|
70
|
+
...s,
|
|
71
|
+
onClose: j,
|
|
72
|
+
prefixCls: p,
|
|
73
|
+
iconPrefix: l,
|
|
74
|
+
classPrefixCls: l,
|
|
76
75
|
noticeType: "notification",
|
|
77
|
-
rtl:
|
|
76
|
+
rtl: c
|
|
78
77
|
}
|
|
79
78
|
)
|
|
80
79
|
},
|
|
81
|
-
|
|
80
|
+
s.id
|
|
82
81
|
)) }) });
|
|
83
|
-
return
|
|
82
|
+
return x ? T(N, x) : N;
|
|
84
83
|
}
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
(r) => {
|
|
91
|
-
var o;
|
|
92
|
-
return (o = r == null ? void 0 : r.clear) == null ? void 0 : o.call(r);
|
|
93
|
-
}
|
|
84
|
+
const f = H(U);
|
|
85
|
+
f.useNotification = k;
|
|
86
|
+
f.config = (t = {}) => {
|
|
87
|
+
v(t.maxCount) && (y = t.maxCount), t.prefixCls && (E = t.prefixCls), v(t.duration) && ($ = t.duration), typeof t.rtl == "boolean" && (d = t.rtl), t.getContainer && t.getContainer?.() !== g && (g = t.getContainer(), Object.values(a).forEach(
|
|
88
|
+
(e) => e?.clear?.()
|
|
94
89
|
), a = {});
|
|
95
90
|
};
|
|
96
|
-
|
|
91
|
+
f.clear = () => {
|
|
97
92
|
Object.values(a).forEach((t) => {
|
|
98
|
-
t
|
|
93
|
+
t?.clear();
|
|
99
94
|
});
|
|
100
95
|
};
|
|
101
|
-
|
|
96
|
+
f.remove = (t) => {
|
|
102
97
|
Object.values(a).forEach((e) => {
|
|
103
|
-
e
|
|
98
|
+
e?.remove(t);
|
|
104
99
|
});
|
|
105
100
|
};
|
|
106
|
-
|
|
107
|
-
const e =
|
|
108
|
-
duration:
|
|
101
|
+
f.addInstance = (t) => {
|
|
102
|
+
const e = w(t.position, d), o = a[e], u = {
|
|
103
|
+
duration: $,
|
|
109
104
|
...t
|
|
110
105
|
};
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
(
|
|
114
|
-
),
|
|
115
|
-
...
|
|
116
|
-
update:
|
|
106
|
+
if (o) {
|
|
107
|
+
const r = o.notices.find(
|
|
108
|
+
(n) => n.id === t.id
|
|
109
|
+
), c = {
|
|
110
|
+
...u,
|
|
111
|
+
update: r
|
|
117
112
|
};
|
|
118
|
-
|
|
113
|
+
o.notices.length >= y && (r ? c.id = r.id : o.shift()), o.add({ ...c });
|
|
119
114
|
}
|
|
120
|
-
if (
|
|
121
|
-
const
|
|
122
|
-
(g || document.body).appendChild(
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
115
|
+
if (o === null && h.push(t), o === void 0) {
|
|
116
|
+
const r = document.createElement("div");
|
|
117
|
+
(g || document.body).appendChild(r), _(r).render(
|
|
118
|
+
/* @__PURE__ */ m(
|
|
119
|
+
f,
|
|
125
120
|
{
|
|
126
|
-
...
|
|
127
|
-
ref: (
|
|
128
|
-
if (
|
|
129
|
-
for (let
|
|
130
|
-
|
|
131
|
-
|
|
121
|
+
...u,
|
|
122
|
+
ref: (n) => {
|
|
123
|
+
if (n) {
|
|
124
|
+
for (let l = 0; l < h.length; l++)
|
|
125
|
+
n.add(h[l]);
|
|
126
|
+
h = [], a[e] = n;
|
|
132
127
|
}
|
|
133
128
|
}
|
|
134
129
|
}
|
|
@@ -138,14 +133,14 @@ c.addInstance = (t) => {
|
|
|
138
133
|
return a[e];
|
|
139
134
|
};
|
|
140
135
|
Q.forEach((t) => {
|
|
141
|
-
|
|
136
|
+
f[t] = (e) => f.addInstance({
|
|
142
137
|
...e,
|
|
143
138
|
type: t
|
|
144
139
|
});
|
|
145
140
|
});
|
|
146
141
|
export {
|
|
147
|
-
|
|
148
|
-
|
|
142
|
+
f as default,
|
|
143
|
+
w as getPosition,
|
|
149
144
|
Q as notificationTypes,
|
|
150
145
|
k as useNotification
|
|
151
146
|
};
|