@kanda-libs/ks-component-ts 0.3.75 → 0.3.76
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/dist/index.d.ts +13863 -13861
- package/dist/index.esm.js +4 -4
- package/dist/index.esm.js.map +3 -3
- package/package.json +1 -1
- package/src/components/Table/Rows/Cell/constants.ts +1 -0
- package/src/components/Table/Rows/Cell/types.d.ts +2 -6
- package/src/components/Table/Rows/Cell/useCellProps.ts +5 -1
- package/src/components/Table/types.d.ts +9 -6
- package/src/generated/widget/index.tsx +65380 -65380
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@ export const CLASS_NAMES = {
|
|
|
2
2
|
container: "flex w-full h-full",
|
|
3
3
|
render:
|
|
4
4
|
"w-full my-auto text-style-g text-neutral-600 whitespace-nowrap overflow-hidden overflow-ellipsis",
|
|
5
|
+
renderNoOverflow: "w-full my-auto text-style-g text-neutral-600 ",
|
|
5
6
|
renderLoading: "w-full my-auto mr-8 text-style-g",
|
|
6
7
|
cell: {
|
|
7
8
|
base: "h-16 flex",
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import type { FunctionComponent } from "react";
|
|
2
2
|
import type { Cell } from "react-table";
|
|
3
3
|
import { StringIndexedObject } from "~/types";
|
|
4
|
+
import { TableRenderComponent } from "../../types";
|
|
4
5
|
|
|
5
6
|
export interface CellColumn {
|
|
6
|
-
renderComponent?:
|
|
7
|
-
component?: FunctionComponent;
|
|
8
|
-
props?: StringIndexedObject;
|
|
9
|
-
optionalProps?: string[];
|
|
10
|
-
value?: string;
|
|
11
|
-
};
|
|
7
|
+
renderComponent?: TableRenderComponent;
|
|
12
8
|
subAccessors?: string[];
|
|
13
9
|
}
|
|
14
10
|
|
|
@@ -51,13 +51,17 @@ export default function useCellProps({
|
|
|
51
51
|
}
|
|
52
52
|
: {};
|
|
53
53
|
|
|
54
|
+
const renderClassName = renderComponent?.removeOverflowRestriction
|
|
55
|
+
? CLASS_NAMES.renderNoOverflow
|
|
56
|
+
: CLASS_NAMES.render;
|
|
57
|
+
|
|
54
58
|
const classNames = {
|
|
55
59
|
cell: clsx(
|
|
56
60
|
compact ? CLASS_NAMES.cell.compact : CLASS_NAMES.cell.base,
|
|
57
61
|
index === 0 ? "" : CLASS_NAMES.cell.padding
|
|
58
62
|
),
|
|
59
63
|
container: CLASS_NAMES.container,
|
|
60
|
-
render: isLoading ? CLASS_NAMES.renderLoading :
|
|
64
|
+
render: isLoading ? CLASS_NAMES.renderLoading : renderClassName,
|
|
61
65
|
};
|
|
62
66
|
|
|
63
67
|
return {
|
|
@@ -17,6 +17,14 @@ export interface TableAction {
|
|
|
17
17
|
payload: [direction: string, id: number];
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
export interface TableRenderComponent {
|
|
21
|
+
component?: FunctionComponent<any>;
|
|
22
|
+
value?: string;
|
|
23
|
+
props?: StringIndexedObject;
|
|
24
|
+
optionalProps?: string[];
|
|
25
|
+
removeOverflowRestriction?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
20
28
|
export interface TableHeaderColumn {
|
|
21
29
|
id: DraggableId;
|
|
22
30
|
render: (label: string) => string;
|
|
@@ -37,12 +45,7 @@ export interface TableHeaderColumn {
|
|
|
37
45
|
width?: number;
|
|
38
46
|
minWidth?: number;
|
|
39
47
|
maxWidth?: number;
|
|
40
|
-
renderComponent?:
|
|
41
|
-
component?: FunctionComponent<any>;
|
|
42
|
-
value?: string;
|
|
43
|
-
props?: StringIndexedObject;
|
|
44
|
-
optionalProps?: string[];
|
|
45
|
-
};
|
|
48
|
+
renderComponent?: TableRenderComponent;
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
export interface TableProps {
|