@zydon/common 2.9.14 → 2.9.16
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-JYG5DKR3.js → chunk-235M242H.js} +2 -2
- package/dist/chunk-3HJISSG2.js +18 -0
- package/dist/chunk-3HJISSG2.js.map +1 -0
- package/dist/chunk-Q64RVUSF.js +34 -0
- package/dist/chunk-Q64RVUSF.js.map +1 -0
- package/dist/components/Analytics/index.js +1 -1
- package/dist/components/Autocomplete/index.js +1 -1
- package/dist/components/BulkEditModal/index.d.ts +22 -1
- package/dist/components/BulkEditModal/index.js +11 -11
- package/dist/components/BulkEditModal/index.js.map +1 -1
- package/dist/components/DataView/index.d.ts +1 -1
- package/dist/components/DynamicDataView/index.js +1 -1
- package/dist/components/FileUpload/index.js +1 -1
- package/dist/components/Filters/index.js +1 -1
- package/dist/components/form/Address/index.js +2 -2
- package/dist/components/form/Autocomplete/index.js +2 -2
- package/dist/components/form/FileUpload/index.js +1 -1
- package/dist/components/form/Webhook/index.js +2 -2
- package/dist/hooks/useSnackbar.d.ts +7 -7
- package/dist/index.d.ts +2 -2
- package/dist/theme/core/index.d.ts +1 -1
- package/dist/theme/styles/index.d.ts +12 -12
- package/package.json +1 -1
- package/dist/chunk-NMGWHNGI.js +0 -34
- package/dist/chunk-NMGWHNGI.js.map +0 -1
- package/dist/chunk-SC6LFS3A.js +0 -18
- package/dist/chunk-SC6LFS3A.js.map +0 -1
- package/dist/{chunk-JYG5DKR3.js.map → chunk-235M242H.js.map} +0 -0
- package/dist/{index-5a5e5dc8.d.ts → index-c8f1e6e7.d.ts} +12 -12
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { a } from '../../chunk-
|
|
1
|
+
import { a } from '../../chunk-235M242H.js';
|
|
2
2
|
import { r } from '../../chunk-XUDTPZHF.js';
|
|
3
3
|
import '../../chunk-UVPQR2Q2.js';
|
|
4
4
|
import { a as a$1 } from '../../chunk-RBTYTONM.js';
|
|
5
5
|
import '../../chunk-CO2KQFUN.js';
|
|
6
6
|
import { a as a$3 } from '../../chunk-I4PPSW36.js';
|
|
7
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-3HJISSG2.js';
|
|
8
8
|
import { a as a$2 } from '../../chunk-YSQ5AYHV.js';
|
|
9
9
|
import '../../chunk-TPOL2YXC.js';
|
|
10
10
|
import { memo, useEffect, useState, useMemo, useCallback } from 'react';
|
|
11
11
|
import { useFormContext, useWatch, useForm, FormProvider } from 'react-hook-form';
|
|
12
|
-
import
|
|
13
|
-
import
|
|
12
|
+
import zt from '@mui/material/LinearProgress';
|
|
13
|
+
import at from '@mui/material/Typography';
|
|
14
14
|
import wt from '@mui/material/Switch';
|
|
15
15
|
import It from '@mui/material/TextField';
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
16
|
+
import j from '@mui/material/Box';
|
|
17
|
+
import ht from '@mui/material/Button';
|
|
18
|
+
import yt from '@mui/material/Chip';
|
|
19
|
+
import bt from '@mui/material/Dialog';
|
|
20
|
+
import A from '@mui/material/Stack';
|
|
21
21
|
import { styled } from '@mui/material/styles';
|
|
22
22
|
import { DataGridPremium, GridToolbarColumnsButton } from '@mui/x-data-grid-premium';
|
|
23
23
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var X=styled(bt)({"& .MuiDialog-paper":{margin:0,borderRadius:0,maxHeight:"100vh",padding:0,height:"100vh",width:"100%",maxWidth:"100%"}}),Z=styled(A)({height:"100%",minHeight:0}),q=styled(yt)(({theme:t})=>({padding:0,"& .MuiChip-label":{color:t.palette.text.secondary,fontWeight:"700"}})),J=styled(ht)(({theme:t})=>({color:t.palette.text.secondary})),Q=styled(j)({flex:1,minHeight:0,padding:0,display:"flex",alignItems:"stretch"}),Y=styled(DataGridPremium)(({theme:t})=>({flex:1,height:"100%",minHeight:320,borderRadius:t.shape.borderRadius,backgroundColor:t.palette.background.paper,"& .MuiDataGrid-columnHeaders":{borderBottom:`1px solid ${t.palette.divider}`,minHeight:48,maxHeight:48},"& .MuiDataGrid-columnHeader":{borderTop:`1px solid ${t.palette.divider} !important`,borderBottom:`1px solid ${t.palette.divider} !important`,minWidth:"120px !important"},"& .MuiDataGrid-cell":{alignItems:"stretch",borderTop:`1px solid ${t.palette.divider}`,minWidth:120,width:"100%",borderLeft:`1px solid ${t.palette.divider}`,padding:0},"& .MuiDataGrid-cell:focus, & .MuiDataGrid-columnHeader:focus":{outline:"none"},"& .MuiDataGrid-withBorderColor":{borderColor:t.palette.divider},"& .MuiDataGrid-virtualScroller":{overflowX:"auto"},"& .MuiDataGrid-footerContainer":{borderTop:`1px solid ${t.palette.divider}`}})),w=styled(j)({display:"flex",alignItems:"center",width:"100%",height:"100%",padding:0,boxSizing:"border-box","& .MuiTypography-root":{width:"100%",overflow:"hidden",textOverflow:"ellipsis"}}),tt=styled(at)(({theme:t})=>({color:t.palette.text.primary})),et=styled(A)(({theme:t})=>({flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderTop:`1px solid ${t.palette.divider}`,padding:t.spacing(2,3),gap:t.spacing(2),flexWrap:"wrap"})),ot=styled(A)(({theme:t})=>({flexDirection:"row",alignItems:"center",gap:t.spacing(.5)}));var nt={"& .MuiOutlinedInput-root":{px:0,borderRadius:0,background:"transparent","& fieldset, &:hover fieldset, &.Mui-focused fieldset":{background:"transparent",borderRadius:0,border:"none"}},"& .MuiInputBase-input":{py:0,height:56,background:"transparent"}},Pt=t=>({disableUnderline:!0,sx:{px:0,"& input":{textAlign:t?"right":"left"}}}),Et=(t,e,a)=>{if(t==null||t==="")return null;if(e.type==="entity"){let l=e.options?.find(T=>T.value?.toString()===t?.toString());if(l)return l.label;let g=e.getSelectedOption?.(a,String(t));if(g)return g.label}if(typeof t=="object"){if("name"in t)return String(t.name);if("label"in t)return String(t.label);if("value"in t)return String(t.value)}return typeof t=="boolean"?t?"Sim":"N\xE3o":String(t)},Mt=({column:t,item:e,fieldPath:a$1,entityValue:l,disabled:g,onSelectOption:T})=>{let i=t.useAutocomplete(),C=i.options,d=l&&!C.some(h=>String(h.value)===l)?i.resolveOption?.(l)??t.getSelectedOption?.(e,l):void 0,n=d?[d,...C]:C;return jsx(w,{children:jsx(a,{fullWidth:!0,name:a$1,value:l,options:n,loading:i.loading,onSearch:i.onSearch,onOpen:i.onOpen,onClose:i.onClose,onScrollEnd:i.onScrollEnd,filterOptions:i.filterOptions,...i.noOptionsText!==void 0&&{noOptionsText:i.noOptionsText},disabled:g,size:"small",placeholder:"Preencher",sx:nt,disableClearable:!0,selectOnFocus:!0,onSelectOption:T})})},Ot=({column:t,item:e,rowIndex:a$1,itemId:l,onFieldChange:g,isFieldDisabled:T})=>{let{setValue:i,control:C}=useFormContext(),d=t.field,n=`items.${a$1}.${String(d)}`,h=useWatch({control:C,name:n,defaultValue:e?.[d]}),s=h===void 0?e?.[d]:h,S=t.readOnly||(T?T({item:e,field:d}):!1),E=String(d)==="id";if(t.readOnly||E){let o=Et(s,t,e);return jsx(w,{children:o?jsx(tt,{variant:"body2",children:o}):jsx(at,{variant:"body2",color:"text.disabled",children:"-"})})}if(t.type==="boolean")return jsx(w,{sx:{justifyContent:"center"},children:jsx(wt,{color:"primary",checked:!!s,inputProps:{"aria-label":t.headerName},onChange:o=>{let c=o.target.checked,p=s;i(n,c,{shouldDirty:!0,shouldTouch:!0});let m=g({itemId:l,field:d,value:c,previousValue:p});m&&typeof m.catch=="function"&&m.catch(()=>{i(n,p,{shouldDirty:!0,shouldTouch:!0});});},disabled:S})});if(t.type==="entity"){let o="";if(s!=null&&s!=="")if(typeof s=="object"){let b=s;"id"in b?o=String(b.id??""):"value"in b&&(o=String(b.value??""));}else o=String(s);let c=b=>{let x=s,B=g({itemId:l,field:d,value:b,previousValue:x});B&&typeof B.catch=="function"&&B.catch(()=>{i(n,x,{shouldDirty:!0,shouldTouch:!0});});};if(t.useAutocomplete)return jsx(Mt,{column:t,item:e,fieldPath:n,entityValue:o,disabled:S,onSelectOption:c});let p=t.options??[],m=o&&!p.some(b=>String(b.value)===o)?t.getSelectedOption?.(e,o):void 0,M=m?[m,...p]:p;return jsx(w,{children:jsx(a,{fullWidth:!0,name:n,value:o,options:M,disabled:S,size:"small",placeholder:"Preencher",sx:nt,disableClearable:!0,onSelectOption:c})})}let y=t.type==="number",R=s??"";return jsx(w,{sx:{justifyContent:y?"flex-end":"flex-start"},children:jsx(It,{fullWidth:!0,size:"small",type:y?"number":"text",placeholder:"Preencher","aria-label":t.headerName,name:n,value:R,variant:"standard",InputProps:{...Pt(y),...y&&{inputProps:{min:0}}},disabled:S,onWheel:o=>{y&&o.target.blur();},onKeyDown:o=>{(o.key===" "||o.key==="Spacebar")&&o.stopPropagation(),y&&(o.key==="-"||o.key==="e")&&o.preventDefault();},onChange:o=>{let c=o.target.value,p=c;if(y)if(c==="")p="";else {let m=Number(c);p=m<0?0:m;}i(n,p,{shouldDirty:!0,shouldTouch:!0}),g({itemId:l,field:d,value:p});}})})},rt=memo(Ot,(t,e)=>t.itemId===e.itemId&&t.rowIndex===e.rowIndex&&t.column===e.column&&t.isFieldDisabled===e.isFieldDisabled);var W="bulk-edit-datagrid-actions",Rt=({setFilterButtonEl:t})=>{let e=useCallback(a=>{t(a);},[t]);return jsx(a$3,{container:W,children:jsx(GridToolbarColumnsButton,{ref:e,slotProps:{button:{color:"inherit",startIcon:jsx(a$2,{icon:"COLUMNS"}),children:"Colunas"}}})})},it=Rt;var dt=({onClose:t,total:e,title:a})=>jsxs(A,{direction:"row",alignItems:"center",gap:3,sx:{px:3,py:0,minHeight:"var(--layout-nav-horizontal-height)"},children:[jsx(J,{variant:"text",size:"small",startIcon:jsx(a$2,{icon:"CHEVRON_LEFT"}),onClick:t,children:"Sair"}),jsxs(A,{flex:1,direction:"row",alignItems:"center",component:"h2",m:0,gap:1,children:[jsx(at,{component:"span",variant:"h6",children:"Editando"}),typeof e=="number"&&jsx(q,{component:"span",disabled:!0,label:e,size:"small",color:"default"}),jsx(at,{component:"span",variant:"h6",children:a})]}),jsx(A,{direction:"row",alignItems:"center",justifyContent:"flex-end",gap:1,id:W})]});var pt=[10,25,50,100],Wt=t=>t.type==="number"?"right":t.type==="boolean"?"center":"left",Vt=({open:t,onClose:e,title:a,header:l,items:g,columns:T,getItemId:i,isLoading:C,page:d,perPage:n,total:h,onPageChange:s,onRowsPerPageChange:S,onFieldChange:E,isFieldDisabled:y,showColumnButton:R,initialState:o})=>{let[c,p]=useState(null),m=g,M=n>0?Math.ceil(h/n):0,b=M>0?M-1:0,x=Math.min(Math.max(d,0),b),B=useMemo(()=>({page:x,pageSize:n}),[n,x]),ut=useMemo(()=>{let r=n?[n,...pt]:pt;return Array.from(new Set(r)).sort((O,v)=>O-v)},[n]),P=useCallback(r=>{r.pageSize!==n&&S(r.pageSize),(r.page!==d||r.pageSize!==n)&&s(r.page,r.pageSize);},[s,S,d,n]),ct=useCallback(r=>{P({page:r,pageSize:n});},[P,n]),mt=useCallback(r=>{P({page:x,pageSize:r});},[P,x]),ft=useMemo(()=>T.map(r=>{let O=Wt(r),v=r.type==="boolean"?100:180;return {field:String(r.field),headerName:r.headerName,flex:1,minWidth:v,disableColumnMenu:!0,headerAlign:O,align:O,renderCell:D=>{let F=D.api.getRowIndexRelativeToVisibleRows(D.id),gt=typeof F=="number"&&F>-1?F:0;return jsx(rt,{column:r,item:D.row,rowIndex:gt,itemId:i(D.row),onFieldChange:E,isFieldDisabled:y})}}}),[T,i,y,E]);return jsx(X,{open:t,onClose:e,fullWidth:!0,children:jsxs(Z,{children:[l??jsx(dt,{onClose:e,total:h,title:a}),C&&jsx(zt,{sx:{height:2}}),jsx(Q,{children:jsx(Y,{columns:ft,rows:m,getRowId:r=>i(r),hideFooterSelectedRowCount:!0,hideFooter:!0,disableRowSelectionOnClick:!0,paginationModel:B,onPaginationModelChange:P,pageSizeOptions:ut,paginationMode:"server",rowCount:h,rowHeight:56,loading:C,slots:{loadingOverlay:a$1,...R&&{toolbar:it}},slotProps:{panel:{anchorEl:c},toolbar:{setFilterButtonEl:p}},initialState:o})}),jsxs(et,{children:[jsxs(ot,{component:"p",children:[jsx(at,{component:"span",variant:"body2",color:"text.disabled",children:"Total de itens:"}),jsx(at,{component:"span",variant:"body2",children:h})]}),jsx(r,{count:h,page:x,rowsPerPage:n,onPageChange:ct,onRowsPerPageChange:mt})]})]})})},Nt=t=>{let{items:e}=t,a=useForm({defaultValues:{items:e}});return useEffect(()=>{a.reset({items:e});},[a,e]),jsx(FormProvider,{...a,children:jsx(Vt,{...t})})},Ge=Nt;
|
|
26
26
|
|
|
27
|
-
export {
|
|
27
|
+
export { Ge as default };
|
|
28
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/BulkEditModal/index.tsx","../../../src/components/BulkEditModal/BulkEditGridCell.tsx","../../../src/components/BulkEditModal/styles.ts","../../../src/components/BulkEditModal/Header.tsx","../../../src/components/BulkEditModal/Toolbar.tsx"],"names":["useCallback","useEffect","useMemo","useState","FormProvider","useForm","LinearProgress","Typography","memo","useFormContext","useWatch","Switch","TextField","Box","Button","Chip","Dialog","Stack","styled","DataGridPremium","BulkEditDialog","BulkEditContainer","StyledChip","theme","StyledBackButton","GridWrapper","StyledDataGrid","CellContent","ReadOnlyText","Footer","FooterTotal","jsx","AUTOCOMPLETE_SX","getInputProps","isNumber","formatDisplayValue","value","column","option","opt","BulkEditGridCellComponent","item","rowIndex","itemId","onFieldChange","isFieldDisabled","setValue","control","fieldName","fieldPath","watchedValue","cellValue","isDisabled","isIdField","displayValue","event","previousValue","result","entityValue","recordValue","Autocomplete_default","newValue","inputValue","rawValue","num","BulkEditGridCell","prev","next","GridToolbarColumnsButton","BULK_EDIT_DATAGRID_ACTIONS","BulkEditToolbar","setFilterButtonEl","handleColumnsButtonRef","button","Portal_default","Icon_default","Toolbar_default","jsxs","Header","onClose","total","title","DEFAULT_PAGE_SIZE_OPTIONS","resolveAlignment","BulkEditModalInner","open","header","items","columns","getItemId","isLoading","page","perPage","onPageChange","onRowsPerPageChange","showColumnButton","initialState","filterButtonEl","rows","totalPages","maxPage","safePage","paginationModel","pageSizeOptions","options","a","b","handlePaginationModelChange","model","handleFooterPageChange","newPage","handleFooterRowsPerPageChange","newRowsPerPage","dataGridColumns","align","baseWidth","params","visibleIndex","row","LoadingOverlay_default","Pagination_default","BulkEditModal","props","formMethods","BulkEditModal_default"],"mappings":"4VAAA,OAAS,eAAAA,EAAa,aAAAC,GAAW,WAAAC,EAAS,YAAAC,OAAgB,QAC1D,OAAS,gBAAAC,GAAc,WAAAC,OAAe,kBACtC,OAAOC,OAAoB,+BAC3B,OAAOC,OAAgB,2BCHvB,OAAS,QAAAC,OAAY,QACrB,OAAS,kBAAAC,GAAgB,YAAAC,OAAgB,kBACzC,OAAOC,OAAY,uBACnB,OAAOC,OAAe,0BACtB,OAAOL,OAAgB,2BCJvB,OAAOM,MAAS,oBAChB,OAAOC,OAA6B,uBACpC,OAAOC,OAAyB,qBAChC,OAAOC,OAAY,uBACnB,OAAOC,MAA2B,sBAClC,OAAS,UAAAC,MAAc,uBACvB,OAAOX,OAAgB,2BACvB,OAAS,mBAAAY,OAAuB,2BAEzB,IAAMC,EAAiBF,EAAOF,EAAM,EAAE,CAC3C,qBAAsB,CACpB,OAAQ,EACR,aAAc,EACd,UAAW,QACX,QAAS,EACT,OAAQ,QACR,MAAO,OACP,SAAU,MACZ,CACF,CAAC,EAEYK,EAAoBH,EAAOD,CAAK,EAAE,CAC7C,OAAQ,OACR,UAAW,CACb,CAAC,EAEYK,EAAaJ,EAAOH,EAAI,EAAa,CAAC,CAAE,MAAAQ,CAAM,KAAO,CAChE,QAAS,EACT,mBAAoB,CAClB,MAAOA,EAAM,QAAQ,KAAK,UAC1B,WAAY,KACd,CACF,EAAE,EAEWC,EAAmBN,EAAOJ,EAAM,EAAe,CAAC,CAAE,MAAAS,CAAM,KAAO,CA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,CAC7B,EAAG,CAACoC,EAAapC,CAAK,CAAC,EAGrBxD,EAAC3B,GAAA,CAAc,GAAGuH,EAChB,SAAA5F,EAACqD,GAAA,CAA2B,GAAGsC,EAAO,EACxC,CAEJ,EAIOE,GAAQH","sourcesContent":["import { useCallback, useEffect, useMemo, useState } from 'react';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport LinearProgress from '@mui/material/LinearProgress';\nimport Typography from '@mui/material/Typography';\nimport type {\n GridSlots,\n GridSlotsComponentsProps,\n} from '@mui/x-data-grid-premium';\nimport {\n GridAlignment,\n GridColDef,\n GridPaginationModel,\n GridValidRowModel,\n} from '@mui/x-data-grid-premium';\n\nimport LoadingOverlay from 'components/DataGrid/LoadingOverlay';\nimport Pagination from 'components/DataView/Pagination';\n\nimport { BulkEditGridCell } from './BulkEditGridCell';\nimport { Header } from './Header';\nimport { type BulkEditModalInnerProps, type BulkEditModalProps } from './props';\nimport {\n BulkEditContainer,\n BulkEditDialog,\n Footer,\n FooterTotal,\n GridWrapper,\n StyledDataGrid,\n} from './styles';\nimport BulkEditToolbar from './Toolbar';\n\nconst DEFAULT_PAGE_SIZE_OPTIONS = [10, 25, 50, 100];\n\nconst resolveAlignment = <TItem extends Record<string, unknown>>(\n column: BulkEditModalInnerProps<TItem>['columns'][number],\n): GridAlignment => {\n if (column.type === 'number') return 'right';\n if (column.type === 'boolean') return 'center';\n return 'left';\n};\n\nconst BulkEditModalInner = <TItem extends Record<string, unknown>>({\n open,\n onClose,\n title,\n header,\n items,\n columns,\n getItemId,\n isLoading,\n page,\n perPage,\n total,\n onPageChange,\n onRowsPerPageChange,\n onFieldChange,\n isFieldDisabled,\n showColumnButton,\n initialState,\n}: BulkEditModalInnerProps<TItem>) => {\n const [filterButtonEl, setFilterButtonEl] =\n useState<HTMLButtonElement | null>(null);\n const rows = items;\n\n const totalPages = perPage > 0 ? Math.ceil(total / perPage) : 0;\n const maxPage = totalPages > 0 ? totalPages - 1 : 0;\n const safePage = Math.min(Math.max(page, 0), maxPage);\n\n const paginationModel = useMemo(\n () => ({\n page: safePage,\n pageSize: perPage,\n }),\n [perPage, safePage],\n );\n\n const pageSizeOptions = useMemo(() => {\n const options = perPage\n ? [perPage, ...DEFAULT_PAGE_SIZE_OPTIONS]\n : DEFAULT_PAGE_SIZE_OPTIONS;\n return Array.from(new Set(options)).sort((a, b) => a - b);\n }, [perPage]);\n\n const handlePaginationModelChange = useCallback(\n (model: GridPaginationModel) => {\n if (model.pageSize !== perPage) {\n onRowsPerPageChange(model.pageSize);\n }\n\n if (model.page !== page || model.pageSize !== perPage) {\n onPageChange(model.page, model.pageSize);\n }\n },\n [onPageChange, onRowsPerPageChange, page, perPage],\n );\n\n const handleFooterPageChange = useCallback(\n (newPage: number) => {\n handlePaginationModelChange({ page: newPage, pageSize: perPage });\n },\n [handlePaginationModelChange, perPage],\n );\n\n const handleFooterRowsPerPageChange = useCallback(\n (newRowsPerPage: number) => {\n handlePaginationModelChange({ page: safePage, pageSize: newRowsPerPage });\n },\n [handlePaginationModelChange, safePage],\n );\n\n const dataGridColumns = useMemo<GridColDef<GridValidRowModel>[]>(\n () =>\n columns.map(column => {\n const align = resolveAlignment(column);\n const baseWidth = column.type === 'boolean' ? 100 : 180;\n\n return {\n field: String(column.field),\n headerName: column.headerName,\n flex: 1,\n minWidth: baseWidth,\n disableColumnMenu: true,\n headerAlign: align,\n align,\n renderCell: params => {\n const visibleIndex = params.api.getRowIndexRelativeToVisibleRows(\n params.id,\n );\n const rowIndex =\n typeof visibleIndex === 'number' && visibleIndex > -1\n ? visibleIndex\n : 0;\n\n return (\n <BulkEditGridCell\n column={column}\n item={params.row as TItem}\n rowIndex={rowIndex}\n itemId={getItemId(params.row as TItem)}\n onFieldChange={onFieldChange}\n isFieldDisabled={isFieldDisabled}\n />\n );\n },\n };\n }),\n [columns, getItemId, isFieldDisabled, onFieldChange],\n );\n\n return (\n <BulkEditDialog open={open} onClose={onClose} fullWidth>\n <BulkEditContainer>\n {header ?? <Header onClose={onClose} total={total} title={title} />}\n {isLoading && <LinearProgress sx={{ height: 2 }} />}\n\n <GridWrapper>\n <StyledDataGrid\n columns={dataGridColumns}\n rows={rows as unknown as GridValidRowModel[]}\n getRowId={row => getItemId(row as TItem)}\n hideFooterSelectedRowCount\n hideFooter\n disableRowSelectionOnClick\n paginationModel={paginationModel}\n onPaginationModelChange={handlePaginationModelChange}\n pageSizeOptions={pageSizeOptions}\n paginationMode=\"server\"\n rowCount={total}\n rowHeight={56}\n loading={isLoading}\n slots={{\n loadingOverlay: LoadingOverlay,\n ...(showColumnButton && {\n toolbar: BulkEditToolbar as unknown as GridSlots['toolbar'],\n }),\n }}\n slotProps={{\n panel: { anchorEl: filterButtonEl },\n toolbar: {\n setFilterButtonEl,\n } as unknown as GridSlotsComponentsProps['toolbar'],\n }}\n initialState={initialState}\n />\n </GridWrapper>\n <Footer>\n <FooterTotal component=\"p\">\n <Typography component=\"span\" variant=\"body2\" color=\"text.disabled\">\n Total de itens:\n </Typography>\n <Typography component=\"span\" variant=\"body2\">\n {total}\n </Typography>\n </FooterTotal>\n <Pagination\n count={total}\n page={safePage}\n rowsPerPage={perPage}\n onPageChange={handleFooterPageChange}\n onRowsPerPageChange={handleFooterRowsPerPageChange}\n />\n </Footer>\n </BulkEditContainer>\n </BulkEditDialog>\n );\n};\n\nconst BulkEditModal = <TItem extends Record<string, unknown>>(\n props: BulkEditModalProps<TItem>,\n) => {\n const { items } = props;\n const formMethods = useForm<{ items: TItem[] }>({\n defaultValues: { items },\n });\n\n // O desempenho é melhor que values: { items } no useForm\n useEffect(() => {\n formMethods.reset({ items });\n }, [formMethods, items]);\n\n return (\n <FormProvider {...formMethods}>\n <BulkEditModalInner<TItem> {...props} />\n </FormProvider>\n );\n};\n\nexport * from './props';\n\nexport default BulkEditModal;\n","import { memo } from 'react';\nimport { useFormContext, useWatch } from 'react-hook-form';\nimport Switch from '@mui/material/Switch';\nimport TextField from '@mui/material/TextField';\nimport Typography from '@mui/material/Typography';\n\nimport Autocomplete from 'components/form/Autocomplete';\n\nimport {\n BulkEditGridCellProps,\n BulkEditModalColumn,\n BulkEditModalFieldChangeParams,\n} from './props';\nimport { CellContent, ReadOnlyText } from './styles';\n\nconst AUTOCOMPLETE_SX = {\n '& .MuiOutlinedInput-root': {\n px: 0,\n borderRadius: 0,\n background: 'transparent',\n '& fieldset, &:hover fieldset, &.Mui-focused fieldset': {\n background: 'transparent',\n borderRadius: 0,\n border: 'none',\n },\n },\n '& .MuiInputBase-input': {\n py: 0,\n height: 56,\n background: 'transparent',\n },\n} as const;\n\nconst getInputProps = (isNumber: boolean) => {\n return {\n disableUnderline: true,\n sx: {\n px: 0,\n '& input': {\n textAlign: isNumber ? 'right' : 'left',\n },\n },\n };\n};\n\nconst formatDisplayValue = <TItem extends Record<string, unknown>>(\n value: unknown,\n column: BulkEditModalColumn<TItem>,\n) => {\n if (value === null || value === undefined || value === '') {\n return null;\n }\n\n if (column.type === 'entity' && column.options) {\n const option = column.options.find(\n opt => opt.value?.toString() === value?.toString(),\n );\n if (option) {\n return option.label;\n }\n }\n\n if (typeof value === 'object') {\n if ('name' in (value as Record<string, unknown>)) {\n return String((value as { name: unknown }).name);\n }\n if ('label' in (value as Record<string, unknown>)) {\n return String((value as { label: unknown }).label);\n }\n if ('value' in (value as Record<string, unknown>)) {\n return String((value as { value: unknown }).value);\n }\n }\n\n if (typeof value === 'boolean') {\n return value ? 'Sim' : 'Não';\n }\n\n return String(value);\n};\n\nconst BulkEditGridCellComponent = <TItem extends Record<string, unknown>>({\n column,\n item,\n rowIndex,\n itemId,\n onFieldChange,\n isFieldDisabled,\n}: BulkEditGridCellProps<TItem>) => {\n const { setValue, control } = useFormContext();\n const fieldName = column.field;\n const fieldPath = `items.${rowIndex}.${String(fieldName)}`;\n const watchedValue = useWatch({\n control,\n name: fieldPath,\n defaultValue: item?.[fieldName],\n });\n const cellValue =\n watchedValue === undefined ? item?.[fieldName] : watchedValue;\n const isDisabled =\n column.readOnly ||\n (isFieldDisabled ? isFieldDisabled({ item, field: fieldName }) : false);\n const isIdField = String(fieldName) === 'id';\n\n if (column.readOnly || isIdField) {\n const displayValue = formatDisplayValue(cellValue, column);\n\n return (\n <CellContent>\n {displayValue ? (\n <ReadOnlyText variant=\"body2\">{displayValue}</ReadOnlyText>\n ) : (\n <Typography variant=\"body2\" color=\"text.disabled\">\n -\n </Typography>\n )}\n </CellContent>\n );\n }\n\n if (column.type === 'boolean') {\n return (\n <CellContent sx={{ justifyContent: 'center' }}>\n <Switch\n color=\"primary\"\n checked={Boolean(cellValue)}\n inputProps={{ 'aria-label': column.headerName }}\n onChange={event => {\n const value = event.target.checked;\n const previousValue = cellValue;\n\n setValue(fieldPath, value as TItem[keyof TItem], {\n shouldDirty: true,\n shouldTouch: true,\n });\n\n const result = onFieldChange({\n itemId,\n field: fieldName,\n value,\n previousValue,\n } as BulkEditModalFieldChangeParams<TItem>);\n\n if (\n result &&\n typeof (result as Promise<unknown>).catch === 'function'\n ) {\n (result as Promise<unknown>).catch(() => {\n setValue(fieldPath, previousValue as TItem[keyof TItem], {\n shouldDirty: true,\n shouldTouch: true,\n });\n });\n }\n }}\n disabled={isDisabled}\n />\n </CellContent>\n );\n }\n\n if (column.type === 'entity') {\n let entityValue = '';\n\n if (cellValue !== null && cellValue !== undefined && cellValue !== '') {\n if (typeof cellValue === 'object') {\n const recordValue = cellValue as Record<string, unknown>;\n\n if ('id' in recordValue) {\n entityValue = String(recordValue.id ?? '');\n } else if ('value' in recordValue) {\n entityValue = String(recordValue.value ?? '');\n }\n } else {\n entityValue = String(cellValue);\n }\n }\n\n return (\n <CellContent>\n <Autocomplete\n fullWidth\n name={fieldPath}\n value={entityValue}\n options={column.options ?? []}\n disabled={isDisabled}\n size=\"small\"\n placeholder=\"Preencher\"\n sx={AUTOCOMPLETE_SX}\n disableClearable\n onSelectOption={(newValue: unknown) => {\n const previousValue = cellValue;\n\n const result = onFieldChange({\n itemId,\n field: fieldName,\n value: newValue,\n previousValue,\n } as BulkEditModalFieldChangeParams<TItem>);\n\n if (\n result &&\n typeof (result as Promise<unknown>).catch === 'function'\n ) {\n (result as Promise<unknown>).catch(() => {\n setValue(fieldPath, previousValue as TItem[keyof TItem], {\n shouldDirty: true,\n shouldTouch: true,\n });\n });\n }\n }}\n />\n </CellContent>\n );\n }\n\n const isNumber = column.type === 'number';\n const inputValue = cellValue ?? '';\n\n return (\n <CellContent sx={{ justifyContent: isNumber ? 'flex-end' : 'flex-start' }}>\n <TextField\n fullWidth\n size=\"small\"\n type={isNumber ? 'number' : 'text'}\n placeholder=\"Preencher\"\n aria-label={column.headerName}\n name={fieldPath}\n value={inputValue as string | number}\n variant=\"standard\"\n InputProps={{\n ...getInputProps(isNumber),\n ...(isNumber && { inputProps: { min: 0 } }),\n }}\n disabled={isDisabled}\n onWheel={event => {\n if (isNumber) {\n (event.target as HTMLInputElement).blur();\n }\n }}\n onKeyDown={event => {\n if (event.key === ' ' || event.key === 'Spacebar') {\n event.stopPropagation();\n }\n if (isNumber && (event.key === '-' || event.key === 'e')) {\n event.preventDefault();\n }\n }}\n onChange={event => {\n const rawValue = event.target.value;\n let value: string | number = rawValue;\n if (isNumber) {\n if (rawValue === '') {\n value = '';\n } else {\n const num = Number(rawValue);\n value = num < 0 ? 0 : num;\n }\n }\n setValue(fieldPath, value as TItem[keyof TItem], {\n shouldDirty: true,\n shouldTouch: true,\n });\n\n onFieldChange({\n itemId,\n field: fieldName,\n value,\n } as BulkEditModalFieldChangeParams<TItem>);\n }}\n />\n </CellContent>\n );\n};\n\nexport const BulkEditGridCell = memo(\n BulkEditGridCellComponent,\n (prev, next) =>\n prev.itemId === next.itemId &&\n prev.rowIndex === next.rowIndex &&\n prev.column === next.column &&\n prev.isFieldDisabled === next.isFieldDisabled,\n) as typeof BulkEditGridCellComponent;\n","import Box from '@mui/material/Box';\nimport Button, { ButtonProps } from '@mui/material/Button';\nimport Chip, { ChipProps } from '@mui/material/Chip';\nimport Dialog from '@mui/material/Dialog';\nimport Stack, { StackProps } from '@mui/material/Stack';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport { DataGridPremium } from '@mui/x-data-grid-premium';\n\nexport const BulkEditDialog = styled(Dialog)({\n '& .MuiDialog-paper': {\n margin: 0,\n borderRadius: 0,\n maxHeight: '100vh',\n padding: 0,\n height: '100vh',\n width: '100%',\n maxWidth: '100%',\n },\n});\n\nexport const BulkEditContainer = styled(Stack)({\n height: '100%',\n minHeight: 0,\n});\n\nexport const StyledChip = styled(Chip)<ChipProps>(({ theme }) => ({\n padding: 0,\n '& .MuiChip-label': {\n color: theme.palette.text.secondary,\n fontWeight: '700',\n },\n}));\n\nexport const StyledBackButton = styled(Button)<ButtonProps>(({ theme }) => ({\n color: theme.palette.text.secondary,\n}));\n\nexport const GridWrapper = styled(Box)({\n flex: 1,\n minHeight: 0,\n padding: 0,\n display: 'flex',\n alignItems: 'stretch',\n});\n\nexport const StyledDataGrid = styled(DataGridPremium)(({ theme }) => ({\n flex: 1,\n height: '100%',\n minHeight: 320,\n borderRadius: theme.shape.borderRadius,\n backgroundColor: theme.palette.background.paper,\n '& .MuiDataGrid-columnHeaders': {\n borderBottom: `1px solid ${theme.palette.divider}`,\n minHeight: 48,\n maxHeight: 48,\n },\n '& .MuiDataGrid-columnHeader': {\n borderTop: `1px solid ${theme.palette.divider} !important`,\n borderBottom: `1px solid ${theme.palette.divider} !important`,\n minWidth: '120px !important',\n },\n '& .MuiDataGrid-cell': {\n alignItems: 'stretch',\n borderTop: `1px solid ${theme.palette.divider}`,\n minWidth: 120,\n width: '100%',\n borderLeft: `1px solid ${theme.palette.divider}`,\n padding: 0,\n },\n '& .MuiDataGrid-cell:focus, & .MuiDataGrid-columnHeader:focus': {\n outline: 'none',\n },\n '& .MuiDataGrid-withBorderColor': {\n borderColor: theme.palette.divider,\n },\n '& .MuiDataGrid-virtualScroller': {\n overflowX: 'auto',\n },\n '& .MuiDataGrid-footerContainer': {\n borderTop: `1px solid ${theme.palette.divider}`,\n },\n}));\n\nexport const CellContent = styled(Box)({\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n height: '100%',\n padding: 0,\n boxSizing: 'border-box',\n\n '& .MuiTypography-root': {\n width: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n});\n\nexport const ReadOnlyText = styled(Typography)(({ theme }) => ({\n color: theme.palette.text.primary,\n}));\n\nexport const Footer = styled(Stack)(({ theme }) => ({\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n borderTop: `1px solid ${theme.palette.divider}`,\n padding: theme.spacing(2, 3),\n gap: theme.spacing(2),\n flexWrap: 'wrap',\n}));\n\nexport const FooterTotal = styled(Stack)<StackProps>(({ theme }) => ({\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(0.5),\n}));\n","import Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport Icon from 'components/Icon';\n\nimport { HeaderProps } from './props';\nimport { StyledBackButton, StyledChip } from './styles';\nimport { BULK_EDIT_DATAGRID_ACTIONS } from './Toolbar';\n\nexport const Header = ({ onClose, total, title }: HeaderProps) => {\n const showTotal = typeof total === 'number';\n\n return (\n <Stack\n direction=\"row\"\n alignItems=\"center\"\n gap={3}\n sx={{ px: 3, py: 0, minHeight: 'var(--layout-nav-horizontal-height)' }}\n >\n <StyledBackButton\n variant=\"text\"\n size=\"small\"\n startIcon={<Icon icon=\"CHEVRON_LEFT\" />}\n onClick={onClose}\n >\n Sair\n </StyledBackButton>\n\n <Stack\n flex={1}\n direction=\"row\"\n alignItems=\"center\"\n component=\"h2\"\n m={0}\n gap={1}\n >\n <Typography component=\"span\" variant=\"h6\">\n Editando\n </Typography>\n {showTotal && (\n <StyledChip\n component=\"span\"\n disabled\n label={total}\n size=\"small\"\n color=\"default\"\n />\n )}\n <Typography component=\"span\" variant=\"h6\">\n {title}\n </Typography>\n </Stack>\n <Stack\n direction=\"row\"\n alignItems=\"center\"\n justifyContent=\"flex-end\"\n gap={1}\n id={BULK_EDIT_DATAGRID_ACTIONS}\n />\n </Stack>\n );\n};\n","import { useCallback } from 'react';\nimport { GridToolbarColumnsButton } from '@mui/x-data-grid-premium';\n\nimport Icon from 'components/Icon';\nimport Portal from 'components/Portal';\n\nimport { BulkEditToolbarProps } from './props';\n\nexport const BULK_EDIT_DATAGRID_ACTIONS = 'bulk-edit-datagrid-actions';\n\nconst BulkEditToolbar = ({ setFilterButtonEl }: BulkEditToolbarProps) => {\n const handleColumnsButtonRef = useCallback(\n (button: HTMLButtonElement | null) => {\n setFilterButtonEl(button);\n },\n [setFilterButtonEl],\n );\n\n return (\n <Portal container={BULK_EDIT_DATAGRID_ACTIONS}>\n <GridToolbarColumnsButton\n ref={handleColumnsButtonRef}\n slotProps={{\n button: {\n color: 'inherit',\n startIcon: <Icon icon=\"COLUMNS\" />,\n children: 'Colunas',\n },\n }}\n />\n </Portal>\n );\n};\n\nexport default BulkEditToolbar;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/BulkEditModal/index.tsx","../../../src/components/BulkEditModal/BulkEditGridCell.tsx","../../../src/components/BulkEditModal/styles.ts","../../../src/components/BulkEditModal/Header.tsx","../../../src/components/BulkEditModal/Toolbar.tsx"],"names":["useCallback","useEffect","useMemo","useState","FormProvider","useForm","LinearProgress","Typography","memo","useFormContext","useWatch","Switch","TextField","Box","Button","Chip","Dialog","Stack","styled","DataGridPremium","BulkEditDialog","BulkEditContainer","StyledChip","theme","StyledBackButton","GridWrapper","StyledDataGrid","CellContent","ReadOnlyText","Footer","FooterTotal","jsx","AUTOCOMPLETE_SX","getInputProps","isNumber","formatDisplayValue","value","column","item","option","opt","selectedOption","DynamicEntityCell","fieldPath","entityValue","disabled","onSelectOption","autocomplete","baseOptions","options","Autocomplete_default","BulkEditGridCellComponent","rowIndex","itemId","onFieldChange","isFieldDisabled","setValue","control","fieldName","watchedValue","cellValue","isDisabled","isIdField","displayValue","event","previousValue","result","recordValue","handleSelectOption","newValue","inputValue","rawValue","num","BulkEditGridCell","prev","next","GridToolbarColumnsButton","BULK_EDIT_DATAGRID_ACTIONS","BulkEditToolbar","setFilterButtonEl","handleColumnsButtonRef","button","Portal_default","Icon_default","Toolbar_default","jsxs","Header","onClose","total","title","DEFAULT_PAGE_SIZE_OPTIONS","resolveAlignment","BulkEditModalInner","open","header","items","columns","getItemId","isLoading","page","perPage","onPageChange","onRowsPerPageChange","showColumnButton","initialState","filterButtonEl","rows","totalPages","maxPage","safePage","paginationModel","pageSizeOptions","a","b","handlePaginationModelChange","model","handleFooterPageChange","newPage","handleFooterRowsPerPageChange","newRowsPerPage","dataGridColumns","align","baseWidth","params","visibleIndex","row","LoadingOverlay_default","Pagination_default","BulkEditModal","props","formMethods","BulkEditModal_default"],"mappings":"4VAAA,OAAS,eAAAA,EAAa,aAAAC,GAAW,WAAAC,EAAS,YAAAC,OAAgB,QAC1D,OAAS,gBAAAC,GAAc,WAAAC,OAAe,kBACtC,OAAOC,OAAoB,+BAC3B,OAAOC,OAAgB,2BCHvB,OAAS,QAAAC,OAAY,QACrB,OAAS,kBAAAC,GAAgB,YAAAC,OAAgB,kBACzC,OAAOC,OAAY,uBACnB,OAAOC,OAAe,0BACtB,OAAOL,OAAgB,2BCJvB,OAAOM,MAAS,oBAChB,OAAOC,OAA6B,uBACpC,OAAOC,OAAyB,qBAChC,OAAOC,OAAY,uBACnB,OAAOC,MAA2B,sBAClC,OAAS,UAAAC,MAAc,uBACvB,OAAOX,OAAgB,2BACvB,OAAS,mBAAAY,OAAuB,2BAEzB,IAAMC,EAAiBF,EAAOF,EAAM,EAAE,CAC3C,qBAAsB,CACpB,OAAQ,EACR,aAAc,EACd,UAAW,QACX,QAAS,EACT,OAAQ,QACR,MAAO,OACP,SAAU,MACZ,CACF,CAAC,EAEYK,EAAoBH,EAAOD,CAAK,EAAE,CAC7C,OAAQ,OACR,UAAW,CACb,CAAC,EAEYK,EAAaJ,EAAOH,EAAI,EAAa,CAAC,CAAE,MAAAQ,CAAM,KAAO,CA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EAAc7H,GAA4B,CAC9C,cAAe,CAAE,MAAA0F,CAAM,CACzB,CAAC,EAGD,OAAA9F,GAAU,IAAM,CACdiI,EAAY,MAAM,CAAE,MAAAnC,CAAM,CAAC,CAC7B,EAAG,CAACmC,EAAanC,CAAK,CAAC,EAGrBhE,EAAC3B,GAAA,CAAc,GAAG8H,EAChB,SAAAnG,EAAC6D,GAAA,CAA2B,GAAGqC,EAAO,EACxC,CAEJ,EAIOE,GAAQH","sourcesContent":["import { useCallback, useEffect, useMemo, useState } from 'react';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport LinearProgress from '@mui/material/LinearProgress';\nimport Typography from '@mui/material/Typography';\nimport type {\n GridSlots,\n GridSlotsComponentsProps,\n} from '@mui/x-data-grid-premium';\nimport {\n GridAlignment,\n GridColDef,\n GridPaginationModel,\n GridValidRowModel,\n} from '@mui/x-data-grid-premium';\n\nimport LoadingOverlay from 'components/DataGrid/LoadingOverlay';\nimport Pagination from 'components/DataView/Pagination';\n\nimport { BulkEditGridCell } from './BulkEditGridCell';\nimport { Header } from './Header';\nimport { type BulkEditModalInnerProps, type BulkEditModalProps } from './props';\nimport {\n BulkEditContainer,\n BulkEditDialog,\n Footer,\n FooterTotal,\n GridWrapper,\n StyledDataGrid,\n} from './styles';\nimport BulkEditToolbar from './Toolbar';\n\nconst DEFAULT_PAGE_SIZE_OPTIONS = [10, 25, 50, 100];\n\nconst resolveAlignment = <TItem extends Record<string, unknown>>(\n column: BulkEditModalInnerProps<TItem>['columns'][number],\n): GridAlignment => {\n if (column.type === 'number') return 'right';\n if (column.type === 'boolean') return 'center';\n return 'left';\n};\n\nconst BulkEditModalInner = <TItem extends Record<string, unknown>>({\n open,\n onClose,\n title,\n header,\n items,\n columns,\n getItemId,\n isLoading,\n page,\n perPage,\n total,\n onPageChange,\n onRowsPerPageChange,\n onFieldChange,\n isFieldDisabled,\n showColumnButton,\n initialState,\n}: BulkEditModalInnerProps<TItem>) => {\n const [filterButtonEl, setFilterButtonEl] =\n useState<HTMLButtonElement | null>(null);\n const rows = items;\n\n const totalPages = perPage > 0 ? Math.ceil(total / perPage) : 0;\n const maxPage = totalPages > 0 ? totalPages - 1 : 0;\n const safePage = Math.min(Math.max(page, 0), maxPage);\n\n const paginationModel = useMemo(\n () => ({\n page: safePage,\n pageSize: perPage,\n }),\n [perPage, safePage],\n );\n\n const pageSizeOptions = useMemo(() => {\n const options = perPage\n ? [perPage, ...DEFAULT_PAGE_SIZE_OPTIONS]\n : DEFAULT_PAGE_SIZE_OPTIONS;\n return Array.from(new Set(options)).sort((a, b) => a - b);\n }, [perPage]);\n\n const handlePaginationModelChange = useCallback(\n (model: GridPaginationModel) => {\n if (model.pageSize !== perPage) {\n onRowsPerPageChange(model.pageSize);\n }\n\n if (model.page !== page || model.pageSize !== perPage) {\n onPageChange(model.page, model.pageSize);\n }\n },\n [onPageChange, onRowsPerPageChange, page, perPage],\n );\n\n const handleFooterPageChange = useCallback(\n (newPage: number) => {\n handlePaginationModelChange({ page: newPage, pageSize: perPage });\n },\n [handlePaginationModelChange, perPage],\n );\n\n const handleFooterRowsPerPageChange = useCallback(\n (newRowsPerPage: number) => {\n handlePaginationModelChange({ page: safePage, pageSize: newRowsPerPage });\n },\n [handlePaginationModelChange, safePage],\n );\n\n const dataGridColumns = useMemo<GridColDef<GridValidRowModel>[]>(\n () =>\n columns.map(column => {\n const align = resolveAlignment(column);\n const baseWidth = column.type === 'boolean' ? 100 : 180;\n\n return {\n field: String(column.field),\n headerName: column.headerName,\n flex: 1,\n minWidth: baseWidth,\n disableColumnMenu: true,\n headerAlign: align,\n align,\n renderCell: params => {\n const visibleIndex = params.api.getRowIndexRelativeToVisibleRows(\n params.id,\n );\n const rowIndex =\n typeof visibleIndex === 'number' && visibleIndex > -1\n ? visibleIndex\n : 0;\n\n return (\n <BulkEditGridCell\n column={column}\n item={params.row as TItem}\n rowIndex={rowIndex}\n itemId={getItemId(params.row as TItem)}\n onFieldChange={onFieldChange}\n isFieldDisabled={isFieldDisabled}\n />\n );\n },\n };\n }),\n [columns, getItemId, isFieldDisabled, onFieldChange],\n );\n\n return (\n <BulkEditDialog open={open} onClose={onClose} fullWidth>\n <BulkEditContainer>\n {header ?? <Header onClose={onClose} total={total} title={title} />}\n {isLoading && <LinearProgress sx={{ height: 2 }} />}\n\n <GridWrapper>\n <StyledDataGrid\n columns={dataGridColumns}\n rows={rows as unknown as GridValidRowModel[]}\n getRowId={row => getItemId(row as TItem)}\n hideFooterSelectedRowCount\n hideFooter\n disableRowSelectionOnClick\n paginationModel={paginationModel}\n onPaginationModelChange={handlePaginationModelChange}\n pageSizeOptions={pageSizeOptions}\n paginationMode=\"server\"\n rowCount={total}\n rowHeight={56}\n loading={isLoading}\n slots={{\n loadingOverlay: LoadingOverlay,\n ...(showColumnButton && {\n toolbar: BulkEditToolbar as unknown as GridSlots['toolbar'],\n }),\n }}\n slotProps={{\n panel: { anchorEl: filterButtonEl },\n toolbar: {\n setFilterButtonEl,\n } as unknown as GridSlotsComponentsProps['toolbar'],\n }}\n initialState={initialState}\n />\n </GridWrapper>\n <Footer>\n <FooterTotal component=\"p\">\n <Typography component=\"span\" variant=\"body2\" color=\"text.disabled\">\n Total de itens:\n </Typography>\n <Typography component=\"span\" variant=\"body2\">\n {total}\n </Typography>\n </FooterTotal>\n <Pagination\n count={total}\n page={safePage}\n rowsPerPage={perPage}\n onPageChange={handleFooterPageChange}\n onRowsPerPageChange={handleFooterRowsPerPageChange}\n />\n </Footer>\n </BulkEditContainer>\n </BulkEditDialog>\n );\n};\n\nconst BulkEditModal = <TItem extends Record<string, unknown>>(\n props: BulkEditModalProps<TItem>,\n) => {\n const { items } = props;\n const formMethods = useForm<{ items: TItem[] }>({\n defaultValues: { items },\n });\n\n // O desempenho é melhor que values: { items } no useForm\n useEffect(() => {\n formMethods.reset({ items });\n }, [formMethods, items]);\n\n return (\n <FormProvider {...formMethods}>\n <BulkEditModalInner<TItem> {...props} />\n </FormProvider>\n );\n};\n\nexport * from './props';\n\nexport default BulkEditModal;\n","import { memo } from 'react';\nimport { useFormContext, useWatch } from 'react-hook-form';\nimport Switch from '@mui/material/Switch';\nimport TextField from '@mui/material/TextField';\nimport Typography from '@mui/material/Typography';\n\nimport Autocomplete from 'components/form/Autocomplete';\n\nimport {\n BulkEditGridCellProps,\n BulkEditModalColumn,\n BulkEditModalFieldChangeParams,\n DynamicEntityCellProps,\n} from './props';\nimport { CellContent, ReadOnlyText } from './styles';\n\nconst AUTOCOMPLETE_SX = {\n '& .MuiOutlinedInput-root': {\n px: 0,\n borderRadius: 0,\n background: 'transparent',\n '& fieldset, &:hover fieldset, &.Mui-focused fieldset': {\n background: 'transparent',\n borderRadius: 0,\n border: 'none',\n },\n },\n '& .MuiInputBase-input': {\n py: 0,\n height: 56,\n background: 'transparent',\n },\n} as const;\n\nconst getInputProps = (isNumber: boolean) => {\n return {\n disableUnderline: true,\n sx: {\n px: 0,\n '& input': {\n textAlign: isNumber ? 'right' : 'left',\n },\n },\n };\n};\n\nconst formatDisplayValue = <TItem extends Record<string, unknown>>(\n value: unknown,\n column: BulkEditModalColumn<TItem>,\n item: TItem,\n) => {\n if (value === null || value === undefined || value === '') {\n return null;\n }\n\n if (column.type === 'entity') {\n const option = column.options?.find(\n opt => opt.value?.toString() === value?.toString(),\n );\n if (option) {\n return option.label;\n }\n\n const selectedOption = column.getSelectedOption?.(item, String(value));\n if (selectedOption) {\n return selectedOption.label;\n }\n }\n\n if (typeof value === 'object') {\n if ('name' in (value as Record<string, unknown>)) {\n return String((value as { name: unknown }).name);\n }\n if ('label' in (value as Record<string, unknown>)) {\n return String((value as { label: unknown }).label);\n }\n if ('value' in (value as Record<string, unknown>)) {\n return String((value as { value: unknown }).value);\n }\n }\n\n if (typeof value === 'boolean') {\n return value ? 'Sim' : 'Não';\n }\n\n return String(value);\n};\n\nconst DynamicEntityCell = <TItem extends Record<string, unknown>>({\n column,\n item,\n fieldPath,\n entityValue,\n disabled,\n onSelectOption,\n}: DynamicEntityCellProps<TItem>) => {\n const autocomplete = column.useAutocomplete!();\n\n const baseOptions = autocomplete.options;\n const selectedOption =\n entityValue && !baseOptions.some(opt => String(opt.value) === entityValue)\n ? (autocomplete.resolveOption?.(entityValue) ??\n column.getSelectedOption?.(item, entityValue))\n : undefined;\n const options = selectedOption\n ? [selectedOption, ...baseOptions]\n : baseOptions;\n\n return (\n <CellContent>\n <Autocomplete\n fullWidth\n name={fieldPath}\n value={entityValue}\n options={options}\n loading={autocomplete.loading}\n onSearch={autocomplete.onSearch}\n onOpen={autocomplete.onOpen}\n onClose={autocomplete.onClose}\n onScrollEnd={autocomplete.onScrollEnd}\n filterOptions={autocomplete.filterOptions}\n {...(autocomplete.noOptionsText !== undefined && {\n noOptionsText: autocomplete.noOptionsText,\n })}\n disabled={disabled}\n size=\"small\"\n placeholder=\"Preencher\"\n sx={AUTOCOMPLETE_SX}\n disableClearable\n selectOnFocus\n onSelectOption={onSelectOption}\n />\n </CellContent>\n );\n};\n\nconst BulkEditGridCellComponent = <TItem extends Record<string, unknown>>({\n column,\n item,\n rowIndex,\n itemId,\n onFieldChange,\n isFieldDisabled,\n}: BulkEditGridCellProps<TItem>) => {\n const { setValue, control } = useFormContext();\n const fieldName = column.field;\n const fieldPath = `items.${rowIndex}.${String(fieldName)}`;\n const watchedValue = useWatch({\n control,\n name: fieldPath,\n defaultValue: item?.[fieldName],\n });\n const cellValue =\n watchedValue === undefined ? item?.[fieldName] : watchedValue;\n const isDisabled =\n column.readOnly ||\n (isFieldDisabled ? isFieldDisabled({ item, field: fieldName }) : false);\n const isIdField = String(fieldName) === 'id';\n\n if (column.readOnly || isIdField) {\n const displayValue = formatDisplayValue(cellValue, column, item);\n\n return (\n <CellContent>\n {displayValue ? (\n <ReadOnlyText variant=\"body2\">{displayValue}</ReadOnlyText>\n ) : (\n <Typography variant=\"body2\" color=\"text.disabled\">\n -\n </Typography>\n )}\n </CellContent>\n );\n }\n\n if (column.type === 'boolean') {\n return (\n <CellContent sx={{ justifyContent: 'center' }}>\n <Switch\n color=\"primary\"\n checked={Boolean(cellValue)}\n inputProps={{ 'aria-label': column.headerName }}\n onChange={event => {\n const value = event.target.checked;\n const previousValue = cellValue;\n\n setValue(fieldPath, value as TItem[keyof TItem], {\n shouldDirty: true,\n shouldTouch: true,\n });\n\n const result = onFieldChange({\n itemId,\n field: fieldName,\n value,\n previousValue,\n } as BulkEditModalFieldChangeParams<TItem>);\n\n if (\n result &&\n typeof (result as Promise<unknown>).catch === 'function'\n ) {\n (result as Promise<unknown>).catch(() => {\n setValue(fieldPath, previousValue as TItem[keyof TItem], {\n shouldDirty: true,\n shouldTouch: true,\n });\n });\n }\n }}\n disabled={isDisabled}\n />\n </CellContent>\n );\n }\n\n if (column.type === 'entity') {\n let entityValue = '';\n\n if (cellValue !== null && cellValue !== undefined && cellValue !== '') {\n if (typeof cellValue === 'object') {\n const recordValue = cellValue as Record<string, unknown>;\n\n if ('id' in recordValue) {\n entityValue = String(recordValue.id ?? '');\n } else if ('value' in recordValue) {\n entityValue = String(recordValue.value ?? '');\n }\n } else {\n entityValue = String(cellValue);\n }\n }\n\n const handleSelectOption = (newValue: unknown) => {\n const previousValue = cellValue;\n\n const result = onFieldChange({\n itemId,\n field: fieldName,\n value: newValue,\n previousValue,\n } as BulkEditModalFieldChangeParams<TItem>);\n\n if (result && typeof (result as Promise<unknown>).catch === 'function') {\n (result as Promise<unknown>).catch(() => {\n setValue(fieldPath, previousValue as TItem[keyof TItem], {\n shouldDirty: true,\n shouldTouch: true,\n });\n });\n }\n };\n\n if (column.useAutocomplete) {\n return (\n <DynamicEntityCell\n column={column}\n item={item}\n fieldPath={fieldPath}\n entityValue={entityValue}\n disabled={isDisabled}\n onSelectOption={handleSelectOption}\n />\n );\n }\n\n const baseOptions = column.options ?? [];\n const selectedOption =\n entityValue &&\n !baseOptions.some(opt => String(opt.value) === entityValue)\n ? column.getSelectedOption?.(item, entityValue)\n : undefined;\n const options = selectedOption\n ? [selectedOption, ...baseOptions]\n : baseOptions;\n\n return (\n <CellContent>\n <Autocomplete\n fullWidth\n name={fieldPath}\n value={entityValue}\n options={options}\n disabled={isDisabled}\n size=\"small\"\n placeholder=\"Preencher\"\n sx={AUTOCOMPLETE_SX}\n disableClearable\n onSelectOption={handleSelectOption}\n />\n </CellContent>\n );\n }\n\n const isNumber = column.type === 'number';\n const inputValue = cellValue ?? '';\n\n return (\n <CellContent sx={{ justifyContent: isNumber ? 'flex-end' : 'flex-start' }}>\n <TextField\n fullWidth\n size=\"small\"\n type={isNumber ? 'number' : 'text'}\n placeholder=\"Preencher\"\n aria-label={column.headerName}\n name={fieldPath}\n value={inputValue as string | number}\n variant=\"standard\"\n InputProps={{\n ...getInputProps(isNumber),\n ...(isNumber && { inputProps: { min: 0 } }),\n }}\n disabled={isDisabled}\n onWheel={event => {\n if (isNumber) {\n (event.target as HTMLInputElement).blur();\n }\n }}\n onKeyDown={event => {\n if (event.key === ' ' || event.key === 'Spacebar') {\n event.stopPropagation();\n }\n if (isNumber && (event.key === '-' || event.key === 'e')) {\n event.preventDefault();\n }\n }}\n onChange={event => {\n const rawValue = event.target.value;\n let value: string | number = rawValue;\n if (isNumber) {\n if (rawValue === '') {\n value = '';\n } else {\n const num = Number(rawValue);\n value = num < 0 ? 0 : num;\n }\n }\n setValue(fieldPath, value as TItem[keyof TItem], {\n shouldDirty: true,\n shouldTouch: true,\n });\n\n onFieldChange({\n itemId,\n field: fieldName,\n value,\n } as BulkEditModalFieldChangeParams<TItem>);\n }}\n />\n </CellContent>\n );\n};\n\nexport const BulkEditGridCell = memo(\n BulkEditGridCellComponent,\n (prev, next) =>\n prev.itemId === next.itemId &&\n prev.rowIndex === next.rowIndex &&\n prev.column === next.column &&\n prev.isFieldDisabled === next.isFieldDisabled,\n) as typeof BulkEditGridCellComponent;\n","import Box from '@mui/material/Box';\nimport Button, { ButtonProps } from '@mui/material/Button';\nimport Chip, { ChipProps } from '@mui/material/Chip';\nimport Dialog from '@mui/material/Dialog';\nimport Stack, { StackProps } from '@mui/material/Stack';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport { DataGridPremium } from '@mui/x-data-grid-premium';\n\nexport const BulkEditDialog = styled(Dialog)({\n '& .MuiDialog-paper': {\n margin: 0,\n borderRadius: 0,\n maxHeight: '100vh',\n padding: 0,\n height: '100vh',\n width: '100%',\n maxWidth: '100%',\n },\n});\n\nexport const BulkEditContainer = styled(Stack)({\n height: '100%',\n minHeight: 0,\n});\n\nexport const StyledChip = styled(Chip)<ChipProps>(({ theme }) => ({\n padding: 0,\n '& .MuiChip-label': {\n color: theme.palette.text.secondary,\n fontWeight: '700',\n },\n}));\n\nexport const StyledBackButton = styled(Button)<ButtonProps>(({ theme }) => ({\n color: theme.palette.text.secondary,\n}));\n\nexport const GridWrapper = styled(Box)({\n flex: 1,\n minHeight: 0,\n padding: 0,\n display: 'flex',\n alignItems: 'stretch',\n});\n\nexport const StyledDataGrid = styled(DataGridPremium)(({ theme }) => ({\n flex: 1,\n height: '100%',\n minHeight: 320,\n borderRadius: theme.shape.borderRadius,\n backgroundColor: theme.palette.background.paper,\n '& .MuiDataGrid-columnHeaders': {\n borderBottom: `1px solid ${theme.palette.divider}`,\n minHeight: 48,\n maxHeight: 48,\n },\n '& .MuiDataGrid-columnHeader': {\n borderTop: `1px solid ${theme.palette.divider} !important`,\n borderBottom: `1px solid ${theme.palette.divider} !important`,\n minWidth: '120px !important',\n },\n '& .MuiDataGrid-cell': {\n alignItems: 'stretch',\n borderTop: `1px solid ${theme.palette.divider}`,\n minWidth: 120,\n width: '100%',\n borderLeft: `1px solid ${theme.palette.divider}`,\n padding: 0,\n },\n '& .MuiDataGrid-cell:focus, & .MuiDataGrid-columnHeader:focus': {\n outline: 'none',\n },\n '& .MuiDataGrid-withBorderColor': {\n borderColor: theme.palette.divider,\n },\n '& .MuiDataGrid-virtualScroller': {\n overflowX: 'auto',\n },\n '& .MuiDataGrid-footerContainer': {\n borderTop: `1px solid ${theme.palette.divider}`,\n },\n}));\n\nexport const CellContent = styled(Box)({\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n height: '100%',\n padding: 0,\n boxSizing: 'border-box',\n\n '& .MuiTypography-root': {\n width: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n});\n\nexport const ReadOnlyText = styled(Typography)(({ theme }) => ({\n color: theme.palette.text.primary,\n}));\n\nexport const Footer = styled(Stack)(({ theme }) => ({\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n borderTop: `1px solid ${theme.palette.divider}`,\n padding: theme.spacing(2, 3),\n gap: theme.spacing(2),\n flexWrap: 'wrap',\n}));\n\nexport const FooterTotal = styled(Stack)<StackProps>(({ theme }) => ({\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(0.5),\n}));\n","import Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport Icon from 'components/Icon';\n\nimport { HeaderProps } from './props';\nimport { StyledBackButton, StyledChip } from './styles';\nimport { BULK_EDIT_DATAGRID_ACTIONS } from './Toolbar';\n\nexport const Header = ({ onClose, total, title }: HeaderProps) => {\n const showTotal = typeof total === 'number';\n\n return (\n <Stack\n direction=\"row\"\n alignItems=\"center\"\n gap={3}\n sx={{ px: 3, py: 0, minHeight: 'var(--layout-nav-horizontal-height)' }}\n >\n <StyledBackButton\n variant=\"text\"\n size=\"small\"\n startIcon={<Icon icon=\"CHEVRON_LEFT\" />}\n onClick={onClose}\n >\n Sair\n </StyledBackButton>\n\n <Stack\n flex={1}\n direction=\"row\"\n alignItems=\"center\"\n component=\"h2\"\n m={0}\n gap={1}\n >\n <Typography component=\"span\" variant=\"h6\">\n Editando\n </Typography>\n {showTotal && (\n <StyledChip\n component=\"span\"\n disabled\n label={total}\n size=\"small\"\n color=\"default\"\n />\n )}\n <Typography component=\"span\" variant=\"h6\">\n {title}\n </Typography>\n </Stack>\n <Stack\n direction=\"row\"\n alignItems=\"center\"\n justifyContent=\"flex-end\"\n gap={1}\n id={BULK_EDIT_DATAGRID_ACTIONS}\n />\n </Stack>\n );\n};\n","import { useCallback } from 'react';\nimport { GridToolbarColumnsButton } from '@mui/x-data-grid-premium';\n\nimport Icon from 'components/Icon';\nimport Portal from 'components/Portal';\n\nimport { BulkEditToolbarProps } from './props';\n\nexport const BULK_EDIT_DATAGRID_ACTIONS = 'bulk-edit-datagrid-actions';\n\nconst BulkEditToolbar = ({ setFilterButtonEl }: BulkEditToolbarProps) => {\n const handleColumnsButtonRef = useCallback(\n (button: HTMLButtonElement | null) => {\n setFilterButtonEl(button);\n },\n [setFilterButtonEl],\n );\n\n return (\n <Portal container={BULK_EDIT_DATAGRID_ACTIONS}>\n <GridToolbarColumnsButton\n ref={handleColumnsButtonRef}\n slotProps={{\n button: {\n color: 'inherit',\n startIcon: <Icon icon=\"COLUMNS\" />,\n children: 'Colunas',\n },\n }}\n />\n </Portal>\n );\n};\n\nexport default BulkEditToolbar;\n"]}
|
|
@@ -90,7 +90,7 @@ declare const SelectionOverlay: _emotion_styled.StyledComponent<_mui_material_St
|
|
|
90
90
|
}, keyof _mui_material_OverridableComponent.CommonProps | keyof _mui_material_Stack.StackOwnProps> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
|
|
91
91
|
declare const SelectionCount: _emotion_styled.StyledComponent<_mui_material_Typography.TypographyOwnProps & _mui_material_OverridableComponent.CommonProps & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
92
92
|
ref?: ((instance: HTMLSpanElement | null) => void) | react.RefObject<HTMLSpanElement> | null | undefined;
|
|
93
|
-
}, "
|
|
93
|
+
}, "fontFamily" | "children" | "pt" | "className" | "style" | "classes" | "sx" | "variant" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
|
|
94
94
|
declare const SelectionActions: _emotion_styled.StyledComponent<_mui_material_Stack.StackOwnProps & _mui_material_OverridableComponent.CommonProps & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
95
95
|
ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
|
|
96
96
|
}, keyof _mui_material_OverridableComponent.CommonProps | keyof _mui_material_Stack.StackOwnProps> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
|
|
@@ -20,7 +20,7 @@ import '../../chunk-CO2KQFUN.js';
|
|
|
20
20
|
import { a as a$8 } from '../../chunk-F6H765KA.js';
|
|
21
21
|
import '../../chunk-F65ZXAGV.js';
|
|
22
22
|
import '../../chunk-I4PPSW36.js';
|
|
23
|
-
import { a as a$3 } from '../../chunk-
|
|
23
|
+
import { a as a$3 } from '../../chunk-3HJISSG2.js';
|
|
24
24
|
import { a } from '../../chunk-YSQ5AYHV.js';
|
|
25
25
|
import '../../chunk-TPOL2YXC.js';
|
|
26
26
|
import '../../chunk-IAOMC4C4.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { r as ContentType, s as FileContentType, k as FileThumbnail, a as HelperText, b as MultiFilePreview, u as MultipleFileUpload, v as MultipleImageUpload, c as SingleFilePreview, w as SingleFileUpload, x as SingleImageUpload, y as UploadAvatar, z as UploadSimpleBox, n as compressImageWithoutCrop, m as convertToWebP, p as encodeFilenameForHeader, f as fileFormat, d as fileFormatByMimeType, e as fileFormatByName, i as fileNameByUrl, g as fileThumb, j as fileThumbnailClasses, h as fileTypeByUrl, o as getFileNameFromContentDisposition, l as isImageFile, q as useDropzoneUploader, t as useFileUploadService } from '../../chunk-
|
|
1
|
+
export { r as ContentType, s as FileContentType, k as FileThumbnail, a as HelperText, b as MultiFilePreview, u as MultipleFileUpload, v as MultipleImageUpload, c as SingleFilePreview, w as SingleFileUpload, x as SingleImageUpload, y as UploadAvatar, z as UploadSimpleBox, n as compressImageWithoutCrop, m as convertToWebP, p as encodeFilenameForHeader, f as fileFormat, d as fileFormatByMimeType, e as fileFormatByName, i as fileNameByUrl, g as fileThumb, j as fileThumbnailClasses, h as fileTypeByUrl, o as getFileNameFromContentDisposition, l as isImageFile, q as useDropzoneUploader, t as useFileUploadService } from '../../chunk-Q64RVUSF.js';
|
|
2
2
|
import '../../chunk-Q2D3PURH.js';
|
|
3
3
|
import '../../chunk-2QOUWCI5.js';
|
|
4
4
|
import '../../chunk-KGLU4CR2.js';
|
|
@@ -4,7 +4,7 @@ import { c } from '../../chunk-VGTQYKAC.js';
|
|
|
4
4
|
import { a } from '../../chunk-CO2KQFUN.js';
|
|
5
5
|
import { a as a$5 } from '../../chunk-F65ZXAGV.js';
|
|
6
6
|
import { a as a$7 } from '../../chunk-GWHI4DH5.js';
|
|
7
|
-
import { a as a$4 } from '../../chunk-
|
|
7
|
+
import { a as a$4 } from '../../chunk-3HJISSG2.js';
|
|
8
8
|
import { a as a$6 } from '../../chunk-YSQ5AYHV.js';
|
|
9
9
|
import '../../chunk-TPOL2YXC.js';
|
|
10
10
|
import { a as a$8 } from '../../chunk-LQRRMVFN.js';
|
|
@@ -2,8 +2,8 @@ import { a as a$3 } from '../../../chunk-MSCOIJQ5.js';
|
|
|
2
2
|
import { a } from '../../../chunk-X64QHBVQ.js';
|
|
3
3
|
import { a as a$1 } from '../../../chunk-YXRL4O4H.js';
|
|
4
4
|
import '../../../chunk-RTC7H5E5.js';
|
|
5
|
-
import { a as a$2 } from '../../../chunk-
|
|
6
|
-
import '../../../chunk-
|
|
5
|
+
import { a as a$2 } from '../../../chunk-235M242H.js';
|
|
6
|
+
import '../../../chunk-3HJISSG2.js';
|
|
7
7
|
import '../../../chunk-YSQ5AYHV.js';
|
|
8
8
|
import '../../../chunk-TPOL2YXC.js';
|
|
9
9
|
import L from '@mui/material/CircularProgress';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { a as default } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-
|
|
1
|
+
export { a as default } from '../../../chunk-235M242H.js';
|
|
2
|
+
import '../../../chunk-3HJISSG2.js';
|
|
3
3
|
import '../../../chunk-YSQ5AYHV.js';
|
|
4
4
|
import '../../../chunk-TPOL2YXC.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as a$1 } from '../../../chunk-YXRL4O4H.js';
|
|
2
|
-
import { a as a$2 } from '../../../chunk-
|
|
2
|
+
import { a as a$2 } from '../../../chunk-235M242H.js';
|
|
3
3
|
import { a as a$3 } from '../../../chunk-GWHI4DH5.js';
|
|
4
|
-
import '../../../chunk-
|
|
4
|
+
import '../../../chunk-3HJISSG2.js';
|
|
5
5
|
import { a } from '../../../chunk-YSQ5AYHV.js';
|
|
6
6
|
import '../../../chunk-TPOL2YXC.js';
|
|
7
7
|
import { useCallback, useMemo } from 'react';
|
|
@@ -4,13 +4,13 @@ import * as react from 'react';
|
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
|
|
6
6
|
declare const useSnackbar: () => {
|
|
7
|
-
toast: ((message:
|
|
8
|
-
success: (message: string | number | boolean | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal |
|
|
9
|
-
info: (message: string | number | boolean | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal |
|
|
10
|
-
warning: (message: string | number | boolean | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal |
|
|
11
|
-
error: (message: string | number | boolean | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal |
|
|
7
|
+
toast: ((message: (() => ReactNode) | ReactNode, data?: ExternalToast | undefined) => string | number) & {
|
|
8
|
+
success: (message: string | number | boolean | (() => ReactNode) | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal | null | undefined, data?: ExternalToast | undefined) => string | number;
|
|
9
|
+
info: (message: string | number | boolean | (() => ReactNode) | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal | null | undefined, data?: ExternalToast | undefined) => string | number;
|
|
10
|
+
warning: (message: string | number | boolean | (() => ReactNode) | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal | null | undefined, data?: ExternalToast | undefined) => string | number;
|
|
11
|
+
error: (message: string | number | boolean | (() => ReactNode) | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal | null | undefined, data?: ExternalToast | undefined) => string | number;
|
|
12
12
|
custom: (jsx: (id: string | number) => react.ReactElement<any, string | react.JSXElementConstructor<any>>, data?: ExternalToast | undefined) => string | number;
|
|
13
|
-
message: (message: string | number | boolean | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal |
|
|
13
|
+
message: (message: string | number | boolean | (() => ReactNode) | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal | null | undefined, data?: ExternalToast | undefined) => string | number;
|
|
14
14
|
promise: <ToastData>(promise: Promise<ToastData> | (() => Promise<ToastData>), data?: ({
|
|
15
15
|
className?: string | undefined;
|
|
16
16
|
style?: react.CSSProperties | undefined;
|
|
@@ -45,7 +45,7 @@ declare const useSnackbar: () => {
|
|
|
45
45
|
unwrap: () => Promise<ToastData>;
|
|
46
46
|
};
|
|
47
47
|
dismiss: (id?: string | number | undefined) => string | number;
|
|
48
|
-
loading: (message: string | number | boolean | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal |
|
|
48
|
+
loading: (message: string | number | boolean | (() => ReactNode) | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal | null | undefined, data?: ExternalToast | undefined) => string | number;
|
|
49
49
|
} & {
|
|
50
50
|
getHistory: () => (sonner.ToastT | sonner.ToastToDismiss)[];
|
|
51
51
|
getToasts: () => (sonner.ToastT | sonner.ToastToDismiss)[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CustomShadows } from './index-
|
|
2
|
-
export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-
|
|
1
|
+
import { C as CustomShadows } from './index-c8f1e6e7.js';
|
|
2
|
+
export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-c8f1e6e7.js';
|
|
3
3
|
export { S as SettingsContextValue, _ as SettingsProvider, T as ThemeProviderProps, u as useSettingsContext } from './settings-provider-38d09283.js';
|
|
4
4
|
export { THEME_CONFIG, default as ThemeProvider } from './theme/theme-provider.js';
|
|
5
5
|
import { S as SettingsState } from './settings-583c107c.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from '../../index-
|
|
1
|
+
export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from '../../index-c8f1e6e7.js';
|
|
2
2
|
import '@mui/lab/TimelineConnector';
|
|
3
3
|
import '@mui/system';
|
|
4
4
|
import '@mui/lab/TimelineDot';
|
|
@@ -173,7 +173,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
173
173
|
float?: csstype.Property.Float | readonly NonNullable<csstype.Property.Float | undefined>[] | readonly csstype.Property.Float[] | undefined;
|
|
174
174
|
floodColor?: readonly string[] | csstype.Property.FloodColor | readonly csstype.Property.FloodColor[] | undefined;
|
|
175
175
|
floodOpacity?: readonly ((string & {}) | csstype.Globals)[] | csstype.Property.FloodOpacity | readonly NonNullable<csstype.Property.FloodOpacity | undefined>[] | undefined;
|
|
176
|
-
fontFamily?: csstype.Property.FontFamily | readonly
|
|
176
|
+
fontFamily?: readonly string[] | csstype.Property.FontFamily | readonly csstype.Property.FontFamily[] | undefined;
|
|
177
177
|
fontFeatureSettings?: readonly string[] | csstype.Property.FontFeatureSettings | readonly csstype.Property.FontFeatureSettings[] | undefined;
|
|
178
178
|
fontKerning?: csstype.Property.FontKerning | readonly NonNullable<csstype.Property.FontKerning | undefined>[] | readonly csstype.Property.FontKerning[] | undefined;
|
|
179
179
|
fontLanguageOverride?: readonly string[] | csstype.Property.FontLanguageOverride | readonly csstype.Property.FontLanguageOverride[] | undefined;
|
|
@@ -197,7 +197,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
197
197
|
fontVariantNumeric?: readonly string[] | csstype.Property.FontVariantNumeric | readonly csstype.Property.FontVariantNumeric[] | undefined;
|
|
198
198
|
fontVariantPosition?: csstype.Property.FontVariantPosition | readonly NonNullable<csstype.Property.FontVariantPosition | undefined>[] | readonly csstype.Property.FontVariantPosition[] | undefined;
|
|
199
199
|
fontVariationSettings?: readonly string[] | csstype.Property.FontVariationSettings | readonly csstype.Property.FontVariationSettings[] | undefined;
|
|
200
|
-
fontWeight?: csstype.Property.FontWeight | readonly NonNullable<csstype.Property.FontWeight | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
200
|
+
fontWeight?: csstype.Property.FontWeight | readonly NonNullable<csstype.Property.FontWeight | undefined>[] | readonly ("bold" | (string & {}) | csstype.Globals | "normal" | "bolder" | "lighter")[] | undefined;
|
|
201
201
|
fontWidth?: readonly string[] | csstype.Property.FontWidth | readonly csstype.Property.FontWidth[] | undefined;
|
|
202
202
|
forcedColorAdjust?: csstype.Property.ForcedColorAdjust | readonly NonNullable<csstype.Property.ForcedColorAdjust | undefined>[] | readonly csstype.Property.ForcedColorAdjust[] | undefined;
|
|
203
203
|
gridAutoColumns?: readonly (string | (string & {}))[] | csstype.Property.GridAutoColumns<string | number> | readonly NonNullable<csstype.Property.GridAutoColumns<string | number> | undefined>[] | undefined;
|
|
@@ -462,7 +462,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
462
462
|
zIndex?: readonly ((string & {}) | csstype.Globals | "auto")[] | csstype.Property.ZIndex | readonly NonNullable<csstype.Property.ZIndex | undefined>[] | undefined;
|
|
463
463
|
zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reset")[] | undefined;
|
|
464
464
|
all?: csstype.Globals | readonly NonNullable<csstype.Globals | undefined>[] | readonly csstype.Globals[] | undefined;
|
|
465
|
-
animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
465
|
+
animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
|
|
466
466
|
animationRange?: readonly (string | (string & {}))[] | csstype.Property.AnimationRange<string | number> | readonly NonNullable<csstype.Property.AnimationRange<string | number> | undefined>[] | undefined;
|
|
467
467
|
background?: readonly (string | (string & {}))[] | csstype.Property.Background<string | number> | readonly NonNullable<csstype.Property.Background<string | number> | undefined>[] | undefined;
|
|
468
468
|
border?: readonly (string | (string & {}))[] | csstype.Property.Border<string | number> | readonly NonNullable<csstype.Property.Border<string | number> | undefined>[] | undefined;
|
|
@@ -474,7 +474,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
474
474
|
borderBlockWidth?: readonly (string | (string & {}))[] | csstype.Property.BorderBlockWidth<string | number> | readonly NonNullable<csstype.Property.BorderBlockWidth<string | number> | undefined>[] | undefined;
|
|
475
475
|
borderBottom?: readonly (string | (string & {}))[] | csstype.Property.BorderBottom<string | number> | readonly NonNullable<csstype.Property.BorderBottom<string | number> | undefined>[] | undefined;
|
|
476
476
|
borderColor?: readonly string[] | csstype.Property.BorderColor | readonly csstype.Property.BorderColor[] | undefined;
|
|
477
|
-
borderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
477
|
+
borderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
|
|
478
478
|
borderInline?: readonly (string | (string & {}))[] | csstype.Property.BorderInline<string | number> | readonly NonNullable<csstype.Property.BorderInline<string | number> | undefined>[] | undefined;
|
|
479
479
|
borderInlineColor?: readonly string[] | csstype.Property.BorderInlineColor | readonly csstype.Property.BorderInlineColor[] | undefined;
|
|
480
480
|
borderInlineEnd?: readonly (string | (string & {}))[] | csstype.Property.BorderInlineEnd<string | number> | readonly NonNullable<csstype.Property.BorderInlineEnd<string | number> | undefined>[] | undefined;
|
|
@@ -509,7 +509,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
509
509
|
marginBlock?: readonly (string | (string & {}))[] | csstype.Property.MarginBlock<string | number> | readonly NonNullable<csstype.Property.MarginBlock<string | number> | undefined>[] | undefined;
|
|
510
510
|
marginInline?: readonly (string | (string & {}))[] | csstype.Property.MarginInline<string | number> | readonly NonNullable<csstype.Property.MarginInline<string | number> | undefined>[] | undefined;
|
|
511
511
|
mask?: readonly (string | (string & {}))[] | csstype.Property.Mask<string | number> | readonly NonNullable<csstype.Property.Mask<string | number> | undefined>[] | undefined;
|
|
512
|
-
maskBorder?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
512
|
+
maskBorder?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
|
|
513
513
|
motion?: readonly (string | (string & {}))[] | csstype.Property.Offset<string | number> | readonly NonNullable<csstype.Property.Offset<string | number> | undefined>[] | undefined;
|
|
514
514
|
offset?: readonly (string | (string & {}))[] | csstype.Property.Offset<string | number> | readonly NonNullable<csstype.Property.Offset<string | number> | undefined>[] | undefined;
|
|
515
515
|
outline?: readonly (string | (string & {}))[] | csstype.Property.Outline<string | number> | readonly NonNullable<csstype.Property.Outline<string | number> | undefined>[] | undefined;
|
|
@@ -758,8 +758,8 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
758
758
|
WebkitUserModify?: csstype.Property.WebkitUserModify | readonly NonNullable<csstype.Property.WebkitUserModify | undefined>[] | readonly csstype.Property.WebkitUserModify[] | undefined;
|
|
759
759
|
WebkitUserSelect?: csstype.Property.WebkitUserSelect | readonly NonNullable<csstype.Property.WebkitUserSelect | undefined>[] | readonly csstype.Property.WebkitUserSelect[] | undefined;
|
|
760
760
|
WebkitWritingMode?: csstype.Property.WritingMode | readonly NonNullable<csstype.Property.WritingMode | undefined>[] | readonly csstype.Property.WritingMode[] | undefined;
|
|
761
|
-
MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
762
|
-
MozBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
761
|
+
MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
|
|
762
|
+
MozBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
|
|
763
763
|
MozColumnRule?: readonly (string | (string & {}))[] | csstype.Property.ColumnRule<string | number> | readonly NonNullable<csstype.Property.ColumnRule<string | number> | undefined>[] | undefined;
|
|
764
764
|
MozColumns?: readonly (string | (string & {}))[] | csstype.Property.Columns<string | number> | readonly NonNullable<csstype.Property.Columns<string | number> | undefined>[] | undefined;
|
|
765
765
|
MozOutlineRadius?: readonly (string | (string & {}))[] | csstype.Property.MozOutlineRadius<string | number> | readonly NonNullable<csstype.Property.MozOutlineRadius<string | number> | undefined>[] | undefined;
|
|
@@ -771,16 +771,16 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
771
771
|
msScrollSnapX?: readonly string[] | csstype.Property.MsScrollSnapX | readonly csstype.Property.MsScrollSnapX[] | undefined;
|
|
772
772
|
msScrollSnapY?: readonly string[] | csstype.Property.MsScrollSnapY | readonly csstype.Property.MsScrollSnapY[] | undefined;
|
|
773
773
|
msTransition?: readonly string[] | csstype.Property.Transition<string & {}> | readonly csstype.Property.Transition<string & {}>[] | undefined;
|
|
774
|
-
WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
774
|
+
WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
|
|
775
775
|
WebkitBorderBefore?: readonly (string | (string & {}))[] | csstype.Property.WebkitBorderBefore<string | number> | readonly NonNullable<csstype.Property.WebkitBorderBefore<string | number> | undefined>[] | undefined;
|
|
776
|
-
WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
776
|
+
WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
|
|
777
777
|
WebkitBorderRadius?: readonly (string | (string & {}))[] | csstype.Property.BorderRadius<string | number> | readonly NonNullable<csstype.Property.BorderRadius<string | number> | undefined>[] | undefined;
|
|
778
778
|
WebkitColumnRule?: readonly (string | (string & {}))[] | csstype.Property.ColumnRule<string | number> | readonly NonNullable<csstype.Property.ColumnRule<string | number> | undefined>[] | undefined;
|
|
779
779
|
WebkitColumns?: readonly (string | (string & {}))[] | csstype.Property.Columns<string | number> | readonly NonNullable<csstype.Property.Columns<string | number> | undefined>[] | undefined;
|
|
780
780
|
WebkitFlex?: readonly (string | (string & {}))[] | csstype.Property.Flex<string | number> | readonly NonNullable<csstype.Property.Flex<string | number> | undefined>[] | undefined;
|
|
781
781
|
WebkitFlexFlow?: readonly string[] | csstype.Property.FlexFlow | readonly csstype.Property.FlexFlow[] | undefined;
|
|
782
782
|
WebkitMask?: readonly (string | (string & {}))[] | csstype.Property.WebkitMask<string | number> | readonly NonNullable<csstype.Property.WebkitMask<string | number> | undefined>[] | undefined;
|
|
783
|
-
WebkitMaskBoxImage?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
783
|
+
WebkitMaskBoxImage?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
|
|
784
784
|
WebkitTextEmphasis?: readonly string[] | csstype.Property.TextEmphasis | readonly csstype.Property.TextEmphasis[] | undefined;
|
|
785
785
|
WebkitTextStroke?: readonly (string | (string & {}))[] | csstype.Property.WebkitTextStroke<string | number> | readonly NonNullable<csstype.Property.WebkitTextStroke<string | number> | undefined>[] | undefined;
|
|
786
786
|
WebkitTransition?: readonly string[] | csstype.Property.Transition<string & {}> | readonly csstype.Property.Transition<string & {}>[] | undefined;
|
|
@@ -861,7 +861,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
861
861
|
MozUserFocus?: csstype.Property.MozUserFocus | readonly NonNullable<csstype.Property.MozUserFocus | undefined>[] | readonly csstype.Property.MozUserFocus[] | undefined;
|
|
862
862
|
MozUserInput?: csstype.Property.MozUserInput | readonly NonNullable<csstype.Property.MozUserInput | undefined>[] | readonly csstype.Property.MozUserInput[] | undefined;
|
|
863
863
|
msImeMode?: csstype.Property.ImeMode | readonly NonNullable<csstype.Property.ImeMode | undefined>[] | readonly csstype.Property.ImeMode[] | undefined;
|
|
864
|
-
OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
864
|
+
OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
|
|
865
865
|
OAnimationDelay?: readonly string[] | csstype.Property.AnimationDelay<string & {}> | readonly csstype.Property.AnimationDelay<string & {}>[] | undefined;
|
|
866
866
|
OAnimationDirection?: readonly string[] | csstype.Property.AnimationDirection | readonly csstype.Property.AnimationDirection[] | undefined;
|
|
867
867
|
OAnimationDuration?: readonly string[] | csstype.Property.AnimationDuration<string & {}> | readonly csstype.Property.AnimationDuration<string & {}>[] | undefined;
|
|
@@ -871,7 +871,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
871
871
|
OAnimationPlayState?: readonly string[] | csstype.Property.AnimationPlayState | readonly csstype.Property.AnimationPlayState[] | undefined;
|
|
872
872
|
OAnimationTimingFunction?: readonly string[] | csstype.Property.AnimationTimingFunction | readonly csstype.Property.AnimationTimingFunction[] | undefined;
|
|
873
873
|
OBackgroundSize?: readonly (string | (string & {}))[] | csstype.Property.BackgroundSize<string | number> | readonly NonNullable<csstype.Property.BackgroundSize<string | number> | undefined>[] | undefined;
|
|
874
|
-
OBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
874
|
+
OBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
|
|
875
875
|
OObjectFit?: csstype.Property.ObjectFit | readonly NonNullable<csstype.Property.ObjectFit | undefined>[] | readonly csstype.Property.ObjectFit[] | undefined;
|
|
876
876
|
OObjectPosition?: readonly (string | (string & {}))[] | csstype.Property.ObjectPosition<string | number> | readonly NonNullable<csstype.Property.ObjectPosition<string | number> | undefined>[] | undefined;
|
|
877
877
|
OTabSize?: readonly (string | (string & {}))[] | csstype.Property.TabSize<string | number> | readonly NonNullable<csstype.Property.TabSize<string | number> | undefined>[] | undefined;
|