@fonixtree/magic-design 0.1.22 → 0.1.24

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 (67) hide show
  1. package/es/assets/less/input.less +4 -0
  2. package/es/common/Collapse/index.js +4 -0
  3. package/es/common/Collapse/index.less +3 -0
  4. package/es/common/FontStyles/index.less +2 -1
  5. package/es/common/InputNumber/index.less +5 -0
  6. package/es/common/LinkModal/MiniAppTable/index.js +250 -0
  7. package/es/common/LinkModal/index.js +6 -0
  8. package/es/composite-comp/bol/components/Banner/mobile/index.less +78 -52
  9. package/es/composite-comp/bol/components/Banner/pc/index.js +11 -3
  10. package/es/composite-comp/bol/components/Banner/pc/index.less +2 -2
  11. package/es/composite-comp/bol/components/Carousel/mobile/index.js +4 -4
  12. package/es/composite-comp/bol/components/Carousel/mobile/index.less +100 -81
  13. package/es/composite-comp/bol/components/Carousel/pc/index.js +5 -4
  14. package/es/composite-comp/bol/components/ImageGallery/mobile/index.less +22 -15
  15. package/es/composite-comp/bol/components/ImageText/mobile/index.less +292 -233
  16. package/es/composite-comp/bol/components/Video/mobile/Layout1/index.less +27 -23
  17. package/es/composite-comp/bol/components/Video/mobile/Layout2/index.less +45 -38
  18. package/es/composite-comp/bol/components/Video/mobile/Layout3/index.less +50 -41
  19. package/es/composite-comp/bol/components/Video/mobile/index.less +3 -2
  20. package/es/composite-comp/bol/components/Wallet/mobile/index.less +40 -27
  21. package/es/composite-comp/common/config-panels/CustomizeConfig/index.js +12 -40
  22. package/es/composite-comp/common/config-panels/CustomizeConfig/index.less +2 -1
  23. package/es/composite-comp/dito/components/FlashDeal/mobile/index.less +97 -83
  24. package/es/composite-comp/dito/components/MobileNavigation/mobile/index.less +35 -18
  25. package/es/composite-comp/dito/components/Recommend/mobile/index.less +86 -73
  26. package/es/composite-comp/dito/components/SearchBar/mobile/index.less +52 -45
  27. package/es/constants/index.js +2 -1
  28. package/es/core/Designer/CompListPanel/CompCard/index.js +5 -1
  29. package/es/meta-comp/components/Image/index.js +1 -1
  30. package/es/meta-comp/config-panels/ButtonConfig/index.js +18 -1
  31. package/es/utils/businessUtil.js +12 -0
  32. package/es/utils/commonUtil.js +4 -0
  33. package/es/utils/coreUtil.js +0 -1
  34. package/lib/assets/less/input.less +4 -0
  35. package/lib/common/Collapse/index.js +4 -0
  36. package/lib/common/Collapse/index.less +3 -0
  37. package/lib/common/FontStyles/index.less +2 -1
  38. package/lib/common/InputNumber/index.less +5 -0
  39. package/lib/common/LinkModal/MiniAppTable/index.js +250 -0
  40. package/lib/common/LinkModal/index.js +6 -0
  41. package/lib/composite-comp/bol/components/Banner/mobile/index.less +78 -52
  42. package/lib/composite-comp/bol/components/Banner/pc/index.js +11 -3
  43. package/lib/composite-comp/bol/components/Banner/pc/index.less +2 -2
  44. package/lib/composite-comp/bol/components/Carousel/mobile/index.js +4 -4
  45. package/lib/composite-comp/bol/components/Carousel/mobile/index.less +100 -81
  46. package/lib/composite-comp/bol/components/Carousel/pc/index.js +5 -4
  47. package/lib/composite-comp/bol/components/ImageGallery/mobile/index.less +22 -15
  48. package/lib/composite-comp/bol/components/ImageText/mobile/index.less +292 -233
  49. package/lib/composite-comp/bol/components/Video/mobile/Layout1/index.less +27 -23
  50. package/lib/composite-comp/bol/components/Video/mobile/Layout2/index.less +45 -38
  51. package/lib/composite-comp/bol/components/Video/mobile/Layout3/index.less +50 -41
  52. package/lib/composite-comp/bol/components/Video/mobile/index.less +3 -2
  53. package/lib/composite-comp/bol/components/Wallet/mobile/index.less +40 -27
  54. package/lib/composite-comp/common/config-panels/CustomizeConfig/index.js +12 -40
  55. package/lib/composite-comp/common/config-panels/CustomizeConfig/index.less +2 -1
  56. package/lib/composite-comp/dito/components/FlashDeal/mobile/index.less +97 -83
  57. package/lib/composite-comp/dito/components/MobileNavigation/mobile/index.less +35 -18
  58. package/lib/composite-comp/dito/components/Recommend/mobile/index.less +86 -73
  59. package/lib/composite-comp/dito/components/SearchBar/mobile/index.less +52 -45
  60. package/lib/constants/index.js +2 -1
  61. package/lib/core/Designer/CompListPanel/CompCard/index.js +5 -1
  62. package/lib/meta-comp/components/Image/index.js +1 -1
  63. package/lib/meta-comp/config-panels/ButtonConfig/index.js +18 -1
  64. package/lib/utils/businessUtil.js +12 -0
  65. package/lib/utils/commonUtil.js +4 -0
  66. package/lib/utils/coreUtil.js +0 -1
  67. package/package.json +1 -1
@@ -20,3 +20,7 @@
20
20
  box-shadow: none
21
21
  }
22
22
  }
23
+
24
+ [magic_design] .cylon-input-number{
25
+ height: 100%;
26
+ }
@@ -137,6 +137,10 @@ function (_super) {
137
137
  var activeKey = _this.state.activeKey;
138
138
 
139
139
  if (checked) {
140
+ if (panelInfo.checkClick) {
141
+ panelInfo.checkClick();
142
+ }
143
+
140
144
  _this.setState({
141
145
  activeKey: [((_a = panelInfo.metaOption) === null || _a === void 0 ? void 0 : _a.id) || panelInfo.key]
142
146
  });
@@ -1,4 +1,7 @@
1
1
  .collapse_wrap {
2
+ .rc-collapse-extra{
3
+ display: flex;
4
+ }
2
5
  .rc-collapse {
3
6
  .rc-collapse-item {
4
7
  border-bottom: 1px solid #EDF0F4;
@@ -12,7 +12,8 @@
12
12
  border-radius: 6px;
13
13
  margin-right: 12px;
14
14
  cursor: pointer;
15
-
15
+ display: flex;
16
+
16
17
  &.active {
17
18
  background: #E9F0FF;
18
19
  }
@@ -6,6 +6,9 @@
6
6
  border-radius: 8px;
7
7
  padding: 0 7px;
8
8
  position: relative;
9
+ display: flex;
10
+ align-items: center;
11
+ padding-top: 1px;
9
12
 
10
13
  .cylon-input-number-focused {
11
14
  box-shadow: none;
@@ -29,5 +32,7 @@
29
32
  position: absolute;
30
33
  top: 50%;
31
34
  transform: translateY(-50%);
35
+ font-size: 14px;
36
+ right: 4px;
32
37
  }
33
38
  }
@@ -0,0 +1,250 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = CustomTable;
9
+
10
+ var _antd = require("antd");
11
+
12
+ var _react = _interopRequireWildcard(require("react"));
13
+
14
+ var _commonUtil = require("../../../utils/commonUtil");
15
+
16
+ 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
+
18
+ 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; }
19
+
20
+ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
21
+ function adopt(value) {
22
+ return value instanceof P ? value : new P(function (resolve) {
23
+ resolve(value);
24
+ });
25
+ }
26
+
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) {
29
+ try {
30
+ step(generator.next(value));
31
+ } catch (e) {
32
+ reject(e);
33
+ }
34
+ }
35
+
36
+ function rejected(value) {
37
+ try {
38
+ step(generator["throw"](value));
39
+ } catch (e) {
40
+ reject(e);
41
+ }
42
+ }
43
+
44
+ function step(result) {
45
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
46
+ }
47
+
48
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
49
+ });
50
+ };
51
+
52
+ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
53
+ var _ = {
54
+ label: 0,
55
+ sent: function sent() {
56
+ if (t[0] & 1) throw t[1];
57
+ return t[1];
58
+ },
59
+ trys: [],
60
+ ops: []
61
+ },
62
+ f,
63
+ y,
64
+ t,
65
+ g;
66
+ return g = {
67
+ next: verb(0),
68
+ "throw": verb(1),
69
+ "return": verb(2)
70
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
71
+ return this;
72
+ }), g;
73
+
74
+ function verb(n) {
75
+ return function (v) {
76
+ return step([n, v]);
77
+ };
78
+ }
79
+
80
+ function step(op) {
81
+ if (f) throw new TypeError("Generator is already executing.");
82
+
83
+ while (_) {
84
+ try {
85
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
86
+ if (y = 0, t) op = [op[0] & 2, t.value];
87
+
88
+ switch (op[0]) {
89
+ case 0:
90
+ case 1:
91
+ t = op;
92
+ break;
93
+
94
+ case 4:
95
+ _.label++;
96
+ return {
97
+ value: op[1],
98
+ done: false
99
+ };
100
+
101
+ case 5:
102
+ _.label++;
103
+ y = op[1];
104
+ op = [0];
105
+ continue;
106
+
107
+ case 7:
108
+ op = _.ops.pop();
109
+
110
+ _.trys.pop();
111
+
112
+ continue;
113
+
114
+ default:
115
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
116
+ _ = 0;
117
+ continue;
118
+ }
119
+
120
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
121
+ _.label = op[1];
122
+ break;
123
+ }
124
+
125
+ if (op[0] === 6 && _.label < t[1]) {
126
+ _.label = t[1];
127
+ t = op;
128
+ break;
129
+ }
130
+
131
+ if (t && _.label < t[2]) {
132
+ _.label = t[2];
133
+
134
+ _.ops.push(op);
135
+
136
+ break;
137
+ }
138
+
139
+ if (t[2]) _.ops.pop();
140
+
141
+ _.trys.pop();
142
+
143
+ continue;
144
+ }
145
+
146
+ op = body.call(thisArg, _);
147
+ } catch (e) {
148
+ op = [6, e];
149
+ y = 0;
150
+ } finally {
151
+ f = t = 0;
152
+ }
153
+ }
154
+
155
+ if (op[0] & 5) throw op[1];
156
+ return {
157
+ value: op[0] ? op[1] : void 0,
158
+ done: true
159
+ };
160
+ }
161
+ };
162
+
163
+ function CustomTable(props) {
164
+ var _this = this;
165
+
166
+ var _onChange = props.onChange;
167
+
168
+ var _a = (0, _react.useState)([]),
169
+ miniAppList = _a[0],
170
+ setMiniAppList = _a[1];
171
+
172
+ var _b = (0, _react.useState)(false),
173
+ loading = _b[0],
174
+ setLoading = _b[1];
175
+
176
+ var queryMiniApp = function queryMiniApp(params) {
177
+ return __awaiter(_this, void 0, void 0, function () {
178
+ var res;
179
+ return __generator(this, function (_a) {
180
+ switch (_a.label) {
181
+ case 0:
182
+ setLoading(true);
183
+ return [4
184
+ /*yield*/
185
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/mini/app/list", params, 'GET')];
186
+
187
+ case 1:
188
+ res = _a.sent();
189
+ setMiniAppList(res.list);
190
+ setLoading(false);
191
+ return [2
192
+ /*return*/
193
+ ];
194
+ }
195
+ });
196
+ });
197
+ };
198
+
199
+ (0, _react.useEffect)(function () {
200
+ queryMiniApp({
201
+ state: 'Valid',
202
+ pageSize: 100
203
+ });
204
+ }, []);
205
+ var columns = [{
206
+ title: 'Logo',
207
+ dataIndex: 'logo',
208
+ render: function render(value) {
209
+ return /*#__PURE__*/_react["default"].createElement("img", {
210
+ alt: "",
211
+ src: value.url,
212
+ style: {
213
+ width: 40,
214
+ height: 40
215
+ }
216
+ });
217
+ }
218
+ }, {
219
+ title: 'Store Name',
220
+ dataIndex: 'storeName'
221
+ }, {
222
+ title: 'App Name',
223
+ dataIndex: 'programName'
224
+ }];
225
+ var rowSelection = {
226
+ onChange: function onChange(selectedRowKeys, selectedRows) {
227
+ _onChange({
228
+ value: selectedRows[0].programLink,
229
+ name: selectedRows[0].programName + "(" + selectedRows[0].storeName + ")"
230
+ });
231
+ },
232
+ type: 'radio'
233
+ };
234
+ return /*#__PURE__*/_react["default"].createElement("div", {
235
+ style: {
236
+ height: 550
237
+ }
238
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Table, {
239
+ bordered: false,
240
+ columns: columns,
241
+ dataSource: miniAppList,
242
+ loading: loading,
243
+ pagination: false,
244
+ rowKey: "storeMiniProgramId",
245
+ rowSelection: rowSelection,
246
+ scroll: {
247
+ y: 480
248
+ }
249
+ }));
250
+ }
@@ -29,6 +29,8 @@ var _SelectVideoModal = _interopRequireDefault(require("./SelectVideoModal"));
29
29
 
30
30
  var _ShareUrl = _interopRequireDefault(require("./ShareUrl"));
31
31
 
32
+ var _MiniAppTable = _interopRequireDefault(require("./MiniAppTable"));
33
+
32
34
  var _locale = require("../../locale");
33
35
 
34
36
  var _commonUtil = require("../../utils/commonUtil");
@@ -321,6 +323,10 @@ var LinkModal = function LinkModal(props) {
321
323
  onChange: function onChange(value) {
322
324
  return setLinkUrl(value);
323
325
  }
326
+ }), item.linkTypeCode === 'MiniApp' && /*#__PURE__*/_react["default"].createElement(_MiniAppTable["default"], {
327
+ onChange: function onChange(value) {
328
+ return setLinkUrl(value);
329
+ }
324
330
  }));
325
331
  })), /*#__PURE__*/_react["default"].createElement("div", {
326
332
  className: "footer"
@@ -1,54 +1,80 @@
1
1
  .m-banner-mobile {
2
2
  position: relative;
3
- }
4
- .m-banner-mobile .cylon-carousel .slick-track {
5
- display: flex;
6
- align-items: center;
7
- }
8
- .m-banner-mobile .carouselItem {
9
- position: relative;
10
- display: flex;
11
- }
12
- .m-banner-mobile .carouselItem .carouseContent {
13
- padding: 1.6rem 0.56rem 0;
14
- position: absolute;
15
- z-index: 2;
16
- display: flex;
17
- flex-direction: column;
18
- margin-bottom: auto;
19
- }
20
- .m-banner-mobile .carouselItem .title {
21
- margin-bottom: 0.16rem;
22
- }
23
- .m-banner-mobile .carouselItem .sub-title {
24
- margin-bottom: 0.4rem;
25
- }
26
- .m-banner-mobile .carouselItem .btn-wrap {
27
- display: flex;
28
- align-items: center;
29
- justify-content: flex-start;
30
- }
31
- .m-banner-mobile .carouselItem .btn-wrap .btn {
32
- margin-right: 0.24rem;
33
- }
34
- .m-banner-mobile .swiper-ban {
35
- position: absolute;
36
- width: 100%;
37
- bottom: 0.2rem;
38
- display: flex;
39
- align-items: center;
40
- justify-content: center;
41
- }
42
- .m-banner-mobile .swiper-ban .ban {
43
- font-size: 0.32rem;
44
- width: 1.5em;
45
- height: 0.3em;
46
- background: #FFF;
47
- cursor: inherit;
48
- margin-right: 0.3em;
49
- transition: all 0.5s;
50
- }
51
- .m-banner-mobile .swiper-ban .ban.active {
52
- width: 1.5em;
53
- opacity: 1;
54
- }
3
+ // .turnPage {
4
+ // position: absolute;
5
+ // top: 50%;
6
+ // transform: translateY(-50%);
7
+ // z-index: 3;
8
+ // cursor: pointer;
9
+ // }
10
+ // .leftBtn {
11
+ // left: 20px;
12
+ // }
13
+ // .rightBtn {
14
+ // right: 20px;
15
+ // }
16
+
17
+ .cylon-carousel {
18
+ .slick-track {
19
+ display: flex;
20
+ align-items: center;
21
+ }
22
+ }
23
+
24
+ .carouselItem {
25
+ // height: 386px;
26
+ position: relative;
27
+ display: flex;
28
+
29
+ .carouseContent {
30
+ padding: 80px 28px 0;
31
+ position: absolute;
32
+ z-index: 2;
33
+ display: flex;
34
+ flex-direction: column;
35
+ margin-bottom: auto;
36
+ }
37
+
38
+ .title {
39
+ margin-bottom: 8px;
40
+ }
41
+
42
+ .sub-title {
43
+ margin-bottom: 20px;
44
+ }
45
+
46
+ .btn-wrap {
47
+ display: flex;
48
+ align-items: center;
49
+ justify-content: flex-start;
50
+
51
+ .btn {
52
+ margin-right: 12px;
53
+ }
54
+ }
55
+ }
56
+
57
+ .swiper-ban {
58
+ position: absolute;
59
+ width: 100%;
60
+ bottom: 10px;
61
+ display: flex;
62
+ align-items: center;
63
+ justify-content: center;
64
+
65
+ .ban {
66
+ font-size: 16px;
67
+ width: 1.5em;
68
+ height: 0.3em;
69
+ background: #FFF;
70
+ cursor: inherit;
71
+ margin-right: 0.3em;
72
+ transition: all .5s;
73
+
74
+ &.active {
75
+ width: 1.5em;
76
+ opacity: 1;
77
+ }
78
+ }
79
+ }
80
+ }
@@ -192,7 +192,8 @@ function (_super) {
192
192
  BannerPc.prototype.render = function () {
193
193
  var _this = this;
194
194
 
195
- var data = this.props.data;
195
+ var data = this.props.data; // console.log('--data banner', data);
196
+
196
197
  var _a = this.state,
197
198
  carouseIndex = _a.carouseIndex,
198
199
  hoverState = _a.hoverState;
@@ -233,6 +234,8 @@ function (_super) {
233
234
  autoplaySpeed: data.setting.autoplay.interval * 1000,
234
235
  dots: false
235
236
  }, data.groupSource.map(function (item, index) {
237
+ var _a, _b;
238
+
236
239
  return /*#__PURE__*/_react["default"].createElement("div", {
237
240
  key: item.id
238
241
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -259,7 +262,8 @@ function (_super) {
259
262
  }), /*#__PURE__*/_react["default"].createElement("div", {
260
263
  className: "carouseContent",
261
264
  style: {
262
- alignItems: _AlignSelector.alignItemMap[item.customize.align]
265
+ alignItems: _AlignSelector.alignItemMap[item.customize.layout],
266
+ textAlign: item.customize.align
263
267
  }
264
268
  }, item.title.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
265
269
  className: "title",
@@ -276,7 +280,11 @@ function (_super) {
276
280
  groupName: (0, _ConfigPanel.getSecondConfigName)(data, item.id)
277
281
  })
278
282
  }), /*#__PURE__*/_react["default"].createElement("div", {
279
- className: "btn-wrap"
283
+ className: "btn-wrap",
284
+ style: {
285
+ justifyContent: _AlignSelector.alignItemMap[item.customize.align],
286
+ width: Math.max((_a = item.title.content) === null || _a === void 0 ? void 0 : _a.pcWidth, (_b = item.text.content) === null || _b === void 0 ? void 0 : _b.pcWidth) + "%"
287
+ }
280
288
  }, item.button.open && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
281
289
  className: "btn",
282
290
  data: item.button,
@@ -73,8 +73,8 @@
73
73
  .btn-wrap {
74
74
  display: flex;
75
75
  align-items: center;
76
- justify-content: flex-start;
77
-
76
+ // justify-content: flex-start;
77
+ // width: 100%;
78
78
  .btn {
79
79
  margin-right: 12px;
80
80
  cursor: pointer;
@@ -192,10 +192,10 @@ function (_super) {
192
192
  rowNum = _a.rowNum;
193
193
  var colNum = 1;
194
194
 
195
- if (layout === 'layout1') {
196
- colNum = Math.min(rowNum, data.groupSource.length);
197
- } else if (layout === 'layout3') {
195
+ if (layout === 'layout3') {
198
196
  colNum = Math.min(rowNum + 0.2, data.groupSource.length);
197
+ } else {
198
+ colNum = Math.min(rowNum, data.groupSource.length);
199
199
  }
200
200
 
201
201
  var floorColNum = Math.floor(colNum);
@@ -225,7 +225,7 @@ function (_super) {
225
225
  sliderIndex: newIndex
226
226
  });
227
227
  },
228
- variableWidth: true
228
+ variableWidth: layout === 'layout3'
229
229
  };
230
230
  var dotsSpace = Math.max(data.setting.dots.size, data.setting.dots.hoverSize) + 12 + "px";
231
231
  return /*#__PURE__*/_react["default"].createElement("div", {