@knovator/pagecreator-admin 0.0.1

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.
Files changed (80) hide show
  1. package/README.md +7 -0
  2. package/index.d.ts +5 -0
  3. package/index.js +7030 -0
  4. package/lib/api/index.d.ts +10 -0
  5. package/lib/api/list.d.ts +48 -0
  6. package/lib/components/Page/AddButton/AddButton.d.ts +3 -0
  7. package/lib/components/Page/AddButton/index.d.ts +2 -0
  8. package/lib/components/Page/Form/PageForm.d.ts +4 -0
  9. package/lib/components/Page/Form/index.d.ts +2 -0
  10. package/lib/components/Page/Page/Page.d.ts +4 -0
  11. package/lib/components/Page/Page/index.d.ts +2 -0
  12. package/lib/components/Page/Pagination/PagePagination.d.ts +3 -0
  13. package/lib/components/Page/Pagination/index.d.ts +2 -0
  14. package/lib/components/Page/Search/PageSearch.d.ts +3 -0
  15. package/lib/components/Page/Search/index.d.ts +2 -0
  16. package/lib/components/Page/Table/PageTable.d.ts +3 -0
  17. package/lib/components/Page/Table/index.d.ts +2 -0
  18. package/lib/components/Page/index.d.ts +2 -0
  19. package/lib/components/Widget/AddButton/AddButton.d.ts +3 -0
  20. package/lib/components/Widget/AddButton/index.d.ts +2 -0
  21. package/lib/components/Widget/Form/TileItemsAccordian.d.ts +4 -0
  22. package/lib/components/Widget/Form/WidgetForm.d.ts +4 -0
  23. package/lib/components/Widget/Form/index.d.ts +2 -0
  24. package/lib/components/Widget/Pagination/WidgetPagination.d.ts +3 -0
  25. package/lib/components/Widget/Pagination/index.d.ts +2 -0
  26. package/lib/components/Widget/Search/WidgetSearch.d.ts +3 -0
  27. package/lib/components/Widget/Search/index.d.ts +2 -0
  28. package/lib/components/Widget/Table/WidgetTable.d.ts +3 -0
  29. package/lib/components/Widget/Table/index.d.ts +2 -0
  30. package/lib/components/Widget/Widget/Widget.d.ts +7 -0
  31. package/lib/components/Widget/Widget/index.d.ts +2 -0
  32. package/lib/components/Widget/index.d.ts +2 -0
  33. package/lib/components/common/Accordian/Accordian.d.ts +13 -0
  34. package/lib/components/common/Accordian/index.d.ts +2 -0
  35. package/lib/components/common/Button/Button.d.ts +4 -0
  36. package/lib/components/common/Button/index.d.ts +2 -0
  37. package/lib/components/common/DNDItemsList/DNDItemsList.d.ts +4 -0
  38. package/lib/components/common/DNDItemsList/index.d.ts +2 -0
  39. package/lib/components/common/DeleteModal/DeleteModal.d.ts +4 -0
  40. package/lib/components/common/DeleteModal/index.d.ts +2 -0
  41. package/lib/components/common/Drawer/Drawer.d.ts +9 -0
  42. package/lib/components/common/Drawer/index.d.ts +2 -0
  43. package/lib/components/common/Form/Form.d.ts +15 -0
  44. package/lib/components/common/Form/index.d.ts +2 -0
  45. package/lib/components/common/ImageUpload/ImageUpload.d.ts +4 -0
  46. package/lib/components/common/ImageUpload/index.d.ts +2 -0
  47. package/lib/components/common/Input/Checkbox.d.ts +4 -0
  48. package/lib/components/common/Input/Input.d.ts +4 -0
  49. package/lib/components/common/Input/ReactSelect.d.ts +4 -0
  50. package/lib/components/common/Input/Select.d.ts +4 -0
  51. package/lib/components/common/Input/index.d.ts +10 -0
  52. package/lib/components/common/Modal/Modal.d.ts +8 -0
  53. package/lib/components/common/Modal/index.d.ts +2 -0
  54. package/lib/components/common/Pagination/Pagination.d.ts +4 -0
  55. package/lib/components/common/Pagination/index.d.ts +2 -0
  56. package/lib/components/common/Table/Table.d.ts +4 -0
  57. package/lib/components/common/Table/index.d.ts +2 -0
  58. package/lib/components/common/Toggle/Toggle.d.ts +4 -0
  59. package/lib/components/common/Toggle/index.d.ts +2 -0
  60. package/lib/constants/common.d.ts +100 -0
  61. package/lib/context/PageContext.d.ts +7 -0
  62. package/lib/context/ProviderContext.d.ts +5 -0
  63. package/lib/context/WidgetContext.d.ts +7 -0
  64. package/lib/helper/utils.d.ts +11 -0
  65. package/lib/hooks/usePage.d.ts +39 -0
  66. package/lib/hooks/usePagination.d.ts +27 -0
  67. package/lib/hooks/useWidget.d.ts +45 -0
  68. package/lib/icons/chevronDown.d.ts +4 -0
  69. package/lib/icons/chevronLeft.d.ts +4 -0
  70. package/lib/icons/chevronRight.d.ts +4 -0
  71. package/lib/icons/chevronUp.d.ts +4 -0
  72. package/lib/icons/close.d.ts +4 -0
  73. package/lib/icons/pencil.d.ts +4 -0
  74. package/lib/icons/trash.d.ts +4 -0
  75. package/lib/types/api.d.ts +29 -0
  76. package/lib/types/common.d.ts +20 -0
  77. package/lib/types/components.d.ts +257 -0
  78. package/lib/types/context.d.ts +93 -0
  79. package/lib/types/index.d.ts +4 -0
  80. package/package.json +39 -0
@@ -0,0 +1,10 @@
1
+ import { ACTION_TYPES, API_TYPE, BaseAPIProps, Routes_Input } from '../types';
2
+ declare const commonApi: ({ data, config, baseUrl, token, url, method, onError, }: BaseAPIProps) => Promise<any>;
3
+ declare const getApiType: ({ routes, action, prefix, id, }: {
4
+ routes?: Routes_Input | undefined;
5
+ action: ACTION_TYPES;
6
+ prefix: string;
7
+ id?: string | undefined;
8
+ }) => API_TYPE;
9
+ export default commonApi;
10
+ export { getApiType };
@@ -0,0 +1,48 @@
1
+ import { API_INPUT_TYPE } from '../types';
2
+ declare const apiList: {
3
+ LIST: ({ prefix }: API_INPUT_TYPE) => {
4
+ url: string;
5
+ method: string;
6
+ };
7
+ CREATE: ({ prefix }: API_INPUT_TYPE) => {
8
+ url: string;
9
+ method: string;
10
+ };
11
+ UPDATE: ({ prefix, id }: API_INPUT_TYPE) => {
12
+ url: string;
13
+ method: string;
14
+ };
15
+ PARTIAL_UPDATE: ({ prefix, id }: API_INPUT_TYPE) => {
16
+ url: string;
17
+ method: string;
18
+ };
19
+ DELETE: ({ prefix, id }: API_INPUT_TYPE) => {
20
+ url: string;
21
+ method: string;
22
+ };
23
+ WIDGET_TYPES: ({ prefix }: API_INPUT_TYPE) => {
24
+ url: string;
25
+ method: string;
26
+ };
27
+ SELECTION_TYPES: ({ prefix }: API_INPUT_TYPE) => {
28
+ url: string;
29
+ method: string;
30
+ };
31
+ TILES: ({ prefix, id }: API_INPUT_TYPE) => {
32
+ url: string;
33
+ method: string;
34
+ };
35
+ COLLECTION_DATA: ({ prefix }: API_INPUT_TYPE) => {
36
+ url: string;
37
+ method: string;
38
+ };
39
+ IMAGE_UPLOAD: ({ prefix }: API_INPUT_TYPE) => {
40
+ url: string;
41
+ method: string;
42
+ };
43
+ IMAGE_REMOVE: ({ prefix, id }: API_INPUT_TYPE) => {
44
+ url: string;
45
+ method: string;
46
+ };
47
+ };
48
+ export default apiList;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const AddButton: () => JSX.Element;
3
+ export default AddButton;
@@ -0,0 +1,2 @@
1
+ import AddButton from "./AddButton";
2
+ export default AddButton;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { FormProps } from '../../../types';
3
+ declare const PageForm: ({ onClose, open, formState }: FormProps) => JSX.Element | null;
4
+ export default PageForm;
@@ -0,0 +1,2 @@
1
+ import PageForm from "./PageForm";
2
+ export default PageForm;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { PageProps } from '../../../types';
3
+ declare const Page: ({ t, loader, permissions }: PageProps) => JSX.Element;
4
+ export default Page;
@@ -0,0 +1,2 @@
1
+ import Page from "./Page";
2
+ export default Page;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const PagePagination: () => JSX.Element;
3
+ export default PagePagination;
@@ -0,0 +1,2 @@
1
+ import PagePagination from "./PagePagination";
2
+ export default PagePagination;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const PageSearch: () => JSX.Element;
3
+ export default PageSearch;
@@ -0,0 +1,2 @@
1
+ import PageSearch from "./PageSearch";
2
+ export default PageSearch;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const PageTable: () => JSX.Element | null;
3
+ export default PageTable;
@@ -0,0 +1,2 @@
1
+ import PageTable from "./PageTable";
2
+ export default PageTable;
@@ -0,0 +1,2 @@
1
+ import Page from "./Page";
2
+ export { Page };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const AddButton: () => JSX.Element;
3
+ export default AddButton;
@@ -0,0 +1,2 @@
1
+ import AddButton from "./AddButton";
2
+ export default AddButton;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { TileItemsAccordianProps } from '../../../types';
3
+ declare const TileItemsAccordian: ({ schema, onDataSubmit, show, title, id, tilesData, collapseId, toggleShow, tileType, widgetId, onDelete, addText, saveText, cancelText, deleteText, editText, }: TileItemsAccordianProps) => JSX.Element;
4
+ export default TileItemsAccordian;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { FormProps } from '../../../types';
3
+ declare const WidgetForm: ({ onClose, open, formState }: FormProps) => JSX.Element | null;
4
+ export default WidgetForm;
@@ -0,0 +1,2 @@
1
+ import MasterForm from "./WidgetForm";
2
+ export default MasterForm;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const WidgetPagination: () => JSX.Element;
3
+ export default WidgetPagination;
@@ -0,0 +1,2 @@
1
+ import WidgetPagination from "./WidgetPagination";
2
+ export default WidgetPagination;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const WidgetSearch: () => JSX.Element;
3
+ export default WidgetSearch;
@@ -0,0 +1,2 @@
1
+ import WidgetSearch from "./WidgetSearch";
2
+ export default WidgetSearch;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const WidgetTable: () => JSX.Element | null;
3
+ export default WidgetTable;
@@ -0,0 +1,2 @@
1
+ import WidgetTable from "./WidgetTable";
2
+ export default WidgetTable;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { WidgetProps } from '../../../types';
3
+ declare const Widget: {
4
+ ({ t, loader, permissions, formatListItem, formatOptionLabel, }: WidgetProps): JSX.Element;
5
+ Table: () => JSX.Element | null;
6
+ };
7
+ export default Widget;
@@ -0,0 +1,2 @@
1
+ import Widget from "./Widget";
2
+ export default Widget;
@@ -0,0 +1,2 @@
1
+ import Widget from "./Widget";
2
+ export { Widget };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ interface AccordianProps {
3
+ id?: string;
4
+ collapseId?: string;
5
+ className?: string;
6
+ children?: React.ReactNode;
7
+ open?: boolean;
8
+ onToggle?: (status: boolean) => void;
9
+ title?: string;
10
+ footerContent?: React.ReactNode;
11
+ }
12
+ declare const Accordian: ({ id, className, children, open, onToggle, title, collapseId, footerContent, }: AccordianProps) => JSX.Element;
13
+ export default Accordian;
@@ -0,0 +1,2 @@
1
+ import Accordian from "./Accordian";
2
+ export default Accordian;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from '../../../types';
3
+ declare const Button: ({ type, size, onClick, className, children, disabled, }: ButtonProps) => JSX.Element;
4
+ export default Button;
@@ -0,0 +1,2 @@
1
+ import Button from "./Button";
2
+ export default Button;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { DNDItemsListProps } from '../../../types';
3
+ declare const DNDItemsList: ({ onDragEnd, items, formatItem, listCode, }: DNDItemsListProps) => JSX.Element;
4
+ export default DNDItemsList;
@@ -0,0 +1,2 @@
1
+ import DNDItemsList from "./DNDItemsList";
2
+ export default DNDItemsList;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { DeleteModalProps } from '../../../types';
3
+ declare const DeleteModal: ({ formState, onClose, itemData, onConfirmDelete, permanentlyDelete, lossOfData, pleaseType, toProceedOrCancel, confirm, }: DeleteModalProps) => JSX.Element | null;
4
+ export default DeleteModal;
@@ -0,0 +1,2 @@
1
+ import DeleteModal from "./DeleteModal";
2
+ export default DeleteModal;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface DrawerProps extends React.PropsWithChildren {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ title?: string;
6
+ footerContent?: React.ReactNode;
7
+ }
8
+ declare const Drawer: ({ children, open, onClose, title, footerContent, }: DrawerProps) => JSX.Element;
9
+ export default Drawer;
@@ -0,0 +1,2 @@
1
+ import Drawer from "./Drawer";
2
+ export default Drawer;
@@ -0,0 +1,15 @@
1
+ import React, { MutableRefObject } from 'react';
2
+ import { EventType } from 'react-hook-form';
3
+ import { CombineObjectType, ObjectType, SchemaType } from '../../../types';
4
+ interface FormProps {
5
+ schema: SchemaType[];
6
+ data?: CombineObjectType;
7
+ isUpdating?: boolean;
8
+ onSubmit: (data: CombineObjectType) => void;
9
+ enable?: boolean;
10
+ updates?: CombineObjectType;
11
+ ref: MutableRefObject<HTMLFormElement | null>;
12
+ watcher?: (value: ObjectType, name: string | undefined, type: EventType | undefined) => void;
13
+ }
14
+ declare const Form: React.ForwardRefExoticComponent<Pick<FormProps, "schema" | "onSubmit" | "data" | "isUpdating" | "enable" | "updates" | "watcher"> & React.RefAttributes<HTMLFormElement | null>>;
15
+ export default Form;
@@ -0,0 +1,2 @@
1
+ import Form from "./Form";
2
+ export default Form;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ImageUploadProps } from '../../../types';
3
+ declare const _default: React.MemoExoticComponent<({ className, text, maxSize, setImgId, onError, error, imgId, onImageUpload, onImageRemove, baseUrl, disabled, }: ImageUploadProps) => JSX.Element>;
4
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import ImageUpload from "./ImageUpload";
2
+ export default ImageUpload;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { CheckboxProps } from '../../../types';
3
+ declare const Checkbox: ({ rest, label, error, wrapperClassName, disabled, }: CheckboxProps) => JSX.Element;
4
+ export default Checkbox;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { InputProps } from '../../../types';
3
+ declare const Input: ({ label, id, placeholder, type, size, required, error, className, disabled, rest, onInput, onBlur, value, onChange, wrapperClassName, }: InputProps) => JSX.Element;
4
+ export default Input;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { ReactSelectProps } from '../../../types';
3
+ declare const CustomReactSelect: ({ onChange, label, error, options, className, isMulti, selectedOptions, required, isLoading, isSearchable, onSearch, placeholder, wrapperClassName, formatOptionLabel, listCode, }: ReactSelectProps) => JSX.Element;
4
+ export default CustomReactSelect;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { SelectProps } from '../../../types';
3
+ declare const Select: ({ onChange, value, rest, label, error, options, size, className, disabled, required, wrapperClassName, }: SelectProps) => JSX.Element;
4
+ export default Select;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import Checkbox from "./Checkbox";
3
+ import Select from "./Select";
4
+ import ReactSelect from "./ReactSelect";
5
+ declare const _default: (({ label, id, placeholder, type, size, required, error, className, disabled, rest, onInput, onBlur, value, onChange, wrapperClassName, }: import("../../../types").InputProps) => JSX.Element) & {
6
+ Select: typeof Select;
7
+ ReactSelect: typeof ReactSelect;
8
+ Checkbox: typeof Checkbox;
9
+ };
10
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ interface ModalProps extends React.PropsWithChildren {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ title?: string;
6
+ }
7
+ declare const Modal: ({ open, onClose, title, children }: ModalProps) => JSX.Element;
8
+ export default Modal;
@@ -0,0 +1,2 @@
1
+ import Modal from "./Modal";
2
+ export default Modal;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { PaginationProps } from '../../../types';
3
+ declare const Pagination: ({ currentPage, pageSize, totalPages, totalRecords, setCurrentPage, showingText, pageText, ofText, }: PaginationProps) => JSX.Element;
4
+ export default Pagination;
@@ -0,0 +1,2 @@
1
+ import Pagination from "./Pagination";
2
+ export default Pagination;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { TableProps } from '../../../types';
3
+ declare const Table: ({ data, dataKeys, actions, loader, loading }: TableProps) => JSX.Element;
4
+ export default Table;
@@ -0,0 +1,2 @@
1
+ import Table from './Table';
2
+ export default Table;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { ToggleProps } from '../../../types';
3
+ declare const Toggle: ({ isChecked, disabled, onChange }: ToggleProps) => JSX.Element;
4
+ export default Toggle;
@@ -0,0 +1,2 @@
1
+ import Toggle from "./Toggle";
2
+ export default Toggle;
@@ -0,0 +1,100 @@
1
+ declare const DEFAULT_OFFSET_PAYLOAD = 0;
2
+ declare const DECIMAL_REDIX = 10;
3
+ declare const DEFAULT_CURRENT_PAGE = 1;
4
+ declare const INTERNAL_ERROR_CODE = "INTERNAL_ERROR";
5
+ declare const DEFAULT_LIMIT = 10;
6
+ declare const PAGE_LIMITS: number[];
7
+ declare enum CALLBACK_CODES {
8
+ 'GET_ALL' = "GET_ALL",
9
+ 'GET_SINGLE' = "GET_SINGLE",
10
+ 'CREATE' = "CREATE",
11
+ 'UPDATE' = "UPDATE",
12
+ 'PARTIAL_UPDATE' = "PARTIAL_UPDATE",
13
+ 'DELETE' = "DELETE",
14
+ 'IMAGE_UPLOAD' = "IMAGE_UPLOAD",
15
+ 'IMAGE_REMOVE' = "IMAGE_REMOVE",
16
+ 'INTERNAL' = "INTERNAL"
17
+ }
18
+ declare const DEFAULT_PERMISSIONS: {
19
+ list: boolean;
20
+ add: boolean;
21
+ delete: boolean;
22
+ partialUpdate: boolean;
23
+ update: boolean;
24
+ };
25
+ declare const TRANSLATION_PAIRS_COMMON: {
26
+ permanentlyDelete: string;
27
+ lossOfData: string;
28
+ pleaseType: string;
29
+ toProceedOrCancel: string;
30
+ confirm: string;
31
+ 'common:actions': string;
32
+ 'common:cancel': string;
33
+ page: string;
34
+ next: string;
35
+ previous: string;
36
+ indicatesRequired: string;
37
+ addButtonText: string;
38
+ editButtonText: string;
39
+ cancelButtonText: string;
40
+ deleteButtonText: string;
41
+ saveButtonText: string;
42
+ showing: string;
43
+ of: string;
44
+ };
45
+ declare const TRANSLATION_PAIRS_WIDGET: {
46
+ 'widget.name': string;
47
+ 'widget.namePlaceholder': string;
48
+ 'widget.nameRequired': string;
49
+ 'widget.selectionTitle': string;
50
+ 'widget.selectionTitlePlaceholder': string;
51
+ 'widget.selectionTitleRequired': string;
52
+ 'widget.widgetType': string;
53
+ 'widget.widgetTypePlaceholder': string;
54
+ 'widget.selectionType': string;
55
+ 'widget.selectionTypeRequired': string;
56
+ 'widget.code': string;
57
+ 'widget.codePlaceholder': string;
58
+ 'widget.codeRequired': string;
59
+ 'widget.webPerRow': string;
60
+ 'widget.webPerRowPlaceholder': string;
61
+ 'widget.mobilePerRow': string;
62
+ 'widget.mobilePerRowPlaceholder': string;
63
+ 'widget.tabletPerRow': string;
64
+ 'widget.tabletPerRowPlaceholder': string;
65
+ 'widget.imageItems': string;
66
+ 'widget.searchPlaceholder': string;
67
+ 'widget.autoPlay': string;
68
+ 'widget.tableName': string;
69
+ 'widget.tableCode': string;
70
+ 'widget.tableActive': string;
71
+ 'widget.addWidgetTitle': string;
72
+ 'widget.updateWidgetTitle': string;
73
+ };
74
+ declare const TRANSLATION_PAIRS_TILES: {
75
+ 'tile.title': string;
76
+ 'tile.titlePlaceholder': string;
77
+ 'tile.altText': string;
78
+ 'tile.altTextPlaceholder': string;
79
+ 'tile.link': string;
80
+ 'tile.linkPlaceholder': string;
81
+ 'tile.image': string;
82
+ 'tile.uploadFile': string;
83
+ 'tile.dragDrop': string;
84
+ 'tile.allowedFormat': string;
85
+ };
86
+ declare const TRANSLATION_PAIRS_PAGE: {
87
+ 'page.name': string;
88
+ 'page.namePlaceholder': string;
89
+ 'page.nameRequired': string;
90
+ 'page.code': string;
91
+ 'page.codePlaceholder': string;
92
+ 'page.codeRequired': string;
93
+ 'page.addPageTitle': string;
94
+ 'page.updatePageTitle': string;
95
+ 'page.searchPages': string;
96
+ 'page.tableName': string;
97
+ 'page.tableCode': string;
98
+ 'page.widgets': string;
99
+ };
100
+ export { CALLBACK_CODES, DECIMAL_REDIX, DEFAULT_CURRENT_PAGE, DEFAULT_OFFSET_PAYLOAD, INTERNAL_ERROR_CODE, DEFAULT_PERMISSIONS, TRANSLATION_PAIRS_COMMON, DEFAULT_LIMIT, PAGE_LIMITS, TRANSLATION_PAIRS_WIDGET, TRANSLATION_PAIRS_TILES, TRANSLATION_PAIRS_PAGE, };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { PageContextType } from '../types';
3
+ interface PageContextProviderProps extends React.PropsWithChildren, Partial<PageContextType> {
4
+ }
5
+ declare const PageContextProvider: ({ t, list, widgets, formState, closeForm, getPages, loading, onChangeFormState, onPageFormSubmit, canAdd, canUpdate, selectedWidgets, setSelectedWidgets, onChangeWidgetSequence, currentPage, limits, pageSize, setCurrentPage, setPageSize, totalPages, totalRecords, canList, columns, data, canDelete, loader, children, }: PageContextProviderProps) => JSX.Element;
6
+ export declare function usePageState(): PageContextType;
7
+ export default PageContextProvider;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { ProviderContextProviderProps, ProviderContextType } from '../types';
3
+ declare const Provider: ({ children, baseUrl, token, onError, onSuccess, onLogout, tilesRoutesPrefix, widgetRoutesPrefix, pageRoutesPrefix, }: ProviderContextProviderProps) => JSX.Element;
4
+ export declare function useProviderState(): ProviderContextType;
5
+ export default Provider;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { WidgetContextType } from '../types';
3
+ interface WidgetContextProviderProps extends React.PropsWithChildren, Partial<WidgetContextType> {
4
+ }
5
+ declare const WidgetContextProvider: ({ t, list, formState, closeForm, loading, onChangeFormState, onWidgetFormSubmit, updateData, canAdd, canUpdate, onDeleteTile, getWidgets, onImageUpload, onImageRemove, widgetTypes, selectionTypes, getCollectionData, collectionDataLoading, collectionData, formatListItem, formatOptionLabel, currentPage, limits, pageSize, setCurrentPage, setPageSize, totalPages, totalRecords, canList, canPartialUpdate, columns, data, canDelete, loader, onPartialUpdateWidget, tilesList, tilesLoading, onTileFormSubmit, children, }: WidgetContextProviderProps) => JSX.Element;
6
+ export declare function useWidgetState(): WidgetContextType;
7
+ export default WidgetContextProvider;
@@ -0,0 +1,11 @@
1
+ import { TFunc } from '../types';
2
+ export declare const paginationDataGatter: (data: any) => any;
3
+ export declare const dataGatter: (data: any) => any;
4
+ export declare const capitalizeFirstLetter: (string?: string) => string;
5
+ export declare const changeToCode: (string?: string) => string;
6
+ export declare const isObject: (data: any) => boolean;
7
+ export declare const isString: (data: any) => boolean;
8
+ export declare const isArray: (data: any) => boolean;
9
+ export declare const isEmpty: (data: any) => boolean;
10
+ export declare function createTranslation(t: TFunc | undefined, obj: Record<string, string>): (key: string) => string;
11
+ export declare const build_path: (...args: string[]) => string;
@@ -0,0 +1,39 @@
1
+ /// <reference types="react" />
2
+ import { FormActionTypes, ObjectType, Routes_Input } from '../types';
3
+ interface UsePageProps {
4
+ defaultLimit: number;
5
+ routes?: Routes_Input;
6
+ preConfirmDelete?: (data: {
7
+ row: ObjectType;
8
+ }) => Promise<boolean>;
9
+ }
10
+ declare const usePage: ({ defaultLimit, routes, preConfirmDelete }: UsePageProps) => {
11
+ list: ObjectType[];
12
+ getPages: (search?: string) => Promise<void>;
13
+ loading: boolean;
14
+ setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
15
+ pageSize: number;
16
+ totalPages: number;
17
+ currentPage: number;
18
+ totalRecords: number;
19
+ setCurrentPage: (value: number) => void;
20
+ setPageSize: (value: number) => void;
21
+ widgets: ObjectType[];
22
+ itemData: any;
23
+ formState: FormActionTypes | undefined;
24
+ onCloseForm: () => void;
25
+ widgetsLoading: boolean;
26
+ selectedWidgets: {
27
+ label: string;
28
+ value: string;
29
+ }[];
30
+ setSelectedWidgets: import("react").Dispatch<import("react").SetStateAction<{
31
+ label: string;
32
+ value: string;
33
+ }[]>>;
34
+ onPageFormSubmit: (data: ObjectType) => Promise<void>;
35
+ onChangeFormState: (state: FormActionTypes, data?: any) => void;
36
+ onCofirmDeletePage: () => Promise<void>;
37
+ onChangeWidgetSequence: (sourceIndex: number, destinationIndex: number) => void;
38
+ };
39
+ export default usePage;
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ interface UsePaginationProps {
3
+ defaultLimit?: number;
4
+ }
5
+ declare const usePagination: ({ defaultLimit }: UsePaginationProps) => {
6
+ pageSize: number;
7
+ setPageSize: (value: number) => void;
8
+ currentPage: number;
9
+ changeSearch: (value: string) => void;
10
+ filter: {
11
+ search: string;
12
+ offset: number;
13
+ limit: number;
14
+ };
15
+ setCurrentPage: (value: number) => void;
16
+ defaultApiPayload: {
17
+ search: string;
18
+ offset: number;
19
+ limit: number;
20
+ };
21
+ setFilter: import("react").Dispatch<import("react").SetStateAction<{
22
+ search: string;
23
+ offset: number;
24
+ limit: number;
25
+ }>>;
26
+ };
27
+ export default usePagination;
@@ -0,0 +1,45 @@
1
+ /// <reference types="react" />
2
+ import { Routes_Input, SelectionType, WidgetType } from '../types';
3
+ import { FormActionTypes, ObjectType } from '../types/common';
4
+ interface UseWidgetProps {
5
+ defaultLimit: number;
6
+ routes?: Routes_Input;
7
+ preConfirmDelete?: (data: {
8
+ row: ObjectType;
9
+ }) => Promise<boolean>;
10
+ }
11
+ declare const useWidget: ({ defaultLimit, routes, preConfirmDelete, }: UseWidgetProps) => {
12
+ list: ObjectType[];
13
+ getWidgets: (search?: string) => Promise<void>;
14
+ loading: boolean;
15
+ setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
16
+ pageSize: number;
17
+ totalPages: number;
18
+ currentPage: number;
19
+ totalRecords: number;
20
+ setCurrentPage: (value: number) => void;
21
+ setPageSize: (value: number) => void;
22
+ formState: FormActionTypes | undefined;
23
+ itemData: ObjectType | null;
24
+ onChangeFormState: (state: FormActionTypes, data?: ObjectType) => void;
25
+ onCloseForm: () => void;
26
+ onDeleteTile: (id: string) => Promise<void>;
27
+ onWidgetFormSubmit: (data: ObjectType) => Promise<void>;
28
+ onCofirmDeleteWidget: () => Promise<void>;
29
+ onPartialUpdateWidget: (data: ObjectType, id: string) => Promise<void>;
30
+ onImageUpload: (file: File) => Promise<{
31
+ fileUrl: string;
32
+ fileId: string;
33
+ fileUri: string;
34
+ } | void>;
35
+ onImageRemove: (id: string) => Promise<void>;
36
+ widgetTypes: WidgetType[];
37
+ selectionTypes: SelectionType[];
38
+ collectionDataLoading: boolean;
39
+ getCollectionData: (collectionName: string, search?: string) => Promise<void>;
40
+ collectionData: any[];
41
+ tilesList: ObjectType[];
42
+ tilesLoading: boolean;
43
+ onTileFormSubmit: (state: FormActionTypes, data: ObjectType, updateId?: string) => Promise<void>;
44
+ };
45
+ export default useWidget;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from '../types';
3
+ declare const ChevronDown: ({ srText, className }: IconProps) => JSX.Element;
4
+ export default ChevronDown;