namirasoft-site-react 1.3.116 → 1.3.118
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/NSBoxEntity.d.ts +15 -2
- package/dist/components/NSBoxEntity.js +55 -3
- package/dist/components/NSBoxEntity.js.map +1 -1
- package/dist/components/NSBoxEnum.d.ts +19 -1
- package/dist/components/NSBoxEnum.js +60 -36
- package/dist/components/NSBoxEnum.js.map +1 -1
- package/dist/components/NSHeader.d.ts +2 -0
- package/dist/components/NSHeader.js +1 -1
- package/dist/components/NSHeader.js.map +1 -1
- package/dist/components/NSLayout.d.ts +2 -0
- package/dist/components/NSLayout.js +1 -1
- package/dist/components/NSLayout.js.map +1 -1
- package/dist/main.d.ts +4 -1
- package/dist/main.js +4 -1
- package/dist/main.js.map +1 -1
- package/package.json +2 -2
- package/src/components/NSBoxEntity.tsx +97 -11
- package/src/components/NSBoxEnum.tsx +104 -43
- package/src/components/NSHeader.tsx +7 -4
- package/src/components/NSLayout.tsx +3 -1
- package/src/main.ts +4 -1
- package/dist/components/NSSelectBox.d.ts +0 -25
- package/dist/components/NSSelectBox.js +0 -62
- package/dist/components/NSSelectBox.js.map +0 -1
- package/src/components/NSSelectBox.tsx +0 -115
- /package/dist/components/{NSSelectBox.module.css → NSBoxEnum.module.css} +0 -0
- /package/src/components/{NSSelectBox.module.css → NSBoxEnum.module.css} +0 -0
|
@@ -6,7 +6,20 @@ export interface INSBoxEntityProps extends IBaseComponentProps, IValidationProps
|
|
|
6
6
|
title: string;
|
|
7
7
|
options: SelectProps['options'];
|
|
8
8
|
multiple: boolean;
|
|
9
|
+
placeHolder?: string;
|
|
9
10
|
}
|
|
10
|
-
export
|
|
11
|
-
|
|
11
|
+
export interface INSBoxEntityState {
|
|
12
|
+
value: string | null;
|
|
13
|
+
values: string[];
|
|
14
|
+
error?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class NSBoxEntity extends React.Component<INSBoxEntityProps, INSBoxEntityState> {
|
|
17
|
+
constructor(props: INSBoxEntityProps);
|
|
18
|
+
getError(value: string): string | null;
|
|
19
|
+
getValue(): string | null;
|
|
20
|
+
getValues(): string[];
|
|
21
|
+
setValue(value: string | null): void;
|
|
22
|
+
setValues(values: string[]): void;
|
|
23
|
+
handleChange(value: string | null | string[]): void;
|
|
24
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
12
25
|
}
|
|
@@ -1,10 +1,62 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import
|
|
4
|
+
import Styles from "./NSSelectBox.module.css";
|
|
5
|
+
import { Select, Space } from 'antd';
|
|
6
|
+
import IconSelectBox from '../assets/images/icon-select-box.svg';
|
|
7
|
+
import { Validator } from "../Validator";
|
|
8
|
+
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
5
9
|
export class NSBoxEntity extends React.Component {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props);
|
|
12
|
+
this.state = {
|
|
13
|
+
value: null,
|
|
14
|
+
values: [],
|
|
15
|
+
};
|
|
16
|
+
this.getValues = this.getValues.bind(this);
|
|
17
|
+
this.setValues = this.setValues.bind(this);
|
|
18
|
+
this.setValue = this.setValue.bind(this);
|
|
19
|
+
this.getValue = this.getValue.bind(this);
|
|
20
|
+
this.handleChange = this.handleChange.bind(this);
|
|
21
|
+
}
|
|
22
|
+
getError(value) {
|
|
23
|
+
return (Validator.getError(this.props.title, value, this.props));
|
|
24
|
+
}
|
|
25
|
+
getValue() {
|
|
26
|
+
let error = this.getError(this.state.value || "");
|
|
27
|
+
if (error) {
|
|
28
|
+
this.setState({ error });
|
|
29
|
+
throw new Error(error);
|
|
30
|
+
}
|
|
31
|
+
return this.state.value;
|
|
32
|
+
}
|
|
33
|
+
getValues() {
|
|
34
|
+
this.state.values.forEach(value => {
|
|
35
|
+
let error = this.getError(value || "");
|
|
36
|
+
if (error) {
|
|
37
|
+
this.setState({ error });
|
|
38
|
+
throw new Error(error);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return this.state.values;
|
|
42
|
+
}
|
|
43
|
+
setValue(value) {
|
|
44
|
+
this.setState({ value });
|
|
45
|
+
}
|
|
46
|
+
setValues(values) {
|
|
47
|
+
this.setState({ values });
|
|
48
|
+
}
|
|
49
|
+
handleChange(value) {
|
|
50
|
+
if (this.props.multiple) {
|
|
51
|
+
this.setValues(value);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
this.setValue(value);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
6
57
|
render() {
|
|
7
|
-
|
|
58
|
+
var _a;
|
|
59
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `${Styles.ns_input_parent}`, children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx(Select, { mode: this.props.multiple ? "multiple" : undefined, style: { width: '100%' }, className: Styles.ns_input_select, placeholder: (_a = this.props.placeHolder) !== null && _a !== void 0 ? _a : "Combo Box", onChange: this.handleChange, optionLabelProp: "label", options: this.props.options, optionRender: (option) => (_jsx(Space, { className: Styles.ns_input_select_option, children: option.data.desc })), suffixIcon: _jsx("img", { src: IconSelectBox, alt: "SelectBox Icon" }) })] }), _jsx(NSBoxErrorNotifier, { error: this.state.error })] }));
|
|
8
60
|
}
|
|
9
61
|
}
|
|
10
62
|
//# sourceMappingURL=NSBoxEntity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSBoxEntity.js","sourceRoot":"","sources":["../../src/components/NSBoxEntity.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NSBoxEntity.js","source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AW,OAAG,IAAI,CAAC,KAAK,CAAC,KAAK,SAAS,EACrI,KAAC,MAAM,IACN,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAClD,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EACxB,SAAS,EAAE,MAAM,CAAC,eAAe,EACjC,WAAW,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,WAAW,mCAAI,WAAW,EAClD,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,eAAe,EAAC,OAAO,EACvB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CACzB,KAAC,KAAK,IAAC,SAAS,EAAE,MAAM,CAAC,sBAAsB,YAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,GACV,CACR,EACD,UAAU,EAAE,cAAK,GAAG,EAAE,aAAa,EAAE,GAAG,EAAC,gBAAgB,GAAG,GAC3D,IACG,EACN,KAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAI,IAC7C,CACH,CAAC;IACH,CAAC;CACD"}
|
|
@@ -1,7 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SelectProps } from 'antd';
|
|
1
3
|
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
2
4
|
import { IValidationProps } from "../props/IValidationProps";
|
|
3
5
|
export interface INSBoxEnumProps extends IBaseComponentProps, IValidationProps {
|
|
4
6
|
title: string;
|
|
7
|
+
options: SelectProps['options'];
|
|
5
8
|
multiple: boolean;
|
|
9
|
+
placeHolder?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface INSBoxEnumState {
|
|
12
|
+
value: string | null;
|
|
13
|
+
values: string[];
|
|
14
|
+
error?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class NSBoxEnum extends React.Component<INSBoxEnumProps, INSBoxEnumState> {
|
|
17
|
+
constructor(props: INSBoxEnumProps);
|
|
18
|
+
getError(value: string): string | null;
|
|
19
|
+
getValue(): string | null;
|
|
20
|
+
getValues(): string[];
|
|
21
|
+
setValue(value: string | null): void;
|
|
22
|
+
setValues(values: string[]): void;
|
|
23
|
+
handleChange(value: string | null | string[]): void;
|
|
24
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
6
25
|
}
|
|
7
|
-
export declare function NSBoxEnum(props: INSBoxEnumProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,38 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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 "./NSBoxEnum.module.css";
|
|
5
|
+
import { Select, Space } from 'antd';
|
|
6
|
+
import IconSelectBox from '../assets/images/icon-select-box.svg';
|
|
7
|
+
import { Validator } from "../Validator";
|
|
8
|
+
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
9
|
+
export class NSBoxEnum extends React.Component {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props);
|
|
12
|
+
this.state = {
|
|
13
|
+
value: null,
|
|
14
|
+
values: [],
|
|
15
|
+
};
|
|
16
|
+
this.getValues = this.getValues.bind(this);
|
|
17
|
+
this.setValues = this.setValues.bind(this);
|
|
18
|
+
this.setValue = this.setValue.bind(this);
|
|
19
|
+
this.getValue = this.getValue.bind(this);
|
|
20
|
+
this.handleChange = this.handleChange.bind(this);
|
|
21
|
+
}
|
|
22
|
+
getError(value) {
|
|
23
|
+
return (Validator.getError(this.props.title, value, this.props));
|
|
24
|
+
}
|
|
25
|
+
getValue() {
|
|
26
|
+
let error = this.getError(this.state.value || "");
|
|
27
|
+
if (error) {
|
|
28
|
+
this.setState({ error });
|
|
29
|
+
throw new Error(error);
|
|
30
|
+
}
|
|
31
|
+
return this.state.value;
|
|
32
|
+
}
|
|
33
|
+
getValues() {
|
|
34
|
+
this.state.values.forEach(value => {
|
|
35
|
+
let error = this.getError(value || "");
|
|
36
|
+
if (error) {
|
|
37
|
+
this.setState({ error });
|
|
38
|
+
throw new Error(error);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return this.state.values;
|
|
42
|
+
}
|
|
43
|
+
setValue(value) {
|
|
44
|
+
this.setState({ value });
|
|
45
|
+
}
|
|
46
|
+
setValues(values) {
|
|
47
|
+
this.setState({ values });
|
|
48
|
+
}
|
|
49
|
+
handleChange(value) {
|
|
50
|
+
if (this.props.multiple) {
|
|
51
|
+
this.setValues(value);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
this.setValue(value);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
var _a;
|
|
59
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `${Styles.ns_input_parent}`, children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx(Select, { mode: this.props.multiple ? "multiple" : undefined, style: { width: '100%' }, className: Styles.ns_input_select, placeholder: (_a = this.props.placeHolder) !== null && _a !== void 0 ? _a : "Combo Box", onChange: this.handleChange, optionLabelProp: "label", options: this.props.options, optionRender: (option) => (_jsx(Space, { className: Styles.ns_input_select_option, children: option.data.desc })), suffixIcon: _jsx("img", { src: IconSelectBox, alt: "SelectBox Icon" }) })] }), _jsx(NSBoxErrorNotifier, { error: this.state.error })] }));
|
|
60
|
+
}
|
|
37
61
|
}
|
|
38
62
|
//# sourceMappingURL=NSBoxEnum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSBoxEnum.js","sourceRoot":"","sources":["../../src/components/NSBoxEnum.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"NSBoxEnum.js","sourceRoot":"","sources":["../../src/components/NSBoxEnum.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,aAAa,MAAM,sCAAsC,CAAC;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAiB1D,MAAM,OAAO,SAAU,SAAQ,KAAK,CAAC,SAA2C;IAE/E,YAAY,KAAsB;QAEjC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACZ,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,EAAE;SACV,CAAC;QACF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,IAAI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= nav.style) === null || _a === void 0 ? void 0 : _a.backgroundColor))
|
|
46
46
|
nav.style.backgroundColor = "rgba(20, 27, 92, 1)";
|
|
47
47
|
return (_jsx("header", { id: this.props.id, className: `${Styles.ns_header} ${(_b = this.props.classList) === null || _b === void 0 ? void 0 : _b.join(" ")}`, style: this.props.style, children: _jsx("nav", { id: (_c = this.props.nav) === null || _c === void 0 ? void 0 : _c.id, className: `${Styles.ns_navbar} ${(_e = (_d = this.props.nav) === null || _d === void 0 ? void 0 : _d.classList) === null || _e === void 0 ? void 0 : _e.join(" ")}`, style: nav === null || nav === void 0 ? void 0 : nav.style, children: _jsxs("div", { className: `${Styles.ns_navbar_parent_content} container`, children: [_jsx("a", { href: "/", children: _jsx("img", { src: this.props.logo, alt: "Logo", width: 48, height: 48 }) }), _jsxs("div", { className: `${Styles.ns_navbar_content} `, children: [_jsx("div", { className: `${Styles.ns_navbar_elements} ${this.state.showNavbar && Styles.ns_navbar_active}`, children: this.render_menu(0, null) }), this.props.account &&
|
|
48
|
-
_jsxs("div", { className: `${Styles.ns_navbar_login_status}`, children: [_jsx("span", { className: `${Styles.ns_navbar_usersname}`, children: "name" }), _jsx("img", { src: 'https://static.namirasoft.com/image/concept/logout/white.svg', alt: "Exit", width: 24, height: 24 })] }), _jsxs("div", { className: "d-flex gap-3 align-items-center", children: [_jsx("span", { className: Styles.ns_navbar_username, children:
|
|
48
|
+
_jsxs("div", { className: `${Styles.ns_navbar_login_status}`, children: [_jsx("span", { className: `${Styles.ns_navbar_usersname}`, children: "name" }), _jsx("img", { src: 'https://static.namirasoft.com/image/concept/logout/white.svg', alt: "Exit", width: 24, height: 24 })] }), _jsxs("div", { className: "d-flex gap-3 align-items-center", children: [_jsx("span", { className: Styles.ns_navbar_username, children: this.props.user_name }), _jsx("div", { className: Styles.ns_navbar_notification, children: _jsx("span", { className: Styles.ns_navbar_notification_count, children: "1" }) }), _jsx("img", { src: Logout, alt: "Logout", width: 20, height: 20, onClick: this.props.logout })] }), _jsx("div", { className: Styles.ns_navbar_menu_icon, onClick: this.handleShowNavbar, children: _jsx("img", { src: this.state.showNavbar ?
|
|
49
49
|
"https://static.namirasoft.com/image/concept/close/white.svg"
|
|
50
50
|
: "https://static.namirasoft.com/image/concept/menu/burger-white.svg", alt: "Menu Icon", width: 24, height: 24 }) })] })] }) }) }));
|
|
51
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSHeader.js","sourceRoot":"","sources":["../../src/components/NSHeader.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAiB,MAAM,qBAAqB,CAAC;AAE7E,OAAO,MAAM,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"NSHeader.js","sourceRoot":"","sources":["../../src/components/NSHeader.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAiB,MAAM,qBAAqB,CAAC;AAE7E,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAmBtD,MAAM,OAAO,QAAS,SAAQ,KAAK,CAAC,SAAwC;IAExE,YAAY,KAAqB;QAE7B,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACT,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,KAAK;SACpB,CAAC;QACF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,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-7,5 +7,7 @@ export interface INSLayoutProps extends IBaseComponentProps {
|
|
|
7
7
|
background?: string;
|
|
8
8
|
notifications: INSNotificationProps[];
|
|
9
9
|
children: ReactNode;
|
|
10
|
+
user_name?: string;
|
|
11
|
+
logout?: () => void;
|
|
10
12
|
}
|
|
11
13
|
export declare function NSLayout(props: INSLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,6 +5,6 @@ import { NSFooter } from './NSFooter';
|
|
|
5
5
|
import { NSNotification } from './NSNotification';
|
|
6
6
|
export function NSLayout(props) {
|
|
7
7
|
var _a;
|
|
8
|
-
return (_jsxs("div", { id: props.id, className: `${Styles.ns_container} ${(_a = props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: props.style, children: [_jsx(NSHeader, { scope: props.scope, name: "Header", logo: props.logo }), props.notifications.map(props => _jsx(NSNotification, Object.assign({}, props))), _jsx("main", { className: `d-flex flex-column text-white px-3 ${Styles.ns_layout_main}`, style: { background: props.background, backgroundAttachment: "fixed" }, children: props.children }), _jsx(NSFooter, { scope: props.scope, name: "Footer", logo: props.logo })] }));
|
|
8
|
+
return (_jsxs("div", { id: props.id, className: `${Styles.ns_container} ${(_a = props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: props.style, children: [_jsx(NSHeader, { scope: props.scope, name: "Header", logo: props.logo, user_name: props.user_name, logout: props.logout }), props.notifications.map(props => _jsx(NSNotification, Object.assign({}, props))), _jsx("main", { className: `d-flex flex-column text-white px-3 ${Styles.ns_layout_main}`, style: { background: props.background, backgroundAttachment: "fixed" }, children: props.children }), _jsx(NSFooter, { scope: props.scope, name: "Footer", logo: props.logo })] }));
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=NSLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSLayout.js","sourceRoot":"","sources":["../../src/components/NSLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C,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E,KAAK,CAAC,IAAI,GAAI,IAC1D,CACP,CAAC;AACH,CAAC"}
|
package/dist/main.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
export * from "./components/NSBoxBoolean";
|
|
1
2
|
export * from "./components/NSBoxDate";
|
|
3
|
+
export * from "./components/NSBoxDateTime";
|
|
2
4
|
export * from "./components/NSBoxDouble";
|
|
3
5
|
export * from "./components/NSBoxDuration";
|
|
4
6
|
export * from "./components/NSBoxEmail";
|
|
7
|
+
export * from "./components/NSBoxEntity";
|
|
8
|
+
export * from "./components/NSBoxEnum";
|
|
5
9
|
export * from "./components/NSBoxErrorNotifier";
|
|
6
10
|
export * from "./components/NSBoxInteger";
|
|
7
11
|
export * from "./components/NSBoxIPV4";
|
|
@@ -29,7 +33,6 @@ export * from "./components/NSLayoutHeroBanner";
|
|
|
29
33
|
export * from "./components/NSLayoutTitle";
|
|
30
34
|
export * from "./components/NSLoading";
|
|
31
35
|
export * from "./components/NSNotification";
|
|
32
|
-
export * from "./components/NSSelectBox";
|
|
33
36
|
export * from "./components/NSSpace";
|
|
34
37
|
export * from "./components/NSSection";
|
|
35
38
|
export * from "./components/NSSectionBars";
|
package/dist/main.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
export * from "./components/NSBoxBoolean";
|
|
1
2
|
export * from "./components/NSBoxDate";
|
|
3
|
+
export * from "./components/NSBoxDateTime";
|
|
2
4
|
export * from "./components/NSBoxDouble";
|
|
3
5
|
export * from "./components/NSBoxDuration";
|
|
4
6
|
export * from "./components/NSBoxEmail";
|
|
7
|
+
export * from "./components/NSBoxEntity";
|
|
8
|
+
export * from "./components/NSBoxEnum";
|
|
5
9
|
export * from "./components/NSBoxErrorNotifier";
|
|
6
10
|
export * from "./components/NSBoxInteger";
|
|
7
11
|
export * from "./components/NSBoxIPV4";
|
|
@@ -29,7 +33,6 @@ export * from "./components/NSLayoutHeroBanner";
|
|
|
29
33
|
export * from "./components/NSLayoutTitle";
|
|
30
34
|
export * from "./components/NSLoading";
|
|
31
35
|
export * from "./components/NSNotification";
|
|
32
|
-
export * from "./components/NSSelectBox";
|
|
33
36
|
export * from "./components/NSSpace";
|
|
34
37
|
export * from "./components/NSSection";
|
|
35
38
|
export * from "./components/NSSectionBars";
|
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,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qCAAqC,CAAC;AACpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;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,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cA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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
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"framework": "npm",
|
|
9
9
|
"application": "package",
|
|
10
10
|
"private": false,
|
|
11
|
-
"version": "1.3.
|
|
11
|
+
"version": "1.3.118",
|
|
12
12
|
"author": "Amir Abolhasani, Alireza Esmaeeli, Sepideh Mazloumi, Hooman Shashaeh",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "./dist/main.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"copy": "copyfiles -u 1 src/**/*.html src/**/*.css src/**/*.svg src/**/*.png src/**/*.jpg dist/"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@types/node": "^20.12.
|
|
24
|
+
"@types/node": "^20.12.10",
|
|
25
25
|
"@types/react": "^18.3.1",
|
|
26
26
|
"@types/react-dom": "^18.3.0",
|
|
27
27
|
"antd": "^5.17.0",
|
|
@@ -1,29 +1,115 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import Styles from "./NSSelectBox.module.css";
|
|
4
|
+
import { Select, Space } from 'antd';
|
|
3
5
|
import type { SelectProps } from 'antd';
|
|
6
|
+
import IconSelectBox from '../assets/images/icon-select-box.svg';
|
|
4
7
|
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
5
8
|
import { IValidationProps } from "../props/IValidationProps";
|
|
6
|
-
import {
|
|
9
|
+
import { Validator } from "../Validator";
|
|
10
|
+
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
7
11
|
|
|
8
12
|
export interface INSBoxEntityProps extends IBaseComponentProps, IValidationProps
|
|
9
13
|
{
|
|
10
14
|
title: string;
|
|
11
15
|
options: SelectProps['options'];
|
|
12
16
|
multiple: boolean;
|
|
17
|
+
placeHolder?: string;
|
|
13
18
|
}
|
|
14
19
|
|
|
15
|
-
export
|
|
20
|
+
export interface INSBoxEntityState
|
|
16
21
|
{
|
|
17
|
-
|
|
22
|
+
value: string | null;
|
|
23
|
+
values: string[];
|
|
24
|
+
error?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export class NSBoxEntity extends React.Component<INSBoxEntityProps, INSBoxEntityState>
|
|
28
|
+
{
|
|
29
|
+
constructor(props: INSBoxEntityProps)
|
|
30
|
+
{
|
|
31
|
+
super(props);
|
|
32
|
+
this.state = {
|
|
33
|
+
value: null,
|
|
34
|
+
values: [],
|
|
35
|
+
};
|
|
36
|
+
this.getValues = this.getValues.bind(this);
|
|
37
|
+
this.setValues = this.setValues.bind(this);
|
|
38
|
+
this.setValue = this.setValue.bind(this);
|
|
39
|
+
this.getValue = this.getValue.bind(this);
|
|
40
|
+
this.handleChange = this.handleChange.bind(this);
|
|
41
|
+
}
|
|
42
|
+
getError(value: string): string | null
|
|
43
|
+
{
|
|
44
|
+
return (
|
|
45
|
+
Validator.getError(this.props.title, value, this.props)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
getValue(): string | null
|
|
49
|
+
{
|
|
50
|
+
let error = this.getError(this.state.value || "");
|
|
51
|
+
if (error)
|
|
52
|
+
{
|
|
53
|
+
this.setState({ error });
|
|
54
|
+
throw new Error(error);
|
|
55
|
+
}
|
|
56
|
+
return this.state.value;
|
|
57
|
+
}
|
|
58
|
+
getValues(): string[]
|
|
59
|
+
{
|
|
60
|
+
this.state.values.forEach(value =>
|
|
61
|
+
{
|
|
62
|
+
let error = this.getError(value || "");
|
|
63
|
+
if (error)
|
|
64
|
+
{
|
|
65
|
+
this.setState({ error });
|
|
66
|
+
throw new Error(error);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
return this.state.values;
|
|
70
|
+
}
|
|
71
|
+
setValue(value: string | null): void
|
|
72
|
+
{
|
|
73
|
+
this.setState({ value });
|
|
74
|
+
}
|
|
75
|
+
setValues(values: string[]): void
|
|
76
|
+
{
|
|
77
|
+
this.setState({ values });
|
|
78
|
+
}
|
|
79
|
+
handleChange(value: string | null | string[]): void
|
|
80
|
+
{
|
|
81
|
+
if (this.props.multiple)
|
|
82
|
+
{
|
|
83
|
+
this.setValues(value as string[]);
|
|
84
|
+
} else
|
|
85
|
+
{
|
|
86
|
+
this.setValue(value as string | null);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
override render()
|
|
18
90
|
{
|
|
19
91
|
return (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
92
|
+
<>
|
|
93
|
+
<div className={`${Styles.ns_input_parent}`}>
|
|
94
|
+
<span className={Styles.ns_input_title}> {this.props.required && <span style={{ color: "red" }} >*</span>} {this.props.title} </span>
|
|
95
|
+
<Select
|
|
96
|
+
mode={this.props.multiple ? "multiple" : undefined}
|
|
97
|
+
style={{ width: '100%' }}
|
|
98
|
+
className={Styles.ns_input_select}
|
|
99
|
+
placeholder={this.props.placeHolder ?? "Combo Box"}
|
|
100
|
+
onChange={this.handleChange}
|
|
101
|
+
optionLabelProp="label"
|
|
102
|
+
options={this.props.options}
|
|
103
|
+
optionRender={(option) => (
|
|
104
|
+
<Space className={Styles.ns_input_select_option}>
|
|
105
|
+
{option.data.desc}
|
|
106
|
+
</Space>
|
|
107
|
+
)}
|
|
108
|
+
suffixIcon={<img src={IconSelectBox} alt="SelectBox Icon" />}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
<NSBoxErrorNotifier error={this.state.error} />
|
|
112
|
+
</>
|
|
113
|
+
);
|
|
28
114
|
}
|
|
29
115
|
}
|
|
@@ -1,54 +1,115 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import Styles from "./NSBoxEnum.module.css";
|
|
4
|
+
import { Select, Space } from 'antd';
|
|
5
|
+
import type { SelectProps } from 'antd';
|
|
6
|
+
import IconSelectBox from '../assets/images/icon-select-box.svg';
|
|
1
7
|
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
2
8
|
import { IValidationProps } from "../props/IValidationProps";
|
|
3
|
-
import {
|
|
9
|
+
import { Validator } from "../Validator";
|
|
10
|
+
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
4
11
|
|
|
5
|
-
const options = [
|
|
6
|
-
{
|
|
7
|
-
date: {
|
|
8
|
-
desc : "test"
|
|
9
|
-
},
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
date: {
|
|
13
|
-
desc : "test"
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
date: {
|
|
18
|
-
desc : "test"
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
date: {
|
|
23
|
-
desc : "test"
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
date: {
|
|
28
|
-
desc : "test"
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
date: {
|
|
33
|
-
desc : "test"
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
]
|
|
37
12
|
export interface INSBoxEnumProps extends IBaseComponentProps, IValidationProps
|
|
38
13
|
{
|
|
39
14
|
title: string;
|
|
15
|
+
options: SelectProps['options'];
|
|
40
16
|
multiple: boolean;
|
|
17
|
+
placeHolder?: string;
|
|
41
18
|
}
|
|
42
19
|
|
|
43
|
-
export
|
|
20
|
+
export interface INSBoxEnumState
|
|
44
21
|
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
22
|
+
value: string | null;
|
|
23
|
+
values: string[];
|
|
24
|
+
error?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export class NSBoxEnum extends React.Component<INSBoxEnumProps, INSBoxEnumState>
|
|
28
|
+
{
|
|
29
|
+
constructor(props: INSBoxEnumProps)
|
|
30
|
+
{
|
|
31
|
+
super(props);
|
|
32
|
+
this.state = {
|
|
33
|
+
value: null,
|
|
34
|
+
values: [],
|
|
35
|
+
};
|
|
36
|
+
this.getValues = this.getValues.bind(this);
|
|
37
|
+
this.setValues = this.setValues.bind(this);
|
|
38
|
+
this.setValue = this.setValue.bind(this);
|
|
39
|
+
this.getValue = this.getValue.bind(this);
|
|
40
|
+
this.handleChange = this.handleChange.bind(this);
|
|
41
|
+
}
|
|
42
|
+
getError(value: string): string | null
|
|
43
|
+
{
|
|
44
|
+
return (
|
|
45
|
+
Validator.getError(this.props.title, value, this.props)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
getValue(): string | null
|
|
49
|
+
{
|
|
50
|
+
let error = this.getError(this.state.value || "");
|
|
51
|
+
if (error)
|
|
52
|
+
{
|
|
53
|
+
this.setState({ error });
|
|
54
|
+
throw new Error(error);
|
|
55
|
+
}
|
|
56
|
+
return this.state.value;
|
|
57
|
+
}
|
|
58
|
+
getValues(): string[]
|
|
59
|
+
{
|
|
60
|
+
this.state.values.forEach(value =>
|
|
61
|
+
{
|
|
62
|
+
let error = this.getError(value || "");
|
|
63
|
+
if (error)
|
|
64
|
+
{
|
|
65
|
+
this.setState({ error });
|
|
66
|
+
throw new Error(error);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
return this.state.values;
|
|
70
|
+
}
|
|
71
|
+
setValue(value: string | null): void
|
|
72
|
+
{
|
|
73
|
+
this.setState({ value });
|
|
74
|
+
}
|
|
75
|
+
setValues(values: string[]): void
|
|
76
|
+
{
|
|
77
|
+
this.setState({ values });
|
|
78
|
+
}
|
|
79
|
+
handleChange(value: string | null | string[]): void
|
|
80
|
+
{
|
|
81
|
+
if (this.props.multiple)
|
|
82
|
+
{
|
|
83
|
+
this.setValues(value as string[]);
|
|
84
|
+
} else
|
|
85
|
+
{
|
|
86
|
+
this.setValue(value as string | null);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
override render()
|
|
90
|
+
{
|
|
91
|
+
return (
|
|
92
|
+
<>
|
|
93
|
+
<div className={`${Styles.ns_input_parent}`}>
|
|
94
|
+
<span className={Styles.ns_input_title}> {this.props.required && <span style={{ color: "red" }} >*</span>} {this.props.title} </span>
|
|
95
|
+
<Select
|
|
96
|
+
mode={this.props.multiple ? "multiple" : undefined}
|
|
97
|
+
style={{ width: '100%' }}
|
|
98
|
+
className={Styles.ns_input_select}
|
|
99
|
+
placeholder={this.props.placeHolder ?? "Combo Box"}
|
|
100
|
+
onChange={this.handleChange}
|
|
101
|
+
optionLabelProp="label"
|
|
102
|
+
options={this.props.options}
|
|
103
|
+
optionRender={(option) => (
|
|
104
|
+
<Space className={Styles.ns_input_select_option}>
|
|
105
|
+
{option.data.desc}
|
|
106
|
+
</Space>
|
|
107
|
+
)}
|
|
108
|
+
suffixIcon={<img src={IconSelectBox} alt="SelectBox Icon" />}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
<NSBoxErrorNotifier error={this.state.error} />
|
|
112
|
+
</>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
54
115
|
}
|
|
@@ -12,7 +12,9 @@ export interface INSHeaderProps extends IBaseComponentProps
|
|
|
12
12
|
name: string;
|
|
13
13
|
logo: string;
|
|
14
14
|
account?: boolean;
|
|
15
|
-
nav?: IBaseComponentProps
|
|
15
|
+
nav?: IBaseComponentProps;
|
|
16
|
+
user_name?: string;
|
|
17
|
+
logout?: () => void
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export interface NSHeaderState
|
|
@@ -102,7 +104,7 @@ export class NSHeader extends React.Component<INSHeaderProps, NSHeaderState>
|
|
|
102
104
|
</div>
|
|
103
105
|
}
|
|
104
106
|
<div className="d-flex gap-3 align-items-center">
|
|
105
|
-
<span className={Styles.ns_navbar_username}>
|
|
107
|
+
<span className={Styles.ns_navbar_username}>{this.props.user_name}</span>
|
|
106
108
|
<div className={Styles.ns_navbar_notification}>
|
|
107
109
|
<span className={Styles.ns_navbar_notification_count}>1</span>
|
|
108
110
|
</div>
|
|
@@ -111,6 +113,7 @@ export class NSHeader extends React.Component<INSHeaderProps, NSHeaderState>
|
|
|
111
113
|
alt="Logout"
|
|
112
114
|
width={20}
|
|
113
115
|
height={20}
|
|
116
|
+
onClick={this.props.logout}
|
|
114
117
|
/>
|
|
115
118
|
</div>
|
|
116
119
|
<div className={Styles.ns_navbar_menu_icon} onClick={this.handleShowNavbar}>
|
|
@@ -126,9 +129,9 @@ export class NSHeader extends React.Component<INSHeaderProps, NSHeaderState>
|
|
|
126
129
|
height={24}
|
|
127
130
|
/>
|
|
128
131
|
</div>
|
|
129
|
-
|
|
132
|
+
|
|
130
133
|
</div>
|
|
131
|
-
|
|
134
|
+
|
|
132
135
|
</div>
|
|
133
136
|
</nav>
|
|
134
137
|
</header>
|
|
@@ -12,6 +12,8 @@ export interface INSLayoutProps extends IBaseComponentProps
|
|
|
12
12
|
background?: string;
|
|
13
13
|
notifications: INSNotificationProps[];
|
|
14
14
|
children: ReactNode;
|
|
15
|
+
user_name?: string;
|
|
16
|
+
logout?: () => void;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export function NSLayout(props: INSLayoutProps)
|
|
@@ -20,7 +22,7 @@ export function NSLayout(props: INSLayoutProps)
|
|
|
20
22
|
<div id={props.id}
|
|
21
23
|
className={`${Styles.ns_container} ${props.classList?.join(" ")}`}
|
|
22
24
|
style={props.style}>
|
|
23
|
-
<NSHeader scope={props.scope} name="Header" logo={props.logo} />
|
|
25
|
+
<NSHeader scope={props.scope} name="Header" logo={props.logo} user_name={props.user_name} logout={props.logout} />
|
|
24
26
|
{props.notifications.map(props => <NSNotification {...props}></NSNotification>)}
|
|
25
27
|
<main className={`d-flex flex-column text-white px-3 ${Styles.ns_layout_main}`} style={{ background: props.background, backgroundAttachment: "fixed" }}>
|
|
26
28
|
{props.children}
|
package/src/main.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
export * from "./components/NSBoxBoolean";
|
|
1
2
|
export * from "./components/NSBoxDate";
|
|
3
|
+
export * from "./components/NSBoxDateTime";
|
|
2
4
|
export * from "./components/NSBoxDouble";
|
|
3
5
|
export * from "./components/NSBoxDuration";
|
|
4
6
|
export * from "./components/NSBoxEmail";
|
|
7
|
+
export * from "./components/NSBoxEntity";
|
|
8
|
+
export * from "./components/NSBoxEnum";
|
|
5
9
|
export * from "./components/NSBoxErrorNotifier";
|
|
6
10
|
export * from "./components/NSBoxInteger";
|
|
7
11
|
export * from "./components/NSBoxIPV4";
|
|
@@ -29,7 +33,6 @@ export * from "./components/NSLayoutHeroBanner";
|
|
|
29
33
|
export * from "./components/NSLayoutTitle";
|
|
30
34
|
export * from "./components/NSLoading";
|
|
31
35
|
export * from "./components/NSNotification";
|
|
32
|
-
export * from "./components/NSSelectBox";
|
|
33
36
|
export * from "./components/NSSpace";
|
|
34
37
|
export * from "./components/NSSection";
|
|
35
38
|
export * from "./components/NSSectionBars";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { SelectProps } from 'antd';
|
|
3
|
-
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
4
|
-
import { IValidationProps } from "../props/IValidationProps";
|
|
5
|
-
export interface INSSelectBoxProps extends IBaseComponentProps, IValidationProps {
|
|
6
|
-
title: string;
|
|
7
|
-
options: SelectProps['options'];
|
|
8
|
-
multiple: boolean;
|
|
9
|
-
placeHolder?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface NSSelectBoxState {
|
|
12
|
-
value: string | null;
|
|
13
|
-
values: string[];
|
|
14
|
-
error?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare class NSSelectBox extends React.Component<INSSelectBoxProps, NSSelectBoxState> {
|
|
17
|
-
constructor(props: INSSelectBoxProps);
|
|
18
|
-
getError(value: string): string | null;
|
|
19
|
-
getValue(): string | null;
|
|
20
|
-
getValues(): string[];
|
|
21
|
-
setValue(value: string | null): void;
|
|
22
|
-
setValues(values: string[]): void;
|
|
23
|
-
handleChange(value: string | null | string[]): void;
|
|
24
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
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 "./NSSelectBox.module.css";
|
|
5
|
-
import { Select, Space } from 'antd';
|
|
6
|
-
import IconSelectBox from '../assets/images/icon-select-box.svg';
|
|
7
|
-
import { Validator } from "../Validator";
|
|
8
|
-
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
9
|
-
export class NSSelectBox extends React.Component {
|
|
10
|
-
constructor(props) {
|
|
11
|
-
super(props);
|
|
12
|
-
this.state = {
|
|
13
|
-
value: null,
|
|
14
|
-
values: [],
|
|
15
|
-
};
|
|
16
|
-
this.getValues = this.getValues.bind(this);
|
|
17
|
-
this.setValues = this.setValues.bind(this);
|
|
18
|
-
this.setValue = this.setValue.bind(this);
|
|
19
|
-
this.getValue = this.getValue.bind(this);
|
|
20
|
-
this.handleChange = this.handleChange.bind(this);
|
|
21
|
-
}
|
|
22
|
-
getError(value) {
|
|
23
|
-
return (Validator.getError(this.props.title, value, this.props));
|
|
24
|
-
}
|
|
25
|
-
getValue() {
|
|
26
|
-
let error = this.getError(this.state.value || "");
|
|
27
|
-
if (error) {
|
|
28
|
-
this.setState({ error });
|
|
29
|
-
throw new Error(error);
|
|
30
|
-
}
|
|
31
|
-
return this.state.value;
|
|
32
|
-
}
|
|
33
|
-
getValues() {
|
|
34
|
-
this.state.values.forEach(value => {
|
|
35
|
-
let error = this.getError(value || "");
|
|
36
|
-
if (error) {
|
|
37
|
-
this.setState({ error });
|
|
38
|
-
throw new Error(error);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
return this.state.values;
|
|
42
|
-
}
|
|
43
|
-
setValue(value) {
|
|
44
|
-
this.setState({ value });
|
|
45
|
-
}
|
|
46
|
-
setValues(values) {
|
|
47
|
-
this.setState({ values });
|
|
48
|
-
}
|
|
49
|
-
handleChange(value) {
|
|
50
|
-
if (this.props.multiple) {
|
|
51
|
-
this.setValues(value);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
this.setValue(value);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
render() {
|
|
58
|
-
var _a;
|
|
59
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `${Styles.ns_input_parent}`, children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx(Select, { mode: this.props.multiple ? "multiple" : undefined, style: { width: '100%' }, className: Styles.ns_input_select, placeholder: (_a = this.props.placeHolder) !== null && _a !== void 0 ? _a : "Combo Box", onChange: this.handleChange, optionLabelProp: "label", options: this.props.options, optionRender: (option) => (_jsx(Space, { className: Styles.ns_input_select_option, children: option.data.desc })), suffixIcon: _jsx("img", { src: IconSelectBox, alt: "SelectBox Icon" }) })] }), _jsx(NSBoxErrorNotifier, { error: this.state.error })] }));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=NSSelectBox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NSSelectBox.js","sourceRoot":"","sources":["../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I,CAAC,KAAK,CAAC,KAAK,SAAS,EACrI,KAAC,MAAM,IACN,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAClD,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EACxB,SAAS,EAAE,MAAM,CAAC,eAAe,EACjC,WAAW,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,WAAW,mCAAI,WAAW,EAClD,QAAQ,EAAE,IAAI,CAAC,YAAY,EAC3B,eAAe,EAAC,OAAO,EACvB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CACzB,KAAC,KAAK,IAAC,SAAS,EAAE,MAAM,CAAC,sBAAsB,YAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,GACV,CACR,EACD,UAAU,EAAE,cAAK,GAAG,EAAE,aAAa,EAAE,GAAG,EAAC,gBAAgB,GAAG,GAC3D,IACG,EACN,KAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAI,IAC7C,CACH,CAAC;IACH,CAAC;CACD"}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import Styles from "./NSSelectBox.module.css";
|
|
4
|
-
import { Select, Space } from 'antd';
|
|
5
|
-
import type { SelectProps } from 'antd';
|
|
6
|
-
import IconSelectBox from '../assets/images/icon-select-box.svg';
|
|
7
|
-
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
8
|
-
import { IValidationProps } from "../props/IValidationProps";
|
|
9
|
-
import { Validator } from "../Validator";
|
|
10
|
-
import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
|
|
11
|
-
|
|
12
|
-
export interface INSSelectBoxProps extends IBaseComponentProps, IValidationProps
|
|
13
|
-
{
|
|
14
|
-
title: string;
|
|
15
|
-
options: SelectProps['options'];
|
|
16
|
-
multiple: boolean;
|
|
17
|
-
placeHolder?: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface NSSelectBoxState
|
|
21
|
-
{
|
|
22
|
-
value: string | null;
|
|
23
|
-
values: string[];
|
|
24
|
-
error?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export class NSSelectBox extends React.Component<INSSelectBoxProps, NSSelectBoxState>
|
|
28
|
-
{
|
|
29
|
-
constructor(props: INSSelectBoxProps)
|
|
30
|
-
{
|
|
31
|
-
super(props);
|
|
32
|
-
this.state = {
|
|
33
|
-
value: null,
|
|
34
|
-
values: [],
|
|
35
|
-
};
|
|
36
|
-
this.getValues = this.getValues.bind(this);
|
|
37
|
-
this.setValues = this.setValues.bind(this);
|
|
38
|
-
this.setValue = this.setValue.bind(this);
|
|
39
|
-
this.getValue = this.getValue.bind(this);
|
|
40
|
-
this.handleChange = this.handleChange.bind(this);
|
|
41
|
-
}
|
|
42
|
-
getError(value: string): string | null
|
|
43
|
-
{
|
|
44
|
-
return (
|
|
45
|
-
Validator.getError(this.props.title, value, this.props)
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
getValue(): string | null
|
|
49
|
-
{
|
|
50
|
-
let error = this.getError(this.state.value || "");
|
|
51
|
-
if (error)
|
|
52
|
-
{
|
|
53
|
-
this.setState({ error });
|
|
54
|
-
throw new Error(error);
|
|
55
|
-
}
|
|
56
|
-
return this.state.value;
|
|
57
|
-
}
|
|
58
|
-
getValues(): string[]
|
|
59
|
-
{
|
|
60
|
-
this.state.values.forEach(value =>
|
|
61
|
-
{
|
|
62
|
-
let error = this.getError(value || "");
|
|
63
|
-
if (error)
|
|
64
|
-
{
|
|
65
|
-
this.setState({ error });
|
|
66
|
-
throw new Error(error);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
return this.state.values;
|
|
70
|
-
}
|
|
71
|
-
setValue(value: string | null): void
|
|
72
|
-
{
|
|
73
|
-
this.setState({ value });
|
|
74
|
-
}
|
|
75
|
-
setValues(values: string[]): void
|
|
76
|
-
{
|
|
77
|
-
this.setState({ values });
|
|
78
|
-
}
|
|
79
|
-
handleChange(value: string | null | string[]): void
|
|
80
|
-
{
|
|
81
|
-
if (this.props.multiple)
|
|
82
|
-
{
|
|
83
|
-
this.setValues(value as string[]);
|
|
84
|
-
} else
|
|
85
|
-
{
|
|
86
|
-
this.setValue(value as string | null);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
override render()
|
|
90
|
-
{
|
|
91
|
-
return (
|
|
92
|
-
<>
|
|
93
|
-
<div className={`${Styles.ns_input_parent}`}>
|
|
94
|
-
<span className={Styles.ns_input_title}> {this.props.required && <span style={{ color: "red" }} >*</span>} {this.props.title} </span>
|
|
95
|
-
<Select
|
|
96
|
-
mode={this.props.multiple ? "multiple" : undefined}
|
|
97
|
-
style={{ width: '100%' }}
|
|
98
|
-
className={Styles.ns_input_select}
|
|
99
|
-
placeholder={this.props.placeHolder ?? "Combo Box"}
|
|
100
|
-
onChange={this.handleChange}
|
|
101
|
-
optionLabelProp="label"
|
|
102
|
-
options={this.props.options}
|
|
103
|
-
optionRender={(option) => (
|
|
104
|
-
<Space className={Styles.ns_input_select_option}>
|
|
105
|
-
{option.data.desc}
|
|
106
|
-
</Space>
|
|
107
|
-
)}
|
|
108
|
-
suffixIcon={<img src={IconSelectBox} alt="SelectBox Icon" />}
|
|
109
|
-
/>
|
|
110
|
-
</div>
|
|
111
|
-
<NSBoxErrorNotifier error={this.state.error} />
|
|
112
|
-
</>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
File without changes
|
|
File without changes
|