@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,28 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { THeadCell } from '../thead-cell/Component.js';
|
|
4
|
+
import { SortIconAsc } from './sort-icon-asc.js';
|
|
5
|
+
import { SortIconDesc } from './sort-icon-desc.js';
|
|
6
|
+
import { SortIconUnset } from './sort-icon-unset.js';
|
|
7
|
+
|
|
8
|
+
var styles = {"component":"table__component_5ob2m","content":"table__content_5ob2m","icon":"table__icon_5ob2m","reverse":"table__reverse_5ob2m","sorted":"table__sorted_5ob2m"};
|
|
9
|
+
require('./index.css')
|
|
10
|
+
|
|
11
|
+
const TSortableHeadCell = ({ children, className, defaultIsSortedDesc, isSortedDesc, textAlign, onSort, ...restProps }) => {
|
|
12
|
+
const SortIcon = useMemo(() => {
|
|
13
|
+
let value = isSortedDesc;
|
|
14
|
+
if (value === undefined)
|
|
15
|
+
value = defaultIsSortedDesc;
|
|
16
|
+
if (typeof value === 'boolean')
|
|
17
|
+
return value ? SortIconDesc : SortIconAsc;
|
|
18
|
+
return SortIconUnset;
|
|
19
|
+
}, [defaultIsSortedDesc, isSortedDesc]);
|
|
20
|
+
return (React.createElement(THeadCell, Object.assign({ className: cn(className, styles.component) }, restProps),
|
|
21
|
+
React.createElement("div", { className: cn(styles.content, { [styles.reverse]: textAlign === 'right' }) },
|
|
22
|
+
children,
|
|
23
|
+
React.createElement(SortIcon, { onClick: onSort, className: cn(styles.icon, {
|
|
24
|
+
[styles.sorted]: isSortedDesc !== undefined,
|
|
25
|
+
}) }))));
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { TSortableHeadCell };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/* hash: 1tbmz */
|
|
2
|
+
:root {
|
|
3
|
+
--color-light-graphic-link: #007aff;
|
|
4
|
+
--color-light-graphic-primary: #0b1f35;
|
|
5
|
+
--color-light-graphic-secondary: #6d7986;
|
|
6
|
+
}
|
|
7
|
+
:root {
|
|
8
|
+
|
|
9
|
+
/* Hard */
|
|
10
|
+
|
|
11
|
+
/* Up */
|
|
12
|
+
|
|
13
|
+
/* Hard up */
|
|
14
|
+
}
|
|
15
|
+
:root {
|
|
16
|
+
--gap-xs: 8px;
|
|
17
|
+
}
|
|
18
|
+
.table__component_5ob2m {
|
|
19
|
+
position: relative;
|
|
20
|
+
}
|
|
21
|
+
.table__content_5ob2m {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
}
|
|
25
|
+
.table__icon_5ob2m {
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
margin-left: var(--gap-xs);
|
|
28
|
+
color: var(--color-light-graphic-secondary);
|
|
29
|
+
transition: color 0.2s ease
|
|
30
|
+
}
|
|
31
|
+
.table__icon_5ob2m:hover {
|
|
32
|
+
color: var(--color-light-graphic-primary);
|
|
33
|
+
}
|
|
34
|
+
.table__reverse_5ob2m {
|
|
35
|
+
flex-direction: row-reverse
|
|
36
|
+
}
|
|
37
|
+
.table__reverse_5ob2m .table__icon_5ob2m {
|
|
38
|
+
margin-left: 0;
|
|
39
|
+
margin-right: var(--gap-xs);
|
|
40
|
+
}
|
|
41
|
+
.table__sorted_5ob2m {
|
|
42
|
+
color: var(--color-light-graphic-link)
|
|
43
|
+
}
|
|
44
|
+
.table__sorted_5ob2m:hover {
|
|
45
|
+
color: var(--color-light-graphic-link);
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const SortIconAsc = props => (React.createElement("svg", Object.assign({ width: '18', height: '18', viewBox: '0 0 18 18', fill: 'currentColor', xmlns: 'http://www.w3.org/2000/svg', focusable: 'false', role: 'img' }, props),
|
|
4
|
+
React.createElement("path", { d: 'M3.00004 10C3.00004 10 11.4477 10 12 10C12 9.33333 12.0001 8.16667 12.0001 7.5H3.0001C3.00006 8 3.0001 9.5 3.00004 10ZM3.0001 3.5C3.00003 4.16667 3 5.33333 3 6H9C9 5.33333 9 4.16667 9 3.5C9 3.5 3.55238 3.5 3.0001 3.5ZM3.00009 14C3.21041 14 15 14 15 14C15 13.5 15 12 15 11.5C15 11.5 3.55238 11.5 3.00009 11.5C3 12 3 13.5 3.00009 14Z' })));
|
|
5
|
+
|
|
6
|
+
export { SortIconAsc };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const SortIconDesc = props => (React.createElement("svg", Object.assign({ width: '18', height: '18', viewBox: '0 0 18 18', fill: 'currentColor', xmlns: 'http://www.w3.org/2000/svg', focusable: 'false', role: 'img' }, props),
|
|
4
|
+
React.createElement("path", { d: 'M3.00004 10C3.00004 10 11.4477 10 12 10C12 9.33333 12.0001 8.16667 12.0001 7.5H3.0001C3.00006 8 3.0001 9.5 3.00004 10ZM3.0001 3.5C3.00003 4.16667 3 5.33333 3 6H15C15 5.33333 15 4.16667 15 3.5C15 3.5 3.55238 3.5 3.0001 3.5ZM3.00009 14C3.21041 14 9 14 9 14C9 13.5 9 12 9 11.5C9 11.5 3.55238 11.5 3.00009 11.5C3 12 3 13.5 3.00009 14Z' })));
|
|
5
|
+
|
|
6
|
+
export { SortIconDesc };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const SortIconUnset = props => (React.createElement("svg", Object.assign({ width: '18', height: '18', viewBox: '0 0 18 18', fill: 'currentColor', xmlns: 'http://www.w3.org/2000/svg', focusable: 'false', role: 'img' }, props),
|
|
4
|
+
React.createElement("path", { d: 'M3 10C3 10 10.4477 10 11 10C11 9.33333 11.0001 8.16667 11.0001 7.5H3.00006C3.00002 8 3.00006 9.5 3 10ZM3.0001 3.5C3.00003 4.16667 3 5.33333 3 6H15C15 5.33333 15 4.16667 15 3.5C15 3.5 3.55238 3.5 3.0001 3.5ZM3 14C3.21032 14 14 14 14 14C14 13.5 14 12 14 11.5C14 11.5 3.55228 11.5 3 11.5C2.99991 12 2.99991 13.5 3 14Z' })));
|
|
5
|
+
|
|
6
|
+
export { SortIconUnset };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./component";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import 'react';
|
|
2
|
+
import 'classnames';
|
|
3
|
+
import './components/thead/Component.js';
|
|
4
|
+
import './utils.js';
|
|
5
|
+
import './components/table/utils.js';
|
|
6
|
+
import './components/table-context/index.js';
|
|
7
|
+
import './components/table/Component.js';
|
|
8
|
+
import '@alfalab/core-components-select/dist/modern';
|
|
9
|
+
import '@alfalab/core-components-pagination/dist/modern';
|
|
10
|
+
import '@alfalab/core-components-button/dist/modern';
|
|
11
|
+
import './components/pagination/select-field/index.js';
|
|
12
|
+
import './components/pagination/Component.js';
|
|
13
|
+
import './components/thead-cell/Component.js';
|
|
14
|
+
import './components/tsortable-head-cell/Component.js';
|
|
15
|
+
import './components/tsortable-head-cell/sort-icon-asc.js';
|
|
16
|
+
import './components/tsortable-head-cell/sort-icon-desc.js';
|
|
17
|
+
import './components/tsortable-head-cell/sort-icon-unset.js';
|
|
18
|
+
import './components/tbody/Component.js';
|
|
19
|
+
import './components/tcell/Component.js';
|
|
20
|
+
import './components/trow/Component.js';
|
|
21
|
+
import './components/texpandable-row/Component.js';
|
|
22
|
+
export { Table } from './component.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
function isChildInstanceOf(child, Component) {
|
|
4
|
+
// мы не можем полагаться на child.type === Component, см. https://github.com/gaearon/react-hot-loader/issues/304
|
|
5
|
+
return child.type === React.createElement(Component).type;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { isChildInstanceOf };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
const http = require('http');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const { promisify } = require('util');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const readFile = promisify(fs.readFile);
|
|
7
|
+
|
|
8
|
+
async function main() {
|
|
9
|
+
const remoteHost = process.env.NIS_HOST || 'digital';
|
|
10
|
+
const remotePort = process.env.NIS_PORT || 80;
|
|
11
|
+
const remotePath = process.env.NIS_PATH || '/npm-install-stats/api/install-stats';
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
const [_, node, os, arch] =
|
|
15
|
+
/node\/v(\d+\.\d+\.\d+) (\w+) (\w+)/.exec(process.env.npm_config_user_agent) || [];
|
|
16
|
+
const [__, npm] = /npm\/(\d+\.\d+\.\d+)/.exec(process.env.npm_config_user_agent) || [];
|
|
17
|
+
const [___, yarn] = /yarn\/(\d+\.\d+\.\d+)/.exec(process.env.npm_config_user_agent) || [];
|
|
18
|
+
|
|
19
|
+
let ownPackageJson, packageJson;
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
const result = await Promise.all([
|
|
23
|
+
readFile(path.join(process.cwd(), 'package.json'), 'utf-8'),
|
|
24
|
+
readFile(path.join(process.cwd(), '../../../package.json'), 'utf-8'),
|
|
25
|
+
]);
|
|
26
|
+
|
|
27
|
+
ownPackageJson = JSON.parse(result[0]);
|
|
28
|
+
packageJson = JSON.parse(result[1]);
|
|
29
|
+
} catch (err) {
|
|
30
|
+
ownPackageJson = '';
|
|
31
|
+
packageJson = '';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const data = {
|
|
35
|
+
node,
|
|
36
|
+
npm,
|
|
37
|
+
yarn,
|
|
38
|
+
os,
|
|
39
|
+
arch,
|
|
40
|
+
ownPackageJson: JSON.stringify(ownPackageJson),
|
|
41
|
+
packageJson: JSON.stringify(packageJson),
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const body = JSON.stringify(data);
|
|
45
|
+
|
|
46
|
+
const options = {
|
|
47
|
+
host: remoteHost,
|
|
48
|
+
port: remotePort,
|
|
49
|
+
path: remotePath,
|
|
50
|
+
method: 'POST',
|
|
51
|
+
headers: {
|
|
52
|
+
'Content-Type': 'application/json',
|
|
53
|
+
'Content-Length': body.length,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return new Promise((resolve, reject) => {
|
|
58
|
+
const req = http.request(options, res => {
|
|
59
|
+
res.on('end', () => {
|
|
60
|
+
resolve();
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
req.on('error', () => {
|
|
65
|
+
reject();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
req.write(body);
|
|
69
|
+
req.end();
|
|
70
|
+
});
|
|
71
|
+
} catch (error) {
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
main()
|
|
77
|
+
.then(() => {
|
|
78
|
+
process.exit(0);
|
|
79
|
+
})
|
|
80
|
+
.catch(() => {
|
|
81
|
+
process.exit(0);
|
|
82
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare function __extends(d: any, b: any): void;
|
|
2
|
+
declare function __rest(s: any, e: any): {};
|
|
3
|
+
declare function __decorate(decorators: any, target: any, key: any, desc: any, ...args: any[]): any;
|
|
4
|
+
declare function __param(paramIndex: any, decorator: any): (target: any, key: any) => void;
|
|
5
|
+
declare function __metadata(metadataKey: any, metadataValue: any): any;
|
|
6
|
+
declare function __awaiter(thisArg: any, _arguments: any, P: any, generator: any): any;
|
|
7
|
+
declare function __generator(thisArg: any, body: any): {
|
|
8
|
+
next: (v: any) => any;
|
|
9
|
+
throw: (v: any) => any;
|
|
10
|
+
return: (v: any) => any;
|
|
11
|
+
};
|
|
12
|
+
declare function __exportStar(m: any, o: any): void;
|
|
13
|
+
declare function __values(o: any): any;
|
|
14
|
+
declare function __read(o: any, n: any): any;
|
|
15
|
+
declare function __spread(...args: any[]): any[];
|
|
16
|
+
declare function __spreadArrays(...args: any[]): any[];
|
|
17
|
+
declare function __await(v: any): any;
|
|
18
|
+
declare class __await {
|
|
19
|
+
constructor(v: any);
|
|
20
|
+
v: any;
|
|
21
|
+
}
|
|
22
|
+
declare function __asyncGenerator(thisArg: any, _arguments: any, generator: any): {};
|
|
23
|
+
declare function __asyncDelegator(o: any): {};
|
|
24
|
+
declare function __asyncValues(o: any): any;
|
|
25
|
+
declare function __makeTemplateObject(cooked: any, raw: any): any;
|
|
26
|
+
declare function __importStar(mod: any): any;
|
|
27
|
+
declare function __importDefault(mod: any): any;
|
|
28
|
+
declare function __classPrivateFieldGet(receiver: any, privateMap: any): any;
|
|
29
|
+
declare function __classPrivateFieldSet(receiver: any, privateMap: any, value: any): any;
|
|
30
|
+
declare function __assign(...args: any[]): any;
|
|
31
|
+
declare function __createBinding(o: any, m: any, k: any, k2: any): void;
|
|
32
|
+
export { __extends, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __assign, __createBinding };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/*! *****************************************************************************
|
|
4
|
+
Copyright (c) Microsoft Corporation.
|
|
5
|
+
|
|
6
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
+
purpose with or without fee is hereby granted.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
***************************************************************************** */
|
|
17
|
+
exports.__assign = function () {
|
|
18
|
+
exports.__assign = Object.assign || function __assign(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s)
|
|
22
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
23
|
+
t[p] = s[p];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
return exports.__assign.apply(this, arguments);
|
|
28
|
+
};
|
|
29
|
+
function __rest(s, e) {
|
|
30
|
+
var t = {};
|
|
31
|
+
for (var p in s)
|
|
32
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
33
|
+
t[p] = s[p];
|
|
34
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
35
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
36
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
37
|
+
t[p[i]] = s[p[i]];
|
|
38
|
+
}
|
|
39
|
+
return t;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
exports.__rest = __rest;
|
package/dist/typings.js
ADDED
package/dist/utils.d.ts
ADDED
package/dist/utils.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
function isChildInstanceOf(child, Component) {
|
|
12
|
+
// мы не можем полагаться на child.type === Component, см. https://github.com/gaearon/react-hot-loader/issues/304
|
|
13
|
+
return child.type === React__default['default'].createElement(Component).type;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
exports.isChildInstanceOf = isChildInstanceOf;
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@alfalab/core-components-table",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"keywords": [],
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"module": "./dist/esm/index.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"react": "^16.9.0 || ^17.0.1",
|
|
17
|
+
"react-dom": "^16.9.0 || ^17.0.1"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@alfalab/core-components-button": "^5.0.3",
|
|
21
|
+
"@alfalab/core-components-pagination": "^1.1.0",
|
|
22
|
+
"@alfalab/core-components-select": "^10.3.0",
|
|
23
|
+
"classnames": "^2.2.6"
|
|
24
|
+
},
|
|
25
|
+
"gitHead": "94999e533968aa575e92106dffa8bbbb8e7ac71d"
|
|
26
|
+
}
|