infinity-forge 2.4.0 → 2.4.1

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 (156) hide show
  1. package/dist/sites/components/default-pages/blog/components/blog-item/share/index.js +2 -2
  2. package/dist/sites/components/default-pages/blog/components/featured-blog/featured-blog-item/index.d.ts +1 -1
  3. package/dist/sites/components/default-pages/blog/components/featured-blog/featured-blog-item/index.js +2 -2
  4. package/dist/system/presentation/components/data/menu/components/menu-item/index.js +3 -3
  5. package/dist/system/presentation/components/data/menu/modes/collapsed-menu/index.js +5 -5
  6. package/dist/system/presentation/components/data/menu/modes/collapsed-menu/styles.js +1 -1
  7. package/dist/system/presentation/components/data/menu/modes/opened/index.js +3 -3
  8. package/dist/system/presentation/components/data/menu/modes/opened/styles.js +1 -1
  9. package/dist/system/presentation/components/data/tab/tab-item/index.d.ts +5 -0
  10. package/dist/system/presentation/components/data/tab/tab-item/index.js +46 -0
  11. package/dist/system/presentation/components/data/tab/tab-item/styles.d.ts +8 -0
  12. package/dist/system/presentation/components/layout/header/components/index.d.ts +2 -0
  13. package/dist/system/presentation/components/layout/header/components/index.js +19 -0
  14. package/dist/system/presentation/components/layout/header/components/menu-right/index.d.ts +1 -1
  15. package/dist/system/presentation/components/layout/header/components/menu-right/index.js +4 -4
  16. package/dist/system/presentation/components/layout/header/components/menu-right/messages/index.js +0 -36
  17. package/dist/system/presentation/components/layout/header/components/menu-right/profile/index.js +0 -38
  18. package/dist/system/presentation/components/layout/header/components/menu-right/settings/index.js +0 -42
  19. package/dist/system/presentation/components/layout/header/components/search-modal/index.js +4 -4
  20. package/dist/system/presentation/components/layout/header/version-01/index.d.ts +2 -0
  21. package/dist/system/presentation/components/layout/header/version-01/index.js +45 -0
  22. package/dist/system/presentation/components/pages/menus/table/columns.d.ts +3 -0
  23. package/dist/system/presentation/components/pages/menus/table/columns.js +21 -0
  24. package/dist/system/presentation/components/pages/menus/table/create.d.ts +3 -0
  25. package/dist/system/presentation/components/pages/menus/table/create.js +72 -0
  26. package/dist/system/presentation/components/pages/menus/table/delete.js +71 -0
  27. package/dist/system/presentation/components/pages/menus/table/edit.d.ts +3 -0
  28. package/dist/system/presentation/components/pages/menus/table/edit.js +78 -0
  29. package/dist/system/presentation/components/pages/menus/table/icon/index.js +1 -1
  30. package/dist/system/presentation/components/pages/menus/table/index.d.ts +4 -0
  31. package/dist/system/presentation/components/pages/menus/table/index.js +21 -0
  32. package/dist/system/presentation/components/pages/users/table/columns.d.ts +3 -0
  33. package/dist/system/presentation/components/pages/users/table/create.d.ts +3 -0
  34. package/dist/system/presentation/components/pages/users/table/create.js +75 -0
  35. package/dist/system/presentation/components/pages/users/table/delete.js +74 -0
  36. package/dist/system/presentation/components/pages/users/table/edit.d.ts +3 -0
  37. package/dist/system/presentation/components/pages/users/table/edit.js +83 -0
  38. package/dist/system/presentation/components/pages/users/table/index.d.ts +4 -0
  39. package/dist/system/presentation/components/pages/users/table/index.js +21 -0
  40. package/dist/system/presentation/context/auth/components/login/form-login/index.js +2 -2
  41. package/dist/system/presentation/context/auth/components/login/index.js +38 -0
  42. package/dist/system/presentation/context/auth/components/private-page/index.d.ts +2 -0
  43. package/dist/system/presentation/context/auth/components/private-page/index.js +141 -0
  44. package/dist/system/presentation/hooks/ui/use-table/components/index.d.ts +1 -0
  45. package/dist/system/presentation/hooks/ui/use-table/components/index.js +18 -0
  46. package/dist/system/presentation/hooks/ui/use-table/components/table/index.d.ts +1 -1
  47. package/dist/system/presentation/hooks/ui/use-table/components/table/index.js +10 -10
  48. package/dist/system/presentation/hooks/ui/use-table/components/table/interfaces.d.ts +2 -2
  49. package/dist/system/presentation/hooks/ui/use-table/query/get-query-arguments-table.d.ts +2 -0
  50. package/dist/system/presentation/hooks/ui/use-table/query/hook.d.ts +5 -0
  51. package/dist/system/presentation/hooks/ui/use-table/query/hook.js +52 -0
  52. package/dist/system/presentation/hooks/ui/use-table/query/index.d.ts +2 -0
  53. package/dist/system/presentation/hooks/ui/use-table/query/index.js +19 -0
  54. package/dist/ui/components/carousel/carousel-lib/core/breakpoints/getBreakpoint.js +35 -0
  55. package/dist/ui/components/carousel/carousel-lib/core/breakpoints/index.d.ts +7 -0
  56. package/dist/ui/components/carousel/carousel-lib/core/breakpoints/index.js +9 -0
  57. package/dist/ui/components/carousel/carousel-lib/core/breakpoints/setBreakpoint.js +94 -0
  58. package/dist/ui/components/carousel/carousel-lib/core/classes/index.d.ts +7 -0
  59. package/dist/ui/components/carousel/carousel-lib/core/classes/index.js +9 -0
  60. package/dist/ui/components/carousel/carousel-lib/core/events/index.js +77 -0
  61. package/dist/ui/components/carousel/carousel-lib/core/events/onLoad.js +14 -0
  62. package/dist/ui/components/carousel/carousel-lib/core/events/onTouchEnd.js +194 -0
  63. package/dist/ui/components/carousel/carousel-lib/core/events/onTouchMove.js +314 -0
  64. package/dist/ui/components/carousel/carousel-lib/core/events/onTouchStart.js +154 -0
  65. package/dist/ui/components/carousel/carousel-lib/core/grab-cursor/index.d.ts +7 -0
  66. package/dist/ui/components/carousel/carousel-lib/core/grab-cursor/index.js +12 -0
  67. package/dist/ui/components/carousel/carousel-lib/core/loop/index.d.ts +9 -0
  68. package/dist/ui/components/carousel/carousel-lib/core/loop/index.js +14 -0
  69. package/dist/ui/components/carousel/carousel-lib/core/loop/loopCreate.js +57 -0
  70. package/dist/ui/components/carousel/carousel-lib/core/loop/loopFix.js +230 -0
  71. package/dist/ui/components/carousel/carousel-lib/core/modules/observer/observer.js +2 -2
  72. package/dist/ui/components/carousel/carousel-lib/core/modules/resize/resize.js +1 -1
  73. package/dist/ui/components/carousel/carousel-lib/core/slide/index.d.ts +17 -0
  74. package/dist/ui/components/carousel/carousel-lib/core/slide/index.js +22 -0
  75. package/dist/ui/components/carousel/carousel-lib/core/slide/slideTo.js +160 -0
  76. package/dist/ui/components/carousel/carousel-lib/core/slide/slideToClickedSlide.js +46 -0
  77. package/dist/ui/components/carousel/carousel-lib/core/transition/index.d.ts +9 -0
  78. package/dist/ui/components/carousel/carousel-lib/core/transition/index.js +14 -0
  79. package/dist/ui/components/carousel/carousel-lib/core/transition/transitionEnd.js +18 -0
  80. package/dist/ui/components/carousel/carousel-lib/core/transition/transitionStart.js +19 -0
  81. package/dist/ui/components/carousel/carousel-lib/core/translate/getTranslate.js +21 -0
  82. package/dist/ui/components/carousel/carousel-lib/core/translate/index.d.ts +13 -0
  83. package/dist/ui/components/carousel/carousel-lib/core/translate/index.js +18 -0
  84. package/dist/ui/components/carousel/carousel-lib/core/translate/translateTo.js +81 -0
  85. package/dist/ui/components/carousel/carousel-lib/core/update/index.d.ts +21 -0
  86. package/dist/ui/components/carousel/carousel-lib/core/update/index.js +26 -0
  87. package/dist/ui/components/carousel/carousel-lib/core/update/updateActiveIndex.js +125 -0
  88. package/dist/ui/components/carousel/carousel-lib/core/update/updateSize.js +45 -0
  89. package/dist/ui/components/carousel/carousel-lib/core/update/updateSlides.js +306 -0
  90. package/dist/ui/components/carousel/carousel-lib/core/update/updateSlidesClasses.js +69 -0
  91. package/dist/ui/components/form/handler/i18n/capture-i18n-errors/index.d.ts +1 -1
  92. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/hook.d.ts +1 -1
  93. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/hook.js +1 -1
  94. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/index.d.ts +3 -3
  95. package/dist/ui/components/form/input-cep/use-cep/providers/ibge/index.js +3 -3
  96. package/dist/ui/components/form/input-cep/use-cep/providers/index.d.ts +1 -1
  97. package/dist/ui/components/form/input-cep/use-cep/providers/index.js +1 -1
  98. package/dist/ui/components/form/input-currency/components/utils/cleanValue.d.ts +1 -1
  99. package/dist/ui/components/form/input-currency/components/utils/cleanValue.js +4 -4
  100. package/dist/ui/components/form/input-currency/components/utils/formatValue.d.ts +1 -1
  101. package/dist/ui/components/form/input-currency/components/utils/formatValue.js +2 -2
  102. package/dist/ui/components/form/input-currency/components/utils/getLocaleConfig.d.ts +1 -1
  103. package/dist/ui/components/form/input-currency/components/utils/getSuffix.js +1 -1
  104. package/dist/ui/components/form/input-currency/components/utils/index.d.ts +8 -8
  105. package/dist/ui/components/form/input-currency/components/utils/index.js +8 -8
  106. package/dist/ui/components/form/input-currency/components/utils/parseAbbrValue.js +1 -1
  107. package/dist/ui/components/form/input-currency/components/utils/removeInvalidChars.js +1 -1
  108. package/dist/ui/components/form/input-currency/components/utils/removeSeparators.js +1 -1
  109. package/dist/ui/components/form/input-date-picker/calendar/calendar-header/index.d.ts +1 -1
  110. package/dist/ui/components/form/input-date-picker/calendar/calendar-header/index.js +3 -3
  111. package/dist/ui/components/form/input-date-picker/calendar/days/index.d.ts +1 -1
  112. package/dist/ui/components/form/input-date-picker/calendar/days/index.js +2 -2
  113. package/dist/ui/components/form/input-date-picker/calendar/months/index.d.ts +1 -1
  114. package/dist/ui/components/form/input-date-picker/calendar/months/index.js +2 -2
  115. package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.d.ts +1 -1
  116. package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.js +1 -1
  117. package/dist/ui/components/form/input-file/render-files/file-item/index.d.ts +2 -2
  118. package/dist/ui/components/form/input-file/render-files/file-item/index.js +3 -3
  119. package/dist/ui/components/form/input-mask/lib/core/errors/SyntheticChangeError.d.ts +1 -1
  120. package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.d.ts +1 -1
  121. package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.js +2 -2
  122. package/dist/ui/components/form/input-mask/lib/core/index.d.ts +5 -5
  123. package/dist/ui/components/form/input-mask/lib/core/index.js +4 -4
  124. package/dist/ui/components/form/input-mask/lib/core/utils/setInputAttributes.d.ts +1 -1
  125. package/dist/ui/components/form/input-mask/lib/mask/InputMask.d.ts +2 -2
  126. package/dist/ui/components/form/input-mask/lib/mask/InputMask.js +2 -2
  127. package/dist/ui/components/form/input-mask/lib/mask/index.d.ts +5 -5
  128. package/dist/ui/components/form/input-mask/lib/mask/index.js +3 -3
  129. package/dist/ui/components/form/input-mask/lib/mask/types.d.ts +1 -1
  130. package/dist/ui/components/form/input-mask/lib/mask/useMask.d.ts +1 -1
  131. package/dist/ui/components/form/input-mask/lib/mask/useMask.js +7 -7
  132. package/dist/ui/components/form/input-mask/lib/mask/utils/filter.d.ts +1 -1
  133. package/dist/ui/components/form/input-mask/lib/mask/utils/format.d.ts +1 -1
  134. package/dist/ui/components/form/input-mask/lib/mask/utils/formatToParts.d.ts +1 -1
  135. package/dist/ui/components/form/input-mask/lib/mask/utils/formatToReplacementObject.d.ts +1 -1
  136. package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.d.ts +1 -1
  137. package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.js +3 -3
  138. package/dist/ui/components/form/input-mask/lib/mask/utils/resolveSelection.d.ts +0 -18
  139. package/dist/ui/components/form/input-mask/lib/mask/utils/unformat.d.ts +1 -1
  140. package/dist/ui/components/form/input-mask/lib/mask/utils/validate.d.ts +0 -13
  141. package/dist/ui/components/form/input-mask/lib/mask/utils.d.ts +1 -1
  142. package/dist/ui/components/form/input-mask/lib/mask/utils.js +5 -5
  143. package/dist/ui/components/form/input-mask/lib/number-format/InputNumberFormat.d.ts +2 -2
  144. package/dist/ui/components/form/input-mask/lib/number-format/InputNumberFormat.js +2 -2
  145. package/dist/ui/components/form/input-mask/lib/number-format/index.d.ts +4 -4
  146. package/dist/ui/components/form/input-mask/lib/number-format/index.js +2 -2
  147. package/dist/ui/components/form/input-mask/lib/number-format/types.d.ts +1 -1
  148. package/dist/ui/components/form/input-mask/lib/number-format/useNumberFormat.d.ts +1 -1
  149. package/dist/ui/components/form/input-mask/lib/number-format/useNumberFormat.js +6 -6
  150. package/dist/ui/components/form/input-mask/lib/number-format/utils/localizeValues.d.ts +1 -1
  151. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.d.ts +2 -2
  152. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.js +1 -1
  153. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveMinimumFractionDigits.d.ts +1 -1
  154. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveOptions.d.ts +1 -1
  155. package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveSelection.d.ts +0 -24
  156. package/package.json +1 -1
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.useEditTable = void 0;
40
+ var ui_1 = require("../../../../../../ui/index.js");
41
+ var system_1 = require("../../../../../../system/index.js");
42
+ function useEditTable(queryKey) {
43
+ var _this = this;
44
+ var createToast = (0, ui_1.useToast)().createToast;
45
+ var editTable = {
46
+ title: 'Editar Menu',
47
+ button: { text: 'Editar' },
48
+ getDetails: {
49
+ key: function (tableItem) { return 'EditMenu' + tableItem.id; },
50
+ fetcher: function (tableItem) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
51
+ switch (_a.label) {
52
+ case 0: return [4 /*yield*/, system_1.container.get(system_1.Types.RemoteMenu).getDetail({ id: tableItem.id })];
53
+ case 1: return [2 /*return*/, _a.sent()];
54
+ }
55
+ }); }); },
56
+ },
57
+ onSucess: function (data) { return __awaiter(_this, void 0, void 0, function () {
58
+ return __generator(this, function (_a) {
59
+ switch (_a.label) {
60
+ case 0: return [4 /*yield*/, system_1.container.get(system_1.Types.RemoteMenu).edit(data)];
61
+ case 1:
62
+ _a.sent();
63
+ createToast({ message: 'Editado com sucesso!', status: 'success' });
64
+ return [2 /*return*/];
65
+ }
66
+ });
67
+ }); },
68
+ inputs: [
69
+ [{ InputComponent: 'Input', type: 'text', label: 'Icone', name: 'icon' }],
70
+ [{ name: 'items', InputComponent: 'Select', isMultiple: true, label: 'Primeiro Nome', options: [] }],
71
+ [{ name: 'route', InputComponent: 'Input', type: 'text', label: 'Url' }],
72
+ [{ name: 'title', InputComponent: 'Input', type: 'text', label: 'Titulo' }],
73
+ ],
74
+ };
75
+ return editTable;
76
+ }
77
+ exports.useEditTable = useEditTable;
78
+ //# sourceMappingURL=edit.js.map
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.IconMenu = void 0;
27
27
  var jsx_runtime_1 = require("react/jsx-runtime");
28
- var S = __importStar(require("./style"));
28
+ var S = __importStar(require("./style.js"));
29
29
  function IconMenu(_a) {
30
30
  var icon = _a.icon;
31
31
  return (0, jsx_runtime_1.jsx)(S.IconMenu, { dangerouslySetInnerHTML: { __html: icon || "" } });
@@ -0,0 +1,4 @@
1
+ export * from './edit.js';
2
+ export * from './create.js';
3
+ export * from './delete.js';
4
+ export * from './columns.js';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./edit.js"), exports);
18
+ __exportStar(require("./create.js"), exports);
19
+ __exportStar(require("./delete.js"), exports);
20
+ __exportStar(require("./columns.js"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ import { User } from '../../../../../../system/domain/index.js';
2
+ import { Column } from '../../../../../../system/presentation/hooks/index.js';
3
+ export declare const columns: Column<User>[];
@@ -0,0 +1,3 @@
1
+ import { DynamicFormHandlerProps } from '../../../../../../ui/index.js';
2
+ import { User } from '../../../../../../system/index.js';
3
+ export declare function useCreateTable(queryKey: string): DynamicFormHandlerProps<User>;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.useCreateTable = void 0;
40
+ var ui_1 = require("../../../../../../ui/index.js");
41
+ var system_1 = require("../../../../../../system/index.js");
42
+ function useCreateTable(queryKey) {
43
+ var _this = this;
44
+ var createToast = (0, ui_1.useToast)().createToast;
45
+ var cache = (0, ui_1.useQueryClient)(function (state) { return state.cache; });
46
+ var createTable = {
47
+ title: 'Criar usuário',
48
+ button: { text: 'Criar' },
49
+ initialData: { isExternal: false },
50
+ onSucess: function (data) { return __awaiter(_this, void 0, void 0, function () {
51
+ var _a;
52
+ return __generator(this, function (_b) {
53
+ switch (_b.label) {
54
+ case 0: return [4 /*yield*/, system_1.container.get(system_1.Types.RemoteUsers).create(data)];
55
+ case 1:
56
+ _b.sent();
57
+ (_a = cache[queryKey]) === null || _a === void 0 ? void 0 : _a.mutate();
58
+ createToast({ message: 'Criado com sucesso!', status: 'success' });
59
+ return [2 /*return*/];
60
+ }
61
+ });
62
+ }); },
63
+ inputs: [
64
+ [{ name: 'emailAddress', InputComponent: 'Input', type: 'email', label: 'Email' }],
65
+ [
66
+ { name: 'firstName', InputComponent: 'Input', type: 'text', label: 'Primeiro Nome' },
67
+ { name: 'lastName', InputComponent: 'Input', type: 'text', label: 'Sobrenome' },
68
+ ],
69
+ [{ name: 'password', InputComponent: 'InputPassword', type: 'password', label: 'Senha' }],
70
+ ],
71
+ };
72
+ return createTable;
73
+ }
74
+ exports.useCreateTable = useCreateTable;
75
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.useDeleteTable = void 0;
40
+ var ui_1 = require("../../../../../../ui/index.js");
41
+ var system_1 = require("../../../../../../system/index.js");
42
+ function useDeleteTable(queryKey) {
43
+ var createToast = (0, ui_1.useToast)().createToast;
44
+ var cache = (0, ui_1.useQueryClient)(function (state) { return state.cache; });
45
+ function executeDelete(tableItem) {
46
+ return __awaiter(this, void 0, void 0, function () {
47
+ var _a;
48
+ var _b;
49
+ return __generator(this, function (_c) {
50
+ switch (_c.label) {
51
+ case 0:
52
+ _c.trys.push([0, 2, , 3]);
53
+ return [4 /*yield*/, system_1.container.get(system_1.Types.RemoteUsers).delete({ id: tableItem.id })];
54
+ case 1:
55
+ _c.sent();
56
+ createToast({ status: 'success', message: 'Usuário deletado com sucesso.' });
57
+ (_b = cache[queryKey]) === null || _b === void 0 ? void 0 : _b.mutate();
58
+ return [3 /*break*/, 3];
59
+ case 2:
60
+ _a = _c.sent();
61
+ createToast({
62
+ status: 'error',
63
+ message: 'Aconteceu um erro ao tentar deletar, tente novamente mais tarde.',
64
+ });
65
+ return [3 /*break*/, 3];
66
+ case 3: return [2 /*return*/];
67
+ }
68
+ });
69
+ });
70
+ }
71
+ return { executeDelete: executeDelete };
72
+ }
73
+ exports.useDeleteTable = useDeleteTable;
74
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1,3 @@
1
+ import { DynamicFormHandlerProps } from '../../../../../../ui/index.js';
2
+ import { User } from '../../../../../../system/index.js';
3
+ export declare function useEditTable(queryKey: string): DynamicFormHandlerProps<User>;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.useEditTable = void 0;
40
+ var ui_1 = require("../../../../../../ui/index.js");
41
+ var system_1 = require("../../../../../../system/index.js");
42
+ function useEditTable(queryKey) {
43
+ var _this = this;
44
+ var createToast = (0, ui_1.useToast)().createToast;
45
+ var cache = (0, ui_1.useQueryClient)(function (state) { return state.cache; });
46
+ var editTable = {
47
+ title: 'Editar usuário',
48
+ button: { text: 'Editar' },
49
+ getDetails: {
50
+ key: function (tableItem) { return 'EditUser' + tableItem.id; },
51
+ fetcher: function (tableItem) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
52
+ switch (_a.label) {
53
+ case 0: return [4 /*yield*/, system_1.container.get(system_1.Types.RemoteUsers).getDetail({ id: tableItem.id })];
54
+ case 1: return [2 /*return*/, _a.sent()];
55
+ }
56
+ }); }); },
57
+ },
58
+ onSucess: function (data, _) { return __awaiter(_this, void 0, void 0, function () {
59
+ var _a;
60
+ return __generator(this, function (_b) {
61
+ switch (_b.label) {
62
+ case 0: return [4 /*yield*/, system_1.container.get(system_1.Types.RemoteUsers).edit(data)];
63
+ case 1:
64
+ _b.sent();
65
+ (_a = cache[queryKey]) === null || _a === void 0 ? void 0 : _a.mutate();
66
+ createToast({ message: 'Editado com sucesso!', status: 'success' });
67
+ return [2 /*return*/];
68
+ }
69
+ });
70
+ }); },
71
+ inputs: [
72
+ [{ name: 'emailAddress', InputComponent: 'Input', type: 'email', label: 'Email' }],
73
+ [
74
+ { name: 'firstName', InputComponent: 'Input', type: 'text', label: 'Primeiro Nome' },
75
+ { name: 'lastName', InputComponent: 'Input', type: 'text', label: 'Sobrenome' },
76
+ ],
77
+ [{ name: 'roleGate', InputComponent: 'Input', type: 'text', label: 'Role' }],
78
+ ],
79
+ };
80
+ return editTable;
81
+ }
82
+ exports.useEditTable = useEditTable;
83
+ //# sourceMappingURL=edit.js.map
@@ -0,0 +1,4 @@
1
+ export * from './edit.js';
2
+ export * from './create.js';
3
+ export * from './delete.js';
4
+ export * from './columns.js';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./edit.js"), exports);
18
+ __exportStar(require("./create.js"), exports);
19
+ __exportStar(require("./delete.js"), exports);
20
+ __exportStar(require("./columns.js"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FormLogin = void 0;
4
4
  var jsx_runtime_1 = require("react/jsx-runtime");
5
- var ui_1 = require("../../../../../../../ui");
6
- var context_1 = require("../../../context");
5
+ var ui_1 = require("../../../../../../../ui/index.js");
6
+ var context_1 = require("../../../context.js");
7
7
  function FormLogin() {
8
8
  var signIn = (0, context_1.useAuthAdmin)().signIn;
9
9
  return ((0, jsx_runtime_1.jsxs)(ui_1.FormHandler, { button: { text: 'Entrar' }, initialData: { emailAddress: '', password: '' }, onSucess: signIn, children: [(0, jsx_runtime_1.jsx)(ui_1.Input, { type: 'email', label: 'Email', name: 'emailAddress', placeholder: 'Digite seu usu\u00E1rio' }), (0, jsx_runtime_1.jsx)(ui_1.InputPassword, { name: 'password', label: 'Senha', placeholder: 'Digite sua senha' })] }));
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Login = void 0;
27
+ var jsx_runtime_1 = require("react/jsx-runtime");
28
+ var ui_1 = require("../../../../../../ui/index.js");
29
+ var form_login_1 = require("./form-login/index.js");
30
+ var infra_injection_1 = require("../../../infra-injection/index.js");
31
+ var S = __importStar(require("./styles.js"));
32
+ function Login() {
33
+ var _a, _b;
34
+ var Configurations = (0, infra_injection_1.useInfraInjection)().Configurations;
35
+ return ((0, jsx_runtime_1.jsx)(ui_1.Error, { name: 'login', children: (0, jsx_runtime_1.jsxs)(S.Login, { children: [(0, jsx_runtime_1.jsxs)("div", { className: 'content', children: [(0, jsx_runtime_1.jsx)("div", { className: 'empty' }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: 'logo', children: (0, jsx_runtime_1.jsx)(ui_1.NextImage, { src: '/images/login-logo.png', alt: ' ' }) }), (0, jsx_runtime_1.jsx)("div", { className: 'text', children: (0, jsx_runtime_1.jsx)("h5", { className: 'font-20-bold', children: "Seja bem vindo!" }) }), (0, jsx_runtime_1.jsx)(form_login_1.FormLogin, {})] }), (0, jsx_runtime_1.jsx)("div", { className: 'contact-footer', children: (0, jsx_runtime_1.jsxs)("span", { children: ["Powered by", ' ', (0, jsx_runtime_1.jsxs)("a", { target: '_blank', href: (_a = Configurations === null || Configurations === void 0 ? void 0 : Configurations.poweredBy) === null || _a === void 0 ? void 0 : _a.link, children: [(_b = Configurations === null || Configurations === void 0 ? void 0 : Configurations.poweredBy) === null || _b === void 0 ? void 0 : _b.name, "."] }), ' ', "Todos os direitos reservados."] }) })] }), (0, jsx_runtime_1.jsx)("div", { className: 'image', children: (0, jsx_runtime_1.jsx)(ui_1.NextImage, { src: '/images/login-left.png', alt: 'Imagem de login' }) })] }) }));
36
+ }
37
+ exports.Login = Login;
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ import { IPrivatePage } from './interfaces.js';
2
+ export declare function PrivatePage({ children, roles, signInRole }: IPrivatePage): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ var __generator = (this && this.__generator) || function (thisArg, body) {
35
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
+ function verb(n) { return function (v) { return step([n, v]); }; }
38
+ function step(op) {
39
+ if (f) throw new TypeError("Generator is already executing.");
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
+ if (y = 0, t) op = [op[0] & 2, t.value];
43
+ switch (op[0]) {
44
+ case 0: case 1: t = op; break;
45
+ case 4: _.label++; return { value: op[1], done: false };
46
+ case 5: _.label++; y = op[1]; op = [0]; continue;
47
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
+ default:
49
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
+ if (t[2]) _.ops.pop();
54
+ _.trys.pop(); continue;
55
+ }
56
+ op = body.call(thisArg, _);
57
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
+ }
60
+ };
61
+ Object.defineProperty(exports, "__esModule", { value: true });
62
+ exports.PrivatePage = void 0;
63
+ var jsx_runtime_1 = require("react/jsx-runtime");
64
+ var react_1 = require("react");
65
+ var router_1 = require("next/router");
66
+ var axios_1 = __importStar(require("axios"));
67
+ var ui_1 = require("../../../../../../ui/index.js");
68
+ var login_1 = require("../login/index.js");
69
+ var context_1 = require("../../context.js");
70
+ function PrivatePage(_a) {
71
+ var children = _a.children, roles = _a.roles, signInRole = _a.signInRole;
72
+ var _b = (0, react_1.useState)(false), interceptorIsReady = _b[0], setInterceptorIsReady = _b[1];
73
+ var router = (0, router_1.useRouter)();
74
+ var _c = (0, context_1.useAuthAdmin)(), user = _c.user, roleUser = _c.roleUser, signOut = _c.signOut, ForbiddenCompoent = _c.ForbiddenCompoent;
75
+ var hasAccess = roles && roles.length > 0 ? roles.includes(roleUser) : true;
76
+ (0, react_1.useEffect)(function () {
77
+ var _a, _b;
78
+ var interceptorId;
79
+ if (user && !((_b = (_a = user[roleUser]) === null || _a === void 0 ? void 0 : _a.interceptor) === null || _b === void 0 ? void 0 : _b.disableInterceptor)) {
80
+ interceptorId = axios_1.default.interceptors.response.use(function (r) { return r; }, function (err) {
81
+ var _a, _b;
82
+ if (err instanceof axios_1.AxiosError) {
83
+ if (err.code === 'ERR_NETWORK') {
84
+ signOut();
85
+ }
86
+ if (((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {
87
+ signOut();
88
+ }
89
+ if (((_b = err === null || err === void 0 ? void 0 : err.response) === null || _b === void 0 ? void 0 : _b.status) === 403) {
90
+ router.push('/403');
91
+ }
92
+ }
93
+ throw err;
94
+ });
95
+ }
96
+ setInterceptorIsReady(true);
97
+ return function () {
98
+ if (interceptorId !== undefined) {
99
+ axios_1.default.interceptors.response.eject(interceptorId);
100
+ }
101
+ };
102
+ }, []);
103
+ return ((0, jsx_runtime_1.jsxs)(ui_1.Error, { name: 'private-page', children: [user && hasAccess && (0, jsx_runtime_1.jsx)(ui_1.Error, { name: 'private-page', children: children }), user && !hasAccess && (0, jsx_runtime_1.jsx)(ui_1.Error, { name: 'private-page_danied', children: ForbiddenCompoent ? (0, jsx_runtime_1.jsx)(ForbiddenCompoent, {}) : (0, jsx_runtime_1.jsx)("div", { children: "Negado" }) }), !user && (0, jsx_runtime_1.jsx)(LoginControl, { interceptorIsReady: interceptorIsReady, signInRole: signInRole })] }));
104
+ }
105
+ exports.PrivatePage = PrivatePage;
106
+ function LoginControl(_a) {
107
+ var _this = this;
108
+ var _b, _c, _d, _e;
109
+ var interceptorIsReady = _a.interceptorIsReady, signInRole = _a.signInRole;
110
+ var _f = (0, react_1.useState)(false), loading = _f[0], setLoading = _f[1];
111
+ var _g = (0, context_1.useAuthAdmin)(), user = _g.user, roles = _g.roles, loadUser = _g.loadUser;
112
+ var router = (0, router_1.useRouter)();
113
+ (0, react_1.useEffect)(function () {
114
+ (function () { return __awaiter(_this, void 0, void 0, function () {
115
+ var _a;
116
+ return __generator(this, function (_b) {
117
+ switch (_b.label) {
118
+ case 0:
119
+ _b.trys.push([0, 2, 3, 4]);
120
+ setLoading(true);
121
+ return [4 /*yield*/, loadUser()];
122
+ case 1:
123
+ _b.sent();
124
+ return [3 /*break*/, 4];
125
+ case 2:
126
+ _a = _b.sent();
127
+ return [3 /*break*/, 4];
128
+ case 3:
129
+ setLoading(false);
130
+ return [7 /*endfinally*/];
131
+ case 4: return [2 /*return*/];
132
+ }
133
+ });
134
+ }); })();
135
+ }, [user]);
136
+ var LoginComponent = roles && ((_c = (_b = roles[signInRole]) === null || _b === void 0 ? void 0 : _b.signInConfig) === null || _c === void 0 ? void 0 : _c.Component) ? (_e = (_d = roles[signInRole]) === null || _d === void 0 ? void 0 : _d.signInConfig) === null || _e === void 0 ? void 0 : _e.Component : login_1.Login;
137
+ var Loading = (!user && !interceptorIsReady && !router.isReady) || loading;
138
+ var noHaveUser = !user && router.isReady && interceptorIsReady && !loading;
139
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [Loading && (0, jsx_runtime_1.jsx)(ui_1.LoadingScreen, { size: 30, color: '#000' }), noHaveUser && (0, jsx_runtime_1.jsx)(LoginComponent, {})] }));
140
+ }
141
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ export * from "./table/index.js";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./table/index.js"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import { ITableProps } from './interfaces';
1
+ import { ITableProps } from './interfaces.js';
2
2
  export declare function Table(props: ITableProps): import("react/jsx-runtime").JSX.Element;