@acorex/layout 3.0.65 → 4.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. package/acorex-layout.d.ts +1 -2
  2. package/esm2020/acorex-layout.mjs +5 -0
  3. package/esm2020/lib/widget-board/editors/widget-size-editor/widget-size.editor.mjs +46 -0
  4. package/esm2020/lib/widget-board/editors/widget-size-editor/widget-size.module.mjs +21 -0
  5. package/esm2020/lib/widget-board/widget-board.component.mjs +441 -0
  6. package/esm2020/lib/widget-board/widget-board.module.mjs +111 -0
  7. package/esm2020/lib/widget-board/widget-config.component.mjs +82 -0
  8. package/esm2020/lib/widget-board/widget-host.component.mjs +290 -0
  9. package/esm2020/lib/widget-board/widget-save.component.mjs +79 -0
  10. package/esm2020/lib/widget-board/widget.class.mjs +127 -0
  11. package/esm2020/public-api.mjs +7 -0
  12. package/fesm2015/acorex-layout.mjs +1166 -0
  13. package/fesm2015/acorex-layout.mjs.map +1 -0
  14. package/fesm2020/acorex-layout.mjs +1159 -0
  15. package/fesm2020/acorex-layout.mjs.map +1 -0
  16. package/lib/widget-board/editors/widget-size-editor/widget-size.editor.d.ts +3 -0
  17. package/lib/widget-board/editors/widget-size-editor/widget-size.module.d.ts +8 -0
  18. package/lib/widget-board/widget-board.component.d.ts +3 -0
  19. package/lib/widget-board/widget-board.module.d.ts +12 -0
  20. package/lib/widget-board/widget-config.component.d.ts +3 -0
  21. package/lib/widget-board/widget-host.component.d.ts +3 -0
  22. package/lib/widget-board/widget-save.component.d.ts +3 -0
  23. package/lib/widget-board/widget.class.d.ts +3 -0
  24. package/package.json +23 -13
  25. package/acorex-layout.metadata.json +0 -1
  26. package/bundles/acorex-layout.umd.js +0 -1487
  27. package/bundles/acorex-layout.umd.js.map +0 -1
  28. package/bundles/acorex-layout.umd.min.js +0 -16
  29. package/bundles/acorex-layout.umd.min.js.map +0 -1
  30. package/esm2015/acorex-layout.js +0 -7
  31. package/esm2015/lib/widget-board/editors/widget-size-editor/widget-size.editor.js +0 -49
  32. package/esm2015/lib/widget-board/editors/widget-size-editor/widget-size.module.js +0 -19
  33. package/esm2015/lib/widget-board/widget-board.component.js +0 -468
  34. package/esm2015/lib/widget-board/widget-board.module.js +0 -67
  35. package/esm2015/lib/widget-board/widget-config.component.js +0 -86
  36. package/esm2015/lib/widget-board/widget-host.component.js +0 -323
  37. package/esm2015/lib/widget-board/widget-save.component.js +0 -79
  38. package/esm2015/lib/widget-board/widget.class.js +0 -123
  39. package/esm2015/public-api.js +0 -7
  40. package/esm5/acorex-layout.js +0 -7
  41. package/esm5/lib/widget-board/editors/widget-size-editor/widget-size.editor.js +0 -52
  42. package/esm5/lib/widget-board/editors/widget-size-editor/widget-size.module.js +0 -22
  43. package/esm5/lib/widget-board/widget-board.component.js +0 -494
  44. package/esm5/lib/widget-board/widget-board.module.js +0 -68
  45. package/esm5/lib/widget-board/widget-config.component.js +0 -90
  46. package/esm5/lib/widget-board/widget-host.component.js +0 -359
  47. package/esm5/lib/widget-board/widget-save.component.js +0 -83
  48. package/esm5/lib/widget-board/widget.class.js +0 -134
  49. package/esm5/public-api.js +0 -7
  50. package/fesm2015/acorex-layout.js +0 -1177
  51. package/fesm2015/acorex-layout.js.map +0 -1
  52. package/fesm5/acorex-layout.js +0 -1264
  53. package/fesm5/acorex-layout.js.map +0 -1
@@ -1,68 +0,0 @@
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 { AXWidgetSaveComponent } from './widget-save.component';
12
- var AXWidgetBoardModule = /** @class */ (function () {
13
- /**
14
- *
15
- */
16
- function AXWidgetBoardModule() {
17
- AXTranslator.load('en', {
18
- 'widget-board': {
19
- 'configurable-props': 'Configurable Properties',
20
- configure: 'Configure Widget'
21
- }
22
- });
23
- AXTranslator.load('fa', {
24
- 'widget-board': {
25
- 'configurable-props': 'ویژگی های قابل تنظیم',
26
- configure: 'پیکر بندی ابزارک'
27
- }
28
- });
29
- }
30
- AXWidgetBoardModule = __decorate([
31
- NgModule({
32
- imports: [
33
- CommonModule,
34
- AXSearchBoxModule,
35
- AXLoadingModule,
36
- RouterModule,
37
- AXProppertyEditorModule,
38
- AXPageModule,
39
- AXToolbarModule,
40
- AXTranslatorModule,
41
- AXLabelModule,
42
- AXTextAreaModule,
43
- AXFieldsetModule,
44
- AXTextBoxModule,
45
- AXFormGroupModule,
46
- AXTabStripModule,
47
- AXCheckBoxModule,
48
- AXMenuModule,
49
- AXTranslatorModule,
50
- AXValidationModule,
51
- RouterModule.forChild([
52
- {
53
- component: AXWidgetSizePropertyEditorComponent,
54
- path: 'ax/editors/widget-size'
55
- },
56
- ])
57
- ],
58
- exports: [AXWidgetBoardComponent, AXProppertyEditorModule],
59
- declarations: [AXWidgetBoardComponent, AXWidgetHostComponent, AXWidgetConfigComponent, AXWidgetSaveComponent],
60
- entryComponents: [AXWidgetConfigComponent, AXWidgetSaveComponent],
61
- providers: []
62
- }),
63
- __metadata("design:paramtypes", [])
64
- ], AXWidgetBoardModule);
65
- return AXWidgetBoardModule;
66
- }());
67
- export { AXWidgetBoardModule };
68
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2lkZ2V0LWJvYXJkLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BhY29yZXgvbGF5b3V0LyIsInNvdXJjZXMiOlsibGliL3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CgnZmEnLCB7XHJcbiAgICAgICAgICAgICd3aWRnZXQtYm9hcmQnOiB7XHJcbiAgICAgICAgICAgICAgICAnY29uZmlndXJhYmxlLXByb3BzJzogJ9mI24zamNqv24wg2YfYp9uMINmC2KfYqNmEINiq2YbYuNuM2YUnLFxyXG4gICAgICAgICAgICAgICAgY29uZmlndXJlOiAn2b7bjNqp2LEg2KjZhtiv24wg2KfYqNiy2KfYsdqpJ1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcblxyXG4gICAgfVxyXG5cclxufVxyXG4iXX0=
@@ -1,90 +0,0 @@
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,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gICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIG5hbWU6ICdjYW5jZWwnLFxyXG4gICAgICAgICAgICAgICAgY2FuY2VsQmVoYXZpb3I6IHRydWUsXHJcbiAgICAgICAgICAgICAgICB0ZXh0OiBBWFRyYW5zbGF0b3IuZ2V0KCdjb21tb24uY2FuY2VsJyksXHJcbiAgICAgICAgICAgICAgICBzdHlsZTogJ2RhbmdlciBibGFuaydcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIF07XHJcbiAgICB9XHJcblxyXG5cclxuXHJcblxyXG5cclxuICAgIG9uRm9vdGVyQnV0dG9uQ2xpY2soZTogQVhNZW51SXRlbUNsaWNrRXZlbnQpIHtcclxuICAgICAgICBpZiAoZS5uYW1lID09PSAnY2FuY2VsJykge1xyXG4gICAgICAgICAgICB0aGlzLmNsb3NlKCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChlLm5hbWUgPT09ICdva2F5Jykge1xyXG4gICAgICAgICAgICB0aGlzLmZvcm0udmFsaWRhdGUoKS50aGVuKGMgPT4ge1xyXG4gICAgICAgICAgICAgICAgaWYgKGMucmVzdWx0KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jbG9zZSh0aGlzLmNoYW5nZXMpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgaGFuZGxlVmFsdWVDaGFuZ2UoZTogQVhQcm9wZXJ5RWRpdG9yVmFsdWVDaGFuZ2VFdmVudCkge1xyXG4gICAgICAgIGNvbnN0IHByb3AgPSB0aGlzLmNoYW5nZXMuZmluZChjID0+IGMucHJvcGVydHkubmFtZSA9PT0gZS5wcm9wZXJ0eS5uYW1lKTtcclxuICAgICAgICBpZiAocHJvcCkge1xyXG4gICAgICAgICAgICBwcm9wLnZhbHVlID0gZS52YWx1ZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHRoaXMuY2hhbmdlcy5wdXNoKHsgcHJvcGVydHk6IGUucHJvcGVydHksIHZhbHVlOiBlLnZhbHVlIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLnVwZGF0ZUNvbnRleHQoKTtcclxuICAgIH1cclxuXHJcbiAgICBuZ09uSW5pdCgpIHtcclxuICAgICAgICB0aGlzLmRpc3BsYXlQcm9wcyA9IHRoaXMucHJvcHMuZmlsdGVyKGMgPT4gYy5wcm9wZXJ0eS52aXNpYmxlICE9PSBmYWxzZSkuc29ydCgoYSwgYikgPT4gYS5wcm9wZXJ0eS5vcmRlciAtIGIucHJvcGVydHkub3JkZXIpO1xyXG4gICAgICAgIHRoaXMudXBkYXRlQ29udGV4dCgpO1xyXG4gICAgfVxyXG5cclxuXHJcbiAgICBwcml2YXRlIHVwZGF0ZUNvbnRleHQoKSB7XHJcbiAgICAgICAgY29uc3QgY3R4ID0ge307XHJcbiAgICAgICAgdGhpcy5wcm9wcy5mb3JFYWNoKHAgPT4ge1xyXG4gICAgICAgICAgICBjdHhbcC5wcm9wZXJ0eS5uYW1lXSA9IHAudmFsdWU7XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgdGhpcy5jaGFuZ2VzLmZvckVhY2gocCA9PiB7XHJcbiAgICAgICAgICAgIGN0eFtwLnByb3BlcnR5Lm5hbWVdID0gcC52YWx1ZTtcclxuICAgICAgICB9KTtcclxuICAgICAgICB0aGlzLmNvbnRleHQgPSBjdHg7XHJcbiAgICB9XHJcblxyXG5cclxuICAgIGlkZW50aWZ5KGluZGV4LCBpdGVtOiBBWFByb3BlcnR5Q29uZmlnKSB7XHJcbiAgICAgICAgcmV0dXJuIGl0ZW0ucHJvcGVydHkubmFtZTtcclxuICAgIH1cclxuXHJcbn0iXX0=
@@ -1,359 +0,0 @@
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
- this.configMenuItem[0].items.push({
133
- name: 'refresh',
134
- icon: 'far fa-undo',
135
- text: AXTranslator.get('common.refresh'),
136
- onClick: function () {
137
- var _a, _b;
138
- (_b = (_a = _this) === null || _a === void 0 ? void 0 : _a.widget) === null || _b === void 0 ? void 0 : _b.refresh();
139
- }
140
- });
141
- //
142
- if (this._hasProps) {
143
- this.configMenuItem[0].items.push({
144
- name: 'configs',
145
- icon: 'far fa-cogs',
146
- text: AXTranslator.get('common.configs'),
147
- onClick: function () {
148
- _this.openConfigDialog();
149
- }
150
- });
151
- }
152
- this.configMenuItem[0].items.push({
153
- name: 'save',
154
- icon: 'far fa-save',
155
- text: AXTranslator.get('common.save-as'),
156
- onClick: function () {
157
- _this.openSaveDialog();
158
- }
159
- });
160
- if (true) {
161
- this.configMenuItem[0].items.push({
162
- name: 'remove',
163
- icon: 'far fa-times',
164
- style: 'ax danger blank',
165
- text: AXTranslator.get('common.remove'),
166
- onClick: function () {
167
- _this.onRemove.emit(_this);
168
- }
169
- });
170
- }
171
- this._hasMenu = this.configMenuItem[0].items.length > 0;
172
- this.cdr.detectChanges();
173
- return [2 /*return*/];
174
- }
175
- });
176
- });
177
- };
178
- AXWidgetHostComponent.prototype.setSizeFromOptions = function () {
179
- var _this = this;
180
- this._widget.getValue('widgetSize').then(function (c) {
181
- var oldSizeX = _this.sizeX;
182
- var oldSizeY = _this.sizeY;
183
- if (c && Array.isArray(c) && (oldSizeX !== c[0] || oldSizeY !== c[1])) {
184
- _this.config.sizeX = _this.sizeX = c[0];
185
- _this.config.sizeY = _this.sizeY = c[1];
186
- _this.onResized.emit({
187
- component: _this._widget,
188
- config: _this.config
189
- });
190
- }
191
- _this.cdr.detectChanges();
192
- });
193
- };
194
- AXWidgetHostComponent.prototype.remove = function (e) {
195
- e.preventDefault();
196
- e.stopPropagation();
197
- this.onRemove.emit(this);
198
- return false;
199
- };
200
- AXWidgetHostComponent.prototype.handleConfig = function (e) {
201
- e.preventDefault();
202
- e.stopPropagation();
203
- this.openConfigDialog();
204
- return false;
205
- };
206
- AXWidgetHostComponent.prototype.openConfigDialog = function () {
207
- var _this = this;
208
- var ppp = this.getMergedProps();
209
- this.popup.open(AXWidgetConfigComponent, {
210
- title: AXTranslator.get('common.configs'),
211
- size: 'sm',
212
- data: {
213
- props: ppp.map(function (c) { return ({ property: c.options, value: _this._widget[c.options.name] }); }),
214
- widget: this.widget
215
- }
216
- }).then(function (c) {
217
- if (c.data) {
218
- if (!_this.config.options) {
219
- _this.config.options = {};
220
- }
221
- c.data.forEach(function (p) {
222
- _this._widget.setValue(p.property.name, p.value);
223
- _this.config.options[p.property.name] = p.value;
224
- });
225
- _this.emitConfigChanged();
226
- _this._widget.redraw();
227
- _this.cdr.detectChanges();
228
- }
229
- });
230
- };
231
- AXWidgetHostComponent.prototype.openSaveDialog = function () {
232
- var _this = this;
233
- var ppp = this.getMergedProps();
234
- this.popup.open(AXWidgetSaveComponent, {
235
- title: AXTranslator.get('common.save-as'),
236
- size: 'sm',
237
- data: {
238
- config: this.config,
239
- props: ppp.map(function (c) { return ({ property: c.options, value: _this._widget[c.options.name] }); })
240
- }
241
- }).then(function (c) {
242
- if (c.data) {
243
- _this.onSave.emit({
244
- component: _this._widget,
245
- data: c.data
246
- });
247
- }
248
- });
249
- };
250
- AXWidgetHostComponent.prototype.handleOptionClick = function (e) {
251
- e.preventDefault();
252
- e.stopPropagation();
253
- this.openConfigDialog();
254
- return false;
255
- };
256
- AXWidgetHostComponent.prototype.ngOnDestroy = function () {
257
- this.vc.clear();
258
- if (this.componentRef) {
259
- this.componentRef.destroy();
260
- }
261
- };
262
- AXWidgetHostComponent.prototype.getMergedProps = function () {
263
- var ppp = AXObjectUtil.deepCopy(AXPropertyDecorators.getProperties(this._widget));
264
- var _loop_1 = function (key) {
265
- if (Object.prototype.hasOwnProperty.call(this_1.config.props, key)) {
266
- var newP = this_1.config.props[key];
267
- var existPropDec = ppp.find(function (p) { return p.property === key; });
268
- if (existPropDec) {
269
- Object.assign(existPropDec.options, newP);
270
- }
271
- }
272
- };
273
- var this_1 = this;
274
- for (var key in this.config.props) {
275
- _loop_1(key);
276
- }
277
- return ppp;
278
- };
279
- AXWidgetHostComponent.prototype.emitConfigChanged = function () {
280
- this.onConfigChanged.emit({
281
- component: this._widget,
282
- config: this.config
283
- });
284
- };
285
- AXWidgetHostComponent.ctorParameters = function () { return [
286
- { type: ElementRef },
287
- { type: ComponentFactoryResolver },
288
- { type: AXRenderService },
289
- { type: ChangeDetectorRef },
290
- { type: AXPopupService },
291
- { type: AXLoadingService }
292
- ]; };
293
- __decorate([
294
- Input(),
295
- __metadata("design:type", Function)
296
- ], AXWidgetHostComponent.prototype, "provideValue", void 0);
297
- __decorate([
298
- Output(),
299
- __metadata("design:type", EventEmitter)
300
- ], AXWidgetHostComponent.prototype, "onRemove", void 0);
301
- __decorate([
302
- Output(),
303
- __metadata("design:type", EventEmitter)
304
- ], AXWidgetHostComponent.prototype, "onConfigChanged", void 0);
305
- __decorate([
306
- Output(),
307
- __metadata("design:type", EventEmitter)
308
- ], AXWidgetHostComponent.prototype, "onResized", void 0);
309
- __decorate([
310
- Output(),
311
- __metadata("design:type", EventEmitter)
312
- ], AXWidgetHostComponent.prototype, "onSave", void 0);
313
- __decorate([
314
- Input(),
315
- __metadata("design:type", Object)
316
- ], AXWidgetHostComponent.prototype, "config", void 0);
317
- __decorate([
318
- ViewChild('vc', { read: ViewContainerRef }),
319
- __metadata("design:type", ViewContainerRef)
320
- ], AXWidgetHostComponent.prototype, "vc", void 0);
321
- __decorate([
322
- HostBinding('attr.data-size-x'),
323
- Input(),
324
- __metadata("design:type", Number)
325
- ], AXWidgetHostComponent.prototype, "sizeX", void 0);
326
- __decorate([
327
- HostBinding('attr.data-size-y'),
328
- Input(),
329
- __metadata("design:type", Number)
330
- ], AXWidgetHostComponent.prototype, "sizeY", void 0);
331
- __decorate([
332
- HostBinding('attr.data-col'),
333
- Input(),
334
- __metadata("design:type", Number)
335
- ], AXWidgetHostComponent.prototype, "col", void 0);
336
- __decorate([
337
- HostBinding('attr.data-row'),
338
- Input(),
339
- __metadata("design:type", Number)
340
- ], AXWidgetHostComponent.prototype, "row", void 0);
341
- AXWidgetHostComponent = __decorate([
342
- Component({
343
- selector: 'ax-widget-host',
344
- 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\" aria-hidden=\"true\"></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\" aria-hidden=\"true\"></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\" aria-hidden=\"true\"></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>",
345
- host: { class: 'ax widget-host', tabindex: '0' },
346
- encapsulation: ViewEncapsulation.None,
347
- changeDetection: ChangeDetectionStrategy.OnPush
348
- }),
349
- __metadata("design:paramtypes", [ElementRef,
350
- ComponentFactoryResolver,
351
- AXRenderService,
352
- ChangeDetectorRef,
353
- AXPopupService,
354
- AXLoadingService])
355
- ], AXWidgetHostComponent);
356
- return AXWidgetHostComponent;
357
- }());
358
- export { AXWidgetHostComponent };
359
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2lkZ2V0LWhvc3QuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGFjb3JleC9sYXlvdXQvIiwic291cmNlcyI6WyJsaWIvd2lkZ2V0LWJvYXJkL3dpZGdldC1ob3N0LmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUNILFNBQVMsRUFDVCxpQkFBaUIsRUFBRSxLQUFLLEVBQ3hCLFVBQVUsRUFBRSxXQUFXLEVBQUUsd0JBQXdCLEVBQUUsU0FBUyxFQUM1RCxnQkFBZ0IsRUFBRSxNQUFNLEVBQUUsWUFBWSxFQUFFLHVCQUF1QixFQUMvRCxpQkFBaUIsRUFBRSxZQUFZLEVBQ2xDLE1BQU0sZUFBZSxDQUFDO0FBRXZCLE9BQU8sRUFBRSxZQUFZLEVBQUUsZUFBZSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBQzdELE9BQU8sRUFBRSxjQUFjLEVBQUUsb0JBQW9CLEVBQUUsbUJBQW1CLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNqSCxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUVwRSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBQzVDLE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBY2hFO0lBK0VJLCtCQUNZLEdBQStCLEVBQy9CLHdCQUFrRCxFQUNsRCxlQUFnQyxFQUNoQy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ub25CdXN5Q2hhbmdlZC5zdWJzY3JpYmUoKGQpID0+IHtcclxuICAgICAgICAgICAgICAgIGlmICghdGhpcy5fd2lkZ2V0LndpZGdldFNpemUpIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLl93aWRnZXQuc2V0VmFsdWUoJ3dpZGdldFNpemUnLCBbdGhpcy5zaXplWCwgdGhpcy5zaXplWV0pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRTaXplRnJvbU9wdGlvbnMoKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHRoaXMuaXNMb2FkaW5nID0gZC52YWx1ZTtcclxuICAgICAgICAgICAgICAgIHRoaXMuY2RyLmRldGVjdENoYW5nZXMoKTtcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0aGlzLl93aWRnZXQub25Db25maWd1cmVkQ2hhbmdlZCkge1xyXG4gICAgICAgICAgICB0aGlzLl93aWRnZXQub25Db25maWd1cmVkQ2hhbmdlZC5zdWJzY3JpYmUoKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5zZXRTaXplRnJvbU9wdGlvbnMoKTtcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vXHJcbiAgICAgICAgaWYgKHRoaXMuY29uZmlnLm9wdGlvbnMpIHtcclxuICAgICAgICAgICAgT2JqZWN0LmFzc2lnbih0aGlzLl93aWRnZXQsIHRoaXMuY29uZmlnLm9wdGlvbnMpO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLl9oYXNQcm9wcyA9IEFYUHJvcGVydHlEZWNvcmF0b3JzLmdldFByb3BlcnRpZXModGhpcy5fd2lkZ2V0KS5sZW5ndGggPiAwO1xyXG5cclxuICAgICAgICB0aGlzLmlzTG9hZGluZyA9IGZhbHNlO1xyXG4gICAgICAgIHRoaXMuY29uZmlnWydfX21ldGFfXyddLmluc3RhbmNlID0gdGhpcztcclxuICAgICAgICB0aGlzLl93aWRnZXRbJ19fbWV0YV9fJ10gPSB7fTtcclxuICAgICAgICB0aGlzLl93aWRnZXRbJ19fbWV0YV9fJ10uY29uZmlnID0gdGhpcy5jb25maWc7XHJcbiAgICAgICAgLy9cclxuICAgICAgICB0aGlzLmNvbmZpZ01lbnVJdGVtWzBdLml0ZW1zLnB1c2goe1xyXG4gICAgICAgICAgICBuYW1lOiAncmVmcmVzaCcsXHJcbiAgICAgICAgICAgIGljb246ICdmYXIgZmEtdW5kbycsXHJcbiAgICAgICAgICAgIHRleHQ6IEFYVHJhbnNsYXRvci5nZXQoJ2NvbW1vbi5yZWZyZXNoJyksXHJcbiAgICAgICAgICAgIG9uQ2xpY2s6ICgpID0+IHtcclxuICAgICAgICAgICAgICAgIHRoaXM/LndpZGdldD8ucmVmcmVzaCgpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgLy9cclxuICAgICAgICBpZiAodGhpcy5faGFzUHJvcHMpIHtcclxuICAgICAgICAgICAgdGhpcy5jb25maWdNZW51SXRlbVswXS5pdGVtcy5wdXNoKHtcclxuICAgICAgICAgICAgICAgIG5hbWU6ICdjb25maWdzJyxcclxuICAgICAgICAgICAgICAgIGljb246ICdmYXIgZmEtY29ncycsXHJcbiAgICAgICAgICAgICAgICB0ZXh0OiBBWFRyYW5zbGF0b3IuZ2V0KCdjb21tb24uY29uZmlncycpLFxyXG4gICAgICAgICAgICAgICAgb25DbGljazogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3BlbkNvbmZpZ0RpYWxvZygpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5jb25maWdNZW51SXRlbVswXS5pdGVtcy5wdXNoKHtcclxuICAgICAgICAgICAgbmFtZTogJ3NhdmUnLFxyXG4gICAgICAgICAgICBpY29uOiAnZmFyIGZhLXNhdmUnLFxyXG4gICAgICAgICAgICB0ZXh0OiBBWFRyYW5zbGF0b3IuZ2V0KCdjb21tb24uc2F2ZS1hcycpLFxyXG4gICAgICAgICAgICBvbkNsaWNrOiAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLm9wZW5TYXZlRGlhbG9nKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgICAgICBpZiAodHJ1ZSkge1xyXG4gICAgICAgICAgICB0aGlzLmNvbmZpZ01lbnVJdGVtWzBdLml0ZW1zLnB1c2goe1xyXG4gICAgICAgICAgICAgICAgbmFtZTogJ3JlbW92ZScsXHJcbiAgICAgICAgICAgICAgICBpY29uOiAnZmFyIGZhLXRpbWVzJyxcclxuICAgICAgICAgICAgICAgIHN0eWxlOiAnYXggZGFuZ2VyIGJsYW5rJyxcclxuICAgICAgICAgICAgICAgIHRleHQ6IEFYVHJhbnNsYXRvci5nZXQoJ2NvbW1vbi5yZW1vdmUnKSxcclxuICAgICAgICAgICAgICAgIG9uQ2xpY2s6ICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLm9uUmVtb3ZlLmVtaXQodGhpcyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLl9oYXNNZW51ID0gdGhpcy5jb25maWdNZW51SXRlbVswXS5pdGVtcy5sZW5ndGggPiAwO1xyXG4gICAgICAgIHRoaXMuY2RyLmRldGVjdENoYW5nZXMoKTtcclxuICAgIH1cclxuXHJcbiAgICBASG9zdEJpbmRpbmcoJ2F0dHIuZGF0YS1zaXplLXgnKVxyXG4gICAgQElucHV0KClcclxuICAgIHNpemVYOiBudW1iZXIgPSAxO1xyXG5cclxuICAgIEBIb3N0QmluZGluZygnYXR0ci5kYXRhLXNpemUteScpXHJcbiAgICBASW5wdXQoKVxyXG4gICAgc2l6ZVk6IG51bWJlciA9IDE7XHJcblxyXG4gICAgQEhvc3RCaW5kaW5nKCdhdHRyLmRhdGEtY29sJylcclxuICAgIEBJbnB1dCgpXHJcbiAgICBjb2w6IG51bWJlciA9IDE7XHJcblxyXG5cclxuICAgIEBIb3N0QmluZGluZygnYXR0ci5kYXRhLXJvdycpXHJcbiAgICBASW5wdXQoKVxyXG4gICAgcm93OiBudW1iZXIgPSAxO1xyXG5cclxuXHJcbiAgICBwcml2YXRlIHNldFNpemVGcm9tT3B0aW9ucygpIHtcclxuICAgICAgICB0aGlzLl93aWRnZXQuZ2V0VmFsdWUoJ3dpZGdldFNpemUnKS50aGVuKGMgPT4ge1xyXG4gICAgICAgICAgICBjb25zdCBvbGRTaXplWCA9IHRoaXMuc2l6ZVg7XHJcbiAgICAgICAgICAgIGNvbnN0IG9sZFNpemVZID0gdGhpcy5zaXplWTtcclxuICAgICAgICAgICAgaWYgKGMgJiYgQXJyYXkuaXNBcnJheShjKSAmJiAob2xkU2l6ZVggIT09IGNbMF0gfHwgb2xkU2l6ZVkgIT09IGNbMV0pKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmNvbmZpZy5zaXplWCA9IHRoaXMuc2l6ZVggPSBjWzBdO1xyXG4gICAgICAgICAgICAgICAgdGhpcy5jb25maWcuc2l6ZVkgPSB0aGlzLnNpemVZID0gY1sxXTtcclxuICAgICAgICAgICAgICAgIHRoaXMub25SZXNpemVkLmVtaXQoe1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudDogdGhpcy5fd2lkZ2V0LFxyXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZzogdGhpcy5jb25maWdcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHRoaXMuY2RyLmRldGVjdENoYW5nZXMoKTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuXHJcbiAgICByZW1vdmUoZTogTW91c2VFdmVudCkge1xyXG4gICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcclxuICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpO1xyXG4gICAgICAgIHRoaXMub25SZW1vdmUuZW1pdCh0aGlzKTtcclxuICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICB9XHJcblxyXG4gICAgaGFuZGxlQ29uZmlnKGU6IE1vdXNlRXZlbnQpIHtcclxuICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTtcclxuICAgICAgICB0aGlzLm9wZW5Db25maWdEaWFsb2coKTtcclxuICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICB9XHJcblxyXG4gICAgcHJpdmF0ZSBvcGVuQ29uZmlnRGlhbG9nKCkge1xyXG4gICAgICAgIGNvbnN0IHBwcCA9IHRoaXMuZ2V0TWVyZ2VkUHJvcHMoKTtcclxuICAgICAgICB0aGlzLnBvcHVwLm9wZW4oQVhXaWRnZXRDb25maWdDb21wb25lbnQsIHtcclxuICAgICAgICAgICAgdGl0bGU6IEFYVHJhbnNsYXRvci5nZXQoJ2NvbW1vbi5jb25maWdzJyksXHJcbiAgICAgICAgICAgIHNpemU6ICdzbScsXHJcbiAgICAgICAgICAgIGRhdGE6IHtcclxuICAgICAgICAgICAgICAgIHByb3BzOiBwcHAubWFwKGMgPT4gKHsgcHJvcGVydHk6IGMub3B0aW9ucywgdmFsdWU6IHRoaXMuX3dpZGdldFtjLm9wdGlvbnMubmFtZV0gfSkpLFxyXG4gICAgICAgICAgICAgICAgd2lkZ2V0OiB0aGlzLndpZGdldFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSkudGhlbihjID0+IHtcclxuICAgICAgICAgICAgaWYgKGMuZGF0YSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLmNvbmZpZy5vcHRpb25zKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jb25maWcub3B0aW9ucyA9IHt9O1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgYy5kYXRhLmZvckVhY2gocCA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fd2lkZ2V0LnNldFZhbHVlKHAucHJvcGVydHkubmFtZSwgcC52YWx1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jb25maWcub3B0aW9uc1twLnByb3BlcnR5Lm5hbWVdID0gcC52YWx1ZTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgdGhpcy5lbWl0Q29uZmlnQ2hhbmdlZCgpO1xyXG4gICAgICAgICAgICAgICAgdGhpcy5fd2lkZ2V0LnJlZHJhdygpO1xyXG4gICAgICAgICAgICAgICAgdGhpcy5jZHIuZGV0ZWN0Q2hhbmdlcygpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcblxyXG4gICAgcHJpdmF0ZSBvcGVuU2F2ZURpYWxvZygpIHtcclxuICAgICAgICBjb25zdCBwcHAgPSB0aGlzLmdldE1lcmdlZFByb3BzKCk7XHJcbiAgICAgICAgdGhpcy5wb3B1cC5vcGVuKEFYV2lkZ2V0U2F2ZUNvbXBvbmVudCwge1xyXG4gICAgICAgICAgICB0aXRsZTogQVhUcmFuc2xhdG9yLmdldCgnY29tbW9uLnNhdmUtYXMnKSxcclxuICAgICAgICAgICAgc2l6ZTogJ3NtJyxcclxuICAgICAgICAgICAgZGF0YToge1xyXG4gICAgICAgICAgICAgICAgY29uZmlnOiB0aGlzLmNvbmZpZyxcclxuICAgICAgICAgICAgICAgIHByb3BzOiBwcHAubWFwKGMgPT4gKHsgcHJvcGVydHk6IGMub3B0aW9ucywgdmFsdWU6IHRoaXMuX3dpZGdldFtjLm9wdGlvbnMubmFtZV0gfSkpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KS50aGVuKGMgPT4ge1xyXG4gICAgICAgICAgICBpZiAoYy5kYXRhKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLm9uU2F2ZS5lbWl0KHtcclxuICAgICAgICAgICAgICAgICAgICBjb21wb25lbnQ6IHRoaXMuX3dpZGdldCxcclxuICAgICAgICAgICAgICAgICAgICBkYXRhOiBjLmRhdGFcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcblxyXG5cclxuXHJcbiAgICBoYW5kbGVPcHRpb25DbGljayhlOiBNb3VzZUV2ZW50KSB7XHJcbiAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xyXG4gICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7XHJcbiAgICAgICAgdGhpcy5vcGVuQ29uZmlnRGlhbG9nKCk7XHJcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgfVxyXG5cclxuICAgIG5nT25EZXN0cm95KCkge1xyXG4gICAgICAgIHRoaXMudmMuY2xlYXIoKTtcclxuICAgICAgICBpZiAodGhpcy5jb21wb25lbnRSZWYpIHtcclxuICAgICAgICAgICAgdGhpcy5jb21wb25lbnRSZWYuZGVzdHJveSgpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBwcml2YXRlIGdldE1lcmdlZFByb3BzKCk6IEFYUHJvcGVydHlEZWNvcmF0b3JbXSB7XHJcbiAgICAgICAgY29uc3QgcHBwID0gQVhPYmplY3RVdGlsLmRlZXBDb3B5KEFYUHJvcGVydHlEZWNvcmF0b3JzLmdldFByb3BlcnRpZXModGhpcy5fd2lkZ2V0KSkgYXMgQVhQcm9wZXJ0eURlY29yYXRvcltdO1xyXG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIHRoaXMuY29uZmlnLnByb3BzKSB7XHJcbiAgICAgICAgICAgIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwodGhpcy5jb25maWcucHJvcHMsIGtleSkpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IG5ld1AgPSB0aGlzLmNvbmZpZy5wcm9wc1trZXldO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZXhpc3RQcm9wRGVjID0gcHBwLmZpbmQocCA9PiBwLnByb3BlcnR5ID09PSBrZXkpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGV4aXN0UHJvcERlYykge1xyXG4gICAgICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24oZXhpc3RQcm9wRGVjLm9wdGlvbnMsIG5ld1ApO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBwcHA7XHJcbiAgICB9XHJcblxyXG4gICAgcHJpdmF0ZSBlbWl0Q29uZmlnQ2hhbmdlZCgpIHtcclxuICAgICAgICB0aGlzLm9uQ29uZmlnQ2hhbmdlZC5lbWl0KHtcclxuICAgICAgICAgICAgY29tcG9uZW50OiB0aGlzLl93aWRnZXQsXHJcbiAgICAgICAgICAgIGNvbmZpZzogdGhpcy5jb25maWdcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuXHJcbn0iXX0=