@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.
Files changed (30) hide show
  1. package/bundles/schneideress-dashboardframework.umd.js +85 -48
  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 +31 -20
  8. package/esm2015/lib/ra.dashboard.module.js +5 -2
  9. package/esm2015/lib/ra.dashboard.service.js +1 -8
  10. package/esm2015/lib/ra.event.enum.js +3 -1
  11. package/esm2015/schneideress-dashboardframework.js +2 -1
  12. package/esm5/lib/custom.notifier.options.js +46 -0
  13. package/esm5/lib/ra-dashboard-area/ra.dashboard.area.js +14 -5
  14. package/esm5/lib/ra-widget-container/ra.widget.container.component.js +30 -27
  15. package/esm5/lib/ra.dashboard.module.js +5 -2
  16. package/esm5/lib/ra.dashboard.service.js +1 -14
  17. package/esm5/lib/ra.event.enum.js +3 -1
  18. package/esm5/schneideress-dashboardframework.js +2 -1
  19. package/fesm2015/schneideress-dashboardframework.js +84 -32
  20. package/fesm2015/schneideress-dashboardframework.js.map +1 -1
  21. package/fesm5/schneideress-dashboardframework.js +82 -45
  22. package/fesm5/schneideress-dashboardframework.js.map +1 -1
  23. package/lib/custom.notifier.options.d.ts +2 -0
  24. package/lib/ra-dashboard-area/ra.dashboard.area.d.ts +3 -1
  25. package/lib/ra-widget-container/ra.widget.container.component.d.ts +4 -4
  26. package/lib/ra.dashboard.service.d.ts +0 -2
  27. package/lib/ra.event.enum.d.ts +3 -1
  28. package/package.json +1 -1
  29. package/schneideress-dashboardframework.d.ts +1 -0
  30. package/schneideress-dashboardframework.metadata.json +1 -1
@@ -3,6 +3,7 @@ import { of, Subject } from 'rxjs';
3
3
  import { BaseService } from '@schneideress/ess-util';
4
4
  import { filter, map } from 'rxjs/operators';
5
5
  import { NgxUiLoaderService, NgxUiLoaderModule } from 'ngx-ui-loader';
6
+ import { NotifierService, NotifierModule } from 'angular-notifier';
6
7
  import { BrowserModule } from '@angular/platform-browser';
7
8
  import { HttpClientModule } from '@angular/common/http';
8
9
  import { CommonModule } from '@angular/common';
@@ -128,13 +129,6 @@ class RaDashboardService extends BaseService {
128
129
  */
129
130
  copyWidget(widgetInfo) {
130
131
  }
131
- /**
132
- * To Collapse current widget
133
- * @param {?} widgetInfo
134
- * @return {?}
135
- */
136
- collapse(widgetInfo) {
137
- }
138
132
  }
139
133
  RaDashboardService.decorators = [
140
134
  { type: Injectable, args: [{
@@ -249,6 +243,8 @@ const RAEvent = {
249
243
  LoadDashboard: "LoadDashboard",
250
244
  /** triggers when user clicks on copywidget */
251
245
  CopyWidget: "CopyWidget",
246
+ /**triggers when user clicks on Move widget */
247
+ MoveWidget: "MoveWidget",
252
248
  };
253
249
  /** @enum {string} */
254
250
  const RAEventKey = {
@@ -358,11 +354,13 @@ class RADashboardArea {
358
354
  * @param {?} dashboardService
359
355
  * @param {?} ngZone
360
356
  * @param {?} ngxService
357
+ * @param {?} notifier
361
358
  */
362
- constructor(dashboardService, ngZone, ngxService) {
359
+ constructor(dashboardService, ngZone, ngxService, notifier) {
363
360
  this.dashboardService = dashboardService;
364
361
  this.ngZone = ngZone;
365
362
  this.ngxService = ngxService;
363
+ this.notifier = notifier;
366
364
  this.widgetList = Array();
367
365
  this.gridheight = 300;
368
366
  this.widgetHeight = 20;
@@ -509,6 +507,7 @@ class RADashboardArea {
509
507
  if (widget.length > 0) {
510
508
  this.widgetList.splice(this.widgetList.indexOf(widget[0]), 1);
511
509
  this.setAreaHeight();
510
+ this.notifier.notify('success', "Widget (" + widget[0].widgetInfo.widgetTitle + ") deleted successfully!");
512
511
  }
513
512
  }
514
513
  /**
@@ -542,7 +541,7 @@ class RADashboardArea {
542
541
  gridsterItem = this.mapObjectsToGridsterItem(widget);
543
542
  this.widgetList.push(gridsterItem);
544
543
  this.setAreaHeight();
545
- this.ngxService.stop();
544
+ //this.ngxService.stop();
546
545
  }));
547
546
  }
548
547
  /**
@@ -611,7 +610,7 @@ class RADashboardArea {
611
610
  RADashboardArea.decorators = [
612
611
  { type: Component, args: [{
613
612
  selector: 'ra-dashboard-area',
614
- 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",
613
+ 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",
615
614
  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}"]
616
615
  }] }
617
616
  ];
@@ -619,7 +618,8 @@ RADashboardArea.decorators = [
619
618
  RADashboardArea.ctorParameters = () => [
620
619
  { type: RaDashboardService },
621
620
  { type: NgZone },
622
- { type: NgxUiLoaderService }
621
+ { type: NgxUiLoaderService },
622
+ { type: NotifierService }
623
623
  ];
624
624
  RADashboardArea.propDecorators = {
625
625
  userDashboardId: [{ type: Input, args: ['user-dashboard-id',] }],
@@ -639,10 +639,12 @@ class RAWidgetContainer {
639
639
  /**
640
640
  * @param {?} dashboardService
641
641
  * @param {?} ngxService
642
+ * @param {?} notifier
642
643
  */
643
- constructor(dashboardService, ngxService) {
644
+ constructor(dashboardService, ngxService, notifier) {
644
645
  this.dashboardService = dashboardService;
645
646
  this.ngxService = ngxService;
647
+ this.notifier = notifier;
646
648
  this.isIEOrEdge = /msie\s|trident\/|edge\//i.test(window.navigator.userAgent);
647
649
  this.widgetDeleted = new EventEmitter();
648
650
  }
@@ -702,18 +704,21 @@ class RAWidgetContainer {
702
704
  */
703
705
  status => {
704
706
  widgetContainerContext.ngxService.stop();
705
- {
707
+ if (status) {
706
708
  widgetContainerContext.widgetDeleted.emit(this.data.widgetInfo.widgetInstanceId);
707
709
  }
710
+ else {
711
+ widgetContainerContext.notifier.notify('error', "Failed to remove widget (" + this.data.widgetInfo.widgetTitle + ")!");
712
+ }
708
713
  }));
709
714
  }
710
715
  /**
711
716
  * To Move or change position if current widget container
712
- * @param {?} widgetInfo
713
717
  * @return {?}
714
718
  */
715
- moveWidget(widgetInfo) {
716
- this.dashboardService.moveWidget(widgetInfo);
719
+ moveWidget() {
720
+ this.raDashboardEventBus.publish(RAEvent.MoveWidget, this.data.widgetInfo);
721
+ // this.dashboardService.moveWidget(widgetInfo);
717
722
  }
718
723
  /**
719
724
  * To Copy Current widget with same configuration
@@ -723,14 +728,6 @@ class RAWidgetContainer {
723
728
  this.raDashboardEventBus.publish(RAEvent.CopyWidget, this.data.widgetInfo);
724
729
  //this.dashboardService.copyWidget(widgetInfo);
725
730
  }
726
- /**
727
- * To Collapse current widget
728
- * @param {?} widgetInfo
729
- * @return {?}
730
- */
731
- collapse(widgetInfo) {
732
- this.dashboardService.collapse(widgetInfo);
733
- }
734
731
  /**
735
732
  * @param {?} config
736
733
  * @return {?}
@@ -773,7 +770,13 @@ class RAWidgetContainer {
773
770
  widgetConfigFilter.appConfig = this.appConfig;
774
771
  widgetConfigFilter.widgetInfo = (/** @type {?} */ ({}));
775
772
  widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
776
- widgetContainer.widgetElement.loadContent(widgetConfigFilter, this.appConfig);
773
+ widgetContainer.widgetElement.loadContent(widgetConfigFilter);
774
+ widgetContainer.widgetElement.addEventListener('load-data-initiated', (/**
775
+ * @param {?} hidePanel
776
+ * @return {?}
777
+ */
778
+ (hidePanel) => {
779
+ }));
777
780
  }), 2000);
778
781
  }));
779
782
  }
@@ -786,22 +789,24 @@ class RAWidgetContainer {
786
789
  /** @type {?} */
787
790
  let widgetConfigFilter = (/** @type {?} */ ({
788
791
  config: widgetInfo.widgetConfigInfo.config,
789
- globalFilter: this.globalFilter
792
+ globalFilter: this.globalFilter,
793
+ appConfig: this.appConfig
790
794
  }));
791
- this.widgetElement.loadContent(widgetConfigFilter, this.appConfig);
795
+ this.widgetElement.loadContent(widgetConfigFilter);
792
796
  }
793
797
  }
794
798
  RAWidgetContainer.decorators = [
795
799
  { type: Component, args: [{
796
800
  selector: 'ra-widget-container',
797
- 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(data)\">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",
798
- 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)}"]
801
+ 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",
802
+ 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)}"]
799
803
  }] }
800
804
  ];
801
805
  /** @nocollapse */
802
806
  RAWidgetContainer.ctorParameters = () => [
803
807
  { type: RaDashboardService },
804
- { type: NgxUiLoaderService }
808
+ { type: NgxUiLoaderService },
809
+ { type: NotifierService }
805
810
  ];
806
811
  RAWidgetContainer.propDecorators = {
807
812
  ctlWidget: [{ type: ViewChild, args: ['ctlWidget', { static: false },] }],
@@ -813,6 +818,52 @@ RAWidgetContainer.propDecorators = {
813
818
  widgetDeleted: [{ type: Output }]
814
819
  };
815
820
 
821
+ /**
822
+ * @fileoverview added by tsickle
823
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
824
+ */
825
+ /** @type {?} */
826
+ const customNotifierOptions = {
827
+ position: {
828
+ horizontal: {
829
+ position: 'right',
830
+ distance: 12
831
+ },
832
+ vertical: {
833
+ position: 'top',
834
+ distance: 12,
835
+ gap: 10
836
+ }
837
+ },
838
+ theme: 'material',
839
+ behaviour: {
840
+ autoHide: 5000,
841
+ onClick: 'hide',
842
+ onMouseover: 'pauseAutoHide',
843
+ showDismissButton: true,
844
+ stacking: 4
845
+ },
846
+ animations: {
847
+ enabled: true,
848
+ show: {
849
+ preset: 'slide',
850
+ speed: 300,
851
+ easing: 'ease'
852
+ },
853
+ hide: {
854
+ preset: 'fade',
855
+ speed: 300,
856
+ easing: 'ease',
857
+ offset: 50
858
+ },
859
+ shift: {
860
+ speed: 300,
861
+ easing: 'ease'
862
+ },
863
+ overlap: 150
864
+ }
865
+ };
866
+
816
867
  /**
817
868
  * @fileoverview added by tsickle
818
869
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -4757,7 +4808,8 @@ DashboardFrameworkModule.decorators = [
4757
4808
  BrowserModule,
4758
4809
  GridsterModule,
4759
4810
  HttpClientModule,
4760
- NgxUiLoaderModule
4811
+ NgxUiLoaderModule,
4812
+ NotifierModule.withConfig(customNotifierOptions)
4761
4813
  ],
4762
4814
  exports: [
4763
4815
  RADashboardArea
@@ -4827,5 +4879,5 @@ RaBaseDashboardFilter.propDecorators = {
4827
4879
  getAllFilterConfig: [{ type: Input }]
4828
4880
  };
4829
4881
 
4830
- export { DashboardFrameworkModule, RADashboardArea, RADashboardEventBus, RAEvent, RAEventKey, RAWidgetContainer, RaBaseDashboardFilter, RaBaseDashboardTemplate, RaDashboardService, GridsterModule as ɵa, GridsterComponent as ɵb, GridsterItemComponent as ɵc, GridsterPreviewComponent as ɵd };
4882
+ 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 };
4831
4883
  //# sourceMappingURL=schneideress-dashboardframework.js.map