@judo/components
Version:
125 lines (124 loc) • 5.94 kB
text/typescript
/// <reference types="react" />
import { ConfirmationDialogProps, DialogProviderProps, FilterDialogProps, ConfirmDialogProviderContext, FilterDialogProviderContext, PageDialogProviderContext, RangeDialogProviderContext, FilterOption, HeroProps, LogoProps, MenuProps } from "@judo/components-api";
import { ReactNode, Dispatch, SetStateAction } from "react";
import { GridColumns, GridSortItem, GridSelectionModel, GridRowId } from "@mui/x-data-grid";
import { JudoStored, QueryCustomizer } from "@judo/data-api-common";
import { ColumnActionsProvider } from "@judo/utilities";
import { To } from "react-router-dom";
declare const ConfirmationDialog: ({ confirmationMessage, title, resolve, open, handleClose }: ConfirmationDialogProps) => JSX.Element;
declare const DialogProvider: ({ children }: DialogProviderProps) => JSX.Element;
declare const FilterDialog: ({ filters, filterOptions, resolve, open, handleClose }: FilterDialogProps) => JSX.Element;
// @ts-ignore
declare const PageDialogContextState: import("react").Context<PageDialogProviderContext>;
// @ts-ignore
declare const ConfirmDialogContextState: import("react").Context<ConfirmDialogProviderContext>;
// @ts-ignore
declare const RangeDialogContextState: import("react").Context<RangeDialogProviderContext>;
// @ts-ignore
declare const FilterDialogContextState: import("react").Context<FilterDialogProviderContext>;
declare const useFilterDialog: () => FilterDialogProviderContext;
interface PageDialogProps {
page: ReactNode;
open: boolean;
handleClose: () => void;
resolve: () => void;
}
declare const PageDialog: ({ page, open, handleClose, resolve }: PageDialogProps) => JSX.Element;
interface RangeDialogProps<T extends JudoStored<T>, U extends QueryCustomizer<T>> {
resolve: (value: any) => void;
open: boolean;
handleClose: () => void;
single?: boolean;
columns: GridColumns<T>;
defaultSortField: GridSortItem;
rangeCall: (queryCustomizer: U) => Promise<Array<T>>;
alreadySelectedItems: GridSelectionModel | GridRowId;
initalQueryCustomizer: U;
filterOptions: FilterOption[];
}
declare const RangeDialog: <T extends JudoStored<T>, U extends QueryCustomizer<T>>({ resolve, open, handleClose, single, columns, defaultSortField, rangeCall, alreadySelectedItems, initalQueryCustomizer, filterOptions }: RangeDialogProps<T, U>) => JSX.Element;
declare const columnsActionCalculator: ColumnActionsProvider<any>;
interface AggregationInputProps {
name?: string;
id?: string;
label?: string;
value: any | undefined | null;
error?: boolean | undefined;
helperText?: string | undefined;
disabled?: boolean | undefined;
readonly?: boolean | undefined;
labelList: string[];
icon?: ReactNode;
onSet?: () => Promise<void> | undefined;
onView?: () => void | undefined;
onCreate?: () => void | undefined;
onDelete?: () => Promise<void> | undefined;
onRemove?: () => void | undefined;
}
declare const AggregationInput: ({ name, id, label, value, error, helperText, disabled, readonly, labelList, icon, onSet, onView, onCreate, onRemove, onDelete }: AggregationInputProps) => JSX.Element;
interface BreadcrumbProviderProps {
children: ReactNode;
}
type JudoNavigationSetTitle = (pageTitle: string) => void;
interface JudoNavigationProviderContext {
clearNavigate: (to: To) => void;
navigate: (to: To) => void;
back: () => void;
isBackDisabled: boolean;
setTitle: JudoNavigationSetTitle;
}
declare const useJudoNavigation: () => JudoNavigationProviderContext;
declare const BreadcrumbProvider: ({ children }: BreadcrumbProviderProps) => JSX.Element;
declare const CustomBreadcrumb: () => JSX.Element;
interface CustomTablePaginationProps {
pageChange: (isNext: boolean) => Promise<void>;
isNextButtonEnabled: boolean;
page: number;
rowPerPage: number;
setPage: Dispatch<SetStateAction<number>>;
}
declare const CustomTablePagination: (props: CustomTablePaginationProps) => JSX.Element;
interface DropdownMenuItem {
disabled?: boolean;
visible?: boolean;
label?: string;
onClick: () => void;
startIcon?: ReactNode;
endIcon?: ReactNode;
}
interface DropdownButtonProps {
children?: ReactNode;
id?: string | undefined;
menuItems: DropdownMenuItem[];
disabled?: boolean;
showDropdownIcon?: boolean;
fullWidth?: boolean;
variant?: "text" | "outlined" | "contained" | undefined;
}
declare function DropdownButton({ children, id, menuItems, disabled, showDropdownIcon, fullWidth, variant }: DropdownButtonProps): JSX.Element;
declare function Hero(props: HeroProps): JSX.Element;
declare function Logo(props: LogoProps): JSX.Element;
declare module "react" {
interface CSSProperties {
"--tree-view-color"?: string;
"--tree-view-bg-color"?: string;
}
}
declare const MenuTree: ({ items, height, maxWidth, defaultExpanded }: MenuProps) => JSX.Element;
interface PageHeaderProps {
title: string;
children: ReactNode;
}
declare const PageHeader: ({ title, children }: PageHeaderProps) => JSX.Element;
interface TrinaryLogicProps {
readOnly?: boolean;
value?: boolean | null;
id?: string;
label: string;
name?: string;
error?: boolean | undefined;
helperText?: string | undefined;
onChange?: (value: boolean | null) => void;
}
declare const TrinaryLogicCombobox: ({ readOnly, value, id, label, name, error, helperText, onChange }: TrinaryLogicProps) => JSX.Element;
export { ConfirmationDialog, DialogProvider, FilterDialog, PageDialogContextState, ConfirmDialogContextState, RangeDialogContextState, FilterDialogContextState, useFilterDialog, PageDialog, RangeDialog, columnsActionCalculator, AggregationInput, JudoNavigationSetTitle, useJudoNavigation, BreadcrumbProvider, CustomBreadcrumb, CustomTablePaginationProps, CustomTablePagination, DropdownButton, Hero, Logo, MenuTree, PageHeader, TrinaryLogicCombobox };