clickgo 3.1.2-dev11 → 3.1.4-dev13

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.
Files changed (110) hide show
  1. package/README.md +1 -1
  2. package/dist/app/demo/app.js +0 -73
  3. package/dist/app/demo/config.json +113 -0
  4. package/dist/app/demo/form/control/button/button.js +12 -11
  5. package/dist/app/demo/form/control/button/button.xml +6 -6
  6. package/dist/app/demo/form/control/check/check.js +14 -10
  7. package/dist/app/demo/form/control/file/file.js +15 -13
  8. package/dist/app/demo/form/control/{overflow/overflow.css → flow/flow.css} +0 -0
  9. package/dist/app/demo/form/control/flow/flow.js +64 -0
  10. package/dist/app/demo/form/control/{overflow/overflow.scss → flow/flow.scss} +0 -0
  11. package/dist/app/demo/form/control/flow/flow.xml +101 -0
  12. package/dist/app/demo/form/control/form/form.js +1 -1
  13. package/dist/app/demo/form/control/form/form.xml +3 -3
  14. package/dist/app/demo/form/control/img/img.xml +2 -2
  15. package/dist/app/demo/form/control/list/list.js +95 -75
  16. package/dist/app/demo/form/control/list/list.xml +15 -11
  17. package/dist/app/demo/form/control/marquee/marquee.js +12 -10
  18. package/dist/app/demo/form/control/menu/menu.js +10 -6
  19. package/dist/app/demo/form/control/monaco/monaco.js +50 -60
  20. package/dist/app/demo/form/control/monaco/monaco.xml +6 -5
  21. package/dist/app/demo/form/control/property/property.js +131 -127
  22. package/dist/app/demo/form/control/radio/radio.js +9 -5
  23. package/dist/app/demo/form/control/scroll/scroll.js +16 -12
  24. package/dist/app/demo/form/control/scroll/scroll.xml +10 -10
  25. package/dist/app/demo/form/control/select/select.js +132 -71
  26. package/dist/app/demo/form/control/select/select.xml +69 -67
  27. package/dist/app/demo/form/control/tab/tab.js +21 -20
  28. package/dist/app/demo/form/control/tab/tab.xml +2 -2
  29. package/dist/app/demo/form/control/text/text.js +53 -45
  30. package/dist/app/demo/form/control/text/text.xml +3 -3
  31. package/dist/app/demo/form/control/{greatview/greatview.css → vflow/vflow.css} +0 -0
  32. package/dist/app/demo/form/control/vflow/vflow.js +79 -0
  33. package/dist/app/demo/form/control/{greatview/greatview.scss → vflow/vflow.scss} +0 -0
  34. package/dist/app/demo/form/control/{greatview/greatview.xml → vflow/vflow.xml} +25 -25
  35. package/dist/app/demo/form/event/form/form.js +58 -56
  36. package/dist/app/demo/form/event/form/form.xml +3 -3
  37. package/dist/app/demo/form/event/other/other.js +29 -0
  38. package/dist/app/demo/form/event/other/other.xml +5 -0
  39. package/dist/app/demo/form/event/screen/screen.js +30 -28
  40. package/dist/app/demo/form/event/screen/screen.xml +2 -2
  41. package/dist/app/demo/form/event/task/task.js +31 -31
  42. package/dist/app/demo/form/event/task/task.xml +3 -3
  43. package/dist/app/demo/form/main.js +166 -5
  44. package/dist/app/demo/form/main.xml +37 -35
  45. package/dist/app/demo/form/method/aform/aform.js +2 -1
  46. package/dist/app/demo/form/method/aform/aform.xml +3 -2
  47. package/dist/app/demo/form/method/aform/sd.js +28 -0
  48. package/dist/app/demo/form/method/aform/sd.xml +7 -0
  49. package/dist/app/demo/form/method/aform/test.xml +4 -5
  50. package/dist/app/demo/form/method/core/core.js +23 -8
  51. package/dist/app/demo/form/method/core/core.xml +6 -1
  52. package/dist/app/demo/form/method/dom/dom.js +91 -99
  53. package/dist/app/demo/form/method/dom/dom.xml +6 -7
  54. package/dist/app/demo/form/method/form/form.js +8 -8
  55. package/dist/app/demo/form/method/form/form.xml +4 -4
  56. package/dist/app/demo/form/method/fs/fs.js +34 -33
  57. package/dist/app/demo/form/method/fs/fs.xml +1 -1
  58. package/dist/app/demo/form/method/fs/text.js +12 -12
  59. package/dist/app/demo/form/method/native/native.js +50 -0
  60. package/dist/app/demo/form/method/native/native.xml +12 -0
  61. package/dist/app/demo/form/method/system/system.js +50 -0
  62. package/dist/app/demo/form/method/system/system.xml +11 -0
  63. package/dist/app/demo/form/method/task/task.js +68 -62
  64. package/dist/app/demo/form/method/task/task.xml +5 -6
  65. package/dist/app/demo/form/method/theme/theme.js +14 -14
  66. package/dist/app/demo/form/method/tool/tool.js +29 -28
  67. package/dist/app/demo/form/method/tool/tool.xml +3 -3
  68. package/dist/app/demo/form/method/zip/zip.js +46 -41
  69. package/dist/app/demo/form/method/zip/zip.xml +1 -1
  70. package/dist/app/task/app.js +0 -25
  71. package/dist/app/task/config.json +29 -0
  72. package/dist/app/task/form/bar/bar.js +1 -1
  73. package/dist/app/task/form/bar/bar.xml +1 -1
  74. package/dist/clickgo.js +1 -1
  75. package/dist/clickgo.ts +1 -1
  76. package/dist/control/common.cgc +0 -0
  77. package/dist/control/form.cgc +0 -0
  78. package/dist/control/monaco.cgc +0 -0
  79. package/dist/control/property.cgc +0 -0
  80. package/dist/control/task.cgc +0 -0
  81. package/dist/global.css +1 -1
  82. package/dist/index.js +6 -3
  83. package/dist/index.ts +9 -3
  84. package/dist/lib/control.js +70 -104
  85. package/dist/lib/control.ts +97 -123
  86. package/dist/lib/core.js +163 -253
  87. package/dist/lib/core.ts +185 -268
  88. package/dist/lib/dom.js +565 -484
  89. package/dist/lib/dom.ts +704 -547
  90. package/dist/lib/form.js +211 -159
  91. package/dist/lib/form.ts +196 -121
  92. package/dist/lib/fs.js +107 -12
  93. package/dist/lib/fs.ts +111 -20
  94. package/dist/lib/native.js +142 -8
  95. package/dist/lib/native.ts +181 -11
  96. package/dist/lib/task.js +526 -164
  97. package/dist/lib/task.ts +598 -179
  98. package/dist/lib/tool.js +48 -1
  99. package/dist/lib/tool.ts +61 -0
  100. package/dist/lib/zip.ts +2 -0
  101. package/dist/theme/familiar.cgt +0 -0
  102. package/package.json +2 -2
  103. package/types/index.d.ts +83 -39
  104. package/dist/app/demo/form/control/greatview/greatview.js +0 -92
  105. package/dist/app/demo/form/control/overflow/overflow.js +0 -70
  106. package/dist/app/demo/form/control/overflow/overflow.xml +0 -98
  107. package/dist/app/demo/form/control/view/view.css +0 -1
  108. package/dist/app/demo/form/control/view/view.js +0 -73
  109. package/dist/app/demo/form/control/view/view.scss +0 -18
  110. 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
- <tab v-model="ntab" :tabs="['greatselect', 'select']" style="flex: 1; width: 0;">
3
- <!-- greatselect -->
4
- <layout v-if="ntab === 'greatselect'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
5
- <label>Now select value is {{select}}:</label>
6
- <greatselect v-model="select" :data="slist" :area="area" :disabled="disabled" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}">
7
- <layout align-v="center" gutter="5" style="line-height: 1.3; flex: 1;">
8
- <img :src="slist[select].src" style="width: 32px; height: 32px;"></img>
9
- <block>
10
- <block>{{slist[select].name}}</block>
11
- <block style="opacity: .7;">{{slist[select].path}}</block>
12
- </block>
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-else>Other</template>
23
- </template>
24
- <template v-slot:itempop>
25
- <menulist>
26
- <menulist-item alt="S">Set the default</menulist-item>
27
- </menulist>
28
- </template>
29
- </greatselect>
30
- <label>Custom pop:</label>
31
- <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}">
32
- <label>Pop is button.</label>
33
- <template v-slot:pop>
34
- <button style="height: 30px;">Nothing</button>
35
- </template>
36
- </greatselect>
37
- <layout gutter="10">
38
- <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>
39
- <button @click="slist.splice(-3, 1)" style="flex: 1; height: 30px;">Remove item</button>
40
- </layout>
41
- <layout gutter="10">
42
- <button @click="disabled = !disabled" style="flex: 1; height: 30px;">Disabled: {{disabled}}</button>
43
- <button @click="area = area === 'all' ? 'arrow' : 'all'" style="flex: 1; height: 30px;">Area: {{area}}</button>
44
- </layout>
45
- <layout gutter="10">
46
- <button @click="fontSize = !fontSize" style="flex: 1; height: 30px;">Change font size</button>
47
- <button @click="padding = !padding" style="flex: 1; height: 30px;">Change padding</button>
48
- </layout>
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
- <!-- select -->
54
- <layout v-else-if="ntab === 'select'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
55
- <label>Now select value is {{select2}}:</label>
56
- <select v-model="select2" :data="slist2" :disabled="disabled" :editable="editable" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
57
- <label>Custom height:</label>
58
- <select :data="['1','2','3','4','5']" :disabled="disabled" :editable="editable" style="height: 60px;" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
59
- <label>Always editable:</label>
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 &amp; color</button>
73
+ <button @click="multi = !multi" style="flex: 1; height: 30px;">{{multi ? '' : '!'}}multi</button>
72
74
  </layout>
73
- </tab>
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
- exports.data = {
15
- 'ntab': '',
16
- 'tabs': ['tab1'],
17
- 'tindex': 1,
18
- 'tabPosition': 'top',
19
- 'color': undefined,
20
- 'size': undefined,
21
- 'drag': false,
22
- 'close': false
23
- };
24
- exports.methods = {
25
- onClose: function (e, i) {
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: function () {
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: function () {
54
+ }
55
+ remove() {
56
56
  if (this.tabs.length > 0) {
57
57
  this.tabs.splice(this.tabs.length - 1);
58
58
  }
59
- },
60
- position: function () {
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="close" @close="onClose" style="margin-top: 10px; flex: 1; height: 0;" :style="{'font-size': size, 'color': color}">
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="close = !close" style="padding: 0 10px; flex: 1; width: 0; height: 30px;">{{close ? '' : '!'}}close</button>
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
- exports.data = {
6
- 'value': '',
7
- 'selectionStart': 0,
8
- 'selectionEnd': 0,
9
- 'multi': false,
10
- 'disabled': false,
11
- 'readonly': false,
12
- 'long': false,
13
- 'password': false,
14
- 'wrap': true,
15
- 'menu': false,
16
- 'gesture': false,
17
- 'lineHeight': 1,
18
- 'fontSize': 12,
19
- 'border': 'solid',
20
- 'background': undefined,
21
- 'scrollLeft': 0,
22
- 'scrollTop': 0,
23
- 'length': 0,
24
- 'clientHeight': 0,
25
- 'clientWidth': 0
26
- };
27
- exports.methods = {
28
- longClick: function () {
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
- scrollborder: function (e) {
34
- if (!this.gesture) {
35
- return;
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}}, Length: {{length}}, Client Height: {{clientHeight}}, Client Width: {{clientWidth}}</label>
5
- <text v-model="value" :multi="multi" :disabled="disabled" :readonly="readonly" :password="password" :wrap="wrap" :border="border" v-model:scroll-left="scrollLeft" v-model:scroll-top="scrollTop" v-model:selection-start="selectionStart" v-model:selection-end="selectionEnd" @resize="clientHeight = $event" @resizen="clientWidth = $event" @change="length = $event" @scrollborder="scrollborder" :style="{'flex': multi ? '1' : undefined, 'line-height': lineHeight, 'font-size': fontSize + 'px', 'background': background, 'color': background ? '#FFF' : undefined, 'height': multi ? undefined : '30px'}">
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>
@@ -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;
@@ -1,37 +1,37 @@
1
- <form title="Greatview" width="450" height="450" min-width="300" min-height="400" padding="10">
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
- <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>
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
- </greatview>
10
+ </vflow>
11
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>
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
- </greatview>
16
- <scroll :length="l2" :client="c2" v-model:scroll-offset="sTop2" style="width: 20px;"></scroll>
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}}, Scroll Top: {{sTop1}}, Length: {{l1}}, Client: {{c1}}.</label>
20
- <label>Scroll Left: {{sLeft2}}, Scroll Top: {{sTop2}}, Length: {{l2}}, Client: {{c2}}.</label>
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
- <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>
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
- </greatview>
28
- <label>Scroll Left: {{sLeft3}}, Scroll Top: {{sTop3}}, Length: {{l3}}, Client: {{c3}}.</label>
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
- <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>
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
- </greatview>
51
+ </vflow>
52
52
  </layout>
53
- <label>Scroll Left: {{sLeft4}}, Scroll Top: {{sTop4}}, Length: {{l4}}, Client: {{c4}}.</label>
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
- <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>
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
- </greatview>
74
- <label>Scroll Left: {{sLeft5}}, Scroll Top: {{sTop5}}, Length: {{l5}}, Client: {{c5}}.</label>
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
- <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>
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
- </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>
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
- </greatview>
84
+ </vflow>
85
85
  <label v-else>Line {{data.row}}</label>
86
- </greatview>
86
+ </vflow>
87
87
  </layout>
88
88
  </tab>
89
89
  </form>