@inspark/inspark-components 1.0.8 → 1.0.11

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ngx-translate/core'), require('@angular/platform-browser'), require('primeng/api'), require('@biesbjerg/ngx-translate-extract/dist/utils/utils'), require('rxjs'), require('@angular/forms'), require('@angular/common'), require('primeng/primeng'), require('@angular/router'), require('@angular/cdk/scrolling'), require('@angular/animations'), require('primeng/table'), require('primeng/dropdown'), require('primeng/multiselect'), require('@ng-bootstrap/ng-bootstrap'), require('primeng/checkbox'), require('ng-inline-svg'), require('primeng/menu'), require('primeng/slider')) :
3
- typeof define === 'function' && define.amd ? define('@inspark/inspark-components', ['exports', '@angular/core', '@ngx-translate/core', '@angular/platform-browser', 'primeng/api', '@biesbjerg/ngx-translate-extract/dist/utils/utils', 'rxjs', '@angular/forms', '@angular/common', 'primeng/primeng', '@angular/router', '@angular/cdk/scrolling', '@angular/animations', 'primeng/table', 'primeng/dropdown', 'primeng/multiselect', '@ng-bootstrap/ng-bootstrap', 'primeng/checkbox', 'ng-inline-svg', 'primeng/menu', 'primeng/slider'], factory) :
4
- (global = global || self, factory((global.inspark = global.inspark || {}, global.inspark['inspark-components'] = {}), global.ng.core, global.core$1, global.ng.platformBrowser, global.api, global.utils, global.rxjs, global.ng.forms, global.ng.common, global.primeng, global.ng.router, global.ng.cdk.scrolling, global.ng.animations, global.table, global.dropdown, global.multiselect, global.ngBootstrap, global.checkbox, global.ngInlineSvg, global.menu, global.slider));
5
- }(this, (function (exports, core, core$1, platformBrowser, api, utils, rxjs, forms, common, primeng, router, scrolling, animations, table, dropdown, multiselect, ngBootstrap, checkbox, ngInlineSvg, menu, slider) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ngx-translate/core'), require('@angular/platform-browser'), require('primeng/api'), require('@biesbjerg/ngx-translate-extract/dist/utils/utils'), require('primeng/dynamicdialog'), require('primeng/components/dynamicdialog/dynamicdialog-injector'), require('rxjs'), require('@angular/forms'), require('@angular/common'), require('primeng/primeng'), require('@angular/router'), require('@angular/cdk/scrolling'), require('@angular/animations'), require('primeng/table'), require('primeng/dropdown'), require('primeng/multiselect'), require('@ng-bootstrap/ng-bootstrap'), require('primeng/checkbox'), require('ng-inline-svg'), require('primeng/menu'), require('primeng/slider')) :
3
+ typeof define === 'function' && define.amd ? define('@inspark/inspark-components', ['exports', '@angular/core', '@ngx-translate/core', '@angular/platform-browser', 'primeng/api', '@biesbjerg/ngx-translate-extract/dist/utils/utils', 'primeng/dynamicdialog', 'primeng/components/dynamicdialog/dynamicdialog-injector', 'rxjs', '@angular/forms', '@angular/common', 'primeng/primeng', '@angular/router', '@angular/cdk/scrolling', '@angular/animations', 'primeng/table', 'primeng/dropdown', 'primeng/multiselect', '@ng-bootstrap/ng-bootstrap', 'primeng/checkbox', 'ng-inline-svg', 'primeng/menu', 'primeng/slider'], factory) :
4
+ (global = global || self, factory((global.inspark = global.inspark || {}, global.inspark['inspark-components'] = {}), global.ng.core, global.core$1, global.ng.platformBrowser, global.api, global.utils, global.dynamicdialog, global.dynamicdialogInjector, global.rxjs, global.ng.forms, global.ng.common, global.primeng, global.ng.router, global.ng.cdk.scrolling, global.ng.animations, global.table, global.dropdown, global.multiselect, global.ngBootstrap, global.checkbox, global.ngInlineSvg, global.menu, global.slider));
5
+ }(this, (function (exports, core, core$1, platformBrowser, api, utils, dynamicdialog, dynamicdialogInjector, rxjs, forms, common, primeng, router, scrolling, animations, table, dropdown, multiselect, ngBootstrap, checkbox, ngInlineSvg, menu, slider) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -598,6 +598,61 @@
598
598
  return InsparkMessageService;
599
599
  }());
600
600
 
601
+ var InsparkDialogService = /** @class */ (function () {
602
+ function InsparkDialogService(componentFactoryResolver, appRef, injector) {
603
+ this.componentFactoryResolver = componentFactoryResolver;
604
+ this.appRef = appRef;
605
+ this.injector = injector;
606
+ }
607
+ InsparkDialogService.prototype.open = function (componentType, config) {
608
+ var dialogRef = this.appendDialogComponentToBody(config);
609
+ console.log('window.scrollY', window.scrollY);
610
+ document.body.style.top = "-" + window.scrollY + "px";
611
+ document.body.style.position = 'fixed';
612
+ dialogRef.onClose.subscribe(function () {
613
+ console.log('custom subscrnve');
614
+ var scrollY = document.body.style.top;
615
+ document.body.style.position = '';
616
+ document.body.style.top = '';
617
+ window.scrollTo(0, parseInt(scrollY || '0') * -1);
618
+ });
619
+ this.dialogComponentRef.instance.childComponentType = componentType;
620
+ return dialogRef;
621
+ };
622
+ InsparkDialogService.prototype.appendDialogComponentToBody = function (config) {
623
+ var _this = this;
624
+ var map = new WeakMap();
625
+ map.set(api.DynamicDialogConfig, config);
626
+ var dialogRef = new api.DynamicDialogRef();
627
+ map.set(api.DynamicDialogRef, dialogRef);
628
+ var sub = dialogRef.onClose.subscribe(function () {
629
+ _this.removeDialogComponentFromBody();
630
+ sub.unsubscribe();
631
+ });
632
+ var componentFactory = this.componentFactoryResolver.resolveComponentFactory(dynamicdialog.DynamicDialogComponent);
633
+ var componentRef = componentFactory.create(new dynamicdialogInjector.DynamicDialogInjector(this.injector, map));
634
+ this.appRef.attachView(componentRef.hostView);
635
+ var domElem = componentRef.hostView.rootNodes[0];
636
+ document.body.appendChild(domElem);
637
+ this.dialogComponentRef = componentRef;
638
+ return dialogRef;
639
+ };
640
+ InsparkDialogService.prototype.removeDialogComponentFromBody = function () {
641
+ this.appRef.detachView(this.dialogComponentRef.hostView);
642
+ this.dialogComponentRef.destroy();
643
+ };
644
+ InsparkDialogService.ctorParameters = function () { return [
645
+ { type: core.ComponentFactoryResolver },
646
+ { type: core.ApplicationRef },
647
+ { type: core.Injector }
648
+ ]; };
649
+ InsparkDialogService = __decorate([
650
+ core.Injectable(),
651
+ __metadata("design:paramtypes", [core.ComponentFactoryResolver, core.ApplicationRef, core.Injector])
652
+ ], InsparkDialogService);
653
+ return InsparkDialogService;
654
+ }());
655
+
601
656
  var CommunicationService = /** @class */ (function () {
602
657
  function CommunicationService() {
603
658
  this.messageSource = {};
@@ -1983,6 +2038,7 @@
1983
2038
  for (var i = 0; i < this.values.length; i++) {
1984
2039
  this.isShowGroup(this.values[i].groupKey[this.groupMode], i);
1985
2040
  }
2041
+ this.sortByGroup();
1986
2042
  };
1987
2043
  __decorate([
1988
2044
  core.Input(),
@@ -3932,6 +3988,7 @@
3932
3988
  exports.InlineMessageComponent = InlineMessageComponent;
3933
3989
  exports.InputTextComponent = InputTextComponent;
3934
3990
  exports.InsparkComponentsModule = InsparkComponentsModule;
3991
+ exports.InsparkDialogService = InsparkDialogService;
3935
3992
  exports.InsparkHeaderComponent = InsparkHeaderComponent;
3936
3993
  exports.InsparkMessageService = InsparkMessageService;
3937
3994
  exports.InsparkStickyComponent = InsparkStickyComponent;