@acorex/layout 6.5.29 → 6.5.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. package/README.md +1 -1
  2. package/acorex-layout.d.ts +5 -5
  3. package/esm2020/acorex-layout.mjs +4 -4
  4. package/esm2020/lib/widget-board/editors/widget-size-editor/widget-size.editor.mjs +46 -46
  5. package/esm2020/lib/widget-board/editors/widget-size-editor/widget-size.module.mjs +21 -21
  6. package/esm2020/lib/widget-board/widget-board.component.mjs +450 -450
  7. package/esm2020/lib/widget-board/widget-board.module.mjs +111 -111
  8. package/esm2020/lib/widget-board/widget-config.component.mjs +82 -82
  9. package/esm2020/lib/widget-board/widget-host.component.mjs +295 -295
  10. package/esm2020/lib/widget-board/widget-save.component.mjs +79 -79
  11. package/esm2020/lib/widget-board/widget.class.mjs +127 -127
  12. package/esm2020/public-api.mjs +7 -7
  13. package/fesm2015/acorex-layout.mjs +1147 -1147
  14. package/fesm2015/acorex-layout.mjs.map +1 -1
  15. package/fesm2020/acorex-layout.mjs +1140 -1140
  16. package/fesm2020/acorex-layout.mjs.map +1 -1
  17. package/lib/widget-board/editors/widget-size-editor/widget-size.editor.d.ts +19 -19
  18. package/lib/widget-board/editors/widget-size-editor/widget-size.module.d.ts +10 -10
  19. package/lib/widget-board/widget-board.component.d.ts +61 -61
  20. package/lib/widget-board/widget-board.module.d.ts +18 -18
  21. package/lib/widget-board/widget-config.component.d.ts +23 -23
  22. package/lib/widget-board/widget-host.component.d.ts +52 -52
  23. package/lib/widget-board/widget-save.component.d.ts +19 -19
  24. package/lib/widget-board/widget.class.d.ts +58 -58
  25. package/package.json +1 -1
  26. package/public-api.d.ts +6 -6
@@ -1,295 +1,295 @@
1
- import { Component, ViewEncapsulation, Input, ElementRef, HostBinding, ComponentFactoryResolver, ViewChild, ViewContainerRef, Output, EventEmitter, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
2
- import { AXObjectUtil, AXRenderService } from '@acorex/core';
3
- import { AXPopupService, AXPropertyDecorators, AXLoadingService } from '@acorex/components';
4
- import { AXWidgetConfigComponent } from './widget-config.component';
5
- import { AXTranslator } from '@acorex/core';
6
- import { AXWidgetSaveComponent } from './widget-save.component';
7
- import * as i0 from "@angular/core";
8
- import * as i1 from "@acorex/core";
9
- import * as i2 from "@acorex/components";
10
- import * as i3 from "@angular/common";
11
- export class AXWidgetHostComponent {
12
- constructor(ref, componentFactoryResolver, rendererService, cdr, popup, loadingService) {
13
- this.ref = ref;
14
- this.componentFactoryResolver = componentFactoryResolver;
15
- this.rendererService = rendererService;
16
- this.cdr = cdr;
17
- this.popup = popup;
18
- this.loadingService = loadingService;
19
- this._hasProps = false;
20
- this._hasMenu = false;
21
- this.configMenuItem = [
22
- {
23
- icon: 'far fa-ellipsis-h',
24
- items: []
25
- }
26
- ];
27
- this.onRemove = new EventEmitter();
28
- this.onConfigChanged = new EventEmitter();
29
- this.onResized = new EventEmitter();
30
- this.onSave = new EventEmitter();
31
- this.readonly = false;
32
- this._isLoading = false;
33
- this.sizeX = 1;
34
- this.sizeY = 1;
35
- this.col = 1;
36
- this.row = 1;
37
- }
38
- get widget() {
39
- return this._widget;
40
- }
41
- get element() {
42
- return this.ref.nativeElement;
43
- }
44
- get isLoading() {
45
- return this._isLoading;
46
- }
47
- set isLoading(v) {
48
- this._isLoading = v;
49
- if (this._loadingId && !v) {
50
- this.loadingService.hide(this._loadingId);
51
- this._loadingId = null;
52
- }
53
- if (v) {
54
- this._loadingId = this.loadingService.show(this.ref.nativeElement);
55
- }
56
- }
57
- get isConfigured() {
58
- return this._widget?.isConfigured || false;
59
- }
60
- ngOnInit() {
61
- this.isLoading = true;
62
- }
63
- async ngAfterViewInit() {
64
- let component;
65
- if (typeof this.config.component === 'string') {
66
- const route = await this.rendererService.findLoadedComponentByRoute(this.config.component, 20);
67
- component = route?.component;
68
- }
69
- else if (typeof this.config.component === 'function') {
70
- component = this.config.component;
71
- }
72
- if (component == null) {
73
- console.error(`Invalid Widget Component!`, this.config);
74
- this.onRemove.emit(this);
75
- return;
76
- }
77
- const widgetFactory = this.componentFactoryResolver.resolveComponentFactory(component);
78
- this.componentRef = this.vc.createComponent(widgetFactory);
79
- this._widget = this.componentRef.instance;
80
- this._widget.provideValue = this.provideValue;
81
- if (this._widget.onBusyChanged) {
82
- this._widget.onBusyChanged.subscribe((d) => {
83
- if (!this._widget.widgetSize) {
84
- this._widget.setValue('widgetSize', [this.sizeX, this.sizeY]);
85
- }
86
- else {
87
- this.setSizeFromOptions();
88
- }
89
- this.isLoading = d.value;
90
- this.cdr.detectChanges();
91
- });
92
- }
93
- if (this._widget.onConfiguredChanged) {
94
- this._widget.onConfiguredChanged.subscribe(() => {
95
- this.setSizeFromOptions();
96
- });
97
- }
98
- //
99
- if (this.config.options) {
100
- Object.assign(this._widget, this.config.options);
101
- }
102
- this._hasProps = AXPropertyDecorators.getProperties(this._widget).length > 0;
103
- this.isLoading = false;
104
- this.config['__meta__'].instance = this;
105
- this._widget['__meta__'] = {};
106
- this._widget['__meta__'].config = this.config;
107
- //
108
- this.configMenuItem[0].items.push({
109
- name: 'refresh',
110
- icon: 'far fa-undo',
111
- text: AXTranslator.get('common.refresh'),
112
- onClick: () => {
113
- this?.widget?.refresh();
114
- }
115
- });
116
- //
117
- if (this._hasProps) {
118
- this.configMenuItem[0].items.push({
119
- name: 'configs',
120
- icon: 'far fa-cogs',
121
- text: AXTranslator.get('common.configs'),
122
- onClick: () => {
123
- this.openConfigDialog();
124
- }
125
- });
126
- }
127
- this.configMenuItem[0].items.push({
128
- name: 'save',
129
- icon: 'far fa-save',
130
- text: AXTranslator.get('common.save-as'),
131
- onClick: () => {
132
- this.openSaveDialog();
133
- }
134
- });
135
- if (true) {
136
- this.configMenuItem[0].items.push({
137
- name: 'remove',
138
- icon: 'far fa-times',
139
- style: 'ax danger blank',
140
- text: AXTranslator.get('common.remove'),
141
- onClick: () => {
142
- this.onRemove.emit(this);
143
- }
144
- });
145
- }
146
- this._hasMenu = this.configMenuItem[0].items.length > 0;
147
- this.cdr.detectChanges();
148
- }
149
- setSizeFromOptions() {
150
- this._widget.getValue('widgetSize').then(c => {
151
- const oldSizeX = this.sizeX;
152
- const oldSizeY = this.sizeY;
153
- if (c && Array.isArray(c) && (oldSizeX !== c[0] || oldSizeY !== c[1])) {
154
- this.config.sizeX = this.sizeX = c[0];
155
- this.config.sizeY = this.sizeY = c[1];
156
- this.onResized.emit({
157
- component: this._widget,
158
- config: this.config
159
- });
160
- }
161
- this.cdr.detectChanges();
162
- });
163
- }
164
- remove(e) {
165
- e.preventDefault();
166
- e.stopPropagation();
167
- if (!this.readonly)
168
- this.onRemove.emit(this);
169
- return false;
170
- }
171
- handleConfig(e) {
172
- e.preventDefault();
173
- e.stopPropagation();
174
- if (!this.readonly)
175
- this.openConfigDialog();
176
- return false;
177
- }
178
- openConfigDialog() {
179
- const ppp = this.getMergedProps();
180
- this.popup.open(AXWidgetConfigComponent, {
181
- title: AXTranslator.get('common.configs'),
182
- size: 'sm',
183
- data: {
184
- props: ppp.map(c => ({ property: c.options, value: this._widget[c.options.name] })),
185
- widget: this.widget
186
- }
187
- }).then(c => {
188
- if (c.data) {
189
- if (!this.config.options) {
190
- this.config.options = {};
191
- }
192
- c.data.forEach(p => {
193
- this._widget.setValue(p.property.name, p.value);
194
- this.config.options[p.property.name] = p.value;
195
- });
196
- this.emitConfigChanged();
197
- this._widget.redraw();
198
- this.cdr.detectChanges();
199
- }
200
- });
201
- }
202
- openSaveDialog() {
203
- const ppp = this.getMergedProps();
204
- this.popup.open(AXWidgetSaveComponent, {
205
- title: AXTranslator.get('common.save-as'),
206
- size: 'sm',
207
- data: {
208
- config: this.config,
209
- props: ppp.map(c => ({ property: c.options, value: this._widget[c.options.name] }))
210
- }
211
- }).then(c => {
212
- if (c.data) {
213
- this.onSave.emit({
214
- component: this._widget,
215
- data: c.data
216
- });
217
- }
218
- });
219
- }
220
- handleOptionClick(e) {
221
- e.preventDefault();
222
- e.stopPropagation();
223
- this.openConfigDialog();
224
- return false;
225
- }
226
- ngOnDestroy() {
227
- this.vc.clear();
228
- if (this.componentRef) {
229
- this.componentRef.destroy();
230
- }
231
- }
232
- getMergedProps() {
233
- const ppp = AXObjectUtil.deepCopy(AXPropertyDecorators.getProperties(this._widget));
234
- for (const key in this.config.props) {
235
- if (Object.prototype.hasOwnProperty.call(this.config.props, key)) {
236
- const newP = this.config.props[key];
237
- const existPropDec = ppp.find(p => p.property === key);
238
- if (existPropDec) {
239
- Object.assign(existPropDec.options, newP);
240
- }
241
- }
242
- }
243
- return ppp;
244
- }
245
- emitConfigChanged() {
246
- this.onConfigChanged.emit({
247
- component: this._widget,
248
- config: this.config
249
- });
250
- }
251
- }
252
- AXWidgetHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetHostComponent, deps: [{ token: i0.ElementRef }, { token: i0.ComponentFactoryResolver }, { token: i1.AXRenderService }, { token: i0.ChangeDetectorRef }, { token: i2.AXPopupService }, { token: i2.AXLoadingService }], target: i0.ɵɵFactoryTarget.Component });
253
- AXWidgetHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: AXWidgetHostComponent, selector: "ax-widget-host", inputs: { provideValue: "provideValue", config: "config", readonly: "readonly", sizeX: "sizeX", sizeY: "sizeY", col: "col", row: "row" }, outputs: { onRemove: "onRemove", onConfigChanged: "onConfigChanged", onResized: "onResized", onSave: "onSave" }, host: { attributes: { "tabindex": "0" }, properties: { "attr.data-size-x": "this.sizeX", "attr.data-size-y": "this.sizeY", "attr.data-col": "this.col", "attr.data-row": "this.row" }, classAttribute: "ax widget-host" }, viewQueries: [{ propertyName: "vc", first: true, predicate: ["vc"], descendants: true, read: ViewContainerRef }], ngImport: i0, 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\" *ngIf=\"!readonly\"><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 && !readonly\">\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>", components: [{ type: i2.AXMenuComponent, selector: "ax-menu", inputs: ["menuTemplate", "rtl", "size", "selection", "mode", "target", "floatAlignment", "floatPlacemnet", "direction", "items"], outputs: ["onItemClick"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "trans": i1.AXTranslatorPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
254
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetHostComponent, decorators: [{
255
- type: Component,
256
- args: [{ selector: 'ax-widget-host', host: { class: 'ax widget-host', tabindex: '0' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, 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\" *ngIf=\"!readonly\"><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 && !readonly\">\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>" }]
257
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ComponentFactoryResolver }, { type: i1.AXRenderService }, { type: i0.ChangeDetectorRef }, { type: i2.AXPopupService }, { type: i2.AXLoadingService }]; }, propDecorators: { provideValue: [{
258
- type: Input
259
- }], onRemove: [{
260
- type: Output
261
- }], onConfigChanged: [{
262
- type: Output
263
- }], onResized: [{
264
- type: Output
265
- }], onSave: [{
266
- type: Output
267
- }], config: [{
268
- type: Input
269
- }], vc: [{
270
- type: ViewChild,
271
- args: ['vc', { read: ViewContainerRef }]
272
- }], readonly: [{
273
- type: Input
274
- }], sizeX: [{
275
- type: HostBinding,
276
- args: ['attr.data-size-x']
277
- }, {
278
- type: Input
279
- }], sizeY: [{
280
- type: HostBinding,
281
- args: ['attr.data-size-y']
282
- }, {
283
- type: Input
284
- }], col: [{
285
- type: HostBinding,
286
- args: ['attr.data-col']
287
- }, {
288
- type: Input
289
- }], row: [{
290
- type: HostBinding,
291
- args: ['attr.data-row']
292
- }, {
293
- type: Input
294
- }] } });
295
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2lkZ2V0LWhvc3QuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvYWNvcmV4L2xheW91dC9zcmMvbGliL3dpZGdldC1ib2FyZC93aWRnZXQtaG9zdC5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hY29yZXgvbGF5b3V0L3NyYy9saWIvd2lkZ2V0LWJvYXJkL3dpZGdldC1ob3N0LmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDSCxTQUFTLEVBQ1QsaUJBQWlCLEVBQUUsS0FBSyxFQUN4QixVQUFVLEVBQUUsV0FBVyxFQUFFLHdCQUF3QixFQUFFLFNBQVMsRUFDNUQsZ0JBQWdCLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSx1QkFBdUIsRUFDL0QsaUJBQWlCLEVBQ3BCLE1BQU0sZUFBZSxDQUFDO0FBRXZCLE9BQU8sRUFBRSxZQUFZLEVBQUUsZUFBZSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBQzdELE9BQU8sRUFBRSxjQUFjLEVBQUUsb0JBQW9CLEVBQXVCLGdCQUFnQixFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDakgsT0FBTyxFQUFFLHVCQUF1QixFQUFFLE1BQU0sMkJBQTJCLENBQUM7QU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50ID0gdGhpcy5jb25maWcuY29tcG9uZW50O1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoY29tcG9uZW50ID09IG51bGwpIHtcclxuICAgICAgICAgICAgY29uc29sZS5lcnJvcihgSW52YWxpZCBXaWRnZXQgQ29tcG9uZW50IWAsIHRoaXMuY29uZmlnKTtcclxuICAgICAgICAgICAgdGhpcy5vblJlbW92ZS5lbWl0KHRoaXMpO1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBjb25zdCB3aWRnZXRGYWN0b3J5ID0gdGhpcy5jb21wb25lbnRGYWN0b3J5UmVzb2x2ZXIucmVzb2x2ZUNvbXBvbmVudEZhY3RvcnkoY29tcG9uZW50KTtcclxuICAgICAgICB0aGlzLmNvbXBvbmVudFJlZiA9IHRoaXMudmMuY3JlYXRlQ29tcG9uZW50KHdpZGdldEZhY3RvcnkpO1xyXG4gICAgICAgIHRoaXMuX3dpZGdldCA9IHRoaXMuY29tcG9uZW50UmVmLmluc3RhbmNlIGFzIEFYV2lkZ2V0Q29tcG9uZW50O1xyXG4gICAgICAgIHRoaXMuX3dpZGdldC5wcm92aWRlVmFsdWUgPSB0aGlzLnByb3ZpZGVWYWx1ZTtcclxuICAgICAgICBpZiAodGhpcy5fd2lkZ2V0Lm9uQnVzeUNoYW5nZWQpIHtcclxuICAgICAgICAgICAgdGhpcy5fd2lkZ2V0Lm9uQnVzeUNoYW5nZWQuc3Vic2NyaWJlKChkKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuX3dpZGdldC53aWRnZXRTaXplKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fd2lkZ2V0LnNldFZhbHVlKCd3aWRnZXRTaXplJywgW3RoaXMuc2l6ZVgsIHRoaXMuc2l6ZVldKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHRo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ICAgICAgbmFtZTogJ3JlZnJlc2gnLFxyXG4gICAgICAgICAgICBpY29uOiAnZmFyIGZhLXVuZG8nLFxyXG4gICAgICAgICAgICB0ZXh0OiBBWFRyYW5zbGF0b3IuZ2V0KCdjb21tb24ucmVmcmVzaCcpLFxyXG4gICAgICAgICAgICBvbkNsaWNrOiAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICB0aGlzPy53aWRnZXQ/LnJlZnJlc2goKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIC8vXHJcbiAgICAgICAgaWYgKHRoaXMuX2hhc1Byb3BzKSB7XHJcbiAgICAgICAgICAgIHRoaXMuY29uZmlnTWVudUl0ZW1bMF0uaXRlbXMucHVzaCh7XHJcbiAgICAgICAgICAgICAgICBuYW1lOiAnY29uZmlncycsXHJcbiAgICAgICAgICAgICAgICBpY29uOiAnZmFyIGZhLWNvZ3MnLFxyXG4gICAgICAgICAgICAgICAgdGV4dDogQVhUcmFuc2xhdG9yLmdldCgnY29tbW9uLmNvbmZpZ3MnKSxcclxuICAgICAgICAgICAgICAgIG9uQ2xpY2s6ICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLm9wZW5Db25maWdEaWFsb2coKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMuY29uZmlnTWVudUl0ZW1bMF0uaXRlbXMucHVzaCh7XHJcbiAgICAgICAgICAgIG5hbWU6ICdzYXZlJyxcclxuICAgICAgICAgICAgaWNvbjogJ2ZhciBmYS1zYXZlJyxcclxuICAgICAgICAgICAgdGV4dDogQVhUcmFuc2xhdG9yLmdldCgnY29tbW9uLnNhdmUtYXMnKSxcclxuICAgICAgICAgICAgb25DbGljazogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5vcGVuU2F2ZURpYWxvZygpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgaWYgKHRydWUpIHtcclxuICAgICAgICAgICAgdGhpcy5jb25maWdNZW51SXRlbVswXS5pdGVtcy5wdXNoKHtcclxuICAgICAgICAgICAgICAgIG5hbWU6ICdyZW1vdmUnLFxyXG4gICAgICAgICAgICAgICAgaWNvbjogJ2ZhciBmYS10aW1lcycsXHJcbiAgICAgICAgICAgICAgICBzdHlsZTogJ2F4IGRhbmdlciBibGFuaycsXHJcbiAgICAgICAgICAgICAgICB0ZXh0OiBBWFRyYW5zbGF0b3IuZ2V0KCdjb21tb24ucmVtb3ZlJyksXHJcbiAgICAgICAgICAgICAgICBvbkNsaWNrOiAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vblJlbW92ZS5lbWl0KHRoaXMpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5faGFzTWVudSA9IHRoaXMuY29uZmlnTWVudUl0ZW1bMF0uaXRlbXMubGVuZ3RoID4gMDtcclxuICAgICAgICB0aGlzLmNkci5kZXRlY3RDaGFuZ2VzKCk7XHJcbiAgICB9XHJcblxyXG4gICAgQEhvc3RCaW5kaW5nKCdhdHRyLmRhdGEtc2l6ZS14JylcclxuICAgIEBJbnB1dCgpXHJcbiAgICBzaXplWDogbnVtYmVyID0gMTtcclxuXHJcbiAgICBASG9zdEJpbmRpbmcoJ2F0dHIuZGF0YS1zaXplLXknKVxyXG4gICAgQElucHV0KClcclxuICAgIHNpemVZOiBudW1iZXIgPSAxO1xyXG5cclxuICAgIEBIb3N0QmluZGluZygnYXR0ci5kYXRhLWNvbCcpXHJcbiAgICBASW5wdXQoKVxyXG4gICAgY29sOiBudW1iZXIgPSAxO1xyXG5cclxuXHJcbiAgICBASG9zdEJpbmRpbmcoJ2F0dHIuZGF0YS1yb3cnKVxyXG4gICAgQElucHV0KClcclxuICAgIHJvdzogbnVtYmVyID0gMTtcclxuXHJcblxyXG4gICAgcHJpdmF0ZSBzZXRTaXplRnJvbU9wdGlvbnMoKSB7XHJcbiAgICAgICAgdGhpcy5fd2lkZ2V0LmdldFZhbHVlKCd3aWRnZXRTaXplJykudGhlbihjID0+IHtcclxuICAgICAgICAgICAgY29uc3Qgb2xkU2l6ZVggPSB0aGlzLnNpemVYO1xyXG4gICAgICAgICAgICBjb25zdCBvbGRTaXplWSA9IHRoaXMuc2l6ZVk7XHJcbiAgICAgICAgICAgIGlmIChjICYmIEFycmF5LmlzQXJyYXkoYykgJiYgKG9sZFNpemVYICE9PSBjWzBdIHx8IG9sZFNpemVZICE9PSBjWzFdKSkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5jb25maWcuc2l6ZVggPSB0aGlzLnNpemVYID0gY1swXTtcclxuICAgICAgICAgICAgICAgIHRoaXMuY29uZmlnLnNpemVZID0gdGhpcy5zaXplWSA9IGNbMV07XHJcbiAgICAgICAgICAgICAgICB0aGlzLm9uUmVzaXplZC5lbWl0KHtcclxuICAgICAgICAgICAgICAgICAgICBjb21wb25lbnQ6IHRoaXMuX3dpZGdldCxcclxuICAgICAgICAgICAgICAgICAgICBjb25maWc6IHRoaXMuY29uZmlnXHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLmNkci5kZXRlY3RDaGFuZ2VzKCk7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcblxyXG4gICAgcmVtb3ZlKGU6IE1vdXNlRXZlbnQpIHtcclxuICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTtcclxuICAgICAgICBpZiAoIXRoaXMucmVhZG9ubHkpXHJcbiAgICAgICAgICAgIHRoaXMub25SZW1vdmUuZW1pdCh0aGlzKTtcclxuICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICB9XHJcblxyXG4gICAgaGFuZGxlQ29uZmlnKGU6IE1vdXNlRXZlbnQpIHtcclxuICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTtcclxuICAgICAgICBpZiAoIXRoaXMucmVhZG9ubHkpXHJcbiAgICAgICAgICAgIHRoaXMub3BlbkNvbmZpZ0RpYWxvZygpO1xyXG4gICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgIH1cclxuXHJcbiAgICBwcml2YXRlIG9wZW5Db25maWdEaWFsb2coKSB7XHJcbiAgICAgICAgY29uc3QgcHBwID0gdGhpcy5nZXRNZXJnZWRQcm9wcygpO1xyXG4gICAgICAgIHRoaXMucG9wdXAub3BlbihBWFdpZGdldENvbmZpZ0NvbXBvbmVudCwge1xyXG4gICAgICAgICAgICB0aXRsZTogQVhUcmFuc2xhdG9yLmdldCgnY29tbW9uLmNvbmZpZ3MnKSxcclxuICAgICAgICAgICAgc2l6ZTogJ3NtJyxcclxuICAgICAgICAgICAgZGF0YToge1xyXG4gICAgICAgICAgICAgICAgcHJvcHM6IHBwcC5tYXAoYyA9PiAoeyBwcm9wZXJ0eTogYy5vcHRpb25zLCB2YWx1ZTogdGhpcy5fd2lkZ2V0W2Mub3B0aW9ucy5uYW1lXSB9KSksXHJcbiAgICAgICAgICAgICAgICB3aWRnZXQ6IHRoaXMud2lkZ2V0XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KS50aGVuKGMgPT4ge1xyXG4gICAgICAgICAgICBpZiAoYy5kYXRhKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuY29uZmlnLm9wdGlvbnMpIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbmZpZy5vcHRpb25zID0ge307XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjLmRhdGEuZm9yRWFjaChwID0+IHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLl93aWRnZXQuc2V0VmFsdWUocC5wcm9wZXJ0eS5uYW1lLCBwLnZhbHVlKTtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbmZpZy5vcHRpb25zW3AucHJvcGVydHkubmFtZV0gPSBwLnZhbHVlO1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmVtaXRDb25maWdDaGFuZ2VkKCk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLl93aWRnZXQucmVkcmF3KCk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmNkci5kZXRlY3RDaGFuZ2VzKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgIH1cclxuXHJcbiAgICBwcml2YXRlIG9wZW5TYXZlRGlhbG9nKCkge1xyXG4gICAgICAgIGNvbnN0IHBwcCA9IHRoaXMuZ2V0TWVyZ2VkUHJvcHMoKTtcclxuICAgICAgICB0aGlzLnBvcHVwLm9wZW4oQVhXaWRnZXRTYXZlQ29tcG9uZW50LCB7XHJcbiAgICAgICAgICAgIHRpdGxlOiBBWFRyYW5zbGF0b3IuZ2V0KCdjb21tb24uc2F2ZS1hcycpLFxyXG4gICAgICAgICAgICBzaXplOiAnc20nLFxyXG4gICAgICAgICAgICBkYXRhOiB7XHJcbiAgICAgICAgICAgICAgICBjb25maWc6IHRoaXMuY29uZmlnLFxyXG4gICAgICAgICAgICAgICAgcHJvcHM6IHBwcC5tYXAoYyA9PiAoeyBwcm9wZXJ0eTogYy5vcHRpb25zLCB2YWx1ZTogdGhpcy5fd2lkZ2V0W2Mub3B0aW9ucy5uYW1lXSB9KSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pLnRoZW4oYyA9PiB7XHJcbiAgICAgICAgICAgIGlmIChjLmRhdGEpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMub25TYXZlLmVtaXQoe1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudDogdGhpcy5fd2lkZ2V0LFxyXG4gICAgICAgICAgICAgICAgICAgIGRhdGE6IGMuZGF0YVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgIH1cclxuXHJcblxyXG5cclxuICAgIGhhbmRsZU9wdGlvbkNsaWNrKGU6IE1vdXNlRXZlbnQpIHtcclxuICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTtcclxuICAgICAgICB0aGlzLm9wZW5Db25maWdEaWFsb2coKTtcclxuICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICB9XHJcblxyXG4gICAgbmdPbkRlc3Ryb3koKSB7XHJcbiAgICAgICAgdGhpcy52Yy5jbGVhcigpO1xyXG4gICAgICAgIGlmICh0aGlzLmNvbXBvbmVudFJlZikge1xyXG4gICAgICAgICAgICB0aGlzLmNvbXBvbmVudFJlZi5kZXN0cm95KCk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIHByaXZhdGUgZ2V0TWVyZ2VkUHJvcHMoKTogQVhQcm9wZXJ0eURlY29yYXRvcltdIHtcclxuICAgICAgICBjb25zdCBwcHAgPSBBWE9iamVjdFV0aWwuZGVlcENvcHkoQVhQcm9wZXJ0eURlY29yYXRvcnMuZ2V0UHJvcGVydGllcyh0aGlzLl93aWRnZXQpKSBhcyBBWFByb3BlcnR5RGVjb3JhdG9yW107XHJcbiAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gdGhpcy5jb25maWcucHJvcHMpIHtcclxuICAgICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbCh0aGlzLmNvbmZpZy5wcm9wcywga2V5KSkge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgbmV3UCA9IHRoaXMuY29uZmlnLnByb3BzW2tleV07XHJcbiAgICAgICAgICAgICAgICBjb25zdCBleGlzdFByb3BEZWMgPSBwcHAuZmluZChwID0+IHAucHJvcGVydHkgPT09IGtleSk7XHJcbiAgICAgICAgICAgICAgICBpZiAoZXhpc3RQcm9wRGVjKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihleGlzdFByb3BEZWMub3B0aW9ucywgbmV3UCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHBwcDtcclxuICAgIH1cclxuXHJcbiAgICBwcml2YXRlIGVtaXRDb25maWdDaGFuZ2VkKCkge1xyXG4gICAgICAgIHRoaXMub25Db25maWdDaGFuZ2VkLmVtaXQoe1xyXG4gICAgICAgICAgICBjb21wb25lbnQ6IHRoaXMuX3dpZGdldCxcclxuICAgICAgICAgICAgY29uZmlnOiB0aGlzLmNvbmZpZ1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG5cclxufSIsIjxkaXYgY2xhc3M9J3dpZGdldC1jb250YWluZXInPlxyXG4gICAgPGRpdiBjbGFzcz1cIndpZGdldC1jb25maWctb3ZlcmxheVwiICpuZ0lmPVwiIWlzQ29uZmlndXJlZFwiIChjbGljayk9XCJoYW5kbGVDb25maWcoJGV2ZW50KVwiPlxyXG4gICAgICAgIDxkaXYgY2xhc3M9XCJ3aWRnZXQtdGl0bGVcIj57e2NvbmZpZy50aXRsZX19PC9kaXY+XHJcbiAgICAgICAgPGRpdiBjbGFzcz1cIndpZGdldC1jb25maWctYm94XCI+XHJcbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb25maWctdGl0bGVcIj57eyAnd2lkZ2V0LWJvYXJkLmNvbmZpZ3VyZScgfCB0cmFuc319PC9kaXY+XHJcbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb25maWctaWNvblwiICpuZ0lmPVwiIXJlYWRvbmx5XCI+PGkgY2xhc3M9XCJmYXMgZmEtY29ncyBmYS01eFwiIGFyaWEtaGlkZGVuPVwidHJ1ZVwiPjwvaT48L2Rpdj5cclxuICAgICAgIC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25maWdNZW51SXRlbScgZGlyZWN0aW9uPVwiaG9yaXpvbnRhbFwiPjwvYXgtbWVudT5cclxuICAgIDwvZGl2PlxyXG4gICAgPCEtLSA8YXgtbG9hZGluZy1wYW5lbCBbdmlzaWJsZV09XCJpc0J1c3lcIj5cclxuICAgIDwvYXgtbG9hZGluZy1wYW5lbD4gLS0+XHJcbiAgICA8ZGl2IGNsYXNzPVwid2lkZ2V0LWNvbnRlbnRcIj5cclxuICAgICAgICA8bmctY29udGFpbmVyICN2Yz48L25nLWNvbnRhaW5lcj5cclxuICAgIDwvZGl2PlxyXG48L2Rpdj4iXX0=
1
+ import { Component, ViewEncapsulation, Input, ElementRef, HostBinding, ComponentFactoryResolver, ViewChild, ViewContainerRef, Output, EventEmitter, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
2
+ import { AXObjectUtil, AXRenderService } from '@acorex/core';
3
+ import { AXPopupService, AXPropertyDecorators, AXLoadingService } from '@acorex/components';
4
+ import { AXWidgetConfigComponent } from './widget-config.component';
5
+ import { AXTranslator } from '@acorex/core';
6
+ import { AXWidgetSaveComponent } from './widget-save.component';
7
+ import * as i0 from "@angular/core";
8
+ import * as i1 from "@acorex/core";
9
+ import * as i2 from "@acorex/components";
10
+ import * as i3 from "@angular/common";
11
+ export class AXWidgetHostComponent {
12
+ constructor(ref, componentFactoryResolver, rendererService, cdr, popup, loadingService) {
13
+ this.ref = ref;
14
+ this.componentFactoryResolver = componentFactoryResolver;
15
+ this.rendererService = rendererService;
16
+ this.cdr = cdr;
17
+ this.popup = popup;
18
+ this.loadingService = loadingService;
19
+ this._hasProps = false;
20
+ this._hasMenu = false;
21
+ this.configMenuItem = [
22
+ {
23
+ icon: 'far fa-ellipsis-h',
24
+ items: []
25
+ }
26
+ ];
27
+ this.onRemove = new EventEmitter();
28
+ this.onConfigChanged = new EventEmitter();
29
+ this.onResized = new EventEmitter();
30
+ this.onSave = new EventEmitter();
31
+ this.readonly = false;
32
+ this._isLoading = false;
33
+ this.sizeX = 1;
34
+ this.sizeY = 1;
35
+ this.col = 1;
36
+ this.row = 1;
37
+ }
38
+ get widget() {
39
+ return this._widget;
40
+ }
41
+ get element() {
42
+ return this.ref.nativeElement;
43
+ }
44
+ get isLoading() {
45
+ return this._isLoading;
46
+ }
47
+ set isLoading(v) {
48
+ this._isLoading = v;
49
+ if (this._loadingId && !v) {
50
+ this.loadingService.hide(this._loadingId);
51
+ this._loadingId = null;
52
+ }
53
+ if (v) {
54
+ this._loadingId = this.loadingService.show(this.ref.nativeElement);
55
+ }
56
+ }
57
+ get isConfigured() {
58
+ return this._widget?.isConfigured || false;
59
+ }
60
+ ngOnInit() {
61
+ this.isLoading = true;
62
+ }
63
+ async ngAfterViewInit() {
64
+ let component;
65
+ if (typeof this.config.component === 'string') {
66
+ const route = await this.rendererService.findLoadedComponentByRoute(this.config.component, 20);
67
+ component = route?.component;
68
+ }
69
+ else if (typeof this.config.component === 'function') {
70
+ component = this.config.component;
71
+ }
72
+ if (component == null) {
73
+ console.error(`Invalid Widget Component!`, this.config);
74
+ this.onRemove.emit(this);
75
+ return;
76
+ }
77
+ const widgetFactory = this.componentFactoryResolver.resolveComponentFactory(component);
78
+ this.componentRef = this.vc.createComponent(widgetFactory);
79
+ this._widget = this.componentRef.instance;
80
+ this._widget.provideValue = this.provideValue;
81
+ if (this._widget.onBusyChanged) {
82
+ this._widget.onBusyChanged.subscribe((d) => {
83
+ if (!this._widget.widgetSize) {
84
+ this._widget.setValue('widgetSize', [this.sizeX, this.sizeY]);
85
+ }
86
+ else {
87
+ this.setSizeFromOptions();
88
+ }
89
+ this.isLoading = d.value;
90
+ this.cdr.detectChanges();
91
+ });
92
+ }
93
+ if (this._widget.onConfiguredChanged) {
94
+ this._widget.onConfiguredChanged.subscribe(() => {
95
+ this.setSizeFromOptions();
96
+ });
97
+ }
98
+ //
99
+ if (this.config.options) {
100
+ Object.assign(this._widget, this.config.options);
101
+ }
102
+ this._hasProps = AXPropertyDecorators.getProperties(this._widget).length > 0;
103
+ this.isLoading = false;
104
+ this.config['__meta__'].instance = this;
105
+ this._widget['__meta__'] = {};
106
+ this._widget['__meta__'].config = this.config;
107
+ //
108
+ this.configMenuItem[0].items.push({
109
+ name: 'refresh',
110
+ icon: 'far fa-undo',
111
+ text: AXTranslator.get('common.refresh'),
112
+ onClick: () => {
113
+ this?.widget?.refresh();
114
+ }
115
+ });
116
+ //
117
+ if (this._hasProps) {
118
+ this.configMenuItem[0].items.push({
119
+ name: 'configs',
120
+ icon: 'far fa-cogs',
121
+ text: AXTranslator.get('common.configs'),
122
+ onClick: () => {
123
+ this.openConfigDialog();
124
+ }
125
+ });
126
+ }
127
+ this.configMenuItem[0].items.push({
128
+ name: 'save',
129
+ icon: 'far fa-save',
130
+ text: AXTranslator.get('common.save-as'),
131
+ onClick: () => {
132
+ this.openSaveDialog();
133
+ }
134
+ });
135
+ if (true) {
136
+ this.configMenuItem[0].items.push({
137
+ name: 'remove',
138
+ icon: 'far fa-times',
139
+ style: 'ax danger blank',
140
+ text: AXTranslator.get('common.remove'),
141
+ onClick: () => {
142
+ this.onRemove.emit(this);
143
+ }
144
+ });
145
+ }
146
+ this._hasMenu = this.configMenuItem[0].items.length > 0;
147
+ this.cdr.detectChanges();
148
+ }
149
+ setSizeFromOptions() {
150
+ this._widget.getValue('widgetSize').then(c => {
151
+ const oldSizeX = this.sizeX;
152
+ const oldSizeY = this.sizeY;
153
+ if (c && Array.isArray(c) && (oldSizeX !== c[0] || oldSizeY !== c[1])) {
154
+ this.config.sizeX = this.sizeX = c[0];
155
+ this.config.sizeY = this.sizeY = c[1];
156
+ this.onResized.emit({
157
+ component: this._widget,
158
+ config: this.config
159
+ });
160
+ }
161
+ this.cdr.detectChanges();
162
+ });
163
+ }
164
+ remove(e) {
165
+ e.preventDefault();
166
+ e.stopPropagation();
167
+ if (!this.readonly)
168
+ this.onRemove.emit(this);
169
+ return false;
170
+ }
171
+ handleConfig(e) {
172
+ e.preventDefault();
173
+ e.stopPropagation();
174
+ if (!this.readonly)
175
+ this.openConfigDialog();
176
+ return false;
177
+ }
178
+ openConfigDialog() {
179
+ const ppp = this.getMergedProps();
180
+ this.popup.open(AXWidgetConfigComponent, {
181
+ title: AXTranslator.get('common.configs'),
182
+ size: 'sm',
183
+ data: {
184
+ props: ppp.map(c => ({ property: c.options, value: this._widget[c.options.name] })),
185
+ widget: this.widget
186
+ }
187
+ }).then(c => {
188
+ if (c.data) {
189
+ if (!this.config.options) {
190
+ this.config.options = {};
191
+ }
192
+ c.data.forEach(p => {
193
+ this._widget.setValue(p.property.name, p.value);
194
+ this.config.options[p.property.name] = p.value;
195
+ });
196
+ this.emitConfigChanged();
197
+ this._widget.redraw();
198
+ this.cdr.detectChanges();
199
+ }
200
+ });
201
+ }
202
+ openSaveDialog() {
203
+ const ppp = this.getMergedProps();
204
+ this.popup.open(AXWidgetSaveComponent, {
205
+ title: AXTranslator.get('common.save-as'),
206
+ size: 'sm',
207
+ data: {
208
+ config: this.config,
209
+ props: ppp.map(c => ({ property: c.options, value: this._widget[c.options.name] }))
210
+ }
211
+ }).then(c => {
212
+ if (c.data) {
213
+ this.onSave.emit({
214
+ component: this._widget,
215
+ data: c.data
216
+ });
217
+ }
218
+ });
219
+ }
220
+ handleOptionClick(e) {
221
+ e.preventDefault();
222
+ e.stopPropagation();
223
+ this.openConfigDialog();
224
+ return false;
225
+ }
226
+ ngOnDestroy() {
227
+ this.vc.clear();
228
+ if (this.componentRef) {
229
+ this.componentRef.destroy();
230
+ }
231
+ }
232
+ getMergedProps() {
233
+ const ppp = AXObjectUtil.deepCopy(AXPropertyDecorators.getProperties(this._widget));
234
+ for (const key in this.config.props) {
235
+ if (Object.prototype.hasOwnProperty.call(this.config.props, key)) {
236
+ const newP = this.config.props[key];
237
+ const existPropDec = ppp.find(p => p.property === key);
238
+ if (existPropDec) {
239
+ Object.assign(existPropDec.options, newP);
240
+ }
241
+ }
242
+ }
243
+ return ppp;
244
+ }
245
+ emitConfigChanged() {
246
+ this.onConfigChanged.emit({
247
+ component: this._widget,
248
+ config: this.config
249
+ });
250
+ }
251
+ }
252
+ AXWidgetHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetHostComponent, deps: [{ token: i0.ElementRef }, { token: i0.ComponentFactoryResolver }, { token: i1.AXRenderService }, { token: i0.ChangeDetectorRef }, { token: i2.AXPopupService }, { token: i2.AXLoadingService }], target: i0.ɵɵFactoryTarget.Component });
253
+ AXWidgetHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: AXWidgetHostComponent, selector: "ax-widget-host", inputs: { provideValue: "provideValue", config: "config", readonly: "readonly", sizeX: "sizeX", sizeY: "sizeY", col: "col", row: "row" }, outputs: { onRemove: "onRemove", onConfigChanged: "onConfigChanged", onResized: "onResized", onSave: "onSave" }, host: { attributes: { "tabindex": "0" }, properties: { "attr.data-size-x": "this.sizeX", "attr.data-size-y": "this.sizeY", "attr.data-col": "this.col", "attr.data-row": "this.row" }, classAttribute: "ax widget-host" }, viewQueries: [{ propertyName: "vc", first: true, predicate: ["vc"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div class='widget-container'>\n <div class=\"widget-config-overlay\" *ngIf=\"!isConfigured\" (click)=\"handleConfig($event)\">\n <div class=\"widget-title\">{{config.title}}</div>\n <div class=\"widget-config-box\">\n <div class=\"config-title\">{{ 'widget-board.configure' | trans}}</div>\n <div class=\"config-icon\" *ngIf=\"!readonly\"><i class=\"fas fa-cogs fa-5x\" aria-hidden=\"true\"></i></div>\n </div>\n </div>\n <div class='widget-edit-overlay' >\n <div class='widget-edit-menu'>\n <button class=\"widget-edit-menu-button\" (click)=\"handleConfig($event)\"\n (mousedown)=\"$event.stopPropagation()\" *ngIf=\"_hasProps\" (mouseup)=\"$event.stopPropagation()\">\n <i class=\"far fa-cogs\" aria-hidden=\"true\"></i>\n </button>\n <button class=\"widget-edit-menu-button\" (click)=\"remove($event)\" (mousedown)=\"$event.stopPropagation()\"\n (mouseup)=\"$event.stopPropagation()\">\n <i class=\"far fa-times\" aria-hidden=\"true\"></i>\n </button>\n </div>\n\n </div>\n <div class=\"widget-options-menu\" *ngIf=\"_hasMenu && !readonly\">\n <ax-menu [items]='configMenuItem' direction=\"horizontal\"></ax-menu>\n </div>\n <!-- <ax-loading-panel [visible]=\"isBusy\">\n </ax-loading-panel> -->\n <div class=\"widget-content\">\n <ng-container #vc></ng-container>\n </div>\n</div>", components: [{ type: i2.AXMenuComponent, selector: "ax-menu", inputs: ["menuTemplate", "rtl", "size", "selection", "mode", "target", "floatAlignment", "floatPlacemnet", "direction", "items"], outputs: ["onItemClick"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "trans": i1.AXTranslatorPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
254
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetHostComponent, decorators: [{
255
+ type: Component,
256
+ args: [{ selector: 'ax-widget-host', host: { class: 'ax widget-host', tabindex: '0' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class='widget-container'>\n <div class=\"widget-config-overlay\" *ngIf=\"!isConfigured\" (click)=\"handleConfig($event)\">\n <div class=\"widget-title\">{{config.title}}</div>\n <div class=\"widget-config-box\">\n <div class=\"config-title\">{{ 'widget-board.configure' | trans}}</div>\n <div class=\"config-icon\" *ngIf=\"!readonly\"><i class=\"fas fa-cogs fa-5x\" aria-hidden=\"true\"></i></div>\n </div>\n </div>\n <div class='widget-edit-overlay' >\n <div class='widget-edit-menu'>\n <button class=\"widget-edit-menu-button\" (click)=\"handleConfig($event)\"\n (mousedown)=\"$event.stopPropagation()\" *ngIf=\"_hasProps\" (mouseup)=\"$event.stopPropagation()\">\n <i class=\"far fa-cogs\" aria-hidden=\"true\"></i>\n </button>\n <button class=\"widget-edit-menu-button\" (click)=\"remove($event)\" (mousedown)=\"$event.stopPropagation()\"\n (mouseup)=\"$event.stopPropagation()\">\n <i class=\"far fa-times\" aria-hidden=\"true\"></i>\n </button>\n </div>\n\n </div>\n <div class=\"widget-options-menu\" *ngIf=\"_hasMenu && !readonly\">\n <ax-menu [items]='configMenuItem' direction=\"horizontal\"></ax-menu>\n </div>\n <!-- <ax-loading-panel [visible]=\"isBusy\">\n </ax-loading-panel> -->\n <div class=\"widget-content\">\n <ng-container #vc></ng-container>\n </div>\n</div>" }]
257
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ComponentFactoryResolver }, { type: i1.AXRenderService }, { type: i0.ChangeDetectorRef }, { type: i2.AXPopupService }, { type: i2.AXLoadingService }]; }, propDecorators: { provideValue: [{
258
+ type: Input
259
+ }], onRemove: [{
260
+ type: Output
261
+ }], onConfigChanged: [{
262
+ type: Output
263
+ }], onResized: [{
264
+ type: Output
265
+ }], onSave: [{
266
+ type: Output
267
+ }], config: [{
268
+ type: Input
269
+ }], vc: [{
270
+ type: ViewChild,
271
+ args: ['vc', { read: ViewContainerRef }]
272
+ }], readonly: [{
273
+ type: Input
274
+ }], sizeX: [{
275
+ type: HostBinding,
276
+ args: ['attr.data-size-x']
277
+ }, {
278
+ type: Input
279
+ }], sizeY: [{
280
+ type: HostBinding,
281
+ args: ['attr.data-size-y']
282
+ }, {
283
+ type: Input
284
+ }], col: [{
285
+ type: HostBinding,
286
+ args: ['attr.data-col']
287
+ }, {
288
+ type: Input
289
+ }], row: [{
290
+ type: HostBinding,
291
+ args: ['attr.data-row']
292
+ }, {
293
+ type: Input
294
+ }] } });
295
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2lkZ2V0LWhvc3QuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJ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aGFuZ2VkKSB7XG4gICAgICAgICAgICB0aGlzLl93aWRnZXQub25CdXN5Q2hhbmdlZC5zdWJzY3JpYmUoKGQpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuX3dpZGdldC53aWRnZXRTaXplKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3dpZGdldC5zZXRWYWx1ZSgnd2lkZ2V0U2l6ZScsIFt0aGlzLnNpemVYLCB0aGlzLnNpemVZXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFNpemVGcm9tT3B0aW9ucygpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLmlzTG9hZGluZyA9IGQudmFsdWU7XG4gICAgICAgICAgICAgICAgdGhpcy5jZHIuZGV0ZWN0Q2hhbmdlcygpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMuX3dpZGdldC5vbkNvbmZpZ3VyZWRDaGFuZ2VkKSB7XG4gICAgICAgICAgICB0aGlzLl93aWRnZXQub25Db25maWd1cmVkQ2hhbmdlZC5zdWJzY3JpYmUoKCkgPT4ge1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0U2l6ZUZyb21PcHRpb25zKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICAvL1xuICAgICAgICBpZiAodGhpcy5jb25maWcub3B0aW9ucykge1xuICAgICAgICAgICAgT2JqZWN0LmFzc2lnbih0aGlzLl93aWRnZXQsIHRoaXMuY29uZmlnLm9wdGlvbnMpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuX2hhc1Byb3BzID0gQVhQcm9wZXJ0eURlY29yYXRvcnMuZ2V0UHJvcGVydGllcyh0aGlzLl93aWRnZXQpLmxlbmd0aCA+IDA7XG5cbiAgICAgICAgdGhpcy5pc0xvYWRpbmcgPSBmYWxzZTtcbiAgICAgICAgdGhpcy5jb25maWdbJ19fbWV0YV9fJ10uaW5zdGFuY2UgPSB0aGlzO1xuICAgICAgICB0aGlzLl93aWRnZXRbJ19fbWV0YV9fJ10gPSB7fTtcbiAgICAgICAgdGhpcy5fd2lkZ2V0WydfX21ldGFfXyddLmNvbmZpZyA9IHRoaXMuY29uZmlnO1xuICAgICAgICAvL1xuICAgICAgICB0aGlzLmNvbmZpZ01lbnVJdGVtWzBdLml0ZW1zLnB1c2goe1xuICAgICAgICAgICAgbmFtZTogJ3JlZnJlc2gnLFxuICAgICAgICAgICAgaWNvbjogJ2ZhciBmYS11bmRvJyxcbiAgICAgICAgICAgIHRleHQ6IEFYVHJhbnNsYXRvci5nZXQoJ2NvbW1vbi5yZWZyZXNoJyksXG4gICAgICAgICAgICBvbkNsaWNrOiAoKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcz8ud2lkZ2V0Py5yZWZyZXNoKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICAvL1xuICAgICAgICBpZiAodGhpcy5faGFzUHJvcHMpIHtcbiAgICAgICAgICAgIHRoaXMuY29uZmlnTWVudUl0ZW1bMF0uaXRlbXMucHVzaCh7XG4gICAgICAgICAgICAgICAgbmFtZTogJ2NvbmZpZ3MnLFxuICAgICAgICAgICAgICAgIGljb246ICdmYXIgZmEtY29ncycsXG4gICAgICAgICAgICAgICAgdGV4dDogQVhUcmFuc2xhdG9yLmdldCgnY29tbW9uLmNvbmZpZ3MnKSxcbiAgICAgICAgICAgICAgICBvbkNsaWNrOiAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3BlbkNvbmZpZ0RpYWxvZygpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuY29uZmlnTWVudUl0ZW1bMF0uaXRlbXMucHVzaCh7XG4gICAgICAgICAgICBuYW1lOiAnc2F2ZScsXG4gICAgICAgICAgICBpY29uOiAnZmFyIGZhLXNhdmUnLFxuICAgICAgICAgICAgdGV4dDogQVhUcmFuc2xhdG9yLmdldCgnY29tbW9uLnNhdmUtYXMnKSxcbiAgICAgICAgICAgIG9uQ2xpY2s6ICgpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLm9wZW5TYXZlRGlhbG9nKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBpZiAodHJ1ZSkge1xuICAgICAgICAgICAgdGhpcy5jb25maWdNZW51SXRlbVswXS5pdGVtcy5wdXNoKHtcbiAgICAgICAgICAgICAgICBuYW1lOiAncmVtb3ZlJyxcbiAgICAgICAgICAgICAgICBpY29uOiAnZmFyIGZhLXRpbWVzJyxcbiAgICAgICAgICAgICAgICBzdHlsZTogJ2F4IGRhbmdlciBibGFuaycsXG4gICAgICAgICAgICAgICAgdGV4dDogQVhUcmFuc2xhdG9yLmdldCgnY29tbW9uLnJlbW92ZScpLFxuICAgICAgICAgICAgICAgIG9uQ2xpY2s6ICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vblJlbW92ZS5lbWl0KHRoaXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuX2hhc01lbnUgPSB0aGlzLmNvbmZpZ01lbnVJdGVtWzBdLml0ZW1zLmxlbmd0aCA+IDA7XG4gICAgICAgIHRoaXMuY2RyLmRldGVjdENoYW5nZXMoKTtcbiAgICB9XG5cbiAgICBASG9zdEJpbmRpbmcoJ2F0dHIuZGF0YS1zaXplLXgnKVxuICAgIEBJbnB1dCgpXG4gICAgc2l6ZVg6IG51bWJlciA9IDE7XG5cbiAgICBASG9zdEJpbmRpbmcoJ2F0dHIuZGF0YS1zaXplLXknKVxuICAgIEBJbnB1dCgpXG4gICAgc2l6ZVk6IG51bWJlciA9IDE7XG5cbiAgICBASG9zdEJpbmRpbmcoJ2F0dHIuZGF0YS1jb2wnKVxuICAgIEBJbnB1dCgpXG4gICAgY29sOiBudW1iZXIgPSAxO1xuXG5cbiAgICBASG9zdEJpbmRpbmcoJ2F0dHIuZGF0YS1yb3cnKVxuICAgIEBJbnB1dCgpXG4gICAgcm93OiBudW1iZXIgPSAxO1xuXG5cbiAgICBwcml2YXRlIHNldFNpemVGcm9tT3B0aW9ucygpIHtcbiAgICAgICAgdGhpcy5fd2lkZ2V0LmdldFZhbHVlKCd3aWRnZXRTaXplJykudGhlbihjID0+IHtcbiAgICAgICAgICAgIGNvbnN0IG9sZFNpemVYID0gdGhpcy5zaXplWDtcbiAgICAgICAgICAgIGNvbnN0IG9sZFNpemVZID0gdGhpcy5zaXplWTtcbiAgICAgICAgICAgIGlmIChjICYmIEFycmF5LmlzQXJyYXkoYykgJiYgKG9sZFNpemVYICE9PSBjWzBdIHx8IG9sZFNpemVZICE9PSBjWzFdKSkge1xuICAgICAgICAgICAgICAgIHRoaXMuY29uZmlnLnNpemVYID0gdGhpcy5zaXplWCA9IGNbMF07XG4gICAgICAgICAgICAgICAgdGhpcy5jb25maWcuc2l6ZVkgPSB0aGlzLnNpemVZID0gY1sxXTtcbiAgICAgICAgICAgICAgICB0aGlzLm9uUmVzaXplZC5lbWl0KHtcbiAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50OiB0aGlzLl93aWRnZXQsXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZzogdGhpcy5jb25maWdcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuY2RyLmRldGVjdENoYW5nZXMoKTtcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgcmVtb3ZlKGU6IE1vdXNlRXZlbnQpIHtcbiAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpO1xuICAgICAgICBpZiAoIXRoaXMucmVhZG9ubHkpXG4gICAgICAgICAgICB0aGlzLm9uUmVtb3ZlLmVtaXQodGhpcyk7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbiAgICBoYW5kbGVDb25maWcoZTogTW91c2VFdmVudCkge1xuICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgIGlmICghdGhpcy5yZWFkb25seSlcbiAgICAgICAgICAgIHRoaXMub3BlbkNvbmZpZ0RpYWxvZygpO1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgcHJpdmF0ZSBvcGVuQ29uZmlnRGlhbG9nKCkge1xuICAgICAgICBjb25zdCBwcHAgPSB0aGlzLmdldE1lcmdlZFByb3BzKCk7XG4gICAgICAgIHRoaXMucG9wdXAub3BlbihBWFdpZGdldENvbmZpZ0NvbXBvbmVudCwge1xuICAgICAgICAgICAgdGl0bGU6IEFYVHJhbnNsYXRvci5nZXQoJ2NvbW1vbi5jb25maWdzJyksXG4gICAgICAgICAgICBzaXplOiAnc20nLFxuICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgIHByb3BzOiBwcHAubWFwKGMgPT4gKHsgcHJvcGVydHk6IGMub3B0aW9ucywgdmFsdWU6IHRoaXMuX3dpZGdldFtjLm9wdGlvbnMubmFtZV0gfSkpLFxuICAgICAgICAgICAgICAgIHdpZGdldDogdGhpcy53aWRnZXRcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSkudGhlbihjID0+IHtcbiAgICAgICAgICAgIGlmIChjLmRhdGEpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuY29uZmlnLm9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jb25maWcub3B0aW9ucyA9IHt9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjLmRhdGEuZm9yRWFjaChwID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fd2lkZ2V0LnNldFZhbHVlKHAucHJvcGVydHkubmFtZSwgcC52YWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY29uZmlnLm9wdGlvbnNbcC5wcm9wZXJ0eS5uYW1lXSA9IHAudmFsdWU7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgdGhpcy5lbWl0Q29uZmlnQ2hhbmdlZCgpO1xuICAgICAgICAgICAgICAgIHRoaXMuX3dpZGdldC5yZWRyYXcoKTtcbiAgICAgICAgICAgICAgICB0aGlzLmNkci5kZXRlY3RDaGFuZ2VzKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHByaXZhdGUgb3BlblNhdmVEaWFsb2coKSB7XG4gICAgICAgIGNvbnN0IHBwcCA9IHRoaXMuZ2V0TWVyZ2VkUHJvcHMoKTtcbiAgICAgICAgdGhpcy5wb3B1cC5vcGVuKEFYV2lkZ2V0U2F2ZUNvbXBvbmVudCwge1xuICAgICAgICAgICAgdGl0bGU6IEFYVHJhbnNsYXRvci5nZXQoJ2NvbW1vbi5zYXZlLWFzJyksXG4gICAgICAgICAgICBzaXplOiAnc20nLFxuICAgICAgICAgICAgZGF0YToge1xuICAgICAgICAgICAgICAgIGNvbmZpZzogdGhpcy5jb25maWcsXG4gICAgICAgICAgICAgICAgcHJvcHM6IHBwcC5tYXAoYyA9PiAoeyBwcm9wZXJ0eTogYy5vcHRpb25zLCB2YWx1ZTogdGhpcy5fd2lkZ2V0W2Mub3B0aW9ucy5uYW1lXSB9KSlcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSkudGhlbihjID0+IHtcbiAgICAgICAgICAgIGlmIChjLmRhdGEpIHtcbiAgICAgICAgICAgICAgICB0aGlzLm9uU2F2ZS5lbWl0KHtcbiAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50OiB0aGlzLl93aWRnZXQsXG4gICAgICAgICAgICAgICAgICAgIGRhdGE6IGMuZGF0YVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cblxuXG4gICAgaGFuZGxlT3B0aW9uQ2xpY2soZTogTW91c2VFdmVudCkge1xuICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgIHRoaXMub3BlbkNvbmZpZ0RpYWxvZygpO1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgbmdPbkRlc3Ryb3koKSB7XG4gICAgICAgIHRoaXMudmMuY2xlYXIoKTtcbiAgICAgICAgaWYgKHRoaXMuY29tcG9uZW50UmVmKSB7XG4gICAgICAgICAgICB0aGlzLmNvbXBvbmVudFJlZi5kZXN0cm95KCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBwcml2YXRlIGdldE1lcmdlZFByb3BzKCk6IEFYUHJvcGVydHlEZWNvcmF0b3JbXSB7XG4gICAgICAgIGNvbnN0IHBwcCA9IEFYT2JqZWN0VXRpbC5kZWVwQ29weShBWFByb3BlcnR5RGVjb3JhdG9ycy5nZXRQcm9wZXJ0aWVzKHRoaXMuX3dpZGdldCkpIGFzIEFYUHJvcGVydHlEZWNvcmF0b3JbXTtcbiAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gdGhpcy5jb25maWcucHJvcHMpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwodGhpcy5jb25maWcucHJvcHMsIGtleSkpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBuZXdQID0gdGhpcy5jb25maWcucHJvcHNba2V5XTtcbiAgICAgICAgICAgICAgICBjb25zdCBleGlzdFByb3BEZWMgPSBwcHAuZmluZChwID0+IHAucHJvcGVydHkgPT09IGtleSk7XG4gICAgICAgICAgICAgICAgaWYgKGV4aXN0UHJvcERlYykge1xuICAgICAgICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKGV4aXN0U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