namirasoft-site-react 1.3.442 → 1.3.444
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/dist/App.js +27 -4
- package/dist/App.js.map +1 -1
- package/dist/components/NSBoxDate.d.ts +1 -1
- package/dist/components/NSBoxDate.js +1 -1
- package/dist/components/NSBoxDate.js.map +1 -1
- package/dist/components/NSBoxFile.d.ts +2 -1
- package/dist/components/NSBoxFile.js.map +1 -1
- package/dist/components/NSCardScreenshot.d.ts +1 -1
- package/dist/components/NSCardScreenshot.js.map +1 -1
- package/dist/components/NSChartColumn.d.ts +1 -1
- package/dist/components/NSChartColumn.js.map +1 -1
- package/dist/components/NSChartPie.d.ts +1 -1
- package/dist/components/NSChartPie.js.map +1 -1
- package/dist/components/NSChartTable.d.ts +1 -1
- package/dist/components/NSChartTable.js.map +1 -1
- package/dist/components/NSDownload.d.ts +1 -1
- package/dist/components/NSDownload.js +2 -2
- package/dist/components/NSDownload.js.map +1 -1
- package/dist/components/NSTable.module.css +7 -1
- package/dist/components/NSTimeTable.d.ts +1 -1
- package/dist/components/NSTimeTable.js.map +1 -1
- package/dist/components/NSTimelineMonthly.d.ts +1 -0
- package/dist/components/NSTimelineMonthly.js +2 -2
- package/dist/components/NSTimelineMonthly.js.map +1 -1
- package/dist/components/NSTimelineMonthly.module.css +4 -0
- package/logo.png +0 -0
- package/package.json +1 -1
- package/src/App.tsx +28 -4
- package/src/components/NSBoxDate.tsx +2 -2
- package/src/components/NSBoxFile.tsx +104 -87
- package/src/components/NSCardScreenshot.tsx +27 -24
- package/src/components/NSChartColumn.tsx +97 -102
- package/src/components/NSChartPie.tsx +2 -2
- package/src/components/NSChartTable.tsx +85 -81
- package/src/components/NSDownload.tsx +55 -48
- package/src/components/NSTable.module.css +7 -1
- package/src/components/NSTimeTable.tsx +38 -35
- package/src/components/NSTimelineMonthly.module.css +4 -0
- package/src/components/NSTimelineMonthly.tsx +18 -14
|
@@ -1,108 +1,125 @@
|
|
|
1
1
|
import React, { ChangeEvent } from "react";
|
|
2
|
-
import { IBaseComponentProps, IValidationProps } from "../main";
|
|
3
2
|
import { InboxOutlined } from '@ant-design/icons';
|
|
4
3
|
import { message, Upload, UploadProps } from "antd";
|
|
4
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
5
|
+
import { IValidationProps } from "../props/IValidationProps";
|
|
5
6
|
import Styles from "./NSBoxFile.module.css"
|
|
6
7
|
|
|
7
8
|
const { Dragger } = Upload;
|
|
8
9
|
|
|
9
|
-
export interface INSBoxFileProps extends IBaseComponentProps, IValidationProps
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
export interface INSBoxFileProps extends IBaseComponentProps, IValidationProps
|
|
11
|
+
{
|
|
12
|
+
title: string;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
onChanged?: (info: any) => void;
|
|
16
|
+
onDroped?: (info: any) => void;
|
|
17
|
+
onClicked?: (e: NSBoxFile) => void;
|
|
18
|
+
showUploadList?: boolean;
|
|
19
|
+
maxFilesCount?: number;
|
|
20
|
+
multiple?: boolean;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
const props: UploadProps = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
name: 'file',
|
|
25
|
+
multiple: false,
|
|
26
|
+
action: 'https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload',
|
|
27
|
+
onChange(info)
|
|
28
|
+
{
|
|
29
|
+
const { status } = info.file;
|
|
30
|
+
if (status !== 'uploading')
|
|
31
|
+
{
|
|
32
|
+
console.log(info.file, info.fileList);
|
|
33
|
+
}
|
|
34
|
+
if (status === 'done')
|
|
35
|
+
{
|
|
36
|
+
message.success(`${info.file.name} file uploaded successfully.`);
|
|
37
|
+
} else if (status === 'error')
|
|
38
|
+
{
|
|
39
|
+
message.error(`${info.file.name} file upload failed.`);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
onDrop(e)
|
|
43
|
+
{
|
|
44
|
+
console.log('Dropped files', e.dataTransfer.files);
|
|
45
|
+
},
|
|
39
46
|
};
|
|
40
47
|
|
|
41
|
-
export interface INSBoxFileState
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
export interface INSBoxFileState
|
|
49
|
+
{
|
|
50
|
+
file: File | null;
|
|
51
|
+
error?: string;
|
|
44
52
|
}
|
|
45
53
|
|
|
46
|
-
export class NSBoxFile extends React.Component<INSBoxFileProps, INSBoxFileState>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
export class NSBoxFile extends React.Component<INSBoxFileProps, INSBoxFileState>
|
|
55
|
+
{
|
|
56
|
+
constructor(props: INSBoxFileProps)
|
|
57
|
+
{
|
|
58
|
+
super(props);
|
|
59
|
+
this.state = {
|
|
60
|
+
file: null,
|
|
61
|
+
};
|
|
62
|
+
this.getError = this.getError.bind(this);
|
|
63
|
+
this.getFile = this.getFile.bind(this);
|
|
64
|
+
this.setFile = this.setFile.bind(this);
|
|
65
|
+
this.onChanged = this.onChanged.bind(this)
|
|
66
|
+
}
|
|
57
67
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
getError(): string | null
|
|
69
|
+
{
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
61
72
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
handleFileChange = (event: ChangeEvent<HTMLInputElement>) =>
|
|
74
|
+
{
|
|
75
|
+
const file = event.target.files ? event.target.files[0] : null;
|
|
76
|
+
this.setState({ file });
|
|
77
|
+
};
|
|
66
78
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
79
|
+
getFile = (): File | null =>
|
|
80
|
+
{
|
|
81
|
+
return this.state.file;
|
|
82
|
+
};
|
|
70
83
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
84
|
+
setFile = (file: File | null) =>
|
|
85
|
+
{
|
|
86
|
+
this.setState({ file }, () =>
|
|
87
|
+
{
|
|
88
|
+
if (this.props.onChanged)
|
|
89
|
+
this.props.onChanged(this.state.file);
|
|
90
|
+
});
|
|
91
|
+
};
|
|
77
92
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
93
|
+
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
94
|
+
{
|
|
95
|
+
const file = e.target.files ? e.target.files[0] : null;
|
|
96
|
+
this.setState({ file });
|
|
97
|
+
if (this.props.onChanged)
|
|
98
|
+
this.props.onChanged(this.state.file);
|
|
99
|
+
}
|
|
84
100
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
override render()
|
|
102
|
+
{
|
|
103
|
+
return (
|
|
104
|
+
<div className={`${Styles.ns_input_file}`}>
|
|
105
|
+
<Dragger {...props}
|
|
106
|
+
onChange={this.props.onChanged}
|
|
107
|
+
onDrop={this.props.onDroped}
|
|
108
|
+
showUploadList={this.props.showUploadList}
|
|
109
|
+
maxCount={this.props.maxFilesCount}
|
|
110
|
+
multiple={this.props.multiple}
|
|
111
|
+
style={{ border: "none" }}
|
|
112
|
+
>
|
|
113
|
+
<p className="ant-upload-drag-icon">
|
|
114
|
+
<InboxOutlined style={{ color: "#141B5C" }} />
|
|
115
|
+
</p>
|
|
116
|
+
<p className="ant-upload-text" style={{ color: "#141B5C" }}>Click or drag file to this area to upload</p>
|
|
117
|
+
<p className="ant-upload-hint" style={{ color: "#141B5C" }}>
|
|
118
|
+
Support for a single or bulk upload. Strictly prohibited from uploading company data or other
|
|
119
|
+
banned files.
|
|
120
|
+
</p>
|
|
121
|
+
</Dragger>
|
|
122
|
+
</div>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
108
125
|
}
|
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
import { IBaseComponentProps } from "../
|
|
1
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
2
2
|
import Styles from "./NSCardScreenshot.module.css"
|
|
3
3
|
|
|
4
|
-
export interface NSCardScreenshotProps extends IBaseComponentProps
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
export interface NSCardScreenshotProps extends IBaseComponentProps
|
|
5
|
+
{
|
|
6
|
+
key: number;
|
|
7
|
+
screenshot: string;
|
|
8
|
+
timeSpent: string;
|
|
9
|
+
onDelete: () => void;
|
|
9
10
|
};
|
|
10
11
|
|
|
11
|
-
const NSCardScreenshot = (props: NSCardScreenshotProps) =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
12
|
+
const NSCardScreenshot = (props: NSCardScreenshotProps) =>
|
|
13
|
+
{
|
|
14
|
+
return (
|
|
15
|
+
<div className={`${Styles.card_screenshot} ${props.classList?.join(' ')}`} style={props.style}>
|
|
16
|
+
<div className={Styles.card_screenshot_header}>
|
|
17
|
+
<span className={Styles.timeSpent}>{props.timeSpent}</span>
|
|
18
|
+
<div onClick={() =>
|
|
19
|
+
{
|
|
20
|
+
if (props.onDelete)
|
|
21
|
+
props.onDelete()
|
|
22
|
+
}}
|
|
23
|
+
className={Styles.deleteButton}>
|
|
24
|
+
<img src="https://static.namirasoft.com/image/concept/delete/blue.svg" alt="" />
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div className={Styles.screenshot_imageSection}>
|
|
28
|
+
<img src={props.screenshot} alt="Screenshot" className={Styles.image} />
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
29
32
|
};
|
|
30
33
|
|
|
31
34
|
export default NSCardScreenshot;
|
|
@@ -1,114 +1,109 @@
|
|
|
1
1
|
import { Bar } from 'react-chartjs-2';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
CategoryScale,
|
|
5
|
-
LinearScale,
|
|
6
|
-
BarElement,
|
|
7
|
-
Title,
|
|
8
|
-
Tooltip,
|
|
9
|
-
Legend,
|
|
10
|
-
ChartOptions,
|
|
11
|
-
} from 'chart.js';
|
|
12
|
-
import { IBaseComponentProps } from '../main';
|
|
2
|
+
import { Chart as ChartJS, CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend, ChartOptions, } from 'chart.js';
|
|
3
|
+
import { IBaseComponentProps } from '../props/IBaseComponentProps';
|
|
13
4
|
import Styles from "./NSChartColumn.module.css"
|
|
14
5
|
|
|
15
6
|
ChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend);
|
|
16
7
|
|
|
17
|
-
export interface NSChartColumnProps extends IBaseComponentProps
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
export interface NSChartColumnProps extends IBaseComponentProps
|
|
9
|
+
{
|
|
10
|
+
labels: string[];
|
|
11
|
+
datasets: number[];
|
|
12
|
+
range: {
|
|
13
|
+
min: number,
|
|
14
|
+
max: number,
|
|
15
|
+
}
|
|
16
|
+
yGrid?: boolean;
|
|
17
|
+
height?: number;
|
|
18
|
+
width?: number;
|
|
27
19
|
}
|
|
28
20
|
|
|
29
|
-
const NSChartColumn = (props: NSChartColumnProps) =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
21
|
+
const NSChartColumn = (props: NSChartColumnProps) =>
|
|
22
|
+
{
|
|
23
|
+
const data = {
|
|
24
|
+
labels: props.labels,
|
|
25
|
+
datasets: [
|
|
26
|
+
{
|
|
27
|
+
label: 'Dataset 1',
|
|
28
|
+
data: props.datasets,
|
|
29
|
+
backgroundColor: '#3354F4',
|
|
30
|
+
borderRadius: 10,
|
|
31
|
+
barThickness: 12,
|
|
32
|
+
borderSkipped: false,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
43
36
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
37
|
+
const options: ChartOptions<'bar'> = {
|
|
38
|
+
responsive: true,
|
|
39
|
+
maintainAspectRatio: false,
|
|
40
|
+
plugins: {
|
|
41
|
+
legend: {
|
|
42
|
+
display: false,
|
|
43
|
+
},
|
|
44
|
+
tooltip: {
|
|
45
|
+
enabled: true,
|
|
46
|
+
callbacks: {
|
|
47
|
+
label: function (context)
|
|
48
|
+
{
|
|
49
|
+
return `$${context.raw}`;
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
scales: {
|
|
55
|
+
x: {
|
|
56
|
+
ticks: {
|
|
57
|
+
font: {
|
|
58
|
+
size: 8,
|
|
59
|
+
weight: 700
|
|
60
|
+
},
|
|
61
|
+
color: '#141B5C',
|
|
62
|
+
maxRotation: 554,
|
|
63
|
+
minRotation: 0,
|
|
64
|
+
},
|
|
65
|
+
grid: {
|
|
66
|
+
display: false,
|
|
67
|
+
},
|
|
68
|
+
border: {
|
|
69
|
+
display: false,
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
y: {
|
|
73
|
+
min: props.range.min,
|
|
74
|
+
max: props.range.max,
|
|
75
|
+
ticks: {
|
|
76
|
+
callback: function (value)
|
|
77
|
+
{
|
|
78
|
+
return `$${value}`;
|
|
79
|
+
},
|
|
80
|
+
font: {
|
|
81
|
+
size: 8,
|
|
82
|
+
weight: 700,
|
|
83
|
+
},
|
|
84
|
+
color: '#141B5C',
|
|
85
|
+
},
|
|
86
|
+
grid: {
|
|
87
|
+
display: props.yGrid,
|
|
88
|
+
color: "#E6EEF5"
|
|
89
|
+
},
|
|
90
|
+
border: {
|
|
91
|
+
display: false,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
101
96
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
97
|
+
return (
|
|
98
|
+
<div style={props.style} className={`${Styles.chart_column_container} ${props.classList?.join(" ")}`}>
|
|
99
|
+
<Bar
|
|
100
|
+
data={data}
|
|
101
|
+
options={options}
|
|
102
|
+
height={props.height ? props.height : 250}
|
|
103
|
+
width={props.width ? props.width : 320}
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
112
107
|
};
|
|
113
108
|
|
|
114
109
|
export default NSChartColumn;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Doughnut } from 'react-chartjs-2';
|
|
3
3
|
import
|
|
4
4
|
{
|
|
5
|
-
|
|
5
|
+
Chart as ChartJS,
|
|
6
6
|
ArcElement,
|
|
7
7
|
Tooltip,
|
|
8
8
|
Legend,
|
|
@@ -17,7 +17,7 @@ import
|
|
|
17
17
|
Plugin,
|
|
18
18
|
ArcElement as ArcElementType
|
|
19
19
|
} from 'chart.js';
|
|
20
|
-
import { IBaseComponentProps } from '../
|
|
20
|
+
import { IBaseComponentProps } from '../props/IBaseComponentProps';
|
|
21
21
|
|
|
22
22
|
ChartJS.register(
|
|
23
23
|
ArcElement, Tooltip, Legend, Title,
|