@fonixtree/magic-design 2.0.63 → 2.0.66

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 (113) 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 +9 -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 +8 -5
  45. package/es/core/Designer/QuickMenuBar/index.js +5 -3
  46. package/es/core/Designer/QuickMenuBar/index.less +4 -0
  47. package/es/core/Designer/index.js +5 -1
  48. package/es/core/Renderer/index.js +3 -1
  49. package/es/decorator/compositeDecorator.js +23 -0
  50. package/es/locale/en/en.json +3 -0
  51. package/es/locale/es/es.json +3 -0
  52. package/es/locale/id/id.json +3 -0
  53. package/es/meta-comp/config-panels/ButtonConfig/index.js +5 -5
  54. package/es/meta-comp/config-panels/ImageConfig/index.js +4 -2
  55. package/es/utils/businessUtil.js +3 -3
  56. package/es/utils/commonUtil.js +2 -2
  57. package/lib/assets/images/base64/index.js +28 -2
  58. package/lib/common/ImagePicker/index.js +0 -2
  59. package/lib/common/LinkModal/FunctionTable/index.js +2 -1
  60. package/lib/common/LinkModal/index.js +14 -2
  61. package/lib/common/MyModal/index.less +1 -1
  62. package/lib/common/UrlPicker/index.js +3 -1
  63. package/lib/composite-comp/bol/components/ImageText/pc/index.js +2 -2
  64. package/lib/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +8 -6
  65. package/lib/composite-comp/common/components/ImageLabel/index.less +9 -3
  66. package/lib/composite-comp/common/components/ProductItem/index.js +25 -17
  67. package/lib/composite-comp/common/components/ProductItem/index.less +13 -7
  68. package/lib/composite-comp/dito/components/AffiliateRecommend/pc/index.js +6 -6
  69. package/lib/composite-comp/dito/components/HeadNavigation/defaultJSON.js +76 -66
  70. package/lib/composite-comp/dito/components/HeadNavigation/index.js +84 -0
  71. package/lib/composite-comp/dito/components/HeadNavigation/mobile/index.js +112 -0
  72. package/lib/composite-comp/dito/components/HeadNavigation/mobile/index.less +34 -0
  73. package/lib/composite-comp/dito/components/MenuNavigation/MenuNavMetaImage/index.js +206 -0
  74. package/lib/composite-comp/dito/components/MenuNavigation/MenuNavMetaImage/index.less +25 -0
  75. package/lib/composite-comp/dito/components/MenuNavigation/defaultJSON.js +70 -42
  76. package/lib/composite-comp/dito/components/MenuNavigation/index.js +84 -0
  77. package/lib/composite-comp/dito/components/MenuNavigation/mobile/index.js +87 -0
  78. package/lib/composite-comp/dito/components/MenuNavigation/mobile/index.less +8 -0
  79. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +4 -4
  80. package/lib/composite-comp/dito/components/Recommend/pc/index.js +6 -6
  81. package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/GroupList/index.js +203 -0
  82. package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/GroupList/index.less +72 -0
  83. package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/HeadNavConfigImageGroup/index.js +142 -0
  84. package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/index.js +123 -0
  85. package/lib/composite-comp/dito/config-panels/HeadNavigationConfig/index.less +23 -0
  86. package/lib/composite-comp/dito/config-panels/MenuNavigationConfig/GroupList/index.js +203 -0
  87. package/lib/composite-comp/dito/config-panels/MenuNavigationConfig/GroupList/index.less +72 -0
  88. package/lib/composite-comp/dito/config-panels/MenuNavigationConfig/MenuNavConfigImageGroup/index.js +137 -0
  89. package/lib/composite-comp/dito/config-panels/MenuNavigationConfig/MenuNavConfigImageGroup/index.less +6 -0
  90. package/lib/composite-comp/dito/config-panels/MenuNavigationConfig/index.js +40 -0
  91. package/lib/composite-comp/dito/second-config-panels/HeadNavigationSecondConfig/index.js +127 -0
  92. package/lib/composite-comp/dito/second-config-panels/MenuNavigationSecondConfig/index.js +127 -0
  93. package/lib/constants/component-types.js +15 -3
  94. package/lib/constants/index.js +8 -0
  95. package/lib/core/Designer/ChatRobot/components/SearchCondition/index.js +110 -0
  96. package/lib/core/Designer/ChatRobot/components/SearchCondition/index.less +33 -0
  97. package/lib/core/Designer/ChatRobot/index.js +23 -5
  98. package/lib/core/Designer/ChatRobot/index.less +40 -20
  99. package/lib/core/Designer/History/index.js +2 -2
  100. package/lib/core/Designer/PageCompList/index.js +8 -5
  101. package/lib/core/Designer/QuickMenuBar/index.js +5 -3
  102. package/lib/core/Designer/QuickMenuBar/index.less +4 -0
  103. package/lib/core/Designer/index.js +5 -1
  104. package/lib/core/Renderer/index.js +3 -1
  105. package/lib/decorator/compositeDecorator.js +23 -0
  106. package/lib/locale/en/en.json +3 -0
  107. package/lib/locale/es/es.json +3 -0
  108. package/lib/locale/id/id.json +3 -0
  109. package/lib/meta-comp/config-panels/ButtonConfig/index.js +5 -5
  110. package/lib/meta-comp/config-panels/ImageConfig/index.js +4 -2
  111. package/lib/utils/businessUtil.js +3 -3
  112. package/lib/utils/commonUtil.js +2 -2
  113. package/package.json +1 -1
@@ -0,0 +1,142 @@
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 _mobxReact = require("mobx-react");
11
+
12
+ var _Button = _interopRequireDefault(require("../../../../../common/Button"));
13
+
14
+ var _coreUtil = require("../../../../../utils/coreUtil");
15
+
16
+ var _decorator = require("../../../../../decorator");
17
+
18
+ var _defaultJSON = require("../../../components/HeadNavigation/defaultJSON");
19
+
20
+ var _locale = require("../../../../../locale");
21
+
22
+ var _GroupList = _interopRequireDefault(require("../../../../../common/GroupList"));
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 notice = 'error';
65
+
66
+ var MenuNavConfigImageGroup =
67
+ /** @class */
68
+ function (_super) {
69
+ __extends(MenuNavConfigImageGroup, _super);
70
+
71
+ function MenuNavConfigImageGroup() {
72
+ var _this = _super !== null && _super.apply(this, arguments) || this;
73
+
74
+ _this.state = {};
75
+
76
+ _this.onClickItem = function (node) {
77
+ _this.props.store.setState({
78
+ clickedGroup: node.id
79
+ });
80
+ };
81
+
82
+ _this.reRender = function () {
83
+ (0, _coreUtil.renderPreview)();
84
+
85
+ _this.setState({});
86
+ };
87
+
88
+ _this.onAddClick = function () {
89
+ var json = (0, _defaultJSON.groupSourceHeadJSON)();
90
+
91
+ _this.props.source.push(json);
92
+
93
+ _this.setState({});
94
+
95
+ (0, _coreUtil.renderPreview)();
96
+ };
97
+
98
+ _this.renderCard = function (src) {
99
+ return /*#__PURE__*/_react["default"].createElement("div", {
100
+ className: "card_wrap"
101
+ }, /*#__PURE__*/_react["default"].createElement("div", {
102
+ className: "name"
103
+ }, src.type));
104
+ };
105
+
106
+ return _this;
107
+ }
108
+
109
+ MenuNavConfigImageGroup.prototype.render = function () {
110
+ var _this = this;
111
+
112
+ var _a = this.props.source,
113
+ source = _a === void 0 ? [] : _a;
114
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
115
+ className: "node_list"
116
+ }, source.length === 0 ? /*#__PURE__*/_react["default"].createElement("span", {
117
+ className: "notice"
118
+ }, notice) : /*#__PURE__*/_react["default"].createElement(_GroupList["default"], {
119
+ onClickItem: this.onClickItem,
120
+ renderCard: function renderCard(v) {
121
+ return _this.renderCard(v);
122
+ },
123
+ reRender: this.reRender,
124
+ source: source
125
+ })), /*#__PURE__*/_react["default"].createElement("div", {
126
+ className: "btn_wrap"
127
+ }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
128
+ icon: "icon-add",
129
+ onClick: this.onAddClick,
130
+ type: "primary"
131
+ }, (0, _locale.i18n)('ADD_MENU'))));
132
+ };
133
+
134
+ MenuNavConfigImageGroup.defaultProps = {
135
+ source: []
136
+ };
137
+ MenuNavConfigImageGroup = __decorate([(0, _mobxReact.inject)('store'), _mobxReact.observer, _decorator.updateConfigDecorator], MenuNavConfigImageGroup);
138
+ return MenuNavConfigImageGroup;
139
+ }(_react["default"].Component);
140
+
141
+ var _default = MenuNavConfigImageGroup;
142
+ exports["default"] = _default;
@@ -0,0 +1,123 @@
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 _antd = require("antd");
11
+
12
+ var _HeadNavConfigImageGroup = _interopRequireDefault(require("./HeadNavConfigImageGroup"));
13
+
14
+ var _Collapse = _interopRequireDefault(require("../../../../common/Collapse"));
15
+
16
+ var _BackgroundConfig = _interopRequireDefault(require("../../../common/config-panels/BackgroundConfig"));
17
+
18
+ var _locale = require("../../../../locale");
19
+
20
+ var _coreUtil = require("../../../../utils/coreUtil");
21
+
22
+ var _common = require("../../../../common");
23
+
24
+ require("./index.less");
25
+
26
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": 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 HeadNavConfigImageGroup =
55
+ /** @class */
56
+ function (_super) {
57
+ __extends(HeadNavConfigImageGroup, _super);
58
+
59
+ function HeadNavConfigImageGroup() {
60
+ var _this = _super !== null && _super.apply(this, arguments) || this;
61
+
62
+ _this.selfRender = function () {
63
+ (0, _coreUtil.renderPreview)();
64
+
65
+ _this.setState({});
66
+ };
67
+
68
+ _this.getDisplayPage = function () {
69
+ var data = _this.props.data;
70
+ return /*#__PURE__*/_react["default"].createElement(_common.Field, null, data.displayPage.map(function (one) {
71
+ return /*#__PURE__*/_react["default"].createElement("div", {
72
+ key: one.name,
73
+ className: "head-navigation-display-wrap"
74
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Checkbox, {
75
+ checked: one.state,
76
+ onChange: function onChange(e) {
77
+ one.state = e.target.checked;
78
+
79
+ _this.selfRender();
80
+ }
81
+ }, one.name));
82
+ }));
83
+ };
84
+
85
+ return _this;
86
+ }
87
+
88
+ HeadNavConfigImageGroup.prototype.render = function () {
89
+ var data = this.props.data;
90
+ return /*#__PURE__*/_react["default"].createElement("div", {
91
+ className: "head-navigation-config"
92
+ }, /*#__PURE__*/_react["default"].createElement(_Collapse["default"], {
93
+ divider: "bold",
94
+ headerSize: "large",
95
+ source: [{
96
+ key: 'headNavigation1',
97
+ name: (0, _locale.i18n)('GROUP'),
98
+ value: /*#__PURE__*/_react["default"].createElement(_HeadNavConfigImageGroup["default"], {
99
+ source: data.groupSource
100
+ })
101
+ }, {
102
+ key: 'headNavigation3',
103
+ name: (0, _locale.i18n)('DISPLAY_PAGE'),
104
+ value: this.getDisplayPage()
105
+ }, {
106
+ key: 'headNavigation2',
107
+ name: (0, _locale.i18n)('BACKGROUND'),
108
+ value: /*#__PURE__*/_react["default"].createElement(_BackgroundConfig["default"], {
109
+ data: data.background
110
+ })
111
+ }],
112
+ type: "triangle"
113
+ }));
114
+ };
115
+
116
+ HeadNavConfigImageGroup.defaultProps = {
117
+ data: {}
118
+ };
119
+ return HeadNavConfigImageGroup;
120
+ }(_react["default"].Component);
121
+
122
+ var _default = HeadNavConfigImageGroup;
123
+ exports["default"] = _default;
@@ -0,0 +1,23 @@
1
+ .head-navigation-config {
2
+ .head-navigation-display-wrap {
3
+ &+ .head-navigation-display-wrap {
4
+ margin-top: 20px;
5
+ }
6
+ .cylon-checkbox-wrapper {
7
+ display: flex;
8
+ flex-direction: row-reverse;
9
+ justify-content: space-between;
10
+ .cylon-checkbox-checked .cylon-checkbox-inner {
11
+ background-color: #2F54EB;
12
+ border-color: #2F54EB;
13
+ }
14
+ .cylon-checkbox + span {
15
+ flex: 1;
16
+ padding-left: 0;
17
+ color: #232F46;
18
+ font-size: 16px;
19
+ font-weight: 600;
20
+ }
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,203 @@
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
+ require("./index.less");
11
+
12
+ var _common = require("../../../../../common");
13
+
14
+ var _commonUtil = require("../../../../../utils/commonUtil");
15
+
16
+ var _coreUtil = require("../../../../../utils/coreUtil");
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 GroupList =
47
+ /** @class */
48
+ function (_super) {
49
+ __extends(GroupList, _super);
50
+
51
+ function GroupList() {
52
+ var _this = _super !== null && _super.apply(this, arguments) || this;
53
+
54
+ _this.state = {
55
+ dragId: ''
56
+ };
57
+
58
+ _this.moveCard = function (dragNodeId, hoverNodeId) {
59
+ var source = _this.props.source;
60
+ var dragIndex = source.findIndex(function (obj) {
61
+ return obj.id === dragNodeId;
62
+ });
63
+ var hoverIndex = source.findIndex(function (obj) {
64
+ return obj.id === hoverNodeId;
65
+ });
66
+ (0, _commonUtil.dragSource)(source, dragIndex, hoverIndex);
67
+
68
+ _this.setState({});
69
+
70
+ (0, _coreUtil.renderPreview)();
71
+ };
72
+
73
+ _this.onDragStart = function (e) {
74
+ _this.setState({
75
+ dragId: e.currentTarget.dataset.nodeid
76
+ });
77
+ };
78
+
79
+ _this.onDragEnter = function (e) {
80
+ var dragId = _this.state.dragId;
81
+ var hoverNodeId = e.currentTarget.dataset.nodeid;
82
+
83
+ if (dragId === hoverNodeId) {
84
+ return;
85
+ } // renderPreview();
86
+
87
+
88
+ _this.moveCard(dragId, hoverNodeId);
89
+ };
90
+
91
+ _this.onDragEnd = function () {
92
+ _this.setState({
93
+ dragId: ''
94
+ });
95
+ };
96
+
97
+ _this.copyItem = function (e, item) {
98
+ var source = _this.props.source;
99
+ e.stopPropagation();
100
+ var index = source.findIndex(function (src) {
101
+ return src.id === item.id;
102
+ });
103
+ source.splice(index, 0, (0, _coreUtil.copyNode)(item));
104
+
105
+ _this.setState({});
106
+
107
+ (0, _coreUtil.renderPreview)();
108
+ };
109
+
110
+ _this.deleteItem = function (e, item) {
111
+ e.stopPropagation();
112
+ var source = _this.props.source;
113
+ var index = source.findIndex(function (src) {
114
+ return src.id === item.id;
115
+ });
116
+ source.splice(index, 1);
117
+
118
+ _this.setState({});
119
+
120
+ (0, _coreUtil.renderPreview)();
121
+
122
+ _this.props.reRender();
123
+ };
124
+
125
+ _this.renderCard = function (src) {
126
+ return /*#__PURE__*/_react["default"].createElement("div", {
127
+ className: "card_wrap"
128
+ }, /*#__PURE__*/_react["default"].createElement("div", {
129
+ className: "name"
130
+ }, src.type));
131
+ };
132
+
133
+ return _this;
134
+ }
135
+
136
+ GroupList.prototype.render = function () {
137
+ var _this = this;
138
+
139
+ var _a = this.props,
140
+ source = _a.source,
141
+ onClickItem = _a.onClickItem;
142
+ var dragId = this.state.dragId;
143
+ return /*#__PURE__*/_react["default"].createElement("div", {
144
+ className: "group_list"
145
+ }, source.length > 0 && source.map(function (src, index) {
146
+ return /*#__PURE__*/_react["default"].createElement("div", {
147
+ key: "card" + src.id,
148
+ className: "group_item",
149
+ "data-nodeid": src.id,
150
+ draggable: "true",
151
+ id: "card" + src.id,
152
+ onClick: function onClick() {
153
+ return onClickItem(src);
154
+ },
155
+ onDragEnd: _this.onDragEnd,
156
+ onDragEnter: _this.onDragEnter,
157
+ onDragOver: function onDragOver(e) {
158
+ e.preventDefault();
159
+ },
160
+ onDragStart: _this.onDragStart,
161
+ style: {
162
+ opacity: src.id === dragId ? '0.4' : '1'
163
+ }
164
+ }, /*#__PURE__*/_react["default"].createElement("div", {
165
+ className: "left"
166
+ }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
167
+ className: "drag-icon",
168
+ color: "#C4C4C4",
169
+ size: "20px",
170
+ type: "icon-drag"
171
+ }), /*#__PURE__*/_react["default"].createElement("span", {
172
+ className: "middle_info ml8"
173
+ }, _this.renderCard(src, index))), /*#__PURE__*/_react["default"].createElement("div", {
174
+ className: "right"
175
+ }, source.length < 5 && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
176
+ className: "icon_copy",
177
+ color: "#232F46",
178
+ onClick: function onClick(e) {
179
+ return _this.copyItem(e, src);
180
+ },
181
+ size: "20px",
182
+ type: "icon-copy"
183
+ }), /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
184
+ className: "icon_delete",
185
+ color: "#FF4141",
186
+ onClick: function onClick(e) {
187
+ return _this.deleteItem(e, src);
188
+ },
189
+ size: "20px",
190
+ type: "icon-delete1"
191
+ })));
192
+ }));
193
+ };
194
+
195
+ GroupList.defaultProps = {
196
+ source: [],
197
+ onClickItem: function onClickItem() {}
198
+ };
199
+ return GroupList;
200
+ }(_react["default"].Component);
201
+
202
+ var _default = GroupList;
203
+ exports["default"] = _default;
@@ -0,0 +1,72 @@
1
+ .group_list {
2
+ margin-bottom: 12px;
3
+
4
+ .group_item {
5
+ position: relative;
6
+ display: flex;
7
+ padding: 12px;
8
+ border-radius: 8px;
9
+ justify-content: space-between;
10
+ cursor: move;
11
+
12
+ &::after {
13
+ content: ' ';
14
+ position: absolute;
15
+ bottom: 0;
16
+ right: 0;
17
+ left: 0;
18
+ height: 1px;
19
+ background-color: #EDF0F4;
20
+ }
21
+
22
+ .left {
23
+ display: flex;
24
+ align-items: center;
25
+
26
+ .middle_info {
27
+ width: 260px;
28
+
29
+ .card_wrap {
30
+ display: flex;
31
+ align-items: center;
32
+ height: 40px;
33
+
34
+ img {
35
+ height: 40px;
36
+ width: 40px;
37
+ border-radius: 8px;
38
+ object-fit: cover;
39
+ background-color: #EDF0F4;
40
+ }
41
+
42
+ .name {
43
+ margin-left: 8px;
44
+ font-family: 'Open Sans';
45
+ font-style: normal;
46
+ font-weight: 600;
47
+ font-size: 16px;
48
+ line-height: 24px;
49
+ color: #232F46;
50
+ overflow: hidden;
51
+ text-overflow: ellipsis;
52
+ white-space: nowrap;
53
+ p {
54
+ margin-bottom: 0;
55
+ }
56
+ }
57
+ }
58
+ }
59
+ }
60
+
61
+
62
+ &:hover {
63
+ background-color: #E9F0FF;
64
+
65
+ .left {
66
+ .middle_info {
67
+ width: 200px;
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
@@ -0,0 +1,137 @@
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 _mobxReact = require("mobx-react");
11
+
12
+ var _Button = _interopRequireDefault(require("../../../../../common/Button"));
13
+
14
+ var _coreUtil = require("../../../../../utils/coreUtil");
15
+
16
+ var _decorator = require("../../../../../decorator");
17
+
18
+ var _GroupList = _interopRequireDefault(require("../GroupList"));
19
+
20
+ var _defaultJSON = require("../../../components/MenuNavigation/defaultJSON");
21
+
22
+ var _locale = require("../../../../../locale");
23
+
24
+ require("./index.less");
25
+
26
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
+
28
+ 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); }
29
+
30
+ var __extends = void 0 && (void 0).__extends || function () {
31
+ var _extendStatics = function extendStatics(d, b) {
32
+ _extendStatics = Object.setPrototypeOf || {
33
+ __proto__: []
34
+ } instanceof Array && function (d, b) {
35
+ d.__proto__ = b;
36
+ } || function (d, b) {
37
+ for (var p in b) {
38
+ if (b.hasOwnProperty(p)) d[p] = b[p];
39
+ }
40
+ };
41
+
42
+ return _extendStatics(d, b);
43
+ };
44
+
45
+ return function (d, b) {
46
+ _extendStatics(d, b);
47
+
48
+ function __() {
49
+ this.constructor = d;
50
+ }
51
+
52
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
53
+ };
54
+ }();
55
+
56
+ var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
57
+ var c = arguments.length,
58
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
59
+ d;
60
+ 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--) {
61
+ if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
62
+ }
63
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
64
+ };
65
+
66
+ var notice = 'error';
67
+
68
+ var MenuNavConfigImageGroup =
69
+ /** @class */
70
+ function (_super) {
71
+ __extends(MenuNavConfigImageGroup, _super);
72
+
73
+ function MenuNavConfigImageGroup() {
74
+ var _this = _super !== null && _super.apply(this, arguments) || this;
75
+
76
+ _this.state = {};
77
+
78
+ _this.onClickItem = function (node) {
79
+ _this.props.store.setState({
80
+ clickedGroup: node.id
81
+ });
82
+ };
83
+
84
+ _this.reRender = function () {
85
+ (0, _coreUtil.renderPreview)();
86
+
87
+ _this.setState({});
88
+ };
89
+
90
+ _this.onAddClick = function () {
91
+ var _a = _this.props.source,
92
+ source = _a === void 0 ? [] : _a;
93
+ if (source.length > 4) return;
94
+ var json = (0, _defaultJSON.groupSourceMenuJSON)();
95
+
96
+ _this.props.source.push(json);
97
+
98
+ _this.setState({});
99
+
100
+ (0, _coreUtil.renderPreview)();
101
+ };
102
+
103
+ return _this;
104
+ }
105
+
106
+ MenuNavConfigImageGroup.prototype.render = function () {
107
+ var _a = this.props.source,
108
+ source = _a === void 0 ? [] : _a;
109
+ return /*#__PURE__*/_react["default"].createElement("div", {
110
+ className: "menu_navigation_source"
111
+ }, /*#__PURE__*/_react["default"].createElement("div", {
112
+ className: "node_list"
113
+ }, source.length === 0 ? /*#__PURE__*/_react["default"].createElement("span", {
114
+ className: "notice"
115
+ }, notice) : /*#__PURE__*/_react["default"].createElement(_GroupList["default"], {
116
+ onClickItem: this.onClickItem,
117
+ reRender: this.reRender,
118
+ source: source
119
+ })), /*#__PURE__*/_react["default"].createElement("div", {
120
+ className: "btn_wrap"
121
+ }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
122
+ className: source.length === 5 ? 'unable-btn' : '',
123
+ icon: "icon-add",
124
+ onClick: this.onAddClick,
125
+ type: "primary"
126
+ }, (0, _locale.i18n)('ADD_MENU'))));
127
+ };
128
+
129
+ MenuNavConfigImageGroup.defaultProps = {
130
+ source: []
131
+ };
132
+ MenuNavConfigImageGroup = __decorate([(0, _mobxReact.inject)('store'), _mobxReact.observer, _decorator.updateConfigDecorator], MenuNavConfigImageGroup);
133
+ return MenuNavConfigImageGroup;
134
+ }(_react["default"].Component);
135
+
136
+ var _default = MenuNavConfigImageGroup;
137
+ exports["default"] = _default;