ebta-workflow-prod 1.1.3 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/.eslintrc.js +7 -0
  2. package/.vscode/extensions.json +3 -0
  3. package/.vscode/settings.json +3 -0
  4. package/README.md +26 -0
  5. package/build/2983859c0d77824ec8db.svg +1 -0
  6. package/build/4168d659d55fd94368bc.svg +1 -0
  7. package/build/641b2c17e92b0e885b9f.svg +1 -0
  8. package/build/882445a26a4f3964786f.svg +1 -0
  9. package/build/activitypack.json +1 -1
  10. package/build/b280e967312a55101032.svg +1 -0
  11. package/build/main.js +2 -2
  12. package/build/main.js.LICENSE.txt +99 -0
  13. package/certs/localhost+2-key.pem +28 -0
  14. package/certs/localhost+2.pem +26 -0
  15. package/index.html +58 -0
  16. package/package.json +43 -7
  17. package/public/img/background.svg +3 -3
  18. package/public/img/compass.svg +3 -3
  19. package/public/img/grab.svg +3 -3
  20. package/public/img/grabbing.svg +3 -3
  21. package/public/img/sprites.svg +14 -14
  22. package/src/activities/AppendObjects.ts +40 -0
  23. package/src/activities/Base64ToFile.ts +56 -0
  24. package/src/activities/CreateGraphicLayer.ts +85 -0
  25. package/src/activities/DrapGeometry.ts +99 -0
  26. package/src/activities/GetElementByDataLayoutID.ts +58 -0
  27. package/src/activities/GetSesionStorage.ts +36 -0
  28. package/src/activities/GetTaskStatus.ts +56 -0
  29. package/src/activities/GetUserToken.ts +102 -0
  30. package/src/activities/GetvGISDetails copy.ts +110 -0
  31. package/src/activities/GetvGISDetails.ts +110 -0
  32. package/src/activities/HTMLextractor.ts +188 -0
  33. package/src/activities/LegendCreator.ts +155 -0
  34. package/src/activities/MergeObjects.ts +61 -0
  35. package/src/activities/PDFMapGenerator.ts +729 -0
  36. package/src/activities/RequestChecker.ts +94 -0
  37. package/src/activities/Sample.ts +41 -0
  38. package/src/activities/SetSessionStorage.ts +57 -0
  39. package/src/activities/SliceLine.ts +61 -0
  40. package/src/elements/AttributeFilter.tsx +1867 -0
  41. package/src/elements/CircularSlider.tsx +67 -0
  42. package/src/elements/CsColorPicker.tsx +140 -0
  43. package/src/elements/DropDownMenu.tsx +282 -0
  44. package/src/elements/HeaderwithHelp.tsx +178 -0
  45. package/src/elements/ItemSearcher.tsx +1035 -0
  46. package/src/elements/ItemSearcher_v2.tsx +1071 -0
  47. package/src/elements/LineChartMui.tsx +50 -0
  48. package/src/elements/MenueBar.tsx +118 -0
  49. package/src/elements/MultipleAutoCompleteCS.tsx +145 -0
  50. package/src/elements/SingleAutoCompleteCS.tsx +133 -0
  51. package/src/elements/TableRadioGoup.tsx +163 -0
  52. package/src/elements/Timeline.tsx +104 -0
  53. package/src/elements/ToggleButtonGroup.tsx +129 -0
  54. package/src/elements/Viewer360.tsx +71 -0
  55. package/src/elements/modules/AttributeFilterEasyComp.tsx +253 -0
  56. package/src/index.ts +41 -0
  57. package/src/main.ts +15 -0
  58. package/src/styles/imageSlider.css +34 -0
  59. package/tsconfig.json +12 -0
  60. package/uuid.js +7 -0
@@ -0,0 +1,50 @@
1
+ import * as React from "react";
2
+ import { FormElementProps, FormElementRegistration } from "@vertigis/workflow";
3
+ import { LineChart } from "@mui/x-charts";
4
+
5
+ /**
6
+ * The generic type argument provided to `FormElementProps<T>` controls the type
7
+ * of `props.value` and `props.setValue(value)`. If your element doesn't need a
8
+ * `value`, you can omit the type argument.
9
+ *
10
+ * You can also declare additional public properties of your element by adding
11
+ * properties to this interface. The properties will be managed by the Workflow
12
+ * runtime, and passed in as `props`. You can update the properties by using
13
+ * `props.setProperty(key, value)`.
14
+ */
15
+ interface LineChartMuiProps extends FormElementProps<string> {
16
+ series: any;
17
+ xAxis: any;
18
+ yAxis: any;
19
+ width: any;
20
+ height: any;
21
+ chartSetting: any
22
+ }
23
+
24
+ /**
25
+ * A Workflow element built using React.
26
+ * @displayName LineChartMui
27
+ * @description Line Chart V1
28
+ * @param props The props that will be provided by the Workflow runtime.
29
+ */
30
+ function LineChartMui(props: LineChartMuiProps): React.ReactElement {
31
+ const { series, xAxis, yAxis, width, height ,chartSetting} = props;
32
+ return (
33
+ <div style={{ width, height }}>
34
+ <LineChart
35
+ series={series}
36
+ xAxis={xAxis}
37
+ yAxis={yAxis}
38
+ {...chartSetting}
39
+ />
40
+ </div>
41
+ );
42
+ }
43
+
44
+ const LineChartMuiElementRegistration: FormElementRegistration<LineChartMuiProps> = {
45
+ component: LineChartMui,
46
+ getInitialProperties: () => ({ value: "Hello World" }),
47
+ id: "LineChartMui",
48
+ };
49
+
50
+ export default LineChartMuiElementRegistration;
@@ -0,0 +1,118 @@
1
+ import * as React from "react";
2
+ import { FormElementProps, FormElementRegistration } from "@vertigis/workflow";
3
+ import Button from '@vertigis/web/ui/Button';
4
+ import Menu from '@vertigis/web/ui/Menu';
5
+ import MenuItem from '@vertigis/web/ui/MenuItem';
6
+ import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
7
+
8
+ /**
9
+ * The generic type argument provided to `FormElementProps<T>` controls the type
10
+ * of `props.value` and `props.setValue(value)`. If your element doesn't need a
11
+ * `value`, you can omit the type argument.
12
+ *
13
+ * You can also declare additional public properties of your element by adding
14
+ * properties to this interface. The properties will be managed by the Workflow
15
+ * runtime, and passed in as `props`. You can update the properties by using
16
+ * `props.setProperty(key, value)`.
17
+ */
18
+
19
+ interface MenuItem {
20
+ title: string;
21
+ items: string[];
22
+ showIcon?: boolean; // Changed from startIcon to showIcon for clarity
23
+ }
24
+
25
+ interface MenueBarProps extends FormElementProps<string> {
26
+ structure: MenuItem[];
27
+ selectedItem?: string;
28
+ }
29
+
30
+ /**
31
+ * A Workflow element built using React.
32
+ * @displayName MenueBar
33
+ * @description Menue Bar
34
+ * @param props The props that will be provided by the Workflow runtime.
35
+ */
36
+ function MenueBar(props: MenueBarProps): React.ReactElement {
37
+ const { structure, raiseEvent, setProperty } = props;
38
+
39
+ // State to track which category menu is open
40
+ const [anchorElMap, setAnchorElMap] = React.useState<{[key: string]: HTMLElement | null}>({});
41
+
42
+ const handleClick = (event: React.MouseEvent<HTMLElement>, category: string) => {
43
+ // Update anchor element for the specific category
44
+ setAnchorElMap(prev => ({
45
+ ...prev,
46
+ [category]: event.currentTarget
47
+ }));
48
+ };
49
+
50
+ const handleClose = (category: string) => {
51
+ // Close the specific category menu
52
+ setAnchorElMap(prev => ({
53
+ ...prev,
54
+ [category]: null
55
+ }));
56
+ };
57
+
58
+ const handleMenuItemClick = (category: string, item: string) => {
59
+ // Handle menu item click - set the selected value
60
+ handleClose(category);
61
+ setProperty("selectedItem" as any, {category, item});
62
+ raiseEvent("clicked" as any, {category, item});
63
+ };
64
+
65
+ return (
66
+ <div style={{ display: 'flex', gap: '8px' }}>
67
+ {structure.map((group) => (
68
+ <div key={group.title}>
69
+ <Button
70
+ aria-controls={anchorElMap[group.title] ? `menu-${group.title}` : undefined}
71
+ aria-haspopup="true"
72
+ aria-expanded={anchorElMap[group.title] ? 'true' : undefined}
73
+ variant="contained"
74
+ disableElevation
75
+ onClick={(e) => handleClick(e, group.title)}
76
+ endIcon={group.showIcon ? <KeyboardArrowDownIcon /> : null}
77
+ >
78
+ {group.title}
79
+ </Button>
80
+ <Menu
81
+ id={`menu-${group.title}`}
82
+ anchorEl={anchorElMap[group.title]}
83
+ open={Boolean(anchorElMap[group.title])}
84
+ onClose={() => handleClose(group.title)}
85
+ MenuListProps={{
86
+ 'aria-labelledby': group.title,
87
+ }}
88
+ >
89
+ {group.items.map((item) => (
90
+ <MenuItem
91
+ key={item}
92
+ onClick={() => handleMenuItemClick(group.title, item)}
93
+ disableRipple
94
+ >
95
+ {item}
96
+ </MenuItem>
97
+ ))}
98
+ </Menu>
99
+ </div>
100
+ ))}
101
+ </div>
102
+ );
103
+ }
104
+
105
+ const MenueBarElementRegistration: FormElementRegistration<MenueBarProps> = {
106
+ component: MenueBar,
107
+ getInitialProperties: () => ({
108
+ structure: [
109
+ {title: "Option 1", items: ['Button A', 'Button B']},
110
+ {title: "Item B", items: ['Button C'], showIcon: true},
111
+ {title: "Option 2", items: ['Button D', 'Button E']},
112
+ ],
113
+ selectedItem: undefined
114
+ }),
115
+ id: "MenueBar",
116
+ };
117
+
118
+ export default MenueBarElementRegistration;
@@ -0,0 +1,145 @@
1
+ import React from "react";
2
+ import { FormElementProps, FormElementRegistration } from "@vertigis/workflow";
3
+ import { createTheme, ThemeProvider} from "@mui/material/styles";
4
+ import Autocomplete from "@mui/material/Autocomplete";
5
+ import TextField from "@mui/material/TextField";
6
+
7
+ interface Option {
8
+ label: string;
9
+ value?: any;
10
+ }
11
+
12
+ interface MultipleAutoCompleteCSProps extends FormElementProps<any> {
13
+ options: Option[];
14
+ variant: "standard" | "outlined" | "filled";
15
+ defaultLabel: string,
16
+ elementSize: "small" | "medium" ;
17
+ }
18
+
19
+ const theme = createTheme({
20
+ components: {
21
+ MuiInputLabel: {
22
+ styleOverrides: {
23
+ root: {
24
+ color: 'var(--primaryForeground)', // Label text color
25
+ fontSize: '1.2rem', // Label font size
26
+
27
+ },
28
+ },
29
+ },
30
+ MuiAutocomplete: {
31
+ styleOverrides: {
32
+ root: {
33
+ backgroundColor: 'var(--primaryBackground)', // Root background color
34
+ },
35
+ listbox: {
36
+ fontSize: '1.2rem', // Listbox text size
37
+ color: 'var(--secondaryForeground)', // Listbox text color
38
+ backgroundColor: 'var(--primaryBackground)', // Listbox background color
39
+ border: '1px solid var(--primaryForeground)', // Listbox border color
40
+ },
41
+ endAdornment: {
42
+ color: 'var(--primaryForeground)', // Default end adornment color
43
+ },
44
+
45
+ popupIndicator:{
46
+ color: 'var(--primaryForeground)', // Default arrow icon color
47
+ backgroundColor: 'var(--primaryBackground)', // Listbox background color
48
+ },
49
+ clearIndicator: {
50
+ color: 'var(--primaryForeground)', // Default clear icon color
51
+ '&:hover': {
52
+ color: 'var(--secondaryForeground)', // Clear icon color on hover
53
+ },
54
+ },
55
+ paper: {
56
+ backgroundColor: 'var(--primaryBackground)', // Paper background color
57
+ color: 'var(--primaryForeground)', // Paper text color
58
+ },
59
+ inputRoot: {
60
+ color: 'var(--primaryForeground)', // Input text color
61
+
62
+ // Styles for the input area
63
+ '& .MuiOutlinedInput-root': {
64
+ '& fieldset': {
65
+ borderColor: 'var(--primaryForeground)',
66
+ },
67
+ '&:hover fieldset': {
68
+ borderColor: 'var(--primaryForeground)',
69
+ },
70
+ '&.Mui-focused fieldset': {
71
+ borderColor: 'var(--primaryForeground)',
72
+ },
73
+ },
74
+ '& .MuiChip-root': {
75
+ fontSize: '1.2rem', // Chip text size
76
+ backgroundColor: 'var(--buttonBackground)', // Chip background color
77
+ color: 'var(--buttonForeground)', // Chip text color
78
+ border: '1px solid var(--buttonBorder)', // Border for the chip
79
+ '& .MuiChip-deleteIcon': {
80
+ color: 'var(--buttonForeground)', // Delete icon color
81
+ '&:hover': {
82
+ color: 'var(--buttonForeground)', // Delete icon hover color
83
+ },
84
+ },
85
+ },
86
+ },
87
+ },
88
+ },
89
+ },
90
+ });
91
+
92
+ /**
93
+ * A Workflow element built using React.
94
+ * @displayName Multiple AutoComplete CS
95
+ * @description Multiple AutoComplete V11
96
+ * @param props The props that will be provided by the Workflow runtime.
97
+ */
98
+
99
+ function MultipleAutoCompleteCS(
100
+ props: MultipleAutoCompleteCSProps
101
+ ): React.ReactElement {
102
+ const { value,defaultLabel, variant, options, setValue , elementSize} = props;
103
+
104
+
105
+ return (
106
+ <ThemeProvider theme={theme}>
107
+ <Autocomplete
108
+ value={value || []}
109
+ options={options || []}
110
+ size={elementSize}
111
+ getOptionLabel={(option: Option) => option.label || ""}
112
+ onChange={(event, newValue) => {
113
+ if (setValue) {
114
+ setValue(newValue);
115
+ }
116
+ }}
117
+ multiple={true}
118
+ renderInput={(params) => (
119
+ <TextField {...params} placeholder={defaultLabel} variant={variant} />
120
+ )}
121
+ />
122
+ </ThemeProvider>
123
+ );
124
+ }
125
+
126
+ const MultipleAutoCompleteCSElementRegistration: FormElementRegistration<MultipleAutoCompleteCSProps> =
127
+ {
128
+ component: MultipleAutoCompleteCS,
129
+ getInitialProperties: () => ({
130
+ defaultLabel: "Default Label", // Provide a default label here
131
+ variant: "outlined", // Provide a default variant here
132
+ autocompleteType: "autoComplete", // Provide a default autocomplete type here
133
+ elementSize: "small", // Provide a default element size here
134
+ options: [
135
+ { label: "Option 1", value: 1 },
136
+ { label: "Option 2", value: 2 },
137
+ { label: "Option 3", value: 3 },
138
+ { label: "Option 4", value: 4 },
139
+ ], // Sample options
140
+ initiatorValue: [{ label: "Option 1", value: 1 }]
141
+ }),
142
+ id: "MultipleAutoCompleteCS",
143
+ };
144
+
145
+ export default MultipleAutoCompleteCSElementRegistration;
@@ -0,0 +1,133 @@
1
+ import React from "react";
2
+ import { FormElementProps, FormElementRegistration } from "@vertigis/workflow";
3
+ import Autocomplete from "@vertigis/web/ui/Autocomplete"
4
+ import { createTheme, ThemeProvider} from "@mui/material/styles";
5
+ import TextField from "@mui/material/TextField";
6
+
7
+ interface Option {
8
+ label: string;
9
+ value?: any;
10
+ }
11
+
12
+ interface SingleAutoCompleteCSProps extends FormElementProps<any> {
13
+ options: Option[];
14
+ variant: "standard" | "outlined" | "filled";
15
+ defaultLabel: string;
16
+ elementSize: "small" | "medium";
17
+ }
18
+
19
+ const theme = createTheme({
20
+ components: {
21
+ MuiInputLabel: {
22
+ styleOverrides: {
23
+ root: {
24
+ color: 'var(--primaryForeground)', // Label text color
25
+ fontSize: '1.2rem', // Label font size
26
+
27
+ },
28
+ },
29
+ },
30
+ MuiAutocomplete: {
31
+ styleOverrides: {
32
+ root: {
33
+ backgroundColor: 'var(--primaryBackground)', // Root background color
34
+ },
35
+ listbox: {
36
+ fontSize: '1.2rem', // Listbox text size
37
+ color: 'var(--secondaryForeground)', // Listbox text color
38
+ backgroundColor: 'var(--primaryBackground)', // Listbox background color
39
+ border: '1px solid var(--primaryForeground)', // Listbox border color
40
+ },
41
+ endAdornment: {
42
+ color: 'var(--primaryForeground)', // Default end adornment color
43
+ },
44
+
45
+ popupIndicator:{
46
+ color: 'var(--primaryForeground)', // Default arrow icon color
47
+ backgroundColor: 'var(--primaryBackground)', // Listbox background color
48
+ },
49
+ clearIndicator: {
50
+ color: 'var(--primaryForeground)', // Default clear icon color
51
+ '&:hover': {
52
+ color: 'var(--secondaryForeground)', // Clear icon color on hover
53
+ },
54
+ },
55
+ paper: {
56
+ backgroundColor: 'var(--primaryBackground)', // Paper background color
57
+ color: 'var(--primaryForeground)', // Paper text color
58
+ },
59
+ inputRoot: {
60
+ color: 'var(--primaryForeground)', // Input text color
61
+ // Styles for the input area
62
+ '& .MuiOutlinedInput-root': {
63
+ '& fieldset': {
64
+ borderColor: 'var(--primaryForeground)',
65
+ },
66
+ '&:hover fieldset': {
67
+ borderColor: 'var(--primaryForeground)',
68
+ },
69
+ '&.Mui-focused fieldset': {
70
+ borderColor: 'var(--primaryForeground)',
71
+ },
72
+ },
73
+ '& .MuiChip-root': {
74
+ fontSize: '1.2rem', // Chip text size
75
+ backgroundColor: 'var(--buttonBackground)', // Chip background color
76
+ color: 'var(--buttonForeground)', // Chip text color
77
+ border: '1px solid var(--buttonBorder)', // Border for the chip
78
+ '& .MuiChip-deleteIcon': {
79
+ color: 'var(--buttonForeground)', // Delete icon color
80
+ '&:hover': {
81
+ color: 'var(--buttonForeground)', // Delete icon hover color
82
+ },
83
+ },
84
+ },
85
+ },
86
+ },
87
+ },
88
+ },
89
+ });
90
+
91
+ /**
92
+ * A Workflow element built using React.
93
+ * @displayName Single AutoComplete
94
+ * @description Single AutoComplete V8
95
+ * @param props The props that will be provided by the Workflow runtime.
96
+ */
97
+
98
+ function SingleAutoCompleteCS(
99
+ props: SingleAutoCompleteCSProps
100
+ ): React.ReactElement {
101
+ const { defaultLabel, variant, options, setValue , value, elementSize} = props;
102
+
103
+ return (
104
+ <ThemeProvider theme={theme}>
105
+ <Autocomplete
106
+ value={value || null}
107
+ size={elementSize}
108
+ options={options || []}
109
+ getOptionLabel={(option: Option) => option.label || ""}
110
+ onChange={(event: any, newValue: Option | null) => {
111
+ setValue(newValue);
112
+ }}
113
+ multiple={false}
114
+ renderInput={(params) => (
115
+ <TextField {...params} placeholder={defaultLabel} variant={variant} />
116
+ )}
117
+ />
118
+ </ThemeProvider>
119
+ );
120
+ }
121
+
122
+ const SingleAutoCompleteCSElementRegistration: FormElementRegistration<SingleAutoCompleteCSProps> =
123
+ {
124
+ component: SingleAutoCompleteCS,
125
+ getInitialProperties: () => ({
126
+ defaultLabel: "Default Label", // Provide a default label here
127
+ variant: "outlined", // Provide a default variant here
128
+ elementSize: "small", // Provide a default element size here
129
+ }),
130
+ id: "SingleAutoCompleteCS",
131
+ };
132
+
133
+ export default SingleAutoCompleteCSElementRegistration;
@@ -0,0 +1,163 @@
1
+ import * as React from "react";
2
+ import type { FormElementProps, FormElementRegistration } from "@vertigis/workflow";
3
+ import Box, { BoxProps } from "@vertigis/web/ui/Box";
4
+ import Table, { TableProps } from "@vertigis/web/ui/Table";
5
+ import TableBody from "@vertigis/web/ui/TableBody";
6
+ import TableCell, { TableCellProps } from "@vertigis/web/ui/TableCell";
7
+ import TableHead from "@vertigis/web/ui/TableHead";
8
+ import TableRow from "@vertigis/web/ui/TableRow";
9
+ import Radio from "@vertigis/web/ui/Radio";
10
+ import RadioGroup from "@vertigis/web/ui/RadioGroup";
11
+ import FormControlLabel from "@vertigis/web/ui/FormControlLabel";
12
+ import Tooltip from "@mui/material/Tooltip";
13
+
14
+ /** Interface for table columns */
15
+ interface Column {
16
+ name: string; // Used for value
17
+ alias?: string; // Used for display
18
+ align?: TableCellProps["align"];
19
+ weight?: number;
20
+ tooltip?: string;
21
+ }
22
+
23
+ /** Interface for row headers */
24
+ interface Row {
25
+ name: string; // Used for value
26
+ alias?: string; // Used for display
27
+ tooltip?: string;
28
+ align?: TableCellProps["align"];
29
+ }
30
+
31
+ type SettableBoxProps = Pick<BoxProps, "maxHeight" | "maxWidth">;
32
+ type SettableTableProps = Pick<TableProps, "stickyHeader">;
33
+ type OverrideProps = Pick<TableProps, "size">;
34
+
35
+ interface TableRadioGroupProps
36
+ extends FormElementProps<Record<string, string>>,
37
+ SettableBoxProps,
38
+ SettableTableProps {
39
+ rows?: Row[];
40
+ columns?: Column[];
41
+ }
42
+ /**
43
+ * A Workflow element built using React.
44
+ * @displayName Table Radio Group
45
+ * @description Table Radio Group
46
+ * @param props The props that will be provided by the Workflow runtime.
47
+ */
48
+ function TableRadioGroup(props: TableRadioGroupProps): React.ReactElement {
49
+ const {
50
+ setValue,
51
+ maxHeight,
52
+ maxWidth,
53
+ value = {},
54
+ rows = [
55
+ { name: "asset_ownership", alias: "Asset Ownership", tooltip: "Defines who legally owns the asset." },
56
+ { name: "asset_management", alias: "Asset Management", tooltip: "Covers the maintenance and lifecycle planning of the asset." },
57
+ { name: "asset_maintenance", alias: "Asset Operation and Maintenance", tooltip: "Ensures daily operation and upkeep of the asset." },
58
+ ],
59
+ columns = [
60
+ { name: "category", alias: "Category", weight: 2, tooltip: "This is the category column" },
61
+ { name: "accept", alias: "Accept", weight: 1, tooltip: "Accept the asset responsibility" },
62
+ { name: "refuse", alias: "Refuse", weight: 1, tooltip: "Refuse asset responsibility" },
63
+ { name: "amendment", alias: "Amendment or Clarification Required", weight: 2, tooltip: "Additional information is needed" },
64
+ ],
65
+ } = props;
66
+
67
+ const { size } = props as OverrideProps;
68
+
69
+ // Calculate total weight dynamically (including first column)
70
+ const totalWeight = columns.reduce((sum, col) => sum + (col.weight || 1), 0);
71
+
72
+ return (
73
+ <Box maxHeight={maxHeight} maxWidth={maxWidth} sx={{ overflow: "auto" }}>
74
+ <Table
75
+ size={size}
76
+ sx={{
77
+ "& span": {
78
+ display: "inline-flex !important",
79
+ },
80
+ }}
81
+ >
82
+ <TableHead>
83
+ <TableRow>
84
+ {columns.map((col, index) => (
85
+ <TableCell
86
+ key={index}
87
+ align={col.align || "center"}
88
+ sx={{ width: `${((col.weight || 1) / totalWeight) * 100}%`, fontWeight: "bold" }}
89
+ >
90
+ <Tooltip title={col.tooltip || "No description available"} arrow>
91
+ <span>{col.alias || col.name}</span>
92
+ </Tooltip>
93
+ </TableCell>
94
+ ))}
95
+ </TableRow>
96
+ </TableHead>
97
+ <TableBody>
98
+ {rows.map((row, rowIndex) => (
99
+ <TableRow key={rowIndex}>
100
+ {columns.map((col, colIndex) => (
101
+ <TableCell key={colIndex} align={row.align || "left"} sx={{ width: `${((col.weight || 1) / totalWeight) * 100}%` }}>
102
+ {colIndex === 0 ? ( // ✅ First column (Category)
103
+ <Tooltip title={row.tooltip || "No description available"} arrow>
104
+ <span style={{ fontWeight: "bold", cursor: "help" }}>{row.alias || row.name}</span>
105
+ </Tooltip>
106
+ ) : (
107
+ <RadioGroup
108
+ row
109
+ name={`group-${rowIndex}`}
110
+ value={value[row.name] || ""}
111
+ onChange={(event) => setValue({ ...value, [row.name]: event.target.value })}
112
+ sx={{ display: "flex", justifyContent: "center" }}
113
+ >
114
+ <FormControlLabel
115
+ value={col.name} // ✅ Name used for value
116
+ control={<Radio />}
117
+ label=""
118
+ sx={{
119
+ margin: 0,
120
+ padding: 0,
121
+ display: "flex",
122
+ justifyContent: "center",
123
+ alignItems: "center",
124
+ }}
125
+ />
126
+ </RadioGroup>
127
+ )}
128
+ </TableCell>
129
+ ))}
130
+ </TableRow>
131
+ ))}
132
+ </TableBody>
133
+ </Table>
134
+ </Box>
135
+ );
136
+ }
137
+
138
+ const TableRadioGroupElementRegistration: FormElementRegistration<TableRadioGroupProps> = {
139
+ component: TableRadioGroup,
140
+ getInitialProperties: () => ({
141
+ value: {
142
+ asset_ownership: "accept", // ✅ Default selection: "Accept" for Asset Ownership
143
+ asset_management: "refuse", // ✅ Default selection: "Refuse" for Asset Management
144
+ asset_maintenance: "amendment", // ✅ Default selection: "Amendment" for Asset Operation and Maintenance
145
+ },
146
+ rows: [
147
+ { name: "asset_ownership", alias: "Asset Ownership", tooltip: "Defines who legally owns the asset." },
148
+ { name: "asset_management", alias: "Asset Management", tooltip: "Covers the maintenance and lifecycle planning of the asset." },
149
+ { name: "asset_maintenance", alias: "Asset Operation and Maintenance", tooltip: "Ensures daily operation and upkeep of the asset." },
150
+ ],
151
+ size: "medium",
152
+ columns: [
153
+ { name: "category", alias: "Category", weight: 2, tooltip: "This is the category column" },
154
+ { name: "accept", alias: "Accept", weight: 1, tooltip: "Accept the asset responsibility" },
155
+ { name: "refuse", alias: "Refuse", weight: 1, tooltip: "Refuse asset responsibility" },
156
+ { name: "amendment", alias: "Amendment or Clarification Required", weight: 1.1, tooltip: "Additional information is needed" },
157
+ ],
158
+ }),
159
+ id: "TableRadioGroup",
160
+ };
161
+
162
+
163
+ export default TableRadioGroupElementRegistration;