ts-glitter 21.8.2 → 21.8.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.
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.8.2';
149
+ glitter.share.editerVersion = 'V_21.8.3';
150
150
  glitter.share.start = new Date();
151
151
  const vm = { appConfig: [] };
152
152
  window.saasConfig = {
package/lowcode/Entry.ts CHANGED
@@ -150,7 +150,7 @@ export class Entry {
150
150
  }
151
151
  (window as any).renderClock = (window as any).renderClock ?? createClock();
152
152
  console.log(`Entry-time:`, (window as any).renderClock.stop());
153
- glitter.share.editerVersion = 'V_21.8.2';
153
+ glitter.share.editerVersion = 'V_21.8.3';
154
154
  glitter.share.start = new Date();
155
155
  const vm = { appConfig: [] };
156
156
  (window as any).saasConfig = {
@@ -9457,6 +9457,11 @@ BasicComponent.componentList = [
9457
9457
  title: '社群按鈕',
9458
9458
  config: { "id": "s6s7sbs4s5s5sasd", "js": "./official_view_component/official.js", "css": { "class": {}, "style": {} }, "data": { "tag": "social_popup", "_gap": "", "attr": [], "elem": "div", "list": [], "inner": "", "_other": {}, "_border": {}, "_margin": {}, "_radius": "", "_padding": {}, "_reverse": "false", "carryData": {}, "refer_app": "shop_template_black_style", "_max_width": "", "_background": "", "_style_refer": "global", "_hor_position": "center", "refer_form_data": { "social_list": [{ "icon": "https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg", "social_type": "fb" }, { "social_type": "ig" }, { "social_type": "line" }] }, "_background_setting": { "type": "none" } }, "list": [], "type": "component", "class": "w-100", "index": 2, "label": "社群彈窗", "style": "", "global": [], "mobile": { "id": "s6s7sbs4s5s5sasd", "js": "./official_view_component/official.js", "css": { "class": {}, "style": {} }, "data": { "refer_app": "shop_template_black_style" }, "list": [], "type": "component", "class": "w-100", "index": 2, "label": "社群彈窗", "style": "", "global": [], "toggle": true, "stylist": [], "version": "v2", "visible": true, "dataType": "static", "style_from": "code", "classDataType": "static", "editor_bridge": {}, "preloadEvenet": {}, "container_fonts": 0, "mobile_editable": [], "desktop_editable": [], "refreshAllParameter": {}, "refreshComponentParameter": {}, "refer": "custom" }, "toggle": true, "desktop": { "data": { "refer_app": "shop_template_black_style", "refer_form_data": {} }, "refer": "custom" }, "stylist": [], "version": "v2", "visible": true, "dataType": "static", "style_from": "code", "classDataType": "static", "editor_bridge": {}, "preloadEvenet": {}, "container_fonts": 0, "mobile_editable": [], "desktop_editable": [], "refreshAllParameter": {}, "refreshComponentParameter": {}, "formData": {} },
9459
9459
  image: `https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/Screenshot 2025-05-21 at 6.22.03 PM.jpg`
9460
+ },
9461
+ {
9462
+ title: '首頁廣告',
9463
+ config: { "id": "s4s1sfs7s9s8sds5", "js": "./official_view_component/official.js", "css": { "class": {}, "style": {} }, "data": { "tag": "banner-first", "_gap": "", "attr": [], "elem": "div", "list": [], "inner": "", "_other": {}, "_border": {}, "_margin": {}, "_radius": "", "_padding": {}, "_reverse": "false", "carryData": {}, "refer_app": "shop_template_black_style", "_max_width": "", "_background": "", "_style_refer": "custom", "_hor_position": "center", "refer_form_data": { "map": "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3625.9857346364677!2d121.56387331536634!3d25.033964283970027!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3442abbff9f1f2cd%3A0xa5e9e25b96d47b6!2z5p2x5Y2A5rC45bq36Zmi!5e0!3m2!1szh-TW!2stw!4v1697247462832!5m2!1szh-TW!2stw", "list": [{ "img": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/s*px$_s7s4s2sas9s7s1s8_1747824490757.png", "link": "/all-product", "title": "所有商品頁面" }], "width": { "unit": "px", "value": "450px", "number": "450" }, "height": { "unit": "px", "value": "450px", "number": "450" } }, "_background_setting": { "type": "none" }, "_style_refer_global": { "index": "0" } }, "list": [], "type": "component", "class": "w-100", "index": 21, "label": "首圖廣告", "style": "", "global": [], "mobile": { "id": "s4s1sfs7s9s8sds5", "js": "./official_view_component/official.js", "css": { "class": {}, "style": {} }, "data": { "refer_app": "shop_template_black_style" }, "list": [], "type": "component", "class": "w-100", "index": 21, "label": "首圖廣告", "style": "", "global": [], "toggle": true, "stylist": [], "version": "v2", "visible": true, "dataType": "static", "style_from": "code", "classDataType": "static", "editor_bridge": {}, "preloadEvenet": {}, "container_fonts": 0, "mobile_editable": [], "desktop_editable": [], "refreshAllParameter": {}, "refreshComponentParameter": {}, "refer": "custom" }, "toggle": true, "desktop": { "data": { "refer_app": "shop_template_black_style", "refer_form_data": {} }, "refer": "custom" }, "stylist": [], "version": "v2", "visible": true, "dataType": "static", "style_from": "code", "classDataType": "static", "editor_bridge": {}, "preloadEvenet": {}, "container_fonts": 0, "mobile_editable": [], "desktop_editable": [], "refreshAllParameter": {}, "refreshComponentParameter": {}, "formData": {} },
9464
+ image: `https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/Screenshot 2025-05-21 at 6.50.46 PM.jpg`
9460
9465
  }
9461
9466
  ];
9462
9467
  BasicComponent.productList = [
@@ -9072,6 +9072,11 @@ export class BasicComponent {
9072
9072
  title: '社群按鈕',
9073
9073
  config: {"id":"s6s7sbs4s5s5sasd","js":"./official_view_component/official.js","css":{"class":{},"style":{}},"data":{"tag":"social_popup","_gap":"","attr":[],"elem":"div","list":[],"inner":"","_other":{},"_border":{},"_margin":{},"_radius":"","_padding":{},"_reverse":"false","carryData":{},"refer_app":"shop_template_black_style","_max_width":"","_background":"","_style_refer":"global","_hor_position":"center","refer_form_data":{"social_list":[{"icon":"https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg","social_type":"fb"},{"social_type":"ig"},{"social_type":"line"}]},"_background_setting":{"type":"none"}},"list":[],"type":"component","class":"w-100","index":2,"label":"社群彈窗","style":"","global":[],"mobile":{"id":"s6s7sbs4s5s5sasd","js":"./official_view_component/official.js","css":{"class":{},"style":{}},"data":{"refer_app":"shop_template_black_style"},"list":[],"type":"component","class":"w-100","index":2,"label":"社群彈窗","style":"","global":[],"toggle":true,"stylist":[],"version":"v2","visible":true,"dataType":"static","style_from":"code","classDataType":"static","editor_bridge":{},"preloadEvenet":{},"container_fonts":0,"mobile_editable":[],"desktop_editable":[],"refreshAllParameter":{},"refreshComponentParameter":{},"refer":"custom"},"toggle":true,"desktop":{"data":{"refer_app":"shop_template_black_style","refer_form_data":{}},"refer":"custom"},"stylist":[],"version":"v2","visible":true,"dataType":"static","style_from":"code","classDataType":"static","editor_bridge":{},"preloadEvenet":{},"container_fonts":0,"mobile_editable":[],"desktop_editable":[],"refreshAllParameter":{},"refreshComponentParameter":{},"formData":{}},
9074
9074
  image: `https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/Screenshot 2025-05-21 at 6.22.03 PM.jpg`
9075
+ },
9076
+ {
9077
+ title: '首頁廣告',
9078
+ config: {"id":"s4s1sfs7s9s8sds5","js":"./official_view_component/official.js","css":{"class":{},"style":{}},"data":{"tag":"banner-first","_gap":"","attr":[],"elem":"div","list":[],"inner":"","_other":{},"_border":{},"_margin":{},"_radius":"","_padding":{},"_reverse":"false","carryData":{},"refer_app":"shop_template_black_style","_max_width":"","_background":"","_style_refer":"custom","_hor_position":"center","refer_form_data":{"map":"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3625.9857346364677!2d121.56387331536634!3d25.033964283970027!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3442abbff9f1f2cd%3A0xa5e9e25b96d47b6!2z5p2x5Y2A5rC45bq36Zmi!5e0!3m2!1szh-TW!2stw!4v1697247462832!5m2!1szh-TW!2stw","list":[{"img":"https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/s*px$_s7s4s2sas9s7s1s8_1747824490757.png","link":"/all-product","title":"所有商品頁面"}],"width":{"unit":"px","value":"450px","number":"450"},"height":{"unit":"px","value":"450px","number":"450"}},"_background_setting":{"type":"none"},"_style_refer_global":{"index":"0"}},"list":[],"type":"component","class":"w-100","index":21,"label":"首圖廣告","style":"","global":[],"mobile":{"id":"s4s1sfs7s9s8sds5","js":"./official_view_component/official.js","css":{"class":{},"style":{}},"data":{"refer_app":"shop_template_black_style"},"list":[],"type":"component","class":"w-100","index":21,"label":"首圖廣告","style":"","global":[],"toggle":true,"stylist":[],"version":"v2","visible":true,"dataType":"static","style_from":"code","classDataType":"static","editor_bridge":{},"preloadEvenet":{},"container_fonts":0,"mobile_editable":[],"desktop_editable":[],"refreshAllParameter":{},"refreshComponentParameter":{},"refer":"custom"},"toggle":true,"desktop":{"data":{"refer_app":"shop_template_black_style","refer_form_data":{}},"refer":"custom"},"stylist":[],"version":"v2","visible":true,"dataType":"static","style_from":"code","classDataType":"static","editor_bridge":{},"preloadEvenet":{},"container_fonts":0,"mobile_editable":[],"desktop_editable":[],"refreshAllParameter":{},"refreshComponentParameter":{},"formData":{}},
9079
+ image: `https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/Screenshot 2025-05-21 at 6.50.46 PM.jpg`
9075
9080
  }
9076
9081
  ]
9077
9082
 
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { init } from '../GVController.js';
11
11
  import { TriggerEvent } from './trigger-event.js';
12
12
  import { GlobalUser } from '../../glitter-base/global/global-user.js';
13
- import { FirstBanner } from '../../public-components/banner/first-banner.js';
14
13
  import { Language } from '../../glitter-base/global/language.js';
15
14
  import { ApplicationConfig } from '../../application-config.js';
16
15
  const html = String.raw;
@@ -91,7 +90,6 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
91
90
  return {
92
91
  onCreateView: () => {
93
92
  var _a, _b, _c, _d, _e, _f, _g, _h;
94
- FirstBanner.main({ gvc: gvc });
95
93
  if (gBundle.page_config.seo && gBundle.page_config.seo.type === 'custom' && gBundle.page_config.seo.title) {
96
94
  glitter.setUrlParameter('', undefined, [
97
95
  (_a = gBundle.page_config.seo.title_prefix) !== null && _a !== void 0 ? _a : '',
@@ -76,7 +76,6 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
76
76
 
77
77
  return {
78
78
  onCreateView: () => {
79
- FirstBanner.main({ gvc: gvc });
80
79
  //定義SEO TITLE
81
80
  if (gBundle.page_config.seo && gBundle.page_config.seo.type === 'custom' && gBundle.page_config.seo.title) {
82
81
  glitter.setUrlParameter(
@@ -173,6 +173,7 @@ export class ToolSetting {
173
173
  const htmlGenerate = new gvc.glitter.htmlGenerate(widget_container, [], {
174
174
  editor_updated_callback: (oWidget) => {
175
175
  if (dd.tag === '廣告輪播') {
176
+ console.log(`oWidget==>`, oWidget);
176
177
  FirstBanner.main({
177
178
  gvc: document.querySelector('.iframe_view').contentWindow.glitter.pageConfig[0].gvc,
178
179
  ed_widget: oWidget,
@@ -213,6 +213,7 @@ export class ToolSetting {
213
213
  {
214
214
  editor_updated_callback: (oWidget: any) => {
215
215
  if (dd.tag === '廣告輪播') {
216
+ console.log(`oWidget==>`,oWidget)
216
217
  FirstBanner.main({
217
218
  gvc: (document.querySelector('.iframe_view') as any).contentWindow.glitter.pageConfig[0].gvc,
218
219
  ed_widget: oWidget,
@@ -743,12 +743,7 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
743
743
  src: `fa-sharp fa-regular fa-globe guide-user-editor-11-icon`,
744
744
  index: 'color',
745
745
  hint: '全站樣式',
746
- },
747
- {
748
- src: `fa-regular fa-grid-2 design-guide-1-icon`,
749
- index: 'widget',
750
- hint: '設計元件',
751
- },
746
+ }
752
747
  ]
753
748
  .filter(dd => {
754
749
  if (gvc.glitter.getUrlParameter('device') === 'mobile') {
@@ -804,12 +804,7 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
804
804
  src: `fa-sharp fa-regular fa-globe guide-user-editor-11-icon`,
805
805
  index: 'color',
806
806
  hint: '全站樣式',
807
- },
808
- {
809
- src: `fa-regular fa-grid-2 design-guide-1-icon`,
810
- index: 'widget',
811
- hint: '設計元件',
812
- },
807
+ }
813
808
  ]
814
809
  .filter(dd => {
815
810
  if (gvc.glitter.getUrlParameter('device') === 'mobile') {
@@ -1178,7 +1178,7 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
1178
1178
  </div>`,
1179
1179
  ` <div class="mx-n3" style="background: #DDD;height: 1px;"></div>`,
1180
1180
  ].join(`<div style="height:18px;"></div>`);
1181
- if (app_editor || glitter.share.editorViewModel.selectItem.is_customer_header) {
1181
+ if (app_editor || ((glitter.share.editorViewModel.selectItem) && glitter.share.editorViewModel.selectItem.is_customer_header)) {
1182
1182
  global_setting_view = ``;
1183
1183
  }
1184
1184
  if (vm.page === 'editor') {
@@ -1355,7 +1355,7 @@ export const component = Plugin.createComponent(import.meta.url, (glitter: Glitt
1355
1355
  </div>`,
1356
1356
  ` <div class="mx-n3" style="background: #DDD;height: 1px;"></div>`,
1357
1357
  ].join(`<div style="height:18px;"></div>`);
1358
- if (app_editor || glitter.share.editorViewModel.selectItem.is_customer_header) {
1358
+ if (app_editor || ((glitter.share.editorViewModel.selectItem) && glitter.share.editorViewModel.selectItem.is_customer_header)) {
1359
1359
  global_setting_view = ``;
1360
1360
  }
1361
1361
  if (vm.page === 'editor') {
@@ -7,8 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { ApiPageConfig } from "../../api/pageConfig.js";
11
- import { GlobalWidget } from "../../glitterBundle/html-component/global-widget.js";
12
10
  const html = String.raw;
13
11
  const css = String.raw;
14
12
  export class FirstBanner {
@@ -39,50 +37,18 @@ export class FirstBanner {
39
37
  background: #393939!important;
40
38
  }
41
39
  `);
42
- const widget = obj.ed_widget || ((yield ApiPageConfig.getPage({
43
- appName: gvc.glitter.window.appName,
44
- type: 'template',
45
- tag: 'advertise',
46
- })).response.result[0]).config[0];
47
- (gvc.glitter.window.glitterInitialHelper).getPageData({
48
- tag: widget.data.tag,
49
- appName: widget.data.refer_app
50
- }, (d2) => {
51
- const data = d2.response.result[0];
52
- function getFormData(ref) {
53
- var _a, _b;
54
- ref = window.parent.glitter.share.updated_form_data[`${widget.refer_app}_${widget.tag}`] || ref;
55
- let formData = JSON.parse(JSON.stringify(ref || {}));
56
- if ((widget.data.refer_app)) {
57
- GlobalWidget.initialShowCaseData({
58
- widget: widget,
59
- gvc: gvc
60
- });
61
- if (gvc.glitter.document.body.clientWidth < 800 && widget.mobile.refer === 'custom') {
62
- ((_a = widget[`mobile_editable`]) !== null && _a !== void 0 ? _a : []).map((dd) => {
63
- formData[dd] = JSON.parse(JSON.stringify((widget.mobile.data.refer_form_data || data.page_config.formData)[dd] || {}));
64
- });
65
- }
66
- else if (gvc.glitter.document.body.clientWidth >= 800 && widget.desktop.refer === 'custom') {
67
- ((_b = widget[`desktop_editable`]) !== null && _b !== void 0 ? _b : []).map((dd) => {
68
- formData[dd] = JSON.parse(JSON.stringify((widget.desktop.data.refer_form_data || data.page_config.formData)[dd] || {}));
69
- });
70
- }
71
- }
72
- return formData;
73
- }
74
- const formData = getFormData((widget.data.refer_app) ? (widget.data.refer_form_data || data.page_config.formData) : data.page_config.formData);
75
- if (formData.list && formData.list.length) {
76
- obj.gvc.glitter.innerDialog((gvc) => {
77
- return gvc.bindView(() => {
78
- return {
79
- bind: id,
80
- view: () => {
81
- return html `
40
+ const formData = obj.widget.formData;
41
+ if (formData.list && formData.list.length) {
42
+ obj.gvc.glitter.innerDialog((gvc) => {
43
+ return gvc.bindView(() => {
44
+ return {
45
+ bind: id,
46
+ view: () => {
47
+ return html `
82
48
  <div class="swiper mySwiper_${id}" style="width:520px;max-width:100vw;height:auto !important;">
83
49
  <div class="swiper-wrapper">
84
50
  ${formData.list.map((dd) => {
85
- return html `
51
+ return html `
86
52
  <div class="swiper-slide pb-4 d-flex align-items-center justify-content-center position-relative"
87
53
  style="background: none;
88
54
  overflow: hidden;;
@@ -90,61 +56,60 @@ overflow: hidden;;
90
56
  <img src="${dd.img || 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}" style="width:520px;max-width:calc(100vw - 40px);max-height: 100vh;cursor: pointer;
91
57
  border-radius: 25px;
92
58
  " onclick="${gvc.event(() => {
93
- gvc.glitter.href = dd.link;
94
- gvc.closeDialog();
95
- })}" >
59
+ gvc.glitter.href = dd.link;
60
+ gvc.closeDialog();
61
+ })}" >
96
62
  <div class="position-absolute d-flex align-items-center justify-content-center"
97
63
  style="top:0px;right: 0px;width:50px;height: 50px;
98
64
  background: rgba(0,0,0,0.5);border-top-right-radius: 25px;border-bottom-left-radius: 10px;cursor: pointer;" onclick="${(() => {
99
- if (gvc.glitter.htmlGenerate.isEditMode()) {
100
- return gvc.editorEvent(() => {
101
- gvc.closeDialog();
102
- });
103
- }
104
- else {
105
- return gvc.event(() => {
106
- gvc.closeDialog();
107
- });
108
- }
109
- })()}">
65
+ if (gvc.glitter.htmlGenerate.isEditMode()) {
66
+ return gvc.editorEvent(() => {
67
+ gvc.closeDialog();
68
+ });
69
+ }
70
+ else {
71
+ return gvc.event(() => {
72
+ gvc.closeDialog();
73
+ });
74
+ }
75
+ })()}">
110
76
  <i class="fa-regular fa-circle-xmark text-white fs-5"
111
77
  ></i>
112
78
  </div>
113
79
  </div>
114
80
  `;
115
- }).join('')}
81
+ }).join('')}
116
82
  </div>
117
83
  <div class="swiper-pagination swiper-pagination-${id}"></div>
118
84
  </div>`;
119
- },
120
- divCreate: {
121
- class: `vw-100 vh-100 position-fixed ${id} d-flex align-items-center justify-content-center`,
122
- style: css `z-index: 999999;
85
+ },
86
+ divCreate: {
87
+ class: `vw-100 vh-100 position-fixed ${id} d-flex align-items-center justify-content-center`,
88
+ style: css `z-index: 999999;
123
89
  background: rgba(0, 0, 0, 0.5);`
124
- },
125
- onCreate: () => {
126
- const interval = setInterval(() => {
127
- if (gvc.glitter.window.Swiper) {
128
- const swiper = new gvc.glitter.window.Swiper(`.mySwiper_${id}`, {
129
- loop: true,
130
- pagination: {
131
- el: `.swiper-pagination-${id}`,
132
- clickable: true,
90
+ },
91
+ onCreate: () => {
92
+ const interval = setInterval(() => {
93
+ if (gvc.glitter.window.Swiper) {
94
+ const swiper = new gvc.glitter.window.Swiper(`.mySwiper_${id}`, {
95
+ loop: true,
96
+ pagination: {
97
+ el: `.swiper-pagination-${id}`,
98
+ clickable: true,
99
+ },
100
+ on: {
101
+ slideChange: function () {
133
102
  },
134
- on: {
135
- slideChange: function () {
136
- },
137
- },
138
- });
139
- clearTimeout(interval);
140
- }
141
- }, 100);
142
- }
143
- };
144
- });
145
- }, 'first-banner', {});
146
- }
147
- });
103
+ },
104
+ });
105
+ clearTimeout(interval);
106
+ }
107
+ }, 100);
108
+ }
109
+ };
110
+ });
111
+ }, 'first-banner', {});
112
+ }
148
113
  return ``;
149
114
  });
150
115
  }
@@ -8,9 +8,10 @@ const css = String.raw
8
8
 
9
9
  export class FirstBanner {
10
10
 
11
- public static async main(obj: {
12
- gvc: GVC,
13
- ed_widget?:any
11
+ public static async main(obj:{
12
+ gvc: GVC,
13
+ widget: any,
14
+ subData: any
14
15
  }) {
15
16
 
16
17
  const gvc = obj.gvc
@@ -38,57 +39,21 @@ export class FirstBanner {
38
39
  background: #393939!important;
39
40
  }
40
41
  `)
41
- const widget=obj.ed_widget || ((
42
- await ApiPageConfig.getPage({
43
- appName: (gvc.glitter.window as any).appName,
44
- type: 'template',
45
- tag:'advertise',
46
- })
47
- ).response.result[0]).config[0];
48
- ((gvc.glitter.window as any).glitterInitialHelper).getPageData( {
49
- tag: widget.data.tag,
50
- appName: widget.data.refer_app
51
- }, (d2: any) => {
52
- const data = d2.response.result[0]
53
- function getFormData(ref: any) {
54
- //判斷是否有上次的更新資料
55
- ref= (window.parent as any).glitter.share.updated_form_data[`${widget.refer_app}_${widget.tag}`] || ref;
56
- let formData = JSON.parse(JSON.stringify(ref || {}))
57
- if ((widget.data.refer_app)) {
58
- GlobalWidget.initialShowCaseData({
59
- widget: widget,
60
- gvc: gvc
61
- });
62
- if (gvc.glitter.document.body.clientWidth < 800 && (widget as any).mobile.refer === 'custom') {
63
- ((widget as any)[`mobile_editable`] ?? []).map((dd: any) => {
64
- formData[dd] = JSON.parse(JSON.stringify(((widget as any).mobile.data.refer_form_data || data.page_config.formData)[dd] || {}))
65
- });
66
- // data.page_config.formData = (widget.data.refer_form_data || data.page_config.formData)
67
- } else if (gvc.glitter.document.body.clientWidth >= 800 && (widget as any).desktop.refer === 'custom') {
68
- ((widget as any)[`desktop_editable`] ?? []).map((dd: any) => {
69
- formData[dd] = JSON.parse(JSON.stringify(((widget as any).desktop.data.refer_form_data || data.page_config.formData)[dd] || {}))
70
- });
42
+ const formData = obj.widget.formData;
71
43
 
72
- // data.page_config.formData = ((widget as any).desktop.data.refer_form_data || data.page_config.formData);
73
- }
44
+ if(formData.list && formData.list.length){
45
+ obj.gvc.glitter.innerDialog((gvc) => {
46
+ return gvc.bindView(() => {
74
47
 
75
- }
76
- return formData;
77
- }
78
- const formData=getFormData((widget.data.refer_app) ? (widget.data.refer_form_data || data.page_config.formData) : data.page_config.formData);
79
- if(formData.list && formData.list.length){
80
- obj.gvc.glitter.innerDialog((gvc) => {
81
- return gvc.bindView(() => {
82
-
83
- return {
84
- bind: id,
85
- view: () => {
86
- return html`
48
+ return {
49
+ bind: id,
50
+ view: () => {
51
+ return html`
87
52
  <div class="swiper mySwiper_${id}" style="width:520px;max-width:100vw;height:auto !important;">
88
53
  <div class="swiper-wrapper">
89
54
  ${
90
- formData.list.map((dd:any) => {
91
- return html`
55
+ formData.list.map((dd:any) => {
56
+ return html`
92
57
  <div class="swiper-slide pb-4 d-flex align-items-center justify-content-center position-relative"
93
58
  style="background: none;
94
59
  overflow: hidden;;
@@ -96,68 +61,66 @@ overflow: hidden;;
96
61
  <img src="${dd.img || 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}" style="width:520px;max-width:calc(100vw - 40px);max-height: 100vh;cursor: pointer;
97
62
  border-radius: 25px;
98
63
  " onclick="${gvc.event(() => {
99
- gvc.glitter.href=dd.link;
100
- gvc.closeDialog()
101
- })}" >
64
+ gvc.glitter.href=dd.link;
65
+ gvc.closeDialog()
66
+ })}" >
102
67
  <div class="position-absolute d-flex align-items-center justify-content-center"
103
68
  style="top:0px;right: 0px;width:50px;height: 50px;
104
69
  background: rgba(0,0,0,0.5);border-top-right-radius: 25px;border-bottom-left-radius: 10px;cursor: pointer;" onclick="${
105
- (()=>{
106
- if(gvc.glitter.htmlGenerate.isEditMode()){
107
- return gvc.editorEvent(()=>{
108
- gvc.closeDialog()
109
- })
110
- }else{
111
- return gvc.event(()=>{
112
- gvc.closeDialog()
113
- })
114
- }
115
- })()}">
70
+ (()=>{
71
+ if(gvc.glitter.htmlGenerate.isEditMode()){
72
+ return gvc.editorEvent(()=>{
73
+ gvc.closeDialog()
74
+ })
75
+ }else{
76
+ return gvc.event(()=>{
77
+ gvc.closeDialog()
78
+ })
79
+ }
80
+ })()}">
116
81
  <i class="fa-regular fa-circle-xmark text-white fs-5"
117
82
  ></i>
118
83
  </div>
119
84
  </div>
120
85
  `
121
- }).join('')
122
- }
86
+ }).join('')
87
+ }
123
88
  </div>
124
89
  <div class="swiper-pagination swiper-pagination-${id}"></div>
125
90
  </div>`
126
- },
127
- divCreate: {
128
- class: `vw-100 vh-100 position-fixed ${id} d-flex align-items-center justify-content-center`,
129
- style: css`z-index: 999999;
91
+ },
92
+ divCreate: {
93
+ class: `vw-100 vh-100 position-fixed ${id} d-flex align-items-center justify-content-center`,
94
+ style: css`z-index: 999999;
130
95
  background: rgba(0, 0, 0, 0.5);`
131
- },
132
- onCreate: () => {
96
+ },
97
+ onCreate: () => {
133
98
 
134
- const interval = setInterval(() => {
135
- if ((gvc.glitter.window as any).Swiper) {
136
- const swiper = new (gvc.glitter.window as any).Swiper(`.mySwiper_${id}`, {
137
- // Optional parameters
138
- loop: true,
139
- // If we need pagination
140
- pagination: {
141
- el: `.swiper-pagination-${id}`,
142
- clickable: true,
143
- },
144
- on: {
145
- slideChange: function () {
146
- // @ts-ignore
147
- },
148
- },
99
+ const interval = setInterval(() => {
100
+ if ((gvc.glitter.window as any).Swiper) {
101
+ const swiper = new (gvc.glitter.window as any).Swiper(`.mySwiper_${id}`, {
102
+ // Optional parameters
103
+ loop: true,
104
+ // If we need pagination
105
+ pagination: {
106
+ el: `.swiper-pagination-${id}`,
107
+ clickable: true,
108
+ },
109
+ on: {
110
+ slideChange: function () {
111
+ // @ts-ignore
112
+ },
113
+ },
149
114
 
150
- });
151
- clearTimeout(interval)
152
- }
153
- }, 100)
154
- }
155
- }
156
- })
157
- }, 'first-banner', {})
115
+ });
116
+ clearTimeout(interval)
117
+ }
118
+ }, 100)
119
+ }
158
120
  }
159
- })
160
-
121
+ })
122
+ }, 'first-banner', {})
123
+ }
161
124
 
162
125
 
163
126
  return ``
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "21.8.2",
3
+ "version": "21.8.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {