@fixefy/fixefy-ui-components 0.1.83 → 0.1.85
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.
|
@@ -331,6 +331,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props, parentRe
|
|
|
331
331
|
});
|
|
332
332
|
}
|
|
333
333
|
case 'text':
|
|
334
|
+
default:
|
|
334
335
|
{
|
|
335
336
|
return options.map((option)=>{
|
|
336
337
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)("li", {
|
|
@@ -341,19 +342,6 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props, parentRe
|
|
|
341
342
|
}, option._id);
|
|
342
343
|
});
|
|
343
344
|
}
|
|
344
|
-
default:
|
|
345
|
-
{
|
|
346
|
-
return options.map((option, i)=>{
|
|
347
|
-
const clicked = getClicked(option);
|
|
348
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)("li", {
|
|
349
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
350
|
-
variant: "subtitle2",
|
|
351
|
-
color: theme.palette.typography.title,
|
|
352
|
-
children: (0, _helpers.titleCase)(clicked || '')
|
|
353
|
-
})
|
|
354
|
-
}, i);
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
345
|
}
|
|
358
346
|
};
|
|
359
347
|
(0, _react.useImperativeHandle)(parentRef, ()=>({
|
|
@@ -383,12 +371,35 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props, parentRe
|
|
|
383
371
|
case true:
|
|
384
372
|
rv = getMultipleDisplayedValues();
|
|
385
373
|
break;
|
|
374
|
+
case false:
|
|
386
375
|
default:
|
|
387
376
|
rv = getValueByModalType(displayed, 'displayed');
|
|
388
|
-
|
|
377
|
+
break;
|
|
389
378
|
}
|
|
390
379
|
return rv;
|
|
391
380
|
};
|
|
381
|
+
const getDeleteButton = (option)=>{
|
|
382
|
+
if (multiple) {
|
|
383
|
+
if (displayed.length > 0) {
|
|
384
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
385
|
+
onClick: ()=>{
|
|
386
|
+
deleteItem(option);
|
|
387
|
+
},
|
|
388
|
+
children: "x"
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
} else {
|
|
392
|
+
if (displayed[search_path] === getClicked(option)) {
|
|
393
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
394
|
+
onClick: ()=>{
|
|
395
|
+
deleteItem(option);
|
|
396
|
+
},
|
|
397
|
+
children: "x"
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return null;
|
|
402
|
+
};
|
|
392
403
|
const getValueByModalType = (option, location)=>{
|
|
393
404
|
let rv = null;
|
|
394
405
|
const clicked = getClicked(option);
|
|
@@ -408,59 +419,74 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props, parentRe
|
|
|
408
419
|
}, option._id);
|
|
409
420
|
break;
|
|
410
421
|
case 'logo':
|
|
411
|
-
rv =
|
|
422
|
+
rv = /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
412
423
|
sx: {
|
|
413
424
|
display: 'flex',
|
|
414
425
|
gap: 1,
|
|
415
426
|
color: 'grey',
|
|
416
|
-
cursor: 'pointer'
|
|
427
|
+
cursor: 'pointer',
|
|
428
|
+
width: '100%'
|
|
417
429
|
},
|
|
418
430
|
children: [
|
|
419
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
431
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
432
|
+
style: {
|
|
433
|
+
width: '70px'
|
|
434
|
+
},
|
|
435
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxIcon.FxIcon, {
|
|
436
|
+
icon: `companies/${option.logo}`,
|
|
437
|
+
width: 70,
|
|
438
|
+
height: 16
|
|
439
|
+
})
|
|
423
440
|
}),
|
|
424
441
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
442
|
+
sx: {
|
|
443
|
+
width: '170px',
|
|
444
|
+
overflow: 'hidden'
|
|
445
|
+
},
|
|
425
446
|
variant: "subtitle2",
|
|
426
447
|
color: theme.palette.typography.title,
|
|
427
448
|
children: (0, _helpers.titleCase)(clicked)
|
|
428
449
|
}),
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
450
|
+
location === 'displayed' && getDeleteButton(option),
|
|
451
|
+
location === 'list' && isChecked(option) && /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxIcon.FxIcon, {
|
|
452
|
+
width: 16,
|
|
453
|
+
height: 16,
|
|
454
|
+
icon: 'filters/chosen_icon.svg'
|
|
434
455
|
})
|
|
435
456
|
]
|
|
436
|
-
}, option._id)
|
|
457
|
+
}, option._id);
|
|
458
|
+
break;
|
|
459
|
+
case 'text':
|
|
460
|
+
default:
|
|
461
|
+
rv = /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
437
462
|
sx: {
|
|
438
463
|
display: 'flex',
|
|
464
|
+
justifyContent: 'space-between',
|
|
465
|
+
width: '100%',
|
|
466
|
+
maxWidth: '250px',
|
|
439
467
|
gap: 1,
|
|
440
468
|
color: 'grey',
|
|
441
469
|
cursor: 'pointer'
|
|
442
470
|
},
|
|
443
471
|
children: [
|
|
444
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_FxIcon.FxIcon, {
|
|
445
|
-
icon: `companies/${option.logo}`,
|
|
446
|
-
width: 70,
|
|
447
|
-
height: 16
|
|
448
|
-
}),
|
|
449
472
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
473
|
+
sx: {
|
|
474
|
+
width: '210px',
|
|
475
|
+
overflow: 'hidden'
|
|
476
|
+
},
|
|
450
477
|
variant: "subtitle2",
|
|
451
478
|
color: theme.palette.typography.title,
|
|
452
479
|
children: (0, _helpers.titleCase)(clicked)
|
|
480
|
+
}),
|
|
481
|
+
location === 'displayed' && getDeleteButton(option),
|
|
482
|
+
location === 'list' && isChecked(option) && /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxIcon.FxIcon, {
|
|
483
|
+
width: 16,
|
|
484
|
+
height: 16,
|
|
485
|
+
icon: 'filters/chosen_icon.svg'
|
|
453
486
|
})
|
|
454
487
|
]
|
|
455
488
|
}, option._id);
|
|
456
489
|
break;
|
|
457
|
-
default:
|
|
458
|
-
rv = /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
459
|
-
variant: "subtitle2",
|
|
460
|
-
color: theme.palette.typography.title,
|
|
461
|
-
children: (0, _helpers.titleCase)(clicked)
|
|
462
|
-
}, option._id);
|
|
463
|
-
break;
|
|
464
490
|
}
|
|
465
491
|
return rv;
|
|
466
492
|
};
|
|
@@ -481,16 +507,14 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props, parentRe
|
|
|
481
507
|
};
|
|
482
508
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_dropdownstyles.Root, {
|
|
483
509
|
sx: {
|
|
484
|
-
background: '#FFFFFF'
|
|
510
|
+
background: '#FFFFFF',
|
|
511
|
+
padding: '0 16px'
|
|
485
512
|
},
|
|
486
513
|
children: [
|
|
487
514
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
488
|
-
sx: {
|
|
489
|
-
padding: '5px 0 5px 5px'
|
|
490
|
-
},
|
|
491
515
|
children: [
|
|
492
516
|
getCurrentValues(),
|
|
493
|
-
|
|
517
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_dropdownstyles.InputWrapper, {
|
|
494
518
|
disabled: disabled,
|
|
495
519
|
sx: {
|
|
496
520
|
width: '100%',
|
|
@@ -200,8 +200,6 @@ const StyledListBox = (0, _styles.styled)('ul')(({ theme, hasClearBtn })=>({
|
|
|
200
200
|
overflow: 'hidden'
|
|
201
201
|
},
|
|
202
202
|
['& li']: {
|
|
203
|
-
paddingRight: 16,
|
|
204
|
-
paddingLeft: 16,
|
|
205
203
|
display: 'flex',
|
|
206
204
|
alignItems: 'center',
|
|
207
205
|
justifyContent: 'flex-start',
|
|
@@ -210,6 +208,7 @@ const StyledListBox = (0, _styles.styled)('ul')(({ theme, hasClearBtn })=>({
|
|
|
210
208
|
textOverflow: 'ellipsis',
|
|
211
209
|
whiteSpace: 'nowrap',
|
|
212
210
|
overflow: 'hidden',
|
|
211
|
+
width: '100%',
|
|
213
212
|
maxWidth: 270,
|
|
214
213
|
minWidth: 270
|
|
215
214
|
},
|
package/package.json
CHANGED