@knovator/pagecreator-admin 0.3.0 → 0.3.2
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 +7119 -0
- package/index.css +590 -51
- package/index.js +163 -308
- package/package.json +8 -7
- package/index.d.ts +0 -5
- package/lib/api/index.d.ts +0 -10
- package/lib/api/list.d.ts +0 -48
- package/lib/components/Page/AddButton/AddButton.d.ts +0 -3
- package/lib/components/Page/AddButton/index.d.ts +0 -2
- package/lib/components/Page/Form/PageForm.d.ts +0 -4
- package/lib/components/Page/Form/index.d.ts +0 -2
- package/lib/components/Page/Page/Page.d.ts +0 -13
- package/lib/components/Page/Page/index.d.ts +0 -2
- package/lib/components/Page/PageFormActions/PageFormActions.d.ts +0 -4
- package/lib/components/Page/PageFormActions/index.d.ts +0 -2
- package/lib/components/Page/PageFormWrapper/PageFormWrapper.d.ts +0 -4
- package/lib/components/Page/PageFormWrapper/index.d.ts +0 -2
- package/lib/components/Page/Pagination/PagePagination.d.ts +0 -3
- package/lib/components/Page/Pagination/index.d.ts +0 -2
- package/lib/components/Page/Search/PageSearch.d.ts +0 -3
- package/lib/components/Page/Search/index.d.ts +0 -2
- package/lib/components/Page/Table/PageTable.d.ts +0 -3
- package/lib/components/Page/Table/index.d.ts +0 -2
- package/lib/components/Page/index.d.ts +0 -2
- package/lib/components/Widget/AddButton/AddButton.d.ts +0 -3
- package/lib/components/Widget/AddButton/index.d.ts +0 -2
- package/lib/components/Widget/Form/ItemsAccordian.d.ts +0 -4
- package/lib/components/Widget/Form/WidgetForm.d.ts +0 -4
- package/lib/components/Widget/Form/index.d.ts +0 -2
- package/lib/components/Widget/Pagination/WidgetPagination.d.ts +0 -3
- package/lib/components/Widget/Pagination/index.d.ts +0 -2
- package/lib/components/Widget/Search/WidgetSearch.d.ts +0 -3
- package/lib/components/Widget/Search/index.d.ts +0 -2
- package/lib/components/Widget/Table/WidgetTable.d.ts +0 -3
- package/lib/components/Widget/Table/index.d.ts +0 -2
- package/lib/components/Widget/Widget/Widget.d.ts +0 -13
- package/lib/components/Widget/Widget/index.d.ts +0 -2
- package/lib/components/Widget/WidgetFormActions/WidgetFormActions.d.ts +0 -4
- package/lib/components/Widget/WidgetFormActions/index.d.ts +0 -2
- package/lib/components/Widget/WidgetFormWrapper/WidgetFormWrapper.d.ts +0 -4
- package/lib/components/Widget/WidgetFormWrapper/index.d.ts +0 -2
- package/lib/components/Widget/index.d.ts +0 -2
- package/lib/components/common/Accordian/Accordian.d.ts +0 -13
- package/lib/components/common/Accordian/index.d.ts +0 -2
- package/lib/components/common/Button/Button.d.ts +0 -4
- package/lib/components/common/Button/index.d.ts +0 -2
- package/lib/components/common/DNDItemsList/DNDItemsList.d.ts +0 -4
- package/lib/components/common/DNDItemsList/index.d.ts +0 -2
- package/lib/components/common/DeleteModal/DeleteModal.d.ts +0 -4
- package/lib/components/common/DeleteModal/index.d.ts +0 -2
- package/lib/components/common/Drawer/Drawer.d.ts +0 -9
- package/lib/components/common/Drawer/index.d.ts +0 -2
- package/lib/components/common/Form/Form.d.ts +0 -15
- package/lib/components/common/Form/SimpleForm.d.ts +0 -17
- package/lib/components/common/Form/index.d.ts +0 -4
- package/lib/components/common/FormActions/FormActions.d.ts +0 -10
- package/lib/components/common/FormActions/index.d.ts +0 -2
- package/lib/components/common/ImageUpload/ImageUpload.d.ts +0 -4
- package/lib/components/common/ImageUpload/index.d.ts +0 -2
- package/lib/components/common/Input/Checkbox.d.ts +0 -4
- package/lib/components/common/Input/Input.d.ts +0 -4
- package/lib/components/common/Input/ReactSelect.d.ts +0 -4
- package/lib/components/common/Input/Select.d.ts +0 -4
- package/lib/components/common/Input/SrcSet.d.ts +0 -4
- package/lib/components/common/Input/index.d.ts +0 -12
- package/lib/components/common/Modal/Modal.d.ts +0 -8
- package/lib/components/common/Modal/index.d.ts +0 -2
- package/lib/components/common/Pagination/Pagination.d.ts +0 -4
- package/lib/components/common/Pagination/index.d.ts +0 -2
- package/lib/components/common/Table/Table.d.ts +0 -4
- package/lib/components/common/Table/index.d.ts +0 -2
- package/lib/components/common/Toggle/Toggle.d.ts +0 -4
- package/lib/components/common/Toggle/index.d.ts +0 -2
- package/lib/constants/common.d.ts +0 -105
- package/lib/context/PageContext.d.ts +0 -7
- package/lib/context/ProviderContext.d.ts +0 -5
- package/lib/context/WidgetContext.d.ts +0 -7
- package/lib/helper/utils.d.ts +0 -11
- package/lib/hooks/usePage.d.ts +0 -39
- package/lib/hooks/usePagination.d.ts +0 -27
- package/lib/hooks/useWidget.d.ts +0 -49
- package/lib/icons/chevronDown.d.ts +0 -4
- package/lib/icons/chevronLeft.d.ts +0 -4
- package/lib/icons/chevronRight.d.ts +0 -4
- package/lib/icons/chevronUp.d.ts +0 -4
- package/lib/icons/close.d.ts +0 -4
- package/lib/icons/pencil.d.ts +0 -4
- package/lib/icons/plus.d.ts +0 -4
- package/lib/icons/trash.d.ts +0 -4
- package/lib/types/api.d.ts +0 -34
- package/lib/types/common.d.ts +0 -25
- package/lib/types/components.d.ts +0 -255
- package/lib/types/context.d.ts +0 -96
- package/lib/types/index.d.ts +0 -4
|
@@ -1,7 +0,0 @@
|
|
|
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;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ProviderContextProviderProps, ProviderContextType } from '../types';
|
|
3
|
-
declare const Provider: ({ children, baseUrl, token, onError, onSuccess, onLogout, switchClass, itemsRoutesPrefix, widgetRoutesPrefix, pageRoutesPrefix, }: ProviderContextProviderProps) => JSX.Element;
|
|
4
|
-
export declare function useProviderState(): ProviderContextType;
|
|
5
|
-
export default Provider;
|
|
@@ -1,7 +0,0 @@
|
|
|
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, onDeleteItem, getWidgets, onImageUpload, onImageRemove, itemsTypes, widgetTypes, getCollectionData, collectionDataLoading, collectionData, formatListItem, formatOptionLabel, currentPage, limits, pageSize, setCurrentPage, setPageSize, totalPages, totalRecords, canList, canPartialUpdate, columns, data, canDelete, loader, onPartialUpdateWidget, webItems, mobileItems, itemsLoading, onItemFormSubmit, children, }: WidgetContextProviderProps) => JSX.Element;
|
|
6
|
-
export declare function useWidgetState(): WidgetContextType;
|
|
7
|
-
export default WidgetContextProvider;
|
package/lib/helper/utils.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
package/lib/hooks/usePage.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
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;
|
|
@@ -1,27 +0,0 @@
|
|
|
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;
|
package/lib/hooks/useWidget.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Routes_Input, WidgetType, ItemsType } 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
|
-
interface ItemsList {
|
|
12
|
-
web: ObjectType[];
|
|
13
|
-
mobile: ObjectType[];
|
|
14
|
-
}
|
|
15
|
-
declare const useWidget: ({ defaultLimit, routes, preConfirmDelete, }: UseWidgetProps) => {
|
|
16
|
-
list: ObjectType[];
|
|
17
|
-
getWidgets: (search?: string) => Promise<void>;
|
|
18
|
-
loading: boolean;
|
|
19
|
-
setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
20
|
-
pageSize: number;
|
|
21
|
-
totalPages: number;
|
|
22
|
-
currentPage: number;
|
|
23
|
-
totalRecords: number;
|
|
24
|
-
setCurrentPage: (value: number) => void;
|
|
25
|
-
setPageSize: (value: number) => void;
|
|
26
|
-
formState: FormActionTypes | undefined;
|
|
27
|
-
itemData: ObjectType | null;
|
|
28
|
-
onChangeFormState: (state: FormActionTypes, data?: ObjectType) => void;
|
|
29
|
-
onCloseForm: () => void;
|
|
30
|
-
onDeleteItem: (id: string) => Promise<void>;
|
|
31
|
-
onWidgetFormSubmit: (data: ObjectType) => Promise<void>;
|
|
32
|
-
onCofirmDeleteWidget: () => Promise<void>;
|
|
33
|
-
onPartialUpdateWidget: (data: ObjectType, id: string) => Promise<void>;
|
|
34
|
-
onImageUpload: (file: File) => Promise<{
|
|
35
|
-
fileUrl: string;
|
|
36
|
-
fileId: string;
|
|
37
|
-
fileUri: string;
|
|
38
|
-
} | void>;
|
|
39
|
-
onImageRemove: (id: string) => Promise<void>;
|
|
40
|
-
itemsTypes: ItemsType[];
|
|
41
|
-
widgetTypes: WidgetType[];
|
|
42
|
-
collectionDataLoading: boolean;
|
|
43
|
-
getCollectionData: (collectionName: string, search?: string) => Promise<void>;
|
|
44
|
-
collectionData: any[];
|
|
45
|
-
itemsList: ItemsList;
|
|
46
|
-
itemsLoading: boolean;
|
|
47
|
-
onItemFormSubmit: (state: FormActionTypes, data: ObjectType, updateId?: string) => Promise<void>;
|
|
48
|
-
};
|
|
49
|
-
export default useWidget;
|
package/lib/icons/chevronUp.d.ts
DELETED
package/lib/icons/close.d.ts
DELETED
package/lib/icons/pencil.d.ts
DELETED
package/lib/icons/plus.d.ts
DELETED
package/lib/icons/trash.d.ts
DELETED
package/lib/types/api.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export declare type ACTION_TYPES = 'IMAGE_UPLOAD' | 'IMAGE_REMOVE' | 'CREATE' | 'LIST' | 'DELETE' | 'UPDATE' | 'ITEM' | 'PARTIAL_UPDATE' | 'WIDGET_TYPES' | 'SELECTION_TYPES' | 'COLLECTION_DATA';
|
|
2
|
-
export declare type API_TYPE = {
|
|
3
|
-
url: string;
|
|
4
|
-
method: string;
|
|
5
|
-
};
|
|
6
|
-
export declare type API_INPUT_TYPE = {
|
|
7
|
-
prefix: string;
|
|
8
|
-
id?: string;
|
|
9
|
-
};
|
|
10
|
-
export declare type Routes_Input = {
|
|
11
|
-
[K in ACTION_TYPES]?: (data: API_INPUT_TYPE) => API_TYPE;
|
|
12
|
-
};
|
|
13
|
-
export declare type ItemsType = {
|
|
14
|
-
value: string;
|
|
15
|
-
label: string;
|
|
16
|
-
};
|
|
17
|
-
export declare type WidgetType = {
|
|
18
|
-
value: string;
|
|
19
|
-
label: string;
|
|
20
|
-
};
|
|
21
|
-
export interface BaseAPIProps {
|
|
22
|
-
config?: any;
|
|
23
|
-
baseUrl: string;
|
|
24
|
-
token: string | (() => Promise<string>);
|
|
25
|
-
data?: any;
|
|
26
|
-
url: string;
|
|
27
|
-
method: string;
|
|
28
|
-
onError?: (error: Error) => void;
|
|
29
|
-
}
|
|
30
|
-
export interface ResponseType {
|
|
31
|
-
message: string;
|
|
32
|
-
code: 'SUCCESS' | 'FAILED';
|
|
33
|
-
data: any;
|
|
34
|
-
}
|
package/lib/types/common.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare type FormActionTypes = 'ADD' | 'UPDATE' | 'DELETE' | null | '';
|
|
2
|
-
export declare type TFunc = (key: string) => string;
|
|
3
|
-
export declare type OptionType = {
|
|
4
|
-
label: string;
|
|
5
|
-
value: string;
|
|
6
|
-
};
|
|
7
|
-
export interface PermissionsObj {
|
|
8
|
-
list: boolean;
|
|
9
|
-
add: boolean;
|
|
10
|
-
update: boolean;
|
|
11
|
-
partialUpdate: boolean;
|
|
12
|
-
delete: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare type ObjectType = {
|
|
15
|
-
[key: string]: string;
|
|
16
|
-
};
|
|
17
|
-
export declare type CombineObjectType = {
|
|
18
|
-
[key: string]: string | boolean | number | string[] | null | CombineObjectType;
|
|
19
|
-
};
|
|
20
|
-
export declare type ValuesType = string | boolean | number | string[];
|
|
21
|
-
export interface SrcSetItem {
|
|
22
|
-
screenSize: number | string;
|
|
23
|
-
width: number | string;
|
|
24
|
-
height: number | string;
|
|
25
|
-
}
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import React, { MutableRefObject } from 'react';
|
|
2
|
-
import { DropResult } from 'react-beautiful-dnd';
|
|
3
|
-
import { RegisterOptions } from 'react-hook-form';
|
|
4
|
-
import { Routes_Input } from './api';
|
|
5
|
-
import { OptionType, FormActionTypes, PermissionsObj, ObjectType } from './common';
|
|
6
|
-
export interface DNDItemsListProps {
|
|
7
|
-
onDragEnd: (result: DropResult) => void;
|
|
8
|
-
items: OptionType[];
|
|
9
|
-
listCode?: string;
|
|
10
|
-
formatItem?: (code: string, data: any) => JSX.Element;
|
|
11
|
-
}
|
|
12
|
-
export interface DrawerProps {
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
open: boolean;
|
|
15
|
-
onClose?: () => void;
|
|
16
|
-
id?: string;
|
|
17
|
-
name?: string;
|
|
18
|
-
title?: string;
|
|
19
|
-
}
|
|
20
|
-
export declare type ButtonTypes = 'primary' | 'secondary' | 'success' | 'danger';
|
|
21
|
-
export declare type ButtonSizes = 'xs' | 'sm' | 'base' | 'lg';
|
|
22
|
-
export interface ButtonProps {
|
|
23
|
-
children?: React.ReactNode;
|
|
24
|
-
type?: ButtonTypes;
|
|
25
|
-
size?: ButtonSizes;
|
|
26
|
-
onClick?: () => void;
|
|
27
|
-
className?: string;
|
|
28
|
-
disabled?: boolean;
|
|
29
|
-
}
|
|
30
|
-
export interface IconProps {
|
|
31
|
-
srText?: string;
|
|
32
|
-
className?: string;
|
|
33
|
-
}
|
|
34
|
-
export declare type InputSizes = 'xs' | 'sm' | 'base' | 'lg';
|
|
35
|
-
export interface InputProps {
|
|
36
|
-
id?: string;
|
|
37
|
-
label?: string;
|
|
38
|
-
placeholder?: string;
|
|
39
|
-
type?: string;
|
|
40
|
-
size?: InputSizes;
|
|
41
|
-
className?: string;
|
|
42
|
-
error?: string;
|
|
43
|
-
errors?: any;
|
|
44
|
-
required?: boolean;
|
|
45
|
-
disabled?: boolean;
|
|
46
|
-
rest?: any;
|
|
47
|
-
wrapperClassName?: string;
|
|
48
|
-
onInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
49
|
-
value?: string | number;
|
|
50
|
-
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
51
|
-
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
52
|
-
control?: any;
|
|
53
|
-
register?: any;
|
|
54
|
-
}
|
|
55
|
-
export interface CheckboxProps {
|
|
56
|
-
rest?: any;
|
|
57
|
-
label?: string;
|
|
58
|
-
error?: string;
|
|
59
|
-
className?: string;
|
|
60
|
-
disabled?: boolean;
|
|
61
|
-
wrapperClassName?: string;
|
|
62
|
-
switchClass?: string;
|
|
63
|
-
}
|
|
64
|
-
export interface SelectProps {
|
|
65
|
-
value?: string | number;
|
|
66
|
-
onChange?: (e: React.ChangeEvent<HTMLSelectElement>) => void;
|
|
67
|
-
label?: string;
|
|
68
|
-
error?: string;
|
|
69
|
-
options?: {
|
|
70
|
-
value: string;
|
|
71
|
-
label: string;
|
|
72
|
-
}[];
|
|
73
|
-
className?: string;
|
|
74
|
-
disabled?: boolean;
|
|
75
|
-
size?: InputSizes;
|
|
76
|
-
id?: string;
|
|
77
|
-
rest?: any;
|
|
78
|
-
required?: boolean;
|
|
79
|
-
wrapperClassName?: string;
|
|
80
|
-
}
|
|
81
|
-
export interface ReactSelectProps {
|
|
82
|
-
onChange?: (opt: OptionType[] | OptionType | null) => void;
|
|
83
|
-
label?: string;
|
|
84
|
-
error?: string;
|
|
85
|
-
options?: {
|
|
86
|
-
value: string;
|
|
87
|
-
label: string;
|
|
88
|
-
}[];
|
|
89
|
-
className?: string;
|
|
90
|
-
disabled?: boolean;
|
|
91
|
-
id?: string;
|
|
92
|
-
isMulti?: boolean;
|
|
93
|
-
required?: boolean;
|
|
94
|
-
selectedOptions?: {
|
|
95
|
-
value: string;
|
|
96
|
-
label: string;
|
|
97
|
-
}[];
|
|
98
|
-
isLoading?: boolean;
|
|
99
|
-
isSearchable?: boolean;
|
|
100
|
-
onSearch?: (text: string) => void;
|
|
101
|
-
placeholder?: string;
|
|
102
|
-
formatOptionLabel?: (code: string, data: any) => JSX.Element;
|
|
103
|
-
listCode?: string;
|
|
104
|
-
wrapperClassName?: string;
|
|
105
|
-
}
|
|
106
|
-
export interface FormProps {
|
|
107
|
-
formRef: MutableRefObject<HTMLFormElement | null>;
|
|
108
|
-
}
|
|
109
|
-
export interface InputRendererProps {
|
|
110
|
-
field: import('react-hook-form').ControllerRenderProps;
|
|
111
|
-
error?: string;
|
|
112
|
-
setError: (msg: string) => void;
|
|
113
|
-
disabled?: boolean;
|
|
114
|
-
}
|
|
115
|
-
export interface WidgetProps {
|
|
116
|
-
t?: any;
|
|
117
|
-
loader?: any;
|
|
118
|
-
routes?: Routes_Input;
|
|
119
|
-
explicitForm?: boolean;
|
|
120
|
-
permissions?: PermissionsObj;
|
|
121
|
-
formatListItem?: (code: string, data: any) => JSX.Element;
|
|
122
|
-
formatOptionLabel?: (code: string, data: any) => JSX.Element;
|
|
123
|
-
preConfirmDelete?: (data: {
|
|
124
|
-
row: ObjectType;
|
|
125
|
-
}) => Promise<boolean>;
|
|
126
|
-
children?: JSX.Element;
|
|
127
|
-
}
|
|
128
|
-
export interface FormWrapperProps {
|
|
129
|
-
children: (data: {
|
|
130
|
-
formState: FormActionTypes | undefined;
|
|
131
|
-
onClose: () => void;
|
|
132
|
-
open: boolean;
|
|
133
|
-
}) => JSX.Element | null;
|
|
134
|
-
}
|
|
135
|
-
export interface FormActionWrapperProps {
|
|
136
|
-
formRef: MutableRefObject<HTMLFormElement | null>;
|
|
137
|
-
}
|
|
138
|
-
export interface SchemaType extends ReactSelectProps {
|
|
139
|
-
label?: string;
|
|
140
|
-
accessor: string;
|
|
141
|
-
Input?: (props: InputRendererProps) => JSX.Element;
|
|
142
|
-
validations?: RegisterOptions;
|
|
143
|
-
editable?: boolean;
|
|
144
|
-
onInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
145
|
-
type?: 'text' | 'number' | 'select' | 'checkbox' | 'textarea' | 'file' | 'url' | 'ReactSelect' | 'srcset';
|
|
146
|
-
options?: {
|
|
147
|
-
value: string;
|
|
148
|
-
label: string;
|
|
149
|
-
}[];
|
|
150
|
-
selectedOptions?: {
|
|
151
|
-
value: string;
|
|
152
|
-
label: string;
|
|
153
|
-
}[];
|
|
154
|
-
isMulti?: boolean;
|
|
155
|
-
placeholder?: string;
|
|
156
|
-
required?: boolean;
|
|
157
|
-
onChange?: (e: any) => void;
|
|
158
|
-
show?: boolean;
|
|
159
|
-
wrapperClassName?: string;
|
|
160
|
-
switchClass?: string;
|
|
161
|
-
}
|
|
162
|
-
export interface PageProps {
|
|
163
|
-
t?: any;
|
|
164
|
-
loader?: any;
|
|
165
|
-
explicitForm?: boolean;
|
|
166
|
-
permissions?: PermissionsObj;
|
|
167
|
-
children?: JSX.Element;
|
|
168
|
-
}
|
|
169
|
-
export interface PaginationProps {
|
|
170
|
-
totalPages: number;
|
|
171
|
-
totalRecords: number;
|
|
172
|
-
currentPage: number;
|
|
173
|
-
pageSize: number;
|
|
174
|
-
setCurrentPage: (value: number) => void;
|
|
175
|
-
showingText?: string;
|
|
176
|
-
pageText?: string;
|
|
177
|
-
ofText?: string;
|
|
178
|
-
}
|
|
179
|
-
export interface ItemsAccordianProps {
|
|
180
|
-
id: string;
|
|
181
|
-
show: boolean;
|
|
182
|
-
title: string;
|
|
183
|
-
itemsData: any[];
|
|
184
|
-
widgetId: string;
|
|
185
|
-
collapseId: string;
|
|
186
|
-
schema: SchemaType[];
|
|
187
|
-
itemType: 'Web' | 'Mobile';
|
|
188
|
-
toggleShow: (status: boolean) => void;
|
|
189
|
-
onDataSubmit: (state: FormActionTypes, data: any, updateId?: string) => void;
|
|
190
|
-
onDelete: (id: string) => void;
|
|
191
|
-
addText?: string;
|
|
192
|
-
editText?: string;
|
|
193
|
-
cancelText?: string;
|
|
194
|
-
deleteText?: string;
|
|
195
|
-
saveText?: string;
|
|
196
|
-
}
|
|
197
|
-
export interface ImageUploadProps {
|
|
198
|
-
className?: string;
|
|
199
|
-
text: string | JSX.Element;
|
|
200
|
-
maxSize: number;
|
|
201
|
-
imgId?: string | ObjectType;
|
|
202
|
-
setImgId: (value?: string | null) => void;
|
|
203
|
-
clearError?: () => void;
|
|
204
|
-
onError: (msg: string) => void;
|
|
205
|
-
onImageUpload: (file: File) => Promise<{
|
|
206
|
-
fileUrl: string;
|
|
207
|
-
fileId: string;
|
|
208
|
-
fileUri: string;
|
|
209
|
-
} | void>;
|
|
210
|
-
onImageRemove?: (id: string) => Promise<void>;
|
|
211
|
-
baseUrl: string;
|
|
212
|
-
error?: string;
|
|
213
|
-
disabled?: boolean;
|
|
214
|
-
}
|
|
215
|
-
export interface ToggleProps {
|
|
216
|
-
isChecked?: boolean;
|
|
217
|
-
disabled?: boolean;
|
|
218
|
-
onChange?: (status: boolean) => void;
|
|
219
|
-
switchClass?: string;
|
|
220
|
-
}
|
|
221
|
-
export interface DeleteModalProps {
|
|
222
|
-
formState: FormActionTypes | undefined;
|
|
223
|
-
onClose: () => void;
|
|
224
|
-
itemData: ObjectType;
|
|
225
|
-
onConfirmDelete: () => void;
|
|
226
|
-
permanentlyDelete?: string;
|
|
227
|
-
lossOfData?: string;
|
|
228
|
-
pleaseType?: string;
|
|
229
|
-
toProceedOrCancel?: string;
|
|
230
|
-
confirm?: string;
|
|
231
|
-
}
|
|
232
|
-
export declare type CellInputType = (parameters: {
|
|
233
|
-
row: any;
|
|
234
|
-
onUpdate?: (row: any) => void;
|
|
235
|
-
}) => JSX.Element | null | string;
|
|
236
|
-
export declare type TableDataItemFormat = {
|
|
237
|
-
label: string;
|
|
238
|
-
dataKey: string;
|
|
239
|
-
highlight?: boolean;
|
|
240
|
-
Cell?: CellInputType;
|
|
241
|
-
};
|
|
242
|
-
export interface TableProps {
|
|
243
|
-
data: any[];
|
|
244
|
-
dataKeys: TableDataItemFormat[];
|
|
245
|
-
loading?: boolean;
|
|
246
|
-
loader?: any;
|
|
247
|
-
actions?: {
|
|
248
|
-
edit?: (data: {
|
|
249
|
-
[key: string]: any;
|
|
250
|
-
}) => void;
|
|
251
|
-
delete?: (data: {
|
|
252
|
-
[key: string]: any;
|
|
253
|
-
}) => void;
|
|
254
|
-
};
|
|
255
|
-
}
|
package/lib/types/context.d.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { WidgetType, ItemsType } from './api';
|
|
3
|
-
import { FormActionTypes, OptionType } from './common';
|
|
4
|
-
export interface ProviderContextType {
|
|
5
|
-
baseUrl: string;
|
|
6
|
-
token: string | (() => Promise<string>);
|
|
7
|
-
onError: (callback_code: import('../constants/common').CALLBACK_CODES, code: string, message: string) => void;
|
|
8
|
-
onSuccess: (callback_code: import('../constants/common').CALLBACK_CODES, code: string, message: string) => void;
|
|
9
|
-
switchClass: string;
|
|
10
|
-
onLogout: () => void;
|
|
11
|
-
widgetRoutesPrefix: string;
|
|
12
|
-
itemsRoutesPrefix: string;
|
|
13
|
-
pageRoutesPrefix: string;
|
|
14
|
-
}
|
|
15
|
-
export interface ProviderContextProviderProps extends React.PropsWithChildren, Omit<ProviderContextType, 'onError' | 'onSuccess' | 'onLogout' | 'widgetRoutesPrefix' | 'itemsRoutesPrefix' | 'pageRoutesPrefix' | 'switchClass'> {
|
|
16
|
-
onError?: (callback_code: import('../constants/common').CALLBACK_CODES, code: string, message: string) => void;
|
|
17
|
-
onSuccess?: (callback_code: import('../constants/common').CALLBACK_CODES, code: string, message: string) => void;
|
|
18
|
-
onLogout?: () => void;
|
|
19
|
-
switchClass?: string;
|
|
20
|
-
widgetRoutesPrefix?: string;
|
|
21
|
-
itemsRoutesPrefix?: string;
|
|
22
|
-
pageRoutesPrefix?: string;
|
|
23
|
-
}
|
|
24
|
-
export interface WidgetContextType {
|
|
25
|
-
t: (key: string) => string;
|
|
26
|
-
list: any[];
|
|
27
|
-
formState: FormActionTypes | undefined;
|
|
28
|
-
closeForm: () => void;
|
|
29
|
-
onWidgetFormSubmit: (data: any) => void;
|
|
30
|
-
onChangeFormState: (status: FormActionTypes, data?: any) => void;
|
|
31
|
-
updateData: any;
|
|
32
|
-
loading: boolean;
|
|
33
|
-
canAdd: boolean;
|
|
34
|
-
canUpdate: boolean;
|
|
35
|
-
onDeleteItem: (id: string) => void;
|
|
36
|
-
getWidgets: (searchText: string) => void;
|
|
37
|
-
onImageUpload: (file: File) => Promise<{
|
|
38
|
-
fileUrl: string;
|
|
39
|
-
fileId: string;
|
|
40
|
-
fileUri: string;
|
|
41
|
-
} | void>;
|
|
42
|
-
onImageRemove: (id: string) => Promise<void>;
|
|
43
|
-
itemsTypes: ItemsType[];
|
|
44
|
-
widgetTypes: WidgetType[];
|
|
45
|
-
getCollectionData: (collectionName: string, search?: string) => Promise<void>;
|
|
46
|
-
collectionDataLoading: boolean;
|
|
47
|
-
collectionData: any[];
|
|
48
|
-
formatListItem?: (code: string, data: any) => JSX.Element;
|
|
49
|
-
formatOptionLabel?: (code: string, data: any) => JSX.Element;
|
|
50
|
-
currentPage: number;
|
|
51
|
-
setCurrentPage: (page: number) => void;
|
|
52
|
-
totalPages: number;
|
|
53
|
-
pageSize: number;
|
|
54
|
-
setPageSize: (size: number) => void;
|
|
55
|
-
totalRecords: number;
|
|
56
|
-
limits: number[];
|
|
57
|
-
canList: boolean;
|
|
58
|
-
canPartialUpdate: boolean;
|
|
59
|
-
columns: any[];
|
|
60
|
-
data: any;
|
|
61
|
-
loader?: JSX.Element;
|
|
62
|
-
canDelete?: boolean;
|
|
63
|
-
onPartialUpdateWidget: (data: any, id: string) => Promise<void>;
|
|
64
|
-
webItems: any[];
|
|
65
|
-
mobileItems: any[];
|
|
66
|
-
itemsLoading: boolean;
|
|
67
|
-
onItemFormSubmit: (state: FormActionTypes, data: any) => void;
|
|
68
|
-
}
|
|
69
|
-
export interface PageContextType {
|
|
70
|
-
t: (key: string) => string;
|
|
71
|
-
list: any[];
|
|
72
|
-
formState: FormActionTypes | undefined;
|
|
73
|
-
closeForm: () => void;
|
|
74
|
-
onPageFormSubmit: (data: any) => void;
|
|
75
|
-
onChangeFormState: (status: FormActionTypes, data?: any) => void;
|
|
76
|
-
loading: boolean;
|
|
77
|
-
canAdd: boolean;
|
|
78
|
-
canUpdate: boolean;
|
|
79
|
-
widgets: any[];
|
|
80
|
-
selectedWidgets: OptionType[];
|
|
81
|
-
setSelectedWidgets: (widgets: OptionType[]) => void;
|
|
82
|
-
onChangeWidgetSequence: (souceIndex: number, destinationIndex: number) => void;
|
|
83
|
-
getPages: (searchText: string) => void;
|
|
84
|
-
currentPage: number;
|
|
85
|
-
setCurrentPage: (page: number) => void;
|
|
86
|
-
totalPages: number;
|
|
87
|
-
pageSize: number;
|
|
88
|
-
setPageSize: (size: number) => void;
|
|
89
|
-
totalRecords: number;
|
|
90
|
-
limits: number[];
|
|
91
|
-
canList: boolean;
|
|
92
|
-
columns: any[];
|
|
93
|
-
data: any;
|
|
94
|
-
loader?: JSX.Element;
|
|
95
|
-
canDelete?: boolean;
|
|
96
|
-
}
|
package/lib/types/index.d.ts
DELETED