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.
Files changed (145) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +75 -0
  3. package/dist/app/demo/config.json +106 -0
  4. package/dist/app/demo/form/control/block/block.css +1 -0
  5. package/dist/app/demo/form/control/block/block.scss +17 -0
  6. package/dist/app/demo/form/control/block/block.xml +7 -0
  7. package/dist/app/demo/form/control/button/button.css +1 -0
  8. package/dist/app/demo/form/control/button/button.js +27 -0
  9. package/dist/app/demo/form/control/button/button.scss +18 -0
  10. package/dist/app/demo/form/control/button/button.xml +126 -0
  11. package/dist/app/demo/form/control/check/check.js +12 -0
  12. package/dist/app/demo/form/control/check/check.xml +13 -0
  13. package/dist/app/demo/form/control/dialog/dialog.js +8 -0
  14. package/dist/app/demo/form/control/dialog/dialog.xml +26 -0
  15. package/dist/app/demo/form/control/file/file.js +23 -0
  16. package/dist/app/demo/form/control/file/file.xml +25 -0
  17. package/dist/app/demo/form/control/form/form.css +1 -0
  18. package/dist/app/demo/form/control/form/form.js +38 -0
  19. package/dist/app/demo/form/control/form/form.scss +9 -0
  20. package/dist/app/demo/form/control/form/form.xml +28 -0
  21. package/dist/app/demo/form/control/greatview/greatview.css +1 -0
  22. package/dist/app/demo/form/control/greatview/greatview.js +92 -0
  23. package/dist/app/demo/form/control/greatview/greatview.scss +22 -0
  24. package/dist/app/demo/form/control/greatview/greatview.xml +89 -0
  25. package/dist/app/demo/form/control/img/img.xml +16 -0
  26. package/dist/app/demo/form/control/label/label.xml +11 -0
  27. package/dist/app/demo/form/control/list/list.css +1 -0
  28. package/dist/app/demo/form/control/list/list.js +194 -0
  29. package/dist/app/demo/form/control/list/list.scss +7 -0
  30. package/dist/app/demo/form/control/list/list.xml +91 -0
  31. package/dist/app/demo/form/control/loading/loading.xml +8 -0
  32. package/dist/app/demo/form/control/marquee/marquee.js +30 -0
  33. package/dist/app/demo/form/control/marquee/marquee.xml +36 -0
  34. package/dist/app/demo/form/control/menu/menu.js +8 -0
  35. package/dist/app/demo/form/control/menu/menu.xml +122 -0
  36. package/dist/app/demo/form/control/monaco/monaco.js +113 -0
  37. package/dist/app/demo/form/control/monaco/monaco.xml +27 -0
  38. package/dist/app/demo/form/control/overflow/overflow.css +1 -0
  39. package/dist/app/demo/form/control/overflow/overflow.js +70 -0
  40. package/dist/app/demo/form/control/overflow/overflow.scss +18 -0
  41. package/dist/app/demo/form/control/overflow/overflow.xml +98 -0
  42. package/dist/app/demo/form/control/property/property.js +129 -0
  43. package/dist/app/demo/form/control/property/property.xml +6 -0
  44. package/dist/app/demo/form/control/radio/radio.js +7 -0
  45. package/dist/app/demo/form/control/radio/radio.xml +12 -0
  46. package/dist/app/demo/form/control/scroll/scroll.js +14 -0
  47. package/dist/app/demo/form/control/scroll/scroll.xml +35 -0
  48. package/dist/app/demo/form/control/select/select.js +91 -0
  49. package/dist/app/demo/form/control/select/select.xml +74 -0
  50. package/dist/app/demo/form/control/tab/tab.js +75 -0
  51. package/dist/app/demo/form/control/tab/tab.xml +22 -0
  52. package/dist/app/demo/form/control/text/text.js +53 -0
  53. package/dist/app/demo/form/control/text/text.xml +37 -0
  54. package/dist/app/demo/form/control/view/view.css +1 -0
  55. package/dist/app/demo/form/control/view/view.js +73 -0
  56. package/dist/app/demo/form/control/view/view.scss +18 -0
  57. package/dist/app/demo/form/control/view/view.xml +94 -0
  58. package/dist/app/demo/form/event/form/form.css +1 -0
  59. package/dist/app/demo/form/event/form/form.js +129 -0
  60. package/dist/app/demo/form/event/form/form.scss +24 -0
  61. package/dist/app/demo/form/event/form/form.xml +16 -0
  62. package/dist/app/demo/form/event/screen/screen.js +51 -0
  63. package/dist/app/demo/form/event/screen/screen.xml +9 -0
  64. package/dist/app/demo/form/event/task/task.js +78 -0
  65. package/dist/app/demo/form/event/task/task.xml +20 -0
  66. package/dist/app/demo/form/main.css +1 -0
  67. package/dist/app/demo/form/main.js +25 -0
  68. package/dist/app/demo/form/main.scss +9 -0
  69. package/dist/app/demo/form/main.xml +49 -0
  70. package/dist/app/demo/form/method/core/core.js +25 -0
  71. package/dist/app/demo/form/method/core/core.xml +7 -0
  72. package/dist/app/demo/form/method/dom/dom.css +1 -0
  73. package/dist/app/demo/form/method/dom/dom.js +163 -0
  74. package/dist/app/demo/form/method/dom/dom.scss +10 -0
  75. package/dist/app/demo/form/method/dom/dom.xml +55 -0
  76. package/dist/app/demo/form/method/form/form.css +1 -0
  77. package/dist/app/demo/form/method/form/form.js +217 -0
  78. package/dist/app/demo/form/method/form/form.scss +3 -0
  79. package/dist/app/demo/form/method/form/form.xml +56 -0
  80. package/dist/app/demo/form/method/form/test.xml +5 -0
  81. package/dist/app/demo/form/method/fs/fs.js +88 -0
  82. package/dist/app/demo/form/method/fs/fs.xml +8 -0
  83. package/dist/app/demo/form/method/fs/text.js +15 -0
  84. package/dist/app/demo/form/method/fs/text.xml +3 -0
  85. package/dist/app/demo/form/method/task/locale1.json +3 -0
  86. package/dist/app/demo/form/method/task/locale2.json +3 -0
  87. package/dist/app/demo/form/method/task/task.js +153 -0
  88. package/dist/app/demo/form/method/task/task.xml +57 -0
  89. package/dist/app/demo/form/method/theme/theme.js +74 -0
  90. package/dist/app/demo/form/method/theme/theme.xml +9 -0
  91. package/dist/app/demo/form/method/tool/tool.js +64 -0
  92. package/dist/app/demo/form/method/tool/tool.xml +26 -0
  93. package/dist/app/demo/form/method/zip/zip.js +99 -0
  94. package/dist/app/demo/form/method/zip/zip.xml +12 -0
  95. package/dist/app/demo/global.css +3 -0
  96. package/dist/app/demo/res/icon.svg +1 -0
  97. package/dist/app/demo/res/img.jpg +0 -0
  98. package/dist/app/demo/res/r-1.svg +1 -0
  99. package/dist/app/demo/res/r-2.svg +1 -0
  100. package/dist/app/demo/res/sql.svg +1 -0
  101. package/dist/app/demo/res/txt.svg +1 -0
  102. package/dist/app/demo/res/zip.svg +1 -0
  103. package/dist/app/task/config.json +29 -0
  104. package/dist/app/task/form/bar/bar.js +299 -0
  105. package/dist/app/task/form/bar/bar.xml +47 -0
  106. package/dist/app/task/form/desktop/desktop.xml +1 -0
  107. package/dist/app/task/locale/en.json +11 -0
  108. package/dist/app/task/locale/ja.json +11 -0
  109. package/dist/app/task/locale/sc.json +11 -0
  110. package/dist/app/task/locale/tc.json +11 -0
  111. package/dist/clickgo.js +41 -0
  112. package/dist/clickgo.ts +51 -0
  113. package/dist/control/common.cgc +0 -0
  114. package/dist/control/form.cgc +0 -0
  115. package/dist/control/monaco.cgc +0 -0
  116. package/dist/control/property.cgc +0 -0
  117. package/dist/control/task.cgc +0 -0
  118. package/dist/global.css +1 -0
  119. package/dist/icon.png +0 -0
  120. package/dist/index.js +88 -0
  121. package/dist/index.ts +92 -0
  122. package/dist/lib/control.js +365 -0
  123. package/dist/lib/control.ts +428 -0
  124. package/dist/lib/core.js +668 -0
  125. package/dist/lib/core.ts +732 -0
  126. package/dist/lib/dom.js +1471 -0
  127. package/dist/lib/dom.ts +1785 -0
  128. package/dist/lib/form.js +2101 -0
  129. package/dist/lib/form.ts +2496 -0
  130. package/dist/lib/fs.js +849 -0
  131. package/dist/lib/fs.ts +995 -0
  132. package/dist/lib/native.js +138 -0
  133. package/dist/lib/native.ts +219 -0
  134. package/dist/lib/task.js +686 -0
  135. package/dist/lib/task.ts +842 -0
  136. package/dist/lib/theme.js +159 -0
  137. package/dist/lib/theme.ts +196 -0
  138. package/dist/lib/tool.js +501 -0
  139. package/dist/lib/tool.ts +620 -0
  140. package/dist/lib/zip.js +352 -0
  141. package/dist/lib/zip.ts +434 -0
  142. package/dist/theme/familiar.cgt +0 -0
  143. package/package.json +27 -0
  144. package/types/dev.d.ts +30 -0
  145. package/types/index.d.ts +673 -0
@@ -0,0 +1,91 @@
1
+ <form title="List" width="400" height="450" min-width="300" min-height="400" padding="10" direction="v">
2
+ <label>Greatlist: {{select}}, list: {{select2}}, label: {{label2}}</label>
3
+ <tab v-model="ntab" :tabs="['greatlist', 'adaptation', 'list', 'async']" style="flex: 1; height: 0;">
4
+ <!-- 默认 -->
5
+ <layout v-if="ntab === 'greatlist'" direction="v" style="flex: 1; width: 0; padding: 10px;">
6
+ <greatlist v-model="select" :data="slist" :disabled="disabled" :must="must" :multi="multi" :selection="selection" :scroll="scroll" @select="onSelect" style="line-height: 1.3; flex: 1; height: 0;">
7
+ <template v-slot="data">
8
+ <layout v-if="data.row.type === 0" align-v="center" gutter="5" style="flex: 1;">
9
+ <img :src="data.row.src" style="width: 32px; height: 32px;"></img>
10
+ <block style="flex: 1;">
11
+ <block>{{data.row.name}}</block>
12
+ <block style="opacity: .7;">{{data.row.path}}</block>
13
+ </block>
14
+ </layout>
15
+ <template v-else>Other</template>
16
+ </template>
17
+ <template v-slot:pop>
18
+ <menulist>
19
+ <menulist-item alt="I" @click="showIndex">Show index</menulist-item>
20
+ <menulist-item alt="S" @click="showType">Show type</menulist-item>
21
+ </menulist>
22
+ </template>
23
+ <template v-slot:itempop>
24
+ <menulist>
25
+ <menulist-item alt="S">Set the default</menulist-item>
26
+ </menulist>
27
+ </template>
28
+ </greatlist>
29
+ <label class="tip">Right-click (computer) or press and hold (phone) to open the universal menu.</label>
30
+ <label class="tip">Area: {{selectionArea}}</label>
31
+ </layout>
32
+ <!-- 自适应 -->
33
+ <layout v-else-if="ntab === 'adaptation'" direction="v" style="flex: 1; width: 0; padding: 10px;">
34
+ <greatlist class="adaptation" :data="adData" v-model="select" :disabled="disabled" :must="must" :multi="multi" :selection="selection" :scroll="scroll" same>
35
+ <template v-slot="data">type: {{data.row.type}}, index: {{data.index}}. {{(data.index === 20) ? 'long test long test long test long test long test' : ''}}</template>
36
+ <template v-slot:itempop>
37
+ <menulist>
38
+ <menulist-item alt="N">None</menulist-item>
39
+ </menulist>
40
+ </template>
41
+ </greatlist>
42
+ </layout>
43
+ <!-- list -->
44
+ <layout v-else-if="ntab === 'list'" direction="v" gutter="10" style="flex: 1; width: 0; padding: 10px;">
45
+ <label>Raw data:</label>
46
+ <view direction="v" style="border: solid 1px #b3b3b3; line-height: 1.5; height: 50px; padding: 5px;">{{listData}}</view>
47
+ <layout gutter="10" style="flex: 1; height: 0;">
48
+ <list v-model="select2" :disabled="disabled" :must="must" :multi="multi" :selection="selection" :scroll="scroll" :data="listData" @label="label2 = $event" style="flex: 2; width: 0;" :tree="tree" :async="async" :icon="icon" icon-default="../../../res/txt.svg" @load="onSelectLoad">
49
+ <menulist>
50
+ <menulist-item alt="I" @click="showIndex2">Show select</menulist-item>
51
+ </menulist>
52
+ </list>
53
+ <list :disabled="disabled" :must="must" :multi="multi" :selection="selection" :scroll="scroll" :data="listData2" style="flex: 1; width: 0;"></list>
54
+ </layout>
55
+ <label class="tip">Right-click (computer) or press and hold (phone) to open the universal menu.</label>
56
+ </layout>
57
+ <!-- async -->
58
+ <layout v-else gutter="10" style="flex: 1; width: 0; padding: 10px;">
59
+ <layout direction="v" gutter="10" style="flex: 1; width: 0;">
60
+ <label>greatlist: {{select3}}</label>
61
+ <greatlist v-model="select3" :disabled="disabled" :must="must" :multi="multi" :selection="selection" :scroll="scroll" :data="listData3" v-slot="data" style="flex: 1; height: 0;" same>
62
+ {{data.row.value ? data.row.value : data.row}}
63
+ </greatlist>
64
+ <button v-if="listData3.length === 0" @click="listData3 = [{'value': 'A', disabled: true}, 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'];select3 = 12" style="height: 30px;">Load data</button>
65
+ </layout>
66
+ <layout direction="v" gutter="10" style="flex: 1; width: 0;">
67
+ <label>list: {{select4}}</label>
68
+ <list v-model="select4" :disabled="disabled" :must="must" :multi="multi" :selection="selection" :scroll="scroll" :data="listData4" style="flex: 1; height: 0;"></list>
69
+ <button v-if="listData4.length === 0" @click="listData4 = [{'value': 'A', disabled: true}, 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'];select4 = 'M'" style="height: 30px;">Load data</button>
70
+ </layout>
71
+ </layout>
72
+ </tab>
73
+ <layout class="ctr" gutter="10" v-show="ntab !== 'async'">
74
+ <button @click="slist.splice(-2, 0, {'type': 0, 'name': 'Card' + slist.length, 'path': 'Bob >> folder >> Card', 'src': '/package/res/r-2.svg','disabled': false})">Add</button>
75
+ <button @click="slist.splice(-3, 1)">Remove</button>
76
+ <button @click="scrollChange">Scroll {{scroll}}</button>
77
+ <button @click="icon = !icon" v-show="ntab === 'list'">{{icon ? '' : '!'}}icon</button>
78
+ </layout>
79
+ <layout class="ctr" gutter="10" v-show="ntab !== 'async'">
80
+ <button @click="selectButton">Select {{ntab === 'list' ? 'item1' : 'item2'}}</button>
81
+ <button @click="selectButtonList" v-show="ntab === 'list'">Select Sub3</button>
82
+ <button @click="tree = !tree" v-show="ntab === 'list'">{{tree ? '' : '!'}}tree</button>
83
+ <button @click="async = !async" v-show="ntab === 'list'">{{async ? '' : '!'}}async</button>
84
+ </layout>
85
+ <layout class="ctr" gutter="10">
86
+ <button @click="disabled = !disabled">{{disabled ? '' : '!'}}disabled</button>
87
+ <button @click="must = !must">{{must ? '' : '!'}}must</button>
88
+ <button @click="multi = !multi">{{multi ? '' : '!'}}multi</button>
89
+ <button @click="selection = !selection">{{selection ? '' : '!'}}selection</button>
90
+ </layout>
91
+ </form>
@@ -0,0 +1,8 @@
1
+ <form width="300" height="300" title="Loading" padding="10">
2
+ <layout direction="v" gutter="10">
3
+ <loading style="width: 50px; height: 50px;"></loading>
4
+ <loading style="width: 40px; height: 40px;"></loading>
5
+ <loading style="width: 30px; height: 30px;"></loading>
6
+ <loading></loading>
7
+ </layout>
8
+ </form>
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.methods = exports.data = void 0;
4
+ exports.data = {
5
+ 'lineCount': 2,
6
+ 'style': false,
7
+ 'direction': 'top',
8
+ 'scroll': false
9
+ };
10
+ exports.methods = {
11
+ changeDirection: function () {
12
+ switch (this.direction) {
13
+ case 'top': {
14
+ this.direction = 'bottom';
15
+ break;
16
+ }
17
+ case 'bottom': {
18
+ this.direction = 'left';
19
+ break;
20
+ }
21
+ case 'left': {
22
+ this.direction = 'right';
23
+ break;
24
+ }
25
+ default: {
26
+ this.direction = 'top';
27
+ }
28
+ }
29
+ }
30
+ };
@@ -0,0 +1,36 @@
1
+ <form title="Marquee" width="300" height="500" padding="10">
2
+ <layout gutter="10" direction="v" style="flex: 1; width: 0;">
3
+ <!-- 左右分 -->
4
+ <layout gutter="10" style="flex: 1; height: 0;">
5
+ <layout direction="v" style="flex: 1; width: 0;">
6
+ <marquee direction="top" :scroll="scroll" style="border: 1px solid rgba(0, 0, 0, .1); background: #FFF;" :style="{'padding': style ? '10px' : undefined, 'line-height': style ? '1.5' : undefined}">
7
+ <block v-for="(line, index) of lineCount">
8
+ <button v-if="index > 0 && index % 10 === 0" style="height: 30px;">test</button>
9
+ <block v-else>Line {{line}}, index: {{index}}.</block>
10
+ </block>
11
+ </marquee>
12
+ </layout>
13
+ <layout direction="v" gutter="10" style="flex: 1; width: 0;">
14
+ <marquee direction="left" :scroll="scroll" style="background: #000; color: #FFF;" :style="{'padding': style ? '10px' : undefined, 'line-height': style ? '1.5' : undefined}">
15
+ <block v-for="(line, index) of lineCount">Line {{line}}, index: {{index}}.</block>
16
+ </marquee>
17
+ <marquee :direction="direction" :scroll="scroll" style="flex: 1; height: 0; border: 1px solid rgba(0, 0, 0, .1); background: #FFF;" :style="{'padding': style ? '10px' : undefined, 'line-height': style ? '1.5' : undefined}">
18
+ <block v-for="(line, index) of lineCount">
19
+ <button v-if="index > 0 && index % 10 === 0" style="height: 30px;">test</button>
20
+ <block v-else>Line {{line}}, index: {{index}}.</block>
21
+ </block>
22
+ </marquee>
23
+ </layout>
24
+ </layout>
25
+ <!-- 控制按钮 -->
26
+ <layout gutter="10">
27
+ <button @click="++lineCount" style="height: 30px; flex: 1; width: 0;">Add item</button>
28
+ <button @click="--lineCount;if(lineCount < 0){lineCount = 0}" style="height: 30px; flex: 1; width: 0;">Remove item</button>
29
+ <button @click="style = !style" style="height: 30px; flex: 1; width: 0;">Change style</button>
30
+ </layout>
31
+ <layout gutter="10">
32
+ <button @click="changeDirection" style="height: 30px; padding: 0 10px;">Right bottom: {{direction}}</button>
33
+ <button @click="scroll = !scroll" style="height: 30px; flex: 1; width: 0;">{{scroll ? '' : '!'}}scroll</button>
34
+ </layout>
35
+ </layout>
36
+ </form>
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.data = void 0;
4
+ exports.data = {
5
+ 'radio': 'radio1',
6
+ 'check1': true,
7
+ 'check2': false
8
+ };
@@ -0,0 +1,122 @@
1
+ <form title="Menu" width="300" height="500" min-width="300" min-height="400" padding="10">
2
+ <layout direction="v" gutter="10" style="flex: 1; width: 0;">
3
+ <label>Radio, Check, Split, Custom:</label>
4
+ <menulist>
5
+ <menulist-item alt="A">Item1</menulist-item>
6
+ <menulist-item alt="B">Item2</menulist-item>
7
+ <menulist-item alt="C">
8
+ <template v-slot>Radio</template>
9
+ <template v-slot:pop>
10
+ <menulist>
11
+ <menulist-item type="radio" alt="A" v-model="radio" label="radio1">Radio1</menulist-item>
12
+ <menulist-item type="radio" alt="B" v-model="radio" label="radio2">Radio2</menulist-item>
13
+ <menulist-split></menulist-split>
14
+ <menulist-item alt="C">
15
+ <template v-slot>Check</template>
16
+ <template v-slot:pop>
17
+ <menulist>
18
+ <menulist-item type="check" alt="A" v-model="check1">Check1</menulist-item>
19
+ <menulist-item type="check" alt="B" v-model="check2">Check2</menulist-item>
20
+ </menulist>
21
+ </template>
22
+ </menulist-item>
23
+ </menulist>
24
+ </template>
25
+ </menulist-item>
26
+ <menulist-item alt="D">
27
+ <template v-slot>Custom</template>
28
+ <template v-slot:pop>
29
+ <menulist>
30
+ <menulist-item alt="A">
31
+ <template v-slot>Icon</template>
32
+ <template v-slot:pop>
33
+ <menulist>
34
+ <menulist-item alt="A"><img src="../../../res/txt.svg" style="width: 16px; height: 16px;" /><label style="margin-left: 10px;">Txt</label></menulist-item>
35
+ <menulist-item alt="B"><img src="../../../res/sql.svg" style="width: 16px; height: 16px;" /><label style="margin-left: 10px;">Sql</label></menulist-item>
36
+ <menulist-item alt="C"><img src="../../../res/zip.svg" style="width: 16px; height: 16px;" /><label style="margin-left: 10px;">Zip</label></menulist-item>
37
+ </menulist>
38
+ </template>
39
+ </menulist-item>
40
+ <menulist-item alt="B">
41
+ <template v-slot>Control</template>
42
+ <template v-slot:pop>
43
+ <menulist>
44
+ <menulist-item alt="A">
45
+ <button @click="$event.stopPropagation()" style="height: 30px; flex: 1; width: 0;">Button</button>
46
+ </menulist-item>
47
+ <menulist-item alt="B">
48
+ <scroll direction="h" @click="$event.stopPropagation()" style="height: 30px; width: 150px;"></scroll>
49
+ </menulist-item>
50
+ <menulist-item alt="C">
51
+ <text @click="$event.stopPropagation()" style="height: 30px; flex: 1; width: 0;"></text>
52
+ </menulist-item>
53
+ </menulist>
54
+ </template>
55
+ </menulist-item>
56
+ <menulist-item alt="C">
57
+ <template v-slot>Free</template>
58
+ <template v-slot:pop>
59
+ <menulist>
60
+ <layout>
61
+ <menulist-item alt="A" style="padding: 20px;">Box 1</menulist-item>
62
+ <menulist-item alt="B" style="padding: 20px;">
63
+ <template v-slot>Box 2</template>
64
+ <template v-slot:pop>
65
+ <menulist>
66
+ <menulist-item alt="A">Child</menulist-item>
67
+ </menulist>
68
+ </template>
69
+ </menulist-item>
70
+ </layout>
71
+ <menulist-item alt="C">Other item</menulist-item>
72
+ </menulist>
73
+ </template>
74
+ </menulist-item>
75
+ </menulist>
76
+ </template>
77
+ </menulist-item>
78
+ </menulist>
79
+ <label>Basic:</label>
80
+ <menulist>
81
+ <menulist-item alt="E">Item1</menulist-item>
82
+ <menulist-item alt="F">
83
+ <template v-slot>Item2</template>
84
+ <template v-slot:pop>
85
+ <menulist>
86
+ <menulist-item alt="A">Item3</menulist-item>
87
+ <menulist-item alt="B">Item4</menulist-item>
88
+ <menulist-item alt="C" disabled>Item5</menulist-item>
89
+ </menulist>
90
+ </template>
91
+ </menulist-item>
92
+ </menulist>
93
+ <label>Bar:</label>
94
+ <menu>
95
+ <menu-item alt="G">
96
+ <template v-slot>Item1</template>
97
+ <template v-slot:pop>
98
+ <menulist>
99
+ <menulist-item alt="A">Item4</menulist-item>
100
+ </menulist>
101
+ </template>
102
+ </menu-item>
103
+ <menu-item alt="H">
104
+ <template v-slot>Item2</template>
105
+ <template v-slot:pop>
106
+ <menulist>
107
+ <menulist-item alt="A">Item6</menulist-item>
108
+ </menulist>
109
+ </template>
110
+ </menu-item>
111
+ <menu-item alt="I" disabled>
112
+ <template v-slot>Item3</template>
113
+ <template v-slot:pop>
114
+ <menulist>
115
+ <menulist-item alt="A">Item5</menulist-item>
116
+ </menulist>
117
+ </template>
118
+ </menu-item>
119
+ <menu-item alt="J">Item7</menu-item>
120
+ </menu>
121
+ </layout>
122
+ </form>
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mounted = exports.methods = exports.computed = exports.data = void 0;
4
+ const clickgo = require("clickgo");
5
+ exports.data = {
6
+ 'path': '/index.html',
7
+ 'file': '',
8
+ 'files': {
9
+ '/index.html': `<html>
10
+ <head>
11
+ <title>Monaco</title>
12
+ </head>
13
+ <body>
14
+ Hello Monaco Editor!
15
+ </body>
16
+ </html>`,
17
+ '/index.ts': 'export' + ` let props = {
18
+ };\n\nexport` + ` let methods = {
19
+ hehe: function(): string {
20
+ return str() + ', en.';
21
+ },
22
+ incl: function(): string {
23
+ return str2() + ', o.';
24
+ }
25
+ };\n`,
26
+ '/index.css': `.red {
27
+ color: red;
28
+ }`,
29
+ '/index.scss': `.red {
30
+ color: red;
31
+ span {
32
+ color: blue;
33
+ }
34
+ }`
35
+ },
36
+ 'list': [
37
+ {
38
+ 'label': 'HTML',
39
+ 'value': '/index.html'
40
+ },
41
+ {
42
+ 'label': 'TypeScript',
43
+ 'value': '/index.ts'
44
+ },
45
+ {
46
+ 'label': 'CSS',
47
+ 'value': '/index.css'
48
+ },
49
+ {
50
+ 'label': 'SCSS',
51
+ 'value': '/index.scss'
52
+ }
53
+ ],
54
+ 'theme': 'vs',
55
+ 'themes': ['vs', 'vs-dark', 'hc-black'],
56
+ 'language': undefined,
57
+ 'globali': false,
58
+ 'newi': false,
59
+ 'readonly': false,
60
+ 'disabled': false,
61
+ 'size': '12px',
62
+ 'family': false,
63
+ 'initMonaco': false
64
+ };
65
+ exports.computed = {
66
+ 'filesName': function () {
67
+ const names = [];
68
+ for (const name in this.files) {
69
+ if (!name.includes('.d.ts')) {
70
+ continue;
71
+ }
72
+ names.push(name);
73
+ }
74
+ return names;
75
+ }
76
+ };
77
+ exports.methods = {
78
+ globalInclude: function () {
79
+ if (this.globali) {
80
+ delete this.files['/global.d.ts'];
81
+ }
82
+ else {
83
+ this.files['/global.d.ts'] = 'declare function str(): string;';
84
+ }
85
+ this.globali = !this.globali;
86
+ },
87
+ newInclude: function () {
88
+ if (this.newi) {
89
+ delete this.files['/new.d.ts'];
90
+ }
91
+ else {
92
+ this.files['/new.d.ts'] = 'declare function str2(): string;';
93
+ }
94
+ this.newi = !this.newi;
95
+ },
96
+ jump: function (input) {
97
+ clickgo.form.dialog({
98
+ 'content': `<block>Path: ${input.resource.path}</block><block>Line: ${input.options.selection.startLineNumber}</block>`,
99
+ 'direction': 'v'
100
+ }).catch((e) => { throw e; });
101
+ },
102
+ pathLebel: function (label) {
103
+ this.language = label.toLowerCase();
104
+ }
105
+ };
106
+ const mounted = function () {
107
+ clickgo.core.initModules('monaco').then(() => {
108
+ this.initMonaco = true;
109
+ }).catch(() => {
110
+ this.initMonaco = true;
111
+ });
112
+ };
113
+ exports.mounted = mounted;
@@ -0,0 +1,27 @@
1
+ <form title="Monaco" width="500" height="450" padding="10" :loading="!initMonaco">
2
+ <layout gutter="10" direction="v" style="flex: 1; width: 0;">
3
+ <label>File: {{path}}, Length: {{files[path].length}}</label>
4
+ <layout gutter="10" style="flex: 1; height: 0;">
5
+ <text :modelValue="JSON.stringify(files, null, 4)" style="flex: 1; width: 0;" multi readonly wrap></text>
6
+ <monaco v-if="initMonaco" v-model="path" v-model:files="files" :readonly="readonly" :language="language" :disabled="disabled" :theme="theme" @jump="jump" style="flex: 1; wdith: 0;" :style="{'font-size': size, 'font-family': family ? 'Consolas, \'Courier New\', monospace' : undefined}"></monaco>
7
+ </layout>
8
+ <layout gutter="10">
9
+ <button @click="disabled = !disabled" style="height: 30px; flex: 1; width: 0;">{{disabled ? '' : '!'}}disabled</button>
10
+ <button @click="readonly = !readonly" style="height: 30px; flex: 1; width: 0;">{{readonly ? '' : '!'}}readonly</button>
11
+ <button @click="family = !family" style="height: 30px; flex: 1; width: 0;">{{family ? '' : '!'}}Family CCM</button>
12
+ <select v-model="size" :data="['12px', '13px', '14px', '15px', '16px']" style="flex: 1; width: 0;"></select>
13
+ <select v-model="theme" :data="themes" style="flex: 1; width: 0;"></select>
14
+ <select v-model="path" @label="pathLebel" :data="list" style="flex: 1; width: 0;"></select>
15
+ </layout>
16
+ <label>Include files:</label>
17
+ <layout gutter="10" style="flex: 1; height: 0;">
18
+ <layout direction="v" gutter="10" style="width: 100px;">
19
+ <list v-model="file" :data="filesName" :must="false" style="flex: 1;"></list>
20
+ <button @click="globalInclude" style="height: 30px;">{{globali ? '' : '!'}}global</button>
21
+ <button @click="newInclude" style="height: 30px;">{{newi ? '' : '!'}}new</button>
22
+ </layout>
23
+ <monaco v-if="(files[file] !== undefined) && initMonaco" v-model="files[file]" language="typescript" style="flex: 1; width: 0;"></monaco>
24
+ <layout v-else align-v="center" align-h="center" style="flex: 1; width: 0;">Please select file.</layout>
25
+ </layout>
26
+ </layout>
27
+ </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}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.methods = exports.data = void 0;
4
+ const clickgo = require("clickgo");
5
+ exports.data = {
6
+ 'ntab': '',
7
+ 'lineValue': 10,
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
+ 'gesture': false,
33
+ 'style': false
34
+ };
35
+ exports.methods = {
36
+ scrollborder: function (e, dir) {
37
+ if (!this.gesture) {
38
+ return;
39
+ }
40
+ let dirs = [];
41
+ switch (dir) {
42
+ case 'h': {
43
+ dirs = ['left', 'right'];
44
+ break;
45
+ }
46
+ default: {
47
+ dirs = ['top', 'bottom'];
48
+ break;
49
+ }
50
+ }
51
+ clickgo.dom.bindGesture(e, {
52
+ 'dirs': dirs,
53
+ 'handler': (dir) => {
54
+ switch (dir) {
55
+ case 'left':
56
+ case 'top': {
57
+ this.lineCount -= 10;
58
+ if (this.lineCount < 0) {
59
+ this.lineCount = 0;
60
+ }
61
+ break;
62
+ }
63
+ default: {
64
+ this.lineCount += this.lineValue;
65
+ }
66
+ }
67
+ }
68
+ });
69
+ }
70
+ };
@@ -0,0 +1,18 @@
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
+ }
@@ -0,0 +1,98 @@
1
+ <form title="Overflow" 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
+ <overflow v-model:scroll-left="sLeft1" v-model:scroll-top="sTop1" direction="v" @resize="c1 = $event" @change="l1 = $event" @scrollborder="scrollborder($event, 'v')" :style="{'line-height': style ? '1.5' : undefined}" class="border" style="flex: 1;">
8
+ <block :style="{'padding': style ? '10px' : undefined}">
9
+ <block v-for="(line, index) of lineCount">
10
+ <button v-if="index > 0 && index % 10 === 0" style="height: 30px;">test</button>
11
+ <block v-else>Line {{line}}, index: {{index}}.</block>
12
+ </block>
13
+ </block>
14
+ </overflow>
15
+ <layout class="border" style="flex: 1;">
16
+ <overflow v-model:scroll-left="sLeft2" v-model:scroll-top="sTop2" direction="v" @resize="c2 = $event" @change="l2 = $event" @scrollborder="scrollborder($event, 'v')" :style="{'line-height': style ? '1.5' : undefined}" style="flex: 1;">
17
+ <block :style="{'padding': style ? '10px' : undefined}">
18
+ <block v-for="(line, index) of lineCount">
19
+ <block v-if="index > 0 && index % 10 === 0" class="custom">Custom</block>
20
+ <block v-else>Line {{line}}, index: {{index}}.</block>
21
+ </block>
22
+ </block>
23
+ </overflow>
24
+ <scroll :length="l2" :client="c2" v-model:scroll-offset="sTop2" style="width: 20px;"></scroll>
25
+ </layout>
26
+ </layout>
27
+ <label>Scroll Left: {{sLeft1}}, Scroll Top: {{sTop1}}, Length: {{l1}}, Client: {{c1}}.</label>
28
+ <label>Scroll Left: {{sLeft2}}, Scroll Top: {{sTop2}}, Length: {{l2}}, Client: {{c2}}.</label>
29
+ <!-- h -->
30
+ <overflow v-model:scroll-left="sLeft3" v-model:scroll-top="sTop3" @resize="c3 = $event" @change="l3 = $event" @scrollborder="scrollborder($event, 'h')" :style="{'line-height': style ? '1.5' : undefined}" class="border" style="flex: 1; height: 0;">
31
+ <layout :style="{'padding': style ? '10px' : undefined}" style="flex: 1;">
32
+ <layout v-for="(line, index) of lineCount" align-v="center" align-h="center" direction="v" class="rightborder" style="width: 80px;">
33
+ <label>Col {{line}}.</label>
34
+ <label>index: {{index}}.</label>
35
+ </layout>
36
+ </layout>
37
+ </overflow>
38
+ <label>Scroll Left: {{sLeft3}}, Scroll Top: {{sTop3}}, Length: {{l3}}, Client: {{c3}}.</label>
39
+ <!-- button list -->
40
+ <layout gutter="10">
41
+ <select v-model="lineValue" :data="[10, 50]" style="flex: 1; width: 0;"></select>
42
+ <button @click="lineCount += lineValue" style="height: 30px;padding: 0 10px;">Add lines</button>
43
+ <button @click="lineCount += lineValue;if(lineCount < 0) {lineCount = 0;}" style="height: 30px; padding: 0 10px;">Remove lines</button>
44
+ </layout>
45
+ <layout gutter="10">
46
+ <button @click="gesture = !gesture" style="flex: 1; width: 0; height: 30px;">{{gesture ? '' : '!'}}gesture</button>
47
+ <button @click="style = !style" style="flex: 1; width: 0; height: 30px;">{{style ? '' : '!'}}style</button>
48
+ </layout>
49
+ </layout>
50
+ <!-- 自适应 -->
51
+ <layout v-else-if="ntab === 'adaptation'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
52
+ <layout :direction="direction ? 'h' : 'v'" style="flex: 1; height: 0;">
53
+ <overflow 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')">
54
+ <layout v-for="(line, index) of lineCount" align-v="center" direction="v" :class="[direction && 'rightborder']">
55
+ <button v-if="index > 0 && index % 10 === 0" style="height: 30px;" :style="{'width': direction ? '30px' : undefined}">test</button>
56
+ <block v-else :style="{'width': direction ? '80px' : undefined, 'text-align': direction ? 'center' : undefined}">Line {{line}}</block>
57
+ </layout>
58
+ </overflow>
59
+ </layout>
60
+ <label>Scroll Left: {{sLeft4}}, Scroll Top: {{sTop4}}, Length: {{l4}}, Client: {{c4}}.</label>
61
+ <layout gutter="10">
62
+ <button @click="lineCount += 10" style="flex: 1; height: 30px;">Add 10 lines</button>
63
+ <button @click="lineCount -= 10;if(lineCount < 0) {lineCount = 0;}" style="flex: 1; height: 30px;">Remove 10 lines</button>
64
+ <button @click="direction = !direction" style="flex: 1; height: 30px;">Direction</button>
65
+ </layout>
66
+ </layout>
67
+ <!-- 内容超出 -->
68
+ <layout v-else-if="ntab === 'beyond'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
69
+ <layout gutter="10" align-v="center">
70
+ <button @click="dir5 = (dir5 === 'h' ? 'v' : 'h')" style="flex: 1; height: 30px;">Change direction</button>
71
+ <button @click="line5 = (line5 === 10 ? 1 : 10)" style="flex: 1; height: 30px;">Change data</button>
72
+ <label>Direction: {{dir5}}</label>
73
+ </layout>
74
+ <overflow v-model:scroll-left="sLeft5" v-model:scroll-top="sTop5" @resize="c5 = $event" @change="l5 = $event" :direction="dir5" class="border" style="flex: 1; height: 0; padding: 10px 0 0 10px;">
75
+ <layout v-for="i of line5" :direction="dir5 === 'h' ? 'v' : 'h'">
76
+ <layout v-for="j of 10" class="block">
77
+ <block>{{i}}-{{j}}</block>
78
+ </layout>
79
+ </layout>
80
+ </overflow>
81
+ <label>Scroll Left: {{sLeft5}}, Scroll Top: {{sTop5}}, Length: {{l5}}, Client: {{c5}}.</label>
82
+ </layout>
83
+ <!-- 嵌套 -->
84
+ <layout v-else style="flex: 1; width: 0; padding: 10px;">
85
+ <overflow class="border" direction="v" style="flex: 1; width: 0;">
86
+ <template v-for="i of 100">
87
+ <overflow v-if="i === 30" class="border" direction="v" style="height: 50px;">
88
+ <label v-for="k of 50">Line {{k}}</label>
89
+ </overflow>
90
+ <overflow v-else-if="i === 40" class="border" style="height: 50px;">
91
+ <label v-for="k of 50" class="rightborder" style="width: 80px;">Line {{k}}</label>
92
+ </overflow>
93
+ <label v-else>Line {{i}}</label>
94
+ </template>
95
+ </overflow>
96
+ </layout>
97
+ </tab>
98
+ </form>