ts-glitter 22.4.6 → 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.
- package/lib/glitterBundle/Glitter.css +74 -62
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-product.js +49 -32
- package/lowcode/backend-manager/bg-product.ts +57 -39
- package/lowcode/backend-manager/bg-widget.js +17 -0
- package/lowcode/backend-manager/bg-widget.ts +18 -0
- package/lowcode/cms-plugin/information/information-module.js +5 -5
- package/lowcode/cms-plugin/information/information-module.ts +9 -5
- package/lowcode/cms-plugin/menus-setting.js +69 -55
- package/lowcode/cms-plugin/menus-setting.ts +77 -61
- package/lowcode/cms-plugin/module/form-module.js +109 -89
- package/lowcode/cms-plugin/module/form-module.ts +680 -650
- package/lowcode/cms-plugin/module/product-excel.js +1 -0
- package/lowcode/cms-plugin/module/product-excel.ts +2 -0
- package/lowcode/cms-plugin/pos-pages/payment-page.js +28 -10
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +29 -10
- package/lowcode/cms-plugin/shopping-allowance-manager.js +0 -1
- package/lowcode/cms-plugin/shopping-allowance-manager.ts +0 -1
- package/lowcode/cms-plugin/shopping-collections.js +367 -193
- package/lowcode/cms-plugin/shopping-collections.ts +664 -243
- package/lowcode/cms-plugin/shopping-information.js +392 -38
- package/lowcode/cms-plugin/shopping-information.ts +479 -87
- package/lowcode/cms-plugin/shopping-product-setting.js +2 -2
- package/lowcode/cms-plugin/shopping-product-setting.ts +2 -2
- package/lowcode/cms-plugin/shopping-setting-advance.js +906 -766
- package/lowcode/cms-plugin/shopping-setting-advance.ts +977 -841
- package/lowcode/cms-plugin/shopping-setting-basic.js +1547 -1285
- package/lowcode/cms-plugin/shopping-setting-basic.ts +1742 -1466
- package/lowcode/cms-plugin/stock-stores.js +1 -0
- package/lowcode/cms-plugin/stock-stores.ts +1 -0
- package/lowcode/cms-plugin/user-list.js +47 -12
- package/lowcode/cms-plugin/user-list.ts +52 -14
- package/lowcode/css/editor.css +6 -0
- package/lowcode/glitterBundle/Glitter.css +74 -62
- package/lowcode/jslib/nestable/index.html +317 -0
- package/lowcode/jslib/nestable/jquery.nestable.js +484 -0
- package/lowcode/official_view_component/form-widget/input-custom.js +98 -6
- package/lowcode/official_view_component/form-widget/input-custom.ts +121 -16
- package/lowcode/public-components/headers/header-class.js +63 -0
- package/lowcode/public-components/headers/header-class.ts +65 -0
- package/lowcode/public-components/headers/sy-02.js +386 -400
- package/lowcode/public-components/headers/sy-02.ts +482 -492
- package/lowcode/public-components/headers/sy-03.js +42 -43
- package/lowcode/public-components/headers/sy-03.ts +46 -43
- package/lowcode/public-components/headers/sy-04.js +43 -41
- package/lowcode/public-components/headers/sy-04.ts +48 -41
- package/lowcode/public-components/headers/sy-05.js +30 -27
- package/lowcode/public-components/headers/sy-05.ts +33 -27
- package/lowcode/public-components/product/product-list.js +160 -148
- package/lowcode/public-components/product/product-list.ts +186 -165
- package/lowcode/public-models/product.ts +26 -1
- package/lowcode/src/glitterBundle/Glitter.css +74 -62
- package/package.json +1 -1
- package/rxmnt81tnk.json +1 -0
- package/src/api-public/controllers/shop.js +10 -4
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +14 -9
- package/src/api-public/services/ezpay/tool.d.ts +1 -0
- package/src/api-public/services/mail.js +1 -1
- package/src/api-public/services/mail.js.map +1 -1
- package/src/api-public/services/mail.ts +1 -1
- package/src/api-public/services/monitor.js.map +1 -1
- package/src/api-public/services/monitor.ts +2 -0
- package/src/api-public/services/schedule.d.ts +0 -1
- package/src/api-public/services/schedule.js +12 -35
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/schedule.ts +15 -39
- package/src/api-public/services/shopee.js +7 -17
- package/src/api-public/services/shopping.d.ts +27 -6
- package/src/api-public/services/shopping.js +364 -85
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +510 -101
- package/src/api-public/services/updated-table-checked.js +58 -1
- package/src/api-public/services/updated-table-checked.js.map +1 -1
- package/src/api-public/services/updated-table-checked.ts +62 -1
- package/src/api-public/services/user-update.js +14 -0
- package/src/api-public/services/user-update.js.map +1 -1
- package/src/api-public/services/user-update.ts +15 -0
- package/src/api-public/services/user.js +1 -1
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +1 -1
- package/src/app-project/serverless/src/modules/database.d.ts +1 -1
- package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
- package/src/helper/glitter-util.d.ts +1 -0
- package/src/index.js +7 -4
- package/src/index.js.map +1 -1
- package/src/index.ts +45 -36
- package/src/modules/firebase.js +1 -0
- package/src/modules/firebase.js.map +1 -1
- package/src/modules/firebase.ts +1 -0
- package/src/seo-config.d.ts +2 -1
- package/src/seo-config.js +28 -22
- package/src/seo-config.js.map +1 -1
- package/src/seo-config.ts +33 -26
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/ses.js +4 -3
- package/src/services/ses.js.map +1 -1
- package/src/services/system-schedule.js.map +1 -1
- package/src/services/system-schedule.ts +1 -0
|
@@ -19,16 +19,17 @@ export class Sy04 {
|
|
|
19
19
|
widget: widget,
|
|
20
20
|
browser: () => {
|
|
21
21
|
let changePage = (index: string, type: 'page' | 'home', subData: any) => {};
|
|
22
|
-
gvc.glitter.getModule(
|
|
23
|
-
|
|
24
|
-
});
|
|
22
|
+
gvc.glitter.getModule(HeaderClass.getChangePagePath(gvc), cl => (changePage = cl.changePage));
|
|
23
|
+
|
|
25
24
|
const colors = Color.getTheme(gvc, widget.formData);
|
|
25
|
+
HeaderClass.addStyle(gvc);
|
|
26
|
+
|
|
26
27
|
return html` <!--Header Sy04-->
|
|
27
|
-
<div style="height:
|
|
28
|
+
<div style="height: 88px;"></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"
|
|
30
31
|
style="background: ${widget.formData.theme_color['background'] ??
|
|
31
|
-
'#000'} !important;height:
|
|
32
|
+
'#000'} !important;height: 88px;z-index:9999;"
|
|
32
33
|
>
|
|
33
34
|
<div class="container header-place h-100">
|
|
34
35
|
<!--LOGO顯示區塊-->
|
|
@@ -60,26 +61,18 @@ export class Sy04 {
|
|
|
60
61
|
? html`
|
|
61
62
|
<div
|
|
62
63
|
class=" fw-bold d-flex align-items-center justify-content-center"
|
|
63
|
-
style="
|
|
64
|
-
.theme_color['title'] ?? '#000'};"
|
|
64
|
+
style="color: ${widget.formData.theme_color['title'] ?? '#000'};"
|
|
65
65
|
>
|
|
66
66
|
${widget.formData.logo.value}
|
|
67
67
|
</div>
|
|
68
68
|
`
|
|
69
|
-
: html`<img
|
|
70
|
-
style="width: 150px;
|
|
71
|
-
background-position: center;
|
|
72
|
-
background-size: cover;
|
|
73
|
-
background-repeat: no-repeat;
|
|
74
|
-
margin-bottom: 20px;"
|
|
75
|
-
src="${widget.formData.logo.value}"
|
|
76
|
-
/> `}
|
|
69
|
+
: html`<img class="h-logo-image" src="${widget.formData.logo.value}" /> `}
|
|
77
70
|
</div>
|
|
78
71
|
</div>
|
|
79
72
|
</div>
|
|
80
73
|
${LanguageView.selectLanguage(gvc, colors)
|
|
81
74
|
? `<div class="mb-3">${LanguageView.selectLanguage(gvc, colors)}</div>`
|
|
82
|
-
:
|
|
75
|
+
: ''}
|
|
83
76
|
<div class="position-relative">
|
|
84
77
|
<input
|
|
85
78
|
class="form-control fw-500 "
|
|
@@ -91,13 +84,7 @@ export class Sy04 {
|
|
|
91
84
|
})}"
|
|
92
85
|
/>
|
|
93
86
|
|
|
94
|
-
<div
|
|
95
|
-
style=" position: absolute;
|
|
96
|
-
right: 10px;
|
|
97
|
-
top: 50%;
|
|
98
|
-
transform: translateY(-50%);
|
|
99
|
-
color: rgb(107, 114, 128);"
|
|
100
|
-
>
|
|
87
|
+
<div class="h-glass-div">
|
|
101
88
|
<i class="fa-solid fa-magnifying-glass"></i>
|
|
102
89
|
</div>
|
|
103
90
|
</div>
|
|
@@ -132,18 +119,29 @@ export class Sy04 {
|
|
|
132
119
|
loop(vm.data);
|
|
133
120
|
}
|
|
134
121
|
|
|
135
|
-
function
|
|
122
|
+
function openParent(data: any, current_path: string[], depth: number) {
|
|
123
|
+
data.open = current_path[depth] === data.title;
|
|
124
|
+
|
|
125
|
+
if ((data.items || []).length > 0) {
|
|
126
|
+
for (const d87 of data.items) {
|
|
127
|
+
openParent(d87, current_path, depth + 1);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function loopItems(data: any, show_border: boolean, current_path: string[]) {
|
|
136
133
|
return data
|
|
137
134
|
.map((dd: any) => {
|
|
135
|
+
const path = [...current_path, dd.title];
|
|
138
136
|
return html`
|
|
139
137
|
<li
|
|
140
138
|
style="${show_border
|
|
141
139
|
? `border-bottom: 1px solid ${widget.formData.theme_color['title'] ?? '#000'} !important;`
|
|
142
|
-
:
|
|
140
|
+
: ''}"
|
|
143
141
|
>
|
|
144
142
|
<div
|
|
145
143
|
class="nav-link d-flex justify-content-between"
|
|
146
|
-
style="padding: 16px;"
|
|
144
|
+
style="padding: 16px; gap: 30px;"
|
|
147
145
|
onclick="${gvc.event(() => {
|
|
148
146
|
if (((dd as any).items ?? []).length === 0) {
|
|
149
147
|
if (dd.link) {
|
|
@@ -156,6 +154,9 @@ export class Sy04 {
|
|
|
156
154
|
if (!og) {
|
|
157
155
|
dd.open = true;
|
|
158
156
|
}
|
|
157
|
+
for (const d4 of vm.data) {
|
|
158
|
+
openParent(d4, path, 0);
|
|
159
|
+
}
|
|
159
160
|
gvc.notifyDataChange(id);
|
|
160
161
|
}
|
|
161
162
|
})}"
|
|
@@ -177,22 +178,22 @@ export class Sy04 {
|
|
|
177
178
|
${(dd.items ?? []).length
|
|
178
179
|
? `<i class="fa-solid ${dd.open ? `fa-angle-up` : `fa-angle-down`}"
|
|
179
180
|
style="color: ${widget.formData.theme_color['title'] ?? '#000'} !important;"></i>`
|
|
180
|
-
:
|
|
181
|
+
: ''}
|
|
181
182
|
</div>
|
|
182
183
|
${dd.open
|
|
183
|
-
? `<ul class="ps-3 pb-2">${loopItems(dd.items ?? [], false)}</ul>`
|
|
184
|
-
:
|
|
184
|
+
? `<ul class="ps-3 pb-2">${loopItems(dd.items ?? [], false, path)}</ul>`
|
|
185
|
+
: ''}
|
|
185
186
|
</li>
|
|
186
187
|
`;
|
|
187
188
|
})
|
|
188
189
|
.join('');
|
|
189
190
|
}
|
|
190
191
|
|
|
191
|
-
return loopItems(vm.data, true);
|
|
192
|
+
return loopItems(vm.data, true, []);
|
|
192
193
|
},
|
|
193
194
|
divCreate: {
|
|
194
195
|
class: `navbar-nav me-auto mb-2 mb-lg-0`,
|
|
195
|
-
style:
|
|
196
|
+
style: '',
|
|
196
197
|
elem: `ul`,
|
|
197
198
|
},
|
|
198
199
|
};
|
|
@@ -219,7 +220,7 @@ background: ${colors.bgr ?? '#000'};overflow-x: hidden;`,
|
|
|
219
220
|
></i>
|
|
220
221
|
</div>
|
|
221
222
|
<div
|
|
222
|
-
class="${widget.formData.logo.type === 'text' ?
|
|
223
|
+
class="${widget.formData.logo.type === 'text' ? '' : `h-100`}"
|
|
223
224
|
onclick="${gvc.event(() => {
|
|
224
225
|
changePage('index', 'home', {});
|
|
225
226
|
})}"
|
|
@@ -293,13 +294,19 @@ background: ${colors.bgr ?? '#000'};overflow-x: hidden;`,
|
|
|
293
294
|
}
|
|
294
295
|
})}"
|
|
295
296
|
>${dd.title}
|
|
296
|
-
${dd.items.length > 0 ? `<i class="fa-solid fa-angle-down ms-2"></i>` :
|
|
297
|
+
${dd.items.length > 0 ? `<i class="fa-solid fa-angle-down ms-2"></i>` : ''}</a
|
|
297
298
|
>
|
|
298
299
|
${dd.items.length > 0
|
|
299
|
-
? `<ul
|
|
300
|
+
? html`<ul
|
|
301
|
+
class="dropdown-menu mt-0"
|
|
302
|
+
style="background:${widget.formData.theme_color['background'] ??
|
|
303
|
+
'#000'} !important;
|
|
300
304
|
cursor: pointer;
|
|
301
|
-
z-index: 99999;"
|
|
302
|
-
|
|
305
|
+
z-index: 99999;"
|
|
306
|
+
>
|
|
307
|
+
${loopItems(dd.items)}
|
|
308
|
+
</ul>`
|
|
309
|
+
: ''}
|
|
303
310
|
</li>`;
|
|
304
311
|
})
|
|
305
312
|
.join('');
|
|
@@ -308,8 +315,8 @@ background: ${colors.bgr ?? '#000'};overflow-x: hidden;`,
|
|
|
308
315
|
return loopItems(vm.data);
|
|
309
316
|
},
|
|
310
317
|
divCreate: {
|
|
311
|
-
class: `navbar-nav ms-3 me-auto `,
|
|
312
|
-
style: `flex-direction: row; gap: 0px;`,
|
|
318
|
+
class: `navbar-nav ms-3 me-auto flex-wrap`,
|
|
319
|
+
style: `flex-direction: row; gap: 0px; justify-content: center;`,
|
|
313
320
|
elem: `ul`,
|
|
314
321
|
},
|
|
315
322
|
};
|
|
@@ -357,7 +364,7 @@ padding-bottom: 2px;
|
|
|
357
364
|
};
|
|
358
365
|
})}
|
|
359
366
|
${HeaderClass.hideShopperBtn()
|
|
360
|
-
?
|
|
367
|
+
? ''
|
|
361
368
|
: `<li class="nav-item d-none d-sm-flex align-items-center justify-content-center" >
|
|
362
369
|
${gvc.bindView(() => {
|
|
363
370
|
const vm = {
|
|
@@ -368,7 +375,7 @@ padding-bottom: 2px;
|
|
|
368
375
|
bind: vm.id,
|
|
369
376
|
view: () => {
|
|
370
377
|
if (PdClass.isShoppingPage()) {
|
|
371
|
-
return
|
|
378
|
+
return '';
|
|
372
379
|
}
|
|
373
380
|
if (!vm.toggle) {
|
|
374
381
|
return html`<i
|
|
@@ -452,7 +459,7 @@ padding-bottom: 2px;
|
|
|
452
459
|
${vm.count}
|
|
453
460
|
</div>
|
|
454
461
|
</div>`
|
|
455
|
-
:
|
|
462
|
+
: ''
|
|
456
463
|
);
|
|
457
464
|
});
|
|
458
465
|
});
|
|
@@ -14,6 +14,7 @@ import { Color } from '../public/color.js';
|
|
|
14
14
|
import { HeadInitial } from './head-initial.js';
|
|
15
15
|
import { HeaderMobile } from './header-mobile.js';
|
|
16
16
|
import { PdClass } from '../product/pd-class.js';
|
|
17
|
+
import { HeaderClass } from './header-class.js';
|
|
17
18
|
const html = String.raw;
|
|
18
19
|
export class Sy05 {
|
|
19
20
|
static main(gvc, widget, subData) {
|
|
@@ -22,9 +23,8 @@ export class Sy05 {
|
|
|
22
23
|
browser: () => {
|
|
23
24
|
var _a, _b, _c;
|
|
24
25
|
let changePage = (index, type, subData) => { };
|
|
25
|
-
gvc.glitter.getModule(
|
|
26
|
-
|
|
27
|
-
});
|
|
26
|
+
gvc.glitter.getModule(HeaderClass.getChangePagePath(gvc), cl => (changePage = cl.changePage));
|
|
27
|
+
HeaderClass.addStyle(gvc);
|
|
28
28
|
return html `
|
|
29
29
|
<!--Header Sy05-->
|
|
30
30
|
<div style="height: 76px;"></div>
|
|
@@ -62,22 +62,13 @@ export class Sy05 {
|
|
|
62
62
|
${widget.formData.logo.type === 'text'
|
|
63
63
|
? html `
|
|
64
64
|
<div
|
|
65
|
-
class="
|
|
66
|
-
style="
|
|
67
|
-
.formData.theme_color['title']) !== null && _a !== void 0 ? _a : '#000'};"
|
|
65
|
+
class="fw-bold d-flex align-items-center justify-content-center h-logo-text-1"
|
|
66
|
+
style="color: ${(_a = widget.formData.theme_color['title']) !== null && _a !== void 0 ? _a : '#000'};"
|
|
68
67
|
>
|
|
69
68
|
${widget.formData.logo.value}
|
|
70
69
|
</div>
|
|
71
70
|
`
|
|
72
|
-
: html `<img
|
|
73
|
-
style="width: 150px;
|
|
74
|
-
background-position: center;
|
|
75
|
-
background-size: cover;
|
|
76
|
-
background-repeat: no-repeat;
|
|
77
|
-
border-radius: 10px;
|
|
78
|
-
margin-bottom: 20px;"
|
|
79
|
-
src="${widget.formData.logo.value}"
|
|
80
|
-
/> `}
|
|
71
|
+
: html `<img class="h-logo-image" src="${widget.formData.logo.value}" /> `}
|
|
81
72
|
</div>
|
|
82
73
|
</div>
|
|
83
74
|
</div>
|
|
@@ -106,19 +97,28 @@ export class Sy05 {
|
|
|
106
97
|
}
|
|
107
98
|
loop(vm.data);
|
|
108
99
|
}
|
|
109
|
-
function
|
|
100
|
+
function openParent(data, current_path, depth) {
|
|
101
|
+
data.open = current_path[depth] === data.title;
|
|
102
|
+
if ((data.items || []).length > 0) {
|
|
103
|
+
for (const d87 of data.items) {
|
|
104
|
+
openParent(d87, current_path, depth + 1);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function loopItems(data, show_border, current_path) {
|
|
110
109
|
return data
|
|
111
110
|
.map((dd) => {
|
|
112
111
|
var _a, _b, _c, _d, _e;
|
|
112
|
+
const path = [...current_path, dd.title];
|
|
113
113
|
return html `
|
|
114
114
|
<li
|
|
115
115
|
style="${show_border
|
|
116
116
|
? `border-bottom: 1px solid ${(_a = widget.formData.theme_color['title']) !== null && _a !== void 0 ? _a : '#000'} !important;`
|
|
117
|
-
:
|
|
117
|
+
: ''}"
|
|
118
118
|
>
|
|
119
119
|
<div
|
|
120
120
|
class="nav-link d-flex justify-content-between"
|
|
121
|
-
style="padding: 16px;"
|
|
121
|
+
style="padding: 16px; gap: 30px;"
|
|
122
122
|
onclick="${gvc.event(() => {
|
|
123
123
|
var _a;
|
|
124
124
|
if (((_a = dd.items) !== null && _a !== void 0 ? _a : []).length === 0) {
|
|
@@ -133,6 +133,9 @@ export class Sy05 {
|
|
|
133
133
|
if (!og) {
|
|
134
134
|
dd.open = true;
|
|
135
135
|
}
|
|
136
|
+
for (const d4 of vm.data) {
|
|
137
|
+
openParent(d4, path, 0);
|
|
138
|
+
}
|
|
136
139
|
gvc.notifyDataChange(id);
|
|
137
140
|
}
|
|
138
141
|
})}"
|
|
@@ -155,21 +158,21 @@ export class Sy05 {
|
|
|
155
158
|
class="fa-solid ${dd.open ? `fa-angle-up` : `fa-angle-down`}"
|
|
156
159
|
style="color: ${(_d = widget.formData.theme_color['title']) !== null && _d !== void 0 ? _d : '#000'} !important;"
|
|
157
160
|
></i>`
|
|
158
|
-
:
|
|
161
|
+
: ''}
|
|
159
162
|
</div>
|
|
160
163
|
${dd.open
|
|
161
|
-
? `<ul class="ps-3 pb-2">${loopItems((_e = dd.items) !== null && _e !== void 0 ? _e : [], false)}</ul>`
|
|
162
|
-
:
|
|
164
|
+
? `<ul class="ps-3 pb-2">${loopItems((_e = dd.items) !== null && _e !== void 0 ? _e : [], false, path)}</ul>`
|
|
165
|
+
: ''}
|
|
163
166
|
</li>
|
|
164
167
|
`;
|
|
165
168
|
})
|
|
166
169
|
.join('');
|
|
167
170
|
}
|
|
168
|
-
return loopItems(vm.data, true);
|
|
171
|
+
return loopItems(vm.data, true, []);
|
|
169
172
|
},
|
|
170
173
|
divCreate: {
|
|
171
174
|
class: `navbar-nav me-auto mb-2 mb-lg-0`,
|
|
172
|
-
style:
|
|
175
|
+
style: '',
|
|
173
176
|
elem: `ul`,
|
|
174
177
|
},
|
|
175
178
|
};
|
|
@@ -193,7 +196,7 @@ background: ${(_a = widget.formData.theme_color['background']) !== null && _a !=
|
|
|
193
196
|
color: ${(_b = widget.formData.theme_color['title']) !== null && _b !== void 0 ? _b : '#000'};"
|
|
194
197
|
></i>
|
|
195
198
|
</div>
|
|
196
|
-
<div class="${widget.formData.logo.type === 'text' ?
|
|
199
|
+
<div class="${widget.formData.logo.type === 'text' ? '' : `h-100`}"
|
|
197
200
|
onclick="${gvc.event(() => {
|
|
198
201
|
changePage('index', 'home', {});
|
|
199
202
|
})}"> ${widget.formData.logo.type === 'text'
|
|
@@ -212,7 +215,7 @@ background: ${(_a = widget.formData.theme_color['background']) !== null && _a !=
|
|
|
212
215
|
`}
|
|
213
216
|
</div>
|
|
214
217
|
<!--選單列表顯示區塊-->
|
|
215
|
-
<ul class="navbar-nav
|
|
218
|
+
<ul class="navbar-nav d-none d-md-block flex-fill ps-2" >
|
|
216
219
|
${gvc.bindView(() => {
|
|
217
220
|
const id = gvc.glitter.getUUID();
|
|
218
221
|
const vm = {
|
|
@@ -243,7 +246,7 @@ background: ${(_a = widget.formData.theme_color['background']) !== null && _a !=
|
|
|
243
246
|
}
|
|
244
247
|
})}"
|
|
245
248
|
>${dd.title}
|
|
246
|
-
${dd.items.length > 0 ? `<i class="fa-solid fa-angle-down ms-2"></i>` :
|
|
249
|
+
${dd.items.length > 0 ? `<i class="fa-solid fa-angle-down ms-2"></i>` : ''}</a
|
|
247
250
|
>
|
|
248
251
|
${dd.items.length > 0
|
|
249
252
|
? html `<ul
|
|
@@ -252,7 +255,7 @@ background: ${(_a = widget.formData.theme_color['background']) !== null && _a !=
|
|
|
252
255
|
>
|
|
253
256
|
${loopItems(dd.items)}
|
|
254
257
|
</ul>`
|
|
255
|
-
:
|
|
258
|
+
: ''}
|
|
256
259
|
</li>`;
|
|
257
260
|
})
|
|
258
261
|
.join('');
|
|
@@ -6,6 +6,7 @@ import { Color } from '../public/color.js';
|
|
|
6
6
|
import { HeadInitial } from './head-initial.js';
|
|
7
7
|
import { HeaderMobile } from './header-mobile.js';
|
|
8
8
|
import { PdClass } from '../product/pd-class.js';
|
|
9
|
+
import { HeaderClass } from './header-class.js';
|
|
9
10
|
|
|
10
11
|
const html = String.raw;
|
|
11
12
|
|
|
@@ -15,9 +16,9 @@ export class Sy05 {
|
|
|
15
16
|
widget: widget,
|
|
16
17
|
browser: () => {
|
|
17
18
|
let changePage = (index: string, type: 'page' | 'home', subData: any) => {};
|
|
18
|
-
gvc.glitter.getModule(
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
gvc.glitter.getModule(HeaderClass.getChangePagePath(gvc), cl => (changePage = cl.changePage));
|
|
20
|
+
|
|
21
|
+
HeaderClass.addStyle(gvc);
|
|
21
22
|
|
|
22
23
|
return html`
|
|
23
24
|
<!--Header Sy05-->
|
|
@@ -55,22 +56,13 @@ export class Sy05 {
|
|
|
55
56
|
${widget.formData.logo.type === 'text'
|
|
56
57
|
? html`
|
|
57
58
|
<div
|
|
58
|
-
class="
|
|
59
|
-
style="
|
|
60
|
-
.formData.theme_color['title'] ?? '#000'};"
|
|
59
|
+
class="fw-bold d-flex align-items-center justify-content-center h-logo-text-1"
|
|
60
|
+
style="color: ${widget.formData.theme_color['title'] ?? '#000'};"
|
|
61
61
|
>
|
|
62
62
|
${widget.formData.logo.value}
|
|
63
63
|
</div>
|
|
64
64
|
`
|
|
65
|
-
: html`<img
|
|
66
|
-
style="width: 150px;
|
|
67
|
-
background-position: center;
|
|
68
|
-
background-size: cover;
|
|
69
|
-
background-repeat: no-repeat;
|
|
70
|
-
border-radius: 10px;
|
|
71
|
-
margin-bottom: 20px;"
|
|
72
|
-
src="${widget.formData.logo.value}"
|
|
73
|
-
/> `}
|
|
65
|
+
: html`<img class="h-logo-image" src="${widget.formData.logo.value}" /> `}
|
|
74
66
|
</div>
|
|
75
67
|
</div>
|
|
76
68
|
</div>
|
|
@@ -104,18 +96,29 @@ export class Sy05 {
|
|
|
104
96
|
loop(vm.data);
|
|
105
97
|
}
|
|
106
98
|
|
|
107
|
-
function
|
|
99
|
+
function openParent(data: any, current_path: string[], depth: number) {
|
|
100
|
+
data.open = current_path[depth] === data.title;
|
|
101
|
+
|
|
102
|
+
if ((data.items || []).length > 0) {
|
|
103
|
+
for (const d87 of data.items) {
|
|
104
|
+
openParent(d87, current_path, depth + 1);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function loopItems(data: any, show_border: boolean, current_path: string[]) {
|
|
108
110
|
return data
|
|
109
111
|
.map((dd: any) => {
|
|
112
|
+
const path = [...current_path, dd.title];
|
|
110
113
|
return html`
|
|
111
114
|
<li
|
|
112
115
|
style="${show_border
|
|
113
116
|
? `border-bottom: 1px solid ${widget.formData.theme_color['title'] ?? '#000'} !important;`
|
|
114
|
-
:
|
|
117
|
+
: ''}"
|
|
115
118
|
>
|
|
116
119
|
<div
|
|
117
120
|
class="nav-link d-flex justify-content-between"
|
|
118
|
-
style="padding: 16px;"
|
|
121
|
+
style="padding: 16px; gap: 30px;"
|
|
119
122
|
onclick="${gvc.event(() => {
|
|
120
123
|
if (((dd as any).items ?? []).length === 0) {
|
|
121
124
|
if (dd.link) {
|
|
@@ -128,6 +131,9 @@ export class Sy05 {
|
|
|
128
131
|
if (!og) {
|
|
129
132
|
dd.open = true;
|
|
130
133
|
}
|
|
134
|
+
for (const d4 of vm.data) {
|
|
135
|
+
openParent(d4, path, 0);
|
|
136
|
+
}
|
|
131
137
|
gvc.notifyDataChange(id);
|
|
132
138
|
}
|
|
133
139
|
})}"
|
|
@@ -152,22 +158,22 @@ export class Sy05 {
|
|
|
152
158
|
style="color: ${widget.formData.theme_color['title'] ??
|
|
153
159
|
'#000'} !important;"
|
|
154
160
|
></i>`
|
|
155
|
-
:
|
|
161
|
+
: ''}
|
|
156
162
|
</div>
|
|
157
163
|
${dd.open
|
|
158
|
-
? `<ul class="ps-3 pb-2">${loopItems(dd.items ?? [], false)}</ul>`
|
|
159
|
-
:
|
|
164
|
+
? `<ul class="ps-3 pb-2">${loopItems(dd.items ?? [], false, path)}</ul>`
|
|
165
|
+
: ''}
|
|
160
166
|
</li>
|
|
161
167
|
`;
|
|
162
168
|
})
|
|
163
169
|
.join('');
|
|
164
170
|
}
|
|
165
171
|
|
|
166
|
-
return loopItems(vm.data, true);
|
|
172
|
+
return loopItems(vm.data, true, []);
|
|
167
173
|
},
|
|
168
174
|
divCreate: {
|
|
169
175
|
class: `navbar-nav me-auto mb-2 mb-lg-0`,
|
|
170
|
-
style:
|
|
176
|
+
style: '',
|
|
171
177
|
elem: `ul`,
|
|
172
178
|
},
|
|
173
179
|
};
|
|
@@ -193,7 +199,7 @@ background: ${widget.formData.theme_color['background'] ?? '#000'};overflow-x: h
|
|
|
193
199
|
color: ${widget.formData.theme_color['title'] ?? '#000'};"
|
|
194
200
|
></i>
|
|
195
201
|
</div>
|
|
196
|
-
<div class="${widget.formData.logo.type === 'text' ?
|
|
202
|
+
<div class="${widget.formData.logo.type === 'text' ? '' : `h-100`}"
|
|
197
203
|
onclick="${gvc.event(() => {
|
|
198
204
|
changePage('index', 'home', {});
|
|
199
205
|
})}"> ${
|
|
@@ -216,7 +222,7 @@ background: ${widget.formData.theme_color['background'] ?? '#000'};overflow-x: h
|
|
|
216
222
|
}
|
|
217
223
|
</div>
|
|
218
224
|
<!--選單列表顯示區塊-->
|
|
219
|
-
<ul class="navbar-nav
|
|
225
|
+
<ul class="navbar-nav d-none d-md-block flex-fill ps-2" >
|
|
220
226
|
${gvc.bindView(() => {
|
|
221
227
|
const id = gvc.glitter.getUUID();
|
|
222
228
|
const vm = {
|
|
@@ -253,7 +259,7 @@ background: ${widget.formData.theme_color['background'] ?? '#000'};overflow-x: h
|
|
|
253
259
|
}
|
|
254
260
|
})}"
|
|
255
261
|
>${dd.title}
|
|
256
|
-
${dd.items.length > 0 ? `<i class="fa-solid fa-angle-down ms-2"></i>` :
|
|
262
|
+
${dd.items.length > 0 ? `<i class="fa-solid fa-angle-down ms-2"></i>` : ''}</a
|
|
257
263
|
>
|
|
258
264
|
${dd.items.length > 0
|
|
259
265
|
? html`<ul
|
|
@@ -263,7 +269,7 @@ background: ${widget.formData.theme_color['background'] ?? '#000'};overflow-x: h
|
|
|
263
269
|
>
|
|
264
270
|
${loopItems(dd.items)}
|
|
265
271
|
</ul>`
|
|
266
|
-
:
|
|
272
|
+
: ''}
|
|
267
273
|
</li>`;
|
|
268
274
|
})
|
|
269
275
|
.join('');
|