@para-ui/core 3.0.117 → 3.0.118

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Form/index.js CHANGED
@@ -3,7 +3,7 @@ import { _ as _slicedToArray } from '../_verture/slicedToArray-76060636.js';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
  import { DeepClone } from '@paraview/lib';
5
5
  import React__default from 'react';
6
- import { F as FormItem, l as localeJson, v as validate } from '../_verture/index-b698be52.js';
6
+ import { F as FormItem, l as localeJson, v as validate } from '../_verture/index-ce963e90.js';
7
7
  import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
8
8
  import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
9
9
  import '../_verture/unsupportedIterableToArray-cb478f24.js';
package/FormItem/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'react/jsx-runtime';
2
2
  import 'react';
3
- export { F as default } from '../_verture/index-b698be52.js';
3
+ export { F as default } from '../_verture/index-ce963e90.js';
4
4
  import 'clsx';
5
5
  import '../Label/index.js';
6
6
  import '../_verture/constant-66aa48a1.js';
@@ -25,8 +25,13 @@ export interface PaginationProps {
25
25
  flippingArrow?: PaginationFlippingArrow[];
26
26
  /** 自适应模式 只有type=complex生效,默认true */
27
27
  autoType?: boolean;
28
- /** 总数 */
28
+ /** 计算分页总数 */
29
29
  total?: number;
30
+ /** 分页总数渲染 */
31
+ totalRender?: {
32
+ realTotal: number;
33
+ render: React.ReactNode | null;
34
+ };
30
35
  /** 每页行数 */
31
36
  rowsPerPage?: number[];
32
37
  /** 当前选中每页行数 */
@@ -77,6 +77,7 @@ var Pagination = function Pagination(props) {
77
77
  autoType = _props$autoType === void 0 ? true : _props$autoType,
78
78
  _props$total = props.total,
79
79
  total = _props$total === void 0 ? 0 : _props$total,
80
+ totalRender = props.totalRender,
80
81
  _props$rowsPerPage = props.rowsPerPage,
81
82
  rowsPerPage = _props$rowsPerPage === void 0 ? [10, 20, 30] : _props$rowsPerPage,
82
83
  _props$flippingArrow = props.flippingArrow,
@@ -302,8 +303,13 @@ var Pagination = function Pagination(props) {
302
303
  if (typeCom === 'simple' || notLayout('sizes')) {
303
304
  return null;
304
305
  }
306
+ var _ref = totalRender || {},
307
+ _ref$realTotal = _ref.realTotal,
308
+ realTotal = _ref$realTotal === void 0 ? 0 : _ref$realTotal,
309
+ _ref$render = _ref.render,
310
+ render = _ref$render === void 0 ? null : _ref$render;
305
311
  // 共{total}条
306
- return jsx("div", Object.assign({
312
+ var rawTotal = jsx("div", Object.assign({
307
313
  className: "total-num pagination-space"
308
314
  }, {
309
315
  children: intl({
@@ -312,7 +318,14 @@ var Pagination = function Pagination(props) {
312
318
  total: total
313
319
  })
314
320
  }));
315
- }, [total, language, locale, typeCom]);
321
+ var realTotalRender = jsx("div", Object.assign({
322
+ className: "total-num pagination-space"
323
+ }, {
324
+ children: render
325
+ }));
326
+ if (!realTotal) return rawTotal;
327
+ return total < realTotal ? realTotalRender : rawTotal;
328
+ }, [total, totalRender, language, locale, typeCom]);
316
329
  /* 每页行数 */
317
330
  var PageLineMemo = useMemo(function () {
318
331
  if (notLayout('pageRow')) {
package/README.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 版本: 3.0.118
2
+
3
+ para-ui/core@3.0.118 发布
4
+ 【表格-Table】添加属性paginationTotalRender
5
+
1
6
  ## 版本: 3.0.117
2
7
 
3
8
  para-ui/core@3.0.117 发布
package/Table/index.js CHANGED
@@ -1638,6 +1638,7 @@ var TableHead = function TableHead(props) {
1638
1638
  flippingArrow = props.flippingArrow,
1639
1639
  autoPagination = props.autoPagination,
1640
1640
  total = props.total,
1641
+ paginationTotalRender = props.paginationTotalRender,
1641
1642
  page = props.page,
1642
1643
  rowsPerPage = props.rowsPerPage,
1643
1644
  currentRowsPerPage = props.currentRowsPerPage,
@@ -1736,6 +1737,7 @@ var TableHead = function TableHead(props) {
1736
1737
  autoType: autoPagination,
1737
1738
  flippingArrow: flippingArrow,
1738
1739
  total: total,
1740
+ totalRender: paginationTotalRender,
1739
1741
  page: page,
1740
1742
  rowsPerPage: rowsPerPage,
1741
1743
  currentRowsPerPage: currentRowsPerPage,
@@ -1831,6 +1833,7 @@ var Table = function Table(propsInit) {
1831
1833
  pagination = _props$pagination === void 0 ? true : _props$pagination,
1832
1834
  _props$paginationType = props.paginationType,
1833
1835
  paginationType = _props$paginationType === void 0 ? 'complex' : _props$paginationType,
1836
+ paginationTotalRender = props.paginationTotalRender,
1834
1837
  flippingArrow = props.flippingArrow,
1835
1838
  _props$autoPagination = props.autoPagination,
1836
1839
  autoPagination = _props$autoPagination === void 0 ? true : _props$autoPagination,
@@ -1924,7 +1927,7 @@ var Table = function Table(propsInit) {
1924
1927
  var _useState7 = useState(0),
1925
1928
  _useState8 = _slicedToArray(_useState7, 2),
1926
1929
  total = _useState8[0],
1927
- setTotal = _useState8[1]; // 总数
1930
+ setTotal = _useState8[1]; // 计算分页总数
1928
1931
  var _useState9 = useState([]),
1929
1932
  _useState10 = _slicedToArray(_useState9, 2),
1930
1933
  rowData = _useState10[0],
@@ -3082,6 +3085,7 @@ var Table = function Table(propsInit) {
3082
3085
  flippingArrow: flippingArrow,
3083
3086
  autoPagination: autoPagination,
3084
3087
  total: total,
3088
+ paginationTotalRender: paginationTotalRender,
3085
3089
  page: pageCom,
3086
3090
  currentRowsPerPage: sizeCom,
3087
3091
  rowsPerPage: sizeArrCom,
@@ -183,6 +183,13 @@ export interface TableProps extends TableHeadBodyPublicProps {
183
183
  pagination?: boolean;
184
184
  /** 分页模式 */
185
185
  paginationType?: 'simple' | 'complex' | PaginationLayout[];
186
+ /** 分页总数渲染 */
187
+ paginationTotalRender?: {
188
+ /** 真实总数 */
189
+ realTotal: number;
190
+ /** 总数渲染 */
191
+ render: React.ReactNode | null;
192
+ };
186
193
  /** 方向键layout,默认全有 */
187
194
  flippingArrow?: PaginationFlippingArrow[];
188
195
  /** 自适应分页,根据外容器大小,改变分页模式 */
@@ -18,8 +18,13 @@ export interface TablePaginationProps {
18
18
  paginationType?: 'simple' | 'complex' | PaginationLayout[];
19
19
  /** 方向键layout,默认全有 */
20
20
  flippingArrow?: PaginationFlippingArrow[];
21
- /** 总条数 */
21
+ /** 总条数用于计算分页总数 */
22
22
  total?: number;
23
+ /** 分页总数渲染 */
24
+ paginationTotalRender?: {
25
+ realTotal: number;
26
+ render: React.ReactNode | null;
27
+ };
23
28
  /** 当前页 */
24
29
  page?: number;
25
30
  /** 每页行数 */
package/index.js CHANGED
@@ -22,7 +22,7 @@ export { D as Dropdown } from './_verture/index-77f9e0fb.js';
22
22
  export { default as DynamicMultiBox } from './DynamicMultiBox/index.js';
23
23
  export { default as Empty } from './Empty/index.js';
24
24
  export { default as Form } from './Form/index.js';
25
- export { F as FormItem } from './_verture/index-b698be52.js';
25
+ export { F as FormItem } from './_verture/index-ce963e90.js';
26
26
  export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-305f73f4.js';
27
27
  export { default as GlobalContext, changeConfirmLocale, getConfirmLocale } from './GlobalContext/index.js';
28
28
  export { default as Help } from './Help/index.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@para-ui/core",
3
3
  "private": false,
4
- "version": "3.0.117",
4
+ "version": "3.0.118",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
7
7
  "description": "Powered by Para FED",