@sia.soul/sia-react-ui 0.1.36 → 0.1.37
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/{chunk-7CPIEYS2.js → chunk-DQ7WGTKA.js} +24 -6
- package/dist/{core-CLt6U7oH.d.cts → core-BzBVS9md.d.cts} +1 -1
- package/dist/{core-vIHbXa6s.d.ts → core-CBURAp9W.d.ts} +1 -1
- package/dist/core.cjs +24 -6
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/index.cjs +24 -6
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1227,10 +1227,28 @@ async function downloadUploadFile(file, request) {
|
|
|
1227
1227
|
}
|
|
1228
1228
|
}
|
|
1229
1229
|
|
|
1230
|
+
// src/components/uploadImage.ts
|
|
1231
|
+
var imageExtension = /\.(png|jpe?g|gif|webp|avif|svg|bmp|ico|apng)$/i;
|
|
1232
|
+
function isUploadImage(file, accept) {
|
|
1233
|
+
if (!file) return false;
|
|
1234
|
+
if (file.thumbUrl) return true;
|
|
1235
|
+
const type = (file.type || file.originFileObj?.type || "").toLowerCase();
|
|
1236
|
+
if (type && type !== "application/octet-stream") return type.startsWith("image/");
|
|
1237
|
+
if (/^data:image\//i.test(file.url || "")) return true;
|
|
1238
|
+
let pathname = "";
|
|
1239
|
+
try {
|
|
1240
|
+
pathname = new URL(file.url || "", "https://upload.invalid").pathname;
|
|
1241
|
+
} catch {
|
|
1242
|
+
}
|
|
1243
|
+
if (imageExtension.test(file.name) || imageExtension.test(pathname)) return true;
|
|
1244
|
+
const rules = (accept || "").split(",").map((rule) => rule.trim().toLowerCase()).filter(Boolean);
|
|
1245
|
+
return Boolean(file.url) && rules.length > 0 && rules.every((rule) => rule.startsWith("image/") || imageExtension.test(rule));
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1230
1248
|
// src/components/Upload.tsx
|
|
1231
1249
|
import { Fragment as Fragment4, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1232
1250
|
var LIST_IGNORE = /* @__PURE__ */ Symbol("SIA_UPLOAD_LIST_IGNORE");
|
|
1233
|
-
function useThumbnail(file) {
|
|
1251
|
+
function useThumbnail(file, accept) {
|
|
1234
1252
|
const [local, setLocal] = useState6();
|
|
1235
1253
|
useEffect4(() => {
|
|
1236
1254
|
if (!file?.thumbUrl && file?.originFileObj?.type.startsWith("image/")) {
|
|
@@ -1240,10 +1258,10 @@ function useThumbnail(file) {
|
|
|
1240
1258
|
}
|
|
1241
1259
|
setLocal(void 0);
|
|
1242
1260
|
}, [file?.originFileObj, file?.thumbUrl]);
|
|
1243
|
-
return file?.thumbUrl || local || (
|
|
1261
|
+
return file?.thumbUrl || local || (isUploadImage(file, accept) ? file?.url : void 0);
|
|
1244
1262
|
}
|
|
1245
1263
|
function UploadItem({ file, files, props, actions }) {
|
|
1246
|
-
const source = useThumbnail(file);
|
|
1264
|
+
const source = useThumbnail(file, props.accept);
|
|
1247
1265
|
const [failed, setFailed] = useState6(false);
|
|
1248
1266
|
const [downloading, setDownloading] = useState6(false);
|
|
1249
1267
|
const downloadingRef = useRef5(false);
|
|
@@ -1330,7 +1348,7 @@ var UploadRoot = forwardRef(function UploadRoot2({
|
|
|
1330
1348
|
const mounted = useRef5(true);
|
|
1331
1349
|
const [dragging, setDragging] = useState6(false);
|
|
1332
1350
|
const [preview, setPreview] = useState6();
|
|
1333
|
-
const previewSource = useThumbnail(preview);
|
|
1351
|
+
const previewSource = useThumbnail(preview, accept);
|
|
1334
1352
|
const limit = maxCount2 === void 0 || !Number.isFinite(maxCount2) ? Infinity : Math.max(0, Math.floor(maxCount2));
|
|
1335
1353
|
const full = files.length >= limit;
|
|
1336
1354
|
const current = useRef5({ disabled, directory, recursive });
|
|
@@ -1556,14 +1574,14 @@ var UploadRoot = forwardRef(function UploadRoot2({
|
|
|
1556
1574
|
),
|
|
1557
1575
|
listType !== "picture-card" && trigger,
|
|
1558
1576
|
/* @__PURE__ */ jsxs8("div", { className: "sia-upload__list", children: [
|
|
1559
|
-
showUploadList && files.map((file) => /* @__PURE__ */ jsx8(UploadItem, { file, files, props: { listType, disabled, itemRender, onPreview, downloadRequest }, actions: {
|
|
1577
|
+
showUploadList && files.map((file) => /* @__PURE__ */ jsx8(UploadItem, { file, files, props: { listType, disabled, itemRender, onPreview, downloadRequest, accept }, actions: {
|
|
1560
1578
|
upload: () => start(file),
|
|
1561
1579
|
abort: () => abort(file.uid),
|
|
1562
1580
|
remove: () => remove(file.uid),
|
|
1563
1581
|
download: () => downloadUploadFile(file, downloadRequest),
|
|
1564
1582
|
preview: () => {
|
|
1565
1583
|
if (onPreview) onPreview(file);
|
|
1566
|
-
else if ((file
|
|
1584
|
+
else if (isUploadImage(file, accept)) setPreview(file);
|
|
1567
1585
|
else if (file.url || file.originFileObj) {
|
|
1568
1586
|
const url = file.url || URL.createObjectURL(file.originFileObj);
|
|
1569
1587
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
@@ -1842,7 +1842,7 @@ interface UploadFile {
|
|
|
1842
1842
|
status?: UploadFileStatus;
|
|
1843
1843
|
/** 上传百分比,范围 0–100。 */
|
|
1844
1844
|
percent?: number;
|
|
1845
|
-
/**
|
|
1845
|
+
/** 远程访问地址,用于预览及下载;图片通过 MIME、文件名或 URL 后缀识别,无类型及后缀时可用仅包含图片的 accept 声明启用缩略图和内置预览。默认下载会 fetch 为 Blob,跨域地址需要服务端允许 CORS。 */
|
|
1846
1846
|
url?: string;
|
|
1847
1847
|
/** 缩略图地址,优先于本地缩略图;预览优先使用 url。 */
|
|
1848
1848
|
thumbUrl?: string;
|
|
@@ -1842,7 +1842,7 @@ interface UploadFile {
|
|
|
1842
1842
|
status?: UploadFileStatus;
|
|
1843
1843
|
/** 上传百分比,范围 0–100。 */
|
|
1844
1844
|
percent?: number;
|
|
1845
|
-
/**
|
|
1845
|
+
/** 远程访问地址,用于预览及下载;图片通过 MIME、文件名或 URL 后缀识别,无类型及后缀时可用仅包含图片的 accept 声明启用缩略图和内置预览。默认下载会 fetch 为 Blob,跨域地址需要服务端允许 CORS。 */
|
|
1846
1846
|
url?: string;
|
|
1847
1847
|
/** 缩略图地址,优先于本地缩略图;预览优先使用 url。 */
|
|
1848
1848
|
thumbUrl?: string;
|
package/dist/core.cjs
CHANGED
|
@@ -4181,6 +4181,24 @@ async function downloadUploadFile(file, request) {
|
|
|
4181
4181
|
}
|
|
4182
4182
|
}
|
|
4183
4183
|
|
|
4184
|
+
// src/components/uploadImage.ts
|
|
4185
|
+
var imageExtension = /\.(png|jpe?g|gif|webp|avif|svg|bmp|ico|apng)$/i;
|
|
4186
|
+
function isUploadImage(file, accept) {
|
|
4187
|
+
if (!file) return false;
|
|
4188
|
+
if (file.thumbUrl) return true;
|
|
4189
|
+
const type = (file.type || file.originFileObj?.type || "").toLowerCase();
|
|
4190
|
+
if (type && type !== "application/octet-stream") return type.startsWith("image/");
|
|
4191
|
+
if (/^data:image\//i.test(file.url || "")) return true;
|
|
4192
|
+
let pathname = "";
|
|
4193
|
+
try {
|
|
4194
|
+
pathname = new URL(file.url || "", "https://upload.invalid").pathname;
|
|
4195
|
+
} catch {
|
|
4196
|
+
}
|
|
4197
|
+
if (imageExtension.test(file.name) || imageExtension.test(pathname)) return true;
|
|
4198
|
+
const rules = (accept || "").split(",").map((rule) => rule.trim().toLowerCase()).filter(Boolean);
|
|
4199
|
+
return Boolean(file.url) && rules.length > 0 && rules.every((rule) => rule.startsWith("image/") || imageExtension.test(rule));
|
|
4200
|
+
}
|
|
4201
|
+
|
|
4184
4202
|
// src/components/Message.tsx
|
|
4185
4203
|
var import_client4 = require("react-dom/client");
|
|
4186
4204
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
@@ -4289,7 +4307,7 @@ var message = {
|
|
|
4289
4307
|
// src/components/Upload.tsx
|
|
4290
4308
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4291
4309
|
var LIST_IGNORE = /* @__PURE__ */ Symbol("SIA_UPLOAD_LIST_IGNORE");
|
|
4292
|
-
function useThumbnail(file) {
|
|
4310
|
+
function useThumbnail(file, accept) {
|
|
4293
4311
|
const [local, setLocal] = (0, import_react23.useState)();
|
|
4294
4312
|
(0, import_react23.useEffect)(() => {
|
|
4295
4313
|
if (!file?.thumbUrl && file?.originFileObj?.type.startsWith("image/")) {
|
|
@@ -4299,10 +4317,10 @@ function useThumbnail(file) {
|
|
|
4299
4317
|
}
|
|
4300
4318
|
setLocal(void 0);
|
|
4301
4319
|
}, [file?.originFileObj, file?.thumbUrl]);
|
|
4302
|
-
return file?.thumbUrl || local || (
|
|
4320
|
+
return file?.thumbUrl || local || (isUploadImage(file, accept) ? file?.url : void 0);
|
|
4303
4321
|
}
|
|
4304
4322
|
function UploadItem({ file, files, props, actions }) {
|
|
4305
|
-
const source = useThumbnail(file);
|
|
4323
|
+
const source = useThumbnail(file, props.accept);
|
|
4306
4324
|
const [failed, setFailed] = (0, import_react23.useState)(false);
|
|
4307
4325
|
const [downloading, setDownloading] = (0, import_react23.useState)(false);
|
|
4308
4326
|
const downloadingRef = (0, import_react23.useRef)(false);
|
|
@@ -4389,7 +4407,7 @@ var UploadRoot = (0, import_react23.forwardRef)(function UploadRoot2({
|
|
|
4389
4407
|
const mounted = (0, import_react23.useRef)(true);
|
|
4390
4408
|
const [dragging, setDragging] = (0, import_react23.useState)(false);
|
|
4391
4409
|
const [preview, setPreview] = (0, import_react23.useState)();
|
|
4392
|
-
const previewSource = useThumbnail(preview);
|
|
4410
|
+
const previewSource = useThumbnail(preview, accept);
|
|
4393
4411
|
const limit = maxCount2 === void 0 || !Number.isFinite(maxCount2) ? Infinity : Math.max(0, Math.floor(maxCount2));
|
|
4394
4412
|
const full = files.length >= limit;
|
|
4395
4413
|
const current = (0, import_react23.useRef)({ disabled, directory, recursive });
|
|
@@ -4615,14 +4633,14 @@ var UploadRoot = (0, import_react23.forwardRef)(function UploadRoot2({
|
|
|
4615
4633
|
),
|
|
4616
4634
|
listType !== "picture-card" && trigger,
|
|
4617
4635
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "sia-upload__list", children: [
|
|
4618
|
-
showUploadList && files.map((file) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(UploadItem, { file, files, props: { listType, disabled, itemRender, onPreview, downloadRequest }, actions: {
|
|
4636
|
+
showUploadList && files.map((file) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(UploadItem, { file, files, props: { listType, disabled, itemRender, onPreview, downloadRequest, accept }, actions: {
|
|
4619
4637
|
upload: () => start(file),
|
|
4620
4638
|
abort: () => abort(file.uid),
|
|
4621
4639
|
remove: () => remove(file.uid),
|
|
4622
4640
|
download: () => downloadUploadFile(file, downloadRequest),
|
|
4623
4641
|
preview: () => {
|
|
4624
4642
|
if (onPreview) onPreview(file);
|
|
4625
|
-
else if ((file
|
|
4643
|
+
else if (isUploadImage(file, accept)) setPreview(file);
|
|
4626
4644
|
else if (file.url || file.originFileObj) {
|
|
4627
4645
|
const url = file.url || URL.createObjectURL(file.originFileObj);
|
|
4628
4646
|
window.open(url, "_blank", "noopener,noreferrer");
|
package/dist/core.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-
|
|
1
|
+
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-BzBVS9md.cjs';
|
|
2
2
|
export { f as Button, B as ButtonProps, e as ButtonSize, g as ButtonVariant, h as Modal, d as ModalActionResult, M as ModalOpenConfig, i as ModalProps, j as ModalType, a as OverlayApiHandle, k as Select, S as SelectOption, c as SelectProps, m as SelectValue } from './Select-YJbT-MF1.cjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import './shared-Bx4B28Wh.cjs';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-
|
|
1
|
+
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-CBURAp9W.js';
|
|
2
2
|
export { f as Button, B as ButtonProps, e as ButtonSize, g as ButtonVariant, h as Modal, d as ModalActionResult, M as ModalOpenConfig, i as ModalProps, j as ModalType, a as OverlayApiHandle, k as Select, S as SelectOption, c as SelectProps, m as SelectValue } from './Select-CCrPqULn.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import './shared-Bx4B28Wh.js';
|
package/dist/core.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -8338,6 +8338,24 @@ async function downloadUploadFile(file, request) {
|
|
|
8338
8338
|
}
|
|
8339
8339
|
}
|
|
8340
8340
|
|
|
8341
|
+
// src/components/uploadImage.ts
|
|
8342
|
+
var imageExtension = /\.(png|jpe?g|gif|webp|avif|svg|bmp|ico|apng)$/i;
|
|
8343
|
+
function isUploadImage(file, accept) {
|
|
8344
|
+
if (!file) return false;
|
|
8345
|
+
if (file.thumbUrl) return true;
|
|
8346
|
+
const type = (file.type || file.originFileObj?.type || "").toLowerCase();
|
|
8347
|
+
if (type && type !== "application/octet-stream") return type.startsWith("image/");
|
|
8348
|
+
if (/^data:image\//i.test(file.url || "")) return true;
|
|
8349
|
+
let pathname = "";
|
|
8350
|
+
try {
|
|
8351
|
+
pathname = new URL(file.url || "", "https://upload.invalid").pathname;
|
|
8352
|
+
} catch {
|
|
8353
|
+
}
|
|
8354
|
+
if (imageExtension.test(file.name) || imageExtension.test(pathname)) return true;
|
|
8355
|
+
const rules = (accept || "").split(",").map((rule) => rule.trim().toLowerCase()).filter(Boolean);
|
|
8356
|
+
return Boolean(file.url) && rules.length > 0 && rules.every((rule) => rule.startsWith("image/") || imageExtension.test(rule));
|
|
8357
|
+
}
|
|
8358
|
+
|
|
8341
8359
|
// src/components/Message.tsx
|
|
8342
8360
|
var import_client5 = require("react-dom/client");
|
|
8343
8361
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
@@ -8446,7 +8464,7 @@ var message = {
|
|
|
8446
8464
|
// src/components/Upload.tsx
|
|
8447
8465
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
8448
8466
|
var LIST_IGNORE = /* @__PURE__ */ Symbol("SIA_UPLOAD_LIST_IGNORE");
|
|
8449
|
-
function useThumbnail(file) {
|
|
8467
|
+
function useThumbnail(file, accept) {
|
|
8450
8468
|
const [local, setLocal] = (0, import_react37.useState)();
|
|
8451
8469
|
(0, import_react37.useEffect)(() => {
|
|
8452
8470
|
if (!file?.thumbUrl && file?.originFileObj?.type.startsWith("image/")) {
|
|
@@ -8456,10 +8474,10 @@ function useThumbnail(file) {
|
|
|
8456
8474
|
}
|
|
8457
8475
|
setLocal(void 0);
|
|
8458
8476
|
}, [file?.originFileObj, file?.thumbUrl]);
|
|
8459
|
-
return file?.thumbUrl || local || (
|
|
8477
|
+
return file?.thumbUrl || local || (isUploadImage(file, accept) ? file?.url : void 0);
|
|
8460
8478
|
}
|
|
8461
8479
|
function UploadItem({ file, files, props, actions }) {
|
|
8462
|
-
const source = useThumbnail(file);
|
|
8480
|
+
const source = useThumbnail(file, props.accept);
|
|
8463
8481
|
const [failed, setFailed] = (0, import_react37.useState)(false);
|
|
8464
8482
|
const [downloading, setDownloading] = (0, import_react37.useState)(false);
|
|
8465
8483
|
const downloadingRef = (0, import_react37.useRef)(false);
|
|
@@ -8546,7 +8564,7 @@ var UploadRoot = (0, import_react37.forwardRef)(function UploadRoot2({
|
|
|
8546
8564
|
const mounted = (0, import_react37.useRef)(true);
|
|
8547
8565
|
const [dragging, setDragging] = (0, import_react37.useState)(false);
|
|
8548
8566
|
const [preview, setPreview] = (0, import_react37.useState)();
|
|
8549
|
-
const previewSource = useThumbnail(preview);
|
|
8567
|
+
const previewSource = useThumbnail(preview, accept);
|
|
8550
8568
|
const limit = maxCount2 === void 0 || !Number.isFinite(maxCount2) ? Infinity : Math.max(0, Math.floor(maxCount2));
|
|
8551
8569
|
const full = files.length >= limit;
|
|
8552
8570
|
const current = (0, import_react37.useRef)({ disabled, directory, recursive });
|
|
@@ -8772,14 +8790,14 @@ var UploadRoot = (0, import_react37.forwardRef)(function UploadRoot2({
|
|
|
8772
8790
|
),
|
|
8773
8791
|
listType !== "picture-card" && trigger,
|
|
8774
8792
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "sia-upload__list", children: [
|
|
8775
|
-
showUploadList && files.map((file) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(UploadItem, { file, files, props: { listType, disabled, itemRender, onPreview, downloadRequest }, actions: {
|
|
8793
|
+
showUploadList && files.map((file) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(UploadItem, { file, files, props: { listType, disabled, itemRender, onPreview, downloadRequest, accept }, actions: {
|
|
8776
8794
|
upload: () => start(file),
|
|
8777
8795
|
abort: () => abort(file.uid),
|
|
8778
8796
|
remove: () => remove(file.uid),
|
|
8779
8797
|
download: () => downloadUploadFile(file, downloadRequest),
|
|
8780
8798
|
preview: () => {
|
|
8781
8799
|
if (onPreview) onPreview(file);
|
|
8782
|
-
else if ((file
|
|
8800
|
+
else if (isUploadImage(file, accept)) setPreview(file);
|
|
8783
8801
|
else if (file.url || file.originFileObj) {
|
|
8784
8802
|
const url = file.url || URL.createObjectURL(file.originFileObj);
|
|
8785
8803
|
window.open(url, "_blank", "noopener,noreferrer");
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TagStatus, B as BadgeProps } from './core-
|
|
2
|
-
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-
|
|
1
|
+
import { T as TagStatus, B as BadgeProps } from './core-BzBVS9md.cjs';
|
|
2
|
+
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-BzBVS9md.cjs';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
|
|
5
5
|
import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TagStatus, B as BadgeProps } from './core-
|
|
2
|
-
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-
|
|
1
|
+
import { T as TagStatus, B as BadgeProps } from './core-CBURAp9W.js';
|
|
2
|
+
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-CBURAp9W.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
|
|
5
5
|
import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.js';
|
package/dist/index.js
CHANGED