@schneideress/dashboardframework 0.0.202 → 0.0.204

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.
@@ -555,37 +555,38 @@ var RADashboardResponsiveService = /** @class */ (function () {
555
555
  enumerable: true,
556
556
  configurable: true
557
557
  });
558
- Object.defineProperty(RADashboardResponsiveService.prototype, "GridsterConfig", {
559
- get: /**
560
- * @return {?}
561
- */
562
- function () {
563
- /** @type {?} */
564
- var config = GridsterConfigDefaultSettings;
565
- config.minCols = this.currentResInfo.maxCols;
566
- config.maxCols = this.currentResInfo.maxCols;
567
- config.minRows = this.currentResInfo.minCols;
568
- config.maxItemCols = this.currentResInfo.maxCols;
569
- config.minItemCols = this.currentResInfo.minCols;
570
- config.minItemRows = this.currentResInfo.minCols;
571
- config.minItemArea = this.currentResInfo.minCols * this.currentResInfo.minCols;
572
- config.defaultItemCols = this.currentResInfo.minCols;
573
- config.defaultItemRows = this.currentResInfo.minCols;
574
- if (!this.IsDesktopView) {
575
- config.resizable.enabled = false;
576
- config.swap = false;
577
- config.draggable.enabled = false;
578
- }
579
- else {
580
- config.resizable.enabled = true;
581
- config.swap = true;
582
- config.draggable.enabled = true;
583
- }
584
- return config;
585
- },
586
- enumerable: true,
587
- configurable: true
588
- });
558
+ /**
559
+ * @param {?} isWidgetMgmnt
560
+ * @return {?}
561
+ */
562
+ RADashboardResponsiveService.prototype.getGridsterConfig = /**
563
+ * @param {?} isWidgetMgmnt
564
+ * @return {?}
565
+ */
566
+ function (isWidgetMgmnt) {
567
+ /** @type {?} */
568
+ var config = GridsterConfigDefaultSettings;
569
+ config.minCols = this.currentResInfo.maxCols;
570
+ config.maxCols = this.currentResInfo.maxCols;
571
+ config.minRows = this.currentResInfo.minCols;
572
+ config.maxItemCols = this.currentResInfo.maxCols;
573
+ config.minItemCols = this.currentResInfo.minCols;
574
+ config.minItemRows = this.currentResInfo.minCols;
575
+ config.minItemArea = this.currentResInfo.minCols * this.currentResInfo.minCols;
576
+ config.defaultItemCols = this.currentResInfo.minCols;
577
+ config.defaultItemRows = this.currentResInfo.minCols;
578
+ if (!this.IsDesktopView || !isWidgetMgmnt) {
579
+ config.resizable.enabled = false;
580
+ config.swap = false;
581
+ config.draggable.enabled = false;
582
+ }
583
+ else {
584
+ config.resizable.enabled = true;
585
+ config.swap = true;
586
+ config.draggable.enabled = true;
587
+ }
588
+ return config;
589
+ };
589
590
  /**To map IwidgetInfo object to gridsterItem */
590
591
  /**
591
592
  * To map IwidgetInfo object to gridsterItem
@@ -734,7 +735,7 @@ var RADashboardArea = /** @class */ (function () {
734
735
  this.isWidgetLoaded = false;
735
736
  this.domResized = false;
736
737
  this.showEmptyDashboard = false;
737
- this.isDashboardMgmnt = false;
738
+ this.isWidgetMgmnt = false;
738
739
  this.widgetHeight = 2;
739
740
  this.widgetWidth = 4;
740
741
  this.hideDashboardBanner = new EventEmitter();
@@ -747,6 +748,7 @@ var RADashboardArea = /** @class */ (function () {
747
748
  */
748
749
  function () {
749
750
  var _this = this;
751
+ this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
750
752
  this.initiateGridsterConfig();
751
753
  this.responsiveService.resized.subscribe((/**
752
754
  * @return {?}
@@ -784,7 +786,7 @@ var RADashboardArea = /** @class */ (function () {
784
786
  * @return {?}
785
787
  */
786
788
  function (changes) {
787
- this.isDashboardMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
789
+ this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
788
790
  if (this.raDashboardEventBus && this.appConfig && !this.isWidgetLoaded) {
789
791
  this.isWidgetLoaded = true;
790
792
  this.loadWidgets(this.userDashboardId, this.areaKey);
@@ -805,7 +807,7 @@ var RADashboardArea = /** @class */ (function () {
805
807
  function () {
806
808
  var _this = this;
807
809
  /**To override default configuration values to the gridster control */
808
- this.options = this.responsiveService.GridsterConfig;
810
+ this.options = this.responsiveService.getGridsterConfig(this.isWidgetMgmnt);
809
811
  this.options.initCallback = (/**
810
812
  * @param {?} gridster
811
813
  * @return {?}
@@ -1411,7 +1413,7 @@ var RADashboardArea = /** @class */ (function () {
1411
1413
  RADashboardArea.decorators = [
1412
1414
  { type: Component, args: [{
1413
1415
  selector: 'ra-dashboard-area',
1414
- 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 </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=\"isDashboardMgmnt\" 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>",
1416
+ 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 </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>",
1415
1417
  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;-ms-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}}"]
1416
1418
  }] }
1417
1419
  ];
@@ -1484,7 +1486,7 @@ if (false) {
1484
1486
  /** @type {?} */
1485
1487
  RADashboardArea.prototype.showEmptyDashboard;
1486
1488
  /** @type {?} */
1487
- RADashboardArea.prototype.isDashboardMgmnt;
1489
+ RADashboardArea.prototype.isWidgetMgmnt;
1488
1490
  /** @type {?} */
1489
1491
  RADashboardArea.prototype.userDashboardId;
1490
1492
  /** @type {?} */