@mx-cartographer/categories
TypeScript icon, indicating that this package has built-in type declarations

6.0.1 • Public • Published

Category Selector Library

This library contains the Category Selector control

Getting started

Installation

  • npm install @mx-cartographer/categories

Usage

CategorySelector must be wrapped by CategoryDataProvider in order for it to have access to the CategoryStore

import { ApiEndpoints, CategoryApi, CategoryStore } from '@mx-cartographer/common'
import { CategoryDataProvider, CategorySelector } from '@mx-cartographer/categories'

export const Example = () => {
  const store = new CategoryStore()
  store.initialize(new CategoryApi('/', ''))
  
  const handleSelected = (guid: string) => {
    // Some action when category is selected
  }
  
  return (
    <CategoryDataProvider onEvent={handleEvent} onSelected={handleSelected} store={store}>
      <CategorySelector />
    </CategoryDataProvider>
  )
}

Optional Props

  • initialSelected: string Set an initially selected category
  • showSelected: boolean Whether or not a checkmark should display on selected categories
  • unselectable: string[] An array of category guids that should not be selectable
  • unselectableText: string Specify what text to show on the tag displayed on unselectable rows (Default is 'Unselectable')

Readme

Keywords

none

Package Sidebar

Install

npm i @mx-cartographer/categories

Weekly Downloads

114

Version

6.0.1

License

MIT

Unpacked Size

83.8 kB

Total Files

72

Last publish

Collaborators

  • drewwarren
  • shalyn.huetter123
  • stephanie.stamm
  • william.bridegroom
  • oklandon
  • lem_mx
  • jgerlach
  • santhosh_mx
  • ashlylamarr
  • daniel.simmonds
  • jordanboudreau
  • mason.medeiros.mx
  • mx-meganathan
  • mickzeller
  • ramana-kumar.murali
  • mx.dev
  • mx-sabarigiri