@pinnacle0/web-ui 0.3.2 → 0.3.3-beta0

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.
Files changed (49) hide show
  1. package/core/VirtualTable/index.d.ts +2 -21
  2. package/core/VirtualTable/index.js +3 -5
  3. package/core/VirtualTable/index.js.map +1 -1
  4. package/core/VirtualTable/index.less +2 -3
  5. package/core/VirtualTable/useRowSelection.js +8 -35
  6. package/core/VirtualTable/useRowSelection.js.map +1 -1
  7. package/core/VirtualTable/useScrollToEdge.js +5 -9
  8. package/core/VirtualTable/useScrollToEdge.js.map +1 -1
  9. package/core/VirtualizedFlatList/CellMeasurer.d.ts +17 -0
  10. package/core/VirtualizedFlatList/CellMeasurer.js +36 -0
  11. package/core/VirtualizedFlatList/CellMeasurer.js.map +1 -0
  12. package/core/VirtualizedFlatList/CellMeasurerCache.d.ts +16 -0
  13. package/core/VirtualizedFlatList/CellMeasurerCache.js +31 -0
  14. package/core/VirtualizedFlatList/CellMeasurerCache.js.map +1 -0
  15. package/core/VirtualizedFlatList/Footer.d.ts +8 -0
  16. package/core/VirtualizedFlatList/Footer.js +27 -0
  17. package/core/VirtualizedFlatList/Footer.js.map +1 -0
  18. package/core/VirtualizedFlatList/ListItem.d.ts +4 -0
  19. package/core/VirtualizedFlatList/ListItem.js +43 -0
  20. package/core/VirtualizedFlatList/ListItem.js.map +1 -0
  21. package/core/VirtualizedFlatList/Loading.d.ts +7 -0
  22. package/core/VirtualizedFlatList/Loading.js +9 -0
  23. package/core/VirtualizedFlatList/Loading.js.map +1 -0
  24. package/core/VirtualizedFlatList/index.d.ts +29 -0
  25. package/core/VirtualizedFlatList/index.js +182 -0
  26. package/core/VirtualizedFlatList/index.js.map +1 -0
  27. package/core/VirtualizedFlatList/index.less +59 -0
  28. package/core/VirtualizedFlatList/type.d.ts +29 -0
  29. package/core/VirtualizedFlatList/type.js +2 -0
  30. package/core/VirtualizedFlatList/type.js.map +1 -0
  31. package/core/VirtualizedFlatList/useLoadingWithDelay.d.ts +1 -0
  32. package/core/VirtualizedFlatList/useLoadingWithDelay.js +51 -0
  33. package/core/VirtualizedFlatList/useLoadingWithDelay.js.map +1 -0
  34. package/hooks/useSwipe/controller.d.ts +20 -0
  35. package/hooks/useSwipe/controller.js +126 -0
  36. package/hooks/useSwipe/controller.js.map +1 -0
  37. package/hooks/useSwipe/index.d.ts +3 -0
  38. package/hooks/useSwipe/index.js +9 -0
  39. package/hooks/useSwipe/index.js.map +1 -0
  40. package/hooks/useSwipe/type.d.ts +38 -0
  41. package/hooks/useSwipe/type.js +8 -0
  42. package/hooks/useSwipe/type.js.map +1 -0
  43. package/hooks/useTransform.d.ts +18 -0
  44. package/hooks/useTransform.js +50 -0
  45. package/hooks/useTransform.js.map +1 -0
  46. package/package.json +8 -2
  47. package/util/SwipeUtil.d.ts +8 -0
  48. package/util/SwipeUtil.js +26 -0
  49. package/util/SwipeUtil.js.map +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinnacle0/web-ui",
3
- "version": "0.3.2",
3
+ "version": "0.3.3-beta0",
4
4
  "author": "Pinnacle",
5
5
  "license": "MIT",
6
6
  "sideEffects": [
@@ -19,6 +19,7 @@
19
19
  "run-script": "ts-node --project config/tsconfig.script.json",
20
20
  "build": "yarn run-script script/build.ts",
21
21
  "start": "yarn run-script script/start.ts",
22
+ "start:mobile": "yarn run-script script/start-mobile.ts",
22
23
  "format": "yarn run-script script/format.ts",
23
24
  "test": "jest --config config/jest.config.js"
24
25
  },
@@ -27,7 +28,10 @@
27
28
  "antd": "4.20.1",
28
29
  "braft-editor": "2.3.9",
29
30
  "moment": "2.29.3",
30
- "react-virtual": "2.10.4"
31
+ "react-virtual": "2.10.4",
32
+ "react-virtualized": "^9.22.3",
33
+ "react-virtualized-auto-sizer": "^1.0.6",
34
+ "react-window": "^1.8.6"
31
35
  },
32
36
  "peerDependencies": {
33
37
  "@babel/runtime": ">=7.12.1",
@@ -47,6 +51,8 @@
47
51
  "@types/react": "18.0.8",
48
52
  "@types/react-dom": "17.0.14",
49
53
  "@types/react-router-dom": "5.3.2",
54
+ "@types/react-virtualized-auto-sizer": "^1.0.1",
55
+ "@types/react-window": "1.8.5",
50
56
  "less": "4.1.2",
51
57
  "react": "18.1.0",
52
58
  "react-dom": "18.1.0",
@@ -0,0 +1,8 @@
1
+ import { Direction } from "../hooks/useSwipe";
2
+ declare function getDirection(start: [number, number], end: [number, number]): Direction;
3
+ declare function getDisplacement(start: [number, number], end: [number, number]): number;
4
+ export declare const SwipeUtil: Readonly<{
5
+ getDirection: typeof getDirection;
6
+ getDisplacement: typeof getDisplacement;
7
+ }>;
8
+ export {};
@@ -0,0 +1,26 @@
1
+ import { Direction } from "../hooks/useSwipe";
2
+ function getDirection(start, end) {
3
+ var vector = [end[0] - start[0], start[1] - end[1]];
4
+ var degree = (Math.atan2(vector[1], vector[0]) * 180) / Math.PI;
5
+ degree = degree < 0 ? degree + 360 : degree;
6
+ if ((degree >= 315 && degree < 360) || (degree >= 0 && degree < 45)) {
7
+ return Direction.RIGHT;
8
+ }
9
+ else if (degree >= 45 && degree < 135) {
10
+ return Direction.UP;
11
+ }
12
+ else if (degree >= 135 && degree < 225) {
13
+ return Direction.LEFT;
14
+ }
15
+ else {
16
+ return Direction.DOWN;
17
+ }
18
+ }
19
+ function getDisplacement(start, end) {
20
+ return Math.sqrt(Math.pow(start[0] - end[0], 2) + Math.pow(start[1] - end[1], 2));
21
+ }
22
+ export var SwipeUtil = Object.freeze({
23
+ getDirection: getDirection,
24
+ getDisplacement: getDisplacement,
25
+ });
26
+ //# sourceMappingURL=SwipeUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwipeUtil.js","sourceRoot":"","sources":["../../src/util/SwipeUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,SAAS,YAAY,CAAC,KAAuB,EAAE,GAAqB;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