@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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-ce870b46.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var cn = require('classnames');
|
|
8
|
+
var styles = require('./index.module.css');
|
|
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
|
+
var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
15
|
+
|
|
16
|
+
var TBody = function (_a) {
|
|
17
|
+
var className = _a.className, children = _a.children, dataTestId = _a.dataTestId, restProps = tslib_es6.__rest(_a, ["className", "children", "dataTestId"]);
|
|
18
|
+
return (React__default['default'].createElement("tbody", tslib_es6.__assign({ className: cn__default['default'](styles__default['default'].component, className), "data-test-id": dataTestId }, restProps), children));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.TBody = TBody;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('../../tslib.es6-ce870b46.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('./index.module.css');
|
|
9
|
+
var components_tbody_Component = require('./Component.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
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 };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-ce870b46.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var cn = require('classnames');
|
|
8
|
+
var components_tableContext_index = require('../table-context/index.js');
|
|
9
|
+
var styles = require('./index.module.css');
|
|
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
|
+
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
15
|
+
var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
16
|
+
|
|
17
|
+
var TCell = function (_a) {
|
|
18
|
+
var className = _a.className, style = _a.style, dataTestId = _a.dataTestId, children = _a.children, index = _a.index, restProps = tslib_es6.__rest(_a, ["className", "style", "dataTestId", "children", "index"]);
|
|
19
|
+
var _b = React.useContext(components_tableContext_index.TableContext), columnsConfiguration = _b.columnsConfiguration, compactView = _b.compactView;
|
|
20
|
+
var column = index === undefined ? null : columnsConfiguration[index];
|
|
21
|
+
var width = column === null || column === void 0 ? void 0 : column.width;
|
|
22
|
+
var textAlign = column === null || column === void 0 ? void 0 : column.textAlign;
|
|
23
|
+
var hidden = (column === null || column === void 0 ? void 0 : column.hidden) || false;
|
|
24
|
+
return (React__default['default'].createElement("td", tslib_es6.__assign({ className: cn__default['default'](styles__default['default'].component, className, hidden && styles__default['default'].hidden, compactView && styles__default['default'].compact), style: tslib_es6.__assign(tslib_es6.__assign({}, style), { width: width, textAlign: textAlign }), "data-test-id": dataTestId }, restProps), children));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.TCell = TCell;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('../../tslib.es6-ce870b46.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('../table-context/index.js');
|
|
9
|
+
require('./index.module.css');
|
|
10
|
+
var components_tcell_Component = require('./Component.js');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
exports.TCell = components_tcell_Component.TCell;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--color-light-border-primary: #dbdee1;
|
|
3
|
+
--color-light-text-primary: #0b1f35;
|
|
4
|
+
}
|
|
5
|
+
:root {
|
|
6
|
+
|
|
7
|
+
/* Hard */
|
|
8
|
+
|
|
9
|
+
/* Up */
|
|
10
|
+
|
|
11
|
+
/* Hard up */
|
|
12
|
+
}
|
|
13
|
+
:root {
|
|
14
|
+
--gap-xs: 8px;
|
|
15
|
+
--gap-m: 16px;
|
|
16
|
+
--gap-xl: 24px;
|
|
17
|
+
}
|
|
18
|
+
.component {
|
|
19
|
+
font-size: 14px;
|
|
20
|
+
line-height: 20px;
|
|
21
|
+
font-weight: 400;
|
|
22
|
+
|
|
23
|
+
color: var(--color-light-text-primary);
|
|
24
|
+
padding: var(--gap-xl) var(--gap-m);
|
|
25
|
+
height: 72px;
|
|
26
|
+
border-top: 1px solid var(--color-light-border-primary);
|
|
27
|
+
vertical-align: top;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
}
|
|
30
|
+
.hidden {
|
|
31
|
+
display: none;
|
|
32
|
+
}
|
|
33
|
+
.compact {
|
|
34
|
+
padding-top: var(--gap-xs);
|
|
35
|
+
padding-bottom: var(--gap-xs);
|
|
36
|
+
|
|
37
|
+
max-width: 0;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
text-overflow: ellipsis;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { TRowProps } from "../trow/index";
|
|
4
|
+
type TExpandableRowProps = TRowProps & {
|
|
5
|
+
defaultExpanded?: boolean;
|
|
6
|
+
expanded?: boolean;
|
|
7
|
+
onToggle?: (expanded: boolean) => void;
|
|
8
|
+
renderContent: (expanded: boolean) => ReactNode;
|
|
9
|
+
};
|
|
10
|
+
declare const TExpandableRow: ({ className, selected, expanded, defaultExpanded, onToggle, renderContent, ...restProps }: TExpandableRowProps) => JSX.Element;
|
|
11
|
+
export { TExpandableRowProps, TExpandableRow };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-ce870b46.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var cn = require('classnames');
|
|
8
|
+
require('../trow/index.module.css');
|
|
9
|
+
var components_trow_Component = require('../trow/Component.js');
|
|
10
|
+
var styles = require('./index.module.css');
|
|
11
|
+
|
|
12
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
+
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
+
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
16
|
+
var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
17
|
+
|
|
18
|
+
var TExpandableRow = function (_a) {
|
|
19
|
+
var _b, _c;
|
|
20
|
+
var className = _a.className, selected = _a.selected, expanded = _a.expanded, _d = _a.defaultExpanded, defaultExpanded = _d === void 0 ? false : _d, _e = _a.onToggle, onToggle = _e === void 0 ? function () { return null; } : _e, _f = _a.renderContent, renderContent = _f === void 0 ? function () { return null; } : _f, restProps = tslib_es6.__rest(_a, ["className", "selected", "expanded", "defaultExpanded", "onToggle", "renderContent"]);
|
|
21
|
+
var _g = React.useState(defaultExpanded), expandedState = _g[0], setExpandedState = _g[1];
|
|
22
|
+
var uncontrolled = expanded === undefined;
|
|
23
|
+
var isExpanded = (uncontrolled ? expandedState : expanded);
|
|
24
|
+
var handleToggle = function () {
|
|
25
|
+
if (uncontrolled) {
|
|
26
|
+
setExpandedState(!isExpanded);
|
|
27
|
+
}
|
|
28
|
+
onToggle(isExpanded);
|
|
29
|
+
};
|
|
30
|
+
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
|
31
|
+
React__default['default'].createElement(components_trow_Component.TRow, tslib_es6.__assign({ className: cn__default['default'](styles__default['default'].row, className, (_b = {},
|
|
32
|
+
_b[styles__default['default'].selected] = selected,
|
|
33
|
+
_b[styles__default['default'].expanded] = isExpanded,
|
|
34
|
+
_b)), selected: selected, onClick: handleToggle }, restProps)),
|
|
35
|
+
React__default['default'].createElement("tr", { className: cn__default['default'](styles__default['default'].expandable, (_c = {}, _c[styles__default['default'].expanded] = isExpanded, _c)) }, renderContent(isExpanded))));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
exports.TExpandableRow = TExpandableRow;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('../../tslib.es6-ce870b46.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('../trow/index.module.css');
|
|
9
|
+
require('../trow/Component.js');
|
|
10
|
+
require('./index.module.css');
|
|
11
|
+
var components_texpandableRow_Component = require('./Component.js');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.TExpandableRow = components_texpandableRow_Component.TExpandableRow;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
|
|
3
|
+
/* Hard */
|
|
4
|
+
|
|
5
|
+
/* Up */
|
|
6
|
+
|
|
7
|
+
/* Hard up */
|
|
8
|
+
}
|
|
9
|
+
.row {
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
}
|
|
12
|
+
.selected.expanded {
|
|
13
|
+
background-color: inherit;
|
|
14
|
+
}
|
|
15
|
+
.expanded:hover {
|
|
16
|
+
background-color: inherit;
|
|
17
|
+
}
|
|
18
|
+
.expandable td {
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding-top: 0;
|
|
21
|
+
padding-bottom: 0;
|
|
22
|
+
border: none;
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { HTMLAttributes } from "react";
|
|
4
|
+
type THeadProps = HTMLAttributes<HTMLTableSectionElement> & {
|
|
5
|
+
/**
|
|
6
|
+
* Дополнительный класс
|
|
7
|
+
*/
|
|
8
|
+
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Дополнительный класс для tr
|
|
11
|
+
*/
|
|
12
|
+
rowClassName?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
15
|
+
*/
|
|
16
|
+
dataTestId?: string;
|
|
17
|
+
};
|
|
18
|
+
declare const THead: React.FC<THeadProps>;
|
|
19
|
+
export { THeadProps, THead };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-ce870b46.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var cn = require('classnames');
|
|
8
|
+
var styles = require('./index.module.css');
|
|
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
|
+
var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
15
|
+
|
|
16
|
+
var THead = function (_a) {
|
|
17
|
+
var className = _a.className, rowClassName = _a.rowClassName, children = _a.children, dataTestId = _a.dataTestId, restProps = tslib_es6.__rest(_a, ["className", "rowClassName", "children", "dataTestId"]);
|
|
18
|
+
return (React__default['default'].createElement("thead", tslib_es6.__assign({ className: cn__default['default'](styles__default['default'].component, className), "data-test-id": dataTestId }, restProps),
|
|
19
|
+
React__default['default'].createElement("tr", { className: cn__default['default'](styles__default['default'].row, rowClassName) }, children)));
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.THead = THead;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('../../tslib.es6-ce870b46.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('./index.module.css');
|
|
9
|
+
var components_thead_Component = require('./Component.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.THead = components_thead_Component.THead;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--color-light-graphic-neutral: #dbdee1;
|
|
3
|
+
}
|
|
4
|
+
:root {
|
|
5
|
+
|
|
6
|
+
/* Hard */
|
|
7
|
+
|
|
8
|
+
/* Up */
|
|
9
|
+
|
|
10
|
+
/* Hard up */
|
|
11
|
+
}
|
|
12
|
+
.component {
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 100%;
|
|
15
|
+
box-sizing: border-box
|
|
16
|
+
}
|
|
17
|
+
.component th:not(:last-child):not(:empty):after {
|
|
18
|
+
transition: opacity 0.2s;
|
|
19
|
+
position: absolute;
|
|
20
|
+
content: '';
|
|
21
|
+
display: block;
|
|
22
|
+
|
|
23
|
+
width: 1px;
|
|
24
|
+
right: 0;
|
|
25
|
+
top: 12px;
|
|
26
|
+
bottom: 8px;
|
|
27
|
+
background-color: var(--color-light-graphic-neutral);
|
|
28
|
+
}
|
|
29
|
+
.component th:after {
|
|
30
|
+
opacity: 0;
|
|
31
|
+
}
|
|
32
|
+
.component:hover th:after {
|
|
33
|
+
opacity: 1;
|
|
34
|
+
}
|
|
35
|
+
.row {
|
|
36
|
+
height: 72px;
|
|
37
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ThHTMLAttributes } from 'react';
|
|
3
|
+
import { TextAlignProperty } from "../../typings";
|
|
4
|
+
type THeadCellProps = ThHTMLAttributes<HTMLHeadingElement> & {
|
|
5
|
+
/**
|
|
6
|
+
* Дополнительный класс
|
|
7
|
+
*/
|
|
8
|
+
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Ширина колонки
|
|
11
|
+
*/
|
|
12
|
+
width?: string | number;
|
|
13
|
+
/**
|
|
14
|
+
* Скрытие колонки
|
|
15
|
+
*/
|
|
16
|
+
hidden?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Выравнивание текста в колонке
|
|
19
|
+
*/
|
|
20
|
+
textAlign?: TextAlignProperty;
|
|
21
|
+
/**
|
|
22
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
23
|
+
*/
|
|
24
|
+
dataTestId?: string;
|
|
25
|
+
};
|
|
26
|
+
declare const THeadCell: ({ children, className, dataTestId, style, width, textAlign, hidden, ...restProps }: THeadCellProps) => JSX.Element;
|
|
27
|
+
export { THeadCellProps, THeadCell };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-ce870b46.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var cn = require('classnames');
|
|
8
|
+
var styles = require('./index.module.css');
|
|
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
|
+
var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
15
|
+
|
|
16
|
+
var THeadCell = function (_a) {
|
|
17
|
+
var children = _a.children, className = _a.className, dataTestId = _a.dataTestId, style = _a.style, width = _a.width, textAlign = _a.textAlign, hidden = _a.hidden, restProps = tslib_es6.__rest(_a, ["children", "className", "dataTestId", "style", "width", "textAlign", "hidden"]);
|
|
18
|
+
return (React__default['default'].createElement("th", tslib_es6.__assign({ className: cn__default['default'](styles__default['default'].component, className, hidden && styles__default['default'].hidden), style: tslib_es6.__assign(tslib_es6.__assign({}, style), { width: width, textAlign: textAlign }), "data-test-id": dataTestId }, restProps), children));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.THeadCell = THeadCell;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('../../tslib.es6-ce870b46.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('./index.module.css');
|
|
9
|
+
var components_theadCell_Component = require('./Component.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.THeadCell = components_theadCell_Component.THeadCell;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--color-light-bg-primary: #fff;
|
|
3
|
+
--color-light-border-primary: #dbdee1;
|
|
4
|
+
--color-light-text-primary: #0b1f35;
|
|
5
|
+
}
|
|
6
|
+
:root {
|
|
7
|
+
|
|
8
|
+
/* Hard */
|
|
9
|
+
|
|
10
|
+
/* Up */
|
|
11
|
+
|
|
12
|
+
/* Hard up */
|
|
13
|
+
}
|
|
14
|
+
:root {
|
|
15
|
+
--gap-s: 12px;
|
|
16
|
+
--gap-2xl: 32px;
|
|
17
|
+
}
|
|
18
|
+
.component {
|
|
19
|
+
font-size: 12px;
|
|
20
|
+
line-height: 16px;
|
|
21
|
+
font-weight: 500;
|
|
22
|
+
letter-spacing: 1.25px;
|
|
23
|
+
text-transform: uppercase;
|
|
24
|
+
|
|
25
|
+
line-height: 20px;
|
|
26
|
+
position: relative;
|
|
27
|
+
text-align: left;
|
|
28
|
+
color: var(--color-light-text-primary);
|
|
29
|
+
padding: var(--gap-2xl) var(--gap-s) 0;
|
|
30
|
+
border-bottom: 1px solid var(--color-light-border-primary);
|
|
31
|
+
background: var(--color-light-bg-primary);
|
|
32
|
+
vertical-align: top;
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
}
|
|
35
|
+
.sortable {
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
.sorted {
|
|
39
|
+
color: var(--color-light-text-primary);
|
|
40
|
+
}
|
|
41
|
+
.hidden {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { HTMLAttributes } from "react";
|
|
4
|
+
import { TCell, TCellProps } from "../tcell/index";
|
|
5
|
+
type TRowProps = HTMLAttributes<HTMLTableRowElement> & {
|
|
6
|
+
/**
|
|
7
|
+
* Компоненты ячеек
|
|
8
|
+
*/
|
|
9
|
+
children: Array<React.ReactElement<TCellProps, typeof TCell>>;
|
|
10
|
+
/**
|
|
11
|
+
* Дополнительный класс
|
|
12
|
+
*/
|
|
13
|
+
className?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Стиль выбранной строки
|
|
16
|
+
*/
|
|
17
|
+
selected?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Убирает нижнюю границу
|
|
20
|
+
*/
|
|
21
|
+
withoutBorder?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
24
|
+
*/
|
|
25
|
+
dataTestId?: string;
|
|
26
|
+
};
|
|
27
|
+
declare const TRow: ({ children, className, selected, withoutBorder, dataTestId, ...restProps }: TRowProps) => JSX.Element;
|
|
28
|
+
export { TRowProps, TRow };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-ce870b46.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var cn = require('classnames');
|
|
8
|
+
var styles = require('./index.module.css');
|
|
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
|
+
var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
15
|
+
|
|
16
|
+
var TRow = function (_a) {
|
|
17
|
+
var _b;
|
|
18
|
+
var children = _a.children, className = _a.className, selected = _a.selected, withoutBorder = _a.withoutBorder, dataTestId = _a.dataTestId, restProps = tslib_es6.__rest(_a, ["children", "className", "selected", "withoutBorder", "dataTestId"]);
|
|
19
|
+
return (React__default['default'].createElement("tr", tslib_es6.__assign({ className: cn__default['default'](styles__default['default'].component, className, (_b = {},
|
|
20
|
+
_b[styles__default['default'].clickable] = typeof restProps.onClick !== 'undefined',
|
|
21
|
+
_b[styles__default['default'].selected] = selected,
|
|
22
|
+
_b[styles__default['default'].withoutBorder] = withoutBorder,
|
|
23
|
+
_b)), "data-test-id": dataTestId }, restProps), React__default['default'].Children.map(children, function (child, index) { return React__default['default'].cloneElement(child, { index: index }); })));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.TRow = TRow;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('../../tslib.es6-ce870b46.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('./index.module.css');
|
|
9
|
+
var components_trow_Component = require('./Component.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.TRow = components_trow_Component.TRow;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--color-static-graphic-solitude: #e8f2fe;
|
|
3
|
+
}
|
|
4
|
+
:root {
|
|
5
|
+
--color-light-bg-primary: #fff;
|
|
6
|
+
--color-light-bg-secondary: #f3f4f5;
|
|
7
|
+
}
|
|
8
|
+
:root {
|
|
9
|
+
|
|
10
|
+
/* Hard */
|
|
11
|
+
|
|
12
|
+
/* Up */
|
|
13
|
+
|
|
14
|
+
/* Hard up */
|
|
15
|
+
}
|
|
16
|
+
.component {
|
|
17
|
+
padding-top: 1px;
|
|
18
|
+
width: 100%;
|
|
19
|
+
transition: background-color 0.2s;
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
background: var(--color-light-bg-primary)
|
|
22
|
+
}
|
|
23
|
+
.component:first-child td {
|
|
24
|
+
border-top: 0;
|
|
25
|
+
}
|
|
26
|
+
.withoutBorder {
|
|
27
|
+
td {
|
|
28
|
+
border: none;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
.clickable {
|
|
32
|
+
cursor: pointer
|
|
33
|
+
}
|
|
34
|
+
.clickable:hover {
|
|
35
|
+
background-color: var(--color-light-bg-secondary);
|
|
36
|
+
}
|
|
37
|
+
.selected {
|
|
38
|
+
background-color: #f2f8ff /* нет цвета в палитре */
|
|
39
|
+
}
|
|
40
|
+
.selected:hover {
|
|
41
|
+
background-color: var(--color-static-graphic-solitude);
|
|
42
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { THeadCellProps } from "../thead-cell/index";
|
|
3
|
+
type TSortableHeadCellProps = THeadCellProps & {
|
|
4
|
+
isSortedDesc?: boolean;
|
|
5
|
+
defaultIsSortedDesc?: boolean;
|
|
6
|
+
onSort?: () => void;
|
|
7
|
+
};
|
|
8
|
+
declare const TSortableHeadCell: ({ children, className, defaultIsSortedDesc, isSortedDesc, textAlign, onSort, ...restProps }: TSortableHeadCellProps) => JSX.Element;
|
|
9
|
+
export { TSortableHeadCellProps, TSortableHeadCell };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-ce870b46.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var cn = require('classnames');
|
|
8
|
+
require('../thead-cell/index.module.css');
|
|
9
|
+
var components_theadCell_Component = require('../thead-cell/Component.js');
|
|
10
|
+
var styles = require('./index.module.css');
|
|
11
|
+
var components_tsortableHeadCell_sortIconAsc = require('./sort-icon-asc.js');
|
|
12
|
+
var components_tsortableHeadCell_sortIconDesc = require('./sort-icon-desc.js');
|
|
13
|
+
var components_tsortableHeadCell_sortIconUnset = require('./sort-icon-unset.js');
|
|
14
|
+
|
|
15
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
+
|
|
17
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
|
+
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
19
|
+
var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
20
|
+
|
|
21
|
+
var TSortableHeadCell = function (_a) {
|
|
22
|
+
var _b, _c;
|
|
23
|
+
var children = _a.children, className = _a.className, defaultIsSortedDesc = _a.defaultIsSortedDesc, isSortedDesc = _a.isSortedDesc, textAlign = _a.textAlign, onSort = _a.onSort, restProps = tslib_es6.__rest(_a, ["children", "className", "defaultIsSortedDesc", "isSortedDesc", "textAlign", "onSort"]);
|
|
24
|
+
var SortIcon = React.useMemo(function () {
|
|
25
|
+
var value = isSortedDesc;
|
|
26
|
+
if (value === undefined)
|
|
27
|
+
value = defaultIsSortedDesc;
|
|
28
|
+
if (typeof value === 'boolean')
|
|
29
|
+
return value ? components_tsortableHeadCell_sortIconDesc.SortIconDesc : components_tsortableHeadCell_sortIconAsc.SortIconAsc;
|
|
30
|
+
return components_tsortableHeadCell_sortIconUnset.SortIconUnset;
|
|
31
|
+
}, [defaultIsSortedDesc, isSortedDesc]);
|
|
32
|
+
return (React__default['default'].createElement(components_theadCell_Component.THeadCell, tslib_es6.__assign({ className: cn__default['default'](className, styles__default['default'].component) }, restProps),
|
|
33
|
+
React__default['default'].createElement("div", { className: cn__default['default'](styles__default['default'].content, (_b = {}, _b[styles__default['default'].reverse] = textAlign === 'right', _b)) },
|
|
34
|
+
children,
|
|
35
|
+
React__default['default'].createElement(SortIcon, { onClick: onSort, className: cn__default['default'](styles__default['default'].icon, (_c = {},
|
|
36
|
+
_c[styles__default['default'].sorted] = isSortedDesc !== undefined,
|
|
37
|
+
_c)) }))));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
exports.TSortableHeadCell = TSortableHeadCell;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|