Skip to content

Commit

Permalink
More fixes & exports
Browse files Browse the repository at this point in the history
  • Loading branch information
djhi committed Sep 25, 2020
1 parent 66939a9 commit 5a63c4c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
15 changes: 11 additions & 4 deletions packages/ra-core/src/dataProvider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import Query from './Query';
import cacheDataProviderProxy from './cacheDataProviderProxy';
import undoableEventEmitter from './undoableEventEmitter';
import useDataProvider from './useDataProvider';
import useMutation from './useMutation';
import useQuery from './useQuery';
import useQueryWithStore from './useQueryWithStore';
import useMutation, { UseMutationValue } from './useMutation';
import useQuery, { UseQueryValue } from './useQuery';
import useQueryWithStore, { QueryOptions } from './useQueryWithStore';
import withDataProvider from './withDataProvider';
import useGetOne from './useGetOne';
import useGetOne, { UseGetOneHookValue } from './useGetOne';
import useGetList from './useGetList';
import useGetMany from './useGetMany';
import useGetManyReference from './useGetManyReference';
Expand All @@ -24,6 +24,13 @@ import useDeleteMany from './useDeleteMany';
import useRefreshWhenVisible from './useRefreshWhenVisible';
import useIsAutomaticRefreshEnabled from './useIsAutomaticRefreshEnabled';

export type {
QueryOptions,
UseMutationValue,
UseQueryValue,
UseGetOneHookValue,
};

export {
cacheDataProviderProxy,
convertLegacyDataProvider,
Expand Down
3 changes: 2 additions & 1 deletion packages/ra-ui-materialui/src/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { ButtonProps as MuiButtonProps } from '@material-ui/core/Button';
import { Theme } from '@material-ui/core';
import classnames from 'classnames';
import { Record, RedirectionSideEffect, useTranslate } from 'ra-core';
import { LocationDescriptor } from 'history';

/**
* A generic Button with side icon. Only the icon is displayed on small screens.
Expand Down Expand Up @@ -133,7 +134,7 @@ interface Props {
className?: string;
color?: MuiPropTypes.Color;
component?: ReactNode;
to?: string | { pathname: string; search: string };
to?: string | LocationDescriptor;
disabled?: boolean;
label?: string;
size?: 'small' | 'medium' | 'large';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ interface Props {
undoable?: boolean;
}

type DeleteWithConfirmButtonProps = Props & ButtonProps;
export type DeleteWithConfirmButtonProps = Props & ButtonProps;

DeleteWithConfirmButton.propTypes = {
basePath: PropTypes.string,
Expand Down
17 changes: 13 additions & 4 deletions packages/ra-ui-materialui/src/button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ import BulkExportButton from './BulkExportButton';
import Button, { ButtonProps } from './Button';
import CloneButton from './CloneButton';
import CreateButton from './CreateButton';
import DeleteButton from './DeleteButton';
import DeleteWithConfirmButton from './DeleteWithConfirmButton';
import DeleteWithUndoButton from './DeleteWithUndoButton';
import DeleteButton, { DeleteButtonProps } from './DeleteButton';
import DeleteWithConfirmButton, {
DeleteWithConfirmButtonProps,
} from './DeleteWithConfirmButton';
import DeleteWithUndoButton, {
DeleteWithUndoButtonProps,
} from './DeleteWithUndoButton';
import EditButton from './EditButton';
import ExportButton from './ExportButton';
import ListButton from './ListButton';
Expand All @@ -17,7 +21,12 @@ import SortButton from './SortButton';
import RefreshButton from './RefreshButton';
import RefreshIconButton from './RefreshIconButton';

export type { ButtonProps };
export type {
ButtonProps,
DeleteButtonProps,
DeleteWithConfirmButtonProps,
DeleteWithUndoButtonProps,
};

export {
BulkDeleteButton,
Expand Down
1 change: 1 addition & 0 deletions packages/ra-ui-materialui/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export interface CreateProps extends ResourceComponentProps {
classes?: any;
className?: string;
component?: ElementType;
record?: Partial<RaRecord>;
onSuccess?: (data: RaRecord) => void;
onFailure?: (error: any) => void;
transform?: (data: RaRecord) => RaRecord;
Expand Down

0 comments on commit 5a63c4c

Please sign in to comment.