ts-glitter 21.7.5 → 21.7.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.
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.7.5';
149
+ glitter.share.editerVersion = 'V_21.7.7';
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.7.5';
153
+ glitter.share.editerVersion = 'V_21.7.7';
154
154
  glitter.share.start = new Date();
155
155
  const vm = { appConfig: [] };
156
156
  (window as any).saasConfig = {
@@ -118,6 +118,7 @@ export class AutoReply {
118
118
  'auto-email-order-create',
119
119
  'auto-email-payment-successful',
120
120
  'proof-purchase',
121
+ 'auto-email-order-cancel-success',
121
122
  'auto-email-birthday',
122
123
  'auto-email-welcome',
123
124
  'auto-email-verify',
@@ -412,7 +413,7 @@ export class AutoReply {
412
413
  return dd.tag === tag;
413
414
  });
414
415
  if (keyData.response.value) {
415
- return Object.assign(Object.assign(Object.assign({}, b), keyData.response.value), { updated_time: new Date(keyData.response.value.updated_time) });
416
+ return Object.assign(Object.assign(Object.assign({}, b), keyData.response.value), { updated_time: keyData.response.value.updated_time && new Date(keyData.response.value.updated_time) });
416
417
  }
417
418
  return b;
418
419
  });
@@ -132,7 +132,7 @@ export class AutoReply {
132
132
  'auto-email-order-create',
133
133
  'auto-email-payment-successful',
134
134
  'proof-purchase',
135
- // 'auto-email-order-cancel-success',
135
+ 'auto-email-order-cancel-success',
136
136
  // 'auto-email-order-cancel-false',
137
137
  'auto-email-birthday',
138
138
  'auto-email-welcome',
@@ -464,7 +464,7 @@ export class AutoReply {
464
464
  return {
465
465
  ...b,
466
466
  ...keyData.response.value,
467
- updated_time: new Date(keyData.response.value.updated_time),
467
+ updated_time: keyData.response.value.updated_time && new Date(keyData.response.value.updated_time),
468
468
  };
469
469
  }
470
470
  return b;
@@ -42,6 +42,9 @@ export class AutoReply {
42
42
  let vmi = undefined;
43
43
  function getDatalist() {
44
44
  return vm.dataList.map((dd) => {
45
+ if (dd.updated_time === 'Invalid Date') {
46
+ dd.updated_time = '';
47
+ }
45
48
  return [
46
49
  {
47
50
  key: '發送時間',
@@ -118,6 +121,7 @@ export class AutoReply {
118
121
  'auto-line-order-cancel-success',
119
122
  'line-proof-purchase',
120
123
  'auto-line-birthday',
124
+ 'auto-line-order-cancel-success'
121
125
  ];
122
126
  let index = 0;
123
127
  for (const b of vm.dataList) {
@@ -349,7 +353,7 @@ export class AutoReply {
349
353
  b.toggle = (_a = keyData.response.value.toggle) !== null && _a !== void 0 ? _a : true;
350
354
  b.content = keyData.response.value.content || b.content;
351
355
  b.name = keyData.response.value.name || b.name;
352
- b.updated_time = new Date(keyData.response.value.updated_time);
356
+ b.updated_time = keyData.response.value.updated_time && new Date(keyData.response.value.updated_time);
353
357
  }
354
358
  return b;
355
359
  });
@@ -53,6 +53,9 @@ export class AutoReply {
53
53
 
54
54
  function getDatalist() {
55
55
  return vm.dataList.map((dd: any) => {
56
+ if (dd.updated_time === 'Invalid Date') {
57
+ dd.updated_time = '';
58
+ }
56
59
  return [
57
60
  {
58
61
  key: '發送時間',
@@ -138,6 +141,7 @@ export class AutoReply {
138
141
  'auto-line-order-cancel-success',
139
142
  'line-proof-purchase',
140
143
  'auto-line-birthday',
144
+ 'auto-line-order-cancel-success'
141
145
  ];
142
146
  let index = 0;
143
147
  for (const b of vm.dataList) {
@@ -391,7 +395,7 @@ export class AutoReply {
391
395
  b.toggle = keyData.response.value.toggle ?? true;
392
396
  b.content = keyData.response.value.content || b.content;
393
397
  b.name = keyData.response.value.name || b.name;
394
- b.updated_time = new Date(keyData.response.value.updated_time);
398
+ b.updated_time = keyData.response.value.updated_time && new Date(keyData.response.value.updated_time);
395
399
  }
396
400
  return b;
397
401
  }
@@ -65,7 +65,7 @@ export class AutoReply {
65
65
  return BgWidget.switchTextButton(gvc, dd.toggle, {
66
66
  left: dd.toggle ? '啟用' : '關閉',
67
67
  }, () => {
68
- ApiUser.getPublicConfig(dd.tag, 'manager').then((res) => {
68
+ ApiUser.getPublicConfig(dd.tag, 'manager').then(res => {
69
69
  dd.toggle = !dd.toggle;
70
70
  res.response.value = res.response.value || {};
71
71
  res.response.value.updated_time = new Date();
@@ -100,11 +100,11 @@ export class AutoReply {
100
100
  });
101
101
  }
102
102
  return BgWidget.container(html `
103
- <div class="title-container">
104
- ${BgWidget.title('自動寄送簡訊')}
105
- <div class="flex-fill"></div>
106
- </div>
107
- ${BgWidget.container(BgWidget.mainCard(BgWidget.tableV3({
103
+ <div class="title-container">
104
+ ${BgWidget.title('自動寄送簡訊')}
105
+ <div class="flex-fill"></div>
106
+ </div>
107
+ ${BgWidget.container(BgWidget.mainCard(BgWidget.tableV3({
108
108
  gvc: gvc,
109
109
  getData: (vmk) => __awaiter(this, void 0, void 0, function* () {
110
110
  const appData = yield ApiUser.getPublicConfig('store-information', 'manager');
@@ -118,6 +118,7 @@ export class AutoReply {
118
118
  'sns-proof-purchase',
119
119
  'auto-sns-birthday',
120
120
  'auto-phone-verify',
121
+ 'auto-sns-order-cancel-success',
121
122
  ];
122
123
  let index = 0;
123
124
  for (const b of vm.dataList) {
@@ -138,8 +139,8 @@ export class AutoReply {
138
139
  },
139
140
  filter: [],
140
141
  })))}
141
- ${BgWidget.mbContainer(240)}
142
- `);
142
+ ${BgWidget.mbContainer(240)}
143
+ `);
143
144
  },
144
145
  };
145
146
  });
@@ -152,8 +153,8 @@ export class AutoReply {
152
153
  const that = this;
153
154
  let pointCount = 1;
154
155
  return html ` ${BgWidget.container([
155
- html `<div class="title-container">
156
- ${BgWidget.goBack(gvc.event(() => {
156
+ html ` <div class="title-container">
157
+ ${BgWidget.goBack(gvc.event(() => {
157
158
  back();
158
159
  }))}${BgWidget.title((() => {
159
160
  const vm = {
@@ -167,8 +168,8 @@ export class AutoReply {
167
168
  divCreate: {},
168
169
  onCreate: () => {
169
170
  if (vm.loading) {
170
- new Promise((resolve) => {
171
- AutoReply.getDefCompare(tag).then((dd) => resolve(dd));
171
+ new Promise(resolve => {
172
+ AutoReply.getDefCompare(tag).then(dd => resolve(dd));
172
173
  }).then((res) => {
173
174
  if (res && res.tag_name) {
174
175
  vm.name = res.tag_name;
@@ -180,7 +181,7 @@ export class AutoReply {
180
181
  },
181
182
  });
182
183
  })())}
183
- </div>`,
184
+ </div>`,
184
185
  BgWidget.mbContainer(24),
185
186
  BgWidget.alertInfo('可使用模板字串,簡訊將在寄送時自動填入相關數值', ['商家名稱:@{{app_name}}', '訂單號碼:@{{訂單號碼}}', '會員姓名:@{{user_name}}'], {
186
187
  class: 'mb-3',
@@ -188,7 +189,7 @@ export class AutoReply {
188
189
  }),
189
190
  BgWidget.mainCard(gvc.bindView(() => {
190
191
  const id = gvc.glitter.getUUID();
191
- AutoReply.getDefCompare(tag).then((dd) => {
192
+ AutoReply.getDefCompare(tag).then(dd => {
192
193
  vm.data = dd;
193
194
  vm.loading = false;
194
195
  gvc.notifyDataChange(id);
@@ -201,19 +202,19 @@ export class AutoReply {
201
202
  gvc: gvc,
202
203
  title: '寄件者名稱',
203
204
  default: vm.data.name || '',
204
- callback: (text) => {
205
+ callback: text => {
205
206
  vm.data.name = text;
206
207
  },
207
208
  placeHolder: '請輸入寄件者名稱',
208
209
  }),
209
210
  html `
210
- <div class="d-flex w-100 align-items-center justify-content-between p-0 my-2">
211
- <div class="d-flex align-items-center gap-2">
212
- ${EditorElem.h3('簡訊內文')}
213
- ${document.body.clientWidth > 768
211
+ <div class="d-flex w-100 align-items-center justify-content-between p-0 my-2">
212
+ <div class="d-flex align-items-center gap-2">
213
+ ${EditorElem.h3('簡訊內文')}
214
+ ${document.body.clientWidth > 768
214
215
  ? BgWidget.grayNote(`預計每則簡訊花費${pointCount * this.ticket}點`, 'margin-top: 0.25em;')
215
216
  : html ` <div style="margin-top: 0.25em;">
216
- ${BgWidget.iconButton({
217
+ ${BgWidget.iconButton({
217
218
  icon: 'info',
218
219
  event: gvc.event(() => {
219
220
  BgWidget.jumpAlert({
@@ -225,17 +226,17 @@ export class AutoReply {
225
226
  });
226
227
  }),
227
228
  })}
228
- </div>`}
229
- </div>
230
- <div>${BgWidget.aiChatButton({ gvc, select: 'writer' })}</div>
231
- </div>
232
- `,
229
+ </div>`}
230
+ </div>
231
+ <div>${BgWidget.aiChatButton({ gvc, select: 'writer' })}</div>
232
+ </div>
233
+ `,
233
234
  EditorElem.editeText({
234
235
  gvc: gvc,
235
236
  title: '',
236
237
  default: vm.data.content || '',
237
238
  placeHolder: '',
238
- callback: (text) => {
239
+ callback: text => {
239
240
  vm.data.content = text;
240
241
  let totalSize = 0;
241
242
  for (let i = 0; i < text.length; i++) {
@@ -262,13 +263,13 @@ export class AutoReply {
262
263
  })),
263
264
  BgWidget.mbContainer(240),
264
265
  html ` <div class="update-bar-container">
265
- ${BgWidget.cancel(gvc.event(() => {
266
+ ${BgWidget.cancel(gvc.event(() => {
266
267
  back();
267
268
  }))}
268
- ${BgWidget.save(gvc.event(() => {
269
+ ${BgWidget.save(gvc.event(() => {
269
270
  const dialog = new ShareDialog(gvc.glitter);
270
271
  dialog.checkYesOrNot({
271
- callback: (select) => {
272
+ callback: select => {
272
273
  if (select) {
273
274
  dialog.dataLoading({ visible: true, text: '儲存中' });
274
275
  vm.data.updated_time = new Date();
@@ -287,7 +288,7 @@ export class AutoReply {
287
288
  text: `確認無誤後將儲存`,
288
289
  });
289
290
  }))}
290
- </div>`,
291
+ </div>`,
291
292
  ].join(''))}`;
292
293
  }
293
294
  static getDefCompare(tag) {
@@ -384,7 +385,7 @@ export class AutoReply {
384
385
  b.toggle = (_a = keyData.response.value.toggle) !== null && _a !== void 0 ? _a : true;
385
386
  b.content = keyData.response.value.content || b.content;
386
387
  b.name = keyData.response.value.name || b.name;
387
- b.updated_time = new Date(keyData.response.value.updated_time);
388
+ b.updated_time = keyData.response.value.updated_time && new Date(keyData.response.value.updated_time);
388
389
  }
389
390
  return b;
390
391
  });