完善MECMAS21参数配置与分组交互
This commit is contained in:
1 parent
32f21f08ff
commit
be54070855
28 files changed
+3418
-202
No files matched your search
@@ -33,6 +33,26 @@ class PortDisplaySpec:
|
||||
order: int = 0
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ParameterGroupDisplaySpec:
|
||||
"""Ordered, collapsible presentation group for component parameters."""
|
||||
|
||||
id: str
|
||||
label: str
|
||||
parameters: tuple[str, ...]
|
||||
order: int = 0
|
||||
default_expanded: bool = False
|
||||
|
||||
def as_catalog_dict(self) -> dict[str, object]:
|
||||
return {
|
||||
"id": self.id,
|
||||
"label": self.label,
|
||||
"parameters": list(self.parameters),
|
||||
"order": self.order,
|
||||
"defaultExpanded": self.default_expanded,
|
||||
}
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ComponentDisplaySpec:
|
||||
"""Frontend metadata co-located with a component implementation."""
|
||||
@@ -44,6 +64,7 @@ class ComponentDisplaySpec:
|
||||
ports: tuple[PortDisplaySpec, ...]
|
||||
order: int = 0
|
||||
role: ComponentCatalogRole | None = None
|
||||
parameter_groups: tuple[ParameterGroupDisplaySpec, ...] = ()
|
||||
|
||||
@property
|
||||
def port_by_name(self) -> dict[str, PortDisplaySpec]:
|
||||
|
||||
Reference in new issue
Block a user