@wizishop/angular-components 0.0.111 → 0.0.114
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 +4765 -4765
- package/bundles/wizishop-angular-components.umd.js +97 -69
- 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 +13 -21
- 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/wizishop-angular-components.js +16 -14
- package/fesm2015/wizishop-angular-components.js +77 -57
- package/fesm2015/wizishop-angular-components.js.map +1 -1
- package/lib/components/button/button.component.d.ts +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/wizishop-angular-components-0.0.114.tgz +0 -0
- package/wizishop-angular-components.d.ts +15 -13
- package/wizishop-angular-components.metadata.json +1 -1
- package/wizishop-angular-components-0.0.111.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
|
}
|
|
@@ -942,11 +979,9 @@
|
|
|
942
979
|
return this._isLoading;
|
|
943
980
|
},
|
|
944
981
|
set: function (isLoading) {
|
|
945
|
-
if (isLoading) {
|
|
946
|
-
this.launchLoading();
|
|
947
|
-
}
|
|
948
982
|
this._isLoading = isLoading;
|
|
949
983
|
this.isLoadingChange.next(isLoading);
|
|
984
|
+
this.toggleLoading();
|
|
950
985
|
},
|
|
951
986
|
enumerable: false,
|
|
952
987
|
configurable: true
|
|
@@ -956,25 +991,14 @@
|
|
|
956
991
|
this.waitForConfirmDelete = true;
|
|
957
992
|
}
|
|
958
993
|
};
|
|
959
|
-
ButtonComponent.prototype.
|
|
994
|
+
ButtonComponent.prototype.toggleLoading = function () {
|
|
960
995
|
var _this = this;
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
}
|
|
964
|
-
this.isLoading = true;
|
|
965
|
-
this.currentLoading = 10;
|
|
966
|
-
this.interval = setInterval(function () {
|
|
996
|
+
this.currentLoading = this.isLoading ? 10 : 100;
|
|
997
|
+
rxjs.interval(200).pipe(operators.takeWhile(function (time) { return _this.isLoading; })).subscribe(function () {
|
|
967
998
|
if (_this.currentLoading < 85) {
|
|
968
999
|
_this.currentLoading += Math.floor(Math.random() * 15);
|
|
969
1000
|
}
|
|
970
|
-
|
|
971
|
-
_this.currentLoading = 100;
|
|
972
|
-
setTimeout(function () {
|
|
973
|
-
clearInterval(_this.interval);
|
|
974
|
-
_this.interval = null;
|
|
975
|
-
}, 100);
|
|
976
|
-
}
|
|
977
|
-
}, 200);
|
|
1001
|
+
});
|
|
978
1002
|
};
|
|
979
1003
|
ButtonComponent.prototype.addMaxWidth = function () {
|
|
980
1004
|
this.buttonMaxWidth = this.buttonWidth + 'px';
|
|
@@ -990,12 +1014,16 @@
|
|
|
990
1014
|
this.waitForConfirmDelete = true;
|
|
991
1015
|
};
|
|
992
1016
|
ButtonComponent.prototype.onButtonClick = function (event) {
|
|
1017
|
+
var _this = this;
|
|
993
1018
|
event.stopPropagation();
|
|
994
1019
|
if (this.disabled) {
|
|
995
1020
|
return;
|
|
996
1021
|
}
|
|
997
1022
|
if (this.hasLoader) {
|
|
998
|
-
this.
|
|
1023
|
+
this.isLoading = false;
|
|
1024
|
+
setTimeout(function () {
|
|
1025
|
+
_this.isLoading = true;
|
|
1026
|
+
}, 0);
|
|
999
1027
|
}
|
|
1000
1028
|
if (!this.waitForConfirmDelete) {
|
|
1001
1029
|
this.click.emit(event);
|
|
@@ -1023,7 +1051,7 @@
|
|
|
1023
1051
|
ButtonComponent.decorators = [
|
|
1024
1052
|
{ type: i0.Component, args: [{
|
|
1025
1053
|
selector: 'wac-button',
|
|
1026
|
-
template: "<a\n [class]=\"'wac-button ' + extraClasses\"\n (click)=\"confirmDelete && waitForConfirmDelete ? addMaxWidthDelete() : '';onButtonClick($event);\"\n (mouseleave)=\"animation ? resetMaxWidth() : '';\"\n (mouseenter)=\"animation ? addMaxWidth() : '';\"\n wzAutoHide (clickOutside)=\"confirmDelete && !waitForConfirmDelete ? resetMaxWidthDelete() : ''\"\n [ngClass]=\"[\n label === '' ? 'alone' : '',\n animationRight ? 'animation-right' : '',\n animation ? 'animationText' : '',\n isLoading ? 'is-loading' : '',\n opacity ? 'opacity' : '',\n disabled ? 'disabled' : '',\n widthAuto ? 'width-auto' : '',\n whiteSpaceNowrap ? 'white-space-no-wrap' : '',\n !waitForConfirmDelete && confirmDelete ? 'step-delete' : '',\n confirmDelete ? 'deletePosition-' + confirmDeletePosition : ''\n ]\"\n [ngStyle]=\"{\n 'text-align': contentHorizontalPosition\n }\"\n>\n <span class=\"wac-button__wrapper\">\n <i *ngIf=\"icon !== ''\" [ngClass]=\"icon\" [style.font-size.px]=\"iconFontSize\"></i>\n {{ label }}\n <i *ngIf=\"iconNext !== ''\" [ngClass]=\"iconNext\" [style.font-size.px]=\"iconFontSize\"></i>\n </span>\n <span class=\"wac-button__animation\" [style.maxWidth]=\"buttonMaxWidth\" [style.width]=\"buttonWidth + 'px'\">\n <span #calculWidth class=\"wac-button__animation__text\" [innerHTML]=\"animationText\"></span>\n </span>\n <span class=\"wac-button__confirmDelete\" [style.maxWidth]=\"buttonMaxWidthDelete\" [style.width]=\"buttonWidthDelete + 'px'\">\n <span #calculWidthDelete class=\"wac-button__confirmDelete__text\" [innerHTML]=\"confirmDeleteText\"></span>\n </span>\n <span\n class=\"wac-button__loader\"\n [ngClass]=\"extraClasses.includes('is-outlined') ? 'outlined' : ''\"\n *ngIf=\"isLoading
|
|
1054
|
+
template: "<a\n [class]=\"'wac-button ' + extraClasses\"\n (click)=\"confirmDelete && waitForConfirmDelete ? addMaxWidthDelete() : '';onButtonClick($event);\"\n (mouseleave)=\"animation ? resetMaxWidth() : '';\"\n (mouseenter)=\"animation ? addMaxWidth() : '';\"\n wzAutoHide (clickOutside)=\"confirmDelete && !waitForConfirmDelete ? resetMaxWidthDelete() : ''\"\n [ngClass]=\"[\n label === '' ? 'alone' : '',\n animationRight ? 'animation-right' : '',\n animation ? 'animationText' : '',\n isLoading ? 'is-loading' : '',\n opacity ? 'opacity' : '',\n disabled ? 'disabled' : '',\n widthAuto ? 'width-auto' : '',\n whiteSpaceNowrap ? 'white-space-no-wrap' : '',\n !waitForConfirmDelete && confirmDelete ? 'step-delete' : '',\n confirmDelete ? 'deletePosition-' + confirmDeletePosition : ''\n ]\"\n [ngStyle]=\"{\n 'text-align': contentHorizontalPosition\n }\"\n>\n <span class=\"wac-button__wrapper\">\n <i *ngIf=\"icon !== ''\" [ngClass]=\"icon\" [style.font-size.px]=\"iconFontSize\"></i>\n {{ label }}\n <i *ngIf=\"iconNext !== ''\" [ngClass]=\"iconNext\" [style.font-size.px]=\"iconFontSize\"></i>\n </span>\n <span class=\"wac-button__animation\" [style.maxWidth]=\"buttonMaxWidth\" [style.width]=\"buttonWidth + 'px'\">\n <span #calculWidth class=\"wac-button__animation__text\" [innerHTML]=\"animationText\"></span>\n </span>\n <span class=\"wac-button__confirmDelete\" [style.maxWidth]=\"buttonMaxWidthDelete\" [style.width]=\"buttonWidthDelete + 'px'\">\n <span #calculWidthDelete class=\"wac-button__confirmDelete__text\" [innerHTML]=\"confirmDeleteText\"></span>\n </span>\n <span\n class=\"wac-button__loader\"\n [ngClass]=\"extraClasses.includes('is-outlined') ? 'outlined' : ''\"\n *ngIf=\"isLoading\"\n [style.width]=\"currentLoading + '%'\"\n >\n <span *ngIf=\"extraClasses.includes('is-outlined')\">\n <i *ngIf=\"icon !== ''\" [ngClass]=\"icon\" [style.font-size.px]=\"iconFontSize\"></i>\n {{ label }}\n <i *ngIf=\"iconNext !== ''\" [ngClass]=\"iconNext\" [style.font-size.px]=\"iconFontSize\"></i>\n </span>\n\n </span>\n</a>\n"
|
|
1027
1055
|
},] }
|
|
1028
1056
|
];
|
|
1029
1057
|
ButtonComponent.ctorParameters = function () { return []; };
|
|
@@ -3746,60 +3774,42 @@
|
|
|
3746
3774
|
|
|
3747
3775
|
var SelectedListComponent = /** @class */ (function () {
|
|
3748
3776
|
function SelectedListComponent() {
|
|
3777
|
+
this.options = [];
|
|
3749
3778
|
this.enableSelectAll = true;
|
|
3750
3779
|
this.selectedItemsIndex = new i0.EventEmitter();
|
|
3751
3780
|
this.selectedItemsAll = new i0.EventEmitter();
|
|
3752
3781
|
this.unSelectedItemsAll = new i0.EventEmitter();
|
|
3753
3782
|
this.selectedOptionIndex = [];
|
|
3754
|
-
this.switchSelectAll = false;
|
|
3755
3783
|
}
|
|
3756
3784
|
SelectedListComponent.prototype.ngOnInit = function () {
|
|
3757
|
-
if (typeof this.options !== typeof undefined) {
|
|
3758
|
-
this.checkSelectedItem();
|
|
3759
|
-
if (this.selectedOptionIndex.length === this.options.length) {
|
|
3760
|
-
this.switchSelectAll = true;
|
|
3761
|
-
}
|
|
3762
|
-
}
|
|
3763
3785
|
};
|
|
3764
|
-
SelectedListComponent.prototype.
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
_this.options[i].checked = true;
|
|
3769
|
-
_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;
|
|
3770
3790
|
});
|
|
3771
|
-
this.switchSelectAll = true;
|
|
3772
3791
|
this.selectedItemsAll.emit(this.selectedOptionIndex);
|
|
3773
3792
|
};
|
|
3774
|
-
SelectedListComponent.prototype.
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
if (eln.checked) {
|
|
3779
|
-
_this.selectedOptionIndex.push(i);
|
|
3780
|
-
}
|
|
3781
|
-
});
|
|
3782
|
-
};
|
|
3783
|
-
SelectedListComponent.prototype.unSelectAll = function () {
|
|
3784
|
-
var _this = this;
|
|
3785
|
-
this.selectedOptionIndex = [];
|
|
3786
|
-
this.options.forEach(function (eln, i) {
|
|
3787
|
-
_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;
|
|
3788
3797
|
});
|
|
3789
|
-
this.switchSelectAll = false;
|
|
3790
3798
|
this.unSelectedItemsAll.emit(this.selectedOptionIndex);
|
|
3791
3799
|
};
|
|
3792
|
-
SelectedListComponent.prototype.
|
|
3793
|
-
this.options[
|
|
3794
|
-
this.
|
|
3795
|
-
|
|
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; });
|
|
3796
3806
|
};
|
|
3797
3807
|
return SelectedListComponent;
|
|
3798
3808
|
}());
|
|
3799
3809
|
SelectedListComponent.decorators = [
|
|
3800
3810
|
{ type: i0.Component, args: [{
|
|
3801
3811
|
selector: 'wac-selected-list',
|
|
3802
|
-
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"
|
|
3803
3813
|
},] }
|
|
3804
3814
|
];
|
|
3805
3815
|
SelectedListComponent.propDecorators = {
|
|
@@ -3945,9 +3955,25 @@
|
|
|
3945
3955
|
},] }
|
|
3946
3956
|
];
|
|
3947
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
|
+
|
|
3948
3973
|
var exportedPipes = [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe];
|
|
3949
3974
|
var pipes$1 = [
|
|
3950
|
-
SelectFiltersPipe
|
|
3975
|
+
SelectFiltersPipe,
|
|
3976
|
+
AreAllOptionsSelectedPipe
|
|
3951
3977
|
];
|
|
3952
3978
|
var SharedPipes = /** @class */ (function () {
|
|
3953
3979
|
function SharedPipes() {
|
|
@@ -4186,19 +4212,21 @@
|
|
|
4186
4212
|
exports.WzEditInPlaceComponent = WzEditInPlaceComponent;
|
|
4187
4213
|
exports.ZindexToggleDirective = ZindexToggleDirective;
|
|
4188
4214
|
exports.ɵa = DomService;
|
|
4189
|
-
exports.ɵb =
|
|
4190
|
-
exports.ɵc =
|
|
4191
|
-
exports.ɵd =
|
|
4192
|
-
exports.ɵe =
|
|
4193
|
-
exports.ɵf =
|
|
4194
|
-
exports.ɵg =
|
|
4195
|
-
exports.ɵh =
|
|
4196
|
-
exports.ɵi =
|
|
4197
|
-
exports.ɵj =
|
|
4198
|
-
exports.ɵk =
|
|
4199
|
-
exports.ɵl =
|
|
4200
|
-
exports.ɵm =
|
|
4201
|
-
exports.ɵn =
|
|
4215
|
+
exports.ɵb = VarDirective;
|
|
4216
|
+
exports.ɵc = AreAllOptionsSelectedPipe;
|
|
4217
|
+
exports.ɵd = PaginationModule;
|
|
4218
|
+
exports.ɵe = PagniationArrayTotalPages;
|
|
4219
|
+
exports.ɵf = PagniationIsLastPage;
|
|
4220
|
+
exports.ɵg = PagniationText;
|
|
4221
|
+
exports.ɵh = TableModule;
|
|
4222
|
+
exports.ɵi = InputSearchModule;
|
|
4223
|
+
exports.ɵj = InputModule;
|
|
4224
|
+
exports.ɵk = TooltipModule;
|
|
4225
|
+
exports.ɵl = ProgressBarModule;
|
|
4226
|
+
exports.ɵm = LoaderModule;
|
|
4227
|
+
exports.ɵn = CheckboxModule;
|
|
4228
|
+
exports.ɵo = inOutY;
|
|
4229
|
+
exports.ɵp = inOutX;
|
|
4202
4230
|
|
|
4203
4231
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4204
4232
|
|