clickgo 3.1.2-dev11 → 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 -73
- 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 +161 -5
- package/dist/app/demo/form/main.xml +36 -35
- package/dist/app/demo/form/method/aform/aform.xml +3 -2
- 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 +8 -8
- package/dist/app/demo/form/method/form/form.xml +4 -4
- 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 +1 -1
- package/dist/app/task/form/bar/bar.xml +1 -1
- package/dist/clickgo.js +1 -1
- package/dist/clickgo.ts +1 -1
- 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 +3 -3
- package/dist/index.ts +3 -3
- package/dist/lib/control.js +70 -104
- package/dist/lib/control.ts +97 -123
- 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 +146 -138
- package/dist/lib/form.ts +108 -86
- 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 +175 -11
- package/dist/lib/task.js +294 -158
- package/dist/lib/task.ts +326 -172
- 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 +23 -24
- 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
|
@@ -1,74 +1,76 @@
|
|
|
1
1
|
<form title="Select" width="400" height="450" min-width="300" min-height="400" padding="10">
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
<block>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</layout>
|
|
14
|
-
<template v-slot:pop="data">
|
|
15
|
-
<layout v-if="data.row.type === 0" align-v="center" gutter="5" style="flex: 1; line-height: 1.3;">
|
|
16
|
-
<img :src="data.row.src" style="width: 32px; height: 32px;"></img>
|
|
17
|
-
<block style="flex: 1;">
|
|
18
|
-
<block>{{data.row.name}}</block>
|
|
19
|
-
<block style="opacity: .7;">{{data.row.path}}</block>
|
|
2
|
+
<layout gutter="10" direction="v" style="flex: 1; width: 0;">
|
|
3
|
+
<tab v-model="ntab" :tabs="['greatselect', 'select']" style="flex: 1; height: 0;">
|
|
4
|
+
<!-- greatselect -->
|
|
5
|
+
<layout v-if="ntab === 'greatselect'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
|
|
6
|
+
<label>Now select value is {{select}}:</label>
|
|
7
|
+
<greatselect v-model="select" :data="slist" :area="area" :disabled="disabled" :multi="multi" :sizes="sizes" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}" style="line-height: 1.3;">
|
|
8
|
+
<layout align-v="center" gutter="5" style="flex: 1;">
|
|
9
|
+
<img :src="slist[select[0]] ? slist[select[0]].src : ''" style="width: 32px; height: 32px;"></img>
|
|
10
|
+
<block>
|
|
11
|
+
<block>{{slist[select[0]] ? slist[select[0]].name : 'None'}}{{select.length > 1 ? ' [multi]' : ''}}</block>
|
|
12
|
+
<block style="opacity: .7;">{{slist[select[0]] ? slist[select[0]].path : none}}</block>
|
|
20
13
|
</block>
|
|
21
14
|
</layout>
|
|
22
|
-
<template v-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<layout gutter="10">
|
|
50
|
-
<button @click="background = !background" style="flex: 1; height: 30px;">Change background and color</button>
|
|
15
|
+
<template v-slot:pop="data">
|
|
16
|
+
<layout v-if="data.row.type === 0" align-v="center" gutter="5" style="flex: 1;">
|
|
17
|
+
<img :src="data.row.src" style="width: 32px; height: 32px;"></img>
|
|
18
|
+
<block>
|
|
19
|
+
<block>{{data.row.name}}</block>
|
|
20
|
+
<block style="opacity: .7;">{{data.row.path}}</block>
|
|
21
|
+
</block>
|
|
22
|
+
</layout>
|
|
23
|
+
<template v-else>Other</template>
|
|
24
|
+
</template>
|
|
25
|
+
<template v-slot:itempop>
|
|
26
|
+
<menulist>
|
|
27
|
+
<menulist-item alt="S">Set the default</menulist-item>
|
|
28
|
+
</menulist>
|
|
29
|
+
</template>
|
|
30
|
+
</greatselect>
|
|
31
|
+
<label>Custom pop:</label>
|
|
32
|
+
<greatselect pop="custom" :area="area" :disabled="disabled" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}">
|
|
33
|
+
<label>Pop is button.</label>
|
|
34
|
+
<template v-slot:pop>
|
|
35
|
+
<button style="height: 30px;">Nothing</button>
|
|
36
|
+
</template>
|
|
37
|
+
</greatselect>
|
|
38
|
+
<layout gutter="10">
|
|
39
|
+
<button @click="slist.splice(-2, 0, {'type': 0, 'name': 'Card' + slist.length, 'path': 'Bob >> folder >> Card', 'src': '/package/res/r-2.svg','disabled': false})" style="flex: 1; height: 30px;">Add item</button>
|
|
40
|
+
<button @click="slist.splice(-3, 1)" style="flex: 1; height: 30px;">Remove item</button>
|
|
41
|
+
</layout>
|
|
51
42
|
</layout>
|
|
43
|
+
<!-- select -->
|
|
44
|
+
<flow v-else-if="ntab === 'select'" direction="v" style="flex: 1; width: 0;">
|
|
45
|
+
<layout gutter="10" direction="v" style="padding: 10px;">
|
|
46
|
+
<label>Now select value is {{select2}}</label>
|
|
47
|
+
<label>Label: {{label2}}</label>
|
|
48
|
+
<select v-model="select2" @label="label2 = $event" :data="remote ? slist2r : slist2" :disabled="disabled" :editable="editable" :multi="multi" :tree="tree" :async="async" :remote="remote" :icon="icon" icon-default="../../../res/txt.svg" @load="onLoad" @remote="onRemote" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
|
|
49
|
+
<label>Custom height:</label>
|
|
50
|
+
<select :data="remote ? slist2r : ['1','2','3','4','5']" :disabled="disabled" :editable="editable" :multi="multi" :tree="tree" :async="async" :remote="remote" :icon="icon" icon-default="../../../res/txt.svg" style="height: 60px;" @load="onLoad" @remote="onRemote" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
|
|
51
|
+
<label>Always editable:</label>
|
|
52
|
+
<select :data="remote ? slist2r : ['1','2','3','4','5']" :disabled="disabled" editable :multi="multi" :tree="tree" :async="async" :remote="remote" :icon="icon" icon-default="../../../res/txt.svg" @load="onLoad" @remote="onRemote" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
|
|
53
|
+
<layout gutter="10">
|
|
54
|
+
<button @click="icon = !icon" style="flex: 1; height: 30px;">{{icon ? '' : '!'}}icon</button>
|
|
55
|
+
<button @click="tree = !tree" style="flex: 1; height: 30px;">{{tree ? '' : '!'}}tree</button>
|
|
56
|
+
<button @click="async = !async" style="flex: 1; height: 30px;">{{async ? '' : '!'}}async</button>
|
|
57
|
+
<button @click="remote = !remote" style="flex: 1; height: 30px;">{{remote ? '' : '!'}}remote</button>
|
|
58
|
+
</layout>
|
|
59
|
+
</layout>
|
|
60
|
+
</flow>
|
|
61
|
+
</tab>
|
|
62
|
+
<layout gutter="10">
|
|
63
|
+
<button @click="disabled = !disabled" style="flex: 1; height: 30px;">{{disabled ? '' : '!'}}disabled</button>
|
|
64
|
+
<button v-if="ntab === 'greatselect'" @click="area = area === 'all' ? 'arrow' : 'all'" style="flex: 1; height: 30px;">Area: {{area}}</button>
|
|
65
|
+
<button v-else @click="editable = !editable" style="flex: 1; height: 30px;">{{editable ? '' : '!'}}editable</button>
|
|
52
66
|
</layout>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<
|
|
59
|
-
<
|
|
60
|
-
<select :data="['1','2','3','4','5']" :disabled="disabled" editable :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
|
|
61
|
-
<layout gutter="10">
|
|
62
|
-
<button @click="disabled = !disabled" style="flex: 1; height: 30px;">Disabled: {{disabled}}</button>
|
|
63
|
-
<button @click="editable = !editable" style="flex: 1; height: 30px;">Editable: {{editable}}</button>
|
|
64
|
-
</layout>
|
|
65
|
-
<layout gutter="10">
|
|
66
|
-
<button @click="fontSize = !fontSize" style="flex: 1; height: 30px;">Change font size</button>
|
|
67
|
-
<button @click="padding = !padding" style="flex: 1; height: 30px;">Change padding</button>
|
|
68
|
-
</layout>
|
|
69
|
-
<layout gutter="10">
|
|
70
|
-
<button @click="background = !background" style="flex: 1; height: 30px;">Change background and color</button>
|
|
71
|
-
</layout>
|
|
67
|
+
<layout gutter="10">
|
|
68
|
+
<button @click="fontSize = !fontSize" style="flex: 1; height: 30px;">Change font size</button>
|
|
69
|
+
<button @click="padding = !padding" style="flex: 1; height: 30px;">Change padding</button>
|
|
70
|
+
</layout>
|
|
71
|
+
<layout gutter="10">
|
|
72
|
+
<button @click="background = !background" style="flex: 1; height: 30px;">Change bg & color</button>
|
|
73
|
+
<button @click="multi = !multi" style="flex: 1; height: 30px;">{{multi ? '' : '!'}}multi</button>
|
|
72
74
|
</layout>
|
|
73
|
-
</
|
|
75
|
+
</layout>
|
|
74
76
|
</form>
|
|
@@ -9,20 +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.data = void 0;
|
|
13
12
|
const clickgo = require("clickgo");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
class default_1 extends clickgo.form.AbstractForm {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.ntab = '';
|
|
17
|
+
this.tabs = ['tab1'];
|
|
18
|
+
this.tindex = 1;
|
|
19
|
+
this.tabPosition = 'top';
|
|
20
|
+
this.color = undefined;
|
|
21
|
+
this.size = undefined;
|
|
22
|
+
this.drag = false;
|
|
23
|
+
this.cclose = false;
|
|
24
|
+
}
|
|
25
|
+
onClose(e, i) {
|
|
26
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
27
|
if (i !== 10) {
|
|
28
28
|
return;
|
|
@@ -30,8 +30,8 @@ exports.methods = {
|
|
|
30
30
|
e.preventDefault();
|
|
31
31
|
yield clickgo.form.dialog('The tab can not be close.');
|
|
32
32
|
});
|
|
33
|
-
}
|
|
34
|
-
add
|
|
33
|
+
}
|
|
34
|
+
add() {
|
|
35
35
|
const len = this.tabs.length;
|
|
36
36
|
const val = 'tab' + (++this.tindex).toString();
|
|
37
37
|
if (len === 15) {
|
|
@@ -51,13 +51,13 @@ exports.methods = {
|
|
|
51
51
|
else {
|
|
52
52
|
this.tabs.push(val);
|
|
53
53
|
}
|
|
54
|
-
}
|
|
55
|
-
remove
|
|
54
|
+
}
|
|
55
|
+
remove() {
|
|
56
56
|
if (this.tabs.length > 0) {
|
|
57
57
|
this.tabs.splice(this.tabs.length - 1);
|
|
58
58
|
}
|
|
59
|
-
}
|
|
60
|
-
position
|
|
59
|
+
}
|
|
60
|
+
position() {
|
|
61
61
|
switch (this.tabPosition) {
|
|
62
62
|
case 'top':
|
|
63
63
|
this.tabPosition = 'right';
|
|
@@ -72,4 +72,5 @@ exports.methods = {
|
|
|
72
72
|
this.tabPosition = 'top';
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
}
|
|
75
|
+
}
|
|
76
|
+
exports.default = default_1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<form title="Tab" width="400" height="450" min-width="300" min-height="400" padding="10" direction="v">
|
|
2
2
|
<label>Now tab: {{ntab}}.</label>
|
|
3
|
-
<tab v-model="ntab" v-model:tabs="tabs" :tabPosition="tabPosition" :drag="drag" :close="
|
|
3
|
+
<tab v-model="ntab" v-model:tabs="tabs" :tabPosition="tabPosition" :drag="drag" :close="cclose" @close="onClose" style="margin-top: 10px; flex: 1; height: 0;" :style="{'font-size': size, 'color': color}">
|
|
4
4
|
<!-- 默认 -->
|
|
5
5
|
<layout style="padding: 10px;">
|
|
6
6
|
<button v-if="ntab === 'tab2'" style="padding: 0 10px; height: 30px;">Test button</button>
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
<button @click="color = color ? undefined : 'red'" style="padding: 0 10px; flex: 1; width: 0; height: 30px;">{{color ? '' : '!'}}red</button>
|
|
18
18
|
<button @click="size = size ? undefined : '18px'" style="padding: 0 10px; flex: 1; width: 0; height: 30px;">{{size ? '' : '!'}}18px</button>
|
|
19
19
|
<button @click="drag = !drag" style="padding: 0 10px; flex: 1; width: 0; height: 30px;">{{drag ? '' : '!'}}drag</button>
|
|
20
|
-
<button @click="
|
|
20
|
+
<button @click="cclose = !cclose" style="padding: 0 10px; flex: 1; width: 0; height: 30px;">{{cclose ? '' : '!'}}close</button>
|
|
21
21
|
</layout>
|
|
22
22
|
</form>
|
|
@@ -1,53 +1,61 @@
|
|
|
1
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
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.methods = exports.data = void 0;
|
|
4
12
|
const clickgo = require("clickgo");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
13
|
+
class default_1 extends clickgo.form.AbstractForm {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.value = '';
|
|
17
|
+
this.isFocus = false;
|
|
18
|
+
this.selectionStart = 0;
|
|
19
|
+
this.selectionEnd = 0;
|
|
20
|
+
this.scrollLeft = 0;
|
|
21
|
+
this.scrollTop = 0;
|
|
22
|
+
this.clientHeight = 0;
|
|
23
|
+
this.clientWidth = 0;
|
|
24
|
+
this.scrollHeight = 0;
|
|
25
|
+
this.scrollWidth = 0;
|
|
26
|
+
this.multi = false;
|
|
27
|
+
this.disabled = false;
|
|
28
|
+
this.readonly = false;
|
|
29
|
+
this.password = false;
|
|
30
|
+
this.wrap = true;
|
|
31
|
+
this.menu = false;
|
|
32
|
+
this.gesture = false;
|
|
33
|
+
this.long = false;
|
|
34
|
+
this.lineHeight = 1;
|
|
35
|
+
this.fontSize = 12;
|
|
36
|
+
this.border = 'solid';
|
|
37
|
+
this.background = undefined;
|
|
38
|
+
}
|
|
39
|
+
get textBorder() {
|
|
40
|
+
switch (this.border) {
|
|
41
|
+
case 'underline': {
|
|
42
|
+
return '0 0 .5px 0';
|
|
43
|
+
}
|
|
44
|
+
case 'none': {
|
|
45
|
+
return '0';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
longClick() {
|
|
29
51
|
this.value = this.long ? 'short\nshort\nshort\nshort\nshort\nshort\nshort\nshort\nshort' : 'long\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong';
|
|
30
52
|
this.long = !this.long;
|
|
31
53
|
this.scrollTop = 0;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
clickgo.dom.bindGesture(e, {
|
|
38
|
-
'dirs': this.multi ? ['top', 'bottom'] : ['left', 'right'],
|
|
39
|
-
'handler': (dir) => {
|
|
40
|
-
switch (dir) {
|
|
41
|
-
case 'left':
|
|
42
|
-
case 'top': {
|
|
43
|
-
this.value = this.value.slice(0, -1);
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
default: {
|
|
47
|
-
this.value += 'A';
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
54
|
+
}
|
|
55
|
+
onGesture(dir) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
yield clickgo.form.dialog('onGesture: ' + dir);
|
|
51
58
|
});
|
|
52
59
|
}
|
|
53
|
-
}
|
|
60
|
+
}
|
|
61
|
+
exports.default = default_1;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<form width="350" height="350" title="Textbox">
|
|
2
2
|
<layout direction="v" gutter="10" style="padding: 10px; flex: 1; width: 0;">
|
|
3
|
-
<label>Text Length: {{value.length}}, Selection Start: {{selectionStart}}, Selection End: {{selectionEnd}}</label>
|
|
4
|
-
<label>Scroll Left: {{scrollLeft}}, Scroll Top: {{scrollTop}},
|
|
5
|
-
<text v-model="value" :multi="multi" :disabled="disabled" :readonly="readonly" :password="password" :wrap="wrap"
|
|
3
|
+
<label>Text Length: {{value.length}}, Selection Start: {{selectionStart}}, Selection End: {{selectionEnd}}, Focus: {{isFocus}}</label>
|
|
4
|
+
<label>Scroll Left: {{scrollLeft}}, Scroll Top: {{scrollTop}}, Scroll Height: {{scrollHeight}}, Scroll Width: {{scrollWidth}}, Client Height: {{clientHeight}}, Client Width: {{clientWidth}}</label>
|
|
5
|
+
<text v-model="value" :multi="multi" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :disabled="disabled" :readonly="readonly" :password="password" :wrap="wrap" v-model:scroll-left="scrollLeft" v-model:scroll-top="scrollTop" v-model:selection-start="selectionStart" v-model:selection-end="selectionEnd" @clientheight="clientHeight = $event" @clientwidth="clientWidth = $event" @scrollheight="scrollHeight = $event" @scrollwidth="scrollWidth = $event" @focus="isFocus = true" @blur="isFocus = false" :style="{'flex': multi ? '1' : undefined, 'line-height': lineHeight, 'font-size': fontSize + 'px', 'background': background, 'color': background ? '#FFF' : undefined, 'height': multi ? undefined : '30px', 'border-width': textBorder}">
|
|
6
6
|
<menulist v-if="menu">
|
|
7
7
|
<menulist-item>Custom</menulist-item>
|
|
8
8
|
</menulist>
|
|
File without changes
|
|
@@ -0,0 +1,79 @@
|
|
|
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.ntab = '';
|
|
17
|
+
this.lineValue = [100];
|
|
18
|
+
this.lineCount = 2;
|
|
19
|
+
this.sLeft1 = 0;
|
|
20
|
+
this.sTop1 = 0;
|
|
21
|
+
this.sWidth1 = 0;
|
|
22
|
+
this.sHeight1 = 0;
|
|
23
|
+
this.cWidth1 = 0;
|
|
24
|
+
this.cHeight1 = 0;
|
|
25
|
+
this.sLeft2 = 0;
|
|
26
|
+
this.sTop2 = 0;
|
|
27
|
+
this.sWidth2 = 0;
|
|
28
|
+
this.sHeight2 = 0;
|
|
29
|
+
this.cWidth2 = 0;
|
|
30
|
+
this.cHeight2 = 0;
|
|
31
|
+
this.sLeft3 = 0;
|
|
32
|
+
this.sTop3 = 0;
|
|
33
|
+
this.sWidth3 = 0;
|
|
34
|
+
this.sHeight3 = 0;
|
|
35
|
+
this.cWidth3 = 0;
|
|
36
|
+
this.cHeight3 = 0;
|
|
37
|
+
this.sLeft4 = 0;
|
|
38
|
+
this.sTop4 = 0;
|
|
39
|
+
this.sWidth4 = 0;
|
|
40
|
+
this.sHeight4 = 0;
|
|
41
|
+
this.cWidth4 = 0;
|
|
42
|
+
this.cHeight4 = 0;
|
|
43
|
+
this.direction = false;
|
|
44
|
+
this.dir5 = 'v';
|
|
45
|
+
this.sLeft5 = 0;
|
|
46
|
+
this.sTop5 = 0;
|
|
47
|
+
this.sWidth5 = 0;
|
|
48
|
+
this.sHeight5 = 0;
|
|
49
|
+
this.cWidth5 = 0;
|
|
50
|
+
this.cHeight5 = 0;
|
|
51
|
+
this.line5 = 10;
|
|
52
|
+
this.cWidth6 = 0;
|
|
53
|
+
this.is6 = {
|
|
54
|
+
'29': 50,
|
|
55
|
+
'39': 50
|
|
56
|
+
};
|
|
57
|
+
this.gesture = false;
|
|
58
|
+
this.style = false;
|
|
59
|
+
this.selection = false;
|
|
60
|
+
this.content = false;
|
|
61
|
+
this.area = {};
|
|
62
|
+
}
|
|
63
|
+
get is() {
|
|
64
|
+
const is = [];
|
|
65
|
+
for (let i = 0; i < this.lineCount; ++i) {
|
|
66
|
+
if (i > 0 && i % 10 === 0) {
|
|
67
|
+
is[i] = 30;
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return is;
|
|
72
|
+
}
|
|
73
|
+
onGesture(dir) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
yield clickgo.form.dialog('onGesture: ' + dir);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.default = default_1;
|
|
File without changes
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
<form title="
|
|
1
|
+
<form title="Vflow" width="450" height="450" min-width="300" min-height="400" padding="10">
|
|
2
2
|
<tab v-model="ntab" :tabs="['normal', 'adaptation', 'beyond', 'nest']" style="flex: 1; width: 0;">
|
|
3
3
|
<!-- 默认 -->
|
|
4
4
|
<layout v-if="ntab === 'normal'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
|
|
5
5
|
<!-- v -->
|
|
6
6
|
<layout gutter="10" style="flex: 1; height: 0;">
|
|
7
|
-
<
|
|
7
|
+
<vflow v-model:scroll-left="sLeft1" v-model:scroll-top="sTop1" @update:scrollTop="stst" direction="v" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" @select="area = $event" @clientwidth="cWidth1 = $event" @clientheight="cHeight1 = $event" @scrollwidth="sWidth1 = $event" @scrollheight="sHeight1 = $event" :style="{'line-height': style ? '1.5' : undefined, 'padding': style ? '10px' : undefined}" class="border" style="flex: 1; width: 0;" :data="lineCount" v-slot="data" :sizes="is">
|
|
8
8
|
<button v-if="data.index > 0 && data.index % 10 === 0" style="height: 30px;">test</button>
|
|
9
9
|
<block v-else>Line {{data.row}}, index: {{data.index}}<label v-if="content" class="content">ha</label>.</block>
|
|
10
|
-
</
|
|
10
|
+
</vflow>
|
|
11
11
|
<layout class="border" style="flex: 1; width: 0;">
|
|
12
|
-
<
|
|
12
|
+
<vflow v-model:scroll-left="sLeft2" v-model:scroll-top="sTop2" direction="v" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" @select="area = $event" @clientwidth="cWidth2 = $event" @clientheight="cHeight2 = $event" @scrollwidth="sWidth2 = $event" @scrollheight="sHeight2 = $event" :style="{'line-height': style ? '1.5' : undefined, 'padding': style ? '10px' : undefined}" style="flex: 1; width: 0;" :data="lineCount" v-slot="data" :sizes="is">
|
|
13
13
|
<block v-if="data.index > 0 && data.index % 10 === 0" class="custom">Custom</block>
|
|
14
14
|
<block v-else>Line {{data.row}}, index: {{data.index}}.</block>
|
|
15
|
-
</
|
|
16
|
-
<scroll :length="
|
|
15
|
+
</vflow>
|
|
16
|
+
<scroll :length="sHeight2" :client="cHeight2" v-model:offset="sTop2" style="width: 20px;"></scroll>
|
|
17
17
|
</layout>
|
|
18
18
|
</layout>
|
|
19
|
-
<label>Scroll Left: {{sLeft1}}
|
|
20
|
-
<label>Scroll Left: {{sLeft2}}
|
|
19
|
+
<label>Scroll Left / Top: {{sLeft1}} / {{sTop1}}, Client Width / Height: {{cWidth1}} / {{cHeight1}}, Scroll Width / Height: {{sWidth1}} / {{sHeight1}}.</label>
|
|
20
|
+
<label>Scroll Left / Top: {{sLeft2}} / {{sTop2}}, Client Width / Height: {{cWidth2}} / {{cHeight2}}, Scroll Width / Height: {{sWidth2}} / {{sHeight2}}.</label>
|
|
21
21
|
<!-- h -->
|
|
22
|
-
<
|
|
22
|
+
<vflow v-model:scroll-left="sLeft3" v-model:scroll-top="sTop3" :selection="selection" :gesture="gesture ? ['left', 'right'] : []" @gesture="onGesture" @select="area = $event" @clientwidth="cWidth3 = $event" @clientheight="cHeight3 = $event" @scrollwidth="sWidth3 = $event" @scrollheight="sHeight3 = $event" :style="{'line-height': style ? '1.5' : undefined, 'padding': style ? '10px' : undefined}" class="border" style="flex: 1; height: 0;" :data="lineCount" v-slot="data">
|
|
23
23
|
<layout align-v="center" align-h="center" direction="v" class="rightborder" style="width: 80px;">
|
|
24
24
|
<label>Col {{data.row}}.</label>
|
|
25
25
|
<label>index: {{data.index}}.</label>
|
|
26
26
|
</layout>
|
|
27
|
-
</
|
|
28
|
-
<label>Scroll Left: {{sLeft3}}
|
|
27
|
+
</vflow>
|
|
28
|
+
<label>Scroll Left / Top: {{sLeft3}} / {{sTop3}}, Client Width / Height: {{cWidth3}} / {{cHeight3}}, Scroll Width / Height: {{sWidth3}} / {{sHeight3}}.</label>
|
|
29
29
|
<label>Selection area: {{area}}</label>
|
|
30
30
|
<!-- button list -->
|
|
31
31
|
<layout gutter="10">
|
|
32
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>
|
|
33
|
+
<button @click="lineCount += lineValue[0]" style="height: 30px; padding: 0 10px;">Add lines</button>
|
|
34
|
+
<button @click="lineCount -= lineValue[0];if(lineCount < 0) {lineCount = 0;}" style="height: 30px; padding: 0 10px;">Remove lines</button>
|
|
35
35
|
</layout>
|
|
36
36
|
<layout gutter="10">
|
|
37
37
|
<button @click="gesture = !gesture" style="flex: 1; width: 0; height: 30px;">{{gesture ? '' : '!'}}gesture</button>
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
<!-- 自适应 -->
|
|
44
44
|
<layout v-else-if="ntab === 'adaptation'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
|
|
45
45
|
<layout :direction="direction ? 'h' : 'v'" style="flex: 1; height: 0;">
|
|
46
|
-
<
|
|
46
|
+
<vflow class="border" v-model:scroll-left="sLeft4" v-model:scroll-top="sTop4" :selection="selection" :gesture="gesture ? (direction ? ['left', 'right'] : ['top', 'bottom']) : []" @gesture="onGesture" :direction="direction ? 'h' : 'v'" @clientwidth="cWidth4 = $event" @clientheight="cHeight4 = $event" @scrollwidth="sWidth4 = $event" @scrollheight="sHeight4 = $event" :data="lineCount" v-slot="data" :sizes="is">
|
|
47
47
|
<layout align-v="center" direction="v" :class="[direction && 'rightborder']" style="flex: 1;">
|
|
48
48
|
<button v-if="data.index > 0 && data.index % 10 === 0" style="height: 30px;" :style="{'width': direction ? '30px' : undefined}">btn</button>
|
|
49
49
|
<block v-else :style="{'width': direction ? '80px' : undefined, 'text-align': direction ? 'center' : undefined}">Line {{data.row}}</block>
|
|
50
50
|
</layout>
|
|
51
|
-
</
|
|
51
|
+
</vflow>
|
|
52
52
|
</layout>
|
|
53
|
-
<label>Scroll Left: {{sLeft4}}
|
|
53
|
+
<label>Scroll Left / Top: {{sLeft4}} / {{sTop4}}, Client Width / Height: {{cWidth4}} / {{cHeight4}}, Scroll Width / Height: {{sWidth4}} / {{sHeight4}}.</label>
|
|
54
54
|
<layout gutter="10">
|
|
55
55
|
<button @click="lineCount += 10" style="flex: 1; width: 0; height: 30px;">Add 10 lines</button>
|
|
56
56
|
<button @click="lineCount -= 10;if(lineCount < 0) {lineCount = 0;}" style="flex: 1; width: 0; height: 30px;">Remove 10 lines</button>
|
|
@@ -64,26 +64,26 @@
|
|
|
64
64
|
<button @click="line5 = (line5 === 10 ? 1 : 10)" style="flex: 1; width: 0; height: 30px;">Change data</button>
|
|
65
65
|
<label>Direction: {{dir5}}</label>
|
|
66
66
|
</layout>
|
|
67
|
-
<
|
|
67
|
+
<vflow v-model:scroll-left="sLeft5" v-model:scroll-top="sTop5" :selection="selection" :gesture="gesture ? ['left', 'right', 'top', 'bottom'] : []" @gesture="onGesture" :direction="dir5" @clientwidth="cWidth5 = $event" @clientheight="cHeight5 = $event" @scrollwidth="sWidth5 = $event" @scrollheight="sHeight5 = $event" class="border" style="flex: 1; height: 0; padding: 10px 0 0 10px;" :data="line5" v-slot="data">
|
|
68
68
|
<layout :direction="dir5 === 'h' ? 'v' : 'h'">
|
|
69
69
|
<layout v-for="j of 10" class="block">
|
|
70
70
|
<block>{{data.row}}-{{j}}</block>
|
|
71
71
|
</layout>
|
|
72
72
|
</layout>
|
|
73
|
-
</
|
|
74
|
-
<label>Scroll Left: {{sLeft5}}
|
|
73
|
+
</vflow>
|
|
74
|
+
<label>Scroll Left / Top: {{sLeft5}} / {{sTop5}}, Client Width / Height: {{cWidth5}} / {{cHeight5}}, Scroll Width / Height: {{sWidth5}} / {{sHeight5}}.</label>
|
|
75
75
|
</layout>
|
|
76
76
|
<!-- 嵌套 -->
|
|
77
77
|
<layout v-else style="flex: 1; width: 0; padding: 10px;">
|
|
78
|
-
<
|
|
79
|
-
<
|
|
78
|
+
<vflow class="border" direction="v" style="flex: 1; width: 0;" :data="100" @clientwidth="cWidth6 = $event" v-slot="data" :sizes="is6">
|
|
79
|
+
<vflow v-if="data.row === 30" :data="50" v-slot="data" class="border" direction="v" style="height: 50px;">
|
|
80
80
|
<label>Line {{data.row}}</label>
|
|
81
|
-
</
|
|
82
|
-
<
|
|
81
|
+
</vflow>
|
|
82
|
+
<vflow v-else-if="data.row === 40" :data="50" v-slot="data" class="border" style="height: 50px;" :style="{'width': cWidth6 + 'px'}">
|
|
83
83
|
<label class="rightborder" style="width: 80px;">Line {{data.row}}</label>
|
|
84
|
-
</
|
|
84
|
+
</vflow>
|
|
85
85
|
<label v-else>Line {{data.row}}</label>
|
|
86
|
-
</
|
|
86
|
+
</vflow>
|
|
87
87
|
</layout>
|
|
88
88
|
</tab>
|
|
89
89
|
</form>
|