namirasoft-site-react 1.4.416 → 1.4.418
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/NSListProduct.d.ts +3 -0
- package/dist/components/NSListProduct.js +5 -5
- package/dist/components/NSListProduct.js.map +1 -1
- package/dist/components/NSTabPage.d.ts +1 -0
- package/dist/components/NSTabPage.js +11 -8
- package/dist/components/NSTabPage.js.map +1 -1
- package/package.json +2 -2
- package/src/components/NSListProduct.tsx +6 -2
- package/src/components/NSTabPage.tsx +12 -7
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
1
2
|
export interface NSListProductProps {
|
|
2
3
|
scope: string;
|
|
3
4
|
name: string;
|
|
5
|
+
getChildrenBefore?: () => ReactNode;
|
|
6
|
+
getChildrenAfter?: () => ReactNode;
|
|
4
7
|
}
|
|
5
8
|
export declare function NSListProduct(props: NSListProductProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { NamirasoftAPIProductServer } from "namirasoft-api-product";
|
|
4
4
|
import { NSCard } from "./NSCard";
|
|
@@ -13,9 +13,9 @@ export function NSListProduct(props) {
|
|
|
13
13
|
setState({ products: products.rows });
|
|
14
14
|
}).catch(() => { });
|
|
15
15
|
}, []);
|
|
16
|
-
return (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
return (_jsxs(NSSection, { style: { gap: "16px" }, children: [props.getChildrenBefore && props.getChildrenBefore(), state.products.map((product) => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
return (_jsx(NSCard, { link: { href: (_a = product.link) !== null && _a !== void 0 ? _a : "" }, title: product.name, image: { src: (_b = product.logo) !== null && _b !== void 0 ? _b : '', alt: product.name } }, product.id));
|
|
19
|
+
}), props.getChildrenAfter && props.getChildrenAfter()] }));
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=NSListProduct.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSListProduct.js","sourceRoot":"","sources":["../../src/components/NSListProduct.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"NSListProduct.js","sourceRoot":"","sources":["../../src/components/NSListProduct.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAAkB,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAexC,MAAM,UAAU,aAAa,CAAC,KAAyB;IAEnD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAqB,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;IAEzE,SAAS,CAAC,GAAG,EAAE;QAEX,IAAI,8BAA8B,GAAG,IAAI,UAAU,CAAC,gCAAgC,EAAE,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;QACxG,IAAI,MAAM,GAAG,IAAI,0BAA0B,CAAC,8BAA8B,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QACvF,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YAExF,QAAQ,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAExB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACH,MAAC,SAAS,IAAC,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,aAC5B,KAAK,CAAC,iBAAiB,IAAI,KAAK,CAAC,iBAAiB,EAAE,EAEjD,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAuB,EAAE,EAAE;;gBAE3C,OAAO,CACH,KAAC,MAAM,IAAkB,IAAI,EAAE,EAAE,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,IAAI,EAAE,IAA1H,OAAO,CAAC,EAAE,CAAoH,CAC9I,CAAC;YACN,CAAC,CAAC,EAEL,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,gBAAgB,EAAE,IAC1C,CAChB,CAAC;AACN,CAAC"}
|
|
@@ -15,6 +15,7 @@ export interface NSTabPageProps extends IBaseComponentProps {
|
|
|
15
15
|
export interface NSTabPageState {
|
|
16
16
|
activeTabIndex: number;
|
|
17
17
|
isClicked: boolean[];
|
|
18
|
+
info?: NSInfoProps;
|
|
18
19
|
}
|
|
19
20
|
export declare class NSTabPage extends Component<NSTabPageProps, NSTabPageState> {
|
|
20
21
|
ns_info: import("react").RefObject<NSInfo>;
|
|
@@ -11,7 +11,8 @@ export class NSTabPage extends Component {
|
|
|
11
11
|
let activeTabIndex = (_a = this.props.activeTabIndex) !== null && _a !== void 0 ? _a : 0;
|
|
12
12
|
this.state = {
|
|
13
13
|
activeTabIndex,
|
|
14
|
-
isClicked: this.props.tabs.map((tab, index) => tab.clicked || activeTabIndex === index)
|
|
14
|
+
isClicked: this.props.tabs.map((tab, index) => tab.clicked || activeTabIndex === index),
|
|
15
|
+
info: undefined
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
18
|
setClicked(indices, callback) {
|
|
@@ -28,18 +29,20 @@ export class NSTabPage extends Component {
|
|
|
28
29
|
let isClicked = this.state.isClicked;
|
|
29
30
|
isClicked[index] = true;
|
|
30
31
|
this.setState({ activeTabIndex: index, isClicked });
|
|
31
|
-
}, children: [tab.title, (((_a = tab.info) === null || _a === void 0 ? void 0 : _a.text) || ((_b = tab.info) === null || _b === void 0 ? void 0 : _b.link)) &&
|
|
32
|
-
|
|
32
|
+
}, children: [tab.title, (this.state.activeTabIndex === index && (((_a = tab.info) === null || _a === void 0 ? void 0 : _a.text) || ((_b = tab.info) === null || _b === void 0 ? void 0 : _b.link))) &&
|
|
33
|
+
_jsx(_Fragment, { children: _jsx("img", { src: "https://static.namirasoft.com/image/concept/info/white-blue.svg", onClick: () => {
|
|
34
|
+
this.setState({ info: tab.info }, () => {
|
|
33
35
|
var _a;
|
|
34
36
|
(_a = this.ns_info.current) === null || _a === void 0 ? void 0 : _a.onClick();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
});
|
|
38
|
+
}, alt: "info", width: 24, height: 24, style: {
|
|
39
|
+
cursor: "pointer",
|
|
40
|
+
marginLeft: "8px"
|
|
41
|
+
} }) })] }, `NSTabPage_li_key_${index}`));
|
|
39
42
|
}) }), _jsx("div", { id: (_c = this.props.container) === null || _c === void 0 ? void 0 : _c.id, className: (_f = (_e = (_d = this.props.container) === null || _d === void 0 ? void 0 : _d.classList) === null || _e === void 0 ? void 0 : _e.join(" ")) !== null && _f !== void 0 ? _f : "", style: Object.assign({}, (_g = this.props.container) === null || _g === void 0 ? void 0 : _g.style), children: this.props.tabs.map((tab, index) => {
|
|
40
43
|
var _a, _b;
|
|
41
44
|
return (_jsx("div", { id: tab.id, className: `${Styles.ns_tab_content_column} ${(_b = (_a = tab.classList) === null || _a === void 0 ? void 0 : _a.join(" ")) !== null && _b !== void 0 ? _b : ""}`, style: Object.assign(Object.assign({}, tab.style), { display: index === this.state.activeTabIndex ? "flex" : "none" }), children: this.state.isClicked[index] ? tab.getContent() : _jsx(_Fragment, {}) }, `NSTabPage_div_key_${this.props.name}_${index}`));
|
|
42
|
-
}) })] }));
|
|
45
|
+
}) }), _jsx(NSInfo, Object.assign({ ref: this.ns_info }, this.state.info))] }));
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
//# sourceMappingURL=NSTabPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSTabPage.js","sourceRoot":"","sources":["../../src/components/NSTabPage.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAe,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"NSTabPage.js","sourceRoot":"","sources":["../../src/components/NSTabPage.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAe,MAAM,SAAS,CAAC;AAwB9C,MAAM,OAAO,SAAU,SAAQ,SAAyC;IAGvE,YAAY,KAAqB;;QAEhC,KAAK,CAAC,KAAK,CAAC,CAAC;QAHd,YAAO,GAAG,SAAS,EAAU,CAAC;QAI7B,IAAI,cAAc,GAAG,MAAA,IAAI,CAAC,KAAK,CAAC,cAAc,mCAAI,CAAC,CAAC;QACpD,IAAI,CAAC,KAAK,GAAG;YACZ,cAAc;YACd,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,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GAAG,CAAC,mCAAI,EAAE,EAAE,EAC9E,KAAK,kCAAO,GAAG,CAAC,KAAK,KAAE,OAAO,EAAE,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,eAGpF,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,mBAAK,IALlD,qBAAqB,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,EAAE,CAO/C,CACN,CAAA;qBAAA,CAAC,GAEE,EACN,KAAC,MAAM,kBACN,GAAG,EAAE,IAAI,CAAC,OAAO,IACb,IAAI,CAAC,KAAK,CAAC,IAAI,EAClB,IACG,CACN,CAAC;IACH,CAAC;CACD"}
|
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.418",
|
|
12
12
|
"author": "Amir Abolhasani",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "./dist/main.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@ant-design/charts": "^2.4.0",
|
|
25
25
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
26
|
-
"@types/node": "^24.0.
|
|
26
|
+
"@types/node": "^24.0.7",
|
|
27
27
|
"@types/react": "^18.3.12",
|
|
28
28
|
"@types/react-bootstrap": "^1.1.0",
|
|
29
29
|
"@types/react-dom": "^18.3.1",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
1
|
+
import { useState, useEffect, ReactNode } from "react";
|
|
2
2
|
import { NamirasoftAPIProductServer, ProductFullRow } from "namirasoft-api-product";
|
|
3
3
|
import { NSCard } from "./NSCard";
|
|
4
4
|
import { EnvService } from 'namirasoft-core'
|
|
@@ -8,6 +8,8 @@ export interface NSListProductProps
|
|
|
8
8
|
{
|
|
9
9
|
scope: string;
|
|
10
10
|
name: string;
|
|
11
|
+
getChildrenBefore?: () => ReactNode;
|
|
12
|
+
getChildrenAfter?: () => ReactNode;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
interface NSListProductState
|
|
@@ -32,6 +34,7 @@ export function NSListProduct(props: NSListProductProps)
|
|
|
32
34
|
|
|
33
35
|
return (
|
|
34
36
|
<NSSection style={{ gap: "16px" }}>
|
|
37
|
+
{props.getChildrenBefore && props.getChildrenBefore()}
|
|
35
38
|
{
|
|
36
39
|
state.products.map((product: ProductFullRow) =>
|
|
37
40
|
{
|
|
@@ -40,6 +43,7 @@ export function NSListProduct(props: NSListProductProps)
|
|
|
40
43
|
);
|
|
41
44
|
})
|
|
42
45
|
}
|
|
43
|
-
|
|
46
|
+
{props.getChildrenAfter && props.getChildrenAfter()}
|
|
47
|
+
</NSSection >
|
|
44
48
|
);
|
|
45
49
|
}
|
|
@@ -23,6 +23,7 @@ export interface NSTabPageState
|
|
|
23
23
|
{
|
|
24
24
|
activeTabIndex: number;
|
|
25
25
|
isClicked: boolean[];
|
|
26
|
+
info?: NSInfoProps;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export class NSTabPage extends Component<NSTabPageProps, NSTabPageState>
|
|
@@ -34,7 +35,8 @@ export class NSTabPage extends Component<NSTabPageProps, NSTabPageState>
|
|
|
34
35
|
let activeTabIndex = this.props.activeTabIndex ?? 0;
|
|
35
36
|
this.state = {
|
|
36
37
|
activeTabIndex,
|
|
37
|
-
isClicked: this.props.tabs.map((tab, index) => tab.clicked || activeTabIndex === index)
|
|
38
|
+
isClicked: this.props.tabs.map((tab, index) => tab.clicked || activeTabIndex === index),
|
|
39
|
+
info: undefined
|
|
38
40
|
};
|
|
39
41
|
}
|
|
40
42
|
setClicked(indices: number[], callback: () => void)
|
|
@@ -66,13 +68,16 @@ export class NSTabPage extends Component<NSTabPageProps, NSTabPageState>
|
|
|
66
68
|
>
|
|
67
69
|
{tab.title}
|
|
68
70
|
{
|
|
69
|
-
(tab.info?.text || tab.info?.link) &&
|
|
71
|
+
(this.state.activeTabIndex === index && (tab.info?.text || tab.info?.link)) &&
|
|
70
72
|
<>
|
|
71
73
|
<img
|
|
72
74
|
src="https://static.namirasoft.com/image/concept/info/white-blue.svg"
|
|
73
75
|
onClick={() =>
|
|
74
76
|
{
|
|
75
|
-
this.
|
|
77
|
+
this.setState({ info: tab.info }, () =>
|
|
78
|
+
{
|
|
79
|
+
this.ns_info.current?.onClick();
|
|
80
|
+
})
|
|
76
81
|
}}
|
|
77
82
|
alt="info"
|
|
78
83
|
width={24}
|
|
@@ -82,10 +87,6 @@ export class NSTabPage extends Component<NSTabPageProps, NSTabPageState>
|
|
|
82
87
|
marginLeft: "8px"
|
|
83
88
|
}}
|
|
84
89
|
/>
|
|
85
|
-
<NSInfo
|
|
86
|
-
ref={this.ns_info}
|
|
87
|
-
{...tab.info}
|
|
88
|
-
/>
|
|
89
90
|
</>
|
|
90
91
|
}
|
|
91
92
|
</li>
|
|
@@ -112,6 +113,10 @@ export class NSTabPage extends Component<NSTabPageProps, NSTabPageState>
|
|
|
112
113
|
))
|
|
113
114
|
}
|
|
114
115
|
</div>
|
|
116
|
+
<NSInfo
|
|
117
|
+
ref={this.ns_info}
|
|
118
|
+
{...this.state.info}
|
|
119
|
+
/>
|
|
115
120
|
</div>
|
|
116
121
|
);
|
|
117
122
|
}
|