@alfalab/core-components-table 1.1.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.
- package/CHANGELOG.md +11 -0
- package/dist/component.d.ts +24 -0
- package/dist/component.js +39 -0
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.js +38 -0
- package/dist/components/pagination/Component.d.ts +22 -0
- package/dist/components/pagination/Component.js +52 -0
- package/dist/components/pagination/index.css +49 -0
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/pagination/index.js +17 -0
- package/dist/components/pagination/select-field/index.css +20 -0
- package/dist/components/pagination/select-field/index.d.ts +3 -0
- package/dist/components/pagination/select-field/index.js +26 -0
- package/dist/components/table/Component.d.ts +56 -0
- package/dist/components/table/Component.js +42 -0
- package/dist/components/table/index.css +39 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/index.js +16 -0
- package/dist/components/table/utils.d.ts +5 -0
- package/dist/components/table/utils.js +27 -0
- package/dist/components/table-context/index.d.ts +18 -0
- package/dist/components/table-context/index.js +19 -0
- package/dist/components/tbody/Component.d.ts +15 -0
- package/dist/components/tbody/Component.js +22 -0
- package/dist/components/tbody/index.css +13 -0
- package/dist/components/tbody/index.d.ts +1 -0
- package/dist/components/tbody/index.js +12 -0
- package/dist/components/tcell/Component.d.ts +18 -0
- package/dist/components/tcell/Component.js +28 -0
- package/dist/components/tcell/index.css +42 -0
- package/dist/components/tcell/index.d.ts +1 -0
- package/dist/components/tcell/index.js +13 -0
- package/dist/components/texpandable-row/Component.d.ts +11 -0
- package/dist/components/texpandable-row/Component.js +38 -0
- package/dist/components/texpandable-row/index.css +24 -0
- package/dist/components/texpandable-row/index.d.ts +1 -0
- package/dist/components/texpandable-row/index.js +13 -0
- package/dist/components/thead/Component.d.ts +19 -0
- package/dist/components/thead/Component.js +23 -0
- package/dist/components/thead/index.css +38 -0
- package/dist/components/thead/index.d.ts +1 -0
- package/dist/components/thead/index.js +12 -0
- package/dist/components/thead-cell/Component.d.ts +27 -0
- package/dist/components/thead-cell/Component.js +22 -0
- package/dist/components/thead-cell/index.css +44 -0
- package/dist/components/thead-cell/index.d.ts +1 -0
- package/dist/components/thead-cell/index.js +12 -0
- package/dist/components/trow/Component.d.ts +28 -0
- package/dist/components/trow/Component.js +27 -0
- package/dist/components/trow/index.css +43 -0
- package/dist/components/trow/index.d.ts +1 -0
- package/dist/components/trow/index.js +12 -0
- package/dist/components/tsortable-head-cell/Component.d.ts +9 -0
- package/dist/components/tsortable-head-cell/Component.js +40 -0
- package/dist/components/tsortable-head-cell/index.css +46 -0
- package/dist/components/tsortable-head-cell/index.d.ts +1 -0
- package/dist/components/tsortable-head-cell/index.js +16 -0
- package/dist/components/tsortable-head-cell/sort-icon-asc.d.ts +5 -0
- package/dist/components/tsortable-head-cell/sort-icon-asc.js +15 -0
- package/dist/components/tsortable-head-cell/sort-icon-desc.d.ts +5 -0
- package/dist/components/tsortable-head-cell/sort-icon-desc.js +15 -0
- package/dist/components/tsortable-head-cell/sort-icon-unset.d.ts +5 -0
- package/dist/components/tsortable-head-cell/sort-icon-unset.js +15 -0
- package/dist/cssm/component.d.ts +24 -0
- package/dist/cssm/component.js +49 -0
- package/dist/cssm/components/index.d.ts +9 -0
- package/dist/cssm/components/index.js +48 -0
- package/dist/cssm/components/pagination/Component.d.ts +22 -0
- package/dist/cssm/components/pagination/Component.js +52 -0
- package/dist/cssm/components/pagination/index.d.ts +1 -0
- package/dist/cssm/components/pagination/index.js +19 -0
- package/dist/cssm/components/pagination/index.module.css +48 -0
- package/dist/cssm/components/pagination/select-field/index.d.ts +3 -0
- package/dist/cssm/components/pagination/select-field/index.js +25 -0
- package/dist/cssm/components/pagination/select-field/index.module.css +19 -0
- package/dist/cssm/components/table/Component.d.ts +56 -0
- package/dist/cssm/components/table/Component.js +42 -0
- package/dist/cssm/components/table/index.d.ts +1 -0
- package/dist/cssm/components/table/index.js +18 -0
- package/dist/cssm/components/table/index.module.css +38 -0
- package/dist/cssm/components/table/utils.d.ts +5 -0
- package/dist/cssm/components/table/utils.js +28 -0
- package/dist/cssm/components/table-context/index.d.ts +18 -0
- package/dist/cssm/components/table-context/index.js +19 -0
- package/dist/cssm/components/tbody/Component.d.ts +15 -0
- package/dist/cssm/components/tbody/Component.js +21 -0
- package/dist/cssm/components/tbody/index.d.ts +1 -0
- package/dist/cssm/components/tbody/index.js +13 -0
- package/dist/cssm/components/tbody/index.module.css +12 -0
- package/dist/cssm/components/tcell/Component.d.ts +18 -0
- package/dist/cssm/components/tcell/Component.js +27 -0
- package/dist/cssm/components/tcell/index.d.ts +1 -0
- package/dist/cssm/components/tcell/index.js +14 -0
- package/dist/cssm/components/tcell/index.module.css +41 -0
- package/dist/cssm/components/texpandable-row/Component.d.ts +11 -0
- package/dist/cssm/components/texpandable-row/Component.js +38 -0
- package/dist/cssm/components/texpandable-row/index.d.ts +1 -0
- package/dist/cssm/components/texpandable-row/index.js +15 -0
- package/dist/cssm/components/texpandable-row/index.module.css +23 -0
- package/dist/cssm/components/thead/Component.d.ts +19 -0
- package/dist/cssm/components/thead/Component.js +22 -0
- package/dist/cssm/components/thead/index.d.ts +1 -0
- package/dist/cssm/components/thead/index.js +13 -0
- package/dist/cssm/components/thead/index.module.css +37 -0
- package/dist/cssm/components/thead-cell/Component.d.ts +27 -0
- package/dist/cssm/components/thead-cell/Component.js +21 -0
- package/dist/cssm/components/thead-cell/index.d.ts +1 -0
- package/dist/cssm/components/thead-cell/index.js +13 -0
- package/dist/cssm/components/thead-cell/index.module.css +43 -0
- package/dist/cssm/components/trow/Component.d.ts +28 -0
- package/dist/cssm/components/trow/Component.js +26 -0
- package/dist/cssm/components/trow/index.d.ts +1 -0
- package/dist/cssm/components/trow/index.js +13 -0
- package/dist/cssm/components/trow/index.module.css +42 -0
- package/dist/cssm/components/tsortable-head-cell/Component.d.ts +9 -0
- package/dist/cssm/components/tsortable-head-cell/Component.js +40 -0
- package/dist/cssm/components/tsortable-head-cell/index.d.ts +1 -0
- package/dist/cssm/components/tsortable-head-cell/index.js +18 -0
- package/dist/cssm/components/tsortable-head-cell/index.module.css +45 -0
- package/dist/cssm/components/tsortable-head-cell/sort-icon-asc.d.ts +5 -0
- package/dist/cssm/components/tsortable-head-cell/sort-icon-asc.js +15 -0
- package/dist/cssm/components/tsortable-head-cell/sort-icon-desc.d.ts +5 -0
- package/dist/cssm/components/tsortable-head-cell/sort-icon-desc.js +15 -0
- package/dist/cssm/components/tsortable-head-cell/sort-icon-unset.d.ts +5 -0
- package/dist/cssm/components/tsortable-head-cell/sort-icon-unset.js +15 -0
- package/dist/cssm/index.d.ts +1 -0
- package/dist/cssm/index.js +41 -0
- package/dist/cssm/tslib.es6-ce870b46.d.ts +32 -0
- package/dist/cssm/tslib.es6-ce870b46.js +42 -0
- package/dist/cssm/typings.d.ts +2 -0
- package/dist/cssm/typings.js +2 -0
- package/dist/cssm/utils.d.ts +4 -0
- package/dist/cssm/utils.js +16 -0
- package/dist/esm/component.d.ts +24 -0
- package/dist/esm/component.js +35 -0
- package/dist/esm/components/index.d.ts +9 -0
- package/dist/esm/components/index.js +22 -0
- package/dist/esm/components/pagination/Component.d.ts +22 -0
- package/dist/esm/components/pagination/Component.js +43 -0
- package/dist/esm/components/pagination/index.css +49 -0
- package/dist/esm/components/pagination/index.d.ts +1 -0
- package/dist/esm/components/pagination/index.js +9 -0
- package/dist/esm/components/pagination/select-field/index.css +20 -0
- package/dist/esm/components/pagination/select-field/index.d.ts +3 -0
- package/dist/esm/components/pagination/select-field/index.js +17 -0
- package/dist/esm/components/table/Component.d.ts +56 -0
- package/dist/esm/components/table/Component.js +33 -0
- package/dist/esm/components/table/index.css +39 -0
- package/dist/esm/components/table/index.d.ts +1 -0
- package/dist/esm/components/table/index.js +8 -0
- package/dist/esm/components/table/utils.d.ts +5 -0
- package/dist/esm/components/table/utils.js +19 -0
- package/dist/esm/components/table-context/index.d.ts +18 -0
- package/dist/esm/components/table-context/index.js +10 -0
- package/dist/esm/components/tbody/Component.d.ts +15 -0
- package/dist/esm/components/tbody/Component.js +13 -0
- package/dist/esm/components/tbody/index.css +13 -0
- package/dist/esm/components/tbody/index.d.ts +1 -0
- package/dist/esm/components/tbody/index.js +4 -0
- package/dist/esm/components/tcell/Component.d.ts +18 -0
- package/dist/esm/components/tcell/Component.js +19 -0
- package/dist/esm/components/tcell/index.css +42 -0
- package/dist/esm/components/tcell/index.d.ts +1 -0
- package/dist/esm/components/tcell/index.js +5 -0
- package/dist/esm/components/texpandable-row/Component.d.ts +11 -0
- package/dist/esm/components/texpandable-row/Component.js +29 -0
- package/dist/esm/components/texpandable-row/index.css +24 -0
- package/dist/esm/components/texpandable-row/index.d.ts +1 -0
- package/dist/esm/components/texpandable-row/index.js +5 -0
- package/dist/esm/components/thead/Component.d.ts +19 -0
- package/dist/esm/components/thead/Component.js +14 -0
- package/dist/esm/components/thead/index.css +38 -0
- package/dist/esm/components/thead/index.d.ts +1 -0
- package/dist/esm/components/thead/index.js +4 -0
- package/dist/esm/components/thead-cell/Component.d.ts +27 -0
- package/dist/esm/components/thead-cell/Component.js +13 -0
- package/dist/esm/components/thead-cell/index.css +44 -0
- package/dist/esm/components/thead-cell/index.d.ts +1 -0
- package/dist/esm/components/thead-cell/index.js +4 -0
- package/dist/esm/components/trow/Component.d.ts +28 -0
- package/dist/esm/components/trow/Component.js +18 -0
- package/dist/esm/components/trow/index.css +43 -0
- package/dist/esm/components/trow/index.d.ts +1 -0
- package/dist/esm/components/trow/index.js +4 -0
- package/dist/esm/components/tsortable-head-cell/Component.d.ts +9 -0
- package/dist/esm/components/tsortable-head-cell/Component.js +31 -0
- package/dist/esm/components/tsortable-head-cell/index.css +46 -0
- package/dist/esm/components/tsortable-head-cell/index.d.ts +1 -0
- package/dist/esm/components/tsortable-head-cell/index.js +8 -0
- package/dist/esm/components/tsortable-head-cell/sort-icon-asc.d.ts +5 -0
- package/dist/esm/components/tsortable-head-cell/sort-icon-asc.js +7 -0
- package/dist/esm/components/tsortable-head-cell/sort-icon-desc.d.ts +5 -0
- package/dist/esm/components/tsortable-head-cell/sort-icon-desc.js +7 -0
- package/dist/esm/components/tsortable-head-cell/sort-icon-unset.d.ts +5 -0
- package/dist/esm/components/tsortable-head-cell/sort-icon-unset.js +7 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +23 -0
- package/dist/esm/tslib.es6-f3c5f2e2.d.ts +32 -0
- package/dist/esm/tslib.es6-f3c5f2e2.js +40 -0
- package/dist/esm/typings.d.ts +2 -0
- package/dist/esm/typings.js +1 -0
- package/dist/esm/utils.d.ts +4 -0
- package/dist/esm/utils.js +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +31 -0
- package/dist/modern/component.d.ts +24 -0
- package/dist/modern/component.js +34 -0
- package/dist/modern/components/index.d.ts +9 -0
- package/dist/modern/components/index.js +21 -0
- package/dist/modern/components/pagination/Component.d.ts +22 -0
- package/dist/modern/components/pagination/Component.js +38 -0
- package/dist/modern/components/pagination/index.css +49 -0
- package/dist/modern/components/pagination/index.d.ts +1 -0
- package/dist/modern/components/pagination/index.js +8 -0
- package/dist/modern/components/pagination/select-field/index.css +20 -0
- package/dist/modern/components/pagination/select-field/index.d.ts +3 -0
- package/dist/modern/components/pagination/select-field/index.js +14 -0
- package/dist/modern/components/table/Component.d.ts +56 -0
- package/dist/modern/components/table/Component.js +28 -0
- package/dist/modern/components/table/index.css +39 -0
- package/dist/modern/components/table/index.d.ts +1 -0
- package/dist/modern/components/table/index.js +7 -0
- package/dist/modern/components/table/utils.d.ts +5 -0
- package/dist/modern/components/table/utils.js +18 -0
- package/dist/modern/components/table-context/index.d.ts +18 -0
- package/dist/modern/components/table-context/index.js +10 -0
- package/dist/modern/components/tbody/Component.d.ts +15 -0
- package/dist/modern/components/tbody/Component.js +11 -0
- package/dist/modern/components/tbody/index.css +13 -0
- package/dist/modern/components/tbody/index.d.ts +1 -0
- package/dist/modern/components/tbody/index.js +3 -0
- package/dist/modern/components/tcell/Component.d.ts +18 -0
- package/dist/modern/components/tcell/Component.js +17 -0
- package/dist/modern/components/tcell/index.css +42 -0
- package/dist/modern/components/tcell/index.d.ts +1 -0
- package/dist/modern/components/tcell/index.js +4 -0
- package/dist/modern/components/texpandable-row/Component.d.ts +11 -0
- package/dist/modern/components/texpandable-row/Component.js +26 -0
- package/dist/modern/components/texpandable-row/index.css +24 -0
- package/dist/modern/components/texpandable-row/index.d.ts +1 -0
- package/dist/modern/components/texpandable-row/index.js +4 -0
- package/dist/modern/components/thead/Component.d.ts +19 -0
- package/dist/modern/components/thead/Component.js +12 -0
- package/dist/modern/components/thead/index.css +38 -0
- package/dist/modern/components/thead/index.d.ts +1 -0
- package/dist/modern/components/thead/index.js +3 -0
- package/dist/modern/components/thead-cell/Component.d.ts +27 -0
- package/dist/modern/components/thead-cell/Component.js +9 -0
- package/dist/modern/components/thead-cell/index.css +44 -0
- package/dist/modern/components/thead-cell/index.d.ts +1 -0
- package/dist/modern/components/thead-cell/index.js +3 -0
- package/dist/modern/components/trow/Component.d.ts +28 -0
- package/dist/modern/components/trow/Component.js +13 -0
- package/dist/modern/components/trow/index.css +43 -0
- package/dist/modern/components/trow/index.d.ts +1 -0
- package/dist/modern/components/trow/index.js +3 -0
- package/dist/modern/components/tsortable-head-cell/Component.d.ts +9 -0
- package/dist/modern/components/tsortable-head-cell/Component.js +28 -0
- package/dist/modern/components/tsortable-head-cell/index.css +46 -0
- package/dist/modern/components/tsortable-head-cell/index.d.ts +1 -0
- package/dist/modern/components/tsortable-head-cell/index.js +7 -0
- package/dist/modern/components/tsortable-head-cell/sort-icon-asc.d.ts +5 -0
- package/dist/modern/components/tsortable-head-cell/sort-icon-asc.js +6 -0
- package/dist/modern/components/tsortable-head-cell/sort-icon-desc.d.ts +5 -0
- package/dist/modern/components/tsortable-head-cell/sort-icon-desc.js +6 -0
- package/dist/modern/components/tsortable-head-cell/sort-icon-unset.d.ts +5 -0
- package/dist/modern/components/tsortable-head-cell/sort-icon-unset.js +6 -0
- package/dist/modern/index.d.ts +1 -0
- package/dist/modern/index.js +22 -0
- package/dist/modern/typings.d.ts +2 -0
- package/dist/modern/typings.js +1 -0
- package/dist/modern/utils.d.ts +4 -0
- package/dist/modern/utils.js +8 -0
- package/dist/send-stats.js +82 -0
- package/dist/tslib.es6-2f687e1c.d.ts +32 -0
- package/dist/tslib.es6-2f687e1c.js +42 -0
- package/dist/typings.d.ts +2 -0
- package/dist/typings.js +2 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.js +16 -0
- package/package.json +26 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# 1.1.0 (2021-12-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **table:** компоненты для построения таблиц ([#911](https://github.com/alfa-laboratory/core-components/issues/911)) ([4ac648a](https://github.com/alfa-laboratory/core-components/commit/4ac648abd4de08bf68babc2f122f432d5b14080e))
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const Table: import("react").ForwardRefExoticComponent<import("react").TableHTMLAttributes<HTMLTableElement> & {
|
|
3
|
+
compactView?: boolean | undefined;
|
|
4
|
+
className?: string | undefined;
|
|
5
|
+
children: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, string | any | (new (props: any) => import("react").Component<any, any, any>)> | null) | (new (props: any) => import("react").Component<any, any, any>)>[];
|
|
6
|
+
wrapper?: boolean | undefined;
|
|
7
|
+
pagination?: import("react").ReactNode;
|
|
8
|
+
dataTestId?: string | undefined;
|
|
9
|
+
} & import("react").RefAttributes<HTMLTableElement>> & {
|
|
10
|
+
TBody: import("react").FC<import("./components/index").TBodyProps>;
|
|
11
|
+
THead: import("react").FC<import("./components/index").THeadProps>;
|
|
12
|
+
THeadCell: ({ children, className, dataTestId, style, width, textAlign, hidden, ...restProps }: import("./components/index").THeadCellProps) => JSX.Element;
|
|
13
|
+
TSortableHeadCell: ({ children, className, defaultIsSortedDesc, isSortedDesc, textAlign, onSort, ...restProps }: import("./components/index").TSortableHeadCellProps) => JSX.Element;
|
|
14
|
+
TCell: ({ className, style, dataTestId, children, index, ...restProps }: import("./components/index").TCellProps) => JSX.Element;
|
|
15
|
+
TRow: ({ children, className, selected, withoutBorder, dataTestId, ...restProps }: import("./components/index").TRowProps) => JSX.Element;
|
|
16
|
+
TExpandableRow: ({ className, selected, expanded, defaultExpanded, onToggle, renderContent, ...restProps }: import("./components/index").TExpandableRowProps) => JSX.Element;
|
|
17
|
+
Pagination: import("react").FC<import("packages/pagination/src").PaginationProps & {
|
|
18
|
+
perPage?: number | undefined;
|
|
19
|
+
possiblePerPage?: number[] | undefined;
|
|
20
|
+
onPerPageChange?: ((perPage: number) => void) | undefined;
|
|
21
|
+
dataTestId?: string | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
24
|
+
export { Table };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('./tslib.es6-2f687e1c.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
var components_thead_Component = require('./components/thead/Component.js');
|
|
9
|
+
require('./utils.js');
|
|
10
|
+
require('./components/table/utils.js');
|
|
11
|
+
require('./components/table-context/index.js');
|
|
12
|
+
var components_table_Component = require('./components/table/Component.js');
|
|
13
|
+
require('@alfalab/core-components-select');
|
|
14
|
+
require('@alfalab/core-components-pagination');
|
|
15
|
+
require('@alfalab/core-components-button');
|
|
16
|
+
require('./components/pagination/select-field/index.js');
|
|
17
|
+
var components_pagination_Component = require('./components/pagination/Component.js');
|
|
18
|
+
var components_theadCell_Component = require('./components/thead-cell/Component.js');
|
|
19
|
+
var components_tsortableHeadCell_Component = require('./components/tsortable-head-cell/Component.js');
|
|
20
|
+
require('./components/tsortable-head-cell/sort-icon-asc.js');
|
|
21
|
+
require('./components/tsortable-head-cell/sort-icon-desc.js');
|
|
22
|
+
require('./components/tsortable-head-cell/sort-icon-unset.js');
|
|
23
|
+
var components_tbody_Component = require('./components/tbody/Component.js');
|
|
24
|
+
var components_tcell_Component = require('./components/tcell/Component.js');
|
|
25
|
+
var components_trow_Component = require('./components/trow/Component.js');
|
|
26
|
+
var components_texpandableRow_Component = require('./components/texpandable-row/Component.js');
|
|
27
|
+
|
|
28
|
+
var Table = Object.assign(components_table_Component.Table, {
|
|
29
|
+
TBody: components_tbody_Component.TBody,
|
|
30
|
+
THead: components_thead_Component.THead,
|
|
31
|
+
THeadCell: components_theadCell_Component.THeadCell,
|
|
32
|
+
TSortableHeadCell: components_tsortableHeadCell_Component.TSortableHeadCell,
|
|
33
|
+
TCell: components_tcell_Component.TCell,
|
|
34
|
+
TRow: components_trow_Component.TRow,
|
|
35
|
+
TExpandableRow: components_texpandableRow_Component.TExpandableRow,
|
|
36
|
+
Pagination: components_pagination_Component.Pagination,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
exports.Table = Table;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./table/index";
|
|
2
|
+
export * from "./pagination/index";
|
|
3
|
+
export * from "./thead/index";
|
|
4
|
+
export * from "./thead-cell/index";
|
|
5
|
+
export * from "./tsortable-head-cell/index";
|
|
6
|
+
export * from "./tbody/index";
|
|
7
|
+
export * from "./tcell/index";
|
|
8
|
+
export * from "./trow/index";
|
|
9
|
+
export * from "./texpandable-row/index";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('../tslib.es6-2f687e1c.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
var components_thead_Component = require('./thead/Component.js');
|
|
9
|
+
require('../utils.js');
|
|
10
|
+
require('./table/utils.js');
|
|
11
|
+
require('./table-context/index.js');
|
|
12
|
+
var components_table_Component = require('./table/Component.js');
|
|
13
|
+
require('@alfalab/core-components-select');
|
|
14
|
+
require('@alfalab/core-components-pagination');
|
|
15
|
+
require('@alfalab/core-components-button');
|
|
16
|
+
require('./pagination/select-field/index.js');
|
|
17
|
+
var components_pagination_Component = require('./pagination/Component.js');
|
|
18
|
+
var components_theadCell_Component = require('./thead-cell/Component.js');
|
|
19
|
+
var components_tsortableHeadCell_Component = require('./tsortable-head-cell/Component.js');
|
|
20
|
+
require('./tsortable-head-cell/sort-icon-asc.js');
|
|
21
|
+
require('./tsortable-head-cell/sort-icon-desc.js');
|
|
22
|
+
require('./tsortable-head-cell/sort-icon-unset.js');
|
|
23
|
+
var components_tbody_Component = require('./tbody/Component.js');
|
|
24
|
+
var components_tcell_Component = require('./tcell/Component.js');
|
|
25
|
+
var components_trow_Component = require('./trow/Component.js');
|
|
26
|
+
var components_texpandableRow_Component = require('./texpandable-row/Component.js');
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
exports.THead = components_thead_Component.THead;
|
|
31
|
+
exports.Table = components_table_Component.Table;
|
|
32
|
+
exports.Pagination = components_pagination_Component.Pagination;
|
|
33
|
+
exports.THeadCell = components_theadCell_Component.THeadCell;
|
|
34
|
+
exports.TSortableHeadCell = components_tsortableHeadCell_Component.TSortableHeadCell;
|
|
35
|
+
exports.TBody = components_tbody_Component.TBody;
|
|
36
|
+
exports.TCell = components_tcell_Component.TCell;
|
|
37
|
+
exports.TRow = components_trow_Component.TRow;
|
|
38
|
+
exports.TExpandableRow = components_texpandableRow_Component.TExpandableRow;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { PaginationProps as CorePaginationProps } from "@alfalab/core-components-pagination";
|
|
3
|
+
type PaginationProps = CorePaginationProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Количество строк на страницу
|
|
6
|
+
*/
|
|
7
|
+
perPage?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Возможные варианты разбивки
|
|
10
|
+
*/
|
|
11
|
+
possiblePerPage?: number[];
|
|
12
|
+
/**
|
|
13
|
+
* Обработчик переключения perPage
|
|
14
|
+
*/
|
|
15
|
+
onPerPageChange?: (perPage: number) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
18
|
+
*/
|
|
19
|
+
dataTestId?: string;
|
|
20
|
+
};
|
|
21
|
+
declare const Pagination: FC<PaginationProps>;
|
|
22
|
+
export { Pagination };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-2f687e1c.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var cn = require('classnames');
|
|
8
|
+
var components_tableContext_index = require('../table-context/index.js');
|
|
9
|
+
var coreComponentsSelect = require('@alfalab/core-components-select');
|
|
10
|
+
var coreComponentsPagination = require('@alfalab/core-components-pagination');
|
|
11
|
+
require('@alfalab/core-components-button');
|
|
12
|
+
var components_pagination_selectField_index = require('./select-field/index.js');
|
|
13
|
+
|
|
14
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
+
|
|
16
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
|
+
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
18
|
+
|
|
19
|
+
var styles = {"component":"table__component_ylny0","pagesWrapper":"table__pagesWrapper_ylny0","tag":"table__tag_ylny0","tagActive":"table__tagActive_ylny0","menu":"table__menu_ylny0","option":"table__option_ylny0"};
|
|
20
|
+
require('./index.css')
|
|
21
|
+
|
|
22
|
+
var Pagination = function (_a) {
|
|
23
|
+
var _b = _a.perPage, perPage = _b === void 0 ? 25 : _b, _c = _a.possiblePerPage, possiblePerPage = _c === void 0 ? [25, 50, 100] : _c, _d = _a.onPerPageChange, onPerPageChange = _d === void 0 ? function () { return null; } : _d, pagesCount = _a.pagesCount, _e = _a.onPageChange, onPageChange = _e === void 0 ? function () { return null; } : _e, className = _a.className, dataTestId = _a.dataTestId, restPaginationProps = tslib_es6.__rest(_a, ["perPage", "possiblePerPage", "onPerPageChange", "pagesCount", "onPageChange", "className", "dataTestId"]);
|
|
24
|
+
var wrapperRef = React.useContext(components_tableContext_index.TableContext).wrapperRef;
|
|
25
|
+
var options = React.useMemo(function () {
|
|
26
|
+
return Array.from(new Set(possiblePerPage.concat(perPage)))
|
|
27
|
+
.sort(function (a, b) { return a - b; })
|
|
28
|
+
.map(function (value) { return ({
|
|
29
|
+
key: value.toString(),
|
|
30
|
+
content: "\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043F\u043E " + value,
|
|
31
|
+
}); });
|
|
32
|
+
}, [perPage, possiblePerPage]);
|
|
33
|
+
var handlePerPageChange = React.useCallback(function (_a) {
|
|
34
|
+
var selected = _a.selected;
|
|
35
|
+
onPerPageChange(Number(selected === null || selected === void 0 ? void 0 : selected.key));
|
|
36
|
+
}, [onPerPageChange]);
|
|
37
|
+
var handlePageChange = React.useCallback(function (pageIndex) {
|
|
38
|
+
onPageChange(pageIndex);
|
|
39
|
+
setTimeout(function () {
|
|
40
|
+
if (wrapperRef.current) {
|
|
41
|
+
wrapperRef.current.scrollIntoView();
|
|
42
|
+
}
|
|
43
|
+
}, 0);
|
|
44
|
+
}, [onPageChange, wrapperRef]);
|
|
45
|
+
if (pagesCount <= 1)
|
|
46
|
+
return null;
|
|
47
|
+
return (React__default['default'].createElement("div", { className: cn__default['default'](styles.component, className), "data-test-id": dataTestId },
|
|
48
|
+
React__default['default'].createElement(coreComponentsSelect.Select, { options: options, selected: perPage.toString(), onChange: handlePerPageChange, preventFlip: false, size: 's', className: styles.select, optionsListClassName: styles.menu, optionClassName: styles.option, Field: components_pagination_selectField_index.CustomSelectField }),
|
|
49
|
+
React__default['default'].createElement(coreComponentsPagination.Pagination, tslib_es6.__assign({ pagesCount: pagesCount, onPageChange: handlePageChange }, restPaginationProps))));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
exports.Pagination = Pagination;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* hash: 6rusb */
|
|
2
|
+
:root {
|
|
3
|
+
--color-light-border-primary: #dbdee1;
|
|
4
|
+
}
|
|
5
|
+
:root {
|
|
6
|
+
|
|
7
|
+
/* Hard */
|
|
8
|
+
|
|
9
|
+
/* Up */
|
|
10
|
+
|
|
11
|
+
/* Hard up */
|
|
12
|
+
}
|
|
13
|
+
:root {
|
|
14
|
+
--gap-2xs: 4px;
|
|
15
|
+
--gap-xs: 8px;
|
|
16
|
+
--gap-m: 16px;
|
|
17
|
+
--gap-xl: 24px;
|
|
18
|
+
--gap-2xl: 32px;
|
|
19
|
+
}
|
|
20
|
+
.table__component_ylny0 {
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
align-items: flex-start;
|
|
24
|
+
width: 100%;
|
|
25
|
+
padding: var(--gap-xl) var(--gap-m) var(--gap-2xl);
|
|
26
|
+
border-top: 1px solid var(--color-light-border-primary);
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
}
|
|
29
|
+
.table__pagesWrapper_ylny0 {
|
|
30
|
+
display: flex;
|
|
31
|
+
}
|
|
32
|
+
.table__tag_ylny0.table__tag_ylny0 {
|
|
33
|
+
flex-shrink: 0;
|
|
34
|
+
margin-right: var(--gap-xs);
|
|
35
|
+
padding: 0 var(--gap-xs);
|
|
36
|
+
min-width: 32px
|
|
37
|
+
}
|
|
38
|
+
.table__tag_ylny0.table__tag_ylny0:last-child {
|
|
39
|
+
margin-right: 0;
|
|
40
|
+
}
|
|
41
|
+
.table__tag_ylny0.table__tag_ylny0.table__tagActive_ylny0 {
|
|
42
|
+
cursor: default;
|
|
43
|
+
}
|
|
44
|
+
.table__menu_ylny0 {
|
|
45
|
+
margin: var(--gap-2xs) 0;
|
|
46
|
+
}
|
|
47
|
+
.table__option_ylny0 {
|
|
48
|
+
min-width: 208px;
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('../../tslib.es6-2f687e1c.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('../table-context/index.js');
|
|
9
|
+
require('@alfalab/core-components-select');
|
|
10
|
+
require('@alfalab/core-components-pagination');
|
|
11
|
+
require('@alfalab/core-components-button');
|
|
12
|
+
require('./select-field/index.js');
|
|
13
|
+
var components_pagination_Component = require('./Component.js');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
exports.Pagination = components_pagination_Component.Pagination;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* hash: l0bps */
|
|
2
|
+
:root {
|
|
3
|
+
--color-light-specialbg-component-shade-7: rgba(10, 29, 49, 0.1351);
|
|
4
|
+
}
|
|
5
|
+
:root {
|
|
6
|
+
|
|
7
|
+
/* Hard */
|
|
8
|
+
|
|
9
|
+
/* Up */
|
|
10
|
+
|
|
11
|
+
/* Hard up */
|
|
12
|
+
}
|
|
13
|
+
.table__field_1dkl5 svg {
|
|
14
|
+
width: 18px;
|
|
15
|
+
height: 18px;
|
|
16
|
+
}
|
|
17
|
+
.table__open_1dkl5,
|
|
18
|
+
.table__open_1dkl5:hover {
|
|
19
|
+
background-color: var(--color-light-specialbg-component-shade-7);
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../../tslib.es6-2f687e1c.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var cn = require('classnames');
|
|
8
|
+
var coreComponentsButton = require('@alfalab/core-components-button');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
|
+
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
14
|
+
|
|
15
|
+
var styles = {"field":"table__field_1dkl5","open":"table__open_1dkl5"};
|
|
16
|
+
require('./index.css')
|
|
17
|
+
|
|
18
|
+
var CustomSelectField = function (_a) {
|
|
19
|
+
var _b;
|
|
20
|
+
var selected = _a.selected, innerProps = _a.innerProps, Arrow = _a.Arrow, open = _a.open;
|
|
21
|
+
var ref = innerProps.ref, restInnerProps = tslib_es6.__rest(innerProps, ["ref"]);
|
|
22
|
+
return (React__default['default'].createElement("div", { ref: ref },
|
|
23
|
+
React__default['default'].createElement(coreComponentsButton.Button, tslib_es6.__assign({}, restInnerProps, { size: 'xxs', view: 'link', className: cn__default['default'](styles.field, (_b = {}, _b[styles.open] = open, _b)), rightAddons: Arrow }), selected === null || selected === void 0 ? void 0 : selected.content)));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.CustomSelectField = CustomSelectField;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TableHTMLAttributes, ReactNode } from "react";
|
|
4
|
+
type TableProps = TableHTMLAttributes<HTMLTableElement> & {
|
|
5
|
+
/**
|
|
6
|
+
* Компактный вид
|
|
7
|
+
*/
|
|
8
|
+
compactView?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Дополнительный класс
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Дочерние компоненты
|
|
15
|
+
*/
|
|
16
|
+
children: React.ReactElement[];
|
|
17
|
+
/**
|
|
18
|
+
* Оборачивает таблицу в стилизованный контейнер
|
|
19
|
+
*/
|
|
20
|
+
wrapper?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Слот для пагинации
|
|
23
|
+
*/
|
|
24
|
+
pagination?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
27
|
+
*/
|
|
28
|
+
dataTestId?: string;
|
|
29
|
+
};
|
|
30
|
+
declare const Table: React.ForwardRefExoticComponent<React.TableHTMLAttributes<HTMLTableElement> & {
|
|
31
|
+
/**
|
|
32
|
+
* Компактный вид
|
|
33
|
+
*/
|
|
34
|
+
compactView?: boolean | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Дополнительный класс
|
|
37
|
+
*/
|
|
38
|
+
className?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Дочерние компоненты
|
|
41
|
+
*/
|
|
42
|
+
children: React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>[];
|
|
43
|
+
/**
|
|
44
|
+
* Оборачивает таблицу в стилизованный контейнер
|
|
45
|
+
*/
|
|
46
|
+
wrapper?: boolean | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Слот для пагинации
|
|
49
|
+
*/
|
|
50
|
+
pagination?: React.ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
53
|
+
*/
|
|
54
|
+
dataTestId?: string | undefined;
|
|
55
|
+
} & React.RefAttributes<HTMLTableElement>>;
|
|
56
|
+
export { TableProps, Table };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-2f687e1c.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var cn = require('classnames');
|
|
8
|
+
require('../thead/Component.js');
|
|
9
|
+
require('../../utils.js');
|
|
10
|
+
var components_table_utils = require('./utils.js');
|
|
11
|
+
var components_tableContext_index = require('../table-context/index.js');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
+
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
17
|
+
|
|
18
|
+
var styles = {"component":"table__component_1h56f","wrapper":"table__wrapper_1h56f","hasPagination":"table__hasPagination_1h56f","table":"table__table_1h56f"};
|
|
19
|
+
require('./index.css')
|
|
20
|
+
|
|
21
|
+
var Table = React.forwardRef(function (_a, ref) {
|
|
22
|
+
var _b;
|
|
23
|
+
var className = _a.className, children = _a.children, _c = _a.compactView, compactView = _c === void 0 ? false : _c, _d = _a.wrapper, wrapper = _d === void 0 ? true : _d, pagination = _a.pagination, dataTestId = _a.dataTestId, restProps = tslib_es6.__rest(_a, ["className", "children", "compactView", "wrapper", "pagination", "dataTestId"]);
|
|
24
|
+
var wrapperRef = React.useRef(null);
|
|
25
|
+
var columnsConfiguration = React.useMemo(function () {
|
|
26
|
+
return components_table_utils.findAllHeadCellsProps(children).map(function (columnProps, index) { return ({
|
|
27
|
+
width: columnProps.width,
|
|
28
|
+
textAlign: columnProps.textAlign,
|
|
29
|
+
hidden: columnProps.hidden,
|
|
30
|
+
index: index,
|
|
31
|
+
}); });
|
|
32
|
+
}, [children]);
|
|
33
|
+
return (React__default['default'].createElement(components_tableContext_index.TableContext.Provider, { value: { columnsConfiguration: columnsConfiguration, compactView: compactView, wrapperRef: wrapperRef } },
|
|
34
|
+
React__default['default'].createElement("div", { ref: wrapperRef, className: cn__default['default'](styles.component, className, (_b = {},
|
|
35
|
+
_b[styles.wrapper] = wrapper,
|
|
36
|
+
_b[styles.hasPagination] = !!pagination,
|
|
37
|
+
_b)), "data-test-id": dataTestId },
|
|
38
|
+
React__default['default'].createElement("table", tslib_es6.__assign({ ref: ref, className: styles.table }, restProps), children),
|
|
39
|
+
pagination)));
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
exports.Table = Table;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* hash: oj997 */
|
|
2
|
+
:root {
|
|
3
|
+
--color-light-bg-primary: #fff;
|
|
4
|
+
}
|
|
5
|
+
:root {
|
|
6
|
+
|
|
7
|
+
/* Hard */
|
|
8
|
+
--shadow-xs-hard: 0 0 4px rgba(11, 31, 53, 0.02), 0 2px 4px rgba(11, 31, 53, 0.04),
|
|
9
|
+
0 2px 4px rgba(11, 31, 53, 0.16);
|
|
10
|
+
|
|
11
|
+
/* Up */
|
|
12
|
+
|
|
13
|
+
/* Hard up */
|
|
14
|
+
}
|
|
15
|
+
:root {
|
|
16
|
+
--gap-m: 16px;
|
|
17
|
+
}
|
|
18
|
+
:root {
|
|
19
|
+
--border-radius-m: 8px;
|
|
20
|
+
}
|
|
21
|
+
.table__component_1h56f {
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
}
|
|
24
|
+
.table__wrapper_1h56f {
|
|
25
|
+
padding: 0 var(--gap-m) var(--gap-m);
|
|
26
|
+
background: var(--color-light-bg-primary);
|
|
27
|
+
box-shadow: var(--shadow-xs-hard);
|
|
28
|
+
border-radius: var(--border-radius-m);
|
|
29
|
+
}
|
|
30
|
+
.table__hasPagination_1h56f {
|
|
31
|
+
padding-bottom: 0;
|
|
32
|
+
}
|
|
33
|
+
.table__table_1h56f {
|
|
34
|
+
width: 100%;
|
|
35
|
+
border-collapse: collapse;
|
|
36
|
+
box-sizing: border-box
|
|
37
|
+
|
|
38
|
+
/* TODO: Хак для выравнивания чекбокса */
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('../../tslib.es6-2f687e1c.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('../thead/Component.js');
|
|
9
|
+
require('../../utils.js');
|
|
10
|
+
require('./utils.js');
|
|
11
|
+
require('../table-context/index.js');
|
|
12
|
+
var components_table_Component = require('./Component.js');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.Table = components_table_Component.Table;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('../../tslib.es6-2f687e1c.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
var components_thead_Component = require('../thead/Component.js');
|
|
9
|
+
var utils = require('../../utils.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
+
|
|
15
|
+
function findAllHeadCellsProps(children) {
|
|
16
|
+
var result = [];
|
|
17
|
+
React__default['default'].Children.forEach(children, function (child) {
|
|
18
|
+
if (utils.isChildInstanceOf(child, components_thead_Component.THead)) {
|
|
19
|
+
React__default['default'].Children.forEach(child.props.children, function (headChild) {
|
|
20
|
+
result.push(headChild.props);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
exports.findAllHeadCellsProps = findAllHeadCellsProps;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { RefObject } from "react";
|
|
4
|
+
import { TextAlignProperty } from "../../typings";
|
|
5
|
+
type ColumnConfiguration = {
|
|
6
|
+
width?: string | number;
|
|
7
|
+
textAlign?: TextAlignProperty;
|
|
8
|
+
hidden?: boolean;
|
|
9
|
+
index: number;
|
|
10
|
+
};
|
|
11
|
+
type TableContextType = {
|
|
12
|
+
columnsConfiguration: ColumnConfiguration[];
|
|
13
|
+
compactView: boolean;
|
|
14
|
+
wrapperRef: RefObject<HTMLDivElement>;
|
|
15
|
+
};
|
|
16
|
+
declare const DEFAULT_TABLE_CONTEXT: TableContextType;
|
|
17
|
+
declare const TableContext: React.Context<TableContextType>;
|
|
18
|
+
export { ColumnConfiguration, TableContextType, DEFAULT_TABLE_CONTEXT, TableContext };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
|
+
|
|
11
|
+
var DEFAULT_TABLE_CONTEXT = {
|
|
12
|
+
columnsConfiguration: [],
|
|
13
|
+
compactView: false,
|
|
14
|
+
wrapperRef: { current: null },
|
|
15
|
+
};
|
|
16
|
+
var TableContext = React__default['default'].createContext(DEFAULT_TABLE_CONTEXT);
|
|
17
|
+
|
|
18
|
+
exports.DEFAULT_TABLE_CONTEXT = DEFAULT_TABLE_CONTEXT;
|
|
19
|
+
exports.TableContext = TableContext;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { HTMLAttributes } from "react";
|
|
4
|
+
type TBodyProps = HTMLAttributes<HTMLTableSectionElement> & {
|
|
5
|
+
/**
|
|
6
|
+
* Дополнительный класс
|
|
7
|
+
*/
|
|
8
|
+
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
11
|
+
*/
|
|
12
|
+
dataTestId?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const TBody: React.FC<TBodyProps>;
|
|
15
|
+
export { TBodyProps, TBody };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-2f687e1c.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var cn = require('classnames');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
+
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
13
|
+
|
|
14
|
+
var styles = {"component":"table__component_13syc"};
|
|
15
|
+
require('./index.css')
|
|
16
|
+
|
|
17
|
+
var TBody = function (_a) {
|
|
18
|
+
var className = _a.className, children = _a.children, dataTestId = _a.dataTestId, restProps = tslib_es6.__rest(_a, ["className", "children", "dataTestId"]);
|
|
19
|
+
return (React__default['default'].createElement("tbody", tslib_es6.__assign({ className: cn__default['default'](styles.component, className), "data-test-id": dataTestId }, restProps), children));
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.TBody = TBody;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('../../tslib.es6-2f687e1c.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
var components_tbody_Component = require('./Component.js');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.TBody = components_tbody_Component.TBody;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TdHTMLAttributes } from 'react';
|
|
3
|
+
type TCellProps = TdHTMLAttributes<HTMLTableCellElement> & {
|
|
4
|
+
/**
|
|
5
|
+
* Дополнительный класс
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
10
|
+
*/
|
|
11
|
+
dataTestId?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Устанавливается автоматически и позволяет использовать конфиг для соответствующего индекса
|
|
14
|
+
*/
|
|
15
|
+
index?: number;
|
|
16
|
+
};
|
|
17
|
+
declare const TCell: ({ className, style, dataTestId, children, index, ...restProps }: TCellProps) => JSX.Element;
|
|
18
|
+
export { TCellProps, TCell };
|