namirasoft-site-react 1.3.443 → 1.3.445

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