@acorex/layout 6.5.28 → 6.5.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/README.md +1 -1
  2. package/acorex-layout.d.ts +5 -0
  3. package/esm2020/acorex-layout.mjs +5 -0
  4. package/esm2020/lib/widget-board/editors/widget-size-editor/widget-size.editor.mjs +46 -0
  5. package/esm2020/lib/widget-board/editors/widget-size-editor/widget-size.module.mjs +21 -0
  6. package/esm2020/lib/widget-board/widget-board.component.mjs +450 -0
  7. package/esm2020/lib/widget-board/widget-board.module.mjs +111 -0
  8. package/esm2020/lib/widget-board/widget-config.component.mjs +82 -0
  9. package/esm2020/lib/widget-board/widget-host.component.mjs +295 -0
  10. package/esm2020/lib/widget-board/widget-save.component.mjs +79 -0
  11. package/esm2020/lib/widget-board/widget.class.mjs +127 -0
  12. package/esm2020/public-api.mjs +7 -0
  13. package/fesm2015/acorex-layout.mjs +1180 -0
  14. package/fesm2015/acorex-layout.mjs.map +1 -0
  15. package/fesm2020/acorex-layout.mjs +1173 -0
  16. package/fesm2020/acorex-layout.mjs.map +1 -0
  17. package/lib/widget-board/editors/widget-size-editor/widget-size.editor.d.ts +19 -0
  18. package/lib/widget-board/editors/widget-size-editor/widget-size.module.d.ts +10 -0
  19. package/lib/widget-board/widget-board.component.d.ts +61 -0
  20. package/lib/widget-board/widget-board.module.d.ts +18 -0
  21. package/lib/widget-board/widget-config.component.d.ts +23 -0
  22. package/lib/widget-board/widget-host.component.d.ts +52 -0
  23. package/lib/widget-board/widget-save.component.d.ts +19 -0
  24. package/lib/widget-board/widget.class.d.ts +58 -0
  25. package/package.json +30 -10
  26. package/{src/public-api.ts → public-api.d.ts} +6 -6
  27. package/karma.conf.js +0 -32
  28. package/ng-package.json +0 -9
  29. package/src/lib/widget-board/editors/widget-size-editor/widget-size.editor.html +0 -6
  30. package/src/lib/widget-board/editors/widget-size-editor/widget-size.editor.ts +0 -55
  31. package/src/lib/widget-board/editors/widget-size-editor/widget-size.module.ts +0 -19
  32. package/src/lib/widget-board/widget-board.component.html +0 -7
  33. package/src/lib/widget-board/widget-board.component.scss +0 -200
  34. package/src/lib/widget-board/widget-board.component.ts +0 -521
  35. package/src/lib/widget-board/widget-board.module.ts +0 -74
  36. package/src/lib/widget-board/widget-config.component.html +0 -16
  37. package/src/lib/widget-board/widget-config.component.ts +0 -99
  38. package/src/lib/widget-board/widget-host.component.html +0 -30
  39. package/src/lib/widget-board/widget-host.component.ts +0 -350
  40. package/src/lib/widget-board/widget-save.component.html +0 -43
  41. package/src/lib/widget-board/widget-save.component.ts +0 -88
  42. package/src/lib/widget-board/widget.class.ts +0 -179
  43. package/src/test.ts +0 -28
  44. package/tsconfig.lib.json +0 -23
  45. package/tsconfig.lib.prod.json +0 -6
  46. package/tsconfig.spec.json +0 -17
  47. package/tslint.json +0 -17
@@ -0,0 +1,1180 @@
1
+ import { __decorate, __metadata, __awaiter } from 'tslib';
2
+ import * as i0 from '@angular/core';
3
+ import { EventEmitter, Injectable, Component, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, ViewContainerRef, Input, Output, HostBinding, ViewChildren, NgModule } from '@angular/core';
4
+ import * as i1 from '@acorex/components';
5
+ import { propertyEditor, AXBasePopupPageComponent, AXValidationFormComponent, AXPropertyDecorators, AXProperyEditorComponent, AXSearchBoxModule, AXLoadingModule, AXProppertyEditorModule, AXPageModule, AXToolbarModule, AXLabelModule, AXTextAreaModule, AXFieldsetModule, AXTextBoxModule, AXFormGroupModule, AXTabStripModule, AXCheckBoxModule, AXMenuModule, AXValidationModule, AXNumberBoxModule } from '@acorex/components';
6
+ import * as i1$1 from '@acorex/core';
7
+ import { AXHtmlUtil, AXTranslator, AXObjectUtil, AXClientRec, AXTranslatorModule } from '@acorex/core';
8
+ import * as i2 from '@angular/common';
9
+ import { CommonModule } from '@angular/common';
10
+ import * as i1$2 from '@angular/router';
11
+ import { RouterModule } from '@angular/router';
12
+ import { FormsModule } from '@angular/forms';
13
+
14
+ // @dynamic
15
+ // TODO: Add Angular decorator.
16
+ class AXWidgetComponent {
17
+ constructor() {
18
+ this.uid = AXHtmlUtil.getUID();
19
+ this.onBusyChanged = new EventEmitter();
20
+ this._isBusy = true;
21
+ this.refreshRate = [{
22
+ id: 60000 * 5,
23
+ text: AXTranslator.get('dateTime.duration.format_minute').replace('{0}', '5')
24
+ }];
25
+ this.onConfiguredChanged = new EventEmitter();
26
+ this.onConfiguredChanged.subscribe(() => {
27
+ if (this.isConfigured === true && this.getRefreshRate()) {
28
+ this.restartRefreshTimer();
29
+ }
30
+ else {
31
+ this.stopRefreshTimer();
32
+ }
33
+ });
34
+ }
35
+ get isBusy() {
36
+ return this._isBusy;
37
+ }
38
+ set isBusy(v) {
39
+ if (v !== this._isBusy) {
40
+ const eventData = {
41
+ component: this,
42
+ oldValue: this._isBusy,
43
+ value: v
44
+ };
45
+ this._isBusy = v;
46
+ this.onBusyChanged.emit(eventData);
47
+ }
48
+ }
49
+ // ???
50
+ getRefreshRate() {
51
+ return Array.isArray(this.refreshRate) && this.refreshRate.length ? this.refreshRate[0].id : this.refreshRate;
52
+ }
53
+ startRefreshTimer() {
54
+ this.intervalId = window.setInterval(this.refresh.bind(this), this.getRefreshRate());
55
+ }
56
+ stopRefreshTimer() {
57
+ window.clearInterval(this.intervalId);
58
+ }
59
+ restartRefreshTimer() {
60
+ this.stopRefreshTimer();
61
+ this.startRefreshTimer();
62
+ }
63
+ ngOnDestroy() {
64
+ this.stopRefreshTimer();
65
+ }
66
+ redraw() {
67
+ }
68
+ refresh() {
69
+ this.restartRefreshTimer();
70
+ }
71
+ get isConfigured() {
72
+ return true;
73
+ }
74
+ setValue(name, value) {
75
+ this[name] = value;
76
+ this.onConfiguredChanged.emit();
77
+ }
78
+ getValue(name) {
79
+ var _a;
80
+ const val = this[name];
81
+ const config = this['__meta__'].config;
82
+ const runtime = (_a = config.props[name]) === null || _a === void 0 ? void 0 : _a.runtime;
83
+ if (runtime && this.provideValue) {
84
+ const res = this.provideValue({
85
+ name,
86
+ value: val,
87
+ uniqueName: config.uniqueName,
88
+ options: config.options,
89
+ });
90
+ if (this.provideValue instanceof Promise) {
91
+ return res;
92
+ }
93
+ else {
94
+ return Promise.resolve(res);
95
+ }
96
+ }
97
+ return Promise.resolve(val);
98
+ }
99
+ }
100
+ AXWidgetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
101
+ AXWidgetComponent.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetComponent });
102
+ __decorate([
103
+ propertyEditor({
104
+ editorClass: 'ax/editors/widget-size',
105
+ title: 'common.size',
106
+ visible: false,
107
+ order: -99,
108
+ }),
109
+ __metadata("design:type", Array)
110
+ ], AXWidgetComponent.prototype, "widgetSize", void 0);
111
+ __decorate([
112
+ propertyEditor({
113
+ editorClass: 'ax/editors/select',
114
+ title: 'common.refresh-rate',
115
+ visible: true,
116
+ order: -98,
117
+ editorOptions: {
118
+ items: () => {
119
+ return [1, 2, 3, 5, 10, 20, 30, 60].map(c => ({
120
+ id: 60000 * c,
121
+ text: AXTranslator.get('dateTime.duration.format_minute').replace('{0}', c.toString())
122
+ }));
123
+ },
124
+ allowNull: false,
125
+ allowSearch: false,
126
+ selectionDataMode: 'value',
127
+ selectionMode: 'single',
128
+ valueField: 'id',
129
+ }
130
+ }),
131
+ __metadata("design:type", Object)
132
+ ], AXWidgetComponent.prototype, "refreshRate", void 0);
133
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetComponent, decorators: [{
134
+ type: Injectable
135
+ }], ctorParameters: function () { return []; }, propDecorators: { widgetSize: [], refreshRate: [] } });
136
+
137
+ class AXWidgetConfigComponent extends AXBasePopupPageComponent {
138
+ constructor(cdr) {
139
+ super();
140
+ this.cdr = cdr;
141
+ this.props = [];
142
+ this.displayProps = [];
143
+ this.changes = [];
144
+ this.context = {};
145
+ }
146
+ getFooterButtons() {
147
+ return [
148
+ {
149
+ name: 'okay',
150
+ submitBehavior: true,
151
+ text: AXTranslator.get('common.confirm'),
152
+ style: 'success'
153
+ },
154
+ {
155
+ name: 'cancel',
156
+ cancelBehavior: true,
157
+ text: AXTranslator.get('common.cancel'),
158
+ style: 'danger blank'
159
+ }
160
+ ];
161
+ }
162
+ onFooterButtonClick(e) {
163
+ if (e.name === 'cancel') {
164
+ this.close();
165
+ }
166
+ if (e.name === 'okay') {
167
+ this.form.validate().then(c => {
168
+ if (c.result) {
169
+ this.close(this.changes);
170
+ }
171
+ });
172
+ }
173
+ }
174
+ handleValueChange(e) {
175
+ const prop = this.changes.find(c => c.property.name === e.property.name);
176
+ if (prop) {
177
+ prop.value = e.value;
178
+ }
179
+ else {
180
+ this.changes.push({ property: e.property, value: e.value });
181
+ }
182
+ this.updateContext();
183
+ }
184
+ ngOnInit() {
185
+ this.displayProps = this.props.filter(c => c.property.visible !== false).sort((a, b) => a.property.order - b.property.order);
186
+ this.updateContext();
187
+ }
188
+ updateContext() {
189
+ const ctx = {};
190
+ this.props.forEach(p => {
191
+ ctx[p.property.name] = p.value;
192
+ });
193
+ this.changes.forEach(p => {
194
+ ctx[p.property.name] = p.value;
195
+ });
196
+ this.context = ctx;
197
+ }
198
+ identify(index, item) {
199
+ return item.property.name;
200
+ }
201
+ }
202
+ AXWidgetConfigComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetConfigComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
203
+ AXWidgetConfigComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: AXWidgetConfigComponent, selector: "ng-component", viewQueries: [{ propertyName: "form", first: true, predicate: AXValidationFormComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<ax-page>\n <ax-page-content>\n <div class=\"container\">\n <ax-validation-form #form>\n <div class=\"row\" *ngFor=\"let p of displayProps; trackBy: identify\">\n <div class=\"col-12\">\n <ax-label>{{p.property.title | trans}}</ax-label>\n <ng-container ax-property-editor-renderer [property]=\"p\" [context]=\"context\" [host]=\"widget\" [validationForm]=\"form\"\n (onValueChange)=\"handleValueChange($event)\">\n </ng-container>\n </div>\n </div>\n </ax-validation-form>\n </div>\n </ax-page-content>\n</ax-page>", components: [{ type: i1.AXPageComponent, selector: "ax-page" }, { type: i1.AXPageContentComponent, selector: "ax-page-content" }, { type: i1.AXValidationFormComponent, selector: "ax-validation-form", inputs: ["validateOn"], outputs: ["onInit"] }, { type: i1.AXLabelComponent, selector: "ax-label", inputs: ["size"] }], directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.AXPropertyEditorRendererDirective, selector: "[ax-property-editor-renderer]", inputs: ["property", "validationForm", "context", "host", "groupId"], outputs: ["onValueChange"] }], pipes: { "trans": i1$1.AXTranslatorPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
204
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetConfigComponent, decorators: [{
205
+ type: Component,
206
+ args: [{ encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ax-page>\n <ax-page-content>\n <div class=\"container\">\n <ax-validation-form #form>\n <div class=\"row\" *ngFor=\"let p of displayProps; trackBy: identify\">\n <div class=\"col-12\">\n <ax-label>{{p.property.title | trans}}</ax-label>\n <ng-container ax-property-editor-renderer [property]=\"p\" [context]=\"context\" [host]=\"widget\" [validationForm]=\"form\"\n (onValueChange)=\"handleValueChange($event)\">\n </ng-container>\n </div>\n </div>\n </ax-validation-form>\n </div>\n </ax-page-content>\n</ax-page>" }]
207
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { form: [{
208
+ type: ViewChild,
209
+ args: [AXValidationFormComponent]
210
+ }] } });
211
+
212
+ class AXWidgetSaveComponent extends AXBasePopupPageComponent {
213
+ constructor() {
214
+ super(...arguments);
215
+ this.props = [];
216
+ }
217
+ getFooterButtons() {
218
+ return [
219
+ {
220
+ name: 'okay',
221
+ submitBehavior: true,
222
+ text: AXTranslator.get('common.confirm'),
223
+ style: 'ax success'
224
+ },
225
+ {
226
+ name: 'cancel',
227
+ cancelBehavior: true,
228
+ text: AXTranslator.get('common.cancel'),
229
+ style: 'ax light'
230
+ }
231
+ ];
232
+ }
233
+ ngOnInit() {
234
+ var _a;
235
+ const titleProp = this.props.find(c => c.property.name === 'title' || c.property.name === 'name');
236
+ const title = (titleProp === null || titleProp === void 0 ? void 0 : titleProp.value) || this.config.title;
237
+ const pp = {};
238
+ (_a = this.props) === null || _a === void 0 ? void 0 : _a.forEach(c => {
239
+ pp[c.property.name] = c.property;
240
+ });
241
+ this.data = {
242
+ component: this.config.component,
243
+ title,
244
+ uniqueName: `${this.config.uniqueName}-${AXHtmlUtil.getUID()}`,
245
+ options: AXObjectUtil.deepJSONClone(this.config.options),
246
+ props: AXObjectUtil.deepJSONClone(pp)
247
+ };
248
+ this.displayProps = this.props
249
+ .filter(c => c.property.visible !== false)
250
+ .sort((a, b) => a.property.order - b.property.order)
251
+ .map(c => ({
252
+ name: c.property.name,
253
+ title: c.property.title,
254
+ allow: true
255
+ }));
256
+ }
257
+ onFooterButtonClick(e) {
258
+ if (e.name === 'cancel') {
259
+ this.close();
260
+ }
261
+ if (e.name === 'okay') {
262
+ this.props.forEach(p => {
263
+ const pp = this.displayProps.find(c => c.name === p.property.name);
264
+ if (pp == null || !pp.allow) {
265
+ let ppp = this.data.props[p.property.name];
266
+ if (ppp) {
267
+ ppp.visible = false;
268
+ }
269
+ else {
270
+ ppp = { visible: false };
271
+ }
272
+ }
273
+ });
274
+ this.close(this.data);
275
+ }
276
+ }
277
+ }
278
+ AXWidgetSaveComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetSaveComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
279
+ AXWidgetSaveComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: AXWidgetSaveComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<ax-page>\n <ax-page-content>\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-12\">\n <ax-form-group>\n <ax-label>{{'common.title' | trans}}</ax-label>\n <ax-text-box [(value)]=\"data.title\"></ax-text-box>\n </ax-form-group>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <ax-form-group>\n <ax-label>{{'common.description' | trans}}</ax-label>\n <ax-text-area [(value)]=\"data.description\"></ax-text-area>\n </ax-form-group>\n </div>\n </div>\n <!-- <div class=\"row\">\n <div class=\"col-12\">\n <ax-form-group>\n <ax-label>{{'common.uniquename' | trans}}</ax-label>\n <ax-text-box></ax-text-box>\n </ax-form-group>\n </div>\n </div> -->\n <div class=\"row\" style=\"margin-block-end: var(--ax-size-md);margin-block-start: var(--ax-size-md);\">\n <div class=\"col-12\">\n <ax-fieldset caption=\"{{'widget-board.configurable-props' | trans}}\">\n <div class=\"row\" *ngFor=\"let prop of displayProps\">\n <div class=\"col-12\" style=\"margin-block-end: var(--ax-size-sm)\">\n <ax-check-box [(value)]=\"prop.allow\" label=\"{{ prop.title | trans }}\">\n\n </ax-check-box>\n </div>\n </div>\n </ax-fieldset>\n </div>\n </div>\n </div>\n </ax-page-content>\n</ax-page>", components: [{ type: i1.AXPageComponent, selector: "ax-page" }, { type: i1.AXPageContentComponent, selector: "ax-page-content" }, { type: i1.AXFormGroupComponent, selector: "ax-form-group", inputs: ["size"] }, { type: i1.AXLabelComponent, selector: "ax-label", inputs: ["size"] }, { type: i1.AXTextBoxComponent, selector: "ax-text-box", inputs: ["mask", "type", "showMask", "maxLength", "maskGuid", "maskPlaceholder", "maskKeepCharPositions"] }, { type: i1.AXTextAreaComponent, selector: "ax-text-area", inputs: ["rows", "cols", "maxLength"] }, { type: i1.AXFieldsetComponent, selector: "ax-fieldset", inputs: ["size", "caption", "allowCollapse"] }, { type: i1.AXCheckBoxComponent, selector: "ax-check-box", inputs: ["readonly", "disabled", "size", "label", "tabIndex", "indeterminate", "value"], outputs: ["onValueChanged", "valueChange", "onClick"] }], directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "trans": i1$1.AXTranslatorPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
280
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetSaveComponent, decorators: [{
281
+ type: Component,
282
+ args: [{ encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ax-page>\n <ax-page-content>\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-12\">\n <ax-form-group>\n <ax-label>{{'common.title' | trans}}</ax-label>\n <ax-text-box [(value)]=\"data.title\"></ax-text-box>\n </ax-form-group>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <ax-form-group>\n <ax-label>{{'common.description' | trans}}</ax-label>\n <ax-text-area [(value)]=\"data.description\"></ax-text-area>\n </ax-form-group>\n </div>\n </div>\n <!-- <div class=\"row\">\n <div class=\"col-12\">\n <ax-form-group>\n <ax-label>{{'common.uniquename' | trans}}</ax-label>\n <ax-text-box></ax-text-box>\n </ax-form-group>\n </div>\n </div> -->\n <div class=\"row\" style=\"margin-block-end: var(--ax-size-md);margin-block-start: var(--ax-size-md);\">\n <div class=\"col-12\">\n <ax-fieldset caption=\"{{'widget-board.configurable-props' | trans}}\">\n <div class=\"row\" *ngFor=\"let prop of displayProps\">\n <div class=\"col-12\" style=\"margin-block-end: var(--ax-size-sm)\">\n <ax-check-box [(value)]=\"prop.allow\" label=\"{{ prop.title | trans }}\">\n\n </ax-check-box>\n </div>\n </div>\n </ax-fieldset>\n </div>\n </div>\n </div>\n </ax-page-content>\n</ax-page>" }]
283
+ }] });
284
+
285
+ class AXWidgetHostComponent {
286
+ constructor(ref, componentFactoryResolver, rendererService, cdr, popup, loadingService) {
287
+ this.ref = ref;
288
+ this.componentFactoryResolver = componentFactoryResolver;
289
+ this.rendererService = rendererService;
290
+ this.cdr = cdr;
291
+ this.popup = popup;
292
+ this.loadingService = loadingService;
293
+ this._hasProps = false;
294
+ this._hasMenu = false;
295
+ this.configMenuItem = [
296
+ {
297
+ icon: 'far fa-ellipsis-h',
298
+ items: []
299
+ }
300
+ ];
301
+ this.onRemove = new EventEmitter();
302
+ this.onConfigChanged = new EventEmitter();
303
+ this.onResized = new EventEmitter();
304
+ this.onSave = new EventEmitter();
305
+ this.readonly = false;
306
+ this._isLoading = false;
307
+ this.sizeX = 1;
308
+ this.sizeY = 1;
309
+ this.col = 1;
310
+ this.row = 1;
311
+ }
312
+ get widget() {
313
+ return this._widget;
314
+ }
315
+ get element() {
316
+ return this.ref.nativeElement;
317
+ }
318
+ get isLoading() {
319
+ return this._isLoading;
320
+ }
321
+ set isLoading(v) {
322
+ this._isLoading = v;
323
+ if (this._loadingId && !v) {
324
+ this.loadingService.hide(this._loadingId);
325
+ this._loadingId = null;
326
+ }
327
+ if (v) {
328
+ this._loadingId = this.loadingService.show(this.ref.nativeElement);
329
+ }
330
+ }
331
+ get isConfigured() {
332
+ var _a;
333
+ return ((_a = this._widget) === null || _a === void 0 ? void 0 : _a.isConfigured) || false;
334
+ }
335
+ ngOnInit() {
336
+ this.isLoading = true;
337
+ }
338
+ ngAfterViewInit() {
339
+ return __awaiter(this, void 0, void 0, function* () {
340
+ let component;
341
+ if (typeof this.config.component === 'string') {
342
+ const route = yield this.rendererService.findLoadedComponentByRoute(this.config.component, 20);
343
+ component = route === null || route === void 0 ? void 0 : route.component;
344
+ }
345
+ else if (typeof this.config.component === 'function') {
346
+ component = this.config.component;
347
+ }
348
+ if (component == null) {
349
+ console.error(`Invalid Widget Component!`, this.config);
350
+ this.onRemove.emit(this);
351
+ return;
352
+ }
353
+ const widgetFactory = this.componentFactoryResolver.resolveComponentFactory(component);
354
+ this.componentRef = this.vc.createComponent(widgetFactory);
355
+ this._widget = this.componentRef.instance;
356
+ this._widget.provideValue = this.provideValue;
357
+ if (this._widget.onBusyChanged) {
358
+ this._widget.onBusyChanged.subscribe((d) => {
359
+ if (!this._widget.widgetSize) {
360
+ this._widget.setValue('widgetSize', [this.sizeX, this.sizeY]);
361
+ }
362
+ else {
363
+ this.setSizeFromOptions();
364
+ }
365
+ this.isLoading = d.value;
366
+ this.cdr.detectChanges();
367
+ });
368
+ }
369
+ if (this._widget.onConfiguredChanged) {
370
+ this._widget.onConfiguredChanged.subscribe(() => {
371
+ this.setSizeFromOptions();
372
+ });
373
+ }
374
+ //
375
+ if (this.config.options) {
376
+ Object.assign(this._widget, this.config.options);
377
+ }
378
+ this._hasProps = AXPropertyDecorators.getProperties(this._widget).length > 0;
379
+ this.isLoading = false;
380
+ this.config['__meta__'].instance = this;
381
+ this._widget['__meta__'] = {};
382
+ this._widget['__meta__'].config = this.config;
383
+ //
384
+ this.configMenuItem[0].items.push({
385
+ name: 'refresh',
386
+ icon: 'far fa-undo',
387
+ text: AXTranslator.get('common.refresh'),
388
+ onClick: () => {
389
+ var _a;
390
+ (_a = this === null || this === void 0 ? void 0 : this.widget) === null || _a === void 0 ? void 0 : _a.refresh();
391
+ }
392
+ });
393
+ //
394
+ if (this._hasProps) {
395
+ this.configMenuItem[0].items.push({
396
+ name: 'configs',
397
+ icon: 'far fa-cogs',
398
+ text: AXTranslator.get('common.configs'),
399
+ onClick: () => {
400
+ this.openConfigDialog();
401
+ }
402
+ });
403
+ }
404
+ this.configMenuItem[0].items.push({
405
+ name: 'save',
406
+ icon: 'far fa-save',
407
+ text: AXTranslator.get('common.save-as'),
408
+ onClick: () => {
409
+ this.openSaveDialog();
410
+ }
411
+ });
412
+ if (true) {
413
+ this.configMenuItem[0].items.push({
414
+ name: 'remove',
415
+ icon: 'far fa-times',
416
+ style: 'ax danger blank',
417
+ text: AXTranslator.get('common.remove'),
418
+ onClick: () => {
419
+ this.onRemove.emit(this);
420
+ }
421
+ });
422
+ }
423
+ this._hasMenu = this.configMenuItem[0].items.length > 0;
424
+ this.cdr.detectChanges();
425
+ });
426
+ }
427
+ setSizeFromOptions() {
428
+ this._widget.getValue('widgetSize').then(c => {
429
+ const oldSizeX = this.sizeX;
430
+ const oldSizeY = this.sizeY;
431
+ if (c && Array.isArray(c) && (oldSizeX !== c[0] || oldSizeY !== c[1])) {
432
+ this.config.sizeX = this.sizeX = c[0];
433
+ this.config.sizeY = this.sizeY = c[1];
434
+ this.onResized.emit({
435
+ component: this._widget,
436
+ config: this.config
437
+ });
438
+ }
439
+ this.cdr.detectChanges();
440
+ });
441
+ }
442
+ remove(e) {
443
+ e.preventDefault();
444
+ e.stopPropagation();
445
+ if (!this.readonly)
446
+ this.onRemove.emit(this);
447
+ return false;
448
+ }
449
+ handleConfig(e) {
450
+ e.preventDefault();
451
+ e.stopPropagation();
452
+ if (!this.readonly)
453
+ this.openConfigDialog();
454
+ return false;
455
+ }
456
+ openConfigDialog() {
457
+ const ppp = this.getMergedProps();
458
+ this.popup.open(AXWidgetConfigComponent, {
459
+ title: AXTranslator.get('common.configs'),
460
+ size: 'sm',
461
+ data: {
462
+ props: ppp.map(c => ({ property: c.options, value: this._widget[c.options.name] })),
463
+ widget: this.widget
464
+ }
465
+ }).then(c => {
466
+ if (c.data) {
467
+ if (!this.config.options) {
468
+ this.config.options = {};
469
+ }
470
+ c.data.forEach(p => {
471
+ this._widget.setValue(p.property.name, p.value);
472
+ this.config.options[p.property.name] = p.value;
473
+ });
474
+ this.emitConfigChanged();
475
+ this._widget.redraw();
476
+ this.cdr.detectChanges();
477
+ }
478
+ });
479
+ }
480
+ openSaveDialog() {
481
+ const ppp = this.getMergedProps();
482
+ this.popup.open(AXWidgetSaveComponent, {
483
+ title: AXTranslator.get('common.save-as'),
484
+ size: 'sm',
485
+ data: {
486
+ config: this.config,
487
+ props: ppp.map(c => ({ property: c.options, value: this._widget[c.options.name] }))
488
+ }
489
+ }).then(c => {
490
+ if (c.data) {
491
+ this.onSave.emit({
492
+ component: this._widget,
493
+ data: c.data
494
+ });
495
+ }
496
+ });
497
+ }
498
+ handleOptionClick(e) {
499
+ e.preventDefault();
500
+ e.stopPropagation();
501
+ this.openConfigDialog();
502
+ return false;
503
+ }
504
+ ngOnDestroy() {
505
+ this.vc.clear();
506
+ if (this.componentRef) {
507
+ this.componentRef.destroy();
508
+ }
509
+ }
510
+ getMergedProps() {
511
+ const ppp = AXObjectUtil.deepCopy(AXPropertyDecorators.getProperties(this._widget));
512
+ for (const key in this.config.props) {
513
+ if (Object.prototype.hasOwnProperty.call(this.config.props, key)) {
514
+ const newP = this.config.props[key];
515
+ const existPropDec = ppp.find(p => p.property === key);
516
+ if (existPropDec) {
517
+ Object.assign(existPropDec.options, newP);
518
+ }
519
+ }
520
+ }
521
+ return ppp;
522
+ }
523
+ emitConfigChanged() {
524
+ this.onConfigChanged.emit({
525
+ component: this._widget,
526
+ config: this.config
527
+ });
528
+ }
529
+ }
530
+ 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$1.AXRenderService }, { token: i0.ChangeDetectorRef }, { token: i1.AXPopupService }, { token: i1.AXLoadingService }], target: i0.ɵɵFactoryTarget.Component });
531
+ 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: i1.AXMenuComponent, selector: "ax-menu", inputs: ["menuTemplate", "rtl", "size", "selection", "mode", "target", "floatAlignment", "floatPlacemnet", "direction", "items"], outputs: ["onItemClick"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "trans": i1$1.AXTranslatorPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetHostComponent, decorators: [{
533
+ type: Component,
534
+ 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>" }]
535
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ComponentFactoryResolver }, { type: i1$1.AXRenderService }, { type: i0.ChangeDetectorRef }, { type: i1.AXPopupService }, { type: i1.AXLoadingService }]; }, propDecorators: { provideValue: [{
536
+ type: Input
537
+ }], onRemove: [{
538
+ type: Output
539
+ }], onConfigChanged: [{
540
+ type: Output
541
+ }], onResized: [{
542
+ type: Output
543
+ }], onSave: [{
544
+ type: Output
545
+ }], config: [{
546
+ type: Input
547
+ }], vc: [{
548
+ type: ViewChild,
549
+ args: ['vc', { read: ViewContainerRef }]
550
+ }], readonly: [{
551
+ type: Input
552
+ }], sizeX: [{
553
+ type: HostBinding,
554
+ args: ['attr.data-size-x']
555
+ }, {
556
+ type: Input
557
+ }], sizeY: [{
558
+ type: HostBinding,
559
+ args: ['attr.data-size-y']
560
+ }, {
561
+ type: Input
562
+ }], col: [{
563
+ type: HostBinding,
564
+ args: ['attr.data-col']
565
+ }, {
566
+ type: Input
567
+ }], row: [{
568
+ type: HostBinding,
569
+ args: ['attr.data-row']
570
+ }, {
571
+ type: Input
572
+ }] } });
573
+
574
+ class AXWidgetBoardComponent {
575
+ constructor(ref, zone, cdr) {
576
+ this.ref = ref;
577
+ this.zone = zone;
578
+ this.cdr = cdr;
579
+ this.widgets = [];
580
+ this.galleryItems = [];
581
+ this.tileSize = 80;
582
+ this.gapSize = 5;
583
+ this.readonly = false;
584
+ this.newWidget = null;
585
+ this._isInEditing = false;
586
+ this.isDragging = false;
587
+ this.DATA_COL = 'data-col';
588
+ this.DATA_ROW = 'data-row';
589
+ this.DATA_SIZE_X = 'data-size-x';
590
+ this.DATA_SIZE_Y = 'data-size-y';
591
+ this.DATA_OLD_COL = 'data-old-col';
592
+ this.DATA_OLD_ROW = 'data-old-row';
593
+ this.onConfigChanged = new EventEmitter();
594
+ this.onWidgetSave = new EventEmitter();
595
+ }
596
+ isInEditing() {
597
+ return this._isInEditing;
598
+ }
599
+ ngOnInit() {
600
+ if (this.rtl == null) {
601
+ this.rtl = window.getComputedStyle(this.ref.nativeElement, null).getPropertyValue('direction') === 'rtl';
602
+ }
603
+ }
604
+ ngAfterViewInit() {
605
+ this.zone.runOutsideAngular((c) => {
606
+ const style = document.createElement('style');
607
+ style.type = 'text/css';
608
+ this.ref.nativeElement.appendChild(style);
609
+ // add css data classes
610
+ for (let i = 1; i <= 50; i++) {
611
+ style.innerHTML += `[${this.DATA_COL}="${i}"] { ${this.rtl ? 'right' : 'left'}: ${(i - 1) * (this.tileSize + this.gapSize)}px; }`;
612
+ style.innerHTML += `[${this.DATA_ROW}="${i}"] { top: ${(i - 1) * (this.tileSize + this.gapSize)}px; }`;
613
+ style.innerHTML += `[${this.DATA_SIZE_X}="${i}"] { width: ${(i * this.tileSize) + ((i - 1) * this.gapSize)}px; }`;
614
+ style.innerHTML += `[${this.DATA_SIZE_Y}="${i}"] { height: ${(i * this.tileSize) + ((i - 1) * this.gapSize)}px; }`;
615
+ }
616
+ });
617
+ }
618
+ calcGridSize() {
619
+ this.zone.runOutsideAngular(() => {
620
+ const width = (Math.max(...this.widgets.map((c) => c.col + c.sizeX - 1))) * (this.tileSize + this.gapSize);
621
+ const height = (Math.max(...this.widgets.map((c) => c.row + c.sizeY - 1))) * (this.tileSize + this.gapSize);
622
+ this.container.nativeElement.style.width = width + 'px';
623
+ this.container.nativeElement.style.height = height + 'px';
624
+ });
625
+ }
626
+ toggleEdit() {
627
+ this._isInEditing ? this.finishEdit() : this.startEdit();
628
+ }
629
+ dragStart(e) {
630
+ e.preventDefault();
631
+ e.stopPropagation();
632
+ this.zone.runOutsideAngular(() => {
633
+ if (this._isInEditing && e.which === 1) {
634
+ this.dragItem = e.currentTarget;
635
+ this.dragItem.setAttribute('data-x-offset', (this.dragItem.offsetLeft - e.clientX).toString());
636
+ //
637
+ this.dragItem.setAttribute('data-y-offset', (this.dragItem.offsetTop - e.clientY).toString());
638
+ this.dragItem.classList.add('widget-dragging');
639
+ this.dragItem.classList.remove('animate__animated', 'animate__pulse');
640
+ }
641
+ });
642
+ return false;
643
+ }
644
+ removePositionData() {
645
+ this.zone.runOutsideAngular(() => {
646
+ if (this.dragItem && this._isInEditing && this.dragItem.getAttribute(this.DATA_OLD_COL) == null) {
647
+ this.dragItem.setAttribute(this.DATA_OLD_COL, this.dragItem.getAttribute(this.DATA_COL));
648
+ this.dragItem.setAttribute(this.DATA_OLD_ROW, this.dragItem.getAttribute(this.DATA_ROW));
649
+ this.dragItem.removeAttribute(this.DATA_COL);
650
+ this.dragItem.removeAttribute(this.DATA_ROW);
651
+ }
652
+ });
653
+ }
654
+ resetPositionData() {
655
+ this.zone.runOutsideAngular(() => {
656
+ if (this.dragItem && this._isInEditing) {
657
+ this.setPosition(this.dragItem, this.dragItem.getAttribute(this.DATA_OLD_COL), this.dragItem.getAttribute(this.DATA_OLD_ROW));
658
+ }
659
+ });
660
+ }
661
+ setPosition(element, col, row) {
662
+ this.zone.runOutsideAngular(() => {
663
+ element.setAttribute(this.DATA_COL, col);
664
+ element.setAttribute(this.DATA_ROW, row);
665
+ element.removeAttribute(this.DATA_OLD_COL);
666
+ element.removeAttribute(this.DATA_OLD_ROW);
667
+ element.style.removeProperty('top');
668
+ element.style.removeProperty('left');
669
+ const widget = this.widgets.find(c => c['__meta__'].instance.element === element);
670
+ widget.col = Number(col);
671
+ widget.row = Number(row);
672
+ });
673
+ }
674
+ drag(e) {
675
+ e.preventDefault();
676
+ e.stopPropagation();
677
+ this.zone.runOutsideAngular(() => {
678
+ if (this.dragItem && this._isInEditing) {
679
+ this.isDragging = true;
680
+ this.addPlaceholder();
681
+ const xOffset = Number(this.dragItem.getAttribute('data-x-offset'));
682
+ const yOffset = Number(this.dragItem.getAttribute('data-y-offset'));
683
+ this.dragItem.style.left = e.clientX + xOffset + 'px';
684
+ this.dragItem.style.top = e.clientY + yOffset + 'px';
685
+ //
686
+ this.detectBestPlacement();
687
+ this.removePositionData();
688
+ }
689
+ });
690
+ return false;
691
+ }
692
+ dragEnd(e) {
693
+ this.zone.runOutsideAngular(() => {
694
+ if (this.dragItem && this._isInEditing && this.isDragging) {
695
+ this.dragItem.classList.remove('widget-dragging');
696
+ this.dragItem.classList.add('animate__animated', 'animate__pulse');
697
+ //
698
+ const p = this.container.nativeElement.querySelector('.widget-blank-placeholder');
699
+ if (this.newWidget) {
700
+ const w = {
701
+ uniqueName: this.newWidget.uniqueName,
702
+ component: this.newWidget.component,
703
+ title: this.newWidget.title,
704
+ options: this.newWidget.options,
705
+ sizeX: this.newWidget.sizeX,
706
+ sizeY: this.newWidget.sizeY,
707
+ col: Number(p.getAttribute(this.DATA_COL)),
708
+ row: Number(p.getAttribute(this.DATA_ROW))
709
+ };
710
+ this.widgets.push(w);
711
+ this.newWidget = null;
712
+ this.container.nativeElement.removeChild(this.dragItem);
713
+ this.zone.run(() => {
714
+ this.cdr.detectChanges();
715
+ this.calcGridSize();
716
+ setTimeout(() => {
717
+ w['__meta__'].instance.element.addEventListener('mousedown', this.dragStart.bind(this), false);
718
+ }, 1000);
719
+ });
720
+ }
721
+ else {
722
+ if (p) {
723
+ this.setPosition(this.dragItem, p.getAttribute(this.DATA_COL), p.getAttribute(this.DATA_ROW));
724
+ }
725
+ else {
726
+ this.setPosition(this.dragItem, this.dragItem.getAttribute(this.DATA_OLD_COL), this.dragItem.getAttribute(this.DATA_OLD_ROW));
727
+ }
728
+ }
729
+ //
730
+ this.removePlaceholder();
731
+ this.dragItem = null;
732
+ this.calcGridSize();
733
+ this.emitConfigChanged('config');
734
+ }
735
+ this.isDragging = false;
736
+ });
737
+ }
738
+ detectFirstEmptySlot(w) {
739
+ const xTile = Math.floor(this.ref.nativeElement.parentElement.offsetWidth / this.tileSize);
740
+ for (let j = 1; j <= 100; j++) {
741
+ for (let i = 1; i <= xTile - w.sizeX; i++) {
742
+ const rec = new AXClientRec({
743
+ left: i,
744
+ top: j,
745
+ width: w.sizeX,
746
+ height: w.sizeY
747
+ });
748
+ const el = this.widgets.filter(c => c !== w).find((c) => rec.intersect({
749
+ left: c.col,
750
+ top: c.row,
751
+ width: c.sizeX,
752
+ height: c.sizeY
753
+ }));
754
+ if (el == null) {
755
+ w.col = i;
756
+ w.row = j;
757
+ return;
758
+ }
759
+ }
760
+ }
761
+ }
762
+ detectBestPlacement() {
763
+ this.zone.runOutsideAngular(() => {
764
+ const p = this.container.nativeElement.querySelector('.widget-blank-placeholder');
765
+ let col = Math.ceil(this.dragItem.offsetLeft / this.tileSize);
766
+ if (this.rtl) {
767
+ col = Math.ceil((this.container.nativeElement.clientWidth - (this.dragItem.offsetLeft + this.dragItem.clientWidth)) / this.tileSize);
768
+ }
769
+ let row = Math.ceil(this.dragItem.offsetTop / this.tileSize);
770
+ if (col < 1) {
771
+ col = 1;
772
+ }
773
+ if (row < 1) {
774
+ row = 1;
775
+ }
776
+ const widgets = Array.from(this.ref.nativeElement.querySelectorAll('.widget-host')).map((c) => c);
777
+ p.setAttribute(this.DATA_COL, col.toString());
778
+ p.setAttribute(this.DATA_ROW, row.toString());
779
+ const collision = widgets.filter(c => c !== this.dragItem).some(c => AXHtmlUtil.collision(c, this.dragItem));
780
+ if (collision) {
781
+ this.removePlaceholder();
782
+ }
783
+ });
784
+ }
785
+ addPlaceholder() {
786
+ this.zone.runOutsideAngular(() => {
787
+ this.removePlaceholder();
788
+ if (this.dragItem) {
789
+ const p = document.createElement('div');
790
+ p.classList.add('widget-blank-placeholder');
791
+ p.setAttribute(this.DATA_COL, this.dragItem.getAttribute(this.DATA_COL));
792
+ p.setAttribute(this.DATA_ROW, this.dragItem.getAttribute(this.DATA_ROW));
793
+ p.setAttribute(this.DATA_SIZE_X, this.dragItem.getAttribute(this.DATA_SIZE_X));
794
+ p.setAttribute(this.DATA_SIZE_Y, this.dragItem.getAttribute(this.DATA_SIZE_Y));
795
+ this.container.nativeElement.appendChild(p);
796
+ }
797
+ });
798
+ }
799
+ removePlaceholder() {
800
+ const p = this.container.nativeElement.querySelector('.widget-blank-placeholder');
801
+ p === null || p === void 0 ? void 0 : p.remove();
802
+ }
803
+ startEdit() {
804
+ this._isInEditing = true;
805
+ this.calcGridSize();
806
+ this.ref.nativeElement.classList.add('grid-background');
807
+ const bg = this.ref.nativeElement;
808
+ bg.style.setProperty('background-position', `${this.rtl ? 'right' : 'left'} top`);
809
+ // tslint:disable-next-line: max-line-length
810
+ const pattern = `url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="${this.tileSize + this.gapSize}" height="${this.tileSize + this.gapSize}"> <rect style="fill: %23dadada" x="${this.rtl ? this.gapSize : 0}" width="${this.tileSize}" height="${this.tileSize}" y="0"></rect></svg>')`;
811
+ bg.style.setProperty('background-image', pattern);
812
+ //
813
+ const widgets = Array.from(this.ref.nativeElement.querySelectorAll('.widget-host'));
814
+ widgets.forEach((w) => {
815
+ w.addEventListener('mousedown', this.dragStart.bind(this), false);
816
+ });
817
+ this.ref.nativeElement.addEventListener('mousemove', this.drag.bind(this), false);
818
+ this.ref.nativeElement.addEventListener('mouseup', this.dragEnd.bind(this), false);
819
+ }
820
+ finishEdit() {
821
+ this.ref.nativeElement.classList.remove('grid-background');
822
+ const bg = this.ref.nativeElement;
823
+ bg.style.removeProperty('background-image');
824
+ //
825
+ this._isInEditing = false;
826
+ const widgets = Array.from(this.ref.nativeElement.querySelectorAll('.widget-host'));
827
+ widgets.forEach((w) => {
828
+ w.removeEventListener('mousedown', this.dragStart.bind(this), false);
829
+ });
830
+ this.ref.nativeElement.removeEventListener('mousemove', this.drag.bind(this), false);
831
+ this.ref.nativeElement.removeEventListener('mouseup', this.dragEnd.bind(this), false);
832
+ this.emitConfigChanged('config');
833
+ }
834
+ addWidget(widget) {
835
+ this.zone.runOutsideAngular(() => {
836
+ this.newWidget = {
837
+ uniqueName: widget.uniqueName,
838
+ component: widget.component,
839
+ title: widget.title,
840
+ col: 1,
841
+ row: 1,
842
+ sizeX: widget.sizeX,
843
+ sizeY: widget.sizeY,
844
+ options: widget.options,
845
+ props: widget.props
846
+ };
847
+ this.detectFirstEmptySlot(this.newWidget);
848
+ const w = {
849
+ uniqueName: this.newWidget.uniqueName,
850
+ component: this.newWidget.component,
851
+ title: this.newWidget.title,
852
+ options: this.newWidget.options,
853
+ props: this.newWidget.props,
854
+ sizeX: this.newWidget.sizeX,
855
+ sizeY: this.newWidget.sizeY,
856
+ col: this.newWidget.col,
857
+ row: this.newWidget.row
858
+ };
859
+ this.widgets.push(w);
860
+ this.newWidget = null;
861
+ this.zone.run(() => {
862
+ this.cdr.detectChanges();
863
+ this.calcGridSize();
864
+ this.emitConfigChanged('add');
865
+ setTimeout(() => {
866
+ w['__meta__'].instance.element.addEventListener('mousedown', this.dragStart.bind(this), false);
867
+ }, 1000);
868
+ });
869
+ });
870
+ }
871
+ handleOnRemove(w) {
872
+ w.element.classList.add('animate__animated', 'animate__zoomOut');
873
+ w.element.addEventListener('animationend', () => {
874
+ this.widgets = this.widgets.filter((c) => c.__meta__.id !== w.config.__meta__.id);
875
+ this.cdr.detectChanges();
876
+ this.calcGridSize();
877
+ this.emitConfigChanged('remove');
878
+ });
879
+ }
880
+ handleOnSave(e) {
881
+ this.onWidgetSave.emit(e);
882
+ }
883
+ trackByFn(index, item) {
884
+ var _a, _b;
885
+ if (!((_a = item['__meta__']) === null || _a === void 0 ? void 0 : _a.id)) {
886
+ item['__meta__'] = {};
887
+ item['__meta__'].id = AXHtmlUtil.getUID();
888
+ }
889
+ return (_b = item['__meta__']) === null || _b === void 0 ? void 0 : _b.id;
890
+ }
891
+ load(widgets) {
892
+ this.clear();
893
+ return new Promise((resolve, reject) => {
894
+ if (widgets) {
895
+ const loadedWidgets = [];
896
+ if (typeof widgets === 'string') {
897
+ try {
898
+ loadedWidgets.push(...JSON.parse(widgets));
899
+ this.emitConfigChanged('load');
900
+ }
901
+ catch (error) {
902
+ reject('Invalid widget json data!');
903
+ }
904
+ }
905
+ else {
906
+ loadedWidgets.push(...widgets);
907
+ this.emitConfigChanged('load');
908
+ }
909
+ let intervalId = -1;
910
+ const loadFunc = () => {
911
+ if (this.galleryItems && this.galleryItems.length > 0) {
912
+ loadedWidgets.forEach(w => {
913
+ const gitem = this.galleryItems.find(c => c.uniqueName === w.uniqueName);
914
+ if (gitem) {
915
+ w.component = gitem.component;
916
+ if (gitem.props) {
917
+ w.props = JSON.parse(JSON.stringify(gitem.props));
918
+ }
919
+ }
920
+ });
921
+ this.widgets.push(...loadedWidgets);
922
+ this.emitConfigChanged('load');
923
+ window.clearInterval(intervalId);
924
+ this.cdr.detectChanges();
925
+ resolve();
926
+ }
927
+ };
928
+ intervalId = window.setInterval(loadFunc, 200);
929
+ }
930
+ else {
931
+ resolve();
932
+ }
933
+ });
934
+ }
935
+ clear() {
936
+ if (this.widgets.length) {
937
+ this.widgets = [];
938
+ this.cdr.detectChanges();
939
+ this.emitConfigChanged('clear');
940
+ }
941
+ }
942
+ save() {
943
+ const obj = this.widgets.map(c => ({
944
+ uniqueName: c.uniqueName,
945
+ component: c.component,
946
+ title: c.title,
947
+ sizeX: c.sizeX,
948
+ sizeY: c.sizeY,
949
+ col: c.col,
950
+ row: c.row,
951
+ options: c.options,
952
+ props: c.props
953
+ }));
954
+ return Promise.resolve(JSON.stringify(obj));
955
+ }
956
+ refresh() {
957
+ this.widgetHosts.forEach(host => {
958
+ host.widget.refresh();
959
+ });
960
+ }
961
+ handleOnConfigChanged(e) {
962
+ this.cdr.detectChanges();
963
+ this.emitConfigChanged('config');
964
+ }
965
+ handleOnResizedChanged(e) {
966
+ this.detectFirstEmptySlot(e.config);
967
+ this.cdr.detectChanges();
968
+ this.emitConfigChanged('config');
969
+ }
970
+ //private resizeChangeObserver: any;
971
+ emitConfigChanged(mode) {
972
+ // if (!this.resizeChangeObserver) {
973
+ // this.resizeChangeObserver = new Observable();
974
+ // Observable.create(observer => {
975
+ // this.resizeChangeObserver = observer;
976
+ // })
977
+ // .pipe(debounceTime(750))
978
+ // .pipe(distinctUntilChanged())
979
+ // .subscribe(c => {
980
+ // this.onConfigChanged.emit({
981
+ // component: this
982
+ // });
983
+ // });
984
+ // }
985
+ // this.resizeChangeObserver.next(new Date());
986
+ this.onConfigChanged.emit({
987
+ component: this,
988
+ mode
989
+ });
990
+ }
991
+ }
992
+ AXWidgetBoardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetBoardComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
993
+ AXWidgetBoardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: AXWidgetBoardComponent, selector: "ax-widget-board", inputs: { galleryItems: "galleryItems", tileSize: "tileSize", gapSize: "gapSize", readonly: "readonly", provideValue: "provideValue" }, outputs: { onConfigChanged: "onConfigChanged", onWidgetSave: "onWidgetSave" }, host: { classAttribute: "ax widget-board" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }, { propertyName: "widgetHosts", predicate: AXWidgetHostComponent, descendants: true }], ngImport: i0, template: "<div class=\"widgets-container\" [class.rtl]=\"rtl\" #container>\n <ax-widget-host *ngFor=\"let w of widgets;trackBy: trackByFn\" [config]='w' [sizeX]=\"w.sizeX\" [readonly]=\"readonly || w.readonly\"\n [sizeY]=\"w.sizeY\" [col]=\"w.col\" [row]=\"w.row\" (onRemove)=\"handleOnRemove($event)\" (onSave)=\"handleOnSave($event)\"\n (onConfigChanged)=\"handleOnConfigChanged($event)\" (onResized)=\"handleOnResizedChanged($event)\"\n [provideValue]=\"provideValue\">\n </ax-widget-host>\n</div>\n", styles: [".widget-board{display:inline-block;margin:15px 20px;min-width:calc(100% - 40px);min-height:calc(100% - 34px);--animate-duration: .5s;background-repeat:no-repeat}.widget-board.grid-background{background-repeat:repeat!important}.widget-board.grid-background .widgets-container .widget-host{touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.widget-board.grid-background .widgets-container .widget-host .widget-edit-overlay{display:block;cursor:move}.widget-board.grid-background .widgets-container .widget-host.widget-dragging{z-index:1000}.widget-board.grid-background .widgets-container .widget-host:focus{outline-width:1px;outline-style:solid;outline-color:var(--ax-primary-color)}.widget-board.grid-background .widget-blank-placeholder{background:var(--ax-primary-trans-light-color);position:absolute}.widget-board .widgets-container{position:relative;touch-action:none}.widget-board .widgets-container.rtl .widget-host .widget-options-menu{right:unset!important;left:0!important}.widget-board .widgets-container .widget-host{position:absolute;background:#fff;box-shadow:2px 2px 3px #dadada;z-index:0}.widget-board .widgets-container .widget-host .widget-content{width:100%;height:100%;display:flex;flex-direction:column}.widget-board .widgets-container .widget-host .widget-content .widget-title{padding:var(--ax-size-md);text-align:start;font-size:1.5em;position:absolute}.widget-board .widgets-container .widget-host .widget-edit-loading{display:none;background:rgba(255,255,255,.85);position:absolute;width:100%;height:100%;top:0;left:0;z-index:2;display:flex}.widget-board .widgets-container .widget-host .widget-config-overlay{position:absolute;background:white;width:100%;height:100%;top:0;left:0;z-index:1;padding:var(--ax-size-md);cursor:pointer}.widget-board .widgets-container .widget-host .widget-config-overlay:hover .widget-title{text-decoration:underline}.widget-board .widgets-container .widget-host .widget-config-overlay .widget-title{text-align:start;font-size:1.5em}.widget-board .widgets-container .widget-host .widget-config-overlay .widget-config-box{align-self:center;text-align:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:var(--ax-gray-dark-color)}.widget-board .widgets-container .widget-host .widget-config-overlay .widget-config-box .config-title{font-size:1.2em;margin-bottom:var(--ax-size-md)}.widget-board .widgets-container .widget-host .widget-edit-overlay{display:none;background:rgba(255,255,255,.5);position:absolute;width:100%;height:100%;top:0;left:0;z-index:10}.widget-board .widgets-container .widget-host .widget-edit-overlay .widget-edit-menu{margin:6px;text-align:end;float:inline-end;opacity:1;transition:opacity 1s ease}.widget-board .widgets-container .widget-host .widget-edit-overlay .widget-edit-menu .widget-edit-menu-button{display:inline-block;background-color:#f0f0f0;border-radius:1px;border:2px solid #fff;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;padding:0;height:32px;width:32px;cursor:pointer;color:#666}.widget-board .widgets-container .widget-host .widget-edit-overlay .widget-edit-menu .widget-edit-menu-button:hover{border-color:#a6a6a6;background-color:#c8c8c8}.widget-board .widgets-container .widget-host .widget-options-menu{display:none;position:absolute;top:0;right:0;z-index:2;cursor:pointer;padding:2px 5px}.widget-board .widgets-container .widget-host .widget-options-menu:hover{background-color:#f0f0f0}.widget-board .widgets-container .widget-host .widget-container{padding:1px;height:100%}.widget-board .widgets-container .widget-host .widget-container:hover .widget-options-menu{display:block}\n"], components: [{ type: AXWidgetHostComponent, selector: "ax-widget-host", inputs: ["provideValue", "config", "readonly", "sizeX", "sizeY", "col", "row"], outputs: ["onRemove", "onConfigChanged", "onResized", "onSave"] }], directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
994
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetBoardComponent, decorators: [{
995
+ type: Component,
996
+ args: [{ selector: 'ax-widget-board', host: { class: 'ax widget-board' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"widgets-container\" [class.rtl]=\"rtl\" #container>\n <ax-widget-host *ngFor=\"let w of widgets;trackBy: trackByFn\" [config]='w' [sizeX]=\"w.sizeX\" [readonly]=\"readonly || w.readonly\"\n [sizeY]=\"w.sizeY\" [col]=\"w.col\" [row]=\"w.row\" (onRemove)=\"handleOnRemove($event)\" (onSave)=\"handleOnSave($event)\"\n (onConfigChanged)=\"handleOnConfigChanged($event)\" (onResized)=\"handleOnResizedChanged($event)\"\n [provideValue]=\"provideValue\">\n </ax-widget-host>\n</div>\n", styles: [".widget-board{display:inline-block;margin:15px 20px;min-width:calc(100% - 40px);min-height:calc(100% - 34px);--animate-duration: .5s;background-repeat:no-repeat}.widget-board.grid-background{background-repeat:repeat!important}.widget-board.grid-background .widgets-container .widget-host{touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.widget-board.grid-background .widgets-container .widget-host .widget-edit-overlay{display:block;cursor:move}.widget-board.grid-background .widgets-container .widget-host.widget-dragging{z-index:1000}.widget-board.grid-background .widgets-container .widget-host:focus{outline-width:1px;outline-style:solid;outline-color:var(--ax-primary-color)}.widget-board.grid-background .widget-blank-placeholder{background:var(--ax-primary-trans-light-color);position:absolute}.widget-board .widgets-container{position:relative;touch-action:none}.widget-board .widgets-container.rtl .widget-host .widget-options-menu{right:unset!important;left:0!important}.widget-board .widgets-container .widget-host{position:absolute;background:#fff;box-shadow:2px 2px 3px #dadada;z-index:0}.widget-board .widgets-container .widget-host .widget-content{width:100%;height:100%;display:flex;flex-direction:column}.widget-board .widgets-container .widget-host .widget-content .widget-title{padding:var(--ax-size-md);text-align:start;font-size:1.5em;position:absolute}.widget-board .widgets-container .widget-host .widget-edit-loading{display:none;background:rgba(255,255,255,.85);position:absolute;width:100%;height:100%;top:0;left:0;z-index:2;display:flex}.widget-board .widgets-container .widget-host .widget-config-overlay{position:absolute;background:white;width:100%;height:100%;top:0;left:0;z-index:1;padding:var(--ax-size-md);cursor:pointer}.widget-board .widgets-container .widget-host .widget-config-overlay:hover .widget-title{text-decoration:underline}.widget-board .widgets-container .widget-host .widget-config-overlay .widget-title{text-align:start;font-size:1.5em}.widget-board .widgets-container .widget-host .widget-config-overlay .widget-config-box{align-self:center;text-align:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:var(--ax-gray-dark-color)}.widget-board .widgets-container .widget-host .widget-config-overlay .widget-config-box .config-title{font-size:1.2em;margin-bottom:var(--ax-size-md)}.widget-board .widgets-container .widget-host .widget-edit-overlay{display:none;background:rgba(255,255,255,.5);position:absolute;width:100%;height:100%;top:0;left:0;z-index:10}.widget-board .widgets-container .widget-host .widget-edit-overlay .widget-edit-menu{margin:6px;text-align:end;float:inline-end;opacity:1;transition:opacity 1s ease}.widget-board .widgets-container .widget-host .widget-edit-overlay .widget-edit-menu .widget-edit-menu-button{display:inline-block;background-color:#f0f0f0;border-radius:1px;border:2px solid #fff;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;padding:0;height:32px;width:32px;cursor:pointer;color:#666}.widget-board .widgets-container .widget-host .widget-edit-overlay .widget-edit-menu .widget-edit-menu-button:hover{border-color:#a6a6a6;background-color:#c8c8c8}.widget-board .widgets-container .widget-host .widget-options-menu{display:none;position:absolute;top:0;right:0;z-index:2;cursor:pointer;padding:2px 5px}.widget-board .widgets-container .widget-host .widget-options-menu:hover{background-color:#f0f0f0}.widget-board .widgets-container .widget-host .widget-container{padding:1px;height:100%}.widget-board .widgets-container .widget-host .widget-container:hover .widget-options-menu{display:block}\n"] }]
997
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { container: [{
998
+ type: ViewChild,
999
+ args: ['container']
1000
+ }], widgetHosts: [{
1001
+ type: ViewChildren,
1002
+ args: [AXWidgetHostComponent]
1003
+ }], galleryItems: [{
1004
+ type: Input
1005
+ }], tileSize: [{
1006
+ type: Input
1007
+ }], gapSize: [{
1008
+ type: Input
1009
+ }], readonly: [{
1010
+ type: Input
1011
+ }], provideValue: [{
1012
+ type: Input
1013
+ }], onConfigChanged: [{
1014
+ type: Output
1015
+ }], onWidgetSave: [{
1016
+ type: Output
1017
+ }] } });
1018
+
1019
+ class AXWidgetSizePropertyEditorComponent extends AXProperyEditorComponent {
1020
+ constructor(cdr) {
1021
+ super(cdr);
1022
+ this.cdr = cdr;
1023
+ this.minX = 1;
1024
+ this.maxX = 10;
1025
+ this.minY = 1;
1026
+ this.maxY = 10;
1027
+ }
1028
+ ngOnInit() {
1029
+ if (Array.isArray(this.value)) {
1030
+ this.sizeX = this.value[0];
1031
+ this.sizeY = this.value[1];
1032
+ }
1033
+ else {
1034
+ this.sizeX = 2;
1035
+ this.sizeY = 2;
1036
+ }
1037
+ }
1038
+ handleMinValueChange(e) {
1039
+ this.sizeX = e.value;
1040
+ if (this.sizeY > 0) {
1041
+ super.handleValueChange([this.sizeX, this.sizeY]);
1042
+ }
1043
+ }
1044
+ handleMaxValueChange(e) {
1045
+ this.sizeY = e.value;
1046
+ if (this.sizeX > 0) {
1047
+ super.handleValueChange([this.sizeX, this.sizeY]);
1048
+ }
1049
+ }
1050
+ ngAfterViewInit() {
1051
+ this.onRenderCompleted.emit();
1052
+ }
1053
+ }
1054
+ AXWidgetSizePropertyEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetSizePropertyEditorComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1055
+ AXWidgetSizePropertyEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: AXWidgetSizePropertyEditorComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div style=\"display: grid;grid-gap: 2%; grid-template-columns: 49% 49%;\">\n <ax-number-box (onValueChanged)=\"handleMinValueChange($event)\" [value]=\"sizeX\" [min]=\"minX\" [max]=\"maxX\">\n </ax-number-box>\n <ax-number-box (onValueChanged)=\"handleMaxValueChange($event)\" [value]=\"sizeY\" [min]=\"minY\" [max]=\"maxY\">\n </ax-number-box>\n</div>", components: [{ type: i1.AXNumberBoxComponent, selector: "ax-number-box", inputs: ["min", "max", "showSeparator", "showCurrency", "showCounter", "scrollWeel", "showDoubleCounter", "maxLength", "intStep", "decimalNumber", "customStep"] }] });
1056
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetSizePropertyEditorComponent, decorators: [{
1057
+ type: Component,
1058
+ args: [{ template: "<div style=\"display: grid;grid-gap: 2%; grid-template-columns: 49% 49%;\">\n <ax-number-box (onValueChanged)=\"handleMinValueChange($event)\" [value]=\"sizeX\" [min]=\"minX\" [max]=\"maxX\">\n </ax-number-box>\n <ax-number-box (onValueChanged)=\"handleMaxValueChange($event)\" [value]=\"sizeY\" [min]=\"minY\" [max]=\"maxY\">\n </ax-number-box>\n</div>" }]
1059
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
1060
+
1061
+ class AXWidgetBoardModule {
1062
+ /**
1063
+ *
1064
+ */
1065
+ constructor() {
1066
+ AXTranslator.load('en', {
1067
+ 'widget-board': {
1068
+ 'configurable-props': 'Configurable Properties',
1069
+ configure: 'Configure Widget'
1070
+ }
1071
+ });
1072
+ AXTranslator.load('fa', {
1073
+ 'widget-board': {
1074
+ 'configurable-props': 'ویژگی های قابل تنظیم',
1075
+ configure: 'پیکر بندی ابزارک'
1076
+ }
1077
+ });
1078
+ }
1079
+ }
1080
+ AXWidgetBoardModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetBoardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1081
+ AXWidgetBoardModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetBoardModule, declarations: [AXWidgetBoardComponent, AXWidgetHostComponent, AXWidgetConfigComponent, AXWidgetSaveComponent], imports: [CommonModule,
1082
+ AXSearchBoxModule,
1083
+ AXLoadingModule,
1084
+ RouterModule,
1085
+ AXProppertyEditorModule,
1086
+ AXPageModule,
1087
+ AXToolbarModule,
1088
+ AXTranslatorModule,
1089
+ AXLabelModule,
1090
+ AXTextAreaModule,
1091
+ AXFieldsetModule,
1092
+ AXTextBoxModule,
1093
+ AXFormGroupModule,
1094
+ AXTabStripModule,
1095
+ AXCheckBoxModule,
1096
+ AXMenuModule,
1097
+ AXTranslatorModule,
1098
+ AXValidationModule, i1$2.RouterModule], exports: [AXWidgetBoardComponent, AXProppertyEditorModule] });
1099
+ AXWidgetBoardModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetBoardModule, providers: [], imports: [[
1100
+ CommonModule,
1101
+ AXSearchBoxModule,
1102
+ AXLoadingModule,
1103
+ RouterModule,
1104
+ AXProppertyEditorModule,
1105
+ AXPageModule,
1106
+ AXToolbarModule,
1107
+ AXTranslatorModule,
1108
+ AXLabelModule,
1109
+ AXTextAreaModule,
1110
+ AXFieldsetModule,
1111
+ AXTextBoxModule,
1112
+ AXFormGroupModule,
1113
+ AXTabStripModule,
1114
+ AXCheckBoxModule,
1115
+ AXMenuModule,
1116
+ AXTranslatorModule,
1117
+ AXValidationModule,
1118
+ RouterModule.forChild([
1119
+ {
1120
+ component: AXWidgetSizePropertyEditorComponent,
1121
+ path: 'ax/editors/widget-size'
1122
+ },
1123
+ ])
1124
+ ], AXProppertyEditorModule] });
1125
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetBoardModule, decorators: [{
1126
+ type: NgModule,
1127
+ args: [{
1128
+ imports: [
1129
+ CommonModule,
1130
+ AXSearchBoxModule,
1131
+ AXLoadingModule,
1132
+ RouterModule,
1133
+ AXProppertyEditorModule,
1134
+ AXPageModule,
1135
+ AXToolbarModule,
1136
+ AXTranslatorModule,
1137
+ AXLabelModule,
1138
+ AXTextAreaModule,
1139
+ AXFieldsetModule,
1140
+ AXTextBoxModule,
1141
+ AXFormGroupModule,
1142
+ AXTabStripModule,
1143
+ AXCheckBoxModule,
1144
+ AXMenuModule,
1145
+ AXTranslatorModule,
1146
+ AXValidationModule,
1147
+ RouterModule.forChild([
1148
+ {
1149
+ component: AXWidgetSizePropertyEditorComponent,
1150
+ path: 'ax/editors/widget-size'
1151
+ },
1152
+ ])
1153
+ ],
1154
+ exports: [AXWidgetBoardComponent, AXProppertyEditorModule],
1155
+ declarations: [AXWidgetBoardComponent, AXWidgetHostComponent, AXWidgetConfigComponent, AXWidgetSaveComponent],
1156
+ providers: []
1157
+ }]
1158
+ }], ctorParameters: function () { return []; } });
1159
+
1160
+ class AXWidgetSizePropertyEditorModule {
1161
+ }
1162
+ AXWidgetSizePropertyEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetSizePropertyEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1163
+ AXWidgetSizePropertyEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetSizePropertyEditorModule, declarations: [AXWidgetSizePropertyEditorComponent], imports: [CommonModule, FormsModule, AXNumberBoxModule], exports: [AXWidgetSizePropertyEditorComponent] });
1164
+ AXWidgetSizePropertyEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetSizePropertyEditorModule, providers: [], imports: [[CommonModule, FormsModule, AXNumberBoxModule]] });
1165
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXWidgetSizePropertyEditorModule, decorators: [{
1166
+ type: NgModule,
1167
+ args: [{
1168
+ declarations: [AXWidgetSizePropertyEditorComponent],
1169
+ imports: [CommonModule, FormsModule, AXNumberBoxModule],
1170
+ exports: [AXWidgetSizePropertyEditorComponent],
1171
+ providers: []
1172
+ }]
1173
+ }] });
1174
+
1175
+ /**
1176
+ * Generated bundle index. Do not edit.
1177
+ */
1178
+
1179
+ export { AXWidgetBoardComponent, AXWidgetBoardModule, AXWidgetComponent, AXWidgetHostComponent, AXWidgetSizePropertyEditorComponent, AXWidgetSizePropertyEditorModule };
1180
+ //# sourceMappingURL=acorex-layout.mjs.map