namirasoft-site-react 1.3.114 → 1.3.116
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 -1
- package/dist/App.js.map +1 -1
- package/dist/components/NSBoxBoolean.d.ts +23 -0
- package/dist/components/NSBoxBoolean.js +41 -0
- package/dist/components/NSBoxBoolean.js.map +1 -0
- package/dist/components/NSBoxBoolean.module.css +55 -0
- package/dist/main.d.ts +3 -3
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
- package/src/App.tsx +8 -2
- package/src/components/NSBoxBoolean.module.css +55 -0
- package/src/components/NSBoxBoolean.tsx +89 -0
- package/src/main.ts +3 -3
package/dist/App.js
CHANGED
|
@@ -5,6 +5,7 @@ import { NSBoxIPV4, NSTable } from './main';
|
|
|
5
5
|
import { useRef } from 'react';
|
|
6
6
|
import { NSLayoutAction } from './components/NSLayoutAction';
|
|
7
7
|
import { NSBoxIPV6 } from './components/NSBoxIPV6';
|
|
8
|
+
import { NSBoxBoolean } from './components/NSBoxBoolean';
|
|
8
9
|
const actions = [
|
|
9
10
|
{
|
|
10
11
|
group: "test-1",
|
|
@@ -83,6 +84,6 @@ export function App() {
|
|
|
83
84
|
return row[column];
|
|
84
85
|
}
|
|
85
86
|
function onChange() { }
|
|
86
|
-
return (_jsx(_Fragment, { children: _jsxs(NSLayoutAction, { notifications: [], actions: actions, title: 'Test', description: 'Lorem lorem orem Lorem lorem orem Lorem lorem orem Lorem lorem orem Lorem lorem orem Lorem lorem orem ', scope: 'Namirasoft Account Console', logo: 'https://static.namirasoft.com/image/namirasoft/site/logo/base.png', children: [_jsx("div", { children: _jsx(NSTable, { ref: table, columns: columns, rows: rows, getCell: getCell, getColumnAttributes: () => { return {}; }, getRowKey: row => row.id.toString(), onChanged: onChange }) }), _jsx(NSBoxIPV6, { title: 'IPV6', required: false }), _jsx(NSBoxIPV4, { title: 'IPV4', required: false })] }) }));
|
|
87
|
+
return (_jsx(_Fragment, { children: _jsxs(NSLayoutAction, { notifications: [], actions: actions, title: 'Test', description: 'Lorem lorem orem Lorem lorem orem Lorem lorem orem Lorem lorem orem Lorem lorem orem Lorem lorem orem ', scope: 'Namirasoft Account Console', logo: 'https://static.namirasoft.com/image/namirasoft/site/logo/base.png', children: [_jsx("div", { children: _jsx(NSTable, { ref: table, columns: columns, rows: rows, getCell: getCell, getColumnAttributes: () => { return {}; }, getRowKey: row => row.id.toString(), onChanged: onChange }) }), _jsx(NSBoxIPV6, { title: 'IPV6', required: false }), _jsx(NSBoxIPV4, { title: 'IPV4', required: false }), _jsx(NSBoxBoolean, { title: 'I4', required: false, name: 'salam ' })] }) }));
|
|
87
88
|
}
|
|
88
89
|
//# 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,SAAS,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"App.js","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":";AAAA,OAAO,WAAW,CAAC;AACnB,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,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C;YAClD,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,SAAS;SACjB;QACD;YACC,EAAE,EAAE,CAAC;YACL,OAAO,EAAE,oBAAoB;YAC7B,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,yCAAyC;YAClD,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,MAAM;SACd;KACA,CAAA;IAUD,SAAS,OAAO,CAAC,GAAQ,EAAE,MAAc;QAExC,OAAQ,GAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IACD,SAAS,QAAQ,KACf,CAAC;IAEH,OAAO,CACN,4BACC,MAAC,cAAc,IACd,aAAa,EAAE,EAAE,EACjB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAC,MAAM,EACZ,WAAW,EAAC,wGAAwG,EACpH,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,mEAAmE,aAExE,wBACC,KAAC,OAAO,IACP,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,mBAAmB,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,CAAA,CAAC,CAAC,EACxC,SAAS,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,EACnC,SAAS,EAAE,QAAQ,GAClB,GACG,EACN,KAAC,SAAS,IACT,KAAK,EAAC,MAAM,EACZ,QAAQ,EAAE,KAAK,GACd,EAEF,KAAC,SAAS,IACT,KAAK,EAAC,MAAM,EACZ,QAAQ,EAAE,KAAK,GACd,EAEF,KAAC,YAAY,IACZ,KAAK,EAAC,IAAI,EACV,QAAQ,EAAE,KAAK,EACf,IAAI,EAAC,QAAQ,GACZ,IACc,GACf,CACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
3
|
+
import { IValidationProps } from "../props/IValidationProps";
|
|
4
|
+
import { IValidationStringProps } from "../props/IValidationStringProps";
|
|
5
|
+
export interface INSBoxBooleanProps extends IBaseComponentProps, IValidationProps, IValidationStringProps {
|
|
6
|
+
title: string;
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface INSBoxBooelanState {
|
|
13
|
+
value: string;
|
|
14
|
+
error?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class NSBoxBoolean extends React.Component<INSBoxBooleanProps, INSBoxBooelanState> {
|
|
17
|
+
constructor(props: INSBoxBooleanProps);
|
|
18
|
+
getError(): string | null;
|
|
19
|
+
getValue(): string;
|
|
20
|
+
setValue(value: string): void;
|
|
21
|
+
private onChanged;
|
|
22
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import Styles from "./NSBoxBoolean.module.css";
|
|
5
|
+
import { Validator } from "../Validator";
|
|
6
|
+
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
7
|
+
export class NSBoxBoolean extends React.Component {
|
|
8
|
+
constructor(props) {
|
|
9
|
+
var _a;
|
|
10
|
+
super(props);
|
|
11
|
+
this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "" };
|
|
12
|
+
this.getValue = this.getValue.bind(this);
|
|
13
|
+
this.setValue = this.setValue.bind(this);
|
|
14
|
+
this.onChanged = this.onChanged.bind(this);
|
|
15
|
+
}
|
|
16
|
+
getError() {
|
|
17
|
+
return (Validator.getError(this.props.title, this.state.value, this.props) &&
|
|
18
|
+
Validator.getErrorString(this.props.title, this.state.value, this.props));
|
|
19
|
+
}
|
|
20
|
+
getValue() {
|
|
21
|
+
let error = this.getError();
|
|
22
|
+
if (error) {
|
|
23
|
+
this.setState({ error });
|
|
24
|
+
throw new Error(error);
|
|
25
|
+
}
|
|
26
|
+
return this.state.value;
|
|
27
|
+
}
|
|
28
|
+
setValue(value) {
|
|
29
|
+
this.setState({ value });
|
|
30
|
+
}
|
|
31
|
+
onChanged(e) {
|
|
32
|
+
this.setValue(e.target.value);
|
|
33
|
+
if (this.props.onChanged)
|
|
34
|
+
this.props.onChanged(e);
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
var _a;
|
|
38
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { 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, " "] }), _jsxs("div", { className: Styles.ns_checkbox_parent, children: [_jsx("input", { id: this.props.id, type: "checkbox", name: this.props.name, className: Styles.ns_input, value: this.state.value, onChange: this.onChanged }), _jsx("label", { className: "ns-font-16-normal", htmlFor: this.props.id, children: this.props.name })] })] }), _jsx(NSBoxErrorNotifier, { error: this.state.error })] }));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=NSBoxBoolean.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NSBoxBoolean.js","sourceRoot":"","sources":["../../src/components/NSBoxBoolean.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAI/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAiB1D,MAAM,OAAO,YAAa,SAAQ,KAAK,CAAC,SAAiD;IAExF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AAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;IACQ,MAAM;;QAEd,OAAO,CACN,8BACC,eAAK,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,aACtG,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,EAErI,eAAK,SAAS,EAAE,MAAM,CAAC,kBAAkB,aACxC,gBACC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EACjB,IAAI,EAAC,UAAU,EACf,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,SAAS,EAAE,MAAM,CAAC,QAAQ,EAC1B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,SAAS,GACvB,EACF,gBAAO,SAAS,EAAC,mBAAmB,EAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,YACzD,IAAI,CAAC,KAAK,CAAC,IAAI,GACT,IACH,IAED,EACN,KAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAI,IAC7C,CACH,CAAC;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.ns_input_parent {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: fit-content;
|
|
5
|
+
color: #141B5C;
|
|
6
|
+
position: relative;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ns_input_title {
|
|
11
|
+
font-size: 16px;
|
|
12
|
+
font-weight: 400;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ns_checkbox_parent {
|
|
16
|
+
border-radius: 8px;
|
|
17
|
+
padding: 10px 12px 10px 12px;
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
border: 1px solid rgba(0, 0, 0, 1) !important;
|
|
21
|
+
background-color: #fff;
|
|
22
|
+
position: relative;
|
|
23
|
+
width: 100%;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
justify-content: flex-start;
|
|
27
|
+
align-items: center;
|
|
28
|
+
gap: 8px;
|
|
29
|
+
height: 48px;
|
|
30
|
+
width: 100%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ns_input {
|
|
34
|
+
width: 24px;
|
|
35
|
+
height: 24px;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ns_input:checked {
|
|
40
|
+
accent-color: #141B5C;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ns_checkbox_parent label {
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
color: #141B5C;
|
|
46
|
+
font-size: 16px;
|
|
47
|
+
font-weight: 300;
|
|
48
|
+
font-family: inherit;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media only screen and (min-width: 380px) {
|
|
52
|
+
.ns_checkbox_parent {
|
|
53
|
+
width: 272px;
|
|
54
|
+
}
|
|
55
|
+
}
|
package/dist/main.d.ts
CHANGED
|
@@ -10,6 +10,9 @@ export * from "./components/NSBoxPassword";
|
|
|
10
10
|
export * from "./components/NSBoxPhone";
|
|
11
11
|
export * from "./components/NSBoxPrice";
|
|
12
12
|
export * from "./components/NSBoxString";
|
|
13
|
+
export * from "./components/NSBoxSearch";
|
|
14
|
+
export * from "./components/NSBoxText";
|
|
15
|
+
export * from "./components/NSBoxTime";
|
|
13
16
|
export * from "./components/NSButtonBlue";
|
|
14
17
|
export * from "./components/NSButtonGreen";
|
|
15
18
|
export * from "./components/NSButton";
|
|
@@ -20,9 +23,6 @@ export * from "./components/NSEntityBar";
|
|
|
20
23
|
export * from "./components/NSFooter";
|
|
21
24
|
export * from "./components/NSHeader";
|
|
22
25
|
export * from "./components/NSCopyToClipboard";
|
|
23
|
-
export * from "./components/NSBoxSearch";
|
|
24
|
-
export * from "./components/NSBoxText";
|
|
25
|
-
export * from "./components/NSBoxTime";
|
|
26
26
|
export * from "./components/NSLayout";
|
|
27
27
|
export * from "./components/NSLayoutAction";
|
|
28
28
|
export * from "./components/NSLayoutHeroBanner";
|
package/dist/main.js
CHANGED
|
@@ -10,6 +10,9 @@ export * from "./components/NSBoxPassword";
|
|
|
10
10
|
export * from "./components/NSBoxPhone";
|
|
11
11
|
export * from "./components/NSBoxPrice";
|
|
12
12
|
export * from "./components/NSBoxString";
|
|
13
|
+
export * from "./components/NSBoxSearch";
|
|
14
|
+
export * from "./components/NSBoxText";
|
|
15
|
+
export * from "./components/NSBoxTime";
|
|
13
16
|
export * from "./components/NSButtonBlue";
|
|
14
17
|
export * from "./components/NSButtonGreen";
|
|
15
18
|
export * from "./components/NSButton";
|
|
@@ -20,9 +23,6 @@ export * from "./components/NSEntityBar";
|
|
|
20
23
|
export * from "./components/NSFooter";
|
|
21
24
|
export * from "./components/NSHeader";
|
|
22
25
|
export * from "./components/NSCopyToClipboard";
|
|
23
|
-
export * from "./components/NSBoxSearch";
|
|
24
|
-
export * from "./components/NSBoxText";
|
|
25
|
-
export * from "./components/NSBoxTime";
|
|
26
26
|
export * from "./components/NSLayout";
|
|
27
27
|
export * from "./components/NSLayoutAction";
|
|
28
28
|
export * from "./components/NSLayoutHeroBanner";
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAA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AC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC"}
|
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { NSBoxIPV4, NSTable } from './main';
|
|
|
4
4
|
import { useRef } from 'react';
|
|
5
5
|
import { NSLayoutAction } from './components/NSLayoutAction';
|
|
6
6
|
import { NSBoxIPV6 } from './components/NSBoxIPV6';
|
|
7
|
+
import { NSBoxBoolean } from './components/NSBoxBoolean';
|
|
7
8
|
|
|
8
9
|
const actions = [
|
|
9
10
|
{
|
|
@@ -103,7 +104,7 @@ export function App()
|
|
|
103
104
|
return (row as any)[column];
|
|
104
105
|
}
|
|
105
106
|
function onChange(): void
|
|
106
|
-
{}
|
|
107
|
+
{ }
|
|
107
108
|
|
|
108
109
|
return (
|
|
109
110
|
<>
|
|
@@ -130,12 +131,17 @@ export function App()
|
|
|
130
131
|
title='IPV6'
|
|
131
132
|
required={false}
|
|
132
133
|
/>
|
|
133
|
-
|
|
134
|
+
|
|
134
135
|
<NSBoxIPV4
|
|
135
136
|
title='IPV4'
|
|
136
137
|
required={false}
|
|
137
138
|
/>
|
|
138
139
|
|
|
140
|
+
<NSBoxBoolean
|
|
141
|
+
title='I4'
|
|
142
|
+
required={false}
|
|
143
|
+
name='salam '
|
|
144
|
+
/>
|
|
139
145
|
</NSLayoutAction>
|
|
140
146
|
</>
|
|
141
147
|
);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.ns_input_parent {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: fit-content;
|
|
5
|
+
color: #141B5C;
|
|
6
|
+
position: relative;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ns_input_title {
|
|
11
|
+
font-size: 16px;
|
|
12
|
+
font-weight: 400;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ns_checkbox_parent {
|
|
16
|
+
border-radius: 8px;
|
|
17
|
+
padding: 10px 12px 10px 12px;
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
border: 1px solid rgba(0, 0, 0, 1) !important;
|
|
21
|
+
background-color: #fff;
|
|
22
|
+
position: relative;
|
|
23
|
+
width: 100%;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
justify-content: flex-start;
|
|
27
|
+
align-items: center;
|
|
28
|
+
gap: 8px;
|
|
29
|
+
height: 48px;
|
|
30
|
+
width: 100%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ns_input {
|
|
34
|
+
width: 24px;
|
|
35
|
+
height: 24px;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ns_input:checked {
|
|
40
|
+
accent-color: #141B5C;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ns_checkbox_parent label {
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
color: #141B5C;
|
|
46
|
+
font-size: 16px;
|
|
47
|
+
font-weight: 300;
|
|
48
|
+
font-family: inherit;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media only screen and (min-width: 380px) {
|
|
52
|
+
.ns_checkbox_parent {
|
|
53
|
+
width: 272px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import Styles from "./NSBoxBoolean.module.css";
|
|
5
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
6
|
+
import { IValidationProps } from "../props/IValidationProps";
|
|
7
|
+
import { IValidationStringProps } from "../props/IValidationStringProps";
|
|
8
|
+
import { Validator } from "../Validator";
|
|
9
|
+
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
10
|
+
|
|
11
|
+
export interface INSBoxBooleanProps extends IBaseComponentProps, IValidationProps, IValidationStringProps
|
|
12
|
+
{
|
|
13
|
+
title: string;
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
name?: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface INSBoxBooelanState
|
|
21
|
+
{
|
|
22
|
+
value: string;
|
|
23
|
+
error?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export class NSBoxBoolean extends React.Component<INSBoxBooleanProps, INSBoxBooelanState>
|
|
27
|
+
{
|
|
28
|
+
constructor(props: INSBoxBooleanProps)
|
|
29
|
+
{
|
|
30
|
+
super(props);
|
|
31
|
+
this.state = { value: props.defaultValue ?? "" };
|
|
32
|
+
this.getValue = this.getValue.bind(this);
|
|
33
|
+
this.setValue = this.setValue.bind(this);
|
|
34
|
+
this.onChanged = this.onChanged.bind(this);
|
|
35
|
+
}
|
|
36
|
+
getError(): string | null
|
|
37
|
+
{
|
|
38
|
+
return (
|
|
39
|
+
Validator.getError(this.props.title, this.state.value, this.props) &&
|
|
40
|
+
Validator.getErrorString(this.props.title, this.state.value, this.props)
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
getValue(): string
|
|
44
|
+
{
|
|
45
|
+
let error = this.getError();
|
|
46
|
+
if (error)
|
|
47
|
+
{
|
|
48
|
+
this.setState({ error });
|
|
49
|
+
throw new Error(error);
|
|
50
|
+
}
|
|
51
|
+
return this.state.value;
|
|
52
|
+
}
|
|
53
|
+
setValue(value: string): void
|
|
54
|
+
{
|
|
55
|
+
this.setState({ value });
|
|
56
|
+
}
|
|
57
|
+
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
58
|
+
{
|
|
59
|
+
this.setValue(e.target.value);
|
|
60
|
+
if (this.props.onChanged)
|
|
61
|
+
this.props.onChanged(e);
|
|
62
|
+
}
|
|
63
|
+
override render()
|
|
64
|
+
{
|
|
65
|
+
return (
|
|
66
|
+
<>
|
|
67
|
+
<div className={`${Styles.ns_input_parent} ${this.props.classList?.join(" ")}`} style={this.props.style}>
|
|
68
|
+
<span className={Styles.ns_input_title}> {this.props.required && <span style={{ color: "red" }} >*</span>} {this.props.title} </span>
|
|
69
|
+
|
|
70
|
+
<div className={Styles.ns_checkbox_parent} >
|
|
71
|
+
<input
|
|
72
|
+
id={this.props.id}
|
|
73
|
+
type="checkbox"
|
|
74
|
+
name={this.props.name}
|
|
75
|
+
className={Styles.ns_input}
|
|
76
|
+
value={this.state.value}
|
|
77
|
+
onChange={this.onChanged}
|
|
78
|
+
/>
|
|
79
|
+
<label className="ns-font-16-normal" htmlFor={this.props.id}>
|
|
80
|
+
{this.props.name}
|
|
81
|
+
</label>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
</div>
|
|
85
|
+
<NSBoxErrorNotifier error={this.state.error} />
|
|
86
|
+
</>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
}
|
package/src/main.ts
CHANGED
|
@@ -10,6 +10,9 @@ export * from "./components/NSBoxPassword";
|
|
|
10
10
|
export * from "./components/NSBoxPhone";
|
|
11
11
|
export * from "./components/NSBoxPrice";
|
|
12
12
|
export * from "./components/NSBoxString";
|
|
13
|
+
export * from "./components/NSBoxSearch";
|
|
14
|
+
export * from "./components/NSBoxText";
|
|
15
|
+
export * from "./components/NSBoxTime";
|
|
13
16
|
export * from "./components/NSButtonBlue";
|
|
14
17
|
export * from "./components/NSButtonGreen";
|
|
15
18
|
export * from "./components/NSButton";
|
|
@@ -20,9 +23,6 @@ export * from "./components/NSEntityBar";
|
|
|
20
23
|
export * from "./components/NSFooter";
|
|
21
24
|
export * from "./components/NSHeader";
|
|
22
25
|
export * from "./components/NSCopyToClipboard";
|
|
23
|
-
export * from "./components/NSBoxSearch";
|
|
24
|
-
export * from "./components/NSBoxText";
|
|
25
|
-
export * from "./components/NSBoxTime";
|
|
26
26
|
export * from "./components/NSLayout";
|
|
27
27
|
export * from "./components/NSLayoutAction";
|
|
28
28
|
export * from "./components/NSLayoutHeroBanner";
|