@zero-library/common 2.3.11 → 2.3.12

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/index.cjs.js CHANGED
@@ -2132,72 +2132,88 @@ var PdfImagePreview_default = ({ fileUrl, pageNo, scale = 1, isHasThumbnails = t
2132
2132
  }
2133
2133
  }, [zoom, virtualizer]);
2134
2134
  return error ? /* @__PURE__ */ jsxRuntime.jsx(antd.Result, { status: "error", title: error }) : /* @__PURE__ */ jsxRuntime.jsxs(antd.Splitter, { className: classNames2__default.default(styles_module_default.nsPreviewPdfImage), children: [
2135
- isHasThumbnails && /* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { resizable: false, min: 400, max: 400, collapsible: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: thumbsParentRef, className: classNames2__default.default(styles_module_default.pdfImageNav, "height-full", "scroll-fade-in"), children: thumbsVirtualizer.getVirtualItems().map((item) => {
2136
- return /* @__PURE__ */ jsxRuntime.jsxs(
2137
- antd.Flex,
2138
- {
2139
- vertical: true,
2140
- align: "center",
2141
- className: classNames2__default.default(styles_module_default.pdfImageNavItem),
2142
- style: {
2143
- top: item.start,
2144
- height: `${THUMB_IMG_HEIGHT}px`
2145
- },
2146
- onClick: () => {
2147
- virtualizer.scrollToIndex(item.index);
2148
- },
2149
- children: [
2150
- /* @__PURE__ */ jsxRuntime.jsx(
2151
- "div",
2152
- {
2153
- className: classNames2__default.default(styles_module_default.pdfImageNavItemImgWrapper, "flex-1", {
2154
- [styles_module_default.pdfImageNavItemActive]: item.index === currentIndex
2155
- }),
2156
- children: /* @__PURE__ */ jsxRuntime.jsx("img", { className: styles_module_default.pdfImageNavItemImg, src: images[item.index].thumbnail || images[item.index].imageUrl })
2157
- }
2158
- ),
2159
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default.pdfImageNavItemTip, children: item.index + 1 })
2160
- ]
2135
+ isHasThumbnails && /* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { resizable: false, min: 400, max: 400, collapsible: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: thumbsParentRef, className: classNames2__default.default(styles_module_default.pdfImageNav, "height-full", "scroll-fade-in"), children: /* @__PURE__ */ jsxRuntime.jsx(
2136
+ "div",
2137
+ {
2138
+ style: {
2139
+ height: `${thumbsVirtualizer.getTotalSize()}px`
2161
2140
  },
2162
- item.index
2163
- );
2164
- }) }) }),
2141
+ children: thumbsVirtualizer.getVirtualItems().map((item) => {
2142
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2143
+ antd.Flex,
2144
+ {
2145
+ vertical: true,
2146
+ align: "center",
2147
+ className: classNames2__default.default(styles_module_default.pdfImageNavItem),
2148
+ style: {
2149
+ top: item.start,
2150
+ height: `${THUMB_IMG_HEIGHT}px`
2151
+ },
2152
+ onClick: () => {
2153
+ virtualizer.scrollToIndex(item.index);
2154
+ },
2155
+ children: [
2156
+ /* @__PURE__ */ jsxRuntime.jsx(
2157
+ "div",
2158
+ {
2159
+ className: classNames2__default.default(styles_module_default.pdfImageNavItemImgWrapper, "flex-1", {
2160
+ [styles_module_default.pdfImageNavItemActive]: item.index === currentIndex
2161
+ }),
2162
+ children: /* @__PURE__ */ jsxRuntime.jsx("img", { className: styles_module_default.pdfImageNavItemImg, src: images[item.index].thumbnail || images[item.index].imageUrl })
2163
+ }
2164
+ ),
2165
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default.pdfImageNavItemTip, children: item.index + 1 })
2166
+ ]
2167
+ },
2168
+ item.index
2169
+ );
2170
+ })
2171
+ }
2172
+ ) }) }),
2165
2173
  /* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames2__default.default("height-full", styles_module_default.pdfImageBody), children: [
2166
2174
  /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 6, align: "center", className: styles_module_default.pdfImageBodyToolbar, children: [
2167
2175
  /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomOut, icon: /* @__PURE__ */ jsxRuntime.jsx(Icon.MinusCircleOutlined, {}), title: "\u7F29\u5C0F" }),
2168
2176
  /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomIn, icon: /* @__PURE__ */ jsxRuntime.jsx(Icon.PlusCircleOutlined, {}), title: "\u653E\u5927" }),
2169
2177
  /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: zoomFitWidth, icon: /* @__PURE__ */ jsxRuntime.jsx(Icon.ColumnWidthOutlined, {}), title: "\u9002\u5E94\u5BBD\u5EA6" })
2170
2178
  ] }),
2171
- /* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, className: "height-full scroll-fade-in", children: virtualizer.getVirtualItems().map((item) => {
2172
- return /* @__PURE__ */ jsxRuntime.jsx(
2173
- "div",
2174
- {
2175
- className: styles_module_default.pdfImageBodyItem,
2176
- style: {
2177
- top: item.start
2178
- },
2179
- children: /* @__PURE__ */ jsxRuntime.jsx(
2179
+ /* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, className: "height-full scroll-fade-in", children: /* @__PURE__ */ jsxRuntime.jsx(
2180
+ "div",
2181
+ {
2182
+ style: {
2183
+ height: `${virtualizer.getTotalSize()}px`
2184
+ },
2185
+ children: virtualizer.getVirtualItems().map((item) => {
2186
+ return /* @__PURE__ */ jsxRuntime.jsx(
2180
2187
  "div",
2181
2188
  {
2182
- className: classNames2__default.default(styles_module_default.pdfImageBodyItemInnerWrapper, "p-8"),
2189
+ className: styles_module_default.pdfImageBodyItem,
2183
2190
  style: {
2184
- width: `${MAIN_IMG_WIDTH * zoom}px`,
2185
- height: `${MAIN_IMG_HEIGHT * zoom}px`
2191
+ top: item.start
2186
2192
  },
2187
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames2__default.default(styles_module_default.pdfImageBodyItemInner, { [styles_module_default.pdfImageBodyItemActive]: item.index === currentIndex }), children: /* @__PURE__ */ jsxRuntime.jsx(
2188
- "img",
2193
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2194
+ "div",
2189
2195
  {
2190
- className: classNames2__default.default(styles_module_default.pdfImageBodyItemImg),
2191
- src: images[item.index].imageUrl,
2192
- loading: item.index === currentIndex ? "eager" : "lazy"
2196
+ className: classNames2__default.default(styles_module_default.pdfImageBodyItemInnerWrapper, "p-8"),
2197
+ style: {
2198
+ width: `${MAIN_IMG_WIDTH * zoom}px`,
2199
+ height: `${MAIN_IMG_HEIGHT * zoom}px`
2200
+ },
2201
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames2__default.default(styles_module_default.pdfImageBodyItemInner, { [styles_module_default.pdfImageBodyItemActive]: item.index === currentIndex }), children: /* @__PURE__ */ jsxRuntime.jsx(
2202
+ "img",
2203
+ {
2204
+ className: classNames2__default.default(styles_module_default.pdfImageBodyItemImg),
2205
+ src: images[item.index].imageUrl,
2206
+ loading: item.index === currentIndex ? "eager" : "lazy"
2207
+ }
2208
+ ) })
2193
2209
  }
2194
- ) })
2195
- }
2196
- )
2197
- },
2198
- `${item.index}-${images[item.index].pageNum}`
2199
- );
2200
- }) })
2210
+ )
2211
+ },
2212
+ `${item.index}-${images[item.index].pageNum}`
2213
+ );
2214
+ })
2215
+ }
2216
+ ) })
2201
2217
  ] }) })
2202
2218
  ] });
2203
2219
  };