@schneideress/dashboardframework 0.0.147 → 0.0.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/schneideress-dashboardframework.umd.js +255 -82
- package/bundles/schneideress-dashboardframework.umd.js.map +1 -1
- package/bundles/schneideress-dashboardframework.umd.min.js +1 -1
- package/bundles/schneideress-dashboardframework.umd.min.js.map +1 -1
- package/esm2015/lib/ra-dashboard-area/ra.dashboard.area.js +80 -68
- package/esm2015/lib/ra.dashboard.responsive.service.js +144 -0
- package/esm2015/public-api.js +2 -1
- package/esm2015/schneideress-dashboardframework.js +2 -2
- package/esm5/lib/ra-dashboard-area/ra.dashboard.area.js +80 -84
- package/esm5/lib/ra.dashboard.responsive.service.js +180 -0
- package/esm5/public-api.js +2 -1
- package/esm5/schneideress-dashboardframework.js +2 -2
- package/fesm2015/schneideress-dashboardframework.js +220 -67
- package/fesm2015/schneideress-dashboardframework.js.map +1 -1
- package/fesm5/schneideress-dashboardframework.js +255 -83
- package/fesm5/schneideress-dashboardframework.js.map +1 -1
- package/lib/ra-dashboard-area/ra.dashboard.area.d.ts +4 -3
- package/lib/ra.dashboard.responsive.service.d.ts +15 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/schneideress-dashboardframework.metadata.json +1 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview added by tsickle
|
|
3
|
+
* Generated from: lib/ra.dashboard.responsive.service.ts
|
|
4
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5
|
+
*/
|
|
6
|
+
import { Injectable } from '@angular/core';
|
|
7
|
+
import { GridsterConfigDefaultSettings } from './ra.gridster.config';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
/** @type {?} */
|
|
10
|
+
var DesktopViewStart = 1367;
|
|
11
|
+
/** @type {?} */
|
|
12
|
+
var GridLockViewEnd = 1024;
|
|
13
|
+
var RADashboardResponsiveService = /** @class */ (function () {
|
|
14
|
+
function RADashboardResponsiveService() {
|
|
15
|
+
var _this = this;
|
|
16
|
+
this.resInfo = [
|
|
17
|
+
{ 'start': 0, 'end': 767, 'minCols': 1, 'maxCols': 1 },
|
|
18
|
+
{ 'start': 768, 'end': GridLockViewEnd, 'minCols': 1, 'maxCols': 2 },
|
|
19
|
+
{ 'start': GridLockViewEnd + 1, 'end': DesktopViewStart - 1, 'minCols': 2, 'maxCols': 6 },
|
|
20
|
+
{ 'start': DesktopViewStart, 'end': 9999999999, 'minCols': 2, 'maxCols': 10 }
|
|
21
|
+
];
|
|
22
|
+
this.setScreenWidth();
|
|
23
|
+
window.addEventListener('resize', (/**
|
|
24
|
+
* @return {?}
|
|
25
|
+
*/
|
|
26
|
+
function () {
|
|
27
|
+
_this.setScreenWidth();
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @private
|
|
32
|
+
* @return {?}
|
|
33
|
+
*/
|
|
34
|
+
RADashboardResponsiveService.prototype.setScreenWidth = /**
|
|
35
|
+
* @private
|
|
36
|
+
* @return {?}
|
|
37
|
+
*/
|
|
38
|
+
function () {
|
|
39
|
+
var _this = this;
|
|
40
|
+
this.screenWidth = screen.width;
|
|
41
|
+
this.currentResInfo = this.resInfo.filter((/**
|
|
42
|
+
* @param {?} item
|
|
43
|
+
* @return {?}
|
|
44
|
+
*/
|
|
45
|
+
function (item) {
|
|
46
|
+
return item.end >= _this.screenWidth && item.start <= _this.screenWidth;
|
|
47
|
+
}))[0];
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(RADashboardResponsiveService.prototype, "IsDesktopView", {
|
|
50
|
+
get: /**
|
|
51
|
+
* @return {?}
|
|
52
|
+
*/
|
|
53
|
+
function () {
|
|
54
|
+
return this.screenWidth >= DesktopViewStart;
|
|
55
|
+
},
|
|
56
|
+
enumerable: true,
|
|
57
|
+
configurable: true
|
|
58
|
+
});
|
|
59
|
+
Object.defineProperty(RADashboardResponsiveService.prototype, "IsGridLocked", {
|
|
60
|
+
get: /**
|
|
61
|
+
* @return {?}
|
|
62
|
+
*/
|
|
63
|
+
function () {
|
|
64
|
+
return this.screenWidth <= GridLockViewEnd;
|
|
65
|
+
},
|
|
66
|
+
enumerable: true,
|
|
67
|
+
configurable: true
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(RADashboardResponsiveService.prototype, "GridsterConfig", {
|
|
70
|
+
get: /**
|
|
71
|
+
* @return {?}
|
|
72
|
+
*/
|
|
73
|
+
function () {
|
|
74
|
+
/** @type {?} */
|
|
75
|
+
var config = GridsterConfigDefaultSettings;
|
|
76
|
+
config.minCols = this.currentResInfo.maxCols;
|
|
77
|
+
config.maxCols = this.currentResInfo.maxCols;
|
|
78
|
+
config.minRows = this.currentResInfo.minCols;
|
|
79
|
+
config.maxItemCols = this.currentResInfo.maxCols;
|
|
80
|
+
config.minItemCols = this.currentResInfo.minCols;
|
|
81
|
+
config.minItemRows = this.currentResInfo.minCols;
|
|
82
|
+
config.minItemArea = this.currentResInfo.minCols * this.currentResInfo.minCols;
|
|
83
|
+
config.defaultItemCols = this.currentResInfo.minCols;
|
|
84
|
+
config.defaultItemRows = this.currentResInfo.minCols;
|
|
85
|
+
if (!this.IsDesktopView) {
|
|
86
|
+
config.resizable.enabled = false;
|
|
87
|
+
config.swap = false;
|
|
88
|
+
config.draggable.enabled = false;
|
|
89
|
+
}
|
|
90
|
+
return config;
|
|
91
|
+
},
|
|
92
|
+
enumerable: true,
|
|
93
|
+
configurable: true
|
|
94
|
+
});
|
|
95
|
+
/**To map IwidgetInfo object to gridsterItem */
|
|
96
|
+
/**
|
|
97
|
+
* To map IwidgetInfo object to gridsterItem
|
|
98
|
+
* @param {?} widget
|
|
99
|
+
* @return {?}
|
|
100
|
+
*/
|
|
101
|
+
RADashboardResponsiveService.prototype.getGridsterItem = /**
|
|
102
|
+
* To map IwidgetInfo object to gridsterItem
|
|
103
|
+
* @param {?} widget
|
|
104
|
+
* @return {?}
|
|
105
|
+
*/
|
|
106
|
+
function (widget) {
|
|
107
|
+
/** @type {?} */
|
|
108
|
+
var gridsterItem = (/** @type {?} */ ({
|
|
109
|
+
cols: this.getWidth(widget.width),
|
|
110
|
+
rows: this.getHeight(widget.height),
|
|
111
|
+
x: this.IsDesktopView ? widget.position_x : 0,
|
|
112
|
+
y: this.IsDesktopView ? widget.position_y : 0,
|
|
113
|
+
isInitialized: widget.isInitialized,
|
|
114
|
+
widgetInfo: widget
|
|
115
|
+
}));
|
|
116
|
+
return gridsterItem;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* @private
|
|
120
|
+
* @param {?} width
|
|
121
|
+
* @return {?}
|
|
122
|
+
*/
|
|
123
|
+
RADashboardResponsiveService.prototype.getWidth = /**
|
|
124
|
+
* @private
|
|
125
|
+
* @param {?} width
|
|
126
|
+
* @return {?}
|
|
127
|
+
*/
|
|
128
|
+
function (width) {
|
|
129
|
+
if (!this.IsDesktopView) {
|
|
130
|
+
width = Math.floor(width / 10 * this.currentResInfo.maxCols);
|
|
131
|
+
if (width < this.currentResInfo.minCols)
|
|
132
|
+
width = this.currentResInfo.minCols;
|
|
133
|
+
}
|
|
134
|
+
return width;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* @private
|
|
138
|
+
* @param {?} height
|
|
139
|
+
* @return {?}
|
|
140
|
+
*/
|
|
141
|
+
RADashboardResponsiveService.prototype.getHeight = /**
|
|
142
|
+
* @private
|
|
143
|
+
* @param {?} height
|
|
144
|
+
* @return {?}
|
|
145
|
+
*/
|
|
146
|
+
function (height) {
|
|
147
|
+
if (!this.IsDesktopView) {
|
|
148
|
+
height = Math.floor(height / 10 * this.currentResInfo.maxCols);
|
|
149
|
+
if (height < this.currentResInfo.minCols)
|
|
150
|
+
height = this.currentResInfo.minCols;
|
|
151
|
+
}
|
|
152
|
+
return height;
|
|
153
|
+
};
|
|
154
|
+
RADashboardResponsiveService.decorators = [
|
|
155
|
+
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
156
|
+
];
|
|
157
|
+
/** @nocollapse */
|
|
158
|
+
RADashboardResponsiveService.ctorParameters = function () { return []; };
|
|
159
|
+
/** @nocollapse */ RADashboardResponsiveService.ngInjectableDef = i0.ɵɵdefineInjectable({ factory: function RADashboardResponsiveService_Factory() { return new RADashboardResponsiveService(); }, token: RADashboardResponsiveService, providedIn: "root" });
|
|
160
|
+
return RADashboardResponsiveService;
|
|
161
|
+
}());
|
|
162
|
+
export { RADashboardResponsiveService };
|
|
163
|
+
if (false) {
|
|
164
|
+
/**
|
|
165
|
+
* @type {?}
|
|
166
|
+
* @private
|
|
167
|
+
*/
|
|
168
|
+
RADashboardResponsiveService.prototype.screenWidth;
|
|
169
|
+
/**
|
|
170
|
+
* @type {?}
|
|
171
|
+
* @private
|
|
172
|
+
*/
|
|
173
|
+
RADashboardResponsiveService.prototype.resInfo;
|
|
174
|
+
/**
|
|
175
|
+
* @type {?}
|
|
176
|
+
* @private
|
|
177
|
+
*/
|
|
178
|
+
RADashboardResponsiveService.prototype.currentResInfo;
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmEuZGFzaGJvYXJkLnJlc3BvbnNpdmUuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzY2huZWlkZXJlc3MvZGFzaGJvYXJkZnJhbWV3b3JrLyIsInNvdXJjZXMiOlsibGliL3JhLmRhc2hib2FyZC5yZXNwb25zaXZlLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTNDLE9BQU8sRUFBRSw2QkFBNkIsRUFBRSxNQUFNLHNCQUFzQixDQUFDOzs7SUFHL0QsZ0JBQWdCLEdBQVcsSUFBSTs7S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oLmZsb29yKGhlaWdodCAvIDEwICogdGhpcy5jdXJyZW50UmVzSW5mby5tYXhDb2xzKTtcclxuICAgICAgICAgICAgaWYgKGhlaWdodCA8IHRoaXMuY3VycmVudFJlc0luZm8ubWluQ29scylcclxuICAgICAgICAgICAgICAgIGhlaWdodCA9IHRoaXMuY3VycmVudFJlc0luZm8ubWluQ29scztcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGhlaWdodDtcclxuICAgIH1cclxufSJdfQ==
|
package/esm5/public-api.js
CHANGED
|
@@ -14,4 +14,5 @@ export { RADashboardEventBus } from './lib/ra.dashbard.event.bus';
|
|
|
14
14
|
export { RAEvent, RAEventKey } from './lib/ra.event.enum';
|
|
15
15
|
export { RaBaseDashboardTemplate } from './lib/ra.base.dashboard.template';
|
|
16
16
|
export { RaBaseDashboardFilter } from './lib/ra.base.dashboard.filter';
|
|
17
|
-
|
|
17
|
+
export { RADashboardResponsiveService } from './lib/ra.dashboard.responsive.service';
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzY2huZWlkZXJlc3MvZGFzaGJvYXJkZnJhbWV3b3JrLyIsInNvdXJjZXMiOlsicHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUlBLG1DQUFjLDRCQUE0QixDQUFDO0FBQzNDLGdDQUFjLDJDQUEyQyxDQUFDO0FBQzFELGtDQUFjLHlEQUF5RCxDQUFDO0FBQ3hFLHlDQUFjLDJCQUEyQixDQUFDO0FBQzFDLG9DQUFjLDZCQUE2QixDQUFDO0FBQzVDLG9DQUFjLHFCQUFxQixDQUFDO0FBQ3BDLHdDQUFjLGtDQUFrQyxDQUFDO0FBQ2pELHNDQUFjLGdDQUFnQyxDQUFDO0FBQy9DLDZDQUFjLHVDQUF1QyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcclxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIHJhLWRhc2hib2FyZC1mcmFtZXdvcmtcclxuICovXHJcblxyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9yYS5kYXNoYm9hcmQuc2VydmljZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3JhLWRhc2hib2FyZC1hcmVhL3JhLmRhc2hib2FyZC5hcmVhJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvcmEtd2lkZ2V0LWNvbnRhaW5lci9yYS53aWRnZXQuY29udGFpbmVyLmNvbXBvbmVudCc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3JhLmRhc2hib2FyZC5tb2R1bGUnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9yYS5kYXNoYmFyZC5ldmVudC5idXMnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9yYS5ldmVudC5lbnVtJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvcmEuYmFzZS5kYXNoYm9hcmQudGVtcGxhdGUnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9yYS5iYXNlLmRhc2hib2FyZC5maWx0ZXInO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9yYS5kYXNoYm9hcmQucmVzcG9uc2l2ZS5zZXJ2aWNlJztcclxuIl19
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Generated bundle index. Do not edit.
|
|
8
8
|
*/
|
|
9
|
-
export { RaDashboardService, RADashboardArea, RAWidgetContainer, DashboardFrameworkModule, RADashboardEventBus, RAEvent, RAEventKey, RaBaseDashboardTemplate, RaBaseDashboardFilter } from './public-api';
|
|
9
|
+
export { RaDashboardService, RADashboardArea, RAWidgetContainer, DashboardFrameworkModule, RADashboardEventBus, RAEvent, RAEventKey, RaBaseDashboardTemplate, RaBaseDashboardFilter, RADashboardResponsiveService } from './public-api';
|
|
10
10
|
export { GridsterComponent as ɵb } from './gridster/lib/gridster.component';
|
|
11
11
|
export { GridsterModule as ɵa } from './gridster/lib/gridster.module';
|
|
12
12
|
export { GridsterItemComponent as ɵc } from './gridster/lib/gridsterItem.component';
|
|
13
13
|
export { GridsterPreviewComponent as ɵd } from './gridster/lib/gridsterPreview.component';
|
|
14
14
|
export { customNotifierOptions as ɵe } from './lib/custom.notifier.options';
|
|
15
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NobmVpZGVyZXNzLWRhc2hib2FyZGZyYW1ld29yay5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzY2huZWlkZXJlc3MvZGFzaGJvYXJkZnJhbWV3b3JrLyIsInNvdXJjZXMiOlsic2NobmVpZGVyZXNzLWRhc2hib2FyZGZyYW1ld29yay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUlBLHlOQUFjLGNBQWMsQ0FBQztBQUU3QixPQUFPLEVBQUMsaUJBQWlCLElBQUksRUFBRSxFQUFDLE1BQU0sbUNBQW1DLENBQUM7QUFDMUUsT0FBTyxFQUFDLGNBQWMsSUFBSSxFQUFFLEVBQUMsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRSxPQUFPLEVBQUMscUJBQXFCLElBQUksRUFBRSxFQUFDLE1BQU0sdUNBQXVDLENBQUM7QUFDbEYsT0FBTyxFQUFDLHdCQUF3QixJQUFJLEVBQUUsRUFBQyxNQUFNLDBDQUEwQyxDQUFDO0FBQ3hGLE9BQU8sRUFBQyxxQkFBcUIsSUFBSSxFQUFFLEVBQUMsTUFBTSwrQkFBK0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcblxuZXhwb3J0IHtHcmlkc3RlckNvbXBvbmVudCBhcyDJtWJ9IGZyb20gJy4vZ3JpZHN0ZXIvbGliL2dyaWRzdGVyLmNvbXBvbmVudCc7XG5leHBvcnQge0dyaWRzdGVyTW9kdWxlIGFzIMm1YX0gZnJvbSAnLi9ncmlkc3Rlci9saWIvZ3JpZHN0ZXIubW9kdWxlJztcbmV4cG9ydCB7R3JpZHN0ZXJJdGVtQ29tcG9uZW50IGFzIMm1Y30gZnJvbSAnLi9ncmlkc3Rlci9saWIvZ3JpZHN0ZXJJdGVtLmNvbXBvbmVudCc7XG5leHBvcnQge0dyaWRzdGVyUHJldmlld0NvbXBvbmVudCBhcyDJtWR9IGZyb20gJy4vZ3JpZHN0ZXIvbGliL2dyaWRzdGVyUHJldmlldy5jb21wb25lbnQnO1xuZXhwb3J0IHtjdXN0b21Ob3RpZmllck9wdGlvbnMgYXMgybVlfSBmcm9tICcuL2xpYi9jdXN0b20ubm90aWZpZXIub3B0aW9ucyc7Il19
|
|
@@ -573,6 +573,147 @@ const GridsterConfigDefaultSettings = {
|
|
|
573
573
|
//itemInitCallback: (item) => this.itemInitCallback(item)
|
|
574
574
|
};
|
|
575
575
|
|
|
576
|
+
/**
|
|
577
|
+
* @fileoverview added by tsickle
|
|
578
|
+
* Generated from: lib/ra.dashboard.responsive.service.ts
|
|
579
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
580
|
+
*/
|
|
581
|
+
/** @type {?} */
|
|
582
|
+
const DesktopViewStart = 1367;
|
|
583
|
+
/** @type {?} */
|
|
584
|
+
const GridLockViewEnd = 1024;
|
|
585
|
+
class RADashboardResponsiveService {
|
|
586
|
+
constructor() {
|
|
587
|
+
this.resInfo = [
|
|
588
|
+
{ 'start': 0, 'end': 767, 'minCols': 1, 'maxCols': 1 },
|
|
589
|
+
{ 'start': 768, 'end': GridLockViewEnd, 'minCols': 1, 'maxCols': 2 },
|
|
590
|
+
{ 'start': GridLockViewEnd + 1, 'end': DesktopViewStart - 1, 'minCols': 2, 'maxCols': 6 },
|
|
591
|
+
{ 'start': DesktopViewStart, 'end': 9999999999, 'minCols': 2, 'maxCols': 10 }
|
|
592
|
+
];
|
|
593
|
+
this.setScreenWidth();
|
|
594
|
+
window.addEventListener('resize', (/**
|
|
595
|
+
* @return {?}
|
|
596
|
+
*/
|
|
597
|
+
() => {
|
|
598
|
+
this.setScreenWidth();
|
|
599
|
+
}));
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* @private
|
|
603
|
+
* @return {?}
|
|
604
|
+
*/
|
|
605
|
+
setScreenWidth() {
|
|
606
|
+
this.screenWidth = screen.width;
|
|
607
|
+
this.currentResInfo = this.resInfo.filter((/**
|
|
608
|
+
* @param {?} item
|
|
609
|
+
* @return {?}
|
|
610
|
+
*/
|
|
611
|
+
(item) => {
|
|
612
|
+
return item.end >= this.screenWidth && item.start <= this.screenWidth;
|
|
613
|
+
}))[0];
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* @return {?}
|
|
617
|
+
*/
|
|
618
|
+
get IsDesktopView() {
|
|
619
|
+
return this.screenWidth >= DesktopViewStart;
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* @return {?}
|
|
623
|
+
*/
|
|
624
|
+
get IsGridLocked() {
|
|
625
|
+
return this.screenWidth <= GridLockViewEnd;
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* @return {?}
|
|
629
|
+
*/
|
|
630
|
+
get GridsterConfig() {
|
|
631
|
+
/** @type {?} */
|
|
632
|
+
let config = GridsterConfigDefaultSettings;
|
|
633
|
+
config.minCols = this.currentResInfo.maxCols;
|
|
634
|
+
config.maxCols = this.currentResInfo.maxCols;
|
|
635
|
+
config.minRows = this.currentResInfo.minCols;
|
|
636
|
+
config.maxItemCols = this.currentResInfo.maxCols;
|
|
637
|
+
config.minItemCols = this.currentResInfo.minCols;
|
|
638
|
+
config.minItemRows = this.currentResInfo.minCols;
|
|
639
|
+
config.minItemArea = this.currentResInfo.minCols * this.currentResInfo.minCols;
|
|
640
|
+
config.defaultItemCols = this.currentResInfo.minCols;
|
|
641
|
+
config.defaultItemRows = this.currentResInfo.minCols;
|
|
642
|
+
if (!this.IsDesktopView) {
|
|
643
|
+
config.resizable.enabled = false;
|
|
644
|
+
config.swap = false;
|
|
645
|
+
config.draggable.enabled = false;
|
|
646
|
+
}
|
|
647
|
+
return config;
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* To map IwidgetInfo object to gridsterItem
|
|
651
|
+
* @param {?} widget
|
|
652
|
+
* @return {?}
|
|
653
|
+
*/
|
|
654
|
+
getGridsterItem(widget) {
|
|
655
|
+
/** @type {?} */
|
|
656
|
+
let gridsterItem = (/** @type {?} */ ({
|
|
657
|
+
cols: this.getWidth(widget.width),
|
|
658
|
+
rows: this.getHeight(widget.height),
|
|
659
|
+
x: this.IsDesktopView ? widget.position_x : 0,
|
|
660
|
+
y: this.IsDesktopView ? widget.position_y : 0,
|
|
661
|
+
isInitialized: widget.isInitialized,
|
|
662
|
+
widgetInfo: widget
|
|
663
|
+
}));
|
|
664
|
+
return gridsterItem;
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* @private
|
|
668
|
+
* @param {?} width
|
|
669
|
+
* @return {?}
|
|
670
|
+
*/
|
|
671
|
+
getWidth(width) {
|
|
672
|
+
if (!this.IsDesktopView) {
|
|
673
|
+
width = Math.floor(width / 10 * this.currentResInfo.maxCols);
|
|
674
|
+
if (width < this.currentResInfo.minCols)
|
|
675
|
+
width = this.currentResInfo.minCols;
|
|
676
|
+
}
|
|
677
|
+
return width;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* @private
|
|
681
|
+
* @param {?} height
|
|
682
|
+
* @return {?}
|
|
683
|
+
*/
|
|
684
|
+
getHeight(height) {
|
|
685
|
+
if (!this.IsDesktopView) {
|
|
686
|
+
height = Math.floor(height / 10 * this.currentResInfo.maxCols);
|
|
687
|
+
if (height < this.currentResInfo.minCols)
|
|
688
|
+
height = this.currentResInfo.minCols;
|
|
689
|
+
}
|
|
690
|
+
return height;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
RADashboardResponsiveService.decorators = [
|
|
694
|
+
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
695
|
+
];
|
|
696
|
+
/** @nocollapse */
|
|
697
|
+
RADashboardResponsiveService.ctorParameters = () => [];
|
|
698
|
+
/** @nocollapse */ RADashboardResponsiveService.ngInjectableDef = ɵɵdefineInjectable({ factory: function RADashboardResponsiveService_Factory() { return new RADashboardResponsiveService(); }, token: RADashboardResponsiveService, providedIn: "root" });
|
|
699
|
+
if (false) {
|
|
700
|
+
/**
|
|
701
|
+
* @type {?}
|
|
702
|
+
* @private
|
|
703
|
+
*/
|
|
704
|
+
RADashboardResponsiveService.prototype.screenWidth;
|
|
705
|
+
/**
|
|
706
|
+
* @type {?}
|
|
707
|
+
* @private
|
|
708
|
+
*/
|
|
709
|
+
RADashboardResponsiveService.prototype.resInfo;
|
|
710
|
+
/**
|
|
711
|
+
* @type {?}
|
|
712
|
+
* @private
|
|
713
|
+
*/
|
|
714
|
+
RADashboardResponsiveService.prototype.currentResInfo;
|
|
715
|
+
}
|
|
716
|
+
|
|
576
717
|
/**
|
|
577
718
|
* @fileoverview added by tsickle
|
|
578
719
|
* Generated from: lib/ra-dashboard-area/ra.dashboard.area.ts
|
|
@@ -585,13 +726,15 @@ class RADashboardArea {
|
|
|
585
726
|
* @param {?} ngxService
|
|
586
727
|
* @param {?} translateService
|
|
587
728
|
* @param {?} notifier
|
|
729
|
+
* @param {?} responsiveService
|
|
588
730
|
*/
|
|
589
|
-
constructor(dashboardService, ngZone, ngxService, translateService, notifier) {
|
|
731
|
+
constructor(dashboardService, ngZone, ngxService, translateService, notifier, responsiveService) {
|
|
590
732
|
this.dashboardService = dashboardService;
|
|
591
733
|
this.ngZone = ngZone;
|
|
592
734
|
this.ngxService = ngxService;
|
|
593
735
|
this.translateService = translateService;
|
|
594
736
|
this.notifier = notifier;
|
|
737
|
+
this.responsiveService = responsiveService;
|
|
595
738
|
this.widgetList = Array();
|
|
596
739
|
this.gridheight = 300;
|
|
597
740
|
this.gridcellHeight = 0;
|
|
@@ -605,15 +748,22 @@ class RADashboardArea {
|
|
|
605
748
|
* @return {?}
|
|
606
749
|
*/
|
|
607
750
|
onResize(event) {
|
|
608
|
-
|
|
609
|
-
var areaContext = this;
|
|
751
|
+
this.widgetList = [];
|
|
610
752
|
setTimeout((/**
|
|
611
753
|
* @return {?}
|
|
612
754
|
*/
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
755
|
+
() => {
|
|
756
|
+
this.initiateGridsterConfig();
|
|
757
|
+
this.options.api.optionsChanged();
|
|
758
|
+
if (this.userWidgets) {
|
|
759
|
+
this.widgetList = this.mapObjectListToGridsterItemList(this.userWidgets);
|
|
760
|
+
this.setAreaHeight();
|
|
761
|
+
}
|
|
762
|
+
else {
|
|
763
|
+
this.loadWidgets(this.userDashboardId, this.areaKey);
|
|
764
|
+
}
|
|
765
|
+
this.domResized = !this.domResized;
|
|
766
|
+
}));
|
|
617
767
|
}
|
|
618
768
|
/**
|
|
619
769
|
* @return {?}
|
|
@@ -634,30 +784,38 @@ class RADashboardArea {
|
|
|
634
784
|
this.inititateEventBusSubscritions();
|
|
635
785
|
}
|
|
636
786
|
}
|
|
637
|
-
// public invokeResizeEvent() {
|
|
638
|
-
// this.widgetContainers.forEach(function(container,i){
|
|
639
|
-
// container.invokeWidgetResizedEvent();
|
|
640
|
-
// });
|
|
641
|
-
// }
|
|
642
787
|
/**
|
|
643
788
|
* To set GridsterConfig
|
|
644
789
|
* @return {?}
|
|
645
790
|
*/
|
|
646
791
|
initiateGridsterConfig() {
|
|
647
|
-
/** @type {?} */
|
|
648
|
-
let areaContext = this;
|
|
649
792
|
/**To override default configuration values to the gridster control */
|
|
650
|
-
this.options =
|
|
793
|
+
this.options = this.responsiveService.GridsterConfig;
|
|
651
794
|
this.options.itemChangeCallback = (/**
|
|
652
795
|
* @param {?} item
|
|
653
796
|
* @return {?}
|
|
654
797
|
*/
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
798
|
+
(item) => {
|
|
799
|
+
if (item.isInitialized) {
|
|
800
|
+
if (!this.responsiveService.IsGridLocked) {
|
|
801
|
+
if (!this.responsiveService.IsDesktopView) {
|
|
802
|
+
this.updateWidgets();
|
|
803
|
+
}
|
|
804
|
+
else {
|
|
805
|
+
if (item.widgetInfo && item.widgetInfo.widgetInstanceId) {
|
|
806
|
+
this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
this.setAreaHeight();
|
|
659
811
|
}
|
|
660
|
-
|
|
812
|
+
});
|
|
813
|
+
this.options.itemInitCallback = (/**
|
|
814
|
+
* @param {?} item
|
|
815
|
+
* @return {?}
|
|
816
|
+
*/
|
|
817
|
+
(item) => {
|
|
818
|
+
item.isInitialized = true;
|
|
661
819
|
});
|
|
662
820
|
}
|
|
663
821
|
/**
|
|
@@ -710,7 +868,6 @@ class RADashboardArea {
|
|
|
710
868
|
* @return {?}
|
|
711
869
|
*/
|
|
712
870
|
() => {
|
|
713
|
-
console.log('rearrange event bus triggered');
|
|
714
871
|
this.rearrangeWidgets();
|
|
715
872
|
}));
|
|
716
873
|
}));
|
|
@@ -724,9 +881,6 @@ class RADashboardArea {
|
|
|
724
881
|
*/
|
|
725
882
|
() => {
|
|
726
883
|
if (widgetList) {
|
|
727
|
-
// widgetList.forEach(widgetInfo => {
|
|
728
|
-
// this.addWidget(widgetInfo);
|
|
729
|
-
// });
|
|
730
884
|
this.addWidgetListToGridster(widgetList, 0);
|
|
731
885
|
}
|
|
732
886
|
}));
|
|
@@ -782,7 +936,7 @@ class RADashboardArea {
|
|
|
782
936
|
* @return {?}
|
|
783
937
|
*/
|
|
784
938
|
updateWidgets() {
|
|
785
|
-
this.dashboardService.updateWidgets(this.mapGridsterListToObject(this.widgetList), this.appConfig).subscribe((/**
|
|
939
|
+
this.dashboardService.updateWidgets(this.formatWidgetDataForPositionDetails(this.mapGridsterListToObject(this.widgetList)), this.appConfig).subscribe((/**
|
|
786
940
|
* @param {?} widgets
|
|
787
941
|
* @return {?}
|
|
788
942
|
*/
|
|
@@ -848,22 +1002,37 @@ class RADashboardArea {
|
|
|
848
1002
|
* @return {?}
|
|
849
1003
|
*/
|
|
850
1004
|
loadWidgets(userDashboarId, areaKey) {
|
|
851
|
-
/** @type {?} */
|
|
852
|
-
let areaContext = this;
|
|
853
1005
|
/** @type {?} */
|
|
854
1006
|
let widgetInfo = (/** @type {?} */ ({
|
|
855
1007
|
dashboardId: userDashboarId.toString(),
|
|
856
1008
|
dashboardAreaKey: areaKey
|
|
857
1009
|
}));
|
|
858
|
-
|
|
1010
|
+
this.widgetList = [];
|
|
859
1011
|
this.dashboardService.getWidgetsByDashboardArea(widgetInfo, this.appConfig).subscribe((/**
|
|
860
1012
|
* @param {?} widgets
|
|
861
1013
|
* @return {?}
|
|
862
1014
|
*/
|
|
863
1015
|
widgets => {
|
|
1016
|
+
//sorting the widgets y, x
|
|
1017
|
+
widgets = widgets.sort((/**
|
|
1018
|
+
* @param {?} a
|
|
1019
|
+
* @param {?} b
|
|
1020
|
+
* @return {?}
|
|
1021
|
+
*/
|
|
1022
|
+
(a, b) => {
|
|
1023
|
+
if (a['position_y'] > b['position_y'])
|
|
1024
|
+
return 1;
|
|
1025
|
+
if (a['position_y'] < b['position_y'])
|
|
1026
|
+
return -1;
|
|
1027
|
+
if (a['position_x'] > b['position_x'])
|
|
1028
|
+
return 1;
|
|
1029
|
+
if (a['position_x'] < b['position_x'])
|
|
1030
|
+
return -1;
|
|
1031
|
+
}));
|
|
1032
|
+
this.userWidgets = widgets;
|
|
864
1033
|
if (widgets && widgets.length > 0) {
|
|
865
|
-
|
|
866
|
-
|
|
1034
|
+
this.widgetList = this.mapObjectListToGridsterItemList(widgets);
|
|
1035
|
+
this.setAreaHeight();
|
|
867
1036
|
}
|
|
868
1037
|
}));
|
|
869
1038
|
}
|
|
@@ -915,7 +1084,6 @@ class RADashboardArea {
|
|
|
915
1084
|
areaHeight = 600;
|
|
916
1085
|
}
|
|
917
1086
|
this.gridheight = areaHeight;
|
|
918
|
-
console.log('area height adjusted1');
|
|
919
1087
|
}
|
|
920
1088
|
/**
|
|
921
1089
|
* To remove a widget instance from dashboard and to save info in database
|
|
@@ -957,20 +1125,12 @@ class RADashboardArea {
|
|
|
957
1125
|
* @return {?}
|
|
958
1126
|
*/
|
|
959
1127
|
addWidget(data) {
|
|
960
|
-
/** @type {?} */
|
|
961
|
-
let widgetid = data.widgetId;
|
|
962
1128
|
data.height = this.widgetHeight;
|
|
963
1129
|
data.width = this.widgetWidth;
|
|
964
1130
|
data.position_x = 0;
|
|
965
1131
|
data.position_y = 0;
|
|
966
|
-
|
|
967
|
-
let gridsterItem = this.mapObjectsToGridsterItem(data);
|
|
1132
|
+
data.isInitialized = true;
|
|
968
1133
|
/** to find the available position in gridster, temp commenting the code-returning higher y value than normal */
|
|
969
|
-
// if (this.options.api) {
|
|
970
|
-
// gridsterItem = this.options.api.getFirstPossiblePosition(gridsterItem);
|
|
971
|
-
// }
|
|
972
|
-
// data.position_x = gridsterItem.x;
|
|
973
|
-
// data.position_y = gridsterItem.y;
|
|
974
1134
|
data.dashboardAreaKey = this.areaKey;
|
|
975
1135
|
data.dashboardId = this.userDashboardId;
|
|
976
1136
|
this.ngxService.start();
|
|
@@ -979,7 +1139,8 @@ class RADashboardArea {
|
|
|
979
1139
|
* @return {?}
|
|
980
1140
|
*/
|
|
981
1141
|
widget => {
|
|
982
|
-
|
|
1142
|
+
/** @type {?} */
|
|
1143
|
+
let gridsterItem = this.responsiveService.getGridsterItem(widget);
|
|
983
1144
|
this.widgetList.push(gridsterItem);
|
|
984
1145
|
this.setAreaHeight();
|
|
985
1146
|
if (this.options.api) {
|
|
@@ -1011,33 +1172,14 @@ class RADashboardArea {
|
|
|
1011
1172
|
* @return {?}
|
|
1012
1173
|
*/
|
|
1013
1174
|
copyWidget(data) {
|
|
1175
|
+
data.position_x = 0;
|
|
1176
|
+
data.position_y = 0;
|
|
1177
|
+
data.isInitialized = true;
|
|
1014
1178
|
/** @type {?} */
|
|
1015
|
-
let gridsterItem = this.
|
|
1016
|
-
if (this.options.api) {
|
|
1017
|
-
gridsterItem = this.options.api.getFirstPossiblePosition(gridsterItem);
|
|
1018
|
-
}
|
|
1019
|
-
data.position_x = gridsterItem.x;
|
|
1020
|
-
data.position_y = gridsterItem.y;
|
|
1021
|
-
gridsterItem = this.mapObjectsToGridsterItem(data);
|
|
1179
|
+
let gridsterItem = this.responsiveService.getGridsterItem(data);
|
|
1022
1180
|
this.widgetList.push(gridsterItem);
|
|
1023
1181
|
this.setAreaHeight();
|
|
1024
1182
|
}
|
|
1025
|
-
/**
|
|
1026
|
-
* To map IwidgetInfo object to gridsterItem
|
|
1027
|
-
* @param {?} widget
|
|
1028
|
-
* @return {?}
|
|
1029
|
-
*/
|
|
1030
|
-
mapObjectsToGridsterItem(widget) {
|
|
1031
|
-
/** @type {?} */
|
|
1032
|
-
let gridsterItem = (/** @type {?} */ ({
|
|
1033
|
-
cols: widget.width,
|
|
1034
|
-
rows: widget.height,
|
|
1035
|
-
x: widget.position_x,
|
|
1036
|
-
y: widget.position_y,
|
|
1037
|
-
widgetInfo: widget
|
|
1038
|
-
}));
|
|
1039
|
-
return gridsterItem;
|
|
1040
|
-
}
|
|
1041
1183
|
/**
|
|
1042
1184
|
* @param {?} widgetList
|
|
1043
1185
|
* @return {?}
|
|
@@ -1050,7 +1192,7 @@ class RADashboardArea {
|
|
|
1050
1192
|
* @return {?}
|
|
1051
1193
|
*/
|
|
1052
1194
|
widget => {
|
|
1053
|
-
widgetArray.push(this.
|
|
1195
|
+
widgetArray.push(this.responsiveService.getGridsterItem(widget));
|
|
1054
1196
|
}));
|
|
1055
1197
|
return widgetArray;
|
|
1056
1198
|
}
|
|
@@ -1099,7 +1241,8 @@ RADashboardArea.ctorParameters = () => [
|
|
|
1099
1241
|
{ type: NgZone },
|
|
1100
1242
|
{ type: NgxUiLoaderService },
|
|
1101
1243
|
{ type: RATranslateService },
|
|
1102
|
-
{ type: NotifierService }
|
|
1244
|
+
{ type: NotifierService },
|
|
1245
|
+
{ type: RADashboardResponsiveService }
|
|
1103
1246
|
];
|
|
1104
1247
|
RADashboardArea.propDecorators = {
|
|
1105
1248
|
userDashboardId: [{ type: Input, args: ['user-dashboard-id',] }],
|
|
@@ -1121,6 +1264,11 @@ if (false) {
|
|
|
1121
1264
|
RADashboardArea.prototype.gridheight;
|
|
1122
1265
|
/** @type {?} */
|
|
1123
1266
|
RADashboardArea.prototype.gridcellHeight;
|
|
1267
|
+
/**
|
|
1268
|
+
* @type {?}
|
|
1269
|
+
* @private
|
|
1270
|
+
*/
|
|
1271
|
+
RADashboardArea.prototype.userWidgets;
|
|
1124
1272
|
/**
|
|
1125
1273
|
* @type {?}
|
|
1126
1274
|
* @private
|
|
@@ -1194,6 +1342,11 @@ if (false) {
|
|
|
1194
1342
|
* @private
|
|
1195
1343
|
*/
|
|
1196
1344
|
RADashboardArea.prototype.notifier;
|
|
1345
|
+
/**
|
|
1346
|
+
* @type {?}
|
|
1347
|
+
* @private
|
|
1348
|
+
*/
|
|
1349
|
+
RADashboardArea.prototype.responsiveService;
|
|
1197
1350
|
}
|
|
1198
1351
|
|
|
1199
1352
|
/**
|
|
@@ -6661,5 +6814,5 @@ if (false) {
|
|
|
6661
6814
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
6662
6815
|
*/
|
|
6663
6816
|
|
|
6664
|
-
export { DashboardFrameworkModule, RADashboardArea, RADashboardEventBus, RAEvent, RAEventKey, RAWidgetContainer, RaBaseDashboardFilter, RaBaseDashboardTemplate, RaDashboardService, GridsterModule as ɵa, GridsterComponent as ɵb, GridsterItemComponent as ɵc, GridsterPreviewComponent as ɵd, customNotifierOptions as ɵe };
|
|
6817
|
+
export { DashboardFrameworkModule, RADashboardArea, RADashboardEventBus, RADashboardResponsiveService, RAEvent, RAEventKey, RAWidgetContainer, RaBaseDashboardFilter, RaBaseDashboardTemplate, RaDashboardService, GridsterModule as ɵa, GridsterComponent as ɵb, GridsterItemComponent as ɵc, GridsterPreviewComponent as ɵd, customNotifierOptions as ɵe };
|
|
6665
6818
|
//# sourceMappingURL=schneideress-dashboardframework.js.map
|