@knovator/pagecreator-admin 1.4.2 → 1.4.3

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/index.cjs CHANGED
@@ -4547,7 +4547,8 @@ const FormActions = ({
4547
4547
  };
4548
4548
 
4549
4549
  const PageFormActions = ({
4550
- formRef
4550
+ formRef,
4551
+ onPrimaryButtonClick
4551
4552
  }) => {
4552
4553
  const {
4553
4554
  onError,
@@ -4562,6 +4563,7 @@ const PageFormActions = ({
4562
4563
  } = usePageState();
4563
4564
  const onSubmitClick = e => {
4564
4565
  var _a;
4566
+ onPrimaryButtonClick === null || onPrimaryButtonClick === void 0 ? void 0 : onPrimaryButtonClick(e);
4565
4567
  if (!formRef) {
4566
4568
  return onError(CALLBACK_CODES.INTERNAL, 'error', `formRef is required to submit the form!`);
4567
4569
  } else if (!formRef.current) {
@@ -4606,7 +4608,8 @@ const Page = ({
4606
4608
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4607
4609
  // @ts-ignore
4608
4610
  permissions: _permissions = {},
4609
- preConfirmDelete
4611
+ preConfirmDelete,
4612
+ onPrimaryButtonClick
4610
4613
  }) => {
4611
4614
  const {
4612
4615
  commonTranslations
@@ -4676,7 +4679,8 @@ const Page = ({
4676
4679
  onClose: onCloseForm,
4677
4680
  title: formState === 'ADD' ? combinedTranslations.addPage : formState === 'UPDATE' ? combinedTranslations.updatePage : '',
4678
4681
  footerContent: /*#__PURE__*/React__default["default"].createElement(PageFormActions, {
4679
- formRef: formRef
4682
+ formRef: formRef,
4683
+ onPrimaryButtonClick: onPrimaryButtonClick
4680
4684
  })
4681
4685
  }, /*#__PURE__*/React__default["default"].createElement(PageForm, {
4682
4686
  formRef: formRef
package/index.js CHANGED
@@ -4535,7 +4535,8 @@ const FormActions = ({
4535
4535
  };
4536
4536
 
4537
4537
  const PageFormActions = ({
4538
- formRef
4538
+ formRef,
4539
+ onPrimaryButtonClick
4539
4540
  }) => {
4540
4541
  const {
4541
4542
  onError,
@@ -4550,6 +4551,7 @@ const PageFormActions = ({
4550
4551
  } = usePageState();
4551
4552
  const onSubmitClick = e => {
4552
4553
  var _a;
4554
+ onPrimaryButtonClick === null || onPrimaryButtonClick === void 0 ? void 0 : onPrimaryButtonClick(e);
4553
4555
  if (!formRef) {
4554
4556
  return onError(CALLBACK_CODES.INTERNAL, 'error', `formRef is required to submit the form!`);
4555
4557
  } else if (!formRef.current) {
@@ -4594,7 +4596,8 @@ const Page = ({
4594
4596
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4595
4597
  // @ts-ignore
4596
4598
  permissions: _permissions = {},
4597
- preConfirmDelete
4599
+ preConfirmDelete,
4600
+ onPrimaryButtonClick
4598
4601
  }) => {
4599
4602
  const {
4600
4603
  commonTranslations
@@ -4664,7 +4667,8 @@ const Page = ({
4664
4667
  onClose: onCloseForm,
4665
4668
  title: formState === 'ADD' ? combinedTranslations.addPage : formState === 'UPDATE' ? combinedTranslations.updatePage : '',
4666
4669
  footerContent: /*#__PURE__*/React.createElement(PageFormActions, {
4667
- formRef: formRef
4670
+ formRef: formRef,
4671
+ onPrimaryButtonClick: onPrimaryButtonClick
4668
4672
  })
4669
4673
  }, /*#__PURE__*/React.createElement(PageForm, {
4670
4674
  formRef: formRef
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knovator/pagecreator-admin",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "dependencies": {
5
5
  "classnames": "^2.3.1",
6
6
  "react-beautiful-dnd": "^13.1.0",
@@ -1,13 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import { PageProps } from '../../../types';
3
3
  declare const Page: {
4
- ({ loader, translations, explicitForm, children, permissions, preConfirmDelete, }: PageProps): JSX.Element;
4
+ ({ loader, translations, explicitForm, children, permissions, preConfirmDelete, onPrimaryButtonClick, }: PageProps): JSX.Element;
5
5
  Table: ({ extraActions, extraColumns }: import("../../../types").DerivedTableProps) => JSX.Element;
6
6
  Search: () => JSX.Element;
7
- Form: ({ formRef }: import("../../../types").FormProps) => JSX.Element | null;
7
+ Form: ({ formRef, onFilterClick, filterQuery }: import("../../../types").FormProps) => JSX.Element | null;
8
8
  AddButton: () => JSX.Element;
9
9
  Pagination: () => JSX.Element;
10
- FormActions: ({ formRef }: import("../../../types").FormActionWrapperProps) => JSX.Element | null;
10
+ FormActions: ({ formRef, onPrimaryButtonClick, }: import("../../../types").FormActionWrapperProps) => JSX.Element | null;
11
11
  FormWrapper: ({ children }: import("../../../types").FormWrapperProps) => JSX.Element | null;
12
12
  };
13
13
  export default Page;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { FormActionWrapperProps } from '../../../types';
3
- declare const PageFormActions: ({ formRef }: FormActionWrapperProps) => JSX.Element | null;
3
+ declare const PageFormActions: ({ formRef, onPrimaryButtonClick, }: FormActionWrapperProps) => JSX.Element | null;
4
4
  export default PageFormActions;
@@ -230,6 +230,7 @@ export interface FormWrapperProps {
230
230
  }
231
231
  export interface FormActionWrapperProps {
232
232
  formRef: MutableRefObject<HTMLFormElement | null>;
233
+ onPrimaryButtonClick?: (e?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
233
234
  }
234
235
  export interface SchemaType extends ReactSelectProps {
235
236
  label?: string;
@@ -275,6 +276,7 @@ export interface PageProps {
275
276
  preConfirmDelete?: (data: {
276
277
  row: ObjectType;
277
278
  }) => Promise<boolean>;
279
+ onPrimaryButtonClick?: (e?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
278
280
  }
279
281
  export interface PaginationProps {
280
282
  totalPages: number;