@campxdev/react-blueprint 1.2.21 → 1.3.0
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/package.json +3 -3
- package/src/App.tsx +2 -33
- package/src/components/Assets/Icons/IconComponents/QuizIcon.tsx +8 -1
- package/src/components/DataDisplay/EditableDataTable/EditableDataTable.tsx +29 -51
- package/src/components/Input/SingleSelect/SingleSelect.tsx +141 -15
- package/src/components/Input/components/{FetchingOptionsLoader.tsx → OptionsLoader.tsx} +10 -2
- package/src/components/Input/styles.tsx +1 -1
- package/src/themes/commonTheme.ts +8 -0
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@campxdev/react-blueprint",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"main": "./export.ts",
|
|
5
5
|
"private": false,
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@campxdev/campx-web-utils": "0.1.5",
|
|
8
8
|
"@emotion/react": "^11.11.4",
|
|
9
9
|
"@emotion/styled": "^11.11.5",
|
|
10
|
-
"@mui/icons-material": "^
|
|
11
|
-
"@mui/material": "^
|
|
10
|
+
"@mui/icons-material": "^6.1.5",
|
|
11
|
+
"@mui/material": "^6.1.5",
|
|
12
12
|
"@mui/x-data-grid": "^7.5.1",
|
|
13
13
|
"@mui/x-date-pickers": "7.16.0",
|
|
14
14
|
"@reduxjs/toolkit": "^2.2.7",
|
package/src/App.tsx
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { GridColDef
|
|
1
|
+
import { GridColDef } from '@mui/x-data-grid';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import './App.css';
|
|
4
|
-
import {
|
|
5
|
-
EditableDataTable,
|
|
6
|
-
Select,
|
|
7
|
-
SingleSelect,
|
|
8
|
-
TextField,
|
|
9
|
-
} from './components/export';
|
|
4
|
+
import { EditableDataTable, Select, SingleSelect } from './components/export';
|
|
10
5
|
import { usePageHeader } from './hooks/usePageHeader';
|
|
11
6
|
|
|
12
7
|
interface RowType {
|
|
@@ -94,35 +89,9 @@ function App() {
|
|
|
94
89
|
{
|
|
95
90
|
field: 'age',
|
|
96
91
|
headerName: 'Age',
|
|
97
|
-
preProcessEditCellProps: (params: GridPreProcessEditCellProps) => {
|
|
98
|
-
const hasError = params.props.value < 3;
|
|
99
|
-
return {
|
|
100
|
-
...params.props,
|
|
101
|
-
error: hasError,
|
|
102
|
-
};
|
|
103
|
-
},
|
|
104
92
|
width: 230,
|
|
105
93
|
editable: true,
|
|
106
94
|
type: 'number',
|
|
107
|
-
renderEditCell: (params) => {
|
|
108
|
-
return (
|
|
109
|
-
<>
|
|
110
|
-
<TextField
|
|
111
|
-
value={params.value}
|
|
112
|
-
error={params.error}
|
|
113
|
-
helperText={params.error && 'Age is at least 3'}
|
|
114
|
-
type="number"
|
|
115
|
-
onChange={(e) => {
|
|
116
|
-
params.api.setEditCellValue({
|
|
117
|
-
id: params.id,
|
|
118
|
-
field: 'age',
|
|
119
|
-
value: e.target.value,
|
|
120
|
-
});
|
|
121
|
-
}}
|
|
122
|
-
/>
|
|
123
|
-
</>
|
|
124
|
-
);
|
|
125
|
-
},
|
|
126
95
|
},
|
|
127
96
|
];
|
|
128
97
|
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
import { useTheme } from '@mui/material';
|
|
2
|
+
|
|
1
3
|
const QuizIcon = ({ size = 16 }) => {
|
|
4
|
+
const theme = useTheme();
|
|
5
|
+
const color = theme.palette.text.black;
|
|
2
6
|
return (
|
|
3
7
|
<svg
|
|
4
8
|
width={size}
|
|
5
9
|
height={size}
|
|
6
10
|
viewBox="0 0 20 20"
|
|
7
|
-
|
|
11
|
+
style={{
|
|
12
|
+
fill: color,
|
|
13
|
+
stroke: color,
|
|
14
|
+
}}
|
|
8
15
|
xmlns="http://www.w3.org/2000/svg"
|
|
9
16
|
>
|
|
10
17
|
<g clip-path="url(#clip0_1305_893)">
|
|
@@ -129,7 +129,7 @@ export const EditableTableCore = (props: EditableDataTableProps) => {
|
|
|
129
129
|
height: '100%',
|
|
130
130
|
},
|
|
131
131
|
'& .MuiDataGrid-cell.MuiDataGrid-cell--editing': {
|
|
132
|
-
padding: '0px 9px
|
|
132
|
+
padding: '0px 9px',
|
|
133
133
|
alignItems: 'center',
|
|
134
134
|
},
|
|
135
135
|
'& .MuiDataGrid-cell': {
|
|
@@ -144,11 +144,6 @@ export const EditableTableCore = (props: EditableDataTableProps) => {
|
|
|
144
144
|
borderColor: theme.palette.primary.main,
|
|
145
145
|
},
|
|
146
146
|
},
|
|
147
|
-
'& .MuiOutlinedInput-root': {
|
|
148
|
-
fieldset: {
|
|
149
|
-
top: '0px !important',
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
147
|
'& .MuiAutocomplete-input': {
|
|
153
148
|
border: 'none',
|
|
154
149
|
},
|
|
@@ -168,53 +163,36 @@ export const EditableTableCore = (props: EditableDataTableProps) => {
|
|
|
168
163
|
width: 150,
|
|
169
164
|
cellClassName: 'actions',
|
|
170
165
|
getActions: (params) => {
|
|
166
|
+
const actions = [];
|
|
171
167
|
if (rowModesModel[params.id]?.mode === GridRowModes.Edit) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
label="Cancel"
|
|
189
|
-
onClick={() => handleDeleteClick(params)}
|
|
190
|
-
color="inherit"
|
|
191
|
-
/>,
|
|
192
|
-
];
|
|
168
|
+
actions.push(
|
|
169
|
+
<GridActionsCellItem
|
|
170
|
+
icon={<Icons.SaveIcon />}
|
|
171
|
+
label="Save"
|
|
172
|
+
onClick={() => handleSaveClick(params)}
|
|
173
|
+
/>,
|
|
174
|
+
);
|
|
175
|
+
} else {
|
|
176
|
+
actions.push(
|
|
177
|
+
<GridActionsCellItem
|
|
178
|
+
icon={<Icons.EditIcon />}
|
|
179
|
+
label="Edit"
|
|
180
|
+
onClick={() => handleEditClick(params)}
|
|
181
|
+
color="inherit"
|
|
182
|
+
/>,
|
|
183
|
+
);
|
|
193
184
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
<
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
<GridActionsCellItem
|
|
206
|
-
icon={<Icons.EditIcon />}
|
|
207
|
-
label="Edit"
|
|
208
|
-
onClick={() => handleEditClick(params)}
|
|
209
|
-
color="inherit"
|
|
210
|
-
/>,
|
|
211
|
-
<GridActionsCellItem
|
|
212
|
-
icon={<Icons.DeleteIcon />}
|
|
213
|
-
label="Delete"
|
|
214
|
-
onClick={() => handleDeleteClick(params)}
|
|
215
|
-
color="inherit"
|
|
216
|
-
/>,
|
|
217
|
-
];
|
|
185
|
+
if (!props.hideDelete) {
|
|
186
|
+
actions.push(
|
|
187
|
+
<GridActionsCellItem
|
|
188
|
+
icon={<Icons.DeleteIcon />}
|
|
189
|
+
label="Delete"
|
|
190
|
+
onClick={() => handleDeleteClick(params)}
|
|
191
|
+
color="inherit"
|
|
192
|
+
/>,
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
return actions;
|
|
218
196
|
},
|
|
219
197
|
} as GridColDef,
|
|
220
198
|
]}
|
|
@@ -5,15 +5,14 @@ import {
|
|
|
5
5
|
Box,
|
|
6
6
|
Autocomplete as MuiAutocomplete,
|
|
7
7
|
Paper,
|
|
8
|
-
PaperProps,
|
|
9
8
|
} from '@mui/material';
|
|
10
9
|
import axios from 'axios';
|
|
11
|
-
import _ from 'lodash';
|
|
12
|
-
import { SyntheticEvent, useEffect, useReducer } from 'react';
|
|
10
|
+
import _, { debounce } from 'lodash';
|
|
11
|
+
import { SyntheticEvent, useEffect, useMemo, useReducer } from 'react';
|
|
13
12
|
import { Typography } from '../../DataDisplay/Typography/Typography';
|
|
14
13
|
import { Spinner } from '../../Feedback/Spinner/Spinner';
|
|
15
14
|
import { TextField } from '../TextField/TextField';
|
|
16
|
-
import {
|
|
15
|
+
import { OptionsLoader } from '../components/OptionsLoader';
|
|
17
16
|
import { OptionContainer } from '../styles';
|
|
18
17
|
|
|
19
18
|
function sleep(duration: number): Promise<void> {
|
|
@@ -24,6 +23,13 @@ function sleep(duration: number): Promise<void> {
|
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
25
|
|
|
26
|
+
declare module '@mui/material/Autocomplete' {
|
|
27
|
+
interface AutocompletePaperSlotPropsOverrides {
|
|
28
|
+
loadingOptions: boolean;
|
|
29
|
+
isSearch: boolean;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
27
33
|
export type SingleSelectProps = {
|
|
28
34
|
options?: { label: string; subLabel?: string; value: any }[] | any[];
|
|
29
35
|
optionsApiEndPoint?: string;
|
|
@@ -33,7 +39,11 @@ export type SingleSelectProps = {
|
|
|
33
39
|
label?: string;
|
|
34
40
|
name?: string;
|
|
35
41
|
getValue?: (option: any) => any;
|
|
36
|
-
|
|
42
|
+
dbValueProps?: {
|
|
43
|
+
valueKey: string;
|
|
44
|
+
isObjectId?: boolean;
|
|
45
|
+
};
|
|
46
|
+
dbLabelProps?: { labelKey: string; subLabelKey?: string };
|
|
37
47
|
onChange: (value: any) => void;
|
|
38
48
|
error?: any;
|
|
39
49
|
helperText?: string;
|
|
@@ -54,7 +64,7 @@ export type SingleSelectProps = {
|
|
|
54
64
|
| 'renderInput'
|
|
55
65
|
>;
|
|
56
66
|
|
|
57
|
-
const CustomPaper = (props:
|
|
67
|
+
const CustomPaper = (props: any) => (
|
|
58
68
|
<Paper
|
|
59
69
|
{...props}
|
|
60
70
|
sx={{
|
|
@@ -63,7 +73,7 @@ const CustomPaper = (props: PaperProps) => (
|
|
|
63
73
|
}}
|
|
64
74
|
>
|
|
65
75
|
{props.children}
|
|
66
|
-
<
|
|
76
|
+
<OptionsLoader loading={props.loadingOptions} isSearch={props.isSearch} />
|
|
67
77
|
</Paper>
|
|
68
78
|
);
|
|
69
79
|
|
|
@@ -78,6 +88,8 @@ enum SingleSelectActionsTypes {
|
|
|
78
88
|
SET_INTERNAL_OPTIONS = 'set_internal_options',
|
|
79
89
|
APPEND_INTERNAL_OPTIONS = 'append_internal_options',
|
|
80
90
|
CHANGE_HAS_MORE_FLAG = 'change_has_more_flag',
|
|
91
|
+
SET_SEARCH = 'set_search',
|
|
92
|
+
CLEAR_SEARCH = 'clear_search',
|
|
81
93
|
}
|
|
82
94
|
const singleSelectReducer = (
|
|
83
95
|
state: any,
|
|
@@ -108,6 +120,18 @@ const singleSelectReducer = (
|
|
|
108
120
|
case SingleSelectActionsTypes.SET_NETWORK_ERROR: {
|
|
109
121
|
return { ...state, ...stateChanges };
|
|
110
122
|
}
|
|
123
|
+
case SingleSelectActionsTypes.SET_SEARCH: {
|
|
124
|
+
return { ...state, search: stateChanges.search, hasMore: true };
|
|
125
|
+
}
|
|
126
|
+
case SingleSelectActionsTypes.CLEAR_SEARCH: {
|
|
127
|
+
return {
|
|
128
|
+
...state,
|
|
129
|
+
search: null,
|
|
130
|
+
offset: 0,
|
|
131
|
+
internalOptions: [],
|
|
132
|
+
internalOptionsMap: {},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
111
135
|
case SingleSelectActionsTypes.SET_INTERNAL_OPTIONS: {
|
|
112
136
|
return {
|
|
113
137
|
...state,
|
|
@@ -153,7 +177,11 @@ export const SingleSelect = ({
|
|
|
153
177
|
onChange,
|
|
154
178
|
error,
|
|
155
179
|
helperText,
|
|
156
|
-
|
|
180
|
+
dbValueProps = {
|
|
181
|
+
valueKey: 'id',
|
|
182
|
+
isObjectId: false,
|
|
183
|
+
},
|
|
184
|
+
dbLabelProps,
|
|
157
185
|
onOpen,
|
|
158
186
|
onClose,
|
|
159
187
|
...restProps
|
|
@@ -171,6 +199,7 @@ export const SingleSelect = ({
|
|
|
171
199
|
limit: 10,
|
|
172
200
|
offset: 0,
|
|
173
201
|
hasMore: true,
|
|
202
|
+
search: null,
|
|
174
203
|
});
|
|
175
204
|
const {
|
|
176
205
|
open,
|
|
@@ -180,6 +209,7 @@ export const SingleSelect = ({
|
|
|
180
209
|
limit,
|
|
181
210
|
offset,
|
|
182
211
|
hasMore,
|
|
212
|
+
search,
|
|
183
213
|
} = state;
|
|
184
214
|
|
|
185
215
|
const internalAxios = useCampxAxios ? campxAxios : axios;
|
|
@@ -199,7 +229,11 @@ export const SingleSelect = ({
|
|
|
199
229
|
limit,
|
|
200
230
|
offset,
|
|
201
231
|
selectedValueData: value,
|
|
202
|
-
|
|
232
|
+
dbValueProps: {
|
|
233
|
+
...dbValueProps,
|
|
234
|
+
...(dbValueProps.isObjectId && { isObjectId: true }),
|
|
235
|
+
},
|
|
236
|
+
dbLabelProps,
|
|
203
237
|
...optionsApiEndpointParams,
|
|
204
238
|
},
|
|
205
239
|
})
|
|
@@ -248,6 +282,11 @@ export const SingleSelect = ({
|
|
|
248
282
|
dispatch({
|
|
249
283
|
actionType: SingleSelectActionsTypes.CLOSE,
|
|
250
284
|
});
|
|
285
|
+
if (optionsApiEndPoint) {
|
|
286
|
+
dispatch({
|
|
287
|
+
actionType: SingleSelectActionsTypes.CLEAR_SEARCH,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
251
290
|
if (onClose) {
|
|
252
291
|
onClose(event, reason);
|
|
253
292
|
}
|
|
@@ -265,12 +304,17 @@ export const SingleSelect = ({
|
|
|
265
304
|
actionType: SingleSelectActionsTypes.LOAD_INTERNAL_OPTIONS_START,
|
|
266
305
|
});
|
|
267
306
|
const newOptions = await internalAxios
|
|
268
|
-
.get(optionsApiEndPoint
|
|
307
|
+
.get(optionsApiEndPoint, {
|
|
269
308
|
params: {
|
|
270
309
|
limit: limit,
|
|
271
310
|
offset: offset + 10,
|
|
311
|
+
search: search,
|
|
272
312
|
selectedValueData: value,
|
|
273
|
-
|
|
313
|
+
dbValueProps: {
|
|
314
|
+
...dbValueProps,
|
|
315
|
+
...(dbValueProps.isObjectId && { isObjectId: true }),
|
|
316
|
+
},
|
|
317
|
+
dbLabelProps,
|
|
274
318
|
...optionsApiEndpointParams,
|
|
275
319
|
},
|
|
276
320
|
})
|
|
@@ -285,13 +329,81 @@ export const SingleSelect = ({
|
|
|
285
329
|
actionType: SingleSelectActionsTypes.APPEND_INTERNAL_OPTIONS,
|
|
286
330
|
stateChanges: {
|
|
287
331
|
newOptions: newOptions,
|
|
288
|
-
|
|
289
332
|
internalOptionsMap: generateOptionsMap(newOptions),
|
|
290
333
|
},
|
|
291
334
|
});
|
|
292
335
|
}
|
|
293
336
|
};
|
|
294
337
|
|
|
338
|
+
const searchDb = async (searchValue: string) => {
|
|
339
|
+
dispatch({
|
|
340
|
+
actionType: SingleSelectActionsTypes.SET_SEARCH,
|
|
341
|
+
stateChanges: {
|
|
342
|
+
search: searchValue,
|
|
343
|
+
},
|
|
344
|
+
});
|
|
345
|
+
if (!searchValue || searchValue.trim() === '') {
|
|
346
|
+
dispatch({
|
|
347
|
+
actionType: SingleSelectActionsTypes.CLEAR_SEARCH,
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
if (optionsApiEndPoint) {
|
|
351
|
+
try {
|
|
352
|
+
dispatch({
|
|
353
|
+
actionType: SingleSelectActionsTypes.LOAD_INTERNAL_OPTIONS_START,
|
|
354
|
+
});
|
|
355
|
+
const options = await internalAxios
|
|
356
|
+
.get(optionsApiEndPoint, {
|
|
357
|
+
params: {
|
|
358
|
+
limit,
|
|
359
|
+
offset: 0,
|
|
360
|
+
selectedValueData: value,
|
|
361
|
+
dbValueProps: {
|
|
362
|
+
...dbValueProps,
|
|
363
|
+
...(dbValueProps.isObjectId && { isObjectId: true }),
|
|
364
|
+
},
|
|
365
|
+
dbLabelProps,
|
|
366
|
+
search: searchValue,
|
|
367
|
+
...optionsApiEndpointParams,
|
|
368
|
+
},
|
|
369
|
+
})
|
|
370
|
+
.then((res) => res.data);
|
|
371
|
+
await sleep(700);
|
|
372
|
+
|
|
373
|
+
dispatch({
|
|
374
|
+
actionType: SingleSelectActionsTypes.SET_INTERNAL_OPTIONS,
|
|
375
|
+
stateChanges: {
|
|
376
|
+
internalOptions: options,
|
|
377
|
+
internalOptionsMap: generateOptionsMap(options),
|
|
378
|
+
},
|
|
379
|
+
});
|
|
380
|
+
} catch (e) {
|
|
381
|
+
dispatch({
|
|
382
|
+
actionType: SingleSelectActionsTypes.SET_NETWORK_ERROR,
|
|
383
|
+
stateChanges: {
|
|
384
|
+
error: e,
|
|
385
|
+
},
|
|
386
|
+
});
|
|
387
|
+
dispatch({
|
|
388
|
+
actionType: SingleSelectActionsTypes.LOAD_INTERNAL_OPTIONS_END,
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
const debouncedSendRequest = useMemo(() => {
|
|
395
|
+
return debounce((searchValue) => {
|
|
396
|
+
searchDb(searchValue);
|
|
397
|
+
}, 300);
|
|
398
|
+
}, [searchDb]);
|
|
399
|
+
|
|
400
|
+
const handleSearch = async (
|
|
401
|
+
e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,
|
|
402
|
+
) => {
|
|
403
|
+
const searchValue = e.target.value;
|
|
404
|
+
debouncedSendRequest(searchValue);
|
|
405
|
+
};
|
|
406
|
+
|
|
295
407
|
const loadSelectedOptions = async () => {
|
|
296
408
|
dispatch({
|
|
297
409
|
actionType: SingleSelectActionsTypes.LOAD_SELECTED_OPTIONS_START,
|
|
@@ -302,7 +414,11 @@ export const SingleSelect = ({
|
|
|
302
414
|
limit,
|
|
303
415
|
offset,
|
|
304
416
|
selectedValueData: value,
|
|
305
|
-
|
|
417
|
+
dbValueProps: {
|
|
418
|
+
...dbValueProps,
|
|
419
|
+
...(dbValueProps.isObjectId && { isObjectId: true }),
|
|
420
|
+
},
|
|
421
|
+
dbLabelProps,
|
|
306
422
|
filterBySelectedValues: true,
|
|
307
423
|
},
|
|
308
424
|
});
|
|
@@ -354,11 +470,19 @@ export const SingleSelect = ({
|
|
|
354
470
|
}}
|
|
355
471
|
open={open}
|
|
356
472
|
autoFocus={true}
|
|
473
|
+
filterOptions={(options, state) => {
|
|
474
|
+
if (optionsApiEndPoint) {
|
|
475
|
+
return options;
|
|
476
|
+
}
|
|
477
|
+
return options.filter((option) =>
|
|
478
|
+
option.label.toLowerCase().includes(state.inputValue.toLowerCase()),
|
|
479
|
+
);
|
|
480
|
+
}}
|
|
357
481
|
value={state.internalOptionsMap[value]}
|
|
358
482
|
PaperComponent={CustomPaper}
|
|
359
483
|
renderOption={(props, option: any) => {
|
|
360
484
|
return (
|
|
361
|
-
<Box component="li" {...props}>
|
|
485
|
+
<Box component="li" {...props} key={option.value}>
|
|
362
486
|
<OptionContainer>
|
|
363
487
|
<Typography variant="label1">{option.label}</Typography>
|
|
364
488
|
<Typography variant="caption">{option?.subLabel}</Typography>
|
|
@@ -374,7 +498,8 @@ export const SingleSelect = ({
|
|
|
374
498
|
...restProps.slotProps,
|
|
375
499
|
paper: {
|
|
376
500
|
...restProps.slotProps?.paper,
|
|
377
|
-
|
|
501
|
+
loadingOptions: loadingInternalOptions,
|
|
502
|
+
isSearch: !!state.search,
|
|
378
503
|
},
|
|
379
504
|
}}
|
|
380
505
|
onOpen={handleOpen}
|
|
@@ -386,6 +511,7 @@ export const SingleSelect = ({
|
|
|
386
511
|
label={label}
|
|
387
512
|
required={required}
|
|
388
513
|
name={name}
|
|
514
|
+
onChange={handleSearch}
|
|
389
515
|
error={error}
|
|
390
516
|
helperText={helperText}
|
|
391
517
|
/>
|
|
@@ -2,11 +2,19 @@ import { Typography } from '../../DataDisplay/Typography/Typography';
|
|
|
2
2
|
import { Spinner } from '../../Feedback/Spinner/Spinner';
|
|
3
3
|
import { FetchingOptionsLoaderContainer } from '../styles';
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const OptionsLoader = ({
|
|
6
|
+
loading,
|
|
7
|
+
isSearch,
|
|
8
|
+
}: {
|
|
9
|
+
loading: boolean;
|
|
10
|
+
isSearch: boolean;
|
|
11
|
+
}) => {
|
|
6
12
|
return loading ? (
|
|
7
13
|
<FetchingOptionsLoaderContainer direction="row" alignItems="center">
|
|
8
14
|
<Spinner />
|
|
9
|
-
<Typography variant="caption">
|
|
15
|
+
<Typography variant="caption">
|
|
16
|
+
{isSearch ? 'Searching' : 'Loading Options'}
|
|
17
|
+
</Typography>
|
|
10
18
|
</FetchingOptionsLoaderContainer>
|
|
11
19
|
) : (
|
|
12
20
|
<></>
|
|
@@ -5,7 +5,7 @@ export const OptionContainer = styled(Box)(({ theme }) => ({
|
|
|
5
5
|
flexDirection: 'column',
|
|
6
6
|
borderBottom: `1px solid ${theme.palette.secondary.main}`,
|
|
7
7
|
width: '100%',
|
|
8
|
-
padding: '
|
|
8
|
+
padding: '4px 0px',
|
|
9
9
|
}));
|
|
10
10
|
|
|
11
11
|
export const FetchingOptionsLoaderContainer = styled(Stack)(({ theme }) => ({
|
|
@@ -302,7 +302,15 @@ export const getCommonTheme = (mode: Theme) => {
|
|
|
302
302
|
'& label': {
|
|
303
303
|
display: 'none',
|
|
304
304
|
},
|
|
305
|
+
input: {
|
|
306
|
+
padding: '9px',
|
|
307
|
+
},
|
|
308
|
+
|
|
309
|
+
fieldset: {
|
|
310
|
+
top: '0px',
|
|
311
|
+
},
|
|
305
312
|
'& legend': {
|
|
313
|
+
height: '0px',
|
|
306
314
|
'& span': {
|
|
307
315
|
display: 'none',
|
|
308
316
|
},
|