namirasoft-account-react 1.3.175 → 1.3.177
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/NSAProductListModal.js +13 -4
- package/dist/components/NSAProductListModal.js.map +1 -1
- package/dist/components/NSAProductListModal.module.css +2 -0
- package/package.json +1 -1
- package/src/components/NSAProductListModal.module.css +2 -0
- package/src/components/NSAProductListModal.tsx +16 -6
|
@@ -5,15 +5,19 @@ import { NamirasoftAPIProductServer } from 'namirasoft-api-product';
|
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
6
|
import CloseToast from '../assets/images/icon-close.png';
|
|
7
7
|
import { NSBoxSearch } from "namirasoft-site-react";
|
|
8
|
+
import { NSLoading } from 'namirasoft-site-react';
|
|
8
9
|
function ProductName() {
|
|
9
10
|
const [state, setState] = useState({ products: [] });
|
|
10
11
|
useEffect(() => {
|
|
12
|
+
handleProducts();
|
|
13
|
+
}, []);
|
|
14
|
+
const handleProducts = () => () => {
|
|
11
15
|
let server = new NamirasoftAPIProductServer(console.error);
|
|
12
16
|
server.product.List(null, null, null).then((products) => {
|
|
13
17
|
setState({ products: products.rows });
|
|
14
18
|
}).catch(() => { });
|
|
15
|
-
}
|
|
16
|
-
return (_jsx("div", { className: Styles.nsa_product_list_border, children: state.products.map((product) => (_jsxs("div", { className: Styles.nsa_product_list, children: [_jsx("img", { src: `${product.logo}`, alt: product.name, width: 65, height: 65, className: 'rounded-circle' }), _jsx("div", { children: _jsx("
|
|
19
|
+
};
|
|
20
|
+
return (_jsx("div", { className: Styles.nsa_product_list_border, children: state.products.map((product) => (_jsxs("div", { className: Styles.nsa_product_list, children: [_jsx("img", { src: `${product.logo}`, alt: product.name, width: 65, height: 65, className: 'rounded-circle' }), _jsx("div", { children: _jsx("span", { children: `${product.name}` }) })] }))) }));
|
|
17
21
|
}
|
|
18
22
|
export class NSAProductListModal extends Component {
|
|
19
23
|
constructor(props) {
|
|
@@ -28,15 +32,20 @@ export class NSAProductListModal extends Component {
|
|
|
28
32
|
document.removeEventListener('mousedown', this.onClickOutside);
|
|
29
33
|
}
|
|
30
34
|
onClickOutside(event) {
|
|
31
|
-
debugger;
|
|
32
35
|
if (this.toastRef.current && !this.toastRef.current.contains(event.target))
|
|
33
36
|
this.props.onClose();
|
|
34
37
|
}
|
|
35
38
|
render() {
|
|
39
|
+
let content = null;
|
|
40
|
+
if (this.state.products == null)
|
|
41
|
+
content = _jsx(NSLoading, {});
|
|
42
|
+
else {
|
|
43
|
+
content = _jsx(ProductName, {});
|
|
44
|
+
}
|
|
36
45
|
return (_jsxs(_Fragment, { children: [_jsx("div", { className: Styles.nsa_product_container, ref: this.toastRef, children: _jsxs("div", { className: Styles.nsa_product_group, children: [_jsx("div", { className: 'd-flex w-100 justify-content-end px-4', children: _jsx("img", { src: CloseToast, alt: "Close", width: 18, height: 18, onClick: (e) => {
|
|
37
46
|
e.stopPropagation();
|
|
38
47
|
this.props.onClose();
|
|
39
|
-
}, className: Styles.nsa_close_icon }) }), _jsx(NSBoxSearch, { title: "", required: false, style: { position: "fixed" } }),
|
|
48
|
+
}, className: Styles.nsa_close_icon }) }), _jsx(NSBoxSearch, { title: "", required: false, style: { position: "fixed" } }), content] }) }), _jsx("div", { className: Styles.nsa_toast_background })] }));
|
|
40
49
|
}
|
|
41
50
|
}
|
|
42
51
|
export default NSAProductListModal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSAProductListModal.js","sourceRoot":"","sources":["../../src/components/NSAProductListModal.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,MAAM,MAAM,kCAAkC,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAkB,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,UAAU,MAAM,iCAAiC,CAAC;AACzD,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CACH,8BACI,cAAK,SAAS,EAAE,MAAM,CAAC,qBAAqB,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,YAC5D,eAAK,SAAS,EAAE,MAAM,CAAC,iBAAiB,aACpC,cAAK,SAAS,EAAC,uCAAuC,YAClD,cACI,GAAG,EAAE,UAAU,EACf,GAAG,EAAC,OAAO,EACX,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;wCAEX,CAAC,CAAC,eAAe,EAAE,CAAC;wCACpB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;oCACzB,CAAC,EACD,SAAS,EAAE,MAAM,CAAC,cAAc,GAClC,GACA,EACN,KAAC,WAAW,IAAC,KAAK,EAAC,EAAE,EAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAI,EACtE,OAAO,IACN,GACJ,EACN,cAAK,SAAS,EAAE,MAAM,CAAC,oBAAoB,GACrC,IACP,CACN,CAAC;IACN,CAAC;CACJ;AAED,eAAe,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import { NamirasoftAPIProductServer, ProductFullRow } from 'namirasoft-api-produ
|
|
|
4
4
|
import { useEffect, useState } from 'react';
|
|
5
5
|
import CloseToast from '../assets/images/icon-close.png';
|
|
6
6
|
import { NSBoxSearch } from "namirasoft-site-react";
|
|
7
|
+
import { NSLoading } from 'namirasoft-site-react';
|
|
7
8
|
|
|
8
9
|
export interface NSAProductListProps
|
|
9
10
|
{
|
|
@@ -19,14 +20,18 @@ function ProductName()
|
|
|
19
20
|
const [state, setState] = useState<NSAProductListState>({ products: [] });
|
|
20
21
|
|
|
21
22
|
useEffect(() =>
|
|
23
|
+
{
|
|
24
|
+
handleProducts();
|
|
25
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
+
}, []);
|
|
27
|
+
const handleProducts = () => () =>
|
|
22
28
|
{
|
|
23
29
|
let server = new NamirasoftAPIProductServer(console.error);
|
|
24
30
|
server.product.List(null, null, null).then((products) =>
|
|
25
31
|
{
|
|
26
32
|
setState({ products: products.rows });
|
|
27
33
|
}).catch(() => { });
|
|
28
|
-
|
|
29
|
-
}, []);
|
|
34
|
+
}
|
|
30
35
|
|
|
31
36
|
return (
|
|
32
37
|
<div className={Styles.nsa_product_list_border}>
|
|
@@ -35,8 +40,7 @@ function ProductName()
|
|
|
35
40
|
<div className={Styles.nsa_product_list}>
|
|
36
41
|
<img src={`${product.logo}`} alt={product.name} width={65} height={65} className='rounded-circle' />
|
|
37
42
|
<div>
|
|
38
|
-
|
|
39
|
-
<h4>{`History`}</h4>
|
|
43
|
+
<span>{`${product.name}`}</span>
|
|
40
44
|
</div>
|
|
41
45
|
</div>
|
|
42
46
|
))
|
|
@@ -63,12 +67,18 @@ export class NSAProductListModal extends Component<NSAProductListProps, NSAProdu
|
|
|
63
67
|
}
|
|
64
68
|
private onClickOutside(event: MouseEvent)
|
|
65
69
|
{
|
|
66
|
-
debugger
|
|
67
70
|
if (this.toastRef.current && !this.toastRef.current.contains(event.target as Node))
|
|
68
71
|
this.props.onClose();
|
|
69
72
|
}
|
|
70
73
|
override render()
|
|
71
74
|
{
|
|
75
|
+
let content = null;
|
|
76
|
+
if (this.state.products == null)
|
|
77
|
+
content = <NSLoading />
|
|
78
|
+
else
|
|
79
|
+
{
|
|
80
|
+
content = <ProductName />
|
|
81
|
+
}
|
|
72
82
|
return (
|
|
73
83
|
<>
|
|
74
84
|
<div className={Styles.nsa_product_container} ref={this.toastRef}>
|
|
@@ -88,7 +98,7 @@ export class NSAProductListModal extends Component<NSAProductListProps, NSAProdu
|
|
|
88
98
|
/>
|
|
89
99
|
</div>
|
|
90
100
|
<NSBoxSearch title="" required={false} style={{ position: "fixed" }} />
|
|
91
|
-
|
|
101
|
+
{content}
|
|
92
102
|
</div>
|
|
93
103
|
</div>
|
|
94
104
|
<div className={Styles.nsa_toast_background}>
|