@acorex/layout 1.3.90
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -0
- package/acorex-layout.d.ts +6 -0
- package/acorex-layout.metadata.json +1 -0
- package/bundles/acorex-layout.umd.js +1479 -0
- package/bundles/acorex-layout.umd.js.map +1 -0
- package/bundles/acorex-layout.umd.min.js +16 -0
- package/bundles/acorex-layout.umd.min.js.map +1 -0
- package/esm2015/acorex-layout.js +7 -0
- package/esm2015/lib/widget-board/editors/widget-size-editor/widget-size.editor.js +49 -0
- package/esm2015/lib/widget-board/editors/widget-size-editor/widget-size.module.js +22 -0
- package/esm2015/lib/widget-board/widget-board.component.js +468 -0
- package/esm2015/lib/widget-board/widget-board.module.js +69 -0
- package/esm2015/lib/widget-board/widget-config.component.js +86 -0
- package/esm2015/lib/widget-board/widget-host.component.js +313 -0
- package/esm2015/lib/widget-board/widget-save.component.js +79 -0
- package/esm2015/lib/widget-board/widget.class.js +123 -0
- package/esm2015/public-api.js +7 -0
- package/esm5/acorex-layout.js +7 -0
- package/esm5/lib/widget-board/editors/widget-size-editor/widget-size.editor.js +52 -0
- package/esm5/lib/widget-board/editors/widget-size-editor/widget-size.module.js +23 -0
- package/esm5/lib/widget-board/widget-board.component.js +494 -0
- package/esm5/lib/widget-board/widget-board.module.js +70 -0
- package/esm5/lib/widget-board/widget-config.component.js +90 -0
- package/esm5/lib/widget-board/widget-host.component.js +349 -0
- package/esm5/lib/widget-board/widget-save.component.js +83 -0
- package/esm5/lib/widget-board/widget.class.js +134 -0
- package/esm5/public-api.js +7 -0
- package/fesm2015/acorex-layout.js +1171 -0
- package/fesm2015/acorex-layout.js.map +1 -0
- package/fesm5/acorex-layout.js +1256 -0
- package/fesm5/acorex-layout.js.map +1 -0
- package/lib/widget-board/editors/widget-size-editor/widget-size.editor.d.ts +16 -0
- package/lib/widget-board/editors/widget-size-editor/widget-size.module.d.ts +3 -0
- package/lib/widget-board/widget-board.component.d.ts +58 -0
- package/lib/widget-board/widget-board.module.d.ts +6 -0
- package/lib/widget-board/widget-config.component.d.ts +20 -0
- package/lib/widget-board/widget-host.component.d.ts +48 -0
- package/lib/widget-board/widget-save.component.d.ts +16 -0
- package/lib/widget-board/widget.class.d.ts +53 -0
- package/package.json +21 -0
- package/public-api.d.ts +6 -0
@@ -0,0 +1,86 @@
|
|
1
|
+
import { __decorate, __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
|
+
let AXWidgetConfigComponent = class AXWidgetConfigComponent extends AXBasePopupPageComponent {
|
6
|
+
constructor(cdr) {
|
7
|
+
super();
|
8
|
+
this.cdr = cdr;
|
9
|
+
this.props = [];
|
10
|
+
this.displayProps = [];
|
11
|
+
this.changes = [];
|
12
|
+
this.context = {};
|
13
|
+
}
|
14
|
+
getFooterButtons() {
|
15
|
+
return [
|
16
|
+
{
|
17
|
+
name: 'okay',
|
18
|
+
submitBehavior: true,
|
19
|
+
text: AXTranslator.get('common.confirm'),
|
20
|
+
style: 'success'
|
21
|
+
},
|
22
|
+
{
|
23
|
+
name: 'cancel',
|
24
|
+
cancelBehavior: true,
|
25
|
+
text: AXTranslator.get('common.cancel'),
|
26
|
+
style: 'danger blank'
|
27
|
+
}
|
28
|
+
];
|
29
|
+
}
|
30
|
+
onFooterButtonClick(e) {
|
31
|
+
if (e.name === 'cancel') {
|
32
|
+
this.close();
|
33
|
+
}
|
34
|
+
if (e.name === 'okay') {
|
35
|
+
this.form.validate().then(c => {
|
36
|
+
if (c.result) {
|
37
|
+
this.close(this.changes);
|
38
|
+
}
|
39
|
+
});
|
40
|
+
}
|
41
|
+
}
|
42
|
+
handleValueChange(e) {
|
43
|
+
const prop = this.changes.find(c => c.property.name === e.property.name);
|
44
|
+
if (prop) {
|
45
|
+
prop.value = e.value;
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
this.changes.push({ property: e.property, value: e.value });
|
49
|
+
}
|
50
|
+
this.updateContext();
|
51
|
+
}
|
52
|
+
ngOnInit() {
|
53
|
+
this.displayProps = this.props.filter(c => c.property.visible !== false).sort((a, b) => a.property.order - b.property.order);
|
54
|
+
this.updateContext();
|
55
|
+
}
|
56
|
+
updateContext() {
|
57
|
+
const ctx = {};
|
58
|
+
this.props.forEach(p => {
|
59
|
+
ctx[p.property.name] = p.value;
|
60
|
+
});
|
61
|
+
this.changes.forEach(p => {
|
62
|
+
ctx[p.property.name] = p.value;
|
63
|
+
});
|
64
|
+
this.context = ctx;
|
65
|
+
}
|
66
|
+
identify(index, item) {
|
67
|
+
return item.property.name;
|
68
|
+
}
|
69
|
+
};
|
70
|
+
AXWidgetConfigComponent.ctorParameters = () => [
|
71
|
+
{ type: ChangeDetectorRef }
|
72
|
+
];
|
73
|
+
__decorate([
|
74
|
+
ViewChild(AXValidationFormComponent),
|
75
|
+
__metadata("design:type", AXValidationFormComponent)
|
76
|
+
], AXWidgetConfigComponent.prototype, "form", void 0);
|
77
|
+
AXWidgetConfigComponent = __decorate([
|
78
|
+
Component({
|
79
|
+
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>",
|
80
|
+
encapsulation: ViewEncapsulation.None,
|
81
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
82
|
+
}),
|
83
|
+
__metadata("design:paramtypes", [ChangeDetectorRef])
|
84
|
+
], AXWidgetConfigComponent);
|
85
|
+
export { AXWidgetCon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0eTogZS5wcm9wZXJ0eSwgdmFsdWU6IGUudmFsdWUgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMudXBkYXRlQ29udGV4dCgpO1xyXG4gICAgfVxyXG5cclxuICAgIG5nT25Jbml0KCkge1xyXG4gICAgICAgIHRoaXMuZGlzcGxheVByb3BzID0gdGhpcy5wcm9wcy5maWx0ZXIoYyA9PiBjLnByb3BlcnR5LnZpc2libGUgIT09IGZhbHNlKS5zb3J0KChhLCBiKSA9PiBhLnByb3BlcnR5Lm9yZGVyIC0gYi5wcm9wZXJ0eS5vcmRlcik7XHJcbiAgICAgICAgdGhpcy51cGRhdGVDb250ZXh0KCk7XHJcbiAgICB9XHJcblxyXG5cclxuICAgIHByaXZhdGUgdXBkYXRlQ29udGV4dCgpIHtcclxuICAgICAgICBjb25zdCBjdHggPSB7fTtcclxuICAgICAgICB0aGlzLnByb3BzLmZvckVhY2gocCA9PiB7XHJcbiAgICAgICAgICAgIGN0eFtwLnByb3BlcnR5Lm5hbWVdID0gcC52YWx1ZTtcclxuICAgICAgICB9KTtcclxuICAgICAgICB0aGlzLmNoYW5nZXMuZm9yRWFjaChwID0+IHtcclxuICAgICAgICAgICAgY3R4W3AucHJvcGVydHkubmFtZV0gPSBwLnZhbHVlO1xyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIHRoaXMuY29udGV4dCA9IGN0eDtcclxuICAgIH1cclxuXHJcblxyXG4gICAgaWRlbnRpZnkoaW5kZXgsIGl0ZW06IEFYUHJvcGVydHlDb25maWcpIHtcclxuICAgICAgICByZXR1cm4gaXRlbS5wcm9wZXJ0eS5uYW1lO1xyXG4gICAgfVxyXG5cclxufSJdfQ==
|
@@ -0,0 +1,313 @@
|
|
1
|
+
import { __awaiter, __decorate, __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
|
+
let AXWidgetHostComponent = class AXWidgetHostComponent {
|
9
|
+
constructor(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
|
+
get widget() {
|
35
|
+
return this._widget;
|
36
|
+
}
|
37
|
+
get element() {
|
38
|
+
return this.ref.nativeElement;
|
39
|
+
}
|
40
|
+
get isLoading() {
|
41
|
+
return this._isLoading;
|
42
|
+
}
|
43
|
+
set isLoading(v) {
|
44
|
+
this._isLoading = v;
|
45
|
+
if (this._loadingId && !v) {
|
46
|
+
this.loadingService.hide(this._loadingId);
|
47
|
+
this._loadingId = null;
|
48
|
+
}
|
49
|
+
if (v) {
|
50
|
+
this._loadingId = this.loadingService.show(this.ref.nativeElement);
|
51
|
+
}
|
52
|
+
}
|
53
|
+
get isConfigured() {
|
54
|
+
var _a;
|
55
|
+
return ((_a = this._widget) === null || _a === void 0 ? void 0 : _a.isConfigured) || false;
|
56
|
+
}
|
57
|
+
ngOnInit() {
|
58
|
+
this.isLoading = true;
|
59
|
+
}
|
60
|
+
ngAfterViewInit() {
|
61
|
+
var _a;
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
63
|
+
let component;
|
64
|
+
if (typeof this.config.component === 'string') {
|
65
|
+
const route = yield this.rendererService.findLoadedComponentByRoute(this.config.component, 20);
|
66
|
+
component = (_a = route) === null || _a === void 0 ? void 0 : _a.component;
|
67
|
+
}
|
68
|
+
else if (typeof this.config.component === 'function') {
|
69
|
+
component = this.config.component;
|
70
|
+
}
|
71
|
+
if (component == null) {
|
72
|
+
console.error(`Invalid Widget Component!`, this.config);
|
73
|
+
this.onRemove.emit(this);
|
74
|
+
return;
|
75
|
+
}
|
76
|
+
const widgetFactory = this.componentFactoryResolver.resolveComponentFactory(component);
|
77
|
+
this.componentRef = this.vc.createComponent(widgetFactory);
|
78
|
+
this._widget = this.componentRef.instance;
|
79
|
+
this._widget.provideValue = this.provideValue;
|
80
|
+
if (this._widget.onBusyChanged) {
|
81
|
+
this._widget.onBusyChanged.subscribe((d) => {
|
82
|
+
if (!this._widget.widgetSize) {
|
83
|
+
this._widget.setValue('widgetSize', [this.sizeX, this.sizeY]);
|
84
|
+
}
|
85
|
+
else {
|
86
|
+
this.setSizeFromOptions();
|
87
|
+
}
|
88
|
+
this.isLoading = d.value;
|
89
|
+
this.cdr.detectChanges();
|
90
|
+
});
|
91
|
+
}
|
92
|
+
if (this._widget.onConfiguredChanged) {
|
93
|
+
this._widget.onConfiguredChanged.subscribe(() => {
|
94
|
+
this.setSizeFromOptions();
|
95
|
+
});
|
96
|
+
}
|
97
|
+
//
|
98
|
+
if (this.config.options) {
|
99
|
+
Object.assign(this._widget, this.config.options);
|
100
|
+
}
|
101
|
+
this._hasProps = AXPropertyDecorators.getProperties(this._widget).length > 0;
|
102
|
+
this.isLoading = false;
|
103
|
+
this.config['__meta__'].instance = this;
|
104
|
+
this._widget['__meta__'] = {};
|
105
|
+
this._widget['__meta__'].config = this.config;
|
106
|
+
//
|
107
|
+
if (this._hasProps) {
|
108
|
+
this.configMenuItem[0].items.push({
|
109
|
+
name: 'configs',
|
110
|
+
icon: 'far fa-cogs',
|
111
|
+
text: AXTranslator.get('common.configs'),
|
112
|
+
onClick: () => {
|
113
|
+
this.openConfigDialog();
|
114
|
+
}
|
115
|
+
});
|
116
|
+
}
|
117
|
+
this.configMenuItem[0].items.push({
|
118
|
+
name: 'save',
|
119
|
+
icon: 'far fa-save',
|
120
|
+
text: AXTranslator.get('common.save-as'),
|
121
|
+
onClick: () => {
|
122
|
+
this.openSaveDialog();
|
123
|
+
}
|
124
|
+
});
|
125
|
+
if (true) {
|
126
|
+
this.configMenuItem[0].items.push({
|
127
|
+
name: 'remove',
|
128
|
+
icon: 'far fa-times',
|
129
|
+
style: 'ax danger blank',
|
130
|
+
text: AXTranslator.get('common.remove'),
|
131
|
+
onClick: () => {
|
132
|
+
this.onRemove.emit(this);
|
133
|
+
}
|
134
|
+
});
|
135
|
+
}
|
136
|
+
this._hasMenu = this.configMenuItem[0].items.length > 0;
|
137
|
+
this.cdr.detectChanges();
|
138
|
+
});
|
139
|
+
}
|
140
|
+
setSizeFromOptions() {
|
141
|
+
this._widget.getValue('widgetSize').then(c => {
|
142
|
+
const oldSizeX = this.sizeX;
|
143
|
+
const oldSizeY = this.sizeY;
|
144
|
+
if (c && Array.isArray(c) && (oldSizeX !== c[0] || oldSizeY !== c[1])) {
|
145
|
+
this.config.sizeX = this.sizeX = c[0];
|
146
|
+
this.config.sizeY = this.sizeY = c[1];
|
147
|
+
this.onResized.emit({
|
148
|
+
component: this._widget,
|
149
|
+
config: this.config
|
150
|
+
});
|
151
|
+
}
|
152
|
+
this.cdr.detectChanges();
|
153
|
+
});
|
154
|
+
}
|
155
|
+
remove(e) {
|
156
|
+
e.preventDefault();
|
157
|
+
e.stopPropagation();
|
158
|
+
this.onRemove.emit(this);
|
159
|
+
return false;
|
160
|
+
}
|
161
|
+
handleConfig(e) {
|
162
|
+
e.preventDefault();
|
163
|
+
e.stopPropagation();
|
164
|
+
this.openConfigDialog();
|
165
|
+
return false;
|
166
|
+
}
|
167
|
+
openConfigDialog() {
|
168
|
+
const ppp = this.getMergedProps();
|
169
|
+
this.popup.open(AXWidgetConfigComponent, {
|
170
|
+
title: AXTranslator.get('common.configs'),
|
171
|
+
size: 'sm',
|
172
|
+
data: {
|
173
|
+
props: ppp.map(c => ({ property: c.options, value: this._widget[c.options.name] })),
|
174
|
+
widget: this.widget
|
175
|
+
}
|
176
|
+
}).then(c => {
|
177
|
+
if (c.data) {
|
178
|
+
if (!this.config.options) {
|
179
|
+
this.config.options = {};
|
180
|
+
}
|
181
|
+
c.data.forEach(p => {
|
182
|
+
this._widget.setValue(p.property.name, p.value);
|
183
|
+
this.config.options[p.property.name] = p.value;
|
184
|
+
});
|
185
|
+
this.emitConfigChanged();
|
186
|
+
this._widget.redraw();
|
187
|
+
this.cdr.detectChanges();
|
188
|
+
}
|
189
|
+
});
|
190
|
+
}
|
191
|
+
openSaveDialog() {
|
192
|
+
const ppp = this.getMergedProps();
|
193
|
+
this.popup.open(AXWidgetSaveComponent, {
|
194
|
+
title: AXTranslator.get('common.save-as'),
|
195
|
+
size: 'sm',
|
196
|
+
data: {
|
197
|
+
config: this.config,
|
198
|
+
props: ppp.map(c => ({ property: c.options, value: this._widget[c.options.name] }))
|
199
|
+
}
|
200
|
+
}).then(c => {
|
201
|
+
if (c.data) {
|
202
|
+
this.onSave.emit({
|
203
|
+
component: this._widget,
|
204
|
+
data: c.data
|
205
|
+
});
|
206
|
+
}
|
207
|
+
});
|
208
|
+
}
|
209
|
+
handleOptionClick(e) {
|
210
|
+
e.preventDefault();
|
211
|
+
e.stopPropagation();
|
212
|
+
this.openConfigDialog();
|
213
|
+
return false;
|
214
|
+
}
|
215
|
+
ngOnDestroy() {
|
216
|
+
this.vc.clear();
|
217
|
+
if (this.componentRef) {
|
218
|
+
this.componentRef.destroy();
|
219
|
+
}
|
220
|
+
}
|
221
|
+
getMergedProps() {
|
222
|
+
const ppp = AXObjectUtil.deepCopy(AXPropertyDecorators.getProperties(this._widget));
|
223
|
+
for (const key in this.config.props) {
|
224
|
+
if (Object.prototype.hasOwnProperty.call(this.config.props, key)) {
|
225
|
+
const newP = this.config.props[key];
|
226
|
+
const existPropDec = ppp.find(p => p.property === key);
|
227
|
+
if (existPropDec) {
|
228
|
+
Object.assign(existPropDec.options, newP);
|
229
|
+
}
|
230
|
+
}
|
231
|
+
}
|
232
|
+
return ppp;
|
233
|
+
}
|
234
|
+
emitConfigChanged() {
|
235
|
+
this.onConfigChanged.emit({
|
236
|
+
component: this._widget,
|
237
|
+
config: this.config
|
238
|
+
});
|
239
|
+
}
|
240
|
+
};
|
241
|
+
AXWidgetHostComponent.ctorParameters = () => [
|
242
|
+
{ type: ElementRef },
|
243
|
+
{ type: ComponentFactoryResolver },
|
244
|
+
{ type: AXRenderService },
|
245
|
+
{ type: ChangeDetectorRef },
|
246
|
+
{ type: AXPopupService },
|
247
|
+
{ type: AXLoadingService }
|
248
|
+
];
|
249
|
+
__decorate([
|
250
|
+
Input(),
|
251
|
+
__metadata("design:type", Function)
|
252
|
+
], AXWidgetHostComponent.prototype, "provideValue", void 0);
|
253
|
+
__decorate([
|
254
|
+
Output(),
|
255
|
+
__metadata("design:type", EventEmitter)
|
256
|
+
], AXWidgetHostComponent.prototype, "onRemove", void 0);
|
257
|
+
__decorate([
|
258
|
+
Output(),
|
259
|
+
__metadata("design:type", EventEmitter)
|
260
|
+
], AXWidgetHostComponent.prototype, "onConfigChanged", void 0);
|
261
|
+
__decorate([
|
262
|
+
Output(),
|
263
|
+
__metadata("design:type", EventEmitter)
|
264
|
+
], AXWidgetHostComponent.prototype, "onResized", void 0);
|
265
|
+
__decorate([
|
266
|
+
Output(),
|
267
|
+
__metadata("design:type", EventEmitter)
|
268
|
+
], AXWidgetHostComponent.prototype, "onSave", void 0);
|
269
|
+
__decorate([
|
270
|
+
Input(),
|
271
|
+
__metadata("design:type", Object)
|
272
|
+
], AXWidgetHostComponent.prototype, "config", void 0);
|
273
|
+
__decorate([
|
274
|
+
ViewChild('vc', { read: ViewContainerRef }),
|
275
|
+
__metadata("design:type", ViewContainerRef)
|
276
|
+
], AXWidgetHostComponent.prototype, "vc", void 0);
|
277
|
+
__decorate([
|
278
|
+
HostBinding('attr.data-size-x'),
|
279
|
+
Input(),
|
280
|
+
__metadata("design:type", Number)
|
281
|
+
], AXWidgetHostComponent.prototype, "sizeX", void 0);
|
282
|
+
__decorate([
|
283
|
+
HostBinding('attr.data-size-y'),
|
284
|
+
Input(),
|
285
|
+
__metadata("design:type", Number)
|
286
|
+
], AXWidgetHostComponent.prototype, "sizeY", void 0);
|
287
|
+
__decorate([
|
288
|
+
HostBinding('attr.data-col'),
|
289
|
+
Input(),
|
290
|
+
__metadata("design:type", Number)
|
291
|
+
], AXWidgetHostComponent.prototype, "col", void 0);
|
292
|
+
__decorate([
|
293
|
+
HostBinding('attr.data-row'),
|
294
|
+
Input(),
|
295
|
+
__metadata("design:type", Number)
|
296
|
+
], AXWidgetHostComponent.prototype, "row", void 0);
|
297
|
+
AXWidgetHostComponent = __decorate([
|
298
|
+
Component({
|
299
|
+
selector: 'ax-widget-host',
|
300
|
+
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>",
|
301
|
+
host: { class: 'ax widget-host', tabindex: '0' },
|
302
|
+
encapsulation: ViewEncapsulation.None,
|
303
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
304
|
+
}),
|
305
|
+
__metadata("design:paramtypes", [ElementRef,
|
306
|
+
ComponentFactoryResolver,
|
307
|
+
AXRenderService,
|
308
|
+
ChangeDetectorRef,
|
309
|
+
AXPopupService,
|
310
|
+
AXLoadingService])
|
311
|
+
], AXWidgetHostComponent);
|
312
|
+
export { AXWidgetHostComponent };
|
313
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2lkZ2V0LWhvc3QuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGFjb3JleC9sYXlvdXQvIiwic291cmNlcyI6WyJsaWIvd2lkZ2V0LWJvYXJkL3dpZGdldC1ob3N0LmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUNILFNBQVMsRUFDVCxpQkFBaUIsRUFBRSxLQUFLLEVBQ3hCLFVBQVUsRUFBRSxXQUFXLEVBQUUsd0JBQXdCLEVBQUUsU0FBUyxFQUM1RCxnQkFBZ0IsRUFBRSxNQU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l93aWRnZXQud2lkZ2V0U2l6ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3dpZGdldC5zZXRWYWx1ZSgnd2lkZ2V0U2l6ZScsIFt0aGlzLnNpemVYLCB0aGlzLnNpemVZXSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFNpemVGcm9tT3B0aW9ucygpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgdGhpcy5pc0xvYWRpbmcgPSBkLnZhbHVlO1xyXG4gICAgICAgICAgICAgICAgdGhpcy5jZHIuZGV0ZWN0Q2hhbmdlcygpO1xyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMuX3dpZGdldC5vbkNvbmZpZ3VyZWRDaGFuZ2VkKSB7XHJcbiAgICAgICAgICAgIHRoaXMuX3dpZGdldC5vbkNvbmZpZ3VyZWRDaGFuZ2VkLnN1YnNjcmliZSgoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnNldFNpemVGcm9tT3B0aW9ucygpO1xyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgLy9cclxuICAgICAgICBpZiAodGhpcy5jb25maWcub3B0aW9ucykge1xyXG4gICAgICAgICAgICBPYmplY3QuYXNzaWduKHRoaXMuX3dpZGdldCwgdGhpcy5jb25maWcub3B0aW9ucyk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMuX2hhc1Byb3BzID0gQVhQcm9wZXJ0eURlY29yYXRvcnMuZ2V0UHJvcGVydGllcyh0aGlzLl93aWRnZXQpLmxlbmd0aCA+IDA7XHJcblxyXG4gICAgICAgIHRoaXMuaXNMb2FkaW5nID0gZmFsc2U7XHJcbiAgICAgICAgdGhpcy5jb25maWdbJ19fbWV0YV9fJ10uaW5zdGFuY2UgPSB0aGlzO1xyXG4gICAgICAgIHRoaXMuX3dpZGdldFsnX19tZXRhX18nXSA9IHt9O1xyXG4gICAgICAgIHRoaXMuX3dpZGdldFsnX19tZXRhX18nXS5jb25maWcgPSB0aGlzLmNvbmZpZztcclxuICAgICAgICAvL1xyXG4gICAgICAgIGlmICh0aGlzLl9oYXNQcm9wcykge1xyXG4gICAgICAgICAgICB0aGlzLmNvbmZpZ01lbnVJdGVtWzBdLml0ZW1zLnB1c2goe1xyXG4gICAgICAgICAgICAgICAgbmFtZTogJ2NvbmZpZ3MnLFxyXG4gICAgICAgICAgICAgICAgaWNvbjogJ2ZhciBmYS1jb2dzJyxcclxuICAgICAgICAgICAgICAgIHRleHQ6IEFYVHJhbnNsYXRvci5nZXQoJ2NvbW1vbi5jb25maWdzJyksXHJcbiAgICAgICAgICAgICAgICBvbkNsaWNrOiAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcGVuQ29uZmlnRGlhbG9nKCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLmNvbmZpZ01lbnVJdGVtWzBdLml0ZW1zLnB1c2goe1xyXG4gICAgICAgICAgICBuYW1lOiAnc2F2ZScsXHJcbiAgICAgICAgICAgIGljb246ICdmYXIgZmEtc2F2ZScsXHJcbiAgICAgICAgICAgIHRleHQ6IEFYVHJhbnNsYXRvci5nZXQoJ2NvbW1vbi5zYXZlLWFzJyksXHJcbiAgICAgICAgICAgIG9uQ2xpY2s6ICgpID0+IHtcclxuICAgICAgICAgICAgICAgIHRoaXMub3BlblNhdmVEaWFsb2coKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGlmICh0cnVlKSB7XHJcbiAgICAgICAgICAgIHRoaXMuY29uZmlnTWVudUl0ZW1bMF0uaXRlbXMucHVzaCh7XHJcbiAgICAgICAgICAgICAgICBuYW1lOiAncmVtb3ZlJyxcclxuICAgICAgICAgICAgICAgIGljb246ICdmYXIgZmEtdGltZXMnLFxyXG4gICAgICAgICAgICAgICAgc3R5bGU6ICdheCBkYW5nZXIgYmxhbmsnLFxyXG4gICAgICAgICAgICAgICAgdGV4dDogQVhUcmFuc2xhdG9yLmdldCgnY29tbW9uLnJlbW92ZScpLFxyXG4gICAgICAgICAgICAgICAgb25DbGljazogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMub25SZW1vdmUuZW1pdCh0aGlzKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMuX2hhc01lbnUgPSB0aGlzLmNvbmZpZ01lbnVJdGVtWzBdLml0ZW1zLmxlbmd0aCA+IDA7XHJcbiAgICAgICAgdGhpcy5jZHIuZGV0ZWN0Q2hhbmdlcygpO1xyXG4gICAgfVxyXG5cclxuICAgIEBIb3N0QmluZGluZygnYXR0ci5kYXRhLXNpemUteCcpXHJcbiAgICBASW5wdXQoKVxyXG4gICAgc2l6ZVg6IG51bWJlciA9IDE7XHJcblxyXG4gICAgQEhvc3RCaW5kaW5nKCdhdHRyLmRhdGEtc2l6ZS15JylcclxuICAgIEBJbnB1dCgpXHJcbiAgICBzaXplWTogbnVtYmVyID0gMTtcclxuXHJcbiAgICBASG9zdEJpbmRpbmcoJ2F0dHIuZGF0YS1jb2wnKVxyXG4gICAgQElucHV0KClcclxuICAgIGNvbDogbnVtYmVyID0gMTtcclxuXHJcblxyXG4gICAgQEhvc3RCaW5kaW5nKCdhdHRyLmRhdGEtcm93JylcclxuICAgIEBJbnB1dCgpXHJcbiAgICByb3c6IG51bWJlciA9IDE7XHJcblxyXG5cclxuICAgIHByaXZhdGUgc2V0U2l6ZUZyb21PcHRpb25zKCkge1xyXG4gICAgICAgIHRoaXMuX3dpZGdldC5nZXRWYWx1ZSgnd2lkZ2V0U2l6ZScpLnRoZW4oYyA9PiB7XHJcbiAgICAgICAgICAgIGNvbnN0IG9sZFNpemVYID0gdGhpcy5zaXplWDtcclxuICAgICAgICAgICAgY29uc3Qgb2xkU2l6ZVkgPSB0aGlzLnNpemVZO1xyXG4gICAgICAgICAgICBpZiAoYyAmJiBBcnJheS5pc0FycmF5KGMpICYmIChvbGRTaXplWCAhPT0gY1swXSB8fCBvbGRTaXplWSAhPT0gY1sxXSkpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuY29uZmlnLnNpemVYID0gdGhpcy5zaXplWCA9IGNbMF07XHJcbiAgICAgICAgICAgICAgICB0aGlzLmNvbmZpZy5zaXplWSA9IHRoaXMuc2l6ZVkgPSBjWzFdO1xyXG4gICAgICAgICAgICAgICAgdGhpcy5vblJlc2l6ZWQuZW1pdCh7XHJcbiAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50OiB0aGlzLl93aWRnZXQsXHJcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnOiB0aGlzLmNvbmZpZ1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgdGhpcy5jZHIuZGV0ZWN0Q2hhbmdlcygpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG5cclxuICAgIHJlbW92ZShlOiBNb3VzZUV2ZW50KSB7XHJcbiAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xyXG4gICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7XHJcbiAgICAgICAgdGhpcy5vblJlbW92ZS5lbWl0KHRoaXMpO1xyXG4gICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgIH1cclxuXHJcbiAgICBoYW5kbGVDb25maWcoZTogTW91c2VFdmVudCkge1xyXG4gICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcclxuICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpO1xyXG4gICAgICAgIHRoaXMub3BlbkNvbmZpZ0RpYWxvZygpO1xyXG4gICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgIH1cclxuXHJcbiAgICBwcml2YXRlIG9wZW5Db25maWdEaWFsb2coKSB7XHJcbiAgICAgICAgY29uc3QgcHBwID0gdGhpcy5nZXRNZXJnZWRQcm9wcygpO1xyXG4gICAgICAgIHRoaXMucG9wdXAub3BlbihBWFdpZGdldENvbmZpZ0NvbXBvbmVudCwge1xyXG4gICAgICAgICAgICB0aXRsZTogQVhUcmFuc2xhdG9yLmdldCgnY29tbW9uLmNvbmZpZ3MnKSxcclxuICAgICAgICAgICAgc2l6ZTogJ3NtJyxcclxuICAgICAgICAgICAgZGF0YToge1xyXG4gICAgICAgICAgICAgICAgcHJvcHM6IHBwcC5tYXAoYyA9PiAoeyBwcm9wZXJ0eTogYy5vcHRpb25zLCB2YWx1ZTogdGhpcy5fd2lkZ2V0W2Mub3B0aW9ucy5uYW1lXSB9KSksXHJcbiAgICAgICAgICAgICAgICB3aWRnZXQ6IHRoaXMud2lkZ2V0XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KS50aGVuKGMgPT4ge1xyXG4gICAgICAgICAgICBpZiAoYy5kYXRhKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMuY29uZmlnLm9wdGlvbnMpIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbmZpZy5vcHRpb25zID0ge307XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjLmRhdGEuZm9yRWFjaChwID0+IHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLl93aWRnZXQuc2V0VmFsdWUocC5wcm9wZXJ0eS5uYW1lLCBwLnZhbHVlKTtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbmZpZy5vcHRpb25zW3AucHJvcGVydHkubmFtZV0gPSBwLnZhbHVlO1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmVtaXRDb25maWdDaGFuZ2VkKCk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLl93aWRnZXQucmVkcmF3KCk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmNkci5kZXRlY3RDaGFuZ2VzKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgIH1cclxuXHJcbiAgICBwcml2YXRlIG9wZW5TYXZlRGlhbG9nKCkge1xyXG4gICAgICAgIGNvbnN0IHBwcCA9IHRoaXMuZ2V0TWVyZ2VkUHJvcHMoKTtcclxuICAgICAgICB0aGlzLnBvcHVwLm9wZW4oQVhXaWRnZXRTYXZlQ29tcG9uZW50LCB7XHJcbiAgICAgICAgICAgIHRpdGxlOiBBWFRyYW5zbGF0b3IuZ2V0KCdjb21tb24uc2F2ZS1hcycpLFxyXG4gICAgICAgICAgICBzaXplOiAnc20nLFxyXG4gICAgICAgICAgICBkYXRhOiB7XHJcbiAgICAgICAgICAgICAgICBjb25maWc6IHRoaXMuY29uZmlnLFxyXG4gICAgICAgICAgICAgICAgcHJvcHM6IHBwcC5tYXAoYyA9PiAoeyBwcm9wZXJ0eTogYy5vcHRpb25zLCB2YWx1ZTogdGhpcy5fd2lkZ2V0W2Mub3B0aW9ucy5uYW1lXSB9KSlcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pLnRoZW4oYyA9PiB7XHJcbiAgICAgICAgICAgIGlmIChjLmRhdGEpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMub25TYXZlLmVtaXQoe1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudDogdGhpcy5fd2lkZ2V0LFxyXG4gICAgICAgICAgICAgICAgICAgIGRhdGE6IGMuZGF0YVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgIH1cclxuXHJcblxyXG5cclxuICAgIGhhbmRsZU9wdGlvbkNsaWNrKGU6IE1vdXNlRXZlbnQpIHtcclxuICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTtcclxuICAgICAgICB0aGlzLm9wZW5Db25maWdEaWFsb2coKTtcclxuICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICB9XHJcblxyXG4gICAgbmdPbkRlc3Ryb3koKSB7XHJcbiAgICAgICAgdGhpcy52Yy5jbGVhcigpO1xyXG4gICAgICAgIGlmICh0aGlzLmNvbXBvbmVudFJlZikge1xyXG4gICAgICAgICAgICB0aGlzLmNvbXBvbmVudFJlZi5kZXN0cm95KCk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIHByaXZhdGUgZ2V0TWVyZ2VkUHJvcHMoKTogQVhQcm9wZXJ0eURlY29yYXRvcltdIHtcclxuICAgICAgICBjb25zdCBwcHAgPSBBWE9iamVjdFV0aWwuZGVlcENvcHkoQVhQcm9wZXJ0eURlY29yYXRvcnMuZ2V0UHJvcGVydGllcyh0aGlzLl93aWRnZXQpKSBhcyBBWFByb3BlcnR5RGVjb3JhdG9yW107XHJcbiAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gdGhpcy5jb25maWcucHJvcHMpIHtcclxuICAgICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbCh0aGlzLmNvbmZpZy5wcm9wcywga2V5KSkge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgbmV3UCA9IHRoaXMuY29uZmlnLnByb3BzW2tleV07XHJcbiAgICAgICAgICAgICAgICBjb25zdCBleGlzdFByb3BEZWMgPSBwcHAuZmluZChwID0+IHAucHJvcGVydHkgPT09IGtleSk7XHJcbiAgICAgICAgICAgICAgICBpZiAoZXhpc3RQcm9wRGVjKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihleGlzdFByb3BEZWMub3B0aW9ucywgbmV3UCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHBwcDtcclxuICAgIH1cclxuXHJcbiAgICBwcml2YXRlIGVtaXRDb25maWdDaGFuZ2VkKCkge1xyXG4gICAgICAgIHRoaXMub25Db25maWdDaGFuZ2VkLmVtaXQoe1xyXG4gICAgICAgICAgICBjb21wb25lbnQ6IHRoaXMuX3dpZGdldCxcclxuICAgICAgICAgICAgY29uZmlnOiB0aGlzLmNvbmZpZ1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG5cclxufSJdfQ==
|
@@ -0,0 +1,79 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { Component, ViewEncapsulation, ChangeDetectionStrategy, } from '@angular/core';
|
3
|
+
import { AXHtmlUtil, AXObjectUtil, AXTranslator } from '@acorex/core';
|
4
|
+
import { AXBasePopupPageComponent } from '@acorex/components';
|
5
|
+
let AXWidgetSaveComponent = class AXWidgetSaveComponent extends AXBasePopupPageComponent {
|
6
|
+
constructor() {
|
7
|
+
super(...arguments);
|
8
|
+
this.props = [];
|
9
|
+
}
|
10
|
+
getFooterButtons() {
|
11
|
+
return [
|
12
|
+
{
|
13
|
+
name: 'okay',
|
14
|
+
submitBehavior: true,
|
15
|
+
text: AXTranslator.get('common.confirm'),
|
16
|
+
style: 'ax success'
|
17
|
+
},
|
18
|
+
{
|
19
|
+
name: 'cancel',
|
20
|
+
cancelBehavior: true,
|
21
|
+
text: AXTranslator.get('common.cancel'),
|
22
|
+
style: 'ax light'
|
23
|
+
}
|
24
|
+
];
|
25
|
+
}
|
26
|
+
ngOnInit() {
|
27
|
+
var _a, _b;
|
28
|
+
const titleProp = this.props.find(c => c.property.name === 'title' || c.property.name === 'name');
|
29
|
+
const title = ((_a = titleProp) === null || _a === void 0 ? void 0 : _a.value) || this.config.title;
|
30
|
+
const pp = {};
|
31
|
+
(_b = this.props) === null || _b === void 0 ? void 0 : _b.forEach(c => {
|
32
|
+
pp[c.property.name] = c.property;
|
33
|
+
});
|
34
|
+
this.data = {
|
35
|
+
component: this.config.component,
|
36
|
+
title,
|
37
|
+
uniqueName: `${this.config.uniqueName}-${AXHtmlUtil.getUID()}`,
|
38
|
+
options: AXObjectUtil.deepJSONClone(this.config.options),
|
39
|
+
props: AXObjectUtil.deepJSONClone(pp)
|
40
|
+
};
|
41
|
+
this.displayProps = this.props
|
42
|
+
.filter(c => c.property.visible !== false)
|
43
|
+
.sort((a, b) => a.property.order - b.property.order)
|
44
|
+
.map(c => ({
|
45
|
+
name: c.property.name,
|
46
|
+
title: c.property.title,
|
47
|
+
allow: true
|
48
|
+
}));
|
49
|
+
}
|
50
|
+
onFooterButtonClick(e) {
|
51
|
+
if (e.name === 'cancel') {
|
52
|
+
this.close();
|
53
|
+
}
|
54
|
+
if (e.name === 'okay') {
|
55
|
+
this.props.forEach(p => {
|
56
|
+
const pp = this.displayProps.find(c => c.name === p.property.name);
|
57
|
+
if (pp == null || !pp.allow) {
|
58
|
+
let ppp = this.data.props[p.property.name];
|
59
|
+
if (ppp) {
|
60
|
+
ppp.visible = false;
|
61
|
+
}
|
62
|
+
else {
|
63
|
+
ppp = { visible: false };
|
64
|
+
}
|
65
|
+
}
|
66
|
+
});
|
67
|
+
this.close(this.data);
|
68
|
+
}
|
69
|
+
}
|
70
|
+
};
|
71
|
+
AXWidgetSaveComponent = __decorate([
|
72
|
+
Component({
|
73
|
+
template: "<ax-page>\r\n <ax-page-content>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <ax-form-group>\r\n <ax-label>{{'common.title' | trans}}</ax-label>\r\n <ax-text-box [(value)]=\"data.title\"></ax-text-box>\r\n </ax-form-group>\r\n </div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <ax-form-group>\r\n <ax-label>{{'common.description' | trans}}</ax-label>\r\n <ax-text-area [(value)]=\"data.description\"></ax-text-area>\r\n </ax-form-group>\r\n </div>\r\n </div>\r\n <!-- <div class=\"row\">\r\n <div class=\"col-12\">\r\n <ax-form-group>\r\n <ax-label>{{'common.uniquename' | trans}}</ax-label>\r\n <ax-text-box></ax-text-box>\r\n </ax-form-group>\r\n </div>\r\n </div> -->\r\n <div class=\"row\" style=\"margin-block-end: var(--ax-size-md);margin-block-start: var(--ax-size-md);\">\r\n <div class=\"col-12\">\r\n <ax-fieldset caption=\"{{'widget-board.configurable-props' | trans}}\">\r\n <div class=\"row\" *ngFor=\"let prop of displayProps\">\r\n <div class=\"col-12\" style=\"margin-block-end: var(--ax-size-sm)\">\r\n <ax-check-box [(value)]=\"prop.allow\" label=\"{{ prop.title | trans }}\">\r\n\r\n </ax-check-box>\r\n </div>\r\n </div>\r\n </ax-fieldset>\r\n </div>\r\n </div>\r\n </div>\r\n </ax-page-content>\r\n</ax-page>",
|
74
|
+
encapsulation: ViewEncapsulation.None,
|
75
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
76
|
+
})
|
77
|
+
], AXWidgetSaveComponent);
|
78
|
+
export { AXWidgetSaveComponent };
|
79
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2lkZ2V0LXNhdmUuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGFjb3JleC9sYXlvdXQvIiwic291cmNlcyI6WyJsaWIvd2lkZ2V0LWJvYXJkL3dpZGdldC1zYXZlLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUNILFNBQVMsRUFDVCxpQkFBaUIsRUFDakIsdUJBQXVCLEdBRTFCLE1BQU0sZUFBZSxDQUFDO0FBRXZCLE9BQU8sRUFBZ0IsVUFBVSxFQUFFLFlBQVksRUFBRSxZQUFZLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFDcEYsT0FBTyxFQUEwQyx3QkFBd0IsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBU3RHLElBQWEscUJBQXFCLEdBQWxDLE1BQWEscUJBQXNCLFNBQVEsd0JBQXdCO0lBQW5FOzt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1cm4gW1xyXG4gICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICBuYW1lOiAnb2theScsXHJcbiAgICAgICAgICAgICAgICBzdWJtaXRCZWhhdmlvcjogdHJ1ZSxcclxuICAgICAgICAgICAgICAgIHRleHQ6IEFYVHJhbnNsYXRvci5nZXQoJ2NvbW1vbi5jb25maXJtJyksXHJcbiAgICAgICAgICAgICAgICBzdHlsZTogJ2F4IHN1Y2Nlc3MnXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIG5hbWU6ICdjYW5jZWwnLFxyXG4gICAgICAgICAgICAgICAgY2FuY2VsQmVoYXZpb3I6IHRydWUsXHJcbiAgICAgICAgICAgICAgICB0ZXh0OiBBWFRyYW5zbGF0b3IuZ2V0KCdjb21tb24uY2FuY2VsJyksXHJcbiAgICAgICAgICAgICAgICBzdHlsZTogJ2F4IGxpZ2h0J1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgXTtcclxuICAgIH1cclxuXHJcbiAgICBuZ09uSW5pdCgpIHtcclxuICAgICAgICBjb25zdCB0aXRsZVByb3AgPSB0aGlzLnByb3BzLmZpbmQoYyA9PiBjLnByb3BlcnR5Lm5hbWUgPT09ICd0aXRsZScgfHwgYy5wcm9wZXJ0eS5uYW1lID09PSAnbmFtZScpO1xyXG4gICAgICAgIGNvbnN0IHRpdGxlID0gdGl0bGVQcm9wPy52YWx1ZSB8fCB0aGlzLmNvbmZpZy50aXRsZTtcclxuICAgICAgICBjb25zdCBwcDogYW55ID0ge307XHJcbiAgICAgICAgdGhpcy5wcm9wcz8uZm9yRWFjaChjID0+IHtcclxuICAgICAgICAgICAgcHBbYy5wcm9wZXJ0eS5uYW1lXSA9IGMucHJvcGVydHk7XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgdGhpcy5kYXRhID0ge1xyXG4gICAgICAgICAgICBjb21wb25lbnQ6IHRoaXMuY29uZmlnLmNvbXBvbmVudCxcclxu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XlQcm9wcy5maW5kKGMgPT4gYy5uYW1lID09PSBwLnByb3BlcnR5Lm5hbWUpO1xyXG4gICAgICAgICAgICAgICAgaWYgKHBwID09IG51bGwgfHwgIXBwLmFsbG93KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBwcCA9IHRoaXMuZGF0YS5wcm9wc1twLnByb3BlcnR5Lm5hbWVdO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChwcHApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcHBwLnZpc2libGUgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHBwcCA9IHsgdmlzaWJsZTogZmFsc2UgfTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB0aGlzLmNsb3NlKHRoaXMuZGF0YSk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59Il19
|