namirasoft-site-react 1.4.449 → 1.4.451
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 -2
- package/dist/App.js.map +1 -1
- package/dist/components/NSBoxBooleans.d.ts +2 -0
- package/dist/components/NSBoxBooleans.js +1 -1
- package/dist/components/NSBoxBooleans.js.map +1 -1
- package/dist/components/NSBoxMoney.d.ts +3 -3
- package/dist/components/NSBoxMoney.js +8 -4
- package/dist/components/NSBoxMoney.js.map +1 -1
- package/dist/components/NSDialog.module.css +3 -3
- package/dist/components/NSGaugeDate.d.ts +2 -0
- package/dist/components/NSGaugeDate.js +12 -3
- package/dist/components/NSGaugeDate.js.map +1 -1
- package/dist/components/NSGaugeDate.module.css +5 -1
- package/dist/components/NSGaugeNumber.d.ts +2 -0
- package/dist/components/NSGaugeNumber.js +14 -4
- package/dist/components/NSGaugeNumber.js.map +1 -1
- package/dist/components/NSGaugeNumber.module.css +4 -0
- package/dist/components/NSNoData.module.css +2 -0
- package/package.json +7 -7
- package/src/App.tsx +15 -16
- package/src/components/NSBoxBooleans.tsx +4 -1
- package/src/components/NSBoxMoney.tsx +81 -77
- package/src/components/NSDialog.module.css +3 -3
- package/src/components/NSGaugeDate.module.css +5 -1
- package/src/components/NSGaugeDate.tsx +40 -13
- package/src/components/NSGaugeNumber.module.css +4 -0
- package/src/components/NSGaugeNumber.tsx +42 -8
- package/src/components/NSNoData.module.css +2 -0
package/dist/App.js
CHANGED
|
@@ -3,7 +3,7 @@ import 'bootstrap/dist/css/bootstrap.min.css';
|
|
|
3
3
|
import { Component } from 'react';
|
|
4
4
|
import './App.css';
|
|
5
5
|
import { NSLayout } from './components/NSLayout';
|
|
6
|
-
import {
|
|
6
|
+
import { NSGaugeDate, NSGaugeNumber, NSRow, NSSection } from './main';
|
|
7
7
|
export class App extends Component {
|
|
8
8
|
constructor(props) {
|
|
9
9
|
super(props);
|
|
@@ -24,7 +24,7 @@ export class App extends Component {
|
|
|
24
24
|
}
|
|
25
25
|
],
|
|
26
26
|
}
|
|
27
|
-
}, isLoggedIn: () => true, logo: 'https://static.namirasoft.com/image/namirasoft/access/logo/base.png', background: { image: "https://static.namirasoft.com/image/namirasoft/access/background/base.svg" }, notifications: [], notifier: {}, scope: '', children: _jsx(NSSection, { style: { paddingTop: "3rem" }, children: _jsxs(
|
|
27
|
+
}, isLoggedIn: () => true, logo: 'https://static.namirasoft.com/image/namirasoft/access/logo/base.png', background: { image: "https://static.namirasoft.com/image/namirasoft/access/background/base.svg" }, notifications: [], notifier: {}, scope: '', children: _jsx(NSSection, { style: { paddingTop: "3rem" }, children: _jsxs(NSRow, { style: { alignItems: "stretch" }, children: [_jsx(NSGaugeDate, { title: 'Date Gauge', from: new Date(Date.now() - 5 * 60000), to: new Date(Date.now() + 5 * 60000), colors: { low: "green", medium: "yellow", high: "red" }, noData: true }), _jsx(NSGaugeNumber, { title: 'Number Gauge', current: 13, total: 100, colors: { low: "green", medium: "yellow", high: "red" }, loading: true })] }) }) }));
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
//# 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,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAC7C,OAAO,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"App.js","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":";AAAA,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAC7C,OAAO,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACj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IAAI,EAAE,KAAK,EAAE,EACvD,MAAM,SACL,EACF,KAAC,aAAa,IACb,KAAK,EAAC,cAAc,EACpB,OAAO,EAAE,EAAE,EACX,KAAK,EAAE,GAAG,EACV,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,EACvD,OAAO,SACN,IACK,GACG,GACF,CACX,CAAC;IACH,CAAC;CACD"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
3
|
+
import { NSInfoProps } from "./NSInfo";
|
|
3
4
|
export interface NSBoxBooleansProps extends IBaseComponentProps {
|
|
4
5
|
items: {
|
|
5
6
|
value: string;
|
|
6
7
|
text: string;
|
|
8
|
+
info?: NSInfoProps;
|
|
7
9
|
}[];
|
|
8
10
|
reverse?: boolean;
|
|
9
11
|
onChanged?: (e: NSBoxBooleans, callback?: () => void) => void;
|
|
@@ -93,7 +93,7 @@ export class NSBoxBooleans extends React.Component {
|
|
|
93
93
|
var _a, _b, _c, _d, _e, _f;
|
|
94
94
|
return (_jsxs(_Fragment, { children: [_jsx(NSBoxBoolean, { id: (_a = this.props.box_all) === null || _a === void 0 ? void 0 : _a.id, classList: (_b = this.props.box_all) === null || _b === void 0 ? void 0 : _b.classList, style: Object.assign({ maxWidth: "100%", width: "100%" }, (_c = this.props.box_all) === null || _c === void 0 ? void 0 : _c.style), label: (_d = this.props.box_all) === null || _d === void 0 ? void 0 : _d.label, input: (_e = this.props.box_all) === null || _e === void 0 ? void 0 : _e.input, title: "All", required: false, hideHeader: (_f = this.props.box_all) === null || _f === void 0 ? void 0 : _f.hideHeader, checked: this.getMarkAllValue(), onChanged: this.onMarkAllChecked }), this.props.items.map((e, index) => {
|
|
95
95
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
96
|
-
return _jsx(NSBoxBoolean, { id: e.value, classList: (_a = this.props.boxes) === null || _a === void 0 ? void 0 : _a.classList, style: Object.assign({ width: NSBox.width.one }, (_b = this.props.boxes) === null || _b === void 0 ? void 0 : _b.style), label: (_c = this.props.boxes) === null || _c === void 0 ? void 0 : _c.label, input: (_d = this.props.boxes) === null || _d === void 0 ? void 0 : _d.input, title: e.text, required: true, hideHeader: (_e = this.props.boxes) === null || _e === void 0 ? void 0 : _e.hideHeader, checked: this.state.values.includes(e.value), defaultValue: (_g = (_f = this.props.boxes) === null || _f === void 0 ? void 0 : _f.defaultValue) === null || _g === void 0 ? void 0 : _g.includes(e.value), onChanged: this.onItemChecked }, `NSBoxBooleans_NSBoxBoolean_key_${index}`);
|
|
96
|
+
return _jsx(NSBoxBoolean, { id: e.value, classList: (_a = this.props.boxes) === null || _a === void 0 ? void 0 : _a.classList, style: Object.assign({ width: NSBox.width.one }, (_b = this.props.boxes) === null || _b === void 0 ? void 0 : _b.style), label: (_c = this.props.boxes) === null || _c === void 0 ? void 0 : _c.label, input: (_d = this.props.boxes) === null || _d === void 0 ? void 0 : _d.input, title: e.text, required: true, hideHeader: (_e = this.props.boxes) === null || _e === void 0 ? void 0 : _e.hideHeader, checked: this.state.values.includes(e.value), defaultValue: (_g = (_f = this.props.boxes) === null || _f === void 0 ? void 0 : _f.defaultValue) === null || _g === void 0 ? void 0 : _g.includes(e.value), onChanged: this.onItemChecked, info: e.info }, `NSBoxBooleans_NSBoxBoolean_key_${index}`);
|
|
97
97
|
})] }));
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSBoxBooleans.js","sourceRoot":"","sources":["../../src/components/NSBoxBooleans.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"NSBoxBooleans.js","sourceRoot":"","s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AS,EACtC,KAAK,kBAAI,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,IAAK,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,0CAAE,KAAK,GAC3D,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,0CAAE,KAAK,EAC9B,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,0CAAE,KAAK,EAC9B,KAAK,EAAE,CAAC,CAAC,IAAI,EACb,QAAQ,EAAE,IAAI,EACd,UAAU,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,0CAAE,UAAU,EACxC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAC5C,YAAY,EAAE,MAAA,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,0CAAE,YAAY,0CAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAC/D,SAAS,EAAE,IAAI,CAAC,aAAa,EAC7B,IAAI,EAAE,CAAC,CAAC,IAAI,IAZP,kCAAkC,KAAK,EAAE,CAa7C,CAAA;iBAAA,CACF,IAEA,CACH,CAAC;IACH,CAAC;CACD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Component } from "react";
|
|
2
2
|
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
3
3
|
import { IValidationProps } from "../props/IValidationProps";
|
|
4
4
|
import { IValidationNumberProps } from "../props/IValidationNumberProps";
|
|
@@ -11,8 +11,8 @@ export interface NSBoxMoneyProps extends IBaseComponentProps, IValidationProps,
|
|
|
11
11
|
export interface NSBoxMoneyState {
|
|
12
12
|
value: number | null;
|
|
13
13
|
}
|
|
14
|
-
export declare class NSBoxMoney extends
|
|
15
|
-
NSBoxBaseLayout_Main:
|
|
14
|
+
export declare class NSBoxMoney extends Component<NSBoxMoneyProps, NSBoxMoneyState> implements INSBox {
|
|
15
|
+
NSBoxBaseLayout_Main: import("react").RefObject<NSBoxBaseLayout>;
|
|
16
16
|
constructor(props: NSBoxMoneyProps);
|
|
17
17
|
isEmpty(value: string): boolean;
|
|
18
18
|
getError(): string | null;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import { Component, createRef } from "react";
|
|
4
4
|
import StylesNSBox from "./NSBox.module.css";
|
|
5
5
|
import { Validator } from "../Validator";
|
|
6
6
|
import { safeMenuMenuItem } from "./NSMenuButton";
|
|
7
7
|
import { NSBoxBaseLayout } from "./NSBoxBaseLayout";
|
|
8
|
-
import { NamingConvention } from "namirasoft-core";
|
|
8
|
+
import { NamingConvention, PriceOperation } from "namirasoft-core";
|
|
9
9
|
import { MoneyFormatter } from "../formatter/MoneyFormatter";
|
|
10
|
-
export class NSBoxMoney extends
|
|
10
|
+
export class NSBoxMoney extends Component {
|
|
11
11
|
constructor(props) {
|
|
12
12
|
var _a;
|
|
13
13
|
super(props);
|
|
@@ -44,7 +44,11 @@ export class NSBoxMoney extends React.Component {
|
|
|
44
44
|
let menu = safeMenuMenuItem(this.props, () => { });
|
|
45
45
|
if (!menu.builtin.copy)
|
|
46
46
|
menu.builtin.copy = { enabled: true, getValue: () => { var _a, _b; return (_b = (_a = this.state.value) === null || _a === void 0 ? void 0 : _a.toLocaleString()) !== null && _b !== void 0 ? _b : ""; } };
|
|
47
|
-
return (_jsx(NSBoxBaseLayout, Object.assign({ ref: this.NSBoxBaseLayout_Main }, this.props, { menu: menu, getValue: () =>
|
|
47
|
+
return (_jsx(NSBoxBaseLayout, Object.assign({ ref: this.NSBoxBaseLayout_Main }, this.props, { menu: menu, getValue: () => {
|
|
48
|
+
var _a;
|
|
49
|
+
const value = PriceOperation.fiat_to_millicent((_a = this.getValue(false)) !== null && _a !== void 0 ? _a : 0);
|
|
50
|
+
return new MoneyFormatter().format(value);
|
|
51
|
+
}, children: _jsx("input", { id: (_a = this.props.input) === null || _a === void 0 ? void 0 : _a.id, name: (_b = this.props.input) === null || _b === void 0 ? void 0 : _b.name, type: "number", className: `${StylesNSBox.ns_box_input} ${(_e = (_d = (_c = this.props.input) === null || _c === void 0 ? void 0 : _c.classList) === null || _d === void 0 ? void 0 : _d.join(" ")) !== null && _e !== void 0 ? _e : ""}`, placeholder: (_f = this.props.placeholder) !== null && _f !== void 0 ? _f : `Please enter ${NamingConvention.auto.convert(this.props.title, NamingConvention.lower_case_space)}`, value: (_g = this.state.value) !== null && _g !== void 0 ? _g : "", onChange: e => this.setValue(parseFloat(e.target.value)), onClick: () => { var _a, _b; (_b = (_a = this.props).onClicked) === null || _b === void 0 ? void 0 : _b.call(_a, this); }, inputMode: "decimal", min: Math.max((_h = this.props.min) !== null && _h !== void 0 ? _h : 0, 0), max: this.props.max, pattern: "[0-9]*[.,]?[0-9]" + (this.props.precision ? `{0,${this.props.precision}}` : "*"), step: "0.01", style: Object.assign({ background: `url("https://static.namirasoft.com/image/concept/type/price.png") white no-repeat scroll center right 4px`, backgroundSize: "24px" }, (_j = this.props.input) === null || _j === void 0 ? void 0 : _j.style) }) })));
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
//# sourceMappingURL=NSBoxMoney.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSBoxMoney.js","sourceRoot":"","sources":["../../src/components/NSBoxMoney.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,
|
|
1
|
+
{"version":3,"file":"NSBoxMoney.js","sourceRoot":"","sources":["../../src/components/NSBoxMoney.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAI7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM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AA2G,EACvH,cAAc,EAAE,MAAM,IACnB,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,0CAAE,KAAK,IAEhC,IACY,CACrB,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
min-width: 350px;
|
|
40
40
|
min-height: 50px;
|
|
41
41
|
max-width: 90vw;
|
|
42
|
-
max-height: calc(
|
|
42
|
+
max-height: calc(100dvh - 6.125rem);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.ns_dialog_content {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
min-width: 350px;
|
|
51
51
|
min-height: 50px;
|
|
52
52
|
max-width: 90vw;
|
|
53
|
-
max-height: calc(
|
|
53
|
+
max-height: calc(100dvh - 6.125rem);
|
|
54
54
|
width: 100%;
|
|
55
55
|
height: 100%;
|
|
56
56
|
overflow-y: auto;
|
|
@@ -101,6 +101,6 @@
|
|
|
101
101
|
|
|
102
102
|
.ns_dialog_parent,
|
|
103
103
|
.ns_dialog_content {
|
|
104
|
-
max-height: calc(
|
|
104
|
+
max-height: calc(100dvh - 4rem);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -9,5 +9,7 @@ export interface NSGaugeDateProps extends IBaseComponentProps {
|
|
|
9
9
|
to: Date;
|
|
10
10
|
colors: NSGaugeColorProps;
|
|
11
11
|
link?: ILinkProps;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
noData?: boolean | string;
|
|
12
14
|
}
|
|
13
15
|
export declare function NSGaugeDate(props: NSGaugeDateProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { URLOperation } from "namirasoft-core";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
-
import { NSDownTimer, NSPanel, NSSpace, NSSpaceSizeType } from "../main";
|
|
4
|
+
import { NSDownTimer, NSLoading, NSNoData, NSPanel, NSSpace, NSSpaceSizeType } from "../main";
|
|
5
5
|
import { NSGauge } from "./NSGauge";
|
|
6
6
|
import Styles from "./NSGaugeDate.module.css";
|
|
7
7
|
const getFormattedDate = (date) => {
|
|
@@ -21,9 +21,18 @@ export function NSGaugeDate(props) {
|
|
|
21
21
|
};
|
|
22
22
|
}, [props.to]);
|
|
23
23
|
let total = props.to.getTime() - props.from.getTime();
|
|
24
|
+
let render_gauge_body = () => {
|
|
25
|
+
if (props.loading) {
|
|
26
|
+
return _jsx(NSLoading, { hideTitle: true, style: { margin: "auto 0", padding: 0 } });
|
|
27
|
+
}
|
|
28
|
+
if (props.noData) {
|
|
29
|
+
return (_jsx(NSNoData, { lable: props.noData !== true ? props.noData : "No Data", style: { marginTop: "1.5rem" } }));
|
|
30
|
+
}
|
|
31
|
+
return (_jsxs(_Fragment, { children: [_jsx(NSGauge, { total: total, current: state.current, showPercent: false, colors: props.colors }), _jsxs("div", { className: Styles.ns_gauge_dates, children: [_jsx("span", { children: getFormattedDate(props.from) }), _jsx("span", { children: getFormattedDate(props.to) })] }), _jsx(NSSpace, { size: NSSpaceSizeType.MINI }), _jsx(NSDownTimer, { text: "Remained", date: props.to })] }));
|
|
32
|
+
};
|
|
24
33
|
let content = (_jsxs(NSPanel, { classList: [Styles.ns_gauge_wrapper], children: [_jsxs("div", { className: Styles.ns_gauge_header, children: [props.icon &&
|
|
25
34
|
_jsx("img", { width: "40", height: "40", src: props.icon, alt: "gauge logo" }), _jsxs("div", { className: Styles.ns_gauge_header_titles, children: [props.headline &&
|
|
26
|
-
_jsx("span", { style: { lineHeight: "1rem" }, children: props.headline }), _jsx("span", { className: Styles.title, children: props.title })] })] }),
|
|
35
|
+
_jsx("span", { style: { lineHeight: "1rem" }, children: props.headline }), _jsx("span", { className: Styles.title, children: props.title })] })] }), _jsx("div", { className: Styles.ns_gauge_body, children: render_gauge_body() })] }));
|
|
27
36
|
if (props.link && !URLOperation.isEqual(props.link.href, window.location.href)) {
|
|
28
37
|
content = (_jsx("a", { href: props.link.href, target: props.link.target, rel: "noreferrer", className: Styles.ns_gauge_link, children: content }));
|
|
29
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSGaugeDate.js","sourceRoot":"","sources":["../../src/components/NSGaugeDate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAuB,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"NSGaugeDate.js","sourceRoot":"","sources":["../../src/components/NSGaugeDate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAuB,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEnH,OAAO,EAAE,OAAO,EAAqB,MAAM,WAAW,CAAC;AACvD,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAoB9C,MAAM,gBAAgB,GAAG,CAAC,IAAU,EAAE,EAAE;IAEpC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAChC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC3D,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IA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AI,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC9E,CAAC;QACG,OAAO,GAAG,CACN,YACI,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,EACrB,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,EACzB,GAAG,EAAC,YAAY,EAChB,SAAS,EAAE,MAAM,CAAC,aAAa,YAE9B,OAAO,GACR,CACP,CAAC;IACN,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
|
@@ -10,6 +10,8 @@ export interface NSGaugeNumberProps extends IBaseComponentProps {
|
|
|
10
10
|
colors: NSGaugeColorProps;
|
|
11
11
|
description?: string;
|
|
12
12
|
link?: ILinkProps;
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
noData?: boolean | string;
|
|
13
15
|
formatter?: (value: number) => string;
|
|
14
16
|
}
|
|
15
17
|
export declare function NSGaugeNumber(props: NSGaugeNumberProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { URLOperation } from "namirasoft-core";
|
|
3
|
-
import { NSPanel } from "../main";
|
|
3
|
+
import { NSLoading, NSNoData, NSPanel } from "../main";
|
|
4
4
|
import { NSGauge } from "./NSGauge";
|
|
5
5
|
import Styles from "./NSGaugeNumber.module.css";
|
|
6
6
|
export function NSGaugeNumber(props) {
|
|
7
|
-
var _a
|
|
7
|
+
var _a;
|
|
8
8
|
let formatter = (_a = props === null || props === void 0 ? void 0 : props.formatter) !== null && _a !== void 0 ? _a : (value => value + "");
|
|
9
|
-
let
|
|
9
|
+
let render_gauge_body = () => {
|
|
10
|
+
var _a;
|
|
11
|
+
if (props.loading) {
|
|
12
|
+
return _jsx(NSLoading, { hideTitle: true, style: { margin: "auto 0", padding: 0 } });
|
|
13
|
+
}
|
|
14
|
+
if (props.noData) {
|
|
15
|
+
return (_jsx(NSNoData, { lable: props.noData !== true ? props.noData : "No Data", style: { marginTop: "1.5rem" } }));
|
|
16
|
+
}
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsx(NSGauge, { total: props.total, current: props.current, showPercent: true, colors: props.colors }), _jsxs("div", { className: Styles.ns_title_wrapper, children: [_jsx("span", { className: Styles.title, children: formatter(props.current) }), _jsx("span", { className: Styles.subtitle, children: `Out of ${formatter(props.total)} ${(_a = props.description) !== null && _a !== void 0 ? _a : ""}`.trim() })] })] }));
|
|
18
|
+
};
|
|
19
|
+
let content = (_jsxs(NSPanel, { classList: [Styles.ns_gauge_wrapper], children: [_jsxs("div", { className: Styles.ns_gauge_header, children: [props.icon && _jsx("img", { width: "40", height: "40", src: props.icon, alt: "gauge logo" }), _jsxs("div", { className: Styles.ns_gauge_header_titles, children: [props.headline && _jsx("span", { style: { lineHeight: "1rem" }, children: props.headline }), _jsx("span", { className: Styles.title, children: props.title })] })] }), _jsx("div", { className: Styles.ns_gauge_body, children: render_gauge_body() })] }));
|
|
10
20
|
if (props.link && !URLOperation.isEqual(props.link.href, window.location.href)) {
|
|
11
21
|
content = (_jsx("a", { href: props.link.href, target: props.link.target, rel: "noreferrer", className: Styles.ns_gauge_link, children: content }));
|
|
12
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSGaugeNumber.js","sourceRoot":"","sources":["../../src/components/NSGaugeNumber.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAuB,OAAO,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"NSGaugeNumber.js","sourceRoot":"","sources":["../../src/components/NSGaugeNumber.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAuB,SAAS,EAAE,QAAQ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E,GAClE,IACL,IACP,CACN,CAAC;IACN,CAAC,CAAC;IAEF,IAAI,OAAO,GAAG,CACV,MAAC,OAAO,IAAC,SAAS,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,aACzC,eAAK,SAAS,EAAE,MAAM,CAAC,eAAe,aACjC,KAAK,CAAC,IAAI,IAAI,cAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAC,YAAY,GAAG,EAC/E,eAAK,SAAS,EAAE,MAAM,CAAC,sBAAsB,aACxC,KAAK,CAAC,QAAQ,IAAI,eAAM,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,YAAG,KAAK,CAAC,QAAQ,GAAQ,EAC/E,eAAM,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,CAAC,KAAK,GAAQ,IACjD,IACJ,EACN,cAAK,SAAS,EAAE,MAAM,CAAC,aAAa,YAC/B,iBAAiB,EAAE,GAClB,IACA,CACb,CAAC;IAEF,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC9E,CAAC;QACG,OAAO,GAAG,CACN,YACI,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,EACrB,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,EACzB,GAAG,EAAC,YAAY,EAChB,SAAS,EAAE,MAAM,CAAC,aAAa,YAE9B,OAAO,GACR,CACP,CAAC;IACN,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
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.451",
|
|
12
12
|
"author": "Amir Abolhasani",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "./dist/main.js",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"copy": "copyfiles -u 1 src/**/*.html src/**/*.css src/**/*.svg src/**/*.png src/**/*.jpg dist/"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ant-design/charts": "^2.6.
|
|
24
|
+
"@ant-design/charts": "^2.6.4",
|
|
25
25
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
26
|
-
"@types/node": "^24.3.
|
|
26
|
+
"@types/node": "^24.3.1",
|
|
27
27
|
"@types/react": "^18.3.12",
|
|
28
28
|
"@types/react-bootstrap": "^1.1.0",
|
|
29
29
|
"@types/react-dom": "^18.3.1",
|
|
30
30
|
"@types/react-gtm-module": "^2.0.4",
|
|
31
|
-
"antd": "^5.27.
|
|
31
|
+
"antd": "^5.27.3",
|
|
32
32
|
"async-mutex": "^0.5.0",
|
|
33
33
|
"bootstrap": "^5.3.8",
|
|
34
34
|
"chart.js": "^4.5.0",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"link-react": "^3.0.0",
|
|
37
37
|
"namirasoft-api-link": "^1.4.20",
|
|
38
38
|
"namirasoft-api-product": "^1.4.40",
|
|
39
|
-
"namirasoft-core": "^1.4.
|
|
39
|
+
"namirasoft-core": "^1.4.89",
|
|
40
40
|
"namirasoft-schema": "^1.4.25",
|
|
41
|
-
"namirasoft-site": "^1.4.
|
|
42
|
-
"namirasoft-site-map": "^1.4.
|
|
41
|
+
"namirasoft-site": "^1.4.40",
|
|
42
|
+
"namirasoft-site-map": "^1.4.34",
|
|
43
43
|
"os-browserify": "^0.3.0",
|
|
44
44
|
"path-browserify": "^1.0.1",
|
|
45
45
|
"react": "^18.3.1",
|
package/src/App.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import 'bootstrap/dist/css/bootstrap.min.css';
|
|
|
2
2
|
import { Component, ReactNode } from 'react';
|
|
3
3
|
import './App.css';
|
|
4
4
|
import { NSLayout } from './components/NSLayout';
|
|
5
|
-
import {
|
|
5
|
+
import { NSGaugeDate, NSGaugeNumber, NSRow, NSSection } from './main';
|
|
6
6
|
|
|
7
7
|
interface AppProps { }
|
|
8
8
|
interface AppState
|
|
@@ -47,23 +47,22 @@ export class App extends Component<AppProps, AppState>
|
|
|
47
47
|
scope=''
|
|
48
48
|
>
|
|
49
49
|
<NSSection style={{ paddingTop: "3rem" }}>
|
|
50
|
-
<
|
|
51
|
-
<
|
|
52
|
-
title='
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
<NSRow style={{ alignItems: "stretch" }}>
|
|
51
|
+
<NSGaugeDate
|
|
52
|
+
title='Date Gauge'
|
|
53
|
+
from={new Date(Date.now() - 5 * 60_000)}
|
|
54
|
+
to={new Date(Date.now() + 5 * 60_000)}
|
|
55
|
+
colors={{ low: "green", medium: "yellow", high: "red" }}
|
|
56
|
+
noData
|
|
55
57
|
/>
|
|
56
|
-
<
|
|
57
|
-
title='
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
<NSGaugeNumber
|
|
59
|
+
title='Number Gauge'
|
|
60
|
+
current={13}
|
|
61
|
+
total={100}
|
|
62
|
+
colors={{ low: "green", medium: "yellow", high: "red" }}
|
|
63
|
+
loading
|
|
60
64
|
/>
|
|
61
|
-
|
|
62
|
-
title='Money'
|
|
63
|
-
required={false}
|
|
64
|
-
onChanged={(box) => this.setState({ amount: box.getValue() ?? 0 })}
|
|
65
|
-
/>
|
|
66
|
-
</NSColumn>
|
|
65
|
+
</NSRow>
|
|
67
66
|
</NSSection>
|
|
68
67
|
</NSLayout>
|
|
69
68
|
);
|
|
@@ -2,12 +2,14 @@ import React from "react";
|
|
|
2
2
|
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
3
3
|
import { NSBoxBoolean } from "./NSBoxBoolean";
|
|
4
4
|
import { NSBox } from "./NSBox";
|
|
5
|
+
import { NSInfoProps } from "./NSInfo";
|
|
5
6
|
|
|
6
7
|
export interface NSBoxBooleansProps extends IBaseComponentProps
|
|
7
8
|
{
|
|
8
9
|
items: {
|
|
9
10
|
value: string,
|
|
10
|
-
text: string
|
|
11
|
+
text: string,
|
|
12
|
+
info?: NSInfoProps
|
|
11
13
|
}[];
|
|
12
14
|
reverse?: boolean;
|
|
13
15
|
onChanged?: (e: NSBoxBooleans, callback?: () => void) => void;
|
|
@@ -170,6 +172,7 @@ export class NSBoxBooleans extends React.Component<NSBoxBooleansProps, NSboxBool
|
|
|
170
172
|
checked={this.state.values.includes(e.value)}
|
|
171
173
|
defaultValue={this.props.boxes?.defaultValue?.includes(e.value)}
|
|
172
174
|
onChanged={this.onItemChecked}
|
|
175
|
+
info={e.info}
|
|
173
176
|
/>
|
|
174
177
|
)
|
|
175
178
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { Component, createRef } from "react";
|
|
4
4
|
import StylesNSBox from "./NSBox.module.css";
|
|
5
5
|
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
6
6
|
import { IValidationProps } from "../props/IValidationProps";
|
|
@@ -8,95 +8,99 @@ import { IValidationNumberProps } from "../props/IValidationNumberProps";
|
|
|
8
8
|
import { Validator } from "../Validator";
|
|
9
9
|
import { safeMenuMenuItem } from "./NSMenuButton";
|
|
10
10
|
import { INSBoxBaseLayoutProps, NSBoxBaseLayout } from "./NSBoxBaseLayout";
|
|
11
|
-
import { NamingConvention } from "namirasoft-core";
|
|
11
|
+
import { NamingConvention, PriceOperation } from "namirasoft-core";
|
|
12
12
|
import { IValidationPrecisionProps } from "../props/IValidationPrecisionProps";
|
|
13
13
|
import { INSBox } from "./INSBox";
|
|
14
14
|
import { MoneyFormatter } from "../formatter/MoneyFormatter";
|
|
15
15
|
|
|
16
16
|
export interface NSBoxMoneyProps extends IBaseComponentProps, IValidationProps, IValidationNumberProps, IValidationPrecisionProps, INSBoxBaseLayoutProps<NSBoxMoney, number>
|
|
17
17
|
{
|
|
18
|
-
|
|
18
|
+
input?: IBaseComponentProps;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export interface NSBoxMoneyState
|
|
22
22
|
{
|
|
23
|
-
|
|
23
|
+
value: number | null;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export class NSBoxMoney extends
|
|
26
|
+
export class NSBoxMoney extends Component<NSBoxMoneyProps, NSBoxMoneyState> implements INSBox
|
|
27
27
|
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
28
|
+
NSBoxBaseLayout_Main = createRef<NSBoxBaseLayout>();
|
|
29
|
+
constructor(props: NSBoxMoneyProps)
|
|
30
|
+
{
|
|
31
|
+
super(props);
|
|
32
|
+
this.state = { value: props.defaultValue ?? null };
|
|
33
|
+
this.isEmpty = this.isEmpty.bind(this);
|
|
34
|
+
this.getError = this.getError.bind(this);
|
|
35
|
+
this.getValue = this.getValue.bind(this);
|
|
36
|
+
this.setValue = this.setValue.bind(this);
|
|
37
|
+
}
|
|
38
|
+
isEmpty(value: string)
|
|
39
|
+
{
|
|
40
|
+
if ((value ?? "").trim())
|
|
41
|
+
return false;
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
getError(): string | null
|
|
45
|
+
{
|
|
46
|
+
return (
|
|
47
|
+
Validator.getError(this.props.title, this.state.value, this.props) ||
|
|
48
|
+
Validator.getErrorNumber(this.props.title, this.state.value, this.props)
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
getValue(checkError: boolean = true): number | null
|
|
52
|
+
{
|
|
53
|
+
return NSBoxBaseLayout.checkGetValue(this, checkError, () => this.state.value);
|
|
54
|
+
}
|
|
55
|
+
setValue(value: number | null, callback?: () => void): void
|
|
56
|
+
{
|
|
57
|
+
if (Number.isNaN(value))
|
|
58
|
+
value = null;
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
60
|
+
this.setState({ value }, () =>
|
|
61
|
+
{
|
|
62
|
+
this.props.onChanged?.(this);
|
|
63
|
+
callback?.();
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
override render()
|
|
67
|
+
{
|
|
68
|
+
let menu = safeMenuMenuItem(this.props, () => { });
|
|
69
|
+
if (!menu.builtin.copy)
|
|
70
|
+
menu.builtin.copy = { enabled: true, getValue: () => this.state.value?.toLocaleString() ?? "" };
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
72
|
+
return (
|
|
73
|
+
<NSBoxBaseLayout
|
|
74
|
+
ref={this.NSBoxBaseLayout_Main}
|
|
75
|
+
{...this.props}
|
|
76
|
+
menu={menu}
|
|
77
|
+
getValue={() =>
|
|
78
|
+
{
|
|
79
|
+
const value = PriceOperation.fiat_to_millicent(this.getValue(false) ?? 0);
|
|
80
|
+
return new MoneyFormatter().format(value);
|
|
81
|
+
}}
|
|
82
|
+
>
|
|
83
|
+
<input
|
|
84
|
+
id={this.props.input?.id}
|
|
85
|
+
name={this.props.input?.name}
|
|
86
|
+
type="number"
|
|
87
|
+
className={`${StylesNSBox.ns_box_input} ${this.props.input?.classList?.join(" ") ?? ""}`}
|
|
88
|
+
placeholder={this.props.placeholder ?? `Please enter ${NamingConvention.auto.convert(this.props.title, NamingConvention.lower_case_space)}`}
|
|
89
|
+
value={this.state.value ?? ""}
|
|
90
|
+
onChange={e => this.setValue(parseFloat(e.target.value))}
|
|
91
|
+
onClick={() => { this.props.onClicked?.(this); }}
|
|
92
|
+
inputMode="decimal"
|
|
93
|
+
min={Math.max(this.props.min ?? 0, 0)}
|
|
94
|
+
max={this.props.max}
|
|
95
|
+
pattern={"[0-9]*[.,]?[0-9]" + (this.props.precision ? `{0,${this.props.precision}}` : "*")}
|
|
96
|
+
step="0.01"
|
|
97
|
+
style={{
|
|
98
|
+
background: `url("https://static.namirasoft.com/image/concept/type/price.png") white no-repeat scroll center right 4px`,
|
|
99
|
+
backgroundSize: "24px",
|
|
100
|
+
...this.props.input?.style
|
|
101
|
+
}}
|
|
102
|
+
/>
|
|
103
|
+
</NSBoxBaseLayout>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
102
106
|
}
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
min-width: 350px;
|
|
40
40
|
min-height: 50px;
|
|
41
41
|
max-width: 90vw;
|
|
42
|
-
max-height: calc(
|
|
42
|
+
max-height: calc(100dvh - 6.125rem);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.ns_dialog_content {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
min-width: 350px;
|
|
51
51
|
min-height: 50px;
|
|
52
52
|
max-width: 90vw;
|
|
53
|
-
max-height: calc(
|
|
53
|
+
max-height: calc(100dvh - 6.125rem);
|
|
54
54
|
width: 100%;
|
|
55
55
|
height: 100%;
|
|
56
56
|
overflow-y: auto;
|
|
@@ -101,6 +101,6 @@
|
|
|
101
101
|
|
|
102
102
|
.ns_dialog_parent,
|
|
103
103
|
.ns_dialog_content {
|
|
104
|
-
max-height: calc(
|
|
104
|
+
max-height: calc(100dvh - 4rem);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { URLOperation } from "namirasoft-core";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import { IBaseComponentProps, NSDownTimer, NSPanel, NSSpace, NSSpaceSizeType } from "../main";
|
|
3
|
+
import { IBaseComponentProps, NSDownTimer, NSLoading, NSNoData, NSPanel, NSSpace, NSSpaceSizeType } from "../main";
|
|
4
4
|
import { ILinkProps } from "../props/ILinkProps";
|
|
5
5
|
import { NSGauge, NSGaugeColorProps } from "./NSGauge";
|
|
6
6
|
import Styles from "./NSGaugeDate.module.css";
|
|
@@ -14,6 +14,8 @@ export interface NSGaugeDateProps extends IBaseComponentProps
|
|
|
14
14
|
to: Date;
|
|
15
15
|
colors: NSGaugeColorProps;
|
|
16
16
|
link?: ILinkProps;
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
noData?: boolean | string;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
interface NSGaugeDateState
|
|
@@ -49,6 +51,42 @@ export function NSGaugeDate(props: NSGaugeDateProps)
|
|
|
49
51
|
}, [props.to]);
|
|
50
52
|
|
|
51
53
|
let total = props.to.getTime() - props.from.getTime();
|
|
54
|
+
|
|
55
|
+
let render_gauge_body = () =>
|
|
56
|
+
{
|
|
57
|
+
if (props.loading)
|
|
58
|
+
{
|
|
59
|
+
return <NSLoading hideTitle style={{ margin: "auto 0", padding: 0 }} />;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (props.noData)
|
|
63
|
+
{
|
|
64
|
+
return (
|
|
65
|
+
<NSNoData
|
|
66
|
+
lable={props.noData !== true ? props.noData : "No Data"}
|
|
67
|
+
style={{ marginTop: "1.5rem" }}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<>
|
|
74
|
+
<NSGauge total={total} current={state.current} showPercent={false} colors={props.colors} />
|
|
75
|
+
<div className={Styles.ns_gauge_dates}>
|
|
76
|
+
<span>{getFormattedDate(props.from)}</span>
|
|
77
|
+
<span>{getFormattedDate(props.to)}</span>
|
|
78
|
+
</div>
|
|
79
|
+
<NSSpace
|
|
80
|
+
size={NSSpaceSizeType.MINI}
|
|
81
|
+
/>
|
|
82
|
+
<NSDownTimer
|
|
83
|
+
text="Remained"
|
|
84
|
+
date={props.to}
|
|
85
|
+
/>
|
|
86
|
+
</>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
|
|
52
90
|
let content = (
|
|
53
91
|
<NSPanel classList={[Styles.ns_gauge_wrapper]}>
|
|
54
92
|
<div className={Styles.ns_gauge_header}>
|
|
@@ -65,18 +103,7 @@ export function NSGaugeDate(props: NSGaugeDateProps)
|
|
|
65
103
|
</div>
|
|
66
104
|
</div>
|
|
67
105
|
<div className={Styles.ns_gauge_body}>
|
|
68
|
-
|
|
69
|
-
<div className={Styles.ns_gauge_dates}>
|
|
70
|
-
<span>{getFormattedDate(props.from)}</span>
|
|
71
|
-
<span>{getFormattedDate(props.to)}</span>
|
|
72
|
-
</div>
|
|
73
|
-
<NSSpace
|
|
74
|
-
size={NSSpaceSizeType.MINI}
|
|
75
|
-
/>
|
|
76
|
-
<NSDownTimer
|
|
77
|
-
text="Remained"
|
|
78
|
-
date={props.to}
|
|
79
|
-
/>
|
|
106
|
+
{render_gauge_body()}
|
|
80
107
|
</div>
|
|
81
108
|
</NSPanel>
|
|
82
109
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { URLOperation } from "namirasoft-core";
|
|
2
|
-
import { IBaseComponentProps, NSPanel } from "../main";
|
|
2
|
+
import { IBaseComponentProps, NSLoading, NSNoData, NSPanel } from "../main";
|
|
3
3
|
import { ILinkProps } from "../props/ILinkProps";
|
|
4
4
|
import { NSGauge, NSGaugeColorProps } from "./NSGauge";
|
|
5
5
|
import Styles from "./NSGaugeNumber.module.css";
|
|
@@ -14,6 +14,8 @@ export interface NSGaugeNumberProps extends IBaseComponentProps
|
|
|
14
14
|
colors: NSGaugeColorProps;
|
|
15
15
|
description?: string;
|
|
16
16
|
link?: ILinkProps;
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
noData?: boolean | string;
|
|
17
19
|
formatter?: (value: number) => string;
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -21,7 +23,42 @@ export function NSGaugeNumber(props: NSGaugeNumberProps)
|
|
|
21
23
|
{
|
|
22
24
|
let formatter = props?.formatter ?? (value => value + "");
|
|
23
25
|
|
|
24
|
-
let
|
|
26
|
+
let render_gauge_body = () =>
|
|
27
|
+
{
|
|
28
|
+
if (props.loading)
|
|
29
|
+
{
|
|
30
|
+
return <NSLoading hideTitle style={{ margin: "auto 0", padding: 0 }} />;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (props.noData)
|
|
34
|
+
{
|
|
35
|
+
return (
|
|
36
|
+
<NSNoData
|
|
37
|
+
lable={props.noData !== true ? props.noData : "No Data"}
|
|
38
|
+
style={{ marginTop: "1.5rem" }}
|
|
39
|
+
/>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<>
|
|
45
|
+
<NSGauge
|
|
46
|
+
total={props.total}
|
|
47
|
+
current={props.current}
|
|
48
|
+
showPercent
|
|
49
|
+
colors={props.colors}
|
|
50
|
+
/>
|
|
51
|
+
<div className={Styles.ns_title_wrapper}>
|
|
52
|
+
<span className={Styles.title}>{formatter(props.current)}</span>
|
|
53
|
+
<span className={Styles.subtitle}>
|
|
54
|
+
{`Out of ${formatter(props.total)} ${props.description ?? ""}`.trim()}
|
|
55
|
+
</span>
|
|
56
|
+
</div>
|
|
57
|
+
</>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
let content = (
|
|
25
62
|
<NSPanel classList={[Styles.ns_gauge_wrapper]}>
|
|
26
63
|
<div className={Styles.ns_gauge_header}>
|
|
27
64
|
{props.icon && <img width="40" height="40" src={props.icon} alt="gauge logo" />}
|
|
@@ -31,13 +68,10 @@ export function NSGaugeNumber(props: NSGaugeNumberProps)
|
|
|
31
68
|
</div>
|
|
32
69
|
</div>
|
|
33
70
|
<div className={Styles.ns_gauge_body}>
|
|
34
|
-
|
|
35
|
-
<div className={Styles.ns_title_wrapper}>
|
|
36
|
-
<span className={Styles.title}>{formatter(props.current)}</span>
|
|
37
|
-
<span className={Styles.subtitle}>{(`Out of ${formatter(props.total)} ` + (props.description ?? "")).trim()}</span>
|
|
38
|
-
</div>
|
|
71
|
+
{render_gauge_body()}
|
|
39
72
|
</div>
|
|
40
|
-
</NSPanel
|
|
73
|
+
</NSPanel>
|
|
74
|
+
);
|
|
41
75
|
|
|
42
76
|
if (props.link && !URLOperation.isEqual(props.link.href, window.location.href))
|
|
43
77
|
{
|