@wizishop/angular-components 0.0.60 → 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 +1785 -1551
- package/bundles/wizishop-angular-components.umd.js +64 -1
- 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/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/public-api.js +3 -1
- package/fesm2015/wizishop-angular-components.js +62 -2
- package/fesm2015/wizishop-angular-components.js.map +1 -1
- package/lib/components/search/search.component.d.ts +23 -0
- package/lib/components/search/shared/search-option.model.d.ts +5 -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.60.tgz +0 -0
|
@@ -3607,6 +3607,67 @@
|
|
|
3607
3607
|
},] }
|
|
3608
3608
|
];
|
|
3609
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
|
+
|
|
3610
3671
|
var components = [
|
|
3611
3672
|
TagComponent,
|
|
3612
3673
|
TabComponent,
|
|
@@ -3646,7 +3707,8 @@
|
|
|
3646
3707
|
WrapperComponent,
|
|
3647
3708
|
FiltersComponent,
|
|
3648
3709
|
WrapperBlocsComponent,
|
|
3649
|
-
SnackbarComponent
|
|
3710
|
+
SnackbarComponent,
|
|
3711
|
+
SearchComponent
|
|
3650
3712
|
];
|
|
3651
3713
|
var exportsFromModule = [
|
|
3652
3714
|
PaginationComponent,
|
|
@@ -3759,6 +3821,7 @@
|
|
|
3759
3821
|
exports.PopinComponent = PopinComponent;
|
|
3760
3822
|
exports.ProgressBarComponent = ProgressBarComponent;
|
|
3761
3823
|
exports.RadioComponent = RadioComponent;
|
|
3824
|
+
exports.SearchComponent = SearchComponent;
|
|
3762
3825
|
exports.SelectComponent = SelectComponent;
|
|
3763
3826
|
exports.SelectInTextComponent = SelectInTextComponent;
|
|
3764
3827
|
exports.SeparatorComponent = SeparatorComponent;
|