@rockshin/tao-ui 0.0.48 → 0.0.49

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.
Files changed (143) hide show
  1. package/dist/components/affix/affix.js +20 -16
  2. package/dist/components/alert/alert.js +114 -99
  3. package/dist/components/app/app-modals.js +134 -96
  4. package/dist/components/app/app-notices.js +39 -23
  5. package/dist/components/auto-complete/auto-complete.js +21 -7
  6. package/dist/components/avatar/avatar.js +31 -11
  7. package/dist/components/badge/badge.css +1 -1
  8. package/dist/components/badge/badge.js +72 -257
  9. package/dist/components/border-beam/border-beam.js +21 -17
  10. package/dist/components/breadcrumb/breadcrumb.js +178 -159
  11. package/dist/components/button/button.js +61 -53
  12. package/dist/components/calendar/calendar.js +6 -4
  13. package/dist/components/card/card.js +24 -8
  14. package/dist/components/carousel/carousel.d.ts +1 -1
  15. package/dist/components/carousel/carousel.js +105 -68
  16. package/dist/components/cascader/cascader.js +54 -19
  17. package/dist/components/checkbox/checkbox.css +13 -2
  18. package/dist/components/checkbox/checkbox.d.ts +2 -0
  19. package/dist/components/checkbox/checkbox.js +320 -229
  20. package/dist/components/collapse/collapse-panels.d.ts +1 -1
  21. package/dist/components/collapse/collapse-panels.js +122 -113
  22. package/dist/components/collapse/collapse.js +98 -63
  23. package/dist/components/color-picker/color-picker.js +539 -441
  24. package/dist/components/color-picker/color.js +1 -1
  25. package/dist/components/context-menu/context-menu.d.ts +1 -1
  26. package/dist/components/context-menu/context-menu.js +108 -68
  27. package/dist/components/date-picker/calendar/calendar-grid.js +42 -39
  28. package/dist/components/date-picker/calendar/month-grid.d.ts +8 -1
  29. package/dist/components/date-picker/calendar/month-grid.js +79 -37
  30. package/dist/components/date-picker/calendar/time-panel.d.ts +2 -1
  31. package/dist/components/date-picker/calendar/time-panel.js +94 -89
  32. package/dist/components/date-picker/calendar/year-grid.d.ts +8 -1
  33. package/dist/components/date-picker/calendar/year-grid.js +66 -35
  34. package/dist/components/date-picker/date-picker.css +24 -1
  35. package/dist/components/date-picker/date-picker.js +99 -53
  36. package/dist/components/date-picker/presets.d.ts +2 -1
  37. package/dist/components/date-picker/presets.js +27 -24
  38. package/dist/components/date-picker/range-picker.js +308 -153
  39. package/dist/components/descriptions/descriptions.js +7 -3
  40. package/dist/components/divider/divider.css +1 -1
  41. package/dist/components/divider/divider.js +1 -1
  42. package/dist/components/drawer/drawer.js +201 -369
  43. package/dist/components/dropdown/dropdown.d.ts +1 -1
  44. package/dist/components/dropdown/dropdown.js +183 -279
  45. package/dist/components/empty/empty.js +57 -78
  46. package/dist/components/float-button/float-button.d.ts +1 -0
  47. package/dist/components/float-button/float-button.js +47 -30
  48. package/dist/components/form/field-control.d.ts +4 -2
  49. package/dist/components/form/field-control.js +17 -9
  50. package/dist/components/form/form-context.d.ts +8 -2
  51. package/dist/components/form/form-context.js +2 -1
  52. package/dist/components/form/form-item.js +85 -63
  53. package/dist/components/form/use-form.d.ts +2 -1
  54. package/dist/components/form/use-form.js +2 -1
  55. package/dist/components/form-field/form-field-view.d.ts +3 -1
  56. package/dist/components/form-field/form-field-view.js +194 -141
  57. package/dist/components/form-section/form-section.d.ts +1 -1
  58. package/dist/components/form-section/form-section.js +52 -45
  59. package/dist/components/image/image.js +585 -477
  60. package/dist/components/input/base-input.js +8 -9
  61. package/dist/components/input/input-shared.d.ts +5 -2
  62. package/dist/components/input/input-shared.js +42 -18
  63. package/dist/components/input/otp.js +236 -217
  64. package/dist/components/input/password.js +2 -1
  65. package/dist/components/input/search.js +8 -7
  66. package/dist/components/list/list-pagination.js +41 -36
  67. package/dist/components/list/list.js +141 -125
  68. package/dist/components/listy/listy.js +175 -106
  69. package/dist/components/masonry/masonry.js +108 -85
  70. package/dist/components/mentions/mentions.js +12 -3
  71. package/dist/components/menu/menu-render.d.ts +9 -3
  72. package/dist/components/menu/menu-render.js +99 -36
  73. package/dist/components/modal/confirm-dialog.js +10 -4
  74. package/dist/components/modal/confirm.js +3 -7
  75. package/dist/components/modal/index.js +9 -3
  76. package/dist/components/modal/modal.js +390 -365
  77. package/dist/components/pagination/pagination.js +105 -96
  78. package/dist/components/popconfirm/popconfirm.d.ts +1 -1
  79. package/dist/components/popconfirm/popconfirm.js +219 -168
  80. package/dist/components/popover/popover.js +330 -243
  81. package/dist/components/progress/progress.css +2 -2
  82. package/dist/components/progress/progress.js +232 -458
  83. package/dist/components/qr-code/qr-code.js +72 -66
  84. package/dist/components/radio/radio.css +15 -4
  85. package/dist/components/radio/radio.d.ts +2 -1
  86. package/dist/components/radio/radio.js +260 -198
  87. package/dist/components/rate/rate.js +173 -113
  88. package/dist/components/scroll-area/scroll-area.js +241 -211
  89. package/dist/components/segmented/segmented.js +73 -41
  90. package/dist/components/select/mobile-select.d.ts +2 -1
  91. package/dist/components/select/mobile-select.js +24 -13
  92. package/dist/components/select/select-searchable-list.d.ts +2 -1
  93. package/dist/components/select/select-searchable-list.js +2 -3
  94. package/dist/components/select/select.js +49 -25
  95. package/dist/components/select/use-select-selection.d.ts +1 -1
  96. package/dist/components/select/use-select-selection.js +7 -4
  97. package/dist/components/skeleton/skeleton.js +56 -48
  98. package/dist/components/slider/slider.js +87 -212
  99. package/dist/components/sonner/sonner.js +109 -93
  100. package/dist/components/spinner/spinner.js +147 -138
  101. package/dist/components/splitter/splitter.js +222 -159
  102. package/dist/components/statistic/statistic.js +7 -6
  103. package/dist/components/steps/steps.js +88 -81
  104. package/dist/components/steps/use-display-steps.js +1 -1
  105. package/dist/components/switch/switch.js +89 -89
  106. package/dist/components/table/table-filter.js +66 -56
  107. package/dist/components/table/table-icons.d.ts +2 -1
  108. package/dist/components/table/table-icons.js +11 -9
  109. package/dist/components/table/table-model.js +1 -1
  110. package/dist/components/table/table.js +107 -83
  111. package/dist/components/table/use-table-data.d.ts +6 -3
  112. package/dist/components/table/use-table-data.js +166 -130
  113. package/dist/components/tabs/tabs.css +1 -1
  114. package/dist/components/tabs/tabs.js +236 -179
  115. package/dist/components/tag/tag.d.ts +2 -2
  116. package/dist/components/tag/tag.js +111 -108
  117. package/dist/components/textarea/textarea.js +22 -17
  118. package/dist/components/time-picker/time-picker.js +5 -3
  119. package/dist/components/timeline/timeline.css +6 -1
  120. package/dist/components/timeline/timeline.js +21 -11
  121. package/dist/components/tooltip/tooltip.d.ts +2 -2
  122. package/dist/components/tooltip/tooltip.js +123 -233
  123. package/dist/components/tour/tour.css +4 -0
  124. package/dist/components/tour/tour.js +400 -331
  125. package/dist/components/transfer/transfer-list.js +29 -11
  126. package/dist/components/transfer/transfer-parts.js +1 -1
  127. package/dist/components/transfer/transfer-types.d.ts +1 -0
  128. package/dist/components/transfer/transfer.js +29 -14
  129. package/dist/components/tree/tree-keyboard.d.ts +1 -1
  130. package/dist/components/tree/tree-keyboard.js +5 -3
  131. package/dist/components/tree/tree.js +74 -59
  132. package/dist/components/tree-select/select-engine.d.ts +3 -2
  133. package/dist/components/tree-select/select-engine.js +18 -16
  134. package/dist/components/tree-select/tree-select.js +21 -5
  135. package/dist/components/upload/upload.css +8 -0
  136. package/dist/components/upload/upload.js +160 -72
  137. package/dist/components/watermark/watermark.js +36 -29
  138. package/dist/number-input/use-number-input.js +129 -90
  139. package/dist/number-input/validate.js +32 -5
  140. package/dist/provider/merge-locale.js +12 -9
  141. package/dist/provider/tao-provider.d.ts +3 -1
  142. package/dist/provider/tao-provider.js +123 -86
  143. package/package.json +1 -1
@@ -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
- function usePreviewContainer(getContainer) {
12
- const $ = c(13);
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
- let t2;
22
- if ($[1] !== compact || $[2] !== mode || $[3] !== tokenStyle) {
23
- t1 = ()=>{
24
- for (const container of containers.current){
25
- if ("light" === mode) delete container.dataset.taoTheme;
26
- else container.dataset.taoTheme = mode;
27
- if (compact) container.dataset.taoDensity = "compact";
28
- else delete container.dataset.taoDensity;
29
- container.removeAttribute("style");
30
- for (const [key, value] of Object.entries(tokenStyle ?? {}))container.style.setProperty(key, String(value));
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
- t2 = [
29
+ t1 = [
34
30
  tokenStyle,
35
31
  mode,
36
32
  compact
37
33
  ];
38
- $[1] = compact;
39
- $[2] = mode;
40
- $[3] = tokenStyle;
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(t1, t2);
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
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
51
- t3 = ()=>()=>{
52
- for (const container_0 of containers.current)container_0.remove();
53
- containers.current = [];
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
- t4 = [];
56
- $[6] = t3;
57
- $[7] = t4;
72
+ t5 = [];
73
+ $[9] = t4;
74
+ $[10] = t5;
58
75
  } else {
59
- t3 = $[6];
60
- t4 = $[7];
76
+ t4 = $[9];
77
+ t5 = $[10];
61
78
  }
62
- useEffect(t3, t4);
79
+ useEffect(t4, t5);
80
+ if (disabled) return;
63
81
  if (false === getContainer) return false;
64
- let t5;
65
- if ($[8] !== compact || $[9] !== getContainer || $[10] !== mode || $[11] !== tokenStyle) {
66
- t5 = ()=>{
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
- if (!target) return null;
69
- const existing = containers.current.find((container_1)=>container_1.parentNode === target);
70
- if (existing) return existing;
71
- const container_2 = document.createElement("div");
72
- container_2.dataset.taoImagePopup = "";
73
- container_2.dataset.taoProvider = "";
74
- if ("light" !== mode) container_2.dataset.taoTheme = mode;
75
- if (compact) container_2.dataset.taoDensity = "compact";
76
- for (const [key_0, value_0] of Object.entries(tokenStyle ?? {}))container_2.style.setProperty(key_0, String(value_0));
77
- target.appendChild(container_2);
78
- containers.current.push(container_2);
79
- return container_2;
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
- $[8] = compact;
82
- $[9] = getContainer;
83
- $[10] = mode;
84
- $[11] = tokenStyle;
85
- $[12] = t5;
86
- } else t5 = $[12];
87
- return t5;
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(58);
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 container = usePreviewContainer(getContainer);
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] !== mask) {
135
- t1 = "object" != typeof mask || null === mask || /*#__PURE__*/ isValidElement(mask) || Array.isArray(mask) ? void 0 : mask;
136
- $[10] = mask;
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.close) {
172
+ if ($[12] !== locale.previous) {
142
173
  t2 = /*#__PURE__*/ jsx(ImageControlIcon, {
143
- name: "close",
144
- label: locale.close
174
+ name: "prev",
175
+ label: locale.previous
145
176
  });
146
- $[12] = locale.close;
177
+ $[12] = locale.previous;
147
178
  $[13] = t2;
148
179
  } else t2 = $[13];
149
180
  let t3;
150
- if ($[14] !== locale.previous) {
181
+ if ($[14] !== locale.next) {
151
182
  t3 = /*#__PURE__*/ jsx(ImageControlIcon, {
152
- name: "prev",
153
- label: locale.previous
183
+ name: "next",
184
+ label: locale.next
154
185
  });
155
- $[14] = locale.previous;
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 ($[18] === Symbol.for("react.memo_cache_sentinel")) {
174
- t5 = /*#__PURE__*/ jsx(ImageControlIcon, {
195
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
196
+ t4 = /*#__PURE__*/ jsx(ImageControlIcon, {
175
197
  name: "rotateLeft"
176
198
  });
177
- t6 = /*#__PURE__*/ jsx(ImageControlIcon, {
199
+ t5 = /*#__PURE__*/ jsx(ImageControlIcon, {
178
200
  name: "rotateRight"
179
201
  });
180
- t7 = /*#__PURE__*/ jsx(ImageControlIcon, {
202
+ t6 = /*#__PURE__*/ jsx(ImageControlIcon, {
181
203
  name: "zoomIn"
182
204
  });
183
- t8 = /*#__PURE__*/ jsx(ImageControlIcon, {
205
+ t7 = /*#__PURE__*/ jsx(ImageControlIcon, {
184
206
  name: "zoomOut"
185
207
  });
186
- t9 = /*#__PURE__*/ jsx(ImageControlIcon, {
208
+ t8 = /*#__PURE__*/ jsx(ImageControlIcon, {
187
209
  name: "flipX"
188
210
  });
189
- t10 = /*#__PURE__*/ jsx(ImageControlIcon, {
211
+ t9 = /*#__PURE__*/ jsx(ImageControlIcon, {
190
212
  name: "flipY"
191
213
  });
192
- $[18] = t10;
193
- $[19] = t5;
194
- $[20] = t6;
195
- $[21] = t7;
196
- $[22] = t8;
197
- $[23] = t9;
214
+ $[16] = t4;
215
+ $[17] = t5;
216
+ $[18] = t6;
217
+ $[19] = t7;
218
+ $[20] = t8;
219
+ $[21] = t9;
198
220
  } else {
199
- t10 = $[18];
200
- t5 = $[19];
201
- t6 = $[20];
202
- t7 = $[21];
203
- t8 = $[22];
204
- t9 = $[23];
221
+ t4 = $[16];
222
+ t5 = $[17];
223
+ t6 = $[18];
224
+ t7 = $[19];
225
+ t8 = $[20];
226
+ t9 = $[21];
205
227
  }
206
- let t11;
207
- if ($[24] !== raw.icons || $[25] !== t2 || $[26] !== t3 || $[27] !== t4) {
208
- t11 = {
209
- close: t2,
210
- prev: t3,
211
- next: t4,
212
- rotateLeft: t5,
213
- rotateRight: t6,
214
- zoomIn: t7,
215
- zoomOut: t8,
216
- flipX: t9,
217
- flipY: t10,
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
- $[24] = raw.icons;
221
- $[25] = t2;
222
- $[26] = t3;
223
- $[27] = t4;
224
- $[28] = t11;
225
- } else t11 = $[28];
226
- const icons = t11;
227
- let t12;
228
- if ($[29] !== locale.messages.flipX || $[30] !== locale.messages.flipY || $[31] !== locale.messages.rotateLeft || $[32] !== locale.messages.rotateRight || $[33] !== locale.messages.zoomIn || $[34] !== locale.messages.zoomOut || $[35] !== locale.next || $[36] !== locale.previous) {
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
- t12 = (node)=>{
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
- $[29] = locale.messages.flipX;
247
- $[30] = locale.messages.flipY;
248
- $[31] = locale.messages.rotateLeft;
249
- $[32] = locale.messages.rotateRight;
250
- $[33] = locale.messages.zoomIn;
251
- $[34] = locale.messages.zoomOut;
252
- $[35] = locale.next;
253
- $[36] = locale.previous;
254
- $[37] = t12;
255
- } else t12 = $[37];
256
- const localizeAction = t12;
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 t13;
259
- if ($[38] !== localizeAction || $[39] !== renderActions) {
260
- t13 = (original, info)=>{
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
- $[38] = localizeAction;
278
- $[39] = renderActions;
279
- $[40] = t13;
280
- } else t13 = $[40];
281
- const actionsRender = t13;
282
- const t14 = false === preview;
283
- const t15 = false === mask || maskConfig?.enabled === false;
284
- const t16 = maskConfig?.blur;
285
- const t17 = open ?? visible;
286
- const t18 = maskConfig?.closable ?? true;
287
- let t19;
288
- if ($[41] !== mask) {
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: t17,
312
+ open: t15,
300
313
  rootClassName,
301
314
  getContainer: container,
302
315
  icons,
303
316
  motionName: "tao-image-preview-fade",
304
- maskClosable: t18,
305
- actionsRender,
306
- ...t19
317
+ maskClosable: t16,
318
+ actionsRender
307
319
  };
308
- $[43] = actionsRender;
309
- $[44] = container;
310
- $[45] = icons;
311
- $[46] = rest;
312
- $[47] = rootClassName;
313
- $[48] = t17;
314
- $[49] = t18;
315
- $[50] = t19;
316
- $[51] = t20;
317
- } else t20 = $[51];
318
- let t21;
319
- if ($[52] !== raw || $[53] !== t14 || $[54] !== t15 || $[55] !== t16 || $[56] !== t20) {
320
- t21 = {
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
- hiddenMask: t15,
324
- blurMask: t16,
325
- config: t20
334
+ maskCover,
335
+ hiddenMask: t13,
336
+ blurMask: t14,
337
+ config: t17
326
338
  };
327
- $[52] = raw;
328
- $[53] = t14;
329
- $[54] = t15;
330
- $[55] = t16;
331
- $[56] = t20;
332
- $[57] = t21;
333
- } else t21 = $[57];
334
- return t21;
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(54);
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
- let t6;
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
- t6 = hasPercent ? {
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] = t6;
404
- } else t6 = $[17];
405
- const progressAria = t6;
406
- let t7;
407
- if ($[18] !== cn?.rail || $[19] !== hasPercent || $[20] !== percent || $[21] !== st?.rail) {
408
- t7 = hasPercent ? /*#__PURE__*/ jsx("div", {
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
- $[18] = cn?.rail;
419
- $[19] = hasPercent;
420
- $[20] = percent;
421
- $[21] = st?.rail;
422
- $[22] = t7;
423
- } else t7 = $[22];
424
- const bar = t7;
425
- const t8 = classes?.root;
426
- const t9 = cn?.root;
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 ($[28] !== props.height || $[29] !== props.style || $[30] !== props.width || $[31] !== props.wrapperStyle || $[32] !== t11 || $[33] !== t12 || $[34] !== tokenStyle) {
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
- ...t11,
472
+ ...t14,
446
473
  ...props.style,
447
- ...t12
474
+ ...t15
448
475
  };
449
- $[28] = props.height;
450
- $[29] = props.style;
451
- $[30] = props.width;
452
- $[31] = props.wrapperStyle;
453
- $[32] = t11;
454
- $[33] = t12;
455
- $[34] = tokenStyle;
456
- $[35] = t13;
457
- } else t13 = $[35];
458
- const t14 = cn?.content;
459
- const t15 = st?.content;
460
- let t16;
461
- if ($[36] !== bar || $[37] !== cn?.indicator || $[38] !== hasPercent || $[39] !== percent || $[40] !== percentText || $[41] !== placeholder || $[42] !== progress || $[43] !== st?.indicator) {
462
- t16 = placeholder ?? (progress?.render ? progress.render(bar, percent) : /*#__PURE__*/ jsxs(Fragment, {
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
- $[36] = bar;
473
- $[37] = cn?.indicator;
474
- $[38] = hasPercent;
475
- $[39] = percent;
476
- $[40] = percentText;
477
- $[41] = placeholder;
478
- $[42] = progress;
479
- $[43] = st?.indicator;
480
- $[44] = t16;
481
- } else t16 = $[44];
482
- let t17;
483
- if ($[45] !== t14 || $[46] !== t15 || $[47] !== t16) {
484
- t17 = /*#__PURE__*/ jsx("div", {
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: t14,
487
- style: t15,
488
- children: t16
513
+ className: t17,
514
+ style: t18,
515
+ children: t19
489
516
  });
490
- $[45] = t14;
491
- $[46] = t15;
492
- $[47] = t16;
493
- $[48] = t17;
494
- } else t17 = $[48];
495
- let t18;
496
- if ($[49] !== progressAria || $[50] !== t10 || $[51] !== t13 || $[52] !== t17) {
497
- t18 = /*#__PURE__*/ jsx("div", {
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: t10,
500
- style: t13,
526
+ className: t13,
527
+ style: t16,
501
528
  ...progressAria,
502
- children: t17
529
+ children: t20
503
530
  });
504
- $[49] = progressAria;
505
- $[50] = t10;
506
- $[51] = t13;
507
- $[52] = t17;
508
- $[53] = t18;
509
- } else t18 = $[53];
510
- return t18;
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(64);
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
- const isProgressConfig = null !== placeholder && "object" == typeof placeholder && !/*#__PURE__*/ isValidElement(placeholder) && "progress" in placeholder;
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
- if (progress || !props.src && placeholder && !isProgressConfig) {
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 ($[25] !== classes || $[26] !== t5) {
604
- t6 = {
605
- ...classes,
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
- $[25] = classes;
609
- $[26] = t5;
610
- $[27] = t6;
611
- } else t6 = $[27];
612
- const t7 = css?.root;
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 ($[28] !== t7 || $[29] !== tokenStyle || $[30] !== wrapperStyle) {
615
- t8 = {
616
- ...tokenStyle,
617
- ...wrapperStyle,
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
- const t9 = css?.popup;
626
- const t10 = css?.popup?.root;
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 ($[32] !== t10 || $[33] !== tokenStyle) {
670
+ if ($[35] !== t10 || $[36] !== tokenStyle || $[37] !== wrapperStyle) {
629
671
  t11 = {
630
672
  ...tokenStyle,
673
+ ...wrapperStyle,
631
674
  ...t10
632
675
  };
633
- $[32] = t10;
634
- $[33] = tokenStyle;
635
- $[34] = t11;
636
- } else t11 = $[34];
637
- let t12;
638
- if ($[35] !== hiddenMask) {
639
- t12 = hiddenMask ? {
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
- $[35] = hiddenMask;
643
- $[36] = t12;
644
- } else t12 = $[36];
645
- let t13;
646
- if ($[37] !== blurMask) {
647
- t13 = blurMask ? {
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
- $[37] = blurMask;
651
- $[38] = t13;
652
- } else t13 = $[38];
653
- const t14 = css?.popup?.mask;
654
- let t15;
655
- if ($[39] !== t12 || $[40] !== t13 || $[41] !== t14) {
656
- t15 = {
657
- ...t12,
658
- ...t13,
659
- ...t14
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
- $[39] = t12;
662
- $[40] = t13;
663
- $[41] = t14;
664
- $[42] = t15;
665
- } else t15 = $[42];
666
- let t16;
667
- if ($[43] !== t11 || $[44] !== t15 || $[45] !== t9) {
668
- t16 = {
669
- ...t9,
670
- root: t11,
671
- mask: t15
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
- $[43] = t11;
674
- $[44] = t15;
675
- $[45] = t9;
676
- $[46] = t16;
677
- } else t16 = $[46];
678
- let t17;
679
- if ($[47] !== css || $[48] !== t16 || $[49] !== t8) {
680
- t17 = {
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: t8,
683
- popup: t16
738
+ root: t11,
739
+ popup: t19
684
740
  };
685
- $[47] = css;
686
- $[48] = t16;
687
- $[49] = t8;
688
- $[50] = t17;
689
- } else t17 = $[50];
690
- const t18 = isProgressConfig ? void 0 : placeholder;
691
- let t19;
692
- if ($[51] !== config || $[52] !== disabled || $[53] !== raw.cover || $[54] !== raw.onOpenChange || $[55] !== raw.onVisibleChange) {
693
- t19 = disabled ? false : {
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
- cover: raw.cover ?? config.cover ?? /*#__PURE__*/ jsx("span", {
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: raw.onOpenChange ?? (raw.onVisibleChange ? (open)=>raw.onVisibleChange(open, !open) : void 0)
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
- $[51] = config;
702
- $[52] = disabled;
703
- $[53] = raw.cover;
704
- $[54] = raw.onOpenChange;
705
- $[55] = raw.onVisibleChange;
706
- $[56] = t19;
707
- } else t19 = $[56];
708
- let t20;
709
- if ($[57] !== prefixCls || $[58] !== rest || $[59] !== t17 || $[60] !== t18 || $[61] !== t19 || $[62] !== t6) {
710
- t20 = /*#__PURE__*/ jsx("span", {
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: t6,
718
- styles: t17,
719
- placeholder: t18,
720
- preview: t19
778
+ classNames: t9,
779
+ styles: t20,
780
+ placeholder: t21,
781
+ preview: t22
721
782
  })
722
783
  });
723
- $[57] = prefixCls;
724
- $[58] = rest;
725
- $[59] = t17;
726
- $[60] = t18;
727
- $[61] = t19;
728
- $[62] = t6;
729
- $[63] = t20;
730
- } else t20 = $[63];
731
- return t20;
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(42);
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 { disabled, config, hiddenMask, blurMask } = usePreviewOptions(preview);
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
- const t3 = css?.popup;
785
- const t4 = css?.popup?.root;
786
- let t5;
787
- if ($[14] !== t4 || $[15] !== tokenStyle) {
788
- t5 = {
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
- ...t4
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
- } else t6 = $[18];
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
- const t8 = css?.popup?.mask;
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 ($[21] !== t6 || $[22] !== t7 || $[23] !== t8) {
815
- t9 = {
816
- ...t6,
817
- ...t7,
818
- ...t8
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
- let t10;
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 ($[29] !== css || $[30] !== t10) {
895
+ if ($[25] !== t10 || $[26] !== t8 || $[27] !== t9) {
839
896
  t11 = {
840
- ...css,
841
- popup: t10
897
+ ...t8,
898
+ ...t9,
899
+ ...t10
842
900
  };
843
- $[29] = css;
844
- $[30] = t10;
845
- $[31] = t11;
846
- } else t11 = $[31];
901
+ $[25] = t10;
902
+ $[26] = t8;
903
+ $[27] = t9;
904
+ $[28] = t11;
905
+ } else t11 = $[28];
847
906
  let t12;
848
- if ($[32] !== config || $[33] !== disabled || $[34] !== raw) {
849
- t12 = disabled ? false : {
850
- ...config,
851
- onOpenChange: raw.onOpenChange ?? (raw.onVisibleChange ? (open, info)=>raw.onVisibleChange(open, !open, info.current) : void 0)
907
+ if ($[29] !== t11 || $[30] !== t5 || $[31] !== t7) {
908
+ t12 = {
909
+ ...t5,
910
+ root: t7,
911
+ mask: t11
852
912
  };
853
- $[32] = config;
854
- $[33] = disabled;
855
- $[34] = raw;
856
- $[35] = t12;
857
- } else t12 = $[35];
913
+ $[29] = t11;
914
+ $[30] = t5;
915
+ $[31] = t7;
916
+ $[32] = t12;
917
+ } else t12 = $[32];
858
918
  let t13;
859
- if ($[36] !== children || $[37] !== classes || $[38] !== rest || $[39] !== t11 || $[40] !== t12) {
860
- t13 = /*#__PURE__*/ jsx("span", {
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: t11,
867
- preview: t12,
868
- children: children
974
+ styles: t13,
975
+ preview: t18,
976
+ children: t19
869
977
  })
870
978
  });
871
- $[36] = children;
872
- $[37] = classes;
873
- $[38] = rest;
874
- $[39] = t11;
875
- $[40] = t12;
876
- $[41] = t13;
877
- } else t13 = $[41];
878
- return t13;
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