namirasoft-site-react 1.4.23 → 1.4.25

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.
@@ -14,19 +14,23 @@
14
14
  }
15
15
 
16
16
  .ns_checkbox_parent {
17
- border-radius: 8px;
17
+ width: 100%;
18
+ height: 48px;
18
19
  padding: 10px 12px 10px 12px;
20
+ background-color: #fff;
21
+ color: #141B5C;
22
+ border-radius: 8px;
23
+ border: 1px solid rgba(0, 0, 0, 1) !important;
19
24
  font-size: 16px;
20
25
  font-weight: 400;
21
- border: 1px solid rgba(0, 0, 0, 1) !important;
22
- background-color: #fff;
26
+ font-family: inherit;
27
+ cursor: pointer;
23
28
  position: relative;
24
- width: 100%;
25
29
  display: flex;
26
30
  flex-direction: row;
27
31
  justify-content: left;
28
32
  align-items: center;
29
- height: 48px;
33
+ gap: 4px;
30
34
  }
31
35
 
32
36
  .ns_input {
@@ -39,14 +43,6 @@
39
43
  accent-color: #141B5C;
40
44
  }
41
45
 
42
- label.ns_checkbox_parent {
43
- cursor: pointer;
44
- color: #141B5C;
45
- font-size: 16px;
46
- font-weight: 300;
47
- font-family: inherit;
48
- }
49
-
50
46
  @media only screen and (min-width: 380px) {
51
47
  .ns_input_parent {
52
48
  max-width: 272px;
@@ -8,6 +8,7 @@ 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;
11
12
  }
12
13
  export interface INSBoxIntegerState {
13
14
  value?: number;
@@ -27,17 +27,28 @@ export class NSBoxInteger extends React.Component {
27
27
  return this.state.value;
28
28
  }
29
29
  setValue(value) {
30
- this.setState({ value }, () => {
31
- if (this.props.onChanged)
32
- this.props.onChanged(this);
33
- });
30
+ if (this.props.isPositiveValue) {
31
+ if (value)
32
+ if (value > 0)
33
+ this.setState({ value }, () => {
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
+ });
34
45
  }
35
46
  onChanged(e) {
36
47
  this.setValue(parseInt(e.target.value));
37
48
  }
38
49
  render() {
39
50
  var _a;
40
- return (_jsxs(_Fragment, { children: [_jsxs("div", { id: this.props.id, className: `${Styles.ns_input_parent} ${(_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("input", { type: "number", name: this.props.name, className: Styles.ns_input, placeholder: this.props.placeholder, value: this.state.value, onChange: this.onChanged, onClick: () => this.props.onClicked, style: { background: `url("https://static.namirasoft.com/image/concept/nsbox/Integer.png") white no-repeat scroll center right 16px`, backgroundSize: "24px" } })] }), _jsx(NSBoxErrorNotifier, { error: this.state.error, clearError: () => this.setState({ error: "" }) })] }));
51
+ return (_jsx(_Fragment, { children: _jsxs("div", { id: this.props.id, className: `${Styles.ns_input_parent} ${(_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("input", { type: "number", name: this.props.name, className: Styles.ns_input, placeholder: this.props.placeholder, value: this.state.value, onChange: this.onChanged, onClick: () => this.props.onClicked, style: { background: `url("https://static.namirasoft.com/image/concept/nsbox/Integer.png") white no-repeat scroll center right 16px`, backgroundSize: "24px" } }), _jsx(NSBoxErrorNotifier, { error: this.state.error, clearError: () => this.setState({ error: "" }) })] }) }));
41
52
  }
42
53
  }
43
54
  //# sourceMappingURL=NSBoxInteger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NSBoxInteger.js","source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CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,eAAe,IAAI,MAAA,IAAI,CAAC,KAAK,CAAC,SAAS,0CAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,aACzH,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,gBACC,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,SAAS,EAAE,MAAM,CAAC,QAAQ,EAC1B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EACnC,KAAK,EAAE,EAAE,UAAU,EAAE,+GAA+G,EAAE,cAAc,EAAE,MAAM,EAAE,GAC7J,EACH,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,IACzF,GACJ,CACH,CAAC;IACH,CAAC;CACD"}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.23",
11
+ "version": "1.4.25",
12
12
  "author": "Amir Abolhasani, Alireza Esmaeeli",
13
13
  "license": "MIT",
14
14
  "main": "./dist/main.js",
@@ -26,14 +26,14 @@
26
26
  "@types/react": "^18.3.10",
27
27
  "@types/react-bootstrap": "^0.32.37",
28
28
  "@types/react-dom": "^18.3.0",
29
- "antd": "^5.21.1",
29
+ "antd": "^5.21.2",
30
30
  "bootstrap": "^5.3.3",
31
31
  "chart.js": "^4.4.4",
32
32
  "copyfiles": "^2.4.1",
33
33
  "link-react": "^3.0.0",
34
34
  "namirasoft-api-link": "^1.4.5",
35
35
  "namirasoft-api-product": "^1.4.5",
36
- "namirasoft-core": "^1.4.8",
36
+ "namirasoft-core": "^1.4.11",
37
37
  "path-browserify": "^1.0.1",
38
38
  "react": "^18.3.1",
39
39
  "react-app-rewired": "^2.2.1",
@@ -14,19 +14,23 @@
14
14
  }
15
15
 
16
16
  .ns_checkbox_parent {
17
- border-radius: 8px;
17
+ width: 100%;
18
+ height: 48px;
18
19
  padding: 10px 12px 10px 12px;
20
+ background-color: #fff;
21
+ color: #141B5C;
22
+ border-radius: 8px;
23
+ border: 1px solid rgba(0, 0, 0, 1) !important;
19
24
  font-size: 16px;
20
25
  font-weight: 400;
21
- border: 1px solid rgba(0, 0, 0, 1) !important;
22
- background-color: #fff;
26
+ font-family: inherit;
27
+ cursor: pointer;
23
28
  position: relative;
24
- width: 100%;
25
29
  display: flex;
26
30
  flex-direction: row;
27
31
  justify-content: left;
28
32
  align-items: center;
29
- height: 48px;
33
+ gap: 4px;
30
34
  }
31
35
 
32
36
  .ns_input {
@@ -39,14 +43,6 @@
39
43
  accent-color: #141B5C;
40
44
  }
41
45
 
42
- label.ns_checkbox_parent {
43
- cursor: pointer;
44
- color: #141B5C;
45
- font-size: 16px;
46
- font-weight: 300;
47
- font-family: inherit;
48
- }
49
-
50
46
  @media only screen and (min-width: 380px) {
51
47
  .ns_input_parent {
52
48
  max-width: 272px;
@@ -15,6 +15,7 @@ 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;
18
19
  }
19
20
 
20
21
  export interface INSBoxIntegerState
@@ -55,11 +56,24 @@ export class NSBoxInteger extends React.Component<INSBoxIntegerProps, INSBoxInte
55
56
  }
56
57
  setValue(value: number | undefined): void
57
58
  {
58
- this.setState({ value }, () =>
59
+ if (this.props.isPositiveValue)
59
60
  {
60
- if (this.props.onChanged)
61
- this.props.onChanged(this);
62
- });
61
+ if (value)
62
+ if (value > 0)
63
+ this.setState({ value }, () =>
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
+ });
63
77
  }
64
78
  private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
65
79
  {
@@ -81,8 +95,8 @@ export class NSBoxInteger extends React.Component<INSBoxIntegerProps, INSBoxInte
81
95
  onClick={() => this.props.onClicked}
82
96
  style={{ background: `url("https://static.namirasoft.com/image/concept/nsbox/Integer.png") white no-repeat scroll center right 16px`, backgroundSize: "24px" }}
83
97
  />
84
- </div>
85
98
  <NSBoxErrorNotifier error={this.state.error} clearError={() => this.setState({ error: "" })} />
99
+ </div>
86
100
  </>
87
101
  );
88
102
  }