@fonixtree/magic-design 2.0.46 → 2.0.48

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.
@@ -6,9 +6,8 @@
6
6
 
7
7
  .cardItem {
8
8
  width: 100%;
9
- height: 218px;
10
9
  border-radius: 10px;
11
- background-color: pink;
10
+ background-color: #fff;
12
11
  position: absolute;
13
12
 
14
13
  &.active {
@@ -21,6 +21,12 @@ Object.defineProperty(exports, "ButtonIconLayout", {
21
21
  return _ButtonIconLayout["default"];
22
22
  }
23
23
  });
24
+ Object.defineProperty(exports, "CardCarousel", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _CardCarousel["default"];
28
+ }
29
+ });
24
30
  Object.defineProperty(exports, "Collapse", {
25
31
  enumerable: true,
26
32
  get: function get() {
@@ -172,4 +178,6 @@ var _InputNumber = _interopRequireDefault(require("./InputNumber"));
172
178
 
173
179
  var _VideoUpload = _interopRequireDefault(require("./VideoUpload"));
174
180
 
181
+ var _CardCarousel = _interopRequireDefault(require("./CardCarousel"));
182
+
175
183
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -9,8 +9,6 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
11
 
12
- var _CardCarousel = _interopRequireDefault(require("src/components/common/CardCarousel"));
13
-
14
12
  var _components = require("../../../../../meta-comp/components");
15
13
 
16
14
  var _mobx = require("../../../../../mobx");
@@ -19,7 +17,7 @@ var _coreUtil = require("../../../../../utils/coreUtil");
19
17
 
20
18
  var _commonUtil = require("../../../../../utils/commonUtil");
21
19
 
22
- var _Iconfont = _interopRequireDefault(require("../../../../../common/Iconfont"));
20
+ var _common = require("../../../../../common");
23
21
 
24
22
  var _constants = require("../../../../../constants");
25
23
 
@@ -315,13 +313,13 @@ function (_super) {
315
313
  }
316
314
 
317
315
  bnplObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
318
- return item.creditId === 1 && [_constants.CREDIT_STATE.APPROVED.KEY, _constants.CREDIT_STATE.LOCKED.KEY].includes(item.state);
316
+ return item.creditId === 1 && [_constants.CREDIT_STATE.APPROVED.KEY].includes(item.state);
319
317
  });
320
318
  creditObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
321
- return item.creditId === 2 && [_constants.CREDIT_STATE.APPROVED.KEY, _constants.CREDIT_STATE.LOCKED.KEY].includes(item.state);
319
+ return item.creditId === 2 && [_constants.CREDIT_STATE.APPROVED.KEY].includes(item.state);
322
320
  });
323
321
  B2BObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
324
- return item.creditId === 3 && [_constants.CREDIT_STATE.APPROVED.KEY, _constants.CREDIT_STATE.LOCKED.KEY].includes(item.state);
322
+ return item.creditId === 3 && [_constants.CREDIT_STATE.APPROVED.KEY].includes(item.state);
325
323
  });
326
324
  this.setState({
327
325
  userWalletData: (_b = {}, _b[_constants.walletType.BNPL] = {
@@ -330,16 +328,16 @@ function (_super) {
330
328
  amount: userCreditResps === null ? '****' : creditObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(creditObj.availableAmount) : 'APPLY'
331
329
  }, _b[_constants.walletType.B2B] = {
332
330
  amount: userCreditResps === null ? '****' : B2BObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(B2BObj.availableAmount) : 'APPLY',
333
- text: B2BObj ? 'Add ore products to your shop!' : '',
334
- btnText: 'Procure Product'
331
+ text: B2BObj ? 'Add more products to your shop!' : '',
332
+ btnText: B2BObj ? 'Procure Product' : ''
335
333
  }, _b[_constants.walletType.CASHBACK] = {
336
334
  amount: userCashbackValues === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userCashbackValues)
337
335
  }, _b[_constants.walletType.BALANCE] = {
338
336
  amount: userBalance === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userBalance),
339
- btnText: 'Social Commerce'
337
+ btnText: userBalance ? 'Social Commerce' : ''
340
338
  }, _b[_constants.walletType.CENDUIT] = {
341
- amount: userPoint === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userPoint),
342
- btnText: 'Cenduit Mall'
339
+ amount: userPoint === null ? '****' : userPoint,
340
+ btnText: userPoint ? 'Cenduit Mall' : ''
343
341
  }, _b)
344
342
  });
345
343
  return [2
@@ -463,36 +461,34 @@ function (_super) {
463
461
  }
464
462
  }
465
463
 
464
+ item.text.text = ((_a = userWalletData[item.sourceType]) === null || _a === void 0 ? void 0 : _a.text) || 'Make money and shop on Cendol!';
466
465
  return /*#__PURE__*/_react["default"].createElement("div", {
467
466
  className: "text-content",
468
467
  style: _bgStyle
469
- }, ((_a = item.title) === null || _a === void 0 ? void 0 : _a.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
468
+ }, ((_b = item.title) === null || _b === void 0 ? void 0 : _b.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
470
469
  className: "title",
471
470
  data: item.title,
472
471
  GAData: __assign(__assign({}, GAData), {
473
472
  groupId: item.id,
474
473
  groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
475
474
  })
476
- }), ((_b = item.amount) === null || _b === void 0 ? void 0 : _b.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
475
+ }), ((_c = item.amount) === null || _c === void 0 ? void 0 : _c.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
477
476
  className: "amount",
478
477
  data: __assign(__assign({}, item.amount), {
479
- text: (_c = userWalletData[item.sourceType]) === null || _c === void 0 ? void 0 : _c.amount
478
+ text: (_d = userWalletData[item.sourceType]) === null || _d === void 0 ? void 0 : _d.amount
480
479
  }),
481
480
  GAData: __assign(__assign({}, GAData), {
482
481
  groupId: item.id,
483
482
  groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
484
483
  }),
485
484
  readonly: true
486
- }), ((_d = item.text) === null || _d === void 0 ? void 0 : _d.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
485
+ }), ((_e = item.text) === null || _e === void 0 ? void 0 : _e.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
487
486
  className: "text",
488
- data: __assign(__assign({}, item.text), {
489
- text: ((_e = userWalletData[item.sourceType]) === null || _e === void 0 ? void 0 : _e.text) || 'Make money and shop on Cendol!'
490
- }),
487
+ data: item.text,
491
488
  GAData: __assign(__assign({}, GAData), {
492
489
  groupId: item.id,
493
490
  groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
494
- }),
495
- readonly: true
491
+ })
496
492
  }), ((_f = item.button) === null || _f === void 0 ? void 0 : _f.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
497
493
  className: "wallet-btn",
498
494
  data: __assign(__assign({}, item.button), {
@@ -565,7 +561,7 @@ function (_super) {
565
561
  }, getItemContent(item));
566
562
  })) : /*#__PURE__*/_react["default"].createElement("div", {
567
563
  className: "carousel-layout"
568
- }, data.setting.navigation.open && data.groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
564
+ }, data.setting.navigation.open && data.groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
569
565
  className: "carousel-icon-left",
570
566
  onClick: function onClick() {
571
567
  return _this.carouselRef.current.toPrev();
@@ -574,7 +570,7 @@ function (_super) {
574
570
  onMouseLeave: this.mouseLeaveBtn,
575
571
  style: navStyle,
576
572
  type: "icon-left"
577
- }), /*#__PURE__*/_react["default"].createElement(_CardCarousel["default"], {
573
+ }), /*#__PURE__*/_react["default"].createElement(_common.CardCarousel, {
578
574
  ref: this.carouselRef,
579
575
  autoplay: autoplay,
580
576
  delay: ((_h = (_g = data.setting) === null || _g === void 0 ? void 0 : _g.autoplay) === null || _h === void 0 ? void 0 : _h.interval) * 1000,
@@ -592,7 +588,7 @@ function (_super) {
592
588
  key: item.id,
593
589
  className: "item-wrap"
594
590
  }, getItemContent(item, preItem, nextItem));
595
- })), data.setting.navigation.open && data.groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
591
+ })), data.setting.navigation.open && data.groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
596
592
  className: "carousel-icon-right",
597
593
  onClick: function onClick() {
598
594
  return _this.carouselRef.current.toNext();
@@ -102,8 +102,7 @@ var Renderer = function Renderer(props) {
102
102
  magic_design: "",
103
103
  style: {
104
104
  height: '100%',
105
- background: pageBackground,
106
- overflow: 'auto'
105
+ background: pageBackground
107
106
  }
108
107
  }, floors.length > 0 && floors.map(function (nodeData, moduleIndex) {
109
108
  var Clazz = _componentTypes.componentMap[nodeData.type];
@@ -6,9 +6,8 @@
6
6
 
7
7
  .cardItem {
8
8
  width: 100%;
9
- height: 218px;
10
9
  border-radius: 10px;
11
- background-color: pink;
10
+ background-color: #fff;
12
11
  position: absolute;
13
12
 
14
13
  &.active {
@@ -21,6 +21,12 @@ Object.defineProperty(exports, "ButtonIconLayout", {
21
21
  return _ButtonIconLayout["default"];
22
22
  }
23
23
  });
24
+ Object.defineProperty(exports, "CardCarousel", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _CardCarousel["default"];
28
+ }
29
+ });
24
30
  Object.defineProperty(exports, "Collapse", {
25
31
  enumerable: true,
26
32
  get: function get() {
@@ -172,4 +178,6 @@ var _InputNumber = _interopRequireDefault(require("./InputNumber"));
172
178
 
173
179
  var _VideoUpload = _interopRequireDefault(require("./VideoUpload"));
174
180
 
181
+ var _CardCarousel = _interopRequireDefault(require("./CardCarousel"));
182
+
175
183
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -9,8 +9,6 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
11
 
12
- var _CardCarousel = _interopRequireDefault(require("src/components/common/CardCarousel"));
13
-
14
12
  var _components = require("../../../../../meta-comp/components");
15
13
 
16
14
  var _mobx = require("../../../../../mobx");
@@ -19,7 +17,7 @@ var _coreUtil = require("../../../../../utils/coreUtil");
19
17
 
20
18
  var _commonUtil = require("../../../../../utils/commonUtil");
21
19
 
22
- var _Iconfont = _interopRequireDefault(require("../../../../../common/Iconfont"));
20
+ var _common = require("../../../../../common");
23
21
 
24
22
  var _constants = require("../../../../../constants");
25
23
 
@@ -315,13 +313,13 @@ function (_super) {
315
313
  }
316
314
 
317
315
  bnplObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
318
- return item.creditId === 1 && [_constants.CREDIT_STATE.APPROVED.KEY, _constants.CREDIT_STATE.LOCKED.KEY].includes(item.state);
316
+ return item.creditId === 1 && [_constants.CREDIT_STATE.APPROVED.KEY].includes(item.state);
319
317
  });
320
318
  creditObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
321
- return item.creditId === 2 && [_constants.CREDIT_STATE.APPROVED.KEY, _constants.CREDIT_STATE.LOCKED.KEY].includes(item.state);
319
+ return item.creditId === 2 && [_constants.CREDIT_STATE.APPROVED.KEY].includes(item.state);
322
320
  });
323
321
  B2BObj = userCreditResps === null || userCreditResps === void 0 ? void 0 : userCreditResps.find(function (item) {
324
- return item.creditId === 3 && [_constants.CREDIT_STATE.APPROVED.KEY, _constants.CREDIT_STATE.LOCKED.KEY].includes(item.state);
322
+ return item.creditId === 3 && [_constants.CREDIT_STATE.APPROVED.KEY].includes(item.state);
325
323
  });
326
324
  this.setState({
327
325
  userWalletData: (_b = {}, _b[_constants.walletType.BNPL] = {
@@ -330,16 +328,16 @@ function (_super) {
330
328
  amount: userCreditResps === null ? '****' : creditObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(creditObj.availableAmount) : 'APPLY'
331
329
  }, _b[_constants.walletType.B2B] = {
332
330
  amount: userCreditResps === null ? '****' : B2BObj ? (0, _currencyUtil.formatCurrencyWithSymbol)(B2BObj.availableAmount) : 'APPLY',
333
- text: B2BObj ? 'Add ore products to your shop!' : '',
334
- btnText: 'Procure Product'
331
+ text: B2BObj ? 'Add more products to your shop!' : '',
332
+ btnText: B2BObj ? 'Procure Product' : ''
335
333
  }, _b[_constants.walletType.CASHBACK] = {
336
334
  amount: userCashbackValues === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userCashbackValues)
337
335
  }, _b[_constants.walletType.BALANCE] = {
338
336
  amount: userBalance === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userBalance),
339
- btnText: 'Social Commerce'
337
+ btnText: userBalance ? 'Social Commerce' : ''
340
338
  }, _b[_constants.walletType.CENDUIT] = {
341
- amount: userPoint === null ? '****' : (0, _currencyUtil.formatCurrencyWithSymbol)(userPoint),
342
- btnText: 'Cenduit Mall'
339
+ amount: userPoint === null ? '****' : userPoint,
340
+ btnText: userPoint ? 'Cenduit Mall' : ''
343
341
  }, _b)
344
342
  });
345
343
  return [2
@@ -463,36 +461,34 @@ function (_super) {
463
461
  }
464
462
  }
465
463
 
464
+ item.text.text = ((_a = userWalletData[item.sourceType]) === null || _a === void 0 ? void 0 : _a.text) || 'Make money and shop on Cendol!';
466
465
  return /*#__PURE__*/_react["default"].createElement("div", {
467
466
  className: "text-content",
468
467
  style: _bgStyle
469
- }, ((_a = item.title) === null || _a === void 0 ? void 0 : _a.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
468
+ }, ((_b = item.title) === null || _b === void 0 ? void 0 : _b.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
470
469
  className: "title",
471
470
  data: item.title,
472
471
  GAData: __assign(__assign({}, GAData), {
473
472
  groupId: item.id,
474
473
  groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
475
474
  })
476
- }), ((_b = item.amount) === null || _b === void 0 ? void 0 : _b.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
475
+ }), ((_c = item.amount) === null || _c === void 0 ? void 0 : _c.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
477
476
  className: "amount",
478
477
  data: __assign(__assign({}, item.amount), {
479
- text: (_c = userWalletData[item.sourceType]) === null || _c === void 0 ? void 0 : _c.amount
478
+ text: (_d = userWalletData[item.sourceType]) === null || _d === void 0 ? void 0 : _d.amount
480
479
  }),
481
480
  GAData: __assign(__assign({}, GAData), {
482
481
  groupId: item.id,
483
482
  groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
484
483
  }),
485
484
  readonly: true
486
- }), ((_d = item.text) === null || _d === void 0 ? void 0 : _d.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
485
+ }), ((_e = item.text) === null || _e === void 0 ? void 0 : _e.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
487
486
  className: "text",
488
- data: __assign(__assign({}, item.text), {
489
- text: ((_e = userWalletData[item.sourceType]) === null || _e === void 0 ? void 0 : _e.text) || 'Make money and shop on Cendol!'
490
- }),
487
+ data: item.text,
491
488
  GAData: __assign(__assign({}, GAData), {
492
489
  groupId: item.id,
493
490
  groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
494
- }),
495
- readonly: true
491
+ })
496
492
  }), ((_f = item.button) === null || _f === void 0 ? void 0 : _f.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
497
493
  className: "wallet-btn",
498
494
  data: __assign(__assign({}, item.button), {
@@ -565,7 +561,7 @@ function (_super) {
565
561
  }, getItemContent(item));
566
562
  })) : /*#__PURE__*/_react["default"].createElement("div", {
567
563
  className: "carousel-layout"
568
- }, data.setting.navigation.open && data.groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
564
+ }, data.setting.navigation.open && data.groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
569
565
  className: "carousel-icon-left",
570
566
  onClick: function onClick() {
571
567
  return _this.carouselRef.current.toPrev();
@@ -574,7 +570,7 @@ function (_super) {
574
570
  onMouseLeave: this.mouseLeaveBtn,
575
571
  style: navStyle,
576
572
  type: "icon-left"
577
- }), /*#__PURE__*/_react["default"].createElement(_CardCarousel["default"], {
573
+ }), /*#__PURE__*/_react["default"].createElement(_common.CardCarousel, {
578
574
  ref: this.carouselRef,
579
575
  autoplay: autoplay,
580
576
  delay: ((_h = (_g = data.setting) === null || _g === void 0 ? void 0 : _g.autoplay) === null || _h === void 0 ? void 0 : _h.interval) * 1000,
@@ -592,7 +588,7 @@ function (_super) {
592
588
  key: item.id,
593
589
  className: "item-wrap"
594
590
  }, getItemContent(item, preItem, nextItem));
595
- })), data.setting.navigation.open && data.groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
591
+ })), data.setting.navigation.open && data.groupSource.length > 1 && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
596
592
  className: "carousel-icon-right",
597
593
  onClick: function onClick() {
598
594
  return _this.carouselRef.current.toNext();
@@ -102,8 +102,7 @@ var Renderer = function Renderer(props) {
102
102
  magic_design: "",
103
103
  style: {
104
104
  height: '100%',
105
- background: pageBackground,
106
- overflow: 'auto'
105
+ background: pageBackground
107
106
  }
108
107
  }, floors.length > 0 && floors.map(function (nodeData, moduleIndex) {
109
108
  var Clazz = _componentTypes.componentMap[nodeData.type];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "2.0.46",
4
+ "version": "2.0.48",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",