@acorex/layout 1.3.90

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/README.md +2 -0
  2. package/acorex-layout.d.ts +6 -0
  3. package/acorex-layout.metadata.json +1 -0
  4. package/bundles/acorex-layout.umd.js +1479 -0
  5. package/bundles/acorex-layout.umd.js.map +1 -0
  6. package/bundles/acorex-layout.umd.min.js +16 -0
  7. package/bundles/acorex-layout.umd.min.js.map +1 -0
  8. package/esm2015/acorex-layout.js +7 -0
  9. package/esm2015/lib/widget-board/editors/widget-size-editor/widget-size.editor.js +49 -0
  10. package/esm2015/lib/widget-board/editors/widget-size-editor/widget-size.module.js +22 -0
  11. package/esm2015/lib/widget-board/widget-board.component.js +468 -0
  12. package/esm2015/lib/widget-board/widget-board.module.js +69 -0
  13. package/esm2015/lib/widget-board/widget-config.component.js +86 -0
  14. package/esm2015/lib/widget-board/widget-host.component.js +313 -0
  15. package/esm2015/lib/widget-board/widget-save.component.js +79 -0
  16. package/esm2015/lib/widget-board/widget.class.js +123 -0
  17. package/esm2015/public-api.js +7 -0
  18. package/esm5/acorex-layout.js +7 -0
  19. package/esm5/lib/widget-board/editors/widget-size-editor/widget-size.editor.js +52 -0
  20. package/esm5/lib/widget-board/editors/widget-size-editor/widget-size.module.js +23 -0
  21. package/esm5/lib/widget-board/widget-board.component.js +494 -0
  22. package/esm5/lib/widget-board/widget-board.module.js +70 -0
  23. package/esm5/lib/widget-board/widget-config.component.js +90 -0
  24. package/esm5/lib/widget-board/widget-host.component.js +349 -0
  25. package/esm5/lib/widget-board/widget-save.component.js +83 -0
  26. package/esm5/lib/widget-board/widget.class.js +134 -0
  27. package/esm5/public-api.js +7 -0
  28. package/fesm2015/acorex-layout.js +1171 -0
  29. package/fesm2015/acorex-layout.js.map +1 -0
  30. package/fesm5/acorex-layout.js +1256 -0
  31. package/fesm5/acorex-layout.js.map +1 -0
  32. package/lib/widget-board/editors/widget-size-editor/widget-size.editor.d.ts +16 -0
  33. package/lib/widget-board/editors/widget-size-editor/widget-size.module.d.ts +3 -0
  34. package/lib/widget-board/widget-board.component.d.ts +58 -0
  35. package/lib/widget-board/widget-board.module.d.ts +6 -0
  36. package/lib/widget-board/widget-config.component.d.ts +20 -0
  37. package/lib/widget-board/widget-host.component.d.ts +48 -0
  38. package/lib/widget-board/widget-save.component.d.ts +16 -0
  39. package/lib/widget-board/widget.class.d.ts +53 -0
  40. package/package.json +21 -0
  41. package/public-api.d.ts +6 -0
@@ -0,0 +1,70 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { NgModule } from '@angular/core';
3
+ import { AXWidgetBoardComponent } from './widget-board.component';
4
+ import { CommonModule } from '@angular/common';
5
+ import { AXWidgetHostComponent } from './widget-host.component';
6
+ import { AXSearchBoxModule, AXLoadingModule, AXProppertyEditorModule, AXPageModule, AXLabelModule, AXToolbarModule, AXTabStripModule, AXMenuModule, AXFormGroupModule, AXTextAreaModule, AXTextBoxModule, AXFieldsetModule, AXCheckBoxModule, AXValidationModule } from '@acorex/components';
7
+ import { RouterModule } from '@angular/router';
8
+ import { AXWidgetConfigComponent } from './widget-config.component';
9
+ import { AXTranslator, AXTranslatorModule } from '@acorex/core';
10
+ import { AXWidgetSizePropertyEditorComponent } from './editors/widget-size-editor/widget-size.editor';
11
+ import { AXWidgetSizePropertyEditorModule } from './editors/widget-size-editor/widget-size.module';
12
+ import { AXWidgetSaveComponent } from './widget-save.component';
13
+ var AXWidgetBoardModule = /** @class */ (function () {
14
+ /**
15
+ *
16
+ */
17
+ function AXWidgetBoardModule() {
18
+ AXTranslator.load('en', {
19
+ 'widget-board': {
20
+ 'configurable-props': 'Configurable Properties',
21
+ configure: 'Configure Widget'
22
+ }
23
+ });
24
+ AXTranslator.load('fa', {
25
+ 'widget-board': {
26
+ 'configurable-props': 'ویژگی های قابل تنظیم',
27
+ configure: 'پیکر بندی ابزارک'
28
+ }
29
+ });
30
+ }
31
+ AXWidgetBoardModule = __decorate([
32
+ NgModule({
33
+ imports: [
34
+ CommonModule,
35
+ AXSearchBoxModule,
36
+ AXLoadingModule,
37
+ RouterModule,
38
+ AXProppertyEditorModule,
39
+ AXPageModule,
40
+ AXToolbarModule,
41
+ AXTranslatorModule,
42
+ AXLabelModule,
43
+ AXTextAreaModule,
44
+ AXFieldsetModule,
45
+ AXTextBoxModule,
46
+ AXFormGroupModule,
47
+ AXTabStripModule,
48
+ AXCheckBoxModule,
49
+ AXMenuModule,
50
+ AXTranslatorModule,
51
+ AXWidgetSizePropertyEditorModule,
52
+ AXValidationModule,
53
+ RouterModule.forChild([
54
+ {
55
+ component: AXWidgetSizePropertyEditorComponent,
56
+ path: 'ax/editors/widget-size'
57
+ },
58
+ ])
59
+ ],
60
+ exports: [AXWidgetBoardComponent, AXProppertyEditorModule],
61
+ declarations: [AXWidgetBoardComponent, AXWidgetHostComponent, AXWidgetConfigComponent, AXWidgetSaveComponent],
62
+ entryComponents: [AXWidgetConfigComponent, AXWidgetSaveComponent],
63
+ providers: []
64
+ }),
65
+ __metadata("design:paramtypes", [])
66
+ ], AXWidgetBoardModule);
67
+ return AXWidgetBoardModule;
68
+ }());
69
+ export { AXWidgetBoardModule };
70
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2lkZ2V0LWJvYXJkLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BhY29yZXgvbGF5b3V0LyIsInNvdXJjZXMiOlsibGliL3dpZGdldC1ib2FyZC93aWRnZXQtYm9hcmQubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3pDLE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQ2xFLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMvQyxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSx5Q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50LFxyXG4gICAgICAgICAgICAgICAgcGF0aDogJ2F4L2VkaXRvcnMvd2lkZ2V0LXNpemUnXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgXSlcclxuICAgIF0sXHJcbiAgICBleHBvcnRzOiBbQVhXaWRnZXRCb2FyZENvbXBvbmVudCwgQVhQcm9wcGVydHlFZGl0b3JNb2R1bGVdLFxyXG4gICAgZGVjbGFyYXRpb25zOiBbQVhXaWRnZXRCb2FyZENvbXBvbmVudCwgQVhXaWRnZXRIb3N0Q29tcG9uZW50LCBBWFdpZGdldENvbmZpZ0NvbXBvbmVudCwgQVhXaWRnZXRTYXZlQ29tcG9uZW50XSxcclxuICAgIGVudHJ5Q29tcG9uZW50czogW0FYV2lkZ2V0Q29uZmlnQ29tcG9uZW50LCBBWFdpZGdldFNhdmVDb21wb25lbnRdLFxyXG4gICAgcHJvdmlkZXJzOiBbXVxyXG59KVxyXG5leHBvcnQgY2xhc3MgQVhXaWRnZXRCb2FyZE1vZHVsZSB7XHJcbiAgICAvKipcclxuICAgICAqXHJcbiAgICAgKi9cclxuICAgIGNvbnN0cnVjdG9yKCkge1xyXG4gICAgICAgIEFYVHJhbnNsYXRvci5sb2FkKCdlbicsIHtcclxuICAgICAgICAgICAgJ3dpZGdldC1ib2FyZCc6IHtcclxuICAgICAgICAgICAgICAgICdjb25maWd1cmFibGUtcHJvcHMnOiAnQ29uZmlndXJhYmxlIFByb3BlcnRpZXMnLFxyXG4gICAgICAgICAgICAgICAgY29uZmlndXJlOiAnQ29uZmlndXJlIFdpZGdldCdcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIEFYVHJhbnNsYXRvci5sb2FkKCdmYScsIHtcclxuICAgICAgICAgICAgJ3dpZGdldC1ib2FyZCc6IHtcclxuICAgICAgICAgICAgICAgICdjb25maWd1cmFibGUtcHJvcHMnOiAn2YjbjNqY2q/bjCDZh9in24wg2YLYp9io2YQg2KrZhti424zZhScsXHJcbiAgICAgICAgICAgICAgICBjb25maWd1cmU6ICfZvtuM2qnYsSDYqNmG2K/bjCDYp9io2LLYp9ix2qknXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuXHJcbiAgICB9XHJcblxyXG59XHJcbiJdfQ==
@@ -0,0 +1,90 @@
1
+ import { __decorate, __extends, __metadata } from "tslib";
2
+ import { Component, ViewEncapsulation, ChangeDetectionStrategy, ChangeDetectorRef, ViewChild } from '@angular/core';
3
+ import { AXBasePopupPageComponent, AXValidationFormComponent } from '@acorex/components';
4
+ import { AXTranslator } from '@acorex/core';
5
+ var AXWidgetConfigComponent = /** @class */ (function (_super) {
6
+ __extends(AXWidgetConfigComponent, _super);
7
+ function AXWidgetConfigComponent(cdr) {
8
+ var _this = _super.call(this) || this;
9
+ _this.cdr = cdr;
10
+ _this.props = [];
11
+ _this.displayProps = [];
12
+ _this.changes = [];
13
+ _this.context = {};
14
+ return _this;
15
+ }
16
+ AXWidgetConfigComponent.prototype.getFooterButtons = function () {
17
+ return [
18
+ {
19
+ name: 'okay',
20
+ submitBehavior: true,
21
+ text: AXTranslator.get('common.confirm'),
22
+ style: 'success'
23
+ },
24
+ {
25
+ name: 'cancel',
26
+ cancelBehavior: true,
27
+ text: AXTranslator.get('common.cancel'),
28
+ style: 'danger blank'
29
+ }
30
+ ];
31
+ };
32
+ AXWidgetConfigComponent.prototype.onFooterButtonClick = function (e) {
33
+ var _this = this;
34
+ if (e.name === 'cancel') {
35
+ this.close();
36
+ }
37
+ if (e.name === 'okay') {
38
+ this.form.validate().then(function (c) {
39
+ if (c.result) {
40
+ _this.close(_this.changes);
41
+ }
42
+ });
43
+ }
44
+ };
45
+ AXWidgetConfigComponent.prototype.handleValueChange = function (e) {
46
+ var prop = this.changes.find(function (c) { return c.property.name === e.property.name; });
47
+ if (prop) {
48
+ prop.value = e.value;
49
+ }
50
+ else {
51
+ this.changes.push({ property: e.property, value: e.value });
52
+ }
53
+ this.updateContext();
54
+ };
55
+ AXWidgetConfigComponent.prototype.ngOnInit = function () {
56
+ this.displayProps = this.props.filter(function (c) { return c.property.visible !== false; }).sort(function (a, b) { return a.property.order - b.property.order; });
57
+ this.updateContext();
58
+ };
59
+ AXWidgetConfigComponent.prototype.updateContext = function () {
60
+ var ctx = {};
61
+ this.props.forEach(function (p) {
62
+ ctx[p.property.name] = p.value;
63
+ });
64
+ this.changes.forEach(function (p) {
65
+ ctx[p.property.name] = p.value;
66
+ });
67
+ this.context = ctx;
68
+ };
69
+ AXWidgetConfigComponent.prototype.identify = function (index, item) {
70
+ return item.property.name;
71
+ };
72
+ AXWidgetConfigComponent.ctorParameters = function () { return [
73
+ { type: ChangeDetectorRef }
74
+ ]; };
75
+ __decorate([
76
+ ViewChild(AXValidationFormComponent),
77
+ __metadata("design:type", AXValidationFormComponent)
78
+ ], AXWidgetConfigComponent.prototype, "form", void 0);
79
+ AXWidgetConfigComponent = __decorate([
80
+ Component({
81
+ template: "<ax-page>\r\n <ax-page-content>\r\n <div class=\"container\">\r\n <ax-validation-form #form>\r\n <div class=\"row\" *ngFor=\"let p of displayProps; trackBy: identify\">\r\n <div class=\"col-12\">\r\n <ax-label>{{p.property.title | trans}}</ax-label>\r\n <ng-container ax-property-editor-renderer [property]=\"p\" [context]=\"context\" [host]=\"widget\" [validationForm]=\"form\"\r\n (onValueChange)=\"handleValueChange($event)\">\r\n </ng-container>\r\n </div>\r\n </div>\r\n </ax-validation-form>\r\n </div>\r\n </ax-page-content>\r\n</ax-page>",
82
+ encapsulation: ViewEncapsulation.None,
83
+ changeDetection: ChangeDetectionStrategy.OnPush
84
+ }),
85
+ __metadata("design:paramtypes", [ChangeDetectorRef])
86
+ ], AXWidgetConfigComponent);
87
+ return AXWidgetConfigComponent;
88
+ }(AXBasePopupPageComponent));
89
+ export { AXWidgetConfigComponent };
90
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2lkZ2V0LWNvbmZpZy5jb21wb25lbnQuanMiLCJz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W5jZWwnLFxyXG4gICAgICAgICAgICAgICAgY2FuY2VsQmVoYXZpb3I6IHRydWUsXHJcbiAgICAgICAgICAgICAgICB0ZXh0OiBBWFRyYW5zbGF0b3IuZ2V0KCdjb21tb24uY2FuY2VsJyksXHJcbiAgICAgICAgICAgICAgICBzdHlsZTogJ2RhbmdlciBibGFuaydcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIF07XHJcbiAgICB9XHJcblxyXG5cclxuXHJcblxyXG5cclxuICAgIG9uRm9vdGVyQnV0dG9uQ2xpY2soZTogQVhNZW51SXRlbUNsaWNrRXZlbnQpIHtcclxuICAgICAgICBpZiAoZS5uYW1lID09PSAnY2FuY2VsJykge1xyXG4gICAgICAgICAgICB0aGlzLmNsb3NlKCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChlLm5hbWUgPT09ICdva2F5Jykge1xyXG4gICAgICAgICAgICB0aGlzLmZvcm0udmFsaWRhdGUoKS50aGVuKGMgPT4ge1xyXG4gICAgICAgICAgICAgICAgaWYgKGMucmVzdWx0KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jbG9zZSh0aGlzLmNoYW5nZXMpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgaGFuZGxlVmFsdWVDaGFuZ2UoZTogQVhQcm9wZXJ5RWRpdG9yVmFsdWVDaGFuZ2VFdmVudCkge1xyXG4gICAgICAgIGNvbnN0IHByb3AgPSB0aGlzLmNoYW5nZXMuZmluZChjID0+IGMucHJvcGVydHkubmFtZSA9PT0gZS5wcm9wZXJ0eS5uYW1lKTtcclxuICAgICAgICBpZiAocHJvcCkge1xyXG4gICAgICAgICAgICBwcm9wLnZhbHVlID0gZS52YWx1ZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHRoaXMuY2hhbmdlcy5wdXNoKHsgcHJvcGVydHk6IGUucHJvcGVydHksIHZhbHVlOiBlLnZhbHVlIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLnVwZGF0ZUNvbnRleHQoKTtcclxuICAgIH1cclxuXHJcbiAgICBuZ09uSW5pdCgpIHtcclxuICAgICAgICB0aGlzLmRpc3BsYXlQcm9wcyA9IHRoaXMucHJvcHMuZmlsdGVyKGMgPT4gYy5wcm9wZXJ0eS52aXNpYmxlICE9PSBmYWxzZSkuc29ydCgoYSwgYikgPT4gYS5wcm9wZXJ0eS5vcmRlciAtIGIucHJvcGVydHkub3JkZXIpO1xyXG4gICAgICAgIHRoaXMudXBkYXRlQ29udGV4dCgpO1xyXG4gICAgfVxyXG5cclxuXHJcbiAgICBwcml2YXRlIHVwZGF0ZUNvbnRleHQoKSB7XHJcbiAgICAgICAgY29uc3QgY3R4ID0ge307XHJcbiAgICAgICAgdGhpcy5wcm9wcy5mb3JFYWNoKHAgPT4ge1xyXG4gICAgICAgICAgICBjdHhbcC5wcm9wZXJ0eS5uYW1lXSA9IHAudmFsdWU7XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgdGhpcy5jaGFuZ2VzLmZvckVhY2gocCA9PiB7XHJcbiAgICAgICAgICAgIGN0eFtwLnByb3BlcnR5Lm5hbWVdID0gcC52YWx1ZTtcclxuICAgICAgICB9KTtcclxuICAgICAgICB0aGlzLmNvbnRleHQgPSBjdHg7XHJcbiAgICB9XHJcblxyXG5cclxuICAgIGlkZW50aWZ5KGluZGV4LCBpdGVtOiBBWFByb3BlcnR5Q29uZmlnKSB7XHJcbiAgICAgICAgcmV0dXJuIGl0ZW0ucHJvcGVydHkubmFtZTtcclxuICAgIH1cclxuXHJcbn0iXX0=
@@ -0,0 +1,349 @@
1
+ import { __awaiter, __decorate, __generator, __metadata } from "tslib";
2
+ import { Component, ViewEncapsulation, Input, ElementRef, HostBinding, ComponentFactoryResolver, ViewChild, ViewContainerRef, Output, EventEmitter, ChangeDetectionStrategy, ChangeDetectorRef, ComponentRef } from '@angular/core';
3
+ import { AXObjectUtil, AXRenderService } from '@acorex/core';
4
+ import { AXPopupService, AXPropertyDecorators, AXPropertyDecorator, AXLoadingService } from '@acorex/components';
5
+ import { AXWidgetConfigComponent } from './widget-config.component';
6
+ import { AXTranslator } from '@acorex/core';
7
+ import { AXWidgetSaveComponent } from './widget-save.component';
8
+ var AXWidgetHostComponent = /** @class */ (function () {
9
+ function AXWidgetHostComponent(ref, componentFactoryResolver, rendererService, cdr, popup, loadingService) {
10
+ this.ref = ref;
11
+ this.componentFactoryResolver = componentFactoryResolver;
12
+ this.rendererService = rendererService;
13
+ this.cdr = cdr;
14
+ this.popup = popup;
15
+ this.loadingService = loadingService;
16
+ this._hasProps = false;
17
+ this._hasMenu = false;
18
+ this.configMenuItem = [
19
+ {
20
+ icon: 'far fa-ellipsis-h',
21
+ items: []
22
+ }
23
+ ];
24
+ this.onRemove = new EventEmitter();
25
+ this.onConfigChanged = new EventEmitter();
26
+ this.onResized = new EventEmitter();
27
+ this.onSave = new EventEmitter();
28
+ this._isLoading = false;
29
+ this.sizeX = 1;
30
+ this.sizeY = 1;
31
+ this.col = 1;
32
+ this.row = 1;
33
+ }
34
+ Object.defineProperty(AXWidgetHostComponent.prototype, "widget", {
35
+ get: function () {
36
+ return this._widget;
37
+ },
38
+ enumerable: true,
39
+ configurable: true
40
+ });
41
+ Object.defineProperty(AXWidgetHostComponent.prototype, "element", {
42
+ get: function () {
43
+ return this.ref.nativeElement;
44
+ },
45
+ enumerable: true,
46
+ configurable: true
47
+ });
48
+ Object.defineProperty(AXWidgetHostComponent.prototype, "isLoading", {
49
+ get: function () {
50
+ return this._isLoading;
51
+ },
52
+ set: function (v) {
53
+ this._isLoading = v;
54
+ if (this._loadingId && !v) {
55
+ this.loadingService.hide(this._loadingId);
56
+ this._loadingId = null;
57
+ }
58
+ if (v) {
59
+ this._loadingId = this.loadingService.show(this.ref.nativeElement);
60
+ }
61
+ },
62
+ enumerable: true,
63
+ configurable: true
64
+ });
65
+ Object.defineProperty(AXWidgetHostComponent.prototype, "isConfigured", {
66
+ get: function () {
67
+ var _a;
68
+ return ((_a = this._widget) === null || _a === void 0 ? void 0 : _a.isConfigured) || false;
69
+ },
70
+ enumerable: true,
71
+ configurable: true
72
+ });
73
+ AXWidgetHostComponent.prototype.ngOnInit = function () {
74
+ this.isLoading = true;
75
+ };
76
+ AXWidgetHostComponent.prototype.ngAfterViewInit = function () {
77
+ var _a;
78
+ return __awaiter(this, void 0, void 0, function () {
79
+ var component, route, widgetFactory;
80
+ var _this = this;
81
+ return __generator(this, function (_b) {
82
+ switch (_b.label) {
83
+ case 0:
84
+ if (!(typeof this.config.component === 'string')) return [3 /*break*/, 2];
85
+ return [4 /*yield*/, this.rendererService.findLoadedComponentByRoute(this.config.component, 20)];
86
+ case 1:
87
+ route = _b.sent();
88
+ component = (_a = route) === null || _a === void 0 ? void 0 : _a.component;
89
+ return [3 /*break*/, 3];
90
+ case 2:
91
+ if (typeof this.config.component === 'function') {
92
+ component = this.config.component;
93
+ }
94
+ _b.label = 3;
95
+ case 3:
96
+ if (component == null) {
97
+ console.error("Invalid Widget Component!", this.config);
98
+ this.onRemove.emit(this);
99
+ return [2 /*return*/];
100
+ }
101
+ widgetFactory = this.componentFactoryResolver.resolveComponentFactory(component);
102
+ this.componentRef = this.vc.createComponent(widgetFactory);
103
+ this._widget = this.componentRef.instance;
104
+ this._widget.provideValue = this.provideValue;
105
+ if (this._widget.onBusyChanged) {
106
+ this._widget.onBusyChanged.subscribe(function (d) {
107
+ if (!_this._widget.widgetSize) {
108
+ _this._widget.setValue('widgetSize', [_this.sizeX, _this.sizeY]);
109
+ }
110
+ else {
111
+ _this.setSizeFromOptions();
112
+ }
113
+ _this.isLoading = d.value;
114
+ _this.cdr.detectChanges();
115
+ });
116
+ }
117
+ if (this._widget.onConfiguredChanged) {
118
+ this._widget.onConfiguredChanged.subscribe(function () {
119
+ _this.setSizeFromOptions();
120
+ });
121
+ }
122
+ //
123
+ if (this.config.options) {
124
+ Object.assign(this._widget, this.config.options);
125
+ }
126
+ this._hasProps = AXPropertyDecorators.getProperties(this._widget).length > 0;
127
+ this.isLoading = false;
128
+ this.config['__meta__'].instance = this;
129
+ this._widget['__meta__'] = {};
130
+ this._widget['__meta__'].config = this.config;
131
+ //
132
+ if (this._hasProps) {
133
+ this.configMenuItem[0].items.push({
134
+ name: 'configs',
135
+ icon: 'far fa-cogs',
136
+ text: AXTranslator.get('common.configs'),
137
+ onClick: function () {
138
+ _this.openConfigDialog();
139
+ }
140
+ });
141
+ }
142
+ this.configMenuItem[0].items.push({
143
+ name: 'save',
144
+ icon: 'far fa-save',
145
+ text: AXTranslator.get('common.save-as'),
146
+ onClick: function () {
147
+ _this.openSaveDialog();
148
+ }
149
+ });
150
+ if (true) {
151
+ this.configMenuItem[0].items.push({
152
+ name: 'remove',
153
+ icon: 'far fa-times',
154
+ style: 'ax danger blank',
155
+ text: AXTranslator.get('common.remove'),
156
+ onClick: function () {
157
+ _this.onRemove.emit(_this);
158
+ }
159
+ });
160
+ }
161
+ this._hasMenu = this.configMenuItem[0].items.length > 0;
162
+ this.cdr.detectChanges();
163
+ return [2 /*return*/];
164
+ }
165
+ });
166
+ });
167
+ };
168
+ AXWidgetHostComponent.prototype.setSizeFromOptions = function () {
169
+ var _this = this;
170
+ this._widget.getValue('widgetSize').then(function (c) {
171
+ var oldSizeX = _this.sizeX;
172
+ var oldSizeY = _this.sizeY;
173
+ if (c && Array.isArray(c) && (oldSizeX !== c[0] || oldSizeY !== c[1])) {
174
+ _this.config.sizeX = _this.sizeX = c[0];
175
+ _this.config.sizeY = _this.sizeY = c[1];
176
+ _this.onResized.emit({
177
+ component: _this._widget,
178
+ config: _this.config
179
+ });
180
+ }
181
+ _this.cdr.detectChanges();
182
+ });
183
+ };
184
+ AXWidgetHostComponent.prototype.remove = function (e) {
185
+ e.preventDefault();
186
+ e.stopPropagation();
187
+ this.onRemove.emit(this);
188
+ return false;
189
+ };
190
+ AXWidgetHostComponent.prototype.handleConfig = function (e) {
191
+ e.preventDefault();
192
+ e.stopPropagation();
193
+ this.openConfigDialog();
194
+ return false;
195
+ };
196
+ AXWidgetHostComponent.prototype.openConfigDialog = function () {
197
+ var _this = this;
198
+ var ppp = this.getMergedProps();
199
+ this.popup.open(AXWidgetConfigComponent, {
200
+ title: AXTranslator.get('common.configs'),
201
+ size: 'sm',
202
+ data: {
203
+ props: ppp.map(function (c) { return ({ property: c.options, value: _this._widget[c.options.name] }); }),
204
+ widget: this.widget
205
+ }
206
+ }).then(function (c) {
207
+ if (c.data) {
208
+ if (!_this.config.options) {
209
+ _this.config.options = {};
210
+ }
211
+ c.data.forEach(function (p) {
212
+ _this._widget.setValue(p.property.name, p.value);
213
+ _this.config.options[p.property.name] = p.value;
214
+ });
215
+ _this.emitConfigChanged();
216
+ _this._widget.redraw();
217
+ _this.cdr.detectChanges();
218
+ }
219
+ });
220
+ };
221
+ AXWidgetHostComponent.prototype.openSaveDialog = function () {
222
+ var _this = this;
223
+ var ppp = this.getMergedProps();
224
+ this.popup.open(AXWidgetSaveComponent, {
225
+ title: AXTranslator.get('common.save-as'),
226
+ size: 'sm',
227
+ data: {
228
+ config: this.config,
229
+ props: ppp.map(function (c) { return ({ property: c.options, value: _this._widget[c.options.name] }); })
230
+ }
231
+ }).then(function (c) {
232
+ if (c.data) {
233
+ _this.onSave.emit({
234
+ component: _this._widget,
235
+ data: c.data
236
+ });
237
+ }
238
+ });
239
+ };
240
+ AXWidgetHostComponent.prototype.handleOptionClick = function (e) {
241
+ e.preventDefault();
242
+ e.stopPropagation();
243
+ this.openConfigDialog();
244
+ return false;
245
+ };
246
+ AXWidgetHostComponent.prototype.ngOnDestroy = function () {
247
+ this.vc.clear();
248
+ if (this.componentRef) {
249
+ this.componentRef.destroy();
250
+ }
251
+ };
252
+ AXWidgetHostComponent.prototype.getMergedProps = function () {
253
+ var ppp = AXObjectUtil.deepCopy(AXPropertyDecorators.getProperties(this._widget));
254
+ var _loop_1 = function (key) {
255
+ if (Object.prototype.hasOwnProperty.call(this_1.config.props, key)) {
256
+ var newP = this_1.config.props[key];
257
+ var existPropDec = ppp.find(function (p) { return p.property === key; });
258
+ if (existPropDec) {
259
+ Object.assign(existPropDec.options, newP);
260
+ }
261
+ }
262
+ };
263
+ var this_1 = this;
264
+ for (var key in this.config.props) {
265
+ _loop_1(key);
266
+ }
267
+ return ppp;
268
+ };
269
+ AXWidgetHostComponent.prototype.emitConfigChanged = function () {
270
+ this.onConfigChanged.emit({
271
+ component: this._widget,
272
+ config: this.config
273
+ });
274
+ };
275
+ AXWidgetHostComponent.ctorParameters = function () { return [
276
+ { type: ElementRef },
277
+ { type: ComponentFactoryResolver },
278
+ { type: AXRenderService },
279
+ { type: ChangeDetectorRef },
280
+ { type: AXPopupService },
281
+ { type: AXLoadingService }
282
+ ]; };
283
+ __decorate([
284
+ Input(),
285
+ __metadata("design:type", Function)
286
+ ], AXWidgetHostComponent.prototype, "provideValue", void 0);
287
+ __decorate([
288
+ Output(),
289
+ __metadata("design:type", EventEmitter)
290
+ ], AXWidgetHostComponent.prototype, "onRemove", void 0);
291
+ __decorate([
292
+ Output(),
293
+ __metadata("design:type", EventEmitter)
294
+ ], AXWidgetHostComponent.prototype, "onConfigChanged", void 0);
295
+ __decorate([
296
+ Output(),
297
+ __metadata("design:type", EventEmitter)
298
+ ], AXWidgetHostComponent.prototype, "onResized", void 0);
299
+ __decorate([
300
+ Output(),
301
+ __metadata("design:type", EventEmitter)
302
+ ], AXWidgetHostComponent.prototype, "onSave", void 0);
303
+ __decorate([
304
+ Input(),
305
+ __metadata("design:type", Object)
306
+ ], AXWidgetHostComponent.prototype, "config", void 0);
307
+ __decorate([
308
+ ViewChild('vc', { read: ViewContainerRef }),
309
+ __metadata("design:type", ViewContainerRef)
310
+ ], AXWidgetHostComponent.prototype, "vc", void 0);
311
+ __decorate([
312
+ HostBinding('attr.data-size-x'),
313
+ Input(),
314
+ __metadata("design:type", Number)
315
+ ], AXWidgetHostComponent.prototype, "sizeX", void 0);
316
+ __decorate([
317
+ HostBinding('attr.data-size-y'),
318
+ Input(),
319
+ __metadata("design:type", Number)
320
+ ], AXWidgetHostComponent.prototype, "sizeY", void 0);
321
+ __decorate([
322
+ HostBinding('attr.data-col'),
323
+ Input(),
324
+ __metadata("design:type", Number)
325
+ ], AXWidgetHostComponent.prototype, "col", void 0);
326
+ __decorate([
327
+ HostBinding('attr.data-row'),
328
+ Input(),
329
+ __metadata("design:type", Number)
330
+ ], AXWidgetHostComponent.prototype, "row", void 0);
331
+ AXWidgetHostComponent = __decorate([
332
+ Component({
333
+ selector: 'ax-widget-host',
334
+ template: "<div class='widget-container'>\r\n <div class=\"widget-config-overlay\" *ngIf=\"!isConfigured\" (click)=\"handleConfig($event)\">\r\n <div class=\"widget-title\">{{config.title}}</div>\r\n <div class=\"widget-config-box\">\r\n <div class=\"config-title\">{{ 'widget-board.configure' | trans}}</div>\r\n <div class=\"config-icon\"><i class=\"fas fa-cogs fa-5x\"></i></div>\r\n </div>\r\n </div>\r\n <div class='widget-edit-overlay'>\r\n <div class='widget-edit-menu'>\r\n <button class=\"widget-edit-menu-button\" (click)=\"handleConfig($event)\"\r\n (mousedown)=\"$event.stopPropagation()\" *ngIf=\"_hasProps\" (mouseup)=\"$event.stopPropagation()\">\r\n <i class=\"far fa-cogs\"></i>\r\n </button>\r\n <button class=\"widget-edit-menu-button\" (click)=\"remove($event)\" (mousedown)=\"$event.stopPropagation()\"\r\n (mouseup)=\"$event.stopPropagation()\">\r\n <i class=\"far fa-times\"></i>\r\n </button>\r\n </div>\r\n\r\n </div>\r\n <div class=\"widget-options-menu\" *ngIf=\"_hasMenu\">\r\n <ax-menu [items]='configMenuItem' direction=\"horizontal\"></ax-menu>\r\n </div>\r\n <!-- <ax-loading-panel [visible]=\"isBusy\">\r\n </ax-loading-panel> -->\r\n <div class=\"widget-content\">\r\n <ng-container #vc></ng-container>\r\n </div>\r\n</div>",
335
+ host: { class: 'ax widget-host', tabindex: '0' },
336
+ encapsulation: ViewEncapsulation.None,
337
+ changeDetection: ChangeDetectionStrategy.OnPush
338
+ }),
339
+ __metadata("design:paramtypes", [ElementRef,
340
+ ComponentFactoryResolver,
341
+ AXRenderService,
342
+ ChangeDetectorRef,
343
+ AXPopupService,
344
+ AXLoadingService])
345
+ ], AXWidgetHostComponent);
346
+ return AXWidgetHostComponent;
347
+ }());
348
+ export { AXWidgetHostComponent };
349
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2lkZ2V0LWhvc3QuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGFjb3JleC9sYXlvdXQvIiwic291cmNlcyI6WyJsaWIvd2lkZ2V0LWJvYXJkL3dpZGdldC1ob3N0LmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUNILFNBQVMsRUFDVCxpQkFBaUIsRUFBRSxLQUFLLEVBQ3hCLFVBQVUsRUFBRSxXQUFXLEVBQUUsd0JBQXdCLEVBQUUsU0FBUyxFQUM1RCxnQkFBZ0IsRUFBRSxNQUFNLEVBQUUsWUFBWSxFQUFFLHVCQUF1QixFQUMvRCxpQkFBaUIsRUFBRSxZQUFZLEVBQ2xDLE1BQU0sZUFBZSxDQUFDO0FBRXZCLE9BQU8sRUFBRSxZQUFZLEVBQUUsZUFBZSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBQzdELE9BQU8sRUFBRSxjQUFjLEVBQUUsb0JBQW9CLEVBQUUsbUJBQW1CLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNqSCxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUVwRSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBQzVDLE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHlCQUF5Q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iAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFNpemVGcm9tT3B0aW9ucygpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgdGhpcy5pc0xvYWRpbmcgPSBkLnZhbHVlO1xyXG4gICAgICAgICAgICAgICAgdGhpcy5jZHIuZGV0ZWN0Q2hhbmdlcygpO1xyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMuX3dpZGdldC5vbkNvbmZpZ3VyZWRDaGFuZ2VkKSB7XHJcbiAgICAgICAgICAgIHRoaXMuX3dpZGdldC5vbkNvbmZpZ3VyZWRDaGFuZ2VkLnN1YnNjcmliZSgoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnNldFNpemVGcm9tT3B0aW9ucygpO1xyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgLy9cclxuICAgICAgICBpZiAodGhpcy5jb25maWcub3B0aW9ucykge1xyXG4gICAgICAgICAgICBPYmplY3QuYXNzaWduKHRoaXMuX3dpZGdldCwgdGhpcy5jb25maWcub3B0aW9ucyk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMuX2hhc1Byb3BzID0gQVhQcm9wZXJ0eURlY29yYXRvcnMuZ2V0UHJvcGVydGllcyh0aGlzLl93aWRnZXQpLmxlbmd0aCA+IDA7XHJcblxyXG4gICAgICAgIHRoaXMuaXNMb2FkaW5nID0gZmFsc2U7XHJcbiAgICAgICAgdGhpcy5jb25maWdbJ19fbWV0YV9fJ10uaW5zdGFuY2UgPSB0aGlzO1xyXG4gICAgICAgIHRoaXMuX3dpZGdldFsnX19tZXRhX18nXSA9IHt9O1xyXG4gICAgICAgIHRoaXMuX3dpZGdldFsnX19tZXRhX18nXS5jb25maWcgPSB0aGlzLmNvbmZpZztcclxuICAgICAgICAvL1xyXG4gICAgICAgIGlmICh0aGlzLl9oYXNQcm9wcykge1xyXG4gICAgICAgICAgICB0aGlzLmNvbmZpZ01lbnVJdGVtWzBdLml0ZW1zLnB1c2goe1xyXG4gICAgICAgICAgICAgICAgbmFtZTogJ2NvbmZpZ3MnLFxyXG4gICAgICAgICAgICAgICAgaWNvbjogJ2ZhciBmYS1jb2dzJyxcclxuICAgICAgICAgICAgICAgIHRleHQ6IEFYVHJhbnNsYXRvci5nZXQoJ2NvbW1vbi5jb25maWdzJyksXHJcbiAgICAgICAgICAgICAgICBvbkNsaWNrOiAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcGVuQ29uZmlnRGlhbG9nKCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLmNvbmZpZ01lbnVJdGVtWzBdLml0ZW1zLnB1c2goe1xyXG4gICAgICAgICAgICBuYW1lOiAnc2F2ZScsXHJcbiAgICAgICAgICAgIGljb246ICdmYXIgZmEtc2F2ZScsXHJcbiAgICAgICAgICAgIHRleHQ6IEFYVHJhbnNsYXRvci5nZXQoJ2NvbW1vbi5zYXZlLWFzJyksXHJcbiAgICAgICAgICAgIG9uQ2xpY2s6ICgpID0+IHtcclxuICAgICAgICAgICAgICAgIHRoaXMub3BlblNhdmVEaWFsb2coKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGlmICh0cnVlKSB7XHJcbiAgICAgICAgICAgIHRoaXMuY29uZmlnTWVudUl0ZW1bMF0uaXRlbXMucHVzaCh7XHJcbiAgICAgICAgICAgICAgICBuYW1lOiAncmVtb3ZlJyxcclxuICAgICAgICAgICAgICAgIGljb246ICdmYXIgZmEtdGltZXMnLFxyXG4gICAgICAgICAgICAgICAgc3R5bGU6ICdheCBkYW5nZXIgYmxhbmsnLFxyXG4gICAgICAgICAgICAgICAgdGV4dDogQVhUcmFuc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ycmF5KGMpICYmIChvbGRTaXplWCAhPT0gY1swXSB8fCBvbGRTaXplWSAhPT0gY1sxXSkpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuY29uZmlnLnNpemVYID0gdGhpcy5zaXplWCA9IGNbMF07XHJcbiAgICAgICAgICAgICAgICB0aGlzLmNvbmZpZy5zaXplWSA9IHRoaXMuc2l6ZVkgPSBjWzFdO1xyXG4gICAgICAgICAgICAgICAgdGhpcy5vblJlc2l6ZWQuZW1pdCh7XHJcbiAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50OiB0aGlzLl93aWRnZXQsXHJcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnOiB0aGlzLmNvbmZpZ1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgdGhpcy5jZHIuZGV0ZWN0Q2hhbmdlcygpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG5cclxuICAgIHJlbW92ZShlOiBNb3VzZUV2ZW50KSB7XHJcbiAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xyXG4gICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7XHJcbiAgICAgICAgdGhpcy5vblJlbW92ZS5lbWl0KHRoaXMpO1xyXG4gICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgIH1cclxuXHJcbiAgICBoYW5kbGVDb25maWcoZTogTW91c2VFdmVudCkge1xyXG4gICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcclxuICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpO1xyXG4gICAgICAgIHRoaXMub3BlbkNvbmZpZ0RpYWxvZygpO1xyXG4gICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgIH1cclxuXHJcbiAgICBwcml2YXRlIG9wZW5Db25maWdEaWFsb2coKSB7XHJcbiAgICAgICAgY29uc3QgcHBwID0gdGhpcy5nZXRNZXJnZWRQcm9wcygpO1xyXG4gICAgICAgIHRoaXMucG9wdXAub3BlbihBWFdpZGdldENvbmZpZ0NvbXBvbmVudCwge1xyXG4gICAgICAgICAgICB0aXRsZTogQVhUcmFuc2xhdG9yLmdldCgnY29tbW9uLmNvbmZpZ3MnKSxcclxuICAgICAgICAgICAgc2l6ZTogJ3NtJyxcclxuICAgICAgICAgICAgZGF0YToge1xyXG4gICAgICAgICAgICAgICAgcHJvcHM6IHBwcC5tYXAoYyA9PiAoeyBwcm9wZXJ0eTogYy5vcHRpb25zLCB2YWx1ZTogdGhpcy5fd2lkZ2V0W2Mub3B0aW9ucy5uYW1lXSB9KSksXHJcbiAgICAgICAgICAgICAgICB3aWRnZXQ6IHRoaXMud2lkZ2V0XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KS50aGVuKGMgPT4ge1xyXG4gICAgICAgICAgICBpZiAoYy5kYXRhKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuY29uZmlnLm9wdGlvbnMpIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbmZpZy5vcHRpb25zID0ge307XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjLmRhdGEuZm9yRWFjaChwID0+IHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLl93aWRnZXQuc2V0VmFsdWUocC5wcm9wZXJ0eS5uYW1lLCBwLnZhbHVlKTtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbmZpZy5vcHRpb25zW3AucHJvcGVydHkubmFtZV0gPSBwLnZhbHVlO1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmVtaXRDb25maWdDaGFuZ2VkKCk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLl93aWRnZXQucmVkcmF3KCk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmNkci5kZXRlY3RDaGFuZ2VzKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgIH1cclxuXHJcbiAgICBwcml2YXRlIG9wZW5TYXZlRGlhbG9nKCkge1xyXG4gICAgICAgIGNvbnN0IHBwcCA9IHRoaXMuZ2V0TWVyZ2VkUHJvcHMoKTtcclxuICAgICAgICB0aGlzLnBvcHVwLm9wZW4oQVhXaWRnZXRTYXZlQ29tcG9uZW50LCB7XHJcbiAgICAgICAgICAgIHRpdGxlOiBBWFRyYW5zbGF0b3IuZ2V0KCdjb21tb24uc2F2ZS1hcycpLFxyXG4gICAgICAgICAgICBzaXplOiAnc20nLFxyXG4gICAgICAgICAgICBkYXRhOiB7XHJcbiAgICAgICAgICAgICAgICBjb25maWc6IHRoaXMuY29uZmlnLFxyXG4gICAgICAgICAgICAgICAgcHJvcHM6IHBwcC5tYXAoYyA9PiAoeyBwcm9wZXJ0eTogYy5vcHRpb25zLCB2YWx1ZTogdGhpcy5fd2lkZ2V0W2Mub3B0aW9ucy5uYW1lXSB9KSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pLnRoZW4oYyA9PiB7XHJcbiAgICAgICAgICAgIGlmIChjLmRhdGEpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMub25TYXZlLmVtaXQoe1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudDogdGhpcy5fd2lkZ2V0LFxyXG4gICAgICAgICAgICAgICAgICAgIGRhdGE6IGMuZGF0YVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgIH1cclxuXHJcblxyXG5cclxuICAgIGhhbmRsZU9wdGlvbkNsaWNrKGU6IE1vdXNlRXZlbnQpIHtcclxuICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTtcclxuICAgICAgICB0aGlzLm9wZW5Db25maWdEaWFsb2coKTtcclxuICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICB9XHJcblxyXG4gICAgbmdPbkRlc3Ryb3koKSB7XHJcbiAgICAgICAgdGhpcy52Yy5jbGVhcigpO1xyXG4gICAgICAgIGlmICh0aGlzLmNvbXBvbmVudFJlZikge1xyXG4gICAgICAgICAgICB0aGlzLmNvbXBvbmVudFJlZi5kZXN0cm95KCk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIHByaXZhdGUgZ2V0TWVyZ2VkUHJvcHMoKTogQVhQcm9wZXJ0eURlY29yYXRvcltdIHtcclxuICAgICAgICBjb25zdCBwcHAgPSBBWE9iamVjdFV0aWwuZGVlcENvcHkoQVhQcm9wZXJ0eURlY29yYXRvcnMuZ2V0UHJvcGVydGllcyh0aGlzLl93aWRnZXQpKSBhcyBBWFByb3BlcnR5RGVjb3JhdG9yW107XHJcbiAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gdGhpcy5jb25maWcucHJvcHMpIHtcclxuICAgICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbCh0aGlzLmNvbmZpZy5wcm9wcywga2V5KSkge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgbmV3UCA9IHRoaXMuY29uZmlnLnByb3BzW2tleV07XHJcbiAgICAgICAgICAgICAgICBjb25zdCBleGlzdFByb3BEZWMgPSBwcHAuZmluZChwID0+IHAucHJvcGVydHkgPT09IGtleSk7XHJcbiAgICAgICAgICAgICAgICBpZiAoZXhpc3RQcm9wRGVjKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihleGlzdFByb3BEZWMub3B0aW9ucywgbmV3UCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHBwcDtcclxuICAgIH1cclxuXHJcbiAgICBwcml2YXRlIGVtaXRDb25maWdDaGFuZ2VkKCkge1xyXG4gICAgICAgIHRoaXMub25Db25maWdDaGFuZ2VkLmVtaXQoe1xyXG4gICAgICAgICAgICBjb21wb25lbnQ6IHRoaXMuX3dpZGdldCxcclxuICAgICAgICAgICAgY29uZmlnOiB0aGlzLmNvbmZpZ1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG5cclxufSJdfQ==