@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
|
@@ -368,6 +368,8 @@ var RAEvent = {
|
|
|
368
368
|
ConfigAddClick: "configAddClick",
|
|
369
369
|
/** triggers when a user click on the save button in widget configuration window */
|
|
370
370
|
ConfigChanged: "configChanged",
|
|
371
|
+
/**To rearrange widgets in a dashboard */
|
|
372
|
+
RearrangeClicked: "rearrangeClicked",
|
|
371
373
|
/**dashboard customize button click */
|
|
372
374
|
DashboardCustomizeClick: "dashboardCustomizeClick",
|
|
373
375
|
/**triggers when user clicks on the dashboard change icon in header section */
|
|
@@ -685,18 +687,182 @@ var GridsterConfigDefaultSettings = {
|
|
|
685
687
|
//itemInitCallback: (item) => this.itemInitCallback(item)
|
|
686
688
|
};
|
|
687
689
|
|
|
690
|
+
/**
|
|
691
|
+
* @fileoverview added by tsickle
|
|
692
|
+
* Generated from: lib/ra.dashboard.responsive.service.ts
|
|
693
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
694
|
+
*/
|
|
695
|
+
/** @type {?} */
|
|
696
|
+
var DesktopViewStart = 1367;
|
|
697
|
+
var RADashboardResponsiveService = /** @class */ (function () {
|
|
698
|
+
function RADashboardResponsiveService() {
|
|
699
|
+
var _this = this;
|
|
700
|
+
this.resInfo = [
|
|
701
|
+
{ 'start': 0, 'end': 767, 'minCols': 1, 'maxCols': 1 },
|
|
702
|
+
{ 'start': 768, 'end': 1024, 'minCols': 1, 'maxCols': 2 },
|
|
703
|
+
{ 'start': 1025, 'end': DesktopViewStart - 1, 'minCols': 2, 'maxCols': 6 },
|
|
704
|
+
{ 'start': DesktopViewStart, 'end': 9999999999, 'minCols': 2, 'maxCols': 10 }
|
|
705
|
+
];
|
|
706
|
+
this.setScreenWidth();
|
|
707
|
+
window.addEventListener('resize', (/**
|
|
708
|
+
* @return {?}
|
|
709
|
+
*/
|
|
710
|
+
function () {
|
|
711
|
+
_this.setScreenWidth();
|
|
712
|
+
}));
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* @private
|
|
716
|
+
* @return {?}
|
|
717
|
+
*/
|
|
718
|
+
RADashboardResponsiveService.prototype.setScreenWidth = /**
|
|
719
|
+
* @private
|
|
720
|
+
* @return {?}
|
|
721
|
+
*/
|
|
722
|
+
function () {
|
|
723
|
+
var _this = this;
|
|
724
|
+
this.screenWidth = screen.width;
|
|
725
|
+
this.currentResInfo = this.resInfo.filter((/**
|
|
726
|
+
* @param {?} item
|
|
727
|
+
* @return {?}
|
|
728
|
+
*/
|
|
729
|
+
function (item) {
|
|
730
|
+
return item.end >= _this.screenWidth && item.start <= _this.screenWidth;
|
|
731
|
+
}))[0];
|
|
732
|
+
};
|
|
733
|
+
Object.defineProperty(RADashboardResponsiveService.prototype, "IsDesktopView", {
|
|
734
|
+
get: /**
|
|
735
|
+
* @return {?}
|
|
736
|
+
*/
|
|
737
|
+
function () {
|
|
738
|
+
return this.screenWidth >= DesktopViewStart;
|
|
739
|
+
},
|
|
740
|
+
enumerable: true,
|
|
741
|
+
configurable: true
|
|
742
|
+
});
|
|
743
|
+
Object.defineProperty(RADashboardResponsiveService.prototype, "GridsterConfig", {
|
|
744
|
+
get: /**
|
|
745
|
+
* @return {?}
|
|
746
|
+
*/
|
|
747
|
+
function () {
|
|
748
|
+
/** @type {?} */
|
|
749
|
+
var config = GridsterConfigDefaultSettings;
|
|
750
|
+
config.minCols = this.currentResInfo.maxCols;
|
|
751
|
+
config.maxCols = this.currentResInfo.maxCols;
|
|
752
|
+
config.minRows = this.currentResInfo.minCols;
|
|
753
|
+
config.maxItemCols = this.currentResInfo.maxCols;
|
|
754
|
+
config.minItemCols = this.currentResInfo.minCols;
|
|
755
|
+
config.minItemRows = this.currentResInfo.minCols;
|
|
756
|
+
config.minItemArea = this.currentResInfo.minCols * this.currentResInfo.minCols;
|
|
757
|
+
config.defaultItemCols = this.currentResInfo.minCols;
|
|
758
|
+
config.defaultItemRows = this.currentResInfo.minCols;
|
|
759
|
+
if (!this.IsDesktopView) {
|
|
760
|
+
config.resizable.enabled = false;
|
|
761
|
+
config.swap = false;
|
|
762
|
+
config.draggable.enabled = false;
|
|
763
|
+
}
|
|
764
|
+
return config;
|
|
765
|
+
},
|
|
766
|
+
enumerable: true,
|
|
767
|
+
configurable: true
|
|
768
|
+
});
|
|
769
|
+
/**To map IwidgetInfo object to gridsterItem */
|
|
770
|
+
/**
|
|
771
|
+
* To map IwidgetInfo object to gridsterItem
|
|
772
|
+
* @param {?} widget
|
|
773
|
+
* @return {?}
|
|
774
|
+
*/
|
|
775
|
+
RADashboardResponsiveService.prototype.getGridsterItem = /**
|
|
776
|
+
* To map IwidgetInfo object to gridsterItem
|
|
777
|
+
* @param {?} widget
|
|
778
|
+
* @return {?}
|
|
779
|
+
*/
|
|
780
|
+
function (widget) {
|
|
781
|
+
/** @type {?} */
|
|
782
|
+
var gridsterItem = (/** @type {?} */ ({
|
|
783
|
+
cols: this.getWidth(widget.width),
|
|
784
|
+
rows: this.getHeight(widget.height),
|
|
785
|
+
x: this.IsDesktopView ? widget.position_x : 0,
|
|
786
|
+
y: this.IsDesktopView ? widget.position_y : 0,
|
|
787
|
+
widgetInfo: widget
|
|
788
|
+
}));
|
|
789
|
+
return gridsterItem;
|
|
790
|
+
};
|
|
791
|
+
/**
|
|
792
|
+
* @private
|
|
793
|
+
* @param {?} width
|
|
794
|
+
* @return {?}
|
|
795
|
+
*/
|
|
796
|
+
RADashboardResponsiveService.prototype.getWidth = /**
|
|
797
|
+
* @private
|
|
798
|
+
* @param {?} width
|
|
799
|
+
* @return {?}
|
|
800
|
+
*/
|
|
801
|
+
function (width) {
|
|
802
|
+
if (!this.IsDesktopView) {
|
|
803
|
+
width = Math.floor(width / 10 * this.currentResInfo.maxCols);
|
|
804
|
+
if (width < this.currentResInfo.minCols)
|
|
805
|
+
width = this.currentResInfo.minCols;
|
|
806
|
+
}
|
|
807
|
+
return width;
|
|
808
|
+
};
|
|
809
|
+
/**
|
|
810
|
+
* @private
|
|
811
|
+
* @param {?} height
|
|
812
|
+
* @return {?}
|
|
813
|
+
*/
|
|
814
|
+
RADashboardResponsiveService.prototype.getHeight = /**
|
|
815
|
+
* @private
|
|
816
|
+
* @param {?} height
|
|
817
|
+
* @return {?}
|
|
818
|
+
*/
|
|
819
|
+
function (height) {
|
|
820
|
+
if (!this.IsDesktopView) {
|
|
821
|
+
height = Math.floor(height / 10 * this.currentResInfo.maxCols);
|
|
822
|
+
if (height < this.currentResInfo.minCols)
|
|
823
|
+
height = this.currentResInfo.minCols;
|
|
824
|
+
}
|
|
825
|
+
return height;
|
|
826
|
+
};
|
|
827
|
+
RADashboardResponsiveService.decorators = [
|
|
828
|
+
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
829
|
+
];
|
|
830
|
+
/** @nocollapse */
|
|
831
|
+
RADashboardResponsiveService.ctorParameters = function () { return []; };
|
|
832
|
+
/** @nocollapse */ RADashboardResponsiveService.ngInjectableDef = ɵɵdefineInjectable({ factory: function RADashboardResponsiveService_Factory() { return new RADashboardResponsiveService(); }, token: RADashboardResponsiveService, providedIn: "root" });
|
|
833
|
+
return RADashboardResponsiveService;
|
|
834
|
+
}());
|
|
835
|
+
if (false) {
|
|
836
|
+
/**
|
|
837
|
+
* @type {?}
|
|
838
|
+
* @private
|
|
839
|
+
*/
|
|
840
|
+
RADashboardResponsiveService.prototype.screenWidth;
|
|
841
|
+
/**
|
|
842
|
+
* @type {?}
|
|
843
|
+
* @private
|
|
844
|
+
*/
|
|
845
|
+
RADashboardResponsiveService.prototype.resInfo;
|
|
846
|
+
/**
|
|
847
|
+
* @type {?}
|
|
848
|
+
* @private
|
|
849
|
+
*/
|
|
850
|
+
RADashboardResponsiveService.prototype.currentResInfo;
|
|
851
|
+
}
|
|
852
|
+
|
|
688
853
|
/**
|
|
689
854
|
* @fileoverview added by tsickle
|
|
690
855
|
* Generated from: lib/ra-dashboard-area/ra.dashboard.area.ts
|
|
691
856
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
692
857
|
*/
|
|
693
858
|
var RADashboardArea = /** @class */ (function () {
|
|
694
|
-
function RADashboardArea(dashboardService, ngZone, ngxService, translateService, notifier) {
|
|
859
|
+
function RADashboardArea(dashboardService, ngZone, ngxService, translateService, notifier, responsiveService) {
|
|
695
860
|
this.dashboardService = dashboardService;
|
|
696
861
|
this.ngZone = ngZone;
|
|
697
862
|
this.ngxService = ngxService;
|
|
698
863
|
this.translateService = translateService;
|
|
699
864
|
this.notifier = notifier;
|
|
865
|
+
this.responsiveService = responsiveService;
|
|
700
866
|
this.widgetList = Array();
|
|
701
867
|
this.gridheight = 300;
|
|
702
868
|
this.gridcellHeight = 0;
|
|
@@ -714,15 +880,23 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
714
880
|
* @return {?}
|
|
715
881
|
*/
|
|
716
882
|
function (event) {
|
|
717
|
-
|
|
718
|
-
|
|
883
|
+
var _this = this;
|
|
884
|
+
this.widgetList = [];
|
|
719
885
|
setTimeout((/**
|
|
720
886
|
* @return {?}
|
|
721
887
|
*/
|
|
722
888
|
function () {
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
889
|
+
_this.initiateGridsterConfig();
|
|
890
|
+
_this.options.api.optionsChanged();
|
|
891
|
+
if (_this.userWidgets) {
|
|
892
|
+
_this.widgetList = _this.mapObjectListToGridsterItemList(_this.userWidgets);
|
|
893
|
+
_this.setAreaHeight();
|
|
894
|
+
}
|
|
895
|
+
else {
|
|
896
|
+
_this.loadWidgets(_this.userDashboardId, _this.areaKey);
|
|
897
|
+
}
|
|
898
|
+
_this.domResized = !_this.domResized;
|
|
899
|
+
}));
|
|
726
900
|
};
|
|
727
901
|
/**
|
|
728
902
|
* @return {?}
|
|
@@ -731,17 +905,7 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
731
905
|
* @return {?}
|
|
732
906
|
*/
|
|
733
907
|
function () {
|
|
734
|
-
var _this = this;
|
|
735
908
|
this.initiateGridsterConfig();
|
|
736
|
-
this.widgetRearrangeSubject.subscribe((/**
|
|
737
|
-
* @param {?} event
|
|
738
|
-
* @return {?}
|
|
739
|
-
*/
|
|
740
|
-
function (event) {
|
|
741
|
-
console.log('in subscribe subject & value is');
|
|
742
|
-
console.log(event);
|
|
743
|
-
_this.rearrangeWidgets();
|
|
744
|
-
}));
|
|
745
909
|
};
|
|
746
910
|
/**
|
|
747
911
|
* @param {?} changes
|
|
@@ -760,43 +924,30 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
760
924
|
this.inititateEventBusSubscritions();
|
|
761
925
|
}
|
|
762
926
|
};
|
|
763
|
-
// public invokeResizeEvent() {
|
|
764
|
-
// this.widgetContainers.forEach(function(container,i){
|
|
765
|
-
// container.invokeWidgetResizedEvent();
|
|
766
|
-
// });
|
|
767
|
-
// }
|
|
768
927
|
/**To set GridsterConfig */
|
|
769
|
-
// public invokeResizeEvent() {
|
|
770
|
-
// this.widgetContainers.forEach(function(container,i){
|
|
771
|
-
// container.invokeWidgetResizedEvent();
|
|
772
|
-
// });
|
|
773
|
-
// }
|
|
774
928
|
/**
|
|
775
929
|
* To set GridsterConfig
|
|
776
930
|
* @return {?}
|
|
777
931
|
*/
|
|
778
|
-
RADashboardArea.prototype.initiateGridsterConfig =
|
|
779
|
-
// public invokeResizeEvent() {
|
|
780
|
-
// this.widgetContainers.forEach(function(container,i){
|
|
781
|
-
// container.invokeWidgetResizedEvent();
|
|
782
|
-
// });
|
|
783
|
-
// }
|
|
784
|
-
/**
|
|
932
|
+
RADashboardArea.prototype.initiateGridsterConfig = /**
|
|
785
933
|
* To set GridsterConfig
|
|
786
934
|
* @return {?}
|
|
787
935
|
*/
|
|
788
936
|
function () {
|
|
789
|
-
|
|
790
|
-
var areaContext = this;
|
|
937
|
+
var _this = this;
|
|
791
938
|
/**To override default configuration values to the gridster control */
|
|
792
|
-
this.options =
|
|
939
|
+
this.options = this.responsiveService.GridsterConfig;
|
|
793
940
|
this.options.itemChangeCallback = (/**
|
|
794
941
|
* @param {?} item
|
|
795
942
|
* @return {?}
|
|
796
943
|
*/
|
|
797
944
|
function (item) {
|
|
798
|
-
|
|
799
|
-
|
|
945
|
+
if (_this.responsiveService.IsDesktopView) {
|
|
946
|
+
if (item.widgetInfo && item.widgetInfo.widgetInstanceId) {
|
|
947
|
+
_this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
_this.setAreaHeight();
|
|
800
951
|
});
|
|
801
952
|
};
|
|
802
953
|
/** To initiate eventbus subsctiptions */
|
|
@@ -846,6 +997,18 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
846
997
|
_this.addWidget(e);
|
|
847
998
|
}));
|
|
848
999
|
}));
|
|
1000
|
+
this.rearrangeWidgetClick = this.raDashboardEventBus.subscribe(RAEvent.RearrangeClicked).subscribe((/**
|
|
1001
|
+
* @param {?} e
|
|
1002
|
+
* @return {?}
|
|
1003
|
+
*/
|
|
1004
|
+
function (e) {
|
|
1005
|
+
_this.ngZone.run((/**
|
|
1006
|
+
* @return {?}
|
|
1007
|
+
*/
|
|
1008
|
+
function () {
|
|
1009
|
+
_this.rearrangeWidgets();
|
|
1010
|
+
}));
|
|
1011
|
+
}));
|
|
849
1012
|
this.widgetLibraryDoneClick = this.raDashboardEventBus.subscribe(RAEvent.widgetLibraryDoneClick).subscribe((/**
|
|
850
1013
|
* @param {?} widgetList
|
|
851
1014
|
* @return {?}
|
|
@@ -856,9 +1019,6 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
856
1019
|
*/
|
|
857
1020
|
function () {
|
|
858
1021
|
if (widgetList) {
|
|
859
|
-
// widgetList.forEach(widgetInfo => {
|
|
860
|
-
// this.addWidget(widgetInfo);
|
|
861
|
-
// });
|
|
862
1022
|
_this.addWidgetListToGridster(widgetList, 0);
|
|
863
1023
|
}
|
|
864
1024
|
}));
|
|
@@ -922,8 +1082,8 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
922
1082
|
this.widgetDeleteEvent.unsubscribe();
|
|
923
1083
|
if (this.widgetLibraryDoneClick)
|
|
924
1084
|
this.widgetLibraryDoneClick.unsubscribe();
|
|
925
|
-
if (this.
|
|
926
|
-
this.
|
|
1085
|
+
if (this.rearrangeWidgetClick)
|
|
1086
|
+
this.rearrangeWidgetClick.unsubscribe();
|
|
927
1087
|
};
|
|
928
1088
|
/**To update position/dimention of all widgets in the area */
|
|
929
1089
|
/**
|
|
@@ -943,6 +1103,69 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
943
1103
|
}));
|
|
944
1104
|
return true;
|
|
945
1105
|
};
|
|
1106
|
+
/**To update widget dimensions */
|
|
1107
|
+
/**
|
|
1108
|
+
* To update widget dimensions
|
|
1109
|
+
* @param {?} widgetInstanceId
|
|
1110
|
+
* @return {?}
|
|
1111
|
+
*/
|
|
1112
|
+
RADashboardArea.prototype.updateWidgetPosition = /**
|
|
1113
|
+
* To update widget dimensions
|
|
1114
|
+
* @param {?} widgetInstanceId
|
|
1115
|
+
* @return {?}
|
|
1116
|
+
*/
|
|
1117
|
+
function (widgetInstanceId) {
|
|
1118
|
+
/** @type {?} */
|
|
1119
|
+
var widgetFilteredList = [];
|
|
1120
|
+
/** @type {?} */
|
|
1121
|
+
var widget = this.widgetList.filter((/**
|
|
1122
|
+
* @param {?} filtered
|
|
1123
|
+
* @return {?}
|
|
1124
|
+
*/
|
|
1125
|
+
function (filtered) { return filtered.widgetInfo && filtered.widgetInfo.widgetInstanceId == widgetInstanceId; }));
|
|
1126
|
+
if (widget && widget.length > 0) {
|
|
1127
|
+
widgetFilteredList.push(widget[0]);
|
|
1128
|
+
/** @type {?} */
|
|
1129
|
+
var widgetList = this.mapGridsterListToObject(widgetFilteredList);
|
|
1130
|
+
this.dashboardService.updateWidgets(this.formatWidgetDataForPositionDetails(widgetList), this.appConfig).subscribe((/**
|
|
1131
|
+
* @param {?} widgets
|
|
1132
|
+
* @return {?}
|
|
1133
|
+
*/
|
|
1134
|
+
function (widgets) {
|
|
1135
|
+
}));
|
|
1136
|
+
}
|
|
1137
|
+
return true;
|
|
1138
|
+
};
|
|
1139
|
+
/**To restrict request payload to be of min size (position & size details) */
|
|
1140
|
+
/**
|
|
1141
|
+
* To restrict request payload to be of min size (position & size details)
|
|
1142
|
+
* @param {?} widgetItemList
|
|
1143
|
+
* @return {?}
|
|
1144
|
+
*/
|
|
1145
|
+
RADashboardArea.prototype.formatWidgetDataForPositionDetails = /**
|
|
1146
|
+
* To restrict request payload to be of min size (position & size details)
|
|
1147
|
+
* @param {?} widgetItemList
|
|
1148
|
+
* @return {?}
|
|
1149
|
+
*/
|
|
1150
|
+
function (widgetItemList) {
|
|
1151
|
+
/** @type {?} */
|
|
1152
|
+
var itemList = [];
|
|
1153
|
+
widgetItemList.forEach((/**
|
|
1154
|
+
* @param {?} widgetItem
|
|
1155
|
+
* @return {?}
|
|
1156
|
+
*/
|
|
1157
|
+
function (widgetItem) {
|
|
1158
|
+
/** @type {?} */
|
|
1159
|
+
var item = (/** @type {?} */ ({}));
|
|
1160
|
+
item.widgetInstanceId = widgetItem.widgetInstanceId;
|
|
1161
|
+
item.position_x = widgetItem.position_x;
|
|
1162
|
+
item.position_y = widgetItem.position_y;
|
|
1163
|
+
item.width = widgetItem.width;
|
|
1164
|
+
item.height = widgetItem.height;
|
|
1165
|
+
itemList.push(item);
|
|
1166
|
+
}));
|
|
1167
|
+
return itemList;
|
|
1168
|
+
};
|
|
946
1169
|
/** To retrieve widgets based on userDashboardid and area name */
|
|
947
1170
|
/**
|
|
948
1171
|
* To retrieve widgets based on userDashboardid and area name
|
|
@@ -959,21 +1182,36 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
959
1182
|
function (userDashboarId, areaKey) {
|
|
960
1183
|
var _this = this;
|
|
961
1184
|
/** @type {?} */
|
|
962
|
-
var areaContext = this;
|
|
963
|
-
/** @type {?} */
|
|
964
1185
|
var widgetInfo = (/** @type {?} */ ({
|
|
965
1186
|
dashboardId: userDashboarId.toString(),
|
|
966
1187
|
dashboardAreaKey: areaKey
|
|
967
1188
|
}));
|
|
968
|
-
|
|
1189
|
+
this.widgetList = [];
|
|
969
1190
|
this.dashboardService.getWidgetsByDashboardArea(widgetInfo, this.appConfig).subscribe((/**
|
|
970
1191
|
* @param {?} widgets
|
|
971
1192
|
* @return {?}
|
|
972
1193
|
*/
|
|
973
1194
|
function (widgets) {
|
|
1195
|
+
//sorting the widgets y, x
|
|
1196
|
+
widgets = widgets.sort((/**
|
|
1197
|
+
* @param {?} a
|
|
1198
|
+
* @param {?} b
|
|
1199
|
+
* @return {?}
|
|
1200
|
+
*/
|
|
1201
|
+
function (a, b) {
|
|
1202
|
+
if (a['position_y'] > b['position_y'])
|
|
1203
|
+
return 1;
|
|
1204
|
+
if (a['position_y'] < b['position_y'])
|
|
1205
|
+
return -1;
|
|
1206
|
+
if (a['position_x'] > b['position_x'])
|
|
1207
|
+
return 1;
|
|
1208
|
+
if (a['position_x'] < b['position_x'])
|
|
1209
|
+
return -1;
|
|
1210
|
+
}));
|
|
1211
|
+
_this.userWidgets = widgets;
|
|
974
1212
|
if (widgets && widgets.length > 0) {
|
|
975
|
-
|
|
976
|
-
|
|
1213
|
+
_this.widgetList = _this.mapObjectListToGridsterItemList(widgets);
|
|
1214
|
+
_this.setAreaHeight();
|
|
977
1215
|
}
|
|
978
1216
|
}));
|
|
979
1217
|
};
|
|
@@ -1031,7 +1269,6 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
1031
1269
|
areaHeight = 600;
|
|
1032
1270
|
}
|
|
1033
1271
|
this.gridheight = areaHeight;
|
|
1034
|
-
console.log('area height adjusted1');
|
|
1035
1272
|
};
|
|
1036
1273
|
/** To remove a widget instance from dashboard and to save info in database */
|
|
1037
1274
|
/**
|
|
@@ -1074,7 +1311,6 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
1074
1311
|
* @return {?}
|
|
1075
1312
|
*/
|
|
1076
1313
|
function () {
|
|
1077
|
-
console.log('in rearrange widgets methd');
|
|
1078
1314
|
this.options.compactType = 'compactUp&Left';
|
|
1079
1315
|
this.options.api.optionsChanged();
|
|
1080
1316
|
this.options.compactType = 'none';
|
|
@@ -1097,20 +1333,11 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
1097
1333
|
*/
|
|
1098
1334
|
function (data) {
|
|
1099
1335
|
var _this = this;
|
|
1100
|
-
/** @type {?} */
|
|
1101
|
-
var widgetid = data.widgetId;
|
|
1102
1336
|
data.height = this.widgetHeight;
|
|
1103
1337
|
data.width = this.widgetWidth;
|
|
1104
1338
|
data.position_x = 0;
|
|
1105
1339
|
data.position_y = 0;
|
|
1106
|
-
/** @type {?} */
|
|
1107
|
-
var gridsterItem = this.mapObjectsToGridsterItem(data);
|
|
1108
1340
|
/** to find the available position in gridster, temp commenting the code-returning higher y value than normal */
|
|
1109
|
-
// if (this.options.api) {
|
|
1110
|
-
// gridsterItem = this.options.api.getFirstPossiblePosition(gridsterItem);
|
|
1111
|
-
// }
|
|
1112
|
-
// data.position_x = gridsterItem.x;
|
|
1113
|
-
// data.position_y = gridsterItem.y;
|
|
1114
1341
|
data.dashboardAreaKey = this.areaKey;
|
|
1115
1342
|
data.dashboardId = this.userDashboardId;
|
|
1116
1343
|
this.ngxService.start();
|
|
@@ -1119,7 +1346,8 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
1119
1346
|
* @return {?}
|
|
1120
1347
|
*/
|
|
1121
1348
|
function (widget) {
|
|
1122
|
-
|
|
1349
|
+
/** @type {?} */
|
|
1350
|
+
var gridsterItem = _this.responsiveService.getGridsterItem(widget);
|
|
1123
1351
|
_this.widgetList.push(gridsterItem);
|
|
1124
1352
|
_this.setAreaHeight();
|
|
1125
1353
|
if (_this.options.api) {
|
|
@@ -1130,13 +1358,18 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
1130
1358
|
_this.gridcellHeight = curRowHeight;
|
|
1131
1359
|
}
|
|
1132
1360
|
}
|
|
1133
|
-
/**
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1361
|
+
/** @type {?} */
|
|
1362
|
+
var widgetInstanceId = 0;
|
|
1363
|
+
if (widget && widget.widgetInstanceId) {
|
|
1364
|
+
widgetInstanceId = widget.widgetInstanceId;
|
|
1365
|
+
/**To save added widget position in db */
|
|
1366
|
+
setTimeout((/**
|
|
1367
|
+
* @return {?}
|
|
1368
|
+
*/
|
|
1369
|
+
function () {
|
|
1370
|
+
_this.updateWidgetPosition(widgetInstanceId);
|
|
1371
|
+
}), 1000);
|
|
1372
|
+
}
|
|
1140
1373
|
_this.raDashboardEventBus.publish(RAEvent.WidgetAdded, widget);
|
|
1141
1374
|
}));
|
|
1142
1375
|
};
|
|
@@ -1152,39 +1385,13 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
1152
1385
|
* @return {?}
|
|
1153
1386
|
*/
|
|
1154
1387
|
function (data) {
|
|
1388
|
+
data.position_x = 0;
|
|
1389
|
+
data.position_y = 0;
|
|
1155
1390
|
/** @type {?} */
|
|
1156
|
-
var gridsterItem = this.
|
|
1157
|
-
if (this.options.api) {
|
|
1158
|
-
gridsterItem = this.options.api.getFirstPossiblePosition(gridsterItem);
|
|
1159
|
-
}
|
|
1160
|
-
data.position_x = gridsterItem.x;
|
|
1161
|
-
data.position_y = gridsterItem.y;
|
|
1162
|
-
gridsterItem = this.mapObjectsToGridsterItem(data);
|
|
1391
|
+
var gridsterItem = this.responsiveService.getGridsterItem(data);
|
|
1163
1392
|
this.widgetList.push(gridsterItem);
|
|
1164
1393
|
this.setAreaHeight();
|
|
1165
1394
|
};
|
|
1166
|
-
/**To map IwidgetInfo object to gridsterItem */
|
|
1167
|
-
/**
|
|
1168
|
-
* To map IwidgetInfo object to gridsterItem
|
|
1169
|
-
* @param {?} widget
|
|
1170
|
-
* @return {?}
|
|
1171
|
-
*/
|
|
1172
|
-
RADashboardArea.prototype.mapObjectsToGridsterItem = /**
|
|
1173
|
-
* To map IwidgetInfo object to gridsterItem
|
|
1174
|
-
* @param {?} widget
|
|
1175
|
-
* @return {?}
|
|
1176
|
-
*/
|
|
1177
|
-
function (widget) {
|
|
1178
|
-
/** @type {?} */
|
|
1179
|
-
var gridsterItem = (/** @type {?} */ ({
|
|
1180
|
-
cols: widget.width,
|
|
1181
|
-
rows: widget.height,
|
|
1182
|
-
x: widget.position_x,
|
|
1183
|
-
y: widget.position_y,
|
|
1184
|
-
widgetInfo: widget
|
|
1185
|
-
}));
|
|
1186
|
-
return gridsterItem;
|
|
1187
|
-
};
|
|
1188
1395
|
/**
|
|
1189
1396
|
* @param {?} widgetList
|
|
1190
1397
|
* @return {?}
|
|
@@ -1202,7 +1409,7 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
1202
1409
|
* @return {?}
|
|
1203
1410
|
*/
|
|
1204
1411
|
function (widget) {
|
|
1205
|
-
widgetArray.push(_this.
|
|
1412
|
+
widgetArray.push(_this.responsiveService.getGridsterItem(widget));
|
|
1206
1413
|
}));
|
|
1207
1414
|
return widgetArray;
|
|
1208
1415
|
};
|
|
@@ -1259,7 +1466,8 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
1259
1466
|
{ type: NgZone },
|
|
1260
1467
|
{ type: NgxUiLoaderService },
|
|
1261
1468
|
{ type: RATranslateService },
|
|
1262
|
-
{ type: NotifierService }
|
|
1469
|
+
{ type: NotifierService },
|
|
1470
|
+
{ type: RADashboardResponsiveService }
|
|
1263
1471
|
]; };
|
|
1264
1472
|
RADashboardArea.propDecorators = {
|
|
1265
1473
|
userDashboardId: [{ type: Input, args: ['user-dashboard-id',] }],
|
|
@@ -1269,7 +1477,6 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
1269
1477
|
widgetHeight: [{ type: Input, args: ['widget-height',] }],
|
|
1270
1478
|
widgetWidth: [{ type: Input, args: ['widget-width',] }],
|
|
1271
1479
|
appConfig: [{ type: Input, args: ['app-config',] }],
|
|
1272
|
-
widgetRearrangeSubject: [{ type: Input }],
|
|
1273
1480
|
gridWrapper: [{ type: ViewChild, args: ['gridWrapper', { static: false },] }],
|
|
1274
1481
|
onResize: [{ type: HostListener, args: ['window:resize', ['$event'],] }]
|
|
1275
1482
|
};
|
|
@@ -1284,11 +1491,21 @@ if (false) {
|
|
|
1284
1491
|
RADashboardArea.prototype.gridheight;
|
|
1285
1492
|
/** @type {?} */
|
|
1286
1493
|
RADashboardArea.prototype.gridcellHeight;
|
|
1494
|
+
/**
|
|
1495
|
+
* @type {?}
|
|
1496
|
+
* @private
|
|
1497
|
+
*/
|
|
1498
|
+
RADashboardArea.prototype.userWidgets;
|
|
1287
1499
|
/**
|
|
1288
1500
|
* @type {?}
|
|
1289
1501
|
* @private
|
|
1290
1502
|
*/
|
|
1291
1503
|
RADashboardArea.prototype.conifgAddClick;
|
|
1504
|
+
/**
|
|
1505
|
+
* @type {?}
|
|
1506
|
+
* @private
|
|
1507
|
+
*/
|
|
1508
|
+
RADashboardArea.prototype.rearrangeWidgetClick;
|
|
1292
1509
|
/**
|
|
1293
1510
|
* @type {?}
|
|
1294
1511
|
* @private
|
|
@@ -1326,8 +1543,6 @@ if (false) {
|
|
|
1326
1543
|
/** @type {?} */
|
|
1327
1544
|
RADashboardArea.prototype.appConfig;
|
|
1328
1545
|
/** @type {?} */
|
|
1329
|
-
RADashboardArea.prototype.widgetRearrangeSubject;
|
|
1330
|
-
/** @type {?} */
|
|
1331
1546
|
RADashboardArea.prototype.gridWrapper;
|
|
1332
1547
|
/**
|
|
1333
1548
|
* @type {?}
|
|
@@ -1354,6 +1569,11 @@ if (false) {
|
|
|
1354
1569
|
* @private
|
|
1355
1570
|
*/
|
|
1356
1571
|
RADashboardArea.prototype.notifier;
|
|
1572
|
+
/**
|
|
1573
|
+
* @type {?}
|
|
1574
|
+
* @private
|
|
1575
|
+
*/
|
|
1576
|
+
RADashboardArea.prototype.responsiveService;
|
|
1357
1577
|
}
|
|
1358
1578
|
|
|
1359
1579
|
/**
|
|
@@ -7409,7 +7629,6 @@ var RaBaseDashboardTemplate = /** @class */ (function () {
|
|
|
7409
7629
|
function RaBaseDashboardTemplate(ngZone) {
|
|
7410
7630
|
var _this = this;
|
|
7411
7631
|
this.ngZone = ngZone;
|
|
7412
|
-
this.widgetRearrangeSubject = new Subject();
|
|
7413
7632
|
this.initialize = (/**
|
|
7414
7633
|
* @param {?} eventBus
|
|
7415
7634
|
* @param {?} userDashboardId
|
|
@@ -7427,17 +7646,6 @@ var RaBaseDashboardTemplate = /** @class */ (function () {
|
|
|
7427
7646
|
}));
|
|
7428
7647
|
_this.init();
|
|
7429
7648
|
});
|
|
7430
|
-
this.rearrangeWidgets = (/**
|
|
7431
|
-
* @return {?}
|
|
7432
|
-
*/
|
|
7433
|
-
function () {
|
|
7434
|
-
_this.ngZone.run((/**
|
|
7435
|
-
* @return {?}
|
|
7436
|
-
*/
|
|
7437
|
-
function () {
|
|
7438
|
-
_this.widgetRearrangeSubject.next(true);
|
|
7439
|
-
}));
|
|
7440
|
-
});
|
|
7441
7649
|
}
|
|
7442
7650
|
/**
|
|
7443
7651
|
* @return {?}
|
|
@@ -7453,8 +7661,7 @@ var RaBaseDashboardTemplate = /** @class */ (function () {
|
|
|
7453
7661
|
RaBaseDashboardTemplate.propDecorators = {
|
|
7454
7662
|
dashboardId: [{ type: Input, args: ['dashboard-id',] }],
|
|
7455
7663
|
globalFilter: [{ type: Input, args: ['global-filter',] }],
|
|
7456
|
-
initialize: [{ type: Input }]
|
|
7457
|
-
rearrangeWidgets: [{ type: Input }]
|
|
7664
|
+
initialize: [{ type: Input }]
|
|
7458
7665
|
};
|
|
7459
7666
|
return RaBaseDashboardTemplate;
|
|
7460
7667
|
}());
|
|
@@ -7466,15 +7673,11 @@ if (false) {
|
|
|
7466
7673
|
/** @type {?} */
|
|
7467
7674
|
RaBaseDashboardTemplate.prototype.appConfig;
|
|
7468
7675
|
/** @type {?} */
|
|
7469
|
-
RaBaseDashboardTemplate.prototype.widgetRearrangeSubject;
|
|
7470
|
-
/** @type {?} */
|
|
7471
7676
|
RaBaseDashboardTemplate.prototype.dashboardId;
|
|
7472
7677
|
/** @type {?} */
|
|
7473
7678
|
RaBaseDashboardTemplate.prototype.globalFilter;
|
|
7474
7679
|
/** @type {?} */
|
|
7475
7680
|
RaBaseDashboardTemplate.prototype.initialize;
|
|
7476
|
-
/** @type {?} */
|
|
7477
|
-
RaBaseDashboardTemplate.prototype.rearrangeWidgets;
|
|
7478
7681
|
/**
|
|
7479
7682
|
* @type {?}
|
|
7480
7683
|
* @private
|
|
@@ -7593,5 +7796,5 @@ if (false) {
|
|
|
7593
7796
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
7594
7797
|
*/
|
|
7595
7798
|
|
|
7596
|
-
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 };
|
|
7799
|
+
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 };
|
|
7597
7800
|
//# sourceMappingURL=schneideress-dashboardframework.js.map
|