@true-engineering/true-react-common-ui-kit 3.33.0 → 3.33.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.
package/README.md CHANGED
@@ -11,13 +11,25 @@
11
11
 
12
12
  # Release Notes
13
13
 
14
+ ## 3.33.2
15
+
16
+ ### Changes
17
+
18
+ - **FlexibleTableCell**: Кастомизирована проверка необходимости отрисовки
19
+
20
+ ## 3.33.1
21
+
22
+ ### Changes
23
+
24
+ - **FlexibleTable**: Поведение пропсы `position` стало таким же как `isFirstColumnSticky`
25
+
14
26
  ## 3.33.0
15
27
 
16
28
  ### Changes
17
29
 
18
- - **WithPopup**: Пропсы триггера разделены на referenceProps (для тегов) и triggerProps (для компонентов)
19
- - **WithPopup**: Для isActive триггера добавлен класс active
20
- - **WithPopup**: Для flip добавлен fallbackAxisSideDirection
30
+ - **WithPopup**: Пропсы триггера разделены на `referenceProps` (для тегов) и `triggerProps` (для компонентов)
31
+ - **WithPopup**: Для `isActive` триггера добавлен класс `active`
32
+ - **WithPopup**: Для `flip` добавлен `fallbackAxisSideDirection`
21
33
  - **ICommonProps**: Разделены на составляющие (чтоб не пикать/омитить)
22
34
 
23
35
  ## 3.32.0
@@ -4,6 +4,8 @@ interface ITableContent {
4
4
  contractCode: string;
5
5
  validFrom: Date;
6
6
  validTo: Date;
7
+ validTo1?: Date;
8
+ validTo2?: Date;
7
9
  title: string;
8
10
  signDate: Date;
9
11
  partner: string;
@@ -11,5 +13,7 @@ interface ITableContent {
11
13
  parentContract: string;
12
14
  currency: string;
13
15
  status: string;
16
+ note?: string;
17
+ publicNote?: string;
14
18
  }
15
19
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, import("./FlexibleTable").IFlexibleTableProps<ITableContent, Partial<Record<keyof ITableContent, unknown>>, keyof ITableContent>>;
@@ -11,4 +11,4 @@ export interface IFlexibleTableCellProps<Row extends ITableRow, HeaderContent ex
11
11
  isSticky?: boolean;
12
12
  isLoading?: boolean;
13
13
  }
14
- export declare function FlexibleTableCell<Row extends ITableRow, HeaderContent extends IHeaderContent<Row>>({ row, columnName, config, renderMode, isSecond, isSticky, isLoading, tweakStyles, ...valueComponentProps }: IFlexibleTableCellProps<Row, HeaderContent>): JSX.Element;
14
+ export declare function FlexibleTableCell<Row extends ITableRow, HeaderContent extends IHeaderContent<Row>>({ row, columnName, config, renderMode, isSecond, isSticky: isOldSticky, isLoading, tweakStyles, ...valueComponentProps }: IFlexibleTableCellProps<Row, HeaderContent>): JSX.Element;
@@ -11,7 +11,8 @@ export interface IFlexibleTableRowProps<Row extends ITableRow, HeaderContent ext
11
11
  isActive?: boolean;
12
12
  /** @default false */
13
13
  isFocusable?: boolean;
14
- /** @default false */
14
+ /** @deprecated Use {@position}
15
+ * @default false */
15
16
  isFirstColumnSticky?: boolean;
16
17
  /** @default false */
17
18
  isLoading?: boolean;
@@ -31,6 +31,12 @@ export interface IFlexibleTableRowConfig<Values extends ITableRow, Key extends k
31
31
  right?: number;
32
32
  left?: number;
33
33
  shouldRenderDataId?: boolean;
34
+ /**
35
+ * Проверка, нужно ли отрисовать component
36
+ * @description **Не влияет на типизацию `component`, лучше использовать `row`**
37
+ * @default isNotEmpty
38
+ */
39
+ shouldRenderComponent?: boolean | ((value: Values[Key], values: Values, key: Key) => boolean);
34
40
  }
35
41
  export type IFlexibleTableConfigType<Values extends ITableRow, HeaderContent extends IHeaderContent<Values> = IHeaderContent<Values>> = {
36
42
  [Key in keyof Values]?: IFlexibleTableRowConfig<Values, Key, HeaderContent>;
@@ -25938,7 +25938,8 @@ var useStyles$i = createThemedStyles("FlexibleTableCell", {
25938
25938
  sticky: _object_spread_props$k(_object_spread$l({
25939
25939
  zIndex: 19,
25940
25940
  paddingLeft: 24,
25941
- paddingRight: 12
25941
+ paddingRight: 12,
25942
+ left: 0
25942
25943
  }, getTransition([
25943
25944
  "box-shadow"
25944
25945
  ])), {
@@ -26039,7 +26040,7 @@ function _object_without_properties_loose$7(source, excluded) {
26039
26040
  return target;
26040
26041
  }
26041
26042
  function FlexibleTableCell(_param) {
26042
- var row = _param.row, columnName = _param.columnName, config = _param.config, renderMode = _param.renderMode, isSecond = _param.isSecond, isSticky = _param.isSticky, isLoading = _param.isLoading, tweakStyles = _param.tweakStyles, valueComponentProps = _object_without_properties$7(_param, [
26043
+ var row = _param.row, columnName = _param.columnName, config = _param.config, renderMode = _param.renderMode, isSecond = _param.isSecond, isOldSticky = _param.isSticky, isLoading = _param.isLoading, tweakStyles = _param.tweakStyles, valueComponentProps = _object_without_properties$7(_param, [
26043
26044
  "row",
26044
26045
  "columnName",
26045
26046
  "config",
@@ -26054,7 +26055,8 @@ function FlexibleTableCell(_param) {
26054
26055
  });
26055
26056
  var value = row[columnName];
26056
26057
  var _config_columnName;
26057
- var _ref = (_config_columnName = config[columnName]) !== null && _config_columnName !== void 0 ? _config_columnName : {}, _ref_component = _ref.component, component = _ref_component === void 0 ? formatCellContent(value, config[columnName]) : _ref_component, left2 = _ref.left, right2 = _ref.right, position = _ref.position, cellAlign = _ref.cellAlign, cellVerticalAlign = _ref.cellVerticalAlign, shouldRenderDataId = _ref.shouldRenderDataId;
26058
+ var _ref = (_config_columnName = config[columnName]) !== null && _config_columnName !== void 0 ? _config_columnName : {}, _ref_component = _ref.component, component = _ref_component === void 0 ? formatCellContent(value, config[columnName]) : _ref_component, left2 = _ref.left, right2 = _ref.right, position = _ref.position, cellAlign = _ref.cellAlign, cellVerticalAlign = _ref.cellVerticalAlign, shouldRenderDataId = _ref.shouldRenderDataId, _ref_shouldRenderComponent = _ref.shouldRenderComponent, shouldRenderComponent = _ref_shouldRenderComponent === void 0 ? isNotEmpty : _ref_shouldRenderComponent;
26059
+ var isSticky = isOldSticky || position === "sticky";
26058
26060
  var Table = TableRenders[renderMode];
26059
26061
  var _obj2;
26060
26062
  return /* @__PURE__ */ jsx(Table.Cell, _object_spread_props$j(_object_spread$k({
@@ -26063,7 +26065,7 @@ function FlexibleTableCell(_param) {
26063
26065
  textAlign: cellAlign,
26064
26066
  position: isSticky ? "sticky" : position,
26065
26067
  right: right2,
26066
- left: isSticky ? 0 : left2,
26068
+ left: left2,
26067
26069
  verticalAlign: cellVerticalAlign
26068
26070
  }
26069
26071
  }, addDataAttributes({
@@ -26072,7 +26074,7 @@ function FlexibleTableCell(_param) {
26072
26074
  children: isLoading ? /* @__PURE__ */ jsx("div", {
26073
26075
  className: classes.skeleton,
26074
26076
  children: /* @__PURE__ */ jsx(Skeleton, {})
26075
- }) : isNotEmpty(value) && applyAction(component, _object_spread_props$j(_object_spread$k({}, valueComponentProps), {
26077
+ }) : applyAction(shouldRenderComponent, value, row, columnName) && applyAction(component, _object_spread_props$j(_object_spread$k({}, valueComponentProps), {
26076
26078
  value,
26077
26079
  row
26078
26080
  }))
@@ -26547,24 +26549,28 @@ function FlexibleTable(_param) {
26547
26549
  children: /* @__PURE__ */ jsx(Table.Row, {
26548
26550
  className: classes.headerRow,
26549
26551
  children: columns.map(function(key, i) {
26550
- var itemConfig = config === null || config === void 0 ? void 0 : config[key];
26551
- var _itemConfig_titleAlign, _itemConfig_title;
26552
+ var _config_key;
26553
+ var _ref = (_config_key = config === null || config === void 0 ? void 0 : config[key]) !== null && _config_key !== void 0 ? _config_key : {}, position = _ref.position, minWidth = _ref.minWidth, width = _ref.width, maxWidth = _ref.maxWidth, _ref_titleAlign = _ref.titleAlign, titleAlign = _ref_titleAlign === void 0 ? "left" : _ref_titleAlign, right2 = _ref.right, left2 = _ref.left, _ref_title = _ref.title, title = _ref_title === void 0 ? "" : _ref_title, shouldRenderDataId = _ref.shouldRenderDataId;
26554
+ var isSticky = position === "sticky" || isFirstColumnSticky && i === 0;
26552
26555
  var _obj2;
26553
26556
  return /* @__PURE__ */ jsx(Table.Header, _object_spread_props$h(_object_spread$i({
26554
- className: clsx(classes.header, (_obj2 = {}, _define_property$j(_obj2, classes.headerSticky, isFirstColumnSticky && i === 0), _define_property$j(_obj2, classes.headerSecond, isFirstColumnSticky && i === 1), _obj2)),
26557
+ className: clsx(classes.header, (_obj2 = {}, _define_property$j(_obj2, classes.headerSticky, isSticky), _define_property$j(_obj2, classes.headerSecond, isFirstColumnSticky && i === 1), _obj2)),
26555
26558
  style: {
26556
- minWidth: itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.minWidth,
26557
- width: itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.width,
26558
- maxWidth: itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.maxWidth,
26559
- textAlign: (_itemConfig_titleAlign = itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.titleAlign) !== null && _itemConfig_titleAlign !== void 0 ? _itemConfig_titleAlign : "left"
26559
+ minWidth,
26560
+ width,
26561
+ maxWidth,
26562
+ textAlign: titleAlign,
26563
+ position: isSticky ? "sticky" : position,
26564
+ right: right2,
26565
+ left: left2
26560
26566
  },
26561
26567
  onClick: isNotEmpty(onHeadClick) ? function() {
26562
26568
  return onHeadClick(key);
26563
26569
  } : void 0
26564
26570
  }, addDataAttributes({
26565
- id: (itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.shouldRenderDataId) ? key : void 0
26571
+ id: shouldRenderDataId ? key : void 0
26566
26572
  })), {
26567
- children: applyAction((_itemConfig_title = itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.title) !== null && _itemConfig_title !== void 0 ? _itemConfig_title : "", {
26573
+ children: applyAction(title, {
26568
26574
  value: headerContent === null || headerContent === void 0 ? void 0 : headerContent[key]
26569
26575
  })
26570
26576
  }), key);