@zydon/common 2.8.35 → 2.8.36

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.
@@ -11,7 +11,7 @@ interface ImageContainerProps {
11
11
 
12
12
  declare const Avatar: react.MemoExoticComponent<react.ForwardRefExoticComponent<Omit<PropsWithChildren<ImageContainerProps & _mui_material_Avatar.AvatarOwnProps & _mui_material_Avatar.AvatarSlotsAndSlotProps & _mui_material_OverridableComponent.CommonProps & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
13
13
  ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
14
- }, "children" | "className" | "style" | "classes" | "sx" | "variant" | "slots" | "slotProps" | "alt" | "src" | "sizes" | "srcSet" | "imgProps"> & {
14
+ }, "children" | "className" | "style" | "classes" | "sx" | "variant" | "slots" | "slotProps" | "sizes" | "alt" | "src" | "srcSet" | "imgProps"> & {
15
15
  component?: react.ElementType<any, keyof react.JSX.IntrinsicElements> | undefined;
16
16
  }>, "ref"> & react.RefAttributes<HTMLDivElement>>>;
17
17
 
@@ -16,8 +16,9 @@ interface UseDynamicAutocompleteConfig<TItem> {
16
16
  };
17
17
  queryParams?: Record<string, unknown>;
18
18
  mapOption?: ((item: TItem) => Option) | MapOptionConfig;
19
+ onSelect?: (value: string, item?: TItem) => void;
19
20
  }
20
- declare const useDynamicAutocomplete: <TItem>({ fieldPath, useQuery, queryParams, mapOption, }: UseDynamicAutocompleteConfig<TItem>) => {
21
+ declare const useDynamicAutocomplete: <TItem>({ fieldPath, useQuery, queryParams, mapOption, onSelect, }: UseDynamicAutocompleteConfig<TItem>) => {
21
22
  options: Option[];
22
23
  loading: boolean;
23
24
  onSearch: (term?: string) => void;
@@ -2,7 +2,7 @@ import { a } from '../chunk-GNNZB7DN.js';
2
2
  import { useMemo, useState, useRef, useCallback, useEffect } from 'react';
3
3
  import { useFormContext, useWatch } from 'react-hook-form';
4
4
 
5
- var B=n=>n,G={value:"id",label:"name"},J=n=>{if(typeof n=="function")return n;let a=n??G;return s=>({label:String(s[a.label]??""),value:String(s[a.value]??"")})},X=({fieldPath:n,useQuery:a$1,queryParams:s={},mapOption:C})=>{let T=useMemo(()=>J(C),[C]),{control:M,setValue:v}=useFormContext(),[u,k]=useState(!1),[g,m]=useState(0),[R,p]=useState([]),[w,d]=useState(!0),f=useRef(!1),x=s.perPage||25,U=`${n}.id`,h=`${n}.name`,l=useWatch({control:M,name:U}),I=useWatch({control:M,name:h}),[F,A]=useState(),S=a(F,400),$=F!==S,q=useCallback(e=>{A(e||void 0);},[]),D=useCallback(()=>{A(void 0);},[]),{data:{items:c=[]}={},isLoading:H,isFetching:i}=a$1({...s,search:S,page:g},{skip:!u});useEffect(()=>{m(0),p([]),d(!0);},[S]),useEffect(()=>{i||!u||(p(e=>{if(g===0)return c;let t=new Set(e.map(y=>String(y.id??""))),b=c.filter(y=>!t.has(String(y.id??"")));return [...e,...b]}),d(c.length>=x),f.current=!1);},[c,i,g,x,u]);let O=useMemo(()=>{let e=R.map(T);return l&&I&&!e.some(t=>String(t.value)===String(l))&&e.unshift({label:I,value:l}),e.filter(t=>t.value!==null&&t.value!==void 0)},[R,l,I,T]),K=useCallback(e=>{let t=O.find(b=>String(b.value)===String(e))?.label;v(h,t);},[O,v,h]),N=useCallback(()=>{k(!0);},[]),Q=useCallback(()=>{k(!1),m(0),p([]),d(!0),D();},[D]),W=useCallback(()=>{!i&&!f.current&&w&&(f.current=!0,m(e=>e+1));},[i,w]);return {options:O,loading:H||i,onSearch:q,onSelectOption:K,onOpen:N,onClose:Q,onScrollEnd:W,filterOptions:B,noOptionsText:$?"Carregando...":void 0}},ee=X;
5
+ var J=n=>n,X={value:"id",label:"name"},Y=n=>{if(typeof n=="function")return n;let u=n??X;return s=>({label:String(s[u.label]??""),value:String(s[u.value]??"")})},Z=({fieldPath:n,useQuery:u,queryParams:s={},mapOption:i,onSelect:p})=>{let g=useMemo(()=>Y(i),[i]),L=typeof i=="object"&&i!==null?i.label:"name",{control:k,setValue:R}=useFormContext(),[h,w]=useState(!1),[I,S]=useState(0),[m,b]=useState([]),[x,y]=useState(!0),T=useRef(!1),F=s.perPage||25,U=`${n}.id`,C=`${n}.${L}`,f=useWatch({control:k,name:U}),O=useWatch({control:k,name:C}),[A,D]=useState(),v=a(A,400),j=A!==v,q=useCallback(e=>{D(e||void 0);},[]),P=useCallback(()=>{D(void 0);},[]),{data:{items:d=[]}={},isLoading:H,isFetching:r}=u({...s,search:v,page:I},{skip:!h});useEffect(()=>{S(0),b([]),y(!0);},[v]),useEffect(()=>{r||!h||(b(e=>{if(I===0)return d;let t=new Set(e.map(l=>String(l.id??""))),a=d.filter(l=>!t.has(String(l.id??"")));return [...e,...a]}),y(d.length>=F),T.current=!1);},[d,r,I,F,h]);let M=useMemo(()=>{let e=m.map(g);return f&&O&&!e.some(t=>String(t.value)===String(f))&&e.unshift({label:O,value:f}),e.filter(t=>t.value!==null&&t.value!==void 0)},[m,f,O,g]),N=useCallback(e=>{let t=M.find(a=>String(a.value)===String(e))?.label;if(R(C,t),p){let a=m.find(l=>String(g(l).value)===String(e));p(e,a);}},[M,R,C,p,m,g]),Q=useCallback(()=>{w(!0);},[]),W=useCallback(()=>{w(!1),S(0),b([]),y(!0),P();},[P]),z=useCallback(()=>{!r&&!T.current&&x&&(T.current=!0,S(e=>e+1));},[r,x]);return {options:M,loading:H||r,onSearch:q,onSelectOption:N,onOpen:Q,onClose:W,onScrollEnd:z,filterOptions:J,noOptionsText:j?"Carregando...":void 0}},te=Z;
6
6
 
7
- export { ee as default };
7
+ export { te as default };
8
8
  //# sourceMappingURL=useDynamicAutocomplete.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hooks/useDynamicAutocomplete.ts"],"names":["useCallback","useEffect","useMemo","useRef","useState","useFormContext","useWatch","passthrough","o","defaultMapKeys","resolveMapper","mapOption","keys","item","useDynamicAutocomplete","fieldPath","useQuery","queryParams","mapper","control","setValue","open","setOpen","page","setPage","allItems","setAllItems","hasMore","setHasMore","loadingMoreRef","perPage","idField","nameField","entityId","entityName","inputValue","setInputValue","search","useDebounceValue_default","searching","onSearch","term","finishSearch","currentPageItems","isLoading","isFetching","prev","existingIds","i","unique","options","list","opt","handleSelectOption","value","label","option","handleOpen","handleClose","handleScrollEnd","p","useDynamicAutocomplete_default"],"mappings":"yCAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,WAAAC,EAAS,UAAAC,EAAQ,YAAAC,MAAgB,QAClE,OAAS,kBAAAC,EAAgB,YAAAC,MAAgB,kBAMzC,IAAMC,EAAeC,GAAgBA,EAI/BC,EAAkC,CAAE,MAAO,KAAM,MAAO,MAAO,EAE/DC,EACJC,GAC8B,CAC9B,GAAI,OAAOA,GAAc,WAAY,OAAOA,EAC5C,IAAMC,EAAOD,GAAaF,EAC1B,OAAQI,IAAiB,CACvB,MAAO,OAAQA,EAAiCD,EAAK,KAAK,GAAK,EAAE,EACjE,MAAO,OAAQC,EAAiCD,EAAK,KAAK,GAAK,EAAE,CACnE,EACF,EAuBME,EAAyB,CAAQ,CACrC,UAAAC,EACA,SAAAC,EACA,YAAAC,EAAc,CAAC,EACf,UAAAN,CACF,IAA2C,CACzC,IAAMO,EAAShB,EAAQ,IAAMQ,EAAcC,CAAS,EAAG,CAACA,CAAS,CAAC,EAC5D,CAAE,QAAAQ,EAAS,SAAAC,CAAS,EAAIf,EAAe,EACvC,CAACgB,EAAMC,CAAO,EAAIlB,EAAS,EAAK,EAChC,CAACmB,EAAMC,CAAO,EAAIpB,EAAS,CAAC,EAC5B,CAACqB,EAAUC,CAAW,EAAItB,EAAkB,CAAC,CAAC,EAC9C,CAACuB,EAASC,CAAU,EAAIxB,EAAS,EAAI,EACrCyB,EAAiB1B,EAAO,EAAK,EAE7B2B,EAAWb,EAAY,SAAsB,GAE7Cc,EAAU,GAAGhB,OACbiB,EAAY,GAAGjB,SAEfkB,EAAW3B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AACiB,EAAK,KAAKtC,GAAQ,OAAOA,EAAK,KAAK,IAAM,OAAOoB,CAAQ,CAAC,GAE1DkB,EAAK,QAAQ,CAAE,MAAOjB,EAAY,MAAOD,CAAS,CAAC,EAG9CkB,EAAK,OACVC,GAAOA,EAAI,QAAU,MAAQA,EAAI,QAAU,MAC7C,CACF,EAAG,CAAC3B,EAAUQ,EAAUC,EAAYhB,CAAM,CAAC,EAErCmC,EAAqBrD,EACxBsD,GAAkB,CACjB,IAAMC,EAAQL,EAAQ,KACpBM,GAAU,OAAOA,EAAO,KAAK,IAAM,OAAOF,CAAK,CACjD,GAAG,MACHlC,EAASY,EAAWuB,CAAK,CAC3B,EACA,CAACL,EAAS9B,EAAUY,CAAS,CAC/B,EAEMyB,EAAazD,EAAY,IAAM,CACnCsB,EAAQ,EAAI,CACd,EAAG,CAAC,CAAC,EAECoC,EAAc1D,EAAY,IAAM,CACpCsB,EAAQ,EAAK,EACbE,EAAQ,CAAC,EACTE,EAAY,CAAC,CAAC,EACdE,EAAW,EAAI,EACfc,EAAa,CACf,EAAG,CAACA,CAAY,CAAC,EAEXiB,EAAkB3D,EAAY,IAAM,CACpC,CAAC6C,GAAc,CAAChB,EAAe,SAAWF,IAC5CE,EAAe,QAAU,GACzBL,EAAQoC,GAAKA,EAAI,CAAC,EAEtB,EAAG,CAACf,EAAYlB,CAAO,CAAC,EAExB,MAAO,CACL,QAAAuB,EACA,QAASN,GAAaC,EACtB,SAAAL,EACA,eAAgBa,EAChB,OAAQI,EACR,QAASC,EACT,YAAaC,EACb,cAAepD,EACf,cAAegC,EAAY,gBAAkB,MAC/C,CACF,EAEOsB,GAAQ/C","sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useFormContext, useWatch } from 'react-hook-form';\n\nimport { Option } from 'types/option';\n\nimport useDebounceValue from './useDebounceValue';\n\nconst passthrough = (o: Option[]) => o;\n\ntype MapOptionConfig = { value: string; label: string };\n\nconst defaultMapKeys: MapOptionConfig = { value: 'id', label: 'name' };\n\nconst resolveMapper = <TItem>(\n mapOption?: ((item: TItem) => Option) | MapOptionConfig,\n): ((item: TItem) => Option) => {\n if (typeof mapOption === 'function') return mapOption;\n const keys = mapOption ?? defaultMapKeys;\n return (item: TItem) => ({\n label: String((item as Record<string, unknown>)[keys.label] ?? ''),\n value: String((item as Record<string, unknown>)[keys.value] ?? ''),\n });\n};\n\nexport interface UseDynamicAutocompleteConfig<TItem> {\n /** Form field path — watches `${fieldPath}.id` and `${fieldPath}.name` */\n fieldPath: string;\n /** RTK Query hook (e.g. useGetCategoriesQuery) */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery: (...args: any[]) => {\n data?: { items: TItem[] };\n isLoading: boolean;\n isFetching: boolean;\n };\n /** Static query params merged with { search } on each call */\n queryParams?: Record<string, unknown>;\n /**\n * Map an API entity to an Option { label, value }.\n * - Function: `(item) => ({ label: item.description, value: item.code })`\n * - Config: `{ value: 'code', label: 'description' }`\n * - Omit: defaults to `{ value: 'id', label: 'name' }`\n */\n mapOption?: ((item: TItem) => Option) | MapOptionConfig;\n}\n\nconst useDynamicAutocomplete = <TItem>({\n fieldPath,\n useQuery,\n queryParams = {},\n mapOption,\n}: UseDynamicAutocompleteConfig<TItem>) => {\n const mapper = useMemo(() => resolveMapper(mapOption), [mapOption]);\n const { control, setValue } = useFormContext();\n const [open, setOpen] = useState(false);\n const [page, setPage] = useState(0);\n const [allItems, setAllItems] = useState<TItem[]>([]);\n const [hasMore, setHasMore] = useState(true);\n const loadingMoreRef = useRef(false);\n\n const perPage = (queryParams.perPage as number) || 25;\n\n const idField = `${fieldPath}.id`;\n const nameField = `${fieldPath}.name`;\n\n const entityId = useWatch({ control, name: idField });\n const entityName = useWatch({ control, name: nameField });\n\n // Simple debounced search\n const [inputValue, setInputValue] = useState<string>();\n const search = useDebounceValue(inputValue, 400);\n const searching = inputValue !== search;\n\n const onSearch = useCallback((term?: string) => {\n setInputValue(term || undefined);\n }, []);\n\n const finishSearch = useCallback(() => {\n setInputValue(undefined);\n }, []);\n\n const {\n data: { items: currentPageItems = [] } = {},\n isLoading,\n isFetching,\n } = useQuery({ ...queryParams, search, page }, { skip: !open });\n\n // Reset pagination when search changes\n useEffect(() => {\n setPage(0);\n setAllItems([]);\n setHasMore(true);\n }, [search]);\n\n // Accumulate items when new page data arrives\n useEffect(() => {\n if (isFetching || !open) return;\n\n setAllItems(prev => {\n if (page === 0) return currentPageItems;\n const existingIds = new Set(\n prev.map(i => String((i as Record<string, unknown>).id ?? '')),\n );\n const unique = currentPageItems.filter(\n i => !existingIds.has(String((i as Record<string, unknown>).id ?? '')),\n );\n return [...prev, ...unique];\n });\n\n setHasMore(currentPageItems.length >= perPage);\n loadingMoreRef.current = false;\n }, [currentPageItems, isFetching, page, perPage, open]);\n\n const options = useMemo(() => {\n const list = allItems.map(mapper);\n\n if (\n entityId &&\n entityName &&\n !list.some(item => String(item.value) === String(entityId))\n ) {\n list.unshift({ label: entityName, value: entityId });\n }\n\n return list.filter(\n opt => opt.value !== null && opt.value !== undefined,\n );\n }, [allItems, entityId, entityName, mapper]);\n\n const handleSelectOption = useCallback(\n (value: string) => {\n const label = options.find(\n option => String(option.value) === String(value),\n )?.label;\n setValue(nameField, label);\n },\n [options, setValue, nameField],\n );\n\n const handleOpen = useCallback(() => {\n setOpen(true);\n }, []);\n\n const handleClose = useCallback(() => {\n setOpen(false);\n setPage(0);\n setAllItems([]);\n setHasMore(true);\n finishSearch();\n }, [finishSearch]);\n\n const handleScrollEnd = useCallback(() => {\n if (!isFetching && !loadingMoreRef.current && hasMore) {\n loadingMoreRef.current = true;\n setPage(p => p + 1);\n }\n }, [isFetching, hasMore]);\n\n return {\n options,\n loading: isLoading || isFetching,\n onSearch,\n onSelectOption: handleSelectOption,\n onOpen: handleOpen,\n onClose: handleClose,\n onScrollEnd: handleScrollEnd,\n filterOptions: passthrough,\n noOptionsText: searching ? 'Carregando...' : undefined,\n };\n};\n\nexport default useDynamicAutocomplete;\n"]}
1
+ {"version":3,"sources":["../../src/hooks/useDynamicAutocomplete.ts"],"names":["useCallback","useEffect","useMemo","useRef","useState","useFormContext","useWatch","passthrough","o","defaultMapKeys","resolveMapper","mapOption","keys","item","useDynamicAutocomplete","fieldPath","useQuery","queryParams","onSelect","mapper","labelKey","control","setValue","open","setOpen","page","setPage","allItems","setAllItems","hasMore","setHasMore","loadingMoreRef","perPage","idField","nameField","entityId","entityName","inputValue","setInputValue","search","useDebounceValue_default","searching","onSearch","term","finishSearch","currentPageItems","isLoading","isFetching","prev","existingIds","i","unique","options","list","opt","handleSelectOption","value","label","option","handleOpen","handleClose","handleScrollEnd","p","useDynamicAutocomplete_default"],"mappings":"yCAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,WAAAC,EAAS,UAAAC,EAAQ,YAAAC,MAAgB,QAClE,OAAS,kBAAAC,EAAgB,YAAAC,MAAgB,kBAMzC,IAAMC,EAAeC,GAAgBA,EAI/BC,EAAkC,CAAE,MAAO,KAAM,MAAO,MAAO,EAE/DC,EACJC,GAC8B,CAC9B,GAAI,OAAOA,GAAc,WAAY,OAAOA,EAC5C,IAAMC,EAAOD,GAAaF,EAC1B,OAAQI,IAAiB,CACvB,MAAO,OAAQA,EAAiCD,EAAK,KAAK,GAAK,EAAE,EACjE,MAAO,OAAQC,EAAiCD,EAAK,KAAK,GAAK,EAAE,CACnE,EACF,EA0BME,EAAyB,CAAQ,CACrC,UAAAC,EACA,SAAAC,EACA,YAAAC,EAAc,CAAC,EACf,UAAAN,EACA,SAAAO,CACF,IAA2C,CACzC,IAAMC,EAASjB,EAAQ,IAAMQ,EAAcC,CAAS,EAAG,CAACA,CAAS,CAAC,EAC5DS,EACJ,OAAOT,GAAc,UAAYA,IAAc,KAC3CA,EAAU,MACV,OACA,CAAE,QAAAU,EAAS,SAAAC,CAAS,EAAIjB,EAAe,EACvC,CAACkB,EAAMC,CAAO,EAAIpB,EAAS,EAAK,EAChC,CAACqB,EAAMC,CAAO,EAAItB,EAAS,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,EAAG,CAACf,EAAYlB,CAAO,CAAC,EAExB,MAAO,CACL,QAAAuB,EACA,QAASN,GAAaC,EACtB,SAAAL,EACA,eAAgBa,EAChB,OAAQI,EACR,QAASC,EACT,YAAaC,EACb,cAAetD,EACf,cAAekC,EAAY,gBAAkB,MAC/C,CACF,EAEOsB,GAAQjD","sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useFormContext, useWatch } from 'react-hook-form';\n\nimport { Option } from 'types/option';\n\nimport useDebounceValue from './useDebounceValue';\n\nconst passthrough = (o: Option[]) => o;\n\ntype MapOptionConfig = { value: string; label: string };\n\nconst defaultMapKeys: MapOptionConfig = { value: 'id', label: 'name' };\n\nconst resolveMapper = <TItem>(\n mapOption?: ((item: TItem) => Option) | MapOptionConfig,\n): ((item: TItem) => Option) => {\n if (typeof mapOption === 'function') return mapOption;\n const keys = mapOption ?? defaultMapKeys;\n return (item: TItem) => ({\n label: String((item as Record<string, unknown>)[keys.label] ?? ''),\n value: String((item as Record<string, unknown>)[keys.value] ?? ''),\n });\n};\n\nexport interface UseDynamicAutocompleteConfig<TItem> {\n /** Form field path — watches `${fieldPath}.id` and `${fieldPath}.{mapOption.label}` */\n fieldPath: string;\n /** RTK Query hook (e.g. useGetCategoriesQuery) */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery: (...args: any[]) => {\n data?: { items: TItem[] };\n isLoading: boolean;\n isFetching: boolean;\n };\n /** Static query params merged with { search } on each call */\n queryParams?: Record<string, unknown>;\n /**\n * Map an API entity to an Option { label, value }.\n * Also determines the form field name: `${fieldPath}.${mapOption.label}`.\n * - Config: `{ value: 'code', label: 'description' }`\n * - Function: falls back to `${fieldPath}.name`\n * - Omit: defaults to `{ value: 'id', label: 'name' }`\n */\n mapOption?: ((item: TItem) => Option) | MapOptionConfig;\n /** Called after an option is selected, with the raw item if found. */\n onSelect?: (value: string, item?: TItem) => void;\n}\n\nconst useDynamicAutocomplete = <TItem>({\n fieldPath,\n useQuery,\n queryParams = {},\n mapOption,\n onSelect,\n}: UseDynamicAutocompleteConfig<TItem>) => {\n const mapper = useMemo(() => resolveMapper(mapOption), [mapOption]);\n const labelKey =\n typeof mapOption === 'object' && mapOption !== null\n ? mapOption.label\n : 'name';\n const { control, setValue } = useFormContext();\n const [open, setOpen] = useState(false);\n const [page, setPage] = useState(0);\n const [allItems, setAllItems] = useState<TItem[]>([]);\n const [hasMore, setHasMore] = useState(true);\n const loadingMoreRef = useRef(false);\n\n const perPage = (queryParams.perPage as number) || 25;\n\n const idField = `${fieldPath}.id`;\n const nameField = `${fieldPath}.${labelKey}`;\n\n const entityId = useWatch({ control, name: idField });\n const entityName = useWatch({ control, name: nameField });\n\n // Simple debounced search\n const [inputValue, setInputValue] = useState<string>();\n const search = useDebounceValue(inputValue, 400);\n const searching = inputValue !== search;\n\n const onSearch = useCallback((term?: string) => {\n setInputValue(term || undefined);\n }, []);\n\n const finishSearch = useCallback(() => {\n setInputValue(undefined);\n }, []);\n\n const {\n data: { items: currentPageItems = [] } = {},\n isLoading,\n isFetching,\n } = useQuery({ ...queryParams, search, page }, { skip: !open });\n\n // Reset pagination when search changes\n useEffect(() => {\n setPage(0);\n setAllItems([]);\n setHasMore(true);\n }, [search]);\n\n // Accumulate items when new page data arrives\n useEffect(() => {\n if (isFetching || !open) return;\n\n setAllItems(prev => {\n if (page === 0) return currentPageItems;\n const existingIds = new Set(\n prev.map(i => String((i as Record<string, unknown>).id ?? '')),\n );\n const unique = currentPageItems.filter(\n i => !existingIds.has(String((i as Record<string, unknown>).id ?? '')),\n );\n return [...prev, ...unique];\n });\n\n setHasMore(currentPageItems.length >= perPage);\n loadingMoreRef.current = false;\n }, [currentPageItems, isFetching, page, perPage, open]);\n\n const options = useMemo(() => {\n const list = allItems.map(mapper);\n\n if (\n entityId &&\n entityName &&\n !list.some(item => String(item.value) === String(entityId))\n ) {\n list.unshift({ label: entityName, value: entityId });\n }\n\n return list.filter(\n opt => opt.value !== null && opt.value !== undefined,\n );\n }, [allItems, entityId, entityName, mapper]);\n\n const handleSelectOption = useCallback(\n (value: string) => {\n const label = options.find(\n option => String(option.value) === String(value),\n )?.label;\n setValue(nameField, label);\n\n if (onSelect) {\n const item = allItems.find(\n i => String(mapper(i).value) === String(value),\n );\n onSelect(value, item);\n }\n },\n [options, setValue, nameField, onSelect, allItems, mapper],\n );\n\n const handleOpen = useCallback(() => {\n setOpen(true);\n }, []);\n\n const handleClose = useCallback(() => {\n setOpen(false);\n setPage(0);\n setAllItems([]);\n setHasMore(true);\n finishSearch();\n }, [finishSearch]);\n\n const handleScrollEnd = useCallback(() => {\n if (!isFetching && !loadingMoreRef.current && hasMore) {\n loadingMoreRef.current = true;\n setPage(p => p + 1);\n }\n }, [isFetching, hasMore]);\n\n return {\n options,\n loading: isLoading || isFetching,\n onSearch,\n onSelectOption: handleSelectOption,\n onOpen: handleOpen,\n onClose: handleClose,\n onScrollEnd: handleScrollEnd,\n filterOptions: passthrough,\n noOptionsText: searching ? 'Carregando...' : undefined,\n };\n};\n\nexport default useDynamicAutocomplete;\n"]}
@@ -12,7 +12,6 @@ declare const useSnackbar: () => {
12
12
  custom: (jsx: (id: string | number) => react.ReactElement<any, string | react.JSXElementConstructor<any>>, data?: ExternalToast | undefined) => string | number;
13
13
  message: (message: string | number | boolean | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal | (() => ReactNode) | null | undefined, data?: ExternalToast | undefined) => string | number;
14
14
  promise: <ToastData>(promise: Promise<ToastData> | (() => Promise<ToastData>), data?: ({
15
- cancel?: ReactNode | sonner.Action;
16
15
  className?: string | undefined;
17
16
  style?: react.CSSProperties | undefined;
18
17
  position?: ("top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right") | undefined;
@@ -21,6 +20,7 @@ declare const useSnackbar: () => {
21
20
  icon?: ReactNode;
22
21
  duration?: number | undefined;
23
22
  onDismiss?: ((toast: sonner.ToastT) => void) | undefined;
23
+ cancel?: ReactNode | sonner.Action;
24
24
  richColors?: boolean | undefined;
25
25
  invert?: boolean | undefined;
26
26
  closeButton?: boolean | undefined;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
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';
1
+ import { C as CustomShadows } from './index-5a5e5dc8.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-5a5e5dc8.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-c8f1e6e7.js';
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-5a5e5dc8.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?: readonly string[] | csstype.Property.FontFamily | readonly csstype.Property.FontFamily[] | undefined;
176
+ fontFamily?: csstype.Property.FontFamily | readonly string[] | 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 ("bold" | (string & {}) | csstype.Globals | "normal" | "bolder" | "lighter")[] | undefined;
200
+ fontWeight?: csstype.Property.FontWeight | readonly NonNullable<csstype.Property.FontWeight | undefined>[] | readonly ((string & {}) | csstype.Globals | "bold" | "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;
@@ -460,9 +460,9 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
460
460
  x?: readonly (string | (string & {}))[] | csstype.Property.X<string | number> | readonly NonNullable<csstype.Property.X<string | number> | undefined>[] | undefined;
461
461
  y?: readonly (string | (string & {}))[] | csstype.Property.Y<string | number> | readonly NonNullable<csstype.Property.Y<string | number> | undefined>[] | undefined;
462
462
  zIndex?: readonly ((string & {}) | csstype.Globals | "auto")[] | csstype.Property.ZIndex | readonly NonNullable<csstype.Property.ZIndex | undefined>[] | undefined;
463
- zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ("reset" | (string & {}) | csstype.Globals | "normal")[] | undefined;
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 ("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;
465
+ animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "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 ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
477
+ borderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "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 ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
512
+ maskBorder?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "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 ("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;
761
+ MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "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 ((string & {}) | csstype.Globals | "repeat" | "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 ("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;
774
+ WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "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 ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
776
+ WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "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 ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
783
+ WebkitMaskBoxImage?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "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 ("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;
864
+ OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "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 ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
874
+ OBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.8.35",
3
+ "version": "2.8.36",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -286,13 +286,10 @@ 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
- cssVarPrefix: string;
290
- zIndex: _mui_material.ZIndex;
291
- direction: _mui_system.Direction;
292
- opacity: _mui_material.Opacity;
293
- typography: _mui_material.TypographyVariants;
289
+ transitions: _mui_material.Transitions;
294
290
  palette: _mui_material.Palette;
295
291
  colorSchemes: Record<_mui_material.SupportedColorScheme, _mui_material.ColorSystem>;
292
+ cssVarPrefix: string;
296
293
  vars: _mui_material.ThemeVars;
297
294
  getCssVar: (field: _mui_material.ThemeCssVar, ...vars: _mui_material.ThemeCssVar[]) => string;
298
295
  getColorSchemeSelector: (colorScheme: _mui_material.SupportedColorScheme) => string;
@@ -303,13 +300,16 @@ declare const components: {
303
300
  spacing: _mui_system.Spacing;
304
301
  breakpoints: _mui_system.Breakpoints;
305
302
  shape: _mui_system.Shape;
306
- transitions: _mui_material.Transitions;
303
+ typography: _mui_material.TypographyVariants;
307
304
  shadows: _mui_material.Shadows;
308
305
  mixins: _mui_material.Mixins;
306
+ zIndex: _mui_material.ZIndex;
307
+ direction: _mui_system.Direction;
309
308
  shouldSkipGeneratingVar: (keys: string[], value: string | number) => boolean;
310
309
  unstable_sxConfig: _mui_system.SxConfig;
311
310
  unstable_sx: (props: _mui_system.SxProps<_mui_material.Theme>) => _mui_styled_engine.CSSObject;
312
311
  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,13 +326,10 @@ 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
- cssVarPrefix: string;
330
- zIndex: _mui_material.ZIndex;
331
- direction: _mui_system.Direction;
332
- opacity: _mui_material.Opacity;
333
- typography: _mui_material.TypographyVariants;
329
+ transitions: _mui_material.Transitions;
334
330
  palette: _mui_material.Palette;
335
331
  colorSchemes: Record<_mui_material.SupportedColorScheme, _mui_material.ColorSystem>;
332
+ cssVarPrefix: string;
336
333
  vars: _mui_material.ThemeVars;
337
334
  getCssVar: (field: _mui_material.ThemeCssVar, ...vars: _mui_material.ThemeCssVar[]) => string;
338
335
  getColorSchemeSelector: (colorScheme: _mui_material.SupportedColorScheme) => string;
@@ -343,13 +340,16 @@ declare const components: {
343
340
  spacing: _mui_system.Spacing;
344
341
  breakpoints: _mui_system.Breakpoints;
345
342
  shape: _mui_system.Shape;
346
- transitions: _mui_material.Transitions;
343
+ typography: _mui_material.TypographyVariants;
347
344
  shadows: _mui_material.Shadows;
348
345
  mixins: _mui_material.Mixins;
346
+ zIndex: _mui_material.ZIndex;
347
+ direction: _mui_system.Direction;
349
348
  shouldSkipGeneratingVar: (keys: string[], value: string | number) => boolean;
350
349
  unstable_sxConfig: _mui_system.SxConfig;
351
350
  unstable_sx: (props: _mui_system.SxProps<_mui_material.Theme>) => _mui_styled_engine.CSSObject;
352
351
  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;