@schneideress/dashboardframework 0.0.247 → 0.0.249
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 +98 -105
- 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/gridster/lib/gridster.component.js +65 -101
- package/esm2015/lib/ra-dashboard-area/ra.dashboard.area.js +9 -2
- package/esm2015/lib/ra-widget-container/ra.widget.container.component.js +27 -11
- package/esm2015/lib/ra.base.dashboard.template.js +5 -1
- package/esm2015/lib/ra.dashboard.service.js +1 -1
- package/esm2015/lib/ra.event.enum.js +3 -1
- package/esm5/gridster/lib/gridster.component.js +65 -101
- package/esm5/lib/ra-dashboard-area/ra.dashboard.area.js +9 -2
- package/esm5/lib/ra-widget-container/ra.widget.container.component.js +27 -11
- package/esm5/lib/ra.base.dashboard.template.js +5 -1
- package/esm5/lib/ra.dashboard.service.js +1 -1
- package/esm5/lib/ra.event.enum.js +3 -1
- package/fesm2015/schneideress-dashboardframework.js +98 -105
- package/fesm2015/schneideress-dashboardframework.js.map +1 -1
- package/fesm5/schneideress-dashboardframework.js +98 -105
- package/fesm5/schneideress-dashboardframework.js.map +1 -1
- package/gridster/lib/gridster.component.d.ts +9 -9
- package/lib/ra-dashboard-area/ra.dashboard.area.d.ts +4 -1
- package/lib/ra-widget-container/ra.widget.container.component.d.ts +3 -1
- package/lib/ra.base.dashboard.template.d.ts +2 -1
- package/lib/ra.event.enum.d.ts +3 -1
- package/package.json +1 -1
- package/schneideress-dashboardframework.metadata.json +1 -1
|
@@ -184,6 +184,8 @@ var RAEvent;
|
|
|
184
184
|
RAEvent["UpdateAppledFiterForInapplicableFilter"] = "UpdateAppledFiterForInapplicableFilter";
|
|
185
185
|
/**show inapplicable filter message in global filter flyout */
|
|
186
186
|
RAEvent["ShowInapplicableFilterMessage"] = "ShowInapplicableFilterMessage";
|
|
187
|
+
/** Bulk Action Clicked */
|
|
188
|
+
RAEvent["BulkActionClick"] = "BulkActionClick";
|
|
187
189
|
})(RAEvent || (RAEvent = {}));
|
|
188
190
|
var RAEventKey;
|
|
189
191
|
(function (RAEventKey) {
|
|
@@ -440,6 +442,9 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
440
442
|
}
|
|
441
443
|
else {
|
|
442
444
|
setTimeout(function () {
|
|
445
|
+
_this.raDashboardEventBus.subscribe(RAEvent.BulkActionClick).subscribe(function (data) {
|
|
446
|
+
_this.bulkActionData = JSON.parse(JSON.stringify(data)); // To create a new reference;
|
|
447
|
+
});
|
|
443
448
|
_this.gridcellHeight = _this.options.api.getCurrentRowHeight();
|
|
444
449
|
_this.domResized = !_this.domResized;
|
|
445
450
|
_this.setAreaHeight();
|
|
@@ -853,6 +858,10 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
853
858
|
Input('app-config'),
|
|
854
859
|
__metadata("design:type", Object)
|
|
855
860
|
], RADashboardArea.prototype, "appConfig", void 0);
|
|
861
|
+
__decorate([
|
|
862
|
+
Input('dashboard-info'),
|
|
863
|
+
__metadata("design:type", Object)
|
|
864
|
+
], RADashboardArea.prototype, "dashboardInfo", void 0);
|
|
856
865
|
__decorate([
|
|
857
866
|
Output(),
|
|
858
867
|
__metadata("design:type", Object)
|
|
@@ -864,7 +873,7 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
864
873
|
RADashboardArea = __decorate([
|
|
865
874
|
Component({
|
|
866
875
|
selector: 'ra-dashboard-area',
|
|
867
|
-
template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\" [ngStyle]=\"{'height': userWidgets.length > 0 ? (gridheight + 'px') : 'unset'}\">\r\n <!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\" *ngIf=\"userWidgets.length > 0\">\r\n <gridster-item [item]=\"item\" *ngFor=\"let item of widgetList\">\r\n <ra-widget-container [app-config]=\"appConfig\" [event-bus]=\"raDashboardEventBus\"\r\n (widgetDeleted)=\"deleteWidget($event)\" [data]=\"item\" [global-filter]=\"globalFilter\"\r\n [grid-cell-height]=\"gridcellHeight\" *ngIf=\"gridcellHeight && gridcellHeight > 0\" [widget-width]=\"item.cols\"\r\n [widget-height]=\"item.rows\" [widget-instance-id]=\"item.widgetInstanceId\" [dom-resized]=\"domResized\"\r\n (updateAppliedFilters)=\"updateAppliedFilters($event)\">\r\n </ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n\r\n <div class=\"empty-padding kiosk-hide\" *ngIf=\"showEmptyDashboard\">\r\n <div class=\"empty-wrapper\">\r\n <div></div>\r\n <div class=\"m-1 empty-prefix\">\r\n <i class=\"fal fa-edit edit-icon\"></i>\r\n <span class=\"empty-title\">{{'dashboard.emptydashboard'|translate}}</span>\r\n </div>\r\n <div class=\"empty-content light\">\r\n <div>\r\n <div class=\"col-sm-12 empty-msg\">\r\n {{'dashboard.emptydashboardmessage'|translate}} <br />\r\n {{'dashboard.emptydashboardmessage2'|translate}}\r\n </div>\r\n <button *ngIf=\"isWidgetMgmnt\" class=\"btn btnLib btn-sm m-1 dashboard-button light\" (click)=\"addNewWidget()\">\r\n <i class=\"fal fa-plus m-1\"></i>{{'dashboard.addawidgets'|translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <notifier-container></notifier-container>\r\n</div>",
|
|
876
|
+
template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\" [ngStyle]=\"{'height': userWidgets.length > 0 ? (gridheight + 'px') : 'unset'}\">\r\n <!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\" *ngIf=\"userWidgets.length > 0\">\r\n <gridster-item [item]=\"item\" *ngFor=\"let item of widgetList\">\r\n <ra-widget-container [dashboard-info]=\"dashboardInfo\" [app-config]=\"appConfig\" [event-bus]=\"raDashboardEventBus\"\r\n (widgetDeleted)=\"deleteWidget($event)\" [data]=\"item\" [global-filter]=\"globalFilter\"\r\n [grid-cell-height]=\"gridcellHeight\" *ngIf=\"gridcellHeight && gridcellHeight > 0\" [widget-width]=\"item.cols\"\r\n [widget-height]=\"item.rows\" [widget-instance-id]=\"item.widgetInstanceId\" [dom-resized]=\"domResized\"\r\n (updateAppliedFilters)=\"updateAppliedFilters($event)\">\r\n </ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n\r\n <div class=\"empty-padding kiosk-hide\" *ngIf=\"showEmptyDashboard\">\r\n <div class=\"empty-wrapper\">\r\n <div></div>\r\n <div class=\"m-1 empty-prefix\">\r\n <i class=\"fal fa-edit edit-icon\"></i>\r\n <span class=\"empty-title\">{{'dashboard.emptydashboard'|translate}}</span>\r\n </div>\r\n <div class=\"empty-content light\">\r\n <div>\r\n <div class=\"col-sm-12 empty-msg\">\r\n {{'dashboard.emptydashboardmessage'|translate}} <br />\r\n {{'dashboard.emptydashboardmessage2'|translate}}\r\n </div>\r\n <button *ngIf=\"isWidgetMgmnt\" class=\"btn btnLib btn-sm m-1 dashboard-button light\" (click)=\"addNewWidget()\">\r\n <i class=\"fal fa-plus m-1\"></i>{{'dashboard.addawidgets'|translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <notifier-container></notifier-container>\r\n</div>",
|
|
868
877
|
styles: ["gridster{width:inherit;resize:height;display:flex;background-color:#ededed;overflow-y:hidden!important}.dvheader{width:100%;height:35px;background:#000;color:#fff;padding:7px 3px 5px 6px;text-transform:uppercase}gridster-item{box-sizing:border-box;z-index:1;position:absolute;overflow:hidden;transition:.3s;display:none;background:#fff;-webkit-user-select:text;-moz-user-select:text;user-select:text;box-shadow:0 1px 10px rgba(0,0,0,.05)}gridster-item:hover{box-shadow:0 1px 10px rgba(0,0,0,.15)}@media screen and (max-width:685px){.gridster-mobile{height:auto!important;margin-bottom:50px!important}}@media screen and (max-width:350px){.gridster-mobile{min-height:330px!important;margin-bottom:0!important}}.empty-padding{padding:40px 20px 20px;background-color:#ededed;display:flex;justify-content:center;align-content:center}.empty-wrapper{display:flex;background-color:#fff;border-radius:8px;min-height:125px;width:72%}.empty-prefix{color:#32ad3c;font-size:18px;display:flex;align-items:center;padding:10px 30px;min-width:-webkit-max-content;min-width:max-content;min-width:-moz-max-content}.empty-content{color:#333;border-left:1px solid #a9afb1;width:100%;display:flex;align-items:center;padding:15px 30px 10px 40px}.empty-msg{padding:0 0 5px;font-size:16px}.dashboard-button{padding:5px 10px 5px 5px!important}.btnLib{background-color:#ededed;color:#333!important}.btn-group-sm>.btn,.btn-sm{padding:5px 20px 5px 5px}.edit-icon{color:#32ad3c;font-size:24px;margin-right:15px}.empty-title{margin-top:10px}@media screen and (max-width:600px){.empty-padding{padding:10px;background-color:#ededed;width:100%;display:block}.empty-wrapper{display:flex;background-color:#fff;border-radius:8px;min-height:125px;width:100%}.empty-prefix{color:#32ad3c;font-size:16px;display:flex;height:40px;padding:6px 10px 8px}.empty-content{color:#333;display:flex;padding:5px 10px 10px;margin-top:44px;margin-left:-185px;border-left:none}.empty-msg{padding:12px 10px 10px 5px;font-size:14px;border-top:1px solid #a9afb1}.edit-icon{color:#32ad3c;font-size:20px;margin-right:6px}.empty-title{margin-top:6px}}"]
|
|
869
878
|
}),
|
|
870
879
|
__metadata("design:paramtypes", [RaDashboardService,
|
|
@@ -1015,20 +1024,27 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1015
1024
|
});
|
|
1016
1025
|
});
|
|
1017
1026
|
}
|
|
1018
|
-
if (this.widgetElement
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1027
|
+
if (this.widgetElement) {
|
|
1028
|
+
if (changes.bulkActionData && changes.bulkActionData.currentValue != changes.bulkActionData.previousValue) {
|
|
1029
|
+
if (typeof this.widgetElement.bulkActionClicked === "function") {
|
|
1030
|
+
this.widgetElement.bulkActionClicked(this.bulkActionData);
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
if (changes.globalFilter && changes.globalFilter.currentValue != changes.globalFilter.previousValue) {
|
|
1034
|
+
var filterObj = this.getParsedConfig(this.globalFilter);
|
|
1035
|
+
if (filterObj.WidgetInstanceId) {
|
|
1036
|
+
if (this.data.widgetInfo.widgetInstanceId != filterObj.WidgetInstanceId)
|
|
1037
|
+
this.refreshWidget(this.data.widgetInfo);
|
|
1038
|
+
}
|
|
1039
|
+
else {
|
|
1022
1040
|
this.refreshWidget(this.data.widgetInfo);
|
|
1041
|
+
}
|
|
1023
1042
|
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1043
|
+
if (changes.width && changes.width.currentValue != changes.width.previousValue ||
|
|
1044
|
+
(changes.height && changes.height.currentValue != changes.height.previousValue)) {
|
|
1045
|
+
this.invokeWidgetResizedEvent();
|
|
1026
1046
|
}
|
|
1027
1047
|
}
|
|
1028
|
-
if (changes.width && changes.width.currentValue != changes.width.previousValue ||
|
|
1029
|
-
(changes.height && changes.height.currentValue != changes.height.previousValue)) {
|
|
1030
|
-
this.invokeWidgetResizedEvent();
|
|
1031
|
-
}
|
|
1032
1048
|
};
|
|
1033
1049
|
RAWidgetContainer.prototype.invokeWidgetResizedEvent = function () {
|
|
1034
1050
|
if (this.widgetElement) {
|
|
@@ -1291,6 +1307,7 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1291
1307
|
widgetConfigFilter.configChanges = this.getConfigChanges(false);
|
|
1292
1308
|
widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
|
|
1293
1309
|
widgetConfigFilter.globalFilter = this.globalFilter;
|
|
1310
|
+
widgetConfigFilter.dashboardInfo = me.dashboardInfo;
|
|
1294
1311
|
this.widgetElement.loadContent(widgetConfigFilter);
|
|
1295
1312
|
return [4 /*yield*/, this.setLock(widgetConfigFilter.config)];
|
|
1296
1313
|
case 1:
|
|
@@ -1734,6 +1751,10 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1734
1751
|
Input('global-filter'),
|
|
1735
1752
|
__metadata("design:type", Object)
|
|
1736
1753
|
], RAWidgetContainer.prototype, "globalFilter", void 0);
|
|
1754
|
+
__decorate([
|
|
1755
|
+
Input('dashboard-info'),
|
|
1756
|
+
__metadata("design:type", Object)
|
|
1757
|
+
], RAWidgetContainer.prototype, "dashboardInfo", void 0);
|
|
1737
1758
|
__decorate([
|
|
1738
1759
|
Input('data'),
|
|
1739
1760
|
__metadata("design:type", Object)
|
|
@@ -1758,6 +1779,10 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1758
1779
|
Input('grid-cell-height'),
|
|
1759
1780
|
__metadata("design:type", Number)
|
|
1760
1781
|
], RAWidgetContainer.prototype, "gridCellHeight", void 0);
|
|
1782
|
+
__decorate([
|
|
1783
|
+
Input('bulk-action-data'),
|
|
1784
|
+
__metadata("design:type", Object)
|
|
1785
|
+
], RAWidgetContainer.prototype, "bulkActionData", void 0);
|
|
1761
1786
|
__decorate([
|
|
1762
1787
|
Output(),
|
|
1763
1788
|
__metadata("design:type", Object)
|
|
@@ -2655,10 +2680,10 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2655
2680
|
}
|
|
2656
2681
|
GridsterComponent_1 = GridsterComponent;
|
|
2657
2682
|
GridsterComponent.checkCollisionTwoItems = function (item, item2) {
|
|
2658
|
-
return
|
|
2659
|
-
item.x + item.cols > item2.x
|
|
2660
|
-
item.y < item2.y + item2.rows
|
|
2661
|
-
item.y + item.rows > item2.y
|
|
2683
|
+
return item.x < item2.x + item2.cols
|
|
2684
|
+
&& item.x + item.cols > item2.x
|
|
2685
|
+
&& item.y < item2.y + item2.rows
|
|
2686
|
+
&& item.y + item.rows > item2.y;
|
|
2662
2687
|
};
|
|
2663
2688
|
GridsterComponent.prototype.ngOnInit = function () {
|
|
2664
2689
|
if (this.options.initCallback) {
|
|
@@ -2666,7 +2691,6 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2666
2691
|
}
|
|
2667
2692
|
};
|
|
2668
2693
|
GridsterComponent.prototype.ngOnChanges = function (changes) {
|
|
2669
|
-
console.log(this.$options);
|
|
2670
2694
|
if (changes.options) {
|
|
2671
2695
|
this.setOptions();
|
|
2672
2696
|
this.options.api = {
|
|
@@ -2675,7 +2699,7 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2675
2699
|
getNextPossiblePosition: this.getNextPossiblePosition.bind(this),
|
|
2676
2700
|
getFirstPossiblePosition: this.getFirstPossiblePosition.bind(this),
|
|
2677
2701
|
getLastPossiblePosition: this.getLastPossiblePosition.bind(this),
|
|
2678
|
-
getCurrentRowHeight: this.getCurrentRowHeight.bind(this)
|
|
2702
|
+
getCurrentRowHeight: this.getCurrentRowHeight.bind(this)
|
|
2679
2703
|
};
|
|
2680
2704
|
this.columns = this.$options.minCols;
|
|
2681
2705
|
this.rows = this.$options.minRows;
|
|
@@ -2689,7 +2713,7 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2689
2713
|
GridsterComponent.prototype.resize = function () {
|
|
2690
2714
|
var height;
|
|
2691
2715
|
var width;
|
|
2692
|
-
if (this.$options.gridType ===
|
|
2716
|
+
if (this.$options.gridType === 'fit' && !this.mobile) {
|
|
2693
2717
|
width = this.el.offsetWidth;
|
|
2694
2718
|
height = this.el.offsetHeight;
|
|
2695
2719
|
}
|
|
@@ -2697,15 +2721,14 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2697
2721
|
width = this.el.clientWidth;
|
|
2698
2722
|
height = this.el.clientHeight;
|
|
2699
2723
|
}
|
|
2700
|
-
if ((width !== this.curWidth || height !== this.curHeight) &&
|
|
2701
|
-
this.checkIfToResize()) {
|
|
2724
|
+
if ((width !== this.curWidth || height !== this.curHeight) && this.checkIfToResize()) {
|
|
2702
2725
|
this.onResize();
|
|
2703
2726
|
}
|
|
2704
2727
|
};
|
|
2705
2728
|
GridsterComponent.prototype.setOptions = function () {
|
|
2706
2729
|
this.$options = GridsterUtils.merge(this.$options, this.options, this.$options);
|
|
2707
2730
|
if (!this.$options.disableWindowResize && !this.windowResize) {
|
|
2708
|
-
this.windowResize = this.renderer.listen(
|
|
2731
|
+
this.windowResize = this.renderer.listen('window', 'resize', this.onResize.bind(this));
|
|
2709
2732
|
}
|
|
2710
2733
|
else if (this.$options.disableWindowResize && this.windowResize) {
|
|
2711
2734
|
this.windowResize();
|
|
@@ -2731,9 +2754,9 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2731
2754
|
}
|
|
2732
2755
|
//if (this.options.api) {
|
|
2733
2756
|
/* this.options.api getting undefined for new dashboard load- temp fix
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2757
|
+
* on new dashboard area load, old dashboard area gets destroyed, but that leads to
|
|
2758
|
+
* ondestroy of current this.options.api instance - needs to investigate further
|
|
2759
|
+
*/
|
|
2737
2760
|
if (false) {
|
|
2738
2761
|
this.options.api.resize = undefined;
|
|
2739
2762
|
this.options.api.optionsChanged = undefined;
|
|
@@ -2756,12 +2779,10 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2756
2779
|
var clientHeight = this.el.clientHeight;
|
|
2757
2780
|
var offsetHeight = this.el.offsetHeight;
|
|
2758
2781
|
var scrollHeight = this.el.scrollHeight;
|
|
2759
|
-
var verticalScrollPresent = clientWidth < offsetWidth &&
|
|
2760
|
-
scrollHeight
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
scrollWidth > offsetWidth &&
|
|
2764
|
-
scrollWidth - offsetWidth < offsetHeight - clientHeight;
|
|
2782
|
+
var verticalScrollPresent = clientWidth < offsetWidth && scrollHeight > offsetHeight
|
|
2783
|
+
&& scrollHeight - offsetHeight < offsetWidth - clientWidth;
|
|
2784
|
+
var horizontalScrollPresent = clientHeight < offsetHeight
|
|
2785
|
+
&& scrollWidth > offsetWidth && scrollWidth - offsetWidth < offsetHeight - clientHeight;
|
|
2765
2786
|
if (verticalScrollPresent) {
|
|
2766
2787
|
return false;
|
|
2767
2788
|
}
|
|
@@ -2771,8 +2792,7 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2771
2792
|
var el = this.el;
|
|
2772
2793
|
var width = el.clientWidth;
|
|
2773
2794
|
var height = el.clientHeight;
|
|
2774
|
-
if (this.$options.setGridSize ||
|
|
2775
|
-
(this.$options.gridType === "fit" && !this.mobile)) {
|
|
2795
|
+
if (this.$options.setGridSize || this.$options.gridType === 'fit' && !this.mobile) {
|
|
2776
2796
|
width = el.offsetWidth;
|
|
2777
2797
|
height = el.offsetHeight;
|
|
2778
2798
|
}
|
|
@@ -2787,11 +2807,11 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2787
2807
|
this.setGridSize();
|
|
2788
2808
|
if (!this.mobile && this.$options.mobileBreakpoint > this.curWidth) {
|
|
2789
2809
|
this.mobile = !this.mobile;
|
|
2790
|
-
this.renderer.addClass(this.el,
|
|
2810
|
+
this.renderer.addClass(this.el, 'mobile');
|
|
2791
2811
|
}
|
|
2792
2812
|
else if (this.mobile && this.$options.mobileBreakpoint < this.curWidth) {
|
|
2793
2813
|
this.mobile = !this.mobile;
|
|
2794
|
-
this.renderer.removeClass(this.el,
|
|
2814
|
+
this.renderer.removeClass(this.el, 'mobile');
|
|
2795
2815
|
}
|
|
2796
2816
|
var rows = this.$options.minRows, columns = this.$options.minCols;
|
|
2797
2817
|
var widgetsIndex = this.grid.length - 1, widget;
|
|
@@ -2819,57 +2839,57 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2819
2839
|
var marginWidth = -this.$options.margin;
|
|
2820
2840
|
if (this.$options.outerMarginLeft !== null) {
|
|
2821
2841
|
marginWidth += this.$options.outerMarginLeft;
|
|
2822
|
-
this.renderer.setStyle(this.el,
|
|
2842
|
+
this.renderer.setStyle(this.el, 'padding-left', this.$options.outerMarginLeft + 'px');
|
|
2823
2843
|
}
|
|
2824
2844
|
else {
|
|
2825
2845
|
marginWidth += this.$options.margin;
|
|
2826
|
-
this.renderer.setStyle(this.el,
|
|
2846
|
+
this.renderer.setStyle(this.el, 'padding-left', this.$options.margin + 'px');
|
|
2827
2847
|
}
|
|
2828
2848
|
if (this.$options.outerMarginRight !== null) {
|
|
2829
2849
|
marginWidth += this.$options.outerMarginRight;
|
|
2830
|
-
this.renderer.setStyle(this.el,
|
|
2850
|
+
this.renderer.setStyle(this.el, 'padding-right', this.$options.outerMarginRight + 'px');
|
|
2831
2851
|
}
|
|
2832
2852
|
else {
|
|
2833
2853
|
marginWidth += this.$options.margin;
|
|
2834
|
-
this.renderer.setStyle(this.el,
|
|
2854
|
+
this.renderer.setStyle(this.el, 'padding-right', this.$options.margin + 'px');
|
|
2835
2855
|
}
|
|
2836
2856
|
this.curColWidth = (this.curWidth - marginWidth) / this.columns;
|
|
2837
2857
|
var marginHeight = -this.$options.margin;
|
|
2838
2858
|
if (this.$options.outerMarginTop !== null) {
|
|
2839
2859
|
marginHeight += this.$options.outerMarginTop;
|
|
2840
|
-
this.renderer.setStyle(this.el,
|
|
2860
|
+
this.renderer.setStyle(this.el, 'padding-top', this.$options.outerMarginTop + 'px');
|
|
2841
2861
|
}
|
|
2842
2862
|
else {
|
|
2843
2863
|
marginHeight += this.$options.margin;
|
|
2844
|
-
this.renderer.setStyle(this.el,
|
|
2864
|
+
this.renderer.setStyle(this.el, 'padding-top', this.$options.margin + 'px');
|
|
2845
2865
|
}
|
|
2846
2866
|
if (this.$options.outerMarginBottom !== null) {
|
|
2847
2867
|
marginHeight += this.$options.outerMarginBottom;
|
|
2848
|
-
this.renderer.setStyle(this.el,
|
|
2868
|
+
this.renderer.setStyle(this.el, 'padding-bottom', this.$options.outerMarginBottom + 'px');
|
|
2849
2869
|
}
|
|
2850
2870
|
else {
|
|
2851
2871
|
marginHeight += this.$options.margin;
|
|
2852
|
-
this.renderer.setStyle(this.el,
|
|
2872
|
+
this.renderer.setStyle(this.el, 'padding-bottom', this.$options.margin + 'px');
|
|
2853
2873
|
}
|
|
2854
2874
|
this.curRowHeight = (this.curHeight - marginHeight) / this.rows;
|
|
2855
2875
|
}
|
|
2856
2876
|
else {
|
|
2857
2877
|
this.curColWidth = (this.curWidth + this.$options.margin) / this.columns;
|
|
2858
2878
|
this.curRowHeight = (this.curHeight + this.$options.margin) / this.rows;
|
|
2859
|
-
this.renderer.setStyle(this.el,
|
|
2860
|
-
this.renderer.setStyle(this.el,
|
|
2861
|
-
this.renderer.setStyle(this.el,
|
|
2862
|
-
this.renderer.setStyle(this.el,
|
|
2879
|
+
this.renderer.setStyle(this.el, 'padding-left', 0 + 'px');
|
|
2880
|
+
this.renderer.setStyle(this.el, 'padding-right', 0 + 'px');
|
|
2881
|
+
this.renderer.setStyle(this.el, 'padding-top', 0 + 'px');
|
|
2882
|
+
this.renderer.setStyle(this.el, 'padding-bottom', 0 + 'px');
|
|
2863
2883
|
}
|
|
2864
2884
|
this.gridRenderer.updateGridster();
|
|
2865
2885
|
this.updateGrid();
|
|
2866
2886
|
if (this.$options.setGridSize) {
|
|
2867
|
-
this.renderer.setStyle(this.el,
|
|
2868
|
-
this.renderer.setStyle(this.el,
|
|
2887
|
+
this.renderer.setStyle(this.el, 'width', (this.columns * this.curColWidth + this.$options.margin) + 'px');
|
|
2888
|
+
this.renderer.setStyle(this.el, 'height', (this.rows * this.curRowHeight + this.$options.margin) + 'px');
|
|
2869
2889
|
}
|
|
2870
2890
|
else {
|
|
2871
|
-
this.renderer.setStyle(this.el,
|
|
2872
|
-
this.renderer.setStyle(this.el,
|
|
2891
|
+
this.renderer.setStyle(this.el, 'width', '');
|
|
2892
|
+
this.renderer.setStyle(this.el, 'height', '');
|
|
2873
2893
|
}
|
|
2874
2894
|
var widgetsIndex = this.grid.length - 1, widget;
|
|
2875
2895
|
for (; widgetsIndex >= 0; widgetsIndex--) {
|
|
@@ -2881,23 +2901,18 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2881
2901
|
setTimeout(this.resize.bind(this), 100);
|
|
2882
2902
|
};
|
|
2883
2903
|
GridsterComponent.prototype.updateGrid = function () {
|
|
2884
|
-
if (this.$options.displayGrid ===
|
|
2885
|
-
this.renderer.addClass(this.el,
|
|
2904
|
+
if (this.$options.displayGrid === 'always' && !this.mobile) {
|
|
2905
|
+
this.renderer.addClass(this.el, 'display-grid');
|
|
2886
2906
|
}
|
|
2887
|
-
else if (this.$options.displayGrid ===
|
|
2888
|
-
this.
|
|
2889
|
-
this.renderer.addClass(this.el, "display-grid");
|
|
2907
|
+
else if (this.$options.displayGrid === 'onDrag&Resize' && this.dragInProgress) {
|
|
2908
|
+
this.renderer.addClass(this.el, 'display-grid');
|
|
2890
2909
|
}
|
|
2891
|
-
else if (this.$options.displayGrid ===
|
|
2892
|
-
|
|
2893
|
-
this.mobile) {
|
|
2894
|
-
this.renderer.removeClass(this.el, "display-grid");
|
|
2910
|
+
else if (this.$options.displayGrid === 'none' || !this.dragInProgress || this.mobile) {
|
|
2911
|
+
this.renderer.removeClass(this.el, 'display-grid');
|
|
2895
2912
|
}
|
|
2896
2913
|
this.setGridDimensions();
|
|
2897
|
-
this.gridColumns.length =
|
|
2898
|
-
|
|
2899
|
-
this.gridRows.length =
|
|
2900
|
-
Math.max(this.rows, Math.floor(this.curHeight / this.curRowHeight)) || 0;
|
|
2914
|
+
this.gridColumns.length = Math.max(this.columns, Math.floor(this.curWidth / this.curColWidth)) || 0;
|
|
2915
|
+
this.gridRows.length = Math.max(this.rows, Math.floor(this.curHeight / this.curRowHeight)) || 0;
|
|
2901
2916
|
this.cdRef.markForCheck();
|
|
2902
2917
|
};
|
|
2903
2918
|
GridsterComponent.prototype.addItem = function (itemComponent) {
|
|
@@ -2917,8 +2932,8 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2917
2932
|
else if (this.checkCollision(itemComponent.$item)) {
|
|
2918
2933
|
if (!this.$options.disableWarnings) {
|
|
2919
2934
|
itemComponent.notPlaced = true;
|
|
2920
|
-
console.warn(
|
|
2921
|
-
JSON.stringify(itemComponent.item, [
|
|
2935
|
+
console.warn('Can\'t be placed in the bounds of the dashboard, trying to auto position!/n' +
|
|
2936
|
+
JSON.stringify(itemComponent.item, ['cols', 'rows', 'x', 'y']));
|
|
2922
2937
|
}
|
|
2923
2938
|
if (!this.$options.disableAutoPositionOnConflict) {
|
|
2924
2939
|
this.autoPositionItem(itemComponent);
|
|
@@ -2957,43 +2972,24 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2957
2972
|
var noNegativePosition = item.y > -1 && item.x > -1;
|
|
2958
2973
|
var maxGridCols = item.cols + item.x <= this.$options.maxCols;
|
|
2959
2974
|
var maxGridRows = item.rows + item.y <= this.$options.maxRows;
|
|
2960
|
-
var maxItemCols = item.maxItemCols === undefined
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
var
|
|
2964
|
-
? this.$options.minItemCols
|
|
2965
|
-
: item.minItemCols;
|
|
2966
|
-
var maxItemRows = item.maxItemRows === undefined
|
|
2967
|
-
? this.$options.maxItemRows
|
|
2968
|
-
: item.maxItemRows;
|
|
2969
|
-
var minItemRows = item.minItemRows === undefined
|
|
2970
|
-
? this.$options.minItemRows
|
|
2971
|
-
: item.minItemRows;
|
|
2975
|
+
var maxItemCols = item.maxItemCols === undefined ? this.$options.maxItemCols : item.maxItemCols;
|
|
2976
|
+
var minItemCols = item.minItemCols === undefined ? this.$options.minItemCols : item.minItemCols;
|
|
2977
|
+
var maxItemRows = item.maxItemRows === undefined ? this.$options.maxItemRows : item.maxItemRows;
|
|
2978
|
+
var minItemRows = item.minItemRows === undefined ? this.$options.minItemRows : item.minItemRows;
|
|
2972
2979
|
var inColsLimits = item.cols <= maxItemCols && item.cols >= minItemCols;
|
|
2973
2980
|
var inRowsLimits = item.rows <= maxItemRows && item.rows >= minItemRows;
|
|
2974
|
-
var minAreaLimit = item.minItemArea === undefined
|
|
2975
|
-
|
|
2976
|
-
: item.minItemArea;
|
|
2977
|
-
var maxAreaLimit = item.maxItemArea === undefined
|
|
2978
|
-
? this.$options.maxItemArea
|
|
2979
|
-
: item.maxItemArea;
|
|
2981
|
+
var minAreaLimit = item.minItemArea === undefined ? this.$options.minItemArea : item.minItemArea;
|
|
2982
|
+
var maxAreaLimit = item.maxItemArea === undefined ? this.$options.maxItemArea : item.maxItemArea;
|
|
2980
2983
|
var area = item.cols * item.rows;
|
|
2981
2984
|
var inMinArea = minAreaLimit <= area;
|
|
2982
2985
|
var inMaxArea = maxAreaLimit >= area;
|
|
2983
|
-
return !(noNegativePosition &&
|
|
2984
|
-
maxGridCols &&
|
|
2985
|
-
maxGridRows &&
|
|
2986
|
-
inColsLimits &&
|
|
2987
|
-
inRowsLimits &&
|
|
2988
|
-
inMinArea &&
|
|
2989
|
-
inMaxArea);
|
|
2986
|
+
return !(noNegativePosition && maxGridCols && maxGridRows && inColsLimits && inRowsLimits && inMinArea && inMaxArea);
|
|
2990
2987
|
};
|
|
2991
2988
|
GridsterComponent.prototype.findItemWithItem = function (item) {
|
|
2992
2989
|
var widgetsIndex = this.grid.length - 1, widget;
|
|
2993
2990
|
for (; widgetsIndex > -1; widgetsIndex--) {
|
|
2994
2991
|
widget = this.grid[widgetsIndex];
|
|
2995
|
-
if (widget.$item !== item &&
|
|
2996
|
-
GridsterComponent_1.checkCollisionTwoItems(widget.$item, item)) {
|
|
2992
|
+
if (widget.$item !== item && GridsterComponent_1.checkCollisionTwoItems(widget.$item, item)) {
|
|
2997
2993
|
return widget;
|
|
2998
2994
|
}
|
|
2999
2995
|
}
|
|
@@ -3004,8 +3000,7 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
3004
3000
|
var widgetsIndex = this.grid.length - 1, widget;
|
|
3005
3001
|
for (; widgetsIndex > -1; widgetsIndex--) {
|
|
3006
3002
|
widget = this.grid[widgetsIndex];
|
|
3007
|
-
if (widget.$item !== item &&
|
|
3008
|
-
GridsterComponent_1.checkCollisionTwoItems(widget.$item, item)) {
|
|
3003
|
+
if (widget.$item !== item && GridsterComponent_1.checkCollisionTwoItems(widget.$item, item)) {
|
|
3009
3004
|
a.push(widget);
|
|
3010
3005
|
}
|
|
3011
3006
|
}
|
|
@@ -3021,8 +3016,8 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
3021
3016
|
else {
|
|
3022
3017
|
itemComponent.notPlaced = true;
|
|
3023
3018
|
if (!this.$options.disableWarnings) {
|
|
3024
|
-
console.warn(
|
|
3025
|
-
JSON.stringify(itemComponent.item, [
|
|
3019
|
+
console.warn('Can\'t be placed in the bounds of the dashboard!/n' +
|
|
3020
|
+
JSON.stringify(itemComponent.item, ['cols', 'rows', 'x', 'y']));
|
|
3026
3021
|
}
|
|
3027
3022
|
}
|
|
3028
3023
|
};
|
|
@@ -3069,10 +3064,7 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
3069
3064
|
GridsterComponent.prototype.getLastPossiblePosition = function (item) {
|
|
3070
3065
|
var farthestItem = { y: 0, x: 0 };
|
|
3071
3066
|
farthestItem = this.grid.reduce(function (prev, curr) {
|
|
3072
|
-
var currCoords = {
|
|
3073
|
-
y: curr.$item.y + curr.$item.rows - 1,
|
|
3074
|
-
x: curr.$item.x + curr.$item.cols - 1,
|
|
3075
|
-
};
|
|
3067
|
+
var currCoords = { y: curr.$item.y + curr.$item.rows - 1, x: curr.$item.x + curr.$item.cols - 1 };
|
|
3076
3068
|
if (GridsterUtils.compareItems(prev, currCoords) === 1) {
|
|
3077
3069
|
return currCoords;
|
|
3078
3070
|
}
|
|
@@ -3121,15 +3113,12 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
3121
3113
|
], GridsterComponent.prototype, "options", void 0);
|
|
3122
3114
|
GridsterComponent = GridsterComponent_1 = __decorate([
|
|
3123
3115
|
Component({
|
|
3124
|
-
selector:
|
|
3116
|
+
selector: 'gridster',
|
|
3125
3117
|
template: "<div class=\"gridster-column\" *ngFor=\"let column of gridColumns; let i = index;\"\r\n [ngStyle]=\"gridRenderer.getGridColumnStyle(i)\"></div>\r\n<div class=\"gridster-row\" *ngFor=\"let row of gridRows; let i = index;\"\r\n [ngStyle]=\"gridRenderer.getGridRowStyle(i)\"></div>\r\n<ng-content></ng-content>\r\n<gridster-preview class=\"gridster-preview\"></gridster-preview>\r\n",
|
|
3126
3118
|
encapsulation: ViewEncapsulation.None,
|
|
3127
3119
|
styles: ["gridster{clear:both;position:relative;box-sizing:border-box;background:#fff;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;display:block;overflow:auto}gridster.fit{overflow-x:hidden;overflow-y:hidden}gridster.scrollVertical{overflow-x:hidden;overflow-y:auto}gridster.scrollHorizontal{overflow-x:auto;overflow-y:hidden}gridster.fixed{overflow:auto}gridster.mobile{overflow-x:hidden;overflow-y:auto;flex-flow:column}gridster.mobile gridster-item{position:relative;width:100%!important;min-height:300px!important}gridster .gridster-column,gridster .gridster-row{position:absolute;display:none;transition:.3s;box-sizing:border-box}gridster.display-grid .gridster-column,gridster.display-grid .gridster-row{display:block}gridster .gridster-column{border-left:1px solid #ccc;border-right:1px solid #ccc}gridster .gridster-row{border-top:1px solid #ccc;border-bottom:1px solid #ccc}"]
|
|
3128
3120
|
}),
|
|
3129
|
-
__metadata("design:paramtypes", [ElementRef,
|
|
3130
|
-
Renderer2,
|
|
3131
|
-
ChangeDetectorRef,
|
|
3132
|
-
NgZone])
|
|
3121
|
+
__metadata("design:paramtypes", [ElementRef, Renderer2, ChangeDetectorRef, NgZone])
|
|
3133
3122
|
], GridsterComponent);
|
|
3134
3123
|
return GridsterComponent;
|
|
3135
3124
|
}());
|
|
@@ -4821,6 +4810,10 @@ var RaBaseDashboardTemplate = /** @class */ (function () {
|
|
|
4821
4810
|
Input('global-filter'),
|
|
4822
4811
|
__metadata("design:type", Object)
|
|
4823
4812
|
], RaBaseDashboardTemplate.prototype, "globalFilter", void 0);
|
|
4813
|
+
__decorate([
|
|
4814
|
+
Input('dashboard-info'),
|
|
4815
|
+
__metadata("design:type", Object)
|
|
4816
|
+
], RaBaseDashboardTemplate.prototype, "dashboardInfo", void 0);
|
|
4824
4817
|
__decorate([
|
|
4825
4818
|
Input(),
|
|
4826
4819
|
__metadata("design:type", Object)
|