namirasoft-site-react 1.4.496 → 1.4.498
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/components/NSBox.module.css +20 -0
- package/dist/components/NSBoxBaseLayout.d.ts +2 -0
- package/dist/components/NSBoxBaseLayout.js +4 -5
- package/dist/components/NSBoxBaseLayout.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NSBox.module.css +20 -0
- package/src/components/NSBoxBaseLayout.tsx +5 -4
- package/dist/components/NSBoxBaseLayout.module.css +0 -18
- package/src/components/NSBoxBaseLayout.module.css +0 -18
|
@@ -49,10 +49,30 @@
|
|
|
49
49
|
display: flex;
|
|
50
50
|
align-items: center;
|
|
51
51
|
gap: 0.5rem;
|
|
52
|
+
background-color: #efefef;
|
|
52
53
|
font-size: 1rem;
|
|
53
54
|
color: #8e8e8e;
|
|
54
55
|
}
|
|
55
56
|
|
|
57
|
+
.ns_nullable_label {
|
|
58
|
+
margin-top: 0.5rem;
|
|
59
|
+
display: inline-flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 0.25rem;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ns_nullable_label span {
|
|
66
|
+
font-size: 0.875rem;
|
|
67
|
+
line-height: 1rem;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ns_nullable_checkbox {
|
|
71
|
+
width: 1rem;
|
|
72
|
+
height: 1rem;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
}
|
|
75
|
+
|
|
56
76
|
@media only screen and (min-width: 480px) {
|
|
57
77
|
.ns_box_input {
|
|
58
78
|
max-width: inherit;
|
|
@@ -17,6 +17,7 @@ export interface INSBoxBaseLayoutProps<Box, Data> {
|
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
loading?: boolean;
|
|
19
19
|
nullable?: boolean;
|
|
20
|
+
nullableDefaultValue?: boolean;
|
|
20
21
|
onNullableChanged?: () => void;
|
|
21
22
|
}
|
|
22
23
|
export interface NSBoxBaseLayoutProps extends IBaseComponentProps, IValidationProps, IValidationStringProps, NSMenuButtonProps {
|
|
@@ -28,6 +29,7 @@ export interface NSBoxBaseLayoutProps extends IBaseComponentProps, IValidationPr
|
|
|
28
29
|
disabled?: boolean;
|
|
29
30
|
loading?: boolean;
|
|
30
31
|
nullable?: boolean;
|
|
32
|
+
nullableDefaultValue?: boolean;
|
|
31
33
|
onNullableChanged?: () => void;
|
|
32
34
|
}
|
|
33
35
|
export interface NSBoxBaseLayoutState {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React, { createRef } from "react";
|
|
4
4
|
import StylesNSBox from "./NSBox.module.css";
|
|
5
|
-
import Styles from "./NSBoxBaseLayout.module.css";
|
|
6
5
|
import { NSLabelErrorNotifier } from "./NSLabelErrorNotifier";
|
|
7
6
|
import { NSLoading } from "./NSLoading";
|
|
8
7
|
import { NSMenuButton } from "./NSMenuButton";
|
|
@@ -12,13 +11,13 @@ export class NSBoxBaseLayout extends React.Component {
|
|
|
12
11
|
return (_b = (_a = box.NSBoxBaseLayout_Main.current) === null || _a === void 0 ? void 0 : _a._onGetValue(checkError, box.getError, handler)) !== null && _b !== void 0 ? _b : null;
|
|
13
12
|
}
|
|
14
13
|
constructor(props) {
|
|
15
|
-
var _a;
|
|
14
|
+
var _a, _b;
|
|
16
15
|
super(props);
|
|
17
16
|
this.NullableCheckBox_Ref = createRef();
|
|
18
17
|
this.state = {
|
|
19
18
|
error: "",
|
|
20
|
-
null: false,
|
|
21
|
-
disabled: (
|
|
19
|
+
null: (_a = this.props.nullableDefaultValue) !== null && _a !== void 0 ? _a : false,
|
|
20
|
+
disabled: (_b = this.props.disabled) !== null && _b !== void 0 ? _b : false
|
|
22
21
|
};
|
|
23
22
|
this._onGetValue = this._onGetValue.bind(this);
|
|
24
23
|
}
|
|
@@ -53,7 +52,7 @@ export class NSBoxBaseLayout extends React.Component {
|
|
|
53
52
|
_jsx("div", { className: StylesNSBox.ns_box_disabled, children: _jsx(NSLoading, { small: true, hideDesciption: true, hideTitle: true, hideContainer: true }) }), !this.state.null && !this.props.loading && this.state.disabled &&
|
|
54
53
|
_jsx("div", { className: StylesNSBox.ns_box_disabled, children: value }), !this.state.null && !this.props.loading && !this.state.disabled &&
|
|
55
54
|
this.props.children, this.props.nullable &&
|
|
56
|
-
_jsxs("label", { className:
|
|
55
|
+
_jsxs("label", { className: StylesNSBox.ns_nullable_label, children: [_jsx("input", { ref: this.NullableCheckBox_Ref, type: "checkbox", className: StylesNSBox.ns_nullable_checkbox, checked: this.state.null, onChange: e => {
|
|
57
56
|
var _a, _b;
|
|
58
57
|
this.setNull(e.target.checked);
|
|
59
58
|
(_b = (_a = this.props).onNullableChanged) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSBoxBaseLayout.js","sourceRoot":"","sources":["../../src/components/NSBoxBaseLayout.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAIpD,OAAO,WAAW,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"NSBoxBaseLayout.js","sourceRoot":"","sources":["../../src/components/NSBoxBaseLayout.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAIpD,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAA4C,MAAM,gBAAgB,CAAC;AAyCxF,MAAM,OAAO,eAAgB,SAAQ,KAAK,CAAC,SAAqD;IAG5F,MAAM,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ns_nullable_label {
|
|
58
|
+
margin-top: 0.5rem;
|
|
59
|
+
display: inline-flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 0.25rem;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ns_nullable_label span {
|
|
66
|
+
font-size: 0.875rem;
|
|
67
|
+
line-height: 1rem;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ns_nullable_checkbox {
|
|
71
|
+
width: 1rem;
|
|
72
|
+
height: 1rem;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
}
|
|
75
|
+
|
|
56
76
|
@media only screen and (min-width: 480px) {
|
|
57
77
|
.ns_box_input {
|
|
58
78
|
max-width: inherit;
|
|
@@ -4,7 +4,6 @@ import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
|
4
4
|
import { IValidationProps } from "../props/IValidationProps";
|
|
5
5
|
import { IValidationStringProps } from "../props/IValidationStringProps";
|
|
6
6
|
import StylesNSBox from "./NSBox.module.css";
|
|
7
|
-
import Styles from "./NSBoxBaseLayout.module.css";
|
|
8
7
|
import { NSInfoProps } from "./NSInfo";
|
|
9
8
|
import { NSLabelErrorNotifier } from "./NSLabelErrorNotifier";
|
|
10
9
|
import { NSLoading } from "./NSLoading";
|
|
@@ -24,6 +23,7 @@ export interface INSBoxBaseLayoutProps<Box, Data>
|
|
|
24
23
|
disabled?: boolean;
|
|
25
24
|
loading?: boolean;
|
|
26
25
|
nullable?: boolean;
|
|
26
|
+
nullableDefaultValue?: boolean;
|
|
27
27
|
onNullableChanged?: () => void;
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -37,6 +37,7 @@ export interface NSBoxBaseLayoutProps extends IBaseComponentProps, IValidationPr
|
|
|
37
37
|
disabled?: boolean;
|
|
38
38
|
loading?: boolean;
|
|
39
39
|
nullable?: boolean;
|
|
40
|
+
nullableDefaultValue?: boolean;
|
|
40
41
|
onNullableChanged?: () => void;
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -59,7 +60,7 @@ export class NSBoxBaseLayout extends React.Component<NSBoxBaseLayoutProps, NSBox
|
|
|
59
60
|
super(props);
|
|
60
61
|
this.state = {
|
|
61
62
|
error: "",
|
|
62
|
-
null: false,
|
|
63
|
+
null: this.props.nullableDefaultValue ?? false,
|
|
63
64
|
disabled: this.props.disabled ?? false
|
|
64
65
|
};
|
|
65
66
|
|
|
@@ -134,11 +135,11 @@ export class NSBoxBaseLayout extends React.Component<NSBoxBaseLayoutProps, NSBox
|
|
|
134
135
|
}
|
|
135
136
|
{
|
|
136
137
|
this.props.nullable &&
|
|
137
|
-
<label className={
|
|
138
|
+
<label className={StylesNSBox.ns_nullable_label}>
|
|
138
139
|
<input
|
|
139
140
|
ref={this.NullableCheckBox_Ref}
|
|
140
141
|
type="checkbox"
|
|
141
|
-
className={
|
|
142
|
+
className={StylesNSBox.ns_nullable_checkbox}
|
|
142
143
|
checked={this.state.null}
|
|
143
144
|
onChange={e =>
|
|
144
145
|
{
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
.ns_label {
|
|
2
|
-
margin-top: 0.5rem;
|
|
3
|
-
display: inline-flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
gap: 0.25rem;
|
|
6
|
-
cursor: pointer;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.ns_label span {
|
|
10
|
-
font-size: 0.875rem;
|
|
11
|
-
line-height: 1rem;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.ns_checkbox {
|
|
15
|
-
width: 1rem;
|
|
16
|
-
height: 1rem;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
.ns_label {
|
|
2
|
-
margin-top: 0.5rem;
|
|
3
|
-
display: inline-flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
gap: 0.25rem;
|
|
6
|
-
cursor: pointer;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.ns_label span {
|
|
10
|
-
font-size: 0.875rem;
|
|
11
|
-
line-height: 1rem;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.ns_checkbox {
|
|
15
|
-
width: 1rem;
|
|
16
|
-
height: 1rem;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
}
|