@douyinfe/semi-foundation 2.39.1 → 2.39.2-alpha.0

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.
@@ -5,6 +5,7 @@ export interface PaginationAdapter<P = Record<string, any>, S = Record<string, a
5
5
  updateTotal: (total: number) => void;
6
6
  updatePageSize: (pageSize: number) => void;
7
7
  updateQuickJumpPage: (quickJumpPage: string | number) => void;
8
+ updateAllPageNumbers: (allPageNumbers: number[]) => void;
8
9
  setCurrentPage: (pageIndex: number) => void;
9
10
  registerKeyDownHandler: (handler: KeyDownHandler) => void;
10
11
  unregisterKeyDownHandler: (handler: KeyDownHandler) => void;
@@ -33,6 +34,7 @@ declare class PaginationFoundation<P = Record<string, any>, S = Record<string, a
33
34
  }): void;
34
35
  goPage(targetPageIndex: number | '...'): void;
35
36
  updatePage(targetPageIndex?: number, total?: number, pageSize?: number): void;
37
+ updateAllPageNumbers(total: number, pageSize: number): void;
36
38
  goPrev(): void;
37
39
  goNext(): void;
38
40
  _updatePageList(pageListInfo: {
@@ -103,6 +103,22 @@ class PaginationFoundation extends _foundation.default {
103
103
  this._adapter.setCurrentPage(targetPageIndex);
104
104
  this._adapter.updatePageSize(pageSize);
105
105
  }
106
+ updateAllPageNumbers(total, pageSize) {
107
+ // only need to update in small size
108
+ const {
109
+ size,
110
+ hoverShowPageSelect,
111
+ disabled
112
+ } = this.getProps();
113
+ if (size !== 'small' || !hoverShowPageSelect || disabled) {
114
+ return;
115
+ } else {
116
+ const pageNumbers = Array.from({
117
+ length: Math.ceil(total / pageSize)
118
+ }, (v, i) => i + 1);
119
+ this._adapter.updateAllPageNumbers(pageNumbers);
120
+ }
121
+ }
106
122
  goPrev() {
107
123
  const {
108
124
  currentPage
@@ -5,6 +5,7 @@ export interface PaginationAdapter<P = Record<string, any>, S = Record<string, a
5
5
  updateTotal: (total: number) => void;
6
6
  updatePageSize: (pageSize: number) => void;
7
7
  updateQuickJumpPage: (quickJumpPage: string | number) => void;
8
+ updateAllPageNumbers: (allPageNumbers: number[]) => void;
8
9
  setCurrentPage: (pageIndex: number) => void;
9
10
  registerKeyDownHandler: (handler: KeyDownHandler) => void;
10
11
  unregisterKeyDownHandler: (handler: KeyDownHandler) => void;
@@ -33,6 +34,7 @@ declare class PaginationFoundation<P = Record<string, any>, S = Record<string, a
33
34
  }): void;
34
35
  goPage(targetPageIndex: number | '...'): void;
35
36
  updatePage(targetPageIndex?: number, total?: number, pageSize?: number): void;
37
+ updateAllPageNumbers(total: number, pageSize: number): void;
36
38
  goPrev(): void;
37
39
  goNext(): void;
38
40
  _updatePageList(pageListInfo: {
@@ -96,6 +96,22 @@ class PaginationFoundation extends BaseFoundation {
96
96
  this._adapter.setCurrentPage(targetPageIndex);
97
97
  this._adapter.updatePageSize(pageSize);
98
98
  }
99
+ updateAllPageNumbers(total, pageSize) {
100
+ // only need to update in small size
101
+ const {
102
+ size,
103
+ hoverShowPageSelect,
104
+ disabled
105
+ } = this.getProps();
106
+ if (size !== 'small' || !hoverShowPageSelect || disabled) {
107
+ return;
108
+ } else {
109
+ const pageNumbers = Array.from({
110
+ length: Math.ceil(total / pageSize)
111
+ }, (v, i) => i + 1);
112
+ this._adapter.updateAllPageNumbers(pageNumbers);
113
+ }
114
+ }
99
115
  goPrev() {
100
116
  const {
101
117
  currentPage
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.39.1",
3
+ "version": "2.39.2-alpha.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build:lib": "node ./scripts/compileLib.js",
7
7
  "prepublishOnly": "npm run build:lib"
8
8
  },
9
9
  "dependencies": {
10
- "@douyinfe/semi-animation": "2.39.1",
10
+ "@douyinfe/semi-animation": "2.39.2-alpha.0",
11
11
  "async-validator": "^3.5.0",
12
12
  "classnames": "^2.2.6",
13
13
  "date-fns": "^2.29.3",
@@ -23,7 +23,7 @@
23
23
  "*.scss",
24
24
  "*.css"
25
25
  ],
26
- "gitHead": "f35dea361d04de2c89c272a1f561ac945ad13aa3",
26
+ "gitHead": "66cb227376f6e04f7fc6c163b6d37b3b534c92af",
27
27
  "devDependencies": {
28
28
  "@babel/plugin-transform-runtime": "^7.15.8",
29
29
  "@babel/preset-env": "^7.15.8",
@@ -7,6 +7,7 @@ export interface PaginationAdapter<P = Record<string, any>, S = Record<string, a
7
7
  updateTotal: (total: number) => void;
8
8
  updatePageSize: (pageSize: number) => void;
9
9
  updateQuickJumpPage: (quickJumpPage: string | number) => void;
10
+ updateAllPageNumbers: (allPageNumbers: number[]) => void;
10
11
  setCurrentPage: (pageIndex: number) => void;
11
12
  registerKeyDownHandler: (handler: KeyDownHandler) => void;
12
13
  unregisterKeyDownHandler: (handler: KeyDownHandler) => void;
@@ -102,6 +103,18 @@ class PaginationFoundation<P = Record<string, any>, S = Record<string, any>> ext
102
103
  this._adapter.updatePageSize(pageSize);
103
104
  }
104
105
 
106
+ updateAllPageNumbers(total: number, pageSize: number) {
107
+ // only need to update in small size
108
+
109
+ const { size, hoverShowPageSelect, disabled } = this.getProps();
110
+ if (size !== 'small' || !hoverShowPageSelect || disabled) {
111
+ return;
112
+ } else {
113
+ const pageNumbers = Array.from({ length: Math.ceil(total / pageSize) }, (v, i) => i + 1);
114
+ this._adapter.updateAllPageNumbers(pageNumbers);
115
+ }
116
+ }
117
+
105
118
  goPrev() {
106
119
  const { currentPage } = this.getStates();
107
120
  if (currentPage > 1) {