cloudmr-ux 0.0.3 → 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/README.md +24 -16
- package/dist/index.975ef6c8.js +75418 -0
- package/dist/index.975ef6c8.js.map +1 -0
- package/dist/index.css +140 -14
- package/dist/index.d.ts +58 -0
- package/dist/index.db9ed22c.css +171 -0
- package/dist/index.db9ed22c.css.map +1 -0
- package/dist/index.html +13 -0
- package/dist/index.js +170 -141
- package/dist/index.mjs +157 -0
- package/package.json +39 -99
- package/dist/index.js.map +0 -1
- package/dist/index.modern.js +0 -147
- package/dist/index.modern.js.map +0 -1
- package/src/.eslintrc +0 -5
- package/src/common/components/Cmr-components/avatar/Avatar.scss +0 -0
- package/src/common/components/Cmr-components/avatar/Avatar.tsx +0 -25
- package/src/common/components/Cmr-components/button/Button.scss +0 -0
- package/src/common/components/Cmr-components/button/Button.tsx +0 -14
- package/src/common/components/Cmr-components/checkbox/Checkbox.scss +0 -11
- package/src/common/components/Cmr-components/checkbox/Checkbox.tsx +0 -29
- package/src/common/components/Cmr-components/collapse/Collapse.scss +0 -3
- package/src/common/components/Cmr-components/collapse/Collapse.tsx +0 -75
- package/src/common/components/Cmr-components/dialogue/Confirmation.tsx +0 -48
- package/src/common/components/Cmr-components/dialogue/DeletionDialog.tsx +0 -61
- package/src/common/components/Cmr-components/dialogue/EditConfirmation.tsx +0 -72
- package/src/common/components/Cmr-components/double-slider/DualSlider.tsx +0 -198
- package/src/common/components/Cmr-components/double-slider/InvertibleDualSlider.tsx +0 -224
- package/src/common/components/Cmr-components/dropdown/Dropdown.scss +0 -36
- package/src/common/components/Cmr-components/dropdown/Dropdown.tsx +0 -83
- package/src/common/components/Cmr-components/gui-slider/ControlledSlider.tsx +0 -139
- package/src/common/components/Cmr-components/gui-slider/Slider.tsx +0 -170
- package/src/common/components/Cmr-components/header/Header.scss +0 -20
- package/src/common/components/Cmr-components/header/Header.tsx +0 -101
- package/src/common/components/Cmr-components/input/Input.scss +0 -0
- package/src/common/components/Cmr-components/input/Input.tsx +0 -39
- package/src/common/components/Cmr-components/input-number/InputNumber.scss +0 -0
- package/src/common/components/Cmr-components/input-number/InputNumber.tsx +0 -29
- package/src/common/components/Cmr-components/label/Label.scss +0 -13
- package/src/common/components/Cmr-components/label/Label.tsx +0 -20
- package/src/common/components/Cmr-components/option/Option.scss +0 -0
- package/src/common/components/Cmr-components/option/Option.tsx +0 -24
- package/src/common/components/Cmr-components/panel/Panel.scss +0 -0
- package/src/common/components/Cmr-components/panel/Panel.tsx +0 -54
- package/src/common/components/Cmr-components/progress/Progress.scss +0 -0
- package/src/common/components/Cmr-components/progress/Progress.tsx +0 -38
- package/src/common/components/Cmr-components/radio/Radio.scss +0 -0
- package/src/common/components/Cmr-components/radio/Radio.tsx +0 -23
- package/src/common/components/Cmr-components/radio-group/RadioGroup.scss +0 -0
- package/src/common/components/Cmr-components/radio-group/RadioGroup.tsx +0 -32
- package/src/common/components/Cmr-components/rename/edit.tsx +0 -94
- package/src/common/components/Cmr-components/select/Select.scss +0 -3
- package/src/common/components/Cmr-components/select/Select.tsx +0 -33
- package/src/common/components/Cmr-components/select-upload/SelectUpload.scss +0 -0
- package/src/common/components/Cmr-components/select-upload/SelectUpload.tsx +0 -133
- package/src/common/components/Cmr-components/slider/Slider.scss +0 -0
- package/src/common/components/Cmr-components/slider/Slider.tsx +0 -66
- package/src/common/components/Cmr-components/spin/Spin.scss +0 -0
- package/src/common/components/Cmr-components/spin/Spin.tsx +0 -31
- package/src/common/components/Cmr-components/tooltip/Tooltip.scss +0 -0
- package/src/common/components/Cmr-components/tooltip/Tooltip.tsx +0 -50
- package/src/common/components/Cmr-components/upload/Upload.scss +0 -5
- package/src/common/components/Cmr-components/upload/Upload.tsx +0 -188
- package/src/common/components/Cmr-components/upload/UploadWindow.tsx +0 -355
- package/src/index.js +0 -8
- package/src/index.test.js +0 -7
- package/src/styles.module.css +0 -9
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { Box } from "@mui/material";
|
|
2
|
-
import { useRef, useState } from "react";
|
|
3
|
-
|
|
4
|
-
export const ControlledSlider = ({
|
|
5
|
-
name,
|
|
6
|
-
min,
|
|
7
|
-
max,
|
|
8
|
-
setValue,
|
|
9
|
-
transform = x => x,
|
|
10
|
-
inverse = x => x,
|
|
11
|
-
value
|
|
12
|
-
}: {
|
|
13
|
-
name: string,
|
|
14
|
-
min: number,
|
|
15
|
-
max: number,
|
|
16
|
-
setValue?: (value: number) => void,
|
|
17
|
-
transform?: (x: number) => number,
|
|
18
|
-
inverse?: (x: number) => number,
|
|
19
|
-
value: number
|
|
20
|
-
}) => {
|
|
21
|
-
const sliderPosition = (value - min) / (max - min) * 100;
|
|
22
|
-
const sliderRef = useRef(null);
|
|
23
|
-
const [isEditing, setIsEditing] = useState(false);
|
|
24
|
-
const [editedValue, setEditedValue] = useState('');
|
|
25
|
-
const [textIsNaN, setIsNaN] = useState(false);
|
|
26
|
-
|
|
27
|
-
const handleDragStart = (e: any) => {
|
|
28
|
-
e.preventDefault();
|
|
29
|
-
|
|
30
|
-
const startX = e.clientX;
|
|
31
|
-
//@ts-ignore
|
|
32
|
-
const sliderWidth = sliderRef.current.offsetWidth;
|
|
33
|
-
|
|
34
|
-
const handleMouseMove = (e: any) => {
|
|
35
|
-
const moveX = e.clientX - startX;
|
|
36
|
-
const newPosition = ((moveX / sliderWidth) * 100) + sliderPosition;
|
|
37
|
-
const clampedPosition = Math.min(100, Math.max(0, newPosition));
|
|
38
|
-
const newValue = (max - min) * clampedPosition / 100 + min;
|
|
39
|
-
setValue && setValue(newValue);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const handleMouseUp = () => {
|
|
43
|
-
document.removeEventListener('mousemove', handleMouseMove);
|
|
44
|
-
document.removeEventListener('mouseup', handleMouseUp);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
document.addEventListener('mousemove', handleMouseMove);
|
|
48
|
-
document.addEventListener('mouseup', handleMouseUp);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
52
|
-
setIsNaN(isNaN(Number(e.target.value)));
|
|
53
|
-
setEditedValue(e.target.value);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const handleInputBlur = (e:any) => {
|
|
57
|
-
let val = inverse(Number(editedValue));
|
|
58
|
-
if (isNaN(val)) {
|
|
59
|
-
return e.preventDefault();
|
|
60
|
-
}
|
|
61
|
-
setIsEditing(false);
|
|
62
|
-
setValue&&setValue(val)
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const handleInputKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
66
|
-
if (e.key === 'Enter'&&!textIsNaN) {
|
|
67
|
-
e.currentTarget.blur();
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const formatText=(value:number)=>{
|
|
72
|
-
return Math.abs(value)<0.01&&value!=0?
|
|
73
|
-
Number(value).toExponential(3).toUpperCase():
|
|
74
|
-
Number(value).toFixed(3);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const displayValue = isEditing ? editedValue : formatText(value);
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<Box sx={{ display: 'flex', flexDirection: 'row', paddingLeft: '4px', paddingRight: '4px' }} height={20}>
|
|
81
|
-
<Box flex={0.77} fontSize={16} color={'#3D3D3D'} alignItems={'center'} display={'flex'} marginBottom={'1pt'}
|
|
82
|
-
fontFamily={'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif'}>
|
|
83
|
-
{name}
|
|
84
|
-
</Box>
|
|
85
|
-
<Box sx={{ display: 'flex', flexDirection: 'row' }} flex={1}>
|
|
86
|
-
<Box
|
|
87
|
-
sx={{
|
|
88
|
-
backgroundColor: '#f0f0f0',
|
|
89
|
-
flex: 1,
|
|
90
|
-
marginLeft: '4px',
|
|
91
|
-
marginRight: '4px',
|
|
92
|
-
borderRadius: '2px',
|
|
93
|
-
position: 'relative',
|
|
94
|
-
overflow: 'hidden'
|
|
95
|
-
}}
|
|
96
|
-
ref={sliderRef}
|
|
97
|
-
onMouseDown={handleDragStart}
|
|
98
|
-
>
|
|
99
|
-
<Box
|
|
100
|
-
sx={{
|
|
101
|
-
position: 'absolute',
|
|
102
|
-
left: `calc(${sliderPosition * 0.98}% - 10px)`,
|
|
103
|
-
width: '20px',
|
|
104
|
-
height: '100%',
|
|
105
|
-
cursor: 'ew-resize',
|
|
106
|
-
zIndex: 1
|
|
107
|
-
}}
|
|
108
|
-
>
|
|
109
|
-
<Box sx={{ position: 'absolute', left: '10px', width: '2px', height: '100%', backgroundColor: 'black' }} />
|
|
110
|
-
</Box>
|
|
111
|
-
</Box>
|
|
112
|
-
<input
|
|
113
|
-
style={{
|
|
114
|
-
backgroundColor: '#f0f0f0',
|
|
115
|
-
width: '45px',
|
|
116
|
-
borderRadius: '2px',
|
|
117
|
-
outline: "none",
|
|
118
|
-
borderStyle: 'none',
|
|
119
|
-
paddingLeft: '3px',
|
|
120
|
-
paddingRight: '3px',
|
|
121
|
-
lineHeight: '20px',
|
|
122
|
-
whiteSpace: 'nowrap',
|
|
123
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif',
|
|
124
|
-
fontSize: '11px',
|
|
125
|
-
color: textIsNaN?'red':'black'
|
|
126
|
-
}}
|
|
127
|
-
value={displayValue}
|
|
128
|
-
onChange={handleInputChange}
|
|
129
|
-
onBlur={handleInputBlur}
|
|
130
|
-
onKeyDown={handleInputKeyDown}
|
|
131
|
-
onFocus={(e) => {
|
|
132
|
-
setEditedValue(e.target.value);
|
|
133
|
-
setIsEditing(true)
|
|
134
|
-
}}
|
|
135
|
-
/>
|
|
136
|
-
</Box>
|
|
137
|
-
</Box>
|
|
138
|
-
);
|
|
139
|
-
};
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { Box } from "@mui/material";
|
|
2
|
-
import {useEffect, useRef, useState} from "react";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* This slider allows users to control a single value within a given range.
|
|
6
|
-
* The rendered value can be masked by a transformation.
|
|
7
|
-
* @param name
|
|
8
|
-
* @param min
|
|
9
|
-
* @param max
|
|
10
|
-
* @param setValue
|
|
11
|
-
* @param transform transform is used to mask the rendered value by a transformation
|
|
12
|
-
* @param inverse transform is used to unmask the value to its original form
|
|
13
|
-
* @constructor
|
|
14
|
-
*/
|
|
15
|
-
export const Slider = ({
|
|
16
|
-
name,
|
|
17
|
-
min,
|
|
18
|
-
max,
|
|
19
|
-
setValue,
|
|
20
|
-
transform = x => x,
|
|
21
|
-
inverse = x => x,
|
|
22
|
-
value
|
|
23
|
-
}: {
|
|
24
|
-
name: string,
|
|
25
|
-
min: number,
|
|
26
|
-
max: number,
|
|
27
|
-
setValue?: (value: number) => void,
|
|
28
|
-
transform?: (x: number) => number,
|
|
29
|
-
inverse?: (x: number) => number,
|
|
30
|
-
value?:number
|
|
31
|
-
}) => {
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
if(value!=undefined){
|
|
34
|
-
setSliderPosition((value-min)/(max-min)*100);
|
|
35
|
-
}
|
|
36
|
-
}, [value]);
|
|
37
|
-
const [sliderPosition, setSliderPosition] = useState(50); // Initial percentage for the slider
|
|
38
|
-
|
|
39
|
-
const sliderRef = useRef(null); // Ref for the parent box
|
|
40
|
-
|
|
41
|
-
const handleDragStart = (e: any) => {
|
|
42
|
-
// Prevent default behavior
|
|
43
|
-
e.preventDefault();
|
|
44
|
-
|
|
45
|
-
// Calculate initial positions
|
|
46
|
-
const startX = e.clientX;
|
|
47
|
-
// @ts-ignore
|
|
48
|
-
const sliderWidth = sliderRef.current.offsetWidth;
|
|
49
|
-
|
|
50
|
-
const handleMouseMove = (e: any) => {
|
|
51
|
-
const moveX = e.clientX - startX;
|
|
52
|
-
const newPosition = ((moveX / sliderWidth) * 100)+sliderPosition;
|
|
53
|
-
|
|
54
|
-
// Prevent the slider from going outside the parent box
|
|
55
|
-
const clampedPosition = Math.min(100, Math.max(0, newPosition));
|
|
56
|
-
|
|
57
|
-
// Update the position of the slider
|
|
58
|
-
setSliderPosition(clampedPosition);
|
|
59
|
-
const value = transform((max - min) * clampedPosition / 100 + min);
|
|
60
|
-
setValue && setValue(value);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const handleMouseUp = () => {
|
|
64
|
-
// Remove event listeners once dragging is complete
|
|
65
|
-
document.removeEventListener('mousemove', handleMouseMove);
|
|
66
|
-
document.removeEventListener('mouseup', handleMouseUp);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
// Add mouse move and mouse up listeners to document to handle drag
|
|
70
|
-
document.addEventListener('mousemove', handleMouseMove);
|
|
71
|
-
document.addEventListener('mouseup', handleMouseUp);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const [isEditing, setIsEditing] = useState(false);
|
|
76
|
-
const [editedValue, setEditedValue] = useState('');
|
|
77
|
-
const [textIsNaN, setIsNaN] = useState(false);
|
|
78
|
-
|
|
79
|
-
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
80
|
-
setIsNaN(isNaN(Number(e.target.value)));
|
|
81
|
-
setEditedValue(e.target.value);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const handleInputBlur = (e:any) => {
|
|
85
|
-
let val = inverse(Number(editedValue));
|
|
86
|
-
if (isNaN(val)) {
|
|
87
|
-
return e.preventDefault();
|
|
88
|
-
}
|
|
89
|
-
setIsEditing(false);
|
|
90
|
-
setValue&&setValue(val)
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const handleInputKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
94
|
-
if (e.key === 'Enter'&&!textIsNaN) {
|
|
95
|
-
e.currentTarget.blur();
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const formatText=(value:number)=>{
|
|
100
|
-
return Math.abs(value)<0.01&&value!=0?
|
|
101
|
-
Number(value).toExponential(3).toUpperCase():
|
|
102
|
-
Number(value).toFixed(3);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const val = transform((max - min) * sliderPosition / 100 + min);
|
|
106
|
-
const displayValue = isEditing ? editedValue : formatText(val);
|
|
107
|
-
|
|
108
|
-
return <Box sx={{display: 'flex', flexDirection: 'row', paddingLeft: '4px', paddingRight: '4px',marginBottom:'4px'
|
|
109
|
-
}} height={20}>
|
|
110
|
-
<Box flex={0.77} fontSize={16} color={'#3D3D3D'} alignItems={'center'} display={'flex'} marginBottom={'1pt'}
|
|
111
|
-
fontFamily={'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif'}>
|
|
112
|
-
{name}
|
|
113
|
-
</Box>
|
|
114
|
-
<Box sx={{display: 'flex', flexDirection: 'row'}} flex={1}>
|
|
115
|
-
<Box sx={{
|
|
116
|
-
backgroundColor: '#f0f0f0',
|
|
117
|
-
flex: 1,
|
|
118
|
-
marginLeft: '4px',
|
|
119
|
-
marginRight: '4px',
|
|
120
|
-
borderRadius: '2px',
|
|
121
|
-
position: 'relative',
|
|
122
|
-
overflow: 'hidden'
|
|
123
|
-
}} ref={sliderRef}
|
|
124
|
-
onMouseDown={handleDragStart}>
|
|
125
|
-
{/* Visual representation of the slider */}
|
|
126
|
-
<Box sx={{
|
|
127
|
-
position: 'absolute',
|
|
128
|
-
left: `calc(${sliderPosition*0.98}% - 10px)`,
|
|
129
|
-
width: '20px',
|
|
130
|
-
height: '100%',
|
|
131
|
-
cursor: 'ew-resize',
|
|
132
|
-
zIndex: 1
|
|
133
|
-
}}>
|
|
134
|
-
<Box sx={{
|
|
135
|
-
position: 'absolute',
|
|
136
|
-
left: '10px',
|
|
137
|
-
width: '2px',
|
|
138
|
-
height: '100%',
|
|
139
|
-
backgroundColor: 'black'
|
|
140
|
-
}}/>
|
|
141
|
-
</Box>
|
|
142
|
-
</Box>
|
|
143
|
-
|
|
144
|
-
<input
|
|
145
|
-
style={{
|
|
146
|
-
backgroundColor: '#f0f0f0',
|
|
147
|
-
width: '45px',
|
|
148
|
-
borderRadius: '2px',
|
|
149
|
-
outline: "none",
|
|
150
|
-
borderStyle: 'none',
|
|
151
|
-
paddingLeft: '3px',
|
|
152
|
-
paddingRight: '3px',
|
|
153
|
-
lineHeight: '20px',
|
|
154
|
-
whiteSpace: 'nowrap',
|
|
155
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif',
|
|
156
|
-
fontSize: '11px',
|
|
157
|
-
color: textIsNaN?'red':'black'
|
|
158
|
-
}}
|
|
159
|
-
value={displayValue}
|
|
160
|
-
onChange={handleInputChange}
|
|
161
|
-
onBlur={handleInputBlur}
|
|
162
|
-
onKeyDown={handleInputKeyDown}
|
|
163
|
-
onFocus={(e) => {
|
|
164
|
-
setEditedValue(e.target.value);
|
|
165
|
-
setIsEditing(true)
|
|
166
|
-
}}
|
|
167
|
-
/>
|
|
168
|
-
</Box>
|
|
169
|
-
</Box>;
|
|
170
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
@import url(https://fonts.googleapis.com/css?family=Nunito);
|
|
2
|
-
|
|
3
|
-
:root {
|
|
4
|
-
--bs-dark-rgb: 0, 0, 0; /* change these values to your preferred RGB color */
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.small-margin{
|
|
8
|
-
margin-left: 25pt;
|
|
9
|
-
margin-right: 25pt;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.navbar-nav > .active > a {
|
|
13
|
-
color: white;
|
|
14
|
-
font-weight: 500;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.navbar-brand {
|
|
18
|
-
font-family: 'Nunito', sans-serif;
|
|
19
|
-
|
|
20
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import './Header.scss';
|
|
3
|
-
import { Link, useNavigate } from 'react-router-dom';
|
|
4
|
-
|
|
5
|
-
interface MenuItem{
|
|
6
|
-
path: string
|
|
7
|
-
title: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const Header = ({siteTitle, authentication,handleLogout,menuList}:{
|
|
11
|
-
siteTitle:string,
|
|
12
|
-
authentication: {email:string, accessToken: string}
|
|
13
|
-
menuList: MenuItem[],
|
|
14
|
-
handleLogout: ()=>void
|
|
15
|
-
}) => {
|
|
16
|
-
const navigate = useNavigate();
|
|
17
|
-
const currPath = navigate.name;
|
|
18
|
-
const [menuSelect, setMenuSelect] = useState(siteTitle);
|
|
19
|
-
const { email, accessToken } = authentication;
|
|
20
|
-
console.log(authentication);
|
|
21
|
-
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
for (let item of menuList) {
|
|
24
|
-
console.log(item.path);
|
|
25
|
-
console.log(currPath);
|
|
26
|
-
if (item.path === currPath) setMenuSelect(item.title);
|
|
27
|
-
}
|
|
28
|
-
}, [currPath]);
|
|
29
|
-
|
|
30
|
-
const handleMenuChange = (info: MenuItem,navigate:any) => {
|
|
31
|
-
if (currPath === info.path) return;
|
|
32
|
-
navigate(info.path);
|
|
33
|
-
for (let item of menuList) {
|
|
34
|
-
if (item.path === info.path){
|
|
35
|
-
setMenuSelect(item.title);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return false;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<nav className="navbar navbar-expand-md navbar-dark bg-dark shadow-sm" style={{background: '#000000'}}>
|
|
43
|
-
{/*add small-margin to className to align header content to the ends*/}
|
|
44
|
-
<div className="container-xl">
|
|
45
|
-
<Link to="/" className="navbar-brand">
|
|
46
|
-
{siteTitle}
|
|
47
|
-
</Link>
|
|
48
|
-
<button className="navbar-toggler" type="button" data-bs-toggle="collapse"
|
|
49
|
-
data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent"
|
|
50
|
-
aria-expanded="false" aria-label="Toggle navigation">
|
|
51
|
-
<span className="navbar-toggler-icon"></span>
|
|
52
|
-
</button>
|
|
53
|
-
|
|
54
|
-
<div className="collapse navbar-collapse" id="navbarToggleExternalContent">
|
|
55
|
-
{/* Left Side Of Navbar */}
|
|
56
|
-
<ul className="navbar-nav">
|
|
57
|
-
{menuList.map((menuItem)=>{
|
|
58
|
-
return <li className={`nav-item${(menuItem.title==menuSelect)?' active':''}`} key={menuItem.path}>
|
|
59
|
-
<a className='nav-link' style={{cursor:'pointer'}} onClick={(event)=>{
|
|
60
|
-
switch(menuItem.title) {
|
|
61
|
-
case 'Bug Report':
|
|
62
|
-
window.open('https://github.com/cloudmrhub-com/mroptimum/issues')
|
|
63
|
-
// window.location.href='https://github.com/cloudmrhub-com/mroptimum/issues';
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
event.preventDefault();
|
|
67
|
-
handleMenuChange(menuItem, navigate)
|
|
68
|
-
}} >
|
|
69
|
-
{menuItem.title}
|
|
70
|
-
</a>
|
|
71
|
-
</li>;
|
|
72
|
-
})}
|
|
73
|
-
</ul>
|
|
74
|
-
|
|
75
|
-
{/**Right Side Of Navbar **/}
|
|
76
|
-
{authentication.accessToken!='' &&(
|
|
77
|
-
<ul className="navbar-nav ms-auto">
|
|
78
|
-
{/** Authentication Links **/}
|
|
79
|
-
<li className="nav-item dropdown">
|
|
80
|
-
<button className="nav-link dropdown-toggle" type="button"
|
|
81
|
-
id="dropdownMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
|
|
82
|
-
{email} <span className="caret"></span>
|
|
83
|
-
</button>
|
|
84
|
-
<ul className="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
|
85
|
-
<li><button className="dropdown-item"
|
|
86
|
-
onClick={(event)=>{event.preventDefault();
|
|
87
|
-
handleLogout();}}>
|
|
88
|
-
Logout
|
|
89
|
-
</button></li>
|
|
90
|
-
</ul>
|
|
91
|
-
</li>
|
|
92
|
-
</ul>)}
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
</nav>
|
|
96
|
-
);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export default Header;
|
|
100
|
-
export type { MenuItem };
|
|
101
|
-
|
|
File without changes
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './Input.scss';
|
|
3
|
-
import { Input } from 'antd';
|
|
4
|
-
import { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
5
|
-
import { LiteralUnion } from 'antd/lib/_util/type';
|
|
6
|
-
|
|
7
|
-
interface CmrInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {
|
|
8
|
-
defaultValue?: string;
|
|
9
|
-
id?: string;
|
|
10
|
-
maxLength?: number;
|
|
11
|
-
size?: SizeType;
|
|
12
|
-
value?: string;
|
|
13
|
-
type?: any;
|
|
14
|
-
prefix?: React.ReactNode;
|
|
15
|
-
bordered?: boolean;
|
|
16
|
-
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
17
|
-
onPressEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const CmrInput = (props: CmrInputProps) => {
|
|
21
|
-
const { defaultValue, id, maxLength, size, value, type, prefix, bordered, onChange, onPressEnter, ...rest } = props;
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<Input
|
|
25
|
-
defaultValue={defaultValue}
|
|
26
|
-
id={id}
|
|
27
|
-
maxLength={maxLength}
|
|
28
|
-
size={size}
|
|
29
|
-
value={value}
|
|
30
|
-
type={type}
|
|
31
|
-
prefix={prefix}
|
|
32
|
-
bordered={bordered}
|
|
33
|
-
onChange={onChange}
|
|
34
|
-
onPressEnter={onPressEnter}
|
|
35
|
-
{...rest}
|
|
36
|
-
/>
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
|
|
File without changes
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, {CSSProperties} from 'react';
|
|
2
|
-
import './InputNumber.scss';
|
|
3
|
-
import { InputNumber } from 'antd';
|
|
4
|
-
import { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
5
|
-
|
|
6
|
-
interface CmrInputNumberProps {
|
|
7
|
-
defaultValue?: number;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
keyboard?: boolean;
|
|
10
|
-
max?: number;
|
|
11
|
-
min?: number;
|
|
12
|
-
size?: SizeType;
|
|
13
|
-
value?: number;
|
|
14
|
-
onChange?: (value: number|null) => void;
|
|
15
|
-
children?: React.ReactNode;
|
|
16
|
-
style?: CSSProperties;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const CmrInputNumber = (props: CmrInputNumberProps) => {
|
|
20
|
-
const { defaultValue, style, max, min, value, onChange, children, ...rest } = props;
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<InputNumber defaultValue={defaultValue} max={max} style={style} min={min} value={value} onChange={onChange} {...rest}>
|
|
24
|
-
{children}
|
|
25
|
-
</InputNumber>
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default CmrInputNumber;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './Label.scss';
|
|
3
|
-
|
|
4
|
-
interface CmrLabelProps extends React.HTMLAttributes<HTMLDivElement>{
|
|
5
|
-
required?: boolean;
|
|
6
|
-
children?: any;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const CmrLabel = (props: CmrLabelProps) => {
|
|
10
|
-
const { children, required = false } = props;
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<label className="cmr-label" style={{fontSize:'16px', ...props.style}}>
|
|
14
|
-
{children}
|
|
15
|
-
{required && <span className="asterik">*</span>}
|
|
16
|
-
</label>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default CmrLabel;
|
|
File without changes
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Select } from 'antd';
|
|
3
|
-
import './Option.scss';
|
|
4
|
-
|
|
5
|
-
const { Option } = Select;
|
|
6
|
-
|
|
7
|
-
interface CmrOptionProps {
|
|
8
|
-
title?: string;
|
|
9
|
-
value: string | number;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
children?: any;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const CmrOption = (props: CmrOptionProps) => {
|
|
15
|
-
const { title, value, disabled, children, ...rest } = props;
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<Option title={title} value={value} disabled={disabled} {...rest}>
|
|
19
|
-
{children}
|
|
20
|
-
</Option>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default CmrOption;
|
|
File without changes
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React, {ReactNode, useState} from 'react';
|
|
2
|
-
import ArrowDropUpIcon from '@mui/icons-material/ArrowDropUp';
|
|
3
|
-
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
|
|
4
|
-
|
|
5
|
-
interface CmrPanelProps extends React.HTMLAttributes<HTMLDivElement>{
|
|
6
|
-
activeKey?: string|string[];
|
|
7
|
-
header: string|undefined;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
panelKey?: number;
|
|
10
|
-
onToggle?: (key: number|undefined) => void;
|
|
11
|
-
expanded?: boolean;
|
|
12
|
-
cardProps?: React.HTMLAttributes<HTMLDivElement>;
|
|
13
|
-
}
|
|
14
|
-
const CmrPanel = function(props:CmrPanelProps){
|
|
15
|
-
let {expanded, onToggle} = props;
|
|
16
|
-
const toggle = ()=>{
|
|
17
|
-
if(onToggle)
|
|
18
|
-
onToggle(props.panelKey);
|
|
19
|
-
};
|
|
20
|
-
return <div className={`card ${props.className}`}>
|
|
21
|
-
<div className="card-header" style={{background: "white", display:props.header==undefined?'none':undefined}}>
|
|
22
|
-
<div className="row align-items-center">
|
|
23
|
-
<div className="col">{props.header}
|
|
24
|
-
</div>
|
|
25
|
-
{onToggle&&<div className="col text-end">
|
|
26
|
-
<span className="react-collapse float-end btn"
|
|
27
|
-
onClick={(e) => {
|
|
28
|
-
toggle();
|
|
29
|
-
}}>
|
|
30
|
-
{(!expanded)?
|
|
31
|
-
<ArrowDropDownIcon/>:
|
|
32
|
-
<ArrowDropUpIcon/>
|
|
33
|
-
}
|
|
34
|
-
</span>
|
|
35
|
-
</div>}
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
{
|
|
39
|
-
(!expanded)?
|
|
40
|
-
<div className={`card-body m-0 ${props.cardProps?.className}`} style={
|
|
41
|
-
{maxHeight:'0',padding:'0', opacity:'0',overflow:'hidden',
|
|
42
|
-
visibility:'collapse',transition:'all 0.5s'}}>
|
|
43
|
-
{props.children}
|
|
44
|
-
</div>
|
|
45
|
-
:
|
|
46
|
-
<div className={`card-body m-5 ${props.cardProps?.className}`} style={
|
|
47
|
-
{maxHeight:undefined,padding:undefined, opacity:'1',
|
|
48
|
-
visibility:'visible',transition:'all 0.5s'}}>
|
|
49
|
-
{props.children}
|
|
50
|
-
</div>}
|
|
51
|
-
</div>;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export default CmrPanel;
|
|
File without changes
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './Progress.scss';
|
|
3
|
-
import { Progress } from 'antd';
|
|
4
|
-
import { ProgressGradient, ProgressType, SuccessProps } from 'antd/lib/progress/progress';
|
|
5
|
-
|
|
6
|
-
declare const ProgressStatuses: ['normal', 'exception', 'active', 'success'];
|
|
7
|
-
|
|
8
|
-
interface CmrProgressProps {
|
|
9
|
-
percent?: number;
|
|
10
|
-
showInfo?: boolean;
|
|
11
|
-
status?: typeof ProgressStatuses[number];
|
|
12
|
-
strokeColor?: string | ProgressGradient;
|
|
13
|
-
strokeLinecap?: 'butt' | 'square' | 'round';
|
|
14
|
-
success?: SuccessProps;
|
|
15
|
-
trailColor?: string;
|
|
16
|
-
type?: ProgressType;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const CmrProgress = (props: CmrProgressProps) => {
|
|
20
|
-
const { percent, showInfo, status, strokeColor, strokeLinecap, success, trailColor, type, ...rest } = props;
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<Progress
|
|
24
|
-
percent={percent}
|
|
25
|
-
showInfo={showInfo}
|
|
26
|
-
status={status}
|
|
27
|
-
strokeColor={strokeColor}
|
|
28
|
-
strokeLinecap={strokeLinecap}
|
|
29
|
-
success={success}
|
|
30
|
-
trailColor={trailColor}
|
|
31
|
-
type={type}
|
|
32
|
-
style={{marginBottom: '5pt'}}
|
|
33
|
-
{...rest}
|
|
34
|
-
/>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default CmrProgress;
|
|
File without changes
|