@zydon/common 2.9.15 → 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/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/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/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-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,8 +1,8 @@
|
|
|
1
|
-
import { a } from './chunk-
|
|
1
|
+
import { a } from './chunk-3HJISSG2.js';
|
|
2
2
|
import { useFormContext, Controller } from 'react-hook-form';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
var A=({name:t,helperText:u,rules:m,onSelectOption:r,InputLabelProps:p,onBlur:n,...c})=>{let{control:i}=useFormContext(),C=o=>e=>{r&&r(e,o.value),o.onChange(e);};return jsx(Controller,{name:t,control:i,rules:m,render:({field:{ref:o,...e},fieldState:{error:l}})=>{let g=d=>{e.onBlur(),n&&n(d);};return jsx(a,{"data-intercom-target":t,...e,...c,inputRef:o,onChange:C(e),onBlur:g,error:!!l,helperText:l?.message||u,InputLabelProps:p})}})},B=A;
|
|
6
6
|
|
|
7
7
|
export { B as a };
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-235M242H.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { a } from './chunk-YSQ5AYHV.js';
|
|
2
|
+
import { memo, createContext, forwardRef, useContext, useMemo, useCallback, useRef, useEffect } from 'react';
|
|
3
|
+
import De, { autocompleteClasses } from '@mui/material/Autocomplete';
|
|
4
|
+
import Ae from '@mui/material/CircularProgress';
|
|
5
|
+
import ge from '@mui/material/TextField';
|
|
6
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
import { VariableSizeList } from 'react-window';
|
|
8
|
+
import { useTheme, styled } from '@mui/material/styles';
|
|
9
|
+
import Ee from '@mui/material/useMediaQuery';
|
|
10
|
+
import xe from '@mui/material/ListSubheader';
|
|
11
|
+
import he from '@mui/material/Stack';
|
|
12
|
+
import F from '@mui/material/Typography';
|
|
13
|
+
import ke from '@mui/material/Popper';
|
|
14
|
+
|
|
15
|
+
var V=memo(({params:e,name:t,placeholder:p,error:i,helperText:u,label:l,required:L,multiple:a$1,formattedValue:o,loading:c,tabIndex:m,InputLabelProps:y,inputRef:g})=>jsx(ge,{...e,name:t,placeholder:p,fullWidth:!0,error:!!i,helperText:u,label:l,required:L,inputRef:g,InputProps:{...e.InputProps,...!a$1&&{startAdornment:o&&!Array.isArray(o)&&o.icon?jsx(a,{icon:o.icon}):void 0},endAdornment:jsxs(Fragment,{children:[c?jsx(Ae,{color:"primary",size:20}):null,e.InputProps.endAdornment]})},inputProps:{...e.inputProps,name:t,tabIndex:m},InputLabelProps:y}));V.displayName="AutocompleteInput";var $=V;var w=8,U=memo(e=>{let{data:t,index:p,style:i}=e,u=t[p],l={...i,top:i.top+w,paddingTop:8};if(Object.prototype.hasOwnProperty.call(u,"group")){let y=u;return jsx(xe,{component:"div",style:l,children:y.group},`list-box-item-group-${y.group}`)}let[L,a$1]=u,{showValueInLabel:o,key:c,...m}=L;return jsx(F,{component:"li",...m,noWrap:!0,style:l,children:jsxs(he,{component:"div",direction:"row",flex:1,gap:1,justifyContent:"start",children:[a$1.icon&&jsx(a,{icon:a$1.icon}),a$1.label,o&&jsxs(F,{variant:"inherit",color:"grey.400",children:["(",a$1.value,")"]})]})},`list-box-item-${c}`)});U.displayName="ListboxRow";var W=U;var Se=createContext(void 0),O=Se;var K=createContext({}),Y=forwardRef((e,t)=>{let p=useContext(K);return jsx("div",{ref:t,...e,...p})});Y.displayName="OuterElementType";var Me=e=>{let t=useRef(null);return useEffect(()=>{t.current!=null&&t.current.resetAfterIndex(0,!0);},[e]),t},we=forwardRef(function(t,p){let{children:i,...u}=t,l=useMemo(()=>{let r=[];return i.forEach(b=>{r.push(b),Object.prototype.hasOwnProperty.call(b,"children")&&Array.isArray(b.children)&&r.push(...b.children);}),r},[i]),L=useTheme(),a=Ee(L.breakpoints.up("sm")),o=l.length,c=a?36:48,m=useCallback(r=>Object.prototype.hasOwnProperty.call(r,"group")?48:c,[c]),y=useMemo(()=>o>8?8*c:l.map(m).reduce((r,b)=>r+b,0),[o,c,l,m]),g=Me(o),P=useContext(O),d=useRef(!1);useEffect(()=>{d.current=!1;},[o]);let R=useCallback(({visibleStopIndex:r})=>{P&&!d.current&&r>=o-3&&(d.current=!0,P());},[P,o]);return jsx("div",{ref:p,children:jsx(K.Provider,{value:u,children:jsx(VariableSizeList,{itemData:l,height:y+2*w,width:"100%",ref:g,outerElementType:Y,innerElementType:"ul",itemSize:r=>m(l[r]),overscanCount:5,itemCount:o,onItemsRendered:R,children:W})})})}),Z=we;var ee=styled(ke)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}});var Ve=e=>e&&typeof e=="object"?e.value.toString():e.toString(),$e=e=>e,Fe=(e,t)=>{let p=t.inputValue.toLocaleUpperCase();return e.filter(i=>`${i.value} ${i.label}`.toLocaleUpperCase().includes(p))},re=memo(forwardRef(({name:e,label:t,value:p,options:i=[],loading:u,noOptionsText:l="Nenhum resultado encontrado.",loadingText:L="Carregando op\xE7\xF5es...",error:a,helperText:o,placeholder:c,onChange:m,groupBy:y,showValueInLabel:g,disabled:P,multiple:d,required:R,renderOption:r,tabIndex:b,onInputChange:C,onSearch:A,onBlur:v,onScrollEnd:ne,InputLabelProps:k,inputRef:G,filterOptions:ie,...se},pe)=>{let N=useRef(null),z=useRef(null),T=useMemo(()=>{if(d)return (Array.isArray(p)?p:[]).reduce((x,be)=>{let D=i.find(ye=>ye.value.toString()===be.toString());return D?[...x,D]:[...x]},[]);let s=i.find(f=>f.value.toString()===p?.toString())||null,n=z.current;return n&&s&&n.value===s.value&&n.label===s.label?n:(z.current=s,s)},[i,p,d]),ue=ie??(N.current==="reset"?void 0:Fe),le=useCallback((s,n,f)=>{if(N.current=f,C&&C(s,n,f),f==="input"){A&&A(n);return}f==="reset"&&A&&A(void 0),f==="clear"&&A&&A("");},[C,A]),me=useCallback((s,n)=>{if(!n){m(d?[]:null);return}if(Array.isArray(n)){m(n.map(Ve));return}m(typeof n=="string"?n.toString():n.value.toString());},[m,d]),ae=useCallback(s=>{v&&v(s);},[v]),ce=useCallback((s,n,f,x)=>r?r(s,n,f,x):[{...s,showValueInLabel:g},n],[r,g]),de=useMemo(()=>r?void 0:Z,[r]),fe=useCallback(s=>jsx($,{params:s,name:e,placeholder:c,error:a,helperText:o,label:t,required:R,multiple:d,formattedValue:T,loading:u,tabIndex:b,InputLabelProps:k,inputRef:G}),[e,c,a,o,t,R,d,T,u,b,k,G]);return jsx(O.Provider,{value:ne,children:jsx(De,{ref:pe,value:T,onInputChange:le,options:i,loading:u,noOptionsText:l,loadingText:L,disabled:P,disableListWrap:!0,PopperComponent:ee,ListboxComponent:de,filterOptions:ue,onChange:me,onBlur:ae,renderOption:ce,renderGroup:$e,groupBy:y,multiple:d,renderInput:fe,...se})})}));re.displayName="Autocomplete";var Tt=re;
|
|
16
|
+
|
|
17
|
+
export { Tt as a };
|
|
18
|
+
//# sourceMappingURL=chunk-3HJISSG2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Autocomplete/index.tsx","../src/components/Autocomplete/AutocompleteInput.tsx","../src/components/Autocomplete/Listbox.tsx","../src/components/Autocomplete/ListboxRow.tsx","../src/components/Autocomplete/ScrollEndContext.ts","../src/components/Autocomplete/styles.ts"],"names":["forwardRef","memo","useCallback","useMemo","useRef","MuiAutocomplete","CircularProgress","TextField","Fragment","jsx","jsxs","AutocompleteInput","params","name","placeholder","error","helperText","label","required","multiple","formattedValue","loading","tabIndex","InputLabelProps","inputRef","Icon_default","AutocompleteInput_default","createContext","useContext","useEffect","VariableSizeList","useTheme","useMediaQuery","ListSubheader","Stack","Typography","LISTBOX_PADDING","ListboxRow","props","data","index","style","dataSet","inlineStyle","groupItem","itemProps","option","showValueInLabel","key","otherItemProps","ListboxRow_default","ScrollEndContext","ScrollEndContext_default","OuterElementContext","OuterElementType","ref","outerProps","useResetCache","ListboxComponent","children","other","itemData","item","theme","smUp","itemCount","itemSize","getChildSize","child","itemsHeight","a","gridRef","onScrollEnd","firedRef","handleItemsRendered","visibleStopIndex","Listbox_default","autocompleteClasses","Popper","styled","StyledPopper","getOptionValue","optionValue","renderGroup","defaultFilterOptions","optionsFilter","state","searchValue","opt","Autocomplete","value","options","noOptionsText","loadingText","onChange","groupBy","disabled","renderOption","onInputChange","onSearch","onBlur","filterOptionsProp","inputReasonRef","lastSingleValueRef","acc","curr","previous","resolvedFilterOptions","handleInputChange","event","eventValue","reason","handleChange","_","handleBlur","memoizedRenderOption","ownerState","renderListbox","memoizedRenderInput","Autocomplete_default"],"mappings":"wCAAA,OACE,cAAAA,GACA,QAAAC,GAEA,eAAAC,EACA,WAAAC,GACA,UAAAC,OACK,QACP,OAAOC,OAKA,6BCbP,OAA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G,GACZ,GAAG1D,GACN,EACF,CAEJ,CACF,CACF,EAEA6B,GAAa,YAAc,eAE3B,IAAO8B,GAAQ9B","sourcesContent":["import {\n forwardRef,\n memo,\n ReactNode,\n useCallback,\n useMemo,\n useRef,\n} from 'react';\nimport MuiAutocomplete, {\n AutocompleteOwnerState,\n AutocompleteRenderGroupParams,\n AutocompleteRenderInputParams,\n AutocompleteRenderOptionState,\n} from '@mui/material/Autocomplete';\n\nimport { AutocompleteProps } from 'types/autoCompleteProps';\nimport { Option } from 'types/option';\n\nimport AutocompleteInput from './AutocompleteInput';\nimport ListboxComponent from './Listbox';\nimport ScrollEndContext from './ScrollEndContext';\nimport { StyledPopper } from './styles';\n\nconst getOptionValue = (optionValue: Option | string | number): string =>\n optionValue && typeof optionValue === 'object'\n ? optionValue.value.toString()\n : optionValue.toString();\n\nconst renderGroup = (params: AutocompleteRenderGroupParams) =>\n params as unknown as ReactNode;\n\nconst defaultFilterOptions = (\n optionsFilter: Option[],\n state: { inputValue: string },\n) => {\n const searchValue = state.inputValue.toLocaleUpperCase();\n return optionsFilter.filter(opt => {\n const search = `${opt.value} ${opt.label}`;\n\n return search.toLocaleUpperCase().includes(searchValue);\n });\n};\n\nconst Autocomplete = memo(\n forwardRef<unknown, AutocompleteProps>(\n (\n {\n name,\n label,\n value,\n options = [],\n loading,\n noOptionsText = 'Nenhum resultado encontrado.',\n loadingText = 'Carregando opções...',\n error,\n helperText,\n placeholder,\n onChange,\n groupBy,\n showValueInLabel,\n disabled,\n multiple,\n required,\n renderOption,\n tabIndex,\n onInputChange,\n onSearch,\n onBlur,\n onScrollEnd,\n InputLabelProps,\n inputRef,\n filterOptions: filterOptionsProp,\n ...other\n },\n ref,\n ) => {\n const inputReasonRef = useRef<'input' | 'reset' | 'clear' | null>(null);\n\n const lastSingleValueRef = useRef<Option | null>(null);\n\n const formattedValue = useMemo(() => {\n if (multiple) {\n const values = Array.isArray(value) ? value : [];\n\n return values.reduce<Option[]>((acc, curr) => {\n const item = options.find(\n opt => opt.value.toString() === curr.toString(),\n );\n\n if (item) return [...acc, item];\n\n return [...acc];\n }, []);\n }\n\n const item =\n options.find(opt => opt.value.toString() === value?.toString()) ||\n null;\n\n const previous = lastSingleValueRef.current;\n if (\n previous &&\n item &&\n previous.value === item.value &&\n previous.label === item.label\n ) {\n return previous;\n }\n\n lastSingleValueRef.current = item;\n return item;\n }, [options, value, multiple]);\n\n const resolvedFilterOptions =\n filterOptionsProp ??\n (inputReasonRef.current === 'reset' ? undefined : defaultFilterOptions);\n\n const handleInputChange = useCallback(\n (\n event: React.SyntheticEvent,\n eventValue: string,\n reason: 'input' | 'reset' | 'clear',\n ) => {\n inputReasonRef.current = reason;\n if (onInputChange) onInputChange(event, eventValue, reason);\n\n if (reason === 'input') {\n if (onSearch) onSearch(eventValue);\n return;\n }\n\n if (reason === 'reset') {\n if (onSearch) onSearch(undefined);\n }\n\n if (reason === 'clear') {\n if (onSearch) onSearch('');\n }\n },\n [onInputChange, onSearch],\n );\n\n const handleChange = useCallback(\n (\n _: React.SyntheticEvent,\n option: Option | (string | Option)[] | string | null,\n ) => {\n if (!option) {\n onChange(multiple ? [] : null);\n return;\n }\n\n if (Array.isArray(option)) {\n onChange(option.map(getOptionValue));\n return;\n }\n\n onChange(\n typeof option === 'string'\n ? option.toString()\n : option.value.toString(),\n );\n },\n [onChange, multiple],\n );\n\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n if (onBlur) onBlur(event);\n },\n [onBlur],\n );\n\n const memoizedRenderOption = useCallback(\n (\n props: React.HTMLAttributes<HTMLLIElement> & { key: string },\n option: Option,\n state: AutocompleteRenderOptionState,\n ownerState: AutocompleteOwnerState<Option, boolean, boolean, boolean>,\n ) =>\n renderOption\n ? renderOption(props, option, state, ownerState)\n : ([{ ...props, showValueInLabel }, option] as ReactNode),\n [renderOption, showValueInLabel],\n );\n\n const renderListbox = useMemo(\n () => (renderOption ? undefined : ListboxComponent),\n [renderOption],\n );\n\n const memoizedRenderInput = useCallback(\n (params: AutocompleteRenderInputParams) => (\n <AutocompleteInput\n params={params}\n name={name}\n placeholder={placeholder}\n error={error}\n helperText={helperText}\n label={label}\n required={required}\n multiple={multiple}\n formattedValue={formattedValue}\n loading={loading}\n tabIndex={tabIndex}\n InputLabelProps={InputLabelProps}\n inputRef={inputRef}\n />\n ),\n [\n name,\n placeholder,\n error,\n helperText,\n label,\n required,\n multiple,\n formattedValue,\n loading,\n tabIndex,\n InputLabelProps,\n inputRef,\n ],\n );\n\n return (\n <ScrollEndContext.Provider value={onScrollEnd}>\n <MuiAutocomplete\n ref={ref}\n value={formattedValue}\n onInputChange={handleInputChange}\n options={options}\n loading={loading}\n noOptionsText={noOptionsText}\n loadingText={loadingText}\n disabled={disabled}\n disableListWrap\n PopperComponent={StyledPopper}\n ListboxComponent={renderListbox}\n filterOptions={resolvedFilterOptions}\n onChange={handleChange}\n onBlur={handleBlur}\n renderOption={memoizedRenderOption}\n renderGroup={renderGroup}\n groupBy={groupBy}\n multiple={multiple}\n renderInput={memoizedRenderInput}\n {...other}\n />\n </ScrollEndContext.Provider>\n );\n },\n ),\n);\n\nAutocomplete.displayName = 'Autocomplete';\n\nexport default Autocomplete;\n","import { memo } from 'react';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport TextField from '@mui/material/TextField';\n\nimport Icon from '../Icon';\n\nimport { AutocompleteInputProps } from './props';\n\nconst AutocompleteInput = memo(\n ({\n params,\n name,\n placeholder,\n error,\n helperText,\n label,\n required,\n multiple,\n formattedValue,\n loading,\n tabIndex,\n InputLabelProps,\n inputRef,\n }: AutocompleteInputProps) => (\n <TextField\n {...params}\n name={name}\n placeholder={placeholder}\n fullWidth\n error={!!error}\n helperText={helperText}\n label={label}\n required={required}\n inputRef={inputRef}\n InputProps={{\n ...params.InputProps,\n ...(!multiple && {\n startAdornment:\n formattedValue &&\n !Array.isArray(formattedValue) &&\n formattedValue.icon ? (\n <Icon icon={formattedValue.icon} />\n ) : undefined,\n }),\n endAdornment: (\n <>\n {loading ? <CircularProgress color=\"primary\" size={20} /> : null}\n {params.InputProps.endAdornment}\n </>\n ),\n }}\n inputProps={{\n ...params.inputProps,\n name,\n tabIndex,\n }}\n InputLabelProps={InputLabelProps}\n />\n ),\n);\n\nAutocompleteInput.displayName = 'AutocompleteInput';\n\nexport default AutocompleteInput;\n","import {\n createContext,\n forwardRef,\n HTMLAttributes,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport { ListOnItemsRenderedProps, VariableSizeList } from 'react-window';\nimport { AutocompleteRenderGroupParams } from '@mui/material/Autocomplete';\nimport { useTheme } from '@mui/material/styles';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport ListboxRow, { LISTBOX_PADDING } from './ListboxRow';\nimport type { ListboxItem } from './props';\nimport ScrollEndContext from './ScrollEndContext';\n\nconst OuterElementContext = createContext({});\n\nconst OuterElementType = forwardRef<HTMLDivElement>((props, ref) => {\n const outerProps = useContext(OuterElementContext);\n return <div ref={ref} {...props} {...outerProps} />;\n});\n\nOuterElementType.displayName = 'OuterElementType';\n\nconst useResetCache = (data: number) => {\n const ref = useRef<VariableSizeList>(null);\n\n useEffect(() => {\n if (ref.current != null) {\n ref.current.resetAfterIndex(0, true);\n }\n }, [data]);\n\n return ref;\n};\n\nconst ListboxComponent = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLElement>\n>(function ListboxComponent(props, ref) {\n const { children, ...other } = props;\n\n const itemData: ListboxItem[] = useMemo(() => {\n const data: ListboxItem[] = [];\n (children as ListboxItem[]).forEach(item => {\n data.push(item);\n if (\n Object.prototype.hasOwnProperty.call(item, 'children') &&\n Array.isArray((item as AutocompleteRenderGroupParams).children)\n ) {\n data.push(\n ...((item as AutocompleteRenderGroupParams)\n .children as ListboxItem[]),\n );\n }\n });\n return data;\n }, [children]);\n\n const theme = useTheme();\n const smUp = useMediaQuery(theme.breakpoints.up('sm'));\n const itemCount = itemData.length;\n const itemSize = smUp ? 36 : 48;\n\n const getChildSize = useCallback(\n (child: ListboxItem) => {\n if (Object.prototype.hasOwnProperty.call(child, 'group')) {\n return 48;\n }\n\n return itemSize;\n },\n [itemSize],\n );\n\n const itemsHeight = useMemo(() => {\n if (itemCount > 8) {\n return 8 * itemSize;\n }\n return itemData.map(getChildSize).reduce((a, b) => a + b, 0);\n }, [itemCount, itemSize, itemData, getChildSize]);\n\n const gridRef = useResetCache(itemCount);\n const onScrollEnd = useContext(ScrollEndContext);\n const firedRef = useRef(false);\n\n useEffect(() => {\n firedRef.current = false;\n }, [itemCount]);\n\n const handleItemsRendered = useCallback(\n ({ visibleStopIndex }: ListOnItemsRenderedProps) => {\n if (\n onScrollEnd &&\n !firedRef.current &&\n visibleStopIndex >= itemCount - 3\n ) {\n firedRef.current = true;\n onScrollEnd();\n }\n },\n [onScrollEnd, itemCount],\n );\n\n return (\n <div ref={ref}>\n <OuterElementContext.Provider value={other}>\n <VariableSizeList\n itemData={itemData}\n height={itemsHeight + 2 * LISTBOX_PADDING}\n width=\"100%\"\n ref={gridRef}\n outerElementType={OuterElementType}\n innerElementType=\"ul\"\n itemSize={index => getChildSize(itemData[index])}\n overscanCount={5}\n itemCount={itemCount}\n onItemsRendered={handleItemsRendered}\n >\n {ListboxRow}\n </VariableSizeList>\n </OuterElementContext.Provider>\n </div>\n );\n});\n\nexport default ListboxComponent;\n","import { HTMLAttributes, memo } from 'react';\nimport { ListChildComponentProps } from 'react-window';\nimport { AutocompleteRenderGroupParams } from '@mui/material/Autocomplete';\nimport ListSubheader from '@mui/material/ListSubheader';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport { Option } from 'types/option';\n\nimport Icon from '../Icon';\n\nimport type { IconName } from './props';\n\nconst LISTBOX_PADDING = 8;\n\nconst ListboxRow = memo((props: ListChildComponentProps) => {\n const { data, index, style } = props;\n const dataSet = data[index] as\n | AutocompleteRenderGroupParams\n | [HTMLAttributes<HTMLLIElement> & { showValueInLabel?: boolean }, Option];\n\n const inlineStyle = {\n ...style,\n top: (style.top as number) + LISTBOX_PADDING,\n paddingTop: 8,\n };\n\n if (Object.prototype.hasOwnProperty.call(dataSet, 'group')) {\n const groupItem = dataSet as AutocompleteRenderGroupParams;\n return (\n <ListSubheader\n key={`list-box-item-group-${groupItem.group}`}\n component=\"div\"\n style={inlineStyle}\n >\n {groupItem.group}\n </ListSubheader>\n );\n }\n\n const [itemProps, option] = dataSet as [\n HTMLAttributes<HTMLLIElement> & {\n showValueInLabel?: boolean;\n key: string;\n },\n Option,\n ];\n const { showValueInLabel, key, ...otherItemProps } = itemProps;\n\n return (\n <Typography\n component=\"li\"\n key={`list-box-item-${key}`}\n {...otherItemProps}\n noWrap\n style={inlineStyle}\n >\n <Stack\n component=\"div\"\n direction=\"row\"\n flex={1}\n gap={1}\n justifyContent=\"start\"\n >\n {option.icon && <Icon icon={option.icon as IconName} />}\n {option.label}\n\n {showValueInLabel && (\n <Typography variant=\"inherit\" color=\"grey.400\">\n ({option.value})\n </Typography>\n )}\n </Stack>\n </Typography>\n );\n});\n\nListboxRow.displayName = 'ListboxRow';\n\nexport { LISTBOX_PADDING };\nexport default ListboxRow;\n","import { createContext } from 'react';\n\nconst ScrollEndContext = createContext<(() => void) | undefined>(undefined);\n\nexport default ScrollEndContext;\n","import { autocompleteClasses } from '@mui/material/Autocomplete';\nimport Popper from '@mui/material/Popper';\nimport { styled } from '@mui/material/styles';\n\nexport const StyledPopper = styled(Popper)({\n [`& .${autocompleteClasses.listbox}`]: {\n boxSizing: 'border-box',\n '& ul': {\n padding: 0,\n margin: 0,\n },\n },\n});\n"]}
|
|
@@ -12,7 +12,7 @@ import { a as a$3 } from '../../chunk-4F2NKGF6.js';
|
|
|
12
12
|
import { c } from '../../chunk-VGTQYKAC.js';
|
|
13
13
|
import { a as a$6 } from '../../chunk-CO2KQFUN.js';
|
|
14
14
|
import '../../chunk-F65ZXAGV.js';
|
|
15
|
-
import { a as a$a } from '../../chunk-
|
|
15
|
+
import { a as a$a } from '../../chunk-3HJISSG2.js';
|
|
16
16
|
import { a as a$4 } from '../../chunk-YSQ5AYHV.js';
|
|
17
17
|
import '../../chunk-TPOL2YXC.js';
|
|
18
18
|
import { a as a$2 } from '../../chunk-E3R7W7GK.js';
|
|
@@ -5,12 +5,25 @@ import { Option } from '../../types/option.js';
|
|
|
5
5
|
import '../../types/icon.js';
|
|
6
6
|
|
|
7
7
|
type BulkEditColumnType = 'text' | 'number' | 'boolean' | 'entity';
|
|
8
|
+
interface BulkEditColumnAutocomplete {
|
|
9
|
+
options: Option[];
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
noOptionsText?: ReactNode;
|
|
12
|
+
onSearch?(value?: string): void;
|
|
13
|
+
onOpen?(): void;
|
|
14
|
+
onClose?(): void;
|
|
15
|
+
onScrollEnd?(): void;
|
|
16
|
+
filterOptions?(options: Option[]): Option[];
|
|
17
|
+
resolveOption?(value: string): Option | undefined;
|
|
18
|
+
}
|
|
8
19
|
interface BulkEditModalColumn<TItem extends Record<string, unknown>> {
|
|
9
20
|
field: keyof TItem;
|
|
10
21
|
headerName: string;
|
|
11
22
|
type: BulkEditColumnType;
|
|
12
23
|
readOnly?: boolean;
|
|
13
24
|
options?: Option[];
|
|
25
|
+
useAutocomplete?(): BulkEditColumnAutocomplete;
|
|
26
|
+
getSelectedOption?(item: TItem, value: string): Option | undefined;
|
|
14
27
|
}
|
|
15
28
|
interface BulkEditModalFieldChangeParams<TItem extends Record<string, unknown>> {
|
|
16
29
|
itemId: string;
|
|
@@ -49,6 +62,14 @@ interface HeaderProps {
|
|
|
49
62
|
total: number;
|
|
50
63
|
title: string | ReactNode;
|
|
51
64
|
}
|
|
65
|
+
interface DynamicEntityCellProps<TItem extends Record<string, unknown>> {
|
|
66
|
+
column: BulkEditModalColumn<TItem>;
|
|
67
|
+
item: TItem;
|
|
68
|
+
fieldPath: string;
|
|
69
|
+
entityValue: string;
|
|
70
|
+
disabled: boolean;
|
|
71
|
+
onSelectOption(newValue: unknown): void;
|
|
72
|
+
}
|
|
52
73
|
interface BulkEditGridCellProps<TItem extends Record<string, unknown>> {
|
|
53
74
|
column: BulkEditModalColumn<TItem>;
|
|
54
75
|
item: TItem;
|
|
@@ -63,4 +84,4 @@ interface BulkEditGridCellProps<TItem extends Record<string, unknown>> {
|
|
|
63
84
|
|
|
64
85
|
declare const BulkEditModal: <TItem extends Record<string, unknown>>(props: BulkEditModalProps<TItem>) => react_jsx_runtime.JSX.Element;
|
|
65
86
|
|
|
66
|
-
export { BulkEditColumnType, BulkEditGridCellProps, BulkEditModalColumn, BulkEditModalFieldChangeParams, BulkEditModalInnerProps, BulkEditModalProps, BulkEditToolbarProps, HeaderProps, BulkEditModal as default };
|
|
87
|
+
export { BulkEditColumnAutocomplete, BulkEditColumnType, BulkEditGridCellProps, BulkEditModalColumn, BulkEditModalFieldChangeParams, BulkEditModalInnerProps, BulkEditModalProps, BulkEditToolbarProps, DynamicEntityCellProps, HeaderProps, BulkEditModal as default };
|
|
@@ -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,W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C,2BAA0B,GAC1B,WAAU,GACV,2BAA0B,GAC1B,gBAAiBhB,GACjB,wBAAyBK,EACzB,gBAAiBJ,GACjB,eAAe,SACf,SAAUvB,EACV,UAAW,GACX,QAASU,EACT,MAAO,CACL,eAAgB6B,EAChB,GAAIxB,GAAoB,CACtB,QAASnB,EACX,CACF,EACA,UAAW,CACT,MAAO,CAAE,SAAUqB,CAAe,EAClC,QAAS,CACP,kBAAA1B,CACF,CACF,EACA,aAAcyB,EAChB,EACF,EACAnB,EAAChD,EAAA,CACC,UAAAgD,EAAC/C,GAAA,CAAY,UAAU,IACrB,UAAAC,EAACxB,GAAA,CAAW,UAAU,OAAO,QAAQ,QAAQ,MAAM,gBAAgB,2BAEnE,EACAwB,EAACxB,GAAA,CAAW,UAAU,OAAO,QAAQ,QAClC,SAAAyE,EACH,GACF,EACAjD,EAACyF,EAAA,CACC,MAAOxC,EACP,KAAMqB,EACN,YAAaT,EACb,aAAciB,GACd,oBAAqBE,GACvB,GACF,GACF,EACF,CAEJ,EAEMU,GACJC,GACG,CACH,GAAM,CAAE,MAAAnC,CAAM,EAAImC,EACZC,EAActH,GAA4B,CAC9C,cAAe,CAAE,MAAAkF,CAAM,CACzB,CAAC,EAGD,OAAAtF,GAAU,IAAM,CACd0H,EAAY,MAAM,CAAE,MAAApC,CAAM,CAAC,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","Lo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OAAQ,CAAE,EAAG,EAEjDyB,EAACN,EAAA,CACC,SAAAM,EAACL,EAAA,CACC,QAAS8F,GACT,KAAMd,EACN,SAAUmB,GAAO5B,EAAU4B,CAAY,EACvC,2BAA0B,GAC1B,WAAU,GACV,2BAA0B,GAC1B,gBAAiBf,EACjB,wBAAyBI,EACzB,gBAAiBH,GACjB,eAAe,SACf,SAAUvB,EACV,UAAW,GACX,QAASU,EACT,MAAO,CACL,eAAgB4B,EAChB,GAAIvB,GAAoB,CACtB,QAASnB,EACX,CACF,EACA,UAAW,CACT,MAAO,CAAE,SAAUqB,CAAe,EAClC,QAAS,CACP,kBAAA1B,CACF,CACF,EACA,aAAcyB,EAChB,EACF,EACAnB,EAACxD,GAAA,CACC,UAAAwD,EAACvD,GAAA,CAAY,UAAU,IACrB,UAAAC,EAACxB,GAAA,CAAW,UAAU,OAAO,QAAQ,QAAQ,MAAM,gBAAgB,2BAEnE,EACAwB,EAACxB,GAAA,CAAW,UAAU,OAAO,QAAQ,QAClC,SAAAiF,EACH,GACF,EACAzD,EAACgG,EAAA,CACC,MAAOvC,EACP,KAAMqB,EACN,YAAaT,EACb,aAAcgB,GACd,oBAAqBE,GACvB,GACF,GACF,EACF,CAEJ,EAEMU,GACJC,GACG,CACH,GAAM,CAAE,MAAAlC,CAAM,EAAIkC,EACZC,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';
|
|
@@ -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;
|
package/package.json
CHANGED
package/dist/chunk-SC6LFS3A.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-YSQ5AYHV.js';
|
|
2
|
-
import { memo, createContext, forwardRef, useContext, useMemo, useCallback, useRef, useEffect } from 'react';
|
|
3
|
-
import Ne, { autocompleteClasses } from '@mui/material/Autocomplete';
|
|
4
|
-
import be from '@mui/material/CircularProgress';
|
|
5
|
-
import ye from '@mui/material/TextField';
|
|
6
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
-
import { VariableSizeList } from 'react-window';
|
|
8
|
-
import { useTheme, styled } from '@mui/material/styles';
|
|
9
|
-
import Se from '@mui/material/useMediaQuery';
|
|
10
|
-
import Pe from '@mui/material/ListSubheader';
|
|
11
|
-
import Ie from '@mui/material/Stack';
|
|
12
|
-
import F from '@mui/material/Typography';
|
|
13
|
-
import Me from '@mui/material/Popper';
|
|
14
|
-
|
|
15
|
-
var D=memo(({params:e,name:t,placeholder:s,error:n,helperText:p,label:m,required:L,multiple:l,formattedValue:o,loading:a$1,tabIndex:u,InputLabelProps:y,inputRef:g})=>jsx(ye,{...e,name:t,placeholder:s,fullWidth:!0,error:!!n,helperText:p,label:m,required:L,inputRef:g,InputProps:{...e.InputProps,...!l&&{startAdornment:o&&!Array.isArray(o)&&o.icon?jsx(a,{icon:o.icon}):void 0},endAdornment:jsxs(Fragment,{children:[a$1?jsx(be,{color:"primary",size:20}):null,e.InputProps.endAdornment]})},inputProps:{...e.inputProps,name:t,tabIndex:u},InputLabelProps:y}));D.displayName="AutocompleteInput";var $=D;var w=8,B=memo(e=>{let{data:t,index:s,style:n}=e,p=t[s],m={...n,top:n.top+w,paddingTop:8};if(Object.prototype.hasOwnProperty.call(p,"group")){let y=p;return jsx(Pe,{component:"div",style:m,children:y.group},`list-box-item-group-${y.group}`)}let[L,l]=p,{showValueInLabel:o,key:a$1,...u}=L;return jsx(F,{component:"li",...u,noWrap:!0,style:m,children:jsxs(Ie,{component:"div",direction:"row",flex:1,gap:1,justifyContent:"start",children:[l.icon&&jsx(a,{icon:l.icon}),l.label,o&&jsxs(F,{variant:"inherit",color:"grey.400",children:["(",l.value,")"]})]})},`list-box-item-${a$1}`)});B.displayName="ListboxRow";var U=B;var Re=createContext(void 0),h=Re;var J=createContext({}),K=forwardRef((e,t)=>{let s=useContext(J);return jsx("div",{ref:t,...e,...s})});K.displayName="OuterElementType";var Te=e=>{let t=useRef(null);return useEffect(()=>{t.current!=null&&t.current.resetAfterIndex(0,!0);},[e]),t},ve=forwardRef(function(t,s){let{children:n,...p}=t,m=useMemo(()=>{let r=[];return n.forEach(b=>{r.push(b),Object.prototype.hasOwnProperty.call(b,"children")&&Array.isArray(b.children)&&r.push(...b.children);}),r},[n]),L=useTheme(),l=Se(L.breakpoints.up("sm")),o=m.length,a=l?36:48,u=useCallback(r=>Object.prototype.hasOwnProperty.call(r,"group")?48:a,[a]),y=useMemo(()=>o>8?8*a:m.map(u).reduce((r,b)=>r+b,0),[o,a,m,u]),g=Te(o),P=useContext(h),c=useRef(!1);useEffect(()=>{c.current=!1;},[o]);let x=useCallback(({visibleStopIndex:r})=>{P&&!c.current&&r>=o-3&&(c.current=!0,P());},[P,o]);return jsx("div",{ref:s,children:jsx(J.Provider,{value:p,children:jsx(VariableSizeList,{itemData:m,height:y+2*w,width:"100%",ref:g,outerElementType:K,innerElementType:"ul",itemSize:r=>u(m[r]),overscanCount:5,itemCount:o,onItemsRendered:x,children:U})})})}),Y=ve;var Z=styled(Me)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}});var ze=e=>e&&typeof e=="object"?e.value.toString():e.toString(),De=e=>e,$e=(e,t)=>{let s=t.inputValue.toLocaleUpperCase();return e.filter(n=>`${n.value} ${n.label}`.toLocaleUpperCase().includes(s))},te=memo(forwardRef(({name:e,label:t,value:s,options:n=[],loading:p,noOptionsText:m="Nenhum resultado encontrado.",loadingText:L="Carregando op\xE7\xF5es...",error:l,helperText:o,placeholder:a,onChange:u,groupBy:y,showValueInLabel:g,disabled:P,multiple:c,required:x,renderOption:r,tabIndex:b,onInputChange:C,onSearch:A,onBlur:S,onScrollEnd:oe,InputLabelProps:k,inputRef:G,filterOptions:re,...ne},ie)=>{let N=useRef(null),T=useMemo(()=>c?(Array.isArray(s)?s:[]).reduce((f,v)=>{let z=n.find(de=>de.value.toString()===v.toString());return z?[...f,z]:[...f]},[]):n.find(i=>i.value.toString()===s?.toString())||null,[n,s,c]),se=re??(N.current==="reset"?void 0:$e),pe=useCallback((d,i,f)=>{if(N.current=f,C&&C(d,i,f),f==="input"){A&&A(i);return}f==="reset"&&A&&A(void 0),f==="clear"&&A&&A("");},[C,A]),me=useCallback((d,i)=>{if(!i){u(c?[]:null);return}if(Array.isArray(i)){u(i.map(ze));return}u(typeof i=="string"?i.toString():i.value.toString());},[u,c]),ue=useCallback(d=>{S&&S(d);},[S]),le=useCallback((d,i,f,v)=>r?r(d,i,f,v):[{...d,showValueInLabel:g},i],[r,g]),ae=useMemo(()=>r?void 0:Y,[r]),ce=useCallback(d=>jsx($,{params:d,name:e,placeholder:a,error:l,helperText:o,label:t,required:x,multiple:c,formattedValue:T,loading:p,tabIndex:b,InputLabelProps:k,inputRef:G}),[e,a,l,o,t,x,c,T,p,b,k,G]);return jsx(h.Provider,{value:oe,children:jsx(Ne,{ref:ie,value:T,onInputChange:pe,options:n,loading:p,noOptionsText:m,loadingText:L,disabled:P,disableListWrap:!0,PopperComponent:Z,ListboxComponent:ae,filterOptions:se,onChange:me,onBlur:ue,renderOption:le,renderGroup:De,groupBy:y,multiple:c,renderInput:ce,...ne})})}));te.displayName="Autocomplete";var St=te;
|
|
16
|
-
|
|
17
|
-
export { St as a };
|
|
18
|
-
//# sourceMappingURL=chunk-SC6LFS3A.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Autocomplete/index.tsx","../src/components/Autocomplete/AutocompleteInput.tsx","../src/components/Autocomplete/Listbox.tsx","../src/components/Autocomplete/ListboxRow.tsx","../src/components/Autocomplete/ScrollEndContext.ts","../src/components/Autocomplete/styles.ts"],"names":["forwardRef","memo","useCallback","useMemo","useRef","MuiAutocomplete","CircularProgress","TextField","Fragment","jsx","jsxs","AutocompleteInput","params","name","placeholder","error","helperText","label","required","multiple","formattedValue","loading","tabIndex","InputLabelProps","inputRef","Icon_default","AutocompleteInput_default","createContext","useContext","useEffect","VariableSizeList","useTheme","useMediaQuery","ListSubheader","Stack","Typography","LISTBOX_PADDING","ListboxRow","props","data","index","style","dataSet","inlineStyle","groupItem","itemProps","option","showValueInLabel","key","otherItemProps","ListboxRow_default","ScrollEndContext","ScrollEndContext_default","OuterElementContext","OuterElementType","ref","outerProps","useResetCache","ListboxComponent","children","other","itemData","item","theme","smUp","itemCount","itemSize","getChildSize","child","itemsHeight","a","gridRef","onScrollEnd","firedRef","handleItemsRendered","visibleStopIndex","Listbox_default","autocompleteClasses","Popper","styled","StyledPopper","getOptionValue","optionValue","renderGroup","defaultFilterOptions","optionsFilter","state","searchValue","opt","Autocomplete","value","options","noOptionsText","loadingText","onChange","groupBy","disabled","renderOption","onInputChange","onSearch","onBlur","filterOptionsProp","inputReasonRef","acc","curr","resolvedFilterOptions","handleInputChange","event","eventValue","reason","handleChange","_","handleBlur","memoizedRenderOption","ownerState","renderListbox","memoizedRenderInput","Autocomplete_default"],"mappings":"wCAAA,OACE,cAAAA,GACA,QAAAC,GAEA,eAAAC,EACA,WAAAC,GACA,UAAAC,OACK,QACP,OAAOC,OAKA,6BCbP,OAAS,QAAAJ,OAAY,QACrB,OAAOK,OAAsB,iCAC7B,OAAOC,OAAe,0BAuCR,OAIJ,YAAAC,GAJI,OAAAC,EAIJ,QAAAC,OAJI,oBAjCd,IAAMC,EAAoBV,GACxB,CAAC,CACC,OAAAW,EACA,KAAAC,EACA,YAAAC,EACA,MAAAC,EACA,WAAAC,EACA,MAAAC,EACA,SAAAC,EACA,SAAAC,EACA,eAAAC,EACA,QAAAC,EACA,SAAAC,EACA,gBAAAC,EACA,SAAAC,CACF,IACEf,EAACF,GAAA,CACE,GAAGK,EACJ,KAAMC,EACN,YAAaC,EACb,UAAS,GACT,MAAO,CAAC,CAACC,EACT,WAAYC,EACZ,MAAOC,EACP,SAAUC,EACV,SAAUM,EACV,WAAY,CACV,GAAGZ,EAAO,WACV,GAAI,CAACO,GAAY,CACf,eACEC,GACA,CAAC,MAAM,QAAQA,CAAc,GAC7BA,EAAe,KACbX,EAACgB,EAAA,CAAK,KAAML,EAAe,KAAM,EAC/B,MACR,EACA,aACEV,GAAAF,GAAA,CACG,UAAAa,EAAUZ,EAACH,GAAA,CAAiB,M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,EACAC,CACF,CACF,EAEA,OACEf,EAAC2C,EAAiB,SAAjB,CAA0B,MAAOoB,GAChC,SAAA/D,EAACJ,GAAA,CACC,IAAKkD,GACL,MAAOnC,EACP,cAAesF,GACf,QAASf,EACT,QAAStE,EACT,cAAeuE,EACf,YAAaC,EACb,SAAUG,EACV,gBAAe,GACf,gBAAiBhB,EACjB,iBAAkBmC,GAClB,cAAeV,GACf,SAAUK,GACV,OAAQE,GACR,aAAcC,GACd,YAAa9B,GACb,QAASY,EACT,SAAU5E,EACV,YAAaiG,GACZ,GAAGxD,GACN,EACF,CAEJ,CACF,CACF,EAEA6B,GAAa,YAAc,eAE3B,IAAO4B,GAAQ5B","sourcesContent":["import {\n forwardRef,\n memo,\n ReactNode,\n useCallback,\n useMemo,\n useRef,\n} from 'react';\nimport MuiAutocomplete, {\n AutocompleteOwnerState,\n AutocompleteRenderGroupParams,\n AutocompleteRenderInputParams,\n AutocompleteRenderOptionState,\n} from '@mui/material/Autocomplete';\n\nimport { AutocompleteProps } from 'types/autoCompleteProps';\nimport { Option } from 'types/option';\n\nimport AutocompleteInput from './AutocompleteInput';\nimport ListboxComponent from './Listbox';\nimport ScrollEndContext from './ScrollEndContext';\nimport { StyledPopper } from './styles';\n\nconst getOptionValue = (optionValue: Option | string | number): string =>\n optionValue && typeof optionValue === 'object'\n ? optionValue.value.toString()\n : optionValue.toString();\n\nconst renderGroup = (params: AutocompleteRenderGroupParams) =>\n params as unknown as ReactNode;\n\nconst defaultFilterOptions = (\n optionsFilter: Option[],\n state: { inputValue: string },\n) => {\n const searchValue = state.inputValue.toLocaleUpperCase();\n return optionsFilter.filter(opt => {\n const search = `${opt.value} ${opt.label}`;\n\n return search.toLocaleUpperCase().includes(searchValue);\n });\n};\n\nconst Autocomplete = memo(\n forwardRef<unknown, AutocompleteProps>(\n (\n {\n name,\n label,\n value,\n options = [],\n loading,\n noOptionsText = 'Nenhum resultado encontrado.',\n loadingText = 'Carregando opções...',\n error,\n helperText,\n placeholder,\n onChange,\n groupBy,\n showValueInLabel,\n disabled,\n multiple,\n required,\n renderOption,\n tabIndex,\n onInputChange,\n onSearch,\n onBlur,\n onScrollEnd,\n InputLabelProps,\n inputRef,\n filterOptions: filterOptionsProp,\n ...other\n },\n ref,\n ) => {\n const inputReasonRef = useRef<'input' | 'reset' | 'clear' | null>(null);\n\n const formattedValue = useMemo(() => {\n if (multiple) {\n const values = Array.isArray(value) ? value : [];\n\n return values.reduce<Option[]>((acc, curr) => {\n const item = options.find(\n opt => opt.value.toString() === curr.toString(),\n );\n\n if (item) return [...acc, item];\n\n return [...acc];\n }, []);\n }\n\n const item = options.find(\n opt => opt.value.toString() === value?.toString(),\n );\n\n return item || null;\n }, [options, value, multiple]);\n\n const resolvedFilterOptions =\n filterOptionsProp ??\n (inputReasonRef.current === 'reset' ? undefined : defaultFilterOptions);\n\n const handleInputChange = useCallback(\n (\n event: React.SyntheticEvent,\n eventValue: string,\n reason: 'input' | 'reset' | 'clear',\n ) => {\n inputReasonRef.current = reason;\n if (onInputChange) onInputChange(event, eventValue, reason);\n\n if (reason === 'input') {\n if (onSearch) onSearch(eventValue);\n return;\n }\n\n if (reason === 'reset') {\n if (onSearch) onSearch(undefined);\n }\n\n if (reason === 'clear') {\n if (onSearch) onSearch('');\n }\n },\n [onInputChange, onSearch],\n );\n\n const handleChange = useCallback(\n (\n _: React.SyntheticEvent,\n option: Option | (string | Option)[] | string | null,\n ) => {\n if (!option) {\n onChange(multiple ? [] : null);\n return;\n }\n\n if (Array.isArray(option)) {\n onChange(option.map(getOptionValue));\n return;\n }\n\n onChange(\n typeof option === 'string'\n ? option.toString()\n : option.value.toString(),\n );\n },\n [onChange, multiple],\n );\n\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n if (onBlur) onBlur(event);\n },\n [onBlur],\n );\n\n const memoizedRenderOption = useCallback(\n (\n props: React.HTMLAttributes<HTMLLIElement> & { key: string },\n option: Option,\n state: AutocompleteRenderOptionState,\n ownerState: AutocompleteOwnerState<Option, boolean, boolean, boolean>,\n ) =>\n renderOption\n ? renderOption(props, option, state, ownerState)\n : ([{ ...props, showValueInLabel }, option] as ReactNode),\n [renderOption, showValueInLabel],\n );\n\n const renderListbox = useMemo(\n () => (renderOption ? undefined : ListboxComponent),\n [renderOption],\n );\n\n const memoizedRenderInput = useCallback(\n (params: AutocompleteRenderInputParams) => (\n <AutocompleteInput\n params={params}\n name={name}\n placeholder={placeholder}\n error={error}\n helperText={helperText}\n label={label}\n required={required}\n multiple={multiple}\n formattedValue={formattedValue}\n loading={loading}\n tabIndex={tabIndex}\n InputLabelProps={InputLabelProps}\n inputRef={inputRef}\n />\n ),\n [\n name,\n placeholder,\n error,\n helperText,\n label,\n required,\n multiple,\n formattedValue,\n loading,\n tabIndex,\n InputLabelProps,\n inputRef,\n ],\n );\n\n return (\n <ScrollEndContext.Provider value={onScrollEnd}>\n <MuiAutocomplete\n ref={ref}\n value={formattedValue}\n onInputChange={handleInputChange}\n options={options}\n loading={loading}\n noOptionsText={noOptionsText}\n loadingText={loadingText}\n disabled={disabled}\n disableListWrap\n PopperComponent={StyledPopper}\n ListboxComponent={renderListbox}\n filterOptions={resolvedFilterOptions}\n onChange={handleChange}\n onBlur={handleBlur}\n renderOption={memoizedRenderOption}\n renderGroup={renderGroup}\n groupBy={groupBy}\n multiple={multiple}\n renderInput={memoizedRenderInput}\n {...other}\n />\n </ScrollEndContext.Provider>\n );\n },\n ),\n);\n\nAutocomplete.displayName = 'Autocomplete';\n\nexport default Autocomplete;\n","import { memo } from 'react';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport TextField from '@mui/material/TextField';\n\nimport Icon from '../Icon';\n\nimport { AutocompleteInputProps } from './props';\n\nconst AutocompleteInput = memo(\n ({\n params,\n name,\n placeholder,\n error,\n helperText,\n label,\n required,\n multiple,\n formattedValue,\n loading,\n tabIndex,\n InputLabelProps,\n inputRef,\n }: AutocompleteInputProps) => (\n <TextField\n {...params}\n name={name}\n placeholder={placeholder}\n fullWidth\n error={!!error}\n helperText={helperText}\n label={label}\n required={required}\n inputRef={inputRef}\n InputProps={{\n ...params.InputProps,\n ...(!multiple && {\n startAdornment:\n formattedValue &&\n !Array.isArray(formattedValue) &&\n formattedValue.icon ? (\n <Icon icon={formattedValue.icon} />\n ) : undefined,\n }),\n endAdornment: (\n <>\n {loading ? <CircularProgress color=\"primary\" size={20} /> : null}\n {params.InputProps.endAdornment}\n </>\n ),\n }}\n inputProps={{\n ...params.inputProps,\n name,\n tabIndex,\n }}\n InputLabelProps={InputLabelProps}\n />\n ),\n);\n\nAutocompleteInput.displayName = 'AutocompleteInput';\n\nexport default AutocompleteInput;\n","import {\n createContext,\n forwardRef,\n HTMLAttributes,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport { ListOnItemsRenderedProps, VariableSizeList } from 'react-window';\nimport { AutocompleteRenderGroupParams } from '@mui/material/Autocomplete';\nimport { useTheme } from '@mui/material/styles';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport ListboxRow, { LISTBOX_PADDING } from './ListboxRow';\nimport type { ListboxItem } from './props';\nimport ScrollEndContext from './ScrollEndContext';\n\nconst OuterElementContext = createContext({});\n\nconst OuterElementType = forwardRef<HTMLDivElement>((props, ref) => {\n const outerProps = useContext(OuterElementContext);\n return <div ref={ref} {...props} {...outerProps} />;\n});\n\nOuterElementType.displayName = 'OuterElementType';\n\nconst useResetCache = (data: number) => {\n const ref = useRef<VariableSizeList>(null);\n\n useEffect(() => {\n if (ref.current != null) {\n ref.current.resetAfterIndex(0, true);\n }\n }, [data]);\n\n return ref;\n};\n\nconst ListboxComponent = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLElement>\n>(function ListboxComponent(props, ref) {\n const { children, ...other } = props;\n\n const itemData: ListboxItem[] = useMemo(() => {\n const data: ListboxItem[] = [];\n (children as ListboxItem[]).forEach(item => {\n data.push(item);\n if (\n Object.prototype.hasOwnProperty.call(item, 'children') &&\n Array.isArray((item as AutocompleteRenderGroupParams).children)\n ) {\n data.push(\n ...((item as AutocompleteRenderGroupParams)\n .children as ListboxItem[]),\n );\n }\n });\n return data;\n }, [children]);\n\n const theme = useTheme();\n const smUp = useMediaQuery(theme.breakpoints.up('sm'));\n const itemCount = itemData.length;\n const itemSize = smUp ? 36 : 48;\n\n const getChildSize = useCallback(\n (child: ListboxItem) => {\n if (Object.prototype.hasOwnProperty.call(child, 'group')) {\n return 48;\n }\n\n return itemSize;\n },\n [itemSize],\n );\n\n const itemsHeight = useMemo(() => {\n if (itemCount > 8) {\n return 8 * itemSize;\n }\n return itemData.map(getChildSize).reduce((a, b) => a + b, 0);\n }, [itemCount, itemSize, itemData, getChildSize]);\n\n const gridRef = useResetCache(itemCount);\n const onScrollEnd = useContext(ScrollEndContext);\n const firedRef = useRef(false);\n\n useEffect(() => {\n firedRef.current = false;\n }, [itemCount]);\n\n const handleItemsRendered = useCallback(\n ({ visibleStopIndex }: ListOnItemsRenderedProps) => {\n if (\n onScrollEnd &&\n !firedRef.current &&\n visibleStopIndex >= itemCount - 3\n ) {\n firedRef.current = true;\n onScrollEnd();\n }\n },\n [onScrollEnd, itemCount],\n );\n\n return (\n <div ref={ref}>\n <OuterElementContext.Provider value={other}>\n <VariableSizeList\n itemData={itemData}\n height={itemsHeight + 2 * LISTBOX_PADDING}\n width=\"100%\"\n ref={gridRef}\n outerElementType={OuterElementType}\n innerElementType=\"ul\"\n itemSize={index => getChildSize(itemData[index])}\n overscanCount={5}\n itemCount={itemCount}\n onItemsRendered={handleItemsRendered}\n >\n {ListboxRow}\n </VariableSizeList>\n </OuterElementContext.Provider>\n </div>\n );\n});\n\nexport default ListboxComponent;\n","import { HTMLAttributes, memo } from 'react';\nimport { ListChildComponentProps } from 'react-window';\nimport { AutocompleteRenderGroupParams } from '@mui/material/Autocomplete';\nimport ListSubheader from '@mui/material/ListSubheader';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport { Option } from 'types/option';\n\nimport Icon from '../Icon';\n\nimport type { IconName } from './props';\n\nconst LISTBOX_PADDING = 8;\n\nconst ListboxRow = memo((props: ListChildComponentProps) => {\n const { data, index, style } = props;\n const dataSet = data[index] as\n | AutocompleteRenderGroupParams\n | [HTMLAttributes<HTMLLIElement> & { showValueInLabel?: boolean }, Option];\n\n const inlineStyle = {\n ...style,\n top: (style.top as number) + LISTBOX_PADDING,\n paddingTop: 8,\n };\n\n if (Object.prototype.hasOwnProperty.call(dataSet, 'group')) {\n const groupItem = dataSet as AutocompleteRenderGroupParams;\n return (\n <ListSubheader\n key={`list-box-item-group-${groupItem.group}`}\n component=\"div\"\n style={inlineStyle}\n >\n {groupItem.group}\n </ListSubheader>\n );\n }\n\n const [itemProps, option] = dataSet as [\n HTMLAttributes<HTMLLIElement> & {\n showValueInLabel?: boolean;\n key: string;\n },\n Option,\n ];\n const { showValueInLabel, key, ...otherItemProps } = itemProps;\n\n return (\n <Typography\n component=\"li\"\n key={`list-box-item-${key}`}\n {...otherItemProps}\n noWrap\n style={inlineStyle}\n >\n <Stack\n component=\"div\"\n direction=\"row\"\n flex={1}\n gap={1}\n justifyContent=\"start\"\n >\n {option.icon && <Icon icon={option.icon as IconName} />}\n {option.label}\n\n {showValueInLabel && (\n <Typography variant=\"inherit\" color=\"grey.400\">\n ({option.value})\n </Typography>\n )}\n </Stack>\n </Typography>\n );\n});\n\nListboxRow.displayName = 'ListboxRow';\n\nexport { LISTBOX_PADDING };\nexport default ListboxRow;\n","import { createContext } from 'react';\n\nconst ScrollEndContext = createContext<(() => void) | undefined>(undefined);\n\nexport default ScrollEndContext;\n","import { autocompleteClasses } from '@mui/material/Autocomplete';\nimport Popper from '@mui/material/Popper';\nimport { styled } from '@mui/material/styles';\n\nexport const StyledPopper = styled(Popper)({\n [`& .${autocompleteClasses.listbox}`]: {\n boxSizing: 'border-box',\n '& ul': {\n padding: 0,\n margin: 0,\n },\n },\n});\n"]}
|
|
File without changes
|
|
@@ -286,10 +286,13 @@ declare const components: {
|
|
|
286
286
|
MuiTimelineDot: {
|
|
287
287
|
defaultProps?: Partial<_mui_lab_TimelineDot.TimelineDotProps> | undefined;
|
|
288
288
|
styleOverrides?: Partial<_mui_material_styles_overrides.OverridesStyleRules<keyof _mui_lab_TimelineDot.TimelineDotClasses, "MuiTimelineDot", {
|
|
289
|
-
|
|
289
|
+
cssVarPrefix: string;
|
|
290
|
+
zIndex: _mui_material.ZIndex;
|
|
291
|
+
direction: _mui_system.Direction;
|
|
292
|
+
opacity: _mui_material.Opacity;
|
|
293
|
+
typography: _mui_material.TypographyVariants;
|
|
290
294
|
palette: _mui_material.Palette;
|
|
291
295
|
colorSchemes: Record<_mui_material.SupportedColorScheme, _mui_material.ColorSystem>;
|
|
292
|
-
cssVarPrefix: string;
|
|
293
296
|
vars: _mui_material.ThemeVars;
|
|
294
297
|
getCssVar: (field: _mui_material.ThemeCssVar, ...vars: _mui_material.ThemeCssVar[]) => string;
|
|
295
298
|
getColorSchemeSelector: (colorScheme: _mui_material.SupportedColorScheme) => string;
|
|
@@ -300,16 +303,13 @@ declare const components: {
|
|
|
300
303
|
spacing: _mui_system.Spacing;
|
|
301
304
|
breakpoints: _mui_system.Breakpoints;
|
|
302
305
|
shape: _mui_system.Shape;
|
|
303
|
-
|
|
306
|
+
transitions: _mui_material.Transitions;
|
|
304
307
|
shadows: _mui_material.Shadows;
|
|
305
308
|
mixins: _mui_material.Mixins;
|
|
306
|
-
zIndex: _mui_material.ZIndex;
|
|
307
|
-
direction: _mui_system.Direction;
|
|
308
309
|
shouldSkipGeneratingVar: (keys: string[], value: string | number) => boolean;
|
|
309
310
|
unstable_sxConfig: _mui_system.SxConfig;
|
|
310
311
|
unstable_sx: (props: _mui_system.SxProps<_mui_material.Theme>) => _mui_styled_engine.CSSObject;
|
|
311
312
|
applyStyles: _mui_system.ApplyStyles<"light" | "dark">;
|
|
312
|
-
opacity: _mui_material.Opacity;
|
|
313
313
|
overlays: _mui_material.Overlays;
|
|
314
314
|
customShadows: CustomShadows;
|
|
315
315
|
unstable_strictMode?: boolean | undefined;
|
|
@@ -326,10 +326,13 @@ declare const components: {
|
|
|
326
326
|
MuiTimelineConnector: {
|
|
327
327
|
defaultProps?: Partial<_mui_lab_TimelineConnector.TimelineConnectorProps> | undefined;
|
|
328
328
|
styleOverrides?: Partial<_mui_material_styles_overrides.OverridesStyleRules<"root", "MuiTimelineConnector", {
|
|
329
|
-
|
|
329
|
+
cssVarPrefix: string;
|
|
330
|
+
zIndex: _mui_material.ZIndex;
|
|
331
|
+
direction: _mui_system.Direction;
|
|
332
|
+
opacity: _mui_material.Opacity;
|
|
333
|
+
typography: _mui_material.TypographyVariants;
|
|
330
334
|
palette: _mui_material.Palette;
|
|
331
335
|
colorSchemes: Record<_mui_material.SupportedColorScheme, _mui_material.ColorSystem>;
|
|
332
|
-
cssVarPrefix: string;
|
|
333
336
|
vars: _mui_material.ThemeVars;
|
|
334
337
|
getCssVar: (field: _mui_material.ThemeCssVar, ...vars: _mui_material.ThemeCssVar[]) => string;
|
|
335
338
|
getColorSchemeSelector: (colorScheme: _mui_material.SupportedColorScheme) => string;
|
|
@@ -340,16 +343,13 @@ declare const components: {
|
|
|
340
343
|
spacing: _mui_system.Spacing;
|
|
341
344
|
breakpoints: _mui_system.Breakpoints;
|
|
342
345
|
shape: _mui_system.Shape;
|
|
343
|
-
|
|
346
|
+
transitions: _mui_material.Transitions;
|
|
344
347
|
shadows: _mui_material.Shadows;
|
|
345
348
|
mixins: _mui_material.Mixins;
|
|
346
|
-
zIndex: _mui_material.ZIndex;
|
|
347
|
-
direction: _mui_system.Direction;
|
|
348
349
|
shouldSkipGeneratingVar: (keys: string[], value: string | number) => boolean;
|
|
349
350
|
unstable_sxConfig: _mui_system.SxConfig;
|
|
350
351
|
unstable_sx: (props: _mui_system.SxProps<_mui_material.Theme>) => _mui_styled_engine.CSSObject;
|
|
351
352
|
applyStyles: _mui_system.ApplyStyles<"light" | "dark">;
|
|
352
|
-
opacity: _mui_material.Opacity;
|
|
353
353
|
overlays: _mui_material.Overlays;
|
|
354
354
|
customShadows: CustomShadows;
|
|
355
355
|
unstable_strictMode?: boolean | undefined;
|