@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.
- package/angular-components.scss +4783 -4783
- package/bundles/wizishop-angular-components.umd.js +73 -50
- package/bundles/wizishop-angular-components.umd.js.map +1 -1
- package/bundles/wizishop-angular-components.umd.min.js +1 -1
- package/bundles/wizishop-angular-components.umd.min.js.map +1 -1
- package/esm2015/lib/components/button/button.component.js +1 -15
- package/esm2015/lib/components/selected-list/selected-list.component.js +17 -32
- package/esm2015/lib/directives/ng-var.directive.js +33 -0
- package/esm2015/lib/directives/shared-directives.module.js +3 -2
- package/esm2015/lib/pipes/selected-list/are-all-options-selected.pipe.js +13 -0
- package/esm2015/lib/pipes/shared-pipes.module.js +4 -2
- package/esm2015/public-api.js +3 -1
- package/fesm2015/wizishop-angular-components.js +65 -49
- package/fesm2015/wizishop-angular-components.js.map +1 -1
- package/lib/components/selected-list/selected-list.component.d.ts +4 -5
- package/lib/directives/ng-var.directive.d.ts +9 -0
- package/lib/pipes/selected-list/are-all-options-selected.pipe.d.ts +5 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
- package/wizishop-angular-components-0.0.115.tgz +0 -0
- package/wizishop-angular-components.metadata.json +1 -1
- package/wizishop-angular-components-0.0.112.tgz +0 -0
|
@@ -596,7 +596,44 @@
|
|
|
596
596
|
isActive: [{ type: i0.Input, args: ['zIndexToggle',] }]
|
|
597
597
|
};
|
|
598
598
|
|
|
599
|
-
var
|
|
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.
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
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.
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
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.
|
|
3798
|
-
this.options[
|
|
3799
|
-
this.
|
|
3800
|
-
|
|
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 && !
|
|
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;
|