clickgo 3.1.1-dev10 → 3.1.2-dev11

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.
@@ -60,12 +60,13 @@ class default_1 extends clickgo.core.AbstractApp {
60
60
  '/form/event/form/form.xml',
61
61
  '/form/event/screen/screen.xml',
62
62
  '/form/event/task/task.xml',
63
+ '/form/method/aform/aform.xml',
64
+ '/form/method/aform/test.xml',
63
65
  '/form/method/core/core.xml',
64
66
  '/form/method/dom/dom.css',
65
67
  '/form/method/dom/dom.xml',
66
68
  '/form/method/form/form.css',
67
69
  '/form/method/form/form.xml',
68
- '/form/method/form/test.xml',
69
70
  '/form/method/fs/fs.xml',
70
71
  '/form/method/fs/text.xml',
71
72
  '/form/method/task/locale1.json',
@@ -13,6 +13,7 @@ const clickgo = require("clickgo");
13
13
  const form_1 = require("./control/form/form");
14
14
  const dialog_1 = require("./control/dialog/dialog");
15
15
  const form_2 = require("./method/form/form");
16
+ const aform_1 = require("./method/aform/aform");
16
17
  class default_1 extends clickgo.form.AbstractForm {
17
18
  constructor() {
18
19
  super(...arguments);
@@ -38,6 +39,10 @@ class default_1 extends clickgo.form.AbstractForm {
38
39
  frm = yield form_2.default.create();
39
40
  break;
40
41
  }
42
+ case 'aform': {
43
+ frm = yield aform_1.default.create();
44
+ break;
45
+ }
41
46
  }
42
47
  if (typeof frm === 'number') {
43
48
  return;
@@ -36,6 +36,7 @@
36
36
  <button @click="openForm('method', 'theme')">Library theme</button>
37
37
  <button @click="openForm('method', 'tool')">Library tool</button>
38
38
  <button @click="openForm('method', 'zip')">Library zip</button>
39
+ <button @click="openForm('aform')">Abstract Form</button>
39
40
  </layout>
40
41
  </overflow>
41
42
  <overflow v-else class="inner" direction="v">
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const clickgo = require("clickgo");
13
+ class default_1 extends clickgo.form.AbstractForm {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.fid = '0';
17
+ this.sendValue = 'sendValue';
18
+ this.test = 'A';
19
+ this.dr = '';
20
+ }
21
+ ccreateForm() {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const frm = yield this.createForm('test');
24
+ if (typeof frm === 'number') {
25
+ return;
26
+ }
27
+ frm.show();
28
+ });
29
+ }
30
+ ssend() {
31
+ this.send(parseInt(this.fid), {
32
+ 'key': this.sendValue
33
+ });
34
+ }
35
+ hhide() {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ this.hide();
38
+ yield clickgo.tool.sleep(1000);
39
+ this.show();
40
+ });
41
+ }
42
+ sshowDialog() {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ const frm = yield this.createForm('test');
45
+ if (typeof frm === 'number') {
46
+ return;
47
+ }
48
+ this.dr = yield frm.showDialog();
49
+ });
50
+ }
51
+ onMounted() {
52
+ this.watch('test', () => __awaiter(this, void 0, void 0, function* () {
53
+ yield clickgo.form.dialog('test changed.');
54
+ }));
55
+ }
56
+ }
57
+ exports.default = default_1;
@@ -0,0 +1,34 @@
1
+ <form width="350" height="400" title="Abstract Form">
2
+ <overflow direction="v" style="flex: 1; padding: 10px;">
3
+ <layout gutter="10" direction="v" style="flex: 1;">
4
+ <label>filename: {{filename}}</label>
5
+ <label>controlName: {{controlName}}</label>
6
+ <label>taskId: {{taskId}}</label>
7
+ <label>formId: {{formId}}</label>
8
+ <label>formFocus: {{formFocus}}</label>
9
+ <label>path: {{path}}</label>
10
+ <label>locale: {{locale}}</label>
11
+ <label>isMask: {{isMask}}</label>
12
+ <layout gutter="10" align-v="center">
13
+ <label>test: {{test}}</label>
14
+ <button @click="test = test === 'A' ? 'B' : 'A'" style="height: 30px; flex: 1;">watch('test', () => { dialog })</button>
15
+ </layout>
16
+ <button @click="ccreateForm" style="height: 30px;">createForm('test')</button>
17
+ <button @click="topMost = !topMost" style="height: 30px;">topMost: {{topMost ? 'true' : 'false'}}</button>
18
+ <layout gutter="10" align-v="center">
19
+ <label>Form ID:</label>
20
+ <text v-model="fid" style="flex: 1; width: 0; height: 30px;"></text>
21
+ </layout>
22
+ <layout gutter="10" align-v="center">
23
+ <label>Send: </label>
24
+ <text v-model="sendValue" style="flex: 1; width: 0; height: 30px;"></text>
25
+ <button @click="ssend" style="padding: 0 10px; height: 30px;">send({{fid}}, { 'key': '{{sendValue}}' })</button>
26
+ </layout>
27
+ <button @click="hhide" style="height: 30px;">hide() and show()</button>
28
+ <layout gutter="10" align-v="center">
29
+ <button @click="sshowDialog" style="height: 30px; flex: 1;">showDialog()</button>
30
+ <label>result: {{dr}}</label>
31
+ </layout>
32
+ </layout>
33
+ </overflow>
34
+ </form>
@@ -0,0 +1,6 @@
1
+ <form width="200" height="200" title="From path">
2
+ <layout align-v="center" align-h="center" direction="v" gutter="10" style="flex: 1; width: 0;">
3
+ <label>Haha!</label>
4
+ <button @click="dialogResult = dialogResult ? '' : 'Done'" style="padding: 10px;">{{dialogResult ? 'Remove' : 'Set'}} dialogResult</button>
5
+ </layout>
6
+ </form>
@@ -14,7 +14,6 @@ class default_1 extends clickgo.form.AbstractForm {
14
14
  constructor() {
15
15
  super(...arguments);
16
16
  this.fid = '0';
17
- this.sendValue = 'sendValue';
18
17
  this.tid = '0';
19
18
  this.type = 'primary';
20
19
  this.progress = 'noraml';
@@ -42,11 +41,6 @@ class default_1 extends clickgo.form.AbstractForm {
42
41
  get() {
43
42
  clickgo.form.dialog(JSON.stringify(clickgo.form.get(parseInt(this.fid)))).catch((e) => { throw e; });
44
43
  }
45
- send() {
46
- clickgo.form.send(parseInt(this.fid), {
47
- 'key': this.sendValue
48
- });
49
- }
50
44
  changeFocus() {
51
45
  clickgo.form.changeFocus(parseInt(this.fid));
52
46
  }
@@ -124,14 +118,6 @@ class default_1 extends clickgo.form.AbstractForm {
124
118
  }
125
119
  clickgo.form.showPop(e.currentTarget, this.refs.pop, 'v');
126
120
  }
127
- createParam() {
128
- clickgo.form.create({
129
- 'layout': '<form width=\'300\' height=\'300\' title=\'normal\'></form>'
130
- }).catch((e) => { throw e; });
131
- }
132
- createPath() {
133
- this.createForm('test').then((e) => { console.log(e); }).catch((e) => { throw e; });
134
- }
135
121
  createTop() {
136
122
  return __awaiter(this, void 0, void 0, function* () {
137
123
  const frm = yield this.createForm('test');
@@ -201,12 +187,8 @@ class default_1 extends clickgo.form.AbstractForm {
201
187
  flash() {
202
188
  clickgo.form.flash(this.formId);
203
189
  }
204
- hhide() {
205
- return __awaiter(this, void 0, void 0, function* () {
206
- this.hide();
207
- yield clickgo.tool.sleep(1000);
208
- this.show();
209
- });
190
+ showLauncher() {
191
+ clickgo.form.showLauncher();
210
192
  }
211
193
  onReceive(obj) {
212
194
  clickgo.form.dialog(JSON.stringify(obj)).catch((e) => { throw e; });
@@ -1,6 +1,7 @@
1
1
  <form width="350" height="400" title="Library form">
2
2
  <overflow direction="v" style="flex: 1; padding: 10px;">
3
3
  <layout gutter="10" direction="v" style="flex: 1;">
4
+ <label>This form id: {{formId}}</label>
4
5
  <button @click="min" style="height: 30px;">min({{formId}})</button>
5
6
  <button @click="max" style="height: 30px;">max({{formId}})</button>
6
7
  <button @click="close" style="height: 30px;">close({{formId}})</button>
@@ -12,17 +13,12 @@
12
13
  </layout>
13
14
  <button @click="getTaskId" style="height: 30px;">getTaskId({{fid}})</button>
14
15
  <button @click="get" style="height: 30px;">get({{fid}})</button>
15
- <layout gutter="10" align-v="center">
16
- <label>Send: </label>
17
- <text v-model="sendValue" style="flex: 1; width: 0; height: 30px;"></text>
18
- <button @click="send" style="padding: 0 10px;">send({{fid}}, {'key': '{{sendValue}}'})</button>
19
- </layout>
20
- <button @click="changeFocus" style="height: 30px;">changeFocus({{fid}})</button>
21
16
  <layout gutter="10" align-v="center">
22
17
  <label>Task ID:</label>
23
18
  <text v-model="tid" style="flex: 1; width: 0; height: 30px;"></text>
24
19
  <button @click="getList" style="padding: 0 10px;">getList({{tid}})</button>
25
20
  </layout>
21
+ <button @click="changeFocus" style="height: 30px;">changeFocus({{fid}})</button>
26
22
  <button @click="getMaxZIndexID" style="height: 30px;">getMaxZIndexID()</button>
27
23
  <button @click="getRectByBorder" style="height: 30px;">getRectByBorder('rb')</button>
28
24
  <button @click="showCircular" style="height: 30px;">showCircular(x, y)</button>
@@ -33,12 +29,10 @@
33
29
  <select v-model="progress" :data="['normal', 'progress + icon']" style="flex: 1; width: 0;"></select>
34
30
  <button @click="notify" style="padding: 0 10px;">notify({ ... })</button>
35
31
  </layout>
36
- <button @click="showPop" style="height: 30px;">showPop(e.currentTarget, this.$refs.pop)</button>
32
+ <button @click="showPop" style="height: 30px;">showPop(e.currentTarget, this.refs.pop)</button>
37
33
  <teleport to="#cg-pop-list">
38
- <block ref="pop" data-cg-pop style="border: solid 1px #000; background: #FFF; width: 200px; height: 100px; display: flex; justify-content: center; align-items: center;">$refs.pop</block>
34
+ <block ref="pop" data-cg-pop style="border: solid 1px #000; background: #FFF; width: 200px; height: 100px; display: flex; justify-content: center; align-items: center;">refs.pop</block>
39
35
  </teleport>
40
- <button @click="createPath" style="height: 30px;">create('test')</button>
41
- <button @click="createTop" style="height: 30px;">create({'layout':'xxx','topMost':true})</button>
42
36
  <label>Dialog result: {{dr}}.</label>
43
37
  <button @click="dialog" style="height: 30px;">dialog('Hello world!')</button>
44
38
  <button @click="dialogLong">dialog('long...')</button>
@@ -47,9 +41,8 @@
47
41
  <button @click="dialogCannot" style="height: 30px;">Dialog can not be close</button>
48
42
  <button @click="confirm(false)" style="height: 30px;">confirm('confirm')</button>
49
43
  <button @click="confirm(true)" style="height: 30px;">confirm({'content':'confirm','cancel':true})</button>
50
- <button @click="setTopMost" style="height: 30px;">setTopMost({{setTopMostValue ? 'false' : 'true'}})</button>
51
44
  <button @click="flash" style="height: 30px;">flash({{formId}})</button>
52
- <button @click="hhide" style="height: 30px;">hide({{formId}}) and show({{formId}})</button>
45
+ <button @click="showLauncher" style="height: 30px;">showLauncher()</button>
53
46
  </layout>
54
47
  </overflow>
55
48
  </form>
@@ -81,7 +81,7 @@ class default_1 extends clickgo.form.AbstractForm {
81
81
  return;
82
82
  }
83
83
  for (const formId in app.forms) {
84
- clickgo.form.remove(parseInt(formId));
84
+ clickgo.form.close(parseInt(formId));
85
85
  }
86
86
  }
87
87
  changeFocus(formId) {
package/dist/clickgo.js CHANGED
@@ -1,27 +1,39 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zip = exports.tool = exports.theme = exports.task = exports.native = exports.fs = exports.form = exports.dom = exports.core = exports.control = exports.vue = exports.getPlatform = exports.getNative = exports.getVersion = void 0;
3
+ exports.zip = exports.tool = exports.theme = exports.task = exports.native = exports.fs = exports.form = exports.dom = exports.core = exports.control = exports.vue = exports.hasFrame = exports.isImmersion = exports.getPlatform = exports.isNative = exports.getVersion = void 0;
4
4
  const version = '3.0.0';
5
5
  function getVersion() {
6
6
  return version;
7
7
  }
8
8
  exports.getVersion = getVersion;
9
9
  const native = navigator.userAgent.includes('electron') ? true : false;
10
- function getNative() {
10
+ function isNative() {
11
11
  return native;
12
12
  }
13
- exports.getNative = getNative;
13
+ exports.isNative = isNative;
14
14
  let platform = 'web';
15
+ let immersion = false;
16
+ let frame = false;
15
17
  if (native) {
16
- const reg = /electron\/(.+?) (.+?)\//.exec(navigator.userAgent);
18
+ const reg = /electron\/(.+?) (.+?)\/(.+?) immersion\/([0-9]) frame\/([0-9])/.exec(navigator.userAgent);
17
19
  if (reg) {
18
20
  platform = reg[2];
21
+ immersion = reg[4] === '0' ? false : true;
22
+ frame = reg[5] === '0' ? false : true;
19
23
  }
20
24
  }
21
25
  function getPlatform() {
22
26
  return platform;
23
27
  }
24
28
  exports.getPlatform = getPlatform;
29
+ function isImmersion() {
30
+ return immersion;
31
+ }
32
+ exports.isImmersion = isImmersion;
33
+ function hasFrame() {
34
+ return frame;
35
+ }
36
+ exports.hasFrame = hasFrame;
25
37
  exports.vue = window.Vue;
26
38
  exports.control = require("./lib/control");
27
39
  exports.core = require("./lib/core");
package/dist/clickgo.ts CHANGED
@@ -19,21 +19,40 @@ export function getVersion(): string {
19
19
  }
20
20
 
21
21
  const native = navigator.userAgent.includes('electron') ? true : false;
22
- export function getNative(): boolean {
22
+ export function isNative(): boolean {
23
23
  return native;
24
24
  }
25
25
 
26
26
  let platform: NodeJS.Platform | 'web' = 'web';
27
+ let immersion: boolean = false;
28
+ let frame: boolean = false;
29
+
27
30
  if (native) {
28
- const reg = /electron\/(.+?) (.+?)\//.exec(navigator.userAgent);
31
+ const reg = /electron\/(.+?) (.+?)\/(.+?) immersion\/([0-9]) frame\/([0-9])/.exec(navigator.userAgent);
29
32
  if (reg) {
30
33
  platform = reg[2] as any;
34
+ immersion = reg[4] === '0' ? false : true;
35
+ frame = reg[5] === '0' ? false : true;
31
36
  }
32
37
  }
33
38
  export function getPlatform(): NodeJS.Platform | 'web' {
34
39
  return platform;
35
40
  }
36
41
 
42
+ /**
43
+ * --- 获取当前 native 是否是沉浸式 ---
44
+ */
45
+ export function isImmersion(): boolean {
46
+ return immersion;
47
+ }
48
+
49
+ /**
50
+ * --- 是否含有窗体外边框 ---
51
+ */
52
+ export function hasFrame(): boolean {
53
+ return frame;
54
+ }
55
+
37
56
  export const vue: import('../types/index').IVueObject = (window as any).Vue;
38
57
 
39
58
  export * as control from './lib/control';
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/global.css CHANGED
@@ -1 +1 @@
1
- #cg-wrap{--cg:hsl(20, 100%, 65%);--success:hsl(150, 100%, 40%);--success-hover:hsl(150, 100%, 45%);--success-active:hsl(150, 100%, 30%);--success-focus:hsl(150, 100%, 35%);--success-disabled:hsl(150, 0%, 40%);--info:hsl(210, 100%, 50%);--info-hover:hsl(210, 100%, 60%);--info-active:hsl(210, 100%, 40%);--info-focus:hsl(210, 100%, 45%);--info-disabled:hsl(210, 0%, 50%);--warning:hsl(20, 100%, 70%);--warning-hover:hsl(20, 100%, 80%);--warning-active:hsl(20, 100%, 60%);--warning-focus:hsl(20, 100%, 65%);--warning-disabled:hsl(20, 0%, 70%);--danger:hsl(350, 100%, 50%);--danger-hover:hsl(350, 100%, 70%);--danger-active:hsl(350, 100%, 40%);--danger-focus:hsl(350, 100%, 45%);--danger-disabled:hsl(350, 0%, 50%);--system-color:hsl(0, 0%, 95%);--system-background:hsla(0, 0%, 0%, .5);--system-border-color:hsla(0, 0%, 100%, .2);--face:hsl(0, 0%, 95%);--g-color:hsl(0, 0%, 20%);--g-color-hover:hsl(0, 0%, 30%);--g-color-active:hsl(0, 0%, 10%);--g-color-focus:hsl(0, 0%, 15%);--g-color-disabled:hsl(0, 0%, 60%);--g-background:hsl(0, 0%, 95%);--g-background-hover:hsl(0, 0%, 100%);--g-background-active:hsl(0, 0%, 85%);--g-background-kp:hsl(0, 0%, 80%);--g-background-opacity:hsl(0, 0%, 50%, .2);--g-background-focus:hsl(0, 0%, 97.5%);--g-background-disabled:hsl(0, 0%, 75%);--g-border-color:hsl(0, 0%, 40%);--g-border-color-hover:hsl(0, 0%, 50%);--g-border-color-active:hsl(0, 0%, 30%);--g-border-color-focus:hsl(0, 0%, 35%);--g-border-color-disabled:hsl(0, 0%, 60%);--g-plain-color:var(--g-color);--g-plain-color-hover:var(--g-color-hover);--g-plain-color-active:var(--g-color-active);--g-plain-color-focus:var(--g-color-focus);--g-plain-color-disabled:var(--g-color-disabled);--g-plain-background:hsl(0, 0%, 100%);--g-plain-background-hover:hsl(0, 0%, 98%);--g-plain-background-active:hsl(0, 0%, 95%);--g-plain-background-focus:var(--g-plain-background);--g-plain-background-disabled:hsl(0, 0%, 95%);--g-plain-border-color:hsl(0, 0%, 70%);--g-plain-border-color-hover:hsl(0, 0%, 80%);--g-plain-border-color-active:hsl(0, 0%, 60%);--g-plain-border-color-focus:hsl(0, 0%, 65%);--g-plain-border-color-disabled:hsl(0, 0%, 60%)}#cg-form-list{z-index:20020000}#cg-pop-list{z-index:20020001}#cg-simpletask{z-index:20020002}#cg-rectangle{z-index:20020003;box-sizing:border-box;position:fixed;border-radius:3px;box-shadow:0 0 10px rgba(0,0,0,.25);background:rgba(255,255,255,.05);pointer-events:none;opacity:0}#cg-circular{z-index:20020003;box-sizing:border-box;position:fixed;border:solid 3px var(--cg);border-radius:50%;filter:drop-shadow(0 0 3px var(--cg));pointer-events:none;opacity:0}#cg-gesture{z-index:20020003;box-sizing:border-box;position:fixed;border-radius:50%;pointer-events:none;opacity:0;background:var(--system-background);box-shadow:0 5px 20px rgba(0,0,0,.25);transform:scale(0);width:20px;height:20px}#cg-gesture.done{background:rgba(255,255,255,.3);border:solid 3px rgba(0,0,0,.3)}#cg-drag{z-index:20020003;box-sizing:border-box;position:fixed;border-radius:3px;pointer-events:none;background:var(--system-background);box-shadow:0 5px 20px rgba(0,0,0,.25);opacity:0;display:flex;justify-content:center;align-items:center}#cg-launcher{z-index:20020004;box-sizing:border-box;position:fixed;background:var(--system-background);-webkit-backdrop-filter:blur(30px) brightness(1.2);backdrop-filter:blur(30px) brightness(1.2);width:100%;height:100%;left:0;top:0;color:var(--system-color);display:none;flex-direction:column;transition:all .1s linear;transform:scale(1.2);opacity:0}#cg-launcher:not(.cg-show){pointer-events:none}#cg-launcher.cg-show{transform:scale(1);opacity:1}.cg-launcher-search{text-align:center;padding:50px}.cg-launcher-sinput{-webkit-appearance:none;padding:10px;height:38px;border:solid 1px var(--system-border-color);background:transparent;width:50%;border-radius:3px;color:var(--system-color)}.cg-launcher-sinput::placeholder{color:var(--system-border-color)}.cg-launcher-sinput::selection{background-color:var(--system-color);color:var(--g-color)}.cg-launcher-sinput:focus{outline:none;border-color:var(--system-color)}.cg-launcher-foldername{-webkit-appearance:none;height:38px;font-size:28px !important;border:none;background:transparent;width:50%;color:var(--system-color);text-align:center}.cg-launcher-foldername::selection{background-color:var(--system-color);color:var(--g-color)}.cg-launcher-foldername:focus{outline:none}.cg-launcher-item{width:190px;display:inline-flex;vertical-align:middle;margin-bottom:50px}.cg-launcher-inner{flex:1;width:0}.cg-launcher-icon{background-position:center;background-size:80px;height:80px;background-repeat:no-repeat}.cg-launcher-icon:active{filter:brightness(0.6)}.cg-launcher-name{font-size:13px;font-weight:bold;text-shadow:0 0 3px rgba(0,0,0,.6);text-align:center;margin-top:20px}.cg-launcher-icon,.cg-launcher-name{transition:all .1s linear;transition-property:opacity}.cg-launcher-space{width:50px}.cg-launcher-folder{display:flex;justify-content:center;height:80px}.cg-launcher-folder>div{height:80px;width:80px;background:rgba(255,255,255,.3);border-radius:20px;padding:10px 4px 4px 10px;transition:all .1s linear;transition-property:left,top,width,height,opacity;overflow-y:auto}.cg-launcher-folder>div::-webkit-scrollbar{display:none}.cg-launcher-folder>div .cg-launcher-item,.cg-launcher-folder>div .cg-launcher-space{transition:all .1s linear}.cg-launcher-folder>div.cg-show{padding:50px 0 0 50px}.cg-launcher-folder>div:not(.cg-show):active{filter:brightness(0.6)}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-item{width:22px;margin-bottom:6px}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-icon{background-size:16px;height:16px;pointer-events:none}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-name{display:none}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-space{width:6px}.cg-launcher-list{flex:1;height:0;overflow-y:auto;padding:0 0 0 50px}.cg-launcher-list::-webkit-scrollbar{display:none}.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-icon,.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-name{opacity:0}.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-folder>div:not(.cg-show){opacity:0}[data-cg-pop]{position:fixed;box-shadow:0px 5px 20px rgba(0,0,0,.25);transition:.1s ease-out;transition-property:transform,opacity;transform:translateY(-10px);opacity:0}[data-cg-pop]:not([data-cg-open]){pointer-events:none}[data-cg-pop][data-cg-open]{transform:translateY(0px);opacity:1}#cg-system{z-index:20020005}.cg-system-notify{background:var(--system-background);position:fixed;padding:15px;border-radius:3px;right:0;top:0;width:280px;font-size:14px;display:flex;transition:.1s ease-out;transition-property:transform,opacity;overflow:hidden;color:var(--system-color);box-shadow:0 5px 20px rgba(0,0,0,.25);-webkit-backdrop-filter:blur(30px) brightness(1.2);backdrop-filter:blur(30px) brightness(1.2)}.cg-system-icon{margin-right:10px;width:16px;height:16px;border-radius:50%}.cg-system-icon.cg-primary{background:var(--success)}.cg-system-icon.cg-info{background:var(--info)}.cg-system-icon.cg-warning{background:var(--warning)}.cg-system-icon.cg-danger{background:var(--danger)}.cg-system-icon.cg-progress{background:var(--cg)}.cg-system-notify-title{font-size:16px;font-weight:bold;padding-bottom:10px}.cg-system-notify-content{line-height:1.5;word-break:break-word}.cg-system-notify-progress{position:absolute;bottom:0;left:0;border-radius:1px;background:var(--cg);transition:width 1s ease-out;width:0%;height:2px}#cg-simpletask{left:0;bottom:-46px;width:100%;height:46px;top:initial;background:var(--system-background);-webkit-backdrop-filter:blur(30px) brightness(1.2);backdrop-filter:blur(30px) brightness(1.2);padding:5px 0 5px 5px;display:flex;color:var(--system-color);transition:bottom .1s ease-out;overflow-x:auto}#cg-simpletask::-webkit-scrollbar{display:none}.cg-simpletask-item{background:rgba(0,0,0,.05);border-radius:3px;padding:10px;display:flex;align-items:center;margin-right:5px}.cg-simpletask-item:hover{background:rgba(0,0,0,.1)}.cg-simpletask-item:active{background:rgba(0,0,0,.2)}.cg-simpletask-icon{margin-right:5px;background-size:cover;width:16px;height:16px}
1
+ #cg-wrap{--cg:hsl(20, 100%, 65%);--success:hsl(150, 100%, 40%);--success-hover:hsl(150, 100%, 45%);--success-active:hsl(150, 100%, 30%);--success-focus:hsl(150, 100%, 35%);--success-disabled:hsl(150, 0%, 40%);--info:hsl(210, 100%, 50%);--info-hover:hsl(210, 100%, 60%);--info-active:hsl(210, 100%, 40%);--info-focus:hsl(210, 100%, 45%);--info-disabled:hsl(210, 0%, 50%);--warning:hsl(20, 100%, 70%);--warning-hover:hsl(20, 100%, 80%);--warning-active:hsl(20, 100%, 60%);--warning-focus:hsl(20, 100%, 65%);--warning-disabled:hsl(20, 0%, 70%);--danger:hsl(350, 100%, 50%);--danger-hover:hsl(350, 100%, 70%);--danger-active:hsl(350, 100%, 40%);--danger-focus:hsl(350, 100%, 45%);--danger-disabled:hsl(350, 0%, 50%);--system-color:hsl(0, 0%, 95%);--system-background:hsla(0, 0%, 0%, .5);--system-border-color:hsla(0, 0%, 100%, .2);--face:hsl(0, 0%, 95%);--g-color:hsl(0, 0%, 20%);--g-color-hover:hsl(0, 0%, 30%);--g-color-active:hsl(0, 0%, 10%);--g-color-focus:hsl(0, 0%, 15%);--g-color-disabled:hsl(0, 0%, 60%);--g-background:hsl(0, 0%, 95%);--g-background-hover:hsl(0, 0%, 100%);--g-background-active:hsl(0, 0%, 85%);--g-background-kp:hsl(0, 0%, 80%);--g-background-opacity:hsl(0, 0%, 50%, .2);--g-background-focus:hsl(0, 0%, 97.5%);--g-background-disabled:hsl(0, 0%, 75%);--g-border-color:hsl(0, 0%, 40%);--g-border-color-hover:hsl(0, 0%, 50%);--g-border-color-active:hsl(0, 0%, 30%);--g-border-color-focus:hsl(0, 0%, 35%);--g-border-color-disabled:hsl(0, 0%, 60%);--g-plain-color:var(--g-color);--g-plain-color-hover:var(--g-color-hover);--g-plain-color-active:var(--g-color-active);--g-plain-color-focus:var(--g-color-focus);--g-plain-color-disabled:var(--g-color-disabled);--g-plain-background:hsl(0, 0%, 100%);--g-plain-background-hover:hsl(0, 0%, 98%);--g-plain-background-active:hsl(0, 0%, 95%);--g-plain-background-focus:var(--g-plain-background);--g-plain-background-disabled:hsl(0, 0%, 95%);--g-plain-border-color:hsl(0, 0%, 70%);--g-plain-border-color-hover:hsl(0, 0%, 80%);--g-plain-border-color-active:hsl(0, 0%, 60%);--g-plain-border-color-focus:hsl(0, 0%, 65%);--g-plain-border-color-disabled:hsl(0, 0%, 60%)}#cg-form-list{z-index:20020000}#cg-pop-list{z-index:20020001}#cg-simpletask{z-index:20020002}#cg-rectangle{z-index:20020003;box-sizing:border-box;position:fixed;border-radius:3px;box-shadow:0 0 10px rgba(0,0,0,.25);background:rgba(255,255,255,.05);pointer-events:none;opacity:0}#cg-circular{z-index:20020003;box-sizing:border-box;position:fixed;border:solid 3px var(--cg);border-radius:50%;filter:drop-shadow(0 0 3px var(--cg));pointer-events:none;opacity:0}#cg-gesture{z-index:20020003;box-sizing:border-box;position:fixed;border-radius:50%;pointer-events:none;opacity:0;background:var(--system-background);box-shadow:0 5px 20px rgba(0,0,0,.25);transform:scale(0);width:20px;height:20px}#cg-gesture.done{background:rgba(255,255,255,.3);border:solid 3px rgba(0,0,0,.3)}#cg-drag{z-index:20020003;box-sizing:border-box;position:fixed;border-radius:3px;pointer-events:none;background:var(--system-background);box-shadow:0 5px 20px rgba(0,0,0,.25);opacity:0;display:flex;justify-content:center;align-items:center}#cg-launcher{z-index:20020004;box-sizing:border-box;position:fixed;background:var(--system-background);-webkit-backdrop-filter:blur(30px) brightness(1.2);backdrop-filter:blur(30px) brightness(1.2);width:100%;height:100%;left:0;top:0;color:var(--system-color);display:none;flex-direction:column;transition:all .1s linear;transform:scale(1.2);opacity:0}#cg-launcher:not(.cg-show){pointer-events:none}#cg-launcher.cg-show{transform:scale(1);opacity:1}.cg-launcher-search{text-align:center;padding:50px}.cg-launcher-sinput{-webkit-appearance:none;appearance:none;padding:10px;height:38px;border:solid 1px var(--system-border-color);background:rgba(0,0,0,0);width:50%;border-radius:3px;color:var(--system-color)}.cg-launcher-sinput::placeholder{color:var(--system-border-color)}.cg-launcher-sinput::selection{background-color:var(--system-color);color:var(--g-color)}.cg-launcher-sinput:focus{outline:none;border-color:var(--system-color)}.cg-launcher-foldername{-webkit-appearance:none;appearance:none;height:38px;font-size:28px !important;border:none;background:rgba(0,0,0,0);width:50%;color:var(--system-color);text-align:center}.cg-launcher-foldername::selection{background-color:var(--system-color);color:var(--g-color)}.cg-launcher-foldername:focus{outline:none}.cg-launcher-item{width:190px;display:inline-flex;vertical-align:middle;margin-bottom:50px}.cg-launcher-inner{flex:1;width:0}.cg-launcher-icon{background-position:center;background-size:80px;height:80px;background-repeat:no-repeat}.cg-launcher-icon:active{filter:brightness(0.6)}.cg-launcher-name{font-size:13px;font-weight:bold;text-shadow:0 0 3px rgba(0,0,0,.6);text-align:center;margin-top:20px}.cg-launcher-icon,.cg-launcher-name{transition:all .1s linear;transition-property:opacity}.cg-launcher-space{width:50px}.cg-launcher-folder{display:flex;justify-content:center;height:80px}.cg-launcher-folder>div{height:80px;width:80px;background:rgba(255,255,255,.3);border-radius:20px;padding:10px 4px 4px 10px;transition:all .1s linear;transition-property:left,top,width,height,opacity;overflow-y:auto}.cg-launcher-folder>div::-webkit-scrollbar{display:none}.cg-launcher-folder>div .cg-launcher-item,.cg-launcher-folder>div .cg-launcher-space{transition:all .1s linear}.cg-launcher-folder>div.cg-show{padding:50px 0 0 50px}.cg-launcher-folder>div:not(.cg-show):active{filter:brightness(0.6)}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-item{width:22px;margin-bottom:6px}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-icon{background-size:16px;height:16px;pointer-events:none}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-name{display:none}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-space{width:6px}.cg-launcher-list{flex:1;height:0;overflow-y:auto;padding:0 0 0 50px}.cg-launcher-list::-webkit-scrollbar{display:none}.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-icon,.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-name{opacity:0}.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-folder>div:not(.cg-show){opacity:0}[data-cg-pop]{position:fixed;box-shadow:0px 5px 20px rgba(0,0,0,.25);transition:.1s ease-out;transition-property:transform,opacity;transform:translateY(-10px);opacity:0}[data-cg-pop]:not([data-cg-open]){pointer-events:none}[data-cg-pop][data-cg-open]{transform:translateY(0px);opacity:1}#cg-system{z-index:20020005}.cg-system-notify{background:var(--system-background);position:fixed;padding:15px;border-radius:3px;right:0;top:0;width:280px;font-size:14px;display:flex;transition:.1s ease-out;transition-property:transform,opacity;overflow:hidden;color:var(--system-color);box-shadow:0 5px 20px rgba(0,0,0,.25);-webkit-backdrop-filter:blur(30px) brightness(1.2);backdrop-filter:blur(30px) brightness(1.2)}.cg-system-icon{margin-right:10px;width:16px;height:16px;border-radius:50%}.cg-system-icon.cg-primary{background:var(--success)}.cg-system-icon.cg-info{background:var(--info)}.cg-system-icon.cg-warning{background:var(--warning)}.cg-system-icon.cg-danger{background:var(--danger)}.cg-system-icon.cg-progress{background:var(--cg)}.cg-system-notify-title{font-size:16px;font-weight:bold;padding-bottom:10px}.cg-system-notify-content{line-height:1.5;word-break:break-word}.cg-system-notify-progress{position:absolute;bottom:0;left:0;border-radius:1px;background:var(--cg);transition:width 1s ease-out;width:0%;height:2px}#cg-simpletask{left:0;bottom:-46px;width:100%;height:46px;top:initial;background:var(--system-background);-webkit-backdrop-filter:blur(30px) brightness(1.2);backdrop-filter:blur(30px) brightness(1.2);padding:5px 0 5px 5px;display:flex;color:var(--system-color);transition:bottom .1s ease-out;overflow-x:auto}#cg-simpletask::-webkit-scrollbar{display:none}.cg-simpletask-item{background:rgba(0,0,0,.05);border-radius:3px;padding:10px;display:flex;align-items:center;margin-right:5px}.cg-simpletask-item:hover{background:rgba(0,0,0,.1)}.cg-simpletask-item:active{background:rgba(0,0,0,.2)}.cg-simpletask-icon{margin-right:5px;background-size:cover;width:16px;height:16px}
package/dist/index.js CHANGED
@@ -9,19 +9,27 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.launcher = exports.AbstractBoot = exports.getPlatform = exports.getNative = exports.getVersion = exports.vue = exports.zip = exports.tool = exports.theme = exports.task = exports.native = exports.fs = exports.form = exports.dom = exports.core = exports.control = exports.clickgo = void 0;
12
+ exports.launcher = exports.AbstractBoot = exports.hasFrame = exports.isImmersion = exports.getPlatform = exports.isNative = exports.getVersion = exports.vue = exports.zip = exports.tool = exports.theme = exports.task = exports.native = exports.fs = exports.form = exports.dom = exports.core = exports.control = exports.clickgo = void 0;
13
13
  function getVersion() {
14
14
  return exports.clickgo.getVersion();
15
15
  }
16
16
  exports.getVersion = getVersion;
17
- function getNative() {
18
- return exports.clickgo.getNative();
17
+ function isNative() {
18
+ return exports.clickgo.isNative();
19
19
  }
20
- exports.getNative = getNative;
20
+ exports.isNative = isNative;
21
21
  function getPlatform() {
22
22
  return exports.clickgo.getPlatform();
23
23
  }
24
24
  exports.getPlatform = getPlatform;
25
+ function isImmersion() {
26
+ return exports.clickgo.isImmersion();
27
+ }
28
+ exports.isImmersion = isImmersion;
29
+ function hasFrame() {
30
+ return exports.clickgo.hasFrame();
31
+ }
32
+ exports.hasFrame = hasFrame;
25
33
  class AbstractBoot {
26
34
  onError() {
27
35
  return;
@@ -71,6 +79,12 @@ class AbstractBoot {
71
79
  onLauncherFolderNameChanged() {
72
80
  return;
73
81
  }
82
+ onRuntimeFileLoad() {
83
+ return;
84
+ }
85
+ onRuntimeFileLoaded() {
86
+ return;
87
+ }
74
88
  }
75
89
  exports.AbstractBoot = AbstractBoot;
76
90
  function launcher(boot) {
@@ -98,7 +112,13 @@ function launcher(boot) {
98
112
  'dir': __dirname + '/',
99
113
  'after': after,
100
114
  'afterIgnore': new RegExp('^' + loader.cdn.replace(/\./g, '\\.')),
101
- 'map': map
115
+ 'map': map,
116
+ 'load': (url) => {
117
+ boot.onRuntimeFileLoad(url);
118
+ },
119
+ 'loaded': (url, state) => {
120
+ boot.onRuntimeFileLoaded(url, state);
121
+ }
102
122
  });
103
123
  const cg = loader.require('clickgo', files, {
104
124
  'dir': __dirname + '/',
package/dist/index.ts CHANGED
@@ -19,18 +19,26 @@ export function getVersion(): string {
19
19
  return clickgo.getVersion();
20
20
  }
21
21
 
22
- export function getNative(): boolean {
23
- return clickgo.getNative();
22
+ export function isNative(): boolean {
23
+ return clickgo.isNative();
24
24
  }
25
25
 
26
26
  export function getPlatform(): NodeJS.Platform | 'web' {
27
27
  return clickgo.getPlatform();
28
28
  }
29
29
 
30
+ export function isImmersion(): boolean {
31
+ return clickgo.isImmersion();
32
+ }
33
+
34
+ export function hasFrame(): boolean {
35
+ return clickgo.hasFrame();
36
+ }
37
+
30
38
  /** --- 全局类 --- */
31
39
  export abstract class AbstractBoot {
32
40
 
33
- /** --- 入口文件 --- */
41
+ /** --- 入口方法 --- */
34
42
  public abstract main(): void | Promise<void>;
35
43
 
36
44
  /** --- 全局错误事件 --- */
@@ -129,6 +137,18 @@ export abstract class AbstractBoot {
129
137
  return;
130
138
  }
131
139
 
140
+ /** --- 环境文件准备加载时的事件 --- */
141
+ public onRuntimeFileLoad(url: string): void | Promise<void>;
142
+ public onRuntimeFileLoad(): void {
143
+ return;
144
+ }
145
+
146
+ /** --- 环境文件加载完成的事件 --- */
147
+ public onRuntimeFileLoaded(url: string, state: number): void | Promise<void>;
148
+ public onRuntimeFileLoaded(): void {
149
+ return;
150
+ }
151
+
132
152
  }
133
153
 
134
154
  export function launcher(boot: AbstractBoot): void {
@@ -161,7 +181,13 @@ export function launcher(boot: AbstractBoot): void {
161
181
  'dir': __dirname + '/',
162
182
  'after': after,
163
183
  'afterIgnore': new RegExp('^' + loader.cdn.replace(/\./g, '\\.')),
164
- 'map': map
184
+ 'map': map,
185
+ 'load': (url) => {
186
+ boot.onRuntimeFileLoad(url) as any;
187
+ },
188
+ 'loaded': (url, state) => {
189
+ boot.onRuntimeFileLoaded(url, state) as any;
190
+ }
165
191
  });
166
192
  const cg = loader.require('clickgo', files, {
167
193
  'dir': __dirname + '/',
@@ -444,7 +444,11 @@ function buildComponents(taskId, formId, path) {
444
444
  'template': control.layout,
445
445
  'props': control.props,
446
446
  'data': function () {
447
- return tool.clone(control.data);
447
+ const data = tool.clone(control.data);
448
+ if (data.props) {
449
+ delete data.props;
450
+ }
451
+ return tool.clone(data);
448
452
  },
449
453
  'methods': control.methods,
450
454
  'computed': computed,
@@ -603,7 +603,11 @@ export function buildComponents(
603
603
  'props': control.props,
604
604
 
605
605
  'data': function() {
606
- return tool.clone(control.data);
606
+ const data = tool.clone(control.data);
607
+ if (data.props) {
608
+ delete data.props;
609
+ }
610
+ return tool.clone(data);
607
611
  },
608
612
  'methods': control.methods,
609
613
  'computed': computed,