infinity-forge 0.23.2 → 0.23.5
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/system/container/files/container.d.ts +1 -1
- package/dist/system/container/files/container.js +2 -2
- package/dist/system/container/files/container.js.map +1 -1
- package/dist/system/container/files/types.d.ts +1 -1
- package/dist/system/container/files/types.js +1 -1
- package/dist/system/container/files/types.js.map +1 -1
- package/dist/system/container/types.d.ts +1 -1
- package/dist/system/data/use-cases/files/index.d.ts +1 -1
- package/dist/system/data/use-cases/files/index.js +1 -1
- package/dist/system/data/use-cases/files/index.js.map +1 -1
- package/dist/system/data/use-cases/files/{remote-upload-files.d.ts → remote-files.d.ts} +2 -1
- package/dist/system/data/use-cases/files/{remote-upload-files.js → remote-files.js} +26 -10
- package/dist/system/data/use-cases/files/remote-files.js.map +1 -0
- package/dist/system/domain/use-cases/files/index.d.ts +3 -2
- package/dist/system/domain/use-cases/files/index.js +2 -1
- package/dist/system/domain/use-cases/files/index.js.map +1 -1
- package/dist/system/domain/use-cases/files/load.d.ts +9 -0
- package/dist/system/domain/use-cases/files/{upload-file.js → load.js} +1 -1
- package/dist/system/domain/use-cases/files/load.js.map +1 -0
- package/dist/system/domain/use-cases/files/{upload-file.d.ts → upload.d.ts} +2 -2
- package/dist/system/domain/use-cases/files/upload.js +3 -0
- package/dist/system/domain/use-cases/files/upload.js.map +1 -0
- package/dist/system/presentation/hooks/ui/use-table/components/table/actions/index.js +1 -2
- package/dist/system/presentation/hooks/ui/use-table/components/table/actions/index.js.map +1 -1
- package/dist/ui/components/form/input-file/index.js +1 -1
- package/dist/ui/components/form/input-file/index.js.map +1 -1
- package/dist/ui/utils/file/index.d.ts +2 -1
- package/dist/ui/utils/file/index.js +1 -0
- package/dist/ui/utils/file/index.js.map +1 -1
- package/dist/ui/utils/file/load-file.d.ts +2 -0
- package/dist/ui/utils/file/load-file.js +72 -0
- package/dist/ui/utils/file/load-file.js.map +1 -0
- package/dist/ui/utils/file/upload-file.js +1 -1
- package/dist/ui/utils/file/upload-file.js.map +1 -1
- package/package.json +1 -1
- package/dist/system/data/use-cases/files/remote-upload-files.js.map +0 -1
- package/dist/system/domain/use-cases/files/upload-file.js.map +0 -1
|
@@ -4,8 +4,8 @@ exports.fileContainer = void 0;
|
|
|
4
4
|
var inversify_1 = require("inversify");
|
|
5
5
|
var system_1 = require("../../../system/index.js");
|
|
6
6
|
var types_1 = require("./types.js");
|
|
7
|
-
var fileContainer = new inversify_1.Container({ defaultScope:
|
|
7
|
+
var fileContainer = new inversify_1.Container({ defaultScope: 'Singleton', autoBindInjectable: true });
|
|
8
8
|
exports.fileContainer = fileContainer;
|
|
9
9
|
fileContainer.parent = system_1.infraContainer;
|
|
10
|
-
fileContainer.bind(types_1.fileTypes.
|
|
10
|
+
fileContainer.bind(types_1.fileTypes.RemoteFile).to(system_1.RemoteFile);
|
|
11
11
|
//# sourceMappingURL=container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../../../src/system/container/files/container.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../../../src/system/container/files/container.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AACrC,mCAAqD;AAErD,iCAAmC;AAEnC,IAAM,aAAa,GAAG,IAAI,qBAAS,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAA;AAKnF,sCAAa;AAHtB,aAAa,CAAC,MAAM,GAAG,uBAAc,CAAA;AACrC,aAAa,CAAC,IAAI,CAAC,iBAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,mBAAU,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/system/container/files/types.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACvB,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/system/container/files/types.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACvB,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;CACrC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './remote-files.js';
|
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./remote-
|
|
17
|
+
__exportStar(require("./remote-files.js"), exports);
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/system/data/use-cases/files/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/system/data/use-cases/files/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as domain from '../../../../system/domain/index.js';
|
|
2
2
|
import { makeApiURL } from '../../../../system/container/infra/make-api-url.js';
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class RemoteFile implements domain.UploadFile, domain.LoadFile {
|
|
4
4
|
private readonly makeApiURL;
|
|
5
5
|
private readonly httpClient;
|
|
6
6
|
constructor(makeApiURL: makeApiURL, httpClient: domain.HttpClient);
|
|
7
7
|
upload(params: domain.UploadFile.Params): Promise<domain.UploadFile.Model>;
|
|
8
|
+
load(params: domain.LoadFile.Params): Promise<any>;
|
|
8
9
|
}
|
|
@@ -71,17 +71,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74
|
-
exports.
|
|
74
|
+
exports.RemoteFile = void 0;
|
|
75
75
|
var inversify_1 = require("inversify");
|
|
76
76
|
var domain = __importStar(require("../../../../system/domain/index.js"));
|
|
77
77
|
var types_1 = require("../../../../system/container/infra/types.js");
|
|
78
78
|
var make_api_url_1 = require("../../../../system/container/infra/make-api-url.js");
|
|
79
|
-
var
|
|
80
|
-
function
|
|
79
|
+
var RemoteFile = /** @class */ (function () {
|
|
80
|
+
function RemoteFile(makeApiURL, httpClient) {
|
|
81
81
|
this.makeApiURL = makeApiURL;
|
|
82
82
|
this.httpClient = httpClient;
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
RemoteFile.prototype.upload = function (params) {
|
|
85
85
|
return __awaiter(this, void 0, void 0, function () {
|
|
86
86
|
var response;
|
|
87
87
|
return __generator(this, function (_a) {
|
|
@@ -91,7 +91,7 @@ var RemoteUploadFile = /** @class */ (function () {
|
|
|
91
91
|
method: 'post',
|
|
92
92
|
body: params,
|
|
93
93
|
headers: {
|
|
94
|
-
|
|
94
|
+
'Content-Type': 'multipart/form-data; boundary=something',
|
|
95
95
|
},
|
|
96
96
|
})];
|
|
97
97
|
case 1:
|
|
@@ -101,13 +101,29 @@ var RemoteUploadFile = /** @class */ (function () {
|
|
|
101
101
|
});
|
|
102
102
|
});
|
|
103
103
|
};
|
|
104
|
-
|
|
104
|
+
RemoteFile.prototype.load = function (params) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
106
|
+
var response;
|
|
107
|
+
return __generator(this, function (_a) {
|
|
108
|
+
switch (_a.label) {
|
|
109
|
+
case 0: return [4 /*yield*/, this.httpClient.request({
|
|
110
|
+
url: this.makeApiURL.make("UploadFile/".concat(params.id)),
|
|
111
|
+
method: 'post',
|
|
112
|
+
})];
|
|
113
|
+
case 1:
|
|
114
|
+
response = _a.sent();
|
|
115
|
+
return [2 /*return*/, response.data];
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
RemoteFile = __decorate([
|
|
105
121
|
(0, inversify_1.injectable)(),
|
|
106
122
|
__param(0, (0, inversify_1.inject)(types_1.InfraTypes.makeApiURL)),
|
|
107
123
|
__param(1, (0, inversify_1.inject)(types_1.InfraTypes.authorizeAdminHttp)),
|
|
108
124
|
__metadata("design:paramtypes", [make_api_url_1.makeApiURL, Object])
|
|
109
|
-
],
|
|
110
|
-
return
|
|
125
|
+
], RemoteFile);
|
|
126
|
+
return RemoteFile;
|
|
111
127
|
}());
|
|
112
|
-
exports.
|
|
113
|
-
//# sourceMappingURL=remote-
|
|
128
|
+
exports.RemoteFile = RemoteFile;
|
|
129
|
+
//# sourceMappingURL=remote-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-files.js","sourceRoot":"","sources":["../../../../../src/system/data/use-cases/files/remote-files.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA8C;AAE9C,sDAAyC;AACzC,wDAA2D;AAC3D,sEAAkE;AAGlE;IACE,oBACkD,UAAsB,EACd,UAA6B;QADrC,eAAU,GAAV,UAAU,CAAY;QACd,eAAU,GAAV,UAAU,CAAmB;IACpF,CAAC;IAEE,2BAAM,GAAZ,UAAa,MAAgC;;;;;4BAC1B,qBAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;4BAC7C,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC;4BACvC,MAAM,EAAE,MAAM;4BACd,IAAI,EAAE,MAAM;4BACZ,OAAO,EAAE;gCACP,cAAc,EAAE,yCAAyC;6BAC1D;yBACF,CAAC,EAAA;;wBAPI,QAAQ,GAAG,SAOf;wBAEF,sBAAO,QAAQ,CAAC,IAA+B,EAAA;;;;KAChD;IAEK,yBAAI,GAAV,UAAW,MAA8B;;;;;4BACtB,qBAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;4BAC7C,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,qBAAc,MAAM,CAAC,EAAE,CAAE,CAAC;4BACpD,MAAM,EAAE,MAAM;yBACf,CAAC,EAAA;;wBAHI,QAAQ,GAAG,SAGf;wBAEF,sBAAO,QAAQ,CAAC,IAA6B,EAAA;;;;KAC9C;IA1BU,UAAU;QADtB,IAAA,sBAAU,GAAE;QAGR,WAAA,IAAA,kBAAM,EAAC,kBAAU,CAAC,UAAU,CAAC,CAAA;QAC7B,WAAA,IAAA,kBAAM,EAAC,kBAAU,CAAC,kBAAkB,CAAC,CAAA;yCADsB,yBAAU;OAF7D,UAAU,CA2BtB;IAAD,iBAAC;CAAA,AA5BD,IA4BC;AA3BY,gCAAU"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './load.js';
|
|
2
|
+
export * from './upload.js';
|
|
3
|
+
export * from './file-system.js';
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./load.js"), exports);
|
|
18
|
+
__exportStar(require("./upload.js"), exports);
|
|
18
19
|
__exportStar(require("./file-system.js"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/system/domain/use-cases/files/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/system/domain/use-cases/files/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,2CAAwB;AACxB,gDAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../../../../src/system/domain/use-cases/files/load.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { List } from
|
|
2
|
-
import { FileSystemType } from
|
|
1
|
+
import { List } from '../../generics/index.js';
|
|
2
|
+
import { FileSystemType } from './file-system.js';
|
|
3
3
|
export type UploadFile = {
|
|
4
4
|
upload: (params: UploadFile.Params) => Promise<UploadFile.Model>;
|
|
5
5
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../../../src/system/domain/use-cases/files/upload.ts"],"names":[],"mappings":""}
|
|
@@ -79,7 +79,6 @@ var react_1 = require("react");
|
|
|
79
79
|
var link_1 = __importDefault(require("next/link"));
|
|
80
80
|
var semantic_ui_react_1 = require("semantic-ui-react");
|
|
81
81
|
var ui_1 = require("../../../../../../../../ui/index.js");
|
|
82
|
-
var component_1 = require("../../../../../../../../ui/components/form/handler/dynamic_form_handler/component.js");
|
|
83
82
|
var S = __importStar(require("./styles.js"));
|
|
84
83
|
function Actions(_a) {
|
|
85
84
|
var _b;
|
|
@@ -100,7 +99,7 @@ function Actions(_a) {
|
|
|
100
99
|
}
|
|
101
100
|
var payload = __assign(__assign({}, ((actions === null || actions === void 0 ? void 0 : actions.edit) || {})), { tableItem: table });
|
|
102
101
|
return ((0, jsx_runtime_1.jsx)(S.Actions, { children: (0, jsx_runtime_1.jsxs)("div", { children: [actions.edit &&
|
|
103
|
-
(((_b = actions.edit) === null || _b === void 0 ? void 0 : _b.link) ? ((0, jsx_runtime_1.jsx)(semantic_ui_react_1.Popup, { 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.jsx)(semantic_ui_react_1.Modal, { open: openEdit, onClose: function () { return setOpenEdit(false); }, style: { maxWidth: 512, borderRadius: 5 }, trigger: (0, jsx_runtime_1.jsx)("span", { className: 'action-button', children: (0, jsx_runtime_1.jsx)(semantic_ui_react_1.Popup, { content: 'Editar', trigger: (0, jsx_runtime_1.jsx)("button", { type: 'button', children: (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconEdit' }) }) }) }), content: openEdit && (0, jsx_runtime_1.jsx)(
|
|
102
|
+
(((_b = actions.edit) === null || _b === void 0 ? void 0 : _b.link) ? ((0, jsx_runtime_1.jsx)(semantic_ui_react_1.Popup, { 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.jsx)(semantic_ui_react_1.Modal, { open: openEdit, onClose: function () { return setOpenEdit(false); }, style: { maxWidth: 512, borderRadius: 5 }, trigger: (0, jsx_runtime_1.jsx)("span", { className: 'action-button', children: (0, jsx_runtime_1.jsx)(semantic_ui_react_1.Popup, { content: 'Editar', trigger: (0, jsx_runtime_1.jsx)("button", { type: 'button', children: (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconEdit' }) }) }) }), content: openEdit && (0, jsx_runtime_1.jsx)(ui_1.DynamicFormHandler, __assign({}, payload, { onSucess: onSuccessEdit })), onOpen: function () {
|
|
104
103
|
setOpenEdit(true);
|
|
105
104
|
} }))), actions.detail && ((0, jsx_runtime_1.jsx)(semantic_ui_react_1.Popup, { 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)(semantic_ui_react_1.Popup, { content: 'Excluir', trigger: (0, jsx_runtime_1.jsx)("button", { className: 'action-button', onClick: function () { return actions.delete(table); }, type: 'button', children: (0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconDelete' }) }) }))] }) }));
|
|
106
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../src/system/presentation/hooks/ui/use-table/components/table/actions/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAgC;AAChC,mDAA4B;AAE5B,uDAAgD;AAEhD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../src/system/presentation/hooks/ui/use-table/components/table/actions/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAgC;AAChC,mDAA4B;AAE5B,uDAAgD;AAEhD,2BAA+C;AAI/C,0CAA6B;AAE7B,SAAgB,OAAO,CAAC,EAAyD;;QAAvD,OAAO,aAAA,EAAE,KAAK,WAAA;IAChC,IAAA,KAA0B,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAxC,QAAQ,QAAA,EAAE,WAAW,QAAmB,CAAA;IAE/C,SAAe,aAAa,CAAC,IAAI;;;;4BAC/B,qBAAM,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAA;;wBAAnD,SAAmD,CAAA;wBAEnD,WAAW,CAAC,KAAK,CAAC,CAAA;;;;;KACnB;IAED,IAAM,OAAO,yBACR,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,KAAI,EAAE,CAAC,KACxB,SAAS,EAAE,KAAK,GACjB,CAAA;IAED,OAAO,CACL,uBAAC,CAAC,CAAC,OAAO,cACR,4CACG,OAAO,CAAC,IAAI;oBACX,CAAC,CAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,IAAI,EAAC,CAAC,CAAC,CACpB,uBAAC,yBAAK,IACJ,OAAO,EAAC,QAAQ,EAChB,OAAO,EACL,uBAAC,cAAI,IAAC,SAAS,EAAC,eAAe,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YACjE,uBAAC,SAAI,IAAC,IAAI,EAAE,UAAU,GAAI,GACrB,GAET,CACH,CAAC,CAAC,CAAC,CACF,uBAAC,yBAAK,IACJ,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,cAAM,OAAA,WAAW,CAAC,KAAK,CAAC,EAAlB,CAAkB,EACjC,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,EACzC,OAAO,EACL,iCAAM,SAAS,EAAC,eAAe,YAC7B,uBAAC,yBAAK,IACJ,OAAO,EAAC,QAAQ,EAChB,OAAO,EACL,mCAAQ,IAAI,EAAC,QAAQ,YACnB,uBAAC,SAAI,IAAC,IAAI,EAAC,UAAU,GAAG,GACjB,GAEX,GACG,EAET,OAAO,EAAE,QAAQ,IAAI,uBAAC,uBAAkB,eAAK,OAAO,IAAE,QAAQ,EAAE,aAAa,IAAI,EACjF,MAAM,EAAE;4BACN,WAAW,CAAC,IAAI,CAAC,CAAA;wBACnB,CAAC,GACD,CACH,CAAC,EAEH,OAAO,CAAC,MAAM,IAAI,CACjB,uBAAC,yBAAK,IACJ,OAAO,EAAC,SAAS,EACjB,OAAO,EACL,uBAAC,cAAI,IAAC,SAAS,EAAC,eAAe,EAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YACzD,uBAAC,SAAI,IAAC,IAAI,EAAC,SAAS,GAAG,GAClB,GAET,CACH,EAEA,OAAO,CAAC,MAAM,IAAI,CACjB,uBAAC,yBAAK,IACJ,OAAO,EAAC,SAAS,EACjB,OAAO,EACL,mCAAQ,SAAS,EAAC,eAAe,EAAC,OAAO,EAAE,cAAM,OAAA,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAArB,CAAqB,EAAE,IAAI,EAAC,QAAQ,YACnF,uBAAC,SAAI,IAAC,IAAI,EAAC,YAAY,GAAG,GACnB,GAEX,CACH,IACG,GACI,CACb,CAAA;AACH,CAAC;AA3ED,0BA2EC"}
|
|
@@ -98,7 +98,7 @@ function InputFile(props) {
|
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
}); } })), (0, jsx_runtime_1.jsx)("label", { htmlFor: props.name, children: loading ? ((0, jsx_runtime_1.jsx)(ui_1.LoaderCircle, { size: 20, color: '#000' })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ui_1.Icon, { name: 'IconDropFile' }), (0, jsx_runtime_1.jsx)("span", { children: "Selecione um arquivo" })] })) }), (0, jsx_runtime_1.jsx)("div", { className: 'initial_value_input_file', children: (field === null || field === void 0 ? void 0 : field.value) &&
|
|
101
|
-
((_a = field === null || field === void 0 ? void 0 : field.value) === null || _a === void 0 ? void 0 : _a.map(function (file) { return ((0, jsx_runtime_1.jsx)(file_card_1.FileCard, { file: file, onDelete: function (file) { var _a; return handlers.setValue((_a = field.value) === null || _a === void 0 ? void 0 : _a.filter(function (item) { return item.url !== file.url; })); } })); })) })] }) })));
|
|
101
|
+
((_a = field === null || field === void 0 ? void 0 : field.value) === null || _a === void 0 ? void 0 : _a.map(function (file) { return ((0, jsx_runtime_1.jsx)(file_card_1.FileCard, { file: file, onDelete: function (file) { var _a; return handlers.setValue((_a = field.value) === null || _a === void 0 ? void 0 : _a.filter(function (item) { return item.url !== file.url; })); } }, file.id + "file_key")); })) })] }) })));
|
|
102
102
|
}
|
|
103
103
|
exports.InputFile = InputFile;
|
|
104
104
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ui/components/form/input-file/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAgC;AAEhC,iCAAiC;AAEjC,yCAAsC;AAEtC,kDAA+C;AAC/C,2BAAqD;AAIrD,0CAA6B;AAE7B,SAAgB,SAAS,CAAC,KAAiB;IAA3C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ui/components/form/input-file/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAgC;AAEhC,iCAAiC;AAEjC,yCAAsC;AAEtC,kDAA+C;AAC/C,2BAAqD;AAIrD,0CAA6B;AAE7B,SAAgB,SAAS,CAAC,KAAiB;IAA3C,iBAiDC;;IAhDO,IAAA,KAAwB,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAtC,OAAO,QAAA,EAAE,UAAU,QAAmB,CAAA;IAEvC,IAAA,KAAuB,IAAA,iBAAQ,EAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,EAApD,KAAK,QAAA,EAAE,CAAC,QAAA,EAAE,QAAQ,QAAkC,CAAA;IAE3D,OAAO,CACL,uBAAC,4BAAY,eAAK,KAAK,cACrB,wBAAC,CAAC,CAAC,SAAS,eACV,6CACM,KAAK,IACT,EAAE,EAAE,KAAK,CAAC,IAAI,EACd,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,QAAQ,EAAE,OAAO,EACjB,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,UAAO,KAAK;;;;;oCACpB,UAAU,CAAC,IAAI,CAAC,CAAA;oCACH,qBAAM,IAAA,eAAU,EAAC,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,EAAA;;oCAA7D,IAAI,GAAG,SAAsD;oCAEnE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;oCAEvB,UAAU,CAAC,KAAK,CAAC,CAAA;;;;yBAClB,IACD,EAEF,kCAAO,OAAO,EAAE,KAAK,CAAC,IAAI,YACvB,OAAO,CAAC,CAAC,CAAC,CACT,uBAAC,iBAAY,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAC,MAAM,GAAG,CACxC,CAAC,CAAC,CAAC,CACF,6DACE,uBAAC,SAAI,IAAC,IAAI,EAAC,cAAc,GAAG,EAE5B,oEAAiC,IAChC,CACJ,GACK,EAER,gCAAK,SAAS,EAAC,0BAA0B,YACtC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK;yBACX,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,0CAAE,GAAG,CAAC,UAAC,IAAoB,IAAK,OAAA,CAC1C,uBAAC,oBAAQ,IAEP,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,UAAC,IAAI,YAAK,OAAA,QAAQ,CAAC,QAAQ,CAAC,MAAA,KAAK,CAAC,KAAK,0CAAE,MAAM,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,EAArB,CAAqB,CAAC,CAAC,CAAA,EAAA,IAFtF,IAAI,CAAC,EAAE,GAAG,UAAU,CAGzB,CACH,EAN2C,CAM3C,CAAC,CAAA,GACA,IACM,IACD,CAChB,CAAA;AACH,CAAC;AAjDD,8BAiDC"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './load-file.js';
|
|
2
|
+
export * from './upload-file.js';
|
|
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./load-file.js"), exports);
|
|
17
18
|
__exportStar(require("./upload-file.js"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/utils/file/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/utils/file/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,gDAA6B"}
|
|
@@ -0,0 +1,72 @@
|
|
|
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.loadFile = void 0;
|
|
40
|
+
var system_1 = require("../../../system/index.js");
|
|
41
|
+
function loadFile(data) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
43
|
+
var response, url, link;
|
|
44
|
+
return __generator(this, function (_a) {
|
|
45
|
+
switch (_a.label) {
|
|
46
|
+
case 0: return [4 /*yield*/, system_1.container.get(system_1.RemoteFile).load(data)
|
|
47
|
+
// await axios
|
|
48
|
+
// .get(file_url, {
|
|
49
|
+
// // responseType: "arraybuffer",
|
|
50
|
+
// headers: {
|
|
51
|
+
// "Content-Type": "application/json",
|
|
52
|
+
// Accept: "application/pdf",
|
|
53
|
+
// },
|
|
54
|
+
// })
|
|
55
|
+
// .then((response) => {
|
|
56
|
+
// })
|
|
57
|
+
];
|
|
58
|
+
case 1:
|
|
59
|
+
response = _a.sent();
|
|
60
|
+
url = window.URL.createObjectURL(new Blob([response]));
|
|
61
|
+
link = document.createElement('a');
|
|
62
|
+
link.href = url;
|
|
63
|
+
link.setAttribute('download', 'download-file' + data.id);
|
|
64
|
+
document.body.appendChild(link);
|
|
65
|
+
link.click();
|
|
66
|
+
return [2 /*return*/];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
exports.loadFile = loadFile;
|
|
72
|
+
//# sourceMappingURL=load-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-file.js","sourceRoot":"","sources":["../../../../src/ui/utils/file/load-file.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAA0D;AAE1D,SAAsB,QAAQ,CAAC,IAAqB;;;;;wBACjC,qBAAM,kBAAS,CAAC,GAAG,CAAa,mBAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;oBAEvE,cAAc;oBACd,mBAAmB;oBACnB,oCAAoC;oBACpC,eAAe;oBACf,0CAA0C;oBAC1C,iCAAiC;oBACjC,OAAO;oBACP,KAAK;oBACL,wBAAwB;oBAExB,KAAK;kBAZkE;;oBAAjE,QAAQ,GAAG,SAAsD;oBAcjE,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;oBACtD,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;oBACxC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;oBACf,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,eAAe,GAAG,IAAI,CAAC,EAAE,CAAC,CAAA;oBACxD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;oBAC/B,IAAI,CAAC,KAAK,EAAE,CAAA;;;;;CACb;AArBD,4BAqBC"}
|
|
@@ -53,7 +53,7 @@ function uploadFile(_a) {
|
|
|
53
53
|
filesToArray.forEach(function (file) {
|
|
54
54
|
formData.append('files', file);
|
|
55
55
|
});
|
|
56
|
-
return [4 /*yield*/, system_1.container.get(system_1.Types.
|
|
56
|
+
return [4 /*yield*/, system_1.container.get(system_1.Types.RemoteFile).upload(formData)];
|
|
57
57
|
case 1:
|
|
58
58
|
response = _b.sent();
|
|
59
59
|
return [2 /*return*/, response.items];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-file.js","sourceRoot":"","sources":["../../../../src/ui/utils/file/upload-file.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"upload-file.js","sourceRoot":"","sources":["../../../../src/ui/utils/file/upload-file.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAuD;AAEvD,SAAsB,UAAU,CAAC,EAA8B;QAA5B,KAAK,WAAA;;;;;;oBACtC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;wBACjC,sBAAO,EAAE,EAAA;oBACX,CAAC;oBAEK,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;oBAElC,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAA;oBAE7B,YAAY,CAAC,OAAO,CAAC,UAAC,IAAI;wBACxB,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;oBAChC,CAAC,CAAC,CAAA;oBAEe,qBAAM,kBAAS,CAAC,GAAG,CAAa,cAAK,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAA;;oBAA7E,QAAQ,GAAG,SAAkE;oBAEnF,sBAAO,QAAQ,CAAC,KAAK,EAAA;;;;CACtB;AAhBD,gCAgBC"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remote-upload-files.js","sourceRoot":"","sources":["../../../../../src/system/data/use-cases/files/remote-upload-files.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA8C;AAE9C,sDAAyC;AACzC,wDAA2D;AAC3D,sEAAkE;AAGlE;IACE,0BACkD,UAAsB,EACd,UAA6B;QADrC,eAAU,GAAV,UAAU,CAAY;QACd,eAAU,GAAV,UAAU,CAAmB;IACpF,CAAC;IAEE,iCAAM,GAAZ,UAAa,MAAgC;;;;;4BAC1B,qBAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;4BAC7C,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC;4BACvC,MAAM,EAAE,MAAM;4BACd,IAAI,EAAE,MAAM;4BACZ,OAAO,EAAE;gCACP,cAAc,EAAG,yCAAyC;6BAC3D;yBACF,CAAC,EAAA;;wBAPI,QAAQ,GAAG,SAOf;wBAEF,sBAAO,QAAQ,CAAC,IAA+B,EAAA;;;;KAChD;IAjBU,gBAAgB;QAD5B,IAAA,sBAAU,GAAE;QAGR,WAAA,IAAA,kBAAM,EAAC,kBAAU,CAAC,UAAU,CAAC,CAAA;QAC7B,WAAA,IAAA,kBAAM,EAAC,kBAAU,CAAC,kBAAkB,CAAC,CAAA;yCADsB,yBAAU;OAF7D,gBAAgB,CAkB5B;IAAD,uBAAC;CAAA,AAnBD,IAmBC;AAlBY,4CAAgB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload-file.js","sourceRoot":"","sources":["../../../../../src/system/domain/use-cases/files/upload-file.ts"],"names":[],"mappings":""}
|