@shlinkio/shlink-frontend-kit 1.2.1 → 1.3.1
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/dist/index.d.ts +42 -0
- package/dist/index.js +509 -508
- package/package.json +17 -16
package/dist/index.d.ts
CHANGED
|
@@ -424,6 +424,11 @@ export declare type NavPillsProps = PropsWithChildren<{
|
|
|
424
424
|
className?: string;
|
|
425
425
|
}>;
|
|
426
426
|
|
|
427
|
+
/**
|
|
428
|
+
* Normalizes a tag, making it lowercase, trimmed and replacing space characters with dashes
|
|
429
|
+
*/
|
|
430
|
+
export declare const normalizeTag: (tag: string) => string;
|
|
431
|
+
|
|
427
432
|
declare type NoTitleProps = {
|
|
428
433
|
title?: never;
|
|
429
434
|
titleSize?: never;
|
|
@@ -689,6 +694,37 @@ export declare type TagsAutocompleteProps = {
|
|
|
689
694
|
searchMode?: 'startsWith' | 'includes';
|
|
690
695
|
} & Pick<SearchComboboxProps<string>, 'placeholder' | 'size' | 'disabled' | 'aria-label'>;
|
|
691
696
|
|
|
697
|
+
export declare type TagsSearchOptions = {
|
|
698
|
+
/** Full list of tags to search on */
|
|
699
|
+
tags: string[];
|
|
700
|
+
/** Tags that are already selected, to ignore them while searching */
|
|
701
|
+
selectedTags: string[];
|
|
702
|
+
/** How to do the search term matching on tags, via `startsWith` or `includes` */
|
|
703
|
+
searchMode: 'startsWith' | 'includes';
|
|
704
|
+
/** Max amount of matching tags to return. Defaults to 5 */
|
|
705
|
+
searchLimit?: number;
|
|
706
|
+
/**
|
|
707
|
+
* Whether new entries are allowed or not.
|
|
708
|
+
* When this is true, it will be allowed to add the search term verbatim in the search result.
|
|
709
|
+
*/
|
|
710
|
+
allowAdding?: boolean;
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
export declare type TagsSearchResult = {
|
|
714
|
+
/**
|
|
715
|
+
* A Map with the list of tags that match the search result, with the tag used both as key and value.
|
|
716
|
+
* Returned as a Map for convenience to use with SearchCombobox.
|
|
717
|
+
*
|
|
718
|
+
* When the search term is empty, `undefined` is returned, so that it is possible to differentiate a search producing
|
|
719
|
+
* no results from not currently performing a search at all.
|
|
720
|
+
*
|
|
721
|
+
* @see {SearchCombobox}
|
|
722
|
+
*/
|
|
723
|
+
searchResults: Map<string, string> | undefined;
|
|
724
|
+
/** A callback used to perform a search in the list of tags */
|
|
725
|
+
onSearch: (searchTerm: string) => void;
|
|
726
|
+
};
|
|
727
|
+
|
|
692
728
|
export declare type Theme = 'dark' | 'light';
|
|
693
729
|
|
|
694
730
|
export declare type TimeoutToggle = typeof useTimeoutToggle;
|
|
@@ -751,6 +787,12 @@ export declare const useGoBack: () => () => void | Promise<void>;
|
|
|
751
787
|
|
|
752
788
|
export declare const useParsedQuery: <T>() => T;
|
|
753
789
|
|
|
790
|
+
/**
|
|
791
|
+
* Allows to search on a list of tags and only return the ones that match.
|
|
792
|
+
* Search can be done by `startsWith` or `includes`.
|
|
793
|
+
*/
|
|
794
|
+
export declare function useTagsSearch({ tags, selectedTags, searchMode, searchLimit, allowAdding }: TagsSearchOptions): TagsSearchResult;
|
|
795
|
+
|
|
754
796
|
export declare const useTheme: (initialTheme?: Theme) => readonly [Theme, Dispatch<SetStateAction<Theme>>];
|
|
755
797
|
|
|
756
798
|
export declare function useTimeout(defaultDelay: number,
|