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
package/dist/App.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import './App.css';
|
|
3
3
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
4
|
-
import { NSFooter, NSHeader, NSTable,
|
|
4
|
+
import { NSFooter, NSHeader, NSTable, NSButtonBlue, NSButtonGreen, NSButtonRed } 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 (_jsxs(_Fragment, { children: [_jsx(NSHeader, { name: 'Header', scope: 'Namira Software Corporation', logo: 'https://static.namirasoft.com/logo/namirasoft/base.png', account: false, style: { backgroundColor: "transparent !important" } }), _jsxs("div", { className: "container", children: [_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, style: { backgroundColor: "transparent !important" } }), _jsxs("div", { className: "container", children: [_jsx(NSButtonBlue, { title: "Cancel Deletion", onClick: () => { } }), _jsx(NSButtonGreen, { title: "Cancel Deletion", onClick: () => { } }), _jsx(NSButtonRed, { title: "Cancel Deletion", onClick: () => { } }), _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,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"App.js","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":";AAAA,OAAO,WAAW,CAAC;AAC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AI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAI,IACjF,EACN,KAAC,QAAQ,IAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,6BAA6B,EAAC,IAAI,EAAC,wDAAwD,GAAG,IAC7H,CACN,CAAC;AACN,CAAC"}
|
package/dist/Validator.d.ts
CHANGED
|
@@ -2,8 +2,13 @@ import { ValidationNumberProps } from "./props/ValidationNumberProps";
|
|
|
2
2
|
import { ValidationProps } from "./props/ValidationProps";
|
|
3
3
|
import { ValidationStringProps } from "./props/ValidationStringProps";
|
|
4
4
|
export declare class Validator {
|
|
5
|
-
static getError(name: string, value: string | null | undefined, validator: ValidationProps): string | null;
|
|
5
|
+
static getError(name: string, value: string | number | null | undefined, validator: ValidationProps): string | null;
|
|
6
6
|
static getErrorString(name: string, value: string | null | undefined, validator: ValidationStringProps): string | null;
|
|
7
|
-
static getErrorNumber(name: string, value:
|
|
7
|
+
static getErrorNumber(name: string, value: number | null | undefined, validator: ValidationNumberProps): string | null;
|
|
8
8
|
static getErrorEmail(name: string, value: string | null | undefined): string | null;
|
|
9
|
+
static getErrorDate(name: string, value: string | null | undefined): string | null;
|
|
10
|
+
static getErrorTime(name: string, value: string | null | undefined): string | null;
|
|
11
|
+
static getErrorDuration(name: string, value: string | null | undefined): string | null;
|
|
12
|
+
static getErrorIP(name: string, value: string | null | undefined): string | null;
|
|
13
|
+
static getErrorPhone(name: string, value: string | null | undefined): string | null;
|
|
9
14
|
}
|
package/dist/Validator.js
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
|
+
import { PhoneOperation, RegexTemplate } from "namirasoft-core";
|
|
1
2
|
export class Validator {
|
|
2
3
|
static getError(name, value, validator) {
|
|
3
4
|
if (validator.required)
|
|
4
5
|
if (!value)
|
|
5
6
|
return `${name} is required.`;
|
|
6
|
-
if (value)
|
|
7
|
+
if (value != null)
|
|
7
8
|
if (validator.regex)
|
|
8
|
-
if (!validator.regex.regex.test(value))
|
|
9
|
+
if (!validator.regex.regex.test(value + ""))
|
|
9
10
|
return `${name} is not a valid ${validator.regex.name}.`;
|
|
11
|
+
if (value != null)
|
|
12
|
+
if (validator.validator) {
|
|
13
|
+
let error = validator.validator(name, value);
|
|
14
|
+
if (error)
|
|
15
|
+
return error;
|
|
16
|
+
}
|
|
10
17
|
return null;
|
|
11
18
|
}
|
|
12
19
|
static getErrorString(name, value, validator) {
|
|
13
|
-
|
|
14
|
-
if (error)
|
|
15
|
-
return error;
|
|
16
|
-
if (value) {
|
|
20
|
+
if (value != null) {
|
|
17
21
|
if (validator.max_length != null)
|
|
18
22
|
if (validator.max_length < value.length)
|
|
19
23
|
return `Max length of ${name} should be ${validator.max_length} characters.`;
|
|
@@ -24,18 +28,14 @@ export class Validator {
|
|
|
24
28
|
return null;
|
|
25
29
|
}
|
|
26
30
|
static getErrorNumber(name, value, validator) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return error;
|
|
30
|
-
if (value) {
|
|
31
|
-
let numValue = parseFloat(value);
|
|
32
|
-
if (isNaN(numValue))
|
|
31
|
+
if (value != null) {
|
|
32
|
+
if (isNaN(value))
|
|
33
33
|
return `${name} is not a number.`;
|
|
34
34
|
if (validator.max != null)
|
|
35
|
-
if (validator.max <
|
|
35
|
+
if (validator.max < value)
|
|
36
36
|
return `Max value of ${name} should be ${validator.max} characters.`;
|
|
37
37
|
if (validator.min != null)
|
|
38
|
-
if (validator.min >
|
|
38
|
+
if (validator.min > value)
|
|
39
39
|
return `Min value of ${name} should be ${validator.min} characters.`;
|
|
40
40
|
}
|
|
41
41
|
return null;
|
|
@@ -44,7 +44,49 @@ export class Validator {
|
|
|
44
44
|
return Validator.getError(name, value, {
|
|
45
45
|
required: true, regex: {
|
|
46
46
|
name: "Email",
|
|
47
|
-
regex:
|
|
47
|
+
regex: RegexTemplate.Email
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
static getErrorDate(name, value) {
|
|
52
|
+
return Validator.getError(name, value, {
|
|
53
|
+
required: true, regex: {
|
|
54
|
+
name: "Date",
|
|
55
|
+
regex: RegexTemplate.Date
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
static getErrorTime(name, value) {
|
|
60
|
+
return Validator.getError(name, value, {
|
|
61
|
+
required: true, regex: {
|
|
62
|
+
name: "Time",
|
|
63
|
+
regex: RegexTemplate.Time
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
static getErrorDuration(name, value) {
|
|
68
|
+
return Validator.getError(name, value, {
|
|
69
|
+
required: true, regex: {
|
|
70
|
+
name: "Duration",
|
|
71
|
+
regex: RegexTemplate.Duration
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
static getErrorIP(name, value) {
|
|
76
|
+
return Validator.getError(name, value, {
|
|
77
|
+
required: true, regex: {
|
|
78
|
+
name: "IP",
|
|
79
|
+
regex: RegexTemplate.IP
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
static getErrorPhone(name, value) {
|
|
84
|
+
return Validator.getError(name, value, {
|
|
85
|
+
required: true, validator: () => {
|
|
86
|
+
if (value)
|
|
87
|
+
if (!PhoneOperation.isValid(value))
|
|
88
|
+
return `${name} is not a valid phone number`;
|
|
89
|
+
return null;
|
|
48
90
|
}
|
|
49
91
|
});
|
|
50
92
|
}
|
package/dist/Validator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Validator.js","sourceRoot":"","sources":["../src/Validator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Validator.js","sourceRoot":"","sources":["../src/Validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKhE,MAAM,OAAO,SAAS;IAElB,MAAM,CAAC,QAAQ,CAA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C,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE;gBACnB,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,aAAa,CAAC,QAAQ;aAChC;SACJ,CAAC,CAAC;IACP,CAAC;IACD,MAAM,CAAC,UAAU,CAAC,IAAY,EAAE,KAAgC;QAE5D,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE;YACnC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE;gBACnB,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,aAAa,CAAC,EAAE;aAC1B;SACJ,CAAC,CAAC;IACP,CAAC;IACD,MAAM,CAAC,aAAa,CAAC,IAAY,EAAE,KAAgC;QAE/D,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE;YACnC,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE;gBAE5B,IAAI,KAAK;oBACL,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC;wBAC9B,OAAO,GAAG,IAAI,8BAA8B,CAAC;gBACrD,OAAO,IAAI,CAAC;YAChB,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -2,9 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import NSButton from "./NSButton";
|
|
3
3
|
import Style from "./NSButtonBlue.module.css";
|
|
4
4
|
export function NSButtonBlue(props) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
let classList = [];
|
|
6
|
+
if (props.classList)
|
|
7
|
+
classList.push(...props.classList);
|
|
8
|
+
classList.push(Style.ns_button_blue);
|
|
9
|
+
return _jsx(NSButton, { title: props.title, icon: props.icon, onClick: props.onClick, id: props.id, classList: classList, style: props.style });
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=NSButtonBlue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSButtonBlue.js","sourceRoot":"","sources":["../../src/components/NSButtonBlue.tsx"],"names":[],"mappings":";AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,MAAM,2BAA2B,CAAC;AAG9C,MAAM,UAAU,YAAY,CAAC,KAAoB;IAE7C,IAAI,
|
|
1
|
+
{"version":3,"file":"NSButtonBlue.js","sourceRoot":"","sources":["../../src/components/NSButtonBlue.tsx"],"names":[],"mappings":";AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,MAAM,2BAA2B,CAAC;AAG9C,MAAM,UAAU,YAAY,CAAC,KAAoB;IAE7C,IAAI,SAAS,GAAG,EAAE,CAAA;IAClB,IAAI,KAAK,CAAC,SAAS;QACf,SAAS,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;IACvC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAErC,OAAO,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,GAAI,CAAC;AAC9I,CAAC"}
|
|
@@ -2,9 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import NSButton from "./NSButton";
|
|
3
3
|
import Style from "./NSButtonGreen.module.css";
|
|
4
4
|
export function NSButtonGreen(props) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
let classList = [];
|
|
6
|
+
if (props.classList)
|
|
7
|
+
classList.push(...props.classList);
|
|
8
|
+
classList.push(Style.ns_button_green);
|
|
9
|
+
return _jsx(NSButton, { title: props.title, icon: props.icon, onClick: props.onClick, id: props.id, classList: classList, style: props.style });
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=NSButtonGreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSButtonGreen.js","sourceRoot":"","sources":["../../src/components/NSButtonGreen.tsx"],"names":[],"mappings":";AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,MAAM,4BAA4B,CAAC;AAG/C,MAAM,UAAU,aAAa,CAAC,KAAoB;IAE9C,IAAI,
|
|
1
|
+
{"version":3,"file":"NSButtonGreen.js","sourceRoot":"","sources":["../../src/components/NSButtonGreen.tsx"],"names":[],"mappings":";AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,MAAM,4BAA4B,CAAC;AAG/C,MAAM,UAAU,aAAa,CAAC,KAAoB;IAE9C,IAAI,SAAS,GAAG,EAAE,CAAA;IAClB,IAAI,KAAK,CAAC,SAAS;QACf,SAAS,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;IACvC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IACtC,OAAO,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,GAAI,CAAC;AAC9I,CAAC"}
|
|
@@ -2,9 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import NSButton from "./NSButton";
|
|
3
3
|
import Style from "./NSButtonGreen.module.css";
|
|
4
4
|
export function NSButtonRed(props) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
let classList = [];
|
|
6
|
+
if (props.classList)
|
|
7
|
+
classList.push(...props.classList);
|
|
8
|
+
classList.push(Style.ns_button_red);
|
|
9
|
+
return _jsx(NSButton, { title: props.title, icon: props.icon, onClick: props.onClick, id: props.id, classList: classList, style: props.style });
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=NSButtonRed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSButtonRed.js","sourceRoot":"","sources":["../../src/components/NSButtonRed.tsx"],"names":[],"mappings":";AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,MAAM,4BAA4B,CAAC;AAG/C,MAAM,UAAU,WAAW,CAAC,KAAoB;IAE5C,IAAI,
|
|
1
|
+
{"version":3,"file":"NSButtonRed.js","sourceRoot":"","sources":["../../src/components/NSButtonRed.tsx"],"names":[],"mappings":";AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,MAAM,4BAA4B,CAAC;AAG/C,MAAM,UAAU,WAAW,CAAC,KAAoB;IAE5C,IAAI,SAAS,GAAG,EAAE,CAAA;IAClB,IAAI,KAAK,CAAC,SAAS;QACf,SAAS,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;IACvC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IACpC,OAAO,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,GAAI,CAAC;AAC9I,CAAC"}
|
|
@@ -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
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
3
|
-
|
|
3
|
+
import { ValidationProps } from "../props/ValidationProps";
|
|
4
|
+
export interface NSInputDateProps extends BaseComponentProps, ValidationProps {
|
|
4
5
|
title: string;
|
|
5
6
|
defaultValue?: string;
|
|
6
7
|
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -12,6 +13,7 @@ export interface NSInputDateState {
|
|
|
12
13
|
}
|
|
13
14
|
export declare class NSInputDate extends React.Component<NSInputDateProps, NSInputDateState> {
|
|
14
15
|
constructor(props: NSInputDateProps);
|
|
16
|
+
getError(): string | null;
|
|
15
17
|
getValue(): string;
|
|
16
18
|
setValue(value: string): void;
|
|
17
19
|
private onChanged;
|
|
@@ -2,18 +2,28 @@
|
|
|
2
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 "./NSInputDate.module.css";
|
|
5
|
+
import IconInputDate from '../assets/images/icon-input-date.svg';
|
|
5
6
|
import { NSInputErrorNotifier } from "./NSInputErrorNotifier";
|
|
7
|
+
import { Validator } from "../Validator";
|
|
6
8
|
export class NSInputDate extends React.Component {
|
|
7
9
|
constructor(props) {
|
|
10
|
+
var _a;
|
|
8
11
|
super(props);
|
|
9
|
-
this.state = {
|
|
10
|
-
value: ""
|
|
11
|
-
};
|
|
12
|
+
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "" };
|
|
12
13
|
this.setValue = this.setValue.bind(this);
|
|
13
14
|
this.getValue = this.getValue.bind(this);
|
|
14
15
|
this.onChanged = this.onChanged.bind(this);
|
|
15
16
|
}
|
|
17
|
+
getError() {
|
|
18
|
+
return (Validator.getError(this.props.title, this.state.value, this.props) &&
|
|
19
|
+
Validator.getErrorDate(this.props.title, this.state.value));
|
|
20
|
+
}
|
|
16
21
|
getValue() {
|
|
22
|
+
let error = this.getError();
|
|
23
|
+
if (error) {
|
|
24
|
+
this.setState({ error });
|
|
25
|
+
throw new Error(error);
|
|
26
|
+
}
|
|
17
27
|
return this.state.value;
|
|
18
28
|
}
|
|
19
29
|
setValue(value) {
|
|
@@ -26,7 +36,7 @@ export class NSInputDate extends React.Component {
|
|
|
26
36
|
}
|
|
27
37
|
render() {
|
|
28
38
|
var _a;
|
|
29
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `${Styles.
|
|
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: IconInputDate, alt: "Date Icon", width: 24, height: 24 }), _jsx("input", { id: this.props.id, value: this.state.value, onChange: this.onChanged, type: "date", className: Styles.ns_input, placeholder: this.props.placeholder, onClick: () => { } })] }), _jsx(NSInputErrorNotifier, { error: this.state.error })] }));
|
|
30
40
|
}
|
|
31
41
|
}
|
|
32
42
|
//# sourceMappingURL=NSInputDate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSInputDate.js","sourceRoot":"","sources":["../../src/components/NSInputDate.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"NSInputDate.js","sourceRoot":"","sources":["../../src/components/NSInputDate.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,aAAa,MAAM,sCAAsC,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAgBzC,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,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IACD,QAAQ;QAEJ,OAAO,CACH,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC;YAClE,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,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E,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,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,GACpB,IACA,EACN,KAAC,oBAAoB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAI,IAClD,CACN,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
.
|
|
1
|
+
.ns_input_parent {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: 326px;
|
|
5
5
|
color: #fff;
|
|
6
6
|
position: relative;
|
|
7
7
|
max-width: 100%;
|
|
8
|
+
padding: 8px;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
.ns_input {
|
|
@@ -12,12 +13,14 @@
|
|
|
12
13
|
padding: 10px 12px;
|
|
13
14
|
font-size: 16px;
|
|
14
15
|
font-weight: 400;
|
|
16
|
+
border: 1px solid rgba(47, 0, 236, 0.6);
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
.ns_input_icon {
|
|
18
20
|
position: absolute;
|
|
19
21
|
right: 20px;
|
|
20
22
|
top: 51%;
|
|
23
|
+
z-index: 1;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
.ns_input_title {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
3
|
-
|
|
3
|
+
import { ValidationProps } from "../props/ValidationProps";
|
|
4
|
+
import { ValidationNumberProps } from "../props/ValidationNumberProps";
|
|
5
|
+
import { ValidationStringProps } from "../props/ValidationStringProps";
|
|
6
|
+
export interface NSInputDurationProps extends BaseComponentProps, ValidationProps, ValidationStringProps, ValidationNumberProps {
|
|
4
7
|
title: string;
|
|
5
8
|
defaultValue?: string;
|
|
6
9
|
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -8,9 +11,11 @@ export interface NSInputDurationProps extends BaseComponentProps {
|
|
|
8
11
|
}
|
|
9
12
|
export interface NSInputDurationState {
|
|
10
13
|
value: string;
|
|
14
|
+
error?: string;
|
|
11
15
|
}
|
|
12
16
|
export declare class NSInputDuration extends React.Component<NSInputDurationProps, NSInputDurationState> {
|
|
13
17
|
constructor(props: NSInputDurationProps);
|
|
18
|
+
getError(): string | null;
|
|
14
19
|
getValue(): string;
|
|
15
20
|
setValue(value: string): void;
|
|
16
21
|
private onChanged;
|
|
@@ -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 IconInputDuration from '../assets/images/icon-input-duration.svg';
|
|
6
|
+
import { Validator } from "../Validator";
|
|
7
|
+
import { NSInputErrorNotifier } from "./NSInputErrorNotifier";
|
|
6
8
|
export class NSInputDuration 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.getErrorDuration(this.props.title, this.state.value));
|
|
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 NSInputDuration 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: IconInputDuration, alt: "Duration 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
40
|
}
|
|
32
41
|
}
|
|
33
42
|
//# sourceMappingURL=NSInputDuration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSInputDuration.js","sourceRoot":"","sources":["../../src/components/NSInputDuration.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"NSInputDuration.js","sourceRoot":"","sources":["../../src/components/NSInputDuration.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B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@@ -5,8 +5,8 @@ import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
|
5
5
|
export interface NSInputEmailProps extends BaseComponentProps, ValidationProps, ValidationStringProps {
|
|
6
6
|
title: string;
|
|
7
7
|
defaultValue?: string;
|
|
8
|
-
placeholder?: string;
|
|
9
8
|
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
9
|
+
placeholder?: string;
|
|
10
10
|
}
|
|
11
11
|
export interface NSInputEmailState {
|
|
12
12
|
value: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
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 IconInputEmail from '../assets/images/icon-input-email.svg';
|
|
6
6
|
import { Validator } from "../Validator";
|
|
7
7
|
import { NSInputErrorNotifier } from "./NSInputErrorNotifier";
|
|
@@ -15,7 +15,9 @@ export class NSInputEmail extends React.Component {
|
|
|
15
15
|
this.onChanged = this.onChanged.bind(this);
|
|
16
16
|
}
|
|
17
17
|
getError() {
|
|
18
|
-
return Validator.
|
|
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.getErrorEmail(this.props.title, this.state.value));
|
|
19
21
|
}
|
|
20
22
|
getValue() {
|
|
21
23
|
let error = this.getError();
|
|
@@ -35,7 +37,7 @@ export class NSInputEmail extends React.Component {
|
|
|
35
37
|
}
|
|
36
38
|
render() {
|
|
37
39
|
var _a;
|
|
38
|
-
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: [
|
|
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: IconInputEmail, alt: "Email Icon", width: 24, height: 24 }), _jsx("input", { id: this.props.id, value: this.state.value, onChange: this.onChanged, type: "email", className: Styles.ns_input, placeholder: this.props.placeholder })] }), _jsx(NSInputErrorNotifier, { error: this.state.error })] }));
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
//# 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,
|
|
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,sBAAsB,CAAC;AAC1C,OAAO,cAAc,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAgB9D,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,I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G,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,cAAc,EACnB,GAAG,EAAC,YAAY,EAChB,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,OAAO,EACZ,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"}
|
|
@@ -4,19 +4,19 @@ import { ValidationProps } from "../props/ValidationProps";
|
|
|
4
4
|
import { ValidationNumberProps } from "../props/ValidationNumberProps";
|
|
5
5
|
export interface NSInputFloatProps extends BaseComponentProps, ValidationProps, ValidationNumberProps {
|
|
6
6
|
title: string;
|
|
7
|
-
defaultValue?:
|
|
7
|
+
defaultValue?: number;
|
|
8
8
|
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
9
9
|
placeholder?: string;
|
|
10
10
|
}
|
|
11
11
|
export interface NSInputFloatState {
|
|
12
|
-
value
|
|
12
|
+
value?: number;
|
|
13
13
|
error?: string;
|
|
14
14
|
}
|
|
15
15
|
export declare class NSInputFloat extends React.Component<NSInputFloatProps, NSInputFloatState> {
|
|
16
16
|
constructor(props: NSInputFloatProps);
|
|
17
17
|
getError(): string | null;
|
|
18
|
-
getValue():
|
|
19
|
-
setValue(value:
|
|
18
|
+
getValue(): number | undefined;
|
|
19
|
+
setValue(value: number | undefined): void;
|
|
20
20
|
private onChanged;
|
|
21
21
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
}
|
|
@@ -1,22 +1,21 @@
|
|
|
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 IconInputFloat from '../assets/images/icon-input-float.svg';
|
|
6
6
|
import { Validator } from "../Validator";
|
|
7
|
+
import { NSInputErrorNotifier } from "./NSInputErrorNotifier";
|
|
7
8
|
export class NSInputFloat extends React.Component {
|
|
8
9
|
constructor(props) {
|
|
9
|
-
var _a;
|
|
10
10
|
super(props);
|
|
11
|
-
this.state = {
|
|
12
|
-
value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "",
|
|
13
|
-
};
|
|
11
|
+
this.state = { value: props.defaultValue };
|
|
14
12
|
this.setValue = this.setValue.bind(this);
|
|
15
13
|
this.getValue = this.getValue.bind(this);
|
|
16
14
|
this.onChanged = this.onChanged.bind(this);
|
|
17
15
|
}
|
|
18
16
|
getError() {
|
|
19
|
-
return Validator.
|
|
17
|
+
return (Validator.getError(this.props.title, this.state.value, this.props) &&
|
|
18
|
+
Validator.getErrorNumber(this.props.title, this.state.value, this.props));
|
|
20
19
|
}
|
|
21
20
|
getValue() {
|
|
22
21
|
let error = this.getError();
|
|
@@ -30,13 +29,13 @@ export class NSInputFloat extends React.Component {
|
|
|
30
29
|
this.setState({ value });
|
|
31
30
|
}
|
|
32
31
|
onChanged(e) {
|
|
33
|
-
this.setValue(e.target.value);
|
|
32
|
+
this.setValue(parseFloat(e.target.value));
|
|
34
33
|
if (this.props.onChanged)
|
|
35
34
|
this.props.onChanged(e);
|
|
36
35
|
}
|
|
37
36
|
render() {
|
|
38
37
|
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: "
|
|
38
|
+
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: IconInputFloat, alt: "Flaot Icon", width: 24, height: 24 }), _jsx("input", { id: this.props.id, value: this.state.value, onChange: this.onChanged, type: "number", className: Styles.ns_input, placeholder: this.props.placeholder })] }), _jsx(NSInputErrorNotifier, { error: this.state.error })] }));
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
//# sourceMappingURL=NSInputFloat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSInputFloat.js","sourceRoot":"","sources":["../../src/components/NSInputFloat.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"NSInputFloat.js","sourceRoot":"","sources":["../../src/components/NSInputFloat.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,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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 NSInputIPProps 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 NSInputIPProps extends BaseComponentProps {
|
|
|
8
10
|
}
|
|
9
11
|
export interface NSInputIPState {
|
|
10
12
|
value: string;
|
|
13
|
+
error?: string;
|
|
11
14
|
}
|
|
12
15
|
export declare class NSInputIP extends React.Component<NSInputIPProps, NSInputIPState> {
|
|
13
16
|
constructor(props: NSInputIPProps);
|
|
17
|
+
getError(): string | null;
|
|
14
18
|
getValue(): string;
|
|
15
19
|
setValue(value: string): void;
|
|
16
20
|
private onChanged;
|