clickgo 3.2.3 → 3.2.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.
- package/README.md +1 -1
- package/dist/app/demo/form/method/dom/dom.js +4 -4
- package/dist/clickgo.js +1 -1
- package/dist/clickgo.ts +1 -1
- package/dist/control/box.cgc +0 -0
- package/dist/control/common.cgc +0 -0
- package/dist/control/desc.cgc +0 -0
- package/dist/control/form.cgc +0 -0
- package/dist/control/html.cgc +0 -0
- package/dist/control/monaco.cgc +0 -0
- package/dist/control/nav.cgc +0 -0
- package/dist/control/property.cgc +0 -0
- package/dist/control/table.cgc +0 -0
- package/dist/control/task.cgc +0 -0
- package/dist/lib/dom.js +30 -4
- package/dist/lib/dom.ts +34 -7
- package/dist/lib/task.ts +1 -1
- package/dist/theme/byterun.cgt +0 -0
- package/dist/theme/familiar.cgt +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Load the module loader first, and then load it using the module loader.
|
|
|
28
28
|
**index.html**
|
|
29
29
|
|
|
30
30
|
```html
|
|
31
|
-
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.4.9/dist/loader.min.js?path=index&npm={'clickgo':'3.2.
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.4.9/dist/loader.min.js?path=index&npm={'clickgo':'3.2.4'}"></script>
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
**index.js**
|
|
@@ -121,9 +121,9 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
121
121
|
bindGesture(e) {
|
|
122
122
|
clickgo.dom.bindGesture(e, (ne, dir) => {
|
|
123
123
|
if (['top', 'bottom'].includes(dir)) {
|
|
124
|
-
return
|
|
124
|
+
return 1;
|
|
125
125
|
}
|
|
126
|
-
return
|
|
126
|
+
return 0;
|
|
127
127
|
}, (dir) => __awaiter(this, void 0, void 0, function* () {
|
|
128
128
|
this.bindGestureText = dir.slice(0, 1).toUpperCase() + dir.slice(1);
|
|
129
129
|
yield clickgo.tool.sleep(500);
|
|
@@ -133,9 +133,9 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
133
133
|
bindGestureWheel(e) {
|
|
134
134
|
clickgo.dom.bindGesture(e, (ne, dir) => {
|
|
135
135
|
if (['top', 'bottom', 'left', 'right'].includes(dir)) {
|
|
136
|
-
return
|
|
136
|
+
return 1;
|
|
137
137
|
}
|
|
138
|
-
return
|
|
138
|
+
return 0;
|
|
139
139
|
}, (dir) => __awaiter(this, void 0, void 0, function* () {
|
|
140
140
|
this.bindGestureWheelText = dir.slice(0, 1).toUpperCase() + dir.slice(1);
|
|
141
141
|
yield clickgo.tool.sleep(500);
|
package/dist/clickgo.js
CHANGED
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.zip = exports.tool = exports.theme = exports.task = exports.native = exports.fs = exports.form = exports.dom = exports.core = exports.control = exports.vue = exports.hasFrame = exports.isImmersion = exports.getPlatform = exports.isNative = exports.getVersion = void 0;
|
|
27
|
-
const version = '3.2.
|
|
27
|
+
const version = '3.2.4';
|
|
28
28
|
function getVersion() {
|
|
29
29
|
return version;
|
|
30
30
|
}
|
package/dist/clickgo.ts
CHANGED
package/dist/control/box.cgc
CHANGED
|
Binary file
|
package/dist/control/common.cgc
CHANGED
|
Binary file
|
package/dist/control/desc.cgc
CHANGED
|
Binary file
|
package/dist/control/form.cgc
CHANGED
|
Binary file
|
package/dist/control/html.cgc
CHANGED
|
Binary file
|
package/dist/control/monaco.cgc
CHANGED
|
Binary file
|
package/dist/control/nav.cgc
CHANGED
|
Binary file
|
|
Binary file
|
package/dist/control/table.cgc
CHANGED
|
Binary file
|
package/dist/control/task.cgc
CHANGED
|
Binary file
|
package/dist/lib/dom.js
CHANGED
|
@@ -878,7 +878,14 @@ function bindGesture(oe, before, handler) {
|
|
|
878
878
|
move: (e, d) => {
|
|
879
879
|
if (first < 0) {
|
|
880
880
|
if (first > -30) {
|
|
881
|
-
before(e, dir);
|
|
881
|
+
const rtn = before(e, dir);
|
|
882
|
+
if (rtn === 1) {
|
|
883
|
+
e.stopPropagation();
|
|
884
|
+
e.preventDefault();
|
|
885
|
+
}
|
|
886
|
+
else if (rtn === -1) {
|
|
887
|
+
e.stopPropagation();
|
|
888
|
+
}
|
|
882
889
|
--first;
|
|
883
890
|
}
|
|
884
891
|
return;
|
|
@@ -902,7 +909,15 @@ function bindGesture(oe, before, handler) {
|
|
|
902
909
|
dir = 'left';
|
|
903
910
|
}
|
|
904
911
|
}
|
|
905
|
-
|
|
912
|
+
const rtn = before(e, dir);
|
|
913
|
+
if (rtn === 1) {
|
|
914
|
+
e.stopPropagation();
|
|
915
|
+
e.preventDefault();
|
|
916
|
+
}
|
|
917
|
+
else {
|
|
918
|
+
if (rtn === -1) {
|
|
919
|
+
e.stopPropagation();
|
|
920
|
+
}
|
|
906
921
|
first = -1;
|
|
907
922
|
return;
|
|
908
923
|
}
|
|
@@ -1028,8 +1043,19 @@ function bindGesture(oe, before, handler) {
|
|
|
1028
1043
|
gestureWheel.dir = 'right';
|
|
1029
1044
|
}
|
|
1030
1045
|
}
|
|
1031
|
-
|
|
1032
|
-
|
|
1046
|
+
const rtn = before(oe, gestureWheel.dir);
|
|
1047
|
+
if (rtn === 1) {
|
|
1048
|
+
oe.stopPropagation();
|
|
1049
|
+
oe.preventDefault();
|
|
1050
|
+
}
|
|
1051
|
+
else {
|
|
1052
|
+
if (rtn === -1) {
|
|
1053
|
+
oe.stopPropagation();
|
|
1054
|
+
gestureWheel.done = true;
|
|
1055
|
+
}
|
|
1056
|
+
else {
|
|
1057
|
+
gestureWheel.dir = '';
|
|
1058
|
+
}
|
|
1033
1059
|
return;
|
|
1034
1060
|
}
|
|
1035
1061
|
form.elements.gesture.style.transform = 'scale(0)';
|
package/dist/lib/dom.ts
CHANGED
|
@@ -1150,10 +1150,10 @@ const gestureWheel = {
|
|
|
1150
1150
|
/**
|
|
1151
1151
|
* --- 绑定上拉、下拉、左拉、右拉 ---
|
|
1152
1152
|
* @param oe 响应事件
|
|
1153
|
-
* @param before before 事件,返回
|
|
1153
|
+
* @param before before 事件,返回 1 则显示 gesture,0 则不处理(可能会向上传递事件),-1 则 stopPropagation(本层可拖动,若实际不可拖动则可能导致浏览器页面滚动)
|
|
1154
1154
|
* @param handler 执行完毕的话才会回调
|
|
1155
1155
|
*/
|
|
1156
|
-
export function bindGesture(oe: MouseEvent | TouchEvent | WheelEvent, before: (e: MouseEvent | TouchEvent | WheelEvent, dir: 'top' | 'right' | 'bottom' | 'left') =>
|
|
1156
|
+
export function bindGesture(oe: MouseEvent | TouchEvent | WheelEvent, before: (e: MouseEvent | TouchEvent | WheelEvent, dir: 'top' | 'right' | 'bottom' | 'left') => number, handler?: (dir: 'top' | 'right' | 'bottom' | 'left') => void | Promise<void>): void {
|
|
1157
1157
|
const el = oe.currentTarget as HTMLElement | null;
|
|
1158
1158
|
if (!el) {
|
|
1159
1159
|
return;
|
|
@@ -1172,7 +1172,14 @@ export function bindGesture(oe: MouseEvent | TouchEvent | WheelEvent, before: (e
|
|
|
1172
1172
|
move: (e, d) => {
|
|
1173
1173
|
if (first < 0) {
|
|
1174
1174
|
if (first > -30) {
|
|
1175
|
-
before(e, dir);
|
|
1175
|
+
const rtn = before(e, dir);
|
|
1176
|
+
if (rtn === 1) {
|
|
1177
|
+
e.stopPropagation();
|
|
1178
|
+
e.preventDefault();
|
|
1179
|
+
}
|
|
1180
|
+
else if (rtn === -1) {
|
|
1181
|
+
e.stopPropagation();
|
|
1182
|
+
}
|
|
1176
1183
|
--first;
|
|
1177
1184
|
}
|
|
1178
1185
|
return;
|
|
@@ -1197,7 +1204,15 @@ export function bindGesture(oe: MouseEvent | TouchEvent | WheelEvent, before: (e
|
|
|
1197
1204
|
dir = 'left';
|
|
1198
1205
|
}
|
|
1199
1206
|
}
|
|
1200
|
-
|
|
1207
|
+
const rtn = before(e, dir);
|
|
1208
|
+
if (rtn === 1) {
|
|
1209
|
+
e.stopPropagation();
|
|
1210
|
+
e.preventDefault();
|
|
1211
|
+
}
|
|
1212
|
+
else {
|
|
1213
|
+
if (rtn === -1) {
|
|
1214
|
+
e.stopPropagation();
|
|
1215
|
+
}
|
|
1201
1216
|
first = -1;
|
|
1202
1217
|
return;
|
|
1203
1218
|
}
|
|
@@ -1342,10 +1357,22 @@ export function bindGesture(oe: MouseEvent | TouchEvent | WheelEvent, before: (e
|
|
|
1342
1357
|
gestureWheel.dir = 'right';
|
|
1343
1358
|
}
|
|
1344
1359
|
}
|
|
1345
|
-
// ---
|
|
1346
|
-
|
|
1360
|
+
// --- 判断是否要显示 gesture ---
|
|
1361
|
+
const rtn = before(oe, gestureWheel.dir as any);
|
|
1362
|
+
if (rtn === 1) {
|
|
1363
|
+
oe.stopPropagation();
|
|
1364
|
+
oe.preventDefault();
|
|
1365
|
+
}
|
|
1366
|
+
else {
|
|
1347
1367
|
// --- 不显示 ---
|
|
1348
|
-
|
|
1368
|
+
// --- 还得判断是不是 stopPropagation 了,如果 stopPropagation 了,才 true ---
|
|
1369
|
+
if (rtn === -1) {
|
|
1370
|
+
oe.stopPropagation();
|
|
1371
|
+
gestureWheel.done = true;
|
|
1372
|
+
}
|
|
1373
|
+
else {
|
|
1374
|
+
gestureWheel.dir = '';
|
|
1375
|
+
}
|
|
1349
1376
|
return;
|
|
1350
1377
|
}
|
|
1351
1378
|
// --- 重置位置 ---
|
package/dist/lib/task.ts
CHANGED
|
@@ -562,7 +562,7 @@ export async function run(url: string | types.IApp, opt: types.ITaskRunOptions =
|
|
|
562
562
|
bindDown: function(oe: MouseEvent | TouchEvent, opt: types.IBindDownOptions) {
|
|
563
563
|
dom.bindDown(oe, opt);
|
|
564
564
|
},
|
|
565
|
-
bindGesture: function(oe: MouseEvent | TouchEvent | WheelEvent, before: (e: MouseEvent | TouchEvent | WheelEvent, dir: 'top' | 'right' | 'bottom' | 'left') =>
|
|
565
|
+
bindGesture: function(oe: MouseEvent | TouchEvent | WheelEvent, before: (e: MouseEvent | TouchEvent | WheelEvent, dir: 'top' | 'right' | 'bottom' | 'left') => number, handler: (dir: 'top' | 'right' | 'bottom' | 'left') => void): void {
|
|
566
566
|
dom.bindGesture(oe, before, handler);
|
|
567
567
|
},
|
|
568
568
|
bindLong: function(
|
package/dist/theme/byterun.cgt
CHANGED
|
Binary file
|
package/dist/theme/familiar.cgt
CHANGED
|
Binary file
|