@knovator/pagecreator-admin 0.7.5 → 0.8.0
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 +183 -126
- package/index.js +183 -126
- package/package.json +1 -1
- package/src/lib/api/list.d.ts +4 -0
- package/src/lib/constants/common.d.ts +2 -0
- package/src/lib/context/WidgetContext.d.ts +1 -1
- package/src/lib/hooks/useWidget.d.ts +3 -2
- package/src/lib/types/api.d.ts +5 -1
- package/src/lib/types/context.d.ts +2 -1
package/src/lib/api/list.d.ts
CHANGED
|
@@ -87,6 +87,8 @@ declare const TRANSLATION_PAIRS_WIDGET: {
|
|
|
87
87
|
'widget.widgetTitleInfo': string;
|
|
88
88
|
'widget.minPerRow': string;
|
|
89
89
|
'widget.actionsLabel': string;
|
|
90
|
+
'widget.category': string;
|
|
91
|
+
'widget.categoryPlaceholder': string;
|
|
90
92
|
'widget.tabNameRequired': string;
|
|
91
93
|
};
|
|
92
94
|
declare const TRANSLATION_PAIRS_ITEM: {
|
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { WidgetContextType } from '../types';
|
|
3
3
|
interface WidgetContextProviderProps extends React.PropsWithChildren, Partial<WidgetContextType> {
|
|
4
4
|
}
|
|
5
|
-
declare const WidgetContextProvider: ({ t, list, imageBaseUrl, searchText, changeSearch, 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, reactSelectStyles, children, }: WidgetContextProviderProps) => JSX.Element;
|
|
5
|
+
declare const WidgetContextProvider: ({ t, list, imageBaseUrl, searchText, changeSearch, formState, closeForm, loading, onChangeFormState, onWidgetFormSubmit, updateData, canAdd, canUpdate, onDeleteItem, getWidgets, onImageUpload, onImageRemove, itemsTypes, widgetTypes, categories, getCollectionData, collectionDataLoading, collectionData, formatListItem, formatOptionLabel, currentPage, limits, pageSize, setCurrentPage, setPageSize, totalPages, totalRecords, canList, canPartialUpdate, columns, data, canDelete, loader, onPartialUpdateWidget, reactSelectStyles, children, }: WidgetContextProviderProps) => JSX.Element;
|
|
6
6
|
export declare function useWidgetState(): WidgetContextType;
|
|
7
7
|
export default WidgetContextProvider;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Routes_Input, WidgetType, ItemsType } from '../types';
|
|
2
|
+
import { Routes_Input, WidgetType, ItemsType, Category } from '../types';
|
|
3
3
|
import { FormActionTypes, ObjectType } from '../types/common';
|
|
4
4
|
interface UseWidgetProps {
|
|
5
5
|
canList?: boolean;
|
|
@@ -10,7 +10,7 @@ interface UseWidgetProps {
|
|
|
10
10
|
}) => Promise<boolean>;
|
|
11
11
|
imageBaseUrl?: string;
|
|
12
12
|
}
|
|
13
|
-
declare const useWidget: ({ canList, defaultLimit, routes, preConfirmDelete, imageBaseUrl }: UseWidgetProps) => {
|
|
13
|
+
declare const useWidget: ({ canList, defaultLimit, routes, preConfirmDelete, imageBaseUrl, }: UseWidgetProps) => {
|
|
14
14
|
list: ObjectType[];
|
|
15
15
|
getWidgets: (search?: string) => Promise<void>;
|
|
16
16
|
loading: boolean;
|
|
@@ -24,6 +24,7 @@ declare const useWidget: ({ canList, defaultLimit, routes, preConfirmDelete, ima
|
|
|
24
24
|
setPageSize: (value: number) => void;
|
|
25
25
|
formState: FormActionTypes | undefined;
|
|
26
26
|
itemData: ObjectType | null;
|
|
27
|
+
categories: Category[];
|
|
27
28
|
onChangeFormState: (state: FormActionTypes, data?: ObjectType) => Promise<void>;
|
|
28
29
|
onCloseForm: () => void;
|
|
29
30
|
onWidgetFormSubmit: (data: ObjectType) => Promise<void>;
|
package/src/lib/types/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ACTION_TYPES = 'IMAGE_UPLOAD' | 'IMAGE_REMOVE' | 'CREATE' | 'LIST' | 'DELETE' | 'UPDATE' | 'ITEM' | 'PARTIAL_UPDATE' | 'WIDGET_TYPES' | 'SELECTION_TYPES' | 'COLLECTION_DATA' | 'GET_ONE';
|
|
1
|
+
export type ACTION_TYPES = 'IMAGE_UPLOAD' | 'IMAGE_REMOVE' | 'CREATE' | 'LIST' | 'DELETE' | 'UPDATE' | 'ITEM' | 'PARTIAL_UPDATE' | 'WIDGET_TYPES' | 'SELECTION_TYPES' | 'COLLECTION_DATA' | 'GET_ONE' | 'CATEGORIES';
|
|
2
2
|
export type API_TYPE = {
|
|
3
3
|
url: string;
|
|
4
4
|
method: string;
|
|
@@ -18,6 +18,10 @@ export type WidgetType = {
|
|
|
18
18
|
value: string;
|
|
19
19
|
label: string;
|
|
20
20
|
};
|
|
21
|
+
export type Category = {
|
|
22
|
+
value: string;
|
|
23
|
+
label: string;
|
|
24
|
+
};
|
|
21
25
|
export interface BaseAPIProps {
|
|
22
26
|
config?: any;
|
|
23
27
|
baseUrl: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { WidgetType, ItemsType } from './api';
|
|
2
|
+
import { WidgetType, ItemsType, Category } from './api';
|
|
3
3
|
import { FormActionTypes, OptionType } from './common';
|
|
4
4
|
export interface ProviderContextType {
|
|
5
5
|
baseUrl: string;
|
|
@@ -43,6 +43,7 @@ export interface WidgetContextType {
|
|
|
43
43
|
onImageRemove: (id: string) => Promise<void>;
|
|
44
44
|
itemsTypes: ItemsType[];
|
|
45
45
|
widgetTypes: WidgetType[];
|
|
46
|
+
categories: Category[];
|
|
46
47
|
getCollectionData: (collectionName: string, search?: string, callback?: (options: OptionType[]) => void, collectionItems?: string[]) => Promise<void>;
|
|
47
48
|
collectionDataLoading: boolean;
|
|
48
49
|
collectionData: any[];
|