awing-library 2.1.24-beta → 2.1.25-beta

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.
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -63,24 +52,21 @@ var react_i18next_1 = require("react-i18next");
63
52
  function MenuDirectory() {
64
53
  var _this = this;
65
54
  var _a = (0, react_1.useContext)(Context_1.default), service = _a.service, i18next = _a.i18next;
66
- var t = (0, react_i18next_1.useTranslation)(undefined, { i18n: i18next }).t;
55
+ var _b = (0, react_i18next_1.useTranslation)(undefined, { i18n: i18next }), t = _b.t, i18n = _b.i18n;
67
56
  var navigate = (0, react_router_dom_1.useNavigate)();
68
- var _b = (0, react_1.useState)(), data = _b[0], setData = _b[1];
57
+ var _c = (0, react_1.useState)(), data = _c[0], setData = _c[1];
69
58
  (0, react_1.useEffect)(function () {
70
59
  // Call API to get data
71
60
  handleFetchData();
72
61
  }, []);
73
62
  var handleConvertedData = function () { return __awaiter(_this, void 0, void 0, function () {
74
- var res, temp, convertedData;
63
+ var res, convertedData;
75
64
  return __generator(this, function (_a) {
76
65
  switch (_a.label) {
77
66
  case 0: return [4 /*yield*/, service.menusGetAll()];
78
67
  case 1:
79
68
  res = _a.sent();
80
- temp = res.map(function (item) {
81
- return __assign(__assign({}, item), { name: t("Menu.MenuName.Menu_".concat(item.menuId)) });
82
- });
83
- convertedData = (0, function_1.convertMenuData)(temp);
69
+ convertedData = (0, function_1.convertMenuData)(res);
84
70
  return [2 /*return*/, convertedData[0]];
85
71
  }
86
72
  });
@@ -99,14 +85,14 @@ function MenuDirectory() {
99
85
  }); };
100
86
  var handleGetMoreData = function (nodeId) { return __awaiter(_this, void 0, void 0, function () {
101
87
  return __generator(this, function (_a) {
102
- console.log(nodeId);
103
88
  return [2 /*return*/];
104
89
  });
105
90
  }); };
106
- if (!data) {
91
+ var translateData = (0, function_1.translateMenu)(data, i18n, t);
92
+ if (!translateData) {
107
93
  return (0, jsx_runtime_1.jsx)(AWING_1.CircularProgress, {});
108
94
  }
109
- return ((0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, spacing: 2, children: (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 6, children: (0, jsx_runtime_1.jsx)(material_1.Paper, { style: { padding: '8px' }, children: (0, jsx_runtime_1.jsx)(AWING_1.HierarchyTree, { data: data, hideSelectCheckbox: true, onGetMoreData: handleGetMoreData, actionComponentProps: {
95
+ return ((0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, spacing: 2, children: (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 6, children: (0, jsx_runtime_1.jsx)(material_1.Paper, { style: { padding: '8px' }, children: (0, jsx_runtime_1.jsx)(AWING_1.HierarchyTree, { data: translateData, hideSelectCheckbox: true, onGetMoreData: handleGetMoreData, actionComponentProps: {
110
96
  actions: [
111
97
  {
112
98
  icon: ((0, jsx_runtime_1.jsx)(icons_material_1.Settings, { fontSize: "small", color: "action" })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.24-beta",
3
+ "version": "2.1.25-beta",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",