@schneideress/dashboardframework 0.0.9 → 0.0.11
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 +85 -48
- package/bundles/schneideress-dashboardframework.umd.js.map +1 -1
- package/bundles/schneideress-dashboardframework.umd.min.js +1 -1
- package/bundles/schneideress-dashboardframework.umd.min.js.map +1 -1
- package/esm2015/lib/custom.notifier.options.js +46 -0
- package/esm2015/lib/ra-dashboard-area/ra.dashboard.area.js +15 -5
- package/esm2015/lib/ra-widget-container/ra.widget.container.component.js +31 -20
- package/esm2015/lib/ra.dashboard.module.js +5 -2
- package/esm2015/lib/ra.dashboard.service.js +1 -8
- package/esm2015/lib/ra.event.enum.js +3 -1
- package/esm2015/schneideress-dashboardframework.js +2 -1
- package/esm5/lib/custom.notifier.options.js +46 -0
- package/esm5/lib/ra-dashboard-area/ra.dashboard.area.js +14 -5
- package/esm5/lib/ra-widget-container/ra.widget.container.component.js +30 -27
- package/esm5/lib/ra.dashboard.module.js +5 -2
- package/esm5/lib/ra.dashboard.service.js +1 -14
- package/esm5/lib/ra.event.enum.js +3 -1
- package/esm5/schneideress-dashboardframework.js +2 -1
- package/fesm2015/schneideress-dashboardframework.js +84 -32
- package/fesm2015/schneideress-dashboardframework.js.map +1 -1
- package/fesm5/schneideress-dashboardframework.js +82 -45
- package/fesm5/schneideress-dashboardframework.js.map +1 -1
- package/lib/custom.notifier.options.d.ts +2 -0
- package/lib/ra-dashboard-area/ra.dashboard.area.d.ts +3 -1
- package/lib/ra-widget-container/ra.widget.container.component.d.ts +4 -4
- package/lib/ra.dashboard.service.d.ts +0 -2
- package/lib/ra.event.enum.d.ts +3 -1
- package/package.json +1 -1
- package/schneideress-dashboardframework.d.ts +1 -0
- package/schneideress-dashboardframework.metadata.json +1 -1
|
@@ -4,6 +4,7 @@ import { of, Subject } from 'rxjs';
|
|
|
4
4
|
import { BaseService } from '@schneideress/ess-util';
|
|
5
5
|
import { filter, map } from 'rxjs/operators';
|
|
6
6
|
import { NgxUiLoaderService, NgxUiLoaderModule } from 'ngx-ui-loader';
|
|
7
|
+
import { NotifierService, NotifierModule } from 'angular-notifier';
|
|
7
8
|
import { BrowserModule } from '@angular/platform-browser';
|
|
8
9
|
import { HttpClientModule } from '@angular/common/http';
|
|
9
10
|
import { CommonModule } from '@angular/common';
|
|
@@ -203,19 +204,6 @@ var RaDashboardService = /** @class */ (function (_super) {
|
|
|
203
204
|
*/
|
|
204
205
|
function (widgetInfo) {
|
|
205
206
|
};
|
|
206
|
-
/** To Collapse current widget*/
|
|
207
|
-
/**
|
|
208
|
-
* To Collapse current widget
|
|
209
|
-
* @param {?} widgetInfo
|
|
210
|
-
* @return {?}
|
|
211
|
-
*/
|
|
212
|
-
RaDashboardService.prototype.collapse = /**
|
|
213
|
-
* To Collapse current widget
|
|
214
|
-
* @param {?} widgetInfo
|
|
215
|
-
* @return {?}
|
|
216
|
-
*/
|
|
217
|
-
function (widgetInfo) {
|
|
218
|
-
};
|
|
219
207
|
RaDashboardService.decorators = [
|
|
220
208
|
{ type: Injectable, args: [{
|
|
221
209
|
providedIn: 'root'
|
|
@@ -370,6 +358,8 @@ var RAEvent = {
|
|
|
370
358
|
LoadDashboard: "LoadDashboard",
|
|
371
359
|
/** triggers when user clicks on copywidget */
|
|
372
360
|
CopyWidget: "CopyWidget",
|
|
361
|
+
/**triggers when user clicks on Move widget */
|
|
362
|
+
MoveWidget: "MoveWidget",
|
|
373
363
|
};
|
|
374
364
|
/** @enum {string} */
|
|
375
365
|
var RAEventKey = {
|
|
@@ -475,10 +465,11 @@ var GridsterConfigDefaultSettings = {
|
|
|
475
465
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
476
466
|
*/
|
|
477
467
|
var RADashboardArea = /** @class */ (function () {
|
|
478
|
-
function RADashboardArea(dashboardService, ngZone, ngxService) {
|
|
468
|
+
function RADashboardArea(dashboardService, ngZone, ngxService, notifier) {
|
|
479
469
|
this.dashboardService = dashboardService;
|
|
480
470
|
this.ngZone = ngZone;
|
|
481
471
|
this.ngxService = ngxService;
|
|
472
|
+
this.notifier = notifier;
|
|
482
473
|
this.widgetList = Array();
|
|
483
474
|
this.gridheight = 300;
|
|
484
475
|
this.widgetHeight = 20;
|
|
@@ -663,6 +654,7 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
663
654
|
if (widget.length > 0) {
|
|
664
655
|
this.widgetList.splice(this.widgetList.indexOf(widget[0]), 1);
|
|
665
656
|
this.setAreaHeight();
|
|
657
|
+
this.notifier.notify('success', "Widget (" + widget[0].widgetInfo.widgetTitle + ") deleted successfully!");
|
|
666
658
|
}
|
|
667
659
|
};
|
|
668
660
|
/**To add widget instance to the database with the next available position and to make changes in
|
|
@@ -706,7 +698,7 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
706
698
|
gridsterItem = _this.mapObjectsToGridsterItem(widget);
|
|
707
699
|
_this.widgetList.push(gridsterItem);
|
|
708
700
|
_this.setAreaHeight();
|
|
709
|
-
|
|
701
|
+
//this.ngxService.stop();
|
|
710
702
|
}));
|
|
711
703
|
};
|
|
712
704
|
/**To map IwidgetInfo object to gridsterItem */
|
|
@@ -794,7 +786,7 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
794
786
|
RADashboardArea.decorators = [
|
|
795
787
|
{ type: Component, args: [{
|
|
796
788
|
selector: 'ra-dashboard-area',
|
|
797
|
-
template: "<div #gridWrapper class=\"wrap gridster\" [style.height.px]=\"gridheight\">\r\n<!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\">\r\n <gridster-item [item]=\"item\" *ngFor=\"let item of widgetList\">\r\n <ra-widget-container [app-config]=\"appConfig\" [event-bus]=\"raDashboardEventBus\" (widgetDeleted)=\"deleteWidget($event)\" [data]=\"item\"\r\n [global-filter]=\"globalFilter\" [widget-instance-id]=\"item.widgetInstanceId\"></ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n</div>\r\n\r\n",
|
|
789
|
+
template: "<div #gridWrapper class=\"wrap gridster\" [style.height.px]=\"gridheight\">\r\n<!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\">\r\n <gridster-item [item]=\"item\" *ngFor=\"let item of widgetList\">\r\n <ra-widget-container [app-config]=\"appConfig\" [event-bus]=\"raDashboardEventBus\" (widgetDeleted)=\"deleteWidget($event)\" [data]=\"item\"\r\n [global-filter]=\"globalFilter\" [widget-instance-id]=\"item.widgetInstanceId\"></ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n <notifier-container></notifier-container>\r\n</div>\r\n\r\n",
|
|
798
790
|
styles: ["gridster{width:inherit;resize:height;display:flex;min-height:600px}gridster-item{border:1px solid #ccc;background:#fff!important}.dvheader{width:100%;height:35px;background:#000;color:#fff;padding:7px 3px 5px 6px;text-transform:uppercase}"]
|
|
799
791
|
}] }
|
|
800
792
|
];
|
|
@@ -802,7 +794,8 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
802
794
|
RADashboardArea.ctorParameters = function () { return [
|
|
803
795
|
{ type: RaDashboardService },
|
|
804
796
|
{ type: NgZone },
|
|
805
|
-
{ type: NgxUiLoaderService }
|
|
797
|
+
{ type: NgxUiLoaderService },
|
|
798
|
+
{ type: NotifierService }
|
|
806
799
|
]; };
|
|
807
800
|
RADashboardArea.propDecorators = {
|
|
808
801
|
userDashboardId: [{ type: Input, args: ['user-dashboard-id',] }],
|
|
@@ -821,9 +814,10 @@ var RADashboardArea = /** @class */ (function () {
|
|
|
821
814
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
822
815
|
*/
|
|
823
816
|
var RAWidgetContainer = /** @class */ (function () {
|
|
824
|
-
function RAWidgetContainer(dashboardService, ngxService) {
|
|
817
|
+
function RAWidgetContainer(dashboardService, ngxService, notifier) {
|
|
825
818
|
this.dashboardService = dashboardService;
|
|
826
819
|
this.ngxService = ngxService;
|
|
820
|
+
this.notifier = notifier;
|
|
827
821
|
this.isIEOrEdge = /msie\s|trident\/|edge\//i.test(window.navigator.userAgent);
|
|
828
822
|
this.widgetDeleted = new EventEmitter();
|
|
829
823
|
}
|
|
@@ -906,24 +900,26 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
906
900
|
*/
|
|
907
901
|
function (status) {
|
|
908
902
|
widgetContainerContext.ngxService.stop();
|
|
909
|
-
{
|
|
903
|
+
if (status) {
|
|
910
904
|
widgetContainerContext.widgetDeleted.emit(_this.data.widgetInfo.widgetInstanceId);
|
|
911
905
|
}
|
|
906
|
+
else {
|
|
907
|
+
widgetContainerContext.notifier.notify('error', "Failed to remove widget (" + _this.data.widgetInfo.widgetTitle + ")!");
|
|
908
|
+
}
|
|
912
909
|
}));
|
|
913
910
|
};
|
|
914
911
|
/** To Move or change position if current widget container*/
|
|
915
912
|
/**
|
|
916
913
|
* To Move or change position if current widget container
|
|
917
|
-
* @param {?} widgetInfo
|
|
918
914
|
* @return {?}
|
|
919
915
|
*/
|
|
920
916
|
RAWidgetContainer.prototype.moveWidget = /**
|
|
921
917
|
* To Move or change position if current widget container
|
|
922
|
-
* @param {?} widgetInfo
|
|
923
918
|
* @return {?}
|
|
924
919
|
*/
|
|
925
|
-
function (
|
|
926
|
-
this.
|
|
920
|
+
function () {
|
|
921
|
+
this.raDashboardEventBus.publish(RAEvent.MoveWidget, this.data.widgetInfo);
|
|
922
|
+
// this.dashboardService.moveWidget(widgetInfo);
|
|
927
923
|
};
|
|
928
924
|
/** To Copy Current widget with same configuration*/
|
|
929
925
|
/**
|
|
@@ -938,20 +934,6 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
938
934
|
this.raDashboardEventBus.publish(RAEvent.CopyWidget, this.data.widgetInfo);
|
|
939
935
|
//this.dashboardService.copyWidget(widgetInfo);
|
|
940
936
|
};
|
|
941
|
-
/** To Collapse current widget*/
|
|
942
|
-
/**
|
|
943
|
-
* To Collapse current widget
|
|
944
|
-
* @param {?} widgetInfo
|
|
945
|
-
* @return {?}
|
|
946
|
-
*/
|
|
947
|
-
RAWidgetContainer.prototype.collapse = /**
|
|
948
|
-
* To Collapse current widget
|
|
949
|
-
* @param {?} widgetInfo
|
|
950
|
-
* @return {?}
|
|
951
|
-
*/
|
|
952
|
-
function (widgetInfo) {
|
|
953
|
-
this.dashboardService.collapse(widgetInfo);
|
|
954
|
-
};
|
|
955
937
|
/**
|
|
956
938
|
* @param {?} config
|
|
957
939
|
* @return {?}
|
|
@@ -1009,7 +991,13 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1009
991
|
widgetConfigFilter.appConfig = _this.appConfig;
|
|
1010
992
|
widgetConfigFilter.widgetInfo = (/** @type {?} */ ({}));
|
|
1011
993
|
widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
|
|
1012
|
-
widgetContainer.widgetElement.loadContent(widgetConfigFilter
|
|
994
|
+
widgetContainer.widgetElement.loadContent(widgetConfigFilter);
|
|
995
|
+
widgetContainer.widgetElement.addEventListener('load-data-initiated', (/**
|
|
996
|
+
* @param {?} hidePanel
|
|
997
|
+
* @return {?}
|
|
998
|
+
*/
|
|
999
|
+
function (hidePanel) {
|
|
1000
|
+
}));
|
|
1013
1001
|
}), 2000);
|
|
1014
1002
|
}));
|
|
1015
1003
|
};
|
|
@@ -1028,21 +1016,23 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1028
1016
|
/** @type {?} */
|
|
1029
1017
|
var widgetConfigFilter = (/** @type {?} */ ({
|
|
1030
1018
|
config: widgetInfo.widgetConfigInfo.config,
|
|
1031
|
-
globalFilter: this.globalFilter
|
|
1019
|
+
globalFilter: this.globalFilter,
|
|
1020
|
+
appConfig: this.appConfig
|
|
1032
1021
|
}));
|
|
1033
|
-
this.widgetElement.loadContent(widgetConfigFilter
|
|
1022
|
+
this.widgetElement.loadContent(widgetConfigFilter);
|
|
1034
1023
|
};
|
|
1035
1024
|
RAWidgetContainer.decorators = [
|
|
1036
1025
|
{ type: Component, args: [{
|
|
1037
1026
|
selector: 'ra-widget-container',
|
|
1038
|
-
template: "<div class=\"wc-wrapper\">\r\n <div class=\"wcheader\">\r\n <div class=\"col-md-12 wc-mover\">\r\n <div class=\"row\">\r\n <div class=\"col-md-11 float-left\" style=\"width:96%;\">{{data.widgetInfo.title?data.widgetInfo.title:\"Title\"}}\r\n </div>\r\n <div class=\"col-md-1\">\r\n <div class=\"float-right\">\r\n <div class=\"dropdown\">\r\n <div class=\"dropbtn\"> <i class=\"fal fa-cog\"></i></div>\r\n <div class=\"dropdown-content\">\r\n <a (click)=\"editWidget()\">Edit</a>\r\n <a (click)=\"copyWidget()\">Copy</a>\r\n <a (click)=\"moveWidget(
|
|
1039
|
-
styles: [".wcheader{width:100%;height:26px;background:#fff;color:#3dcd58;padding:7px 7px 0 6px;font-family:\"Arial Rounded MT\";border-bottom:1px solid;border-color:#fff;font-size:16px}.wc-mover{cursor:all-scroll}.wcBody{padding:8px}.wcBodyBorder{border:1px dashed #e6e2e2}.sp_icon{float:left;margin:0 15% 0 0}.dropbtn{cursor:pointer;color:#42b4e6}.dropdown{display:none;position:relative}.dropdown hr{margin:0!important}.dropdown-content{display:none;position:absolute;right:0;background-color:#f9f9f9;min-width:100px;box-shadow:0 8px 16px 8px rgba(0,0,0,.2);z-index:1;font-size:12px;font-family:\"Arial Rounded MT\"}.dropdown-content a{color:#000;padding:5px 16px;text-decoration:none;display:block;cursor:pointer}.dropdown-content a:hover{background-color:#f1f1f1}.dropdown:hover .dropdown-content,.wc-wrapper:hover .dropdown{display:block}.dropdown:hover .dropbtn{color:#2b7797}.hr{border:0;border-top:1px solid rgba(0,0,0,.1)}"]
|
|
1027
|
+
template: "<div class=\"wc-wrapper\">\r\n <div class=\"wcheader\">\r\n <div class=\"col-md-12 wc-mover\">\r\n <div class=\"row\">\r\n <div class=\"col-md-11 float-left\" style=\"width:96%;\">{{data.widgetInfo.title?data.widgetInfo.title:\"Title\"}}\r\n </div>\r\n <div class=\"col-md-1\">\r\n <div class=\"float-right\">\r\n <div class=\"dropdown\">\r\n <div class=\"dropbtn gearIcon\"> <i class=\"fal fa-cog\"></i></div>\r\n <div class=\"dropdown-content\">\r\n <a (click)=\"editWidget()\">Edit</a>\r\n <a (click)=\"copyWidget()\">Copy</a>\r\n <a (click)=\"moveWidget()\">Move</a> \r\n <hr class=\"hr\">\r\n <a (click)=\"deleteWidget()\">Delete</a>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"wcBody\">\r\n <div class=\"wcBodyBorder\" #ctlWidget></div>\r\n </div>\r\n</div>\r\n",
|
|
1028
|
+
styles: [".wcheader{width:100%;height:26px;background:#fff;color:#3dcd58;padding:7px 7px 0 6px;font-family:\"Arial Rounded MT\";border-bottom:1px solid;border-color:#fff;font-size:16px}.wc-mover{cursor:all-scroll}.wcBody{padding:8px}.wcBodyBorder{border:1px dashed #e6e2e2}.sp_icon{float:left;margin:0 15% 0 0}.dropbtn{cursor:pointer;color:#42b4e6}.dropdown{display:none;position:relative}.dropdown hr{margin:0!important}.dropdown-content{display:none;position:absolute;right:0;background-color:#f9f9f9;min-width:100px;box-shadow:0 8px 16px 8px rgba(0,0,0,.2);z-index:1;font-size:12px;font-family:\"Arial Rounded MT\"}.dropdown-content a{color:#000;padding:5px 16px;text-decoration:none;display:block;cursor:pointer}.dropdown-content a:hover{background-color:#f1f1f1}.dropdown:hover .dropdown-content,.wc-wrapper:hover .dropdown{display:block}.dropdown:hover .dropbtn{color:#2b7797}.gearIcon{color:#42b4e6}.hr{border:0;border-top:1px solid rgba(0,0,0,.1)}"]
|
|
1040
1029
|
}] }
|
|
1041
1030
|
];
|
|
1042
1031
|
/** @nocollapse */
|
|
1043
1032
|
RAWidgetContainer.ctorParameters = function () { return [
|
|
1044
1033
|
{ type: RaDashboardService },
|
|
1045
|
-
{ type: NgxUiLoaderService }
|
|
1034
|
+
{ type: NgxUiLoaderService },
|
|
1035
|
+
{ type: NotifierService }
|
|
1046
1036
|
]; };
|
|
1047
1037
|
RAWidgetContainer.propDecorators = {
|
|
1048
1038
|
ctlWidget: [{ type: ViewChild, args: ['ctlWidget', { static: false },] }],
|
|
@@ -1056,6 +1046,52 @@ var RAWidgetContainer = /** @class */ (function () {
|
|
|
1056
1046
|
return RAWidgetContainer;
|
|
1057
1047
|
}());
|
|
1058
1048
|
|
|
1049
|
+
/**
|
|
1050
|
+
* @fileoverview added by tsickle
|
|
1051
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1052
|
+
*/
|
|
1053
|
+
/** @type {?} */
|
|
1054
|
+
var customNotifierOptions = {
|
|
1055
|
+
position: {
|
|
1056
|
+
horizontal: {
|
|
1057
|
+
position: 'right',
|
|
1058
|
+
distance: 12
|
|
1059
|
+
},
|
|
1060
|
+
vertical: {
|
|
1061
|
+
position: 'top',
|
|
1062
|
+
distance: 12,
|
|
1063
|
+
gap: 10
|
|
1064
|
+
}
|
|
1065
|
+
},
|
|
1066
|
+
theme: 'material',
|
|
1067
|
+
behaviour: {
|
|
1068
|
+
autoHide: 5000,
|
|
1069
|
+
onClick: 'hide',
|
|
1070
|
+
onMouseover: 'pauseAutoHide',
|
|
1071
|
+
showDismissButton: true,
|
|
1072
|
+
stacking: 4
|
|
1073
|
+
},
|
|
1074
|
+
animations: {
|
|
1075
|
+
enabled: true,
|
|
1076
|
+
show: {
|
|
1077
|
+
preset: 'slide',
|
|
1078
|
+
speed: 300,
|
|
1079
|
+
easing: 'ease'
|
|
1080
|
+
},
|
|
1081
|
+
hide: {
|
|
1082
|
+
preset: 'fade',
|
|
1083
|
+
speed: 300,
|
|
1084
|
+
easing: 'ease',
|
|
1085
|
+
offset: 50
|
|
1086
|
+
},
|
|
1087
|
+
shift: {
|
|
1088
|
+
speed: 300,
|
|
1089
|
+
easing: 'ease'
|
|
1090
|
+
},
|
|
1091
|
+
overlap: 150
|
|
1092
|
+
}
|
|
1093
|
+
};
|
|
1094
|
+
|
|
1059
1095
|
/**
|
|
1060
1096
|
* @fileoverview added by tsickle
|
|
1061
1097
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -5571,7 +5607,8 @@ var DashboardFrameworkModule = /** @class */ (function () {
|
|
|
5571
5607
|
BrowserModule,
|
|
5572
5608
|
GridsterModule,
|
|
5573
5609
|
HttpClientModule,
|
|
5574
|
-
NgxUiLoaderModule
|
|
5610
|
+
NgxUiLoaderModule,
|
|
5611
|
+
NotifierModule.withConfig(customNotifierOptions)
|
|
5575
5612
|
],
|
|
5576
5613
|
exports: [
|
|
5577
5614
|
RADashboardArea
|
|
@@ -5644,5 +5681,5 @@ var RaBaseDashboardFilter = /** @class */ (function () {
|
|
|
5644
5681
|
return RaBaseDashboardFilter;
|
|
5645
5682
|
}());
|
|
5646
5683
|
|
|
5647
|
-
export { DashboardFrameworkModule, RADashboardArea, RADashboardEventBus, RAEvent, RAEventKey, RAWidgetContainer, RaBaseDashboardFilter, RaBaseDashboardTemplate, RaDashboardService, GridsterModule as ɵa, GridsterComponent as ɵb, GridsterItemComponent as ɵc, GridsterPreviewComponent as ɵd };
|
|
5684
|
+
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 };
|
|
5648
5685
|
//# sourceMappingURL=schneideress-dashboardframework.js.map
|