funda-ui 4.7.515 → 4.7.525
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/CascadingSelect/index.css +105 -88
- package/CascadingSelect/index.js +23 -23
- package/CascadingSelectE2E/index.css +105 -88
- package/CascadingSelectE2E/index.js +24 -24
- package/Select/index.js +110 -88
- package/Tooltip/index.css +69 -68
- package/Tooltip/index.d.ts +15 -1
- package/Tooltip/index.js +153 -57
- package/lib/cjs/CascadingSelect/index.js +23 -23
- package/lib/cjs/CascadingSelectE2E/index.js +24 -24
- package/lib/cjs/Select/index.js +110 -88
- package/lib/cjs/Tooltip/index.d.ts +15 -1
- package/lib/cjs/Tooltip/index.js +153 -57
- package/lib/css/CascadingSelect/index.css +105 -88
- package/lib/css/CascadingSelectE2E/index.css +105 -88
- package/lib/css/Tooltip/index.css +69 -68
- package/lib/esm/CascadingSelect/Group.tsx +3 -5
- package/lib/esm/CascadingSelect/index.scss +89 -68
- package/lib/esm/CascadingSelect/index.tsx +21 -20
- package/lib/esm/CascadingSelectE2E/Group.tsx +4 -3
- package/lib/esm/CascadingSelectE2E/index.scss +83 -63
- package/lib/esm/CascadingSelectE2E/index.tsx +22 -21
- package/lib/esm/Select/index.tsx +165 -148
- package/lib/esm/Tooltip/index.scss +63 -60
- package/lib/esm/Tooltip/index.tsx +143 -44
- package/package.json +1 -1
package/lib/esm/Select/index.tsx
CHANGED
|
@@ -269,8 +269,14 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
269
269
|
const keyboardSelectedItem = useRef<any>(null);
|
|
270
270
|
|
|
271
271
|
|
|
272
|
+
// loading
|
|
273
|
+
const [fetchLoading, setFetchLoading] = useState(false);
|
|
274
|
+
const loadingOutput = <><div className="cus-select-loader">{loader || <svg height="12px" width="12px" viewBox="0 0 512 512"><g><path fill="inherit" d="M256,0c-23.357,0-42.297,18.932-42.297,42.288c0,23.358,18.94,42.288,42.297,42.288c23.357,0,42.279-18.93,42.279-42.288C298.279,18.932,279.357,0,256,0z" /><path fill="inherit" d="M256,427.424c-23.357,0-42.297,18.931-42.297,42.288C213.703,493.07,232.643,512,256,512c23.357,0,42.279-18.93,42.279-42.288C298.279,446.355,279.357,427.424,256,427.424z" /><path fill="inherit" d="M74.974,74.983c-16.52,16.511-16.52,43.286,0,59.806c16.52,16.52,43.287,16.52,59.806,0c16.52-16.511,16.52-43.286,0-59.806C118.261,58.463,91.494,58.463,74.974,74.983z" /><path fill="inherit" d="M377.203,377.211c-16.503,16.52-16.503,43.296,0,59.815c16.519,16.52,43.304,16.52,59.806,0c16.52-16.51,16.52-43.295,0-59.815C420.489,360.692,393.722,360.7,377.203,377.211z" /><path fill="inherit" d="M84.567,256c0.018-23.348-18.922-42.279-42.279-42.279c-23.357-0.009-42.297,18.932-42.279,42.288c-0.018,23.348,18.904,42.279,42.279,42.279C65.645,298.288,84.567,279.358,84.567,256z" /><path fill="inherit" d="M469.712,213.712c-23.357,0-42.279,18.941-42.297,42.288c0,23.358,18.94,42.288,42.297,42.297c23.357,0,42.297-18.94,42.279-42.297C512.009,232.652,493.069,213.712,469.712,213.712z" /><path fill="inherit" d="M74.991,377.22c-16.519,16.511-16.519,43.296,0,59.806c16.503,16.52,43.27,16.52,59.789,0c16.52-16.519,16.52-43.295,0-59.815C118.278,360.692,91.511,360.692,74.991,377.22z" /><path fill="inherit" d="M437.026,134.798c16.52-16.52,16.52-43.304,0-59.824c-16.519-16.511-43.304-16.52-59.823,0c-16.52,16.52-16.503,43.295,0,59.815C393.722,151.309,420.507,151.309,437.026,134.798z" /></g></svg>}</div></>;
|
|
275
|
+
|
|
276
|
+
|
|
272
277
|
// return a array of options
|
|
273
278
|
let staticOptionsData: OptionConfig[] = optionsRes;
|
|
279
|
+
const hasDefaultOptions = staticOptionsData.length > 0;
|
|
274
280
|
|
|
275
281
|
//
|
|
276
282
|
const [orginalData, setOrginalData] = useState<OptionConfig[]>(staticOptionsData);
|
|
@@ -481,6 +487,8 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
481
487
|
//performance
|
|
482
488
|
const handleChangeFetchSafe = useDebounce((val: any) => {
|
|
483
489
|
|
|
490
|
+
setFetchLoading(true);
|
|
491
|
+
|
|
484
492
|
if (fetchUpdate) {
|
|
485
493
|
|
|
486
494
|
// update filter status
|
|
@@ -495,6 +503,8 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
495
503
|
popwinPosInit();
|
|
496
504
|
popwinFilterItems(val);
|
|
497
505
|
}, 0);
|
|
506
|
+
|
|
507
|
+
setFetchLoading(false);
|
|
498
508
|
});
|
|
499
509
|
} else {
|
|
500
510
|
|
|
@@ -504,13 +514,13 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
504
514
|
popwinFilterItems(val);
|
|
505
515
|
}, 0);
|
|
506
516
|
|
|
517
|
+
setFetchLoading(false);
|
|
518
|
+
|
|
507
519
|
}
|
|
508
520
|
|
|
509
521
|
|
|
510
522
|
}, 350, [optionsData]);
|
|
511
523
|
|
|
512
|
-
|
|
513
|
-
|
|
514
524
|
async function fetchData(params: any, valueToInputDefault: any, inputDefault: any, init: boolean = true) {
|
|
515
525
|
|
|
516
526
|
|
|
@@ -1152,12 +1162,10 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
1152
1162
|
setIsOpen(false);
|
|
1153
1163
|
if (!MULTI_SEL_VALID) popwinPosHide();
|
|
1154
1164
|
|
|
1155
|
-
|
|
1156
1165
|
if (MANUAL_REQ) {
|
|
1157
|
-
//
|
|
1158
|
-
setOptionsData(
|
|
1166
|
+
// restore to static data
|
|
1167
|
+
setOptionsData(staticOptionsData);
|
|
1159
1168
|
} else {
|
|
1160
|
-
// restore data
|
|
1161
1169
|
setOptionsData(orginalData);
|
|
1162
1170
|
}
|
|
1163
1171
|
|
|
@@ -1220,10 +1228,9 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
1220
1228
|
|
|
1221
1229
|
}
|
|
1222
1230
|
|
|
1223
|
-
|
|
1224
1231
|
if (MANUAL_REQ) {
|
|
1225
|
-
//
|
|
1226
|
-
setOptionsData(
|
|
1232
|
+
// display static data
|
|
1233
|
+
setOptionsData(staticOptionsData);
|
|
1227
1234
|
} else {
|
|
1228
1235
|
// restore data
|
|
1229
1236
|
setOptionsData(orginalData);
|
|
@@ -1237,7 +1244,8 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
1237
1244
|
|
|
1238
1245
|
|
|
1239
1246
|
// Every time the input changes or the search button is clicked, a data request will be triggered
|
|
1240
|
-
|
|
1247
|
+
// !!! If the default data is empty, the pop-up window is not displayed
|
|
1248
|
+
if (MANUAL_REQ && (controlTempValue === '' || controlTempValue === null) && !hasDefaultOptions) {
|
|
1241
1249
|
setTimeout(() => {
|
|
1242
1250
|
popwinPosHide();
|
|
1243
1251
|
}, 0);
|
|
@@ -1715,7 +1723,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
1715
1723
|
setControlTempValue(null);
|
|
1716
1724
|
|
|
1717
1725
|
// update filter status
|
|
1718
|
-
setFilterItemsHasNoMatchData(false);
|
|
1726
|
+
setFilterItemsHasNoMatchData(false);
|
|
1719
1727
|
|
|
1720
1728
|
}
|
|
1721
1729
|
|
|
@@ -1787,8 +1795,8 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
1787
1795
|
|
|
1788
1796
|
}
|
|
1789
1797
|
|
|
1790
|
-
|
|
1791
1798
|
async function handleFetch(inputVal: any = null) {
|
|
1799
|
+
setFetchLoading(true);
|
|
1792
1800
|
|
|
1793
1801
|
// data init
|
|
1794
1802
|
const searchStr: string = typeof inputVal === 'string' ? inputVal : (controlTempValue || controlTempValue === '' ? controlTempValue : '');
|
|
@@ -1798,6 +1806,7 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
1798
1806
|
|
|
1799
1807
|
const res = await fetchData((_params).join(','), '', '', false);
|
|
1800
1808
|
|
|
1809
|
+
setFetchLoading(false);
|
|
1801
1810
|
|
|
1802
1811
|
return res;
|
|
1803
1812
|
}
|
|
@@ -2801,161 +2810,169 @@ const Select = forwardRef((props: SelectProps, externalRef: any) => {
|
|
|
2801
2810
|
{/* /CLEAR BUTTON (Only Single selection) */}
|
|
2802
2811
|
|
|
2803
2812
|
|
|
2804
|
-
{/* NO MATCH & LOADER */}
|
|
2805
|
-
<button tabIndex={-1} type="button" className="list-group-item list-group-item-action no-match border-0 custom-select-multi__control-option-item--nomatch hide" disabled>
|
|
2806
|
-
{
|
|
2807
|
-
// (1) Handling async data with the click event
|
|
2808
|
-
(!FIRST_REQUEST_AUTO && !handleFirstFetchCompleted) ||
|
|
2809
|
-
|
|
2810
|
-
// (2) Every time the input changes or the search button is clicked, a data request will be triggered
|
|
2811
|
-
(fetchUpdate && !filterItemsHasNoMatchData && controlTempValue !== '')
|
|
2812
|
-
? <><div className="cus-select-loader">{loader || <svg height="12px" width="12px" viewBox="0 0 512 512"><g><path fill="inherit" d="M256,0c-23.357,0-42.297,18.932-42.297,42.288c0,23.358,18.94,42.288,42.297,42.288c23.357,0,42.279-18.93,42.279-42.288C298.279,18.932,279.357,0,256,0z" /><path fill="inherit" d="M256,427.424c-23.357,0-42.297,18.931-42.297,42.288C213.703,493.07,232.643,512,256,512c23.357,0,42.279-18.93,42.279-42.288C298.279,446.355,279.357,427.424,256,427.424z" /><path fill="inherit" d="M74.974,74.983c-16.52,16.511-16.52,43.286,0,59.806c16.52,16.52,43.287,16.52,59.806,0c16.52-16.511,16.52-43.286,0-59.806C118.261,58.463,91.494,58.463,74.974,74.983z" /><path fill="inherit" d="M377.203,377.211c-16.503,16.52-16.503,43.296,0,59.815c16.519,16.52,43.304,16.52,59.806,0c16.52-16.51,16.52-43.295,0-59.815C420.489,360.692,393.722,360.7,377.203,377.211z" /><path fill="inherit" d="M84.567,256c0.018-23.348-18.922-42.279-42.279-42.279c-23.357-0.009-42.297,18.932-42.279,42.288c-0.018,23.348,18.904,42.279,42.279,42.279C65.645,298.288,84.567,279.358,84.567,256z" /><path fill="inherit" d="M469.712,213.712c-23.357,0-42.279,18.941-42.297,42.288c0,23.358,18.94,42.288,42.297,42.297c23.357,0,42.297-18.94,42.279-42.297C512.009,232.652,493.069,213.712,469.712,213.712z" /><path fill="inherit" d="M74.991,377.22c-16.519,16.511-16.519,43.296,0,59.806c16.503,16.52,43.27,16.52,59.789,0c16.52-16.519,16.52-43.295,0-59.815C118.278,360.692,91.511,360.692,74.991,377.22z" /><path fill="inherit" d="M437.026,134.798c16.52-16.52,16.52-43.304,0-59.824c-16.519-16.511-43.304-16.52-59.823,0c-16.52,16.52-16.503,43.295,0,59.815C393.722,151.309,420.507,151.309,437.026,134.798z" /></g></svg>}</div></> : <>{fetchNoneInfo}</>}
|
|
2813
|
-
</button>
|
|
2814
|
-
{/* /NO MATCH & LOADER */}
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
2813
|
|
|
2818
2814
|
{/* OPTIONS LIST */}
|
|
2819
|
-
{
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
if (!MULTI_SEL_VALID) {
|
|
2832
|
-
const _defaultValue = controlValue.toString();
|
|
2833
|
-
let filterRes: any = [];
|
|
2834
|
-
const filterResQueryValue = optionsData.filter((item: any) => item.value == _defaultValue);
|
|
2835
|
-
const filterResQueryLabel = optionsData.filter((item: any) => item.label == _defaultValue);
|
|
2836
|
-
|
|
2837
|
-
if (filterResQueryValue.length === 0 && filterResQueryLabel.length > 0) {
|
|
2838
|
-
filterRes = filterResQueryValue;
|
|
2839
|
-
if (filterResQueryValue.length === 0) filterRes = filterResQueryLabel;
|
|
2840
|
-
}
|
|
2841
|
-
|
|
2842
|
-
const _targetValue = filterRes.length > 0 ? filterRes[0].value : _defaultValue;
|
|
2843
|
-
const _realValue = item.value.toString();
|
|
2844
|
-
|
|
2845
|
-
if (_realValue === _targetValue && _targetValue !== '') {
|
|
2846
|
-
disabledCurrentOption = true;
|
|
2847
|
-
}
|
|
2848
|
-
}
|
|
2849
|
-
|
|
2850
|
-
}
|
|
2815
|
+
{fetchLoading && MANUAL_REQ && hasDefaultOptions ? (
|
|
2816
|
+
// only loading
|
|
2817
|
+
<><button tabIndex={-1} type="button" className="list-group-item list-group-item-action no-match border-0 custom-select-multi__control-option-item--nomatch" disabled>{loadingOutput}</button></>
|
|
2818
|
+
) : (
|
|
2819
|
+
<>
|
|
2820
|
+
|
|
2821
|
+
{/* NO MATCH & LOADER */}
|
|
2822
|
+
<button tabIndex={-1} type="button" className="list-group-item list-group-item-action no-match border-0 custom-select-multi__control-option-item--nomatch hide" disabled>
|
|
2823
|
+
{
|
|
2824
|
+
// (1) Handling async data with the click event
|
|
2825
|
+
(!FIRST_REQUEST_AUTO && !handleFirstFetchCompleted) ||
|
|
2851
2826
|
|
|
2827
|
+
// (2) Every time the input changes or the search button is clicked, a data request will be triggered
|
|
2828
|
+
(fetchUpdate && !filterItemsHasNoMatchData && controlTempValue !== '')
|
|
2829
|
+
? <>{loadingOutput}</> : <>{fetchNoneInfo}</>}
|
|
2830
|
+
</button>
|
|
2831
|
+
{/* /NO MATCH & LOADER */}
|
|
2852
2832
|
|
|
2853
2833
|
|
|
2854
|
-
|
|
2834
|
+
{optionsData ? optionsData.map((item, index) => {
|
|
2835
|
+
const startItemBorder = index === 0 ? 'border-top-0' : '';
|
|
2836
|
+
const endItemBorder = index === optionsData.length - 1 ? 'border-bottom-0' : '';
|
|
2855
2837
|
|
|
2856
|
-
// ++++++++++++++++++++
|
|
2857
|
-
// Single selection
|
|
2858
|
-
// ++++++++++++++++++++
|
|
2859
|
-
return <button
|
|
2860
|
-
tabIndex={-1}
|
|
2861
|
-
type="button"
|
|
2862
|
-
data-index={index}
|
|
2863
|
-
key={index}
|
|
2864
|
-
className={combinedCls(
|
|
2865
|
-
'list-group-item list-group-item-action border-start-0 border-end-0 custom-select-multi__control-option-item border-bottom-0',
|
|
2866
|
-
startItemBorder,
|
|
2867
|
-
endItemBorder,
|
|
2868
|
-
{
|
|
2869
|
-
'disabled': item.disabled,
|
|
2870
|
-
'active disabled': disabledCurrentOption,
|
|
2871
|
-
'custom-select-grouptitle': item.group
|
|
2872
|
-
}
|
|
2873
2838
|
|
|
2874
|
-
)
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
role="tab"
|
|
2881
|
-
onClick={handleSelect}
|
|
2882
|
-
>
|
|
2883
|
-
{typeof renderOption === 'function' ? <>
|
|
2884
|
-
{renderOption(item, index)}
|
|
2885
|
-
</> : <>
|
|
2886
|
-
<span dangerouslySetInnerHTML={{
|
|
2887
|
-
__html: typeof item.listItemLabel === 'undefined' ? item.label : item.listItemLabel
|
|
2888
|
-
}}></span>
|
|
2889
|
-
</>}
|
|
2890
|
-
</button>
|
|
2839
|
+
// disable selected options (only single selection)
|
|
2840
|
+
let disabledCurrentOption: boolean = false;
|
|
2841
|
+
if (
|
|
2842
|
+
(typeof controlValue !== 'undefined' && controlValue !== null && controlValue !== '') &&
|
|
2843
|
+
(typeof item.value !== 'undefined' && item.value !== null && item.value !== '')
|
|
2844
|
+
) {
|
|
2891
2845
|
|
|
2892
|
-
|
|
2846
|
+
if (!MULTI_SEL_VALID) {
|
|
2847
|
+
const _defaultValue = controlValue.toString();
|
|
2848
|
+
let filterRes: any = [];
|
|
2849
|
+
const filterResQueryValue = optionsData.filter((item: any) => item.value == _defaultValue);
|
|
2850
|
+
const filterResQueryLabel = optionsData.filter((item: any) => item.label == _defaultValue);
|
|
2893
2851
|
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2852
|
+
if (filterResQueryValue.length === 0 && filterResQueryLabel.length > 0) {
|
|
2853
|
+
filterRes = filterResQueryValue;
|
|
2854
|
+
if (filterResQueryValue.length === 0) filterRes = filterResQueryLabel;
|
|
2855
|
+
}
|
|
2898
2856
|
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
type="button"
|
|
2902
|
-
data-selected={`${itemSelected ? 'true' : 'false'}`}
|
|
2903
|
-
data-index={index}
|
|
2904
|
-
key={index}
|
|
2905
|
-
className={combinedCls(
|
|
2906
|
-
'list-group-item list-group-item-action border-start-0 border-end-0 custom-select-multi__control-option-item border-bottom-0',
|
|
2907
|
-
startItemBorder,
|
|
2908
|
-
endItemBorder,
|
|
2909
|
-
{
|
|
2910
|
-
'list-group-item-secondary item-selected': itemSelected,
|
|
2911
|
-
'disabled': item.disabled,
|
|
2912
|
-
'custom-select-grouptitle': item.group
|
|
2857
|
+
const _targetValue = filterRes.length > 0 ? filterRes[0].value : _defaultValue;
|
|
2858
|
+
const _realValue = item.value.toString();
|
|
2913
2859
|
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
data-label={`${item.label}`}
|
|
2918
|
-
data-querystring={`${typeof item.queryString === 'undefined' ? '' : item.queryString}`}
|
|
2919
|
-
data-list-item-label={`${typeof item.listItemLabel === 'undefined' ? '' : item.listItemLabel}`}
|
|
2920
|
-
data-itemdata={JSON.stringify(item)}
|
|
2921
|
-
role="tab"
|
|
2922
|
-
onClick={handleSelect}
|
|
2923
|
-
>
|
|
2924
|
-
<var className={combinedCls(
|
|
2925
|
-
'me-1 custom-select-multi__control-option-checkbox-selected',
|
|
2926
|
-
{
|
|
2927
|
-
'd-none': !itemSelected
|
|
2860
|
+
if (_realValue === _targetValue && _targetValue !== '') {
|
|
2861
|
+
disabledCurrentOption = true;
|
|
2862
|
+
}
|
|
2928
2863
|
}
|
|
2929
2864
|
|
|
2930
|
-
|
|
2931
|
-
<svg width="1.2em" height="1.2em" fill="#000000" viewBox="0 0 24 24"><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" /></svg>
|
|
2865
|
+
}
|
|
2932
2866
|
|
|
2933
|
-
</var>
|
|
2934
|
-
|
|
2935
|
-
<var className={combinedCls(
|
|
2936
|
-
'me-1 custom-select-multi__control-option-checkbox-placeholder',
|
|
2937
|
-
{
|
|
2938
|
-
'd-none': itemSelected
|
|
2939
|
-
}
|
|
2940
|
-
)}>
|
|
2941
|
-
<svg width="1.2em" height="1.2em" fill="#000000" viewBox="0 0 24 24"><path d="M4 7.2002V16.8002C4 17.9203 4 18.4801 4.21799 18.9079C4.40973 19.2842 4.71547 19.5905 5.0918 19.7822C5.5192 20 6.07899 20 7.19691 20H16.8031C17.921 20 18.48 20 18.9074 19.7822C19.2837 19.5905 19.5905 19.2842 19.7822 18.9079C20 18.4805 20 17.9215 20 16.8036V7.19691C20 6.07899 20 5.5192 19.7822 5.0918C19.5905 4.71547 19.2837 4.40973 18.9074 4.21799C18.4796 4 17.9203 4 16.8002 4H7.2002C6.08009 4 5.51962 4 5.0918 4.21799C4.71547 4.40973 4.40973 4.71547 4.21799 5.0918C4 5.51962 4 6.08009 4 7.2002Z" /></svg>
|
|
2942
|
-
</var>
|
|
2943
|
-
|
|
2944
|
-
{typeof renderOption === 'function' ? <>
|
|
2945
|
-
{renderOption(item, index)}
|
|
2946
|
-
</> : <>
|
|
2947
|
-
<span dangerouslySetInnerHTML={{
|
|
2948
|
-
__html: typeof item.listItemLabel === 'undefined' ? item.label : item.listItemLabel
|
|
2949
|
-
}}></span>
|
|
2950
|
-
</>}
|
|
2951
2867
|
|
|
2952
2868
|
|
|
2953
|
-
|
|
2869
|
+
if (!MULTI_SEL_VALID) {
|
|
2870
|
+
|
|
2871
|
+
// ++++++++++++++++++++
|
|
2872
|
+
// Single selection
|
|
2873
|
+
// ++++++++++++++++++++
|
|
2874
|
+
return <button
|
|
2875
|
+
tabIndex={-1}
|
|
2876
|
+
type="button"
|
|
2877
|
+
data-index={index}
|
|
2878
|
+
key={index}
|
|
2879
|
+
className={combinedCls(
|
|
2880
|
+
'list-group-item list-group-item-action border-start-0 border-end-0 custom-select-multi__control-option-item border-bottom-0',
|
|
2881
|
+
startItemBorder,
|
|
2882
|
+
endItemBorder,
|
|
2883
|
+
{
|
|
2884
|
+
'disabled': item.disabled,
|
|
2885
|
+
'active disabled': disabledCurrentOption,
|
|
2886
|
+
'custom-select-grouptitle': item.group
|
|
2887
|
+
}
|
|
2888
|
+
|
|
2889
|
+
)}
|
|
2890
|
+
data-value={`${item.value}`}
|
|
2891
|
+
data-label={`${item.label}`}
|
|
2892
|
+
data-querystring={`${typeof item.queryString === 'undefined' ? '' : item.queryString}`}
|
|
2893
|
+
data-itemdata={JSON.stringify(item)}
|
|
2894
|
+
data-list-item-label={`${typeof item.listItemLabel === 'undefined' ? '' : item.listItemLabel}`}
|
|
2895
|
+
role="tab"
|
|
2896
|
+
onClick={handleSelect}
|
|
2897
|
+
>
|
|
2898
|
+
{typeof renderOption === 'function' ? <>
|
|
2899
|
+
{renderOption(item, index)}
|
|
2900
|
+
</> : <>
|
|
2901
|
+
<span dangerouslySetInnerHTML={{
|
|
2902
|
+
__html: typeof item.listItemLabel === 'undefined' ? item.label : item.listItemLabel
|
|
2903
|
+
}}></span>
|
|
2904
|
+
</>}
|
|
2905
|
+
</button>
|
|
2906
|
+
|
|
2907
|
+
} else {
|
|
2908
|
+
|
|
2909
|
+
// ++++++++++++++++++++
|
|
2910
|
+
// Multiple selection
|
|
2911
|
+
// ++++++++++++++++++++
|
|
2912
|
+
const itemSelected = multiSelControlOptionExist(controlArr.values, item.value) ? true : false;
|
|
2913
|
+
|
|
2914
|
+
return <button
|
|
2915
|
+
tabIndex={-1}
|
|
2916
|
+
type="button"
|
|
2917
|
+
data-selected={`${itemSelected ? 'true' : 'false'}`}
|
|
2918
|
+
data-index={index}
|
|
2919
|
+
key={index}
|
|
2920
|
+
className={combinedCls(
|
|
2921
|
+
'list-group-item list-group-item-action border-start-0 border-end-0 custom-select-multi__control-option-item border-bottom-0',
|
|
2922
|
+
startItemBorder,
|
|
2923
|
+
endItemBorder,
|
|
2924
|
+
{
|
|
2925
|
+
'list-group-item-secondary item-selected': itemSelected,
|
|
2926
|
+
'disabled': item.disabled,
|
|
2927
|
+
'custom-select-grouptitle': item.group
|
|
2928
|
+
|
|
2929
|
+
}
|
|
2930
|
+
)}
|
|
2931
|
+
data-value={`${item.value}`}
|
|
2932
|
+
data-label={`${item.label}`}
|
|
2933
|
+
data-querystring={`${typeof item.queryString === 'undefined' ? '' : item.queryString}`}
|
|
2934
|
+
data-list-item-label={`${typeof item.listItemLabel === 'undefined' ? '' : item.listItemLabel}`}
|
|
2935
|
+
data-itemdata={JSON.stringify(item)}
|
|
2936
|
+
role="tab"
|
|
2937
|
+
onClick={handleSelect}
|
|
2938
|
+
>
|
|
2939
|
+
<var className={combinedCls(
|
|
2940
|
+
'me-1 custom-select-multi__control-option-checkbox-selected',
|
|
2941
|
+
{
|
|
2942
|
+
'd-none': !itemSelected
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
)}>
|
|
2946
|
+
<svg width="1.2em" height="1.2em" fill="#000000" viewBox="0 0 24 24"><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" /></svg>
|
|
2947
|
+
|
|
2948
|
+
</var>
|
|
2949
|
+
|
|
2950
|
+
<var className={combinedCls(
|
|
2951
|
+
'me-1 custom-select-multi__control-option-checkbox-placeholder',
|
|
2952
|
+
{
|
|
2953
|
+
'd-none': itemSelected
|
|
2954
|
+
}
|
|
2955
|
+
)}>
|
|
2956
|
+
<svg width="1.2em" height="1.2em" fill="#000000" viewBox="0 0 24 24"><path d="M4 7.2002V16.8002C4 17.9203 4 18.4801 4.21799 18.9079C4.40973 19.2842 4.71547 19.5905 5.0918 19.7822C5.5192 20 6.07899 20 7.19691 20H16.8031C17.921 20 18.48 20 18.9074 19.7822C19.2837 19.5905 19.5905 19.2842 19.7822 18.9079C20 18.4805 20 17.9215 20 16.8036V7.19691C20 6.07899 20 5.5192 19.7822 5.0918C19.5905 4.71547 19.2837 4.40973 18.9074 4.21799C18.4796 4 17.9203 4 16.8002 4H7.2002C6.08009 4 5.51962 4 5.0918 4.21799C4.71547 4.40973 4.40973 4.71547 4.21799 5.0918C4 5.51962 4 6.08009 4 7.2002Z" /></svg>
|
|
2957
|
+
</var>
|
|
2958
|
+
|
|
2959
|
+
{typeof renderOption === 'function' ? <>
|
|
2960
|
+
{renderOption(item, index)}
|
|
2961
|
+
</> : <>
|
|
2962
|
+
<span dangerouslySetInnerHTML={{
|
|
2963
|
+
__html: typeof item.listItemLabel === 'undefined' ? item.label : item.listItemLabel
|
|
2964
|
+
}}></span>
|
|
2965
|
+
</>}
|
|
2966
|
+
|
|
2967
|
+
|
|
2968
|
+
</button>
|
|
2954
2969
|
|
|
2955
|
-
|
|
2970
|
+
}
|
|
2956
2971
|
|
|
2957
2972
|
|
|
2958
|
-
|
|
2973
|
+
}) : null}
|
|
2974
|
+
</>
|
|
2975
|
+
)}
|
|
2959
2976
|
{/* /OPTIONS LIST */}
|
|
2960
2977
|
|
|
2961
2978
|
</div>
|