@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.
- package/README.md +7 -0
- package/index.d.ts +5 -0
- package/index.js +7030 -0
- package/lib/api/index.d.ts +10 -0
- package/lib/api/list.d.ts +48 -0
- package/lib/components/Page/AddButton/AddButton.d.ts +3 -0
- package/lib/components/Page/AddButton/index.d.ts +2 -0
- package/lib/components/Page/Form/PageForm.d.ts +4 -0
- package/lib/components/Page/Form/index.d.ts +2 -0
- package/lib/components/Page/Page/Page.d.ts +4 -0
- package/lib/components/Page/Page/index.d.ts +2 -0
- package/lib/components/Page/Pagination/PagePagination.d.ts +3 -0
- package/lib/components/Page/Pagination/index.d.ts +2 -0
- package/lib/components/Page/Search/PageSearch.d.ts +3 -0
- package/lib/components/Page/Search/index.d.ts +2 -0
- package/lib/components/Page/Table/PageTable.d.ts +3 -0
- package/lib/components/Page/Table/index.d.ts +2 -0
- package/lib/components/Page/index.d.ts +2 -0
- package/lib/components/Widget/AddButton/AddButton.d.ts +3 -0
- package/lib/components/Widget/AddButton/index.d.ts +2 -0
- package/lib/components/Widget/Form/TileItemsAccordian.d.ts +4 -0
- package/lib/components/Widget/Form/WidgetForm.d.ts +4 -0
- package/lib/components/Widget/Form/index.d.ts +2 -0
- package/lib/components/Widget/Pagination/WidgetPagination.d.ts +3 -0
- package/lib/components/Widget/Pagination/index.d.ts +2 -0
- package/lib/components/Widget/Search/WidgetSearch.d.ts +3 -0
- package/lib/components/Widget/Search/index.d.ts +2 -0
- package/lib/components/Widget/Table/WidgetTable.d.ts +3 -0
- package/lib/components/Widget/Table/index.d.ts +2 -0
- package/lib/components/Widget/Widget/Widget.d.ts +7 -0
- package/lib/components/Widget/Widget/index.d.ts +2 -0
- package/lib/components/Widget/index.d.ts +2 -0
- package/lib/components/common/Accordian/Accordian.d.ts +13 -0
- package/lib/components/common/Accordian/index.d.ts +2 -0
- package/lib/components/common/Button/Button.d.ts +4 -0
- package/lib/components/common/Button/index.d.ts +2 -0
- package/lib/components/common/DNDItemsList/DNDItemsList.d.ts +4 -0
- package/lib/components/common/DNDItemsList/index.d.ts +2 -0
- package/lib/components/common/DeleteModal/DeleteModal.d.ts +4 -0
- package/lib/components/common/DeleteModal/index.d.ts +2 -0
- package/lib/components/common/Drawer/Drawer.d.ts +9 -0
- package/lib/components/common/Drawer/index.d.ts +2 -0
- package/lib/components/common/Form/Form.d.ts +15 -0
- package/lib/components/common/Form/index.d.ts +2 -0
- package/lib/components/common/ImageUpload/ImageUpload.d.ts +4 -0
- package/lib/components/common/ImageUpload/index.d.ts +2 -0
- package/lib/components/common/Input/Checkbox.d.ts +4 -0
- package/lib/components/common/Input/Input.d.ts +4 -0
- package/lib/components/common/Input/ReactSelect.d.ts +4 -0
- package/lib/components/common/Input/Select.d.ts +4 -0
- package/lib/components/common/Input/index.d.ts +10 -0
- package/lib/components/common/Modal/Modal.d.ts +8 -0
- package/lib/components/common/Modal/index.d.ts +2 -0
- package/lib/components/common/Pagination/Pagination.d.ts +4 -0
- package/lib/components/common/Pagination/index.d.ts +2 -0
- package/lib/components/common/Table/Table.d.ts +4 -0
- package/lib/components/common/Table/index.d.ts +2 -0
- package/lib/components/common/Toggle/Toggle.d.ts +4 -0
- package/lib/components/common/Toggle/index.d.ts +2 -0
- package/lib/constants/common.d.ts +100 -0
- package/lib/context/PageContext.d.ts +7 -0
- package/lib/context/ProviderContext.d.ts +5 -0
- package/lib/context/WidgetContext.d.ts +7 -0
- package/lib/helper/utils.d.ts +11 -0
- package/lib/hooks/usePage.d.ts +39 -0
- package/lib/hooks/usePagination.d.ts +27 -0
- package/lib/hooks/useWidget.d.ts +45 -0
- package/lib/icons/chevronDown.d.ts +4 -0
- package/lib/icons/chevronLeft.d.ts +4 -0
- package/lib/icons/chevronRight.d.ts +4 -0
- package/lib/icons/chevronUp.d.ts +4 -0
- package/lib/icons/close.d.ts +4 -0
- package/lib/icons/pencil.d.ts +4 -0
- package/lib/icons/trash.d.ts +4 -0
- package/lib/types/api.d.ts +29 -0
- package/lib/types/common.d.ts +20 -0
- package/lib/types/components.d.ts +257 -0
- package/lib/types/context.d.ts +93 -0
- package/lib/types/index.d.ts +4 -0
- 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,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,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,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,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,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,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,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,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,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,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;
|