@schneideress/dashboardframework 0.0.33 → 0.0.35

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.
@@ -5,8 +5,10 @@ import { filter, map } from 'rxjs/operators';
5
5
  import { NgxUiLoaderService, NgxUiLoaderModule } from 'ngx-ui-loader';
6
6
  import { NotifierService, NotifierModule } from 'angular-notifier';
7
7
  import { TranslateService, TranslateModule } from '@schneideress/ess-base';
8
+ import { __awaiter } from 'tslib';
8
9
  import { BrowserModule } from '@angular/platform-browser';
9
10
  import { HttpClientModule } from '@angular/common/http';
11
+ import { PerfectScrollbarModule, PERFECT_SCROLLBAR_CONFIG } from 'ngx-perfect-scrollbar';
10
12
  import { CommonModule } from '@angular/common';
11
13
 
12
14
  /**
@@ -268,6 +270,8 @@ const RAEvent = {
268
270
  widgetLibraryDoneClick: "widgetLibraryDoneClick",
269
271
  /**refresh favorite icon after srtting and resetting favorites */
270
272
  favoriteIconRefresh: "favoriteIconRefresh",
273
+ /**to refresh menu content */
274
+ QuickLinkRefresh: "QuickLinkRefresh",
271
275
  };
272
276
  /** @enum {string} */
273
277
  const RAEventKey = {
@@ -763,6 +767,11 @@ class RADashboardArea {
763
767
  let areaScrollHeight = 0;
764
768
  /** @type {?} */
765
769
  let areaHeight = 0;
770
+ /** @type {?} */
771
+ let curRowHeight = 0;
772
+ if (this.options.api) {
773
+ curRowHeight = this.options.api.getCurrentRowHeight();
774
+ }
766
775
  this.widgetList.forEach((/**
767
776
  * @param {?} t
768
777
  * @return {?}
@@ -773,6 +782,10 @@ class RADashboardArea {
773
782
  if (currentHeight > areaScrollHeight) {
774
783
  areaScrollHeight = currentHeight;
775
784
  }
785
+ if (curRowHeight == 0) {
786
+ currentHeight = this.widgetList[0].curRowHeight;
787
+ }
788
+ t.widgetInfo.rowHeight = curRowHeight;
776
789
  }));
777
790
  if (this.options.api) {
778
791
  areaHeight = areaScrollHeight * this.options.api.getCurrentRowHeight() + 2;
@@ -900,6 +913,7 @@ class RADashboardArea {
900
913
  widget.width = widgetItem.cols;
901
914
  widget.position_x = widgetItem.x;
902
915
  widget.position_y = widgetItem.y;
916
+ widget.rowHeight = widgetItem.curRowHeight;
903
917
  return widget;
904
918
  }
905
919
  /**
@@ -922,7 +936,7 @@ class RADashboardArea {
922
936
  RADashboardArea.decorators = [
923
937
  { type: Component, args: [{
924
938
  selector: 'ra-dashboard-area',
925
- 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-width]=\"item.cols\" [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",
939
+ 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-width]=\"item.cols\" [widget-height]=\"item.rows\" [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",
926
940
  styles: ["gridster{width:inherit;resize:height;display:flex}gridster-item{background:#fff!important}.dvheader{width:100%;height:35px;background:#000;color:#fff;padding:7px 3px 5px 6px;text-transform:uppercase}"]
927
941
  }] }
928
942
  ];
@@ -1036,8 +1050,7 @@ class RAWidgetContainer {
1036
1050
  this.notifier = notifier;
1037
1051
  this.isWidgetLoaded = false;
1038
1052
  this.isIEOrEdge = /msie\s|trident\/|edge\//i.test(window.navigator.userAgent);
1039
- this.lockStatus = "unlock";
1040
- this.lockClass = "unlock";
1053
+ this.lockClass = "unlocked";
1041
1054
  this.widgetDeleted = new EventEmitter();
1042
1055
  }
1043
1056
  /**
@@ -1062,11 +1075,14 @@ class RAWidgetContainer {
1062
1075
  if (this.widgetElement && changes.globalFilter && changes.globalFilter.currentValue != changes.globalFilter.previousValue) {
1063
1076
  this.refreshWidget(this.data.widgetInfo);
1064
1077
  }
1065
- if (changes.widgetWidth && changes.widgetWidth.currentValue != changes.widgetWidth.previousValue) {
1078
+ if (changes.width && changes.width.currentValue != changes.width.previousValue) {
1066
1079
  this.data.widgetInfo.isDimensionUpdate = true;
1067
1080
  this.refreshWidget(this.data.widgetInfo);
1068
1081
  this.data.widgetInfo.isDimensionUpdate = false;
1069
1082
  }
1083
+ if (changes.height && changes.height.currentValue != changes.height.previousValue) {
1084
+ this.setWidgetheight();
1085
+ }
1070
1086
  }
1071
1087
  /**
1072
1088
  * @return {?}
@@ -1140,37 +1156,48 @@ class RAWidgetContainer {
1140
1156
  this.refreshWidget(this.data.widgetInfo);
1141
1157
  // this.updateWidget(widgetInfo);
1142
1158
  }
1159
+ /**
1160
+ * @return {?}
1161
+ */
1162
+ setWidgetheight() {
1163
+ this.widgetHeight = this.data.widgetInfo.height * this.data.widgetInfo.rowHeight + 2;
1164
+ }
1143
1165
  /**
1144
1166
  * To load external custom element to the widget container
1145
1167
  * @param {?} widgetInfo
1146
1168
  * @return {?}
1147
1169
  */
1148
1170
  loadWidget(widgetInfo) {
1149
- /** @type {?} */
1150
- let widgetConfigFilter = (/** @type {?} */ ({
1151
- config: widgetInfo.widgetConfigInfo.config,
1152
- globalFilter: this.globalFilter
1153
- }));
1154
- /** @type {?} */
1155
- let widgetContainer = this;
1156
- this.dashboardService.loadExternalScript(widgetInfo.scriptUrl, (/**
1157
- * @return {?}
1158
- */
1159
- () => {
1160
- widgetContainer.widgetElement = document.createElement(widgetInfo.customTag);
1161
- widgetContainer.widgetElement.setAttribute("widget-instance-id", widgetInfo.widgetInstanceId);
1162
- document.body.addEventListener('widgetinitiated' + widgetInfo.widgetInstanceId, (/**
1171
+ return __awaiter(this, void 0, void 0, /** @this {!RAWidgetContainer} */ function* () {
1172
+ /** @type {?} */
1173
+ let widgetConfigFilter = (/** @type {?} */ ({
1174
+ config: widgetInfo.widgetConfigInfo.config,
1175
+ globalFilter: this.globalFilter
1176
+ }));
1177
+ /** @type {?} */
1178
+ let widgetContainer = this;
1179
+ this.dashboardService.loadExternalScript(widgetInfo.scriptUrl, (/**
1163
1180
  * @return {?}
1164
1181
  */
1165
1182
  () => {
1166
- widgetContainer.isWidgetLoaded = true;
1167
- widgetConfigFilter.appConfig = this.appConfig;
1168
- widgetConfigFilter.widgetInfo = (/** @type {?} */ ({}));
1169
- widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
1170
- widgetContainer.widgetElement.loadContent(widgetConfigFilter);
1183
+ widgetContainer.widgetElement = document.createElement(widgetInfo.customTag);
1184
+ widgetContainer.widgetElement.setAttribute("widget-instance-id", widgetInfo.widgetInstanceId);
1185
+ document.body.addEventListener('widgetinitiated' + widgetInfo.widgetInstanceId, (/**
1186
+ * @return {?}
1187
+ */
1188
+ () => __awaiter(this, void 0, void 0, /** @this {!RAWidgetContainer} */ function* () {
1189
+ console.log('widget initiate' + widgetInfo.widgetInstanceId);
1190
+ widgetContainer.isWidgetLoaded = true;
1191
+ widgetConfigFilter.appConfig = this.appConfig;
1192
+ widgetConfigFilter.widgetInfo = (/** @type {?} */ ({}));
1193
+ widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
1194
+ widgetContainer.widgetElement.loadContent(widgetConfigFilter);
1195
+ yield widgetContainer.setClass();
1196
+ })));
1197
+ this.ctlWidget.nativeElement.appendChild(this.widgetElement);
1171
1198
  }));
1172
- this.ctlWidget.nativeElement.appendChild(this.widgetElement);
1173
- }));
1199
+ this.setWidgetheight();
1200
+ });
1174
1201
  }
1175
1202
  /**
1176
1203
  * To refresh widget on input config changes
@@ -1189,31 +1216,42 @@ class RAWidgetContainer {
1189
1216
  }));
1190
1217
  if (widgetContainerContext.isWidgetLoaded) {
1191
1218
  widgetContainerContext.widgetElement.loadContent(widgetConfigFilter);
1192
- this.lockStatus = widgetContainerContext.widgetElement.loadLockStatus();
1193
- if (this.lockStatus) {
1194
- switch (this.lockStatus) {
1219
+ //await this.setClass();
1220
+ }
1221
+ }
1222
+ /**
1223
+ * @private
1224
+ * @return {?}
1225
+ */
1226
+ setClass() {
1227
+ return __awaiter(this, void 0, void 0, /** @this {!RAWidgetContainer} */ function* () {
1228
+ /** @type {?} */
1229
+ let lockstatus = yield this.widgetElement.loadLockStatus();
1230
+ console.log('lock staus' + lockstatus);
1231
+ if (lockstatus) {
1232
+ switch (lockstatus) {
1195
1233
  case "lock": {
1196
1234
  this.lockClass = "fa fa-lock locked";
1197
1235
  }
1198
1236
  case "unlock": {
1199
- this.lockClass = "unlock";
1237
+ this.lockClass = "unlocked";
1200
1238
  }
1201
1239
  case "partiallock": {
1202
1240
  this.lockClass = "fa fa-lock partiallocked";
1203
1241
  }
1204
1242
  default: {
1205
- this.lockClass = "unlock";
1243
+ this.lockClass = "unlocked";
1206
1244
  }
1207
1245
  }
1208
1246
  }
1209
- }
1247
+ });
1210
1248
  }
1211
1249
  }
1212
1250
  RAWidgetContainer.decorators = [
1213
1251
  { type: Component, args: [{
1214
1252
  selector: 'ra-widget-container',
1215
- 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.widgetTitle}}\r\n </div>\r\n <div class=\"col-md-1\">\r\n <div class=\"float-right\" style=\"display: flex\">\r\n <div><i [ngClass]=\"lockClass\"></i></div>\r\n <div class=\"dropdown\">\r\n <div class=\"dropbtn gearIcon\"> <i class=\"fal fa-cog\"></i></div>\r\n <div class=\"dropdown-content widget-config-item\">\r\n <a (click)=\"editWidget()\">\r\n <i class=\"fal fa-edit\"></i>\r\n <span>{{'Edit'|translate}}</span>\r\n </a>\r\n <a (click)=\"copyWidget()\">\r\n <i class=\"fal fa-copy\"></i>\r\n <span>{{'Copy'|translate}}</span>\r\n </a>\r\n <a (click)=\"moveWidget()\">\r\n <i class=\"fal fa-arrows-alt\"></i>\r\n <span>{{'Move'|translate}}</span>\r\n </a>\r\n <hr class=\"hr\">\r\n <a (click)=\"deleteWidget()\">\r\n <i class=\"fal fa-times\" style=\"padding-left: 3px;\"></i>\r\n <span>{{'Delete'|translate}}</span>\r\n </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>",
1216
- 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{visibility:hidden;opacity:0;transition:visibility,opacity .5s linear;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{display:block;-webkit-animation:.3s ease-out slide-down;animation:.3s ease-out slide-down}.wc-wrapper:hover .dropdown{visibility:visible;opacity:1}.dropdown:hover .dropbtn{color:#2b7797}.gearIcon{color:#42b4e6}.hr{border:0;border-top:1px solid rgba(0,0,0,.1)}@keyframes slide-down{0%{opacity:0;-webkit-transform:translateY(-20%);transform:translateY(-20%)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes slide-down{0%{opacity:0;-webkit-transform:translateY(-20%)}100%{opacity:1;-webkit-transform:translateY(0)}}.widget-config-item i{font-size:17px;color:#42b4e6}.widget-config-item span{font-size:12px;font:inherit;padding-left:12px;color:#42b4e6}.locked{color:#42b4e6}.partiallocked{color:#a0d9f2}.unlock{display:none}"]
1253
+ 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-10 float-left\" style=\"width:96%;\">{{data.widgetInfo.widgetTitle}}\r\n </div>\r\n <div class=\"col-md-2\">\r\n <div class=\"float-right\" style=\"display: flex\">\r\n <div class=\"pr-3\"><i [ngClass]=\"lockClass\"></i></div>\r\n <div class=\"dropdown\">\r\n <div class=\"dropbtn gearIcon\"> <i class=\"fal fa-cog\"></i></div>\r\n <div class=\"dropdown-content widget-config-item\">\r\n <a (click)=\"editWidget()\">\r\n <i class=\"fal fa-edit\"></i>\r\n <span>{{'Edit'|translate}}</span>\r\n </a>\r\n <a (click)=\"copyWidget()\">\r\n <i class=\"fal fa-copy\"></i>\r\n <span>{{'Copy'|translate}}</span>\r\n </a>\r\n <a (click)=\"moveWidget()\">\r\n <i class=\"fal fa-arrows-alt\"></i>\r\n <span>{{'Move'|translate}}</span>\r\n </a>\r\n <hr class=\"hr\">\r\n <a (click)=\"deleteWidget()\">\r\n <i class=\"fal fa-times\" style=\"padding-left: 3px;\"></i>\r\n <span>{{'Delete'|translate}}</span>\r\n </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\" [style.height.px]=\"widgetHeight\">\r\n <perfect-scrollbar [scrollIndicators]=\"true\">\r\n <div class=\"wcBodyBorder\" #ctlWidget></div>\r\n </perfect-scrollbar>\r\n </div>\r\n</div>\r\n",
1254
+ 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{visibility:hidden;opacity:0;transition:visibility,opacity .5s linear;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{display:block;-webkit-animation:.3s ease-out slide-down;animation:.3s ease-out slide-down}.wc-wrapper:hover .dropdown{visibility:visible;opacity:1}.dropdown:hover .dropbtn{color:#2b7797}.gearIcon{color:#42b4e6}.hr{border:0;border-top:1px solid rgba(0,0,0,.1)}@keyframes slide-down{0%{opacity:0;-webkit-transform:translateY(-20%);transform:translateY(-20%)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes slide-down{0%{opacity:0;-webkit-transform:translateY(-20%)}100%{opacity:1;-webkit-transform:translateY(0)}}.widget-config-item i{font-size:17px;color:#42b4e6}.widget-config-item span{font-size:12px;font:inherit;padding-left:12px;color:#42b4e6}.locked{color:#42b4e6}.partiallocked{color:#a0d9f2}.unlocked{display:none}"]
1217
1255
  }] }
1218
1256
  ];
1219
1257
  /** @nocollapse */
@@ -1231,7 +1269,8 @@ RAWidgetContainer.propDecorators = {
1231
1269
  data: [{ type: Input, args: ['data',] }],
1232
1270
  raDashboardEventBus: [{ type: Input, args: ['event-bus',] }],
1233
1271
  appConfig: [{ type: Input, args: ['app-config',] }],
1234
- widgetWidth: [{ type: Input, args: ['widget-width',] }],
1272
+ width: [{ type: Input, args: ['widget-width',] }],
1273
+ height: [{ type: Input, args: ['widget-height',] }],
1235
1274
  widgetDeleted: [{ type: Output }]
1236
1275
  };
1237
1276
  if (false) {
@@ -1256,7 +1295,7 @@ if (false) {
1256
1295
  */
1257
1296
  RAWidgetContainer.prototype.isIEOrEdge;
1258
1297
  /** @type {?} */
1259
- RAWidgetContainer.prototype.lockStatus;
1298
+ RAWidgetContainer.prototype.widgetHeight;
1260
1299
  /** @type {?} */
1261
1300
  RAWidgetContainer.prototype.lockClass;
1262
1301
  /** @type {?} */
@@ -1272,7 +1311,9 @@ if (false) {
1272
1311
  /** @type {?} */
1273
1312
  RAWidgetContainer.prototype.appConfig;
1274
1313
  /** @type {?} */
1275
- RAWidgetContainer.prototype.widgetWidth;
1314
+ RAWidgetContainer.prototype.width;
1315
+ /** @type {?} */
1316
+ RAWidgetContainer.prototype.height;
1276
1317
  /** @type {?} */
1277
1318
  RAWidgetContainer.prototype.widgetDeleted;
1278
1319
  /**
@@ -5789,6 +5830,11 @@ GridsterModule.decorators = [
5789
5830
  * @fileoverview added by tsickle
5790
5831
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5791
5832
  */
5833
+ /** @type {?} */
5834
+ const DEFAULT_PERFECT_SCROLLBAR_CONFIG = {
5835
+ suppressScrollX: true
5836
+ };
5837
+ const ɵ0 = DEFAULT_PERFECT_SCROLLBAR_CONFIG;
5792
5838
  class DashboardFrameworkModule {
5793
5839
  }
5794
5840
  DashboardFrameworkModule.decorators = [
@@ -5803,13 +5849,17 @@ DashboardFrameworkModule.decorators = [
5803
5849
  HttpClientModule,
5804
5850
  NgxUiLoaderModule,
5805
5851
  TranslateModule,
5806
- NotifierModule.withConfig(customNotifierOptions)
5852
+ NotifierModule.withConfig(customNotifierOptions),
5853
+ PerfectScrollbarModule
5807
5854
  ],
5808
5855
  exports: [
5809
5856
  RADashboardArea,
5810
5857
  TranslateModule
5811
5858
  ],
5812
- providers: [],
5859
+ providers: [{
5860
+ provide: PERFECT_SCROLLBAR_CONFIG,
5861
+ useValue: ɵ0
5862
+ },],
5813
5863
  bootstrap: [RADashboardArea]
5814
5864
  },] }
5815
5865
  ];