ts-glitter 21.1.7 → 21.1.8

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 (49) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/backend-manager/bg-product.js +39 -18
  4. package/lowcode/backend-manager/bg-product.ts +54 -23
  5. package/lowcode/cms-plugin/pos-pages/payment-page.js +37 -29
  6. package/lowcode/cms-plugin/pos-pages/payment-page.ts +61 -49
  7. package/lowcode/cms-plugin/pos-pages/pos-function.js +6 -1
  8. package/lowcode/cms-plugin/pos-pages/pos-function.ts +8 -1
  9. package/lowcode/cms-plugin/stock-history.js +1 -0
  10. package/lowcode/cms-plugin/stock-history.ts +1 -10
  11. package/lowcode/css/editor.css +2 -2
  12. package/lowcode/form-view/e-commerce/product-select.js +13 -11
  13. package/lowcode/form-view/e-commerce/product-select.ts +14 -12
  14. package/lowcode/modules/tool.js +9 -0
  15. package/lowcode/modules/tool.ts +12 -0
  16. package/lowcode/public-components/checkout/index.js +216 -207
  17. package/lowcode/public-components/checkout/index.ts +1315 -1309
  18. package/package.json +1 -1
  19. package/src/api-public/models/glitter-finance.js +1 -2
  20. package/src/api-public/models/glitter-finance.js.map +1 -5
  21. package/src/api-public/services/checkout-event.js +17 -7
  22. package/src/api-public/services/checkout-event.js.map +1 -1
  23. package/src/api-public/services/data-analyze.d.ts +1 -1
  24. package/src/api-public/services/fb-service.js +4 -4
  25. package/src/api-public/services/fb-service.js.map +1 -1
  26. package/src/api-public/services/schedule.d.ts +1 -1
  27. package/src/api-public/services/schedule.js +18 -14
  28. package/src/api-public/services/schedule.js.map +1 -1
  29. package/src/api-public/services/schedule.ts +18 -14
  30. package/src/api-public/services/user.js +17 -7
  31. package/src/api-public/services/user.js.map +1 -1
  32. package/src/config.d.ts +1 -1
  33. package/src/modules/AWSLib.js +2 -3
  34. package/src/modules/AWSLib.js.map +1 -1
  35. package/src/modules/database.d.ts +1 -1
  36. package/src/modules/redis.d.ts +1 -1
  37. package/src/modules/tool.d.ts +4 -4
  38. package/src/modules/tool.js +1 -2
  39. package/src/modules/tool.js.map +1 -1
  40. package/src/services/app.js +17 -7
  41. package/src/services/app.js.map +1 -1
  42. package/src/services/backend-service.js +17 -7
  43. package/src/services/backend-service.js.map +1 -1
  44. package/src/services/create-instance.js +3 -4
  45. package/src/services/create-instance.js.map +1 -1
  46. package/src/services/saas-table-check.js +2 -2
  47. package/src/services/saas-table-check.js.map +1 -5
  48. package/src/services/tool.js +2 -3
  49. package/src/services/tool.js.map +1 -1
@@ -124,9 +124,10 @@ export class ProductSelect {
124
124
  return [];
125
125
  }
126
126
  }))();
127
- resolve(html ` <div class="d-flex flex-column py-2 my-2 border-top" style="gap: 18px;">
127
+ resolve(html ` <div class="d-flex flex-column py-2" style="">
128
+ <div class="mx-n3 border-top" ></div>
128
129
  <div
129
- class="d-flex align-items-center gray-bottom-line-18 pb-2"
130
+ class="d-flex align-items-center pb-2"
130
131
  style="gap: 10px; justify-content: space-between;"
131
132
  >
132
133
  <div class="flex-fill ">
@@ -153,14 +154,7 @@ export class ProductSelect {
153
154
  class="${bundle.formData[bundle.key].select === 'all' ? `d-none` : ``}"
154
155
  style="margin-top: 30px;"
155
156
  >
156
- ${BgWidget.grayButton((() => {
157
- switch (bundle.formData[bundle.key].select) {
158
- case 'product':
159
- case 'collection':
160
- return `選取`;
161
- }
162
- return ``;
163
- })(), gvc.event(() => {
157
+ ${BgWidget.save(gvc.event(() => {
164
158
  var _a, _b;
165
159
  if (bundle.formData[bundle.key].select === 'product') {
166
160
  bundle.formData[bundle.key].value = (_a = bundle.formData[bundle.key].value) !== null && _a !== void 0 ? _a : [];
@@ -186,7 +180,14 @@ export class ProductSelect {
186
180
  }),
187
181
  });
188
182
  }
189
- }), { textStyle: 'font-weight: 400;' })}
183
+ }), (() => {
184
+ switch (bundle.formData[bundle.key].select) {
185
+ case 'product':
186
+ case 'collection':
187
+ return `選取`;
188
+ }
189
+ return ``;
190
+ })())}
190
191
  </div>
191
192
  </div>
192
193
  <div class="d-flex flex-column gap-2" id="${subVM.containerId}">
@@ -232,6 +233,7 @@ export class ProductSelect {
232
233
  }
233
234
  }))}
234
235
  </div>
236
+ <div class="mx-n3 border-top" ></div>
235
237
  </div>`);
236
238
  }));
237
239
  },
@@ -127,9 +127,10 @@ export class ProductSelect {
127
127
  }
128
128
  })();
129
129
  resolve(
130
- html` <div class="d-flex flex-column py-2 my-2 border-top" style="gap: 18px;">
130
+ html` <div class="d-flex flex-column py-2" style="">
131
+ <div class="mx-n3 border-top" ></div>
131
132
  <div
132
- class="d-flex align-items-center gray-bottom-line-18 pb-2"
133
+ class="d-flex align-items-center pb-2"
133
134
  style="gap: 10px; justify-content: space-between;"
134
135
  >
135
136
  <div class="flex-fill ">
@@ -156,15 +157,7 @@ export class ProductSelect {
156
157
  class="${bundle.formData[bundle.key].select === 'all' ? `d-none` : ``}"
157
158
  style="margin-top: 30px;"
158
159
  >
159
- ${BgWidget.grayButton(
160
- (() => {
161
- switch (bundle.formData[bundle.key].select) {
162
- case 'product':
163
- case 'collection':
164
- return `選取`;
165
- }
166
- return ``;
167
- })(),
160
+ ${BgWidget.save(
168
161
  gvc.event(() => {
169
162
  if (bundle.formData[bundle.key].select === 'product') {
170
163
  bundle.formData[bundle.key].value = bundle.formData[bundle.key].value ?? [];
@@ -190,7 +183,15 @@ export class ProductSelect {
190
183
  });
191
184
  }
192
185
  }),
193
- { textStyle: 'font-weight: 400;' }
186
+ (() => {
187
+ switch (bundle.formData[bundle.key].select) {
188
+ case 'product':
189
+ case 'collection':
190
+ return `選取`;
191
+ }
192
+ return ``;
193
+ })(),
194
+
194
195
  )}
195
196
  </div>
196
197
  </div>
@@ -241,6 +242,7 @@ export class ProductSelect {
241
242
  })
242
243
  )}
243
244
  </div>
245
+ <div class="mx-n3 border-top" ></div>
244
246
  </div>`
245
247
  );
246
248
  });
@@ -81,4 +81,13 @@ export class Tool {
81
81
  return a + b;
82
82
  }
83
83
  }
84
+ static isNowBetweenDates(startIso, endIso) {
85
+ const now = new Date();
86
+ const startDate = new Date(startIso);
87
+ const endDate = new Date(endIso);
88
+ if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
89
+ return true;
90
+ }
91
+ return now >= startDate && now <= endDate;
92
+ }
84
93
  }
@@ -98,4 +98,16 @@ export class Tool {
98
98
  return a + b;
99
99
  }
100
100
  }
101
+
102
+ static isNowBetweenDates(startIso: string, endIso: string): boolean {
103
+ const now = new Date();
104
+ const startDate = new Date(startIso);
105
+ const endDate = new Date(endIso);
106
+
107
+ if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
108
+ return true;
109
+ }
110
+
111
+ return now >= startDate && now <= endDate;
112
+ }
101
113
  }