@schneideress/dashboardframework 0.0.150 → 0.0.152

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,18 +5,18 @@
5
5
  }(this, (function (exports, core, rxjs, raCommon, operators, ngxUiLoader, angularNotifier, widgetframework, platformBrowser, http, common, userControls, commonControls) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation. All rights reserved.
9
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
10
- this file except in compliance with the License. You may obtain a copy of the
11
- License at http://www.apache.org/licenses/LICENSE-2.0
8
+ Copyright (c) Microsoft Corporation.
12
9
 
13
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
15
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
16
- MERCHANTABLITY OR NON-INFRINGEMENT.
10
+ Permission to use, copy, modify, and/or distribute this software for any
11
+ purpose with or without fee is hereby granted.
17
12
 
18
- See the Apache Version 2.0 License for specific language governing permissions
19
- and limitations under the License.
13
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
+ PERFORMANCE OF THIS SOFTWARE.
20
20
  ***************************************************************************** */
21
21
  /* global Reflect, Promise */
22
22
 
@@ -109,8 +109,13 @@
109
109
  }
110
110
  }
111
111
 
112
+ function __createBinding(o, m, k, k2) {
113
+ if (k2 === undefined) k2 = k;
114
+ o[k2] = m[k];
115
+ }
116
+
112
117
  function __exportStar(m, exports) {
113
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
118
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
114
119
  }
115
120
 
116
121
  function __values(o) {
@@ -602,6 +607,8 @@
602
607
  WidgetAdded: "WidgetAdded",
603
608
  /**To update global filter site from map widget selected site */
604
609
  UpdateGlobalFilterFromMapWidget: "UpdateGlobalFilterFromMapWidget",
610
+ /**To add widget on empty dashboard */
611
+ AddWidgetEmptyDashboard: "AddWidgetEmptyDashboard",
605
612
  };
606
613
  /** @enum {string} */
607
614
  var RAEventKey = {
@@ -926,13 +933,18 @@
926
933
  function () {
927
934
  var _this = this;
928
935
  this.screenWidth = screen.width;
929
- this.currentResInfo = this.resInfo.filter((/**
930
- * @param {?} item
931
- * @return {?}
932
- */
933
- function (item) {
934
- return item.end >= _this.screenWidth && item.start <= _this.screenWidth;
935
- }))[0];
936
+ if (this.IsDesktopView) {
937
+ this.currentResInfo = this.resInfo[3];
938
+ }
939
+ else {
940
+ this.currentResInfo = this.resInfo.filter((/**
941
+ * @param {?} item
942
+ * @return {?}
943
+ */
944
+ function (item) {
945
+ return item.end >= _this.screenWidth && item.start <= _this.screenWidth;
946
+ }))[0];
947
+ }
936
948
  };
937
949
  Object.defineProperty(RADashboardResponsiveService.prototype, "IsDesktopView", {
938
950
  get: /**
@@ -1553,8 +1565,7 @@
1553
1565
  var _this = this;
1554
1566
  data.height = this.widgetHeight;
1555
1567
  data.width = this.widgetWidth;
1556
- data.position_x = 0;
1557
- data.position_y = 0;
1568
+ data = this.setPositions(data);
1558
1569
  /** to find the available position in gridster, temp commenting the code-returning higher y value than normal */
1559
1570
  data.dashboardAreaKey = this.areaKey;
1560
1571
  data.dashboardId = this.userDashboardId;
@@ -1591,6 +1602,34 @@
1591
1602
  _this.raDashboardEventBus.publish(RAEvent.WidgetAdded, widget);
1592
1603
  }));
1593
1604
  };
1605
+ /**
1606
+ * @private
1607
+ * @param {?} data
1608
+ * @return {?}
1609
+ */
1610
+ RADashboardArea.prototype.setPositions = /**
1611
+ * @private
1612
+ * @param {?} data
1613
+ * @return {?}
1614
+ */
1615
+ function (data) {
1616
+ data.position_x = 0;
1617
+ data.position_y = 0;
1618
+ if (!this.responsiveService.IsDesktopView) {
1619
+ if (this.userWidgets.length > 0) {
1620
+ /** @type {?} */
1621
+ var widget = this.userWidgets[this.userWidgets.length - 1];
1622
+ if (widget.position_x + widget.width > 5) {
1623
+ data.position_y = widget.position_y + 1;
1624
+ }
1625
+ else {
1626
+ data.position_y = widget.position_y;
1627
+ data.position_x = 10 - (widget.position_x + widget.width);
1628
+ }
1629
+ }
1630
+ }
1631
+ return data;
1632
+ };
1594
1633
  /** To add widget to current widget list ,invoked from copy widget window*/
1595
1634
  /**
1596
1635
  * To add widget to current widget list ,invoked from copy widget window
@@ -1603,8 +1642,15 @@
1603
1642
  * @return {?}
1604
1643
  */
1605
1644
  function (data) {
1606
- data.position_x = 0;
1607
- data.position_y = 0;
1645
+ data = this.setPositions(data);
1646
+ if (!this.responsiveService.IsDesktopView) {
1647
+ this.dashboardService.updateWidgets(this.formatWidgetDataForPositionDetails([data]), this.appConfig).subscribe((/**
1648
+ * @param {?} widgets
1649
+ * @return {?}
1650
+ */
1651
+ function (widgets) {
1652
+ }));
1653
+ }
1608
1654
  /** @type {?} */
1609
1655
  var gridsterItem = this.responsiveService.getGridsterItem(data);
1610
1656
  this.widgetList.push(gridsterItem);