@maplander/components 0.21.0 → 0.21.1

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.
@@ -2839,6 +2839,7 @@
2839
2839
  this._formBuilder = _formBuilder;
2840
2840
  this._converter = _converter;
2841
2841
  this.METERS_TO_SQ = 10.76391042;
2842
+ this.changeFilter = new core.EventEmitter();
2842
2843
  this.isOPI = this._config || false;
2843
2844
  this._subscription = new rxjs.Subscription();
2844
2845
  /** @type {?} */
@@ -2848,12 +2849,17 @@
2848
2849
  * @return {?}
2849
2850
  */
2850
2851
  function (item) {
2851
- if ((_this.hideRoom && item.value !== types.PropertyTypeEnum.ROOM) ||
2852
- (_this.hideResidential && item.value !== types.PropertyTypeEnum.RESIDENTIAL)) {
2853
- items.push(item);
2852
+ if (_this.newFilters) {
2853
+ if (item.value !== types.PropertyTypeEnum.ROOM && item.value !== types.PropertyTypeEnum.RESIDENTIAL) {
2854
+ items.push(item);
2855
+ }
2854
2856
  }
2855
2857
  }));
2856
- this.propertyTypeList = items;
2858
+ this.propertyTypeList = items.map((/**
2859
+ * @param {?} item
2860
+ * @return {?}
2861
+ */
2862
+ function (item) { return (__assign({}, item)); }));
2857
2863
  this.bedroomsList = Object.assign([], ConstantsComponents.BedroomList);
2858
2864
  this.bathroomsList = Object.assign([], ConstantsComponents.BathroomList);
2859
2865
  this.parkingPlacesList = Object.assign([], ConstantsComponents.ParkingSpacesList);
@@ -2948,6 +2954,7 @@
2948
2954
  this.filtersForm.controls['offering'].setValue(types.OfferingTypeEnum.SALE);
2949
2955
  break;
2950
2956
  }
2957
+ this.changeFilter.emit({ type: 'propertyType', payload: { filter: this.filter, value: this.filtersForm.value } });
2951
2958
  };
2952
2959
  /**
2953
2960
  * @param {?} ev
@@ -2959,6 +2966,7 @@
2959
2966
  */
2960
2967
  function (ev) {
2961
2968
  this.filter.offering = (/** @type {?} */ (ev));
2969
+ this.changeFilter.emit({ type: 'filter', payload: { filter: this.filter, value: this.filtersForm.value } });
2962
2970
  };
2963
2971
  /**
2964
2972
  * @param {?} ev
@@ -2970,6 +2978,7 @@
2970
2978
  */
2971
2979
  function (ev) {
2972
2980
  this.filter.currency = ev;
2981
+ this.changeFilter.emit({ type: 'filter', payload: { filter: this.filter, value: this.filtersForm.value } });
2973
2982
  };
2974
2983
  /**
2975
2984
  * @param {?} amenity
@@ -2991,6 +3000,7 @@
2991
3000
  this.filter.extras.push(amenity.value);
2992
3001
  }
2993
3002
  amenity.checked = !amenity.checked;
3003
+ this.changeFilter.emit({ type: 'filter', payload: { filter: this.filter, value: this.filtersForm.value } });
2994
3004
  };
2995
3005
  /**
2996
3006
  * @return {?}
@@ -3040,6 +3050,7 @@
3040
3050
  this.filter = propertyTypeItemIndex ? Utils.getFilterByPropertyType(this.filter) : Utils.getInitialFilter(this.isOPI, this.filter);
3041
3051
  this.updateFormByFilters();
3042
3052
  this.setPrices();
3053
+ this.changeFilter.emit({ type: 'filter', payload: { filter: this.filter, value: this.filtersForm.value } });
3043
3054
  };
3044
3055
  /**
3045
3056
  * @private
@@ -3050,7 +3061,9 @@
3050
3061
  * @return {?}
3051
3062
  */
3052
3063
  function () {
3064
+ var _this = this;
3053
3065
  this.filtersForm = this._formBuilder.group({
3066
+ state: [],
3054
3067
  offering: [],
3055
3068
  currency: [],
3056
3069
  minPrice: ['', [forms.Validators.required, forms.Validators.pattern(new RegExp('(^[0-9]+)'))]],
@@ -3064,6 +3077,12 @@
3064
3077
  }, {
3065
3078
  validator: CurrencyFilterValidator('minPrice', 'maxPrice')
3066
3079
  });
3080
+ this.filtersForm.valueChanges.subscribe((/**
3081
+ * @return {?}
3082
+ */
3083
+ function () {
3084
+ _this.changeFilter.emit({ type: 'filter', payload: { filter: _this.filter, value: _this.filtersForm.value } });
3085
+ }));
3067
3086
  };
3068
3087
  /**
3069
3088
  * @private
@@ -3075,6 +3094,7 @@
3075
3094
  */
3076
3095
  function () {
3077
3096
  this.filtersForm.patchValue({
3097
+ state: null,
3078
3098
  offering: this.filter.offering,
3079
3099
  currency: this.filter.currency,
3080
3100
  minPrice: this.filter.downLimitPrice,
@@ -3098,6 +3118,7 @@
3098
3118
  function () {
3099
3119
  /** @type {?} */
3100
3120
  var data = this.filtersForm.value;
3121
+ this.filter.state = data.state;
3101
3122
  this.filter.offering = data.offering;
3102
3123
  this.filter.currency = data.currency;
3103
3124
  this.filter.downLimitPrice = Number(data.minPrice);
@@ -3391,8 +3412,10 @@
3391
3412
  ]; };
3392
3413
  FiltersComponent.propDecorators = {
3393
3414
  utils: [{ type: core.Input }],
3394
- hideRoom: [{ type: core.Input }],
3395
- hideResidential: [{ type: core.Input }]
3415
+ newFilters: [{ type: core.Input }],
3416
+ stateOptions: [{ type: core.Input }],
3417
+ propertyTotal: [{ type: core.Input }],
3418
+ changeFilter: [{ type: core.Output }]
3396
3419
  };
3397
3420
  return FiltersComponent;
3398
3421
  }());