namirasoft-site-react 1.3.42 → 1.3.43
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.
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export interface NSInputDateProps {
|
|
3
3
|
title: string;
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
4
6
|
}
|
|
5
7
|
export interface NSInputDateState {
|
|
6
8
|
value: string;
|
|
7
9
|
}
|
|
8
10
|
export declare class NSInputDate extends React.Component<NSInputDateProps, NSInputDateState> {
|
|
9
11
|
constructor(props: NSInputDateProps);
|
|
10
|
-
setValue(e: React.ChangeEvent<HTMLInputElement>): void;
|
|
11
|
-
setDefaultValue(value: string): void;
|
|
12
12
|
getValue(): string;
|
|
13
|
+
setValue(value: string): void;
|
|
14
|
+
private onChanged;
|
|
13
15
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
}
|
|
@@ -10,19 +10,21 @@ export class NSInputDate extends React.Component {
|
|
|
10
10
|
};
|
|
11
11
|
this.setValue = this.setValue.bind(this);
|
|
12
12
|
this.getValue = this.getValue.bind(this);
|
|
13
|
-
this.
|
|
13
|
+
this.onChanged = this.onChanged.bind(this);
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
this.
|
|
15
|
+
getValue() {
|
|
16
|
+
return this.state.value;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
setValue(value) {
|
|
19
19
|
this.setState({ value });
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
onChanged(e) {
|
|
22
|
+
this.setValue(e.target.value);
|
|
23
|
+
if (this.props.onChanged)
|
|
24
|
+
this.props.onChanged(e);
|
|
23
25
|
}
|
|
24
26
|
render() {
|
|
25
|
-
return (_jsxs("div", { className: `${Styles.ns_parent_input} p-2`, children: [_jsx("span", { className: Styles.ns_input_title, children: this.props.title }), _jsx("input", { value: this.state.value, onChange: this.
|
|
27
|
+
return (_jsxs("div", { className: `${Styles.ns_parent_input} p-2`, 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: "YYYY/MM/DD", id: "ns-input-date" })] }));
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
//# sourceMappingURL=NSInputDate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSInputDate.js","sourceRoot":"","sources":["../../src/components/NSInputDate.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"NSInputDate.js","sourceRoot":"","sources":["../../src/components/NSInputDate.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAc9C,MAAM,OAAO,WAAY,SAAQ,KAAK,CAAC,SAA6C;IAChF,YAAY,KAAuB;QAE/B,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACT,KAAK,EAAE,EAAE;SACZ,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,MAAM,aAC3C,eAAM,SAAS,EAAE,MAAM,CAAC,cAAc,YAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAQ,EACjE,gBACI,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,IAAI,EAAC,MAAM,EACX,SAAS,EAAE,MAAM,CAAC,QAAQ,EAC1B,WAAW,EAAC,YAAY,EACxB,EAAE,EAAC,eAAe,GACpB,IACA,CACT,CAAC;IACN,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -6,6 +6,8 @@ import Styles from "./NSInputDate.module.css";
|
|
|
6
6
|
export interface NSInputDateProps
|
|
7
7
|
{
|
|
8
8
|
title: string;
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export interface NSInputDateState
|
|
@@ -22,19 +24,21 @@ export class NSInputDate extends React.Component<NSInputDateProps, NSInputDateSt
|
|
|
22
24
|
};
|
|
23
25
|
this.setValue = this.setValue.bind(this);
|
|
24
26
|
this.getValue = this.getValue.bind(this);
|
|
25
|
-
this.
|
|
27
|
+
this.onChanged = this.onChanged.bind(this);
|
|
26
28
|
}
|
|
27
|
-
|
|
29
|
+
getValue(): string
|
|
28
30
|
{
|
|
29
|
-
this.
|
|
31
|
+
return this.state.value;
|
|
30
32
|
}
|
|
31
|
-
|
|
33
|
+
setValue(value: string): void
|
|
32
34
|
{
|
|
33
35
|
this.setState({ value });
|
|
34
36
|
}
|
|
35
|
-
|
|
37
|
+
private onChanged(e: React.ChangeEvent<HTMLInputElement>): void
|
|
36
38
|
{
|
|
37
|
-
|
|
39
|
+
this.setValue(e.target.value);
|
|
40
|
+
if (this.props.onChanged)
|
|
41
|
+
this.props.onChanged(e);
|
|
38
42
|
}
|
|
39
43
|
override render()
|
|
40
44
|
{
|
|
@@ -43,7 +47,7 @@ export class NSInputDate extends React.Component<NSInputDateProps, NSInputDateSt
|
|
|
43
47
|
<span className={Styles.ns_input_title}>{this.props.title}</span>
|
|
44
48
|
<input
|
|
45
49
|
value={this.state.value}
|
|
46
|
-
onChange={this.
|
|
50
|
+
onChange={this.onChanged}
|
|
47
51
|
type="date"
|
|
48
52
|
className={Styles.ns_input}
|
|
49
53
|
placeholder="YYYY/MM/DD"
|