clickgo 3.1.0-dev9 → 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',
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.data = void 0;
4
- exports.data = {
5
- 'message': 'message',
6
- 'buttons': ['OK'],
7
- 'btn': 'none'
8
- };
3
+ const clickgo = require("clickgo");
4
+ class default_1 extends clickgo.form.AbstractForm {
5
+ constructor() {
6
+ super(...arguments);
7
+ this.message = 'message';
8
+ this.buttons = ['OK'];
9
+ this.btn = 'none';
10
+ }
11
+ }
12
+ exports.default = default_1;
@@ -11,6 +11,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const clickgo = require("clickgo");
13
13
  const form_1 = require("./control/form/form");
14
+ const dialog_1 = require("./control/dialog/dialog");
15
+ const form_2 = require("./method/form/form");
16
+ const aform_1 = require("./method/aform/aform");
14
17
  class default_1 extends clickgo.form.AbstractForm {
15
18
  constructor() {
16
19
  super(...arguments);
@@ -20,10 +23,26 @@ class default_1 extends clickgo.form.AbstractForm {
20
23
  return __awaiter(this, void 0, void 0, function* () {
21
24
  let frm = 0;
22
25
  switch (name) {
26
+ case 'cblock': {
27
+ frm = yield this.createForm('control/block/block');
28
+ break;
29
+ }
23
30
  case 'cform': {
24
31
  frm = yield form_1.default.create();
25
32
  break;
26
33
  }
34
+ case 'cdialog': {
35
+ frm = yield dialog_1.default.create();
36
+ break;
37
+ }
38
+ case 'mform': {
39
+ frm = yield form_2.default.create();
40
+ break;
41
+ }
42
+ case 'aform': {
43
+ frm = yield aform_1.default.create();
44
+ break;
45
+ }
27
46
  }
28
47
  if (typeof frm === 'number') {
29
48
  return;
@@ -11,9 +11,9 @@
11
11
  <button @click="openForm('control', 'tab')">Tab</button>
12
12
  <button @click="openForm('control', 'label')">Label</button>
13
13
  <button @click="openForm('control', 'loading')">Loading</button>
14
- <button @click="openForm('control', 'dialog')">Dialog</button>
14
+ <button @click="openForm('cdialog')">Dialog</button>
15
15
  <button @click="openForm('control', 'file')">File</button>
16
- <button @click="openForm('control', 'block')">Block</button>
16
+ <button @click="openForm('cblock')">Block</button>
17
17
  <button @click="openForm('control', 'overflow')">Overflow</button>
18
18
  <button @click="openForm('control', 'view')">View</button>
19
19
  <button @click="openForm('control', 'greatview')">Greatview</button>
@@ -30,12 +30,13 @@
30
30
  <layout class="buttons" gutter="10" direction="v">
31
31
  <button @click="openForm('method', 'core')">Library core</button>
32
32
  <button @click="openForm('method', 'dom')">Library dom</button>
33
- <button @click="openForm('method', 'form')">Library form</button>
33
+ <button @click="openForm('mform')">Library form</button>
34
34
  <button @click="openForm('method', 'fs')">Library fs</button>
35
35
  <button @click="openForm('method', 'task')">Library task</button>
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>
@@ -9,76 +9,70 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.mounted = exports.receive = exports.methods = exports.data = void 0;
13
12
  const clickgo = require("clickgo");
14
- exports.data = {
15
- 'fid': '0',
16
- 'sendValue': 'sendValue',
17
- 'tid': '0',
18
- 'type': 'primary',
19
- 'progress': 'noraml',
20
- 'dialogResult': '',
21
- 'setTopMostValue': false
22
- };
23
- exports.methods = {
24
- min: function () {
25
- clickgo.form.min();
26
- },
27
- max: function () {
28
- clickgo.form.max();
29
- },
30
- close: function () {
31
- clickgo.form.close();
32
- },
33
- bindResize: function (e) {
13
+ class default_1 extends clickgo.form.AbstractForm {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.fid = '0';
17
+ this.tid = '0';
18
+ this.type = 'primary';
19
+ this.progress = 'noraml';
20
+ this.dr = '';
21
+ this.setTopMostValue = false;
22
+ }
23
+ min() {
24
+ clickgo.form.min(this.formId);
25
+ }
26
+ max() {
27
+ clickgo.form.max(this.formId);
28
+ }
29
+ close() {
30
+ clickgo.form.close(this.formId);
31
+ }
32
+ bindResize(e) {
34
33
  clickgo.form.bindResize(e, 'rb');
35
- },
36
- bindDrag: function (e) {
34
+ }
35
+ bindDrag(e) {
37
36
  clickgo.form.bindDrag(e);
38
- },
39
- getTaskId: function () {
37
+ }
38
+ getTaskId() {
40
39
  clickgo.form.dialog(clickgo.form.getTaskId(parseInt(this.fid)).toString()).catch((e) => { throw e; });
41
- },
42
- get: function () {
40
+ }
41
+ get() {
43
42
  clickgo.form.dialog(JSON.stringify(clickgo.form.get(parseInt(this.fid)))).catch((e) => { throw e; });
44
- },
45
- send: function () {
46
- clickgo.form.send(parseInt(this.fid), {
47
- 'key': this.sendValue
48
- });
49
- },
50
- changeFocus: function () {
43
+ }
44
+ changeFocus() {
51
45
  clickgo.form.changeFocus(parseInt(this.fid));
52
- },
53
- getList: function () {
46
+ }
47
+ getList() {
54
48
  let str = JSON.stringify(clickgo.form.getList(this.taskId));
55
49
  str = str.replace(/"icon":"(.*?)"/g, function (t, t1) {
56
50
  return `"icon":"${t1 ? (t1.slice(0, 10) + '...') : t1}"`;
57
51
  });
58
52
  clickgo.form.dialog(`<overflow direction="v" style="width: 200px; height: 80px;">${str}</overflow>`).catch((e) => { throw e; });
59
- },
60
- getMaxZIndexID: function () {
53
+ }
54
+ getMaxZIndexID() {
61
55
  const fid = clickgo.form.getMaxZIndexID();
62
56
  clickgo.form.dialog(JSON.stringify(fid)).catch((e) => { throw e; });
63
- },
64
- getRectByBorder: function () {
57
+ }
58
+ getRectByBorder() {
65
59
  const size = clickgo.form.getRectByBorder('rb');
66
60
  clickgo.form.dialog(JSON.stringify(size)).catch((e) => { throw e; });
67
- },
68
- showCircular: function (e) {
61
+ }
62
+ showCircular(e) {
69
63
  clickgo.form.showCircular(e.clientX, e.clientY);
70
- },
71
- showRectangle: function (e) {
64
+ }
65
+ showRectangle(e) {
72
66
  return __awaiter(this, void 0, void 0, function* () {
73
67
  clickgo.form.showRectangle(e.clientX, e.clientY, 'rb');
74
68
  yield clickgo.tool.sleep(1000);
75
69
  clickgo.form.hideRectangle();
76
70
  });
77
- },
78
- showDrag: function () {
71
+ }
72
+ showDrag() {
79
73
  return __awaiter(this, void 0, void 0, function* () {
80
74
  clickgo.form.showDrag();
81
- const rect = this.$refs.showDrag.$el.getBoundingClientRect();
75
+ const rect = this.refs.showDrag.$el.getBoundingClientRect();
82
76
  clickgo.form.moveDrag({
83
77
  'left': rect.left,
84
78
  'top': rect.top,
@@ -88,8 +82,8 @@ exports.methods = {
88
82
  yield clickgo.tool.sleep(1000);
89
83
  clickgo.form.hideDrag();
90
84
  });
91
- },
92
- notify: function () {
85
+ }
86
+ notify() {
93
87
  return __awaiter(this, void 0, void 0, function* () {
94
88
  let icon = null;
95
89
  if (this.progress === 'progress + icon') {
@@ -117,56 +111,51 @@ exports.methods = {
117
111
  clickgo.form.notifyProgress(nid, 100);
118
112
  }
119
113
  });
120
- },
121
- showPop: function (e) {
114
+ }
115
+ showPop(e) {
122
116
  if (!e.currentTarget) {
123
117
  return;
124
118
  }
125
- clickgo.form.showPop(e.currentTarget, this.$refs.pop, 'v');
126
- },
127
- createParam: function () {
128
- clickgo.form.create({
129
- 'layout': '<form width=\'300\' height=\'300\' title=\'normal\'></form>'
130
- }).catch((e) => { throw e; });
131
- },
132
- createPath: function () {
133
- clickgo.form.create('test').then((e) => { console.log(e); }).catch((e) => { throw e; });
134
- },
135
- createTop: function () {
136
- clickgo.form.create({
137
- 'layout': '<form width=\'300\' height=\'300\' title=\'normal\'></form>',
138
- 'topMost': true
139
- }).catch((e) => { throw e; });
140
- },
141
- dialog: function () {
119
+ clickgo.form.showPop(e.currentTarget, this.refs.pop, 'v');
120
+ }
121
+ createTop() {
142
122
  return __awaiter(this, void 0, void 0, function* () {
143
- this.dialogResult = yield clickgo.form.dialog('Hello world!');
123
+ const frm = yield this.createForm('test');
124
+ if (typeof frm === 'number') {
125
+ return;
126
+ }
127
+ frm.topMost = true;
144
128
  });
145
- },
146
- dialogLong: function () {
129
+ }
130
+ dialog() {
147
131
  return __awaiter(this, void 0, void 0, function* () {
148
- this.dialogResult = yield clickgo.form.dialog('longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong');
132
+ this.dr = yield clickgo.form.dialog('Hello world!');
149
133
  });
150
- },
151
- dialogTitle: function () {
134
+ }
135
+ dialogLong() {
136
+ return __awaiter(this, void 0, void 0, function* () {
137
+ this.dr = yield clickgo.form.dialog('longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong');
138
+ });
139
+ }
140
+ dialogTitle() {
152
141
  return __awaiter(this, void 0, void 0, function* () {
153
- this.dialogResult = yield clickgo.form.dialog({
142
+ this.dr = yield clickgo.form.dialog({
154
143
  'title': 'Title',
155
144
  'content': 'Hello world!'
156
145
  });
157
146
  });
158
- },
159
- dialogButtons: function () {
147
+ }
148
+ dialogButtons() {
160
149
  return __awaiter(this, void 0, void 0, function* () {
161
- this.dialogResult = yield clickgo.form.dialog({
150
+ this.dr = yield clickgo.form.dialog({
162
151
  'content': 'Hello world!',
163
152
  'buttons': ['A', 'B', 'C']
164
153
  });
165
154
  });
166
- },
167
- dialogCannot: function () {
155
+ }
156
+ dialogCannot() {
168
157
  return __awaiter(this, void 0, void 0, function* () {
169
- this.dialogResult = yield clickgo.form.dialog({
158
+ this.dr = yield clickgo.form.dialog({
170
159
  'content': 'Hello world!',
171
160
  'buttons': ['Do not close', 'Close'],
172
161
  'select': (e, button) => {
@@ -176,42 +165,37 @@ exports.methods = {
176
165
  }
177
166
  });
178
167
  });
179
- },
180
- confirm: function (cancel) {
168
+ }
169
+ confirm(cancel) {
181
170
  return __awaiter(this, void 0, void 0, function* () {
182
- this.dialogResult = yield clickgo.form.confirm({
171
+ this.dr = yield clickgo.form.confirm({
183
172
  'content': 'Hello world?',
184
173
  'cancel': cancel
185
174
  });
186
- if (typeof this.dialogResult === 'boolean') {
187
- this.dialogResult = this.dialogResult ? 'true (boolean)' : 'false (boolean)';
175
+ if (typeof this.dr === 'boolean') {
176
+ this.dr = this.dr ? 'true (boolean)' : 'false (boolean)';
188
177
  }
189
178
  else {
190
- this.dialogResult = this.dialogResult.toString() + ' (number)';
179
+ this.dr = this.dr.toString() + ' (number)';
191
180
  }
192
181
  });
193
- },
194
- setTopMost: function () {
182
+ }
183
+ setTopMost() {
195
184
  this.setTopMostValue = !this.setTopMostValue;
196
- clickgo.form.setTopMost(this.setTopMostValue);
197
- },
198
- flash: function () {
199
- clickgo.form.flash();
200
- },
201
- hide: function () {
202
- return __awaiter(this, void 0, void 0, function* () {
203
- clickgo.form.hide();
204
- yield clickgo.tool.sleep(1000);
205
- clickgo.form.show();
206
- });
185
+ this.topMost = this.setTopMostValue;
207
186
  }
208
- };
209
- const receive = function (obj) {
210
- clickgo.form.dialog(JSON.stringify(obj)).catch((e) => { throw e; });
211
- };
212
- exports.receive = receive;
213
- const mounted = function () {
214
- this.fid = this.formId;
215
- this.tid = this.taskId;
216
- };
217
- exports.mounted = mounted;
187
+ flash() {
188
+ clickgo.form.flash(this.formId);
189
+ }
190
+ showLauncher() {
191
+ clickgo.form.showLauncher();
192
+ }
193
+ onReceive(obj) {
194
+ clickgo.form.dialog(JSON.stringify(obj)).catch((e) => { throw e; });
195
+ }
196
+ onMounted() {
197
+ this.fid = this.formId.toString();
198
+ this.tid = this.taskId.toString();
199
+ }
200
+ }
201
+ exports.default = default_1;
@@ -1,28 +1,24 @@
1
- <form width="350" height="400" title="Library form" padding="10">
2
- <overflow direction="v" style="flex: 1;">
1
+ <form width="350" height="400" title="Library form">
2
+ <overflow direction="v" style="flex: 1; padding: 10px;">
3
3
  <layout gutter="10" direction="v" style="flex: 1;">
4
- <button @click="min" style="height: 30px;">min()</button>
5
- <button @click="max" style="height: 30px;">max()</button>
6
- <button @click="close" style="height: 30px;">close()</button>
4
+ <label>This form id: {{formId}}</label>
5
+ <button @click="min" style="height: 30px;">min({{formId}})</button>
6
+ <button @click="max" style="height: 30px;">max({{formId}})</button>
7
+ <button @click="close" style="height: 30px;">close({{formId}})</button>
7
8
  <label @mousedown="bindResize" @touchstart="bindResize" style="padding: 20px; background: rgba(0, 0, 0, .1); cursor: se-resize;">bindResize(e, 'rb')</label>
8
- <label @mousedown="bindDrag" @touchstart="bindDrag" style="padding: 20px; background: rgba(0, 0, 0, .1);">bindDrag(e)</label>
9
+ <label @mousedown="bindDrag" @touchstart="bindDrag" style="padding: 20px; background: rgba(0, 0, 0, .1); cursor: move;">bindDrag(e)</label>
9
10
  <layout gutter="10" align-v="center">
10
11
  <label>Form ID:</label>
11
12
  <text v-model="fid" style="flex: 1; width: 0; height: 30px;"></text>
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,14 +29,11 @@
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="createParam" style="height: 30px;">create({'layout':'xxx'})</button>
41
- <button @click="createPath" style="height: 30px;">create('test')</button>
42
- <button @click="createTop" style="height: 30px;">create({'layout':'xxx','topMost':true})</button>
43
- <label>Dialog result: {{dialogResult}}.</label>
36
+ <label>Dialog result: {{dr}}.</label>
44
37
  <button @click="dialog" style="height: 30px;">dialog('Hello world!')</button>
45
38
  <button @click="dialogLong">dialog('long...')</button>
46
39
  <button @click="dialogTitle" style="height: 30px;">dialog({'title':'Title','content':'Hello world!'})</button>
@@ -48,9 +41,8 @@
48
41
  <button @click="dialogCannot" style="height: 30px;">Dialog can not be close</button>
49
42
  <button @click="confirm(false)" style="height: 30px;">confirm('confirm')</button>
50
43
  <button @click="confirm(true)" style="height: 30px;">confirm({'content':'confirm','cancel':true})</button>
51
- <button @click="setTopMost" style="height: 30px;">setTopMost({{setTopMostValue ? 'false' : 'true'}})</button>
52
- <button @click="flash" style="height: 30px;">flash()</button>
53
- <button @click="hide" style="height: 30px;">hide() and show()</button>
44
+ <button @click="flash" style="height: 30px;">flash({{formId}})</button>
45
+ <button @click="showLauncher" style="height: 30px;">showLauncher()</button>
54
46
  </layout>
55
47
  </overflow>
56
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