@true-engineering/true-react-common-ui-kit 3.4.0 → 3.6.0

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 CHANGED
@@ -10,6 +10,16 @@
10
10
 
11
11
  # Release Notes
12
12
 
13
+ ## v3.6.0
14
+
15
+ - **Select**: Добавлена возможность передавать `defaultOptionLabel` как `ReactNode`
16
+
17
+ ## v3.5.0
18
+
19
+ ### Fixed
20
+
21
+ - Исправлена ошибка порядка вызова хуков при добавлении/удалении `tweakStyles` во время жизни компонента
22
+
13
23
  ## v3.4.0
14
24
 
15
25
  - **Input**: Добавляет пропс onInput
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ICommonProps } from '../../types';
2
3
  import { IFiltersPaneSearchProps } from './components';
3
4
  import { ConfigType, IFilterLocaleKey, IPartialFilterLocale } from './types';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ComponentStory } from '@storybook/react';
2
3
  import { IFiltersPaneProps } from './FiltersPane';
3
4
  interface IFiltersPaneWithCustomProps<Values, Content> extends IFiltersPaneProps<Values, Content> {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { IMultiSelectListProps } from '../../../MultiSelectList';
2
3
  import { IFilterMultiSelectValues } from '../../types';
3
4
  export type IFilterMultiSelectProps<Value, Option = string> = IMultiSelectListProps<Value, Option>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ICommonProps } from '../../../../types';
2
3
  import type { IFilterWrapperProps } from '../FilterWrapper';
3
4
  import { IFilterValueViewStyles } from './FilterValueView.styles';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ComponentStory } from '@storybook/react';
2
3
  import { FlexibleTable } from './FlexibleTable';
3
4
  declare const _default: {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ICommonProps } from '../../types';
2
3
  import { IMultiSelectListValues, IMultiSelectLocale, IMultiSelectLocaleKey } from '../MultiSelectList';
3
4
  import { IHorizontalCornerConnection } from './types';
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { type ComponentMeta, type ComponentStory } from '@storybook/react';
3
+ import { type ISelectProps } from './Select';
4
+ interface ISelectWithCustomProps<T> extends ISelectProps<T> {
5
+ shouldUsePopper?: boolean;
6
+ shouldRenderInBody?: boolean;
7
+ shouldHideOnScroll?: boolean;
8
+ canBeFlipped?: boolean;
9
+ scrollParent?: 'document' | 'auto';
10
+ }
11
+ declare function SelectWithCustomProps({ noMatchesLabel, shouldUsePopper, shouldRenderInBody, shouldHideOnScroll, canBeFlipped, scrollParent, ...restProps }: ISelectWithCustomProps<string>): JSX.Element;
12
+ declare const _default: ComponentMeta<typeof SelectWithCustomProps>;
13
+ export default _default;
14
+ export declare const CustomSelect: ComponentStory<typeof SelectWithCustomProps>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ComponentMeta, ComponentStory } from '@storybook/react';
2
3
  import { ISelectProps } from './Select';
3
4
  interface ISelectWithCustomProps<T> extends ISelectProps<T> {
@@ -6,7 +6,7 @@ import { ISearchInputProps } from '../SearchInput';
6
6
  import { IMultipleSelectValue } from './types';
7
7
  import { ISelectStyles } from './Select.styles';
8
8
  export interface ISelectProps<Value> extends Omit<IInputProps, 'value' | 'onChange' | 'onBlur' | 'type' | 'tweakStyles'>, ICommonProps<ISelectStyles> {
9
- defaultOptionLabel?: string;
9
+ defaultOptionLabel?: ReactNode;
10
10
  allOptionsLabel?: string;
11
11
  noMatchesLabel?: string;
12
12
  loadingLabel?: ReactNode;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ComponentMeta, ComponentStory } from '@storybook/react';
2
3
  import { ISelectProps } from './Select';
3
4
  interface ISelectWithCustomProps<T> extends ISelectProps<T> {
@@ -8,7 +8,7 @@ export interface ISelectListProps<Value> extends ICommonProps<ISelectListStyles>
8
8
  noMatchesLabel?: string;
9
9
  isLoading?: boolean;
10
10
  loadingLabel?: ReactNode;
11
- defaultOptionLabel?: string;
11
+ defaultOptionLabel?: ReactNode;
12
12
  allOptionsLabel?: string;
13
13
  areAllOptionsSelected?: boolean;
14
14
  shouldScrollToList?: boolean;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ICommonProps } from '../../types';
2
3
  import { ISelectorOption, ISelectorValue } from './types';
3
4
  import { ISelectorStyles } from './Selector.styles';
@@ -1921,13 +1921,14 @@ function _object_spread_props$L(target, source) {
1921
1921
  }
1922
1922
  return target;
1923
1923
  }
1924
+ var EMPTY_STYLES = {};
1924
1925
  var isTweakStyle = function(key) {
1925
1926
  return key.startsWith("tweak");
1926
1927
  };
1927
1928
  var cleanStyles = function(tweakStyles) {
1928
1929
  return isNotEmpty(tweakStyles) && Object.keys(tweakStyles).some(function(key) {
1929
1930
  return !isTweakStyle(key);
1930
- }) ? tweakStyles : void 0;
1931
+ }) ? tweakStyles : EMPTY_STYLES;
1931
1932
  };
1932
1933
  var checkStyles = function(componentName, styles) {
1933
1934
  var invalidClasses = Object.keys(styles).reduce(function(acc, key) {
@@ -10961,7 +10962,7 @@ function SelectList(param) {
10961
10962
  children: loadingLabel
10962
10963
  }) : /* @__PURE__ */ jsxs(Fragment, {
10963
10964
  children: [
10964
- isStringNotEmpty(defaultOptionLabel) && /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, {
10965
+ isReactNodeNotEmpty(defaultOptionLabel) && /* @__PURE__ */ jsx(ScrollIntoViewIfNeeded, {
10965
10966
  active: focusedIndex === DEFAULT_OPTION_INDEX,
10966
10967
  options: {
10967
10968
  block: "nearest"
@@ -11480,7 +11481,7 @@ function Select(props) {
11480
11481
  var isMounted = useIsMounted();
11481
11482
  var _useState = _sliced_to_array$k(useState(false), 2), isListOpen = _useState[0], setIsListOpen = _useState[1];
11482
11483
  var _useState1 = _sliced_to_array$k(useState(false), 2), areOptionsLoading = _useState1[0], setAreOptionsLoading = _useState1[1];
11483
- var hasDefaultOption = isStringNotEmpty(defaultOptionLabel);
11484
+ var hasDefaultOption = isReactNodeNotEmpty(defaultOptionLabel);
11484
11485
  var _useState2 = _sliced_to_array$k(useState(DEFAULT_OPTION_INDEX), 2), focusedListCellIndex = _useState2[0], setFocusedListCellIndex = _useState2[1];
11485
11486
  var _useState3 = _sliced_to_array$k(useState(""), 2), searchValue = _useState3[0], setSearchValue = _useState3[1];
11486
11487
  var _useState4 = _sliced_to_array$k(useState(true), 2), shouldShowDefaultOption = _useState4[0], setShouldShowDefaultOption = _useState4[1];