clickgo 3.15.49 → 3.15.50

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.15.49'}"></script>
28
+ <script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.8/dist/loader.min.js?path=index&npm={'clickgo':'3.15.50'}"></script>
29
29
  ```
30
30
 
31
31
  **index.js**
@@ -48,5 +48,21 @@ class default_1 extends clickgo.form.AbstractForm {
48
48
  'content': hash
49
49
  });
50
50
  }
51
+ onKeydown(e) {
52
+ const date = new Date();
53
+ this.list.unshift({
54
+ 'time': date.getHours().toString() + ':' + date.getMinutes().toString() + ':' + date.getSeconds().toString(),
55
+ 'name': 'keydown',
56
+ 'content': e.key
57
+ });
58
+ }
59
+ onKeyup(e) {
60
+ const date = new Date();
61
+ this.list.unshift({
62
+ 'time': date.getHours().toString() + ':' + date.getMinutes().toString() + ':' + date.getSeconds().toString(),
63
+ 'name': 'keyup',
64
+ 'content': e.key
65
+ });
66
+ }
51
67
  }
52
68
  exports.default = default_1;
package/dist/clickgo.js CHANGED
@@ -29,7 +29,7 @@ exports.isNative = isNative;
29
29
  exports.getPlatform = getPlatform;
30
30
  exports.isImmersion = isImmersion;
31
31
  exports.hasFrame = hasFrame;
32
- const version = '3.15.49';
32
+ const version = '3.15.50';
33
33
  function getVersion() {
34
34
  return version;
35
35
  }
package/dist/clickgo.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- const version = '3.15.49';
16
+ const version = '3.15.50';
17
17
  export function getVersion(): string {
18
18
  return version;
19
19
  }
package/dist/index.js CHANGED
@@ -98,6 +98,12 @@ class AbstractBoot {
98
98
  onHashChanged() {
99
99
  return;
100
100
  }
101
+ onKeydown() {
102
+ return;
103
+ }
104
+ onKeyup() {
105
+ return;
106
+ }
101
107
  onRuntimeFileLoad() {
102
108
  return;
103
109
  }
package/dist/index.ts CHANGED
@@ -176,6 +176,18 @@ export abstract class AbstractBoot {
176
176
  return;
177
177
  }
178
178
 
179
+ /** --- 键盘按下事件 --- */
180
+ public onKeydown(e: KeyboardEvent): void | Promise<void>;
181
+ public onKeydown(): void {
182
+ return;
183
+ }
184
+
185
+ /** --- 键盘弹起事件 --- */
186
+ public onKeyup(e: KeyboardEvent): void | Promise<void>;
187
+ public onKeyup(): void {
188
+ return;
189
+ }
190
+
179
191
  /** --- 环境文件准备加载时的事件 --- */
180
192
  public onRuntimeFileLoad(url: string): void | Promise<void>;
181
193
  public onRuntimeFileLoad(): void {
package/dist/lib/core.js CHANGED
@@ -149,6 +149,12 @@ class AbstractApp {
149
149
  onHashChanged() {
150
150
  return;
151
151
  }
152
+ onKeydown() {
153
+ return;
154
+ }
155
+ onKeyup() {
156
+ return;
157
+ }
152
158
  }
153
159
  exports.AbstractApp = AbstractApp;
154
160
  function getCdn() {
@@ -442,7 +448,7 @@ const globalEvents = {
442
448
  }
443
449
  };
444
450
  function trigger(name, taskId = 0, formId = 0, param1 = '', param2 = '', param3 = true) {
445
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25;
451
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30;
446
452
  const eventName = 'on' + name[0].toUpperCase() + name.slice(1);
447
453
  switch (name) {
448
454
  case 'error': {
@@ -607,6 +613,19 @@ function trigger(name, taskId = 0, formId = 0, param1 = '', param2 = '', param3
607
613
  }
608
614
  break;
609
615
  }
616
+ case 'keydown':
617
+ case 'keyup': {
618
+ (_27 = (_26 = globalEvents)[name]) === null || _27 === void 0 ? void 0 : _27.call(_26, taskId);
619
+ exports.boot === null || exports.boot === void 0 ? void 0 : exports.boot[eventName](taskId);
620
+ for (const tid in task.list) {
621
+ const t = task.list[tid];
622
+ (_28 = t.class) === null || _28 === void 0 ? void 0 : _28[eventName](taskId);
623
+ for (const fid in t.forms) {
624
+ (_30 = (_29 = t.forms[fid].vroot)[eventName]) === null || _30 === void 0 ? void 0 : _30.call(_29, taskId);
625
+ }
626
+ }
627
+ break;
628
+ }
610
629
  }
611
630
  }
612
631
  function readApp(blob) {
package/dist/lib/core.ts CHANGED
@@ -198,6 +198,18 @@ export abstract class AbstractApp {
198
198
  return;
199
199
  }
200
200
 
201
+ /** --- 键盘按下事件 --- */
202
+ public onKeydown(e: KeyboardEvent): void | Promise<void>;
203
+ public onKeydown(): void {
204
+ return;
205
+ }
206
+
207
+ /** --- 键盘弹起事件 --- */
208
+ public onKeyup(e: KeyboardEvent): void | Promise<void>;
209
+ public onKeyup(): void {
210
+ return;
211
+ }
212
+
201
213
  }
202
214
 
203
215
  /** --- CDN 地址 --- */
@@ -511,7 +523,7 @@ const globalEvents = {
511
523
  /**
512
524
  * --- 主动触发系统级事件,App 中无效,用 this.trigger 替代 ---
513
525
  */
514
- export function trigger(name: types.TGlobalEvent, taskId: number | string | boolean = 0, formId: number | string | boolean | Record<string, any> | null = 0, param1: boolean | Error | string = '', param2: string | Record<string, any> = '', param3: boolean = true): void {
526
+ export function trigger(name: types.TGlobalEvent, taskId: number | string | boolean | KeyboardEvent = 0, formId: number | string | boolean | Record<string, any> | null = 0, param1: boolean | Error | string = '', param2: string | Record<string, any> = '', param3: boolean = true): void {
515
527
  const eventName = 'on' + name[0].toUpperCase() + name.slice(1);
516
528
  switch (name) {
517
529
  case 'error': {
@@ -676,6 +688,19 @@ export function trigger(name: types.TGlobalEvent, taskId: number | string | bool
676
688
  }
677
689
  break;
678
690
  }
691
+ case 'keydown':
692
+ case 'keyup': {
693
+ (globalEvents as any)[name]?.(taskId);
694
+ (boot as any)?.[eventName](taskId);
695
+ for (const tid in task.list) {
696
+ const t = task.list[tid];
697
+ (t.class as any)?.[eventName](taskId);
698
+ for (const fid in t.forms) {
699
+ t.forms[fid].vroot[eventName]?.(taskId);
700
+ }
701
+ }
702
+ break;
703
+ }
679
704
  }
680
705
  }
681
706
 
package/dist/lib/dom.js CHANGED
@@ -1620,6 +1620,7 @@ window.addEventListener('keydown', function (e) {
1620
1620
  break;
1621
1621
  }
1622
1622
  }
1623
+ core.trigger('keydown', e);
1623
1624
  });
1624
1625
  window.addEventListener('keyup', function (e) {
1625
1626
  switch (e.key) {
@@ -1636,6 +1637,7 @@ window.addEventListener('keyup', function (e) {
1636
1637
  break;
1637
1638
  }
1638
1639
  }
1640
+ core.trigger('keyup', e);
1639
1641
  });
1640
1642
  function bindMove(e, opt) {
1641
1643
  var _a, _b, _c, _d;
package/dist/lib/dom.ts CHANGED
@@ -2059,6 +2059,7 @@ window.addEventListener('keydown', function(e: KeyboardEvent) {
2059
2059
  break;
2060
2060
  }
2061
2061
  }
2062
+ core.trigger('keydown', e);
2062
2063
  });
2063
2064
  window.addEventListener('keyup', function(e: KeyboardEvent) {
2064
2065
  switch (e.key) {
@@ -2075,6 +2076,7 @@ window.addEventListener('keyup', function(e: KeyboardEvent) {
2075
2076
  break;
2076
2077
  }
2077
2078
  }
2079
+ core.trigger('keyup', e);
2078
2080
  });
2079
2081
 
2080
2082
  /**
package/dist/lib/form.js CHANGED
@@ -623,6 +623,12 @@ class AbstractForm extends AbstractCommon {
623
623
  onHashChanged() {
624
624
  return;
625
625
  }
626
+ onKeydown() {
627
+ return;
628
+ }
629
+ onKeyup() {
630
+ return;
631
+ }
626
632
  }
627
633
  exports.AbstractForm = AbstractForm;
628
634
  const popInfo = {
package/dist/lib/form.ts CHANGED
@@ -852,6 +852,18 @@ export abstract class AbstractForm extends AbstractCommon {
852
852
  return;
853
853
  }
854
854
 
855
+ /** --- 键盘按下事件 --- */
856
+ public onKeydown(e: KeyboardEvent): void | Promise<void>;
857
+ public onKeydown(): void {
858
+ return;
859
+ }
860
+
861
+ /** --- 键盘弹起事件 --- */
862
+ public onKeyup(e: KeyboardEvent): void | Promise<void>;
863
+ public onKeyup(): void {
864
+ return;
865
+ }
866
+
855
867
  }
856
868
 
857
869
  /** --- pop 相关信息 --- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clickgo",
3
- "version": "3.15.49",
3
+ "version": "3.15.50",
4
4
  "description": "Background interface, software interface, mobile phone APP interface operation library.",
5
5
  "keywords": [
6
6
  "deskrt",
package/types/index.d.ts CHANGED
@@ -86,7 +86,7 @@ export interface IAvailArea {
86
86
  }
87
87
 
88
88
  /** --- 全局事件类型 --- */
89
- export type TGlobalEvent = 'error' | 'screenResize' | 'configChanged' | 'formCreated' | 'formRemoved' | 'formTitleChanged' | 'formIconChanged' | 'formStateMinChanged' | 'formStateMaxChanged' | 'formShowChanged' | 'formFocused' | 'formBlurred' | 'formFlash' | 'formShowInSystemTaskChange' | 'formHashChange' | 'taskStarted' | 'taskEnded' | 'launcherFolderNameChanged' | 'hashChanged';
89
+ export type TGlobalEvent = 'error' | 'screenResize' | 'configChanged' | 'formCreated' | 'formRemoved' | 'formTitleChanged' | 'formIconChanged' | 'formStateMinChanged' | 'formStateMaxChanged' | 'formShowChanged' | 'formFocused' | 'formBlurred' | 'formFlash' | 'formShowInSystemTaskChange' | 'formHashChange' | 'taskStarted' | 'taskEnded' | 'launcherFolderNameChanged' | 'hashChanged' | 'keydown' | 'keyup';
90
90
 
91
91
  /** --- 现场下载 app 的参数 --- */
92
92
  export interface ICoreFetchAppOptions {