ts-glitter 22.4.7 → 22.4.9

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 (98) hide show
  1. package/lib/glitterBundle/Glitter.css +74 -62
  2. package/lowcode/Entry.js +1 -1
  3. package/lowcode/Entry.ts +1 -1
  4. package/lowcode/backend-manager/bg-product.js +49 -32
  5. package/lowcode/backend-manager/bg-product.ts +57 -39
  6. package/lowcode/backend-manager/bg-widget.js +17 -0
  7. package/lowcode/backend-manager/bg-widget.ts +18 -0
  8. package/lowcode/cms-plugin/information/information-module.js +5 -5
  9. package/lowcode/cms-plugin/information/information-module.ts +9 -5
  10. package/lowcode/cms-plugin/menus-setting.js +69 -55
  11. package/lowcode/cms-plugin/menus-setting.ts +77 -61
  12. package/lowcode/cms-plugin/module/form-module.js +109 -89
  13. package/lowcode/cms-plugin/module/form-module.ts +680 -650
  14. package/lowcode/cms-plugin/module/product-excel.js +1 -0
  15. package/lowcode/cms-plugin/module/product-excel.ts +2 -0
  16. package/lowcode/cms-plugin/pos-pages/payment-page.js +28 -10
  17. package/lowcode/cms-plugin/pos-pages/payment-page.ts +29 -10
  18. package/lowcode/cms-plugin/shopping-allowance-manager.js +0 -1
  19. package/lowcode/cms-plugin/shopping-allowance-manager.ts +0 -1
  20. package/lowcode/cms-plugin/shopping-collections.js +367 -193
  21. package/lowcode/cms-plugin/shopping-collections.ts +664 -243
  22. package/lowcode/cms-plugin/shopping-information.js +392 -38
  23. package/lowcode/cms-plugin/shopping-information.ts +479 -87
  24. package/lowcode/cms-plugin/shopping-product-setting.js +2 -2
  25. package/lowcode/cms-plugin/shopping-product-setting.ts +2 -2
  26. package/lowcode/cms-plugin/shopping-setting-advance.js +906 -766
  27. package/lowcode/cms-plugin/shopping-setting-advance.ts +977 -841
  28. package/lowcode/cms-plugin/shopping-setting-basic.js +1547 -1285
  29. package/lowcode/cms-plugin/shopping-setting-basic.ts +1742 -1466
  30. package/lowcode/cms-plugin/stock-stores.js +1 -0
  31. package/lowcode/cms-plugin/stock-stores.ts +1 -0
  32. package/lowcode/cms-plugin/user-list.js +47 -12
  33. package/lowcode/cms-plugin/user-list.ts +52 -14
  34. package/lowcode/css/editor.css +6 -0
  35. package/lowcode/glitterBundle/Glitter.css +74 -62
  36. package/lowcode/jslib/nestable/index.html +317 -0
  37. package/lowcode/jslib/nestable/jquery.nestable.js +484 -0
  38. package/lowcode/official_view_component/form-widget/input-custom.js +98 -6
  39. package/lowcode/official_view_component/form-widget/input-custom.ts +121 -16
  40. package/lowcode/public-components/headers/header-class.js +63 -0
  41. package/lowcode/public-components/headers/header-class.ts +65 -0
  42. package/lowcode/public-components/headers/sy-02.js +386 -400
  43. package/lowcode/public-components/headers/sy-02.ts +482 -492
  44. package/lowcode/public-components/headers/sy-03.js +42 -43
  45. package/lowcode/public-components/headers/sy-03.ts +46 -43
  46. package/lowcode/public-components/headers/sy-04.js +43 -41
  47. package/lowcode/public-components/headers/sy-04.ts +48 -41
  48. package/lowcode/public-components/headers/sy-05.js +30 -27
  49. package/lowcode/public-components/headers/sy-05.ts +33 -27
  50. package/lowcode/public-components/product/product-list.js +160 -148
  51. package/lowcode/public-components/product/product-list.ts +186 -165
  52. package/lowcode/public-models/product.ts +26 -1
  53. package/lowcode/src/glitterBundle/Glitter.css +74 -62
  54. package/package.json +1 -1
  55. package/rxmnt81tnk.json +1 -0
  56. package/src/api-public/controllers/shop.js +10 -4
  57. package/src/api-public/controllers/shop.js.map +1 -1
  58. package/src/api-public/controllers/shop.ts +14 -9
  59. package/src/api-public/services/ezpay/tool.d.ts +1 -0
  60. package/src/api-public/services/mail.js +1 -1
  61. package/src/api-public/services/mail.js.map +1 -1
  62. package/src/api-public/services/mail.ts +1 -1
  63. package/src/api-public/services/schedule.d.ts +0 -1
  64. package/src/api-public/services/schedule.js +12 -35
  65. package/src/api-public/services/schedule.js.map +1 -1
  66. package/src/api-public/services/schedule.ts +15 -39
  67. package/src/api-public/services/shopee.js +7 -17
  68. package/src/api-public/services/shopping.d.ts +27 -6
  69. package/src/api-public/services/shopping.js +364 -85
  70. package/src/api-public/services/shopping.js.map +1 -1
  71. package/src/api-public/services/shopping.ts +510 -101
  72. package/src/api-public/services/updated-table-checked.js +58 -1
  73. package/src/api-public/services/updated-table-checked.js.map +1 -1
  74. package/src/api-public/services/updated-table-checked.ts +62 -1
  75. package/src/api-public/services/user-update.js +14 -0
  76. package/src/api-public/services/user-update.js.map +1 -1
  77. package/src/api-public/services/user-update.ts +15 -0
  78. package/src/api-public/services/user.js +1 -1
  79. package/src/api-public/services/user.js.map +1 -1
  80. package/src/api-public/services/user.ts +1 -1
  81. package/src/app-project/serverless/src/modules/database.d.ts +1 -1
  82. package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
  83. package/src/helper/glitter-util.d.ts +1 -0
  84. package/src/index.js +7 -5
  85. package/src/index.js.map +1 -1
  86. package/src/index.ts +45 -38
  87. package/src/modules/firebase.js +1 -0
  88. package/src/modules/firebase.js.map +1 -1
  89. package/src/modules/firebase.ts +1 -0
  90. package/src/seo-config.d.ts +1 -1
  91. package/src/seo-config.js +1 -2
  92. package/src/seo-config.js.map +1 -1
  93. package/src/seo-config.ts +1 -2
  94. package/src/services/saas-table-check.js.map +1 -1
  95. package/src/services/ses.js +4 -3
  96. package/src/services/ses.js.map +1 -1
  97. package/src/services/system-schedule.js.map +1 -1
  98. package/src/services/system-schedule.ts +1 -0
@@ -1,7 +1,7 @@
1
1
  import { BgWidget } from '../../backend-manager/bg-widget.js';
2
2
  import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
3
3
  import { EditorElem } from '../../glitterBundle/plugins/editor-elem.js';
4
- import { Language } from "../../glitter-base/global/language.js";
4
+ import { Language } from '../../glitter-base/global/language.js';
5
5
  export class FormModule {
6
6
  static editor(gvc, data, title, update) {
7
7
  const html = String.raw;
@@ -46,7 +46,7 @@ export class FormModule {
46
46
  try {
47
47
  const view = vm.data
48
48
  .map((dd, index) => {
49
- const opc = option.find((d1) => {
49
+ const opc = option.find(d1 => {
50
50
  if (dd.page === 'multiple_line_text') {
51
51
  return d1.key === 'input';
52
52
  }
@@ -55,18 +55,18 @@ export class FormModule {
55
55
  if (!opc) {
56
56
  return ``;
57
57
  }
58
- return html `<li class="w-100 border rounded-3 mb-2" style="overflow: hidden;">
59
- <div
60
- class="d-flex align-items-center w-100 py-2"
61
- style="padding-left: 20px; padding-right: 20px;background: #F7F7F7;cursor: pointer;overflow: hidden;"
62
- onclick="${gvc.event(() => {
58
+ return html ` <li class="w-100 border rounded-3 mb-2" style="overflow: hidden;">
59
+ <div
60
+ class="d-flex align-items-center w-100 py-2"
61
+ style="padding-left: 20px; padding-right: 20px;background: #F7F7F7;cursor: pointer;overflow: hidden;"
62
+ onclick="${gvc.event(() => {
63
63
  dd.toggle = !dd.toggle;
64
64
  gvc.notifyDataChange(vm.id);
65
65
  })}"
66
- >
67
- <i class="fa-sharp fa-solid fa-grip-dots-vertical me-3 dragItem "></i>
68
- <div style="width:12px;" class="d-flex align-items-center justify-content-center me-3">
69
- ${(() => {
66
+ >
67
+ <i class="fa-sharp fa-solid fa-grip-dots-vertical me-3 dragItem "></i>
68
+ <div style="width:12px;" class="d-flex align-items-center justify-content-center me-3">
69
+ ${(() => {
70
70
  switch (dd.form_config.type) {
71
71
  case 'email':
72
72
  return `<i class="fa-solid fa-envelope "></i>`;
@@ -80,8 +80,8 @@ export class FormModule {
80
80
  return opc.icon;
81
81
  }
82
82
  })()}
83
- </div>
84
- ${(Language.getLanguageCustomText(dd.title || opc.title))}${(() => {
83
+ </div>
84
+ ${Language.getLanguageCustomText(dd.title || opc.title)}${(() => {
85
85
  if (dd.deletable === false) {
86
86
  return `<div class="ms-2">${BgWidget.blueNote(`系統預設`)}</div>`;
87
87
  }
@@ -89,16 +89,21 @@ export class FormModule {
89
89
  return ``;
90
90
  }
91
91
  })()}
92
- <div class="flex-fill"></div>
93
- ${dd.toggle ? `<i class="fa-solid fa-angle-up"></i>` : `<i class="fa-solid fa-angle-down"></i>`}
94
- </div>
95
- ${dd.toggle
92
+ <div class="flex-fill"></div>
93
+ ${dd.toggle ? `<i class="fa-solid fa-angle-up"></i>` : `<i class="fa-solid fa-angle-down"></i>`}
94
+ </div>
95
+ ${dd.toggle
96
96
  ? html `
97
- <div class="w-100 p-3">
98
- ${(() => {
97
+ <div class="w-100 p-3">
98
+ ${(() => {
99
99
  var _a;
100
100
  const editor_option = [
101
- BgWidget.multiCheckboxContainer(gvc, [{ key: 'true', name: '設定為必填項目' }], [`${(_a = dd.require) !== null && _a !== void 0 ? _a : ''}` || 'false'], () => {
101
+ BgWidget.multiCheckboxContainer(gvc, [
102
+ {
103
+ key: 'true',
104
+ name: '設定為必填項目',
105
+ },
106
+ ], [`${(_a = dd.require) !== null && _a !== void 0 ? _a : ''}` || 'false'], () => {
102
107
  if (dd.require) {
103
108
  const dialog = new ShareDialog(gvc.glitter);
104
109
  if (dd.key === 'email' &&
@@ -132,7 +137,12 @@ export class FormModule {
132
137
  }
133
138
  else {
134
139
  return [
135
- BgWidget.multiCheckboxContainer(gvc, [{ key: 'true', name: '隱藏此欄位' }], [`${(_a = dd.hidden) !== null && _a !== void 0 ? _a : ''}` || 'false'], () => {
140
+ BgWidget.multiCheckboxContainer(gvc, [
141
+ {
142
+ key: 'true',
143
+ name: '隱藏此欄位',
144
+ },
145
+ ], [`${(_a = dd.hidden) !== null && _a !== void 0 ? _a : ''}` || 'false'], () => {
136
146
  dd.hidden = !dd.hidden;
137
147
  update && update();
138
148
  gvc.notifyDataChange(vm.id);
@@ -140,12 +150,16 @@ export class FormModule {
140
150
  ];
141
151
  }
142
152
  })(),
143
- html `<div class="d-flex align-items-center justify-content-end ${dd.deletable === false ? `d-none` : ``}">
144
- ${BgWidget.cancel(gvc.event(() => {
153
+ html ` <div
154
+ class="d-flex align-items-center justify-content-end ${dd.deletable === false
155
+ ? `d-none`
156
+ : ``}"
157
+ >
158
+ ${BgWidget.cancel(gvc.event(() => {
145
159
  const dialog = new ShareDialog(gvc.glitter);
146
160
  dialog.checkYesOrNot({
147
161
  text: '是否確認刪除欄位?',
148
- callback: (response) => {
162
+ callback: response => {
149
163
  if (response) {
150
164
  vm.data.splice(index, 1);
151
165
  gvc.notifyDataChange(vm.id);
@@ -154,7 +168,7 @@ export class FormModule {
154
168
  },
155
169
  });
156
170
  }), '刪除欄位')}
157
- </div>`,
171
+ </div>`,
158
172
  ];
159
173
  switch (dd.page) {
160
174
  case 'multiple_line_text':
@@ -167,9 +181,9 @@ export class FormModule {
167
181
  else {
168
182
  return [
169
183
  EditorElem.select({
170
- title: html `<div class="tx_normal fw-normal">資料類型</div>`,
184
+ title: html ` <div class="tx_normal fw-normal">資料類型</div>`,
171
185
  gvc: gvc,
172
- callback: (value) => {
186
+ callback: value => {
173
187
  dd.form_config.type = value;
174
188
  if (value === 'textArea') {
175
189
  dd.page = 'multiple_line_text';
@@ -248,7 +262,7 @@ export class FormModule {
248
262
  value: 'password',
249
263
  visible: 'visible',
250
264
  },
251
- ].map((dd) => {
265
+ ].map(dd => {
252
266
  return {
253
267
  title: dd.name,
254
268
  value: dd.value,
@@ -262,56 +276,60 @@ export class FormModule {
262
276
  gvc: gvc,
263
277
  title: '自訂欄位名稱',
264
278
  default: dd.title || '',
265
- callback: (text) => {
279
+ callback: text => {
266
280
  dd.title = text;
267
281
  update && update();
268
282
  gvc.notifyDataChange(vm.id);
269
283
  },
270
284
  placeHolder: '請輸入自訂欄位名稱',
271
- global_language: true
285
+ global_language: true,
272
286
  }),
273
287
  BgWidget.editeInput({
274
288
  gvc: gvc,
275
289
  title: '提示文字',
276
290
  default: dd.form_config.place_holder || '',
277
- callback: (text) => {
291
+ callback: text => {
278
292
  dd.form_config.place_holder = text;
279
293
  update && update();
280
294
  gvc.notifyDataChange(vm.id);
281
295
  },
282
296
  placeHolder: '請輸入關於這項欄位的描述或指引',
283
- global_language: true
297
+ global_language: true,
284
298
  }),
285
- ...((dd.form_config.type === 'date') ? [
286
- BgWidget.editeInput({
287
- gvc: gvc,
288
- title: '最小起始日',
289
- default: dd.form_config.start_time || '',
290
- callback: (text) => {
291
- dd.form_config.start_time = text;
292
- update && update();
293
- gvc.notifyDataChange(vm.id);
294
- },
295
- placeHolder: '幾天前,0為當下,未輸入則不限制',
296
- global_language: true
297
- }),
298
- BgWidget.editeInput({
299
- gvc: gvc,
300
- title: '最大結束日',
301
- default: dd.form_config.end_time || '',
302
- callback: (text) => {
303
- dd.form_config.end_time = text;
304
- update && update();
305
- gvc.notifyDataChange(vm.id);
306
- },
307
- placeHolder: '幾天後,0為當下,未輸入則不限制',
308
- global_language: true
309
- })
310
- ] : []),
299
+ ...(dd.form_config.type === 'date'
300
+ ? [
301
+ BgWidget.editeInput({
302
+ gvc: gvc,
303
+ title: '最小起始日',
304
+ default: dd.form_config.start_time || '',
305
+ callback: text => {
306
+ dd.form_config.start_time = text;
307
+ update && update();
308
+ gvc.notifyDataChange(vm.id);
309
+ },
310
+ placeHolder: '幾天前,0為當下,未輸入則不限制',
311
+ global_language: true,
312
+ }),
313
+ BgWidget.editeInput({
314
+ gvc: gvc,
315
+ title: '最大結束日',
316
+ default: dd.form_config.end_time || '',
317
+ callback: text => {
318
+ dd.form_config.end_time = text;
319
+ update && update();
320
+ gvc.notifyDataChange(vm.id);
321
+ },
322
+ placeHolder: '幾天後,0為當下,未輸入則不限制',
323
+ global_language: true,
324
+ }),
325
+ ]
326
+ : []),
311
327
  ...editor_option,
312
- ].filter((dd) => {
328
+ ]
329
+ .filter(dd => {
313
330
  return dd;
314
- }).join('<div class="my-2"></div>');
331
+ })
332
+ .join('<div class="my-2"></div>');
315
333
  case 'form-select':
316
334
  case 'check_box':
317
335
  case 'mutiple_select':
@@ -320,17 +338,17 @@ export class FormModule {
320
338
  gvc: gvc,
321
339
  title: '自訂欄位名稱',
322
340
  default: dd.title || '',
323
- callback: (text) => {
341
+ callback: text => {
324
342
  dd.title = text;
325
343
  update && update();
326
344
  gvc.notifyDataChange(vm.id);
327
345
  },
328
346
  placeHolder: '請輸入自訂欄位名稱',
329
- global_language: true
347
+ global_language: true,
330
348
  }),
331
349
  html `
332
- <div class="tx_normal fw-normal mb-2">選項</div>
333
- ${gvc.bindView(() => {
350
+ <div class="tx_normal fw-normal mb-2">選項</div>
351
+ ${gvc.bindView(() => {
334
352
  const cVm = {
335
353
  id: gvc.glitter.getUUID(),
336
354
  };
@@ -340,12 +358,15 @@ export class FormModule {
340
358
  return (dd.form_config.option
341
359
  .map((d1, index) => {
342
360
  return html `
343
- <div class="d-flex align-items-center mb-2 w-100" style="gap: 10px;">
344
- ${BgWidget.editeInput({
361
+ <div
362
+ class="d-flex align-items-center mb-2 w-100"
363
+ style="gap: 10px;"
364
+ >
365
+ ${BgWidget.editeInput({
345
366
  gvc: gvc,
346
367
  title: '',
347
368
  default: d1.value || '',
348
- callback: (text) => {
369
+ callback: text => {
349
370
  d1.value = text;
350
371
  d1.name = text;
351
372
  update && update();
@@ -353,25 +374,24 @@ export class FormModule {
353
374
  },
354
375
  placeHolder: '請輸入自訂欄位名稱',
355
376
  global_language: true,
356
- divStyle: `width:100%;`
377
+ divStyle: `width:100%;`,
357
378
  })}
358
- <i
359
- class="fa-solid fa-xmark"
360
- style="color:#8d8d8d;cursor: pointer; "
361
- onclick="${gvc.event(() => {
379
+ <i
380
+ class="fa-solid fa-xmark"
381
+ style="color:#8d8d8d;cursor: pointer; "
382
+ onclick="${gvc.event(() => {
362
383
  dd.form_config.option.splice(index, 1);
363
384
  update && update();
364
385
  gvc.notifyDataChange(cVm.id);
365
386
  })}"
366
- ></i>
367
- </div>
368
- `;
387
+ ></i>
388
+ </div>
389
+ `;
369
390
  })
370
391
  .join('') +
371
392
  html ` <div
372
-
373
- style="width: 100px; height: 34px; padding: 6px 18px;background: #EAEAEA; border-radius: 10px; overflow: hidden; justify-content: center; align-items: center; gap: 8px; display: inline-flex; cursor: pointer;"
374
- onclick="${gvc.event(() => {
393
+ style="width: 100px; height: 34px; padding: 6px 18px;background: #EAEAEA; border-radius: 10px; overflow: hidden; justify-content: center; align-items: center; gap: 8px; display: inline-flex; cursor: pointer;"
394
+ onclick="${gvc.event(() => {
375
395
  dd.form_config.option.push({
376
396
  index: 0,
377
397
  name: '',
@@ -380,27 +400,27 @@ export class FormModule {
380
400
  update && update();
381
401
  gvc.notifyDataChange(cVm.id);
382
402
  })}"
383
- >
384
- <div
385
- style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
386
- >
387
- 新增選項
388
- </div>
389
- </div>`);
403
+ >
404
+ <div
405
+ style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
406
+ >
407
+ 新增選項
408
+ </div>
409
+ </div>`);
390
410
  },
391
411
  };
392
412
  })}
393
- `,
413
+ `,
394
414
  ...editor_option,
395
415
  ].join('<div class="my-2"></div>');
396
416
  default:
397
417
  return '';
398
418
  }
399
419
  })()}
400
- </div>
401
- `
420
+ </div>
421
+ `
402
422
  : ''}
403
- </li>`;
423
+ </li>`;
404
424
  })
405
425
  .join('');
406
426
  return view;