@knovator/pagecreator-admin 1.2.2 → 1.2.4
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 +205 -205
- package/index.d.ts +1 -0
- package/package.json +38 -42
- package/src/{index.d.ts → index.ts} +1 -0
- package/src/lib/api/index.ts +70 -0
- package/src/lib/api/list.ts +59 -0
- package/src/lib/components/Page/AddButton/AddButton.tsx +16 -0
- package/src/lib/components/Page/AddButton/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Page/Form/PageForm.tsx +194 -0
- package/src/lib/components/Page/Form/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Page/Page/Page.tsx +151 -0
- package/src/lib/components/Page/Page/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Page/PageFormActions/PageFormActions.tsx +50 -0
- package/src/lib/components/Page/PageFormActions/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Page/PageFormWrapper/PageFormWrapper.tsx +16 -0
- package/src/lib/components/Page/PageFormWrapper/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Page/Pagination/PagePagination.tsx +26 -0
- package/src/lib/components/Page/Pagination/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Page/Search/PageSearch.tsx +32 -0
- package/src/lib/components/Page/Search/{index.d.ts → index.tsx} +1 -0
- package/src/lib/components/Page/Table/PageTable.tsx +36 -0
- package/src/lib/components/Page/Table/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Page/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Widget/AddButton/AddButton.tsx +16 -0
- package/src/lib/components/Widget/AddButton/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Widget/Form/ItemsAccordian.tsx +354 -0
- package/src/lib/components/Widget/Form/Tabs/TabItem.tsx +43 -0
- package/src/lib/components/Widget/Form/Tabs/Tabs.tsx +190 -0
- package/src/lib/components/Widget/Form/Tabs/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Widget/Form/WidgetForm.tsx +771 -0
- package/src/lib/components/Widget/Form/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Widget/Pagination/WidgetPagination.tsx +26 -0
- package/src/lib/components/Widget/Pagination/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Widget/Search/WidgetSearch.tsx +32 -0
- package/src/lib/components/Widget/Search/{index.d.ts → index.tsx} +1 -0
- package/src/lib/components/Widget/Table/WidgetTable.tsx +70 -0
- package/src/lib/components/Widget/Table/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Widget/Widget/Widget.tsx +173 -0
- package/src/lib/components/Widget/Widget/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Widget/WidgetFormActions/WidgetFormActions.tsx +50 -0
- package/src/lib/components/Widget/WidgetFormActions/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Widget/WidgetFormWrapper/WidgetFormWrapper.tsx +16 -0
- package/src/lib/components/Widget/WidgetFormWrapper/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/Widget/{index.d.ts → index.tsx} +1 -0
- package/src/lib/components/common/Accordian/Accordian.tsx +56 -0
- package/src/lib/components/common/Accordian/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/common/Button/Button.tsx +45 -0
- package/src/lib/components/common/Button/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/common/ConfirmPopover/ConfirmPopover.tsx +47 -0
- package/src/lib/components/common/ConfirmPopover/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/common/DNDItemsList/DNDItemsList.tsx +53 -0
- package/src/lib/components/common/DNDItemsList/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/common/DeleteModal/DeleteModal.tsx +72 -0
- package/src/lib/components/common/DeleteModal/index.tsx +3 -0
- package/src/lib/components/common/Drawer/Drawer.tsx +79 -0
- package/src/lib/components/common/Drawer/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/common/Form/Form.tsx +256 -0
- package/src/lib/components/common/Form/SimpleForm.tsx +314 -0
- package/src/lib/components/common/Form/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/common/FormActions/FormActions.tsx +37 -0
- package/src/lib/components/common/FormActions/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/common/ImageUpload/ImageUpload.tsx +113 -0
- package/src/lib/components/common/ImageUpload/index.tsx +3 -0
- package/src/lib/components/common/Input/Checkbox.tsx +25 -0
- package/src/lib/components/common/Input/Input.tsx +51 -0
- package/src/lib/components/common/Input/ReactSelect.tsx +60 -0
- package/src/lib/components/common/Input/Select.tsx +47 -0
- package/src/lib/components/common/Input/SrcSet.tsx +143 -0
- package/src/lib/components/common/Input/index.ts +20 -0
- package/src/lib/components/common/Modal/Modal.tsx +57 -0
- package/src/lib/components/common/Modal/index.tsx +3 -0
- package/src/lib/components/common/Pagination/Pagination.tsx +88 -0
- package/src/lib/components/common/Pagination/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/common/Table/Table.tsx +133 -0
- package/src/lib/components/common/Table/{index.d.ts → index.ts} +1 -0
- package/src/lib/components/common/Toggle/Toggle.tsx +23 -0
- package/src/lib/components/common/Toggle/{index.d.ts → index.ts} +1 -0
- package/src/lib/constants/common.ts +145 -0
- package/src/lib/context/PageContext.tsx +100 -0
- package/src/lib/context/ProviderContext.tsx +52 -0
- package/src/lib/context/WidgetContext.tsx +127 -0
- package/src/lib/helper/utils.ts +46 -0
- package/src/lib/hooks/usePage.tsx +307 -0
- package/src/lib/hooks/usePagination.tsx +41 -0
- package/src/lib/hooks/useWidget.tsx +503 -0
- package/src/lib/icons/chevronDown.tsx +21 -0
- package/src/lib/icons/chevronLeft.tsx +20 -0
- package/src/lib/icons/chevronRight.tsx +20 -0
- package/src/lib/icons/chevronUp.tsx +21 -0
- package/src/lib/icons/close.tsx +21 -0
- package/src/lib/icons/pencil.tsx +21 -0
- package/src/lib/icons/plus.tsx +23 -0
- package/src/lib/icons/trash.tsx +21 -0
- package/src/lib/types/api.ts +44 -0
- package/src/lib/types/common.ts +31 -0
- package/src/lib/types/components.ts +427 -0
- package/src/lib/types/context.ts +184 -0
- package/src/styles/index.css +469 -0
- package/index.cjs +0 -7714
- package/index.css +0 -2258
- package/index.js +0 -7700
- package/src/lib/api/index.d.ts +0 -10
- package/src/lib/api/list.d.ts +0 -56
- package/src/lib/components/Page/AddButton/AddButton.d.ts +0 -3
- package/src/lib/components/Page/Form/PageForm.d.ts +0 -4
- package/src/lib/components/Page/Page/Page.d.ts +0 -13
- package/src/lib/components/Page/PageFormActions/PageFormActions.d.ts +0 -4
- package/src/lib/components/Page/PageFormWrapper/PageFormWrapper.d.ts +0 -4
- package/src/lib/components/Page/Pagination/PagePagination.d.ts +0 -3
- package/src/lib/components/Page/Search/PageSearch.d.ts +0 -3
- package/src/lib/components/Page/Table/PageTable.d.ts +0 -4
- package/src/lib/components/Widget/AddButton/AddButton.d.ts +0 -3
- package/src/lib/components/Widget/Form/ItemsAccordian.d.ts +0 -4
- package/src/lib/components/Widget/Form/Tabs/TabItem.d.ts +0 -4
- package/src/lib/components/Widget/Form/Tabs/Tabs.d.ts +0 -4
- package/src/lib/components/Widget/Form/WidgetForm.d.ts +0 -4
- package/src/lib/components/Widget/Pagination/WidgetPagination.d.ts +0 -3
- package/src/lib/components/Widget/Search/WidgetSearch.d.ts +0 -3
- package/src/lib/components/Widget/Table/WidgetTable.d.ts +0 -4
- package/src/lib/components/Widget/Widget/Widget.d.ts +0 -13
- package/src/lib/components/Widget/WidgetFormActions/WidgetFormActions.d.ts +0 -4
- package/src/lib/components/Widget/WidgetFormWrapper/WidgetFormWrapper.d.ts +0 -4
- package/src/lib/components/common/Accordian/Accordian.d.ts +0 -13
- package/src/lib/components/common/Button/Button.d.ts +0 -4
- package/src/lib/components/common/ConfirmPopover/ConfirmPopover.d.ts +0 -4
- package/src/lib/components/common/DNDItemsList/DNDItemsList.d.ts +0 -4
- package/src/lib/components/common/DeleteModal/DeleteModal.d.ts +0 -4
- package/src/lib/components/common/DeleteModal/index.d.ts +0 -2
- package/src/lib/components/common/Drawer/Drawer.d.ts +0 -9
- package/src/lib/components/common/Form/Form.d.ts +0 -15
- package/src/lib/components/common/Form/SimpleForm.d.ts +0 -18
- package/src/lib/components/common/FormActions/FormActions.d.ts +0 -10
- package/src/lib/components/common/ImageUpload/ImageUpload.d.ts +0 -4
- package/src/lib/components/common/ImageUpload/index.d.ts +0 -2
- package/src/lib/components/common/Input/Checkbox.d.ts +0 -4
- package/src/lib/components/common/Input/Input.d.ts +0 -4
- package/src/lib/components/common/Input/ReactSelect.d.ts +0 -4
- package/src/lib/components/common/Input/Select.d.ts +0 -4
- package/src/lib/components/common/Input/SrcSet.d.ts +0 -4
- package/src/lib/components/common/Input/index.d.ts +0 -12
- package/src/lib/components/common/Modal/Modal.d.ts +0 -8
- package/src/lib/components/common/Modal/index.d.ts +0 -2
- package/src/lib/components/common/Pagination/Pagination.d.ts +0 -4
- package/src/lib/components/common/Table/Table.d.ts +0 -4
- package/src/lib/components/common/Toggle/Toggle.d.ts +0 -4
- package/src/lib/constants/common.d.ts +0 -122
- package/src/lib/context/PageContext.d.ts +0 -7
- package/src/lib/context/ProviderContext.d.ts +0 -5
- package/src/lib/context/WidgetContext.d.ts +0 -7
- package/src/lib/helper/utils.d.ts +0 -10
- package/src/lib/hooks/usePage.d.ts +0 -43
- package/src/lib/hooks/usePagination.d.ts +0 -15
- package/src/lib/hooks/useWidget.d.ts +0 -46
- package/src/lib/icons/chevronDown.d.ts +0 -4
- package/src/lib/icons/chevronLeft.d.ts +0 -4
- package/src/lib/icons/chevronRight.d.ts +0 -4
- package/src/lib/icons/chevronUp.d.ts +0 -4
- package/src/lib/icons/close.d.ts +0 -4
- package/src/lib/icons/pencil.d.ts +0 -4
- package/src/lib/icons/plus.d.ts +0 -4
- package/src/lib/icons/trash.d.ts +0 -4
- package/src/lib/types/api.d.ts +0 -34
- package/src/lib/types/common.d.ts +0 -29
- package/src/lib/types/components.d.ts +0 -420
- package/src/lib/types/context.d.ts +0 -135
- /package/src/lib/types/{index.d.ts → index.ts} +0 -0
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Routes_Input, WidgetType, ItemsType } from '../types';
|
|
3
|
-
import { FormActionTypes, ObjectType, LanguageType } from '../types/common';
|
|
4
|
-
interface UseWidgetProps {
|
|
5
|
-
canList?: boolean;
|
|
6
|
-
defaultLimit: number;
|
|
7
|
-
routes?: Routes_Input;
|
|
8
|
-
preConfirmDelete?: (data: {
|
|
9
|
-
row: ObjectType;
|
|
10
|
-
}) => Promise<boolean>;
|
|
11
|
-
imageBaseUrl?: string;
|
|
12
|
-
}
|
|
13
|
-
declare const useWidget: ({ canList, defaultLimit, routes, preConfirmDelete, imageBaseUrl, }: UseWidgetProps) => {
|
|
14
|
-
list: ObjectType[];
|
|
15
|
-
getWidgets: (search?: string) => Promise<void>;
|
|
16
|
-
loading: boolean;
|
|
17
|
-
languages: LanguageType[];
|
|
18
|
-
setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
19
|
-
searchText: string;
|
|
20
|
-
pageSize: number;
|
|
21
|
-
totalPages: number;
|
|
22
|
-
currentPage: number;
|
|
23
|
-
totalRecords: number;
|
|
24
|
-
setCurrentPage: (page: number) => void;
|
|
25
|
-
setPageSize: (value: number) => void;
|
|
26
|
-
formState: FormActionTypes | undefined;
|
|
27
|
-
itemData: ObjectType | null;
|
|
28
|
-
onChangeFormState: (state: FormActionTypes, data?: ObjectType) => Promise<void>;
|
|
29
|
-
onCloseForm: () => void;
|
|
30
|
-
onWidgetFormSubmit: (data: ObjectType) => Promise<void>;
|
|
31
|
-
onCofirmDeleteWidget: () => Promise<void>;
|
|
32
|
-
onPartialUpdateWidget: (data: ObjectType, id: string) => Promise<void>;
|
|
33
|
-
onImageUpload: (file: File) => Promise<{
|
|
34
|
-
fileUrl: string;
|
|
35
|
-
fileId: string;
|
|
36
|
-
fileUri: string;
|
|
37
|
-
} | void>;
|
|
38
|
-
onImageRemove: (id: string) => Promise<void>;
|
|
39
|
-
itemsTypes: ItemsType[];
|
|
40
|
-
widgetTypes: WidgetType[];
|
|
41
|
-
changeSearch: (value: string) => void;
|
|
42
|
-
collectionDataLoading: boolean;
|
|
43
|
-
getCollectionData: (collectionName: string, search?: string, callback?: ((data: any) => void) | undefined, collectionItems?: string[]) => Promise<void>;
|
|
44
|
-
collectionData: any[];
|
|
45
|
-
};
|
|
46
|
-
export default useWidget;
|
package/src/lib/icons/close.d.ts
DELETED
package/src/lib/icons/plus.d.ts
DELETED
package/src/lib/icons/trash.d.ts
DELETED
package/src/lib/types/api.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export type ACTION_TYPES = 'IMAGE_UPLOAD' | 'IMAGE_REMOVE' | 'CREATE' | 'LIST' | 'DELETE' | 'UPDATE' | 'ITEM' | 'PARTIAL_UPDATE' | 'WIDGET_TYPES' | 'SELECTION_TYPES' | 'COLLECTION_DATA' | 'GET_ONE' | 'LANGUAGES';
|
|
2
|
-
export type API_TYPE = {
|
|
3
|
-
url: string;
|
|
4
|
-
method: string;
|
|
5
|
-
};
|
|
6
|
-
export type API_INPUT_TYPE = {
|
|
7
|
-
prefix: string;
|
|
8
|
-
id?: string;
|
|
9
|
-
};
|
|
10
|
-
export type Routes_Input = {
|
|
11
|
-
[K in ACTION_TYPES]?: (data: API_INPUT_TYPE) => API_TYPE;
|
|
12
|
-
};
|
|
13
|
-
export type ItemsType = {
|
|
14
|
-
value: string;
|
|
15
|
-
label: string;
|
|
16
|
-
};
|
|
17
|
-
export 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
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export type FormActionTypes = 'ADD' | 'UPDATE' | 'DELETE' | null | '';
|
|
2
|
-
export type TFunc = (key: string) => string;
|
|
3
|
-
export 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 type LanguageType = {
|
|
15
|
-
name: string;
|
|
16
|
-
code: string;
|
|
17
|
-
};
|
|
18
|
-
export type ObjectType = {
|
|
19
|
-
[key: string]: string;
|
|
20
|
-
};
|
|
21
|
-
export type CombineObjectType = {
|
|
22
|
-
[key: string]: string | boolean | number | string[] | null | Record<string | number, CombineObjectType> | CombineObjectType | CombineObjectType[];
|
|
23
|
-
};
|
|
24
|
-
export type ValuesType = string | boolean | number | string[];
|
|
25
|
-
export interface SrcSetItem {
|
|
26
|
-
screenSize: number | string;
|
|
27
|
-
width: number | string;
|
|
28
|
-
height: number | string;
|
|
29
|
-
}
|
|
@@ -1,420 +0,0 @@
|
|
|
1
|
-
import React, { MutableRefObject } from 'react';
|
|
2
|
-
import { DropResult } from 'react-beautiful-dnd';
|
|
3
|
-
import { FieldValues, RegisterOptions, UseFormClearErrors, UseFormGetValues, UseFormSetValue, ValidationRule } from 'react-hook-form';
|
|
4
|
-
import { Routes_Input } from './api';
|
|
5
|
-
import { OptionType, FormActionTypes, PermissionsObj, ObjectType, LanguageType } 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 type ButtonTypes = 'primary' | 'secondary' | 'success' | 'danger';
|
|
21
|
-
export 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
|
-
loading?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface IconProps {
|
|
32
|
-
srText?: string;
|
|
33
|
-
className?: string;
|
|
34
|
-
}
|
|
35
|
-
export type InputSizes = 'xs' | 'sm' | 'base' | 'lg';
|
|
36
|
-
export interface InputProps {
|
|
37
|
-
id?: string;
|
|
38
|
-
label?: string;
|
|
39
|
-
placeholder?: string;
|
|
40
|
-
type?: string;
|
|
41
|
-
size?: InputSizes;
|
|
42
|
-
className?: string;
|
|
43
|
-
error?: string;
|
|
44
|
-
errors?: any;
|
|
45
|
-
required?: boolean;
|
|
46
|
-
disabled?: boolean;
|
|
47
|
-
rest?: any;
|
|
48
|
-
wrapperClassName?: string;
|
|
49
|
-
onInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
50
|
-
value?: string | number;
|
|
51
|
-
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
52
|
-
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
53
|
-
control?: any;
|
|
54
|
-
register?: any;
|
|
55
|
-
info?: string;
|
|
56
|
-
name?: string;
|
|
57
|
-
}
|
|
58
|
-
export interface SrcSetMessageProps {
|
|
59
|
-
screenSizeRequired: string;
|
|
60
|
-
minScreenSize: string;
|
|
61
|
-
widthRequired: string;
|
|
62
|
-
minWidth: string;
|
|
63
|
-
heightRequired: string;
|
|
64
|
-
minHeight: string;
|
|
65
|
-
}
|
|
66
|
-
export interface HTMLEditorProps {
|
|
67
|
-
id?: string;
|
|
68
|
-
label?: string;
|
|
69
|
-
placeholder?: string;
|
|
70
|
-
value?: string;
|
|
71
|
-
wrapperClassName?: string;
|
|
72
|
-
onChange: (value: string) => void;
|
|
73
|
-
onInput?: (e: any) => void;
|
|
74
|
-
required?: boolean;
|
|
75
|
-
error?: string;
|
|
76
|
-
}
|
|
77
|
-
export interface CheckboxProps {
|
|
78
|
-
rest?: any;
|
|
79
|
-
label?: string;
|
|
80
|
-
error?: string;
|
|
81
|
-
className?: string;
|
|
82
|
-
disabled?: boolean;
|
|
83
|
-
wrapperClassName?: string;
|
|
84
|
-
switchClass?: string;
|
|
85
|
-
}
|
|
86
|
-
export interface SelectProps {
|
|
87
|
-
value?: string | number;
|
|
88
|
-
onChange?: (e: React.ChangeEvent<HTMLSelectElement>) => void;
|
|
89
|
-
label?: string;
|
|
90
|
-
error?: string;
|
|
91
|
-
options?: {
|
|
92
|
-
value: string;
|
|
93
|
-
label: string;
|
|
94
|
-
}[];
|
|
95
|
-
className?: string;
|
|
96
|
-
disabled?: boolean;
|
|
97
|
-
size?: InputSizes;
|
|
98
|
-
id?: string;
|
|
99
|
-
rest?: any;
|
|
100
|
-
required?: boolean;
|
|
101
|
-
wrapperClassName?: string;
|
|
102
|
-
}
|
|
103
|
-
export interface ReactSelectProps {
|
|
104
|
-
onChange?: (opt: OptionType[] | OptionType | null) => void;
|
|
105
|
-
label?: string;
|
|
106
|
-
error?: string;
|
|
107
|
-
options?: {
|
|
108
|
-
value: string;
|
|
109
|
-
label: string;
|
|
110
|
-
}[];
|
|
111
|
-
className?: string;
|
|
112
|
-
disabled?: boolean;
|
|
113
|
-
id?: string;
|
|
114
|
-
isMulti?: boolean;
|
|
115
|
-
required?: boolean;
|
|
116
|
-
selectedOptions?: {
|
|
117
|
-
value: string;
|
|
118
|
-
label: string;
|
|
119
|
-
}[];
|
|
120
|
-
isLoading?: boolean;
|
|
121
|
-
isSearchable?: boolean;
|
|
122
|
-
placeholder?: string;
|
|
123
|
-
formatOptionLabel?: (code: string, data: any) => JSX.Element;
|
|
124
|
-
listCode?: string;
|
|
125
|
-
wrapperClassName?: string;
|
|
126
|
-
customStyles?: any;
|
|
127
|
-
loadOptions?: (value?: string, callback?: (options: OptionType[]) => void) => Promise<OptionType[]>;
|
|
128
|
-
selectKey?: string;
|
|
129
|
-
}
|
|
130
|
-
export interface CustomInputType {
|
|
131
|
-
field: import('react-hook-form').ControllerRenderProps;
|
|
132
|
-
error?: string;
|
|
133
|
-
setError: (msg: string) => void;
|
|
134
|
-
}
|
|
135
|
-
export interface FormProps {
|
|
136
|
-
formRef: MutableRefObject<HTMLFormElement | null>;
|
|
137
|
-
customInputs?: Record<string, (props: InputRendererProps) => JSX.Element>;
|
|
138
|
-
}
|
|
139
|
-
export interface InputRendererProps {
|
|
140
|
-
field: import('react-hook-form').ControllerRenderProps;
|
|
141
|
-
error?: string;
|
|
142
|
-
setError: (msg: string) => void;
|
|
143
|
-
disabled?: boolean;
|
|
144
|
-
}
|
|
145
|
-
export interface WidgetTranslationPairs {
|
|
146
|
-
htmlContentRequired: string | ValidationRule<boolean> | undefined;
|
|
147
|
-
htmlContentPlaceholder: string | undefined;
|
|
148
|
-
htmlContent: string | undefined;
|
|
149
|
-
itemsType: string;
|
|
150
|
-
itemsTypePlaceholder: string;
|
|
151
|
-
widgetType: string;
|
|
152
|
-
widgetTypeRequired: string;
|
|
153
|
-
color: string;
|
|
154
|
-
webPerRow: string;
|
|
155
|
-
webPerRowPlaceholder: string;
|
|
156
|
-
mobilePerRow: string;
|
|
157
|
-
mobilePerRowPlaceholder: string;
|
|
158
|
-
tabletPerRow: string;
|
|
159
|
-
tabletPerRowPlaceholder: string;
|
|
160
|
-
mobileItems: string;
|
|
161
|
-
webItems: string;
|
|
162
|
-
searchPlaceholder: string;
|
|
163
|
-
autoPlay: string;
|
|
164
|
-
addWidgetTitle: string;
|
|
165
|
-
updateWidgetTitle: string;
|
|
166
|
-
webPerRowRequired: string;
|
|
167
|
-
tabletPerRowRequired: string;
|
|
168
|
-
mobilePerRowRequired: string;
|
|
169
|
-
tabDeleteTitle: string;
|
|
170
|
-
widgetTitleInfo: string;
|
|
171
|
-
minPerRow: string;
|
|
172
|
-
tabNameRequired: string;
|
|
173
|
-
subtitle: string;
|
|
174
|
-
subTitlePlaceholder: string;
|
|
175
|
-
altText: string;
|
|
176
|
-
altTextPlaceholder: string;
|
|
177
|
-
link: string;
|
|
178
|
-
linkPlaceholder: string;
|
|
179
|
-
image: string;
|
|
180
|
-
uploadFile: string;
|
|
181
|
-
dragDrop: string;
|
|
182
|
-
allowedFormat: string;
|
|
183
|
-
srcset: string;
|
|
184
|
-
screenSizeRequired: string;
|
|
185
|
-
widthRequired: string;
|
|
186
|
-
heightRequired: string;
|
|
187
|
-
minScreenSize: string;
|
|
188
|
-
minWidth: string;
|
|
189
|
-
minHeight: string;
|
|
190
|
-
deleteTitle: string;
|
|
191
|
-
textContent: string;
|
|
192
|
-
textContentRequired: string;
|
|
193
|
-
textContentInfo: string;
|
|
194
|
-
textContentPlaceholder: string;
|
|
195
|
-
}
|
|
196
|
-
export interface WidgetProps {
|
|
197
|
-
loader?: any;
|
|
198
|
-
routes?: Routes_Input;
|
|
199
|
-
explicitForm?: boolean;
|
|
200
|
-
permissions?: PermissionsObj;
|
|
201
|
-
formatListItem?: (code: string, data: any) => JSX.Element;
|
|
202
|
-
formatOptionLabel?: (code: string, data: any) => JSX.Element;
|
|
203
|
-
preConfirmDelete?: (data: {
|
|
204
|
-
row: ObjectType;
|
|
205
|
-
}) => Promise<boolean>;
|
|
206
|
-
children?: JSX.Element;
|
|
207
|
-
reactSelectStyles?: any;
|
|
208
|
-
imageBaseUrl?: string;
|
|
209
|
-
imageMaxSize?: number;
|
|
210
|
-
translations?: WidgetTranslationPairs;
|
|
211
|
-
}
|
|
212
|
-
export interface DerivedTableProps {
|
|
213
|
-
extraActions?: (item: any) => JSX.Element;
|
|
214
|
-
extraColumns?: [
|
|
215
|
-
{
|
|
216
|
-
label: string;
|
|
217
|
-
Cell: (item: any) => JSX.Element;
|
|
218
|
-
}
|
|
219
|
-
];
|
|
220
|
-
}
|
|
221
|
-
export interface FormWrapperProps {
|
|
222
|
-
children: (data: {
|
|
223
|
-
formState: FormActionTypes | undefined;
|
|
224
|
-
onClose: () => void;
|
|
225
|
-
open: boolean;
|
|
226
|
-
}) => JSX.Element | null;
|
|
227
|
-
}
|
|
228
|
-
export interface FormActionWrapperProps {
|
|
229
|
-
formRef: MutableRefObject<HTMLFormElement | null>;
|
|
230
|
-
}
|
|
231
|
-
export interface SchemaType extends ReactSelectProps {
|
|
232
|
-
label?: string;
|
|
233
|
-
accessor: string;
|
|
234
|
-
Input?: (props: InputRendererProps) => JSX.Element;
|
|
235
|
-
validations?: RegisterOptions;
|
|
236
|
-
editable?: boolean;
|
|
237
|
-
onInput?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
238
|
-
type?: 'text' | 'number' | 'select' | 'checkbox' | 'textarea' | 'file' | 'url' | 'ReactSelect' | 'color' | 'html';
|
|
239
|
-
options?: {
|
|
240
|
-
value: string;
|
|
241
|
-
label: string;
|
|
242
|
-
}[];
|
|
243
|
-
selectedOptions?: {
|
|
244
|
-
value: string;
|
|
245
|
-
label: string;
|
|
246
|
-
}[];
|
|
247
|
-
isMulti?: boolean;
|
|
248
|
-
placeholder?: string;
|
|
249
|
-
required?: boolean;
|
|
250
|
-
onChange?: (e: any) => void;
|
|
251
|
-
show?: boolean;
|
|
252
|
-
wrapperClassName?: string;
|
|
253
|
-
switchClass?: string;
|
|
254
|
-
info?: string;
|
|
255
|
-
customStyles?: any;
|
|
256
|
-
}
|
|
257
|
-
export interface PageTranslationPairs {
|
|
258
|
-
slug: string;
|
|
259
|
-
slugPlaceholder: string;
|
|
260
|
-
slugRequired: string;
|
|
261
|
-
addPage: string;
|
|
262
|
-
updatePage: string;
|
|
263
|
-
searchPages: string;
|
|
264
|
-
widgets: string;
|
|
265
|
-
}
|
|
266
|
-
export interface PageProps {
|
|
267
|
-
loader?: any;
|
|
268
|
-
explicitForm?: boolean;
|
|
269
|
-
children?: JSX.Element;
|
|
270
|
-
permissions?: PermissionsObj;
|
|
271
|
-
translations?: PageTranslationPairs;
|
|
272
|
-
preConfirmDelete?: (data: {
|
|
273
|
-
row: ObjectType;
|
|
274
|
-
}) => Promise<boolean>;
|
|
275
|
-
}
|
|
276
|
-
export interface PaginationProps {
|
|
277
|
-
totalPages: number;
|
|
278
|
-
totalRecords: number;
|
|
279
|
-
currentPage: number;
|
|
280
|
-
pageSize: number;
|
|
281
|
-
setCurrentPage: (value: number) => void;
|
|
282
|
-
showingText?: string;
|
|
283
|
-
pageText?: string;
|
|
284
|
-
ofText?: string;
|
|
285
|
-
previousContent?: string | React.ReactNode;
|
|
286
|
-
nextContent?: string | React.ReactNode;
|
|
287
|
-
}
|
|
288
|
-
export interface ItemsAccordianProps {
|
|
289
|
-
id: string;
|
|
290
|
-
show: boolean;
|
|
291
|
-
title: string;
|
|
292
|
-
collapseId: string;
|
|
293
|
-
toggleShow: (status: boolean) => void;
|
|
294
|
-
addText?: string;
|
|
295
|
-
deleteText?: string;
|
|
296
|
-
loading?: boolean;
|
|
297
|
-
languages?: LanguageType[];
|
|
298
|
-
name: string;
|
|
299
|
-
itemType: 'Web' | 'Mobile';
|
|
300
|
-
errors: any;
|
|
301
|
-
control: any;
|
|
302
|
-
register: any;
|
|
303
|
-
setError: any;
|
|
304
|
-
clearError: (key: string) => void;
|
|
305
|
-
}
|
|
306
|
-
export interface TabItemProps {
|
|
307
|
-
showDelete?: boolean;
|
|
308
|
-
isDisabled?: boolean;
|
|
309
|
-
deleteTitle: string;
|
|
310
|
-
onRemoveTab: () => void;
|
|
311
|
-
register?: any;
|
|
312
|
-
noButtonText: string;
|
|
313
|
-
yesButtonText: string;
|
|
314
|
-
error?: string;
|
|
315
|
-
}
|
|
316
|
-
export interface TabsProps {
|
|
317
|
-
activeTab: number;
|
|
318
|
-
setActiveTab: (value: number) => void;
|
|
319
|
-
onSubmit?: () => void;
|
|
320
|
-
control: any;
|
|
321
|
-
options?: {
|
|
322
|
-
value: string;
|
|
323
|
-
label: string;
|
|
324
|
-
}[];
|
|
325
|
-
deleteTitle: string;
|
|
326
|
-
listCode: string;
|
|
327
|
-
noButtonText: string;
|
|
328
|
-
yesButtonText: string;
|
|
329
|
-
itemsPlaceholder?: string;
|
|
330
|
-
formatOptionLabel?: (code: string, data: any) => JSX.Element;
|
|
331
|
-
isItemsLoading?: boolean;
|
|
332
|
-
formatItem?: (code: string, data: any) => JSX.Element;
|
|
333
|
-
onCollectionItemsIndexChange: (index: number, data: DropResult) => void;
|
|
334
|
-
tabCollectionItems: any[];
|
|
335
|
-
errors?: {
|
|
336
|
-
[key: string]: any;
|
|
337
|
-
};
|
|
338
|
-
customStyles?: any;
|
|
339
|
-
clearErrors: UseFormClearErrors<FieldValues>;
|
|
340
|
-
getValues: UseFormGetValues<FieldValues>;
|
|
341
|
-
setValue: UseFormSetValue<FieldValues>;
|
|
342
|
-
languages?: LanguageType[];
|
|
343
|
-
loadOptions?: (value?: string, callback?: (options: OptionType[]) => void) => Promise<OptionType[]>;
|
|
344
|
-
}
|
|
345
|
-
export interface ImageUploadProps {
|
|
346
|
-
className?: string;
|
|
347
|
-
text: string | JSX.Element;
|
|
348
|
-
maxSize: number;
|
|
349
|
-
imgId?: string | ObjectType;
|
|
350
|
-
setImgId: (value?: string | null) => void;
|
|
351
|
-
clearError?: () => void;
|
|
352
|
-
onError: (msg: string) => void;
|
|
353
|
-
onImageUpload: (file: File) => Promise<{
|
|
354
|
-
fileUrl: string;
|
|
355
|
-
fileId: string;
|
|
356
|
-
fileUri: string;
|
|
357
|
-
} | void>;
|
|
358
|
-
onImageRemove?: (id: string) => Promise<void>;
|
|
359
|
-
baseUrl: string;
|
|
360
|
-
error?: string;
|
|
361
|
-
disabled?: boolean;
|
|
362
|
-
}
|
|
363
|
-
export interface ToggleProps {
|
|
364
|
-
isChecked?: boolean;
|
|
365
|
-
disabled?: boolean;
|
|
366
|
-
onChange?: (status: boolean) => void;
|
|
367
|
-
switchClass?: string;
|
|
368
|
-
}
|
|
369
|
-
export interface ConfirmPopoverProps {
|
|
370
|
-
children?: JSX.Element;
|
|
371
|
-
onConfirm: () => void;
|
|
372
|
-
confirmText?: string;
|
|
373
|
-
cancelText?: string;
|
|
374
|
-
title: string;
|
|
375
|
-
}
|
|
376
|
-
export interface DeleteModalProps {
|
|
377
|
-
formState: FormActionTypes | undefined;
|
|
378
|
-
onClose: () => void;
|
|
379
|
-
itemData: ObjectType;
|
|
380
|
-
onConfirmDelete: () => void;
|
|
381
|
-
confirmationRequired?: string;
|
|
382
|
-
permanentlyDelete?: string;
|
|
383
|
-
lossOfData?: string;
|
|
384
|
-
pleaseType?: string;
|
|
385
|
-
toProceedOrCancel?: string;
|
|
386
|
-
confirm?: string;
|
|
387
|
-
typeHerePlaceholder?: string;
|
|
388
|
-
}
|
|
389
|
-
export type CellInputType = (parameters: {
|
|
390
|
-
row: any;
|
|
391
|
-
onUpdate?: (row: any) => void;
|
|
392
|
-
}) => JSX.Element | null | string;
|
|
393
|
-
export type TableDataItemFormat = {
|
|
394
|
-
label: string;
|
|
395
|
-
dataKey: string;
|
|
396
|
-
highlight?: boolean;
|
|
397
|
-
Cell?: CellInputType;
|
|
398
|
-
};
|
|
399
|
-
export interface TableProps {
|
|
400
|
-
data: any[];
|
|
401
|
-
dataKeys: TableDataItemFormat[];
|
|
402
|
-
loading?: boolean;
|
|
403
|
-
loader?: any;
|
|
404
|
-
actions?: {
|
|
405
|
-
edit?: ((data: {
|
|
406
|
-
[key: string]: any;
|
|
407
|
-
}) => void) | boolean;
|
|
408
|
-
delete?: ((data: {
|
|
409
|
-
[key: string]: any;
|
|
410
|
-
}) => void) | boolean;
|
|
411
|
-
};
|
|
412
|
-
actionsLabel: string;
|
|
413
|
-
extraActions?: (item: any) => JSX.Element;
|
|
414
|
-
extraColumns?: [
|
|
415
|
-
{
|
|
416
|
-
label: string;
|
|
417
|
-
Cell: (item: any) => JSX.Element;
|
|
418
|
-
}
|
|
419
|
-
];
|
|
420
|
-
}
|