@schneideress/dashboardframework 0.0.247 → 0.0.248
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 +89 -104
- 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 +8 -1
- package/esm2015/lib/ra-widget-container/ra.widget.container.component.js +23 -11
- 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 +8 -1
- package/esm5/lib/ra-widget-container/ra.widget.container.component.js +23 -11
- package/esm5/lib/ra.dashboard.service.js +1 -1
- package/esm5/lib/ra.event.enum.js +3 -1
- package/fesm2015/schneideress-dashboardframework.js +89 -104
- package/fesm2015/schneideress-dashboardframework.js.map +1 -1
- package/fesm5/schneideress-dashboardframework.js +89 -104
- 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 +2 -1
- package/lib/ra.dashboard.service.d.ts +3 -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)
|
|
@@ -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.dashboardService.dashboardInfo;
|
|
1294
1311
|
this.widgetElement.loadContent(widgetConfigFilter);
|
|
1295
1312
|
return [4 /*yield*/, this.setLock(widgetConfigFilter.config)];
|
|
1296
1313
|
case 1:
|
|
@@ -1758,6 +1775,10 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1758
1775
|
Input('grid-cell-height'),
|
|
1759
1776
|
__metadata("design:type", Number)
|
|
1760
1777
|
], RAWidgetContainer.prototype, "gridCellHeight", void 0);
|
|
1778
|
+
__decorate([
|
|
1779
|
+
Input('bulk-action-data'),
|
|
1780
|
+
__metadata("design:type", Object)
|
|
1781
|
+
], RAWidgetContainer.prototype, "bulkActionData", void 0);
|
|
1761
1782
|
__decorate([
|
|
1762
1783
|
Output(),
|
|
1763
1784
|
__metadata("design:type", Object)
|
|
@@ -2655,10 +2676,10 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2655
2676
|
}
|
|
2656
2677
|
GridsterComponent_1 = GridsterComponent;
|
|
2657
2678
|
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
|
|
2679
|
+
return item.x < item2.x + item2.cols
|
|
2680
|
+
&& item.x + item.cols > item2.x
|
|
2681
|
+
&& item.y < item2.y + item2.rows
|
|
2682
|
+
&& item.y + item.rows > item2.y;
|
|
2662
2683
|
};
|
|
2663
2684
|
GridsterComponent.prototype.ngOnInit = function () {
|
|
2664
2685
|
if (this.options.initCallback) {
|
|
@@ -2666,7 +2687,6 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2666
2687
|
}
|
|
2667
2688
|
};
|
|
2668
2689
|
GridsterComponent.prototype.ngOnChanges = function (changes) {
|
|
2669
|
-
console.log(this.$options);
|
|
2670
2690
|
if (changes.options) {
|
|
2671
2691
|
this.setOptions();
|
|
2672
2692
|
this.options.api = {
|
|
@@ -2675,7 +2695,7 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2675
2695
|
getNextPossiblePosition: this.getNextPossiblePosition.bind(this),
|
|
2676
2696
|
getFirstPossiblePosition: this.getFirstPossiblePosition.bind(this),
|
|
2677
2697
|
getLastPossiblePosition: this.getLastPossiblePosition.bind(this),
|
|
2678
|
-
getCurrentRowHeight: this.getCurrentRowHeight.bind(this)
|
|
2698
|
+
getCurrentRowHeight: this.getCurrentRowHeight.bind(this)
|
|
2679
2699
|
};
|
|
2680
2700
|
this.columns = this.$options.minCols;
|
|
2681
2701
|
this.rows = this.$options.minRows;
|
|
@@ -2689,7 +2709,7 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2689
2709
|
GridsterComponent.prototype.resize = function () {
|
|
2690
2710
|
var height;
|
|
2691
2711
|
var width;
|
|
2692
|
-
if (this.$options.gridType ===
|
|
2712
|
+
if (this.$options.gridType === 'fit' && !this.mobile) {
|
|
2693
2713
|
width = this.el.offsetWidth;
|
|
2694
2714
|
height = this.el.offsetHeight;
|
|
2695
2715
|
}
|
|
@@ -2697,15 +2717,14 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2697
2717
|
width = this.el.clientWidth;
|
|
2698
2718
|
height = this.el.clientHeight;
|
|
2699
2719
|
}
|
|
2700
|
-
if ((width !== this.curWidth || height !== this.curHeight) &&
|
|
2701
|
-
this.checkIfToResize()) {
|
|
2720
|
+
if ((width !== this.curWidth || height !== this.curHeight) && this.checkIfToResize()) {
|
|
2702
2721
|
this.onResize();
|
|
2703
2722
|
}
|
|
2704
2723
|
};
|
|
2705
2724
|
GridsterComponent.prototype.setOptions = function () {
|
|
2706
2725
|
this.$options = GridsterUtils.merge(this.$options, this.options, this.$options);
|
|
2707
2726
|
if (!this.$options.disableWindowResize && !this.windowResize) {
|
|
2708
|
-
this.windowResize = this.renderer.listen(
|
|
2727
|
+
this.windowResize = this.renderer.listen('window', 'resize', this.onResize.bind(this));
|
|
2709
2728
|
}
|
|
2710
2729
|
else if (this.$options.disableWindowResize && this.windowResize) {
|
|
2711
2730
|
this.windowResize();
|
|
@@ -2731,9 +2750,9 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2731
2750
|
}
|
|
2732
2751
|
//if (this.options.api) {
|
|
2733
2752
|
/* this.options.api getting undefined for new dashboard load- temp fix
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2753
|
+
* on new dashboard area load, old dashboard area gets destroyed, but that leads to
|
|
2754
|
+
* ondestroy of current this.options.api instance - needs to investigate further
|
|
2755
|
+
*/
|
|
2737
2756
|
if (false) {
|
|
2738
2757
|
this.options.api.resize = undefined;
|
|
2739
2758
|
this.options.api.optionsChanged = undefined;
|
|
@@ -2756,12 +2775,10 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2756
2775
|
var clientHeight = this.el.clientHeight;
|
|
2757
2776
|
var offsetHeight = this.el.offsetHeight;
|
|
2758
2777
|
var scrollHeight = this.el.scrollHeight;
|
|
2759
|
-
var verticalScrollPresent = clientWidth < offsetWidth &&
|
|
2760
|
-
scrollHeight
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
scrollWidth > offsetWidth &&
|
|
2764
|
-
scrollWidth - offsetWidth < offsetHeight - clientHeight;
|
|
2778
|
+
var verticalScrollPresent = clientWidth < offsetWidth && scrollHeight > offsetHeight
|
|
2779
|
+
&& scrollHeight - offsetHeight < offsetWidth - clientWidth;
|
|
2780
|
+
var horizontalScrollPresent = clientHeight < offsetHeight
|
|
2781
|
+
&& scrollWidth > offsetWidth && scrollWidth - offsetWidth < offsetHeight - clientHeight;
|
|
2765
2782
|
if (verticalScrollPresent) {
|
|
2766
2783
|
return false;
|
|
2767
2784
|
}
|
|
@@ -2771,8 +2788,7 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2771
2788
|
var el = this.el;
|
|
2772
2789
|
var width = el.clientWidth;
|
|
2773
2790
|
var height = el.clientHeight;
|
|
2774
|
-
if (this.$options.setGridSize ||
|
|
2775
|
-
(this.$options.gridType === "fit" && !this.mobile)) {
|
|
2791
|
+
if (this.$options.setGridSize || this.$options.gridType === 'fit' && !this.mobile) {
|
|
2776
2792
|
width = el.offsetWidth;
|
|
2777
2793
|
height = el.offsetHeight;
|
|
2778
2794
|
}
|
|
@@ -2787,11 +2803,11 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2787
2803
|
this.setGridSize();
|
|
2788
2804
|
if (!this.mobile && this.$options.mobileBreakpoint > this.curWidth) {
|
|
2789
2805
|
this.mobile = !this.mobile;
|
|
2790
|
-
this.renderer.addClass(this.el,
|
|
2806
|
+
this.renderer.addClass(this.el, 'mobile');
|
|
2791
2807
|
}
|
|
2792
2808
|
else if (this.mobile && this.$options.mobileBreakpoint < this.curWidth) {
|
|
2793
2809
|
this.mobile = !this.mobile;
|
|
2794
|
-
this.renderer.removeClass(this.el,
|
|
2810
|
+
this.renderer.removeClass(this.el, 'mobile');
|
|
2795
2811
|
}
|
|
2796
2812
|
var rows = this.$options.minRows, columns = this.$options.minCols;
|
|
2797
2813
|
var widgetsIndex = this.grid.length - 1, widget;
|
|
@@ -2819,57 +2835,57 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2819
2835
|
var marginWidth = -this.$options.margin;
|
|
2820
2836
|
if (this.$options.outerMarginLeft !== null) {
|
|
2821
2837
|
marginWidth += this.$options.outerMarginLeft;
|
|
2822
|
-
this.renderer.setStyle(this.el,
|
|
2838
|
+
this.renderer.setStyle(this.el, 'padding-left', this.$options.outerMarginLeft + 'px');
|
|
2823
2839
|
}
|
|
2824
2840
|
else {
|
|
2825
2841
|
marginWidth += this.$options.margin;
|
|
2826
|
-
this.renderer.setStyle(this.el,
|
|
2842
|
+
this.renderer.setStyle(this.el, 'padding-left', this.$options.margin + 'px');
|
|
2827
2843
|
}
|
|
2828
2844
|
if (this.$options.outerMarginRight !== null) {
|
|
2829
2845
|
marginWidth += this.$options.outerMarginRight;
|
|
2830
|
-
this.renderer.setStyle(this.el,
|
|
2846
|
+
this.renderer.setStyle(this.el, 'padding-right', this.$options.outerMarginRight + 'px');
|
|
2831
2847
|
}
|
|
2832
2848
|
else {
|
|
2833
2849
|
marginWidth += this.$options.margin;
|
|
2834
|
-
this.renderer.setStyle(this.el,
|
|
2850
|
+
this.renderer.setStyle(this.el, 'padding-right', this.$options.margin + 'px');
|
|
2835
2851
|
}
|
|
2836
2852
|
this.curColWidth = (this.curWidth - marginWidth) / this.columns;
|
|
2837
2853
|
var marginHeight = -this.$options.margin;
|
|
2838
2854
|
if (this.$options.outerMarginTop !== null) {
|
|
2839
2855
|
marginHeight += this.$options.outerMarginTop;
|
|
2840
|
-
this.renderer.setStyle(this.el,
|
|
2856
|
+
this.renderer.setStyle(this.el, 'padding-top', this.$options.outerMarginTop + 'px');
|
|
2841
2857
|
}
|
|
2842
2858
|
else {
|
|
2843
2859
|
marginHeight += this.$options.margin;
|
|
2844
|
-
this.renderer.setStyle(this.el,
|
|
2860
|
+
this.renderer.setStyle(this.el, 'padding-top', this.$options.margin + 'px');
|
|
2845
2861
|
}
|
|
2846
2862
|
if (this.$options.outerMarginBottom !== null) {
|
|
2847
2863
|
marginHeight += this.$options.outerMarginBottom;
|
|
2848
|
-
this.renderer.setStyle(this.el,
|
|
2864
|
+
this.renderer.setStyle(this.el, 'padding-bottom', this.$options.outerMarginBottom + 'px');
|
|
2849
2865
|
}
|
|
2850
2866
|
else {
|
|
2851
2867
|
marginHeight += this.$options.margin;
|
|
2852
|
-
this.renderer.setStyle(this.el,
|
|
2868
|
+
this.renderer.setStyle(this.el, 'padding-bottom', this.$options.margin + 'px');
|
|
2853
2869
|
}
|
|
2854
2870
|
this.curRowHeight = (this.curHeight - marginHeight) / this.rows;
|
|
2855
2871
|
}
|
|
2856
2872
|
else {
|
|
2857
2873
|
this.curColWidth = (this.curWidth + this.$options.margin) / this.columns;
|
|
2858
2874
|
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,
|
|
2875
|
+
this.renderer.setStyle(this.el, 'padding-left', 0 + 'px');
|
|
2876
|
+
this.renderer.setStyle(this.el, 'padding-right', 0 + 'px');
|
|
2877
|
+
this.renderer.setStyle(this.el, 'padding-top', 0 + 'px');
|
|
2878
|
+
this.renderer.setStyle(this.el, 'padding-bottom', 0 + 'px');
|
|
2863
2879
|
}
|
|
2864
2880
|
this.gridRenderer.updateGridster();
|
|
2865
2881
|
this.updateGrid();
|
|
2866
2882
|
if (this.$options.setGridSize) {
|
|
2867
|
-
this.renderer.setStyle(this.el,
|
|
2868
|
-
this.renderer.setStyle(this.el,
|
|
2883
|
+
this.renderer.setStyle(this.el, 'width', (this.columns * this.curColWidth + this.$options.margin) + 'px');
|
|
2884
|
+
this.renderer.setStyle(this.el, 'height', (this.rows * this.curRowHeight + this.$options.margin) + 'px');
|
|
2869
2885
|
}
|
|
2870
2886
|
else {
|
|
2871
|
-
this.renderer.setStyle(this.el,
|
|
2872
|
-
this.renderer.setStyle(this.el,
|
|
2887
|
+
this.renderer.setStyle(this.el, 'width', '');
|
|
2888
|
+
this.renderer.setStyle(this.el, 'height', '');
|
|
2873
2889
|
}
|
|
2874
2890
|
var widgetsIndex = this.grid.length - 1, widget;
|
|
2875
2891
|
for (; widgetsIndex >= 0; widgetsIndex--) {
|
|
@@ -2881,23 +2897,18 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2881
2897
|
setTimeout(this.resize.bind(this), 100);
|
|
2882
2898
|
};
|
|
2883
2899
|
GridsterComponent.prototype.updateGrid = function () {
|
|
2884
|
-
if (this.$options.displayGrid ===
|
|
2885
|
-
this.renderer.addClass(this.el,
|
|
2900
|
+
if (this.$options.displayGrid === 'always' && !this.mobile) {
|
|
2901
|
+
this.renderer.addClass(this.el, 'display-grid');
|
|
2886
2902
|
}
|
|
2887
|
-
else if (this.$options.displayGrid ===
|
|
2888
|
-
this.
|
|
2889
|
-
this.renderer.addClass(this.el, "display-grid");
|
|
2903
|
+
else if (this.$options.displayGrid === 'onDrag&Resize' && this.dragInProgress) {
|
|
2904
|
+
this.renderer.addClass(this.el, 'display-grid');
|
|
2890
2905
|
}
|
|
2891
|
-
else if (this.$options.displayGrid ===
|
|
2892
|
-
|
|
2893
|
-
this.mobile) {
|
|
2894
|
-
this.renderer.removeClass(this.el, "display-grid");
|
|
2906
|
+
else if (this.$options.displayGrid === 'none' || !this.dragInProgress || this.mobile) {
|
|
2907
|
+
this.renderer.removeClass(this.el, 'display-grid');
|
|
2895
2908
|
}
|
|
2896
2909
|
this.setGridDimensions();
|
|
2897
|
-
this.gridColumns.length =
|
|
2898
|
-
|
|
2899
|
-
this.gridRows.length =
|
|
2900
|
-
Math.max(this.rows, Math.floor(this.curHeight / this.curRowHeight)) || 0;
|
|
2910
|
+
this.gridColumns.length = Math.max(this.columns, Math.floor(this.curWidth / this.curColWidth)) || 0;
|
|
2911
|
+
this.gridRows.length = Math.max(this.rows, Math.floor(this.curHeight / this.curRowHeight)) || 0;
|
|
2901
2912
|
this.cdRef.markForCheck();
|
|
2902
2913
|
};
|
|
2903
2914
|
GridsterComponent.prototype.addItem = function (itemComponent) {
|
|
@@ -2917,8 +2928,8 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2917
2928
|
else if (this.checkCollision(itemComponent.$item)) {
|
|
2918
2929
|
if (!this.$options.disableWarnings) {
|
|
2919
2930
|
itemComponent.notPlaced = true;
|
|
2920
|
-
console.warn(
|
|
2921
|
-
JSON.stringify(itemComponent.item, [
|
|
2931
|
+
console.warn('Can\'t be placed in the bounds of the dashboard, trying to auto position!/n' +
|
|
2932
|
+
JSON.stringify(itemComponent.item, ['cols', 'rows', 'x', 'y']));
|
|
2922
2933
|
}
|
|
2923
2934
|
if (!this.$options.disableAutoPositionOnConflict) {
|
|
2924
2935
|
this.autoPositionItem(itemComponent);
|
|
@@ -2957,43 +2968,24 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
2957
2968
|
var noNegativePosition = item.y > -1 && item.x > -1;
|
|
2958
2969
|
var maxGridCols = item.cols + item.x <= this.$options.maxCols;
|
|
2959
2970
|
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;
|
|
2971
|
+
var maxItemCols = item.maxItemCols === undefined ? this.$options.maxItemCols : item.maxItemCols;
|
|
2972
|
+
var minItemCols = item.minItemCols === undefined ? this.$options.minItemCols : item.minItemCols;
|
|
2973
|
+
var maxItemRows = item.maxItemRows === undefined ? this.$options.maxItemRows : item.maxItemRows;
|
|
2974
|
+
var minItemRows = item.minItemRows === undefined ? this.$options.minItemRows : item.minItemRows;
|
|
2972
2975
|
var inColsLimits = item.cols <= maxItemCols && item.cols >= minItemCols;
|
|
2973
2976
|
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;
|
|
2977
|
+
var minAreaLimit = item.minItemArea === undefined ? this.$options.minItemArea : item.minItemArea;
|
|
2978
|
+
var maxAreaLimit = item.maxItemArea === undefined ? this.$options.maxItemArea : item.maxItemArea;
|
|
2980
2979
|
var area = item.cols * item.rows;
|
|
2981
2980
|
var inMinArea = minAreaLimit <= area;
|
|
2982
2981
|
var inMaxArea = maxAreaLimit >= area;
|
|
2983
|
-
return !(noNegativePosition &&
|
|
2984
|
-
maxGridCols &&
|
|
2985
|
-
maxGridRows &&
|
|
2986
|
-
inColsLimits &&
|
|
2987
|
-
inRowsLimits &&
|
|
2988
|
-
inMinArea &&
|
|
2989
|
-
inMaxArea);
|
|
2982
|
+
return !(noNegativePosition && maxGridCols && maxGridRows && inColsLimits && inRowsLimits && inMinArea && inMaxArea);
|
|
2990
2983
|
};
|
|
2991
2984
|
GridsterComponent.prototype.findItemWithItem = function (item) {
|
|
2992
2985
|
var widgetsIndex = this.grid.length - 1, widget;
|
|
2993
2986
|
for (; widgetsIndex > -1; widgetsIndex--) {
|
|
2994
2987
|
widget = this.grid[widgetsIndex];
|
|
2995
|
-
if (widget.$item !== item &&
|
|
2996
|
-
GridsterComponent_1.checkCollisionTwoItems(widget.$item, item)) {
|
|
2988
|
+
if (widget.$item !== item && GridsterComponent_1.checkCollisionTwoItems(widget.$item, item)) {
|
|
2997
2989
|
return widget;
|
|
2998
2990
|
}
|
|
2999
2991
|
}
|
|
@@ -3004,8 +2996,7 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
3004
2996
|
var widgetsIndex = this.grid.length - 1, widget;
|
|
3005
2997
|
for (; widgetsIndex > -1; widgetsIndex--) {
|
|
3006
2998
|
widget = this.grid[widgetsIndex];
|
|
3007
|
-
if (widget.$item !== item &&
|
|
3008
|
-
GridsterComponent_1.checkCollisionTwoItems(widget.$item, item)) {
|
|
2999
|
+
if (widget.$item !== item && GridsterComponent_1.checkCollisionTwoItems(widget.$item, item)) {
|
|
3009
3000
|
a.push(widget);
|
|
3010
3001
|
}
|
|
3011
3002
|
}
|
|
@@ -3021,8 +3012,8 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
3021
3012
|
else {
|
|
3022
3013
|
itemComponent.notPlaced = true;
|
|
3023
3014
|
if (!this.$options.disableWarnings) {
|
|
3024
|
-
console.warn(
|
|
3025
|
-
JSON.stringify(itemComponent.item, [
|
|
3015
|
+
console.warn('Can\'t be placed in the bounds of the dashboard!/n' +
|
|
3016
|
+
JSON.stringify(itemComponent.item, ['cols', 'rows', 'x', 'y']));
|
|
3026
3017
|
}
|
|
3027
3018
|
}
|
|
3028
3019
|
};
|
|
@@ -3069,10 +3060,7 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
3069
3060
|
GridsterComponent.prototype.getLastPossiblePosition = function (item) {
|
|
3070
3061
|
var farthestItem = { y: 0, x: 0 };
|
|
3071
3062
|
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
|
-
};
|
|
3063
|
+
var currCoords = { y: curr.$item.y + curr.$item.rows - 1, x: curr.$item.x + curr.$item.cols - 1 };
|
|
3076
3064
|
if (GridsterUtils.compareItems(prev, currCoords) === 1) {
|
|
3077
3065
|
return currCoords;
|
|
3078
3066
|
}
|
|
@@ -3121,15 +3109,12 @@ var GridsterComponent = /** @class */ (function () {
|
|
|
3121
3109
|
], GridsterComponent.prototype, "options", void 0);
|
|
3122
3110
|
GridsterComponent = GridsterComponent_1 = __decorate([
|
|
3123
3111
|
Component({
|
|
3124
|
-
selector:
|
|
3112
|
+
selector: 'gridster',
|
|
3125
3113
|
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
3114
|
encapsulation: ViewEncapsulation.None,
|
|
3127
3115
|
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
3116
|
}),
|
|
3129
|
-
__metadata("design:paramtypes", [ElementRef,
|
|
3130
|
-
Renderer2,
|
|
3131
|
-
ChangeDetectorRef,
|
|
3132
|
-
NgZone])
|
|
3117
|
+
__metadata("design:paramtypes", [ElementRef, Renderer2, ChangeDetectorRef, NgZone])
|
|
3133
3118
|
], GridsterComponent);
|
|
3134
3119
|
return GridsterComponent;
|
|
3135
3120
|
}());
|