namirasoft-site-react 1.3.251 → 1.3.254
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 +1 -1
- package/dist/App.js.map +1 -1
- package/dist/components/NSBoxBoolean.d.ts +6 -7
- package/dist/components/NSBoxBoolean.js +8 -12
- package/dist/components/NSBoxBoolean.js.map +1 -1
- package/dist/components/NSBoxDate.d.ts +3 -2
- package/dist/components/NSBoxDate.js +5 -7
- package/dist/components/NSBoxDate.js.map +1 -1
- package/dist/components/NSBoxDateTime.d.ts +3 -2
- package/dist/components/NSBoxDateTime.js +5 -7
- package/dist/components/NSBoxDateTime.js.map +1 -1
- package/dist/components/NSBoxDouble.d.ts +3 -2
- package/dist/components/NSBoxDouble.js +5 -7
- package/dist/components/NSBoxDouble.js.map +1 -1
- package/dist/components/NSBoxDuration.d.ts +3 -2
- package/dist/components/NSBoxDuration.js +5 -7
- package/dist/components/NSBoxDuration.js.map +1 -1
- package/dist/components/NSBoxEmail.d.ts +3 -2
- package/dist/components/NSBoxEmail.js +6 -8
- package/dist/components/NSBoxEmail.js.map +1 -1
- package/dist/components/NSBoxEntity.d.ts +6 -3
- package/dist/components/NSBoxEntity.js +13 -10
- package/dist/components/NSBoxEntity.js.map +1 -1
- package/dist/components/NSBoxEnum.d.ts +3 -2
- package/dist/components/NSBoxEnum.js +5 -8
- package/dist/components/NSBoxEnum.js.map +1 -1
- package/dist/components/NSBoxErrorNotifier.d.ts +1 -0
- package/dist/components/NSBoxErrorNotifier.js +5 -1
- package/dist/components/NSBoxErrorNotifier.js.map +1 -1
- package/dist/components/NSBoxIPV4.d.ts +3 -2
- package/dist/components/NSBoxIPV4.js +5 -7
- package/dist/components/NSBoxIPV4.js.map +1 -1
- package/dist/components/NSBoxIPV6.d.ts +3 -2
- package/dist/components/NSBoxIPV6.js +5 -7
- package/dist/components/NSBoxIPV6.js.map +1 -1
- package/dist/components/NSBoxInteger.d.ts +3 -2
- package/dist/components/NSBoxInteger.js +5 -7
- package/dist/components/NSBoxInteger.js.map +1 -1
- package/dist/components/NSBoxLabel.d.ts +2 -1
- package/dist/components/NSBoxLabel.js +2 -1
- package/dist/components/NSBoxLabel.js.map +1 -1
- package/dist/components/NSBoxOTP.d.ts +2 -0
- package/dist/components/NSBoxOTP.js +2 -1
- package/dist/components/NSBoxOTP.js.map +1 -1
- package/dist/components/NSBoxPassword.d.ts +3 -2
- package/dist/components/NSBoxPassword.js +5 -7
- package/dist/components/NSBoxPassword.js.map +1 -1
- package/dist/components/NSBoxPhone.d.ts +3 -2
- package/dist/components/NSBoxPhone.js +1 -4
- package/dist/components/NSBoxPhone.js.map +1 -1
- package/dist/components/NSBoxPrice.d.ts +3 -2
- package/dist/components/NSBoxPrice.js +6 -8
- package/dist/components/NSBoxPrice.js.map +1 -1
- package/dist/components/NSBoxString.d.ts +3 -2
- package/dist/components/NSBoxString.js +6 -8
- package/dist/components/NSBoxString.js.map +1 -1
- package/dist/components/NSBoxTextArea.d.ts +3 -2
- package/dist/components/NSBoxTextArea.js +7 -9
- package/dist/components/NSBoxTextArea.js.map +1 -1
- package/dist/components/NSBoxTime.d.ts +3 -2
- package/dist/components/NSBoxTime.js +5 -7
- package/dist/components/NSBoxTime.js.map +1 -1
- package/dist/components/NSFilterBoxDialog.js +1 -1
- package/dist/components/NSGroupedList.module.css +1 -0
- package/dist/components/NSPagination.d.ts +15 -2
- package/dist/components/NSPagination.js +73 -44
- package/dist/components/NSPagination.js.map +1 -1
- package/dist/components/NSTable.d.ts +4 -3
- package/dist/components/NSTable.js +8 -6
- package/dist/components/NSTable.js.map +1 -1
- package/dist/props/IBaseComponentProps.d.ts +1 -0
- package/package.json +2 -2
- package/src/App.tsx +2 -2
- package/src/components/NSBoxBoolean.tsx +18 -27
- package/src/components/NSBoxDate.tsx +14 -15
- package/src/components/NSBoxDateTime.tsx +14 -15
- package/src/components/NSBoxDouble.tsx +15 -17
- package/src/components/NSBoxDuration.tsx +14 -14
- package/src/components/NSBoxEmail.tsx +19 -18
- package/src/components/NSBoxEntity.tsx +23 -14
- package/src/components/NSBoxEnum.tsx +10 -13
- package/src/components/NSBoxErrorNotifier.tsx +7 -1
- package/src/components/NSBoxIPV4.tsx +14 -14
- package/src/components/NSBoxIPV6.tsx +14 -14
- package/src/components/NSBoxInteger.tsx +14 -14
- package/src/components/NSBoxLabel.tsx +3 -2
- package/src/components/NSBoxOTP.tsx +19 -15
- package/src/components/NSBoxPassword.tsx +14 -14
- package/src/components/NSBoxPhone.tsx +4 -9
- package/src/components/NSBoxPrice.tsx +15 -15
- package/src/components/NSBoxString.tsx +16 -16
- package/src/components/NSBoxTextArea.tsx +13 -17
- package/src/components/NSBoxTime.tsx +14 -14
- package/src/components/NSFilterBoxDialog.tsx +2 -2
- package/src/components/NSGroupedList.module.css +1 -0
- package/src/components/NSPagination.tsx +154 -117
- package/src/components/NSTable.tsx +8 -8
- package/src/props/IBaseComponentProps.ts +1 -0
|
@@ -12,9 +12,10 @@ import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
|
12
12
|
export interface INSBoxIntegerProps extends IBaseComponentProps, IValidationProps, IValidationNumberProps
|
|
13
13
|
{
|
|
14
14
|
title: string;
|
|
15
|
-
defaultValue?: number;
|
|
16
|
-
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
17
15
|
placeholder?: string;
|
|
16
|
+
defaultValue?: number;
|
|
17
|
+
onChanged?: (e: NSBoxInteger) => void;
|
|
18
|
+
onClicked?: (e: NSBoxInteger) => void;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export interface INSBoxIntegerState
|
|
@@ -46,41 +47,40 @@ export class NSBoxInteger extends React.Component<INSBoxIntegerProps, INSBoxInte
|
|
|
46
47
|
if (error)
|
|
47
48
|
{
|
|
48
49
|
this.setState({ error });
|
|
49
|
-
setTimeout(() =>
|
|
50
|
-
{
|
|
51
|
-
this.setState({ error: "" });
|
|
52
|
-
}, 7000);
|
|
53
50
|
throw new Error(error);
|
|
54
51
|
}
|
|
55
52
|
return this.state.value;
|
|
56
53
|
}
|
|
57
54
|
setValue(value: number | undefined): void
|
|
58
55
|
{
|
|
59
|
-
this.setState({ value })
|
|
56
|
+
this.setState({ value }, () =>
|
|
57
|
+
{
|
|
58
|
+
if (this.props.onChanged)
|
|
59
|
+
this.props.onChanged(this);
|
|
60
|
+
});
|
|
60
61
|
}
|
|
61
62
|
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
62
63
|
{
|
|
63
64
|
this.setValue(parseInt(e.target.value));
|
|
64
|
-
if (this.props.onChanged)
|
|
65
|
-
this.props.onChanged(e);
|
|
66
65
|
}
|
|
67
66
|
override render()
|
|
68
67
|
{
|
|
69
68
|
return (
|
|
70
69
|
<>
|
|
71
|
-
<div className={`${Styles.ns_input_parent}
|
|
70
|
+
<div id={this.props.id} className={`${Styles.ns_input_parent} ${this.props.classList?.join(" ")}`} style={this.props.style}>
|
|
72
71
|
<span className={Styles.ns_input_title}> {this.props.required && <span style={{ color: "red" }} >*</span>} {this.props.title} </span>
|
|
73
72
|
<input
|
|
74
|
-
id={this.props.id}
|
|
75
|
-
value={this.state.value}
|
|
76
|
-
onChange={this.onChanged}
|
|
77
73
|
type="number"
|
|
74
|
+
name={this.props.name}
|
|
78
75
|
className={Styles.ns_input}
|
|
79
76
|
placeholder={this.props.placeholder}
|
|
77
|
+
value={this.state.value}
|
|
78
|
+
onChange={this.onChanged}
|
|
79
|
+
onClick={() => this.props.onClicked}
|
|
80
80
|
style={{ background: `url(${IconInputInteger}) white no-repeat scroll center right 16px` }}
|
|
81
81
|
/>
|
|
82
82
|
</div>
|
|
83
|
-
<NSBoxErrorNotifier error={this.state.error} />
|
|
83
|
+
<NSBoxErrorNotifier error={this.state.error} clearError={() => this.setState({ error: "" })} />
|
|
84
84
|
</>
|
|
85
85
|
);
|
|
86
86
|
}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import Styles from './NSBoxLabel.module.css'
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { ReactNode } from "react";
|
|
6
|
+
import { IBaseComponentProps } from '../main';
|
|
6
7
|
|
|
7
|
-
export interface INSBoxLabelProps
|
|
8
|
+
export interface INSBoxLabelProps extends IBaseComponentProps
|
|
8
9
|
{
|
|
9
10
|
title: string;
|
|
10
11
|
children: ReactNode;
|
|
@@ -18,7 +19,7 @@ export class NSBoxLabel extends React.Component<INSBoxLabelProps, INSBoxLabelSta
|
|
|
18
19
|
override render()
|
|
19
20
|
{
|
|
20
21
|
return (
|
|
21
|
-
<div className={Styles.ns_tab_item}>
|
|
22
|
+
<div id={this.props.id} className={`${Styles.ns_tab_item} ${this.props.classList?.join(" ")}`} style={this.props.style}>
|
|
22
23
|
<span className={`${Styles.ns_box_label_title} ns_font_16_bold`}>{this.props.title}</span>
|
|
23
24
|
<div>
|
|
24
25
|
{this.props.children}
|
|
@@ -4,6 +4,8 @@ import { IBaseComponentProps } from '../main';
|
|
|
4
4
|
|
|
5
5
|
interface INSBoxOTPProps extends IBaseComponentProps
|
|
6
6
|
{
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
defaultValue?: string;
|
|
7
9
|
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
8
10
|
}
|
|
9
11
|
|
|
@@ -41,21 +43,23 @@ function NSBoxOTP(props: INSBoxOTPProps)
|
|
|
41
43
|
};
|
|
42
44
|
|
|
43
45
|
return (
|
|
44
|
-
<div style={{ display: 'flex', gap: '10px' }}>
|
|
45
|
-
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
46
|
+
<div id={props.id} className={`${Styles.ns_input_parent} ${props.classList?.join(" ")}`} style={{ ...props.style, display: 'flex', gap: '10px' }}>
|
|
47
|
+
{
|
|
48
|
+
values.map((value, index) => (
|
|
49
|
+
<input
|
|
50
|
+
key={index + 10}
|
|
51
|
+
ref={el => inputsRef.current[index] = el}
|
|
52
|
+
type="text"
|
|
53
|
+
value={value}
|
|
54
|
+
onChange={handleChange(index)}
|
|
55
|
+
onKeyDown={handleKeyDown(index)}
|
|
56
|
+
maxLength={1}
|
|
57
|
+
style={{ width: '30px', textAlign: 'center' }}
|
|
58
|
+
className={Styles.ns_otp_input}
|
|
59
|
+
/>
|
|
60
|
+
))
|
|
61
|
+
}
|
|
62
|
+
</div >
|
|
59
63
|
);
|
|
60
64
|
};
|
|
61
65
|
|
|
@@ -12,9 +12,10 @@ import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
|
12
12
|
export interface INSBoxPasswordProps extends IBaseComponentProps, IValidationProps, IValidationStringProps
|
|
13
13
|
{
|
|
14
14
|
title: string;
|
|
15
|
-
defaultValue?: string;
|
|
16
|
-
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
17
15
|
placeholder?: string;
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
onChanged?: (e: NSBoxPassword) => void;
|
|
18
|
+
onClicked?: (e: NSBoxPassword) => void;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export interface INSBoxPasswordState
|
|
@@ -46,41 +47,40 @@ export class NSBoxPassword extends React.Component<INSBoxPasswordProps, INSBoxPa
|
|
|
46
47
|
if (error)
|
|
47
48
|
{
|
|
48
49
|
this.setState({ error });
|
|
49
|
-
setTimeout(() =>
|
|
50
|
-
{
|
|
51
|
-
this.setState({ error: "" });
|
|
52
|
-
}, 7000);
|
|
53
50
|
throw new Error(error);
|
|
54
51
|
}
|
|
55
52
|
return this.state.value;
|
|
56
53
|
}
|
|
57
54
|
setValue(value: string): void
|
|
58
55
|
{
|
|
59
|
-
this.setState({ value })
|
|
56
|
+
this.setState({ value }, () =>
|
|
57
|
+
{
|
|
58
|
+
if (this.props.onChanged)
|
|
59
|
+
this.props.onChanged(this);
|
|
60
|
+
});
|
|
60
61
|
}
|
|
61
62
|
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
62
63
|
{
|
|
63
64
|
this.setValue(e.target.value);
|
|
64
|
-
if (this.props.onChanged)
|
|
65
|
-
this.props.onChanged(e);
|
|
66
65
|
}
|
|
67
66
|
override render()
|
|
68
67
|
{
|
|
69
68
|
return (
|
|
70
69
|
<>
|
|
71
|
-
<div className={`${Styles.ns_input_parent} ${this.props.classList?.join(" ")}`} style={this.props.style}>
|
|
70
|
+
<div id={this.props.id} className={`${Styles.ns_input_parent} ${this.props.classList?.join(" ")}`} style={this.props.style}>
|
|
72
71
|
<span className={Styles.ns_input_title}> {this.props.required && <span style={{ color: "red" }} >*</span>} {this.props.title} </span>
|
|
73
72
|
<input
|
|
74
|
-
id={this.props.id}
|
|
75
|
-
value={this.state.value}
|
|
76
|
-
onChange={this.onChanged}
|
|
77
73
|
type="password"
|
|
74
|
+
name={this.props.name}
|
|
78
75
|
className={Styles.ns_input}
|
|
79
76
|
placeholder={this.props.placeholder}
|
|
77
|
+
value={this.state.value}
|
|
78
|
+
onChange={this.onChanged}
|
|
79
|
+
onClick={() => this.props.onClicked}
|
|
80
80
|
style={{ background: `url(${IconInputString}) white no-repeat scroll center right 16px` }}
|
|
81
81
|
/>
|
|
82
82
|
</div>
|
|
83
|
-
<NSBoxErrorNotifier error={this.state.error} />
|
|
83
|
+
<NSBoxErrorNotifier error={this.state.error} clearError={() => this.setState({ error: "" })} />
|
|
84
84
|
</>
|
|
85
85
|
);
|
|
86
86
|
}
|
|
@@ -17,9 +17,10 @@ import CopyToClipboard from '../CopyToClipboard';
|
|
|
17
17
|
export interface INSBoxPhoneProps extends IBaseComponentProps, IValidationProps, IValidationStringProps
|
|
18
18
|
{
|
|
19
19
|
title: string;
|
|
20
|
-
defaultValue?: string;
|
|
21
|
-
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
22
20
|
placeholder?: string;
|
|
21
|
+
defaultValue?: string;
|
|
22
|
+
onChanged?: (e: NSBoxPhone) => void;
|
|
23
|
+
onClicked?: (e: NSBoxPhone) => void;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export interface INSBoxPhoneState
|
|
@@ -52,12 +53,7 @@ export class NSBoxPhone extends React.Component<INSBoxPhoneProps, INSBoxPhoneSta
|
|
|
52
53
|
if (error)
|
|
53
54
|
{
|
|
54
55
|
this.setState({ error });
|
|
55
|
-
setTimeout(() =>
|
|
56
|
-
{
|
|
57
|
-
this.setState({ error: "" });
|
|
58
|
-
}, 8000);
|
|
59
56
|
throw new Error(error);
|
|
60
|
-
|
|
61
57
|
}
|
|
62
58
|
return this.state.value;
|
|
63
59
|
}
|
|
@@ -74,7 +70,6 @@ export class NSBoxPhone extends React.Component<INSBoxPhoneProps, INSBoxPhoneSta
|
|
|
74
70
|
return (
|
|
75
71
|
<>
|
|
76
72
|
<div id={this.props.id} className={`${Styles.ns_input_phone_parent} ${Styles.ns_input_parent} ${this.props.classList?.join(" ")} ${this.state.isFullScreen ? Styles.ns_full_screen : ""}`} style={this.props.style}>
|
|
77
|
-
|
|
78
73
|
<div className="d-flex justify-content-between align-item-center">
|
|
79
74
|
<span className={Styles.ns_input_title}> {this.props.required && <span style={{ color: "red" }} >*</span>} {this.props.title} </span>
|
|
80
75
|
<div className="d-flex gap-1">
|
|
@@ -108,7 +103,7 @@ export class NSBoxPhone extends React.Component<INSBoxPhoneProps, INSBoxPhoneSta
|
|
|
108
103
|
}}
|
|
109
104
|
/>
|
|
110
105
|
</div >
|
|
111
|
-
<NSBoxErrorNotifier error={this.state.error} />
|
|
106
|
+
<NSBoxErrorNotifier error={this.state.error} clearError={() => this.setState({ error: "" })} />
|
|
112
107
|
</>
|
|
113
108
|
);
|
|
114
109
|
}
|
|
@@ -12,9 +12,10 @@ import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
|
12
12
|
export interface INSBoxPriceProps extends IBaseComponentProps, IValidationProps, IValidationNumberProps
|
|
13
13
|
{
|
|
14
14
|
title: string;
|
|
15
|
+
placeholder?: number;
|
|
15
16
|
defaultValue?: number;
|
|
16
|
-
onChanged?: (e:
|
|
17
|
-
|
|
17
|
+
onChanged?: (e: NSBoxPrice) => void;
|
|
18
|
+
onClicked?: (e: NSBoxPrice) => void;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export interface INSBoxPriceState
|
|
@@ -46,43 +47,42 @@ export class NSBoxPrice extends React.Component<INSBoxPriceProps, INSBoxPriceSta
|
|
|
46
47
|
if (error)
|
|
47
48
|
{
|
|
48
49
|
this.setState({ error });
|
|
49
|
-
setTimeout(() =>
|
|
50
|
-
{
|
|
51
|
-
this.setState({ error: "" });
|
|
52
|
-
}, 7000);
|
|
53
50
|
throw new Error(error);
|
|
54
51
|
}
|
|
55
52
|
return this.state.value;
|
|
56
53
|
}
|
|
57
54
|
setValue(value: number | undefined): void
|
|
58
55
|
{
|
|
59
|
-
this.setState({ value })
|
|
56
|
+
this.setState({ value }, () =>
|
|
57
|
+
{
|
|
58
|
+
if (this.props.onChanged)
|
|
59
|
+
this.props.onChanged(this);
|
|
60
|
+
});
|
|
60
61
|
}
|
|
61
62
|
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
62
63
|
{
|
|
63
64
|
this.setValue(parseFloat(e.target.value));
|
|
64
|
-
if (this.props.onChanged)
|
|
65
|
-
this.props.onChanged(e);
|
|
66
65
|
}
|
|
67
66
|
override render()
|
|
68
67
|
{
|
|
69
68
|
return (
|
|
70
69
|
<>
|
|
71
|
-
<div className={`${Styles.ns_input_parent}
|
|
70
|
+
<div id={this.props.id} className={`${Styles.ns_input_parent} ${this.props.classList?.join(" ")}`} style={this.props.style}>
|
|
72
71
|
<span className={Styles.ns_input_title}> {this.props.required && <span style={{ color: "red" }} >*</span>} {this.props.title} </span>
|
|
73
72
|
<input
|
|
74
|
-
|
|
73
|
+
type="number"
|
|
74
|
+
name={this.props.name}
|
|
75
|
+
className={Styles.ns_input}
|
|
76
|
+
placeholder={this.props.placeholder?.toString.name}
|
|
75
77
|
value={this.state.value}
|
|
76
78
|
onChange={this.onChanged}
|
|
77
|
-
|
|
79
|
+
onClick={() => this.props.onClicked}
|
|
78
80
|
step="0.01"
|
|
79
81
|
min="0"
|
|
80
|
-
className={Styles.ns_input}
|
|
81
|
-
placeholder={this.props.placeholder}
|
|
82
82
|
style={{ background: `url(${IconInputFloat}) white no-repeat scroll center right 16px` }}
|
|
83
83
|
/>
|
|
84
84
|
</div>
|
|
85
|
-
<NSBoxErrorNotifier error={this.state.error} />
|
|
85
|
+
<NSBoxErrorNotifier error={this.state.error} clearError={() => this.setState({ error: "" })} />
|
|
86
86
|
</>
|
|
87
87
|
);
|
|
88
88
|
}
|
|
@@ -15,9 +15,10 @@ import CopyToClipboard from '../CopyToClipboard';
|
|
|
15
15
|
export interface INSBoxStringProps extends IBaseComponentProps, IValidationProps, IValidationStringProps
|
|
16
16
|
{
|
|
17
17
|
title: string;
|
|
18
|
-
defaultValue?: string;
|
|
19
|
-
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
20
18
|
placeholder?: string;
|
|
19
|
+
defaultValue?: string;
|
|
20
|
+
onChanged?: (e: NSBoxString) => void;
|
|
21
|
+
onClicked?: (e: NSBoxString) => void;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export interface INSBoxStringState
|
|
@@ -51,24 +52,21 @@ export class NSBoxString extends React.Component<INSBoxStringProps, INSBoxString
|
|
|
51
52
|
if (error)
|
|
52
53
|
{
|
|
53
54
|
this.setState({ error });
|
|
54
|
-
|
|
55
|
-
{
|
|
56
|
-
this.setState({ error: "" });
|
|
57
|
-
}, 7000);
|
|
58
|
-
// throw new Error(error);
|
|
59
|
-
return '';
|
|
55
|
+
throw new Error(error);
|
|
60
56
|
}
|
|
61
57
|
return this.state.value;
|
|
62
58
|
}
|
|
63
59
|
setValue(value: string): void
|
|
64
60
|
{
|
|
65
|
-
this.setState({ value })
|
|
61
|
+
this.setState({ value }, () =>
|
|
62
|
+
{
|
|
63
|
+
if (this.props.onChanged)
|
|
64
|
+
this.props.onChanged(this);
|
|
65
|
+
});
|
|
66
66
|
}
|
|
67
67
|
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
68
68
|
{
|
|
69
69
|
this.setValue(e.target.value);
|
|
70
|
-
if (this.props.onChanged)
|
|
71
|
-
this.props.onChanged(e);
|
|
72
70
|
}
|
|
73
71
|
private toggleFullScreen(): void
|
|
74
72
|
{
|
|
@@ -78,7 +76,7 @@ export class NSBoxString extends React.Component<INSBoxStringProps, INSBoxString
|
|
|
78
76
|
{
|
|
79
77
|
return (
|
|
80
78
|
<>
|
|
81
|
-
<div className={`${Styles.ns_input_parent} ${this.props.classList?.join(" ")} ${this.state.isFullScreen ? Styles.ns_full_screen : ""}`} style={this.props.style}>
|
|
79
|
+
<div id={this.props.id} className={`${Styles.ns_input_parent} ${this.props.classList?.join(" ")} ${this.state.isFullScreen ? Styles.ns_full_screen : ""}`} style={this.props.style}>
|
|
82
80
|
<div className="d-flex justify-content-between align-items-center">
|
|
83
81
|
<span className={Styles.ns_input_title}>
|
|
84
82
|
{this.props.required && <span style={{ color: "red" }}>*</span>} {this.props.title}
|
|
@@ -103,14 +101,16 @@ export class NSBoxString extends React.Component<INSBoxStringProps, INSBoxString
|
|
|
103
101
|
</div>
|
|
104
102
|
</div>
|
|
105
103
|
<input
|
|
106
|
-
id={this.props.id}
|
|
107
|
-
value={this.state.value}
|
|
108
|
-
onChange={this.onChanged}
|
|
109
104
|
type="text"
|
|
105
|
+
name={this.props.name}
|
|
110
106
|
className={Styles.ns_input}
|
|
111
107
|
placeholder={this.props.placeholder}
|
|
108
|
+
value={this.state.value}
|
|
109
|
+
onChange={this.onChanged}
|
|
110
|
+
onClick={() => this.props.onClicked}
|
|
112
111
|
style={{ background: `url(${IconInputString}) white no-repeat scroll center right 16px` }}
|
|
113
112
|
/>
|
|
113
|
+
{/* Todo make a new component for fullscreen */}
|
|
114
114
|
<div className={Styles.ns_input_modal_full_screen} style={{ display: this.state.isFullScreen === false ? "none" : "block" }} >
|
|
115
115
|
<div>
|
|
116
116
|
<img
|
|
@@ -129,7 +129,7 @@ export class NSBoxString extends React.Component<INSBoxStringProps, INSBoxString
|
|
|
129
129
|
></textarea>
|
|
130
130
|
</div>
|
|
131
131
|
</div>
|
|
132
|
-
<NSBoxErrorNotifier error={this.state.error} />
|
|
132
|
+
<NSBoxErrorNotifier error={this.state.error} clearError={() => this.setState({ error: "" })} />
|
|
133
133
|
</>
|
|
134
134
|
);
|
|
135
135
|
}
|
|
@@ -15,9 +15,10 @@ import CopyToClipboard from '../CopyToClipboard';
|
|
|
15
15
|
export interface INSBoxTextAreaProps extends IBaseComponentProps, IValidationProps, IValidationStringProps
|
|
16
16
|
{
|
|
17
17
|
title: string;
|
|
18
|
-
defaultValue?: string;
|
|
19
|
-
onChanged?: () => void;
|
|
20
18
|
placeholder?: string;
|
|
19
|
+
defaultValue?: string;
|
|
20
|
+
onChanged?: (e: NSBoxTextArea) => void;
|
|
21
|
+
onClicked?: (e: NSBoxTextArea) => void;
|
|
21
22
|
cols?: number;
|
|
22
23
|
rows?: number;
|
|
23
24
|
}
|
|
@@ -53,25 +54,22 @@ export class NSBoxTextArea extends React.Component<INSBoxTextAreaProps, INSBoxTe
|
|
|
53
54
|
if (error)
|
|
54
55
|
{
|
|
55
56
|
this.setState({ error });
|
|
56
|
-
|
|
57
|
-
{
|
|
58
|
-
this.setState({ error: "" });
|
|
59
|
-
}, 7000);
|
|
60
|
-
// throw new Error(error);
|
|
61
|
-
return '';
|
|
57
|
+
throw new Error(error);
|
|
62
58
|
}
|
|
63
59
|
return this.state.value;
|
|
64
|
-
|
|
65
60
|
}
|
|
66
61
|
setValue(value: string): void
|
|
67
62
|
{
|
|
68
|
-
this.setState({ value })
|
|
63
|
+
this.setState({ value }, () =>
|
|
64
|
+
{
|
|
65
|
+
if (this.props.onChanged)
|
|
66
|
+
this.props.onChanged(this);
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
69
|
}
|
|
70
70
|
private onChanged = async (e: React.ChangeEvent<HTMLTextAreaElement>): Promise<void> =>
|
|
71
71
|
{
|
|
72
72
|
await this.setValue(e.target.value);
|
|
73
|
-
if (this.props.onChanged)
|
|
74
|
-
this.props.onChanged();
|
|
75
73
|
}
|
|
76
74
|
private toggleFullScreen(): void
|
|
77
75
|
{
|
|
@@ -81,7 +79,7 @@ export class NSBoxTextArea extends React.Component<INSBoxTextAreaProps, INSBoxTe
|
|
|
81
79
|
{
|
|
82
80
|
return (
|
|
83
81
|
<>
|
|
84
|
-
<div className={`${Styles.ns_text_area_parent} ${this.props.classList?.join(" ")} ${this.state.isFullScreen ? Styles.ns_full_screen : ""}`} style={this.props.style} onClick={this.state.isFullScreen ? ()=>{} : ()=>{}}>
|
|
82
|
+
<div id={this.props.id} className={`${Styles.ns_text_area_parent} ${this.props.classList?.join(" ")} ${this.state.isFullScreen ? Styles.ns_full_screen : ""}`} style={this.props.style} onClick={this.state.isFullScreen ? () => { } : () => { }}>
|
|
85
83
|
<div className="d-flex justify-content-between align-items-center">
|
|
86
84
|
<span className={Styles.ns_input_title}>
|
|
87
85
|
{this.props.required && <span style={{ color: "red" }}>*</span>} {this.props.title}
|
|
@@ -115,17 +113,15 @@ export class NSBoxTextArea extends React.Component<INSBoxTextAreaProps, INSBoxTe
|
|
|
115
113
|
}}
|
|
116
114
|
cols={this.props.cols}
|
|
117
115
|
rows={this.props.rows}
|
|
118
|
-
id={this.props.id}
|
|
119
116
|
value={this.state.value}
|
|
120
117
|
className={Styles.ns_text_area}
|
|
121
118
|
placeholder={this.props.placeholder}
|
|
122
119
|
onChange={this.onChanged}
|
|
120
|
+
onClick={() => this.props.onClicked}
|
|
123
121
|
/>
|
|
124
|
-
|
|
125
|
-
|
|
126
122
|
</div>
|
|
127
123
|
</div>
|
|
128
|
-
<NSBoxErrorNotifier error={this.state.error} />
|
|
124
|
+
<NSBoxErrorNotifier error={this.state.error} clearError={() => this.setState({ error: "" })} />
|
|
129
125
|
</>
|
|
130
126
|
);
|
|
131
127
|
}
|
|
@@ -12,9 +12,10 @@ import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
|
12
12
|
export interface INSBoxTimeProps extends IBaseComponentProps, IValidationProps, IValidationStringProps
|
|
13
13
|
{
|
|
14
14
|
title: string;
|
|
15
|
-
defaultValue?: string;
|
|
16
|
-
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
17
15
|
placeholder?: string;
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
onChanged?: (e: NSBoxTime) => void;
|
|
18
|
+
onClicked?: (e: NSBoxTime) => void;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export interface INSBoxTimeState
|
|
@@ -47,42 +48,41 @@ export class NSBoxTime extends React.Component<INSBoxTimeProps, INSBoxTimeState>
|
|
|
47
48
|
if (error)
|
|
48
49
|
{
|
|
49
50
|
this.setState({ error });
|
|
50
|
-
setTimeout(() =>
|
|
51
|
-
{
|
|
52
|
-
this.setState({ error: "" });
|
|
53
|
-
}, 7000);
|
|
54
51
|
throw new Error(error);
|
|
55
52
|
}
|
|
56
53
|
return this.state.value;
|
|
57
54
|
}
|
|
58
55
|
setValue(value: string): void
|
|
59
56
|
{
|
|
60
|
-
this.setState({ value })
|
|
57
|
+
this.setState({ value }, () =>
|
|
58
|
+
{
|
|
59
|
+
if (this.props.onChanged)
|
|
60
|
+
this.props.onChanged(this);
|
|
61
|
+
});
|
|
61
62
|
}
|
|
62
63
|
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
63
64
|
{
|
|
64
65
|
this.setValue(e.target.value);
|
|
65
|
-
if (this.props.onChanged)
|
|
66
|
-
this.props.onChanged(e);
|
|
67
66
|
}
|
|
68
67
|
override render()
|
|
69
68
|
{
|
|
70
69
|
return (
|
|
71
70
|
<>
|
|
72
|
-
<div className={`${Styles.ns_input_parent} ${this.props.classList?.join(" ")}`} style={this.props.style}>
|
|
71
|
+
<div id={this.props.id} className={`${Styles.ns_input_parent} ${this.props.classList?.join(" ")}`} style={this.props.style}>
|
|
73
72
|
<span className={Styles.ns_input_title}> {this.props.required && <span style={{ color: "red" }} >*</span>} {this.props.title} </span>
|
|
74
73
|
<input
|
|
75
|
-
id={this.props.id}
|
|
76
|
-
value={this.state.value}
|
|
77
|
-
onChange={this.onChanged}
|
|
78
74
|
type="time"
|
|
75
|
+
name={this.props.name}
|
|
79
76
|
className={Styles.ns_input}
|
|
80
77
|
placeholder={this.props.placeholder}
|
|
78
|
+
value={this.state.value}
|
|
79
|
+
onChange={this.onChanged}
|
|
80
|
+
onClick={() => this.props.onClicked}
|
|
81
81
|
step="2"
|
|
82
82
|
style={{ background: `url(${IconInputTime}) white no-repeat scroll center right 16px` }}
|
|
83
83
|
/>
|
|
84
84
|
</div>
|
|
85
|
-
<NSBoxErrorNotifier error={this.state.error} />
|
|
85
|
+
<NSBoxErrorNotifier error={this.state.error} clearError={() => this.setState({ error: "" })} />
|
|
86
86
|
</>
|
|
87
87
|
);
|
|
88
88
|
}
|
|
@@ -30,7 +30,7 @@ export class NSFilterBoxDialog extends Component<INSFilterBoxDialogProps, INSFil
|
|
|
30
30
|
</h3>
|
|
31
31
|
<NSBoxEnum
|
|
32
32
|
title={"this.props.title"}
|
|
33
|
-
|
|
33
|
+
placeholder=""
|
|
34
34
|
options={[]}
|
|
35
35
|
multiple={false}
|
|
36
36
|
required={false}
|
|
@@ -38,7 +38,7 @@ export class NSFilterBoxDialog extends Component<INSFilterBoxDialogProps, INSFil
|
|
|
38
38
|
|
|
39
39
|
<NSBoxEnum
|
|
40
40
|
title={"this.props.title"}
|
|
41
|
-
|
|
41
|
+
placeholder=""
|
|
42
42
|
options={[]}
|
|
43
43
|
multiple={false}
|
|
44
44
|
required={false}
|