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