mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Create initial table tokens package
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
a20a1eade1
commit
11d708d9c7
15
package-lock.json
generated
15
package-lock.json
generated
@ -4095,6 +4095,10 @@
|
||||
"resolved": "packages/utility-features/startable-stoppable",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@k8slens/table-tokens": {
|
||||
"resolved": "packages/table",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@k8slens/test-utils": {
|
||||
"resolved": "packages/utility-features/test-utils",
|
||||
"link": true
|
||||
@ -36561,6 +36565,17 @@
|
||||
"rimraf": "^4.4.1"
|
||||
}
|
||||
},
|
||||
"packages/table": {
|
||||
"version": "6.5.0-alpha.7",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@k8slens/webpack": "^6.5.0-alpha.8",
|
||||
"rimraf": "^4.4.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@ogre-tools/injectable": "^16.1.0"
|
||||
}
|
||||
},
|
||||
"packages/technical-features/application/agnostic": {
|
||||
"name": "@k8slens/application",
|
||||
"version": "6.5.0-alpha.8",
|
||||
|
||||
3
packages/table/README.md
Normal file
3
packages/table/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Description
|
||||
|
||||
The package exports tokens needed for external table configuration.
|
||||
30
packages/table/index.ts
Normal file
30
packages/table/index.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import React from "react";
|
||||
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/src/kube-list-layout-column";
|
||||
|
||||
export interface TableDataContextValue {
|
||||
columns?: (
|
||||
| BaseKubeObjectListLayoutColumn<KubeObject>
|
||||
| SpecificKubeListLayoutColumn<KubeObject>
|
||||
| GeneralKubeObjectListLayoutColumn
|
||||
)[];
|
||||
}
|
||||
|
||||
export const TableDataContext = React.createContext<TableDataContextValue>({
|
||||
columns: [],
|
||||
});
|
||||
|
||||
export type CreateTableState<Props> = (context: TableDataContextValue, props: Props) => any;
|
||||
|
||||
export const createTableStateInjectionToken = getInjectionToken<CreateTableState<any>>({
|
||||
id: "create-table-state-injection-token",
|
||||
});
|
||||
|
||||
export const tableComponentInjectionToken = getInjectionToken<React.ComponentType<any>>({
|
||||
id: "table-component-injection-token",
|
||||
});
|
||||
28
packages/table/package.json
Normal file
28
packages/table/package.json
Normal 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
packages/table/tsconfig.json
Normal file
4
packages/table/tsconfig.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "@k8slens/typescript/config/base.json",
|
||||
"include": ["**/*.ts"]
|
||||
}
|
||||
1
packages/table/webpack.config.js
Normal file
1
packages/table/webpack.config.js
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require("@k8slens/webpack").configForNode;
|
||||
Loading…
Reference in New Issue
Block a user