clickgo 3.1.1-dev10 → 3.1.3-dev12

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.
Files changed (106) hide show
  1. package/dist/app/demo/app.js +0 -72
  2. package/dist/app/demo/config.json +109 -0
  3. package/dist/app/demo/form/control/button/button.js +12 -11
  4. package/dist/app/demo/form/control/button/button.xml +6 -6
  5. package/dist/app/demo/form/control/check/check.js +14 -10
  6. package/dist/app/demo/form/control/file/file.js +15 -13
  7. package/dist/app/demo/form/control/{overflow/overflow.css → flow/flow.css} +0 -0
  8. package/dist/app/demo/form/control/flow/flow.js +64 -0
  9. package/dist/app/demo/form/control/{overflow/overflow.scss → flow/flow.scss} +0 -0
  10. package/dist/app/demo/form/control/flow/flow.xml +101 -0
  11. package/dist/app/demo/form/control/form/form.js +1 -1
  12. package/dist/app/demo/form/control/form/form.xml +3 -3
  13. package/dist/app/demo/form/control/img/img.xml +2 -2
  14. package/dist/app/demo/form/control/list/list.js +95 -75
  15. package/dist/app/demo/form/control/list/list.xml +15 -11
  16. package/dist/app/demo/form/control/marquee/marquee.js +12 -10
  17. package/dist/app/demo/form/control/menu/menu.js +10 -6
  18. package/dist/app/demo/form/control/monaco/monaco.js +50 -60
  19. package/dist/app/demo/form/control/monaco/monaco.xml +6 -5
  20. package/dist/app/demo/form/control/property/property.js +131 -127
  21. package/dist/app/demo/form/control/radio/radio.js +9 -5
  22. package/dist/app/demo/form/control/scroll/scroll.js +16 -12
  23. package/dist/app/demo/form/control/scroll/scroll.xml +10 -10
  24. package/dist/app/demo/form/control/select/select.js +132 -71
  25. package/dist/app/demo/form/control/select/select.xml +69 -67
  26. package/dist/app/demo/form/control/tab/tab.js +21 -20
  27. package/dist/app/demo/form/control/tab/tab.xml +2 -2
  28. package/dist/app/demo/form/control/text/text.js +53 -45
  29. package/dist/app/demo/form/control/text/text.xml +3 -3
  30. package/dist/app/demo/form/control/{greatview/greatview.css → vflow/vflow.css} +0 -0
  31. package/dist/app/demo/form/control/vflow/vflow.js +79 -0
  32. package/dist/app/demo/form/control/{greatview/greatview.scss → vflow/vflow.scss} +0 -0
  33. package/dist/app/demo/form/control/{greatview/greatview.xml → vflow/vflow.xml} +25 -25
  34. package/dist/app/demo/form/event/form/form.js +58 -56
  35. package/dist/app/demo/form/event/form/form.xml +3 -3
  36. package/dist/app/demo/form/event/screen/screen.js +30 -28
  37. package/dist/app/demo/form/event/screen/screen.xml +2 -2
  38. package/dist/app/demo/form/event/task/task.js +31 -31
  39. package/dist/app/demo/form/event/task/task.xml +3 -3
  40. package/dist/app/demo/form/main.js +166 -5
  41. package/dist/app/demo/form/main.xml +37 -35
  42. package/dist/app/demo/form/method/aform/aform.js +57 -0
  43. package/dist/app/demo/form/method/aform/aform.xml +35 -0
  44. package/dist/app/demo/form/method/aform/test.xml +6 -0
  45. package/dist/app/demo/form/method/core/core.js +11 -8
  46. package/dist/app/demo/form/method/core/core.xml +2 -1
  47. package/dist/app/demo/form/method/dom/dom.js +91 -99
  48. package/dist/app/demo/form/method/dom/dom.xml +6 -7
  49. package/dist/app/demo/form/method/form/form.js +10 -28
  50. package/dist/app/demo/form/method/form/form.xml +8 -15
  51. package/dist/app/demo/form/method/fs/fs.js +34 -33
  52. package/dist/app/demo/form/method/fs/fs.xml +1 -1
  53. package/dist/app/demo/form/method/fs/text.js +12 -12
  54. package/dist/app/demo/form/method/native/native.js +50 -0
  55. package/dist/app/demo/form/method/native/native.xml +12 -0
  56. package/dist/app/demo/form/method/system/system.js +50 -0
  57. package/dist/app/demo/form/method/system/system.xml +11 -0
  58. package/dist/app/demo/form/method/task/task.js +59 -61
  59. package/dist/app/demo/form/method/task/task.xml +4 -6
  60. package/dist/app/demo/form/method/theme/theme.js +14 -14
  61. package/dist/app/demo/form/method/tool/tool.js +29 -28
  62. package/dist/app/demo/form/method/tool/tool.xml +3 -3
  63. package/dist/app/demo/form/method/zip/zip.js +46 -41
  64. package/dist/app/demo/form/method/zip/zip.xml +1 -1
  65. package/dist/app/task/app.js +0 -25
  66. package/dist/app/task/config.json +29 -0
  67. package/dist/app/task/form/bar/bar.js +2 -2
  68. package/dist/app/task/form/bar/bar.xml +1 -1
  69. package/dist/clickgo.js +17 -5
  70. package/dist/clickgo.ts +22 -3
  71. package/dist/control/common.cgc +0 -0
  72. package/dist/control/form.cgc +0 -0
  73. package/dist/control/monaco.cgc +0 -0
  74. package/dist/control/property.cgc +0 -0
  75. package/dist/control/task.cgc +0 -0
  76. package/dist/global.css +1 -1
  77. package/dist/index.js +28 -8
  78. package/dist/index.ts +33 -7
  79. package/dist/lib/control.js +75 -105
  80. package/dist/lib/control.ts +102 -124
  81. package/dist/lib/core.js +108 -252
  82. package/dist/lib/core.ts +122 -268
  83. package/dist/lib/dom.js +564 -483
  84. package/dist/lib/dom.ts +703 -546
  85. package/dist/lib/form.js +170 -153
  86. package/dist/lib/form.ts +132 -99
  87. package/dist/lib/fs.js +1 -1
  88. package/dist/lib/fs.ts +1 -1
  89. package/dist/lib/native.js +135 -8
  90. package/dist/lib/native.ts +176 -12
  91. package/dist/lib/task.js +301 -175
  92. package/dist/lib/task.ts +330 -207
  93. package/dist/lib/tool.js +48 -1
  94. package/dist/lib/tool.ts +61 -0
  95. package/dist/lib/zip.ts +2 -0
  96. package/dist/theme/familiar.cgt +0 -0
  97. package/package.json +1 -1
  98. package/types/index.d.ts +26 -29
  99. package/dist/app/demo/form/control/greatview/greatview.js +0 -92
  100. package/dist/app/demo/form/control/overflow/overflow.js +0 -70
  101. package/dist/app/demo/form/control/overflow/overflow.xml +0 -98
  102. package/dist/app/demo/form/control/view/view.css +0 -1
  103. package/dist/app/demo/form/control/view/view.js +0 -73
  104. package/dist/app/demo/form/control/view/view.scss +0 -18
  105. package/dist/app/demo/form/control/view/view.xml +0 -94
  106. package/dist/app/demo/form/method/form/test.xml +0 -5
package/dist/lib/form.js CHANGED
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.hideLauncher = exports.showLauncher = exports.flash = exports.confirm = exports.dialog = exports.create = exports.remove = exports.doFocusAndPopEvent = exports.hidePop = exports.showPop = exports.removeFromPop = exports.appendToPop = exports.hideNotify = exports.notifyProgress = exports.notify = exports.hideDrag = exports.moveDrag = exports.showDrag = exports.hideRectangle = exports.showRectangle = exports.moveRectangle = exports.showCircular = exports.getRectByBorder = exports.getMaxZIndexID = exports.changeFocus = exports.getList = exports.send = exports.get = exports.getTaskId = exports.refreshMaxPosition = exports.bindDrag = exports.bindResize = exports.close = exports.max = exports.min = exports.launcherRoot = exports.simpleSystemTaskRoot = exports.AbstractForm = void 0;
12
+ exports.hideLauncher = exports.showLauncher = exports.flash = exports.confirm = exports.dialog = exports.create = exports.remove = exports.doFocusAndPopEvent = exports.hidePop = exports.showPop = exports.removeFromPop = exports.appendToPop = exports.hideNotify = exports.notifyProgress = exports.notify = exports.hideDrag = exports.moveDrag = exports.showDrag = exports.hideRectangle = exports.showRectangle = exports.moveRectangle = exports.showCircular = exports.getRectByBorder = exports.getMaxZIndexID = exports.changeFocus = exports.getFocus = exports.getList = exports.send = exports.get = exports.getTaskId = exports.refreshMaxPosition = exports.bindDrag = exports.bindResize = exports.close = exports.max = exports.min = exports.elements = exports.launcherRoot = exports.simpleSystemTaskRoot = exports.AbstractForm = void 0;
13
13
  const clickgo = require("../clickgo");
14
14
  const core = require("./core");
15
15
  const task = require("./task");
@@ -18,6 +18,7 @@ const dom = require("./dom");
18
18
  const control = require("./control");
19
19
  const fs = require("./fs");
20
20
  const native = require("./native");
21
+ let focusId = null;
21
22
  const info = {
22
23
  'lastId': 0,
23
24
  'lastZIndex': 999,
@@ -55,6 +56,7 @@ const info = {
55
56
  };
56
57
  class AbstractForm {
57
58
  constructor() {
59
+ this.isNativeSync = false;
58
60
  this._firstShow = true;
59
61
  this.dialogResult = '';
60
62
  }
@@ -96,6 +98,9 @@ class AbstractForm {
96
98
  };
97
99
  const cdata = Object.entries(frm);
98
100
  for (const item of cdata) {
101
+ if (item[0] === 'access') {
102
+ continue;
103
+ }
99
104
  code.data[item[0]] = item[1];
100
105
  }
101
106
  if (!layout) {
@@ -174,7 +179,7 @@ class AbstractForm {
174
179
  return (_d = (_b = (_a = task.list[this.taskId].locale.data[this.locale]) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : (_c = task.list[this.taskId].locale.data['en']) === null || _c === void 0 ? void 0 : _c[key]) !== null && _d !== void 0 ? _d : 'LocaleError';
175
180
  };
176
181
  }
177
- classPrepend() {
182
+ get classPrepend() {
178
183
  return (cla) => {
179
184
  if (typeof cla !== 'string') {
180
185
  return cla;
@@ -232,7 +237,7 @@ class AbstractForm {
232
237
  }
233
238
  show() {
234
239
  const v = this;
235
- v.$refs.form.$data.showData = true;
240
+ v.$refs.form.$data.isShow = true;
236
241
  if (this._firstShow) {
237
242
  this._firstShow = false;
238
243
  const area = core.getAvailArea();
@@ -244,12 +249,13 @@ class AbstractForm {
244
249
  v.$refs.form.setPropData('top', (area.height - v.$el.offsetHeight) / 2);
245
250
  }
246
251
  }
247
- v.$refs.form.$data.showData = true;
252
+ v.$refs.form.$data.isShow = true;
248
253
  changeFocus(this.formId);
249
254
  }
250
255
  }
251
256
  showDialog() {
252
257
  return __awaiter(this, void 0, void 0, function* () {
258
+ this.topMost = true;
253
259
  this.show();
254
260
  task.list[this.taskId].runtime.dialogFormIds.push(this.formId);
255
261
  return new Promise((resolve) => {
@@ -261,7 +267,10 @@ class AbstractForm {
261
267
  }
262
268
  hide() {
263
269
  const v = this;
264
- v.$refs.form.$data.showData = false;
270
+ v.$refs.form.$data.isShow = false;
271
+ }
272
+ close() {
273
+ close(this.formId);
265
274
  }
266
275
  onBeforeCreate() {
267
276
  return;
@@ -342,7 +351,7 @@ const popInfo = {
342
351
  'elList': [],
343
352
  'lastZIndex': 0
344
353
  };
345
- const elements = {
354
+ exports.elements = {
346
355
  'wrap': document.createElement('div'),
347
356
  'list': document.createElement('div'),
348
357
  'popList': document.createElement('div'),
@@ -357,41 +366,33 @@ const elements = {
357
366
  'init': function () {
358
367
  this.wrap.id = 'cg-wrap';
359
368
  document.getElementsByTagName('body')[0].appendChild(this.wrap);
360
- if (clickgo.getNative() && (clickgo.getPlatform() === 'win32')) {
361
- this.wrap.addEventListener('mouseenter', function () {
362
- native.invoke('cg-mouse-ignore', native.getToken(), false);
363
- });
364
- this.wrap.addEventListener('mouseleave', function () {
365
- native.invoke('cg-mouse-ignore', native.getToken(), true);
366
- });
367
- }
368
- this.list.id = 'cg-form-list';
369
- this.wrap.appendChild(this.list);
370
- this.list.addEventListener('touchmove', function (e) {
369
+ this.wrap.addEventListener('touchmove', function (e) {
371
370
  if (e.cancelable) {
372
371
  e.preventDefault();
373
372
  }
374
373
  }, {
375
374
  'passive': false
376
375
  });
377
- this.list.addEventListener('wheel', function (e) {
376
+ this.wrap.addEventListener('wheel', function (e) {
378
377
  e.preventDefault();
379
378
  }, {
380
379
  'passive': false
381
380
  });
382
- this.list.addEventListener('contextmenu', function (e) {
381
+ this.wrap.addEventListener('contextmenu', function (e) {
383
382
  e.preventDefault();
384
383
  });
384
+ if (clickgo.isImmersion()) {
385
+ this.wrap.addEventListener('mouseenter', function () {
386
+ native.invoke('cg-mouse-ignore', native.getToken(), false);
387
+ });
388
+ this.wrap.addEventListener('mouseleave', function () {
389
+ native.invoke('cg-mouse-ignore', native.getToken(), true);
390
+ });
391
+ }
392
+ this.list.id = 'cg-form-list';
393
+ this.wrap.appendChild(this.list);
385
394
  this.popList.id = 'cg-pop-list';
386
- this.popList.addEventListener('contextmenu', function (e) {
387
- e.preventDefault();
388
- });
389
395
  this.wrap.appendChild(this.popList);
390
- this.popList.addEventListener('touchmove', function (e) {
391
- e.preventDefault();
392
- }, {
393
- 'passive': false
394
- });
395
396
  this.circular.id = 'cg-circular';
396
397
  this.wrap.appendChild(this.circular);
397
398
  this.rectangle.setAttribute('data-pos', '');
@@ -404,25 +405,9 @@ const elements = {
404
405
  this.dragIcon = this.drag.childNodes[0];
405
406
  this.wrap.appendChild(this.drag);
406
407
  this.system.id = 'cg-system';
407
- this.system.addEventListener('contextmenu', function (e) {
408
- e.preventDefault();
409
- });
410
408
  this.wrap.appendChild(this.system);
411
- this.system.addEventListener('touchmove', function (e) {
412
- e.preventDefault();
413
- }, {
414
- 'passive': false
415
- });
416
409
  this.simpleSystemtask.id = 'cg-simpletask';
417
- this.simpleSystemtask.addEventListener('contextmenu', function (e) {
418
- e.preventDefault();
419
- });
420
410
  this.wrap.appendChild(this.simpleSystemtask);
421
- this.simpleSystemtask.addEventListener('touchmove', function (e) {
422
- e.preventDefault();
423
- }, {
424
- 'passive': false
425
- });
426
411
  const simpletaskApp = clickgo.vue.createApp({
427
412
  'template': '<div v-for="(item, formId) of forms" class="cg-simpletask-item" @click="click(parseInt(formId))"><div v-if="item.icon" class="cg-simpletask-icon" :style="{\'background-image\': \'url(\' + item.icon + \')\'}"></div><div>{{item.title}}</div></div>',
428
413
  'data': function () {
@@ -435,14 +420,14 @@ const elements = {
435
420
  handler: function () {
436
421
  const length = Object.keys(this.forms).length;
437
422
  if (length > 0) {
438
- if (elements.simpleSystemtask.style.bottom !== '0px') {
439
- elements.simpleSystemtask.style.bottom = '0px';
423
+ if (exports.elements.simpleSystemtask.style.bottom !== '0px') {
424
+ exports.elements.simpleSystemtask.style.bottom = '0px';
440
425
  core.trigger('screenResize');
441
426
  }
442
427
  }
443
428
  else {
444
- if (elements.simpleSystemtask.style.bottom === '0px') {
445
- elements.simpleSystemtask.style.bottom = '-46px';
429
+ if (exports.elements.simpleSystemtask.style.bottom === '0px') {
430
+ exports.elements.simpleSystemtask.style.bottom = '-46px';
446
431
  core.trigger('screenResize');
447
432
  }
448
433
  }
@@ -461,20 +446,12 @@ const elements = {
461
446
  });
462
447
  simpletaskApp.mount('#cg-simpletask');
463
448
  this.launcher.id = 'cg-launcher';
464
- this.launcher.addEventListener('contextmenu', function (e) {
465
- e.preventDefault();
466
- });
467
449
  this.wrap.appendChild(this.launcher);
468
- this.launcher.addEventListener('touchmove', function (e) {
469
- e.preventDefault();
470
- }, {
471
- 'passive': false
472
- });
473
450
  const waiting = function () {
474
451
  if (!core.config) {
475
452
  setTimeout(function () {
476
453
  waiting();
477
- }, 2000);
454
+ }, 150);
478
455
  return;
479
456
  }
480
457
  const launcherApp = clickgo.vue.createApp({
@@ -639,7 +616,7 @@ const elements = {
639
616
  waiting();
640
617
  }
641
618
  };
642
- elements.init();
619
+ exports.elements.init();
643
620
  function changeState(state, formId) {
644
621
  const tid = getTaskId(formId);
645
622
  const t = task.list[tid];
@@ -711,8 +688,8 @@ function bindDrag(e) {
711
688
  exports.bindDrag = bindDrag;
712
689
  function refreshMaxPosition() {
713
690
  const area = core.getAvailArea();
714
- for (let i = 0; i < elements.list.children.length; ++i) {
715
- const el = elements.list.children.item(i);
691
+ for (let i = 0; i < exports.elements.list.children.length; ++i) {
692
+ const el = exports.elements.list.children.item(i);
716
693
  const ef = el.children.item(0);
717
694
  if (ef.dataset.cgMax === undefined) {
718
695
  continue;
@@ -731,7 +708,7 @@ function refreshMaxPosition() {
731
708
  }
732
709
  exports.refreshMaxPosition = refreshMaxPosition;
733
710
  function getTaskId(formId) {
734
- const formElement = elements.list.querySelector(`[data-form-id='${formId}']`);
711
+ const formElement = exports.elements.list.querySelector(`[data-form-id='${formId}']`);
735
712
  if (!formElement) {
736
713
  return 0;
737
714
  }
@@ -751,10 +728,10 @@ function get(formId) {
751
728
  return {
752
729
  'taskId': taskId,
753
730
  'title': item.vroot.$refs.form.title,
754
- 'icon': item.vroot.$refs.form.iconData,
731
+ 'icon': item.vroot.$refs.form.iconDataUrl,
755
732
  'stateMax': item.vroot.$refs.form.stateMaxData,
756
733
  'stateMin': item.vroot.$refs.form.stateMinData,
757
- 'show': item.vroot.$refs.form.showData,
734
+ 'show': item.vroot.$refs.form.isShow,
758
735
  'focus': item.vroot.formFocus
759
736
  };
760
737
  }
@@ -778,18 +755,22 @@ function getList(taskId) {
778
755
  list[fid] = {
779
756
  'taskId': taskId,
780
757
  'title': item.vroot.$refs.form.title,
781
- 'icon': item.vroot.$refs.form.iconData,
758
+ 'icon': item.vroot.$refs.form.iconDataUrl,
782
759
  'stateMax': item.vroot.$refs.form.stateMaxData,
783
760
  'stateMin': item.vroot.$refs.form.stateMinData,
784
- 'show': item.vroot.$refs.form.showData,
761
+ 'show': item.vroot.$refs.form.isShow,
785
762
  'focus': item.vroot.formFocus
786
763
  };
787
764
  }
788
765
  return list;
789
766
  }
790
767
  exports.getList = getList;
768
+ function getFocus() {
769
+ return focusId;
770
+ }
771
+ exports.getFocus = getFocus;
791
772
  function changeFocus(formId = 0) {
792
- var _a, _b;
773
+ var _a;
793
774
  if (typeof formId !== 'number') {
794
775
  notify({
795
776
  'title': 'Warning',
@@ -798,37 +779,31 @@ function changeFocus(formId = 0) {
798
779
  });
799
780
  return;
800
781
  }
801
- const focusElement = document.querySelector('#cg-form-list > [data-form-focus]');
802
- if (focusElement) {
803
- const dataFormId = focusElement.getAttribute('data-form-id');
804
- if (dataFormId) {
805
- const dataFormIdNumber = parseInt(dataFormId);
806
- if (dataFormIdNumber === formId) {
807
- return;
808
- }
809
- else {
810
- const taskId = parseInt((_a = focusElement.getAttribute('data-task-id')) !== null && _a !== void 0 ? _a : '0');
811
- const t = task.list[taskId];
812
- t.forms[dataFormIdNumber].vapp._container.removeAttribute('data-form-focus');
813
- t.forms[dataFormIdNumber].vroot._formFocus = false;
814
- core.trigger('formBlurred', taskId, dataFormIdNumber);
815
- }
782
+ const dataFormId = getFocus();
783
+ if (dataFormId) {
784
+ if (dataFormId === formId) {
785
+ return;
816
786
  }
817
787
  else {
818
- return;
788
+ const t = task.list[task.getFocus()];
789
+ t.forms[dataFormId].vapp._container.removeAttribute('data-form-focus');
790
+ t.forms[dataFormId].vroot._formFocus = false;
791
+ core.trigger('formBlurred', t.id, dataFormId);
819
792
  }
820
793
  }
794
+ focusId = null;
795
+ task.setFocus();
821
796
  if (formId === 0) {
822
797
  return;
823
798
  }
824
- const el = document.querySelector(`#cg-form-list > [data-form-id='${formId}']`);
799
+ const el = exports.elements.list.querySelector(`.cg-form-wrap[data-form-id='${formId}']`);
825
800
  if (!el) {
826
801
  return;
827
802
  }
828
803
  if (el.children.item(0).dataset.cgMin !== undefined) {
829
804
  min(formId);
830
805
  }
831
- const taskId = parseInt((_b = el.getAttribute('data-task-id')) !== null && _b !== void 0 ? _b : '0');
806
+ const taskId = parseInt((_a = el.getAttribute('data-task-id')) !== null && _a !== void 0 ? _a : '0');
832
807
  const t = task.list[taskId];
833
808
  if (t.runtime.dialogFormIds.length) {
834
809
  const dialogFormId = t.runtime.dialogFormIds[t.runtime.dialogFormIds.length - 1];
@@ -836,13 +811,15 @@ function changeFocus(formId = 0) {
836
811
  min(dialogFormId);
837
812
  }
838
813
  if (t.forms[dialogFormId].vroot._topMost) {
839
- t.forms[dialogFormId].vroot.$refs.form.$data.zIndexData = ++info.topLastZIndex;
814
+ t.forms[dialogFormId].vroot.$refs.form.$data.zIndex = ++info.topLastZIndex;
840
815
  }
841
816
  else {
842
- t.forms[dialogFormId].vroot.$refs.form.$data.zIndexData = ++info.lastZIndex;
817
+ t.forms[dialogFormId].vroot.$refs.form.$data.zIndex = ++info.lastZIndex;
843
818
  }
844
819
  t.forms[dialogFormId].vapp._container.dataset.formFocus = '';
845
820
  t.forms[dialogFormId].vroot._formFocus = true;
821
+ focusId = dialogFormId;
822
+ task.setFocus(t.id);
846
823
  core.trigger('formFocused', taskId, dialogFormId);
847
824
  if (dialogFormId !== formId) {
848
825
  clickgo.form.flash(dialogFormId, taskId);
@@ -850,13 +827,15 @@ function changeFocus(formId = 0) {
850
827
  }
851
828
  else {
852
829
  if (t.forms[formId].vroot._topMost) {
853
- t.forms[formId].vroot.$refs.form.$data.zIndexData = ++info.topLastZIndex;
830
+ t.forms[formId].vroot.$refs.form.$data.zIndex = ++info.topLastZIndex;
854
831
  }
855
832
  else {
856
- t.forms[formId].vroot.$refs.form.$data.zIndexData = ++info.lastZIndex;
833
+ t.forms[formId].vroot.$refs.form.$data.zIndex = ++info.lastZIndex;
857
834
  }
858
835
  t.forms[formId].vapp._container.dataset.formFocus = '';
859
836
  t.forms[formId].vroot._formFocus = true;
837
+ focusId = formId;
838
+ task.setFocus(t.id);
860
839
  core.trigger('formFocused', taskId, formId);
861
840
  }
862
841
  }
@@ -865,8 +844,8 @@ function getMaxZIndexID(out = {}) {
865
844
  var _a, _b;
866
845
  let zIndex = 0;
867
846
  let formId = null;
868
- for (let i = 0; i < elements.list.children.length; ++i) {
869
- const formWrap = elements.list.children.item(i);
847
+ for (let i = 0; i < exports.elements.list.children.length; ++i) {
848
+ const formWrap = exports.elements.list.children.item(i);
870
849
  const formInner = formWrap.children.item(0);
871
850
  if (!formInner) {
872
851
  continue;
@@ -976,21 +955,21 @@ function getRectByBorder(border) {
976
955
  }
977
956
  exports.getRectByBorder = getRectByBorder;
978
957
  function showCircular(x, y) {
979
- elements.circular.style.transition = 'none';
958
+ exports.elements.circular.style.transition = 'none';
980
959
  requestAnimationFrame(function () {
981
- elements.circular.style.width = '6px';
982
- elements.circular.style.height = '6px';
983
- elements.circular.style.left = (x - 3).toString() + 'px';
984
- elements.circular.style.top = (y - 3).toString() + 'px';
985
- elements.circular.style.opacity = '1';
960
+ exports.elements.circular.style.width = '6px';
961
+ exports.elements.circular.style.height = '6px';
962
+ exports.elements.circular.style.left = (x - 3).toString() + 'px';
963
+ exports.elements.circular.style.top = (y - 3).toString() + 'px';
964
+ exports.elements.circular.style.opacity = '1';
986
965
  requestAnimationFrame(function () {
987
- elements.circular.style.transition = 'all .3s ease-out';
966
+ exports.elements.circular.style.transition = 'all .3s ease-out';
988
967
  requestAnimationFrame(function () {
989
- elements.circular.style.width = '60px';
990
- elements.circular.style.height = '60px';
991
- elements.circular.style.left = (x - 30).toString() + 'px';
992
- elements.circular.style.top = (y - 30).toString() + 'px';
993
- elements.circular.style.opacity = '0';
968
+ exports.elements.circular.style.width = '60px';
969
+ exports.elements.circular.style.height = '60px';
970
+ exports.elements.circular.style.left = (x - 30).toString() + 'px';
971
+ exports.elements.circular.style.top = (y - 30).toString() + 'px';
972
+ exports.elements.circular.style.opacity = '0';
994
973
  });
995
974
  });
996
975
  });
@@ -998,43 +977,43 @@ function showCircular(x, y) {
998
977
  exports.showCircular = showCircular;
999
978
  function moveRectangle(border) {
1000
979
  var _a, _b, _c, _d;
1001
- const dataReady = (_a = elements.rectangle.getAttribute('data-ready')) !== null && _a !== void 0 ? _a : '0';
980
+ const dataReady = (_a = exports.elements.rectangle.getAttribute('data-ready')) !== null && _a !== void 0 ? _a : '0';
1002
981
  if (dataReady === '0') {
1003
982
  return;
1004
983
  }
1005
- const dataBorder = (_b = elements.rectangle.getAttribute('data-border')) !== null && _b !== void 0 ? _b : '';
984
+ const dataBorder = (_b = exports.elements.rectangle.getAttribute('data-border')) !== null && _b !== void 0 ? _b : '';
1006
985
  const setDataBorder = typeof border === 'string' ? border : `o-${border.left}-${(_c = border.top) !== null && _c !== void 0 ? _c : 'n'}-${border.width}-${(_d = border.height) !== null && _d !== void 0 ? _d : 'n'}`;
1007
986
  if (dataBorder === setDataBorder) {
1008
987
  return;
1009
988
  }
1010
- elements.rectangle.setAttribute('data-dir', setDataBorder);
989
+ exports.elements.rectangle.setAttribute('data-dir', setDataBorder);
1011
990
  const pos = getRectByBorder(border);
1012
991
  const width = pos.width - 20;
1013
992
  const height = pos.height - 20;
1014
993
  const left = pos.left + 10;
1015
994
  const top = pos.top + 10;
1016
995
  if (width !== undefined && height !== undefined && left !== undefined && top !== undefined) {
1017
- elements.rectangle.style.width = width.toString() + 'px';
1018
- elements.rectangle.style.height = height.toString() + 'px';
1019
- elements.rectangle.style.left = left.toString() + 'px';
1020
- elements.rectangle.style.top = top.toString() + 'px';
996
+ exports.elements.rectangle.style.width = width.toString() + 'px';
997
+ exports.elements.rectangle.style.height = height.toString() + 'px';
998
+ exports.elements.rectangle.style.left = left.toString() + 'px';
999
+ exports.elements.rectangle.style.top = top.toString() + 'px';
1021
1000
  }
1022
1001
  }
1023
1002
  exports.moveRectangle = moveRectangle;
1024
1003
  function showRectangle(x, y, border) {
1025
- elements.rectangle.style.transition = 'none';
1004
+ exports.elements.rectangle.style.transition = 'none';
1026
1005
  requestAnimationFrame(function () {
1027
- elements.rectangle.style.width = '5px';
1028
- elements.rectangle.style.height = '5px';
1029
- elements.rectangle.style.left = (x - 10).toString() + 'px';
1030
- elements.rectangle.style.top = (y - 10).toString() + 'px';
1031
- elements.rectangle.style.opacity = '1';
1032
- elements.rectangle.setAttribute('data-ready', '0');
1033
- elements.rectangle.setAttribute('data-dir', '');
1006
+ exports.elements.rectangle.style.width = '5px';
1007
+ exports.elements.rectangle.style.height = '5px';
1008
+ exports.elements.rectangle.style.left = (x - 10).toString() + 'px';
1009
+ exports.elements.rectangle.style.top = (y - 10).toString() + 'px';
1010
+ exports.elements.rectangle.style.opacity = '1';
1011
+ exports.elements.rectangle.setAttribute('data-ready', '0');
1012
+ exports.elements.rectangle.setAttribute('data-dir', '');
1034
1013
  requestAnimationFrame(function () {
1035
- elements.rectangle.style.transition = 'all .2s ease-out';
1014
+ exports.elements.rectangle.style.transition = 'all .2s ease-out';
1036
1015
  requestAnimationFrame(function () {
1037
- elements.rectangle.setAttribute('data-ready', '1');
1016
+ exports.elements.rectangle.setAttribute('data-ready', '1');
1038
1017
  moveRectangle(border);
1039
1018
  });
1040
1019
  });
@@ -1042,40 +1021,40 @@ function showRectangle(x, y, border) {
1042
1021
  }
1043
1022
  exports.showRectangle = showRectangle;
1044
1023
  function hideRectangle() {
1045
- elements.rectangle.style.opacity = '0';
1024
+ exports.elements.rectangle.style.opacity = '0';
1046
1025
  }
1047
1026
  exports.hideRectangle = hideRectangle;
1048
1027
  function showDrag() {
1049
- elements.drag.style.opacity = '1';
1028
+ exports.elements.drag.style.opacity = '1';
1050
1029
  }
1051
1030
  exports.showDrag = showDrag;
1052
1031
  function moveDrag(opt) {
1053
1032
  if (opt.top) {
1054
- elements.drag.style.top = opt.top.toString() + 'px';
1033
+ exports.elements.drag.style.top = opt.top.toString() + 'px';
1055
1034
  }
1056
1035
  if (opt.left) {
1057
- elements.drag.style.left = opt.left.toString() + 'px';
1036
+ exports.elements.drag.style.left = opt.left.toString() + 'px';
1058
1037
  }
1059
1038
  if (opt.width) {
1060
- elements.drag.style.width = opt.width.toString() + 'px';
1039
+ exports.elements.drag.style.width = opt.width.toString() + 'px';
1061
1040
  }
1062
1041
  if (opt.height) {
1063
- elements.drag.style.height = opt.height.toString() + 'px';
1042
+ exports.elements.drag.style.height = opt.height.toString() + 'px';
1064
1043
  }
1065
1044
  if (opt.icon) {
1066
- if (elements.dragIcon) {
1067
- elements.dragIcon.style.display = 'block';
1045
+ if (exports.elements.dragIcon) {
1046
+ exports.elements.dragIcon.style.display = 'block';
1068
1047
  }
1069
1048
  }
1070
1049
  else {
1071
- if (elements.dragIcon) {
1072
- elements.dragIcon.style.display = 'none';
1050
+ if (exports.elements.dragIcon) {
1051
+ exports.elements.dragIcon.style.display = 'none';
1073
1052
  }
1074
1053
  }
1075
1054
  }
1076
1055
  exports.moveDrag = moveDrag;
1077
1056
  function hideDrag() {
1078
- elements.drag.style.opacity = '0';
1057
+ exports.elements.drag.style.opacity = '0';
1079
1058
  }
1080
1059
  exports.hideDrag = hideDrag;
1081
1060
  let notifyTop = 10;
@@ -1111,7 +1090,7 @@ function notify(opt) {
1111
1090
  el.childNodes.item(0).style.background = 'url(' + opt.icon + ')';
1112
1091
  el.childNodes.item(0).style.backgroundSize = '16px';
1113
1092
  }
1114
- elements.system.appendChild(el);
1093
+ exports.elements.system.appendChild(el);
1115
1094
  notifyTop += el.offsetHeight + 10;
1116
1095
  requestAnimationFrame(function () {
1117
1096
  el.style.transform = `translateY(${y}px) translateX(-10px)`;
@@ -1124,7 +1103,7 @@ function notify(opt) {
1124
1103
  }
1125
1104
  exports.notify = notify;
1126
1105
  function notifyProgress(notifyId, per) {
1127
- const el = elements.system.querySelector(`[data-notifyid="${notifyId}"]`);
1106
+ const el = exports.elements.system.querySelector(`[data-notifyid="${notifyId}"]`);
1128
1107
  if (!el) {
1129
1108
  return;
1130
1109
  }
@@ -1148,7 +1127,7 @@ function notifyProgress(notifyId, per) {
1148
1127
  }
1149
1128
  exports.notifyProgress = notifyProgress;
1150
1129
  function hideNotify(notifyId) {
1151
- const el = elements.system.querySelector(`[data-notifyid="${notifyId}"]`);
1130
+ const el = exports.elements.system.querySelector(`[data-notifyid="${notifyId}"]`);
1152
1131
  if (!el) {
1153
1132
  return;
1154
1133
  }
@@ -1175,11 +1154,11 @@ function hideNotify(notifyId) {
1175
1154
  }
1176
1155
  exports.hideNotify = hideNotify;
1177
1156
  function appendToPop(el) {
1178
- elements.popList.appendChild(el);
1157
+ exports.elements.popList.appendChild(el);
1179
1158
  }
1180
1159
  exports.appendToPop = appendToPop;
1181
1160
  function removeFromPop(el) {
1182
- elements.popList.removeChild(el);
1161
+ exports.elements.popList.removeChild(el);
1183
1162
  }
1184
1163
  exports.removeFromPop = removeFromPop;
1185
1164
  let lastShowPopTime = 0;
@@ -1399,13 +1378,14 @@ function remove(formId) {
1399
1378
  let icon = '';
1400
1379
  if (task.list[taskId].forms[formId]) {
1401
1380
  title = task.list[taskId].forms[formId].vroot.$refs.form.title;
1402
- icon = task.list[taskId].forms[formId].vroot.$refs.form.iconData;
1381
+ icon = task.list[taskId].forms[formId].vroot.$refs.form.iconDataUrl;
1403
1382
  const io = task.list[taskId].runtime.dialogFormIds.indexOf(formId);
1404
1383
  if (io > -1) {
1405
1384
  task.list[taskId].runtime.dialogFormIds.splice(io, 1);
1406
1385
  }
1407
- task.list[taskId].forms[formId].vroot.$refs.form.$data.showData = false;
1386
+ task.list[taskId].forms[formId].vroot.$refs.form.$data.isShow = false;
1408
1387
  setTimeout(function () {
1388
+ var _a;
1409
1389
  const fid = getMaxZIndexID({
1410
1390
  'formIds': [formId]
1411
1391
  });
@@ -1420,12 +1400,16 @@ function remove(formId) {
1420
1400
  }
1421
1401
  task.list[taskId].forms[formId].vapp.unmount();
1422
1402
  task.list[taskId].forms[formId].vapp._container.remove();
1403
+ (_a = exports.elements.popList.querySelector('[data-form-id="' + formId.toString() + '"]')) === null || _a === void 0 ? void 0 : _a.remove();
1423
1404
  if (io > -1) {
1424
1405
  task.list[taskId].forms[formId].vroot.cgDialogCallback();
1425
1406
  }
1426
1407
  delete task.list[taskId].forms[formId];
1427
1408
  dom.removeStyle(taskId, 'form', formId);
1428
1409
  core.trigger('formRemoved', taskId, formId, title, icon);
1410
+ dom.clearWatchStyle(formId);
1411
+ dom.clearWatchProperty(formId);
1412
+ native.clear(formId, taskId);
1429
1413
  if (Object.keys(task.list[taskId].forms).length === 0) {
1430
1414
  task.end(taskId);
1431
1415
  }
@@ -1449,7 +1433,7 @@ function getForm(taskId, formId) {
1449
1433
  return form;
1450
1434
  }
1451
1435
  function create(opt) {
1452
- var _a, _b, _c, _d;
1436
+ var _a, _b, _c, _d, _e, _f;
1453
1437
  return __awaiter(this, void 0, void 0, function* () {
1454
1438
  if (!opt.taskId) {
1455
1439
  return -1;
@@ -1464,6 +1448,7 @@ function create(opt) {
1464
1448
  return -3;
1465
1449
  }
1466
1450
  let data = {};
1451
+ let access = {};
1467
1452
  let methods = undefined;
1468
1453
  let computed = {};
1469
1454
  let beforeCreate = undefined;
@@ -1476,8 +1461,9 @@ function create(opt) {
1476
1461
  let unmounted = undefined;
1477
1462
  if (opt.code) {
1478
1463
  data = (_b = opt.code.data) !== null && _b !== void 0 ? _b : {};
1464
+ access = (_c = opt.code.access) !== null && _c !== void 0 ? _c : {};
1479
1465
  methods = opt.code.methods;
1480
- computed = (_c = opt.code.computed) !== null && _c !== void 0 ? _c : {};
1466
+ computed = (_d = opt.code.computed) !== null && _d !== void 0 ? _d : {};
1481
1467
  beforeCreate = opt.code.beforeCreate;
1482
1468
  created = opt.code.created;
1483
1469
  beforeMount = opt.code.beforeMount;
@@ -1492,7 +1478,7 @@ function create(opt) {
1492
1478
  if (opt.style) {
1493
1479
  const r = tool.stylePrepend(opt.style);
1494
1480
  prep = r.prep;
1495
- style = yield tool.styleUrl2DataUrl((_d = opt.path) !== null && _d !== void 0 ? _d : '/', r.style, t.app.files);
1481
+ style = yield tool.styleUrl2DataUrl((_e = opt.path) !== null && _e !== void 0 ? _e : '/', r.style, t.app.files);
1496
1482
  }
1497
1483
  let layout = tool.purify(opt.layout);
1498
1484
  layout = tool.layoutAddTagClassAndReTagName(layout, true);
@@ -1505,8 +1491,12 @@ function create(opt) {
1505
1491
  }
1506
1492
  layout = tool.layoutClassPrepend(layout, prepList);
1507
1493
  layout = tool.eventsAttrWrap(layout);
1508
- elements.list.insertAdjacentHTML('beforeend', `<div class="cg-form-wrap" data-form-id="${formId.toString()}" data-task-id="${opt.taskId.toString()}"></div>`);
1509
- const el = elements.list.children.item(elements.list.children.length - 1);
1494
+ if (layout.includes('<teleport')) {
1495
+ layout = tool.teleportGlue(layout, formId);
1496
+ }
1497
+ exports.elements.list.insertAdjacentHTML('beforeend', `<div class="cg-form-wrap" data-form-id="${formId.toString()}" data-task-id="${opt.taskId.toString()}"></div>`);
1498
+ exports.elements.popList.insertAdjacentHTML('beforeend', `<div data-form-id="${formId.toString()}" data-task-id="${opt.taskId.toString()}"></div>`);
1499
+ const el = exports.elements.list.children.item(exports.elements.list.children.length - 1);
1510
1500
  computed.formId = {
1511
1501
  get: function () {
1512
1502
  return formId;
@@ -1564,16 +1554,19 @@ function create(opt) {
1564
1554
  changeFocus(form.id);
1565
1555
  }
1566
1556
  else {
1567
- form.vroot.$refs.form.$data.zIndexData = ++info.topLastZIndex;
1557
+ form.vroot.$refs.form.$data.zIndex = ++info.topLastZIndex;
1568
1558
  }
1569
1559
  }
1570
1560
  else {
1571
1561
  form.vroot.$data._topMost = false;
1572
- form.vroot.$refs.form.$data.zIndexData = ++info.lastZIndex;
1562
+ form.vroot.$refs.form.$data.zIndex = ++info.lastZIndex;
1573
1563
  }
1574
1564
  return;
1575
1565
  }
1576
1566
  };
1567
+ if (clickgo.isNative() && (formId === 1) && !clickgo.isImmersion() && !clickgo.hasFrame()) {
1568
+ data.isNativeSync = true;
1569
+ }
1577
1570
  if (style) {
1578
1571
  dom.pushStyle(opt.taskId, style, 'form', formId);
1579
1572
  }
@@ -1586,7 +1579,10 @@ function create(opt) {
1586
1579
  'methods': methods,
1587
1580
  'computed': computed,
1588
1581
  'beforeCreate': beforeCreate,
1589
- 'created': created,
1582
+ 'created': function () {
1583
+ this.access = tool.clone(access);
1584
+ created === null || created === void 0 ? void 0 : created.call(this);
1585
+ },
1590
1586
  'beforeMount': beforeMount,
1591
1587
  'mounted': function () {
1592
1588
  return __awaiter(this, void 0, void 0, function* () {
@@ -1596,7 +1592,7 @@ function create(opt) {
1596
1592
  'current': t.current,
1597
1593
  'files': t.app.files
1598
1594
  });
1599
- this.$refs.form.iconData = (icon instanceof Blob) ? yield tool.blob2DataUrl(icon) : '';
1595
+ this.$refs.form.iconDataUrl = (icon instanceof Blob) ? yield tool.blob2DataUrl(icon) : '';
1600
1596
  }
1601
1597
  resolve({
1602
1598
  'vapp': vapp,
@@ -1645,15 +1641,36 @@ function create(opt) {
1645
1641
  }
1646
1642
  catch (err) {
1647
1643
  core.trigger('error', rtn.vroot.taskId, rtn.vroot.formId, err, 'Create form mounted error.');
1648
- t.forms[formId] = undefined;
1649
1644
  delete t.forms[formId];
1650
- rtn.vapp.unmount();
1645
+ try {
1646
+ rtn.vapp.unmount();
1647
+ }
1648
+ catch (err) {
1649
+ const msg = `Message: ${err.message}\nTask id: ${opt.taskId}\nForm id: ${formId}\nFunction: form.create, unmount.`;
1650
+ notify({
1651
+ 'title': 'Form Unmount Error',
1652
+ 'content': msg,
1653
+ 'type': 'danger'
1654
+ });
1655
+ console.log('Form Unmount Error', msg, err);
1656
+ }
1651
1657
  rtn.vapp._container.remove();
1658
+ (_f = exports.elements.popList.querySelector('[data-form-id="' + rtn.vroot.formId + '"]')) === null || _f === void 0 ? void 0 : _f.remove();
1659
+ dom.clearWatchStyle(rtn.vroot.formId);
1660
+ dom.clearWatchProperty(rtn.vroot.formId);
1661
+ native.clear(formId, t.id);
1652
1662
  dom.removeStyle(rtn.vroot.taskId, 'form', rtn.vroot.formId);
1653
1663
  return -8;
1654
1664
  }
1655
1665
  }
1656
- core.trigger('formCreated', opt.taskId, formId, rtn.vroot.$refs.form.title, rtn.vroot.$refs.form.iconData);
1666
+ core.trigger('formCreated', opt.taskId, formId, rtn.vroot.$refs.form.title, rtn.vroot.$refs.form.iconDataUrl);
1667
+ if (rtn.vroot.isNativeSync) {
1668
+ native.invoke('cg-set-size', native.getToken(), rtn.vroot.$refs.form.$el.offsetWidth, rtn.vroot.$refs.form.$el.offsetHeight);
1669
+ window.addEventListener('resize', function () {
1670
+ rtn.vroot.$refs.form.setPropData('width', window.innerWidth);
1671
+ rtn.vroot.$refs.form.setPropData('height', window.innerHeight);
1672
+ });
1673
+ }
1657
1674
  return formId;
1658
1675
  });
1659
1676
  }
@@ -1704,7 +1721,7 @@ function dialog(opt) {
1704
1721
  }
1705
1722
  }
1706
1723
  };
1707
- cls.create(undefined, `<form title="${(_c = nopt.title) !== null && _c !== void 0 ? _c : 'dialog'}" min="false" max="false" resize="false" height="0" border="${nopt.title ? 'normal' : 'plain'}" direction="v"><dialog :buttons="buttons" @select="select"${nopt.direction ? ` direction="${nopt.direction}"` : ''}>${nopt.content}</dialog></form>`).then((frm) => {
1724
+ cls.create(undefined, `<form title="${(_c = nopt.title) !== null && _c !== void 0 ? _c : 'dialog'}" min="false" max="false" resize="false" height="0" width="0" border="${nopt.title ? 'normal' : 'plain'}" direction="v"><dialog :buttons="buttons" @select="select"${nopt.direction ? ` direction="${nopt.direction}"` : ''}>${nopt.content}</dialog></form>`).then((frm) => {
1708
1725
  if (typeof frm === 'number') {
1709
1726
  resolve('');
1710
1727
  return;
@@ -1780,20 +1797,20 @@ function flash(formId, taskId) {
1780
1797
  }
1781
1798
  exports.flash = flash;
1782
1799
  function showLauncher() {
1783
- elements.launcher.style.display = 'flex';
1800
+ exports.elements.launcher.style.display = 'flex';
1784
1801
  requestAnimationFrame(function () {
1785
- elements.launcher.classList.add('cg-show');
1802
+ exports.elements.launcher.classList.add('cg-show');
1786
1803
  });
1787
1804
  }
1788
1805
  exports.showLauncher = showLauncher;
1789
1806
  function hideLauncher() {
1790
- elements.launcher.classList.remove('cg-show');
1807
+ exports.elements.launcher.classList.remove('cg-show');
1791
1808
  setTimeout(function () {
1792
1809
  if (exports.launcherRoot.folderName !== '') {
1793
1810
  exports.launcherRoot.closeFolder();
1794
1811
  }
1795
1812
  exports.launcherRoot.name = '';
1796
- elements.launcher.style.display = 'none';
1813
+ exports.elements.launcher.style.display = 'none';
1797
1814
  }, 300);
1798
1815
  }
1799
1816
  exports.hideLauncher = hideLauncher;