@wizishop/angular-components 0.0.61 → 0.0.62

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.
@@ -3021,6 +3021,81 @@ span.wac-tooltip {
3021
3021
  }
3022
3022
  }
3023
3023
  }
3024
+ .wac-wrapper {
3025
+ width: 100%;
3026
+ &.max-width {
3027
+ max-width: 1080px;
3028
+ margin: 0 auto;
3029
+ }
3030
+ }
3031
+ .wac-alert {
3032
+ width: 100%;
3033
+ background-color: transparentize($wac-link-color, 0.85);
3034
+ color: $wac-link-color;
3035
+ border-radius: 3px;
3036
+ display: flex;
3037
+ flex-wrap: nowrap;
3038
+ justify-content: space-between;
3039
+ padding: 20px;
3040
+ &.success {
3041
+ background-color: transparentize($wac-green-color, 0.85);
3042
+ p {
3043
+ color: $wac-p-alert-color-success;
3044
+ > * {
3045
+ color: $wac-p-alert-color-success;
3046
+ }
3047
+ }
3048
+ i {
3049
+ color: $wac-green-color;
3050
+ }
3051
+ }
3052
+ &.warning {
3053
+ background-color: transparentize($wac-primary-button, 0.85);
3054
+ p {
3055
+ color: $wac-p-alert-color-warning;
3056
+ > * {
3057
+ color: $wac-p-alert-color-warning;
3058
+ }
3059
+ }
3060
+ i {
3061
+ color: $wac-primary-button;
3062
+ }
3063
+ }
3064
+ &.alert {
3065
+ background-color: transparentize($wac-orange-color, 0.85);
3066
+ p {
3067
+ color: $wac-p-alert-color-alert;
3068
+ > * {
3069
+ color: $wac-p-alert-color-alert;
3070
+ }
3071
+ }
3072
+ i {
3073
+ color: $wac-orange-color;
3074
+ }
3075
+ }
3076
+ p {
3077
+ width: 100%;
3078
+ font-size: rem(14);
3079
+ line-height: rem(25);
3080
+ margin: 0;
3081
+ padding: 0;
3082
+ color: $wac-p-alert-color-default;
3083
+ > * {
3084
+ color: $wac-p-alert-color-default;
3085
+ }
3086
+ }
3087
+ i {
3088
+ width: auto;
3089
+ margin: 0 10px 0 0;
3090
+ color: inherit;
3091
+ font-size: rem(14);
3092
+ line-height: rem(25);
3093
+ }
3094
+
3095
+ .wac-button i {
3096
+ color: $wac-white;
3097
+ }
3098
+ }
3024
3099
  .wac-upload {
3025
3100
  width: auto;
3026
3101
  &__wrapper {
@@ -3117,81 +3192,6 @@ span.wac-tooltip {
3117
3192
  }
3118
3193
  }
3119
3194
  }
3120
- .wac-alert {
3121
- width: 100%;
3122
- background-color: transparentize($wac-link-color, 0.85);
3123
- color: $wac-link-color;
3124
- border-radius: 3px;
3125
- display: flex;
3126
- flex-wrap: nowrap;
3127
- justify-content: space-between;
3128
- padding: 20px;
3129
- &.success {
3130
- background-color: transparentize($wac-green-color, 0.85);
3131
- p {
3132
- color: $wac-p-alert-color-success;
3133
- > * {
3134
- color: $wac-p-alert-color-success;
3135
- }
3136
- }
3137
- i {
3138
- color: $wac-green-color;
3139
- }
3140
- }
3141
- &.warning {
3142
- background-color: transparentize($wac-primary-button, 0.85);
3143
- p {
3144
- color: $wac-p-alert-color-warning;
3145
- > * {
3146
- color: $wac-p-alert-color-warning;
3147
- }
3148
- }
3149
- i {
3150
- color: $wac-primary-button;
3151
- }
3152
- }
3153
- &.alert {
3154
- background-color: transparentize($wac-orange-color, 0.85);
3155
- p {
3156
- color: $wac-p-alert-color-alert;
3157
- > * {
3158
- color: $wac-p-alert-color-alert;
3159
- }
3160
- }
3161
- i {
3162
- color: $wac-orange-color;
3163
- }
3164
- }
3165
- p {
3166
- width: 100%;
3167
- font-size: rem(14);
3168
- line-height: rem(25);
3169
- margin: 0;
3170
- padding: 0;
3171
- color: $wac-p-alert-color-default;
3172
- > * {
3173
- color: $wac-p-alert-color-default;
3174
- }
3175
- }
3176
- i {
3177
- width: auto;
3178
- margin: 0 10px 0 0;
3179
- color: inherit;
3180
- font-size: rem(14);
3181
- line-height: rem(25);
3182
- }
3183
-
3184
- .wac-button i {
3185
- color: $wac-white;
3186
- }
3187
- }
3188
- .wac-wrapper {
3189
- width: 100%;
3190
- &.max-width {
3191
- max-width: 1080px;
3192
- margin: 0 auto;
3193
- }
3194
- }
3195
3195
  .wac-back {
3196
3196
  width: 40px;
3197
3197
  height: 40px;
@@ -3610,40 +3610,53 @@
3610
3610
  var SearchComponent = /** @class */ (function () {
3611
3611
  function SearchComponent() {
3612
3612
  this.alwaysOpen = false;
3613
+ this.disableSearchIn = false;
3613
3614
  this.emptyResult = '';
3614
3615
  this.search = '';
3615
3616
  this.openSelect = false;
3616
3617
  this.selectValue = new i0.EventEmitter();
3617
- this.selectValueByIndex = new i0.EventEmitter();
3618
+ this.searchKeyUp = new i0.EventEmitter();
3619
+ this.searchFocusOut = new i0.EventEmitter();
3618
3620
  }
3619
3621
  SearchComponent.prototype.ngOnInit = function () {
3620
3622
  this.triggerOptions = this.options;
3621
3623
  };
3622
- SearchComponent.prototype.customTB = function (item, index) {
3623
- return item.id + "-" + index;
3624
- };
3625
3624
  SearchComponent.prototype.onClose = function () {
3626
3625
  this.openSelect = false;
3627
3626
  };
3628
3627
  SearchComponent.prototype.setSearchValueToQuery = function (value) {
3629
3628
  var _this = this;
3630
3629
  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; });
3630
+ if (this.disableSearchIn) {
3631
+ this.triggerOptions = this.options;
3634
3632
  }
3635
3633
  else {
3636
- this.triggerOptions = this.options;
3634
+ if (this.search.length > 0) {
3635
+ this.openSelect = true;
3636
+ this.triggerOptions = this.options.filter(function (element) { return element.label.toLowerCase().indexOf(_this.search.toLowerCase()) !== -1; });
3637
+ }
3638
+ else {
3639
+ this.triggerOptions = this.options;
3640
+ }
3637
3641
  }
3642
+ this.searchKeyUp.emit(this.search);
3643
+ };
3644
+ SearchComponent.prototype.sendEventFocusOut = function () {
3645
+ this.searchFocusOut.emit(this.search);
3638
3646
  };
3639
3647
  SearchComponent.prototype.closeSelect = function () {
3640
- // this.openSelect = false;
3648
+ this.openSelect = false;
3641
3649
  };
3642
- SearchComponent.prototype.onSelectItem = function (index) {
3643
- this.selectValueByIndex.emit(index);
3644
- this.selectValue.emit(this.options[index]);
3650
+ SearchComponent.prototype.onSelectItem = function (index, value, label) {
3645
3651
  this.search = '';
3646
3652
  this.openSelect = false;
3653
+ if (this.disableSearchIn) {
3654
+ this.selectValue.emit(index);
3655
+ }
3656
+ else {
3657
+ var findInOption = this.options.findIndex(function (element) { return element.label === label && element.value === value; });
3658
+ this.selectValue.emit(findInOption);
3659
+ }
3647
3660
  };
3648
3661
  SearchComponent.prototype.resetAllVue = function () {
3649
3662
  this.search = '';
@@ -3654,7 +3667,7 @@
3654
3667
  SearchComponent.decorators = [
3655
3668
  { type: i0.Component, args: [{
3656
3669
  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"
3670
+ 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;\" (focusout)=\"sendEventFocusOut()\" (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; let index = index;\">\n <div [ngClass]=\"{ selected: item.active }\" (click)=\"onSelectItem(index, item.value, item.label)\">\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
3671
  },] }
3659
3672
  ];
3660
3673
  SearchComponent.ctorParameters = function () { return []; };
@@ -3663,9 +3676,11 @@
3663
3676
  alwaysOpen: [{ type: i0.Input }],
3664
3677
  label: [{ type: i0.Input }],
3665
3678
  options: [{ type: i0.Input }],
3679
+ disableSearchIn: [{ type: i0.Input }],
3666
3680
  emptyResult: [{ type: i0.Input }],
3667
3681
  selectValue: [{ type: i0.Output }],
3668
- selectValueByIndex: [{ type: i0.Output }]
3682
+ searchKeyUp: [{ type: i0.Output }],
3683
+ searchFocusOut: [{ type: i0.Output }]
3669
3684
  };
3670
3685
 
3671
3686
  var components = [