ts-glitter 17.1.3 → 17.1.4
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/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-widget.js +9 -12
- package/lowcode/backend-manager/bg-widget.ts +11 -12
- package/lowcode/cms-plugin/shopping-product-setting.js +0 -1
- package/lowcode/cms-plugin/shopping-product-setting.ts +1 -2
- package/lowcode/glitterBundle/Glitter.js +14 -5
- package/lowcode/glitterBundle/Glitter.ts +17 -5
- package/lowcode/glitterBundle/plugins/editor-elem.js +20 -18
- package/lowcode/glitterBundle/plugins/editor-elem.ts +19 -17
- package/lowcode/glitterBundle/plugins/html-render.js +0 -1
- package/lowcode/glitterBundle/plugins/html-render.ts +0 -1
- package/lowcode/public-components/banner/first-banner.js +0 -1
- package/lowcode/public-components/banner/first-banner.ts +0 -1
- package/lowcode/public-components/product/pd-class.js +0 -1
- package/lowcode/public-components/product/pd-class.ts +0 -1
- package/package.json +1 -1
package/lowcode/Entry.js
CHANGED
|
@@ -89,7 +89,7 @@ export class Entry {
|
|
|
89
89
|
}
|
|
90
90
|
window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : clockF();
|
|
91
91
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
92
|
-
glitter.share.editerVersion = 'V_17.1.
|
|
92
|
+
glitter.share.editerVersion = 'V_17.1.4';
|
|
93
93
|
glitter.share.start = new Date();
|
|
94
94
|
const vm = {
|
|
95
95
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -90,7 +90,7 @@ export class Entry {
|
|
|
90
90
|
}
|
|
91
91
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
92
92
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
93
|
-
glitter.share.editerVersion = 'V_17.1.
|
|
93
|
+
glitter.share.editerVersion = 'V_17.1.4';
|
|
94
94
|
glitter.share.start = new Date();
|
|
95
95
|
const vm: {
|
|
96
96
|
appConfig: any;
|
|
@@ -1564,7 +1564,7 @@ ${(_c = obj.default) !== null && _c !== void 0 ? _c : ''}</textarea
|
|
|
1564
1564
|
table: false,
|
|
1565
1565
|
};
|
|
1566
1566
|
gvc.addStyle(`
|
|
1567
|
-
|
|
1567
|
+
.tb_v3 {
|
|
1568
1568
|
text-align: left !important;
|
|
1569
1569
|
padding-right: 0.25rem !important;
|
|
1570
1570
|
padding-left: 0.25rem !important;
|
|
@@ -1719,7 +1719,7 @@ ${(_c = obj.default) !== null && _c !== void 0 ? _c : ''}</textarea
|
|
|
1719
1719
|
return vm.tableData[0]
|
|
1720
1720
|
.map((dd, index) => {
|
|
1721
1721
|
return html `
|
|
1722
|
-
<div class="${ids.headerCell} ${ids.textClass} tx_700"
|
|
1722
|
+
<div class="${ids.headerCell} ${ids.textClass} tb_v3 tx_700"
|
|
1723
1723
|
style="min-width: ${widthList[index]}px;">${dd.key}
|
|
1724
1724
|
</div>`;
|
|
1725
1725
|
})
|
|
@@ -1780,19 +1780,16 @@ ${(_c = obj.default) !== null && _c !== void 0 ? _c : ''}</textarea
|
|
|
1780
1780
|
${dd
|
|
1781
1781
|
.map((d3, tdIndex) => {
|
|
1782
1782
|
const tdClass = Tool.randomString(5);
|
|
1783
|
-
|
|
1784
|
-
.${tdClass} {
|
|
1785
|
-
border: none;
|
|
1783
|
+
const style = ` border: none;
|
|
1786
1784
|
vertical-align: middle;
|
|
1787
1785
|
width: ${widthList[tdIndex]}px;
|
|
1788
1786
|
${dd.length > 1 && tdIndex === 0 ? 'border-radius: 10px 0 0 10px;' : ''}
|
|
1789
1787
|
${dd.length > 1 && tdIndex === dd.length - 1 ? 'border-radius: 0 10px 10px 0;' : ''}
|
|
1790
|
-
${dd.length === 1 ? 'border-radius: 10px;' : ''}
|
|
1791
|
-
}
|
|
1792
|
-
`);
|
|
1788
|
+
${dd.length === 1 ? 'border-radius: 10px;' : ''}`;
|
|
1793
1789
|
return html `
|
|
1794
1790
|
<td
|
|
1795
|
-
class="${ids.textClass} ${tdClass} tx_normal"
|
|
1791
|
+
class="${ids.textClass} ${tdClass} tb_v3 tx_normal"
|
|
1792
|
+
style="${style}"
|
|
1796
1793
|
${obj.filter.length !== 0 && tdIndex === 0 ? `gvc-checkbox="checkbox${trIndex}"` : ''}
|
|
1797
1794
|
>
|
|
1798
1795
|
<div class="text-nowrap"
|
|
@@ -3779,8 +3776,8 @@ ${(_c = obj.default) !== null && _c !== void 0 ? _c : ''}</textarea
|
|
|
3779
3776
|
`);
|
|
3780
3777
|
return className;
|
|
3781
3778
|
}
|
|
3782
|
-
static getDarkDotClass(gvc
|
|
3783
|
-
const className =
|
|
3779
|
+
static getDarkDotClass(gvc) {
|
|
3780
|
+
const className = `dark_dot`;
|
|
3784
3781
|
gvc.addStyle(`
|
|
3785
3782
|
.${className} {
|
|
3786
3783
|
min-width: 1rem;
|
|
@@ -3790,7 +3787,7 @@ ${(_c = obj.default) !== null && _c !== void 0 ? _c : ''}</textarea
|
|
|
3790
3787
|
.${className}:checked[type='radio'] {
|
|
3791
3788
|
border: 2px solid #000;
|
|
3792
3789
|
background-color: #fff;
|
|
3793
|
-
background-image: url(${this.darkDotDataImage(
|
|
3790
|
+
background-image: url(${this.darkDotDataImage('#000')});
|
|
3794
3791
|
background-position: center center;
|
|
3795
3792
|
}
|
|
3796
3793
|
`);
|
|
@@ -1866,7 +1866,7 @@ ${obj.default ?? ''}</textarea
|
|
|
1866
1866
|
};
|
|
1867
1867
|
|
|
1868
1868
|
gvc.addStyle(`
|
|
1869
|
-
|
|
1869
|
+
.tb_v3 {
|
|
1870
1870
|
text-align: left !important;
|
|
1871
1871
|
padding-right: 0.25rem !important;
|
|
1872
1872
|
padding-left: 0.25rem !important;
|
|
@@ -2039,7 +2039,7 @@ ${obj.default ?? ''}</textarea
|
|
|
2039
2039
|
return vm.tableData[0]
|
|
2040
2040
|
.map((dd, index: number) => {
|
|
2041
2041
|
return html`
|
|
2042
|
-
<div class="${ids.headerCell} ${ids.textClass} tx_700"
|
|
2042
|
+
<div class="${ids.headerCell} ${ids.textClass} tb_v3 tx_700"
|
|
2043
2043
|
style="min-width: ${widthList[index]}px;">${dd.key}
|
|
2044
2044
|
</div>`;
|
|
2045
2045
|
})
|
|
@@ -2100,19 +2100,17 @@ ${obj.default ?? ''}</textarea
|
|
|
2100
2100
|
${dd
|
|
2101
2101
|
.map((d3, tdIndex: number) => {
|
|
2102
2102
|
const tdClass = Tool.randomString(5);
|
|
2103
|
-
|
|
2104
|
-
.${tdClass} {
|
|
2105
|
-
border: none;
|
|
2103
|
+
const style=` border: none;
|
|
2106
2104
|
vertical-align: middle;
|
|
2107
2105
|
width: ${widthList[tdIndex]}px;
|
|
2108
2106
|
${dd.length > 1 && tdIndex === 0 ? 'border-radius: 10px 0 0 10px;' : ''}
|
|
2109
2107
|
${dd.length > 1 && tdIndex === dd.length - 1 ? 'border-radius: 0 10px 10px 0;' : ''}
|
|
2110
|
-
${dd.length === 1 ? 'border-radius: 10px;' : ''}
|
|
2111
|
-
|
|
2112
|
-
`);
|
|
2108
|
+
${dd.length === 1 ? 'border-radius: 10px;' : ''}`
|
|
2109
|
+
|
|
2113
2110
|
return html`
|
|
2114
2111
|
<td
|
|
2115
|
-
class="${ids.textClass} ${tdClass} tx_normal"
|
|
2112
|
+
class="${ids.textClass} ${tdClass} tb_v3 tx_normal"
|
|
2113
|
+
style="${style}"
|
|
2116
2114
|
${obj.filter.length !== 0 && tdIndex === 0 ? `gvc-checkbox="checkbox${trIndex}"` : ''}
|
|
2117
2115
|
>
|
|
2118
2116
|
<div class="text-nowrap"
|
|
@@ -2301,6 +2299,7 @@ ${obj.default ?? ''}</textarea
|
|
|
2301
2299
|
const id = gvc.glitter.getUUID();
|
|
2302
2300
|
const randomString = this.getDarkDotClass(gvc);
|
|
2303
2301
|
|
|
2302
|
+
|
|
2304
2303
|
return gvc.bindView({
|
|
2305
2304
|
bind: id,
|
|
2306
2305
|
view: () => {
|
|
@@ -4445,8 +4444,8 @@ ${obj.default ?? ''}</textarea
|
|
|
4445
4444
|
return className;
|
|
4446
4445
|
}
|
|
4447
4446
|
|
|
4448
|
-
static getDarkDotClass(gvc: GVC
|
|
4449
|
-
const className =
|
|
4447
|
+
static getDarkDotClass(gvc: GVC) {
|
|
4448
|
+
const className = `dark_dot`;
|
|
4450
4449
|
gvc.addStyle(`
|
|
4451
4450
|
.${className} {
|
|
4452
4451
|
min-width: 1rem;
|
|
@@ -4456,7 +4455,7 @@ ${obj.default ?? ''}</textarea
|
|
|
4456
4455
|
.${className}:checked[type='radio'] {
|
|
4457
4456
|
border: 2px solid #000;
|
|
4458
4457
|
background-color: #fff;
|
|
4459
|
-
background-image: url(${this.darkDotDataImage(
|
|
4458
|
+
background-image: url(${this.darkDotDataImage('#000')});
|
|
4460
4459
|
background-position: center center;
|
|
4461
4460
|
}
|
|
4462
4461
|
`);
|
|
@@ -1592,7 +1592,6 @@ export class ShoppingProductSetting {
|
|
|
1592
1592
|
postMD.variants.map((variant) => {
|
|
1593
1593
|
variant.preview_image = variant[`preview_image_${ShoppingProductSetting.select_language}`] || variant.preview_image || BgWidget.noImageURL;
|
|
1594
1594
|
});
|
|
1595
|
-
console.log("language_data.title -- ", language_data);
|
|
1596
1595
|
const cat_title = (() => {
|
|
1597
1596
|
switch (postMD.product_category) {
|
|
1598
1597
|
case "commodity":
|
|
@@ -1814,8 +1814,7 @@ export class ShoppingProductSetting {
|
|
|
1814
1814
|
postMD.variants.map((variant: any) => {
|
|
1815
1815
|
variant.preview_image = variant[`preview_image_${ShoppingProductSetting.select_language}`] || variant.preview_image || BgWidget.noImageURL
|
|
1816
1816
|
})
|
|
1817
|
-
|
|
1818
|
-
// console.log(postMD.title)
|
|
1817
|
+
|
|
1819
1818
|
const cat_title=(()=>{
|
|
1820
1819
|
switch (postMD.product_category){
|
|
1821
1820
|
case "commodity":
|
|
@@ -488,17 +488,26 @@ export class Glitter {
|
|
|
488
488
|
try {
|
|
489
489
|
const funString = `${dd.value}`;
|
|
490
490
|
if (!(element.replaceAtMemory[dd.key])) {
|
|
491
|
-
|
|
491
|
+
const f_s = funString.replace(`.fun(this,event);`, '');
|
|
492
|
+
let function_ = eval(`${f_s.replace('editorEvent', 'clickMap')}.fun`);
|
|
493
|
+
setTimeout(() => {
|
|
494
|
+
try {
|
|
495
|
+
eval(`delete ${f_s.replace('editorEvent', 'clickMap')}`);
|
|
496
|
+
}
|
|
497
|
+
catch (e) {
|
|
498
|
+
}
|
|
499
|
+
}, 2000);
|
|
500
|
+
element.addEventListener(dd.key.substring(2), function (event) {
|
|
492
501
|
if ((glitter.htmlGenerate.isEditMode() || glitter.htmlGenerate.isIdeaMode()) && !glitter.share.EditorMode && (['htmlEditor', 'find_idea'].includes(glitter.getUrlParameter('type')))) {
|
|
493
502
|
if (funString.indexOf('editorEvent') !== -1) {
|
|
494
|
-
|
|
503
|
+
function_(this, event);
|
|
495
504
|
}
|
|
496
505
|
else if (dd.key !== 'onclick') {
|
|
497
|
-
|
|
506
|
+
function_(this, event);
|
|
498
507
|
}
|
|
499
508
|
}
|
|
500
509
|
else {
|
|
501
|
-
|
|
510
|
+
function_(this, event);
|
|
502
511
|
}
|
|
503
512
|
});
|
|
504
513
|
}
|
|
@@ -506,7 +515,7 @@ export class Glitter {
|
|
|
506
515
|
element.replaceAtMemory[dd.key] = true;
|
|
507
516
|
}
|
|
508
517
|
catch (e) {
|
|
509
|
-
console.log(
|
|
518
|
+
console.log(`this_var_not_exists=>`, dd.value);
|
|
510
519
|
glitter.deBugMessage(e);
|
|
511
520
|
}
|
|
512
521
|
}
|
|
@@ -1152,24 +1152,36 @@ ${(!error.message) ? `` : `錯誤訊息:${error.message}`}${(!error.lineNumber)
|
|
|
1152
1152
|
try {
|
|
1153
1153
|
const funString = `${dd.value}`;
|
|
1154
1154
|
if (!((element as any).replaceAtMemory[dd.key])) {
|
|
1155
|
-
|
|
1155
|
+
const f_s=funString.replace(`.fun(this,event);`,'')
|
|
1156
|
+
let function_=eval(`${f_s.replace('editorEvent', 'clickMap')}.fun`);
|
|
1157
|
+
setTimeout(()=>{
|
|
1158
|
+
try {
|
|
1159
|
+
//移除暫存方法避免洩漏和資安問題
|
|
1160
|
+
eval (`delete ${f_s.replace('editorEvent', 'clickMap')}`);
|
|
1161
|
+
}catch (e) {
|
|
1162
|
+
|
|
1163
|
+
}
|
|
1164
|
+
},2000)
|
|
1165
|
+
|
|
1166
|
+
element.addEventListener(dd.key.substring(2), function (event) {
|
|
1156
1167
|
if ((glitter.htmlGenerate.isEditMode() || glitter.htmlGenerate.isIdeaMode()) && !glitter.share.EditorMode && (['htmlEditor', 'find_idea'].includes(glitter.getUrlParameter('type')))) {
|
|
1157
1168
|
if (funString.indexOf('editorEvent') !== -1) {
|
|
1158
|
-
|
|
1169
|
+
function_(this,event)
|
|
1159
1170
|
} else if (dd.key !== 'onclick') {
|
|
1160
|
-
|
|
1171
|
+
function_(this,event)
|
|
1161
1172
|
}
|
|
1162
1173
|
} else {
|
|
1163
|
-
|
|
1174
|
+
function_(this,event)
|
|
1164
1175
|
}
|
|
1165
1176
|
})
|
|
1166
1177
|
}
|
|
1167
1178
|
element.removeAttribute(dd.key);
|
|
1168
1179
|
(element as any).replaceAtMemory[dd.key] = true
|
|
1169
1180
|
} catch (e) {
|
|
1170
|
-
console.log(
|
|
1181
|
+
console.log(`this_var_not_exists=>`,dd.value);
|
|
1171
1182
|
glitter.deBugMessage(e)
|
|
1172
1183
|
}
|
|
1184
|
+
|
|
1173
1185
|
} else {
|
|
1174
1186
|
try {
|
|
1175
1187
|
if (dd.value) {
|
|
@@ -2321,7 +2321,6 @@ ${obj.gvc.bindView(() => {
|
|
|
2321
2321
|
}
|
|
2322
2322
|
static checkBoxOnly(obj) {
|
|
2323
2323
|
return obj.gvc.bindView(() => {
|
|
2324
|
-
var _a;
|
|
2325
2324
|
const id = obj.gvc.glitter.getUUID();
|
|
2326
2325
|
return {
|
|
2327
2326
|
bind: id,
|
|
@@ -2329,23 +2328,26 @@ ${obj.gvc.bindView(() => {
|
|
|
2329
2328
|
return html `<i class="${obj.def ? `fa-solid fa-square-check` : `fa-regular fa-square`} "
|
|
2330
2329
|
style="color: #393939;"></i>`;
|
|
2331
2330
|
},
|
|
2332
|
-
divCreate: {
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2331
|
+
divCreate: () => {
|
|
2332
|
+
var _a;
|
|
2333
|
+
return {
|
|
2334
|
+
option: [
|
|
2335
|
+
{
|
|
2336
|
+
key: 'onclick',
|
|
2337
|
+
value: obj.gvc.event((e, event) => {
|
|
2338
|
+
const bool = !obj.def;
|
|
2339
|
+
if (!obj.stopChangeView) {
|
|
2340
|
+
obj.def = !obj.def;
|
|
2341
|
+
}
|
|
2342
|
+
obj.callback(bool);
|
|
2343
|
+
event.stopPropagation();
|
|
2344
|
+
obj.gvc.notifyDataChange(id);
|
|
2345
|
+
}),
|
|
2346
|
+
},
|
|
2347
|
+
],
|
|
2348
|
+
class: `d-flex align-items-center justify-content-center`,
|
|
2349
|
+
style: `height:20px;font-size:18px;cursor:pointer;${(_a = obj.style) !== null && _a !== void 0 ? _a : ''}`,
|
|
2350
|
+
};
|
|
2349
2351
|
},
|
|
2350
2352
|
};
|
|
2351
2353
|
});
|
|
@@ -2685,23 +2685,25 @@ ${obj.gvc.bindView(() => {
|
|
|
2685
2685
|
return html`<i class="${obj.def ? `fa-solid fa-square-check` : `fa-regular fa-square`} "
|
|
2686
2686
|
style="color: #393939;"></i>`;
|
|
2687
2687
|
},
|
|
2688
|
-
divCreate: {
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2688
|
+
divCreate: ()=>{
|
|
2689
|
+
return {
|
|
2690
|
+
option: [
|
|
2691
|
+
{
|
|
2692
|
+
key: 'onclick',
|
|
2693
|
+
value: obj.gvc.event((e, event) => {
|
|
2694
|
+
const bool = !obj.def;
|
|
2695
|
+
if (!obj.stopChangeView) {
|
|
2696
|
+
obj.def = !obj.def;
|
|
2697
|
+
}
|
|
2698
|
+
obj.callback(bool);
|
|
2699
|
+
event.stopPropagation();
|
|
2700
|
+
obj.gvc.notifyDataChange(id);
|
|
2701
|
+
}),
|
|
2702
|
+
},
|
|
2703
|
+
],
|
|
2704
|
+
class: `d-flex align-items-center justify-content-center`,
|
|
2705
|
+
style: `height:20px;font-size:18px;cursor:pointer;${obj.style ?? ''}`,
|
|
2706
|
+
}
|
|
2705
2707
|
},
|
|
2706
2708
|
};
|
|
2707
2709
|
});
|
|
@@ -90,7 +90,6 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
|
|
|
90
90
|
return {
|
|
91
91
|
onCreateView: () => {
|
|
92
92
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
93
|
-
console.log(`gBundle=>`, gBundle);
|
|
94
93
|
FirstBanner.main({ gvc: gvc });
|
|
95
94
|
if (gBundle.page_config.seo && (gBundle.page_config.seo.type === "custom") && gBundle.page_config.seo.title) {
|
|
96
95
|
glitter.setUrlParameter('', undefined, [
|
|
@@ -71,7 +71,6 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
|
|
|
71
71
|
}
|
|
72
72
|
return {
|
|
73
73
|
onCreateView: () => {
|
|
74
|
-
console.log(`gBundle=>`,gBundle)
|
|
75
74
|
FirstBanner.main({gvc:gvc})
|
|
76
75
|
//定義SEO TITLE
|
|
77
76
|
if(gBundle.page_config.seo && (gBundle.page_config.seo.type==="custom") && gBundle.page_config.seo.title){
|
|
@@ -72,7 +72,6 @@ export class FirstBanner {
|
|
|
72
72
|
return formData;
|
|
73
73
|
}
|
|
74
74
|
const formData = getFormData((widget.data.refer_app) ? (widget.data.refer_form_data || data.page_config.formData) : data.page_config.formData);
|
|
75
|
-
console.log(`formData====${formData.list.length}===`, formData);
|
|
76
75
|
if (formData.list && formData.list.length) {
|
|
77
76
|
obj.gvc.glitter.innerDialog((gvc) => {
|
|
78
77
|
return gvc.bindView(() => {
|
|
@@ -76,7 +76,6 @@ export class FirstBanner {
|
|
|
76
76
|
return formData;
|
|
77
77
|
}
|
|
78
78
|
const formData=getFormData((widget.data.refer_app) ? (widget.data.refer_form_data || data.page_config.formData) : data.page_config.formData);
|
|
79
|
-
console.log(`formData====${formData.list.length}===`,formData)
|
|
80
79
|
if(formData.list && formData.list.length){
|
|
81
80
|
obj.gvc.glitter.innerDialog((gvc) => {
|
|
82
81
|
return gvc.bindView(() => {
|
|
@@ -334,7 +334,6 @@ export class PdClass {
|
|
|
334
334
|
: obj.vm.specs.map((spec) => {
|
|
335
335
|
return spec.option[0].title;
|
|
336
336
|
});
|
|
337
|
-
console.log(`obj.vm.specs=>`, obj.vm.specs);
|
|
338
337
|
obj.prod.preview_image = obj.prod.preview_image.filter((dd) => {
|
|
339
338
|
return dd !== 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg';
|
|
340
339
|
});
|
|
@@ -454,7 +454,6 @@ export class PdClass {
|
|
|
454
454
|
: obj.vm.specs.map((spec: any) => {
|
|
455
455
|
return spec.option[0].title;
|
|
456
456
|
});
|
|
457
|
-
console.log(`obj.vm.specs=>`, obj.vm.specs)
|
|
458
457
|
obj.prod.preview_image = obj.prod.preview_image.filter((dd) => {
|
|
459
458
|
return dd !== 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg';
|
|
460
459
|
});
|