@sheinx/base 3.9.6-beta.2 → 3.9.6-beta.4

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":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;AAexD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,2CAowBxE"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;AAexD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,2CAuwBxE"}
@@ -328,8 +328,11 @@ function Table(props) {
328
328
  if (props.onScroll && typeof props.onScroll === 'function') {
329
329
  var maxWidth = target.scrollWidth - target.clientWidth;
330
330
  var maxHeight = target.scrollHeight - target.clientHeight;
331
- var x = Math.min(target.scrollLeft / maxWidth, 1);
332
- var y = Math.min(target.scrollTop / maxHeight, 1);
331
+ // 浏览器缩放时,scrollHeight/clientHeight 的取整方式不同,导致 scrollTop 最大值可能无法达到 maxHeight
332
+ // 例如:缩放到 80% 时,scrollTop 可能是 1981.25,而 maxHeight 是 1982
333
+ // 因此需要容错 1px 误差,当 scrollTop >= maxHeight - 1 时认为已滚动到底
334
+ var x = maxWidth > 0 ? maxWidth - target.scrollLeft < 1 ? 1 : Math.min(target.scrollLeft / maxWidth, 1) : 0;
335
+ var y = maxHeight > 0 ? maxHeight - target.scrollTop < 1 ? 1 : Math.min(target.scrollTop / maxHeight, 1) : 0;
333
336
  props.onScroll(x, y, target.scrollLeft, target.scrollTop);
334
337
  }
335
338
  syncHeaderScroll(target.scrollLeft);
@@ -1 +1 @@
1
- {"version":3,"file":"transfer-list-header.d.ts","sourceRoot":"","sources":["transfer-list-header.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAGtE,QAAA,MAAM,kBAAkB,sIAoHvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"transfer-list-header.d.ts","sourceRoot":"","sources":["transfer-list-header.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAGtE,QAAA,MAAM,kBAAkB,sIAsHvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -30,9 +30,10 @@ var TransferListHeader = function TransferListHeader(props) {
30
30
  }
31
31
  var every = true;
32
32
  var some = false;
33
- var vaildData = listDatum.getVaildData();
34
- if (vaildData.length === 0) return false;
35
- vaildData.forEach(function (item) {
33
+ if (data.length === 0) return false;
34
+ data.forEach(function (item) {
35
+ // 跳过禁用的项,不计入复选框状态
36
+ if (listDatum.disabledCheck(item)) return;
36
37
  if (!listDatum.check(item)) {
37
38
  every = false;
38
39
  } else {
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;AAexD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,2CAowBxE"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;AAexD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,2CAuwBxE"}
@@ -321,8 +321,11 @@ export default function Table(props) {
321
321
  if (props.onScroll && typeof props.onScroll === 'function') {
322
322
  var maxWidth = target.scrollWidth - target.clientWidth;
323
323
  var maxHeight = target.scrollHeight - target.clientHeight;
324
- var x = Math.min(target.scrollLeft / maxWidth, 1);
325
- var y = Math.min(target.scrollTop / maxHeight, 1);
324
+ // 浏览器缩放时,scrollHeight/clientHeight 的取整方式不同,导致 scrollTop 最大值可能无法达到 maxHeight
325
+ // 例如:缩放到 80% 时,scrollTop 可能是 1981.25,而 maxHeight 是 1982
326
+ // 因此需要容错 1px 误差,当 scrollTop >= maxHeight - 1 时认为已滚动到底
327
+ var x = maxWidth > 0 ? maxWidth - target.scrollLeft < 1 ? 1 : Math.min(target.scrollLeft / maxWidth, 1) : 0;
328
+ var y = maxHeight > 0 ? maxHeight - target.scrollTop < 1 ? 1 : Math.min(target.scrollTop / maxHeight, 1) : 0;
326
329
  props.onScroll(x, y, target.scrollLeft, target.scrollTop);
327
330
  }
328
331
  syncHeaderScroll(target.scrollLeft);
@@ -1 +1 @@
1
- {"version":3,"file":"transfer-list-header.d.ts","sourceRoot":"","sources":["transfer-list-header.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAGtE,QAAA,MAAM,kBAAkB,sIAoHvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"transfer-list-header.d.ts","sourceRoot":"","sources":["transfer-list-header.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAGtE,QAAA,MAAM,kBAAkB,sIAsHvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -24,9 +24,10 @@ var TransferListHeader = function TransferListHeader(props) {
24
24
  }
25
25
  var every = true;
26
26
  var some = false;
27
- var vaildData = listDatum.getVaildData();
28
- if (vaildData.length === 0) return false;
29
- vaildData.forEach(function (item) {
27
+ if (data.length === 0) return false;
28
+ data.forEach(function (item) {
29
+ // 跳过禁用的项,不计入复选框状态
30
+ if (listDatum.disabledCheck(item)) return;
30
31
  if (!listDatum.check(item)) {
31
32
  every = false;
32
33
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.9.6-beta.2",
3
+ "version": "3.9.6-beta.4",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -10,7 +10,7 @@
10
10
  "module": "./esm/index.js",
11
11
  "typings": "./cjs/index.d.ts",
12
12
  "dependencies": {
13
- "@sheinx/hooks": "3.9.6-beta.2",
13
+ "@sheinx/hooks": "3.9.6-beta.4",
14
14
  "immer": "^10.0.0",
15
15
  "classnames": "^2.0.0",
16
16
  "@shined/reactive": "^0.3.3"