ts-glitter 16.0.4 → 16.0.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 +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-line.js +1 -1
- package/lowcode/backend-manager/bg-line.ts +1 -1
- package/lowcode/backend-manager/bg-list-component.js +56 -49
- package/lowcode/backend-manager/bg-list-component.ts +57 -50
- package/lowcode/backend-manager/bg-notify.js +1 -1
- package/lowcode/backend-manager/bg-notify.ts +1 -1
- package/lowcode/backend-manager/bg-recommend.js +1 -1
- package/lowcode/backend-manager/bg-recommend.ts +1 -1
- package/lowcode/backend-manager/bg-sns.js +1 -1
- package/lowcode/backend-manager/bg-sns.ts +1 -1
- package/lowcode/backend-manager/bg-widget.js +15 -2
- package/lowcode/backend-manager/bg-widget.ts +16 -2
- package/lowcode/cms-plugin/auto-reply.js +116 -7
- package/lowcode/cms-plugin/auto-reply.ts +136 -7
- package/lowcode/cms-plugin/filter-options.js +8 -0
- package/lowcode/cms-plugin/filter-options.ts +20 -0
- package/lowcode/cms-plugin/module/delivery-html.js +217 -93
- package/lowcode/cms-plugin/module/delivery-html.ts +232 -96
- package/lowcode/cms-plugin/module/product-excel.js +5 -1
- package/lowcode/cms-plugin/module/product-excel.ts +270 -266
- package/lowcode/cms-plugin/permission-setting.js +3 -2
- package/lowcode/cms-plugin/permission-setting.ts +2 -2
- package/lowcode/cms-plugin/shopping-allowance-manager.js +3 -2
- package/lowcode/cms-plugin/shopping-allowance-manager.ts +2 -2
- package/lowcode/cms-plugin/shopping-finance-setting.js +2 -1
- package/lowcode/cms-plugin/shopping-finance-setting.ts +2 -1
- package/lowcode/cms-plugin/shopping-invoice-manager.js +3 -2
- package/lowcode/cms-plugin/shopping-invoice-manager.ts +2 -2
- package/lowcode/cms-plugin/shopping-order-manager.js +83 -6
- package/lowcode/cms-plugin/shopping-order-manager.ts +81 -6
- package/lowcode/cms-plugin/shopping-product-setting.js +6 -5
- package/lowcode/cms-plugin/shopping-product-setting.ts +3 -3
- package/lowcode/cms-plugin/shopping-product-stock.js +3 -2
- package/lowcode/cms-plugin/shopping-product-stock.ts +2 -2
- package/lowcode/cms-plugin/shopping-product-v2.js +3 -2
- package/lowcode/cms-plugin/shopping-product-v2.ts +2 -2
- package/lowcode/cms-plugin/stock-stores.js +379 -0
- package/lowcode/cms-plugin/stock-stores.ts +468 -0
- package/lowcode/cms-plugin/stock-vendors.js +349 -0
- package/lowcode/cms-plugin/stock-vendors.ts +433 -0
- package/lowcode/cms-plugin/user-list.js +6 -4
- package/lowcode/cms-plugin/user-list.ts +4 -4
- package/lowcode/jspage/function-page/setting_editor.js +105 -113
- package/lowcode/jspage/function-page/setting_editor.ts +319 -331
- package/lowcode/public-components/checkout/index.js +3 -0
- package/lowcode/public-components/checkout/index.ts +16 -0
- package/package.json +1 -1
- package/src/api-public/controllers/ai-chat.js +2 -0
- package/src/api-public/controllers/ai-chat.js.map +1 -1
- package/src/api-public/controllers/ai-chat.ts +3 -1
- package/src/api-public/controllers/ai-points.js.map +1 -1
- package/src/api-public/controllers/article.js.map +1 -5
- package/src/api-public/controllers/fcm.js.map +1 -1
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/rebate.js.map +1 -1
- package/src/api-public/controllers/shop.js +2 -0
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +2 -0
- package/src/api-public/controllers/sms-points.js.map +1 -1
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/controllers/wallet.js.map +1 -1
- package/src/api-public/services/ai-pointes.js.map +1 -1
- package/src/api-public/services/ai-robot.js.map +1 -1
- package/src/api-public/services/auto-send-email.js.map +1 -1
- package/src/api-public/services/custom-code.js.map +1 -1
- package/src/api-public/services/fb-message.js.map +1 -1
- package/src/api-public/services/financial-service.d.ts +31 -1
- package/src/api-public/services/financial-service.js +71 -2
- package/src/api-public/services/financial-service.js.map +1 -1
- package/src/api-public/services/financial-service.ts +100 -1
- package/src/api-public/services/invoice.js.map +1 -1
- package/src/api-public/services/language-setting.js.map +1 -1
- package/src/api-public/services/rebate.js.map +1 -1
- package/src/api-public/services/recommend.js.map +1 -1
- package/src/api-public/services/share-permission.js.map +1 -1
- package/src/api-public/services/shopping.js +1 -0
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +2 -0
- package/src/api-public/services/sms-pointes.js.map +1 -1
- package/src/api-public/services/user.js.map +1 -5
- package/src/api-public/services/wallet.js.map +1 -1
- package/src/config.d.ts +1 -1
- package/src/config.js.map +1 -1
- package/src/index.js +3 -3
- package/src/index.js.map +5 -1
- package/src/services/app.js.map +1 -1
- package/src/services/saas-table-check.js.map +1 -1
package/lowcode/Entry.js
CHANGED
|
@@ -79,7 +79,7 @@ export class Entry {
|
|
|
79
79
|
}
|
|
80
80
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
81
81
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
82
|
-
glitter.share.editerVersion = 'V_16.0.
|
|
82
|
+
glitter.share.editerVersion = 'V_16.0.6';
|
|
83
83
|
glitter.share.start = new Date();
|
|
84
84
|
const vm = {
|
|
85
85
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -81,7 +81,7 @@ export class Entry {
|
|
|
81
81
|
|
|
82
82
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
83
83
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
84
|
-
glitter.share.editerVersion = 'V_16.0.
|
|
84
|
+
glitter.share.editerVersion = 'V_16.0.6';
|
|
85
85
|
glitter.share.start = new Date();
|
|
86
86
|
const vm: {
|
|
87
87
|
appConfig: any;
|
|
@@ -309,7 +309,7 @@ export class BgLine {
|
|
|
309
309
|
return html ` <div style="display: flex; align-items: center; gap: 10px; width: 100%; justify-content: space-between">
|
|
310
310
|
<div>${filterList[0]}</div>
|
|
311
311
|
<div style="display: flex;">
|
|
312
|
-
|
|
312
|
+
${filterList[2] ? `<div class="me-2">${filterList[2]}</div>` : ''}
|
|
313
313
|
</div>
|
|
314
314
|
</div>
|
|
315
315
|
<div style="display: flex; margin-top: 8px;">${filterList[1]}</div>
|
|
@@ -385,7 +385,7 @@ export class BgLine {
|
|
|
385
385
|
return html` <div style="display: flex; align-items: center; gap: 10px; width: 100%; justify-content: space-between">
|
|
386
386
|
<div>${filterList[0]}</div>
|
|
387
387
|
<div style="display: flex;">
|
|
388
|
-
|
|
388
|
+
${filterList[2] ? `<div class="me-2">${filterList[2]}</div>` : ''}
|
|
389
389
|
</div>
|
|
390
390
|
</div>
|
|
391
391
|
<div style="display: flex; margin-top: 8px;">${filterList[1]}</div>
|
|
@@ -97,55 +97,62 @@ export class BgListComponent {
|
|
|
97
97
|
view: () => {
|
|
98
98
|
return html `<!-- Accordion: 篩選 -->
|
|
99
99
|
<div class="accordion" id="accordion${vmShow.id}">
|
|
100
|
-
${gvc.map(items.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
this.vm.filter[item.key]
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
this.vm.filter[item.key]
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
this.vm.filter[item.key]
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
100
|
+
${gvc.map(items.length > 0
|
|
101
|
+
? items.map((item) => {
|
|
102
|
+
let contentHTML = '';
|
|
103
|
+
switch (item.type) {
|
|
104
|
+
case 'during':
|
|
105
|
+
contentHTML +=
|
|
106
|
+
item.data && item.data.list.length > 0
|
|
107
|
+
? BgWidget.duringInputContainer(gvc, item.data, this.vm.filter[item.key], (value) => {
|
|
108
|
+
this.vm.filter[item.key] = value;
|
|
109
|
+
})
|
|
110
|
+
: '';
|
|
111
|
+
break;
|
|
112
|
+
case 'multi_checkbox':
|
|
113
|
+
contentHTML +=
|
|
114
|
+
item.data.length > 0
|
|
115
|
+
? BgWidget.multiCheckboxContainer(gvc, item.data, this.vm.filter[item.key], (value) => {
|
|
116
|
+
this.vm.filter[item.key] = value;
|
|
117
|
+
})
|
|
118
|
+
: '';
|
|
119
|
+
break;
|
|
120
|
+
case 'radio_and_input':
|
|
121
|
+
contentHTML +=
|
|
122
|
+
item.data.length > 0
|
|
123
|
+
? BgWidget.radioInputContainer(gvc, item.data, this.vm.filter[item.key], (value) => {
|
|
124
|
+
this.vm.filter[item.key] = value;
|
|
125
|
+
})
|
|
126
|
+
: '';
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
return contentHTML.length > 0
|
|
130
|
+
? html `<!-- Item -->
|
|
131
|
+
<div class="accordion-item border-0 rounded-3 mb-3">
|
|
132
|
+
<h3 class="accordion-header" id="heading${item.key}">
|
|
133
|
+
<button
|
|
134
|
+
class="accordion-button shadow-none rounded-3 p-0 collapsed"
|
|
135
|
+
type="button"
|
|
136
|
+
data-bs-toggle="collapse"
|
|
137
|
+
data-bs-target="#collapse${item.key}"
|
|
138
|
+
aria-expanded="false"
|
|
139
|
+
aria-controls="collapse${item.key}"
|
|
140
|
+
>
|
|
141
|
+
${item.name}
|
|
142
|
+
</button>
|
|
143
|
+
</h3>
|
|
144
|
+
<div
|
|
145
|
+
class="accordion-collapse collapse"
|
|
146
|
+
id="collapse${item.key}"
|
|
147
|
+
aria-labelledby="heading${item.key}"
|
|
148
|
+
data-bs-parent="#accordion${vmShow.id}"
|
|
149
|
+
>
|
|
150
|
+
<div class="accordion-body p-0 pt-1">${contentHTML}</div>
|
|
151
|
+
</div>
|
|
152
|
+
</div> `
|
|
153
|
+
: '';
|
|
154
|
+
})
|
|
155
|
+
: ['無篩選項目'])}
|
|
149
156
|
</div>
|
|
150
157
|
<div class="position-absolute bottom-0 left-0 w-100 d-flex align-items-center justify-content-end p-3 border-top pe-4" style="gap:10px;">
|
|
151
158
|
${BgWidget.cancel(gvc.event(() => {
|
|
@@ -108,7 +108,7 @@ export class BgListComponent {
|
|
|
108
108
|
|
|
109
109
|
showRightMenu(items: FilterItem[]) {
|
|
110
110
|
const glitter = (window.parent as any).glitter;
|
|
111
|
-
const gvc: GVC = glitter.pageConfig[glitter.pageConfig.length-1].gvc;
|
|
111
|
+
const gvc: GVC = glitter.pageConfig[glitter.pageConfig.length - 1].gvc;
|
|
112
112
|
const menu = glitter.share.NormalPageEditor;
|
|
113
113
|
const vmShow = { id: gvc.glitter.getUUID() };
|
|
114
114
|
menu.closeEvent = () => gvc.notifyDataChange(this.vm.id);
|
|
@@ -122,57 +122,64 @@ export class BgListComponent {
|
|
|
122
122
|
return html`<!-- Accordion: 篩選 -->
|
|
123
123
|
<div class="accordion" id="accordion${vmShow.id}">
|
|
124
124
|
${gvc.map(
|
|
125
|
-
items.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
this.vm.filter[item.key]
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
this.vm.filter[item.key]
|
|
141
|
-
|
|
142
|
-
|
|
125
|
+
items.length > 0
|
|
126
|
+
? items.map((item: any) => {
|
|
127
|
+
let contentHTML = '';
|
|
128
|
+
switch (item.type) {
|
|
129
|
+
case 'during':
|
|
130
|
+
contentHTML +=
|
|
131
|
+
item.data && item.data.list.length > 0
|
|
132
|
+
? BgWidget.duringInputContainer(gvc, item.data, this.vm.filter[item.key], (value) => {
|
|
133
|
+
this.vm.filter[item.key] = value;
|
|
134
|
+
})
|
|
135
|
+
: '';
|
|
136
|
+
break;
|
|
137
|
+
case 'multi_checkbox':
|
|
138
|
+
contentHTML +=
|
|
139
|
+
item.data.length > 0
|
|
140
|
+
? BgWidget.multiCheckboxContainer(gvc, item.data, this.vm.filter[item.key], (value) => {
|
|
141
|
+
this.vm.filter[item.key] = value;
|
|
142
|
+
})
|
|
143
|
+
: '';
|
|
143
144
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
145
|
+
break;
|
|
146
|
+
case 'radio_and_input':
|
|
147
|
+
contentHTML +=
|
|
148
|
+
item.data.length > 0
|
|
149
|
+
? BgWidget.radioInputContainer(gvc, item.data, this.vm.filter[item.key], (value) => {
|
|
150
|
+
this.vm.filter[item.key] = value;
|
|
151
|
+
})
|
|
152
|
+
: '';
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
154
155
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
156
|
+
return contentHTML.length > 0
|
|
157
|
+
? html`<!-- Item -->
|
|
158
|
+
<div class="accordion-item border-0 rounded-3 mb-3">
|
|
159
|
+
<h3 class="accordion-header" id="heading${item.key}">
|
|
160
|
+
<button
|
|
161
|
+
class="accordion-button shadow-none rounded-3 p-0 collapsed"
|
|
162
|
+
type="button"
|
|
163
|
+
data-bs-toggle="collapse"
|
|
164
|
+
data-bs-target="#collapse${item.key}"
|
|
165
|
+
aria-expanded="false"
|
|
166
|
+
aria-controls="collapse${item.key}"
|
|
167
|
+
>
|
|
168
|
+
${item.name}
|
|
169
|
+
</button>
|
|
170
|
+
</h3>
|
|
171
|
+
<div
|
|
172
|
+
class="accordion-collapse collapse"
|
|
173
|
+
id="collapse${item.key}"
|
|
174
|
+
aria-labelledby="heading${item.key}"
|
|
175
|
+
data-bs-parent="#accordion${vmShow.id}"
|
|
176
|
+
>
|
|
177
|
+
<div class="accordion-body p-0 pt-1">${contentHTML}</div>
|
|
178
|
+
</div>
|
|
179
|
+
</div> `
|
|
180
|
+
: '';
|
|
181
|
+
})
|
|
182
|
+
: ['無篩選項目']
|
|
176
183
|
)}
|
|
177
184
|
</div>
|
|
178
185
|
<div class="position-absolute bottom-0 left-0 w-100 d-flex align-items-center justify-content-end p-3 border-top pe-4" style="gap:10px;">
|
|
@@ -309,7 +309,7 @@ export class BgNotify {
|
|
|
309
309
|
return html `<div style="display: flex; align-items: center; gap: 10px; width: 100%; justify-content: space-between">
|
|
310
310
|
<div>${filterList[0]}</div>
|
|
311
311
|
<div style="display: flex;">
|
|
312
|
-
|
|
312
|
+
${filterList[2] ? `<div class="me-2">${filterList[2]}</div>` : ''}
|
|
313
313
|
</div>
|
|
314
314
|
</div>
|
|
315
315
|
<div style="display: flex; margin-top: 8px;">${filterList[1]}</div>
|
|
@@ -380,7 +380,7 @@ export class BgNotify {
|
|
|
380
380
|
return html`<div style="display: flex; align-items: center; gap: 10px; width: 100%; justify-content: space-between">
|
|
381
381
|
<div>${filterList[0]}</div>
|
|
382
382
|
<div style="display: flex;">
|
|
383
|
-
|
|
383
|
+
${filterList[2] ? `<div class="me-2">${filterList[2]}</div>` : ''}
|
|
384
384
|
</div>
|
|
385
385
|
</div>
|
|
386
386
|
<div style="display: flex; margin-top: 8px;">${filterList[1]}</div>
|
|
@@ -369,7 +369,7 @@ export class BgRecommend {
|
|
|
369
369
|
return html ` <div style="display: flex; align-items: center; gap: 10px; width: 100%; justify-content: space-between">
|
|
370
370
|
<div>${filterList[0]}</div>
|
|
371
371
|
<div style="display: flex;">
|
|
372
|
-
|
|
372
|
+
${filterList[2] ? `<div class="me-2">${filterList[2]}</div>` : ''}
|
|
373
373
|
</div>
|
|
374
374
|
</div>
|
|
375
375
|
<div style="display: flex; margin-top: 8px;">${filterList[1]}</div>`;
|
|
@@ -465,7 +465,7 @@ export class BgRecommend {
|
|
|
465
465
|
return html` <div style="display: flex; align-items: center; gap: 10px; width: 100%; justify-content: space-between">
|
|
466
466
|
<div>${filterList[0]}</div>
|
|
467
467
|
<div style="display: flex;">
|
|
468
|
-
|
|
468
|
+
${filterList[2] ? `<div class="me-2">${filterList[2]}</div>` : ''}
|
|
469
469
|
</div>
|
|
470
470
|
</div>
|
|
471
471
|
<div style="display: flex; margin-top: 8px;">${filterList[1]}</div>`;
|
|
@@ -311,7 +311,7 @@ export class BgSNS {
|
|
|
311
311
|
return html ` <div style="display: flex; align-items: center; gap: 10px; width: 100%; justify-content: space-between">
|
|
312
312
|
<div>${filterList[0]}</div>
|
|
313
313
|
<div style="display: flex;">
|
|
314
|
-
|
|
314
|
+
${filterList[2] ? `<div class="me-2">${filterList[2]}</div>` : ''}
|
|
315
315
|
</div>
|
|
316
316
|
</div>
|
|
317
317
|
<div style="display: flex; margin-top: 8px;">${filterList[1]}</div>
|
|
@@ -387,7 +387,7 @@ export class BgSNS {
|
|
|
387
387
|
return html` <div style="display: flex; align-items: center; gap: 10px; width: 100%; justify-content: space-between">
|
|
388
388
|
<div>${filterList[0]}</div>
|
|
389
389
|
<div style="display: flex;">
|
|
390
|
-
|
|
390
|
+
${filterList[2] ? `<div class="me-2">${filterList[2]}</div>` : ''}
|
|
391
391
|
</div>
|
|
392
392
|
</div>
|
|
393
393
|
<div style="display: flex; margin-top: 8px;">${filterList[1]}</div>
|
|
@@ -334,13 +334,23 @@ export class BgWidget {
|
|
|
334
334
|
const numberRegex = /^\d+$/;
|
|
335
335
|
return numberRegex.test(str);
|
|
336
336
|
}
|
|
337
|
+
static selectLanguage() {
|
|
338
|
+
return ``;
|
|
339
|
+
}
|
|
337
340
|
static editeInput(obj) {
|
|
338
341
|
var _a, _b, _c, _d, _e, _f;
|
|
339
342
|
obj.title = (_a = obj.title) !== null && _a !== void 0 ? _a : '';
|
|
340
343
|
return html `
|
|
341
344
|
<div style="${(_b = obj.divStyle) !== null && _b !== void 0 ? _b : ''}">
|
|
342
|
-
${obj.title ? html
|
|
343
|
-
<div class="d-flex w-100 align-items-center border rounded-3 ${obj.readonly ? `bgw-input-readonly` : ``}" style="margin: 8px 0;">
|
|
345
|
+
${obj.title ? html `<div class="tx_normal fw-normal" style="${(_c = obj.titleStyle) !== null && _c !== void 0 ? _c : ''}">${obj.title}</div>` : ``}
|
|
346
|
+
<div class="d-flex w-100 align-items-center border rounded-3 ${obj.readonly ? `bgw-input-readonly` : ``}" style="margin: 8px 0;overflow: hidden;">
|
|
347
|
+
${obj.global_language ? `
|
|
348
|
+
<div class="bg-white d-flex align-items-center justify-content-center py-3 px-2 border-end" style="cursor: pointer;" onclick="${obj.gvc.event(() => {
|
|
349
|
+
BgWidget.selectLanguage();
|
|
350
|
+
})}">
|
|
351
|
+
<i class="fa-sharp fa-regular fa-earth-americas"></i>
|
|
352
|
+
</div>
|
|
353
|
+
` : ``}
|
|
344
354
|
${obj.startText ? html ` <div class="py-2 ps-3" style="white-space: nowrap">${obj.startText}</div>` : ''}
|
|
345
355
|
<input
|
|
346
356
|
class="bgw-input ${obj.readonly ? `bgw-input-readonly` : ``}"
|
|
@@ -2051,6 +2061,9 @@ ${(_c = obj.default) !== null && _c !== void 0 ? _c : ''}</textarea
|
|
|
2051
2061
|
bind: vm.id,
|
|
2052
2062
|
view: () => {
|
|
2053
2063
|
if (vm.show) {
|
|
2064
|
+
if (obj.options.length === 0) {
|
|
2065
|
+
return '';
|
|
2066
|
+
}
|
|
2054
2067
|
return html ` <div class="c_absolute" style="top: 20px; right: 20px;">
|
|
2055
2068
|
<div class="form-check d-flex flex-column" style="gap: 16px">
|
|
2056
2069
|
${obj.gvc.map(obj.options.map((opt) => {
|
|
@@ -453,6 +453,9 @@ export class BgWidget {
|
|
|
453
453
|
return numberRegex.test(str);
|
|
454
454
|
}
|
|
455
455
|
|
|
456
|
+
static selectLanguage(){
|
|
457
|
+
return ``
|
|
458
|
+
}
|
|
456
459
|
static editeInput(obj: {
|
|
457
460
|
gvc: GVC;
|
|
458
461
|
title: string;
|
|
@@ -468,12 +471,20 @@ export class BgWidget {
|
|
|
468
471
|
startText?: string;
|
|
469
472
|
endText?: string;
|
|
470
473
|
oninput?: (text: string) => void;
|
|
474
|
+
global_language?:boolean
|
|
471
475
|
}) {
|
|
472
476
|
obj.title = obj.title ?? '';
|
|
473
477
|
return html`
|
|
474
478
|
<div style="${obj.divStyle ?? ''}">
|
|
475
|
-
${obj.title ? html
|
|
476
|
-
<div class="d-flex w-100 align-items-center border rounded-3 ${obj.readonly ? `bgw-input-readonly` : ``}" style="margin: 8px 0;">
|
|
479
|
+
${obj.title ? html`<div class="tx_normal fw-normal" style="${obj.titleStyle ?? ''}">${obj.title}</div>` : ``}
|
|
480
|
+
<div class="d-flex w-100 align-items-center border rounded-3 ${obj.readonly ? `bgw-input-readonly` : ``}" style="margin: 8px 0;overflow: hidden;">
|
|
481
|
+
${obj.global_language ? `
|
|
482
|
+
<div class="bg-white d-flex align-items-center justify-content-center py-3 px-2 border-end" style="cursor: pointer;" onclick="${obj.gvc.event(()=>{
|
|
483
|
+
BgWidget.selectLanguage()
|
|
484
|
+
})}">
|
|
485
|
+
<i class="fa-sharp fa-regular fa-earth-americas"></i>
|
|
486
|
+
</div>
|
|
487
|
+
`:``}
|
|
477
488
|
${obj.startText ? html` <div class="py-2 ps-3" style="white-space: nowrap">${obj.startText}</div>` : ''}
|
|
478
489
|
<input
|
|
479
490
|
class="bgw-input ${obj.readonly ? `bgw-input-readonly` : ``}"
|
|
@@ -2429,6 +2440,9 @@ ${obj.default ?? ''}</textarea
|
|
|
2429
2440
|
bind: vm.id,
|
|
2430
2441
|
view: () => {
|
|
2431
2442
|
if (vm.show) {
|
|
2443
|
+
if (obj.options.length === 0) {
|
|
2444
|
+
return '';
|
|
2445
|
+
}
|
|
2432
2446
|
return html` <div class="c_absolute" style="top: 20px; right: 20px;">
|
|
2433
2447
|
<div class="form-check d-flex flex-column" style="gap: 16px">
|
|
2434
2448
|
${obj.gvc.map(
|
|
@@ -11,6 +11,9 @@ import { BgWidget } from '../backend-manager/bg-widget.js';
|
|
|
11
11
|
import { Tool } from '../modules/tool.js';
|
|
12
12
|
import { ApiUser } from '../glitter-base/route/user.js';
|
|
13
13
|
import { EditorElem } from '../glitterBundle/plugins/editor-elem.js';
|
|
14
|
+
import { ProductAi } from "./ai-generator/product-ai.js";
|
|
15
|
+
import { imageLibrary } from "../modules/image-library.js";
|
|
16
|
+
import { ShareDialog } from "../glitterBundle/dialog/ShareDialog.js";
|
|
14
17
|
const html = String.raw;
|
|
15
18
|
export class AutoReply {
|
|
16
19
|
static main(gvc, widget) {
|
|
@@ -216,13 +219,119 @@ export class AutoReply {
|
|
|
216
219
|
select: 'writer',
|
|
217
220
|
})}
|
|
218
221
|
</div>`,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
222
|
+
gvc.bindView((() => {
|
|
223
|
+
const id = gvc.glitter.getUUID();
|
|
224
|
+
return {
|
|
225
|
+
bind: id,
|
|
226
|
+
view: () => {
|
|
227
|
+
try {
|
|
228
|
+
return html `<div
|
|
229
|
+
class="d-flex justify-content-between align-items-center gap-3 mb-1"
|
|
230
|
+
style="cursor: pointer;"
|
|
231
|
+
onclick="${gvc.event(() => {
|
|
232
|
+
const originContent = `${vm.data.content}`;
|
|
233
|
+
BgWidget.fullDialog({
|
|
234
|
+
gvc: gvc,
|
|
235
|
+
title: (gvc2) => {
|
|
236
|
+
return `<div class="d-flex align-items-center" style="gap:10px;">${'內文編輯' + BgWidget.aiChatButton({
|
|
237
|
+
gvc: gvc2,
|
|
238
|
+
select: 'writer',
|
|
239
|
+
click: () => {
|
|
240
|
+
ProductAi.generateRichText(gvc, (text) => {
|
|
241
|
+
vm.data.content += text;
|
|
242
|
+
gvc.notifyDataChange(id);
|
|
243
|
+
gvc2.recreateView();
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
})}</div>`;
|
|
247
|
+
},
|
|
248
|
+
innerHTML: (gvc2) => {
|
|
249
|
+
return html `
|
|
250
|
+
<div>
|
|
251
|
+
${EditorElem.richText({
|
|
252
|
+
gvc: gvc2,
|
|
253
|
+
def: vm.data.content,
|
|
254
|
+
setHeight: '100vh',
|
|
255
|
+
hiddenBorder: true,
|
|
256
|
+
insertImageEvent: (editor) => {
|
|
257
|
+
const mark = `{{${Tool.randomString(8)}}}`;
|
|
258
|
+
editor.selection.setAtEnd(editor.$el.get(0));
|
|
259
|
+
editor.html.insert(mark);
|
|
260
|
+
editor.undo.saveStep();
|
|
261
|
+
imageLibrary.selectImageLibrary(gvc, (urlArray) => {
|
|
262
|
+
if (urlArray.length > 0) {
|
|
263
|
+
const imgHTML = urlArray
|
|
264
|
+
.map((url) => {
|
|
265
|
+
return html `
|
|
266
|
+
<img src="${url.data}"/>`;
|
|
267
|
+
})
|
|
268
|
+
.join('');
|
|
269
|
+
editor.html.set(editor.html
|
|
270
|
+
.get(0)
|
|
271
|
+
.replace(mark, html `
|
|
272
|
+
<div class="d-flex flex-column">
|
|
273
|
+
${imgHTML}
|
|
274
|
+
</div>`));
|
|
275
|
+
editor.undo.saveStep();
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
279
|
+
dialog.errorMessage({ text: '請選擇至少一張圖片' });
|
|
280
|
+
}
|
|
281
|
+
}, html `
|
|
282
|
+
<div
|
|
283
|
+
class="d-flex flex-column"
|
|
284
|
+
style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;"
|
|
285
|
+
>
|
|
286
|
+
圖片庫
|
|
287
|
+
</div>`, {
|
|
288
|
+
mul: true,
|
|
289
|
+
cancelEvent: () => {
|
|
290
|
+
editor.html.set(editor.html.get(0).replace(mark, ''));
|
|
291
|
+
editor.undo.saveStep();
|
|
292
|
+
},
|
|
293
|
+
});
|
|
294
|
+
},
|
|
295
|
+
callback: (text) => {
|
|
296
|
+
vm.data.content = text;
|
|
297
|
+
},
|
|
298
|
+
rich_height: `calc(${window.parent.innerHeight}px - 70px - 58px - 49px - 64px - 40px + ${document.body.clientWidth < 800 ? `70` : `0`}px)`,
|
|
299
|
+
})}
|
|
300
|
+
</div>`;
|
|
301
|
+
},
|
|
302
|
+
footer_html: (gvc2) => {
|
|
303
|
+
return [
|
|
304
|
+
BgWidget.cancel(gvc2.event(() => {
|
|
305
|
+
vm.data.content = originContent;
|
|
306
|
+
gvc2.closeDialog();
|
|
307
|
+
})),
|
|
308
|
+
BgWidget.save(gvc2.event(() => {
|
|
309
|
+
gvc2.closeDialog();
|
|
310
|
+
gvc.notifyDataChange(id);
|
|
311
|
+
})),
|
|
312
|
+
].join('');
|
|
313
|
+
},
|
|
314
|
+
closeCallback: () => {
|
|
315
|
+
vm.data.content = originContent;
|
|
316
|
+
},
|
|
317
|
+
});
|
|
318
|
+
})}"
|
|
319
|
+
>
|
|
320
|
+
${(() => {
|
|
321
|
+
vm.data.content = vm.data.content || '';
|
|
322
|
+
const text = gvc.glitter.utText.removeTag(vm.data.content);
|
|
323
|
+
return BgWidget.richTextView(Tool.truncateString(text, 100));
|
|
324
|
+
})()}
|
|
325
|
+
</div>`;
|
|
326
|
+
}
|
|
327
|
+
catch (e) {
|
|
328
|
+
console.log(`error=>`, e);
|
|
329
|
+
return ``;
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
divCreate: {},
|
|
333
|
+
};
|
|
334
|
+
})())
|
|
226
335
|
].join('');
|
|
227
336
|
},
|
|
228
337
|
};
|