|
@@ -1,4 +1,4 @@
|
|
-from typing import Dict
|
|
|
|
|
|
+from typing import Dict, List
|
|
|
|
|
|
from ..dependencies import register_component
|
|
from ..dependencies import register_component
|
|
from ..element import Element
|
|
from ..element import Element
|
|
@@ -8,16 +8,18 @@ register_component('table', __file__, 'table.js', ['lib/ag-grid-community.min.js
|
|
|
|
|
|
class Table(Element):
|
|
class Table(Element):
|
|
|
|
|
|
- def __init__(self, options: Dict, *, theme: str = 'balham') -> None:
|
|
|
|
|
|
+ def __init__(self, options: Dict, *, html_columns: List[int] = [], theme: str = 'balham') -> None:
|
|
"""Table
|
|
"""Table
|
|
|
|
|
|
An element to create a table using `AG Grid <https://www.ag-grid.com/>`_.
|
|
An element to create a table using `AG Grid <https://www.ag-grid.com/>`_.
|
|
|
|
|
|
:param options: dictionary of AG Grid options
|
|
:param options: dictionary of AG Grid options
|
|
|
|
+ :param html_columns: list of columns that should be rendered as HTML (default: `[]`)
|
|
:param theme: AG Grid theme (default: 'balham')
|
|
:param theme: AG Grid theme (default: 'balham')
|
|
"""
|
|
"""
|
|
super().__init__('table')
|
|
super().__init__('table')
|
|
self._props['options'] = options
|
|
self._props['options'] = options
|
|
|
|
+ self._props['html_columns'] = html_columns
|
|
self._classes = [f'ag-theme-{theme}', 'w-full', 'h-64']
|
|
self._classes = [f'ag-theme-{theme}', 'w-full', 'h-64']
|
|
|
|
|
|
@property
|
|
@property
|