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,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ToolbarOptions } from "./type";
|
|
3
|
+
import { ExportType } from "./Components/Export/type";
|
|
4
|
+
interface GridToolBarViewProps {
|
|
5
|
+
widgetStyle?: {
|
|
6
|
+
id?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
inline?: React.CSSProperties;
|
|
9
|
+
};
|
|
10
|
+
toolBarOptions: ToolbarOptions;
|
|
11
|
+
config: {
|
|
12
|
+
uiElementGroupId: string;
|
|
13
|
+
};
|
|
14
|
+
uiElementGroupData: Record<string, any>;
|
|
15
|
+
loadTemplateSupportiveData?: (callBack: (args: any) => void, supportiveKeys: any) => Promise<any>;
|
|
16
|
+
onModelUpdate: (callBack: ((args: any) => void) | null, fieldName: string, value: any) => void;
|
|
17
|
+
onExport?: (callBack: ((args: any) => void) | null, exportType: ExportType) => void;
|
|
18
|
+
onExportDelete: (callBack: ((args: any) => void) | null, id: string) => void;
|
|
19
|
+
onExportList: (callBack: ((args: any) => void) | null) => void;
|
|
20
|
+
onExportDownload: (callBack: ((args: any) => void) | null, id: string) => void;
|
|
21
|
+
}
|
|
22
|
+
declare const GridToolBarView: ({ widgetStyle, toolBarOptions, config, uiElementGroupData, loadTemplateSupportiveData, onModelUpdate, onExport, onExportDelete, onExportList, onExportDownload }: GridToolBarViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default GridToolBarView;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FilterTargetType, Operator, OperatorCreiteria } from "../../enum";
|
|
2
|
+
import { ValueLoadType } from "../../type";
|
|
3
|
+
export type AdvancedSearchData = {
|
|
4
|
+
appliedQuery: {
|
|
5
|
+
criteria: string;
|
|
6
|
+
filters: FilterExpression[];
|
|
7
|
+
};
|
|
8
|
+
filterRows: FilterExpressionViewModel[];
|
|
9
|
+
criteria: string;
|
|
10
|
+
};
|
|
11
|
+
export type FilterExpression = {
|
|
12
|
+
id: string;
|
|
13
|
+
propertyToFilter: FilterTarget;
|
|
14
|
+
operator: {
|
|
15
|
+
label: string;
|
|
16
|
+
value: Operator | null;
|
|
17
|
+
};
|
|
18
|
+
value?: FilterValue | FilterValue[];
|
|
19
|
+
selectedCriteria: OperatorCreiteria;
|
|
20
|
+
};
|
|
21
|
+
export type FilterTarget = {
|
|
22
|
+
label: string;
|
|
23
|
+
value: any;
|
|
24
|
+
apiPropertyName: string;
|
|
25
|
+
dataProvider?: {
|
|
26
|
+
key?: string;
|
|
27
|
+
value?: FilterValue | FilterValue[];
|
|
28
|
+
valueLoadType: ValueLoadType;
|
|
29
|
+
};
|
|
30
|
+
type: FilterTargetType;
|
|
31
|
+
};
|
|
32
|
+
export type FilterValue = {
|
|
33
|
+
label: string;
|
|
34
|
+
value: any;
|
|
35
|
+
} | string | number | Date | boolean;
|
|
36
|
+
export type FilterExpressionViewModel = {
|
|
37
|
+
id: string;
|
|
38
|
+
idLabel: string;
|
|
39
|
+
allPropertieseToFilter: FilterTarget[];
|
|
40
|
+
alloperators: {
|
|
41
|
+
label: string;
|
|
42
|
+
value: Operator | null;
|
|
43
|
+
}[];
|
|
44
|
+
allValues?: FilterValue[] | FilterValue;
|
|
45
|
+
selectedFilter: FilterExpression;
|
|
46
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { AdvancedSearchData } from "./advancedSearch";
|
|
2
|
+
import { GlobalSearchData } from "./globalSearch";
|
|
3
|
+
import { GroupedByData } from "./groupBy";
|
|
4
|
+
import { QuickFilterData } from "./quickFilter";
|
|
5
|
+
import { SettingData } from "./setting";
|
|
6
|
+
import { UserViewData } from "./userView";
|
|
7
|
+
export type ToolbarData = {
|
|
8
|
+
globalSearch: GlobalSearchData;
|
|
9
|
+
advancedSearch: AdvancedSearchData;
|
|
10
|
+
quickFilter: QuickFilterData;
|
|
11
|
+
groupedBy: GroupedByData;
|
|
12
|
+
setting: SettingData;
|
|
13
|
+
reset: number;
|
|
14
|
+
lazyLoad?: boolean;
|
|
15
|
+
globalFilters?: {
|
|
16
|
+
pattern: string;
|
|
17
|
+
filters: any[];
|
|
18
|
+
};
|
|
19
|
+
localSearch?: {
|
|
20
|
+
id: string;
|
|
21
|
+
field: string;
|
|
22
|
+
value: any;
|
|
23
|
+
}[];
|
|
24
|
+
sort?: {
|
|
25
|
+
field: string;
|
|
26
|
+
dir: string;
|
|
27
|
+
}[];
|
|
28
|
+
defaultSort?: {
|
|
29
|
+
field: string;
|
|
30
|
+
dir: string;
|
|
31
|
+
}[];
|
|
32
|
+
pagination?: {
|
|
33
|
+
skip: number;
|
|
34
|
+
take: number;
|
|
35
|
+
};
|
|
36
|
+
defaultPagination?: {
|
|
37
|
+
skip: number;
|
|
38
|
+
take: number;
|
|
39
|
+
};
|
|
40
|
+
userView: UserViewData;
|
|
41
|
+
processing?: boolean;
|
|
42
|
+
enableDataLoading: boolean;
|
|
43
|
+
defaultGroups?: {
|
|
44
|
+
field: string;
|
|
45
|
+
dir: string;
|
|
46
|
+
}[];
|
|
47
|
+
defaultColumns?: any[];
|
|
48
|
+
};
|
|
49
|
+
export declare const getInitialData: () => ToolbarData;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FilterTargetType, OperatorCreiteria } from "../../enum";
|
|
2
|
+
import { ValueLoadType } from "../../type";
|
|
3
|
+
export type QuickFilterData = {
|
|
4
|
+
appliedQuery: {
|
|
5
|
+
criteria: string;
|
|
6
|
+
filterRows: FilterExpression[];
|
|
7
|
+
joinCriteria: OperatorCreiteria;
|
|
8
|
+
};
|
|
9
|
+
filterRows: FilterExpression[];
|
|
10
|
+
};
|
|
11
|
+
export type FilterExpression = {
|
|
12
|
+
id: string;
|
|
13
|
+
propertyToFilter: FilterTarget;
|
|
14
|
+
allValues?: FilterValue[];
|
|
15
|
+
value?: FilterValue | FilterValue[];
|
|
16
|
+
};
|
|
17
|
+
export type FilterTarget = {
|
|
18
|
+
label: string;
|
|
19
|
+
apiPropertyName: string;
|
|
20
|
+
dataProvider?: {
|
|
21
|
+
key?: string;
|
|
22
|
+
value?: FilterValue | FilterValue[];
|
|
23
|
+
valueLoadType: ValueLoadType;
|
|
24
|
+
};
|
|
25
|
+
type: FilterTargetType;
|
|
26
|
+
};
|
|
27
|
+
export type FilterValue = {
|
|
28
|
+
label: string;
|
|
29
|
+
value: any;
|
|
30
|
+
} | string | number | Date | boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DataWidgetType } from "../../Components/Setting/Setting";
|
|
2
|
+
export type SettingData = {
|
|
3
|
+
activeDataWidgetType: DataWidgetType;
|
|
4
|
+
columnChooser: ColumnChooserData;
|
|
5
|
+
};
|
|
6
|
+
export type ColumnChooserData = {
|
|
7
|
+
appliedColumns: ChooserColumn[];
|
|
8
|
+
allColumns: ChooserColumn[];
|
|
9
|
+
selectedColumns: ChooserColumn[];
|
|
10
|
+
};
|
|
11
|
+
export type ChooserColumn = {
|
|
12
|
+
id: number;
|
|
13
|
+
label: string;
|
|
14
|
+
field: string;
|
|
15
|
+
selected: boolean;
|
|
16
|
+
includeInCard: boolean;
|
|
17
|
+
isFreezed: boolean;
|
|
18
|
+
order: number;
|
|
19
|
+
width?: number;
|
|
20
|
+
primary: boolean;
|
|
21
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare enum OperatorCreiteria {
|
|
2
|
+
AND = "AND",
|
|
3
|
+
OR = "OR"
|
|
4
|
+
}
|
|
5
|
+
export declare enum FilterTargetType {
|
|
6
|
+
TEXT = "TEXT",
|
|
7
|
+
DATE = "DATE",
|
|
8
|
+
NUMBER = "NUMBER",
|
|
9
|
+
LIST = "LIST",
|
|
10
|
+
BOOLEAN = "BOOLEAN"
|
|
11
|
+
}
|
|
12
|
+
export declare enum Operator {
|
|
13
|
+
Equal = 0,
|
|
14
|
+
NotEqual = 1,
|
|
15
|
+
Like = 2,
|
|
16
|
+
NotLike = 3,
|
|
17
|
+
In = 4,
|
|
18
|
+
NotIn = 5,
|
|
19
|
+
LessThan = 6,
|
|
20
|
+
LessThanOrEqual = 7,
|
|
21
|
+
GreaterThan = 8,
|
|
22
|
+
GreaterThanOrEqual = 9,
|
|
23
|
+
Between = 10,
|
|
24
|
+
NotBetween = 11,
|
|
25
|
+
IsNull = 12,
|
|
26
|
+
IsNotNull = 13
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getUniqueId: () => string;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { DataWidgetType } from "./Components/Setting/Setting";
|
|
2
|
+
import { FilterTarget } from "./data/advancedSearch";
|
|
3
|
+
import { FilterTarget as FilterTargetQuick } from "./data/quickFilter";
|
|
4
|
+
import { ChooserColumn } from "./data/setting";
|
|
5
|
+
export type ActionProps = {
|
|
6
|
+
onExport?: (callBack: ((args: any) => void) | null, exportType: string) => void;
|
|
7
|
+
onExportDelete: (callBack: ((args: any) => void) | null, id: string) => void;
|
|
8
|
+
onExportList: (callBack: ((args: any) => void) | null) => void;
|
|
9
|
+
onExportDownload: (callBack: ((args: any) => void) | null, id: string) => void;
|
|
10
|
+
onModelUpdate: (callBack: ((args: any) => void) | null, fieldName: string, value: any) => void;
|
|
11
|
+
loadTemplateSupportiveData?: (callBack: (args: any) => void, supportiveKeys: any) => Promise<any>;
|
|
12
|
+
onScreenDataLoad?: (callBack: (response: any) => void) => void;
|
|
13
|
+
};
|
|
14
|
+
export type ToolbarOptions = {
|
|
15
|
+
globalSearch: GlobalSearch;
|
|
16
|
+
advancedSearch: AdvancedSearch;
|
|
17
|
+
quickFilter: QuickFilter;
|
|
18
|
+
groupBy: GroupBy;
|
|
19
|
+
reset: Reset;
|
|
20
|
+
setting: Setting;
|
|
21
|
+
userView: UserView;
|
|
22
|
+
export: Export;
|
|
23
|
+
};
|
|
24
|
+
type VisibleProps = {
|
|
25
|
+
visible: boolean;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
};
|
|
28
|
+
type GlobalSearch = VisibleProps;
|
|
29
|
+
type AdvancedSearch = VisibleProps & {
|
|
30
|
+
filterableFields: FilterTarget[];
|
|
31
|
+
};
|
|
32
|
+
type QuickFilter = VisibleProps & {
|
|
33
|
+
filterRows: FilterTargetQuick[];
|
|
34
|
+
};
|
|
35
|
+
type GroupBy = VisibleProps & {
|
|
36
|
+
groupableFields: {
|
|
37
|
+
label: string;
|
|
38
|
+
value: string;
|
|
39
|
+
}[];
|
|
40
|
+
};
|
|
41
|
+
type Reset = VisibleProps;
|
|
42
|
+
type Setting = VisibleProps & {
|
|
43
|
+
disableColumnChooser: boolean;
|
|
44
|
+
disabledDisplayWidgetType: boolean;
|
|
45
|
+
activeDataWidgetType: DataWidgetType;
|
|
46
|
+
columns: ChooserColumn[];
|
|
47
|
+
};
|
|
48
|
+
type UserView = VisibleProps & {
|
|
49
|
+
enableDefaultSaveInSession: boolean;
|
|
50
|
+
};
|
|
51
|
+
type Export = VisibleProps;
|
|
52
|
+
export declare enum ValueLoadType {
|
|
53
|
+
"SELF" = "SELF",
|
|
54
|
+
"API" = "API",
|
|
55
|
+
"ADAPTER" = "ADAPTER",
|
|
56
|
+
"STATE" = "STATE"
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseProps } from "../../Factory/BaseType";
|
|
2
|
+
export type InformationAlertProps = BaseProps & {
|
|
3
|
+
messageHeader?: string;
|
|
4
|
+
messageBody?: string;
|
|
5
|
+
onConfirm?: () => void;
|
|
6
|
+
};
|
|
7
|
+
declare const InformationAlert: (props: InformationAlertProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default InformationAlert;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseProps } from "../../Factory/BaseType";
|
|
2
|
+
type InformationAlertViewProps = BaseProps & {
|
|
3
|
+
messageHeader?: string;
|
|
4
|
+
messageBody?: string;
|
|
5
|
+
onConfirm?: () => void;
|
|
6
|
+
};
|
|
7
|
+
declare const InformationAlertView: ({ widgetStyle, messageHeader, messageBody, onConfirm, }: InformationAlertViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default InformationAlertView;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseProps } from "../../Factory/BaseType";
|
|
2
|
+
export type MenuProps = BaseProps & {
|
|
3
|
+
menuItems?: ItemProps[];
|
|
4
|
+
onNavigate?: (callBack: undefined, path: string, navigationType: string) => void;
|
|
5
|
+
};
|
|
6
|
+
export type ItemProps = {
|
|
7
|
+
label: string;
|
|
8
|
+
path: string;
|
|
9
|
+
subItems: ItemProps[];
|
|
10
|
+
navigationType: string;
|
|
11
|
+
onNavigate: (path: string, navigationType: string) => void;
|
|
12
|
+
};
|
|
13
|
+
declare const Menu: (props: MenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default Menu;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as TemplateWidgetFactory, default } from "./Factory/TemplateWidgetFactory";
|
|
2
|
+
export { default as TemplateActionFactory } from "./Action/TemplateActionFactory";
|
|
3
|
+
export type { BaseProps } from './Factory/BaseType';
|
|
4
|
+
export type { TemplateActionType } from './Action/TemplateActionType';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getValueFromNestedObject: (fieldName: string, object: any) => any;
|
package/package.json
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "procode-vs-template",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "VarStreet Template Library - A comprehensive React template system with widget factories, action handlers, and SCSS styling for dynamic template creation",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.esm.js",
|
|
8
|
+
"types": "dist/types/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"src",
|
|
12
|
+
"README.md",
|
|
13
|
+
"CHANGELOG.md"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": "./dist/index.esm.js",
|
|
18
|
+
"require": "./dist/index.js",
|
|
19
|
+
"types": "./dist/types/index.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./factories": {
|
|
22
|
+
"import": "./dist/factories.esm.js",
|
|
23
|
+
"require": "./dist/factories.js",
|
|
24
|
+
"types": "./dist/types/factories.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"./actions": {
|
|
27
|
+
"import": "./dist/actions.esm.js",
|
|
28
|
+
"require": "./dist/actions.js",
|
|
29
|
+
"types": "./dist/types/actions.d.ts"
|
|
30
|
+
},
|
|
31
|
+
"./styles": "./src/assets/styles/_tempalte-base.scss"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"react",
|
|
35
|
+
"template",
|
|
36
|
+
"ui-library",
|
|
37
|
+
"factory",
|
|
38
|
+
"templates",
|
|
39
|
+
"typescript",
|
|
40
|
+
"varstreet",
|
|
41
|
+
"components",
|
|
42
|
+
"template-system",
|
|
43
|
+
"react-components",
|
|
44
|
+
"ui-components",
|
|
45
|
+
"widget-factory",
|
|
46
|
+
"action-factory",
|
|
47
|
+
"scss",
|
|
48
|
+
"styling"
|
|
49
|
+
],
|
|
50
|
+
"author": "VarStreet Team",
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"scripts": {
|
|
53
|
+
"start": "vite",
|
|
54
|
+
"build": "rollup -c",
|
|
55
|
+
"clean": "rimraf dist",
|
|
56
|
+
"prebuild": "npm run clean",
|
|
57
|
+
"prepublishOnly": "npm run build",
|
|
58
|
+
"postbuild": "powershell -Command \"New-Item -ItemType Directory -Path dist/src/assets/styles -Force; Copy-Item src/assets/styles/*.scss dist/src/assets/styles/\"",
|
|
59
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
60
|
+
"preview": "vite preview"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"@progress/kendo-react-buttons": "^8.1.1",
|
|
64
|
+
"@progress/kendo-react-dateinputs": "^8.1.1",
|
|
65
|
+
"@progress/kendo-react-dialogs": "^8.1.1",
|
|
66
|
+
"@progress/kendo-react-dropdowns": "^8.1.1",
|
|
67
|
+
"@progress/kendo-react-inputs": "^8.1.1",
|
|
68
|
+
"react": "^18.2.0",
|
|
69
|
+
"react-beautiful-dnd": "^13.1.1",
|
|
70
|
+
"react-dom": "^18.2.0",
|
|
71
|
+
"react-router-dom": "^6.22.3"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
75
|
+
"@rollup/plugin-image": "^3.0.3",
|
|
76
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
77
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
78
|
+
"@rollup/plugin-url": "^8.0.2",
|
|
79
|
+
"@types/react": "^18.2.15",
|
|
80
|
+
"@types/react-dom": "^18.2.7",
|
|
81
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
82
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
83
|
+
"@vitejs/plugin-react": "^4.0.3",
|
|
84
|
+
"eslint": "^8.45.0",
|
|
85
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
86
|
+
"eslint-plugin-react-refresh": "^0.4.3",
|
|
87
|
+
"fs": "^0.0.1-security",
|
|
88
|
+
"rimraf": "^5.0.10",
|
|
89
|
+
"rollup": "^4.18.0",
|
|
90
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
91
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
92
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
93
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
94
|
+
"sass": "^1.38.0",
|
|
95
|
+
"typescript": "^5.0.2",
|
|
96
|
+
"vite": "^4.4.5"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { handleMenuNavigation } from "./TemplateActions/handleMenuNavigation";
|
|
3
|
+
import { TemplateActionType } from "./TemplateActionType";
|
|
4
|
+
|
|
5
|
+
class TemplateActionFactory {
|
|
6
|
+
private static instance: TemplateActionFactory;
|
|
7
|
+
private actionMap: Map<string, any>;
|
|
8
|
+
|
|
9
|
+
private constructor() {
|
|
10
|
+
this.actionMap = new Map<string, any>([
|
|
11
|
+
[TemplateActionType.MENUNAVIGATE, handleMenuNavigation],
|
|
12
|
+
]);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static getInstance(): TemplateActionFactory {
|
|
16
|
+
if (!TemplateActionFactory.instance) {
|
|
17
|
+
TemplateActionFactory.instance = new TemplateActionFactory();
|
|
18
|
+
}
|
|
19
|
+
return TemplateActionFactory.instance;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
getAction(key: string): any {
|
|
23
|
+
return this.actionMap.get(key) || null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default TemplateActionFactory;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { NavigationType } from "../TemplateActionType";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
+
|
|
5
|
+
const navigationHandlers = {
|
|
6
|
+
[NavigationType.INTERNAL]: (path: string, actionInvokerProps: any) =>
|
|
7
|
+
actionInvokerProps.navigate(path),
|
|
8
|
+
[NavigationType.EXTERNAL]: (path: string) => (window.location.href = path),
|
|
9
|
+
[NavigationType.NEWWINDOW]: (path: string) => new Function(path)(),
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const handleMenuNavigation = (
|
|
13
|
+
actionInvokerProps: any,
|
|
14
|
+
path: string,
|
|
15
|
+
navigationType: string
|
|
16
|
+
) => {
|
|
17
|
+
const handler = navigationHandlers[navigationType as NavigationType];
|
|
18
|
+
if (handler) {
|
|
19
|
+
handler(path, actionInvokerProps);
|
|
20
|
+
} else {
|
|
21
|
+
console.warn(`Unknown navigation type: ${navigationType}`);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
export type BaseProps = {
|
|
3
|
+
widgetType?: string;
|
|
4
|
+
targetEntity?: string;
|
|
5
|
+
config: any;
|
|
6
|
+
screenDataField?: string;
|
|
7
|
+
targetScreenDataField?: string;
|
|
8
|
+
eventService?: any;
|
|
9
|
+
uiElementGroupData: Record<string, any>;
|
|
10
|
+
widgetStyle?: { id?: string; className?: string; inline?: React.CSSProperties };
|
|
11
|
+
viewModel?:Record<string,any>
|
|
12
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import ConfirmationAlert from "../Widgets/ConfirmationAlert";
|
|
4
|
+
import { WidgetTypes } from "../constant";
|
|
5
|
+
import GridToolBar from "../Widgets/GridToolBar/GridToolBar";
|
|
6
|
+
import InformationAlert from "../Widgets/InformationAlert/InformationAlert";
|
|
7
|
+
import Menu from "../Widgets/Menu";
|
|
8
|
+
import Block from "../Widgets/Block";
|
|
9
|
+
|
|
10
|
+
class TemplateWidgetFactory {
|
|
11
|
+
private standardWidgetFactory: any = undefined;
|
|
12
|
+
private customWidgetFactory?: any;
|
|
13
|
+
private static factory: TemplateWidgetFactory;
|
|
14
|
+
private widgetMap = new Map<string, React.FC<any>>();
|
|
15
|
+
|
|
16
|
+
private constructor() {
|
|
17
|
+
this.createWidgetMap();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static get(standardWidgetFactory: any, customWidgetFactory: any) {
|
|
21
|
+
if (!standardWidgetFactory && !customWidgetFactory) {
|
|
22
|
+
throw new Error("Widget Factory Not Assigned Error");
|
|
23
|
+
}
|
|
24
|
+
if (!TemplateWidgetFactory.factory) {
|
|
25
|
+
TemplateWidgetFactory.factory = new TemplateWidgetFactory();
|
|
26
|
+
}
|
|
27
|
+
TemplateWidgetFactory.factory.standardWidgetFactory = standardWidgetFactory;
|
|
28
|
+
TemplateWidgetFactory.factory.customWidgetFactory = customWidgetFactory;
|
|
29
|
+
return TemplateWidgetFactory.factory;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static getStandardFactory = () =>
|
|
33
|
+
TemplateWidgetFactory.factory.standardWidgetFactory;
|
|
34
|
+
|
|
35
|
+
static getCustomFactory = () =>
|
|
36
|
+
TemplateWidgetFactory.factory.customWidgetFactory;
|
|
37
|
+
|
|
38
|
+
private createWidgetMap(): void {
|
|
39
|
+
this.widgetMap.set(WidgetTypes.GRIDTOOLBAR, GridToolBar);
|
|
40
|
+
this.widgetMap.set(WidgetTypes.CONFOMATIONALERTBOX, ConfirmationAlert);
|
|
41
|
+
this.widgetMap.set(WidgetTypes.INFOMATIONALERTBOX, InformationAlert);
|
|
42
|
+
this.widgetMap.set(WidgetTypes.MENU, Menu);
|
|
43
|
+
this.widgetMap.set(WidgetTypes.BLOCK, Block);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
getWidgets(): Map<string, React.FC> {
|
|
47
|
+
return this.widgetMap;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export default TemplateWidgetFactory;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import TemplateWidgetFactory from "../Factory/TemplateWidgetFactory";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
+
const FactoryRenderer = (props: any) => {
|
|
5
|
+
const standardWidgets =
|
|
6
|
+
TemplateWidgetFactory.getStandardFactory()?.getWidgets();
|
|
7
|
+
const customWidgets = TemplateWidgetFactory.getCustomFactory()?.getWidgets();
|
|
8
|
+
|
|
9
|
+
const WidgetComponent = customWidgets?.get?.(props.widgetType) ??
|
|
10
|
+
standardWidgets?.get?.(props.widgetType) ?? <></>;
|
|
11
|
+
|
|
12
|
+
return <WidgetComponent {...props} />;
|
|
13
|
+
};
|
|
14
|
+
export default FactoryRenderer;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BlockProps } from "./types";
|
|
2
|
+
|
|
3
|
+
const BlockView = (props: BlockProps) => {
|
|
4
|
+
return (
|
|
5
|
+
<section
|
|
6
|
+
className={`tmpl-block-container ${props.widgetStyle?.className ?? ""}`}
|
|
7
|
+
id={props.widgetStyle?.id ?? ""}
|
|
8
|
+
style={{ ...(props.widgetStyle?.inline ?? {}) }}
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
className={`tmpl-block__item ${
|
|
12
|
+
props.enableBorder ? "tmpl-border" : ""
|
|
13
|
+
}`}
|
|
14
|
+
>
|
|
15
|
+
<div
|
|
16
|
+
className={`tmpl-block__header ${
|
|
17
|
+
props.enableHeaderBorder ? "tmpl-border-header" : ""
|
|
18
|
+
}`}
|
|
19
|
+
>
|
|
20
|
+
{props.title}
|
|
21
|
+
</div>
|
|
22
|
+
<div
|
|
23
|
+
className="tmpl-block__value"
|
|
24
|
+
dangerouslySetInnerHTML={{ __html: props.value ?? "-" }}
|
|
25
|
+
></div>
|
|
26
|
+
</div>
|
|
27
|
+
</section>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default BlockView;
|