@fonixtree/magic-design 0.0.94 → 0.0.97

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 (39) hide show
  1. package/es/composite-comp/bol/components/Banner/pc/index.js +1 -14
  2. package/es/composite-comp/bol/components/Carousel/imgs/pcDefImg1.png +0 -0
  3. package/es/composite-comp/bol/components/Carousel/mobile/index.js +6 -36
  4. package/es/composite-comp/bol/components/Carousel/mobile/index.less +12 -5
  5. package/es/composite-comp/bol/components/Carousel/pc/index.js +6 -36
  6. package/es/composite-comp/bol/components/Carousel/pc/index.less +12 -9
  7. package/es/composite-comp/bol/components/ImageGallery/pc/index.js +1 -1
  8. package/es/composite-comp/common/components/ProductItem/index.less +2 -0
  9. package/es/composite-comp/dito/components/FlashDeal/mobile/index.js +1 -15
  10. package/es/composite-comp/dito/components/FlashDeal/pc/index.js +1 -15
  11. package/es/composite-comp/dito/components/PcNavigation/pc/index.js +6 -0
  12. package/es/composite-comp/dito/components/PcNavigation/pc/index.less +2 -1
  13. package/es/composite-comp/dito/components/Recommend/mobile/index.js +21 -29
  14. package/es/composite-comp/dito/components/Recommend/mobile/index.less +1 -0
  15. package/es/composite-comp/dito/components/Recommend/pc/index.js +31 -32
  16. package/es/composite-comp/dito/components/Recommend/pc/index.less +1 -0
  17. package/es/decorator/compositeDecorator.js +3 -2
  18. package/es/decorator/metaDecorator.js +2 -2
  19. package/es/meta-comp/components/Image/index.less +1 -1
  20. package/lib/composite-comp/bol/components/Banner/pc/index.js +1 -14
  21. package/lib/composite-comp/bol/components/Carousel/imgs/pcDefImg1.png +0 -0
  22. package/lib/composite-comp/bol/components/Carousel/mobile/index.js +6 -36
  23. package/lib/composite-comp/bol/components/Carousel/mobile/index.less +12 -5
  24. package/lib/composite-comp/bol/components/Carousel/pc/index.js +6 -36
  25. package/lib/composite-comp/bol/components/Carousel/pc/index.less +12 -9
  26. package/lib/composite-comp/bol/components/ImageGallery/pc/index.js +1 -1
  27. package/lib/composite-comp/common/components/ProductItem/index.less +2 -0
  28. package/lib/composite-comp/dito/components/FlashDeal/mobile/index.js +1 -15
  29. package/lib/composite-comp/dito/components/FlashDeal/pc/index.js +1 -15
  30. package/lib/composite-comp/dito/components/PcNavigation/pc/index.js +6 -0
  31. package/lib/composite-comp/dito/components/PcNavigation/pc/index.less +2 -1
  32. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +21 -29
  33. package/lib/composite-comp/dito/components/Recommend/mobile/index.less +1 -0
  34. package/lib/composite-comp/dito/components/Recommend/pc/index.js +31 -32
  35. package/lib/composite-comp/dito/components/Recommend/pc/index.less +1 -0
  36. package/lib/decorator/compositeDecorator.js +3 -2
  37. package/lib/decorator/metaDecorator.js +2 -2
  38. package/lib/meta-comp/components/Image/index.less +1 -1
  39. package/package.json +1 -1
@@ -13,7 +13,9 @@ require("./index.less");
13
13
 
14
14
  var _classnames = _interopRequireDefault(require("classnames"));
15
15
 
16
- var _lodash = _interopRequireDefault(require("lodash.throttle"));
16
+ var _lodash = require("lodash");
17
+
18
+ var _lodash2 = _interopRequireDefault(require("lodash.throttle"));
17
19
 
18
20
  var _mobx = require("../../../../../mobx");
19
21
 
@@ -359,8 +361,11 @@ function (_super) {
359
361
  _k.label = 1;
360
362
 
361
363
  case 1:
362
- _k.trys.push([1, 7,, 8]);
364
+ _k.trys.push([1, 9,, 10]);
363
365
 
366
+ if (!(groupSource.length > 0)) return [3
367
+ /*break*/
368
+ , 7];
364
369
  if (!(sourceType === 'select')) return [3
365
370
  /*break*/
366
371
  , 3];
@@ -417,13 +422,22 @@ function (_super) {
417
422
  , 8];
418
423
 
419
424
  case 7:
425
+ newData = [];
426
+ _k.label = 8;
427
+
428
+ case 8:
429
+ return [3
430
+ /*break*/
431
+ , 10];
432
+
433
+ case 9:
420
434
  e_1 = _k.sent();
421
435
  newData = [];
422
436
  return [3
423
437
  /*break*/
424
- , 8];
438
+ , 10];
425
439
 
426
- case 8:
440
+ case 10:
427
441
  if (!(0, _coreUtil.isDesignMode)()) {
428
442
  _cache = (0, _storeUtil.getMagicStore)("recommend_" + recommendId);
429
443
  (0, _storeUtil.setMagicStore)("recommend_" + recommendId, __assign(__assign({}, _cache), (_h = {}, _h["products" + index] = newData, _h.endTime = Date.now() + 3 * 60 * 1000, _h)));
@@ -467,24 +481,6 @@ function (_super) {
467
481
  }, true);
468
482
  };
469
483
 
470
- _this.getBackgroundStyle = function () {
471
- var panelProps = _this.props.panelProps;
472
- var bgStyle = {};
473
-
474
- if (panelProps.background.bgType === 'color') {
475
- bgStyle = {
476
- backgroundColor: (0, _commonUtil.getColorRgba)(panelProps.background.color || '#fff', panelProps.background.opacity / 100 || 1)
477
- };
478
- } else {
479
- bgStyle = {
480
- background: "url(" + panelProps.background.image + ") no-repeat center",
481
- backgroundSize: '100%'
482
- };
483
- }
484
-
485
- return bgStyle;
486
- };
487
-
488
484
  _this.onTabClick = function (e, index) {
489
485
  var tabIndex = _this.state.tabIndex;
490
486
  if (tabIndex === index) return; // e.currentTarget.scrollIntoView(false);
@@ -505,7 +501,7 @@ function (_super) {
505
501
  if (scrollDom) {
506
502
  _this.setScrollDisabled(scrollDom);
507
503
 
508
- scrollDom.onscroll = (0, _lodash["default"])(function () {
504
+ scrollDom.onscroll = (0, _lodash2["default"])(function () {
509
505
  _this.setScrollDisabled(scrollDom);
510
506
  }, 500);
511
507
  }
@@ -553,19 +549,24 @@ function (_super) {
553
549
  if (scrollDom) {
554
550
  _this.setScrollDisabled(scrollDom);
555
551
 
556
- scrollDom.onscroll = (0, _lodash["default"])(function () {
552
+ scrollDom.onscroll = (0, _lodash2["default"])(function () {
557
553
  _this.setScrollDisabled(scrollDom);
558
554
  }, 500);
559
555
  }
560
556
  }, 0);
561
557
  this.listenWidth();
558
+ window.addEventListener('resize', (0, _lodash.debounce)(this.listenWidth));
559
+ };
560
+
561
+ RecommendMobile.prototype.componentWillUnmount = function () {
562
+ window.removeEventListener('resize', this.listenWidth);
562
563
  };
563
564
 
564
- RecommendMobile.prototype.componentWillReceiveProps = function () {
565
+ RecommendMobile.prototype.componentWillReceiveProps = function (nextProps) {
565
566
  var _this = this;
566
567
 
567
568
  var tabIndex = this.state.tabIndex;
568
- var panelProps = this.props.panelProps;
569
+ var panelProps = nextProps.panelProps;
569
570
  var source = [];
570
571
  var hideTabs = false;
571
572
  panelProps.groupSource.map(function (m) {
@@ -573,8 +574,8 @@ function (_super) {
573
574
  if (show) source.push(m);
574
575
  });
575
576
 
576
- if (source.length === 0 && panelProps.groupSource.length > 0) {
577
- source.push(panelProps.groupSource[0]);
577
+ if (source.length === 0) {
578
+ if (panelProps.groupSource.length > 0) source.push(panelProps.groupSource[0]);
578
579
  hideTabs = true;
579
580
  }
580
581
 
@@ -610,7 +611,7 @@ function (_super) {
610
611
  if (scrollDom) {
611
612
  _this.setScrollDisabled(scrollDom);
612
613
 
613
- scrollDom.onscroll = (0, _lodash["default"])(function () {
614
+ scrollDom.onscroll = (0, _lodash2["default"])(function () {
614
615
  _this.setScrollDisabled(scrollDom);
615
616
  }, 500);
616
617
  }
@@ -646,7 +647,6 @@ function (_super) {
646
647
  scrollToLeftDisabled = _a.scrollToLeftDisabled,
647
648
  scrollToRightDisabled = _a.scrollToRightDisabled,
648
649
  contentWidth = _a.contentWidth;
649
- var bgStyle = this.getBackgroundStyle();
650
650
  var products = this.state["products" + tabIndex] || [];
651
651
  var isDivide = groupSource.length <= 10;
652
652
  var layout = panelProps.customize.layout.pcLayout;
@@ -663,8 +663,7 @@ function (_super) {
663
663
  }, 140);
664
664
  if (layout === 'layout1' && contentWidth) imgHeight = (contentWidth - 12 * (panelProps.customize.pcRowNum - 1)) / panelProps.customize.pcRowNum;
665
665
  return /*#__PURE__*/_react["default"].createElement("div", {
666
- className: "m-recommend-pc",
667
- style: bgStyle
666
+ className: "m-recommend-pc"
668
667
  }, !hideTabs && /*#__PURE__*/_react["default"].createElement("div", {
669
668
  className: "tab-select-wrap"
670
669
  }, groupSource.map(function (tab, index) {
@@ -25,6 +25,7 @@
25
25
  .tabTitle {
26
26
  display: flex;
27
27
  align-items: center;
28
+ text-align: center;
28
29
  // padding: 0 24px;
29
30
  min-width: 100px;
30
31
  height: 100%;
@@ -123,8 +123,9 @@ function compositeDecorator(WrappedComponent) {
123
123
  wrapStyle.opacity = background.opacity ? background.opacity : 1;
124
124
  } else {
125
125
  wrapStyle.backgroundImage = "url(" + background.image + ")";
126
- wrapStyle.backgroundPosition = 'center';
127
- wrapStyle.backgroundSize = 'cover';
126
+ wrapStyle.backgroundPosition = '0px 0px';
127
+ wrapStyle.backgroundSize = 'auto 100%';
128
+ wrapStyle.backgroundRepeat = 'no-repeat';
128
129
  }
129
130
  }
130
131
  }
@@ -211,8 +211,8 @@ function metaDecorator(WrappedComponent) {
211
211
  className = _a.className,
212
212
  rest = __rest(_a, ["className"]);
213
213
 
214
- var hoverStyle = this.getInteractStyle();
215
- console.log(rest);
214
+ var hoverStyle = this.getInteractStyle(); // console.log(rest);
215
+
216
216
  return /*#__PURE__*/_react["default"].createElement("div", {
217
217
  className: className,
218
218
  style: this.getStyle()
@@ -4,7 +4,7 @@
4
4
  height: 100%;
5
5
  display: flex;
6
6
  justify-content: center;
7
- overflow: hidden;
7
+ // overflow: hidden;
8
8
  &>img {
9
9
  width: 100%;
10
10
  height: 100%;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "0.0.94",
4
+ "version": "0.0.97",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",