Add object list color value view

This commit is contained in:
2022-03-04 17:37:53 +08:00
parent e7533fab55
commit ca3a19f5b0
4 changed files with 38 additions and 8 deletions
+7
View File
@@ -0,0 +1,7 @@
div.object-list-color-value {
height: calc( 100% - 6px);
margin: 3px 0;
margin-left: 3px;
border-radius: 1000px;
width: 3px;
}
+17 -6
View File
@@ -2,6 +2,7 @@ import { Component, ReactNode } from "react";
import { DetailsList } from "@Component/DetailsList/DetailsList";
import { useStatus, IMixinStatusProps } from "@Context/Status";
import { Localization } from "@Component/Localization/Localization";
import "./ObjectList.scss";
@useStatus
class ObjectList extends Component<IMixinStatusProps> {
@@ -44,14 +45,24 @@ class ObjectList extends Component<IMixinStatusProps> {
}))}
columns={[
{
key: "color",
noDefaultStyle: true,
beforeCheckbox: true,
render: (color) => <div
className="object-list-color-value"
style={{
background: `rgb(${
Math.floor(color[0] * 255)
}, ${
Math.floor(color[1] * 255)
}, ${
Math.floor(color[2] * 255)
})`
}}
/>
}, {
key: "name",
render: (name) => <span>{name}</span>
// }, {
// key: "behaviors",
// render: (behaviors) => <span>{(behaviors as Record<"name", string>[]).map(r => r.name).join(", ")}</span>
// }, {
// key: "label",
// render: (label) => <span>{(label as Record<"name", string>[]).map(r => r.name).join(", ")}</span>
}
]}
/>