namirasoft-account-react 1.3.163 → 1.3.165

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 CHANGED
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import NSAProductListModal from "./components/NSAProductListModal";
2
3
  export function App() {
3
- return (_jsx("div", {}));
4
+ return (_jsx("div", { children: _jsx(NSAProductListModal, { onClose: () => { } }) }));
4
5
  }
5
6
  ;
6
7
  //# 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,MAAM,UAAU,GAAG;IAEf,OAAO,CACH,eACM,CACT,CAAC;AACN,CAAC;AAAA,CAAC"}
1
+ {"version":3,"file":"App.js","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,MAAM,kCAAkC,CAAC;AAEnE,MAAM,UAAU,GAAG;IAEf,OAAO,CACH,wBACI,KAAC,mBAAmB,IAAC,OAAO,EAAE,GAAE,EAAE,GAAC,CAAC,GAAG,GACrC,CACT,CAAC;AACN,CAAC;AAAA,CAAC"}
@@ -95,7 +95,7 @@
95
95
  position: absolute;
96
96
  right: 0;
97
97
  z-index: 1;
98
- top: 30;
98
+ top: 30px;
99
99
  left: auto;
100
100
  transform: translate(0%, 0%);
101
101
  width: 275px;
@@ -1,5 +1,5 @@
1
- import { ProductFullRow } from 'namirasoft-api-product';
2
1
  import { Component } from 'react';
2
+ import { ProductFullRow } from 'namirasoft-api-product';
3
3
  export interface NSAProductListProps {
4
4
  onClose: () => void;
5
5
  }
@@ -7,7 +7,9 @@ interface NSAProductListState {
7
7
  products: ProductFullRow[];
8
8
  }
9
9
  export declare class NSAProductListModal extends Component<NSAProductListProps, NSAProductListState> {
10
+ private toastRef;
10
11
  constructor(props: NSAProductListProps);
12
+ componentDidMount(): void;
11
13
  componentWillUnmount(): void;
12
14
  private onClickOutside;
13
15
  render(): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Component, createRef } from 'react';
2
3
  import { NSBoxString } from 'namirasoft-site-react';
3
4
  import Styles from './NSAProductListModal.module.css';
4
5
  import { NamirasoftAPIProductServer } from 'namirasoft-api-product';
5
6
  import { useEffect, useState } from 'react';
6
- import { Component } from 'react';
7
7
  function ProductName() {
8
8
  const [state, setState] = useState({ products: [] });
9
9
  useEffect(() => {
@@ -17,17 +17,22 @@ function ProductName() {
17
17
  export class NSAProductListModal extends Component {
18
18
  constructor(props) {
19
19
  super(props);
20
+ this.toastRef = createRef();
20
21
  this.onClickOutside = this.onClickOutside.bind(this);
21
22
  }
23
+ componentDidMount() {
24
+ document.addEventListener('mousedown', this.onClickOutside);
25
+ }
22
26
  componentWillUnmount() {
23
27
  document.removeEventListener('mousedown', this.onClickOutside);
24
28
  }
25
29
  onClickOutside(event) {
26
- console.log(event);
27
- this.props.onClose();
30
+ debugger;
31
+ if (this.toastRef.current && !this.toastRef.current.contains(event.target))
32
+ this.props.onClose();
28
33
  }
29
34
  render() {
30
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: Styles.nsa_product_container, children: _jsxs("div", { className: Styles.nsa_product_group, children: [_jsx(NSBoxString, { title: 'Search', onClicked: () => { }, required: false }), _jsx(ProductName, {})] }) }), _jsx("div", { className: Styles.nsa_toast_background })] }));
35
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: Styles.nsa_product_container, ref: this.toastRef, children: _jsxs("div", { className: Styles.nsa_product_group, children: [_jsx(NSBoxString, { title: 'Search', onClicked: () => { }, required: false }), _jsx(ProductName, {})] }) }), _jsx("div", { className: Styles.nsa_toast_background })] }));
31
36
  }
32
37
  }
33
38
  export default NSAProductListModal;
@@ -1 +1 @@
1
- {"version":3,"file":"NSAProductListModal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AC,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAChE,CAAC;IACQ,oBAAoB;QAEzB,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACnE,CAAC;IACO,cAAc,CAAC,KAAiB;QAEpC,QAAQ,CAAA;QACR,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC;YAC9E,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IACQ,MAAM;QAEX,OAAO,CACH,8BACI,cAAK,SAAS,EAAE,MAAM,CAAC,qBAAqB,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,YAC5D,eAAK,SAAS,EAAE,MAAM,CAAC,iBAAiB,aACpC,KAAC,WAAW,IAAC,KAAK,EAAC,QAAQ,EAAC,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,GAAI,EACrE,KAAC,WAAW,KAAG,IACb,GACJ,EACN,cAAK,SAAS,EAAE,MAAM,CAAC,oBAAoB,GACrC,IACP,CACN,CAAC;IACN,CAAC;CACJ;AAED,eAAe,mBAAmB,CAAC"}
@@ -1,12 +1,9 @@
1
1
  .nsa_product_container {
2
- flex-direction: column;
3
- justify-content: left;
4
- align-items: flex-start;
5
- position: fixed;
2
+ position: absolute;
6
3
  z-index: 1;
7
- top: 50%;
8
- left: 50%;
9
- transform: translate(-50%, -50%);
4
+ top: 30px;
5
+ transform: translate(0, 0);
6
+ right: 0;
10
7
  }
11
8
 
12
9
  .nsa_product_group {
@@ -20,6 +17,7 @@
20
17
  height: 450px;
21
18
  overflow: auto;
22
19
  padding: 16px 0;
20
+ background: #fff;
23
21
  }
24
22
 
25
23
  .nsa_product_list {
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.3.163",
11
+ "version": "1.3.165",
12
12
  "author": "Amir Abolhasani, Hooman Shashaeh",
13
13
  "license": "MIT",
14
14
  "main": "./dist/main.js",
package/src/App.tsx CHANGED
@@ -1,7 +1,10 @@
1
+ import NSAProductListModal from "./components/NSAProductListModal";
2
+
1
3
  export function App()
2
4
  {
3
5
  return (
4
6
  <div>
7
+ <NSAProductListModal onClose={()=>{}}/>
5
8
  </div>
6
9
  );
7
10
  };
@@ -95,7 +95,7 @@
95
95
  position: absolute;
96
96
  right: 0;
97
97
  z-index: 1;
98
- top: 30;
98
+ top: 30px;
99
99
  left: auto;
100
100
  transform: translate(0%, 0%);
101
101
  width: 275px;
@@ -1,12 +1,9 @@
1
1
  .nsa_product_container {
2
- flex-direction: column;
3
- justify-content: left;
4
- align-items: flex-start;
5
- position: fixed;
2
+ position: absolute;
6
3
  z-index: 1;
7
- top: 50%;
8
- left: 50%;
9
- transform: translate(-50%, -50%);
4
+ top: 30px;
5
+ transform: translate(0, 0);
6
+ right: 0;
10
7
  }
11
8
 
12
9
  .nsa_product_group {
@@ -20,6 +17,7 @@
20
17
  height: 450px;
21
18
  overflow: auto;
22
19
  padding: 16px 0;
20
+ background: #fff;
23
21
  }
24
22
 
25
23
  .nsa_product_list {
@@ -1,9 +1,9 @@
1
+ import React, { Component, createRef } from 'react';
1
2
  import { NSBoxString } from 'namirasoft-site-react';
2
3
  import Styles from './NSAProductListModal.module.css';
3
4
  import { NamirasoftAPIProductServer, ProductFullRow } from 'namirasoft-api-product';
4
5
  import { useEffect, useState } from 'react';
5
6
 
6
- import { Component } from 'react';
7
7
  export interface NSAProductListProps
8
8
  {
9
9
  onClose: () => void;
@@ -45,26 +45,32 @@ function ProductName()
45
45
  }
46
46
  export class NSAProductListModal extends Component<NSAProductListProps, NSAProductListState>
47
47
  {
48
+ private toastRef: React.RefObject<HTMLDivElement>;
48
49
  constructor(props: NSAProductListProps)
49
50
  {
50
51
  super(props);
52
+ this.toastRef = createRef();
51
53
  this.onClickOutside = this.onClickOutside.bind(this);
52
54
  }
55
+ override componentDidMount(): void
56
+ {
57
+ document.addEventListener('mousedown', this.onClickOutside);
58
+ }
53
59
  override componentWillUnmount(): void
54
60
  {
55
61
  document.removeEventListener('mousedown', this.onClickOutside);
56
62
  }
57
63
  private onClickOutside(event: MouseEvent)
58
64
  {
59
- console.log(event)
60
- // if (this.toastRef.current && !this.toastRef.current.contains(event.target as Node))
61
- this.props.onClose();
65
+ debugger
66
+ if (this.toastRef.current && !this.toastRef.current.contains(event.target as Node))
67
+ this.props.onClose();
62
68
  }
63
69
  override render()
64
70
  {
65
71
  return (
66
72
  <>
67
- <div className={Styles.nsa_product_container}>
73
+ <div className={Styles.nsa_product_container} ref={this.toastRef}>
68
74
  <div className={Styles.nsa_product_group}>
69
75
  <NSBoxString title='Search' onClicked={() => { }} required={false} />
70
76
  <ProductName />