@fonixtree/magic-design 2.0.82 → 2.0.84

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 (95) hide show
  1. package/es/assets/fonts/.DS_Store +0 -0
  2. package/es/assets/fonts/magic-box-iconfont.css +30 -6
  3. package/es/assets/fonts/magic-box-iconfont.js +1 -1
  4. package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
  5. package/es/assets/fonts/magic-box-iconfont.woff +0 -0
  6. package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
  7. package/es/common/GroupList/index.js +5 -2
  8. package/es/common/ProductModal/SortableImageList/index.js +118 -0
  9. package/es/common/ProductModal/SortableImageList/index.less +3 -0
  10. package/es/common/ProductModal/index.js +40 -27
  11. package/es/composite-comp/common/config-panels/SpacingConfig/index.js +1 -0
  12. package/es/composite-comp/dito/components/CommonFunctions/defaultJSON.js +88 -0
  13. package/es/composite-comp/dito/components/CommonFunctions/index.js +84 -0
  14. package/es/composite-comp/dito/components/CommonFunctions/mobile/index.js +105 -0
  15. package/es/composite-comp/dito/components/CommonFunctions/mobile/index.less +30 -0
  16. package/es/composite-comp/dito/components/Orders/defaultJSON.js +89 -0
  17. package/es/composite-comp/dito/components/Orders/index.js +84 -0
  18. package/es/composite-comp/dito/components/Orders/mobile/index.js +336 -0
  19. package/es/composite-comp/dito/components/Orders/mobile/index.less +86 -0
  20. package/es/composite-comp/dito/components/PersonalInformation/defaultJSON.js +95 -0
  21. package/es/composite-comp/dito/components/PersonalInformation/index.js +84 -0
  22. package/es/composite-comp/dito/components/PersonalInformation/mobile/images/avatar.png +0 -0
  23. package/es/composite-comp/dito/components/PersonalInformation/mobile/index.js +451 -0
  24. package/es/composite-comp/dito/components/PersonalInformation/mobile/index.less +127 -0
  25. package/es/composite-comp/dito/config-panels/CommonFunctionsConfig/ConfigGroup/index.js +128 -0
  26. package/es/composite-comp/dito/config-panels/CommonFunctionsConfig/index.js +113 -0
  27. package/es/composite-comp/dito/config-panels/OrdersConfig/ConfigGroup/index.js +128 -0
  28. package/es/composite-comp/dito/config-panels/OrdersConfig/index.js +114 -0
  29. package/es/composite-comp/dito/config-panels/PersonalInformationConfig/ConfigGroup/index.js +131 -0
  30. package/es/composite-comp/dito/config-panels/PersonalInformationConfig/index.js +118 -0
  31. package/es/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.js +122 -0
  32. package/es/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.less +1 -0
  33. package/es/composite-comp/dito/second-config-panels/OrdersSecondConfig/index.js +148 -0
  34. package/es/composite-comp/dito/second-config-panels/OrdersSecondConfig/index.less +9 -0
  35. package/es/composite-comp/dito/second-config-panels/PersonalInformationSecondConfig/index.js +143 -0
  36. package/es/composite-comp/dito/second-config-panels/PersonalInformationSecondConfig/index.less +9 -0
  37. package/es/constants/component-types.js +21 -3
  38. package/es/constants/index.js +37 -3
  39. package/es/core/Designer/ConfigPanel/index.js +6 -0
  40. package/es/decorator/compositeDecorator.js +1 -1
  41. package/es/locale/en/en.json +14 -0
  42. package/es/locale/es/es.json +14 -0
  43. package/es/locale/id/id.json +14 -0
  44. package/es/mobx/UserState.js +144 -0
  45. package/es/mobx/index.js +9 -3
  46. package/es/utils/androidUtil.js +13 -2
  47. package/es/utils/commonUtil.js +117 -3
  48. package/lib/assets/fonts/.DS_Store +0 -0
  49. package/lib/assets/fonts/magic-box-iconfont.css +30 -6
  50. package/lib/assets/fonts/magic-box-iconfont.js +1 -1
  51. package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
  52. package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
  53. package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
  54. package/lib/common/GroupList/index.js +5 -2
  55. package/lib/common/ProductModal/SortableImageList/index.js +118 -0
  56. package/lib/common/ProductModal/SortableImageList/index.less +3 -0
  57. package/lib/common/ProductModal/index.js +40 -27
  58. package/lib/composite-comp/common/config-panels/SpacingConfig/index.js +1 -0
  59. package/lib/composite-comp/dito/components/CommonFunctions/defaultJSON.js +88 -0
  60. package/lib/composite-comp/dito/components/CommonFunctions/index.js +84 -0
  61. package/lib/composite-comp/dito/components/CommonFunctions/mobile/index.js +105 -0
  62. package/lib/composite-comp/dito/components/CommonFunctions/mobile/index.less +30 -0
  63. package/lib/composite-comp/dito/components/Orders/defaultJSON.js +89 -0
  64. package/lib/composite-comp/dito/components/Orders/index.js +84 -0
  65. package/lib/composite-comp/dito/components/Orders/mobile/index.js +336 -0
  66. package/lib/composite-comp/dito/components/Orders/mobile/index.less +86 -0
  67. package/lib/composite-comp/dito/components/PersonalInformation/defaultJSON.js +95 -0
  68. package/lib/composite-comp/dito/components/PersonalInformation/index.js +84 -0
  69. package/lib/composite-comp/dito/components/PersonalInformation/mobile/images/avatar.png +0 -0
  70. package/lib/composite-comp/dito/components/PersonalInformation/mobile/index.js +451 -0
  71. package/lib/composite-comp/dito/components/PersonalInformation/mobile/index.less +127 -0
  72. package/lib/composite-comp/dito/config-panels/CommonFunctionsConfig/ConfigGroup/index.js +128 -0
  73. package/lib/composite-comp/dito/config-panels/CommonFunctionsConfig/index.js +113 -0
  74. package/lib/composite-comp/dito/config-panels/OrdersConfig/ConfigGroup/index.js +128 -0
  75. package/lib/composite-comp/dito/config-panels/OrdersConfig/index.js +114 -0
  76. package/lib/composite-comp/dito/config-panels/PersonalInformationConfig/ConfigGroup/index.js +131 -0
  77. package/lib/composite-comp/dito/config-panels/PersonalInformationConfig/index.js +118 -0
  78. package/lib/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.js +122 -0
  79. package/lib/composite-comp/dito/second-config-panels/CommonFunctionsSecondConfig/index.less +1 -0
  80. package/lib/composite-comp/dito/second-config-panels/OrdersSecondConfig/index.js +148 -0
  81. package/lib/composite-comp/dito/second-config-panels/OrdersSecondConfig/index.less +9 -0
  82. package/lib/composite-comp/dito/second-config-panels/PersonalInformationSecondConfig/index.js +143 -0
  83. package/lib/composite-comp/dito/second-config-panels/PersonalInformationSecondConfig/index.less +9 -0
  84. package/lib/constants/component-types.js +21 -3
  85. package/lib/constants/index.js +37 -3
  86. package/lib/core/Designer/ConfigPanel/index.js +6 -0
  87. package/lib/decorator/compositeDecorator.js +1 -1
  88. package/lib/locale/en/en.json +14 -0
  89. package/lib/locale/es/es.json +14 -0
  90. package/lib/locale/id/id.json +14 -0
  91. package/lib/mobx/UserState.js +144 -0
  92. package/lib/mobx/index.js +9 -3
  93. package/lib/utils/androidUtil.js +13 -2
  94. package/lib/utils/commonUtil.js +117 -3
  95. package/package.json +1 -1
@@ -52,8 +52,11 @@ var renderCardDefault = function renderCardDefault(src) {
52
52
  alt: "",
53
53
  src: ((0, _coreUtil.isPc)() ? src.image.content.pcImgSrc : src.image.content.h5ImgSrc) || _defaultImg["default"]
54
54
  }), /*#__PURE__*/_react["default"].createElement("div", {
55
- className: "name"
56
- }, src.title.text));
55
+ className: "name",
56
+ dangerouslySetInnerHTML: {
57
+ __html: src.title.text
58
+ }
59
+ }));
57
60
  };
58
61
 
59
62
  var GroupList =
@@ -0,0 +1,118 @@
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"] = SortableImageList;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _immutabilityHelper = _interopRequireDefault(require("immutability-helper"));
13
+
14
+ var _Iconfont = _interopRequireDefault(require("../../Iconfont"));
15
+
16
+ require("./index.less");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ function SortableImageList(_a) {
25
+ var selectedList = _a.selectedList,
26
+ setSelectedList = _a.setSelectedList;
27
+
28
+ var _b = (0, _react.useState)(''),
29
+ dragId = _b[0],
30
+ setDragId = _b[1];
31
+
32
+ var _c = (0, _react.useState)(selectedList || []),
33
+ list = _c[0],
34
+ setList = _c[1];
35
+
36
+ var ref = (0, _react.useRef)();
37
+
38
+ var onDragEnd = function onDragEnd() {
39
+ console.log('onDragEnd');
40
+ setDragId('');
41
+
42
+ if (ref.current) {
43
+ setSelectedList(ref.current);
44
+ }
45
+ };
46
+
47
+ (0, _react.useEffect)(function () {
48
+ setList(selectedList || []);
49
+ }, [selectedList]);
50
+
51
+ var delSelectedItem = function delSelectedItem(index) {
52
+ var rows = JSON.parse(JSON.stringify(selectedList));
53
+ rows.splice(index, 1);
54
+ setSelectedList(rows);
55
+ };
56
+
57
+ var moveCard = (0, _react.useCallback)(function (dragNodeId, hoverNodeId) {
58
+ var dragIndex = list.findIndex(function (comp) {
59
+ return comp.productId === Number(dragNodeId);
60
+ });
61
+ var hoverIndex = list.findIndex(function (comp) {
62
+ return comp.productId === Number(hoverNodeId);
63
+ });
64
+ setList(function (prevCards) {
65
+ var newList = (0, _immutabilityHelper["default"])(prevCards, {
66
+ $splice: [[dragIndex, 1], [hoverIndex, 0, prevCards[dragIndex]]]
67
+ });
68
+ ref.current = newList;
69
+ return newList;
70
+ });
71
+ }, [list]);
72
+
73
+ var onDragEnter = function onDragEnter(e) {
74
+ console.log('onDragEnter');
75
+ var hoverNodeId = e.currentTarget.dataset.nodeid;
76
+
77
+ if (dragId === hoverNodeId) {
78
+ return;
79
+ }
80
+
81
+ moveCard(dragId, hoverNodeId);
82
+ };
83
+
84
+ var onDragStart = function onDragStart(e) {
85
+ setDragId(e.currentTarget.dataset.nodeid);
86
+ console.log('onDragStart');
87
+ };
88
+
89
+ return /*#__PURE__*/_react["default"].createElement("div", {
90
+ className: "imgListWrap"
91
+ }, list.map(function (item, index) {
92
+ return /*#__PURE__*/_react["default"].createElement("div", {
93
+ key: index,
94
+ className: "selectedItem"
95
+ }, /*#__PURE__*/_react["default"].createElement("img", {
96
+ alt: "",
97
+ className: "selectedItemImg " + (item.state !== 'A' ? 'invalid' : ''),
98
+ "data-nodeid": item.productId,
99
+ draggable: "true",
100
+ onDragEnd: onDragEnd,
101
+ onDragEnter: onDragEnter,
102
+ onDragOver: function onDragOver(e) {
103
+ e.preventDefault();
104
+ },
105
+ onDragStart: onDragStart,
106
+ src: item.productImageUrl,
107
+ title: item.productName
108
+ }), /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
109
+ className: "selectedItemClose",
110
+ color: "#000",
111
+ onClick: function onClick() {
112
+ return delSelectedItem(index);
113
+ },
114
+ size: 12,
115
+ type: "icon-close"
116
+ }));
117
+ }));
118
+ }
@@ -0,0 +1,3 @@
1
+ .imgListWrap {
2
+ display: flex;
3
+ }
@@ -11,12 +11,12 @@ var _antd = require("antd");
11
11
 
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
 
14
+ var _SortableImageList = _interopRequireDefault(require("./SortableImageList"));
15
+
14
16
  var _commonUtil = require("../../utils/commonUtil");
15
17
 
16
18
  var _businessUtil = require("../../utils/businessUtil");
17
19
 
18
- var _Iconfont = _interopRequireDefault(require("../Iconfont"));
19
-
20
20
  var _currencyUtil = require("../../utils/currencyUtil");
21
21
 
22
22
  require("./index.less");
@@ -310,13 +310,17 @@ var ProductModal = function ProductModal(props) {
310
310
  selectedList = _w[0],
311
311
  setSelectedList = _w[1];
312
312
 
313
- var _x = (0, _react.useState)({
313
+ var _x = (0, _react.useState)(''),
314
+ dragId = _x[0],
315
+ setDragId = _x[1];
316
+
317
+ var _y = (0, _react.useState)({
314
318
  pageSize: 20,
315
319
  current: 1,
316
320
  total: 0
317
321
  }),
318
- paginationParams = _x[0],
319
- setPaginationParams = _x[1];
322
+ paginationParams = _y[0],
323
+ setPaginationParams = _y[1];
320
324
 
321
325
  var rowSelection = {
322
326
  selectedRowKeys: selectedList.map(function (v) {
@@ -346,10 +350,34 @@ var ProductModal = function ProductModal(props) {
346
350
  }
347
351
  };
348
352
 
349
- var delSelectedItem = function delSelectedItem(index) {
350
- var rows = JSON.parse(JSON.stringify(selectedList));
351
- rows.splice(index, 1);
352
- setSelectedList(rows);
353
+ var moveItem = function moveItem(dragNodeId, hoverNodeId) {
354
+ var source = JSON.parse(JSON.stringify(selectedList));
355
+ var dragIndex = source.findIndex(function (obj) {
356
+ return obj.productId == dragNodeId;
357
+ });
358
+ var hoverIndex = source.findIndex(function (obj) {
359
+ return obj.productId == hoverNodeId;
360
+ });
361
+ var list = dragSource(source, dragIndex, hoverIndex);
362
+ setSelectedList(list);
363
+ };
364
+
365
+ var onDragStart = function onDragStart(e) {
366
+ setDragId(e.currentTarget.dataset.nodeid);
367
+ };
368
+
369
+ var onDragEnter = function onDragEnter(e) {
370
+ var hoverNodeId = e.currentTarget.dataset.nodeid;
371
+
372
+ if (dragId === hoverNodeId) {
373
+ return;
374
+ }
375
+
376
+ moveItem(dragId, hoverNodeId);
377
+ };
378
+
379
+ var onDragEnd = function onDragEnd() {
380
+ setDragId('');
353
381
  }; // 请求商品列表
354
382
 
355
383
 
@@ -790,24 +818,9 @@ var ProductModal = function ProductModal(props) {
790
818
  }
791
819
  }), /*#__PURE__*/_react["default"].createElement("div", {
792
820
  className: "selectedCot"
793
- }, selectedList.map(function (item, index) {
794
- return /*#__PURE__*/_react["default"].createElement("div", {
795
- key: index,
796
- className: "selectedItem"
797
- }, /*#__PURE__*/_react["default"].createElement("img", {
798
- alt: "",
799
- className: "selectedItemImg " + (item.state !== 'A' ? 'invalid' : ''),
800
- src: item.productImageUrl,
801
- title: item.productName
802
- }), /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
803
- className: "selectedItemClose",
804
- color: "#000",
805
- onClick: function onClick() {
806
- return delSelectedItem(index);
807
- },
808
- size: 12,
809
- type: "icon-close"
810
- }));
821
+ }, /*#__PURE__*/_react["default"].createElement(_SortableImageList["default"], {
822
+ selectedList: selectedList,
823
+ setSelectedList: setSelectedList
811
824
  })))), /*#__PURE__*/_react["default"].createElement("div", {
812
825
  className: "footer"
813
826
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -92,6 +92,7 @@ function (_super) {
92
92
  _this.selfRender();
93
93
  }
94
94
  })), /*#__PURE__*/_react["default"].createElement(_common.Field, {
95
+ split: "dashed",
95
96
  title: (0, _locale.i18n)('PADDING')
96
97
  }, /*#__PURE__*/_react["default"].createElement("div", {
97
98
  className: "padding-wrap"
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getDefaultJSON = exports.CommonFunctionsGroupSourceJSON = void 0;
7
+
8
+ var _uuid = require("uuid");
9
+
10
+ var CommonFunctionsGroupSourceJSON = function CommonFunctionsGroupSourceJSON(text) {
11
+ var groupId = (0, _uuid.v4)();
12
+ return {
13
+ id: groupId,
14
+ title: {
15
+ parentId: groupId,
16
+ id: (0, _uuid.v4)(),
17
+ open: true,
18
+ type: 'TEXT',
19
+ specialContent: [],
20
+ text: text || 'Function Name',
21
+ content: {
22
+ sizeType: 'Customize font styles',
23
+ fontFamily: 'Open Sans',
24
+ fontWeight: 600,
25
+ fontSize: 14,
26
+ color: '#2C2C2C',
27
+ width: 0,
28
+ textAlign: 'center'
29
+ },
30
+ underline: {
31
+ open: false,
32
+ textDecorationColor: '',
33
+ textDecorationStyle: 'solid'
34
+ },
35
+ vertical: {}
36
+ },
37
+ image: {
38
+ parentId: groupId,
39
+ id: (0, _uuid.v4)(),
40
+ open: true,
41
+ type: 'IMAGE',
42
+ content: {
43
+ h5Name: 'name2',
44
+ pcName: 'name2',
45
+ h5ImgSrc: '',
46
+ pcImgSrc: '',
47
+ clickUrl: ''
48
+ },
49
+ hover: {
50
+ open: false,
51
+ backgroundType: 'enlarge',
52
+ magnification: 1.5,
53
+ pcImgHoverUrl: '',
54
+ h5ImgHoverUrl: ''
55
+ }
56
+ }
57
+ };
58
+ };
59
+
60
+ exports.CommonFunctionsGroupSourceJSON = CommonFunctionsGroupSourceJSON;
61
+
62
+ var getDefaultJSON = function getDefaultJSON() {
63
+ return {
64
+ id: (0, _uuid.v4)(),
65
+ type: 'COMMON_FUNCTIONS',
66
+ groupSource: [CommonFunctionsGroupSourceJSON('Address'), CommonFunctionsGroupSourceJSON('Policies'), CommonFunctionsGroupSourceJSON('Security Center'), CommonFunctionsGroupSourceJSON('Function Name')],
67
+ spacing: {
68
+ pc: {
69
+ paddingTop: 0,
70
+ paddingBottom: 0,
71
+ marginBottom: 0
72
+ },
73
+ mobile: {
74
+ paddingTop: 0,
75
+ paddingBottom: 0,
76
+ marginBottom: 0
77
+ }
78
+ },
79
+ background: {
80
+ opacity: 100,
81
+ color: '#FFFFFF',
82
+ image: '',
83
+ bgType: 'color'
84
+ }
85
+ };
86
+ };
87
+
88
+ exports.getDefaultJSON = getDefaultJSON;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _mobile = _interopRequireDefault(require("./mobile"));
11
+
12
+ var _defaultJSON = require("./defaultJSON");
13
+
14
+ var _compositeDecorator = _interopRequireDefault(require("../../../../decorator/compositeDecorator"));
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
+
18
+ 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); }
19
+
20
+ 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; }
21
+
22
+ 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); }
23
+
24
+ var __extends = void 0 && (void 0).__extends || function () {
25
+ var _extendStatics = function extendStatics(d, b) {
26
+ _extendStatics = Object.setPrototypeOf || {
27
+ __proto__: []
28
+ } instanceof Array && function (d, b) {
29
+ d.__proto__ = b;
30
+ } || function (d, b) {
31
+ for (var p in b) {
32
+ if (b.hasOwnProperty(p)) d[p] = b[p];
33
+ }
34
+ };
35
+
36
+ return _extendStatics(d, b);
37
+ };
38
+
39
+ return function (d, b) {
40
+ _extendStatics(d, b);
41
+
42
+ function __() {
43
+ this.constructor = d;
44
+ }
45
+
46
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
47
+ };
48
+ }();
49
+
50
+ var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
51
+ var c = arguments.length,
52
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
53
+ d;
54
+ if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
55
+ if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
56
+ }
57
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
58
+ };
59
+
60
+ var CommonFunctions =
61
+ /** @class */
62
+ function (_super) {
63
+ __extends(CommonFunctions, _super);
64
+
65
+ function CommonFunctions() {
66
+ return _super !== null && _super.apply(this, arguments) || this;
67
+ }
68
+
69
+ CommonFunctions.prototype.render = function () {
70
+ var nodeData = this.props.nodeData;
71
+ return /*#__PURE__*/_react["default"].createElement("div", null, window.magicDesign.device === 'pc' ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null) : /*#__PURE__*/_react["default"].createElement(_mobile["default"], {
72
+ data: nodeData
73
+ }));
74
+ };
75
+
76
+ CommonFunctions.defaultProps = {};
77
+ CommonFunctions.type = 'COMMON_FUNCTIONS';
78
+ CommonFunctions.getDefaultJSON = _defaultJSON.getDefaultJSON;
79
+ CommonFunctions = __decorate([_compositeDecorator["default"]], CommonFunctions);
80
+ return CommonFunctions;
81
+ }(_react.Component);
82
+
83
+ var _default = CommonFunctions;
84
+ exports["default"] = _default;
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+
12
+ var _components = require("../../../../../meta-comp/components");
13
+
14
+ var _common = require("../../../../../common");
15
+
16
+ var _commonUtil = require("../../../../../utils/commonUtil");
17
+
18
+ require("./index.less");
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
+
22
+ var __extends = void 0 && (void 0).__extends || function () {
23
+ var _extendStatics = function extendStatics(d, b) {
24
+ _extendStatics = Object.setPrototypeOf || {
25
+ __proto__: []
26
+ } instanceof Array && function (d, b) {
27
+ d.__proto__ = b;
28
+ } || function (d, b) {
29
+ for (var p in b) {
30
+ if (b.hasOwnProperty(p)) d[p] = b[p];
31
+ }
32
+ };
33
+
34
+ return _extendStatics(d, b);
35
+ };
36
+
37
+ return function (d, b) {
38
+ _extendStatics(d, b);
39
+
40
+ function __() {
41
+ this.constructor = d;
42
+ }
43
+
44
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
45
+ };
46
+ }();
47
+
48
+ var CommonFunctionsMobile =
49
+ /** @class */
50
+ function (_super) {
51
+ __extends(CommonFunctionsMobile, _super);
52
+
53
+ function CommonFunctionsMobile() {
54
+ var _this = _super !== null && _super.apply(this, arguments) || this;
55
+
56
+ _this.state = {};
57
+
58
+ _this.onItemClick = function (item) {
59
+ var url = (0, _commonUtil.ensure)(function () {
60
+ return item.title.content.clickUrl.value || item.image.content.clickUrl.value;
61
+ }, '');
62
+ (0, _commonUtil.navigateTo)(url);
63
+ };
64
+
65
+ return _this;
66
+ }
67
+
68
+ CommonFunctionsMobile.prototype.render = function () {
69
+ var _this = this;
70
+
71
+ var data = this.props.data;
72
+ return /*#__PURE__*/_react["default"].createElement("div", {
73
+ className: (0, _classnames["default"])('common-functions-mobile')
74
+ }, /*#__PURE__*/_react["default"].createElement("ul", null, data.groupSource.map(function (item) {
75
+ return /*#__PURE__*/_react["default"].createElement("li", {
76
+ key: item.id,
77
+ onClick: function onClick() {
78
+ return _this.onItemClick(item);
79
+ }
80
+ }, /*#__PURE__*/_react["default"].createElement("div", null, item.image.open && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
81
+ className: "img",
82
+ data: item.image,
83
+ maxWidth: "100%"
84
+ }), item.title.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
85
+ className: "title",
86
+ data: item.title,
87
+ onTextInput: function onTextInput(text) {
88
+ item.title.text = text;
89
+ }
90
+ })), /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
91
+ color: "#C7C7C7",
92
+ size: 14,
93
+ type: "icon-outlined-right"
94
+ }));
95
+ })));
96
+ };
97
+
98
+ CommonFunctionsMobile.defaultProps = {
99
+ data: {}
100
+ };
101
+ return CommonFunctionsMobile;
102
+ }(_react["default"].Component);
103
+
104
+ var _default = CommonFunctionsMobile;
105
+ exports["default"] = _default;
@@ -0,0 +1,30 @@
1
+ .common-functions-mobile {
2
+ padding: 0.32rem 0;
3
+ box-sizing: border-box;
4
+ overflow: auto;
5
+ }
6
+ .common-functions-mobile ul {
7
+ margin: 0;
8
+ padding: 0;
9
+ }
10
+ .common-functions-mobile ul li {
11
+ padding: 0.24rem 0.32rem;
12
+ box-sizing: border-box;
13
+ display: flex;
14
+ justify-content: space-between;
15
+ align-items: center;
16
+ }
17
+ .common-functions-mobile ul li > div {
18
+ display: flex;
19
+ align-items: center;
20
+ }
21
+ .common-functions-mobile ul li > div .img {
22
+ width: 0.32rem;
23
+ height: 0.32rem;
24
+ margin-right: 0.08rem;
25
+ }
26
+ .common-functions-mobile ul li > div .title {
27
+ font-size: 0.28rem;
28
+ font-weight: 500;
29
+ line-height: 0.4rem;
30
+ }
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getDefaultJSON = exports.OrdersGroupSourceJSON = void 0;
7
+
8
+ var _uuid = require("uuid");
9
+
10
+ var OrdersGroupSourceJSON = function OrdersGroupSourceJSON(text) {
11
+ var groupId = (0, _uuid.v4)();
12
+ return {
13
+ id: groupId,
14
+ title: {
15
+ parentId: groupId,
16
+ id: (0, _uuid.v4)(),
17
+ open: true,
18
+ type: 'TEXT',
19
+ specialContent: [],
20
+ text: text || 'Name',
21
+ content: {
22
+ sizeType: 'Customize font styles',
23
+ fontFamily: 'Open Sans',
24
+ fontWeight: 400,
25
+ fontSize: 12,
26
+ color: '#2C2C2C',
27
+ width: 0,
28
+ textAlign: 'center'
29
+ },
30
+ underline: {
31
+ open: false,
32
+ textDecorationColor: '',
33
+ textDecorationStyle: 'solid'
34
+ },
35
+ vertical: {}
36
+ },
37
+ image: {
38
+ parentId: groupId,
39
+ id: (0, _uuid.v4)(),
40
+ open: true,
41
+ type: 'IMAGE',
42
+ content: {
43
+ h5Name: 'name2',
44
+ pcName: 'name2',
45
+ h5ImgSrc: '',
46
+ pcImgSrc: '',
47
+ clickUrl: ''
48
+ },
49
+ hover: {
50
+ open: false,
51
+ backgroundType: 'enlarge',
52
+ magnification: 1.5,
53
+ pcImgHoverUrl: '',
54
+ h5ImgHoverUrl: ''
55
+ }
56
+ },
57
+ sourceType: 'To Pay'
58
+ };
59
+ };
60
+
61
+ exports.OrdersGroupSourceJSON = OrdersGroupSourceJSON;
62
+
63
+ var getDefaultJSON = function getDefaultJSON() {
64
+ return {
65
+ id: (0, _uuid.v4)(),
66
+ type: 'ORDERS',
67
+ groupSource: [OrdersGroupSourceJSON('To Pay'), OrdersGroupSourceJSON('To Ship'), OrdersGroupSourceJSON('To Receive'), OrdersGroupSourceJSON('Rating'), OrdersGroupSourceJSON('Return')],
68
+ spacing: {
69
+ pc: {
70
+ paddingTop: 0,
71
+ paddingBottom: 0,
72
+ marginBottom: 0
73
+ },
74
+ mobile: {
75
+ paddingTop: 0,
76
+ paddingBottom: 0,
77
+ marginBottom: 0
78
+ }
79
+ },
80
+ background: {
81
+ opacity: 100,
82
+ color: '#FFFFFF',
83
+ image: '',
84
+ bgType: 'color'
85
+ }
86
+ };
87
+ };
88
+
89
+ exports.getDefaultJSON = getDefaultJSON;