clickgo 3.1.10-beta → 3.1.11-beta2
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/form/control/nav/nav.js +2 -2
- package/dist/app/demo/form/control/nav/nav.xml +9 -3
- package/dist/app/demo/form/method/core/core.js +5 -0
- package/dist/app/demo/form/method/core/core.xml +1 -0
- package/dist/control/nav.cgc +0 -0
- package/dist/lib/core.js +6 -2
- package/dist/lib/core.ts +8 -1
- package/dist/lib/task.js +4 -1
- package/dist/lib/task.ts +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Load the module loader first, and then load it using the module loader.
|
|
|
28
28
|
**index.html**
|
|
29
29
|
|
|
30
30
|
```html
|
|
31
|
-
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.4.9/dist/loader.min.js?path=index&npm={'clickgo':'3.1.
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.4.9/dist/loader.min.js?path=index&npm={'clickgo':'3.1.11-beta2'}"></script>
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
**index.js**
|
|
@@ -37,12 +37,12 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
37
37
|
constructor() {
|
|
38
38
|
super(...arguments);
|
|
39
39
|
this.layer = false;
|
|
40
|
-
this.
|
|
40
|
+
this.name = '';
|
|
41
41
|
this.isShow = false;
|
|
42
42
|
this.loading = false;
|
|
43
43
|
}
|
|
44
44
|
onMounted() {
|
|
45
|
-
this.watch('
|
|
45
|
+
this.watch('name', () => __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
this.loading = true;
|
|
47
47
|
yield clickgo.tool.sleep(300);
|
|
48
48
|
this.loading = false;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<form width="600" height="500" title="Nav" :loading="loading">
|
|
2
|
-
<nav v-model="
|
|
2
|
+
<nav v-model="name" v-model:show="isShow" @layer="layer = $event" style="flex: 1; width: 0;">
|
|
3
3
|
<nav-item label="Title1">
|
|
4
4
|
<nav-title>group1</nav-title>
|
|
5
5
|
<nav-item label="Sub1">
|
|
@@ -29,14 +29,20 @@
|
|
|
29
29
|
<nav-item label="Action11"></nav-item>
|
|
30
30
|
<nav-item label="Action12"></nav-item>
|
|
31
31
|
</nav-item>
|
|
32
|
+
<nav-item label="中文">
|
|
33
|
+
<nav-item label="中文1"></nav-item>
|
|
34
|
+
<nav-item label="中文2"></nav-item>
|
|
35
|
+
<nav-item label="有 name" name="hasname"></nav-item>
|
|
36
|
+
</nav-item>
|
|
32
37
|
</nav-item>
|
|
33
38
|
<template v-slot:content>
|
|
34
39
|
<layout direction="v" gutter="10" style="padding: 10px; flex: 1;">
|
|
35
40
|
<label>Change the size of the form to see the effect.</label>
|
|
36
|
-
<label>Now select: {{
|
|
41
|
+
<label>Now select: {{name}}</label>
|
|
37
42
|
<label>Layer show: {{isShow ? 'true' : 'false'}}</label>
|
|
38
43
|
<button v-if="layer" @click="isShow = true" style="height: 30px;">Open</button>
|
|
39
|
-
<button @click="
|
|
44
|
+
<button @click="name = 'Action11'" style="height: 30px;">Select "Action11"</button>
|
|
45
|
+
<button @click="name = 'hasname'" style="height: 30px;">Select "hasname"</button>
|
|
40
46
|
</layout>
|
|
41
47
|
</template>
|
|
42
48
|
</nav>
|
|
@@ -59,5 +59,10 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
59
59
|
yield clickgo.form.dialog('No permission.');
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
+
getHash() {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
yield clickgo.form.dialog('Hash is: ' + clickgo.core.getHash());
|
|
65
|
+
});
|
|
66
|
+
}
|
|
62
67
|
}
|
|
63
68
|
exports.default = default_1;
|
package/dist/control/nav.cgc
CHANGED
|
Binary file
|
package/dist/lib/core.js
CHANGED
|
@@ -32,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.hash = exports.getAvailArea = exports.fetchApp = exports.readApp = exports.trigger = exports.getModule = exports.regModule = exports.boot = exports.getCdn = exports.AbstractApp = exports.config = void 0;
|
|
35
|
+
exports.getHash = exports.hash = exports.getAvailArea = exports.fetchApp = exports.readApp = exports.trigger = exports.getModule = exports.regModule = exports.boot = exports.getCdn = exports.AbstractApp = exports.config = void 0;
|
|
36
36
|
const clickgo = __importStar(require("../clickgo"));
|
|
37
37
|
const fs = __importStar(require("./fs"));
|
|
38
38
|
const form = __importStar(require("./form"));
|
|
@@ -680,6 +680,10 @@ function hash(hash, taskId) {
|
|
|
680
680
|
return true;
|
|
681
681
|
}
|
|
682
682
|
exports.hash = hash;
|
|
683
|
+
function getHash() {
|
|
684
|
+
return window.location.hash ? decodeURIComponent(window.location.hash.slice(1)) : '';
|
|
685
|
+
}
|
|
686
|
+
exports.getHash = getHash;
|
|
683
687
|
window.addEventListener('hashchange', function () {
|
|
684
|
-
trigger('hashChanged', window.location.hash ? window.location.hash.slice(1) : '');
|
|
688
|
+
trigger('hashChanged', window.location.hash ? decodeURIComponent(window.location.hash.slice(1)) : '');
|
|
685
689
|
});
|
package/dist/lib/core.ts
CHANGED
|
@@ -786,6 +786,13 @@ export function hash(hash: string, taskId?: number): boolean {
|
|
|
786
786
|
return true;
|
|
787
787
|
}
|
|
788
788
|
|
|
789
|
+
/**
|
|
790
|
+
* --- 获取当前浏览器的 hash ---
|
|
791
|
+
*/
|
|
792
|
+
export function getHash(): string {
|
|
793
|
+
return window.location.hash ? decodeURIComponent(window.location.hash.slice(1)) : '';
|
|
794
|
+
}
|
|
795
|
+
|
|
789
796
|
window.addEventListener('hashchange', function() {
|
|
790
|
-
trigger('hashChanged', window.location.hash ? window.location.hash.slice(1) : '');
|
|
797
|
+
trigger('hashChanged', window.location.hash ? decodeURIComponent(window.location.hash.slice(1)) : '');
|
|
791
798
|
});
|
package/dist/lib/task.js
CHANGED
|
@@ -236,7 +236,7 @@ function run(url, opt = {}, ntid) {
|
|
|
236
236
|
const unblock = opt.unblock ? tool.clone(opt.unblock) : [];
|
|
237
237
|
const unblockSys = [
|
|
238
238
|
'require',
|
|
239
|
-
'__awaiter', 'eval', 'Math', 'Array', 'Blob', 'Error', 'Infinity', 'parseInt', 'parseFloat', 'Promise', 'Date', 'JSON', 'fetch', 'Number', 'Object'
|
|
239
|
+
'__awaiter', 'eval', 'Math', 'Array', 'Blob', 'Error', 'Infinity', 'parseInt', 'parseFloat', 'Promise', 'Date', 'JSON', 'fetch', 'Number', 'Object', 'encodeURIComponent', 'decodeURIComponent'
|
|
240
240
|
];
|
|
241
241
|
for (const name of unblockSys) {
|
|
242
242
|
if (unblock.includes(name)) {
|
|
@@ -412,6 +412,9 @@ function run(url, opt = {}, ntid) {
|
|
|
412
412
|
},
|
|
413
413
|
hash: function (hash) {
|
|
414
414
|
return core.hash(hash, taskId);
|
|
415
|
+
},
|
|
416
|
+
getHash: function () {
|
|
417
|
+
return core.getHash();
|
|
415
418
|
}
|
|
416
419
|
},
|
|
417
420
|
'dom': {
|
package/dist/lib/task.ts
CHANGED
|
@@ -282,7 +282,7 @@ export async function run(url: string, opt: types.ITaskRunOptions = {}, ntid?: n
|
|
|
282
282
|
const unblock = opt.unblock ? tool.clone(opt.unblock) : [];
|
|
283
283
|
const unblockSys = [
|
|
284
284
|
'require',
|
|
285
|
-
'__awaiter', 'eval', 'Math', 'Array', 'Blob', 'Error', 'Infinity', 'parseInt', 'parseFloat', 'Promise', 'Date', 'JSON', 'fetch', 'Number', 'Object'
|
|
285
|
+
'__awaiter', 'eval', 'Math', 'Array', 'Blob', 'Error', 'Infinity', 'parseInt', 'parseFloat', 'Promise', 'Date', 'JSON', 'fetch', 'Number', 'Object', 'encodeURIComponent', 'decodeURIComponent'
|
|
286
286
|
];
|
|
287
287
|
for (const name of unblockSys) {
|
|
288
288
|
if (unblock.includes(name)) {
|
|
@@ -470,6 +470,9 @@ export async function run(url: string, opt: types.ITaskRunOptions = {}, ntid?: n
|
|
|
470
470
|
},
|
|
471
471
|
hash: function(hash: string): boolean {
|
|
472
472
|
return core.hash(hash, taskId);
|
|
473
|
+
},
|
|
474
|
+
getHash: function(): string {
|
|
475
|
+
return core.getHash();
|
|
473
476
|
}
|
|
474
477
|
},
|
|
475
478
|
'dom': {
|