ts-glitter 21.1.1 → 21.1.3

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.
Files changed (29) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/assets/css/theme.css +1 -1
  4. package/lowcode/backend-manager/bg-customer-message.js +1 -1
  5. package/lowcode/backend-manager/bg-customer-message.ts +1 -1
  6. package/lowcode/cms-plugin/POS-setting.js +10 -6
  7. package/lowcode/cms-plugin/POS-setting.ts +11 -5
  8. package/lowcode/cms-plugin/ai-message.js +1 -1
  9. package/lowcode/cms-plugin/ai-message.ts +1 -1
  10. package/lowcode/cms-plugin/pos-basic-setting.ts +1 -0
  11. package/lowcode/cms-plugin/pos-config-setting.js +56 -8
  12. package/lowcode/cms-plugin/pos-config-setting.ts +81 -28
  13. package/lowcode/cms-plugin/pos-pages/products-page.js +13 -2
  14. package/lowcode/cms-plugin/pos-pages/products-page.ts +14 -2
  15. package/lowcode/editor-components/font-select.js +1 -0
  16. package/lowcode/editor-components/font-select.ts +64 -0
  17. package/lowcode/official_view_component/official/component.js +10 -5
  18. package/lowcode/official_view_component/official/component.ts +22 -13
  19. package/lowcode/setting/fonts-config.js +119 -59
  20. package/lowcode/setting/fonts-config.ts +7075 -6999
  21. package/package.json +1 -1
  22. package/src/api-public/services/data-analyze.d.ts +4 -4
  23. package/src/api-public/services/data-analyze.js +16 -8
  24. package/src/api-public/services/data-analyze.js.map +1 -1
  25. package/src/api-public/services/data-analyze.ts +16 -8
  26. package/src/api-public/services/shopping.js +2 -3
  27. package/src/api-public/services/shopping.js.map +1 -1
  28. package/src/api-public/services/shopping.ts +2 -3
  29. package/src/api-public/utils/ut-permission.d.ts +0 -1
package/lowcode/Entry.js CHANGED
@@ -146,7 +146,7 @@ export class Entry {
146
146
  }
147
147
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
148
148
  console.log(`Entry-time:`, window.renderClock.stop());
149
- glitter.share.editerVersion = 'V_21.1.1';
149
+ glitter.share.editerVersion = 'V_21.1.3';
150
150
  glitter.share.start = new Date();
151
151
  const vm = { appConfig: [] };
152
152
  window.saasConfig = {
package/lowcode/Entry.ts CHANGED
@@ -149,7 +149,7 @@ export class Entry {
149
149
  }
150
150
  (window as any).renderClock = (window as any).renderClock ?? createClock();
151
151
  console.log(`Entry-time:`, (window as any).renderClock.stop());
152
- glitter.share.editerVersion = 'V_21.1.1';
152
+ glitter.share.editerVersion = 'V_21.1.3';
153
153
  glitter.share.start = new Date();
154
154
  const vm = { appConfig: [] };
155
155
  (window as any).saasConfig = {
@@ -13533,7 +13533,7 @@ html:not([dir=rtl]) .range-slider-ui.noUi-horizontal .noUi-handle {
13533
13533
  }
13534
13534
 
13535
13535
  .dropdown-menu li:hover > .dropdown-item {
13536
- color: var(--main-orange);
13536
+ color: #ffb400;
13537
13537
  }
13538
13538
  .dropdown-menu .active > .dropdown-item {
13539
13539
  color: #ff6c02;
@@ -107,7 +107,7 @@ export class BgCustomerMessage {
107
107
  else {
108
108
  let view = [
109
109
  ` <div class="navbar d-flex align-items-center justify-content-between w-100 p-3 "
110
- style="background: linear-gradient(135deg, var(--main-orange) 0%, #ff6c02 100%);">
110
+ style="background: linear-gradient(135deg, #ffb400 0%, #ff6c02 100%);">
111
111
  <div class="d-flex align-items-center pe-3 w-100"
112
112
  style="gap:10px;display: flex;align-items: center;">
113
113
  <img src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_sas0s9s0s1sesas0_1697354801736-Glitterlogo.png"
@@ -123,7 +123,7 @@ export class BgCustomerMessage {
123
123
  } else {
124
124
  let view = [
125
125
  ` <div class="navbar d-flex align-items-center justify-content-between w-100 p-3 "
126
- style="background: linear-gradient(135deg, var(--main-orange) 0%, #ff6c02 100%);">
126
+ style="background: linear-gradient(135deg, #ffb400 0%, #ff6c02 100%);">
127
127
  <div class="d-flex align-items-center pe-3 w-100"
128
128
  style="gap:10px;display: flex;align-items: center;">
129
129
  <img src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_sas0s9s0s1sesas0_1697354801736-Glitterlogo.png"
@@ -158,7 +158,17 @@ export class POSSetting {
158
158
  });
159
159
  }));
160
160
  }
161
+ static setSaasBrand() {
162
+ if (window.location.href.includes('smartshop')) {
163
+ window.glitterBase = 'hd_saas';
164
+ }
165
+ else {
166
+ window.glitterBase = 'shopnex';
167
+ }
168
+ window.saasConfig.config.token = GlobalUser.saas_token;
169
+ }
161
170
  static main(gvc) {
171
+ this.setSaasBrand();
162
172
  const glitter = gvc.glitter;
163
173
  const dialog = new ShareDialog(glitter);
164
174
  gvc.addStyle(`
@@ -207,12 +217,6 @@ export class POSSetting {
207
217
  POSSetting.initialStyle(gvc);
208
218
  gvc.glitter.share.NormalPageEditor = NormalPageEditor;
209
219
  gvc.glitter.addStyleLink('./css/editor.css');
210
- if (window.location.href.includes('smartshop')) {
211
- window.glitterBase = 'hd_saas';
212
- }
213
- else {
214
- window.glitterBase = 'shopnex';
215
- }
216
220
  window.appName = gvc.glitter.getUrlParameter('app-id');
217
221
  window.saasConfig.config.token = GlobalUser.saas_token;
218
222
  localStorage.setItem('on-pos', 'true');
@@ -172,6 +172,8 @@ export class POSSetting {
172
172
  }
173
173
 
174
174
  static initial(gvc: GVC) {
175
+
176
+
175
177
  gvc.glitter.share.editorViewModel = { app_config_original: {} };
176
178
  gvc.glitter.share.shop_config = { shop_name: '' };
177
179
 
@@ -188,7 +190,16 @@ export class POSSetting {
188
190
  });
189
191
  }
190
192
 
193
+ static setSaasBrand(){
194
+ if (window.location.href.includes('smartshop')) {
195
+ (window as any).glitterBase = 'hd_saas';
196
+ } else {
197
+ (window as any).glitterBase = 'shopnex';
198
+ }
199
+ (window as any).saasConfig.config.token = GlobalUser.saas_token;
200
+ }
191
201
  static main(gvc: GVC) {
202
+ this.setSaasBrand();
192
203
  const glitter = gvc.glitter;
193
204
  const dialog = new ShareDialog(glitter);
194
205
 
@@ -240,11 +251,6 @@ export class POSSetting {
240
251
 
241
252
  gvc.glitter.share.NormalPageEditor = NormalPageEditor; // 提供給編輯器使用
242
253
  gvc.glitter.addStyleLink('./css/editor.css');
243
- if (window.location.href.includes('smartshop')) {
244
- (window as any).glitterBase = 'hd_saas';
245
- } else {
246
- (window as any).glitterBase = 'shopnex';
247
- }
248
254
 
249
255
  (window as any).appName = gvc.glitter.getUrlParameter('app-id');
250
256
  (window as any).saasConfig.config.token = GlobalUser.saas_token;
@@ -873,7 +873,7 @@ export class AiMessage {
873
873
  }
874
874
  }
875
875
  AiMessage.config = {
876
- color: 'linear-gradient(135deg, var(--main-orange) 0%, #ff6c02 100%)',
876
+ color: 'linear-gradient(135deg, #ffb400 0%, #ff6c02 100%)',
877
877
  head: 'https://liondesign-prd.s3.amazonaws.com/file/252530754/1695093945424-Frame 62 (1).png',
878
878
  name: '萊恩設計',
879
879
  user_data: {
@@ -13,7 +13,7 @@ import {MemberAi} from "./ai-generator/member-ai.js";
13
13
 
14
14
  export class AiMessage {
15
15
  public static config: any = {
16
- color: 'linear-gradient(135deg, var(--main-orange) 0%, #ff6c02 100%)',
16
+ color: 'linear-gradient(135deg, #ffb400 0%, #ff6c02 100%)',
17
17
  head: 'https://liondesign-prd.s3.amazonaws.com/file/252530754/1695093945424-Frame 62 (1).png',
18
18
  name: '萊恩設計',
19
19
  user_data: {
@@ -30,6 +30,7 @@ const dialog=new ShareDialog(gvc.glitter)
30
30
  ${[
31
31
  BgWidget.editeInput({
32
32
  gvc: gvc,
33
+
33
34
  title: '商店名稱',
34
35
  default: appData.shop_name || '',
35
36
  placeHolder: '請輸入商店名稱',
@@ -227,6 +227,52 @@ ${BgWidget.customButton({
227
227
  }),
228
228
  }));
229
229
  }
230
+ function createProductCardLayout(title, description) {
231
+ var _a;
232
+ vm.data.pos_support_finction = (_a = vm.data.pos_support_finction) !== null && _a !== void 0 ? _a : [];
233
+ return createRow(title, description, BgWidget.customButton({
234
+ button: { color: 'snow', size: 'md' },
235
+ text: { name: '編輯' },
236
+ event: gvc.event(() => {
237
+ var _a;
238
+ vm.data.prdouct_card_layout = (_a = vm.data.prdouct_card_layout) !== null && _a !== void 0 ? _a : '16:9';
239
+ BgWidget.settingDialog({
240
+ gvc,
241
+ title,
242
+ width: 600,
243
+ innerHTML: gvc => {
244
+ return BgWidget.editeInput({
245
+ gvc: gvc,
246
+ title: '卡片比例',
247
+ default: vm.data.prdouct_card_layout,
248
+ placeHolder: '請輸入卡片比例,範例: 16:9',
249
+ callback: (text) => {
250
+ if (text.split(':').map((dd) => {
251
+ return Number.isFinite(Number(dd));
252
+ }).length === 2) {
253
+ vm.data.prdouct_card_layout = text;
254
+ }
255
+ },
256
+ });
257
+ },
258
+ footer_html: gvc => {
259
+ return [
260
+ BgWidget.cancel(gvc.event(() => {
261
+ gvc.closeDialog();
262
+ })),
263
+ BgWidget.save(gvc.event(() => __awaiter(this, void 0, void 0, function* () {
264
+ dialog.dataLoading({ visible: true });
265
+ yield vm.save_info();
266
+ dialog.dataLoading({ visible: false });
267
+ dialog.successMessage({ text: '儲存成功' });
268
+ gvc.closeDialog();
269
+ }))),
270
+ ].join('');
271
+ },
272
+ });
273
+ }),
274
+ }));
275
+ }
230
276
  function createCheckoutModeDialog(title, description) {
231
277
  return createRow(title, description, BgWidget.customButton({
232
278
  button: { color: 'snow', size: 'md' },
@@ -308,10 +354,11 @@ ${BgWidget.customButton({
308
354
  const typeMap = {
309
355
  function: () => {
310
356
  var _a;
311
- return [BgWidget.mainCard(html `
312
- <div class="d-flex flex-column gap-2">
313
- ${createSection('POS功能', '系統將根據您勾選的項目,開放相對應的功能')}
314
- ${BgWidget.inlineCheckBox({
357
+ return [
358
+ BgWidget.mainCard(html `
359
+ <div class="d-flex flex-column gap-2">
360
+ ${createSection('POS功能', '系統將根據您勾選的項目,開放相對應的功能')}
361
+ ${BgWidget.inlineCheckBox({
315
362
  title: '',
316
363
  gvc,
317
364
  def: (_a = vm.data.pos_support_finction) !== null && _a !== void 0 ? _a : [],
@@ -326,14 +373,15 @@ ${BgWidget.customButton({
326
373
  },
327
374
  type: 'multiple',
328
375
  })}
329
- ${createPickUpModeDialog('叫號取餐', `針對特店取餐功能,會自動遞增取餐號碼。`)}
330
- </div>
331
- `)
376
+ ${createPickUpModeDialog('叫號取餐', `針對特店取餐功能,會自動遞增取餐號碼。`)}
377
+ ${createProductCardLayout('商品比例', `設定POS商品卡片顯示比例。`)}
378
+ </div>
379
+ `),
332
380
  ].join('');
333
381
  },
334
382
  finance: () => {
335
383
  return ShoppingFinanceSetting.main(gvc, true);
336
- }
384
+ },
337
385
  };
338
386
  return BgWidget.container(html `
339
387
  <div class="title-container">${BgWidget.title('全站設定')}</div>
@@ -158,7 +158,7 @@ export class PosConfigSetting {
158
158
  }
159
159
 
160
160
  function createPickUpModeDialog(title: string, description: string) {
161
- vm.data.pos_support_finction=vm.data.pos_support_finction??[]
161
+ vm.data.pos_support_finction = vm.data.pos_support_finction ?? [];
162
162
  return createRow(
163
163
  title,
164
164
  description,
@@ -276,6 +276,60 @@ ${BgWidget.customButton({
276
276
  );
277
277
  }
278
278
 
279
+ function createProductCardLayout(title: string, description: string) {
280
+ vm.data.pos_support_finction = vm.data.pos_support_finction ?? [];
281
+ return createRow(
282
+ title,
283
+ description,
284
+ BgWidget.customButton({
285
+ button: { color: 'snow', size: 'md' },
286
+ text: { name: '編輯' },
287
+ event: gvc.event(() => {
288
+ vm.data.prdouct_card_layout=vm.data.prdouct_card_layout??'16:9'
289
+ BgWidget.settingDialog({
290
+ gvc,
291
+ title,
292
+ width: 600,
293
+ innerHTML: gvc => {
294
+ return BgWidget.editeInput({
295
+ gvc: gvc,
296
+
297
+ title: '卡片比例',
298
+ default: vm.data.prdouct_card_layout,
299
+ placeHolder: '請輸入卡片比例,範例: 16:9',
300
+ callback: (text) => {
301
+ if(text.split(':').map((dd)=>{
302
+ return Number.isFinite(Number(dd))
303
+ }).length===2){
304
+ vm.data.prdouct_card_layout=text
305
+ }
306
+ },
307
+ });
308
+ },
309
+ footer_html: gvc => {
310
+ return [
311
+ BgWidget.cancel(
312
+ gvc.event(() => {
313
+ gvc.closeDialog();
314
+ })
315
+ ),
316
+ BgWidget.save(
317
+ gvc.event(async () => {
318
+ dialog.dataLoading({ visible: true });
319
+ await vm.save_info();
320
+ dialog.dataLoading({ visible: false });
321
+ dialog.successMessage({ text: '儲存成功' });
322
+ gvc.closeDialog();
323
+ })
324
+ ),
325
+ ].join('');
326
+ },
327
+ });
328
+ }),
329
+ })
330
+ );
331
+ }
332
+
279
333
  function createCheckoutModeDialog(title: string, description: string) {
280
334
  return createRow(
281
335
  title,
@@ -367,35 +421,34 @@ ${BgWidget.customButton({
367
421
  vm.data.pos_support_finction = vm.data.pos_support_finction ?? [];
368
422
  const typeMap: Record<string, () => string> = {
369
423
  function: () => {
370
- return [BgWidget.mainCard(html`
371
- <div class="d-flex flex-column gap-2">
372
- ${createSection('POS功能', '系統將根據您勾選的項目,開放相對應的功能')}
373
- ${BgWidget.inlineCheckBox({
374
- title: '',
375
- gvc,
376
- def: vm.data.pos_support_finction ?? [],
377
- array: [
378
- { title: '列印明細', value: 'print_order_detail' },
379
- { title: '列印留存聯', value: 'print_order_receipt' },
380
- { title: '發票開立', value: 'print_invoice' },
381
- { title: '桌號設定', value: 'table_select' },
382
- ],
383
- callback: (array: any) => {
384
- vm.data.pos_support_finction = array;
385
- },
386
- type: 'multiple',
387
- })}
388
- ${createPickUpModeDialog(
389
- '叫號取餐',
390
- `針對特店取餐功能,會自動遞增取餐號碼。`
391
- )}
392
- </div>
393
- `)
424
+ return [
425
+ BgWidget.mainCard(html`
426
+ <div class="d-flex flex-column gap-2">
427
+ ${createSection('POS功能', '系統將根據您勾選的項目,開放相對應的功能')}
428
+ ${BgWidget.inlineCheckBox({
429
+ title: '',
430
+ gvc,
431
+ def: vm.data.pos_support_finction ?? [],
432
+ array: [
433
+ { title: '列印明細', value: 'print_order_detail' },
434
+ { title: '列印留存聯', value: 'print_order_receipt' },
435
+ { title: '發票開立', value: 'print_invoice' },
436
+ { title: '桌號設定', value: 'table_select' },
437
+ ],
438
+ callback: (array: any) => {
439
+ vm.data.pos_support_finction = array;
440
+ },
441
+ type: 'multiple',
442
+ })}
443
+ ${createPickUpModeDialog('叫號取餐', `針對特店取餐功能,會自動遞增取餐號碼。`)}
444
+ ${createProductCardLayout('商品比例', `設定POS商品卡片顯示比例。`)}
445
+ </div>
446
+ `),
394
447
  ].join('');
395
448
  },
396
- finance:()=>{
397
- return ShoppingFinanceSetting.main(gvc,true)
398
- }
449
+ finance: () => {
450
+ return ShoppingFinanceSetting.main(gvc, true);
451
+ },
399
452
  };
400
453
 
401
454
  return BgWidget.container(html`
@@ -12,6 +12,7 @@ import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
12
12
  import { POSSetting } from '../POS-setting.js';
13
13
  import { Swal } from '../../modules/sweetAlert.js';
14
14
  import { PaymentPage } from './payment-page.js';
15
+ import { PayConfig } from './pay-config.js';
15
16
  const html = String.raw;
16
17
  export class ProductsPage {
17
18
  static main(obj) {
@@ -24,7 +25,7 @@ export class ProductsPage {
24
25
  const pVM = {
25
26
  pageSize: 0,
26
27
  pageIndex: 1,
27
- limit: 20,
28
+ limit: 50,
28
29
  };
29
30
  function loadData() {
30
31
  let category = vm.categories.find((category) => category.select == true);
@@ -144,7 +145,17 @@ export class ProductsPage {
144
145
  >
145
146
  <div
146
147
  class="w-100"
147
- style="border-radius: 10px 10px 0 0;;padding-bottom: 116px;background: 50%/cover no-repeat url('${(_b = (_a = data
148
+ style="border-radius: 10px 10px 0 0;;padding-bottom: ${(() => {
149
+ if (PayConfig.pos_config.prdouct_card_layout) {
150
+ const wi = PayConfig.pos_config.prdouct_card_layout.split(':').map((dd) => {
151
+ return parseInt(dd, 10);
152
+ });
153
+ return parseInt(`${wi[0] / wi[1] * 100}`, 10);
154
+ }
155
+ else {
156
+ return `56`;
157
+ }
158
+ })()}%;background: 50%/cover no-repeat url('${(_b = (_a = data
148
159
  .content.preview_image[0]) !== null && _a !== void 0 ? _a : image) !== null && _b !== void 0 ? _b : image}');"
149
160
  ></div>
150
161
  <div class="d-flex flex-column" style="padding: 12px 10px;gap: 4px;">
@@ -5,6 +5,7 @@ import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
5
5
  import { POSSetting } from '../POS-setting.js';
6
6
  import { Swal } from '../../modules/sweetAlert.js';
7
7
  import { PaymentPage } from './payment-page.js';
8
+ import { PayConfig } from './pay-config.js';
8
9
 
9
10
  const html = String.raw;
10
11
 
@@ -102,7 +103,7 @@ export class ProductsPage {
102
103
  const pVM = {
103
104
  pageSize: 0,
104
105
  pageIndex: 1,
105
- limit: 20,
106
+ limit: 50,
106
107
  };
107
108
 
108
109
  function loadData() {
@@ -228,7 +229,18 @@ export class ProductsPage {
228
229
  >
229
230
  <div
230
231
  class="w-100"
231
- style="border-radius: 10px 10px 0 0;;padding-bottom: 116px;background: 50%/cover no-repeat url('${data
232
+ style="border-radius: 10px 10px 0 0;;padding-bottom: ${
233
+ (()=>{
234
+ if(PayConfig.pos_config.prdouct_card_layout){
235
+ const wi=PayConfig.pos_config.prdouct_card_layout.split(':').map((dd:any)=>{
236
+ return parseInt(dd,10)
237
+ })
238
+ return parseInt(`${wi[0] / wi[1] * 100}`,10)
239
+ }else{
240
+ return `56`
241
+ }
242
+ })()
243
+ }%;background: 50%/cover no-repeat url('${data
232
244
  .content.preview_image[0] ??
233
245
  image ??
234
246
  image}');"
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,64 @@
1
+ // import { BgWidget } from '../backend-manager/bg-widget.js';
2
+ // import { EditorElem } from '../glitterBundle/plugins/editor-elem.js';
3
+ // import { ShareDialog } from '../glitterBundle/dialog/ShareDialog.js';
4
+ // import { FontsConfig } from '../setting/fonts-config.js';
5
+ //
6
+ // export class FontSelect {
7
+ // public static setFont(obj: { index: number; gvc: any; vm_c: any; globalValue: any; dd: any }) {
8
+ // const { index, gvc, vm_c, globalValue, dd } = obj;
9
+ // return `<div class="col-12 mb-3" style="cursor: pointer;">
10
+ // <div class="rounded border p-2 d-flex w-100 flex-column" style="gap:10px;">
11
+ // ${BgWidget.title(index === 0 ? `預設字型` : dd.value || `字型樣式 ${index}`, 'font-size: 16px;')}
12
+ // <div class="d-flex align-items-center" style="gap:10px;">
13
+ // ${EditorElem.searchInputDynamicV2({
14
+ // title: '',
15
+ // gvc: gvc,
16
+ // // default: dd.value,
17
+ // def: dd.value,
18
+ // array: vm_c.fonts.map((dd: any, index: number) => {
19
+ // return dd.title;
20
+ // }),
21
+ // callback: text => {
22
+ // if (
23
+ // vm_c.fonts.find((dd: any, index: number) => {
24
+ // return dd.title === text;
25
+ // })
26
+ // ) {
27
+ // dd.title = text;
28
+ // dd.value = text;
29
+ // FontsConfig.reInitialFontTheme(globalValue, gvc);
30
+ // }
31
+ // gvc.notifyDataChange(vm_c.id);
32
+ // },
33
+ // placeHolder: '搜尋字體',
34
+ // readonly: 'true',
35
+ // })}
36
+ // ${
37
+ // index !== 0
38
+ // ? BgWidget.cancel(
39
+ // gvc.event(() => {
40
+ // const dialog = new ShareDialog(gvc.glitter);
41
+ // dialog.checkYesOrNot({
42
+ // text: '是否確認刪除此字型?',
43
+ // callback: response => {
44
+ // if (response) {
45
+ // globalValue.font_theme.splice(index, 1);
46
+ // gvc.notifyDataChange(vm_c.id);
47
+ // }
48
+ // },
49
+ // });
50
+ // }),
51
+ // '<i class="fa-solid fa-trash-can"></i>'
52
+ // )
53
+ // : ``
54
+ // }
55
+ // </div>
56
+ // </div>
57
+ // <div class="d-flex p-2 align-items-center" style="gap:10px;">
58
+ // <div class="fs-6">預覽字體:</div>
59
+ // <div class="fs-6 bgf6 p-2" style="font-family: '${dd.value}' !important;">字型</div>
60
+ // <div class="fs-6 bgf6 p-2" style="font-family: '${dd.value}' !important;">fonts</div>
61
+ // </div>
62
+ // </div>`;
63
+ // }
64
+ // }
@@ -33,11 +33,10 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
33
33
  widget[dd].data.refer_app = widget.data.refer_app;
34
34
  });
35
35
  }
36
- const app_editor = (['index-app'].includes(gvc.glitter.getUrlParameter('page')) || ApplicationConfig.is_application);
36
+ const app_editor = ['index-app'].includes(gvc.glitter.getUrlParameter('page')) || ApplicationConfig.is_application;
37
37
  initialReferData(widget);
38
38
  let viewConfig = undefined;
39
39
  const html = String.raw;
40
- const view_container_id = widget.id;
41
40
  return {
42
41
  view: () => {
43
42
  if (app_editor) {
@@ -128,8 +127,14 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
128
127
  });
129
128
  function getFormData(ref) {
130
129
  var _a, _b;
131
- ref =
132
- window.parent.glitter.share.updated_form_data[`${page_request_config.appName}_${tag}`] || ref;
130
+ ref = (() => {
131
+ if (window.glitter.getUrlParameter('select_widget') === 'true') {
132
+ return ref;
133
+ }
134
+ else {
135
+ return window.parent.glitter.share.updated_form_data[`${page_request_config.appName}_${tag}`] || ref;
136
+ }
137
+ })();
133
138
  let formData = JSON.parse(JSON.stringify(ref || {}));
134
139
  if (widget.data.refer_app) {
135
140
  GlobalWidget.initialShowCaseData({
@@ -1456,7 +1461,7 @@ font-weight: 700;"
1456
1461
  gvc.glitter.getModule(new URL(gvc.glitter.root_path + `public-components/headers/header-mobile.js`).href, res => {
1457
1462
  resolve(res.editor({
1458
1463
  gvc: gvc,
1459
- widget: widget
1464
+ widget: widget,
1460
1465
  }));
1461
1466
  });
1462
1467
  });
@@ -26,20 +26,20 @@ export const component = Plugin.createComponent(import.meta.url, (glitter: Glitt
26
26
  widget[dd].data.refer_app = widget.data.refer_app;
27
27
  });
28
28
  }
29
- const app_editor=(['index-app'].includes(gvc.glitter.getUrlParameter('page')) || ApplicationConfig.is_application)
29
+
30
+ const app_editor =
31
+ ['index-app'].includes(gvc.glitter.getUrlParameter('page')) || ApplicationConfig.is_application;
30
32
  initialReferData(widget);
31
33
  let viewConfig: any = undefined;
32
34
  const html = String.raw;
33
- const view_container_id = widget.id;
34
35
  return {
35
36
  view: () => {
36
- if(app_editor){
37
- widget.mobile_editable=[]
37
+ if (app_editor) {
38
+ widget.mobile_editable = [];
38
39
  }
39
40
  let data: any = undefined;
40
41
  let tag = widget.data.tag;
41
42
  let carryData = widget.data.carryData;
42
-
43
43
  async function getData(document: any) {
44
44
  return new Promise(async (resolve, reject) => {
45
45
  try {
@@ -116,11 +116,18 @@ const app_editor=(['index-app'].includes(gvc.glitter.getUrlParameter('page')) ||
116
116
  });
117
117
 
118
118
  function getFormData(ref: any) {
119
+
120
+
119
121
  //判斷是否有上次的更新資料
120
- ref =
121
- (window.parent as any).glitter.share.updated_form_data[
122
- `${page_request_config.appName}_${tag}`
123
- ] || ref;
122
+ ref = (()=>{
123
+ if((window as any).glitter.getUrlParameter('select_widget') === 'true'){
124
+ return ref;
125
+ }else{
126
+ return (window.parent as any).glitter.share.updated_form_data[
127
+ `${page_request_config.appName}_${tag}`
128
+ ] || ref
129
+ }
130
+ })();
124
131
  let formData = JSON.parse(JSON.stringify(ref || {}));
125
132
  if (widget.data.refer_app) {
126
133
  GlobalWidget.initialShowCaseData({
@@ -1314,8 +1321,8 @@ const app_editor=(['index-app'].includes(gvc.glitter.getUrlParameter('page')) ||
1314
1321
  </div>`,
1315
1322
  ` <div class="mx-n3" style="background: #DDD;height: 1px;"></div>`,
1316
1323
  ].join(`<div style="height:18px;"></div>`);
1317
- if(app_editor){
1318
- global_setting_view=``
1324
+ if (app_editor) {
1325
+ global_setting_view = ``;
1319
1326
  }
1320
1327
  if (vm.page === 'editor') {
1321
1328
  const array_items: any = await filterFormat(dd => {
@@ -1682,12 +1689,14 @@ font-weight: 700;"
1682
1689
  view: () => {
1683
1690
  return new Promise((resolve, reject) => {
1684
1691
  gvc.glitter.getModule(
1685
- new URL(gvc.glitter.root_path + `public-components/headers/header-mobile.js`).href,
1692
+ new URL(
1693
+ gvc.glitter.root_path + `public-components/headers/header-mobile.js`
1694
+ ).href,
1686
1695
  res => {
1687
1696
  resolve(
1688
1697
  res.editor({
1689
1698
  gvc: gvc,
1690
- widget:widget
1699
+ widget: widget,
1691
1700
  })
1692
1701
  );
1693
1702
  }