Repository: CNFeffery/feffery-antd-components (language: python)

Issue:
[BUG] `AntdTable`组件`data`参数字段值不支持传入布尔类型



Discussion / hints:

Fix patch:
diff --git a/feffery_antd_components/AntdTable.py b/feffery_antd_components/AntdTable.py
index ed3c2017..8892f170 100644
--- a/feffery_antd_components/AntdTable.py
+++ b/feffery_antd_components/AntdTable.py
@@ -168,8 +168,8 @@ class AntdTable(Component):
 
     `data` is a list of dicts with strings as keys and values of type
     list of boolean | number | string | dict | lists | a list of or a
-    singular dash component, string or number | string | number | dict
-    with keys:
+    singular dash component, string or number | string | number |
+    boolean | dict with keys:
 
     - content (string; optional):
         链接显示的文字内容，优先级高于字段配置信息中的`renderLinkText`参数.
diff --git a/src/lib/components/dataDisplay/AntdTable.react.js b/src/lib/components/dataDisplay/AntdTable.react.js
index ddd22c2f..e3c02cd4 100644
--- a/src/lib/components/dataDisplay/AntdTable.react.js
+++ b/src/lib/components/dataDisplay/AntdTable.react.js
@@ -278,6 +278,7 @@ AntdTable.propTypes = {
                  * 其中`mini-prorgess`模式、`'mini-ring-progress'`模式下输入值需在0~1之间
                  */
                 PropTypes.number,
+                PropTypes.bool,
                 /**
                  * `'link'`模式
                  */


Test patch:
diff --git a/tests/dataDisplay/AntdTable/fix_field_bool.py b/tests/dataDisplay/AntdTable/fix_field_bool.py
new file mode 100644
index 00000000..35a85117
--- /dev/null
+++ b/tests/dataDisplay/AntdTable/fix_field_bool.py
@@ -0,0 +1,50 @@
+if True:
+    import sys
+
+    sys.path.append('../../../')
+    import dash
+    from dash import html
+    from datetime import datetime
+    import feffery_antd_components as fac
+
+app = dash.Dash(__name__)
+
+app.layout = html.Div(
+    [
+        fac.AntdTable(
+            columns=[
+                {
+                    'title': 'int型示例',
+                    'dataIndex': 'int型示例',
+                },
+                {
+                    'title': 'float型示例',
+                    'dataIndex': 'float型示例',
+                },
+                {
+                    'title': 'str型示例',
+                    'dataIndex': 'str型示例',
+                },
+                {
+                    'title': '日期时间示例',
+                    'dataIndex': '日期时间示例',
+                },
+            ],
+            data=[
+                {
+                    'int型示例': 123,
+                    'float型示例': 1.23,
+                    'str型示例': '示例字符',
+                    '日期时间示例': datetime.now(),
+                    '布尔类型示例': True,
+                }
+            ]
+            * 3,
+        )
+    ],
+    style={'padding': 100},
+)
+
+
+if __name__ == '__main__':
+    app.run(debug=True)