@wizishop/angular-components 0.0.112 → 0.0.115

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.
@@ -596,7 +596,44 @@
596
596
  isActive: [{ type: i0.Input, args: ['zIndexToggle',] }]
597
597
  };
598
598
 
599
- var directives = [DebounceKeyupDirective, AbstractDebounceDirective, AutoHideDirective, ZindexToggleDirective];
599
+ var VarDirective = /** @class */ (function () {
600
+ function VarDirective(templateRef, vcRef) {
601
+ this.templateRef = templateRef;
602
+ this.vcRef = vcRef;
603
+ this.context = {
604
+ $implicit: null,
605
+ ngVar: null,
606
+ };
607
+ this.hasView = false;
608
+ }
609
+ Object.defineProperty(VarDirective.prototype, "ngVar", {
610
+ // https://stackoverflow.com/questions/38582293/how-to-declare-a-variable-in-a-template-in-angular
611
+ set: function (context) {
612
+ this.context.$implicit = this.context.ngVar = context;
613
+ if (!this.hasView) {
614
+ this.vcRef.createEmbeddedView(this.templateRef, this.context);
615
+ this.hasView = true;
616
+ }
617
+ },
618
+ enumerable: false,
619
+ configurable: true
620
+ });
621
+ return VarDirective;
622
+ }());
623
+ VarDirective.decorators = [
624
+ { type: i0.Directive, args: [{
625
+ selector: '[ngVar]',
626
+ },] }
627
+ ];
628
+ VarDirective.ctorParameters = function () { return [
629
+ { type: i0.TemplateRef },
630
+ { type: i0.ViewContainerRef }
631
+ ]; };
632
+ VarDirective.propDecorators = {
633
+ ngVar: [{ type: i0.Input }]
634
+ };
635
+
636
+ var directives = [DebounceKeyupDirective, AbstractDebounceDirective, AutoHideDirective, ZindexToggleDirective, VarDirective];
600
637
  var SharedDirectives = /** @class */ (function () {
601
638
  function SharedDirectives() {
602
639
  }
@@ -962,20 +999,6 @@
962
999
  _this.currentLoading += Math.floor(Math.random() * 15);
963
1000
  }
964
1001
  });
965
- /* this.interval = setInterval(() => {
966
-
967
- if (this.currentLoading < 85) {
968
- this.currentLoading += Math.floor(Math.random() * 15);
969
- }
970
-
971
- if (!this.isLoading) {
972
- this.currentLoading = 100;
973
-
974
- setTimeout(() => {
975
- clearInterval(this.interval);
976
- }, 100);
977
- }
978
- }, 200); */
979
1002
  };
980
1003
  ButtonComponent.prototype.addMaxWidth = function () {
981
1004
  this.buttonMaxWidth = this.buttonWidth + 'px';
@@ -3751,60 +3774,42 @@
3751
3774
 
3752
3775
  var SelectedListComponent = /** @class */ (function () {
3753
3776
  function SelectedListComponent() {
3777
+ this.options = [];
3754
3778
  this.enableSelectAll = true;
3755
3779
  this.selectedItemsIndex = new i0.EventEmitter();
3756
3780
  this.selectedItemsAll = new i0.EventEmitter();
3757
3781
  this.unSelectedItemsAll = new i0.EventEmitter();
3758
3782
  this.selectedOptionIndex = [];
3759
- this.switchSelectAll = false;
3760
3783
  }
3761
3784
  SelectedListComponent.prototype.ngOnInit = function () {
3762
- if (typeof this.options !== typeof undefined) {
3763
- this.checkSelectedItem();
3764
- if (this.selectedOptionIndex.length === this.options.length) {
3765
- this.switchSelectAll = true;
3766
- }
3767
- }
3768
3785
  };
3769
- SelectedListComponent.prototype.selectAll = function () {
3770
- var _this = this;
3771
- this.selectedOptionIndex = [];
3772
- this.options.forEach(function (eln, i) {
3773
- _this.options[i].checked = true;
3774
- _this.selectedOptionIndex.push(i);
3786
+ SelectedListComponent.prototype.onSelectAll = function () {
3787
+ this.selectedOptionIndex = this.options.map(function (option, index) {
3788
+ option.checked = true;
3789
+ return index;
3775
3790
  });
3776
- this.switchSelectAll = true;
3777
3791
  this.selectedItemsAll.emit(this.selectedOptionIndex);
3778
3792
  };
3779
- SelectedListComponent.prototype.checkSelectedItem = function () {
3780
- var _this = this;
3781
- this.selectedOptionIndex = [];
3782
- this.options.forEach(function (eln, i) {
3783
- if (eln.checked) {
3784
- _this.selectedOptionIndex.push(i);
3785
- }
3786
- });
3787
- };
3788
- SelectedListComponent.prototype.unSelectAll = function () {
3789
- var _this = this;
3790
- this.selectedOptionIndex = [];
3791
- this.options.forEach(function (eln, i) {
3792
- _this.options[i].checked = false;
3793
+ SelectedListComponent.prototype.onUnSelectAll = function () {
3794
+ this.selectedOptionIndex = this.options.map(function (option, index) {
3795
+ option.checked = false;
3796
+ return index;
3793
3797
  });
3794
- this.switchSelectAll = false;
3795
3798
  this.unSelectedItemsAll.emit(this.selectedOptionIndex);
3796
3799
  };
3797
- SelectedListComponent.prototype.selectItem = function (i) {
3798
- this.options[i].checked = !this.options[i].checked;
3799
- this.checkSelectedItem();
3800
- this.selectedItemsIndex.emit(i);
3800
+ SelectedListComponent.prototype.onSelectItem = function (index) {
3801
+ this.options[index].checked = !this.options[index].checked;
3802
+ this.selectedItemsIndex.emit(index);
3803
+ };
3804
+ SelectedListComponent.prototype.areAllOptionsChecked = function () {
3805
+ return !this.options.some(function (option) { return !option.checked; });
3801
3806
  };
3802
3807
  return SelectedListComponent;
3803
3808
  }());
3804
3809
  SelectedListComponent.decorators = [
3805
3810
  { type: i0.Component, args: [{
3806
3811
  selector: 'wac-selected-list',
3807
- template: "<div class=\"selected-list\">\n <div class=\"selected-list__wrapper\">\n <div class=\"selected-list__wrapper__head\">\n <p *ngIf=\"label\" [innerHTML]=\"label\"></p>\n <span *ngIf=\"textSelectAll && !switchSelectAll\" [innerHTML]=\"textSelectAll\" (click)=\"selectAll()\"></span>\n <span *ngIf=\"textUnSelectAll && switchSelectAll\" [innerHTML]=\"textUnSelectAll\" (click)=\"unSelectAll()\"></span>\n </div>\n <div class=\"selected-list__wrapper__content\">\n <div class=\"selected-list__wrapper__content__item\" *ngFor=\"let item of options;let i = index;\" [ngClass]=\"{'active': item.checked}\" (click)=\"selectItem(i)\">\n <span [innerHTML]=\"item.label\"></span>\n <i class=\"fas fa-check\"></i>\n </div>\n </div>\n </div>\n</div>\n"
3812
+ template: "<div class=\"selected-list\">\n <div class=\"selected-list__wrapper\">\n <div class=\"selected-list__wrapper__head\">\n <p *ngIf=\"label\" [innerHTML]=\"label\"></p>\n <ng-container *ngVar=\"(options | areAllOptionsSelected) as areAllOptionsSelected\">\n <span *ngIf=\"textSelectAll && !areAllOptionsSelected\" [innerHTML]=\"textSelectAll\" (click)=\"onSelectAll()\"></span>\n <span *ngIf=\"textUnSelectAll && areAllOptionsSelected\" [innerHTML]=\"textUnSelectAll\" (click)=\"onUnSelectAll()\"></span>\n </ng-container>\n\n </div>\n <div class=\"selected-list__wrapper__content\">\n <div class=\"selected-list__wrapper__content__item\" *ngFor=\"let item of options;let i = index;\" [ngClass]=\"{'active': item.checked}\" (click)=\"onSelectItem(i)\">\n <span [innerHTML]=\"item.label\"></span>\n <i class=\"fas fa-check\"></i>\n </div>\n </div>\n </div>\n</div>\n"
3808
3813
  },] }
3809
3814
  ];
3810
3815
  SelectedListComponent.propDecorators = {
@@ -3950,9 +3955,25 @@
3950
3955
  },] }
3951
3956
  ];
3952
3957
 
3958
+ var AreAllOptionsSelectedPipe = /** @class */ (function () {
3959
+ function AreAllOptionsSelectedPipe() {
3960
+ }
3961
+ AreAllOptionsSelectedPipe.prototype.transform = function (options) {
3962
+ return !options.some(function (option) { return !option.checked; });
3963
+ };
3964
+ return AreAllOptionsSelectedPipe;
3965
+ }());
3966
+ AreAllOptionsSelectedPipe.decorators = [
3967
+ { type: i0.Pipe, args: [{
3968
+ name: 'areAllOptionsSelected',
3969
+ pure: false
3970
+ },] }
3971
+ ];
3972
+
3953
3973
  var exportedPipes = [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe];
3954
3974
  var pipes$1 = [
3955
- SelectFiltersPipe
3975
+ SelectFiltersPipe,
3976
+ AreAllOptionsSelectedPipe
3956
3977
  ];
3957
3978
  var SharedPipes = /** @class */ (function () {
3958
3979
  function SharedPipes() {
@@ -4123,6 +4144,7 @@
4123
4144
  exports.AlertPopupComponent = AlertPopupComponent;
4124
4145
  exports.AlertPopupModule = AlertPopupModule;
4125
4146
  exports.AlertPopupService = AlertPopupService;
4147
+ exports.AreAllOptionsSelectedPipe = AreAllOptionsSelectedPipe;
4126
4148
  exports.AutoHideDirective = AutoHideDirective;
4127
4149
  exports.BackComponent = BackComponent;
4128
4150
  exports.BlockComponent = BlockComponent;
@@ -4185,6 +4207,7 @@
4185
4207
  exports.TreeComponent = TreeComponent;
4186
4208
  exports.TreeModule = TreeModule;
4187
4209
  exports.UploadComponent = UploadComponent;
4210
+ exports.VarDirective = VarDirective;
4188
4211
  exports.WiziComponentsModule = WiziComponentsModule;
4189
4212
  exports.WrapperBlocsComponent = WrapperBlocsComponent;
4190
4213
  exports.WrapperComponent = WrapperComponent;