@sheinx/hooks 3.9.5-beta.4 → 3.9.5-beta.6
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pagination.d.ts","sourceRoot":"","sources":["use-pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,aAAa,UAAW,mBAAmB;;;;kBAqBT,MAAM,SAAS,MAAM;;;;;;;
|
|
1
|
+
{"version":3,"file":"use-pagination.d.ts","sourceRoot":"","sources":["use-pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,aAAa,UAAW,mBAAmB;;;;kBAqBT,MAAM,SAAS,MAAM;;;;;;;CAsC5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -43,12 +43,15 @@ var usePagination = function usePagination(props) {
|
|
|
43
43
|
if (currentProp !== undefined && currentProp !== current) setCurrent(currentProp);
|
|
44
44
|
}, [currentProp]);
|
|
45
45
|
var handleChange = (0, _usePersistFn.usePersistFn)(function (c, size) {
|
|
46
|
-
|
|
46
|
+
var newPageSize = size || pageSize;
|
|
47
|
+
var sizeChange = size !== undefined && pageSize !== size;
|
|
48
|
+
|
|
49
|
+
// Always update state and trigger onChange, even for the same page
|
|
50
|
+
// This allows handlers to re-execute logic when clicking the same page
|
|
47
51
|
setCurrent(c);
|
|
48
|
-
setPageSize(
|
|
52
|
+
setPageSize(newPageSize);
|
|
49
53
|
if (onChange) {
|
|
50
|
-
|
|
51
|
-
onChange(c, size || pageSize, sizeChange);
|
|
54
|
+
onChange(c, newPageSize, sizeChange);
|
|
52
55
|
}
|
|
53
56
|
});
|
|
54
57
|
var getRootProps = function getRootProps() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pagination.d.ts","sourceRoot":"","sources":["use-pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,aAAa,UAAW,mBAAmB;;;;kBAqBT,MAAM,SAAS,MAAM;;;;;;;
|
|
1
|
+
{"version":3,"file":"use-pagination.d.ts","sourceRoot":"","sources":["use-pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,aAAa,UAAW,mBAAmB;;;;kBAqBT,MAAM,SAAS,MAAM;;;;;;;CAsC5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -37,12 +37,15 @@ var usePagination = function usePagination(props) {
|
|
|
37
37
|
if (currentProp !== undefined && currentProp !== current) setCurrent(currentProp);
|
|
38
38
|
}, [currentProp]);
|
|
39
39
|
var handleChange = usePersistFn(function (c, size) {
|
|
40
|
-
|
|
40
|
+
var newPageSize = size || pageSize;
|
|
41
|
+
var sizeChange = size !== undefined && pageSize !== size;
|
|
42
|
+
|
|
43
|
+
// Always update state and trigger onChange, even for the same page
|
|
44
|
+
// This allows handlers to re-execute logic when clicking the same page
|
|
41
45
|
setCurrent(c);
|
|
42
|
-
setPageSize(
|
|
46
|
+
setPageSize(newPageSize);
|
|
43
47
|
if (onChange) {
|
|
44
|
-
|
|
45
|
-
onChange(c, size || pageSize, sizeChange);
|
|
48
|
+
onChange(c, newPageSize, sizeChange);
|
|
46
49
|
}
|
|
47
50
|
});
|
|
48
51
|
var getRootProps = function getRootProps() {
|