@fixefy/fixefy-ui-components 0.2.31 → 0.2.33
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/FxAsyncDropdown/FxAsyncDropdown.js +9 -17
- package/dist/FxAsyncDropdown/styles/dropdown.styles.d.ts +0 -3
- package/dist/FxAsyncDropdown/styles/dropdown.styles.js +9 -47
- package/dist/FxStaticDropdown/FxStaticDropdown.d.ts +1 -1
- package/dist/FxStaticDropdown/FxStaticDropdown.js +2 -2
- package/dist/FxStaticDropdown/styles/dropdown.styles.js +3 -7
- package/package.json +1 -1
|
@@ -120,7 +120,7 @@ const checkedIcon = /*#__PURE__*/ (0, _jsxruntime.jsx)(_iconsmaterial.CheckBox,
|
|
|
120
120
|
fontSize: "small"
|
|
121
121
|
});
|
|
122
122
|
const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
|
|
123
|
-
const { onAdd, onRemoveOne, onRemoveAll, fetcher, disabled, type = 'text', variables, search_path, modal_type, multiple, name, query, isInitialOpen, placeholder, title_path,
|
|
123
|
+
const { onAdd, onRemoveOne, onRemoveAll, fetcher, disabled, type = 'text', variables, search_path, modal_type, multiple, name, query, isInitialOpen, placeholder, title_path, rootStylesOverride } = props;
|
|
124
124
|
const ref = (0, _react.useRef)(null);
|
|
125
125
|
const theme = (0, _material.useTheme)();
|
|
126
126
|
const [displayed, setDisplayed] = (0, _react.useState)(multiple ? [] : '');
|
|
@@ -187,14 +187,10 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
|
|
|
187
187
|
if (newOptions == null || newOptions.length < pageSize) {
|
|
188
188
|
setIsLastPage(true);
|
|
189
189
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
...prevOptions,
|
|
195
|
-
...newOptions
|
|
196
|
-
]);
|
|
197
|
-
}
|
|
190
|
+
reason !== 'loaded more' ? setOptions(newOptions) : setOptions((prevOptions)=>[
|
|
191
|
+
...prevOptions,
|
|
192
|
+
...newOptions
|
|
193
|
+
]);
|
|
198
194
|
}
|
|
199
195
|
}, [
|
|
200
196
|
data,
|
|
@@ -251,17 +247,20 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
|
|
|
251
247
|
deleteOneItem(option);
|
|
252
248
|
} else {
|
|
253
249
|
onAdd && onAdd(option);
|
|
250
|
+
setIOpen(false);
|
|
254
251
|
setDisplayed((prev)=>[
|
|
255
252
|
...prev,
|
|
256
253
|
option
|
|
257
254
|
]);
|
|
258
255
|
addToStoredDisplayed(option);
|
|
256
|
+
setIOpen(false);
|
|
259
257
|
}
|
|
260
258
|
break;
|
|
261
259
|
default:
|
|
262
260
|
setDisplayed(option);
|
|
263
261
|
onAdd && onAdd(option);
|
|
264
262
|
addToStoredDisplayed(option);
|
|
263
|
+
setIOpen(false);
|
|
265
264
|
}
|
|
266
265
|
};
|
|
267
266
|
const deleteOneItem = (item)=>{
|
|
@@ -492,8 +491,6 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
|
|
|
492
491
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
493
492
|
direction: 'row',
|
|
494
493
|
sx: {
|
|
495
|
-
maxWidth: 270,
|
|
496
|
-
minWidth: 270,
|
|
497
494
|
display: 'flex',
|
|
498
495
|
justifyContent: 'space-between'
|
|
499
496
|
},
|
|
@@ -530,7 +527,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
|
|
|
530
527
|
});
|
|
531
528
|
};
|
|
532
529
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_dropdownstyles.Root, {
|
|
533
|
-
style:
|
|
530
|
+
style: rootStylesOverride,
|
|
534
531
|
children: [
|
|
535
532
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
536
533
|
children: [
|
|
@@ -546,11 +543,6 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
|
|
|
546
543
|
},
|
|
547
544
|
onFocus: ()=>{
|
|
548
545
|
!isInitialOpen && setIOpen(true);
|
|
549
|
-
},
|
|
550
|
-
onBlur: ()=>{
|
|
551
|
-
setTimeout(()=>{
|
|
552
|
-
!isInitialOpen && setIOpen(false);
|
|
553
|
-
}, 200);
|
|
554
546
|
}
|
|
555
547
|
}),
|
|
556
548
|
loading && /*#__PURE__*/ (0, _jsxruntime.jsx)(_dropdownstyles.Loading, {
|
|
@@ -12,21 +12,12 @@ _export(exports, {
|
|
|
12
12
|
InputWrapper: function() {
|
|
13
13
|
return InputWrapper;
|
|
14
14
|
},
|
|
15
|
-
Label: function() {
|
|
16
|
-
return Label;
|
|
17
|
-
},
|
|
18
|
-
Listbox: function() {
|
|
19
|
-
return Listbox;
|
|
20
|
-
},
|
|
21
15
|
Loading: function() {
|
|
22
16
|
return Loading;
|
|
23
17
|
},
|
|
24
18
|
Root: function() {
|
|
25
19
|
return Root;
|
|
26
20
|
},
|
|
27
|
-
StyledClose: function() {
|
|
28
|
-
return StyledClose;
|
|
29
|
-
},
|
|
30
21
|
StyledListBox: function() {
|
|
31
22
|
return StyledListBox;
|
|
32
23
|
}
|
|
@@ -85,7 +76,7 @@ function _object_spread_props(target, source) {
|
|
|
85
76
|
return target;
|
|
86
77
|
}
|
|
87
78
|
const Root = (0, _styles.styled)('div')(({ props })=>{
|
|
88
|
-
return
|
|
79
|
+
return _object_spread({
|
|
89
80
|
color: 'rgba(0,0,0,.85)',
|
|
90
81
|
fontSize: 14,
|
|
91
82
|
background: '#FFFFFF',
|
|
@@ -95,14 +86,11 @@ const Root = (0, _styles.styled)('div')(({ props })=>{
|
|
|
95
86
|
['& > div']: {
|
|
96
87
|
padding: 0
|
|
97
88
|
}
|
|
98
|
-
}
|
|
99
|
-
|
|
89
|
+
},
|
|
90
|
+
maxWidth: 270,
|
|
91
|
+
minWidth: 270
|
|
92
|
+
}, props);
|
|
100
93
|
});
|
|
101
|
-
const Label = (0, _styles.styled)('label')(()=>({
|
|
102
|
-
padding: '0 0 4px',
|
|
103
|
-
lineHeight: '1.5',
|
|
104
|
-
display: 'block'
|
|
105
|
-
}));
|
|
106
94
|
const Loading = (0, _styles.styled)('div')(()=>({
|
|
107
95
|
width: 30,
|
|
108
96
|
height: 30,
|
|
@@ -160,33 +148,8 @@ const InputWrapper = (0, _styles.styled)('div')(({ theme, hasValue, disabled })=
|
|
|
160
148
|
})
|
|
161
149
|
};
|
|
162
150
|
});
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
padding: 0,
|
|
166
|
-
position: 'absolute',
|
|
167
|
-
listStyle: 'none',
|
|
168
|
-
backgroundColor: theme.palette.common.white,
|
|
169
|
-
overflow: 'auto',
|
|
170
|
-
maxHeight: 250,
|
|
171
|
-
minHeight: 250,
|
|
172
|
-
borderRadius: 4,
|
|
173
|
-
boxShadow: '0px 0px 10px rgba(86, 135, 147, 0.2)',
|
|
174
|
-
zIndex: 1,
|
|
175
|
-
maxWidth: 270,
|
|
176
|
-
minWidth: 270,
|
|
177
|
-
top: 48,
|
|
178
|
-
left: -42,
|
|
179
|
-
['& div']: {
|
|
180
|
-
textOverflow: 'ellipsis',
|
|
181
|
-
whiteSpace: 'nowrap',
|
|
182
|
-
overflow: 'hidden'
|
|
183
|
-
}
|
|
184
|
-
}));
|
|
185
|
-
const StyledClose = (0, _styles.styled)('div')(()=>({
|
|
186
|
-
position: 'absolute',
|
|
187
|
-
bottom: 0
|
|
188
|
-
}));
|
|
189
|
-
const StyledListBox = (0, _styles.styled)('ul')(({ theme })=>({
|
|
151
|
+
const StyledListBox = (0, _styles.styled)('ul')(({ theme })=>{
|
|
152
|
+
return {
|
|
190
153
|
margin: 0,
|
|
191
154
|
padding: 0,
|
|
192
155
|
listStyle: 'none',
|
|
@@ -198,7 +161,6 @@ const StyledListBox = (0, _styles.styled)('ul')(({ theme })=>({
|
|
|
198
161
|
overflowX: 'hidden',
|
|
199
162
|
paddingTop: 8,
|
|
200
163
|
paddingBottom: 8,
|
|
201
|
-
maxWidth: 270,
|
|
202
164
|
minWidth: 270,
|
|
203
165
|
'&::-webkit-scrollbar': {
|
|
204
166
|
width: '8px',
|
|
@@ -228,7 +190,6 @@ const StyledListBox = (0, _styles.styled)('ul')(({ theme })=>({
|
|
|
228
190
|
whiteSpace: 'nowrap',
|
|
229
191
|
overflow: 'hidden',
|
|
230
192
|
width: '100%',
|
|
231
|
-
maxWidth: 270,
|
|
232
193
|
minWidth: 270
|
|
233
194
|
},
|
|
234
195
|
['& li:hover']: {
|
|
@@ -245,4 +206,5 @@ const StyledListBox = (0, _styles.styled)('ul')(({ theme })=>({
|
|
|
245
206
|
color: 'currentColor'
|
|
246
207
|
}
|
|
247
208
|
}
|
|
248
|
-
}
|
|
209
|
+
};
|
|
210
|
+
});
|
|
@@ -18,6 +18,6 @@ export type StaticDropdownPropsType = {
|
|
|
18
18
|
isInitialOpen?: boolean;
|
|
19
19
|
placeholder?: string;
|
|
20
20
|
data: string[];
|
|
21
|
-
|
|
21
|
+
rootStylesOverride?: any;
|
|
22
22
|
};
|
|
23
23
|
export declare const FxStaticDropdown: React.ForwardRefExoticComponent<StaticDropdownPropsType & React.RefAttributes<unknown>>;
|
|
@@ -65,7 +65,7 @@ const checkedIcon = /*#__PURE__*/ (0, _jsxruntime.jsx)(_iconsmaterial.CheckBox,
|
|
|
65
65
|
fontSize: "small"
|
|
66
66
|
});
|
|
67
67
|
const FxStaticDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
|
|
68
|
-
const { onAdd, onRemoveOne, onRemoveAll, type = 'text', modal_type, multiple, query, isInitialOpen, placeholder, data,
|
|
68
|
+
const { onAdd, onRemoveOne, onRemoveAll, type = 'text', modal_type, multiple, query, isInitialOpen, placeholder, data, rootStylesOverride } = props;
|
|
69
69
|
const ref = (0, _react.useRef)(null);
|
|
70
70
|
const theme = (0, _material.useTheme)();
|
|
71
71
|
const [displayed, setDisplayed] = (0, _react.useState)(multiple ? [] : '');
|
|
@@ -383,7 +383,7 @@ const FxStaticDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
|
|
|
383
383
|
});
|
|
384
384
|
};
|
|
385
385
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_dropdownstyles.Root, {
|
|
386
|
-
style:
|
|
386
|
+
style: rootStylesOverride,
|
|
387
387
|
children: [
|
|
388
388
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
389
389
|
children: [
|
|
@@ -73,7 +73,7 @@ function _object_spread_props(target, source) {
|
|
|
73
73
|
return target;
|
|
74
74
|
}
|
|
75
75
|
const Root = (0, _styles.styled)('div')(({ props })=>{
|
|
76
|
-
return
|
|
76
|
+
return _object_spread({
|
|
77
77
|
color: 'rgba(0,0,0,.85)',
|
|
78
78
|
fontSize: 14,
|
|
79
79
|
background: '#FFFFFF',
|
|
@@ -84,7 +84,7 @@ const Root = (0, _styles.styled)('div')(({ props })=>{
|
|
|
84
84
|
padding: 0
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
});
|
|
87
|
+
}, props);
|
|
88
88
|
});
|
|
89
89
|
const InputWrapper = (0, _styles.styled)('div')(({ theme, hasValue, disabled })=>{
|
|
90
90
|
const disabledBorder = `1px solid ${theme.palette.greyscale[200]}`;
|
|
@@ -144,8 +144,6 @@ const StyledListBox = (0, _styles.styled)('ul')(({ theme })=>({
|
|
|
144
144
|
overflowX: 'hidden',
|
|
145
145
|
paddingTop: 8,
|
|
146
146
|
paddingBottom: 8,
|
|
147
|
-
maxWidth: 270,
|
|
148
|
-
minWidth: 270,
|
|
149
147
|
'&::-webkit-scrollbar': {
|
|
150
148
|
width: '8px',
|
|
151
149
|
backgroundColor: 'transparent'
|
|
@@ -173,9 +171,7 @@ const StyledListBox = (0, _styles.styled)('ul')(({ theme })=>({
|
|
|
173
171
|
textOverflow: 'ellipsis',
|
|
174
172
|
whiteSpace: 'nowrap',
|
|
175
173
|
overflow: 'hidden',
|
|
176
|
-
width: '100%'
|
|
177
|
-
maxWidth: 270,
|
|
178
|
-
minWidth: 270
|
|
174
|
+
width: '100%'
|
|
179
175
|
},
|
|
180
176
|
['& li:hover']: {
|
|
181
177
|
backgroundColor: '#F6F9FA'
|
package/package.json
CHANGED