mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
✨ feat(table): 添加 ComponentCell 以支持表格单元格中嵌入可渲染组件
This commit is contained in:
parent
fb0a9813e1
commit
25fa123d35
@ -12,6 +12,7 @@ from .components import (
|
|||||||
from .core import (
|
from .core import (
|
||||||
BaseCell,
|
BaseCell,
|
||||||
CodeElement,
|
CodeElement,
|
||||||
|
ComponentCell,
|
||||||
HeadingElement,
|
HeadingElement,
|
||||||
ImageCell,
|
ImageCell,
|
||||||
ImageElement,
|
ImageElement,
|
||||||
@ -49,6 +50,7 @@ __all__ = [
|
|||||||
"BaseCell",
|
"BaseCell",
|
||||||
"BaseChartData",
|
"BaseChartData",
|
||||||
"CodeElement",
|
"CodeElement",
|
||||||
|
"ComponentCell",
|
||||||
"Divider",
|
"Divider",
|
||||||
"EChartsData",
|
"EChartsData",
|
||||||
"HeadingElement",
|
"HeadingElement",
|
||||||
|
|||||||
@ -24,6 +24,7 @@ from .markdown import (
|
|||||||
from .notebook import NotebookData, NotebookElement
|
from .notebook import NotebookData, NotebookElement
|
||||||
from .table import (
|
from .table import (
|
||||||
BaseCell,
|
BaseCell,
|
||||||
|
ComponentCell,
|
||||||
ImageCell,
|
ImageCell,
|
||||||
RichTextCell,
|
RichTextCell,
|
||||||
StatusBadgeCell,
|
StatusBadgeCell,
|
||||||
@ -38,6 +39,7 @@ __all__ = [
|
|||||||
"BaseCell",
|
"BaseCell",
|
||||||
"CardData",
|
"CardData",
|
||||||
"CodeElement",
|
"CodeElement",
|
||||||
|
"ComponentCell",
|
||||||
"DetailsData",
|
"DetailsData",
|
||||||
"DetailsItem",
|
"DetailsItem",
|
||||||
"HeadingElement",
|
"HeadingElement",
|
||||||
|
|||||||
@ -10,6 +10,7 @@ from .text import TextSpan
|
|||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"BaseCell",
|
"BaseCell",
|
||||||
|
"ComponentCell",
|
||||||
"ImageCell",
|
"ImageCell",
|
||||||
"ProgressBarCell",
|
"ProgressBarCell",
|
||||||
"RichTextCell",
|
"RichTextCell",
|
||||||
@ -78,12 +79,20 @@ class RichTextCell(BaseCell):
|
|||||||
"""片段之间的间距"""
|
"""片段之间的间距"""
|
||||||
|
|
||||||
|
|
||||||
|
class ComponentCell(BaseCell):
|
||||||
|
"""一个通用的单元格,可以容纳任何可渲染的组件。"""
|
||||||
|
|
||||||
|
type: str = "component"
|
||||||
|
component: RenderableComponent
|
||||||
|
|
||||||
|
|
||||||
TableCell = (
|
TableCell = (
|
||||||
TextCell
|
TextCell
|
||||||
| ImageCell
|
| ImageCell
|
||||||
| StatusBadgeCell
|
| StatusBadgeCell
|
||||||
| ProgressBarCell
|
| ProgressBarCell
|
||||||
| RichTextCell
|
| RichTextCell
|
||||||
|
| ComponentCell
|
||||||
| str
|
| str
|
||||||
| int
|
| int
|
||||||
| float
|
| float
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user