fangguo-component 1.2.4 → 1.2.6

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.
@@ -30,32 +30,14 @@ var __objRest = (source, exclude) => {
30
30
  return target;
31
31
  };
32
32
  import { ElWatermark } from "element-plus/es";
33
- import { defineComponent, useAttrs, ref, computed, watch, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, createVNode, withCtx, Fragment, renderSlot, createBlock, createElementVNode, createSlots, normalizeProps, guardReactiveProps, createCommentVNode, mergeProps, withModifiers } from "vue";
33
+ import { defineComponent, useAttrs, ref, computed, watch, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, createVNode, withCtx, Fragment, renderSlot, normalizeProps, mergeProps, createBlock, createElementVNode, createSlots, guardReactiveProps, createCommentVNode, withModifiers } from "vue";
34
34
  import { L as LazyPopover } from "./LazyPopover-CcvilJ6U.js";
35
- import { V as ViewImgErrorFallback, F as FgViewImg, u as useViewImgDefaults } from "./ViewImg-CD4QJK4R.js";
36
- import { m as montageImgUrl } from "./montageImgUrl-DP5jMHCX.js";
35
+ import { V as ViewImgErrorFallback, F as FgViewImg, u as useViewImgDefaults } from "./ViewImg-CLRjYOUN.js";
36
+ import { h as hasPlatformImageResizeParams, m as montageImgUrl } from "./montageImgUrl-B9ZmJ7TF.js";
37
37
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
38
- const _hoisted_1 = {
39
- key: 1,
40
- class: "fg-view-img-popover__loading-icon",
41
- viewBox: "0 0 1280 1024"
42
- };
43
- const _hoisted_2 = ["fill"];
44
- const _hoisted_3 = {
45
- key: 1,
46
- class: "fg-view-img-popover__loading-icon",
47
- viewBox: "0 0 1280 1024"
48
- };
49
- const _hoisted_4 = ["fill"];
50
- const _hoisted_5 = {
51
- key: 1,
52
- class: "fg-view-img-popover__loading-icon",
53
- viewBox: "0 0 1280 1024"
54
- };
55
- const _hoisted_6 = ["fill"];
56
38
  const HOVER_POPOVER_PADDING = 10;
57
- const HOVER_POPOVER_MAX_HEIGHT = 400;
58
- const DEFAULT_LOADING_ICON_COLOR = "#cfd2d7";
39
+ const DEFAULT_HOVER_BOX_WIDTH = 400;
40
+ const DEFAULT_HOVER_BOX_HEIGHT = 380;
59
41
  const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
60
42
  inheritAttrs: false
61
43
  }), {
@@ -81,18 +63,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
81
63
  maxScale: {},
82
64
  showProgress: { type: Boolean },
83
65
  toolbarBgColor: {},
84
- backgroundColor: {},
66
+ hoverBackgroundColor: {},
67
+ hoverBoxWidth: {},
68
+ hoverBoxHeight: {},
85
69
  toolbarIconColor: {},
86
70
  simpleExtraTools: {},
87
71
  renderExtraTools: {},
88
72
  originalToolbar: {},
89
- errorColor: {},
90
- errorOffset: {},
73
+ fallbackColor: {},
91
74
  errorText: {},
92
75
  ossProcess: { type: Boolean, default: true },
93
76
  ossLinks: {},
94
77
  imgSize: {},
95
78
  previewStripQuery: { type: Boolean, default: true },
79
+ previewSideNav: { type: [Boolean, String] },
80
+ scrollContainer: { default: null },
96
81
  hoverSrc: { default: "" },
97
82
  previewSrc: { default: "" },
98
83
  hoverImgSize: { default: void 0 },
@@ -126,6 +111,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
126
111
  return () => props2.render(props2.payload);
127
112
  }
128
113
  });
114
+ const resolvedWaterMarkTitle = computed(() => {
115
+ var _a, _b;
116
+ return (_b = (_a = props.waterMarkTitle) != null ? _a : viewImgDefaults.waterMarkTitle) != null ? _b : "";
117
+ });
118
+ const resolvedFallbackColor = computed(
119
+ () => {
120
+ var _a, _b;
121
+ return ((_a = props.fallbackColor) == null ? void 0 : _a.trim()) || ((_b = props.loadingIconColor) == null ? void 0 : _b.trim()) || viewImgDefaults.loadingIconColor || "";
122
+ }
123
+ );
124
+ const resolvedHoverBackgroundColor = computed(() => {
125
+ var _a;
126
+ return ((_a = props.hoverBackgroundColor) == null ? void 0 : _a.trim()) || "";
127
+ });
128
+ const shouldEnableReferencePreview = computed(() => {
129
+ var _a;
130
+ return props.preview || !!((_a = props.previewSrcList) == null ? void 0 : _a.length);
131
+ });
129
132
  const viewImgProps = computed(() => {
130
133
  const _a = props, {
131
134
  hoverSrc: _h,
@@ -136,7 +139,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
136
139
  waterMarkTitle: _wt,
137
140
  showPreviewIcon: _spi,
138
141
  showHoverOnError: _shoe,
139
- loadingIconColor: _lic
142
+ loadingIconColor: _lic,
143
+ fallbackColor: _fc,
144
+ hoverBackgroundColor: _hbc,
145
+ hoverBoxWidth: _hbw,
146
+ hoverBoxHeight: _hbh
140
147
  } = _a, rest = __objRest(_a, [
141
148
  "hoverSrc",
142
149
  "previewSrc",
@@ -146,14 +153,29 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
146
153
  "waterMarkTitle",
147
154
  "showPreviewIcon",
148
155
  "showHoverOnError",
149
- "loadingIconColor"
156
+ "loadingIconColor",
157
+ "fallbackColor",
158
+ "hoverBackgroundColor",
159
+ "hoverBoxWidth",
160
+ "hoverBoxHeight"
150
161
  ]);
151
162
  return __spreadProps(__spreadValues({}, rest), {
163
+ fallbackColor: resolvedFallbackColor.value,
152
164
  previewSrcList: shouldEnableReferencePreview.value ? resolvePopoverPreviewSrcList() : []
153
165
  });
154
166
  });
155
167
  const referenceViewImgBind = computed(() => {
156
- const _a = attrs, { class: _class, style: _style } = _a, rest = __objRest(_a, ["class", "style"]);
168
+ const _a = attrs, {
169
+ class: _class,
170
+ style: _style,
171
+ backgroundColor: _backgroundColor,
172
+ "background-color": _backgroundColorKebab
173
+ } = _a, rest = __objRest(_a, [
174
+ "class",
175
+ "style",
176
+ "backgroundColor",
177
+ "background-color"
178
+ ]);
157
179
  return __spreadValues(__spreadValues({}, rest), viewImgProps.value);
158
180
  });
159
181
  const handlePreviewIconClick = () => {
@@ -166,29 +188,31 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
166
188
  if (typeof extra === "string") return extra;
167
189
  return __spreadValues(__spreadValues({}, base), extra);
168
190
  };
169
- const HOVER_POPOVER_MAX_HEIGHT_CSS = `${HOVER_POPOVER_MAX_HEIGHT}px`;
170
- const HOVER_IMAGE_MAX_HEIGHT_CSS = `${HOVER_POPOVER_MAX_HEIGHT - HOVER_POPOVER_PADDING * 2}px`;
171
191
  const DEFAULT_HOVER_IMG_SIZE = { h: 420 };
172
- const resolvedWaterMarkTitle = computed(() => {
192
+ const formatCssSize = (size) => typeof size === "number" ? `${size}px` : size;
193
+ const resolvedHoverBoxWidth = computed(() => {
173
194
  var _a, _b;
174
- return (_b = (_a = props.waterMarkTitle) != null ? _a : viewImgDefaults.waterMarkTitle) != null ? _b : "";
195
+ const width = (_b = props.hoverBoxWidth) != null ? _b : (_a = props.hoverPopoverProps) == null ? void 0 : _a.width;
196
+ return width != null ? width : DEFAULT_HOVER_BOX_WIDTH;
175
197
  });
176
- const resolvedLoadingIconColor = computed(
198
+ const resolvedHoverBoxHeightCss = computed(
177
199
  () => {
178
- var _a, _b;
179
- return (_b = (_a = props.loadingIconColor) != null ? _a : viewImgDefaults.loadingIconColor) != null ? _b : DEFAULT_LOADING_ICON_COLOR;
200
+ var _a;
201
+ return formatCssSize((_a = props.hoverBoxHeight) != null ? _a : DEFAULT_HOVER_BOX_HEIGHT);
180
202
  }
181
203
  );
204
+ const resolvedHoverPopoverMaxHeight = computed(
205
+ () => `calc(${resolvedHoverBoxHeightCss.value} + ${HOVER_POPOVER_PADDING * 2}px)`
206
+ );
182
207
  const defaultSlotPayload = computed(() => {
183
- var _a, _b, _c, _d;
208
+ var _a, _b;
184
209
  return {
185
210
  src: props.src,
186
211
  displaySrc: ((_a = viewImgRef.value) == null ? void 0 : _a.displaySrc) || props.src,
187
212
  loading: !!props.loading,
188
213
  loadError: referenceLoadError.value,
189
214
  errorText: (_b = props.errorText) != null ? _b : "",
190
- errorColor: (_c = props.errorColor) != null ? _c : "#f5f5f5",
191
- errorOffset: (_d = props.errorOffset) != null ? _d : 0
215
+ fallbackColor: resolvedFallbackColor.value
192
216
  };
193
217
  });
194
218
  const isReferenceInvalid = computed(() => !props.src.trim() || referenceLoadError.value);
@@ -198,23 +222,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
198
222
  const canShowPreviewIcon = computed(
199
223
  () => props.showPreviewIcon && !isReferenceInvalid.value
200
224
  );
201
- const shouldEnableReferencePreview = computed(() => {
202
- var _a;
203
- return props.preview || !!((_a = props.previewSrcList) == null ? void 0 : _a.length);
204
- });
205
225
  const hoverPopoverPropsMerged = computed(() => {
206
226
  var _a;
207
- const _b = (_a = props.hoverPopoverProps) != null ? _a : {}, { popperStyle: userPopperStyle, popperClass: userPopperClass } = _b, restHoverPopoverProps = __objRest(_b, ["popperStyle", "popperClass"]);
227
+ const _b = (_a = props.hoverPopoverProps) != null ? _a : {}, {
228
+ width: _userWidth,
229
+ popperStyle: userPopperStyle,
230
+ popperClass: userPopperClass
231
+ } = _b, restHoverPopoverProps = __objRest(_b, [
232
+ "width",
233
+ "popperStyle",
234
+ "popperClass"
235
+ ]);
208
236
  const popperClass = [userPopperClass, "fg-view-img-popover"].filter(Boolean).join(" ");
209
237
  return __spreadValues({
210
238
  placement: "right",
211
239
  trigger: "hover",
212
- width: 400,
240
+ width: resolvedHoverBoxWidth.value,
213
241
  teleported: true,
214
242
  popperClass,
215
243
  popperStyle: mergePopperStyle(
216
244
  {
217
- maxHeight: HOVER_POPOVER_MAX_HEIGHT_CSS,
245
+ maxHeight: resolvedHoverPopoverMaxHeight.value,
218
246
  overflow: "hidden",
219
247
  padding: `${HOVER_POPOVER_PADDING}px`,
220
248
  boxSizing: "border-box"
@@ -223,10 +251,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
223
251
  )
224
252
  }, restHoverPopoverProps);
225
253
  });
226
- const resolveImgUrl = (url, imgSize) => {
227
- if (!props.ossProcess) return url;
228
- return montageImgUrl(url, imgSize, props.ossLinks ? { ossLinks: props.ossLinks } : void 0);
229
- };
230
254
  const stripQueryParams = (url) => {
231
255
  const index = url.indexOf("?");
232
256
  return index === -1 ? url : url.slice(0, index);
@@ -244,30 +268,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
244
268
  if (!props.src.trim()) return [];
245
269
  return [applyPreviewUrlFallback(props.src)];
246
270
  };
247
- const resolveResizeProcess = (imgSize) => {
248
- const { w, h, s, l } = imgSize != null ? imgSize : {};
249
- if (w) return `resize,w_${w}`;
250
- if (h) return `resize,h_${h}`;
251
- if (s) return `resize,s_${s}`;
252
- if (l) return `resize,l_${l}`;
253
- return "resize,h_420";
254
- };
255
- const replaceOssResizeProcess = (url, imgSize) => {
256
- const resizeProcess = resolveResizeProcess(imgSize);
257
- if (url.includes("x-oss-process=image/resize,")) {
258
- return url.replace(/image\/resize,[^/?&#]+/, `image/${resizeProcess}`);
259
- }
260
- if (url.includes("x-oss-process=image/")) {
261
- return url.replace("x-oss-process=image/", `x-oss-process=image/${resizeProcess}/`);
262
- }
263
- return "";
264
- };
265
271
  const resolveHoverImgUrl = (url, imgSize) => {
266
272
  if (!url.trim()) return "";
267
- if (!props.ossProcess) return url;
268
- const replaced = replaceOssResizeProcess(url, imgSize);
269
- if (replaced) return replaced;
270
- return resolveImgUrl(url, imgSize);
273
+ const options = props.ossLinks ? { ossLinks: props.ossLinks } : void 0;
274
+ const hasResizeParams = hasPlatformImageResizeParams(url);
275
+ if (hasResizeParams) {
276
+ return montageImgUrl(url, imgSize, options);
277
+ }
278
+ if (props.ossProcess) {
279
+ return montageImgUrl(url, imgSize, options);
280
+ }
281
+ return url;
271
282
  };
272
283
  const handleReferenceLoad = (event) => {
273
284
  referenceLoadError.value = false;
@@ -289,13 +300,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
289
300
  );
290
301
  const hoverPreviewSrc = computed(() => {
291
302
  var _a;
292
- const hoverSource = props.hoverSrc || props.src;
293
- if (props.hoverSrc && !props.hoverImgSize) return props.hoverSrc;
303
+ const hoverSource = (props.hoverSrc || props.src).trim();
304
+ if (!hoverSource) return "";
305
+ if (props.hoverSrc && props.hoverImgSize == null) return props.hoverSrc;
294
306
  return resolveHoverImgUrl(hoverSource, (_a = props.hoverImgSize) != null ? _a : DEFAULT_HOVER_IMG_SIZE);
295
307
  });
296
308
  const hoverImgStyle = computed(() => ({
297
309
  width: "100%",
298
- height: HOVER_IMAGE_MAX_HEIGHT_CSS
310
+ height: resolvedHoverBoxHeightCss.value,
311
+ backgroundColor: resolvedHoverBackgroundColor.value || void 0
312
+ }));
313
+ const hoverWatermarkStyle = computed(() => ({
314
+ width: "100%",
315
+ height: resolvedHoverBoxHeightCss.value,
316
+ maxHeight: resolvedHoverBoxHeightCss.value
299
317
  }));
300
318
  return (_ctx, _cache) => {
301
319
  const _component_el_watermark = ElWatermark;
@@ -326,12 +344,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
326
344
  key: 0,
327
345
  render: unref(viewImgDefaults).placeholder,
328
346
  payload: slotProps
329
- }, null, 8, ["render", "payload"])) : (openBlock(), createElementBlock("svg", _hoisted_1, [
330
- createElementVNode("path", {
331
- d: "M1174.826667 0H105.216A105.258667 105.258667 0 0 0-0.042667 105.258667V918.613333a105.258667 105.258667 0 0 0 105.258667 105.258667h1069.653333A105.258667 105.258667 0 0 0 1280.085333 918.613333V105.258667A105.344 105.344 0 0 0 1174.826667 0z m-402.773334 181.461333a105.386667 105.386667 0 1 1-0.042666 210.773334 105.386667 105.386667 0 0 1 0-210.773334zM104.746667 883.882667S191.018667 381.098667 391.509333 381.098667c196.48 0 246.528 351.616 384.810667 351.616 87.210667 0 78.08-158.72 216.490667-158.72 99.242667 0 162.304 309.888 162.304 309.888H104.789333z",
332
- fill: resolvedLoadingIconColor.value
333
- }, null, 8, _hoisted_2)
334
- ]))
347
+ }, null, 8, ["render", "payload"])) : (openBlock(), createBlock(ViewImgErrorFallback, {
348
+ key: 1,
349
+ loading: "",
350
+ src: slotProps.src,
351
+ "fallback-color": resolvedFallbackColor.value
352
+ }, null, 8, ["src", "fallback-color"]))
335
353
  ], true)
336
354
  ]),
337
355
  _: 2
@@ -346,14 +364,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
346
364
  ]), 1040)
347
365
  ]),
348
366
  default: withCtx(() => [
349
- hoverPreviewSrc.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
350
- referenceLoadError.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
367
+ hoverPreviewSrc.value || __props.showHoverOnError && isReferenceInvalid.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
368
+ referenceLoadError.value || !__props.src.trim() ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
351
369
  !__props.isShowWatermark ? (openBlock(), createElementBlock("div", {
352
370
  key: 0,
353
371
  class: "fg-view-img-popover__hover-image fg-view-img-popover__hover-error",
354
372
  style: normalizeStyle(hoverImgStyle.value)
355
373
  }, [
356
- _ctx.$slots.error ? renderSlot(_ctx.$slots, "error", { key: 0 }, void 0, true) : unref(viewImgDefaults).error ? (openBlock(), createBlock(unref(ViewImgDefaultRenderer), {
374
+ _ctx.$slots.error ? renderSlot(_ctx.$slots, "error", normalizeProps(mergeProps({ key: 0 }, defaultSlotPayload.value)), void 0, true) : unref(viewImgDefaults).error ? (openBlock(), createBlock(unref(ViewImgDefaultRenderer), {
357
375
  key: 1,
358
376
  render: unref(viewImgDefaults).error,
359
377
  payload: defaultSlotPayload.value
@@ -361,11 +379,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
361
379
  key: 2,
362
380
  src: defaultSlotPayload.value.src,
363
381
  "error-text": defaultSlotPayload.value.errorText,
364
- "error-color": defaultSlotPayload.value.errorColor
365
- }, null, 8, ["src", "error-text", "error-color"]))
382
+ "fallback-color": resolvedFallbackColor.value
383
+ }, null, 8, ["src", "error-text", "fallback-color"]))
366
384
  ], 4)) : (openBlock(), createBlock(_component_el_watermark, {
367
385
  key: 1,
368
386
  class: "fg-view-img-popover__watermark",
387
+ style: normalizeStyle(hoverWatermarkStyle.value),
369
388
  content: [resolvedWaterMarkTitle.value],
370
389
  gap: [10, 10],
371
390
  font: { fontSize: 16, color: "rgba(0, 0, 0, 0.3)" }
@@ -375,7 +394,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
375
394
  class: "fg-view-img-popover__hover-image fg-view-img-popover__hover-error",
376
395
  style: normalizeStyle(hoverImgStyle.value)
377
396
  }, [
378
- _ctx.$slots.error ? renderSlot(_ctx.$slots, "error", { key: 0 }, void 0, true) : unref(viewImgDefaults).error ? (openBlock(), createBlock(unref(ViewImgDefaultRenderer), {
397
+ _ctx.$slots.error ? renderSlot(_ctx.$slots, "error", normalizeProps(mergeProps({ key: 0 }, defaultSlotPayload.value)), void 0, true) : unref(viewImgDefaults).error ? (openBlock(), createBlock(unref(ViewImgDefaultRenderer), {
379
398
  key: 1,
380
399
  render: unref(viewImgDefaults).error,
381
400
  payload: defaultSlotPayload.value
@@ -383,12 +402,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
383
402
  key: 2,
384
403
  src: defaultSlotPayload.value.src,
385
404
  "error-text": defaultSlotPayload.value.errorText,
386
- "error-color": defaultSlotPayload.value.errorColor
387
- }, null, 8, ["src", "error-text", "error-color"]))
405
+ "fallback-color": resolvedFallbackColor.value
406
+ }, null, 8, ["src", "error-text", "fallback-color"]))
388
407
  ], 4)
389
408
  ]),
390
409
  _: 3
391
- }, 8, ["content"]))
410
+ }, 8, ["style", "content"]))
392
411
  ], 64)) : !__props.isShowWatermark ? (openBlock(), createBlock(FgViewImg, {
393
412
  key: 1,
394
413
  class: "fg-view-img-popover__hover-image",
@@ -396,8 +415,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
396
415
  style: normalizeStyle(hoverImgStyle.value),
397
416
  preview: false,
398
417
  "oss-process": false,
399
- "error-color": __props.errorColor,
400
- "error-offset": __props.errorOffset,
418
+ "fallback-color": resolvedFallbackColor.value,
401
419
  "error-text": __props.errorText,
402
420
  loading: __props.loading,
403
421
  fit: "contain"
@@ -408,12 +426,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
408
426
  key: 0,
409
427
  render: unref(viewImgDefaults).placeholder,
410
428
  payload: slotProps
411
- }, null, 8, ["render", "payload"])) : (openBlock(), createElementBlock("svg", _hoisted_3, [
412
- createElementVNode("path", {
413
- d: "M1174.826667 0H105.216A105.258667 105.258667 0 0 0-0.042667 105.258667V918.613333a105.258667 105.258667 0 0 0 105.258667 105.258667h1069.653333A105.258667 105.258667 0 0 0 1280.085333 918.613333V105.258667A105.344 105.344 0 0 0 1174.826667 0z m-402.773334 181.461333a105.386667 105.386667 0 1 1-0.042666 210.773334 105.386667 105.386667 0 0 1 0-210.773334zM104.746667 883.882667S191.018667 381.098667 391.509333 381.098667c196.48 0 246.528 351.616 384.810667 351.616 87.210667 0 78.08-158.72 216.490667-158.72 99.242667 0 162.304 309.888 162.304 309.888H104.789333z",
414
- fill: resolvedLoadingIconColor.value
415
- }, null, 8, _hoisted_4)
416
- ]))
429
+ }, null, 8, ["render", "payload"])) : (openBlock(), createBlock(ViewImgErrorFallback, {
430
+ key: 1,
431
+ loading: "",
432
+ src: slotProps.src,
433
+ "fallback-color": resolvedFallbackColor.value
434
+ }, null, 8, ["src", "fallback-color"]))
417
435
  ], true)
418
436
  ]),
419
437
  _: 2
@@ -425,9 +443,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
425
443
  ]),
426
444
  key: "0"
427
445
  } : void 0
428
- ]), 1032, ["src", "style", "error-color", "error-offset", "error-text", "loading"])) : (openBlock(), createBlock(_component_el_watermark, {
446
+ ]), 1032, ["src", "style", "fallback-color", "error-text", "loading"])) : (openBlock(), createBlock(_component_el_watermark, {
429
447
  key: 2,
430
448
  class: "fg-view-img-popover__watermark",
449
+ style: normalizeStyle(hoverWatermarkStyle.value),
431
450
  content: [resolvedWaterMarkTitle.value],
432
451
  gap: [10, 10],
433
452
  font: { fontSize: 16, color: "rgba(0, 0, 0, 0.3)" }
@@ -439,8 +458,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
439
458
  style: normalizeStyle(hoverImgStyle.value),
440
459
  preview: false,
441
460
  "oss-process": false,
442
- "error-color": __props.errorColor,
443
- "error-offset": __props.errorOffset,
461
+ "fallback-color": resolvedFallbackColor.value,
444
462
  "error-text": __props.errorText,
445
463
  loading: __props.loading,
446
464
  fit: "contain"
@@ -451,12 +469,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
451
469
  key: 0,
452
470
  render: unref(viewImgDefaults).placeholder,
453
471
  payload: slotProps
454
- }, null, 8, ["render", "payload"])) : (openBlock(), createElementBlock("svg", _hoisted_5, [
455
- createElementVNode("path", {
456
- d: "M1174.826667 0H105.216A105.258667 105.258667 0 0 0-0.042667 105.258667V918.613333a105.258667 105.258667 0 0 0 105.258667 105.258667h1069.653333A105.258667 105.258667 0 0 0 1280.085333 918.613333V105.258667A105.344 105.344 0 0 0 1174.826667 0z m-402.773334 181.461333a105.386667 105.386667 0 1 1-0.042666 210.773334 105.386667 105.386667 0 0 1 0-210.773334zM104.746667 883.882667S191.018667 381.098667 391.509333 381.098667c196.48 0 246.528 351.616 384.810667 351.616 87.210667 0 78.08-158.72 216.490667-158.72 99.242667 0 162.304 309.888 162.304 309.888H104.789333z",
457
- fill: resolvedLoadingIconColor.value
458
- }, null, 8, _hoisted_6)
459
- ]))
472
+ }, null, 8, ["render", "payload"])) : (openBlock(), createBlock(ViewImgErrorFallback, {
473
+ key: 1,
474
+ loading: "",
475
+ src: slotProps.src,
476
+ "fallback-color": resolvedFallbackColor.value
477
+ }, null, 8, ["src", "fallback-color"]))
460
478
  ], true)
461
479
  ]),
462
480
  _: 2
@@ -468,10 +486,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
468
486
  ]),
469
487
  key: "0"
470
488
  } : void 0
471
- ]), 1032, ["src", "style", "error-color", "error-offset", "error-text", "loading"])
489
+ ]), 1032, ["src", "style", "fallback-color", "error-text", "loading"])
472
490
  ]),
473
491
  _: 3
474
- }, 8, ["content"]))
492
+ }, 8, ["style", "content"]))
475
493
  ], 64)) : createCommentVNode("", true)
476
494
  ]),
477
495
  _: 3
@@ -491,7 +509,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
491
509
  };
492
510
  }
493
511
  }));
494
- const ViewImgPopover = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a3f15571"]]);
512
+ const ViewImgPopover = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0c64a317"]]);
495
513
  export {
496
514
  ViewImgPopover as V
497
515
  };
@@ -1,12 +1,12 @@
1
1
  @charset "UTF-8";
2
2
  /* :where 降低默认宽高优先级,避免压过外部 Tailwind 等工具类(如 w-[200px]) */
3
- :where(.fg-view-img-popover__reference[data-v-a3f15571]) {
3
+ :where(.fg-view-img-popover__reference[data-v-0c64a317]) {
4
4
  position: relative;
5
5
  display: block;
6
6
  width: 100%;
7
7
  height: 100%;
8
8
  }
9
- .fg-view-img-popover__preview-icon[data-v-a3f15571] {
9
+ .fg-view-img-popover__preview-icon[data-v-0c64a317] {
10
10
  position: absolute;
11
11
  top: 4px;
12
12
  right: 4px;
@@ -18,26 +18,21 @@
18
18
  color: var(--el-text-color-primary);
19
19
  cursor: pointer;
20
20
  }
21
- .fg-view-img-popover__preview-icon[data-v-a3f15571]:hover {
21
+ .fg-view-img-popover__preview-icon[data-v-0c64a317]:hover {
22
22
  color: var(--el-color-primary);
23
23
  }
24
- .fg-view-img-popover__loading-icon[data-v-a3f15571] {
25
- display: block;
26
- width: 40%;
27
- height: 40%;
28
- }
29
- .fg-view-img-popover__hover-image[data-v-a3f15571] {
24
+ .fg-view-img-popover__hover-image[data-v-0c64a317] {
30
25
  display: block;
31
26
  vertical-align: top;
32
27
  background: #7f7f7f;
33
28
  }
34
- .fg-view-img-popover__hover-image[data-v-a3f15571] .fg-view-img__inner {
29
+ .fg-view-img-popover__hover-image[data-v-0c64a317] .fg-view-img__inner {
35
30
  width: 100%;
36
31
  height: 100%;
37
32
  object-fit: contain;
38
33
  }
39
- .fg-view-img-popover__hover-image[data-v-a3f15571] .fg-view-img__placeholder,
40
- .fg-view-img-popover__hover-image[data-v-a3f15571] .fg-view-img__error {
34
+ .fg-view-img-popover__hover-image[data-v-0c64a317] .fg-view-img__placeholder,
35
+ .fg-view-img-popover__hover-image[data-v-0c64a317] .fg-view-img__error {
41
36
  position: absolute;
42
37
  inset: 0;
43
38
  display: flex;
@@ -46,23 +41,7 @@
46
41
  background: #f5f7fa;
47
42
  line-height: 1.4;
48
43
  }
49
- .fg-view-img-popover__hover-image[data-v-a3f15571] .fg-view-img__error-default {
50
- width: 100%;
51
- height: 100%;
52
- display: flex;
53
- align-items: center;
54
- justify-content: center;
55
- color: #909399;
56
- font-size: 13px;
57
- text-align: center;
58
- }
59
- .fg-view-img-popover__hover-image[data-v-a3f15571] .fg-view-img__error-text {
60
- color: #909399;
61
- font-size: 13px;
62
- line-height: 1.4;
63
- text-align: center;
64
- }
65
- .fg-view-img-popover__hover-error[data-v-a3f15571] {
44
+ .fg-view-img-popover__hover-error[data-v-0c64a317] {
66
45
  display: flex;
67
46
  align-items: center;
68
47
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import { _ } from "../../FgCascader.vue_vue_type_style_index_0_lang-DzvTfHp4.js";
1
+ import { _ } from "../../FgCascader.vue_vue_type_style_index_0_lang-CtUPO8fk.js";
2
2
  export {
3
3
  _ as FgCascader
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import { _ } from "../ArgHover.vue_vue_type_style_index_0_lang-CSymSDRl.js";
2
- import { _ as _2 } from "../FgCascader.vue_vue_type_style_index_0_lang-DzvTfHp4.js";
2
+ import { _ as _2 } from "../FgCascader.vue_vue_type_style_index_0_lang-CtUPO8fk.js";
3
3
  import { _ as _3 } from "../CitySelect.vue_vue_type_script_setup_true_lang-DZp6834K.js";
4
4
  import { _ as _4 } from "../DragResizable.vue_vue_type_style_index_0_lang-BePpQHve.js";
5
5
  import { _ as _5 } from "../HSelectAll.vue_vue_type_script_setup_true_lang-xHFbYs59.js";
@@ -31,8 +31,8 @@ import { S } from "../SelectAddress-CCepDxu8.js";
31
31
  import { S as S2 } from "../SelectTree-BHvvkiQi.js";
32
32
  import { S as S3 } from "../SvgIcon-DIg0upEk.js";
33
33
  import { T } from "../TextCopy-lpbeqOUI.js";
34
- import { F, V, c as c2, r as r2, u } from "../ViewImg-CD4QJK4R.js";
35
- import { V as V2 } from "../ViewImgPopover-D-1b2nEa.js";
34
+ import { F, V, c as c2, r as r2, u } from "../ViewImg-CLRjYOUN.js";
35
+ import { V as V2 } from "../ViewImgPopover-koNFPgjR.js";
36
36
  import { I, P, g as g2, u as u2, a as a2 } from "../imgViewerStore-Ajm-L7R5.js";
37
37
  import { V as V3 } from "../VirtualTable-Cm_L7q9W.js";
38
38
  export {
@@ -5,7 +5,16 @@ type ObjectFit = "fill" | "contain" | "cover" | "none" | "scale-down" | "";
5
5
  type __VLS_Props = {
6
6
  src?: string;
7
7
  fit?: ObjectFit;
8
+ /**
9
+ * 是否懒加载:为 true 时进入视口(或 scrollContainer)后再请求图片
10
+ * (IntersectionObserver;非仅原生 loading="lazy")
11
+ */
8
12
  lazy?: boolean;
13
+ /**
14
+ * 懒加载滚动根;未传时相对浏览器视口。
15
+ * 自定义 overflow 容器需传入选择器或 HTMLElement,否则可能判定为“已在视口内”而立刻加载。
16
+ */
17
+ scrollContainer?: string | HTMLElement | null;
9
18
  /** 外部 loading 状态,为 true 时展示 placeholder */
10
19
  loading?: boolean;
11
20
  /** 是否开启点击预览大图 */
@@ -50,12 +59,8 @@ type __VLS_Props = {
50
59
  renderExtraTools?: VNode | null;
51
60
  /** 内置工具栏按钮配置 */
52
61
  originalToolbar?: OriginalToolbarItem[];
53
- /** 加载失败图标填充色(「无图」态不受影响) */
54
- errorColor?: string;
55
- /**
56
- * @deprecated 旧版 FgErrorImage 参数,内置双态占位不再使用;保留以兼容业务传参
57
- */
58
- errorOffset?: number;
62
+ /** 内置占位图标 / 文案色;作用于加载中 / 无图 / 加载失败;未传用设计默认色 */
63
+ fallbackColor?: string;
59
64
  /** 加载失败文案;未传默认「加载失败」。空 / 仅空白 src 固定显示「无图」 */
60
65
  errorText?: string;
61
66
  /** 是否对 src 做 OSS / TEMU 缩略图处理,需先在应用入口 configureImgUrl 注入 ossLinks */
@@ -82,8 +87,7 @@ declare function __VLS_template(): {
82
87
  loading: boolean;
83
88
  loadError: boolean;
84
89
  errorText: string;
85
- errorColor: string;
86
- errorOffset: number;
90
+ fallbackColor: string;
87
91
  }): any;
88
92
  error?(_: {
89
93
  src: string;
@@ -91,11 +95,12 @@ declare function __VLS_template(): {
91
95
  loading: boolean;
92
96
  loadError: boolean;
93
97
  errorText: string;
94
- errorColor: string;
95
- errorOffset: number;
98
+ fallbackColor: string;
96
99
  }): any;
97
100
  };
98
- refs: {};
101
+ refs: {
102
+ rootRef: HTMLSpanElement;
103
+ };
99
104
  rootEl: any;
100
105
  };
101
106
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
@@ -139,7 +144,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
139
144
  previewTeleported: boolean;
140
145
  fit: ObjectFit;
141
146
  errorText: string;
142
- errorColor: string;
147
+ fallbackColor: string;
143
148
  initialIndex: number;
144
149
  toolbarBgColor: string;
145
150
  toolbarIconColor: string;
@@ -152,12 +157,14 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
152
157
  originalToolbar: OriginalToolbarItem[];
153
158
  previewSideNav: PreviewSideNav;
154
159
  defImgPreviewIndex: number;
155
- errorOffset: number;
160
+ scrollContainer: string | HTMLElement | null;
156
161
  ossProcess: boolean;
157
162
  ossLinks: string[];
158
163
  imgSize: ImgSizeOptions;
159
164
  previewStripQuery: boolean;
160
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
165
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
166
+ rootRef: HTMLSpanElement;
167
+ }, any>;
161
168
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
162
169
  export default _default;
163
170
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1,14 +1,17 @@
1
1
  type __VLS_Props = {
2
+ /** 为 true 时展示「加载中」(优先于无图 / 失败) */
3
+ loading?: boolean;
2
4
  /** 原始图片地址;空或仅空白走「无图」态 */
3
5
  src?: string;
4
6
  /** 加载失败文案;未传时默认「加载失败」 */
5
7
  errorText?: string;
6
- /** 加载失败图标填充色;「无图」态仍用设计双色 */
7
- errorColor?: string;
8
+ /** 内置占位主色;未传用设计默认色;传入后按主色派生浅淡色 */
9
+ fallbackColor?: string;
8
10
  };
9
11
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
12
+ loading: boolean;
10
13
  src: string;
11
14
  errorText: string;
12
- errorColor: string;
15
+ fallbackColor: string;
13
16
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
14
17
  export default _default;