Giter VIP home page Giter VIP logo

appbaseio / reactivesearch Goto Github PK

View Code? Open in Web Editor NEW
4.9K 62.0 472.0 361.02 MB

Search UI components for React and Vue

Home Page: https://opensource.appbase.io/reactivesearch

License: Apache License 2.0

JavaScript 53.20% HTML 35.67% Shell 0.05% CSS 6.80% TypeScript 0.33% Vue 3.96%
ui-components data-components react developer-tools search elasticsearch vue react-components vue-components live-demos

reactivesearch's Issues

can I use this without Appbase?

we are a SaaS startup and have our own search enginge developed. is it possible to use this component without having an appbase account? if so, is there a documentation for it.

NestedList: react prop behavior

NestedList component's react prop (i.e. when the NestedList component depends on other components) does not correctly apply to the nested (child) list values.

ResultList: Support smaller image sizes

  • onData() method's returning JSON object can have an additional field "image_size", which can take "small" and "large" as valid values. A small value will render the image in an icon size.
  • "desc" field can use styling improvements.

NestedList: Fix default selection behavior

For defaultSelected prop, only items which are present in the NestedList should be selected and values which are not found in the list should be ignored (Similar to NativeList).

Move playground to it's own repo - reactive-playground

We will move the storybook and associated playground build and config files to its own repo at reactive-playground. That way we can use a unified playground across all reactive* projects.

In doing so, we will also build a jquery-esque plugin to filter stories by applied tags (which can also be set as a URL query parameter)

Reference: appbaseio/reactivebase#78

New component: TagCloud

Component Props

  • componentId String
    component ID.
  • appbaseField String
    DB field to be mapped for the query.
  • title String [optional]
    title of the component, optional.
  • multiSelect Boolean [optional]
    whether to allow multiple tag selections. Defaults to false.
  • defaultSelected String or Array
    pre-selected values, specified as one of String or Array type. Same validation logic as with ToggleList.
  • showCount Boolean [optional]
    whether to show the count next to the data label. Defaults to false.

Component would be sorted in alphabetical order, and for the time being, will not support any other sort options. The size of the labels will depend on the frequency of their occurrence. Selected label will show a background-color effect.

CSS Styles API

rbc-count-active
rbc-multiselect-active
rbc-title-active

Stories

  1. Basic story
  2. With default Selected values
  3. With multi-select set and default Selected values
  4. with dark theme
  5. Playground.

Create an onboarding experience

Create a 4-step interactive tutorial to guide a user towards building an example ReactiveSearch app.

Step 1: Create App
Step 2: Importer Upload Interface - Upload data, we will provide an example JSON to be directly uploaded
Step 3: Importer + Dejavu View Interface - Provide mappings and view uploaded data
Step 4: Show the final app UI (with an external link to running with codepen)

Search component: cursor position

Currently, the cursor position doesn't change on the Search components. We need to support cursor movements based on the user inputs.

Possible fix involves working with Reactive-select and applying an event.PreventDefault().

New Component: DynamicRangeSlider

Like RangeSlider but decides its range based on the underlying data, i.e. dynamically.

Component Props

  • componentId String
    component ID.
  • appbaseField String
    DB field to be mapped with UI for querying. Should be numeric.
  • title String
    title of the component, optional.
  • rangeLabels Function [optional]
    takes a function(start_val, end_val) and returns an object in the format:
{
  "start": "start label",
  "end": "end label"
}
  • defaultSelected Function [optional]
    takes a function(start_val, end_val) and returns an object in the format:
{
  "start": 0,
  "end": 10
}
  • showHistogram Boolean
    whether to show the histogram. Defaults to true.
  • stepValue Number
    step value specifies the slider stepper. Value should be an integer between 1 and floor(#total-range/2). Defaults to 1.

CSS Styles API

rbc-histogram-active
rbc-rangelabels-active
rbc-title-active

Stories

  1. Basic story
  2. Story with passing labels via a function
  3. With default selected
  4. With a different step value than 1
  5. In a dark theme
  6. Playground.

NestedList: Component Update

  • Update the NestedList component to be in sync with ReactiveBase
  • Delete the NestedList component from ReactiveBase.
  • Delete the NestedList story from ReactiveBase.
  • Delete the NestedList story from ReactiveMaps.

New recipe example: Meetup

@metagrover Perhaps while building the meetup example for Reactive Maps, we can build one that can also be re-used here. For the layout, try to keep it closely aligned to the design spec.

NestedList: Support multiple nesting levels

Current implementation of NestedList component supports up to two levels of aggregations. We should implement a generic aggregations query that can support 'n' levels --> and currently limit n to recurse to a depth of 10 (We will wait till the day an actual use-case needs more than that).

ResultCard and ResultList components behavior

Result components should wrap the markup with <div>...</div> instead of <a>...</a> when url property is not set.

This is essential for cases when you have <a /> in your title or desc property, because in such cases if the outer wrapper is also an <a> tag, you will end up with nested <a> tags.

ResultList: sortOptions prop %@#! with query

When applying sortOptions prop, the resulting query gets sorted on an "undefined" field.

and generates a 400 search parse exception.

The result is a sad list with nothing to show.

New component: RatingsFilter

Component Props

  • componentId String
    component ID.
  • appbaseField String
    DB field to be mapped for the query.
  • title String [optional]
    title of the component, optional.
  • data Object Array
    an array of objects with start, end numeric values and label as either string or HTML.
{[
  {"start": 4, "end": 5, "label": "4 stars and up"}, 
  {"start": 3, "end": 5, "label": "3 stars and up"}, 
  {"start": 1, "end": 5, "label": "> 1 stars"}
]}
  • defaultSelected Object
    pre-selected ratings value, specified with start and end keys, values should match one of the elements in the data array prop.

CSS Styles API

rbc-title-active

For a selected item, there should be a rbc-active class.

Stories

  1. Basic story
  2. With default selected values
  3. with dark theme
  4. Playground.

New component: CategorySearch

An extension of Data Search component meant to be used in e-commerce search settings.

Component Props

  • componentId String
    component ID.
  • appbaseField String
    DB field to be mapped for the query.
  • categoryField String
    DB field path for finding search results by category.
  • title String [optional]
    title of the component, optional.
  • size Number [optional]
    total suggestions to be displayed, defaults to 10.
  • defaultSuggestions Object Array [optional]
    an array of objects with value as string and label as either string or HTML.
{[
  {"value": "breakfast", "label": {<p><i className="fa-icon">Breakfast</p>}}, 
  {"value": "lunch", "label": {<p><i className="fa-icon">Lunch</p>}}, 
  {"value": "dinner", "label": {<p><i className="fa-icon">Dinner</p>}}
]}
  • defaultSelected String [optional]
    pre-selected text by which search should happen.

showSuggestions prop is always set to be true for this component and not exposed in the props spec.

CSS Styles API

rbc-title-active

For a selected item, there should be a rbc-active class.

Stories

  1. Basic story
  2. With default suggestions applied
  3. with dark theme
  4. Playground.

Search Examples: Component Usage

  • Product Hunt search should work on both title and description.
  • Airbnb components should implement react prop between themselves.
  • E-commerce sensor components should implement the react prop between themselves.
  • E-commerce example's category search filter does not show any results on picking a category.
  • Yelp's suggestions seem to be broken.
    While it shows "BARDS TOWN", clicking on it doesn't bring up any results.
  • Meetup's search topics box doesn't show any suggestions. I tried "Big Data", "Single", "Social"

We should implement a noResults view in all examples.

Importantly, we are selling the search functionality and that is broken in some key examples. We need to fix that first.

New Component: ToggleList

Component Props

  • componentId String
    component ID.
  • appbaseField String
    DB field to be mapped for the query.
  • title String
    title of the component, optional.
  • data Object Array
    an object array of {label:label, value:value} kv pairs, label is displayed in the UI and value is the corresponding actual field value in the database. Note: label can be specified as either String or HTML.
  • multiSelect Boolean
    whether to allow multiple selections, true by default.
  • defaultSelected String or Array
    pre-selected values, specified as one of String or Array type.
  • showCount Boolean
    whether to show the count next to the data label.

CSS Styles API

rbc-count-active
rbc-multiselect-active
rbc-title-active

Stories

  1. Basic story
  2. Story with passing label as a HTML markup
  3. Without title attribute
  4. With default Selected values
  5. In a dark theme
  6. Playground.

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.