namirasoft-site-react 1.3.61 → 1.3.62
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 +2 -2
- package/dist/App.js.map +1 -1
- package/dist/Validator.d.ts +7 -2
- package/dist/Validator.js +57 -15
- package/dist/Validator.js.map +1 -1
- package/dist/components/NSButtonBlue.js +5 -4
- package/dist/components/NSButtonBlue.js.map +1 -1
- package/dist/components/NSButtonGreen.js +5 -4
- package/dist/components/NSButtonGreen.js.map +1 -1
- package/dist/components/NSButtonRed.js +5 -4
- package/dist/components/NSButtonRed.js.map +1 -1
- package/dist/components/NSInput.module.css +29 -0
- package/dist/components/NSInputDate.d.ts +3 -1
- package/dist/components/NSInputDate.js +14 -4
- package/dist/components/NSInputDate.js.map +1 -1
- package/dist/components/NSInputDate.module.css +4 -1
- package/dist/components/NSInputDuration.d.ts +6 -1
- package/dist/components/NSInputDuration.js +15 -6
- package/dist/components/NSInputDuration.js.map +1 -1
- package/dist/components/NSInputEmail.d.ts +1 -1
- package/dist/components/NSInputEmail.js +5 -3
- package/dist/components/NSInputEmail.js.map +1 -1
- package/dist/components/NSInputFloat.d.ts +4 -4
- package/dist/components/NSInputFloat.js +8 -9
- package/dist/components/NSInputFloat.js.map +1 -1
- package/dist/components/NSInputIP.d.ts +5 -1
- package/dist/components/NSInputIP.js +17 -7
- package/dist/components/NSInputIP.js.map +1 -1
- package/dist/components/NSInputInteger.d.ts +9 -5
- package/dist/components/NSInputInteger.js +16 -8
- package/dist/components/NSInputInteger.js.map +1 -1
- package/dist/components/NSInputPassword.d.ts +5 -1
- package/dist/components/NSInputPassword.js +15 -6
- package/dist/components/NSInputPassword.js.map +1 -1
- package/dist/components/NSInputPhone.d.ts +8 -3
- package/dist/components/NSInputPhone.js +18 -12
- package/dist/components/NSInputPhone.js.map +1 -1
- package/dist/components/NSInputPrice.d.ts +7 -2
- package/dist/components/NSInputPrice.js +15 -7
- package/dist/components/NSInputPrice.js.map +1 -1
- package/dist/components/NSInputSearch.d.ts +6 -1
- package/dist/components/NSInputSearch.js +15 -6
- package/dist/components/NSInputSearch.js.map +1 -1
- package/dist/components/NSInputString.d.ts +5 -1
- package/dist/components/NSInputString.js +15 -6
- package/dist/components/NSInputString.js.map +1 -1
- package/dist/components/NSInputText.d.ts +5 -1
- package/dist/components/NSInputText.js +15 -6
- package/dist/components/NSInputText.js.map +1 -1
- package/dist/components/NSInputTime.d.ts +5 -1
- package/dist/components/NSInputTime.js +16 -6
- package/dist/components/NSInputTime.js.map +1 -1
- package/dist/components/NSSectionBars.d.ts +1 -0
- package/dist/components/NSSectionBars.js.map +1 -1
- package/dist/components/NSSectionCards.d.ts +1 -2
- package/dist/components/NSSectionCards.js +1 -1
- package/dist/components/NSSectionCards.js.map +1 -1
- package/dist/components/NSSectionTitle.d.ts +1 -2
- package/dist/components/NSSectionTitle.js +1 -1
- package/dist/components/NSSectionTitle.js.map +1 -1
- package/dist/components/NSSelectBox.d.ts +6 -3
- package/dist/components/NSSelectBox.js +21 -6
- package/dist/components/NSSelectBox.js.map +1 -1
- package/dist/components/NSTable.js +1 -1
- package/dist/components/NSTable.js.map +1 -1
- package/dist/props/ValidationNumberProps.d.ts +1 -2
- package/dist/props/ValidationProps.d.ts +1 -0
- package/dist/props/ValidationStringProps.d.ts +1 -2
- package/package.json +3 -3
- package/src/App.tsx +13 -3
- package/src/Validator.ts +67 -18
- package/src/components/NSButtonBlue.tsx +6 -4
- package/src/components/NSButtonGreen.tsx +5 -4
- package/src/components/NSButtonRed.tsx +5 -4
- package/src/components/NSInput.module.css +29 -0
- package/src/components/NSInputDate.module.css +4 -1
- package/src/components/NSInputDate.tsx +29 -12
- package/src/components/NSInputDuration.tsx +44 -23
- package/src/components/NSInputEmail.tsx +10 -5
- package/src/components/NSInputFloat.tsx +33 -32
- package/src/components/NSInputIP.tsx +44 -24
- package/src/components/NSInputInteger.tsx +48 -31
- package/src/components/NSInputPassword.tsx +42 -23
- package/src/components/NSInputPhone.tsx +45 -29
- package/src/components/NSInputPrice.tsx +45 -23
- package/src/components/NSInputSearch.tsx +43 -21
- package/src/components/NSInputString.tsx +42 -23
- package/src/components/NSInputText.tsx +42 -23
- package/src/components/NSInputTime.tsx +44 -23
- package/src/components/NSSectionBars.tsx +1 -0
- package/src/components/NSSectionCards.tsx +3 -3
- package/src/components/NSSectionTitle.tsx +3 -3
- package/src/components/NSSelectBox.tsx +48 -23
- package/src/components/NSTable.tsx +1 -1
- package/src/props/ValidationNumberProps.ts +1 -3
- package/src/props/ValidationProps.ts +1 -0
- package/src/props/ValidationStringProps.ts +1 -3
- package/dist/components/NSInputDuration.module.css +0 -26
- package/dist/components/NSInputEmail.module.css +0 -38
- package/dist/components/NSInputFloat.module.css +0 -26
- package/dist/components/NSInputIP.module.css +0 -26
- package/dist/components/NSInputInteger.module.css +0 -26
- package/dist/components/NSInputPassword.module.css +0 -27
- package/dist/components/NSInputPhone.module.css +0 -33
- package/dist/components/NSInputPrice.module.css +0 -27
- package/dist/components/NSInputSearch.module.css +0 -27
- package/dist/components/NSInputString.module.css +0 -27
- package/dist/components/NSInputText.module.css +0 -28
- package/dist/components/NSInputTime.module.css +0 -27
- package/src/components/NSInputDuration.module.css +0 -26
- package/src/components/NSInputEmail.module.css +0 -38
- package/src/components/NSInputFloat.module.css +0 -26
- package/src/components/NSInputIP.module.css +0 -26
- package/src/components/NSInputInteger.module.css +0 -26
- package/src/components/NSInputPassword.module.css +0 -27
- package/src/components/NSInputPhone.module.css +0 -33
- package/src/components/NSInputPrice.module.css +0 -27
- package/src/components/NSInputSearch.module.css +0 -27
- package/src/components/NSInputString.module.css +0 -27
- package/src/components/NSInputText.module.css +0 -28
- package/src/components/NSInputTime.module.css +0 -27
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import Styles from "./
|
|
4
|
+
import Styles from "./NSInput.module.css";
|
|
5
5
|
import IconInputText from '../assets/images/icon-input-text.svg';
|
|
6
|
+
import { Validator } from "../Validator";
|
|
7
|
+
import { NSInputErrorNotifier } from "./NSInputErrorNotifier";
|
|
6
8
|
export class NSInputText extends React.Component {
|
|
7
9
|
constructor(props) {
|
|
8
10
|
var _a;
|
|
9
11
|
super(props);
|
|
10
|
-
this.state = {
|
|
11
|
-
value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "",
|
|
12
|
-
};
|
|
12
|
+
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "" };
|
|
13
13
|
this.getValue = this.getValue.bind(this);
|
|
14
14
|
this.setValue = this.setValue.bind(this);
|
|
15
15
|
this.onChanged = this.onChanged.bind(this);
|
|
16
16
|
}
|
|
17
|
+
getError() {
|
|
18
|
+
return (Validator.getError(this.props.title, this.state.value, this.props) &&
|
|
19
|
+
Validator.getErrorString(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) {
|
|
@@ -27,7 +36,7 @@ export class NSInputText extends React.Component {
|
|
|
27
36
|
}
|
|
28
37
|
render() {
|
|
29
38
|
var _a;
|
|
30
|
-
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: [
|
|
39
|
+
return (_jsxs(_Fragment, { children: [_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", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx("img", { className: Styles.ns_input_icon, src: IconInputText, alt: "Text Icon", width: 24, height: 24 }), _jsx("input", { id: this.props.id, value: this.state.value, onChange: this.onChanged, type: "text", className: Styles.ns_input, placeholder: this.props.placeholder })] }), _jsx(NSInputErrorNotifier, { error: this.state.error })] }));
|
|
31
40
|
}
|
|
32
41
|
}
|
|
33
42
|
//# sourceMappingURL=NSInputText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSInputText.js","sourceRoot":"","sources":["../../src/components/NSInputText.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"NSInputText.js","sourceRoot":"","sources":["../../src/components/NSInputText.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,aAAa,MAAM,sCAAsC,CAAC;AAIjE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAgB9D,MAAM,OAAO,WAAY,SAAQ,KAAK,CAAC,SAA6C;IAEhF,YAAY,KAAuB;;QAE/B,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,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QAAQ,IAAI,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAW,OAAG,IAAI,CAAC,KAAK,CAAC,KAAK,SAAS,EACrI,cACI,SAAS,EAAE,MAAM,CAAC,aAAa,EAC/B,GAAG,EAAE,aAAa,EAClB,GAAG,EAAC,WAAW,EACf,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,GACZ,EACF,gBACI,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EACjB,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,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,GACrC,IACA,EACN,KAAC,oBAAoB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAI,IAClD,CACN,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
3
|
-
|
|
3
|
+
import { ValidationProps } from "../props/ValidationProps";
|
|
4
|
+
import { ValidationStringProps } from "../props/ValidationStringProps";
|
|
5
|
+
export interface NSInputTimeProps extends BaseComponentProps, ValidationProps, ValidationStringProps {
|
|
4
6
|
title: string;
|
|
5
7
|
defaultValue?: string;
|
|
6
8
|
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -8,9 +10,11 @@ export interface NSInputTimeProps extends BaseComponentProps {
|
|
|
8
10
|
}
|
|
9
11
|
export interface NSInputTimeState {
|
|
10
12
|
value: string;
|
|
13
|
+
error?: string;
|
|
11
14
|
}
|
|
12
15
|
export declare class NSInputTime extends React.Component<NSInputTimeProps, NSInputTimeState> {
|
|
13
16
|
constructor(props: NSInputTimeProps);
|
|
17
|
+
getError(): string | null;
|
|
14
18
|
getValue(): string;
|
|
15
19
|
setValue(value: string): void;
|
|
16
20
|
private onChanged;
|
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import Styles from "./
|
|
4
|
+
import Styles from "./NSInput.module.css";
|
|
5
5
|
import IconInputTime from '../assets/images/icon-input-time.svg';
|
|
6
|
+
import { Validator } from "../Validator";
|
|
7
|
+
import { NSInputErrorNotifier } from "./NSInputErrorNotifier";
|
|
6
8
|
export class NSInputTime extends React.Component {
|
|
7
9
|
constructor(props) {
|
|
8
10
|
var _a;
|
|
9
11
|
super(props);
|
|
10
|
-
this.state = {
|
|
11
|
-
value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "",
|
|
12
|
-
};
|
|
12
|
+
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "" };
|
|
13
13
|
this.getValue = this.getValue.bind(this);
|
|
14
14
|
this.setValue = this.setValue.bind(this);
|
|
15
15
|
this.onChanged = this.onChanged.bind(this);
|
|
16
16
|
}
|
|
17
|
+
getError() {
|
|
18
|
+
return (Validator.getError(this.props.title, this.state.value, this.props) &&
|
|
19
|
+
Validator.getErrorString(this.props.title, this.state.value, this.props) &&
|
|
20
|
+
Validator.getErrorTime(this.props.title, this.state.value));
|
|
21
|
+
}
|
|
17
22
|
getValue() {
|
|
23
|
+
let error = this.getError();
|
|
24
|
+
if (error) {
|
|
25
|
+
this.setState({ error });
|
|
26
|
+
throw new Error(error);
|
|
27
|
+
}
|
|
18
28
|
return this.state.value;
|
|
19
29
|
}
|
|
20
30
|
setValue(value) {
|
|
@@ -27,7 +37,7 @@ export class NSInputTime extends React.Component {
|
|
|
27
37
|
}
|
|
28
38
|
render() {
|
|
29
39
|
var _a;
|
|
30
|
-
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: [
|
|
40
|
+
return (_jsxs(_Fragment, { children: [_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", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx("img", { className: Styles.ns_input_icon, src: IconInputTime, alt: "Time Icon", width: 24, height: 24 }), _jsx("input", { id: this.props.id, value: this.state.value, onChange: this.onChanged, type: "time", className: Styles.ns_input, placeholder: this.props.placeholder, step: "2" })] }), _jsx(NSInputErrorNotifier, { error: this.state.error })] }));
|
|
31
41
|
}
|
|
32
42
|
}
|
|
33
43
|
//# 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,
|
|
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,sBAAsB,CAAC;AAC1C,OAAO,aAAa,MAAM,sCAAsC,CAAC;AAIjE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAgB9D,MAAM,OAAO,WAAY,SAAQ,KAAK,CAAC,SAA6C;IAEhF,YAAY,KAAuB;;QAE/B,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,KAAK,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,KAAK,CAAC,SAAS;YACpB,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC;IACQ,MAAM;;QAEX,OAAO,CACH,8BACI,eAAK,SAAS,EAAE,GAAG,MAAM,CAAC,eAAe,QAAQ,MAAA,IAAI,CAAC,KAAK,CAAC,SAAS,0CAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,aACvG,gBAAM,SAAS,EAAE,MAAM,CAAC,cAAc,kBAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAW,OAAG,IAAI,CAAC,KAAK,CAAC,KAAK,SAAS,EACrI,cACI,SAAS,EAAE,MAAM,CAAC,aAAa,EAC/B,GAAG,EAAE,aAAa,EAClB,GAAG,EAAC,WAAW,EACf,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,GACZ,EACF,gBACI,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EACjB,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,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,IAAI,EAAC,GAAG,GACV,IACA,EACN,KAAC,oBAAoB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAI,IAClD,CACN,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NSEntityBarProps } from './NSEntityBar';
|
|
2
2
|
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
3
3
|
export interface NSSectionBarsProps extends BaseComponentProps {
|
|
4
|
+
title?: string;
|
|
4
5
|
bars: NSEntityBarProps[];
|
|
5
6
|
}
|
|
6
7
|
export declare function NSSectionBars(props: NSSectionBarsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSSectionBars.js","sourceRoot":"","sources":["../../src/components/NSSectionBars.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"NSSectionBars.js","sourceRoot":"","sources":["../../src/components/NSSectionBars.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AASrD,MAAM,UAAU,aAAa,CAAC,KAAyB;;IAEtD,OAAO,CACN,MAAC,SAAS,oBAAK,KAAK,eACnB,KAAC,OAAO,IAAC,IAAI,EAAE,eAAe,CAAC,MAAM,GAAI,EACzC,cAAK,SAAS,EAAE,mCAAmC,MAAM,CAAC,uBAAuB,EAAE,YAEjF,MAAA,KAAK,CAAC,IAAI,0CAAE,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAC,WAAW,oBAAkB,GAAG,GAAf,GAAG,CAAC,EAAE,CAAa,CAAC,GAE3D,EACN,KAAC,OAAO,IAAC,IAAI,EAAE,eAAe,CAAC,MAAM,GAAI,KAC9B,CACZ,CAAC;AACH,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { NSTitleProps } from './NSTitle';
|
|
2
1
|
import { NSCardProps } from './NSCard';
|
|
3
2
|
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
4
3
|
import { LinkProps } from '../props/LinkProps';
|
|
5
4
|
export interface NSSectionCardsProps extends BaseComponentProps {
|
|
6
|
-
title?:
|
|
5
|
+
title?: string;
|
|
7
6
|
description?: {
|
|
8
7
|
text: string;
|
|
9
8
|
color?: string;
|
|
@@ -8,7 +8,7 @@ import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
|
8
8
|
export function NSSectionCards(props) {
|
|
9
9
|
var _a, _b;
|
|
10
10
|
return (_jsxs(NSSection, Object.assign({}, props, { children: [_jsx(NSSpace, { size: NSSpaceSizeType.NORMAL }), _jsxs("div", { className: `container mx-auto px-4 lg:px-12 ${Styles.ns_section_cards_holder}`, children: [props.title &&
|
|
11
|
-
_jsxs("div", { className: Styles.ns_section_cards_title_container, children: [_jsx(NSTitle,
|
|
11
|
+
_jsxs("div", { className: Styles.ns_section_cards_title_container, children: [_jsx(NSTitle, { title: props.title }), props.description &&
|
|
12
12
|
_jsxs("p", { style: { color: (_a = props.description) === null || _a === void 0 ? void 0 : _a.color }, className: Styles.ns_description, children: [" ", props.description.text, " "] })] }), _jsx("div", { className: ` ${Styles.ns_card_container}`, children: (_b = props.cards) === null || _b === void 0 ? void 0 : _b.map((card) => _jsx(NSCard, Object.assign({}, card), card.id)) }), props.button &&
|
|
13
13
|
_jsx("div", { className: `mt-12 w-full- text-center ${Styles.ns_section_cards_link_container}`, children: _jsx(NSLinkBlue, Object.assign({}, props.button)) })] }), _jsx(NSSpace, { size: NSSpaceSizeType.NORMAL })] })));
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSSectionCards.js","sourceRoot":"","sources":["../../src/components/NSSectionCards.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,6BAA6B,CAAC;AACjD,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"NSSectionCards.js","sourceRoot":"","sources":["../../src/components/NSSectionCards.tsx"],"names":[],"mappings":";AAAA,OAAO,M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Z,CAAC;AACH,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { NSTitleProps } from './NSTitle';
|
|
3
2
|
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
4
3
|
export interface NSSectionTitleProps extends BaseComponentProps {
|
|
5
|
-
title:
|
|
4
|
+
title: string;
|
|
6
5
|
children: ReactNode;
|
|
7
6
|
}
|
|
8
7
|
export declare function NSSectionTitle(props: NSSectionTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,6 +3,6 @@ import { NSSection } from './NSSection';
|
|
|
3
3
|
import { NSTitle } from './NSTitle';
|
|
4
4
|
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
5
5
|
export function NSSectionTitle(props) {
|
|
6
|
-
return (_jsxs(NSSection, Object.assign({}, props, { children: [_jsx(NSSpace, { size: NSSpaceSizeType.NORMAL }), _jsx(NSTitle,
|
|
6
|
+
return (_jsxs(NSSection, Object.assign({}, props, { children: [_jsx(NSSpace, { size: NSSpaceSizeType.NORMAL }), _jsx(NSTitle, { title: props.title }), props.children] })));
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=NSSectionTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSSectionTitle.js","sourceRoot":"","sources":["../../src/components/NSSectionTitle.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"NSSectionTitle.js","sourceRoot":"","sources":["../../src/components/NSSectionTitle.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AASrD,MAAM,UAAU,cAAc,CAAC,KAA0B;IAExD,OAAO,CACN,MAAC,SAAS,oBAAK,KAAK,eACnB,KAAC,OAAO,IAAC,IAAI,EAAE,eAAe,CAAC,MAAM,GAAI,EACzC,KAAC,OAAO,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,GAAI,EAC9B,KAAK,CAAC,QAAQ,KACJ,CACZ,CAAC;AACH,CAAC"}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { SelectProps } from 'antd';
|
|
3
3
|
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
4
|
-
|
|
4
|
+
import { ValidationProps } from "../props/ValidationProps";
|
|
5
|
+
export interface NSSelectBoxProps extends BaseComponentProps, ValidationProps {
|
|
5
6
|
title: string;
|
|
6
7
|
options: SelectProps['options'];
|
|
7
8
|
}
|
|
8
9
|
export interface NSSelectBoxState {
|
|
9
10
|
value: string | null;
|
|
10
11
|
values: string[];
|
|
12
|
+
error?: string;
|
|
11
13
|
}
|
|
12
14
|
export declare class NSSelectBox extends React.Component<NSSelectBoxProps, NSSelectBoxState> {
|
|
13
15
|
constructor(props: NSSelectBoxProps);
|
|
14
|
-
|
|
16
|
+
getError(): string | null;
|
|
15
17
|
getValue(): string | null;
|
|
16
|
-
|
|
18
|
+
setValue(value: string | null): void;
|
|
17
19
|
getValues(): string[];
|
|
20
|
+
setValues(values: string[]): void;
|
|
18
21
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
19
22
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import Styles from "./NSSelectBox.module.css";
|
|
5
5
|
import { Select, Space } from 'antd';
|
|
6
6
|
import IconSelectBox from '../assets/images/icon-select-box.svg';
|
|
7
|
+
import { Validator } from "../Validator";
|
|
8
|
+
import { NSInputErrorNotifier } from "./NSInputErrorNotifier";
|
|
7
9
|
export class NSSelectBox extends React.Component {
|
|
8
10
|
constructor(props) {
|
|
9
11
|
super(props);
|
|
@@ -14,20 +16,33 @@ export class NSSelectBox extends React.Component {
|
|
|
14
16
|
this.getValues = this.getValues.bind(this);
|
|
15
17
|
this.setValues = this.setValues.bind(this);
|
|
16
18
|
}
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
+
getError() {
|
|
20
|
+
return (Validator.getError(this.props.title, this.state.value, this.props));
|
|
19
21
|
}
|
|
20
22
|
getValue() {
|
|
23
|
+
let error = this.getError();
|
|
24
|
+
if (error) {
|
|
25
|
+
this.setState({ error });
|
|
26
|
+
throw new Error(error);
|
|
27
|
+
}
|
|
21
28
|
return this.state.value;
|
|
22
29
|
}
|
|
23
|
-
|
|
24
|
-
this.setState({
|
|
30
|
+
setValue(value) {
|
|
31
|
+
this.setState({ value });
|
|
25
32
|
}
|
|
26
33
|
getValues() {
|
|
34
|
+
let error = this.getError();
|
|
35
|
+
if (error) {
|
|
36
|
+
this.setState({ error });
|
|
37
|
+
throw new Error(error);
|
|
38
|
+
}
|
|
27
39
|
return this.state.values;
|
|
28
40
|
}
|
|
41
|
+
setValues(values) {
|
|
42
|
+
this.setState({ values });
|
|
43
|
+
}
|
|
29
44
|
render() {
|
|
30
|
-
return (_jsxs("div", { className: `${Styles.ns_input_parent} p-2`, children: [
|
|
45
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `${Styles.ns_input_parent} p-2`, children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx(Select, { mode: "multiple", style: { width: '100%' }, className: Styles.ns_input_select, placeholder: "Combo Box", onChange: this.setValues, optionLabelProp: "label", options: this.props.options, optionRender: (option) => (_jsx(Space, { className: Styles.ns_input_select_option, children: option.data.desc })), suffixIcon: _jsx("img", { src: IconSelectBox, alt: "SelectBox Icon" }) })] }), _jsx(NSInputErrorNotifier, { error: this.state.error })] }));
|
|
31
46
|
}
|
|
32
47
|
}
|
|
33
48
|
//# sourceMappingURL=NSSelectBox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSSelectBox.js","sourceRoot":"","sources":["../../src/components/NSSelectBox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,aAAa,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"NSSelectBox.js","sourceRoot":"","sources":["../../src/components/NSSelectBox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,aAAa,MAAM,sCAAsC,CAAC;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAe9D,MAAM,OAAO,WAAY,SAAQ,KAAK,CAAC,SAA6C;IAEhF,YAAY,KAAuB;QAE/B,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACT,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,EAAE;SACb,CAAC;QACF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IACD,QAAQ;QAEJ,OAAO,CACH,SAAS,CAAC,QAAQ,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AM,EAAE,EACxB,SAAS,EAAE,MAAM,CAAC,eAAe,EACjC,WAAW,EAAC,WAAW,EACvB,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,eAAe,EAAC,OAAO,EACvB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CACtB,KAAC,KAAK,IAAC,SAAS,EAAE,MAAM,CAAC,sBAAsB,YAC1C,MAAM,CAAC,IAAI,CAAC,IAAI,GACb,CACX,EACD,UAAU,EAAE,cAAK,GAAG,EAAE,aAAa,EAAE,GAAG,EAAC,gBAAgB,GAAG,GAC9D,IACA,EACN,KAAC,oBAAoB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAI,IAClD,CACN,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -30,7 +30,7 @@ export class NSTable extends Component {
|
|
|
30
30
|
return this.props.getCell(row, column, rowIndex, columnIndex);
|
|
31
31
|
return row[column];
|
|
32
32
|
};
|
|
33
|
-
return (_jsxs("div", { id: this.props.id, className: `container ${Styles.ns_project_list_container} ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, 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({}, getColumnAttributes(column, columnIndex), { "data-label": `${this.state.columns[column]} : `, children: getCell(row, column, rowIndex, columnIndex) })))) }, this.props.getRowKey(row, rowIndex))) })] }), _jsx(NSSpace, { size: NSSpaceSizeType.MICRO }), _jsxs("section", { className: Styles.ns_pagination_button, children: [_jsx(NSPagination, { size: 50, page: 5 }), _jsx(NSSpace, { size: NSSpaceSizeType.SMALL }), _jsxs("div", { className: Styles.ns_button, children: [_jsx(NSButton, { title: 'Export', icon: { src: "/assets/images/export-vector.png" }, onClick: () => { }, style: { border: '1px solid rgba(255, 148, 50, 1)' } }), _jsx(NSButton, { title: 'Refresh', icon: { src: "/assets/images/export-vector.png" }, onClick: () => { }, style: { border: '1px solid rgba(3, 119, 255, 1)' } })] })] }), _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.." })] })] }));
|
|
33
|
+
return (_jsxs("div", { id: this.props.id, className: `container ${Styles.ns_project_list_container} ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsx("section", { className: Styles.ns_search_input, children: _jsx(NSInputSearch, { title: '', required: false }) }), _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({}, getColumnAttributes(column, columnIndex), { "data-label": `${this.state.columns[column]} : `, children: getCell(row, column, rowIndex, columnIndex) })))) }, this.props.getRowKey(row, rowIndex))) })] }), _jsx(NSSpace, { size: NSSpaceSizeType.MICRO }), _jsxs("section", { className: Styles.ns_pagination_button, children: [_jsx(NSPagination, { size: 50, page: 5 }), _jsx(NSSpace, { size: NSSpaceSizeType.SMALL }), _jsxs("div", { className: Styles.ns_button, children: [_jsx(NSButton, { title: 'Export', icon: { src: "/assets/images/export-vector.png" }, onClick: () => { }, style: { border: '1px solid rgba(255, 148, 50, 1)' } }), _jsx(NSButton, { title: 'Refresh', icon: { src: "/assets/images/export-vector.png" }, onClick: () => { }, style: { border: '1px solid rgba(3, 119, 255, 1)' } })] })] }), _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.." })] })] }));
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
//# 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,QAAQ,MAAM,YAAY,CAAC;AAClC,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;AAmBlC,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,CAAC;QAClD,IAAI,mBAAmB,GAAG,CAAC,MAAc,EAAE,WAAmB,EAAE,EAAE;YAE9D,IAAI,IAAI,CAAC,KAAK,CAAC,mBAAmB;gBAC9B,OAAO,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AC,IAAI,EAAE,eAAe,CAAC,KAAK,GAAI,EACxC,eAAK,SAAS,EAAE,MAAM,CAAC,SAAS,aAC5B,KAAC,QAAQ,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAE,EAAE,GAAG,EAAE,kCAAkC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,iCAAiC,EAAE,GAAI,EACxJ,KAAC,QAAQ,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,EAAE,EAAE,GAAG,EAAE,kCAAkC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,gCAAgC,EAAE,GAAI,IACtJ,IACA,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"}
|
package/package.json
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"framework": "npm",
|
|
9
9
|
"application": "package",
|
|
10
10
|
"private": false,
|
|
11
|
-
"version": "1.3.
|
|
12
|
-
"author": "Amir Abolhasani, Alireza Esmaeeli, Hooman Shashaeh",
|
|
11
|
+
"version": "1.3.62",
|
|
12
|
+
"author": "Amir Abolhasani, Alireza Esmaeeli, Sepideh Mazloumi, Hooman Shashaeh",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "./dist/main.js",
|
|
15
15
|
"types": "./dist/main.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"copyfiles": "^2.4.1",
|
|
30
30
|
"link-react": "^3.0.0",
|
|
31
31
|
"namirasoft-api-link": "^1.3.1",
|
|
32
|
-
"namirasoft-core": "^1.3.
|
|
32
|
+
"namirasoft-core": "^1.3.19",
|
|
33
33
|
"path-browserify": "^1.0.1",
|
|
34
34
|
"react": "^18.2.0",
|
|
35
35
|
"react-app-rewired": "^2.2.1",
|
package/src/App.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './App.css';
|
|
2
2
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
3
|
-
import { NSFooter, NSHeader, NSTable,
|
|
3
|
+
import { NSFooter, NSHeader, NSTable, NSButtonBlue, NSButtonGreen, NSButtonRed } from './main';
|
|
4
4
|
|
|
5
5
|
export function App()
|
|
6
6
|
{
|
|
@@ -48,8 +48,18 @@ export function App()
|
|
|
48
48
|
style={{ backgroundColor: "transparent !important" }}
|
|
49
49
|
/>
|
|
50
50
|
<div className="container">
|
|
51
|
-
<
|
|
52
|
-
|
|
51
|
+
<NSButtonBlue
|
|
52
|
+
title="Cancel Deletion"
|
|
53
|
+
onClick={()=>{}}
|
|
54
|
+
/>
|
|
55
|
+
<NSButtonGreen
|
|
56
|
+
title="Cancel Deletion"
|
|
57
|
+
onClick={()=>{}}
|
|
58
|
+
/>
|
|
59
|
+
<NSButtonRed
|
|
60
|
+
title="Cancel Deletion"
|
|
61
|
+
onClick={()=>{}}
|
|
62
|
+
/>
|
|
53
63
|
<NSTable<Row> columns={columns} rows={rows} getRowKey={row => row.id.toString()} />
|
|
54
64
|
</div>
|
|
55
65
|
<NSFooter name='Footer' scope='Namira Software Corporation' logo='https://static.namirasoft.com/logo/namirasoft/base.png' />
|
package/src/Validator.ts
CHANGED
|
@@ -1,26 +1,31 @@
|
|
|
1
|
+
import { PhoneOperation, RegexTemplate } from "namirasoft-core";
|
|
1
2
|
import { ValidationNumberProps } from "./props/ValidationNumberProps";
|
|
2
3
|
import { ValidationProps } from "./props/ValidationProps";
|
|
3
4
|
import { ValidationStringProps } from "./props/ValidationStringProps";
|
|
4
5
|
|
|
5
6
|
export class Validator
|
|
6
7
|
{
|
|
7
|
-
static getError(name: string, value: string | null | undefined, validator: ValidationProps): string | null
|
|
8
|
+
static getError(name: string, value: string | number | null | undefined, validator: ValidationProps): string | null
|
|
8
9
|
{
|
|
9
10
|
if (validator.required)
|
|
10
11
|
if (!value)
|
|
11
12
|
return `${name} is required.`;
|
|
12
|
-
if (value)
|
|
13
|
+
if (value != null)
|
|
13
14
|
if (validator.regex)
|
|
14
|
-
if (!validator.regex.regex.test(value))
|
|
15
|
+
if (!validator.regex.regex.test(value + ""))
|
|
15
16
|
return `${name} is not a valid ${validator.regex.name}.`;
|
|
17
|
+
if (value != null)
|
|
18
|
+
if (validator.validator)
|
|
19
|
+
{
|
|
20
|
+
let error = validator.validator(name, value);
|
|
21
|
+
if (error)
|
|
22
|
+
return error;
|
|
23
|
+
}
|
|
16
24
|
return null;
|
|
17
25
|
}
|
|
18
26
|
static getErrorString(name: string, value: string | null | undefined, validator: ValidationStringProps): string | null
|
|
19
27
|
{
|
|
20
|
-
|
|
21
|
-
if (error)
|
|
22
|
-
return error;
|
|
23
|
-
if (value)
|
|
28
|
+
if (value != null)
|
|
24
29
|
{
|
|
25
30
|
if (validator.max_length != null)
|
|
26
31
|
if (validator.max_length < value.length)
|
|
@@ -31,21 +36,17 @@ export class Validator
|
|
|
31
36
|
}
|
|
32
37
|
return null;
|
|
33
38
|
}
|
|
34
|
-
static getErrorNumber(name: string, value:
|
|
39
|
+
static getErrorNumber(name: string, value: number | null | undefined, validator: ValidationNumberProps): string | null
|
|
35
40
|
{
|
|
36
|
-
|
|
37
|
-
if (error)
|
|
38
|
-
return error;
|
|
39
|
-
if (value)
|
|
41
|
+
if (value != null)
|
|
40
42
|
{
|
|
41
|
-
|
|
42
|
-
if (isNaN(numValue))
|
|
43
|
+
if (isNaN(value))
|
|
43
44
|
return `${name} is not a number.`;
|
|
44
45
|
if (validator.max != null)
|
|
45
|
-
if (validator.max <
|
|
46
|
+
if (validator.max < value)
|
|
46
47
|
return `Max value of ${name} should be ${validator.max} characters.`;
|
|
47
48
|
if (validator.min != null)
|
|
48
|
-
if (validator.min >
|
|
49
|
+
if (validator.min > value)
|
|
49
50
|
return `Min value of ${name} should be ${validator.min} characters.`;
|
|
50
51
|
}
|
|
51
52
|
return null;
|
|
@@ -55,8 +56,56 @@ export class Validator
|
|
|
55
56
|
return Validator.getError(name, value, {
|
|
56
57
|
required: true, regex: {
|
|
57
58
|
name: "Email",
|
|
58
|
-
regex:
|
|
59
|
+
regex: RegexTemplate.Email
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
static getErrorDate(name: string, value: string | null | undefined): string | null
|
|
64
|
+
{
|
|
65
|
+
return Validator.getError(name, value, {
|
|
66
|
+
required: true, regex: {
|
|
67
|
+
name: "Date",
|
|
68
|
+
regex: RegexTemplate.Date
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
static getErrorTime(name: string, value: string | null | undefined): string | null
|
|
73
|
+
{
|
|
74
|
+
return Validator.getError(name, value, {
|
|
75
|
+
required: true, regex: {
|
|
76
|
+
name: "Time",
|
|
77
|
+
regex: RegexTemplate.Time
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
static getErrorDuration(name: string, value: string | null | undefined): string | null
|
|
82
|
+
{
|
|
83
|
+
return Validator.getError(name, value, {
|
|
84
|
+
required: true, regex: {
|
|
85
|
+
name: "Duration",
|
|
86
|
+
regex: RegexTemplate.Duration
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
static getErrorIP(name: string, value: string | null | undefined): string | null
|
|
91
|
+
{
|
|
92
|
+
return Validator.getError(name, value, {
|
|
93
|
+
required: true, regex: {
|
|
94
|
+
name: "IP",
|
|
95
|
+
regex: RegexTemplate.IP
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
static getErrorPhone(name: string, value: string | null | undefined): string | null
|
|
100
|
+
{
|
|
101
|
+
return Validator.getError(name, value, {
|
|
102
|
+
required: true, validator: () =>
|
|
103
|
+
{
|
|
104
|
+
if (value)
|
|
105
|
+
if (!PhoneOperation.isValid(value))
|
|
106
|
+
return `${name} is not a valid phone number`;
|
|
107
|
+
return null;
|
|
59
108
|
}
|
|
60
|
-
})
|
|
109
|
+
});
|
|
61
110
|
}
|
|
62
111
|
}
|
|
@@ -4,8 +4,10 @@ import { NSButtonProps } from "./NSButton";
|
|
|
4
4
|
|
|
5
5
|
export function NSButtonBlue(props: NSButtonProps)
|
|
6
6
|
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
let classList = []
|
|
8
|
+
if (props.classList)
|
|
9
|
+
classList.push(...props.classList);
|
|
10
|
+
classList.push(Style.ns_button_blue);
|
|
11
|
+
|
|
12
|
+
return <NSButton title={props.title} icon={props.icon} onClick={props.onClick} id={props.id} classList={classList} style={props.style} />;
|
|
11
13
|
}
|
|
@@ -4,8 +4,9 @@ import { NSButtonProps } from "./NSButton";
|
|
|
4
4
|
|
|
5
5
|
export function NSButtonGreen(props: NSButtonProps)
|
|
6
6
|
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
let classList = []
|
|
8
|
+
if (props.classList)
|
|
9
|
+
classList.push(...props.classList);
|
|
10
|
+
classList.push(Style.ns_button_green);
|
|
11
|
+
return <NSButton title={props.title} icon={props.icon} onClick={props.onClick} id={props.id} classList={classList} style={props.style} />;
|
|
11
12
|
}
|
|
@@ -4,8 +4,9 @@ import { NSButtonProps } from "./NSButton";
|
|
|
4
4
|
|
|
5
5
|
export function NSButtonRed(props: NSButtonProps)
|
|
6
6
|
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
let classList = []
|
|
8
|
+
if (props.classList)
|
|
9
|
+
classList.push(...props.classList);
|
|
10
|
+
classList.push(Style.ns_button_red);
|
|
11
|
+
return <NSButton title={props.title} icon={props.icon} onClick={props.onClick} id={props.id} classList={classList} style={props.style} />;
|
|
11
12
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.ns_input_parent {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 326px;
|
|
5
|
+
color: #fff;
|
|
6
|
+
position: relative;
|
|
7
|
+
max-width: 100%;
|
|
8
|
+
padding: 8px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ns_input {
|
|
12
|
+
border-radius: 8px;
|
|
13
|
+
padding: 10px 12px;
|
|
14
|
+
font-size: 16px;
|
|
15
|
+
font-weight: 400;
|
|
16
|
+
border: 1px solid rgba(47, 0, 236, 0.6);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.ns_input_icon {
|
|
20
|
+
position: absolute;
|
|
21
|
+
right: 20px;
|
|
22
|
+
top: 51%;
|
|
23
|
+
z-index: 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ns_input_title {
|
|
27
|
+
font-size: 16px;
|
|
28
|
+
font-weight: 400;
|
|
29
|
+
}
|