namirasoft-site-react 1.3.46 → 1.3.48
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 +3 -3
- package/dist/App.js.map +1 -1
- package/dist/Validator.d.ts +9 -0
- package/dist/Validator.js +52 -0
- package/dist/Validator.js.map +1 -0
- package/dist/components/NSInputEmail.d.ts +6 -2
- package/dist/components/NSInputEmail.js +12 -13
- package/dist/components/NSInputEmail.js.map +1 -1
- package/dist/components/NSInputFloat.d.ts +6 -1
- package/dist/components/NSInputFloat.js +11 -1
- package/dist/components/NSInputFloat.js.map +1 -1
- package/dist/components/NSSectionBars.js +3 -2
- package/dist/components/NSSectionBars.js.map +1 -1
- package/dist/components/NSSectionCards.js +5 -4
- package/dist/components/NSSectionCards.js.map +1 -1
- package/dist/components/NSSectionTitle.js +2 -1
- package/dist/components/NSSectionTitle.js.map +1 -1
- package/dist/components/NSSpace.d.ts +0 -4
- package/dist/components/NSSpace.js +1 -14
- package/dist/components/NSSpace.js.map +1 -1
- package/dist/props/BaseComponentProps.d.ts +5 -0
- package/dist/props/BaseComponentProps.js +2 -0
- package/dist/props/BaseComponentProps.js.map +1 -0
- package/dist/props/ValidationNumberProps.d.ts +5 -0
- package/dist/props/ValidationNumberProps.js +2 -0
- package/dist/props/ValidationNumberProps.js.map +1 -0
- package/dist/props/ValidationProps.d.ts +5 -0
- package/dist/props/ValidationProps.js +2 -0
- package/dist/props/ValidationProps.js.map +1 -0
- package/dist/props/ValidationRegexProps.d.ts +4 -0
- package/dist/props/ValidationRegexProps.js +2 -0
- package/dist/props/ValidationRegexProps.js.map +1 -0
- package/dist/props/ValidationStringProps.d.ts +5 -0
- package/dist/props/ValidationStringProps.js +2 -0
- package/dist/props/ValidationStringProps.js.map +1 -0
- package/package.json +2 -2
- package/src/App.tsx +51 -42
- package/src/Validator.ts +62 -0
- package/src/components/NSInputEmail.tsx +34 -30
- package/src/components/NSInputFloat.tsx +29 -9
- package/src/components/NSSectionBars.tsx +3 -0
- package/src/components/NSSectionCards.tsx +4 -1
- package/src/components/NSSectionTitle.tsx +2 -0
- package/src/components/NSSpace.tsx +1 -19
- package/src/props/BaseComponentProps.ts +7 -0
- package/src/props/ValidationNumberProps.ts +7 -0
- package/src/props/ValidationProps.ts +7 -0
- package/src/props/ValidationRegexProps.ts +5 -0
- package/src/props/ValidationStringProps.ts +7 -0
package/dist/App.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import './App.css';
|
|
3
3
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
4
|
-
import {
|
|
4
|
+
import { NSFooter, NSHeader, NSTable } from './main';
|
|
5
5
|
export function App() {
|
|
6
6
|
let columns = {
|
|
7
7
|
"id": "ID",
|
|
@@ -28,6 +28,6 @@ export function App() {
|
|
|
28
28
|
status: "Done"
|
|
29
29
|
}
|
|
30
30
|
];
|
|
31
|
-
return (_jsx(
|
|
31
|
+
return (_jsxs(_Fragment, { children: [_jsx(NSHeader, { name: 'Header', scope: 'Namira Software Corporation', logo: 'https://static.namirasoft.com/logo/namirasoft/base.png', account: false, background: { color: "transparent !important" } }), _jsx("div", { className: "container", children: _jsx(NSTable, { columns: columns, rows: rows, getRowKey: row => row.id.toString() }) }), _jsx(NSFooter, { name: 'Footer', scope: 'Namira Software Corporation', logo: 'https://static.namirasoft.com/logo/namirasoft/base.png' })] }));
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=App.js.map
|
package/dist/App.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.js","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":";AAAA,OAAO,WAAW,CAAC;AACnB,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"App.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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ValidationNumberProps } from "./props/ValidationNumberProps";
|
|
2
|
+
import { ValidationProps } from "./props/ValidationProps";
|
|
3
|
+
import { ValidationStringProps } from "./props/ValidationStringProps";
|
|
4
|
+
export declare class Validator {
|
|
5
|
+
static getError(name: string, value: string | null | undefined, validator: ValidationProps): string | null;
|
|
6
|
+
static getErrorString(name: string, value: string | null | undefined, validator: ValidationStringProps): string | null;
|
|
7
|
+
static getErrorNumber(name: string, value: string | null | undefined, validator: ValidationNumberProps): string | null;
|
|
8
|
+
static getErrorEmail(name: string, value: string | null | undefined): string | null;
|
|
9
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export class Validator {
|
|
2
|
+
static getError(name, value, validator) {
|
|
3
|
+
if (validator.required)
|
|
4
|
+
if (!value)
|
|
5
|
+
return `${name} is required.`;
|
|
6
|
+
if (value)
|
|
7
|
+
if (validator.regex)
|
|
8
|
+
if (!validator.regex.regex.test(value))
|
|
9
|
+
return `${name} is not a valid ${validator.regex.name}.`;
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
static getErrorString(name, value, validator) {
|
|
13
|
+
let error = this.getError(name, value, validator);
|
|
14
|
+
if (error)
|
|
15
|
+
return error;
|
|
16
|
+
if (value) {
|
|
17
|
+
if (validator.max_length != null)
|
|
18
|
+
if (validator.max_length < value.length)
|
|
19
|
+
return `Max length of ${name} should be ${validator.max_length} characters.`;
|
|
20
|
+
if (validator.min_length != null)
|
|
21
|
+
if (validator.min_length > value.length)
|
|
22
|
+
return `Minlength of ${name} should be ${validator.min_length} characters.`;
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
static getErrorNumber(name, value, validator) {
|
|
27
|
+
let error = this.getError(name, value, validator);
|
|
28
|
+
if (error)
|
|
29
|
+
return error;
|
|
30
|
+
if (value) {
|
|
31
|
+
let numValue = parseFloat(value);
|
|
32
|
+
if (isNaN(numValue))
|
|
33
|
+
return `${name} is not a number.`;
|
|
34
|
+
if (validator.max != null)
|
|
35
|
+
if (validator.max < numValue)
|
|
36
|
+
return `Max value of ${name} should be ${validator.max} characters.`;
|
|
37
|
+
if (validator.min != null)
|
|
38
|
+
if (validator.min > numValue)
|
|
39
|
+
return `Min value of ${name} should be ${validator.min} characters.`;
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
static getErrorEmail(name, value) {
|
|
44
|
+
return Validator.getError(name, value, {
|
|
45
|
+
required: true, regex: {
|
|
46
|
+
name: "Email",
|
|
47
|
+
regex: /^[\w]+@([\w]+\.)+\w{2,}$/gm
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=Validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Validator.js","sourceRoot":"","sources":["../src/Validator.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,SAAS;IAElB,MAAM,CAAC,QAAQ,CAAC,IAAY,EAAE,KAAgC,EAAE,SAA0B;QAEtF,IAAI,SAAS,CAAC,QAAQ;YAClB,IAAI,CAAC,KAAK;gBACN,OAAO,GAAG,IAAI,eAAe,CAAC;QACtC,IAAI,KAAK;YACL,IAAI,SAAS,CAAC,KAAK;gBACf,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;oBAClC,OAAO,GAAG,IAAI,mBAAmB,SAAS,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC;QACrE,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,CAAC,cAAc,CAAC,IAAY,EAAE,KAAgC,EAAE,SAAgC;QAElG,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAClD,IAAI,KAAK;YACL,OAAO,KAAK,CAAC;QACjB,IAAI,KAAK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EAAE;gBACnB,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,4BAA4B;aACtC;SACJ,CAAC,CAAA;IACN,CAAC;CACJ"}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
import { ValidationProps } from "../props/ValidationProps";
|
|
3
|
+
import { ValidationStringProps } from "../props/ValidationStringProps";
|
|
4
|
+
export interface NSInputEmailProps extends ValidationProps, ValidationStringProps {
|
|
3
5
|
title: string;
|
|
4
6
|
defaultValue?: string;
|
|
7
|
+
placeholder?: string;
|
|
5
8
|
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
9
|
}
|
|
7
10
|
export interface NSInputEmailState {
|
|
8
11
|
value: string;
|
|
9
|
-
error
|
|
12
|
+
error?: string;
|
|
10
13
|
}
|
|
11
14
|
export declare class NSInputEmail extends React.Component<NSInputEmailProps, NSInputEmailState> {
|
|
12
15
|
constructor(props: NSInputEmailProps);
|
|
16
|
+
getError(): string | null;
|
|
13
17
|
getValue(): string;
|
|
14
18
|
setValue(value: string): void;
|
|
15
19
|
private onChanged;
|
|
@@ -4,30 +4,29 @@ import React from "react";
|
|
|
4
4
|
import Styles from "./NSInputEmail.module.css";
|
|
5
5
|
import IconInputEmail from '../assets/images/icon-input-email.svg';
|
|
6
6
|
import Danger from '../assets/images/danger.svg';
|
|
7
|
+
import { Validator } from "../Validator";
|
|
7
8
|
export class NSInputEmail extends React.Component {
|
|
8
9
|
constructor(props) {
|
|
9
10
|
var _a;
|
|
10
11
|
super(props);
|
|
11
|
-
this.state = {
|
|
12
|
-
value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "",
|
|
13
|
-
error: false,
|
|
14
|
-
};
|
|
12
|
+
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "" };
|
|
15
13
|
this.setValue = this.setValue.bind(this);
|
|
16
14
|
this.getValue = this.getValue.bind(this);
|
|
17
15
|
this.onChanged = this.onChanged.bind(this);
|
|
18
16
|
}
|
|
17
|
+
getError() {
|
|
18
|
+
return Validator.getErrorString(this.props.title, this.state.value, this.props) && Validator.getErrorEmail(this.props.title, this.state.value);
|
|
19
|
+
}
|
|
19
20
|
getValue() {
|
|
21
|
+
let error = this.getError();
|
|
22
|
+
if (error) {
|
|
23
|
+
this.setState({ error });
|
|
24
|
+
throw new Error(error);
|
|
25
|
+
}
|
|
20
26
|
return this.state.value;
|
|
21
27
|
}
|
|
22
28
|
setValue(value) {
|
|
23
|
-
|
|
24
|
-
debugger;
|
|
25
|
-
if (!email.test(value)) {
|
|
26
|
-
this.setState({ error: true, value });
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
this.setState({ error: false, value });
|
|
30
|
-
}
|
|
29
|
+
this.setState({ value });
|
|
31
30
|
}
|
|
32
31
|
onChanged(e) {
|
|
33
32
|
this.setValue(e.target.value);
|
|
@@ -35,7 +34,7 @@ export class NSInputEmail extends React.Component {
|
|
|
35
34
|
this.props.onChanged(e);
|
|
36
35
|
}
|
|
37
36
|
render() {
|
|
38
|
-
return (_jsxs(_Fragment, { children: [_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: IconInputEmail, alt: "
|
|
37
|
+
return (_jsxs(_Fragment, { children: [_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: IconInputEmail, alt: "Email Icon", width: 24, height: 24 }), _jsx("input", { value: this.state.value, onChange: this.onChanged, type: "email", className: `${this.state.error ? Styles.ns_input_red : ""} ${Styles.ns_input}`, placeholder: this.props.placeholder })] }), this.state.error && (_jsx(_Fragment, { children: _jsxs("div", { className: "d-flex justify-content-start align-items-center gap-2 ms-2", children: [_jsx("img", { className: "", src: Danger, alt: "Error Icon", width: 13, height: 13 }), _jsx("span", { className: Styles.ns_input_error, children: this.state.error })] }) }))] }));
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
//# sourceMappingURL=NSInputEmail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSInputEmail.js","sourceRoot":"","sources":["../../src/components/NSInputEmail.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,cAAc,MAAM,uCAAuC,CAAC;AACnE,OAAO,MAAM,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"NSInputEmail.js","sourceRoot":"","sources":["../../src/components/NSInputEmail.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,cAAc,MAAM,uCAAuC,CAAC;AACnE,OAAO,MAAM,MAAM,6BAA6B,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAkBzC,MAAM,OAAO,YAAa,SAAQ,KAAK,CAAC,SAA+C;IAEnF,YAAY,KAAwB;;QAEhC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,MAAA,KAAK,CAAC,YAAY,mCAAI,EAAE,EAAE,CAAC;QACjD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IACD,QAAQ;QAEJ,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,C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AAE,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,MAAM,CAAC,QAAQ,EAAE,EAC9E,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,GACrC,IACA,EAGF,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CAChB,4BACI,eAAK,SAAS,EAAC,4DAA4D,aACvE,cACI,SAAS,EAAE,EAAE,EACb,GAAG,EAAE,MAAM,EACX,GAAG,EAAC,YAAY,EAChB,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,GACZ,EACF,eAAM,SAAS,EAAE,MAAM,CAAC,cAAc,YAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAQ,IAC/D,GACP,CAAC,IAEb,CACN,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
3
|
+
import { ValidationProps } from "../props/ValidationProps";
|
|
4
|
+
import { ValidationNumberProps } from "../props/ValidationNumberProps";
|
|
5
|
+
export interface NSInputFloatProps extends BaseComponentProps, ValidationProps, ValidationNumberProps {
|
|
3
6
|
title: string;
|
|
4
7
|
defaultValue?: string;
|
|
5
8
|
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
9
|
}
|
|
7
10
|
export interface NSInputFloatState {
|
|
8
11
|
value: string;
|
|
12
|
+
error?: string;
|
|
9
13
|
}
|
|
10
14
|
export declare class NSInputFloat extends React.Component<NSInputFloatProps, NSInputFloatState> {
|
|
11
15
|
constructor(props: NSInputFloatProps);
|
|
16
|
+
getError(): string | null;
|
|
12
17
|
getValue(): string;
|
|
13
18
|
setValue(value: string): void;
|
|
14
19
|
private onChanged;
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import Styles from "./NSInputFloat.module.css";
|
|
5
5
|
import IconInputFloat from '../assets/images/icon-input-float.svg';
|
|
6
|
+
import { Validator } from "../Validator";
|
|
6
7
|
export class NSInputFloat extends React.Component {
|
|
7
8
|
constructor(props) {
|
|
8
9
|
var _a;
|
|
@@ -14,7 +15,15 @@ export class NSInputFloat extends React.Component {
|
|
|
14
15
|
this.getValue = this.getValue.bind(this);
|
|
15
16
|
this.onChanged = this.onChanged.bind(this);
|
|
16
17
|
}
|
|
18
|
+
getError() {
|
|
19
|
+
return Validator.getErrorNumber(this.props.title, this.state.value, this.props);
|
|
20
|
+
}
|
|
17
21
|
getValue() {
|
|
22
|
+
let error = this.getError();
|
|
23
|
+
if (error) {
|
|
24
|
+
this.setState({ error });
|
|
25
|
+
throw new Error(error);
|
|
26
|
+
}
|
|
18
27
|
return this.state.value;
|
|
19
28
|
}
|
|
20
29
|
setValue(value) {
|
|
@@ -26,7 +35,8 @@ export class NSInputFloat extends React.Component {
|
|
|
26
35
|
this.props.onChanged(e);
|
|
27
36
|
}
|
|
28
37
|
render() {
|
|
29
|
-
|
|
38
|
+
var _a;
|
|
39
|
+
return (_jsxs("div", { className: `${Styles.ns_input_parent} p-2 ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsxs("span", { className: Styles.ns_input_title, children: [this.props.required && _jsx("span", { children: "*" }), this.props.title] }), _jsx("img", { className: Styles.ns_input_icon, src: IconInputFloat, alt: "icon", width: 24, height: 24 }), _jsx("input", { value: this.state.value, onChange: this.onChanged, type: "number", className: Styles.ns_input, placeholder: "1.2" })] }));
|
|
30
40
|
}
|
|
31
41
|
}
|
|
32
42
|
//# sourceMappingURL=NSInputFloat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSInputFloat.js","sourceRoot":"","sources":["../../src/components/NSInputFloat.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,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sx-runtime";
|
|
3
3
|
import { Component } from 'react';
|
|
4
4
|
import Styles from './NSSectionBars.module.css';
|
|
5
5
|
import { NSEntityBar } from './NSEntityBar';
|
|
6
6
|
import { NSSection } from './NSSection';
|
|
7
|
+
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
7
8
|
export class NSSectionBars extends Component {
|
|
8
9
|
render() {
|
|
9
10
|
var _a;
|
|
10
|
-
return (_jsx(_Fragment, { children:
|
|
11
|
+
return (_jsx(_Fragment, { children: _jsxs(NSSection, { background: this.props.background, children: [_jsx(NSSpace, { size: NSSpaceSizeType.NORMAL }), _jsx("div", { className: `container mx-auto px-4 lg:px-12 ${Styles.ns_entity_bar_container}`, children: (_a = this.props.bars) === null || _a === void 0 ? void 0 : _a.map((bar) => _jsx(NSEntityBar, Object.assign({}, bar), bar.id)) }), _jsx(NSSpace, { size: NSSpaceSizeType.NORMAL })] }) }));
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=NSSectionBars.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSSectionBars.js","sourceRoot":"","sources":["../../src/components/NSSectionBars.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"NSSectionBars.js","sourceRoot":"","sources":["../../src/components/NSSectionBars.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAQrD,MAAM,OAAO,aAAc,SAAQ,SAA6B;IAEtD,MAAM;;QAEd,OAAO,CACN,4BACC,MAAC,SAAS,IAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,aAC3C,KAAC,OAAO,IAAC,IAAI,EAAE,eAAe,CAAC,MAAM,GAAI,EACzC,cAAK,SAAS,EAAE,mCAAmC,MAAM,CAAC,uBAAuB,EAAE,YAEjF,MAAA,IAAI,CAAC,KAAK,CAAC,IAAI,0CAAE,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAC,WAAW,oBAAkB,GAAG,GAAf,GAAG,CAAC,EAAE,CAAa,CAAC,GAEhE,EACN,KAAC,OAAO,IAAC,IAAI,EAAE,eAAe,CAAC,MAAM,GAAI,IAC9B,GACV,CACH,CAAC;IACH,CAAC;CACD"}
|
|
@@ -6,13 +6,14 @@ import { NSTitle } from './NSTitle';
|
|
|
6
6
|
import { NSCard } from './NSCard';
|
|
7
7
|
import { NSSection } from './NSSection';
|
|
8
8
|
import { NSLinkBlue } from './NSLinkBlue';
|
|
9
|
+
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
9
10
|
export class NSSectionCards extends Component {
|
|
10
11
|
render() {
|
|
11
12
|
var _a, _b, _c, _d, _e, _f;
|
|
12
|
-
return (_jsx(_Fragment, { children:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
return (_jsx(_Fragment, { children: _jsxs(NSSection, { background: this.props.background, children: [_jsx(NSSpace, { size: NSSpaceSizeType.NORMAL }), _jsxs("div", { className: `container mx-auto px-4 lg:px-12 ${Styles.ns_section_cards_holder}`, children: [this.props.title &&
|
|
14
|
+
_jsxs("div", { className: Styles.ns_section_cards_title_container, children: [_jsx(NSTitle, { color: (_a = this.props.title) === null || _a === void 0 ? void 0 : _a.color, title: (_b = this.props.title) === null || _b === void 0 ? void 0 : _b.text }), this.props.description &&
|
|
15
|
+
_jsxs("p", { style: { color: (_c = this.props.description) === null || _c === void 0 ? void 0 : _c.color }, className: Styles.ns_description, children: [" ", this.props.description.text, " "] })] }), _jsx("div", { className: ` ${Styles.ns_card_container}`, children: (_d = this.props.cards) === null || _d === void 0 ? void 0 : _d.map((card) => _jsx(NSCard, Object.assign({}, card), card.id)) }), this.props.button &&
|
|
16
|
+
_jsx("div", { className: `mt-12 w-full- text-center ${Styles.ns_section_cards_link_container}`, children: _jsx(NSLinkBlue, { href: (_e = this.props.button) === null || _e === void 0 ? void 0 : _e.href, title: (_f = this.props.button) === null || _f === void 0 ? void 0 : _f.title }) })] }), _jsx(NSSpace, { size: NSSpaceSizeType.NORMAL })] }) }));
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
//# sourceMappingURL=NSSectionCards.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSSectionCards.js","sourceRoot":"","sources":["../../src/components/NSSectionCards.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,MAAM,MAAM,6BAA6B,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"NSSectionCards.js","sourceRoot":"","sources":["../../src/components/NSSectionCards.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,MAAM,MAAM,6BAA6B,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,C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AAC,IAAI,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,MAAM,0CAAE,IAAI,EAAE,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,MAAM,0CAAE,KAAK,GAAI,GACzE,IAEF,EACN,KAAC,OAAO,IAAC,IAAI,EAAE,eAAe,CAAC,MAAM,GAAI,IAC9B,GACV,CACH,CAAC;IACH,CAAC;CACD"}
|
|
@@ -3,9 +3,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Component } from 'react';
|
|
4
4
|
import { NSSection } from './NSSection';
|
|
5
5
|
import { NSTitle } from './NSTitle';
|
|
6
|
+
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
6
7
|
export class NSSectionTitle extends Component {
|
|
7
8
|
render() {
|
|
8
|
-
return (_jsxs(NSSection, { background: this.props.background, children: [_jsx(NSTitle, { color: this.props.title.color, title: this.props.title.text }), this.props.children] }));
|
|
9
|
+
return (_jsxs(NSSection, { background: this.props.background, children: [_jsx(NSSpace, { size: NSSpaceSizeType.NORMAL }), _jsx(NSTitle, { color: this.props.title.color, title: this.props.title.text }), this.props.children] }));
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
//# sourceMappingURL=NSSectionTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSSectionTitle.js","sourceRoot":"","sources":["../../src/components/NSSectionTitle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"NSSectionTitle.js","sourceRoot":"","sources":["../../src/components/NSSectionTitle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAYrD,MAAM,OAAO,cAAe,SAAQ,SAA8B;IAExD,MAAM;QAEd,OAAO,CACN,MAAC,SAAS,IAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,aAC3C,KAAC,OAAO,IAAC,IAAI,EAAE,eAAe,CAAC,MAAM,GAAI,EACzC,KAAC,OAAO,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,GAAI,EACvE,IAAI,CAAC,KAAK,CAAC,QAAQ,IACT,CACZ,CAAC;IACH,CAAC;CACD"}
|
|
@@ -15,11 +15,7 @@ export declare enum NSSpaceSizeType {
|
|
|
15
15
|
XXXLARGE = "128px"
|
|
16
16
|
}
|
|
17
17
|
export interface NSSpaceState {
|
|
18
|
-
size: NSSpaceSizeType;
|
|
19
18
|
}
|
|
20
19
|
export declare class NSSpace extends React.Component<NSSpaceProps, NSSpaceState> {
|
|
21
|
-
constructor(props: NSSpaceProps);
|
|
22
|
-
setValue(size: NSSpaceSizeType): void;
|
|
23
|
-
getValue(): NSSpaceSizeType;
|
|
24
20
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
25
21
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import React from "react";
|
|
4
3
|
export var NSSpaceSizeType;
|
|
@@ -15,20 +14,8 @@ export var NSSpaceSizeType;
|
|
|
15
14
|
NSSpaceSizeType["XXXLARGE"] = "128px";
|
|
16
15
|
})(NSSpaceSizeType || (NSSpaceSizeType = {}));
|
|
17
16
|
export class NSSpace extends React.Component {
|
|
18
|
-
constructor(props) {
|
|
19
|
-
super(props);
|
|
20
|
-
this.state = { size: props.size };
|
|
21
|
-
this.setValue = this.setValue.bind(this);
|
|
22
|
-
this.getValue = this.getValue.bind(this);
|
|
23
|
-
}
|
|
24
|
-
setValue(size) {
|
|
25
|
-
this.setState({ size });
|
|
26
|
-
}
|
|
27
|
-
getValue() {
|
|
28
|
-
return this.state.size;
|
|
29
|
-
}
|
|
30
17
|
render() {
|
|
31
|
-
return (_jsx("hr", { style: { width: "100%", height: this.
|
|
18
|
+
return (_jsx("hr", { style: { width: "100%", height: this.props.size, margin: "0px", padding: "0px", background: "transparent", color: "transparent", border: 0 } }));
|
|
32
19
|
}
|
|
33
20
|
}
|
|
34
21
|
//# sourceMappingURL=NSSpace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSSpace.js","sourceRoot":"","sources":["../../src/components/NSSpace.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"NSSpace.js","sourceRoot":"","sources":["../../src/components/NSSpace.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,CAAN,IAAY,eAYX;AAZD,WAAY,eAAe;IAEvB,+BAAY,CAAA;IACZ,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,iCAAc,CAAA;IACd,kCAAe,CAAA;IACf,kCAAe,CAAA;IACf,iCAAc,CAAA;IACd,kCAAe,CAAA;IACf,mCAAgB,CAAA;IAChB,qCAAkB,CAAA;AACtB,CAAC,EAZW,eAAe,KAAf,eAAe,QAY1B;AAMD,MAAM,OAAO,OAAQ,SAAQ,KAAK,CAAC,SAAqC;IAE3D,MAAM;QAEX,OAAO,CACH,aAAI,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,EAAE,GAAI,CACvJ,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseComponentProps.js","sourceRoot":"","sources":["../../src/props/BaseComponentProps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValidationNumberProps.js","sourceRoot":"","sources":["../../src/props/ValidationNumberProps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValidationProps.js","sourceRoot":"","sources":["../../src/props/ValidationProps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValidationRegexProps.js","sourceRoot":"","sources":["../../src/props/ValidationRegexProps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValidationStringProps.js","sourceRoot":"","sources":["../../src/props/ValidationStringProps.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"framework": "npm",
|
|
9
9
|
"application": "package",
|
|
10
10
|
"private": false,
|
|
11
|
-
"version": "1.3.
|
|
11
|
+
"version": "1.3.48",
|
|
12
12
|
"author": "Amir Abolhasani, Alireza Esmaeeli, Hooman Shashaeh",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "./dist/main.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@types/node": "^20.12.7",
|
|
25
|
-
"@types/react": "^18.2.
|
|
25
|
+
"@types/react": "^18.2.79",
|
|
26
26
|
"@types/react-dom": "^18.2.25",
|
|
27
27
|
"antd": "^5.16.2",
|
|
28
28
|
"bootstrap": "^5.3.3",
|
package/src/App.tsx
CHANGED
|
@@ -1,48 +1,57 @@
|
|
|
1
1
|
import './App.css';
|
|
2
2
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
3
|
-
import {
|
|
3
|
+
import { NSFooter, NSHeader, NSTable } from './main';
|
|
4
4
|
|
|
5
5
|
export function App()
|
|
6
6
|
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
7
|
+
let columns = {
|
|
8
|
+
"id": "ID",
|
|
9
|
+
"project": "Project",
|
|
10
|
+
"level": "Level",
|
|
11
|
+
"message": "Message",
|
|
12
|
+
"cent": "Cent",
|
|
13
|
+
"status": "Status",
|
|
14
|
+
}
|
|
15
|
+
let rows = [{
|
|
16
|
+
id: 1,
|
|
17
|
+
project: "Namirasoft Account",
|
|
18
|
+
level: "Debug",
|
|
19
|
+
message: "Lorem ipsum dolor sit amet, consetetur ",
|
|
20
|
+
cent: "24",
|
|
21
|
+
status: "Done"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 2,
|
|
25
|
+
project: "Namirasoft Account",
|
|
26
|
+
level: "Debug",
|
|
27
|
+
message: "Lorem ipsum dolor sit amet, consetetur ",
|
|
28
|
+
cent: "24",
|
|
29
|
+
status: "Done"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
interface Row
|
|
33
|
+
{
|
|
34
|
+
id: number,
|
|
35
|
+
project: string,
|
|
36
|
+
level: string,
|
|
37
|
+
message: string,
|
|
38
|
+
cent: string,
|
|
39
|
+
status: string
|
|
40
|
+
}
|
|
41
|
+
return (
|
|
42
|
+
<>
|
|
43
|
+
<NSHeader
|
|
44
|
+
name='Header'
|
|
45
|
+
scope='Namira Software Corporation'
|
|
46
|
+
logo='https://static.namirasoft.com/logo/namirasoft/base.png'
|
|
47
|
+
account={false}
|
|
48
|
+
background={{ color: "transparent !important" }}
|
|
49
|
+
/>
|
|
50
|
+
|
|
51
|
+
<div className="container">
|
|
52
|
+
<NSTable<Row> columns={columns} rows={rows} getRowKey={row => row.id.toString()} />
|
|
53
|
+
</div>
|
|
54
|
+
<NSFooter name='Footer' scope='Namira Software Corporation' logo='https://static.namirasoft.com/logo/namirasoft/base.png' />
|
|
55
|
+
</>
|
|
56
|
+
);
|
|
48
57
|
}
|
package/src/Validator.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ValidationNumberProps } from "./props/ValidationNumberProps";
|
|
2
|
+
import { ValidationProps } from "./props/ValidationProps";
|
|
3
|
+
import { ValidationStringProps } from "./props/ValidationStringProps";
|
|
4
|
+
|
|
5
|
+
export class Validator
|
|
6
|
+
{
|
|
7
|
+
static getError(name: string, value: string | null | undefined, validator: ValidationProps): string | null
|
|
8
|
+
{
|
|
9
|
+
if (validator.required)
|
|
10
|
+
if (!value)
|
|
11
|
+
return `${name} is required.`;
|
|
12
|
+
if (value)
|
|
13
|
+
if (validator.regex)
|
|
14
|
+
if (!validator.regex.regex.test(value))
|
|
15
|
+
return `${name} is not a valid ${validator.regex.name}.`;
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
static getErrorString(name: string, value: string | null | undefined, validator: ValidationStringProps): string | null
|
|
19
|
+
{
|
|
20
|
+
let error = this.getError(name, value, validator);
|
|
21
|
+
if (error)
|
|
22
|
+
return error;
|
|
23
|
+
if (value)
|
|
24
|
+
{
|
|
25
|
+
if (validator.max_length != null)
|
|
26
|
+
if (validator.max_length < value.length)
|
|
27
|
+
return `Max length of ${name} should be ${validator.max_length} characters.`;
|
|
28
|
+
if (validator.min_length != null)
|
|
29
|
+
if (validator.min_length > value.length)
|
|
30
|
+
return `Minlength of ${name} should be ${validator.min_length} characters.`;
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
static getErrorNumber(name: string, value: string | null | undefined, validator: ValidationNumberProps): string | null
|
|
35
|
+
{
|
|
36
|
+
let error = this.getError(name, value, validator);
|
|
37
|
+
if (error)
|
|
38
|
+
return error;
|
|
39
|
+
if (value)
|
|
40
|
+
{
|
|
41
|
+
let numValue = parseFloat(value);
|
|
42
|
+
if (isNaN(numValue))
|
|
43
|
+
return `${name} is not a number.`;
|
|
44
|
+
if (validator.max != null)
|
|
45
|
+
if (validator.max < numValue)
|
|
46
|
+
return `Max value of ${name} should be ${validator.max} characters.`;
|
|
47
|
+
if (validator.min != null)
|
|
48
|
+
if (validator.min > numValue)
|
|
49
|
+
return `Min value of ${name} should be ${validator.min} characters.`;
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
static getErrorEmail(name: string, value: string | null | undefined): string | null
|
|
54
|
+
{
|
|
55
|
+
return Validator.getError(name, value, {
|
|
56
|
+
required: true, regex: {
|
|
57
|
+
name: "Email",
|
|
58
|
+
regex: /^[\w]+@([\w]+\.)+\w{2,}$/gm
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -4,49 +4,52 @@ import React from "react";
|
|
|
4
4
|
import Styles from "./NSInputEmail.module.css";
|
|
5
5
|
import IconInputEmail from '../assets/images/icon-input-email.svg';
|
|
6
6
|
import Danger from '../assets/images/danger.svg';
|
|
7
|
+
import { Validator } from "../Validator";
|
|
8
|
+
import { ValidationProps } from "../props/ValidationProps";
|
|
9
|
+
import { ValidationStringProps } from "../props/ValidationStringProps";
|
|
7
10
|
|
|
8
|
-
export interface NSInputEmailProps
|
|
11
|
+
export interface NSInputEmailProps extends ValidationProps, ValidationStringProps
|
|
9
12
|
{
|
|
10
13
|
title: string;
|
|
11
|
-
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
placeholder?: string;
|
|
12
16
|
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
export interface NSInputEmailState
|
|
16
20
|
{
|
|
17
21
|
value: string;
|
|
18
|
-
error
|
|
22
|
+
error?: string;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
|
-
export class NSInputEmail extends React.Component<NSInputEmailProps, NSInputEmailState>
|
|
25
|
+
export class NSInputEmail extends React.Component<NSInputEmailProps, NSInputEmailState>
|
|
26
|
+
{
|
|
22
27
|
constructor(props: NSInputEmailProps)
|
|
23
28
|
{
|
|
24
29
|
super(props);
|
|
25
|
-
this.state = {
|
|
26
|
-
value: props.defaultValue ?? "",
|
|
27
|
-
error: false,
|
|
28
|
-
};
|
|
30
|
+
this.state = { value: props.defaultValue ?? "" };
|
|
29
31
|
this.setValue = this.setValue.bind(this);
|
|
30
32
|
this.getValue = this.getValue.bind(this);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
this.onChanged = this.onChanged.bind(this);
|
|
34
|
+
}
|
|
35
|
+
getError(): string | null
|
|
36
|
+
{
|
|
37
|
+
return Validator.getErrorString(this.props.title, this.state.value, this.props) && Validator.getErrorEmail(this.props.title, this.state.value);
|
|
38
|
+
}
|
|
33
39
|
getValue(): string
|
|
34
40
|
{
|
|
41
|
+
let error = this.getError();
|
|
42
|
+
if (error)
|
|
43
|
+
{
|
|
44
|
+
this.setState({ error });
|
|
45
|
+
throw new Error(error);
|
|
46
|
+
}
|
|
35
47
|
return this.state.value;
|
|
36
|
-
|
|
48
|
+
}
|
|
37
49
|
setValue(value: string): void
|
|
38
50
|
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (!email.test(value))
|
|
42
|
-
{
|
|
43
|
-
this.setState({ error: true, value });
|
|
44
|
-
}
|
|
45
|
-
else
|
|
46
|
-
{
|
|
47
|
-
this.setState({ error: false, value });
|
|
48
|
-
}
|
|
49
|
-
}
|
|
51
|
+
this.setState({ value });
|
|
52
|
+
}
|
|
50
53
|
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
51
54
|
{
|
|
52
55
|
this.setValue(e.target.value);
|
|
@@ -62,7 +65,7 @@ export class NSInputEmail extends React.Component<NSInputEmailProps, NSInputEmai
|
|
|
62
65
|
<img
|
|
63
66
|
className={Styles.ns_input_icon}
|
|
64
67
|
src={IconInputEmail}
|
|
65
|
-
alt="
|
|
68
|
+
alt="Email Icon"
|
|
66
69
|
width={24}
|
|
67
70
|
height={24}
|
|
68
71
|
/>
|
|
@@ -70,24 +73,25 @@ export class NSInputEmail extends React.Component<NSInputEmailProps, NSInputEmai
|
|
|
70
73
|
value={this.state.value}
|
|
71
74
|
onChange={this.onChanged}
|
|
72
75
|
type="email"
|
|
73
|
-
className={`${this.state.error
|
|
74
|
-
placeholder=
|
|
76
|
+
className={`${this.state.error ? Styles.ns_input_red : ""} ${Styles.ns_input}`}
|
|
77
|
+
placeholder={this.props.placeholder}
|
|
75
78
|
/>
|
|
76
79
|
</div>
|
|
77
80
|
{
|
|
78
|
-
|
|
81
|
+
// todo make it a component
|
|
82
|
+
this.state.error && (
|
|
79
83
|
<>
|
|
80
|
-
<div className="d-flex justify-content-start align-items-center gap-2 ms-2
|
|
84
|
+
<div className="d-flex justify-content-start align-items-center gap-2 ms-2">
|
|
81
85
|
<img
|
|
82
86
|
className={""}
|
|
83
87
|
src={Danger}
|
|
84
|
-
alt="
|
|
88
|
+
alt="Error Icon"
|
|
85
89
|
width={13}
|
|
86
90
|
height={13}
|
|
87
91
|
/>
|
|
88
|
-
<span className={Styles.ns_input_error}>
|
|
92
|
+
<span className={Styles.ns_input_error}>{this.state.error}</span>
|
|
89
93
|
</div>
|
|
90
|
-
</>)
|
|
94
|
+
</>)
|
|
91
95
|
}
|
|
92
96
|
</>
|
|
93
97
|
);
|
|
@@ -3,20 +3,26 @@
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import Styles from "./NSInputFloat.module.css";
|
|
5
5
|
import IconInputFloat from '../assets/images/icon-input-float.svg';
|
|
6
|
+
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
7
|
+
import { ValidationProps } from "../props/ValidationProps";
|
|
8
|
+
import { ValidationNumberProps } from "../props/ValidationNumberProps";
|
|
9
|
+
import { Validator } from "../Validator";
|
|
6
10
|
|
|
7
|
-
export interface NSInputFloatProps
|
|
11
|
+
export interface NSInputFloatProps extends BaseComponentProps, ValidationProps, ValidationNumberProps
|
|
8
12
|
{
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
title: string;
|
|
14
|
+
defaultValue?: string;
|
|
11
15
|
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
export interface NSInputFloatState
|
|
15
19
|
{
|
|
16
20
|
value: string;
|
|
21
|
+
error?: string;
|
|
17
22
|
}
|
|
18
23
|
|
|
19
|
-
export class NSInputFloat extends React.Component<NSInputFloatProps, NSInputFloatState>
|
|
24
|
+
export class NSInputFloat extends React.Component<NSInputFloatProps, NSInputFloatState>
|
|
25
|
+
{
|
|
20
26
|
constructor(props: NSInputFloatProps)
|
|
21
27
|
{
|
|
22
28
|
super(props);
|
|
@@ -27,15 +33,24 @@ export class NSInputFloat extends React.Component<NSInputFloatProps, NSInputFloa
|
|
|
27
33
|
this.getValue = this.getValue.bind(this);
|
|
28
34
|
this.onChanged = this.onChanged.bind(this);
|
|
29
35
|
}
|
|
36
|
+
getError(): string | null
|
|
37
|
+
{
|
|
38
|
+
return Validator.getErrorNumber(this.props.title, this.state.value, this.props);
|
|
39
|
+
}
|
|
30
40
|
getValue(): string
|
|
31
41
|
{
|
|
42
|
+
let error = this.getError();
|
|
43
|
+
if (error)
|
|
44
|
+
{
|
|
45
|
+
this.setState({ error });
|
|
46
|
+
throw new Error(error);
|
|
47
|
+
}
|
|
32
48
|
return this.state.value;
|
|
33
|
-
|
|
49
|
+
}
|
|
34
50
|
setValue(value: string): void
|
|
35
51
|
{
|
|
36
52
|
this.setState({ value });
|
|
37
|
-
|
|
38
|
-
|
|
53
|
+
}
|
|
39
54
|
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
40
55
|
{
|
|
41
56
|
this.setValue(e.target.value);
|
|
@@ -45,8 +60,13 @@ export class NSInputFloat extends React.Component<NSInputFloatProps, NSInputFloa
|
|
|
45
60
|
override render()
|
|
46
61
|
{
|
|
47
62
|
return (
|
|
48
|
-
<div className={`${Styles.ns_input_parent} p-2`}>
|
|
49
|
-
<span className={Styles.ns_input_title}>
|
|
63
|
+
<div className={`${Styles.ns_input_parent} p-2 ${this.props.classList?.join(" ")}`} style={this.props.style}>
|
|
64
|
+
<span className={Styles.ns_input_title}>
|
|
65
|
+
{
|
|
66
|
+
this.props.required && <span>*</span>
|
|
67
|
+
}
|
|
68
|
+
{this.props.title}
|
|
69
|
+
</span>
|
|
50
70
|
<img
|
|
51
71
|
className={Styles.ns_input_icon}
|
|
52
72
|
src={IconInputFloat}
|
|
@@ -5,6 +5,7 @@ import Styles from './NSSectionBars.module.css';
|
|
|
5
5
|
import { NSEntityBar, NSEntityBarProps } from './NSEntityBar';
|
|
6
6
|
import { NSSection } from './NSSection';
|
|
7
7
|
import { BackgroundProps } from '../props/BackgroundProps';
|
|
8
|
+
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
8
9
|
|
|
9
10
|
export interface NSSectionBarsProps
|
|
10
11
|
{
|
|
@@ -19,11 +20,13 @@ export class NSSectionBars extends Component<NSSectionBarsProps>
|
|
|
19
20
|
return (
|
|
20
21
|
<>
|
|
21
22
|
<NSSection background={this.props.background} >
|
|
23
|
+
<NSSpace size={NSSpaceSizeType.NORMAL} />
|
|
22
24
|
<div className={`container mx-auto px-4 lg:px-12 ${Styles.ns_entity_bar_container}`}>
|
|
23
25
|
{
|
|
24
26
|
this.props.bars?.map((bar) => <NSEntityBar key={bar.id} {...bar} />)
|
|
25
27
|
}
|
|
26
28
|
</div>
|
|
29
|
+
<NSSpace size={NSSpaceSizeType.NORMAL} />
|
|
27
30
|
</NSSection>
|
|
28
31
|
</>
|
|
29
32
|
);
|
|
@@ -7,6 +7,7 @@ import { NSCard, NSCardProps } from './NSCard';
|
|
|
7
7
|
import { NSSection } from './NSSection';
|
|
8
8
|
import { NSLinkBlue } from './NSLinkBlue';
|
|
9
9
|
import { BackgroundProps } from '../props/BackgroundProps';
|
|
10
|
+
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
10
11
|
|
|
11
12
|
export interface NSSectionCardsProps
|
|
12
13
|
{
|
|
@@ -33,11 +34,12 @@ export class NSSectionCards extends Component<NSSectionCardsProps>
|
|
|
33
34
|
return (
|
|
34
35
|
<>
|
|
35
36
|
<NSSection background={this.props.background} >
|
|
37
|
+
<NSSpace size={NSSpaceSizeType.NORMAL} />
|
|
36
38
|
<div className={`container mx-auto px-4 lg:px-12 ${Styles.ns_section_cards_holder}`}>
|
|
37
39
|
{
|
|
38
40
|
this.props.title &&
|
|
39
41
|
<div className={Styles.ns_section_cards_title_container}>
|
|
40
|
-
|
|
42
|
+
<NSTitle color={this.props.title?.color} title={this.props.title?.text} />
|
|
41
43
|
{
|
|
42
44
|
this.props.description &&
|
|
43
45
|
<p style={{ color: this.props.description?.color }} className={Styles.ns_description}> {this.props.description.text} </p>
|
|
@@ -56,6 +58,7 @@ export class NSSectionCards extends Component<NSSectionCardsProps>
|
|
|
56
58
|
</div>
|
|
57
59
|
}
|
|
58
60
|
</div>
|
|
61
|
+
<NSSpace size={NSSpaceSizeType.NORMAL} />
|
|
59
62
|
</NSSection>
|
|
60
63
|
</>
|
|
61
64
|
);
|
|
@@ -4,6 +4,7 @@ import { Component, ReactNode } from 'react';
|
|
|
4
4
|
import { NSSection } from './NSSection';
|
|
5
5
|
import { NSTitle } from './NSTitle';
|
|
6
6
|
import { BackgroundProps } from '../props/BackgroundProps';
|
|
7
|
+
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
7
8
|
|
|
8
9
|
export interface NSSectionTitleProps
|
|
9
10
|
{
|
|
@@ -21,6 +22,7 @@ export class NSSectionTitle extends Component<NSSectionTitleProps>
|
|
|
21
22
|
{
|
|
22
23
|
return (
|
|
23
24
|
<NSSection background={this.props.background} >
|
|
25
|
+
<NSSpace size={NSSpaceSizeType.NORMAL} />
|
|
24
26
|
<NSTitle color={this.props.title.color} title={this.props.title.text} />
|
|
25
27
|
{this.props.children}
|
|
26
28
|
</NSSection>
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
1
|
import React from "react";
|
|
4
2
|
|
|
5
3
|
export interface NSSpaceProps
|
|
@@ -23,30 +21,14 @@ export enum NSSpaceSizeType
|
|
|
23
21
|
|
|
24
22
|
export interface NSSpaceState
|
|
25
23
|
{
|
|
26
|
-
size: NSSpaceSizeType;
|
|
27
24
|
}
|
|
28
25
|
|
|
29
26
|
export class NSSpace extends React.Component<NSSpaceProps, NSSpaceState>
|
|
30
27
|
{
|
|
31
|
-
constructor(props: NSSpaceProps)
|
|
32
|
-
{
|
|
33
|
-
super(props);
|
|
34
|
-
this.state = { size: props.size };
|
|
35
|
-
this.setValue = this.setValue.bind(this);
|
|
36
|
-
this.getValue = this.getValue.bind(this);
|
|
37
|
-
}
|
|
38
|
-
setValue(size: NSSpaceSizeType): void
|
|
39
|
-
{
|
|
40
|
-
this.setState({ size });
|
|
41
|
-
}
|
|
42
|
-
getValue(): NSSpaceSizeType
|
|
43
|
-
{
|
|
44
|
-
return this.state.size;
|
|
45
|
-
}
|
|
46
28
|
override render()
|
|
47
29
|
{
|
|
48
30
|
return (
|
|
49
|
-
<hr style={{ width: "100%", height: this.
|
|
31
|
+
<hr style={{ width: "100%", height: this.props.size, margin: "0px", padding: "0px", background: "transparent", color: "transparent", border: 0 }} />
|
|
50
32
|
);
|
|
51
33
|
}
|
|
52
34
|
}
|