0.9.38 • Published 2 days ago

@synerise/ds-tagslist v0.9.38

Weekly downloads
22
License
ISC
Repository
github
Last release
2 days ago

id: tagslist

title: TagsList

TagsList UI Component

Installation

npm i @synerise/ds-tagslist
# or
yarn add @synerise/ds-tagslist

Usage

import TagsList from '@synerise/ds-tagslist'

const items = [
    { id: 1, name: 'Tag 1' },
    { id: 2, name: 'Tag 2' }
];

const onChange = (
    action: TagsListActions, 
    newItems: TagsListItem[],
    newTargetItem: TagsListItem,   
    originItems: TagsListItem[], 
    originTargetItem: TagsListItem
) => {
    console.log(
        action,             // action string that was triggered
        newItems,           // new items object with changed data
        newTargetItem:      // new item object with changed data
        originItems,        // basically previous items
        originTargetItem,   // previous item
    );
};

<TagsList 
    items={items}
    onChange={onChange}
/>

Demo

API

PropertyDescriptionTypeDefault
addButtonDisabledDefines if add button is disabledbooleanfalse
itemsArray of items which should be displayed as tags for controlled stateTagsListItem[]
onChangeEvent function triggered when items change(action: TagsListActions, newItems: TagsListItem[], newTargetItem: TagsListItem, originItems: TagsListItem[], originTargetItem: TagsListItem) => void
defaultItemsArray of items for no controlled stateTagsListItem[]
maxItemsVisibleThe maximum amount of items which will be visible on the initial rendernumber10
showMoreStepNumber of items shown after clicking "show more" buttonnumber10
textsOverride translation texts passed to the componentTagsListTexts-
onAddDropdownEvent function triggered on "Add tag" visibility change(visible: boolean) => void
onSearchEvent function triggered on search input change(query: string) => void
onManageTagsTriggered when Manage tags buttons are clicked(event: React.MouseEvent<HTMLElement, MouseEvent>) => void
onItemsAddEvent triggered when "Apply" button is clicked inside "Add tag" dropdown.(items: TagsListItem[]) => void
withCheckboxShow checkboxes on items hoverbooleantrue

TagsListItem

TagsListItem object contains information about specific tag.

PropertyDescriptionTypeDefault
nameName of the tagstring-
descriptionDescription info, if set it will be shown in AddModalstring-
favouriteWhether item is added to favouritesbooleanfalse
checkedWhether item is checked/selected (for controlled state)booleanfalse
canUpdateWhether item is editablebooleanfalse
canDeleteWhether item is removablebooleanfalse
canEnterSettingsWhether user can enter settings for the itembooleanfalse
idUnique id of the tag itemstring-

TagsListTexts

PropertyDescriptionTypeDefault
add"Add" textReactNode-
addItemLabelA label of the add formReactNode-
addToFavouriteA tooltip used for adding to the favouritesReactNode-
delete"Delete" textReactNode-
deleteFromFavouritesA tooltip used for removing from favouritesReactNode-
deleteAllContentA message displayed when user wants to delete all the content of the folderReactNode-
edit"Edit" text - displayed in actions menuReactNode-
enterSettings"Settings" text - displayed in actions menuReactNode-
invalidNameErrorError displayed when user provides invalid folder nameReactNode-
less"Less" text - displayed in the footerReactNode-
more"More" text - displayed in the footerReactNode-
moveToDefaultA message displayed when user wants to all the content of the folder to the default folderReactNode-
moveToOtherFolderA message displayed when user wants to all the content of the folder to the other folderReactNode-
showLessLabelAdditional label of the "show less" button in the footerReactNode-
showMoreLabelAdditional label of the "show more" button in the footerReactNode-

AddModal

PropertyDescriptionTypeDefault
disabledShould the trigger be disabledbooleanfalse
itemsList of itemsTagsListItem[]
loadingShow loadingbooleanfalse
tristateUse <CheckboxTristate> for tagsbooleanfalse
triggerReplace default trigger buttonReactNode
searchAddTagAbility to add new tags with search inputbooleantrue
textsOverride translation texts passed to the componentTagsListTexts
onItemsAddEvent function triggered when hit Apply button(items: TagsListItem[]) => void
onVisibleChangeEvent function triggered when dropdown visibility changes(visible: boolean) => void
onManageTagsFunction triggered when "Manage tags" button is clicked(event: React.MouseEvent<HTMLElement, MouseEvent>) => void
0.9.37

2 days ago

0.9.38

2 days ago

0.9.36

11 days ago

0.9.35

15 days ago

0.9.34

25 days ago

0.9.33

1 month ago

0.9.32

1 month ago

0.9.31

1 month ago

0.9.30

2 months ago

0.9.29

2 months ago

0.9.28

2 months ago

0.9.27

3 months ago

0.9.25

3 months ago

0.9.26

3 months ago

0.9.24

3 months ago

0.9.23

4 months ago

0.9.22

4 months ago

0.9.21

4 months ago

0.9.20

5 months ago

0.9.19

5 months ago

0.9.18

5 months ago

0.9.8

8 months ago

0.8.67

10 months ago

0.9.7

8 months ago

0.8.66

10 months ago

0.8.69

10 months ago

0.9.9

8 months ago

0.8.68

10 months ago

0.9.4

8 months ago

0.9.3

8 months ago

0.9.6

8 months ago

0.9.5

8 months ago

0.9.12

7 months ago

0.9.13

7 months ago

0.9.14

7 months ago

0.9.15

6 months ago

0.9.10

7 months ago

0.9.11

7 months ago

0.9.16

6 months ago

0.9.17

6 months ago

0.9.0

9 months ago

0.9.2

9 months ago

0.9.1

9 months ago

0.8.65

11 months ago

0.8.64

11 months ago

0.8.63

12 months ago

0.8.62

12 months ago

0.8.61

12 months ago

0.8.60

1 year ago

0.8.56

1 year ago

0.8.55

1 year ago

0.8.58

1 year ago

0.8.57

1 year ago

0.8.52

1 year ago

0.8.54

1 year ago

0.8.53

1 year ago

0.8.59

1 year ago

0.8.51

1 year ago

0.8.50

1 year ago

0.8.49

1 year ago

0.8.47

1 year ago

0.8.46

1 year ago

0.8.45

1 year ago

0.8.44

1 year ago

0.8.41

1 year ago

0.8.43

1 year ago

0.8.42

1 year ago

0.8.40

1 year ago

0.8.36

2 years ago

0.8.35

2 years ago

0.8.38

2 years ago

0.8.37

2 years ago

0.8.39

1 year ago

0.8.34

2 years ago

0.8.33

2 years ago

0.8.30

2 years ago

0.8.32

2 years ago

0.8.31

2 years ago

0.8.25

2 years ago

0.8.24

2 years ago

0.8.27

2 years ago

0.8.26

2 years ago

0.8.28

2 years ago

0.8.23

2 years ago

0.8.22

2 years ago

0.8.21

2 years ago

0.8.14

2 years ago

0.8.13

2 years ago

0.8.16

2 years ago

0.8.15

2 years ago

0.8.18

2 years ago

0.8.17

2 years ago

0.8.12

2 years ago

0.8.11

2 years ago

0.8.10

2 years ago

0.8.9

2 years ago

0.8.8

2 years ago

0.8.5

2 years ago

0.8.7

2 years ago

0.8.6

2 years ago

0.8.4

2 years ago

0.7.9

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.8.3

2 years ago

0.8.2

2 years ago

0.7.2

2 years ago

0.7.1

3 years ago

0.7.4

2 years ago

0.7.3

2 years ago

0.7.0

3 years ago

0.7.6

2 years ago

0.7.5

2 years ago

0.7.8

2 years ago

0.7.7

2 years ago

0.6.53

3 years ago

0.6.52

3 years ago

0.6.50

3 years ago

0.6.51

3 years ago

0.6.49

3 years ago

0.6.48

3 years ago

0.6.47

3 years ago

0.6.46

3 years ago

0.6.43

3 years ago

0.6.45

3 years ago

0.6.44

3 years ago

0.6.42

3 years ago

0.6.41

3 years ago

0.6.40

3 years ago

0.6.39

3 years ago

0.6.38

3 years ago

0.6.37

3 years ago

0.6.36

3 years ago

0.6.35

3 years ago

0.6.34

3 years ago

0.6.32

3 years ago

0.6.33

3 years ago

0.6.31

3 years ago

0.6.30

3 years ago

0.6.29

3 years ago

0.6.28

3 years ago

0.6.27

3 years ago

0.6.24

3 years ago

0.6.21

3 years ago

0.6.20

3 years ago

0.6.19

3 years ago

0.6.18

3 years ago

0.6.17

3 years ago

0.6.16

3 years ago

0.6.15

3 years ago

0.6.14

3 years ago

0.6.13

3 years ago

0.6.10

3 years ago

0.6.12

3 years ago

0.6.11

3 years ago

0.6.9

3 years ago

0.6.7

3 years ago

0.6.8

3 years ago

0.6.6

3 years ago

0.6.5

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.6.0

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.20

3 years ago