@wizishop/angular-components 0.0.36 → 0.0.40

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.
Files changed (26) hide show
  1. package/angular-components.scss +3941 -3760
  2. package/bundles/wizishop-angular-components.umd.js +136 -18
  3. package/bundles/wizishop-angular-components.umd.js.map +1 -1
  4. package/bundles/wizishop-angular-components.umd.min.js +2 -2
  5. package/bundles/wizishop-angular-components.umd.min.js.map +1 -1
  6. package/esm2015/lib/components/alert-popup/alert-popup-module.js +16 -0
  7. package/esm2015/lib/components/alert-popup/alert-popup.component.js +41 -0
  8. package/esm2015/lib/components/alert-popup/alert-popup.service.js +30 -0
  9. package/esm2015/lib/components/dropdown/dropdown.component.js +2 -2
  10. package/esm2015/lib/components/header-page/header-page.component.js +2 -2
  11. package/esm2015/lib/components/shared-components.module.js +6 -2
  12. package/esm2015/lib/services/dom.service.js +28 -4
  13. package/esm2015/public-api.js +3 -1
  14. package/esm2015/wizishop-angular-components.js +3 -2
  15. package/fesm2015/wizishop-angular-components.js +111 -7
  16. package/fesm2015/wizishop-angular-components.js.map +1 -1
  17. package/lib/components/alert-popup/alert-popup-module.d.ts +2 -0
  18. package/lib/components/alert-popup/alert-popup.component.d.ts +16 -0
  19. package/lib/components/alert-popup/alert-popup.service.d.ts +19 -0
  20. package/lib/services/dom.service.d.ts +11 -0
  21. package/package.json +1 -1
  22. package/public-api.d.ts +2 -0
  23. package/wizishop-angular-components-0.0.40.tgz +0 -0
  24. package/wizishop-angular-components.d.ts +2 -1
  25. package/wizishop-angular-components.metadata.json +1 -1
  26. package/wizishop-angular-components-0.0.36.tgz +0 -0
@@ -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')) :
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'], 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']));
5
- }(this, (function (exports, i1, i0, common, forms, ngxPerfectScrollbar, rxjs, operators, table, animations, ngxChips, uuid, core) { '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 []; };
@@ -1676,7 +1704,7 @@
1676
1704
  HeaderPageComponent.decorators = [
1677
1705
  { type: i0.Component, args: [{
1678
1706
  selector: 'wac-header-page',
1679
- template: "<div class=\"wac-header-page\">\n <div class=\"wac-header-page__maxWidth\">\n <div class=\"wac-header-page__maxWidth__top\">\n <div class=\"wac-header-page__maxWidth__top__left\">\n <a *ngIf=\"linkBack\" [href]=\"linkBack\"><i class=\"fas fa-chevron-left\"></i></a>\n <wac-h1>{{ title }}<ng-content select=\"[role=header]\"></ng-content></wac-h1>\n </div>\n <div class=\"wac-header-page__maxWidth__top__right\">\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n</div>\n"
1707
+ template: "<div class=\"wac-header-page\">\n <div class=\"wac-header-page__maxWidth\">\n <div class=\"wac-header-page__maxWidth__top\">\n <div class=\"wac-header-page__maxWidth__top__left\">\n <a *ngIf=\"linkBack\" [routerLink]=\"linkBack\"><i class=\"fas fa-chevron-left\"></i></a>\n <wac-h1>{{ title }}<ng-content select=\"[role=header]\"></ng-content></wac-h1>\n </div>\n <div class=\"wac-header-page__maxWidth__top__right\">\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n</div>\n"
1680
1708
  },] }
1681
1709
  ];
1682
1710
  HeaderPageComponent.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' : '')\"\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 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,
@@ -3511,7 +3624,9 @@
3511
3624
  InputModule,
3512
3625
  LoaderModule,
3513
3626
  ProgressBarModule,
3514
- ngxPerfectScrollbar.PerfectScrollbarModule
3627
+ ngxPerfectScrollbar.PerfectScrollbarModule,
3628
+ AlertPopupModule,
3629
+ router.RouterModule
3515
3630
  ],
3516
3631
  declarations: components,
3517
3632
  exports: __spread(components, exportsFromModule)
@@ -3529,7 +3644,7 @@
3529
3644
  common.CommonModule,
3530
3645
  SharedComponentsModule,
3531
3646
  SharedDirectives,
3532
- i1.NwbAllModule
3647
+ i1$1.NwbAllModule
3533
3648
  ],
3534
3649
  exports: [SharedComponentsModule, SharedDirectives]
3535
3650
  },] }
@@ -3545,6 +3660,8 @@
3545
3660
 
3546
3661
  exports.AbstractDebounceDirective = AbstractDebounceDirective;
3547
3662
  exports.AlertComponent = AlertComponent;
3663
+ exports.AlertPopupComponent = AlertPopupComponent;
3664
+ exports.AlertPopupService = AlertPopupService;
3548
3665
  exports.AutoHideDirective = AutoHideDirective;
3549
3666
  exports.BackComponent = BackComponent;
3550
3667
  exports.BlockComponent = BlockComponent;
@@ -3616,7 +3733,8 @@
3616
3733
  exports.ɵk = LoaderModule;
3617
3734
  exports.ɵl = CheckboxModule;
3618
3735
  exports.ɵm = inOutY;
3619
- exports.ɵn = inOutX;
3736
+ exports.ɵn = AlertPopupModule;
3737
+ exports.ɵo = inOutX;
3620
3738
 
3621
3739
  Object.defineProperty(exports, '__esModule', { value: true });
3622
3740