ts-glitter 21.9.6 → 21.9.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 (38) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/backend-manager/bg-blog.js +2 -0
  4. package/lowcode/backend-manager/bg-blog.ts +4 -0
  5. package/lowcode/backend-manager/bg-product.js +3 -3
  6. package/lowcode/backend-manager/bg-product.ts +3 -3
  7. package/lowcode/backend-manager/bg-widget.js +15 -11
  8. package/lowcode/backend-manager/bg-widget.ts +30 -21
  9. package/lowcode/cms-plugin/menus-setting.js +389 -141
  10. package/lowcode/cms-plugin/menus-setting.ts +519 -228
  11. package/lowcode/cms-plugin/shopping-collections.js +5 -38
  12. package/lowcode/cms-plugin/shopping-collections.ts +5 -47
  13. package/lowcode/jspage/function-page/setting_editor.js +0 -27
  14. package/lowcode/jspage/function-page/setting_editor.ts +27 -27
  15. package/lowcode/public-components/footer/footer-01.js +183 -158
  16. package/lowcode/public-components/footer/footer-01.ts +275 -256
  17. package/lowcode/public-components/footer/footer-02.js +83 -63
  18. package/lowcode/public-components/footer/footer-02.ts +160 -145
  19. package/lowcode/public-components/footer/footer-03.js +78 -60
  20. package/lowcode/public-components/footer/footer-03.ts +149 -137
  21. package/lowcode/public-components/headers/sy-02.js +17 -2
  22. package/lowcode/public-components/headers/sy-02.ts +18 -6
  23. package/lowcode/public-components/headers/sy-03.js +18 -4
  24. package/lowcode/public-components/headers/sy-03.ts +26 -15
  25. package/lowcode/public-components/headers/sy-04.js +18 -4
  26. package/lowcode/public-components/headers/sy-04.ts +26 -15
  27. package/lowcode/public-components/headers/sy-05.js +93 -68
  28. package/lowcode/public-components/headers/sy-05.ts +174 -151
  29. package/lowcode/public-components/product/pd-class.js +27 -8
  30. package/lowcode/public-components/product/pd-class.ts +60 -35
  31. package/package.json +1 -1
  32. package/src/api-public/services/shopee.js +17 -7
  33. package/src/api-public/services/user.js +17 -7
  34. package/src/index.js +17 -7
  35. package/src/services/app.js +17 -7
  36. package/src/services/app.js.map +1 -1
  37. package/src/services/backend-service.js +17 -7
  38. package/src/services/backend-service.js.map +1 -1
@@ -16,7 +16,7 @@ const html = String.raw;
16
16
  export class Sy02 {
17
17
  public static main(gvc: GVC, widget: any, subData: any) {
18
18
  return HeadInitial.initial({
19
- widget:widget,
19
+ widget: widget,
20
20
  browser: () => {
21
21
  let changePage = (index: string, type: 'page' | 'home', subData: any) => {};
22
22
  gvc.glitter.getModule(new URL('./official_event/page/change-page.js', gvc.glitter.root_path).href, cl => {
@@ -24,6 +24,7 @@ export class Sy02 {
24
24
  });
25
25
  const colors = Color.getTheme(gvc, widget.formData);
26
26
  return html`
27
+ <!--Header Sy02-->
27
28
  <div style="height: 76px;"></div>
28
29
  <nav
29
30
  class="navbar navbar-expand-lg vw-100 header header-place shadow position-fixed top-0 left-0 py-0"
@@ -115,7 +116,7 @@ export class Sy02 {
115
116
  const vm = {
116
117
  data: [],
117
118
  };
118
-
119
+
119
120
  ApiUser.getPublicConfig(
120
121
  widget.formData.menu_refer || 'menu-setting',
121
122
  'manager',
@@ -262,16 +263,26 @@ background: ${colors.bgr ?? '#000'};overflow-x: hidden;`,
262
263
  const vm = {
263
264
  data: [],
264
265
  };
265
- ApiUser.getPublicConfig(widget.formData.menu_refer || 'menu-setting', 'manager', (window as any).appName).then(res => {
266
+ ApiUser.getPublicConfig(
267
+ widget.formData.menu_refer || 'menu-setting',
268
+ 'manager',
269
+ (window as any).appName
270
+ ).then(res => {
266
271
  vm.data = res.response.value[Language.getLanguage()];
267
272
  gvc.notifyDataChange(id);
268
273
  });
269
274
  return {
270
275
  bind: id,
271
- view: () => {
276
+ view: async () => {
277
+ const userData = await ApiUser.getUserData(gvc.glitter.share.GlobalUser.token, 'me');
278
+
272
279
  function loopItems(data: any) {
273
280
  return data
274
281
  .map((dd: any) => {
282
+ if (!PdClass.menuVisibleVerify(userData, dd)) {
283
+ return '';
284
+ }
285
+
275
286
  return html` <li class="nav-item dropdown">
276
287
  <a
277
288
  class="nav-link header-link "
@@ -298,6 +309,7 @@ background: ${colors.bgr ?? '#000'};overflow-x: hidden;`,
298
309
  : ``}
299
310
  </li>`;
300
311
  })
312
+ .filter(Boolean)
301
313
  .join('');
302
314
  }
303
315
 
@@ -370,8 +382,8 @@ padding-bottom: 2px;
370
382
  return {
371
383
  bind: vm.id,
372
384
  view: () => {
373
- if(PdClass.isShoppingPage()){
374
- return ``
385
+ if (PdClass.isShoppingPage()) {
386
+ return ``;
375
387
  }
376
388
  if (!vm.toggle) {
377
389
  return html`<i
@@ -1,3 +1,12 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
1
10
  import { ApiUser } from '../../glitter-base/route/user.js';
2
11
  import { getCheckoutCount } from '../../official_event/e-commerce/get-count.js';
3
12
  import { GlobalUser } from '../../glitter-base/global/global-user.js';
@@ -21,7 +30,8 @@ export class Sy03 {
21
30
  changePage = cl.changePage;
22
31
  });
23
32
  const colors = Color.getTheme(gvc, widget.formData);
24
- return html ` <div class="d-sm-none" style="height: 76px;"></div>
33
+ return html ` <!--Header Sy03-->
34
+ <div class="d-sm-none" style="height: 76px;"></div>
25
35
  <nav
26
36
  class="navbar navbar-expand-lg vw-100 header header-place shadow top-0 left-0 py-0 position-fixed position-sm-relative"
27
37
  style="background: ${(_a = widget.formData.theme_color['background']) !== null && _a !== void 0 ? _a : '#000'} !important;z-index:9999;
@@ -229,7 +239,7 @@ background: ${(_a = colors.bgr) !== null && _a !== void 0 ? _a : '#000'};overflo
229
239
  </div>
230
240
  </div>
231
241
  <!--選單列表顯示區塊-->
232
- <ul class="navbar-nav d-none d-md-block flex-fill ps-2 position-sticky" >
242
+ <ul class="navbar-nav d-none d-md-block flex-fill ps-2 position-sticky">
233
243
  ${gvc.bindView(() => {
234
244
  const id = gvc.glitter.getUUID();
235
245
  const vm = {
@@ -241,11 +251,15 @@ background: ${(_a = colors.bgr) !== null && _a !== void 0 ? _a : '#000'};overflo
241
251
  });
242
252
  return {
243
253
  bind: id,
244
- view: () => {
254
+ view: () => __awaiter(this, void 0, void 0, function* () {
255
+ const userData = yield ApiUser.getUserData(gvc.glitter.share.GlobalUser.token, 'me');
245
256
  function loopItems(data) {
246
257
  return data
247
258
  .map((dd) => {
248
259
  var _a, _b;
260
+ if (!PdClass.menuVisibleVerify(userData, dd)) {
261
+ return '';
262
+ }
249
263
  return html ` <li class="nav-item dropdown">
250
264
  <a
251
265
  class="nav-link header-link "
@@ -268,7 +282,7 @@ background: ${(_a = colors.bgr) !== null && _a !== void 0 ? _a : '#000'};overflo
268
282
  .join('');
269
283
  }
270
284
  return loopItems(vm.data);
271
- },
285
+ }),
272
286
  divCreate: {
273
287
  class: `navbar-nav ms-3 me-auto mt-3`,
274
288
  style: `flex-direction: row; gap: 15px;`,
@@ -16,7 +16,7 @@ const html = String.raw;
16
16
  export class Sy03 {
17
17
  public static main(gvc: GVC, widget: any, subData: any) {
18
18
  return HeadInitial.initial({
19
- widget:widget,
19
+ widget: widget,
20
20
  browser: () => {
21
21
  let changePage = (index: string, type: 'page' | 'home', subData: any) => {};
22
22
  gvc.glitter.getModule(new URL('./official_event/page/change-page.js', gvc.glitter.root_path).href, cl => {
@@ -24,7 +24,8 @@ export class Sy03 {
24
24
  });
25
25
  const colors = Color.getTheme(gvc, widget.formData);
26
26
 
27
- return html` <div class="d-sm-none" style="height: 76px;"></div>
27
+ return html` <!--Header Sy03-->
28
+ <div class="d-sm-none" style="height: 76px;"></div>
28
29
  <nav
29
30
  class="navbar navbar-expand-lg vw-100 header header-place shadow top-0 left-0 py-0 position-fixed position-sm-relative"
30
31
  style="background: ${widget.formData.theme_color['background'] ?? '#000'} !important;z-index:9999;
@@ -104,12 +105,14 @@ export class Sy03 {
104
105
  const vm = {
105
106
  data: [],
106
107
  };
107
- ApiUser.getPublicConfig(widget.formData.menu_refer || 'menu-setting', 'manager', (window as any).appName).then(
108
- res => {
109
- vm.data = res.response.value[Language.getLanguage()];
110
- gvc.notifyDataChange(id);
111
- }
112
- );
108
+ ApiUser.getPublicConfig(
109
+ widget.formData.menu_refer || 'menu-setting',
110
+ 'manager',
111
+ (window as any).appName
112
+ ).then(res => {
113
+ vm.data = res.response.value[Language.getLanguage()];
114
+ gvc.notifyDataChange(id);
115
+ });
113
116
  return {
114
117
  bind: id,
115
118
  view: () => {
@@ -125,7 +128,6 @@ export class Sy03 {
125
128
  }
126
129
 
127
130
  function loopItems(data: any, show_border: boolean) {
128
-
129
131
  return data
130
132
  .map((dd: any) => {
131
133
  return html`
@@ -236,23 +238,32 @@ background: ${colors.bgr ?? '#000'};overflow-x: hidden;`,
236
238
  </div>
237
239
  </div>
238
240
  <!--選單列表顯示區塊-->
239
- <ul class="navbar-nav d-none d-md-block flex-fill ps-2 position-sticky" >
241
+ <ul class="navbar-nav d-none d-md-block flex-fill ps-2 position-sticky">
240
242
  ${gvc.bindView(() => {
241
243
  const id = gvc.glitter.getUUID();
242
244
  const vm = {
243
245
  data: [],
244
246
  };
245
- ApiUser.getPublicConfig(widget.formData.menu_refer || 'menu-setting', 'manager', (window as any).appName).then(res => {
247
+ ApiUser.getPublicConfig(
248
+ widget.formData.menu_refer || 'menu-setting',
249
+ 'manager',
250
+ (window as any).appName
251
+ ).then(res => {
246
252
  vm.data = res.response.value[Language.getLanguage()];
247
253
  gvc.notifyDataChange(id);
248
254
  });
249
255
  return {
250
256
  bind: id,
251
- view: () => {
257
+ view: async () => {
258
+ const userData = await ApiUser.getUserData(gvc.glitter.share.GlobalUser.token, 'me');
259
+
252
260
  function loopItems(data: any) {
253
-
254
261
  return data
255
262
  .map((dd: any) => {
263
+ if (!PdClass.menuVisibleVerify(userData, dd)) {
264
+ return '';
265
+ }
266
+
256
267
  return html` <li class="nav-item dropdown">
257
268
  <a
258
269
  class="nav-link header-link "
@@ -345,8 +356,8 @@ padding-bottom: 2px;
345
356
  return {
346
357
  bind: vm.id,
347
358
  view: () => {
348
- if(PdClass.isShoppingPage()){
349
- return ``
359
+ if (PdClass.isShoppingPage()) {
360
+ return ``;
350
361
  }
351
362
  if (!vm.toggle) {
352
363
  return html`<i
@@ -1,3 +1,12 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
1
10
  import { ApiUser } from '../../glitter-base/route/user.js';
2
11
  import { getCheckoutCount } from '../../official_event/e-commerce/get-count.js';
3
12
  import { GlobalUser } from '../../glitter-base/global/global-user.js';
@@ -21,7 +30,8 @@ export class Sy04 {
21
30
  changePage = cl.changePage;
22
31
  });
23
32
  const colors = Color.getTheme(gvc, widget.formData);
24
- return html ` <div style="height: 76px;"></div>
33
+ return html ` <!--Header Sy04-->
34
+ <div style="height: 76px;"></div>
25
35
  <nav
26
36
  class="navbar navbar-expand-lg vw-100 header header-place shadow position-fixed top-0 left-0 py-0"
27
37
  style="background: ${(_a = widget.formData.theme_color['background']) !== null && _a !== void 0 ? _a : '#000'} !important;height: 76px;z-index:9999;"
@@ -241,7 +251,7 @@ background: ${(_a = colors.bgr) !== null && _a !== void 0 ? _a : '#000'};overflo
241
251
  `}
242
252
  </div>
243
253
  </div>
244
- <div >
254
+ <div>
245
255
  <!--選單列表顯示區塊-->
246
256
  <ul
247
257
  class="navbar-nav position-absolute start-50 top-50 d-none d-lg-block"
@@ -258,11 +268,15 @@ background: ${(_a = colors.bgr) !== null && _a !== void 0 ? _a : '#000'};overflo
258
268
  });
259
269
  return {
260
270
  bind: id,
261
- view: () => {
271
+ view: () => __awaiter(this, void 0, void 0, function* () {
272
+ const userData = yield ApiUser.getUserData(gvc.glitter.share.GlobalUser.token, 'me');
262
273
  function loopItems(data) {
263
274
  return data
264
275
  .map((dd) => {
265
276
  var _a, _b;
277
+ if (!PdClass.menuVisibleVerify(userData, dd)) {
278
+ return '';
279
+ }
266
280
  return html ` <li class="nav-item dropdown">
267
281
  <a
268
282
  class="nav-link header-link "
@@ -285,7 +299,7 @@ background: ${(_a = colors.bgr) !== null && _a !== void 0 ? _a : '#000'};overflo
285
299
  .join('');
286
300
  }
287
301
  return loopItems(vm.data);
288
- },
302
+ }),
289
303
  divCreate: {
290
304
  class: `navbar-nav ms-3 me-auto `,
291
305
  style: `flex-direction: row; gap: 0px;`,
@@ -16,14 +16,15 @@ const html = String.raw;
16
16
  export class Sy04 {
17
17
  public static main(gvc: GVC, widget: any, subData: any) {
18
18
  return HeadInitial.initial({
19
- widget:widget,
19
+ widget: widget,
20
20
  browser: () => {
21
21
  let changePage = (index: string, type: 'page' | 'home', subData: any) => {};
22
22
  gvc.glitter.getModule(new URL('./official_event/page/change-page.js', gvc.glitter.root_path).href, cl => {
23
23
  changePage = cl.changePage;
24
24
  });
25
25
  const colors = Color.getTheme(gvc, widget.formData);
26
- return html` <div style="height: 76px;"></div>
26
+ return html` <!--Header Sy04-->
27
+ <div style="height: 76px;"></div>
27
28
  <nav
28
29
  class="navbar navbar-expand-lg vw-100 header header-place shadow position-fixed top-0 left-0 py-0"
29
30
  style="background: ${widget.formData.theme_color['background'] ??
@@ -108,13 +109,15 @@ export class Sy04 {
108
109
  const vm = {
109
110
  data: [],
110
111
  };
111
- ApiUser.getPublicConfig(widget.formData.menu_refer || 'menu-setting', 'manager', (window as any).appName).then(
112
- res => {
113
- vm.data = res.response.value[Language.getLanguage()];
112
+ ApiUser.getPublicConfig(
113
+ widget.formData.menu_refer || 'menu-setting',
114
+ 'manager',
115
+ (window as any).appName
116
+ ).then(res => {
117
+ vm.data = res.response.value[Language.getLanguage()];
114
118
 
115
- gvc.notifyDataChange(id);
116
- }
117
- );
119
+ gvc.notifyDataChange(id);
120
+ });
118
121
  return {
119
122
  bind: id,
120
123
  view: () => {
@@ -130,7 +133,6 @@ export class Sy04 {
130
133
  }
131
134
 
132
135
  function loopItems(data: any, show_border: boolean) {
133
-
134
136
  return data
135
137
  .map((dd: any) => {
136
138
  return html`
@@ -249,7 +251,7 @@ background: ${colors.bgr ?? '#000'};overflow-x: hidden;`,
249
251
  `}
250
252
  </div>
251
253
  </div>
252
- <div >
254
+ <div>
253
255
  <!--選單列表顯示區塊-->
254
256
  <ul
255
257
  class="navbar-nav position-absolute start-50 top-50 d-none d-lg-block"
@@ -260,17 +262,26 @@ background: ${colors.bgr ?? '#000'};overflow-x: hidden;`,
260
262
  const vm = {
261
263
  data: [],
262
264
  };
263
- ApiUser.getPublicConfig(widget.formData.menu_refer || 'menu-setting', 'manager', (window as any).appName).then(res => {
265
+ ApiUser.getPublicConfig(
266
+ widget.formData.menu_refer || 'menu-setting',
267
+ 'manager',
268
+ (window as any).appName
269
+ ).then(res => {
264
270
  vm.data = res.response.value[Language.getLanguage()];
265
271
  gvc.notifyDataChange(id);
266
272
  });
267
273
  return {
268
274
  bind: id,
269
- view: () => {
275
+ view: async () => {
276
+ const userData = await ApiUser.getUserData(gvc.glitter.share.GlobalUser.token, 'me');
277
+
270
278
  function loopItems(data: any) {
271
-
272
279
  return data
273
280
  .map((dd: any) => {
281
+ if (!PdClass.menuVisibleVerify(userData, dd)) {
282
+ return '';
283
+ }
284
+
274
285
  return html` <li class="nav-item dropdown">
275
286
  <a
276
287
  class="nav-link header-link "
@@ -356,8 +367,8 @@ padding-bottom: 2px;
356
367
  return {
357
368
  bind: vm.id,
358
369
  view: () => {
359
- if(PdClass.isShoppingPage()){
360
- return ``
370
+ if (PdClass.isShoppingPage()) {
371
+ return ``;
361
372
  }
362
373
  if (!vm.toggle) {
363
374
  return html`<i