@true-engineering/true-react-common-ui-kit 1.6.0 → 1.7.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.
@@ -5,14 +5,14 @@ export declare type IPosition = 'sticky' | 'absolute' | 'relative' | 'static';
5
5
  export declare type ITitleComponent<Value> = FC<{
6
6
  value?: Value;
7
7
  }>;
8
- export declare type IValueComponent<Values, Value> = FC<{
8
+ export declare type IValueComponent<Values, Value> = (props: {
9
9
  value: Value;
10
10
  row: Values;
11
11
  isFocusedRow?: boolean;
12
12
  isNestedComponentExpanded: boolean;
13
13
  isRowNestedComponentExpanded: boolean;
14
14
  onSetNestedComponent: (component?: ReactNode) => void;
15
- }>;
15
+ }) => JSX.Element | null;
16
16
  export declare type FlexibleTableConfigType<Values> = {
17
17
  [Key in keyof Values]?: {
18
18
  title?: ReactNode;
@@ -7974,7 +7974,7 @@ function Select(_param) {
7974
7974
  value: searchValue !== "" && !shouldRenderSearchInputInList ? searchValue : stringValue,
7975
7975
  onChange: handleInputChange,
7976
7976
  isActive: isListOpen,
7977
- isReadonly: optionsMode === "normal" || shouldRenderSearchInputInList,
7977
+ isReadonly: isReadonly !== null && isReadonly !== void 0 ? isReadonly : optionsMode === "normal" || shouldRenderSearchInputInList,
7978
7978
  onFocus: handleFocus,
7979
7979
  onBlur: handleBlur,
7980
7980
  isDisabled,
@@ -7964,7 +7964,7 @@
7964
7964
  value: searchValue !== "" && !shouldRenderSearchInputInList ? searchValue : stringValue,
7965
7965
  onChange: handleInputChange,
7966
7966
  isActive: isListOpen,
7967
- isReadonly: optionsMode === "normal" || shouldRenderSearchInputInList,
7967
+ isReadonly: isReadonly !== null && isReadonly !== void 0 ? isReadonly : optionsMode === "normal" || shouldRenderSearchInputInList,
7968
7968
  onFocus: handleFocus,
7969
7969
  onBlur: handleBlur,
7970
7970
  isDisabled,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@true-engineering/true-react-common-ui-kit",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "True Engineering React UI Kit with theming support",
5
5
  "author": "True Engineering (https://trueengineering.ru)",
6
6
  "keywords": [
@@ -1,4 +1,5 @@
1
1
  import { ComponentStory } from '@storybook/react';
2
+ import { FC } from 'react';
2
3
  import { FlexibleTable } from './FlexibleTable';
3
4
  import { FlexibleTableConfigType } from './types';
4
5
  import content from './fixture-test';
@@ -21,11 +22,15 @@ interface ITableContent {
21
22
  status: string;
22
23
  }
23
24
 
25
+ const Temp: FC<{ value: string | undefined }> = ({ value }) => <>{value}</>;
26
+ const Temp1: FC<{ value: string }> = ({ value }) => <>{value}</>;
27
+
24
28
  const config: FlexibleTableConfigType<ITableContent> = {
25
29
  contractCode: {
26
30
  title: 'Contract Code',
27
31
  },
28
32
  title: {
33
+ component: Temp,
29
34
  title: 'Title',
30
35
  minWidth: 320,
31
36
  },
@@ -39,6 +44,7 @@ const config: FlexibleTableConfigType<ITableContent> = {
39
44
  title: 'Sign Date',
40
45
  },
41
46
  partner: {
47
+ component: Temp1,
42
48
  title: 'Partner',
43
49
  },
44
50
  };
@@ -16,14 +16,14 @@ export type ITitleComponent<Value> = FC<{
16
16
  value?: Value;
17
17
  }>;
18
18
 
19
- export type IValueComponent<Values, Value> = FC<{
19
+ export type IValueComponent<Values, Value> = (props: {
20
20
  value: Value;
21
21
  row: Values;
22
22
  isFocusedRow?: boolean;
23
23
  isNestedComponentExpanded: boolean;
24
24
  isRowNestedComponentExpanded: boolean;
25
25
  onSetNestedComponent: (component?: ReactNode) => void;
26
- }>;
26
+ }) => JSX.Element | null;
27
27
 
28
28
  export type FlexibleTableConfigType<Values> = {
29
29
  [Key in keyof Values]?: {
@@ -480,7 +480,10 @@ export function Select<Value>({
480
480
  }
481
481
  onChange={handleInputChange}
482
482
  isActive={isListOpen}
483
- isReadonly={optionsMode === 'normal' || shouldRenderSearchInputInList}
483
+ isReadonly={
484
+ isReadonly ??
485
+ (optionsMode === 'normal' || shouldRenderSearchInputInList)
486
+ }
484
487
  onFocus={handleFocus}
485
488
  onBlur={handleBlur}
486
489
  isDisabled={isDisabled}