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.
Files changed (191) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +188 -0
  3. package/dist/actions.esm.js +53 -0
  4. package/dist/actions.esm.js.map +1 -0
  5. package/dist/actions.js +55 -0
  6. package/dist/actions.js.map +1 -0
  7. package/dist/assets/delete.png +0 -0
  8. package/dist/assets/info.svg +5 -0
  9. package/dist/assets/react.svg +1 -0
  10. package/dist/assets/styles/_tempalte-base.scss +5 -0
  11. package/dist/factories.esm.js +39149 -0
  12. package/dist/factories.esm.js.map +1 -0
  13. package/dist/factories.js +39169 -0
  14. package/dist/factories.js.map +1 -0
  15. package/dist/index.esm.js +39200 -0
  16. package/dist/index.esm.js.map +1 -0
  17. package/dist/index.js +39224 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/src/assets/styles/_tempalte-base.scss +5 -0
  20. package/dist/types/Action/TemplateActionFactory.d.ts +8 -0
  21. package/dist/types/Action/TemplateActionType.d.ts +8 -0
  22. package/dist/types/Action/TemplateActions/handleMenuNavigation.d.ts +1 -0
  23. package/dist/types/Factory/BaseType.d.ts +16 -0
  24. package/dist/types/Factory/TemplateWidgetFactory.d.ts +14 -0
  25. package/dist/types/Renderer/index.d.ts +2 -0
  26. package/dist/types/Widgets/Block/BlockView.d.ts +3 -0
  27. package/dist/types/Widgets/Block/index.d.ts +3 -0
  28. package/dist/types/Widgets/Block/types.d.ts +12 -0
  29. package/dist/types/Widgets/ConfirmationAlert/ConfirmationAlertView.d.ts +14 -0
  30. package/dist/types/Widgets/ConfirmationAlert/index.d.ts +11 -0
  31. package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/AdvancedSearch.d.ts +15 -0
  32. package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/AdvancedSearchView.d.ts +6 -0
  33. package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/Filter.d.ts +20 -0
  34. package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/FilterPopup.d.ts +13 -0
  35. package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/FilterPopupView.d.ts +25 -0
  36. package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/TypeBasedWidgetFactory.d.ts +8 -0
  37. package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/constant.d.ts +8 -0
  38. package/dist/types/Widgets/GridToolBar/Components/AdvancedSearch/helper/AdvancedSearchFunctions.d.ts +7 -0
  39. package/dist/types/Widgets/GridToolBar/Components/Export/Export.d.ts +14 -0
  40. package/dist/types/Widgets/GridToolBar/Components/Export/ExportPopup.d.ts +20 -0
  41. package/dist/types/Widgets/GridToolBar/Components/Export/ExportView.d.ts +6 -0
  42. package/dist/types/Widgets/GridToolBar/Components/Export/type.d.ts +4 -0
  43. package/dist/types/Widgets/GridToolBar/Components/GlobalSearch/GlobalSearch.d.ts +11 -0
  44. package/dist/types/Widgets/GridToolBar/Components/GlobalSearch/GlobalSearchView.d.ts +9 -0
  45. package/dist/types/Widgets/GridToolBar/Components/GroupBy/GroupByPopUp.d.ts +17 -0
  46. package/dist/types/Widgets/GridToolBar/Components/GroupBy/GroupByView.d.ts +6 -0
  47. package/dist/types/Widgets/GridToolBar/Components/GroupBy/index.d.ts +15 -0
  48. package/dist/types/Widgets/GridToolBar/Components/QuickFilter/FilterPopup.d.ts +10 -0
  49. package/dist/types/Widgets/GridToolBar/Components/QuickFilter/QuickFilterView.d.ts +6 -0
  50. package/dist/types/Widgets/GridToolBar/Components/QuickFilter/index.d.ts +12 -0
  51. package/dist/types/Widgets/GridToolBar/Components/Reset/ResetView.d.ts +6 -0
  52. package/dist/types/Widgets/GridToolBar/Components/Reset/index.d.ts +11 -0
  53. package/dist/types/Widgets/GridToolBar/Components/ScreenView/CreateScreenPopup.d.ts +6 -0
  54. package/dist/types/Widgets/GridToolBar/Components/ScreenView/UserView.d.ts +26 -0
  55. package/dist/types/Widgets/GridToolBar/Components/ScreenView/UserViewView.d.ts +13 -0
  56. package/dist/types/Widgets/GridToolBar/Components/ScreenView/ViewItem.d.ts +11 -0
  57. package/dist/types/Widgets/GridToolBar/Components/ScreenView/actions/index.d.ts +8 -0
  58. package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/deserializedScreenView.d.ts +4 -0
  59. package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/getSavedSystemDefault.d.ts +2 -0
  60. package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/saveSystemDefaultInSession.d.ts +1 -0
  61. package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/advancedSearchHandler.d.ts +1 -0
  62. package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/globalSearchHandler.d.ts +1 -0
  63. package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/groupByHandler.d.ts +1 -0
  64. package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/localSearchHandler.d.ts +1 -0
  65. package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/paginationHandler.d.ts +1 -0
  66. package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/quickFilterHandler.d.ts +1 -0
  67. package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/settingHandler.d.ts +1 -0
  68. package/dist/types/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/sortHandler.d.ts +1 -0
  69. package/dist/types/Widgets/GridToolBar/Components/ScreenView/services/index.d.ts +6 -0
  70. package/dist/types/Widgets/GridToolBar/Components/Setting/ColumnChooser/ColumnChooser.d.ts +15 -0
  71. package/dist/types/Widgets/GridToolBar/Components/Setting/ColumnChooser/ColumnChooserView.d.ts +17 -0
  72. package/dist/types/Widgets/GridToolBar/Components/Setting/ColumnChooser/DragDropContext.d.ts +9 -0
  73. package/dist/types/Widgets/GridToolBar/Components/Setting/Setting.d.ts +19 -0
  74. package/dist/types/Widgets/GridToolBar/Components/Setting/SettingPopup.d.ts +9 -0
  75. package/dist/types/Widgets/GridToolBar/Components/Setting/SettingView.d.ts +6 -0
  76. package/dist/types/Widgets/GridToolBar/GridToolBar.d.ts +8 -0
  77. package/dist/types/Widgets/GridToolBar/GridToolBarView.d.ts +23 -0
  78. package/dist/types/Widgets/GridToolBar/data/advancedSearch/index.d.ts +46 -0
  79. package/dist/types/Widgets/GridToolBar/data/globalSearch/index.d.ts +4 -0
  80. package/dist/types/Widgets/GridToolBar/data/groupBy/index.d.ts +6 -0
  81. package/dist/types/Widgets/GridToolBar/data/index.d.ts +49 -0
  82. package/dist/types/Widgets/GridToolBar/data/quickFilter/index.d.ts +30 -0
  83. package/dist/types/Widgets/GridToolBar/data/setting/index.d.ts +21 -0
  84. package/dist/types/Widgets/GridToolBar/data/userView/index.d.ts +10 -0
  85. package/dist/types/Widgets/GridToolBar/enum/index.d.ts +27 -0
  86. package/dist/types/Widgets/GridToolBar/helper/getUniqueId.d.ts +1 -0
  87. package/dist/types/Widgets/GridToolBar/type.d.ts +58 -0
  88. package/dist/types/Widgets/InformationAlert/InformationAlert.d.ts +8 -0
  89. package/dist/types/Widgets/InformationAlert/InformationAlertView.d.ts +8 -0
  90. package/dist/types/Widgets/Menu/MenuMainHeader.d.ts +3 -0
  91. package/dist/types/Widgets/Menu/MenuSubHeader.d.ts +3 -0
  92. package/dist/types/Widgets/Menu/MenuSubItem.d.ts +3 -0
  93. package/dist/types/Widgets/Menu/MenuView.d.ts +6 -0
  94. package/dist/types/Widgets/Menu/index.d.ts +14 -0
  95. package/dist/types/actions.d.ts +2 -0
  96. package/dist/types/constant.d.ts +8 -0
  97. package/dist/types/factories.d.ts +2 -0
  98. package/dist/types/index.d.ts +4 -0
  99. package/dist/types/utils/getValueFromNestedObject.d.ts +1 -0
  100. package/package.json +98 -0
  101. package/src/Action/TemplateActionFactory.ts +27 -0
  102. package/src/Action/TemplateActionType.ts +8 -0
  103. package/src/Action/TemplateActions/handleMenuNavigation.ts +23 -0
  104. package/src/Factory/BaseType.ts +12 -0
  105. package/src/Factory/TemplateWidgetFactory.tsx +50 -0
  106. package/src/Renderer/index.tsx +14 -0
  107. package/src/Widgets/Block/BlockView.tsx +31 -0
  108. package/src/Widgets/Block/Styles/index.scss +41 -0
  109. package/src/Widgets/Block/index.tsx +8 -0
  110. package/src/Widgets/Block/types.ts +11 -0
  111. package/src/Widgets/ConfirmationAlert/ConfirmationAlertView.tsx +90 -0
  112. package/src/Widgets/ConfirmationAlert/index.tsx +16 -0
  113. package/src/Widgets/ConfirmationAlert/scss/index.scss +66 -0
  114. package/src/Widgets/GridToolBar/Components/AdvancedSearch/AdvancedSearch.tsx +83 -0
  115. package/src/Widgets/GridToolBar/Components/AdvancedSearch/AdvancedSearchView.tsx +25 -0
  116. package/src/Widgets/GridToolBar/Components/AdvancedSearch/Filter.tsx +162 -0
  117. package/src/Widgets/GridToolBar/Components/AdvancedSearch/FilterPopup.tsx +437 -0
  118. package/src/Widgets/GridToolBar/Components/AdvancedSearch/FilterPopupView.tsx +111 -0
  119. package/src/Widgets/GridToolBar/Components/AdvancedSearch/TypeBasedWidgetFactory.tsx +226 -0
  120. package/src/Widgets/GridToolBar/Components/AdvancedSearch/constant.ts +55 -0
  121. package/src/Widgets/GridToolBar/Components/AdvancedSearch/helper/AdvancedSearchFunctions.ts +36 -0
  122. package/src/Widgets/GridToolBar/Components/Export/Export.tsx +57 -0
  123. package/src/Widgets/GridToolBar/Components/Export/ExportPopup.tsx +388 -0
  124. package/src/Widgets/GridToolBar/Components/Export/ExportView.tsx +21 -0
  125. package/src/Widgets/GridToolBar/Components/Export/type.ts +4 -0
  126. package/src/Widgets/GridToolBar/Components/GlobalSearch/GlobalSearch.tsx +95 -0
  127. package/src/Widgets/GridToolBar/Components/GlobalSearch/GlobalSearchView.tsx +65 -0
  128. package/src/Widgets/GridToolBar/Components/GroupBy/GroupByPopUp.tsx +115 -0
  129. package/src/Widgets/GridToolBar/Components/GroupBy/GroupByView.tsx +21 -0
  130. package/src/Widgets/GridToolBar/Components/GroupBy/index.tsx +84 -0
  131. package/src/Widgets/GridToolBar/Components/QuickFilter/FilterPopup.tsx +41 -0
  132. package/src/Widgets/GridToolBar/Components/QuickFilter/QuickFilterView.tsx +23 -0
  133. package/src/Widgets/GridToolBar/Components/QuickFilter/index.tsx +199 -0
  134. package/src/Widgets/GridToolBar/Components/Reset/ResetView.tsx +22 -0
  135. package/src/Widgets/GridToolBar/Components/Reset/index.tsx +41 -0
  136. package/src/Widgets/GridToolBar/Components/ScreenView/CreateScreenPopup.tsx +88 -0
  137. package/src/Widgets/GridToolBar/Components/ScreenView/UserView.tsx +266 -0
  138. package/src/Widgets/GridToolBar/Components/ScreenView/UserViewView.tsx +67 -0
  139. package/src/Widgets/GridToolBar/Components/ScreenView/ViewItem.tsx +94 -0
  140. package/src/Widgets/GridToolBar/Components/ScreenView/actions/index.ts +20 -0
  141. package/src/Widgets/GridToolBar/Components/ScreenView/helpers/deserializedScreenView.ts +19 -0
  142. package/src/Widgets/GridToolBar/Components/ScreenView/helpers/getSavedSystemDefault.ts +18 -0
  143. package/src/Widgets/GridToolBar/Components/ScreenView/helpers/saveSystemDefaultInSession.ts +12 -0
  144. package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/advancedSearchHandler.ts +32 -0
  145. package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/globalSearchHandler.ts +13 -0
  146. package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/groupByHandler.ts +8 -0
  147. package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/localSearchHandler.ts +6 -0
  148. package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/paginationHandler.ts +6 -0
  149. package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/quickFilterHandler.ts +13 -0
  150. package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/settingHandler.ts +19 -0
  151. package/src/Widgets/GridToolBar/Components/ScreenView/helpers/uiElementHandler/sortHandler.ts +6 -0
  152. package/src/Widgets/GridToolBar/Components/ScreenView/services/index.ts +63 -0
  153. package/src/Widgets/GridToolBar/Components/Setting/ColumnChooser/ColumnChooser.tsx +274 -0
  154. package/src/Widgets/GridToolBar/Components/Setting/ColumnChooser/ColumnChooserView.tsx +154 -0
  155. package/src/Widgets/GridToolBar/Components/Setting/ColumnChooser/DragDropContext.tsx +76 -0
  156. package/src/Widgets/GridToolBar/Components/Setting/Setting.tsx +116 -0
  157. package/src/Widgets/GridToolBar/Components/Setting/SettingPopup.tsx +23 -0
  158. package/src/Widgets/GridToolBar/Components/Setting/SettingView.tsx +23 -0
  159. package/src/Widgets/GridToolBar/GridToolBar.tsx +111 -0
  160. package/src/Widgets/GridToolBar/GridToolBarView.tsx +138 -0
  161. package/src/Widgets/GridToolBar/data/advancedSearch/index.ts +45 -0
  162. package/src/Widgets/GridToolBar/data/globalSearch/index.ts +4 -0
  163. package/src/Widgets/GridToolBar/data/groupBy/index.ts +3 -0
  164. package/src/Widgets/GridToolBar/data/index.ts +74 -0
  165. package/src/Widgets/GridToolBar/data/quickFilter/index.ts +37 -0
  166. package/src/Widgets/GridToolBar/data/setting/index.ts +23 -0
  167. package/src/Widgets/GridToolBar/data/userView/index.ts +11 -0
  168. package/src/Widgets/GridToolBar/enum/index.ts +29 -0
  169. package/src/Widgets/GridToolBar/helper/getUniqueId.ts +2 -0
  170. package/src/Widgets/GridToolBar/scss/index.scss +834 -0
  171. package/src/Widgets/GridToolBar/type.ts +63 -0
  172. package/src/Widgets/InformationAlert/InformationAlert.tsx +12 -0
  173. package/src/Widgets/InformationAlert/InformationAlertView.tsx +46 -0
  174. package/src/Widgets/InformationAlert/scss/index.scss +73 -0
  175. package/src/Widgets/Menu/MenuMainHeader.tsx +28 -0
  176. package/src/Widgets/Menu/MenuSubHeader.tsx +20 -0
  177. package/src/Widgets/Menu/MenuSubItem.tsx +10 -0
  178. package/src/Widgets/Menu/MenuView.tsx +19 -0
  179. package/src/Widgets/Menu/index.json +245 -0
  180. package/src/Widgets/Menu/index.tsx +32 -0
  181. package/src/Widgets/Menu/scss/index.scss +93 -0
  182. package/src/actions.ts +5 -0
  183. package/src/assets/delete.png +0 -0
  184. package/src/assets/info.svg +5 -0
  185. package/src/assets/react.svg +1 -0
  186. package/src/assets/styles/_tempalte-base.scss +5 -0
  187. package/src/constant.ts +8 -0
  188. package/src/factories.ts +5 -0
  189. package/src/index.ts +12 -0
  190. package/src/utils/getValueFromNestedObject.ts +14 -0
  191. 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,4 @@
1
+ export type GlobalSearchData = {
2
+ filterQuery: string;
3
+ appliedQuery: string;
4
+ };
@@ -0,0 +1,6 @@
1
+ export type GroupedByData = {
2
+ appliedGroups: {
3
+ label: string;
4
+ value: string;
5
+ }[];
6
+ };
@@ -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,10 @@
1
+ export type UserViewData = {
2
+ selectedView?: View;
3
+ allViews: View[];
4
+ };
5
+ export type View = {
6
+ id: string;
7
+ name: string;
8
+ isDefault: boolean;
9
+ isSelected: boolean;
10
+ };
@@ -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,3 @@
1
+ import { ItemProps } from ".";
2
+ declare const MenuMainHeader: (props: ItemProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default MenuMainHeader;
@@ -0,0 +1,3 @@
1
+ import { ItemProps } from ".";
2
+ declare const MenuSubHeader: (props: ItemProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default MenuSubHeader;
@@ -0,0 +1,3 @@
1
+ import { ItemProps } from ".";
2
+ declare const MenuSubItem: (props: ItemProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default MenuSubItem;
@@ -0,0 +1,6 @@
1
+ import { ItemProps } from ".";
2
+ declare const MenuView: ({ menuItems, onNavigate, }: {
3
+ menuItems: ItemProps[];
4
+ onNavigate: (path: string, navigationType: string) => void;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ export default MenuView;
@@ -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,2 @@
1
+ export { default as TemplateActionFactory } from './Action/TemplateActionFactory';
2
+ export type { TemplateActionType } from './Action/TemplateActionType';
@@ -0,0 +1,8 @@
1
+ export declare enum WidgetTypes {
2
+ GRIDTOOLBAR = "GRIDTOOLBAR",
3
+ CONFOMATIONALERTBOX = "CONFOMATIONALERTBOX",
4
+ INFOMATIONALERTBOX = "INFOMATIONALERTBOX",
5
+ MENU = "MENU",
6
+ BLOCK = "BLOCK"
7
+ }
8
+ export declare const SYSTEM_DEFAULT = "System_Default";
@@ -0,0 +1,2 @@
1
+ export { default as TemplateWidgetFactory } from './Factory/TemplateWidgetFactory';
2
+ export type { BaseProps } from './Factory/BaseType';
@@ -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,8 @@
1
+ export enum TemplateActionType {
2
+ MENUNAVIGATE = "MENUNAVIGATE",
3
+ }
4
+ export enum NavigationType {
5
+ EXTERNAL = "EXTERNAL",
6
+ NEWWINDOW = "NEWWINDOW",
7
+ INTERNAL = "INTERNAL",
8
+ }
@@ -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;