@wizishop/angular-components 0.0.37 → 0.0.41

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('@wizishop/ng-wizi-bulma'), require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('ngx-perfect-scrollbar'), require('rxjs'), require('rxjs/operators'), require('@angular/cdk/table'), require('@angular/animations'), require('ngx-chips'), require('uuid'), require('@ngx-translate/core'), require('@angular/router')) :
3
- typeof define === 'function' && define.amd ? define('@wizishop/angular-components', ['exports', '@wizishop/ng-wizi-bulma', '@angular/core', '@angular/common', '@angular/forms', 'ngx-perfect-scrollbar', 'rxjs', 'rxjs/operators', '@angular/cdk/table', '@angular/animations', 'ngx-chips', 'uuid', '@ngx-translate/core', '@angular/router'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wizishop = global.wizishop || {}, global.wizishop['angular-components'] = {}), global['ng-wizi-bulma'], global.ng.core, global.ng.common, global.ng.forms, global['ngx-perfect-scrollbar'], global.rxjs, global.rxjs.operators, global.ng.cdk.table, global.ng.animations, global['ngx-chips'], global.uuid, global['@ngx-translate/core'], global.ng.router));
5
- }(this, (function (exports, i1, i0, common, forms, ngxPerfectScrollbar, rxjs, operators, table, animations, ngxChips, uuid, core, router) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@wizishop/ng-wizi-bulma'), require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('ngx-perfect-scrollbar'), require('rxjs'), require('rxjs/operators'), require('@angular/cdk/overlay'), require('@angular/cdk/table'), require('@angular/animations'), require('ngx-chips'), require('uuid'), require('@ngx-translate/core'), require('@angular/router')) :
3
+ typeof define === 'function' && define.amd ? define('@wizishop/angular-components', ['exports', '@wizishop/ng-wizi-bulma', '@angular/core', '@angular/common', '@angular/forms', 'ngx-perfect-scrollbar', 'rxjs', 'rxjs/operators', '@angular/cdk/overlay', '@angular/cdk/table', '@angular/animations', 'ngx-chips', 'uuid', '@ngx-translate/core', '@angular/router'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wizishop = global.wizishop || {}, global.wizishop['angular-components'] = {}), global['ng-wizi-bulma'], global.ng.core, global.ng.common, global.ng.forms, global['ngx-perfect-scrollbar'], global.rxjs, global.rxjs.operators, global.ng.cdk.overlay, global.ng.cdk.table, global.ng.animations, global['ngx-chips'], global.uuid, global['@ngx-translate/core'], global.ng.router));
5
+ }(this, (function (exports, i1$1, i0, common, forms, ngxPerfectScrollbar, rxjs, operators, i1, table, animations, ngxChips, uuid, core, router) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -230,10 +230,16 @@
230
230
  r[k] = a[j];
231
231
  return r;
232
232
  }
233
- function __spreadArray(to, from) {
234
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
235
- to[j] = from[i];
236
- return to;
233
+ function __spreadArray(to, from, pack) {
234
+ if (pack || arguments.length === 2)
235
+ for (var i = 0, l = from.length, ar; i < l; i++) {
236
+ if (ar || !(i in from)) {
237
+ if (!ar)
238
+ ar = Array.prototype.slice.call(from, 0, i);
239
+ ar[i] = from[i];
240
+ }
241
+ }
242
+ return to.concat(ar || Array.prototype.slice.call(from));
237
243
  }
238
244
  function __await(v) {
239
245
  return this instanceof __await ? (this.v = v, this) : new __await(v);
@@ -442,7 +448,11 @@
442
448
  };
443
449
 
444
450
  var DomService = /** @class */ (function () {
445
- function DomService() {
451
+ function DomService(componentFactoryResolver, appRef, injector, overlayContainer) {
452
+ this.componentFactoryResolver = componentFactoryResolver;
453
+ this.appRef = appRef;
454
+ this.injector = injector;
455
+ this.overlayContainer = overlayContainer;
446
456
  this.documentEventSource = new rxjs.Subject();
447
457
  this.documentEventDone = this.documentEventSource.asObservable();
448
458
  this.eventInitialisation = true;
@@ -472,14 +482,32 @@
472
482
  _this.documentScrollSource.next(window);
473
483
  };
474
484
  };
485
+ DomService.prototype.attachComponentPortal = function (component, injector) {
486
+ var componentRef = this.componentFactoryResolver
487
+ .resolveComponentFactory(component)
488
+ .create(injector ? injector : this.injector);
489
+ this.appRef.attachView(componentRef.hostView);
490
+ this.overlayContainer.getContainerElement().appendChild(this._getComponentRootNode(componentRef));
491
+ return componentRef;
492
+ };
493
+ /** Gets the root HTMLElement for an instantiated component. */
494
+ DomService.prototype._getComponentRootNode = function (componentRef) {
495
+ return componentRef.hostView.rootNodes[0];
496
+ };
475
497
  return DomService;
476
498
  }());
477
- DomService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DomService_Factory() { return new DomService(); }, token: DomService, providedIn: "root" });
499
+ DomService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DomService_Factory() { return new DomService(i0.ɵɵinject(i0.ComponentFactoryResolver), i0.ɵɵinject(i0.ApplicationRef), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(i1.OverlayContainer)); }, token: DomService, providedIn: "root" });
478
500
  DomService.decorators = [
479
501
  { type: i0.Injectable, args: [{
480
502
  providedIn: 'root'
481
503
  },] }
482
504
  ];
505
+ DomService.ctorParameters = function () { return [
506
+ { type: i0.ComponentFactoryResolver },
507
+ { type: i0.ApplicationRef },
508
+ { type: i0.Injector },
509
+ { type: i1.OverlayContainer }
510
+ ]; };
483
511
 
484
512
  var AutoHideDirective = /** @class */ (function () {
485
513
  function AutoHideDirective(_elementRef, domService) {
@@ -707,14 +735,14 @@
707
735
  };
708
736
  return FiltersTableService;
709
737
  }());
710
- FiltersTableService.ɵprov = i0.ɵɵdefineInjectable({ factory: function FiltersTableService_Factory() { return new FiltersTableService(i0.ɵɵinject(i1.NwbFilterRoutingBuilder)); }, token: FiltersTableService, providedIn: "root" });
738
+ FiltersTableService.ɵprov = i0.ɵɵdefineInjectable({ factory: function FiltersTableService_Factory() { return new FiltersTableService(i0.ɵɵinject(i1$1.NwbFilterRoutingBuilder)); }, token: FiltersTableService, providedIn: "root" });
711
739
  FiltersTableService.decorators = [
712
740
  { type: i0.Injectable, args: [{
713
741
  providedIn: 'root'
714
742
  },] }
715
743
  ];
716
744
  FiltersTableService.ctorParameters = function () { return [
717
- { type: i1.NwbFilterRoutingBuilder }
745
+ { type: i1$1.NwbFilterRoutingBuilder }
718
746
  ]; };
719
747
 
720
748
  var TableComponent = /** @class */ (function () {
@@ -994,7 +1022,7 @@
994
1022
  DropdownComponent.decorators = [
995
1023
  { type: i0.Component, args: [{
996
1024
  selector: 'wac-dropdown',
997
- template: "<div class=\"wac-dropdown\">\n <div class=\"wac-dropdown__wrapper\">\n <i class=\"wac-dropdown__wrapper__icon far fa-ellipsis-v\"></i>\n <div class=\"wac-dropdown__wrapper__sublevel\">\n <ul class=\"wac-dropdown__wrapper__sublevel__container\">\n <li\n *ngFor=\"let item of items\"\n class=\"wac-dropdown__wrapper__sublevel__container__item\"\n (click)=\"onUserInput(item.index)\"\n >\n <i\n *ngIf=\"hasIcons\"\n [class]=\"item.icon\"\n [style.font-size.px]=\"item.iconFontSize ? item.iconFontSize : '14'\"\n ></i>\n {{ item.label }}\n </li>\n </ul>\n </div>\n </div>\n</div>\n"
1025
+ template: "<div class=\"wac-dropdown\">\n <div class=\"wac-dropdown__wrapper\">\n <i class=\"wac-dropdown__wrapper__icon far fa-ellipsis-v\"></i>\n <div class=\"wac-dropdown__wrapper__sublevel\">\n <ul class=\"wac-dropdown__wrapper__sublevel__container\">\n <li\n *ngFor=\"let item of items\"\n class=\"wac-dropdown__wrapper__sublevel__container__item\"\n (click)=\"onUserInput(item.index)\"\n >\n <i\n *ngIf=\"hasIcons\"\n [class]=\"item.icon\"\n [style.font-size.px]=\"item.iconFontSize ? item.iconFontSize : '14'\"\n ></i>\n <span>{{ item.label }}</span>\n </li>\n </ul>\n </div>\n </div>\n</div>\n"
998
1026
  },] }
999
1027
  ];
1000
1028
  DropdownComponent.ctorParameters = function () { return []; };
@@ -3432,6 +3460,91 @@
3432
3460
  response: [{ type: i0.Output }]
3433
3461
  };
3434
3462
 
3463
+ var AlertPopupComponent = /** @class */ (function () {
3464
+ function AlertPopupComponent() {
3465
+ /** Subject for notifying the user that the dialog has finished closing. */
3466
+ this.afterClosedPopup = new rxjs.Subject();
3467
+ this.open = false;
3468
+ }
3469
+ AlertPopupComponent.prototype.ngOnInit = function () {
3470
+ var _this = this;
3471
+ setTimeout(function () {
3472
+ _this.open = true;
3473
+ }, 50);
3474
+ if (this.config.duration > 0) {
3475
+ this.timer = setTimeout(function () { return _this.dismiss(); }, this.config.duration);
3476
+ }
3477
+ };
3478
+ AlertPopupComponent.prototype.dismiss = function () {
3479
+ var _this = this;
3480
+ this.open = false;
3481
+ setTimeout(function () {
3482
+ _this.afterClosedPopup.next(true);
3483
+ _this.afterClosedPopup.complete();
3484
+ }, 200);
3485
+ };
3486
+ /**
3487
+ * Gets an observable that is notified when the dialog is finished closing.
3488
+ */
3489
+ AlertPopupComponent.prototype.afterClosed = function () {
3490
+ return this.afterClosedPopup.asObservable();
3491
+ };
3492
+ return AlertPopupComponent;
3493
+ }());
3494
+ AlertPopupComponent.decorators = [
3495
+ { type: i0.Component, args: [{
3496
+ selector: 'wac-alert-popup',
3497
+ template: "<div\n [class]=\"'alert ' + ((config.color) ? config.color : ' is-primary') + ((config.extraClasses) ? ' ' + config.extraClasses : '') + ((config.position) ? ' ' + config.position : '') + ((config.fullsize) ? ' fullsize' : '') + ((config.opacity) ? ' opacity-active' : '') + ((config.small) ? ' small' : '')\"\n [ngClass]=\"{'is-active': open}\"\n>\n <div class=\"alert--message\">\n <span class=\"icon\" *ngIf=\"config.icon\">\n <i [class]=\"config.icon\"></i>\n </span>\n <span (click)=\"dismiss()\" class=\"wac-alert-popup__close\"><i class=\"fas fa-times\"></i></span>\n <p *ngIf=\"config.title\" class=\"wac-alert-popup__title\" [innerHTML]=\"config.title\"></p>\n <p *ngIf=\"config.message\" class=\"wac-alert-popup__text\" [innerHTML]=\"config.message\"></p>\n </div>\n</div>\n",
3498
+ host: {
3499
+ class: 'wac-alert-popup'
3500
+ },
3501
+ encapsulation: i0.ViewEncapsulation.None
3502
+ },] }
3503
+ ];
3504
+
3505
+ var AlertPopupService = /** @class */ (function () {
3506
+ function AlertPopupService(domService) {
3507
+ this.domService = domService;
3508
+ }
3509
+ AlertPopupService.prototype.open = function (config) {
3510
+ var componentRef = this.getComponentRef(config);
3511
+ return componentRef.instance;
3512
+ };
3513
+ AlertPopupService.prototype.getComponentRef = function (config) {
3514
+ var componentRef = this.domService.attachComponentPortal(AlertPopupComponent);
3515
+ config = Object.assign({
3516
+ position: 'is-top'
3517
+ }, config);
3518
+ componentRef.instance.config = config;
3519
+ componentRef.instance.afterClosed().subscribe(function () {
3520
+ componentRef.destroy();
3521
+ });
3522
+ return componentRef;
3523
+ };
3524
+ return AlertPopupService;
3525
+ }());
3526
+ AlertPopupService.decorators = [
3527
+ { type: i0.Injectable }
3528
+ ];
3529
+ AlertPopupService.ctorParameters = function () { return [
3530
+ { type: DomService }
3531
+ ]; };
3532
+
3533
+ var AlertPopupModule = /** @class */ (function () {
3534
+ function AlertPopupModule() {
3535
+ }
3536
+ return AlertPopupModule;
3537
+ }());
3538
+ AlertPopupModule.decorators = [
3539
+ { type: i0.NgModule, args: [{
3540
+ imports: [common.CommonModule],
3541
+ providers: [AlertPopupService],
3542
+ entryComponents: [AlertPopupComponent],
3543
+ declarations: [AlertPopupComponent],
3544
+ exports: [AlertPopupComponent]
3545
+ },] }
3546
+ ];
3547
+
3435
3548
  var components = [
3436
3549
  TagComponent,
3437
3550
  TabComponent,
@@ -3497,7 +3610,7 @@
3497
3610
  imports: [
3498
3611
  common.CommonModule,
3499
3612
  forms.FormsModule,
3500
- i1.NwbAllModule,
3613
+ i1$1.NwbAllModule,
3501
3614
  core.TranslateModule.forChild(),
3502
3615
  forms.ReactiveFormsModule,
3503
3616
  SharedDirectives,
@@ -3512,6 +3625,7 @@
3512
3625
  LoaderModule,
3513
3626
  ProgressBarModule,
3514
3627
  ngxPerfectScrollbar.PerfectScrollbarModule,
3628
+ AlertPopupModule,
3515
3629
  router.RouterModule
3516
3630
  ],
3517
3631
  declarations: components,
@@ -3530,7 +3644,7 @@
3530
3644
  common.CommonModule,
3531
3645
  SharedComponentsModule,
3532
3646
  SharedDirectives,
3533
- i1.NwbAllModule
3647
+ i1$1.NwbAllModule
3534
3648
  ],
3535
3649
  exports: [SharedComponentsModule, SharedDirectives]
3536
3650
  },] }
@@ -3546,6 +3660,8 @@
3546
3660
 
3547
3661
  exports.AbstractDebounceDirective = AbstractDebounceDirective;
3548
3662
  exports.AlertComponent = AlertComponent;
3663
+ exports.AlertPopupComponent = AlertPopupComponent;
3664
+ exports.AlertPopupService = AlertPopupService;
3549
3665
  exports.AutoHideDirective = AutoHideDirective;
3550
3666
  exports.BackComponent = BackComponent;
3551
3667
  exports.BlockComponent = BlockComponent;
@@ -3617,7 +3733,8 @@
3617
3733
  exports.ɵk = LoaderModule;
3618
3734
  exports.ɵl = CheckboxModule;
3619
3735
  exports.ɵm = inOutY;
3620
- exports.ɵn = inOutX;
3736
+ exports.ɵn = AlertPopupModule;
3737
+ exports.ɵo = inOutX;
3621
3738
 
3622
3739
  Object.defineProperty(exports, '__esModule', { value: true });
3623
3740