Classes
Class: FilterManager
63 min
@klevu/core / docid 7vdpes 8 0tv 43dya7ly / filtermanager filter manager is used to store and handle filters (facets) in the results easily it can be easily used with applyfilterwithfiltermanager() and listfilters() modifiers table of contents constructors docid\ ztqpueyzosyserbcqiw4h properties docid\ ztqpueyzosyserbcqiw4h accessors docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h methods docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h docid\ ztqpueyzosyserbcqiw4h constructors constructor • new filtermanager ( initialvalues? ) manager can be initialized with existing options and sliders parameters true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l52 properties filters • filters @klevu/core docid 7vdpes 8 0tv 43dya7ly \[] = \[] defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l25 accessors options • get options () @klevu/core docid 7vdpes 8 0tv 43dya7ly \[] use filters instead this doesn't take into account order of options and sliders returns @klevu/core docid 7vdpes 8 0tv 43dya7ly \[] defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l30 sliders • get sliders () @klevu/core docid 7vdpes 8 0tv 43dya7ly \[] use filters instead this doesn't take into account order of options and sliders returns @klevu/core docid 7vdpes 8 0tv 43dya7ly \[] defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l40 methods clear ▸ clear () void clear current options and sliders returns void defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l82 clearoptionselections ▸ clearoptionselections ( key? ) void sets selected key of all options to false parameters true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type returns void defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l181 currentselection ▸ currentselection ( key ) undefined | string \[] get current selection by key parameters true left unhandled content type left unhandled content type left unhandled content type left unhandled content type returns undefined | string \[] defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l298 deselectoption ▸ deselectoption ( key , value ) void deselect given option parameters true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type returns void defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l158 getcurrentstate ▸ getcurrentstate () filtermanagerstate gets current state of filters returns filtermanagerstate current state defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l91 getoptionbykeycreateifnotexists ▸ private getoptionbykeycreateifnotexists ( key , value ) object get option by key and sub option name if doesn't exist, create it parameters true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type returns object true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l428 initfromlistfilters ▸ initfromlistfilters ( filters ) void parameters true left unhandled content type left unhandled content type left unhandled content type left unhandled content type returns void defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l59 readfromurlparams ▸ readfromurlparams ( params ) void set current selection of filters from a url param string parameters true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type returns void defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l358 selectoption ▸ selectoption ( key , value ) void select given option parameters true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type returns void defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l134 selectedfilters ▸ selectedfilters () { key string ; label string ; type enumeration klevufiltertype docid\ ww8 ksa2 cuoaickix5tp ; value string }\[] quickly get all selected options and sliders returns { key string ; label string ; type enumeration klevufiltertype docid\ ww8 ksa2 cuoaickix5tp ; value string }\[] array of selected filters, with key, label, type and value defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l380 setstate ▸ setstate ( state ) void parameters true left unhandled content type left unhandled content type left unhandled content type left unhandled content type returns void defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l97 toapplyfilters ▸ toapplyfilters () @klevu/core docid 7vdpes 8 0tv 43dya7ly \[] populate filter manager with filters from klevu api returns @klevu/core docid 7vdpes 8 0tv 43dya7ly \[] defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l255 tourlparams ▸ tourlparams () string changes current selection of filters to a url param string returns string string of url params defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l328 toggleoption ▸ toggleoption ( key , value ) void function to select filters in filter manager sends a dom event on change parameters true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type returns void defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l109 updateslide ▸ updateslide ( key , min , max ) void function to update slide in filter manager sends a dom event on change parameters true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type returns void defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l212 isklevufilterresultoptions ▸ static isklevufilterresultoptions ( filter ) filter is klevufilterresultoptions is given variable an option filter parameters true left unhandled content type left unhandled content type left unhandled content type left unhandled content type returns filter is klevufilterresultoptions defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l485 isklevufilterresultrating ▸ static isklevufilterresultrating ( filter ) filter is klevufilterresultrating is given variable an rating filter parameters true left unhandled content type left unhandled content type left unhandled content type left unhandled content type returns filter is klevufilterresultrating defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l499 isklevufilterresultslider ▸ static isklevufilterresultslider ( filter ) filter is klevufilterresultslider is given variable a slider filter parameters true left unhandled content type left unhandled content type left unhandled content type left unhandled content type returns filter is klevufilterresultslider defined in https //github com/klevultd/frontend sdk/blob/492d3760/packages/klevu core/src/store/filtermanager ts#l471