@acorex/layout 3.0.63 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. package/acorex-layout.d.ts +1 -2
  2. package/esm2020/acorex-layout.mjs +5 -0
  3. package/esm2020/lib/widget-board/editors/widget-size-editor/widget-size.editor.mjs +46 -0
  4. package/esm2020/lib/widget-board/editors/widget-size-editor/widget-size.module.mjs +21 -0
  5. package/esm2020/lib/widget-board/widget-board.component.mjs +441 -0
  6. package/esm2020/lib/widget-board/widget-board.module.mjs +111 -0
  7. package/esm2020/lib/widget-board/widget-config.component.mjs +82 -0
  8. package/esm2020/lib/widget-board/widget-host.component.mjs +290 -0
  9. package/esm2020/lib/widget-board/widget-save.component.mjs +79 -0
  10. package/esm2020/lib/widget-board/widget.class.mjs +127 -0
  11. package/esm2020/public-api.mjs +7 -0
  12. package/fesm2015/acorex-layout.mjs +1166 -0
  13. package/fesm2015/acorex-layout.mjs.map +1 -0
  14. package/fesm2020/acorex-layout.mjs +1159 -0
  15. package/fesm2020/acorex-layout.mjs.map +1 -0
  16. package/lib/widget-board/editors/widget-size-editor/widget-size.editor.d.ts +3 -0
  17. package/lib/widget-board/editors/widget-size-editor/widget-size.module.d.ts +8 -0
  18. package/lib/widget-board/widget-board.component.d.ts +3 -0
  19. package/lib/widget-board/widget-board.module.d.ts +12 -0
  20. package/lib/widget-board/widget-config.component.d.ts +3 -0
  21. package/lib/widget-board/widget-host.component.d.ts +3 -0
  22. package/lib/widget-board/widget-save.component.d.ts +3 -0
  23. package/lib/widget-board/widget.class.d.ts +3 -0
  24. package/package.json +23 -13
  25. package/acorex-layout.metadata.json +0 -1
  26. package/bundles/acorex-layout.umd.js +0 -1487
  27. package/bundles/acorex-layout.umd.js.map +0 -1
  28. package/bundles/acorex-layout.umd.min.js +0 -16
  29. package/bundles/acorex-layout.umd.min.js.map +0 -1
  30. package/esm2015/acorex-layout.js +0 -7
  31. package/esm2015/lib/widget-board/editors/widget-size-editor/widget-size.editor.js +0 -49
  32. package/esm2015/lib/widget-board/editors/widget-size-editor/widget-size.module.js +0 -19
  33. package/esm2015/lib/widget-board/widget-board.component.js +0 -468
  34. package/esm2015/lib/widget-board/widget-board.module.js +0 -67
  35. package/esm2015/lib/widget-board/widget-config.component.js +0 -86
  36. package/esm2015/lib/widget-board/widget-host.component.js +0 -323
  37. package/esm2015/lib/widget-board/widget-save.component.js +0 -79
  38. package/esm2015/lib/widget-board/widget.class.js +0 -123
  39. package/esm2015/public-api.js +0 -7
  40. package/esm5/acorex-layout.js +0 -7
  41. package/esm5/lib/widget-board/editors/widget-size-editor/widget-size.editor.js +0 -52
  42. package/esm5/lib/widget-board/editors/widget-size-editor/widget-size.module.js +0 -22
  43. package/esm5/lib/widget-board/widget-board.component.js +0 -494
  44. package/esm5/lib/widget-board/widget-board.module.js +0 -68
  45. package/esm5/lib/widget-board/widget-config.component.js +0 -90
  46. package/esm5/lib/widget-board/widget-host.component.js +0 -359
  47. package/esm5/lib/widget-board/widget-save.component.js +0 -83
  48. package/esm5/lib/widget-board/widget.class.js +0 -134
  49. package/esm5/public-api.js +0 -7
  50. package/fesm2015/acorex-layout.js +0 -1177
  51. package/fesm2015/acorex-layout.js.map +0 -1
  52. package/fesm5/acorex-layout.js +0 -1264
  53. package/fesm5/acorex-layout.js.map +0 -1
@@ -1,494 +0,0 @@
1
- import { __decorate, __metadata, __read, __spread } from "tslib";
2
- import { Component, OnInit, Input, ViewEncapsulation, ElementRef, ViewChild, NgZone, ChangeDetectionStrategy, ChangeDetectorRef, Output, EventEmitter, ViewChildren, QueryList } from '@angular/core';
3
- import { AXWidgetHostComponent } from './widget-host.component';
4
- import { AXHtmlUtil, AXClientRec } from '@acorex/core';
5
- import { Observable } from 'rxjs';
6
- import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
7
- var AXWidgetBoardComponent = /** @class */ (function () {
8
- function AXWidgetBoardComponent(ref, zone, cdr) {
9
- this.ref = ref;
10
- this.zone = zone;
11
- this.cdr = cdr;
12
- this.widgets = [];
13
- this.galleryItems = [];
14
- this.tileSize = 80;
15
- this.gapSize = 5;
16
- this.newWidget = null;
17
- this._isInEditing = false;
18
- this.isDragging = false;
19
- this.DATA_COL = 'data-col';
20
- this.DATA_ROW = 'data-row';
21
- this.DATA_SIZE_X = 'data-size-x';
22
- this.DATA_SIZE_Y = 'data-size-y';
23
- this.DATA_OLD_COL = 'data-old-col';
24
- this.DATA_OLD_ROW = 'data-old-row';
25
- this.onConfigChanged = new EventEmitter();
26
- this.onWidgetSave = new EventEmitter();
27
- }
28
- AXWidgetBoardComponent.prototype.isInEditing = function () {
29
- return this._isInEditing;
30
- };
31
- AXWidgetBoardComponent.prototype.ngOnInit = function () {
32
- if (this.rtl == null) {
33
- this.rtl = window.getComputedStyle(this.ref.nativeElement, null).getPropertyValue('direction') === 'rtl';
34
- }
35
- };
36
- AXWidgetBoardComponent.prototype.ngAfterViewInit = function () {
37
- var _this = this;
38
- this.zone.runOutsideAngular(function (c) {
39
- var style = document.createElement('style');
40
- style.type = 'text/css';
41
- _this.ref.nativeElement.appendChild(style);
42
- // add css data classes
43
- for (var i = 1; i <= 50; i++) {
44
- style.innerHTML += "[" + _this.DATA_COL + "=\"" + i + "\"] { " + (_this.rtl ? 'right' : 'left') + ": " + (i - 1) * (_this.tileSize + _this.gapSize) + "px; }";
45
- style.innerHTML += "[" + _this.DATA_ROW + "=\"" + i + "\"] { top: " + (i - 1) * (_this.tileSize + _this.gapSize) + "px; }";
46
- style.innerHTML += "[" + _this.DATA_SIZE_X + "=\"" + i + "\"] { width: " + ((i * _this.tileSize) + ((i - 1) * _this.gapSize)) + "px; }";
47
- style.innerHTML += "[" + _this.DATA_SIZE_Y + "=\"" + i + "\"] { height: " + ((i * _this.tileSize) + ((i - 1) * _this.gapSize)) + "px; }";
48
- }
49
- });
50
- };
51
- AXWidgetBoardComponent.prototype.calcGridSize = function () {
52
- var _this = this;
53
- this.zone.runOutsideAngular(function () {
54
- var width = (Math.max.apply(Math, __spread(_this.widgets.map(function (c) { return c.col + c.sizeX - 1; })))) * (_this.tileSize + _this.gapSize);
55
- var height = (Math.max.apply(Math, __spread(_this.widgets.map(function (c) { return c.row + c.sizeY - 1; })))) * (_this.tileSize + _this.gapSize);
56
- _this.container.nativeElement.style.width = width + 'px';
57
- _this.container.nativeElement.style.height = height + 'px';
58
- });
59
- };
60
- AXWidgetBoardComponent.prototype.toggleEdit = function () {
61
- this._isInEditing ? this.finishEdit() : this.startEdit();
62
- };
63
- AXWidgetBoardComponent.prototype.dragStart = function (e) {
64
- var _this = this;
65
- e.preventDefault();
66
- e.stopPropagation();
67
- this.zone.runOutsideAngular(function () {
68
- if (_this._isInEditing && e.which === 1) {
69
- _this.dragItem = e.currentTarget;
70
- _this.dragItem.setAttribute('data-x-offset', (_this.dragItem.offsetLeft - e.clientX).toString());
71
- //
72
- _this.dragItem.setAttribute('data-y-offset', (_this.dragItem.offsetTop - e.clientY).toString());
73
- _this.dragItem.classList.add('widget-dragging');
74
- _this.dragItem.classList.remove('animate__animated', 'animate__pulse');
75
- }
76
- });
77
- return false;
78
- };
79
- AXWidgetBoardComponent.prototype.removePositionData = function () {
80
- var _this = this;
81
- this.zone.runOutsideAngular(function () {
82
- if (_this.dragItem && _this._isInEditing && _this.dragItem.getAttribute(_this.DATA_OLD_COL) == null) {
83
- _this.dragItem.setAttribute(_this.DATA_OLD_COL, _this.dragItem.getAttribute(_this.DATA_COL));
84
- _this.dragItem.setAttribute(_this.DATA_OLD_ROW, _this.dragItem.getAttribute(_this.DATA_ROW));
85
- _this.dragItem.removeAttribute(_this.DATA_COL);
86
- _this.dragItem.removeAttribute(_this.DATA_ROW);
87
- }
88
- });
89
- };
90
- AXWidgetBoardComponent.prototype.resetPositionData = function () {
91
- var _this = this;
92
- this.zone.runOutsideAngular(function () {
93
- if (_this.dragItem && _this._isInEditing) {
94
- _this.setPosition(_this.dragItem, _this.dragItem.getAttribute(_this.DATA_OLD_COL), _this.dragItem.getAttribute(_this.DATA_OLD_ROW));
95
- }
96
- });
97
- };
98
- AXWidgetBoardComponent.prototype.setPosition = function (element, col, row) {
99
- var _this = this;
100
- this.zone.runOutsideAngular(function () {
101
- element.setAttribute(_this.DATA_COL, col);
102
- element.setAttribute(_this.DATA_ROW, row);
103
- element.removeAttribute(_this.DATA_OLD_COL);
104
- element.removeAttribute(_this.DATA_OLD_ROW);
105
- element.style.removeProperty('top');
106
- element.style.removeProperty('left');
107
- var widget = _this.widgets.find(function (c) { return c['__meta__'].instance.element === element; });
108
- widget.col = Number(col);
109
- widget.row = Number(row);
110
- });
111
- };
112
- AXWidgetBoardComponent.prototype.drag = function (e) {
113
- var _this = this;
114
- e.preventDefault();
115
- e.stopPropagation();
116
- this.zone.runOutsideAngular(function () {
117
- if (_this.dragItem && _this._isInEditing) {
118
- _this.isDragging = true;
119
- _this.addPlaceholder();
120
- var xOffset = Number(_this.dragItem.getAttribute('data-x-offset'));
121
- var yOffset = Number(_this.dragItem.getAttribute('data-y-offset'));
122
- _this.dragItem.style.left = e.clientX + xOffset + 'px';
123
- _this.dragItem.style.top = e.clientY + yOffset + 'px';
124
- //
125
- _this.detectBestPlacement();
126
- _this.removePositionData();
127
- }
128
- });
129
- return false;
130
- };
131
- AXWidgetBoardComponent.prototype.dragEnd = function (e) {
132
- var _this = this;
133
- this.zone.runOutsideAngular(function () {
134
- if (_this.dragItem && _this._isInEditing && _this.isDragging) {
135
- _this.dragItem.classList.remove('widget-dragging');
136
- _this.dragItem.classList.add('animate__animated', 'animate__pulse');
137
- //
138
- var p = _this.container.nativeElement.querySelector('.widget-blank-placeholder');
139
- if (_this.newWidget) {
140
- var w_1 = {
141
- uniqueName: _this.newWidget.uniqueName,
142
- component: _this.newWidget.component,
143
- title: _this.newWidget.title,
144
- options: _this.newWidget.options,
145
- sizeX: _this.newWidget.sizeX,
146
- sizeY: _this.newWidget.sizeY,
147
- col: Number(p.getAttribute(_this.DATA_COL)),
148
- row: Number(p.getAttribute(_this.DATA_ROW))
149
- };
150
- _this.widgets.push(w_1);
151
- _this.newWidget = null;
152
- _this.container.nativeElement.removeChild(_this.dragItem);
153
- _this.zone.run(function () {
154
- _this.cdr.detectChanges();
155
- _this.calcGridSize();
156
- setTimeout(function () {
157
- w_1['__meta__'].instance.element.addEventListener('mousedown', _this.dragStart.bind(_this), false);
158
- }, 1000);
159
- });
160
- }
161
- else {
162
- if (p) {
163
- _this.setPosition(_this.dragItem, p.getAttribute(_this.DATA_COL), p.getAttribute(_this.DATA_ROW));
164
- }
165
- else {
166
- _this.setPosition(_this.dragItem, _this.dragItem.getAttribute(_this.DATA_OLD_COL), _this.dragItem.getAttribute(_this.DATA_OLD_ROW));
167
- }
168
- }
169
- //
170
- _this.removePlaceholder();
171
- _this.dragItem = null;
172
- _this.calcGridSize();
173
- _this.emitConfigChanged();
174
- }
175
- _this.isDragging = false;
176
- });
177
- };
178
- AXWidgetBoardComponent.prototype.detectFirstEmptySlot = function (w) {
179
- var xTile = Math.floor(this.ref.nativeElement.parentElement.offsetWidth / this.tileSize);
180
- for (var j = 1; j <= 100; j++) {
181
- var _loop_1 = function (i) {
182
- var rec = new AXClientRec({
183
- left: i,
184
- top: j,
185
- width: w.sizeX,
186
- height: w.sizeY
187
- });
188
- var el = this_1.widgets.filter(function (c) { return c !== w; }).find(function (c) {
189
- return rec.intersect({
190
- left: c.col,
191
- top: c.row,
192
- width: c.sizeX,
193
- height: c.sizeY
194
- });
195
- });
196
- if (el == null) {
197
- w.col = i;
198
- w.row = j;
199
- return { value: void 0 };
200
- }
201
- };
202
- var this_1 = this;
203
- for (var i = 1; i <= xTile - w.sizeX; i++) {
204
- var state_1 = _loop_1(i);
205
- if (typeof state_1 === "object")
206
- return state_1.value;
207
- }
208
- }
209
- };
210
- AXWidgetBoardComponent.prototype.detectBestPlacement = function () {
211
- var _this = this;
212
- this.zone.runOutsideAngular(function () {
213
- var p = _this.container.nativeElement.querySelector('.widget-blank-placeholder');
214
- var col = Math.ceil(_this.dragItem.offsetLeft / _this.tileSize);
215
- if (_this.rtl) {
216
- col = Math.ceil((_this.container.nativeElement.clientWidth - (_this.dragItem.offsetLeft + _this.dragItem.clientWidth)) / _this.tileSize);
217
- }
218
- var row = Math.ceil(_this.dragItem.offsetTop / _this.tileSize);
219
- if (col < 1) {
220
- col = 1;
221
- }
222
- if (row < 1) {
223
- row = 1;
224
- }
225
- var widgets = Array.from(_this.ref.nativeElement.querySelectorAll('.widget-host')).map(function (c) { return c; });
226
- p.setAttribute(_this.DATA_COL, col.toString());
227
- p.setAttribute(_this.DATA_ROW, row.toString());
228
- var collision = widgets.filter(function (c) { return c !== _this.dragItem; }).some(function (c) { return AXHtmlUtil.collision(c, _this.dragItem); });
229
- if (collision) {
230
- _this.removePlaceholder();
231
- }
232
- });
233
- };
234
- AXWidgetBoardComponent.prototype.addPlaceholder = function () {
235
- var _this = this;
236
- this.zone.runOutsideAngular(function () {
237
- _this.removePlaceholder();
238
- if (_this.dragItem) {
239
- var p = document.createElement('div');
240
- p.classList.add('widget-blank-placeholder');
241
- p.setAttribute(_this.DATA_COL, _this.dragItem.getAttribute(_this.DATA_COL));
242
- p.setAttribute(_this.DATA_ROW, _this.dragItem.getAttribute(_this.DATA_ROW));
243
- p.setAttribute(_this.DATA_SIZE_X, _this.dragItem.getAttribute(_this.DATA_SIZE_X));
244
- p.setAttribute(_this.DATA_SIZE_Y, _this.dragItem.getAttribute(_this.DATA_SIZE_Y));
245
- _this.container.nativeElement.appendChild(p);
246
- }
247
- });
248
- };
249
- AXWidgetBoardComponent.prototype.removePlaceholder = function () {
250
- var _a;
251
- var p = this.container.nativeElement.querySelector('.widget-blank-placeholder');
252
- (_a = p) === null || _a === void 0 ? void 0 : _a.remove();
253
- };
254
- AXWidgetBoardComponent.prototype.startEdit = function () {
255
- var _this = this;
256
- this._isInEditing = true;
257
- this.calcGridSize();
258
- this.ref.nativeElement.classList.add('grid-background');
259
- var bg = this.ref.nativeElement;
260
- bg.style.setProperty('background-position', (this.rtl ? 'right' : 'left') + " top");
261
- // tslint:disable-next-line: max-line-length
262
- var 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>')";
263
- bg.style.setProperty('background-image', pattern);
264
- //
265
- var widgets = Array.from(this.ref.nativeElement.querySelectorAll('.widget-host'));
266
- widgets.forEach(function (w) {
267
- w.addEventListener('mousedown', _this.dragStart.bind(_this), false);
268
- });
269
- this.ref.nativeElement.addEventListener('mousemove', this.drag.bind(this), false);
270
- this.ref.nativeElement.addEventListener('mouseup', this.dragEnd.bind(this), false);
271
- };
272
- AXWidgetBoardComponent.prototype.finishEdit = function () {
273
- var _this = this;
274
- this.ref.nativeElement.classList.remove('grid-background');
275
- var bg = this.ref.nativeElement;
276
- bg.style.removeProperty('background-image');
277
- //
278
- this._isInEditing = false;
279
- var widgets = Array.from(this.ref.nativeElement.querySelectorAll('.widget-host'));
280
- widgets.forEach(function (w) {
281
- w.removeEventListener('mousedown', _this.dragStart.bind(_this), false);
282
- });
283
- this.ref.nativeElement.removeEventListener('mousemove', this.drag.bind(this), false);
284
- this.ref.nativeElement.removeEventListener('mouseup', this.dragEnd.bind(this), false);
285
- this.emitConfigChanged();
286
- };
287
- AXWidgetBoardComponent.prototype.addWidget = function (widget) {
288
- var _this = this;
289
- this.zone.runOutsideAngular(function () {
290
- _this.newWidget = {
291
- uniqueName: widget.uniqueName,
292
- component: widget.component,
293
- title: widget.title,
294
- col: 1,
295
- row: 1,
296
- sizeX: widget.sizeX,
297
- sizeY: widget.sizeY,
298
- options: widget.options,
299
- props: widget.props
300
- };
301
- _this.detectFirstEmptySlot(_this.newWidget);
302
- var w = {
303
- uniqueName: _this.newWidget.uniqueName,
304
- component: _this.newWidget.component,
305
- title: _this.newWidget.title,
306
- options: _this.newWidget.options,
307
- props: _this.newWidget.props,
308
- sizeX: _this.newWidget.sizeX,
309
- sizeY: _this.newWidget.sizeY,
310
- col: _this.newWidget.col,
311
- row: _this.newWidget.row
312
- };
313
- _this.widgets.push(w);
314
- _this.newWidget = null;
315
- _this.zone.run(function () {
316
- _this.cdr.detectChanges();
317
- _this.calcGridSize();
318
- _this.emitConfigChanged();
319
- setTimeout(function () {
320
- w['__meta__'].instance.element.addEventListener('mousedown', _this.dragStart.bind(_this), false);
321
- }, 1000);
322
- });
323
- });
324
- };
325
- AXWidgetBoardComponent.prototype.handleOnRemove = function (w) {
326
- var _this = this;
327
- w.element.classList.add('animate__animated', 'animate__zoomOut');
328
- w.element.addEventListener('animationend', function () {
329
- _this.widgets = _this.widgets.filter(function (c) { return c.__meta__.id !== w.config.__meta__.id; });
330
- _this.cdr.detectChanges();
331
- _this.calcGridSize();
332
- _this.emitConfigChanged();
333
- });
334
- };
335
- AXWidgetBoardComponent.prototype.handleOnSave = function (e) {
336
- this.onWidgetSave.emit(e);
337
- };
338
- AXWidgetBoardComponent.prototype.trackByFn = function (index, item) {
339
- var _a, _b;
340
- if (!((_a = item['__meta__']) === null || _a === void 0 ? void 0 : _a.id)) {
341
- item['__meta__'] = {};
342
- item['__meta__'].id = AXHtmlUtil.getUID();
343
- }
344
- return (_b = item['__meta__']) === null || _b === void 0 ? void 0 : _b.id;
345
- };
346
- AXWidgetBoardComponent.prototype.load = function (widgets) {
347
- var _this = this;
348
- this.clear();
349
- return new Promise(function (resolve, reject) {
350
- if (widgets) {
351
- var loadedWidgets_1 = [];
352
- if (typeof widgets === 'string') {
353
- try {
354
- loadedWidgets_1.push.apply(loadedWidgets_1, __spread(JSON.parse(widgets)));
355
- }
356
- catch (error) {
357
- reject('Invalid widget json data!');
358
- }
359
- }
360
- else {
361
- loadedWidgets_1.push.apply(loadedWidgets_1, __spread(widgets));
362
- }
363
- var intervalId_1 = -1;
364
- var loadFunc = function () {
365
- var _a;
366
- if (_this.galleryItems && _this.galleryItems.length > 0) {
367
- loadedWidgets_1.forEach(function (w) {
368
- var gitem = _this.galleryItems.find(function (c) { return c.uniqueName === w.uniqueName; });
369
- if (gitem) {
370
- w.component = gitem.component;
371
- if (gitem.props) {
372
- w.props = JSON.parse(JSON.stringify(gitem.props));
373
- }
374
- }
375
- });
376
- (_a = _this.widgets).push.apply(_a, __spread(loadedWidgets_1));
377
- window.clearInterval(intervalId_1);
378
- _this.cdr.detectChanges();
379
- resolve();
380
- }
381
- };
382
- intervalId_1 = window.setInterval(loadFunc, 200);
383
- }
384
- else {
385
- resolve();
386
- }
387
- });
388
- };
389
- AXWidgetBoardComponent.prototype.clear = function () {
390
- if (this.widgets.length) {
391
- this.widgets = [];
392
- this.cdr.detectChanges();
393
- this.emitConfigChanged();
394
- }
395
- };
396
- AXWidgetBoardComponent.prototype.save = function () {
397
- var obj = this.widgets.map(function (c) { return ({
398
- uniqueName: c.uniqueName,
399
- component: c.component,
400
- title: c.title,
401
- sizeX: c.sizeX,
402
- sizeY: c.sizeY,
403
- col: c.col,
404
- row: c.row,
405
- options: c.options,
406
- props: c.props
407
- }); });
408
- return Promise.resolve(JSON.stringify(obj));
409
- };
410
- AXWidgetBoardComponent.prototype.refresh = function () {
411
- this.widgetHosts.forEach(function (host) {
412
- host.widget.refresh();
413
- });
414
- };
415
- AXWidgetBoardComponent.prototype.handleOnConfigChanged = function (e) {
416
- this.cdr.detectChanges();
417
- this.emitConfigChanged();
418
- };
419
- AXWidgetBoardComponent.prototype.handleOnResizedChanged = function (e) {
420
- this.detectFirstEmptySlot(e.config);
421
- this.cdr.detectChanges();
422
- this.emitConfigChanged();
423
- };
424
- AXWidgetBoardComponent.prototype.emitConfigChanged = function () {
425
- var _this = this;
426
- if (!this.resizeChangeObserver) {
427
- this.resizeChangeObserver = new Observable();
428
- Observable.create(function (observer) {
429
- _this.resizeChangeObserver = observer;
430
- })
431
- .pipe(debounceTime(750))
432
- .pipe(distinctUntilChanged())
433
- .subscribe(function (c) {
434
- _this.onConfigChanged.emit({
435
- component: _this
436
- });
437
- });
438
- }
439
- this.resizeChangeObserver.next(new Date());
440
- };
441
- AXWidgetBoardComponent.ctorParameters = function () { return [
442
- { type: ElementRef },
443
- { type: NgZone },
444
- { type: ChangeDetectorRef }
445
- ]; };
446
- __decorate([
447
- ViewChild('container'),
448
- __metadata("design:type", ElementRef)
449
- ], AXWidgetBoardComponent.prototype, "container", void 0);
450
- __decorate([
451
- ViewChildren(AXWidgetHostComponent),
452
- __metadata("design:type", QueryList)
453
- ], AXWidgetBoardComponent.prototype, "widgetHosts", void 0);
454
- __decorate([
455
- Input(),
456
- __metadata("design:type", Array)
457
- ], AXWidgetBoardComponent.prototype, "galleryItems", void 0);
458
- __decorate([
459
- Input(),
460
- __metadata("design:type", Number)
461
- ], AXWidgetBoardComponent.prototype, "tileSize", void 0);
462
- __decorate([
463
- Input(),
464
- __metadata("design:type", Number)
465
- ], AXWidgetBoardComponent.prototype, "gapSize", void 0);
466
- __decorate([
467
- Input(),
468
- __metadata("design:type", Function)
469
- ], AXWidgetBoardComponent.prototype, "provideValue", void 0);
470
- __decorate([
471
- Output(),
472
- __metadata("design:type", EventEmitter)
473
- ], AXWidgetBoardComponent.prototype, "onConfigChanged", void 0);
474
- __decorate([
475
- Output(),
476
- __metadata("design:type", EventEmitter)
477
- ], AXWidgetBoardComponent.prototype, "onWidgetSave", void 0);
478
- AXWidgetBoardComponent = __decorate([
479
- Component({
480
- selector: 'ax-widget-board',
481
- 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",
482
- host: { class: 'ax widget-board' },
483
- encapsulation: ViewEncapsulation.None,
484
- changeDetection: ChangeDetectionStrategy.OnPush,
485
- styles: [".widget-board{display:inline-block;margin:15px 20px;min-width:calc(100% - 40px);min-height:calc(100% - 34px);--animate-duration:0.5s;background-repeat:no-repeat}.widget-board.grid-background{background-repeat:repeat!important}.widget-board.grid-background .widgets-container .widget-host{touch-action:none;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:#fff;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}.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}"]
486
- }),
487
- __metadata("design:paramtypes", [ElementRef,
488
- NgZone,
489
- ChangeDetectorRef])
490
- ], AXWidgetBoardComponent);
491
- return AXWidgetBoardComponent;
492
- }());
493
- export { AXWidgetBoardComponent };
494
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2lkZ2V0LWJvYXJkLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BhY29yZXgvbGF5b3V0LyIsInNvdXJjZXMiOlsibGliL3dpZGdldC1ib2FyZC93aWRnZXQtYm9hcmQuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQ0wsU0FBUyxFQUNULE1BQU0sRUFDTixLQUFLLEVBQ0wsaU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emVZOiB0aGlzLm5ld1dpZGdldC5zaXplWSxcclxuICAgICAgICAgICAgY29sOiBOdW1iZXIocC5nZXRBdHRyaWJ1dGUodGhpcy5EQVRBX0NPTCkpLFxyXG4gICAgICAgICAgICByb3c6IE51bWJlcihwLmdldEF0dHJpYnV0ZSh0aGlzLkRBVEFfUk9XKSlcclxuICAgICAgICAgIH07XHJcblxyXG4gICAgICAgICAgdGhpcy53aWRnZXRzLnB1c2godyk7XHJcbiAgICAgICAgICB0aGlzLm5ld1dpZGdldCA9IG51bGw7XHJcbiAgICAgICAgICB0aGlzLmNvbnRhaW5lci5uYXRpdmVFbGVtZW50LnJlbW92ZUNoaWxkKHRoaXMuZHJhZ0l0ZW0pO1xyXG4gICAgICAgICAgdGhpcy56b25lLnJ1bigoKSA9PiB7XHJcbiAgICAgICAgICAgIHRoaXMuY2RyLmRldGVjdENoYW5nZXMoKTtcclxuICAgICAgICAgICAgdGhpcy5jYWxjR3JpZFNpemUoKTtcclxuICAgICAgICAgICAgc2V0VGltZW91dCgoKSA9PiB7XHJcbiAgICAgICAgICAgICAgd1snX19tZXRhX18nXS5pbnN0YW5jZS5lbGVtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ21vdXNlZG93bicsIHRoaXMuZHJhZ1N0YXJ0LmJpbmQodGhpcyksIGZhbHNlKTtcclxuICAgICAgICAgICAgfSwgMTAwMCk7XHJcbiAgICAgICAgICB9KTtcclxuICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgaWYgKHApIHtcclxuICAgICAgICAgICAgdGhpcy5zZXRQb3NpdGlvbih0aGlzLmRyYWdJdGVtLCBwLmdldEF0dHJpYnV0ZSh0aGlzLkRBVEFfQ09MKSwgcC5nZXRBdHRyaWJ1dGUodGhpcy5EQVRBX1JPVykpO1xyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHRoaXMuc2V0UG9zaXRpb24odGhpcy5kcmFnSXRlbSwgdGhpcy5k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AgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgbG9hZGVkV2lkZ2V0cy5wdXNoKC4uLndpZGdldHMpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBsZXQgaW50ZXJ2YWxJZDogbnVtYmVyID0gLTE7XHJcbiAgICAgICAgY29uc3QgbG9hZEZ1bmMgPSAoKSA9PiB7XHJcblxyXG4gICAgICAgICAgaWYgKHRoaXMuZ2FsbGVyeUl0ZW1zICYmIHRoaXMuZ2FsbGVyeUl0ZW1zLmxlbmd0aCA+IDApIHtcclxuICAgICAgICAgICAgbG9hZGVkV2lkZ2V0cy5mb3JFYWNoKHcgPT4ge1xyXG4gICAgICAgICAgICAgIGNvbnN0IGdpdGVtID0gdGhpcy5nYWxsZXJ5SXRlbXMuZmluZChjID0+IGMudW5pcXVlTmFtZSA9PT0gdy51bmlxdWVOYW1lKTtcclxuICAgICAgICAgICAgICBpZiAoZ2l0ZW0pIHtcclxuICAgICAgICAgICAgICAgIHcuY29tcG9uZW50ID0gZ2l0ZW0uY29tcG9uZW50O1xyXG4gICAgICAgICAgICAgICAgaWYgKGdpdGVtLnByb3BzKSB7XHJcbiAgICAgICAgICAgICAgICAgIHcucHJvcHMgPSBKU09OLnBhcnNlKEpTT04uc3RyaW5naWZ5KGdpdGVtLnByb3BzKSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgdGhpcy53aWRnZXRzLnB1c2goLi4ubG9hZGVkV2lkZ2V0cyk7XHJcbiAgICAgICAgICAgIHdpbmRvdy5jbGVhckludGVydmFsKGludGVydmFsSWQpO1xyXG4gICAgICAgICAgICB0aGlzLmNkci5kZXRlY3RDaGFuZ2VzKCk7XHJcbiAgICAgICAgICAgIHJlc29sdmUoKTtcclxuICAgICAgICAgIH1cclxuICAgICAgICB9O1xyXG4gICAgICAgIGludGVydmFsSWQgPSB3aW5kb3cuc2V0SW50Z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