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
@@ -1,9 +1,19 @@
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 { Color } from '../public/color.js';
2
11
  import { ApiUser } from '../../glitter-base/route/user.js';
3
12
  import { LanguageView } from '../public/language-view.js';
4
13
  import { Language } from '../../glitter-base/global/language.js';
5
14
  import { FooterInitial } from './footer-initial.js';
6
15
  import { Footer } from '../../app-component/footer.js';
16
+ import { PdClass } from '../product/pd-class.js';
7
17
  const html = String.raw;
8
18
  export class Footer01 {
9
19
  static main(gvc, widget, subData) {
@@ -15,127 +25,133 @@ export class Footer01 {
15
25
  list: [],
16
26
  };
17
27
  const css = String.raw;
18
- gvc.addStyle(css `
19
- .f-title {
20
- font-size: 16px;
21
- font-weight: 600;
22
- letter-spacing: 0.64px;
23
- word-break: break-all;
24
- color: ${colors.title};
25
- }
28
+ gvc.addStyle(`
29
+ .f-title {
30
+ font-size: 16px;
31
+ font-weight: 600;
32
+ letter-spacing: 0.64px;
33
+ word-break: break-all;
34
+ color: ${colors.title};
35
+ }
26
36
 
27
- .f-ul {
28
- display: flex;
29
- flex-direction: column;
30
- gap: 5px;
31
- }
37
+ .f-ul {
38
+ display: flex;
39
+ flex-direction: column;
40
+ gap: 5px;
41
+ }
32
42
 
33
- .f-li {
34
- color: ${colors.content};
35
- }
43
+ .f-li {
44
+ color: ${colors.content};
45
+ }
36
46
 
37
- .f-aclass {
38
- color: ${colors.content} !important;
39
- }
47
+ .f-aclass {
48
+ color: ${colors.content} !important;
49
+ }
40
50
 
41
- .f-bgr {
42
- background: ${colors.bgr};
43
- }
51
+ .f-bgr {
52
+ background: ${colors.bgr};
53
+ }
44
54
 
45
- .f-container {
46
- margin-left: 10px;
47
- margin-right: 10px;
48
- }
55
+ .f-container {
56
+ margin-left: 10px;
57
+ margin-right: 10px;
58
+ }
49
59
 
50
- .f-title-container {
51
- margin-bottom: 18px;
52
- }
60
+ .f-title-container {
61
+ margin-bottom: 18px;
62
+ }
53
63
 
54
- .f-content-container {
55
- display: flex;
56
- justify-content: space-around;
57
- margin-bottom: 10px;
58
- }
64
+ .f-content-container {
65
+ display: flex;
66
+ justify-content: space-around;
67
+ margin-bottom: 10px;
68
+ }
59
69
 
60
- .f-copyright {
61
- font-size: 14px;
62
- color: ${colors.content};
63
- border-top: 1px solid ${colors.content};
64
- padding: 6px 0;
65
- }
70
+ .f-copyright {
71
+ font-size: 14px;
72
+ color: ${colors.content};
73
+ border-top: 1px solid ${colors.content};
74
+ padding: 6px 0;
75
+ }
66
76
 
67
- .f-icon-div {
68
- display: flex;
69
- align-items: center;
70
- justify-content: center;
71
- cursor: pointer;
72
- }
77
+ .f-icon-div {
78
+ display: flex;
79
+ align-items: center;
80
+ justify-content: center;
81
+ cursor: pointer;
82
+ }
73
83
 
74
- .f-icon-image {
75
- color: #ffffff;
76
- width: 30px;
77
- height: 30px;
78
- }
84
+ .f-icon-image {
85
+ color: #ffffff;
86
+ width: 30px;
87
+ height: 30px;
88
+ }
79
89
 
80
- .f-intro {
81
- margin-top: 12px;
82
- font-size: 14px;
83
- font-weight: 400;
84
- line-height: 160%;
85
- letter-spacing: 0.56px;
86
- color: ${colors.content};
87
- }
90
+ .f-intro {
91
+ margin-top: 12px;
92
+ font-size: 14px;
93
+ font-weight: 400;
94
+ line-height: 160%;
95
+ letter-spacing: 0.56px;
96
+ color: ${colors.content};
97
+ }
88
98
  `);
89
- gvc.addStyle(css `
90
- .f-copyright {
91
- font-size: 14px;
92
- color: ${colors.content};
93
- border-top: 1px solid ${colors.content};
94
- padding: 6px 0;
95
- }
99
+ gvc.addStyle(`
100
+ .f-copyright {
101
+ font-size: 14px;
102
+ color: ${colors.content};
103
+ border-top: 1px solid ${colors.content};
104
+ padding: 6px 0;
105
+ }
96
106
 
97
- .f-h4 {
98
- color: ${colors.title};
99
- font-size: 32px;
100
- font-weight: 700;
101
- }
107
+ .f-h4 {
108
+ color: ${colors.title};
109
+ font-size: 32px;
110
+ font-weight: 700;
111
+ }
102
112
 
103
- .f-icon-list {
104
- display: flex;
105
- align-items: center;
106
- gap: 5px;
107
- cursor: pointer;
108
- }
113
+ .f-icon-list {
114
+ display: flex;
115
+ align-items: center;
116
+ gap: 5px;
117
+ cursor: pointer;
118
+ }
109
119
 
110
- .f-icon {
111
- color: ${colors.content};
112
- }
120
+ .f-icon {
121
+ color: ${colors.content};
122
+ }
113
123
  `);
114
- return html `
115
- <footer class="f-bgr border-top">
116
- <div class="border-gray-700 f-padding-top">
117
- <div class="container">
118
- <div class="row py-sm-5 f-container ">
119
- <div
120
- class="col-12 col-md-3 col-lg-4 f-title-container pt-3 pt-sm-0 ${document.body.clientWidth < 800 ? ` d-flex flex-column align-items-center justify-content-center` : ``}">
121
- <img src="${formData.logo}" style="max-height: 90px" />
122
- ${(window.store_info.language_setting.support.length > 1 || window.store_info.multi_currency) && document.body.clientWidth < 800 ? LanguageView.selectLanguage(gvc, colors) : ``}
123
- <ul class="d-flex list-unstyled list-inline mt-3 mb-md-0 text-gray-350">
124
- ${(() => {
124
+ return html ` <!-- Footer 01 -->
125
+ <footer class="f-bgr border-top">
126
+ <div class="border-gray-700 f-padding-top">
127
+ <div class="container">
128
+ <div class="row py-sm-5 f-container ">
129
+ <div
130
+ class="col-12 col-md-3 col-lg-4 f-title-container pt-3 pt-sm-0 ${document.body.clientWidth < 800
131
+ ? ` d-flex flex-column align-items-center justify-content-center`
132
+ : ``}"
133
+ >
134
+ <img src="${formData.logo}" style="max-height: 90px" />
135
+ ${(window.store_info.language_setting.support.length > 1 ||
136
+ window.store_info.multi_currency) &&
137
+ document.body.clientWidth < 800
138
+ ? LanguageView.selectLanguage(gvc, colors)
139
+ : ``}
140
+ <ul class="d-flex list-unstyled list-inline mt-3 mb-md-0 text-gray-350">
141
+ ${(() => {
125
142
  try {
126
143
  return formData.kkk.link
127
144
  .map((item) => {
128
- return html `
129
- <li class="list-inline-item f-icon-list">
130
- <div class="f-icon-div">
131
- <div
132
- onclick="${gvc.event(() => {
145
+ return html ` <li class="list-inline-item f-icon-list">
146
+ <div class="f-icon-div">
147
+ <div
148
+ onclick="${gvc.event(() => {
133
149
  gvc.glitter.href = item.link;
134
150
  })}"
135
- >
136
- <img
137
- class="f-icon-image"
138
- src="${(() => {
151
+ >
152
+ <img
153
+ class="f-icon-image"
154
+ src="${(() => {
139
155
  switch (item.type) {
140
156
  case 'fb':
141
157
  return 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722847285395-img_facebook.svg';
@@ -151,10 +167,10 @@ export class Footer01 {
151
167
  return '';
152
168
  }
153
169
  })()}"
154
- />
155
- </div>
156
- </div>
157
- </li>`;
170
+ />
171
+ </div>
172
+ </div>
173
+ </li>`;
158
174
  })
159
175
  .join('');
160
176
  }
@@ -162,75 +178,85 @@ export class Footer01 {
162
178
  return '';
163
179
  }
164
180
  })()}
165
- </ul>
166
- <div>
167
- <h4 class="f-intro mb-0">
168
- ${formData.intro ? formData.intro.replace(/\n/g, '<br/>') : ''}</h4>
169
- </div>
170
- ${(window.store_info.language_setting.support.length > 1 || window.store_info.multi_currency) && document.body.clientWidth >= 800 ? LanguageView.selectLanguage(gvc, colors) : ``}
171
- </div>
172
- <div class="col f-content-container ${document.body.clientWidth > 768 ? '' : 'row'}">
173
- ${(() => {
181
+ </ul>
182
+ <div>
183
+ <h4 class="f-intro mb-0">${formData.intro ? formData.intro.replace(/\n/g, '<br/>') : ''}</h4>
184
+ </div>
185
+ ${(window.store_info.language_setting.support.length > 1 ||
186
+ window.store_info.multi_currency) &&
187
+ document.body.clientWidth >= 800
188
+ ? LanguageView.selectLanguage(gvc, colors)
189
+ : ``}
190
+ </div>
191
+ <div class="col f-content-container ${document.body.clientWidth > 768 ? '' : 'row'}">
192
+ ${(() => {
174
193
  try {
175
194
  return gvc.bindView((() => {
176
195
  const id = gvc.glitter.getUUID();
177
196
  let loading = true;
178
197
  return {
179
198
  bind: id,
180
- view: () => {
199
+ view: () => __awaiter(this, void 0, void 0, function* () {
181
200
  if (loading) {
182
201
  return '';
183
202
  }
184
203
  else {
204
+ const userData = yield ApiUser.getUserData(gvc.glitter.share.GlobalUser.token, 'me');
185
205
  return footer.list
186
206
  .map((data) => {
187
- return html `
188
- <div
189
- class="${document.body.clientWidth > 768 ? '' : 'col-12 mt-3'}">
190
- <h6
191
- class="heading-xxs mb-3 f-title"
192
- onclick="${gvc.event(() => {
207
+ if (!PdClass.menuVisibleVerify(userData, data)) {
208
+ return '';
209
+ }
210
+ return html ` <div class="${document.body.clientWidth > 768 ? '' : 'col-12 mt-3'}">
211
+ <h6
212
+ class="heading-xxs mb-3 f-title"
213
+ onclick="${gvc.event(() => {
193
214
  if (data.link) {
194
215
  gvc.glitter.href = data.link;
195
216
  }
196
217
  })}"
197
- >
198
- ${data.title}
199
- </h6>
200
- <ul class="list-unstyled mb-7 f-ul">
201
- ${data.items
202
- .map((chi) => {
203
- return html `
204
- <li
205
- class="f-li"
206
- style="${chi.link ? 'cursor: pointer;' : ''}"
207
- onclick="${gvc.event(() => {
218
+ >
219
+ ${data.title}
220
+ </h6>
221
+ <ul class="list-unstyled mb-7 f-ul">
222
+ ${data.items
223
+ .map(chi => {
224
+ if (!PdClass.menuVisibleVerify(userData, chi)) {
225
+ return '';
226
+ }
227
+ return html ` <li
228
+ class="f-li"
229
+ style="${chi.link ? 'cursor: pointer;' : ''}"
230
+ onclick="${gvc.event(() => {
208
231
  if (chi.link) {
209
232
  gvc.glitter.href = chi.link;
210
233
  }
211
234
  })}"
212
- >
213
- <a class="f-aclass"
214
- title="${chi.title}"
215
- onclick="${gvc.event((e, event) => {
235
+ >
236
+ <a
237
+ class="f-aclass"
238
+ title="${chi.title}"
239
+ onclick="${gvc.event((e, event) => {
216
240
  event.preventDefault();
217
241
  })}"
218
- href="${chi.link}">${chi.title}</a>
219
- </li>`;
242
+ href="${chi.link}"
243
+ >${chi.title}</a
244
+ >
245
+ </li>`;
220
246
  })
221
247
  .join('')}
222
- </ul>
223
- </div>`;
248
+ </ul>
249
+ </div>`;
224
250
  })
225
251
  .join('');
226
252
  }
227
- },
253
+ }),
228
254
  divCreate: {
229
255
  class: document.body.clientWidth > 768 ? 'd-flex gap-5' : 'row p-0',
230
256
  },
231
257
  onCreate: () => {
232
258
  if (loading) {
233
- ApiUser.getPublicConfig(widget.formData.menu_refer || 'footer-setting', 'manager').then((data) => {
259
+ ApiUser.getPublicConfig(widget.formData.menu_refer || 'footer-setting', 'manager').then(data => {
234
260
  if (data.result && data.response.value) {
235
261
  footer.list = data.response.value[Language.getLanguage()];
236
262
  }
@@ -246,23 +272,22 @@ export class Footer01 {
246
272
  return '';
247
273
  }
248
274
  })()}
249
- </div>
250
- </div>
251
- </div>
275
+ </div>
252
276
  </div>
253
- <div class="py-6">
254
- <div class="container">
255
- ${formData.copy_right
256
- ? html `
257
- <div class="row">
258
- <div class="col text-center">
259
- <p class="my-2 f-copyright">${formData.copy_right}</p>
260
- </div>
261
- </div>`
277
+ </div>
278
+ </div>
279
+ <div class="py-6">
280
+ <div class="container">
281
+ ${formData.copy_right
282
+ ? html ` <div class="row">
283
+ <div class="col text-center">
284
+ <p class="my-2 f-copyright">${formData.copy_right}</p>
285
+ </div>
286
+ </div>`
262
287
  : ''}
263
- </div>
264
- </div>
265
- </footer>`;
288
+ </div>
289
+ </div>
290
+ </footer>`;
266
291
  },
267
292
  mobile: () => {
268
293
  return Footer.main({
@@ -270,10 +295,10 @@ export class Footer01 {
270
295
  formData: {},
271
296
  key: '',
272
297
  widget: widget,
273
- callback: () => { }
298
+ callback: () => { },
274
299
  });
275
300
  },
276
- gvc: gvc
301
+ gvc: gvc,
277
302
  });
278
303
  }
279
304
  }