@alfalab/core-components-table 4.0.7 → 4.0.8-alfasans
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/component.d.ts +21 -22
- package/components/pagination/Component.d.ts +1 -1
- package/components/pagination/Component.js.map +1 -1
- package/components/pagination/index.css +8 -8
- package/components/pagination/index.module.css.js +1 -1
- package/components/pagination/index.module.css.js.map +1 -1
- package/components/pagination/select-field/index.css +3 -3
- package/components/pagination/select-field/index.module.css.js +1 -1
- package/components/pagination/select-field/index.module.css.js.map +1 -1
- package/components/table/Component.d.ts +7 -7
- package/components/table/index.css +6 -6
- package/components/table/index.module.css.js +1 -1
- package/components/table/index.module.css.js.map +1 -1
- package/components/table/utils.js.map +1 -1
- package/components/table-context/index.d.ts +2 -2
- package/components/tbody/Component.d.ts +3 -3
- package/components/tbody/index.css +1 -1
- package/components/tbody/index.module.css.js +1 -1
- package/components/tbody/index.module.css.js.map +1 -1
- package/components/tcell/Component.d.ts +1 -1
- package/components/tcell/index.css +10 -8
- package/components/tcell/index.module.css.js +1 -1
- package/components/tcell/index.module.css.js.map +1 -1
- package/components/texpandable-row/Component.d.ts +9 -9
- package/components/texpandable-row/Component.js.map +1 -1
- package/components/texpandable-row/index.css +4 -4
- package/components/texpandable-row/index.module.css.js +1 -1
- package/components/texpandable-row/index.module.css.js.map +1 -1
- package/components/thead/Component.d.ts +1 -1
- package/components/thead/index.css +5 -5
- package/components/thead/index.module.css.js +1 -1
- package/components/thead/index.module.css.js.map +1 -1
- package/components/thead-cell/Component.d.ts +1 -1
- package/components/thead-cell/index.css +12 -11
- package/components/thead-cell/index.module.css.js +1 -1
- package/components/thead-cell/index.module.css.js.map +1 -1
- package/components/trow/Component.d.ts +6 -6
- package/components/trow/index.css +7 -7
- package/components/trow/index.module.css.js +1 -1
- package/components/trow/index.module.css.js.map +1 -1
- package/components/tsortable-head-cell/Component.d.ts +1 -1
- package/components/tsortable-head-cell/index.css +7 -7
- package/components/tsortable-head-cell/index.module.css.js +1 -1
- package/components/tsortable-head-cell/index.module.css.js.map +1 -1
- package/cssm/component.d.ts +21 -22
- package/cssm/components/pagination/Component.d.ts +1 -1
- package/cssm/components/pagination/Component.js.map +1 -1
- package/cssm/components/table/Component.d.ts +7 -7
- package/cssm/components/table/utils.js.map +1 -1
- package/cssm/components/table-context/index.d.ts +2 -2
- package/cssm/components/tbody/Component.d.ts +3 -3
- package/cssm/components/tcell/Component.d.ts +1 -1
- package/cssm/components/tcell/index.module.css +5 -3
- package/cssm/components/texpandable-row/Component.d.ts +9 -9
- package/cssm/components/texpandable-row/Component.js.map +1 -1
- package/cssm/components/thead/Component.d.ts +1 -1
- package/cssm/components/thead-cell/Component.d.ts +1 -1
- package/cssm/components/thead-cell/index.module.css +4 -3
- package/cssm/components/trow/Component.d.ts +6 -6
- package/cssm/components/tsortable-head-cell/Component.d.ts +1 -1
- package/cssm/typings.d.ts +1 -1
- package/cssm/utils.d.ts +4 -1
- package/cssm/utils.js +1 -1
- package/cssm/utils.js.map +1 -1
- package/esm/component.d.ts +21 -22
- package/esm/components/pagination/Component.d.ts +1 -1
- package/esm/components/pagination/Component.js.map +1 -1
- package/esm/components/pagination/index.css +8 -8
- package/esm/components/pagination/index.module.css.js +1 -1
- package/esm/components/pagination/index.module.css.js.map +1 -1
- package/esm/components/pagination/select-field/index.css +3 -3
- package/esm/components/pagination/select-field/index.module.css.js +1 -1
- package/esm/components/pagination/select-field/index.module.css.js.map +1 -1
- package/esm/components/table/Component.d.ts +7 -7
- package/esm/components/table/index.css +6 -6
- package/esm/components/table/index.module.css.js +1 -1
- package/esm/components/table/index.module.css.js.map +1 -1
- package/esm/components/table/utils.js.map +1 -1
- package/esm/components/table-context/index.d.ts +2 -2
- package/esm/components/tbody/Component.d.ts +3 -3
- package/esm/components/tbody/index.css +1 -1
- package/esm/components/tbody/index.module.css.js +1 -1
- package/esm/components/tbody/index.module.css.js.map +1 -1
- package/esm/components/tcell/Component.d.ts +1 -1
- package/esm/components/tcell/index.css +10 -8
- package/esm/components/tcell/index.module.css.js +1 -1
- package/esm/components/tcell/index.module.css.js.map +1 -1
- package/esm/components/texpandable-row/Component.d.ts +9 -9
- package/esm/components/texpandable-row/Component.js.map +1 -1
- package/esm/components/texpandable-row/index.css +4 -4
- package/esm/components/texpandable-row/index.module.css.js +1 -1
- package/esm/components/texpandable-row/index.module.css.js.map +1 -1
- package/esm/components/thead/Component.d.ts +1 -1
- package/esm/components/thead/index.css +5 -5
- package/esm/components/thead/index.module.css.js +1 -1
- package/esm/components/thead/index.module.css.js.map +1 -1
- package/esm/components/thead-cell/Component.d.ts +1 -1
- package/esm/components/thead-cell/index.css +12 -11
- package/esm/components/thead-cell/index.module.css.js +1 -1
- package/esm/components/thead-cell/index.module.css.js.map +1 -1
- package/esm/components/trow/Component.d.ts +6 -6
- package/esm/components/trow/index.css +7 -7
- package/esm/components/trow/index.module.css.js +1 -1
- package/esm/components/trow/index.module.css.js.map +1 -1
- package/esm/components/tsortable-head-cell/Component.d.ts +1 -1
- package/esm/components/tsortable-head-cell/index.css +7 -7
- package/esm/components/tsortable-head-cell/index.module.css.js +1 -1
- package/esm/components/tsortable-head-cell/index.module.css.js.map +1 -1
- package/esm/typings.d.ts +1 -1
- package/esm/utils.d.ts +4 -1
- package/esm/utils.js +1 -1
- package/esm/utils.js.map +1 -1
- package/modern/component.d.ts +21 -22
- package/modern/components/pagination/Component.d.ts +1 -1
- package/modern/components/pagination/Component.js.map +1 -1
- package/modern/components/pagination/index.css +8 -8
- package/modern/components/pagination/index.module.css.js +1 -1
- package/modern/components/pagination/index.module.css.js.map +1 -1
- package/modern/components/pagination/select-field/index.css +3 -3
- package/modern/components/pagination/select-field/index.module.css.js +1 -1
- package/modern/components/pagination/select-field/index.module.css.js.map +1 -1
- package/modern/components/table/Component.d.ts +7 -7
- package/modern/components/table/index.css +6 -6
- package/modern/components/table/index.module.css.js +1 -1
- package/modern/components/table/index.module.css.js.map +1 -1
- package/modern/components/table/utils.js.map +1 -1
- package/modern/components/table-context/index.d.ts +2 -2
- package/modern/components/tbody/Component.d.ts +3 -3
- package/modern/components/tbody/index.css +1 -1
- package/modern/components/tbody/index.module.css.js +1 -1
- package/modern/components/tbody/index.module.css.js.map +1 -1
- package/modern/components/tcell/Component.d.ts +1 -1
- package/modern/components/tcell/index.css +10 -8
- package/modern/components/tcell/index.module.css.js +1 -1
- package/modern/components/tcell/index.module.css.js.map +1 -1
- package/modern/components/texpandable-row/Component.d.ts +9 -9
- package/modern/components/texpandable-row/Component.js.map +1 -1
- package/modern/components/texpandable-row/index.css +4 -4
- package/modern/components/texpandable-row/index.module.css.js +1 -1
- package/modern/components/texpandable-row/index.module.css.js.map +1 -1
- package/modern/components/thead/Component.d.ts +1 -1
- package/modern/components/thead/index.css +5 -5
- package/modern/components/thead/index.module.css.js +1 -1
- package/modern/components/thead/index.module.css.js.map +1 -1
- package/modern/components/thead-cell/Component.d.ts +1 -1
- package/modern/components/thead-cell/index.css +12 -11
- package/modern/components/thead-cell/index.module.css.js +1 -1
- package/modern/components/thead-cell/index.module.css.js.map +1 -1
- package/modern/components/trow/Component.d.ts +6 -6
- package/modern/components/trow/index.css +7 -7
- package/modern/components/trow/index.module.css.js +1 -1
- package/modern/components/trow/index.module.css.js.map +1 -1
- package/modern/components/tsortable-head-cell/Component.d.ts +1 -1
- package/modern/components/tsortable-head-cell/index.css +7 -7
- package/modern/components/tsortable-head-cell/index.module.css.js +1 -1
- package/modern/components/tsortable-head-cell/index.module.css.js.map +1 -1
- package/modern/typings.d.ts +1 -1
- package/modern/utils.d.ts +4 -1
- package/modern/utils.js +1 -1
- package/modern/utils.js.map +1 -1
- package/moderncssm/component.d.ts +21 -22
- package/moderncssm/components/pagination/Component.d.ts +1 -1
- package/moderncssm/components/pagination/Component.js.map +1 -1
- package/moderncssm/components/table/Component.d.ts +7 -7
- package/moderncssm/components/table/utils.js.map +1 -1
- package/moderncssm/components/table-context/index.d.ts +2 -2
- package/moderncssm/components/tbody/Component.d.ts +3 -3
- package/moderncssm/components/tcell/Component.d.ts +1 -1
- package/moderncssm/components/tcell/index.module.css +2 -1
- package/moderncssm/components/texpandable-row/Component.d.ts +9 -9
- package/moderncssm/components/texpandable-row/Component.js.map +1 -1
- package/moderncssm/components/thead/Component.d.ts +1 -1
- package/moderncssm/components/thead-cell/Component.d.ts +1 -1
- package/moderncssm/components/thead-cell/index.module.css +1 -1
- package/moderncssm/components/trow/Component.d.ts +6 -6
- package/moderncssm/components/tsortable-head-cell/Component.d.ts +1 -1
- package/moderncssm/typings.d.ts +1 -1
- package/moderncssm/utils.d.ts +4 -1
- package/moderncssm/utils.js +1 -1
- package/moderncssm/utils.js.map +1 -1
- package/package.json +6 -6
- package/src/components/pagination/index.module.css +1 -1
- package/src/components/pagination/select-field/index.module.css +1 -1
- package/src/components/table/index.module.css +1 -1
- package/src/components/tbody/index.module.css +1 -1
- package/src/components/tcell/index.module.css +1 -1
- package/src/components/texpandable-row/index.module.css +1 -1
- package/src/components/thead/index.module.css +1 -1
- package/src/components/thead-cell/index.module.css +1 -1
- package/src/components/trow/index.module.css +1 -1
- package/src/components/tsortable-head-cell/index.module.css +1 -1
- package/src/utils.ts +8 -2
- package/typings.d.ts +1 -1
- package/utils.d.ts +4 -1
- package/utils.js +1 -1
- package/utils.js.map +1 -1
package/component.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { Pagination, Table as TableComponent, TBody, TCell, TExpandableRow, THead, THeadCell, TRow, TSortableHeadCell } from './components';
|
|
3
2
|
export declare const Table: import("react").ForwardRefExoticComponent<import("react").TableHTMLAttributes<HTMLTableElement> & {
|
|
4
|
-
compactView?: boolean
|
|
5
|
-
compactHorizontal?: boolean
|
|
6
|
-
className?: string
|
|
7
|
-
children: import("react").ReactElement
|
|
8
|
-
wrapper?: boolean
|
|
3
|
+
compactView?: boolean;
|
|
4
|
+
compactHorizontal?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
children: import("react").ReactElement | import("react").ReactElement[];
|
|
7
|
+
wrapper?: boolean;
|
|
9
8
|
pagination?: import("react").ReactNode;
|
|
10
|
-
dataTestId?: string
|
|
11
|
-
stickyHeader?: boolean
|
|
9
|
+
dataTestId?: string;
|
|
10
|
+
stickyHeader?: boolean;
|
|
12
11
|
} & import("react").RefAttributes<HTMLTableElement>> & {
|
|
13
12
|
TBody: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLTableSectionElement> & {
|
|
14
|
-
className?: string
|
|
15
|
-
dataTestId?: string
|
|
13
|
+
className?: string;
|
|
14
|
+
dataTestId?: string;
|
|
16
15
|
} & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
17
16
|
THead: import("react").FC<import("./components").THeadProps>;
|
|
18
17
|
THeadCell: ({ children, className, dataTestId, style, width, textAlign, hidden, ...restProps }: import("./components").THeadCellProps) => import("react").JSX.Element | null;
|
|
@@ -20,23 +19,23 @@ export declare const Table: import("react").ForwardRefExoticComponent<import("re
|
|
|
20
19
|
TCell: ({ className, style, dataTestId, children, index, ...restProps }: import("./components").TCellProps) => import("react").JSX.Element | null;
|
|
21
20
|
TRow: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLTableRowElement> & {
|
|
22
21
|
children: import("react").ReactElement<import("./components").TCellProps, ({ className, style, dataTestId, children, index, ...restProps }: import("./components").TCellProps) => import("react").JSX.Element | null> | import("react").ReactElement<import("./components").TCellProps, ({ className, style, dataTestId, children, index, ...restProps }: import("./components").TCellProps) => import("react").JSX.Element | null>[];
|
|
23
|
-
className?: string
|
|
24
|
-
selected?: boolean
|
|
25
|
-
withoutBorder?: boolean
|
|
26
|
-
dataTestId?: string
|
|
22
|
+
className?: string;
|
|
23
|
+
selected?: boolean;
|
|
24
|
+
withoutBorder?: boolean;
|
|
25
|
+
dataTestId?: string;
|
|
27
26
|
} & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
28
27
|
TExpandableRow: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLTableRowElement> & {
|
|
29
28
|
children: import("react").ReactElement<import("./components").TCellProps, ({ className, style, dataTestId, children, index, ...restProps }: import("./components").TCellProps) => import("react").JSX.Element | null> | import("react").ReactElement<import("./components").TCellProps, ({ className, style, dataTestId, children, index, ...restProps }: import("./components").TCellProps) => import("react").JSX.Element | null>[];
|
|
30
|
-
className?: string
|
|
31
|
-
selected?: boolean
|
|
32
|
-
withoutBorder?: boolean
|
|
33
|
-
dataTestId?: string
|
|
29
|
+
className?: string;
|
|
30
|
+
selected?: boolean;
|
|
31
|
+
withoutBorder?: boolean;
|
|
32
|
+
dataTestId?: string;
|
|
34
33
|
} & {
|
|
35
|
-
defaultExpanded?: boolean
|
|
36
|
-
expanded?: boolean
|
|
37
|
-
onToggle?: (
|
|
34
|
+
defaultExpanded?: boolean;
|
|
35
|
+
expanded?: boolean;
|
|
36
|
+
onToggle?: (expanded: boolean) => void;
|
|
38
37
|
renderContent: (expanded: boolean) => import("react").ReactNode;
|
|
39
|
-
rowRef?: import("react").Ref<HTMLTableRowElement
|
|
38
|
+
rowRef?: import("react").Ref<HTMLTableRowElement>;
|
|
40
39
|
} & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
41
40
|
Pagination: import("react").FC<import("./components").PaginationProps>;
|
|
42
41
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
2
|
import { type PaginationProps as CorePaginationProps } from '@alfalab/core-components-pagination';
|
|
3
|
-
export
|
|
3
|
+
export type PaginationProps = CorePaginationProps & {
|
|
4
4
|
/**
|
|
5
5
|
* Количество строк на страницу
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../src/components/pagination/Component.tsx"],"sourcesContent":["import React, { type FC, useCallback, useContext, useMemo } from 'react';\nimport cn from 'classnames';\n\nimport {\n Pagination as CorePagination,\n type PaginationProps as CorePaginationProps,\n} from '@alfalab/core-components-pagination';\nimport { SelectDesktop, type SelectDesktopProps } from '@alfalab/core-components-select/desktop';\nimport { type BaseSelectChangePayload } from '@alfalab/core-components-select/shared';\n\nimport { TableContext } from '../table-context';\n\nimport { CustomSelectField } from './select-field';\n\nimport styles from './index.module.css';\n\nexport type PaginationProps = CorePaginationProps & {\n /**\n * Количество строк на страницу\n */\n perPage?: number;\n\n /**\n * Возможные варианты разбивки\n */\n possiblePerPage?: number[];\n\n /**\n * Обработчик переключения perPage\n */\n onPerPageChange?: (perPage: number) => void;\n\n /**\n * Скрывает переключатель количества строк на страницу\n */\n hidePerPageSelect?: boolean;\n\n /**\n * Идентификатор для систем автоматизированного тестирования\n */\n dataTestId?: string;\n};\n\nexport const Pagination: FC<PaginationProps> = ({\n perPage = 25,\n possiblePerPage = [25, 50, 100],\n onPerPageChange = () => null,\n hidePerPageSelect = false,\n pagesCount,\n onPageChange = () => null,\n className,\n dataTestId,\n ...restPaginationProps\n}) => {\n const { wrapperRef } = useContext(TableContext);\n\n const options = useMemo(\n () =>\n Array.from(new Set<number>(possiblePerPage.concat(perPage)))\n .sort((a, b) => a - b)\n .map((value) => ({\n key: value.toString(),\n content: `Показывать по ${value}`,\n })),\n [perPage, possiblePerPage],\n );\n\n const handlePerPageChange: SelectDesktopProps['onChange'] = useCallback(\n ({ selected }: BaseSelectChangePayload) => {\n onPerPageChange(Number(selected?.key));\n },\n [onPerPageChange],\n );\n\n const handlePageChange = useCallback(\n (pageIndex: number) => {\n onPageChange(pageIndex);\n\n setTimeout(() => {\n if (wrapperRef.current) {\n wrapperRef.current.scrollIntoView();\n }\n }, 0);\n },\n [onPageChange, wrapperRef],\n );\n\n return (\n <div className={cn(styles.component, className)} data-test-id={dataTestId}>\n {hidePerPageSelect === false && (\n <SelectDesktop\n options={options}\n selected={perPage.toString()}\n onChange={handlePerPageChange}\n preventFlip={false}\n size={48}\n className={styles.select}\n optionsListClassName={styles.menu}\n optionClassName={styles.option}\n Field={CustomSelectField}\n />\n )}\n\n {pagesCount > 1 && (\n <CorePagination\n pagesCount={pagesCount}\n onPageChange={handlePageChange}\n className={styles.pagination}\n {...restPaginationProps}\n />\n )}\n </div>\n );\n};\n"],"names":["__rest","useContext","TableContext","useMemo","useCallback","React","cn","styles","SelectDesktop","CustomSelectField","CorePagination","__assign"],"mappings":";;;;;;;;;;;;;;;;;;AA2CO,IAAM,UAAU,GAAwB,UAAC,EAU/C,EAAA;AATG,IAAA,IAAA,EAAY,GAAA,EAAA,CAAA,OAAA,EAAZ,OAAO,GAAA,EAAA,KAAA,MAAA,GAAG,EAAE,GAAA,EAAA,EACZ,EAAA,GAAA,EAAA,CAAA,eAA+B,EAA/B,eAAe,GAAG,EAAA,KAAA,MAAA,GAAA,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,GAAA,EAAA,EAC/B,EAA4B,GAAA,EAAA,CAAA,eAAA,EAA5B,eAAe,GAAA,EAAA,KAAA,MAAA,GAAG,YAAM,EAAA,OAAA,IAAI,CAAA,EAAA,GAAA,EAAA,EAC5B,EAAA,GAAA,EAAA,CAAA,iBAAyB,EAAzB,iBAAiB,GAAG,EAAA,KAAA,MAAA,GAAA,KAAK,GAAA,EAAA,EACzB,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,EAAA,GAAA,EAAA,CAAA,YAAyB,EAAzB,YAAY,GAAG,EAAA,KAAA,MAAA,GAAA,YAAA,EAAM,OAAA,IAAI,CAAJ,EAAI,GAAA,EAAA,EACzB,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,UAAU,GAAA,EAAA,CAAA,UAAA,EACP,mBAAmB,GAAAA,YAAA,CAAA,EAAA,EATsB,+HAU/C,CADyB;AAEd,IAAA,IAAA,UAAU,GAAKC,gBAAU,CAACC,kBAAY,CAAC,WAA7B;IAElB,IAAM,OAAO,GAAGC,aAAO,CACnB,YAAA;AACI,QAAA,OAAA,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAS,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACtD,aAAA,IAAI,CAAC,UAAC,CAAC,EAAE,CAAC,EAAA,EAAK,OAAA,CAAC,GAAG,CAAC,CAAL,EAAK;AACpB,aAAA,GAAG,CAAC,UAAC,KAAK,EAAA,EAAK,QAAC;AACb,YAAA,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE;YACrB,OAAO,EAAE,4EAAiB,CAAA,MAAA,CAAA,KAAK,CAAE;SACpC,EAAC,EAAA,CAAC;AALP,KAKO,EACX,CAAC,OAAO,EAAE,eAAe,CAAC,CAC7B;AAED,IAAA,IAAM,mBAAmB,GAAmCC,iBAAW,CACnE,UAAC,EAAqC,EAAA;AAAnC,QAAA,IAAA,QAAQ,GAAA,EAAA,CAAA,QAAA;AACP,QAAA,eAAe,CAAC,MAAM,CAAC,QAAQ,KAAR,IAAA,IAAA,QAAQ,KAAR,MAAA,GAAA,MAAA,GAAA,QAAQ,CAAE,GAAG,CAAC,CAAC;AAC1C,KAAC,EACD,CAAC,eAAe,CAAC,CACpB;AAED,IAAA,IAAM,gBAAgB,GAAGA,iBAAW,CAChC,UAAC,SAAiB,EAAA;QACd,YAAY,CAAC,SAAS,CAAC;AAEvB,QAAA,UAAU,CAAC,YAAA;
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../src/components/pagination/Component.tsx"],"sourcesContent":["import React, { type FC, useCallback, useContext, useMemo } from 'react';\nimport cn from 'classnames';\n\nimport {\n Pagination as CorePagination,\n type PaginationProps as CorePaginationProps,\n} from '@alfalab/core-components-pagination';\nimport { SelectDesktop, type SelectDesktopProps } from '@alfalab/core-components-select/desktop';\nimport { type BaseSelectChangePayload } from '@alfalab/core-components-select/shared';\n\nimport { TableContext } from '../table-context';\n\nimport { CustomSelectField } from './select-field';\n\nimport styles from './index.module.css';\n\nexport type PaginationProps = CorePaginationProps & {\n /**\n * Количество строк на страницу\n */\n perPage?: number;\n\n /**\n * Возможные варианты разбивки\n */\n possiblePerPage?: number[];\n\n /**\n * Обработчик переключения perPage\n */\n onPerPageChange?: (perPage: number) => void;\n\n /**\n * Скрывает переключатель количества строк на страницу\n */\n hidePerPageSelect?: boolean;\n\n /**\n * Идентификатор для систем автоматизированного тестирования\n */\n dataTestId?: string;\n};\n\nexport const Pagination: FC<PaginationProps> = ({\n perPage = 25,\n possiblePerPage = [25, 50, 100],\n onPerPageChange = () => null,\n hidePerPageSelect = false,\n pagesCount,\n onPageChange = () => null,\n className,\n dataTestId,\n ...restPaginationProps\n}) => {\n const { wrapperRef } = useContext(TableContext);\n\n const options = useMemo(\n () =>\n Array.from(new Set<number>(possiblePerPage.concat(perPage)))\n .sort((a, b) => a - b)\n .map((value) => ({\n key: value.toString(),\n content: `Показывать по ${value}`,\n })),\n [perPage, possiblePerPage],\n );\n\n const handlePerPageChange: SelectDesktopProps['onChange'] = useCallback(\n ({ selected }: BaseSelectChangePayload) => {\n onPerPageChange(Number(selected?.key));\n },\n [onPerPageChange],\n );\n\n const handlePageChange = useCallback(\n (pageIndex: number) => {\n onPageChange(pageIndex);\n\n setTimeout(() => {\n if (wrapperRef.current) {\n wrapperRef.current.scrollIntoView();\n }\n }, 0);\n },\n [onPageChange, wrapperRef],\n );\n\n return (\n <div className={cn(styles.component, className)} data-test-id={dataTestId}>\n {hidePerPageSelect === false && (\n <SelectDesktop\n options={options}\n selected={perPage.toString()}\n onChange={handlePerPageChange}\n preventFlip={false}\n size={48}\n className={styles.select}\n optionsListClassName={styles.menu}\n optionClassName={styles.option}\n Field={CustomSelectField}\n />\n )}\n\n {pagesCount > 1 && (\n <CorePagination\n pagesCount={pagesCount}\n onPageChange={handlePageChange}\n className={styles.pagination}\n {...restPaginationProps}\n />\n )}\n </div>\n );\n};\n"],"names":["__rest","useContext","TableContext","useMemo","useCallback","React","cn","styles","SelectDesktop","CustomSelectField","CorePagination","__assign"],"mappings":";;;;;;;;;;;;;;;;;;AA2CO,IAAM,UAAU,GAAwB,UAAC,EAU/C,EAAA;AATG,IAAA,IAAA,EAAY,GAAA,EAAA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EACX,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,gBAAgB,EAC9B,SAAS,EAAEJ,YAAM,CAAC,UAAU,EACxB,EAAA,mBAAmB,CACzB,CAAA,CACL,CACC;AAEd;;;;"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
--gap-24: var(--gap-xl);
|
|
15
15
|
--gap-32: var(--gap-2xl);
|
|
16
16
|
}
|
|
17
|
-
.
|
|
17
|
+
.table__component_177m2 {
|
|
18
18
|
position: sticky;
|
|
19
19
|
left: var(--gap-0);
|
|
20
20
|
display: flex;
|
|
@@ -25,27 +25,27 @@
|
|
|
25
25
|
border-top: 1px solid var(--color-light-neutral-400);
|
|
26
26
|
box-sizing: border-box;
|
|
27
27
|
}
|
|
28
|
-
.
|
|
28
|
+
.table__pagesWrapper_177m2 {
|
|
29
29
|
display: flex;
|
|
30
30
|
}
|
|
31
|
-
.
|
|
31
|
+
.table__tag_177m2.table__tag_177m2 {
|
|
32
32
|
flex-shrink: 0;
|
|
33
33
|
margin-right: var(--gap-8);
|
|
34
34
|
padding: var(--gap-0) var(--gap-8);
|
|
35
35
|
min-width: 32px;
|
|
36
36
|
}
|
|
37
|
-
.
|
|
37
|
+
.table__tag_177m2.table__tag_177m2:last-child {
|
|
38
38
|
margin-right: var(--gap-0);
|
|
39
39
|
}
|
|
40
|
-
.
|
|
40
|
+
.table__tag_177m2.table__tag_177m2.table__tagActive_177m2 {
|
|
41
41
|
cursor: default;
|
|
42
42
|
}
|
|
43
|
-
.
|
|
43
|
+
.table__pagination_177m2 {
|
|
44
44
|
margin-left: auto;
|
|
45
45
|
}
|
|
46
|
-
.
|
|
46
|
+
.table__menu_177m2 {
|
|
47
47
|
margin: var(--gap-4) var(--gap-0);
|
|
48
48
|
}
|
|
49
|
-
.
|
|
49
|
+
.table__option_177m2 {
|
|
50
50
|
min-width: 208px;
|
|
51
51
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"component":"
|
|
5
|
+
var styles = {"component":"table__component_177m2","pagination":"table__pagination_177m2","menu":"table__menu_177m2","option":"table__option_177m2"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/pagination/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/pagination/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.component {\n position: sticky;\n left: var(--gap-0);\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n width: 100%;\n padding: var(--gap-24) var(--gap-16) var(--gap-32);\n border-top: 1px solid var(--color-light-neutral-400);\n box-sizing: border-box;\n}\n\n.pagesWrapper {\n display: flex;\n}\n\n.tag.tag {\n flex-shrink: 0;\n margin-right: var(--gap-8);\n padding: var(--gap-0) var(--gap-8);\n min-width: 32px;\n\n &:last-child {\n margin-right: var(--gap-0);\n }\n\n &.tagActive {\n cursor: default;\n }\n}\n\n.pagination {\n margin-left: auto;\n}\n\n.menu {\n margin: var(--gap-4) var(--gap-0);\n}\n\n.option {\n min-width: 208px;\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,WAAW,CAAC,wBAAwB,CAA0G,YAAY,CAAC,yBAAyB,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,qBAAqB,CAAC;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--color-light-neutral-translucent-200-hover: rgba(15, 25, 55, 0.1);
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
.table__field_10s7d svg {
|
|
5
5
|
width: 18px;
|
|
6
6
|
height: 18px;
|
|
7
7
|
}
|
|
8
|
-
.
|
|
9
|
-
.
|
|
8
|
+
.table__open_10s7d,
|
|
9
|
+
.table__open_10s7d:hover {
|
|
10
10
|
background-color: var(--color-light-neutral-translucent-200-hover);
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../../src/components/pagination/select-field/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../../src/components/pagination/select-field/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.field {\n & svg {\n width: 18px;\n height: 18px;\n }\n}\n\n.open,\n.open:hover {\n background-color: var(--color-light-neutral-translucent-200-hover);\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,mBAAmB,CAAC;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type ReactNode, type TableHTMLAttributes } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type TableProps = TableHTMLAttributes<HTMLTableElement> & {
|
|
3
3
|
/**
|
|
4
4
|
* Компактный вид
|
|
5
5
|
*/
|
|
@@ -37,15 +37,15 @@ export declare const Table: React.ForwardRefExoticComponent<React.TableHTMLAttri
|
|
|
37
37
|
/**
|
|
38
38
|
* Компактный вид
|
|
39
39
|
*/
|
|
40
|
-
compactView?: boolean
|
|
40
|
+
compactView?: boolean;
|
|
41
41
|
/**
|
|
42
42
|
* Уменьшение горизонтальных паддингов
|
|
43
43
|
*/
|
|
44
|
-
compactHorizontal?: boolean
|
|
44
|
+
compactHorizontal?: boolean;
|
|
45
45
|
/**
|
|
46
46
|
* Дополнительный класс
|
|
47
47
|
*/
|
|
48
|
-
className?: string
|
|
48
|
+
className?: string;
|
|
49
49
|
/**
|
|
50
50
|
* Дочерние компоненты
|
|
51
51
|
*/
|
|
@@ -53,7 +53,7 @@ export declare const Table: React.ForwardRefExoticComponent<React.TableHTMLAttri
|
|
|
53
53
|
/**
|
|
54
54
|
* Оборачивает таблицу в стилизованный контейнер
|
|
55
55
|
*/
|
|
56
|
-
wrapper?: boolean
|
|
56
|
+
wrapper?: boolean;
|
|
57
57
|
/**
|
|
58
58
|
* Слот для пагинации
|
|
59
59
|
*/
|
|
@@ -61,9 +61,9 @@ export declare const Table: React.ForwardRefExoticComponent<React.TableHTMLAttri
|
|
|
61
61
|
/**
|
|
62
62
|
* Идентификатор для систем автоматизированного тестирования
|
|
63
63
|
*/
|
|
64
|
-
dataTestId?: string
|
|
64
|
+
dataTestId?: string;
|
|
65
65
|
/**
|
|
66
66
|
* Если true то заголовок будет фиксироваться при скроле
|
|
67
67
|
*/
|
|
68
|
-
stickyHeader?: boolean
|
|
68
|
+
stickyHeader?: boolean;
|
|
69
69
|
} & React.RefAttributes<HTMLTableElement>>;
|
|
@@ -13,27 +13,27 @@
|
|
|
13
13
|
--gap-0: 0px;
|
|
14
14
|
--gap-16: var(--gap-m);
|
|
15
15
|
}
|
|
16
|
-
.
|
|
16
|
+
.table__component_qb1ol {
|
|
17
17
|
box-sizing: border-box;
|
|
18
18
|
}
|
|
19
|
-
.
|
|
19
|
+
.table__wrapper_qb1ol {
|
|
20
20
|
padding: var(--gap-0) var(--gap-16) var(--gap-16);
|
|
21
21
|
background: var(--color-light-base-bg-primary);
|
|
22
22
|
box-shadow: var(--shadow-xs-hard);
|
|
23
23
|
border-radius: var(--border-radius-8);
|
|
24
24
|
overflow: auto;
|
|
25
25
|
}
|
|
26
|
-
.
|
|
26
|
+
.table__stickyHeader_qb1ol {
|
|
27
27
|
max-height: 100%;
|
|
28
28
|
}
|
|
29
|
-
.
|
|
29
|
+
.table__hasPagination_qb1ol {
|
|
30
30
|
padding-bottom: var(--gap-0);
|
|
31
31
|
}
|
|
32
|
-
.
|
|
32
|
+
.table__table_qb1ol {
|
|
33
33
|
width: 100%;
|
|
34
34
|
border-collapse: collapse;
|
|
35
35
|
box-sizing: border-box;
|
|
36
36
|
}
|
|
37
|
-
.
|
|
37
|
+
.table__table_qb1ol td:first-child label > *[class^='box'], .table__table_qb1ol th:first-child label > *[class^='box'] {
|
|
38
38
|
margin-top: var(--gap-0);
|
|
39
39
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"component":"
|
|
5
|
+
var styles = {"component":"table__component_qb1ol","wrapper":"table__wrapper_qb1ol","stickyHeader":"table__stickyHeader_qb1ol","hasPagination":"table__hasPagination_qb1ol","table":"table__table_qb1ol"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/table/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/table/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.component {\n box-sizing: border-box;\n}\n\n.wrapper {\n padding: var(--gap-0) var(--gap-16) var(--gap-16);\n background: var(--color-light-base-bg-primary);\n box-shadow: var(--shadow-xs-hard);\n border-radius: var(--border-radius-8);\n overflow: auto;\n}\n\n.stickyHeader {\n max-height: 100%;\n}\n\n.hasPagination {\n padding-bottom: var(--gap-0);\n}\n\n.table {\n width: 100%;\n border-collapse: collapse;\n box-sizing: border-box;\n\n /* TODO: Хак для выравнивания чекбокса */\n & td:first-child,\n & th:first-child {\n & label > *[class^='box'] {\n margin-top: var(--gap-0);\n }\n }\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,WAAW,CAAC,wBAAwB,CAAC,SAAS,CAAC,sBAAsB,CAAC,cAAc,CAAC,2BAA2B,CAAC,eAAe,CAAC,4BAA4B,CAAC,OAAO,CAAC,oBAAoB,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/components/table/utils.ts"],"sourcesContent":["import React from 'react';\n\nimport { isChildInstanceOf } from '../../utils';\nimport { THead } from '../thead';\nimport { type THeadCellProps } from '../thead-cell';\n\nexport function findAllHeadCellsProps(children: React.ReactElement | React.ReactElement[]) {\n const result: THeadCellProps[] = [];\n\n React.Children.forEach(children, (child) => {\n if (isChildInstanceOf(child, THead)) {\n React.Children.forEach(child.props.children, (headChild) => {\n result.push(headChild.props);\n });\n }\n });\n\n return result;\n}\n"],"names":["React","isChildInstanceOf","THead"],"mappings":";;;;;;;;;;;;AAMM,SAAU,qBAAqB,CAAC,QAAmD,EAAA;IACrF,IAAM,MAAM,GAAqB,EAAE;IAEnCA,sBAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAC,KAAK,EAAA;AACnC,QAAA,IAAIC,uBAAiB,CAAC,KAAK,EAAEC,eAAK,CAAC,EAAE;AACjC,YAAAF,sBAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAC,SAAS,EAAA;AACnD,gBAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;AAChC,aAAC,CAAC
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/components/table/utils.ts"],"sourcesContent":["import React from 'react';\n\nimport { isChildInstanceOf } from '../../utils';\nimport { THead } from '../thead';\nimport { type THeadCellProps } from '../thead-cell';\n\nexport function findAllHeadCellsProps(children: React.ReactElement | React.ReactElement[]) {\n const result: THeadCellProps[] = [];\n\n React.Children.forEach(children, (child) => {\n if (isChildInstanceOf(child, THead)) {\n React.Children.forEach(child.props.children, (headChild) => {\n result.push(headChild.props);\n });\n }\n });\n\n return result;\n}\n"],"names":["React","isChildInstanceOf","THead"],"mappings":";;;;;;;;;;;;AAMM,SAAU,qBAAqB,CAAC,QAAmD,EAAA;IACrF,IAAM,MAAM,GAAqB,EAAE;IAEnCA,sBAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAC,KAAK,EAAA;AACnC,QAAA,IAAIC,uBAAiB,CAAC,KAAK,EAAEC,eAAK,CAAC,EAAE;AACjC,YAAAF,sBAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAC,SAAS,EAAA;AACnD,gBAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;AAChC,aAAC,CAAC;;AAEV,KAAC,CAAC;AAEF,IAAA,OAAO,MAAM;AACjB;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
2
|
import { type TextAlignProperty } from '../../typings';
|
|
3
|
-
export
|
|
3
|
+
export type ColumnConfiguration = {
|
|
4
4
|
width?: string | number;
|
|
5
5
|
textAlign?: TextAlignProperty;
|
|
6
6
|
hidden?: boolean;
|
|
7
7
|
index: number;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type TableContextType = {
|
|
10
10
|
columnsConfiguration: ColumnConfiguration[];
|
|
11
11
|
stickyHeader: boolean;
|
|
12
12
|
compactView: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type HTMLAttributes } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type TBodyProps = HTMLAttributes<HTMLTableSectionElement> & {
|
|
3
3
|
/**
|
|
4
4
|
* Дополнительный класс
|
|
5
5
|
*/
|
|
@@ -13,9 +13,9 @@ export declare const TBody: React.ForwardRefExoticComponent<React.HTMLAttributes
|
|
|
13
13
|
/**
|
|
14
14
|
* Дополнительный класс
|
|
15
15
|
*/
|
|
16
|
-
className?: string
|
|
16
|
+
className?: string;
|
|
17
17
|
/**
|
|
18
18
|
* Идентификатор для систем автоматизированного тестирования
|
|
19
19
|
*/
|
|
20
|
-
dataTestId?: string
|
|
20
|
+
dataTestId?: string;
|
|
21
21
|
} & React.RefAttributes<HTMLTableSectionElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/tbody/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/tbody/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.component {\n width: 100%;\n box-sizing: border-box;\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,WAAW,CAAC,wBAAwB,CAAC;;;;"}
|
|
@@ -14,14 +14,16 @@
|
|
|
14
14
|
--gap-24: var(--gap-xl);
|
|
15
15
|
}
|
|
16
16
|
:root {
|
|
17
|
-
--font-family-
|
|
18
|
-
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
17
|
+
--font-family-alfasans:
|
|
18
|
+
'Alfa Interface Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
19
|
+
Helvetica, sans-serif;
|
|
19
20
|
}
|
|
20
|
-
.
|
|
21
|
+
.table__component_s3dlh {
|
|
21
22
|
font-size: 14px;
|
|
22
23
|
line-height: 20px;
|
|
23
24
|
font-weight: 400;
|
|
24
|
-
|
|
25
|
+
letter-spacing: -0.08px;
|
|
26
|
+
font-family: var(--font-family-alfasans);
|
|
25
27
|
|
|
26
28
|
color: var(--color-light-text-primary);
|
|
27
29
|
padding: var(--gap-24) var(--gap-12);
|
|
@@ -30,17 +32,17 @@
|
|
|
30
32
|
vertical-align: top;
|
|
31
33
|
box-sizing: border-box;
|
|
32
34
|
}
|
|
33
|
-
.
|
|
35
|
+
.table__component_s3dlh:first-child {
|
|
34
36
|
padding-left: var(--gap-16);
|
|
35
37
|
}
|
|
36
|
-
.
|
|
38
|
+
.table__component_s3dlh:last-child {
|
|
37
39
|
padding-right: var(--gap-16);
|
|
38
40
|
}
|
|
39
|
-
.
|
|
41
|
+
.table__compactHorizontal_s3dlh {
|
|
40
42
|
padding-left: var(--gap-6);
|
|
41
43
|
padding-right: var(--gap-6);
|
|
42
44
|
}
|
|
43
|
-
.
|
|
45
|
+
.table__compact_s3dlh {
|
|
44
46
|
padding-top: var(--gap-8);
|
|
45
47
|
padding-bottom: var(--gap-8);
|
|
46
48
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"component":"
|
|
5
|
+
var styles = {"component":"table__component_s3dlh","compactHorizontal":"table__compactHorizontal_s3dlh","compact":"table__compact_s3dlh"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/tcell/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/tcell/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.component {\n @mixin paragraph_primary_small;\n\n color: var(--color-light-text-primary);\n padding: var(--gap-24) var(--gap-12);\n height: 72px;\n border-top: 1px solid var(--color-light-neutral-400);\n vertical-align: top;\n box-sizing: border-box;\n\n &:first-child {\n padding-left: var(--gap-16);\n }\n\n &:last-child {\n padding-right: var(--gap-16);\n }\n}\n\n.compactHorizontal {\n padding-left: var(--gap-6);\n padding-right: var(--gap-6);\n}\n\n.compact {\n padding-top: var(--gap-8);\n padding-bottom: var(--gap-8);\n\n max-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,WAAW,CAAC,wBAAwB,CAAC,mBAAmB,CAAC,gCAAgC,CAAC,SAAS,CAAC,sBAAsB,CAAC;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type ReactNode, type Ref } from 'react';
|
|
2
2
|
import { type TRowProps } from '../trow';
|
|
3
|
-
export
|
|
3
|
+
export type TExpandableRowProps = TRowProps & {
|
|
4
4
|
defaultExpanded?: boolean;
|
|
5
5
|
expanded?: boolean;
|
|
6
6
|
onToggle?: (expanded: boolean) => void;
|
|
@@ -9,14 +9,14 @@ export declare type TExpandableRowProps = TRowProps & {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const TExpandableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & {
|
|
11
11
|
children: React.ReactElement<import("..").TCellProps, ({ className, style, dataTestId, children, index, ...restProps }: import("..").TCellProps) => React.JSX.Element | null> | React.ReactElement<import("..").TCellProps, ({ className, style, dataTestId, children, index, ...restProps }: import("..").TCellProps) => React.JSX.Element | null>[];
|
|
12
|
-
className?: string
|
|
13
|
-
selected?: boolean
|
|
14
|
-
withoutBorder?: boolean
|
|
15
|
-
dataTestId?: string
|
|
12
|
+
className?: string;
|
|
13
|
+
selected?: boolean;
|
|
14
|
+
withoutBorder?: boolean;
|
|
15
|
+
dataTestId?: string;
|
|
16
16
|
} & {
|
|
17
|
-
defaultExpanded?: boolean
|
|
18
|
-
expanded?: boolean
|
|
19
|
-
onToggle?: (
|
|
17
|
+
defaultExpanded?: boolean;
|
|
18
|
+
expanded?: boolean;
|
|
19
|
+
onToggle?: (expanded: boolean) => void;
|
|
20
20
|
renderContent: (expanded: boolean) => ReactNode;
|
|
21
|
-
rowRef?:
|
|
21
|
+
rowRef?: Ref<HTMLTableRowElement>;
|
|
22
22
|
} & React.RefAttributes<HTMLTableRowElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../src/components/texpandable-row/Component.tsx"],"sourcesContent":["import React, { forwardRef, type ReactNode, type Ref, useState } from 'react';\nimport cn from 'classnames';\n\nimport { TRow, type TRowProps } from '../trow';\n\nimport styles from './index.module.css';\n\nexport type TExpandableRowProps = TRowProps & {\n defaultExpanded?: boolean;\n\n expanded?: boolean;\n\n onToggle?: (expanded: boolean) => void;\n\n renderContent: (expanded: boolean) => ReactNode;\n\n rowRef?: Ref<HTMLTableRowElement>;\n};\n\nexport const TExpandableRow = forwardRef<HTMLTableRowElement, TExpandableRowProps>(\n (\n {\n className,\n selected,\n expanded,\n defaultExpanded = false,\n onToggle = () => null,\n renderContent = () => null,\n rowRef,\n ...restProps\n }: TExpandableRowProps,\n ref,\n ) => {\n const [expandedState, setExpandedState] = useState<boolean>(defaultExpanded);\n\n const uncontrolled = expanded === undefined;\n\n const isExpanded = uncontrolled ? expandedState : expanded;\n\n const handleToggle = () => {\n if (uncontrolled) {\n setExpandedState(!isExpanded);\n }\n\n onToggle(isExpanded);\n };\n\n return (\n <React.Fragment>\n <TRow\n className={cn(styles.row, className, {\n [styles.selected]: selected,\n [styles.expanded]: isExpanded,\n })}\n selected={selected}\n onClick={handleToggle}\n ref={rowRef}\n {...restProps}\n />\n\n <tr ref={ref} className={cn(styles.expandable, { [styles.expanded]: isExpanded })}>\n {renderContent(isExpanded)}\n </tr>\n </React.Fragment>\n );\n },\n);\n\nTExpandableRow.displayName = 'TExpandableRow';\n"],"names":["forwardRef","__rest","useState","React","TRow","__assign","cn","styles"],"mappings":";;;;;;;;;;;;;;;IAmBa,cAAc,GAAGA,gBAAU,CACpC,UACI,EASsB,EACtB,GAAG,EAAA;;IATC,IAAA,SAAS,eAAA,EACT,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,EAAA,GAAA,EAAA,CAAA,eAAuB,EAAvB,eAAe,GAAA,EAAA,KAAA,MAAA,GAAG,KAAK,GAAA,EAAA,EACvB,gBAAqB,EAArB,QAAQ,mBAAG,YAAM,EAAA,OAAA,IAAI,CAAJ,EAAI,KAAA,EACrB,EAAA,GAAA,EAAA,CAAA,aAA0B,EAA1B,aAAa,GAAA,EAAA,KAAA,MAAA,GAAG,cAAM,OAAA,IAAI,GAAA,GAAA,EAAA,EAC1B,MAAM,GAAA,EAAA,CAAA,MAAA,EACH,SAAS,GAAAC,YAAA,CAAA,EAAA,EARhB,+FASC,CADe;IAIV,IAAA,EAAA,GAAoCC,cAAQ,CAAU,eAAe,CAAC,EAArE,aAAa,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,gBAAgB,GAAA,EAAA,CAAA,CAAA,CAAsC;AAE5E,IAAA,IAAM,YAAY,GAAG,QAAQ,KAAK,SAAS;IAE3C,IAAM,UAAU,GAAG,YAAY,GAAG,aAAa,GAAG,QAAQ;AAE1D,IAAA,IAAM,YAAY,GAAG,YAAA;
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../src/components/texpandable-row/Component.tsx"],"sourcesContent":["import React, { forwardRef, type ReactNode, type Ref, useState } from 'react';\nimport cn from 'classnames';\n\nimport { TRow, type TRowProps } from '../trow';\n\nimport styles from './index.module.css';\n\nexport type TExpandableRowProps = TRowProps & {\n defaultExpanded?: boolean;\n\n expanded?: boolean;\n\n onToggle?: (expanded: boolean) => void;\n\n renderContent: (expanded: boolean) => ReactNode;\n\n rowRef?: Ref<HTMLTableRowElement>;\n};\n\nexport const TExpandableRow = forwardRef<HTMLTableRowElement, TExpandableRowProps>(\n (\n {\n className,\n selected,\n expanded,\n defaultExpanded = false,\n onToggle = () => null,\n renderContent = () => null,\n rowRef,\n ...restProps\n }: TExpandableRowProps,\n ref,\n ) => {\n const [expandedState, setExpandedState] = useState<boolean>(defaultExpanded);\n\n const uncontrolled = expanded === undefined;\n\n const isExpanded = uncontrolled ? expandedState : expanded;\n\n const handleToggle = () => {\n if (uncontrolled) {\n setExpandedState(!isExpanded);\n }\n\n onToggle(isExpanded);\n };\n\n return (\n <React.Fragment>\n <TRow\n className={cn(styles.row, className, {\n [styles.selected]: selected,\n [styles.expanded]: isExpanded,\n })}\n selected={selected}\n onClick={handleToggle}\n ref={rowRef}\n {...restProps}\n />\n\n <tr ref={ref} className={cn(styles.expandable, { [styles.expanded]: isExpanded })}>\n {renderContent(isExpanded)}\n </tr>\n </React.Fragment>\n );\n },\n);\n\nTExpandableRow.displayName = 'TExpandableRow';\n"],"names":["forwardRef","__rest","useState","React","TRow","__assign","cn","styles"],"mappings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AAM,CAAC,QAAQ,CAAA,GAAG,UAAU;AAC/B,gBAAA,EAAA,EAAA,EACF,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,YAAY,EACrB,GAAG,EAAE,MAAM,EAAA,EACP,SAAS,CACf,CAAA;QAEFJ,sBAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,GAAG,EAAE,GAAG,EAAE,SAAS,EAAEG,mBAAE,CAACC,YAAM,CAAC,UAAU,GAAI,EAAA,GAAA,EAAA,EAAA,EAAA,CAACA,YAAM,CAAC,QAAQ,CAAA,GAAG,UAAU,EAAA,EAAA,EAAG,EAC5E,EAAA,aAAa,CAAC,UAAU,CAAC,CACzB,CACQ;AAEzB,CAAC;AAGL,cAAc,CAAC,WAAW,GAAG,gBAAgB;;;;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--gap-0: 0px;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
.table__row_147gv {
|
|
5
5
|
cursor: pointer;
|
|
6
6
|
}
|
|
7
|
-
.
|
|
7
|
+
.table__selected_147gv.table__expanded_147gv {
|
|
8
8
|
background-color: inherit;
|
|
9
9
|
}
|
|
10
|
-
.
|
|
10
|
+
.table__expanded_147gv:hover {
|
|
11
11
|
background-color: inherit;
|
|
12
12
|
}
|
|
13
|
-
.
|
|
13
|
+
.table__expandable_147gv td {
|
|
14
14
|
margin: var(--gap-0);
|
|
15
15
|
padding-top: var(--gap-0);
|
|
16
16
|
padding-bottom: var(--gap-0);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"row":"
|
|
5
|
+
var styles = {"row":"table__row_147gv","selected":"table__selected_147gv","expanded":"table__expanded_147gv","expandable":"table__expandable_147gv"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/texpandable-row/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/texpandable-row/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.row {\n cursor: pointer;\n}\n\n.selected.expanded {\n background-color: inherit;\n}\n\n.expanded {\n &:hover {\n background-color: inherit;\n }\n}\n\n.expandable {\n & td {\n margin: var(--gap-0);\n padding-top: var(--gap-0);\n padding-bottom: var(--gap-0);\n border: none;\n height: auto;\n }\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,KAAK,CAAC,kBAAkB,CAAC,UAAU,CAAC,uBAAuB,CAAC,UAAU,CAAC,uBAAuB,CAAC,YAAY,CAAC,yBAAyB,CAAC;;;;"}
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
--gap-0: 0px;
|
|
7
7
|
--gap-8: var(--gap-xs);
|
|
8
8
|
}
|
|
9
|
-
.
|
|
9
|
+
.table__component_cqqsp {
|
|
10
10
|
position: relative;
|
|
11
11
|
width: 100%;
|
|
12
12
|
box-sizing: border-box;
|
|
13
13
|
}
|
|
14
|
-
.
|
|
14
|
+
.table__component_cqqsp th:not(:last-child):not(:empty):after {
|
|
15
15
|
transition: opacity 0.2s;
|
|
16
16
|
position: absolute;
|
|
17
17
|
content: '';
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
bottom: var(--gap-8);
|
|
24
24
|
background-color: var(--color-light-neutral-400);
|
|
25
25
|
}
|
|
26
|
-
.
|
|
26
|
+
.table__component_cqqsp th:after {
|
|
27
27
|
opacity: 0;
|
|
28
28
|
}
|
|
29
|
-
.
|
|
29
|
+
.table__component_cqqsp:hover th:after {
|
|
30
30
|
opacity: 1;
|
|
31
31
|
}
|
|
32
|
-
.
|
|
32
|
+
.table__row_cqqsp {
|
|
33
33
|
height: 72px;
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/thead/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/thead/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.component {\n position: relative;\n width: 100%;\n box-sizing: border-box;\n\n & th:not(:last-child):not(:empty):after {\n transition: opacity 0.2s;\n position: absolute;\n content: '';\n display: block;\n\n width: 1px;\n right: var(--gap-0);\n top: var(--gap-8);\n bottom: var(--gap-8);\n background-color: var(--color-light-neutral-400);\n }\n\n & th:after {\n opacity: 0;\n }\n\n &:hover th:after {\n opacity: 1;\n }\n}\n\n.row {\n height: 72px;\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,WAAW,CAAC,wBAAwB,CAAC,KAAK,CAAC,kBAAkB,CAAC;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type ThHTMLAttributes } from 'react';
|
|
2
2
|
import { type TextAlignProperty } from '../../typings';
|
|
3
|
-
export
|
|
3
|
+
export type THeadCellProps = ThHTMLAttributes<HTMLHeadingElement> & {
|
|
4
4
|
/**
|
|
5
5
|
* Дополнительный класс
|
|
6
6
|
*/
|