ts-glitter 21.4.4 → 21.4.6
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 +18 -18
- package/lowcode/Entry.ts +18 -19
- package/lowcode/backend-manager/bg-product.js +8 -6
- package/lowcode/backend-manager/bg-product.ts +17 -15
- package/lowcode/backend-manager/bg-recommend.js +16 -5
- package/lowcode/backend-manager/bg-recommend.ts +15 -5
- package/lowcode/backend-manager/bg-widget.js +160 -160
- package/lowcode/backend-manager/bg-widget.ts +169 -166
- package/lowcode/cms-plugin/POS-setting.js +75 -23
- package/lowcode/cms-plugin/POS-setting.ts +87 -30
- package/lowcode/cms-plugin/menus-setting.js +165 -37
- package/lowcode/cms-plugin/menus-setting.ts +144 -21
- package/lowcode/cms-plugin/module/order-excel.js +8 -8
- package/lowcode/cms-plugin/module/order-excel.ts +10 -10
- package/lowcode/cms-plugin/module/stock-excel.js +184 -0
- package/lowcode/cms-plugin/module/stock-excel.ts +205 -0
- package/lowcode/cms-plugin/module/vendor-excel.js +375 -0
- package/lowcode/cms-plugin/module/vendor-excel.ts +450 -0
- package/lowcode/cms-plugin/order/order-module.js +6 -4
- package/lowcode/cms-plugin/order/order-module.ts +16 -14
- package/lowcode/cms-plugin/pos-pages/models.ts +6 -2
- package/lowcode/cms-plugin/pos-pages/products-page.js +589 -469
- package/lowcode/cms-plugin/pos-pages/products-page.ts +657 -491
- package/lowcode/cms-plugin/shopping-product-setting.js +7 -10
- package/lowcode/cms-plugin/shopping-product-setting.ts +12 -10
- package/lowcode/cms-plugin/shopping-setting-basic.js +2 -5
- package/lowcode/cms-plugin/shopping-setting-basic.ts +2 -5
- package/lowcode/cms-plugin/stock-history.js +39 -26
- package/lowcode/cms-plugin/stock-history.ts +58 -49
- package/lowcode/cms-plugin/stock-vendors.js +18 -13
- package/lowcode/cms-plugin/stock-vendors.ts +31 -16
- package/lowcode/glitterBundle/html-component/global-widget.js +162 -136
- package/lowcode/glitterBundle/html-component/global-widget.ts +430 -382
- package/lowcode/public-components/blogs/blogs-01.js +22 -9
- package/lowcode/public-components/blogs/blogs-01.ts +28 -14
- package/package.json +1 -1
- package/src/api-public/services/schedule.js +6 -1
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/schedule.ts +4 -1
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { Storage } from
|
|
10
|
+
import { Storage } from '../helper/storage.js';
|
|
11
11
|
import { ApiPageConfig } from '../../api/pageConfig.js';
|
|
12
12
|
var ViewType;
|
|
13
13
|
(function (ViewType) {
|
|
@@ -17,10 +17,10 @@ var ViewType;
|
|
|
17
17
|
})(ViewType || (ViewType = {}));
|
|
18
18
|
const html = String.raw;
|
|
19
19
|
export class GlobalWidget {
|
|
20
|
-
constructor() {
|
|
21
|
-
}
|
|
20
|
+
constructor() { }
|
|
22
21
|
static showCaseBar(gvc, widget, refresh) {
|
|
23
|
-
if (['mobile', 'desktop'].includes(gvc.glitter.getCookieByName('ViewType')) &&
|
|
22
|
+
if (['mobile', 'desktop'].includes(gvc.glitter.getCookieByName('ViewType')) &&
|
|
23
|
+
GlobalWidget.glitter_view_type !== 'def') {
|
|
24
24
|
GlobalWidget.glitter_view_type = gvc.glitter.getCookieByName('ViewType');
|
|
25
25
|
}
|
|
26
26
|
return gvc.bindView(() => {
|
|
@@ -30,37 +30,40 @@ export class GlobalWidget {
|
|
|
30
30
|
view: () => {
|
|
31
31
|
var _a;
|
|
32
32
|
GlobalWidget.glitter_view_type = (_a = GlobalWidget.glitter_view_type) !== null && _a !== void 0 ? _a : 'def';
|
|
33
|
-
return html `
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
return html ` <h3 class="my-auto tx_title me-2 ms-2 " style="white-space: nowrap;font-size: 16px;">
|
|
34
|
+
元件顯示樣式
|
|
35
|
+
</h3>
|
|
36
|
+
<div
|
|
37
|
+
style="background:#f1f1f1;border-radius:10px;"
|
|
38
|
+
class="d-flex align-items-center justify-content-center p-1 "
|
|
39
|
+
>
|
|
40
|
+
${[
|
|
39
41
|
{
|
|
40
42
|
icon: 'fa-regular fa-border-all guide-user-editor-5-back',
|
|
41
43
|
type: 'def',
|
|
42
|
-
title: '預設樣式'
|
|
44
|
+
title: '預設樣式',
|
|
43
45
|
},
|
|
44
|
-
{ icon: 'fa-regular fa-desktop', type:
|
|
45
|
-
{ icon: 'fa-regular fa-mobile guide-user-editor-5', type:
|
|
46
|
-
]
|
|
46
|
+
{ icon: 'fa-regular fa-desktop', type: 'desktop', title: '電腦版' },
|
|
47
|
+
{ icon: 'fa-regular fa-mobile guide-user-editor-5', type: 'mobile', title: '手機版' },
|
|
48
|
+
]
|
|
49
|
+
.map(dd => {
|
|
47
50
|
if (dd.type === GlobalWidget.glitter_view_type) {
|
|
48
|
-
return html `
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
return html ` <div
|
|
52
|
+
class="d-flex align-items-center justify-content-center bg-white"
|
|
53
|
+
style="height:36px;width:36px;border-radius:10px;cursor:pointer;color:#151515;"
|
|
54
|
+
data-bs-toggle="tooltip"
|
|
55
|
+
data-bs-placement="top"
|
|
56
|
+
data-bs-custom-class="custom-tooltip"
|
|
57
|
+
data-bs-title="${dd.title}"
|
|
58
|
+
>
|
|
59
|
+
<i class="${dd.icon}"></i>
|
|
60
|
+
</div>`;
|
|
57
61
|
}
|
|
58
62
|
else {
|
|
59
|
-
return html `
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
onclick="${gvc.event(() => {
|
|
63
|
+
return html ` <div
|
|
64
|
+
class="d-flex align-items-center justify-content-center"
|
|
65
|
+
style="height:36px;width:36px;border-radius:10px;cursor:pointer;color:#151515;"
|
|
66
|
+
onclick="${gvc.event(() => {
|
|
64
67
|
GlobalWidget.glitter_view_type = dd.type;
|
|
65
68
|
if (dd.type !== 'def') {
|
|
66
69
|
Storage.view_type = dd.type;
|
|
@@ -71,34 +74,35 @@ export class GlobalWidget {
|
|
|
71
74
|
refresh(dd.type);
|
|
72
75
|
gvc.glitter.share.loading_dialog.dataLoading({
|
|
73
76
|
text: '模組加載中...',
|
|
74
|
-
visible: true
|
|
77
|
+
visible: true,
|
|
75
78
|
});
|
|
76
79
|
gvc.notifyDataChange(['docs-container', id]);
|
|
77
80
|
})}"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
data-bs-toggle="tooltip"
|
|
82
|
+
data-bs-placement="top"
|
|
83
|
+
data-bs-custom-class="custom-tooltip"
|
|
84
|
+
data-bs-title="${dd.title}"
|
|
85
|
+
>
|
|
86
|
+
<i class="${dd.icon}"></i>
|
|
87
|
+
</div>`;
|
|
84
88
|
}
|
|
85
89
|
})
|
|
86
90
|
.join('')}
|
|
87
|
-
|
|
91
|
+
</div>`;
|
|
88
92
|
},
|
|
89
93
|
divCreate: {
|
|
90
|
-
class: `${
|
|
91
|
-
style:
|
|
94
|
+
class: `${gvc.glitter.getUrlParameter('device') === 'mobile' ? `d-none ` : `d-flex`} align-items-center border-bottom mx-n2 mt-n2 p-2 guide-user-editor-4`,
|
|
95
|
+
style: ``,
|
|
92
96
|
},
|
|
93
97
|
onCreate: () => {
|
|
94
98
|
$('.tooltip').remove();
|
|
95
99
|
$('[data-bs-toggle="tooltip"]').tooltip();
|
|
96
|
-
}
|
|
100
|
+
},
|
|
97
101
|
};
|
|
98
102
|
});
|
|
99
103
|
}
|
|
100
104
|
static initialShowCaseData(obj) {
|
|
101
|
-
['mobile', 'desktop'].map(
|
|
105
|
+
['mobile', 'desktop'].map(d2 => {
|
|
102
106
|
var _a, _b, _c;
|
|
103
107
|
obj.widget[d2] = (_a = obj.widget[d2]) !== null && _a !== void 0 ? _a : { refer: 'def' };
|
|
104
108
|
if (obj.widget[d2].refer === 'custom') {
|
|
@@ -115,35 +119,39 @@ export class GlobalWidget {
|
|
|
115
119
|
delete obj.widget[d2].storage;
|
|
116
120
|
delete obj.widget[d2].share;
|
|
117
121
|
delete obj.widget[d2].bundle;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
122
|
+
!obj.widget[d2].formData &&
|
|
123
|
+
Object.defineProperty(obj.widget[d2], 'formData', {
|
|
124
|
+
get: function () {
|
|
125
|
+
return obj.widget.formData;
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
!obj.widget[d2].storage &&
|
|
129
|
+
Object.defineProperty(obj.widget[d2], 'storage', {
|
|
130
|
+
get: function () {
|
|
131
|
+
return obj.widget.storage;
|
|
132
|
+
},
|
|
133
|
+
set(v) {
|
|
134
|
+
obj.widget.storage = v;
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
!obj.widget[d2].share &&
|
|
138
|
+
Object.defineProperty(obj.widget[d2], 'share', {
|
|
139
|
+
get: function () {
|
|
140
|
+
return obj.widget.share;
|
|
141
|
+
},
|
|
142
|
+
set(v) {
|
|
143
|
+
obj.widget.share = v;
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
!obj.widget[d2].bundle &&
|
|
147
|
+
Object.defineProperty(obj.widget[d2], 'bundle', {
|
|
148
|
+
get: function () {
|
|
149
|
+
return obj.widget.bundle;
|
|
150
|
+
},
|
|
151
|
+
set(v) {
|
|
152
|
+
obj.widget.bundle = v;
|
|
153
|
+
},
|
|
154
|
+
});
|
|
147
155
|
obj.widget[d2].editorEvent = obj.widget.editorEvent;
|
|
148
156
|
obj.widget[d2].global = (_c = obj.widget.global) !== null && _c !== void 0 ? _c : [];
|
|
149
157
|
obj.widget[d2].global.gvc = obj.gvc;
|
|
@@ -161,6 +169,13 @@ export class GlobalWidget {
|
|
|
161
169
|
}
|
|
162
170
|
});
|
|
163
171
|
}
|
|
172
|
+
static grayButton(text, event, obj) {
|
|
173
|
+
var _a;
|
|
174
|
+
return html ` <button class="btn btn-gray ${(obj === null || obj === void 0 ? void 0 : obj.class) || ''}" type="button" onclick="${event}">
|
|
175
|
+
<i class="${obj && obj.icon && obj.icon.length > 0 ? obj.icon : 'd-none'}" style="color: #393939"></i>
|
|
176
|
+
${text.length > 0 ? html `<span class="tx_700" style="${(_a = obj === null || obj === void 0 ? void 0 : obj.textStyle) !== null && _a !== void 0 ? _a : ''}">${text}</span>` : ''}
|
|
177
|
+
</button>`;
|
|
178
|
+
}
|
|
164
179
|
static select(obj) {
|
|
165
180
|
var _a;
|
|
166
181
|
return html ` ${obj.title ? html ` <div class="tx_normal fw-normal mb-2">${obj.title}</div>` : ``}
|
|
@@ -183,18 +198,17 @@ export class GlobalWidget {
|
|
|
183
198
|
</select>`;
|
|
184
199
|
}
|
|
185
200
|
static switchButton(gvc, def, callback) {
|
|
186
|
-
return html `
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
onchange="${gvc.event((e) => {
|
|
201
|
+
return html ` <div class="form-check form-switch d-flex align-items-center my-0" style=" cursor: pointer;">
|
|
202
|
+
<input
|
|
203
|
+
class="form-check-input"
|
|
204
|
+
type="checkbox"
|
|
205
|
+
onchange="${gvc.event(e => {
|
|
192
206
|
callback(e.checked);
|
|
193
207
|
})}"
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
208
|
+
style="height:17px;width:30px;"
|
|
209
|
+
${def ? `checked` : ``}
|
|
210
|
+
/>
|
|
211
|
+
</div>`;
|
|
198
212
|
}
|
|
199
213
|
static showCaseEditor(obj) {
|
|
200
214
|
const outer_id = obj.gvc.glitter.getUUID();
|
|
@@ -207,11 +221,11 @@ export class GlobalWidget {
|
|
|
207
221
|
return ``;
|
|
208
222
|
},
|
|
209
223
|
divCreate: {
|
|
210
|
-
class: `${outer_id}
|
|
224
|
+
class: `${outer_id}`,
|
|
211
225
|
},
|
|
212
226
|
onCreate: () => __awaiter(this, void 0, void 0, function* () {
|
|
213
227
|
let civ = [];
|
|
214
|
-
const is_sub_page = ['pages/', 'hidden/', 'shop/'].find(
|
|
228
|
+
const is_sub_page = ['pages/', 'hidden/', 'shop/'].find(dd => {
|
|
215
229
|
return (obj.gvc.glitter.getUrlParameter('page') || '').startsWith(dd);
|
|
216
230
|
});
|
|
217
231
|
if (!glitter.share.c_header_list) {
|
|
@@ -223,12 +237,12 @@ export class GlobalWidget {
|
|
|
223
237
|
tag: '標頭元件',
|
|
224
238
|
})).response.result.data;
|
|
225
239
|
}
|
|
226
|
-
if (is_sub_page &&
|
|
227
|
-
|
|
228
|
-
|
|
240
|
+
if (is_sub_page &&
|
|
241
|
+
glitter.share.c_header_list.find((d1) => {
|
|
242
|
+
return d1.tag === obj.widget.data.tag && d1.appName === obj.widget.data.refer_app;
|
|
243
|
+
})) {
|
|
229
244
|
glitter.share.header_refer = glitter.share.header_refer || 'def';
|
|
230
|
-
civ.push(`<div class="mt-2 fs-6 mb-2" style="color: black;margin-bottom: 5px;"
|
|
231
|
-
>標頭樣式參照</div>`);
|
|
245
|
+
civ.push(`<div class="mt-2 fs-6 mb-2" style="color: black;margin-bottom: 5px;" >標頭樣式參照</div>`);
|
|
232
246
|
civ.push(GlobalWidget.select({
|
|
233
247
|
gvc: gvc,
|
|
234
248
|
callback: (text) => {
|
|
@@ -251,16 +265,20 @@ export class GlobalWidget {
|
|
|
251
265
|
window.parent.document.querySelector('.' + outer_id).outerHTML = civ.join('');
|
|
252
266
|
return;
|
|
253
267
|
}
|
|
268
|
+
else {
|
|
269
|
+
}
|
|
270
|
+
civ.push(`<div class="mx-n2 border-top my-2"></div>`);
|
|
254
271
|
}
|
|
255
272
|
civ.push((() => {
|
|
256
273
|
GlobalWidget.glitter_view_type = ViewType.desktop;
|
|
257
274
|
if (Storage.view_type === 'mobile') {
|
|
258
275
|
GlobalWidget.glitter_view_type = ViewType.mobile;
|
|
259
276
|
}
|
|
260
|
-
if (['mobile', 'desktop'].includes(obj.gvc.glitter.getCookieByName('ViewType')) &&
|
|
277
|
+
if (['mobile', 'desktop'].includes(obj.gvc.glitter.getCookieByName('ViewType')) &&
|
|
278
|
+
GlobalWidget.glitter_view_type !== 'def') {
|
|
261
279
|
GlobalWidget.glitter_view_type = obj.gvc.glitter.getCookieByName('ViewType');
|
|
262
280
|
}
|
|
263
|
-
if (
|
|
281
|
+
if (GlobalWidget.glitter_view_type === 'def' || obj.gvc.glitter.getUrlParameter('device') === 'mobile') {
|
|
264
282
|
return obj.view(obj.widget, 'def');
|
|
265
283
|
}
|
|
266
284
|
else {
|
|
@@ -279,34 +297,35 @@ export class GlobalWidget {
|
|
|
279
297
|
{
|
|
280
298
|
key: 'form_editor',
|
|
281
299
|
label: `元件設計`,
|
|
282
|
-
icon: `fa-regular fa-pencil
|
|
300
|
+
icon: `fa-regular fa-pencil`,
|
|
283
301
|
},
|
|
284
302
|
{
|
|
285
303
|
key: 'ai_editor',
|
|
286
304
|
label: 'AI 設計',
|
|
287
|
-
icon: `fa-regular fa-wand-magic-sparkles
|
|
288
|
-
}
|
|
305
|
+
icon: `fa-regular fa-wand-magic-sparkles`,
|
|
306
|
+
},
|
|
289
307
|
];
|
|
290
308
|
return list
|
|
291
|
-
.map(
|
|
309
|
+
.map(dd => {
|
|
292
310
|
if (select_bt === dd.key) {
|
|
293
|
-
return html `
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
311
|
+
return html ` <div
|
|
312
|
+
class="d-flex align-items-center justify-content-center fw-bold px-2 py-2 fw-500 select-label-ai-message_ fs-6"
|
|
313
|
+
style="gap:5px;"
|
|
314
|
+
>
|
|
315
|
+
<i class="${dd.icon} "></i>${dd.label}
|
|
316
|
+
</div>`;
|
|
298
317
|
}
|
|
299
318
|
else {
|
|
300
|
-
return html `
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
319
|
+
return html ` <div
|
|
320
|
+
class="d-flex align-items-center justify-content-center fw-bold px-2 py-2 fw-500 select-btn-ai-message_ fs-6"
|
|
321
|
+
style="gap:5px;"
|
|
322
|
+
onclick="${gvc.event(() => {
|
|
304
323
|
select_bt = dd.key;
|
|
305
324
|
gvc.notifyDataChange(id);
|
|
306
325
|
})}"
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
326
|
+
>
|
|
327
|
+
<i class="${dd.icon}"></i>${dd.label}
|
|
328
|
+
</div>`;
|
|
310
329
|
}
|
|
311
330
|
})
|
|
312
331
|
.join(`<div class="border-end" style="width:1px;height:39px;"></div>`);
|
|
@@ -317,9 +336,8 @@ export class GlobalWidget {
|
|
|
317
336
|
if (obj.hide_selector) {
|
|
318
337
|
return ``;
|
|
319
338
|
}
|
|
320
|
-
return html `
|
|
321
|
-
|
|
322
|
-
style="">${[
|
|
339
|
+
return html ` <div class=" mx-n2" style="">
|
|
340
|
+
${[
|
|
323
341
|
...(() => {
|
|
324
342
|
if (obj.hide_ai) {
|
|
325
343
|
return [];
|
|
@@ -333,18 +351,20 @@ export class GlobalWidget {
|
|
|
333
351
|
return {
|
|
334
352
|
bind: id,
|
|
335
353
|
view: () => {
|
|
336
|
-
return html `
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
354
|
+
return html ` <div
|
|
355
|
+
class="my-auto tx_title fw-normal d-flex align-items-center"
|
|
356
|
+
style="white-space: nowrap;font-size: 16px;"
|
|
357
|
+
>
|
|
358
|
+
在${(() => {
|
|
359
|
+
if (GlobalWidget.glitter_view_type === 'mobile') {
|
|
340
360
|
return `手機`;
|
|
341
361
|
}
|
|
342
362
|
else {
|
|
343
363
|
return `電腦`;
|
|
344
364
|
}
|
|
345
|
-
})()}版上${
|
|
346
|
-
|
|
347
|
-
|
|
365
|
+
})()}版上${obj.widget[key].refer === 'hide' ? `不` : ``}顯示
|
|
366
|
+
</div>
|
|
367
|
+
${GlobalWidget.switchButton(obj.gvc, obj.widget[key].refer !== 'hide', bool => {
|
|
348
368
|
if (bool) {
|
|
349
369
|
obj.widget[key].refer = 'def';
|
|
350
370
|
}
|
|
@@ -360,11 +380,12 @@ export class GlobalWidget {
|
|
|
360
380
|
},
|
|
361
381
|
divCreate: {
|
|
362
382
|
class: `d-flex align-content-center px-3`,
|
|
363
|
-
style: `gap:10px;margin-bottom:18px;margin-top:13px
|
|
364
|
-
}
|
|
383
|
+
style: `gap:10px;margin-bottom:18px;margin-top:13px;`,
|
|
384
|
+
},
|
|
365
385
|
};
|
|
366
|
-
})
|
|
367
|
-
]
|
|
386
|
+
}),
|
|
387
|
+
]
|
|
388
|
+
.concat((() => {
|
|
368
389
|
if (obj.widget[key].refer === 'hide') {
|
|
369
390
|
return [];
|
|
370
391
|
}
|
|
@@ -373,14 +394,15 @@ export class GlobalWidget {
|
|
|
373
394
|
return [];
|
|
374
395
|
}
|
|
375
396
|
else {
|
|
376
|
-
return [
|
|
397
|
+
return [
|
|
398
|
+
obj.gvc.bindView(() => {
|
|
377
399
|
const id = gvc.glitter.getUUID();
|
|
378
400
|
return {
|
|
379
401
|
bind: id,
|
|
380
402
|
view: () => {
|
|
381
403
|
return `<div class="my-auto tx_title fw-normal d-flex align-items-center" style="white-space: nowrap;font-size: 16px;">顯示獨立樣式</div>
|
|
382
|
-
${GlobalWidget.switchButton(obj.gvc, obj.widget[key].refer === 'custom',
|
|
383
|
-
obj.widget[key].refer =
|
|
404
|
+
${GlobalWidget.switchButton(obj.gvc, obj.widget[key].refer === 'custom', bool => {
|
|
405
|
+
obj.widget[key].refer = bool ? `custom` : `def`;
|
|
384
406
|
if (obj.widget.refreshComponent) {
|
|
385
407
|
obj.widget.refreshComponent();
|
|
386
408
|
}
|
|
@@ -391,21 +413,25 @@ ${GlobalWidget.switchButton(obj.gvc, obj.widget[key].refer === 'custom', (bool)
|
|
|
391
413
|
},
|
|
392
414
|
divCreate: {
|
|
393
415
|
class: `d-flex align-content-center px-3`,
|
|
394
|
-
style: `gap:10px;margin-top:13px
|
|
395
|
-
}
|
|
416
|
+
style: `gap:10px;margin-top:13px;`,
|
|
417
|
+
},
|
|
396
418
|
};
|
|
397
|
-
}) +
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
419
|
+
}) +
|
|
420
|
+
`<div class="px-3 pt-2" style="white-space: normal;word-break: break-all;color: #8D8D8D; font-size: 14px; font-weight: 400; ">透過設定獨立樣式在${(() => {
|
|
421
|
+
if (GlobalWidget.glitter_view_type === 'mobile') {
|
|
422
|
+
return `手機`;
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
return `電腦`;
|
|
426
|
+
}
|
|
427
|
+
})()}版上顯示特定設計效果</div>`,
|
|
428
|
+
`<div class="mx-n3" style="background: #DDD;height: 1px;"></div>`,
|
|
429
|
+
].join(`<div style="height:18px;"></div>`);
|
|
405
430
|
}
|
|
406
431
|
}
|
|
407
|
-
})())
|
|
408
|
-
|
|
432
|
+
})())
|
|
433
|
+
.join('<div class="my-3"></div>')}
|
|
434
|
+
</div>`;
|
|
409
435
|
}
|
|
410
436
|
return obj.gvc.bindView(() => {
|
|
411
437
|
return {
|
|
@@ -413,7 +439,7 @@ ${GlobalWidget.switchButton(obj.gvc, obj.widget[key].refer === 'custom', (bool)
|
|
|
413
439
|
view: () => {
|
|
414
440
|
if (select_bt === 'ai_editor') {
|
|
415
441
|
return new Promise((resolve, reject) => {
|
|
416
|
-
gvc.glitter.getModule(gvc.glitter.root_path + 'cms-plugin/ai-generator/editor-ai.js',
|
|
442
|
+
gvc.glitter.getModule(gvc.glitter.root_path + 'cms-plugin/ai-generator/editor-ai.js', EditorAi => {
|
|
417
443
|
resolve([`<div class="mx-n2">${ai_switch()}</div>`, EditorAi.view(gvc)].join(''));
|
|
418
444
|
});
|
|
419
445
|
});
|
|
@@ -450,13 +476,13 @@ ${GlobalWidget.switchButton(obj.gvc, obj.widget[key].refer === 'custom', (bool)
|
|
|
450
476
|
}
|
|
451
477
|
})();
|
|
452
478
|
return [view].join('');
|
|
453
|
-
}
|
|
479
|
+
},
|
|
454
480
|
};
|
|
455
481
|
});
|
|
456
482
|
}
|
|
457
483
|
})());
|
|
458
484
|
window.parent.document.querySelector('.' + outer_id).outerHTML = civ.join('');
|
|
459
|
-
})
|
|
485
|
+
}),
|
|
460
486
|
};
|
|
461
487
|
});
|
|
462
488
|
}
|