@schneideress/dashboardframework 0.0.145 → 0.0.146

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.
@@ -731,7 +731,17 @@ var RADashboardArea = /** @class */ (function () {
731
731
  * @return {?}
732
732
  */
733
733
  function () {
734
+ var _this = this;
734
735
  this.initiateGridsterConfig();
736
+ this.widgetRearrangeSubject.subscribe((/**
737
+ * @param {?} event
738
+ * @return {?}
739
+ */
740
+ function (event) {
741
+ console.log('in subscribe subject & value is');
742
+ console.log(event);
743
+ _this.rearrangeWidgets();
744
+ }));
735
745
  };
736
746
  /**
737
747
  * @param {?} changes
@@ -912,6 +922,8 @@ var RADashboardArea = /** @class */ (function () {
912
922
  this.widgetDeleteEvent.unsubscribe();
913
923
  if (this.widgetLibraryDoneClick)
914
924
  this.widgetLibraryDoneClick.unsubscribe();
925
+ if (this.widgetRearrangeSubject)
926
+ this.widgetRearrangeSubject.unsubscribe();
915
927
  };
916
928
  /**To update position/dimention of all widgets in the area */
917
929
  /**
@@ -1036,7 +1048,6 @@ var RADashboardArea = /** @class */ (function () {
1036
1048
  */
1037
1049
  function (widgetInstanceId, isalertDisabled) {
1038
1050
  if (isalertDisabled === void 0) { isalertDisabled = false; }
1039
- console.log("goCorona");
1040
1051
  /** @type {?} */
1041
1052
  var widget = this.widgetList.filter((/**
1042
1053
  * @param {?} item
@@ -1051,12 +1062,24 @@ var RADashboardArea = /** @class */ (function () {
1051
1062
  if (!isalertDisabled) {
1052
1063
  this.notifier.notify('success', " " + this.translateService.translate('Common.Widgettext') + " " + widget[0].widgetInfo.widgetTitle + " " + this.translateService.translate('Common.deletedSuccesfully') + " ");
1053
1064
  }
1054
- this.options.compactType = 'compactLeft&Up';
1055
- this.options.api.optionsChanged();
1056
- this.options.compactType = 'none';
1057
- this.options.api.optionsChanged();
1058
1065
  }
1059
1066
  };
1067
+ /**To rearrange widgets position in the dashboard, compactLeft&Up,compactLeft,compactUp,etc*/
1068
+ /**
1069
+ * To rearrange widgets position in the dashboard, compactLeft&Up,compactLeft,compactUp,etc
1070
+ * @return {?}
1071
+ */
1072
+ RADashboardArea.prototype.rearrangeWidgets = /**
1073
+ * To rearrange widgets position in the dashboard, compactLeft&Up,compactLeft,compactUp,etc
1074
+ * @return {?}
1075
+ */
1076
+ function () {
1077
+ console.log('in rearrange widgets methd');
1078
+ this.options.compactType = 'compactUp&Left';
1079
+ this.options.api.optionsChanged();
1080
+ this.options.compactType = 'none';
1081
+ this.options.api.optionsChanged();
1082
+ };
1060
1083
  /**To add widget instance to the database with the next available position and to make changes in
1061
1084
  * dashboard area.
1062
1085
  */
@@ -1246,6 +1269,7 @@ var RADashboardArea = /** @class */ (function () {
1246
1269
  widgetHeight: [{ type: Input, args: ['widget-height',] }],
1247
1270
  widgetWidth: [{ type: Input, args: ['widget-width',] }],
1248
1271
  appConfig: [{ type: Input, args: ['app-config',] }],
1272
+ widgetRearrangeSubject: [{ type: Input }],
1249
1273
  gridWrapper: [{ type: ViewChild, args: ['gridWrapper', { static: false },] }],
1250
1274
  onResize: [{ type: HostListener, args: ['window:resize', ['$event'],] }]
1251
1275
  };
@@ -1302,6 +1326,8 @@ if (false) {
1302
1326
  /** @type {?} */
1303
1327
  RADashboardArea.prototype.appConfig;
1304
1328
  /** @type {?} */
1329
+ RADashboardArea.prototype.widgetRearrangeSubject;
1330
+ /** @type {?} */
1305
1331
  RADashboardArea.prototype.gridWrapper;
1306
1332
  /**
1307
1333
  * @type {?}
@@ -1481,12 +1507,13 @@ var RAWidgetContainer = /** @class */ (function () {
1481
1507
  */
1482
1508
  function (isHover) {
1483
1509
  if (isHover === void 0) { isHover = true; }
1484
- console.log('in mousehover value');
1485
- console.log(isHover);
1486
1510
  if (this.widgetElement) {
1487
- console.log(1);
1488
- this.widgetElement.hoverStatus(isHover);
1489
- console.log(2);
1511
+ if (typeof this.widgetElement.hoverStatus === "function") {
1512
+ this.widgetElement.hoverStatus(isHover);
1513
+ }
1514
+ else {
1515
+ console.warn('widget framework outdated, please update to version 0.0.96');
1516
+ }
1490
1517
  }
1491
1518
  if (!isHover) {
1492
1519
  this.hideDropDown();
@@ -1691,8 +1718,6 @@ var RAWidgetContainer = /** @class */ (function () {
1691
1718
  * @return {?}
1692
1719
  */
1693
1720
  function (e) {
1694
- console.log('in widget default state');
1695
- console.log(e);
1696
1721
  widgetContainer.setEmptyState(e.detail);
1697
1722
  }));
1698
1723
  titleLineEnabled = widgetContainer.widgetElement.titleLineEnabled();
@@ -1770,16 +1795,11 @@ var RAWidgetContainer = /** @class */ (function () {
1770
1795
  */
1771
1796
  function (widgetInfo, forceEnable) {
1772
1797
  if (forceEnable === void 0) { forceEnable = false; }
1773
- console.log('in set no configured');
1774
- console.log(widgetInfo);
1775
- console.log(forceEnable);
1776
1798
  if ((widgetInfo.showDefaultState && (widgetInfo.widgetConfigInfo.config == "" || Object.keys(JSON.parse(widgetInfo.widgetConfigInfo.config)).length == 0)) || (forceEnable)) {
1777
- console.log('ininf');
1778
1799
  this.isWidgetStateApplicable = true;
1779
1800
  this.widgetEmptyState = WidgetViewState.emptyConfig.toString();
1780
1801
  }
1781
1802
  else {
1782
- console.log('in else');
1783
1803
  this.widgetEmptyState = '';
1784
1804
  this.isWidgetStateApplicable = false;
1785
1805
  }
@@ -1796,24 +1816,19 @@ var RAWidgetContainer = /** @class */ (function () {
1796
1816
  * @return {?}
1797
1817
  */
1798
1818
  function (widgetState) {
1799
- console.log('in wc contanjiner widget state');
1800
- console.log(widgetState);
1801
1819
  this.widgetEmptyState = widgetState;
1802
1820
  if (widgetState != WidgetViewState.normal) {
1803
1821
  this.isWidgetStateApplicable = true;
1804
1822
  this.isDownloadIconVisible = false;
1805
1823
  }
1806
1824
  else {
1807
- console.log('in else case');
1808
1825
  this.isWidgetStateApplicable = false;
1809
1826
  }
1810
1827
  switch (widgetState) {
1811
1828
  case WidgetViewState.emptyConfig:
1812
- console.log('in case emptyconfig');
1813
1829
  this.setNotConfiguredState(this.data.widgetInfo, true);
1814
1830
  break;
1815
1831
  case WidgetViewState.emptyData:
1816
- console.log('in case empty');
1817
1832
  break;
1818
1833
  case WidgetViewState.error:
1819
1834
  break;
@@ -7394,6 +7409,7 @@ var RaBaseDashboardTemplate = /** @class */ (function () {
7394
7409
  function RaBaseDashboardTemplate(ngZone) {
7395
7410
  var _this = this;
7396
7411
  this.ngZone = ngZone;
7412
+ this.widgetRearrangeSubject = new Subject();
7397
7413
  this.initialize = (/**
7398
7414
  * @param {?} eventBus
7399
7415
  * @param {?} userDashboardId
@@ -7411,6 +7427,17 @@ var RaBaseDashboardTemplate = /** @class */ (function () {
7411
7427
  }));
7412
7428
  _this.init();
7413
7429
  });
7430
+ this.rearrangeWidgets = (/**
7431
+ * @return {?}
7432
+ */
7433
+ function () {
7434
+ _this.ngZone.run((/**
7435
+ * @return {?}
7436
+ */
7437
+ function () {
7438
+ _this.widgetRearrangeSubject.next(true);
7439
+ }));
7440
+ });
7414
7441
  }
7415
7442
  /**
7416
7443
  * @return {?}
@@ -7426,7 +7453,8 @@ var RaBaseDashboardTemplate = /** @class */ (function () {
7426
7453
  RaBaseDashboardTemplate.propDecorators = {
7427
7454
  dashboardId: [{ type: Input, args: ['dashboard-id',] }],
7428
7455
  globalFilter: [{ type: Input, args: ['global-filter',] }],
7429
- initialize: [{ type: Input }]
7456
+ initialize: [{ type: Input }],
7457
+ rearrangeWidgets: [{ type: Input }]
7430
7458
  };
7431
7459
  return RaBaseDashboardTemplate;
7432
7460
  }());
@@ -7438,11 +7466,15 @@ if (false) {
7438
7466
  /** @type {?} */
7439
7467
  RaBaseDashboardTemplate.prototype.appConfig;
7440
7468
  /** @type {?} */
7469
+ RaBaseDashboardTemplate.prototype.widgetRearrangeSubject;
7470
+ /** @type {?} */
7441
7471
  RaBaseDashboardTemplate.prototype.dashboardId;
7442
7472
  /** @type {?} */
7443
7473
  RaBaseDashboardTemplate.prototype.globalFilter;
7444
7474
  /** @type {?} */
7445
7475
  RaBaseDashboardTemplate.prototype.initialize;
7476
+ /** @type {?} */
7477
+ RaBaseDashboardTemplate.prototype.rearrangeWidgets;
7446
7478
  /**
7447
7479
  * @type {?}
7448
7480
  * @private