namirasoft-site-react 1.3.212 → 1.3.213
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/config-overrides.js +70 -70
- package/dist/App.css +13 -0
- package/dist/App.d.ts +0 -6
- package/dist/App.js +5 -33
- package/dist/App.js.map +1 -1
- package/dist/assets/images/404 image.svg +9 -9
- package/dist/assets/images/404 image_mobile.svg +9 -9
- package/dist/assets/images/arrow.svg +3 -3
- package/dist/assets/images/danger.svg +3 -3
- package/dist/assets/images/exit.svg +3 -3
- package/dist/assets/images/icon-export.svg +3 -0
- package/dist/assets/images/icon-input-copy.svg +3 -3
- package/dist/assets/images/icon-input-date.svg +9 -9
- package/dist/assets/images/icon-input-duration.svg +9 -9
- package/dist/assets/images/icon-input-email.svg +9 -9
- package/dist/assets/images/icon-input-float.svg +9 -9
- package/dist/assets/images/icon-input-id.svg +9 -0
- package/dist/assets/images/icon-input-integer.svg +9 -9
- package/dist/assets/images/icon-input-ip.svg +9 -9
- package/dist/assets/images/icon-input-phone.svg +9 -9
- package/dist/assets/images/icon-input-price.svg +9 -9
- package/dist/assets/images/icon-input-search.svg +3 -3
- package/dist/assets/images/icon-input-string.svg +9 -9
- package/dist/assets/images/icon-input-text.svg +9 -9
- package/dist/assets/images/icon-input-time.svg +9 -9
- package/dist/assets/images/icon-refresh.svg +3 -0
- package/dist/assets/images/icon-select-box.svg +3 -3
- package/dist/assets/images/logo.svg +9 -9
- package/dist/assets/images/menu.svg +3 -3
- package/dist/assets/images/namira.svg +9 -9
- package/dist/assets/images/rectangle.svg +3 -3
- package/dist/components/NSActionMenu.js +4 -4
- package/dist/components/NSActionMenu.js.map +1 -1
- package/dist/components/NSActionMenu.module.css +75 -75
- package/dist/components/NSBarAction.module.css +87 -87
- package/dist/components/NSBarHeroBanner.module.css +42 -42
- package/dist/components/NSBarNotification.module.css +31 -31
- package/dist/components/NSBarTitle.js +1 -1
- package/dist/components/NSBarTitle.js.map +1 -1
- package/dist/components/NSBarTitle.module.css +9 -9
- package/dist/components/NSBox.module.css +112 -119
- package/dist/components/NSBoxBoolean.module.css +54 -54
- package/dist/components/NSBoxDate.module.css +39 -39
- package/dist/components/NSBoxEmail.js +1 -1
- package/dist/components/NSBoxEmail.js.map +1 -1
- package/dist/components/NSBoxEnum.module.css +38 -38
- package/dist/components/NSBoxErrorNotifier.module.css +2 -2
- package/dist/components/NSBoxOTP.module.css +10 -10
- package/dist/components/NSBoxTextArea.module.css +72 -76
- package/dist/components/NSButton.js +1 -1
- package/dist/components/NSButton.js.map +1 -1
- package/dist/components/NSButton.module.css +27 -27
- package/dist/components/NSButtonBlue.module.css +4 -4
- package/dist/components/NSButtonGreen.module.css +4 -4
- package/dist/components/NSButtonRed.module.css +4 -4
- package/dist/components/NSCard.js +1 -1
- package/dist/components/NSCard.js.map +1 -1
- package/dist/components/NSCard.module.css +110 -110
- package/dist/components/NSCopyToClipboard.module.css +39 -39
- package/dist/components/NSElectronicCard.module.css +60 -60
- package/dist/components/NSEntityBar.js +1 -1
- package/dist/components/NSEntityBar.js.map +1 -1
- package/dist/components/NSEntityBar.module.css +77 -77
- package/dist/components/NSEntityCardBackground.module.css +27 -27
- package/dist/components/NSFilterBox.module.css +38 -38
- package/dist/components/NSFilterBoxDialog.module.css +36 -36
- package/dist/components/NSFilterItem.module.css +23 -23
- package/dist/components/NSFooter.module.css +126 -126
- package/dist/components/NSGroupedList.module.css +70 -70
- package/dist/components/NSHeader.js +1 -1
- package/dist/components/NSHeader.js.map +1 -1
- package/dist/components/NSHeader.module.css +254 -254
- package/dist/components/NSInput.module.css +74 -0
- package/dist/components/NSInputDate.d.ts +21 -0
- package/dist/components/NSInputDate.js +41 -0
- package/dist/components/NSInputDate.js.map +1 -0
- package/dist/components/NSInputDate.module.css +42 -0
- package/dist/components/NSInputDuration.d.ts +23 -0
- package/dist/components/NSInputDuration.js +42 -0
- package/dist/components/NSInputDuration.js.map +1 -0
- package/dist/components/NSInputEmail.d.ts +22 -0
- package/dist/components/NSInputEmail.js +43 -0
- package/dist/components/NSInputEmail.js.map +1 -0
- package/dist/components/NSInputErrorNotifier.d.ts +5 -0
- package/dist/components/NSInputErrorNotifier.js +7 -0
- package/dist/components/NSInputErrorNotifier.js.map +1 -0
- package/dist/components/NSInputErrorNotifier.module.css +3 -0
- package/dist/components/NSInputFloat.d.ts +22 -0
- package/dist/components/NSInputFloat.js +41 -0
- package/dist/components/NSInputFloat.js.map +1 -0
- package/dist/components/NSInputIP.d.ts +22 -0
- package/dist/components/NSInputIP.js +43 -0
- package/dist/components/NSInputIP.js.map +1 -0
- package/dist/components/NSInputInteger.d.ts +22 -0
- package/dist/components/NSInputInteger.js +41 -0
- package/dist/components/NSInputInteger.js.map +1 -0
- package/dist/components/NSInputPassword.d.ts +22 -0
- package/dist/components/NSInputPassword.js +42 -0
- package/dist/components/NSInputPassword.js.map +1 -0
- package/dist/components/NSInputPhone.d.ts +22 -0
- package/dist/components/NSInputPhone.js +38 -0
- package/dist/components/NSInputPhone.js.map +1 -0
- package/dist/components/NSInputPrice.d.ts +22 -0
- package/dist/components/NSInputPrice.js +41 -0
- package/dist/components/NSInputPrice.js.map +1 -0
- package/dist/components/NSInputSearch.d.ts +22 -0
- package/dist/components/NSInputSearch.js +41 -0
- package/dist/components/NSInputSearch.js.map +1 -0
- package/dist/components/NSInputString.d.ts +22 -0
- package/dist/components/NSInputString.js +42 -0
- package/dist/components/NSInputString.js.map +1 -0
- package/dist/components/NSInputText.d.ts +22 -0
- package/dist/components/NSInputText.js +42 -0
- package/dist/components/NSInputText.js.map +1 -0
- package/dist/components/NSInputTime.d.ts +22 -0
- package/dist/components/NSInputTime.js +43 -0
- package/dist/components/NSInputTime.js.map +1 -0
- package/dist/components/NSLayout.module.css +13 -13
- package/dist/components/NSLayoutAction.d.ts +5 -0
- package/dist/components/NSLayoutAction.js +20 -0
- package/dist/components/NSLayoutAction.js.map +1 -0
- package/dist/components/NSLayoutAction.module.css +88 -0
- package/dist/components/NSLayoutHeroBanner.d.ts +2 -0
- package/dist/components/NSLayoutHeroBanner.js +8 -0
- package/dist/components/NSLayoutHeroBanner.js.map +1 -0
- package/dist/components/NSLayoutHeroBanner.module.css +43 -0
- package/dist/components/NSLayoutTitle.d.ts +2 -0
- package/dist/components/NSLayoutTitle.js +11 -0
- package/dist/components/NSLayoutTitle.js.map +1 -0
- package/dist/components/NSLayoutTitle.module.css +10 -0
- package/dist/components/NSLink.module.css +36 -36
- package/dist/components/NSLoading.js +2 -2
- package/dist/components/NSLoading.js.map +1 -1
- package/dist/components/NSLoading.module.css +26 -29
- package/dist/components/NSModal.js +2 -2
- package/dist/components/NSModal.module.css +70 -70
- package/dist/components/NSNotification.d.ts +21 -0
- package/dist/components/NSNotification.js +37 -0
- package/dist/components/NSNotification.js.map +1 -0
- package/dist/components/NSNotification.module.css +32 -0
- package/dist/components/NSPagination.js +2 -2
- package/dist/components/NSPagination.js.map +1 -1
- package/dist/components/NSPagination.module.css +37 -67
- package/dist/components/NSPanel.module.css +45 -46
- package/dist/components/NSSection.module.css +10 -10
- package/dist/components/NSSectionBars.module.css +10 -10
- package/dist/components/NSSectionCards.module.css +38 -38
- package/dist/components/NSSelectBox.d.ts +24 -0
- package/dist/components/NSSelectBox.js +61 -0
- package/dist/components/NSSelectBox.js.map +1 -0
- package/dist/components/NSSelectBox.module.css +42 -0
- package/dist/components/NSTabPage.module.css +44 -48
- package/dist/components/NSTable.js +5 -8
- package/dist/components/NSTable.js.map +1 -1
- package/dist/components/NSTable.module.css +165 -170
- package/dist/components/NSTitle.module.css +15 -15
- package/dist/components/NSVerification.module.css +22 -22
- package/dist/index.css +6 -0
- package/dist/pages/NSLoginPage.module.css +19 -19
- package/dist/pages/NSNotFoundPage.module.css +18 -18
- package/dist/props/BaseComponentProps.d.ts +6 -0
- package/dist/props/BaseComponentProps.js +2 -0
- package/dist/props/BaseComponentProps.js.map +10 -0
- package/dist/props/IHeaderIconProps.d.ts +2 -0
- package/dist/props/INamirasoftProps.d.ts +4 -0
- package/dist/props/INamirasoftProps.js +2 -0
- package/dist/props/INamirasoftProps.js.map +1 -0
- package/dist/props/ImageProps.d.ts +4 -0
- package/dist/props/ImageProps.js +2 -0
- package/dist/props/ImageProps.js.map +10 -0
- package/dist/props/LinkProps.d.ts +5 -0
- package/dist/props/LinkProps.js +2 -0
- package/dist/props/LinkProps.js.map +10 -0
- package/dist/props/ValidationNumberProps.d.ts +4 -0
- package/dist/props/ValidationNumberProps.js +2 -0
- package/dist/props/ValidationNumberProps.js.map +10 -0
- package/dist/props/ValidationProps.d.ts +6 -0
- package/dist/props/ValidationProps.js +2 -0
- package/dist/props/ValidationProps.js.map +10 -0
- package/dist/props/ValidationRegexProps.d.ts +4 -0
- package/dist/props/ValidationRegexProps.js +2 -0
- package/dist/props/ValidationRegexProps.js.map +1 -0
- package/dist/props/ValidationStringProps.d.ts +4 -0
- package/dist/props/ValidationStringProps.js +2 -0
- package/dist/props/ValidationStringProps.js.map +10 -0
- package/package.json +65 -65
- package/public/index.html +38 -38
- package/public/manifest.json +24 -24
- package/public/robots.txt +3 -3
- package/src/App.css +16 -16
- package/src/App.tsx +67 -114
- package/src/CopyToClipboard.ts +6 -6
- package/src/Validator.ts +110 -110
- package/src/assets/images/404 image.svg +9 -9
- package/src/assets/images/404 image_mobile.svg +9 -9
- package/src/assets/images/arrow.svg +3 -3
- package/src/assets/images/danger.svg +3 -3
- package/src/assets/images/exit.svg +3 -3
- package/src/assets/images/icon-input-copy.svg +3 -3
- package/src/assets/images/icon-input-date.svg +9 -9
- package/src/assets/images/icon-input-duration.svg +9 -9
- package/src/assets/images/icon-input-email.svg +9 -9
- package/src/assets/images/icon-input-float.svg +9 -9
- package/src/assets/images/icon-input-integer.svg +9 -9
- package/src/assets/images/icon-input-ip.svg +9 -9
- package/src/assets/images/icon-input-phone.svg +9 -9
- package/src/assets/images/icon-input-price.svg +9 -9
- package/src/assets/images/icon-input-search.svg +3 -3
- package/src/assets/images/icon-input-string.svg +9 -9
- package/src/assets/images/icon-input-text.svg +9 -9
- package/src/assets/images/icon-input-time.svg +9 -9
- package/src/assets/images/icon-select-box.svg +3 -3
- package/src/assets/images/logo.svg +9 -9
- package/src/assets/images/menu.svg +3 -3
- package/src/assets/images/namira.svg +9 -9
- package/src/assets/images/rectangle.svg +3 -3
- package/src/components/NSActionMenu.module.css +75 -75
- package/src/components/NSActionMenu.tsx +78 -78
- package/src/components/NSBarAction.module.css +87 -87
- package/src/components/NSBarAction.tsx +87 -87
- package/src/components/NSBarHeroBanner.module.css +42 -42
- package/src/components/NSBarHeroBanner.tsx +61 -61
- package/src/components/NSBarNotification.module.css +31 -31
- package/src/components/NSBarNotification.tsx +63 -63
- package/src/components/NSBarTitle.module.css +9 -9
- package/src/components/NSBarTitle.tsx +28 -28
- package/src/components/NSBox.module.css +85 -119
- package/src/components/NSBoxBoolean.module.css +54 -54
- package/src/components/NSBoxBoolean.tsx +91 -91
- package/src/components/NSBoxDate.module.css +39 -39
- package/src/components/NSBoxDate.tsx +84 -84
- package/src/components/NSBoxDateTime.tsx +84 -84
- package/src/components/NSBoxDouble.tsx +90 -90
- package/src/components/NSBoxDuration.tsx +88 -88
- package/src/components/NSBoxEmail.tsx +128 -143
- package/src/components/NSBoxEntity.tsx +120 -120
- package/src/components/NSBoxEnum.module.css +38 -38
- package/src/components/NSBoxEnum.tsx +127 -127
- package/src/components/NSBoxErrorNotifier.module.css +2 -2
- package/src/components/NSBoxErrorNotifier.tsx +27 -27
- package/src/components/NSBoxIPV4.tsx +93 -93
- package/src/components/NSBoxIPV6.tsx +90 -90
- package/src/components/NSBoxInteger.tsx +86 -86
- package/src/components/NSBoxLabel.module.css +12 -12
- package/src/components/NSBoxLabel.tsx +28 -28
- package/src/components/NSBoxOTP.module.css +10 -10
- package/src/components/NSBoxOTP.tsx +61 -61
- package/src/components/NSBoxPassword.tsx +86 -86
- package/src/components/NSBoxPhone.tsx +114 -114
- package/src/components/NSBoxPrice.tsx +88 -88
- package/src/components/NSBoxSearch.tsx +89 -89
- package/src/components/NSBoxString.tsx +118 -118
- package/src/components/NSBoxText.tsx +131 -131
- package/src/components/NSBoxTextArea.module.css +76 -76
- package/src/components/NSBoxTextArea.tsx +131 -131
- package/src/components/NSBoxTime.tsx +88 -88
- package/src/components/NSButton.module.css +27 -27
- package/src/components/NSButton.tsx +23 -23
- package/src/components/NSButtonBlue.module.css +4 -4
- package/src/components/NSButtonBlue.tsx +12 -12
- package/src/components/NSButtonGreen.module.css +4 -4
- package/src/components/NSButtonGreen.tsx +11 -11
- package/src/components/NSButtonRed.module.css +4 -4
- package/src/components/NSButtonRed.tsx +11 -11
- package/src/components/NSCard.module.css +110 -110
- package/src/components/NSCard.tsx +69 -69
- package/src/components/NSCopyToClipboard.module.css +39 -39
- package/src/components/NSCopyToClipboard.tsx +35 -35
- package/src/components/NSElectronicCard.module.css +60 -60
- package/src/components/NSElectronicCard.tsx +47 -47
- package/src/components/NSEntityBar.module.css +77 -77
- package/src/components/NSEntityBar.tsx +27 -27
- package/src/components/NSEntityCardBackground.module.css +27 -27
- package/src/components/NSEntityCardBackground.tsx +34 -34
- package/src/components/NSFilterBox.module.css +38 -38
- package/src/components/NSFilterBox.tsx +277 -277
- package/src/components/NSFilterBoxDialog.module.css +36 -36
- package/src/components/NSFilterBoxDialog.tsx +74 -74
- package/src/components/NSFilterItem.module.css +23 -23
- package/src/components/NSFilterItem.tsx +71 -71
- package/src/components/NSFooter.module.css +126 -126
- package/src/components/NSFooter.tsx +153 -153
- package/src/components/NSGroupedList.module.css +70 -70
- package/src/components/NSGroupedList.tsx +56 -56
- package/src/components/NSHeader.module.css +254 -254
- package/src/components/NSHeader.tsx +187 -184
- package/src/components/NSLayout.module.css +13 -13
- package/src/components/NSLayout.tsx +75 -75
- package/src/components/NSLine.tsx +18 -18
- package/src/components/NSLink.module.css +36 -36
- package/src/components/NSLink.tsx +25 -25
- package/src/components/NSLinkBlue.tsx +20 -20
- package/src/components/NSLinkGreen.tsx +5 -5
- package/src/components/NSLinkRed.tsx +5 -5
- package/src/components/NSLoading.module.css +26 -29
- package/src/components/NSLoading.tsx +17 -19
- package/src/components/NSModal.module.css +70 -70
- package/src/components/NSModal.tsx +62 -62
- package/src/components/NSPagination.module.css +37 -67
- package/src/components/NSPagination.tsx +116 -116
- package/src/components/NSPanel.module.css +46 -46
- package/src/components/NSPanel.tsx +19 -19
- package/src/components/NSSection.module.css +10 -10
- package/src/components/NSSection.tsx +23 -23
- package/src/components/NSSectionBars.module.css +10 -10
- package/src/components/NSSectionBars.tsx +25 -25
- package/src/components/NSSectionCards.module.css +38 -38
- package/src/components/NSSectionCards.tsx +51 -51
- package/src/components/NSSectionTitle.tsx +21 -21
- package/src/components/NSSpace.tsx +28 -28
- package/src/components/NSTabPage.module.css +48 -48
- package/src/components/NSTabPage.tsx +45 -45
- package/src/components/NSTable.module.css +166 -170
- package/src/components/NSTable.tsx +192 -197
- package/src/components/NSTitle.module.css +15 -15
- package/src/components/NSTitle.tsx +19 -19
- package/src/components/NSVerification.module.css +22 -22
- package/src/components/NSVerification.tsx +41 -41
- package/src/index.tsx +7 -7
- package/src/main.ts +73 -73
- package/src/pages/NSLoginPage.module.css +19 -19
- package/src/pages/NSLoginPage.tsx +45 -45
- package/src/pages/NSNotFoundPage.module.css +18 -18
- package/src/pages/NSNotFoundPage.tsx +11 -11
- package/src/props/IBaseComponentProps.ts +7 -7
- package/src/props/IHeaderIconProps.ts +9 -6
- package/src/props/IHeaderProps.ts +6 -6
- package/src/props/IImageProps.ts +4 -4
- package/src/props/ILinkProps.ts +5 -5
- package/src/props/IValidationNumberProps.ts +4 -4
- package/src/props/IValidationProps.ts +7 -7
- package/src/props/IValidationRegexProps.ts +4 -4
- package/src/props/IValidationStringProps.ts +4 -4
- package/src/routing/INSRouterMaker.ts +6 -6
- package/src/routing/INSRouterProps.ts +5 -5
- package/src/routing/INSRouterState.ts +5 -5
- package/src/routing/NSRouterMaker.tsx +33 -33
- package/src/routing/Notifier.ts +79 -79
- package/tsconfig.json +43 -43
- package/dist/components/NSBoxLabel.module.css +0 -13
- package/public/assets/images/no_data.png +0 -0
|
@@ -1,278 +1,278 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import React, { Component } from 'react';
|
|
4
|
-
import Styles from './NSFilterBox.module.css'
|
|
5
|
-
import { IBaseComponentProps } from '../main';
|
|
6
|
-
import { NSFilterItem } from './NSFilterItem';
|
|
7
|
-
import { FilterItem, FilterItemColumnType, FilterItemOperator } from 'namirasoft-core'
|
|
8
|
-
import NSGroupedList from './NSGroupedList';
|
|
9
|
-
|
|
10
|
-
interface INSFilterBoxProps extends IBaseComponentProps
|
|
11
|
-
{
|
|
12
|
-
placeholder?: string;
|
|
13
|
-
onChanged?: () => void;
|
|
14
|
-
tables: {
|
|
15
|
-
name: string,
|
|
16
|
-
text: string
|
|
17
|
-
columns: {
|
|
18
|
-
name: string,
|
|
19
|
-
text: string,
|
|
20
|
-
type: FilterItemColumnType
|
|
21
|
-
}[];
|
|
22
|
-
}[];
|
|
23
|
-
getData: (column: string) => string[];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface INSFilterBoxState
|
|
27
|
-
{
|
|
28
|
-
filterItems: FilterItem[];
|
|
29
|
-
showSuggestList: boolean;
|
|
30
|
-
searchValue: string;
|
|
31
|
-
groupListState: GroupListState;
|
|
32
|
-
selectedColumns: {
|
|
33
|
-
name: string,
|
|
34
|
-
text: string
|
|
35
|
-
columns: {
|
|
36
|
-
name: string,
|
|
37
|
-
text: string,
|
|
38
|
-
type: FilterItemColumnType
|
|
39
|
-
}[];
|
|
40
|
-
}[];
|
|
41
|
-
selectedOperators: {
|
|
42
|
-
name: string;
|
|
43
|
-
operator: FilterItemOperator
|
|
44
|
-
};
|
|
45
|
-
selectedValues: [];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
enum GroupListState
|
|
49
|
-
{
|
|
50
|
-
Normal = 'Normal',
|
|
51
|
-
Column = 'Column',
|
|
52
|
-
Opertor = 'Opertor',
|
|
53
|
-
Value = 'Value'
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export class NSFilterBox extends Component<INSFilterBoxProps, INSFilterBoxState>
|
|
57
|
-
{
|
|
58
|
-
constructor(props: INSFilterBoxProps)
|
|
59
|
-
{
|
|
60
|
-
super(props);
|
|
61
|
-
this.state = {
|
|
62
|
-
filterItems: [],
|
|
63
|
-
groupListState: GroupListState.Normal,
|
|
64
|
-
showSuggestList: false,
|
|
65
|
-
searchValue: "",
|
|
66
|
-
selectedColumns: [],
|
|
67
|
-
selectedOperators: {
|
|
68
|
-
name: "",
|
|
69
|
-
operator: FilterItemOperator.all.Empty
|
|
70
|
-
},
|
|
71
|
-
selectedValues: []
|
|
72
|
-
}
|
|
73
|
-
this.selectColumn = this.selectColumn.bind(this);
|
|
74
|
-
this.selectOperator = this.selectOperator.bind(this);
|
|
75
|
-
this.selectValue = this.selectValue.bind(this);
|
|
76
|
-
this.removeSelected = this.removeSelected.bind(this);
|
|
77
|
-
this.onChanged = this.onChanged.bind(this);
|
|
78
|
-
this.getValue = this.getValue.bind(this);
|
|
79
|
-
this.setValue = this.setValue.bind(this);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
getValue(): string
|
|
83
|
-
{
|
|
84
|
-
return this.state.searchValue;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
//show and hide list ui
|
|
88
|
-
setValue(value: string): void
|
|
89
|
-
{
|
|
90
|
-
if (value !== "")
|
|
91
|
-
this.setState({
|
|
92
|
-
showSuggestList: true,
|
|
93
|
-
groupListState: GroupListState.Column,
|
|
94
|
-
searchValue: value
|
|
95
|
-
})
|
|
96
|
-
else
|
|
97
|
-
this.setState({
|
|
98
|
-
showSuggestList: false,
|
|
99
|
-
groupListState: GroupListState.Normal,
|
|
100
|
-
searchValue: ""
|
|
101
|
-
})
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
selectColumn(groupe: string, item: string): void
|
|
106
|
-
{
|
|
107
|
-
console.log("item", groupe);
|
|
108
|
-
console.log("item", item);
|
|
109
|
-
this.setState({
|
|
110
|
-
groupListState: GroupListState.Opertor,
|
|
111
|
-
searchValue: item
|
|
112
|
-
//selectedOperators
|
|
113
|
-
})
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
selectOperator(group: string, item: string): void
|
|
117
|
-
{
|
|
118
|
-
console.log("item", item);
|
|
119
|
-
console.log("group", group);
|
|
120
|
-
debugger
|
|
121
|
-
this.setState({
|
|
122
|
-
groupListState: GroupListState.Value,
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
selectValue(group: string, item: string): void
|
|
128
|
-
{
|
|
129
|
-
console.log("item", item);
|
|
130
|
-
console.log("group", group);
|
|
131
|
-
// let filterItems = new FilterItem("", false, this.state.selectedOperators.operator, this.state.selectedOperators.name)
|
|
132
|
-
// console.log(filterItems)
|
|
133
|
-
// this.setState({
|
|
134
|
-
// filterItems
|
|
135
|
-
// })
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
removeSelected(text: string): void
|
|
139
|
-
{
|
|
140
|
-
let selectedArray = [...this.state.filterItems];
|
|
141
|
-
selectedArray = selectedArray.filter(item => item.column !== text)
|
|
142
|
-
this.setState({
|
|
143
|
-
filterItems: selectedArray
|
|
144
|
-
})
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
private onChanged = async (e: React.ChangeEvent<HTMLInputElement>): Promise<void> =>
|
|
148
|
-
{
|
|
149
|
-
await this.setValue(e.target.value);
|
|
150
|
-
if (this.props.onChanged)
|
|
151
|
-
this.props.onChanged();
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
override render()
|
|
155
|
-
{
|
|
156
|
-
return (
|
|
157
|
-
<>
|
|
158
|
-
<div>
|
|
159
|
-
<div className={Styles.ns_input_container}>
|
|
160
|
-
<figure className={Styles.ns_input_icon_container}>
|
|
161
|
-
<img
|
|
162
|
-
src="https://static.namirasoft.com/image/concept/magnifier/blue.svg"
|
|
163
|
-
alt="input-icon"
|
|
164
|
-
width={24}
|
|
165
|
-
height={24}
|
|
166
|
-
/>
|
|
167
|
-
</figure>
|
|
168
|
-
<input
|
|
169
|
-
// id={this.props.id}
|
|
170
|
-
value={this.state.searchValue}
|
|
171
|
-
onChange={this.onChanged}
|
|
172
|
-
type="text"
|
|
173
|
-
className={Styles.ns_input}
|
|
174
|
-
placeholder={this.props.placeholder}
|
|
175
|
-
/>
|
|
176
|
-
{this.state.showSuggestList &&
|
|
177
|
-
<figure className={Styles.ns_input_close_icon}
|
|
178
|
-
onClick={() => this.setState({
|
|
179
|
-
showSuggestList: false,
|
|
180
|
-
groupListState: GroupListState.Normal,
|
|
181
|
-
searchValue: ""
|
|
182
|
-
})}
|
|
183
|
-
>
|
|
184
|
-
<img
|
|
185
|
-
src="https://static.namirasoft.com/image/concept/close/blue.svg"
|
|
186
|
-
alt="input-icon"
|
|
187
|
-
width={24}
|
|
188
|
-
height={24}
|
|
189
|
-
/>
|
|
190
|
-
</figure>
|
|
191
|
-
}
|
|
192
|
-
</div>
|
|
193
|
-
{
|
|
194
|
-
this.state.groupListState == GroupListState.Column &&
|
|
195
|
-
<NSGroupedList
|
|
196
|
-
onClick={this.selectColumn}
|
|
197
|
-
groups={this.props.tables.map((table) =>
|
|
198
|
-
{
|
|
199
|
-
return {
|
|
200
|
-
name: table.name,
|
|
201
|
-
text: table.text,
|
|
202
|
-
items: table.columns.map((column) =>
|
|
203
|
-
{
|
|
204
|
-
return {
|
|
205
|
-
name: column.name,
|
|
206
|
-
text: column.text,
|
|
207
|
-
type: column.type
|
|
208
|
-
}
|
|
209
|
-
})
|
|
210
|
-
}
|
|
211
|
-
})}
|
|
212
|
-
/>
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
{
|
|
216
|
-
this.state.groupListState == GroupListState.Opertor &&
|
|
217
|
-
<NSGroupedList
|
|
218
|
-
onClick={this.selectOperator}
|
|
219
|
-
groups={
|
|
220
|
-
[
|
|
221
|
-
{
|
|
222
|
-
name: "operators",
|
|
223
|
-
text: "Operators",
|
|
224
|
-
items:
|
|
225
|
-
FilterItemOperator.getAllByType(FilterItemColumnType.String).map((operator) =>
|
|
226
|
-
{
|
|
227
|
-
return {
|
|
228
|
-
name: operator.name,
|
|
229
|
-
text: operator.name,
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
})
|
|
233
|
-
}
|
|
234
|
-
]
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
/>
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
{
|
|
241
|
-
this.state.groupListState == GroupListState.Value &&
|
|
242
|
-
<NSGroupedList
|
|
243
|
-
onClick={this.selectValue}
|
|
244
|
-
groups={
|
|
245
|
-
[{
|
|
246
|
-
name: "value",
|
|
247
|
-
text: "Value",
|
|
248
|
-
items:
|
|
249
|
-
this.props.getData(this.state.searchValue).map((data) =>
|
|
250
|
-
{
|
|
251
|
-
return {
|
|
252
|
-
name: data,
|
|
253
|
-
text: data
|
|
254
|
-
}
|
|
255
|
-
})
|
|
256
|
-
}
|
|
257
|
-
]
|
|
258
|
-
}
|
|
259
|
-
/>
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
</div>
|
|
264
|
-
<div className={Styles.ns_selected_list_parent}>
|
|
265
|
-
{this.state.filterItems.map((item, index) =>
|
|
266
|
-
<NSFilterItem
|
|
267
|
-
item={item}
|
|
268
|
-
key={index}
|
|
269
|
-
removeSelected={() => this.removeSelected(item.column)}
|
|
270
|
-
/>
|
|
271
|
-
)
|
|
272
|
-
}
|
|
273
|
-
</div>
|
|
274
|
-
|
|
275
|
-
</>
|
|
276
|
-
);
|
|
277
|
-
}
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import React, { Component } from 'react';
|
|
4
|
+
import Styles from './NSFilterBox.module.css'
|
|
5
|
+
import { IBaseComponentProps } from '../main';
|
|
6
|
+
import { NSFilterItem } from './NSFilterItem';
|
|
7
|
+
import { FilterItem, FilterItemColumnType, FilterItemOperator } from 'namirasoft-core'
|
|
8
|
+
import NSGroupedList from './NSGroupedList';
|
|
9
|
+
|
|
10
|
+
interface INSFilterBoxProps extends IBaseComponentProps
|
|
11
|
+
{
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
onChanged?: () => void;
|
|
14
|
+
tables: {
|
|
15
|
+
name: string,
|
|
16
|
+
text: string
|
|
17
|
+
columns: {
|
|
18
|
+
name: string,
|
|
19
|
+
text: string,
|
|
20
|
+
type: FilterItemColumnType
|
|
21
|
+
}[];
|
|
22
|
+
}[];
|
|
23
|
+
getData: (column: string) => string[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface INSFilterBoxState
|
|
27
|
+
{
|
|
28
|
+
filterItems: FilterItem[];
|
|
29
|
+
showSuggestList: boolean;
|
|
30
|
+
searchValue: string;
|
|
31
|
+
groupListState: GroupListState;
|
|
32
|
+
selectedColumns: {
|
|
33
|
+
name: string,
|
|
34
|
+
text: string
|
|
35
|
+
columns: {
|
|
36
|
+
name: string,
|
|
37
|
+
text: string,
|
|
38
|
+
type: FilterItemColumnType
|
|
39
|
+
}[];
|
|
40
|
+
}[];
|
|
41
|
+
selectedOperators: {
|
|
42
|
+
name: string;
|
|
43
|
+
operator: FilterItemOperator
|
|
44
|
+
};
|
|
45
|
+
selectedValues: [];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
enum GroupListState
|
|
49
|
+
{
|
|
50
|
+
Normal = 'Normal',
|
|
51
|
+
Column = 'Column',
|
|
52
|
+
Opertor = 'Opertor',
|
|
53
|
+
Value = 'Value'
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export class NSFilterBox extends Component<INSFilterBoxProps, INSFilterBoxState>
|
|
57
|
+
{
|
|
58
|
+
constructor(props: INSFilterBoxProps)
|
|
59
|
+
{
|
|
60
|
+
super(props);
|
|
61
|
+
this.state = {
|
|
62
|
+
filterItems: [],
|
|
63
|
+
groupListState: GroupListState.Normal,
|
|
64
|
+
showSuggestList: false,
|
|
65
|
+
searchValue: "",
|
|
66
|
+
selectedColumns: [],
|
|
67
|
+
selectedOperators: {
|
|
68
|
+
name: "",
|
|
69
|
+
operator: FilterItemOperator.all.Empty
|
|
70
|
+
},
|
|
71
|
+
selectedValues: []
|
|
72
|
+
}
|
|
73
|
+
this.selectColumn = this.selectColumn.bind(this);
|
|
74
|
+
this.selectOperator = this.selectOperator.bind(this);
|
|
75
|
+
this.selectValue = this.selectValue.bind(this);
|
|
76
|
+
this.removeSelected = this.removeSelected.bind(this);
|
|
77
|
+
this.onChanged = this.onChanged.bind(this);
|
|
78
|
+
this.getValue = this.getValue.bind(this);
|
|
79
|
+
this.setValue = this.setValue.bind(this);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
getValue(): string
|
|
83
|
+
{
|
|
84
|
+
return this.state.searchValue;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
//show and hide list ui
|
|
88
|
+
setValue(value: string): void
|
|
89
|
+
{
|
|
90
|
+
if (value !== "")
|
|
91
|
+
this.setState({
|
|
92
|
+
showSuggestList: true,
|
|
93
|
+
groupListState: GroupListState.Column,
|
|
94
|
+
searchValue: value
|
|
95
|
+
})
|
|
96
|
+
else
|
|
97
|
+
this.setState({
|
|
98
|
+
showSuggestList: false,
|
|
99
|
+
groupListState: GroupListState.Normal,
|
|
100
|
+
searchValue: ""
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
selectColumn(groupe: string, item: string): void
|
|
106
|
+
{
|
|
107
|
+
console.log("item", groupe);
|
|
108
|
+
console.log("item", item);
|
|
109
|
+
this.setState({
|
|
110
|
+
groupListState: GroupListState.Opertor,
|
|
111
|
+
searchValue: item
|
|
112
|
+
//selectedOperators
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
selectOperator(group: string, item: string): void
|
|
117
|
+
{
|
|
118
|
+
console.log("item", item);
|
|
119
|
+
console.log("group", group);
|
|
120
|
+
debugger
|
|
121
|
+
this.setState({
|
|
122
|
+
groupListState: GroupListState.Value,
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
selectValue(group: string, item: string): void
|
|
128
|
+
{
|
|
129
|
+
console.log("item", item);
|
|
130
|
+
console.log("group", group);
|
|
131
|
+
// let filterItems = new FilterItem("", false, this.state.selectedOperators.operator, this.state.selectedOperators.name)
|
|
132
|
+
// console.log(filterItems)
|
|
133
|
+
// this.setState({
|
|
134
|
+
// filterItems
|
|
135
|
+
// })
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
removeSelected(text: string): void
|
|
139
|
+
{
|
|
140
|
+
let selectedArray = [...this.state.filterItems];
|
|
141
|
+
selectedArray = selectedArray.filter(item => item.column !== text)
|
|
142
|
+
this.setState({
|
|
143
|
+
filterItems: selectedArray
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
private onChanged = async (e: React.ChangeEvent<HTMLInputElement>): Promise<void> =>
|
|
148
|
+
{
|
|
149
|
+
await this.setValue(e.target.value);
|
|
150
|
+
if (this.props.onChanged)
|
|
151
|
+
this.props.onChanged();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
override render()
|
|
155
|
+
{
|
|
156
|
+
return (
|
|
157
|
+
<>
|
|
158
|
+
<div>
|
|
159
|
+
<div className={Styles.ns_input_container}>
|
|
160
|
+
<figure className={Styles.ns_input_icon_container}>
|
|
161
|
+
<img
|
|
162
|
+
src="https://static.namirasoft.com/image/concept/magnifier/blue.svg"
|
|
163
|
+
alt="input-icon"
|
|
164
|
+
width={24}
|
|
165
|
+
height={24}
|
|
166
|
+
/>
|
|
167
|
+
</figure>
|
|
168
|
+
<input
|
|
169
|
+
// id={this.props.id}
|
|
170
|
+
value={this.state.searchValue}
|
|
171
|
+
onChange={this.onChanged}
|
|
172
|
+
type="text"
|
|
173
|
+
className={Styles.ns_input}
|
|
174
|
+
placeholder={this.props.placeholder}
|
|
175
|
+
/>
|
|
176
|
+
{this.state.showSuggestList &&
|
|
177
|
+
<figure className={Styles.ns_input_close_icon}
|
|
178
|
+
onClick={() => this.setState({
|
|
179
|
+
showSuggestList: false,
|
|
180
|
+
groupListState: GroupListState.Normal,
|
|
181
|
+
searchValue: ""
|
|
182
|
+
})}
|
|
183
|
+
>
|
|
184
|
+
<img
|
|
185
|
+
src="https://static.namirasoft.com/image/concept/close/blue.svg"
|
|
186
|
+
alt="input-icon"
|
|
187
|
+
width={24}
|
|
188
|
+
height={24}
|
|
189
|
+
/>
|
|
190
|
+
</figure>
|
|
191
|
+
}
|
|
192
|
+
</div>
|
|
193
|
+
{
|
|
194
|
+
this.state.groupListState == GroupListState.Column &&
|
|
195
|
+
<NSGroupedList
|
|
196
|
+
onClick={this.selectColumn}
|
|
197
|
+
groups={this.props.tables.map((table) =>
|
|
198
|
+
{
|
|
199
|
+
return {
|
|
200
|
+
name: table.name,
|
|
201
|
+
text: table.text,
|
|
202
|
+
items: table.columns.map((column) =>
|
|
203
|
+
{
|
|
204
|
+
return {
|
|
205
|
+
name: column.name,
|
|
206
|
+
text: column.text,
|
|
207
|
+
type: column.type
|
|
208
|
+
}
|
|
209
|
+
})
|
|
210
|
+
}
|
|
211
|
+
})}
|
|
212
|
+
/>
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
{
|
|
216
|
+
this.state.groupListState == GroupListState.Opertor &&
|
|
217
|
+
<NSGroupedList
|
|
218
|
+
onClick={this.selectOperator}
|
|
219
|
+
groups={
|
|
220
|
+
[
|
|
221
|
+
{
|
|
222
|
+
name: "operators",
|
|
223
|
+
text: "Operators",
|
|
224
|
+
items:
|
|
225
|
+
FilterItemOperator.getAllByType(FilterItemColumnType.String).map((operator) =>
|
|
226
|
+
{
|
|
227
|
+
return {
|
|
228
|
+
name: operator.name,
|
|
229
|
+
text: operator.name,
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
})
|
|
233
|
+
}
|
|
234
|
+
]
|
|
235
|
+
|
|
236
|
+
}
|
|
237
|
+
/>
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
{
|
|
241
|
+
this.state.groupListState == GroupListState.Value &&
|
|
242
|
+
<NSGroupedList
|
|
243
|
+
onClick={this.selectValue}
|
|
244
|
+
groups={
|
|
245
|
+
[{
|
|
246
|
+
name: "value",
|
|
247
|
+
text: "Value",
|
|
248
|
+
items:
|
|
249
|
+
this.props.getData(this.state.searchValue).map((data) =>
|
|
250
|
+
{
|
|
251
|
+
return {
|
|
252
|
+
name: data,
|
|
253
|
+
text: data
|
|
254
|
+
}
|
|
255
|
+
})
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
}
|
|
259
|
+
/>
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
</div>
|
|
264
|
+
<div className={Styles.ns_selected_list_parent}>
|
|
265
|
+
{this.state.filterItems.map((item, index) =>
|
|
266
|
+
<NSFilterItem
|
|
267
|
+
item={item}
|
|
268
|
+
key={index}
|
|
269
|
+
removeSelected={() => this.removeSelected(item.column)}
|
|
270
|
+
/>
|
|
271
|
+
)
|
|
272
|
+
}
|
|
273
|
+
</div>
|
|
274
|
+
|
|
275
|
+
</>
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
278
|
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
.ns_dialog_holder {
|
|
2
|
-
background: #Fff;
|
|
3
|
-
width: 100%;
|
|
4
|
-
max-width: 358px;
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
position: relative;
|
|
10
|
-
color: #141B5C;
|
|
11
|
-
gap: 16px;
|
|
12
|
-
z-index: 9;
|
|
13
|
-
padding: 16px;
|
|
14
|
-
border-radius: 8px;
|
|
15
|
-
border: solid 1px #A1A4B0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.ns_dialog_close {
|
|
19
|
-
position: absolute;
|
|
20
|
-
top: 16px;
|
|
21
|
-
right: 16px;
|
|
22
|
-
background: none;
|
|
23
|
-
border: none;
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.ns_dialog_title {}
|
|
28
|
-
|
|
29
|
-
.ns_dialog_btn_container {
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: row;
|
|
32
|
-
justify-content: center;
|
|
33
|
-
gap: 16px;
|
|
34
|
-
}
|
|
35
|
-
.ns_dialog_btn_container button {
|
|
36
|
-
width: 128px !important;
|
|
1
|
+
.ns_dialog_holder {
|
|
2
|
+
background: #Fff;
|
|
3
|
+
width: 100%;
|
|
4
|
+
max-width: 358px;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
position: relative;
|
|
10
|
+
color: #141B5C;
|
|
11
|
+
gap: 16px;
|
|
12
|
+
z-index: 9;
|
|
13
|
+
padding: 16px;
|
|
14
|
+
border-radius: 8px;
|
|
15
|
+
border: solid 1px #A1A4B0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ns_dialog_close {
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 16px;
|
|
21
|
+
right: 16px;
|
|
22
|
+
background: none;
|
|
23
|
+
border: none;
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ns_dialog_title {}
|
|
28
|
+
|
|
29
|
+
.ns_dialog_btn_container {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: row;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
gap: 16px;
|
|
34
|
+
}
|
|
35
|
+
.ns_dialog_btn_container button {
|
|
36
|
+
width: 128px !important;
|
|
37
37
|
}
|