namirasoft-site-react 1.3.40 → 1.3.43
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 +30 -2
- package/dist/App.js.map +1 -1
- package/dist/components/NSButtonGroup.d.ts +2 -0
- package/dist/components/NSButtonGroup.js +7 -0
- package/dist/components/NSButtonGroup.js.map +1 -0
- package/dist/components/NSButtonGroup.module.css +38 -0
- package/dist/components/NSInputDate.d.ts +4 -2
- package/dist/components/NSInputDate.js +9 -7
- package/dist/components/NSInputDate.js.map +1 -1
- package/dist/components/NSInputDuration.d.ts +4 -2
- package/dist/components/NSInputDuration.js +12 -9
- package/dist/components/NSInputDuration.js.map +1 -1
- package/dist/components/NSInputEmail.d.ts +4 -2
- package/dist/components/NSInputEmail.js +16 -12
- package/dist/components/NSInputEmail.js.map +1 -1
- package/dist/components/NSInputFloat.d.ts +4 -2
- package/dist/components/NSInputFloat.js +11 -8
- package/dist/components/NSInputFloat.js.map +1 -1
- package/dist/components/NSInputIP.d.ts +4 -2
- package/dist/components/NSInputIP.js +12 -9
- package/dist/components/NSInputIP.js.map +1 -1
- package/dist/components/NSInputInteger.d.ts +4 -2
- package/dist/components/NSInputInteger.js +12 -9
- package/dist/components/NSInputInteger.js.map +1 -1
- package/dist/components/NSInputSearch.d.ts +4 -4
- package/dist/components/NSInputSearch.js +11 -17
- package/dist/components/NSInputSearch.js.map +1 -1
- package/dist/components/NSInputTime.d.ts +4 -2
- package/dist/components/NSInputTime.js +12 -9
- package/dist/components/NSInputTime.js.map +1 -1
- package/dist/components/NSTable.d.ts +1 -0
- package/dist/components/NSTable.js +6 -2
- package/dist/components/NSTable.js.map +1 -1
- package/dist/components/NSTable.module.css +50 -9
- package/dist/main.d.ts +1 -0
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
- package/public/assets/images/close-vector.png +0 -0
- package/src/App.tsx +46 -8
- package/src/components/NSButtonGroup.module.css +38 -0
- package/src/components/NSButtonGroup.tsx +12 -0
- package/src/components/NSInputDate.tsx +11 -7
- package/src/components/NSInputDuration.tsx +18 -14
- package/src/components/NSInputEmail.tsx +21 -16
- package/src/components/NSInputFloat.tsx +16 -11
- package/src/components/NSInputIP.tsx +14 -10
- package/src/components/NSInputInteger.tsx +14 -10
- package/src/components/NSInputSearch.tsx +16 -24
- package/src/components/NSInputTime.tsx +13 -9
- package/src/components/NSTable.module.css +50 -9
- package/src/components/NSTable.tsx +27 -8
- package/src/main.ts +1 -0
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export interface NSInputTimeProps {
|
|
3
3
|
title: string;
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
4
6
|
}
|
|
5
7
|
export interface NSInputTimeState {
|
|
6
8
|
value: string;
|
|
7
9
|
}
|
|
8
10
|
export declare class NSInputTime extends React.Component<NSInputTimeProps, NSInputTimeState> {
|
|
9
11
|
constructor(props: NSInputTimeProps);
|
|
10
|
-
setValue(e: React.ChangeEvent<HTMLInputElement>): void;
|
|
11
|
-
setDefaultValue(value: string): void;
|
|
12
12
|
getValue(): string;
|
|
13
|
+
setValue(value: string): void;
|
|
14
|
+
private onChanged;
|
|
13
15
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
}
|
|
@@ -5,25 +5,28 @@ import Styles from "./NSInputTime.module.css";
|
|
|
5
5
|
import IconInputTime from '../assets/images/icon-input-time.svg';
|
|
6
6
|
export class NSInputTime extends React.Component {
|
|
7
7
|
constructor(props) {
|
|
8
|
+
var _a;
|
|
8
9
|
super(props);
|
|
9
10
|
this.state = {
|
|
10
|
-
value: "",
|
|
11
|
+
value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "",
|
|
11
12
|
};
|
|
12
|
-
this.setValue = this.setValue.bind(this);
|
|
13
13
|
this.getValue = this.getValue.bind(this);
|
|
14
|
-
this.
|
|
14
|
+
this.setValue = this.setValue.bind(this);
|
|
15
|
+
this.onChanged = this.onChanged.bind(this);
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
this.
|
|
17
|
+
getValue() {
|
|
18
|
+
return this.state.value;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
+
setValue(value) {
|
|
20
21
|
this.setState({ value });
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
onChanged(e) {
|
|
24
|
+
this.setValue(e.target.value);
|
|
25
|
+
if (this.props.onChanged)
|
|
26
|
+
this.props.onChanged(e);
|
|
24
27
|
}
|
|
25
28
|
render() {
|
|
26
|
-
return (_jsxs("div", { className: `${Styles.ns_input_parent} p-2`, children: [_jsx("span", { className: Styles.ns_input_title, children: this.props.title }), _jsx("img", { className: Styles.ns_input_icon, src: IconInputTime, alt: "icon", width: 24, height: 24 }), _jsx("input", { value: this.state.value, onChange: this.
|
|
29
|
+
return (_jsxs("div", { className: `${Styles.ns_input_parent} p-2`, children: [_jsx("span", { className: Styles.ns_input_title, children: this.props.title }), _jsx("img", { className: Styles.ns_input_icon, src: IconInputTime, alt: "icon", width: 24, height: 24 }), _jsx("input", { value: this.state.value, onChange: this.onChanged, type: "time", className: Styles.ns_input, placeholder: "21:44:06", step: "2" })] }));
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
32
|
//# sourceMappingURL=NSInputTime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSInputTime.js","sourceRoot":"","sources":["../../src/components/NSInputTime.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,aAAa,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"NSInputTime.js","sourceRoot":"","sources":["../../src/components/NSInputTime.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MA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,EACT,MAAM,EAAE,EAAE,GACZ,EACF,gBACI,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,IAAI,EAAC,MAAM,EACX,SAAS,EAAE,MAAM,CAAC,QAAQ,EAC1B,WAAW,EAAC,UAAU,EACtB,IAAI,EAAC,GAAG,GACV,IACA,CACT,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -15,6 +15,7 @@ export interface NSTableState<RowType> {
|
|
|
15
15
|
[key: string]: string;
|
|
16
16
|
};
|
|
17
17
|
rows: RowType[];
|
|
18
|
+
modalState: boolean;
|
|
18
19
|
}
|
|
19
20
|
export declare class NSTable<RowType> extends Component<NSTableProps<RowType>, NSTableState<RowType>> {
|
|
20
21
|
constructor(props: NSTableProps<RowType>);
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import NSButtonGroup from './NSButtonGroup';
|
|
4
|
+
import { NSInputSearch } from './NSInputSearch';
|
|
5
|
+
import { NSPagination } from './NSPagination';
|
|
6
|
+
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
3
7
|
import Styles from './NSTable.module.css';
|
|
4
8
|
import { Component } from 'react';
|
|
5
9
|
export class NSTable extends Component {
|
|
6
10
|
constructor(props) {
|
|
7
11
|
super(props);
|
|
8
|
-
this.state = { columns: props.columns, rows: props.rows };
|
|
12
|
+
this.state = { columns: props.columns, rows: props.rows, modalState: false };
|
|
9
13
|
}
|
|
10
14
|
setColumns(columns) {
|
|
11
15
|
this.setState({ columns });
|
|
@@ -15,7 +19,7 @@ export class NSTable extends Component {
|
|
|
15
19
|
}
|
|
16
20
|
render() {
|
|
17
21
|
let column_keys = Object.keys(this.state.columns);
|
|
18
|
-
return (_jsxs("div", { className: Styles.ns_project_list_container, children:
|
|
22
|
+
return (_jsxs("div", { className: `container ${Styles.ns_project_list_container}`, children: [_jsx("section", { className: Styles.ns_search_input, children: _jsx(NSInputSearch, {}) }), _jsx(NSSpace, { size: NSSpaceSizeType.SMALL }), _jsxs("table", { className: Styles.ns_table, children: [_jsx("thead", { className: Styles.ns_thead, children: _jsx("tr", { children: column_keys.map(column_key => _jsx("th", { scope: "col", children: this.state.columns[column_key] }, column_key)) }) }), _jsx("tbody", { className: Styles.ns_tbody, children: this.state.rows.map((row, rowIndex) => _jsx("tr", { onClick: () => this.setState({ modalState: !this.state.modalState }), children: column_keys.map((column, columnIndex) => (_jsx("td", Object.assign({}, this.props.getColumnAttributes(column, columnIndex), { "data-label": this.state.columns[column], children: this.props.getCell(row, column, rowIndex, columnIndex) })))) }, this.props.getRowKey(row, rowIndex))) })] }), _jsx(NSSpace, { size: NSSpaceSizeType.MICRO }), _jsxs("section", { className: Styles.ns_button_group, children: [_jsx(NSPagination, { size: 50, page: 5 }), _jsx(NSSpace, { size: NSSpaceSizeType.SMALL }), _jsx(NSButtonGroup, {})] }), _jsx(NSSpace, { size: NSSpaceSizeType.SMALL }), _jsxs("section", { onClick: () => this.setState({ modalState: !this.state.modalState }), className: Styles.ns_modal, style: { display: this.state.modalState ? "block" : "none" }, children: [_jsx("a", { children: _jsx("img", { src: '/assets/images/close-vector.png' }) }), _jsx("p", { children: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur vitae diam non enim vestibulum interdum. Duis condimentum augue id magna semper rutrum. Nullam sit amet magna in magna gravida vehicula. Vestibulum erat nulla, ullamcorper nec, rutrum non, nonummy ac, erat. In laoreet, magna id viverra tincidunt, sem odio bibendum justo, vel imperdiet sapien wisi sed libero. Phasellus enim erat, vestibulum vel, aliquam a, posuere eu, velit. Morbi imperdiet, mauris ac auctor dictum, nisl ligula egestas nulla, et sollicitudin sem purus in lacus. Mauris dictum facilisis augue. Phasellus faucibus molestie nisl. Aliquam ante. Nulla accumsan, elit sit amet varius semper, nulla mauris mollis quam, tempor suscipit diam nulla vel leo. In convallis. Phasellus rhoncus.." })] })] }));
|
|
19
23
|
}
|
|
20
24
|
}
|
|
21
25
|
//# sourceMappingURL=NSTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSTable.js","sourceRoot":"","sources":["../../src/components/NSTable.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NSTable.js","sourceRoot":"","sources":["../../src/components/NSTable.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAkBlC,MAAM,OAAO,OAAiB,SAAQ,SAAuD;IAEzF,YAAY,KAA4B;QAEpC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;IACjF,CAAC;IACD,UAAU,CAAC,OAAkC;QAEzC,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,CAAC,IAAe;QAEnB,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5B,CAAC;IACQ,MAAM;QAEX,IAAI,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAA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AM,CAAC,eAAe,aACtC,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,GAAI,EACnC,KAAC,OAAO,IAAC,IAAI,EAAE,eAAe,CAAC,KAAK,GAAI,EACxC,KAAC,aAAa,KAAG,IACX,EACV,KAAC,OAAO,IAAC,IAAI,EAAE,eAAe,CAAC,KAAK,GAAI,EACxC,mBAAS,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,aACnK,sBAAG,cAAK,GAAG,EAAC,iCAAiC,GAAG,GAAI,EACpD,4xBAGI,IACE,IACP,CACV,CAAA;IACL,CAAC;CACJ"}
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
.ns_project_list_container {}
|
|
2
|
-
|
|
3
1
|
.ns_table {
|
|
4
2
|
display: flex;
|
|
5
3
|
flex-direction: column;
|
|
6
|
-
padding: 0;
|
|
7
4
|
color: rgba(20, 27, 92, 1);
|
|
8
|
-
|
|
9
5
|
}
|
|
10
6
|
|
|
11
7
|
.ns_table thead {
|
|
12
8
|
clip: rect(0 0 0 0);
|
|
13
9
|
position: fixed;
|
|
14
|
-
|
|
15
10
|
}
|
|
16
11
|
|
|
17
12
|
.ns_table tr {
|
|
18
13
|
border-radius: 8px;
|
|
19
14
|
padding: 16px;
|
|
20
|
-
margin: 10px;
|
|
21
15
|
display: block;
|
|
22
16
|
background-color: rgba(20, 27, 92, 0.3);
|
|
17
|
+
margin: 16px 0;
|
|
23
18
|
}
|
|
24
19
|
|
|
25
20
|
.ns_table td {
|
|
@@ -35,13 +30,42 @@
|
|
|
35
30
|
float: left;
|
|
36
31
|
font-weight: bold;
|
|
37
32
|
text-transform: uppercase;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Button Group */
|
|
36
|
+
.ns_button_group {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
align-items: center;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Modal */
|
|
43
|
+
.ns_modal {
|
|
44
|
+
position: fixed;
|
|
45
|
+
height: fit-content;
|
|
46
|
+
top: 25%;
|
|
47
|
+
left: 0;
|
|
48
|
+
border-radius: 8px;
|
|
49
|
+
padding: 24px;
|
|
50
|
+
margin: 0 16px;
|
|
51
|
+
background-color: rgba(188, 194, 244, 1);
|
|
52
|
+
z-index: 10;
|
|
53
|
+
color: rgba(20, 27, 92, 1);
|
|
54
|
+
}
|
|
38
55
|
|
|
56
|
+
.ns_modal a {
|
|
57
|
+
float: right;
|
|
39
58
|
}
|
|
40
59
|
|
|
41
|
-
|
|
60
|
+
.modal img {
|
|
61
|
+
width: 32px;
|
|
62
|
+
height: 32px;
|
|
63
|
+
right: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@media screen and (min-width: 768px) {
|
|
42
67
|
.ns_table {
|
|
43
68
|
color: #000000;
|
|
44
|
-
|
|
45
69
|
}
|
|
46
70
|
|
|
47
71
|
.ns_table thead {
|
|
@@ -53,7 +77,6 @@
|
|
|
53
77
|
|
|
54
78
|
.ns_table tbody {
|
|
55
79
|
background-color: rgba(20, 27, 92, 0.3);
|
|
56
|
-
|
|
57
80
|
}
|
|
58
81
|
|
|
59
82
|
.ns_table tr {
|
|
@@ -89,6 +112,14 @@
|
|
|
89
112
|
text-transform: uppercase;
|
|
90
113
|
}
|
|
91
114
|
|
|
115
|
+
/* Button Group */
|
|
116
|
+
.ns_button_group {
|
|
117
|
+
display: flex;
|
|
118
|
+
flex-direction: row;
|
|
119
|
+
justify-content: space-between;
|
|
120
|
+
align-items: center;
|
|
121
|
+
}
|
|
122
|
+
|
|
92
123
|
@media screen and (min-width: 990px) {
|
|
93
124
|
.ns_table {
|
|
94
125
|
padding: 0 48px;
|
|
@@ -101,5 +132,15 @@
|
|
|
101
132
|
.ns_table tr {
|
|
102
133
|
font-size: 24px;
|
|
103
134
|
}
|
|
135
|
+
|
|
136
|
+
/* Search Input */
|
|
137
|
+
.ns_search_input {
|
|
138
|
+
padding: 0 40px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Button Group */
|
|
142
|
+
.ns_button_group {
|
|
143
|
+
padding: 0 48px;
|
|
144
|
+
}
|
|
104
145
|
}
|
|
105
146
|
}
|
package/dist/main.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./components/NSButtonBlue";
|
|
2
2
|
export * from "./components/NSButtonBlueVector";
|
|
3
3
|
export * from "./components/NSButtonGreen";
|
|
4
|
+
export * from "./components/NSButtonGroup";
|
|
4
5
|
export * from "./components/NSButtonRed";
|
|
5
6
|
export * from "./components/NSCard";
|
|
6
7
|
export * from "./components/NSEntityCardBackground";
|
package/dist/main.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./components/NSButtonBlue";
|
|
2
2
|
export * from "./components/NSButtonBlueVector";
|
|
3
3
|
export * from "./components/NSButtonGreen";
|
|
4
|
+
export * from "./components/NSButtonGroup";
|
|
4
5
|
export * from "./components/NSButtonRed";
|
|
5
6
|
export * from "./components/NSCard";
|
|
6
7
|
export * from "./components/NSEntityCardBackground";
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qCAAqC,CAAC;AACpD,cAAc,0BAA0B,CAAC;AACzC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Ac,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
Binary file
|
package/src/App.tsx
CHANGED
|
@@ -1,15 +1,53 @@
|
|
|
1
1
|
import './App.css';
|
|
2
2
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
3
|
-
import { NSLayoutTitle } from './main';
|
|
3
|
+
import { NSLayoutTitle, NSTable } from './main';
|
|
4
4
|
|
|
5
5
|
export function App()
|
|
6
6
|
{
|
|
7
|
+
let columns = {
|
|
8
|
+
"id": "ID",
|
|
9
|
+
"project": "Project",
|
|
10
|
+
"level": "Level",
|
|
11
|
+
"message": "Message",
|
|
12
|
+
"cent": "Cent",
|
|
13
|
+
"status": "Status",
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
let rows = [{
|
|
17
|
+
id: 1,
|
|
18
|
+
project: "Namirasoft Account",
|
|
19
|
+
level: "Debug",
|
|
20
|
+
message: "Lorem ipsum dolor sit amet, consetetur ",
|
|
21
|
+
cent: "24",
|
|
22
|
+
status: "Done"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: 2,
|
|
26
|
+
project: "Namirasoft Account",
|
|
27
|
+
level: "Debug",
|
|
28
|
+
message: "Lorem ipsum dolor sit amet, consetetur ",
|
|
29
|
+
cent: "24",
|
|
30
|
+
status: "Done"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
interface Row
|
|
34
|
+
{
|
|
35
|
+
id: number,
|
|
36
|
+
project: string,
|
|
37
|
+
level: string,
|
|
38
|
+
message: string,
|
|
39
|
+
cent: string,
|
|
40
|
+
status: string
|
|
41
|
+
}
|
|
42
|
+
function getCell(row: Row, column: string): any
|
|
43
|
+
{
|
|
44
|
+
return (row as any)[column];
|
|
45
|
+
}
|
|
7
46
|
return (
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</div>
|
|
47
|
+
<NSLayoutTitle scope='Namirasoft Account Console' logo='' title="Namirasoft">
|
|
48
|
+
<div className="container">
|
|
49
|
+
<NSTable columns={columns} rows={rows} getCell={getCell} getColumnAttributes={() => { return {} }} getRowKey={row => row.id.toString()} />
|
|
50
|
+
</div>
|
|
51
|
+
</NSLayoutTitle>
|
|
14
52
|
);
|
|
15
|
-
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.ns_button_group_desktop {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
width: 100%;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.ns_button_group_desktop button {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
font-size: 16px;
|
|
13
|
+
border-radius: 8px;
|
|
14
|
+
width: 128px;
|
|
15
|
+
height: 48px;
|
|
16
|
+
gap: 10px;
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
color: black;
|
|
19
|
+
background-color: transparent;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ns_export_button {
|
|
23
|
+
border: 1px solid rgba(255, 148, 50, 1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ns_refresh_button {
|
|
27
|
+
border: 1px solid rgba(3, 119, 255, 1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ns_project img {
|
|
31
|
+
margin-right: 8px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media only screen and (min-width:768px) {
|
|
35
|
+
.ns_button_group_desktop {
|
|
36
|
+
gap: 24px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Styles from './NSButtonGroup.module.css'
|
|
2
|
+
function NSButtonGroup()
|
|
3
|
+
{
|
|
4
|
+
return (
|
|
5
|
+
<div className={Styles.ns_button_group_desktop}>
|
|
6
|
+
<button onClick={() => window.print()} className={Styles.ns_export_button}><img src="/assets/images/export-vector.png" alt="Export Table Data" width={13} height={16} />Export</button>
|
|
7
|
+
<button onClick={() => window.location.reload()} className={Styles.ns_refresh_button}><img src="/assets/images/refresh-vector.png" alt="Refresh Table Contnet" width={15} height={16} />Refresh</button>
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default NSButtonGroup;
|
|
@@ -6,6 +6,8 @@ import Styles from "./NSInputDate.module.css";
|
|
|
6
6
|
export interface NSInputDateProps
|
|
7
7
|
{
|
|
8
8
|
title: string;
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export interface NSInputDateState
|
|
@@ -22,19 +24,21 @@ export class NSInputDate extends React.Component<NSInputDateProps, NSInputDateSt
|
|
|
22
24
|
};
|
|
23
25
|
this.setValue = this.setValue.bind(this);
|
|
24
26
|
this.getValue = this.getValue.bind(this);
|
|
25
|
-
this.
|
|
27
|
+
this.onChanged = this.onChanged.bind(this);
|
|
26
28
|
}
|
|
27
|
-
|
|
29
|
+
getValue(): string
|
|
28
30
|
{
|
|
29
|
-
this.
|
|
31
|
+
return this.state.value;
|
|
30
32
|
}
|
|
31
|
-
|
|
33
|
+
setValue(value: string): void
|
|
32
34
|
{
|
|
33
35
|
this.setState({ value });
|
|
34
36
|
}
|
|
35
|
-
|
|
37
|
+
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
36
38
|
{
|
|
37
|
-
|
|
39
|
+
this.setValue(e.target.value);
|
|
40
|
+
if (this.props.onChanged)
|
|
41
|
+
this.props.onChanged(e);
|
|
38
42
|
}
|
|
39
43
|
override render()
|
|
40
44
|
{
|
|
@@ -43,7 +47,7 @@ export class NSInputDate extends React.Component<NSInputDateProps, NSInputDateSt
|
|
|
43
47
|
<span className={Styles.ns_input_title}>{this.props.title}</span>
|
|
44
48
|
<input
|
|
45
49
|
value={this.state.value}
|
|
46
|
-
onChange={this.
|
|
50
|
+
onChange={this.onChanged}
|
|
47
51
|
type="date"
|
|
48
52
|
className={Styles.ns_input}
|
|
49
53
|
placeholder="YYYY/MM/DD"
|
|
@@ -6,7 +6,9 @@ import IconInputDuration from '../assets/images/icon-input-duration.svg';
|
|
|
6
6
|
|
|
7
7
|
export interface NSInputDurationProps
|
|
8
8
|
{
|
|
9
|
-
|
|
9
|
+
title: string;
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
export interface NSInputDurationState
|
|
@@ -19,25 +21,27 @@ export class NSInputDuration extends React.Component<NSInputDurationProps, NSInp
|
|
|
19
21
|
{
|
|
20
22
|
super(props);
|
|
21
23
|
this.state = {
|
|
22
|
-
value: "",
|
|
24
|
+
value: props.defaultValue ?? "",
|
|
23
25
|
};
|
|
24
|
-
this.setValue = this.setValue.bind(this);
|
|
25
26
|
this.getValue = this.getValue.bind(this);
|
|
26
|
-
this.
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
this.setValue = this.setValue.bind(this);
|
|
28
|
+
this.onChanged = this.onChanged.bind(this);
|
|
29
|
+
}
|
|
30
|
+
getValue(): string
|
|
29
31
|
{
|
|
30
|
-
this.
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
return this.state.value;
|
|
33
|
+
}
|
|
34
|
+
setValue(value: string): void
|
|
33
35
|
{
|
|
34
36
|
this.setState({ value });
|
|
35
37
|
}
|
|
36
|
-
|
|
38
|
+
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
37
39
|
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
this.setValue(e.target.value);
|
|
41
|
+
if (this.props.onChanged)
|
|
42
|
+
this.props.onChanged(e);
|
|
43
|
+
}
|
|
44
|
+
override render()
|
|
41
45
|
{
|
|
42
46
|
return (
|
|
43
47
|
<div className={`${Styles.ns_input_parent} p-2`}>
|
|
@@ -51,7 +55,7 @@ export class NSInputDuration extends React.Component<NSInputDurationProps, NSInp
|
|
|
51
55
|
/>
|
|
52
56
|
<input
|
|
53
57
|
value={this.state.value}
|
|
54
|
-
|
|
58
|
+
onChange={this.onChanged}
|
|
55
59
|
type="time"
|
|
56
60
|
className={Styles.ns_input}
|
|
57
61
|
placeholder="21:44:06"
|
|
@@ -8,6 +8,8 @@ import Danger from '../assets/images/danger.svg';
|
|
|
8
8
|
export interface NSInputEmailProps
|
|
9
9
|
{
|
|
10
10
|
title: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export interface NSInputEmailState
|
|
@@ -21,32 +23,35 @@ export class NSInputEmail extends React.Component<NSInputEmailProps, NSInputEmai
|
|
|
21
23
|
{
|
|
22
24
|
super(props);
|
|
23
25
|
this.state = {
|
|
24
|
-
|
|
26
|
+
value: props.defaultValue ?? "",
|
|
25
27
|
error: false,
|
|
26
28
|
};
|
|
27
29
|
this.setValue = this.setValue.bind(this);
|
|
28
30
|
this.getValue = this.getValue.bind(this);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
this.onChanged = this.onChanged.bind(this);
|
|
32
|
+
}
|
|
33
|
+
getValue(): string
|
|
32
34
|
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
return this.state.value;
|
|
36
|
+
}
|
|
37
|
+
setValue(value: string): void
|
|
38
|
+
{
|
|
39
|
+
let email = /^(([^<>()[]\\.,;:\s@"]+(\.[^<>()[]\\.,;:\s@"]+)*)|(".+"))@(([[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
40
|
+
debugger
|
|
41
|
+
if (!email.test(value))
|
|
35
42
|
{
|
|
36
|
-
this.setState({ error: true, value
|
|
43
|
+
this.setState({ error: true, value });
|
|
37
44
|
}
|
|
38
45
|
else
|
|
39
46
|
{
|
|
40
|
-
this.setState({ error: false, value
|
|
47
|
+
this.setState({ error: false, value });
|
|
41
48
|
}
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
}
|
|
50
|
+
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
44
51
|
{
|
|
45
|
-
this.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
{
|
|
49
|
-
return this.state.value;
|
|
52
|
+
this.setValue(e.target.value);
|
|
53
|
+
if (this.props.onChanged)
|
|
54
|
+
this.props.onChanged(e);
|
|
50
55
|
}
|
|
51
56
|
override render()
|
|
52
57
|
{
|
|
@@ -63,7 +68,7 @@ export class NSInputEmail extends React.Component<NSInputEmailProps, NSInputEmai
|
|
|
63
68
|
/>
|
|
64
69
|
<input
|
|
65
70
|
value={this.state.value}
|
|
66
|
-
onChange={this.
|
|
71
|
+
onChange={this.onChanged}
|
|
67
72
|
type="email"
|
|
68
73
|
className={`${this.state.error === true ? Styles.ns_input_red : ""} ${Styles.ns_input}`}
|
|
69
74
|
placeholder="Sample@gmail.com"
|
|
@@ -6,7 +6,9 @@ import IconInputFloat from '../assets/images/icon-input-float.svg';
|
|
|
6
6
|
|
|
7
7
|
export interface NSInputFloatProps
|
|
8
8
|
{
|
|
9
|
-
|
|
9
|
+
title: string;
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
export interface NSInputFloatState
|
|
@@ -19,23 +21,26 @@ export class NSInputFloat extends React.Component<NSInputFloatProps, NSInputFloa
|
|
|
19
21
|
{
|
|
20
22
|
super(props);
|
|
21
23
|
this.state = {
|
|
22
|
-
value: "",
|
|
24
|
+
value: props.defaultValue ?? "",
|
|
23
25
|
};
|
|
24
26
|
this.setValue = this.setValue.bind(this);
|
|
25
27
|
this.getValue = this.getValue.bind(this);
|
|
26
|
-
this.
|
|
28
|
+
this.onChanged = this.onChanged.bind(this);
|
|
27
29
|
}
|
|
28
|
-
|
|
30
|
+
getValue(): string
|
|
29
31
|
{
|
|
30
|
-
this.
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
return this.state.value;
|
|
33
|
+
}
|
|
34
|
+
setValue(value: string): void
|
|
33
35
|
{
|
|
34
36
|
this.setState({ value });
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
37
40
|
{
|
|
38
|
-
|
|
41
|
+
this.setValue(e.target.value);
|
|
42
|
+
if (this.props.onChanged)
|
|
43
|
+
this.props.onChanged(e);
|
|
39
44
|
}
|
|
40
45
|
override render()
|
|
41
46
|
{
|
|
@@ -51,7 +56,7 @@ export class NSInputFloat extends React.Component<NSInputFloatProps, NSInputFloa
|
|
|
51
56
|
/>
|
|
52
57
|
<input
|
|
53
58
|
value={this.state.value}
|
|
54
|
-
onChange={this.
|
|
59
|
+
onChange={this.onChanged}
|
|
55
60
|
type="number"
|
|
56
61
|
className={Styles.ns_input}
|
|
57
62
|
placeholder="1.2"
|