@schneideress/dashboardframework 0.0.6 → 0.0.8
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.
- package/bundles/schneideress-dashboardframework.umd.js +58 -29
- package/bundles/schneideress-dashboardframework.umd.js.map +1 -1
- package/bundles/schneideress-dashboardframework.umd.min.js +1 -1
- package/bundles/schneideress-dashboardframework.umd.min.js.map +1 -1
- package/esm2015/lib/ra-dashboard-area/ra.dashboard.area.js +44 -18
- package/esm2015/lib/ra-widget-container/ra.widget.container.component.js +19 -10
- package/esm2015/lib/ra.dashboard.module.js +4 -2
- package/esm5/lib/ra-dashboard-area/ra.dashboard.area.js +48 -18
- package/esm5/lib/ra-widget-container/ra.widget.container.component.js +18 -10
- package/esm5/lib/ra.dashboard.module.js +4 -2
- package/fesm2015/schneideress-dashboardframework.js +52 -25
- package/fesm2015/schneideress-dashboardframework.js.map +1 -1
- package/fesm5/schneideress-dashboardframework.js +55 -25
- package/fesm5/schneideress-dashboardframework.js.map +1 -1
- package/lib/ra-dashboard-area/ra.dashboard.area.d.ts +5 -1
- package/lib/ra-widget-container/ra.widget.container.component.d.ts +3 -1
- package/package.json +1 -1
- package/schneideress-dashboardframework.metadata.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@schneideress/ess-util'), require('rxjs/operators'), require('@angular/platform-browser'), require('@angular/common/http'), require('@angular/common')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@schneideress/dashboardframework', ['exports', '@angular/core', 'rxjs', '@schneideress/ess-util', 'rxjs/operators', '@angular/platform-browser', '@angular/common/http', '@angular/common'], factory) :
|
|
4
|
-
(global = global || self, factory((global.schneideress = global.schneideress || {}, global.schneideress.dashboardframework = {}), global.ng.core, global.rxjs, global.essUtil, global.rxjs.operators, global.ng.platformBrowser, global.ng.common.http, global.ng.common));
|
|
5
|
-
}(this, function (exports, core, rxjs, essUtil, operators, platformBrowser, http, common) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@schneideress/ess-util'), require('rxjs/operators'), require('ngx-ui-loader'), require('@angular/platform-browser'), require('@angular/common/http'), require('@angular/common')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@schneideress/dashboardframework', ['exports', '@angular/core', 'rxjs', '@schneideress/ess-util', 'rxjs/operators', 'ngx-ui-loader', '@angular/platform-browser', '@angular/common/http', '@angular/common'], factory) :
|
|
4
|
+
(global = global || self, factory((global.schneideress = global.schneideress || {}, global.schneideress.dashboardframework = {}), global.ng.core, global.rxjs, global.essUtil, global.rxjs.operators, global.ngxUiLoader, global.ng.platformBrowser, global.ng.common.http, global.ng.common));
|
|
5
|
+
}(this, function (exports, core, rxjs, essUtil, operators, ngxUiLoader, platformBrowser, http, common) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/*! *****************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -509,9 +509,10 @@
|
|
|
509
509
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
510
510
|
*/
|
|
511
511
|
var RADashboardArea = /** @class */ (function () {
|
|
512
|
-
function RADashboardArea(dashboardService, ngZone) {
|
|
512
|
+
function RADashboardArea(dashboardService, ngZone, ngxService) {
|
|
513
513
|
this.dashboardService = dashboardService;
|
|
514
514
|
this.ngZone = ngZone;
|
|
515
|
+
this.ngxService = ngxService;
|
|
515
516
|
this.widgetList = Array();
|
|
516
517
|
this.gridheight = 300;
|
|
517
518
|
this.widgetHeight = 20;
|
|
@@ -524,18 +525,27 @@
|
|
|
524
525
|
* @return {?}
|
|
525
526
|
*/
|
|
526
527
|
function () {
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
528
|
+
this.initiateGridsterConfig();
|
|
529
|
+
};
|
|
530
|
+
/**To set GridsterConfig */
|
|
531
|
+
/**
|
|
532
|
+
* To set GridsterConfig
|
|
533
|
+
* @return {?}
|
|
534
|
+
*/
|
|
535
|
+
RADashboardArea.prototype.initiateGridsterConfig = /**
|
|
536
|
+
* To set GridsterConfig
|
|
537
|
+
* @return {?}
|
|
538
|
+
*/
|
|
539
|
+
function () {
|
|
540
|
+
/** @type {?} */
|
|
531
541
|
var areaContext = this;
|
|
542
|
+
/**To override default configuration values to the gridster control */
|
|
532
543
|
this.options = GridsterConfigDefaultSettings;
|
|
533
544
|
this.options.itemChangeCallback = (/**
|
|
534
545
|
* @param {?} item
|
|
535
546
|
* @return {?}
|
|
536
547
|
*/
|
|
537
548
|
function (item) {
|
|
538
|
-
console.log('in change call back');
|
|
539
549
|
areaContext.setAreaHeight();
|
|
540
550
|
areaContext.updateWidgets();
|
|
541
551
|
});
|
|
@@ -565,6 +575,7 @@
|
|
|
565
575
|
}));
|
|
566
576
|
}
|
|
567
577
|
if (this.raDashboardEventBus && this.userDashboardId && this.areaKey) {
|
|
578
|
+
this.initiateGridsterConfig();
|
|
568
579
|
this.loadWidgets(this.userDashboardId, this.areaKey);
|
|
569
580
|
}
|
|
570
581
|
};
|
|
@@ -584,7 +595,6 @@
|
|
|
584
595
|
* @return {?}
|
|
585
596
|
*/
|
|
586
597
|
function () {
|
|
587
|
-
console.log('in update widgets');
|
|
588
598
|
this.dashboardService.updateWidgets(this.mapGridsterListToObject(this.widgetList), this.appConfig).subscribe((/**
|
|
589
599
|
* @param {?} widgets
|
|
590
600
|
* @return {?}
|
|
@@ -609,6 +619,8 @@
|
|
|
609
619
|
function (userDashboarId, areaKey) {
|
|
610
620
|
var _this = this;
|
|
611
621
|
/** @type {?} */
|
|
622
|
+
var areaContext = this;
|
|
623
|
+
/** @type {?} */
|
|
612
624
|
var widgetInfo = (/** @type {?} */ ({
|
|
613
625
|
dashboardId: userDashboarId.toString(),
|
|
614
626
|
dashboardAreaKey: areaKey
|
|
@@ -618,9 +630,14 @@
|
|
|
618
630
|
* @return {?}
|
|
619
631
|
*/
|
|
620
632
|
function (widgets) {
|
|
621
|
-
if (widgets) {
|
|
622
|
-
|
|
623
|
-
|
|
633
|
+
if (widgets && widgets.length > 0) {
|
|
634
|
+
areaContext.widgetList = _this.mapObjectListToGridsterItemList(widgets);
|
|
635
|
+
setTimeout((/**
|
|
636
|
+
* @return {?}
|
|
637
|
+
*/
|
|
638
|
+
function () {
|
|
639
|
+
areaContext.setAreaHeight();
|
|
640
|
+
}), 2000);
|
|
624
641
|
}
|
|
625
642
|
}));
|
|
626
643
|
};
|
|
@@ -649,9 +666,11 @@
|
|
|
649
666
|
areaScrollHeight = currentHeight;
|
|
650
667
|
}
|
|
651
668
|
}));
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
669
|
+
if (this.options.api) {
|
|
670
|
+
areaHeight = areaScrollHeight * this.options.api.getCurrentRowHeight() + 2;
|
|
671
|
+
}
|
|
672
|
+
if (areaHeight < 600) {
|
|
673
|
+
areaHeight = 600;
|
|
655
674
|
}
|
|
656
675
|
this.gridheight = areaHeight;
|
|
657
676
|
};
|
|
@@ -705,11 +724,14 @@
|
|
|
705
724
|
data.position_y = 0;
|
|
706
725
|
/** @type {?} */
|
|
707
726
|
var gridsterItem = this.mapObjectsToGridsterItem(data);
|
|
708
|
-
|
|
727
|
+
if (this.options.api) {
|
|
728
|
+
gridsterItem = this.options.api.getFirstPossiblePosition(gridsterItem);
|
|
729
|
+
}
|
|
709
730
|
data.position_x = gridsterItem.x;
|
|
710
731
|
data.position_y = gridsterItem.y;
|
|
711
732
|
data.dashboardAreaKey = this.areaKey;
|
|
712
733
|
data.dashboardId = this.userDashboardId;
|
|
734
|
+
this.ngxService.start();
|
|
713
735
|
this.dashboardService.addWidget(data, this.appConfig).subscribe((/**
|
|
714
736
|
* @param {?} widget
|
|
715
737
|
* @return {?}
|
|
@@ -718,6 +740,7 @@
|
|
|
718
740
|
gridsterItem = _this.mapObjectsToGridsterItem(widget);
|
|
719
741
|
_this.widgetList.push(gridsterItem);
|
|
720
742
|
_this.setAreaHeight();
|
|
743
|
+
_this.ngxService.stop();
|
|
721
744
|
}));
|
|
722
745
|
};
|
|
723
746
|
/**To map IwidgetInfo object to gridsterItem */
|
|
@@ -805,14 +828,15 @@
|
|
|
805
828
|
RADashboardArea.decorators = [
|
|
806
829
|
{ type: core.Component, args: [{
|
|
807
830
|
selector: 'ra-dashboard-area',
|
|
808
|
-
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",
|
|
809
|
-
styles: ["gridster{width:inherit;resize:height;display:flex;min-height:
|
|
831
|
+
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",
|
|
832
|
+
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}"]
|
|
810
833
|
}] }
|
|
811
834
|
];
|
|
812
835
|
/** @nocollapse */
|
|
813
836
|
RADashboardArea.ctorParameters = function () { return [
|
|
814
837
|
{ type: RaDashboardService },
|
|
815
|
-
{ type: core.NgZone }
|
|
838
|
+
{ type: core.NgZone },
|
|
839
|
+
{ type: ngxUiLoader.NgxUiLoaderService }
|
|
816
840
|
]; };
|
|
817
841
|
RADashboardArea.propDecorators = {
|
|
818
842
|
userDashboardId: [{ type: core.Input, args: ['user-dashboard-id',] }],
|
|
@@ -831,8 +855,9 @@
|
|
|
831
855
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
832
856
|
*/
|
|
833
857
|
var RAWidgetContainer = /** @class */ (function () {
|
|
834
|
-
function RAWidgetContainer(dashboardService) {
|
|
858
|
+
function RAWidgetContainer(dashboardService, ngxService) {
|
|
835
859
|
this.dashboardService = dashboardService;
|
|
860
|
+
this.ngxService = ngxService;
|
|
836
861
|
this.isIEOrEdge = /msie\s|trident\/|edge\//i.test(window.navigator.userAgent);
|
|
837
862
|
this.widgetDeleted = new core.EventEmitter();
|
|
838
863
|
}
|
|
@@ -906,13 +931,17 @@
|
|
|
906
931
|
*/
|
|
907
932
|
function () {
|
|
908
933
|
var _this = this;
|
|
909
|
-
|
|
934
|
+
/** @type {?} */
|
|
935
|
+
var widgetContainerContext = this;
|
|
936
|
+
widgetContainerContext.ngxService.start();
|
|
937
|
+
widgetContainerContext.dashboardService.deleteWidget(this.data.widgetInfo, this.appConfig).subscribe((/**
|
|
910
938
|
* @param {?} status
|
|
911
939
|
* @return {?}
|
|
912
940
|
*/
|
|
913
941
|
function (status) {
|
|
942
|
+
widgetContainerContext.ngxService.stop();
|
|
914
943
|
{
|
|
915
|
-
|
|
944
|
+
widgetContainerContext.widgetDeleted.emit(_this.data.widgetInfo.widgetInstanceId);
|
|
916
945
|
}
|
|
917
946
|
}));
|
|
918
947
|
};
|
|
@@ -967,8 +996,6 @@
|
|
|
967
996
|
* @return {?}
|
|
968
997
|
*/
|
|
969
998
|
function (config) {
|
|
970
|
-
console.log('in config change config');
|
|
971
|
-
console.log(config);
|
|
972
999
|
this.data.widgetInfo.widgetConfigInfo.config = config;
|
|
973
1000
|
this.refreshWidget(this.data.widgetInfo);
|
|
974
1001
|
this.updateWidget(this.data.widgetInfo);
|
|
@@ -1043,13 +1070,14 @@
|
|
|
1043
1070
|
RAWidgetContainer.decorators = [
|
|
1044
1071
|
{ type: core.Component, args: [{
|
|
1045
1072
|
selector: 'ra-widget-container',
|
|
1046
|
-
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(data)\">Copy</a>\r\n <a (click)=\"moveWidget(data)\">Move</a>\r\n <a (click)=\"collapse(data)\">Collapse</a>\r\n <hr class=\"hr\"
|
|
1073
|
+
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(data)\">Copy</a>\r\n <a (click)=\"moveWidget(data)\">Move</a>\r\n <a (click)=\"collapse(data)\">Collapse</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",
|
|
1047
1074
|
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-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)}"]
|
|
1048
1075
|
}] }
|
|
1049
1076
|
];
|
|
1050
1077
|
/** @nocollapse */
|
|
1051
1078
|
RAWidgetContainer.ctorParameters = function () { return [
|
|
1052
|
-
{ type: RaDashboardService }
|
|
1079
|
+
{ type: RaDashboardService },
|
|
1080
|
+
{ type: ngxUiLoader.NgxUiLoaderService }
|
|
1053
1081
|
]; };
|
|
1054
1082
|
RAWidgetContainer.propDecorators = {
|
|
1055
1083
|
ctlWidget: [{ type: core.ViewChild, args: ['ctlWidget', { static: false },] }],
|
|
@@ -5577,7 +5605,8 @@
|
|
|
5577
5605
|
imports: [
|
|
5578
5606
|
platformBrowser.BrowserModule,
|
|
5579
5607
|
GridsterModule,
|
|
5580
|
-
http.HttpClientModule
|
|
5608
|
+
http.HttpClientModule,
|
|
5609
|
+
ngxUiLoader.NgxUiLoaderModule
|
|
5581
5610
|
],
|
|
5582
5611
|
exports: [
|
|
5583
5612
|
RADashboardArea
|