clickgo 3.16.26 → 3.16.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/app/demo/app.js +4 -16
- package/dist/app/demo/config.json +4 -1
- package/dist/app/demo/form/control/arteditor/arteditor.js +7 -18
- package/dist/app/demo/form/control/button/button.js +2 -13
- package/dist/app/demo/form/control/check/check.js +3 -14
- package/dist/app/demo/form/control/content/content.js +3 -14
- package/dist/app/demo/form/control/daterange/daterange.js +1 -1
- package/dist/app/demo/form/control/delete/delete.js +3 -14
- package/dist/app/demo/form/control/dialog/dialog.js +2 -0
- package/dist/app/demo/form/control/dialog/dialog.xml +26 -12
- package/dist/app/demo/form/control/flow/flow.js +2 -13
- package/dist/app/demo/form/control/form/form.js +4 -15
- package/dist/app/demo/form/control/iconview/iconview.js +12 -29
- package/dist/app/demo/form/control/jodit/jodit.js +7 -18
- package/dist/app/demo/form/control/link/link.js +2 -13
- package/dist/app/demo/form/control/list/list.js +40 -52
- package/dist/app/demo/form/control/list/list.xml +20 -10
- package/dist/app/demo/form/control/map/map.js +17 -28
- package/dist/app/demo/form/control/menu/menu.js +6 -17
- package/dist/app/demo/form/control/mpegts/mpegts.js +1 -1
- package/dist/app/demo/form/control/nav/nav.js +6 -17
- package/dist/app/demo/form/control/novnc/novnc.js +75 -0
- package/dist/app/demo/form/control/novnc/novnc.xml +13 -0
- package/dist/app/demo/form/control/panel/panel.js +9 -20
- package/dist/app/demo/form/control/panel/test1.js +20 -41
- package/dist/app/demo/form/control/pdf/pdf.js +7 -20
- package/dist/app/demo/form/control/progress/progress.js +3 -12
- package/dist/app/demo/form/control/radio/radio.js +6 -17
- package/dist/app/demo/form/control/select/select.js +28 -41
- package/dist/app/demo/form/control/switch/switch.js +3 -14
- package/dist/app/demo/form/control/tab/tab.js +7 -18
- package/dist/app/demo/form/control/table/table.js +8 -23
- package/dist/app/demo/form/control/text/text.js +2 -13
- package/dist/app/demo/form/control/tuieditor/tuieditor.js +7 -18
- package/dist/app/demo/form/control/uploader/uploader.js +20 -31
- package/dist/app/demo/form/control/vflow/vflow.js +2 -13
- package/dist/app/demo/form/event/form/form.js +11 -22
- package/dist/app/demo/form/event/task/task.js +14 -29
- package/dist/app/demo/form/main.js +381 -387
- package/dist/app/demo/form/main.xml +3 -0
- package/dist/app/demo/form/method/acontrol/acontrol.js +2 -13
- package/dist/app/demo/form/method/aform/aform.js +41 -60
- package/dist/app/demo/form/method/aform/sd.js +3 -14
- package/dist/app/demo/form/method/core/core.js +25 -50
- package/dist/app/demo/form/method/dom/dom.js +35 -58
- package/dist/app/demo/form/method/form/form.js +106 -149
- package/dist/app/demo/form/method/fs/fs.js +126 -147
- package/dist/app/demo/form/method/native/native.js +44 -72
- package/dist/app/demo/form/method/storage/storage.js +9 -27
- package/dist/app/demo/form/method/system/system.js +16 -41
- package/dist/app/demo/form/method/task/task.js +18 -37
- package/dist/app/demo/form/method/theme/theme.js +39 -54
- package/dist/app/demo/form/method/tool/tool.js +22 -43
- package/dist/app/demo/form/method/tool/tool.xml +1 -1
- package/dist/app/demo/form/method/zip/zip.js +18 -29
- package/dist/app/demo/form/solution/backpanel/backpanel.js +10 -23
- package/dist/app/task/app.js +2 -13
- package/dist/app/task/form/bar/bar.js +32 -45
- package/dist/clickgo.js +1 -1
- package/dist/control/arteditor.cgc +0 -0
- package/dist/control/box.cgc +0 -0
- package/dist/control/captcha.cgc +0 -0
- package/dist/control/common.cgc +0 -0
- package/dist/control/desc.cgc +0 -0
- package/dist/control/drawer.cgc +0 -0
- package/dist/control/echarts.cgc +0 -0
- package/dist/control/form.cgc +0 -0
- package/dist/control/iconview.cgc +0 -0
- package/dist/control/jodit.cgc +0 -0
- package/dist/control/map.cgc +0 -0
- package/dist/control/monaco.cgc +0 -0
- package/dist/control/mpegts.cgc +0 -0
- package/dist/control/nav.cgc +0 -0
- package/dist/control/novnc.cgc +0 -0
- package/dist/control/page.cgc +0 -0
- package/dist/control/pdf.cgc +0 -0
- package/dist/control/property.cgc +0 -0
- package/dist/control/qrcode.cgc +0 -0
- package/dist/control/table.cgc +0 -0
- package/dist/control/task.cgc +0 -0
- package/dist/control/tplink.cgc +0 -0
- package/dist/control/tuieditor.cgc +0 -0
- package/dist/control/tuiviewer.cgc +0 -0
- package/dist/control/xterm.cgc +0 -0
- package/dist/index.js +59 -71
- package/dist/lib/control.js +213 -235
- package/dist/lib/core.js +356 -379
- package/dist/lib/dom.js +62 -91
- package/dist/lib/form.js +834 -906
- package/dist/lib/fs.js +834 -892
- package/dist/lib/native.js +32 -63
- package/dist/lib/storage.js +21 -33
- package/dist/lib/task.js +1054 -1098
- package/dist/lib/theme.js +102 -121
- package/dist/lib/tool.js +65 -98
- package/dist/lib/zip.js +27 -42
- package/dist/theme/blue.cgt +0 -0
- package/dist/theme/byterun.cgt +0 -0
- package/dist/theme/dark.cgt +0 -0
- package/dist/theme/light.cgt +0 -0
- package/package.json +1 -1
package/dist/lib/native.js
CHANGED
|
@@ -32,15 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
36
|
exports.getToken = getToken;
|
|
46
37
|
exports.on = on;
|
|
@@ -158,54 +149,36 @@ function getListenerList(taskId) {
|
|
|
158
149
|
}
|
|
159
150
|
return rtn;
|
|
160
151
|
}
|
|
161
|
-
function invoke(name, ...param) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
return window.clickgoNative.invoke(name, ...param);
|
|
167
|
-
});
|
|
152
|
+
async function invoke(name, ...param) {
|
|
153
|
+
if (!clickgo.isNative()) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
return window.clickgoNative.invoke(name, ...param);
|
|
168
157
|
}
|
|
169
158
|
invoke('cg-init', token);
|
|
170
|
-
function quit() {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
function
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
function activate() {
|
|
196
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
197
|
-
yield invoke('cg-activate', token);
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
function close() {
|
|
201
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
202
|
-
yield invoke('cg-close', token);
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
function maximizable(val) {
|
|
206
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
207
|
-
yield invoke('cg-maximizable', token, val);
|
|
208
|
-
});
|
|
159
|
+
async function quit() {
|
|
160
|
+
await invoke('cg-quit', token);
|
|
161
|
+
}
|
|
162
|
+
async function size(width, height) {
|
|
163
|
+
await invoke('cg-set-size', token, width, height);
|
|
164
|
+
}
|
|
165
|
+
async function max() {
|
|
166
|
+
await invoke('cg-set-state', token, 'max');
|
|
167
|
+
}
|
|
168
|
+
async function min() {
|
|
169
|
+
await invoke('cg-set-state', token, 'min');
|
|
170
|
+
}
|
|
171
|
+
async function restore() {
|
|
172
|
+
await invoke('cg-set-state', token, 'restore');
|
|
173
|
+
}
|
|
174
|
+
async function activate() {
|
|
175
|
+
await invoke('cg-activate', token);
|
|
176
|
+
}
|
|
177
|
+
async function close() {
|
|
178
|
+
await invoke('cg-close', token);
|
|
179
|
+
}
|
|
180
|
+
async function maximizable(val) {
|
|
181
|
+
await invoke('cg-maximizable', token, val);
|
|
209
182
|
}
|
|
210
183
|
function open(options = {}) {
|
|
211
184
|
return invoke('cg-form-open', token, options);
|
|
@@ -216,13 +189,9 @@ function save(options = {}) {
|
|
|
216
189
|
function dialog(options = {}) {
|
|
217
190
|
return invoke('cg-form-dialog', token, options);
|
|
218
191
|
}
|
|
219
|
-
function ping(val) {
|
|
220
|
-
return
|
|
221
|
-
return invoke('cg-ping', val);
|
|
222
|
-
});
|
|
192
|
+
async function ping(val) {
|
|
193
|
+
return invoke('cg-ping', val);
|
|
223
194
|
}
|
|
224
|
-
function isMax() {
|
|
225
|
-
return
|
|
226
|
-
return invoke('cg-is-max');
|
|
227
|
-
});
|
|
195
|
+
async function isMax() {
|
|
196
|
+
return invoke('cg-is-max');
|
|
228
197
|
}
|
package/dist/lib/storage.js
CHANGED
|
@@ -32,15 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
36
|
exports.get = get;
|
|
46
37
|
exports.set = set;
|
|
@@ -106,7 +97,7 @@ function get(key, taskId) {
|
|
|
106
97
|
try {
|
|
107
98
|
return JSON.parse(v);
|
|
108
99
|
}
|
|
109
|
-
catch
|
|
100
|
+
catch {
|
|
110
101
|
return null;
|
|
111
102
|
}
|
|
112
103
|
}
|
|
@@ -188,7 +179,7 @@ function all() {
|
|
|
188
179
|
const rtn = {};
|
|
189
180
|
for (let i = 0; i < localStorage.length; i++) {
|
|
190
181
|
const key = localStorage.key(i);
|
|
191
|
-
if (!
|
|
182
|
+
if (!key?.startsWith('clickgo-size-')) {
|
|
192
183
|
continue;
|
|
193
184
|
}
|
|
194
185
|
const sizes = localStorage.getItem(key);
|
|
@@ -201,27 +192,24 @@ function all() {
|
|
|
201
192
|
}
|
|
202
193
|
return rtn;
|
|
203
194
|
}
|
|
204
|
-
function clear(path) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
if (!(key === null || key === void 0 ? void 0 : key.startsWith(pre))) {
|
|
220
|
-
continue;
|
|
221
|
-
}
|
|
222
|
-
localStorage.removeItem(key);
|
|
223
|
-
++count;
|
|
195
|
+
async function clear(path) {
|
|
196
|
+
if (!path) {
|
|
197
|
+
return 0;
|
|
198
|
+
}
|
|
199
|
+
const loc = localeData[core.config.locale]?.['sure-clear'] ?? localeData['en']['sure-clear'];
|
|
200
|
+
if (!await form.superConfirm(loc.replace('?', tool.escapeHTML(path)))) {
|
|
201
|
+
return 0;
|
|
202
|
+
}
|
|
203
|
+
let count = 0;
|
|
204
|
+
localStorage.removeItem('clickgo-size-' + path);
|
|
205
|
+
const pre = 'clickgo-item-' + path + '-';
|
|
206
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
207
|
+
const key = localStorage.key(i);
|
|
208
|
+
if (!key?.startsWith(pre)) {
|
|
209
|
+
continue;
|
|
224
210
|
}
|
|
225
|
-
|
|
226
|
-
|
|
211
|
+
localStorage.removeItem(key);
|
|
212
|
+
++count;
|
|
213
|
+
}
|
|
214
|
+
return count;
|
|
227
215
|
}
|