ts-glitter 13.8.7985 → 13.8.7992

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/lowcode/Entry.js CHANGED
@@ -70,7 +70,7 @@ export class Entry {
70
70
  }
71
71
  window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
72
72
  console.log(`Entry-time:`, window.renderClock.stop());
73
- glitter.share.editerVersion = 'V_13.8.7985';
73
+ glitter.share.editerVersion = 'V_13.8.7992';
74
74
  glitter.share.start = new Date();
75
75
  const vm = {
76
76
  appConfig: [],
package/lowcode/Entry.ts CHANGED
@@ -71,7 +71,7 @@ export class Entry {
71
71
  }
72
72
  (window as any).renderClock = (window as any).renderClock ?? clockF();
73
73
  console.log(`Entry-time:`, (window as any).renderClock.stop());
74
- glitter.share.editerVersion = 'V_13.8.7985';
74
+ glitter.share.editerVersion = 'V_13.8.7992';
75
75
  glitter.share.start = new Date();
76
76
  const vm: {
77
77
  appConfig: any;
@@ -25,14 +25,14 @@ export class ApiWallet {
25
25
  data: JSON.stringify(json),
26
26
  });
27
27
  }
28
- static getWallet() {
28
+ static getWallet(token) {
29
29
  return BaseApi.create({
30
30
  url: getBaseUrl() + `/api-public/v1/wallet/sum`,
31
31
  type: 'GET',
32
32
  headers: {
33
33
  'Content-Type': 'application/json',
34
34
  'g-app': getConfig().config.appName,
35
- Authorization: getConfig().config.token,
35
+ Authorization: token || getConfig().config.token,
36
36
  },
37
37
  });
38
38
  }
@@ -28,14 +28,14 @@ export class ApiWallet {
28
28
  });
29
29
  }
30
30
 
31
- public static getWallet() {
31
+ public static getWallet(token?:string) {
32
32
  return BaseApi.create({
33
33
  url: getBaseUrl() + `/api-public/v1/wallet/sum`,
34
34
  type: 'GET',
35
35
  headers: {
36
36
  'Content-Type': 'application/json',
37
37
  'g-app': getConfig().config.appName,
38
- Authorization: getConfig().config.token,
38
+ Authorization: token || getConfig().config.token,
39
39
  },
40
40
  });
41
41
  }
@@ -993,6 +993,9 @@ ${(!error.message) ? `` : `錯誤訊息:${error.message}`}${(!error.lineNumber)
993
993
  return fun();
994
994
  }
995
995
  }
996
+ isTouchDevice() {
997
+ return ('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0);
998
+ }
996
999
  getUUID(format) {
997
1000
  let d = Date.now();
998
1001
  if (typeof performance !== 'undefined' && typeof performance.now === 'function') {
@@ -572,6 +572,9 @@ ${(!error.message) ? `` : `錯誤訊息:${error.message}`}${(!error.lineNumber)
572
572
  }
573
573
  }
574
574
 
575
+ public isTouchDevice(){
576
+ return ('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || ((navigator as any).msMaxTouchPoints > 0);
577
+ }
575
578
  public getUUID(format?: string): string {
576
579
  let d = Date.now();
577
580
 
@@ -1604,7 +1604,7 @@ ${dd.value === vm.select ? `background:linear-gradient(135deg, #667eea 0%, #764b
1604
1604
  },
1605
1605
  divCreate: option.divCreate || {
1606
1606
  class: `w-100`,
1607
- style: `height:calc(100vh - ${(document.body.clientWidth < 800) ? 0 : 56}px);overflow-y:auto;`,
1607
+ style: `height:calc(100vh - ${(document.body.clientWidth < 800) ? 0 : 56 + glitter.share.top_inset}px);overflow-y:auto;`,
1608
1608
  },
1609
1609
  };
1610
1610
  });
@@ -1703,7 +1703,7 @@ ${dd.value === vm.select ? `background:linear-gradient(135deg, #667eea 0%, #764b
1703
1703
  },
1704
1704
  divCreate: option.divCreate || {
1705
1705
  class: `w-100`,
1706
- style: `height:calc(100vh - ${(document.body.clientWidth < 800) ? 0 : 56}px);overflow-y:auto;`,
1706
+ style: `height:calc(100vh - ${(document.body.clientWidth < 800) ? 0 : 56+glitter.share.top_inset}px);overflow-y:auto;`,
1707
1707
  },
1708
1708
  };
1709
1709
  });
@@ -164,7 +164,7 @@ export class imageLibrary {
164
164
  gvc.notifyDataChange(vm.id);
165
165
  event.stopPropagation();
166
166
  })}"
167
- ${document.body.clientWidth > 800 ? `
167
+ ${(!gvc.glitter.isTouchDevice()) ? `
168
168
  onmouseenter="${gvc.event(() => {
169
169
  if ((opt === null || opt === void 0 ? void 0 : opt.onlyRead) || cf.key == "album") {
170
170
  return;
@@ -208,7 +208,7 @@ export class imageLibrary {
208
208
  gvc.notifyDataChange(vm.id)
209
209
  event.stopPropagation();
210
210
  })}"
211
- ${document.body.clientWidth>800 ? `
211
+ ${(!gvc.glitter.isTouchDevice()) ? `
212
212
  onmouseenter="${gvc.event(() => {
213
213
  if (opt?.onlyRead || cf.key == "album") {
214
214
  return
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { TriggerEvent } from "../../glitterBundle/plugins/trigger-event.js";
11
11
  import { ApiWallet } from "../../glitter-base/route/wallet.js";
12
+ import { GlobalUser } from "../../glitter-base/global/global-user.js";
12
13
  TriggerEvent.createSingleEvent(import.meta.url, () => {
13
14
  return {
14
15
  fun: (gvc, widget, object, subData, element) => {
@@ -18,7 +19,7 @@ TriggerEvent.createSingleEvent(import.meta.url, () => {
18
19
  },
19
20
  event: () => {
20
21
  return new Promise((resolve, reject) => __awaiter(void 0, void 0, void 0, function* () {
21
- ApiWallet.getWallet().then((res) => __awaiter(void 0, void 0, void 0, function* () {
22
+ ApiWallet.getWallet(GlobalUser.token).then((res) => __awaiter(void 0, void 0, void 0, function* () {
22
23
  resolve(res.result && res.response.sum);
23
24
  }));
24
25
  }));
@@ -1,6 +1,7 @@
1
1
  import {TriggerEvent} from "../../glitterBundle/plugins/trigger-event.js";
2
2
  import {ApiShop} from "../../glitter-base/route/shopping.js";
3
3
  import {ApiWallet} from "../../glitter-base/route/wallet.js";
4
+ import {GlobalUser} from "../../glitter-base/global/global-user.js";
4
5
 
5
6
  TriggerEvent.createSingleEvent(import.meta.url, () => {
6
7
  return {
@@ -13,7 +14,7 @@ TriggerEvent.createSingleEvent(import.meta.url, () => {
13
14
  event: () => {
14
15
 
15
16
  return new Promise(async (resolve, reject) => {
16
- ApiWallet.getWallet().then(async (res) => {
17
+ ApiWallet.getWallet(GlobalUser.token).then(async (res) => {
17
18
  resolve(res.result && res.response.sum)
18
19
  })
19
20
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "13.8.7985",
3
+ "version": "13.8.7992",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,7 +23,7 @@ declare const _default: {
23
23
  getPagination: (sql: string, page: number, pageCount: number) => string;
24
24
  escape: (parameter: any) => string;
25
25
  queryLambada: (cf: {
26
- database?: string | undefined;
26
+ database?: string;
27
27
  }, fun: (v: {
28
28
  query(sql: string, params: unknown[]): Promise<any>;
29
29
  }) => any) => Promise<any>;
@@ -76,7 +76,7 @@ const query = async (sql, params) => {
76
76
  const TAG = '[Database][Query]';
77
77
  try {
78
78
  const connection = await pool.getConnection();
79
- await pool.query(`SET time_zone = '+08:00';`, []);
79
+ await pool.query(`SET time_zone = '+00:00';`, []);
80
80
  const [results] = await pool.query(sql, params);
81
81
  connection.release();
82
82
  return results;
@@ -71,7 +71,7 @@ const query = async (sql: string, params: unknown[]): Promise<any> => {
71
71
  const TAG = '[Database][Query]';
72
72
  try {
73
73
  const connection = await pool.getConnection();
74
- await pool.query(`SET time_zone = '+08:00';`,[]);
74
+ await pool.query(`SET time_zone = '+00:00';`,[]);
75
75
  const [results] = await pool.query(sql, params);
76
76
  connection.release();
77
77
  return results;