@fonixtree/magic-design 2.0.191 → 2.0.193
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.
- package/es/common/SelectStoreModal/SortableImageList/index.js +118 -0
- package/es/common/SelectStoreModal/SortableImageList/index.less +3 -0
- package/es/common/SelectStoreModal/index.js +497 -0
- package/es/common/SelectStoreModal/index.less +152 -0
- package/es/common/StoreSource/index.js +255 -0
- package/es/common/StoreSource/index.less +14 -0
- package/es/common/index.js +8 -0
- package/es/composite-comp/public/components/Stores/defaultJSON.js +2 -1
- package/es/composite-comp/public/components/Stores/mobile/StoreItem/img/defaultHImg.png +0 -0
- package/es/composite-comp/public/components/Stores/mobile/StoreItem/img/defaultImg.png +0 -0
- package/es/composite-comp/public/components/Stores/mobile/StoreItem/index.js +18 -6
- package/es/composite-comp/public/components/Stores/mobile/StoreItem/index.less +15 -1
- package/es/composite-comp/public/components/Stores/mobile/index.js +11 -10
- package/es/composite-comp/public/config-panels/StoresConfig/ConfigContent/index.js +16 -3
- package/es/composite-comp/public/config-panels/StoresConfig/ConfigContent/index.less +14 -0
- package/es/locale/ar/ar.json +10 -1
- package/es/locale/en/en.json +10 -1
- package/es/locale/es/es.json +10 -1
- package/es/locale/mn/mn.json +10 -1
- package/es/utils/commonUtil.js +11 -1
- package/lib/common/SelectStoreModal/SortableImageList/index.js +118 -0
- package/lib/common/SelectStoreModal/SortableImageList/index.less +3 -0
- package/lib/common/SelectStoreModal/index.js +497 -0
- package/lib/common/SelectStoreModal/index.less +152 -0
- package/lib/common/StoreSource/index.js +255 -0
- package/lib/common/StoreSource/index.less +14 -0
- package/lib/common/index.js +8 -0
- package/lib/composite-comp/public/components/Stores/defaultJSON.js +2 -1
- package/lib/composite-comp/public/components/Stores/mobile/StoreItem/img/defaultHImg.png +0 -0
- package/lib/composite-comp/public/components/Stores/mobile/StoreItem/img/defaultImg.png +0 -0
- package/lib/composite-comp/public/components/Stores/mobile/StoreItem/index.js +18 -6
- package/lib/composite-comp/public/components/Stores/mobile/StoreItem/index.less +15 -1
- package/lib/composite-comp/public/components/Stores/mobile/index.js +11 -10
- package/lib/composite-comp/public/config-panels/StoresConfig/ConfigContent/index.js +16 -3
- package/lib/composite-comp/public/config-panels/StoresConfig/ConfigContent/index.less +14 -0
- package/lib/locale/ar/ar.json +10 -1
- package/lib/locale/en/en.json +10 -1
- package/lib/locale/es/es.json +10 -1
- package/lib/locale/mn/mn.json +10 -1
- package/lib/utils/commonUtil.js +11 -1
- package/package.json +1 -1
package/es/locale/ar/ar.json
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"NEW": "New",
|
|
3
|
+
"ALL": "All",
|
|
4
|
+
"CLOSE": "Close",
|
|
5
|
+
"OPEN": "Open",
|
|
6
|
+
"SELECT_STORE": "Select Store",
|
|
7
|
+
"STORE_LOGO": "Store Logo",
|
|
8
|
+
"STORE_STATE": "Store State",
|
|
9
|
+
"BUSINESS_TYPE": "Business Type",
|
|
10
|
+
"STORE_SELECT": "Store Select",
|
|
2
11
|
"SELECT_STORES": "Select stores",
|
|
3
12
|
"HIGH_SALES_STORES": "High sales stores",
|
|
4
13
|
"NEW_STORES": "New stores",
|
|
@@ -44,7 +53,6 @@
|
|
|
44
53
|
"CAMPAIGN_NAME": "Campaign Name",
|
|
45
54
|
"PROCESSING": "Processing",
|
|
46
55
|
"HAS_NOT_STARTED": "Has not started",
|
|
47
|
-
"ALL": "ALL",
|
|
48
56
|
"PERIOD_OF_VAILDITY": "Period of Vaildity",
|
|
49
57
|
"COUPON_VALUE": "Coupon Value",
|
|
50
58
|
"COUPON_NAME": "Coupon Name",
|
|
@@ -348,6 +356,7 @@
|
|
|
348
356
|
"ADD_IMAGE": "Add Image",
|
|
349
357
|
"ADD_BANNER": "Add Banner",
|
|
350
358
|
"TOTAL_PRODUCTS": "Total {count} products",
|
|
359
|
+
"TOTAL_STORES": "Total {count} stores",
|
|
351
360
|
"SELECTED": "Selected",
|
|
352
361
|
"GROUP_BUY": "Group Buy",
|
|
353
362
|
"RESET": "Reset",
|
package/es/locale/en/en.json
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"NEW": "New",
|
|
3
|
+
"ALL": "All",
|
|
4
|
+
"CLOSE": "Close",
|
|
5
|
+
"OPEN": "Open",
|
|
6
|
+
"SELECT_STORE": "Select Store",
|
|
7
|
+
"STORE_LOGO": "Store Logo",
|
|
8
|
+
"STORE_STATE": "Store State",
|
|
9
|
+
"BUSINESS_TYPE": "Business Type",
|
|
10
|
+
"STORE_SELECT": "Store Select",
|
|
2
11
|
"SELECT_STORES": "Select stores",
|
|
3
12
|
"HIGH_SALES_STORES": "High sales stores",
|
|
4
13
|
"NEW_STORES": "New stores",
|
|
@@ -44,7 +53,6 @@
|
|
|
44
53
|
"CAMPAIGN_NAME": "Campaign Name",
|
|
45
54
|
"PROCESSING": "Processing",
|
|
46
55
|
"HAS_NOT_STARTED": "Has not started",
|
|
47
|
-
"ALL": "ALL",
|
|
48
56
|
"PERIOD_OF_VAILDITY": "Period of Vaildity",
|
|
49
57
|
"COUPON_VALUE": "Coupon Value",
|
|
50
58
|
"COUPON_NAME": "Coupon Name",
|
|
@@ -348,6 +356,7 @@
|
|
|
348
356
|
"ADD_IMAGE": "Add Image",
|
|
349
357
|
"ADD_BANNER": "Add Banner",
|
|
350
358
|
"TOTAL_PRODUCTS": "Total {count} products",
|
|
359
|
+
"TOTAL_STORES": "Total {count} stores",
|
|
351
360
|
"SELECTED": "Selected",
|
|
352
361
|
"GROUP_BUY": "Group Buy",
|
|
353
362
|
"RESET": "Reset",
|
package/es/locale/es/es.json
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"NEW": "New",
|
|
3
|
+
"ALL": "TODO",
|
|
4
|
+
"CLOSE": "Close",
|
|
5
|
+
"OPEN": "Open",
|
|
6
|
+
"SELECT_STORE": "Select Store",
|
|
7
|
+
"STORE_LOGO": "Store Logo",
|
|
8
|
+
"STORE_STATE": "Store State",
|
|
9
|
+
"BUSINESS_TYPE": "Business Type",
|
|
10
|
+
"STORE_SELECT": "Store Select",
|
|
2
11
|
"SELECT_STORES": "Select stores",
|
|
3
12
|
"HIGH_SALES_STORES": "High sales stores",
|
|
4
13
|
"NEW_STORES": "New stores",
|
|
@@ -44,7 +53,6 @@
|
|
|
44
53
|
"CAMPAIGN_NAME": "Campaign Name",
|
|
45
54
|
"PROCESSING": "Processing",
|
|
46
55
|
"HAS_NOT_STARTED": "Has not started",
|
|
47
|
-
"ALL": "TODO",
|
|
48
56
|
"PERIOD_OF_VAILDITY": "Period of Vaildity",
|
|
49
57
|
"COUPON_VALUE": "Coupon Value",
|
|
50
58
|
"COUPON_NAME": "Coupon Name",
|
|
@@ -348,6 +356,7 @@
|
|
|
348
356
|
"ADD_IMAGE": "Añadir Imagen",
|
|
349
357
|
"ADD_BANNER": "Agregar Banner",
|
|
350
358
|
"TOTAL_PRODUCTS": "Total {count} productos",
|
|
359
|
+
"TOTAL_STORES": "Total {count} stores",
|
|
351
360
|
"SELECTED": "Seleccionado",
|
|
352
361
|
"GROUP_BUY": "Compra en grupo",
|
|
353
362
|
"RESET": "Restablecer",
|
package/es/locale/mn/mn.json
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"NEW": "New",
|
|
3
|
+
"ALL": "БҮГД",
|
|
4
|
+
"CLOSE": "Close",
|
|
5
|
+
"OPEN": "Open",
|
|
6
|
+
"SELECT_STORE": "Select Store",
|
|
7
|
+
"STORE_LOGO": "Store Logo",
|
|
8
|
+
"STORE_STATE": "Store State",
|
|
9
|
+
"BUSINESS_TYPE": "Business Type",
|
|
10
|
+
"STORE_SELECT": "Store Select",
|
|
2
11
|
"SELECT_STORES": "Select stores",
|
|
3
12
|
"HIGH_SALES_STORES": "High sales stores",
|
|
4
13
|
"NEW_STORES": "New stores",
|
|
@@ -44,7 +53,6 @@
|
|
|
44
53
|
"CAMPAIGN_NAME": "Аяны нэр",
|
|
45
54
|
"PROCESSING": "Боловсруулж байна",
|
|
46
55
|
"HAS_NOT_STARTED": "Эхлээгүй байна",
|
|
47
|
-
"ALL": "БҮГД",
|
|
48
56
|
"PERIOD_OF_VAILDITY": "Хүчинтэй байх хугацаа",
|
|
49
57
|
"COUPON_VALUE": "Купоны үнэ цэнэ",
|
|
50
58
|
"COUPON_NAME": "Купоны нэр",
|
|
@@ -348,6 +356,7 @@
|
|
|
348
356
|
"ADD_IMAGE": "Зураг нэмэх",
|
|
349
357
|
"ADD_BANNER": "Баннер нэмэх",
|
|
350
358
|
"TOTAL_PRODUCTS": "Нийт {count} бүтээгдэхүүн",
|
|
359
|
+
"TOTAL_STORES": "Total {count} stores",
|
|
351
360
|
"SELECTED": "Сонгосон",
|
|
352
361
|
"GROUP_BUY": "Бүлгийн худалдан авалт",
|
|
353
362
|
"RESET": "Дахин тохируулах",
|
package/es/utils/commonUtil.js
CHANGED
|
@@ -245,12 +245,22 @@ function commonFetch(url, data, method) {
|
|
|
245
245
|
var _a, _b;
|
|
246
246
|
|
|
247
247
|
var credentials = localStorage.getItem('credentials');
|
|
248
|
+
var csrf = localStorage.getItem('X-CSRF-TOKEN');
|
|
248
249
|
var headers = {
|
|
250
|
+
Accept: 'application/json',
|
|
249
251
|
'Content-Type': 'application/json; charset=UTF-8',
|
|
250
252
|
credentials: credentials,
|
|
251
|
-
accessToken: credentials
|
|
253
|
+
accessToken: credentials,
|
|
254
|
+
'X-CSRF-TOKEN': csrf
|
|
252
255
|
};
|
|
253
256
|
|
|
257
|
+
if (url.endsWith('portal/login')) {
|
|
258
|
+
headers = __assign(__assign({}, headers), {
|
|
259
|
+
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
|
|
260
|
+
'X-Requested-With': 'XMLHttpRequest'
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
|
|
254
264
|
if (_method === 'GET') {
|
|
255
265
|
if ((_a = window.magicDesign) === null || _a === void 0 ? void 0 : _a.fetch) {
|
|
256
266
|
window.magicDesign.fetch(url, {
|
|
@@ -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.storeId === Number(dragNodeId);
|
|
60
|
+
});
|
|
61
|
+
var hoverIndex = list.findIndex(function (comp) {
|
|
62
|
+
return comp.storeId === 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.storeId,
|
|
99
|
+
draggable: "true",
|
|
100
|
+
onDragEnd: onDragEnd,
|
|
101
|
+
onDragEnter: onDragEnter,
|
|
102
|
+
onDragOver: function onDragOver(e) {
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
},
|
|
105
|
+
onDragStart: onDragStart,
|
|
106
|
+
src: item.storeLogoUrl,
|
|
107
|
+
title: item.storeName
|
|
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
|
+
}
|