ts-glitter 17.0.7 → 17.1.0
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/form-view/editor/image-selector.js +23 -7
- package/lowcode/form-view/editor/image-selector.ts +28 -13
- package/lowcode/public-components/product/pd-class.js +4 -3
- package/lowcode/public-components/product/pd-class.ts +5 -3
- package/lowcode/public-components/product/product-detail.js +1 -1
- package/lowcode/public-components/product/product-detail.ts +1 -1
- package/package.json +1 -1
package/lowcode/Entry.js
CHANGED
|
@@ -88,7 +88,7 @@ export class Entry {
|
|
|
88
88
|
}
|
|
89
89
|
window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : clockF();
|
|
90
90
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
91
|
-
glitter.share.editerVersion = 'V_17.0
|
|
91
|
+
glitter.share.editerVersion = 'V_17.1.0';
|
|
92
92
|
glitter.share.start = new Date();
|
|
93
93
|
const vm = {
|
|
94
94
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -88,7 +88,7 @@ export class Entry {
|
|
|
88
88
|
}
|
|
89
89
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
90
90
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
91
|
-
glitter.share.editerVersion = 'V_17.0
|
|
91
|
+
glitter.share.editerVersion = 'V_17.1.0';
|
|
92
92
|
glitter.share.start = new Date();
|
|
93
93
|
const vm: {
|
|
94
94
|
appConfig: any;
|
|
@@ -24,12 +24,32 @@ export class ImageSelector {
|
|
|
24
24
|
widget.bundle.form_data[widget.bundle.form_key] = widget.bundle.form_data[widget.bundle.form_key].value;
|
|
25
25
|
}
|
|
26
26
|
const src = widget.bundle.form_data[widget.bundle.form_key];
|
|
27
|
+
function selectImage() {
|
|
28
|
+
imageLibrary.selectImageLibrary(gvc, (urlArray) => {
|
|
29
|
+
widget.bundle.form_data[widget.bundle.form_key] = urlArray[0].data;
|
|
30
|
+
widget.bundle.refresh && widget.bundle.refresh();
|
|
31
|
+
gvc.notifyDataChange(id);
|
|
32
|
+
}, html ` <div class="d-flex flex-column" style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">圖片庫</div>`, { mul: false });
|
|
33
|
+
}
|
|
27
34
|
return html `
|
|
28
|
-
<div class="fw-normal mt-2 fs-6">${widget.bundle.form_title}
|
|
35
|
+
<div class="fw-normal mt-2 fs-6 d-flex align-items-center" style="gap:8px;">${widget.bundle.form_title}
|
|
36
|
+
<button
|
|
37
|
+
class="btn-size-sm btn-gray "
|
|
38
|
+
style=""
|
|
39
|
+
type="button"
|
|
40
|
+
onclick="${gvc.event(() => {
|
|
41
|
+
selectImage();
|
|
42
|
+
})}"
|
|
43
|
+
>
|
|
44
|
+
<span class="tx_700" style="">替換</span>
|
|
45
|
+
</button>
|
|
46
|
+
</div>
|
|
29
47
|
<div
|
|
30
48
|
class="d-flex align-items-center justify-content-center rounded-3 shadow mt-2"
|
|
31
49
|
|
|
32
|
-
style="width:145px;height:145px;cursor:pointer;background:
|
|
50
|
+
style="width:145px;height:145px;cursor:pointer;background-color: lightgrey;
|
|
51
|
+
background-image: url('${src || BgWidget.noImageURL}');background-size: cover;background-repeat: no-repeat;background-position: center;
|
|
52
|
+
"
|
|
33
53
|
>
|
|
34
54
|
<div
|
|
35
55
|
class="w-100 h-100 d-flex align-items-center justify-content-center rounded-3 p-hover-image position-relative"
|
|
@@ -103,11 +123,7 @@ export class ImageSelector {
|
|
|
103
123
|
style=""
|
|
104
124
|
type="button"
|
|
105
125
|
onclick="${gvc.event(() => {
|
|
106
|
-
|
|
107
|
-
widget.bundle.form_data[widget.bundle.form_key] = urlArray[0].data;
|
|
108
|
-
widget.bundle.refresh && widget.bundle.refresh();
|
|
109
|
-
gvc.notifyDataChange(id);
|
|
110
|
-
}, html ` <div class="d-flex flex-column" style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">圖片庫</div>`, { mul: false });
|
|
126
|
+
selectImage();
|
|
111
127
|
})}"
|
|
112
128
|
>
|
|
113
129
|
<span class="tx_700" style="">選擇圖片</span>
|
|
@@ -18,13 +18,37 @@ export class ImageSelector {
|
|
|
18
18
|
widget.bundle.form_data[widget.bundle.form_key]=widget.bundle.form_data[widget.bundle.form_key].value
|
|
19
19
|
}
|
|
20
20
|
const src = widget.bundle.form_data[widget.bundle.form_key];
|
|
21
|
-
|
|
21
|
+
function selectImage(){
|
|
22
|
+
imageLibrary.selectImageLibrary(
|
|
23
|
+
gvc,
|
|
24
|
+
(urlArray) => {
|
|
25
|
+
widget.bundle.form_data[widget.bundle.form_key]=urlArray[0].data;
|
|
26
|
+
widget.bundle.refresh && widget.bundle.refresh();
|
|
27
|
+
gvc.notifyDataChange(id)
|
|
28
|
+
},
|
|
29
|
+
html` <div class="d-flex flex-column" style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">圖片庫</div>`,
|
|
30
|
+
{ mul: false }
|
|
31
|
+
)
|
|
32
|
+
}
|
|
22
33
|
return html`
|
|
23
|
-
<div class="fw-normal mt-2 fs-6">${widget.bundle.form_title}
|
|
34
|
+
<div class="fw-normal mt-2 fs-6 d-flex align-items-center" style="gap:8px;">${widget.bundle.form_title}
|
|
35
|
+
<button
|
|
36
|
+
class="btn-size-sm btn-gray "
|
|
37
|
+
style=""
|
|
38
|
+
type="button"
|
|
39
|
+
onclick="${gvc.event(() => {
|
|
40
|
+
selectImage()
|
|
41
|
+
})}"
|
|
42
|
+
>
|
|
43
|
+
<span class="tx_700" style="">替換</span>
|
|
44
|
+
</button>
|
|
45
|
+
</div>
|
|
24
46
|
<div
|
|
25
47
|
class="d-flex align-items-center justify-content-center rounded-3 shadow mt-2"
|
|
26
48
|
|
|
27
|
-
style="width:145px;height:145px;cursor:pointer;background:
|
|
49
|
+
style="width:145px;height:145px;cursor:pointer;background-color: lightgrey;
|
|
50
|
+
background-image: url('${src || BgWidget.noImageURL}');background-size: cover;background-repeat: no-repeat;background-position: center;
|
|
51
|
+
"
|
|
28
52
|
>
|
|
29
53
|
<div
|
|
30
54
|
class="w-100 h-100 d-flex align-items-center justify-content-center rounded-3 p-hover-image position-relative"
|
|
@@ -103,16 +127,7 @@ export class ImageSelector {
|
|
|
103
127
|
style=""
|
|
104
128
|
type="button"
|
|
105
129
|
onclick="${gvc.event(() => {
|
|
106
|
-
|
|
107
|
-
gvc,
|
|
108
|
-
(urlArray) => {
|
|
109
|
-
widget.bundle.form_data[widget.bundle.form_key]=urlArray[0].data;
|
|
110
|
-
widget.bundle.refresh && widget.bundle.refresh();
|
|
111
|
-
gvc.notifyDataChange(id)
|
|
112
|
-
},
|
|
113
|
-
html` <div class="d-flex flex-column" style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">圖片庫</div>`,
|
|
114
|
-
{ mul: false }
|
|
115
|
-
)
|
|
130
|
+
selectImage()
|
|
116
131
|
})}"
|
|
117
132
|
>
|
|
118
133
|
<span class="tx_700" style="">選擇圖片</span>
|
|
@@ -254,11 +254,12 @@ export class PdClass {
|
|
|
254
254
|
static showSwiper(obj) {
|
|
255
255
|
const css = String.raw;
|
|
256
256
|
const isPhone = document.body.clientWidth < 768;
|
|
257
|
-
obj.gvc.glitter.addStyleLink(['https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css'
|
|
258
|
-
|
|
257
|
+
obj.gvc.glitter.addStyleLink(['https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css',
|
|
258
|
+
`https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css`]);
|
|
259
|
+
obj.gvc.glitter.addMtScript([{ src: `https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js` },
|
|
260
|
+
{ src: `https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js` }], () => {
|
|
259
261
|
}, () => {
|
|
260
262
|
});
|
|
261
|
-
console.log(`obj.prod.preview_image=>`, JSON.stringify(obj.prod.preview_image));
|
|
262
263
|
obj.prod.variants.forEach((variant) => {
|
|
263
264
|
variant.preview_image = variant[`preview_image_${Language.getLanguage()}`] || variant.preview_image;
|
|
264
265
|
if (variant.preview_image && !obj.prod.preview_image.includes(variant.preview_image)) {
|
|
@@ -369,15 +369,17 @@ export class PdClass {
|
|
|
369
369
|
static showSwiper(obj: { gvc: GVC; prod: Product; vm: any; class?: string }) {
|
|
370
370
|
const css = String.raw;
|
|
371
371
|
const isPhone = document.body.clientWidth < 768;
|
|
372
|
-
obj.gvc.glitter.addStyleLink(['https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css'
|
|
372
|
+
obj.gvc.glitter.addStyleLink(['https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css',
|
|
373
|
+
`https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css`]);
|
|
373
374
|
obj.gvc.glitter.addMtScript(
|
|
374
|
-
[{src: `https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js`},
|
|
375
|
+
[{src: `https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js`},
|
|
376
|
+
{src: `https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js`}],
|
|
375
377
|
() => {
|
|
376
378
|
},
|
|
377
379
|
() => {
|
|
378
380
|
}
|
|
379
381
|
);
|
|
380
|
-
|
|
382
|
+
|
|
381
383
|
obj.prod.variants.forEach((variant) => {
|
|
382
384
|
variant.preview_image=(variant as any)[`preview_image_${Language.getLanguage()}`] || variant.preview_image;
|
|
383
385
|
if (variant.preview_image && !obj.prod.preview_image.includes(variant.preview_image)) {
|