clickgo 3.15.8 → 3.15.10

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 (50) hide show
  1. package/README.md +1 -1
  2. package/dist/app/demo/config.json +2 -0
  3. package/dist/app/demo/form/control/hske/hske.js +34 -0
  4. package/dist/app/demo/form/control/hske/hske.xml +19 -0
  5. package/dist/app/demo/form/control/label/label.xml +4 -1
  6. package/dist/app/demo/form/control/layout/layout.js +0 -23
  7. package/dist/app/demo/form/control/layout/layout.xml +1 -1
  8. package/dist/app/demo/form/control/text/text.js +1 -0
  9. package/dist/app/demo/form/control/text/text.xml +1 -1
  10. package/dist/app/demo/form/main.js +5 -0
  11. package/dist/app/demo/form/main.xml +2 -1
  12. package/dist/clickgo.js +7 -7
  13. package/dist/clickgo.ts +1 -1
  14. package/dist/control/arteditor.cgc +0 -0
  15. package/dist/control/box.cgc +0 -0
  16. package/dist/control/common.cgc +0 -0
  17. package/dist/control/desc.cgc +0 -0
  18. package/dist/control/drawer.cgc +0 -0
  19. package/dist/control/echarts.cgc +0 -0
  20. package/dist/control/form.cgc +0 -0
  21. package/dist/control/iconview.cgc +0 -0
  22. package/dist/control/jodit.cgc +0 -0
  23. package/dist/control/map.cgc +0 -0
  24. package/dist/control/monaco.cgc +0 -0
  25. package/dist/control/nav.cgc +0 -0
  26. package/dist/control/page.cgc +0 -0
  27. package/dist/control/property.cgc +0 -0
  28. package/dist/control/table.cgc +0 -0
  29. package/dist/control/task.cgc +0 -0
  30. package/dist/control/tuieditor.cgc +0 -0
  31. package/dist/control/tuiviewer.cgc +0 -0
  32. package/dist/control/xterm.cgc +0 -0
  33. package/dist/global.css +1 -1
  34. package/dist/index.js +7 -7
  35. package/dist/lib/control.js +4 -4
  36. package/dist/lib/core.js +15 -15
  37. package/dist/lib/dom.js +49 -49
  38. package/dist/lib/form.js +48 -49
  39. package/dist/lib/fs.js +19 -20
  40. package/dist/lib/fs.ts +1 -1
  41. package/dist/lib/native.js +14 -15
  42. package/dist/lib/storage.js +6 -7
  43. package/dist/lib/task.js +23 -23
  44. package/dist/lib/theme.js +7 -7
  45. package/dist/lib/tool.js +42 -42
  46. package/dist/lib/zip.js +2 -2
  47. package/dist/theme/byterun.cgt +0 -0
  48. package/dist/theme/familiar.cgt +0 -0
  49. package/dist/theme/light.cgt +0 -0
  50. package/package.json +1 -1
package/dist/lib/dom.js CHANGED
@@ -32,7 +32,55 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
32
  });
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.createElement = exports.exitFullscreen = exports.fullscreen = exports.siblingsData = exports.siblings = exports.index = exports.findParentByTag = exports.findParentByClass = exports.findParentByData = exports.bindResize = exports.bindMove = exports.is = exports.bindDrag = exports.setDragData = exports.bindLong = exports.allowEvent = exports.bindGesture = exports.bindDown = exports.bindDblClick = exports.bindClick = exports.getWatchInfo = exports.clearWatchProperty = exports.isWatchProperty = exports.watchProperty = exports.clearWatchStyle = exports.isWatchStyle = exports.watchStyle = exports.clearWatch = exports.isWatch = exports.unwatch = exports.watch = exports.getWatchCount = exports.clearWatchSize = exports.isWatchSize = exports.unwatchSize = exports.watchSize = exports.getWatchSizeCount = exports.clearWatchPosition = exports.isWatchPosition = exports.unwatchPosition = exports.watchPosition = exports.getStyleCount = exports.removeStyle = exports.pushStyle = exports.removeFromStyleList = exports.createToStyleList = exports.hasTouchButMouse = exports.setGlobalCursor = exports.inPage = void 0;
35
+ exports.is = void 0;
36
+ exports.inPage = inPage;
37
+ exports.setGlobalCursor = setGlobalCursor;
38
+ exports.hasTouchButMouse = hasTouchButMouse;
39
+ exports.createToStyleList = createToStyleList;
40
+ exports.removeFromStyleList = removeFromStyleList;
41
+ exports.pushStyle = pushStyle;
42
+ exports.removeStyle = removeStyle;
43
+ exports.getStyleCount = getStyleCount;
44
+ exports.watchPosition = watchPosition;
45
+ exports.unwatchPosition = unwatchPosition;
46
+ exports.isWatchPosition = isWatchPosition;
47
+ exports.clearWatchPosition = clearWatchPosition;
48
+ exports.getWatchSizeCount = getWatchSizeCount;
49
+ exports.watchSize = watchSize;
50
+ exports.unwatchSize = unwatchSize;
51
+ exports.isWatchSize = isWatchSize;
52
+ exports.clearWatchSize = clearWatchSize;
53
+ exports.getWatchCount = getWatchCount;
54
+ exports.watch = watch;
55
+ exports.unwatch = unwatch;
56
+ exports.isWatch = isWatch;
57
+ exports.clearWatch = clearWatch;
58
+ exports.watchStyle = watchStyle;
59
+ exports.isWatchStyle = isWatchStyle;
60
+ exports.clearWatchStyle = clearWatchStyle;
61
+ exports.watchProperty = watchProperty;
62
+ exports.isWatchProperty = isWatchProperty;
63
+ exports.clearWatchProperty = clearWatchProperty;
64
+ exports.getWatchInfo = getWatchInfo;
65
+ exports.bindClick = bindClick;
66
+ exports.bindDblClick = bindDblClick;
67
+ exports.bindDown = bindDown;
68
+ exports.bindGesture = bindGesture;
69
+ exports.allowEvent = allowEvent;
70
+ exports.bindLong = bindLong;
71
+ exports.setDragData = setDragData;
72
+ exports.bindDrag = bindDrag;
73
+ exports.bindMove = bindMove;
74
+ exports.bindResize = bindResize;
75
+ exports.findParentByData = findParentByData;
76
+ exports.findParentByClass = findParentByClass;
77
+ exports.findParentByTag = findParentByTag;
78
+ exports.index = index;
79
+ exports.siblings = siblings;
80
+ exports.siblingsData = siblingsData;
81
+ exports.fullscreen = fullscreen;
82
+ exports.exitFullscreen = exitFullscreen;
83
+ exports.createElement = createElement;
36
84
  const clickgo = __importStar(require("../clickgo"));
37
85
  const form = __importStar(require("./form"));
38
86
  const core = __importStar(require("./core"));
@@ -63,7 +111,6 @@ ${classUnfold()}, ${classUnfold('input')}, ${classUnfold('textarea')} {font-fami
63
111
  function inPage(el) {
64
112
  return document.body.contains(el);
65
113
  }
66
- exports.inPage = inPage;
67
114
  let globalCursorStyle;
68
115
  function setGlobalCursor(type) {
69
116
  if (!globalCursorStyle) {
@@ -76,7 +123,6 @@ function setGlobalCursor(type) {
76
123
  globalCursorStyle.innerHTML = '';
77
124
  }
78
125
  }
79
- exports.setGlobalCursor = setGlobalCursor;
80
126
  let lastTouchTime = 0;
81
127
  document.addEventListener('touchstart', function () {
82
128
  lastTouchTime = Date.now();
@@ -97,16 +143,13 @@ function hasTouchButMouse(e) {
97
143
  }
98
144
  return false;
99
145
  }
100
- exports.hasTouchButMouse = hasTouchButMouse;
101
146
  function createToStyleList(taskId) {
102
147
  styleList.insertAdjacentHTML('beforeend', `<div id="cg-style-task${taskId}"><div class="cg-style-control"></div><div class="cg-style-theme"></div><style class="cg-style-global"></style><div class="cg-style-form"></div></div>`);
103
148
  }
104
- exports.createToStyleList = createToStyleList;
105
149
  function removeFromStyleList(taskId) {
106
150
  var _a;
107
151
  (_a = document.getElementById('cg-style-task' + taskId.toString())) === null || _a === void 0 ? void 0 : _a.remove();
108
152
  }
109
- exports.removeFromStyleList = removeFromStyleList;
110
153
  function pushStyle(taskId, style, type = 'global', formId = 0, panelId) {
111
154
  const el = document.querySelector(`#cg-style-task${taskId} > .cg-style-${type}`);
112
155
  if (!el) {
@@ -122,7 +165,6 @@ function pushStyle(taskId, style, type = 'global', formId = 0, panelId) {
122
165
  el.insertAdjacentHTML('beforeend', `<style class="cg-style-form${formId}" data-panel="${panelId ? panelId.toString() : ''}">${style}</style>`);
123
166
  }
124
167
  }
125
- exports.pushStyle = pushStyle;
126
168
  function removeStyle(taskId, type = 'global', formId = 0, panelId) {
127
169
  const styleTask = document.getElementById('cg-style-task' + taskId.toString());
128
170
  if (!styleTask) {
@@ -157,11 +199,9 @@ function removeStyle(taskId, type = 'global', formId = 0, panelId) {
157
199
  }
158
200
  }
159
201
  }
160
- exports.removeStyle = removeStyle;
161
202
  function getStyleCount(taskId, type) {
162
203
  return document.querySelectorAll(`#cg-style-task${taskId} > .cg-style-${type} > style`).length;
163
204
  }
164
- exports.getStyleCount = getStyleCount;
165
205
  const watchPositionObjects = {};
166
206
  let watchPositionIndex = 0;
167
207
  function watchPosition(el, cb, immediate = false) {
@@ -206,7 +246,6 @@ function watchPosition(el, cb, immediate = false) {
206
246
  ++watchPositionIndex;
207
247
  return true;
208
248
  }
209
- exports.watchPosition = watchPosition;
210
249
  function unwatchPosition(el) {
211
250
  const index = el.dataset.cgPoindex;
212
251
  if (index === undefined) {
@@ -230,11 +269,9 @@ function unwatchPosition(el) {
230
269
  }
231
270
  delete watchPositionObjects[formId];
232
271
  }
233
- exports.unwatchPosition = unwatchPosition;
234
272
  function isWatchPosition(el) {
235
273
  return el.dataset.cgPoindex ? true : false;
236
274
  }
237
- exports.isWatchPosition = isWatchPosition;
238
275
  function clearWatchPosition(formId, panelId) {
239
276
  if (!watchPositionObjects[formId]) {
240
277
  return;
@@ -256,7 +293,6 @@ function clearWatchPosition(formId, panelId) {
256
293
  }
257
294
  delete watchPositionObjects[formId];
258
295
  }
259
- exports.clearWatchPosition = clearWatchPosition;
260
296
  const watchSizeList = {};
261
297
  function getWatchSizeCount(taskId) {
262
298
  if (!taskId) {
@@ -271,7 +307,6 @@ function getWatchSizeCount(taskId) {
271
307
  }
272
308
  return count;
273
309
  }
274
- exports.getWatchSizeCount = getWatchSizeCount;
275
310
  let watchSizeIndex = 0;
276
311
  const resizeObserver = new ResizeObserver(function (entries) {
277
312
  for (const entrie of entries) {
@@ -324,7 +359,6 @@ function watchSize(el, cb, immediate = false, taskId) {
324
359
  ++watchSizeIndex;
325
360
  return true;
326
361
  }
327
- exports.watchSize = watchSize;
328
362
  function unwatchSize(el, taskId) {
329
363
  const index = el.dataset.cgRoindex;
330
364
  if (index === undefined) {
@@ -338,11 +372,9 @@ function unwatchSize(el, taskId) {
338
372
  el.removeAttribute('data-cg-roindex');
339
373
  delete watchSizeList[index];
340
374
  }
341
- exports.unwatchSize = unwatchSize;
342
375
  function isWatchSize(el) {
343
376
  return el.dataset.cgRoindex ? true : false;
344
377
  }
345
- exports.isWatchSize = isWatchSize;
346
378
  function clearWatchSize(taskId) {
347
379
  for (const index in watchSizeList) {
348
380
  const item = watchSizeList[index];
@@ -354,7 +386,6 @@ function clearWatchSize(taskId) {
354
386
  delete watchSizeList[index];
355
387
  }
356
388
  }
357
- exports.clearWatchSize = clearWatchSize;
358
389
  const watchList = {};
359
390
  function getWatchCount(taskId) {
360
391
  if (!taskId) {
@@ -369,7 +400,6 @@ function getWatchCount(taskId) {
369
400
  }
370
401
  return count;
371
402
  }
372
- exports.getWatchCount = getWatchCount;
373
403
  let watchIndex = 0;
374
404
  function watch(el, cb, mode = 'default', immediate = false, taskId) {
375
405
  if (isWatch(el)) {
@@ -461,7 +491,6 @@ function watch(el, cb, mode = 'default', immediate = false, taskId) {
461
491
  ++watchIndex;
462
492
  return true;
463
493
  }
464
- exports.watch = watch;
465
494
  function unwatch(el, taskId) {
466
495
  const index = el.dataset.cgMoindex;
467
496
  if (index === undefined) {
@@ -475,11 +504,9 @@ function unwatch(el, taskId) {
475
504
  watchList[index].mo.disconnect();
476
505
  delete watchList[index];
477
506
  }
478
- exports.unwatch = unwatch;
479
507
  function isWatch(el) {
480
508
  return el.dataset.cgMoindex ? true : false;
481
509
  }
482
- exports.isWatch = isWatch;
483
510
  function clearWatch(taskId) {
484
511
  for (const index in watchList) {
485
512
  const item = watchList[index];
@@ -491,7 +518,6 @@ function clearWatch(taskId) {
491
518
  delete watchList[index];
492
519
  }
493
520
  }
494
- exports.clearWatch = clearWatch;
495
521
  const watchCgTimerHandler = function () {
496
522
  for (const index in watchSizeList) {
497
523
  const item = watchSizeList[index];
@@ -567,11 +593,9 @@ function watchStyle(el, name, cb, immediate = false) {
567
593
  el.dataset.cgStyleindex = watchStyleIndex.toString();
568
594
  ++watchStyleIndex;
569
595
  }
570
- exports.watchStyle = watchStyle;
571
596
  function isWatchStyle(el) {
572
597
  return el.dataset.cgStyleindex ? true : false;
573
598
  }
574
- exports.isWatchStyle = isWatchStyle;
575
599
  function clearWatchStyle(formId, panelId) {
576
600
  if (!watchStyleList[formId]) {
577
601
  return;
@@ -593,7 +617,6 @@ function clearWatchStyle(formId, panelId) {
593
617
  }
594
618
  delete watchStyleList[formId];
595
619
  }
596
- exports.clearWatchStyle = clearWatchStyle;
597
620
  const watchPropertyObjects = {};
598
621
  let watchPropertyIndex = 0;
599
622
  function watchProperty(el, name, cb, immediate = false) {
@@ -649,11 +672,9 @@ function watchProperty(el, name, cb, immediate = false) {
649
672
  el.dataset.cgPropertyindex = watchPropertyIndex.toString();
650
673
  ++watchPropertyIndex;
651
674
  }
652
- exports.watchProperty = watchProperty;
653
675
  function isWatchProperty(el) {
654
676
  return el.dataset.cgPropertyindex ? true : false;
655
677
  }
656
- exports.isWatchProperty = isWatchProperty;
657
678
  function clearWatchProperty(formId, panelId) {
658
679
  if (!watchPropertyObjects[formId]) {
659
680
  return;
@@ -675,7 +696,6 @@ function clearWatchProperty(formId, panelId) {
675
696
  }
676
697
  delete watchPropertyObjects[formId];
677
698
  }
678
- exports.clearWatchProperty = clearWatchProperty;
679
699
  function getWatchInfo() {
680
700
  var _a, _b;
681
701
  const rtn = {
@@ -767,7 +787,6 @@ function getWatchInfo() {
767
787
  }
768
788
  return rtn;
769
789
  }
770
- exports.getWatchInfo = getWatchInfo;
771
790
  let watchTimer = 0;
772
791
  const watchTimerHandler = function () {
773
792
  if (form.getFocus) {
@@ -912,7 +931,6 @@ function bindClick(e, handler) {
912
931
  }
913
932
  });
914
933
  }
915
- exports.bindClick = bindClick;
916
934
  const lastDblClickData = {
917
935
  'time': 0,
918
936
  'x': 0,
@@ -937,7 +955,6 @@ function bindDblClick(e, handler) {
937
955
  lastDblClickData.y = y;
938
956
  });
939
957
  }
940
- exports.bindDblClick = bindDblClick;
941
958
  function bindDown(oe, opt) {
942
959
  var _a;
943
960
  if (hasTouchButMouse(oe)) {
@@ -1047,7 +1064,6 @@ function bindDown(oe, opt) {
1047
1064
  }
1048
1065
  (_a = opt.down) === null || _a === void 0 ? void 0 : _a.call(opt, oe);
1049
1066
  }
1050
- exports.bindDown = bindDown;
1051
1067
  const gestureWheel = {
1052
1068
  'last': 0,
1053
1069
  'offset': 0,
@@ -1339,7 +1355,6 @@ function bindGesture(oe, before, handler) {
1339
1355
  });
1340
1356
  }
1341
1357
  }
1342
- exports.bindGesture = bindGesture;
1343
1358
  let lastLongTime = 0;
1344
1359
  function allowEvent(e) {
1345
1360
  const now = Date.now();
@@ -1355,7 +1370,6 @@ function allowEvent(e) {
1355
1370
  }
1356
1371
  return true;
1357
1372
  }
1358
- exports.allowEvent = allowEvent;
1359
1373
  function bindLong(e, long) {
1360
1374
  if (hasTouchButMouse(e)) {
1361
1375
  return;
@@ -1396,12 +1410,10 @@ function bindLong(e, long) {
1396
1410
  }
1397
1411
  });
1398
1412
  }
1399
- exports.bindLong = bindLong;
1400
1413
  let bindDragData = undefined;
1401
1414
  function setDragData(data) {
1402
1415
  bindDragData = data;
1403
1416
  }
1404
- exports.setDragData = setDragData;
1405
1417
  function bindDrag(e, opt) {
1406
1418
  bindDragData = opt.data;
1407
1419
  let otop = 0;
@@ -1495,7 +1507,6 @@ function bindDrag(e, opt) {
1495
1507
  }
1496
1508
  });
1497
1509
  }
1498
- exports.bindDrag = bindDrag;
1499
1510
  exports.is = clickgo.vue.reactive({
1500
1511
  'move': false,
1501
1512
  'shift': false,
@@ -1819,7 +1830,6 @@ function bindMove(e, opt) {
1819
1830
  'bottom': bottom
1820
1831
  };
1821
1832
  }
1822
- exports.bindMove = bindMove;
1823
1833
  function bindResize(e, opt) {
1824
1834
  var _a, _b;
1825
1835
  if (hasTouchButMouse(e)) {
@@ -1910,7 +1920,6 @@ function bindResize(e, opt) {
1910
1920
  'end': opt.end
1911
1921
  });
1912
1922
  }
1913
- exports.bindResize = bindResize;
1914
1923
  function findParentByData(el, name, value) {
1915
1924
  let parent = el.parentNode;
1916
1925
  while (parent) {
@@ -1934,7 +1943,6 @@ function findParentByData(el, name, value) {
1934
1943
  }
1935
1944
  return null;
1936
1945
  }
1937
- exports.findParentByData = findParentByData;
1938
1946
  function findParentByClass(el, name) {
1939
1947
  let parent = el.parentNode;
1940
1948
  while (parent) {
@@ -1951,7 +1959,6 @@ function findParentByClass(el, name) {
1951
1959
  }
1952
1960
  return null;
1953
1961
  }
1954
- exports.findParentByClass = findParentByClass;
1955
1962
  function findParentByTag(el, name) {
1956
1963
  let parent = el.parentNode;
1957
1964
  while (parent) {
@@ -1969,7 +1976,6 @@ function findParentByTag(el, name) {
1969
1976
  }
1970
1977
  return null;
1971
1978
  }
1972
- exports.findParentByTag = findParentByTag;
1973
1979
  function index(el) {
1974
1980
  let index = 0;
1975
1981
  let p = el.previousElementSibling;
@@ -1982,7 +1988,6 @@ function index(el) {
1982
1988
  }
1983
1989
  return index;
1984
1990
  }
1985
- exports.index = index;
1986
1991
  function siblings(el) {
1987
1992
  if (!el.parentNode) {
1988
1993
  return [];
@@ -1997,7 +2002,6 @@ function siblings(el) {
1997
2002
  }
1998
2003
  return list;
1999
2004
  }
2000
- exports.siblings = siblings;
2001
2005
  function siblingsData(el, name) {
2002
2006
  const list = siblings(el);
2003
2007
  const olist = [];
@@ -2009,7 +2013,6 @@ function siblingsData(el, name) {
2009
2013
  }
2010
2014
  return olist;
2011
2015
  }
2012
- exports.siblingsData = siblingsData;
2013
2016
  function fullscreen() {
2014
2017
  return __awaiter(this, void 0, void 0, function* () {
2015
2018
  const he = document.getElementsByTagName('html')[0];
@@ -2026,7 +2029,6 @@ function fullscreen() {
2026
2029
  }
2027
2030
  });
2028
2031
  }
2029
- exports.fullscreen = fullscreen;
2030
2032
  function exitFullscreen() {
2031
2033
  return __awaiter(this, void 0, void 0, function* () {
2032
2034
  const d = document;
@@ -2043,11 +2045,9 @@ function exitFullscreen() {
2043
2045
  }
2044
2046
  });
2045
2047
  }
2046
- exports.exitFullscreen = exitFullscreen;
2047
2048
  function createElement(tagName) {
2048
2049
  return document.createElement(tagName);
2049
2050
  }
2050
- exports.createElement = createElement;
2051
2051
  document.addEventListener('visibilitychange', function () {
2052
2052
  if (document.hidden) {
2053
2053
  cancelAnimationFrame(watchTimer);