@rockshin/tao-ui 0.0.48 → 0.0.51
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/dist/components/affix/affix.js +20 -16
- package/dist/components/alert/alert.js +114 -99
- package/dist/components/app/app-modals.js +134 -96
- package/dist/components/app/app-notices.js +39 -23
- package/dist/components/auto-complete/auto-complete.js +21 -7
- package/dist/components/avatar/avatar.js +31 -11
- package/dist/components/badge/badge.css +1 -1
- package/dist/components/badge/badge.js +72 -257
- package/dist/components/border-beam/border-beam.js +21 -17
- package/dist/components/breadcrumb/breadcrumb.js +178 -159
- package/dist/components/button/button.css +9 -1
- package/dist/components/button/button.js +61 -53
- package/dist/components/calendar/calendar.js +6 -4
- package/dist/components/card/card.js +24 -8
- package/dist/components/carousel/carousel.d.ts +1 -1
- package/dist/components/carousel/carousel.js +105 -68
- package/dist/components/cascader/cascader.js +54 -19
- package/dist/components/checkbox/checkbox.css +13 -2
- package/dist/components/checkbox/checkbox.d.ts +2 -0
- package/dist/components/checkbox/checkbox.js +320 -229
- package/dist/components/collapse/collapse-panels.d.ts +1 -1
- package/dist/components/collapse/collapse-panels.js +122 -113
- package/dist/components/collapse/collapse.js +98 -63
- package/dist/components/color-picker/color-picker.js +539 -441
- package/dist/components/color-picker/color.js +1 -1
- package/dist/components/context-menu/context-menu.d.ts +1 -1
- package/dist/components/context-menu/context-menu.js +108 -68
- package/dist/components/date-picker/calendar/calendar-grid.js +42 -39
- package/dist/components/date-picker/calendar/month-grid.d.ts +8 -1
- package/dist/components/date-picker/calendar/month-grid.js +79 -37
- package/dist/components/date-picker/calendar/time-panel.d.ts +2 -1
- package/dist/components/date-picker/calendar/time-panel.js +94 -89
- package/dist/components/date-picker/calendar/year-grid.d.ts +8 -1
- package/dist/components/date-picker/calendar/year-grid.js +66 -35
- package/dist/components/date-picker/date-picker.css +24 -1
- package/dist/components/date-picker/date-picker.js +99 -53
- package/dist/components/date-picker/presets.d.ts +2 -1
- package/dist/components/date-picker/presets.js +27 -24
- package/dist/components/date-picker/range-picker.js +308 -153
- package/dist/components/descriptions/descriptions.js +7 -3
- package/dist/components/divider/divider.css +1 -1
- package/dist/components/divider/divider.js +1 -1
- package/dist/components/drawer/drawer.js +201 -369
- package/dist/components/dropdown/dropdown.d.ts +1 -1
- package/dist/components/dropdown/dropdown.js +183 -279
- package/dist/components/empty/empty.js +57 -78
- package/dist/components/float-button/float-button.d.ts +1 -0
- package/dist/components/float-button/float-button.js +47 -30
- package/dist/components/form/field-control.d.ts +4 -2
- package/dist/components/form/field-control.js +17 -9
- package/dist/components/form/form-context.d.ts +8 -2
- package/dist/components/form/form-context.js +2 -1
- package/dist/components/form/form-item.js +85 -63
- package/dist/components/form/use-form.d.ts +2 -1
- package/dist/components/form/use-form.js +2 -1
- package/dist/components/form-field/form-field-view.d.ts +3 -1
- package/dist/components/form-field/form-field-view.js +194 -141
- package/dist/components/form-section/form-section.d.ts +1 -1
- package/dist/components/form-section/form-section.js +52 -45
- package/dist/components/image/image.js +585 -477
- package/dist/components/input/base-input.js +8 -9
- package/dist/components/input/input-shared.d.ts +5 -2
- package/dist/components/input/input-shared.js +42 -18
- package/dist/components/input/input.css +1 -0
- package/dist/components/input/otp.js +236 -217
- package/dist/components/input/password.js +2 -1
- package/dist/components/input/search.js +8 -7
- package/dist/components/list/list-pagination.js +41 -36
- package/dist/components/list/list.js +141 -125
- package/dist/components/listy/listy.js +175 -106
- package/dist/components/masonry/masonry.js +108 -85
- package/dist/components/mentions/mentions.js +12 -3
- package/dist/components/menu/menu-render.d.ts +9 -3
- package/dist/components/menu/menu-render.js +99 -36
- package/dist/components/modal/confirm-dialog.js +10 -4
- package/dist/components/modal/confirm.js +3 -7
- package/dist/components/modal/index.js +9 -3
- package/dist/components/modal/modal.js +390 -365
- package/dist/components/pagination/pagination.js +105 -96
- package/dist/components/popconfirm/popconfirm.d.ts +1 -1
- package/dist/components/popconfirm/popconfirm.js +219 -168
- package/dist/components/popover/popover.js +330 -243
- package/dist/components/progress/progress.css +2 -2
- package/dist/components/progress/progress.js +232 -458
- package/dist/components/qr-code/qr-code.js +72 -66
- package/dist/components/radio/radio.css +15 -4
- package/dist/components/radio/radio.d.ts +2 -1
- package/dist/components/radio/radio.js +260 -198
- package/dist/components/rate/rate.js +173 -113
- package/dist/components/scroll-area/scroll-area.js +241 -211
- package/dist/components/segmented/segmented.js +73 -41
- package/dist/components/select/mobile-select.d.ts +2 -1
- package/dist/components/select/mobile-select.js +24 -13
- package/dist/components/select/select-searchable-list.d.ts +2 -1
- package/dist/components/select/select-searchable-list.js +2 -3
- package/dist/components/select/select.css +3 -2
- package/dist/components/select/select.js +49 -25
- package/dist/components/select/use-select-selection.d.ts +1 -1
- package/dist/components/select/use-select-selection.js +7 -4
- package/dist/components/skeleton/skeleton.js +56 -48
- package/dist/components/slider/slider.js +87 -212
- package/dist/components/sonner/sonner.js +109 -93
- package/dist/components/spinner/spinner.js +147 -138
- package/dist/components/splitter/splitter.js +222 -159
- package/dist/components/statistic/statistic.js +7 -6
- package/dist/components/steps/steps.js +88 -81
- package/dist/components/steps/use-display-steps.js +1 -1
- package/dist/components/switch/switch.js +89 -89
- package/dist/components/table/table-filter.js +66 -56
- package/dist/components/table/table-icons.d.ts +2 -1
- package/dist/components/table/table-icons.js +11 -9
- package/dist/components/table/table-model.js +1 -1
- package/dist/components/table/table.js +107 -83
- package/dist/components/table/use-table-data.d.ts +6 -3
- package/dist/components/table/use-table-data.js +166 -130
- package/dist/components/tabs/tabs.css +1 -1
- package/dist/components/tabs/tabs.js +236 -179
- package/dist/components/tag/tag.d.ts +2 -2
- package/dist/components/tag/tag.js +111 -108
- package/dist/components/textarea/textarea.js +22 -17
- package/dist/components/time-picker/time-picker.js +5 -3
- package/dist/components/timeline/timeline.css +6 -1
- package/dist/components/timeline/timeline.js +21 -11
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/components/tooltip/tooltip.js +123 -233
- package/dist/components/tour/tour.css +4 -0
- package/dist/components/tour/tour.js +400 -331
- package/dist/components/transfer/transfer-list.js +31 -12
- package/dist/components/transfer/transfer-parts.js +1 -1
- package/dist/components/transfer/transfer-types.d.ts +1 -0
- package/dist/components/transfer/transfer.css +5 -0
- package/dist/components/transfer/transfer.js +29 -14
- package/dist/components/tree/tree-keyboard.d.ts +1 -1
- package/dist/components/tree/tree-keyboard.js +5 -3
- package/dist/components/tree/tree.js +74 -59
- package/dist/components/tree-select/select-engine.d.ts +3 -2
- package/dist/components/tree-select/select-engine.js +18 -16
- package/dist/components/tree-select/tree-select.js +21 -5
- package/dist/components/upload/upload.css +8 -0
- package/dist/components/upload/upload.js +160 -72
- package/dist/components/watermark/watermark.js +36 -29
- package/dist/number-input/use-number-input.js +129 -90
- package/dist/number-input/validate.js +32 -5
- package/dist/provider/merge-locale.js +12 -9
- package/dist/provider/tao-provider.d.ts +3 -1
- package/dist/provider/tao-provider.js +123 -86
- package/package.json +4 -3
|
@@ -1,94 +1,119 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
import _rc_component_image from "@rc-component/image";
|
|
4
|
-
import { Children, cloneElement, isValidElement, useEffect, useRef } from "react";
|
|
4
|
+
import { Children, cloneElement, createContext, isValidElement, useContext, useEffect, useRef, useState } from "react";
|
|
5
5
|
import { useTaoInternalConfig } from "../../provider/tao-provider.js";
|
|
6
6
|
import { cx } from "../../utils/semantic.js";
|
|
7
7
|
import { ImageControlIcon } from "./image-icons.js";
|
|
8
8
|
import "./image.css";
|
|
9
9
|
import { interopDefault } from "../../utils/interop-default.js";
|
|
10
10
|
const RcImageComponent = /*#__PURE__*/ interopDefault(_rc_component_image);
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const PreviewDisabledContext = /*#__PURE__*/ createContext(false);
|
|
12
|
+
function usePreviewContainer(getContainer, allowCreate, disabled) {
|
|
13
|
+
const $ = c(17);
|
|
13
14
|
const { tokenStyle, mode, compact } = useTaoInternalConfig();
|
|
15
|
+
const containerRef = useRef(null);
|
|
14
16
|
let t0;
|
|
15
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
16
|
-
t0 = [];
|
|
17
|
-
$[0] = t0;
|
|
18
|
-
} else t0 = $[0];
|
|
19
|
-
const containers = useRef(t0);
|
|
20
17
|
let t1;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
18
|
+
if ($[0] !== compact || $[1] !== mode || $[2] !== tokenStyle) {
|
|
19
|
+
t0 = ()=>{
|
|
20
|
+
const container = containerRef.current;
|
|
21
|
+
if (!container) return;
|
|
22
|
+
if ("light" === mode) delete container.dataset.taoTheme;
|
|
23
|
+
else container.dataset.taoTheme = mode;
|
|
24
|
+
if (compact) container.dataset.taoDensity = "compact";
|
|
25
|
+
else delete container.dataset.taoDensity;
|
|
26
|
+
container.removeAttribute("style");
|
|
27
|
+
for (const [key, value] of Object.entries(tokenStyle ?? {}))container.style.setProperty(key, String(value));
|
|
32
28
|
};
|
|
33
|
-
|
|
29
|
+
t1 = [
|
|
34
30
|
tokenStyle,
|
|
35
31
|
mode,
|
|
36
32
|
compact
|
|
37
33
|
];
|
|
38
|
-
$[
|
|
39
|
-
$[
|
|
40
|
-
$[
|
|
34
|
+
$[0] = compact;
|
|
35
|
+
$[1] = mode;
|
|
36
|
+
$[2] = tokenStyle;
|
|
37
|
+
$[3] = t0;
|
|
41
38
|
$[4] = t1;
|
|
42
|
-
$[5] = t2;
|
|
43
39
|
} else {
|
|
40
|
+
t0 = $[3];
|
|
44
41
|
t1 = $[4];
|
|
45
|
-
t2 = $[5];
|
|
46
42
|
}
|
|
47
|
-
useEffect(
|
|
43
|
+
useEffect(t0, t1);
|
|
44
|
+
let t2;
|
|
48
45
|
let t3;
|
|
46
|
+
if ($[5] !== disabled || $[6] !== getContainer) {
|
|
47
|
+
t2 = ()=>{
|
|
48
|
+
if (!disabled && false !== getContainer) return;
|
|
49
|
+
containerRef.current?.remove();
|
|
50
|
+
containerRef.current = null;
|
|
51
|
+
};
|
|
52
|
+
t3 = [
|
|
53
|
+
disabled,
|
|
54
|
+
getContainer
|
|
55
|
+
];
|
|
56
|
+
$[5] = disabled;
|
|
57
|
+
$[6] = getContainer;
|
|
58
|
+
$[7] = t2;
|
|
59
|
+
$[8] = t3;
|
|
60
|
+
} else {
|
|
61
|
+
t2 = $[7];
|
|
62
|
+
t3 = $[8];
|
|
63
|
+
}
|
|
64
|
+
useEffect(t2, t3);
|
|
49
65
|
let t4;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
66
|
+
let t5;
|
|
67
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
68
|
+
t4 = ()=>()=>{
|
|
69
|
+
containerRef.current?.remove();
|
|
70
|
+
containerRef.current = null;
|
|
54
71
|
};
|
|
55
|
-
|
|
56
|
-
$[
|
|
57
|
-
$[
|
|
72
|
+
t5 = [];
|
|
73
|
+
$[9] = t4;
|
|
74
|
+
$[10] = t5;
|
|
58
75
|
} else {
|
|
59
|
-
|
|
60
|
-
|
|
76
|
+
t4 = $[9];
|
|
77
|
+
t5 = $[10];
|
|
61
78
|
}
|
|
62
|
-
useEffect(
|
|
79
|
+
useEffect(t4, t5);
|
|
80
|
+
if (disabled) return;
|
|
63
81
|
if (false === getContainer) return false;
|
|
64
|
-
let
|
|
65
|
-
if ($[
|
|
66
|
-
|
|
82
|
+
let t6;
|
|
83
|
+
if ($[11] !== allowCreate || $[12] !== compact || $[13] !== getContainer || $[14] !== mode || $[15] !== tokenStyle) {
|
|
84
|
+
t6 = ()=>{
|
|
85
|
+
if (!allowCreate && !containerRef.current) return null;
|
|
67
86
|
const target = "function" == typeof getContainer ? getContainer() : "string" == typeof getContainer ? document.querySelector(getContainer) : getContainer ?? document.body;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
87
|
+
const previous = containerRef.current;
|
|
88
|
+
if (previous && previous.parentNode === target) return previous;
|
|
89
|
+
if (previous) queueMicrotask(()=>previous.remove());
|
|
90
|
+
if (!target) {
|
|
91
|
+
containerRef.current = null;
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
const container_0 = target.ownerDocument.createElement("div");
|
|
95
|
+
container_0.dataset.taoImagePopup = "";
|
|
96
|
+
container_0.dataset.taoProvider = "";
|
|
97
|
+
if ("light" !== mode) container_0.dataset.taoTheme = mode;
|
|
98
|
+
if (compact) container_0.dataset.taoDensity = "compact";
|
|
99
|
+
for (const [key_0, value_0] of Object.entries(tokenStyle ?? {}))container_0.style.setProperty(key_0, String(value_0));
|
|
100
|
+
target.appendChild(container_0);
|
|
101
|
+
containerRef.current = container_0;
|
|
102
|
+
return container_0;
|
|
80
103
|
};
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
|
|
87
|
-
|
|
104
|
+
$[11] = allowCreate;
|
|
105
|
+
$[12] = compact;
|
|
106
|
+
$[13] = getContainer;
|
|
107
|
+
$[14] = mode;
|
|
108
|
+
$[15] = tokenStyle;
|
|
109
|
+
$[16] = t6;
|
|
110
|
+
} else t6 = $[16];
|
|
111
|
+
return t6;
|
|
88
112
|
}
|
|
89
|
-
function usePreviewOptions(preview) {
|
|
90
|
-
const $ = c(
|
|
113
|
+
function usePreviewOptions(preview, internalOpen) {
|
|
114
|
+
const $ = c(54);
|
|
91
115
|
const { locale } = useTaoInternalConfig();
|
|
116
|
+
const groupDisabled = useContext(PreviewDisabledContext);
|
|
92
117
|
let t0;
|
|
93
118
|
if ($[0] !== preview) {
|
|
94
119
|
t0 = "object" == typeof preview ? preview : {};
|
|
@@ -129,103 +154,100 @@ function usePreviewOptions(preview) {
|
|
|
129
154
|
toolbarRender = $[8];
|
|
130
155
|
visible = $[9];
|
|
131
156
|
}
|
|
132
|
-
const
|
|
157
|
+
const disabled = groupDisabled || false === preview;
|
|
158
|
+
const container = usePreviewContainer(getContainer, !disabled && (open ?? visible ?? internalOpen), disabled);
|
|
159
|
+
const iterableMask = null !== mask && "object" == typeof mask && Symbol.iterator in mask ? mask : void 0;
|
|
160
|
+
const maskCover = "string" == typeof mask || "number" == typeof mask || /*#__PURE__*/ isValidElement(mask) ? mask : iterableMask;
|
|
161
|
+
const maskConfig = "object" != typeof mask || null === mask || /*#__PURE__*/ isValidElement(mask) || iterableMask ? void 0 : mask;
|
|
133
162
|
let t1;
|
|
134
|
-
if ($[10] !==
|
|
135
|
-
t1 =
|
|
136
|
-
|
|
163
|
+
if ($[10] !== locale.close) {
|
|
164
|
+
t1 = /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
165
|
+
name: "close",
|
|
166
|
+
label: locale.close
|
|
167
|
+
});
|
|
168
|
+
$[10] = locale.close;
|
|
137
169
|
$[11] = t1;
|
|
138
170
|
} else t1 = $[11];
|
|
139
|
-
const maskConfig = t1;
|
|
140
171
|
let t2;
|
|
141
|
-
if ($[12] !== locale.
|
|
172
|
+
if ($[12] !== locale.previous) {
|
|
142
173
|
t2 = /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
143
|
-
name: "
|
|
144
|
-
label: locale.
|
|
174
|
+
name: "prev",
|
|
175
|
+
label: locale.previous
|
|
145
176
|
});
|
|
146
|
-
$[12] = locale.
|
|
177
|
+
$[12] = locale.previous;
|
|
147
178
|
$[13] = t2;
|
|
148
179
|
} else t2 = $[13];
|
|
149
180
|
let t3;
|
|
150
|
-
if ($[14] !== locale.
|
|
181
|
+
if ($[14] !== locale.next) {
|
|
151
182
|
t3 = /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
152
|
-
name: "
|
|
153
|
-
label: locale.
|
|
183
|
+
name: "next",
|
|
184
|
+
label: locale.next
|
|
154
185
|
});
|
|
155
|
-
$[14] = locale.
|
|
186
|
+
$[14] = locale.next;
|
|
156
187
|
$[15] = t3;
|
|
157
188
|
} else t3 = $[15];
|
|
158
189
|
let t4;
|
|
159
|
-
if ($[16] !== locale.next) {
|
|
160
|
-
t4 = /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
161
|
-
name: "next",
|
|
162
|
-
label: locale.next
|
|
163
|
-
});
|
|
164
|
-
$[16] = locale.next;
|
|
165
|
-
$[17] = t4;
|
|
166
|
-
} else t4 = $[17];
|
|
167
|
-
let t10;
|
|
168
190
|
let t5;
|
|
169
191
|
let t6;
|
|
170
192
|
let t7;
|
|
171
193
|
let t8;
|
|
172
194
|
let t9;
|
|
173
|
-
if ($[
|
|
174
|
-
|
|
195
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
196
|
+
t4 = /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
175
197
|
name: "rotateLeft"
|
|
176
198
|
});
|
|
177
|
-
|
|
199
|
+
t5 = /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
178
200
|
name: "rotateRight"
|
|
179
201
|
});
|
|
180
|
-
|
|
202
|
+
t6 = /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
181
203
|
name: "zoomIn"
|
|
182
204
|
});
|
|
183
|
-
|
|
205
|
+
t7 = /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
184
206
|
name: "zoomOut"
|
|
185
207
|
});
|
|
186
|
-
|
|
208
|
+
t8 = /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
187
209
|
name: "flipX"
|
|
188
210
|
});
|
|
189
|
-
|
|
211
|
+
t9 = /*#__PURE__*/ jsx(ImageControlIcon, {
|
|
190
212
|
name: "flipY"
|
|
191
213
|
});
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
$[
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
214
|
+
$[16] = t4;
|
|
215
|
+
$[17] = t5;
|
|
216
|
+
$[18] = t6;
|
|
217
|
+
$[19] = t7;
|
|
218
|
+
$[20] = t8;
|
|
219
|
+
$[21] = t9;
|
|
198
220
|
} else {
|
|
199
|
-
|
|
200
|
-
t5 = $[
|
|
201
|
-
t6 = $[
|
|
202
|
-
t7 = $[
|
|
203
|
-
t8 = $[
|
|
204
|
-
t9 = $[
|
|
221
|
+
t4 = $[16];
|
|
222
|
+
t5 = $[17];
|
|
223
|
+
t6 = $[18];
|
|
224
|
+
t7 = $[19];
|
|
225
|
+
t8 = $[20];
|
|
226
|
+
t9 = $[21];
|
|
205
227
|
}
|
|
206
|
-
let
|
|
207
|
-
if ($[
|
|
208
|
-
|
|
209
|
-
close:
|
|
210
|
-
prev:
|
|
211
|
-
next:
|
|
212
|
-
rotateLeft:
|
|
213
|
-
rotateRight:
|
|
214
|
-
zoomIn:
|
|
215
|
-
zoomOut:
|
|
216
|
-
flipX:
|
|
217
|
-
flipY:
|
|
228
|
+
let t10;
|
|
229
|
+
if ($[22] !== raw.icons || $[23] !== t1 || $[24] !== t2 || $[25] !== t3) {
|
|
230
|
+
t10 = {
|
|
231
|
+
close: t1,
|
|
232
|
+
prev: t2,
|
|
233
|
+
next: t3,
|
|
234
|
+
rotateLeft: t4,
|
|
235
|
+
rotateRight: t5,
|
|
236
|
+
zoomIn: t6,
|
|
237
|
+
zoomOut: t7,
|
|
238
|
+
flipX: t8,
|
|
239
|
+
flipY: t9,
|
|
218
240
|
...raw.icons
|
|
219
241
|
};
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
} else
|
|
226
|
-
const icons =
|
|
227
|
-
let
|
|
228
|
-
if ($[
|
|
242
|
+
$[22] = raw.icons;
|
|
243
|
+
$[23] = t1;
|
|
244
|
+
$[24] = t2;
|
|
245
|
+
$[25] = t3;
|
|
246
|
+
$[26] = t10;
|
|
247
|
+
} else t10 = $[26];
|
|
248
|
+
const icons = t10;
|
|
249
|
+
let t11;
|
|
250
|
+
if ($[27] !== locale.messages.flipX || $[28] !== locale.messages.flipY || $[29] !== locale.messages.rotateLeft || $[30] !== locale.messages.rotateRight || $[31] !== locale.messages.zoomIn || $[32] !== locale.messages.zoomOut || $[33] !== locale.next || $[34] !== locale.previous) {
|
|
229
251
|
const actionLabels = {
|
|
230
252
|
prev: locale.previous,
|
|
231
253
|
next: locale.next,
|
|
@@ -236,28 +258,28 @@ function usePreviewOptions(preview) {
|
|
|
236
258
|
zoomOut: locale.messages.zoomOut,
|
|
237
259
|
zoomIn: locale.messages.zoomIn
|
|
238
260
|
};
|
|
239
|
-
|
|
261
|
+
t11 = (node)=>{
|
|
240
262
|
if (!/*#__PURE__*/ isValidElement(node)) return node;
|
|
241
263
|
const label = actionLabels[node.props["aria-label"] ?? ""];
|
|
242
264
|
return void 0 === label ? node : /*#__PURE__*/ cloneElement(node, {
|
|
243
265
|
"aria-label": label
|
|
244
266
|
});
|
|
245
267
|
};
|
|
246
|
-
$[
|
|
247
|
-
$[
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
} else
|
|
256
|
-
const localizeAction =
|
|
268
|
+
$[27] = locale.messages.flipX;
|
|
269
|
+
$[28] = locale.messages.flipY;
|
|
270
|
+
$[29] = locale.messages.rotateLeft;
|
|
271
|
+
$[30] = locale.messages.rotateRight;
|
|
272
|
+
$[31] = locale.messages.zoomIn;
|
|
273
|
+
$[32] = locale.messages.zoomOut;
|
|
274
|
+
$[33] = locale.next;
|
|
275
|
+
$[34] = locale.previous;
|
|
276
|
+
$[35] = t11;
|
|
277
|
+
} else t11 = $[35];
|
|
278
|
+
const localizeAction = t11;
|
|
257
279
|
const renderActions = raw.actionsRender ?? toolbarRender;
|
|
258
|
-
let
|
|
259
|
-
if ($[
|
|
260
|
-
|
|
280
|
+
let t12;
|
|
281
|
+
if ($[36] !== localizeAction || $[37] !== renderActions) {
|
|
282
|
+
t12 = (original, info)=>{
|
|
261
283
|
const actions = original;
|
|
262
284
|
const localized = /*#__PURE__*/ cloneElement(actions, void 0, Children.map(actions.props.children, localizeAction));
|
|
263
285
|
return renderActions ? renderActions(localized, {
|
|
@@ -274,67 +296,58 @@ function usePreviewOptions(preview) {
|
|
|
274
296
|
}
|
|
275
297
|
}) : localized;
|
|
276
298
|
};
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
$[
|
|
280
|
-
} else
|
|
281
|
-
const actionsRender =
|
|
282
|
-
const
|
|
283
|
-
const
|
|
284
|
-
const
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
t19 = /*#__PURE__*/ isValidElement(mask) ? {
|
|
290
|
-
cover: mask
|
|
291
|
-
} : {};
|
|
292
|
-
$[41] = mask;
|
|
293
|
-
$[42] = t19;
|
|
294
|
-
} else t19 = $[42];
|
|
295
|
-
let t20;
|
|
296
|
-
if ($[43] !== actionsRender || $[44] !== container || $[45] !== icons || $[46] !== rest || $[47] !== rootClassName || $[48] !== t17 || $[49] !== t18 || $[50] !== t19) {
|
|
297
|
-
t20 = {
|
|
299
|
+
$[36] = localizeAction;
|
|
300
|
+
$[37] = renderActions;
|
|
301
|
+
$[38] = t12;
|
|
302
|
+
} else t12 = $[38];
|
|
303
|
+
const actionsRender = t12;
|
|
304
|
+
const t13 = false === mask || maskConfig?.enabled === false;
|
|
305
|
+
const t14 = maskConfig?.blur;
|
|
306
|
+
const t15 = open ?? visible;
|
|
307
|
+
const t16 = maskConfig?.closable ?? true;
|
|
308
|
+
let t17;
|
|
309
|
+
if ($[39] !== actionsRender || $[40] !== container || $[41] !== icons || $[42] !== rest || $[43] !== rootClassName || $[44] !== t15 || $[45] !== t16) {
|
|
310
|
+
t17 = {
|
|
298
311
|
...rest,
|
|
299
|
-
open:
|
|
312
|
+
open: t15,
|
|
300
313
|
rootClassName,
|
|
301
314
|
getContainer: container,
|
|
302
315
|
icons,
|
|
303
316
|
motionName: "tao-image-preview-fade",
|
|
304
|
-
maskClosable:
|
|
305
|
-
actionsRender
|
|
306
|
-
...t19
|
|
317
|
+
maskClosable: t16,
|
|
318
|
+
actionsRender
|
|
307
319
|
};
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
disabled: t14,
|
|
320
|
+
$[39] = actionsRender;
|
|
321
|
+
$[40] = container;
|
|
322
|
+
$[41] = icons;
|
|
323
|
+
$[42] = rest;
|
|
324
|
+
$[43] = rootClassName;
|
|
325
|
+
$[44] = t15;
|
|
326
|
+
$[45] = t16;
|
|
327
|
+
$[46] = t17;
|
|
328
|
+
} else t17 = $[46];
|
|
329
|
+
let t18;
|
|
330
|
+
if ($[47] !== disabled || $[48] !== maskCover || $[49] !== raw || $[50] !== t13 || $[51] !== t14 || $[52] !== t17) {
|
|
331
|
+
t18 = {
|
|
332
|
+
disabled,
|
|
322
333
|
raw,
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
334
|
+
maskCover,
|
|
335
|
+
hiddenMask: t13,
|
|
336
|
+
blurMask: t14,
|
|
337
|
+
config: t17
|
|
326
338
|
};
|
|
327
|
-
$[
|
|
328
|
-
$[
|
|
329
|
-
$[
|
|
330
|
-
$[
|
|
331
|
-
$[
|
|
332
|
-
$[
|
|
333
|
-
|
|
334
|
-
|
|
339
|
+
$[47] = disabled;
|
|
340
|
+
$[48] = maskCover;
|
|
341
|
+
$[49] = raw;
|
|
342
|
+
$[50] = t13;
|
|
343
|
+
$[51] = t14;
|
|
344
|
+
$[52] = t17;
|
|
345
|
+
$[53] = t18;
|
|
346
|
+
} else t18 = $[53];
|
|
347
|
+
return t18;
|
|
335
348
|
}
|
|
336
349
|
function ImageProgress(t0) {
|
|
337
|
-
const $ = c(
|
|
350
|
+
const $ = c(58);
|
|
338
351
|
const { props, progress, placeholder } = t0;
|
|
339
352
|
let t1;
|
|
340
353
|
if ($[0] !== props) {
|
|
@@ -382,17 +395,19 @@ function ImageProgress(t0) {
|
|
|
382
395
|
$[11] = t5;
|
|
383
396
|
} else t5 = $[11];
|
|
384
397
|
const percentText = t5;
|
|
385
|
-
|
|
398
|
+
const t6 = props["aria-labelledby"];
|
|
399
|
+
const t7 = props["aria-describedby"];
|
|
400
|
+
let t8;
|
|
386
401
|
if ($[12] !== hasPercent || $[13] !== locale.messages || $[14] !== percent || $[15] !== percentText || $[16] !== props) {
|
|
387
|
-
|
|
402
|
+
t8 = hasPercent ? {
|
|
388
403
|
role: "progressbar",
|
|
389
404
|
"aria-valuemin": 0,
|
|
390
405
|
"aria-valuemax": 100,
|
|
391
406
|
"aria-valuenow": percent,
|
|
392
|
-
"aria-label": props["aria-label"] ?? percentText
|
|
407
|
+
"aria-label": props["aria-label"] ?? (props.alt || percentText)
|
|
393
408
|
} : {
|
|
394
409
|
role: "status",
|
|
395
|
-
"aria-label": props["aria-label"] ?? locale.messages.loading,
|
|
410
|
+
"aria-label": props["aria-label"] ?? (props.alt || locale.messages.loading),
|
|
396
411
|
"aria-busy": true
|
|
397
412
|
};
|
|
398
413
|
$[12] = hasPercent;
|
|
@@ -400,12 +415,24 @@ function ImageProgress(t0) {
|
|
|
400
415
|
$[14] = percent;
|
|
401
416
|
$[15] = percentText;
|
|
402
417
|
$[16] = props;
|
|
403
|
-
$[17] =
|
|
404
|
-
} else
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
418
|
+
$[17] = t8;
|
|
419
|
+
} else t8 = $[17];
|
|
420
|
+
let t9;
|
|
421
|
+
if ($[18] !== t6 || $[19] !== t7 || $[20] !== t8) {
|
|
422
|
+
t9 = {
|
|
423
|
+
"aria-labelledby": t6,
|
|
424
|
+
"aria-describedby": t7,
|
|
425
|
+
...t8
|
|
426
|
+
};
|
|
427
|
+
$[18] = t6;
|
|
428
|
+
$[19] = t7;
|
|
429
|
+
$[20] = t8;
|
|
430
|
+
$[21] = t9;
|
|
431
|
+
} else t9 = $[21];
|
|
432
|
+
const progressAria = t9;
|
|
433
|
+
let t10;
|
|
434
|
+
if ($[22] !== cn?.rail || $[23] !== hasPercent || $[24] !== percent || $[25] !== st?.rail) {
|
|
435
|
+
t10 = hasPercent ? /*#__PURE__*/ jsx("div", {
|
|
409
436
|
"data-tao-image-progress-rail": "",
|
|
410
437
|
className: cn?.rail,
|
|
411
438
|
style: st?.rail,
|
|
@@ -415,51 +442,51 @@ function ImageProgress(t0) {
|
|
|
415
442
|
}
|
|
416
443
|
})
|
|
417
444
|
}) : null;
|
|
418
|
-
$[
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
422
|
-
$[
|
|
423
|
-
} else
|
|
424
|
-
const bar =
|
|
425
|
-
const
|
|
426
|
-
const
|
|
427
|
-
let t10;
|
|
428
|
-
if ($[23] !== props.className || $[24] !== props.rootClassName || $[25] !== t8 || $[26] !== t9) {
|
|
429
|
-
t10 = cx(t8, t9, props.rootClassName, props.className);
|
|
430
|
-
$[23] = props.className;
|
|
431
|
-
$[24] = props.rootClassName;
|
|
432
|
-
$[25] = t8;
|
|
433
|
-
$[26] = t9;
|
|
434
|
-
$[27] = t10;
|
|
435
|
-
} else t10 = $[27];
|
|
436
|
-
const t11 = styles?.root;
|
|
437
|
-
const t12 = st?.root;
|
|
445
|
+
$[22] = cn?.rail;
|
|
446
|
+
$[23] = hasPercent;
|
|
447
|
+
$[24] = percent;
|
|
448
|
+
$[25] = st?.rail;
|
|
449
|
+
$[26] = t10;
|
|
450
|
+
} else t10 = $[26];
|
|
451
|
+
const bar = t10;
|
|
452
|
+
const t11 = classes?.root;
|
|
453
|
+
const t12 = cn?.root;
|
|
438
454
|
let t13;
|
|
439
|
-
if ($[
|
|
440
|
-
t13 =
|
|
455
|
+
if ($[27] !== props.className || $[28] !== props.rootClassName || $[29] !== t11 || $[30] !== t12) {
|
|
456
|
+
t13 = cx(t11, t12, props.rootClassName, props.className);
|
|
457
|
+
$[27] = props.className;
|
|
458
|
+
$[28] = props.rootClassName;
|
|
459
|
+
$[29] = t11;
|
|
460
|
+
$[30] = t12;
|
|
461
|
+
$[31] = t13;
|
|
462
|
+
} else t13 = $[31];
|
|
463
|
+
const t14 = styles?.root;
|
|
464
|
+
const t15 = st?.root;
|
|
465
|
+
let t16;
|
|
466
|
+
if ($[32] !== props.height || $[33] !== props.style || $[34] !== props.width || $[35] !== props.wrapperStyle || $[36] !== t14 || $[37] !== t15 || $[38] !== tokenStyle) {
|
|
467
|
+
t16 = {
|
|
441
468
|
...tokenStyle,
|
|
442
469
|
width: props.width,
|
|
443
470
|
height: props.height,
|
|
444
471
|
...props.wrapperStyle,
|
|
445
|
-
...
|
|
472
|
+
...t14,
|
|
446
473
|
...props.style,
|
|
447
|
-
...
|
|
474
|
+
...t15
|
|
448
475
|
};
|
|
449
|
-
$[
|
|
450
|
-
$[
|
|
451
|
-
$[
|
|
452
|
-
$[
|
|
453
|
-
$[
|
|
454
|
-
$[
|
|
455
|
-
$[
|
|
456
|
-
$[
|
|
457
|
-
} else
|
|
458
|
-
const
|
|
459
|
-
const
|
|
460
|
-
let
|
|
461
|
-
if ($[
|
|
462
|
-
|
|
476
|
+
$[32] = props.height;
|
|
477
|
+
$[33] = props.style;
|
|
478
|
+
$[34] = props.width;
|
|
479
|
+
$[35] = props.wrapperStyle;
|
|
480
|
+
$[36] = t14;
|
|
481
|
+
$[37] = t15;
|
|
482
|
+
$[38] = tokenStyle;
|
|
483
|
+
$[39] = t16;
|
|
484
|
+
} else t16 = $[39];
|
|
485
|
+
const t17 = cn?.content;
|
|
486
|
+
const t18 = st?.content;
|
|
487
|
+
let t19;
|
|
488
|
+
if ($[40] !== bar || $[41] !== cn?.indicator || $[42] !== hasPercent || $[43] !== percent || $[44] !== percentText || $[45] !== placeholder || $[46] !== progress || $[47] !== st?.indicator) {
|
|
489
|
+
t19 = placeholder ?? (progress?.render ? progress.render(bar, percent) : /*#__PURE__*/ jsxs(Fragment, {
|
|
463
490
|
children: [
|
|
464
491
|
bar,
|
|
465
492
|
hasPercent && /*#__PURE__*/ jsx("span", {
|
|
@@ -469,49 +496,50 @@ function ImageProgress(t0) {
|
|
|
469
496
|
})
|
|
470
497
|
]
|
|
471
498
|
}));
|
|
472
|
-
$[
|
|
473
|
-
$[
|
|
474
|
-
$[
|
|
475
|
-
$[
|
|
476
|
-
$[
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
479
|
-
$[
|
|
480
|
-
$[
|
|
481
|
-
} else
|
|
482
|
-
let
|
|
483
|
-
if ($[
|
|
484
|
-
|
|
499
|
+
$[40] = bar;
|
|
500
|
+
$[41] = cn?.indicator;
|
|
501
|
+
$[42] = hasPercent;
|
|
502
|
+
$[43] = percent;
|
|
503
|
+
$[44] = percentText;
|
|
504
|
+
$[45] = placeholder;
|
|
505
|
+
$[46] = progress;
|
|
506
|
+
$[47] = st?.indicator;
|
|
507
|
+
$[48] = t19;
|
|
508
|
+
} else t19 = $[48];
|
|
509
|
+
let t20;
|
|
510
|
+
if ($[49] !== t17 || $[50] !== t18 || $[51] !== t19) {
|
|
511
|
+
t20 = /*#__PURE__*/ jsx("div", {
|
|
485
512
|
"data-tao-image-progress-content": "",
|
|
486
|
-
className:
|
|
487
|
-
style:
|
|
488
|
-
children:
|
|
513
|
+
className: t17,
|
|
514
|
+
style: t18,
|
|
515
|
+
children: t19
|
|
489
516
|
});
|
|
490
|
-
$[
|
|
491
|
-
$[
|
|
492
|
-
$[
|
|
493
|
-
$[
|
|
494
|
-
} else
|
|
495
|
-
let
|
|
496
|
-
if ($[
|
|
497
|
-
|
|
517
|
+
$[49] = t17;
|
|
518
|
+
$[50] = t18;
|
|
519
|
+
$[51] = t19;
|
|
520
|
+
$[52] = t20;
|
|
521
|
+
} else t20 = $[52];
|
|
522
|
+
let t21;
|
|
523
|
+
if ($[53] !== progressAria || $[54] !== t13 || $[55] !== t16 || $[56] !== t20) {
|
|
524
|
+
t21 = /*#__PURE__*/ jsx("div", {
|
|
498
525
|
"data-tao-image-progress": "",
|
|
499
|
-
className:
|
|
500
|
-
style:
|
|
526
|
+
className: t13,
|
|
527
|
+
style: t16,
|
|
501
528
|
...progressAria,
|
|
502
|
-
children:
|
|
529
|
+
children: t20
|
|
503
530
|
});
|
|
504
|
-
$[
|
|
505
|
-
$[
|
|
506
|
-
$[
|
|
507
|
-
$[
|
|
508
|
-
$[
|
|
509
|
-
} else
|
|
510
|
-
return
|
|
531
|
+
$[53] = progressAria;
|
|
532
|
+
$[54] = t13;
|
|
533
|
+
$[55] = t16;
|
|
534
|
+
$[56] = t20;
|
|
535
|
+
$[57] = t21;
|
|
536
|
+
} else t21 = $[57];
|
|
537
|
+
return t21;
|
|
511
538
|
}
|
|
512
539
|
function ImageBase(props) {
|
|
513
|
-
const $ = c(
|
|
540
|
+
const $ = c(71);
|
|
514
541
|
const { tokenStyle } = useTaoInternalConfig();
|
|
542
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
515
543
|
let classNames;
|
|
516
544
|
let placeholder;
|
|
517
545
|
let preview;
|
|
@@ -559,7 +587,7 @@ function ImageBase(props) {
|
|
|
559
587
|
$[13] = t2;
|
|
560
588
|
} else t2 = $[13];
|
|
561
589
|
const css = t2;
|
|
562
|
-
const { disabled, config, hiddenMask, blurMask } = usePreviewOptions(preview);
|
|
590
|
+
const { disabled, config, hiddenMask, blurMask, maskCover } = usePreviewOptions(preview, internalOpen);
|
|
563
591
|
let t3;
|
|
564
592
|
if ($[14] !== preview) {
|
|
565
593
|
t3 = "object" == typeof preview ? preview : {};
|
|
@@ -567,171 +595,204 @@ function ImageBase(props) {
|
|
|
567
595
|
$[15] = t3;
|
|
568
596
|
} else t3 = $[15];
|
|
569
597
|
const raw = t3;
|
|
570
|
-
|
|
598
|
+
let t4;
|
|
599
|
+
if ($[16] !== placeholder) {
|
|
600
|
+
t4 = null !== placeholder && "object" == typeof placeholder && !/*#__PURE__*/ isValidElement(placeholder) && "progress" in placeholder;
|
|
601
|
+
$[16] = placeholder;
|
|
602
|
+
$[17] = t4;
|
|
603
|
+
} else t4 = $[17];
|
|
604
|
+
const isProgressConfig = t4;
|
|
571
605
|
const progress = isProgressConfig ? placeholder.progress : void 0;
|
|
572
|
-
|
|
573
|
-
let t4;
|
|
574
|
-
if ($[16] !== progress) {
|
|
575
|
-
t4 = true === progress ? {} : progress || void 0;
|
|
576
|
-
$[16] = progress;
|
|
577
|
-
$[17] = t4;
|
|
578
|
-
} else t4 = $[17];
|
|
579
|
-
const t5 = isProgressConfig ? void 0 : placeholder;
|
|
580
|
-
let t6;
|
|
581
|
-
if ($[18] !== props || $[19] !== t4 || $[20] !== t5) {
|
|
582
|
-
t6 = /*#__PURE__*/ jsx(ImageProgress, {
|
|
583
|
-
props: props,
|
|
584
|
-
progress: t4,
|
|
585
|
-
placeholder: t5
|
|
586
|
-
});
|
|
587
|
-
$[18] = props;
|
|
588
|
-
$[19] = t4;
|
|
589
|
-
$[20] = t5;
|
|
590
|
-
$[21] = t6;
|
|
591
|
-
} else t6 = $[21];
|
|
592
|
-
return t6;
|
|
593
|
-
}
|
|
594
|
-
const t4 = classes?.cover;
|
|
606
|
+
const showPlaceholder = !!progress || !props.src && (!!placeholder || 0 === placeholder) && !isProgressConfig;
|
|
595
607
|
let t5;
|
|
596
|
-
if ($[22] !== raw.maskClassName || $[23] !== t4) {
|
|
597
|
-
t5 = cx(t4, raw.maskClassName);
|
|
598
|
-
$[22] = raw.maskClassName;
|
|
599
|
-
$[23] = t4;
|
|
600
|
-
$[24] = t5;
|
|
601
|
-
} else t5 = $[24];
|
|
602
608
|
let t6;
|
|
603
|
-
if ($[
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
cover: t5
|
|
609
|
+
if ($[18] !== config.open || $[19] !== disabled || $[20] !== showPlaceholder) {
|
|
610
|
+
t5 = ()=>{
|
|
611
|
+
if (disabled || void 0 !== config.open || showPlaceholder) setInternalOpen(false);
|
|
607
612
|
};
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
+
t6 = [
|
|
614
|
+
disabled,
|
|
615
|
+
config.open,
|
|
616
|
+
showPlaceholder
|
|
617
|
+
];
|
|
618
|
+
$[18] = config.open;
|
|
619
|
+
$[19] = disabled;
|
|
620
|
+
$[20] = showPlaceholder;
|
|
621
|
+
$[21] = t5;
|
|
622
|
+
$[22] = t6;
|
|
623
|
+
} else {
|
|
624
|
+
t5 = $[21];
|
|
625
|
+
t6 = $[22];
|
|
626
|
+
}
|
|
627
|
+
useEffect(t5, t6);
|
|
628
|
+
if (showPlaceholder) {
|
|
629
|
+
let t7;
|
|
630
|
+
if ($[23] !== progress) {
|
|
631
|
+
t7 = true === progress ? {} : progress || void 0;
|
|
632
|
+
$[23] = progress;
|
|
633
|
+
$[24] = t7;
|
|
634
|
+
} else t7 = $[24];
|
|
635
|
+
const t8 = isProgressConfig ? void 0 : placeholder;
|
|
636
|
+
let t9;
|
|
637
|
+
if ($[25] !== props || $[26] !== t7 || $[27] !== t8) {
|
|
638
|
+
t9 = /*#__PURE__*/ jsx(ImageProgress, {
|
|
639
|
+
props: props,
|
|
640
|
+
progress: t7,
|
|
641
|
+
placeholder: t8
|
|
642
|
+
});
|
|
643
|
+
$[25] = props;
|
|
644
|
+
$[26] = t7;
|
|
645
|
+
$[27] = t8;
|
|
646
|
+
$[28] = t9;
|
|
647
|
+
} else t9 = $[28];
|
|
648
|
+
return t9;
|
|
649
|
+
}
|
|
650
|
+
const t7 = classes?.cover;
|
|
613
651
|
let t8;
|
|
614
|
-
if ($[
|
|
615
|
-
t8 =
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
...t7
|
|
619
|
-
};
|
|
620
|
-
$[28] = t7;
|
|
621
|
-
$[29] = tokenStyle;
|
|
622
|
-
$[30] = wrapperStyle;
|
|
652
|
+
if ($[29] !== raw.maskClassName || $[30] !== t7) {
|
|
653
|
+
t8 = cx(t7, raw.maskClassName);
|
|
654
|
+
$[29] = raw.maskClassName;
|
|
655
|
+
$[30] = t7;
|
|
623
656
|
$[31] = t8;
|
|
624
657
|
} else t8 = $[31];
|
|
625
|
-
|
|
626
|
-
|
|
658
|
+
let t9;
|
|
659
|
+
if ($[32] !== classes || $[33] !== t8) {
|
|
660
|
+
t9 = {
|
|
661
|
+
...classes,
|
|
662
|
+
cover: t8
|
|
663
|
+
};
|
|
664
|
+
$[32] = classes;
|
|
665
|
+
$[33] = t8;
|
|
666
|
+
$[34] = t9;
|
|
667
|
+
} else t9 = $[34];
|
|
668
|
+
const t10 = css?.root;
|
|
627
669
|
let t11;
|
|
628
|
-
if ($[
|
|
670
|
+
if ($[35] !== t10 || $[36] !== tokenStyle || $[37] !== wrapperStyle) {
|
|
629
671
|
t11 = {
|
|
630
672
|
...tokenStyle,
|
|
673
|
+
...wrapperStyle,
|
|
631
674
|
...t10
|
|
632
675
|
};
|
|
633
|
-
$[
|
|
634
|
-
$[
|
|
635
|
-
$[
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
676
|
+
$[35] = t10;
|
|
677
|
+
$[36] = tokenStyle;
|
|
678
|
+
$[37] = wrapperStyle;
|
|
679
|
+
$[38] = t11;
|
|
680
|
+
} else t11 = $[38];
|
|
681
|
+
const t12 = css?.popup;
|
|
682
|
+
const t13 = css?.popup?.root;
|
|
683
|
+
let t14;
|
|
684
|
+
if ($[39] !== t13 || $[40] !== tokenStyle) {
|
|
685
|
+
t14 = {
|
|
686
|
+
...tokenStyle,
|
|
687
|
+
...t13
|
|
688
|
+
};
|
|
689
|
+
$[39] = t13;
|
|
690
|
+
$[40] = tokenStyle;
|
|
691
|
+
$[41] = t14;
|
|
692
|
+
} else t14 = $[41];
|
|
693
|
+
let t15;
|
|
694
|
+
if ($[42] !== hiddenMask) {
|
|
695
|
+
t15 = hiddenMask ? {
|
|
640
696
|
background: "transparent"
|
|
641
697
|
} : {};
|
|
642
|
-
$[
|
|
643
|
-
$[
|
|
644
|
-
} else
|
|
645
|
-
let
|
|
646
|
-
if ($[
|
|
647
|
-
|
|
698
|
+
$[42] = hiddenMask;
|
|
699
|
+
$[43] = t15;
|
|
700
|
+
} else t15 = $[43];
|
|
701
|
+
let t16;
|
|
702
|
+
if ($[44] !== blurMask) {
|
|
703
|
+
t16 = blurMask ? {
|
|
648
704
|
backdropFilter: "blur(4px)"
|
|
649
705
|
} : {};
|
|
650
|
-
$[
|
|
651
|
-
$[
|
|
652
|
-
} else
|
|
653
|
-
const
|
|
654
|
-
let
|
|
655
|
-
if ($[
|
|
656
|
-
|
|
657
|
-
...
|
|
658
|
-
...
|
|
659
|
-
...
|
|
706
|
+
$[44] = blurMask;
|
|
707
|
+
$[45] = t16;
|
|
708
|
+
} else t16 = $[45];
|
|
709
|
+
const t17 = css?.popup?.mask;
|
|
710
|
+
let t18;
|
|
711
|
+
if ($[46] !== t15 || $[47] !== t16 || $[48] !== t17) {
|
|
712
|
+
t18 = {
|
|
713
|
+
...t15,
|
|
714
|
+
...t16,
|
|
715
|
+
...t17
|
|
660
716
|
};
|
|
661
|
-
$[
|
|
662
|
-
$[
|
|
663
|
-
$[
|
|
664
|
-
$[
|
|
665
|
-
} else
|
|
666
|
-
let
|
|
667
|
-
if ($[
|
|
668
|
-
|
|
669
|
-
...
|
|
670
|
-
root:
|
|
671
|
-
mask:
|
|
717
|
+
$[46] = t15;
|
|
718
|
+
$[47] = t16;
|
|
719
|
+
$[48] = t17;
|
|
720
|
+
$[49] = t18;
|
|
721
|
+
} else t18 = $[49];
|
|
722
|
+
let t19;
|
|
723
|
+
if ($[50] !== t12 || $[51] !== t14 || $[52] !== t18) {
|
|
724
|
+
t19 = {
|
|
725
|
+
...t12,
|
|
726
|
+
root: t14,
|
|
727
|
+
mask: t18
|
|
672
728
|
};
|
|
673
|
-
$[
|
|
674
|
-
$[
|
|
675
|
-
$[
|
|
676
|
-
$[
|
|
677
|
-
} else
|
|
678
|
-
let
|
|
679
|
-
if ($[
|
|
680
|
-
|
|
729
|
+
$[50] = t12;
|
|
730
|
+
$[51] = t14;
|
|
731
|
+
$[52] = t18;
|
|
732
|
+
$[53] = t19;
|
|
733
|
+
} else t19 = $[53];
|
|
734
|
+
let t20;
|
|
735
|
+
if ($[54] !== css || $[55] !== t11 || $[56] !== t19) {
|
|
736
|
+
t20 = {
|
|
681
737
|
...css,
|
|
682
|
-
root:
|
|
683
|
-
popup:
|
|
738
|
+
root: t11,
|
|
739
|
+
popup: t19
|
|
684
740
|
};
|
|
685
|
-
$[
|
|
686
|
-
$[
|
|
687
|
-
$[
|
|
688
|
-
$[
|
|
689
|
-
} else
|
|
690
|
-
const
|
|
691
|
-
let
|
|
692
|
-
if ($[
|
|
693
|
-
|
|
741
|
+
$[54] = css;
|
|
742
|
+
$[55] = t11;
|
|
743
|
+
$[56] = t19;
|
|
744
|
+
$[57] = t20;
|
|
745
|
+
} else t20 = $[57];
|
|
746
|
+
const t21 = isProgressConfig ? void 0 : placeholder;
|
|
747
|
+
let t22;
|
|
748
|
+
if ($[58] !== config || $[59] !== disabled || $[60] !== internalOpen || $[61] !== maskCover || $[62] !== raw) {
|
|
749
|
+
t22 = disabled ? false : {
|
|
694
750
|
...config,
|
|
695
|
-
|
|
751
|
+
open: config.open ?? internalOpen,
|
|
752
|
+
cover: raw.cover ?? maskCover ?? /*#__PURE__*/ jsx("span", {
|
|
696
753
|
"aria-hidden": "true",
|
|
697
754
|
children: "⌕"
|
|
698
755
|
}),
|
|
699
|
-
onOpenChange:
|
|
756
|
+
onOpenChange: (open)=>{
|
|
757
|
+
if (void 0 === config.open) setInternalOpen(open);
|
|
758
|
+
if (raw.onOpenChange) raw.onOpenChange(open);
|
|
759
|
+
else raw.onVisibleChange?.(open, !open);
|
|
760
|
+
}
|
|
700
761
|
};
|
|
701
|
-
$[
|
|
702
|
-
$[
|
|
703
|
-
$[
|
|
704
|
-
$[
|
|
705
|
-
$[
|
|
706
|
-
$[
|
|
707
|
-
} else
|
|
708
|
-
let
|
|
709
|
-
if ($[
|
|
710
|
-
|
|
762
|
+
$[58] = config;
|
|
763
|
+
$[59] = disabled;
|
|
764
|
+
$[60] = internalOpen;
|
|
765
|
+
$[61] = maskCover;
|
|
766
|
+
$[62] = raw;
|
|
767
|
+
$[63] = t22;
|
|
768
|
+
} else t22 = $[63];
|
|
769
|
+
let t23;
|
|
770
|
+
if ($[64] !== prefixCls || $[65] !== rest || $[66] !== t20 || $[67] !== t21 || $[68] !== t22 || $[69] !== t9) {
|
|
771
|
+
t23 = /*#__PURE__*/ jsx("span", {
|
|
711
772
|
"data-tao-image-inline": "",
|
|
712
773
|
children: /*#__PURE__*/ jsx(RcImageComponent, {
|
|
713
774
|
...rest,
|
|
714
775
|
"data-tao-image": "",
|
|
715
776
|
prefixCls: prefixCls,
|
|
716
777
|
previewPrefixCls: "tao-image-preview",
|
|
717
|
-
classNames:
|
|
718
|
-
styles:
|
|
719
|
-
placeholder:
|
|
720
|
-
preview:
|
|
778
|
+
classNames: t9,
|
|
779
|
+
styles: t20,
|
|
780
|
+
placeholder: t21,
|
|
781
|
+
preview: t22
|
|
721
782
|
})
|
|
722
783
|
});
|
|
723
|
-
$[
|
|
724
|
-
$[
|
|
725
|
-
$[
|
|
726
|
-
$[
|
|
727
|
-
$[
|
|
728
|
-
$[
|
|
729
|
-
$[
|
|
730
|
-
} else
|
|
731
|
-
return
|
|
784
|
+
$[64] = prefixCls;
|
|
785
|
+
$[65] = rest;
|
|
786
|
+
$[66] = t20;
|
|
787
|
+
$[67] = t21;
|
|
788
|
+
$[68] = t22;
|
|
789
|
+
$[69] = t9;
|
|
790
|
+
$[70] = t23;
|
|
791
|
+
} else t23 = $[70];
|
|
792
|
+
return t23;
|
|
732
793
|
}
|
|
733
794
|
function ImagePreviewGroup(props) {
|
|
734
|
-
const $ = c(
|
|
795
|
+
const $ = c(53);
|
|
735
796
|
const { tokenStyle } = useTaoInternalConfig();
|
|
736
797
|
let children;
|
|
737
798
|
let classNames;
|
|
@@ -773,7 +834,8 @@ function ImagePreviewGroup(props) {
|
|
|
773
834
|
$[11] = t1;
|
|
774
835
|
} else t1 = $[11];
|
|
775
836
|
const css = t1;
|
|
776
|
-
const
|
|
837
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
838
|
+
const { disabled, config, hiddenMask, blurMask } = usePreviewOptions(preview, internalOpen);
|
|
777
839
|
let t2;
|
|
778
840
|
if ($[12] !== preview) {
|
|
779
841
|
t2 = "object" == typeof preview ? preview : {};
|
|
@@ -781,101 +843,147 @@ function ImagePreviewGroup(props) {
|
|
|
781
843
|
$[13] = t2;
|
|
782
844
|
} else t2 = $[13];
|
|
783
845
|
const raw = t2;
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
846
|
+
let t3;
|
|
847
|
+
let t4;
|
|
848
|
+
if ($[14] !== config.open || $[15] !== disabled) {
|
|
849
|
+
t3 = ()=>{
|
|
850
|
+
if (disabled || void 0 !== config.open) setInternalOpen(false);
|
|
851
|
+
};
|
|
852
|
+
t4 = [
|
|
853
|
+
disabled,
|
|
854
|
+
config.open
|
|
855
|
+
];
|
|
856
|
+
$[14] = config.open;
|
|
857
|
+
$[15] = disabled;
|
|
858
|
+
$[16] = t3;
|
|
859
|
+
$[17] = t4;
|
|
860
|
+
} else {
|
|
861
|
+
t3 = $[16];
|
|
862
|
+
t4 = $[17];
|
|
863
|
+
}
|
|
864
|
+
useEffect(t3, t4);
|
|
865
|
+
const t5 = css?.popup;
|
|
866
|
+
const t6 = css?.popup?.root;
|
|
867
|
+
let t7;
|
|
868
|
+
if ($[18] !== t6 || $[19] !== tokenStyle) {
|
|
869
|
+
t7 = {
|
|
789
870
|
...tokenStyle,
|
|
790
|
-
...
|
|
871
|
+
...t6
|
|
791
872
|
};
|
|
792
|
-
$[14] = t4;
|
|
793
|
-
$[15] = tokenStyle;
|
|
794
|
-
$[16] = t5;
|
|
795
|
-
} else t5 = $[16];
|
|
796
|
-
let t6;
|
|
797
|
-
if ($[17] !== hiddenMask) {
|
|
798
|
-
t6 = hiddenMask ? {
|
|
799
|
-
background: "transparent"
|
|
800
|
-
} : {};
|
|
801
|
-
$[17] = hiddenMask;
|
|
802
873
|
$[18] = t6;
|
|
803
|
-
|
|
804
|
-
let t7;
|
|
805
|
-
if ($[19] !== blurMask) {
|
|
806
|
-
t7 = blurMask ? {
|
|
807
|
-
backdropFilter: "blur(4px)"
|
|
808
|
-
} : {};
|
|
809
|
-
$[19] = blurMask;
|
|
874
|
+
$[19] = tokenStyle;
|
|
810
875
|
$[20] = t7;
|
|
811
876
|
} else t7 = $[20];
|
|
812
|
-
|
|
877
|
+
let t8;
|
|
878
|
+
if ($[21] !== hiddenMask) {
|
|
879
|
+
t8 = hiddenMask ? {
|
|
880
|
+
background: "transparent"
|
|
881
|
+
} : {};
|
|
882
|
+
$[21] = hiddenMask;
|
|
883
|
+
$[22] = t8;
|
|
884
|
+
} else t8 = $[22];
|
|
813
885
|
let t9;
|
|
814
|
-
if ($[
|
|
815
|
-
t9 = {
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
};
|
|
820
|
-
$[21] = t6;
|
|
821
|
-
$[22] = t7;
|
|
822
|
-
$[23] = t8;
|
|
886
|
+
if ($[23] !== blurMask) {
|
|
887
|
+
t9 = blurMask ? {
|
|
888
|
+
backdropFilter: "blur(4px)"
|
|
889
|
+
} : {};
|
|
890
|
+
$[23] = blurMask;
|
|
823
891
|
$[24] = t9;
|
|
824
892
|
} else t9 = $[24];
|
|
825
|
-
|
|
826
|
-
if ($[25] !== t3 || $[26] !== t5 || $[27] !== t9) {
|
|
827
|
-
t10 = {
|
|
828
|
-
...t3,
|
|
829
|
-
root: t5,
|
|
830
|
-
mask: t9
|
|
831
|
-
};
|
|
832
|
-
$[25] = t3;
|
|
833
|
-
$[26] = t5;
|
|
834
|
-
$[27] = t9;
|
|
835
|
-
$[28] = t10;
|
|
836
|
-
} else t10 = $[28];
|
|
893
|
+
const t10 = css?.popup?.mask;
|
|
837
894
|
let t11;
|
|
838
|
-
if ($[
|
|
895
|
+
if ($[25] !== t10 || $[26] !== t8 || $[27] !== t9) {
|
|
839
896
|
t11 = {
|
|
840
|
-
...
|
|
841
|
-
|
|
897
|
+
...t8,
|
|
898
|
+
...t9,
|
|
899
|
+
...t10
|
|
842
900
|
};
|
|
843
|
-
$[
|
|
844
|
-
$[
|
|
845
|
-
$[
|
|
846
|
-
|
|
901
|
+
$[25] = t10;
|
|
902
|
+
$[26] = t8;
|
|
903
|
+
$[27] = t9;
|
|
904
|
+
$[28] = t11;
|
|
905
|
+
} else t11 = $[28];
|
|
847
906
|
let t12;
|
|
848
|
-
if ($[
|
|
849
|
-
t12 =
|
|
850
|
-
...
|
|
851
|
-
|
|
907
|
+
if ($[29] !== t11 || $[30] !== t5 || $[31] !== t7) {
|
|
908
|
+
t12 = {
|
|
909
|
+
...t5,
|
|
910
|
+
root: t7,
|
|
911
|
+
mask: t11
|
|
852
912
|
};
|
|
853
|
-
$[
|
|
854
|
-
$[
|
|
855
|
-
$[
|
|
856
|
-
$[
|
|
857
|
-
} else t12 = $[
|
|
913
|
+
$[29] = t11;
|
|
914
|
+
$[30] = t5;
|
|
915
|
+
$[31] = t7;
|
|
916
|
+
$[32] = t12;
|
|
917
|
+
} else t12 = $[32];
|
|
858
918
|
let t13;
|
|
859
|
-
if ($[
|
|
860
|
-
t13 =
|
|
919
|
+
if ($[33] !== css || $[34] !== t12) {
|
|
920
|
+
t13 = {
|
|
921
|
+
...css,
|
|
922
|
+
popup: t12
|
|
923
|
+
};
|
|
924
|
+
$[33] = css;
|
|
925
|
+
$[34] = t12;
|
|
926
|
+
$[35] = t13;
|
|
927
|
+
} else t13 = $[35];
|
|
928
|
+
const t14 = !disabled && (config.open ?? internalOpen);
|
|
929
|
+
const t15 = disabled ? "" : config.motionName;
|
|
930
|
+
let t16;
|
|
931
|
+
if ($[36] !== config.open || $[37] !== raw) {
|
|
932
|
+
t16 = (open, info)=>{
|
|
933
|
+
if (void 0 === config.open) setInternalOpen(open);
|
|
934
|
+
if (raw.onOpenChange) raw.onOpenChange(open, info);
|
|
935
|
+
else raw.onVisibleChange?.(open, !open, info.current);
|
|
936
|
+
};
|
|
937
|
+
$[36] = config.open;
|
|
938
|
+
$[37] = raw;
|
|
939
|
+
$[38] = t16;
|
|
940
|
+
} else t16 = $[38];
|
|
941
|
+
let t17;
|
|
942
|
+
if ($[39] !== config || $[40] !== t14 || $[41] !== t15 || $[42] !== t16) {
|
|
943
|
+
t17 = {
|
|
944
|
+
...config,
|
|
945
|
+
open: t14,
|
|
946
|
+
motionName: t15,
|
|
947
|
+
onOpenChange: t16
|
|
948
|
+
};
|
|
949
|
+
$[39] = config;
|
|
950
|
+
$[40] = t14;
|
|
951
|
+
$[41] = t15;
|
|
952
|
+
$[42] = t16;
|
|
953
|
+
$[43] = t17;
|
|
954
|
+
} else t17 = $[43];
|
|
955
|
+
const t18 = t17;
|
|
956
|
+
let t19;
|
|
957
|
+
if ($[44] !== children || $[45] !== disabled) {
|
|
958
|
+
t19 = /*#__PURE__*/ jsx(PreviewDisabledContext.Provider, {
|
|
959
|
+
value: disabled,
|
|
960
|
+
children: children
|
|
961
|
+
});
|
|
962
|
+
$[44] = children;
|
|
963
|
+
$[45] = disabled;
|
|
964
|
+
$[46] = t19;
|
|
965
|
+
} else t19 = $[46];
|
|
966
|
+
let t20;
|
|
967
|
+
if ($[47] !== classes || $[48] !== rest || $[49] !== t13 || $[50] !== t18 || $[51] !== t19) {
|
|
968
|
+
t20 = /*#__PURE__*/ jsx("span", {
|
|
861
969
|
"data-tao-image-group": "",
|
|
862
970
|
children: /*#__PURE__*/ jsx(RcImageComponent.PreviewGroup, {
|
|
863
971
|
...rest,
|
|
864
972
|
previewPrefixCls: "tao-image-preview",
|
|
865
973
|
classNames: classes,
|
|
866
|
-
styles:
|
|
867
|
-
preview:
|
|
868
|
-
children:
|
|
974
|
+
styles: t13,
|
|
975
|
+
preview: t18,
|
|
976
|
+
children: t19
|
|
869
977
|
})
|
|
870
978
|
});
|
|
871
|
-
$[
|
|
872
|
-
$[
|
|
873
|
-
$[
|
|
874
|
-
$[
|
|
875
|
-
$[
|
|
876
|
-
$[
|
|
877
|
-
} else
|
|
878
|
-
return
|
|
979
|
+
$[47] = classes;
|
|
980
|
+
$[48] = rest;
|
|
981
|
+
$[49] = t13;
|
|
982
|
+
$[50] = t18;
|
|
983
|
+
$[51] = t19;
|
|
984
|
+
$[52] = t20;
|
|
985
|
+
} else t20 = $[52];
|
|
986
|
+
return t20;
|
|
879
987
|
}
|
|
880
988
|
const Image = Object.assign(ImageBase, {
|
|
881
989
|
PreviewGroup: ImagePreviewGroup
|