namirasoft-site-react 1.4.25 → 1.4.26
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.
|
@@ -8,7 +8,6 @@ export interface INSBoxIntegerProps extends IBaseComponentProps, IValidationProp
|
|
|
8
8
|
defaultValue?: number;
|
|
9
9
|
onChanged?: (e: NSBoxInteger) => void;
|
|
10
10
|
onClicked?: (e: NSBoxInteger) => void;
|
|
11
|
-
isPositiveValue?: boolean;
|
|
12
11
|
}
|
|
13
12
|
export interface INSBoxIntegerState {
|
|
14
13
|
value?: number;
|
|
@@ -27,21 +27,10 @@ export class NSBoxInteger extends React.Component {
|
|
|
27
27
|
return this.state.value;
|
|
28
28
|
}
|
|
29
29
|
setValue(value) {
|
|
30
|
-
|
|
31
|
-
if (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (this.props.onChanged)
|
|
35
|
-
this.props.onChanged(this);
|
|
36
|
-
});
|
|
37
|
-
else
|
|
38
|
-
throw new Error("Only Positive Value");
|
|
39
|
-
}
|
|
40
|
-
else
|
|
41
|
-
this.setState({ value }, () => {
|
|
42
|
-
if (this.props.onChanged)
|
|
43
|
-
this.props.onChanged(this);
|
|
44
|
-
});
|
|
30
|
+
this.setState({ value }, () => {
|
|
31
|
+
if (this.props.onChanged)
|
|
32
|
+
this.props.onChanged(this);
|
|
33
|
+
});
|
|
45
34
|
}
|
|
46
35
|
onChanged(e) {
|
|
47
36
|
this.setValue(parseInt(e.target.value));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSBoxInteger.js","sourceRoot":"","sources":["../../src/components/NSBoxInteger.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAIxC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,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AAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EACnC,KAAK,EAAE,EAAE,UAAU,EAAE,+GAA+G,EAAE,cAAc,EAAE,MAAM,EAAE,GAC7J,EACF,KAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAI,IAC1F,GACJ,CACH,CAAC;IACH,CAAC;CACD"}
|
package/package.json
CHANGED
|
@@ -15,7 +15,6 @@ export interface INSBoxIntegerProps extends IBaseComponentProps, IValidationProp
|
|
|
15
15
|
defaultValue?: number;
|
|
16
16
|
onChanged?: (e: NSBoxInteger) => void;
|
|
17
17
|
onClicked?: (e: NSBoxInteger) => void;
|
|
18
|
-
isPositiveValue?: boolean;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
export interface INSBoxIntegerState
|
|
@@ -56,24 +55,11 @@ export class NSBoxInteger extends React.Component<INSBoxIntegerProps, INSBoxInte
|
|
|
56
55
|
}
|
|
57
56
|
setValue(value: number | undefined): void
|
|
58
57
|
{
|
|
59
|
-
|
|
58
|
+
this.setState({ value }, () =>
|
|
60
59
|
{
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
{
|
|
65
|
-
if (this.props.onChanged)
|
|
66
|
-
this.props.onChanged(this);
|
|
67
|
-
});
|
|
68
|
-
else
|
|
69
|
-
throw new Error("Only Positive Value"); //todo: Fix Error Message
|
|
70
|
-
}
|
|
71
|
-
else
|
|
72
|
-
this.setState({ value }, () =>
|
|
73
|
-
{
|
|
74
|
-
if (this.props.onChanged)
|
|
75
|
-
this.props.onChanged(this);
|
|
76
|
-
});
|
|
60
|
+
if (this.props.onChanged)
|
|
61
|
+
this.props.onChanged(this);
|
|
62
|
+
});
|
|
77
63
|
}
|
|
78
64
|
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
79
65
|
{
|
|
@@ -95,7 +81,7 @@ export class NSBoxInteger extends React.Component<INSBoxIntegerProps, INSBoxInte
|
|
|
95
81
|
onClick={() => this.props.onClicked}
|
|
96
82
|
style={{ background: `url("https://static.namirasoft.com/image/concept/nsbox/Integer.png") white no-repeat scroll center right 16px`, backgroundSize: "24px" }}
|
|
97
83
|
/>
|
|
98
|
-
|
|
84
|
+
<NSBoxErrorNotifier error={this.state.error} clearError={() => this.setState({ error: "" })} />
|
|
99
85
|
</div>
|
|
100
86
|
</>
|
|
101
87
|
);
|