clickgo 3.1.1-dev10 → 3.1.3-dev12
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/dist/app/demo/app.js +0 -72
- package/dist/app/demo/config.json +109 -0
- package/dist/app/demo/form/control/button/button.js +12 -11
- package/dist/app/demo/form/control/button/button.xml +6 -6
- package/dist/app/demo/form/control/check/check.js +14 -10
- package/dist/app/demo/form/control/file/file.js +15 -13
- package/dist/app/demo/form/control/{overflow/overflow.css → flow/flow.css} +0 -0
- package/dist/app/demo/form/control/flow/flow.js +64 -0
- package/dist/app/demo/form/control/{overflow/overflow.scss → flow/flow.scss} +0 -0
- package/dist/app/demo/form/control/flow/flow.xml +101 -0
- package/dist/app/demo/form/control/form/form.js +1 -1
- package/dist/app/demo/form/control/form/form.xml +3 -3
- package/dist/app/demo/form/control/img/img.xml +2 -2
- package/dist/app/demo/form/control/list/list.js +95 -75
- package/dist/app/demo/form/control/list/list.xml +15 -11
- package/dist/app/demo/form/control/marquee/marquee.js +12 -10
- package/dist/app/demo/form/control/menu/menu.js +10 -6
- package/dist/app/demo/form/control/monaco/monaco.js +50 -60
- package/dist/app/demo/form/control/monaco/monaco.xml +6 -5
- package/dist/app/demo/form/control/property/property.js +131 -127
- package/dist/app/demo/form/control/radio/radio.js +9 -5
- package/dist/app/demo/form/control/scroll/scroll.js +16 -12
- package/dist/app/demo/form/control/scroll/scroll.xml +10 -10
- package/dist/app/demo/form/control/select/select.js +132 -71
- package/dist/app/demo/form/control/select/select.xml +69 -67
- package/dist/app/demo/form/control/tab/tab.js +21 -20
- package/dist/app/demo/form/control/tab/tab.xml +2 -2
- package/dist/app/demo/form/control/text/text.js +53 -45
- package/dist/app/demo/form/control/text/text.xml +3 -3
- package/dist/app/demo/form/control/{greatview/greatview.css → vflow/vflow.css} +0 -0
- package/dist/app/demo/form/control/vflow/vflow.js +79 -0
- package/dist/app/demo/form/control/{greatview/greatview.scss → vflow/vflow.scss} +0 -0
- package/dist/app/demo/form/control/{greatview/greatview.xml → vflow/vflow.xml} +25 -25
- package/dist/app/demo/form/event/form/form.js +58 -56
- package/dist/app/demo/form/event/form/form.xml +3 -3
- package/dist/app/demo/form/event/screen/screen.js +30 -28
- package/dist/app/demo/form/event/screen/screen.xml +2 -2
- package/dist/app/demo/form/event/task/task.js +31 -31
- package/dist/app/demo/form/event/task/task.xml +3 -3
- package/dist/app/demo/form/main.js +166 -5
- package/dist/app/demo/form/main.xml +37 -35
- package/dist/app/demo/form/method/aform/aform.js +57 -0
- package/dist/app/demo/form/method/aform/aform.xml +35 -0
- package/dist/app/demo/form/method/aform/test.xml +6 -0
- package/dist/app/demo/form/method/core/core.js +11 -8
- package/dist/app/demo/form/method/core/core.xml +2 -1
- package/dist/app/demo/form/method/dom/dom.js +91 -99
- package/dist/app/demo/form/method/dom/dom.xml +6 -7
- package/dist/app/demo/form/method/form/form.js +10 -28
- package/dist/app/demo/form/method/form/form.xml +8 -15
- package/dist/app/demo/form/method/fs/fs.js +34 -33
- package/dist/app/demo/form/method/fs/fs.xml +1 -1
- package/dist/app/demo/form/method/fs/text.js +12 -12
- package/dist/app/demo/form/method/native/native.js +50 -0
- package/dist/app/demo/form/method/native/native.xml +12 -0
- package/dist/app/demo/form/method/system/system.js +50 -0
- package/dist/app/demo/form/method/system/system.xml +11 -0
- package/dist/app/demo/form/method/task/task.js +59 -61
- package/dist/app/demo/form/method/task/task.xml +4 -6
- package/dist/app/demo/form/method/theme/theme.js +14 -14
- package/dist/app/demo/form/method/tool/tool.js +29 -28
- package/dist/app/demo/form/method/tool/tool.xml +3 -3
- package/dist/app/demo/form/method/zip/zip.js +46 -41
- package/dist/app/demo/form/method/zip/zip.xml +1 -1
- package/dist/app/task/app.js +0 -25
- package/dist/app/task/config.json +29 -0
- package/dist/app/task/form/bar/bar.js +2 -2
- package/dist/app/task/form/bar/bar.xml +1 -1
- package/dist/clickgo.js +17 -5
- package/dist/clickgo.ts +22 -3
- package/dist/control/common.cgc +0 -0
- package/dist/control/form.cgc +0 -0
- package/dist/control/monaco.cgc +0 -0
- package/dist/control/property.cgc +0 -0
- package/dist/control/task.cgc +0 -0
- package/dist/global.css +1 -1
- package/dist/index.js +28 -8
- package/dist/index.ts +33 -7
- package/dist/lib/control.js +75 -105
- package/dist/lib/control.ts +102 -124
- package/dist/lib/core.js +108 -252
- package/dist/lib/core.ts +122 -268
- package/dist/lib/dom.js +564 -483
- package/dist/lib/dom.ts +703 -546
- package/dist/lib/form.js +170 -153
- package/dist/lib/form.ts +132 -99
- package/dist/lib/fs.js +1 -1
- package/dist/lib/fs.ts +1 -1
- package/dist/lib/native.js +135 -8
- package/dist/lib/native.ts +176 -12
- package/dist/lib/task.js +301 -175
- package/dist/lib/task.ts +330 -207
- package/dist/lib/tool.js +48 -1
- package/dist/lib/tool.ts +61 -0
- package/dist/lib/zip.ts +2 -0
- package/dist/theme/familiar.cgt +0 -0
- package/package.json +1 -1
- package/types/index.d.ts +26 -29
- package/dist/app/demo/form/control/greatview/greatview.js +0 -92
- package/dist/app/demo/form/control/overflow/overflow.js +0 -70
- package/dist/app/demo/form/control/overflow/overflow.xml +0 -98
- package/dist/app/demo/form/control/view/view.css +0 -1
- package/dist/app/demo/form/control/view/view.js +0 -73
- package/dist/app/demo/form/control/view/view.scss +0 -18
- package/dist/app/demo/form/control/view/view.xml +0 -94
- package/dist/app/demo/form/method/form/test.xml +0 -5
|
@@ -1,49 +1,51 @@
|
|
|
1
1
|
<form width="400" height="550" title="ClickGo demo" icon="/package/res/icon.svg">
|
|
2
2
|
<tab v-model="ntab" :tabs="['control', 'method', 'event']" style="margin: 10px; flex: 1;">
|
|
3
|
-
<
|
|
3
|
+
<flow v-if="ntab === 'control'" class="inner" direction="v">
|
|
4
4
|
<layout class="buttons" gutter="10" direction="v">
|
|
5
5
|
<button @click="openForm('cform')">Form</button>
|
|
6
|
-
<button @click="openForm('
|
|
7
|
-
<button @click="openForm('
|
|
8
|
-
<button @click="openForm('
|
|
9
|
-
<button @click="openForm('
|
|
10
|
-
<button @click="openForm('
|
|
11
|
-
<button @click="openForm('
|
|
12
|
-
<button @click="openForm('
|
|
13
|
-
<button @click="openForm('
|
|
6
|
+
<button @click="openForm('cimg')">Img</button>
|
|
7
|
+
<button @click="openForm('cbutton')">Button</button>
|
|
8
|
+
<button @click="openForm('ccheck')">Check</button>
|
|
9
|
+
<button @click="openForm('cradio')">Radio</button>
|
|
10
|
+
<button @click="openForm('ctext')">Text</button>
|
|
11
|
+
<button @click="openForm('ctab')">Tab</button>
|
|
12
|
+
<button @click="openForm('clabel')">Label</button>
|
|
13
|
+
<button @click="openForm('cloading')">Loading</button>
|
|
14
14
|
<button @click="openForm('cdialog')">Dialog</button>
|
|
15
|
-
<button @click="openForm('
|
|
15
|
+
<button @click="openForm('cfile')">File</button>
|
|
16
16
|
<button @click="openForm('cblock')">Block</button>
|
|
17
|
-
<button @click="openForm('
|
|
18
|
-
<button @click="openForm('
|
|
19
|
-
<button @click="openForm('
|
|
20
|
-
<button @click="openForm('
|
|
21
|
-
<button @click="openForm('
|
|
22
|
-
<button @click="openForm('
|
|
23
|
-
<button @click="openForm('
|
|
24
|
-
<button @click="openForm('
|
|
25
|
-
<button @click="openForm('
|
|
26
|
-
<button @click="openForm('control', 'monaco')">Monaco</button>
|
|
17
|
+
<button @click="openForm('cflow')">Flow</button>
|
|
18
|
+
<button @click="openForm('cvflow')">Vflow</button>
|
|
19
|
+
<button @click="openForm('cmarquee')">Marquee</button>
|
|
20
|
+
<button @click="openForm('cscroll')">Scroll</button>
|
|
21
|
+
<button @click="openForm('cmenu')">Menu</button>
|
|
22
|
+
<button @click="openForm('clist')">List</button>
|
|
23
|
+
<button @click="openForm('cselect')">Select</button>
|
|
24
|
+
<button @click="openForm('cproperty')">Property</button>
|
|
25
|
+
<button @click="openForm('cmonaco')">Monaco</button>
|
|
27
26
|
</layout>
|
|
28
|
-
</
|
|
29
|
-
<
|
|
27
|
+
</flow>
|
|
28
|
+
<flow v-else-if="ntab === 'method'" class="inner" direction="v">
|
|
30
29
|
<layout class="buttons" gutter="10" direction="v">
|
|
31
|
-
<button @click="openForm('
|
|
32
|
-
<button @click="openForm('
|
|
30
|
+
<button @click="openForm('mcore')">Library core</button>
|
|
31
|
+
<button @click="openForm('mdom')">Library dom</button>
|
|
33
32
|
<button @click="openForm('mform')">Library form</button>
|
|
34
|
-
<button @click="openForm('
|
|
35
|
-
<button @click="openForm('
|
|
36
|
-
<button @click="openForm('
|
|
37
|
-
<button @click="openForm('
|
|
38
|
-
<button @click="openForm('
|
|
33
|
+
<button @click="openForm('mfs')">Library fs</button>
|
|
34
|
+
<button @click="openForm('mnative')">Library native</button>
|
|
35
|
+
<button @click="openForm('mtask')">Library task</button>
|
|
36
|
+
<button @click="openForm('mtheme')">Library theme</button>
|
|
37
|
+
<button @click="openForm('mtool')">Library tool</button>
|
|
38
|
+
<button @click="openForm('mzip')">Library zip</button>
|
|
39
|
+
<button @click="openForm('aform')">Abstract Form</button>
|
|
40
|
+
<button @click="openForm('msystem')">System</button>
|
|
39
41
|
</layout>
|
|
40
|
-
</
|
|
41
|
-
<
|
|
42
|
+
</flow>
|
|
43
|
+
<flow v-else class="inner" direction="v">
|
|
42
44
|
<layout class="buttons" gutter="10" direction="v">
|
|
43
|
-
<button @click="openForm('
|
|
44
|
-
<button @click="openForm('
|
|
45
|
-
<button @click="openForm('
|
|
45
|
+
<button @click="openForm('escreen')">About screen</button>
|
|
46
|
+
<button @click="openForm('eform')">About form</button>
|
|
47
|
+
<button @click="openForm('etask')">About task</button>
|
|
46
48
|
</layout>
|
|
47
|
-
</
|
|
49
|
+
</flow>
|
|
48
50
|
</tab>
|
|
49
51
|
</form>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const clickgo = require("clickgo");
|
|
13
|
+
class default_1 extends clickgo.form.AbstractForm {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.fid = '0';
|
|
17
|
+
this.sendValue = 'sendValue';
|
|
18
|
+
this.test = 'A';
|
|
19
|
+
this.dr = '';
|
|
20
|
+
}
|
|
21
|
+
ccreateForm() {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const frm = yield this.createForm('test');
|
|
24
|
+
if (typeof frm === 'number') {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
frm.show();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
ssend() {
|
|
31
|
+
this.send(parseInt(this.fid), {
|
|
32
|
+
'key': this.sendValue
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
hhide() {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
this.hide();
|
|
38
|
+
yield clickgo.tool.sleep(1000);
|
|
39
|
+
this.show();
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
sshowDialog() {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
const frm = yield this.createForm('test');
|
|
45
|
+
if (typeof frm === 'number') {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.dr = yield frm.showDialog();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
onMounted() {
|
|
52
|
+
this.watch('test', () => __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
yield clickgo.form.dialog('test changed.');
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.default = default_1;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<form width="350" height="400" title="Abstract Form">
|
|
2
|
+
<flow direction="v" style="flex: 1; padding: 10px;">
|
|
3
|
+
<layout gutter="10" direction="v" style="flex: 1;">
|
|
4
|
+
<label>filename: {{filename}}</label>
|
|
5
|
+
<label>controlName: {{controlName}}</label>
|
|
6
|
+
<label>taskId: {{taskId}}</label>
|
|
7
|
+
<label>formId: {{formId}}</label>
|
|
8
|
+
<label>formFocus: {{formFocus}}</label>
|
|
9
|
+
<label>path: {{path}}</label>
|
|
10
|
+
<label>locale: {{locale}}</label>
|
|
11
|
+
<label>isMask: {{isMask}}</label>
|
|
12
|
+
<layout gutter="10" align-v="center">
|
|
13
|
+
<label>test: {{test}}</label>
|
|
14
|
+
<button @click="test = test === 'A' ? 'B' : 'A'" style="height: 30px; flex: 1;">watch('test', () => { dialog })</button>
|
|
15
|
+
</layout>
|
|
16
|
+
<button @click="ccreateForm" style="height: 30px;">createForm('test')</button>
|
|
17
|
+
<button @click="topMost = !topMost" style="height: 30px;">topMost: {{topMost ? 'true' : 'false'}}</button>
|
|
18
|
+
<layout gutter="10" align-v="center">
|
|
19
|
+
<label>Form ID:</label>
|
|
20
|
+
<text v-model="fid" style="flex: 1; width: 0; height: 30px;"></text>
|
|
21
|
+
</layout>
|
|
22
|
+
<layout gutter="10" align-v="center">
|
|
23
|
+
<label>Send: </label>
|
|
24
|
+
<text v-model="sendValue" style="flex: 1; width: 0; height: 30px;"></text>
|
|
25
|
+
<button @click="ssend" style="padding: 0 10px; height: 30px;">send({{fid}}, { 'key': '{{sendValue}}' })</button>
|
|
26
|
+
</layout>
|
|
27
|
+
<button @click="hhide" style="height: 30px;">hide() and show()</button>
|
|
28
|
+
<layout gutter="10" align-v="center">
|
|
29
|
+
<button @click="sshowDialog" style="height: 30px; flex: 1;">showDialog()</button>
|
|
30
|
+
<label>result: {{dr}}</label>
|
|
31
|
+
</layout>
|
|
32
|
+
<button @click="close" style="height: 30px;">close()</button>
|
|
33
|
+
</layout>
|
|
34
|
+
</flow>
|
|
35
|
+
</form>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<form width="200" height="200" title="From path">
|
|
2
|
+
<layout align-v="center" align-h="center" direction="v" gutter="10" style="flex: 1; width: 0;">
|
|
3
|
+
<label>Haha!</label>
|
|
4
|
+
<button @click="dialogResult = dialogResult ? '' : 'Done'" style="padding: 10px;">{{dialogResult ? 'Remove' : 'Set'}} dialogResult</button>
|
|
5
|
+
</layout>
|
|
6
|
+
</form>
|
|
@@ -9,17 +9,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.methods = exports.computed = void 0;
|
|
13
12
|
const clickgo = require("clickgo");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return JSON.stringify(clickgo.core.config, null, 4);
|
|
13
|
+
class default_1 extends clickgo.form.AbstractForm {
|
|
14
|
+
get config() {
|
|
15
|
+
return JSON.stringify(clickgo.core.config, null, 4).replace(/"icon": "([\s\S]+?)"/g, '"icon": "data:image/..."');
|
|
17
16
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
getCdn() {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield clickgo.form.dialog(clickgo.core.getCdn());
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
getAvailArea() {
|
|
21
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
24
|
yield clickgo.form.dialog(JSON.stringify(clickgo.core.getAvailArea()));
|
|
23
25
|
});
|
|
24
26
|
}
|
|
25
|
-
}
|
|
27
|
+
}
|
|
28
|
+
exports.default = default_1;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<form width="350" height="400" title="Library task" padding="10">
|
|
2
2
|
<layout direction="v" gutter="10" style="flex: 1;">
|
|
3
|
-
<button @click="getAvailArea" style="height: 30px;">getAvailArea()</button>
|
|
4
3
|
<label>config:</label>
|
|
5
4
|
<text v-model="config" readonly multi style="flex: 1;"></text>
|
|
5
|
+
<button @click="getCdn" style="height: 30px;">getCdn()</button>
|
|
6
|
+
<button @click="getAvailArea" style="height: 30px;">getAvailArea()</button>
|
|
6
7
|
</layout>
|
|
7
8
|
</form>
|
|
@@ -9,155 +9,147 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.mounted = exports.methods = exports.computed = exports.data = void 0;
|
|
13
12
|
const clickgo = require("clickgo");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
class default_1 extends clickgo.form.AbstractForm {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.watchSizeText = false;
|
|
17
|
+
this.watchSizeHeight = true;
|
|
18
|
+
this.watchText = false;
|
|
19
|
+
this.watchInner = true;
|
|
20
|
+
this.watchStyleChange = true;
|
|
21
|
+
this.bindGestureText = '';
|
|
22
|
+
this.bindGestureWheelText = '';
|
|
23
|
+
this.bindLongText = false;
|
|
24
|
+
this.moveLeft = 0;
|
|
25
|
+
this.moveTop = 0;
|
|
26
|
+
this.moveWidth = 25;
|
|
27
|
+
this.moveHeight = 25;
|
|
28
|
+
}
|
|
29
|
+
get isMove() {
|
|
30
30
|
return clickgo.dom.is.move;
|
|
31
|
-
}
|
|
32
|
-
|
|
31
|
+
}
|
|
32
|
+
get isShift() {
|
|
33
33
|
return clickgo.dom.is.shift;
|
|
34
|
-
}
|
|
35
|
-
|
|
34
|
+
}
|
|
35
|
+
get isCtrl() {
|
|
36
36
|
return clickgo.dom.is.ctrl;
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
exports.methods = {
|
|
40
|
-
setGlobalCursor: function (type) {
|
|
38
|
+
setGlobalCursor(type) {
|
|
41
39
|
clickgo.dom.setGlobalCursor(type);
|
|
42
|
-
}
|
|
43
|
-
hasTouchButMouse
|
|
40
|
+
}
|
|
41
|
+
hasTouchButMouse(e) {
|
|
44
42
|
clickgo.form.dialog(clickgo.dom.hasTouchButMouse(e) ? 'true' : 'false').catch((e) => { throw e; });
|
|
45
|
-
}
|
|
46
|
-
getStyleCount
|
|
43
|
+
}
|
|
44
|
+
getStyleCount() {
|
|
47
45
|
clickgo.form.dialog(clickgo.dom.getStyleCount(this.taskId, 'form').toString()).catch((e) => { throw e; });
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
clickgo.form.dialog(JSON.stringify(clickgo.dom.getSize(this.$refs.getSize.$el))).catch((e) => { throw e; });
|
|
51
|
-
},
|
|
52
|
-
watchSize: function () {
|
|
46
|
+
}
|
|
47
|
+
watchSize() {
|
|
53
48
|
this.watchSizeText = !this.watchSizeText;
|
|
54
49
|
if (this.watchSizeText) {
|
|
55
|
-
clickgo.dom.watchSize(this
|
|
56
|
-
clickgo.form.dialog(JSON.stringify(
|
|
50
|
+
clickgo.dom.watchSize(this.refs.watchSize.$el, () => {
|
|
51
|
+
clickgo.form.dialog(JSON.stringify({
|
|
52
|
+
'width': this.refs.watchSize.$el.offsetWidth,
|
|
53
|
+
'height': this.refs.watchSize.$el.offsetHeight
|
|
54
|
+
})).catch((e) => { throw e; });
|
|
57
55
|
});
|
|
58
56
|
}
|
|
59
57
|
else {
|
|
60
|
-
clickgo.dom.unwatchSize(this
|
|
58
|
+
clickgo.dom.unwatchSize(this.refs.watchSize.$el);
|
|
61
59
|
}
|
|
62
|
-
}
|
|
63
|
-
|
|
60
|
+
}
|
|
61
|
+
wwatch() {
|
|
64
62
|
this.watchText = !this.watchText;
|
|
65
63
|
if (this.watchText) {
|
|
66
|
-
clickgo.dom.watch(this
|
|
64
|
+
clickgo.dom.watch(this.refs.watch.$el, () => {
|
|
67
65
|
clickgo.form.dialog('Changed.').catch((e) => { throw e; });
|
|
68
66
|
});
|
|
69
67
|
}
|
|
70
68
|
else {
|
|
71
|
-
clickgo.dom.unwatch(this
|
|
69
|
+
clickgo.dom.unwatch(this.refs.watch.$el);
|
|
72
70
|
}
|
|
73
|
-
}
|
|
74
|
-
isWatchStyle
|
|
75
|
-
clickgo.form.dialog(clickgo.dom.isWatchStyle(this
|
|
76
|
-
}
|
|
77
|
-
bindGesture
|
|
78
|
-
clickgo.dom.bindGesture(e, {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this.bindGestureText = dir.slice(0, 1).toUpperCase() + dir.slice(1);
|
|
82
|
-
const handler = () => __awaiter(this, void 0, void 0, function* () {
|
|
83
|
-
yield clickgo.tool.sleep(500);
|
|
84
|
-
this.bindGestureText = '';
|
|
85
|
-
});
|
|
86
|
-
handler().catch((e) => {
|
|
87
|
-
console.log(e);
|
|
88
|
-
});
|
|
71
|
+
}
|
|
72
|
+
isWatchStyle() {
|
|
73
|
+
clickgo.form.dialog(clickgo.dom.isWatchStyle(this.refs.watchStyle.$el) ? 'true' : 'false').catch((e) => { throw e; });
|
|
74
|
+
}
|
|
75
|
+
bindGesture(e) {
|
|
76
|
+
clickgo.dom.bindGesture(e, (ne, dir) => {
|
|
77
|
+
if (['top', 'bottom'].includes(dir)) {
|
|
78
|
+
return true;
|
|
89
79
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
handler().catch((e) => {
|
|
102
|
-
console.log(e);
|
|
103
|
-
});
|
|
80
|
+
return false;
|
|
81
|
+
}, (dir) => __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
this.bindGestureText = dir.slice(0, 1).toUpperCase() + dir.slice(1);
|
|
83
|
+
yield clickgo.tool.sleep(500);
|
|
84
|
+
this.bindGestureText = '';
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
bindGestureWheel(e) {
|
|
88
|
+
clickgo.dom.bindGesture(e, (ne, dir) => {
|
|
89
|
+
if (['top', 'bottom', 'left', 'right'].includes(dir)) {
|
|
90
|
+
return true;
|
|
104
91
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
92
|
+
return false;
|
|
93
|
+
}, (dir) => __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
this.bindGestureWheelText = dir.slice(0, 1).toUpperCase() + dir.slice(1);
|
|
95
|
+
yield clickgo.tool.sleep(500);
|
|
96
|
+
this.bindGestureWheelText = '';
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
bindLong() {
|
|
108
100
|
clickgo.form.dialog('Press and hold this button.').catch((e) => { throw e; });
|
|
109
|
-
}
|
|
110
|
-
bindLongDown
|
|
101
|
+
}
|
|
102
|
+
bindLongDown(e) {
|
|
111
103
|
clickgo.dom.bindLong(e, () => __awaiter(this, void 0, void 0, function* () {
|
|
112
104
|
this.bindLongText = true;
|
|
113
105
|
yield clickgo.tool.sleep(500);
|
|
114
106
|
this.bindLongText = false;
|
|
115
107
|
}));
|
|
116
|
-
}
|
|
117
|
-
bindDragDown
|
|
108
|
+
}
|
|
109
|
+
bindDragDown(e) {
|
|
118
110
|
clickgo.dom.bindDrag(e, {
|
|
119
|
-
'el': this
|
|
111
|
+
'el': this.refs.bindDrag,
|
|
120
112
|
'data': 'bindDragDownTest'
|
|
121
113
|
});
|
|
122
|
-
}
|
|
123
|
-
dragEnter
|
|
114
|
+
}
|
|
115
|
+
dragEnter(e) {
|
|
124
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
125
117
|
e.target.innerText = 'enter';
|
|
126
118
|
yield clickgo.tool.sleep(200);
|
|
127
119
|
e.target.innerText = '';
|
|
128
120
|
});
|
|
129
|
-
}
|
|
130
|
-
dragLeave
|
|
121
|
+
}
|
|
122
|
+
dragLeave(e) {
|
|
131
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
132
124
|
e.target.innerText = 'leave';
|
|
133
125
|
yield clickgo.tool.sleep(200);
|
|
134
126
|
e.target.innerText = '';
|
|
135
127
|
});
|
|
136
|
-
}
|
|
137
|
-
drop
|
|
128
|
+
}
|
|
129
|
+
drop(e) {
|
|
138
130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
139
131
|
e.target.innerText = 'drop';
|
|
140
132
|
yield clickgo.tool.sleep(500);
|
|
141
133
|
e.target.innerText = '';
|
|
142
134
|
});
|
|
143
|
-
}
|
|
144
|
-
bindMoveDown
|
|
135
|
+
}
|
|
136
|
+
bindMoveDown(e) {
|
|
145
137
|
clickgo.dom.bindMove(e, {
|
|
146
138
|
'areaObject': e.currentTarget,
|
|
147
|
-
'object': this
|
|
148
|
-
move: (
|
|
149
|
-
this.moveLeft += ox;
|
|
150
|
-
this.moveTop += oy;
|
|
139
|
+
'object': this.refs.move,
|
|
140
|
+
move: (e, o) => {
|
|
141
|
+
this.moveLeft += o.ox;
|
|
142
|
+
this.moveTop += o.oy;
|
|
151
143
|
}
|
|
152
144
|
});
|
|
153
|
-
}
|
|
154
|
-
fullscreen
|
|
145
|
+
}
|
|
146
|
+
fullscreen() {
|
|
155
147
|
clickgo.dom.fullscreen();
|
|
156
148
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
exports.
|
|
149
|
+
onMounted() {
|
|
150
|
+
clickgo.dom.watchStyle(this.refs.watchStyle.$el, 'font-size', (n, v) => {
|
|
151
|
+
clickgo.form.dialog('name: ' + n + ', value: ' + v).catch((e) => { throw e; });
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
exports.default = default_1;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
<form width="400" height="450" title="Library dom"
|
|
2
|
-
<
|
|
1
|
+
<form width="400" height="450" title="Library dom">
|
|
2
|
+
<flow direction="v" style="flex: 1; padding: 10px;">
|
|
3
3
|
<layout gutter="10" direction="v" style="flex: 1;">
|
|
4
4
|
<button @click="setGlobalCursor('wait')" style="height: 30px;">setGlobalCursor('wait')</button>
|
|
5
5
|
<button @click="setGlobalCursor" style="height: 30px;">setGlobalCursor()</button>
|
|
6
6
|
<button @click="hasTouchButMouse" style="height: 30px;">hasTouchButMouse()</button>
|
|
7
7
|
<button @click="getStyleCount" style="height: 30px;">getStyleCount({{taskId}}, 'form')</button>
|
|
8
|
-
<button @click="getSize" ref="getSize" style="height: 30px;">getSize(this.$refs.getSize)</button>
|
|
9
8
|
<layout gutter="10">
|
|
10
9
|
<button @click="watchSize" ref="watchSize" :style="{'height': (watchSizeHeight ? 30 : 50) + 'px'}" style="padding: 0 5px; flex: 1;">{{watchSizeText ? '' : '!'}}watchSize</button>
|
|
11
10
|
<button @click="watchSizeHeight = !watchSizeHeight" style="padding: 0 5px; flex: 1;">Change</button>
|
|
12
11
|
</layout>
|
|
13
12
|
<layout gutter="10">
|
|
14
13
|
<layout ref="watch" align-v="center" align-h="center" style="flex: 1; background: #FFF;">{{watchInner ? 'inner' : 'Inner'}}</layout>
|
|
15
|
-
<button @click="
|
|
14
|
+
<button @click="wwatch" style="height: 30px; padding: 0 5px;">{{watchText ? '' : '!'}}watch</button>
|
|
16
15
|
<button @click="watchInner = !watchInner" style="padding: 0 5px;">Change</button>
|
|
17
16
|
</layout>
|
|
18
|
-
<button @click="watchStyleChange = !watchStyleChange" ref="watchStyle" style="height: 30px;" :style="{'font-size': watchStyleChange ? 'inherit' : '16px'}">watchStyle(this
|
|
19
|
-
<button @click="isWatchStyle" style="height: 30px;">isWatchStyle(this
|
|
17
|
+
<button @click="watchStyleChange = !watchStyleChange" ref="watchStyle" style="height: 30px;" :style="{'font-size': watchStyleChange ? 'inherit' : '16px'}">watchStyle(this.refs.watchStyle.$el, 'font-size', (n, v) => { ... })</button>
|
|
18
|
+
<button @click="isWatchStyle" style="height: 30px;">isWatchStyle(this.refs.watchStyle.$el)</button>
|
|
20
19
|
<block @mousedown="bindGesture" @touchstart="bindGesture" style="height: 50px; background: #FFF; display: flex; justify-content: center; align-items: center; color: rgba(0, 0, 0, .5); font-size: 14px;">{{bindGestureText ? bindGestureText : 'bindGesture(e: Touch | Mouse, { ... })'}}</block>
|
|
21
20
|
<block @wheel="bindGestureWheel" style="height: 50px; background: #FFF; display: flex; justify-content: center; align-items: center; color: rgba(0, 0, 0, .5); font-size: 14px;">{{bindGestureWheelText ? bindGestureWheelText : 'bindGesture(e: Wheel, { ... })'}}</block>
|
|
22
21
|
<button @click="bindLong" ref="bindLong" @mousedown="bindLongDown" @touchstart="bindLongDown" style="height: 30px;">{{bindLongText ? 'Yeah!' : 'bindLong(e, () => { ... })'}}</button>
|
|
@@ -51,5 +50,5 @@
|
|
|
51
50
|
<label>clickgo.form.is.shift: {{isShift ? 'true' : 'false'}}</label>
|
|
52
51
|
<label>clickgo.form.is.ctrl: {{isCtrl ? 'true' : 'false'}}</label>
|
|
53
52
|
</layout>
|
|
54
|
-
</
|
|
53
|
+
</flow>
|
|
55
54
|
</form>
|
|
@@ -14,10 +14,9 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this.fid = '0';
|
|
17
|
-
this.sendValue = 'sendValue';
|
|
18
17
|
this.tid = '0';
|
|
19
|
-
this.type = 'primary';
|
|
20
|
-
this.progress = 'noraml';
|
|
18
|
+
this.type = ['primary'];
|
|
19
|
+
this.progress = ['noraml'];
|
|
21
20
|
this.dr = '';
|
|
22
21
|
this.setTopMostValue = false;
|
|
23
22
|
}
|
|
@@ -42,20 +41,15 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
42
41
|
get() {
|
|
43
42
|
clickgo.form.dialog(JSON.stringify(clickgo.form.get(parseInt(this.fid)))).catch((e) => { throw e; });
|
|
44
43
|
}
|
|
45
|
-
send() {
|
|
46
|
-
clickgo.form.send(parseInt(this.fid), {
|
|
47
|
-
'key': this.sendValue
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
44
|
changeFocus() {
|
|
51
45
|
clickgo.form.changeFocus(parseInt(this.fid));
|
|
52
46
|
}
|
|
53
47
|
getList() {
|
|
54
|
-
let str = JSON.stringify(clickgo.form.getList(this.
|
|
48
|
+
let str = JSON.stringify(clickgo.form.getList(parseInt(this.tid)));
|
|
55
49
|
str = str.replace(/"icon":"(.*?)"/g, function (t, t1) {
|
|
56
50
|
return `"icon":"${t1 ? (t1.slice(0, 10) + '...') : t1}"`;
|
|
57
51
|
});
|
|
58
|
-
clickgo.form.dialog(`<
|
|
52
|
+
clickgo.form.dialog(`<flow direction="v" style="width: 200px; height: 80px;">${str}</flow>`).catch((e) => { throw e; });
|
|
59
53
|
}
|
|
60
54
|
getMaxZIndexID() {
|
|
61
55
|
const fid = clickgo.form.getMaxZIndexID();
|
|
@@ -92,7 +86,7 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
92
86
|
notify() {
|
|
93
87
|
return __awaiter(this, void 0, void 0, function* () {
|
|
94
88
|
let icon = null;
|
|
95
|
-
if (this.progress === 'progress + icon') {
|
|
89
|
+
if (this.progress[0] === 'progress + icon') {
|
|
96
90
|
icon = yield clickgo.fs.getContent('/package/res/icon.svg');
|
|
97
91
|
}
|
|
98
92
|
if (icon instanceof Blob) {
|
|
@@ -101,11 +95,11 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
101
95
|
const nid = clickgo.form.notify({
|
|
102
96
|
'title': 'Notify',
|
|
103
97
|
'content': 'Content',
|
|
104
|
-
'type': this.type,
|
|
105
|
-
'progress': (this.progress === 'progress + icon') ? true : false,
|
|
98
|
+
'type': this.type[0],
|
|
99
|
+
'progress': (this.progress[0] === 'progress + icon') ? true : false,
|
|
106
100
|
'icon': icon
|
|
107
101
|
});
|
|
108
|
-
if (this.progress === 'progress + icon') {
|
|
102
|
+
if (this.progress[0] === 'progress + icon') {
|
|
109
103
|
clickgo.form.notifyProgress(nid, 12);
|
|
110
104
|
yield clickgo.tool.sleep(1000);
|
|
111
105
|
clickgo.form.notifyProgress(nid, 30);
|
|
@@ -124,14 +118,6 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
124
118
|
}
|
|
125
119
|
clickgo.form.showPop(e.currentTarget, this.refs.pop, 'v');
|
|
126
120
|
}
|
|
127
|
-
createParam() {
|
|
128
|
-
clickgo.form.create({
|
|
129
|
-
'layout': '<form width=\'300\' height=\'300\' title=\'normal\'></form>'
|
|
130
|
-
}).catch((e) => { throw e; });
|
|
131
|
-
}
|
|
132
|
-
createPath() {
|
|
133
|
-
this.createForm('test').then((e) => { console.log(e); }).catch((e) => { throw e; });
|
|
134
|
-
}
|
|
135
121
|
createTop() {
|
|
136
122
|
return __awaiter(this, void 0, void 0, function* () {
|
|
137
123
|
const frm = yield this.createForm('test');
|
|
@@ -201,12 +187,8 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
201
187
|
flash() {
|
|
202
188
|
clickgo.form.flash(this.formId);
|
|
203
189
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
this.hide();
|
|
207
|
-
yield clickgo.tool.sleep(1000);
|
|
208
|
-
this.show();
|
|
209
|
-
});
|
|
190
|
+
showLauncher() {
|
|
191
|
+
clickgo.form.showLauncher();
|
|
210
192
|
}
|
|
211
193
|
onReceive(obj) {
|
|
212
194
|
clickgo.form.dialog(JSON.stringify(obj)).catch((e) => { throw e; });
|