@data-c/ui 0.2.8 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as _mui_material from '@mui/material';
3
- import { ButtonProps as ButtonProps$3, StackProps, CheckboxProps as CheckboxProps$1, DialogProps as DialogProps$1, IconButtonProps, DrawerProps, TypographyProps, ToolbarProps as ToolbarProps$1, TextFieldProps, FilterOptionsState, TooltipProps as TooltipProps$2, BoxProps, PaperProps, SvgIconProps, IconProps, ChipProps, InputBaseProps, Breakpoint, TableFooterProps, MenuItemProps as MenuItemProps$2, PopoverProps, ContainerProps } from '@mui/material';
3
+ import { ButtonProps as ButtonProps$3, StackProps, CheckboxProps as CheckboxProps$1, IconButtonProps, DrawerProps, TypographyProps, ToolbarProps as ToolbarProps$1, TextFieldProps, TooltipProps as TooltipProps$2, BoxProps, PaperProps, SvgIconProps, IconProps, DialogProps as DialogProps$1, ChipProps, InputBaseProps, Breakpoint, TableFooterProps, MenuItemProps as MenuItemProps$2, PopoverProps, ContainerProps, AutocompleteInputChangeReason } from '@mui/material';
4
4
  import * as React$1 from 'react';
5
- import React__default, { ReactNode, ComponentType, ForwardRefExoticComponent, RefAttributes } from 'react';
6
- import { TransportableDataTableProps, CredentialsConfigsInterface, AmbienteDataInterface, Empresa, PaginationProps as PaginationProps$1 } from '@data-c/hooks';
5
+ import React__default, { ReactNode, ForwardRefExoticComponent, RefAttributes } from 'react';
6
+ import { CredentialsConfigsInterface, AmbienteDataInterface, Empresa, PaginationProps as PaginationProps$1 } from '@data-c/hooks';
7
7
  import * as _mui_material_styles from '@mui/material/styles';
8
8
  import { AvatarProps } from '@mui/material/Avatar';
9
- import { DialogComponent, DialogProps as DialogProps$2 } from '@toolpad/core';
9
+ import { DialogComponent, DialogProps } from '@toolpad/core';
10
10
  export { useDialogs } from '@toolpad/core';
11
11
  import { GridColDef as GridColDef$1, DataGridProps, GridRowsProp, GridRowSelectionModel, GridCallbackDetails, GridActionsCellItemProps } from '@mui/x-data-grid';
12
12
  import * as LucideIcons from 'lucide-react';
@@ -30,40 +30,6 @@ declare const CurrencyTextField: React$1.ForwardRefExoticComponent<Omit<Omit<_mu
30
30
  onChange?: ((e: React.ChangeEvent<HTMLInputElement>, value: any) => void) | undefined;
31
31
  }, "ref"> & React$1.RefAttributes<unknown>>;
32
32
 
33
- interface DialogActionsProps {
34
- cancelLabel?: string;
35
- confirmLabel?: string;
36
- type?: 'content' | 'info' | 'warning' | 'error' | 'success';
37
- onCancel?: () => void;
38
- onConfirm?: () => void;
39
- isLoadingConfirmButton?: boolean;
40
- }
41
-
42
- interface DialogProps extends DialogProps$1 {
43
- actions?: 'none' | ReactNode;
44
- type?: 'content' | 'info' | 'warning' | 'error' | 'success';
45
- onConfirm?: () => void;
46
- dialogActionsProps?: DialogActionsProps;
47
- }
48
- declare function Dialog$1(props: DialogProps): react_jsx_runtime.JSX.Element;
49
- declare namespace Dialog$1 {
50
- var defaultProps: {
51
- fullWidth: boolean;
52
- type: string;
53
- };
54
- }
55
-
56
- interface DeleteContainerProps extends DialogProps {
57
- title: string;
58
- children: ReactNode;
59
- onDelete?: (formValues: any) => void;
60
- type?: 'warning' | 'error';
61
- }
62
- declare function DeleteContainer(props: DeleteContainerProps): react_jsx_runtime.JSX.Element;
63
- declare namespace DeleteContainer {
64
- var defaultProps: DialogProps;
65
- }
66
-
67
33
  interface TooltipProps$1 {
68
34
  type: 'warning' | 'info';
69
35
  content: NonNullable<React__default.ReactNode>;
@@ -148,22 +114,6 @@ interface Flag {
148
114
  }
149
115
  declare function Flag(props: Flag): react_jsx_runtime.JSX.Element | null;
150
116
 
151
- interface FormContainerProps {
152
- children: ReactNode;
153
- onSubmitForm?: (formValues: any) => void;
154
- view?: 'dialog' | 'plain';
155
- triggerButton?: 'none' | React__default.ReactNode;
156
- triggerButtonProps?: ButtonProps$3;
157
- triggerButtonLabel?: string;
158
- confirmButtonLabel?: string;
159
- actions?: ReactNode;
160
- dialogProps?: Omit<DialogProps$1, 'open'>;
161
- }
162
- declare function FormContainer(props: FormContainerProps): react_jsx_runtime.JSX.Element;
163
- declare namespace FormContainer {
164
- var defaultProps: Omit<FormContainerProps, "children">;
165
- }
166
-
167
117
  interface LabelValueProps {
168
118
  label: string;
169
119
  children: ReactNode | string;
@@ -191,26 +141,6 @@ type SearchTextFieldProps = {
191
141
  } & Omit<TextFieldProps, 'onChange'>;
192
142
  declare function SearchTextField(props: SearchTextFieldProps): react_jsx_runtime.JSX.Element;
193
143
 
194
- type TransporterProps<T, TP = {}> = {
195
- form?: ComponentType;
196
- table: ComponentType<TransportableDataTableProps<T>>;
197
- tableProps?: TP;
198
- options: Array<T>;
199
- value?: T | null;
200
- inputValue?: unknown;
201
- isLoading?: boolean;
202
- onSearch: (q: string) => void;
203
- renderValue: (value: T) => string;
204
- onChange?: (value: T | null) => void;
205
- optionKeyName?: string;
206
- filterOptions?: ((options: T[], state: FilterOptionsState<T>) => T[]) | undefined;
207
- dialogProps?: Omit<DialogProps$1, 'open'>;
208
- } & Omit<TextFieldProps, 'onChange'>;
209
- declare function Transporter<T>(props: TransporterProps<T>): react_jsx_runtime.JSX.Element;
210
- declare namespace Transporter {
211
- var defaultProps: Pick<TransporterProps<any, {}>, "dialogProps">;
212
- }
213
-
214
144
  interface TooltipProps extends TooltipProps$2 {
215
145
  type: 'warning' | 'info';
216
146
  }
@@ -531,7 +461,7 @@ interface DialogAdicionarButtonProps<T> extends Omit<ButtonProps$3, 'onClick'> {
531
461
  }
532
462
  declare function DialogAdicionarButton<T>(props: DialogAdicionarButtonProps<T>): react_jsx_runtime.JSX.Element;
533
463
 
534
- interface DialogConfirmProps<T = any> extends DialogProps$2<T, T | false> {
464
+ interface DialogConfirmProps<T = any> extends DialogProps<T, T | false> {
535
465
  title?: string;
536
466
  message?: string;
537
467
  confirmButtonLabel?: string;
@@ -539,7 +469,7 @@ interface DialogConfirmProps<T = any> extends DialogProps$2<T, T | false> {
539
469
  }
540
470
  declare function DialogConfirm(props: DialogConfirmProps): react_jsx_runtime.JSX.Element;
541
471
 
542
- declare function DialogConfirmDelete({ open, onClose, payload, }: DialogProps$2<{
472
+ declare function DialogConfirmDelete({ open, onClose, payload, }: DialogProps<{
543
473
  useRemover: any;
544
474
  configs: any;
545
475
  }>): react_jsx_runtime.JSX.Element;
@@ -888,8 +818,7 @@ interface CardTitleProps {
888
818
  }
889
819
  declare function CardTitle(props: CardTitleProps): react_jsx_runtime.JSX.Element;
890
820
 
891
- interface CardContentProps {
892
- children: React.ReactNode;
821
+ interface CardContentProps extends StackProps {
893
822
  }
894
823
  declare function CardContent(props: CardContentProps): react_jsx_runtime.JSX.Element;
895
824
 
@@ -938,4 +867,59 @@ declare const Page: {
938
867
  Content: typeof PageContent;
939
868
  };
940
869
 
941
- export { AlterarLicenca, AlterarLicencaProps, AlterarSenha, AlterarSenhaProps, Avatar, Breadcrumbs, BreadcrumbsItem, BreadcrumbsProps, Button$1 as Button, ButtonContainer, Button as ButtonGroup, Card, Checkbox, CheckboxProps, ColorsGrid, Content$1 as Content, ContentProps, ContentTitle, CurrencyCellStyle, CurrencyTextField, DataTable, DataTableOptions, DataTableOptionsProps, DeleteContainer, DeleteContainerProps, Dialog$1 as Dialog, DialogProps, Dialog as DialogV2, DrawerMenu, DrawerMenuProps, Editable, EditableProps, Filter, FilterApiContext, FilterApiContextProps, FilterContainer$1 as FilterContainer, FilterControl, FilterDataContext, FilterDataContextProps, FilterOptions, FilterProps, FilterProvider, FilterProviderProps, Flag, FormContainer, FormContainerProps, GridColDef, Header, Icon, LabelValue, LabelValueProps, List$1 as List, LucideIcon as LucidIcon, Menu, MenuItemProps$1 as MenuItemProps, MioAuth, MioAuthProps, OptionStyles, Page, PageTitle$1 as PageTitle, PasswordTextField, List as Popover, Profile, ProfileProps, SearchTextField, Surface, Title, TitleProps, TitleVariant, Tooltip, TooltipProps, Transporter, TransporterProps, renderMenuItems, theme, useFilter, useFilterApi, useMenu };
870
+ interface AutocompleteProps<T = any> {
871
+ onDoubleClick?: () => void;
872
+ onChange?: (value: T | null) => void;
873
+ value?: T | null;
874
+ options: Array<T>;
875
+ renderValue?: (value: T) => string;
876
+ onSearchChange?: (query: string, reason: AutocompleteInputChangeReason) => void;
877
+ label?: string;
878
+ isLoading?: boolean;
879
+ name?: string;
880
+ helperText?: string;
881
+ error?: boolean;
882
+ required?: boolean;
883
+ disabled?: boolean;
884
+ autoFocus?: boolean;
885
+ }
886
+ declare function Autocomplete<T = any>(props: AutocompleteProps<T>): react_jsx_runtime.JSX.Element;
887
+
888
+ interface TransporterContainerProps {
889
+ children: ReactNode;
890
+ title?: string;
891
+ }
892
+ declare function TransporterContainer(props: TransporterContainerProps): react_jsx_runtime.JSX.Element | null;
893
+
894
+ interface TransporterRootProps<T> {
895
+ scope: string;
896
+ value?: T | null;
897
+ onChange?: (value: T) => void;
898
+ children: ReactNode;
899
+ }
900
+ declare function TransporterRoot<T = any>(props: TransporterRootProps<T>): react_jsx_runtime.JSX.Element;
901
+
902
+ type TransporterTextFieldProps = {} & Omit<AutocompleteProps, 'onChange' | 'value'>;
903
+ declare function TransporterTextField(props: TransporterTextFieldProps): react_jsx_runtime.JSX.Element;
904
+
905
+ type TransporterStore<T> = {
906
+ isOpen: boolean;
907
+ query?: string;
908
+ value?: T | null;
909
+ setQuery: (query?: string) => void;
910
+ setValue: (value?: T | null) => void;
911
+ openTransporter: () => void;
912
+ closeTransporter: (value?: T) => Promise<void>;
913
+ onChange?: (value: T) => void;
914
+ setOnChange: (fn?: (value: T) => void) => void;
915
+ triggerOnChange: (value: T) => void;
916
+ };
917
+ declare function useTransporter<T>(id: string): TransporterStore<T>;
918
+
919
+ declare const Transporter: {
920
+ Root: typeof TransporterRoot;
921
+ TextField: typeof TransporterTextField;
922
+ Container: typeof TransporterContainer;
923
+ };
924
+
925
+ export { AlterarLicenca, AlterarLicencaProps, AlterarSenha, AlterarSenhaProps, Autocomplete, AutocompleteProps, Avatar, Breadcrumbs, BreadcrumbsItem, BreadcrumbsProps, Button$1 as Button, ButtonContainer, Button as ButtonGroup, Card, Checkbox, CheckboxProps, ColorsGrid, Content$1 as Content, ContentProps, ContentTitle, CurrencyCellStyle, CurrencyTextField, DataTable, DataTableOptions, DataTableOptionsProps, Dialog, DrawerMenu, DrawerMenuProps, Editable, EditableProps, Filter, FilterApiContext, FilterApiContextProps, FilterContainer$1 as FilterContainer, FilterControl, FilterDataContext, FilterDataContextProps, FilterOptions, FilterProps, FilterProvider, FilterProviderProps, Flag, GridColDef, Header, Icon, LabelValue, LabelValueProps, List$1 as List, LucideIcon as LucidIcon, Menu, MenuItemProps$1 as MenuItemProps, MioAuth, MioAuthProps, OptionStyles, Page, PageTitle$1 as PageTitle, PasswordTextField, List as Popover, Profile, ProfileProps, SearchTextField, Surface, Title, TitleProps, TitleVariant, Tooltip, TooltipProps, Transporter, renderMenuItems, theme, useFilter, useFilterApi, useMenu, useTransporter };