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

Issue:
[Feature] `AntdPagination`新增`align`参数，用于设置对齐方式



Discussion / hints:

Fix patch:
diff --git a/feffery_antd_components/AntdPagination.py b/feffery_antd_components/AntdPagination.py
index 87a06b64..b038ae43 100644
--- a/feffery_antd_components/AntdPagination.py
+++ b/feffery_antd_components/AntdPagination.py
@@ -12,6 +12,9 @@ class AntdPagination(Component):
 - id (string; optional):
     组件唯一id.
 
+- align (a value equal to: 'start', 'center', 'end'; default 'start'):
+    组件尺寸规格，可选项有`'start'`、`'center'`、`'end'`  默认值：`'start'`.
+
 - aria-* (string; optional):
     `aria-*`格式属性通配.
 
@@ -112,10 +115,10 @@ class AntdPagination(Component):
     _namespace = 'feffery_antd_components'
     _type = 'AntdPagination'
     @_explicitize_args
-    def __init__(self, id=Component.UNDEFINED, key=Component.UNDEFINED, style=Component.UNDEFINED, className=Component.UNDEFINED, locale=Component.UNDEFINED, defaultCurrent=Component.UNDEFINED, defaultPageSize=Component.UNDEFINED, current=Component.UNDEFINED, disabled=Component.UNDEFINED, hideOnSinglePage=Component.UNDEFINED, pageSize=Component.UNDEFINED, pageSizeOptions=Component.UNDEFINED, showSizeChanger=Component.UNDEFINED, showQuickJumper=Component.UNDEFINED, showTotalPrefix=Component.UNDEFINED, showTotalSuffix=Component.UNDEFINED, simple=Component.UNDEFINED, size=Component.UNDEFINED, total=Component.UNDEFINED, showTotal=Component.UNDEFINED, showLessItems=Component.UNDEFINED, batchPropsNames=Component.UNDEFINED, batchPropsValues=Component.UNDEFINED, loading_state=Component.UNDEFINED, persistence=Component.UNDEFINED, persisted_props=Component.UNDEFINED, persistence_type=Component.UNDEFINED, **kwargs):
-        self._prop_names = ['id', 'aria-*', 'batchPropsNames', 'batchPropsValues', 'className', 'current', 'data-*', 'defaultCurrent', 'defaultPageSize', 'disabled', 'hideOnSinglePage', 'key', 'loading_state', 'locale', 'pageSize', 'pageSizeOptions', 'persisted_props', 'persistence', 'persistence_type', 'showLessItems', 'showQuickJumper', 'showSizeChanger', 'showTotal', 'showTotalPrefix', 'showTotalSuffix', 'simple', 'size', 'style', 'total']
+    def __init__(self, id=Component.UNDEFINED, key=Component.UNDEFINED, style=Component.UNDEFINED, className=Component.UNDEFINED, locale=Component.UNDEFINED, align=Component.UNDEFINED, defaultCurrent=Component.UNDEFINED, defaultPageSize=Component.UNDEFINED, current=Component.UNDEFINED, disabled=Component.UNDEFINED, hideOnSinglePage=Component.UNDEFINED, pageSize=Component.UNDEFINED, pageSizeOptions=Component.UNDEFINED, showSizeChanger=Component.UNDEFINED, showQuickJumper=Component.UNDEFINED, showTotalPrefix=Component.UNDEFINED, showTotalSuffix=Component.UNDEFINED, simple=Component.UNDEFINED, size=Component.UNDEFINED, total=Component.UNDEFINED, showTotal=Component.UNDEFINED, showLessItems=Component.UNDEFINED, batchPropsNames=Component.UNDEFINED, batchPropsValues=Component.UNDEFINED, loading_state=Component.UNDEFINED, persistence=Component.UNDEFINED, persisted_props=Component.UNDEFINED, persistence_type=Component.UNDEFINED, **kwargs):
+        self._prop_names = ['id', 'align', 'aria-*', 'batchPropsNames', 'batchPropsValues', 'className', 'current', 'data-*', 'defaultCurrent', 'defaultPageSize', 'disabled', 'hideOnSinglePage', 'key', 'loading_state', 'locale', 'pageSize', 'pageSizeOptions', 'persisted_props', 'persistence', 'persistence_type', 'showLessItems', 'showQuickJumper', 'showSizeChanger', 'showTotal', 'showTotalPrefix', 'showTotalSuffix', 'simple', 'size', 'style', 'total']
         self._valid_wildcard_attributes =            ['data-', 'aria-']
-        self.available_properties = ['id', 'aria-*', 'batchPropsNames', 'batchPropsValues', 'className', 'current', 'data-*', 'defaultCurrent', 'defaultPageSize', 'disabled', 'hideOnSinglePage', 'key', 'loading_state', 'locale', 'pageSize', 'pageSizeOptions', 'persisted_props', 'persistence', 'persistence_type', 'showLessItems', 'showQuickJumper', 'showSizeChanger', 'showTotal', 'showTotalPrefix', 'showTotalSuffix', 'simple', 'size', 'style', 'total']
+        self.available_properties = ['id', 'align', 'aria-*', 'batchPropsNames', 'batchPropsValues', 'className', 'current', 'data-*', 'defaultCurrent', 'defaultPageSize', 'disabled', 'hideOnSinglePage', 'key', 'loading_state', 'locale', 'pageSize', 'pageSizeOptions', 'persisted_props', 'persistence', 'persistence_type', 'showLessItems', 'showQuickJumper', 'showSizeChanger', 'showTotal', 'showTotalPrefix', 'showTotalSuffix', 'simple', 'size', 'style', 'total']
         self.available_wildcard_properties =            ['data-', 'aria-']
         _explicit_args = kwargs.pop('_explicit_args')
         _locals = locals()
diff --git a/src/lib/components/navigation/AntdPagination.react.js b/src/lib/components/navigation/AntdPagination.react.js
index 864b5139..6945e61c 100644
--- a/src/lib/components/navigation/AntdPagination.react.js
+++ b/src/lib/components/navigation/AntdPagination.react.js
@@ -22,6 +22,7 @@ const AntdPagination = (props) => {
         className,
         key,
         locale,
+        align,
         defaultCurrent,
         defaultPageSize,
         current,
@@ -96,6 +97,7 @@ const AntdPagination = (props) => {
                 style={style}
                 key={key}
                 pageSize={pageSize || defaultPageSize}
+                align={align}
                 defaultCurrent={defaultCurrent}
                 defaultPageSize={defaultPageSize}
                 current={current}
@@ -155,6 +157,12 @@ AntdPagination.propTypes = {
      */
     locale: PropTypes.oneOf(['zh-cn', 'en-us', 'de-de']),
 
+    /**
+     * 组件尺寸规格，可选项有`'start'`、`'center'`、`'end'`
+     * 默认值：`'start'`
+     */
+    align: PropTypes.oneOf(['start', 'center', 'end']),
+
     /**
      * 初始化时的当前页码
      * 默认值：`1`
@@ -312,6 +320,7 @@ AntdPagination.propTypes = {
 // 设置默认参数
 AntdPagination.defaultProps = {
     locale: 'zh-cn',
+    align: 'start',
     defaultCurrent: 1,
     defaultPageSize: 10,
     disabled: false,


Test patch:
diff --git a/tests/navigation/AntdPagination/feat_align.py b/tests/navigation/AntdPagination/feat_align.py
new file mode 100644
index 00000000..4f336524
--- /dev/null
+++ b/tests/navigation/AntdPagination/feat_align.py
@@ -0,0 +1,31 @@
+if True:
+    import sys
+
+    sys.path.append('../../../')
+    from dash import Dash, html
+    import feffery_antd_components as fac
+    from feffery_dash_utils.style_utils import style
+
+app = Dash(__name__)
+
+app.layout = html.Div(
+    [
+        fac.AntdDivider("align='start'"),
+        fac.AntdPagination(
+            defaultPageSize=10, total=100, align='start'
+        ),
+        fac.AntdDivider("align='center'"),
+        fac.AntdPagination(
+            defaultPageSize=10, total=100, align='center'
+        ),
+        fac.AntdDivider("align='end'"),
+        fac.AntdPagination(
+            defaultPageSize=10, total=100, align='end'
+        ),
+    ],
+    style=style(padding=50),
+)
+
+
+if __name__ == '__main__':
+    app.run(debug=True)