clickgo 3.16.19 → 3.16.20

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 CHANGED
@@ -25,7 +25,7 @@ Load the module loader first, and then load it using the module loader.
25
25
  **index.html**
26
26
 
27
27
  ```html
28
- <script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.8/dist/loader.min.js?path=index&npm={'clickgo':'3.16.19'}"></script>
28
+ <script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.8/dist/loader.min.js?path=index&npm={'clickgo':'3.16.20'}"></script>
29
29
  ```
30
30
 
31
31
  **index.js**
@@ -112,5 +112,17 @@ class default_1 extends clickgo.form.AbstractForm {
112
112
  yield clickgo.form.dialog(JSON.stringify(rtn));
113
113
  });
114
114
  }
115
+ dialog(opts) {
116
+ return __awaiter(this, void 0, void 0, function* () {
117
+ const rtn = yield clickgo.native.dialog({
118
+ 'title': opts.title,
119
+ 'message': opts.message,
120
+ 'type': opts.type,
121
+ 'detail': opts.detail,
122
+ 'buttons': opts.buttons,
123
+ });
124
+ yield clickgo.form.dialog(JSON.stringify(rtn));
125
+ });
126
+ }
115
127
  }
116
128
  exports.default = default_1;
@@ -11,5 +11,12 @@
11
11
  <button @click="isMax">isMax</button>
12
12
  <button @click="open">open</button>
13
13
  <button @click="save">save</button>
14
+ <label>dialog:</label>
15
+ <layout gutter="10">
16
+ <button @click="dialog({'message':'test'})" style="flex: 1">default</button>
17
+ <button @click="dialog({'message':'info','type':'info'})" style="flex: 1">info</button>
18
+ <button @click="dialog({'message':'question','type':'question','detail':'detail'})" style="flex: 1">question</button>
19
+ <button @click="dialog({'message':'warning','type':'warning','title':'custom','buttons':['Yes','No']})" style="flex: 1">warning</button>
20
+ </layout>
14
21
  </layout>
15
22
  </form>
package/dist/clickgo.js CHANGED
@@ -39,7 +39,7 @@ exports.isNative = isNative;
39
39
  exports.getPlatform = getPlatform;
40
40
  exports.isImmersion = isImmersion;
41
41
  exports.hasFrame = hasFrame;
42
- const version = '3.16.18';
42
+ const version = '3.16.20';
43
43
  function getVersion() {
44
44
  return version;
45
45
  }
@@ -32,5 +32,12 @@ export declare function save(options?: {
32
32
  'accept': string[];
33
33
  }>;
34
34
  }): Promise<string | null>;
35
+ export declare function dialog(options?: string | {
36
+ 'type'?: 'info' | 'error' | 'question' | 'warning';
37
+ 'title'?: string;
38
+ 'message'?: string;
39
+ 'detail'?: string;
40
+ 'buttons'?: string[];
41
+ }): Promise<number>;
35
42
  export declare function ping(val: string): Promise<string>;
36
43
  export declare function isMax(): Promise<boolean>;
@@ -59,6 +59,7 @@ exports.close = close;
59
59
  exports.maximizable = maximizable;
60
60
  exports.open = open;
61
61
  exports.save = save;
62
+ exports.dialog = dialog;
62
63
  exports.ping = ping;
63
64
  exports.isMax = isMax;
64
65
  const clickgo = __importStar(require("../clickgo"));
@@ -212,6 +213,9 @@ function open(options = {}) {
212
213
  function save(options = {}) {
213
214
  return invoke('cg-form-save', token, options);
214
215
  }
216
+ function dialog(options = {}) {
217
+ return invoke('cg-form-dialog', token, options);
218
+ }
215
219
  function ping(val) {
216
220
  return __awaiter(this, void 0, void 0, function* () {
217
221
  return invoke('cg-ping', val);
package/dist/lib/task.js CHANGED
@@ -854,18 +854,39 @@ function run(url_1) {
854
854
  yield native.maximizable(val);
855
855
  });
856
856
  },
857
+ open: function (options) {
858
+ return __awaiter(this, void 0, void 0, function* () {
859
+ const rtn = yield checkPermission('native.form', false, undefined, taskId);
860
+ if (!rtn[0]) {
861
+ return null;
862
+ }
863
+ return native.open(options);
864
+ });
865
+ },
866
+ save: function (options) {
867
+ return __awaiter(this, void 0, void 0, function* () {
868
+ const rtn = yield checkPermission('native.form', false, undefined, taskId);
869
+ if (!rtn[0]) {
870
+ return null;
871
+ }
872
+ return native.save(options);
873
+ });
874
+ },
875
+ dialog: function (options) {
876
+ return __awaiter(this, void 0, void 0, function* () {
877
+ const rtn = yield checkPermission('native.form', false, undefined, taskId);
878
+ if (!rtn[0]) {
879
+ return -1;
880
+ }
881
+ return native.dialog(options);
882
+ });
883
+ },
857
884
  ping: function (val) {
858
885
  return native.ping(val);
859
886
  },
860
887
  isMax: function () {
861
888
  return native.isMax();
862
889
  },
863
- open: function (options) {
864
- return native.open(options);
865
- },
866
- save: function (options) {
867
- return native.save(options);
868
- },
869
890
  },
870
891
  'storage': {
871
892
  get: function (key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clickgo",
3
- "version": "3.16.19",
3
+ "version": "3.16.20",
4
4
  "description": "Background interface, software interface, mobile phone APP interface operation library.",
5
5
  "keywords": [
6
6
  "deskrt",