@alfalab/core-components-table 2.8.5 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/component.d.ts +8 -1
- package/components/pagination/Component.js +1 -1
- package/components/pagination/index.css +13 -10
- package/components/pagination/select-field/index.css +7 -4
- package/components/pagination/select-field/index.js +1 -1
- package/components/table/Component.js +1 -1
- package/components/table/index.css +11 -8
- package/components/tbody/Component.js +1 -1
- package/components/tbody/index.css +5 -2
- package/components/tcell/Component.js +1 -1
- package/components/tcell/index.css +9 -6
- package/components/texpandable-row/Component.d.ts +3 -1
- package/components/texpandable-row/Component.js +3 -3
- package/components/texpandable-row/index.css +9 -6
- package/components/thead/Component.js +1 -1
- package/components/thead/index.css +10 -7
- package/components/thead-cell/Component.js +1 -1
- package/components/thead-cell/index.css +13 -10
- package/components/trow/Component.d.ts +22 -1
- package/components/trow/Component.js +5 -4
- package/components/trow/index.css +11 -8
- package/components/tsortable-head-cell/Component.js +1 -1
- package/components/tsortable-head-cell/index.css +12 -9
- package/cssm/component.d.ts +8 -1
- package/cssm/components/pagination/index.module.css +4 -1
- package/cssm/components/pagination/select-field/index.module.css +3 -0
- package/cssm/components/table/index.module.css +4 -1
- package/cssm/components/tbody/index.module.css +3 -0
- package/cssm/components/tcell/index.module.css +3 -0
- package/cssm/components/texpandable-row/Component.d.ts +3 -1
- package/cssm/components/texpandable-row/Component.js +2 -2
- package/cssm/components/texpandable-row/index.module.css +4 -1
- package/cssm/components/thead/index.module.css +4 -1
- package/cssm/components/thead-cell/index.module.css +4 -1
- package/cssm/components/trow/Component.d.ts +22 -1
- package/cssm/components/trow/Component.js +4 -3
- package/cssm/components/trow/index.module.css +3 -0
- package/cssm/components/tsortable-head-cell/index.module.css +4 -1
- package/esm/component.d.ts +8 -1
- package/esm/components/pagination/Component.js +1 -1
- package/esm/components/pagination/index.css +13 -10
- package/esm/components/pagination/select-field/index.css +7 -4
- package/esm/components/pagination/select-field/index.js +1 -1
- package/esm/components/table/Component.js +1 -1
- package/esm/components/table/index.css +11 -8
- package/esm/components/tbody/Component.js +1 -1
- package/esm/components/tbody/index.css +5 -2
- package/esm/components/tcell/Component.js +1 -1
- package/esm/components/tcell/index.css +9 -6
- package/esm/components/texpandable-row/Component.d.ts +3 -1
- package/esm/components/texpandable-row/Component.js +3 -3
- package/esm/components/texpandable-row/index.css +9 -6
- package/esm/components/thead/Component.js +1 -1
- package/esm/components/thead/index.css +10 -7
- package/esm/components/thead-cell/Component.js +1 -1
- package/esm/components/thead-cell/index.css +13 -10
- package/esm/components/trow/Component.d.ts +22 -1
- package/esm/components/trow/Component.js +6 -5
- package/esm/components/trow/index.css +11 -8
- package/esm/components/tsortable-head-cell/Component.js +1 -1
- package/esm/components/tsortable-head-cell/index.css +12 -9
- package/modern/component.d.ts +8 -1
- package/modern/components/pagination/Component.js +1 -1
- package/modern/components/pagination/index.css +13 -10
- package/modern/components/pagination/select-field/index.css +7 -4
- package/modern/components/pagination/select-field/index.js +1 -1
- package/modern/components/table/Component.js +1 -1
- package/modern/components/table/index.css +11 -8
- package/modern/components/tbody/Component.js +1 -1
- package/modern/components/tbody/index.css +5 -2
- package/modern/components/tcell/Component.js +1 -1
- package/modern/components/tcell/index.css +9 -6
- package/modern/components/texpandable-row/Component.d.ts +3 -1
- package/modern/components/texpandable-row/Component.js +3 -3
- package/modern/components/texpandable-row/index.css +9 -6
- package/modern/components/thead/Component.js +1 -1
- package/modern/components/thead/index.css +10 -7
- package/modern/components/thead-cell/Component.js +1 -1
- package/modern/components/thead-cell/index.css +13 -10
- package/modern/components/trow/Component.d.ts +22 -1
- package/modern/components/trow/Component.js +5 -4
- package/modern/components/trow/index.css +11 -8
- package/modern/components/tsortable-head-cell/Component.js +1 -1
- package/modern/components/tsortable-head-cell/index.css +12 -9
- package/moderncssm/component.d.ts +8 -1
- package/moderncssm/components/texpandable-row/Component.d.ts +3 -1
- package/moderncssm/components/texpandable-row/Component.js +2 -2
- package/moderncssm/components/trow/Component.d.ts +22 -1
- package/moderncssm/components/trow/Component.js +4 -3
- package/package.json +3 -3
- package/src/components/texpandable-row/Component.tsx +5 -1
- package/src/components/trow/Component.tsx +18 -20
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { forwardRef, ReactNode, useState } from 'react';
|
|
1
|
+
import React, { forwardRef, ReactNode, Ref, useState } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
4
|
import { TRow, TRowProps } from '../trow';
|
|
@@ -13,6 +13,8 @@ export type TExpandableRowProps = TRowProps & {
|
|
|
13
13
|
onToggle?: (expanded: boolean) => void;
|
|
14
14
|
|
|
15
15
|
renderContent: (expanded: boolean) => ReactNode;
|
|
16
|
+
|
|
17
|
+
rowRef?: Ref<HTMLTableRowElement>;
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
export const TExpandableRow = forwardRef<HTMLTableRowElement, TExpandableRowProps>(
|
|
@@ -24,6 +26,7 @@ export const TExpandableRow = forwardRef<HTMLTableRowElement, TExpandableRowProp
|
|
|
24
26
|
defaultExpanded = false,
|
|
25
27
|
onToggle = () => null,
|
|
26
28
|
renderContent = () => null,
|
|
29
|
+
rowRef,
|
|
27
30
|
...restProps
|
|
28
31
|
}: TExpandableRowProps,
|
|
29
32
|
ref,
|
|
@@ -51,6 +54,7 @@ export const TExpandableRow = forwardRef<HTMLTableRowElement, TExpandableRowProp
|
|
|
51
54
|
})}
|
|
52
55
|
selected={selected}
|
|
53
56
|
onClick={handleToggle}
|
|
57
|
+
ref={rowRef}
|
|
54
58
|
{...restProps}
|
|
55
59
|
/>
|
|
56
60
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { HTMLAttributes } from 'react';
|
|
1
|
+
import React, { forwardRef, HTMLAttributes } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
4
|
import { TCell, TCellProps } from '../tcell';
|
|
@@ -34,23 +34,21 @@ export type TRowProps = HTMLAttributes<HTMLTableRowElement> & {
|
|
|
34
34
|
dataTestId?: string;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
export const TRow = (
|
|
38
|
-
children,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
{...restProps}
|
|
53
|
-
>
|
|
54
|
-
{React.Children.map(children, (child, index) => React.cloneElement(child, { index }))}
|
|
55
|
-
</tr>
|
|
37
|
+
export const TRow = forwardRef<HTMLTableRowElement, TRowProps>(
|
|
38
|
+
({ children, className, selected, withoutBorder, dataTestId, ...restProps }, ref) => (
|
|
39
|
+
<tr
|
|
40
|
+
className={cn(styles.component, className, {
|
|
41
|
+
[styles.clickable]: typeof restProps.onClick !== 'undefined',
|
|
42
|
+
[styles.selected]: selected,
|
|
43
|
+
[styles.withoutBorder]: withoutBorder,
|
|
44
|
+
})}
|
|
45
|
+
data-test-id={dataTestId}
|
|
46
|
+
ref={ref}
|
|
47
|
+
{...restProps}
|
|
48
|
+
>
|
|
49
|
+
{React.Children.map(children, (child, index) => React.cloneElement(child, { index }))}
|
|
50
|
+
</tr>
|
|
51
|
+
),
|
|
56
52
|
);
|
|
53
|
+
|
|
54
|
+
TRow.displayName = 'TRow';
|