@webdevarif/dashui 0.2.3 → 0.2.4
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.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1894,7 +1894,6 @@ function MediaPickerDialog({
|
|
|
1894
1894
|
folders = [],
|
|
1895
1895
|
loading = false,
|
|
1896
1896
|
total,
|
|
1897
|
-
uploads = [],
|
|
1898
1897
|
typeFilter = "all",
|
|
1899
1898
|
onTypeChange,
|
|
1900
1899
|
search = "",
|
|
@@ -1905,15 +1904,18 @@ function MediaPickerDialog({
|
|
|
1905
1904
|
onLoadMore,
|
|
1906
1905
|
hasMore = false,
|
|
1907
1906
|
multiple = false,
|
|
1907
|
+
initialSelected = [],
|
|
1908
1908
|
accept = "all",
|
|
1909
1909
|
onSelect
|
|
1910
1910
|
}) {
|
|
1911
|
-
const [localSelected, setLocalSelected] = React20.useState(
|
|
1911
|
+
const [localSelected, setLocalSelected] = React20.useState(new Set(initialSelected));
|
|
1912
1912
|
const [isDragging, setIsDragging] = React20.useState(false);
|
|
1913
1913
|
const fileInputRef = React20.useRef(null);
|
|
1914
1914
|
const dragCounterRef = React20.useRef(0);
|
|
1915
1915
|
React20.useEffect(() => {
|
|
1916
|
-
if (
|
|
1916
|
+
if (open) {
|
|
1917
|
+
setLocalSelected(new Set(initialSelected));
|
|
1918
|
+
} else {
|
|
1917
1919
|
setLocalSelected(/* @__PURE__ */ new Set());
|
|
1918
1920
|
setIsDragging(false);
|
|
1919
1921
|
dragCounterRef.current = 0;
|
|
@@ -1975,7 +1977,6 @@ function MediaPickerDialog({
|
|
|
1975
1977
|
onUpload(e.target.files);
|
|
1976
1978
|
}
|
|
1977
1979
|
};
|
|
1978
|
-
const activeUploads = uploads.filter((u) => u.status === "uploading");
|
|
1979
1980
|
const firstSelected = files.find((f) => localSelected.has(f.id));
|
|
1980
1981
|
return /* @__PURE__ */ jsx34(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs20(
|
|
1981
1982
|
DialogContent,
|
|
@@ -2081,20 +2082,6 @@ function MediaPickerDialog({
|
|
|
2081
2082
|
)
|
|
2082
2083
|
] })
|
|
2083
2084
|
] }),
|
|
2084
|
-
activeUploads.length > 0 && /* @__PURE__ */ jsx34("div", { className: "border-b px-4 py-2 space-y-1.5 shrink-0", children: activeUploads.map((u, i) => /* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-2", children: [
|
|
2085
|
-
/* @__PURE__ */ jsx34("span", { className: "flex-1 truncate text-xs text-muted-foreground", children: u.name }),
|
|
2086
|
-
/* @__PURE__ */ jsx34("div", { className: "h-1.5 w-24 overflow-hidden rounded-full bg-muted", children: /* @__PURE__ */ jsx34(
|
|
2087
|
-
"div",
|
|
2088
|
-
{
|
|
2089
|
-
className: "h-full rounded-full bg-primary transition-all duration-200",
|
|
2090
|
-
style: { width: `${u.progress}%` }
|
|
2091
|
-
}
|
|
2092
|
-
) }),
|
|
2093
|
-
/* @__PURE__ */ jsxs20("span", { className: "text-[10px] text-muted-foreground w-6 text-right", children: [
|
|
2094
|
-
u.progress,
|
|
2095
|
-
"%"
|
|
2096
|
-
] })
|
|
2097
|
-
] }, i)) }),
|
|
2098
2085
|
/* @__PURE__ */ jsxs20(
|
|
2099
2086
|
"div",
|
|
2100
2087
|
{
|