@chayns-components/core 5.5.36 → 5.5.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -0
- package/lib/cjs/components/copyable-content/CopyableContent.js +12 -11
- package/lib/cjs/components/copyable-content/CopyableContent.js.map +1 -1
- package/lib/cjs/components/copyable-content/CopyableContent.test.js +4 -11
- package/lib/cjs/components/copyable-content/CopyableContent.test.js.map +1 -1
- package/lib/cjs/components/file-list/FileList.js +4 -3
- package/lib/cjs/components/file-list/FileList.js.map +1 -1
- package/lib/cjs/components/file-list/file-item/FileItem.js +6 -7
- package/lib/cjs/components/file-list/file-item/FileItem.js.map +1 -1
- package/lib/cjs/components/filter/filter-content/FilterContent.js +8 -7
- package/lib/cjs/components/filter/filter-content/FilterContent.js.map +1 -1
- package/lib/cjs/components/filter-buttons/FilterButtons.js +5 -3
- package/lib/cjs/components/filter-buttons/FilterButtons.js.map +1 -1
- package/lib/cjs/components/filter-buttons/all-button/AllButton.js +5 -4
- package/lib/cjs/components/filter-buttons/all-button/AllButton.js.map +1 -1
- package/lib/cjs/components/search-box/SearchBox.js +13 -4
- package/lib/cjs/components/search-box/SearchBox.js.map +1 -1
- package/lib/cjs/components/truncation/Truncation.js +8 -7
- package/lib/cjs/components/truncation/Truncation.js.map +1 -1
- package/lib/cjs/components/truncation/Truncation.test.js +4 -5
- package/lib/cjs/components/truncation/Truncation.test.js.map +1 -1
- package/lib/cjs/constants/textStrings.js +29 -29
- package/lib/cjs/constants/textStrings.js.map +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/utils/searchBox.js +6 -0
- package/lib/cjs/utils/searchBox.js.map +1 -1
- package/lib/cjs/utils/searchBox.test.js +34 -0
- package/lib/cjs/utils/searchBox.test.js.map +1 -0
- package/lib/esm/components/copyable-content/CopyableContent.js +12 -11
- package/lib/esm/components/copyable-content/CopyableContent.js.map +1 -1
- package/lib/esm/components/copyable-content/CopyableContent.test.js +4 -11
- package/lib/esm/components/copyable-content/CopyableContent.test.js.map +1 -1
- package/lib/esm/components/file-list/FileList.js +4 -3
- package/lib/esm/components/file-list/FileList.js.map +1 -1
- package/lib/esm/components/file-list/file-item/FileItem.js +6 -7
- package/lib/esm/components/file-list/file-item/FileItem.js.map +1 -1
- package/lib/esm/components/filter/filter-content/FilterContent.js +8 -7
- package/lib/esm/components/filter/filter-content/FilterContent.js.map +1 -1
- package/lib/esm/components/filter-buttons/FilterButtons.js +5 -3
- package/lib/esm/components/filter-buttons/FilterButtons.js.map +1 -1
- package/lib/esm/components/filter-buttons/all-button/AllButton.js +5 -4
- package/lib/esm/components/filter-buttons/all-button/AllButton.js.map +1 -1
- package/lib/esm/components/search-box/SearchBox.js +13 -4
- package/lib/esm/components/search-box/SearchBox.js.map +1 -1
- package/lib/esm/components/truncation/Truncation.js +8 -7
- package/lib/esm/components/truncation/Truncation.js.map +1 -1
- package/lib/esm/components/truncation/Truncation.test.js +4 -5
- package/lib/esm/components/truncation/Truncation.test.js.map +1 -1
- package/lib/esm/constants/textStrings.js +29 -29
- package/lib/esm/constants/textStrings.js.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/utils/searchBox.js +6 -0
- package/lib/esm/utils/searchBox.js.map +1 -1
- package/lib/esm/utils/searchBox.test.js +32 -0
- package/lib/esm/utils/searchBox.test.js.map +1 -0
- package/lib/types/components/search-box/SearchBox.d.ts +5 -0
- package/lib/types/constants/textStrings.d.ts +29 -29
- package/lib/types/index.d.ts +1 -0
- package/lib/types/utils/searchBox.d.ts +4 -2
- package/package.json +3 -3
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","Accordion","AccordionContent","AccordionGroup","AccordionIntro","AccordionItem","AmountControl","VerificationBadge","AreaContext","AreaProvider","Badge","Button","Checkbox","ColorSchemeProvider","useColorScheme","BadgeSize","BadgeDesign","useContainer","ContainerAnchor","useFocusRingPortal","DropdownDirection","useIsMeasuredClone","useCombinedRefs","Filter","AnimatedNumber","FileList","FileSelect","DropdownBodyWrapper","ComboBox","ContentCard","CopyableContent","CopyableContentAppearance","HighlightSlider","ContextMenu","ContextMenuAlignment","ExpandableContent","FileInput","STREAMINGSERVICE_FILE_TYPES","TSIMG_FILE_TYPES","FilterButton","FilterButtons","GridImage","GroupedImage","Icon","Input","InputSize","List","ListItemContent","ListItem","LIST_ITEM_MARKER","withListItemMarker","withListItemMarkerForwardRef","MentionFinder","MultiActionButton","NumberInput","PageProvider","Popup","PopupContent","ProgressBar","PopupAlignment","RadioButtonGroup","RadioButton","ScrollView","SearchBox","SearchInput","SelectButton","SetupWizardItem","SetupWizard","SharingContextMenu","SharingBar","SharingButton","Signature","SliderButton","Slider","SmallWaitCursor","SmallWaitCursorSize","SmallWaitCursorSpeed","TagInput","TextArea","Tooltip","Truncation","MentionFinderPopupAlignment","useElementSize","ContentCardType","isValidFileType","getHumanSize","FilterButtonItemShape","FilterButtonSize","MultiActionButtonHeight","MultiActionButtonStatusType","ClampPosition","useIsTouch","filterFilesByMimeType","getFileAsArrayBuffer","selectFiles","isTobitEmployee","getUsableHeight","uploadFile","ComboBoxSize","Skeleton","SkeletonAnimationType","Masonry","useKeyboardFocusHighlighting"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as VerificationBadge } from './components/verification-badge/VerificationBadge';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport {\n default as ColorSchemeProvider,\n useColorScheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { BadgeSize, BadgeDesign } from './components/badge/Badge.types';\nexport type {\n ColorSchemeContextProps,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { useContainer, ContainerAnchor } from './hooks/container';\nexport { useFocusRingPortal } from './hooks/useFocusRingPortal';\nexport { DropdownDirection, type DropdownCoordinates } from './types/dropdown';\nexport { useIsMeasuredClone } from './hooks/element';\nexport { useCombinedRefs } from './hooks/ref';\nexport { default as Filter, type FilterRightIcon } from './components/filter/Filter';\nexport {\n type SortItem,\n type SearchConfig,\n type SortConfig,\n type CheckboxConfig,\n type FilterButtonConfig,\n type FilterRef,\n} from './types/filter';\nexport { default as AnimatedNumber } from './components/animated-number/AnimatedNumber';\nexport {\n default as FileList,\n type IFileItem as FileListItem,\n} from './components/file-list/FileList';\nexport { default as FileSelect } from './components/file-select/FileSelect';\nexport { default as DropdownBodyWrapper } from './components/dropdown-body-wrapper/DropdownBodyWrapper';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport {\n default as CopyableContent,\n CopyableContentAppearance,\n type CopyableContentProps,\n} from './components/copyable-content/CopyableContent';\nexport { default as HighlightSlider } from './components/highlight-slider/HighlightSlider';\nexport type { HighlightSliderItemColors as HighlightSliderColors } from './components/highlight-slider/highlight-slider-item/HighlightSliderItem';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport {\n ContextMenuAlignment,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuProps,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu.types';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport {\n default as FileInput,\n type FileInputRef,\n STREAMINGSERVICE_FILE_TYPES,\n TSIMG_FILE_TYPES,\n} from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as GroupedImage } from './components/grouped-image/GroupedImage';\nexport { default as Icon, type IconProps } from './components/icon/Icon';\nexport { default as Input, InputSize } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n type ListItemRef,\n type ListItemSize,\n} from './components/list/list-item/ListItem';\nexport {\n type ListItemMarkedForwardRefComponent,\n type ListItemMarkedComponent,\n type ListItemMetaProps,\n LIST_ITEM_MARKER,\n withListItemMarker,\n withListItemMarkerForwardRef,\n} from './components/list/list-item/ListItem.utils';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as MultiActionButton } from './components/multi-action-button/MultiActionButton';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { PopupAlignment } from './types/popup';\nexport type { PopupProps } from './components/popup/Popup.types';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingContextMenu } from './components/sharing-context-menu/SharingContextMenu';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as SharingButton } from './components/sharing-button/SharingButton';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport type { Tag } from './types/tagInput';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport type { TagInputRef } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/element';\nexport type { BrowserName } from './types/chayns';\nexport { ContentCardType } from './types/contentCard';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport { isValidFileType, getHumanSize } from './utils/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport {\n type MultiActionButtonAction,\n type MultiActionButtonActionEvent,\n type MultiActionButtonActionStatus,\n MultiActionButtonHeight,\n type MultiActionButtonProps,\n type MultiActionButtonSecondaryContextMenu,\n MultiActionButtonStatusType,\n} from './components/multi-action-button/MultiActionButton.types';\nexport { ClampPosition } from './types/truncation';\nexport { useIsTouch } from './utils/environment';\nexport { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\nexport type { Theme } from './components/color-scheme-provider/ColorSchemeProvider';\nexport { ComboBoxSize } from './components/combobox/ComboBox.types';\nexport type {\n IComboBoxItem as ComboBoxItem,\n ComboBoxTextStyles,\n IComboBoxItems as ComboBoxItems,\n ComboBoxRef,\n} from './components/combobox/ComboBox.types';\nexport { default as Skeleton } from './components/skeleton';\nexport { SkeletonAnimationType } from './components/skeleton/types';\nexport { default as Masonry } from './components/masonry/Masonry';\nexport { useKeyboardFocusHighlighting } from './hooks/useKeyboardFocusHighlighting';\n"],"mappings":"AAAA;;AAEA,SAASA,OAAO,IAAIC,SAAS,QAAQ,kCAAkC;AACvE,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,2DAA2D;AACvG,SAASF,OAAO,IAAIG,cAAc,QAAQ,uDAAuD;AACjG,SAASH,OAAO,IAAII,cAAc,QAAQ,uDAAuD;AACjG,SAASJ,OAAO,IAAIK,aAAa,QAAQ,qDAAqD;AAC9F,SAASL,OAAO,IAAIM,aAAa,QAAQ,2CAA2C;AACpF,SAASN,OAAO,IAAIO,iBAAiB,QAAQ,mDAAmD;AAChG,SACIC,WAAW,EACXR,OAAO,IAAIS,YAAY,QACpB,gDAAgD;AACvD,SAAST,OAAO,IAAIU,KAAK,QAAQ,0BAA0B;AAC3D,SAASV,OAAO,IAAIW,MAAM,QAAQ,4BAA4B;AAC9D,SAASX,OAAO,IAAIY,QAAQ,QAAQ,gCAAgC;AACpE,SACIZ,OAAO,IAAIa,mBAAmB,EAC9BC,cAAc,QACX,wDAAwD;AAC/D,SAASC,SAAS,EAAEC,WAAW,QAAQ,gCAAgC;AAKvE,SAASC,YAAY,EAAEC,eAAe,QAAQ,mBAAmB;AACjE,SAASC,kBAAkB,QAAQ,4BAA4B;AAC/D,SAASC,iBAAiB,QAAkC,kBAAkB;AAC9E,SAASC,kBAAkB,QAAQ,iBA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QAAQ,QAAQ,iCAAiC;AAErE,SAAS7E,OAAO,IAAI8E,QAAQ,QAAQ,iCAAiC;AACrE,SAAS9E,OAAO,IAAI+E,OAAO,QAAQ,8BAA8B;AACjE,SAAS/E,OAAO,IAAIgF,UAAU,QAAQ,oCAAoC;AAC1E,SAASC,2BAA2B,QAAQ,2BAA2B;AACvE,SAASC,cAAc,QAAQ,iBAAiB;AAEhD,SAASC,eAAe,QAAQ,qBAAqB;AAErD,SAASC,eAAe,EAAEC,YAAY,QAAQ,cAAc;AAE5D,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ,uBAAuB;AAW/E,SAIIC,uBAAuB,EAGvBC,2BAA2B,QACxB,0DAA0D;AACjE,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,QAAQ,qBAAqB;AAChD,SAASC,qBAAqB,EAAEC,oBAAoB,EAAEC,WAAW,QAAQ,oBAAoB;AAC7F,SAASC,eAAe,QAAQ,yBAAyB;AACzD,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,UAAU,QAAQ,oBAAoB;AAE/C,SAASC,YAAY,QAAQ,sCAAsC;AAOnE,SAASlG,OAAO,IAAImG,QAAQ,QAAQ,uBAAuB;AAC3D,SAASC,qBAAqB,QAAQ,6BAA6B;AACnE,SAASpG,OAAO,IAAIqG,OAAO,QAAQ,8BAA8B;AACjE,SAASC,4BAA4B,QAAQ,sCAAsC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","Accordion","AccordionContent","AccordionGroup","AccordionIntro","AccordionItem","AmountControl","VerificationBadge","AreaContext","AreaProvider","Badge","Button","Checkbox","ColorSchemeProvider","useColorScheme","BadgeSize","BadgeDesign","useContainer","ContainerAnchor","useFocusRingPortal","DropdownDirection","useIsMeasuredClone","useCombinedRefs","Filter","AnimatedNumber","FileList","FileSelect","DropdownBodyWrapper","ComboBox","ContentCard","CopyableContent","CopyableContentAppearance","HighlightSlider","ContextMenu","ContextMenuAlignment","ExpandableContent","FileInput","STREAMINGSERVICE_FILE_TYPES","TSIMG_FILE_TYPES","FilterButton","FilterButtons","GridImage","GroupedImage","Icon","Input","InputSize","List","ListItemContent","ListItem","LIST_ITEM_MARKER","withListItemMarker","withListItemMarkerForwardRef","MentionFinder","MultiActionButton","NumberInput","PageProvider","Popup","PopupContent","ProgressBar","PopupAlignment","RadioButtonGroup","RadioButton","ScrollView","SearchBox","SearchInput","SelectButton","SetupWizardItem","SetupWizard","SharingContextMenu","SharingBar","SharingButton","Signature","SliderButton","Slider","SmallWaitCursor","SmallWaitCursorSize","SmallWaitCursorSpeed","TagInput","TextArea","Tooltip","Truncation","MentionFinderPopupAlignment","useElementSize","ContentCardType","isValidFileType","getHumanSize","FilterButtonItemShape","FilterButtonSize","MultiActionButtonHeight","MultiActionButtonStatusType","ClampPosition","useIsTouch","filterFilesByMimeType","getFileAsArrayBuffer","selectFiles","isTobitEmployee","getUsableHeight","uploadFile","ComboBoxSize","Skeleton","SkeletonAnimationType","Masonry","useKeyboardFocusHighlighting"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as VerificationBadge } from './components/verification-badge/VerificationBadge';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport {\n default as ColorSchemeProvider,\n useColorScheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { BadgeSize, BadgeDesign } from './components/badge/Badge.types';\nexport type {\n ColorSchemeContextProps,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { useContainer, ContainerAnchor } from './hooks/container';\nexport { useFocusRingPortal } from './hooks/useFocusRingPortal';\nexport { DropdownDirection, type DropdownCoordinates } from './types/dropdown';\nexport { useIsMeasuredClone } from './hooks/element';\nexport { useCombinedRefs } from './hooks/ref';\nexport { default as Filter, type FilterRightIcon } from './components/filter/Filter';\nexport {\n type SortItem,\n type SearchConfig,\n type SortConfig,\n type CheckboxConfig,\n type FilterButtonConfig,\n type FilterRef,\n} from './types/filter';\nexport { default as AnimatedNumber } from './components/animated-number/AnimatedNumber';\nexport {\n default as FileList,\n type IFileItem as FileListItem,\n} from './components/file-list/FileList';\nexport { default as FileSelect } from './components/file-select/FileSelect';\nexport { default as DropdownBodyWrapper } from './components/dropdown-body-wrapper/DropdownBodyWrapper';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport {\n default as CopyableContent,\n CopyableContentAppearance,\n type CopyableContentProps,\n} from './components/copyable-content/CopyableContent';\nexport { default as HighlightSlider } from './components/highlight-slider/HighlightSlider';\nexport type { HighlightSliderItemColors as HighlightSliderColors } from './components/highlight-slider/highlight-slider-item/HighlightSliderItem';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport {\n ContextMenuAlignment,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuProps,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu.types';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport {\n default as FileInput,\n type FileInputRef,\n STREAMINGSERVICE_FILE_TYPES,\n TSIMG_FILE_TYPES,\n} from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as GroupedImage } from './components/grouped-image/GroupedImage';\nexport { default as Icon, type IconProps } from './components/icon/Icon';\nexport { default as Input, InputSize } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n type ListItemRef,\n type ListItemSize,\n} from './components/list/list-item/ListItem';\nexport {\n type ListItemMarkedForwardRefComponent,\n type ListItemMarkedComponent,\n type ListItemMetaProps,\n LIST_ITEM_MARKER,\n withListItemMarker,\n withListItemMarkerForwardRef,\n} from './components/list/list-item/ListItem.utils';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as MultiActionButton } from './components/multi-action-button/MultiActionButton';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { PopupAlignment } from './types/popup';\nexport type { PopupProps } from './components/popup/Popup.types';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingContextMenu } from './components/sharing-context-menu/SharingContextMenu';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as SharingButton } from './components/sharing-button/SharingButton';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport type { Tag } from './types/tagInput';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport type { TagInputRef } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/element';\nexport type { BrowserName } from './types/chayns';\nexport { ContentCardType } from './types/contentCard';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport { isValidFileType, getHumanSize } from './utils/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SearchBoxSortFunction } from './utils/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport {\n type MultiActionButtonAction,\n type MultiActionButtonActionEvent,\n type MultiActionButtonActionStatus,\n MultiActionButtonHeight,\n type MultiActionButtonProps,\n type MultiActionButtonSecondaryContextMenu,\n MultiActionButtonStatusType,\n} from './components/multi-action-button/MultiActionButton.types';\nexport { ClampPosition } from './types/truncation';\nexport { useIsTouch } from './utils/environment';\nexport { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\nexport type { Theme } from './components/color-scheme-provider/ColorSchemeProvider';\nexport { ComboBoxSize } from './components/combobox/ComboBox.types';\nexport type {\n IComboBoxItem as ComboBoxItem,\n ComboBoxTextStyles,\n IComboBoxItems as ComboBoxItems,\n ComboBoxRef,\n} from './components/combobox/ComboBox.types';\nexport { default as Skeleton } from './components/skeleton';\nexport { SkeletonAnimationType } from './components/skeleton/types';\nexport { default as Masonry } from './components/masonry/Masonry';\nexport { useKeyboardFocusHighlighting } from './hooks/useKeyboardFocusHighlighting';\n"],"mappings":"AAAA;;AAEA,SAASA,OAAO,IAAIC,SAAS,QAAQ,kCAAkC;AACvE,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,2DAA2D;AACvG,SAASF,OAAO,IAAIG,cAAc,QAAQ,uDAAuD;AACjG,SAASH,OAAO,IAAII,cAAc,QAAQ,uDAAuD;AACjG,SAASJ,OAAO,IAAIK,aAAa,QAAQ,qDAAqD;AAC9F,SAASL,OAAO,IAAIM,aAAa,QAAQ,2CAA2C;AACpF,SAASN,OAAO,IAAIO,iBAAiB,QAAQ,mDAAmD;AAChG,SACIC,WAAW,EACXR,OAAO,IAAIS,YAAY,QACpB,gDAAgD;AACvD,SAAST,OAAO,IAAIU,KAAK,QAAQ,0BAA0B;AAC3D,SAASV,OAAO,IAAIW,MAAM,QAAQ,4BAA4B;AAC9D,SAASX,OAAO,IAAIY,QAAQ,QAAQ,gCAAgC;AACpE,SACIZ,OAAO,IAAIa,mBAAmB,EAC9BC,cAAc,QACX,wDAAwD;AAC/D,SAASC,SAAS,EAAEC,WAAW,QAAQ,gCAAgC;AAKvE,SAASC,YAAY,EAAEC,eAAe,QAAQ,mBAAmB;AACjE,SAASC,kBAAkB,QAAQ,4BAA4B;AAC/D,SAASC,iBAAiB,QAAkC,kBAAkB;AAC9E,SAASC,kBAAkB,QAAQ,iBAAiB;AACpD,SAASC,eAAe,QAAQ,aAAa;AAC7C,SAAStB,OAAO,IAAIuB,MAAM,QAA8B,4BAA4B;AASpF,SAASvB,OAAO,IAAIwB,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,8BAA8B;AACjE,SAAS/E,OAAO,IAAIgF,UAAU,QAAQ,oCAAoC;AAC1E,SAASC,2BAA2B,QAAQ,2BAA2B;AACvE,SAASC,cAAc,QAAQ,iBAAiB;AAEhD,SAASC,eAAe,QAAQ,qBAAqB;AAErD,SAASC,eAAe,EAAEC,YAAY,QAAQ,cAAc;AAE5D,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ,uBAAuB;AAY/E,SAIIC,uBAAuB,EAGvBC,2BAA2B,QACxB,0DAA0D;AACjE,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,QAAQ,qBAAqB;AAChD,SAASC,qBAAqB,EAAEC,oBAAoB,EAAEC,WAAW,QAAQ,oBAAoB;AAC7F,SAASC,eAAe,QAAQ,yBAAyB;AACzD,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,UAAU,QAAQ,oBAAoB;AAE/C,SAASC,YAAY,QAAQ,sCAAsC;AAOnE,SAASlG,OAAO,IAAImG,QAAQ,QAAQ,uBAAuB;AAC3D,SAASC,qBAAqB,QAAQ,6BAA6B;AACnE,SAASpG,OAAO,IAAIqG,OAAO,QAAQ,8BAA8B;AACjE,SAASC,4BAA4B,QAAQ,sCAAsC","ignoreList":[]}
|
|
@@ -38,9 +38,13 @@ export const getCurrentGroupName = element => {
|
|
|
38
38
|
return currentGroupName;
|
|
39
39
|
};
|
|
40
40
|
export const sortSearchBoxItems = ({
|
|
41
|
+
customSortFunction,
|
|
41
42
|
searchString,
|
|
42
43
|
items
|
|
43
44
|
}) => {
|
|
45
|
+
if (customSortFunction) {
|
|
46
|
+
return [...items].sort(customSortFunction);
|
|
47
|
+
}
|
|
44
48
|
const lowercaseSearchString = searchString.toLowerCase();
|
|
45
49
|
return [...items].sort((a, b) => {
|
|
46
50
|
const aStartsWithSearchString = a.text.toLowerCase().startsWith(lowercaseSearchString);
|
|
@@ -55,6 +59,7 @@ export const sortSearchBoxItems = ({
|
|
|
55
59
|
});
|
|
56
60
|
};
|
|
57
61
|
export const searchList = ({
|
|
62
|
+
customSortFunction,
|
|
58
63
|
searchString,
|
|
59
64
|
items
|
|
60
65
|
}) => {
|
|
@@ -76,6 +81,7 @@ export const searchList = ({
|
|
|
76
81
|
}
|
|
77
82
|
});
|
|
78
83
|
return sortSearchBoxItems({
|
|
84
|
+
customSortFunction,
|
|
79
85
|
items: matchingItems,
|
|
80
86
|
searchString
|
|
81
87
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchBox.js","names":["surroundWithBTag","text","startIndex","length","before","substring","highlighted","after","getCurrentGroupName","element","hasChildrenFound","currentGroupName","top","parentTop","getBoundingClientRect","children","Array","from","forEach","child","y","childrenY","height","childrenHeight","id","sum","currentGroup","startsWith","nummer","split","pop","sortSearchBoxItems","searchString","items","
|
|
1
|
+
{"version":3,"file":"searchBox.js","names":["surroundWithBTag","text","startIndex","length","before","substring","highlighted","after","getCurrentGroupName","element","hasChildrenFound","currentGroupName","top","parentTop","getBoundingClientRect","children","Array","from","forEach","child","y","childrenY","height","childrenHeight","id","sum","currentGroup","startsWith","nummer","split","pop","sortSearchBoxItems","customSortFunction","searchString","items","sort","lowercaseSearchString","toLowerCase","a","b","aStartsWithSearchString","bStartsWithSearchString","localeCompare","searchList","matchingItems","item","lowercaseText","includes","push","indexOf","highlightedText"],"sources":["../../../src/utils/searchBox.ts"],"sourcesContent":["import type { ISearchBoxItem } from '../types/searchBox';\n\nconst surroundWithBTag = (text: string, startIndex: number, length: number) => {\n const before = text.substring(0, startIndex);\n const highlighted = text.substring(startIndex, startIndex + length);\n const after = text.substring(startIndex + length);\n\n return `${before}<b>${highlighted}</b>${after}`;\n};\n\nexport const getCurrentGroupName = (element: HTMLElement) => {\n let hasChildrenFound = false;\n let currentGroupName = '';\n\n const { top: parentTop } = element.getBoundingClientRect();\n const { children } = element;\n\n Array.from(children).forEach((child) => {\n if (hasChildrenFound) {\n return;\n }\n\n const { y: childrenY, height: childrenHeight } = child.getBoundingClientRect();\n const { id } = child;\n\n const sum = childrenY + childrenHeight - parentTop;\n\n if (sum >= 0) {\n hasChildrenFound = true;\n let currentGroup = id;\n\n if (id.startsWith('search-box-item__')) {\n const nummer = id.split('__')[1];\n currentGroup = nummer?.split('_').pop() ?? '';\n }\n\n currentGroupName = currentGroup;\n }\n });\n\n return currentGroupName;\n};\n\nexport type SearchBoxSortFunction = (a: ISearchBoxItem, b: ISearchBoxItem) => number;\n\ninterface SearchListOptions {\n customSortFunction?: SearchBoxSortFunction;\n items: ISearchBoxItem[];\n searchString: string;\n}\n\nexport const sortSearchBoxItems = ({\n customSortFunction,\n searchString,\n items,\n}: SearchListOptions) => {\n if (customSortFunction) {\n return [...items].sort(customSortFunction);\n }\n\n const lowercaseSearchString = searchString.toLowerCase();\n\n return [...items].sort((a, b) => {\n const aStartsWithSearchString = a.text.toLowerCase().startsWith(lowercaseSearchString);\n const bStartsWithSearchString = b.text.toLowerCase().startsWith(lowercaseSearchString);\n\n if (aStartsWithSearchString && !bStartsWithSearchString) {\n return -1;\n }\n if (!aStartsWithSearchString && bStartsWithSearchString) {\n return 1;\n }\n return a.text.localeCompare(b.text);\n });\n};\n\nexport const searchList = ({ customSortFunction, searchString, items }: SearchListOptions) => {\n const matchingItems: ISearchBoxItem[] = [];\n\n const lowercaseSearchString = searchString.toLowerCase();\n\n items.forEach((item) => {\n const lowercaseText = item.text.toLowerCase();\n\n if (lowercaseText.includes(lowercaseSearchString)) {\n if (searchString === '') {\n matchingItems.push(item);\n } else {\n const startIndex = lowercaseText.indexOf(lowercaseSearchString);\n const highlightedText = surroundWithBTag(\n item.text,\n startIndex,\n searchString.length,\n );\n matchingItems.push({ ...item, text: highlightedText });\n }\n }\n });\n\n return sortSearchBoxItems({ customSortFunction, items: matchingItems, searchString });\n};\n"],"mappings":"AAEA,MAAMA,gBAAgB,GAAGA,CAACC,IAAY,EAAEC,UAAkB,EAAEC,MAAc,KAAK;EAC3E,MAAMC,MAAM,GAAGH,IAAI,CAACI,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/C,IAAIH,YAAY,KAAK,EAAE,EAAE;QACrBW,aAAa,CAACI,IAAI,CAACH,IAAI,CAAC;MAC5B,CAAC,MAAM;QACH,MAAM3C,UAAU,GAAG4C,aAAa,CAACG,OAAO,CAACb,qBAAqB,CAAC;QAC/D,MAAMc,eAAe,GAAGlD,gBAAgB,CACpC6C,IAAI,CAAC5C,IAAI,EACTC,UAAU,EACV+B,YAAY,CAAC9B,MACjB,CAAC;QACDyC,aAAa,CAACI,IAAI,CAAC;UAAE,GAAGH,IAAI;UAAE5C,IAAI,EAAEiD;QAAgB,CAAC,CAAC;MAC1D;IACJ;EACJ,CAAC,CAAC;EAEF,OAAOnB,kBAAkB,CAAC;IAAEC,kBAAkB;IAAEE,KAAK,EAAEU,aAAa;IAAEX;EAAa,CAAC,CAAC;AACzF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { searchList } from './searchBox';
|
|
3
|
+
const items = [{
|
|
4
|
+
id: '2',
|
|
5
|
+
text: 'Zweite'
|
|
6
|
+
}, {
|
|
7
|
+
id: '1',
|
|
8
|
+
text: 'Erste'
|
|
9
|
+
}];
|
|
10
|
+
describe('searchList', () => {
|
|
11
|
+
it('uses the custom sort function instead of the default sort', () => {
|
|
12
|
+
const result = searchList({
|
|
13
|
+
customSortFunction: (a, b) => b.id.localeCompare(a.id),
|
|
14
|
+
items,
|
|
15
|
+
searchString: ''
|
|
16
|
+
});
|
|
17
|
+
expect(result.map(({
|
|
18
|
+
id
|
|
19
|
+
}) => id)).toEqual(['2', '1']);
|
|
20
|
+
});
|
|
21
|
+
it('still filters before applying the custom sort function', () => {
|
|
22
|
+
const result = searchList({
|
|
23
|
+
customSortFunction: (a, b) => a.id.localeCompare(b.id),
|
|
24
|
+
items,
|
|
25
|
+
searchString: 'e'
|
|
26
|
+
});
|
|
27
|
+
expect(result.map(({
|
|
28
|
+
id
|
|
29
|
+
}) => id)).toEqual(['1', '2']);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=searchBox.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchBox.test.js","names":["describe","expect","it","searchList","items","id","text","result","customSortFunction","a","b","localeCompare","searchString","map","toEqual"],"sources":["../../../src/utils/searchBox.test.ts"],"sourcesContent":["import { describe, expect, it } from 'vitest';\nimport type { ISearchBoxItem } from '../types/searchBox';\nimport { searchList } from './searchBox';\n\nconst items: ISearchBoxItem[] = [\n { id: '2', text: 'Zweite' },\n { id: '1', text: 'Erste' },\n];\n\ndescribe('searchList', () => {\n it('uses the custom sort function instead of the default sort', () => {\n const result = searchList({\n customSortFunction: (a, b) => b.id.localeCompare(a.id),\n items,\n searchString: '',\n });\n\n expect(result.map(({ id }) => id)).toEqual(['2', '1']);\n });\n\n it('still filters before applying the custom sort function', () => {\n const result = searchList({\n customSortFunction: (a, b) => a.id.localeCompare(b.id),\n items,\n searchString: 'e',\n });\n\n expect(result.map(({ id }) => id)).toEqual(['1', '2']);\n });\n});\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAE7C,SAASC,UAAU,QAAQ,aAAa;AAExC,MAAMC,KAAuB,GAAG,CAC5B;EAAEC,EAAE,EAAE,GAAG;EAAEC,IAAI,EAAE;AAAS,CAAC,EAC3B;EAAED,EAAE,EAAE,GAAG;EAAEC,IAAI,EAAE;AAAQ,CAAC,CAC7B;AAEDN,QAAQ,CAAC,YAAY,EAAE,MAAM;EACzBE,EAAE,CAAC,2DAA2D,EAAE,MAAM;IAClE,MAAMK,MAAM,GAAGJ,UAAU,CAAC;MACtBK,kBAAkB,EAAEA,CAACC,CAAC,EAAEC,CAAC,KAAKA,CAAC,CAACL,EAAE,CAACM,aAAa,CAACF,CAAC,CAACJ,EAAE,CAAC;MACtDD,KAAK;MACLQ,YAAY,EAAE;IAClB,CAAC,CAAC;IAEFX,MAAM,CAACM,MAAM,CAACM,GAAG,CAAC,CAAC;MAAER;IAAG,CAAC,KAAKA,EAAE,CAAC,CAAC,CAACS,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;EAC1D,CAAC,CAAC;EAEFZ,EAAE,CAAC,wDAAwD,EAAE,MAAM;IAC/D,MAAMK,MAAM,GAAGJ,UAAU,CAAC;MACtBK,kBAAkB,EAAEA,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAACJ,EAAE,CAACM,aAAa,CAACD,CAAC,CAACL,EAAE,CAAC;MACtDD,KAAK;MACLQ,YAAY,EAAE;IAClB,CAAC,CAAC;IAEFX,MAAM,CAACM,MAAM,CAACM,GAAG,CAAC,CAAC;MAAER;IAAG,CAAC,KAAKA,EAAE,CAAC,CAAC,CAACS,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;EAC1D,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ChangeEventHandler, FC, FocusEventHandler, KeyboardEventHandler } from 'react';
|
|
2
2
|
import type { ISearchBoxItem, ISearchBoxItems } from '../../types/searchBox';
|
|
3
|
+
import { type SearchBoxSortFunction } from '../../utils/searchBox';
|
|
3
4
|
import { type InputProps } from '../input/Input';
|
|
4
5
|
import { TagInputProps } from '../tag-input/TagInput';
|
|
5
6
|
import type { DropdownDirection } from '../../types/dropdown';
|
|
@@ -22,6 +23,10 @@ export type SearchBoxProps = {
|
|
|
22
23
|
* An optional callback function to filter the elements to be displayed
|
|
23
24
|
*/
|
|
24
25
|
customFilter?: (item: ISearchBoxItem) => boolean;
|
|
26
|
+
/**
|
|
27
|
+
* An optional callback function to sort the filtered elements to be displayed
|
|
28
|
+
*/
|
|
29
|
+
customSortFunction?: SearchBoxSortFunction;
|
|
25
30
|
/**
|
|
26
31
|
* If true, the custom filter replaces the built-in text search instead of narrowing its results.
|
|
27
32
|
*/
|
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
readonly components: {
|
|
3
|
+
readonly copyableContent: {
|
|
4
|
+
readonly copy: {
|
|
5
|
+
readonly stringName: "txt_chayns_components_v5_core_components_copyableContent_copy";
|
|
6
|
+
readonly fallback: "Kopieren";
|
|
7
|
+
};
|
|
8
|
+
readonly copyFailed: {
|
|
9
|
+
readonly stringName: "txt_chayns_components_v5_core_components_copyableContent_copyFailed";
|
|
10
|
+
readonly fallback: "Kopieren fehlgeschlagen";
|
|
11
|
+
};
|
|
12
|
+
readonly share: {
|
|
13
|
+
readonly stringName: "txt_chayns_components_v5_core_components_copyableContent_share";
|
|
14
|
+
readonly fallback: "Teilen";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
readonly fileItem: {
|
|
18
|
+
readonly download: {
|
|
19
|
+
readonly stringName: "txt_chayns_components_v5_core_components_fileItem_download";
|
|
20
|
+
readonly fallback: "Download";
|
|
21
|
+
};
|
|
22
|
+
readonly remove: {
|
|
23
|
+
readonly stringName: "txt_chayns_components_v5_core_components_fileItem_remove";
|
|
24
|
+
readonly fallback: "Entfernen";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
3
27
|
readonly filter: {
|
|
4
28
|
readonly filterContent: {
|
|
5
29
|
readonly input: {
|
|
6
30
|
readonly placeholder: {
|
|
7
|
-
readonly stringName: "
|
|
31
|
+
readonly stringName: "txt_chayns_components_v5_core_components_filter_filterContent_input_placeholder";
|
|
8
32
|
readonly fallback: "Suche";
|
|
9
33
|
};
|
|
10
34
|
};
|
|
11
35
|
readonly sort: {
|
|
12
|
-
readonly stringName: "
|
|
36
|
+
readonly stringName: "txt_chayns_components_v5_core_components_filter_filterContent_sort";
|
|
13
37
|
readonly fallback: "Sortierung";
|
|
14
38
|
};
|
|
15
39
|
};
|
|
16
40
|
};
|
|
17
41
|
readonly filterButtons: {
|
|
18
42
|
readonly all: {
|
|
19
|
-
readonly stringName: "
|
|
43
|
+
readonly stringName: "txt_chayns_components_v5_core_components_filterButtons_all";
|
|
20
44
|
readonly fallback: "Alle";
|
|
21
45
|
};
|
|
22
46
|
};
|
|
23
47
|
readonly truncation: {
|
|
24
48
|
readonly less: {
|
|
25
|
-
readonly stringName: "
|
|
49
|
+
readonly stringName: "txt_chayns_components_v5_core_components_truncation_less";
|
|
26
50
|
readonly fallback: "Weniger";
|
|
27
51
|
};
|
|
28
52
|
readonly more: {
|
|
29
|
-
readonly stringName: "
|
|
53
|
+
readonly stringName: "txt_chayns_components_v5_core_components_truncation_more";
|
|
30
54
|
readonly fallback: "Mehr";
|
|
31
55
|
};
|
|
32
56
|
};
|
|
33
|
-
readonly fileItem: {
|
|
34
|
-
readonly download: {
|
|
35
|
-
readonly stringName: "txt_chayns_components_core_components_fileItem_download";
|
|
36
|
-
readonly fallback: "Download";
|
|
37
|
-
};
|
|
38
|
-
readonly remove: {
|
|
39
|
-
readonly stringName: "txt_chayns_components_core_components_fileItem_remove";
|
|
40
|
-
readonly fallback: "Entfernen";
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
readonly copyableContent: {
|
|
44
|
-
readonly copy: {
|
|
45
|
-
readonly stringName: "txt_chayns_components_core_components_copyableContent_copy";
|
|
46
|
-
readonly fallback: "Kopieren";
|
|
47
|
-
};
|
|
48
|
-
readonly share: {
|
|
49
|
-
readonly stringName: "txt_chayns_components_core_components_copyableContent_share";
|
|
50
|
-
readonly fallback: "Teilen";
|
|
51
|
-
};
|
|
52
|
-
readonly copyFailed: {
|
|
53
|
-
readonly stringName: "txt_chayns_components_core_components_copyableContent_copyFailed";
|
|
54
|
-
readonly fallback: "Kopieren fehlgeschlagen";
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
export default _default;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -88,6 +88,7 @@ export type { IListItemRightElements } from './types/list';
|
|
|
88
88
|
export type { PopupRef } from './types/popup';
|
|
89
89
|
export type { RadioButtonItem } from './types/radioButton';
|
|
90
90
|
export type { ISearchBoxItem as SearchBoxItem, ISearchBoxItems as SearchBoxItems, } from './types/searchBox';
|
|
91
|
+
export type { SearchBoxSortFunction } from './utils/searchBox';
|
|
91
92
|
export type { SelectButtonItem } from './types/selectButton';
|
|
92
93
|
export type { SliderButtonItem } from './types/slider-button';
|
|
93
94
|
export { type MultiActionButtonAction, type MultiActionButtonActionEvent, type MultiActionButtonActionStatus, MultiActionButtonHeight, type MultiActionButtonProps, type MultiActionButtonSecondaryContextMenu, MultiActionButtonStatusType, } from './components/multi-action-button/MultiActionButton.types';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ISearchBoxItem } from '../types/searchBox';
|
|
2
2
|
export declare const getCurrentGroupName: (element: HTMLElement) => string;
|
|
3
|
+
export type SearchBoxSortFunction = (a: ISearchBoxItem, b: ISearchBoxItem) => number;
|
|
3
4
|
interface SearchListOptions {
|
|
5
|
+
customSortFunction?: SearchBoxSortFunction;
|
|
4
6
|
items: ISearchBoxItem[];
|
|
5
7
|
searchString: string;
|
|
6
8
|
}
|
|
7
|
-
export declare const sortSearchBoxItems: ({ searchString, items }: SearchListOptions) => ISearchBoxItem[];
|
|
8
|
-
export declare const searchList: ({ searchString, items }: SearchListOptions) => ISearchBoxItem[];
|
|
9
|
+
export declare const sortSearchBoxItems: ({ customSortFunction, searchString, items, }: SearchListOptions) => ISearchBoxItem[];
|
|
10
|
+
export declare const searchList: ({ customSortFunction, searchString, items }: SearchListOptions) => ISearchBoxItem[];
|
|
9
11
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.40",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@chayns-components/format": "^5.5.34",
|
|
79
|
-
"@chayns-components/textstring": "^5.5.34",
|
|
80
79
|
"@chayns/colors": "^2.0.2",
|
|
80
|
+
"@chayns/textstrings": "^1.0.1",
|
|
81
81
|
"@chayns/uac-service": "~0.0.62",
|
|
82
82
|
"clsx": "^2.1.1",
|
|
83
83
|
"react-compiler-runtime": "^1.0.0",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"access": "public"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "6dbae57c63a1acb4aad518450bc6bc3d911a1d3e"
|
|
97
97
|
}
|