@asurraa/sura-ui-dropdown-filter
TypeScript icon, indicating that this package has built-in type declarations

1.0.18 • Public • Published

Storybook

@asurraa/sura-ui-dropdown-filter

Sura UI Dropdown Filter

Usage

Dropdown filter is used to sort and search the selection between choices of data. It is normally used to filter through the date of the given data from the API.

See more details related to the AsurRaa utilities here

Installation

yarn add @asurraa/sura-ui-dropdown-filter

Interface

export interface AsurRaaDropdownFilterProps extends AsurRaaSelectProps {
  //* This should be moment format type
  filterDateFormat?: string;
  filterOnChange?: (value: AsurRaaFilterOptionType) => void;
  emitFilterValueFromName?: Array<string>;
}

Example

import { AsurRaaDropdownFilter } from "@asurraa/sura-ui-dropdown-filter";

const App = (props) => {
  export interface AnyInterfaceProps {
    // Types interface
    cbFilter: AsurRaaDropdownFilterProps["filterOnChange"];
  }

  return (
    <div>
      // Others JSX Component
      <div>
        <AsurRaaDropdownFilter
          emitFilterValueFromName={["Today"]}
          filterOnChange={(value) => {
            setFilterDate({
              startDate: toAsurRaaDate(value.value.startDate),
              endDate: toAsurRaaDate(value.value.endDate),
            });
          }}
        />
      </div>
    </div>
  );
};

Readme

Keywords

none

Package Sidebar

Install

npm i @asurraa/sura-ui-dropdown-filter

Weekly Downloads

0

Version

1.0.18

License

none

Unpacked Size

15.6 kB

Total Files

12

Last publish

Collaborators

  • vichea
  • themkimhong
  • lyhourchhen
  • duongkimseng