@wizishop/angular-components 0.0.57 → 0.0.61
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 +1822 -1501
- package/bundles/wizishop-angular-components.umd.js +106 -6
- 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 +39 -4
- package/esm2015/lib/components/search/search.component.js +60 -0
- package/esm2015/lib/components/search/shared/search-option.model.js +2 -0
- package/esm2015/lib/components/shared-components.module.js +4 -2
- package/esm2015/lib/components/tag/tag.component.js +5 -3
- package/esm2015/public-api.js +3 -1
- package/fesm2015/wizishop-angular-components.js +104 -7
- package/fesm2015/wizishop-angular-components.js.map +1 -1
- package/lib/components/button/button.component.d.ts +12 -2
- package/lib/components/search/search.component.d.ts +23 -0
- package/lib/components/search/shared/search-option.model.d.ts +5 -0
- package/lib/components/tag/tag.component.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
- package/wizishop-angular-components-0.0.61.tgz +0 -0
- package/wizishop-angular-components.metadata.json +1 -1
- package/wizishop-angular-components-0.0.57.tgz +0 -0
|
@@ -848,6 +848,7 @@
|
|
|
848
848
|
this.label = '';
|
|
849
849
|
this.hasClose = false;
|
|
850
850
|
this.isOpen = true;
|
|
851
|
+
this.big = false;
|
|
851
852
|
}
|
|
852
853
|
TagComponent.prototype.closeTag = function () {
|
|
853
854
|
if (this.hasClose) {
|
|
@@ -859,14 +860,15 @@
|
|
|
859
860
|
TagComponent.decorators = [
|
|
860
861
|
{ type: i0.Component, args: [{
|
|
861
862
|
selector: 'wac-tag',
|
|
862
|
-
template: "<div class=\"wac-tag\" [classList]=\"'wac-tag--' + class\" [ngClass]=\"{ hover: hasClose }\" *ngIf=\"isOpen\" (click)=\"closeTag()\">\n {{ label }}\n <span *ngIf=\"hasClose\"><i class=\"fas fa-times\"></i></span>\n</div>\n"
|
|
863
|
+
template: "<div class=\"wac-tag\" [classList]=\"'wac-tag--' + class\" [ngClass]=\"{ hover: hasClose, 'big': big }\" *ngIf=\"isOpen\" (click)=\"closeTag()\">\n {{ label }}\n <span *ngIf=\"hasClose\"><i class=\"fas fa-times\"></i></span>\n</div>\n"
|
|
863
864
|
},] }
|
|
864
865
|
];
|
|
865
866
|
TagComponent.ctorParameters = function () { return []; };
|
|
866
867
|
TagComponent.propDecorators = {
|
|
867
868
|
label: [{ type: i0.Input }],
|
|
868
869
|
class: [{ type: i0.Input }],
|
|
869
|
-
hasClose: [{ type: i0.Input }]
|
|
870
|
+
hasClose: [{ type: i0.Input }],
|
|
871
|
+
big: [{ type: i0.Input }]
|
|
870
872
|
};
|
|
871
873
|
|
|
872
874
|
var TabComponent = /** @class */ (function () {
|
|
@@ -912,13 +914,24 @@
|
|
|
912
914
|
this.animation = false;
|
|
913
915
|
this.animationRight = false;
|
|
914
916
|
this.animationText = '';
|
|
917
|
+
this.confirmDelete = false;
|
|
918
|
+
this.confirmDeleteText = '';
|
|
919
|
+
this.confirmDeletePosition = 'right';
|
|
915
920
|
this.click = new i0.EventEmitter();
|
|
916
921
|
this.isLoading = false;
|
|
917
922
|
this.interval = null;
|
|
923
|
+
this.waitForConfirmDelete = false;
|
|
918
924
|
this.buttonMaxWidth = '0px';
|
|
919
925
|
this.buttonWidth = '0px';
|
|
926
|
+
this.buttonMaxWidthDelete = '0px';
|
|
927
|
+
this.buttonWidthDelete = '0px';
|
|
920
928
|
this.currentLoading = 0;
|
|
921
929
|
}
|
|
930
|
+
ButtonComponent.prototype.ngOnInit = function () {
|
|
931
|
+
if (this.confirmDelete) {
|
|
932
|
+
this.waitForConfirmDelete = true;
|
|
933
|
+
}
|
|
934
|
+
};
|
|
922
935
|
ButtonComponent.prototype.launchLoading = function () {
|
|
923
936
|
var _this = this;
|
|
924
937
|
if (this.isLoading || this.interval !== null) {
|
|
@@ -945,13 +958,29 @@
|
|
|
945
958
|
ButtonComponent.prototype.resetMaxWidth = function () {
|
|
946
959
|
this.buttonMaxWidth = '0px';
|
|
947
960
|
};
|
|
961
|
+
ButtonComponent.prototype.addMaxWidthDelete = function () {
|
|
962
|
+
this.buttonMaxWidthDelete = this.buttonWidthDelete + 'px';
|
|
963
|
+
console.log('here', this.buttonMaxWidthDelete);
|
|
964
|
+
};
|
|
965
|
+
ButtonComponent.prototype.resetMaxWidthDelete = function () {
|
|
966
|
+
this.buttonMaxWidthDelete = '0px';
|
|
967
|
+
this.waitForConfirmDelete = true;
|
|
968
|
+
};
|
|
948
969
|
ButtonComponent.prototype.onButtonClick = function (event) {
|
|
949
970
|
event.stopPropagation();
|
|
950
971
|
if (!this.disabled) {
|
|
951
972
|
if (this.hasLoader) {
|
|
952
973
|
this.launchLoading();
|
|
953
974
|
}
|
|
954
|
-
this.
|
|
975
|
+
if (!this.waitForConfirmDelete) {
|
|
976
|
+
this.click.emit(event);
|
|
977
|
+
if (this.confirmDelete) {
|
|
978
|
+
this.resetMaxWidthDelete();
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
else {
|
|
982
|
+
this.waitForConfirmDelete = false;
|
|
983
|
+
}
|
|
955
984
|
}
|
|
956
985
|
};
|
|
957
986
|
ButtonComponent.prototype.ngAfterViewInit = function () {
|
|
@@ -960,6 +989,10 @@
|
|
|
960
989
|
if (_this.animation) {
|
|
961
990
|
_this.buttonWidth = _this.calculWidth.nativeElement.offsetWidth;
|
|
962
991
|
}
|
|
992
|
+
if (_this.confirmDelete) {
|
|
993
|
+
_this.buttonWidthDelete = _this.calculWidthDelete.nativeElement.offsetWidth;
|
|
994
|
+
console.log('here2', _this.buttonWidthDelete);
|
|
995
|
+
}
|
|
963
996
|
}, 1000);
|
|
964
997
|
};
|
|
965
998
|
return ButtonComponent;
|
|
@@ -967,7 +1000,7 @@
|
|
|
967
1000
|
ButtonComponent.decorators = [
|
|
968
1001
|
{ type: i0.Component, args: [{
|
|
969
1002
|
selector: 'wac-button',
|
|
970
|
-
template: "<a\n [class]=\"'wac-button ' + extraClasses\"\n (click)=\"onButtonClick($event)
|
|
1003
|
+
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]=\"[label === '' ? 'alone' : '',animationRight ? 'animation-right' : '', animation ? 'animationText' : '', isLoading ? 'is-loading' : '', opacity ? 'opacity' : '', disabled ? 'disabled' : '', widthAuto ? 'width-auto' : '', whiteSpaceNowrap ? 'white-space-no-wrap' : '', !waitForConfirmDelete && confirmDelete ? 'step-delete' : '', confirmDelete ? 'deletePosition-' + confirmDeletePosition : '']\"\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 || interval !== null\"\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"
|
|
971
1004
|
},] }
|
|
972
1005
|
];
|
|
973
1006
|
ButtonComponent.ctorParameters = function () { return []; };
|
|
@@ -985,8 +1018,12 @@
|
|
|
985
1018
|
animation: [{ type: i0.Input }],
|
|
986
1019
|
animationRight: [{ type: i0.Input }],
|
|
987
1020
|
animationText: [{ type: i0.Input }],
|
|
1021
|
+
confirmDelete: [{ type: i0.Input }],
|
|
1022
|
+
confirmDeleteText: [{ type: i0.Input }],
|
|
1023
|
+
confirmDeletePosition: [{ type: i0.Input }],
|
|
988
1024
|
click: [{ type: i0.Output }],
|
|
989
|
-
calculWidth: [{ type: i0.ViewChild, args: ['calculWidth',] }]
|
|
1025
|
+
calculWidth: [{ type: i0.ViewChild, args: ['calculWidth',] }],
|
|
1026
|
+
calculWidthDelete: [{ type: i0.ViewChild, args: ['calculWidthDelete',] }]
|
|
990
1027
|
};
|
|
991
1028
|
|
|
992
1029
|
var InfoComponent = /** @class */ (function () {
|
|
@@ -3570,6 +3607,67 @@
|
|
|
3570
3607
|
},] }
|
|
3571
3608
|
];
|
|
3572
3609
|
|
|
3610
|
+
var SearchComponent = /** @class */ (function () {
|
|
3611
|
+
function SearchComponent() {
|
|
3612
|
+
this.alwaysOpen = false;
|
|
3613
|
+
this.emptyResult = '';
|
|
3614
|
+
this.search = '';
|
|
3615
|
+
this.openSelect = false;
|
|
3616
|
+
this.selectValue = new i0.EventEmitter();
|
|
3617
|
+
this.selectValueByIndex = new i0.EventEmitter();
|
|
3618
|
+
}
|
|
3619
|
+
SearchComponent.prototype.ngOnInit = function () {
|
|
3620
|
+
this.triggerOptions = this.options;
|
|
3621
|
+
};
|
|
3622
|
+
SearchComponent.prototype.customTB = function (item, index) {
|
|
3623
|
+
return item.id + "-" + index;
|
|
3624
|
+
};
|
|
3625
|
+
SearchComponent.prototype.onClose = function () {
|
|
3626
|
+
this.openSelect = false;
|
|
3627
|
+
};
|
|
3628
|
+
SearchComponent.prototype.setSearchValueToQuery = function (value) {
|
|
3629
|
+
var _this = this;
|
|
3630
|
+
this.search = value.target.value;
|
|
3631
|
+
if (this.search.length > 0) {
|
|
3632
|
+
this.openSelect = true;
|
|
3633
|
+
this.triggerOptions = this.options.filter(function (element) { return element.label.toLowerCase().indexOf(_this.search.toLowerCase()) !== -1; });
|
|
3634
|
+
}
|
|
3635
|
+
else {
|
|
3636
|
+
this.triggerOptions = this.options;
|
|
3637
|
+
}
|
|
3638
|
+
};
|
|
3639
|
+
SearchComponent.prototype.closeSelect = function () {
|
|
3640
|
+
// this.openSelect = false;
|
|
3641
|
+
};
|
|
3642
|
+
SearchComponent.prototype.onSelectItem = function (index) {
|
|
3643
|
+
this.selectValueByIndex.emit(index);
|
|
3644
|
+
this.selectValue.emit(this.options[index]);
|
|
3645
|
+
this.search = '';
|
|
3646
|
+
this.openSelect = false;
|
|
3647
|
+
};
|
|
3648
|
+
SearchComponent.prototype.resetAllVue = function () {
|
|
3649
|
+
this.search = '';
|
|
3650
|
+
this.closeSelect();
|
|
3651
|
+
};
|
|
3652
|
+
return SearchComponent;
|
|
3653
|
+
}());
|
|
3654
|
+
SearchComponent.decorators = [
|
|
3655
|
+
{ type: i0.Component, args: [{
|
|
3656
|
+
selector: 'wac-search',
|
|
3657
|
+
template: "<div class=\"wac-search\" [ngClass]=\"{ open: openSelect || alwaysOpen }\" [zIndexToggle]=\"openSelect\" wzAutoHide (clickOutside)=\"closeSelect()\">\n <div class=\"wac-search__wrapper\">\n <button><i class=\"fal fa-search\"></i></button>\n <input [value]=\"search\" type=\"text\" required [placeholder]=\"placeholder\" (focus)=\"openSelect = true;\" (keyup)=\"setSearchValueToQuery($event)\" />\n </div>\n <div class=\"wac-search__absolute\" *ngIf=\"triggerOptions\" [ngClass]=\"{'hidden': !openSelect}\">\n <perfect-scrollbar [config]=\"{ suppressScrollX: true }\" *ngIf=\"triggerOptions.length > 0\">\n <div (click)=\"onClose()\" class=\"wac-select__content__item\" *ngFor=\"let item of triggerOptions; trackBy: customTB; let index = index;\">\n <div [ngClass]=\"{ selected: item.active }\" (click)=\"onSelectItem(index)\">\n {{ item.label }}\n </div>\n </div>\n </perfect-scrollbar>\n <div class=\"wac-select__content__empty\" *ngIf=\"triggerOptions.length === 0\">\n <span *ngIf=\"emptyResult\">{{emptyResult}}</span>\n </div>\n </div>\n</div>\n"
|
|
3658
|
+
},] }
|
|
3659
|
+
];
|
|
3660
|
+
SearchComponent.ctorParameters = function () { return []; };
|
|
3661
|
+
SearchComponent.propDecorators = {
|
|
3662
|
+
placeholder: [{ type: i0.Input }],
|
|
3663
|
+
alwaysOpen: [{ type: i0.Input }],
|
|
3664
|
+
label: [{ type: i0.Input }],
|
|
3665
|
+
options: [{ type: i0.Input }],
|
|
3666
|
+
emptyResult: [{ type: i0.Input }],
|
|
3667
|
+
selectValue: [{ type: i0.Output }],
|
|
3668
|
+
selectValueByIndex: [{ type: i0.Output }]
|
|
3669
|
+
};
|
|
3670
|
+
|
|
3573
3671
|
var components = [
|
|
3574
3672
|
TagComponent,
|
|
3575
3673
|
TabComponent,
|
|
@@ -3609,7 +3707,8 @@
|
|
|
3609
3707
|
WrapperComponent,
|
|
3610
3708
|
FiltersComponent,
|
|
3611
3709
|
WrapperBlocsComponent,
|
|
3612
|
-
SnackbarComponent
|
|
3710
|
+
SnackbarComponent,
|
|
3711
|
+
SearchComponent
|
|
3613
3712
|
];
|
|
3614
3713
|
var exportsFromModule = [
|
|
3615
3714
|
PaginationComponent,
|
|
@@ -3722,6 +3821,7 @@
|
|
|
3722
3821
|
exports.PopinComponent = PopinComponent;
|
|
3723
3822
|
exports.ProgressBarComponent = ProgressBarComponent;
|
|
3724
3823
|
exports.RadioComponent = RadioComponent;
|
|
3824
|
+
exports.SearchComponent = SearchComponent;
|
|
3725
3825
|
exports.SelectComponent = SelectComponent;
|
|
3726
3826
|
exports.SelectInTextComponent = SelectInTextComponent;
|
|
3727
3827
|
exports.SeparatorComponent = SeparatorComponent;
|