musae 1.3.1-beta.22 → 1.3.1-beta.23

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.
@@ -14,6 +14,7 @@ var relax = require('@aiszlab/relax');
14
14
  var className = require('@aiszlab/relax/class-name');
15
15
  var useClassNames = require('../../hooks/use-class-names.cjs');
16
16
  var context = require('./context.cjs');
17
+ var theme = require('../theme/theme.cjs');
17
18
 
18
19
  var Pagination = function Pagination(_ref) {
19
20
  var _ref$total = _ref.total,
@@ -50,7 +51,8 @@ var Pagination = function Pagination(_ref) {
50
51
  onPageSizeChange = _usePagiantion.onPageSizeChange;
51
52
  var styled = {
52
53
  pagination: stylex.props(styles.default.pagination.base),
53
- sizer: stylex.props(styles.default.pagination.sizer)
54
+ sizer: stylex.props(styles.default.pagination.sizer),
55
+ range: stylex.props(styles.default.pagination.range, theme.$body.small)
54
56
  };
55
57
  var pages = Math.max(1, Math.ceil(total / Math.max(1, pageSize)));
56
58
  var sizeOptions = React.useMemo(function () {
@@ -67,7 +69,10 @@ var Pagination = function Pagination(_ref) {
67
69
  }, /*#__PURE__*/React.createElement("ul", {
68
70
  className: styled.pagination.className,
69
71
  style: styled.pagination.style
70
- }, paginationItems.map(function (item$1) {
72
+ }, /*#__PURE__*/React.createElement("li", {
73
+ className: styled.range.className,
74
+ style: styled.range.style
75
+ }, locale.range(total === 0 ? 0 : Math.min(total, (at - 1) * pageSize + 1), Math.min(at * pageSize, total), total)), paginationItems.map(function (item$1) {
71
76
  return /*#__PURE__*/React.createElement("li", {
72
77
  key: item$1
73
78
  }, /*#__PURE__*/React.createElement(item.default, {
@@ -10,6 +10,7 @@ import { unique, toFunction } from '@aiszlab/relax';
10
10
  import { stringify } from '@aiszlab/relax/class-name';
11
11
  import { useClassNames } from '../../hooks/use-class-names.mjs';
12
12
  import { CLASS_NAMES } from './context.mjs';
13
+ import { $body } from '../theme/theme.mjs';
13
14
 
14
15
  var Pagination = function Pagination(_ref) {
15
16
  var _ref$total = _ref.total,
@@ -46,7 +47,8 @@ var Pagination = function Pagination(_ref) {
46
47
  onPageSizeChange = _usePagiantion.onPageSizeChange;
47
48
  var styled = {
48
49
  pagination: props(styles.pagination.base),
49
- sizer: props(styles.pagination.sizer)
50
+ sizer: props(styles.pagination.sizer),
51
+ range: props(styles.pagination.range, $body.small)
50
52
  };
51
53
  var pages = Math.max(1, Math.ceil(total / Math.max(1, pageSize)));
52
54
  var sizeOptions = useMemo(function () {
@@ -63,7 +65,10 @@ var Pagination = function Pagination(_ref) {
63
65
  }, /*#__PURE__*/React.createElement("ul", {
64
66
  className: styled.pagination.className,
65
67
  style: styled.pagination.style
66
- }, paginationItems.map(function (item) {
68
+ }, /*#__PURE__*/React.createElement("li", {
69
+ className: styled.range.className,
70
+ style: styled.range.style
71
+ }, locale.range(total === 0 ? 0 : Math.min(total, (at - 1) * pageSize + 1), Math.min(at * pageSize, total), total)), paginationItems.map(function (item) {
67
72
  return /*#__PURE__*/React.createElement("li", {
68
73
  key: item
69
74
  }, /*#__PURE__*/React.createElement(Item, {
@@ -15,7 +15,7 @@ var pagination = {
15
15
  base: {
16
16
  k1xSpc: "musaex-78zum5",
17
17
  kGNEyG: "musaex-6s0dn4",
18
- k1C7PZ: "musaex-5xj0sk",
18
+ k1C7PZ: "musaex-1bu9cvf",
19
19
  kH6xsr: "musaex-3ct3a4",
20
20
  kogj98: "musaex-q3gua8",
21
21
  kmVPX3: "musaex-1n775ky",
@@ -25,6 +25,11 @@ var pagination = {
25
25
  k1xSpc: "musaex-78zum5",
26
26
  kGNEyG: "musaex-6s0dn4",
27
27
  $$css: true
28
+ },
29
+ range: {
30
+ kMwMTN: "musaex-bq1wot",
31
+ khDVqt: "musaex-uxw1ft",
32
+ $$css: true
28
33
  }
29
34
  };
30
35
  var styles = {
@@ -32,6 +32,10 @@ declare const styles: {
32
32
  readonly display: import("@stylexjs/stylex").StyleXClassNameFor<"display", "flex">;
33
33
  readonly alignItems: import("@stylexjs/stylex").StyleXClassNameFor<"alignItems", "center">;
34
34
  }>;
35
+ readonly range: Readonly<{
36
+ readonly color: import("@stylexjs/stylex").StyleXClassNameFor<"color", "var(--color-on-surface-variant)">;
37
+ readonly whiteSpace: import("@stylexjs/stylex").StyleXClassNameFor<"whiteSpace", "nowrap">;
38
+ }>;
35
39
  }>;
36
40
  };
37
41
  export default styles;
@@ -11,7 +11,7 @@ var pagination = {
11
11
  base: {
12
12
  k1xSpc: "musaex-78zum5",
13
13
  kGNEyG: "musaex-6s0dn4",
14
- k1C7PZ: "musaex-5xj0sk",
14
+ k1C7PZ: "musaex-1bu9cvf",
15
15
  kH6xsr: "musaex-3ct3a4",
16
16
  kogj98: "musaex-q3gua8",
17
17
  kmVPX3: "musaex-1n775ky",
@@ -21,6 +21,11 @@ var pagination = {
21
21
  k1xSpc: "musaex-78zum5",
22
22
  kGNEyG: "musaex-6s0dn4",
23
23
  $$css: true
24
+ },
25
+ range: {
26
+ kMwMTN: "musaex-bq1wot",
27
+ khDVqt: "musaex-uxw1ft",
28
+ $$css: true
24
29
  }
25
30
  };
26
31
  var styles = {
@@ -14,6 +14,9 @@ var en_US = {
14
14
  pagination: {
15
15
  size: function size(_size) {
16
16
  return "".concat(_size, " items/page");
17
+ },
18
+ range: function range(from, to, total) {
19
+ return "".concat(from, "\u2013").concat(to, " of ").concat(total);
17
20
  }
18
21
  },
19
22
  popconfirm: {
@@ -10,6 +10,9 @@ var en_US = {
10
10
  pagination: {
11
11
  size: function size(_size) {
12
12
  return "".concat(_size, " items/page");
13
+ },
14
+ range: function range(from, to, total) {
15
+ return "".concat(from, "\u2013").concat(to, " of ").concat(total);
13
16
  }
14
17
  },
15
18
  popconfirm: {
@@ -14,6 +14,9 @@ var zh_CN = {
14
14
  pagination: {
15
15
  size: function size(_size) {
16
16
  return "".concat(_size, " \u6761/\u9875");
17
+ },
18
+ range: function range(from, to, total) {
19
+ return "".concat(from, "\u2013").concat(to, " \u6761\uFF0C\u5171 ").concat(total, " \u6761");
17
20
  }
18
21
  },
19
22
  popconfirm: {
@@ -10,6 +10,9 @@ var zh_CN = {
10
10
  pagination: {
11
11
  size: function size(_size) {
12
12
  return "".concat(_size, " \u6761/\u9875");
13
+ },
14
+ range: function range(from, to, total) {
15
+ return "".concat(from, "\u2013").concat(to, " \u6761\uFF0C\u5171 ").concat(total, " \u6761");
13
16
  }
14
17
  },
15
18
  popconfirm: {
@@ -10,6 +10,7 @@ export interface Locale {
10
10
  };
11
11
  pagination: {
12
12
  size: string | ((size: number) => string);
13
+ range: (from: number, to: number, total: number) => string;
13
14
  };
14
15
  popconfirm: {
15
16
  confirm: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musae",
3
- "version": "1.3.1-beta.22",
3
+ "version": "1.3.1-beta.23",
4
4
  "description": "musae-ui",
5
5
  "author": "tutu@fantufantu.com",
6
6
  "license": "MIT",