@unicom-cloud/ui 0.8.81 → 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 +2 -2
- 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/SpeechSynthesis.js +1 -1
- package/Spin.js +1 -1
- package/Statistic.js +2 -2
- 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/anchor/util.js +1 -1
- package/auto-complete/index.js +2 -2
- package/avatar/Avatar.js +31 -31
- package/avatar/Group.js +25 -25
- package/back-top/index.js +30 -30
- 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/{BNevupAU.js → uKZyjtff.js} +5 -4
- package/chunk/{DLBfXSnU.js → w221i0nK.js} +2872 -2871
- 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 +410 -408
- 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/speech-synthesis/index.js +1 -1
- package/spin/DotLoading.js +10 -10
- package/spin/index.js +44 -44
- package/statistic/Countdown.js +34 -34
- package/statistic/index.js +67 -67
- package/steps/index.js +55 -55
- package/style.css +1 -1
- package/switch/index.js +54 -54
- package/table/Table.js +3 -3
- 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/time-picker/util.js +5 -5
- 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 +9 -8
- 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 +13 -13
- package/utils/names.js +1 -1
- package/utils/setPrimaryColor.js +18 -13
- package/utils/tween.js +1 -1
- 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
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
var ht = Object.defineProperty;
|
|
2
2
|
var vt = (a, t, o) => t in a ? ht(a, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : a[t] = o;
|
|
3
|
-
var
|
|
3
|
+
var ke = (a, t, o) => vt(a, typeof t != "symbol" ? t + "" : t, o);
|
|
4
4
|
import { jsx as s, jsxs as M } from "react/jsx-runtime";
|
|
5
5
|
import xe from "@unicom-cloud/icons/IconUiClose";
|
|
6
6
|
import bt from "@unicom-cloud/icons/IconUiCopy";
|
|
7
7
|
import yt from "@unicom-cloud/icons/IconUiFullscreen";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
8
|
+
import kt from "@unicom-cloud/icons/IconUiLeft";
|
|
9
|
+
import xt from "@unicom-cloud/icons/IconUiLoading";
|
|
10
|
+
import It from "@unicom-cloud/icons/IconUiOriginalSize";
|
|
11
|
+
import Ct from "@unicom-cloud/icons/IconUiRight";
|
|
12
12
|
import St from "@unicom-cloud/icons/IconUiRotateLeft";
|
|
13
13
|
import wt from "@unicom-cloud/icons/IconUiRotateRight";
|
|
14
14
|
import Pt from "@unicom-cloud/icons/IconUiZoomIn";
|
|
15
15
|
import Lt from "@unicom-cloud/icons/IconUiZoomOut";
|
|
16
16
|
import Nt from "lodash/isUndefined";
|
|
17
|
-
import { useState as
|
|
18
|
-
import { a as Tt, b as Et } from "./
|
|
17
|
+
import { useState as h, forwardRef as zt, useContext as Ie, useRef as x, useMemo as Ce, useImperativeHandle as At, useCallback as Mt, useEffect as b } from "react";
|
|
18
|
+
import { a as Tt, b as Et } from "./Cplu5dtQ.js";
|
|
19
19
|
import "lodash/isEqualWith";
|
|
20
20
|
import { u as Ot } from "./CXPOj2uy.js";
|
|
21
21
|
import "./ClM74To2.js";
|
|
22
22
|
import { ArrowDown as $t, ArrowUp as Ut, ArrowLeft as Rt, ArrowRight as Yt, Esc as Dt } from "@unicom-cloud/utils/constant/keyboardCode";
|
|
23
23
|
import "lodash/isNumber";
|
|
24
24
|
import "lodash/merge";
|
|
25
|
-
import { isServerRendering as Xt, on as
|
|
25
|
+
import { isServerRendering as Xt, on as Q, off as ee } from "../utils/dom.js";
|
|
26
26
|
import "./B4WG1mhs.js";
|
|
27
27
|
import { u as Vt } from "./BFTV6myl.js";
|
|
28
28
|
import { u as Bt } from "./DU1RCDfh.js";
|
|
@@ -31,8 +31,8 @@ import "@unicom-cloud/utils/constant";
|
|
|
31
31
|
import { u as Wt } from "./a3hR6zLw.js";
|
|
32
32
|
import "lodash/debounce";
|
|
33
33
|
import Zt from "../portal/index.js";
|
|
34
|
-
import { P as
|
|
35
|
-
import
|
|
34
|
+
import { P as Se } from "./NPajzdOv.js";
|
|
35
|
+
import we from "@unicom-cloud/utils/class-name";
|
|
36
36
|
import jt from "@unicom-cloud/utils/clipboard-copy";
|
|
37
37
|
import { r as Ht } from "./CIRG541s.js";
|
|
38
38
|
import Gt from "../image/ImagePreviewArrow.js";
|
|
@@ -40,10 +40,10 @@ import _t from "../image/ImagePreviewToolbar.js";
|
|
|
40
40
|
import { PreviewGroupContext as qt } from "../image/previewGroupContext.js";
|
|
41
41
|
import Kt from "lodash/isArray";
|
|
42
42
|
function Jt(a, t, o, n, i) {
|
|
43
|
-
let
|
|
44
|
-
return o && (a.width > t.width ?
|
|
43
|
+
let f = o, u = n;
|
|
44
|
+
return o && (a.width > t.width ? f = 0 : (t.left > a.left && (f -= Math.abs(a.left - t.left) / i), t.right < a.right && (f += Math.abs(a.right - t.right) / i))), n && (a.height > t.height ? u = 0 : (t.top > a.top && (u -= Math.abs(a.top - t.top) / i), t.bottom < a.bottom && (u += Math.abs(a.bottom - t.bottom) / i))), [f, u];
|
|
45
45
|
}
|
|
46
|
-
const
|
|
46
|
+
const Pe = [
|
|
47
47
|
25,
|
|
48
48
|
33,
|
|
49
49
|
50,
|
|
@@ -64,7 +64,7 @@ const we = [
|
|
|
64
64
|
];
|
|
65
65
|
class Qt {
|
|
66
66
|
constructor(t) {
|
|
67
|
-
|
|
67
|
+
ke(this, "scaleAttr");
|
|
68
68
|
this.updateScale(t);
|
|
69
69
|
}
|
|
70
70
|
get scales() {
|
|
@@ -77,10 +77,10 @@ class Qt {
|
|
|
77
77
|
return this.scaleAttr[this.scaleAttr.length - 1];
|
|
78
78
|
}
|
|
79
79
|
updateScale(t) {
|
|
80
|
-
let o =
|
|
80
|
+
let o = Pe;
|
|
81
81
|
if (Kt(t) && t.filter((n) => n > 0).length && (o = t.filter((n) => n > 0)), o = o.map((n) => +(n / 100).toFixed(2)), !o.includes(1)) {
|
|
82
|
-
const n = this.findClosestIndex(1, o),
|
|
83
|
-
o.splice(
|
|
82
|
+
const n = this.findClosestIndex(1, o), f = o[n] < 1 ? n + 1 : n;
|
|
83
|
+
o.splice(f, 0, 1);
|
|
84
84
|
}
|
|
85
85
|
this.scaleAttr = o;
|
|
86
86
|
}
|
|
@@ -91,14 +91,14 @@ class Qt {
|
|
|
91
91
|
return 0;
|
|
92
92
|
let n = o.length - 1;
|
|
93
93
|
for (let i = 0; i < o.length; i++) {
|
|
94
|
-
const
|
|
95
|
-
if (t ===
|
|
94
|
+
const f = o[i];
|
|
95
|
+
if (t === f) {
|
|
96
96
|
n = i;
|
|
97
97
|
break;
|
|
98
98
|
}
|
|
99
|
-
if (t <
|
|
100
|
-
const
|
|
101
|
-
n =
|
|
99
|
+
if (t < f) {
|
|
100
|
+
const u = o[i - 1];
|
|
101
|
+
n = u === void 0 || Math.abs(u - t) <= Math.abs(f - t) ? i - 1 : i;
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -110,7 +110,7 @@ class Qt {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
function eo(a) {
|
|
113
|
-
const [t, o] =
|
|
113
|
+
const [t, o] = h(a);
|
|
114
114
|
return {
|
|
115
115
|
status: t,
|
|
116
116
|
isBeforeLoad: t === "beforeLoad",
|
|
@@ -121,7 +121,7 @@ function eo(a) {
|
|
|
121
121
|
setStatus: o
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
|
-
const
|
|
124
|
+
const te = 90, to = {
|
|
125
125
|
maskClosable: !0,
|
|
126
126
|
closable: !0,
|
|
127
127
|
breakPoint: 316,
|
|
@@ -142,7 +142,7 @@ const ee = 90, to = {
|
|
|
142
142
|
],
|
|
143
143
|
getPopupContainer: () => document.body,
|
|
144
144
|
escToExit: !0,
|
|
145
|
-
scales:
|
|
145
|
+
scales: Pe,
|
|
146
146
|
resetTranslate: !0
|
|
147
147
|
};
|
|
148
148
|
function oo(a, t) {
|
|
@@ -150,241 +150,241 @@ function oo(a, t) {
|
|
|
150
150
|
previewGroup: o,
|
|
151
151
|
previewUrlMap: n,
|
|
152
152
|
currentIndex: i,
|
|
153
|
-
setCurrentIndex:
|
|
154
|
-
infinite:
|
|
155
|
-
previewPropsMap:
|
|
156
|
-
} =
|
|
153
|
+
setCurrentIndex: f,
|
|
154
|
+
infinite: u,
|
|
155
|
+
previewPropsMap: oe
|
|
156
|
+
} = Ie(qt), Le = o ? oe.get(i) : {}, T = Vt(
|
|
157
157
|
a,
|
|
158
158
|
to,
|
|
159
|
-
|
|
159
|
+
Le
|
|
160
160
|
), {
|
|
161
|
-
className:
|
|
162
|
-
style:
|
|
163
|
-
src:
|
|
164
|
-
defaultVisible:
|
|
165
|
-
maskClosable:
|
|
166
|
-
closable:
|
|
167
|
-
breakPoint:
|
|
168
|
-
actions:
|
|
169
|
-
actionsLayout:
|
|
161
|
+
className: Ne,
|
|
162
|
+
style: ze,
|
|
163
|
+
src: Ae,
|
|
164
|
+
defaultVisible: Me,
|
|
165
|
+
maskClosable: Te,
|
|
166
|
+
closable: Ee,
|
|
167
|
+
breakPoint: Oe,
|
|
168
|
+
actions: $e,
|
|
169
|
+
actionsLayout: Ue,
|
|
170
170
|
getPopupContainer: S,
|
|
171
171
|
onVisibleChange: E,
|
|
172
172
|
scales: O,
|
|
173
|
-
escToExit:
|
|
174
|
-
imgAttributes:
|
|
173
|
+
escToExit: ne,
|
|
174
|
+
imgAttributes: Re = {},
|
|
175
175
|
imageRender: $,
|
|
176
|
-
extra:
|
|
177
|
-
resetTranslate:
|
|
178
|
-
} = T, w = o ? n.get(i) :
|
|
179
|
-
defaultValue:
|
|
176
|
+
extra: Ye = null,
|
|
177
|
+
resetTranslate: re
|
|
178
|
+
} = T, w = o ? n.get(i) : Ae, [U, De] = h(w), [m, Xe] = Ot(!1, {
|
|
179
|
+
defaultValue: Me,
|
|
180
180
|
value: T.visible
|
|
181
|
-
}),
|
|
182
|
-
|
|
181
|
+
}), ie = Ie(Tt), { getPrefixCls: R, locale: l, rtl: Ve } = ie, se = R == null ? void 0 : R("image"), d = `${se}-preview`, Be = we(
|
|
182
|
+
d,
|
|
183
183
|
{
|
|
184
|
-
[`${
|
|
185
|
-
[`${
|
|
184
|
+
[`${d}-hide`]: !m,
|
|
185
|
+
[`${d}-rtl`]: Ve
|
|
186
186
|
},
|
|
187
|
-
|
|
188
|
-
), P = x(), Fe = x(),
|
|
187
|
+
Ne
|
|
188
|
+
), P = x(), Fe = x(), y = x(), ae = x(), Y = x(!1), C = x({
|
|
189
189
|
pageX: 0,
|
|
190
190
|
pageY: 0,
|
|
191
191
|
originX: 0,
|
|
192
192
|
originY: 0
|
|
193
|
-
}), { isLoading: We, isLoaded: Ze, setStatus:
|
|
194
|
-
onLoad:
|
|
195
|
-
onError:
|
|
196
|
-
onMouseDown:
|
|
193
|
+
}), { isLoading: We, isLoaded: Ze, setStatus: D } = eo("loading"), [je, He] = h(!1), [g, X] = h({ x: 0, y: 0 }), [c, V] = h(1), [ce, le] = h(!1), [L, B] = h(0), [v, me] = h(!1), k = Ce(() => new Qt(O), []), {
|
|
194
|
+
onLoad: F,
|
|
195
|
+
onError: W,
|
|
196
|
+
onMouseDown: Z,
|
|
197
197
|
style: Ge,
|
|
198
198
|
className: _e,
|
|
199
199
|
...qe
|
|
200
|
-
} =
|
|
201
|
-
function
|
|
202
|
-
|
|
200
|
+
} = Re, fe = !u && i <= 0, ue = !u && i >= n.size - 1;
|
|
201
|
+
function j() {
|
|
202
|
+
X({ x: 0, y: 0 }), V(1), B(0);
|
|
203
203
|
}
|
|
204
204
|
At(t, () => ({
|
|
205
|
-
reset:
|
|
206
|
-
getRootDOMNode: () =>
|
|
205
|
+
reset: j,
|
|
206
|
+
getRootDOMNode: () => ae.current
|
|
207
207
|
}));
|
|
208
|
-
const [N, Ke] =
|
|
209
|
-
|
|
208
|
+
const [N, Ke] = h(), de = Mt(() => N, [N]);
|
|
209
|
+
b(() => {
|
|
210
210
|
const e = S == null ? void 0 : S(), r = Ft(e) || document.body;
|
|
211
211
|
Ke(r);
|
|
212
|
-
}, [S]), Bt(
|
|
212
|
+
}, [S]), Bt(de, { hidden: m });
|
|
213
213
|
const Je = Ce(
|
|
214
214
|
() => !Xt && N === document.body,
|
|
215
215
|
[N]
|
|
216
216
|
);
|
|
217
|
-
function
|
|
217
|
+
function pe(e) {
|
|
218
218
|
const r = n.size;
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
function j() {
|
|
222
|
-
de(i - 1);
|
|
219
|
+
u && (e %= r, e < 0 && (e = r - Math.abs(e))), e !== i && e >= 0 && e <= r - 1 && f(e);
|
|
223
220
|
}
|
|
224
221
|
function H() {
|
|
225
|
-
|
|
222
|
+
pe(i - 1);
|
|
223
|
+
}
|
|
224
|
+
function G() {
|
|
225
|
+
pe(i + 1);
|
|
226
226
|
}
|
|
227
227
|
function Qe() {
|
|
228
|
-
|
|
228
|
+
B(L === 0 ? 360 - te : L - te);
|
|
229
229
|
}
|
|
230
230
|
function et() {
|
|
231
|
-
|
|
231
|
+
B((L + te) % 360);
|
|
232
232
|
}
|
|
233
|
-
const
|
|
234
|
-
!
|
|
235
|
-
|
|
233
|
+
const _ = x(null), tt = () => {
|
|
234
|
+
!ce && le(!0), _.current && clearTimeout(_.current), _.current = setTimeout(() => {
|
|
235
|
+
le(!1);
|
|
236
236
|
}, 1e3);
|
|
237
237
|
}, z = (e) => {
|
|
238
|
-
c !== e && (
|
|
238
|
+
c !== e && (V(e), tt());
|
|
239
239
|
};
|
|
240
|
-
function
|
|
241
|
-
const e =
|
|
240
|
+
function q() {
|
|
241
|
+
const e = k.getNextScale(c, "zoomIn");
|
|
242
242
|
z(e);
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
const e =
|
|
244
|
+
function K() {
|
|
245
|
+
const e = k.getNextScale(c, "zoomOut");
|
|
246
246
|
z(e);
|
|
247
247
|
}
|
|
248
248
|
function ot(e) {
|
|
249
|
-
e.deltaY > 0 ? c >=
|
|
249
|
+
e.deltaY > 0 ? c >= k.minScale && K() : c <= k.maxScale && q();
|
|
250
250
|
}
|
|
251
251
|
function nt() {
|
|
252
252
|
z(1);
|
|
253
253
|
}
|
|
254
254
|
function rt() {
|
|
255
|
-
const e =
|
|
256
|
-
z(
|
|
255
|
+
const e = y.current.getBoundingClientRect(), r = P.current.getBoundingClientRect(), p = e.height / (r.height / c), I = e.width / (r.width / c), J = Math.max(p, I);
|
|
256
|
+
z(J);
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
e.target === e.currentTarget &&
|
|
258
|
+
function ge(e) {
|
|
259
|
+
e.target === e.currentTarget && Te && A();
|
|
260
260
|
}
|
|
261
261
|
function it() {
|
|
262
262
|
jt(U);
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function he() {
|
|
265
265
|
A();
|
|
266
266
|
}
|
|
267
267
|
function st(e) {
|
|
268
268
|
A();
|
|
269
269
|
}
|
|
270
270
|
function A() {
|
|
271
|
-
|
|
271
|
+
m && (E == null || E(!1, m), Nt(T.visible) && Xe(!1));
|
|
272
272
|
}
|
|
273
273
|
function at(e) {
|
|
274
274
|
if (e && e.length) {
|
|
275
|
-
const
|
|
276
|
-
He(
|
|
275
|
+
const p = e[0].contentRect.width < Oe;
|
|
276
|
+
He(p);
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
const
|
|
280
|
-
if (!
|
|
279
|
+
const ve = () => {
|
|
280
|
+
if (!y.current || !P.current)
|
|
281
281
|
return;
|
|
282
|
-
const e =
|
|
282
|
+
const e = y.current.getBoundingClientRect(), r = P.current.getBoundingClientRect(), [p, I] = Jt(
|
|
283
283
|
e,
|
|
284
284
|
r,
|
|
285
|
-
|
|
286
|
-
|
|
285
|
+
g.x,
|
|
286
|
+
g.y,
|
|
287
287
|
c
|
|
288
288
|
);
|
|
289
|
-
(
|
|
290
|
-
x:
|
|
291
|
-
y:
|
|
289
|
+
(p !== g.x || I !== g.y) && X({
|
|
290
|
+
x: p,
|
|
291
|
+
y: I
|
|
292
292
|
});
|
|
293
|
-
},
|
|
293
|
+
}, be = (e) => {
|
|
294
294
|
var r;
|
|
295
|
-
if (
|
|
295
|
+
if (m && v) {
|
|
296
296
|
(r = e.preventDefault) == null || r.call(e);
|
|
297
|
-
const { originX:
|
|
298
|
-
|
|
297
|
+
const { originX: p, originY: I, pageX: J, pageY: dt } = C.current, pt = p + (e.pageX - J) / c, gt = I + (e.pageY - dt) / c;
|
|
298
|
+
X({
|
|
299
299
|
x: pt,
|
|
300
300
|
y: gt
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
|
-
},
|
|
303
|
+
}, ye = (e) => {
|
|
304
304
|
var r;
|
|
305
|
-
(r = e.preventDefault) == null || r.call(e),
|
|
305
|
+
(r = e.preventDefault) == null || r.call(e), me(!1);
|
|
306
306
|
};
|
|
307
307
|
function ct(e) {
|
|
308
|
-
|
|
308
|
+
D("loaded"), F == null || F(e);
|
|
309
309
|
}
|
|
310
310
|
function lt(e) {
|
|
311
|
-
|
|
311
|
+
D("error"), W == null || W(e);
|
|
312
312
|
}
|
|
313
313
|
const mt = (e) => {
|
|
314
|
-
var
|
|
315
|
-
(
|
|
314
|
+
var p;
|
|
315
|
+
(p = e.preventDefault) == null || p.call(e), me(!0);
|
|
316
316
|
const r = e.type === "touchstart" ? e.touches[0] : e;
|
|
317
|
-
|
|
317
|
+
C.current.pageX = r.pageX, C.current.pageY = r.pageY, C.current.originX = g.x, C.current.originY = g.y, Z == null || Z(e);
|
|
318
318
|
};
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}), [
|
|
322
|
-
|
|
323
|
-
}, [
|
|
324
|
-
|
|
325
|
-
}, [c]),
|
|
326
|
-
|
|
327
|
-
}, [
|
|
328
|
-
|
|
319
|
+
b(() => (m && v && (Q(document, "mousemove", be, !1), Q(document, "mouseup", ye, !1)), () => {
|
|
320
|
+
ee(document, "mousemove", be, !1), ee(document, "mouseup", ye, !1);
|
|
321
|
+
}), [m, v]), b(() => {
|
|
322
|
+
re && !v && ve();
|
|
323
|
+
}, [v, g]), b(() => {
|
|
324
|
+
re && ve();
|
|
325
|
+
}, [c]), b(() => {
|
|
326
|
+
m && j();
|
|
327
|
+
}, [m]), b(() => {
|
|
328
|
+
De(w), D(w ? "loading" : "loaded"), j();
|
|
329
329
|
}, [w]), Wt(() => {
|
|
330
|
-
|
|
331
|
-
}, [O]),
|
|
330
|
+
k.updateScale(O), V(1);
|
|
331
|
+
}, [O]), b(() => {
|
|
332
332
|
const e = (r) => {
|
|
333
333
|
if (r)
|
|
334
334
|
switch (r.key) {
|
|
335
335
|
case Dt.key:
|
|
336
|
-
|
|
336
|
+
ne && A();
|
|
337
337
|
break;
|
|
338
338
|
case Yt.key:
|
|
339
|
-
|
|
339
|
+
G();
|
|
340
340
|
break;
|
|
341
341
|
case Rt.key:
|
|
342
|
-
|
|
342
|
+
H();
|
|
343
343
|
break;
|
|
344
344
|
case Ut.key:
|
|
345
|
-
|
|
345
|
+
q();
|
|
346
346
|
break;
|
|
347
347
|
case $t.key:
|
|
348
|
-
|
|
348
|
+
K();
|
|
349
349
|
break;
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
|
-
return
|
|
353
|
-
|
|
352
|
+
return m && !v && !Y.current && (Y.current = !0, Q(document, "keydown", e)), () => {
|
|
353
|
+
Y.current = !1, ee(document, "keydown", e);
|
|
354
354
|
};
|
|
355
|
-
}, [
|
|
355
|
+
}, [m, ne, v, i, c]);
|
|
356
356
|
const ft = [
|
|
357
357
|
!1,
|
|
358
358
|
{
|
|
359
359
|
key: "rotateRight",
|
|
360
|
-
name:
|
|
360
|
+
name: l == null ? void 0 : l.ImagePreview.rotateRight,
|
|
361
361
|
content: /* @__PURE__ */ s(wt, {}),
|
|
362
362
|
onClick: et
|
|
363
363
|
},
|
|
364
364
|
{
|
|
365
365
|
key: "rotateLeft",
|
|
366
|
-
name:
|
|
366
|
+
name: l == null ? void 0 : l.ImagePreview.rotateLeft,
|
|
367
367
|
content: /* @__PURE__ */ s(St, {}),
|
|
368
368
|
onClick: Qe
|
|
369
369
|
},
|
|
370
370
|
{
|
|
371
371
|
key: "zoomIn",
|
|
372
|
-
name:
|
|
372
|
+
name: l == null ? void 0 : l.ImagePreview.zoomIn,
|
|
373
373
|
content: /* @__PURE__ */ s(Pt, {}),
|
|
374
|
-
onClick:
|
|
375
|
-
disabled: c ===
|
|
374
|
+
onClick: q,
|
|
375
|
+
disabled: c === k.maxScale
|
|
376
376
|
},
|
|
377
377
|
{
|
|
378
378
|
key: "zoomOut",
|
|
379
|
-
name:
|
|
379
|
+
name: l == null ? void 0 : l.ImagePreview.zoomOut,
|
|
380
380
|
content: /* @__PURE__ */ s(Lt, {}),
|
|
381
|
-
onClick:
|
|
382
|
-
disabled: c ===
|
|
381
|
+
onClick: K,
|
|
382
|
+
disabled: c === k.minScale
|
|
383
383
|
},
|
|
384
384
|
{
|
|
385
385
|
key: "originalSize",
|
|
386
|
-
name:
|
|
387
|
-
content: /* @__PURE__ */ s(
|
|
386
|
+
name: l == null ? void 0 : l.ImagePreview.originalSize,
|
|
387
|
+
content: /* @__PURE__ */ s(It, {}),
|
|
388
388
|
onClick: nt
|
|
389
389
|
},
|
|
390
390
|
{
|
|
@@ -396,16 +396,16 @@ function oo(a, t) {
|
|
|
396
396
|
!!o && {
|
|
397
397
|
key: "next",
|
|
398
398
|
name: "下一张",
|
|
399
|
-
content: /* @__PURE__ */ s(
|
|
400
|
-
disabled:
|
|
401
|
-
onClick:
|
|
399
|
+
content: /* @__PURE__ */ s(Ct, {}),
|
|
400
|
+
disabled: ue,
|
|
401
|
+
onClick: G
|
|
402
402
|
},
|
|
403
403
|
!!o && {
|
|
404
404
|
key: "prev",
|
|
405
405
|
name: "上一张",
|
|
406
|
-
content: /* @__PURE__ */ s(
|
|
407
|
-
disabled:
|
|
408
|
-
onClick:
|
|
406
|
+
content: /* @__PURE__ */ s(kt, {}),
|
|
407
|
+
disabled: fe,
|
|
408
|
+
onClick: H
|
|
409
409
|
},
|
|
410
410
|
{
|
|
411
411
|
key: "copy",
|
|
@@ -417,27 +417,27 @@ function oo(a, t) {
|
|
|
417
417
|
key: "close",
|
|
418
418
|
name: "关闭",
|
|
419
419
|
content: /* @__PURE__ */ s(xe, {}),
|
|
420
|
-
onClick:
|
|
420
|
+
onClick: he
|
|
421
421
|
}
|
|
422
422
|
].filter(Boolean);
|
|
423
|
-
|
|
424
|
-
const e = Ht([
|
|
423
|
+
b(() => {
|
|
424
|
+
const e = Ht([y.current], at);
|
|
425
425
|
return () => {
|
|
426
426
|
e();
|
|
427
427
|
};
|
|
428
|
-
}, [
|
|
428
|
+
}, [y.current]);
|
|
429
429
|
const ut = () => {
|
|
430
430
|
const e = /* @__PURE__ */ s(
|
|
431
431
|
"img",
|
|
432
432
|
{
|
|
433
433
|
onWheel: ot,
|
|
434
434
|
ref: P,
|
|
435
|
-
className:
|
|
436
|
-
[`${
|
|
435
|
+
className: we(_e, `${d}-img`, {
|
|
436
|
+
[`${d}-img-moving`]: v
|
|
437
437
|
}),
|
|
438
438
|
style: {
|
|
439
439
|
...Ge,
|
|
440
|
-
transform: `translate(${
|
|
440
|
+
transform: `translate(${g.x}px, ${g.y}px) rotate(${L}deg)`
|
|
441
441
|
},
|
|
442
442
|
src: U,
|
|
443
443
|
...qe,
|
|
@@ -451,26 +451,26 @@ function oo(a, t) {
|
|
|
451
451
|
);
|
|
452
452
|
return ($ == null ? void 0 : $(e)) ?? e;
|
|
453
453
|
};
|
|
454
|
-
return /* @__PURE__ */ s(Zt, { visible:
|
|
454
|
+
return /* @__PURE__ */ s(Zt, { visible: m, forceRender: !1, getContainer: de, children: /* @__PURE__ */ s(
|
|
455
455
|
Et,
|
|
456
456
|
{
|
|
457
|
-
...
|
|
457
|
+
...ie,
|
|
458
458
|
childrenName: "ImagePreview",
|
|
459
|
-
getPopupContainer: () =>
|
|
459
|
+
getPopupContainer: () => y.current,
|
|
460
460
|
children: /* @__PURE__ */ M(
|
|
461
461
|
"div",
|
|
462
462
|
{
|
|
463
463
|
className: Be,
|
|
464
464
|
style: {
|
|
465
|
-
...
|
|
465
|
+
...ze || {},
|
|
466
466
|
...Je ? {} : { zIndex: "inherit", position: "absolute" }
|
|
467
467
|
},
|
|
468
|
-
ref:
|
|
468
|
+
ref: ae,
|
|
469
469
|
children: [
|
|
470
470
|
/* @__PURE__ */ s(
|
|
471
|
-
|
|
471
|
+
Se,
|
|
472
472
|
{
|
|
473
|
-
in:
|
|
473
|
+
in: m,
|
|
474
474
|
timeout: 400,
|
|
475
475
|
appear: !0,
|
|
476
476
|
classNames: "fadeImage",
|
|
@@ -482,38 +482,38 @@ function oo(a, t) {
|
|
|
482
482
|
onExited: (e) => {
|
|
483
483
|
e && (e.parentNode.style.display = "", e.style.display = "none");
|
|
484
484
|
},
|
|
485
|
-
children: /* @__PURE__ */ s("div", { className: `${
|
|
485
|
+
children: /* @__PURE__ */ s("div", { className: `${d}-mask`, onClick: st })
|
|
486
486
|
}
|
|
487
487
|
),
|
|
488
|
-
|
|
488
|
+
m && /* @__PURE__ */ M(
|
|
489
489
|
"div",
|
|
490
490
|
{
|
|
491
|
-
ref:
|
|
492
|
-
className: `${
|
|
493
|
-
onClick:
|
|
491
|
+
ref: y,
|
|
492
|
+
className: `${d}-wrapper`,
|
|
493
|
+
onClick: ge,
|
|
494
494
|
children: [
|
|
495
495
|
/* @__PURE__ */ M(
|
|
496
496
|
"div",
|
|
497
497
|
{
|
|
498
498
|
ref: Fe,
|
|
499
|
-
className: `${
|
|
499
|
+
className: `${d}-img-container`,
|
|
500
500
|
style: { transform: `scale(${c}, ${c})` },
|
|
501
|
-
onClick:
|
|
501
|
+
onClick: ge,
|
|
502
502
|
children: [
|
|
503
503
|
ut(),
|
|
504
|
-
We && /* @__PURE__ */ s("div", { className: `${
|
|
504
|
+
We && /* @__PURE__ */ s("div", { className: `${d}-loading`, children: /* @__PURE__ */ s(xt, {}) })
|
|
505
505
|
]
|
|
506
506
|
}
|
|
507
507
|
),
|
|
508
508
|
/* @__PURE__ */ s(
|
|
509
|
-
|
|
509
|
+
Se,
|
|
510
510
|
{
|
|
511
|
-
in:
|
|
511
|
+
in: ce,
|
|
512
512
|
timeout: 400,
|
|
513
513
|
appear: !0,
|
|
514
514
|
classNames: "fadeImage",
|
|
515
515
|
unmountOnExit: !0,
|
|
516
|
-
children: /* @__PURE__ */ M("div", { className: `${
|
|
516
|
+
children: /* @__PURE__ */ M("div", { className: `${d}-scale-value`, children: [
|
|
517
517
|
(c * 100).toFixed(0),
|
|
518
518
|
"%"
|
|
519
519
|
] })
|
|
@@ -522,19 +522,19 @@ function oo(a, t) {
|
|
|
522
522
|
Ze && /* @__PURE__ */ s(
|
|
523
523
|
_t,
|
|
524
524
|
{
|
|
525
|
-
prefixCls:
|
|
526
|
-
previewPrefixCls:
|
|
527
|
-
actions:
|
|
528
|
-
actionsLayout:
|
|
525
|
+
prefixCls: se,
|
|
526
|
+
previewPrefixCls: d,
|
|
527
|
+
actions: $e,
|
|
528
|
+
actionsLayout: Ue,
|
|
529
529
|
defaultActions: ft,
|
|
530
530
|
simple: je
|
|
531
531
|
}
|
|
532
532
|
),
|
|
533
|
-
|
|
533
|
+
Ee && /* @__PURE__ */ s(
|
|
534
534
|
"div",
|
|
535
535
|
{
|
|
536
|
-
className: `${
|
|
537
|
-
onClick:
|
|
536
|
+
className: `${d}-close-btn`,
|
|
537
|
+
onClick: he,
|
|
538
538
|
children: /* @__PURE__ */ s(xe, {})
|
|
539
539
|
}
|
|
540
540
|
),
|
|
@@ -543,14 +543,14 @@ function oo(a, t) {
|
|
|
543
543
|
{
|
|
544
544
|
previewCount: n.size,
|
|
545
545
|
current: i,
|
|
546
|
-
infinite:
|
|
547
|
-
disableLeft:
|
|
548
|
-
disableRight:
|
|
549
|
-
onPrev:
|
|
550
|
-
onNext:
|
|
546
|
+
infinite: u,
|
|
547
|
+
disableLeft: fe,
|
|
548
|
+
disableRight: ue,
|
|
549
|
+
onPrev: H,
|
|
550
|
+
onNext: G
|
|
551
551
|
}
|
|
552
552
|
),
|
|
553
|
-
|
|
553
|
+
Ye
|
|
554
554
|
]
|
|
555
555
|
}
|
|
556
556
|
)
|