@true-engineering/true-react-common-ui-kit 3.15.0 → 3.15.1
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/README.md +6 -0
- package/dist/true-react-common-ui-kit.js +4 -4
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +4 -4
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/MultiSelectList/MultiSelectList.tsx +6 -9
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState, useMemo, useRef, useCallback, ReactNode } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { debounce } from 'ts-debounce';
|
|
4
|
-
import { isNotEmpty } from '@true-engineering/true-react-platform-helpers';
|
|
4
|
+
import { isArrayNotEmpty, isNotEmpty } from '@true-engineering/true-react-platform-helpers';
|
|
5
5
|
import { addDataAttributes } from '../../helpers';
|
|
6
6
|
import { useIsMounted, useTweakStyles } from '../../hooks';
|
|
7
7
|
import { ICommonProps } from '../../types';
|
|
@@ -317,20 +317,17 @@ export function MultiSelectList<Value extends IMultiSelectListValues<Option>, Op
|
|
|
317
317
|
|
|
318
318
|
const mainOptionsList = isGroupingEnabled ? unchosenOptions : allOptions;
|
|
319
319
|
|
|
320
|
-
const hasSelectedOptionsGroup =
|
|
321
|
-
isGroupingEnabled && chosenValues !== undefined && chosenValues.length > 0;
|
|
320
|
+
const hasSelectedOptionsGroup = isGroupingEnabled && isArrayNotEmpty(chosenValues);
|
|
322
321
|
|
|
323
|
-
const shouldShowNothingFoundMessage = !isLoading && allOptions
|
|
322
|
+
const shouldShowNothingFoundMessage = !isLoading && !isArrayNotEmpty(allOptions);
|
|
324
323
|
|
|
325
324
|
const shouldShowAllOptionsLabel =
|
|
326
|
-
|
|
327
|
-
unchosenOptions.length > 0 &&
|
|
328
|
-
chosenValues !== undefined &&
|
|
329
|
-
chosenValues.length > 0;
|
|
325
|
+
hasSelectedOptionsGroup && (isArrayNotEmpty(unchosenOptions) || !isArrayNotEmpty(allOptions));
|
|
330
326
|
|
|
331
327
|
const shouldShowPreloader = isLoading || isLoadingOptionsOnScroll;
|
|
332
328
|
|
|
333
|
-
const shouldShowOptionsList =
|
|
329
|
+
const shouldShowOptionsList =
|
|
330
|
+
!isLoading && (isArrayNotEmpty(allOptions) || isArrayNotEmpty(chosenValues));
|
|
334
331
|
|
|
335
332
|
return (
|
|
336
333
|
<div className={classes.root} {...addDataAttributes(data)}>
|