ts-glitter 13.7.9 → 13.8.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/backend-manager/bg-customer-message.js +15 -12
- package/lowcode/backend-manager/bg-customer-message.ts +16 -13
- package/lowcode/backend-manager/bg-guide.js +4 -4
- package/lowcode/backend-manager/bg-guide.ts +4 -4
- package/lowcode/backend-manager/bg-shopping.js +4 -4
- package/lowcode/backend-manager/bg-shopping.ts +4 -4
- package/lowcode/backend-manager/bg-sns.js +18 -3
- package/lowcode/backend-manager/bg-sns.ts +19 -3
- package/lowcode/backend-manager/bg-widget.js +88 -10
- package/lowcode/backend-manager/bg-widget.ts +88 -16
- package/lowcode/cms-plugin/customer-message-user.js +1 -1
- package/lowcode/cms-plugin/customer-message-user.ts +1 -1
- package/lowcode/cms-plugin/line-auto-reply.js +2 -2
- package/lowcode/cms-plugin/line-auto-reply.ts +2 -2
- package/lowcode/cms-plugin/module/form-module.js +71 -60
- package/lowcode/cms-plugin/module/form-module.ts +315 -301
- package/lowcode/cms-plugin/shopping-finance-setting.js +16 -3
- package/lowcode/cms-plugin/shopping-finance-setting.ts +16 -3
- package/lowcode/cms-plugin/shopping-product-setting.js +150 -24
- package/lowcode/cms-plugin/shopping-product-setting.ts +181 -22
- package/lowcode/cms-plugin/shopping-product-text.js +254 -37
- package/lowcode/cms-plugin/shopping-product-text.ts +275 -30
- package/lowcode/cms-plugin/sns-auto-reply.js +19 -1
- package/lowcode/cms-plugin/sns-auto-reply.ts +19 -1
- package/lowcode/css/editor.css +9 -4
- package/lowcode/editor/add-component.js +290 -98
- package/lowcode/editor/add-component.ts +992 -787
- package/lowcode/editor/basic-component.js +1 -1
- package/lowcode/editor/basic-component.ts +1 -1
- package/lowcode/glitter-base/route/ai-chat.js +12 -0
- package/lowcode/glitter-base/route/ai-chat.ts +14 -1
- package/lowcode/glitterBundle/html-component/custom-style.js +4 -4
- package/lowcode/glitterBundle/html-component/custom-style.ts +4 -4
- package/lowcode/glitterBundle/plugins/editor-elem.js +616 -742
- package/lowcode/glitterBundle/plugins/editor-elem.ts +1297 -1542
- package/lowcode/jspage/editor.js +2 -1
- package/lowcode/jspage/editor.ts +2 -1
- package/lowcode/jspage/function-page/main_editor.js +19 -6
- package/lowcode/jspage/function-page/main_editor.ts +34 -20
- package/lowcode/jspage/main.js +134 -9
- package/lowcode/jspage/main.ts +142 -9
- package/lowcode/modules/tool.js +13 -0
- package/lowcode/modules/tool.ts +17 -0
- package/lowcode/official_event/page/change-page.ts +1 -0
- package/lowcode/public-components/headers/sy-02.js +13 -10
- package/lowcode/public-components/headers/sy-02.ts +12 -9
- package/package.json +2 -2
- package/src/api-public/controllers/ai-chat.js +12 -0
- package/src/api-public/controllers/ai-chat.js.map +1 -1
- package/src/api-public/controllers/ai-chat.ts +13 -0
- package/src/api-public/controllers/app-release.js.map +1 -1
- package/src/api-public/controllers/article.js.map +1 -1
- package/src/api-public/controllers/fb-message.js.map +1 -1
- package/src/api-public/controllers/line-message.js.map +1 -1
- package/src/api-public/controllers/post.js.map +1 -1
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/services/ai-robot.d.ts +7 -0
- package/src/api-public/services/ai-robot.js +83 -0
- package/src/api-public/services/ai-robot.js.map +1 -1
- package/src/api-public/services/ai-robot.ts +80 -0
- package/src/api-public/services/line-message.js.map +1 -1
- package/src/api-public/services/notify.js.map +1 -1
- package/src/api-public/services/post.js.map +1 -1
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/shopping.d.ts +1 -1
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/controllers/ai.js +0 -1
- package/src/controllers/ai.js.map +1 -1
- package/src/controllers/ai.ts +0 -1
- package/src/index.js +3 -3
- package/src/index.js.map +1 -1
- package/src/services/ai.js +2 -2
- package/src/services/ai.js.map +1 -1
- package/src/services/ai.ts +2 -2
|
@@ -241,8 +241,8 @@ export class AutoReply {
|
|
|
241
241
|
placeHolder: '請輸入寄件者名稱',
|
|
242
242
|
}),
|
|
243
243
|
html`
|
|
244
|
-
<div class="d-flex
|
|
245
|
-
<div class="d-flex align-items-center gap-2">${EditorElem.h3('
|
|
244
|
+
<div class="d-flex align-items-center justify-content-between p-0 my-2">
|
|
245
|
+
<div class="d-flex align-items-center gap-2">${EditorElem.h3('訊息內容')}</div>
|
|
246
246
|
<div>${BgWidget.aiChatButton({ gvc, select: 'writer' })}</div>
|
|
247
247
|
</div>
|
|
248
248
|
`,
|
|
@@ -55,17 +55,17 @@ export class FormModule {
|
|
|
55
55
|
return ``;
|
|
56
56
|
}
|
|
57
57
|
return html `<li class="w-100 border rounded-3 mb-2" style="overflow: hidden;">
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
<div
|
|
59
|
+
class="d-flex align-items-center w-100 py-2"
|
|
60
|
+
style="padding-left: 20px; padding-right: 20px;background: #F7F7F7;cursor: pointer;overflow: hidden;"
|
|
61
|
+
onclick="${gvc.event(() => {
|
|
62
62
|
dd.toggle = !dd.toggle;
|
|
63
63
|
gvc.notifyDataChange(vm.id);
|
|
64
64
|
})}"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
>
|
|
66
|
+
<i class="fa-sharp fa-solid fa-grip-dots-vertical me-3 dragItem "></i>
|
|
67
|
+
<div style="width:12px;" class="d-flex align-items-center justify-content-center me-3">
|
|
68
|
+
${(() => {
|
|
69
69
|
switch (dd.form_config.type) {
|
|
70
70
|
case 'email':
|
|
71
71
|
return `<i class="fa-solid fa-envelope "></i>`;
|
|
@@ -77,7 +77,8 @@ export class FormModule {
|
|
|
77
77
|
return opc.icon;
|
|
78
78
|
}
|
|
79
79
|
})()}
|
|
80
|
-
|
|
80
|
+
</div>
|
|
81
|
+
${dd.title || opc.title}${(() => {
|
|
81
82
|
if (dd.deletable === false) {
|
|
82
83
|
return `<div class="ms-2">${BgWidget.blueNote(`系統預設`)}</div>`;
|
|
83
84
|
}
|
|
@@ -85,27 +86,30 @@ export class FormModule {
|
|
|
85
86
|
return ``;
|
|
86
87
|
}
|
|
87
88
|
})()}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
<div class="flex-fill"></div>
|
|
90
|
+
${dd.toggle ? `<i class="fa-solid fa-angle-up"></i>` : `<i class="fa-solid fa-angle-down"></i>`}
|
|
91
|
+
</div>
|
|
92
|
+
${dd.toggle
|
|
92
93
|
? html `
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
<div class="w-100 p-3">
|
|
95
|
+
${(() => {
|
|
95
96
|
var _a;
|
|
96
|
-
const editor_option = [
|
|
97
|
+
const editor_option = [
|
|
98
|
+
BgWidget.multiCheckboxContainer(gvc, [{ key: 'true', name: '設定為必填項目' }], [`${(_a = dd.require) !== null && _a !== void 0 ? _a : ''}` || 'false'], () => {
|
|
97
99
|
if (dd.require) {
|
|
98
100
|
const dialog = new ShareDialog(gvc.glitter);
|
|
99
|
-
if (dd.key === 'email' &&
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
if (dd.key === 'email' &&
|
|
102
|
+
!vm.data.find((dd) => {
|
|
103
|
+
return dd.key === 'phone' && dd.require;
|
|
104
|
+
})) {
|
|
102
105
|
dialog.errorMessage({ text: '電話或信箱,必須有一個為必填' });
|
|
103
106
|
gvc.notifyDataChange(vm.id);
|
|
104
107
|
return;
|
|
105
108
|
}
|
|
106
|
-
else if (dd.key === 'phone' &&
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
else if (dd.key === 'phone' &&
|
|
110
|
+
!vm.data.find((dd) => {
|
|
111
|
+
return dd.key === 'email' && dd.require;
|
|
112
|
+
})) {
|
|
109
113
|
dialog.errorMessage({ text: '電話或信箱,必須有一個為必填' });
|
|
110
114
|
gvc.notifyDataChange(vm.id);
|
|
111
115
|
return;
|
|
@@ -124,15 +128,17 @@ export class FormModule {
|
|
|
124
128
|
return [];
|
|
125
129
|
}
|
|
126
130
|
else {
|
|
127
|
-
return [
|
|
131
|
+
return [
|
|
132
|
+
BgWidget.multiCheckboxContainer(gvc, [{ key: 'true', name: '隱藏此欄位' }], [`${(_a = dd.hidden) !== null && _a !== void 0 ? _a : ''}` || 'false'], () => {
|
|
128
133
|
dd.hidden = !dd.hidden;
|
|
129
134
|
update && update();
|
|
130
135
|
gvc.notifyDataChange(vm.id);
|
|
131
|
-
})
|
|
136
|
+
}),
|
|
137
|
+
];
|
|
132
138
|
}
|
|
133
139
|
})(),
|
|
134
|
-
html `<div class="d-flex align-items-center justify-content-end ${
|
|
135
|
-
|
|
140
|
+
html `<div class="d-flex align-items-center justify-content-end ${dd.deletable === false ? `d-none` : ``}">
|
|
141
|
+
${BgWidget.cancel(gvc.event(() => {
|
|
136
142
|
const dialog = new ShareDialog(gvc.glitter);
|
|
137
143
|
dialog.checkYesOrNot({
|
|
138
144
|
text: '是否確認刪除欄位?',
|
|
@@ -145,7 +151,8 @@ export class FormModule {
|
|
|
145
151
|
},
|
|
146
152
|
});
|
|
147
153
|
}), '刪除欄位')}
|
|
148
|
-
|
|
154
|
+
</div>`,
|
|
155
|
+
];
|
|
149
156
|
switch (dd.page) {
|
|
150
157
|
case 'multiple_line_text':
|
|
151
158
|
case 'input':
|
|
@@ -155,7 +162,8 @@ export class FormModule {
|
|
|
155
162
|
return [];
|
|
156
163
|
}
|
|
157
164
|
else {
|
|
158
|
-
return [
|
|
165
|
+
return [
|
|
166
|
+
EditorElem.select({
|
|
159
167
|
title: html `<div class="tx_normal fw-normal">資料類型</div>`,
|
|
160
168
|
gvc: gvc,
|
|
161
169
|
callback: (value) => {
|
|
@@ -243,7 +251,8 @@ export class FormModule {
|
|
|
243
251
|
value: dd.value,
|
|
244
252
|
};
|
|
245
253
|
}),
|
|
246
|
-
})
|
|
254
|
+
}),
|
|
255
|
+
];
|
|
247
256
|
}
|
|
248
257
|
})(),
|
|
249
258
|
BgWidget.editeInput({
|
|
@@ -268,7 +277,7 @@ export class FormModule {
|
|
|
268
277
|
},
|
|
269
278
|
placeHolder: '請輸入關於這項欄位的描述或指引',
|
|
270
279
|
}),
|
|
271
|
-
...editor_option
|
|
280
|
+
...editor_option,
|
|
272
281
|
].join('<div class="my-2"></div>');
|
|
273
282
|
case 'form-select':
|
|
274
283
|
case 'check_box':
|
|
@@ -286,8 +295,8 @@ export class FormModule {
|
|
|
286
295
|
placeHolder: '請輸入自訂欄位名稱',
|
|
287
296
|
}),
|
|
288
297
|
html `
|
|
289
|
-
|
|
290
|
-
|
|
298
|
+
<div class="tx_normal fw-normal mb-2">選項</div>
|
|
299
|
+
${gvc.bindView(() => {
|
|
291
300
|
const cVm = {
|
|
292
301
|
id: gvc.glitter.getUUID(),
|
|
293
302
|
};
|
|
@@ -297,35 +306,35 @@ export class FormModule {
|
|
|
297
306
|
return (dd.form_config.option
|
|
298
307
|
.map((d1, index) => {
|
|
299
308
|
return html `
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
309
|
+
<div class="d-flex align-items-center mb-2" style="gap: 10px;">
|
|
310
|
+
<input
|
|
311
|
+
class="form-control flex-fill"
|
|
312
|
+
placeholder="請輸入選項內容"
|
|
313
|
+
value="${d1.name}"
|
|
314
|
+
onchange="${gvc.event((e, event) => {
|
|
306
315
|
d1.value = e.value;
|
|
307
316
|
d1.name = e.value;
|
|
308
317
|
update && update();
|
|
309
318
|
gvc.notifyDataChange(cVm.id);
|
|
310
319
|
})}"
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
320
|
+
/>
|
|
321
|
+
<i
|
|
322
|
+
class="fa-solid fa-xmark"
|
|
323
|
+
style="color:#8d8d8d;cursor: pointer; "
|
|
324
|
+
onclick="${gvc.event(() => {
|
|
316
325
|
dd.form_config.option.splice(index, 1);
|
|
317
326
|
update && update();
|
|
318
327
|
gvc.notifyDataChange(cVm.id);
|
|
319
328
|
})}"
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
329
|
+
></i>
|
|
330
|
+
</div>
|
|
331
|
+
`;
|
|
323
332
|
})
|
|
324
333
|
.join('') +
|
|
325
334
|
html ` <div
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
335
|
+
class=""
|
|
336
|
+
style="width: 100px; height: 34px; padding: 6px 18px;background: #EAEAEA; border-radius: 10px; overflow: hidden; justify-content: center; align-items: center; gap: 8px; display: inline-flex; cursor: pointer;"
|
|
337
|
+
onclick="${gvc.event(() => {
|
|
329
338
|
dd.form_config.option.push({
|
|
330
339
|
index: 0,
|
|
331
340
|
name: '',
|
|
@@ -334,25 +343,27 @@ export class FormModule {
|
|
|
334
343
|
update && update();
|
|
335
344
|
gvc.notifyDataChange(cVm.id);
|
|
336
345
|
})}"
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
346
|
+
>
|
|
347
|
+
<div
|
|
348
|
+
style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
|
|
349
|
+
>
|
|
350
|
+
新增選項
|
|
351
|
+
</div>
|
|
352
|
+
</div>`);
|
|
342
353
|
},
|
|
343
354
|
};
|
|
344
355
|
})}
|
|
345
|
-
|
|
346
|
-
...editor_option
|
|
356
|
+
`,
|
|
357
|
+
...editor_option,
|
|
347
358
|
].join('<div class="my-2"></div>');
|
|
348
359
|
default:
|
|
349
360
|
return '';
|
|
350
361
|
}
|
|
351
362
|
})()}
|
|
352
|
-
|
|
353
|
-
|
|
363
|
+
</div>
|
|
364
|
+
`
|
|
354
365
|
: ''}
|
|
355
|
-
|
|
366
|
+
</li>`;
|
|
356
367
|
})
|
|
357
368
|
.join('');
|
|
358
369
|
return view;
|
|
@@ -397,7 +408,7 @@ export class FormModule {
|
|
|
397
408
|
},
|
|
398
409
|
};
|
|
399
410
|
}),
|
|
400
|
-
BgWidget.
|
|
411
|
+
BgWidget.dropPlusButton({
|
|
401
412
|
gvc: gvc,
|
|
402
413
|
title: '新增一個欄位',
|
|
403
414
|
options: option.map((dd) => {
|