@3sc/common-component 0.0.1 → 0.0.3
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/dist/App.js +7 -5
- package/dist/components/alert/alert-body.js +122 -0
- package/dist/components/alert/details-body.js +126 -0
- package/dist/components/alert/index.js +173 -24
- package/dist/components/alert/style.scss +146 -2
- package/dist/components/alert/table-detail.js +37 -0
- package/dist/components/bell.js +4 -3
- package/dist/components/input-field/index.js +67 -0
- package/dist/components/my-dialog.js +64 -25
- package/dist/components/my-pagination/index.js +50 -0
- package/dist/components/my-pagination/logs.js +24 -0
- package/dist/components/notification-card/card.js +100 -0
- package/dist/components/notification-card/index.js +36 -0
- package/dist/components/select-field/index.js +55 -0
- package/dist/components/sort-icon/index.js +26 -0
- package/dist/config/mui-provider.js +2 -1
- package/dist/config/my-context.js +18 -8
- package/dist/config/theme.js +4 -0
- package/dist/helper/common-fun.js +83 -5
- package/dist/modules/notification.js +2 -1
- package/dist/sass/_colors.scss +6 -1
- package/dist/sass/_typography.scss +1 -1
- package/dist/services/notification.js +19 -2
- package/dist/utils/ActionType.js +13 -0
- package/dist/utils/Constant.js +25 -3
- package/dist/utils/ErrorMsg.js +14 -0
- package/dist/utils/LocalStorage.js +6 -1
- package/package.json +60 -60
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _material = require("@mui/material");
|
|
9
|
+
var _styles = require("@mui/material/styles");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
const BootstrapInput = (0, _styles.styled)(_material.InputBase)(_ref => {
|
|
12
|
+
let {
|
|
13
|
+
theme
|
|
14
|
+
} = _ref;
|
|
15
|
+
return {
|
|
16
|
+
"& .MuiInputBase-input": {
|
|
17
|
+
color: theme.palette.input.border,
|
|
18
|
+
borderRadius: 4,
|
|
19
|
+
position: "relative",
|
|
20
|
+
backgroundColor: theme.palette.background.paper,
|
|
21
|
+
border: "1px solid ".concat(theme.palette.input.border),
|
|
22
|
+
fontSize: ".9rem",
|
|
23
|
+
fontWeight: 500,
|
|
24
|
+
fontFamily: "Montserrat, sans-serif",
|
|
25
|
+
padding: "11px 26px 10px 12px",
|
|
26
|
+
transition: theme.transitions.create(["border-color", "box-shadow"])
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
const SelectField = _ref2 => {
|
|
31
|
+
let {
|
|
32
|
+
option,
|
|
33
|
+
value,
|
|
34
|
+
handleSelectChange
|
|
35
|
+
} = _ref2;
|
|
36
|
+
return /*#__PURE__*/_react.default.createElement(_material.FormControl, {
|
|
37
|
+
sx: {
|
|
38
|
+
width: 120
|
|
39
|
+
}
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Select, {
|
|
41
|
+
onChange: handleSelectChange,
|
|
42
|
+
value: value,
|
|
43
|
+
size: "small",
|
|
44
|
+
input: /*#__PURE__*/_react.default.createElement(BootstrapInput, null),
|
|
45
|
+
sx: {
|
|
46
|
+
"& .MuiSelected": {
|
|
47
|
+
color: "primary.main"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}, option.map((item, index) => /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
|
|
51
|
+
key: index,
|
|
52
|
+
value: item.value
|
|
53
|
+
}, item.label))));
|
|
54
|
+
};
|
|
55
|
+
var _default = exports.default = SelectField;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const SortIcon = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
sortKey,
|
|
12
|
+
sortDir,
|
|
13
|
+
column
|
|
14
|
+
} = _ref;
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, sortKey === column ? !sortDir ? /*#__PURE__*/_react.default.createElement("i", {
|
|
16
|
+
className: "fa fa-arrow-up",
|
|
17
|
+
"aria-hidden": "true"
|
|
18
|
+
}) : /*#__PURE__*/_react.default.createElement("i", {
|
|
19
|
+
className: "fa fa-arrow-down",
|
|
20
|
+
"aria-hidden": "true"
|
|
21
|
+
}) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("i", {
|
|
22
|
+
className: "fa fa-sort",
|
|
23
|
+
"aria-hidden": "true"
|
|
24
|
+
})));
|
|
25
|
+
};
|
|
26
|
+
var _default = exports.default = SortIcon;
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
8
|
var _material = require("@mui/material");
|
|
8
9
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
9
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -11,7 +12,7 @@ function MuiProvider(_ref) {
|
|
|
11
12
|
let {
|
|
12
13
|
children
|
|
13
14
|
} = _ref;
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_material.ThemeProvider, {
|
|
15
16
|
theme: _theme.default
|
|
16
17
|
}, children);
|
|
17
18
|
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.symbol.description.js");
|
|
4
|
+
require("core-js/modules/es.weak-map.js");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = exports.TasksDispatchContext = exports.TasksContext = void 0;
|
|
8
9
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
9
|
-
var _react = require("react");
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _ActionType = _interopRequireDefault(require("../utils/ActionType"));
|
|
12
|
+
var _ErrorMsg = _interopRequireDefault(require("../utils/ErrorMsg"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
18
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -19,36 +25,40 @@ function MyContext(_ref) {
|
|
|
19
25
|
children
|
|
20
26
|
} = _ref;
|
|
21
27
|
const [tasks, dispatch] = (0, _react.useReducer)(tasksReducer, initialTasks);
|
|
22
|
-
return /*#__PURE__*/
|
|
28
|
+
return /*#__PURE__*/_react.default.createElement(TasksContext.Provider, {
|
|
23
29
|
value: tasks
|
|
24
|
-
}, /*#__PURE__*/
|
|
30
|
+
}, /*#__PURE__*/_react.default.createElement(TasksDispatchContext.Provider, {
|
|
25
31
|
value: dispatch
|
|
26
32
|
}, children));
|
|
27
33
|
}
|
|
28
34
|
var _default = exports.default = MyContext;
|
|
29
35
|
function tasksReducer(tasks, action) {
|
|
30
36
|
switch (action.type) {
|
|
31
|
-
case
|
|
37
|
+
case _ActionType.default.LOADING:
|
|
32
38
|
return _objectSpread(_objectSpread({}, tasks), {}, {
|
|
33
39
|
loading: action.loading
|
|
34
40
|
});
|
|
35
|
-
case
|
|
41
|
+
case _ActionType.default.SUCCESS:
|
|
36
42
|
{
|
|
37
43
|
return _objectSpread(_objectSpread({}, tasks), {}, {
|
|
38
44
|
data: action.data
|
|
39
45
|
});
|
|
40
46
|
}
|
|
41
|
-
case
|
|
47
|
+
case _ActionType.default.MARK_ALL_AS_READ:
|
|
48
|
+
return _objectSpread(_objectSpread({}, tasks), {}, {
|
|
49
|
+
isMarkAllAsRead: action.isMarkAllAsRead
|
|
50
|
+
});
|
|
51
|
+
case _ActionType.default.ERROR:
|
|
42
52
|
return _objectSpread(_objectSpread({}, tasks), {}, {
|
|
43
53
|
error: action.error
|
|
44
54
|
});
|
|
45
55
|
default:
|
|
46
|
-
throw new Error("
|
|
56
|
+
throw new Error("".concat(_ErrorMsg.default.UNHANDLED, ": ").concat(action));
|
|
47
57
|
}
|
|
48
58
|
}
|
|
49
59
|
const initialTasks = {
|
|
50
60
|
loading: false,
|
|
51
61
|
data: [],
|
|
52
62
|
error: "",
|
|
53
|
-
isMarkAllAsRead:
|
|
63
|
+
isMarkAllAsRead: false
|
|
54
64
|
};
|
package/dist/config/theme.js
CHANGED
|
@@ -3,10 +3,88 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getLocalStorage = void 0;
|
|
6
|
+
exports.sortByKeyArr = exports.searchByKeyArr = exports.getLocalStorage = exports.fullFormatDate = exports.filterAlertData = exports.detectMarkAllAsRead = exports.dataSlice = exports.createPayloadMarkAllAsRead = void 0;
|
|
7
|
+
require("core-js/modules/es.array.sort.js");
|
|
8
|
+
require("core-js/modules/es.array.includes.js");
|
|
9
|
+
require("core-js/modules/es.string.includes.js");
|
|
10
|
+
require("core-js/modules/es.string.trim.js");
|
|
7
11
|
const getLocalStorage = key => {
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
|
|
12
|
+
const value = localStorage.getItem(key);
|
|
13
|
+
if (value) {
|
|
14
|
+
return JSON.parse(value);
|
|
15
|
+
}
|
|
16
|
+
return "";
|
|
11
17
|
};
|
|
12
|
-
exports.getLocalStorage = getLocalStorage;
|
|
18
|
+
exports.getLocalStorage = getLocalStorage;
|
|
19
|
+
const fullFormatDate = date => {
|
|
20
|
+
const currentDate = new Date(date);
|
|
21
|
+
const options = {
|
|
22
|
+
year: "numeric",
|
|
23
|
+
month: "long",
|
|
24
|
+
day: "2-digit",
|
|
25
|
+
hour: "2-digit",
|
|
26
|
+
minute: "2-digit",
|
|
27
|
+
second: "2-digit",
|
|
28
|
+
hour12: true
|
|
29
|
+
};
|
|
30
|
+
const formattedDate = currentDate.toLocaleString("en-US", options);
|
|
31
|
+
return formattedDate;
|
|
32
|
+
};
|
|
33
|
+
exports.fullFormatDate = fullFormatDate;
|
|
34
|
+
const filterAlertData = data => {
|
|
35
|
+
const newData = data.sort((a, b) => {
|
|
36
|
+
if (a.isRead === b.isRead) {
|
|
37
|
+
return 0;
|
|
38
|
+
} else if (b.isRead) {
|
|
39
|
+
return -1;
|
|
40
|
+
} else {
|
|
41
|
+
return 1;
|
|
42
|
+
}
|
|
43
|
+
}).slice(0, 9);
|
|
44
|
+
return newData;
|
|
45
|
+
};
|
|
46
|
+
exports.filterAlertData = filterAlertData;
|
|
47
|
+
const detectMarkAllAsRead = data => {
|
|
48
|
+
let count = 0;
|
|
49
|
+
for (let i = 0; i < data.length; i++) {
|
|
50
|
+
if (!data[i].isRead) count++;
|
|
51
|
+
;
|
|
52
|
+
}
|
|
53
|
+
return count;
|
|
54
|
+
};
|
|
55
|
+
exports.detectMarkAllAsRead = detectMarkAllAsRead;
|
|
56
|
+
const createPayloadMarkAllAsRead = data => {
|
|
57
|
+
const payload = [];
|
|
58
|
+
data.forEach(item => {
|
|
59
|
+
if (!item.isRead) {
|
|
60
|
+
payload.push(item.id);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
return payload;
|
|
64
|
+
};
|
|
65
|
+
exports.createPayloadMarkAllAsRead = createPayloadMarkAllAsRead;
|
|
66
|
+
const searchByKeyArr = (data, keyArr, value) => {
|
|
67
|
+
const newData = data.filter(item => {
|
|
68
|
+
return keyArr.some(key => {
|
|
69
|
+
return item[key].toLowerCase().includes(value.trim().toLowerCase());
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
return newData;
|
|
73
|
+
};
|
|
74
|
+
exports.searchByKeyArr = searchByKeyArr;
|
|
75
|
+
const sortByKeyArr = (data, key, order) => {
|
|
76
|
+
const newData = data.sort((a, b) => {
|
|
77
|
+
if (order === "asc") {
|
|
78
|
+
return a[key].toLowerCase().localeCompare(b[key].toLowerCase());
|
|
79
|
+
} else {
|
|
80
|
+
return b[key].toLowerCase().localeCompare(a[key].toLowerCase());
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
return newData;
|
|
84
|
+
};
|
|
85
|
+
exports.sortByKeyArr = sortByKeyArr;
|
|
86
|
+
const dataSlice = (data, page, rowPerPage) => {
|
|
87
|
+
const newData = data.slice((page - 1) * rowPerPage, page * rowPerPage);
|
|
88
|
+
return newData;
|
|
89
|
+
};
|
|
90
|
+
exports.dataSlice = dataSlice;
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Notification = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
8
|
var _alert = _interopRequireDefault(require("../components/alert"));
|
|
8
9
|
var _muiProvider = _interopRequireDefault(require("../config/mui-provider"));
|
|
9
10
|
var _myContext = _interopRequireDefault(require("../config/my-context"));
|
|
@@ -14,7 +15,7 @@ const Notification = _ref => {
|
|
|
14
15
|
buId,
|
|
15
16
|
snopId
|
|
16
17
|
} = _ref;
|
|
17
|
-
return /*#__PURE__*/
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_muiProvider.default, null, /*#__PURE__*/_react.default.createElement(_myContext.default, null, /*#__PURE__*/_react.default.createElement(_alert.default, {
|
|
18
19
|
tenantId: tenantId,
|
|
19
20
|
buId: buId,
|
|
20
21
|
snopId: snopId
|
package/dist/sass/_colors.scss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
$fontFamily:
|
|
1
|
+
$fontFamily: Montserrat, sans-serif;
|
|
@@ -3,18 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getNotification = void 0;
|
|
6
|
+
exports.putNotification = exports.getNotification = void 0;
|
|
7
7
|
require("core-js/modules/es.promise.js");
|
|
8
8
|
var _axios = _interopRequireDefault(require("../config/axios"));
|
|
9
9
|
var _Constant = require("../utils/Constant");
|
|
10
10
|
var _EndPoint = _interopRequireDefault(require("../utils/EndPoint"));
|
|
11
11
|
var _Env = _interopRequireDefault(require("../utils/Env"));
|
|
12
|
+
var _LocalStorage = _interopRequireDefault(require("../utils/LocalStorage"));
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
14
|
const {
|
|
14
15
|
TENANT_ID,
|
|
15
16
|
BU_ID,
|
|
16
17
|
SNOP_ID
|
|
17
18
|
} = _Constant.OTHER_CONSTANT;
|
|
19
|
+
const {
|
|
20
|
+
TENANT_IDS,
|
|
21
|
+
BU_IDS,
|
|
22
|
+
SNOP_IDS
|
|
23
|
+
} = _LocalStorage.default;
|
|
18
24
|
const getNotification = async _ref => {
|
|
19
25
|
let {
|
|
20
26
|
tenantId,
|
|
@@ -30,4 +36,15 @@ const getNotification = async _ref => {
|
|
|
30
36
|
return e;
|
|
31
37
|
}
|
|
32
38
|
};
|
|
33
|
-
exports.getNotification = getNotification;
|
|
39
|
+
exports.getNotification = getNotification;
|
|
40
|
+
const putNotification = async payload => {
|
|
41
|
+
try {
|
|
42
|
+
const url = "".concat(_EndPoint.default.NOTIFICATION).concat(_Env.default.VERSION, "?").concat(TENANT_ID, "=").concat(TENANT_IDS, "&").concat(BU_ID, "=").concat(BU_IDS, "&").concat(SNOP_ID, "=").concat(SNOP_IDS);
|
|
43
|
+
const response = await _axios.default.put(url, payload);
|
|
44
|
+
return response;
|
|
45
|
+
} catch (e) {
|
|
46
|
+
// do something
|
|
47
|
+
return e;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.putNotification = putNotification;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
const ACTION_TYPE = {
|
|
8
|
+
LOADING: "LOADING",
|
|
9
|
+
SUCCESS: "SUCCESS",
|
|
10
|
+
ERROR: "ERROR",
|
|
11
|
+
MARK_ALL_AS_READ: "MARK_ALL_AS_READ"
|
|
12
|
+
};
|
|
13
|
+
var _default = exports.default = ACTION_TYPE;
|
package/dist/utils/Constant.js
CHANGED
|
@@ -3,13 +3,35 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.OTHER_CONSTANT = exports.LOCAL_STORAGE_KEY = void 0;
|
|
6
|
+
exports.optionRow = exports.detailsSearchKey = exports.detailsHeadObj = exports.OTHER_CONSTANT = exports.LOCAL_STORAGE_KEY = exports.HEADER_ICON_TYPE = void 0;
|
|
7
7
|
const LOCAL_STORAGE_KEY = exports.LOCAL_STORAGE_KEY = {
|
|
8
|
-
TOKEN: "token"
|
|
8
|
+
TOKEN: "token",
|
|
9
|
+
USER: "user",
|
|
10
|
+
SNOP: "snop"
|
|
9
11
|
};
|
|
10
12
|
const OTHER_CONSTANT = exports.OTHER_CONSTANT = {
|
|
11
13
|
BEARER: "Bearer",
|
|
12
14
|
TENANT_ID: "tenant_id",
|
|
13
15
|
BU_ID: "bu_id",
|
|
14
16
|
SNOP_ID: "snop_id"
|
|
15
|
-
};
|
|
17
|
+
};
|
|
18
|
+
const HEADER_ICON_TYPE = exports.HEADER_ICON_TYPE = {
|
|
19
|
+
REFRESH: "refresh",
|
|
20
|
+
CLOSE: "close"
|
|
21
|
+
};
|
|
22
|
+
const optionRow = exports.optionRow = [{
|
|
23
|
+
label: "Show 10 Rows",
|
|
24
|
+
value: 10
|
|
25
|
+
}, {
|
|
26
|
+
label: "Show 20 Rows",
|
|
27
|
+
value: 20
|
|
28
|
+
}, {
|
|
29
|
+
label: "Show 30 Rows",
|
|
30
|
+
value: 30
|
|
31
|
+
}];
|
|
32
|
+
const detailsHeadObj = exports.detailsHeadObj = {
|
|
33
|
+
"SKU Name": "sku_name",
|
|
34
|
+
Node: "node",
|
|
35
|
+
"Channel Name": "channel_name"
|
|
36
|
+
};
|
|
37
|
+
const detailsSearchKey = exports.detailsSearchKey = Object.values(detailsHeadObj);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
const ERROR_MSG = {
|
|
8
|
+
SWR: "Something went wrong!",
|
|
9
|
+
UNHANDLED: "Unhandled action type: ",
|
|
10
|
+
INVALID: "Invalid action type: ",
|
|
11
|
+
INVALID_ACTION: "Invalid action type: ",
|
|
12
|
+
NRF: "Not record found!"
|
|
13
|
+
};
|
|
14
|
+
var _default = exports.default = ERROR_MSG;
|
|
@@ -6,7 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _commonFun = require("../helper/common-fun");
|
|
8
8
|
var _Constant = require("./Constant");
|
|
9
|
+
const user = (0, _commonFun.getLocalStorage)(_Constant.LOCAL_STORAGE_KEY.USER);
|
|
10
|
+
const snop = (0, _commonFun.getLocalStorage)(_Constant.LOCAL_STORAGE_KEY.SNOP);
|
|
9
11
|
const LOCAL_STORAGE = {
|
|
10
|
-
TOKEN: (0, _commonFun.getLocalStorage)(_Constant.LOCAL_STORAGE_KEY.TOKEN)
|
|
12
|
+
TOKEN: (0, _commonFun.getLocalStorage)(_Constant.LOCAL_STORAGE_KEY.TOKEN),
|
|
13
|
+
BU_IDS: user === null || user === void 0 ? void 0 : user.business_unit_id,
|
|
14
|
+
TENANT_IDS: user === null || user === void 0 ? void 0 : user.tenant_id,
|
|
15
|
+
SNOP_IDS: snop === null || snop === void 0 ? void 0 : snop.snop_id
|
|
11
16
|
};
|
|
12
17
|
var _default = exports.default = LOCAL_STORAGE;
|
package/package.json
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@3sc/common-component",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"keywords": [
|
|
5
|
-
"react",
|
|
6
|
-
"components",
|
|
7
|
-
"ui"
|
|
8
|
-
],
|
|
9
|
-
"main": "dist/modules",
|
|
10
|
-
"module": "dist/modules",
|
|
11
|
-
"files": [
|
|
12
|
-
"dist",
|
|
13
|
-
"README.md"
|
|
14
|
-
],
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@emotion/react": "^11.11.3",
|
|
17
|
-
"@emotion/styled": "^11.11.0",
|
|
18
|
-
"@mui/icons-material": "^5.14.5",
|
|
19
|
-
"@mui/material": "^5.15.5",
|
|
20
|
-
"@testing-library/jest-dom": "^5.17.0",
|
|
21
|
-
"@testing-library/react": "^13.4.0",
|
|
22
|
-
"@testing-library/user-event": "^13.5.0",
|
|
23
|
-
"axios": "^1.6.5",
|
|
24
|
-
"react": "^18.2.0",
|
|
25
|
-
"react-dom": "^18.2.0",
|
|
26
|
-
"react-scripts": "5.0.1",
|
|
27
|
-
"sass": "^1.69.7",
|
|
28
|
-
"web-vitals": "^2.1.4"
|
|
29
|
-
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"start": "react-scripts start",
|
|
32
|
-
"build": "babel src --out-dir dist --copy-files",
|
|
33
|
-
"test": "react-scripts test",
|
|
34
|
-
"eject": "react-scripts eject"
|
|
35
|
-
},
|
|
36
|
-
"eslintConfig": {
|
|
37
|
-
"extends": [
|
|
38
|
-
"react-app",
|
|
39
|
-
"react-app/jest"
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
|
-
"browserslist": {
|
|
43
|
-
"production": [
|
|
44
|
-
">0.2%",
|
|
45
|
-
"not dead",
|
|
46
|
-
"not op_mini all"
|
|
47
|
-
],
|
|
48
|
-
"development": [
|
|
49
|
-
"last 1 chrome version",
|
|
50
|
-
"last 1 firefox version",
|
|
51
|
-
"last 1 safari version"
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
|
-
"devDependencies": {
|
|
55
|
-
"@babel/cli": "^7.23.4",
|
|
56
|
-
"@babel/core": "^7.23.7",
|
|
57
|
-
"@babel/preset-env": "^7.23.8",
|
|
58
|
-
"babel-plugin-inline-dotenv": "^1.7.0"
|
|
59
|
-
}
|
|
60
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@3sc/common-component",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"react",
|
|
6
|
+
"components",
|
|
7
|
+
"ui"
|
|
8
|
+
],
|
|
9
|
+
"main": "dist/modules",
|
|
10
|
+
"module": "dist/modules",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@emotion/react": "^11.11.3",
|
|
17
|
+
"@emotion/styled": "^11.11.0",
|
|
18
|
+
"@mui/icons-material": "^5.14.5",
|
|
19
|
+
"@mui/material": "^5.15.5",
|
|
20
|
+
"@testing-library/jest-dom": "^5.17.0",
|
|
21
|
+
"@testing-library/react": "^13.4.0",
|
|
22
|
+
"@testing-library/user-event": "^13.5.0",
|
|
23
|
+
"axios": "^1.6.5",
|
|
24
|
+
"react": "^18.2.0",
|
|
25
|
+
"react-dom": "^18.2.0",
|
|
26
|
+
"react-scripts": "5.0.1",
|
|
27
|
+
"sass": "^1.69.7",
|
|
28
|
+
"web-vitals": "^2.1.4"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"start": "react-scripts start",
|
|
32
|
+
"build": "babel src --out-dir dist --copy-files",
|
|
33
|
+
"test": "react-scripts test",
|
|
34
|
+
"eject": "react-scripts eject"
|
|
35
|
+
},
|
|
36
|
+
"eslintConfig": {
|
|
37
|
+
"extends": [
|
|
38
|
+
"react-app",
|
|
39
|
+
"react-app/jest"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"browserslist": {
|
|
43
|
+
"production": [
|
|
44
|
+
">0.2%",
|
|
45
|
+
"not dead",
|
|
46
|
+
"not op_mini all"
|
|
47
|
+
],
|
|
48
|
+
"development": [
|
|
49
|
+
"last 1 chrome version",
|
|
50
|
+
"last 1 firefox version",
|
|
51
|
+
"last 1 safari version"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@babel/cli": "^7.23.4",
|
|
56
|
+
"@babel/core": "^7.23.7",
|
|
57
|
+
"@babel/preset-env": "^7.23.8",
|
|
58
|
+
"babel-plugin-inline-dotenv": "^1.7.0"
|
|
59
|
+
}
|
|
60
|
+
}
|