namirasoft-site-react 1.3.139 → 1.3.141

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.
Files changed (39) hide show
  1. package/dist/App.js +109 -55
  2. package/dist/App.js.map +1 -1
  3. package/dist/components/NSButtonRed.module.css +1 -1
  4. package/dist/components/NSFilterBox.d.ts +44 -1
  5. package/dist/components/NSFilterBox.js +112 -2
  6. package/dist/components/NSFilterBox.js.map +1 -1
  7. package/dist/components/NSFilterBox.module.css +10 -0
  8. package/dist/components/NSFilterBoxDialog.d.ts +1 -0
  9. package/dist/components/NSFilterBoxDialog.js +2 -2
  10. package/dist/components/NSFilterBoxDialog.js.map +1 -1
  11. package/dist/components/NSFilterItem.d.ts +17 -0
  12. package/dist/components/NSFilterItem.js +29 -0
  13. package/dist/components/NSFilterItem.js.map +1 -0
  14. package/dist/components/NSFilterItem.module.css +24 -0
  15. package/dist/components/NSGroupedList.d.ts +21 -0
  16. package/dist/components/NSGroupedList.js +12 -0
  17. package/dist/components/NSGroupedList.js.map +1 -0
  18. package/dist/components/NSGroupedList.module.css +71 -0
  19. package/dist/components/NSLayoutAction.js +4 -4
  20. package/dist/components/NSLayoutAction.js.map +1 -1
  21. package/dist/components/NSModal.d.ts +1 -0
  22. package/dist/components/NSModal.js +1 -1
  23. package/dist/components/NSModal.js.map +1 -1
  24. package/dist/components/NSTable.d.ts +2 -1
  25. package/dist/components/NSTable.js +4 -4
  26. package/dist/components/NSTable.js.map +1 -1
  27. package/package.json +1 -1
  28. package/src/App.tsx +110 -92
  29. package/src/components/NSButtonRed.module.css +1 -1
  30. package/src/components/NSFilterBox.module.css +10 -0
  31. package/src/components/NSFilterBox.tsx +204 -20
  32. package/src/components/NSFilterBoxDialog.tsx +5 -3
  33. package/src/components/NSFilterItem.module.css +24 -0
  34. package/src/components/NSFilterItem.tsx +72 -0
  35. package/src/components/NSGroupedList.module.css +71 -0
  36. package/src/components/NSGroupedList.tsx +59 -0
  37. package/src/components/NSLayoutAction.tsx +23 -21
  38. package/src/components/NSModal.tsx +7 -0
  39. package/src/components/NSTable.tsx +5 -4
@@ -8,7 +8,8 @@ import { NSButtonRed } from './NSButtonRed';
8
8
 
9
9
  interface INSFilterBoxDialogProps extends IBaseComponentProps
10
10
  {
11
- title: string
11
+ title: string;
12
+ onCloseDialog: () => void;
12
13
  }
13
14
 
14
15
  interface INSFilterBoxDialogState
@@ -22,7 +23,8 @@ export class NSFilterBoxDialog extends Component<INSFilterBoxDialogProps, INSFil
22
23
  {
23
24
  return (
24
25
  <div className={Styles.ns_dialog_holder}>
25
- <button className={Styles.ns_dialog_close}>
26
+ <button className={Styles.ns_dialog_close}
27
+ onClick={this.props.onCloseDialog}>
26
28
  <img src="https://static.namirasoft.com/image/concept/close/blue.svg" alt="close-dialog" width={24} height={24} />
27
29
  </button>
28
30
  <h3 className={Styles.ns_dialog_title}>
@@ -64,7 +66,7 @@ export class NSFilterBoxDialog extends Component<INSFilterBoxDialogProps, INSFil
64
66
 
65
67
  <NSButtonBlue
66
68
  title='Cancel'
67
- onClick={() => { }}
69
+ onClick={this.props.onCloseDialog}
68
70
  />
69
71
  </div>
70
72
  </div>
@@ -0,0 +1,24 @@
1
+ .ns_selected_holder {
2
+ position: relative;
3
+ }
4
+ .ns_selected_item_parent {
5
+ padding: 6px;
6
+ border: solid 1px #0377FF;
7
+ border-radius: 8px;
8
+ background-color: #fff;
9
+ color: #141B5C;
10
+ cursor: pointer;
11
+ }
12
+
13
+ .ns_selected_close_icon {
14
+ outline: none;
15
+ border: none;
16
+ background: none;
17
+ padding-top: 4px;
18
+ border-left: solid 1px #0377FF;
19
+ }
20
+
21
+ .ns_dialog_parent {
22
+ position: absolute;
23
+
24
+ }
@@ -0,0 +1,72 @@
1
+ import { Component } from 'react';
2
+ import { IBaseComponentProps } from '../props/IBaseComponentProps';
3
+ import Styles from './NSFilterItem.module.css'
4
+ import { NSFilterBoxDialog } from './NSFilterBoxDialog';
5
+ import { FilterItem } from 'namirasoft-core';
6
+
7
+ interface INSFilterItemProps extends IBaseComponentProps
8
+ {
9
+ item: FilterItem
10
+ removeSelected: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>, text: string) => void
11
+ }
12
+
13
+ interface INSFilterItemState
14
+ {
15
+ showDialog: boolean
16
+ }
17
+
18
+ export class NSFilterItem extends Component<INSFilterItemProps, INSFilterItemState>
19
+ {
20
+ constructor(props: INSFilterItemProps)
21
+ {
22
+ super(props);
23
+ this.state = {
24
+ showDialog: false
25
+ }
26
+ this.onClsoeDialog = this.onClsoeDialog.bind(this);
27
+ this.onShowDialog = this.onShowDialog.bind(this);
28
+ }
29
+
30
+ onShowDialog()
31
+ {
32
+ this.setState({
33
+ showDialog: true
34
+ })
35
+ }
36
+
37
+ onClsoeDialog()
38
+ {
39
+ this.setState({
40
+ showDialog: false
41
+ })
42
+ }
43
+
44
+ override render()
45
+ {
46
+ return (
47
+ <div className={Styles.ns_selected_holder}>
48
+ <div className={Styles.ns_selected_item_parent}
49
+ onClick={this.onShowDialog}
50
+ >
51
+ <span>{ this.props.item.column} </span>
52
+ <button
53
+ className={Styles.ns_selected_close_icon}
54
+ onClick={(e) => this.props.removeSelected(e, this.props.item.column)}
55
+ >
56
+ <img src="https://static.namirasoft.com/image/concept/close/blue.svg" alt="close" width={24} height={24} />
57
+ </button>
58
+ </div>
59
+
60
+ {this.state.showDialog &&
61
+ <div className={Styles.ns_dialog_parent}>
62
+ <NSFilterBoxDialog
63
+ onCloseDialog={this.onClsoeDialog}
64
+ title='Edit Filter'
65
+
66
+ />
67
+ </div>
68
+ }
69
+ </div>
70
+ );
71
+ }
72
+ }
@@ -0,0 +1,71 @@
1
+ .ns_group_list_parent {
2
+ width: 100%;
3
+ max-width: 560px;
4
+ border-radius: 8px;
5
+ border: solid 1px #B2BBD9;
6
+ background-color: #fff;
7
+ padding-bottom: 16px;
8
+ height: 250px;
9
+ overflow: auto;
10
+ }
11
+
12
+ .ns_group_list_parent::-webkit-scrollbar {
13
+ width: 1rem;
14
+ }
15
+
16
+ .ns_group_list_parent::-webkit-scrollbar-track {
17
+ box-shadow: inset 0 0 6px #E8EBF6;
18
+ }
19
+
20
+ .ns_group_list_parent::-webkit-scrollbar-thumb {
21
+ background-color: #A1A4B0;
22
+ border-radius: 8px;
23
+ }
24
+
25
+ .ns_group_list {
26
+ list-style-type: none;
27
+ color: #141B5C;
28
+ padding: 0;
29
+ margin: 0;
30
+ display: flex;
31
+ flex-direction: column;
32
+ align-items: flex-start;
33
+ justify-content: flex-start;
34
+ font-size: 16px;
35
+ font-weight: 700;
36
+ width: 100%;
37
+ }
38
+
39
+ .ns_group_category {
40
+ display: inline-block;
41
+ padding-top: 10px;
42
+ padding-bottom: 10px;
43
+ padding-left: 8px;
44
+ border-bottom: solid 1px currentColor;
45
+ width: 100%;
46
+ }
47
+
48
+ .ns_group_list li {
49
+ width: 100%;
50
+ }
51
+
52
+ .ns_group_item {
53
+ cursor: pointer;
54
+ padding: 6px 0 6px 24px;
55
+ font-size: 16px;
56
+ font-weight: 300;
57
+ color: #141B5C;
58
+ border-bottom: solid 1px currentColor;
59
+ width: 100%;
60
+ display: inline-block;
61
+ transition: all 0.1s;
62
+ }
63
+
64
+ .ns_group_item:hover {
65
+ background-color: #B2BBD9;
66
+ font-weight: 700;
67
+ }
68
+
69
+ .ns_block {
70
+ display: block;
71
+ }
@@ -0,0 +1,59 @@
1
+ "use client"
2
+ import { Component } from 'react';
3
+ import { IBaseComponentProps } from '../main';
4
+ import Styles from "./NSGroupedList.module.css"
5
+
6
+ interface INSGroupedListProps extends IBaseComponentProps
7
+ {
8
+ groups: {
9
+ name: string;
10
+ text: string;
11
+ sign?: string;
12
+ operator_name?: string;
13
+ items: {
14
+ name: string;
15
+ text: string;
16
+ }[];
17
+ }[];
18
+ onClick: (group: string, item: string) => void;
19
+ }
20
+
21
+ interface INSGroupedListState
22
+ {
23
+
24
+ }
25
+
26
+ class NSGroupedList extends Component<INSGroupedListProps, INSGroupedListState>
27
+ {
28
+ override render()
29
+ {
30
+ return (
31
+ <div className={Styles.ns_group_list_parent}>
32
+ {this.props.groups.map((group, index) =>
33
+ <ul key={index} className={Styles.ns_group_list}>
34
+ <span className={Styles.ns_group_category}> {group.name} </span>
35
+ {
36
+ group.items.map((item, index) =>
37
+ <li key={index} onClick={() => this.props.onClick(group.name, item.name)}>
38
+ <div className={Styles.ns_group_item}>
39
+ <span>
40
+ {item.name} {" "}
41
+ {group.sign && <span> {group.sign} </span>}
42
+ </span>
43
+ {
44
+ group.operator_name &&
45
+ <span className={Styles.ns_block}> {group.operator_name} </span>
46
+ }
47
+ </div>
48
+ </li>
49
+ )
50
+ }
51
+ </ul>
52
+ )}
53
+ </div>
54
+
55
+ );
56
+ }
57
+ }
58
+
59
+ export default NSGroupedList;
@@ -48,27 +48,7 @@ export function NSLayoutAction(props: INSLayoutActionProps)
48
48
  />
49
49
  </div>
50
50
 
51
- {/* Mobile */}
52
- <div className={`d-block d-lg-none ${Styles.ns_mobile_action_bar_title}`}>
53
- <h1 className={Styles.title}>{props.title}</h1>
54
- {
55
- props.description && lines &&
56
- <>
57
- <p className={Styles.description}>
58
- {
59
- lines.map((line, index) =>
60
- {
61
- return <>
62
- {line.trim()}
63
- {index != lines.length - 1 && <br />}
64
- </>
65
- })
66
- }
67
- </p>
68
- <NSSpace size={NSSpaceSizeType.MINI} />
69
- </>
70
- }
71
- </div>
51
+
72
52
 
73
53
  <div className={Styles.ns_actions_hodler}>
74
54
  {filtered_actions.map((action) =>
@@ -82,6 +62,28 @@ export function NSLayoutAction(props: INSLayoutActionProps)
82
62
 
83
63
  </div>
84
64
  <NSSpace size={NSSpaceSizeType.SMALL} />
65
+ {/* Mobile */}
66
+ <div className={`container d-block d-lg-none ${Styles.ns_mobile_action_bar_title}`}>
67
+ <h1 className={Styles.title}>{props.title}</h1>
68
+ {
69
+ props.description && lines &&
70
+ <>
71
+ <p className={Styles.description}>
72
+ {
73
+ lines.map((line, index) =>
74
+ {
75
+ return <>
76
+ {line.trim()}
77
+ {index != lines.length - 1 && <br />}
78
+ </>
79
+ })
80
+ }
81
+ </p>
82
+ <NSSpace size={NSSpaceSizeType.MINI} />
83
+ </>
84
+ }
85
+ </div>
86
+ <NSSpace size={NSSpaceSizeType.SMALL} />
85
87
  {props.children}
86
88
  </NSLayout>
87
89
  );
@@ -6,6 +6,7 @@ export interface INSModalProps extends IBaseComponentProps
6
6
  title?: string;
7
7
  description?: string;
8
8
  show: boolean;
9
+ column?: string;
9
10
  children?: React.ReactNode;
10
11
  onClose: () => void;
11
12
  }
@@ -32,6 +33,12 @@ export function NSModal(props: INSModalProps)
32
33
  classList={[Styles.ns_close_modal]}
33
34
  />
34
35
  <div className={Styles.ns_modal_content}>
36
+ {props.column && (
37
+ <>
38
+ <NSTitle title={props.column} />
39
+ <NSSpace size={NSSpaceSizeType.NORMAL} />
40
+ </>
41
+ )}
35
42
  {props.title && (
36
43
  <>
37
44
  <NSTitle title={props.title} />
@@ -34,6 +34,7 @@ export interface NSTableState<RowType>
34
34
  model: {
35
35
  show: boolean;
36
36
  description?: string;
37
+ columnName?: string;
37
38
  }
38
39
  }
39
40
 
@@ -59,9 +60,9 @@ export class NSTable<RowType> extends Component<INSTableProps<RowType>, NSTableS
59
60
  {
60
61
  return this.search?.current?.getValue() ?? "";
61
62
  }
62
- showModal(description: string)
63
+ showModal(description: string, columnName: string)
63
64
  {
64
- this.setState({ model: { show: true, description } });
65
+ this.setState({ model: { show: true, description, columnName } });
65
66
  }
66
67
  hideModal()
67
68
  {
@@ -71,7 +72,6 @@ export class NSTable<RowType> extends Component<INSTableProps<RowType>, NSTableS
71
72
  {
72
73
  this.setState({ currentPage: page });
73
74
  this.props.getRows(page);
74
-
75
75
  }
76
76
  override render()
77
77
  {
@@ -109,7 +109,7 @@ export class NSTable<RowType> extends Component<INSTableProps<RowType>, NSTableS
109
109
  overided = res;
110
110
  }
111
111
  if (!overided)
112
- this.showModal(getCell(row, column, rowIndex, columnIndex));
112
+ this.showModal(getCell(row, column, rowIndex, columnIndex), column);
113
113
  };
114
114
  return (
115
115
  <div id={this.props.id}
@@ -156,6 +156,7 @@ export class NSTable<RowType> extends Component<INSTableProps<RowType>, NSTableS
156
156
  description={this.state.model.description}
157
157
  onClose={() => { this.hideModal(); }}
158
158
  title={this.state.title}
159
+ column={this.state.model.columnName}
159
160
  />
160
161
  </div >
161
162
  )