Table component injection tokens (#7754)

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev authored and GitHub committed 2023-05-26 13:32:25 +03:00
1 parent 4b63bc238e
commit 1ffdb6c89f
20 files changed
+167 -18

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
# Description
The package exports tokens needed for external table configuration.
+28
View File
@@ -0,0 +1,28 @@
import { getInjectionToken } from "@ogre-tools/injectable";
import type { KubeObject } from "@k8slens/kube-object/src/kube-object";
import type {
BaseKubeObjectListLayoutColumn,
GeneralKubeObjectListLayoutColumn,
SpecificKubeListLayoutColumn,
} from "@k8slens/list-layout";
type Column = (
| BaseKubeObjectListLayoutColumn<KubeObject>
| SpecificKubeListLayoutColumn<KubeObject>
| GeneralKubeObjectListLayoutColumn
);
export interface TableComponentProps {
tableId?: string;
columns?: Column[];
save?: (state: object) => void;
load?: (tableId: string) => object;
}
export interface TableComponent {
Component: React.ComponentType<TableComponentProps>;
}
export const tableComponentInjectionToken = getInjectionToken<TableComponent>({
id: "table-component-injection-token",
});
+28
View File
@@ -0,0 +1,28 @@
{
"name": "@k8slens/table-tokens",
"version": "6.5.0-alpha.7",
"description": "Injection token exporter for table components",
"license": "MIT",
"type": "commonjs",
"private": false,
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"clean": "rimraf dist/",
"build": "lens-webpack-build"
},
"devDependencies": {
"@k8slens/webpack": "^6.5.0-alpha.8",
"rimraf": "^4.4.1"
},
"peerDependencies": {
"@ogre-tools/injectable": "^16.1.0"
}
}
+4
View File
@@ -0,0 +1,4 @@
{
"extends": "@k8slens/typescript/config/base.json",
"include": ["**/*.ts"]
}
+1
View File
@@ -0,0 +1 @@
module.exports = require("@k8slens/webpack").configForNode;