@true-engineering/true-react-common-ui-kit 3.0.0-alpha.0 → 3.0.0-alpha.2

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.
@@ -1,13 +1,13 @@
1
1
  import { ReactNode, RefObject } from 'react';
2
2
  import { ICommonProps } from '../../types';
3
- import { FlexibleTableConfigType, IInfinityScrollConfig } from './types';
3
+ import { IFlexibleTableConfigType, IInfinityScrollConfig } from './types';
4
4
  import { IFlexibleTableStyles } from './FlexibleTable.styles';
5
5
  export interface IFlexibleTableProps<Values extends Record<string, any>> extends ICommonProps<IFlexibleTableStyles> {
6
6
  content: Values[];
7
7
  headerContent?: Partial<Record<keyof Values, any>>;
8
8
  enabledColumns?: Array<keyof Values>;
9
9
  activeRows?: number[];
10
- config?: FlexibleTableConfigType<Values>;
10
+ config?: IFlexibleTableConfigType<Values>;
11
11
  isHorizontallyScrollable?: boolean;
12
12
  isFirstColumnSticky?: boolean;
13
13
  infinityScrollConfig?: IInfinityScrollConfig;
@@ -1,11 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
  import type { ICommonProps } from '../../../../types';
3
- import type { FlexibleTableConfigType } from '../../types';
3
+ import type { IFlexibleTableConfigType } from '../../types';
4
4
  import { IFlexibleTableCellStyles } from './FlexibleTableCell.styles';
5
5
  export interface IFlexibleTableCellProps<Values extends Record<string, any>> extends Pick<ICommonProps<IFlexibleTableCellStyles>, 'tweakStyles'> {
6
6
  item: Values;
7
7
  columnName: keyof Values;
8
- config?: FlexibleTableConfigType<Values>;
8
+ config?: IFlexibleTableConfigType<Values>;
9
9
  isFocusedRow?: boolean;
10
10
  isSecond?: boolean;
11
11
  isSticky?: boolean;
@@ -1,13 +1,13 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ICommonProps } from '../../../../types';
3
- import { FlexibleTableConfigType } from '../../types';
3
+ import { IFlexibleTableConfigType } from '../../types';
4
4
  import { IFlexibleTableRowStyles } from './FlexibleTableRow.styles';
5
5
  export interface IFlexibleTableRowProps<Values extends Record<string, any>> extends Pick<ICommonProps<IFlexibleTableRowStyles>, 'tweakStyles'> {
6
6
  item: Values;
7
7
  uniqueField?: keyof Values;
8
8
  isFirstColumnSticky?: boolean;
9
9
  isActive: boolean;
10
- config?: FlexibleTableConfigType<Values>;
10
+ config?: IFlexibleTableConfigType<Values>;
11
11
  enabledColumns?: Array<keyof Values>;
12
12
  rowAttributes?: Array<keyof Values>;
13
13
  expandableRowComponent?(item: Values, isOpen: boolean, close: () => void): ReactNode;
@@ -13,7 +13,7 @@ export declare type IValueComponent<Values, Value> = (props: {
13
13
  isRowNestedComponentExpanded: boolean;
14
14
  onSetNestedComponent: (component?: ReactNode) => void;
15
15
  }) => JSX.Element | ReactNode;
16
- export declare type FlexibleTableConfigType<Values> = {
16
+ export declare type IFlexibleTableConfigType<Values> = {
17
17
  [Key in keyof Values]?: {
18
18
  title?: ReactNode;
19
19
  titleComponent?: ITitleComponent<unknown>;
@@ -3,3 +3,4 @@ export * from './use-on-click-outside';
3
3
  export * from './use-dropdown';
4
4
  export * from './use-tweak-styles';
5
5
  export * from './use-did-mount-effect';
6
+ export * from './use-mixed-styles';
@@ -0,0 +1 @@
1
+ export declare const useMixedStyles: <StyleSheet_1>(baseStyles?: StyleSheet_1 | undefined, tweakStyles?: StyleSheet_1 | undefined) => StyleSheet_1 | undefined;
@@ -4098,6 +4098,14 @@ var useDidMountEffect = function(effect3, dependencies) {
4098
4098
  };
4099
4099
  }, dependencies);
4100
4100
  };
4101
+ var useMixedStyles = function(baseStyles, tweakStyles) {
4102
+ return useMemo(function() {
4103
+ return isNotEmpty(baseStyles) && isNotEmpty(tweakStyles) ? mergeStyles(baseStyles, tweakStyles) : baseStyles !== null && baseStyles !== void 0 ? baseStyles : tweakStyles;
4104
+ }, [
4105
+ baseStyles,
4106
+ tweakStyles
4107
+ ]);
4108
+ };
4101
4109
  const avatarGreen = ` <svg\r
4102
4110
  width="100%"\r
4103
4111
  height="100%"\r
@@ -6197,6 +6205,7 @@ var useStyles$D = createThemedStyles("Checkbox", {
6197
6205
  root: {
6198
6206
  cursor: "pointer",
6199
6207
  display: "flex",
6208
+ alignItems: "center",
6200
6209
  gap: 14,
6201
6210
  width: "fit-content"
6202
6211
  },
@@ -8271,13 +8280,15 @@ var baseInputStyles = {
8271
8280
  }
8272
8281
  };
8273
8282
  var readonlyInputBaseStyles = {
8274
- inputIcon: {
8275
- width: "auto"
8283
+ input: {
8284
+ cursor: "pointer"
8276
8285
  }
8277
8286
  };
8278
8287
  var multiSelectInputBaseStyles = {
8279
8288
  inputIcon: {
8280
- width: "auto"
8289
+ "&:not($loading)": {
8290
+ width: "auto"
8291
+ }
8281
8292
  }
8282
8293
  };
8283
8294
  var readonlyInputStyles = mergeStyles(baseInputStyles, readonlyInputBaseStyles);
@@ -28654,6 +28665,7 @@ export {
28654
28665
  useDidMountEffect,
28655
28666
  useDropdown,
28656
28667
  useIsMounted,
28668
+ useMixedStyles,
28657
28669
  useOnClickOutside,
28658
28670
  useOnClickOutsideWithRef,
28659
28671
  useTweakStyles