fui-material 2.8.3 → 2.8.5

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.
@@ -41,6 +41,8 @@ export interface IFTable extends React.HTMLAttributes<HTMLTableElement> {
41
41
  * @default "auto"
42
42
  */
43
43
  layout?: "auto" | "fixed";
44
+ /** Показывает поле поиска по полному тексту строк FTableBody. */
45
+ searchable?: boolean;
44
46
  }
45
47
  /**
46
48
  * Компонент FTable представляет собой таблицу с возможностью управления переполнением и "липким" заголовком.
@@ -0,0 +1,6 @@
1
+ import { type ButtonHTMLAttributes, type ReactNode } from 'react';
2
+ export interface IFTableActions extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
3
+ children?: ReactNode;
4
+ }
5
+ /** Кнопка действий с произвольным содержимым в нативном popover. */
6
+ export default function FTableActions({ children, className, onClick, ...props }: IFTableActions): import("react").JSX.Element;
@@ -1,36 +1,13 @@
1
- import React from "react";
2
- /**
3
- * Интерфейс для пропсов компонента FTableBody.
4
- * @interface IFTableBody
5
- * @extends {React.HTMLAttributes<HTMLTableSectionElement>}
6
- */
1
+ import React from 'react';
7
2
  export interface IFTableBody extends React.HTMLAttributes<HTMLTableSectionElement> {
8
- /**
9
- * Дополнительные стили для тела таблицы.
10
- * @type {React.CSSProperties}
11
- */
12
3
  st?: React.CSSProperties;
13
- /**
14
- * Дочерние элементы (например, строки `<tr>` или ячейки `<td>`).
15
- * @type {React.ReactNode}
16
- */
17
4
  children?: React.ReactNode;
18
- /**
19
- * Выравнивание текста внутри тела таблицы.
20
- * @type {'left' | 'right' | 'center' | 'justify'}
21
- * @default 'left'
22
- */
23
5
  textAlignment?: 'left' | 'right' | 'center' | 'justify';
24
- /**
25
- * Ref для родительского контейнера с прокруткой.
26
- * Используется для отслеживания события прокрутки.
27
- * @type {React.RefObject<HTMLDivElement>}
28
- */
29
6
  tableWrapperRef?: React.RefObject<HTMLDivElement>;
30
- /**
31
- * Количество видимых строк для виртуализации. Если не указано — виртуализация отключена.
32
- */
7
+ /** Минимум отрисованных строк; окно дополняется до высоты контейнера с запасом. При rowSpan рендерятся все строки. */
33
8
  visibleRowCount?: number;
9
+ /** Автоматически сокращать текст длиннее указанного числа символов. */
10
+ truncateAt?: number;
34
11
  }
35
12
  declare const _default: React.NamedExoticComponent<IFTableBody>;
36
13
  export default _default;
@@ -37,6 +37,14 @@ export interface IFTableDataCell extends React.TdHTMLAttributes<HTMLTableCellEle
37
37
  * @default 'auto'
38
38
  */
39
39
  height?: number | string;
40
+ /** Сокращение текста; false отменяет truncateAt тела таблицы. */
41
+ truncate?: boolean;
42
+ /** Уникальный ключ столбца, совпадающий с sortKey заголовка. */
43
+ sortKey?: string;
44
+ /** Исходное значение для сортировки чисел, дат и JSX. */
45
+ sortValue?: string | number;
46
+ /** Текст для поиска в пользовательском содержимом. */
47
+ searchValue?: string;
40
48
  }
41
49
  /**
42
50
  * Компонент FTableDataCell представляет собой ячейку данных таблицы (`<td>`).
@@ -37,6 +37,8 @@ export interface IFTableHeaderCell extends React.ThHTMLAttributes<HTMLTableCellE
37
37
  * @default 'auto'
38
38
  */
39
39
  width?: number | string;
40
+ /** Включает сортировку по ячейкам FTableDataCell с таким же ключом. */
41
+ sortKey?: string;
40
42
  }
41
43
  /**
42
44
  * Компонент FTableHeaderCell представляет собой ячейку заголовка таблицы (`<th>`).
@@ -0,0 +1,7 @@
1
+ import { type HTMLAttributes, type ReactElement } from 'react';
2
+ /** Full cell text stays reachable by pointer and keyboard outside the scroll container. */
3
+ export default function FTableTextTooltip({ text, enabled, children }: {
4
+ text: string;
5
+ enabled: boolean;
6
+ children: ReactElement<HTMLAttributes<HTMLButtonElement>>;
7
+ }): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { TableSort } from './tableRows';
2
+ export declare const TableControlsContext: import("react").Context<{
3
+ query: string;
4
+ sort: TableSort | null;
5
+ toggleSort?: (key: string) => void;
6
+ }>;
@@ -0,0 +1 @@
1
+ export declare const TruncateContext: import("react").Context<number | undefined>;
@@ -0,0 +1,24 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface TableSort {
3
+ key: string;
4
+ direction: 'ascending' | 'descending';
5
+ }
6
+ type RowGroup = {
7
+ rows: ReactNode[];
8
+ text: string;
9
+ values: Map<string, string | number>;
10
+ };
11
+ type Section = {
12
+ heading: ReactNode[];
13
+ groups: RowGroup[];
14
+ };
15
+ export declare function tableChildren(children: ReactNode, prefix?: string): ReactNode[];
16
+ /** Build the search index once per children change, before virtualization. */
17
+ export declare function indexTableRows(children: ReactNode): {
18
+ rows: ReactNode[];
19
+ sections: Section[];
20
+ columnCount: number;
21
+ hasRowSpans: boolean;
22
+ };
23
+ export declare function selectTableRows(index: ReturnType<typeof indexTableRows>, query: string, sort: TableSort | null): ReactNode[];
24
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare function virtualRowRange(offsets: number[], top: number, viewportHeight: number, minimumRows: number): {
2
+ start: number;
3
+ end: number;
4
+ };
@@ -50,3 +50,4 @@ export { default as FMenuLinks } from "./MenuLinks/FMenuLinks";
50
50
  export { default as FTooltip } from "./FTooltip";
51
51
  export { default as FSearchableSelect } from "./FSearchableSelect";
52
52
  export { default as FSegmentedControl } from "./FSegmentedControl";
53
+ export { default as FTableActions } from "./TableComponents/FTableActions";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fui-material",
3
- "version": "2.8.3",
3
+ "version": "2.8.5",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",