0.21.19 • Published 7 days ago

@synerise/ds-context-selector v0.21.19

Weekly downloads
57
License
ISC
Repository
github
Last release
7 days ago

id: context-selector

title: ContextSelector

ContextSelector UI Component

Installation

npm i @synerise/ds-context-selector
or
yarn add @synerise/ds-context-selector

Usage

import ContextSelector from '@synerise/ds-context-selector'

<ContextSelector
    texts={{
     buttonLabel: 'Choose',
     searchPlaceholder: 'Search',
     noResults: 'No results',
   }}
    onSelectItem={(item) => {}}
    selectedItem={{
       name: 'Transaction charge',
       id: 6,
       icon: <NotificationsM />,
       groupId: 'RECENT',
       groupName: 'Activity',
     }}
    items={[
        {
            name: 'Pricelist 02',
            id: 0,
            icon: <SegmentM />,
            groupId: 'RECENT',
            groupName: 'Parameters',
        },
        {
            name: 'Transaction charge',
            id: 6,
            icon: <NotificationsM />,
            groupId: 'RECENT',
            groupName: 'Activity',
        },
        {
          name: 'Segmentation 1',
          id: 'segmentation_1',
          icon: <SegmentM />,
          groupId: 'SEGMENTATIONS',
        }
    ]}
    groups={[
        {
            id: 'RECENT',
            name: 'Recent',
            defaultGroup: true,
          },
          {
            id: 'ALL',
            name: 'All',
            defaultGroup: false,
            subGroups: [
            {
                name: 'Segmentations',
                id: 'SEGMENTATIONS',
                icon: <FolderM />,
                groupName: 'Parameters',
            },
            ]
        }]}
/>

Demo

API

PropertyDescriptionTypeDefault
groupsGroups of itemsContextGroup[][]
itemsArray of itemsContextItem[][]
menuItemHeightSize of single menu itemItemSize.LARGE \ ItemSize.DEFAULTItemSize.DEFAULT
onSelectItemCallback called when user selects item(item: ContextItem \ ContextGroup \ undefined) => void-
defaultDropdownVisibilitydefault visibility of dropdownbooleanfalse
openedWhether if dropdown should opens from outside of componentbooleanfalse
textsTranslations objectContextSelectorTexts-
selectedItemSelected itemContextItem \ undefinedundefined
addModeIf true trigger doesn't change style when value is setContextItem \ undefinedundefined
customTriggerComponentAdd custom triggerReact.ReactNodeundefined
triggerAdd custom trigger to modal'click' \ 'hover' \ 'contextMenu''click
getMenuEntryPropsConfigure tooltip (information-card by default)(arg: ParameterValueType) => MenuItemProps \ undefinedundefined
dropdownWrapperStylesApply custom styles to dropdown wrapperCSSProperties \ undefined-
onClickOutsideEventsOverwrite default events for document listenerHandledEventsType[] \ undefined-
onClickOutsideCallback called when user click outside dropdown() => void \ undefined-
onSearchCallback called when user enter any char in search input(query: string) => void-
hideSearchFieldWhether to hide the search field in the dropdownbooleanfalse
onFetchDataCallback called when user scrolls to the end of dropdown list() => void-
onActivateCallback called when user opens dropdown(fieldType: string) => void-
onDeactivateCallback called when user closes dropdown() => void-
hasMoreItemsWhether if onFetchData should be calledboolean-
getPopupContainerOverridePopup container function for child tooltips and dropdowns(trigger: HTMLElementnull) => HTMLElement;-
dropdownPropsLimited part of props for dropdown on ContextSelector componentOmit<DropdownProps, 'trigger' 'getPopupContainer' 'onVisibleChange' 'visible' 'overlay'>-

ContextGroup

PropertyDescriptionTypeDefault
defaultGroupWhether if this group is defaultbooleanfalse
iconIcon of groupReact.ReactNode-
idId of groupReact.ReactText-
itemTypeType of itemsstring-
nameName of groupstring-
subGroupsSubgroups of groupsContextGroup[]-
tooltipTooltip textstring-
useCustomIconUse custom icon instead of wrapping it inside Icon componentbooleanfalse
descriptionSet menu item description ( recommended to use with 'large' sizeReact.ReactNode-
customSuffixUse custom suffix instead of default 'check' iconReact.ReactNode-

ContextItem

PropertyDescriptionTypeDefault
groupIdId of groupReact.ReactText-
groupNameName of groupstring-
iconIcon of itemReact.ReactNode-
idId of itemReact.ReactText-
nameName of itemstring-
subGroupsSubgroups of itemContextGroup[]-
useCustomIconUse custom icon instead of wrapping it inside Icon componentbooleanfalse
descriptionSet menu item description ( recommended to use with 'large' sizeReact.ReactNode-
customSuffixUse custom suffix instead of default 'check' iconReact.ReactNode-

ContextSelectorTexts

PropertyDescriptionTypeDefault
buttonLabelButton labelstring \ React.ReactNode'Choose'
noResultsNo results infostring \ React.ReactNode'No results'
searchPlaceholderSearch box placeholderstring'Search'
0.21.19

7 days ago

0.21.18

9 days ago

0.21.17

9 days ago

0.21.16

18 days ago

0.21.14

21 days ago

0.21.15

21 days ago

0.21.13

22 days ago

0.21.12

25 days ago

0.21.10

1 month ago

0.21.11

1 month ago

0.21.9

1 month ago

0.21.8

1 month ago

0.21.7

1 month ago

0.21.6

1 month ago

0.21.5

2 months ago

0.21.4

2 months ago

0.21.3

2 months ago

0.21.2

2 months ago

0.21.1

2 months ago

0.21.0

2 months ago

0.20.8

2 months ago

0.20.7

3 months ago

0.20.6

3 months ago

0.20.5

3 months ago

0.20.4

3 months ago

0.20.3

3 months ago

0.20.2

3 months ago

0.20.1

4 months ago

0.20.0

4 months ago

0.19.25

4 months ago

0.19.24

4 months ago

0.19.23

5 months ago

0.19.22

5 months ago

0.19.21

5 months ago

0.19.20

5 months ago

0.17.7

11 months ago

0.17.9

10 months ago

0.17.10

10 months ago

0.17.12

10 months ago

0.17.11

10 months ago

0.17.13

10 months ago

0.18.1

10 months ago

0.18.2

10 months ago

0.18.3

10 months ago

0.18.4

10 months ago

0.18.5

9 months ago

0.18.0

10 months ago

0.19.8

8 months ago

0.19.9

8 months ago

0.19.0

9 months ago

0.19.1

9 months ago

0.19.2

9 months ago

0.19.3

9 months ago

0.19.4

9 months ago

0.19.5

8 months ago

0.19.6

8 months ago

0.19.7

8 months ago

0.19.11

8 months ago

0.19.12

7 months ago

0.19.13

7 months ago

0.19.14

7 months ago

0.19.15

7 months ago

0.19.16

7 months ago

0.19.17

7 months ago

0.19.18

6 months ago

0.19.10

8 months ago

0.19.19

6 months ago

0.17.5

11 months ago

0.17.6

11 months ago

0.17.4

11 months ago

0.17.3

12 months ago

0.17.2

12 months ago

0.17.0

12 months ago

0.17.1

12 months ago

0.16.14

12 months ago

0.16.10

1 year ago

0.16.11

1 year ago

0.16.12

1 year ago

0.16.13

1 year ago

0.16.3

1 year ago

0.16.4

1 year ago

0.16.5

1 year ago

0.16.6

1 year ago

0.16.7

1 year ago

0.16.8

1 year ago

0.16.9

1 year ago

0.16.2

1 year ago

0.15.10

1 year ago

0.15.9

1 year ago

0.16.0

1 year ago

0.16.1

1 year ago

0.15.7

1 year ago

0.15.6

1 year ago

0.15.4

1 year ago

0.15.5

1 year ago

0.14.12

1 year ago

0.14.11

1 year ago

0.15.0

1 year ago

0.15.1

1 year ago

0.15.2

1 year ago

0.15.3

1 year ago

0.14.10

1 year ago

0.14.5

2 years ago

0.14.6

2 years ago

0.14.7

2 years ago

0.14.8

2 years ago

0.14.9

1 year ago

0.14.3

2 years ago

0.14.4

2 years ago

0.13.0

2 years ago

0.12.16

2 years ago

0.12.17

2 years ago

0.14.0

2 years ago

0.12.19

2 years ago

0.14.1

2 years ago

0.14.2

2 years ago

0.12.13

2 years ago

0.12.14

2 years ago

0.12.15

2 years ago

0.12.20

2 years ago

0.12.21

2 years ago

0.12.10

2 years ago

0.12.11

2 years ago

0.12.12

2 years ago

0.12.7

2 years ago

0.12.2

2 years ago

0.12.3

2 years ago

0.12.4

2 years ago

0.12.5

2 years ago

0.12.6

2 years ago

0.11.0

2 years ago

0.12.0

2 years ago

0.12.1

2 years ago

0.10.10

2 years ago

0.10.9

2 years ago

0.10.5

2 years ago

0.10.6

2 years ago

0.10.7

2 years ago

0.10.8

2 years ago

0.9.0

2 years ago

0.10.1

2 years ago

0.10.2

2 years ago

0.10.3

2 years ago

0.10.4

2 years ago

0.10.0

2 years ago

0.8.5

2 years ago

0.8.4

2 years ago

0.8.7

2 years ago

0.8.6

2 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.8.3

2 years ago

0.8.2

3 years ago

0.7.3

3 years ago

0.7.2

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.4

3 years ago

0.6.3

3 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.5.0

3 years ago

0.5.1

3 years ago

0.6.0

3 years ago

0.4.43

3 years ago

0.4.42

3 years ago

0.4.41

3 years ago

0.4.40

3 years ago

0.4.39

3 years ago

0.4.38

3 years ago

0.4.37

3 years ago

0.4.36

3 years ago

0.4.35

3 years ago

0.4.32

3 years ago

0.4.33

3 years ago

0.4.34

3 years ago

0.4.31

3 years ago

0.4.30

3 years ago

0.4.29

3 years ago

0.4.28

3 years ago

0.4.27

3 years ago

0.4.26

3 years ago

0.4.23

3 years ago

0.4.20

3 years ago

0.4.19

3 years ago

0.4.18

3 years ago

0.4.17

3 years ago

0.4.16

3 years ago

0.4.15

3 years ago

0.4.14

3 years ago

0.4.13

3 years ago

0.4.12

3 years ago

0.4.9

3 years ago

0.4.8

3 years ago

0.4.10

3 years ago

0.4.11

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.1

3 years ago

0.4.2

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.1

3 years ago

0.1.0

3 years ago