@schneideress/dashboardframework 0.0.146 → 0.0.148
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 +334 -135
- package/bundles/schneideress-dashboardframework.umd.js.map +1 -1
- package/bundles/schneideress-dashboardframework.umd.min.js +11 -11
- package/bundles/schneideress-dashboardframework.umd.min.js.map +1 -1
- package/esm2015/lib/ra-dashboard-area/ra.dashboard.area.js +146 -87
- package/esm2015/lib/ra.base.dashboard.template.js +2 -20
- package/esm2015/lib/ra.dashboard.responsive.service.js +135 -0
- package/esm2015/lib/ra.event.enum.js +3 -1
- package/esm2015/public-api.js +2 -1
- package/esm2015/schneideress-dashboardframework.js +2 -2
- package/esm5/lib/ra-dashboard-area/ra.dashboard.area.js +158 -104
- package/esm5/lib/ra.base.dashboard.template.js +2 -20
- package/esm5/lib/ra.dashboard.responsive.service.js +167 -0
- package/esm5/lib/ra.event.enum.js +3 -1
- package/esm5/public-api.js +2 -1
- package/esm5/schneideress-dashboardframework.js +2 -2
- package/fesm2015/schneideress-dashboardframework.js +280 -103
- package/fesm2015/schneideress-dashboardframework.js.map +1 -1
- package/fesm5/schneideress-dashboardframework.js +323 -120
- package/fesm5/schneideress-dashboardframework.js.map +1 -1
- package/lib/ra-dashboard-area/ra.dashboard.area.d.ts +9 -5
- package/lib/ra.base.dashboard.template.d.ts +0 -3
- package/lib/ra.dashboard.responsive.service.d.ts +15 -0
- package/lib/ra.event.enum.d.ts +2 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/schneideress-dashboardframework.metadata.json +1 -1
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
}(this, (function (exports, core, rxjs, raCommon, operators, ngxUiLoader, angularNotifier, widgetframework, platformBrowser, http, common, userControls, commonControls) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/*! *****************************************************************************
|
|
8
|
-
Copyright (c) Microsoft Corporation.
|
|
8
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
10
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
11
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
15
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
16
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
19
|
+
and limitations under the License.
|
|
20
20
|
***************************************************************************** */
|
|
21
21
|
/* global Reflect, Promise */
|
|
22
22
|
|
|
@@ -109,13 +109,8 @@
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
function __createBinding(o, m, k, k2) {
|
|
113
|
-
if (k2 === undefined) k2 = k;
|
|
114
|
-
o[k2] = m[k];
|
|
115
|
-
}
|
|
116
|
-
|
|
117
112
|
function __exportStar(m, exports) {
|
|
118
|
-
for (var p in m) if (
|
|
113
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
119
114
|
}
|
|
120
115
|
|
|
121
116
|
function __values(o) {
|
|
@@ -579,6 +574,8 @@
|
|
|
579
574
|
ConfigAddClick: "configAddClick",
|
|
580
575
|
/** triggers when a user click on the save button in widget configuration window */
|
|
581
576
|
ConfigChanged: "configChanged",
|
|
577
|
+
/**To rearrange widgets in a dashboard */
|
|
578
|
+
RearrangeClicked: "rearrangeClicked",
|
|
582
579
|
/**dashboard customize button click */
|
|
583
580
|
DashboardCustomizeClick: "dashboardCustomizeClick",
|
|
584
581
|
/**triggers when user clicks on the dashboard change icon in header section */
|
|
@@ -896,18 +893,182 @@
|
|
|
896
893
|
//itemInitCallback: (item) => this.itemInitCallback(item)
|
|
897
894
|
};
|
|
898
895
|
|
|
896
|
+
/**
|
|
897
|
+
* @fileoverview added by tsickle
|
|
898
|
+
* Generated from: lib/ra.dashboard.responsive.service.ts
|
|
899
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
900
|
+
*/
|
|
901
|
+
/** @type {?} */
|
|
902
|
+
var DesktopViewStart = 1367;
|
|
903
|
+
var RADashboardResponsiveService = /** @class */ (function () {
|
|
904
|
+
function RADashboardResponsiveService() {
|
|
905
|
+
var _this = this;
|
|
906
|
+
this.resInfo = [
|
|
907
|
+
{ 'start': 0, 'end': 767, 'minCols': 1, 'maxCols': 1 },
|
|
908
|
+
{ 'start': 768, 'end': 1024, 'minCols': 1, 'maxCols': 2 },
|
|
909
|
+
{ 'start': 1025, 'end': DesktopViewStart - 1, 'minCols': 2, 'maxCols': 6 },
|
|
910
|
+
{ 'start': DesktopViewStart, 'end': 9999999999, 'minCols': 2, 'maxCols': 10 }
|
|
911
|
+
];
|
|
912
|
+
this.setScreenWidth();
|
|
913
|
+
window.addEventListener('resize', (/**
|
|
914
|
+
* @return {?}
|
|
915
|
+
*/
|
|
916
|
+
function () {
|
|
917
|
+
_this.setScreenWidth();
|
|
918
|
+
}));
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* @private
|
|
922
|
+
* @return {?}
|
|
923
|
+
*/
|
|
924
|
+
RADashboardResponsiveService.prototype.setScreenWidth = /**
|
|
925
|
+
* @private
|
|
926
|
+
* @return {?}
|
|
927
|
+
*/
|
|
928
|
+
function () {
|
|
929
|
+
var _this = this;
|
|
930
|
+
this.screenWidth = screen.width;
|
|
931
|
+
this.currentResInfo = this.resInfo.filter((/**
|
|
932
|
+
* @param {?} item
|
|
933
|
+
* @return {?}
|
|
934
|
+
*/
|
|
935
|
+
function (item) {
|
|
936
|
+
return item.end >= _this.screenWidth && item.start <= _this.screenWidth;
|
|
937
|
+
}))[0];
|
|
938
|
+
};
|
|
939
|
+
Object.defineProperty(RADashboardResponsiveService.prototype, "IsDesktopView", {
|
|
940
|
+
get: /**
|
|
941
|
+
* @return {?}
|
|
942
|
+
*/
|
|
943
|
+
function () {
|
|
944
|
+
return this.screenWidth >= DesktopViewStart;
|
|
945
|
+
},
|
|
946
|
+
enumerable: true,
|
|
947
|
+
configurable: true
|
|
948
|
+
});
|
|
949
|
+
Object.defineProperty(RADashboardResponsiveService.prototype, "GridsterConfig", {
|
|
950
|
+
get: /**
|
|
951
|
+
* @return {?}
|
|
952
|
+
*/
|
|
953
|
+
function () {
|
|
954
|
+
/** @type {?} */
|
|
955
|
+
var config = GridsterConfigDefaultSettings;
|
|
956
|
+
config.minCols = this.currentResInfo.maxCols;
|
|
957
|
+
config.maxCols = this.currentResInfo.maxCols;
|
|
958
|
+
config.minRows = this.currentResInfo.minCols;
|
|
959
|
+
config.maxItemCols = this.currentResInfo.maxCols;
|
|
960
|
+
config.minItemCols = this.currentResInfo.minCols;
|
|
961
|
+
config.minItemRows = this.currentResInfo.minCols;
|
|
962
|
+
config.minItemArea = this.currentResInfo.minCols * this.currentResInfo.minCols;
|
|
963
|
+
config.defaultItemCols = this.currentResInfo.minCols;
|
|
964
|
+
config.defaultItemRows = this.currentResInfo.minCols;
|
|
965
|
+
if (!this.IsDesktopView) {
|
|
966
|
+
config.resizable.enabled = false;
|
|
967
|
+
config.swap = false;
|
|
968
|
+
config.draggable.enabled = false;
|
|
969
|
+
}
|
|
970
|
+
return config;
|
|
971
|
+
},
|
|
972
|
+
enumerable: true,
|
|
973
|
+
configurable: true
|
|
974
|
+
});
|
|
975
|
+
/**To map IwidgetInfo object to gridsterItem */
|
|
976
|
+
/**
|
|
977
|
+
* To map IwidgetInfo object to gridsterItem
|
|
978
|
+
* @param {?} widget
|
|
979
|
+
* @return {?}
|
|
980
|
+
*/
|
|
981
|
+
RADashboardResponsiveService.prototype.getGridsterItem = /**
|
|
982
|
+
* To map IwidgetInfo object to gridsterItem
|
|
983
|
+
* @param {?} widget
|
|
984
|
+
* @return {?}
|
|
985
|
+
*/
|
|
986
|
+
function (widget) {
|
|
987
|
+
/** @type {?} */
|
|
988
|
+
var gridsterItem = (/** @type {?} */ ({
|
|
989
|
+
cols: this.getWidth(widget.width),
|
|
990
|
+
rows: this.getHeight(widget.height),
|
|
991
|
+
x: this.IsDesktopView ? widget.position_x : 0,
|
|
992
|
+
y: this.IsDesktopView ? widget.position_y : 0,
|
|
993
|
+
widgetInfo: widget
|
|
994
|
+
}));
|
|
995
|
+
return gridsterItem;
|
|
996
|
+
};
|
|
997
|
+
/**
|
|
998
|
+
* @private
|
|
999
|
+
* @param {?} width
|
|
1000
|
+
* @return {?}
|
|
1001
|
+
*/
|
|
1002
|
+
RADashboardResponsiveService.prototype.getWidth = /**
|
|
1003
|
+
* @private
|
|
1004
|
+
* @param {?} width
|
|
1005
|
+
* @return {?}
|
|
1006
|
+
*/
|
|
1007
|
+
function (width) {
|
|
1008
|
+
if (!this.IsDesktopView) {
|
|
1009
|
+
width = Math.floor(width / 10 * this.currentResInfo.maxCols);
|
|
1010
|
+
if (width < this.currentResInfo.minCols)
|
|
1011
|
+
width = this.currentResInfo.minCols;
|
|
1012
|
+
}
|
|
1013
|
+
return width;
|
|
1014
|
+
};
|
|
1015
|
+
/**
|
|
1016
|
+
* @private
|
|
1017
|
+
* @param {?} height
|
|
1018
|
+
* @return {?}
|
|
1019
|
+
*/
|
|
1020
|
+
RADashboardResponsiveService.prototype.getHeight = /**
|
|
1021
|
+
* @private
|
|
1022
|
+
* @param {?} height
|
|
1023
|
+
* @return {?}
|
|
1024
|
+
*/
|
|
1025
|
+
function (height) {
|
|
1026
|
+
if (!this.IsDesktopView) {
|
|
1027
|
+
height = Math.floor(height / 10 * this.currentResInfo.maxCols);
|
|
1028
|
+
if (height < this.currentResInfo.minCols)
|
|
1029
|
+
height = this.currentResInfo.minCols;
|
|
1030
|
+
}
|
|
1031
|
+
return height;
|
|
1032
|
+
};
|
|
1033
|
+
RADashboardResponsiveService.decorators = [
|
|
1034
|
+
{ type: core.Injectable, args: [{ providedIn: 'root' },] }
|
|
1035
|
+
];
|
|
1036
|
+
/** @nocollapse */
|
|
1037
|
+
RADashboardResponsiveService.ctorParameters = function () { return []; };
|
|
1038
|
+
/** @nocollapse */ RADashboardResponsiveService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function RADashboardResponsiveService_Factory() { return new RADashboardResponsiveService(); }, token: RADashboardResponsiveService, providedIn: "root" });
|
|
1039
|
+
return RADashboardResponsiveService;
|
|
1040
|
+
}());
|
|
1041
|
+
if (false) {
|
|
1042
|
+
/**
|
|
1043
|
+
* @type {?}
|
|
1044
|
+
* @private
|
|
1045
|
+
*/
|
|
1046
|
+
RADashboardResponsiveService.prototype.screenWidth;
|
|
1047
|
+
/**
|
|
1048
|
+
* @type {?}
|
|
1049
|
+
* @private
|
|
1050
|
+
*/
|
|
1051
|
+
RADashboardResponsiveService.prototype.resInfo;
|
|
1052
|
+
/**
|
|
1053
|
+
* @type {?}
|
|
1054
|
+
* @private
|
|
1055
|
+
*/
|
|
1056
|
+
RADashboardResponsiveService.prototype.currentResInfo;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
899
1059
|
/**
|
|
900
1060
|
* @fileoverview added by tsickle
|
|
901
1061
|
* Generated from: lib/ra-dashboard-area/ra.dashboard.area.ts
|
|
902
1062
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
903
1063
|
*/
|
|
904
1064
|
var RADashboardArea = /** @class */ (function () {
|
|
905
|
-
function RADashboardArea(dashboardService, ngZone, ngxService, translateService, notifier) {
|
|
1065
|
+
function RADashboardArea(dashboardService, ngZone, ngxService, translateService, notifier, responsiveService) {
|
|
906
1066
|
this.dashboardService = dashboardService;
|
|
907
1067
|
this.ngZone = ngZone;
|
|
908
1068
|
this.ngxService = ngxService;
|
|
909
1069
|
this.translateService = translateService;
|
|
910
1070
|
this.notifier = notifier;
|
|
1071
|
+
this.responsiveService = responsiveService;
|
|
911
1072
|
this.widgetList = Array();
|
|
912
1073
|
this.gridheight = 300;
|
|
913
1074
|
this.gridcellHeight = 0;
|
|
@@ -925,15 +1086,23 @@
|
|
|
925
1086
|
* @return {?}
|
|
926
1087
|
*/
|
|
927
1088
|
function (event) {
|
|
928
|
-
|
|
929
|
-
|
|
1089
|
+
var _this = this;
|
|
1090
|
+
this.widgetList = [];
|
|
930
1091
|
setTimeout((/**
|
|
931
1092
|
* @return {?}
|
|
932
1093
|
*/
|
|
933
1094
|
function () {
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
1095
|
+
_this.initiateGridsterConfig();
|
|
1096
|
+
_this.options.api.optionsChanged();
|
|
1097
|
+
if (_this.userWidgets) {
|
|
1098
|
+
_this.widgetList = _this.mapObjectListToGridsterItemList(_this.userWidgets);
|
|
1099
|
+
_this.setAreaHeight();
|
|
1100
|
+
}
|
|
1101
|
+
else {
|
|
1102
|
+
_this.loadWidgets(_this.userDashboardId, _this.areaKey);
|
|
1103
|
+
}
|
|
1104
|
+
_this.domResized = !_this.domResized;
|
|
1105
|
+
}));
|
|
937
1106
|
};
|
|
938
1107
|
/**
|
|
939
1108
|
* @return {?}
|
|
@@ -942,17 +1111,7 @@
|
|
|
942
1111
|
* @return {?}
|
|
943
1112
|
*/
|
|
944
1113
|
function () {
|
|
945
|
-
var _this = this;
|
|
946
1114
|
this.initiateGridsterConfig();
|
|
947
|
-
this.widgetRearrangeSubject.subscribe((/**
|
|
948
|
-
* @param {?} event
|
|
949
|
-
* @return {?}
|
|
950
|
-
*/
|
|
951
|
-
function (event) {
|
|
952
|
-
console.log('in subscribe subject & value is');
|
|
953
|
-
console.log(event);
|
|
954
|
-
_this.rearrangeWidgets();
|
|
955
|
-
}));
|
|
956
1115
|
};
|
|
957
1116
|
/**
|
|
958
1117
|
* @param {?} changes
|
|
@@ -971,43 +1130,30 @@
|
|
|
971
1130
|
this.inititateEventBusSubscritions();
|
|
972
1131
|
}
|
|
973
1132
|
};
|
|
974
|
-
// public invokeResizeEvent() {
|
|
975
|
-
// this.widgetContainers.forEach(function(container,i){
|
|
976
|
-
// container.invokeWidgetResizedEvent();
|
|
977
|
-
// });
|
|
978
|
-
// }
|
|
979
1133
|
/**To set GridsterConfig */
|
|
980
|
-
// public invokeResizeEvent() {
|
|
981
|
-
// this.widgetContainers.forEach(function(container,i){
|
|
982
|
-
// container.invokeWidgetResizedEvent();
|
|
983
|
-
// });
|
|
984
|
-
// }
|
|
985
1134
|
/**
|
|
986
1135
|
* To set GridsterConfig
|
|
987
1136
|
* @return {?}
|
|
988
1137
|
*/
|
|
989
|
-
RADashboardArea.prototype.initiateGridsterConfig =
|
|
990
|
-
// public invokeResizeEvent() {
|
|
991
|
-
// this.widgetContainers.forEach(function(container,i){
|
|
992
|
-
// container.invokeWidgetResizedEvent();
|
|
993
|
-
// });
|
|
994
|
-
// }
|
|
995
|
-
/**
|
|
1138
|
+
RADashboardArea.prototype.initiateGridsterConfig = /**
|
|
996
1139
|
* To set GridsterConfig
|
|
997
1140
|
* @return {?}
|
|
998
1141
|
*/
|
|
999
1142
|
function () {
|
|
1000
|
-
|
|
1001
|
-
var areaContext = this;
|
|
1143
|
+
var _this = this;
|
|
1002
1144
|
/**To override default configuration values to the gridster control */
|
|
1003
|
-
this.options =
|
|
1145
|
+
this.options = this.responsiveService.GridsterConfig;
|
|
1004
1146
|
this.options.itemChangeCallback = (/**
|
|
1005
1147
|
* @param {?} item
|
|
1006
1148
|
* @return {?}
|
|
1007
1149
|
*/
|
|
1008
1150
|
function (item) {
|
|
1009
|
-
|
|
1010
|
-
|
|
1151
|
+
if (_this.responsiveService.IsDesktopView) {
|
|
1152
|
+
if (item.widgetInfo && item.widgetInfo.widgetInstanceId) {
|
|
1153
|
+
_this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
_this.setAreaHeight();
|
|
1011
1157
|
});
|
|
1012
1158
|
};
|
|
1013
1159
|
/** To initiate eventbus subsctiptions */
|
|
@@ -1057,6 +1203,18 @@
|
|
|
1057
1203
|
_this.addWidget(e);
|
|
1058
1204
|
}));
|
|
1059
1205
|
}));
|
|
1206
|
+
this.rearrangeWidgetClick = this.raDashboardEventBus.subscribe(RAEvent.RearrangeClicked).subscribe((/**
|
|
1207
|
+
* @param {?} e
|
|
1208
|
+
* @return {?}
|
|
1209
|
+
*/
|
|
1210
|
+
function (e) {
|
|
1211
|
+
_this.ngZone.run((/**
|
|
1212
|
+
* @return {?}
|
|
1213
|
+
*/
|
|
1214
|
+
function () {
|
|
1215
|
+
_this.rearrangeWidgets();
|
|
1216
|
+
}));
|
|
1217
|
+
}));
|
|
1060
1218
|
this.widgetLibraryDoneClick = this.raDashboardEventBus.subscribe(RAEvent.widgetLibraryDoneClick).subscribe((/**
|
|
1061
1219
|
* @param {?} widgetList
|
|
1062
1220
|
* @return {?}
|
|
@@ -1067,9 +1225,6 @@
|
|
|
1067
1225
|
*/
|
|
1068
1226
|
function () {
|
|
1069
1227
|
if (widgetList) {
|
|
1070
|
-
// widgetList.forEach(widgetInfo => {
|
|
1071
|
-
// this.addWidget(widgetInfo);
|
|
1072
|
-
// });
|
|
1073
1228
|
_this.addWidgetListToGridster(widgetList, 0);
|
|
1074
1229
|
}
|
|
1075
1230
|
}));
|
|
@@ -1133,8 +1288,8 @@
|
|
|
1133
1288
|
this.widgetDeleteEvent.unsubscribe();
|
|
1134
1289
|
if (this.widgetLibraryDoneClick)
|
|
1135
1290
|
this.widgetLibraryDoneClick.unsubscribe();
|
|
1136
|
-
if (this.
|
|
1137
|
-
this.
|
|
1291
|
+
if (this.rearrangeWidgetClick)
|
|
1292
|
+
this.rearrangeWidgetClick.unsubscribe();
|
|
1138
1293
|
};
|
|
1139
1294
|
/**To update position/dimention of all widgets in the area */
|
|
1140
1295
|
/**
|
|
@@ -1154,6 +1309,69 @@
|
|
|
1154
1309
|
}));
|
|
1155
1310
|
return true;
|
|
1156
1311
|
};
|
|
1312
|
+
/**To update widget dimensions */
|
|
1313
|
+
/**
|
|
1314
|
+
* To update widget dimensions
|
|
1315
|
+
* @param {?} widgetInstanceId
|
|
1316
|
+
* @return {?}
|
|
1317
|
+
*/
|
|
1318
|
+
RADashboardArea.prototype.updateWidgetPosition = /**
|
|
1319
|
+
* To update widget dimensions
|
|
1320
|
+
* @param {?} widgetInstanceId
|
|
1321
|
+
* @return {?}
|
|
1322
|
+
*/
|
|
1323
|
+
function (widgetInstanceId) {
|
|
1324
|
+
/** @type {?} */
|
|
1325
|
+
var widgetFilteredList = [];
|
|
1326
|
+
/** @type {?} */
|
|
1327
|
+
var widget = this.widgetList.filter((/**
|
|
1328
|
+
* @param {?} filtered
|
|
1329
|
+
* @return {?}
|
|
1330
|
+
*/
|
|
1331
|
+
function (filtered) { return filtered.widgetInfo && filtered.widgetInfo.widgetInstanceId == widgetInstanceId; }));
|
|
1332
|
+
if (widget && widget.length > 0) {
|
|
1333
|
+
widgetFilteredList.push(widget[0]);
|
|
1334
|
+
/** @type {?} */
|
|
1335
|
+
var widgetList = this.mapGridsterListToObject(widgetFilteredList);
|
|
1336
|
+
this.dashboardService.updateWidgets(this.formatWidgetDataForPositionDetails(widgetList), this.appConfig).subscribe((/**
|
|
1337
|
+
* @param {?} widgets
|
|
1338
|
+
* @return {?}
|
|
1339
|
+
*/
|
|
1340
|
+
function (widgets) {
|
|
1341
|
+
}));
|
|
1342
|
+
}
|
|
1343
|
+
return true;
|
|
1344
|
+
};
|
|
1345
|
+
/**To restrict request payload to be of min size (position & size details) */
|
|
1346
|
+
/**
|
|
1347
|
+
* To restrict request payload to be of min size (position & size details)
|
|
1348
|
+
* @param {?} widgetItemList
|
|
1349
|
+
* @return {?}
|
|
1350
|
+
*/
|
|
1351
|
+
RADashboardArea.prototype.formatWidgetDataForPositionDetails = /**
|
|
1352
|
+
* To restrict request payload to be of min size (position & size details)
|
|
1353
|
+
* @param {?} widgetItemList
|
|
1354
|
+
* @return {?}
|
|
1355
|
+
*/
|
|
1356
|
+
function (widgetItemList) {
|
|
1357
|
+
/** @type {?} */
|
|
1358
|
+
var itemList = [];
|
|
1359
|
+
widgetItemList.forEach((/**
|
|
1360
|
+
* @param {?} widgetItem
|
|
1361
|
+
* @return {?}
|
|
1362
|
+
*/
|
|
1363
|
+
function (widgetItem) {
|
|
1364
|
+
/** @type {?} */
|
|
1365
|
+
var item = (/** @type {?} */ ({}));
|
|
1366
|
+
item.widgetInstanceId = widgetItem.widgetInstanceId;
|
|
1367
|
+
item.position_x = widgetItem.position_x;
|
|
1368
|
+
item.position_y = widgetItem.position_y;
|
|
1369
|
+
item.width = widgetItem.width;
|
|
1370
|
+
item.height = widgetItem.height;
|
|
1371
|
+
itemList.push(item);
|
|
1372
|
+
}));
|
|
1373
|
+
return itemList;
|
|
1374
|
+
};
|
|
1157
1375
|
/** To retrieve widgets based on userDashboardid and area name */
|
|
1158
1376
|
/**
|
|
1159
1377
|
* To retrieve widgets based on userDashboardid and area name
|
|
@@ -1170,21 +1388,36 @@
|
|
|
1170
1388
|
function (userDashboarId, areaKey) {
|
|
1171
1389
|
var _this = this;
|
|
1172
1390
|
/** @type {?} */
|
|
1173
|
-
var areaContext = this;
|
|
1174
|
-
/** @type {?} */
|
|
1175
1391
|
var widgetInfo = (/** @type {?} */ ({
|
|
1176
1392
|
dashboardId: userDashboarId.toString(),
|
|
1177
1393
|
dashboardAreaKey: areaKey
|
|
1178
1394
|
}));
|
|
1179
|
-
|
|
1395
|
+
this.widgetList = [];
|
|
1180
1396
|
this.dashboardService.getWidgetsByDashboardArea(widgetInfo, this.appConfig).subscribe((/**
|
|
1181
1397
|
* @param {?} widgets
|
|
1182
1398
|
* @return {?}
|
|
1183
1399
|
*/
|
|
1184
1400
|
function (widgets) {
|
|
1401
|
+
//sorting the widgets y, x
|
|
1402
|
+
widgets = widgets.sort((/**
|
|
1403
|
+
* @param {?} a
|
|
1404
|
+
* @param {?} b
|
|
1405
|
+
* @return {?}
|
|
1406
|
+
*/
|
|
1407
|
+
function (a, b) {
|
|
1408
|
+
if (a['position_y'] > b['position_y'])
|
|
1409
|
+
return 1;
|
|
1410
|
+
if (a['position_y'] < b['position_y'])
|
|
1411
|
+
return -1;
|
|
1412
|
+
if (a['position_x'] > b['position_x'])
|
|
1413
|
+
return 1;
|
|
1414
|
+
if (a['position_x'] < b['position_x'])
|
|
1415
|
+
return -1;
|
|
1416
|
+
}));
|
|
1417
|
+
_this.userWidgets = widgets;
|
|
1185
1418
|
if (widgets && widgets.length > 0) {
|
|
1186
|
-
|
|
1187
|
-
|
|
1419
|
+
_this.widgetList = _this.mapObjectListToGridsterItemList(widgets);
|
|
1420
|
+
_this.setAreaHeight();
|
|
1188
1421
|
}
|
|
1189
1422
|
}));
|
|
1190
1423
|
};
|
|
@@ -1242,7 +1475,6 @@
|
|
|
1242
1475
|
areaHeight = 600;
|
|
1243
1476
|
}
|
|
1244
1477
|
this.gridheight = areaHeight;
|
|
1245
|
-
console.log('area height adjusted1');
|
|
1246
1478
|
};
|
|
1247
1479
|
/** To remove a widget instance from dashboard and to save info in database */
|
|
1248
1480
|
/**
|
|
@@ -1285,7 +1517,6 @@
|
|
|
1285
1517
|
* @return {?}
|
|
1286
1518
|
*/
|
|
1287
1519
|
function () {
|
|
1288
|
-
console.log('in rearrange widgets methd');
|
|
1289
1520
|
this.options.compactType = 'compactUp&Left';
|
|
1290
1521
|
this.options.api.optionsChanged();
|
|
1291
1522
|
this.options.compactType = 'none';
|
|
@@ -1308,20 +1539,11 @@
|
|
|
1308
1539
|
*/
|
|
1309
1540
|
function (data) {
|
|
1310
1541
|
var _this = this;
|
|
1311
|
-
/** @type {?} */
|
|
1312
|
-
var widgetid = data.widgetId;
|
|
1313
1542
|
data.height = this.widgetHeight;
|
|
1314
1543
|
data.width = this.widgetWidth;
|
|
1315
1544
|
data.position_x = 0;
|
|
1316
1545
|
data.position_y = 0;
|
|
1317
|
-
/** @type {?} */
|
|
1318
|
-
var gridsterItem = this.mapObjectsToGridsterItem(data);
|
|
1319
1546
|
/** to find the available position in gridster, temp commenting the code-returning higher y value than normal */
|
|
1320
|
-
// if (this.options.api) {
|
|
1321
|
-
// gridsterItem = this.options.api.getFirstPossiblePosition(gridsterItem);
|
|
1322
|
-
// }
|
|
1323
|
-
// data.position_x = gridsterItem.x;
|
|
1324
|
-
// data.position_y = gridsterItem.y;
|
|
1325
1547
|
data.dashboardAreaKey = this.areaKey;
|
|
1326
1548
|
data.dashboardId = this.userDashboardId;
|
|
1327
1549
|
this.ngxService.start();
|
|
@@ -1330,7 +1552,8 @@
|
|
|
1330
1552
|
* @return {?}
|
|
1331
1553
|
*/
|
|
1332
1554
|
function (widget) {
|
|
1333
|
-
|
|
1555
|
+
/** @type {?} */
|
|
1556
|
+
var gridsterItem = _this.responsiveService.getGridsterItem(widget);
|
|
1334
1557
|
_this.widgetList.push(gridsterItem);
|
|
1335
1558
|
_this.setAreaHeight();
|
|
1336
1559
|
if (_this.options.api) {
|
|
@@ -1341,13 +1564,18 @@
|
|
|
1341
1564
|
_this.gridcellHeight = curRowHeight;
|
|
1342
1565
|
}
|
|
1343
1566
|
}
|
|
1344
|
-
/**
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1567
|
+
/** @type {?} */
|
|
1568
|
+
var widgetInstanceId = 0;
|
|
1569
|
+
if (widget && widget.widgetInstanceId) {
|
|
1570
|
+
widgetInstanceId = widget.widgetInstanceId;
|
|
1571
|
+
/**To save added widget position in db */
|
|
1572
|
+
setTimeout((/**
|
|
1573
|
+
* @return {?}
|
|
1574
|
+
*/
|
|
1575
|
+
function () {
|
|
1576
|
+
_this.updateWidgetPosition(widgetInstanceId);
|
|
1577
|
+
}), 1000);
|
|
1578
|
+
}
|
|
1351
1579
|
_this.raDashboardEventBus.publish(RAEvent.WidgetAdded, widget);
|
|
1352
1580
|
}));
|
|
1353
1581
|
};
|
|
@@ -1363,39 +1591,13 @@
|
|
|
1363
1591
|
* @return {?}
|
|
1364
1592
|
*/
|
|
1365
1593
|
function (data) {
|
|
1594
|
+
data.position_x = 0;
|
|
1595
|
+
data.position_y = 0;
|
|
1366
1596
|
/** @type {?} */
|
|
1367
|
-
var gridsterItem = this.
|
|
1368
|
-
if (this.options.api) {
|
|
1369
|
-
gridsterItem = this.options.api.getFirstPossiblePosition(gridsterItem);
|
|
1370
|
-
}
|
|
1371
|
-
data.position_x = gridsterItem.x;
|
|
1372
|
-
data.position_y = gridsterItem.y;
|
|
1373
|
-
gridsterItem = this.mapObjectsToGridsterItem(data);
|
|
1597
|
+
var gridsterItem = this.responsiveService.getGridsterItem(data);
|
|
1374
1598
|
this.widgetList.push(gridsterItem);
|
|
1375
1599
|
this.setAreaHeight();
|
|
1376
1600
|
};
|
|
1377
|
-
/**To map IwidgetInfo object to gridsterItem */
|
|
1378
|
-
/**
|
|
1379
|
-
* To map IwidgetInfo object to gridsterItem
|
|
1380
|
-
* @param {?} widget
|
|
1381
|
-
* @return {?}
|
|
1382
|
-
*/
|
|
1383
|
-
RADashboardArea.prototype.mapObjectsToGridsterItem = /**
|
|
1384
|
-
* To map IwidgetInfo object to gridsterItem
|
|
1385
|
-
* @param {?} widget
|
|
1386
|
-
* @return {?}
|
|
1387
|
-
*/
|
|
1388
|
-
function (widget) {
|
|
1389
|
-
/** @type {?} */
|
|
1390
|
-
var gridsterItem = (/** @type {?} */ ({
|
|
1391
|
-
cols: widget.width,
|
|
1392
|
-
rows: widget.height,
|
|
1393
|
-
x: widget.position_x,
|
|
1394
|
-
y: widget.position_y,
|
|
1395
|
-
widgetInfo: widget
|
|
1396
|
-
}));
|
|
1397
|
-
return gridsterItem;
|
|
1398
|
-
};
|
|
1399
1601
|
/**
|
|
1400
1602
|
* @param {?} widgetList
|
|
1401
1603
|
* @return {?}
|
|
@@ -1413,7 +1615,7 @@
|
|
|
1413
1615
|
* @return {?}
|
|
1414
1616
|
*/
|
|
1415
1617
|
function (widget) {
|
|
1416
|
-
widgetArray.push(_this.
|
|
1618
|
+
widgetArray.push(_this.responsiveService.getGridsterItem(widget));
|
|
1417
1619
|
}));
|
|
1418
1620
|
return widgetArray;
|
|
1419
1621
|
};
|
|
@@ -1470,7 +1672,8 @@
|
|
|
1470
1672
|
{ type: core.NgZone },
|
|
1471
1673
|
{ type: ngxUiLoader.NgxUiLoaderService },
|
|
1472
1674
|
{ type: raCommon.RATranslateService },
|
|
1473
|
-
{ type: angularNotifier.NotifierService }
|
|
1675
|
+
{ type: angularNotifier.NotifierService },
|
|
1676
|
+
{ type: RADashboardResponsiveService }
|
|
1474
1677
|
]; };
|
|
1475
1678
|
RADashboardArea.propDecorators = {
|
|
1476
1679
|
userDashboardId: [{ type: core.Input, args: ['user-dashboard-id',] }],
|
|
@@ -1480,7 +1683,6 @@
|
|
|
1480
1683
|
widgetHeight: [{ type: core.Input, args: ['widget-height',] }],
|
|
1481
1684
|
widgetWidth: [{ type: core.Input, args: ['widget-width',] }],
|
|
1482
1685
|
appConfig: [{ type: core.Input, args: ['app-config',] }],
|
|
1483
|
-
widgetRearrangeSubject: [{ type: core.Input }],
|
|
1484
1686
|
gridWrapper: [{ type: core.ViewChild, args: ['gridWrapper', { static: false },] }],
|
|
1485
1687
|
onResize: [{ type: core.HostListener, args: ['window:resize', ['$event'],] }]
|
|
1486
1688
|
};
|
|
@@ -1495,11 +1697,21 @@
|
|
|
1495
1697
|
RADashboardArea.prototype.gridheight;
|
|
1496
1698
|
/** @type {?} */
|
|
1497
1699
|
RADashboardArea.prototype.gridcellHeight;
|
|
1700
|
+
/**
|
|
1701
|
+
* @type {?}
|
|
1702
|
+
* @private
|
|
1703
|
+
*/
|
|
1704
|
+
RADashboardArea.prototype.userWidgets;
|
|
1498
1705
|
/**
|
|
1499
1706
|
* @type {?}
|
|
1500
1707
|
* @private
|
|
1501
1708
|
*/
|
|
1502
1709
|
RADashboardArea.prototype.conifgAddClick;
|
|
1710
|
+
/**
|
|
1711
|
+
* @type {?}
|
|
1712
|
+
* @private
|
|
1713
|
+
*/
|
|
1714
|
+
RADashboardArea.prototype.rearrangeWidgetClick;
|
|
1503
1715
|
/**
|
|
1504
1716
|
* @type {?}
|
|
1505
1717
|
* @private
|
|
@@ -1537,8 +1749,6 @@
|
|
|
1537
1749
|
/** @type {?} */
|
|
1538
1750
|
RADashboardArea.prototype.appConfig;
|
|
1539
1751
|
/** @type {?} */
|
|
1540
|
-
RADashboardArea.prototype.widgetRearrangeSubject;
|
|
1541
|
-
/** @type {?} */
|
|
1542
1752
|
RADashboardArea.prototype.gridWrapper;
|
|
1543
1753
|
/**
|
|
1544
1754
|
* @type {?}
|
|
@@ -1565,6 +1775,11 @@
|
|
|
1565
1775
|
* @private
|
|
1566
1776
|
*/
|
|
1567
1777
|
RADashboardArea.prototype.notifier;
|
|
1778
|
+
/**
|
|
1779
|
+
* @type {?}
|
|
1780
|
+
* @private
|
|
1781
|
+
*/
|
|
1782
|
+
RADashboardArea.prototype.responsiveService;
|
|
1568
1783
|
}
|
|
1569
1784
|
|
|
1570
1785
|
/**
|
|
@@ -7620,7 +7835,6 @@
|
|
|
7620
7835
|
function RaBaseDashboardTemplate(ngZone) {
|
|
7621
7836
|
var _this = this;
|
|
7622
7837
|
this.ngZone = ngZone;
|
|
7623
|
-
this.widgetRearrangeSubject = new rxjs.Subject();
|
|
7624
7838
|
this.initialize = (/**
|
|
7625
7839
|
* @param {?} eventBus
|
|
7626
7840
|
* @param {?} userDashboardId
|
|
@@ -7638,17 +7852,6 @@
|
|
|
7638
7852
|
}));
|
|
7639
7853
|
_this.init();
|
|
7640
7854
|
});
|
|
7641
|
-
this.rearrangeWidgets = (/**
|
|
7642
|
-
* @return {?}
|
|
7643
|
-
*/
|
|
7644
|
-
function () {
|
|
7645
|
-
_this.ngZone.run((/**
|
|
7646
|
-
* @return {?}
|
|
7647
|
-
*/
|
|
7648
|
-
function () {
|
|
7649
|
-
_this.widgetRearrangeSubject.next(true);
|
|
7650
|
-
}));
|
|
7651
|
-
});
|
|
7652
7855
|
}
|
|
7653
7856
|
/**
|
|
7654
7857
|
* @return {?}
|
|
@@ -7664,8 +7867,7 @@
|
|
|
7664
7867
|
RaBaseDashboardTemplate.propDecorators = {
|
|
7665
7868
|
dashboardId: [{ type: core.Input, args: ['dashboard-id',] }],
|
|
7666
7869
|
globalFilter: [{ type: core.Input, args: ['global-filter',] }],
|
|
7667
|
-
initialize: [{ type: core.Input }]
|
|
7668
|
-
rearrangeWidgets: [{ type: core.Input }]
|
|
7870
|
+
initialize: [{ type: core.Input }]
|
|
7669
7871
|
};
|
|
7670
7872
|
return RaBaseDashboardTemplate;
|
|
7671
7873
|
}());
|
|
@@ -7677,15 +7879,11 @@
|
|
|
7677
7879
|
/** @type {?} */
|
|
7678
7880
|
RaBaseDashboardTemplate.prototype.appConfig;
|
|
7679
7881
|
/** @type {?} */
|
|
7680
|
-
RaBaseDashboardTemplate.prototype.widgetRearrangeSubject;
|
|
7681
|
-
/** @type {?} */
|
|
7682
7882
|
RaBaseDashboardTemplate.prototype.dashboardId;
|
|
7683
7883
|
/** @type {?} */
|
|
7684
7884
|
RaBaseDashboardTemplate.prototype.globalFilter;
|
|
7685
7885
|
/** @type {?} */
|
|
7686
7886
|
RaBaseDashboardTemplate.prototype.initialize;
|
|
7687
|
-
/** @type {?} */
|
|
7688
|
-
RaBaseDashboardTemplate.prototype.rearrangeWidgets;
|
|
7689
7887
|
/**
|
|
7690
7888
|
* @type {?}
|
|
7691
7889
|
* @private
|
|
@@ -7795,6 +7993,7 @@
|
|
|
7795
7993
|
exports.DashboardFrameworkModule = DashboardFrameworkModule;
|
|
7796
7994
|
exports.RADashboardArea = RADashboardArea;
|
|
7797
7995
|
exports.RADashboardEventBus = RADashboardEventBus;
|
|
7996
|
+
exports.RADashboardResponsiveService = RADashboardResponsiveService;
|
|
7798
7997
|
exports.RAEvent = RAEvent;
|
|
7799
7998
|
exports.RAEventKey = RAEventKey;
|
|
7800
7999
|
exports.RAWidgetContainer = RAWidgetContainer;
|