{"version":3,"file":"area_size_dropdown-CM2rIKYM.js","sources":["../../../app/assets/javascripts/components/dropdown_menu/desktop/area_size_dropdown.ts"],"sourcesContent":["\nimport isBlankStr from \"underscore.string/isBlank\"\nimport {\n MinMaxSelectWithChosen,\n InputSelector as BaseInputSelector,\n DEFAULT_SELECTOR as BASE_DEFAULT_SELECTOR,\n} from \"components/dropdown_menu/with_chosen\"\n\nexport type InputSelector = BaseInputSelector & {\n scope?: string | JQuery\n main?: string\n min_select?: string\n max_select?: string\n toggle?: string\n dropdown?: string\n min_wrapper?: string\n max_wrapper?: string\n}\nconst DEFAULT_SELECTOR = Object.assign({}, BASE_DEFAULT_SELECTOR, {\n scope: \".cell-listing-filter\",\n main: \".cell-listing-filter__area-size-dropdown-container\",\n min_select: \".cell-listing-filter__minimum-area-size-input\",\n max_select: \".cell-listing-filter__maximum-area-size-input\",\n toggle: \".dropdown-with-input-toggle\",\n dropdown: \".dropdown-menu-with-input\",\n max_wrapper: \".filter-option--gross-max\",\n min_wrapper: \".filter-option--gross-min\",\n})\n\n\nclass AreaSizeDropdown extends MinMaxSelectWithChosen {\n protected name: string\n\n constructor(selector?: InputSelector){\n const merged_selector = Object.assign({}, DEFAULT_SELECTOR, selector)\n super(merged_selector)\n\n this.name = \"area_size_dropdown_blueprint\"\n }\n\n protected onChange(e: Event){\n super.onChange(e)\n\n this.emit(\"val_change\")\n }\n protected convertValueToLabel(){\n const min_value = this.$min_select.val()\n const max_value = this.$max_select.val()\n const min_label = this.$min_select.find(\"option:selected\").text()\n const max_label = this.$max_select.find(\"option:selected\").text()\n\n if (!isBlankStr(min_value) && !isBlankStr(max_value)){\n return `${min_label} - ${max_label}`\n }\n else if (!isBlankStr(min_value)){\n return `> ${min_label}`\n }\n else if ( !isBlankStr(max_value) ){\n return `< ${max_label}`\n }\n else{\n return this.$selected_text.data(\"original-text\")\n }\n }\n}\n\n\nexport {\n AreaSizeDropdown,\n DEFAULT_SELECTOR,\n}\n"],"names":["DEFAULT_SELECTOR","BASE_DEFAULT_SELECTOR","AreaSizeDropdown","MinMaxSelectWithChosen","selector","merged_selector","min_value","max_value","min_label","max_label","isBlankStr"],"mappings":"0FAkBA,MAAMA,EAAmB,OAAO,OAAO,CAAA,EAAIC,EAAuB,CAChE,MAAc,uBACd,KAAc,qDACd,WAAc,gDACd,WAAc,gDACd,OAAc,8BACd,SAAc,4BACd,YAAc,4BACd,YAAc,2BAChB,CAAC,EAGD,MAAMC,UAAyBC,CAAuB,CAGpD,YAAYC,EAAyB,CACnC,MAAMC,EAAkB,OAAO,OAAO,CAAA,EAAIL,EAAkBI,CAAQ,EACpE,MAAMC,CAAe,EAErB,KAAK,KAAO,8BAAA,CAGJ,SAAS,EAAS,CAC1B,MAAM,SAAS,CAAC,EAEhB,KAAK,KAAK,YAAY,CAAA,CAEd,qBAAqB,CACvB,MAAAC,EAAY,KAAK,YAAY,IAAI,EACjCC,EAAY,KAAK,YAAY,IAAI,EACjCC,EAAY,KAAK,YAAY,KAAK,iBAAiB,EAAE,KAAK,EAC1DC,EAAY,KAAK,YAAY,KAAK,iBAAiB,EAAE,KAAK,EAEhE,MAAI,CAACC,EAAWJ,CAAS,GAAK,CAACI,EAAWH,CAAS,EAC1C,GAAG,OAAAC,EAAS,OAAM,OAAAC,GAEjBC,EAAWJ,CAAS,EAGnBI,EAAWH,CAAS,EAItB,KAAK,eAAe,KAAK,eAAe,EAHxC,KAAK,OAAAE,GAHL,KAAK,OAAAD,EAOd,CAEJ"}