Code Monkey home page Code Monkey logo

wfm-seeker's Introduction

WFM Seeker component v2

this thing

Description

Fuzzy search React component from warframe.market
This is v2 of the component, it's a rewrite of the original component.

⚠️ This repository require a future setup, i just throw it togeter in 5 mins.

How to use

<Seeker
    placeholder={"placeholder"}
    autocompleteOnBlur={true}
    items={listOfItems}
    nameKey={`i18n.${currentLang}.name`}
    idKey={'id'}
    selectedItem={searchItem}
    onSelect={rememberSearch}
/>

item model

type ItemShort = {
    id: string;
    group: string;

    "i18n.en.name": string
    "i18n.ko.name": string
    "i18n.fr.name": string
    ...
};

Suggestions in dropdown list are sorted by group and then by number of matched chars, then alphabetically.

group named top will be always on top
group named bottom always at bottom
rest of groups will be sorted alphabetically

wfm-seeker's People

Contributors

kyckyc avatar

Stargazers

IGAMER avatar sahandmohammadrezaii avatar J.Zhang avatar  avatar

Watchers

 avatar

wfm-seeker's Issues

search by tags

e.g. search warframe -> [Ash Prime Set,Baruuk Prime Set,...]

Consider using a string similarity algorithm: levenshtein to optimize the search experience

(^|.*?\\s·)(inputValue)
image

(^|.*?\\s·)*(inputValue)
image

let regexBase = parts.reduce((regexBase, part, index) => (part.length > 0 ? (regexBase += `(^|.*?\\s·)(${part})`) : regexBase), '');

I'm not sure how it will affect the textNodes in the DropdownInner component

textNodes.push(<b key={cnt}>{name.slice(charIndex, charIndex + matchedlenght)}</b>);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.