infinity-forge 3.4.7 → 3.4.8
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/sites/components/default-pages/blog/components/blog-item/index.d.ts +1 -1
- package/dist/sites/components/default-pages/blog/components/blog-item/index.js +1 -1
- package/dist/sites/components/default-pages/blog/components/categorias/index.js +1 -1
- package/dist/sites/components/default-pages/blog/components/featured-blog/featured-blog-item/index.d.ts +4 -0
- package/dist/sites/components/default-pages/blog/components/featured-blog/featured-blog-item/index.js +42 -0
- package/dist/sites/components/default-pages/blog/components/featured-blog/index.js +1 -1
- package/dist/sites/components/default-pages/blog/components/side-box-newsletter/index.js +1 -1
- package/dist/sites/components/default-pages/blog/components/side-box-search/index.js +1 -1
- package/dist/sites/components/default-pages/blog/components/title-blog/index.js +1 -1
- package/dist/system/presentation/components/data/buttons/sidebar-button/index.js +1 -1
- package/dist/system/presentation/components/data/chat/card-message/index.d.ts +1 -1
- package/dist/system/presentation/components/data/chat/card-message/index.js +1 -1
- package/dist/system/presentation/components/data/chat/loader/index.js +1 -1
- package/dist/system/presentation/components/data/menu/components/menu-item/index.js +78 -0
- package/dist/system/presentation/components/data/menu/modes/collapsed-menu/index.js +43 -0
- package/dist/system/presentation/components/data/menu/modes/collapsed-menu/styles.js +15 -0
- package/dist/system/presentation/components/data/menu/modes/opened/index.js +50 -0
- package/dist/system/presentation/components/data/menu/modes/opened/styles.js +15 -0
- package/dist/system/presentation/components/data/notifications/card/index.d.ts +1 -1
- package/dist/system/presentation/components/data/notifications/card/index.js +1 -1
- package/dist/system/presentation/components/data/profile-infos/profile/index.js +1 -1
- package/dist/system/presentation/components/data/tab/tab-item/index.js +1 -1
- package/dist/system/presentation/components/layout/header/components/menu-right/component.d.ts +5 -0
- package/dist/system/presentation/components/layout/header/components/menu-right/component.js +34 -0
- package/dist/system/presentation/components/layout/header/components/menu-right/index.d.ts +3 -0
- package/dist/system/presentation/components/layout/header/components/menu-right/index.js +20 -0
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/card/index.d.ts +0 -2
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/card/index.js +0 -47
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/index.js +0 -92
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/content/interfaces.d.ts +0 -6
- package/dist/system/presentation/components/layout/header/components/menu-right/messages/index.js +0 -36
- package/dist/system/presentation/components/layout/header/components/menu-right/profile/content/index.js +0 -36
- package/dist/system/presentation/components/layout/header/components/menu-right/profile/index.js +0 -38
- package/dist/system/presentation/components/layout/header/components/search-modal/index.js +40 -0
- package/dist/system/presentation/components/layout/header/components/search-modal/search-list/index.js +0 -52
- package/dist/system/presentation/components/layout/header/components/search-modal/trigger/index.js +0 -45
- package/dist/system/presentation/components/layout/header/version-01/index.js +1 -1
- package/dist/system/presentation/components/pages/menus/table/columns.d.ts +1 -1
- package/dist/system/presentation/components/pages/menus/table/create.d.ts +1 -1
- package/dist/system/presentation/components/pages/menus/table/create.js +1 -1
- package/dist/system/presentation/components/pages/menus/table/delete.js +1 -1
- package/dist/system/presentation/components/pages/menus/table/edit.d.ts +1 -1
- package/dist/system/presentation/components/pages/menus/table/edit.js +1 -0
- package/dist/system/presentation/components/pages/menus/table/icon/index.js +34 -0
- package/dist/system/presentation/components/pages/users/table/columns.d.ts +1 -1
- package/dist/system/presentation/components/pages/users/table/create.d.ts +1 -1
- package/dist/system/presentation/components/pages/users/table/create.js +1 -1
- package/dist/system/presentation/components/pages/users/table/delete.js +1 -1
- package/dist/system/presentation/components/pages/users/table/edit.d.ts +1 -1
- package/dist/system/presentation/components/pages/users/table/edit.js +1 -0
- package/dist/system/presentation/context/auth/components/login/form-login/index.js +12 -0
- package/dist/system/presentation/context/auth/components/login/index.js +1 -1
- package/dist/system/presentation/context/auth/components/private-page/index.js +1 -1
- package/dist/system/presentation/hooks/locales/ibge/use-load-cities-by-uf/index.d.ts +1 -1
- package/dist/system/presentation/hooks/locales/ibge/use-load-cities-by-uf/index.js +1 -1
- package/dist/system/presentation/hooks/ui/use-table/components/table/actions/delete/index.d.ts +0 -5
- package/dist/system/presentation/hooks/ui/use-table/components/table/actions/delete/index.js +0 -80
- package/dist/system/presentation/hooks/ui/use-table/components/table/actions/index.d.ts +0 -5
- package/dist/system/presentation/hooks/ui/use-table/components/table/actions/index.js +0 -111
- package/dist/system/presentation/hooks/ui/use-table/components/table/active-filters/index.d.ts +0 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/active-filters/index.js +0 -78
- package/dist/system/presentation/hooks/ui/use-table/components/table/create/index.d.ts +0 -4
- package/dist/system/presentation/hooks/ui/use-table/components/table/create/index.js +0 -60
- package/dist/system/presentation/hooks/ui/use-table/components/table/export/index.d.ts +0 -4
- package/dist/system/presentation/hooks/ui/use-table/components/table/export/index.js +0 -35
- package/dist/system/presentation/hooks/ui/use-table/components/table/filters/index.d.ts +0 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/filters/index.js +0 -144
- package/dist/system/presentation/hooks/ui/use-table/components/table/index.d.ts +2 -0
- package/dist/system/presentation/hooks/ui/use-table/components/table/index.js +105 -0
- package/dist/system/presentation/hooks/ui/use-table/components/table/interfaces.d.ts +14 -0
- package/dist/system/presentation/hooks/ui/use-table/components/table/pagination/index.d.ts +0 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/pagination/index.js +0 -56
- package/dist/system/presentation/hooks/ui/use-table/components/table/skeleton-table/index.js +0 -34
- package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/index.d.ts +0 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/index.js +0 -50
- package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/interfaces.d.ts +0 -6
- package/dist/system/presentation/hooks/ui/use-table/query/hook.js +1 -1
- package/dist/ui/components/carousel/carousel-lib/core/modules/observer/observer.js +2 -2
- package/dist/ui/components/carousel/carousel-lib/core/modules/resize/resize.js +1 -1
- package/dist/ui/components/form/input-cep/use-cep/providers/ibge/hook.d.ts +1 -1
- package/dist/ui/components/form/input-cep/use-cep/providers/ibge/hook.js +1 -1
- package/dist/ui/components/form/input-cep/use-cep/providers/ibge/index.d.ts +3 -3
- package/dist/ui/components/form/input-cep/use-cep/providers/ibge/index.js +3 -3
- package/dist/ui/components/form/input-date-picker/calendar/calendar-header/index.js +62 -0
- package/dist/ui/components/form/input-date-picker/calendar/days/index.d.ts +2 -0
- package/dist/ui/components/form/input-date-picker/calendar/days/index.js +87 -0
- package/dist/ui/components/form/input-date-picker/calendar/months/index.d.ts +2 -0
- package/dist/ui/components/form/input-date-picker/calendar/months/index.js +66 -0
- package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.d.ts +0 -13
- package/dist/ui/components/form/input-file/render-files/file-item/button-upload-image-mobile/index.js +0 -18
- package/dist/ui/components/form/input-file/render-files/file-item/index.d.ts +3 -0
- package/dist/ui/components/form/input-file/render-files/file-item/index.js +49 -0
- package/dist/ui/components/form/input-mask/lib/core/errors/SyntheticChangeError.d.ts +0 -14
- package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.d.ts +0 -10
- package/dist/ui/components/form/input-mask/lib/core/hooks/useInput.js +0 -204
- package/dist/ui/components/form/input-mask/lib/core/index.d.ts +5 -0
- package/dist/ui/components/form/input-mask/lib/core/index.js +15 -0
- package/dist/ui/components/form/input-mask/lib/core/utils/setInputAttributes.d.ts +0 -2
- package/dist/ui/components/form/input-mask/lib/mask/InputMask.d.ts +6 -0
- package/dist/ui/components/form/input-mask/lib/mask/InputMask.js +44 -0
- package/dist/ui/components/form/input-mask/lib/mask/index.d.ts +5 -0
- package/dist/ui/components/form/input-mask/lib/mask/index.js +26 -0
- package/dist/ui/components/form/input-mask/lib/mask/types.d.ts +61 -0
- package/dist/ui/components/form/input-mask/lib/mask/useMask.d.ts +3 -0
- package/dist/ui/components/form/input-mask/lib/mask/useMask.js +150 -0
- package/dist/ui/components/form/input-mask/lib/mask/utils/filter.d.ts +0 -14
- package/dist/ui/components/form/input-mask/lib/mask/utils/format.d.ts +0 -14
- package/dist/ui/components/form/input-mask/lib/mask/utils/formatToParts.d.ts +0 -17
- package/dist/ui/components/form/input-mask/lib/mask/utils/formatToReplacementObject.d.ts +0 -2
- package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.d.ts +0 -14
- package/dist/ui/components/form/input-mask/lib/mask/utils/resolveDetail.js +0 -25
- package/dist/ui/components/form/input-mask/lib/mask/utils/resolveSelection.d.ts +0 -18
- package/dist/ui/components/form/input-mask/lib/mask/utils/unformat.d.ts +0 -16
- package/dist/ui/components/form/input-mask/lib/mask/utils/validate.d.ts +0 -13
- package/dist/ui/components/form/input-mask/lib/mask/utils.d.ts +63 -0
- package/dist/ui/components/form/input-mask/lib/mask/utils.js +114 -0
- package/dist/ui/components/form/input-mask/lib/number-format/InputNumberFormat.d.ts +6 -0
- package/dist/ui/components/form/input-mask/lib/number-format/InputNumberFormat.js +58 -0
- package/dist/ui/components/form/input-mask/lib/number-format/index.d.ts +4 -0
- package/dist/ui/components/form/input-mask/lib/number-format/index.js +11 -0
- package/dist/ui/components/form/input-mask/lib/number-format/types.d.ts +26 -0
- package/dist/ui/components/form/input-mask/lib/number-format/useNumberFormat.d.ts +3 -0
- package/dist/ui/components/form/input-mask/lib/number-format/useNumberFormat.js +208 -0
- package/dist/ui/components/form/input-mask/lib/number-format/utils/localizeValues.d.ts +0 -7
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.d.ts +0 -20
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveDetail.js +0 -123
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveMinimumFractionDigits.d.ts +0 -11
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveOptions.d.ts +0 -5
- package/dist/ui/components/form/input-mask/lib/number-format/utils/resolveSelection.d.ts +0 -24
- package/dist/ui/components/form/input-seo/input-meta-image/index.d.ts +1 -1
- package/dist/ui/components/form/input-seo/input-meta-image/index.js +1 -1
- package/dist/ui/components/menu-mobile/components/nav-links/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,111 +0,0 @@
|
|
|
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
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
|
-
function step(op) {
|
|
50
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
51
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
52
|
-
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;
|
|
53
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
54
|
-
switch (op[0]) {
|
|
55
|
-
case 0: case 1: t = op; break;
|
|
56
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
57
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
58
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59
|
-
default:
|
|
60
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
61
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
62
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
63
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
64
|
-
if (t[2]) _.ops.pop();
|
|
65
|
-
_.trys.pop(); continue;
|
|
66
|
-
}
|
|
67
|
-
op = body.call(thisArg, _);
|
|
68
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
69
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
73
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
74
|
-
};
|
|
75
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
|
-
exports.Actions = void 0;
|
|
77
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
78
|
-
var react_1 = require("react");
|
|
79
|
-
var link_1 = __importDefault(require("next/link"));
|
|
80
|
-
var ui_1 = require("../../../../../../../../ui");
|
|
81
|
-
var delete_1 = require("./delete");
|
|
82
|
-
var S = __importStar(require("./styles"));
|
|
83
|
-
var context_1 = require("../../../../../../../../system/presentation/context");
|
|
84
|
-
function Actions(_a) {
|
|
85
|
-
var _this = this;
|
|
86
|
-
var _b, _c, _d;
|
|
87
|
-
var actions = _a.actions, table = _a.table;
|
|
88
|
-
var _e = (0, react_1.useState)(false), open = _e[0], setOpen = _e[1];
|
|
89
|
-
var payload = __assign(__assign({}, ((actions === null || actions === void 0 ? void 0 : actions.edit) || {})), { tableItem: table });
|
|
90
|
-
var roleUser = (0, context_1.useAuthAdmin)().roleUser;
|
|
91
|
-
var Configurations = (0, context_1.useInfraInjection)().Configurations;
|
|
92
|
-
var enableToUpdate = !((_c = (_b = Configurations === null || Configurations === void 0 ? void 0 : Configurations.table) === null || _b === void 0 ? void 0 : _b.accessControl) === null || _c === void 0 ? void 0 : _c.update) ? true : Configurations.table.accessControl.update.includes(roleUser);
|
|
93
|
-
return ((0, jsx_runtime_1.jsx)(S.Actions, { children: (0, jsx_runtime_1.jsxs)("div", { children: [actions.edit && enableToUpdate &&
|
|
94
|
-
(((_d = actions.edit) === null || _d === void 0 ? void 0 : _d.link) ? ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { idTooltip: 'Actions', bgColor: '#fff', enableHover: true, content: 'Editar', trigger: (0, jsx_runtime_1.jsx)(link_1.default, { className: 'action-button', href: actions.edit.link.href(table), children: (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconEdit' }) }) })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ui_1.Modal, { open: open, onClose: function () { return setOpen(false); }, styles: __assign({ width: '100vw', maxWidth: '512px', borderRadius: 5 }, ((actions === null || actions === void 0 ? void 0 : actions.modalStyles) || {})), children: (0, jsx_runtime_1.jsx)(ui_1.DynamicFormHandler, __assign({}, payload, { onSucess: function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
95
|
-
var response;
|
|
96
|
-
return __generator(this, function (_a) {
|
|
97
|
-
switch (_a.label) {
|
|
98
|
-
case 0: return [4 /*yield*/, actions.edit.onSucess(data, undefined, table)];
|
|
99
|
-
case 1:
|
|
100
|
-
response = _a.sent();
|
|
101
|
-
return [2 /*return*/, response];
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
}); }, onFinish: function () {
|
|
105
|
-
setOpen(false);
|
|
106
|
-
} })) }), (0, jsx_runtime_1.jsx)("span", { className: 'action-button', onClick: function () { return setOpen(true); }, children: (0, jsx_runtime_1.jsx)(ui_1.Tooltip, { idTooltip: '', bgColor: '#fff', enableHover: true, content: 'Editar', trigger: (0, jsx_runtime_1.jsx)("button", { type: 'button', children: (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconEdit' }) }) }) })] }))), actions.detail && ((0, jsx_runtime_1.jsx)(ui_1.Tooltip, { idTooltip: 'Actions', bgColor: '#fff', enableHover: true, content: 'Detalhe', trigger: (0, jsx_runtime_1.jsx)(link_1.default, { className: 'action-button', href: actions.detail(table), children: (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconEye' }) }) })), actions.delete && (0, jsx_runtime_1.jsx)(delete_1.ActionDelete, { action: actions.delete, table: table }), actions.custom &&
|
|
107
|
-
actions.custom.length > 0 &&
|
|
108
|
-
actions.custom.map(function (Component, index) { return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Component, __assign({}, table)) }, 'custom' + index + Component.name)); })] }) }));
|
|
109
|
-
}
|
|
110
|
-
exports.Actions = Actions;
|
|
111
|
-
//# sourceMappingURL=index.js.map
|
package/dist/system/presentation/hooks/ui/use-table/components/table/active-filters/index.js
CHANGED
|
@@ -1,78 +0,0 @@
|
|
|
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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
26
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
27
|
-
if (ar || !(i in from)) {
|
|
28
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
29
|
-
ar[i] = from[i];
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.ActiveFilters = void 0;
|
|
36
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
37
|
-
var router_1 = require("next/router");
|
|
38
|
-
var ui_1 = require("../../../../../../../../ui");
|
|
39
|
-
var S = __importStar(require("./styles"));
|
|
40
|
-
function ActiveFilters(_a) {
|
|
41
|
-
var _b, _c, _d;
|
|
42
|
-
var configs = _a.configs, tableInformations = _a.tableInformations;
|
|
43
|
-
var router = (0, router_1.useRouter)();
|
|
44
|
-
var queryFilters = (_b = router === null || router === void 0 ? void 0 : router.query) === null || _b === void 0 ? void 0 : _b.filters;
|
|
45
|
-
var base64FiltersDecoded = (0, ui_1.fromBase64ToString)(queryFilters);
|
|
46
|
-
var configsFilter = (configs === null || configs === void 0 ? void 0 : configs.customFilters) || [];
|
|
47
|
-
var apiFilters = (tableInformations === null || tableInformations === void 0 ? void 0 : tableInformations.filters) || [];
|
|
48
|
-
var filters = __spreadArray(__spreadArray([], apiFilters, true), configsFilter, true);
|
|
49
|
-
var outSideFilters = (_c = configs.customFilters) === null || _c === void 0 ? void 0 : _c.filter(function (filter) { return filter.outsideFilters; });
|
|
50
|
-
if ((!base64FiltersDecoded.filters || base64FiltersDecoded.filters.length === 0) && !router.query.search && (!outSideFilters || outSideFilters.length === 0)) {
|
|
51
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
52
|
-
}
|
|
53
|
-
return ((0, jsx_runtime_1.jsxs)(S.ActiveFilters, { children: [outSideFilters &&
|
|
54
|
-
outSideFilters.length > 0 &&
|
|
55
|
-
outSideFilters.map(function (filter) {
|
|
56
|
-
var _a;
|
|
57
|
-
var existThisFilterInUrl = router.query[filter.data];
|
|
58
|
-
if (!existThisFilterInUrl) {
|
|
59
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
60
|
-
}
|
|
61
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: 'filter_item', children: [(0, jsx_runtime_1.jsxs)("span", { children: [filter.label, ": ", (_a = filter.options.find(function (option) { return option.value === existThisFilterInUrl; })) === null || _a === void 0 ? void 0 : _a.text] }, filter.data), (0, jsx_runtime_1.jsx)("button", { type: 'button', onClick: function () {
|
|
62
|
-
var _a;
|
|
63
|
-
(0, ui_1.updateRoute)({ params: (_a = {}, _a[filter.data] = undefined, _a), router: router });
|
|
64
|
-
}, children: (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'CloseIcon' }) })] }));
|
|
65
|
-
}), (_d = base64FiltersDecoded === null || base64FiltersDecoded === void 0 ? void 0 : base64FiltersDecoded.filters) === null || _d === void 0 ? void 0 : _d.map(function (filter) {
|
|
66
|
-
var _a, _b, _c;
|
|
67
|
-
var text = (_c = (_b = (_a = filters
|
|
68
|
-
.find(function (f) { return (f === null || f === void 0 ? void 0 : f.data) === (filter === null || filter === void 0 ? void 0 : filter.data); })) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.find(function (option) { return option.value === filter.search; })) === null || _c === void 0 ? void 0 : _c.text;
|
|
69
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: 'filter_item', children: [(0, jsx_runtime_1.jsx)("span", { children: text }), (0, jsx_runtime_1.jsx)("button", { type: 'button', onClick: function () {
|
|
70
|
-
var filters = base64FiltersDecoded.filters.filter(function (f) { return f.data !== filter.data && f.search !== filter.search; });
|
|
71
|
-
(0, ui_1.updateRoute)({ params: { filters: (0, ui_1.toBase64)({ filters: filters }) }, router: router });
|
|
72
|
-
}, children: (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'CloseIcon' }) })] }, filter.data + filter.search));
|
|
73
|
-
}), router.query.search && ((0, jsx_runtime_1.jsxs)("div", { className: 'filter_item', children: [(0, jsx_runtime_1.jsxs)("span", { children: ["Busca: ", router.query.search] }), (0, jsx_runtime_1.jsx)("button", { type: 'button', onClick: function () {
|
|
74
|
-
(0, ui_1.updateRoute)({ params: { search: undefined }, router: router });
|
|
75
|
-
}, children: (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'CloseIcon' }) })] }))] }));
|
|
76
|
-
}
|
|
77
|
-
exports.ActiveFilters = ActiveFilters;
|
|
78
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,60 +0,0 @@
|
|
|
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
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.CreateAction = void 0;
|
|
41
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
42
|
-
var react_1 = require("react");
|
|
43
|
-
var link_1 = __importDefault(require("next/link"));
|
|
44
|
-
var ui_1 = require("../../../../../../../../ui");
|
|
45
|
-
var system_1 = require("../../../../../../../../system");
|
|
46
|
-
var S = __importStar(require("./styles"));
|
|
47
|
-
function CreateAction(_a) {
|
|
48
|
-
var _b, _c, _d, _e;
|
|
49
|
-
var actions = _a.actions;
|
|
50
|
-
var _f = (0, react_1.useState)(false), open = _f[0], setOpen = _f[1];
|
|
51
|
-
var roleUser = (0, system_1.useAuthAdmin)().roleUser;
|
|
52
|
-
var Configurations = (0, system_1.useInfraInjection)().Configurations;
|
|
53
|
-
var enableToUpdate = !((_c = (_b = Configurations === null || Configurations === void 0 ? void 0 : Configurations.table) === null || _b === void 0 ? void 0 : _b.accessControl) === null || _c === void 0 ? void 0 : _c.create) ? true : Configurations.table.accessControl.create.includes(roleUser);
|
|
54
|
-
if (!actions.create || !enableToUpdate) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
return ((0, jsx_runtime_1.jsx)(S.Create, { children: ((_d = actions.create) === null || _d === void 0 ? void 0 : _d.link) ? ((0, jsx_runtime_1.jsxs)(link_1.default, { className: 'create-button font-14-regular', href: actions.create.link.href, children: [(0, jsx_runtime_1.jsx)("div", { className: 'icon', children: (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: ((_e = actions === null || actions === void 0 ? void 0 : actions.create) === null || _e === void 0 ? void 0 : _e.icon) || 'IconPlusSharp' }) }), actions.create.text] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ui_1.Modal, { styles: __assign({ width: '100vw', maxWidth: '512px', borderRadius: 10 }, ((actions === null || actions === void 0 ? void 0 : actions.modalStyles) || {})), open: open, onClose: function () { return setOpen(false); }, children: (0, jsx_runtime_1.jsx)(ui_1.DynamicFormHandler, __assign({}, actions.create, { onSucess: actions.create.onSucess, onFinish: function () { return setOpen(false); } })) }), (0, jsx_runtime_1.jsxs)("button", { className: 'create-button font-14-regular', type: 'button', onClick: function () { return setOpen(true); }, children: [(0, jsx_runtime_1.jsx)("div", { className: 'icon', children: (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: (actions === null || actions === void 0 ? void 0 : actions.create.icon) || 'IconPlusSharp' }) }), actions.create.text] })] })) }));
|
|
58
|
-
}
|
|
59
|
-
exports.CreateAction = CreateAction;
|
|
60
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,35 +0,0 @@
|
|
|
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.Export = void 0;
|
|
27
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
-
var ui_1 = require("../../../../../../../../ui");
|
|
29
|
-
var S = __importStar(require("./styles"));
|
|
30
|
-
function Export(_a) {
|
|
31
|
-
var exports = _a.exports;
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)(ui_1.Error, { name: 'Export', children: (0, jsx_runtime_1.jsxs)(S.Export, { className: 'font-14-regular', children: [(0, jsx_runtime_1.jsx)("div", { className: 'icon', children: (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconUpload' }) }), "Exportar"] }) }));
|
|
33
|
-
}
|
|
34
|
-
exports.Export = Export;
|
|
35
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,144 +0,0 @@
|
|
|
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
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
|
-
function step(op) {
|
|
50
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
51
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
52
|
-
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;
|
|
53
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
54
|
-
switch (op[0]) {
|
|
55
|
-
case 0: case 1: t = op; break;
|
|
56
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
57
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
58
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59
|
-
default:
|
|
60
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
61
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
62
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
63
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
64
|
-
if (t[2]) _.ops.pop();
|
|
65
|
-
_.trys.pop(); continue;
|
|
66
|
-
}
|
|
67
|
-
op = body.call(thisArg, _);
|
|
68
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
69
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
73
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
74
|
-
if (ar || !(i in from)) {
|
|
75
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
76
|
-
ar[i] = from[i];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
80
|
-
};
|
|
81
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
82
|
-
exports.Filters = void 0;
|
|
83
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
84
|
-
var router_1 = require("next/router");
|
|
85
|
-
var system_1 = require("../../../../../../../../system");
|
|
86
|
-
var ui_1 = require("../../../../../../../../ui");
|
|
87
|
-
var S = __importStar(require("./styles"));
|
|
88
|
-
function Filters(_a) {
|
|
89
|
-
var _b;
|
|
90
|
-
var configs = _a.configs, tableInformations = _a.tableInformations;
|
|
91
|
-
var configsFilter = configs.customFilters || [];
|
|
92
|
-
var apiFilters = (tableInformations === null || tableInformations === void 0 ? void 0 : tableInformations.filters) || [];
|
|
93
|
-
var filters = __spreadArray(__spreadArray([], apiFilters, true), configsFilter, true);
|
|
94
|
-
var router = (0, router_1.useRouter)();
|
|
95
|
-
var queryFilters = (_b = router === null || router === void 0 ? void 0 : router.query) === null || _b === void 0 ? void 0 : _b.filters;
|
|
96
|
-
var base64FiltersDecoded = (0, ui_1.fromBase64ToString)(queryFilters);
|
|
97
|
-
var hasFiltersSelected = (base64FiltersDecoded === null || base64FiltersDecoded === void 0 ? void 0 : base64FiltersDecoded.filters) && Array.isArray(base64FiltersDecoded === null || base64FiltersDecoded === void 0 ? void 0 : base64FiltersDecoded.filters);
|
|
98
|
-
var initialData = hasFiltersSelected &&
|
|
99
|
-
(base64FiltersDecoded === null || base64FiltersDecoded === void 0 ? void 0 : base64FiltersDecoded.filters.reduce(function (reducer, filter) {
|
|
100
|
-
var _a;
|
|
101
|
-
return __assign(__assign({}, reducer), (_a = {}, _a[filter === null || filter === void 0 ? void 0 : filter.data] = filter === null || filter === void 0 ? void 0 : filter.search, _a));
|
|
102
|
-
}, {}));
|
|
103
|
-
function updateFilters(filters) {
|
|
104
|
-
(0, ui_1.updateRoute)({ params: { filters: (0, ui_1.toBase64)({ filters: filters }) }, router: router });
|
|
105
|
-
}
|
|
106
|
-
if (filters.length === 0) {
|
|
107
|
-
return (0, jsx_runtime_1.jsx)("div", {});
|
|
108
|
-
}
|
|
109
|
-
return ((0, jsx_runtime_1.jsx)(ui_1.Error, { name: 'Filters', children: (0, jsx_runtime_1.jsxs)(S.Filters, { "$gridColumns": filters.length + 1, children: [(0, jsx_runtime_1.jsx)("div", { className: 'filters-accordion', children: (0, jsx_runtime_1.jsx)(ui_1.Accordion, { openIcon: 'EqualizerLineIcon', closeIcon: 'EqualizerFillIcon', children: (0, jsx_runtime_1.jsx)(FiltersForm, { initialData: initialData, filters: filters, hasFiltersSelected: hasFiltersSelected, base64FiltersDecoded: base64FiltersDecoded, updateFilters: updateFilters }) }) }), (0, jsx_runtime_1.jsx)(FiltersForm, { base64FiltersDecoded: base64FiltersDecoded, filters: filters, hasFiltersSelected: hasFiltersSelected, initialData: initialData, updateFilters: updateFilters })] }) }));
|
|
110
|
-
}
|
|
111
|
-
exports.Filters = Filters;
|
|
112
|
-
function FiltersForm(_a) {
|
|
113
|
-
var _this = this;
|
|
114
|
-
var initialData = _a.initialData, filters = _a.filters, hasFiltersSelected = _a.hasFiltersSelected, base64FiltersDecoded = _a.base64FiltersDecoded, updateFilters = _a.updateFilters;
|
|
115
|
-
var router = (0, router_1.useRouter)();
|
|
116
|
-
return ((0, jsx_runtime_1.jsx)(ui_1.FormHandler, { disableEnterKeySubmitForm: true, initialData: __assign(__assign({}, initialData), router.query), children: (0, jsx_runtime_1.jsxs)("div", { className: 'filters', children: [filters === null || filters === void 0 ? void 0 : filters.map(function (filter) { return ((0, jsx_runtime_1.jsx)(ui_1.Select, { name: filter.data, label: filter.label, placeholder: filter.placeholder || filter.label, onlyOneValue: true, onChangeSelect: function (value) { return __awaiter(_this, void 0, void 0, function () {
|
|
117
|
-
var filterSelected, filterAlredyExist, remapedFilters;
|
|
118
|
-
var _a;
|
|
119
|
-
var _b, _c;
|
|
120
|
-
return __generator(this, function (_d) {
|
|
121
|
-
if (filter.outsideFilters) {
|
|
122
|
-
(0, ui_1.updateRoute)({ params: (_a = {}, _a[filter.data] = value, _a), router: router });
|
|
123
|
-
return [2 /*return*/];
|
|
124
|
-
}
|
|
125
|
-
filterSelected = { data: filter === null || filter === void 0 ? void 0 : filter.data, search: value };
|
|
126
|
-
if (hasFiltersSelected) {
|
|
127
|
-
filterAlredyExist = (_b = base64FiltersDecoded === null || base64FiltersDecoded === void 0 ? void 0 : base64FiltersDecoded.filters) === null || _b === void 0 ? void 0 : _b.find(function (f) { return (f === null || f === void 0 ? void 0 : f.data) === (filter === null || filter === void 0 ? void 0 : filter.data); });
|
|
128
|
-
if (filterAlredyExist) {
|
|
129
|
-
remapedFilters = (_c = base64FiltersDecoded === null || base64FiltersDecoded === void 0 ? void 0 : base64FiltersDecoded.filters) === null || _c === void 0 ? void 0 : _c.map(function (f) {
|
|
130
|
-
return (f === null || f === void 0 ? void 0 : f.data) === (filter === null || filter === void 0 ? void 0 : filter.data) ? filterSelected : f;
|
|
131
|
-
});
|
|
132
|
-
updateFilters(remapedFilters);
|
|
133
|
-
return [2 /*return*/];
|
|
134
|
-
}
|
|
135
|
-
updateFilters(__spreadArray(__spreadArray([], base64FiltersDecoded === null || base64FiltersDecoded === void 0 ? void 0 : base64FiltersDecoded.filters, true), [filterSelected], false));
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
updateFilters([filterSelected]);
|
|
139
|
-
}
|
|
140
|
-
return [2 /*return*/];
|
|
141
|
-
});
|
|
142
|
-
}); }, options: filter.options.map(function (op) { return ({ label: op.text, value: op.value }); }) }, filter.data)); }), (0, jsx_runtime_1.jsx)(system_1.InputSearch, { onChange: function (value) { return (0, ui_1.updateRoute)({ params: { search: value, page: 1 }, router: router }); } })] }) }));
|
|
143
|
-
}
|
|
144
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.Table = void 0;
|
|
38
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
var react_1 = require("react");
|
|
40
|
+
var router_1 = require("next/router");
|
|
41
|
+
var ui_1 = require("../../../../../../../ui/index.js");
|
|
42
|
+
var export_1 = require("./export/index.js");
|
|
43
|
+
var actions_1 = require("./actions/index.js");
|
|
44
|
+
var filters_1 = require("./filters/index.js");
|
|
45
|
+
var create_1 = require("./create/index.js");
|
|
46
|
+
var thead_item_1 = require("./thead-item/index.js");
|
|
47
|
+
var pagination_1 = require("./pagination/index.js");
|
|
48
|
+
var skeleton_table_1 = require("./skeleton-table/index.js");
|
|
49
|
+
var active_filters_1 = require("./active-filters/index.js");
|
|
50
|
+
var S = __importStar(require("./styles.js"));
|
|
51
|
+
function Table(props) {
|
|
52
|
+
var _a, _b, _c, _d;
|
|
53
|
+
var configs = props.configs, isFetching = props.isFetching, columnsConfiguration = props.columnsConfiguration, tableInformations = props.tableInformations;
|
|
54
|
+
var router = (0, router_1.useRouter)();
|
|
55
|
+
var loadingTable = configs.isLoading || isFetching;
|
|
56
|
+
var pagination = (configs === null || configs === void 0 ? void 0 : configs.pagination) || (tableInformations === null || tableInformations === void 0 ? void 0 : tableInformations.pagination);
|
|
57
|
+
var paramToSearch = ((_b = (((_a = router.query) === null || _a === void 0 ? void 0 : _a.search) || '')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) || '';
|
|
58
|
+
var tableItems = configs.tableData || (tableInformations === null || tableInformations === void 0 ? void 0 : tableInformations.items);
|
|
59
|
+
var tableFilered = (configs === null || configs === void 0 ? void 0 : configs.enableSearchInSelf)
|
|
60
|
+
? tableItems && tableItems.length > 0
|
|
61
|
+
? tableItems === null || tableItems === void 0 ? void 0 : tableItems.filter(function (item) {
|
|
62
|
+
var _a;
|
|
63
|
+
var stringfyItem = item ? JSON.stringify(item) : '';
|
|
64
|
+
return (_a = stringfyItem === null || stringfyItem === void 0 ? void 0 : stringfyItem.toLowerCase()) === null || _a === void 0 ? void 0 : _a.includes(paramToSearch);
|
|
65
|
+
})
|
|
66
|
+
: null
|
|
67
|
+
: null;
|
|
68
|
+
var tableData = tableFilered || tableItems || [];
|
|
69
|
+
var tableRef = (0, react_1.useRef)(null);
|
|
70
|
+
return ((0, jsx_runtime_1.jsxs)(ui_1.Error, { name: 'table-component', children: [(0, jsx_runtime_1.jsxs)(S.TopActions, { className: 'top-actions', children: [(0, jsx_runtime_1.jsx)(filters_1.Filters, __assign({}, props)), (0, jsx_runtime_1.jsxs)("div", { className: 'right', children: [(tableInformations === null || tableInformations === void 0 ? void 0 : tableInformations.exports) && ((_c = tableInformations === null || tableInformations === void 0 ? void 0 : tableInformations.exports) === null || _c === void 0 ? void 0 : _c.length) > 0 && ((0, jsx_runtime_1.jsx)(export_1.Export, { exports: tableInformations.exports })), (columnsConfiguration === null || columnsConfiguration === void 0 ? void 0 : columnsConfiguration.actions) && (0, jsx_runtime_1.jsx)(create_1.CreateAction, { actions: columnsConfiguration === null || columnsConfiguration === void 0 ? void 0 : columnsConfiguration.actions })] })] }), (0, jsx_runtime_1.jsx)(active_filters_1.ActiveFilters, __assign({}, props)), (0, jsx_runtime_1.jsx)(S.Table, { children: (0, jsx_runtime_1.jsxs)("div", { ref: tableRef, children: [(0, jsx_runtime_1.jsxs)("table", { children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [columnsConfiguration.actions && (0, jsx_runtime_1.jsx)("th", { style: { width: '100px' } }), (_d = columnsConfiguration.columns) === null || _d === void 0 ? void 0 : _d.map(function (colunm, index) {
|
|
71
|
+
if (colunm.enabled === false) {
|
|
72
|
+
return (0, jsx_runtime_1.jsx)(react_1.Fragment, {}, colunm.id + index);
|
|
73
|
+
}
|
|
74
|
+
return ((0, jsx_runtime_1.jsx)(thead_item_1.THeadItem, { index: index, colunm: colunm, disableOrdenationTable: configs === null || configs === void 0 ? void 0 : configs.disableOrdenationTable }, colunm.id + index));
|
|
75
|
+
})] }) }), (0, jsx_runtime_1.jsxs)("tbody", { children: [!loadingTable &&
|
|
76
|
+
tableItems &&
|
|
77
|
+
Array.isArray(tableItems) &&
|
|
78
|
+
(tableItems === null || tableItems === void 0 ? void 0 : tableItems.length) !== 0 &&
|
|
79
|
+
(tableData === null || tableData === void 0 ? void 0 : tableData.map(function (table, index) {
|
|
80
|
+
var _a;
|
|
81
|
+
return ((0, jsx_runtime_1.jsxs)("tr", { children: [columnsConfiguration.actions && (0, jsx_runtime_1.jsx)(actions_1.Actions, { actions: columnsConfiguration.actions, table: table }), (_a = columnsConfiguration.columns) === null || _a === void 0 ? void 0 : _a.map(function (e, i) {
|
|
82
|
+
var _a, _b, _c, _d;
|
|
83
|
+
if (e.enabled === false) {
|
|
84
|
+
return (0, jsx_runtime_1.jsx)(react_1.Fragment, {}, e.id + index);
|
|
85
|
+
}
|
|
86
|
+
function getProps() {
|
|
87
|
+
var _a;
|
|
88
|
+
var props = Object.keys(((_a = e.Component) === null || _a === void 0 ? void 0 : _a.props) || {}).reduce(function (reducer, property) {
|
|
89
|
+
var _a;
|
|
90
|
+
var newReducer = reducer;
|
|
91
|
+
newReducer[property] = table[(_a = e.Component) === null || _a === void 0 ? void 0 : _a.props[property]];
|
|
92
|
+
return __assign({}, newReducer);
|
|
93
|
+
}, {});
|
|
94
|
+
return props;
|
|
95
|
+
}
|
|
96
|
+
var props = ((_a = e.Component) === null || _a === void 0 ? void 0 : _a.allProps) ? table : ((_b = e.Component) === null || _b === void 0 ? void 0 : _b.props) ? getProps() : {};
|
|
97
|
+
var defaultProps = ((_c = e.Component) === null || _c === void 0 ? void 0 : _c.defaultProps) ? (_d = e.Component) === null || _d === void 0 ? void 0 : _d.defaultProps : {};
|
|
98
|
+
var widthTable = tableRef.current;
|
|
99
|
+
var widthPercentage = (e.width * 100) / ((widthTable === null || widthTable === void 0 ? void 0 : widthTable.offsetWidth) || 0);
|
|
100
|
+
return ((0, jsx_runtime_1.jsx)("td", { className: 'font-14-regular', style: { width: widthPercentage.toFixed(2) + '%' }, children: e.Component ? ((0, jsx_runtime_1.jsx)(e.Component.Element, __assign({}, props, defaultProps, { index: index }))) : (table[e.id]) }, String(index) + String(i)));
|
|
101
|
+
})] }, table.id + String(index)));
|
|
102
|
+
})), loadingTable && ((0, jsx_runtime_1.jsxs)("tr", { style: { height: 0 }, children: [columnsConfiguration.columns.map(function (c, index) { return ((0, jsx_runtime_1.jsx)("td", { children: (0, jsx_runtime_1.jsx)("div", { style: { width: c.width + 'px' } }) }, index)); }), columnsConfiguration.actions && ((0, jsx_runtime_1.jsx)("td", { style: { width: '100%' }, children: (0, jsx_runtime_1.jsx)("div", { style: { width: '100%' } }) }))] }))] })] }), !loadingTable && (tableData === null || tableData === void 0 ? void 0 : tableData.length) === 0 && ((0, jsx_runtime_1.jsxs)("div", { className: 'error_table', children: [(0, jsx_runtime_1.jsxs)("svg", { xmlns: 'http://www.w3.org/2000/svg', width: '60', height: '60', viewBox: '0 0 60 60', fill: 'none', children: [(0, jsx_runtime_1.jsx)("path", { d: 'M49.8 18.3301H24.02C23.05 18.3301 22.26 19.1201 22.26 20.0901C22.26 21.0601 23.05 21.8501 24.02 21.8501H49.8C50.77 21.8501 51.56 21.0601 51.56 20.0901C51.56 19.1201 50.77 18.3301 49.8 18.3301Z', fill: '#828282' }), (0, jsx_runtime_1.jsx)("path", { d: 'M19.85 47.7001C20.19 48.0401 20.64 48.2101 21.09 48.2101C21.54 48.2101 21.99 48.0401 22.33 47.7001C23.02 47.0101 23.02 45.9001 22.33 45.2101L18.3 41.1801L22.33 37.1501C23.02 36.4601 23.02 35.3501 22.33 34.6601C21.64 33.9701 20.53 33.9701 19.84 34.6601L15.81 38.6901L11.78 34.6601C11.09 33.9701 9.97996 33.9701 9.28996 34.6601C8.59996 35.3501 8.59996 36.4601 9.28996 37.1501L13.32 41.1801L9.28996 45.2101C8.59996 45.9001 8.59996 47.0101 9.28996 47.7001C9.62996 48.0401 10.08 48.2101 10.53 48.2101C10.98 48.2101 11.43 48.0401 11.77 47.7001L15.8 43.6701L19.83 47.7001H19.85Z', fill: '#828282' }), (0, jsx_runtime_1.jsx)("path", { d: 'M59.75 9.29004C59.75 6.38004 57.39 4.01004 54.48 4.01004H19.34C16.43 4.00004 14.07 6.36004 14.07 9.27004V25.45C6.17001 26.33 0.0100098 33.04 0.0100098 41.17C0.0100098 49.89 7.11001 56.99 15.83 56.99H54.5C57.41 56.99 59.77 54.62 59.77 51.72V9.29004H59.75ZM15.82 53.48C9.04001 53.48 3.52001 47.96 3.52001 41.18C3.52001 34.4 9.04001 28.88 15.82 28.88C22.6 28.88 28.12 34.4 28.12 41.18C28.12 47.96 22.6 53.48 15.82 53.48ZM54.49 53.48H25.75C28.91 50.92 31.07 47.18 31.54 42.93H49.8C50.77 42.93 51.56 42.14 51.56 41.17C51.56 40.2 50.77 39.41 49.8 39.41H31.54C31.25 36.83 30.34 34.43 28.97 32.38H49.81C50.78 32.38 51.57 31.59 51.57 30.62C51.57 29.65 50.78 28.86 49.81 28.86H25.76C23.47 27.01 20.66 25.78 17.59 25.44V9.27004C17.59 8.30004 18.38 7.51004 19.35 7.51004H54.49C55.46 7.52004 56.25 8.31004 56.25 9.28004V51.72C56.26 52.69 55.48 53.48 54.51 53.48H54.49Z', fill: '#828282' })] }), (0, jsx_runtime_1.jsx)("h3", { children: configs === null || configs === void 0 ? void 0 : configs.errorMessage })] })), loadingTable && (0, jsx_runtime_1.jsx)(skeleton_table_1.SkeletonTable, {})] }) }), !(configs === null || configs === void 0 ? void 0 : configs.disablePagination) && pagination && ((0, jsx_runtime_1.jsxs)(S.TableBottom, { className: 'table-bottom', children: [pagination && ((0, jsx_runtime_1.jsxs)("span", { children: ["Mostrando", ' ', (0, jsx_runtime_1.jsx)("strong", { children: pagination.pageSize > pagination.totalItems ? pagination.totalItems : pagination === null || pagination === void 0 ? void 0 : pagination.pageSize }), ' ', "de ", (0, jsx_runtime_1.jsx)("strong", { children: pagination === null || pagination === void 0 ? void 0 : pagination.totalItems }), " resultados"] })), pagination && (0, jsx_runtime_1.jsx)(pagination_1.PaginationTable, __assign({}, pagination))] }))] }));
|
|
103
|
+
}
|
|
104
|
+
exports.Table = Table;
|
|
105
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { List, Pagination, TableConfiguration } from '../../../../../../../system/index.js';
|
|
2
|
+
import { IUseTableProps } from '../../interfaces.js';
|
|
3
|
+
type colunm = keyof any;
|
|
4
|
+
interface IShowHiden {
|
|
5
|
+
text: string;
|
|
6
|
+
filterBased: colunm;
|
|
7
|
+
disable: string[];
|
|
8
|
+
enable: string[];
|
|
9
|
+
}
|
|
10
|
+
type ITableProps = {
|
|
11
|
+
isFetching: boolean;
|
|
12
|
+
tableInformations?: TableConfiguration & List<any> & Pagination;
|
|
13
|
+
} & IUseTableProps;
|
|
14
|
+
export type { ITableProps, IShowHiden };
|