@s_mart/dropzone 7.0.0 → 7.0.1
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.mjs +2 -2
- package/package.json +6 -5
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import P,{useEffect as T}from"react";import{Dropzone as b,FileItem as A}from"@dropzone-ui/react";import{
|
|
1
|
+
import P,{useEffect as T}from"react";import{Dropzone as b,FileItem as A}from"@dropzone-ui/react";import{LIcon as q}from"@s_mart/core";import{Tooltip as w,Typography as N}from"@mui/material";import{lineTimes as k}from"@s_mart/regular-icons";import x from"@emotion/styled";import{colorPalette as c}from"@s_mart/tokens";var m=x.button`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -24,4 +24,4 @@ import P,{useEffect as T}from"react";import{Dropzone as b,FileItem as A}from"@dr
|
|
|
24
24
|
background-color: ${c.neutral[40]};
|
|
25
25
|
transition: all 0.3s ease;
|
|
26
26
|
}
|
|
27
|
-
`;import{useNotification as B}from"@s_mart/hooks";import{Fragment as U,jsx as t,jsxs as _}from"react/jsx-runtime";var I=({showDeleteAllFilesButton:u=!0,placeholder:h,fileItemProps:D,initialValue:n=[],onClean:v,onReset:g,tratamentoFilesOnChange:p,...f})=>{let{setNotification:d}=B(),[l,a]=P.useState(n),z=e=>{let o=e.filter(i=>i.valid===!0);a(o);let r={variant:"warning",autoHideDuration:5e3};if(e.length>0){let i=e.filter(s=>s.valid===!1);i.length===1?d({...r,title:`Arquivo ${i[0].file.name} inv\xE1lido`,message:i[0].errors?.[0]}):i.length>1&&i.forEach(s=>{d({...r,title:`Arquivo ${s.file.name} inv\xE1lido`,message:s.errors?.[0]})})}},y=()=>{a([]),g?.()},F=e=>{let o=l.filter(r=>r.id!==e.id);a(o),v?.(o)};return T(()=>{n.length&&a(n)},[n]),t(b,{localization:"PT-pt",header:!1,footer:!1,headerClassName:"header",view:"grid",value:l,...f,onChange:async e=>{let o=e;if(p){let r=await p(e);r&&(o=r)}z(o),f.onChange?.(o)},children:l.length===0?t("div",{children:h||"Arraste os arquivos aqui ou clique para selecionar"}):_(U,{children:[u&&t(
|
|
27
|
+
`;import{useNotification as B}from"@s_mart/hooks";import{Fragment as U,jsx as t,jsxs as _}from"react/jsx-runtime";var I=({showDeleteAllFilesButton:u=!0,placeholder:h,fileItemProps:D,initialValue:n=[],onClean:v,onReset:g,tratamentoFilesOnChange:p,...f})=>{let{setNotification:d}=B(),[l,a]=P.useState(n),z=e=>{let o=e.filter(i=>i.valid===!0);a(o);let r={variant:"warning",autoHideDuration:5e3};if(e.length>0){let i=e.filter(s=>s.valid===!1);i.length===1?d({...r,title:`Arquivo ${i[0].file.name} inv\xE1lido`,message:i[0].errors?.[0]}):i.length>1&&i.forEach(s=>{d({...r,title:`Arquivo ${s.file.name} inv\xE1lido`,message:s.errors?.[0]})})}},y=()=>{a([]),g?.()},F=e=>{let o=l.filter(r=>r.id!==e.id);a(o),v?.(o)};return T(()=>{n.length&&a(n)},[n]),t(b,{localization:"PT-pt",header:!1,footer:!1,headerClassName:"header",view:"grid",value:l,...f,onChange:async e=>{let o=e;if(p){let r=await p(e);r&&(o=r)}z(o),f.onChange?.(o)},children:l.length===0?t("div",{children:h||"Arraste os arquivos aqui ou clique para selecionar"}):_(U,{children:[u&&t(w,{title:t(N,{variant:"bodyMD",children:"Remover"}),children:t(m,{onClick:e=>{e.preventDefault(),e.stopPropagation(),y()},children:t(q,{icon:k,size:"24px"})})}),t("div",{style:{display:"flex"},children:l?.map(e=>t(A,{info:!0,localization:"PT-pt",preview:!0,...e,...D,onDelete:()=>F(e)},e.id))})]})})};export{I as Dropzone};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@s_mart/dropzone",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"main": "./dist/index.mjs",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.mts",
|
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@dropzone-ui/react": "^6.7.20",
|
|
14
|
+
"@mui/material": ">=5.15.14",
|
|
14
15
|
"tsup": "8.0.2",
|
|
15
16
|
"@types/react": ">=18.3.1",
|
|
16
17
|
"@types/react-dom": ">=18.3.0",
|
|
17
18
|
"typescript": ">=5.4.2",
|
|
18
|
-
"@s_mart/core": "7.0.
|
|
19
|
-
"@s_mart/hooks": "7.0.
|
|
19
|
+
"@s_mart/core": "7.0.1",
|
|
20
|
+
"@s_mart/hooks": "7.0.1",
|
|
20
21
|
"@s_mart/regular-icons": "5.2.0",
|
|
21
22
|
"eslint-config-smarten": "4.1.0",
|
|
22
23
|
"@s_mart/tokens": "5.1.0",
|
|
@@ -31,8 +32,8 @@
|
|
|
31
32
|
"react": ">=18.3.1",
|
|
32
33
|
"react-dom": ">=18.3.1",
|
|
33
34
|
"typescript": ">=5.4.2",
|
|
34
|
-
"@s_mart/core": "7.0.
|
|
35
|
-
"@s_mart/hooks": "7.0.
|
|
35
|
+
"@s_mart/core": "7.0.1",
|
|
36
|
+
"@s_mart/hooks": "7.0.1",
|
|
36
37
|
"@s_mart/regular-icons": "5.2.0",
|
|
37
38
|
"@s_mart/tokens": "5.1.0",
|
|
38
39
|
"@s_mart/typed": "6.0.0"
|