@true-engineering/true-react-common-ui-kit 1.1.0 → 1.3.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
@@ -2,6 +2,12 @@
2
2
 
3
3
  Модульный UI Kit на React с поддержкой темизации.
4
4
 
5
+ # Публикация
6
+
7
+ 1. Слить Pull Request с увеличением версии пакета в файле `package.json` в ветке `master`
8
+ 2. `yarn build` локально из ветки `master`
9
+ 3. `npm publish` локально из ветки `master`
10
+
5
11
  # Release Notes
6
12
 
7
13
  ## v0.4.0
@@ -6,7 +6,7 @@ export declare type ITitleComponent<Value> = FC<{
6
6
  value?: Value;
7
7
  }>;
8
8
  export declare type IValueComponent<Values, Value> = FC<{
9
- value?: Value;
9
+ value: Value;
10
10
  row: Values;
11
11
  isFocusedRow?: boolean;
12
12
  isNestedComponentExpanded: boolean;
@@ -16,7 +16,7 @@ export declare type IValueComponent<Values, Value> = FC<{
16
16
  export declare type FlexibleTableConfigType<Values> = {
17
17
  [Key in keyof Values]?: {
18
18
  title?: ReactNode;
19
- titleComponent?: ITitleComponent<any>;
19
+ titleComponent?: ITitleComponent<unknown>;
20
20
  component?: IValueComponent<Values, Values[Key]>;
21
21
  dateFormat?: string;
22
22
  minWidth?: string | number;
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { IInputProps } from '../Input';
3
3
  import { IIconType } from '../Icon';
4
4
  import { IDropdownWithPopperOptions } from '../../types';
@@ -7,22 +7,23 @@ export interface ISelectProps<Value> extends Omit<IInputProps, 'value' | 'onChan
7
7
  tweakStyles?: SelectStyles;
8
8
  defaultOptionLabel?: string;
9
9
  noMatchesLabel?: string;
10
- loadingLabel?: React.ReactNode;
10
+ loadingLabel?: ReactNode;
11
11
  optionsMode?: 'search' | 'dynamic' | 'normal';
12
- onType?: (value: string) => Promise<void>;
13
12
  debounceTime?: number;
14
13
  minSymbolsCountToOpenList?: number;
15
14
  dropdownOptions?: IDropdownWithPopperOptions;
16
15
  dropdownIcon?: IIconType;
17
- onOpen?: () => void;
18
- optionsFilter?: (options: Value[], query: string) => Value[];
19
16
  options: Value[];
20
17
  value: Value | undefined;
21
18
  shouldScrollToList?: boolean;
19
+ isOptionDisabled?(option: Value): boolean;
22
20
  onChange(value: Value | undefined): void;
21
+ onType?(value: string): Promise<void>;
22
+ optionsFilter?(options: Value[], query: string): Value[];
23
+ onOpen?(): void;
23
24
  compareValuesOnChange?(v1: Value | undefined, v2: Value | undefined): boolean;
24
25
  convertValueToString?(value: Value): string | undefined;
25
- convertValueToReactNode?(value: Value): ReactNode;
26
+ convertValueToReactNode?(value: Value, isDisabled: boolean): ReactNode;
26
27
  convertValueToId?(value: Value): string | undefined;
27
28
  }
28
- export declare function Select<Value>({ options, value, onChange, compareValuesOnChange, convertValueToString, convertValueToId, convertValueToReactNode, defaultOptionLabel, onFocus, onBlur, onType, onOpen, debounceTime, optionsMode, optionsFilter, noMatchesLabel, loadingLabel, tweakStyles, testId, isDisabled, dropdownOptions, minSymbolsCountToOpenList, dropdownIcon, shouldScrollToList, ...inputProps }: ISelectProps<Value>): JSX.Element;
29
+ export declare function Select<Value>({ options, value, defaultOptionLabel, debounceTime, optionsMode, noMatchesLabel, loadingLabel, tweakStyles, testId, isDisabled, dropdownOptions, minSymbolsCountToOpenList, dropdownIcon, shouldScrollToList, onChange, onFocus, onBlur, onType, onOpen, isOptionDisabled, compareValuesOnChange, convertValueToString, convertValueToId, convertValueToReactNode, optionsFilter, ...inputProps }: ISelectProps<Value>): JSX.Element;
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { ICommonProps } from '../../../types';
3
3
  import { SelectListStyles } from './SelectList.styles';
4
4
  export interface ISelectListProps<Value> extends ICommonProps {
@@ -8,14 +8,14 @@ export interface ISelectListProps<Value> extends ICommonProps {
8
8
  activeValue?: Value;
9
9
  noMatchesLabel?: string;
10
10
  isLoading?: boolean;
11
- loadingLabel?: React.ReactNode;
11
+ loadingLabel?: ReactNode;
12
12
  defaultOptionLabel?: string;
13
- onOptionClick: (index: number) => void;
14
13
  testId?: string;
15
14
  shouldScrollToList?: boolean;
16
- convertValueToString: (value: Value) => string | undefined;
17
- convertValueToReactNode?: (value: Value) => ReactNode;
18
- convertValueToId?: (value: Value) => string | undefined;
15
+ onOptionClick(index: number): void;
16
+ isOptionDisabled(value: Value): boolean;
17
+ convertValueToString(value: Value): string | undefined;
18
+ convertValueToReactNode?(value: Value, isDisabled: boolean): ReactNode;
19
+ convertValueToId?(value: Value): string | undefined;
19
20
  }
20
- export declare function isOptionDisabled<Value>(option: Value): boolean;
21
- export declare function SelectList<Value>({ options, onOptionClick, focusedIndex, activeValue, defaultOptionLabel, noMatchesLabel, isLoading, loadingLabel, convertValueToString, convertValueToReactNode, convertValueToId, tweakStyles, testId, shouldScrollToList, }: ISelectListProps<Value>): JSX.Element;
21
+ export declare function SelectList<Value>({ options, focusedIndex, activeValue, defaultOptionLabel, noMatchesLabel, isLoading, loadingLabel, tweakStyles, testId, shouldScrollToList, isOptionDisabled, onOptionClick, convertValueToString, convertValueToReactNode, convertValueToId, }: ISelectListProps<Value>): JSX.Element;
@@ -1,3 +1,4 @@
1
+ export declare const defaultIsOptionDisabled: <Value>(option: Value) => boolean;
1
2
  export declare const defaultConvertFunction: (v: unknown) => string | undefined;
2
3
  export declare const defaultCompareFunction: <Value>(v1: Value, v2: Value) => boolean;
3
4
  export declare const getActiveValueIndex: <Value>(options: Value[], value: Value | undefined, convertFunc: (v: Value) => string | undefined) => number;