pixel-react 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/index.d.ts +9 -2
- package/lib/index.esm.js +103 -80
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +104 -80
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/StateDropdown/StateDropdown.tsx +10 -15
- package/src/index.ts +2 -0
package/package.json
CHANGED
@@ -12,14 +12,11 @@ const StateDropdown = ({
|
|
12
12
|
isOnlyReviewer = false,
|
13
13
|
userHasOnlyViewAccess = false,
|
14
14
|
}: StateDropdownProps) => {
|
15
|
-
let currentState=value.toUpperCase();
|
15
|
+
let currentState = value.toUpperCase();
|
16
16
|
let content;
|
17
17
|
let options;
|
18
18
|
const isReviewerAndClickedOnReviewState: boolean =
|
19
|
-
isReviewer &&
|
20
|
-
!isApprovePage &&
|
21
|
-
currentState === 'REVIEW' &&
|
22
|
-
!nodeObj;
|
19
|
+
isReviewer && !isApprovePage && currentState === 'REVIEW' && !nodeObj;
|
23
20
|
let selectedOption: { label: string; value: string } = {
|
24
21
|
label: '',
|
25
22
|
value: '',
|
@@ -101,12 +98,13 @@ const StateDropdown = ({
|
|
101
98
|
];
|
102
99
|
}
|
103
100
|
|
104
|
-
let handleSelectedOption:(value:string)=>{
|
105
|
-
|
101
|
+
let handleSelectedOption: (value: string) => {
|
102
|
+
label: string;
|
103
|
+
value: string;
|
104
|
+
} = (value) => {
|
105
|
+
return { label: value, value: value };
|
106
106
|
};
|
107
|
-
if (currentState === 'REVIEW'
|
108
|
-
selectedOption = handleSelectedOption(value);
|
109
|
-
} else if (currentState === 'REVIEW' && !isApprovePage) {
|
107
|
+
if (currentState === 'REVIEW') {
|
110
108
|
selectedOption = handleSelectedOption(value);
|
111
109
|
} else if (currentState === 'NEW' && !isApprovePage) {
|
112
110
|
selectedOption = handleSelectedOption(value);
|
@@ -171,10 +169,7 @@ const StateDropdown = ({
|
|
171
169
|
showBorder={true}
|
172
170
|
/>
|
173
171
|
);
|
174
|
-
} else if (
|
175
|
-
currentState === 'REJECTED' &&
|
176
|
-
userHasOnlyViewAccess
|
177
|
-
) {
|
172
|
+
} else if (currentState === 'REJECTED' && userHasOnlyViewAccess) {
|
178
173
|
content = (
|
179
174
|
<Select
|
180
175
|
label={value}
|
@@ -199,7 +194,7 @@ const StateDropdown = ({
|
|
199
194
|
/>
|
200
195
|
);
|
201
196
|
} else {
|
202
|
-
|
197
|
+
content = '';
|
203
198
|
}
|
204
199
|
|
205
200
|
return (
|
package/src/index.ts
CHANGED
@@ -37,6 +37,7 @@ import HighlightText from './components/HighlightText';
|
|
37
37
|
import Checkbox from './components/Checkbox';
|
38
38
|
import Search from './components/Search/Search';
|
39
39
|
import StateDropdown from './components/StateDropdown';
|
40
|
+
import AddButton from './components/AddButton';
|
40
41
|
|
41
42
|
// Utils imports
|
42
43
|
import { checkEmpty } from './utils/checkEmpty/checkEmpty';
|
@@ -84,6 +85,7 @@ export {
|
|
84
85
|
Search,
|
85
86
|
StateDropdown,
|
86
87
|
StatusButton,
|
88
|
+
AddButton,
|
87
89
|
|
88
90
|
|
89
91
|
// utils exports
|