ui-soxo-bootstrap-core 2.5.1 → 2.5.3
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/core/components/extra-info/extra-info-details.js +109 -126
- package/core/lib/components/sidemenu/sidemenu.js +193 -238
- package/core/lib/components/sidemenu/sidemenu.scss +39 -26
- package/core/lib/elements/basic/rangepicker/rangepicker.js +1 -0
- package/core/lib/elements/basic/rangepicker/rangepicker.scss +6 -0
- package/core/lib/pages/login/login.js +19 -17
- package/core/lib/pages/profile/theme-config.js +1 -1
- package/core/models/users/components/user-add/user-add.js +98 -411
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ExtraInfoDetail component contains the button and the data for corresponding to script mode and will open extrainfo
|
|
2
|
+
* ExtraInfoDetail component contains the button and the data for corresponding to script mode and will open extrainfo
|
|
3
3
|
*
|
|
4
|
-
* @description
|
|
4
|
+
* @description
|
|
5
5
|
* @author Sneha T
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -21,152 +21,135 @@ import ExtraInfo from './extra-info';
|
|
|
21
21
|
|
|
22
22
|
const { TabPane } = Tabs;
|
|
23
23
|
|
|
24
|
-
export default function ExtraInfoDetail({ modeValue, icon, title, tabPosition='left',showDrawerData,dbPtr,callback
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
export default function ExtraInfoDetail({ modeValue, icon, title, tabPosition = 'left', showDrawerData, dbPtr, callback, ...record }) {
|
|
25
|
+
// State to control drawer
|
|
26
|
+
const [open, setOpen] = useState(false);
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
// To set extra info data
|
|
29
|
+
const [info, setInfo] = useState([]);
|
|
30
|
+
//Setting active key for tabs
|
|
31
|
+
const [activeKey, setActiveKey] = useState(null);
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
// To strore selected item
|
|
34
|
+
const [selectedItem, setSelectedItem] = useState(null);
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
const [loading, setLoading] = useState(true);
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
setActiveKey(null); // Reset activeKey before fetching new info
|
|
44
|
-
|
|
45
|
-
getExtraInfo();
|
|
38
|
+
/**
|
|
39
|
+
* Show Drawer
|
|
40
|
+
*/
|
|
41
|
+
const showDrawer = () => {
|
|
42
|
+
setActiveKey(null); // Reset activeKey before fetching new info
|
|
46
43
|
|
|
47
|
-
|
|
44
|
+
getExtraInfo();
|
|
48
45
|
|
|
49
|
-
|
|
46
|
+
setOpen(true);
|
|
47
|
+
};
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Function to close
|
|
51
|
+
*/
|
|
52
|
+
const onClose = () => {
|
|
53
|
+
if (typeof callback === 'function') {
|
|
54
|
+
// Only call if it exists
|
|
55
|
+
callback(false);
|
|
56
|
+
}
|
|
57
|
+
setOpen(false);
|
|
58
|
+
};
|
|
61
59
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Function to get Info
|
|
62
|
+
*/
|
|
63
|
+
async function getExtraInfo() {
|
|
64
|
+
setSelectedItem();
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
setLoading(true);
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
let mode = modeValue;
|
|
70
69
|
|
|
71
|
-
|
|
70
|
+
const result = await Dashboard.getExtraInfo(mode);
|
|
72
71
|
|
|
73
|
-
|
|
72
|
+
setInfo(result);
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
setSelectedItem(result[0]);
|
|
76
75
|
|
|
77
|
-
|
|
76
|
+
setActiveKey(result[0].id.toString()); // Set activeKey to the first item's id
|
|
78
77
|
|
|
79
|
-
|
|
78
|
+
setLoading(false);
|
|
79
|
+
}
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
// If showDrawerData is true then call showDrawer function
|
|
83
|
+
if (showDrawerData) {
|
|
84
|
+
showDrawer();
|
|
82
85
|
}
|
|
86
|
+
}, [showDrawerData]);
|
|
83
87
|
|
|
84
|
-
|
|
85
|
-
// If showDrawerData is true then call showDrawer function
|
|
86
|
-
if (showDrawerData) {
|
|
87
|
-
showDrawer();
|
|
88
|
-
}
|
|
89
|
-
}, [showDrawerData]);
|
|
90
|
-
|
|
91
|
-
/**
|
|
88
|
+
/**
|
|
92
89
|
* Function to render icon or button
|
|
93
90
|
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
91
|
+
const renderIconOrButton = () => {
|
|
92
|
+
switch (icon) {
|
|
93
|
+
case 'InfoCircleFilled':
|
|
94
|
+
return <InfoCircleFilled onClick={showDrawer} />;
|
|
95
|
+
case 'Button':
|
|
96
|
+
return (
|
|
97
|
+
<Button size="small" onClick={showDrawer}>
|
|
98
|
+
Show Info
|
|
99
|
+
</Button>
|
|
100
|
+
);
|
|
101
|
+
default:
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<>
|
|
108
|
+
{/* {loading ? (
|
|
110
109
|
<>
|
|
111
110
|
<Skeleton active />
|
|
112
111
|
</>
|
|
113
112
|
) : ( */}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
<div className="right-drawer">
|
|
157
|
-
|
|
158
|
-
{selectedItem && !loading ? <ExtraInfo item={selectedItem} record={record} dbPtr={dbPtr}/> : null}
|
|
159
|
-
|
|
160
|
-
</div>
|
|
161
|
-
|
|
162
|
-
</div>
|
|
163
|
-
|
|
164
|
-
</div>
|
|
165
|
-
|
|
166
|
-
</Drawer>
|
|
167
|
-
|
|
168
|
-
</>
|
|
169
|
-
{/* )} */}
|
|
170
|
-
</>
|
|
171
|
-
);
|
|
113
|
+
<>
|
|
114
|
+
{/* */}
|
|
115
|
+
{/* <Button onClick={showDrawer}> */}
|
|
116
|
+
|
|
117
|
+
{/* <InfoCircleFilled onMouseEnter={showDrawer} /> */}
|
|
118
|
+
|
|
119
|
+
{renderIconOrButton()}
|
|
120
|
+
{/* </Button> */}
|
|
121
|
+
{/* */}
|
|
122
|
+
|
|
123
|
+
{/* */}
|
|
124
|
+
<Drawer width={'35%'} title={title} onClose={onClose} open={open}>
|
|
125
|
+
<div className="main-drawer-content">
|
|
126
|
+
<div className="drawer-container">
|
|
127
|
+
<div className="drawer-click">
|
|
128
|
+
{' '}
|
|
129
|
+
{/* Flexbox approach */}
|
|
130
|
+
<Tabs
|
|
131
|
+
tabPosition={tabPosition}
|
|
132
|
+
activeKey={activeKey} // Set activeKey to control the active tab
|
|
133
|
+
onChange={(key) => {
|
|
134
|
+
const selectedItem = info.find((item) => item.id.toString() === key);
|
|
135
|
+
|
|
136
|
+
setSelectedItem(selectedItem);
|
|
137
|
+
|
|
138
|
+
setActiveKey(key);
|
|
139
|
+
}}
|
|
140
|
+
>
|
|
141
|
+
{info.map((item) => (
|
|
142
|
+
<TabPane tab={item.caption} key={item.id.toString()} />
|
|
143
|
+
))}
|
|
144
|
+
</Tabs>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<div className="right-drawer">{selectedItem && !loading ? <ExtraInfo item={selectedItem} record={record} dbPtr={dbPtr} /> : null}</div>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</Drawer>
|
|
151
|
+
</>
|
|
152
|
+
{/* )} */}
|
|
153
|
+
</>
|
|
154
|
+
);
|
|
172
155
|
}
|