@schneideress/dashboardframework 0.0.10 → 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.
Files changed (27) hide show
  1. package/bundles/schneideress-dashboardframework.umd.js +70 -28
  2. package/bundles/schneideress-dashboardframework.umd.js.map +1 -1
  3. package/bundles/schneideress-dashboardframework.umd.min.js +1 -1
  4. package/bundles/schneideress-dashboardframework.umd.min.js.map +1 -1
  5. package/esm2015/lib/custom.notifier.options.js +46 -0
  6. package/esm2015/lib/ra-dashboard-area/ra.dashboard.area.js +15 -5
  7. package/esm2015/lib/ra-widget-container/ra.widget.container.component.js +18 -7
  8. package/esm2015/lib/ra.dashboard.module.js +5 -2
  9. package/esm2015/lib/ra.dashboard.service.js +1 -8
  10. package/esm2015/schneideress-dashboardframework.js +2 -1
  11. package/esm5/lib/custom.notifier.options.js +46 -0
  12. package/esm5/lib/ra-dashboard-area/ra.dashboard.area.js +14 -5
  13. package/esm5/lib/ra-widget-container/ra.widget.container.component.js +17 -7
  14. package/esm5/lib/ra.dashboard.module.js +5 -2
  15. package/esm5/lib/ra.dashboard.service.js +1 -14
  16. package/esm5/schneideress-dashboardframework.js +2 -1
  17. package/fesm2015/schneideress-dashboardframework.js +69 -19
  18. package/fesm2015/schneideress-dashboardframework.js.map +1 -1
  19. package/fesm5/schneideress-dashboardframework.js +67 -25
  20. package/fesm5/schneideress-dashboardframework.js.map +1 -1
  21. package/lib/custom.notifier.options.d.ts +2 -0
  22. package/lib/ra-dashboard-area/ra.dashboard.area.d.ts +3 -1
  23. package/lib/ra-widget-container/ra.widget.container.component.d.ts +3 -1
  24. package/lib/ra.dashboard.service.d.ts +0 -2
  25. package/package.json +1 -1
  26. package/schneideress-dashboardframework.d.ts +1 -0
  27. 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'
@@ -477,10 +465,11 @@ var GridsterConfigDefaultSettings = {
477
465
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
478
466
  */
479
467
  var RADashboardArea = /** @class */ (function () {
480
- function RADashboardArea(dashboardService, ngZone, ngxService) {
468
+ function RADashboardArea(dashboardService, ngZone, ngxService, notifier) {
481
469
  this.dashboardService = dashboardService;
482
470
  this.ngZone = ngZone;
483
471
  this.ngxService = ngxService;
472
+ this.notifier = notifier;
484
473
  this.widgetList = Array();
485
474
  this.gridheight = 300;
486
475
  this.widgetHeight = 20;
@@ -665,6 +654,7 @@ var RADashboardArea = /** @class */ (function () {
665
654
  if (widget.length > 0) {
666
655
  this.widgetList.splice(this.widgetList.indexOf(widget[0]), 1);
667
656
  this.setAreaHeight();
657
+ this.notifier.notify('success', "Widget (" + widget[0].widgetInfo.widgetTitle + ") deleted successfully!");
668
658
  }
669
659
  };
670
660
  /**To add widget instance to the database with the next available position and to make changes in
@@ -708,7 +698,7 @@ var RADashboardArea = /** @class */ (function () {
708
698
  gridsterItem = _this.mapObjectsToGridsterItem(widget);
709
699
  _this.widgetList.push(gridsterItem);
710
700
  _this.setAreaHeight();
711
- _this.ngxService.stop();
701
+ //this.ngxService.stop();
712
702
  }));
713
703
  };
714
704
  /**To map IwidgetInfo object to gridsterItem */
@@ -796,7 +786,7 @@ var RADashboardArea = /** @class */ (function () {
796
786
  RADashboardArea.decorators = [
797
787
  { type: Component, args: [{
798
788
  selector: 'ra-dashboard-area',
799
- 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",
800
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}"]
801
791
  }] }
802
792
  ];
@@ -804,7 +794,8 @@ var RADashboardArea = /** @class */ (function () {
804
794
  RADashboardArea.ctorParameters = function () { return [
805
795
  { type: RaDashboardService },
806
796
  { type: NgZone },
807
- { type: NgxUiLoaderService }
797
+ { type: NgxUiLoaderService },
798
+ { type: NotifierService }
808
799
  ]; };
809
800
  RADashboardArea.propDecorators = {
810
801
  userDashboardId: [{ type: Input, args: ['user-dashboard-id',] }],
@@ -823,9 +814,10 @@ var RADashboardArea = /** @class */ (function () {
823
814
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
824
815
  */
825
816
  var RAWidgetContainer = /** @class */ (function () {
826
- function RAWidgetContainer(dashboardService, ngxService) {
817
+ function RAWidgetContainer(dashboardService, ngxService, notifier) {
827
818
  this.dashboardService = dashboardService;
828
819
  this.ngxService = ngxService;
820
+ this.notifier = notifier;
829
821
  this.isIEOrEdge = /msie\s|trident\/|edge\//i.test(window.navigator.userAgent);
830
822
  this.widgetDeleted = new EventEmitter();
831
823
  }
@@ -908,9 +900,12 @@ var RAWidgetContainer = /** @class */ (function () {
908
900
  */
909
901
  function (status) {
910
902
  widgetContainerContext.ngxService.stop();
911
- {
903
+ if (status) {
912
904
  widgetContainerContext.widgetDeleted.emit(_this.data.widgetInfo.widgetInstanceId);
913
905
  }
906
+ else {
907
+ widgetContainerContext.notifier.notify('error', "Failed to remove widget (" + _this.data.widgetInfo.widgetTitle + ")!");
908
+ }
914
909
  }));
915
910
  };
916
911
  /** To Move or change position if current widget container*/
@@ -923,7 +918,6 @@ var RAWidgetContainer = /** @class */ (function () {
923
918
  * @return {?}
924
919
  */
925
920
  function () {
926
- console.log('in move widget');
927
921
  this.raDashboardEventBus.publish(RAEvent.MoveWidget, this.data.widgetInfo);
928
922
  // this.dashboardService.moveWidget(widgetInfo);
929
923
  };
@@ -1030,14 +1024,15 @@ var RAWidgetContainer = /** @class */ (function () {
1030
1024
  RAWidgetContainer.decorators = [
1031
1025
  { type: Component, args: [{
1032
1026
  selector: 'ra-widget-container',
1033
- 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()\">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",
1034
- 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)}"]
1035
1029
  }] }
1036
1030
  ];
1037
1031
  /** @nocollapse */
1038
1032
  RAWidgetContainer.ctorParameters = function () { return [
1039
1033
  { type: RaDashboardService },
1040
- { type: NgxUiLoaderService }
1034
+ { type: NgxUiLoaderService },
1035
+ { type: NotifierService }
1041
1036
  ]; };
1042
1037
  RAWidgetContainer.propDecorators = {
1043
1038
  ctlWidget: [{ type: ViewChild, args: ['ctlWidget', { static: false },] }],
@@ -1051,6 +1046,52 @@ var RAWidgetContainer = /** @class */ (function () {
1051
1046
  return RAWidgetContainer;
1052
1047
  }());
1053
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
+
1054
1095
  /**
1055
1096
  * @fileoverview added by tsickle
1056
1097
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -5566,7 +5607,8 @@ var DashboardFrameworkModule = /** @class */ (function () {
5566
5607
  BrowserModule,
5567
5608
  GridsterModule,
5568
5609
  HttpClientModule,
5569
- NgxUiLoaderModule
5610
+ NgxUiLoaderModule,
5611
+ NotifierModule.withConfig(customNotifierOptions)
5570
5612
  ],
5571
5613
  exports: [
5572
5614
  RADashboardArea
@@ -5639,5 +5681,5 @@ var RaBaseDashboardFilter = /** @class */ (function () {
5639
5681
  return RaBaseDashboardFilter;
5640
5682
  }());
5641
5683
 
5642
- 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 };
5643
5685
  //# sourceMappingURL=schneideress-dashboardframework.js.map