1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
18 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
19 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
20 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
21 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
22 | };
|
23 | var __metadata = (this && this.__metadata) || function (k, v) {
|
24 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
25 | };
|
26 | var __param = (this && this.__param) || function (paramIndex, decorator) {
|
27 | return function (target, key) { decorator(target, key, paramIndex); }
|
28 | };
|
29 | Object.defineProperty(exports, "__esModule", { value: true });
|
30 | exports.ReactDialog = void 0;
|
31 | const React = require("react");
|
32 | const inversify_1 = require("inversify");
|
33 | const common_1 = require("../../common");
|
34 | const dialogs_1 = require("../dialogs");
|
35 | const client_1 = require("react-dom/client");
|
36 | let ReactDialog = class ReactDialog extends dialogs_1.AbstractDialog {
|
37 | constructor(props) {
|
38 | super(props);
|
39 | this.contentNodeRoot = (0, client_1.createRoot)(this.contentNode);
|
40 | this.isMounted = true;
|
41 | this.toDispose.push(common_1.Disposable.create(() => {
|
42 | this.contentNodeRoot.unmount();
|
43 | this.isMounted = false;
|
44 | }));
|
45 | }
|
46 | onUpdateRequest(msg) {
|
47 | var _a;
|
48 | super.onUpdateRequest(msg);
|
49 | if (!this.isMounted) {
|
50 | this.contentNodeRoot = (0, client_1.createRoot)(this.contentNode);
|
51 | }
|
52 | (_a = this.contentNodeRoot) === null || _a === void 0 ? void 0 : _a.render(React.createElement(React.Fragment, null, this.render()));
|
53 | }
|
54 | };
|
55 | ReactDialog = __decorate([
|
56 | (0, inversify_1.injectable)(),
|
57 | __param(0, (0, inversify_1.inject)(dialogs_1.DialogProps)),
|
58 | __metadata("design:paramtypes", [dialogs_1.DialogProps])
|
59 | ], ReactDialog);
|
60 | exports.ReactDialog = ReactDialog;
|
61 |
|
\ | No newline at end of file |