ts-glitter 21.6.2 → 21.6.5

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 (53) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/backend-manager/bg-blog.js +186 -8
  4. package/lowcode/backend-manager/bg-blog.ts +206 -11
  5. package/lowcode/backend-manager/bg-widget.js +20 -17
  6. package/lowcode/backend-manager/bg-widget.ts +23 -19
  7. package/lowcode/cms-plugin/permission-setting.js +2 -3
  8. package/lowcode/cms-plugin/permission-setting.ts +2 -3
  9. package/lowcode/cms-plugin/shopping-discount-setting.js +1711 -341
  10. package/lowcode/cms-plugin/shopping-discount-setting.ts +1938 -327
  11. package/lowcode/editor-components/global-widget/bridge.js +30 -0
  12. package/lowcode/editor-components/global-widget/bridge.ts +131 -2
  13. package/lowcode/form-view/e-commerce/product-select.js +6 -16
  14. package/lowcode/form-view/e-commerce/product-select.ts +16 -18
  15. package/lowcode/glitter-base/global/language.js +2 -0
  16. package/lowcode/glitter-base/global/language.ts +2 -0
  17. package/lowcode/glitterBundle/html-component/global-widget.js +0 -74
  18. package/lowcode/glitterBundle/html-component/global-widget.ts +1 -81
  19. package/lowcode/official_view_component/official/component.ts +0 -2
  20. package/lowcode/public-components/checkout/index.js +1 -1
  21. package/lowcode/public-components/checkout/index.ts +1 -1
  22. package/lowcode/public-components/user-manager/um-info.js +4 -0
  23. package/lowcode/public-components/user-manager/um-info.ts +4 -1
  24. package/lowcode/public-components/user-manager/um-login.js +3 -3
  25. package/lowcode/public-components/user-manager/um-login.ts +3 -6
  26. package/lowcode/public-components/user-manager/um-rebate.js +6 -2
  27. package/lowcode/public-components/user-manager/um-rebate.ts +28 -2
  28. package/package.json +1 -1
  29. package/src/api-public/controllers/shop.js +1 -0
  30. package/src/api-public/controllers/shop.js.map +1 -1
  31. package/src/api-public/controllers/shop.ts +1 -0
  32. package/src/api-public/services/data-analyze.d.ts +1 -1
  33. package/src/api-public/services/rebate.d.ts +14 -2
  34. package/src/api-public/services/rebate.js +66 -24
  35. package/src/api-public/services/rebate.js.map +1 -1
  36. package/src/api-public/services/rebate.ts +91 -24
  37. package/src/api-public/services/schedule.js +1 -3
  38. package/src/api-public/services/schedule.js.map +1 -1
  39. package/src/api-public/services/schedule.ts +1 -1
  40. package/src/api-public/services/shopping.js +35 -6
  41. package/src/api-public/services/shopping.js.map +1 -1
  42. package/src/api-public/services/shopping.ts +45 -12
  43. package/src/index.js +17 -7
  44. package/src/index.js.map +1 -1
  45. package/src/modules/database.js +1 -1
  46. package/src/modules/database.js.map +1 -1
  47. package/src/modules/database.ts +1 -1
  48. package/src/run.js +1 -1
  49. package/src/run.js.map +1 -1
  50. package/src/run.ts +1 -1
  51. package/src/services/system-schedule.js +1 -1
  52. package/src/services/system-schedule.js.map +1 -1
  53. package/src/services/system-schedule.ts +3 -2
@@ -2850,9 +2850,8 @@ ${obj.default ?? ''}</textarea
2850
2850
  }
2851
2851
  ) {
2852
2852
  const id = gvc.glitter.getUUID();
2853
- const inputColor = obj && obj.readonly ? '#808080' : undefined;
2854
- const randomString =
2855
- obj && obj.single ? this.getWhiteDotClass(gvc, inputColor) : this.getCheckedClass(gvc, inputColor);
2853
+ const isReadonly = Boolean(obj && obj.readonly);
2854
+ const randomString = obj?.single ? this.getWhiteDotClass(gvc, isReadonly) : this.getCheckedClass(gvc, isReadonly);
2856
2855
  const viewId = Tool.randomString(5);
2857
2856
 
2858
2857
  return gvc.bindView({
@@ -2924,9 +2923,8 @@ ${obj.default ?? ''}</textarea
2924
2923
  readonly?: boolean;
2925
2924
  }
2926
2925
  ) {
2927
- const inputColor = undefined;
2928
- const checkedString = this.getCheckedClass(gvc, inputColor);
2929
- const squareString = this.getSquareClass(gvc, inputColor);
2926
+ const checkedString = this.getCheckedClass(gvc);
2927
+ const squareString = this.getSquareClass(gvc);
2930
2928
  const viewId = Tool.randomString(5);
2931
2929
  const randomKey = Tool.randomString(5);
2932
2930
 
@@ -2995,9 +2993,7 @@ ${obj.default ?? ''}</textarea
2995
2993
  }) {
2996
2994
  obj.type = obj.type ?? 'single';
2997
2995
  const gvc = obj.gvc;
2998
- const inputColor = undefined;
2999
- const randomString =
3000
- obj.type === 'single' ? this.getWhiteDotClass(gvc, inputColor) : this.getCheckedClass(gvc, inputColor);
2996
+ const randomString = obj.type === 'single' ? this.getWhiteDotClass(gvc) : this.getCheckedClass(gvc);
3001
2997
  return html`
3002
2998
  ${obj.title ? html` <div class="tx_normal fw-normal">${obj.title}</div>` : ``}
3003
2999
  ${obj.gvc.bindView(() => {
@@ -5261,9 +5257,17 @@ ${obj.default ?? ''}</textarea
5261
5257
  return `"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='${color}'%3e%3cpath d='M225.813 48.907L128 146.72 30.187 48.907 0 79.093l128 128 128-128z'/%3e%3c/svg%3e"`;
5262
5258
  }
5263
5259
 
5264
- static checkedDataImage(color: string): string {
5265
- color = color.replace('#', '%23');
5266
- return `"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='${color}' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e"`;
5260
+ static checkedDataImage(): string {
5261
+ const color = '#fff'.replace('#', '%23');
5262
+ return `"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2217%22%20viewBox%3D%220%200%2016%2017%22%20fill%3D%22none%22%3E%0A%20%20%3Crect%20y%3D%220.5%22%20width%3D%2216%22%20height%3D%2216%22%20rx%3D%223%22%20fill%3D%22%23393939%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M4.5%209L7%2011.5L11.5%205.5%22%20stroke%3D%22${color}%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E"`;
5263
+ // return `"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='${color}' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e"`;
5264
+ }
5265
+
5266
+ static readonlyCheckedDataImage(): string {
5267
+ const color = '#fff'.replace('#', '%23');
5268
+ const bgr = '#8d8d8d'.replace('#', '%23');
5269
+ return `"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2217%22%20viewBox%3D%220%200%2016%2017%22%20fill%3D%22none%22%3E%0A%20%20%3Crect%20y%3D%220.5%22%20width%3D%2216%22%20height%3D%2216%22%20rx%3D%223%22%20fill%3D%22${bgr}%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M4.5%209L7%2011.5L11.5%205.5%22%20stroke%3D%22${color}%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E"`;
5270
+ // return `"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='${color}' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e"`;
5267
5271
  }
5268
5272
 
5269
5273
  static squareDataImage(color: string): string {
@@ -5281,17 +5285,17 @@ ${obj.default ?? ''}</textarea
5281
5285
  return `"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='16' height='16' rx='8' fill='${color}'/%3e%3crect x='4' y='4' width='8' height='8' rx='4' fill='white'/%3e%3c/svg%3e"`;
5282
5286
  }
5283
5287
 
5284
- static getCheckedClass(gvc: GVC, color?: string) {
5285
- const className = color ? 'checked-image' : 'checked-image-readonly';
5288
+ static getCheckedClass(gvc: GVC, readonly?: boolean) {
5289
+ const className = readonly ? 'checked-image-readonly' : 'checked-image';
5286
5290
  gvc.addStyle(`
5287
5291
  .${className} {
5288
5292
  min-width: 1.25rem;
5289
5293
  min-height: 1.25rem;
5290
5294
  }
5291
5295
  .${className}:checked[type='checkbox'] {
5292
- border: 2px solid ${color ?? '#000'};
5296
+ border: 0;
5293
5297
  background-color: #fff;
5294
- background-image: url(${this.checkedDataImage(color ?? '#000')});
5298
+ background-image: url(${readonly ? this.readonlyCheckedDataImage() : this.checkedDataImage()});
5295
5299
  background-position: center center;
5296
5300
  }
5297
5301
  `);
@@ -5331,8 +5335,8 @@ ${obj.default ?? ''}</textarea
5331
5335
  return className;
5332
5336
  }
5333
5337
 
5334
- static getWhiteDotClass(gvc: GVC, color?: string) {
5335
- const className = color ? 'white-dot-image' : 'white-dot-image-readonly';
5338
+ static getWhiteDotClass(gvc: GVC, readonly?: boolean) {
5339
+ const className = readonly ? 'white-dot-image-readonly' : 'white-dot-image';
5336
5340
  gvc.addStyle(`
5337
5341
  .${className} {
5338
5342
  min-width: 1.15rem;
@@ -5342,7 +5346,7 @@ ${obj.default ?? ''}</textarea
5342
5346
  .${className}:checked[type='radio'] {
5343
5347
  border: 0px solid #000;
5344
5348
  background-color: #fff;
5345
- background-image: url(${this.whiteDotDataImage(color ?? '#000')});
5349
+ background-image: url(${this.whiteDotDataImage(readonly ? '#808080' : '#000')});
5346
5350
  background-position: center center;
5347
5351
  }
5348
5352
  `);
@@ -839,8 +839,7 @@ export class PermissionSetting {
839
839
  }
840
840
  static checkboxContainer(gvc, items, authData, callback) {
841
841
  const id = gvc.glitter.getUUID();
842
- const inputColor = undefined;
843
- const randomString = BgWidget.getCheckedClass(gvc, inputColor);
842
+ const randomString = BgWidget.getCheckedClass(gvc);
844
843
  const viewId = Tool.randomString(5);
845
844
  function renderCheck(key, status) {
846
845
  if (key) {
@@ -920,7 +919,7 @@ export class PermissionSetting {
920
919
  </div>
921
920
  `;
922
921
  });
923
- return html ` <div class="row" >${checkboxHTML}</div> `;
922
+ return html ` <div class="row">${checkboxHTML}</div> `;
924
923
  },
925
924
  });
926
925
  }
@@ -998,8 +998,7 @@ export class PermissionSetting {
998
998
  callback?: () => void
999
999
  ) {
1000
1000
  const id = gvc.glitter.getUUID();
1001
- const inputColor = undefined;
1002
- const randomString = BgWidget.getCheckedClass(gvc, inputColor);
1001
+ const randomString = BgWidget.getCheckedClass(gvc);
1003
1002
  const viewId = Tool.randomString(5);
1004
1003
 
1005
1004
  function renderCheck(key: string | undefined, status: boolean) {
@@ -1082,7 +1081,7 @@ export class PermissionSetting {
1082
1081
  `;
1083
1082
  });
1084
1083
 
1085
- return html` <div class="row" >${checkboxHTML}</div> `;
1084
+ return html` <div class="row">${checkboxHTML}</div> `;
1086
1085
  },
1087
1086
  });
1088
1087
  }