@fonixtree/magic-design 2.0.63 → 2.0.64

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 (111) hide show
  1. package/es/assets/images/base64/index.js +28 -2
  2. package/es/common/ImagePicker/index.js +0 -2
  3. package/es/common/LinkModal/FunctionTable/index.js +2 -1
  4. package/es/common/LinkModal/index.js +14 -2
  5. package/es/common/MyModal/index.less +1 -1
  6. package/es/common/UrlPicker/index.js +3 -1
  7. package/es/composite-comp/bol/components/ImageText/pc/index.js +2 -2
  8. package/es/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +8 -6
  9. package/es/composite-comp/common/components/ImageLabel/index.less +10 -3
  10. package/es/composite-comp/common/components/ProductItem/index.js +25 -17
  11. package/es/composite-comp/common/components/ProductItem/index.less +13 -7
  12. package/es/composite-comp/dito/components/AffiliateRecommend/pc/index.js +6 -6
  13. package/es/composite-comp/dito/components/HeadNavigation/defaultJSON.js +76 -66
  14. package/es/composite-comp/dito/components/HeadNavigation/index.js +84 -0
  15. package/es/composite-comp/dito/components/HeadNavigation/mobile/index.js +112 -0
  16. package/es/composite-comp/dito/components/HeadNavigation/mobile/index.less +34 -0
  17. package/es/composite-comp/dito/components/MenuNavigation/MenuNavMetaImage/index.js +206 -0
  18. package/es/composite-comp/dito/components/MenuNavigation/MenuNavMetaImage/index.less +25 -0
  19. package/es/composite-comp/dito/components/MenuNavigation/defaultJSON.js +70 -42
  20. package/es/composite-comp/dito/components/MenuNavigation/index.js +84 -0
  21. package/es/composite-comp/dito/components/MenuNavigation/mobile/index.js +87 -0
  22. package/es/composite-comp/dito/components/MenuNavigation/mobile/index.less +8 -0
  23. package/es/composite-comp/dito/components/Recommend/mobile/index.js +4 -4
  24. package/es/composite-comp/dito/components/Recommend/pc/index.js +6 -6
  25. package/es/composite-comp/dito/config-panels/HeadNavigationConfig/GroupList/index.js +203 -0
  26. package/es/composite-comp/dito/config-panels/HeadNavigationConfig/GroupList/index.less +72 -0
  27. package/es/composite-comp/dito/config-panels/HeadNavigationConfig/HeadNavConfigImageGroup/index.js +142 -0
  28. package/es/composite-comp/dito/config-panels/HeadNavigationConfig/index.js +123 -0
  29. package/es/composite-comp/dito/config-panels/HeadNavigationConfig/index.less +23 -0
  30. package/es/composite-comp/dito/config-panels/MenuNavigationConfig/GroupList/index.js +203 -0
  31. package/es/composite-comp/dito/config-panels/MenuNavigationConfig/GroupList/index.less +72 -0
  32. package/es/composite-comp/dito/config-panels/MenuNavigationConfig/MenuNavConfigImageGroup/index.js +137 -0
  33. package/es/composite-comp/dito/config-panels/MenuNavigationConfig/MenuNavConfigImageGroup/index.less +6 -0
  34. package/es/composite-comp/dito/config-panels/MenuNavigationConfig/index.js +40 -0
  35. package/es/composite-comp/dito/second-config-panels/HeadNavigationSecondConfig/index.js +127 -0
  36. package/es/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +127 -0
  37. package/es/constants/component-types.js +15 -3
  38. package/es/constants/index.js +8 -0
  39. package/es/core/Designer/ChatRobot/components/SearchCondition/index.js +110 -0
  40. package/es/core/Designer/ChatRobot/components/SearchCondition/index.less +33 -0
  41. package/es/core/Designer/ChatRobot/index.js +23 -5
  42. package/es/core/Designer/ChatRobot/index.less +40 -20
  43. package/es/core/Designer/History/index.js +2 -2
  44. package/es/core/Designer/PageCompList/index.js +5 -3
  45. package/es/core/Designer/index.js +1 -0
  46. package/es/core/Renderer/index.js +3 -1
  47. package/es/decorator/compositeDecorator.js +23 -0
  48. package/es/locale/en/en.json +3 -0
  49. package/es/locale/es/es.json +3 -0
  50. package/es/locale/id/id.json +3 -0
  51. package/es/meta-comp/config-panels/ButtonConfig/index.js +5 -5
  52. package/es/meta-comp/config-panels/ImageConfig/index.js +4 -2
  53. package/es/utils/businessUtil.js +3 -3
  54. package/es/utils/commonUtil.js +2 -2
  55. package/lib/assets/images/base64/index.js +28 -2
  56. package/lib/common/ImagePicker/index.js +0 -2
  57. package/lib/common/LinkModal/FunctionTable/index.js +2 -1
  58. package/lib/common/LinkModal/index.js +14 -2
  59. package/lib/common/MyModal/index.less +1 -1
  60. package/lib/common/UrlPicker/index.js +3 -1
  61. package/lib/composite-comp/bol/components/ImageText/pc/index.js +2 -2
  62. package/lib/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +8 -6
  63. package/lib/composite-comp/common/components/ImageLabel/index.less +10 -3
  64. package/lib/composite-comp/common/components/ProductItem/index.js +25 -17
  65. package/lib/composite-comp/common/components/ProductItem/index.less +13 -7
  66. package/lib/composite-comp/dito/components/AffiliateRecommend/pc/index.js +6 -6
  67. package/lib/composite-comp/dito/components/HeadNavigation/defaultJSON.js +76 -66
  68. package/lib/composite-comp/dito/components/HeadNavigation/index.js +84 -0
  69. package/lib/composite-comp/dito/components/HeadNavigation/mobile/index.js +112 -0
  70. package/lib/composite-comp/dito/components/HeadNavigation/mobile/index.less +34 -0
  71. package/lib/composite-comp/dito/components/MenuNavigation/MenuNavMetaImage/index.js +206 -0
  72. package/lib/composite-comp/dito/components/MenuNavigation/MenuNavMetaImage/index.less +25 -0
  73. package/lib/composite-comp/dito/components/MenuNavigation/defaultJSON.js +70 -42
  74. package/lib/composite-comp/dito/components/MenuNavigation/index.js +84 -0
  75. package/lib/composite-comp/dito/components/MenuNavigation/mobile/index.js +87 -0
  76. package/lib/composite-comp/dito/components/MenuNavigation/mobile/index.less +8 -0
  77. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +4 -4
  78. package/lib/composite-comp/dito/components/Recommend/pc/index.js +6 -6
  79. package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/GroupList/index.js +203 -0
  80. package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/GroupList/index.less +72 -0
  81. package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/HeadNavConfigImageGroup/index.js +142 -0
  82. package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/index.js +123 -0
  83. package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/index.less +23 -0
  84. package/lib/composite-comp/dito/config-panels/MenuNavigationConfig/GroupList/index.js +203 -0
  85. package/lib/composite-comp/dito/config-panels/MenuNavigationConfig/GroupList/index.less +72 -0
  86. package/lib/composite-comp/dito/config-panels/MenuNavigationConfig/MenuNavConfigImageGroup/index.js +137 -0
  87. package/lib/composite-comp/dito/config-panels/MenuNavigationConfig/MenuNavConfigImageGroup/index.less +6 -0
  88. package/lib/composite-comp/dito/config-panels/MenuNavigationConfig/index.js +40 -0
  89. package/lib/composite-comp/dito/second-config-panels/HeadNavigationSecondConfig/index.js +127 -0
  90. package/lib/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +127 -0
  91. package/lib/constants/component-types.js +15 -3
  92. package/lib/constants/index.js +8 -0
  93. package/lib/core/Designer/ChatRobot/components/SearchCondition/index.js +110 -0
  94. package/lib/core/Designer/ChatRobot/components/SearchCondition/index.less +33 -0
  95. package/lib/core/Designer/ChatRobot/index.js +23 -5
  96. package/lib/core/Designer/ChatRobot/index.less +40 -20
  97. package/lib/core/Designer/History/index.js +2 -2
  98. package/lib/core/Designer/PageCompList/index.js +5 -3
  99. package/lib/core/Designer/index.js +1 -0
  100. package/lib/core/Renderer/index.js +3 -1
  101. package/lib/decorator/compositeDecorator.js +23 -0
  102. package/lib/locale/en/en.json +3 -0
  103. package/lib/locale/es/es.json +3 -0
  104. package/lib/locale/id/id.json +3 -0
  105. package/lib/meta-comp/config-panels/ButtonConfig/index.js +5 -5
  106. package/lib/meta-comp/config-panels/ImageConfig/index.js +4 -2
  107. package/lib/utils/businessUtil.js +3 -3
  108. package/lib/utils/commonUtil.js +2 -2
  109. package/package.json +1 -1
  110. package/es/assets/fonts/.DS_Store +0 -0
  111. package/lib/assets/fonts/.DS_Store +0 -0
@@ -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 HeadNavigation =
61
+ /** @class */
62
+ function (_super) {
63
+ __extends(HeadNavigation, _super);
64
+
65
+ function HeadNavigation() {
66
+ return _super !== null && _super.apply(this, arguments) || this;
67
+ }
68
+
69
+ HeadNavigation.prototype.render = function () {
70
+ var nodeData = this.props.nodeData;
71
+ return /*#__PURE__*/_react["default"].createElement("div", null, window.magicDesign.device === 'pc' ? null : /*#__PURE__*/_react["default"].createElement(_mobile["default"], {
72
+ data: nodeData
73
+ }));
74
+ };
75
+
76
+ HeadNavigation.defaultProps = {};
77
+ HeadNavigation.type = 'HEAD_NAVIGATION';
78
+ HeadNavigation.getDefaultJSON = _defaultJSON.getDefaultJSON;
79
+ HeadNavigation = __decorate([_compositeDecorator["default"]], HeadNavigation);
80
+ return HeadNavigation;
81
+ }(_react.Component);
82
+
83
+ var _default = HeadNavigation;
84
+ exports["default"] = _default;
@@ -0,0 +1,112 @@
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 _components = require("../../../../../meta-comp/components");
11
+
12
+ var _commonUtil = require("../../../../../utils/commonUtil");
13
+
14
+ require("./index.less");
15
+
16
+ var _common = require("../../../../../common");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ var __extends = void 0 && (void 0).__extends || function () {
21
+ var _extendStatics = function extendStatics(d, b) {
22
+ _extendStatics = Object.setPrototypeOf || {
23
+ __proto__: []
24
+ } instanceof Array && function (d, b) {
25
+ d.__proto__ = b;
26
+ } || function (d, b) {
27
+ for (var p in b) {
28
+ if (b.hasOwnProperty(p)) d[p] = b[p];
29
+ }
30
+ };
31
+
32
+ return _extendStatics(d, b);
33
+ };
34
+
35
+ return function (d, b) {
36
+ _extendStatics(d, b);
37
+
38
+ function __() {
39
+ this.constructor = d;
40
+ }
41
+
42
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
43
+ };
44
+ }();
45
+
46
+ var HeadNavigationMobile =
47
+ /** @class */
48
+ function (_super) {
49
+ __extends(HeadNavigationMobile, _super);
50
+
51
+ function HeadNavigationMobile() {
52
+ var _this = _super !== null && _super.apply(this, arguments) || this;
53
+
54
+ _this.carouselRef = /*#__PURE__*/_react["default"].createRef();
55
+ _this.state = {
56
+ showNav: false
57
+ };
58
+ return _this;
59
+ }
60
+
61
+ HeadNavigationMobile.prototype.render = function () {
62
+ var _this = this;
63
+
64
+ var data = this.props.data;
65
+ var showNav = this.state.showNav;
66
+ console.log('---head data', data);
67
+ var GAData = (0, _commonUtil.getGAData)(data);
68
+ return /*#__PURE__*/_react["default"].createElement("div", {
69
+ className: "m-head-navigation"
70
+ }, /*#__PURE__*/_react["default"].createElement("div", {
71
+ className: "head-wrap"
72
+ }, /*#__PURE__*/_react["default"].createElement("div", {
73
+ className: "head-title"
74
+ }, "Direct Function"), /*#__PURE__*/_react["default"].createElement("div", {
75
+ className: "" + (showNav ? 'icon-wrap rotate' : 'icon-wrap'),
76
+ onClick: function onClick() {
77
+ _this.setState({
78
+ showNav: !showNav
79
+ });
80
+ }
81
+ }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
82
+ color: "#232F46",
83
+ size: 20,
84
+ type: "icon-more"
85
+ }))), /*#__PURE__*/_react["default"].createElement("div", {
86
+ className: showNav ? 'content-wrap item-padding-top' : 'content-wrap'
87
+ }, showNav && data.groupSource.map(function (group) {
88
+ return /*#__PURE__*/_react["default"].createElement("div", {
89
+ key: group.id,
90
+ className: "head-item",
91
+ onClick: function onClick() {
92
+ return _this.clickJump(group.title.text);
93
+ }
94
+ }, group.image.open && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
95
+ data: group.image,
96
+ GAData: GAData,
97
+ maxWidth: 64,
98
+ minWidth: 64
99
+ }));
100
+ })));
101
+ };
102
+
103
+ HeadNavigationMobile.defaultProps = {
104
+ data: {
105
+ groupSource: []
106
+ }
107
+ };
108
+ return HeadNavigationMobile;
109
+ }(_react["default"].Component);
110
+
111
+ var _default = HeadNavigationMobile;
112
+ exports["default"] = _default;
@@ -0,0 +1,34 @@
1
+ .m-head-navigation {
2
+ width: 100%;
3
+ }
4
+ .m-head-navigation .head-wrap {
5
+ padding: 0.3rem;
6
+ display: flex;
7
+ align-items: center;
8
+ justify-content: space-between;
9
+ border-bottom: 0.02rem solid #E6EAF0;
10
+ }
11
+ .m-head-navigation .head-wrap .head-title {
12
+ font-family: Open Sans;
13
+ font-size: 0.28rem;
14
+ font-weight: 400;
15
+ line-height: 0.44rem;
16
+ color: #000;
17
+ }
18
+ .m-head-navigation .head-wrap .icon-wrap {
19
+ transition: all 0.1s;
20
+ }
21
+ .m-head-navigation .head-wrap .rotate {
22
+ transform: rotate(90deg);
23
+ }
24
+ .m-head-navigation .content-wrap {
25
+ display: flex;
26
+ flex-wrap: wrap;
27
+ }
28
+ .m-head-navigation .content-wrap .head-item {
29
+ margin-bottom: 0.16rem;
30
+ margin-left: 0.14rem;
31
+ }
32
+ .m-head-navigation .item-padding-top {
33
+ padding-top: 0.16rem;
34
+ }
@@ -0,0 +1,206 @@
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
+ require("./index.less");
13
+
14
+ var _h5DefImg = _interopRequireDefault(require("../../../../../meta-comp/components/Image/image/h5DefImg.png"));
15
+
16
+ var _pcDefImg = _interopRequireDefault(require("../../../../../meta-comp/components/Image/image/pcDefImg.png"));
17
+
18
+ var _coreUtil = require("../../../../../utils/coreUtil");
19
+
20
+ var _decorator = require("../../../../../decorator");
21
+
22
+ var _commonUtil = require("../../../../../utils/commonUtil");
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
+
26
+ 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); }
27
+
28
+ var __extends = void 0 && (void 0).__extends || function () {
29
+ var _extendStatics = function extendStatics(d, b) {
30
+ _extendStatics = Object.setPrototypeOf || {
31
+ __proto__: []
32
+ } instanceof Array && function (d, b) {
33
+ d.__proto__ = b;
34
+ } || function (d, b) {
35
+ for (var p in b) {
36
+ if (b.hasOwnProperty(p)) d[p] = b[p];
37
+ }
38
+ };
39
+
40
+ return _extendStatics(d, b);
41
+ };
42
+
43
+ return function (d, b) {
44
+ _extendStatics(d, b);
45
+
46
+ function __() {
47
+ this.constructor = d;
48
+ }
49
+
50
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
51
+ };
52
+ }();
53
+
54
+ var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
55
+ var c = arguments.length,
56
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
57
+ d;
58
+ 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--) {
59
+ if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
60
+ }
61
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
62
+ };
63
+
64
+ var MetaImage =
65
+ /** @class */
66
+ function (_super) {
67
+ __extends(MetaImage, _super);
68
+
69
+ function MetaImage() {
70
+ var _this = _super !== null && _super.apply(this, arguments) || this;
71
+
72
+ _this.imgRef = /*#__PURE__*/_react["default"].createRef();
73
+ _this.state = {
74
+ // 当仅作为一个图片时,鼠标移上去,hover状态
75
+ hoverImgSrc: false
76
+ };
77
+
78
+ _this.getStyle = function () {
79
+ var _a, _b;
80
+
81
+ var _c = _this.props,
82
+ data = _c.data,
83
+ hoverState = _c.hoverState,
84
+ maxHeight = _c.maxHeight,
85
+ maxWidth = _c.maxWidth,
86
+ minHeight = _c.minHeight,
87
+ minWidth = _c.minWidth,
88
+ limitWidthHeight = _c.limitWidthHeight,
89
+ scale = _c.scale;
90
+ var hoverImgSrc = _this.state.hoverImgSrc;
91
+ var obj = {};
92
+
93
+ if (((_a = data === null || data === void 0 ? void 0 : data.hover) === null || _a === void 0 ? void 0 : _a.open) && ((_b = data === null || data === void 0 ? void 0 : data.hover) === null || _b === void 0 ? void 0 : _b.backgroundType) === 'enlarge' && (hoverState || hoverImgSrc)) {
94
+ // return { transform: `scale(${data.hover.magnification})` };
95
+ obj.transform = "scale(" + data.hover.magnification + ")";
96
+ obj.zIndex = '1';
97
+ }
98
+
99
+ if (maxHeight) {
100
+ obj.maxHeight = maxHeight;
101
+ }
102
+
103
+ if (maxWidth || maxWidth === 0) {
104
+ obj.maxWidth = maxWidth;
105
+ }
106
+
107
+ if (minHeight) {
108
+ obj.minHeight = minHeight;
109
+ }
110
+
111
+ if (minWidth) {
112
+ obj.minWidth = minWidth;
113
+ }
114
+
115
+ if (limitWidthHeight) {
116
+ if ((0, _coreUtil.isPc)()) {
117
+ if (data.content.pcImgWidth) obj.width = data.content.pcImgWidth * scale;
118
+
119
+ if (data.content.pcImgWidth > data.content.pcImgHeight) {
120
+ obj.height = 'auto';
121
+ } else if (data.content.pcImgHeight) obj.height = data.content.pcImgHeight * scale;
122
+ } else {
123
+ if (data.content.h5ImgWidth) obj.width = data.content.h5ImgWidth * scale; // if (data.content.h5ImgHeight) obj.height = data.content.h5ImgHeight * scale;
124
+
125
+ if (data.content.h5ImgWidth > data.content.h5ImgHeight || data.content.h5ImgHeight > maxHeight) {
126
+ obj.height = 'auto';
127
+ } else if (data.content.h5ImgHeight) obj.height = data.content.h5ImgHeight * scale;
128
+ }
129
+ }
130
+
131
+ return obj;
132
+ };
133
+
134
+ _this.mouseEnterImg = function () {
135
+ var _a;
136
+
137
+ var data = _this.props.data;
138
+
139
+ if ((_a = data === null || data === void 0 ? void 0 : data.hover) === null || _a === void 0 ? void 0 : _a.open) {
140
+ _this.setState({
141
+ hoverImgSrc: true
142
+ });
143
+ }
144
+ };
145
+
146
+ _this.mouseLeaveImg = function () {
147
+ var _a;
148
+
149
+ var data = _this.props.data;
150
+
151
+ if ((_a = data === null || data === void 0 ? void 0 : data.hover) === null || _a === void 0 ? void 0 : _a.open) {
152
+ _this.setState({
153
+ hoverImgSrc: false
154
+ });
155
+ }
156
+ };
157
+
158
+ return _this;
159
+ }
160
+
161
+ MetaImage.prototype.render = function () {
162
+ var _a, _b, _c, _d;
163
+
164
+ var _e = this.props,
165
+ data = _e.data,
166
+ hoverState = _e.hoverState;
167
+ var hoverImgSrc = this.state.hoverImgSrc;
168
+ var srcImg = (0, _coreUtil.isPc)() ? (_a = data.content) === null || _a === void 0 ? void 0 : _a.pcImgSrc : (_b = data.content) === null || _b === void 0 ? void 0 : _b.h5ImgSrc;
169
+
170
+ if (((_c = data === null || data === void 0 ? void 0 : data.hover) === null || _c === void 0 ? void 0 : _c.open) && ((_d = data === null || data === void 0 ? void 0 : data.hover) === null || _d === void 0 ? void 0 : _d.backgroundType) === 'new' && (hoverState || hoverImgSrc)) {
171
+ srcImg = (0, _coreUtil.isPc)() ? data.hover.pcImgHoverUrl : data.hover.h5ImgHoverUrl;
172
+ }
173
+
174
+ if (!srcImg) {
175
+ srcImg = (0, _coreUtil.isPc)() ? _pcDefImg["default"] : _h5DefImg["default"];
176
+ }
177
+
178
+ return /*#__PURE__*/_react["default"].createElement("div", {
179
+ className: (0, _classnames["default"])('menu-meta-image'),
180
+ onClick: function onClick() {
181
+ (0, _coreUtil.clickUrl)(data.content.clickUrl);
182
+ }
183
+ }, srcImg && /*#__PURE__*/_react["default"].createElement("img", {
184
+ ref: this.imgRef,
185
+ onMouseEnter: this.mouseEnterImg,
186
+ onMouseLeave: this.mouseLeaveImg,
187
+ src: srcImg,
188
+ style: (0, _commonUtil.pxToRem)(this.getStyle())
189
+ }));
190
+ };
191
+
192
+ MetaImage.defaultProps = {
193
+ data: {
194
+ content: {},
195
+ hover: {}
196
+ },
197
+ hoverState: false,
198
+ limitWidthHeight: false,
199
+ scale: 1
200
+ };
201
+ MetaImage = __decorate([_decorator.metaDecorator], MetaImage);
202
+ return MetaImage;
203
+ }(_react["default"].Component);
204
+
205
+ var _default = MetaImage;
206
+ exports["default"] = _default;
@@ -0,0 +1,25 @@
1
+ .menu-meta-image {
2
+ position: relative;
3
+ width: 100%;
4
+ height: 100%;
5
+ display: flex;
6
+ justify-content: center;
7
+ // overflow: hidden;
8
+ &>img {
9
+ width: 100%;
10
+ height: 100%;
11
+ // object-fit: contain;
12
+ transition: all .2s linear;
13
+ vertical-align: initial;
14
+ max-width: 100%;
15
+ object-fit: contain;
16
+ }
17
+
18
+ &.backgroundImg {
19
+ &>img {
20
+ // object-fit: cover;
21
+ // width: auto;
22
+ max-width: none;
23
+ }
24
+ }
25
+ }
@@ -3,69 +3,97 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getDefaultJSON = void 0;
6
+ exports.groupSourceMenuJSON = exports.getDefaultJSON = void 0;
7
7
 
8
8
  var _uuid = require("uuid");
9
9
 
10
+ var _base = require("../../../../assets/images/base64");
11
+
10
12
  var defaultMenuName = [{
11
13
  name: 'Home',
12
- icon: '',
13
- selectedIcon: '',
14
- clickUrl: ''
14
+ icon: _base.menuHomeIcon,
15
+ selectedIcon: _base.menuHomeSelectedIcon,
16
+ clickUrl: {
17
+ value: '/',
18
+ name: 'Home',
19
+ type: 'FunctionPage'
20
+ }
15
21
  }, {
16
22
  name: 'Category',
17
- icon: '',
18
- selectedIcon: '',
19
- clickUrl: ''
23
+ icon: _base.menuCategoryIcon,
24
+ selectedIcon: _base.menuCategorySelectedIcon,
25
+ clickUrl: {
26
+ value: '/main/category',
27
+ name: 'Category',
28
+ type: 'FunctionPage'
29
+ }
20
30
  }, {
21
31
  name: 'Community',
22
- icon: '',
23
- selectedIcon: '',
24
- clickUrl: ''
32
+ icon: _base.menuCommunityIcon,
33
+ selectedIcon: _base.menuCommunitySelectedIcon,
34
+ clickUrl: {
35
+ value: '/main/community',
36
+ name: 'Community',
37
+ type: 'FunctionPage'
38
+ }
25
39
  }, {
26
40
  name: 'Cart',
27
- icon: '',
28
- selectedIcon: '',
29
- clickUrl: ''
41
+ icon: _base.menuCartIcon,
42
+ selectedIcon: _base.menuCartSelectedIcon,
43
+ clickUrl: {
44
+ value: '/main/cart',
45
+ name: 'Cart',
46
+ remark: '/h5/carts/num'
47
+ }
30
48
  }, {
31
49
  name: 'Account',
32
- icon: '',
33
- selectedIcon: '',
34
- clickUrl: ''
50
+ icon: _base.menuAccountIcon,
51
+ selectedIcon: _base.menuAccountSelectedIcon,
52
+ clickUrl: {
53
+ value: '/main/account',
54
+ name: 'Account',
55
+ type: 'FunctionPage'
56
+ }
35
57
  }];
36
58
 
59
+ var groupSourceMenuJSON = function groupSourceMenuJSON(group) {
60
+ if (!group) group = defaultMenuName[0];
61
+ var itemId = (0, _uuid.v4)();
62
+ return {
63
+ id: itemId,
64
+ type: group.name,
65
+ image: {
66
+ parentId: itemId,
67
+ id: (0, _uuid.v4)(),
68
+ open: true,
69
+ type: 'IMAGE',
70
+ content: {
71
+ h5Name: 'name2',
72
+ pcName: 'name2',
73
+ h5ImgSrc: group.icon,
74
+ pcImgSrc: '',
75
+ clickUrl: group.clickUrl
76
+ },
77
+ hover: {
78
+ open: true,
79
+ backgroundType: 'new',
80
+ magnification: 1.5,
81
+ pcImgHoverUrl: '',
82
+ h5ImgHoverUrl: group.selectedIcon
83
+ }
84
+ }
85
+ };
86
+ };
87
+
88
+ exports.groupSourceMenuJSON = groupSourceMenuJSON;
89
+
37
90
  var getDefaultJSON = function getDefaultJSON() {
38
91
  var groupId = (0, _uuid.v4)();
39
92
  return {
40
93
  id: groupId,
41
94
  type: 'MENU_NAVIGATION',
42
95
  groupSource: defaultMenuName.map(function (group) {
43
- var itemId = (0, _uuid.v4)();
44
- return {
45
- id: itemId,
46
- parentId: groupId,
47
- type: group.name,
48
- image: {
49
- parentId: itemId,
50
- id: (0, _uuid.v4)(),
51
- open: true,
52
- type: 'IMAGE',
53
- content: {
54
- h5Name: 'name2',
55
- pcName: 'name2',
56
- h5ImgSrc: '',
57
- pcImgSrc: '',
58
- clickUrl: ''
59
- },
60
- hover: {
61
- open: true,
62
- backgroundType: 'enlarge',
63
- magnification: 1.5,
64
- pcImgHoverUrl: '',
65
- h5ImgHoverUrl: ''
66
- }
67
- }
68
- };
96
+ return groupSourceMenuJSON(group);
69
97
  }),
70
98
  background: {
71
99
  opacity: 100,
@@ -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 MenuNavigation =
61
+ /** @class */
62
+ function (_super) {
63
+ __extends(MenuNavigation, _super);
64
+
65
+ function MenuNavigation() {
66
+ return _super !== null && _super.apply(this, arguments) || this;
67
+ }
68
+
69
+ MenuNavigation.prototype.render = function () {
70
+ var nodeData = this.props.nodeData;
71
+ return /*#__PURE__*/_react["default"].createElement("div", null, window.magicDesign.device === 'pc' ? null : /*#__PURE__*/_react["default"].createElement(_mobile["default"], {
72
+ data: nodeData
73
+ }));
74
+ };
75
+
76
+ MenuNavigation.defaultProps = {};
77
+ MenuNavigation.type = 'MENU_NAVIGATION';
78
+ MenuNavigation.getDefaultJSON = _defaultJSON.getDefaultJSON;
79
+ MenuNavigation = __decorate([_compositeDecorator["default"]], MenuNavigation);
80
+ return MenuNavigation;
81
+ }(_react.Component);
82
+
83
+ var _default = MenuNavigation;
84
+ exports["default"] = _default;