@lynx-js/lynx-ui-swipe-action 0.0.0 → 3.130.0

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.
@@ -0,0 +1,102 @@
1
+ import type { ForwardedRef, ReactElement } from '@lynx-js/react';
2
+ import type { ComponentBasicProps } from '@lynx-js/lynx-ui-common';
3
+ export type SwipeAction = (props: SwipeActionProps) => ReactElement;
4
+ export interface SwipeActionProps extends ComponentBasicProps {
5
+ ref?: ForwardedRef<SwipeActionRef>;
6
+ /**
7
+ * Whether allow swipe action. When it set to false, this item can only be used to display content.
8
+ * @zh 是否允许滑动操作。当设置为 false 时,SwipeAction 只能用来显示内容。
9
+ * @defaultValue true
10
+ * @Android
11
+ * @iOS
12
+ */
13
+ enableSwipe: boolean;
14
+ /**
15
+ * Id of the SwipeAction. The onSwipeStart, onSwipeEnd and onAction will be called with this id.
16
+ * @zh SwipeAction 的id。
17
+ * @Android
18
+ * @iOS
19
+ */
20
+ swipeActionId: string;
21
+ /**
22
+ * Display area of the SwipeAction. The content of this area will be displayed on the left side of the SwipeAction.
23
+ * @zh SwipeAction 的内容。内容会显示在 SwipeAction 的左侧。
24
+ * @Android
25
+ * @iOS
26
+ */
27
+ displayArea: ReactElement;
28
+ /**
29
+ * Action area of the SwipeAction. The content of this area will be displayed on the right side of the SwipeAction. Before swipe or showActionArea called, this area will be hidden.
30
+ * @zh SwipeAction 的内容。内容会显示在 SwipeAction 的右侧。在用手滚动或调用 showActionArea 前,actionArea 不会显示。
31
+ * @Android
32
+ * @iOS
33
+ */
34
+ actionArea: ReactElement;
35
+ /**
36
+ * The size of the action area. If the swipeAction is used inside List, the reuse of the List may cause the actionArea to have wrong size. You can use this property to set the initial size of the actionArea.
37
+ * @zh actionArea 的大小。如果在 list 中使用 SwipeAction,list 的复用可能会导致操作区域大小错误。这个属性可用于指定一个初始大小,尽可能接近于排版渲染后的大小。
38
+ * @defaultValue 0
39
+ * @Android
40
+ * @iOS
41
+ */
42
+ estimatedActionAreaSize?: number;
43
+ /**
44
+ * The content of the SwipeAction. The content will be displayed on the left side of the SwipeAction.
45
+ * @zh SwipeAction 的内容. 内容会显示在 SwipeAction 的左侧.
46
+ * @Android
47
+ * @iOS
48
+ */
49
+ children?: ReactElement;
50
+ /**
51
+ * Force touch event to send to SwipeAction.
52
+ * @zh 制触摸事件发送到 SwipeAction.
53
+ * @defaultValue true
54
+ * @iOS
55
+ */
56
+ iosEnableSimultaneousTouch?: boolean;
57
+ /**
58
+ * Display debug logs. Open it when you find a bug.
59
+ * @zh 显示调试日志。当你发现 bug 时打开它
60
+ * @Android
61
+ * @iOS
62
+ */
63
+ debugLog?: boolean;
64
+ /**
65
+ * Triggered when the SwipeAction is swiped.
66
+ * @zh SwipeAction 手动滚动开始时触发。
67
+ * @Android
68
+ * @iOS
69
+ */
70
+ onSwipeStart?: (id: string) => void;
71
+ /**
72
+ * Triggered when the SwipeAction swipe ends.
73
+ * @zh SwipeAction 手动滚动结束时触发。
74
+ * @Android
75
+ * @iOS
76
+ */
77
+ onSwipeEnd?: (id: string) => void;
78
+ /**
79
+ * Triggered when the actionArea was tapped. Can be used to delete or other actions.
80
+ * @zh ActionArea 被点击时触发,可用于实现删除或其他操作。
81
+ * @Android
82
+ * @iOS
83
+ */
84
+ onAction?: (id: string) => void;
85
+ }
86
+ export interface SwipeActionRef {
87
+ /**
88
+ * Call to display the actionArea. If animated is true, the actionArea will be displayed with animation.
89
+ * @zh 调用以显示 actionArea。如果 animated 为 true,则显示过程将带有动画效果。
90
+ * @Android
91
+ * @iOS
92
+ */
93
+ showActionArea: (animated: boolean) => void;
94
+ /**
95
+ * Call to hide the actionArea. If animated is true, the actionArea will be hidden with animation.
96
+ * @zh 调用以隐藏 actionArea. 如果 animated 为 true,则隐藏过程将带有动画效果。
97
+ * @Android
98
+ * @iOS
99
+ */
100
+ closeActionArea: (animated: boolean) => void;
101
+ }
102
+ //# sourceMappingURL=index.docs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.docs.d.ts","sourceRoot":"","sources":["../../src/types/index.docs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAEhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAElE,MAAM,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,gBAAgB,KAAK,YAAY,CAAA;AAEnE,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D,GAAG,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAClC;;;;;;OAMG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB;;;;;OAKG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB;;;;;OAKG;IACH,WAAW,EAAE,YAAY,CAAA;IACzB;;;;;OAKG;IACH,UAAU,EAAE,YAAY,CAAA;IACxB;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB;;;;;OAKG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAA;IACpC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,cAAc,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAA;IAC3C;;;;;OAKG;IACH,eAAe,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAA;CAC7C"}
File without changes
package/package.json CHANGED
@@ -1,9 +1,52 @@
1
1
  {
2
2
  "name": "@lynx-js/lynx-ui-swipe-action",
3
- "version": "0.0.0",
4
- "description": "Empty placeholder package",
5
- "main": "index.js",
3
+ "version": "3.130.0",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/lynx-family/lynx-ui.git",
7
+ "directory": "packages/lynx-ui-swipe-action"
8
+ },
9
+ "license": "Apache-2.0",
10
+ "author": {
11
+ "name": "The Lynx Authors"
12
+ },
13
+ "sideEffects": false,
14
+ "type": "module",
15
+ "main": "./dist/index.jsx",
16
+ "module": "./dist/index.jsx",
17
+ "types": "./dist/index.d.ts",
18
+ "files": [
19
+ "src/**",
20
+ "README.md",
21
+ "CHANGELOG.md",
22
+ "LICENSE",
23
+ "tsconfig.docs.json",
24
+ "tsconfig.json",
25
+ "dist/**"
26
+ ],
27
+ "dependencies": {
28
+ "@lynx-js/gesture-runtime": "2.1.1",
29
+ "@lynx-js/lynx-ui-common": "3.130.0"
30
+ },
31
+ "devDependencies": {
32
+ "@lynx-js/react": "0.113.0",
33
+ "@lynx-js/types": "3.6.0",
34
+ "@rslib/core": "^0.16.0",
35
+ "@types/react": "^18.3.8",
36
+ "typescript": "^5.5.3"
37
+ },
38
+ "peerDependencies": {
39
+ "@lynx-js/react": ">=0.100.0",
40
+ "@lynx-js/types": "*",
41
+ "@types/react": "^18"
42
+ },
6
43
  "publishConfig": {
7
44
  "access": "public"
45
+ },
46
+ "jsnext:source": "./src/index.tsx",
47
+ "scripts": {
48
+ "build": "rslib build",
49
+ "build:watch": "rslib build --watch",
50
+ "test": "vitest"
8
51
  }
9
- }
52
+ }