@sheinx/hooks 3.3.0-beta.10 → 3.3.0-beta.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -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;;;;kBAiBT,MAAM,SAAS,MAAM;;;;;;;CAiC5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
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;;;;;;;CAiC5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -39,6 +39,9 @@ var usePagination = function usePagination(props) {
39
39
  (0, _react.useEffect)(function () {
40
40
  if (pageSizeProp !== pageSize) setPageSize(pageSizeProp);
41
41
  }, [pageSizeProp]);
42
+ (0, _react.useEffect)(function () {
43
+ if (currentProp !== undefined && currentProp !== current) setCurrent(currentProp);
44
+ }, [currentProp]);
42
45
  var handleChange = (0, _usePersistFn.usePersistFn)(function (c, size) {
43
46
  if (c === current && size === undefined) return;
44
47
  setCurrent(c);
@@ -58,7 +61,7 @@ var usePagination = function usePagination(props) {
58
61
  return _objectSpread({}, mergedEventHandlers);
59
62
  };
60
63
  return {
61
- current: currentProp !== undefined ? currentProp : current,
64
+ current: current,
62
65
  pageSize: pageSize,
63
66
  total: total,
64
67
  onChange: handleChange,
@@ -1 +1 @@
1
- {"version":3,"file":"use-table-layout.d.ts","sourceRoot":"","sources":["use-table-layout.tsx"],"names":[],"mapp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AAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB;;;;;;;;;;;yBA8CX,MAAM,UAAU,MAAM;;;;;;;;CA+N5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -328,7 +328,7 @@ var useTableLayout = function useTableLayout(props) {
328
328
  (_cancelFunc = cancelFunc) === null || _cancelFunc === void 0 || _cancelFunc();
329
329
  };
330
330
  }, [scrollRef.current]);
331
- (0, _react.useLayoutEffect)(function () {
331
+ (0, _react.useEffect)(function () {
332
332
  if (adjust) {
333
333
  getColgroup(adjust === 'drag');
334
334
  setAdjust(false);
@@ -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;;;;kBAiBT,MAAM,SAAS,MAAM;;;;;;;CAiC5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
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;;;;;;;CAiC5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -33,6 +33,9 @@ var usePagination = function usePagination(props) {
33
33
  useEffect(function () {
34
34
  if (pageSizeProp !== pageSize) setPageSize(pageSizeProp);
35
35
  }, [pageSizeProp]);
36
+ useEffect(function () {
37
+ if (currentProp !== undefined && currentProp !== current) setCurrent(currentProp);
38
+ }, [currentProp]);
36
39
  var handleChange = usePersistFn(function (c, size) {
37
40
  if (c === current && size === undefined) return;
38
41
  setCurrent(c);
@@ -52,7 +55,7 @@ var usePagination = function usePagination(props) {
52
55
  return _objectSpread({}, mergedEventHandlers);
53
56
  };
54
57
  return {
55
- current: currentProp !== undefined ? currentProp : current,
58
+ current: current,
56
59
  pageSize: pageSize,
57
60
  total: total,
58
61
  onChange: handleChange,
@@ -1 +1 @@
1
- {"version":3,"file":"use-table-layout.d.ts","sourceRoot":"","sources":["use-table-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAKlE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAcrE,MAAM,WAAW,mBACf,SAAQ,IAAI,CACV,cAAc,CAAC,GAAG,CAAC,EACnB,MAAM,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,OAAO,CAC7E;IACD,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB;;;;;;;;;;;yBA8CX,MAAM,UAAU,MAAM;;;;;;;;CA+N5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"use-table-layout.d.ts","sourceRoot":"","sources":["use-table-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAcrE,MAAM,WAAW,mBACf,SAAQ,IAAI,CACV,cAAc,CAAC,GAAG,CAAC,EACnB,MAAM,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,OAAO,CAC7E;IACD,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB;;;;;;;;;;;yBA8CX,MAAM,UAAU,MAAM;;;;;;;;CA+N5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -14,7 +14,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
14
14
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
15
15
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
16
16
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
- import React, { useEffect, useRef, useLayoutEffect } from 'react';
17
+ import React, { useEffect, useRef } from 'react';
18
18
  import useLatestObj from "../../common/use-latest-obj";
19
19
  import usePersistFn from "../../common/use-persist-fn";
20
20
  import usePrevious from "../../common/use-previous";
@@ -319,7 +319,7 @@ var useTableLayout = function useTableLayout(props) {
319
319
  (_cancelFunc = cancelFunc) === null || _cancelFunc === void 0 || _cancelFunc();
320
320
  };
321
321
  }, [scrollRef.current]);
322
- useLayoutEffect(function () {
322
+ useEffect(function () {
323
323
  if (adjust) {
324
324
  getColgroup(adjust === 'drag');
325
325
  setAdjust(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.3.0-beta.10",
3
+ "version": "3.3.0-beta.11",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",