@fonixtree/magic-design 0.2.3 → 0.2.6

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 (69) hide show
  1. package/es/assets/fonts/.DS_Store +0 -0
  2. package/es/common/LinkModal/CustomTable/index.js +1 -0
  3. package/es/common/MyModal/index.less +12 -4
  4. package/es/composite-comp/ashita/components/WalletAshita/defaultJSON.js +250 -0
  5. package/es/composite-comp/ashita/components/WalletAshita/index.js +84 -0
  6. package/es/composite-comp/ashita/components/WalletAshita/mobile/index.js +613 -0
  7. package/es/composite-comp/ashita/components/WalletAshita/mobile/index.less +103 -0
  8. package/es/composite-comp/ashita/components/WalletAshita/pc/index.js +359 -0
  9. package/es/composite-comp/ashita/components/WalletAshita/pc/index.less +1 -0
  10. package/es/composite-comp/ashita/config-panels/WalletAshitaConfig/WalletConfigContent/index.js +93 -0
  11. package/es/composite-comp/ashita/config-panels/WalletAshitaConfig/WalletConfigContent/index.less +0 -0
  12. package/es/composite-comp/ashita/config-panels/WalletAshitaConfig/WalletConfigImageGroup/index.js +145 -0
  13. package/es/composite-comp/ashita/config-panels/WalletAshitaConfig/WalletConfigImageGroup/index.less +0 -0
  14. package/es/composite-comp/ashita/config-panels/WalletAshitaConfig/WalletConfigSetting/index.js +201 -0
  15. package/es/composite-comp/ashita/config-panels/WalletAshitaConfig/WalletConfigSetting/index.less +9 -0
  16. package/es/composite-comp/ashita/config-panels/WalletAshitaConfig/imgs/defaultImg.png +0 -0
  17. package/es/composite-comp/ashita/config-panels/WalletAshitaConfig/index.js +77 -0
  18. package/es/composite-comp/ashita/second-config-panels/WalletAshitaSecondConfig/index.js +188 -0
  19. package/es/composite-comp/ashita/second-config-panels/WalletAshitaSecondConfig/index.less +9 -0
  20. package/es/composite-comp/bol/components/ImageGallery/mobile/index.less +3 -0
  21. package/es/composite-comp/public/components/Wallet/defaultJSON.js +145 -0
  22. package/es/composite-comp/public/components/Wallet/index.js +84 -0
  23. package/es/composite-comp/public/components/Wallet/mobile/index.js +350 -0
  24. package/es/composite-comp/public/components/Wallet/mobile/index.less +22 -0
  25. package/es/composite-comp/public/config-panels/WalletConfig/GroupList/defaultImg.png +0 -0
  26. package/es/composite-comp/public/config-panels/WalletConfig/GroupList/index.js +100 -0
  27. package/es/composite-comp/public/config-panels/WalletConfig/GroupList/index.less +72 -0
  28. package/es/composite-comp/public/config-panels/WalletConfig/WalletConfigImageGroup/index.js +123 -0
  29. package/es/composite-comp/public/config-panels/WalletConfig/WalletConfigImageGroup/index.less +0 -0
  30. package/es/composite-comp/public/config-panels/WalletConfig/imgs/defaultImg.png +0 -0
  31. package/es/composite-comp/public/config-panels/WalletConfig/index.js +61 -0
  32. package/es/composite-comp/public/second-config-panels/WalletSecondConfig/index.js +152 -0
  33. package/es/constants/component-types.js +15 -9
  34. package/es/constants/index.js +19 -10
  35. package/lib/assets/fonts/.DS_Store +0 -0
  36. package/lib/common/LinkModal/CustomTable/index.js +1 -0
  37. package/lib/common/MyModal/index.less +12 -4
  38. package/lib/composite-comp/ashita/components/WalletAshita/defaultJSON.js +250 -0
  39. package/lib/composite-comp/ashita/components/WalletAshita/index.js +84 -0
  40. package/lib/composite-comp/ashita/components/WalletAshita/mobile/index.js +613 -0
  41. package/lib/composite-comp/ashita/components/WalletAshita/mobile/index.less +103 -0
  42. package/lib/composite-comp/ashita/components/WalletAshita/pc/index.js +359 -0
  43. package/lib/composite-comp/ashita/components/WalletAshita/pc/index.less +1 -0
  44. package/lib/composite-comp/ashita/config-panels/WalletAshitaConfig/WalletConfigContent/index.js +93 -0
  45. package/lib/composite-comp/ashita/config-panels/WalletAshitaConfig/WalletConfigContent/index.less +0 -0
  46. package/lib/composite-comp/ashita/config-panels/WalletAshitaConfig/WalletConfigImageGroup/index.js +145 -0
  47. package/lib/composite-comp/ashita/config-panels/WalletAshitaConfig/WalletConfigImageGroup/index.less +0 -0
  48. package/lib/composite-comp/ashita/config-panels/WalletAshitaConfig/WalletConfigSetting/index.js +201 -0
  49. package/lib/composite-comp/ashita/config-panels/WalletAshitaConfig/WalletConfigSetting/index.less +9 -0
  50. package/lib/composite-comp/ashita/config-panels/WalletAshitaConfig/imgs/defaultImg.png +0 -0
  51. package/lib/composite-comp/ashita/config-panels/WalletAshitaConfig/index.js +77 -0
  52. package/lib/composite-comp/ashita/second-config-panels/WalletAshitaSecondConfig/index.js +188 -0
  53. package/lib/composite-comp/ashita/second-config-panels/WalletAshitaSecondConfig/index.less +9 -0
  54. package/lib/composite-comp/bol/components/ImageGallery/mobile/index.less +3 -0
  55. package/lib/composite-comp/public/components/Wallet/defaultJSON.js +145 -0
  56. package/lib/composite-comp/public/components/Wallet/index.js +84 -0
  57. package/lib/composite-comp/public/components/Wallet/mobile/index.js +350 -0
  58. package/lib/composite-comp/public/components/Wallet/mobile/index.less +22 -0
  59. package/lib/composite-comp/public/config-panels/WalletConfig/GroupList/defaultImg.png +0 -0
  60. package/lib/composite-comp/public/config-panels/WalletConfig/GroupList/index.js +100 -0
  61. package/lib/composite-comp/public/config-panels/WalletConfig/GroupList/index.less +72 -0
  62. package/lib/composite-comp/public/config-panels/WalletConfig/WalletConfigImageGroup/index.js +123 -0
  63. package/lib/composite-comp/public/config-panels/WalletConfig/WalletConfigImageGroup/index.less +0 -0
  64. package/lib/composite-comp/public/config-panels/WalletConfig/imgs/defaultImg.png +0 -0
  65. package/lib/composite-comp/public/config-panels/WalletConfig/index.js +61 -0
  66. package/lib/composite-comp/public/second-config-panels/WalletSecondConfig/index.js +152 -0
  67. package/lib/constants/component-types.js +15 -9
  68. package/lib/constants/index.js +19 -10
  69. package/package.json +1 -1
@@ -0,0 +1,613 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+
12
+ var _locale = require("../../../../../locale");
13
+
14
+ var _components = require("../../../../../meta-comp/components");
15
+
16
+ var _mobx = require("../../../../../mobx");
17
+
18
+ var _coreUtil = require("../../../../../utils/coreUtil");
19
+
20
+ var _commonUtil = require("../../../../../utils/commonUtil");
21
+
22
+ var _common = require("../../../../../common");
23
+
24
+ var _constants = require("../../../../../constants");
25
+
26
+ var _currencyUtil = require("../../../../../utils/currencyUtil");
27
+
28
+ var _ConfigPanel = require("../../../../../core/Designer/ConfigPanel");
29
+
30
+ require("./index.less");
31
+
32
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
33
+
34
+ var __extends = void 0 && (void 0).__extends || function () {
35
+ var _extendStatics = function extendStatics(d, b) {
36
+ _extendStatics = Object.setPrototypeOf || {
37
+ __proto__: []
38
+ } instanceof Array && function (d, b) {
39
+ d.__proto__ = b;
40
+ } || function (d, b) {
41
+ for (var p in b) {
42
+ if (b.hasOwnProperty(p)) d[p] = b[p];
43
+ }
44
+ };
45
+
46
+ return _extendStatics(d, b);
47
+ };
48
+
49
+ return function (d, b) {
50
+ _extendStatics(d, b);
51
+
52
+ function __() {
53
+ this.constructor = d;
54
+ }
55
+
56
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
57
+ };
58
+ }();
59
+
60
+ var __assign = void 0 && (void 0).__assign || function () {
61
+ __assign = Object.assign || function (t) {
62
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
63
+ s = arguments[i];
64
+
65
+ for (var p in s) {
66
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
67
+ }
68
+ }
69
+
70
+ return t;
71
+ };
72
+
73
+ return __assign.apply(this, arguments);
74
+ };
75
+
76
+ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
77
+ function adopt(value) {
78
+ return value instanceof P ? value : new P(function (resolve) {
79
+ resolve(value);
80
+ });
81
+ }
82
+
83
+ return new (P || (P = Promise))(function (resolve, reject) {
84
+ function fulfilled(value) {
85
+ try {
86
+ step(generator.next(value));
87
+ } catch (e) {
88
+ reject(e);
89
+ }
90
+ }
91
+
92
+ function rejected(value) {
93
+ try {
94
+ step(generator["throw"](value));
95
+ } catch (e) {
96
+ reject(e);
97
+ }
98
+ }
99
+
100
+ function step(result) {
101
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
102
+ }
103
+
104
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
105
+ });
106
+ };
107
+
108
+ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
109
+ var _ = {
110
+ label: 0,
111
+ sent: function sent() {
112
+ if (t[0] & 1) throw t[1];
113
+ return t[1];
114
+ },
115
+ trys: [],
116
+ ops: []
117
+ },
118
+ f,
119
+ y,
120
+ t,
121
+ g;
122
+ return g = {
123
+ next: verb(0),
124
+ "throw": verb(1),
125
+ "return": verb(2)
126
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
127
+ return this;
128
+ }), g;
129
+
130
+ function verb(n) {
131
+ return function (v) {
132
+ return step([n, v]);
133
+ };
134
+ }
135
+
136
+ function step(op) {
137
+ if (f) throw new TypeError("Generator is already executing.");
138
+
139
+ while (_) {
140
+ try {
141
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
142
+ if (y = 0, t) op = [op[0] & 2, t.value];
143
+
144
+ switch (op[0]) {
145
+ case 0:
146
+ case 1:
147
+ t = op;
148
+ break;
149
+
150
+ case 4:
151
+ _.label++;
152
+ return {
153
+ value: op[1],
154
+ done: false
155
+ };
156
+
157
+ case 5:
158
+ _.label++;
159
+ y = op[1];
160
+ op = [0];
161
+ continue;
162
+
163
+ case 7:
164
+ op = _.ops.pop();
165
+
166
+ _.trys.pop();
167
+
168
+ continue;
169
+
170
+ default:
171
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
172
+ _ = 0;
173
+ continue;
174
+ }
175
+
176
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
177
+ _.label = op[1];
178
+ break;
179
+ }
180
+
181
+ if (op[0] === 6 && _.label < t[1]) {
182
+ _.label = t[1];
183
+ t = op;
184
+ break;
185
+ }
186
+
187
+ if (t && _.label < t[2]) {
188
+ _.label = t[2];
189
+
190
+ _.ops.push(op);
191
+
192
+ break;
193
+ }
194
+
195
+ if (t[2]) _.ops.pop();
196
+
197
+ _.trys.pop();
198
+
199
+ continue;
200
+ }
201
+
202
+ op = body.call(thisArg, _);
203
+ } catch (e) {
204
+ op = [6, e];
205
+ y = 0;
206
+ } finally {
207
+ f = t = 0;
208
+ }
209
+ }
210
+
211
+ if (op[0] & 5) throw op[1];
212
+ return {
213
+ value: op[0] ? op[1] : void 0,
214
+ done: true
215
+ };
216
+ }
217
+ };
218
+
219
+ var MOBILE_IMG_SIZE = {
220
+ 2: {
221
+ maxW: 165,
222
+ maxH: 92,
223
+ gap: 12
224
+ },
225
+ 3: {
226
+ maxW: 106,
227
+ maxH: 68,
228
+ gap: 12
229
+ }
230
+ };
231
+
232
+ var WalletMobile =
233
+ /** @class */
234
+ function (_super) {
235
+ __extends(WalletMobile, _super);
236
+
237
+ function WalletMobile() {
238
+ var _this = _super !== null && _super.apply(this, arguments) || this;
239
+
240
+ _this.carouselRef = /*#__PURE__*/_react["default"].createRef();
241
+ _this.state = {
242
+ sliderIndex: 0,
243
+ userWalletData: {}
244
+ };
245
+ _this.destroy = null;
246
+
247
+ _this.getMyWalletData = function () {
248
+ return __awaiter(_this, void 0, void 0, function () {
249
+ var data, _a, userCreditResps, userCashbackValues, userBalance, userPoint, defaultShowWallet, bnplObj, creditObj, B2BObj;
250
+
251
+ var _b;
252
+
253
+ var _this = this;
254
+
255
+ return __generator(this, function (_c) {
256
+ switch (_c.label) {
257
+ case 0:
258
+ data = this.props.data;
259
+ return [4
260
+ /*yield*/
261
+ , (0, _commonUtil.commonFetch)('/designer/v1/h5/mywallet/list', {}, 'GET')];
262
+
263
+ case 1:
264
+ _a = _c.sent(), userCreditResps = _a.userCreditResps, userCashbackValues = _a.userCashbackValues, userBalance = _a.userBalance, userPoint = _a.userPoint, defaultShowWallet = _a.defaultShowWallet;
265
+ bnplObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
266
+ return item.creditId === 1;
267
+ });
268
+ creditObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
269
+ return item.creditId === 2;
270
+ });
271
+ B2BObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
272
+ return item.creditId === 3;
273
+ });
274
+ this.setState({
275
+ userWalletData: (_b = {}, _b[_constants.walletType.BNPL] = {
276
+ amount: userCreditResps === null ? '****' : bnplObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(bnplObj.availableAmount) : (0, _locale.i18n)('APPLY'),
277
+ show: userCreditResps === null || [_constants.CREDIT_STATE.APPROVED.KEY].includes(bnplObj === null || bnplObj === void 0 ? void 0 : bnplObj.state)
278
+ }, _b[_constants.walletType.CREDIT] = {
279
+ amount: userCreditResps === null ? '****' : creditObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(creditObj.availableAmount) : (0, _locale.i18n)('APPLY'),
280
+ show: userCreditResps === null || [_constants.CREDIT_STATE.APPROVED.KEY].includes(creditObj === null || creditObj === void 0 ? void 0 : creditObj.state)
281
+ }, _b[_constants.walletType.B2B] = {
282
+ amount: userCreditResps === null ? '****' : B2BObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(B2BObj.availableAmount) : (0, _locale.i18n)('APPLY'),
283
+ text: B2BObj ? (0, _locale.i18n)('ADD_MORE_PRODUCTS_TO_YOUR_SHOP') : '',
284
+ btnText: B2BObj ? (0, _locale.i18n)('PROCURE_PRODUCT') : '',
285
+ show: userCreditResps === null || [_constants.CREDIT_STATE.APPROVED.KEY].includes(B2BObj === null || B2BObj === void 0 ? void 0 : B2BObj.state)
286
+ }, _b[_constants.walletType.CASHBACK] = {
287
+ amount: userCashbackValues === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userCashbackValues),
288
+ show: true
289
+ }, _b[_constants.walletType.BALANCE] = {
290
+ amount: userBalance === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userBalance),
291
+ btnText: userBalance ? (0, _locale.i18n)('SOCIAL_COMMERCE') : '',
292
+ show: true
293
+ }, _b[_constants.walletType.CENDUIT] = {
294
+ amount: userPoint === null ? '****' : userPoint,
295
+ btnText: userPoint ? (0, _locale.i18n)('CENDUIT_MALL') : '',
296
+ show: true
297
+ }, _b)
298
+ }, function () {
299
+ var _a;
300
+
301
+ if (data.customize.layout === 'layout2' && _this.carouselRef) {
302
+ var userWalletData_1 = _this.state.userWalletData;
303
+
304
+ var _groupSource = data.groupSource.filter(function (f) {
305
+ var _a;
306
+
307
+ return (_a = userWalletData_1[f.sourceType]) === null || _a === void 0 ? void 0 : _a.show;
308
+ });
309
+
310
+ var defaultShowIndex_1 = 0;
311
+
312
+ _groupSource.forEach(function (f, i) {
313
+ if (f.sourceType === defaultShowWallet) defaultShowIndex_1 = i;
314
+ });
315
+
316
+ (_a = _this.carouselRef.current) === null || _a === void 0 ? void 0 : _a.slideTo(defaultShowIndex_1);
317
+ }
318
+ });
319
+ return [2
320
+ /*return*/
321
+ ];
322
+ }
323
+ });
324
+ });
325
+ };
326
+
327
+ _this.mouseEnterBtn = function (e) {
328
+ var _a, _b;
329
+
330
+ var data = _this.props.data;
331
+
332
+ if ((_a = data.setting.navigation) === null || _a === void 0 ? void 0 : _a.hoverColor) {
333
+ e.target.style.color = data.setting.navigation.hoverColor;
334
+ }
335
+
336
+ if ((_b = data.setting.navigation) === null || _b === void 0 ? void 0 : _b.hoverSize) {
337
+ e.target.style.fontSize = data.setting.navigation.hoverSize;
338
+ }
339
+ };
340
+
341
+ _this.mouseLeaveBtn = function (e) {
342
+ var _a, _b;
343
+
344
+ var data = _this.props.data;
345
+
346
+ if ((_a = data.setting.navigation) === null || _a === void 0 ? void 0 : _a.color) {
347
+ e.target.style.color = data.setting.navigation.color;
348
+ }
349
+
350
+ if ((_b = data.setting.navigation) === null || _b === void 0 ? void 0 : _b.size) {
351
+ e.target.style.fontSize = data.setting.navigation.size;
352
+ }
353
+ };
354
+
355
+ _this.sliderGoTo = function (groupSource) {
356
+ var nextIndex = groupSource.findIndex(function (item) {
357
+ return item.id === _mobx.store.clickedGroup;
358
+ });
359
+
360
+ if (nextIndex != -1 && nextIndex != _this.state.sliderIndex) {
361
+ _this.carouselRef.current.slideTo(nextIndex);
362
+ }
363
+ };
364
+
365
+ return _this;
366
+ }
367
+
368
+ WalletMobile.prototype.componentDidMount = function () {
369
+ var _this = this;
370
+
371
+ this.getMyWalletData();
372
+ this.destroy = (0, _mobx.autorun)(function () {
373
+ var _a;
374
+
375
+ if (_this.props.data.customize.layout === 'layout2' && _this.carouselRef) {
376
+ _this.sliderGoTo(_this.props.data.groupSource);
377
+ /** 设计器模式下 如果选中特定group 自动播放关闭 */
378
+
379
+
380
+ if ((0, _coreUtil.isDesignMode)() && _mobx.store.clickedGroup) {
381
+ (_a = _this.carouselRef.current) === null || _a === void 0 ? void 0 : _a.stopPlay();
382
+ }
383
+ }
384
+ });
385
+ };
386
+
387
+ WalletMobile.prototype.componentWillReceiveProps = function (nextProps) {
388
+ var _a, _b;
389
+
390
+ if (nextProps.data.customize.layout === 'layout2' && this.carouselRef) {
391
+ this.sliderGoTo(nextProps.data.groupSource);
392
+
393
+ if (nextProps.data.setting.autoplay.open) {
394
+ (_a = this.carouselRef.current) === null || _a === void 0 ? void 0 : _a.startPlay();
395
+ } else {
396
+ (_b = this.carouselRef.current) === null || _b === void 0 ? void 0 : _b.stopPlay();
397
+ }
398
+ }
399
+ };
400
+
401
+ WalletMobile.prototype.render = function () {
402
+ var _this = this;
403
+
404
+ var _a, _b, _c, _d, _e, _f, _g, _h;
405
+
406
+ var data = this.props.data;
407
+ var _j = this.state,
408
+ sliderIndex = _j.sliderIndex,
409
+ userWalletData = _j.userWalletData;
410
+ var colNum = data.customize.rowNum;
411
+ var autoplay = (_b = (_a = data.setting) === null || _a === void 0 ? void 0 : _a.autoplay) === null || _b === void 0 ? void 0 : _b.open;
412
+
413
+ var _groupSource = data.groupSource.filter(function (f) {
414
+ var _a;
415
+
416
+ return (_a = userWalletData[f.sourceType]) === null || _a === void 0 ? void 0 : _a.show;
417
+ });
418
+ /** 设计器模式下 如果选中特定group 自动播放关闭 */
419
+
420
+
421
+ if ((0, _coreUtil.isDesignMode)() && _mobx.store.clickedGroup) {
422
+ autoplay = false;
423
+ }
424
+
425
+ var navStyle = {
426
+ fontSize: (0, _commonUtil.convertToRem)((_d = (_c = data.setting) === null || _c === void 0 ? void 0 : _c.navigation) === null || _d === void 0 ? void 0 : _d.size),
427
+ color: (_f = (_e = data.setting) === null || _e === void 0 ? void 0 : _e.navigation) === null || _f === void 0 ? void 0 : _f.color
428
+ };
429
+
430
+ var getItemContent = function getItemContent(item, preItem, nextItem) {
431
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
432
+
433
+ var data = _this.props.data;
434
+ var userWalletData = _this.state.userWalletData;
435
+ var GAData = (0, _commonUtil.getGAData)(data);
436
+ var _bgStyle = {};
437
+
438
+ if (item.background) {
439
+ if (item.background.bgType === 'color') {
440
+ _bgStyle.backgroundColor = item.background.color;
441
+ _bgStyle.opacity = item.background.opacity ? item.background.opacity : 1;
442
+ } else {
443
+ _bgStyle.backgroundImage = "url(" + item.background.image + ")";
444
+ _bgStyle.backgroundPosition = 'center';
445
+ _bgStyle.backgroundSize = 'cover';
446
+ }
447
+ }
448
+
449
+ item.text.text = ((_a = userWalletData[item.sourceType]) === null || _a === void 0 ? void 0 : _a.text) || (0, _locale.i18n)('MAKE_MONEY_AND_SHOP_ON_CENDOL');
450
+ return /*#__PURE__*/_react["default"].createElement("div", {
451
+ className: "text-content",
452
+ style: _bgStyle
453
+ }, ((_b = item.title) === null || _b === void 0 ? void 0 : _b.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
454
+ className: "title",
455
+ data: item.title,
456
+ GAData: __assign(__assign({}, GAData), {
457
+ groupId: item.id,
458
+ groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
459
+ })
460
+ }), ((_c = item.amount) === null || _c === void 0 ? void 0 : _c.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
461
+ className: "amount",
462
+ data: __assign(__assign({}, item.amount), {
463
+ text: (_d = userWalletData[item.sourceType]) === null || _d === void 0 ? void 0 : _d.amount
464
+ }),
465
+ GAData: __assign(__assign({}, GAData), {
466
+ groupId: item.id,
467
+ groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
468
+ }),
469
+ readonly: true
470
+ }), ((_e = item.text) === null || _e === void 0 ? void 0 : _e.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
471
+ className: "text",
472
+ data: item.text,
473
+ GAData: __assign(__assign({}, GAData), {
474
+ groupId: item.id,
475
+ groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
476
+ })
477
+ }), ((_f = item.button) === null || _f === void 0 ? void 0 : _f.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
478
+ className: "wallet-btn",
479
+ data: __assign(__assign({}, item.button), {
480
+ text: ((_g = userWalletData[item.sourceType]) === null || _g === void 0 ? void 0 : _g.btnText) || (0, _locale.i18n)('LETS_GO')
481
+ }),
482
+ GAData: __assign(__assign({}, GAData), {
483
+ groupId: item.id,
484
+ groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
485
+ })
486
+ }), data.customize.layout === 'layout2' && ((_h = item.peek) === null || _h === void 0 ? void 0 : _h.open) && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
487
+ className: "peek left"
488
+ }, /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
489
+ data: __assign(__assign({}, item.peek), {
490
+ text: "" + (((_j = preItem === null || preItem === void 0 ? void 0 : preItem.title) === null || _j === void 0 ? void 0 : _j.text) || '')
491
+ }),
492
+ GAData: __assign(__assign({}, GAData), {
493
+ groupId: item.id,
494
+ groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
495
+ }),
496
+ readonly: true
497
+ }), /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
498
+ data: __assign(__assign({}, item.peek), {
499
+ text: "" + (((_k = userWalletData[preItem === null || preItem === void 0 ? void 0 : preItem.sourceType]) === null || _k === void 0 ? void 0 : _k.amount) || '')
500
+ }),
501
+ GAData: __assign(__assign({}, GAData), {
502
+ groupId: item.id,
503
+ groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
504
+ }),
505
+ readonly: true
506
+ })), /*#__PURE__*/_react["default"].createElement("div", {
507
+ className: "peek right"
508
+ }, /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
509
+ data: __assign(__assign({}, item.peek), {
510
+ text: "" + (((_l = nextItem === null || nextItem === void 0 ? void 0 : nextItem.title) === null || _l === void 0 ? void 0 : _l.text) || '')
511
+ }),
512
+ GAData: __assign(__assign({}, GAData), {
513
+ groupId: item.id,
514
+ groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
515
+ }),
516
+ readonly: true
517
+ }), /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
518
+ data: __assign(__assign({}, item.peek), {
519
+ text: "" + (((_m = userWalletData[nextItem === null || nextItem === void 0 ? void 0 : nextItem.sourceType]) === null || _m === void 0 ? void 0 : _m.amount) || '')
520
+ }),
521
+ GAData: __assign(__assign({}, GAData), {
522
+ groupId: item.id,
523
+ groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
524
+ }),
525
+ readonly: true
526
+ }))));
527
+ };
528
+
529
+ return /*#__PURE__*/_react["default"].createElement("div", {
530
+ className: "m-Wallet-mobile"
531
+ }, data.title.headline.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
532
+ className: "headline",
533
+ data: data.title.headline
534
+ }), data.customize.layout === 'layout1' ? /*#__PURE__*/_react["default"].createElement("div", {
535
+ className: "column-layout column_" + colNum,
536
+ style: (0, _commonUtil.pxToRem)({
537
+ gap: MOBILE_IMG_SIZE[colNum].gap
538
+ })
539
+ }, _groupSource.map(function (item) {
540
+ return /*#__PURE__*/_react["default"].createElement("div", {
541
+ key: item.id,
542
+ className: "item-wrap",
543
+ style: (0, _commonUtil.pxToRem)({
544
+ width: "calc((100% - " + (0, _commonUtil.convertToRem)(MOBILE_IMG_SIZE[colNum].gap * (colNum - 1)) + ") / " + colNum + ")"
545
+ })
546
+ }, getItemContent(item));
547
+ })) : /*#__PURE__*/_react["default"].createElement("div", {
548
+ className: "carousel-layout"
549
+ }, data.setting.navigation.open && _groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
550
+ className: "carousel-icon-left",
551
+ onClick: function onClick() {
552
+ return _this.carouselRef.current.toPrev();
553
+ },
554
+ onMouseEnter: this.mouseEnterBtn,
555
+ onMouseLeave: this.mouseLeaveBtn,
556
+ style: navStyle,
557
+ type: "icon-left"
558
+ }), /*#__PURE__*/_react["default"].createElement(_common.CardCarousel, {
559
+ ref: this.carouselRef,
560
+ autoplay: autoplay,
561
+ delay: ((_h = (_g = data.setting) === null || _g === void 0 ? void 0 : _g.autoplay) === null || _h === void 0 ? void 0 : _h.interval) * 1000,
562
+ onChange: function onChange(index) {
563
+ return _this.setState({
564
+ sliderIndex: index
565
+ });
566
+ }
567
+ }, _groupSource.map(function (item, index) {
568
+ var preItemFirst = _groupSource.length > 1 ? _groupSource[_groupSource.length - 1] : null;
569
+ var preItemLast = _groupSource.length > 1 ? _groupSource[0] : null;
570
+ var preItem = index === 0 ? preItemFirst : _groupSource[index - 1];
571
+ var nextItem = index === _groupSource.length - 1 ? preItemLast : _groupSource[index + 1];
572
+ return /*#__PURE__*/_react["default"].createElement("div", {
573
+ key: item.id,
574
+ className: "item-wrap"
575
+ }, getItemContent(item, preItem, nextItem));
576
+ })), data.setting.navigation.open && _groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
577
+ className: "carousel-icon-right",
578
+ onClick: function onClick() {
579
+ return _this.carouselRef.current.toNext();
580
+ },
581
+ onMouseEnter: this.mouseEnterBtn,
582
+ onMouseLeave: this.mouseLeaveBtn,
583
+ style: navStyle,
584
+ type: "icon-right"
585
+ }), data.setting.dots.open && _groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement("div", {
586
+ className: "swiper-ban"
587
+ }, _groupSource.map(function (item, i) {
588
+ return /*#__PURE__*/_react["default"].createElement("div", {
589
+ key: i,
590
+ className: (0, _classnames["default"])('ban', {
591
+ active: i == sliderIndex
592
+ }),
593
+ onClick: function onClick() {
594
+ return _this.carouselRef.current.slideTo(i);
595
+ },
596
+ style: (0, _commonUtil.pxToRem)({
597
+ backgroundColor: i == sliderIndex ? data.setting.dots.hoverColor : data.setting.dots.color,
598
+ fontSize: i == sliderIndex ? data.setting.dots.hoverSize : data.setting.dots.size
599
+ })
600
+ });
601
+ }))));
602
+ };
603
+
604
+ WalletMobile.defaultProps = {
605
+ data: {
606
+ groupSource: []
607
+ }
608
+ };
609
+ return WalletMobile;
610
+ }(_react["default"].Component);
611
+
612
+ var _default = WalletMobile;
613
+ exports["default"] = _default;