clickgo 3.0.0-dev
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/LICENSE +201 -0
- package/README.md +75 -0
- package/dist/app/demo/config.json +106 -0
- package/dist/app/demo/form/control/block/block.css +1 -0
- package/dist/app/demo/form/control/block/block.scss +17 -0
- package/dist/app/demo/form/control/block/block.xml +7 -0
- package/dist/app/demo/form/control/button/button.css +1 -0
- package/dist/app/demo/form/control/button/button.js +27 -0
- package/dist/app/demo/form/control/button/button.scss +18 -0
- package/dist/app/demo/form/control/button/button.xml +126 -0
- package/dist/app/demo/form/control/check/check.js +12 -0
- package/dist/app/demo/form/control/check/check.xml +13 -0
- package/dist/app/demo/form/control/dialog/dialog.js +8 -0
- package/dist/app/demo/form/control/dialog/dialog.xml +26 -0
- package/dist/app/demo/form/control/file/file.js +23 -0
- package/dist/app/demo/form/control/file/file.xml +25 -0
- package/dist/app/demo/form/control/form/form.css +1 -0
- package/dist/app/demo/form/control/form/form.js +38 -0
- package/dist/app/demo/form/control/form/form.scss +9 -0
- package/dist/app/demo/form/control/form/form.xml +28 -0
- package/dist/app/demo/form/control/greatview/greatview.css +1 -0
- package/dist/app/demo/form/control/greatview/greatview.js +92 -0
- package/dist/app/demo/form/control/greatview/greatview.scss +22 -0
- package/dist/app/demo/form/control/greatview/greatview.xml +89 -0
- package/dist/app/demo/form/control/img/img.xml +16 -0
- package/dist/app/demo/form/control/label/label.xml +11 -0
- package/dist/app/demo/form/control/list/list.css +1 -0
- package/dist/app/demo/form/control/list/list.js +194 -0
- package/dist/app/demo/form/control/list/list.scss +7 -0
- package/dist/app/demo/form/control/list/list.xml +91 -0
- package/dist/app/demo/form/control/loading/loading.xml +8 -0
- package/dist/app/demo/form/control/marquee/marquee.js +30 -0
- package/dist/app/demo/form/control/marquee/marquee.xml +36 -0
- package/dist/app/demo/form/control/menu/menu.js +8 -0
- package/dist/app/demo/form/control/menu/menu.xml +122 -0
- package/dist/app/demo/form/control/monaco/monaco.js +113 -0
- package/dist/app/demo/form/control/monaco/monaco.xml +27 -0
- package/dist/app/demo/form/control/overflow/overflow.css +1 -0
- package/dist/app/demo/form/control/overflow/overflow.js +70 -0
- package/dist/app/demo/form/control/overflow/overflow.scss +18 -0
- package/dist/app/demo/form/control/overflow/overflow.xml +98 -0
- package/dist/app/demo/form/control/property/property.js +129 -0
- package/dist/app/demo/form/control/property/property.xml +6 -0
- package/dist/app/demo/form/control/radio/radio.js +7 -0
- package/dist/app/demo/form/control/radio/radio.xml +12 -0
- package/dist/app/demo/form/control/scroll/scroll.js +14 -0
- package/dist/app/demo/form/control/scroll/scroll.xml +35 -0
- package/dist/app/demo/form/control/select/select.js +91 -0
- package/dist/app/demo/form/control/select/select.xml +74 -0
- package/dist/app/demo/form/control/tab/tab.js +75 -0
- package/dist/app/demo/form/control/tab/tab.xml +22 -0
- package/dist/app/demo/form/control/text/text.js +53 -0
- package/dist/app/demo/form/control/text/text.xml +37 -0
- package/dist/app/demo/form/control/view/view.css +1 -0
- package/dist/app/demo/form/control/view/view.js +73 -0
- package/dist/app/demo/form/control/view/view.scss +18 -0
- package/dist/app/demo/form/control/view/view.xml +94 -0
- package/dist/app/demo/form/event/form/form.css +1 -0
- package/dist/app/demo/form/event/form/form.js +129 -0
- package/dist/app/demo/form/event/form/form.scss +24 -0
- package/dist/app/demo/form/event/form/form.xml +16 -0
- package/dist/app/demo/form/event/screen/screen.js +51 -0
- package/dist/app/demo/form/event/screen/screen.xml +9 -0
- package/dist/app/demo/form/event/task/task.js +78 -0
- package/dist/app/demo/form/event/task/task.xml +20 -0
- package/dist/app/demo/form/main.css +1 -0
- package/dist/app/demo/form/main.js +25 -0
- package/dist/app/demo/form/main.scss +9 -0
- package/dist/app/demo/form/main.xml +49 -0
- package/dist/app/demo/form/method/core/core.js +25 -0
- package/dist/app/demo/form/method/core/core.xml +7 -0
- package/dist/app/demo/form/method/dom/dom.css +1 -0
- package/dist/app/demo/form/method/dom/dom.js +163 -0
- package/dist/app/demo/form/method/dom/dom.scss +10 -0
- package/dist/app/demo/form/method/dom/dom.xml +55 -0
- package/dist/app/demo/form/method/form/form.css +1 -0
- package/dist/app/demo/form/method/form/form.js +217 -0
- package/dist/app/demo/form/method/form/form.scss +3 -0
- package/dist/app/demo/form/method/form/form.xml +56 -0
- package/dist/app/demo/form/method/form/test.xml +5 -0
- package/dist/app/demo/form/method/fs/fs.js +88 -0
- package/dist/app/demo/form/method/fs/fs.xml +8 -0
- package/dist/app/demo/form/method/fs/text.js +15 -0
- package/dist/app/demo/form/method/fs/text.xml +3 -0
- package/dist/app/demo/form/method/task/locale1.json +3 -0
- package/dist/app/demo/form/method/task/locale2.json +3 -0
- package/dist/app/demo/form/method/task/task.js +153 -0
- package/dist/app/demo/form/method/task/task.xml +57 -0
- package/dist/app/demo/form/method/theme/theme.js +74 -0
- package/dist/app/demo/form/method/theme/theme.xml +9 -0
- package/dist/app/demo/form/method/tool/tool.js +64 -0
- package/dist/app/demo/form/method/tool/tool.xml +26 -0
- package/dist/app/demo/form/method/zip/zip.js +99 -0
- package/dist/app/demo/form/method/zip/zip.xml +12 -0
- package/dist/app/demo/global.css +3 -0
- package/dist/app/demo/res/icon.svg +1 -0
- package/dist/app/demo/res/img.jpg +0 -0
- package/dist/app/demo/res/r-1.svg +1 -0
- package/dist/app/demo/res/r-2.svg +1 -0
- package/dist/app/demo/res/sql.svg +1 -0
- package/dist/app/demo/res/txt.svg +1 -0
- package/dist/app/demo/res/zip.svg +1 -0
- package/dist/app/task/config.json +29 -0
- package/dist/app/task/form/bar/bar.js +299 -0
- package/dist/app/task/form/bar/bar.xml +47 -0
- package/dist/app/task/form/desktop/desktop.xml +1 -0
- package/dist/app/task/locale/en.json +11 -0
- package/dist/app/task/locale/ja.json +11 -0
- package/dist/app/task/locale/sc.json +11 -0
- package/dist/app/task/locale/tc.json +11 -0
- package/dist/clickgo.js +41 -0
- package/dist/clickgo.ts +51 -0
- 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 -0
- package/dist/icon.png +0 -0
- package/dist/index.js +88 -0
- package/dist/index.ts +92 -0
- package/dist/lib/control.js +365 -0
- package/dist/lib/control.ts +428 -0
- package/dist/lib/core.js +668 -0
- package/dist/lib/core.ts +732 -0
- package/dist/lib/dom.js +1471 -0
- package/dist/lib/dom.ts +1785 -0
- package/dist/lib/form.js +2101 -0
- package/dist/lib/form.ts +2496 -0
- package/dist/lib/fs.js +849 -0
- package/dist/lib/fs.ts +995 -0
- package/dist/lib/native.js +138 -0
- package/dist/lib/native.ts +219 -0
- package/dist/lib/task.js +686 -0
- package/dist/lib/task.ts +842 -0
- package/dist/lib/theme.js +159 -0
- package/dist/lib/theme.ts +196 -0
- package/dist/lib/tool.js +501 -0
- package/dist/lib/tool.ts +620 -0
- package/dist/lib/zip.js +352 -0
- package/dist/lib/zip.ts +434 -0
- package/dist/theme/familiar.cgt +0 -0
- package/package.json +27 -0
- package/types/dev.d.ts +30 -0
- package/types/index.d.ts +673 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<form title="Dialog" width="400" height="400" min-width="400" min-height="400" padding="10">
|
|
2
|
+
<layout direction="v" gutter="10" style="flex: 1; width: 0;">
|
|
3
|
+
<layout align-h="center" align-v="center" style="flex: 1;">
|
|
4
|
+
<form title="Title" :min="false" :max="false" :resize="false" width="auto" height="auto" direction="v">
|
|
5
|
+
<dialog @select="btn = $event" :buttons="buttons" :direction="message === 'lines' ? 'v' : 'h'">
|
|
6
|
+
<template v-if="message === 'message'">Message</template>
|
|
7
|
+
<template v-else-if="message === 'buttons'"><button style="flex: 1; height: 30px;">Button1</button><button style="margin-left: 10px; flex: 1; height: 30px;">Button2</button></template>
|
|
8
|
+
<template v-else-if="message === 'lines'"><block v-for="i of 5">Line {{i}}.</block></template>
|
|
9
|
+
<template v-else>longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong</template>
|
|
10
|
+
</dialog>
|
|
11
|
+
</form>
|
|
12
|
+
</layout>
|
|
13
|
+
<layout gutter="10">
|
|
14
|
+
<button style="flex: 1; height: 30px;" @click="buttons = ['A', 'B', 'C']">['A', 'B', 'C']</button>
|
|
15
|
+
<button style="flex: 1; height: 30px;" @click="buttons = ['Cancel', 'OK']">['Cancel', 'OK']</button>
|
|
16
|
+
<button style="flex: 1; height: 30px;" @click="buttons = ['OK']">['OK']</button>
|
|
17
|
+
</layout>
|
|
18
|
+
<layout gutter="10">
|
|
19
|
+
<button style="flex: 1; height: 30px;" @click="message = 'message'">Message</button>
|
|
20
|
+
<button style="flex: 1; height: 30px;" @click="message = 'long'">Long</button>
|
|
21
|
+
<button style="flex: 1; height: 30px;" @click="message = 'buttons'">Two buttons</button>
|
|
22
|
+
<button style="flex: 1; height: 30px;" @click="message = 'lines'">Multiple lines</button>
|
|
23
|
+
</layout>
|
|
24
|
+
<label>You click: {{btn}}.</label>
|
|
25
|
+
</layout>
|
|
26
|
+
</form>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.methods = exports.data = void 0;
|
|
4
|
+
exports.data = {
|
|
5
|
+
'accept': 'txt',
|
|
6
|
+
'multi': 'false',
|
|
7
|
+
'dir': 'false',
|
|
8
|
+
'list': []
|
|
9
|
+
};
|
|
10
|
+
exports.methods = {
|
|
11
|
+
select: function () {
|
|
12
|
+
this.$refs.file.select();
|
|
13
|
+
},
|
|
14
|
+
change: function (files) {
|
|
15
|
+
this.list = [];
|
|
16
|
+
if (!files) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
for (const file of files) {
|
|
20
|
+
this.list.push((file.webkitRelativePath || file.name) + ' (' + file.size.toString() + ')');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<form width="300" height="300" title="File" padding="10">
|
|
2
|
+
<layout direction="v" gutter="10" style="flex: 1;">
|
|
3
|
+
<label>A control that reads a local files:</label>
|
|
4
|
+
<layout gutter="10" align-v="center">
|
|
5
|
+
<label style="width: 50px;">accept:</label>
|
|
6
|
+
<radio v-model="accept" value="txt" style="flex: 1;">txt</radio>
|
|
7
|
+
<radio v-model="accept" value="jpg" style="flex: 1;">jpg</radio>
|
|
8
|
+
</layout>
|
|
9
|
+
<layout gutter="10" align-v="center">
|
|
10
|
+
<label style="width: 50px;">multi:</label>
|
|
11
|
+
<radio v-model="multi" value="true" style="flex: 1;">true</radio>
|
|
12
|
+
<radio v-model="multi" value="false" style="flex: 1;">false</radio>
|
|
13
|
+
</layout>
|
|
14
|
+
<layout gutter="10" align-v="center">
|
|
15
|
+
<label style="width: 50px;">dir:</label>
|
|
16
|
+
<radio v-model="dir" value="true" style="flex: 1;">true</radio>
|
|
17
|
+
<radio v-model="dir" value="false" style="flex: 1;">false</radio>
|
|
18
|
+
</layout>
|
|
19
|
+
<button @click="select" style="height: 30px;">
|
|
20
|
+
Select
|
|
21
|
+
<file ref="file" @change="change" :accept="[accept]" :multi="multi" :dir="dir"></file>
|
|
22
|
+
</button>
|
|
23
|
+
<list :data="list" style="flex: 1; height: 0;"></list>
|
|
24
|
+
</layout>
|
|
25
|
+
</form>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
button{height:30px}.bottom button{flex:1;width:0}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
exports.methods = exports.data = void 0;
|
|
13
|
+
const clickgo = require("clickgo");
|
|
14
|
+
exports.data = {
|
|
15
|
+
'width': 300,
|
|
16
|
+
'height': 520,
|
|
17
|
+
'icon': '',
|
|
18
|
+
'title': 'Form',
|
|
19
|
+
'min': true,
|
|
20
|
+
'max': true,
|
|
21
|
+
'close': true,
|
|
22
|
+
'stateMax': false,
|
|
23
|
+
'stateMin': false,
|
|
24
|
+
'minWidth': 200,
|
|
25
|
+
'minHeight': 100,
|
|
26
|
+
'resize': true,
|
|
27
|
+
'loading': false,
|
|
28
|
+
'border': 'normal'
|
|
29
|
+
};
|
|
30
|
+
exports.methods = {
|
|
31
|
+
showLoading: function () {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
this.loading = true;
|
|
34
|
+
yield clickgo.tool.sleep(1000);
|
|
35
|
+
this.loading = false;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<form v-model:width="width" v-model:height="height" :icon="icon" :title="title" :min="min" :max="max" :close="close" v-model:state-max="stateMax" v-model:state-min="stateMin" :min-width="minWidth" :min-height="minHeight" :resize="resize" :loading="loading" :border="border" direction="v">
|
|
2
|
+
<overflow direction="v">
|
|
3
|
+
<layout direction="v" gutter="10" style="padding: 10px;">
|
|
4
|
+
<label>focus: {{cgFocus}}, width: {{width}}, height: {{height}}, state-max: {{stateMax}}, state-min: {{stateMin}}.</label>
|
|
5
|
+
<button @click="icon = icon ? '' : '/package/res/icon.svg'">Set icon</button>
|
|
6
|
+
<button @click="title = (title === 'Form') ? 'Changed' : 'Form'">Set title</button>
|
|
7
|
+
<button @click="min = min ? false : true">{{min ? 'Hide' : 'Show'}} min button</button>
|
|
8
|
+
<button @click="max = max ? false : true">{{max ? 'Hide' : 'Show'}} max button</button>
|
|
9
|
+
<button @click="close = close ? false : true">{{close ? 'Hide' : 'Show'}} close button</button>
|
|
10
|
+
<button @click="stateMax = true">To max</button>
|
|
11
|
+
<button @click="stateMin = true">To min</button>
|
|
12
|
+
<button @click="minWidth = (minWidth === 200) ? 300 : 200">Set min-width to {{minWidth === 200 ? '300' : '200'}}</button>
|
|
13
|
+
<button @click="minHeight = (minHeight === 100) ? 200 : 100">Set min-height to {{minHeight === 100 ? '200' : '100'}}</button>
|
|
14
|
+
<button @click="width = 350">Set width to 350</button>
|
|
15
|
+
<button @click="height = 400">Set height to 400</button>
|
|
16
|
+
<button @click="width = 'auto'">Set width to "auto"</button>
|
|
17
|
+
<button @click="height = 'auto'">Set height to "auto"</button>
|
|
18
|
+
<button @click="resize = resize ? false : true">{{resize ? 'Disabled' : 'Enabled'}} resize</button>
|
|
19
|
+
<button @click="showLoading">Show loading</button>
|
|
20
|
+
<layout class="bottom" gutter="10">
|
|
21
|
+
<button @click="border = 'normal'">Normal</button>
|
|
22
|
+
<button @click="border = 'thin'">Thin</button>
|
|
23
|
+
<button @click="border = 'plain'">Plain</button>
|
|
24
|
+
<button @click="border = 'none'">None</button>
|
|
25
|
+
</layout>
|
|
26
|
+
</layout>
|
|
27
|
+
</overflow>
|
|
28
|
+
</form>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.border{border:1px solid rgba(0,0,0,.1)}.custom{margin:auto;background:#07c160;width:60%;height:30px;color:#fff;text-align:center;line-height:30px}.rightborder{border-right:1px solid rgba(0,0,0,.1)}.block{width:200px;height:200px;padding:0 10px 10px 0}.block block{background:#07c160;color:#fff;display:flex;align-items:center;justify-content:center;flex:1}.content{display:inline-block;padding:5px;background:rgba(0,0,0,.1);margin-left:2px;margin-bottom:1px}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.methods = exports.mounted = exports.computed = exports.data = void 0;
|
|
4
|
+
const clickgo = require("clickgo");
|
|
5
|
+
exports.data = {
|
|
6
|
+
'ntab': '',
|
|
7
|
+
'lineValue': 100,
|
|
8
|
+
'lineCount': 2,
|
|
9
|
+
'sLeft1': 0,
|
|
10
|
+
'sTop1': 0,
|
|
11
|
+
'l1': 0,
|
|
12
|
+
'c1': 0,
|
|
13
|
+
'sLeft2': 0,
|
|
14
|
+
'sTop2': 0,
|
|
15
|
+
'l2': 0,
|
|
16
|
+
'c2': 0,
|
|
17
|
+
'sLeft3': 0,
|
|
18
|
+
'sTop3': 0,
|
|
19
|
+
'l3': 0,
|
|
20
|
+
'c3': 0,
|
|
21
|
+
'sLeft4': 0,
|
|
22
|
+
'sTop4': 0,
|
|
23
|
+
'l4': 0,
|
|
24
|
+
'c4': 0,
|
|
25
|
+
'direction': false,
|
|
26
|
+
'dir5': 'v',
|
|
27
|
+
'sLeft5': 0,
|
|
28
|
+
'sTop5': 0,
|
|
29
|
+
'l5': 0,
|
|
30
|
+
'c5': 0,
|
|
31
|
+
'line5': 10,
|
|
32
|
+
'c6': 0,
|
|
33
|
+
'is6': [],
|
|
34
|
+
'gesture': false,
|
|
35
|
+
'style': false,
|
|
36
|
+
'selection': false,
|
|
37
|
+
'content': false,
|
|
38
|
+
'area': {}
|
|
39
|
+
};
|
|
40
|
+
exports.computed = {
|
|
41
|
+
'is': function () {
|
|
42
|
+
const is = [];
|
|
43
|
+
for (let i = 0; i < this.lineCount; ++i) {
|
|
44
|
+
if (i > 0 && i % 10 === 0) {
|
|
45
|
+
is[i] = 30;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return is;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const mounted = function () {
|
|
53
|
+
this.is6[29] = 50;
|
|
54
|
+
this.is6[39] = 50;
|
|
55
|
+
};
|
|
56
|
+
exports.mounted = mounted;
|
|
57
|
+
exports.methods = {
|
|
58
|
+
scrollborder: function (e, dir) {
|
|
59
|
+
if (!this.gesture) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
let dirs = [];
|
|
63
|
+
switch (dir) {
|
|
64
|
+
case 'h': {
|
|
65
|
+
dirs = ['left', 'right'];
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
default: {
|
|
69
|
+
dirs = ['top', 'bottom'];
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
clickgo.dom.bindGesture(e, {
|
|
74
|
+
'dirs': dirs,
|
|
75
|
+
'handler': (dir) => {
|
|
76
|
+
switch (dir) {
|
|
77
|
+
case 'left':
|
|
78
|
+
case 'top': {
|
|
79
|
+
this.lineCount -= 10;
|
|
80
|
+
if (this.lineCount < 0) {
|
|
81
|
+
this.lineCount = 0;
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
default: {
|
|
86
|
+
this.lineCount += this.lineValue;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.border {
|
|
2
|
+
border: 1px solid rgba(0, 0, 0, .1);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.custom {
|
|
6
|
+
margin: auto; background: #07c160; width: 60%; height: 30px; color: #FFF; text-align: center; line-height: 30px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.rightborder {
|
|
10
|
+
border-right: 1px solid rgba(0, 0, 0, .1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.block {
|
|
14
|
+
width: 200px; height: 200px; padding: 0 10px 10px 0;
|
|
15
|
+
}
|
|
16
|
+
.block block {
|
|
17
|
+
background: #07c160; color: #FFF; display: flex; align-items: center; justify-content: center; flex: 1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.content {
|
|
21
|
+
display: inline-block; padding: 5px; background: rgba(0, 0, 0, .1); margin-left: 2px; margin-bottom: 1px;
|
|
22
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<form title="Greatview" width="450" height="450" min-width="300" min-height="400" padding="10">
|
|
2
|
+
<tab v-model="ntab" :tabs="['normal', 'adaptation', 'beyond', 'nest']" style="flex: 1; width: 0;">
|
|
3
|
+
<!-- 默认 -->
|
|
4
|
+
<layout v-if="ntab === 'normal'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
|
|
5
|
+
<!-- v -->
|
|
6
|
+
<layout gutter="10" style="flex: 1; height: 0;">
|
|
7
|
+
<greatview v-model:scroll-left="sLeft1" v-model:scroll-top="sTop1" direction="v" :selection="selection" @select="area = $event" @resize="c1 = $event" @change="l1 = $event" @scrollborder="scrollborder($event, 'v')" :style="{'line-height': style ? '1.5' : undefined, 'padding': style ? '10px' : undefined}" class="border" style="flex: 1; width: 0;" :data="lineCount" v-slot="data" :items-size="is" same>
|
|
8
|
+
<button v-if="data.index > 0 && data.index % 10 === 0" style="height: 30px;">test</button>
|
|
9
|
+
<block v-else>Line {{data.row}}, index: {{data.index}}<label v-if="content" class="content">ha</label>.</block>
|
|
10
|
+
</greatview>
|
|
11
|
+
<layout class="border" style="flex: 1; width: 0;">
|
|
12
|
+
<greatview v-model:scroll-left="sLeft2" v-model:scroll-top="sTop2" direction="v" :selection="selection" @select="area = $event" @resize="c2 = $event" @change="l2 = $event" @scrollborder="scrollborder($event, 'v')" :style="{'line-height': style ? '1.5' : undefined, 'padding': style ? '10px' : undefined}" style="flex: 1; width: 0;" :data="lineCount" v-slot="data" :items-size="is" same>
|
|
13
|
+
<block v-if="data.index > 0 && data.index % 10 === 0" class="custom">Custom</block>
|
|
14
|
+
<block v-else>Line {{data.row}}, index: {{data.index}}.</block>
|
|
15
|
+
</greatview>
|
|
16
|
+
<scroll :length="l2" :client="c2" v-model:scroll-offset="sTop2" style="width: 20px;"></scroll>
|
|
17
|
+
</layout>
|
|
18
|
+
</layout>
|
|
19
|
+
<label>Scroll Left: {{sLeft1}}, Scroll Top: {{sTop1}}, Length: {{l1}}, Client: {{c1}}.</label>
|
|
20
|
+
<label>Scroll Left: {{sLeft2}}, Scroll Top: {{sTop2}}, Length: {{l2}}, Client: {{c2}}.</label>
|
|
21
|
+
<!-- h -->
|
|
22
|
+
<greatview v-model:scroll-left="sLeft3" v-model:scroll-top="sTop3" :selection="selection" @select="area = $event" @resize="c3 = $event" @change="l3 = $event" @scrollborder="scrollborder($event, 'h')" :style="{'line-height': style ? '1.5' : undefined, 'padding': style ? '10px' : undefined}" class="border" style="flex: 1; height: 0;" :data="lineCount" v-slot="data" same>
|
|
23
|
+
<layout align-v="center" align-h="center" direction="v" class="rightborder" style="width: 80px;">
|
|
24
|
+
<label>Col {{data.row}}.</label>
|
|
25
|
+
<label>index: {{data.index}}.</label>
|
|
26
|
+
</layout>
|
|
27
|
+
</greatview>
|
|
28
|
+
<label>Scroll Left: {{sLeft3}}, Scroll Top: {{sTop3}}, Length: {{l3}}, Client: {{c3}}.</label>
|
|
29
|
+
<label>Selection area: {{area}}</label>
|
|
30
|
+
<!-- button list -->
|
|
31
|
+
<layout gutter="10">
|
|
32
|
+
<select v-model="lineValue" :data="[100, 500, 1000, 10000]" style="flex: 1; width: 0;"></select>
|
|
33
|
+
<button @click="lineCount += lineValue" style="height: 30px; padding: 0 10px;">Add lines</button>
|
|
34
|
+
<button @click="lineCount -= lineValue;if(lineCount < 0) {lineCount = 0;}" style="height: 30px; padding: 0 10px;">Remove lines</button>
|
|
35
|
+
</layout>
|
|
36
|
+
<layout gutter="10">
|
|
37
|
+
<button @click="gesture = !gesture" style="flex: 1; width: 0; height: 30px;">{{gesture ? '' : '!'}}gesture</button>
|
|
38
|
+
<button @click="selection = !selection" style="flex: 1; width: 0; height: 30px;">{{selection ? '' : '!'}}selection</button>
|
|
39
|
+
<button @click="style = !style" style="flex: 1; width: 0; height: 30px;">{{style ? '' : '!'}}style</button>
|
|
40
|
+
<button @click="content = !content" style="flex: 1; width: 0; height: 30px;">{{content ? '' : '!'}}content</button>
|
|
41
|
+
</layout>
|
|
42
|
+
</layout>
|
|
43
|
+
<!-- 自适应 -->
|
|
44
|
+
<layout v-else-if="ntab === 'adaptation'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
|
|
45
|
+
<layout :direction="direction ? 'h' : 'v'" style="flex: 1; height: 0;">
|
|
46
|
+
<greatview class="border" v-model:scroll-left="sLeft4" v-model:scroll-top="sTop4" :direction="direction ? 'h' : 'v'" @resize="c4 = $event" @change="l4 = $event" @scrollborder="scrollborder($event, 'v')" :data="lineCount" v-slot="data" :items-size="is" same>
|
|
47
|
+
<layout align-v="center" direction="v" :class="[direction && 'rightborder']" style="flex: 1;">
|
|
48
|
+
<button v-if="data.index > 0 && data.index % 10 === 0" style="height: 30px;" :style="{'width': direction ? '30px' : undefined}">btn</button>
|
|
49
|
+
<block v-else :style="{'width': direction ? '80px' : undefined, 'text-align': direction ? 'center' : undefined}">Line {{data.row}}</block>
|
|
50
|
+
</layout>
|
|
51
|
+
</greatview>
|
|
52
|
+
</layout>
|
|
53
|
+
<label>Scroll Left: {{sLeft4}}, Scroll Top: {{sTop4}}, Length: {{l4}}, Client: {{c4}}.</label>
|
|
54
|
+
<layout gutter="10">
|
|
55
|
+
<button @click="lineCount += 10" style="flex: 1; width: 0; height: 30px;">Add 10 lines</button>
|
|
56
|
+
<button @click="lineCount -= 10;if(lineCount < 0) {lineCount = 0;}" style="flex: 1; width: 0; height: 30px;">Remove 10 lines</button>
|
|
57
|
+
<button @click="direction = !direction" style="flex: 1; height: 30px;">Direction</button>
|
|
58
|
+
</layout>
|
|
59
|
+
</layout>
|
|
60
|
+
<!-- 内容超出 -->
|
|
61
|
+
<layout v-else-if="ntab === 'beyond'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
|
|
62
|
+
<layout gutter="10" align-v="center">
|
|
63
|
+
<button @click="dir5 = (dir5 === 'h' ? 'v' : 'h')" style="flex: 1; width: 0; height: 30px;">Change direction</button>
|
|
64
|
+
<button @click="line5 = (line5 === 10 ? 1 : 10)" style="flex: 1; width: 0; height: 30px;">Change data</button>
|
|
65
|
+
<label>Direction: {{dir5}}</label>
|
|
66
|
+
</layout>
|
|
67
|
+
<greatview v-model:scroll-left="sLeft5" v-model:scroll-top="sTop5" content="max" @resize="c5 = $event" @change="l5 = $event" :direction="dir5" class="border" style="flex: 1; height: 0; padding: 10px 0 0 10px;" :data="line5" v-slot="data" same>
|
|
68
|
+
<layout :direction="dir5 === 'h' ? 'v' : 'h'">
|
|
69
|
+
<layout v-for="j of 10" class="block">
|
|
70
|
+
<block>{{data.row}}-{{j}}</block>
|
|
71
|
+
</layout>
|
|
72
|
+
</layout>
|
|
73
|
+
</greatview>
|
|
74
|
+
<label>Scroll Left: {{sLeft5}}, Scroll Top: {{sTop5}}, Length: {{l5}}, Client: {{c5}}.</label>
|
|
75
|
+
</layout>
|
|
76
|
+
<!-- 嵌套 -->
|
|
77
|
+
<layout v-else style="flex: 1; width: 0; padding: 10px;">
|
|
78
|
+
<greatview class="border" direction="v" @resizen="c6 = $event" solo="false" style="flex: 1; width: 0;" :data="100" v-slot="data" :items-size="is6" same>
|
|
79
|
+
<greatview v-if="data.row === 30" class="border" direction="v" solo="false" style="height: 50px;" :data="50" v-slot="data" same>
|
|
80
|
+
<label>Line {{data.row}}</label>
|
|
81
|
+
</greatview>
|
|
82
|
+
<greatview v-else-if="data.row === 40" :data="50" v-slot="data" class="border" solo="false" style="height: 50px;" :style="{'width': c6 + 'px'}" same>
|
|
83
|
+
<label class="rightborder" style="width: 80px;">Line {{data.row}}</label>
|
|
84
|
+
</greatview>
|
|
85
|
+
<label v-else>Line {{data.row}}</label>
|
|
86
|
+
</greatview>
|
|
87
|
+
</layout>
|
|
88
|
+
</tab>
|
|
89
|
+
</form>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<form width="300" height="500" title="Img">
|
|
2
|
+
<overflow direction="v" style="flex: 1; width: 0;">
|
|
3
|
+
<layout direction="v" gutter="10" style="padding: 10px;">
|
|
4
|
+
<label>Load "../../../res/img.jpg":</label>
|
|
5
|
+
<img src="../../../res/img.jpg" style="width: 200px; height: 200px;" />
|
|
6
|
+
<label>Mode auto:</label>
|
|
7
|
+
<img src="../../../res/img.jpg" mode="auto" style="width: 200px; height: 200px;" />
|
|
8
|
+
<label>Mode cover:</label>
|
|
9
|
+
<img src="../../../res/img.jpg" mode="cover" style="width: 200px; height: 250px;" />
|
|
10
|
+
<label>Mode contain:</label>
|
|
11
|
+
<img src="../../../res/img.jpg" mode="contain" style="border: dotted 1px rgba(0, 0, 0, .5); width: 200px; height: 250px;" />
|
|
12
|
+
<label>You can also use http://, https:// and data: url, load "https://nodejs.org/static/images/logo.svg":</label>
|
|
13
|
+
<img src="https://nodejs.org/static/images/logo.svg" style="background-color: #333; width: 122px; height: 75px;" />
|
|
14
|
+
</layout>
|
|
15
|
+
</overflow>
|
|
16
|
+
</form>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<form width="300" height="300" title="Label">
|
|
2
|
+
<layout direction="v" gutter="10" style="padding: 10px; flex: 1; width: 0;">
|
|
3
|
+
<label>You can use CSS to customize the label:</label>
|
|
4
|
+
<label>Normal</label>
|
|
5
|
+
<label style="text-align: center;">Center</label>
|
|
6
|
+
<label style="color: red;">Color</label>
|
|
7
|
+
<label style="background: rgba(0, 0, 0, .1);">Background</label>
|
|
8
|
+
<label style="background: rgba(0, 0, 0, .1); padding: 10px;">Padding</label>
|
|
9
|
+
<label style="font-size: 36px;">Font size</label>
|
|
10
|
+
</layout>
|
|
11
|
+
</form>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tab,.tip,.ctr{margin-top:10px}.ctr button{height:30px;flex:1}
|
|
@@ -0,0 +1,194 @@
|
|
|
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
|
+
exports.methods = exports.computed = exports.data = void 0;
|
|
13
|
+
const clickgo = require("clickgo");
|
|
14
|
+
exports.data = {
|
|
15
|
+
'ntab': '',
|
|
16
|
+
'slist': [
|
|
17
|
+
{
|
|
18
|
+
'type': 0,
|
|
19
|
+
'name': 'Appraise',
|
|
20
|
+
'path': 'Bob >> folder >> Appraise',
|
|
21
|
+
'src': '/package/res/r-1.svg'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
'type': 0,
|
|
25
|
+
'name': 'Card',
|
|
26
|
+
'path': 'Bob >> folder >> Card',
|
|
27
|
+
'src': '/package/res/r-2.svg',
|
|
28
|
+
'menu': true
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
'type': 0,
|
|
32
|
+
'name': 'Appraise2',
|
|
33
|
+
'path': 'Bob >> folder >> Appraise2',
|
|
34
|
+
'src': '/package/res/r-1.svg',
|
|
35
|
+
'disabled': true
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
'control': 'split'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
'type': 1
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
'select': 0,
|
|
45
|
+
'select2': 'Appraise',
|
|
46
|
+
'label2': '',
|
|
47
|
+
'tree': false,
|
|
48
|
+
'async': false,
|
|
49
|
+
'icon': false,
|
|
50
|
+
'sub6children': [],
|
|
51
|
+
'select3': 0,
|
|
52
|
+
'listData3': [],
|
|
53
|
+
'select4': '',
|
|
54
|
+
'listData4': [],
|
|
55
|
+
'disabled': false,
|
|
56
|
+
'must': true,
|
|
57
|
+
'multi': false,
|
|
58
|
+
'selection': false,
|
|
59
|
+
'selectionArea': {},
|
|
60
|
+
'scroll': 'auto'
|
|
61
|
+
};
|
|
62
|
+
exports.computed = {
|
|
63
|
+
'adData': function () {
|
|
64
|
+
const data = [];
|
|
65
|
+
for (let i = 0; i < this.slist.length; ++i) {
|
|
66
|
+
const item = this.slist[i];
|
|
67
|
+
data.push({
|
|
68
|
+
'type': item.type === undefined ? 'split' : item.type,
|
|
69
|
+
'menu': i === 20 ? true : false
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return data;
|
|
73
|
+
},
|
|
74
|
+
'listData': function () {
|
|
75
|
+
const data = ['Item1', {
|
|
76
|
+
'label': 'Title1',
|
|
77
|
+
'children': [
|
|
78
|
+
'Sub1',
|
|
79
|
+
{
|
|
80
|
+
'label': 'Title2',
|
|
81
|
+
'children': ['Sub2', 'Sub3'],
|
|
82
|
+
'icon': '../../../res/zip.svg',
|
|
83
|
+
'openicon': '../../../res/sql.svg'
|
|
84
|
+
},
|
|
85
|
+
'Sub4',
|
|
86
|
+
{
|
|
87
|
+
'label': 'Title3',
|
|
88
|
+
'title': true,
|
|
89
|
+
'children': ['Sub5',
|
|
90
|
+
{
|
|
91
|
+
'value': 'Sub6',
|
|
92
|
+
'children': this.sub6children
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
'tree': 1
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}];
|
|
99
|
+
for (let k = 0; k < this.slist.length; ++k) {
|
|
100
|
+
if (this.slist[k].name) {
|
|
101
|
+
data.push({
|
|
102
|
+
'label': `index: ${k}, value: ${this.slist[k].name}${(k === 20 ? ' long test long test long test long test long test' : '')}`,
|
|
103
|
+
'value': this.slist[k].name,
|
|
104
|
+
'disabled': this.slist[k].disabled
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
data.push({
|
|
109
|
+
'label': `index: ${k}, value: i${k}${(k === 20 ? ' long test long test long test long test long test' : '')}`,
|
|
110
|
+
'value': 'i' + k.toString(),
|
|
111
|
+
'disabled': true
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return data;
|
|
116
|
+
},
|
|
117
|
+
'listData2': function () {
|
|
118
|
+
const data = [];
|
|
119
|
+
for (let k = 0; k < this.listData.length; k++) {
|
|
120
|
+
data.push(k + 1);
|
|
121
|
+
}
|
|
122
|
+
return data;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
exports.methods = {
|
|
126
|
+
showIndex: function () {
|
|
127
|
+
clickgo.form.dialog('Index is ' + this.select.toString() + '.').catch((e) => { throw e; });
|
|
128
|
+
},
|
|
129
|
+
showIndex2: function () {
|
|
130
|
+
clickgo.form.dialog('Index is ' + this.select2.toString() + '.').catch((e) => { throw e; });
|
|
131
|
+
},
|
|
132
|
+
showType: function () {
|
|
133
|
+
if (Array.isArray(this.select)) {
|
|
134
|
+
if (this.select.length === 0) {
|
|
135
|
+
clickgo.form.dialog('There are currently no selected items.').catch((e) => { throw e; });
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
const types = [];
|
|
139
|
+
for (const item of this.select) {
|
|
140
|
+
types.push(this.slist[item].type);
|
|
141
|
+
}
|
|
142
|
+
clickgo.form.dialog(`Type is ${types}.`).catch((e) => { throw e; });
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
clickgo.form.dialog(this.select === -1 ? 'There are currently no selected items.' : `Type is ${this.slist[this.select].type}.`).catch((e) => { throw e; });
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
selectButton: function () {
|
|
150
|
+
if (this.ntab === 'list') {
|
|
151
|
+
this.select2 = 'Item1';
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
this.select = 1;
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
selectButtonList: function () {
|
|
158
|
+
this.select2 = 'Sub3';
|
|
159
|
+
},
|
|
160
|
+
onSelectLoad: function (value, resolve) {
|
|
161
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
if (value !== 'Sub6') {
|
|
163
|
+
yield clickgo.tool.sleep(100);
|
|
164
|
+
if (value === 'Sub8') {
|
|
165
|
+
resolve(['Sub9', 'Sub10']);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
resolve();
|
|
169
|
+
}
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
yield clickgo.tool.sleep(300);
|
|
173
|
+
this.sub6children = ['Sub7', 'Sub8'];
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
onSelect: function (area) {
|
|
177
|
+
this.selectionArea = area;
|
|
178
|
+
},
|
|
179
|
+
scrollChange: function () {
|
|
180
|
+
switch (this.scroll) {
|
|
181
|
+
case 'auto': {
|
|
182
|
+
this.scroll = 'visible';
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
case 'visible': {
|
|
186
|
+
this.scroll = 'hidden';
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
default: {
|
|
190
|
+
this.scroll = 'auto';
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
};
|