namirasoft-site-react 1.4.549 → 1.4.551
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/NSButton.d.ts +3 -2
- package/dist/components/NSButton.js +3 -5
- package/dist/components/NSButton.js.map +1 -1
- package/dist/formatter/DateFormatter.js +2 -1
- package/dist/formatter/DateFormatter.js.map +1 -1
- package/dist/formatter/DateTimeFormatter.js +2 -1
- package/dist/formatter/DateTimeFormatter.js.map +1 -1
- package/package.json +2 -2
- package/src/components/NSButton.tsx +7 -8
- package/src/formatter/DateFormatter.ts +2 -1
- package/src/formatter/DateTimeFormatter.ts +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
2
2
|
import { IImageProps } from "../props/IImageProps";
|
|
3
|
-
import
|
|
3
|
+
import { ButtonHTMLAttributes, Component } from "react";
|
|
4
4
|
import { NSLoadingProps } from "./NSLoading";
|
|
5
5
|
export interface NSButtonOnClickProps<ParameterType = any> {
|
|
6
6
|
action: (onFinshied: () => void, parameters?: ParameterType) => void;
|
|
@@ -12,11 +12,12 @@ export interface NSButtonProps<ParameterType = any> extends IBaseComponentProps
|
|
|
12
12
|
onClick: NSButtonOnClickProps<ParameterType>;
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
loading?: NSLoadingProps;
|
|
15
|
+
attributes?: ButtonHTMLAttributes<HTMLButtonElement>;
|
|
15
16
|
}
|
|
16
17
|
export interface NSButtonState {
|
|
17
18
|
clicked: boolean;
|
|
18
19
|
}
|
|
19
|
-
export declare class NSButton extends
|
|
20
|
+
export declare class NSButton extends Component<NSButtonProps, NSButtonState> {
|
|
20
21
|
constructor(props: NSButtonProps);
|
|
21
22
|
performClick(): void;
|
|
22
23
|
render(): React.ReactNode;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import Styles from "./NSButton.module.css";
|
|
3
|
-
import
|
|
3
|
+
import { Component } from "react";
|
|
4
4
|
import { NSLoading } from "./NSLoading";
|
|
5
|
-
export class NSButton extends
|
|
5
|
+
export class NSButton extends Component {
|
|
6
6
|
constructor(props) {
|
|
7
7
|
super(props);
|
|
8
8
|
this.state = { clicked: false };
|
|
@@ -26,9 +26,7 @@ export class NSButton extends React.Component {
|
|
|
26
26
|
var _a, _b;
|
|
27
27
|
if (this.state.clicked)
|
|
28
28
|
return _jsx(NSLoading, Object.assign({ small: true, hideTitle: true, hideDescription: true }, this.props.loading));
|
|
29
|
-
return (_jsxs("button", { id: this.props.id, className: `${this.props.disabled ? Styles.ns_button_disabled : Styles.ns_button} ${(_b = (_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")) !== null && _b !== void 0 ? _b : ""}`,
|
|
30
|
-
this.performClick();
|
|
31
|
-
}, disabled: this.props.disabled, children: [this.props.icon && _jsx("img", Object.assign({}, this.props.icon, { alt: "Icon", width: 24, height: 24 })), this.props.title] }));
|
|
29
|
+
return (_jsxs("button", Object.assign({ id: this.props.id }, this.props.attributes, { disabled: this.props.disabled, style: this.props.style, className: `${this.props.disabled ? Styles.ns_button_disabled : Styles.ns_button} ${(_b = (_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")) !== null && _b !== void 0 ? _b : ""}`, onClick: () => this.performClick(), children: [this.props.icon && _jsx("img", Object.assign({}, this.props.icon, { alt: "Icon", width: 24, height: 24 })), this.props.title] })));
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
32
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSButton.js","sourceRoot":"","sources":["../../src/components/NSButton.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAG3C,OAAO,
|
|
1
|
+
{"version":3,"file":"NSButton.js","sourceRoot":"","sources":["../../src/components/NSButton.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM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AAC,KAAK,CAAC,QAAQ,EAC7B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,SAAS,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,IAAI,MAAA,MAAA,IAAI,CAAC,KAAK,CAAC,SAAS,0CAAE,IAAI,CAAC,GAAG,CAAC,mCAAI,EAAE,EAAE,EAC3H,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,aAEjC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,8BAAS,IAAI,CAAC,KAAK,CAAC,IAAI,IAAE,GAAG,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EACjF,IAAI,CAAC,KAAK,CAAC,KAAK,KACX,CACb,CAAC;IACN,CAAC;CACJ;AAAA,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TimeOperation } from "namirasoft-core";
|
|
1
2
|
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
2
3
|
export class DateFormatter extends BaseColumnFormatter {
|
|
3
4
|
constructor(width = "130px") {
|
|
@@ -8,7 +9,7 @@ export class DateFormatter extends BaseColumnFormatter {
|
|
|
8
9
|
if (value)
|
|
9
10
|
try {
|
|
10
11
|
let date = new Date(value);
|
|
11
|
-
return
|
|
12
|
+
return TimeOperation.format(date, "YYYY/MM/DD");
|
|
12
13
|
}
|
|
13
14
|
catch (e) {
|
|
14
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateFormatter.js","sourceRoot":"","sources":["../../src/formatter/DateFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,OAAO,aAAc,SAAQ,mBAAmB;IAElD,YAAY,QAAgB,OAAO;QAE/B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IACQ,MAAM,CAAC,KAAU;QAEtB,IAAI,KAAK;YACL,IACA,CAAC;gBACG,IAAI,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC3B,OAAO,
|
|
1
|
+
{"version":3,"file":"DateFormatter.js","sourceRoot":"","sources":["../../src/formatter/DateFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,OAAO,aAAc,SAAQ,mBAAmB;IAElD,YAAY,QAAgB,OAAO;QAE/B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IACQ,MAAM,CAAC,KAAU;QAEtB,IAAI,KAAK;YACL,IACA,CAAC;gBACG,IAAI,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC3B,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;YACpD,CAAC;YAAC,OAAO,CAAC,EACV,CAAC;YACD,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TimeOperation } from "namirasoft-core";
|
|
1
2
|
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
2
3
|
export class DateTimeFormatter extends BaseColumnFormatter {
|
|
3
4
|
constructor(width = "185px") {
|
|
@@ -8,7 +9,7 @@ export class DateTimeFormatter extends BaseColumnFormatter {
|
|
|
8
9
|
if (value)
|
|
9
10
|
try {
|
|
10
11
|
let date = new Date(value);
|
|
11
|
-
return
|
|
12
|
+
return TimeOperation.format(date, "YYYY/MM/DD HH:mm:ss");
|
|
12
13
|
}
|
|
13
14
|
catch (e) {
|
|
14
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeFormatter.js","sourceRoot":"","sources":["../../src/formatter/DateTimeFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,OAAO,iBAAkB,SAAQ,mBAAmB;IAEtD,YAAY,QAAgB,OAAO;QAE/B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IACQ,MAAM,CAAC,KAAU;QAEtB,IAAI,KAAK;YACL,IACA,CAAC;gBACG,IAAI,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC3B,OAAO,
|
|
1
|
+
{"version":3,"file":"DateTimeFormatter.js","sourceRoot":"","sources":["../../src/formatter/DateTimeFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,OAAO,iBAAkB,SAAQ,mBAAmB;IAEtD,YAAY,QAAgB,OAAO;QAE/B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IACQ,MAAM,CAAC,KAAU;QAEtB,IAAI,KAAK;YACL,IACA,CAAC;gBACG,IAAI,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC3B,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;YAC7D,CAAC;YAAC,OAAO,CAAC,EACV,CAAC;YACD,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"framework": "npm",
|
|
9
9
|
"application": "package",
|
|
10
10
|
"private": false,
|
|
11
|
-
"version": "1.4.
|
|
11
|
+
"version": "1.4.551",
|
|
12
12
|
"author": "Amir Abolhasani",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "./dist/main.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@uiw/react-json-view": "^2.0.0-alpha.43",
|
|
33
33
|
"antd": "^6.4.4",
|
|
34
34
|
"async-mutex": "^0.5.0",
|
|
35
|
-
"axios": "^1.
|
|
35
|
+
"axios": "^1.18.0",
|
|
36
36
|
"bootstrap": "^5.3.8",
|
|
37
37
|
"chart.js": "^4.5.1",
|
|
38
38
|
"copyfiles": "^2.4.1",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Styles from "./NSButton.module.css";
|
|
2
2
|
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
3
3
|
import { IImageProps } from "../props/IImageProps";
|
|
4
|
-
import
|
|
4
|
+
import { ButtonHTMLAttributes, Component } from "react";
|
|
5
5
|
import { NSLoading, NSLoadingProps } from "./NSLoading";
|
|
6
6
|
|
|
7
7
|
export interface NSButtonOnClickProps<ParameterType = any>
|
|
@@ -17,6 +17,7 @@ export interface NSButtonProps<ParameterType = any> extends IBaseComponentProps
|
|
|
17
17
|
onClick: NSButtonOnClickProps<ParameterType>;
|
|
18
18
|
disabled?: boolean;
|
|
19
19
|
loading?: NSLoadingProps
|
|
20
|
+
attributes?: ButtonHTMLAttributes<HTMLButtonElement>
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export interface NSButtonState
|
|
@@ -24,7 +25,7 @@ export interface NSButtonState
|
|
|
24
25
|
clicked: boolean;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
export class NSButton extends
|
|
28
|
+
export class NSButton extends Component<NSButtonProps, NSButtonState>
|
|
28
29
|
{
|
|
29
30
|
constructor(props: NSButtonProps)
|
|
30
31
|
{
|
|
@@ -60,13 +61,11 @@ export class NSButton extends React.Component<NSButtonProps, NSButtonState>
|
|
|
60
61
|
|
|
61
62
|
return (
|
|
62
63
|
<button id={this.props.id}
|
|
63
|
-
|
|
64
|
-
style={this.props.style}
|
|
65
|
-
onClick={() =>
|
|
66
|
-
{
|
|
67
|
-
this.performClick();
|
|
68
|
-
}}
|
|
64
|
+
{...this.props.attributes}
|
|
69
65
|
disabled={this.props.disabled}
|
|
66
|
+
style={this.props.style}
|
|
67
|
+
className={`${this.props.disabled ? Styles.ns_button_disabled : Styles.ns_button} ${this.props.classList?.join(" ") ?? ""}`}
|
|
68
|
+
onClick={() => this.performClick()}
|
|
70
69
|
>
|
|
71
70
|
{this.props.icon && <img {...this.props.icon} alt="Icon" width={24} height={24} />}
|
|
72
71
|
{this.props.title}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TimeOperation } from "namirasoft-core";
|
|
1
2
|
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
2
3
|
|
|
3
4
|
export class DateFormatter extends BaseColumnFormatter
|
|
@@ -13,7 +14,7 @@ export class DateFormatter extends BaseColumnFormatter
|
|
|
13
14
|
try
|
|
14
15
|
{
|
|
15
16
|
let date = new Date(value);
|
|
16
|
-
return
|
|
17
|
+
return TimeOperation.format(date, "YYYY/MM/DD");
|
|
17
18
|
} catch (e)
|
|
18
19
|
{
|
|
19
20
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TimeOperation } from "namirasoft-core";
|
|
1
2
|
import { BaseColumnFormatter } from "./BaseColumnFormatter";
|
|
2
3
|
|
|
3
4
|
export class DateTimeFormatter extends BaseColumnFormatter
|
|
@@ -13,7 +14,7 @@ export class DateTimeFormatter extends BaseColumnFormatter
|
|
|
13
14
|
try
|
|
14
15
|
{
|
|
15
16
|
let date = new Date(value);
|
|
16
|
-
return
|
|
17
|
+
return TimeOperation.format(date, "YYYY/MM/DD HH:mm:ss");
|
|
17
18
|
} catch (e)
|
|
18
19
|
{
|
|
19
20
|
}
|