@fonixtree/magic-design 2.0.30 → 2.0.32

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 (137) hide show
  1. package/es/assets/less/modal.less +1 -1
  2. package/es/common/ImageLazy/index.js +6 -5
  3. package/es/common/LinkModal/FilteredProductModal/index.js +7 -3
  4. package/es/common/LinkModal/FilteredProductModal/index.less +1 -1
  5. package/es/common/LinkModal/index.js +1 -1
  6. package/es/common/ProductModal/index.js +23 -30
  7. package/es/composite-comp/bol/components/Banner/mobile/index.js +6 -0
  8. package/es/composite-comp/bol/components/Carousel/index.js +16 -23
  9. package/es/composite-comp/bol/components/Carousel/mobile/index.js +7 -18
  10. package/es/composite-comp/bol/components/Video/defaultJSON.js +24 -0
  11. package/es/composite-comp/bol/config-panels/TagCompConfig/imgs/layout1.png +0 -0
  12. package/es/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +0 -1
  13. package/es/composite-comp/common/components/ProductItem/index.js +4 -2
  14. package/es/composite-comp/common/components/ProductItem/index.less +9 -0
  15. package/es/composite-comp/dito/components/Recommend/defaultJSON.js +1 -1
  16. package/es/composite-comp/dito/components/Recommend/mobile/index.js +14 -2
  17. package/es/composite-comp/dito/components/SignBoard/defaultJSON.js +41 -37
  18. package/es/composite-comp/dito/components/SignBoard/mobile/index.js +32 -27
  19. package/es/composite-comp/dito/components/SignBoard/mobile/index.less +0 -14
  20. package/es/composite-comp/dito/components/SignBoard/pc/index.js +8 -11
  21. package/es/composite-comp/dito/config-panels/SignBoardConfig/SignBoardConfigContent/index.js +9 -47
  22. package/es/composite-comp/dito/config-panels/SignBoardConfig/index.js +9 -2
  23. package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +3 -3
  24. package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +14 -2
  25. package/es/core/Designer/ToolBarModal/index.js +16 -4
  26. package/es/core/Designer/index.js +3 -0
  27. package/es/decorator/index.js +38 -1
  28. package/es/decorator/lazyLoadDecorator.js +75 -0
  29. package/es/locale/en/en.json +1 -1
  30. package/es/locale/es/es.json +1 -1
  31. package/es/locale/id/id.json +1 -1
  32. package/es/meta-comp/components/Button/index.js +7 -0
  33. package/es/meta-comp/components/Text/formats/fontStyle.js +58 -0
  34. package/es/meta-comp/components/Text/index.js +9 -0
  35. package/es/meta-comp/config-panels/ButtonConfig/index.js +30 -28
  36. package/es/utils/commonUtil.js +17 -3
  37. package/es/utils/currencyUtil.js +29 -10
  38. package/lib/assets/less/modal.less +1 -1
  39. package/lib/common/ImageLazy/index.js +6 -5
  40. package/lib/common/LinkModal/FilteredProductModal/index.js +7 -3
  41. package/lib/common/LinkModal/FilteredProductModal/index.less +1 -1
  42. package/lib/common/LinkModal/index.js +1 -1
  43. package/lib/common/ProductModal/index.js +23 -30
  44. package/lib/composite-comp/bol/components/Banner/mobile/index.js +6 -0
  45. package/lib/composite-comp/bol/components/Carousel/index.js +16 -23
  46. package/lib/composite-comp/bol/components/Carousel/mobile/index.js +7 -18
  47. package/lib/composite-comp/bol/components/Video/defaultJSON.js +24 -0
  48. package/lib/composite-comp/bol/config-panels/TagCompConfig/imgs/layout1.png +0 -0
  49. package/lib/composite-comp/bol/second-config-panels/VideoSecondConfig/index.js +0 -1
  50. package/lib/composite-comp/common/components/ProductItem/index.js +4 -2
  51. package/lib/composite-comp/common/components/ProductItem/index.less +9 -0
  52. package/lib/composite-comp/dito/components/Recommend/defaultJSON.js +1 -1
  53. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +14 -2
  54. package/lib/composite-comp/dito/components/SignBoard/defaultJSON.js +41 -37
  55. package/lib/composite-comp/dito/components/SignBoard/mobile/index.js +32 -27
  56. package/lib/composite-comp/dito/components/SignBoard/mobile/index.less +0 -14
  57. package/lib/composite-comp/dito/components/SignBoard/pc/index.js +8 -11
  58. package/lib/composite-comp/dito/config-panels/SignBoardConfig/SignBoardConfigContent/index.js +9 -47
  59. package/lib/composite-comp/dito/config-panels/SignBoardConfig/index.js +9 -2
  60. package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +3 -3
  61. package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +14 -2
  62. package/lib/core/Designer/ToolBarModal/index.js +16 -4
  63. package/lib/core/Designer/index.js +3 -0
  64. package/lib/decorator/index.js +38 -1
  65. package/lib/decorator/lazyLoadDecorator.js +75 -0
  66. package/lib/locale/en/en.json +1 -1
  67. package/lib/locale/es/es.json +1 -1
  68. package/lib/locale/id/id.json +1 -1
  69. package/lib/meta-comp/components/Button/index.js +7 -0
  70. package/lib/meta-comp/components/Text/formats/fontStyle.js +58 -0
  71. package/lib/meta-comp/components/Text/index.js +9 -0
  72. package/lib/meta-comp/config-panels/ButtonConfig/index.js +30 -28
  73. package/lib/utils/commonUtil.js +17 -3
  74. package/lib/utils/currencyUtil.js +29 -10
  75. package/package.json +1 -1
  76. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/AlignSelectPicker/index.js +0 -99
  77. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/AlignSelectPicker/index.less +0 -54
  78. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignCenterSVG.js +0 -27
  79. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignLeftSVG.js +0 -27
  80. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignRightSVG.js +0 -27
  81. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/index.js +0 -96
  82. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/index.less +0 -26
  83. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/ColorPickerBtn/index.js +0 -101
  84. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/ColorPickerBtn/index.less +0 -26
  85. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/LinkInputPicker/index.js +0 -99
  86. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/LinkInputPicker/index.less +0 -39
  87. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/index.js +0 -93
  88. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/index.less +0 -26
  89. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/BackgroundSVG.js +0 -27
  90. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/BoldSVG.js +0 -29
  91. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/FontColorSVG.js +0 -49
  92. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/ItalicSVG.js +0 -29
  93. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/LinkSVG.js +0 -26
  94. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/OrderSVG.js +0 -27
  95. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/StrikeSVG.js +0 -31
  96. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/UnderlineSVG.js +0 -34
  97. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/images/UnorderSVG.js +0 -41
  98. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/index.js +0 -136
  99. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/index.less +0 -25
  100. package/es/core/Designer/TextEditModal/ToolBar/ToolBtn/type.js +0 -1
  101. package/es/core/Designer/TextEditModal/ToolBar/index.js +0 -219
  102. package/es/core/Designer/TextEditModal/ToolBar/index.less +0 -19
  103. package/es/core/Designer/TextEditModal/index.js +0 -100
  104. package/es/core/Designer/TextEditModal/index.less +0 -4
  105. package/es/core/Designer/TextEditModal_old/index.js +0 -142
  106. package/es/core/Designer/TextEditModal_old/index.less +0 -25
  107. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/AlignSelectPicker/index.js +0 -99
  108. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/AlignSelectPicker/index.less +0 -54
  109. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignCenterSVG.js +0 -27
  110. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignLeftSVG.js +0 -27
  111. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/images/AlignRightSVG.js +0 -27
  112. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/index.js +0 -96
  113. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/AlignPicker/index.less +0 -26
  114. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/ColorPickerBtn/index.js +0 -101
  115. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/ColorPickerBtn/index.less +0 -26
  116. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/LinkInputPicker/index.js +0 -99
  117. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/LinkInputPicker/index.less +0 -39
  118. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/index.js +0 -93
  119. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/components/LinkBtn/index.less +0 -26
  120. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/BackgroundSVG.js +0 -27
  121. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/BoldSVG.js +0 -29
  122. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/FontColorSVG.js +0 -49
  123. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/ItalicSVG.js +0 -29
  124. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/LinkSVG.js +0 -26
  125. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/OrderSVG.js +0 -27
  126. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/StrikeSVG.js +0 -31
  127. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/UnderlineSVG.js +0 -34
  128. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/images/UnorderSVG.js +0 -41
  129. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/index.js +0 -136
  130. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/index.less +0 -25
  131. package/lib/core/Designer/TextEditModal/ToolBar/ToolBtn/type.js +0 -1
  132. package/lib/core/Designer/TextEditModal/ToolBar/index.js +0 -219
  133. package/lib/core/Designer/TextEditModal/ToolBar/index.less +0 -19
  134. package/lib/core/Designer/TextEditModal/index.js +0 -100
  135. package/lib/core/Designer/TextEditModal/index.less +0 -4
  136. package/lib/core/Designer/TextEditModal_old/index.js +0 -142
  137. package/lib/core/Designer/TextEditModal_old/index.less +0 -25
@@ -11,6 +11,8 @@ var _antd = require("antd");
11
11
 
12
12
  require("./index.less");
13
13
 
14
+ var _lodash = require("lodash");
15
+
14
16
  var _locale = require("../../../locale");
15
17
 
16
18
  var _SpacingConfig = _interopRequireDefault(require("../../../composite-comp/common/config-panels/SpacingConfig"));
@@ -104,11 +106,11 @@ function (_super) {
104
106
 
105
107
  _this.updateAttr(data, 'hover', {
106
108
  open: true,
107
- buttonBorder: data.buttonBorder,
108
- buttonIcon: data.buttonIcon,
109
- buttonText: data.buttonText,
109
+ buttonBorder: (0, _lodash.cloneDeep)(data.buttonBorder),
110
+ buttonIcon: (0, _lodash.cloneDeep)(data.buttonIcon),
111
+ buttonText: (0, _lodash.cloneDeep)(data.buttonText),
110
112
  content: {
111
- backgroundColor: data.content.backgroundColor
113
+ backgroundColor: (0, _lodash.cloneDeep)(data.content.backgroundColor)
112
114
  }
113
115
  }); // console.log('--ffd, button hover first click', data);
114
116
 
@@ -162,7 +164,7 @@ function (_super) {
162
164
 
163
165
  var fontSizeKey = window.magicDesign.device == 'pc' ? 'pcFontSize' : 'fontSize';
164
166
 
165
- var ButtonTextSetting = function ButtonTextSetting(data) {
167
+ var ButtonTextSetting = function ButtonTextSetting(_data) {
166
168
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
167
169
  title: (0, _locale.i18n)('FONT_STYLE')
168
170
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
@@ -171,24 +173,24 @@ function (_super) {
171
173
  return t.key == v;
172
174
  });
173
175
 
174
- _extends(data, __assign(__assign({}, findOne), {
176
+ _extends(_data, __assign(__assign({}, findOne), {
175
177
  sizeType: findOne === null || findOne === void 0 ? void 0 : findOne.key
176
178
  }));
177
179
 
178
180
  _this.selfRender();
179
181
  },
180
- value: data.sizeType
182
+ value: _data.sizeType
181
183
  }, _TextConfig.sizeTypeList.map(function (sizeType) {
182
184
  return /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
183
185
  value: sizeType.key
184
186
  }, sizeType.key);
185
- }))), data.sizeType == 'Customize font styles' && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
187
+ }))), _data.sizeType == 'Customize font styles' && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
186
188
  title: (0, _locale.i18n)('FONT_FAMILY')
187
189
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
188
190
  onChange: function onChange(v) {
189
- _this.updateAttr(data, 'fontFamily', v);
191
+ _this.updateAttr(_data, 'fontFamily', v);
190
192
  },
191
- value: data.fontFamily
193
+ value: _data.fontFamily
192
194
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
193
195
  value: "Montserrat"
194
196
  }, "Montserrat"), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
@@ -197,9 +199,9 @@ function (_super) {
197
199
  title: (0, _locale.i18n)('FONT_WEIGHT')
198
200
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
199
201
  onChange: function onChange(v) {
200
- _this.updateAttr(data, 'fontWeight', v);
202
+ _this.updateAttr(_data, 'fontWeight', v);
201
203
  },
202
- value: data.fontWeight
204
+ value: _data.fontWeight
203
205
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
204
206
  value: 400
205
207
  }, (0, _locale.i18n)('REGULAR')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
@@ -210,34 +212,34 @@ function (_super) {
210
212
  onChange: function onChange(_a) {
211
213
  var count = _a.count;
212
214
 
213
- _this.updateAttr(data, fontSizeKey, count);
215
+ _this.updateAttr(_data, fontSizeKey, count);
214
216
  },
215
217
  unit: "px",
216
218
  value: {
217
- count: data[fontSizeKey]
219
+ count: _data[fontSizeKey]
218
220
  }
219
221
  }))), /*#__PURE__*/_react["default"].createElement(_common.Field, {
220
222
  title: ""
221
223
  }, /*#__PURE__*/_react["default"].createElement(_common.FontStyles, {
222
224
  onChange: function onChange(value) {
223
- _extends(data, value);
225
+ _extends(_data, value);
224
226
 
225
227
  _this.selfRender();
226
228
  },
227
- value: data
229
+ value: _data
228
230
  })));
229
231
  };
230
232
 
231
- var ButtonBorderSetting = function ButtonBorderSetting(data) {
233
+ var ButtonBorderSetting = function ButtonBorderSetting(_data) {
232
234
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
233
235
  split: true,
234
236
  title: (0, _locale.i18n)('BORDER_COLOR')
235
237
  }, /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
236
238
  colorType: "rgba",
237
239
  onChange: function onChange(value) {
238
- _this.updateAttr(data, 'borderColor', value);
240
+ _this.updateAttr(_data, 'borderColor', value);
239
241
  },
240
- value: data.borderColor
242
+ value: _data.borderColor
241
243
  })), /*#__PURE__*/_react["default"].createElement(_common.Field, {
242
244
  title: (0, _locale.i18n)('BORDER_RADIUS')
243
245
  }, /*#__PURE__*/_react["default"].createElement(_common.Slider, {
@@ -245,15 +247,15 @@ function (_super) {
245
247
  onChange: function onChange(_a) {
246
248
  var count = _a.count;
247
249
 
248
- _this.updateAttr(data, 'borderRadius', count);
250
+ _this.updateAttr(_data, 'borderRadius', count);
249
251
  },
250
252
  value: {
251
- count: data.borderRadius
253
+ count: _data.borderRadius
252
254
  }
253
255
  })));
254
256
  };
255
257
 
256
- var ButtonIconSetting = function ButtonIconSetting(data) {
258
+ var ButtonIconSetting = function ButtonIconSetting(_data) {
257
259
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
258
260
  title: (0, _locale.i18n)('ICON')
259
261
  }, /*#__PURE__*/_react["default"].createElement(_common.IconPicker, {
@@ -262,18 +264,18 @@ function (_super) {
262
264
  },
263
265
  onClick: function onClick() {
264
266
  _this.setState({
265
- isHover: data == _this.props.data.hover.buttonIcon
267
+ isHover: _data == _this.props._data.hover.buttonIcon
266
268
  });
267
269
  },
268
- value: data.iconUrl
269
- })), data.iconUrl && /*#__PURE__*/_react["default"].createElement(_common.Field, {
270
+ value: _data.iconUrl
271
+ })), _data.iconUrl && /*#__PURE__*/_react["default"].createElement(_common.Field, {
270
272
  title: (0, _locale.i18n)('ICON_PLACEMENT')
271
273
  }, /*#__PURE__*/_react["default"].createElement(_common.ButtonIconLayout, {
272
- icon: data.iconUrl,
274
+ icon: _data.iconUrl,
273
275
  onChange: function onChange(value) {
274
- return _this.updateAttr(data, 'layout', value);
276
+ return _this.updateAttr(_data, 'layout', value);
275
277
  },
276
- value: data.layout
278
+ value: _data.layout
277
279
  })));
278
280
  };
279
281
 
@@ -7,7 +7,7 @@ exports.addZero = exports.addUrlQuery = void 0;
7
7
  exports.asyncDataURLtoImage = asyncDataURLtoImage;
8
8
  exports.checkFileName = exports.calcLastTime = exports.asyncNextTick = void 0;
9
9
  exports.commonFetch = commonFetch;
10
- exports.compatibleNewPageData = void 0;
10
+ exports.convertCount = exports.compatibleNewPageData = void 0;
11
11
  exports.convertImageUrl = convertImageUrl;
12
12
  exports.convertToRem = void 0;
13
13
  exports.copy2ClipBoard = copy2ClipBoard;
@@ -776,7 +776,7 @@ var pxToRem = function pxToRem(styleObj) {
776
776
  if (typeof value === 'string' && value.endsWith('px')) {
777
777
  remObj[key] = convertToRem(value.split('px')[0]);
778
778
  } else if (typeof value === 'number') {
779
- remObj[key] = ['opacity', 'lineHeight', 'zIndex'].includes(key) ? value : convertToRem(value);
779
+ remObj[key] = ['opacity', 'lineHeight', 'zIndex', 'fontWeight'].includes(key) ? value : convertToRem(value);
780
780
  } else if ((key === 'padding' || key === 'margin') && typeof value === 'string') {
781
781
  var paddingValues = value.split(' ');
782
782
  var remPaddingValues = paddingValues.map(function (paddingValue) {
@@ -884,4 +884,18 @@ var downloadBase64Image = function downloadBase64Image(base64String, filename) {
884
884
  link.click();
885
885
  };
886
886
 
887
- exports.downloadBase64Image = downloadBase64Image;
887
+ exports.downloadBase64Image = downloadBase64Image;
888
+
889
+ var convertCount = function convertCount(value) {
890
+ var newValue = value;
891
+
892
+ if (value >= 1000000) {
893
+ newValue = Number(value / 1000000).toFixed(1) + "M";
894
+ } else if (value >= 1000) {
895
+ newValue = Number(value / 1000).toFixed(1) + "K";
896
+ }
897
+
898
+ return newValue;
899
+ };
900
+
901
+ exports.convertCount = convertCount;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.numberToFixed = exports.getPricePrefix = exports.getPrecision = exports.formatCurrencyWithSymbol = exports.formatCurrency = exports.currencyToFont = exports.calcFloatCount = exports.addSeparators = void 0;
6
+ exports.numberToFixed = exports.getPricePrefix = exports.getPrecision = exports.formatCurrencyWithSymbol = exports.formatCurrency = exports.formatBackendCurrency = exports.currencyToFont = exports.calcFloatCount = exports.addSeparators = void 0;
7
7
 
8
8
  var _divide = _interopRequireDefault(require("lodash/divide"));
9
9
 
@@ -15,7 +15,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
15
15
 
16
16
  /* eslint-disable */
17
17
  var precision = (0, _commonUtil.ensure)(function () {
18
- return window.ecommerce.precision;
18
+ return window.systemParams.precision;
19
19
  }, '0'); // 千分位展示
20
20
 
21
21
  var addSeparators = function addSeparators(nStr, thousandsSep, decimalSep) {
@@ -42,7 +42,7 @@ exports.addSeparators = addSeparators;
42
42
 
43
43
  var getPricePrefix = function getPricePrefix() {
44
44
  var pricePrefix = (0, _commonUtil.ensure)(function () {
45
- return window.ecommerce.prefix;
45
+ return window.systemParams.prefix;
46
46
  }, 'Rp');
47
47
  return pricePrefix;
48
48
  };
@@ -51,23 +51,42 @@ exports.getPricePrefix = getPricePrefix;
51
51
 
52
52
  var getPrecision = function getPrecision() {
53
53
  var ret = (0, _commonUtil.ensure)(function () {
54
- return window.ecommerce.precision;
54
+ return window.systemParams.precision;
55
55
  }, '0');
56
56
  return Number(ret);
57
- }; // 格式化金额
57
+ };
58
+ /**
59
+ * 前端数值转换为后端数值
60
+ * @param num
61
+ */
58
62
 
59
63
 
60
64
  exports.getPrecision = getPrecision;
61
65
 
66
+ var formatBackendCurrency = function formatBackendCurrency(num) {
67
+ var precision = (0, _commonUtil.ensure)(function () {
68
+ return window.systemParams.precision;
69
+ }, '0');
70
+
71
+ if (!num) {
72
+ return num;
73
+ }
74
+
75
+ return num * Math.pow(10, precision);
76
+ }; // 格式化金额
77
+
78
+
79
+ exports.formatBackendCurrency = formatBackendCurrency;
80
+
62
81
  var formatCurrency = function formatCurrency(num) {
63
82
  var displayPrecision = (0, _commonUtil.ensure)(function () {
64
- return window.ecommerce.displayCurrencyPrecision;
83
+ return window.systemParams.displayCurrencyPrecision;
65
84
  }, '0');
66
85
  var precision = (0, _commonUtil.ensure)(function () {
67
- return window.ecommerce.precision;
86
+ return window.systemParams.precision;
68
87
  }, '0');
69
88
  var pricePrefix = (0, _commonUtil.ensure)(function () {
70
- return window.ecommerce.prefix;
89
+ return window.systemParams.prefix;
71
90
  }, 'Rp');
72
91
  var numVal = num;
73
92
 
@@ -162,7 +181,7 @@ var currencyToFont = function currencyToFont(value, customPrecision, customDispl
162
181
  precision = Number(customPrecision);
163
182
  } else {
164
183
  precision = (0, _commonUtil.ensure)(function () {
165
- return window.ecommerce.precision;
184
+ return window.systemParams.precision;
166
185
  }, '0');
167
186
  }
168
187
 
@@ -180,7 +199,7 @@ var currencyToFont = function currencyToFont(value, customPrecision, customDispl
180
199
  displayPrecision = Number(customDisplayPrecision);
181
200
  } else {
182
201
  displayPrecision = (0, _commonUtil.ensure)(function () {
183
- return window.ecommerce.displayCurrencyPrecision;
202
+ return window.systemParams.displayCurrencyPrecision;
184
203
  }, 'Rp');
185
204
  }
186
205
 
@@ -18,7 +18,7 @@
18
18
  .cylon-modal-body {
19
19
  padding: 16px 16px 12px 16px !important;
20
20
  max-height: 800px !important;
21
- overflow: scroll;
21
+ // overflow: scroll;
22
22
  }
23
23
  }
24
24
  }
@@ -100,9 +100,11 @@ function (_super) {
100
100
 
101
101
  this.intersectionObserver = new IntersectionObserver(function (entries) {
102
102
  if (entries[0].isIntersecting) {
103
- _this.setState({
104
- show: true
105
- });
103
+ if (!_this.state.show) {
104
+ _this.setState({
105
+ show: true
106
+ });
107
+ }
106
108
  }
107
109
  }, {
108
110
  root: (_a = this.props) === null || _a === void 0 ? void 0 : _a.rootContainer(),
@@ -120,14 +122,13 @@ function (_super) {
120
122
  var _this = this;
121
123
 
122
124
  var _a = this.props,
123
- root = _a.root,
124
125
  _b = _a.lazy,
125
126
  lazy = _b === void 0 ? true : _b,
126
127
  src = _a.src,
127
128
  onLoadFunc = _a.onLoadFunc,
128
129
  style = _a.style,
129
130
  className = _a.className,
130
- rest = __rest(_a, ["root", "lazy", "src", "onLoadFunc", "style", "className"]);
131
+ rest = __rest(_a, ["lazy", "src", "onLoadFunc", "style", "className"]);
131
132
 
132
133
  var show = this.state.show;
133
134
  var isShow = lazy ? show : true;
@@ -447,7 +447,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
447
447
  switch (_a.label) {
448
448
  case 0:
449
449
  precision = Math.pow(10, (0, _commonUtil.ensure)(function () {
450
- return window.ecommerce.precision;
450
+ return window.systemParams.precision;
451
451
  }, '0'));
452
452
  params = {
453
453
  catgIds: tValue.join(','),
@@ -532,12 +532,14 @@ var FilteredProductModal = function FilteredProductModal(props) {
532
532
  layout: "vertical"
533
533
  }, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
534
534
  label: "Category"
535
- }, /*#__PURE__*/_react["default"].createElement(_antd.TreeSelect, {
536
- allowClear: true,
535
+ }, /*#__PURE__*/_react["default"].createElement(_antd.TreeSelect // allowClear
536
+ , {
537
537
  dropdownStyle: {
538
538
  maxHeight: 400,
539
539
  overflow: 'auto'
540
540
  },
541
+ maxTagCount: 2,
542
+ maxTagTextLength: 5,
541
543
  multiple: true,
542
544
  onChange: onChange,
543
545
  placeholder: (0, _locale.i18n)('PLEASE_SELECT'),
@@ -549,6 +551,8 @@ var FilteredProductModal = function FilteredProductModal(props) {
549
551
  label: "Brand"
550
552
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
551
553
  defaultValue: [],
554
+ maxTagCount: 2,
555
+ maxTagTextLength: 5,
552
556
  mode: "multiple",
553
557
  onChange: handleBrandChange,
554
558
  placeholder: (0, _locale.i18n)('PLEASE_SELECT'),
@@ -84,7 +84,7 @@
84
84
  }
85
85
 
86
86
  .leftCot {
87
- width: 230px;
87
+ width: 280px;
88
88
  // height: 400px;
89
89
  box-sizing: border-box;
90
90
  border-right: 1px solid #e0e0e0;
@@ -285,7 +285,7 @@ var LinkModal = function LinkModal(props) {
285
285
  ,
286
286
  title: (0, _locale.i18n)('URL_SETUP'),
287
287
  visible: visible,
288
- width: "900px",
288
+ width: "1000px",
289
289
  wrapClassName: "magicLinkModal"
290
290
  }, /*#__PURE__*/_react["default"].createElement(_antd.Tabs, {
291
291
  activeKey: selected,
@@ -204,8 +204,6 @@ var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
204
204
  return r;
205
205
  };
206
206
 
207
- var precision = (0, _currencyUtil.getPrecision)();
208
-
209
207
  var formatData = function formatData(list) {
210
208
  list.map(function (item) {
211
209
  item.preSalesPrice = (0, _currencyUtil.formatCurrencyWithSymbol)(item.salesPrice);
@@ -377,21 +375,18 @@ var ProductModal = function ProductModal(props) {
377
375
 
378
376
  var queryOfferCatgs = function queryOfferCatgs() {
379
377
  return __awaiter(void 0, void 0, void 0, function () {
380
- var res, arr;
378
+ var res, tree;
381
379
  return __generator(this, function (_a) {
382
380
  switch (_a.label) {
383
381
  case 0:
384
382
  return [4
385
383
  /*yield*/
386
- , (0, _commonUtil.commonFetch)('/designer/v1/h5/offers/catgs', {}, 'GET')];
384
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/designer/resource/offercatgs/list", {}, 'GET')];
387
385
 
388
386
  case 1:
389
387
  res = _a.sent();
390
- arr = [];
391
- res.forEach(function (f) {
392
- if (f.children) arr.push.apply(arr, f.children);
393
- });
394
- setCatgsList(arr);
388
+ tree = (0, _businessUtil.listToTree)(res);
389
+ setCatgsList(tree);
395
390
  return [2
396
391
  /*return*/
397
392
  ];
@@ -409,7 +404,7 @@ var ProductModal = function ProductModal(props) {
409
404
  case 0:
410
405
  return [4
411
406
  /*yield*/
412
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offerdiscatgs/brands", {}, 'GET')];
407
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/designer/resource/brand/list", {}, 'GET')];
413
408
 
414
409
  case 1:
415
410
  res = _a.sent();
@@ -565,35 +560,33 @@ var ProductModal = function ProductModal(props) {
565
560
  layout: "vertical"
566
561
  }, /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
567
562
  label: "Category"
568
- }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
569
- mode: "multiple",
570
- onChange: function onChange(value, option) {
563
+ }, /*#__PURE__*/_react["default"].createElement(_antd.TreeSelect, {
564
+ dropdownStyle: {
565
+ maxHeight: 400,
566
+ overflow: 'auto'
567
+ },
568
+ maxTagCount: 2,
569
+ maxTagTextLength: 5,
570
+ multiple: true,
571
+ onChange: function onChange(value) {
571
572
  setSelCatgsList(value);
572
573
  },
573
574
  placeholder: (0, _locale.i18n)('PLEASE_SELECT'),
574
575
  size: "small",
576
+ treeData: catgsList,
577
+ treeDefaultExpandAll: true,
575
578
  value: selCatgsList
576
- }, catgsList.map(function (item) {
577
- return /*#__PURE__*/_react["default"].createElement(OptGroup, {
578
- key: item.model.catgId,
579
- label: item.model.catgName
580
- }, (item.children || []).map(function (i) {
581
- return /*#__PURE__*/_react["default"].createElement(Option, {
582
- key: i.model.catgId,
583
- value: i.model.catgId
584
- }, i.model.catgName);
585
- }));
586
- }))), /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
579
+ })), /*#__PURE__*/_react["default"].createElement(_antd.Form.Item, {
587
580
  label: "Brand"
588
581
  }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
589
582
  mode: "multiple",
590
- onChange: function onChange(value, option) {
583
+ onChange: function onChange(value) {
591
584
  setSelBrandsList(value);
592
585
  },
593
586
  placeholder: (0, _locale.i18n)('PLEASE_SELECT'),
594
587
  size: "small",
595
588
  value: selBrandsList
596
- }, brandsList.map(function (item, index) {
589
+ }, brandsList.map(function (item) {
597
590
  return /*#__PURE__*/_react["default"].createElement(Option, {
598
591
  key: item.catgId,
599
592
  value: item.brandId
@@ -706,8 +699,8 @@ var ProductModal = function ProductModal(props) {
706
699
  productCode: productCode,
707
700
  storeId: storeId,
708
701
  cmpTypeId: promotions || '',
709
- minPrice: minPrice === '' ? '' : minPrice * Math.pow(10, precision),
710
- maxPrice: maxPrice === '' ? '' : maxPrice * Math.pow(10, precision),
702
+ minPrice: (0, _currencyUtil.formatBackendCurrency)(minPrice),
703
+ maxPrice: (0, _currencyUtil.formatBackendCurrency)(maxPrice),
711
704
  catgIds: selCatgsList.join(','),
712
705
  brandIds: selBrandsList.join(','),
713
706
  labelIds: selLabelData.value || '',
@@ -736,8 +729,8 @@ var ProductModal = function ProductModal(props) {
736
729
  productName: productName,
737
730
  productCode: productCode,
738
731
  cmpTypeId: promotions || '',
739
- minPrice: minPrice === '' ? '' : minPrice * Math.pow(10, precision),
740
- maxPrice: maxPrice === '' ? '' : maxPrice * Math.pow(10, precision),
732
+ minPrice: (0, _currencyUtil.formatBackendCurrency)(minPrice),
733
+ maxPrice: (0, _currencyUtil.formatBackendCurrency)(maxPrice),
741
734
  catgIds: selCatgsList.join(','),
742
735
  brandIds: selBrandsList.join(','),
743
736
  labelIds: selLabelData.value || '',
@@ -208,6 +208,12 @@ function (_super) {
208
208
  style: _this.getBackgroundStyle(item)
209
209
  }, /*#__PURE__*/_react["default"].createElement("div", {
210
210
  className: "carouselItem",
211
+ onClick: function onClick() {
212
+ /** PTO 定制GA */
213
+ if (window.magicDesign.pushGA) {
214
+ window.magicDesign.pushGA({}, 'select_promotion');
215
+ }
216
+ },
211
217
  onMouseEnter: _this.mouseEnterWrap,
212
218
  onMouseLeave: _this.mouseLeaveWrap,
213
219
  style: _this.getItemStyle(item)
@@ -15,6 +15,8 @@ var _defaultJSON = require("./defaultJSON");
15
15
 
16
16
  var _compositeDecorator = _interopRequireDefault(require("../../../../decorator/compositeDecorator"));
17
17
 
18
+ var _decorator = require("../../../../decorator");
19
+
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
21
 
20
22
  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); }
@@ -68,40 +70,26 @@ function (_super) {
68
70
  var _this = _super !== null && _super.apply(this, arguments) || this;
69
71
 
70
72
  _this.state = {
71
- show: false
73
+ lazyShow: false
72
74
  };
73
75
  _this.carouselRef = /*#__PURE__*/_react["default"].createRef();
74
76
  _this.intersectionObserver = null;
75
77
  return _this;
76
78
  }
77
79
 
78
- Carousel.prototype.componentDidMount = function () {
79
- var _this = this;
80
+ Carousel.prototype.componentDidMount = function () {};
80
81
 
81
- this.intersectionObserver = new IntersectionObserver(function (entries) {
82
- if (entries[0].isIntersecting) {
83
- _this.setState({
84
- show: true
85
- });
86
- }
87
- }, {
88
- root: null,
89
- // threshold: 0.8,
90
- rootMargin: '0px 0px 100px 0px'
91
- });
92
- this.intersectionObserver.observe(this.carouselRef.current);
93
- };
94
-
95
- Carousel.prototype.componentWillUnmount = function () {
96
- this.intersectionObserver.disconnect(this.carouselRef.current);
97
- };
82
+ Carousel.prototype.componentWillUnmount = function () {};
98
83
 
99
84
  Carousel.prototype.render = function () {
100
85
  var nodeData = this.props.nodeData;
101
- var show = this.state.show;
86
+ var lazyShow = this.state.lazyShow;
102
87
  return /*#__PURE__*/_react["default"].createElement("div", {
103
- ref: this.carouselRef
104
- }, show && (window.magicDesign.device === 'pc' ? /*#__PURE__*/_react["default"].createElement(_pc["default"], {
88
+ ref: this.carouselRef,
89
+ style: {
90
+ height: lazyShow ? 'auto' : 300
91
+ }
92
+ }, lazyShow && (window.magicDesign.device === 'pc' ? /*#__PURE__*/_react["default"].createElement(_pc["default"], {
105
93
  data: nodeData
106
94
  }) : /*#__PURE__*/_react["default"].createElement(_mobile["default"], {
107
95
  data: nodeData
@@ -111,6 +99,11 @@ function (_super) {
111
99
  Carousel.defaultProps = {};
112
100
  Carousel.type = 'CAROUSEL';
113
101
  Carousel.getDefaultJSON = _defaultJSON.getDefaultJSON;
102
+
103
+ __decorate([(0, _decorator.lazy)('carouselRef')], Carousel.prototype, "componentDidMount", null);
104
+
105
+ __decorate([_decorator.lazyDestroy], Carousel.prototype, "componentWillUnmount", null);
106
+
114
107
  Carousel = __decorate([_compositeDecorator["default"]], Carousel);
115
108
  return Carousel;
116
109
  }(_react.Component);
@@ -73,24 +73,13 @@ var __assign = void 0 && (void 0).__assign || function () {
73
73
  return __assign.apply(this, arguments);
74
74
  };
75
75
 
76
- var MOBILE_IMG_SIZE = {
77
- 1: {
78
- maxH: 282
79
- },
80
- 2: {
81
- maxH: 137
82
- },
83
- 3: {
84
- maxH: 87
85
- },
86
- 4: {
87
- maxH: 66
88
- },
89
- 5: {
90
- maxH: 50
91
- }
92
- };
93
-
76
+ // const MOBILE_IMG_SIZE = {
77
+ // 1: { maxH: 282 },
78
+ // 2: { maxH: 137 },
79
+ // 3: { maxH: 87 },
80
+ // 4: { maxH: 66 },
81
+ // 5: { maxH: 50 },
82
+ // };
94
83
  var CarouselMobile =
95
84
  /** @class */
96
85
  function (_super) {
@@ -101,6 +101,18 @@ var videoGroupSourceJSON = function videoGroupSourceJSON(parentId) {
101
101
  iconUrl: '',
102
102
  layout: 'right'
103
103
  },
104
+ spacing: {
105
+ pc: {
106
+ paddingTop: 0,
107
+ paddingBottom: 0,
108
+ marginBottom: 0
109
+ },
110
+ mobile: {
111
+ paddingTop: 0,
112
+ paddingBottom: 0,
113
+ marginBottom: 0
114
+ }
115
+ },
104
116
  text: 'Button Tag'
105
117
  },
106
118
  secondButtonTag: {
@@ -126,6 +138,18 @@ var videoGroupSourceJSON = function videoGroupSourceJSON(parentId) {
126
138
  borderColor: '',
127
139
  borderRadius: 4
128
140
  },
141
+ spacing: {
142
+ pc: {
143
+ paddingTop: 0,
144
+ paddingBottom: 0,
145
+ marginBottom: 0
146
+ },
147
+ mobile: {
148
+ paddingTop: 0,
149
+ paddingBottom: 0,
150
+ marginBottom: 0
151
+ }
152
+ },
129
153
  buttonIcon: {
130
154
  iconUrl: '',
131
155
  layout: 'right'
@@ -79,7 +79,6 @@ function (_super) {
79
79
  var _a;
80
80
 
81
81
  var obj = null;
82
- console.log(customize);
83
82
 
84
83
  if ((0, _coreUtil.isPc)()) {
85
84
  switch ((_a = customize === null || customize === void 0 ? void 0 : customize.layout) === null || _a === void 0 ? void 0 : _a.pcLayout) {