@fonixtree/magic-design 1.0.167 → 1.0.168

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 (153) hide show
  1. package/es/assets/fonts/magic-box-iconfont.css +11 -3
  2. package/es/assets/fonts/magic-box-iconfont.js +1 -1
  3. package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
  4. package/es/assets/fonts/magic-box-iconfont.woff +0 -0
  5. package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
  6. package/es/assets/images/layout-icon/campaignLayout1.png +0 -0
  7. package/es/assets/images/layout-icon/imageGalleryLayout3.png +0 -0
  8. package/es/assets/images/layout-icon/imageGalleryLayout4.png +0 -0
  9. package/es/common/Collapse/index.js +3 -1
  10. package/es/common/CountDown/index.js +29 -2
  11. package/es/common/CountDown/index.less +38 -5
  12. package/es/common/Field/index.js +2 -1
  13. package/es/common/Field/index.less +4 -0
  14. package/es/common/Iconfont/index.js +4 -2
  15. package/es/composite-comp/bol/components/ImageGallery/mobile/index.js +18 -1
  16. package/es/composite-comp/bol/components/ImageGallery/mobile/index.less +9 -0
  17. package/es/composite-comp/common/config-panels/BackgroundConfig/index.js +15 -73
  18. package/es/composite-comp/dito/components/Campaign/defaultJSON.js +112 -0
  19. package/es/composite-comp/dito/components/Campaign/index.js +88 -0
  20. package/es/composite-comp/dito/components/Campaign/mobile/components/Bargain/index.js +320 -0
  21. package/es/composite-comp/dito/components/Campaign/mobile/components/Bargain/index.less +20 -0
  22. package/es/composite-comp/dito/components/Campaign/mobile/components/CountDown/index.js +180 -0
  23. package/es/composite-comp/dito/components/Campaign/mobile/components/CountDown/index.less +26 -0
  24. package/es/composite-comp/dito/components/Campaign/mobile/components/FlashSale/index.js +434 -0
  25. package/es/composite-comp/dito/components/Campaign/mobile/components/FlashSale/index.less +20 -0
  26. package/es/composite-comp/dito/components/Campaign/mobile/components/GroupBuy/index.js +317 -0
  27. package/es/composite-comp/dito/components/Campaign/mobile/components/GroupBuy/index.less +20 -0
  28. package/es/composite-comp/dito/components/Campaign/mobile/components/ProductItem/index.js +115 -0
  29. package/es/composite-comp/dito/components/Campaign/mobile/components/ProductItem/index.less +14 -0
  30. package/es/composite-comp/dito/components/Campaign/mobile/imgs/defImg.png +0 -0
  31. package/es/composite-comp/dito/components/Campaign/mobile/index.js +125 -0
  32. package/es/composite-comp/dito/components/Campaign/mobile/index.less +57 -0
  33. package/es/composite-comp/dito/components/FlashDeal/defaultJSON.js +25 -11
  34. package/es/composite-comp/dito/components/FlashDeal/mobile/index.js +15 -14
  35. package/es/composite-comp/dito/components/FlashDeal/pc/ProductItem/index.js +197 -0
  36. package/es/composite-comp/dito/components/FlashDeal/pc/ProductItem/index.less +100 -0
  37. package/es/composite-comp/dito/components/FlashDeal/pc/index.js +18 -22
  38. package/es/composite-comp/dito/components/FlashDeal/pc/index.less +19 -30
  39. package/es/composite-comp/dito/components/SearchDITO/defaultJSON.js +7 -1
  40. package/es/composite-comp/dito/components/SearchDITO/pc/components/ConfirmModal/index.less +69 -0
  41. package/es/composite-comp/dito/components/SearchDITO/pc/components/Header/index.js +602 -0
  42. package/es/composite-comp/dito/components/SearchDITO/pc/components/Header/index.less +184 -0
  43. package/es/composite-comp/dito/components/SearchDITO/pc/index.js +12 -579
  44. package/es/composite-comp/dito/components/SearchDITO/pc/index.less +1 -185
  45. package/es/composite-comp/dito/components/SlideImage/defaultJSON.js +29 -8
  46. package/es/composite-comp/dito/components/SlideImage/pc/components/CardItem/index.js +3 -1
  47. package/es/composite-comp/dito/components/SlideImage/pc/components/ParallaxScroll/index.js +5 -1
  48. package/es/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.js +20 -13
  49. package/es/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.less +4 -11
  50. package/es/composite-comp/dito/components/SlideImage/pc/index.js +2 -0
  51. package/es/composite-comp/dito/config-panels/CampaignConfig/ConfigContent/index.js +143 -0
  52. package/es/composite-comp/dito/config-panels/CampaignConfig/ConfigTitle/index.js +93 -0
  53. package/es/composite-comp/dito/config-panels/CampaignConfig/index.js +69 -0
  54. package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigTitle/index.js +7 -20
  55. package/es/composite-comp/dito/config-panels/FlashDealConfig/index.js +15 -1
  56. package/es/composite-comp/dito/config-panels/RecommendConfig/index.js +10 -4
  57. package/es/composite-comp/dito/config-panels/SearchDITOConfig/ConfigContent/index.js +11 -2
  58. package/es/composite-comp/dito/config-panels/SearchDITOConfig/ConfigContent/index.less +6 -6
  59. package/es/composite-comp/dito/config-panels/SlideImageConfig/index.js +26 -0
  60. package/es/composite-comp/dito/second-config-panels/CampaignSecondConfig/index.js +109 -0
  61. package/es/composite-comp/dito/second-config-panels/SlideImageSecondConfig/index.js +11 -0
  62. package/es/constants/component-types.js +9 -3
  63. package/es/constants/index.js +4 -0
  64. package/es/constants/layout.js +16 -2
  65. package/es/core/Designer/ConfigPanel/index.js +4 -0
  66. package/es/decorator/compositeDecorator.js +5 -2
  67. package/es/locale/en/en.json +6 -1
  68. package/es/locale/es/es.json +6 -1
  69. package/es/locale/id/id.json +6 -1
  70. package/es/meta-comp/components/Button/index.js +4 -1
  71. package/es/meta-comp/components/Button/index.less +8 -1
  72. package/es/meta-comp/config-panels/ButtonConfig/index.js +1 -1
  73. package/es/meta-comp/config-panels/TextConfig/index.js +19 -2
  74. package/lib/assets/fonts/magic-box-iconfont.css +11 -3
  75. package/lib/assets/fonts/magic-box-iconfont.js +1 -1
  76. package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
  77. package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
  78. package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
  79. package/lib/assets/images/layout-icon/campaignLayout1.png +0 -0
  80. package/lib/assets/images/layout-icon/imageGalleryLayout3.png +0 -0
  81. package/lib/assets/images/layout-icon/imageGalleryLayout4.png +0 -0
  82. package/lib/common/Collapse/index.js +3 -1
  83. package/lib/common/CountDown/index.js +29 -2
  84. package/lib/common/CountDown/index.less +38 -5
  85. package/lib/common/Field/index.js +2 -1
  86. package/lib/common/Field/index.less +4 -0
  87. package/lib/common/Iconfont/index.js +4 -2
  88. package/lib/composite-comp/bol/components/ImageGallery/mobile/index.js +18 -1
  89. package/lib/composite-comp/bol/components/ImageGallery/mobile/index.less +9 -0
  90. package/lib/composite-comp/common/config-panels/BackgroundConfig/index.js +15 -73
  91. package/lib/composite-comp/dito/components/Campaign/defaultJSON.js +112 -0
  92. package/lib/composite-comp/dito/components/Campaign/index.js +88 -0
  93. package/lib/composite-comp/dito/components/Campaign/mobile/components/Bargain/index.js +320 -0
  94. package/lib/composite-comp/dito/components/Campaign/mobile/components/Bargain/index.less +20 -0
  95. package/lib/composite-comp/dito/components/Campaign/mobile/components/CountDown/index.js +180 -0
  96. package/lib/composite-comp/dito/components/Campaign/mobile/components/CountDown/index.less +26 -0
  97. package/lib/composite-comp/dito/components/Campaign/mobile/components/FlashSale/index.js +434 -0
  98. package/lib/composite-comp/dito/components/Campaign/mobile/components/FlashSale/index.less +20 -0
  99. package/lib/composite-comp/dito/components/Campaign/mobile/components/GroupBuy/index.js +317 -0
  100. package/lib/composite-comp/dito/components/Campaign/mobile/components/GroupBuy/index.less +20 -0
  101. package/lib/composite-comp/dito/components/Campaign/mobile/components/ProductItem/index.js +115 -0
  102. package/lib/composite-comp/dito/components/Campaign/mobile/components/ProductItem/index.less +14 -0
  103. package/lib/composite-comp/dito/components/Campaign/mobile/imgs/defImg.png +0 -0
  104. package/lib/composite-comp/dito/components/Campaign/mobile/index.js +125 -0
  105. package/lib/composite-comp/dito/components/Campaign/mobile/index.less +57 -0
  106. package/lib/composite-comp/dito/components/FlashDeal/defaultJSON.js +25 -11
  107. package/lib/composite-comp/dito/components/FlashDeal/mobile/index.js +15 -14
  108. package/lib/composite-comp/dito/components/FlashDeal/pc/ProductItem/index.js +197 -0
  109. package/lib/composite-comp/dito/components/FlashDeal/pc/ProductItem/index.less +100 -0
  110. package/lib/composite-comp/dito/components/FlashDeal/pc/index.js +18 -22
  111. package/lib/composite-comp/dito/components/FlashDeal/pc/index.less +19 -30
  112. package/lib/composite-comp/dito/components/SearchDITO/defaultJSON.js +7 -1
  113. package/lib/composite-comp/dito/components/SearchDITO/pc/components/ConfirmModal/index.less +69 -0
  114. package/lib/composite-comp/dito/components/SearchDITO/pc/components/Header/index.js +602 -0
  115. package/lib/composite-comp/dito/components/SearchDITO/pc/components/Header/index.less +184 -0
  116. package/lib/composite-comp/dito/components/SearchDITO/pc/index.js +12 -579
  117. package/lib/composite-comp/dito/components/SearchDITO/pc/index.less +1 -185
  118. package/lib/composite-comp/dito/components/SlideImage/defaultJSON.js +29 -8
  119. package/lib/composite-comp/dito/components/SlideImage/pc/components/CardItem/index.js +3 -1
  120. package/lib/composite-comp/dito/components/SlideImage/pc/components/ParallaxScroll/index.js +5 -1
  121. package/lib/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.js +20 -13
  122. package/lib/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.less +4 -11
  123. package/lib/composite-comp/dito/components/SlideImage/pc/index.js +2 -0
  124. package/lib/composite-comp/dito/config-panels/CampaignConfig/ConfigContent/index.js +143 -0
  125. package/lib/composite-comp/dito/config-panels/CampaignConfig/ConfigTitle/index.js +93 -0
  126. package/lib/composite-comp/dito/config-panels/CampaignConfig/index.js +69 -0
  127. package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigTitle/index.js +7 -20
  128. package/lib/composite-comp/dito/config-panels/FlashDealConfig/index.js +15 -1
  129. package/lib/composite-comp/dito/config-panels/RecommendConfig/index.js +10 -4
  130. package/lib/composite-comp/dito/config-panels/SearchDITOConfig/ConfigContent/index.js +11 -2
  131. package/lib/composite-comp/dito/config-panels/SearchDITOConfig/ConfigContent/index.less +6 -6
  132. package/lib/composite-comp/dito/config-panels/SlideImageConfig/index.js +26 -0
  133. package/lib/composite-comp/dito/second-config-panels/CampaignSecondConfig/index.js +109 -0
  134. package/lib/composite-comp/dito/second-config-panels/SlideImageSecondConfig/index.js +11 -0
  135. package/lib/constants/component-types.js +9 -3
  136. package/lib/constants/index.js +4 -0
  137. package/lib/constants/layout.js +16 -2
  138. package/lib/core/Designer/ConfigPanel/index.js +4 -0
  139. package/lib/decorator/compositeDecorator.js +5 -2
  140. package/lib/locale/en/en.json +6 -1
  141. package/lib/locale/es/es.json +6 -1
  142. package/lib/locale/id/id.json +6 -1
  143. package/lib/meta-comp/components/Button/index.js +4 -1
  144. package/lib/meta-comp/components/Button/index.less +8 -1
  145. package/lib/meta-comp/config-panels/ButtonConfig/index.js +1 -1
  146. package/lib/meta-comp/config-panels/TextConfig/index.js +19 -2
  147. package/package.json +1 -1
  148. package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg1.png +0 -0
  149. package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg2.png +0 -0
  150. package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg3.png +0 -0
  151. package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg1.png +0 -0
  152. package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg2.png +0 -0
  153. package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg3.png +0 -0
@@ -265,7 +265,8 @@ function (_super) {
265
265
  _this.getHeader = function (panel) {
266
266
  var activeKey = _this.state.activeKey;
267
267
  var name = panel.name,
268
- key = panel.key;
268
+ key = panel.key,
269
+ onClick = panel.onClick;
269
270
  var _a = _this.props,
270
271
  headerStyle = _a.headerStyle,
271
272
  showActiveColor = _a.showActiveColor;
@@ -275,6 +276,7 @@ function (_super) {
275
276
  } : {};
276
277
  return /*#__PURE__*/_react["default"].createElement("div", {
277
278
  className: "header_wrap",
279
+ onClick: onClick,
278
280
  onMouseEnter: function onMouseEnter() {
279
281
  return _this.headerMouseEnter(panel);
280
282
  },
@@ -9,10 +9,18 @@ exports["default"] = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+
12
14
  var _commonUtil = require("../../utils/commonUtil");
13
15
 
14
16
  require("./index.less");
15
17
 
18
+ var _Iconfont = _interopRequireDefault(require("../Iconfont"));
19
+
20
+ var _coreUtil = require("../../utils/coreUtil");
21
+
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
+
16
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
25
 
18
26
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -138,13 +146,32 @@ function (_super) {
138
146
  };
139
147
 
140
148
  CountDown.prototype.render = function () {
149
+ var type = this.props.type;
141
150
  var _a = this.state,
142
151
  hour = _a.hour,
143
152
  min = _a.min,
144
153
  second = _a.second;
145
154
  return /*#__PURE__*/_react["default"].createElement("div", {
146
- className: "count-down-wrap"
147
- }, /*#__PURE__*/_react["default"].createElement("span", null, hour), /*#__PURE__*/_react["default"].createElement("span", null, min), /*#__PURE__*/_react["default"].createElement("span", null, second));
155
+ className: (0, _classnames["default"])('count-down-wrap', {
156
+ pc: type === 'pc'
157
+ })
158
+ }, (0, _coreUtil.isPc)() && /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
159
+ bold: true,
160
+ className: "icon_time",
161
+ color: "#000",
162
+ size: 24,
163
+ type: "icon-time1"
164
+ }), /*#__PURE__*/_react["default"].createElement("span", {
165
+ className: "num"
166
+ }, hour), (0, _coreUtil.isPc)() && /*#__PURE__*/_react["default"].createElement("span", {
167
+ className: "pots"
168
+ }, ":"), /*#__PURE__*/_react["default"].createElement("span", {
169
+ className: "num"
170
+ }, min), (0, _coreUtil.isPc)() && /*#__PURE__*/_react["default"].createElement("span", {
171
+ className: "pots"
172
+ }, ":"), /*#__PURE__*/_react["default"].createElement("span", {
173
+ className: "num"
174
+ }, second));
148
175
  };
149
176
 
150
177
  CountDown.defaultProps = {
@@ -1,11 +1,13 @@
1
1
  .count-down-wrap {
2
2
  display: flex;
3
3
  align-items: center;
4
+ justify-content: center;
5
+ font-family: 'Montserrat';
6
+ gap: 4px;
4
7
 
5
- span {
8
+ .num {
6
9
  background: #CC1D20;
7
10
  border-radius: 4px;
8
- font-family: 'Montserrat';
9
11
  font-style: normal;
10
12
  font-weight: 500;
11
13
  font-size: 12px;
@@ -14,10 +16,41 @@
14
16
  line-height: 17px;
15
17
  width: 24px;
16
18
  text-align: center;
17
- margin-right: 4px;
19
+ }
20
+
21
+ .pots {
22
+ display: none;
23
+ }
24
+
25
+ &.pc {
26
+ background-color: #F9CA1C;
27
+ border-radius: 20px;
28
+ padding: 0 12px;
29
+ gap: 2px;
30
+
31
+ .icon_time {
32
+ margin-right: 2px;
33
+ }
34
+
35
+ .num {
36
+ background: none;
37
+ font-style: normal;
38
+ font-weight: 700;
39
+ font-size: 20px;
40
+ color: #000;
41
+ height: 36px;
42
+ line-height: 38px;
43
+ }
18
44
 
19
- &:last-child {
20
- margin-right: 0;
45
+ .pots {
46
+ display: inline-block;
47
+ font-style: normal;
48
+ font-weight: 700;
49
+ font-size: 20px;
50
+ color: #000;
51
+ height: 36px;
52
+ line-height: 35px;
53
+ margin-left: 3px;
21
54
  }
22
55
  }
23
56
  }
@@ -74,7 +74,8 @@ function (_super) {
74
74
  return /*#__PURE__*/_react["default"].createElement("div", _extends({
75
75
  className: (0, _classnames["default"])('m-field', {
76
76
  split: split,
77
- bold: split === 'bold'
77
+ bold: split === 'bold',
78
+ solid: split === 'solid'
78
79
  })
79
80
  }, rest), /*#__PURE__*/_react["default"].createElement("div", {
80
81
  className: (0, _classnames["default"])('field-item', {
@@ -9,6 +9,10 @@
9
9
  border-bottom: 8px solid #EDF0F4;
10
10
  border-radius: 2px;
11
11
  }
12
+
13
+ &.solid {
14
+ border-bottom: 1px solid #D2D9E5;
15
+ }
12
16
  }
13
17
 
14
18
  .field-item {
@@ -105,7 +105,8 @@ function (_super) {
105
105
  color = _a.color,
106
106
  svg = _a.svg,
107
107
  className = _a.className,
108
- rest = __rest(_a, ["type", "size", "color", "svg", "className"]);
108
+ bold = _a.bold,
109
+ rest = __rest(_a, ["type", "size", "color", "svg", "className", "bold"]);
109
110
 
110
111
  var _size = size;
111
112
 
@@ -124,7 +125,8 @@ function (_super) {
124
125
  className: (0, _classnames["default"])('icon_container', className),
125
126
  style: {
126
127
  fontSize: _size,
127
- color: color
128
+ color: color,
129
+ fontWeight: bold ? 'bold' : 'normal'
128
130
  }
129
131
  }, rest), svg ? /*#__PURE__*/_react["default"].createElement("svg", {
130
132
  "aria-hidden": "true",
@@ -114,6 +114,7 @@ function (_super) {
114
114
  var data = this.props.data;
115
115
  var GAData = (0, _commonUtil.getGAData)(data);
116
116
  var isHorizontal = data.customize.layout.h5Layout === 'layout2';
117
+ var isFluidLayout = data.customize.layout.h5Layout === 'layout3' || data.customize.layout.h5Layout === 'layout4';
117
118
  var colNum = isHorizontal ? data.customize.rowNum : 1;
118
119
  var newData = data.groupSource.reduce(function (prev, curr, index) {
119
120
  var i = Math.floor(index / colNum);
@@ -122,7 +123,7 @@ function (_super) {
122
123
  }, []);
123
124
  return /*#__PURE__*/_react["default"].createElement("div", {
124
125
  className: "m-image-gallery-mobile"
125
- }, /*#__PURE__*/_react["default"].createElement("div", {
126
+ }, !isFluidLayout && /*#__PURE__*/_react["default"].createElement("div", {
126
127
  className: "content"
127
128
  }, newData.map(function (arr, index) {
128
129
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -150,6 +151,22 @@ function (_super) {
150
151
  maxWidth: "100%"
151
152
  }));
152
153
  }));
154
+ })), isFluidLayout && /*#__PURE__*/_react["default"].createElement("div", {
155
+ className: (0, _classnames["default"])('fluid-content', {
156
+ left: data.customize.layout.h5Layout === 'layout3'
157
+ })
158
+ }, data.groupSource.map(function (item) {
159
+ return /*#__PURE__*/_react["default"].createElement("div", {
160
+ className: "img-wrap"
161
+ }, /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
162
+ data: item.image,
163
+ GAData: __assign(__assign({}, GAData), {
164
+ groupId: item.id,
165
+ groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
166
+ }) // maxHeight={MOBILE_IMG_SIZE[colNum].maxH}
167
+ ,
168
+ maxWidth: "100%"
169
+ }));
153
170
  })));
154
171
  };
155
172
 
@@ -16,3 +16,12 @@
16
16
  align-items: center;
17
17
  justify-content: center;
18
18
  }
19
+ .m-image-gallery-mobile .fluid-content::after {
20
+ content: "";
21
+ display: table;
22
+ clear: both;
23
+ }
24
+ .m-image-gallery-mobile .fluid-content .img-wrap {
25
+ float: left;
26
+ width: 48%;
27
+ }
@@ -49,47 +49,34 @@ function (_super) {
49
49
  __extends(BackgroundConfig, _super);
50
50
 
51
51
  function BackgroundConfig() {
52
- var _this = _super !== null && _super.apply(this, arguments) || this;
53
-
54
- _this.state = {};
55
- return _this;
52
+ return _super !== null && _super.apply(this, arguments) || this;
56
53
  }
57
54
 
58
55
  BackgroundConfig.prototype.render = function () {
59
56
  var _this = this;
60
57
 
61
- var _a, _b, _c, _d, _e;
62
-
63
- var _f = this.props,
64
- data = _f.data,
65
- component = _f.component;
66
-
67
- if (!data.tabBackground) {
68
- data.tabBackground = {
69
- opacity: 100,
70
- color: '#232F46',
71
- image: '',
72
- tabBgType: 'color'
73
- };
74
- }
75
-
58
+ var _a = this.props,
59
+ data = _a.data,
60
+ name = _a.name,
61
+ type = _a.type;
76
62
  return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
77
- title: component === 'recommend' ? (0, _locale.i18n)('PRODUCT_BACKGROUND') : (0, _locale.i18n)('BACKGROUND')
78
- }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
63
+ title: name
64
+ }, type === 'all' && /*#__PURE__*/_react["default"].createElement(_antd.Select, {
79
65
  onChange: function onChange(bgType) {
80
66
  data.bgType = bgType;
67
+ data.tabBgType = bgType;
81
68
 
82
69
  _this.selfRender();
83
70
  },
84
71
  style: {
85
72
  marginBottom: '15px'
86
73
  },
87
- value: data.bgType
74
+ value: data.bgType || data.tabBgType
88
75
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
89
76
  value: "color"
90
77
  }, (0, _locale.i18n)('COLOR')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
91
78
  value: "image"
92
- }, (0, _locale.i18n)('IMAGE'))), data.bgType === 'color' ? /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
79
+ }, (0, _locale.i18n)('IMAGE'))), (type === 'color' || data.bgType === 'color' || data.tabBgType === 'color') && /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
93
80
  colorType: "rgba",
94
81
  onChange: function onChange(v) {
95
82
  data.opacity = 1;
@@ -98,7 +85,7 @@ function (_super) {
98
85
  _this.selfRender();
99
86
  },
100
87
  value: data.color
101
- }) : /*#__PURE__*/_react["default"].createElement(_common.ImagePicker, {
88
+ }), (type === 'image' || data.bgType === 'image' || data.tabBgType === 'image') && /*#__PURE__*/_react["default"].createElement(_common.ImagePicker, {
102
89
  imageSelectedWay: data.imageSelectedWay || {
103
90
  pc: '',
104
91
  mobile: ''
@@ -115,48 +102,6 @@ function (_super) {
115
102
  _this.selfRender();
116
103
  },
117
104
  value: data.image
118
- })), component === 'recommend' && /*#__PURE__*/_react["default"].createElement(_common.Field, {
119
- title: (0, _locale.i18n)('TAB_BACKGROUND')
120
- }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
121
- onChange: function onChange(tabBgType) {
122
- data.tabBackground.tabBgType = tabBgType;
123
-
124
- _this.selfRender();
125
- },
126
- style: {
127
- marginBottom: '15px'
128
- },
129
- value: (_a = data.tabBackground) === null || _a === void 0 ? void 0 : _a.tabBgType
130
- }, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
131
- value: "color"
132
- }, (0, _locale.i18n)('COLOR')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
133
- value: "image"
134
- }, (0, _locale.i18n)('IMAGE'))), ((_b = data.tabBackground) === null || _b === void 0 ? void 0 : _b.tabBgType) === 'color' ? /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
135
- colorType: "rgba",
136
- onChange: function onChange(v) {
137
- data.tabBackground.opacity = 1;
138
- data.tabBackground.color = v;
139
-
140
- _this.selfRender();
141
- },
142
- value: (_c = data.tabBackground) === null || _c === void 0 ? void 0 : _c.color
143
- }) : /*#__PURE__*/_react["default"].createElement(_common.ImagePicker, {
144
- imageSelectedWay: ((_d = data.tabBackground) === null || _d === void 0 ? void 0 : _d.imageSelectedWay) || {
145
- pc: '',
146
- mobile: ''
147
- },
148
- onChange: function onChange(v, way) {
149
- if (v) {
150
- data.tabBackground.image = v.url;
151
- }
152
-
153
- if (way) {
154
- data.tabBackground.imageSelectedWay = way;
155
- }
156
-
157
- _this.selfRender();
158
- },
159
- value: (_e = data.tabBackground) === null || _e === void 0 ? void 0 : _e.image
160
105
  })));
161
106
  };
162
107
 
@@ -166,13 +111,10 @@ function (_super) {
166
111
  color: '#232F46',
167
112
  image: '',
168
113
  bgType: 'color',
169
- tabBackground: {
170
- opacity: 100,
171
- color: '#232F46',
172
- image: '',
173
- tabBgType: 'color'
174
- }
175
- }
114
+ tabBgType: 'color'
115
+ },
116
+ name: (0, _locale.i18n)('BACKGROUND'),
117
+ type: 'all'
176
118
  };
177
119
  return BackgroundConfig;
178
120
  }(_BaseConfig["default"]);
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.groupSourceJSON = exports.getDefaultJSON = void 0;
7
+
8
+ var _uuid = require("uuid");
9
+
10
+ var groupSourceJSON = function groupSourceJSON(parentId, type) {
11
+ var groupId = (0, _uuid.v4)();
12
+ return {
13
+ id: groupId,
14
+ parentId: parentId,
15
+ type: type,
16
+ open: true,
17
+ groupName: {
18
+ parentId: groupId,
19
+ id: (0, _uuid.v4)(),
20
+ open: true,
21
+ type: 'TEXT',
22
+ specialContent: [],
23
+ text: 'PAYDAY SALE!',
24
+ content: {
25
+ sizeType: 'Customize font styles',
26
+ fontWeight: 700,
27
+ fontSize: 10,
28
+ color: '#0038A7'
29
+ },
30
+ underline: {
31
+ open: false,
32
+ textDecorationColor: '',
33
+ textDecorationStyle: 'solid'
34
+ },
35
+ vertical: {}
36
+ }
37
+ };
38
+ };
39
+
40
+ exports.groupSourceJSON = groupSourceJSON;
41
+
42
+ var getDefaultJSON = function getDefaultJSON() {
43
+ var groupId = (0, _uuid.v4)();
44
+ return {
45
+ id: (0, _uuid.v4)(),
46
+ type: 'CAMPAIGN',
47
+ title: {
48
+ headline: {
49
+ id: (0, _uuid.v4)(),
50
+ open: true,
51
+ type: 'TEXT',
52
+ specialContent: [],
53
+ text: 'Lorem Ipsum',
54
+ content: {
55
+ sizeType: 'Customize font styles',
56
+ fontWeight: 600,
57
+ fontSize: 14,
58
+ color: '#000000'
59
+ },
60
+ underline: {
61
+ open: false,
62
+ textDecorationColor: '',
63
+ textDecorationStyle: 'solid'
64
+ },
65
+ vertical: {
66
+ open: false,
67
+ lineHeight: 18
68
+ }
69
+ }
70
+ },
71
+ content: {
72
+ image: {
73
+ id: (0, _uuid.v4)(),
74
+ open: true,
75
+ type: 'IMAGE',
76
+ content: {
77
+ h5Name: 'name2',
78
+ pcName: 'name2',
79
+ h5ImgSrc: '',
80
+ pcImgSrc: '',
81
+ clickUrl: ''
82
+ },
83
+ hover: {
84
+ open: false,
85
+ backgroundType: 'enlarge',
86
+ magnification: 1.5,
87
+ pcImgHoverUrl: '',
88
+ h5ImgHoverUrl: ''
89
+ }
90
+ }
91
+ },
92
+ groupSource: [groupSourceJSON(groupId, 'Flash Sale'), groupSourceJSON(groupId, 'Group Buy'), groupSourceJSON(groupId, 'Bargain')],
93
+ spacing: {
94
+ mobile: {
95
+ paddingTop: 0,
96
+ paddingBottom: 0,
97
+ marginBottom: 0
98
+ }
99
+ },
100
+ customize: {
101
+ layout: 'layout1'
102
+ },
103
+ background: {
104
+ opacity: 100,
105
+ color: '#fff',
106
+ image: '',
107
+ bgType: 'color'
108
+ }
109
+ };
110
+ };
111
+
112
+ exports.getDefaultJSON = getDefaultJSON;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _mobile = _interopRequireDefault(require("./mobile"));
11
+
12
+ var _defaultJSON = require("./defaultJSON");
13
+
14
+ var _coreUtil = require("../../../../utils/coreUtil");
15
+
16
+ var _compositeDecorator = _interopRequireDefault(require("../../../../decorator/compositeDecorator"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
25
+
26
+ var __extends = void 0 && (void 0).__extends || function () {
27
+ var _extendStatics = function extendStatics(d, b) {
28
+ _extendStatics = Object.setPrototypeOf || {
29
+ __proto__: []
30
+ } instanceof Array && function (d, b) {
31
+ d.__proto__ = b;
32
+ } || function (d, b) {
33
+ for (var p in b) {
34
+ if (b.hasOwnProperty(p)) d[p] = b[p];
35
+ }
36
+ };
37
+
38
+ return _extendStatics(d, b);
39
+ };
40
+
41
+ return function (d, b) {
42
+ _extendStatics(d, b);
43
+
44
+ function __() {
45
+ this.constructor = d;
46
+ }
47
+
48
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
49
+ };
50
+ }();
51
+
52
+ var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
53
+ var c = arguments.length,
54
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
55
+ d;
56
+ if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
57
+ if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
58
+ }
59
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
60
+ };
61
+
62
+ var Campaign =
63
+ /** @class */
64
+ function (_super) {
65
+ __extends(Campaign, _super);
66
+
67
+ function Campaign() {
68
+ return _super !== null && _super.apply(this, arguments) || this;
69
+ }
70
+
71
+ Campaign.prototype.render = function () {
72
+ var nodeData = this.props.nodeData;
73
+ return /*#__PURE__*/_react["default"].createElement("div", null, (0, _coreUtil.isPc)() ? null : /*#__PURE__*/_react["default"].createElement(_mobile["default"], {
74
+ panelProps: nodeData
75
+ }));
76
+ };
77
+
78
+ Campaign.defaultProps = {
79
+ nodeData: (0, _defaultJSON.getDefaultJSON)()
80
+ };
81
+ Campaign.type = 'CAMPAIGN';
82
+ Campaign.getDefaultJSON = _defaultJSON.getDefaultJSON;
83
+ Campaign = __decorate([_compositeDecorator["default"]], Campaign);
84
+ return Campaign;
85
+ }(_react.Component);
86
+
87
+ var _default = Campaign;
88
+ exports["default"] = _default;