@data-c/ui 0.1.42 → 0.1.44

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,18 +1,19 @@
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$2, StackProps, CheckboxProps as CheckboxProps$1, DialogProps as DialogProps$1, IconButtonProps, DrawerProps, TypographyProps, ToolbarProps, TextFieldProps, FilterOptionsState, TooltipProps as TooltipProps$2, BoxProps, PaperProps, SvgIconProps, IconProps, InputBaseProps, ChipProps } 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, InputBaseProps, ChipProps, Breakpoint, TableFooterProps } from '@mui/material';
4
4
  import * as React$1 from 'react';
5
5
  import React__default, { ReactNode, ComponentType } from 'react';
6
6
  import { MUIDataTableProps } from 'mui-datatables';
7
- import { PaginationProps, TransportableDataTableProps, CredentialsConfigsInterface, AmbienteDataInterface } from '@data-c/hooks';
7
+ import { PaginationProps as PaginationProps$1, TransportableDataTableProps, CredentialsConfigsInterface, AmbienteDataInterface } from '@data-c/hooks';
8
8
  import * as _mui_material_styles from '@mui/material/styles';
9
9
  import { AvatarProps } from '@mui/material/Avatar';
10
10
  import { DialogComponent, DialogProps as DialogProps$2 } from '@toolpad/core/useDialogs';
11
+ import { GridActionsCellItemProps, GridColDef as GridColDef$1, DataGridProps, GridRowsProp, GridRowSelectionModel, GridCallbackDetails } from '@mui/x-data-grid';
11
12
 
12
- interface ButtonProps$1 extends ButtonProps$2 {
13
+ interface ButtonProps$2 extends ButtonProps$3 {
13
14
  isLoading?: boolean;
14
15
  }
15
- declare const Button: (props: ButtonProps$1) => react_jsx_runtime.JSX.Element;
16
+ declare const Button: (props: ButtonProps$2) => react_jsx_runtime.JSX.Element;
16
17
 
17
18
  declare function ButtonContainer(props: StackProps): react_jsx_runtime.JSX.Element;
18
19
 
@@ -67,12 +68,12 @@ interface DataTableProps extends Omit<MUIDataTableProps, 'title'> {
67
68
  isLoading?: boolean;
68
69
  isFetching?: boolean;
69
70
  tableTitle?: string;
70
- pagination?: PaginationProps;
71
+ pagination?: PaginationProps$1;
71
72
  changePage?: (page: number) => void;
72
73
  changePageSize?: (pageSize: number) => void;
73
74
  changeSort?: (column: string, direction: string) => void;
74
75
  }
75
- declare const DataTable: (props: DataTableProps) => react_jsx_runtime.JSX.Element;
76
+ declare const DataTable$1: (props: DataTableProps) => react_jsx_runtime.JSX.Element;
76
77
 
77
78
  interface TooltipProps$1 {
78
79
  type: 'warning' | 'info';
@@ -132,7 +133,7 @@ interface FilterProps {
132
133
  children: ReactNode;
133
134
  triggerButton?: 'none' | React__default.ReactNode;
134
135
  triggerButtonLabel?: string;
135
- triggerButtonProps?: ButtonProps$2;
136
+ triggerButtonProps?: ButtonProps$3;
136
137
  title?: string;
137
138
  onApplyFilters?: (filters: any) => void;
138
139
  renderLabel?: (filterLabel: string, filterValue: any) => React__default.ReactNode;
@@ -163,7 +164,7 @@ interface FormContainerProps {
163
164
  onSubmitForm?: (formValues: any) => void;
164
165
  view?: 'dialog' | 'plain';
165
166
  triggerButton?: 'none' | React__default.ReactNode;
166
- triggerButtonProps?: ButtonProps$2;
167
+ triggerButtonProps?: ButtonProps$3;
167
168
  triggerButtonLabel?: string;
168
169
  confirmButtonLabel?: string;
169
170
  actions?: ReactNode;
@@ -187,7 +188,7 @@ declare function LabelValue(props: LabelValueProps): react_jsx_runtime.JSX.Eleme
187
188
  interface PageTitleProps {
188
189
  title: string;
189
190
  children?: ReactNode;
190
- toolbarProps?: ToolbarProps;
191
+ toolbarProps?: ToolbarProps$1;
191
192
  onBack?: () => void;
192
193
  onClose?: () => void;
193
194
  onUpdate?: (value?: string) => void;
@@ -288,7 +289,7 @@ declare function Editable(props: EditableProps): react_jsx_runtime.JSX.Element;
288
289
 
289
290
  interface ContentProps extends BoxProps {
290
291
  }
291
- declare function Content(props: ContentProps): react_jsx_runtime.JSX.Element;
292
+ declare function Content$1(props: ContentProps): react_jsx_runtime.JSX.Element;
292
293
 
293
294
  declare function Surface(props: PaperProps): react_jsx_runtime.JSX.Element;
294
295
 
@@ -508,7 +509,7 @@ interface DialogProviderProps {
508
509
  }
509
510
  declare function DialogProvider({ children }: DialogProviderProps): react_jsx_runtime.JSX.Element;
510
511
 
511
- interface DialogAdicionarButtonProps<T> extends Omit<ButtonProps$2, 'onClick'> {
512
+ interface DialogAdicionarButtonProps<T> extends Omit<ButtonProps$3, 'onClick'> {
512
513
  dialogComponent: DialogComponent<any, any>;
513
514
  payload: T;
514
515
  label?: string;
@@ -517,7 +518,7 @@ declare function DialogAdicionarButton<T>(props: DialogAdicionarButtonProps<T>):
517
518
 
518
519
  declare function DialogHeader(props: StackProps): react_jsx_runtime.JSX.Element;
519
520
 
520
- declare function Title(props: TypographyProps): react_jsx_runtime.JSX.Element;
521
+ declare function Title$1(props: TypographyProps): react_jsx_runtime.JSX.Element;
521
522
 
522
523
  interface DialogActionCloseProps {
523
524
  onClose: (result?: any) => Promise<void>;
@@ -526,17 +527,17 @@ declare function DialogActionClose({ onClose }: DialogActionCloseProps): react_j
526
527
 
527
528
  declare function DialogContent({ children, ...rest }: StackProps): react_jsx_runtime.JSX.Element;
528
529
 
529
- declare function Footer(props: StackProps): react_jsx_runtime.JSX.Element;
530
+ declare function Footer$1(props: StackProps): react_jsx_runtime.JSX.Element;
530
531
 
531
532
  declare function DialogActions(props: StackProps): react_jsx_runtime.JSX.Element;
532
533
 
533
- declare function DialogActionCancelar$1({ children, ...rest }: ButtonProps$2): react_jsx_runtime.JSX.Element;
534
+ declare function DialogActionCancelar$1({ children, ...rest }: ButtonProps$3): react_jsx_runtime.JSX.Element;
534
535
 
535
- type ButtonProps = {
536
+ type ButtonProps$1 = {
536
537
  isLoading: boolean;
537
538
  label?: string;
538
- } & ButtonProps$2;
539
- declare function DialogActionCancelar({ children, label, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
539
+ } & ButtonProps$3;
540
+ declare function DialogActionCancelar({ children, label, ...rest }: ButtonProps$1): react_jsx_runtime.JSX.Element;
540
541
 
541
542
  declare function DialogConfirmDelete({ open, onClose, payload, }: DialogProps$2<{
542
543
  identificador: any;
@@ -548,10 +549,10 @@ declare const Dialog: {
548
549
  Provider: typeof DialogProvider;
549
550
  AdicionarButton: typeof DialogAdicionarButton;
550
551
  Header: typeof DialogHeader;
551
- Title: typeof Title;
552
+ Title: typeof Title$1;
552
553
  ActionClose: typeof DialogActionClose;
553
554
  Content: typeof DialogContent;
554
- Footer: typeof Footer;
555
+ Footer: typeof Footer$1;
555
556
  Actions: typeof DialogActions;
556
557
  ActionCancelar: typeof DialogActionCancelar$1;
557
558
  ActionSalvar: typeof DialogActionCancelar;
@@ -569,12 +570,35 @@ declare function FilterContainer({ children }: {
569
570
  children: ReactNode;
570
571
  }): react_jsx_runtime.JSX.Element;
571
572
 
573
+ interface FilterDataContextProps<T = any> {
574
+ filterValues: T;
575
+ filterValuesAsArray: Array<Record<string, T>>;
576
+ appliedValues: T;
577
+ isOpen: boolean;
578
+ target?: HTMLElement;
579
+ container?: HTMLElement;
580
+ searchId?: string;
581
+ }
582
+ interface FilterApiContextProps<T = any> {
583
+ setContainer: (container: HTMLElement) => void;
584
+ openFilter: (event: React__default.MouseEvent<HTMLElement>) => void;
585
+ closeFilter: () => void;
586
+ toggleFilter: () => void;
587
+ onChangeFilterValue?: (e: React__default.ChangeEvent<HTMLInputElement>) => void;
588
+ changeFilterValue: (name: string, value: any) => void;
589
+ changeFilterValues: (filterValues: T) => void;
590
+ applyFilterValues: () => void;
591
+ deleteFilterValue?: (filterName: string) => void;
592
+ deleteAllFilterValues?: () => void;
593
+ }
572
594
  interface FilterProviderProps<T = any> {
573
595
  children: ReactNode;
574
596
  filterValues?: T;
575
597
  storagePath?: string;
576
598
  }
577
599
  declare function FilterProvider<T>(props: FilterProviderProps<T>): react_jsx_runtime.JSX.Element;
600
+ declare function useFilter<T = any>(): FilterDataContextProps<T>;
601
+ declare function useFilterApi<T = any>(): FilterApiContextProps<T>;
578
602
 
579
603
  interface FilterRootProps {
580
604
  children: ReactNode;
@@ -621,4 +645,120 @@ declare const Filter: {
621
645
  Chip: typeof FiltrerChip;
622
646
  };
623
647
 
624
- export { AlterarSenha, AlterarSenhaProps, Avatar, Breadcrumbs, BreadcrumbsItem, BreadcrumbsProps, Button, ButtonContainer, Checkbox, CheckboxProps, ColorsGrid, Content, ContentProps, ContentTitle, CurrencyCellStyle, CurrencyTextField, DataTable, DataTableOptions, DataTableOptionsProps, DataTableProps, DeleteContainer, DeleteContainerProps, Dialog$1 as Dialog, DialogProps, Dialog as DialogV2, DrawerMenu, DrawerMenuProps, Editable, EditableProps, Filter, FilterContainer$1 as FilterContainer, FilterControl, FilterProps, Flag, FormContainer, FormContainerProps, Header, Icon, LabelValue, LabelValueProps, Menu, MenuItemProps$1 as MenuItemProps, MioAuth, MioAuthProps, OptionStyles, PageTitle, PasswordTextField, Profile, ProfileProps, SearchTextField, Surface, Tooltip, TooltipProps, Transporter, TransporterProps, renderMenuItems, theme };
648
+ interface CellActionTransportProps {
649
+ disabled?: boolean;
650
+ title?: string;
651
+ onClick?: (event: 'transport') => void;
652
+ }
653
+ declare function CellActionTransport({ onClick, ...rest }: CellActionTransportProps): react_jsx_runtime.JSX.Element;
654
+
655
+ interface SelectionCounterProps {
656
+ countTitle?: string;
657
+ gender?: 'masculino' | 'feminino';
658
+ }
659
+ declare function SelectionCounter(props: SelectionCounterProps): react_jsx_runtime.JSX.Element;
660
+
661
+ interface CellActionDeleteProps {
662
+ onClick?: (event: 'delete') => void;
663
+ disabled?: boolean;
664
+ title?: string;
665
+ }
666
+ declare function CellActionDelete({ onClick, ...rest }: CellActionDeleteProps): react_jsx_runtime.JSX.Element;
667
+
668
+ declare function ExportCsvButton(): react_jsx_runtime.JSX.Element;
669
+
670
+ interface CellActionEditProps {
671
+ disabled?: boolean;
672
+ title?: string;
673
+ onClick?: (event: 'edit') => void;
674
+ }
675
+ declare function CellActionEdit({ onClick, ...rest }: CellActionEditProps): react_jsx_runtime.JSX.Element;
676
+
677
+ interface CellActionsProps {
678
+ children: ReactNode;
679
+ onClick: (event: 'edit' | 'delete') => void;
680
+ }
681
+ declare function CellActions(props: CellActionsProps): react_jsx_runtime.JSX.Element;
682
+
683
+ type CellActionProps = {
684
+ event?: string;
685
+ onClick?: (event?: string) => void;
686
+ } & GridActionsCellItemProps;
687
+ declare function CellAction(props: CellActionProps): react_jsx_runtime.JSX.Element;
688
+
689
+ interface PaginationProps {
690
+ pagination?: PaginationProps$1;
691
+ rowsPerPageOptions?: number[];
692
+ onChangePage?: (currentPage: number) => void;
693
+ onChangePageSize?: (numberOfRows: number) => void;
694
+ }
695
+ declare function Pagination(props: PaginationProps): react_jsx_runtime.JSX.Element;
696
+
697
+ interface ActionsProps {
698
+ breakpoints?: Breakpoint | number;
699
+ children: ReactNode;
700
+ }
701
+ declare function Actions({ children, breakpoints }: ActionsProps): react_jsx_runtime.JSX.Element;
702
+
703
+ interface ToolbarProps {
704
+ children?: ReactNode;
705
+ }
706
+ declare function Toolbar({ children }: ToolbarProps): react_jsx_runtime.JSX.Element;
707
+
708
+ declare function Content(props: StackProps): react_jsx_runtime.JSX.Element;
709
+
710
+ type ButtonProps = {
711
+ isLoading?: boolean;
712
+ } & ButtonProps$3;
713
+ declare function DataTableButton(props: ButtonProps): react_jsx_runtime.JSX.Element;
714
+
715
+ declare function Footer(props: TableFooterProps): react_jsx_runtime.JSX.Element;
716
+
717
+ type GridColDef = GridColDef$1 & {
718
+ enableStickyColumns?: boolean;
719
+ };
720
+ interface TableProps<T> extends Omit<DataGridProps, 'onCellKeyDown' | 'onRowDoubleClick'> {
721
+ data?: GridRowsProp<{
722
+ [key: string | symbol]: any;
723
+ }>;
724
+ columns: GridColDef[];
725
+ error?: string;
726
+ isLoading?: boolean;
727
+ isFetching?: boolean;
728
+ stackProps?: StackProps;
729
+ controlledRowsSelectedId?: GridRowSelectionModel;
730
+ onCellKeyDown?: (event: 'edit' | 'delete', id: number | string) => void;
731
+ onRowDoubleClick?: (event: 'edit' | 'delete', id: number | string) => void;
732
+ onClearRowsSelectedId?: (rowsSelectedId: GridRowSelectionModel) => void;
733
+ onRowSelectionChange?: (rowSelectionModel: GridRowSelectionModel, details: GridCallbackDetails) => void;
734
+ }
735
+ declare function Table<T>(props: TableProps<T>): react_jsx_runtime.JSX.Element;
736
+
737
+ interface TitleProps {
738
+ titleDivider?: boolean;
739
+ children: string;
740
+ }
741
+ declare function Title({ children, titleDivider }: TitleProps): react_jsx_runtime.JSX.Element;
742
+
743
+ declare function Root({ children, height, ...rest }: StackProps): react_jsx_runtime.JSX.Element;
744
+
745
+ declare const DataTable: {
746
+ CellActionTransport: typeof CellActionTransport;
747
+ SelectionCounter: typeof SelectionCounter;
748
+ CellActionDelete: typeof CellActionDelete;
749
+ ExportCsvButton: typeof ExportCsvButton;
750
+ CellActionEdit: typeof CellActionEdit;
751
+ CellActions: typeof CellActions;
752
+ CellAction: typeof CellAction;
753
+ Pagination: typeof Pagination;
754
+ Actions: typeof Actions;
755
+ Toolbar: typeof Toolbar;
756
+ Content: typeof Content;
757
+ Button: typeof DataTableButton;
758
+ Footer: typeof Footer;
759
+ Table: typeof Table;
760
+ Title: typeof Title;
761
+ Root: typeof Root;
762
+ };
763
+
764
+ export { AlterarSenha, AlterarSenhaProps, Avatar, Breadcrumbs, BreadcrumbsItem, BreadcrumbsProps, Button, ButtonContainer, Checkbox, CheckboxProps, ColorsGrid, Content$1 as Content, ContentProps, ContentTitle, CurrencyCellStyle, CurrencyTextField, DataTable$1 as DataTable, DataTableOptions, DataTableOptionsProps, DataTableProps, DataTable as DataTableV2, DeleteContainer, DeleteContainerProps, Dialog$1 as Dialog, DialogProps, Dialog as DialogV2, DrawerMenu, DrawerMenuProps, Editable, EditableProps, Filter, FilterContainer$1 as FilterContainer, FilterControl, FilterProps, Flag, FormContainer, FormContainerProps, GridColDef, Header, Icon, LabelValue, LabelValueProps, Menu, MenuItemProps$1 as MenuItemProps, MioAuth, MioAuthProps, OptionStyles, PageTitle, PasswordTextField, Profile, ProfileProps, SearchTextField, Surface, Tooltip, TooltipProps, Transporter, TransporterProps, renderMenuItems, theme, useFilter, useFilterApi };