procode-vs-template 1.0.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/CHANGELOG.md +37 -0
- package/README.md +188 -0
- package/dist/actions.esm.js +53 -0
- package/dist/actions.esm.js.map +1 -0
- package/dist/actions.js +55 -0
- package/dist/actions.js.map +1 -0
- package/dist/assets/delete.png +0 -0
- package/dist/assets/info.svg +5 -0
- package/dist/assets/react.svg +1 -0
- package/dist/assets/styles/_tempalte-base.scss +5 -0
- package/dist/factories.esm.js +39149 -0
- package/dist/factories.esm.js.map +1 -0
- package/dist/factories.js +39169 -0
- package/dist/factories.js.map +1 -0
- package/dist/index.esm.js +39200 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +39224 -0
- package/dist/index.js.map +1 -0
- package/dist/src/assets/styles/_tempalte-base.scss +5 -0
- package/dist/types/Action/TemplateActionFactory.d.ts +8 -0
- package/dist/types/Action/TemplateActionType.d.ts +8 -0
- package/dist/types/Action/TemplateActions/handleMenuNavigation.d.ts +1 -0
- package/dist/types/Factory/BaseType.d.ts +16 -0
- package/dist/types/Factory/TemplateWidgetFactory.d.ts +14 -0
- package/dist/types/Renderer/index.d.ts +2 -0
- package/dist/types/Widgets/Block/BlockView.d.ts +3 -0
- package/dist/types/Widgets/Block/index.d.ts +3 -0
- package/dist/types/Widgets/Block/types.d.ts +12 -0
- package/dist/types/Widgets/ConfirmationAlert/ConfirmationAlertView.d.ts +14 -0
- package/dist/types/Widgets/ConfirmationAlert/index.d.ts +11 -0
- package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/AdvancedSearch.d.ts +15 -0
- package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/AdvancedSearchView.d.ts +6 -0
- package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/Filter.d.ts +20 -0
- package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/FilterPopup.d.ts +13 -0
- package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/FilterPopupView.d.ts +25 -0
- package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/TypeBasedWidgetFactory.d.ts +8 -0
- package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/constant.d.ts +8 -0
- package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/helper/AdvancedSearchFunctions.d.ts +7 -0
- package/dist/types/Widgets/GridToolBar/Components/Export/Export.d.ts +14 -0
- package/dist/types/Widgets/GridToolBar/Components/Export/ExportPopup.d.ts +20 -0
- package/dist/types/Widgets/GridToolBar/Components/Export/ExportView.d.ts +6 -0
- package/dist/types/Widgets/GridToolBar/Components/Export/type.d.ts +4 -0
- package/dist/types/Widgets/GridToolBar/Components/GlobalSearch/GlobalSearch.d.ts +11 -0
- package/dist/types/Widgets/GridToolBar/Components/GlobalSearch/GlobalSearchView.d.ts +9 -0
- package/dist/types/Widgets/GridToolBar/Components/GroupBy/GroupByPopUp.d.ts +17 -0
- package/dist/types/Widgets/GridToolBar/Components/GroupBy/GroupByView.d.ts +6 -0
- package/dist/types/Widgets/GridToolBar/Components/GroupBy/index.d.ts +15 -0
- package/dist/types/Widgets/GridToolBar/Components/QuickFilter/FilterPopup.d.ts +10 -0
- package/dist/types/Widgets/GridToolBar/Components/QuickFilter/QuickFilterView.d.ts +6 -0
- package/dist/types/Widgets/GridToolBar/Components/QuickFilter/index.d.ts +12 -0
- package/dist/types/Widgets/GridToolBar/Components/Reset/ResetView.d.ts +6 -0
- package/dist/types/Widgets/GridToolBar/Components/Reset/index.d.ts +11 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/CreateScreenPopup.d.ts +6 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/UserView.d.ts +26 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/UserViewView.d.ts +13 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/ViewItem.d.ts +11 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/actions/index.d.ts +8 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/deserializedScreenView.d.ts +4 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/getSavedSystemDefault.d.ts +2 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/saveSystemDefaultInSession.d.ts +1 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/advancedSearchHandler.d.ts +1 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/globalSearchHandler.d.ts +1 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/groupByHandler.d.ts +1 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/localSearchHandler.d.ts +1 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/paginationHandler.d.ts +1 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/quickFilterHandler.d.ts +1 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/settingHandler.d.ts +1 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/sortHandler.d.ts +1 -0
- package/dist/types/Widgets/GridToolBar/Components/ScreenView/services/index.d.ts +6 -0
- package/dist/types/Widgets/GridToolBar/Components/Setting/ColumnChooser/ColumnChooser.d.ts +15 -0
- package/dist/types/Widgets/GridToolBar/Components/Setting/ColumnChooser/ColumnChooserView.d.ts +17 -0
- package/dist/types/Widgets/GridToolBar/Components/Setting/ColumnChooser/DragDropContext.d.ts +9 -0
- package/dist/types/Widgets/GridToolBar/Components/Setting/Setting.d.ts +19 -0
- package/dist/types/Widgets/GridToolBar/Components/Setting/SettingPopup.d.ts +9 -0
- package/dist/types/Widgets/GridToolBar/Components/Setting/SettingView.d.ts +6 -0
- package/dist/types/Widgets/GridToolBar/GridToolBar.d.ts +8 -0
- package/dist/types/Widgets/GridToolBar/GridToolBarView.d.ts +23 -0
- package/dist/types/Widgets/GridToolBar/data/advancedSearch/index.d.ts +46 -0
- package/dist/types/Widgets/GridToolBar/data/globalSearch/index.d.ts +4 -0
- package/dist/types/Widgets/GridToolBar/data/groupBy/index.d.ts +6 -0
- package/dist/types/Widgets/GridToolBar/data/index.d.ts +49 -0
- package/dist/types/Widgets/GridToolBar/data/quickFilter/index.d.ts +30 -0
- package/dist/types/Widgets/GridToolBar/data/setting/index.d.ts +21 -0
- package/dist/types/Widgets/GridToolBar/data/userView/index.d.ts +10 -0
- package/dist/types/Widgets/GridToolBar/enum/index.d.ts +27 -0
- package/dist/types/Widgets/GridToolBar/helper/getUniqueId.d.ts +1 -0
- package/dist/types/Widgets/GridToolBar/type.d.ts +58 -0
- package/dist/types/Widgets/InformationAlert/InformationAlert.d.ts +8 -0
- package/dist/types/Widgets/InformationAlert/InformationAlertView.d.ts +8 -0
- package/dist/types/Widgets/Menu/MenuMainHeader.d.ts +3 -0
- package/dist/types/Widgets/Menu/MenuSubHeader.d.ts +3 -0
- package/dist/types/Widgets/Menu/MenuSubItem.d.ts +3 -0
- package/dist/types/Widgets/Menu/MenuView.d.ts +6 -0
- package/dist/types/Widgets/Menu/index.d.ts +14 -0
- package/dist/types/actions.d.ts +2 -0
- package/dist/types/constant.d.ts +8 -0
- package/dist/types/factories.d.ts +2 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/utils/getValueFromNestedObject.d.ts +1 -0
- package/package.json +98 -0
- package/src/Action/TemplateActionFactory.ts +27 -0
- package/src/Action/TemplateActionType.ts +8 -0
- package/src/Action/TemplateActions/handleMenuNavigation.ts +23 -0
- package/src/Factory/BaseType.ts +12 -0
- package/src/Factory/TemplateWidgetFactory.tsx +50 -0
- package/src/Renderer/index.tsx +14 -0
- package/src/Widgets/Block/BlockView.tsx +31 -0
- package/src/Widgets/Block/Styles/index.scss +41 -0
- package/src/Widgets/Block/index.tsx +8 -0
- package/src/Widgets/Block/types.ts +11 -0
- package/src/Widgets/ConfirmationAlert/ConfirmationAlertView.tsx +90 -0
- package/src/Widgets/ConfirmationAlert/index.tsx +16 -0
- package/src/Widgets/ConfirmationAlert/scss/index.scss +66 -0
- package/src/Widgets/GridToolBar/Components/AdvancedSearch/AdvancedSearch.tsx +83 -0
- package/src/Widgets/GridToolBar/Components/AdvancedSearch/AdvancedSearchView.tsx +25 -0
- package/src/Widgets/GridToolBar/Components/AdvancedSearch/Filter.tsx +162 -0
- package/src/Widgets/GridToolBar/Components/AdvancedSearch/FilterPopup.tsx +437 -0
- package/src/Widgets/GridToolBar/Components/AdvancedSearch/FilterPopupView.tsx +111 -0
- package/src/Widgets/GridToolBar/Components/AdvancedSearch/TypeBasedWidgetFactory.tsx +226 -0
- package/src/Widgets/GridToolBar/Components/AdvancedSearch/constant.ts +55 -0
- package/src/Widgets/GridToolBar/Components/AdvancedSearch/helper/AdvancedSearchFunctions.ts +36 -0
- package/src/Widgets/GridToolBar/Components/Export/Export.tsx +57 -0
- package/src/Widgets/GridToolBar/Components/Export/ExportPopup.tsx +388 -0
- package/src/Widgets/GridToolBar/Components/Export/ExportView.tsx +21 -0
- package/src/Widgets/GridToolBar/Components/Export/type.ts +4 -0
- package/src/Widgets/GridToolBar/Components/GlobalSearch/GlobalSearch.tsx +95 -0
- package/src/Widgets/GridToolBar/Components/GlobalSearch/GlobalSearchView.tsx +65 -0
- package/src/Widgets/GridToolBar/Components/GroupBy/GroupByPopUp.tsx +115 -0
- package/src/Widgets/GridToolBar/Components/GroupBy/GroupByView.tsx +21 -0
- package/src/Widgets/GridToolBar/Components/GroupBy/index.tsx +84 -0
- package/src/Widgets/GridToolBar/Components/QuickFilter/FilterPopup.tsx +41 -0
- package/src/Widgets/GridToolBar/Components/QuickFilter/QuickFilterView.tsx +23 -0
- package/src/Widgets/GridToolBar/Components/QuickFilter/index.tsx +199 -0
- package/src/Widgets/GridToolBar/Components/Reset/ResetView.tsx +22 -0
- package/src/Widgets/GridToolBar/Components/Reset/index.tsx +41 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/CreateScreenPopup.tsx +88 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/UserView.tsx +266 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/UserViewView.tsx +67 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/ViewItem.tsx +94 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/actions/index.ts +20 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/helpers/deserializedScreenView.ts +19 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/helpers/getSavedSystemDefault.ts +18 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/helpers/saveSystemDefaultInSession.ts +12 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/advancedSearchHandler.ts +32 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/globalSearchHandler.ts +13 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/groupByHandler.ts +8 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/localSearchHandler.ts +6 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/paginationHandler.ts +6 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/quickFilterHandler.ts +13 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/settingHandler.ts +19 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/sortHandler.ts +6 -0
- package/src/Widgets/GridToolBar/Components/ScreenView/services/index.ts +63 -0
- package/src/Widgets/GridToolBar/Components/Setting/ColumnChooser/ColumnChooser.tsx +274 -0
- package/src/Widgets/GridToolBar/Components/Setting/ColumnChooser/ColumnChooserView.tsx +154 -0
- package/src/Widgets/GridToolBar/Components/Setting/ColumnChooser/DragDropContext.tsx +76 -0
- package/src/Widgets/GridToolBar/Components/Setting/Setting.tsx +116 -0
- package/src/Widgets/GridToolBar/Components/Setting/SettingPopup.tsx +23 -0
- package/src/Widgets/GridToolBar/Components/Setting/SettingView.tsx +23 -0
- package/src/Widgets/GridToolBar/GridToolBar.tsx +111 -0
- package/src/Widgets/GridToolBar/GridToolBarView.tsx +138 -0
- package/src/Widgets/GridToolBar/data/advancedSearch/index.ts +45 -0
- package/src/Widgets/GridToolBar/data/globalSearch/index.ts +4 -0
- package/src/Widgets/GridToolBar/data/groupBy/index.ts +3 -0
- package/src/Widgets/GridToolBar/data/index.ts +74 -0
- package/src/Widgets/GridToolBar/data/quickFilter/index.ts +37 -0
- package/src/Widgets/GridToolBar/data/setting/index.ts +23 -0
- package/src/Widgets/GridToolBar/data/userView/index.ts +11 -0
- package/src/Widgets/GridToolBar/enum/index.ts +29 -0
- package/src/Widgets/GridToolBar/helper/getUniqueId.ts +2 -0
- package/src/Widgets/GridToolBar/scss/index.scss +834 -0
- package/src/Widgets/GridToolBar/type.ts +63 -0
- package/src/Widgets/InformationAlert/InformationAlert.tsx +12 -0
- package/src/Widgets/InformationAlert/InformationAlertView.tsx +46 -0
- package/src/Widgets/InformationAlert/scss/index.scss +73 -0
- package/src/Widgets/Menu/MenuMainHeader.tsx +28 -0
- package/src/Widgets/Menu/MenuSubHeader.tsx +20 -0
- package/src/Widgets/Menu/MenuSubItem.tsx +10 -0
- package/src/Widgets/Menu/MenuView.tsx +19 -0
- package/src/Widgets/Menu/index.json +245 -0
- package/src/Widgets/Menu/index.tsx +32 -0
- package/src/Widgets/Menu/scss/index.scss +93 -0
- package/src/actions.ts +5 -0
- package/src/assets/delete.png +0 -0
- package/src/assets/info.svg +5 -0
- package/src/assets/react.svg +1 -0
- package/src/assets/styles/_tempalte-base.scss +5 -0
- package/src/constant.ts +8 -0
- package/src/factories.ts +5 -0
- package/src/index.ts +12 -0
- package/src/utils/getValueFromNestedObject.ts +14 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
import React, { useEffect } from "react";
|
|
4
|
+
import GridToolBarView from "./GridToolBarView";
|
|
5
|
+
import { SYSTEM_DEFAULT } from "../../constant";
|
|
6
|
+
import { BaseProps } from "../../Factory/BaseType";
|
|
7
|
+
|
|
8
|
+
import { ActionProps, ToolbarOptions } from "./type";
|
|
9
|
+
import { saveSystemDefaultInSession } from "./Components/ScreenView/helpers/saveSystemDefaultInSession";
|
|
10
|
+
import { useLocation, useNavigate } from "react-router-dom";
|
|
11
|
+
|
|
12
|
+
export type GridToolBarProps = BaseProps &
|
|
13
|
+
ActionProps & {
|
|
14
|
+
toolBarOptions: ToolbarOptions;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const GridToolBar: React.FC<GridToolBarProps> = ({
|
|
18
|
+
config,
|
|
19
|
+
targetScreenDataField,
|
|
20
|
+
uiElementGroupData,
|
|
21
|
+
widgetStyle,
|
|
22
|
+
toolBarOptions,
|
|
23
|
+
loadTemplateSupportiveData,
|
|
24
|
+
onExport,
|
|
25
|
+
onExportDelete,
|
|
26
|
+
onExportList,
|
|
27
|
+
onExportDownload,
|
|
28
|
+
onModelUpdate,
|
|
29
|
+
onScreenDataLoad,
|
|
30
|
+
}) => {
|
|
31
|
+
const location = useLocation();
|
|
32
|
+
const navigate = useNavigate();
|
|
33
|
+
|
|
34
|
+
const targetUiElementGroupId = location.state?.targetUiElementGroupId;
|
|
35
|
+
|
|
36
|
+
const resultHandler = (response: any) => {
|
|
37
|
+
onModelUpdate?.(null, targetScreenDataField ?? "", response);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const saveInSession = () => {
|
|
41
|
+
if (
|
|
42
|
+
uiElementGroupData?.userView?.selectedView?.id === SYSTEM_DEFAULT &&
|
|
43
|
+
toolBarOptions.userView.enableDefaultSaveInSession
|
|
44
|
+
) {
|
|
45
|
+
saveSystemDefaultInSession(config.uiElementGroupId, uiElementGroupData);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
onModelUpdate(null, config.uiElementGroupId, {
|
|
51
|
+
...uiElementGroupData,
|
|
52
|
+
setting: {
|
|
53
|
+
activeDataWidgetType: toolBarOptions.setting.activeDataWidgetType,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}, []);
|
|
57
|
+
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
return () => {
|
|
60
|
+
saveInSession();
|
|
61
|
+
};
|
|
62
|
+
}, [location.pathname]);
|
|
63
|
+
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (
|
|
66
|
+
location.state?.enableHotReload &&
|
|
67
|
+
targetUiElementGroupId &&
|
|
68
|
+
targetUiElementGroupId === config.uiElementGroupId
|
|
69
|
+
) {
|
|
70
|
+
if (targetUiElementGroupId) {
|
|
71
|
+
const rest = { ...location.state };
|
|
72
|
+
delete rest.targetUiElementGroupId;
|
|
73
|
+
delete rest.enableHotReload;
|
|
74
|
+
navigate(location.pathname, { state: rest, replace: true });
|
|
75
|
+
}
|
|
76
|
+
onScreenDataLoad?.(resultHandler);
|
|
77
|
+
}
|
|
78
|
+
}, [targetUiElementGroupId]);
|
|
79
|
+
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (uiElementGroupData?.enableDataLoading) {
|
|
82
|
+
onScreenDataLoad?.(resultHandler);
|
|
83
|
+
}
|
|
84
|
+
}, [
|
|
85
|
+
JSON.stringify(uiElementGroupData?.globalSearch?.appliedQuery),
|
|
86
|
+
JSON.stringify(uiElementGroupData?.advancedSearch?.appliedQuery),
|
|
87
|
+
JSON.stringify(uiElementGroupData?.quickFilter?.appliedQuery),
|
|
88
|
+
JSON.stringify(uiElementGroupData?.groupedBy?.appliedGroups),
|
|
89
|
+
JSON.stringify(uiElementGroupData?.pagination),
|
|
90
|
+
JSON.stringify(uiElementGroupData?.sort),
|
|
91
|
+
JSON.stringify(uiElementGroupData?.localSearch),
|
|
92
|
+
uiElementGroupData?.enableDataLoading,
|
|
93
|
+
]);
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<GridToolBarView
|
|
97
|
+
widgetStyle={widgetStyle}
|
|
98
|
+
toolBarOptions={toolBarOptions}
|
|
99
|
+
config={config}
|
|
100
|
+
uiElementGroupData={uiElementGroupData}
|
|
101
|
+
loadTemplateSupportiveData={loadTemplateSupportiveData}
|
|
102
|
+
onModelUpdate={onModelUpdate}
|
|
103
|
+
onExport={onExport}
|
|
104
|
+
onExportDelete={onExportDelete}
|
|
105
|
+
onExportList={onExportList}
|
|
106
|
+
onExportDownload={onExportDownload}
|
|
107
|
+
/>
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export default GridToolBar;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import AdvancedSearch from "./Components/AdvancedSearch/AdvancedSearch";
|
|
3
|
+
import GlobalSearch from "./Components/GlobalSearch/GlobalSearch";
|
|
4
|
+
import QuickFilter from "./Components/QuickFilter";
|
|
5
|
+
import GroupBy from "./Components/GroupBy";
|
|
6
|
+
import Reset from "./Components/Reset";
|
|
7
|
+
import Setting from "./Components/Setting/Setting";
|
|
8
|
+
import Export from "./Components/Export/Export";
|
|
9
|
+
import UserView from "./Components/ScreenView/UserView";
|
|
10
|
+
import { ToolbarOptions } from "./type";
|
|
11
|
+
import { ExportType } from "./Components/Export/type";
|
|
12
|
+
|
|
13
|
+
interface GridToolBarViewProps {
|
|
14
|
+
widgetStyle?: {
|
|
15
|
+
id?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
inline?: React.CSSProperties;
|
|
18
|
+
};
|
|
19
|
+
toolBarOptions: ToolbarOptions;
|
|
20
|
+
config: { uiElementGroupId: string };
|
|
21
|
+
uiElementGroupData: Record<string, any>;
|
|
22
|
+
loadTemplateSupportiveData?: (
|
|
23
|
+
callBack: (args: any) => void,
|
|
24
|
+
supportiveKeys: any
|
|
25
|
+
) => Promise<any>;
|
|
26
|
+
onModelUpdate: (
|
|
27
|
+
callBack: ((args: any) => void) | null,
|
|
28
|
+
fieldName: string,
|
|
29
|
+
value: any
|
|
30
|
+
) => void;
|
|
31
|
+
onExport?: (
|
|
32
|
+
callBack: ((args: any) => void) | null,
|
|
33
|
+
exportType: ExportType
|
|
34
|
+
) => void;
|
|
35
|
+
onExportDelete: (callBack: ((args: any) => void) | null, id: string) => void;
|
|
36
|
+
onExportList: (callBack: ((args: any) => void) | null) => void;
|
|
37
|
+
onExportDownload: (callBack: ((args: any) => void) | null, id: string) => void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const GridToolBarView = ({
|
|
41
|
+
widgetStyle,
|
|
42
|
+
toolBarOptions,
|
|
43
|
+
config,
|
|
44
|
+
uiElementGroupData,
|
|
45
|
+
loadTemplateSupportiveData,
|
|
46
|
+
onModelUpdate,
|
|
47
|
+
onExport,
|
|
48
|
+
onExportDelete,
|
|
49
|
+
onExportList,
|
|
50
|
+
onExportDownload
|
|
51
|
+
}: GridToolBarViewProps) => {
|
|
52
|
+
return (
|
|
53
|
+
<div
|
|
54
|
+
id={widgetStyle?.id || ""}
|
|
55
|
+
className={`tmpl-grid-toolbar-container ${widgetStyle?.className || ""}`}
|
|
56
|
+
style={{ ...(widgetStyle?.inline || {}) }}
|
|
57
|
+
>
|
|
58
|
+
<GlobalSearch
|
|
59
|
+
visible={toolBarOptions.globalSearch.visible}
|
|
60
|
+
disabled={toolBarOptions.globalSearch.disabled}
|
|
61
|
+
config={config}
|
|
62
|
+
uiElementGroupData={uiElementGroupData}
|
|
63
|
+
onModelUpdate={onModelUpdate}
|
|
64
|
+
/>
|
|
65
|
+
<AdvancedSearch
|
|
66
|
+
visible={toolBarOptions.advancedSearch.visible}
|
|
67
|
+
disabled={toolBarOptions.advancedSearch.disabled}
|
|
68
|
+
filterableFields={toolBarOptions.advancedSearch.filterableFields}
|
|
69
|
+
config={config}
|
|
70
|
+
uiElementGroupData={uiElementGroupData}
|
|
71
|
+
onModelUpdate={onModelUpdate}
|
|
72
|
+
loadTemplateSupportiveData={loadTemplateSupportiveData}
|
|
73
|
+
/>
|
|
74
|
+
<QuickFilter
|
|
75
|
+
visible={toolBarOptions.quickFilter.visible}
|
|
76
|
+
disabled={toolBarOptions.quickFilter.disabled}
|
|
77
|
+
config={config}
|
|
78
|
+
uiElementGroupData={uiElementGroupData}
|
|
79
|
+
onModelUpdate={onModelUpdate}
|
|
80
|
+
loadTemplateSupportiveData={loadTemplateSupportiveData}
|
|
81
|
+
/>
|
|
82
|
+
<GroupBy
|
|
83
|
+
visible={toolBarOptions.groupBy.visible}
|
|
84
|
+
disabled={toolBarOptions.groupBy.disabled}
|
|
85
|
+
groupableFields={toolBarOptions.groupBy.groupableFields}
|
|
86
|
+
config={config}
|
|
87
|
+
uiElementGroupData={uiElementGroupData}
|
|
88
|
+
onModelUpdate={onModelUpdate}
|
|
89
|
+
/>
|
|
90
|
+
<Reset
|
|
91
|
+
visible={toolBarOptions.reset.visible}
|
|
92
|
+
disabled={toolBarOptions.reset.disabled}
|
|
93
|
+
config={config}
|
|
94
|
+
uiElementGroupData={uiElementGroupData}
|
|
95
|
+
onModelUpdate={onModelUpdate}
|
|
96
|
+
/>
|
|
97
|
+
<Setting
|
|
98
|
+
visible={toolBarOptions.setting.visible}
|
|
99
|
+
disabled={toolBarOptions.setting.disabled}
|
|
100
|
+
disableColumnChooser={toolBarOptions.setting.disableColumnChooser}
|
|
101
|
+
columns={toolBarOptions.setting.columns}
|
|
102
|
+
disabledDisplayWidgetType={
|
|
103
|
+
toolBarOptions.setting.disabledDisplayWidgetType
|
|
104
|
+
}
|
|
105
|
+
config={config}
|
|
106
|
+
uiElementGroupData={uiElementGroupData}
|
|
107
|
+
onModelUpdate={onModelUpdate}
|
|
108
|
+
/>
|
|
109
|
+
<UserView
|
|
110
|
+
visible={toolBarOptions.userView.visible}
|
|
111
|
+
disabled={toolBarOptions.userView.disabled}
|
|
112
|
+
enableDefaultSaveInSession={
|
|
113
|
+
toolBarOptions.userView.enableDefaultSaveInSession
|
|
114
|
+
}
|
|
115
|
+
advancedFilterableFields={
|
|
116
|
+
toolBarOptions.advancedSearch.filterableFields
|
|
117
|
+
}
|
|
118
|
+
quickFilterRows={toolBarOptions.quickFilter.filterRows}
|
|
119
|
+
activeDataWidgetType={toolBarOptions.setting.activeDataWidgetType}
|
|
120
|
+
columns={toolBarOptions.setting.columns}
|
|
121
|
+
config={config}
|
|
122
|
+
uiElementGroupData={uiElementGroupData}
|
|
123
|
+
onModelUpdate={onModelUpdate}
|
|
124
|
+
/>
|
|
125
|
+
<Export
|
|
126
|
+
visible={toolBarOptions.export.visible}
|
|
127
|
+
disabled={toolBarOptions.export.disabled}
|
|
128
|
+
config={config}
|
|
129
|
+
onExport={onExport}
|
|
130
|
+
onExportDelete={onExportDelete}
|
|
131
|
+
onExportList={onExportList}
|
|
132
|
+
onExportDownload={onExportDownload}
|
|
133
|
+
/>
|
|
134
|
+
</div>
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export default GridToolBarView;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { FilterTargetType, Operator, OperatorCreiteria } from "../../enum";
|
|
3
|
+
import { ValueLoadType } from "../../type";
|
|
4
|
+
|
|
5
|
+
export type AdvancedSearchData = {
|
|
6
|
+
appliedQuery: { criteria: string; filters: FilterExpression[] };
|
|
7
|
+
filterRows: FilterExpressionViewModel[];
|
|
8
|
+
criteria: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type FilterExpression = {
|
|
12
|
+
id: string;
|
|
13
|
+
propertyToFilter: FilterTarget;
|
|
14
|
+
operator: { label: string; value: Operator | null };
|
|
15
|
+
value?: FilterValue | FilterValue[];
|
|
16
|
+
selectedCriteria: OperatorCreiteria;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type FilterTarget = {
|
|
20
|
+
label: string;
|
|
21
|
+
value: any;
|
|
22
|
+
apiPropertyName: string;
|
|
23
|
+
dataProvider?: {
|
|
24
|
+
key?: string;
|
|
25
|
+
value?: FilterValue | FilterValue[];
|
|
26
|
+
valueLoadType: ValueLoadType;
|
|
27
|
+
};
|
|
28
|
+
type: FilterTargetType;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type FilterValue =
|
|
32
|
+
| { label: string; value: any }
|
|
33
|
+
| string
|
|
34
|
+
| number
|
|
35
|
+
| Date
|
|
36
|
+
| boolean;
|
|
37
|
+
|
|
38
|
+
export type FilterExpressionViewModel = {
|
|
39
|
+
id: string;
|
|
40
|
+
idLabel: string;
|
|
41
|
+
allPropertieseToFilter: FilterTarget[];
|
|
42
|
+
alloperators: { label: string; value: Operator | null }[];
|
|
43
|
+
allValues?: FilterValue[] | FilterValue;
|
|
44
|
+
selectedFilter: FilterExpression;
|
|
45
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import _ from "lodash";
|
|
3
|
+
import { getAdvancedSearchIntitialFilterRow } from "../Components/AdvancedSearch/helper/AdvancedSearchFunctions";
|
|
4
|
+
import { _defaultView } from "../Components/ScreenView/UserView";
|
|
5
|
+
import { DataWidgetType } from "../Components/Setting/Setting";
|
|
6
|
+
import { OperatorCreiteria } from "../enum";
|
|
7
|
+
import { AdvancedSearchData } from "./advancedSearch";
|
|
8
|
+
import { GlobalSearchData } from "./globalSearch";
|
|
9
|
+
import { GroupedByData } from "./groupBy";
|
|
10
|
+
import { QuickFilterData } from "./quickFilter";
|
|
11
|
+
import { SettingData } from "./setting";
|
|
12
|
+
import { UserViewData } from "./userView";
|
|
13
|
+
|
|
14
|
+
export type ToolbarData = {
|
|
15
|
+
globalSearch: GlobalSearchData;
|
|
16
|
+
advancedSearch: AdvancedSearchData;
|
|
17
|
+
quickFilter: QuickFilterData;
|
|
18
|
+
groupedBy: GroupedByData;
|
|
19
|
+
setting: SettingData;
|
|
20
|
+
reset: number;
|
|
21
|
+
lazyLoad?: boolean;
|
|
22
|
+
globalFilters?: { pattern: string; filters: any[] };
|
|
23
|
+
localSearch?: { id: string; field: string; value: any }[];
|
|
24
|
+
sort?: { field: string; dir: string }[];
|
|
25
|
+
defaultSort?: { field: string; dir: string }[];
|
|
26
|
+
pagination?: { skip: number; take: number };
|
|
27
|
+
defaultPagination?: { skip: number; take: number };
|
|
28
|
+
userView: UserViewData;
|
|
29
|
+
processing?: boolean;
|
|
30
|
+
enableDataLoading: boolean;
|
|
31
|
+
defaultGroups?: { field: string; dir: string }[];
|
|
32
|
+
defaultColumns?: any[];
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const getInitialData = (): ToolbarData => {
|
|
36
|
+
const defaultAdvancedFilterRow = _.cloneDeep(
|
|
37
|
+
getAdvancedSearchIntitialFilterRow()
|
|
38
|
+
);
|
|
39
|
+
const initialState: ToolbarData = {
|
|
40
|
+
globalSearch: { filterQuery: "", appliedQuery: "" },
|
|
41
|
+
advancedSearch: {
|
|
42
|
+
appliedQuery: { criteria: "", filters: [] },
|
|
43
|
+
filterRows: [defaultAdvancedFilterRow],
|
|
44
|
+
criteria: defaultAdvancedFilterRow.idLabel,
|
|
45
|
+
},
|
|
46
|
+
quickFilter: {
|
|
47
|
+
appliedQuery: {
|
|
48
|
+
criteria: "",
|
|
49
|
+
filterRows: [],
|
|
50
|
+
joinCriteria: OperatorCreiteria.AND,
|
|
51
|
+
},
|
|
52
|
+
filterRows: [],
|
|
53
|
+
},
|
|
54
|
+
groupedBy: {
|
|
55
|
+
appliedGroups: [],
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
setting: {
|
|
59
|
+
activeDataWidgetType: DataWidgetType.GRID,
|
|
60
|
+
columnChooser: {
|
|
61
|
+
appliedColumns: [],
|
|
62
|
+
allColumns: [],
|
|
63
|
+
selectedColumns: [],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
reset: 0,
|
|
67
|
+
userView: {
|
|
68
|
+
selectedView: undefined,
|
|
69
|
+
allViews: [_.cloneDeep(_defaultView)],
|
|
70
|
+
},
|
|
71
|
+
enableDataLoading: false,
|
|
72
|
+
};
|
|
73
|
+
return initialState;
|
|
74
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FilterTargetType, OperatorCreiteria } from "../../enum";
|
|
2
|
+
import { ValueLoadType } from "../../type";
|
|
3
|
+
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
|
+
export type QuickFilterData = {
|
|
6
|
+
appliedQuery: {
|
|
7
|
+
criteria: string;
|
|
8
|
+
filterRows: FilterExpression[];
|
|
9
|
+
joinCriteria: OperatorCreiteria;
|
|
10
|
+
};
|
|
11
|
+
filterRows: FilterExpression[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type FilterExpression = {
|
|
15
|
+
id: string;
|
|
16
|
+
propertyToFilter: FilterTarget;
|
|
17
|
+
allValues?: FilterValue[];
|
|
18
|
+
value?: FilterValue | FilterValue[];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type FilterTarget = {
|
|
22
|
+
label: string;
|
|
23
|
+
apiPropertyName: string;
|
|
24
|
+
dataProvider?: {
|
|
25
|
+
key?: string;
|
|
26
|
+
value?: FilterValue | FilterValue[];
|
|
27
|
+
valueLoadType: ValueLoadType;
|
|
28
|
+
};
|
|
29
|
+
type: FilterTargetType;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type FilterValue =
|
|
33
|
+
| { label: string; value: any }
|
|
34
|
+
| string
|
|
35
|
+
| number
|
|
36
|
+
| Date
|
|
37
|
+
| boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DataWidgetType } from "../../Components/Setting/Setting";
|
|
2
|
+
|
|
3
|
+
export type SettingData = {
|
|
4
|
+
activeDataWidgetType: DataWidgetType;
|
|
5
|
+
columnChooser: ColumnChooserData;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type ColumnChooserData = {
|
|
9
|
+
appliedColumns: ChooserColumn[];
|
|
10
|
+
allColumns: ChooserColumn[];
|
|
11
|
+
selectedColumns: ChooserColumn[];
|
|
12
|
+
};
|
|
13
|
+
export type ChooserColumn = {
|
|
14
|
+
id: number;
|
|
15
|
+
label: string;
|
|
16
|
+
field: string;
|
|
17
|
+
selected: boolean;
|
|
18
|
+
includeInCard: boolean;
|
|
19
|
+
isFreezed: boolean;
|
|
20
|
+
order: number;
|
|
21
|
+
width?: number;
|
|
22
|
+
primary: boolean;
|
|
23
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export enum OperatorCreiteria {
|
|
2
|
+
AND = "AND",
|
|
3
|
+
OR = "OR",
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export enum FilterTargetType {
|
|
7
|
+
TEXT = "TEXT",
|
|
8
|
+
DATE = "DATE",
|
|
9
|
+
NUMBER = "NUMBER",
|
|
10
|
+
LIST = "LIST",
|
|
11
|
+
BOOLEAN = "BOOLEAN",
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export enum Operator {
|
|
15
|
+
Equal,
|
|
16
|
+
NotEqual,
|
|
17
|
+
Like,
|
|
18
|
+
NotLike,
|
|
19
|
+
In,
|
|
20
|
+
NotIn,
|
|
21
|
+
LessThan,
|
|
22
|
+
LessThanOrEqual,
|
|
23
|
+
GreaterThan,
|
|
24
|
+
GreaterThanOrEqual,
|
|
25
|
+
Between,
|
|
26
|
+
NotBetween,
|
|
27
|
+
IsNull,
|
|
28
|
+
IsNotNull,
|
|
29
|
+
}
|