@unicom-cloud/ui 0.8.96 → 0.8.98
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/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/QrCode.js +57 -0
- package/Tour.js +63 -0
- package/Trigger.js +1 -1
- 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 +56 -56
- 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 +125 -129
- 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/useId.js +8 -8
- 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 +9 -7
- 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 +53 -55
- package/development/index.js +9 -9
- package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
- 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/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 +684 -675
- 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 +222 -230
- 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 +226 -0
- package/liquid-fill/LiquidFill2.js +3 -0
- package/liquid-fill/index.js +4 -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 +96 -99
- 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 +60 -65
- 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 +107 -107
- 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 +58 -58
- package/steps/Step.js +42 -42
- package/steps/index.js +54 -54
- package/style.css +1 -1
- package/switch/index.js +77 -78
- 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/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 +337 -346
- 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/mutationObserver.d.ts +2 -0
- package/types/common/utils/resizeObserver.d.ts +2 -0
- package/types/pc/config-provider/interface.d.ts +6 -0
- package/types/pc/index.d.ts +3 -0
- package/types/pc/liquid-fill/LiquidFill.d.ts +115 -0
- package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
- package/types/pc/liquid-fill/index.d.ts +2 -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/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 +77 -73
- 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 +48 -49
- 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 +281 -278
- package/utils/intersectionObserver.js +4 -0
- package/utils/mutationObserver.js +4 -0
- package/utils/names.js +12 -0
- 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/utils/resizeObserverEffect.js +0 -23
- package/types/common/utils/resizeObserverEffect.d.ts +0 -2
- package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
- package/utils/resizeObserverEffect.js +0 -4
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { v4 as
|
|
4
|
-
function
|
|
5
|
-
function c
|
|
6
|
-
const [n,
|
|
7
|
-
|
|
8
|
-
),
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as v, useState as x, useCallback as s, useImperativeHandle as _, useEffect as b } from "react";
|
|
3
|
+
import { v4 as C } from "uuid";
|
|
4
|
+
function q(m) {
|
|
5
|
+
function l(c, p) {
|
|
6
|
+
const [n, i] = x(
|
|
7
|
+
c?.notices ?? []
|
|
8
|
+
), d = s(
|
|
9
9
|
(t) => {
|
|
10
|
-
const r =
|
|
11
|
-
return t.id && n.findIndex((e) => e.id === t.id) !== -1 ?
|
|
10
|
+
const r = t?.id ?? `pqb_notice_id_${C()}`;
|
|
11
|
+
return t.id && n.findIndex((e) => e.id === t.id) !== -1 ? u(t) : i((e) => [
|
|
12
12
|
...e,
|
|
13
13
|
{
|
|
14
14
|
...t,
|
|
@@ -17,41 +17,41 @@ function E(l) {
|
|
|
17
17
|
]), r;
|
|
18
18
|
},
|
|
19
19
|
[n]
|
|
20
|
-
),
|
|
21
|
-
|
|
22
|
-
}, []),
|
|
23
|
-
|
|
20
|
+
), u = s((t) => {
|
|
21
|
+
i((r) => r.map((e) => t.id === e.id ? (delete e.update, t) : e));
|
|
22
|
+
}, []), o = s(() => {
|
|
23
|
+
i((t) => {
|
|
24
24
|
const r = [...t];
|
|
25
25
|
return r.shift(), r;
|
|
26
26
|
});
|
|
27
|
-
}, []),
|
|
28
|
-
|
|
29
|
-
}, []),
|
|
30
|
-
|
|
27
|
+
}, []), f = s((t) => {
|
|
28
|
+
i((r) => r.filter((e) => e.id !== t));
|
|
29
|
+
}, []), a = s(() => {
|
|
30
|
+
i((t) => []);
|
|
31
31
|
}, []);
|
|
32
|
-
return
|
|
32
|
+
return _(p, () => ({
|
|
33
33
|
notices: n,
|
|
34
|
-
add:
|
|
35
|
-
update:
|
|
36
|
-
shift:
|
|
37
|
-
remove:
|
|
38
|
-
clear:
|
|
39
|
-
}), [n,
|
|
40
|
-
}, [n]), /* @__PURE__ */
|
|
41
|
-
|
|
34
|
+
add: d,
|
|
35
|
+
update: u,
|
|
36
|
+
shift: o,
|
|
37
|
+
remove: f,
|
|
38
|
+
clear: a
|
|
39
|
+
}), [n, d, u, o, f, a]), b(() => () => {
|
|
40
|
+
}, [n]), /* @__PURE__ */ h(
|
|
41
|
+
m,
|
|
42
42
|
{
|
|
43
|
-
...
|
|
43
|
+
...c,
|
|
44
44
|
notices: n,
|
|
45
|
-
add:
|
|
46
|
-
update:
|
|
47
|
-
shift:
|
|
48
|
-
remove:
|
|
49
|
-
clear:
|
|
45
|
+
add: d,
|
|
46
|
+
update: u,
|
|
47
|
+
shift: o,
|
|
48
|
+
remove: f,
|
|
49
|
+
clear: a
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
return
|
|
53
|
+
return v(l);
|
|
54
54
|
}
|
|
55
55
|
export {
|
|
56
|
-
|
|
56
|
+
q as default
|
|
57
57
|
};
|
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useContext as
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import c from "lodash/isFunction";
|
|
3
|
+
import { useContext as u, useRef as l, useEffect as n } from "react";
|
|
4
4
|
import "../config-provider/ConfigProvider.js";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
function
|
|
9
|
-
const { getPrefixCls:
|
|
10
|
-
|
|
11
|
-
if (!
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
e.onResize((i = n == null ? void 0 : n[0]) == null ? void 0 : i.target);
|
|
5
|
+
import d from "@unicom-cloud/utils/class-name";
|
|
6
|
+
import { resizeObserver as a } from "../components/common/utils/resizeObserver.js";
|
|
7
|
+
import x from "../config-provider/context.js";
|
|
8
|
+
function w(e) {
|
|
9
|
+
const { getPrefixCls: i } = u(x), t = i?.("overflow-item"), r = l();
|
|
10
|
+
n(() => {
|
|
11
|
+
if (!c(e.onResize)) return;
|
|
12
|
+
const s = a([r.current], (f) => {
|
|
13
|
+
e.onResize(f?.[0]?.target);
|
|
15
14
|
});
|
|
16
15
|
return () => {
|
|
17
|
-
|
|
16
|
+
s();
|
|
18
17
|
};
|
|
19
|
-
}, [r.current, e.onResize]),
|
|
18
|
+
}, [r.current, e.onResize]), n(() => (e.onResize(r.current), () => {
|
|
20
19
|
e.unregister(r.current);
|
|
21
20
|
}), []);
|
|
22
|
-
const
|
|
23
|
-
return /* @__PURE__ */
|
|
21
|
+
const o = e.hidden;
|
|
22
|
+
return /* @__PURE__ */ m(
|
|
24
23
|
"div",
|
|
25
24
|
{
|
|
26
25
|
ref: r,
|
|
27
|
-
className:
|
|
28
|
-
[`${
|
|
26
|
+
className: d(t, e.className, {
|
|
27
|
+
[`${t}-hidden`]: o
|
|
29
28
|
}),
|
|
30
29
|
children: e.children
|
|
31
30
|
}
|
|
32
31
|
);
|
|
33
32
|
}
|
|
34
33
|
export {
|
|
35
|
-
|
|
34
|
+
w as default
|
|
36
35
|
};
|
|
@@ -1,75 +1,74 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useContext as j, useState as i, useLayoutEffect as k, useRef as b, useEffect as
|
|
1
|
+
import { jsxs as $, jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as j, useState as i, useLayoutEffect as k, useRef as b, useEffect as z } from "react";
|
|
3
3
|
import "../config-provider/ConfigProvider.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
4
|
+
import E from "@unicom-cloud/utils/class-name";
|
|
5
|
+
import { resizeObserver as I } from "../components/common/utils/resizeObserver.js";
|
|
6
|
+
import v from "./OverflowItem.js";
|
|
7
7
|
import M from "../config-provider/context.js";
|
|
8
|
-
function
|
|
9
|
-
const { getPrefixCls:
|
|
8
|
+
function A(l) {
|
|
9
|
+
const { getPrefixCls: g } = j(M), f = g?.("overflow"), { items: a, suffixItems: O } = l, y = l.ellipsisNode || (({ ellipsisCount: t }) => `+${t}`), [m, N] = i(), [d, W] = i(), [o, h] = i({}), [x, p] = i({}), w = a.length - d, _ = w > 0 ? y({ ellipsisCount: w }) : null;
|
|
10
10
|
k(() => {
|
|
11
|
-
const
|
|
12
|
-
let
|
|
13
|
-
Object.keys(
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
}),
|
|
19
|
-
}, [
|
|
20
|
-
const
|
|
21
|
-
return
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
W(((t = (r = s == null ? void 0 : s[0]) == null ? void 0 : r.target) == null ? void 0 : t.clientWidth) || 0);
|
|
11
|
+
const t = Object.values(o).length;
|
|
12
|
+
let r = Object.values(x).reduce((e, n) => e + (n?.width || 0), 0), s = t;
|
|
13
|
+
Object.keys(o).some((e, n) => {
|
|
14
|
+
const c = o[e];
|
|
15
|
+
if (c && r + c.width > m)
|
|
16
|
+
return s = n, !0;
|
|
17
|
+
r += c?.width || 0;
|
|
18
|
+
}), W(Math.max(s, 0));
|
|
19
|
+
}, [o, m, x]);
|
|
20
|
+
const u = b();
|
|
21
|
+
return z(() => {
|
|
22
|
+
const t = I([u.current], (r) => {
|
|
23
|
+
N(r?.[0]?.target?.clientWidth || 0);
|
|
25
24
|
});
|
|
26
25
|
return () => {
|
|
27
|
-
|
|
26
|
+
t();
|
|
28
27
|
};
|
|
29
|
-
}, [
|
|
30
|
-
|
|
31
|
-
const
|
|
28
|
+
}, [u.current]), /* @__PURE__ */ $("div", { ref: u, className: E(f, l.className), children: [
|
|
29
|
+
a.map((t, r) => {
|
|
30
|
+
const s = `${t?.key || r}_overflow_item_${r}`;
|
|
32
31
|
return /* @__PURE__ */ C(
|
|
33
|
-
|
|
32
|
+
v,
|
|
34
33
|
{
|
|
35
|
-
onResize: (
|
|
36
|
-
|
|
34
|
+
onResize: (e) => {
|
|
35
|
+
h((n) => (n[s] = { node: e, width: e.clientWidth }, n));
|
|
37
36
|
},
|
|
38
37
|
unregister: () => {
|
|
39
|
-
|
|
38
|
+
h((e) => (delete e[s], e));
|
|
40
39
|
},
|
|
41
|
-
hidden:
|
|
42
|
-
children:
|
|
40
|
+
hidden: d < r + 1,
|
|
41
|
+
children: t
|
|
43
42
|
},
|
|
44
|
-
|
|
43
|
+
s
|
|
45
44
|
);
|
|
46
45
|
}),
|
|
47
|
-
[
|
|
48
|
-
if (!
|
|
46
|
+
[_, ...O].map((t, r) => {
|
|
47
|
+
if (!t)
|
|
49
48
|
return null;
|
|
50
|
-
const
|
|
49
|
+
const s = `${t?.key || r}_overflow_suffix_item`;
|
|
51
50
|
return /* @__PURE__ */ C(
|
|
52
|
-
|
|
51
|
+
v,
|
|
53
52
|
{
|
|
54
|
-
className: `${
|
|
55
|
-
onResize: (
|
|
56
|
-
|
|
57
|
-
...
|
|
58
|
-
[`${
|
|
53
|
+
className: `${f}-suffix-item`,
|
|
54
|
+
onResize: (e) => {
|
|
55
|
+
p((n) => ({
|
|
56
|
+
...n,
|
|
57
|
+
[`${s}`]: { node: e, width: e.clientWidth }
|
|
59
58
|
}));
|
|
60
59
|
},
|
|
61
60
|
unregister: () => {
|
|
62
|
-
|
|
63
|
-
...
|
|
61
|
+
p((e) => (delete e[s], {
|
|
62
|
+
...e
|
|
64
63
|
}));
|
|
65
64
|
},
|
|
66
|
-
children:
|
|
65
|
+
children: t
|
|
67
66
|
},
|
|
68
|
-
|
|
67
|
+
s
|
|
69
68
|
);
|
|
70
69
|
})
|
|
71
70
|
] });
|
|
72
71
|
}
|
|
73
72
|
export {
|
|
74
|
-
|
|
73
|
+
A as default
|
|
75
74
|
};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unicom-cloud/ui","version":"0.8.
|
|
1
|
+
{"name":"@unicom-cloud/ui","version":"0.8.98","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"}}
|
package/page-header/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as c, jsx as r, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as c, jsx as r, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import B from "@unicom-cloud/icons/IconUiLeft";
|
|
3
3
|
import _ from "@unicom-cloud/icons/IconUiRight";
|
|
4
4
|
import T, { useContext as W, useState as j, useRef as z, useImperativeHandle as K, useEffect as U } from "react";
|
|
5
5
|
import D from "../breadcrumb/index.js";
|
|
@@ -7,62 +7,62 @@ import "../config-provider/ConfigProvider.js";
|
|
|
7
7
|
import F from "../components/common/hooks/useKeyboardEvent.js";
|
|
8
8
|
import L from "../components/common/hooks/useMergeProps.js";
|
|
9
9
|
import M from "../icon-hover/index.js";
|
|
10
|
-
import
|
|
10
|
+
import u from "@unicom-cloud/utils/class-name";
|
|
11
11
|
import { omit as O } from "../components/common/utils/omit.js";
|
|
12
|
-
import {
|
|
12
|
+
import { resizeObserver as S } from "../components/common/utils/resizeObserver.js";
|
|
13
13
|
import q from "../config-provider/context.js";
|
|
14
|
-
function
|
|
15
|
-
const { getPrefixCls:
|
|
16
|
-
|
|
14
|
+
function p(g, $) {
|
|
15
|
+
const { getPrefixCls: b, componentConfig: v, rtl: h } = W(q), a = L(
|
|
16
|
+
g,
|
|
17
17
|
{},
|
|
18
|
-
|
|
18
|
+
v?.PageHeader
|
|
19
19
|
), {
|
|
20
|
-
header:
|
|
21
|
-
title:
|
|
22
|
-
subTitle:
|
|
20
|
+
header: N,
|
|
21
|
+
title: x,
|
|
22
|
+
subTitle: y,
|
|
23
23
|
extra: k,
|
|
24
|
-
children:
|
|
24
|
+
children: m,
|
|
25
25
|
backIcon: l,
|
|
26
|
-
footer:
|
|
27
|
-
breadcrumb:
|
|
26
|
+
footer: d,
|
|
27
|
+
breadcrumb: f,
|
|
28
28
|
...A
|
|
29
29
|
} = a;
|
|
30
|
-
let i =
|
|
30
|
+
let i = N;
|
|
31
31
|
Array.isArray(i) && !i.length && (i = null);
|
|
32
|
-
let n =
|
|
32
|
+
let n = x;
|
|
33
33
|
Array.isArray(n) && !n.length && (n = null);
|
|
34
|
-
let
|
|
35
|
-
Array.isArray(s) && !s.length && (s = null);
|
|
36
|
-
let o = k;
|
|
34
|
+
let o = y;
|
|
37
35
|
Array.isArray(o) && !o.length && (o = null);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
let s = k;
|
|
37
|
+
Array.isArray(s) && !s.length && (s = null);
|
|
38
|
+
const C = F(), [w, P] = j(!1), t = z(), e = b?.("page-header");
|
|
39
|
+
K($, () => ({
|
|
40
|
+
getRootDomElement: R
|
|
41
41
|
}), []);
|
|
42
|
-
function
|
|
42
|
+
function R() {
|
|
43
43
|
return t.current;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
t.current &&
|
|
45
|
+
function I() {
|
|
46
|
+
t.current && P(t.current.offsetWidth < 768);
|
|
47
47
|
}
|
|
48
48
|
return U(() => {
|
|
49
|
-
const
|
|
49
|
+
const E = S([t.current], I);
|
|
50
50
|
return () => {
|
|
51
|
-
|
|
51
|
+
E();
|
|
52
52
|
};
|
|
53
53
|
}, [t.current]), /* @__PURE__ */ c(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
56
|
...O(A, ["onBack"]),
|
|
57
57
|
ref: t,
|
|
58
|
-
className:
|
|
58
|
+
className: u(
|
|
59
59
|
`${e}`,
|
|
60
60
|
{
|
|
61
|
-
[`${e}-with-breadcrumb`]:
|
|
62
|
-
[`${e}-with-content`]:
|
|
63
|
-
[`${e}-with-footer`]:
|
|
64
|
-
[`${e}-wrap`]:
|
|
65
|
-
[`${e}-rtl`]:
|
|
61
|
+
[`${e}-with-breadcrumb`]: f,
|
|
62
|
+
[`${e}-with-content`]: m,
|
|
63
|
+
[`${e}-with-footer`]: d,
|
|
64
|
+
[`${e}-wrap`]: w,
|
|
65
|
+
[`${e}-rtl`]: h
|
|
66
66
|
},
|
|
67
67
|
a.className
|
|
68
68
|
),
|
|
@@ -70,12 +70,12 @@ function b(v, N) {
|
|
|
70
70
|
children: [
|
|
71
71
|
!!i && /* @__PURE__ */ r("div", { className: `${e}-header`, children: i }),
|
|
72
72
|
/* @__PURE__ */ c("div", { className: `${e}-head-wrapper`, children: [
|
|
73
|
-
|
|
73
|
+
f && /* @__PURE__ */ r(D, { ...f }),
|
|
74
74
|
/* @__PURE__ */ c("div", { className: `${e}-head`, children: [
|
|
75
75
|
/* @__PURE__ */ c(
|
|
76
76
|
"div",
|
|
77
77
|
{
|
|
78
|
-
className:
|
|
78
|
+
className: u(`${e}-head-main`, {
|
|
79
79
|
[`${e}-head-main-with-back`]: l
|
|
80
80
|
}),
|
|
81
81
|
children: [
|
|
@@ -87,31 +87,31 @@ function b(v, N) {
|
|
|
87
87
|
role: "button",
|
|
88
88
|
className: `${e}-back`,
|
|
89
89
|
onClick: a.onBack,
|
|
90
|
-
...
|
|
90
|
+
...C({
|
|
91
91
|
onPressEnter: a.onBack
|
|
92
92
|
}),
|
|
93
|
-
children: /* @__PURE__ */ r("span", { className: `${e}-back-icon`, children: l === !0 ?
|
|
93
|
+
children: /* @__PURE__ */ r("span", { className: `${e}-back-icon`, children: l === !0 ? h ? /* @__PURE__ */ r(_, {}) : /* @__PURE__ */ r(B, {}) : l })
|
|
94
94
|
}
|
|
95
95
|
),
|
|
96
96
|
n && /* @__PURE__ */ r("div", { className: `${e}-title`, children: n }),
|
|
97
|
-
|
|
97
|
+
o && /* @__PURE__ */ c(H, { children: [
|
|
98
98
|
/* @__PURE__ */ r("div", { className: `${e}-divider` }),
|
|
99
|
-
/* @__PURE__ */ r("div", { className: `${e}-sub-title`, children:
|
|
99
|
+
/* @__PURE__ */ r("div", { className: `${e}-sub-title`, children: o })
|
|
100
100
|
] })
|
|
101
101
|
]
|
|
102
102
|
}
|
|
103
103
|
),
|
|
104
|
-
|
|
104
|
+
s && /* @__PURE__ */ r("div", { className: `${e}-head-extra`, children: s })
|
|
105
105
|
] })
|
|
106
106
|
] }),
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
m && /* @__PURE__ */ r("div", { className: `${e}-content`, children: m }),
|
|
108
|
+
d && /* @__PURE__ */ r("div", { className: `${e}-footer`, children: d })
|
|
109
109
|
]
|
|
110
110
|
}
|
|
111
111
|
);
|
|
112
112
|
}
|
|
113
|
-
|
|
114
|
-
const
|
|
113
|
+
p.displayName = "PageHeader";
|
|
114
|
+
const oe = T.forwardRef(p);
|
|
115
115
|
export {
|
|
116
|
-
|
|
116
|
+
oe as default
|
|
117
117
|
};
|
package/pagination/PageItem.js
CHANGED
|
@@ -1,119 +1,115 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
2
|
+
import M from "@unicom-cloud/icons/IconUiLeft";
|
|
3
|
+
import R from "@unicom-cloud/icons/IconUiMore";
|
|
4
|
+
import j from "@unicom-cloud/icons/IconUiRight";
|
|
5
|
+
import K, { useContext as h } from "react";
|
|
6
6
|
import "../config-provider/ConfigProvider.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { StepType as
|
|
10
|
-
import
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
n.currentTarget.dataset.active !== "true" && (n.stopPropagation(), c || g == null || g(u));
|
|
7
|
+
import N from "../components/common/hooks/useKeyboardEvent.js";
|
|
8
|
+
import S from "@unicom-cloud/utils/class-name";
|
|
9
|
+
import { StepType as b } from "./interface.js";
|
|
10
|
+
import $ from "../config-provider/context.js";
|
|
11
|
+
function T(t) {
|
|
12
|
+
const { locale: e } = h($), u = N(), {
|
|
13
|
+
pageNum: n,
|
|
14
|
+
current: g,
|
|
15
|
+
rootPrefixCls: r,
|
|
16
|
+
pageItemStyle: l,
|
|
17
|
+
activePageItemStyle: o,
|
|
18
|
+
itemRender: c
|
|
19
|
+
} = t, m = `${r}-item`, p = g === n, d = S(m, p ? `${m}-active` : "");
|
|
20
|
+
let a = l;
|
|
21
|
+
p && (a = { ...a, ...o });
|
|
22
|
+
const P = p ? { "aria-current": !0 } : {}, f = (i) => {
|
|
23
|
+
const { pageNum: s, onClick: v, disabled: C } = t;
|
|
24
|
+
i.currentTarget.dataset.active !== "true" && (i.stopPropagation(), C || v?.(s));
|
|
26
25
|
};
|
|
27
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ x(
|
|
28
27
|
"li",
|
|
29
28
|
{
|
|
30
|
-
style:
|
|
31
|
-
className:
|
|
32
|
-
onClick:
|
|
29
|
+
style: a,
|
|
30
|
+
className: d,
|
|
31
|
+
onClick: f,
|
|
33
32
|
tabIndex: t.disabled ? -1 : 0,
|
|
34
|
-
"aria-label":
|
|
35
|
-
...
|
|
36
|
-
...
|
|
37
|
-
children:
|
|
33
|
+
"aria-label": e?.Pagination?.currentPage?.replace?.("{0}", n),
|
|
34
|
+
...u({ onPressEnter: f }),
|
|
35
|
+
...P,
|
|
36
|
+
children: c ? c(n, "page", n) : n
|
|
38
37
|
}
|
|
39
38
|
);
|
|
40
39
|
}
|
|
41
|
-
function
|
|
40
|
+
function I(t, e) {
|
|
42
41
|
switch (t) {
|
|
43
42
|
case "prev":
|
|
44
|
-
return e && e.prev ? e.prev : /* @__PURE__ */
|
|
43
|
+
return e && e.prev ? e.prev : /* @__PURE__ */ x(M, {});
|
|
45
44
|
case "next":
|
|
46
|
-
return e && e.next ? e.next : /* @__PURE__ */
|
|
45
|
+
return e && e.next ? e.next : /* @__PURE__ */ x(j, {});
|
|
47
46
|
case "more":
|
|
48
|
-
return e && e.more ? e.more : /* @__PURE__ */
|
|
47
|
+
return e && e.more ? e.more : /* @__PURE__ */ x(R, {});
|
|
49
48
|
default:
|
|
50
49
|
return null;
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}, l = $("more", d), r = a > 0 ? (u = (n = (s = e == null ? void 0 : e.Pagination) == null ? void 0 : s.nextSomePages) == null ? void 0 : n.replace) == null ? void 0 : u.call(n, "{0}", a) : (h = (c = (g = e == null ? void 0 : e.Pagination) == null ? void 0 : g.prevSomePages) == null ? void 0 : c.replace) == null ? void 0 : h.call(c, "{0}", -a);
|
|
68
|
-
return /* @__PURE__ */ y(
|
|
52
|
+
const F = (t) => {
|
|
53
|
+
const { locale: e } = h($), {
|
|
54
|
+
rootPrefixCls: u,
|
|
55
|
+
current: n,
|
|
56
|
+
allPages: g,
|
|
57
|
+
jumpPage: r,
|
|
58
|
+
icons: l,
|
|
59
|
+
disabled: o,
|
|
60
|
+
pageItemStyle: c,
|
|
61
|
+
itemRender: m
|
|
62
|
+
} = t, p = g > 0 ? 1 : 0, d = Math.min(g, Math.max(p, n + r)), a = `${u}-item ${u}-item-jumper`, P = S(a), f = () => {
|
|
63
|
+
!o && t.onClick?.(d);
|
|
64
|
+
}, i = I("more", l), s = r > 0 ? e?.Pagination?.nextSomePages?.replace?.("{0}", r) : e?.Pagination?.prevSomePages?.replace?.("{0}", -r);
|
|
65
|
+
return /* @__PURE__ */ x(
|
|
69
66
|
"li",
|
|
70
67
|
{
|
|
71
|
-
style:
|
|
72
|
-
className:
|
|
73
|
-
onClick:
|
|
74
|
-
"aria-label":
|
|
75
|
-
children:
|
|
68
|
+
style: c,
|
|
69
|
+
className: P,
|
|
70
|
+
onClick: f,
|
|
71
|
+
"aria-label": s,
|
|
72
|
+
children: m ? m(void 0, "more", i) : i
|
|
76
73
|
}
|
|
77
74
|
);
|
|
78
|
-
},
|
|
79
|
-
const { locale: e, rtl:
|
|
80
|
-
rootPrefixCls:
|
|
81
|
-
current:
|
|
82
|
-
allPages:
|
|
83
|
-
type:
|
|
84
|
-
icons:
|
|
85
|
-
disabled:
|
|
86
|
-
pageItemStyle:
|
|
87
|
-
itemRender:
|
|
88
|
-
} = t,
|
|
89
|
-
let
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
let
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
[`${
|
|
96
|
-
}),
|
|
97
|
-
|
|
98
|
-
s || (h = t.onClick) == null || h.call(t, n);
|
|
75
|
+
}, G = (t) => {
|
|
76
|
+
const { locale: e, rtl: u } = h($), n = N(), {
|
|
77
|
+
rootPrefixCls: g,
|
|
78
|
+
current: r,
|
|
79
|
+
allPages: l,
|
|
80
|
+
type: o,
|
|
81
|
+
icons: c,
|
|
82
|
+
disabled: m,
|
|
83
|
+
pageItemStyle: p,
|
|
84
|
+
itemRender: d
|
|
85
|
+
} = t, a = `${g}-item`, [P, f] = u ? ["next", "prev"] : ["prev", "next"], i = o === b.previous ? I(P, c) : I(f, c);
|
|
86
|
+
let s = !1;
|
|
87
|
+
l === 0 ? s = !0 : o === b.previous ? s = r <= 1 : s = r === l;
|
|
88
|
+
const v = m || s;
|
|
89
|
+
let C = r + (o === b.previous ? -1 : 1);
|
|
90
|
+
C = Math.max(0, Math.min(l, C));
|
|
91
|
+
const y = b.previous === o ? "prev" : "next", E = S(a, `${a}-${y}`, {
|
|
92
|
+
[`${a}-disabled`]: v
|
|
93
|
+
}), k = () => {
|
|
94
|
+
v || t.onClick?.(C);
|
|
99
95
|
};
|
|
100
|
-
return /* @__PURE__ */
|
|
96
|
+
return /* @__PURE__ */ x(
|
|
101
97
|
"li",
|
|
102
98
|
{
|
|
103
|
-
style:
|
|
104
|
-
className:
|
|
105
|
-
onClick:
|
|
106
|
-
tabIndex:
|
|
107
|
-
"aria-label": e
|
|
108
|
-
...
|
|
109
|
-
onPressEnter:
|
|
99
|
+
style: p,
|
|
100
|
+
className: E,
|
|
101
|
+
onClick: k,
|
|
102
|
+
tabIndex: v ? -1 : 0,
|
|
103
|
+
"aria-label": e?.Pagination[y],
|
|
104
|
+
...n({
|
|
105
|
+
onPressEnter: k
|
|
110
106
|
}),
|
|
111
|
-
children:
|
|
107
|
+
children: d ? d(void 0, y, i) : i
|
|
112
108
|
}
|
|
113
109
|
);
|
|
114
|
-
},
|
|
110
|
+
}, H = K.memo(T);
|
|
115
111
|
export {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
112
|
+
F as JumpPager,
|
|
113
|
+
G as StepPager,
|
|
114
|
+
H as default
|
|
119
115
|
};
|