ts-glitter 22.4.7 → 22.4.9
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/lib/glitterBundle/Glitter.css +74 -62
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-product.js +49 -32
- package/lowcode/backend-manager/bg-product.ts +57 -39
- package/lowcode/backend-manager/bg-widget.js +17 -0
- package/lowcode/backend-manager/bg-widget.ts +18 -0
- package/lowcode/cms-plugin/information/information-module.js +5 -5
- package/lowcode/cms-plugin/information/information-module.ts +9 -5
- package/lowcode/cms-plugin/menus-setting.js +69 -55
- package/lowcode/cms-plugin/menus-setting.ts +77 -61
- package/lowcode/cms-plugin/module/form-module.js +109 -89
- package/lowcode/cms-plugin/module/form-module.ts +680 -650
- package/lowcode/cms-plugin/module/product-excel.js +1 -0
- package/lowcode/cms-plugin/module/product-excel.ts +2 -0
- package/lowcode/cms-plugin/pos-pages/payment-page.js +28 -10
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +29 -10
- package/lowcode/cms-plugin/shopping-allowance-manager.js +0 -1
- package/lowcode/cms-plugin/shopping-allowance-manager.ts +0 -1
- package/lowcode/cms-plugin/shopping-collections.js +367 -193
- package/lowcode/cms-plugin/shopping-collections.ts +664 -243
- package/lowcode/cms-plugin/shopping-information.js +392 -38
- package/lowcode/cms-plugin/shopping-information.ts +479 -87
- package/lowcode/cms-plugin/shopping-product-setting.js +2 -2
- package/lowcode/cms-plugin/shopping-product-setting.ts +2 -2
- package/lowcode/cms-plugin/shopping-setting-advance.js +906 -766
- package/lowcode/cms-plugin/shopping-setting-advance.ts +977 -841
- package/lowcode/cms-plugin/shopping-setting-basic.js +1547 -1285
- package/lowcode/cms-plugin/shopping-setting-basic.ts +1742 -1466
- package/lowcode/cms-plugin/stock-stores.js +1 -0
- package/lowcode/cms-plugin/stock-stores.ts +1 -0
- package/lowcode/cms-plugin/user-list.js +47 -12
- package/lowcode/cms-plugin/user-list.ts +52 -14
- package/lowcode/css/editor.css +6 -0
- package/lowcode/glitterBundle/Glitter.css +74 -62
- package/lowcode/jslib/nestable/index.html +317 -0
- package/lowcode/jslib/nestable/jquery.nestable.js +484 -0
- package/lowcode/official_view_component/form-widget/input-custom.js +98 -6
- package/lowcode/official_view_component/form-widget/input-custom.ts +121 -16
- package/lowcode/public-components/headers/header-class.js +63 -0
- package/lowcode/public-components/headers/header-class.ts +65 -0
- package/lowcode/public-components/headers/sy-02.js +386 -400
- package/lowcode/public-components/headers/sy-02.ts +482 -492
- package/lowcode/public-components/headers/sy-03.js +42 -43
- package/lowcode/public-components/headers/sy-03.ts +46 -43
- package/lowcode/public-components/headers/sy-04.js +43 -41
- package/lowcode/public-components/headers/sy-04.ts +48 -41
- package/lowcode/public-components/headers/sy-05.js +30 -27
- package/lowcode/public-components/headers/sy-05.ts +33 -27
- package/lowcode/public-components/product/product-list.js +160 -148
- package/lowcode/public-components/product/product-list.ts +186 -165
- package/lowcode/public-models/product.ts +26 -1
- package/lowcode/src/glitterBundle/Glitter.css +74 -62
- package/package.json +1 -1
- package/rxmnt81tnk.json +1 -0
- package/src/api-public/controllers/shop.js +10 -4
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +14 -9
- package/src/api-public/services/ezpay/tool.d.ts +1 -0
- package/src/api-public/services/mail.js +1 -1
- package/src/api-public/services/mail.js.map +1 -1
- package/src/api-public/services/mail.ts +1 -1
- package/src/api-public/services/schedule.d.ts +0 -1
- package/src/api-public/services/schedule.js +12 -35
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/schedule.ts +15 -39
- package/src/api-public/services/shopee.js +7 -17
- package/src/api-public/services/shopping.d.ts +27 -6
- package/src/api-public/services/shopping.js +364 -85
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +510 -101
- package/src/api-public/services/updated-table-checked.js +58 -1
- package/src/api-public/services/updated-table-checked.js.map +1 -1
- package/src/api-public/services/updated-table-checked.ts +62 -1
- package/src/api-public/services/user-update.js +14 -0
- package/src/api-public/services/user-update.js.map +1 -1
- package/src/api-public/services/user-update.ts +15 -0
- package/src/api-public/services/user.js +1 -1
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +1 -1
- package/src/app-project/serverless/src/modules/database.d.ts +1 -1
- package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
- package/src/helper/glitter-util.d.ts +1 -0
- package/src/index.js +7 -5
- package/src/index.js.map +1 -1
- package/src/index.ts +45 -38
- package/src/modules/firebase.js +1 -0
- package/src/modules/firebase.js.map +1 -1
- package/src/modules/firebase.ts +1 -0
- package/src/seo-config.d.ts +1 -1
- package/src/seo-config.js +1 -2
- package/src/seo-config.js.map +1 -1
- package/src/seo-config.ts +1 -2
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/ses.js +4 -3
- package/src/services/ses.js.map +1 -1
- package/src/services/system-schedule.js.map +1 -1
- package/src/services/system-schedule.ts +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BgWidget } from '../../backend-manager/bg-widget.js';
|
|
2
2
|
import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
|
|
3
3
|
import { EditorElem } from '../../glitterBundle/plugins/editor-elem.js';
|
|
4
|
-
import { Language } from
|
|
4
|
+
import { Language } from '../../glitter-base/global/language.js';
|
|
5
5
|
export class FormModule {
|
|
6
6
|
static editor(gvc, data, title, update) {
|
|
7
7
|
const html = String.raw;
|
|
@@ -46,7 +46,7 @@ export class FormModule {
|
|
|
46
46
|
try {
|
|
47
47
|
const view = vm.data
|
|
48
48
|
.map((dd, index) => {
|
|
49
|
-
const opc = option.find(
|
|
49
|
+
const opc = option.find(d1 => {
|
|
50
50
|
if (dd.page === 'multiple_line_text') {
|
|
51
51
|
return d1.key === 'input';
|
|
52
52
|
}
|
|
@@ -55,18 +55,18 @@ export class FormModule {
|
|
|
55
55
|
if (!opc) {
|
|
56
56
|
return ``;
|
|
57
57
|
}
|
|
58
|
-
return html
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
return html ` <li class="w-100 border rounded-3 mb-2" style="overflow: hidden;">
|
|
59
|
+
<div
|
|
60
|
+
class="d-flex align-items-center w-100 py-2"
|
|
61
|
+
style="padding-left: 20px; padding-right: 20px;background: #F7F7F7;cursor: pointer;overflow: hidden;"
|
|
62
|
+
onclick="${gvc.event(() => {
|
|
63
63
|
dd.toggle = !dd.toggle;
|
|
64
64
|
gvc.notifyDataChange(vm.id);
|
|
65
65
|
})}"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
>
|
|
67
|
+
<i class="fa-sharp fa-solid fa-grip-dots-vertical me-3 dragItem "></i>
|
|
68
|
+
<div style="width:12px;" class="d-flex align-items-center justify-content-center me-3">
|
|
69
|
+
${(() => {
|
|
70
70
|
switch (dd.form_config.type) {
|
|
71
71
|
case 'email':
|
|
72
72
|
return `<i class="fa-solid fa-envelope "></i>`;
|
|
@@ -80,8 +80,8 @@ export class FormModule {
|
|
|
80
80
|
return opc.icon;
|
|
81
81
|
}
|
|
82
82
|
})()}
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
</div>
|
|
84
|
+
${Language.getLanguageCustomText(dd.title || opc.title)}${(() => {
|
|
85
85
|
if (dd.deletable === false) {
|
|
86
86
|
return `<div class="ms-2">${BgWidget.blueNote(`系統預設`)}</div>`;
|
|
87
87
|
}
|
|
@@ -89,16 +89,21 @@ export class FormModule {
|
|
|
89
89
|
return ``;
|
|
90
90
|
}
|
|
91
91
|
})()}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
<div class="flex-fill"></div>
|
|
93
|
+
${dd.toggle ? `<i class="fa-solid fa-angle-up"></i>` : `<i class="fa-solid fa-angle-down"></i>`}
|
|
94
|
+
</div>
|
|
95
|
+
${dd.toggle
|
|
96
96
|
? html `
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
<div class="w-100 p-3">
|
|
98
|
+
${(() => {
|
|
99
99
|
var _a;
|
|
100
100
|
const editor_option = [
|
|
101
|
-
BgWidget.multiCheckboxContainer(gvc, [
|
|
101
|
+
BgWidget.multiCheckboxContainer(gvc, [
|
|
102
|
+
{
|
|
103
|
+
key: 'true',
|
|
104
|
+
name: '設定為必填項目',
|
|
105
|
+
},
|
|
106
|
+
], [`${(_a = dd.require) !== null && _a !== void 0 ? _a : ''}` || 'false'], () => {
|
|
102
107
|
if (dd.require) {
|
|
103
108
|
const dialog = new ShareDialog(gvc.glitter);
|
|
104
109
|
if (dd.key === 'email' &&
|
|
@@ -132,7 +137,12 @@ export class FormModule {
|
|
|
132
137
|
}
|
|
133
138
|
else {
|
|
134
139
|
return [
|
|
135
|
-
BgWidget.multiCheckboxContainer(gvc, [
|
|
140
|
+
BgWidget.multiCheckboxContainer(gvc, [
|
|
141
|
+
{
|
|
142
|
+
key: 'true',
|
|
143
|
+
name: '隱藏此欄位',
|
|
144
|
+
},
|
|
145
|
+
], [`${(_a = dd.hidden) !== null && _a !== void 0 ? _a : ''}` || 'false'], () => {
|
|
136
146
|
dd.hidden = !dd.hidden;
|
|
137
147
|
update && update();
|
|
138
148
|
gvc.notifyDataChange(vm.id);
|
|
@@ -140,12 +150,16 @@ export class FormModule {
|
|
|
140
150
|
];
|
|
141
151
|
}
|
|
142
152
|
})(),
|
|
143
|
-
html
|
|
144
|
-
|
|
153
|
+
html ` <div
|
|
154
|
+
class="d-flex align-items-center justify-content-end ${dd.deletable === false
|
|
155
|
+
? `d-none`
|
|
156
|
+
: ``}"
|
|
157
|
+
>
|
|
158
|
+
${BgWidget.cancel(gvc.event(() => {
|
|
145
159
|
const dialog = new ShareDialog(gvc.glitter);
|
|
146
160
|
dialog.checkYesOrNot({
|
|
147
161
|
text: '是否確認刪除欄位?',
|
|
148
|
-
callback:
|
|
162
|
+
callback: response => {
|
|
149
163
|
if (response) {
|
|
150
164
|
vm.data.splice(index, 1);
|
|
151
165
|
gvc.notifyDataChange(vm.id);
|
|
@@ -154,7 +168,7 @@ export class FormModule {
|
|
|
154
168
|
},
|
|
155
169
|
});
|
|
156
170
|
}), '刪除欄位')}
|
|
157
|
-
|
|
171
|
+
</div>`,
|
|
158
172
|
];
|
|
159
173
|
switch (dd.page) {
|
|
160
174
|
case 'multiple_line_text':
|
|
@@ -167,9 +181,9 @@ export class FormModule {
|
|
|
167
181
|
else {
|
|
168
182
|
return [
|
|
169
183
|
EditorElem.select({
|
|
170
|
-
title: html
|
|
184
|
+
title: html ` <div class="tx_normal fw-normal">資料類型</div>`,
|
|
171
185
|
gvc: gvc,
|
|
172
|
-
callback:
|
|
186
|
+
callback: value => {
|
|
173
187
|
dd.form_config.type = value;
|
|
174
188
|
if (value === 'textArea') {
|
|
175
189
|
dd.page = 'multiple_line_text';
|
|
@@ -248,7 +262,7 @@ export class FormModule {
|
|
|
248
262
|
value: 'password',
|
|
249
263
|
visible: 'visible',
|
|
250
264
|
},
|
|
251
|
-
].map(
|
|
265
|
+
].map(dd => {
|
|
252
266
|
return {
|
|
253
267
|
title: dd.name,
|
|
254
268
|
value: dd.value,
|
|
@@ -262,56 +276,60 @@ export class FormModule {
|
|
|
262
276
|
gvc: gvc,
|
|
263
277
|
title: '自訂欄位名稱',
|
|
264
278
|
default: dd.title || '',
|
|
265
|
-
callback:
|
|
279
|
+
callback: text => {
|
|
266
280
|
dd.title = text;
|
|
267
281
|
update && update();
|
|
268
282
|
gvc.notifyDataChange(vm.id);
|
|
269
283
|
},
|
|
270
284
|
placeHolder: '請輸入自訂欄位名稱',
|
|
271
|
-
global_language: true
|
|
285
|
+
global_language: true,
|
|
272
286
|
}),
|
|
273
287
|
BgWidget.editeInput({
|
|
274
288
|
gvc: gvc,
|
|
275
289
|
title: '提示文字',
|
|
276
290
|
default: dd.form_config.place_holder || '',
|
|
277
|
-
callback:
|
|
291
|
+
callback: text => {
|
|
278
292
|
dd.form_config.place_holder = text;
|
|
279
293
|
update && update();
|
|
280
294
|
gvc.notifyDataChange(vm.id);
|
|
281
295
|
},
|
|
282
296
|
placeHolder: '請輸入關於這項欄位的描述或指引',
|
|
283
|
-
global_language: true
|
|
297
|
+
global_language: true,
|
|
284
298
|
}),
|
|
285
|
-
...(
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
299
|
+
...(dd.form_config.type === 'date'
|
|
300
|
+
? [
|
|
301
|
+
BgWidget.editeInput({
|
|
302
|
+
gvc: gvc,
|
|
303
|
+
title: '最小起始日',
|
|
304
|
+
default: dd.form_config.start_time || '',
|
|
305
|
+
callback: text => {
|
|
306
|
+
dd.form_config.start_time = text;
|
|
307
|
+
update && update();
|
|
308
|
+
gvc.notifyDataChange(vm.id);
|
|
309
|
+
},
|
|
310
|
+
placeHolder: '幾天前,0為當下,未輸入則不限制',
|
|
311
|
+
global_language: true,
|
|
312
|
+
}),
|
|
313
|
+
BgWidget.editeInput({
|
|
314
|
+
gvc: gvc,
|
|
315
|
+
title: '最大結束日',
|
|
316
|
+
default: dd.form_config.end_time || '',
|
|
317
|
+
callback: text => {
|
|
318
|
+
dd.form_config.end_time = text;
|
|
319
|
+
update && update();
|
|
320
|
+
gvc.notifyDataChange(vm.id);
|
|
321
|
+
},
|
|
322
|
+
placeHolder: '幾天後,0為當下,未輸入則不限制',
|
|
323
|
+
global_language: true,
|
|
324
|
+
}),
|
|
325
|
+
]
|
|
326
|
+
: []),
|
|
311
327
|
...editor_option,
|
|
312
|
-
]
|
|
328
|
+
]
|
|
329
|
+
.filter(dd => {
|
|
313
330
|
return dd;
|
|
314
|
-
})
|
|
331
|
+
})
|
|
332
|
+
.join('<div class="my-2"></div>');
|
|
315
333
|
case 'form-select':
|
|
316
334
|
case 'check_box':
|
|
317
335
|
case 'mutiple_select':
|
|
@@ -320,17 +338,17 @@ export class FormModule {
|
|
|
320
338
|
gvc: gvc,
|
|
321
339
|
title: '自訂欄位名稱',
|
|
322
340
|
default: dd.title || '',
|
|
323
|
-
callback:
|
|
341
|
+
callback: text => {
|
|
324
342
|
dd.title = text;
|
|
325
343
|
update && update();
|
|
326
344
|
gvc.notifyDataChange(vm.id);
|
|
327
345
|
},
|
|
328
346
|
placeHolder: '請輸入自訂欄位名稱',
|
|
329
|
-
global_language: true
|
|
347
|
+
global_language: true,
|
|
330
348
|
}),
|
|
331
349
|
html `
|
|
332
|
-
|
|
333
|
-
|
|
350
|
+
<div class="tx_normal fw-normal mb-2">選項</div>
|
|
351
|
+
${gvc.bindView(() => {
|
|
334
352
|
const cVm = {
|
|
335
353
|
id: gvc.glitter.getUUID(),
|
|
336
354
|
};
|
|
@@ -340,12 +358,15 @@ export class FormModule {
|
|
|
340
358
|
return (dd.form_config.option
|
|
341
359
|
.map((d1, index) => {
|
|
342
360
|
return html `
|
|
343
|
-
|
|
344
|
-
|
|
361
|
+
<div
|
|
362
|
+
class="d-flex align-items-center mb-2 w-100"
|
|
363
|
+
style="gap: 10px;"
|
|
364
|
+
>
|
|
365
|
+
${BgWidget.editeInput({
|
|
345
366
|
gvc: gvc,
|
|
346
367
|
title: '',
|
|
347
368
|
default: d1.value || '',
|
|
348
|
-
callback:
|
|
369
|
+
callback: text => {
|
|
349
370
|
d1.value = text;
|
|
350
371
|
d1.name = text;
|
|
351
372
|
update && update();
|
|
@@ -353,25 +374,24 @@ export class FormModule {
|
|
|
353
374
|
},
|
|
354
375
|
placeHolder: '請輸入自訂欄位名稱',
|
|
355
376
|
global_language: true,
|
|
356
|
-
divStyle: `width:100
|
|
377
|
+
divStyle: `width:100%;`,
|
|
357
378
|
})}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
379
|
+
<i
|
|
380
|
+
class="fa-solid fa-xmark"
|
|
381
|
+
style="color:#8d8d8d;cursor: pointer; "
|
|
382
|
+
onclick="${gvc.event(() => {
|
|
362
383
|
dd.form_config.option.splice(index, 1);
|
|
363
384
|
update && update();
|
|
364
385
|
gvc.notifyDataChange(cVm.id);
|
|
365
386
|
})}"
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
387
|
+
></i>
|
|
388
|
+
</div>
|
|
389
|
+
`;
|
|
369
390
|
})
|
|
370
391
|
.join('') +
|
|
371
392
|
html ` <div
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
onclick="${gvc.event(() => {
|
|
393
|
+
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;"
|
|
394
|
+
onclick="${gvc.event(() => {
|
|
375
395
|
dd.form_config.option.push({
|
|
376
396
|
index: 0,
|
|
377
397
|
name: '',
|
|
@@ -380,27 +400,27 @@ export class FormModule {
|
|
|
380
400
|
update && update();
|
|
381
401
|
gvc.notifyDataChange(cVm.id);
|
|
382
402
|
})}"
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
403
|
+
>
|
|
404
|
+
<div
|
|
405
|
+
style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
|
|
406
|
+
>
|
|
407
|
+
新增選項
|
|
408
|
+
</div>
|
|
409
|
+
</div>`);
|
|
390
410
|
},
|
|
391
411
|
};
|
|
392
412
|
})}
|
|
393
|
-
|
|
413
|
+
`,
|
|
394
414
|
...editor_option,
|
|
395
415
|
].join('<div class="my-2"></div>');
|
|
396
416
|
default:
|
|
397
417
|
return '';
|
|
398
418
|
}
|
|
399
419
|
})()}
|
|
400
|
-
|
|
401
|
-
|
|
420
|
+
</div>
|
|
421
|
+
`
|
|
402
422
|
: ''}
|
|
403
|
-
|
|
423
|
+
</li>`;
|
|
404
424
|
})
|
|
405
425
|
.join('');
|
|
406
426
|
return view;
|