clickgo 3.1.11-beta2 → 3.1.13

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
@@ -3,19 +3,19 @@
3
3
  <p align="center"><img src="dist/icon.png" width="68" height="68" alt="ClickGo"></p>
4
4
  <p align="center">
5
5
  <a href="https://github.com/maiyun/clickgo/blob/master/LICENSE">
6
- <img alt="License" src="https://img.shields.io/github/license/maiyun/clickgo.svg?color=blue" />
6
+ <img alt="License" src="https://img.shields.io/github/license/maiyun/clickgo?color=blue" />
7
7
  </a>
8
8
  <a href="https://www.npmjs.com/package/clickgo">
9
- <img alt="NPM stable version" src="https://img.shields.io/npm/v/clickgo.svg?color=brightgreen&logo=npm" />
10
- <img alt="NPM beta version" src="https://img.shields.io/npm/v/clickgo/beta.svg?color=yellowgreen&logo=npm" />
11
- <img alt="NPM development version" src="https://img.shields.io/npm/v/clickgo/dev.svg?color=yellow&logo=npm" />
9
+ <img alt="NPM stable version" src="https://img.shields.io/npm/v/clickgo?color=brightgreen&logo=npm" />
10
+ <img alt="NPM beta version" src="https://img.shields.io/npm/v/clickgo/beta?color=yellowgreen&logo=npm" />
11
+ <img alt="NPM development version" src="https://img.shields.io/npm/v/clickgo/dev?color=yellow&logo=npm" />
12
12
  </a><br>
13
13
  <a href="https://github.com/maiyun/clickgo/releases">
14
- <img alt="GitHub releases" src="https://img.shields.io/github/release/maiyun/clickgo.svg?color=brightgreen&logo=github" />
15
- <img alt="GitHub pre-releases" src="https://img.shields.io/github/release/maiyun/clickgo/all.svg?color=yellow&logo=github" />
14
+ <img alt="GitHub releases" src="https://img.shields.io/github/v/release/maiyun/clickgo?color=brightgreen&logo=github" />
15
+ <img alt="GitHub pre-releases" src="https://img.shields.io/github/v/release/maiyun/clickgo?color=yellow&logo=github&include_prereleases" />
16
16
  </a>
17
17
  <a href="https://github.com/maiyun/clickgo/issues">
18
- <img alt="GitHub issues" src="https://img.shields.io/github/issues/maiyun/clickgo.svg?color=blue&logo=github" />
18
+ <img alt="GitHub issues" src="https://img.shields.io/github/issues/maiyun/clickgo?color=blue&logo=github" />
19
19
  </a>
20
20
  </p>
21
21
 
@@ -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.11-beta2'}"></script>
31
+ <script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.4.9/dist/loader.min.js?path=index&npm={'clickgo':'3.1.13'}"></script>
32
32
  ```
33
33
 
34
34
  **index.js**
@@ -35,6 +35,9 @@
35
35
  <nav-item label="有 name" name="hasname"></nav-item>
36
36
  </nav-item>
37
37
  </nav-item>
38
+ <nav-item label="Root1"></nav-item>
39
+ <nav-item label="Root2"></nav-item>
40
+ <nav-item label="Root3"></nav-item>
38
41
  <template v-slot:content>
39
42
  <layout direction="v" gutter="10" style="padding: 10px; flex: 1;">
40
43
  <label>Change the size of the form to see the effect.</label>
@@ -32,6 +32,7 @@ class default_1 extends clickgo.form.AbstractForm {
32
32
  constructor() {
33
33
  super(...arguments);
34
34
  this.selected = ['none'];
35
+ this.parentData = 'yeah!';
35
36
  }
36
37
  go() {
37
38
  this.refs.panel.go(test1_1.default, {
@@ -1,7 +1,8 @@
1
1
  <panel direction="v" gutter="10" style="padding: 10px; border: solid 2px #000; border-color: #777 #DDD #DDD #777;">
2
2
  <label>Hello, this is test1.</label>
3
3
  <label>onShow count: {{scount}}</label>
4
- <label>data: {{data}}</label>
4
+ <label>Data: {{data}}</label>
5
+ <label>Parent data: {{rootForm.parentData}}</label>
5
6
  <button @click="click" style="height: 30px;">Hi</button>
6
7
  <layout>
7
8
  <button style="padding: 15px 30px;" area="split">
@@ -1,3 +1,4 @@
1
- <panel style="padding: 10px; border: solid 2px #000; border-color: #777 #DDD #DDD #777; background: #FFF;">
1
+ <panel direction="v" gutter="10" style="padding: 10px; border: solid 2px #000; border-color: #777 #DDD #DDD #777; background: #FFF;">
2
2
  <label>Hello, test2!</label>
3
+ <label>Panel ID: {{panelId}}</label>
3
4
  </panel>
Binary file
package/dist/lib/form.js CHANGED
@@ -99,9 +99,6 @@ class AbstractCommon {
99
99
  get formId() {
100
100
  return 0;
101
101
  }
102
- get formFocus() {
103
- return this._formFocus;
104
- }
105
102
  set formFocus(b) {
106
103
  notify({
107
104
  'title': 'Error',
@@ -192,6 +189,13 @@ class AbstractPanel extends AbstractCommon {
192
189
  get panelId() {
193
190
  return 0;
194
191
  }
192
+ get rootForm() {
193
+ return {};
194
+ }
195
+ get formFocus() {
196
+ var _a;
197
+ return (_a = this.rootForm.formFocus) !== null && _a !== void 0 ? _a : false;
198
+ }
195
199
  onShow() {
196
200
  return;
197
201
  }
@@ -223,6 +227,9 @@ class AbstractForm extends AbstractCommon {
223
227
  task.list[this.taskId].runtime.dialogFormIds[task.list[this.taskId].runtime.dialogFormIds.length - 1]
224
228
  === this.formId ? false : true;
225
229
  }
230
+ get formFocus() {
231
+ return this._formFocus;
232
+ }
226
233
  show() {
227
234
  const v = this;
228
235
  if (this._firstShow) {
@@ -1611,7 +1618,6 @@ function createPanel(cls, el, formId, taskId) {
1611
1618
  }
1612
1619
  idata[item[0]] = item[1];
1613
1620
  }
1614
- idata._formFocus = false;
1615
1621
  const prot = tool.getClassPrototype(panel);
1616
1622
  const methods = prot.method;
1617
1623
  const computed = prot.access;
@@ -1661,7 +1667,20 @@ function createPanel(cls, el, formId, taskId) {
1661
1667
  set: function () {
1662
1668
  notify({
1663
1669
  'title': 'Error',
1664
- 'content': `The software tries to modify the system variable "cgPrep".\nPath: ${this.filename}`,
1670
+ 'content': `The software tries to modify the system variable "prep".\nPath: ${this.filename}`,
1671
+ 'type': 'danger'
1672
+ });
1673
+ return;
1674
+ }
1675
+ };
1676
+ computed.rootForm = {
1677
+ get: function () {
1678
+ return t.forms[formId].vroot;
1679
+ },
1680
+ set: function () {
1681
+ notify({
1682
+ 'title': 'Error',
1683
+ 'content': `The software tries to modify the system variable "rootForm".\nPath: ${this.filename}`,
1665
1684
  'type': 'danger'
1666
1685
  });
1667
1686
  return;
@@ -1920,7 +1939,7 @@ function create(cls, data, opt = {}, taskId) {
1920
1939
  set: function () {
1921
1940
  notify({
1922
1941
  'title': 'Error',
1923
- 'content': `The software tries to modify the system variable "cgPrep".\nPath: ${this.filename}`,
1942
+ 'content': `The software tries to modify the system variable "prep".\nPath: ${this.filename}`,
1924
1943
  'type': 'danger'
1925
1944
  });
1926
1945
  return;
package/dist/lib/form.ts CHANGED
@@ -116,12 +116,6 @@ abstract class AbstractCommon {
116
116
  return 0;
117
117
  }
118
118
 
119
- /** --- 当前窗体是否是焦点 --- */
120
- public get formFocus(): boolean {
121
- // --- _formFocus 在初始化时由系统设置 ---
122
- return (this as any)._formFocus;
123
- }
124
-
125
119
  public set formFocus(b: boolean) {
126
120
  notify({
127
121
  'title': 'Error',
@@ -282,6 +276,16 @@ export abstract class AbstractPanel extends AbstractCommon {
282
276
  return 0;
283
277
  }
284
278
 
279
+ /** --- 当前 panel 所在窗体的窗体对象,系统会在创建时重写本函数 --- */
280
+ public get rootForm(): AbstractForm & Record<string, any> {
281
+ return {} as any;
282
+ }
283
+
284
+ /** --- 当前窗体是否是焦点 --- */
285
+ public get formFocus(): boolean {
286
+ return this.rootForm.formFocus ?? false;
287
+ }
288
+
285
289
  public onShow(data: Record<string, any>): void | Promise<void>;
286
290
  public onShow(): void {
287
291
  return;
@@ -332,6 +336,12 @@ export abstract class AbstractForm extends AbstractCommon {
332
336
  === this.formId ? false : true;
333
337
  }
334
338
 
339
+ /** --- 当前窗体是否是焦点 --- */
340
+ public get formFocus(): boolean {
341
+ // --- _formFocus 在初始化时由系统设置 ---
342
+ return (this as any)._formFocus;
343
+ }
344
+
335
345
  /** --- 当前是不是初次显示 --- */
336
346
  private _firstShow: boolean = true;
337
347
 
@@ -2115,7 +2125,6 @@ export async function createPanel<T extends AbstractPanel>(
2115
2125
  }
2116
2126
  idata[item[0]] = item[1];
2117
2127
  }
2118
- idata._formFocus = false;
2119
2128
  /** --- class 对象的方法和 getter/setter 列表 --- */
2120
2129
  const prot = tool.getClassPrototype(panel);
2121
2130
  const methods = prot.method;
@@ -2166,7 +2175,20 @@ export async function createPanel<T extends AbstractPanel>(
2166
2175
  set: function(this: types.IVue): void {
2167
2176
  notify({
2168
2177
  'title': 'Error',
2169
- 'content': `The software tries to modify the system variable "cgPrep".\nPath: ${this.filename}`,
2178
+ 'content': `The software tries to modify the system variable "prep".\nPath: ${this.filename}`,
2179
+ 'type': 'danger'
2180
+ });
2181
+ return;
2182
+ }
2183
+ };
2184
+ computed.rootForm = {
2185
+ get: function(): AbstractForm & Record<string, any> {
2186
+ return t.forms[formId].vroot as any;
2187
+ },
2188
+ set: function(this: types.IVue): void {
2189
+ notify({
2190
+ 'title': 'Error',
2191
+ 'content': `The software tries to modify the system variable "rootForm".\nPath: ${this.filename}`,
2170
2192
  'type': 'danger'
2171
2193
  });
2172
2194
  return;
@@ -2478,7 +2500,7 @@ export async function create<T extends AbstractForm>(
2478
2500
  set: function(this: types.IVue): void {
2479
2501
  notify({
2480
2502
  'title': 'Error',
2481
- 'content': `The software tries to modify the system variable "cgPrep".\nPath: ${this.filename}`,
2503
+ 'content': `The software tries to modify the system variable "prep".\nPath: ${this.filename}`,
2482
2504
  'type': 'danger'
2483
2505
  });
2484
2506
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clickgo",
3
- "version": "3.1.11-beta2",
3
+ "version": "3.1.13",
4
4
  "description": "Background interface, software interface, mobile phone APP interface operation library.",
5
5
  "keywords": [
6
6
  "deskrt",