@unicom-cloud/ui 0.8.80 → 0.8.82
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/Alert.js +1 -1
- package/AutoComplete.js +2 -2
- package/BackTop.js +1 -1
- package/Badge.js +1 -1
- package/Breadcrumb.js +2 -2
- package/Button.js +1 -1
- package/Calendar.js +2 -2
- package/Card.js +1 -1
- package/Carousel.js +1 -1
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/Collapse.js +1 -1
- package/ColorPicker.js +2 -2
- package/Comment.js +1 -1
- package/ConfigProvider.js +5 -4
- package/Copy.js +1 -1
- package/DatePicker.js +7 -7
- package/Descriptions.js +1 -1
- package/Divider.js +1 -1
- package/Draggable.js +1 -1
- package/Dropdown.js +1 -1
- package/Empty.js +1 -1
- package/Icon.js +1 -1
- package/IconHover.js +1 -1
- package/Image.js +1 -1
- package/InputNumber.js +1 -1
- package/Layout.js +1 -1
- package/Link.js +1 -1
- package/List.js +2 -2
- package/Mentions.js +2 -2
- package/Menu.js +1 -1
- package/Message.js +1 -1
- package/Modal.js +1 -1
- package/Notice.js +1 -1
- package/Notification.js +5 -5
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/Pagination.js +1 -1
- package/Popconfirm.js +1 -1
- package/Popover.js +1 -1
- package/Progress.js +1 -1
- package/Radio.js +1 -1
- package/Rate.js +1 -1
- package/ResizeBox.js +1 -1
- package/Result.js +1 -1
- package/Select.js +1 -1
- package/Skeleton.js +1 -1
- package/Slider.js +1 -1
- package/Space.js +1 -1
- package/Spin.js +1 -1
- package/Statistic.js +1 -1
- package/Steps.js +1 -1
- package/Switch.js +1 -1
- package/Table.js +1 -1
- package/Tabs.js +1 -1
- package/Tag.js +1 -1
- package/Tooltip.js +1 -1
- package/Transfer.js +2 -2
- package/Tree.js +1 -1
- package/TreeSelect.js +1 -1
- package/Trigger.js +1 -1
- package/Typography.js +1 -1
- package/affix/index.js +60 -57
- package/alert/index.js +53 -53
- package/anchor/Anchor.js +72 -72
- package/anchor/Link.js +27 -27
- package/auto-complete/index.js +2 -2
- package/avatar/Avatar.js +31 -31
- package/avatar/Group.js +25 -25
- package/back-top/index.js +24 -24
- package/badge/index.js +37 -37
- package/breadcrumb/index.js +26 -26
- package/button/Group.js +7 -7
- package/button/index.js +29 -29
- package/calendar/index.js +2 -2
- package/card/Grid.js +12 -12
- package/card/Meta.js +17 -17
- package/card/index.js +44 -44
- package/carousel/Arrow.js +19 -19
- package/carousel/Indicator.js +25 -25
- package/carousel/index.js +77 -77
- package/cascader/Cascader.js +2 -2
- package/cascader/index.js +1 -1
- package/cascader/util.js +1 -1
- package/checkbox/Checkbox.js +2 -2
- package/checkbox/Group.js +2 -2
- package/checkbox/GroupBlock.js +2 -2
- package/checkbox/index.js +2 -2
- package/chunk/{yLRv5RIK.js → CQI1gsQs.js} +181 -181
- package/chunk/CmMehQON.js +1464 -0
- package/chunk/Cplu5dtQ.js +730 -0
- package/chunk/{C5X4hOkx.js → D0338Pbq.js} +80 -80
- package/chunk/{DYspELhF.js → DXDbeIai.js} +223 -223
- package/chunk/{DEiyXzBZ.js → DfrB26fI.js} +63 -63
- package/chunk/{BG7YGUsx.js → dKvAiKxr.js} +119 -119
- package/chunk/{D73Vr7fa.js → w221i0nK.js} +2871 -2870
- package/collapse/Collapse.js +2 -2
- package/collapse/Item.js +2 -2
- package/collapse/index.js +1 -1
- package/color-picker/ControlBar.js +36 -36
- package/color-picker/InputAlpha.js +11 -11
- package/color-picker/InputHex.js +24 -24
- package/color-picker/InputRgb.js +23 -23
- package/color-picker/Palette.js +18 -18
- package/color-picker/Panel.js +2 -2
- package/color-picker/index.js +2 -2
- package/comment/index.js +31 -31
- package/config-provider/ConfigProvider.js +5 -4
- package/config-provider/context.js +2 -2
- package/config-provider/index.js +4 -3
- package/copy/index.js +28 -28
- package/date-picker/Picker.js +276 -276
- package/date-picker/{PickerRange.js → RangePicker.js} +2 -2
- package/date-picker/index.js +26 -27
- package/descriptions/index.js +33 -33
- package/divider/index.js +12 -12
- package/draggable/index.js +23 -23
- package/drawer/Drawer.js +81 -81
- package/dropdown/Button.js +1 -1
- package/dropdown/index.js +56 -56
- package/empty/index.js +1 -1
- package/form/Form.js +76 -76
- package/form/FormItem.js +64 -64
- package/grid/Col.js +53 -53
- package/grid/Row.js +34 -34
- package/grid/grid-item.js +29 -29
- package/grid/grid.js +50 -50
- package/icon/index.js +20 -19
- package/icon-hover/index.js +1 -1
- package/image/Image.js +86 -86
- package/image/ImagePreview.js +2 -2
- package/image/ImagePreviewArrow.js +22 -22
- package/image/ImagePreviewGroup.js +1 -1
- package/image/index.js +1 -1
- package/index.js +404 -402
- package/input/Group.js +8 -8
- package/input/Input.js +322 -322
- package/input/InputElement.js +1 -1
- package/input/Password.js +1 -1
- package/input/Search.js +1 -1
- package/input/Textarea.js +1 -1
- package/input-number/index.js +1 -1
- package/input-tag/InputTag.js +40 -40
- package/layout/Content.js +7 -7
- package/layout/Footer.js +9 -9
- package/layout/Header.js +7 -7
- package/layout/Sider.js +55 -55
- package/layout/index.js +32 -32
- package/link/index.js +35 -35
- package/list/Item.js +29 -29
- package/list/Meta.js +12 -12
- package/list/index.js +2 -2
- package/mentions/index.js +2 -2
- package/menu/Menu.js +2 -2
- package/menu/OverflowWrap.js +1 -1
- package/menu/index.js +2 -2
- package/message/index.js +1 -1
- package/message/useMessage.js +1 -1
- package/modal/Confirm.js +2 -2
- package/modal/Modal.js +2 -2
- package/modal/index.js +1 -1
- package/notice/index.js +1 -1
- package/notification/index.js +5 -5
- package/notification/useNotification.js +1 -1
- package/overflow-ellipsis/OverflowItem.js +12 -12
- package/overflow-ellipsis/index.js +24 -24
- package/package.json +1 -1
- package/page-header/index.js +38 -38
- package/pagination/PageItem.js +16 -16
- package/pagination/PageJumper.js +1 -1
- package/pagination/PageOption.js +2 -2
- package/pagination/Pagination.js +2 -2
- package/pagination/index.js +1 -1
- package/picker/Input.js +69 -69
- package/picker/InputRange.js +111 -111
- package/popconfirm/index.js +61 -61
- package/popover/index.js +35 -35
- package/progress/index.js +22 -22
- package/radio/Group.js +2 -2
- package/radio/GroupBlock.js +2 -2
- package/radio/Radio.js +2 -2
- package/radio/index.js +2 -2
- package/rate/index.js +49 -49
- package/resize-box/ResizeTrigger.js +34 -34
- package/resize-box/Split.js +56 -56
- package/resize-box/SplitGroup.js +55 -55
- package/resize-box/index.js +51 -51
- package/result/index.js +41 -41
- package/select/Option.js +1 -1
- package/select/Select.js +2 -2
- package/select/index.js +2 -2
- package/select/util.js +1 -1
- package/select-view/Core.js +125 -125
- package/skeleton/index.js +20 -20
- package/slider/Button.js +57 -57
- package/slider/index.js +116 -116
- package/space/index.js +46 -44
- package/spin/DotLoading.js +10 -10
- package/spin/index.js +44 -44
- package/statistic/Countdown.js +34 -34
- package/statistic/index.js +61 -61
- package/steps/index.js +55 -55
- package/style.css +1 -1
- package/switch/index.js +54 -54
- package/table/Table.js +2 -2
- package/table/index.js +1 -1
- package/tabs/Tab.js +2 -2
- package/tabs/TabContent.js +2 -2
- package/tabs/TabPane.js +12 -12
- package/tabs/index.js +2 -2
- package/tag/index.js +45 -45
- package/time-picker/Picker.js +76 -76
- package/time-picker/TimePicker.js +136 -136
- package/time-picker/index.js +8 -8
- package/timeline/Item.js +47 -47
- package/timeline/Timeline.js +41 -41
- package/tooltip/index.js +29 -29
- package/transfer/Item.js +2 -2
- package/transfer/List.js +2 -2
- package/transfer/index.js +2 -2
- package/tree/Animation.js +2 -2
- package/tree/Node.js +2 -2
- package/tree/NodeList.js +1 -1
- package/tree/Tree.js +2 -2
- package/tree/index.js +1 -1
- package/tree-select/List.js +1 -1
- package/tree-select/Select.js +2 -2
- package/tree-select/index.js +2 -2
- package/trigger/index.js +60 -60
- package/types/config-provider/ConfigProvider.d.ts +2 -2
- package/types/config-provider/context.d.ts +1 -1
- package/types/date-picker/index.d.ts +8 -9
- package/types/date-picker/interface.d.ts +9 -9
- package/types/index.d.ts +1 -1
- package/types/picker/Input.d.ts +2 -2
- package/types/space/index.d.ts +2 -1
- package/types/utils/names.d.ts +1 -1
- package/typography/Base.js +53 -53
- package/typography/Ellipsis.js +6 -6
- package/typography/Operations.js +28 -28
- package/typography/Paragraph.js +8 -8
- package/typography/Typography.js +7 -7
- package/typography/index.js +1 -1
- package/upload/TriggerNode.js +47 -47
- package/upload/Upload.js +184 -184
- package/utils/contextHolder.js +3 -3
- package/utils/index.js +1 -1
- package/utils/names.js +1 -1
- package/utils/setPrimaryColor.js +18 -13
- package/verification-code/VerificationCode.js +49 -49
- package/version/index.js +1 -1
- package/watermark/Watermark.js +24 -24
- package/chunk/CQvM33Vg.js +0 -724
- package/chunk/yhU2zeeu.js +0 -1461
- /package/types/date-picker/{PickerRange.d.ts → RangePicker.d.ts} +0 -0
package/Tree.js
CHANGED
package/TreeSelect.js
CHANGED
package/Trigger.js
CHANGED
package/Typography.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as o, w as t } from "./chunk/
|
|
1
|
+
import { E as o, w as t } from "./chunk/w221i0nK.js";
|
|
2
2
|
import { default as f } from "./typography/Paragraph.js";
|
|
3
3
|
import { default as l } from "./typography/Text.js";
|
|
4
4
|
import { default as T } from "./typography/Title.js";
|
package/affix/index.js
CHANGED
|
@@ -1,57 +1,60 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import { a as
|
|
7
|
-
import { u as
|
|
1
|
+
import { jsxs as k, jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import N from "lodash/isFunction";
|
|
3
|
+
import q from "lodash/isPlainObject";
|
|
4
|
+
import G from "lodash/isUndefined";
|
|
5
|
+
import { forwardRef as J, useContext as K, useState as Q, useRef as b, useMemo as V, useCallback as X, useEffect as m, useImperativeHandle as Y } from "react";
|
|
6
|
+
import { a as Z } from "../chunk/Cplu5dtQ.js";
|
|
7
|
+
import { u as P } from "../chunk/B2yFlXke.js";
|
|
8
8
|
import { u as tt } from "../chunk/BFTV6myl.js";
|
|
9
|
-
import
|
|
10
|
-
import { getScrollElements as et, on as
|
|
9
|
+
import v from "@unicom-cloud/utils/class-name";
|
|
10
|
+
import { getScrollElements as et, on as A, off as p } from "../utils/dom.js";
|
|
11
11
|
import { l as rt } from "../chunk/ClM74To2.js";
|
|
12
12
|
import { r as st } from "../chunk/CIRG541s.js";
|
|
13
13
|
import ot from "../utils/throttleByRaf.js";
|
|
14
|
-
function nt(
|
|
15
|
-
return rt(
|
|
14
|
+
function nt(i) {
|
|
15
|
+
return rt(i) ? {
|
|
16
16
|
top: 0,
|
|
17
17
|
bottom: window.innerHeight
|
|
18
|
-
} :
|
|
18
|
+
} : i instanceof HTMLElement ? i.getBoundingClientRect() : {
|
|
19
|
+
top: 0,
|
|
20
|
+
bottom: 0
|
|
21
|
+
};
|
|
19
22
|
}
|
|
20
23
|
const it = {
|
|
21
24
|
offsetTop: 0
|
|
22
25
|
};
|
|
23
|
-
function ft(
|
|
24
|
-
const { getPrefixCls:
|
|
25
|
-
|
|
26
|
+
function ft(i, H) {
|
|
27
|
+
const { getPrefixCls: d, componentConfig: x, rtl: O } = K(Z), U = tt(
|
|
28
|
+
i,
|
|
26
29
|
it,
|
|
27
|
-
|
|
30
|
+
x == null ? void 0 : x.Affix
|
|
28
31
|
), {
|
|
29
|
-
className:
|
|
30
|
-
style:
|
|
32
|
+
className: _,
|
|
33
|
+
style: B,
|
|
31
34
|
affixClassName: I,
|
|
32
|
-
affixStyle:
|
|
35
|
+
affixStyle: C,
|
|
33
36
|
offsetTop: l,
|
|
34
|
-
offsetBottom:
|
|
35
|
-
target:
|
|
37
|
+
offsetBottom: f,
|
|
38
|
+
target: S,
|
|
36
39
|
targetContainer: a,
|
|
37
40
|
children: j,
|
|
38
|
-
onChange:
|
|
41
|
+
onChange: y,
|
|
39
42
|
...D
|
|
40
|
-
} =
|
|
43
|
+
} = U, [g, T] = Q({
|
|
41
44
|
status: "MEASURE_DONE",
|
|
42
45
|
isFixed: !1,
|
|
43
46
|
sizeStyles: {},
|
|
44
47
|
fixedStyles: {}
|
|
45
|
-
}), { isFixed:
|
|
46
|
-
{ [F]:
|
|
48
|
+
}), { isFixed: R, sizeStyles: L, fixedStyles: W } = g, z = b(R), F = d == null ? void 0 : d("affix"), $ = v(
|
|
49
|
+
{ [F]: R, [`${F}-rtl`]: O },
|
|
47
50
|
I
|
|
48
|
-
), r =
|
|
49
|
-
var n,
|
|
51
|
+
), r = b(null), s = b(null), w = V(() => {
|
|
52
|
+
var n, c;
|
|
50
53
|
let e = null;
|
|
51
|
-
return
|
|
52
|
-
}, [r.current,
|
|
54
|
+
return N(S) ? e = S() : e = ((c = (n = et(r.current)) == null ? void 0 : n.at) == null ? void 0 : c.call(n, -1)) || window, e;
|
|
55
|
+
}, [r.current, S]), t = X(
|
|
53
56
|
ot(() => {
|
|
54
|
-
|
|
57
|
+
T({
|
|
55
58
|
status: "MEASURE_START",
|
|
56
59
|
isFixed: !1,
|
|
57
60
|
fixedStyles: {},
|
|
@@ -60,45 +63,45 @@ function ft(c, v) {
|
|
|
60
63
|
}),
|
|
61
64
|
[]
|
|
62
65
|
);
|
|
63
|
-
return
|
|
66
|
+
return P(() => {
|
|
64
67
|
const { status: e } = g;
|
|
65
68
|
if (e !== "MEASURE_START" || !r.current || !s.current)
|
|
66
69
|
return;
|
|
67
|
-
const n =
|
|
68
|
-
let o = !1,
|
|
69
|
-
n === "top" ? (o =
|
|
70
|
+
const n = G(f) ? "top" : "bottom", c = r.current.getBoundingClientRect(), u = nt(s.current);
|
|
71
|
+
let o = !1, E = {};
|
|
72
|
+
n === "top" ? (o = c.top - u.top < (l || 0), E = o ? {
|
|
70
73
|
position: "fixed",
|
|
71
74
|
top: u.top + (l || 0)
|
|
72
|
-
} : {}) : (o = u.bottom -
|
|
75
|
+
} : {}) : (o = u.bottom - c.bottom < (f || 0), E = o ? {
|
|
73
76
|
position: "fixed",
|
|
74
|
-
bottom: window.innerHeight - u.bottom + (
|
|
77
|
+
bottom: window.innerHeight - u.bottom + (f || 0)
|
|
75
78
|
} : {});
|
|
76
|
-
const
|
|
79
|
+
const M = o ? {
|
|
77
80
|
width: r.current.offsetWidth,
|
|
78
81
|
height: r.current.offsetHeight
|
|
79
82
|
} : {};
|
|
80
|
-
|
|
83
|
+
T({
|
|
81
84
|
status: "MEASURE_DONE",
|
|
82
85
|
isFixed: o,
|
|
83
|
-
sizeStyles:
|
|
84
|
-
fixedStyles: { ...
|
|
85
|
-
}), o !== z.current && (z.current = o,
|
|
86
|
-
}, [g,
|
|
86
|
+
sizeStyles: M,
|
|
87
|
+
fixedStyles: { ...E, ...M }
|
|
88
|
+
}), o !== z.current && (z.current = o, N(y) && y(o));
|
|
89
|
+
}, [g, f, l, y]), m(() => (t(), () => {
|
|
87
90
|
var e;
|
|
88
91
|
(e = t == null ? void 0 : t.cancel) == null || e.call(t);
|
|
89
|
-
}), [
|
|
90
|
-
if (s.current =
|
|
91
|
-
return
|
|
92
|
+
}), [w, a, f, l, t]), m(() => {
|
|
93
|
+
if (s.current = w, s.current)
|
|
94
|
+
return A(s.current, "scroll", t), A(s.current, "resize", t), () => {
|
|
92
95
|
p(s.current, "scroll", t), p(s.current, "resize", t);
|
|
93
96
|
};
|
|
94
|
-
}, [
|
|
95
|
-
const e =
|
|
96
|
-
return s.current !== window && e ? (
|
|
97
|
+
}, [w, t]), m(() => {
|
|
98
|
+
const e = N(a) ? a() : null;
|
|
99
|
+
return s.current !== window && e ? (A(e, "scroll", t), () => {
|
|
97
100
|
p(e, "scroll", t);
|
|
98
101
|
}) : () => {
|
|
99
102
|
p(e, "scroll", t);
|
|
100
103
|
};
|
|
101
|
-
}, [a, t]),
|
|
104
|
+
}, [a, t]), Y(H, () => ({
|
|
102
105
|
updatePosition: t,
|
|
103
106
|
getRootDOMNode: () => r.current
|
|
104
107
|
})), m(() => {
|
|
@@ -106,22 +109,22 @@ function ft(c, v) {
|
|
|
106
109
|
return () => {
|
|
107
110
|
e();
|
|
108
111
|
};
|
|
109
|
-
}, [r.current]), /* @__PURE__ */
|
|
110
|
-
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
+
}, [r.current]), /* @__PURE__ */ k("div", { className: v(_), style: B, ref: r, ...D, children: [
|
|
113
|
+
R && /* @__PURE__ */ h("div", { style: L }),
|
|
114
|
+
/* @__PURE__ */ h(
|
|
112
115
|
"div",
|
|
113
116
|
{
|
|
114
|
-
className:
|
|
117
|
+
className: $,
|
|
115
118
|
style: {
|
|
116
|
-
|
|
117
|
-
...
|
|
119
|
+
...W,
|
|
120
|
+
...q(C) ? C : {}
|
|
118
121
|
},
|
|
119
|
-
children: j || /* @__PURE__ */
|
|
122
|
+
children: j || /* @__PURE__ */ h("span", {})
|
|
120
123
|
}
|
|
121
124
|
)
|
|
122
125
|
] });
|
|
123
126
|
}
|
|
124
|
-
const ct =
|
|
127
|
+
const ct = J(
|
|
125
128
|
ft
|
|
126
129
|
);
|
|
127
130
|
ct.displayName = "Affix";
|
package/alert/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import j from "@unicom-cloud/icons/IconUiCheckCircleFill";
|
|
3
|
+
import k from "@unicom-cloud/icons/IconUiClose";
|
|
4
|
+
import R from "@unicom-cloud/icons/IconUiCloseCircleFill";
|
|
5
|
+
import T from "@unicom-cloud/icons/IconUiExclamationCircleFill";
|
|
6
|
+
import g from "@unicom-cloud/icons/IconUiInfoCircleFill";
|
|
7
7
|
import { forwardRef as q, useRef as z, useContext as H, useState as M } from "react";
|
|
8
|
-
import { a as O } from "../chunk/
|
|
8
|
+
import { a as O } from "../chunk/Cplu5dtQ.js";
|
|
9
9
|
import { u as V } from "../chunk/BFTV6myl.js";
|
|
10
10
|
import _ from "@unicom-cloud/utils/class-name";
|
|
11
11
|
import { P as B } from "../chunk/NPajzdOv.js";
|
|
@@ -13,90 +13,90 @@ const D = {
|
|
|
13
13
|
showIcon: !0,
|
|
14
14
|
type: "info"
|
|
15
15
|
};
|
|
16
|
-
function G(
|
|
17
|
-
|
|
18
|
-
const { getPrefixCls:
|
|
19
|
-
|
|
16
|
+
function G(h, c) {
|
|
17
|
+
c || (c = z());
|
|
18
|
+
const { getPrefixCls: o, componentConfig: r, rtl: N } = H(O), a = V(
|
|
19
|
+
h,
|
|
20
20
|
D,
|
|
21
|
-
|
|
21
|
+
r == null ? void 0 : r.Alert
|
|
22
22
|
), {
|
|
23
|
-
style:
|
|
24
|
-
className:
|
|
25
|
-
action:
|
|
26
|
-
type:
|
|
27
|
-
title:
|
|
28
|
-
content:
|
|
23
|
+
style: b,
|
|
24
|
+
className: $,
|
|
25
|
+
action: m,
|
|
26
|
+
type: u = "info",
|
|
27
|
+
title: n,
|
|
28
|
+
content: p,
|
|
29
29
|
icon: f,
|
|
30
|
-
showIcon:
|
|
31
|
-
closable:
|
|
32
|
-
closeable:
|
|
33
|
-
afterClose:
|
|
34
|
-
onClose:
|
|
35
|
-
closeElement:
|
|
30
|
+
showIcon: C,
|
|
31
|
+
closable: I,
|
|
32
|
+
closeable: w,
|
|
33
|
+
afterClose: s,
|
|
34
|
+
onClose: i,
|
|
35
|
+
closeElement: x,
|
|
36
36
|
banner: v,
|
|
37
37
|
...y
|
|
38
|
-
} =
|
|
39
|
-
function
|
|
38
|
+
} = a, e = o == null ? void 0 : o("alert"), [U, A] = M(!0);
|
|
39
|
+
function E(l) {
|
|
40
40
|
if (f)
|
|
41
41
|
return f;
|
|
42
|
-
switch (
|
|
42
|
+
switch (l) {
|
|
43
43
|
case "info":
|
|
44
|
-
return /* @__PURE__ */ t(
|
|
44
|
+
return /* @__PURE__ */ t(g, {});
|
|
45
45
|
case "success":
|
|
46
|
-
return /* @__PURE__ */ t(
|
|
46
|
+
return /* @__PURE__ */ t(j, {});
|
|
47
47
|
case "warning":
|
|
48
|
-
return /* @__PURE__ */ t(
|
|
48
|
+
return /* @__PURE__ */ t(T, {});
|
|
49
49
|
case "error":
|
|
50
|
-
return /* @__PURE__ */ t(
|
|
50
|
+
return /* @__PURE__ */ t(R, {});
|
|
51
51
|
default:
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
55
|
+
function F(l) {
|
|
56
|
+
A(!1), i == null || i(l);
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const P = _(
|
|
59
59
|
e,
|
|
60
|
-
`${e}-${
|
|
60
|
+
`${e}-${u}`,
|
|
61
61
|
{
|
|
62
|
-
[`${e}-with-title`]:
|
|
62
|
+
[`${e}-with-title`]: n,
|
|
63
63
|
[`${e}-banner`]: v,
|
|
64
|
-
[`${e}-rtl`]:
|
|
64
|
+
[`${e}-rtl`]: N
|
|
65
65
|
},
|
|
66
|
-
|
|
67
|
-
),
|
|
66
|
+
$
|
|
67
|
+
), S = "closeable" in a ? w : I;
|
|
68
68
|
return /* @__PURE__ */ t(
|
|
69
69
|
B,
|
|
70
70
|
{
|
|
71
|
-
in:
|
|
71
|
+
in: U,
|
|
72
72
|
timeout: 300,
|
|
73
73
|
classNames: "zoomInTop",
|
|
74
74
|
unmountOnExit: !0,
|
|
75
75
|
onExited: () => {
|
|
76
|
-
|
|
76
|
+
s == null || s();
|
|
77
77
|
},
|
|
78
|
-
children: /* @__PURE__ */
|
|
78
|
+
children: /* @__PURE__ */ d(
|
|
79
79
|
"div",
|
|
80
80
|
{
|
|
81
|
-
ref:
|
|
82
|
-
style:
|
|
83
|
-
className:
|
|
81
|
+
ref: c,
|
|
82
|
+
style: b,
|
|
83
|
+
className: P,
|
|
84
84
|
role: "alert",
|
|
85
85
|
...y,
|
|
86
86
|
children: [
|
|
87
|
-
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
C && /* @__PURE__ */ t("div", { className: `${e}-icon-wrapper`, children: E(u) }),
|
|
88
|
+
/* @__PURE__ */ d("div", { className: `${e}-content-wrapper`, children: [
|
|
89
|
+
n && /* @__PURE__ */ t("div", { className: `${e}-title`, children: n }),
|
|
90
|
+
p && /* @__PURE__ */ t("div", { className: `${e}-content`, children: p })
|
|
91
91
|
] }),
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
m && /* @__PURE__ */ t("div", { className: `${e}-action`, children: m }),
|
|
93
|
+
S && /* @__PURE__ */ t(
|
|
94
94
|
"button",
|
|
95
95
|
{
|
|
96
96
|
type: "button",
|
|
97
|
-
onClick:
|
|
97
|
+
onClick: F,
|
|
98
98
|
className: `${e}-close-btn`,
|
|
99
|
-
children:
|
|
99
|
+
children: x || /* @__PURE__ */ t(k, {})
|
|
100
100
|
}
|
|
101
101
|
)
|
|
102
102
|
]
|
package/anchor/Anchor.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as mt, jsx as w } from "react/jsx-runtime";
|
|
2
2
|
import { compute as dt } from "../utils/computeScrollIntoView.js";
|
|
3
3
|
import { p as pt } from "../chunk/Coz3rCng.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import _ from "lodash/isFunction";
|
|
5
|
+
import E from "lodash/isNumber";
|
|
6
6
|
import gt from "lodash/throttle";
|
|
7
|
-
import { forwardRef as ht, useContext as Ct, useRef as
|
|
7
|
+
import { forwardRef as ht, useContext as Ct, useRef as k, useState as kt, useEffect as N, useCallback as S, useImperativeHandle as xt } from "react";
|
|
8
8
|
import yt from "../affix/index.js";
|
|
9
|
-
import { a as Lt } from "../chunk/
|
|
9
|
+
import { a as Lt } from "../chunk/Cplu5dtQ.js";
|
|
10
10
|
import { u as Rt } from "../chunk/oopARUrq.js";
|
|
11
11
|
import { u as wt } from "../chunk/BFTV6myl.js";
|
|
12
12
|
import { u as Nt } from "../chunk/Duezix3m.js";
|
|
@@ -15,108 +15,108 @@ import { on as $t, off as At } from "../utils/dom.js";
|
|
|
15
15
|
import { l as Tt } from "../chunk/ClM74To2.js";
|
|
16
16
|
import vt from "./context.js";
|
|
17
17
|
import bt from "./Link.js";
|
|
18
|
-
import { findNode as
|
|
18
|
+
import { findNode as P, getContainerElement as Mt, getContainer as Et, getScrollParent as Pt, slide as Ft } from "./util.js";
|
|
19
19
|
const It = {
|
|
20
20
|
animation: !0,
|
|
21
21
|
affix: !0,
|
|
22
22
|
hash: !0,
|
|
23
23
|
boundary: "start"
|
|
24
24
|
};
|
|
25
|
-
function Ht(
|
|
26
|
-
const { getPrefixCls:
|
|
27
|
-
|
|
25
|
+
function Ht(G, J) {
|
|
26
|
+
const { getPrefixCls: $, componentConfig: A, rtl: F } = Ct(Lt), K = wt(
|
|
27
|
+
G,
|
|
28
28
|
It,
|
|
29
|
-
|
|
29
|
+
A == null ? void 0 : A.Anchor
|
|
30
30
|
), {
|
|
31
31
|
className: Q,
|
|
32
32
|
style: X,
|
|
33
33
|
scrollContainer: m,
|
|
34
34
|
animation: Y = !0,
|
|
35
|
-
lineless:
|
|
35
|
+
lineless: x,
|
|
36
36
|
affix: Z = !0,
|
|
37
37
|
affixStyle: tt,
|
|
38
38
|
offsetBottom: et,
|
|
39
39
|
offsetTop: nt,
|
|
40
|
-
hash:
|
|
40
|
+
hash: I = !0,
|
|
41
41
|
boundary: i = "start",
|
|
42
|
-
targetOffset:
|
|
42
|
+
targetOffset: T,
|
|
43
43
|
children: rt,
|
|
44
44
|
direction: y = "vertical",
|
|
45
|
-
onSelect:
|
|
46
|
-
onChange:
|
|
45
|
+
onSelect: H,
|
|
46
|
+
onChange: v,
|
|
47
47
|
...ot
|
|
48
|
-
} = K,
|
|
49
|
-
[`${
|
|
50
|
-
[`${
|
|
51
|
-
[`${
|
|
52
|
-
}), s =
|
|
53
|
-
function
|
|
54
|
-
let t =
|
|
55
|
-
return m || (t =
|
|
48
|
+
} = K, a = $ == null ? void 0 : $("anchor"), it = St(a, Q, {
|
|
49
|
+
[`${a}-lineless`]: x,
|
|
50
|
+
[`${a}-rtl`]: F,
|
|
51
|
+
[`${a}-horizontal`]: y === "horizontal"
|
|
52
|
+
}), s = k(null), d = k(null), f = k(/* @__PURE__ */ new Map()), b = k(!1), p = k(null), [st, O] = kt(0), [o, ct] = Nt(""), lt = Rt();
|
|
53
|
+
function z() {
|
|
54
|
+
let t = Et(m);
|
|
55
|
+
return m || (t = Pt(s.current)), t;
|
|
56
56
|
}
|
|
57
57
|
N(() => {
|
|
58
|
-
const t =
|
|
58
|
+
const t = z();
|
|
59
59
|
p.current = t;
|
|
60
60
|
}, [m]);
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
const at = S(() => z(), [m]);
|
|
62
|
+
xt(
|
|
63
|
+
J,
|
|
64
64
|
() => ({
|
|
65
65
|
dom: s.current,
|
|
66
66
|
getRootDOMNode: () => s.current
|
|
67
67
|
}),
|
|
68
68
|
[]
|
|
69
69
|
);
|
|
70
|
-
function
|
|
71
|
-
t && (
|
|
70
|
+
function B(t, e) {
|
|
71
|
+
t && (f.current.set(t, e), O(Math.random()));
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
73
|
+
function ft(t) {
|
|
74
|
+
f.current.delete(t), O(Math.random());
|
|
75
75
|
}
|
|
76
76
|
const L = S(
|
|
77
77
|
(t) => {
|
|
78
78
|
if (!t || !s.current)
|
|
79
79
|
return;
|
|
80
|
-
if (!
|
|
81
|
-
const n =
|
|
82
|
-
n &&
|
|
80
|
+
if (!f.current.has(t)) {
|
|
81
|
+
const n = P(s.current, `a[data-href='${t}']`);
|
|
82
|
+
n && B(t, n);
|
|
83
83
|
}
|
|
84
|
-
const e =
|
|
84
|
+
const e = f.current.get(t);
|
|
85
85
|
e && t !== o && (pt(e, {
|
|
86
86
|
behavior: "auto",
|
|
87
87
|
block: "nearest",
|
|
88
88
|
scrollMode: "if-needed",
|
|
89
89
|
boundary: s.current
|
|
90
90
|
}), ct(t).then(() => {
|
|
91
|
-
|
|
91
|
+
_(v) && v(t, o);
|
|
92
92
|
}));
|
|
93
93
|
},
|
|
94
|
-
[o,
|
|
95
|
-
),
|
|
94
|
+
[o, v]
|
|
95
|
+
), U = S(() => {
|
|
96
96
|
let t;
|
|
97
|
-
const e =
|
|
98
|
-
return [...
|
|
99
|
-
const c =
|
|
97
|
+
const e = E(i) ? i : 0, n = p.current, h = Mt(n).getBoundingClientRect(), R = document.documentElement.clientHeight;
|
|
98
|
+
return [...f.current.keys()].some((M) => {
|
|
99
|
+
const c = P(document, M);
|
|
100
100
|
let u = !1;
|
|
101
101
|
if (c) {
|
|
102
102
|
const { top: r, height: C } = c.getBoundingClientRect();
|
|
103
103
|
if (Tt(n)) {
|
|
104
|
-
const l =
|
|
104
|
+
const l = T ?? R / 2;
|
|
105
105
|
u = r >= e && r <= l || r <= e && r + C >= l;
|
|
106
106
|
} else {
|
|
107
|
-
const l = r - h.top - e,
|
|
108
|
-
u = l >= 0 && l <=
|
|
107
|
+
const l = r - h.top - e, D = T ?? h.height / 2;
|
|
108
|
+
u = l >= 0 && l <= D || l <= 0 && l + C >= D;
|
|
109
109
|
}
|
|
110
110
|
u && (t = c);
|
|
111
111
|
}
|
|
112
112
|
return u;
|
|
113
113
|
}), t;
|
|
114
|
-
}, [i,
|
|
114
|
+
}, [i, T]), g = S(
|
|
115
115
|
gt(
|
|
116
116
|
(t) => {
|
|
117
|
-
if (
|
|
117
|
+
if (b.current)
|
|
118
118
|
return;
|
|
119
|
-
const e =
|
|
119
|
+
const e = U();
|
|
120
120
|
if (e && e.id) {
|
|
121
121
|
const n = `#${e.id}`;
|
|
122
122
|
L(n);
|
|
@@ -125,29 +125,29 @@ function Ht(q, G) {
|
|
|
125
125
|
30,
|
|
126
126
|
{ trailing: !0 }
|
|
127
127
|
),
|
|
128
|
-
[
|
|
128
|
+
[U, L]
|
|
129
129
|
);
|
|
130
|
-
function
|
|
130
|
+
function V(t) {
|
|
131
131
|
if (t)
|
|
132
132
|
try {
|
|
133
|
-
const e =
|
|
133
|
+
const e = P(document, t);
|
|
134
134
|
if (!e)
|
|
135
135
|
return;
|
|
136
|
-
const n =
|
|
136
|
+
const n = E(i) ? "start" : i, j = E(i) ? i : 0, h = dt(e, { block: n });
|
|
137
137
|
if (!h.length)
|
|
138
138
|
return;
|
|
139
139
|
let R = !1;
|
|
140
|
-
const
|
|
140
|
+
const M = h.map(({ el: c, top: u }) => new Promise((r) => {
|
|
141
141
|
if (!R) {
|
|
142
142
|
c === p.current && (R = !0);
|
|
143
|
-
const C = u -
|
|
144
|
-
return Y ? Ft(c, C, r) : (
|
|
143
|
+
const C = u - j;
|
|
144
|
+
return Y ? Ft(c, C, r) : (I || (c.scrollTop = C), r(null));
|
|
145
145
|
}
|
|
146
146
|
r(null);
|
|
147
147
|
}));
|
|
148
|
-
|
|
148
|
+
b.current = !0, Promise.all(M).then(() => {
|
|
149
149
|
setTimeout(() => {
|
|
150
|
-
|
|
150
|
+
b.current = !1;
|
|
151
151
|
}, 27);
|
|
152
152
|
});
|
|
153
153
|
} catch (e) {
|
|
@@ -155,30 +155,30 @@ function Ht(q, G) {
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
function ut(t, e) {
|
|
158
|
-
|
|
158
|
+
I || t.preventDefault(), L(e), V(e), _(H) && H(e, o);
|
|
159
159
|
}
|
|
160
160
|
N(() => {
|
|
161
161
|
const t = decodeURIComponent(location.hash);
|
|
162
|
-
t ? (L(t),
|
|
162
|
+
t ? (L(t), V(t)) : g(null);
|
|
163
163
|
}, []), N(() => (lt || g(null), $t(p.current, "scroll", g), () => {
|
|
164
164
|
At(p.current, "scroll", g);
|
|
165
165
|
}), [m, g]), N(() => {
|
|
166
|
-
const t =
|
|
167
|
-
t && !
|
|
168
|
-
}, [o,
|
|
169
|
-
const
|
|
170
|
-
!
|
|
166
|
+
const t = f.current.get(o);
|
|
167
|
+
t && !x && d.current && (y === "horizontal" ? (d.current.style.left = `${t.offsetLeft}px`, d.current.style.width = `${t.clientWidth}px`) : d.current.style.top = `${t.offsetTop}px`);
|
|
168
|
+
}, [o, x, y, F, st]);
|
|
169
|
+
const W = /* @__PURE__ */ mt("div", { className: it, style: X, ref: s, ...ot, children: [
|
|
170
|
+
!x && o && /* @__PURE__ */ w("div", { className: `${a}-line-slider`, ref: d }),
|
|
171
171
|
/* @__PURE__ */ w(
|
|
172
172
|
vt.Provider,
|
|
173
173
|
{
|
|
174
174
|
value: {
|
|
175
175
|
direction: y,
|
|
176
176
|
currentLink: o,
|
|
177
|
-
addLink:
|
|
178
|
-
removeLink:
|
|
177
|
+
addLink: B,
|
|
178
|
+
removeLink: ft,
|
|
179
179
|
onLinkClick: ut
|
|
180
180
|
},
|
|
181
|
-
children: /* @__PURE__ */ w("div", { className: `${
|
|
181
|
+
children: /* @__PURE__ */ w("div", { className: `${a}-list`, children: rt })
|
|
182
182
|
}
|
|
183
183
|
)
|
|
184
184
|
] });
|
|
@@ -188,14 +188,14 @@ function Ht(q, G) {
|
|
|
188
188
|
offsetTop: nt,
|
|
189
189
|
offsetBottom: et,
|
|
190
190
|
style: tt,
|
|
191
|
-
target:
|
|
192
|
-
children:
|
|
191
|
+
target: at,
|
|
192
|
+
children: W
|
|
193
193
|
}
|
|
194
|
-
) :
|
|
194
|
+
) : W;
|
|
195
195
|
}
|
|
196
|
-
const Ot = ht(Ht),
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
const Ot = ht(Ht), q = Ot;
|
|
197
|
+
q.displayName = "Anchor";
|
|
198
|
+
q.Link = bt;
|
|
199
199
|
export {
|
|
200
|
-
|
|
200
|
+
q as default
|
|
201
201
|
};
|