clickgo 3.8.4 → 3.8.6

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
@@ -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.5.0/dist/loader.min.js?path=index&npm={'clickgo':'3.8.4'}"></script>
31
+ <script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.0/dist/loader.min.js?path=index&npm={'clickgo':'3.8.6'}"></script>
32
32
  ```
33
33
 
34
34
  **index.js**
@@ -27,7 +27,9 @@ const clickgo = __importStar(require("clickgo"));
27
27
  class default_1 extends clickgo.form.AbstractForm {
28
28
  constructor() {
29
29
  super(...arguments);
30
- this.html = `<h1>Hello world!</h1>
30
+ this.htmlIndex = 0;
31
+ this.html = [
32
+ `<h1>Hello world!</h1>
31
33
  <button>Button</button> <button disabled>Button2</button>
32
34
  <h2>H2 title</h2>
33
35
  <div>div</div>
@@ -45,7 +47,10 @@ class default_1 extends clickgo.form.AbstractForm {
45
47
  <li id="li">li</li>
46
48
  </ol>
47
49
  <script>alert('b');</script>
48
- <style>li{background:red;}div{background:blue;}#li{background:yellow;}</style>`;
50
+ <style>li{background:red;}div{background:blue;}#li{background:yellow;}</style>`,
51
+ `<h2>123</h2>
52
+ <button>Test</button>`
53
+ ];
49
54
  this.css = `div{background:blue;}.test{background:red;}#li{background:yellow;}`;
50
55
  this.lcss = '';
51
56
  this.rcss = '';
@@ -1,11 +1,12 @@
1
1
  <form title="Html" width="450" height="500" padding="10">
2
2
  <layout gutter="10" direction="v" style="flex: 1; width: 0;">
3
3
  <layout gutter="10" style="flex: 1; height: 0;">
4
- <html :html="html" :css="lcss" style="background: var(--g-plain-background); border: solid 1px var(--g-plain-border-color); padding: 10px; flex: 1; width: 0;"></html>
5
- <html :html="html" :css="rcss" style="background: var(--g-plain-background); border: solid 1px var(--g-plain-border-color); padding: 10px; flex: 1; width: 0;"></html>
4
+ <html :html="html[htmlIndex]" :css="lcss" style="background: var(--g-plain-background); border: solid 1px var(--g-plain-border-color); padding: 10px; flex: 1; width: 0;"></html>
5
+ <html :html="html[htmlIndex]" :css="rcss" style="background: var(--g-plain-background); border: solid 1px var(--g-plain-border-color); padding: 10px; flex: 1; width: 0;"></html>
6
6
  </layout>
7
7
  <layout gutter="10">
8
8
  <button style="height: 30px; flex: 1;" @click="lcss = lcss ? '' : css">Left {{lcss ? 'remove' : 'add'}} css</button>
9
+ <button style="height: 30px; flex: 1;" @click="htmlIndex = htmlIndex ? 0 : 1">Toogle html</button>
9
10
  <button style="height: 30px; flex: 1;" @click="rcss = rcss ? '' : css">Right {{rcss ? 'remove' : 'add'}} css</button>
10
11
  </layout>
11
12
  </layout>
@@ -1,4 +1,4 @@
1
- <form title="List" width="400" height="450" min-width="300" min-height="400" padding="10" direction="v">
1
+ <form title="List" width="450" height="450" min-width="300" min-height="400" padding="10" direction="v">
2
2
  <label>Greatlist: {{select}}, list: {{select2}}, label: {{label2}}</label>
3
3
  <tab v-model="ntab" :tabs="['greatlist', 'adaptation', 'beyond', 'list', 'object', 'async']" style="flex: 1; height: 0;">
4
4
  <!-- 默认 -->
@@ -93,9 +93,12 @@ class default_1 extends clickgo.form.AbstractForm {
93
93
  }
94
94
  ];
95
95
  this.slist2r = [];
96
+ this.addRemoveList = [];
96
97
  this.select2 = ['haha2'];
97
98
  this.aemodel = [];
98
99
  this.label2 = [];
100
+ this.asyncModel = ['1'];
101
+ this.asyncData = [];
99
102
  this.select3 = [];
100
103
  this.label3 = [];
101
104
  this.s3other = false;
@@ -105,6 +108,7 @@ class default_1 extends clickgo.form.AbstractForm {
105
108
  this.background = false;
106
109
  this.disabled = false;
107
110
  this.multi = false;
111
+ this.search = false;
108
112
  this.editable = false;
109
113
  this.tree = false;
110
114
  this.async = false;
@@ -150,21 +154,44 @@ class default_1 extends clickgo.form.AbstractForm {
150
154
  onRemote(value, resolve) {
151
155
  return __awaiter(this, void 0, void 0, function* () {
152
156
  yield clickgo.tool.sleep(300);
157
+ if (value === '') {
158
+ resolve(['1', '3', '5']);
159
+ return;
160
+ }
153
161
  if (value === '8') {
154
- this.slist2r = [];
155
162
  resolve();
156
163
  return;
157
164
  }
158
- this.slist2r = ['test', value, 'remote', {
165
+ resolve(['test', value, 'remote', {
159
166
  'label': 'label',
160
167
  'value': 'ok'
161
168
  }, {
162
169
  'label': 'label2',
163
170
  'value': 2
164
- }];
165
- resolve();
171
+ }]);
166
172
  });
167
173
  }
174
+ onAdd(index, value) {
175
+ this.addRemoveList.unshift('@add, index: ' + index.toString() + ', value: ' + value);
176
+ }
177
+ onRemove(index, value) {
178
+ this.addRemoveList.unshift('@remove, index: ' + index.toString() + ', value: ' + value);
179
+ }
180
+ changeArea() {
181
+ switch (this.area) {
182
+ case 'all': {
183
+ this.area = 'arrow';
184
+ break;
185
+ }
186
+ case 'arrow': {
187
+ this.area = 'text';
188
+ break;
189
+ }
190
+ default: {
191
+ this.area = 'all';
192
+ }
193
+ }
194
+ }
168
195
  onMounted() {
169
196
  this.watch(() => this.select.join(','), (n, o) => {
170
197
  let select = [];
@@ -1,4 +1,4 @@
1
- <form title="Select" width="400" height="450" min-width="300" min-height="400" padding="10">
1
+ <form title="Select" width="400" height="550" min-width="300" min-height="400" padding="10">
2
2
  <layout gutter="10" direction="v" style="flex: 1; width: 0;">
3
3
  <tab v-model="ntab" :tabs="['greatselect', 'select', 'levelselect']" style="flex: 1; height: 0;">
4
4
  <!-- greatselect -->
@@ -45,23 +45,33 @@
45
45
  <layout gutter="10" direction="v" style="padding: 10px;">
46
46
  <label>Now select value is {{select2}}</label>
47
47
  <label>Label: {{label2}}</label>
48
- <select v-model="select2" @label="label2 = $event" :data="remote ? slist2r : slist2" :disabled="disabled" :editable="editable" :multi="multi" :tree="tree" :async="async" :remote="remote" :remote-delay="remoteDelay[0]" :icon="icon" icon-default="../../../res/txt.svg" @load="onLoad" @remote="onRemote" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
48
+ <select v-model="select2" @label="label2 = $event" :data="remote ? slist2r : slist2" :disabled="disabled" :editable="editable" :multi="multi" :tree="tree" :async="async" :search="search" :remote="remote" :remote-delay="remoteDelay[0]" :icon="icon" icon-default="../../../res/txt.svg" @load="onLoad" @remote="onRemote" @add="onAdd" @remove="onRemove" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
49
+ <list :data="addRemoveList" style="height: 100px;"></list>
49
50
  <label>Custom height:</label>
50
- <select :data="remote ? slist2r : ['1','2','3','4','5']" :disabled="disabled" :editable="editable" :multi="multi" :tree="tree" :async="async" :remote="remote" :remote-delay="remoteDelay[0]" :icon="icon" icon-default="../../../res/txt.svg" style="height: 60px;" @load="onLoad" @remote="onRemote" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
51
+ <select :data="remote ? slist2r : ['1','2','3','4','5']" :disabled="disabled" :editable="editable" :multi="multi" :tree="tree" :async="async" :search="search" :remote="remote" :remote-delay="remoteDelay[0]" :icon="icon" icon-default="../../../res/txt.svg" style="height: 60px;" @load="onLoad" @remote="onRemote" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
51
52
  <label>Always editable: {{aemodel}}</label>
52
53
  <layout gutter="10">
53
- <select v-model="aemodel" :data="remote ? slist2r : ['1','2','3','4','5']" :disabled="disabled" editable :multi="multi" :tree="tree" :async="async" :remote="remote" :remote-delay="remoteDelay[0]" :icon="icon" icon-default="../../../res/txt.svg" placeholder="Please enter" @load="onLoad" @remote="onRemote" style="flex: 1;" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
54
+ <select v-model="aemodel" :data="remote ? slist2r : ['1','2','3','4','5']" :disabled="disabled" editable :multi="multi" :tree="tree" :async="async" :search="search" :remote="remote" :remote-delay="remoteDelay[0]" :icon="icon" icon-default="../../../res/txt.svg" placeholder="Please enter" @load="onLoad" @remote="onRemote" style="flex: 1;" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
54
55
  <button @click="aemodel.length=0">clear</button>
55
56
  <button @click="aemodel[0] = '4'">4</button>
56
57
  </layout>
57
58
  <layout gutter="10">
58
59
  <button @click="icon = !icon" style="flex: 1;">{{icon ? '' : '!'}}icon</button>
59
- <button @click="async = !async" style="flex: 1;">{{async ? '' : '!'}}async</button>
60
60
  <button @click="tree = !tree" style="flex: 1;">{{tree ? '' : '!'}}tree</button>
61
+ <button v-if="tree" @click="async = !async" style="flex: 1;">{{async ? '' : '!'}}async</button>
61
62
  </layout>
62
63
  <layout gutter="10">
63
- <button @click="remote = !remote" style="flex: 1;">{{remote ? '' : '!'}}remote</button>
64
- <select :data="[0, 100, 500, 1000, 2000]" v-model="remoteDelay" style="flex: 1;"></select>
64
+ <button @click="search = !search" style="flex: 1;">{{search ? '' : '!'}}search</button>
65
+ <template v-if="search">
66
+ <button @click="remote = !remote" style="flex: 1;">{{remote ? '' : '!'}}remote</button>
67
+ <select :data="[0, 100, 500, 1000, 2000]" v-model="remoteDelay" style="flex: 1;"></select>
68
+ </template>
69
+ </layout>
70
+ <!-- async 延迟加载 data -->
71
+ <label>Async value: {{asyncModel}}</label>
72
+ <layout gutter="10">
73
+ <select v-model="asyncModel" :data="asyncData" style="flex: 1;"></select>
74
+ <button v-if="!asyncData.length" @click="asyncData=['0', {'label':'ok','value':'1'},'2','3']">Load</button>
65
75
  </layout>
66
76
  </layout>
67
77
  </flow>
@@ -81,7 +91,7 @@
81
91
  </tab>
82
92
  <layout gutter="10">
83
93
  <button @click="disabled = !disabled" style="flex: 1;">{{disabled ? '' : '!'}}disabled</button>
84
- <button v-if="ntab === 'greatselect'" @click="area = area === 'all' ? 'arrow' : 'all'" style="flex: 1;">Area: {{area}}</button>
94
+ <button v-if="ntab === 'greatselect'" @click="changeArea" style="flex: 1;">Area: {{area}}</button>
85
95
  <button v-else @click="editable = !editable" style="flex: 1;">{{editable ? '' : '!'}}editable</button>
86
96
  </layout>
87
97
  <layout gutter="10">
@@ -37,7 +37,10 @@ class default_1 extends clickgo.form.AbstractForm {
37
37
  constructor() {
38
38
  super(...arguments);
39
39
  this.ntab = '';
40
- this.tabs = ['tab1'];
40
+ this.tabs = ['tab1', {
41
+ 'label': 'haha',
42
+ 'value': 'ok'
43
+ }];
41
44
  this.tindex = 1;
42
45
  this.tabPosition = 'top';
43
46
  this.color = undefined;
@@ -45,9 +48,10 @@ class default_1 extends clickgo.form.AbstractForm {
45
48
  this.drag = false;
46
49
  this.cclose = false;
47
50
  }
48
- onClose(e, i) {
51
+ onClose(e, i, v) {
49
52
  return __awaiter(this, void 0, void 0, function* () {
50
53
  if (i !== 10) {
54
+ yield clickgo.form.dialog('Closed, index: ' + i.toString() + ', value: ' + v);
51
55
  return;
52
56
  }
53
57
  e.preventDefault();
@@ -69,5 +69,10 @@ class default_1 extends clickgo.form.AbstractForm {
69
69
  yield clickgo.form.dialog('typeof localStorage: ' + typeof localStorage);
70
70
  });
71
71
  }
72
+ map() {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ yield clickgo.form.dialog('typeof Map: ' + typeof Map);
75
+ });
76
+ }
72
77
  }
73
78
  exports.default = default_1;
@@ -1,11 +1,14 @@
1
1
  <form width="350" height="400" title="System">
2
2
  <layout direction="v" gutter="10" style="flex: 1; padding: 10px;">
3
- <button @click="getVersion" style="height: 30px;">clickgo.getVersion()</button>
4
- <button @click="isNative" style="height: 30px;">clickgo.isNative()</button>
5
- <button @click="getPlatform" style="height: 30px;">clickgo.getPlatform()</button>
6
- <button @click="isImmersion" style="height: 30px;">clickgo.isImmersion()</button>
7
- <button @click="hasFrame" style="height: 30px;">clickgo.hasFrame()</button>
8
- <button @click="unblock" style="height: 30px;">unblock: ['sessionStorage']</button>
9
- <button @click="ls" style="height: 30px;">typeof localStorage</button>
3
+ <button @click="getVersion">clickgo.getVersion()</button>
4
+ <button @click="isNative">clickgo.isNative()</button>
5
+ <button @click="getPlatform">clickgo.getPlatform()</button>
6
+ <button @click="isImmersion">clickgo.isImmersion()</button>
7
+ <button @click="hasFrame">clickgo.hasFrame()</button>
8
+ <button @click="unblock">unblock: ['sessionStorage']</button>
9
+ <layout gutter="10">
10
+ <button @click="ls" style="flex: 1;">typeof localStorage</button>
11
+ <button @click="map" style="flex: 1;">Map</button>
12
+ </layout>
10
13
  </layout>
11
14
  </form>
package/dist/clickgo.js CHANGED
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.zip = exports.tool = exports.theme = exports.task = exports.storage = exports.native = exports.fs = exports.form = exports.dom = exports.core = exports.control = exports.vue = exports.hasFrame = exports.isImmersion = exports.getPlatform = exports.isNative = exports.getVersion = void 0;
27
- const version = '3.8.4';
27
+ const version = '3.8.6';
28
28
  function getVersion() {
29
29
  return version;
30
30
  }
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.8.4';
16
+ const version = '3.8.6';
17
17
  export function getVersion(): string {
18
18
  return version;
19
19
  }
Binary file
package/dist/lib/form.js CHANGED
@@ -1571,23 +1571,26 @@ function doFocusAndPopEvent(e) {
1571
1571
  if (!target) {
1572
1572
  return;
1573
1573
  }
1574
- const element = target;
1575
- if (element.dataset.cgPopOpen !== undefined) {
1576
- return;
1577
- }
1578
1574
  const paths = (_a = e.path) !== null && _a !== void 0 ? _a : (e.composedPath ? e.composedPath() : []);
1575
+ let isCgPopOpen = false;
1579
1576
  for (const item of paths) {
1580
1577
  if (!item.tagName) {
1581
1578
  continue;
1582
1579
  }
1583
- if (item.tagName.toLowerCase() === 'body') {
1584
- break;
1580
+ if (item.dataset.cgPopOpen !== undefined) {
1581
+ isCgPopOpen = true;
1582
+ continue;
1585
1583
  }
1586
- if (item.id === 'cg-pop-list') {
1584
+ if (item.classList.contains('cg-form-wrap')) {
1585
+ const formId = parseInt((_b = item.getAttribute('data-form-id')) !== null && _b !== void 0 ? _b : '0');
1586
+ changeFocus(formId);
1587
+ if (!isCgPopOpen) {
1588
+ hidePop();
1589
+ }
1587
1590
  return;
1588
1591
  }
1589
- if (item.dataset.cgPopOpen !== undefined) {
1590
- return;
1592
+ if (item.tagName.toLowerCase() === 'body') {
1593
+ break;
1591
1594
  }
1592
1595
  }
1593
1596
  for (const item of paths) {
@@ -1597,10 +1600,7 @@ function doFocusAndPopEvent(e) {
1597
1600
  if (item.tagName.toLowerCase() === 'body') {
1598
1601
  break;
1599
1602
  }
1600
- if (item.classList.contains('cg-form-wrap')) {
1601
- const formId = parseInt((_b = item.getAttribute('data-form-id')) !== null && _b !== void 0 ? _b : '0');
1602
- changeFocus(formId);
1603
- hidePop();
1603
+ if (item.id === 'cg-pop-list') {
1604
1604
  return;
1605
1605
  }
1606
1606
  }
package/dist/lib/form.ts CHANGED
@@ -2053,29 +2053,31 @@ export function doFocusAndPopEvent(e: MouseEvent | TouchEvent): void {
2053
2053
  if (!target) {
2054
2054
  return;
2055
2055
  }
2056
- const element: HTMLElement | null = target as HTMLElement;
2057
- if (element.dataset.cgPopOpen !== undefined) {
2058
- // --- 此对象为已打开 pop 的组件,不做处理,组件自行处理 ---
2059
- return;
2060
- }
2061
2056
  const paths: HTMLElement[] = (e as any).path ?? (e.composedPath ? e.composedPath() : []);
2062
- // --- 检测是不是弹出层 ---
2057
+ // --- 检测是不是窗体内部点击 ---
2058
+ let isCgPopOpen = false;
2063
2059
  for (const item of paths) {
2064
2060
  if (!item.tagName) {
2065
2061
  continue;
2066
2062
  }
2067
- if (item.tagName.toLowerCase() === 'body') {
2068
- break;
2063
+ if (item.dataset.cgPopOpen !== undefined) {
2064
+ isCgPopOpen = true;
2065
+ continue;
2069
2066
  }
2070
- if (item.id === 'cg-pop-list') {
2071
- // --- 弹出层点击,不触发丢失焦点,也不触发隐藏 pop,是否隐藏请自行处理 ---
2067
+ if (item.classList.contains('cg-form-wrap')) {
2068
+ // --- 窗体内部点击,转换焦点到当前窗体,但触发隐藏 pop ---
2069
+ const formId = parseInt(item.getAttribute('data-form-id') ?? '0');
2070
+ changeFocus(formId);
2071
+ if (!isCgPopOpen) {
2072
+ hidePop();
2073
+ }
2072
2074
  return;
2073
2075
  }
2074
- if (item.dataset.cgPopOpen !== undefined) {
2075
- return;
2076
+ if (item.tagName.toLowerCase() === 'body') {
2077
+ break;
2076
2078
  }
2077
2079
  }
2078
- // --- 检测是不是窗体内部点击 ---
2080
+ // --- 检测是不是弹出层 ---
2079
2081
  for (const item of paths) {
2080
2082
  if (!item.tagName) {
2081
2083
  continue;
@@ -2083,11 +2085,8 @@ export function doFocusAndPopEvent(e: MouseEvent | TouchEvent): void {
2083
2085
  if (item.tagName.toLowerCase() === 'body') {
2084
2086
  break;
2085
2087
  }
2086
- if (item.classList.contains('cg-form-wrap')) {
2087
- // --- 窗体内部点击,转换焦点到当前窗体,但触发隐藏 pop ---
2088
- const formId = parseInt(item.getAttribute('data-form-id') ?? '0');
2089
- changeFocus(formId);
2090
- hidePop();
2088
+ if (item.id === 'cg-pop-list') {
2089
+ // --- 弹出层点击,不触发丢失焦点,也不触发隐藏 pop,是否隐藏请自行处理 ---
2091
2090
  return;
2092
2091
  }
2093
2092
  }
package/dist/lib/task.js CHANGED
@@ -253,7 +253,7 @@ function run(url, opt = {}, ntid) {
253
253
  if (notifyId) {
254
254
  setTimeout(function () {
255
255
  form.hideNotify(notifyId);
256
- }, 2000);
256
+ }, 3000);
257
257
  }
258
258
  }
259
259
  else if (url.type !== 'app') {
@@ -269,7 +269,8 @@ function run(url, opt = {}, ntid) {
269
269
  const unblock = opt.unblock ? tool.clone(opt.unblock) : [];
270
270
  const unblockSys = [
271
271
  'require',
272
- '__awaiter', 'eval', 'Math', 'Array', 'Blob', 'Error', 'Infinity', 'getComputedStyle', 'parseInt', 'parseFloat', 'Promise', 'Date', 'JSON', 'fetch', 'Number', 'String', 'Object', 'encodeURIComponent', 'decodeURIComponent', 'FormData', 'WebSocket'
272
+ '__awaiter', 'eval', 'Math', 'Array', 'Blob', 'Error', 'Infinity', 'getComputedStyle', 'parseInt', 'parseFloat', 'Promise', 'Date', 'JSON', 'fetch', 'Number', 'String', 'Object', 'encodeURIComponent', 'decodeURIComponent', 'FormData', 'WebSocket',
273
+ 'Map', 'Set', 'WeakMap', 'WeakSet', 'RegExp', 'Function', 'Boolean', 'Symbol', 'Proxy', 'Reflect', 'Intl', 'NaN', 'navigator', 'Image', 'Audio', 'CanvasRenderingContext2D', 'WebGLRenderingContext', 'NodeList', 'HTMLCollection', 'Event', 'MouseEvent', 'KeyboardEvent', 'TouchEvent', 'File', 'FileList', 'URL', 'Navigator', 'Performance', 'Crypto', 'Worker', 'SharedWorker', 'ServiceWorker', 'WebAssembly', 'IntersectionObserver', 'MutationObserver', 'AudioContext', 'WebGL2RenderingContext', 'WebGLVertexArrayObject', 'WebGLBuffer', 'WebGLShader', 'WebGLProgram', 'WebGLTexture', 'WebGLRenderbuffer', 'WebGLFramebuffer', 'WebGLUniformLocation', 'WebGLActiveInfo', 'WebGLShaderPrecisionFormat', 'PerformanceObserver', 'PerformanceEntry', 'performance', 'ResizeObserver', 'requestIdleCallback', 'cancelIdleCallback', 'AbortController', 'AbortSignal', 'TextDecoder', 'TextEncoder', 'StorageEvent', 'BeforeUnloadEvent', 'PointerEvent', 'CompositionEvent', 'WheelEvent', 'InputEvent', 'HashChangeEvent', 'PopStateEvent', 'MessageEvent', 'Notification', 'BatteryManager', 'DeviceOrientationEvent', 'DeviceMotionEvent', 'ScreenOrientation', 'MediaQueryList', 'SpeechSynthesisUtterance', 'BroadcastChannel', 'Worklet', 'CustomEvent', 'TransitionEvent', 'AnimationEvent', 'Response', 'Request', 'Headers', 'ReadableStream', 'WritableStream', 'TransformStream', 'URLSearchParams', 'History', 'location', 'crypto', 'indexedDB', 'IDBFactory', 'IDBDatabase', 'IDBTransaction', 'IDBObjectStore', 'IDBIndex', 'IDBCursor', 'IDBKeyRange', 'IDBRequest', 'FileReader', 'Atomics', 'CanvasGradient', 'CanvasPattern', 'TextMetrics', 'ImageData', 'Path2D', 'TextTrack', 'VTTCue', 'TrackEvent', 'OfflineAudioContext', 'AnalyserNode', 'AudioBuffer', 'AudioBufferSourceNode', 'AudioDestinationNode', 'AudioListener', 'AudioNode', 'AudioParam', 'AudioScheduledSourceNode', 'AudioWorklet', 'BaseAudioContext', 'BiquadFilterNode', 'ChannelMergerNode', 'ChannelSplitterNode', 'ConstantSourceNode', 'ConvolverNode', 'DelayNode', 'DynamicsCompressorNode', 'GainNode', 'IIRFilterNode', 'MediaElementAudioSourceNode', 'MediaStreamAudioSourceNode', 'MediaStreamAudioDestinationNode', 'OscillatorNode', 'PannerNode', 'PeriodicWave', 'ScriptProcessorNode', 'StereoPannerNode', 'WaveShaperNode', 'UIEvent', 'FocusEvent', 'ClipboardEvent', 'GamepadEvent', 'MediaKeyMessageEvent', 'PageTransitionEvent', 'ProgressEvent', 'Touch', 'ErrorEvent', 'MediaStreamEvent', 'IDBVersionChangeEvent', 'SpeechSynthesisEvent', 'AudioProcessingEvent', 'OfflineAudioCompletionEvent', 'ClipboardItem', 'PresentationConnection', 'PresentationConnectionAvailableEvent', 'PresentationConnectionCloseEvent', 'PresentationConnectionList', 'PresentationReceiver', 'PresentationRequest', 'PushManager', 'PushSubscription', 'PushSubscriptionOptions', 'ServiceWorkerContainer', 'PaymentRequest', 'PaymentAddress', 'PaymentRequestUpdateEvent', 'PaymentResponse', 'PresentationAvailability', 'Bluetooth', 'BluetoothDevice', 'BluetoothRemoteGATTServer', 'BluetoothRemoteGATTService', 'BluetoothRemoteGATTCharacteristic', 'BluetoothRemoteGATTDescriptor', 'MediaRecorder', 'MessageChannel', 'MessagePort', 'atob', 'btoa'
273
274
  ];
274
275
  for (const name of unblockSys) {
275
276
  if (unblock.includes(name)) {
@@ -665,6 +666,9 @@ function run(url, opt = {}, ntid) {
665
666
  hidePop: function (pop) {
666
667
  form.hidePop(pop);
667
668
  },
669
+ doFocusAndPopEvent: function (e) {
670
+ form.doFocusAndPopEvent(e);
671
+ },
668
672
  removePanel(id, vapp, el) {
669
673
  return form.removePanel(id, vapp, el);
670
674
  },
@@ -1043,6 +1047,9 @@ function run(url, opt = {}, ntid) {
1043
1047
  },
1044
1048
  execCommand: function (ac) {
1045
1049
  tool.execCommand(ac);
1050
+ },
1051
+ compar(before, after) {
1052
+ return tool.compar(before, after);
1046
1053
  }
1047
1054
  },
1048
1055
  'zip': {
package/dist/lib/task.ts CHANGED
@@ -296,7 +296,7 @@ export async function run(url: string | types.IApp, opt: types.ITaskRunOptions =
296
296
  if (notifyId) {
297
297
  setTimeout(function(): void {
298
298
  form.hideNotify(notifyId);
299
- }, 2000);
299
+ }, 3000);
300
300
  }
301
301
  }
302
302
  else if (url.type !== 'app') {
@@ -315,7 +315,8 @@ export async function run(url: string | types.IApp, opt: types.ITaskRunOptions =
315
315
  const unblock = opt.unblock ? tool.clone(opt.unblock) : [];
316
316
  const unblockSys = [
317
317
  'require',
318
- '__awaiter', 'eval', 'Math', 'Array', 'Blob', 'Error', 'Infinity', 'getComputedStyle', 'parseInt', 'parseFloat', 'Promise', 'Date', 'JSON', 'fetch', 'Number', 'String', 'Object', 'encodeURIComponent', 'decodeURIComponent', 'FormData', 'WebSocket'
318
+ '__awaiter', 'eval', 'Math', 'Array', 'Blob', 'Error', 'Infinity', 'getComputedStyle', 'parseInt', 'parseFloat', 'Promise', 'Date', 'JSON', 'fetch', 'Number', 'String', 'Object', 'encodeURIComponent', 'decodeURIComponent', 'FormData', 'WebSocket',
319
+ 'Map', 'Set', 'WeakMap', 'WeakSet', 'RegExp', 'Function', 'Boolean', 'Symbol', 'Proxy', 'Reflect', 'Intl', 'NaN', 'navigator', 'Image', 'Audio', 'CanvasRenderingContext2D', 'WebGLRenderingContext', 'NodeList', 'HTMLCollection', 'Event', 'MouseEvent', 'KeyboardEvent', 'TouchEvent', 'File', 'FileList', 'URL', 'Navigator', 'Performance', 'Crypto', 'Worker', 'SharedWorker', 'ServiceWorker', 'WebAssembly', 'IntersectionObserver', 'MutationObserver', 'AudioContext', 'WebGL2RenderingContext', 'WebGLVertexArrayObject', 'WebGLBuffer', 'WebGLShader', 'WebGLProgram', 'WebGLTexture', 'WebGLRenderbuffer', 'WebGLFramebuffer', 'WebGLUniformLocation', 'WebGLActiveInfo', 'WebGLShaderPrecisionFormat', 'PerformanceObserver', 'PerformanceEntry', 'performance', 'ResizeObserver', 'requestIdleCallback', 'cancelIdleCallback', 'AbortController', 'AbortSignal', 'TextDecoder', 'TextEncoder', 'StorageEvent', 'BeforeUnloadEvent', 'PointerEvent', 'CompositionEvent', 'WheelEvent', 'InputEvent', 'HashChangeEvent', 'PopStateEvent', 'MessageEvent', 'Notification', 'BatteryManager', 'DeviceOrientationEvent', 'DeviceMotionEvent', 'ScreenOrientation', 'MediaQueryList', 'SpeechSynthesisUtterance', 'BroadcastChannel', 'Worklet', 'CustomEvent', 'TransitionEvent', 'AnimationEvent', 'Response', 'Request', 'Headers', 'ReadableStream', 'WritableStream', 'TransformStream', 'URLSearchParams', 'History', 'location', 'crypto', 'indexedDB', 'IDBFactory', 'IDBDatabase', 'IDBTransaction', 'IDBObjectStore', 'IDBIndex', 'IDBCursor', 'IDBKeyRange', 'IDBRequest', 'FileReader', 'Atomics', 'CanvasGradient', 'CanvasPattern', 'TextMetrics', 'ImageData', 'Path2D', 'TextTrack', 'VTTCue', 'TrackEvent', 'OfflineAudioContext', 'AnalyserNode', 'AudioBuffer', 'AudioBufferSourceNode', 'AudioDestinationNode', 'AudioListener', 'AudioNode', 'AudioParam', 'AudioScheduledSourceNode', 'AudioWorklet', 'BaseAudioContext', 'BiquadFilterNode', 'ChannelMergerNode', 'ChannelSplitterNode', 'ConstantSourceNode', 'ConvolverNode', 'DelayNode', 'DynamicsCompressorNode', 'GainNode', 'IIRFilterNode', 'MediaElementAudioSourceNode', 'MediaStreamAudioSourceNode', 'MediaStreamAudioDestinationNode', 'OscillatorNode', 'PannerNode', 'PeriodicWave', 'ScriptProcessorNode', 'StereoPannerNode', 'WaveShaperNode', 'UIEvent', 'FocusEvent', 'ClipboardEvent', 'GamepadEvent', 'MediaKeyMessageEvent', 'PageTransitionEvent', 'ProgressEvent', 'Touch', 'ErrorEvent', 'MediaStreamEvent', 'IDBVersionChangeEvent', 'SpeechSynthesisEvent', 'AudioProcessingEvent', 'OfflineAudioCompletionEvent', 'ClipboardItem', 'PresentationConnection', 'PresentationConnectionAvailableEvent', 'PresentationConnectionCloseEvent', 'PresentationConnectionList', 'PresentationReceiver', 'PresentationRequest', 'PushManager', 'PushSubscription', 'PushSubscriptionOptions', 'ServiceWorkerContainer', 'PaymentRequest', 'PaymentAddress', 'PaymentRequestUpdateEvent', 'PaymentResponse', 'PresentationAvailability', 'Bluetooth', 'BluetoothDevice', 'BluetoothRemoteGATTServer', 'BluetoothRemoteGATTService', 'BluetoothRemoteGATTCharacteristic', 'BluetoothRemoteGATTDescriptor', 'MediaRecorder', 'MessageChannel', 'MessagePort', 'atob', 'btoa'
319
320
  ];
320
321
  for (const name of unblockSys) {
321
322
  if (unblock.includes(name)) {
@@ -756,6 +757,9 @@ export async function run(url: string | types.IApp, opt: types.ITaskRunOptions =
756
757
  hidePop: function(pop?: HTMLElement): void {
757
758
  form.hidePop(pop);
758
759
  },
760
+ doFocusAndPopEvent: function(e: MouseEvent | TouchEvent): void {
761
+ form.doFocusAndPopEvent(e);
762
+ },
759
763
  removePanel(id: number, vapp: types.IVApp, el: HTMLElement): boolean {
760
764
  return form.removePanel(id, vapp, el);
761
765
  },
@@ -1162,6 +1166,16 @@ export async function run(url: string | types.IApp, opt: types.ITaskRunOptions =
1162
1166
  },
1163
1167
  execCommand: function(ac: string): void {
1164
1168
  tool.execCommand(ac);
1169
+ },
1170
+ compar(before: string[], after: string[]): {
1171
+ 'remove': Record<string, number>;
1172
+ 'add': Record<string, number>;
1173
+ 'length': {
1174
+ 'remove': number;
1175
+ 'add': number;
1176
+ };
1177
+ } {
1178
+ return tool.compar(before, after);
1165
1179
  }
1166
1180
  },
1167
1181
  'zip': {
package/dist/lib/tool.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.execCommand = exports.blob2DataUrl = exports.blob2Text = exports.urlAtom = exports.urlResolve = exports.parseUrl = exports.post = exports.fetch = exports.request = exports.rgb2hsl = exports.escapeHTML = exports.getArray = exports.getNumber = exports.getBoolean = exports.random = exports.RANDOM_LUNS = exports.RANDOM_V = exports.RANDOM_LUN = exports.RANDOM_LU = exports.RANDOM_LN = exports.RANDOM_UN = exports.RANDOM_L = exports.RANDOM_U = exports.RANDOM_N = exports.rand = exports.getMimeByPath = exports.stylePrepend = exports.teleportGlue = exports.eventsAttrWrap = exports.layoutClassPrepend = exports.layoutInsertAttr = exports.layoutAddTagClassAndReTagName = exports.styleUrl2DataUrl = exports.match = exports.purify = exports.sleepFrame = exports.nextFrame = exports.sleep = exports.clone = exports.blob2ArrayBuffer = exports.getClassPrototype = void 0;
12
+ exports.compar = exports.execCommand = exports.blob2DataUrl = exports.blob2Text = exports.urlAtom = exports.urlResolve = exports.parseUrl = exports.post = exports.fetch = exports.request = exports.rgb2hsl = exports.escapeHTML = exports.getArray = exports.getNumber = exports.getBoolean = exports.random = exports.RANDOM_LUNS = exports.RANDOM_V = exports.RANDOM_LUN = exports.RANDOM_LU = exports.RANDOM_LN = exports.RANDOM_UN = exports.RANDOM_L = exports.RANDOM_U = exports.RANDOM_N = exports.rand = exports.getMimeByPath = exports.stylePrepend = exports.teleportGlue = exports.eventsAttrWrap = exports.layoutClassPrepend = exports.layoutInsertAttr = exports.layoutAddTagClassAndReTagName = exports.styleUrl2DataUrl = exports.match = exports.purify = exports.sleepFrame = exports.nextFrame = exports.sleep = exports.clone = exports.blob2ArrayBuffer = exports.getClassPrototype = void 0;
13
13
  function getClassPrototype(obj, over = [], level = 0) {
14
14
  if (level === 0) {
15
15
  return getClassPrototype(Object.getPrototypeOf(obj), over, level + 1);
@@ -636,3 +636,31 @@ function execCommand(ac) {
636
636
  document.execCommand(ac);
637
637
  }
638
638
  exports.execCommand = execCommand;
639
+ function compar(before, after) {
640
+ const rtn = {
641
+ 'remove': {},
642
+ 'add': {},
643
+ 'length': {
644
+ 'remove': 0,
645
+ 'add': 0
646
+ }
647
+ };
648
+ for (let i = 0; i < before.length; ++i) {
649
+ const item = before[i];
650
+ if (after.includes(item)) {
651
+ continue;
652
+ }
653
+ rtn.remove[item] = i;
654
+ ++rtn.length.remove;
655
+ }
656
+ for (let i = 0; i < after.length; ++i) {
657
+ const item = after[i];
658
+ if (before.includes(item)) {
659
+ continue;
660
+ }
661
+ rtn.add[item] = i;
662
+ ++rtn.length.add;
663
+ }
664
+ return rtn;
665
+ }
666
+ exports.compar = compar;
package/dist/lib/tool.ts CHANGED
@@ -790,3 +790,50 @@ export function execCommand(ac: string): void {
790
790
  // eslint-disable-next-line deprecation/deprecation
791
791
  document.execCommand(ac);
792
792
  }
793
+
794
+ /**
795
+ * ---- 对比老值和新值,看看新值中哪些移除了,哪些新增了 ---
796
+ * @param before 老值
797
+ * @param after 新值
798
+ */
799
+ export function compar(before: string[], after: string[]): {
800
+ 'remove': Record<string, number>;
801
+ 'add': Record<string, number>;
802
+ 'length': {
803
+ 'remove': number;
804
+ 'add': number;
805
+ };
806
+ } {
807
+ const rtn: {
808
+ 'remove': Record<string, number>;
809
+ 'add': Record<string, number>;
810
+ 'length': {
811
+ 'remove': number;
812
+ 'add': number;
813
+ };
814
+ } = {
815
+ 'remove': {},
816
+ 'add': {},
817
+ 'length': {
818
+ 'remove': 0,
819
+ 'add': 0
820
+ }
821
+ };
822
+ for (let i = 0; i < before.length; ++i) {
823
+ const item = before[i];
824
+ if (after.includes(item)) {
825
+ continue;
826
+ }
827
+ rtn.remove[item] = i;
828
+ ++rtn.length.remove;
829
+ }
830
+ for (let i = 0; i < after.length; ++i) {
831
+ const item = after[i];
832
+ if (before.includes(item)) {
833
+ continue;
834
+ }
835
+ rtn.add[item] = i;
836
+ ++rtn.length.add;
837
+ }
838
+ return rtn;
839
+ }
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clickgo",
3
- "version": "3.8.4",
3
+ "version": "3.8.6",
4
4
  "description": "Background interface, software interface, mobile phone APP interface operation library.",
5
5
  "keywords": [
6
6
  "deskrt",