@acorex/layout 4.2.0 → 4.2.3

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