@subiz/widget-v4 4.0.70 → 4.0.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/assets/less/order.less +1 -6
  2. package/compiled_src/order/order.js +13 -11
  3. package/compiled_src/store/store.js +16 -21
  4. package/dist/132.js +13 -11
  5. package/dist/178.js +1 -1
  6. package/dist/{180455656b6.132.js → 1806f67a77b.132.js} +1 -1
  7. package/dist/{180455656b6.178.js → 1806f67a77b.178.js} +1 -1
  8. package/dist/{180455656b6.213.js → 1806f67a77b.213.js} +0 -0
  9. package/dist/{180455656b6.335.js → 1806f67a77b.335.js} +0 -0
  10. package/dist/{180455656b6.362.js → 1806f67a77b.362.js} +1 -1
  11. package/dist/{180455656b6.441.js → 1806f67a77b.441.js} +0 -0
  12. package/dist/{180455656b6.605.js → 1806f67a77b.605.js} +0 -0
  13. package/dist/{180455656b6.678.js → 1806f67a77b.678.js} +0 -0
  14. package/dist/{180455656b6.782.js → 1806f67a77b.782.js} +1 -1
  15. package/dist/{180455656b6.app.js → 1806f67a77b.app.js} +1 -1
  16. package/dist/{180455656b6.index.html → 1806f67a77b.index.html} +1 -1
  17. package/dist/{180455656b6.library.html → 1806f67a77b.library.html} +1 -1
  18. package/dist/{180455656b6.library.js → 1806f67a77b.library.js} +1 -1
  19. package/dist/{180455656b6.preview.html → 1806f67a77b.preview.html} +1 -1
  20. package/dist/{180455656b6.preview.js → 1806f67a77b.preview.js} +1 -1
  21. package/dist/{180455656b6.screenshoot.js → 1806f67a77b.screenshoot.js} +1 -1
  22. package/dist/362.js +1 -1
  23. package/dist/782.js +1 -1
  24. package/dist/HASH +1 -1
  25. package/dist/screenshoot.html +1 -1
  26. package/dist/screenshoot.js +11 -19
  27. package/package.json +3 -2
  28. package/src/order/order.js +18 -22
  29. package/src/store/store.js +9 -22
@@ -449,11 +449,6 @@ div.order__card.order__card__active {
449
449
  .color(white);
450
450
  }
451
451
 
452
- .order_status.order_status__processing {
453
- background: @primary-color;
454
- .color(white);
455
- }
456
-
457
452
  .order_status.order_status__shipping {
458
453
  background: @black;
459
454
  .color(white);
@@ -474,7 +469,7 @@ div.order__card.order__card__active {
474
469
  .color(white);
475
470
  }
476
471
 
477
- .order_status.order_status__new {
472
+ .order_status.order_status__open {
478
473
  background: @yellow;
479
474
  .color(white);
480
475
  }
@@ -46,6 +46,7 @@ class Order extends common.Com {
46
46
  loading: true,
47
47
  order: {},
48
48
  err: {},
49
+ shipping_address: 'new',
49
50
  selectedProvince: null,
50
51
  selectedDistrict: null,
51
52
  selectedWard: null,
@@ -350,10 +351,7 @@ class Order extends common.Com {
350
351
 
351
352
  _defineProperty(this, "onCancel", () => {
352
353
  if (this.props.onResponse) this.props.onResponse('rejected');
353
- this.close();
354
- });
355
354
 
356
- _defineProperty(this, "close", () => {
357
355
  if (this.props.cid && !this.state.order.user_confirmation) {
358
356
  let order = _index.default.cloneDeep(this.state.order);
359
357
 
@@ -361,6 +359,10 @@ class Order extends common.Com {
361
359
  this.props.store.updateOrder(order);
362
360
  }
363
361
 
362
+ this.close();
363
+ });
364
+
365
+ _defineProperty(this, "close", () => {
364
366
  if (this.props.onClose) this.props.onClose();
365
367
  });
366
368
 
@@ -435,7 +437,7 @@ class Order extends common.Com {
435
437
  return null;
436
438
  let editmode = false;
437
439
 
438
- if (!order.status || order.status == 'new') {
440
+ if (!order.status || order.status == 'open') {
439
441
  editmode = !order.user_confirmation;
440
442
  }
441
443
 
@@ -528,7 +530,7 @@ class Order extends common.Com {
528
530
  renderDesktopShipping(order) {
529
531
  let editmode = false;
530
532
 
531
- if (!order.status || order.status == 'new') {
533
+ if (!order.status || order.status == 'open') {
532
534
  editmode = !order.user_confirmation;
533
535
  }
534
536
 
@@ -835,7 +837,7 @@ class Order extends common.Com {
835
837
  }, (0, _preact.h)("div", null, "Ph\xED v\u1EADn chuy\u1EC3n"), (0, _preact.h)("div", null, _index.default.get(order, 'shipping.fee', 0), " d"));
836
838
  let editmode = false;
837
839
 
838
- if (!order.status || order.status == 'new') {
840
+ if (!order.status || order.status == 'open') {
839
841
  editmode = !order.user_confirmation;
840
842
  }
841
843
 
@@ -871,7 +873,7 @@ class Order extends common.Com {
871
873
  }
872
874
 
873
875
  renderStatusBadge(order) {
874
- let status = order.status || 'new';
876
+ let status = order.status || 'open';
875
877
  return (0, _preact.h)("div", {
876
878
  style: "float: right !important;",
877
879
  class: 'order_status order_status__' + status
@@ -879,7 +881,7 @@ class Order extends common.Com {
879
881
  }
880
882
 
881
883
  renderShippingInfo(order) {
882
- if (order.status != 'new' || order.user_confirmation) {}
884
+ if (order.status != 'open' || order.user_confirmation) {}
883
885
 
884
886
  let shipping_provider = _index.default.get(order, 'shipping.shipping_provider');
885
887
 
@@ -985,7 +987,7 @@ class Order extends common.Com {
985
987
  let $products = null;
986
988
  let editmode = false;
987
989
 
988
- if (!order.status || order.status == 'new') {
990
+ if (!order.status || order.status == 'open') {
989
991
  editmode = !order.user_confirmation;
990
992
  }
991
993
 
@@ -1089,7 +1091,7 @@ class Order extends common.Com {
1089
1091
  onClick: this.onCancel
1090
1092
  }, this.props.t('cancel_order'));
1091
1093
 
1092
- if (order.user_confirmation || order.status != 'new') {
1094
+ if (order.user_confirmation || order.status != 'open') {
1093
1095
  $status = null;
1094
1096
  if (this.props.cid) $close = (0, _preact.h)("div", {
1095
1097
  class: "order_btn order__btn__light mt-3",
@@ -1121,7 +1123,7 @@ class Order extends common.Com {
1121
1123
  let $actions = null;
1122
1124
  let editmode = false;
1123
1125
 
1124
- if (!order.status || order.status == 'new') {
1126
+ if (!order.status || order.status == 'open') {
1125
1127
  editmode = !order.user_confirmation;
1126
1128
  }
1127
1129
 
@@ -29,14 +29,6 @@ cookie.defaults.path = '/';
29
29
  cookie.expiresMultiplier = 60 * 60 * 24;
30
30
  cookie.defaults.expires = 3650;
31
31
  const MAX_CONVO = 20;
32
- const ga_client_id = '';
33
- setTimeout(() => {
34
- if (window.gtag) {
35
- window.gtag('get', 'UA-XXXXXXXX-Y', 'client_id', clientid => {
36
- ga_client_id = clientid;
37
- });
38
- }
39
- }, 100);
40
32
 
41
33
  const page_loaded = _index.default.Date.now();
42
34
 
@@ -178,7 +170,9 @@ class Store {
178
170
 
179
171
  _defineProperty(this, "seenQueue", []);
180
172
 
181
- _defineProperty(this, "_typing", _index.default.throttle(convoid => this.api.sendTyping(convoid), 3000));
173
+ _defineProperty(this, "_typing", _index.default.throttle(convoid => this.api.sendTyping(convoid), 3000, {
174
+ trailing: false
175
+ }));
182
176
 
183
177
  _defineProperty(this, "onConvoEvent", (o, cb) => this.pubsub.on2(o, 'events', cb));
184
178
 
@@ -1190,20 +1184,21 @@ const inmemCookie = {
1190
1184
  };
1191
1185
 
1192
1186
  function getGaClientId() {
1193
- if (ga_client_id) return ga_client_id;
1194
- if (!hasGA()) return ga_client_id;
1187
+ if (!window.ga) return;
1188
+ if (!window.ga.getAll) return;
1195
1189
  var allTrackers = window.ga.getAll() || [];
1190
+ let ga_client_id = '';
1196
1191
  allTrackers.forEach(function (tracker) {
1197
1192
  ga_client_id = tracker.get('clientId');
1198
1193
  });
1199
1194
  return ga_client_id;
1200
1195
  }
1201
1196
 
1202
- const hasGA = () => !!(window.ga && window.ga.getAll || window.gtag);
1203
-
1204
1197
  function getGaTrackingIds() {
1205
1198
  var trackingIds = [];
1206
- if (!hasGA()) return trackingIds;
1199
+ if (!(window.ga && window.ga.getAll)) return trackingIds;
1200
+ if (!window.ga) return [];
1201
+ if (!window.ga.getAll) return [];
1207
1202
  const allTrackers = window.ga.getAll() || [];
1208
1203
  allTrackers.forEach(function (tracker) {
1209
1204
  var trackingId = tracker.get('trackingId');
@@ -1221,19 +1216,19 @@ function sendToFBPixel(category, action, label) {
1221
1216
  }
1222
1217
 
1223
1218
  function sendToGA(category, action, label) {
1224
- if (!hasGA()) return;
1219
+ console.log('SENT.', category, action, label);
1225
1220
 
1226
- if (window.gtag) {
1227
- window.gtag('event', category + '.' + action, label);
1228
- return;
1229
- }
1230
-
1231
- if (window.ga) {
1221
+ if (window.ga && window.ga.getAll) {
1232
1222
  const allTrackers = window.ga.getAll() || [];
1233
1223
  allTrackers.forEach(function (tracker) {
1234
1224
  const name = tracker.get('name');
1235
1225
  window.ga(name + '.send', 'event', category, action, label);
1236
1226
  });
1227
+ } else {
1228
+ if (window.gtag) window.gtag('event', category, {
1229
+ Action: action,
1230
+ Label: label
1231
+ });
1237
1232
  }
1238
1233
  }
1239
1234
 
package/dist/132.js CHANGED
@@ -4101,6 +4101,7 @@ class order_Order extends common/* Com */.up {
4101
4101
  loading: true,
4102
4102
  order: {},
4103
4103
  err: {},
4104
+ shipping_address: 'new',
4104
4105
  selectedProvince: null,
4105
4106
  selectedDistrict: null,
4106
4107
  selectedWard: null,
@@ -4393,16 +4394,17 @@ class order_Order extends common/* Com */.up {
4393
4394
 
4394
4395
  order_defineProperty(this, "onCancel", () => {
4395
4396
  if (this.props.onResponse) this.props.onResponse('rejected');
4396
- this.close();
4397
- });
4398
4397
 
4399
- order_defineProperty(this, "close", () => {
4400
4398
  if (this.props.cid && !this.state.order.user_confirmation) {
4401
4399
  let order = util/* default.cloneDeep */.Z.cloneDeep(this.state.order);
4402
4400
  order.user_confirmation = 'rejected';
4403
4401
  this.props.store.updateOrder(order);
4404
4402
  }
4405
4403
 
4404
+ this.close();
4405
+ });
4406
+
4407
+ order_defineProperty(this, "close", () => {
4406
4408
  if (this.props.onClose) this.props.onClose();
4407
4409
  });
4408
4410
 
@@ -4472,7 +4474,7 @@ class order_Order extends common/* Com */.up {
4472
4474
  return null;
4473
4475
  let editmode = false;
4474
4476
 
4475
- if (!order.status || order.status == 'new') {
4477
+ if (!order.status || order.status == 'open') {
4476
4478
  editmode = !order.user_confirmation;
4477
4479
  }
4478
4480
 
@@ -4563,7 +4565,7 @@ class order_Order extends common/* Com */.up {
4563
4565
  renderDesktopShipping(order) {
4564
4566
  let editmode = false;
4565
4567
 
4566
- if (!order.status || order.status == 'new') {
4568
+ if (!order.status || order.status == 'open') {
4567
4569
  editmode = !order.user_confirmation;
4568
4570
  }
4569
4571
 
@@ -4864,7 +4866,7 @@ class order_Order extends common/* Com */.up {
4864
4866
  }, (0,preact_module.h)("div", null, "Ph\xED v\u1EADn chuy\u1EC3n"), (0,preact_module.h)("div", null, util/* default.get */.Z.get(order, 'shipping.fee', 0), " d"));
4865
4867
  let editmode = false;
4866
4868
 
4867
- if (!order.status || order.status == 'new') {
4869
+ if (!order.status || order.status == 'open') {
4868
4870
  editmode = !order.user_confirmation;
4869
4871
  }
4870
4872
 
@@ -4900,7 +4902,7 @@ class order_Order extends common/* Com */.up {
4900
4902
  }
4901
4903
 
4902
4904
  renderStatusBadge(order) {
4903
- let status = order.status || 'new';
4905
+ let status = order.status || 'open';
4904
4906
  return (0,preact_module.h)("div", {
4905
4907
  style: "float: right !important;",
4906
4908
  class: 'order_status order_status__' + status
@@ -4908,7 +4910,7 @@ class order_Order extends common/* Com */.up {
4908
4910
  }
4909
4911
 
4910
4912
  renderShippingInfo(order) {
4911
- if (order.status != 'new' || order.user_confirmation) {}
4913
+ if (order.status != 'open' || order.user_confirmation) {}
4912
4914
 
4913
4915
  let shipping_provider = util/* default.get */.Z.get(order, 'shipping.shipping_provider');
4914
4916
  if (!shipping_provider) return null;
@@ -5008,7 +5010,7 @@ class order_Order extends common/* Com */.up {
5008
5010
  let $products = null;
5009
5011
  let editmode = false;
5010
5012
 
5011
- if (!order.status || order.status == 'new') {
5013
+ if (!order.status || order.status == 'open') {
5012
5014
  editmode = !order.user_confirmation;
5013
5015
  }
5014
5016
 
@@ -5112,7 +5114,7 @@ class order_Order extends common/* Com */.up {
5112
5114
  onClick: this.onCancel
5113
5115
  }, this.props.t('cancel_order'));
5114
5116
 
5115
- if (order.user_confirmation || order.status != 'new') {
5117
+ if (order.user_confirmation || order.status != 'open') {
5116
5118
  $status = null;
5117
5119
  if (this.props.cid) $close = (0,preact_module.h)("div", {
5118
5120
  class: "order_btn order__btn__light mt-3",
@@ -5144,7 +5146,7 @@ class order_Order extends common/* Com */.up {
5144
5146
  let $actions = null;
5145
5147
  let editmode = false;
5146
5148
 
5147
- if (!order.status || order.status == 'new') {
5149
+ if (!order.status || order.status == 'open') {
5148
5150
  editmode = !order.user_confirmation;
5149
5151
  }
5150
5152