@s_mart/dropzone 1.1.1 → 1.1.2
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.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47,7 +47,7 @@ const theme2 = createTheme({ palette: {
|
|
|
47
47
|
background-color: ${Pt.colorPalette.neutral[40]};
|
|
48
48
|
transition: all 0.3s ease;
|
|
49
49
|
}
|
|
50
|
-
`;var qo=require("@s_mart/hooks");var oe=require("react/jsx-runtime"),Ho=p=>{var f=p,{showDeleteAllFilesButton:e=!0,placeholder:r,fileItemProps:t,initialValue:o=[],onClean:n,onReset:a}=f,s=At(f,["showDeleteAllFilesButton","placeholder","fileItemProps","initialValue","onClean","onReset"]);let{setNotification:u}=(0,qo.useNotification)(),[d,x]=Ur.default.useState(o),l=c=>{var H;let E=c.filter(k=>k.valid===!0);x(E);let U={variant:"warning",autoHideDuration:5e3};if(c.length>0){let k=c.filter(M=>M.valid===!1);k.length===1?u(ze(Me({},U),{title:`Arquivo ${k[0].file.name} inv\xE1lido`,message:(H=k[0].errors)==null?void 0:H[0]})):k.length>1&&k.forEach(M=>{var L;u(ze(Me({},U),{title:`Arquivo ${M.file.name} inv\xE1lido`,message:(L=M.errors)==null?void 0:L[0]}))})}},v=()=>{x([]),a==null||a()},b=c=>{let E=d.filter(U=>U.id!==c.id);x(E),n==null||n(E)};return(0,Ur.useEffect)(()=>{x(o)},[o]),(0,oe.jsx)(Lr.Dropzone,ze(Me({localization:"PT-pt",header:!1,footer:!1,headerClassName:"header",view:"grid",value:d},s),{onChange:c=>{var E;l(c),(E=s.onChange)==null||E.call(s,c)},children:d.length===0?(0,oe.jsx)("div",{children:r||"Arraste os arquivos aqui ou clique para selecionar"}):(0,oe.jsxs)(oe.Fragment,{children:[e&&(0,oe.jsx)(Fr.Tooltip,{title:(0,oe.jsx)(Br,{variant:"bodyMD",children:"Remover"}),children:(0,oe.jsx)(Ko,{onClick:c=>{c.preventDefault(),c.stopPropagation(),v()},children:(0,oe.jsx)(Fr.LIcon,{icon:Go.lineTimes,size:"24px"})})}),(0,oe.jsx)("div",{style:{display:"flex"},children:d==null?void 0:d.map(c=>(0,oe.jsx)(Lr.FileItem,ze(Me(Me({info:!0,localization:"PT-pt",preview:!0},c),t),{onDelete:()=>b(c)}),c.id))})]})}))};0&&(module.exports={Dropzone});
|
|
50
|
+
`;var qo=require("@s_mart/hooks");var oe=require("react/jsx-runtime"),Ho=p=>{var f=p,{showDeleteAllFilesButton:e=!0,placeholder:r,fileItemProps:t,initialValue:o=[],onClean:n,onReset:a}=f,s=At(f,["showDeleteAllFilesButton","placeholder","fileItemProps","initialValue","onClean","onReset"]);let{setNotification:u}=(0,qo.useNotification)(),[d,x]=Ur.default.useState(o),l=c=>{var H;let E=c.filter(k=>k.valid===!0);x(E);let U={variant:"warning",autoHideDuration:5e3};if(c.length>0){let k=c.filter(M=>M.valid===!1);k.length===1?u(ze(Me({},U),{title:`Arquivo ${k[0].file.name} inv\xE1lido`,message:(H=k[0].errors)==null?void 0:H[0]})):k.length>1&&k.forEach(M=>{var L;u(ze(Me({},U),{title:`Arquivo ${M.file.name} inv\xE1lido`,message:(L=M.errors)==null?void 0:L[0]}))})}},v=()=>{x([]),a==null||a()},b=c=>{let E=d.filter(U=>U.id!==c.id);x(E),n==null||n(E)};return(0,Ur.useEffect)(()=>{o.length&&x(o)},[o]),(0,oe.jsx)(Lr.Dropzone,ze(Me({localization:"PT-pt",header:!1,footer:!1,headerClassName:"header",view:"grid",value:d},s),{onChange:c=>{var E;l(c),(E=s.onChange)==null||E.call(s,c)},children:d.length===0?(0,oe.jsx)("div",{children:r||"Arraste os arquivos aqui ou clique para selecionar"}):(0,oe.jsxs)(oe.Fragment,{children:[e&&(0,oe.jsx)(Fr.Tooltip,{title:(0,oe.jsx)(Br,{variant:"bodyMD",children:"Remover"}),children:(0,oe.jsx)(Ko,{onClick:c=>{c.preventDefault(),c.stopPropagation(),v()},children:(0,oe.jsx)(Fr.LIcon,{icon:Go.lineTimes,size:"24px"})})}),(0,oe.jsx)("div",{style:{display:"flex"},children:d==null?void 0:d.map(c=>(0,oe.jsx)(Lr.FileItem,ze(Me(Me({info:!0,localization:"PT-pt",preview:!0},c),t),{onDelete:()=>b(c)}),c.id))})]})}))};0&&(module.exports={Dropzone});
|
|
51
51
|
/*
|
|
52
52
|
object-assign
|
|
53
53
|
(c) Sindre Sorhus
|
package/dist/index.mjs
CHANGED
|
@@ -47,7 +47,7 @@ const theme2 = createTheme({ palette: {
|
|
|
47
47
|
background-color: ${No.neutral[40]};
|
|
48
48
|
transition: all 0.3s ease;
|
|
49
49
|
}
|
|
50
|
-
`;import{useNotification as cs}from"@s_mart/hooks";import{Fragment as ds,jsx as ve,jsxs as xs}from"react/jsx-runtime";var ms=p=>{var f=p,{showDeleteAllFilesButton:e=!0,placeholder:r,fileItemProps:t,initialValue:o=[],onClean:n,onReset:a}=f,s=_t(f,["showDeleteAllFilesButton","placeholder","fileItemProps","initialValue","onClean","onReset"]);let{setNotification:u}=cs(),[d,x]=as.useState(o),l=c=>{var H;let E=c.filter(k=>k.valid===!0);x(E);let U={variant:"warning",autoHideDuration:5e3};if(c.length>0){let k=c.filter(M=>M.valid===!1);k.length===1?u(Le(Re({},U),{title:`Arquivo ${k[0].file.name} inv\xE1lido`,message:(H=k[0].errors)==null?void 0:H[0]})):k.length>1&&k.forEach(M=>{var L;u(Le(Re({},U),{title:`Arquivo ${M.file.name} inv\xE1lido`,message:(L=M.errors)==null?void 0:L[0]}))})}},v=()=>{x([]),a==null||a()},b=c=>{let E=d.filter(U=>U.id!==c.id);x(E),n==null||n(E)};return ss(()=>{x(o)},[o]),ve(is,Le(Re({localization:"PT-pt",header:!1,footer:!1,headerClassName:"header",view:"grid",value:d},s),{onChange:c=>{var E;l(c),(E=s.onChange)==null||E.call(s,c)},children:d.length===0?ve("div",{children:r||"Arraste os arquivos aqui ou clique para selecionar"}):xs(ds,{children:[e&&ve(ps,{title:ve(Dr,{variant:"bodyMD",children:"Remover"}),children:ve(Bo,{onClick:c=>{c.preventDefault(),c.stopPropagation(),v()},children:ve(us,{icon:ls,size:"24px"})})}),ve("div",{style:{display:"flex"},children:d==null?void 0:d.map(c=>ve(fs,Le(Re(Re({info:!0,localization:"PT-pt",preview:!0},c),t),{onDelete:()=>b(c)}),c.id))})]})}))};export{ms as Dropzone};
|
|
50
|
+
`;import{useNotification as cs}from"@s_mart/hooks";import{Fragment as ds,jsx as ve,jsxs as xs}from"react/jsx-runtime";var ms=p=>{var f=p,{showDeleteAllFilesButton:e=!0,placeholder:r,fileItemProps:t,initialValue:o=[],onClean:n,onReset:a}=f,s=_t(f,["showDeleteAllFilesButton","placeholder","fileItemProps","initialValue","onClean","onReset"]);let{setNotification:u}=cs(),[d,x]=as.useState(o),l=c=>{var H;let E=c.filter(k=>k.valid===!0);x(E);let U={variant:"warning",autoHideDuration:5e3};if(c.length>0){let k=c.filter(M=>M.valid===!1);k.length===1?u(Le(Re({},U),{title:`Arquivo ${k[0].file.name} inv\xE1lido`,message:(H=k[0].errors)==null?void 0:H[0]})):k.length>1&&k.forEach(M=>{var L;u(Le(Re({},U),{title:`Arquivo ${M.file.name} inv\xE1lido`,message:(L=M.errors)==null?void 0:L[0]}))})}},v=()=>{x([]),a==null||a()},b=c=>{let E=d.filter(U=>U.id!==c.id);x(E),n==null||n(E)};return ss(()=>{o.length&&x(o)},[o]),ve(is,Le(Re({localization:"PT-pt",header:!1,footer:!1,headerClassName:"header",view:"grid",value:d},s),{onChange:c=>{var E;l(c),(E=s.onChange)==null||E.call(s,c)},children:d.length===0?ve("div",{children:r||"Arraste os arquivos aqui ou clique para selecionar"}):xs(ds,{children:[e&&ve(ps,{title:ve(Dr,{variant:"bodyMD",children:"Remover"}),children:ve(Bo,{onClick:c=>{c.preventDefault(),c.stopPropagation(),v()},children:ve(us,{icon:ls,size:"24px"})})}),ve("div",{style:{display:"flex"},children:d==null?void 0:d.map(c=>ve(fs,Le(Re(Re({info:!0,localization:"PT-pt",preview:!0},c),t),{onDelete:()=>b(c)}),c.id))})]})}))};export{ms as Dropzone};
|
|
51
51
|
/*
|
|
52
52
|
object-assign
|
|
53
53
|
(c) Sindre Sorhus
|