@sheinx/hooks 3.3.6-beta.6 → 3.3.6-fix.1
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/cjs/common/use-input-able/use-Input-able.d.ts.map +1 -1
- package/cjs/common/use-input-able/use-Input-able.js +7 -8
- package/cjs/components/use-table/use-table-virtual.d.ts.map +1 -1
- package/cjs/components/use-table/use-table-virtual.js +3 -1
- package/esm/common/use-input-able/use-Input-able.d.ts.map +1 -1
- package/esm/common/use-input-able/use-Input-able.js +8 -9
- package/esm/components/use-table/use-table-virtual.d.ts.map +1 -1
- package/esm/components/use-table/use-table-virtual.js +3 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-Input-able.d.ts","sourceRoot":"","sources":["use-Input-able.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;;;;
|
|
1
|
+
{"version":3,"file":"use-Input-able.d.ts","sourceRoot":"","sources":["use-Input-able.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;;;;EAuE3F"}
|
|
@@ -45,19 +45,18 @@ function useInputAble(props) {
|
|
|
45
45
|
var render = (0, _useRender.useRender)(syncValue);
|
|
46
46
|
var shouldUseState = delay || !control;
|
|
47
47
|
var value = shouldUseState ? stateValue : valuePo;
|
|
48
|
-
(0, _react.
|
|
49
|
-
if (
|
|
48
|
+
(0, _react.useLayoutEffect)(function () {
|
|
49
|
+
if (delay && control && props.value !== stateValue) {
|
|
50
|
+
changeStateValue(props.value);
|
|
51
|
+
} else if (context.timer) {
|
|
50
52
|
clearTimeout(context.timer);
|
|
51
53
|
context.timer = null;
|
|
52
54
|
}
|
|
53
|
-
|
|
54
|
-
changeStateValue(props.value);
|
|
55
|
-
}
|
|
56
|
-
}, [props.value, delay]);
|
|
55
|
+
}, [props.value, delay, control]);
|
|
57
56
|
var forceDelayChange = (0, _usePersistFn.default)(function () {
|
|
58
|
-
if (context.
|
|
57
|
+
if (context.delayChange) context.delayChange();
|
|
58
|
+
if (context.timer) {
|
|
59
59
|
clearTimeout(context.timer);
|
|
60
|
-
context.delayChange();
|
|
61
60
|
context.timer = null;
|
|
62
61
|
context.delayChange = null;
|
|
63
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-table-virtual.d.ts","sourceRoot":"","sources":["use-table-virtual.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"use-table-virtual.d.ts","sourceRoot":"","sources":["use-table-virtual.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,UAAU,oBAAoB;IAC5B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC3C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;CACnC;AACD,QAAA,MAAM,eAAe,UAAW,oBAAoB;;;;;;;oBAsLpC,MAAM;mBACP,MAAM;WACd,MAAM;gBACD,MAAM;kBACJ,OAAO;;0BAtFuB,MAAM,UAAU,MAAM;0BAxBtB,MAAM,QAAQ,MAAM;2BAkJnB,MAAM;CAwFlD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -16,6 +16,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
16
16
|
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; }
|
|
17
17
|
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; } }
|
|
18
18
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
+
var MAX_ROW_SPAN = 200;
|
|
19
20
|
var useTableVirtual = function useTableVirtual(props) {
|
|
20
21
|
var _useState = (0, _react.useState)(0),
|
|
21
22
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -155,8 +156,9 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
155
156
|
sum += context.cachedHeight[i] || props.rowHeight;
|
|
156
157
|
var rowSpanHeight = 0;
|
|
157
158
|
if (rowSpanInfos) {
|
|
159
|
+
var maxRowSpanLenth = Math.min(rowSpanInfos.length, props.rowsInView > MAX_ROW_SPAN ? props.rowsInView : props.rowsInView || MAX_ROW_SPAN);
|
|
158
160
|
var siblingsIndexs = [];
|
|
159
|
-
for (var k = 0; k <
|
|
161
|
+
for (var k = 0; k < maxRowSpanLenth; k++) {
|
|
160
162
|
if (rowSpanInfos[k] <= i && k > i) {
|
|
161
163
|
siblingsIndexs.push(k);
|
|
162
164
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-Input-able.d.ts","sourceRoot":"","sources":["use-Input-able.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;;;;
|
|
1
|
+
{"version":3,"file":"use-Input-able.d.ts","sourceRoot":"","sources":["use-Input-able.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;;;;EAuE3F"}
|
|
@@ -4,7 +4,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
4
|
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; }
|
|
5
5
|
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; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import {
|
|
7
|
+
import { useLayoutEffect, useRef, useState } from 'react';
|
|
8
8
|
import { isFunc } from "../../utils/is";
|
|
9
9
|
import { shallowEqual } from "../../utils/shallow-equal";
|
|
10
10
|
import usePersistFn from "../use-persist-fn";
|
|
@@ -38,19 +38,18 @@ export default function useInputAble(props) {
|
|
|
38
38
|
var render = useRender(syncValue);
|
|
39
39
|
var shouldUseState = delay || !control;
|
|
40
40
|
var value = shouldUseState ? stateValue : valuePo;
|
|
41
|
-
|
|
42
|
-
if (
|
|
41
|
+
useLayoutEffect(function () {
|
|
42
|
+
if (delay && control && props.value !== stateValue) {
|
|
43
|
+
changeStateValue(props.value);
|
|
44
|
+
} else if (context.timer) {
|
|
43
45
|
clearTimeout(context.timer);
|
|
44
46
|
context.timer = null;
|
|
45
47
|
}
|
|
46
|
-
|
|
47
|
-
changeStateValue(props.value);
|
|
48
|
-
}
|
|
49
|
-
}, [props.value, delay]);
|
|
48
|
+
}, [props.value, delay, control]);
|
|
50
49
|
var forceDelayChange = usePersistFn(function () {
|
|
51
|
-
if (context.
|
|
50
|
+
if (context.delayChange) context.delayChange();
|
|
51
|
+
if (context.timer) {
|
|
52
52
|
clearTimeout(context.timer);
|
|
53
|
-
context.delayChange();
|
|
54
53
|
context.timer = null;
|
|
55
54
|
context.delayChange = null;
|
|
56
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-table-virtual.d.ts","sourceRoot":"","sources":["use-table-virtual.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"use-table-virtual.d.ts","sourceRoot":"","sources":["use-table-virtual.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,UAAU,oBAAoB;IAC5B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC3C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;CACnC;AACD,QAAA,MAAM,eAAe,UAAW,oBAAoB;;;;;;;oBAsLpC,MAAM;mBACP,MAAM;WACd,MAAM;gBACD,MAAM;kBACJ,OAAO;;0BAtFuB,MAAM,UAAU,MAAM;0BAxBtB,MAAM,QAAQ,MAAM;2BAkJnB,MAAM;CAwFlD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -10,6 +10,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import { usePersistFn } from "../../common/use-persist-fn";
|
|
12
12
|
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
13
|
+
var MAX_ROW_SPAN = 200;
|
|
13
14
|
var useTableVirtual = function useTableVirtual(props) {
|
|
14
15
|
var _useState = useState(0),
|
|
15
16
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -149,8 +150,9 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
149
150
|
sum += context.cachedHeight[i] || props.rowHeight;
|
|
150
151
|
var rowSpanHeight = 0;
|
|
151
152
|
if (rowSpanInfos) {
|
|
153
|
+
var maxRowSpanLenth = Math.min(rowSpanInfos.length, props.rowsInView > MAX_ROW_SPAN ? props.rowsInView : props.rowsInView || MAX_ROW_SPAN);
|
|
152
154
|
var siblingsIndexs = [];
|
|
153
|
-
for (var k = 0; k <
|
|
155
|
+
for (var k = 0; k < maxRowSpanLenth; k++) {
|
|
154
156
|
if (rowSpanInfos[k] <= i && k > i) {
|
|
155
157
|
siblingsIndexs.push(k);
|
|
156
158
|
}
|