@applica-software-guru/react-admin 1.5.234 → 1.5.235

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/.husky/pre-commit CHANGED
@@ -3,5 +3,4 @@ if [ -d "dist" ]; then
3
3
  fi
4
4
  npm run format
5
5
  npm run eslint
6
- npm run test
7
- git add .
6
+ npm run test
@@ -1,35 +1,35 @@
1
- import { SxProps } from '@mui/material/styles';
2
- import React, { PropsWithChildren } from 'react';
3
- import { CreateControllerProps, RedirectionSideEffect } from 'react-admin';
4
- declare function CreateInDialogButton({ fullWidth, maxWidth, label, record, redirect, scrollToTop, className, sx, style, fab, onSubmit, onSuccess, onError, ...controllerProps }: CreateInDialogButtonProps): JSX.Element;
5
- type CreateInDialogButtonProps = CreateControllerProps & PropsWithChildren<{
6
- fullWidth?: boolean;
7
- maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false;
1
+ import { Breakpoint } from '@mui/material';
2
+ import { CreateButtonProps, CreateProps } from 'ra-ui-materialui';
3
+ import { PropsWithChildren } from 'react';
4
+ import { FieldValues } from 'react-hook-form';
5
+ type ResponsiveButtonProps = CreateButtonProps & {
8
6
  label?: string;
9
- record?: any;
10
- redirect?: RedirectionSideEffect;
11
- scrollToTop?: boolean;
12
- className?: string;
13
- sx?: SxProps;
14
- style?: React.CSSProperties;
15
- /**
16
- * If set to false, the button will always render as a regular button, regardless of the screen size.
17
- */
18
- fab: boolean;
19
- /**
20
- * @deprecated Use mutationOptions.onSubmit instead
21
- */
22
- onSubmit?: (record: any, close: () => void) => void;
23
- /**
24
- * @deprecated Use mutationOptions.onSuccess instead
25
- */
26
- onSuccess?: (data: any) => void;
7
+ onClick?: () => void;
8
+ };
9
+ type CloseDialogFunction = () => void;
10
+ type SubmitFunction = (values: FieldValues, closeDialog: CloseDialogFunction) => void;
11
+ type CreateInDialogButtonProps = PropsWithChildren & CreateProps & ResponsiveButtonProps & {
12
+ maxWidth: Breakpoint;
13
+ fullWidth?: boolean;
14
+ fullScreen?: boolean;
27
15
  /**
16
+ * Custom handler for the submit event, in this case you are responsible for closing the dialog.
17
+ * @example
18
+ *
19
+ * const handleSubmit = (values, closeDialog) => {
20
+ * console.log(values); // { title: 'Hello World' }
21
+ * closeDialog();
22
+ * }
23
+ * <CreateInDialogButton onSubmit={handleSubmit}>
24
+ * <SimpleForm>
25
+ * <TextInput source="title" />
26
+ * </SimpleForm>
27
+ * </CreateInDialogButton>
28
28
  *
29
- * @deprecated Use mutationOptions.onError instead
30
29
  */
31
- onError?: (error: any) => void;
32
- }>;
30
+ onSubmit?: SubmitFunction;
31
+ };
32
+ declare function CreateInDialogButton(props: CreateInDialogButtonProps): import("react/jsx-runtime").JSX.Element;
33
33
  export { CreateInDialogButton };
34
34
  export type { CreateInDialogButtonProps };
35
35
  //# sourceMappingURL=CreateInDialogButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CreateInDialogButton.d.ts","sourceRoot":"","sources":["../../../../src/components/ra-buttons/CreateInDialogButton.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAiB,MAAM,sBAAsB,CAAC;AAE9D,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAAyB,MAAM,OAAO,CAAC;AAClF,OAAO,EAIL,qBAAqB,EAErB,qBAAqB,EAQtB,MAAM,aAAa,CAAC;AAwBrB,iBAAS,oBAAoB,CAAC,EAC5B,SAAgB,EAChB,QAAe,EACf,KAA0B,EAC1B,MAAM,EACN,QAAQ,EACR,WAAkB,EAClB,SAAS,EACT,EAAE,EACF,KAAK,EACL,GAAU,EACV,QAAQ,EACR,SAAS,EACT,OAAO,EACP,GAAG,eAAe,EACnB,EAAE,yBAAyB,GAAG,GAAG,CAAC,OAAO,CAwCzC;AAoHD,KAAK,yBAAyB,GAAG,qBAAqB,GACpD,iBAAiB,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;OAEG;IACH,GAAG,EAAE,OAAO,CAAC;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IACpD;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC,CAAC,CAAC;AAsBL,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAChC,YAAY,EAAE,yBAAyB,EAAE,CAAC"}
1
+ {"version":3,"file":"CreateInDialogButton.d.ts","sourceRoot":"","sources":["../../../../src/components/ra-buttons/CreateInDialogButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAU,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAwB,iBAAiB,EAAE,WAAW,EAAc,MAAM,kBAAkB,CAAC;AACpG,OAAc,EAAY,iBAAiB,EAAyB,MAAM,OAAO,CAAC;AAClF,OAAO,EAAE,WAAW,EAAkB,MAAM,iBAAiB,CAAC;AAwB9D,KAAK,qBAAqB,GAAG,iBAAiB,GAAG;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAYF,KAAK,mBAAmB,GAAG,MAAM,IAAI,CAAC;AACtC,KAAK,cAAc,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,mBAAmB,KAAK,IAAI,CAAC;AAkBtF,KAAK,yBAAyB,GAAG,iBAAiB,GAChD,WAAW,GACX,qBAAqB,GAAG;IACtB,QAAQ,EAAE,UAAU,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,CAAC;AACJ,iBAAS,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CA4D7D;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAChC,YAAY,EAAE,yBAAyB,EAAE,CAAC"}
@@ -1,13 +1,16 @@
1
1
  import { Breakpoint } from '@mui/material';
2
- import React, { PropsWithChildren } from 'react';
3
- import { EditControllerProps } from 'react-admin';
4
- declare function EditInDialogButton({ fullWidth, maxWidth, label, style, children, ...props }: EditInDialogButtonProps): JSX.Element;
5
- type EditInDialogButtonProps = EditControllerProps & PropsWithChildren<{
6
- fullWidth?: boolean;
7
- maxWidth?: false | Breakpoint | undefined;
2
+ import { EditProps } from 'ra-ui-materialui';
3
+ import { PropsWithChildren } from 'react';
4
+ type ResponsiveButtonProps = {
8
5
  label?: string;
9
- style?: React.CSSProperties;
10
- }>;
6
+ onClick: () => void;
7
+ };
8
+ type EditInDialogButtonProps = PropsWithChildren & EditProps & ResponsiveButtonProps & {
9
+ maxWidth: Breakpoint;
10
+ fullWidth?: boolean;
11
+ fullScreen?: boolean;
12
+ };
13
+ declare function EditInDialogButton(props: EditInDialogButtonProps): JSX.Element;
11
14
  export { EditInDialogButton };
12
15
  export type { EditInDialogButtonProps };
13
16
  //# sourceMappingURL=EditInDialogButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditInDialogButton.d.ts","sourceRoot":"","sources":["../../../../src/components/ra-buttons/EditInDialogButton.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAU,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAAyB,MAAM,OAAO,CAAC;AAClF,OAAO,EAGL,mBAAmB,EAOpB,MAAM,aAAa,CAAC;AAmErB,iBAAS,kBAAkB,CAAC,EAC1B,SAAgB,EAChB,QAAe,EACf,KAAwB,EACxB,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAkBvC;AAED,KAAK,uBAAuB,GAAG,mBAAmB,GAChD,iBAAiB,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC,CAAC;AAEL,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"EditInDialogButton.d.ts","sourceRoot":"","sources":["../../../../src/components/ra-buttons/EditInDialogButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAU,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAsB,SAAS,EAAc,MAAM,kBAAkB,CAAC;AAC7E,OAAc,EAAY,iBAAiB,EAAyB,MAAM,OAAO,CAAC;AAElF,KAAK,qBAAqB,GAAG;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAcF,KAAK,uBAAuB,GAAG,iBAAiB,GAC9C,SAAS,GACT,qBAAqB,GAAG;IACtB,QAAQ,EAAE,UAAU,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AACJ,iBAAS,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAkDvE;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,YAAY,EAAE,uBAAuB,EAAE,CAAC"}