Noteworthy Programs Map

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

    1.1.4 • 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')

    Keywords

    none

    Install

    npm i @mx-cartographer/categories

    DownloadsWeekly Downloads

    20

    Version

    1.1.4

    License

    MIT

    Unpacked Size

    66.1 kB

    Total Files

    42

    Last publish

    Collaborators

    • jgerlach
    • lem_mx
    • harlan.evans.mx
    • igor.morgunov
    • jsfowles
    • mattcbodily
    • kelliegreen
    • shalyn.huetter123
    • william.bridegroom
    • stephanie.stamm
    • drewwarren
    • stevencreates
    • garrowp