@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.
- package/bundles/maplander-components.umd.js +29 -6
- package/bundles/maplander-components.umd.js.map +1 -1
- package/bundles/maplander-components.umd.min.js +2 -2
- package/bundles/maplander-components.umd.min.js.map +1 -1
- package/esm2015/lib/components/filters/filters.component.js +36 -10
- package/esm5/lib/components/filters/filters.component.js +38 -10
- package/fesm2015/maplander-components.js +29 -7
- package/fesm2015/maplander-components.js.map +1 -1
- package/fesm5/maplander-components.js +30 -7
- package/fesm5/maplander-components.js.map +1 -1
- package/lib/components/filters/filters.component.d.ts +14 -3
- package/maplander-components.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Pipe, NgModule, Directive, ElementRef, Input, Component, Inject, Injectable, InjectionToken, Optional, Renderer2,
|
|
1
|
+
import { Pipe, NgModule, Directive, ElementRef, Input, Component, Inject, Injectable, InjectionToken, Optional, Renderer2, Output, EventEmitter, ViewChild, ContentChild, TemplateRef, ChangeDetectorRef, forwardRef, Injector } from '@angular/core';
|
|
2
2
|
import { CommonModule, CurrencyPipe } from '@angular/common';
|
|
3
3
|
import { LandUseEnum, PFileTypeEnum, PropertyTypeEnum, OfferingTypeEnum, StatusTypeEnum, Currency, PFile, DialogResponseType, LeadInfo, NewCompleteProperty, NewProperty, PropertyInfo, Features, Address, Amenities, AreaUnitEnum, Owner, NewPropertyLite } from '@maplander/types';
|
|
4
4
|
import { __values, __assign, __extends } from 'tslib';
|
|
@@ -2827,6 +2827,7 @@ var FiltersComponent = /** @class */ (function () {
|
|
|
2827
2827
|
this._formBuilder = _formBuilder;
|
|
2828
2828
|
this._converter = _converter;
|
|
2829
2829
|
this.METERS_TO_SQ = 10.76391042;
|
|
2830
|
+
this.changeFilter = new EventEmitter();
|
|
2830
2831
|
this.isOPI = this._config || false;
|
|
2831
2832
|
this._subscription = new Subscription();
|
|
2832
2833
|
/** @type {?} */
|
|
@@ -2836,12 +2837,17 @@ var FiltersComponent = /** @class */ (function () {
|
|
|
2836
2837
|
* @return {?}
|
|
2837
2838
|
*/
|
|
2838
2839
|
function (item) {
|
|
2839
|
-
if (
|
|
2840
|
-
(
|
|
2841
|
-
|
|
2840
|
+
if (_this.newFilters) {
|
|
2841
|
+
if (item.value !== PropertyTypeEnum.ROOM && item.value !== PropertyTypeEnum.RESIDENTIAL) {
|
|
2842
|
+
items.push(item);
|
|
2843
|
+
}
|
|
2842
2844
|
}
|
|
2843
2845
|
}));
|
|
2844
|
-
this.propertyTypeList = items
|
|
2846
|
+
this.propertyTypeList = items.map((/**
|
|
2847
|
+
* @param {?} item
|
|
2848
|
+
* @return {?}
|
|
2849
|
+
*/
|
|
2850
|
+
function (item) { return (__assign({}, item)); }));
|
|
2845
2851
|
this.bedroomsList = Object.assign([], ConstantsComponents.BedroomList);
|
|
2846
2852
|
this.bathroomsList = Object.assign([], ConstantsComponents.BathroomList);
|
|
2847
2853
|
this.parkingPlacesList = Object.assign([], ConstantsComponents.ParkingSpacesList);
|
|
@@ -2936,6 +2942,7 @@ var FiltersComponent = /** @class */ (function () {
|
|
|
2936
2942
|
this.filtersForm.controls['offering'].setValue(OfferingTypeEnum.SALE);
|
|
2937
2943
|
break;
|
|
2938
2944
|
}
|
|
2945
|
+
this.changeFilter.emit({ type: 'propertyType', payload: { filter: this.filter, value: this.filtersForm.value } });
|
|
2939
2946
|
};
|
|
2940
2947
|
/**
|
|
2941
2948
|
* @param {?} ev
|
|
@@ -2947,6 +2954,7 @@ var FiltersComponent = /** @class */ (function () {
|
|
|
2947
2954
|
*/
|
|
2948
2955
|
function (ev) {
|
|
2949
2956
|
this.filter.offering = (/** @type {?} */ (ev));
|
|
2957
|
+
this.changeFilter.emit({ type: 'filter', payload: { filter: this.filter, value: this.filtersForm.value } });
|
|
2950
2958
|
};
|
|
2951
2959
|
/**
|
|
2952
2960
|
* @param {?} ev
|
|
@@ -2958,6 +2966,7 @@ var FiltersComponent = /** @class */ (function () {
|
|
|
2958
2966
|
*/
|
|
2959
2967
|
function (ev) {
|
|
2960
2968
|
this.filter.currency = ev;
|
|
2969
|
+
this.changeFilter.emit({ type: 'filter', payload: { filter: this.filter, value: this.filtersForm.value } });
|
|
2961
2970
|
};
|
|
2962
2971
|
/**
|
|
2963
2972
|
* @param {?} amenity
|
|
@@ -2979,6 +2988,7 @@ var FiltersComponent = /** @class */ (function () {
|
|
|
2979
2988
|
this.filter.extras.push(amenity.value);
|
|
2980
2989
|
}
|
|
2981
2990
|
amenity.checked = !amenity.checked;
|
|
2991
|
+
this.changeFilter.emit({ type: 'filter', payload: { filter: this.filter, value: this.filtersForm.value } });
|
|
2982
2992
|
};
|
|
2983
2993
|
/**
|
|
2984
2994
|
* @return {?}
|
|
@@ -3028,6 +3038,7 @@ var FiltersComponent = /** @class */ (function () {
|
|
|
3028
3038
|
this.filter = propertyTypeItemIndex ? Utils.getFilterByPropertyType(this.filter) : Utils.getInitialFilter(this.isOPI, this.filter);
|
|
3029
3039
|
this.updateFormByFilters();
|
|
3030
3040
|
this.setPrices();
|
|
3041
|
+
this.changeFilter.emit({ type: 'filter', payload: { filter: this.filter, value: this.filtersForm.value } });
|
|
3031
3042
|
};
|
|
3032
3043
|
/**
|
|
3033
3044
|
* @private
|
|
@@ -3038,7 +3049,9 @@ var FiltersComponent = /** @class */ (function () {
|
|
|
3038
3049
|
* @return {?}
|
|
3039
3050
|
*/
|
|
3040
3051
|
function () {
|
|
3052
|
+
var _this = this;
|
|
3041
3053
|
this.filtersForm = this._formBuilder.group({
|
|
3054
|
+
state: [],
|
|
3042
3055
|
offering: [],
|
|
3043
3056
|
currency: [],
|
|
3044
3057
|
minPrice: ['', [Validators.required, Validators.pattern(new RegExp('(^[0-9]+)'))]],
|
|
@@ -3052,6 +3065,12 @@ var FiltersComponent = /** @class */ (function () {
|
|
|
3052
3065
|
}, {
|
|
3053
3066
|
validator: CurrencyFilterValidator('minPrice', 'maxPrice')
|
|
3054
3067
|
});
|
|
3068
|
+
this.filtersForm.valueChanges.subscribe((/**
|
|
3069
|
+
* @return {?}
|
|
3070
|
+
*/
|
|
3071
|
+
function () {
|
|
3072
|
+
_this.changeFilter.emit({ type: 'filter', payload: { filter: _this.filter, value: _this.filtersForm.value } });
|
|
3073
|
+
}));
|
|
3055
3074
|
};
|
|
3056
3075
|
/**
|
|
3057
3076
|
* @private
|
|
@@ -3063,6 +3082,7 @@ var FiltersComponent = /** @class */ (function () {
|
|
|
3063
3082
|
*/
|
|
3064
3083
|
function () {
|
|
3065
3084
|
this.filtersForm.patchValue({
|
|
3085
|
+
state: null,
|
|
3066
3086
|
offering: this.filter.offering,
|
|
3067
3087
|
currency: this.filter.currency,
|
|
3068
3088
|
minPrice: this.filter.downLimitPrice,
|
|
@@ -3086,6 +3106,7 @@ var FiltersComponent = /** @class */ (function () {
|
|
|
3086
3106
|
function () {
|
|
3087
3107
|
/** @type {?} */
|
|
3088
3108
|
var data = this.filtersForm.value;
|
|
3109
|
+
this.filter.state = data.state;
|
|
3089
3110
|
this.filter.offering = data.offering;
|
|
3090
3111
|
this.filter.currency = data.currency;
|
|
3091
3112
|
this.filter.downLimitPrice = Number(data.minPrice);
|
|
@@ -3379,8 +3400,10 @@ var FiltersComponent = /** @class */ (function () {
|
|
|
3379
3400
|
]; };
|
|
3380
3401
|
FiltersComponent.propDecorators = {
|
|
3381
3402
|
utils: [{ type: Input }],
|
|
3382
|
-
|
|
3383
|
-
|
|
3403
|
+
newFilters: [{ type: Input }],
|
|
3404
|
+
stateOptions: [{ type: Input }],
|
|
3405
|
+
propertyTotal: [{ type: Input }],
|
|
3406
|
+
changeFilter: [{ type: Output }]
|
|
3384
3407
|
};
|
|
3385
3408
|
return FiltersComponent;
|
|
3386
3409
|
}());
|