ts-glitter 13.4.6 → 13.4.7

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.
@@ -29,16 +29,16 @@ export class EditorElem {
29
29
  onchange="${obj.gvc.event((e) => {
30
30
  obj.callback(e.value);
31
31
  })}"
32
- />
33
- <div class="" style="width: 1px;height: 25px;background-color: white;"></div>
34
- <i
32
+ />
33
+ <div class="" style="width: 1px;height: 25px;background-color: white;"></div>
34
+ <i
35
35
  class="fa-regular fa-eye text-black ms-2"
36
36
  style="cursor: pointer;"
37
37
  onclick="${obj.gvc.event(() => {
38
38
  glitter.openDiaLog(new URL('../../dialog/image-preview.js', import.meta.url).href, 'preview', obj.def);
39
39
  })}"
40
- ></i>
41
- <i
40
+ ></i>
41
+ <i
42
42
  class="fa-regular fa-upload ms-2 text-black"
43
43
  style="cursor: pointer;"
44
44
  onclick="${obj.gvc.event(() => {
@@ -77,7 +77,7 @@ export class EditorElem {
77
77
  },
78
78
  });
79
79
  })}"
80
- ></i>`;
80
+ ></i>`;
81
81
  },
82
82
  divCreate: {
83
83
  class: `d-flex align-items-center mb-2`,
@@ -95,33 +95,35 @@ export class EditorElem {
95
95
  bind: id,
96
96
  view: () => {
97
97
  if (obj.def && obj.def.length > 0) {
98
- return html ` <div class="uimg-container">
99
- <img class="uimg-image" src="${obj.def}" />
100
- <div
101
- class="uimg-shadow"
102
- onmouseover="${gvc.event((e) => {
98
+ return html `
99
+ <div class="uimg-container">
100
+ <img class="uimg-image" src="${obj.def}"/>
101
+ <div
102
+ class="uimg-shadow"
103
+ onmouseover="${gvc.event((e) => {
103
104
  e.style.opacity = '1';
104
105
  })}"
105
- onmouseout="${gvc.event((e) => {
106
+ onmouseout="${gvc.event((e) => {
106
107
  e.style.opacity = '0';
107
108
  })}"
108
- >
109
- <i
110
- class="fa-regular fa-trash mx-auto fs-1 uimg-trash"
111
- onclick="${gvc.event(() => {
109
+ >
110
+ <i
111
+ class="fa-regular fa-trash mx-auto fs-1 uimg-trash"
112
+ onclick="${gvc.event(() => {
112
113
  obj.def = '';
113
114
  obj.callback(obj.def);
114
115
  gvc.notifyDataChange(id);
115
116
  })}"
116
- ></i>
117
- </div>
118
- </div>`;
117
+ ></i>
118
+ </div>
119
+ </div>`;
119
120
  }
120
- return html ` <div class="uimg-container">
121
- <button
122
- class="btn btn-gray"
123
- type="button"
124
- onclick="${gvc.event(() => {
121
+ return html `
122
+ <div class="uimg-container">
123
+ <button
124
+ class="btn btn-gray"
125
+ type="button"
126
+ onclick="${gvc.event(() => {
125
127
  glitter.ut.chooseMediaCallback({
126
128
  single: true,
127
129
  accept: 'json,image/*',
@@ -157,10 +159,10 @@ export class EditorElem {
157
159
  },
158
160
  });
159
161
  })}"
160
- >
161
- <span class="tx_700">新增圖片</span>
162
- </button>
163
- </div>`;
162
+ >
163
+ <span class="tx_700">新增圖片</span>
164
+ </button>
165
+ </div>`;
164
166
  },
165
167
  };
166
168
  })}`;
@@ -212,44 +214,50 @@ export class EditorElem {
212
214
  {
213
215
  src: `https://raw.githack.com/SortableJS/Sortable/master/Sortable.js`,
214
216
  },
215
- ], () => { }, () => { });
217
+ ], () => {
218
+ }, () => {
219
+ });
216
220
  const id = obj.gvc.glitter.getUUID();
217
221
  const bid = obj.gvc.glitter.getUUID();
218
222
  return {
219
223
  bind: id,
220
224
  view: () => {
221
225
  if (data.length === 0) {
222
- return html ` <div class="w-100 d-flex align-items-center justify-content-center fw-bold fs-6 alert m-0 bgf6">尚未新增任何檔案...</div>`;
226
+ return html `
227
+ <div class="w-100 d-flex align-items-center justify-content-center fw-bold fs-6 alert m-0 bgf6">
228
+ 尚未新增任何檔案...
229
+ </div>`;
223
230
  }
224
231
  return html `
225
232
  <div class="" style="gap:10px; ">
226
233
  <ul id="${bid}" class="d-flex " style="gap:10px;overflow-x: auto;">
227
234
  ${data
228
235
  .map((dd, index) => {
229
- return html ` <li
230
- class="d-flex align-items-center justify-content-center rounded-3 shadow"
231
- index="${index}"
232
- style="min-width:135px;135px;height:135px;cursor:pointer;background: 50%/cover url('${dd}');"
233
- >
234
- <div
235
- class="w-100 h-100 d-flex align-items-center justify-content-center rounded-3 p-hover-image"
236
- style="opacity:0;background: rgba(0,0,0,0.5);gap:20px;color:white;font-size:22px;"
237
- >
238
- <i
239
- class="fa-regular fa-eye"
240
- onclick="${obj.gvc.event(() => {
236
+ return html `
237
+ <li
238
+ class="d-flex align-items-center justify-content-center rounded-3 shadow"
239
+ index="${index}"
240
+ style="min-width:135px;135px;height:135px;cursor:pointer;background: 50%/cover url('${dd}');"
241
+ >
242
+ <div
243
+ class="w-100 h-100 d-flex align-items-center justify-content-center rounded-3 p-hover-image"
244
+ style="opacity:0;background: rgba(0,0,0,0.5);gap:20px;color:white;font-size:22px;"
245
+ >
246
+ <i
247
+ class="fa-regular fa-eye"
248
+ onclick="${obj.gvc.event(() => {
241
249
  window.parent.glitter.openDiaLog(new URL('../../dialog/image-preview.js', import.meta.url).href, 'preview', dd);
242
250
  })}"
243
- ></i>
244
- <i
245
- class="fa-regular fa-trash"
246
- onclick="${obj.gvc.event(() => {
251
+ ></i>
252
+ <i
253
+ class="fa-regular fa-trash"
254
+ onclick="${obj.gvc.event(() => {
247
255
  data.splice(index, 1);
248
256
  obj.gvc.notifyDataChange(id);
249
257
  })}"
250
- ></i>
251
- </div>
252
- </li>`;
258
+ ></i>
259
+ </div>
260
+ </li>`;
253
261
  })
254
262
  .join('')}
255
263
  </ul>
@@ -285,7 +293,8 @@ export class EditorElem {
285
293
  },
286
294
  });
287
295
  }
288
- catch (e) { }
296
+ catch (e) {
297
+ }
289
298
  clearInterval(interval);
290
299
  }
291
300
  }, 100);
@@ -305,7 +314,9 @@ export class EditorElem {
305
314
  {
306
315
  src: `https://raw.githack.com/SortableJS/Sortable/master/Sortable.js`,
307
316
  },
308
- ], () => { }, () => { });
317
+ ], () => {
318
+ }, () => {
319
+ });
309
320
  const id = obj.gvc.glitter.getUUID();
310
321
  const bid = obj.gvc.glitter.getUUID();
311
322
  let loading = true;
@@ -316,37 +327,42 @@ export class EditorElem {
316
327
  return '';
317
328
  }
318
329
  if (data.length === 0) {
319
- return html ` <div class="w-100 d-flex align-items-center justify-content-center fw-bold fs-6 alert m-0 bgf6">尚未新增任何檔案...</div>`;
330
+ return html `
331
+ <div class="w-100 d-flex align-items-center justify-content-center fw-bold fs-6 alert m-0 bgf6">
332
+ 尚未新增任何檔案...
333
+ </div>`;
320
334
  }
321
335
  return html `
322
336
  <ul id="${bid}" class="d-flex" style="gap:10px;overflow-x: auto;max-width: 700px;">
323
337
  ${data
324
338
  .map((dd, index) => {
325
- return html ` <li
326
- class="d-flex align-items-center justify-content-center rounded-3 shadow"
327
- index="${index}"
328
- style="min-width:135px;135px;height:135px;cursor:pointer;background: 50%/cover url('${dd}');"
329
- >
330
- <div
331
- class="w-100 h-100 d-flex align-items-center justify-content-center rounded-3 p-hover-image position-relative"
332
- style="opacity:0;background: rgba(0,0,0,0.5);gap:20px;color:white;font-size:22px;"
333
- >
334
- <i class="fa-solid fa-grip-dots dragItem position-absolute" style="top:5px;left:5px;"></i>
335
- <i
336
- class="fa-regular fa-eye"
337
- onclick="${obj.gvc.event(() => {
339
+ return html `
340
+ <li
341
+ class="d-flex align-items-center justify-content-center rounded-3 shadow"
342
+ index="${index}"
343
+ style="min-width:135px;135px;height:135px;cursor:pointer;background: 50%/cover url('${dd}');"
344
+ >
345
+ <div
346
+ class="w-100 h-100 d-flex align-items-center justify-content-center rounded-3 p-hover-image position-relative"
347
+ style="opacity:0;background: rgba(0,0,0,0.5);gap:20px;color:white;font-size:22px;"
348
+ >
349
+ <i class="fa-solid fa-grip-dots dragItem position-absolute"
350
+ style="top:5px;left:5px;"></i>
351
+ <i
352
+ class="fa-regular fa-eye"
353
+ onclick="${obj.gvc.event(() => {
338
354
  window.parent.glitter.openDiaLog(new URL('../../dialog/image-preview.js', import.meta.url).href, 'preview', dd);
339
355
  })}"
340
- ></i>
341
- <i
342
- class="fa-regular fa-trash"
343
- onclick="${obj.gvc.event(() => {
356
+ ></i>
357
+ <i
358
+ class="fa-regular fa-trash"
359
+ onclick="${obj.gvc.event(() => {
344
360
  data.splice(index, 1);
345
361
  obj.gvc.notifyDataChange(id);
346
362
  })}"
347
- ></i>
348
- </div>
349
- </li>`;
363
+ ></i>
364
+ </div>
365
+ </li>`;
350
366
  })
351
367
  .join('')}
352
368
  </ul>
@@ -405,7 +421,8 @@ export class EditorElem {
405
421
  },
406
422
  });
407
423
  }
408
- catch (e) { }
424
+ catch (e) {
425
+ }
409
426
  clearInterval(interval);
410
427
  }
411
428
  }, 100);
@@ -490,11 +507,12 @@ export class EditorElem {
490
507
  return {
491
508
  bind: id,
492
509
  view: () => {
493
- return html ` <iframe
494
- id="${frameID}"
495
- class="w-100 h-100 border rounded-3"
496
- src="${domain}/browser-amd-editor/component.html?height=${height}&link=${location.origin}&callbackID=${id}"
497
- ></iframe>`;
510
+ return html `
511
+ <iframe
512
+ id="${frameID}"
513
+ class="w-100 h-100 border rounded-3"
514
+ src="${domain}/browser-amd-editor/component.html?height=${height}&link=${location.origin}&callbackID=${id}"
515
+ ></iframe>`;
498
516
  },
499
517
  divCreate: { class: `w-100 `, style: `height:${height}px;` },
500
518
  onDestroy: () => {
@@ -518,9 +536,9 @@ export class EditorElem {
518
536
  <div class="d-flex">
519
537
  ${obj.title ? EditorElem.h3(obj.title) : ''}
520
538
  <div
521
- class="d-flex align-items-center justify-content-center"
522
- style="height:36px;width:36px;border-radius:10px;cursor:pointer;color:#151515;"
523
- onclick="${obj.gvc.event(() => {
539
+ class="d-flex align-items-center justify-content-center"
540
+ style="height:36px;width:36px;border-radius:10px;cursor:pointer;color:#151515;"
541
+ onclick="${obj.gvc.event(() => {
524
542
  EditorElem.openEditorDialog(obj.gvc, (gvc) => {
525
543
  return getComponent(gvc, window.innerHeight - 100);
526
544
  }, () => {
@@ -561,9 +579,9 @@ export class EditorElem {
561
579
  view: () => {
562
580
  return html `
563
581
  <iframe
564
- id="${frameID}"
565
- class="w-100 h-100 border rounded-3"
566
- src="${domain}/browser-amd-editor/component.html?height=${height}&link=${location.origin}&callbackID=${id}"
582
+ id="${frameID}"
583
+ class="w-100 h-100 border rounded-3"
584
+ src="${domain}/browser-amd-editor/component.html?height=${height}&link=${location.origin}&callbackID=${id}"
567
585
  ></iframe>
568
586
  `;
569
587
  },
@@ -589,9 +607,9 @@ export class EditorElem {
589
607
  <div class="d-flex">
590
608
  ${obj.title ? EditorElem.h3(obj.title) : ''}
591
609
  <div
592
- class="d-flex align-items-center justify-content-center"
593
- style="height:36px;width:36px;border-radius:10px;cursor:pointer;color:#151515;"
594
- onclick="${obj.gvc.event(() => {
610
+ class="d-flex align-items-center justify-content-center"
611
+ style="height:36px;width:36px;border-radius:10px;cursor:pointer;color:#151515;"
612
+ onclick="${obj.gvc.event(() => {
595
613
  EditorElem.openEditorDialog(obj.gvc, (gvc) => {
596
614
  return getComponent(gvc, window.innerHeight - 100);
597
615
  }, () => {
@@ -667,9 +685,9 @@ ${obj.structEnd ? obj.structEnd : '})()'}`,
667
685
  view: () => {
668
686
  return html `
669
687
  <iframe
670
- id="${frameID}"
671
- class="w-100 h-100 border rounded-3"
672
- src="${domain}/browser-amd-editor/component.html?height=${height}&link=${location.origin}&callbackID=${id}"
688
+ id="${frameID}"
689
+ class="w-100 h-100 border rounded-3"
690
+ src="${domain}/browser-amd-editor/component.html?height=${height}&link=${location.origin}&callbackID=${id}"
673
691
  ></iframe>
674
692
  `;
675
693
  },
@@ -695,22 +713,23 @@ ${obj.structEnd ? obj.structEnd : '})()'}`,
695
713
  return {
696
714
  bind: codeID,
697
715
  view: () => {
698
- return (html ` <div class="d-flex">
699
- ${obj.title ? EditorElem.h3(obj.title) : ''}
700
- <div
701
- class="d-flex align-items-center justify-content-center"
702
- style="height:36px;width:36px;border-radius:10px;cursor:pointer;color:#151515;"
703
- onclick="${obj.gvc.event(() => {
716
+ return (html `
717
+ <div class="d-flex">
718
+ ${obj.title ? EditorElem.h3(obj.title) : ''}
719
+ <div
720
+ class="d-flex align-items-center justify-content-center"
721
+ style="height:36px;width:36px;border-radius:10px;cursor:pointer;color:#151515;"
722
+ onclick="${obj.gvc.event(() => {
704
723
  EditorElem.openEditorDialog(obj.gvc, (gvc) => {
705
724
  return getComponent(gvc, window.innerHeight - 100);
706
725
  }, () => {
707
726
  obj.gvc.notifyDataChange(codeID);
708
727
  });
709
728
  })}"
710
- >
711
- <i class="fa-solid fa-expand"></i>
712
- </div>
713
- </div>` + getComponent(obj.gvc, obj.height));
729
+ >
730
+ <i class="fa-solid fa-expand"></i>
731
+ </div>
732
+ </div>` + getComponent(obj.gvc, obj.height));
714
733
  },
715
734
  };
716
735
  });
@@ -728,9 +747,9 @@ ${obj.structEnd ? obj.structEnd : '})()'}`,
728
747
  view: () => {
729
748
  return html `
730
749
  <iframe
731
- id="${frameID}"
732
- class="w-100 h-100 border rounded-3"
733
- src="${domain}/browser-amd-editor/component.html?height=${height}&link=${location.origin}&callbackID=${id}"
750
+ id="${frameID}"
751
+ class="w-100 h-100 border rounded-3"
752
+ src="${domain}/browser-amd-editor/component.html?height=${height}&link=${location.origin}&callbackID=${id}"
734
753
  ></iframe>
735
754
  `;
736
755
  },
@@ -773,9 +792,9 @@ ${obj.structEnd ? obj.structEnd : '})()'}`,
773
792
  <div class="d-flex">
774
793
  ${obj.title ? EditorElem.h3(obj.title) : ''}
775
794
  <div
776
- class="d-flex align-items-center justify-content-center"
777
- style="height:36px;width:36px;border-radius:10px;cursor:pointer;color:#151515;"
778
- onclick="${obj.gvc.event(() => {
795
+ class="d-flex align-items-center justify-content-center"
796
+ style="height:36px;width:36px;border-radius:10px;cursor:pointer;color:#151515;"
797
+ onclick="${obj.gvc.event(() => {
779
798
  EditorElem.openEditorDialog(obj.gvc, (gvc) => {
780
799
  return getComponent(gvc, window.innerHeight - 100);
781
800
  }, () => {
@@ -832,7 +851,9 @@ ${obj.structEnd ? obj.structEnd : '})()'}`,
832
851
  `languages/zh_tw.js`,
833
852
  ].map((dd) => {
834
853
  return { src: dd.includes('http') ? dd : new URL(`../../jslib/froala/` + dd, import.meta.url).href };
835
- }), () => { }, () => { });
854
+ }), () => {
855
+ }, () => {
856
+ });
836
857
  gvc.addStyleLink([
837
858
  new URL(`../../jslib/froala/css/plugins/code_view.css`, import.meta.url).href,
838
859
  'https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.css',
@@ -841,7 +862,8 @@ ${obj.structEnd ? obj.structEnd : '})()'}`,
841
862
  return {
842
863
  bind: id,
843
864
  view: () => {
844
- return html ` <div class="w-100 d-flex align-items-center justify-content-center p-3 ${richID}-loading">
865
+ return html `
866
+ <div class="w-100 d-flex align-items-center justify-content-center p-3 ${richID}-loading">
845
867
  <div class="spinner-border" style=""></div>
846
868
  </div>
847
869
  <div id="${richID}">${obj.def}</div>`;
@@ -947,14 +969,15 @@ ${obj.structEnd ? obj.structEnd : '})()'}`,
947
969
  }
948
970
  setTimeout(() => {
949
971
  const target = glitter.document.querySelector(`[data-cmd="insertImage"]`);
950
- target.outerHTML = html ` <button
951
- id="insertImage-replace"
952
- type="button"
953
- tabindex="-1"
954
- role="button"
955
- class="fr-command fr-btn "
956
- data-title="插入圖片 (⌘P)"
957
- onclick="${obj.gvc.event(() => {
972
+ target.outerHTML = html `
973
+ <button
974
+ id="insertImage-replace"
975
+ type="button"
976
+ tabindex="-1"
977
+ role="button"
978
+ class="fr-command fr-btn "
979
+ data-title="插入圖片 (⌘P)"
980
+ onclick="${obj.gvc.event(() => {
958
981
  glitter.ut.chooseMediaCallback({
959
982
  single: true,
960
983
  accept: 'image/*',
@@ -988,14 +1011,15 @@ ${obj.structEnd ? obj.structEnd : '})()'}`,
988
1011
  },
989
1012
  });
990
1013
  })}"
991
- >
992
- <svg class="fr-svg" focusable="false" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
993
- <path
994
- d="M14.2,11l3.8,5H6l3-3.9l2.1,2.7L14,11H14.2z M8.5,11c0.8,0,1.5-0.7,1.5-1.5S9.3,8,8.5,8S7,8.7,7,9.5C7,10.3,7.7,11,8.5,11z M22,6v12c0,1.1-0.9,2-2,2H4c-1.1,0-2-0.9-2-2V6c0-1.1,0.9-2,2-2h16C21.1,4,22,4.9,22,6z M20,8.8V6H4v12h16V8.8z"
995
- ></path>
996
- </svg>
997
- <span class="fr-sr-only">插入圖片</span>
998
- </button>`;
1014
+ >
1015
+ <svg class="fr-svg" focusable="false" viewBox="0 0 24 24"
1016
+ xmlns="http://www.w3.org/2000/svg">
1017
+ <path
1018
+ d="M14.2,11l3.8,5H6l3-3.9l2.1,2.7L14,11H14.2z M8.5,11c0.8,0,1.5-0.7,1.5-1.5S9.3,8,8.5,8S7,8.7,7,9.5C7,10.3,7.7,11,8.5,11z M22,6v12c0,1.1-0.9,2-2,2H4c-1.1,0-2-0.9-2-2V6c0-1.1,0.9-2,2-2h16C21.1,4,22,4.9,22,6z M20,8.8V6H4v12h16V8.8z"
1019
+ ></path>
1020
+ </svg>
1021
+ <span class="fr-sr-only">插入圖片</span>
1022
+ </button>`;
999
1023
  if (obj.readonly) {
1000
1024
  editor.edit.off();
1001
1025
  editor.toolbar.disable();
@@ -1017,8 +1041,9 @@ margin-bottom: 5px;
1017
1041
  white-space: normal;" >${obj.title}</div>
1018
1042
  <div class="w-100" style=" padding: 10px 12px;border-radius: 7px; overflow: hidden; border: 1px #DDDDDD solid; justify-content: flex-start; align-items: center; gap: 10px; display: inline-flex;cursor:pointer;" onclick="${obj.gvc.event(() => {
1019
1043
  EditorElem.openEditorDialog(obj.gvc, () => {
1020
- return html ` <div class="p-3" style="overflow: hidden;">
1021
- ${EditorElem.richText({
1044
+ return html `
1045
+ <div class="p-3" style="overflow: hidden;">
1046
+ ${EditorElem.richText({
1022
1047
  gvc: obj.gvc,
1023
1048
  def: obj.def,
1024
1049
  callback: (text) => {
@@ -1026,8 +1051,9 @@ white-space: normal;" >${obj.title}</div>
1026
1051
  obj.callback(text);
1027
1052
  },
1028
1053
  })}
1029
- </div>`;
1030
- }, () => { }, 800, obj.title);
1054
+ </div>`;
1055
+ }, () => {
1056
+ }, 800, obj.title);
1031
1057
  })}">
1032
1058
  ${((_a = obj.def) !== null && _a !== void 0 ? _a : '').replace(/<[^>]*>/g, '') || '尚未輸入內容'}
1033
1059
  </div>`;
@@ -1115,20 +1141,20 @@ ${obj.gvc.bindView(() => {
1115
1141
  view: () => {
1116
1142
  var _a;
1117
1143
  return html `<input
1118
- class="flex-fill form-control "
1119
- placeholder="請輸入檔案連結"
1120
- value="${(_a = obj.def) !== null && _a !== void 0 ? _a : ''}"
1121
- onchange="${obj.gvc.event((e) => {
1144
+ class="flex-fill form-control "
1145
+ placeholder="請輸入檔案連結"
1146
+ value="${(_a = obj.def) !== null && _a !== void 0 ? _a : ''}"
1147
+ onchange="${obj.gvc.event((e) => {
1122
1148
  obj.callback(e.value);
1123
1149
  })}"
1124
- ${obj.readonly ? `readonly` : ``}
1125
- />
1126
- <div class="" style="width: 1px;height: 25px;background-color: white;"></div>
1127
- ${!obj.readonly
1150
+ ${obj.readonly ? `readonly` : ``}
1151
+ />
1152
+ <div class="" style="width: 1px;height: 25px;background-color: white;"></div>
1153
+ ${!obj.readonly
1128
1154
  ? html `<i
1129
- class="fa-regular fa-upload ms-2 fs-5"
1130
- style="cursor: pointer;color:black;"
1131
- onclick="${obj.gvc.event(() => {
1155
+ class="fa-regular fa-upload ms-2 fs-5"
1156
+ style="cursor: pointer;color:black;"
1157
+ onclick="${obj.gvc.event(() => {
1132
1158
  glitter.ut.chooseMediaCallback({
1133
1159
  single: true,
1134
1160
  accept: '*',
@@ -1164,7 +1190,7 @@ ${obj.gvc.bindView(() => {
1164
1190
  },
1165
1191
  });
1166
1192
  })}"
1167
- ></i>`
1193
+ ></i>`
1168
1194
  : ``} `;
1169
1195
  },
1170
1196
  divCreate: {
@@ -1217,17 +1243,17 @@ ${obj.gvc.bindView(() => {
1217
1243
  const glitter = window.glitter;
1218
1244
  const $ = glitter.$;
1219
1245
  return html `<h3 style="color: white;font-size: 16px;margin-bottom: 10px;" class="mt-2">${obj.title}</h3>
1220
- <div class="d-flex align-items-center mb-3">
1221
- <input
1246
+ <div class="d-flex align-items-center mb-3">
1247
+ <input
1222
1248
  class="flex-fill form-control "
1223
1249
  placeholder="請輸入圖片連結"
1224
1250
  value="${obj.def}"
1225
1251
  onchange="${obj.gvc.event((e) => {
1226
1252
  obj.callback(e.value);
1227
1253
  })}"
1228
- />
1229
- <div class="" style="width: 1px;height: 25px;background-color: white;"></div>
1230
- <i
1254
+ />
1255
+ <div class="" style="width: 1px;height: 25px;background-color: white;"></div>
1256
+ <i
1231
1257
  class="fa-regular fa-upload text-white ms-2"
1232
1258
  style="cursor: pointer;"
1233
1259
  onclick="${obj.gvc.event(() => {
@@ -1264,28 +1290,30 @@ ${obj.gvc.bindView(() => {
1264
1290
  },
1265
1291
  });
1266
1292
  })}"
1267
- ></i>
1268
- </div>`;
1293
+ ></i>
1294
+ </div>`;
1269
1295
  }
1270
1296
  static uploadLottie(obj) {
1271
1297
  const glitter = window.glitter;
1272
1298
  const $ = glitter.$;
1273
1299
  return html `<h3 style="color: white;font-size: 16px;margin-bottom: 10px;" class="mt-2">${obj.title}</h3>
1274
- <div class="alert alert-dark alert-dismissible fade show" role="alert" style="white-space: normal;word-break: break-word;">
1275
- <a onclick="${obj.gvc.event(() => glitter.openNewTab(`https://lottiefiles.com/`))}" class="fw text-white" style="cursor: pointer;">Lottie</a>
1276
- 是開放且免費的動畫平台,可以前往下載動畫檔後進行上傳.
1277
- </div>
1278
- <div class="d-flex align-items-center mb-3">
1279
- <input
1300
+ <div class="alert alert-dark alert-dismissible fade show" role="alert"
1301
+ style="white-space: normal;word-break: break-word;">
1302
+ <a onclick="${obj.gvc.event(() => glitter.openNewTab(`https://lottiefiles.com/`))}" class="fw text-white"
1303
+ style="cursor: pointer;">Lottie</a>
1304
+ 是開放且免費的動畫平台,可以前往下載動畫檔後進行上傳.
1305
+ </div>
1306
+ <div class="d-flex align-items-center mb-3">
1307
+ <input
1280
1308
  class="flex-fill form-control "
1281
1309
  placeholder="請輸入圖片連結"
1282
1310
  value="${obj.def}"
1283
1311
  onchange="${obj.gvc.event((e) => {
1284
1312
  obj.callback(e.value);
1285
1313
  })}"
1286
- />
1287
- <div class="" style="width: 1px;height: 25px;background-color: white;"></div>
1288
- <i
1314
+ />
1315
+ <div class="" style="width: 1px;height: 25px;background-color: white;"></div>
1316
+ <i
1289
1317
  class="fa-regular fa-upload text-white ms-2"
1290
1318
  style="cursor: pointer;"
1291
1319
  onclick="${obj.gvc.event(() => {
@@ -1322,15 +1350,17 @@ ${obj.gvc.bindView(() => {
1322
1350
  },
1323
1351
  });
1324
1352
  })}"
1325
- ></i>
1326
- </div>`;
1353
+ ></i>
1354
+ </div>`;
1327
1355
  }
1328
1356
  static h3(title) {
1329
1357
  return html `<h3 style="color: #393939;font-size: 15px;margin-bottom: 5px;" class="fw-500 mt-2">${title}</h3>`;
1330
1358
  }
1331
1359
  static plusBtn(title, event) {
1332
- return html ` <div class="w-100 my-3" style="background: black;height: 1px;"></div>
1333
- <div class="fw-500 text-dark align-items-center justify-content-center d-flex p-1 rounded mt-1 hoverBtn" style="border: 1px solid #151515;color:#151515;" onclick="${event}">
1360
+ return html `
1361
+ <div class="w-100 my-3" style="background: black;height: 1px;"></div>
1362
+ <div class="fw-500 text-dark align-items-center justify-content-center d-flex p-1 rounded mt-1 hoverBtn"
1363
+ style="border: 1px solid #151515;color:#151515;" onclick="${event}">
1334
1364
  ${title}
1335
1365
  </div>`;
1336
1366
  }
@@ -1338,10 +1368,13 @@ ${obj.gvc.bindView(() => {
1338
1368
  const glitter = window.glitter;
1339
1369
  return (html `
1340
1370
  ${EditorElem.h3(obj.title)}
1341
- <div class="alert alert-info fade show p-2" role="alert" style="white-space: normal;word-break: break-all;">
1342
- <a onclick="${obj.gvc.event(() => glitter.openNewTab('https://fontawesome.com/search'))}" class="fw fw-bold" style="cursor: pointer;">fontawesome</a>
1371
+ <div class="alert alert-info fade show p-2" role="alert"
1372
+ style="white-space: normal;word-break: break-all;">
1373
+ <a onclick="${obj.gvc.event(() => glitter.openNewTab('https://fontawesome.com/search'))}"
1374
+ class="fw fw-bold" style="cursor: pointer;">fontawesome</a>
1343
1375
 
1344
- <a onclick="${obj.gvc.event(() => glitter.openNewTab('https://boxicons.com/'))}" class="fw fw-bold" style="cursor: pointer;">box-icon</a>
1376
+ <a onclick="${obj.gvc.event(() => glitter.openNewTab('https://boxicons.com/'))}" class="fw fw-bold"
1377
+ style="cursor: pointer;">box-icon</a>
1345
1378
  是開放且免費的icon提供平台,可以前往挑選合適標籤進行設定.
1346
1379
  </div>
1347
1380
  ` +
@@ -1365,54 +1398,62 @@ ${obj.gvc.bindView(() => {
1365
1398
  bind: id,
1366
1399
  view: () => {
1367
1400
  if (obj.data.expand) {
1368
- return html ` <div
1369
- class="toggleInner mb-2 p-2"
1370
- style="width:calc(100%);border-radius:8px;
1371
- min-height:45px;background:#d9f1ff;border: 1px solid #151515;color:#151515;"
1372
- >
1401
+ return html `
1373
1402
  <div
1374
- class="d-flex p-0 align-items-center mb-2 w-100"
1375
- onclick="${obj.gvc.event(() => {
1403
+ class="toggleInner mb-2 p-2"
1404
+ style="width:calc(100%);border-radius:8px;
1405
+ min-height:45px;background:#d9f1ff;border: 1px solid #151515;color:#151515;"
1406
+ >
1407
+ <div
1408
+ class="d-flex p-0 align-items-center mb-2 w-100"
1409
+ onclick="${obj.gvc.event(() => {
1376
1410
  obj.data.expand = !obj.data.expand;
1377
1411
  obj.gvc.notifyDataChange(id);
1378
1412
  })}"
1379
- style="cursor: pointer;"
1380
- >
1381
- <h3 style="font-size: 16px;color: black;width: calc(100% - 60px);" class="m-0 p-0">${obj.title}</h3>
1382
- <div class="flex-fill"></div>
1383
- <div class="text-dark fw-bold" style="cursor: pointer;">收合<i class="fa-solid fa-up ms-2 text-dark"></i></div>
1384
- </div>
1385
- ${typeof obj.innerText === 'string' ? obj.innerText : obj.innerText()}
1386
- </div>`;
1413
+ style="cursor: pointer;"
1414
+ >
1415
+ <h3 style="font-size: 16px;color: black;width: calc(100% - 60px);" class="m-0 p-0">
1416
+ ${obj.title}</h3>
1417
+ <div class="flex-fill"></div>
1418
+ <div class="text-dark fw-bold" style="cursor: pointer;">收合<i
1419
+ class="fa-solid fa-up ms-2 text-dark"></i></div>
1420
+ </div>
1421
+ ${typeof obj.innerText === 'string' ? obj.innerText : obj.innerText()}
1422
+ </div>`;
1387
1423
  }
1388
- return html ` <div
1389
- class="toggleInner mb-2 p-2"
1390
- style="width:calc(100%);border-radius:8px;
1391
- min-height:45px;background:#d9f1ff;border: 1px solid #151515;color:#151515;"
1392
- >
1424
+ return html `
1393
1425
  <div
1394
- class="w-100 d-flex p-0 align-items-center"
1395
- onclick="${obj.gvc.event(() => {
1426
+ class="toggleInner mb-2 p-2"
1427
+ style="width:calc(100%);border-radius:8px;
1428
+ min-height:45px;background:#d9f1ff;border: 1px solid #151515;color:#151515;"
1429
+ >
1430
+ <div
1431
+ class="w-100 d-flex p-0 align-items-center"
1432
+ onclick="${obj.gvc.event(() => {
1396
1433
  obj.data.expand = !obj.data.expand;
1397
1434
  obj.gvc.notifyDataChange(id);
1398
1435
  })}"
1399
- style="cursor: pointer;"
1400
- >
1401
- <h3 style="font-size: 16px;color: black;width: calc(100% - 60px);" class="m-0 p-0">${obj.title}</h3>
1402
- <div class="flex-fill"></div>
1403
- <span class="text-dark fw-bold" style="cursor: pointer;">展開<i class="fa-solid fa-down ms-2 text-dark"></i></span>
1404
- </div>
1405
- </div>`;
1436
+ style="cursor: pointer;"
1437
+ >
1438
+ <h3 style="font-size: 16px;color: black;width: calc(100% - 60px);" class="m-0 p-0">
1439
+ ${obj.title}</h3>
1440
+ <div class="flex-fill"></div>
1441
+ <span class="text-dark fw-bold" style="cursor: pointer;">展開<i
1442
+ class="fa-solid fa-down ms-2 text-dark"></i></span>
1443
+ </div>
1444
+ </div>`;
1406
1445
  },
1407
1446
  divCreate: {},
1408
1447
  };
1409
1448
  })}`;
1410
1449
  }
1411
1450
  static minusTitle(title, event) {
1412
- return html ` <div class="d-flex align-items-center">
1413
- <i class="fa-regular fa-circle-minus text-danger me-2" style="font-size: 20px;cursor: pointer;" onclick="${event}"></i>
1414
- <h3 style="color: black;font-size: 16px;" class="m-0">${title}</h3>
1415
- </div>`;
1451
+ return html `
1452
+ <div class="d-flex align-items-center">
1453
+ <i class="fa-regular fa-circle-minus text-danger me-2" style="font-size: 20px;cursor: pointer;"
1454
+ onclick="${event}"></i>
1455
+ <h3 style="color: black;font-size: 16px;" class="m-0">${title}</h3>
1456
+ </div>`;
1416
1457
  }
1417
1458
  static searchInput(obj) {
1418
1459
  obj.def = obj.def || '';
@@ -1432,22 +1473,23 @@ ${obj.gvc.bindView(() => {
1432
1473
  bind: id2,
1433
1474
  view: () => {
1434
1475
  return html `<input
1435
- class="form-control w-100"
1436
- style="height: 40px;"
1437
- placeholder="${obj.placeHolder}"
1438
- onfocus="${obj.gvc.event(() => {
1476
+ class="form-control w-100"
1477
+ style="height: 40px;"
1478
+ placeholder="${obj.placeHolder}"
1479
+ onfocus="${obj.gvc.event(() => {
1439
1480
  gvc.getBindViewElem(id).addClass(`show`);
1440
1481
  })}"
1441
- onblur="${gvc.event(() => { })}"
1442
- oninput="${gvc.event((e) => {
1482
+ onblur="${gvc.event(() => {
1483
+ })}"
1484
+ oninput="${gvc.event((e) => {
1443
1485
  obj.def = e.value;
1444
1486
  gvc.notifyDataChange(id);
1445
1487
  setTimeout(() => {
1446
1488
  gvc.getBindViewElem(id).addClass(`show`);
1447
1489
  }, 100);
1448
1490
  })}"
1449
- value="${obj.def.replace(/"/g, "'")}"
1450
- onchange="${gvc.event((e) => {
1491
+ value="${obj.def.replace(/"/g, "'")}"
1492
+ onchange="${gvc.event((e) => {
1451
1493
  changeInterval = setTimeout(() => {
1452
1494
  obj.def = e.value;
1453
1495
  obj.callback(obj.def);
@@ -1470,9 +1512,10 @@ ${obj.gvc.bindView(() => {
1470
1512
  return d2.toUpperCase().indexOf(obj.def.toUpperCase()) !== -1;
1471
1513
  })
1472
1514
  .map((d3) => {
1473
- return html ` <button
1474
- class="dropdown-item"
1475
- onclick="${gvc.event(() => {
1515
+ return html `
1516
+ <button
1517
+ class="dropdown-item"
1518
+ onclick="${gvc.event(() => {
1476
1519
  clearInterval(changeInterval);
1477
1520
  obj.def = d3;
1478
1521
  gvc.notifyDataChange(id2);
@@ -1481,9 +1524,9 @@ ${obj.gvc.bindView(() => {
1481
1524
  gvc.getBindViewElem(id).removeClass(`show`);
1482
1525
  }, 100);
1483
1526
  })}"
1484
- >
1485
- ${d3}
1486
- </button>`;
1527
+ >
1528
+ ${d3}
1529
+ </button>`;
1487
1530
  })
1488
1531
  .join('');
1489
1532
  },
@@ -1523,7 +1566,8 @@ ${obj.gvc.bindView(() => {
1523
1566
  gvc.getBindViewElem(id).addClass(`show`);
1524
1567
  }, 100);
1525
1568
  }
1526
- catch (e) { }
1569
+ catch (e) {
1570
+ }
1527
1571
  });
1528
1572
  }
1529
1573
  return html `
@@ -1531,40 +1575,43 @@ ${obj.gvc.bindView(() => {
1531
1575
  return {
1532
1576
  bind: id2,
1533
1577
  view: () => {
1534
- return html ` <div class="" style="position: absolute;transform: translateY(-50%);top:50%;left:20px;">
1535
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
1578
+ return html `
1579
+ <div class=""
1580
+ style="position: absolute;transform: translateY(-50%);top:50%;left:20px;">
1581
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
1582
+ viewBox="0 0 20 20" fill="none">
1536
1583
  <g clip-path="url(#clip0_12704_238948)">
1537
1584
  <path
1538
- d="M14.375 8.125C14.375 6.4674 13.7165 4.87769 12.5444 3.70558C11.3723 2.53348 9.7826 1.875 8.125 1.875C6.4674 1.875 4.87769 2.53348 3.70558 3.70558C2.53348 4.87769 1.875 6.4674 1.875 8.125C1.875 9.7826 2.53348 11.3723 3.70558 12.5444C4.87769 13.7165 6.4674 14.375 8.125 14.375C9.7826 14.375 11.3723 13.7165 12.5444 12.5444C13.7165 11.3723 14.375 9.7826 14.375 8.125ZM13.168 14.4961C11.7852 15.5938 10.0312 16.25 8.125 16.25C3.63672 16.25 0 12.6133 0 8.125C0 3.63672 3.63672 0 8.125 0C12.6133 0 16.25 3.63672 16.25 8.125C16.25 10.0312 15.5938 11.7852 14.4961 13.168L19.7266 18.3984C20.0938 18.7656 20.0938 19.3594 19.7266 19.7227C19.3594 20.0859 18.7656 20.0898 18.4023 19.7227L13.168 14.4961Z"
1539
- fill="#8D8D8D"
1585
+ d="M14.375 8.125C14.375 6.4674 13.7165 4.87769 12.5444 3.70558C11.3723 2.53348 9.7826 1.875 8.125 1.875C6.4674 1.875 4.87769 2.53348 3.70558 3.70558C2.53348 4.87769 1.875 6.4674 1.875 8.125C1.875 9.7826 2.53348 11.3723 3.70558 12.5444C4.87769 13.7165 6.4674 14.375 8.125 14.375C9.7826 14.375 11.3723 13.7165 12.5444 12.5444C13.7165 11.3723 14.375 9.7826 14.375 8.125ZM13.168 14.4961C11.7852 15.5938 10.0312 16.25 8.125 16.25C3.63672 16.25 0 12.6133 0 8.125C0 3.63672 3.63672 0 8.125 0C12.6133 0 16.25 3.63672 16.25 8.125C16.25 10.0312 15.5938 11.7852 14.4961 13.168L19.7266 18.3984C20.0938 18.7656 20.0938 19.3594 19.7266 19.7227C19.3594 20.0859 18.7656 20.0898 18.4023 19.7227L13.168 14.4961Z"
1586
+ fill="#8D8D8D"
1540
1587
  />
1541
1588
  </g>
1542
1589
  <defs>
1543
1590
  <clipPath id="clip0_12704_238948">
1544
- <rect width="20" height="20" fill="white" />
1591
+ <rect width="20" height="20" fill="white"/>
1545
1592
  </clipPath>
1546
1593
  </defs>
1547
1594
  </svg>
1548
1595
  </div>
1549
1596
  <input
1550
- class="form-control w-100"
1551
- style="height: 44px;max-height:100%;padding-left:50px;"
1552
- placeholder="${obj.placeHolder}"
1553
- onfocus="${obj.gvc.event(() => {
1597
+ class="form-control w-100"
1598
+ style="height: 44px;max-height:100%;padding-left:50px;"
1599
+ placeholder="${obj.placeHolder}"
1600
+ onfocus="${obj.gvc.event(() => {
1554
1601
  gvc.getBindViewElem(id).addClass(`show`);
1555
1602
  refreshData();
1556
1603
  })}"
1557
- onblur="${gvc.event(() => {
1604
+ onblur="${gvc.event(() => {
1558
1605
  setTimeout(() => {
1559
1606
  gvc.getBindViewElem(id).removeClass(`show`);
1560
1607
  }, 300);
1561
1608
  })}"
1562
- oninput="${gvc.event((e) => {
1609
+ oninput="${gvc.event((e) => {
1563
1610
  obj.def = e.value;
1564
1611
  refreshData();
1565
1612
  })}"
1566
- value="${obj.def}"
1567
- onchange="${gvc.event((e) => {
1613
+ value="${obj.def}"
1614
+ onchange="${gvc.event((e) => {
1568
1615
  obj.def = e.value;
1569
1616
  setTimeout(() => {
1570
1617
  obj.callback(obj.def);
@@ -1584,16 +1631,17 @@ ${obj.gvc.bindView(() => {
1584
1631
  return d2.toUpperCase().indexOf(obj.def.toUpperCase()) !== -1;
1585
1632
  })
1586
1633
  .map((d3) => {
1587
- return html ` <button
1588
- class="dropdown-item"
1589
- onclick="${gvc.event(() => {
1634
+ return html `
1635
+ <button
1636
+ class="dropdown-item"
1637
+ onclick="${gvc.event(() => {
1590
1638
  obj.def = d3;
1591
1639
  gvc.notifyDataChange(id2);
1592
1640
  obj.callback(obj.def);
1593
1641
  })}"
1594
- >
1595
- ${d3}
1596
- </button>`;
1642
+ >
1643
+ ${d3}
1644
+ </button>`;
1597
1645
  })
1598
1646
  .join('');
1599
1647
  },
@@ -1629,7 +1677,8 @@ ${obj.gvc.bindView(() => {
1629
1677
  gvc.getBindViewElem(id).addClass(`show`);
1630
1678
  }, 100);
1631
1679
  }
1632
- catch (e) { }
1680
+ catch (e) {
1681
+ }
1633
1682
  });
1634
1683
  }
1635
1684
  return html `
@@ -1637,40 +1686,43 @@ ${obj.gvc.bindView(() => {
1637
1686
  return {
1638
1687
  bind: id2,
1639
1688
  view: () => {
1640
- return html ` <div class="" style="position: absolute;transform: translateY(-50%);top:50%;left:20px;">
1641
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
1689
+ return html `
1690
+ <div class=""
1691
+ style="position: absolute;transform: translateY(-50%);top:50%;left:20px;">
1692
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
1693
+ viewBox="0 0 20 20" fill="none">
1642
1694
  <g clip-path="url(#clip0_12704_238948)">
1643
1695
  <path
1644
- d="M14.375 8.125C14.375 6.4674 13.7165 4.87769 12.5444 3.70558C11.3723 2.53348 9.7826 1.875 8.125 1.875C6.4674 1.875 4.87769 2.53348 3.70558 3.70558C2.53348 4.87769 1.875 6.4674 1.875 8.125C1.875 9.7826 2.53348 11.3723 3.70558 12.5444C4.87769 13.7165 6.4674 14.375 8.125 14.375C9.7826 14.375 11.3723 13.7165 12.5444 12.5444C13.7165 11.3723 14.375 9.7826 14.375 8.125ZM13.168 14.4961C11.7852 15.5938 10.0312 16.25 8.125 16.25C3.63672 16.25 0 12.6133 0 8.125C0 3.63672 3.63672 0 8.125 0C12.6133 0 16.25 3.63672 16.25 8.125C16.25 10.0312 15.5938 11.7852 14.4961 13.168L19.7266 18.3984C20.0938 18.7656 20.0938 19.3594 19.7266 19.7227C19.3594 20.0859 18.7656 20.0898 18.4023 19.7227L13.168 14.4961Z"
1645
- fill="#8D8D8D"
1696
+ d="M14.375 8.125C14.375 6.4674 13.7165 4.87769 12.5444 3.70558C11.3723 2.53348 9.7826 1.875 8.125 1.875C6.4674 1.875 4.87769 2.53348 3.70558 3.70558C2.53348 4.87769 1.875 6.4674 1.875 8.125C1.875 9.7826 2.53348 11.3723 3.70558 12.5444C4.87769 13.7165 6.4674 14.375 8.125 14.375C9.7826 14.375 11.3723 13.7165 12.5444 12.5444C13.7165 11.3723 14.375 9.7826 14.375 8.125ZM13.168 14.4961C11.7852 15.5938 10.0312 16.25 8.125 16.25C3.63672 16.25 0 12.6133 0 8.125C0 3.63672 3.63672 0 8.125 0C12.6133 0 16.25 3.63672 16.25 8.125C16.25 10.0312 15.5938 11.7852 14.4961 13.168L19.7266 18.3984C20.0938 18.7656 20.0938 19.3594 19.7266 19.7227C19.3594 20.0859 18.7656 20.0898 18.4023 19.7227L13.168 14.4961Z"
1697
+ fill="#8D8D8D"
1646
1698
  />
1647
1699
  </g>
1648
1700
  <defs>
1649
1701
  <clipPath id="clip0_12704_238948">
1650
- <rect width="20" height="20" fill="white" />
1702
+ <rect width="20" height="20" fill="white"/>
1651
1703
  </clipPath>
1652
1704
  </defs>
1653
1705
  </svg>
1654
1706
  </div>
1655
1707
  <input
1656
- class="form-control w-100"
1657
- style="height: 44px;max-height:100%;padding-left:50px;"
1658
- placeholder="${obj.placeHolder}"
1659
- onfocus="${obj.gvc.event(() => {
1708
+ class="form-control w-100"
1709
+ style="height: 44px;max-height:100%;padding-left:50px;"
1710
+ placeholder="${obj.placeHolder}"
1711
+ onfocus="${obj.gvc.event(() => {
1660
1712
  gvc.getBindViewElem(id).addClass(`show`);
1661
1713
  refreshData();
1662
1714
  })}"
1663
- onblur="${gvc.event(() => {
1715
+ onblur="${gvc.event(() => {
1664
1716
  setTimeout(() => {
1665
1717
  gvc.getBindViewElem(id).removeClass(`show`);
1666
1718
  }, 300);
1667
1719
  })}"
1668
- oninput="${gvc.event((e) => {
1720
+ oninput="${gvc.event((e) => {
1669
1721
  obj.def = e.value;
1670
1722
  refreshData();
1671
1723
  })}"
1672
- value="${obj.def}"
1673
- onchange="${gvc.event((e) => {
1724
+ value="${obj.def}"
1725
+ onchange="${gvc.event((e) => {
1674
1726
  obj.def = e.value;
1675
1727
  setTimeout(() => {
1676
1728
  obj.callback(obj.def);
@@ -1690,16 +1742,17 @@ ${obj.gvc.bindView(() => {
1690
1742
  return d2.toUpperCase().indexOf(obj.def.toUpperCase()) !== -1;
1691
1743
  })
1692
1744
  .map((d3) => {
1693
- return html ` <button
1694
- class="dropdown-item"
1695
- onclick="${gvc.event(() => {
1745
+ return html `
1746
+ <button
1747
+ class="dropdown-item"
1748
+ onclick="${gvc.event(() => {
1696
1749
  obj.def = d3;
1697
1750
  gvc.notifyDataChange(id2);
1698
1751
  obj.callback(obj.def);
1699
1752
  })}"
1700
- >
1701
- ${d3}
1702
- </button>`;
1753
+ >
1754
+ ${d3}
1755
+ </button>`;
1703
1756
  })
1704
1757
  .join('');
1705
1758
  },
@@ -1718,8 +1771,8 @@ ${obj.gvc.bindView(() => {
1718
1771
  var _a, _b, _c, _d;
1719
1772
  obj.title = (_a = obj.title) !== null && _a !== void 0 ? _a : '';
1720
1773
  return html `${obj.title ? EditorElem.h3(obj.title) : ``}
1721
- <div class="d-flex align-items-center">
1722
- <input
1774
+ <div class="d-flex align-items-center">
1775
+ <input
1723
1776
  class="form-control"
1724
1777
  style="${(_b = obj.style) !== null && _b !== void 0 ? _b : ''}"
1725
1778
  type="${(_c = obj.type) !== null && _c !== void 0 ? _c : 'text'}"
@@ -1739,9 +1792,10 @@ ${obj.gvc.bindView(() => {
1739
1792
  })}"
1740
1793
  value="${(_d = obj.default) !== null && _d !== void 0 ? _d : ''}"
1741
1794
  ${obj.readonly ? `readonly` : ``}
1742
- />
1743
- ${obj.unit ? html ` <div class="p-2">${obj.unit}</div>` : ''}
1744
- </div> `;
1795
+ />
1796
+ ${obj.unit ? html `
1797
+ <div class="p-2">${obj.unit}</div>` : ''}
1798
+ </div> `;
1745
1799
  }
1746
1800
  static container(array) {
1747
1801
  return array.join(`<div class="my-2"></div>`);
@@ -1750,8 +1804,8 @@ ${obj.gvc.bindView(() => {
1750
1804
  const viewId = obj.gvc.glitter.getUUID();
1751
1805
  const def = () => ({ num: obj.default, min: obj.min, max: obj.max });
1752
1806
  return html `${obj.title ? EditorElem.h3(obj.title) : ``}
1753
- <div class="d-flex align-items-center">
1754
- ${obj.gvc.bindView({
1807
+ <div class="d-flex align-items-center">
1808
+ ${obj.gvc.bindView({
1755
1809
  bind: viewId,
1756
1810
  view: () => {
1757
1811
  var _a;
@@ -1768,7 +1822,7 @@ ${obj.gvc.bindView(() => {
1768
1822
  })}"
1769
1823
  value="${obj.default !== undefined ? this.numberInterval(def()) : ''}"
1770
1824
  ${obj.readonly ? `readonly` : ``}
1771
- />`;
1825
+ />`;
1772
1826
  },
1773
1827
  divCreate: { class: 'w-100' },
1774
1828
  onCreate: () => {
@@ -1777,8 +1831,9 @@ ${obj.gvc.bindView(() => {
1777
1831
  }
1778
1832
  },
1779
1833
  })}
1780
- ${obj.unit ? html ` <div class="p-2">${obj.unit}</div>` : ''}
1781
- </div> `;
1834
+ ${obj.unit ? html `
1835
+ <div class="p-2">${obj.unit}</div>` : ''}
1836
+ </div> `;
1782
1837
  }
1783
1838
  static numberInterval(obj) {
1784
1839
  const n = parseInt(`${obj.num}`, 10);
@@ -1820,6 +1875,10 @@ ${obj.gvc.bindView(() => {
1820
1875
 
1821
1876
  <input class="flex-fill ms-2" value="${obj.def}" placeholder="" style="border:none;width:100px;" onclick="${obj.gvc.event((e, event) => {
1822
1877
  document.querySelector(`[gvc-id='${obj.gvc.id(id)}'] .pcr-button`).click();
1878
+ })}" onchange="${obj.gvc.event((e, event) => {
1879
+ obj.callback(e.value);
1880
+ obj.gvc.notifyDataChange(id);
1881
+ document.querySelector('.pcr-app.visible').classList.remove('visible');
1823
1882
  })}">`;
1824
1883
  },
1825
1884
  divCreate: {
@@ -1841,9 +1900,11 @@ ${obj.gvc.bindView(() => {
1841
1900
  padding: 0px !important;
1842
1901
  border: 1px solid #e2e5f1;
1843
1902
  }
1903
+
1844
1904
  .pcr-app {
1845
1905
  z-index: 99999;
1846
1906
  }
1907
+
1847
1908
  .pickr {
1848
1909
  width: 19px !important;
1849
1910
  height: 19px !important;
@@ -1908,13 +1969,13 @@ ${obj.gvc.bindView(() => {
1908
1969
  return html `
1909
1970
  ${obj.title ? EditorElem.h3(obj.title) : ``}
1910
1971
  <select
1911
- class="form-select ${(_a = obj.class) !== null && _a !== void 0 ? _a : ''}"
1912
- style="max-height:100%; ${(_b = obj.style) !== null && _b !== void 0 ? _b : ''};"
1913
- onchange="${obj.gvc.event((e) => {
1972
+ class="form-select ${(_a = obj.class) !== null && _a !== void 0 ? _a : ''}"
1973
+ style="max-height:100%; ${(_b = obj.style) !== null && _b !== void 0 ? _b : ''};"
1974
+ onchange="${obj.gvc.event((e) => {
1914
1975
  obj.callback(e.value);
1915
1976
  })}"
1916
- ${obj.readonly ? `disabled` : ``}
1917
- onclick="${obj.gvc.event((e, event) => {
1977
+ ${obj.readonly ? `disabled` : ``}
1978
+ onclick="${obj.gvc.event((e, event) => {
1918
1979
  if (obj.readonly) {
1919
1980
  event.stopPropagation();
1920
1981
  event.preventDefault();
@@ -1924,10 +1985,13 @@ ${obj.gvc.bindView(() => {
1924
1985
  ${obj.array
1925
1986
  .map((dd) => {
1926
1987
  if (typeof dd === 'object') {
1927
- return html ` <option value="${dd.value}" ${dd.value === obj.def ? `selected` : ``}>${dd.title}</option>`;
1988
+ return html `
1989
+ <option value="${dd.value}" ${dd.value === obj.def ? `selected` : ``}>${dd.title}
1990
+ </option>`;
1928
1991
  }
1929
1992
  else {
1930
- return html ` <option value="${dd}" ${dd === obj.def ? `selected` : ``}>${dd}</option>`;
1993
+ return html `
1994
+ <option value="${dd}" ${dd === obj.def ? `selected` : ``}>${dd}</option>`;
1931
1995
  }
1932
1996
  })
1933
1997
  .join('')}
@@ -1963,9 +2027,9 @@ ${obj.gvc.bindView(() => {
1963
2027
  }
1964
2028
  }
1965
2029
  return html `
1966
- <div
1967
- class="d-flex align-items-center"
1968
- onclick="${obj.gvc.event(() => {
2030
+ <div
2031
+ class="d-flex align-items-center"
2032
+ onclick="${obj.gvc.event(() => {
1969
2033
  if (obj.type === 'multiple') {
1970
2034
  if (obj.def.find((d2) => {
1971
2035
  return d2 === dd.value;
@@ -1985,12 +2049,13 @@ ${obj.gvc.bindView(() => {
1985
2049
  }
1986
2050
  gvc.notifyDataChange(id);
1987
2051
  })}"
1988
- >
1989
- <i class="${isSelect() ? `fa-solid fa-square-check` : `fa-regular fa-square`} me-2" style="${isSelect() ? `color:#295ed1;` : `color:black;`}"></i>
1990
- <span style="font-size:0.85rem;">${dd.title}</span>
1991
- </div>
1992
- ${obj.def === dd.value && dd.innerHtml ? `<div class="mt-1">${dd.innerHtml}</div>` : ``}
1993
- `;
2052
+ >
2053
+ <i class="${isSelect() ? `fa-solid fa-square-check` : `fa-regular fa-square`} me-2"
2054
+ style="${isSelect() ? `color:#295ed1;` : `color:black;`}"></i>
2055
+ <span style="font-size:0.85rem;">${dd.title}</span>
2056
+ </div>
2057
+ ${obj.def === dd.value && dd.innerHtml ? `<div class="mt-1">${dd.innerHtml}</div>` : ``}
2058
+ `;
1994
2059
  })
1995
2060
  .join('<div class="my-2"></div>');
1996
2061
  },
@@ -2008,7 +2073,8 @@ ${obj.gvc.bindView(() => {
2008
2073
  return {
2009
2074
  bind: id,
2010
2075
  view: () => {
2011
- return html `<i class="${obj.def ? `fa-solid fa-square-check` : `fa-regular fa-square`} " style="color: #393939;"></i>`;
2076
+ return html `<i class="${obj.def ? `fa-solid fa-square-check` : `fa-regular fa-square`} "
2077
+ style="color: #393939;"></i>`;
2012
2078
  },
2013
2079
  divCreate: {
2014
2080
  option: [
@@ -2036,7 +2102,8 @@ ${obj.gvc.bindView(() => {
2036
2102
  obj.type = (_a = obj.type) !== null && _a !== void 0 ? _a : 'single';
2037
2103
  const gvc = obj.gvc;
2038
2104
  return html `
2039
- ${obj.title ? html ` <div class="tx_700" style="margin-bottom: 18px">${obj.title}</div>` : ``}
2105
+ ${obj.title ? html `
2106
+ <div class="tx_700" style="margin-bottom: 18px">${obj.title}</div>` : ``}
2040
2107
  ${obj.gvc.bindView(() => {
2041
2108
  const id = obj.gvc.glitter.getUUID();
2042
2109
  return {
@@ -2055,9 +2122,9 @@ ${obj.gvc.bindView(() => {
2055
2122
  }
2056
2123
  }
2057
2124
  return html `
2058
- <div
2059
- class="d-flex align-items-center"
2060
- onclick="${obj.gvc.event(() => {
2125
+ <div
2126
+ class="d-flex align-items-center"
2127
+ onclick="${obj.gvc.event(() => {
2061
2128
  if (obj.readonly) {
2062
2129
  return;
2063
2130
  }
@@ -2080,14 +2147,16 @@ ${obj.gvc.bindView(() => {
2080
2147
  }
2081
2148
  gvc.notifyDataChange(id);
2082
2149
  })}"
2083
- >
2084
- <i class="${isSelect() ? `fa-solid fa-circle-dot` : `fa-regular fa-circle`} me-2" style="color: ${obj.readonly ? '#808080' : '#393939'}"></i>
2085
- <span style="font-size: 16px; cursor: pointer;">${dd.title}</span>
2086
- </div>
2087
- ${obj.def === dd.value && dd.innerHtml ? `<div style="margin-top: 8px;">${dd.innerHtml}</div>` : ``}
2088
- `;
2150
+ >
2151
+ <i class="${isSelect() ? `fa-solid fa-circle-dot` : `fa-regular fa-circle`} me-2"
2152
+ style="color: ${obj.readonly ? '#808080' : '#393939'}"></i>
2153
+ <span style="font-size: 16px; cursor: pointer;">${dd.title}</span>
2154
+ </div>
2155
+ ${obj.def === dd.value && dd.innerHtml ? `<div style="margin-top: 8px;">${dd.innerHtml}</div>` : ``}
2156
+ `;
2089
2157
  })
2090
- .join(html ` <div style="margin-top: 12px;"></div>`);
2158
+ .join(html `
2159
+ <div style="margin-top: 12px;"></div>`);
2091
2160
  },
2092
2161
  divCreate: {
2093
2162
  class: `${obj.oneLine ? 'd-flex gap-2' : ''} ps-1`,
@@ -2097,11 +2166,12 @@ ${obj.gvc.bindView(() => {
2097
2166
  `;
2098
2167
  }
2099
2168
  static editerDialog(par) {
2100
- return html ` <button
2101
- type="button"
2102
- class="btn btn-primary-c w-100"
2103
- style=""
2104
- onclick="${par.gvc.event(() => {
2169
+ return html `
2170
+ <button
2171
+ type="button"
2172
+ class="btn btn-primary-c w-100"
2173
+ style=""
2174
+ onclick="${par.gvc.event(() => {
2105
2175
  const gvc = par.gvc;
2106
2176
  NormalPageEditor.toggle({
2107
2177
  visible: true,
@@ -2114,9 +2184,9 @@ ${obj.gvc.bindView(() => {
2114
2184
  });
2115
2185
  par.callback && (NormalPageEditor.closeEvent = par.callback);
2116
2186
  })}"
2117
- >
2118
- ${par.editTitle}
2119
- </button>`;
2187
+ >
2188
+ ${par.editTitle}
2189
+ </button>`;
2120
2190
  }
2121
2191
  static folderLineItems(obj) {
2122
2192
  const gvc = obj.gvc;
@@ -2127,7 +2197,9 @@ ${obj.gvc.bindView(() => {
2127
2197
  {
2128
2198
  src: `https://raw.githack.com/SortableJS/Sortable/master/Sortable.js`,
2129
2199
  },
2130
- ], () => { }, () => { });
2200
+ ], () => {
2201
+ }, () => {
2202
+ });
2131
2203
  return {
2132
2204
  bind: parId,
2133
2205
  view: () => {
@@ -2145,41 +2217,47 @@ ${obj.gvc.bindView(() => {
2145
2217
  return false;
2146
2218
  };
2147
2219
  const childSelect = dd.type === 'container' ? checkChildSelect(dd.dataList) : false;
2148
- return html ` <li class="btn-group d-flex flex-column" style="margin-top:1px;margin-bottom:1px;">
2149
- <div
2150
- class="editor_item d-flex px-2 my-0 hi me-n1 ${dd.toggle || childSelect || obj.isOptionSelected(dd) ? `active` : ``}"
2151
- style=""
2152
- onclick="${gvc.event(() => {
2220
+ return html `
2221
+ <li class="btn-group d-flex flex-column" style="margin-top:1px;margin-bottom:1px;">
2222
+ <div
2223
+ class="editor_item d-flex px-2 my-0 hi me-n1 ${dd.toggle || childSelect || obj.isOptionSelected(dd) ? `active` : ``}"
2224
+ style=""
2225
+ onclick="${gvc.event(() => {
2153
2226
  if (dd.type === 'container') {
2154
2227
  dd.toggle = !dd.toggle;
2155
2228
  }
2156
2229
  obj.onOptionSelected(dd);
2157
2230
  gvc.notifyDataChange(parId);
2158
2231
  })}"
2159
- >
2160
- ${dd.type === 'container'
2161
- ? html ` <div
2162
- class="subBt ps-0 ms-n2"
2163
- onclick="${gvc.event((e, event) => {
2232
+ >
2233
+ ${dd.type === 'container'
2234
+ ? html `
2235
+ <div
2236
+ class="subBt ps-0 ms-n2"
2237
+ onclick="${gvc.event((e, event) => {
2164
2238
  dd.toggle = !dd.toggle;
2165
2239
  gvc.notifyDataChange(parId);
2166
2240
  event.stopPropagation();
2167
2241
  event.preventDefault();
2168
2242
  })}"
2169
- >
2170
- ${dd.toggle ? html `<i class="fa-regular fa-angle-down hoverBtn "></i>` : html ` <i class="fa-regular fa-angle-right hoverBtn "></i> `}
2171
- </div>`
2243
+ >
2244
+ ${dd.toggle ? html `<i
2245
+ class="fa-regular fa-angle-down hoverBtn "></i>` : html `
2246
+ <i class="fa-regular fa-angle-right hoverBtn "></i> `}
2247
+ </div>`
2172
2248
  : ``}
2173
- ${dd.label}
2174
- <div class="flex-fill"></div>
2175
- </div>
2176
- ${(() => {
2249
+ ${dd.label}
2250
+ <div class="flex-fill"></div>
2251
+ </div>
2252
+ ${(() => {
2177
2253
  if (dd.type !== 'container' || dd.dataList.length === 0) {
2178
2254
  return '';
2179
2255
  }
2180
2256
  else {
2181
- return html ` <div class="${dd.toggle || (dd.toggle === undefined && checkChildSelect(dd.dataList)) ? `` : `d-none`}" style="padding-left:5px;">
2182
- ${this.folderLineItems({
2257
+ return html `
2258
+ <div class="${dd.toggle || (dd.toggle === undefined && checkChildSelect(dd.dataList)) ? `` : `d-none`}"
2259
+ style="padding-left:5px;">
2260
+ ${this.folderLineItems({
2183
2261
  gvc: obj.gvc,
2184
2262
  viewArray: dd.dataList.map((dd, index) => {
2185
2263
  dd.index = index;
@@ -2189,10 +2267,10 @@ ${obj.gvc.bindView(() => {
2189
2267
  isOptionSelected: obj.isOptionSelected,
2190
2268
  onOptionSelected: obj.onOptionSelected,
2191
2269
  })}
2192
- </div>`;
2270
+ </div>`;
2193
2271
  }
2194
2272
  })()}
2195
- </li>`;
2273
+ </li>`;
2196
2274
  })
2197
2275
  .join('');
2198
2276
  },
@@ -2230,7 +2308,8 @@ ${obj.gvc.bindView(() => {
2230
2308
  },
2231
2309
  });
2232
2310
  }
2233
- catch (e) { }
2311
+ catch (e) {
2312
+ }
2234
2313
  clearInterval(interval);
2235
2314
  }
2236
2315
  }, 100);
@@ -2249,7 +2328,9 @@ ${obj.gvc.bindView(() => {
2249
2328
  {
2250
2329
  src: `https://raw.githack.com/SortableJS/Sortable/master/Sortable.js`,
2251
2330
  },
2252
- ], () => { }, () => { });
2331
+ ], () => {
2332
+ }, () => {
2333
+ });
2253
2334
  if (obj.hoverGray) {
2254
2335
  gvc.addStyle(`
2255
2336
  #${parId} :hover :not(.btn-black, .tx_700_white){
@@ -2275,11 +2356,12 @@ ${obj.gvc.bindView(() => {
2275
2356
  event.stopPropagation();
2276
2357
  });
2277
2358
  return html `
2278
- <li class="btn-group" style="margin-top:1px;margin-bottom:1px;${obj.hr ? `border-bottom: 1px solid #f6f6f6; ` : ``};">
2359
+ <li class="btn-group"
2360
+ style="margin-top:1px;margin-bottom:1px;${obj.hr ? `border-bottom: 1px solid #f6f6f6; ` : ``};">
2279
2361
  <div
2280
- class="h-auto align-items-center px-2 my-0 hi me-n1 ${dd.isSelect ? `bgf6 border` : ``}"
2281
- style="cursor: pointer;min-height:36px;width: calc(100% - 10px);display: flex;font-size: 14px;line-height: 20px;font-weight: 500;text-rendering: optimizelegibility;user-select: none;margin: 5px 10px;"
2282
- onclick="${gvc.event(() => {
2362
+ class="h-auto align-items-center px-2 my-0 hi me-n1 ${dd.isSelect ? `bgf6 border` : ``}"
2363
+ style="cursor: pointer;min-height:36px;width: calc(100% - 10px);display: flex;font-size: 14px;line-height: 20px;font-weight: 500;text-rendering: optimizelegibility;user-select: none;margin: 5px 10px;"
2364
+ onclick="${gvc.event(() => {
2283
2365
  if (!dd.innerHtml) {
2284
2366
  return;
2285
2367
  }
@@ -2289,65 +2371,72 @@ ${obj.gvc.bindView(() => {
2289
2371
  else if (original[index]) {
2290
2372
  const originalData = JSON.parse(JSON.stringify(original[index]));
2291
2373
  gvc.glitter.innerDialog((gvc) => {
2292
- return html ` <div
2293
- class="dropdown-menu mx-0 position-fixed pb-0 border p-0 show"
2294
- style="z-index:999999;${dd.width ? `width:${dd.width + ';'}` : ``}"
2295
- onclick="${gvc.event((e, event) => {
2374
+ return html `
2375
+ <div
2376
+ class="dropdown-menu mx-0 position-fixed pb-0 border p-0 show"
2377
+ style="z-index:999999;${dd.width ? `width:${dd.width + ';'}` : ``}"
2378
+ onclick="${gvc.event((e, event) => {
2296
2379
  event.preventDefault();
2297
2380
  event.stopPropagation();
2298
2381
  })}"
2299
- >
2300
- <div class="d-flex align-items-center px-2 border-bottom" style="height:50px;min-width:400px;">
2301
- <h3 style="font-size:15px;font-weight:500;" class="m-0">${dd.editTitle ? dd.editTitle : `編輯項目「${dd.title}」`}</h3>
2302
- <div class="flex-fill"></div>
2303
- <div
2304
- class="hoverBtn p-2"
2305
- data-bs-toggle="dropdown"
2306
- aria-haspopup="true"
2307
- aria-expanded="false"
2308
- style="color:black;font-size:20px;"
2309
- onclick="${gvc.event((e, event) => {
2382
+ >
2383
+ <div class="d-flex align-items-center px-2 border-bottom"
2384
+ style="height:50px;min-width:400px;">
2385
+ <h3 style="font-size:15px;font-weight:500;"
2386
+ class="m-0">
2387
+ ${dd.editTitle ? dd.editTitle : `編輯項目「${dd.title}」`}</h3>
2388
+ <div class="flex-fill"></div>
2389
+ <div
2390
+ class="hoverBtn p-2"
2391
+ data-bs-toggle="dropdown"
2392
+ aria-haspopup="true"
2393
+ aria-expanded="false"
2394
+ style="color:black;font-size:20px;"
2395
+ onclick="${gvc.event((e, event) => {
2310
2396
  original[index] = originalData;
2311
2397
  gvc.closeDialog();
2312
2398
  obj.refreshComponent();
2313
2399
  })}"
2314
- >
2315
- <i class="fa-sharp fa-regular fa-circle-xmark"></i>
2316
- </div>
2317
- </div>
2318
- <div class="px-2" style="max-height:calc(100vh - 150px);overflow-y:auto;">${dd.innerHtml(gvc)}</div>
2319
- <div class="d-flex w-100 p-2 border-top ${dd.saveAble === false ? `d-none` : ``}">
2320
- <div class="flex-fill"></div>
2321
- <div
2322
- class="btn btn-secondary"
2323
- style="height:40px;width:80px;"
2324
- onclick="${gvc.event(() => {
2400
+ >
2401
+ <i class="fa-sharp fa-regular fa-circle-xmark"></i>
2402
+ </div>
2403
+ </div>
2404
+ <div class="px-2"
2405
+ style="max-height:calc(100vh - 150px);overflow-y:auto;">
2406
+ ${dd.innerHtml(gvc)}
2407
+ </div>
2408
+ <div class="d-flex w-100 p-2 border-top ${dd.saveAble === false ? `d-none` : ``}">
2409
+ <div class="flex-fill"></div>
2410
+ <div
2411
+ class="btn btn-secondary"
2412
+ style="height:40px;width:80px;"
2413
+ onclick="${gvc.event(() => {
2325
2414
  original[index] = originalData;
2326
2415
  gvc.closeDialog();
2327
2416
  obj.refreshComponent();
2328
2417
  })}"
2329
- >
2330
- 取消
2331
- </div>
2332
- <div
2333
- class="btn btn-primary-c ms-2"
2334
- style="height:40px;width:80px;"
2335
- onclick="${gvc.event(() => {
2418
+ >
2419
+ 取消
2420
+ </div>
2421
+ <div
2422
+ class="btn btn-primary-c ms-2"
2423
+ style="height:40px;width:80px;"
2424
+ onclick="${gvc.event(() => {
2336
2425
  gvc.closeDialog();
2337
2426
  (dd.saveEvent && dd.saveEvent()) || obj.refreshComponent();
2338
2427
  })}"
2339
- >
2340
- <i class="fa-solid fa-floppy-disk me-2"></i>儲存
2341
- </div>
2342
- </div>
2343
- </div>`;
2428
+ >
2429
+ <i class="fa-solid fa-floppy-disk me-2"></i>儲存
2430
+ </div>
2431
+ </div>
2432
+ </div>`;
2344
2433
  }, glitter.getUUID());
2345
2434
  }
2346
2435
  })}"
2347
2436
  >
2348
2437
  <div
2349
- class="subBt ms-n2 ${obj.minus === false ? `d-none` : ``}"
2350
- onclick="${gvc.event((e, event) => {
2438
+ class="subBt ms-n2 ${obj.minus === false ? `d-none` : ``}"
2439
+ onclick="${gvc.event((e, event) => {
2351
2440
  if (obj.minusEvent) {
2352
2441
  obj.minusEvent(obj.originalArray, index);
2353
2442
  }
@@ -2359,12 +2448,13 @@ ${obj.gvc.bindView(() => {
2359
2448
  event.stopPropagation();
2360
2449
  })}"
2361
2450
  >
2362
- <i class="fa-regular fa-circle-minus d-flex align-items-center justify-content-center subBt " style="width:15px;height:15px;color:red;"></i>
2451
+ <i class="fa-regular fa-circle-minus d-flex align-items-center justify-content-center subBt "
2452
+ style="width:15px;height:15px;color:red;"></i>
2363
2453
  </div>
2364
2454
  <div class="subBt ${obj.draggable === false || dd.draggable === false ? `d-none` : ``} ${obj.position ? `` : `d-none`}">
2365
2455
  <i
2366
- class="dragItem fa-solid fa-grip-dots-vertical d-flex align-items-center justify-content-center "
2367
- style="width:15px;height:15px;padding-right: 14px;"
2456
+ class="dragItem fa-solid fa-grip-dots-vertical d-flex align-items-center justify-content-center "
2457
+ style="width:15px;height:15px;padding-right: 14px;"
2368
2458
  ></i>
2369
2459
  </div>
2370
2460
  ${dd.title}
@@ -2382,10 +2472,11 @@ ${obj.gvc.bindView(() => {
2382
2472
  obj.refreshComponent();
2383
2473
  }
2384
2474
  let toggle = false;
2385
- return html ` <div
2386
- class="btn-group dropend subBt"
2387
- style="position: relative;"
2388
- onclick="${gvc.event((e, event) => {
2475
+ return html `
2476
+ <div
2477
+ class="btn-group dropend subBt"
2478
+ style="position: relative;"
2479
+ onclick="${gvc.event((e, event) => {
2389
2480
  toggle = !toggle;
2390
2481
  if (toggle) {
2391
2482
  $(e).children('.bt').dropdown('show');
@@ -2396,48 +2487,51 @@ ${obj.gvc.bindView(() => {
2396
2487
  }
2397
2488
  event.stopPropagation();
2398
2489
  })}"
2399
- >
2400
- <div type="button" class="bt" style="background:none;" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
2401
- <i class="fa-sharp fa-regular fa-scissors"></i>
2402
- </div>
2403
- <div
2404
- class="dropdown-menu mx-1 "
2405
- style="height: 135px;"
2406
- onclick="${gvc.event((e, event) => {
2490
+ >
2491
+ <div type="button" class="bt" style="background:none;"
2492
+ data-bs-toggle="dropdown" aria-haspopup="true"
2493
+ aria-expanded="false">
2494
+ <i class="fa-sharp fa-regular fa-scissors"></i>
2495
+ </div>
2496
+ <div
2497
+ class="dropdown-menu mx-1 "
2498
+ style="height: 135px;"
2499
+ onclick="${gvc.event((e, event) => {
2407
2500
  toggle = false;
2408
2501
  event.stopPropagation();
2409
2502
  })}"
2410
- >
2411
- <a
2412
- class="dropdown-item"
2413
- onclick="${gvc.event((e, event) => {
2503
+ >
2504
+ <a
2505
+ class="dropdown-item"
2506
+ onclick="${gvc.event((e, event) => {
2414
2507
  addIt(0, event);
2415
2508
  })}"
2416
2509
  >向上複製</a
2417
- >
2418
- <hr class="dropdown-divider" />
2419
- <a
2420
- class="dropdown-item"
2421
- onclick="${gvc.event((e, event) => {
2510
+ >
2511
+ <hr class="dropdown-divider"/>
2512
+ <a
2513
+ class="dropdown-item"
2514
+ onclick="${gvc.event((e, event) => {
2422
2515
  $(e).parent().parent().children('.bt').dropdown('hide');
2423
2516
  navigator.clipboard.writeText(JSON.stringify(original[index]));
2424
2517
  })}"
2425
2518
  >複製到剪貼簿</a
2426
- >
2427
- <hr class="dropdown-divider" />
2428
- <a
2429
- class="dropdown-item"
2430
- onclick="${gvc.event((e, event) => {
2519
+ >
2520
+ <hr class="dropdown-divider"/>
2521
+ <a
2522
+ class="dropdown-item"
2523
+ onclick="${gvc.event((e, event) => {
2431
2524
  $(e).parent().parent().children('.bt').dropdown('hide');
2432
2525
  addIt(1, event);
2433
2526
  })}"
2434
2527
  >向下複製</a
2435
- >
2436
- </div>
2437
- </div>`;
2528
+ >
2529
+ </div>
2530
+ </div>`;
2438
2531
  })()}
2439
2532
  <div class="dragItem subBt ${obj.draggable === false || dd.draggable === false ? `d-none` : ``} ${obj.position ? `d-none` : ``}">
2440
- <i class="fa-solid fa-grip-dots-vertical d-flex align-items-center justify-content-center " style="width:15px;height:15px;"></i>
2533
+ <i class="fa-solid fa-grip-dots-vertical d-flex align-items-center justify-content-center "
2534
+ style="width:15px;height:15px;"></i>
2441
2535
  </div>
2442
2536
  </div>
2443
2537
  </li>
@@ -2471,7 +2565,8 @@ ${obj.gvc.bindView(() => {
2471
2565
  group: obj.gvc.glitter.getUUID(),
2472
2566
  animation: 100,
2473
2567
  handle: '.dragItem',
2474
- onChange: function (evt) { },
2568
+ onChange: function (evt) {
2569
+ },
2475
2570
  onStart: function (evt) {
2476
2571
  startIndex = evt.oldIndex;
2477
2572
  },
@@ -2481,7 +2576,8 @@ ${obj.gvc.bindView(() => {
2481
2576
  },
2482
2577
  });
2483
2578
  }
2484
- catch (e) { }
2579
+ catch (e) {
2580
+ }
2485
2581
  clearInterval(interval);
2486
2582
  }
2487
2583
  }, 100);
@@ -2490,22 +2586,27 @@ ${obj.gvc.bindView(() => {
2490
2586
  };
2491
2587
  }) +
2492
2588
  (obj.plus
2493
- ? html ` <div class="btn-group mt-2 ps-1 pe-2 w-100 border-bottom pb-2 align-items-center">
2494
- <div class="btn-outline-secondary-c btn ms-2 " style="height:30px;flex:1;" onclick="${obj.plus.event}"><i class="fa-regular fa-circle-plus me-2"></i>${obj.plus.title}</div>
2495
- ${(() => {
2589
+ ? html `
2590
+ <div class="btn-group mt-2 ps-1 pe-2 w-100 border-bottom pb-2 align-items-center">
2591
+ <div class="btn-outline-secondary-c btn ms-2 " style="height:30px;flex:1;"
2592
+ onclick="${obj.plus.event}"><i
2593
+ class="fa-regular fa-circle-plus me-2"></i>${obj.plus.title}
2594
+ </div>
2595
+ ${(() => {
2496
2596
  if (obj.copyable === false) {
2497
2597
  return ``;
2498
2598
  }
2499
2599
  let interval = undefined;
2500
- return html ` <div
2501
- type="button"
2502
- class="bt ms-1"
2503
- style="background:none;"
2504
- data-bs-toggle="dropdown"
2505
- aria-haspopup="true"
2506
- data-placement="right"
2507
- aria-expanded="false"
2508
- onclick="${gvc.event(() => {
2600
+ return html `
2601
+ <div
2602
+ type="button"
2603
+ class="bt ms-1"
2604
+ style="background:none;"
2605
+ data-bs-toggle="dropdown"
2606
+ aria-haspopup="true"
2607
+ data-placement="right"
2608
+ aria-expanded="false"
2609
+ onclick="${gvc.event(() => {
2509
2610
  function readClipboardContent() {
2510
2611
  return __awaiter(this, void 0, void 0, function* () {
2511
2612
  try {
@@ -2534,33 +2635,35 @@ ${obj.gvc.bindView(() => {
2534
2635
  }
2535
2636
  readClipboardContent();
2536
2637
  })}"
2537
- >
2538
- <i class="fa-regular fa-paste"></i>
2539
- </div>`;
2638
+ >
2639
+ <i class="fa-regular fa-paste"></i>
2640
+ </div>`;
2540
2641
  })()}
2541
- </div>`
2642
+ </div>`
2542
2643
  : ``));
2543
2644
  }
2544
2645
  return ((obj.title
2545
- ? html ` <div class="d-flex px-2 hi fw-bold d-flex align-items-center border-bottom py-2 border-top bgf6" style="color:#151515;font-size:16px;gap:0px;height:48px;">
2546
- ${obj.title}
2547
- <div class="flex-fill"></div>
2548
- ${obj.copyable !== false
2646
+ ? html `
2647
+ <div class="d-flex px-2 hi fw-bold d-flex align-items-center border-bottom py-2 border-top bgf6"
2648
+ style="color:#151515;font-size:16px;gap:0px;height:48px;">
2649
+ ${obj.title}
2650
+ <div class="flex-fill"></div>
2651
+ ${obj.copyable !== false
2549
2652
  ? html `
2550
- <div
2551
- class="d-flex align-items-center justify-content-center hoverBtn me-2 border"
2552
- style="height:30px;width:30px;border-radius:6px;cursor:pointer;color:#151515;"
2553
- onclick="${gvc.event(() => {
2653
+ <div
2654
+ class="d-flex align-items-center justify-content-center hoverBtn me-2 border"
2655
+ style="height:30px;width:30px;border-radius:6px;cursor:pointer;color:#151515;"
2656
+ onclick="${gvc.event(() => {
2554
2657
  navigator.clipboard.writeText(JSON.stringify(obj.originalArray));
2555
2658
  const dialog = new ShareDialog(gvc.glitter);
2556
2659
  dialog.successMessage({ text: '已複製至剪貼簿!' });
2557
2660
  })}"
2558
- >
2559
- <i class="fa-sharp fa-regular fa-scissors" aria-hidden="true"></i>
2560
- </div>
2561
- `
2661
+ >
2662
+ <i class="fa-sharp fa-regular fa-scissors" aria-hidden="true"></i>
2663
+ </div>
2664
+ `
2562
2665
  : ``}
2563
- </div>`
2666
+ </div>`
2564
2667
  : ``) +
2565
2668
  gvc.bindView(() => {
2566
2669
  return {
@@ -2585,7 +2688,9 @@ ${obj.gvc.bindView(() => {
2585
2688
  {
2586
2689
  src: `https://raw.githack.com/SortableJS/Sortable/master/Sortable.js`,
2587
2690
  },
2588
- ], () => { }, () => { });
2691
+ ], () => {
2692
+ }, () => {
2693
+ });
2589
2694
  if (obj.hoverGray) {
2590
2695
  gvc.addStyle(`
2591
2696
  #${parId} :hover :not(.btn-black, .tx_700_white){
@@ -2611,11 +2716,12 @@ ${obj.gvc.bindView(() => {
2611
2716
  event.stopPropagation();
2612
2717
  });
2613
2718
  return html `
2614
- <li class="btn-group" style="margin-top:1px;margin-bottom:1px;${obj.hr ? `border-bottom: 1px solid #f6f6f6; ` : ``};">
2719
+ <li class="btn-group"
2720
+ style="margin-top:1px;margin-bottom:1px;${obj.hr ? `border-bottom: 1px solid #f6f6f6; ` : ``};">
2615
2721
  <div
2616
- class="h-auto align-items-center px-2 my-0 hi me-n1 ${dd.isSelect ? `bgf6 border` : ``}"
2617
- style="cursor: pointer;min-height:36px;width: calc(100% - 10px);display: flex;font-size: 14px;line-height: 20px;font-weight: 500;text-rendering: optimizelegibility;user-select: none;margin: 5px 10px;"
2618
- onclick="${gvc.event(() => {
2722
+ class="h-auto align-items-center px-2 my-0 hi me-n1 ${dd.isSelect ? `bgf6 border` : ``}"
2723
+ style="cursor: pointer;min-height:36px;width: calc(100% - 10px);display: flex;font-size: 14px;line-height: 20px;font-weight: 500;text-rendering: optimizelegibility;user-select: none;margin: 5px 10px;"
2724
+ onclick="${gvc.event(() => {
2619
2725
  if (!dd.innerHtml) {
2620
2726
  return;
2621
2727
  }
@@ -2625,65 +2731,72 @@ ${obj.gvc.bindView(() => {
2625
2731
  else if (original[index]) {
2626
2732
  const originalData = JSON.parse(JSON.stringify(original[index]));
2627
2733
  gvc.glitter.innerDialog((gvc) => {
2628
- return html ` <div
2629
- class="dropdown-menu mx-0 position-fixed pb-0 border p-0 show"
2630
- style="z-index:999999;${dd.width ? `width:${dd.width + ';'}` : ``}"
2631
- onclick="${gvc.event((e, event) => {
2734
+ return html `
2735
+ <div
2736
+ class="dropdown-menu mx-0 position-fixed pb-0 border p-0 show"
2737
+ style="z-index:999999;${dd.width ? `width:${dd.width + ';'}` : ``}"
2738
+ onclick="${gvc.event((e, event) => {
2632
2739
  event.preventDefault();
2633
2740
  event.stopPropagation();
2634
2741
  })}"
2635
- >
2636
- <div class="d-flex align-items-center px-2 border-bottom" style="height:50px;min-width:400px;">
2637
- <h3 style="font-size:15px;font-weight:500;" class="m-0">${dd.editTitle ? dd.editTitle : `編輯項目「${dd.title}」`}</h3>
2638
- <div class="flex-fill"></div>
2639
- <div
2640
- class="hoverBtn p-2"
2641
- data-bs-toggle="dropdown"
2642
- aria-haspopup="true"
2643
- aria-expanded="false"
2644
- style="color:black;font-size:20px;"
2645
- onclick="${gvc.event((e, event) => {
2742
+ >
2743
+ <div class="d-flex align-items-center px-2 border-bottom"
2744
+ style="height:50px;min-width:400px;">
2745
+ <h3 style="font-size:15px;font-weight:500;"
2746
+ class="m-0">
2747
+ ${dd.editTitle ? dd.editTitle : `編輯項目「${dd.title}」`}</h3>
2748
+ <div class="flex-fill"></div>
2749
+ <div
2750
+ class="hoverBtn p-2"
2751
+ data-bs-toggle="dropdown"
2752
+ aria-haspopup="true"
2753
+ aria-expanded="false"
2754
+ style="color:black;font-size:20px;"
2755
+ onclick="${gvc.event((e, event) => {
2646
2756
  original[index] = originalData;
2647
2757
  gvc.closeDialog();
2648
2758
  obj.refreshComponent();
2649
2759
  })}"
2650
- >
2651
- <i class="fa-sharp fa-regular fa-circle-xmark"></i>
2652
- </div>
2653
- </div>
2654
- <div class="px-2" style="max-height:calc(100vh - 150px);overflow-y:auto;">${dd.innerHtml(gvc)}</div>
2655
- <div class="d-flex w-100 p-2 border-top ${dd.saveAble === false ? `d-none` : ``}">
2656
- <div class="flex-fill"></div>
2657
- <div
2658
- class="btn btn-secondary"
2659
- style="height:40px;width:80px;"
2660
- onclick="${gvc.event(() => {
2760
+ >
2761
+ <i class="fa-sharp fa-regular fa-circle-xmark"></i>
2762
+ </div>
2763
+ </div>
2764
+ <div class="px-2"
2765
+ style="max-height:calc(100vh - 150px);overflow-y:auto;">
2766
+ ${dd.innerHtml(gvc)}
2767
+ </div>
2768
+ <div class="d-flex w-100 p-2 border-top ${dd.saveAble === false ? `d-none` : ``}">
2769
+ <div class="flex-fill"></div>
2770
+ <div
2771
+ class="btn btn-secondary"
2772
+ style="height:40px;width:80px;"
2773
+ onclick="${gvc.event(() => {
2661
2774
  original[index] = originalData;
2662
2775
  gvc.closeDialog();
2663
2776
  obj.refreshComponent();
2664
2777
  })}"
2665
- >
2666
- 取消
2667
- </div>
2668
- <div
2669
- class="btn btn-primary-c ms-2"
2670
- style="height:40px;width:80px;"
2671
- onclick="${gvc.event(() => {
2778
+ >
2779
+ 取消
2780
+ </div>
2781
+ <div
2782
+ class="btn btn-primary-c ms-2"
2783
+ style="height:40px;width:80px;"
2784
+ onclick="${gvc.event(() => {
2672
2785
  gvc.closeDialog();
2673
2786
  (dd.saveEvent && dd.saveEvent()) || obj.refreshComponent();
2674
2787
  })}"
2675
- >
2676
- <i class="fa-solid fa-floppy-disk me-2"></i>儲存
2677
- </div>
2678
- </div>
2679
- </div>`;
2788
+ >
2789
+ <i class="fa-solid fa-floppy-disk me-2"></i>儲存
2790
+ </div>
2791
+ </div>
2792
+ </div>`;
2680
2793
  }, glitter.getUUID());
2681
2794
  }
2682
2795
  })}"
2683
2796
  >
2684
2797
  <div
2685
- class="subBt ms-n2 ${obj.minus === false ? `d-none` : ``}"
2686
- onclick="${gvc.event((e, event) => {
2798
+ class="subBt ms-n2 ${obj.minus === false ? `d-none` : ``}"
2799
+ onclick="${gvc.event((e, event) => {
2687
2800
  if (obj.minusEvent) {
2688
2801
  obj.minusEvent(obj.originalArray, index);
2689
2802
  }
@@ -2695,12 +2808,13 @@ ${obj.gvc.bindView(() => {
2695
2808
  event.stopPropagation();
2696
2809
  })}"
2697
2810
  >
2698
- <i class="fa-regular fa-circle-minus d-flex align-items-center justify-content-center subBt " style="width:15px;height:15px;color:red;"></i>
2811
+ <i class="fa-regular fa-circle-minus d-flex align-items-center justify-content-center subBt "
2812
+ style="width:15px;height:15px;color:red;"></i>
2699
2813
  </div>
2700
2814
  <div class="subBt ${obj.draggable === false || dd.draggable === false ? `d-none` : ``} ${obj.position ? `` : `d-none`}">
2701
2815
  <i
2702
- class="dragItem fa-solid fa-grip-dots-vertical d-flex align-items-center justify-content-center "
2703
- style="width:15px;height:15px;padding-right: 14px;"
2816
+ class="dragItem fa-solid fa-grip-dots-vertical d-flex align-items-center justify-content-center "
2817
+ style="width:15px;height:15px;padding-right: 14px;"
2704
2818
  ></i>
2705
2819
  </div>
2706
2820
  ${dd.title}
@@ -2718,10 +2832,11 @@ ${obj.gvc.bindView(() => {
2718
2832
  obj.refreshComponent();
2719
2833
  }
2720
2834
  let toggle = false;
2721
- return html ` <div
2722
- class="btn-group dropend subBt"
2723
- style="position: relative;"
2724
- onclick="${gvc.event((e, event) => {
2835
+ return html `
2836
+ <div
2837
+ class="btn-group dropend subBt"
2838
+ style="position: relative;"
2839
+ onclick="${gvc.event((e, event) => {
2725
2840
  toggle = !toggle;
2726
2841
  if (toggle) {
2727
2842
  $(e).children('.bt').dropdown('show');
@@ -2732,48 +2847,51 @@ ${obj.gvc.bindView(() => {
2732
2847
  }
2733
2848
  event.stopPropagation();
2734
2849
  })}"
2735
- >
2736
- <div type="button" class="bt" style="background:none;" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
2737
- <i class="fa-sharp fa-regular fa-scissors"></i>
2738
- </div>
2739
- <div
2740
- class="dropdown-menu mx-1 "
2741
- style="height: 135px;"
2742
- onclick="${gvc.event((e, event) => {
2850
+ >
2851
+ <div type="button" class="bt" style="background:none;"
2852
+ data-bs-toggle="dropdown" aria-haspopup="true"
2853
+ aria-expanded="false">
2854
+ <i class="fa-sharp fa-regular fa-scissors"></i>
2855
+ </div>
2856
+ <div
2857
+ class="dropdown-menu mx-1 "
2858
+ style="height: 135px;"
2859
+ onclick="${gvc.event((e, event) => {
2743
2860
  toggle = false;
2744
2861
  event.stopPropagation();
2745
2862
  })}"
2746
- >
2747
- <a
2748
- class="dropdown-item"
2749
- onclick="${gvc.event((e, event) => {
2863
+ >
2864
+ <a
2865
+ class="dropdown-item"
2866
+ onclick="${gvc.event((e, event) => {
2750
2867
  addIt(0, event);
2751
2868
  })}"
2752
2869
  >向上複製</a
2753
- >
2754
- <hr class="dropdown-divider" />
2755
- <a
2756
- class="dropdown-item"
2757
- onclick="${gvc.event((e, event) => {
2870
+ >
2871
+ <hr class="dropdown-divider"/>
2872
+ <a
2873
+ class="dropdown-item"
2874
+ onclick="${gvc.event((e, event) => {
2758
2875
  $(e).parent().parent().children('.bt').dropdown('hide');
2759
2876
  navigator.clipboard.writeText(JSON.stringify(original[index]));
2760
2877
  })}"
2761
2878
  >複製到剪貼簿</a
2762
- >
2763
- <hr class="dropdown-divider" />
2764
- <a
2765
- class="dropdown-item"
2766
- onclick="${gvc.event((e, event) => {
2879
+ >
2880
+ <hr class="dropdown-divider"/>
2881
+ <a
2882
+ class="dropdown-item"
2883
+ onclick="${gvc.event((e, event) => {
2767
2884
  $(e).parent().parent().children('.bt').dropdown('hide');
2768
2885
  addIt(1, event);
2769
2886
  })}"
2770
2887
  >向下複製</a
2771
- >
2772
- </div>
2773
- </div>`;
2888
+ >
2889
+ </div>
2890
+ </div>`;
2774
2891
  })()}
2775
2892
  <div class="dragItem subBt ${obj.draggable === false || dd.draggable === false ? `d-none` : ``} ${obj.position ? `d-none` : ``}">
2776
- <i class="fa-solid fa-grip-dots-vertical d-flex align-items-center justify-content-center " style="width:15px;height:15px;"></i>
2893
+ <i class="fa-solid fa-grip-dots-vertical d-flex align-items-center justify-content-center "
2894
+ style="width:15px;height:15px;"></i>
2777
2895
  </div>
2778
2896
  </div>
2779
2897
  </li>
@@ -2807,7 +2925,8 @@ ${obj.gvc.bindView(() => {
2807
2925
  group: obj.gvc.glitter.getUUID(),
2808
2926
  animation: 100,
2809
2927
  handle: '.dragItem',
2810
- onChange: function (evt) { },
2928
+ onChange: function (evt) {
2929
+ },
2811
2930
  onStart: function (evt) {
2812
2931
  startIndex = evt.oldIndex;
2813
2932
  },
@@ -2817,7 +2936,8 @@ ${obj.gvc.bindView(() => {
2817
2936
  },
2818
2937
  });
2819
2938
  }
2820
- catch (e) { }
2939
+ catch (e) {
2940
+ }
2821
2941
  clearInterval(interval);
2822
2942
  }
2823
2943
  }, 100);
@@ -2826,22 +2946,27 @@ ${obj.gvc.bindView(() => {
2826
2946
  };
2827
2947
  }) +
2828
2948
  (obj.plus
2829
- ? html ` <div class="btn-group mt-2 ps-1 pe-2 w-100 border-bottom pb-2 align-items-center">
2830
- <div class="btn-outline-secondary-c btn ms-2 " style="height:30px;flex:1;" onclick="${obj.plus.event}"><i class="fa-regular fa-circle-plus me-2"></i>${obj.plus.title}</div>
2831
- ${(() => {
2949
+ ? html `
2950
+ <div class="btn-group mt-2 ps-1 pe-2 w-100 border-bottom pb-2 align-items-center">
2951
+ <div class="btn-outline-secondary-c btn ms-2 " style="height:30px;flex:1;"
2952
+ onclick="${obj.plus.event}"><i
2953
+ class="fa-regular fa-circle-plus me-2"></i>${obj.plus.title}
2954
+ </div>
2955
+ ${(() => {
2832
2956
  if (obj.copyable === false) {
2833
2957
  return ``;
2834
2958
  }
2835
2959
  let interval = undefined;
2836
- return html ` <div
2837
- type="button"
2838
- class="bt ms-1"
2839
- style="background:none;"
2840
- data-bs-toggle="dropdown"
2841
- aria-haspopup="true"
2842
- data-placement="right"
2843
- aria-expanded="false"
2844
- onclick="${gvc.event(() => {
2960
+ return html `
2961
+ <div
2962
+ type="button"
2963
+ class="bt ms-1"
2964
+ style="background:none;"
2965
+ data-bs-toggle="dropdown"
2966
+ aria-haspopup="true"
2967
+ data-placement="right"
2968
+ aria-expanded="false"
2969
+ onclick="${gvc.event(() => {
2845
2970
  function readClipboardContent() {
2846
2971
  return __awaiter(this, void 0, void 0, function* () {
2847
2972
  try {
@@ -2870,33 +2995,35 @@ ${obj.gvc.bindView(() => {
2870
2995
  }
2871
2996
  readClipboardContent();
2872
2997
  })}"
2873
- >
2874
- <i class="fa-regular fa-paste"></i>
2875
- </div>`;
2998
+ >
2999
+ <i class="fa-regular fa-paste"></i>
3000
+ </div>`;
2876
3001
  })()}
2877
- </div>`
3002
+ </div>`
2878
3003
  : ``));
2879
3004
  }
2880
3005
  return ((obj.title
2881
- ? html ` <div class="d-flex px-2 hi fw-bold d-flex align-items-center border-bottom py-2 border-top bgf6" style="color:#151515;font-size:16px;gap:0px;height:48px;">
2882
- ${obj.title}
2883
- <div class="flex-fill"></div>
2884
- ${obj.copyable !== false
3006
+ ? html `
3007
+ <div class="d-flex px-2 hi fw-bold d-flex align-items-center border-bottom py-2 border-top bgf6"
3008
+ style="color:#151515;font-size:16px;gap:0px;height:48px;">
3009
+ ${obj.title}
3010
+ <div class="flex-fill"></div>
3011
+ ${obj.copyable !== false
2885
3012
  ? html `
2886
- <div
2887
- class="d-flex align-items-center justify-content-center hoverBtn me-2 border"
2888
- style="height:30px;width:30px;border-radius:6px;cursor:pointer;color:#151515;"
2889
- onclick="${gvc.event(() => {
3013
+ <div
3014
+ class="d-flex align-items-center justify-content-center hoverBtn me-2 border"
3015
+ style="height:30px;width:30px;border-radius:6px;cursor:pointer;color:#151515;"
3016
+ onclick="${gvc.event(() => {
2890
3017
  navigator.clipboard.writeText(JSON.stringify(obj.originalArray));
2891
3018
  const dialog = new ShareDialog(gvc.glitter);
2892
3019
  dialog.successMessage({ text: '已複製至剪貼簿!' });
2893
3020
  })}"
2894
- >
2895
- <i class="fa-sharp fa-regular fa-scissors" aria-hidden="true"></i>
2896
- </div>
2897
- `
3021
+ >
3022
+ <i class="fa-sharp fa-regular fa-scissors" aria-hidden="true"></i>
3023
+ </div>
3024
+ `
2898
3025
  : ``}
2899
- </div>`
3026
+ </div>`
2900
3027
  : ``) +
2901
3028
  gvc.bindView(() => {
2902
3029
  return {
@@ -2911,41 +3038,46 @@ ${obj.gvc.bindView(() => {
2911
3038
  }));
2912
3039
  }
2913
3040
  static buttonPrimary(title, event) {
2914
- return html ` <button type="button" class="btn btn-primary-c w-100" onclick="${event}">${title}</button>`;
3041
+ return html `
3042
+ <button type="button" class="btn btn-primary-c w-100" onclick="${event}">${title}</button>`;
2915
3043
  }
2916
3044
  static buttonNormal(title, event) {
2917
- return html ` <button type="button" class="btn w-100" style="background:white;width:calc(100%);border-radius:8px;min-height:45px;border:1px solid black;color:#151515;" onclick="${event}">
2918
- ${title}
2919
- </button>`;
3045
+ return html `
3046
+ <button type="button" class="btn w-100"
3047
+ style="background:white;width:calc(100%);border-radius:8px;min-height:45px;border:1px solid black;color:#151515;"
3048
+ onclick="${event}">
3049
+ ${title}
3050
+ </button>`;
2920
3051
  }
2921
3052
  static openEditorDialog(gvc, inner, close, width, title, tag) {
2922
3053
  return gvc.glitter.innerDialog((gvc) => {
2923
- return html ` <div
2924
- class="dropdown-menu mx-0 position-fixed pb-0 border p-0 show "
2925
- style="z-index:999999;max-height: calc(100vh - 20px);"
2926
- onclick="${gvc.event((e, event) => {
3054
+ return html `
3055
+ <div
3056
+ class="dropdown-menu mx-0 position-fixed pb-0 border p-0 show "
3057
+ style="z-index:999999;max-height: calc(100vh - 20px);"
3058
+ onclick="${gvc.event((e, event) => {
2927
3059
  event.preventDefault();
2928
3060
  event.stopPropagation();
2929
3061
  })}"
2930
- >
2931
- <div
2932
- class="d-flex align-items-center px-2 border-bottom"
2933
- style="height:50px;width: ${width ||
3062
+ >
3063
+ <div
3064
+ class="d-flex align-items-center px-2 border-bottom"
3065
+ style="height:50px;width: ${width ||
2934
3066
  gvc.glitter.ut.frSize({
2935
3067
  1400: 1200,
2936
3068
  1600: 1400,
2937
3069
  1900: 1600,
2938
3070
  }, '1200')}px;"
2939
- >
2940
- <h3 style="font-size:15px;font-weight:500;" class="m-0">${title !== null && title !== void 0 ? title : `代碼編輯`}</h3>
2941
- <div class="flex-fill"></div>
2942
- <div
2943
- class="hoverBtn p-2"
2944
- data-bs-toggle="dropdown"
2945
- aria-haspopup="true"
2946
- aria-expanded="false"
2947
- style="color:black;font-size:20px;"
2948
- onclick="${gvc.event((e, event) => __awaiter(this, void 0, void 0, function* () {
3071
+ >
3072
+ <h3 style="font-size:15px;font-weight:500;" class="m-0">${title !== null && title !== void 0 ? title : `代碼編輯`}</h3>
3073
+ <div class="flex-fill"></div>
3074
+ <div
3075
+ class="hoverBtn p-2"
3076
+ data-bs-toggle="dropdown"
3077
+ aria-haspopup="true"
3078
+ aria-expanded="false"
3079
+ style="color:black;font-size:20px;"
3080
+ onclick="${gvc.event((e, event) => __awaiter(this, void 0, void 0, function* () {
2949
3081
  let wait_promise = close();
2950
3082
  if (wait_promise && wait_promise.then) {
2951
3083
  wait_promise = yield wait_promise;
@@ -2954,61 +3086,63 @@ ${obj.gvc.bindView(() => {
2954
3086
  gvc.closeDialog();
2955
3087
  }
2956
3088
  }))}"
2957
- >
2958
- <i class="fa-sharp fa-regular fa-circle-xmark"></i>
3089
+ >
3090
+ <i class="fa-sharp fa-regular fa-circle-xmark"></i>
3091
+ </div>
2959
3092
  </div>
2960
- </div>
2961
- <div
2962
- class=""
2963
- style="max-height:calc(100vh - 150px);overflow-y:auto;width: ${width ||
3093
+ <div
3094
+ class=""
3095
+ style="max-height:calc(100vh - 150px);overflow-y:auto;width: ${width ||
2964
3096
  gvc.glitter.ut.frSize({
2965
3097
  1400: 1200,
2966
3098
  1600: 1400,
2967
3099
  1900: 1600,
2968
3100
  }, '1200')}px;"
2969
- >
2970
- ${inner(gvc)}
2971
- </div>
2972
- </div>`;
3101
+ >
3102
+ ${inner(gvc)}
3103
+ </div>
3104
+ </div>`;
2973
3105
  }, tag !== null && tag !== void 0 ? tag : gvc.glitter.getUUID());
2974
3106
  }
2975
3107
  static btnGroup(obj) {
2976
3108
  var _a, _b;
2977
3109
  const gvc = obj.gvc;
2978
3110
  let interval = undefined;
2979
- return html ` <div class="position-relative btn-group dropend subBt my-auto ms-1 ${(_a = obj.classS) !== null && _a !== void 0 ? _a : ''}" style="${(_b = obj.style) !== null && _b !== void 0 ? _b : ''}">
2980
- <div
2981
- type="button"
2982
- class="bt"
2983
- style="background:none;"
2984
- data-bs-toggle="dropdown"
2985
- aria-haspopup="true"
2986
- data-placement="left"
2987
- aria-expanded="false"
2988
- onclick="${gvc.event((e, event) => {
3111
+ return html `
3112
+ <div class="position-relative btn-group dropend subBt my-auto ms-1 ${(_a = obj.classS) !== null && _a !== void 0 ? _a : ''}"
3113
+ style="${(_b = obj.style) !== null && _b !== void 0 ? _b : ''}">
3114
+ <div
3115
+ type="button"
3116
+ class="bt"
3117
+ style="background:none;"
3118
+ data-bs-toggle="dropdown"
3119
+ aria-haspopup="true"
3120
+ data-placement="left"
3121
+ aria-expanded="false"
3122
+ onclick="${gvc.event((e, event) => {
2989
3123
  setTimeout(() => {
2990
3124
  obj.top && $(e).parent().children('.dropdown-menu').css('top', `${obj.top}px`);
2991
3125
  }, 100);
2992
3126
  event.stopPropagation();
2993
3127
  event.preventDefault();
2994
3128
  })}"
2995
- >
2996
- ${obj.fontawesome}
2997
- </div>
2998
- <div
2999
- class="dropdown-menu mx-1"
3000
- data-placement="right"
3001
- onmouseover="${obj.gvc.event((e, event) => {
3129
+ >
3130
+ ${obj.fontawesome}
3131
+ </div>
3132
+ <div
3133
+ class="dropdown-menu mx-1"
3134
+ data-placement="right"
3135
+ onmouseover="${obj.gvc.event((e, event) => {
3002
3136
  clearInterval(interval);
3003
3137
  })}"
3004
- onmouseout="${obj.gvc.event((e, event) => {
3138
+ onmouseout="${obj.gvc.event((e, event) => {
3005
3139
  $(e).children('.bt').dropdown('hide');
3006
3140
  })}"
3007
- style="min-height: 150px;${obj.dropDownStyle}"
3008
- >
3009
- <div class="px-2">${obj.inner}</div>
3010
- </div>
3011
- </div>`;
3141
+ style="min-height: 150px;${obj.dropDownStyle}"
3142
+ >
3143
+ <div class="px-2">${obj.inner}</div>
3144
+ </div>
3145
+ </div>`;
3012
3146
  }
3013
3147
  }
3014
3148
  EditorElem.noImageURL = 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg';