@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@true-engineering/true-react-common-ui-kit",
3
- "version": "3.15.0",
3
+ "version": "3.15.1",
4
4
  "description": "True Engineering React UI Kit with theming support",
5
5
  "author": "True Engineering (https://trueengineering.ru)",
6
6
  "keywords": [
@@ -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.length === 0;
322
+ const shouldShowNothingFoundMessage = !isLoading && !isArrayNotEmpty(allOptions);
324
323
 
325
324
  const shouldShowAllOptionsLabel =
326
- isGroupingEnabled &&
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 = !isLoading && allOptions.length !== 0;
329
+ const shouldShowOptionsList =
330
+ !isLoading && (isArrayNotEmpty(allOptions) || isArrayNotEmpty(chosenValues));
334
331
 
335
332
  return (
336
333
  <div className={classes.root} {...addDataAttributes(data)}>