namirasoft-site-react 1.3.55 → 1.3.57
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 +3 -3
- package/dist/App.js.map +1 -1
- package/dist/components/NSInputDate.js +1 -1
- package/dist/components/NSInputDate.module.css +0 -9
- package/dist/components/NSInputPassword.d.ts +18 -0
- package/dist/components/NSInputPassword.js +33 -0
- package/dist/components/NSInputPassword.js.map +1 -0
- package/dist/components/NSInputPassword.module.css +27 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -1
- package/package.json +2 -2
- package/src/App.tsx +2 -1
- package/src/components/NSInputDate.module.css +0 -9
- package/src/components/NSInputDate.tsx +1 -1
- package/src/components/NSInputPassword.module.css +27 -0
- package/src/components/NSInputPassword.tsx +70 -0
- package/src/main.ts +1 -0
package/dist/App.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import './App.css';
|
|
3
3
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
4
|
-
import { NSFooter, NSHeader, NSTable } from './main';
|
|
4
|
+
import { NSFooter, NSHeader, NSTable, NSInputDate } from './main';
|
|
5
5
|
export function App() {
|
|
6
6
|
let columns = {
|
|
7
7
|
"id": "ID",
|
|
@@ -28,6 +28,6 @@ export function App() {
|
|
|
28
28
|
status: "Done"
|
|
29
29
|
}
|
|
30
30
|
];
|
|
31
|
-
return (_jsxs(_Fragment, { children: [_jsx(NSHeader, { name: 'Header', scope: 'Namira Software Corporation', logo: 'https://static.namirasoft.com/logo/namirasoft/base.png', account: false, background: { color: "transparent !important" } }),
|
|
31
|
+
return (_jsxs(_Fragment, { children: [_jsx(NSHeader, { name: 'Header', scope: 'Namira Software Corporation', logo: 'https://static.namirasoft.com/logo/namirasoft/base.png', account: false, background: { color: "transparent !important" } }), _jsxs("div", { className: "container", children: [_jsx(NSInputDate, { title: "rrt" }), _jsx(NSTable, { columns: columns, rows: rows, getRowKey: row => row.id.toString() })] }), _jsx(NSFooter, { name: 'Footer', scope: 'Namira Software Corporation', logo: 'https://static.namirasoft.com/logo/namirasoft/base.png' })] }));
|
|
32
32
|
}
|
|
33
33
|
//# 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,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,QAAQ,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,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAC,WAAW,EAAE,MAAM,QAAQ,CAAC;AAEjE,MAAM,UAAU,GAAG;IAEf,IAAI,OAAO,GAAG;QACV,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,OAAO;QAChB,SAAS,EAAE,SAAS;QACpB,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,QAAQ;KACrB,CAAA;IACD,IAAI,IAAI,GAAG,CAAC;YACR,EAAE,EAAE,CAAC;YACL,OAAO,EAAE,oBAAoB;YAC7B,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,yCAAyC;YAClD,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,MAAM;SACjB;QACD;YACI,EAAE,EAAE,CAAC;YACL,OAAO,EAAE,oBAAoB;YAC7B,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,yCAAyC;YAClD,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,MAAM;SACjB;KACA,CAAA;IAUD,OAAO,CACH,8BACI,KAAC,QAAQ,IACL,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,6BAA6B,EACnC,IAAI,EAAC,wDAAwD,EAC7D,OAAO,EAAE,KAAK,EACd,UAAU,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,GACjD,EACF,eAAK,SAAS,EAAC,WAAW,aACtB,KAAC,WAAW,IAAC,KAAK,EAAC,KAAK,GAAE,EAC1B,KAAC,OAAO,IAAM,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAI,IACjF,EACN,KAAC,QAAQ,IAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,6BAA6B,EAAC,IAAI,EAAC,wDAAwD,GAAG,IAC7H,CACN,CAAC;AACN,CAAC"}
|
|
@@ -25,7 +25,7 @@ export class NSInputDate extends React.Component {
|
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
27
|
var _a;
|
|
28
|
-
return (_jsxs("div", { className: `${Styles.
|
|
28
|
+
return (_jsxs("div", { className: `${Styles.ns_parent_input} p-2 ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsx("span", { className: Styles.ns_input_title, children: this.props.title }), _jsx("input", { value: this.state.value, onChange: this.onChanged, type: "date", className: Styles.ns_input, placeholder: this.props.placeholder, id: "ns-input-date" })] }));
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
//# sourceMappingURL=NSInputDate.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
3
|
+
export interface NSInputPasswordProps extends BaseComponentProps {
|
|
4
|
+
title: string;
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface NSInputPasswordState {
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class NSInputPassword extends React.Component<NSInputPasswordProps, NSInputPasswordState> {
|
|
13
|
+
constructor(props: NSInputPasswordProps);
|
|
14
|
+
getValue(): string;
|
|
15
|
+
setValue(value: string): void;
|
|
16
|
+
private onChanged;
|
|
17
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import Styles from "./NSInputPassword.module.css";
|
|
5
|
+
import IconInputString from '../assets/images/icon-input-string.svg';
|
|
6
|
+
export class NSInputPassword extends React.Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
var _a;
|
|
9
|
+
super(props);
|
|
10
|
+
this.state = {
|
|
11
|
+
value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "",
|
|
12
|
+
};
|
|
13
|
+
this.getValue = this.getValue.bind(this);
|
|
14
|
+
this.setValue = this.setValue.bind(this);
|
|
15
|
+
this.onChanged = this.onChanged.bind(this);
|
|
16
|
+
}
|
|
17
|
+
getValue() {
|
|
18
|
+
return this.state.value;
|
|
19
|
+
}
|
|
20
|
+
setValue(value) {
|
|
21
|
+
this.setState({ value });
|
|
22
|
+
}
|
|
23
|
+
onChanged(e) {
|
|
24
|
+
this.setValue(e.target.value);
|
|
25
|
+
if (this.props.onChanged)
|
|
26
|
+
this.props.onChanged(e);
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
var _a;
|
|
30
|
+
return (_jsxs("div", { className: `${Styles.ns_input_parent} p-2 ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsx("span", { className: Styles.ns_input_title, children: this.props.title }), _jsx("img", { className: Styles.ns_input_icon, src: IconInputString, alt: "icon", width: 24, height: 24 }), _jsx("input", { value: this.state.value, onChange: this.onChanged, type: "password", className: Styles.ns_input, placeholder: this.props.placeholder })] }));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=NSInputPassword.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NSInputPassword.js","sourceRoot":"","sources":["../../src/components/NSInputPassword.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,8BAA8B,CAAC;AAClD,OAAO,eAAe,MAAM,wCAAwC,CAAC;AAgBrE,MAAM,OAAO,eAAgB,SAAQ,KAAK,CAAC,SAAqD;IAE5F,YAAY,KAA2B;;QAEnC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACT,KAAK,EAAE,MAAA,KAAK,CAAC,YAAY,mCAAI,EAAE;SAClC,CAAC;QACF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IACD,QAAQ;QAEJ,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;IAC5B,CAAC;IACD,QAAQ,CAAC,KAAa;QAElB,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7B,CAAC;IACO,SAAS,CAAC,CAAsC;QAEpD,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9B,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS;YACpB,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC;IACQ,MAAM;;QAEX,OAAO,CACH,eAAK,SAAS,EAAE,GAAG,MAAM,CAAC,eAAe,QAAQ,MAAA,IAAI,CAAC,KAAK,CAAC,SAAS,0CAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,aAEvG,eAAM,SAAS,EAAE,MAAM,CAAC,cAAc,YAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAQ,EACjE,cACI,SAAS,EAAE,MAAM,CAAC,aAAa,EAC/B,GAAG,EAAE,eAAe,EACpB,GAAG,EAAC,MAAM,EACV,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,GACZ,EACF,gBACI,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,IAAI,EAAC,UAAU,EACf,SAAS,EAAE,MAAM,CAAC,QAAQ,EAC1B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,GACrC,IACA,CACT,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.ns_input_parent {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 326px;
|
|
5
|
+
color: #fff;
|
|
6
|
+
position: relative;
|
|
7
|
+
max-width: 100%;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ns_input {
|
|
11
|
+
border-radius: 8px;
|
|
12
|
+
padding: 10px 12px;
|
|
13
|
+
font-size: 16px;
|
|
14
|
+
font-weight: 400;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ns_input_icon {
|
|
18
|
+
position: absolute;
|
|
19
|
+
right: 20px;
|
|
20
|
+
top: 51%;
|
|
21
|
+
z-index: 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ns_input_title {
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
font-weight: 400;
|
|
27
|
+
}
|
package/dist/main.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from "./components/NSInputDuration";
|
|
|
14
14
|
export * from "./components/NSInputEmail";
|
|
15
15
|
export * from "./components/NSInputFloat";
|
|
16
16
|
export * from "./components/NSInputIP";
|
|
17
|
+
export * from "./components/NSInputPassword";
|
|
17
18
|
export * from "./components/NSInputInteger";
|
|
18
19
|
export * from "./components/NSInputPhone";
|
|
19
20
|
export * from "./components/NSInputPrice";
|
package/dist/main.js
CHANGED
|
@@ -14,6 +14,7 @@ export * from "./components/NSInputDuration";
|
|
|
14
14
|
export * from "./components/NSInputEmail";
|
|
15
15
|
export * from "./components/NSInputFloat";
|
|
16
16
|
export * from "./components/NSInputIP";
|
|
17
|
+
export * from "./components/NSInputPassword";
|
|
17
18
|
export * from "./components/NSInputInteger";
|
|
18
19
|
export * from "./components/NSInputPhone";
|
|
19
20
|
export * from "./components/NSInputPrice";
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,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,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,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,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,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,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,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,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,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.57",
|
|
12
12
|
"author": "Amir Abolhasani, Alireza Esmaeeli, Hooman Shashaeh",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "./dist/main.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"link-react": "^3.0.0",
|
|
31
31
|
"namirasoft-api-link": "^1.3.1",
|
|
32
32
|
"namirasoft-core": "^1.3.18",
|
|
33
|
-
"namirasoft-site-react": "^1.3.
|
|
33
|
+
"namirasoft-site-react": "^1.3.56",
|
|
34
34
|
"path-browserify": "^1.0.1",
|
|
35
35
|
"react": "^18.2.0",
|
|
36
36
|
"react-app-rewired": "^2.2.1",
|
package/src/App.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './App.css';
|
|
2
2
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
3
|
-
import { NSFooter, NSHeader, NSTable } from './main';
|
|
3
|
+
import { NSFooter, NSHeader, NSTable,NSInputDate } from './main';
|
|
4
4
|
|
|
5
5
|
export function App()
|
|
6
6
|
{
|
|
@@ -48,6 +48,7 @@ export function App()
|
|
|
48
48
|
background={{ color: "transparent !important" }}
|
|
49
49
|
/>
|
|
50
50
|
<div className="container">
|
|
51
|
+
<NSInputDate title="rrt"/>
|
|
51
52
|
<NSTable<Row> columns={columns} rows={rows} getRowKey={row => row.id.toString()} />
|
|
52
53
|
</div>
|
|
53
54
|
<NSFooter name='Footer' scope='Namira Software Corporation' logo='https://static.namirasoft.com/logo/namirasoft/base.png' />
|
|
@@ -45,7 +45,7 @@ export class NSInputDate extends React.Component<NSInputDateProps, NSInputDateSt
|
|
|
45
45
|
override render()
|
|
46
46
|
{
|
|
47
47
|
return (
|
|
48
|
-
<div className={`${Styles.
|
|
48
|
+
<div className={`${Styles.ns_parent_input} p-2 ${this.props.classList?.join(" ")}`} style={this.props.style}>
|
|
49
49
|
<span className={Styles.ns_input_title}>{this.props.title}</span>
|
|
50
50
|
<input
|
|
51
51
|
value={this.state.value}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.ns_input_parent {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 326px;
|
|
5
|
+
color: #fff;
|
|
6
|
+
position: relative;
|
|
7
|
+
max-width: 100%;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ns_input {
|
|
11
|
+
border-radius: 8px;
|
|
12
|
+
padding: 10px 12px;
|
|
13
|
+
font-size: 16px;
|
|
14
|
+
font-weight: 400;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ns_input_icon {
|
|
18
|
+
position: absolute;
|
|
19
|
+
right: 20px;
|
|
20
|
+
top: 51%;
|
|
21
|
+
z-index: 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ns_input_title {
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
font-weight: 400;
|
|
27
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import Styles from "./NSInputPassword.module.css";
|
|
5
|
+
import IconInputString from '../assets/images/icon-input-string.svg';
|
|
6
|
+
import { BaseComponentProps } from "../props/BaseComponentProps";
|
|
7
|
+
|
|
8
|
+
export interface NSInputPasswordProps extends BaseComponentProps
|
|
9
|
+
{
|
|
10
|
+
title: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface NSInputPasswordState
|
|
17
|
+
{
|
|
18
|
+
value: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class NSInputPassword extends React.Component<NSInputPasswordProps, NSInputPasswordState>
|
|
22
|
+
{
|
|
23
|
+
constructor(props: NSInputPasswordProps)
|
|
24
|
+
{
|
|
25
|
+
super(props);
|
|
26
|
+
this.state = {
|
|
27
|
+
value: props.defaultValue ?? "",
|
|
28
|
+
};
|
|
29
|
+
this.getValue = this.getValue.bind(this);
|
|
30
|
+
this.setValue = this.setValue.bind(this);
|
|
31
|
+
this.onChanged = this.onChanged.bind(this);
|
|
32
|
+
}
|
|
33
|
+
getValue(): string
|
|
34
|
+
{
|
|
35
|
+
return this.state.value;
|
|
36
|
+
}
|
|
37
|
+
setValue(value: string): void
|
|
38
|
+
{
|
|
39
|
+
this.setState({ value });
|
|
40
|
+
}
|
|
41
|
+
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
42
|
+
{
|
|
43
|
+
this.setValue(e.target.value);
|
|
44
|
+
if (this.props.onChanged)
|
|
45
|
+
this.props.onChanged(e);
|
|
46
|
+
}
|
|
47
|
+
override render()
|
|
48
|
+
{
|
|
49
|
+
return (
|
|
50
|
+
<div className={`${Styles.ns_input_parent} p-2 ${this.props.classList?.join(" ")}`} style={this.props.style}>
|
|
51
|
+
|
|
52
|
+
<span className={Styles.ns_input_title}>{this.props.title}</span>
|
|
53
|
+
<img
|
|
54
|
+
className={Styles.ns_input_icon}
|
|
55
|
+
src={IconInputString}
|
|
56
|
+
alt="icon"
|
|
57
|
+
width={24}
|
|
58
|
+
height={24}
|
|
59
|
+
/>
|
|
60
|
+
<input
|
|
61
|
+
value={this.state.value}
|
|
62
|
+
onChange={this.onChanged}
|
|
63
|
+
type="password"
|
|
64
|
+
className={Styles.ns_input}
|
|
65
|
+
placeholder={this.props.placeholder}
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
}
|
package/src/main.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from "./components/NSInputDuration";
|
|
|
14
14
|
export * from "./components/NSInputEmail";
|
|
15
15
|
export * from "./components/NSInputFloat";
|
|
16
16
|
export * from "./components/NSInputIP";
|
|
17
|
+
export * from "./components/NSInputPassword";
|
|
17
18
|
export * from "./components/NSInputInteger";
|
|
18
19
|
export * from "./components/NSInputPhone";
|
|
19
20
|
export * from "./components/NSInputPrice";
|