@fonixtree/magic-design 2.0.97 → 2.0.98

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 (187) hide show
  1. package/es/assets/fonts/.DS_Store +0 -0
  2. package/es/assets/images/layout-icon/banner-slide-layout1.png +0 -0
  3. package/es/assets/images/layout-icon/banner-slide-layout1.svg +6 -0
  4. package/es/assets/images/layout-icon/banner-slide-layout2.png +0 -0
  5. package/es/assets/images/layout-icon/layout-recommend-mobile-1.png +0 -0
  6. package/es/assets/images/layout-icon/layout-recommend-mobile-2.png +0 -0
  7. package/es/assets/images/layout-icon/layout-recommend-mobile-3.png +0 -0
  8. package/es/assets/images/layout-icon/layout-recommend-mobile-4.png +0 -0
  9. package/es/common/Collapse/index.js +10 -8
  10. package/es/common/FontStyles/index.less +3 -1
  11. package/es/common/MonpayCountDown/index.js +160 -0
  12. package/es/common/RatingText/index.js +105 -0
  13. package/es/common/RatingText/index.less +12 -0
  14. package/es/common/index.js +8 -0
  15. package/es/composite-comp/bol/components/Banner/defaultJSON.js +1 -0
  16. package/es/composite-comp/bol/components/Banner/mobile/index.js +2 -1
  17. package/es/composite-comp/bol/components/Banner/mobile/index.less +8 -4
  18. package/es/composite-comp/bol/components/Banner/pc/index.js +2 -1
  19. package/es/composite-comp/bol/components/Banner/pc/index.less +9 -3
  20. package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigSetting/index.js +11 -11
  21. package/es/composite-comp/bol/config-panels/NewsletterConfig/NewsletterContentSetting/index.js +1 -1
  22. package/es/composite-comp/common/components/MonpayProductItem/index.js +283 -0
  23. package/es/composite-comp/common/components/MonpayProductItem/index.less +211 -0
  24. package/es/composite-comp/common/components/ProductItem/index.js +5 -11
  25. package/es/composite-comp/common/components/ProductItem/index.less +10 -0
  26. package/es/composite-comp/common/config-panels/CustomizeConfig/index.js +13 -0
  27. package/es/composite-comp/{bol/config-panels/NewsletterConfig → common/config-panels}/InputField/index.js +18 -10
  28. package/es/composite-comp/dito/components/GroupBuy/defaultJSON.js +0 -4
  29. package/es/composite-comp/dito/components/GroupBuy/mobile/index.js +3 -3
  30. package/es/composite-comp/dito/components/SearchBar/defaultJSON.js +14 -1
  31. package/es/composite-comp/dito/components/SearchBar/mobile/index.js +98 -33
  32. package/es/composite-comp/dito/components/SearchBar/mobile/index.less +11 -1
  33. package/es/composite-comp/dito/components/SearchBar/pc/index.js +78 -6
  34. package/es/composite-comp/dito/components/SearchBar/pc/index.less +1 -0
  35. package/es/composite-comp/dito/components/SignBoard/mobile/index.js +4 -3
  36. package/es/composite-comp/dito/config-panels/GroupBuyConfig/GroupBuyConfigContent/index.js +5 -9
  37. package/es/composite-comp/dito/config-panels/GroupBuyConfig/GroupBuyConfigContent/index.less +2 -0
  38. package/es/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.js +36 -6
  39. package/es/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.less +7 -0
  40. package/es/composite-comp/monpay/components/MonpayFlashDeal/MonpayCountDown/index.js +212 -0
  41. package/es/composite-comp/monpay/components/MonpayFlashDeal/MonpayCountDown/index.less +21 -0
  42. package/es/composite-comp/monpay/components/MonpayFlashDeal/defaultJSON.js +322 -0
  43. package/es/composite-comp/monpay/components/MonpayFlashDeal/index.js +90 -0
  44. package/es/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg.png +0 -0
  45. package/es/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg1.png +0 -0
  46. package/es/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg2.png +0 -0
  47. package/es/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg3.png +0 -0
  48. package/es/composite-comp/monpay/components/MonpayFlashDeal/mobile/index.js +462 -0
  49. package/es/composite-comp/monpay/components/MonpayFlashDeal/mobile/index.less +104 -0
  50. package/es/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg.png +0 -0
  51. package/es/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg1.png +0 -0
  52. package/es/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg2.png +0 -0
  53. package/es/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg3.png +0 -0
  54. package/es/composite-comp/monpay/components/MonpayFlashDeal/pc/index.js +582 -0
  55. package/es/composite-comp/monpay/components/MonpayFlashDeal/pc/index.less +150 -0
  56. package/es/composite-comp/monpay/components/MonpayRecommend/defaultJSON.js +385 -0
  57. package/es/composite-comp/monpay/components/MonpayRecommend/index.js +90 -0
  58. package/es/composite-comp/monpay/components/MonpayRecommend/mobile/imgs/defImg1.png +0 -0
  59. package/es/composite-comp/monpay/components/MonpayRecommend/mobile/imgs/defImg2.png +0 -0
  60. package/es/composite-comp/monpay/components/MonpayRecommend/mobile/imgs/defImg3.png +0 -0
  61. package/es/composite-comp/monpay/components/MonpayRecommend/mobile/index.js +714 -0
  62. package/es/composite-comp/monpay/components/MonpayRecommend/mobile/index.less +81 -0
  63. package/es/composite-comp/monpay/components/MonpayRecommend/pc/imgs/defImg1.png +0 -0
  64. package/es/composite-comp/monpay/components/MonpayRecommend/pc/imgs/defImg2.png +0 -0
  65. package/es/composite-comp/monpay/components/MonpayRecommend/pc/imgs/defImg3.png +0 -0
  66. package/es/composite-comp/monpay/components/MonpayRecommend/pc/index.js +763 -0
  67. package/es/composite-comp/monpay/components/MonpayRecommend/pc/index.less +124 -0
  68. package/es/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigContent/index.js +177 -0
  69. package/es/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigContent/index.less +41 -0
  70. package/es/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigTitle/index.js +171 -0
  71. package/es/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigTitle/index.less +7 -0
  72. package/es/composite-comp/monpay/config-panels/MonpayFlashDealConfig/imgs/layout1.png +0 -0
  73. package/es/composite-comp/monpay/config-panels/MonpayFlashDealConfig/index.js +73 -0
  74. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigContent/index.js +141 -0
  75. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigContent/index.less +0 -0
  76. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigGroup/index.js +149 -0
  77. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigGroup/index.less +16 -0
  78. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigTitle/index.js +93 -0
  79. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigTitle/index.less +0 -0
  80. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/imgs/defaultImg.png +0 -0
  81. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/index.js +150 -0
  82. package/es/composite-comp/monpay/second-config-panels/MonpayRecommendSecondConfig/AIRecommendation/index.js +431 -0
  83. package/es/composite-comp/monpay/second-config-panels/MonpayRecommendSecondConfig/index.js +258 -0
  84. package/es/composite-comp/monpay/second-config-panels/MonpayRecommendSecondConfig/index.less +15 -0
  85. package/es/constants/component-types.js +13 -3
  86. package/es/constants/index.js +8 -0
  87. package/es/constants/layout.js +43 -4
  88. package/es/core/Designer/ConfigPanel/index.js +1 -1
  89. package/es/core/Designer/index.js +5 -2
  90. package/es/locale/en/en.json +11 -0
  91. package/es/locale/es/es.json +11 -0
  92. package/es/locale/id/id.json +11 -0
  93. package/es/utils/dateUtil.js +13 -0
  94. package/lib/assets/fonts/.DS_Store +0 -0
  95. package/lib/assets/images/layout-icon/banner-slide-layout1.png +0 -0
  96. package/lib/assets/images/layout-icon/banner-slide-layout1.svg +6 -0
  97. package/lib/assets/images/layout-icon/banner-slide-layout2.png +0 -0
  98. package/lib/assets/images/layout-icon/layout-recommend-mobile-1.png +0 -0
  99. package/lib/assets/images/layout-icon/layout-recommend-mobile-2.png +0 -0
  100. package/lib/assets/images/layout-icon/layout-recommend-mobile-3.png +0 -0
  101. package/lib/assets/images/layout-icon/layout-recommend-mobile-4.png +0 -0
  102. package/lib/common/Collapse/index.js +10 -8
  103. package/lib/common/FontStyles/index.less +3 -1
  104. package/lib/common/MonpayCountDown/index.js +160 -0
  105. package/lib/common/RatingText/index.js +105 -0
  106. package/lib/common/RatingText/index.less +12 -0
  107. package/lib/common/index.js +8 -0
  108. package/lib/composite-comp/bol/components/Banner/defaultJSON.js +1 -0
  109. package/lib/composite-comp/bol/components/Banner/mobile/index.js +2 -1
  110. package/lib/composite-comp/bol/components/Banner/mobile/index.less +8 -4
  111. package/lib/composite-comp/bol/components/Banner/pc/index.js +2 -1
  112. package/lib/composite-comp/bol/components/Banner/pc/index.less +9 -3
  113. package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigSetting/index.js +11 -11
  114. package/lib/composite-comp/bol/config-panels/NewsletterConfig/NewsletterContentSetting/index.js +1 -1
  115. package/lib/composite-comp/common/components/MonpayProductItem/index.js +283 -0
  116. package/lib/composite-comp/common/components/MonpayProductItem/index.less +211 -0
  117. package/lib/composite-comp/common/components/ProductItem/index.js +5 -11
  118. package/lib/composite-comp/common/components/ProductItem/index.less +10 -0
  119. package/lib/composite-comp/common/config-panels/CustomizeConfig/index.js +13 -0
  120. package/lib/composite-comp/{bol/config-panels/NewsletterConfig → common/config-panels}/InputField/index.js +18 -10
  121. package/lib/composite-comp/dito/components/GroupBuy/defaultJSON.js +0 -4
  122. package/lib/composite-comp/dito/components/GroupBuy/mobile/index.js +3 -3
  123. package/lib/composite-comp/dito/components/SearchBar/defaultJSON.js +14 -1
  124. package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +98 -33
  125. package/lib/composite-comp/dito/components/SearchBar/mobile/index.less +11 -1
  126. package/lib/composite-comp/dito/components/SearchBar/pc/index.js +78 -6
  127. package/lib/composite-comp/dito/components/SearchBar/pc/index.less +1 -0
  128. package/lib/composite-comp/dito/components/SignBoard/mobile/index.js +4 -3
  129. package/lib/composite-comp/dito/config-panels/GroupBuyConfig/GroupBuyConfigContent/index.js +5 -9
  130. package/lib/composite-comp/dito/config-panels/GroupBuyConfig/GroupBuyConfigContent/index.less +2 -0
  131. package/lib/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.js +36 -6
  132. package/lib/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.less +7 -0
  133. package/lib/composite-comp/monpay/components/MonpayFlashDeal/MonpayCountDown/index.js +212 -0
  134. package/lib/composite-comp/monpay/components/MonpayFlashDeal/MonpayCountDown/index.less +21 -0
  135. package/lib/composite-comp/monpay/components/MonpayFlashDeal/defaultJSON.js +322 -0
  136. package/lib/composite-comp/monpay/components/MonpayFlashDeal/index.js +90 -0
  137. package/lib/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg.png +0 -0
  138. package/lib/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg1.png +0 -0
  139. package/lib/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg2.png +0 -0
  140. package/lib/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg3.png +0 -0
  141. package/lib/composite-comp/monpay/components/MonpayFlashDeal/mobile/index.js +462 -0
  142. package/lib/composite-comp/monpay/components/MonpayFlashDeal/mobile/index.less +104 -0
  143. package/lib/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg.png +0 -0
  144. package/lib/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg1.png +0 -0
  145. package/lib/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg2.png +0 -0
  146. package/lib/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg3.png +0 -0
  147. package/lib/composite-comp/monpay/components/MonpayFlashDeal/pc/index.js +582 -0
  148. package/lib/composite-comp/monpay/components/MonpayFlashDeal/pc/index.less +150 -0
  149. package/lib/composite-comp/monpay/components/MonpayRecommend/defaultJSON.js +385 -0
  150. package/lib/composite-comp/monpay/components/MonpayRecommend/index.js +90 -0
  151. package/lib/composite-comp/monpay/components/MonpayRecommend/mobile/imgs/defImg1.png +0 -0
  152. package/lib/composite-comp/monpay/components/MonpayRecommend/mobile/imgs/defImg2.png +0 -0
  153. package/lib/composite-comp/monpay/components/MonpayRecommend/mobile/imgs/defImg3.png +0 -0
  154. package/lib/composite-comp/monpay/components/MonpayRecommend/mobile/index.js +714 -0
  155. package/lib/composite-comp/monpay/components/MonpayRecommend/mobile/index.less +81 -0
  156. package/lib/composite-comp/monpay/components/MonpayRecommend/pc/imgs/defImg1.png +0 -0
  157. package/lib/composite-comp/monpay/components/MonpayRecommend/pc/imgs/defImg2.png +0 -0
  158. package/lib/composite-comp/monpay/components/MonpayRecommend/pc/imgs/defImg3.png +0 -0
  159. package/lib/composite-comp/monpay/components/MonpayRecommend/pc/index.js +763 -0
  160. package/lib/composite-comp/monpay/components/MonpayRecommend/pc/index.less +124 -0
  161. package/lib/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigContent/index.js +177 -0
  162. package/lib/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigContent/index.less +41 -0
  163. package/lib/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigTitle/index.js +171 -0
  164. package/lib/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigTitle/index.less +7 -0
  165. package/lib/composite-comp/monpay/config-panels/MonpayFlashDealConfig/imgs/layout1.png +0 -0
  166. package/lib/composite-comp/monpay/config-panels/MonpayFlashDealConfig/index.js +73 -0
  167. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigContent/index.js +141 -0
  168. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigContent/index.less +0 -0
  169. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigGroup/index.js +149 -0
  170. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigGroup/index.less +16 -0
  171. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigTitle/index.js +93 -0
  172. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigTitle/index.less +0 -0
  173. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/imgs/defaultImg.png +0 -0
  174. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/index.js +150 -0
  175. package/lib/composite-comp/monpay/second-config-panels/MonpayRecommendSecondConfig/AIRecommendation/index.js +431 -0
  176. package/lib/composite-comp/monpay/second-config-panels/MonpayRecommendSecondConfig/index.js +258 -0
  177. package/lib/composite-comp/monpay/second-config-panels/MonpayRecommendSecondConfig/index.less +15 -0
  178. package/lib/constants/component-types.js +13 -3
  179. package/lib/constants/index.js +8 -0
  180. package/lib/constants/layout.js +43 -4
  181. package/lib/core/Designer/ConfigPanel/index.js +1 -1
  182. package/lib/core/Designer/index.js +5 -2
  183. package/lib/locale/en/en.json +11 -0
  184. package/lib/locale/es/es.json +11 -0
  185. package/lib/locale/id/id.json +11 -0
  186. package/lib/utils/dateUtil.js +13 -0
  187. package/package.json +1 -1
@@ -36,13 +36,26 @@ var getDefaultJSON = function getDefaultJSON() {
36
36
  open: true,
37
37
  color: {
38
38
  pc: '#D92929',
39
- mobile: '#8493AF'
39
+ mobile: '#D2D9E5'
40
40
  },
41
41
  backgroundColor: {
42
42
  pc: '#fff',
43
43
  mobile: '#fff'
44
44
  }
45
45
  },
46
+ keyword: {
47
+ open: true,
48
+ type: 'InputField',
49
+ placeholder: 'Tshirt Woman',
50
+ content: {
51
+ sizeType: 'Customize font styles',
52
+ fontFamily: 'Open Sans',
53
+ fontWeight: 600,
54
+ fontSize: 12,
55
+ pcFontSize: 14,
56
+ color: '#CE1126'
57
+ }
58
+ },
46
59
  icon: {
47
60
  id: (0, _uuid.v4)(),
48
61
  open: true,
@@ -7,6 +7,8 @@ exports["default"] = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
+ var _antd = require("antd");
11
+
10
12
  require("./index.less");
11
13
 
12
14
  var _components = require("../../../../../meta-comp/components");
@@ -15,6 +17,8 @@ var _common = require("../../../../../common");
15
17
 
16
18
  var _coreUtil = require("../../../../../utils/coreUtil");
17
19
 
20
+ var _Text = require("../../../../../meta-comp/components/Text");
21
+
18
22
  var _commonUtil = require("../../../../../utils/commonUtil");
19
23
 
20
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -45,6 +49,22 @@ var __extends = void 0 && (void 0).__extends || function () {
45
49
  };
46
50
  }();
47
51
 
52
+ var __assign = void 0 && (void 0).__assign || function () {
53
+ __assign = Object.assign || function (t) {
54
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
55
+ s = arguments[i];
56
+
57
+ for (var p in s) {
58
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
59
+ }
60
+ }
61
+
62
+ return t;
63
+ };
64
+
65
+ return __assign.apply(this, arguments);
66
+ };
67
+
48
68
  var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
49
69
  function adopt(value) {
50
70
  return value instanceof P ? value : new P(function (resolve) {
@@ -198,7 +218,8 @@ function (_super) {
198
218
 
199
219
  _this.state = {
200
220
  messageNum: '',
201
- cartNum: ''
221
+ cartNum: '',
222
+ editing: false
202
223
  };
203
224
 
204
225
  _this.getCartNum = function () {
@@ -265,60 +286,103 @@ function (_super) {
265
286
  });
266
287
  };
267
288
 
289
+ _this.onChange = function (e) {
290
+ _this.setState({
291
+ value: e.target.value,
292
+ editing: true
293
+ });
294
+ };
295
+
296
+ _this.onFocus = function () {
297
+ var _a;
298
+
299
+ var value = _this.state.value;
300
+
301
+ if (value === ((_a = _this.props.data.content.keyword) === null || _a === void 0 ? void 0 : _a.placeholder)) {
302
+ _this.setState({
303
+ value: '',
304
+ editing: true
305
+ });
306
+ }
307
+ };
308
+
309
+ _this.onBlur = function () {
310
+ var _a, _b, _c;
311
+
312
+ var value = _this.state.value;
313
+
314
+ if (!value) {
315
+ _this.setState({
316
+ value: (_c = (_b = (_a = _this.props.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.keyword) === null || _c === void 0 ? void 0 : _c.placeholder,
317
+ editing: false
318
+ });
319
+ }
320
+ };
321
+
268
322
  return _this;
269
323
  }
270
324
 
271
325
  SearchMobile.prototype.componentDidMount = function () {
272
- // const { data } = this.props;
273
- // console.log('---mobile ', data);
326
+ var _a, _b, _c;
327
+
274
328
  this.getMessageNum();
275
329
  this.getCartNum();
330
+ this.setState({
331
+ value: (_c = (_b = (_a = this.props.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.keyword) === null || _c === void 0 ? void 0 : _c.placeholder
332
+ });
333
+ };
334
+
335
+ SearchMobile.prototype.componentWillReceiveProps = function (nextProps) {
336
+ var _a, _b, _c;
337
+
338
+ if (!this.state.editing) {
339
+ this.setState({
340
+ value: (_c = (_b = (_a = nextProps.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.keyword) === null || _c === void 0 ? void 0 : _c.placeholder
341
+ });
342
+ }
276
343
  };
277
344
 
278
345
  SearchMobile.prototype.render = function () {
279
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
346
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
280
347
 
281
348
  var data = this.props.data;
282
- var _q = this.state,
283
- messageNum = _q.messageNum,
284
- cartNum = _q.cartNum; // let styleWrap = {};
285
- // if (data.content.background.bgType === 'color') {
286
- // styleWrap = {
287
- // backgroundColor: data.content.background.color,
288
- // opacity: data.content.background.opacity,
289
- // };
290
- // } else {
291
- // styleWrap = {
292
- // backgroundImage: `url(${data.content.background.image})`,
293
- // backgroundPosition: 'center',
294
- // backgroundRepeat: 'no-repeat',
295
- // backgroundSize: '100%',
296
- // };
297
- // }
349
+ var _t = this.state,
350
+ messageNum = _t.messageNum,
351
+ cartNum = _t.cartNum,
352
+ value = _t.value;
353
+
354
+ var style = __assign({}, (0, _Text.contentStyle)((_a = data.content.keyword) === null || _a === void 0 ? void 0 : _a.content));
298
355
 
356
+ Reflect.deleteProperty(style, 'width');
299
357
  return /*#__PURE__*/_react["default"].createElement("div", {
300
358
  className: "m-search-bar"
301
359
  }, /*#__PURE__*/_react["default"].createElement("div", {
302
360
  className: "right"
303
- }, data.content && ((_a = data.content.box) === null || _a === void 0 ? void 0 : _a.open) && /*#__PURE__*/_react["default"].createElement("div", {
361
+ }, data.content && ((_b = data.content.box) === null || _b === void 0 ? void 0 : _b.open) && /*#__PURE__*/_react["default"].createElement("div", {
304
362
  className: "search-input-wrap",
305
363
  onClick: function onClick() {
306
364
  return (0, _coreUtil.clickUrl)('/search-page');
307
365
  },
308
366
  style: {
309
- borderColor: (_c = (_b = data.content.box) === null || _b === void 0 ? void 0 : _b.color) === null || _c === void 0 ? void 0 : _c.mobile
367
+ borderColor: (_d = (_c = data.content.box) === null || _c === void 0 ? void 0 : _c.color) === null || _d === void 0 ? void 0 : _d.mobile,
368
+ backgroundColor: (_f = (_e = data.content.box) === null || _e === void 0 ? void 0 : _e.backgroundColor) === null || _f === void 0 ? void 0 : _f.mobile
310
369
  }
311
- }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
312
- color: (_e = (_d = data.content.box) === null || _d === void 0 ? void 0 : _d.color) === null || _e === void 0 ? void 0 : _e.mobile,
370
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
371
+ className: "search-input",
372
+ onBlur: this.onBlur,
373
+ onChange: this.onChange,
374
+ onFocus: this.onFocus,
375
+ style: (0, _commonUtil.pxToRem)(style),
376
+ type: "text",
377
+ value: value
378
+ }), /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
379
+ color: (_h = (_g = data.content.box) === null || _g === void 0 ? void 0 : _g.color) === null || _h === void 0 ? void 0 : _h.mobile,
313
380
  size: (0, _commonUtil.convertToRem)(24),
314
- style: {
315
- display: 'flex'
316
- },
317
381
  type: "icon-search2"
318
- })), data.content && ((_g = (_f = data.content.icon) === null || _f === void 0 ? void 0 : _f.cartIcon) === null || _g === void 0 ? void 0 : _g.mobile) && /*#__PURE__*/_react["default"].createElement("div", {
382
+ })), data.content && ((_k = (_j = data.content.icon) === null || _j === void 0 ? void 0 : _j.cartIcon) === null || _k === void 0 ? void 0 : _k.mobile) && /*#__PURE__*/_react["default"].createElement("div", {
319
383
  className: "message-wrap"
320
384
  }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
321
- color: (_j = (_h = data.content.icon) === null || _h === void 0 ? void 0 : _h.color) === null || _j === void 0 ? void 0 : _j.mobile,
385
+ color: (_m = (_l = data.content.icon) === null || _l === void 0 ? void 0 : _l.color) === null || _m === void 0 ? void 0 : _m.mobile,
322
386
  onClick: function onClick() {
323
387
  return (0, _coreUtil.clickUrl)('/main/cart');
324
388
  },
@@ -329,10 +393,10 @@ function (_super) {
329
393
  type: "icon-ShoppingCartSimple1"
330
394
  }), !!cartNum && /*#__PURE__*/_react["default"].createElement("span", {
331
395
  className: "num"
332
- }, cartNum)), data.content && ((_l = (_k = data.content.icon) === null || _k === void 0 ? void 0 : _k.messageIcon) === null || _l === void 0 ? void 0 : _l.mobile) && /*#__PURE__*/_react["default"].createElement("div", {
396
+ }, cartNum)), data.content && ((_p = (_o = data.content.icon) === null || _o === void 0 ? void 0 : _o.messageIcon) === null || _p === void 0 ? void 0 : _p.mobile) && /*#__PURE__*/_react["default"].createElement("div", {
333
397
  className: "message-wrap"
334
398
  }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
335
- color: (_o = (_m = data.content.icon) === null || _m === void 0 ? void 0 : _m.color) === null || _o === void 0 ? void 0 : _o.mobile,
399
+ color: (_r = (_q = data.content.icon) === null || _q === void 0 ? void 0 : _q.color) === null || _r === void 0 ? void 0 : _r.mobile,
336
400
  onClick: function onClick() {
337
401
  return (0, _coreUtil.clickUrl)('/message-center');
338
402
  },
@@ -343,7 +407,7 @@ function (_super) {
343
407
  type: "icon-message"
344
408
  }), !!messageNum && /*#__PURE__*/_react["default"].createElement("span", {
345
409
  className: "num"
346
- }, messageNum))), data.content && ((_p = data.content.logo) === null || _p === void 0 ? void 0 : _p.open) && /*#__PURE__*/_react["default"].createElement("div", {
410
+ }, messageNum))), data.content && ((_s = data.content.logo) === null || _s === void 0 ? void 0 : _s.open) && /*#__PURE__*/_react["default"].createElement("div", {
347
411
  className: "logo",
348
412
  onClick: function onClick() {
349
413
  var _a, _b;
@@ -366,7 +430,8 @@ function (_super) {
366
430
  };
367
431
 
368
432
  SearchMobile.defaultProps = {
369
- data: {}
433
+ data: {},
434
+ value: ''
370
435
  };
371
436
  return SearchMobile;
372
437
  }(_react["default"].Component);
@@ -23,7 +23,17 @@
23
23
  height: 0.64rem;
24
24
  text-align: right;
25
25
  display: flex;
26
- justify-content: flex-end;
26
+ justify-content: space-between;
27
+ }
28
+ .m-search-bar .right .search-input-wrap .search-input {
29
+ background-color: transparent;
30
+ border: none;
31
+ height: 100%;
32
+ box-shadow: none;
33
+ font-family: 'Open Sans';
34
+ font-style: normal;
35
+ font-weight: 400;
36
+ font-size: 0.28rem;
27
37
  }
28
38
  .m-search-bar .right .message-wrap {
29
39
  position: relative;
@@ -19,6 +19,10 @@ var _common = require("../../../../../common");
19
19
 
20
20
  var _coreUtil = require("../../../../../utils/coreUtil");
21
21
 
22
+ var _commonUtil = require("../../../../../utils/commonUtil");
23
+
24
+ var _Text = require("../../../../../meta-comp/components/Text");
25
+
22
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
27
 
24
28
  var __extends = void 0 && (void 0).__extends || function () {
@@ -47,6 +51,22 @@ var __extends = void 0 && (void 0).__extends || function () {
47
51
  };
48
52
  }();
49
53
 
54
+ var __assign = void 0 && (void 0).__assign || function () {
55
+ __assign = Object.assign || function (t) {
56
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
57
+ s = arguments[i];
58
+
59
+ for (var p in s) {
60
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
61
+ }
62
+ }
63
+
64
+ return t;
65
+ };
66
+
67
+ return __assign.apply(this, arguments);
68
+ };
69
+
50
70
  var SearchPc =
51
71
  /** @class */
52
72
  function (_super) {
@@ -56,17 +76,43 @@ function (_super) {
56
76
  var _this = _super !== null && _super.apply(this, arguments) || this;
57
77
 
58
78
  _this.state = {
59
- // messageNum: '',
60
- inputVal: ''
79
+ inputVal: '',
80
+ editing: false
61
81
  };
62
82
 
63
83
  _this.onChangeVal = function (val) {
64
- // console.log('--onChangeVal', val);
65
84
  _this.setState({
66
- inputVal: val
85
+ inputVal: val,
86
+ editing: true
67
87
  });
68
88
  };
69
89
 
90
+ _this.onFocus = function () {
91
+ var _a;
92
+
93
+ var inputVal = _this.state.inputVal;
94
+
95
+ if (inputVal === ((_a = _this.props.data.content.keyword) === null || _a === void 0 ? void 0 : _a.placeholder)) {
96
+ _this.setState({
97
+ inputVal: '',
98
+ editing: true
99
+ });
100
+ }
101
+ };
102
+
103
+ _this.onBlur = function () {
104
+ var _a, _b, _c;
105
+
106
+ var inputVal = _this.state.inputVal;
107
+
108
+ if (!inputVal) {
109
+ _this.setState({
110
+ inputVal: (_c = (_b = (_a = _this.props.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.keyword) === null || _c === void 0 ? void 0 : _c.placeholder,
111
+ editing: false
112
+ });
113
+ }
114
+ };
115
+
70
116
  _this.searchProduct = function () {
71
117
  (0, _coreUtil.clickUrl)("/product/list?q=" + _this.state.inputVal);
72
118
  };
@@ -80,13 +126,35 @@ function (_super) {
80
126
  return _this;
81
127
  }
82
128
 
83
- SearchPc.prototype.componentDidMount = function () {};
129
+ SearchPc.prototype.componentDidMount = function () {
130
+ var _a, _b, _c;
131
+
132
+ this.setState({
133
+ inputVal: (_c = (_b = (_a = this.props.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.keyword) === null || _c === void 0 ? void 0 : _c.placeholder
134
+ });
135
+ };
136
+
137
+ SearchPc.prototype.componentWillReceiveProps = function (nextProps) {
138
+ var _a, _b, _c;
139
+
140
+ if (!this.state.editing) {
141
+ this.setState({
142
+ inputVal: (_c = (_b = (_a = nextProps.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.keyword) === null || _c === void 0 ? void 0 : _c.placeholder
143
+ });
144
+ }
145
+ };
84
146
 
85
147
  SearchPc.prototype.render = function () {
86
148
  var _this = this;
87
149
 
150
+ var _a, _b, _c;
151
+
88
152
  var data = this.props.data;
89
153
  var inputVal = this.state.inputVal;
154
+
155
+ var style = __assign({}, (0, _Text.contentStyle)((_a = data.content.keyword) === null || _a === void 0 ? void 0 : _a.content));
156
+
157
+ Reflect.deleteProperty(style, 'width');
90
158
  return /*#__PURE__*/_react["default"].createElement("div", {
91
159
  className: "pc-search-bar"
92
160
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -94,15 +162,19 @@ function (_super) {
94
162
  }, data.content && data.content.box.open && /*#__PURE__*/_react["default"].createElement("div", {
95
163
  className: "search-input-wrap",
96
164
  style: {
97
- borderColor: data.content.box.color.pc
165
+ borderColor: data.content.box.color.pc,
166
+ backgroundColor: (_c = (_b = data.content.box) === null || _b === void 0 ? void 0 : _b.backgroundColor) === null || _c === void 0 ? void 0 : _c.pc
98
167
  }
99
168
  }, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
100
169
  className: "search-input",
170
+ onBlur: this.onBlur,
101
171
  onChange: function onChange(e) {
102
172
  return _this.onChangeVal(e.target.value);
103
173
  },
174
+ onFocus: this.onFocus,
104
175
  onKeyUp: this.keyUp,
105
176
  placeholder: (0, _locale.i18n)('PLEASE_INPUT_KEYWORDS'),
177
+ style: (0, _commonUtil.pxToRem)(style),
106
178
  value: inputVal
107
179
  }), /*#__PURE__*/_react["default"].createElement("div", {
108
180
  className: "search-icon",
@@ -23,6 +23,7 @@
23
23
  flex: 1;
24
24
 
25
25
  .search-input {
26
+ background-color: transparent;
26
27
  border: none;
27
28
  height: 38px;
28
29
  box-shadow: none;
@@ -13,8 +13,6 @@ var _antd = require("antd");
13
13
 
14
14
  var _common = require("../../../../../common");
15
15
 
16
- var _coreUtil = require("../../../../../utils/coreUtil");
17
-
18
16
  var _star = _interopRequireDefault(require("../imgs/star.svg"));
19
17
 
20
18
  var _commonUtil = require("../../../../../utils/commonUtil");
@@ -241,7 +239,10 @@ function (_super) {
241
239
 
242
240
  _this.searchProduct = function () {
243
241
  var storeId = window.magicDesign.storeId;
244
- (0, _coreUtil.clickUrl)("/product/list?q=" + _this.state.inputVal + "&storeId=" + storeId);
242
+ (0, _commonUtil.navigateTo)('/product/list', {
243
+ q: _this.state.inputVal,
244
+ storeId: storeId
245
+ }); // clickUrl(`/product/list?q=${this.state.inputVal}&storeId=${storeId}`);
245
246
  };
246
247
 
247
248
  _this.clickCollect = function () {
@@ -71,7 +71,7 @@ function (_super) {
71
71
  AComponent.prototype.render = function () {
72
72
  var _this = this;
73
73
 
74
- var _a, _b;
74
+ var _a, _b, _c;
75
75
 
76
76
  var panelProps = this.props.panelProps;
77
77
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -131,26 +131,22 @@ function (_super) {
131
131
  }, (0, _locale.i18n)('SALES_PROGRESS')), /*#__PURE__*/_react["default"].createElement(_antd.Switch, {
132
132
  checked: (_a = panelProps.salesProgress) === null || _a === void 0 ? void 0 : _a.open,
133
133
  onChange: function onChange(v) {
134
- panelProps.salesProgress = {
135
- open: v
136
- };
134
+ panelProps.salesProgress.open = v;
137
135
 
138
136
  _this.reRender();
139
137
  }
140
- })), /*#__PURE__*/_react["default"].createElement("div", {
138
+ })), ((_b = panelProps.salesProgress) === null || _b === void 0 ? void 0 : _b.open) && /*#__PURE__*/_react["default"].createElement("div", {
141
139
  className: "content"
142
140
  }, /*#__PURE__*/_react["default"].createElement("p", {
143
141
  className: "name"
144
142
  }, (0, _locale.i18n)('PROGRESS_BAR_COLOR')), /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
145
143
  colorType: "rgba",
146
144
  onChange: function onChange(v) {
147
- panelProps.salesProgress = {
148
- color: v
149
- };
145
+ panelProps.salesProgress.color = v;
150
146
 
151
147
  _this.reRender();
152
148
  },
153
- value: (_b = panelProps.salesProgress) === null || _b === void 0 ? void 0 : _b.color
149
+ value: (_c = panelProps.salesProgress) === null || _c === void 0 ? void 0 : _c.color
154
150
  }))));
155
151
  };
156
152
 
@@ -22,6 +22,8 @@
22
22
 
23
23
  .content {
24
24
  position: relative;
25
+ background-color: #F5F6F7;
26
+ padding: 12px;
25
27
 
26
28
  .name {
27
29
  font-size: 14px;
@@ -19,6 +19,10 @@ var _coreUtil = require("../../../../../utils/coreUtil");
19
19
 
20
20
  var _locale = require("../../../../../locale");
21
21
 
22
+ var _InputField = _interopRequireDefault(require("../../../../common/config-panels/InputField"));
23
+
24
+ require("./index.less");
25
+
22
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
27
 
24
28
  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); }
@@ -71,6 +75,8 @@ function (_super) {
71
75
  SearchBarConfigContent.prototype.render = function () {
72
76
  var _this = this;
73
77
 
78
+ var _a, _b, _c, _d;
79
+
74
80
  var panelProps = this.props.panelProps;
75
81
  var source = [{
76
82
  key: 'search1',
@@ -83,10 +89,9 @@ function (_super) {
83
89
  }, {
84
90
  key: 'search2',
85
91
  name: (0, _locale.i18n)('SEARCH_BOX'),
86
- value: /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
87
- style: {
88
- marginTop: 20
89
- },
92
+ value: /*#__PURE__*/_react["default"].createElement("div", {
93
+ className: "search_bar_config_box"
94
+ }, /*#__PURE__*/_react["default"].createElement(_common.Field, {
90
95
  title: (0, _locale.i18n)('BOX_COLOR')
91
96
  }, /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
92
97
  colorType: "rgba",
@@ -102,12 +107,37 @@ function (_super) {
102
107
  value: (0, _coreUtil.isPc)() ? panelProps.box.color.pc : panelProps.box.color.mobile
103
108
  })), /*#__PURE__*/_react["default"].createElement(_common.Field, {
104
109
  style: {
105
- marginTop: 20
110
+ marginTop: 16
106
111
  },
107
112
  title: (0, _locale.i18n)('BOX_BACKGROUND')
108
- })),
113
+ }, /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
114
+ colorType: "rgba",
115
+ onChange: function onChange(v) {
116
+ if ((0, _coreUtil.isPc)()) {
117
+ panelProps.box.backgroundColor.pc = v;
118
+ } else {
119
+ panelProps.box.backgroundColor.mobile = v;
120
+ }
121
+
122
+ _this.selfRender();
123
+ },
124
+ value: (0, _coreUtil.isPc)() ? (_b = (_a = panelProps.box) === null || _a === void 0 ? void 0 : _a.backgroundColor) === null || _b === void 0 ? void 0 : _b.pc : (_d = (_c = panelProps.box) === null || _c === void 0 ? void 0 : _c.backgroundColor) === null || _d === void 0 ? void 0 : _d.mobile
125
+ }))),
109
126
  metaOption: panelProps.box,
110
127
  toggleType: 'switch'
128
+ }, {
129
+ key: panelProps.keyword.id,
130
+ name: (0, _locale.i18n)('SEARCH_BAR_KEYWORD'),
131
+ toggleType: 'switch',
132
+ value: /*#__PURE__*/_react["default"].createElement("div", {
133
+ style: {
134
+ marginTop: 10
135
+ }
136
+ }, /*#__PURE__*/_react["default"].createElement(_InputField["default"], {
137
+ data: panelProps.keyword,
138
+ inputLabel: "Input Keyword"
139
+ })),
140
+ metaOption: panelProps.keyword
111
141
  }, {
112
142
  key: panelProps.icon.id,
113
143
  name: (0, _locale.i18n)('ICON'),
@@ -0,0 +1,7 @@
1
+ .search_bar_config_box {
2
+ padding: 12px;
3
+ background-color: #F5F6F7;
4
+ margin-top: 16px;
5
+ padding-bottom: 1px;
6
+ border-radius: 6px;
7
+ }