@leanix/components 0.4.76 → 0.4.78

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/index.d.ts CHANGED
@@ -39,6 +39,7 @@ export * from './lib/core-ui/tooltip/tooltip.directive';
39
39
  export * from './lib/core-ui/linkify/linkify.pipe';
40
40
  export * from './lib/core-ui/linkify/unlinkify.pipe';
41
41
  export * from './lib/core-ui/functions/core-css.helpers';
42
+ export * from './lib/core-ui/functions/highlight-text.function';
42
43
  export * from './lib/core-ui/services/resize-observer.service';
43
44
  export * from './lib/forms-ui/forms-ui.module';
44
45
  export * from './lib/forms-ui/components/basic-dropdown-item/basic-dropdown-item.component';
@@ -0,0 +1,29 @@
1
+ export interface HighlightTextSettings {
2
+ /**
3
+ * Whether to match case sensitively
4
+ */
5
+ caseSensitive?: boolean;
6
+ /**
7
+ * Whether to match whole words only
8
+ */
9
+ wordsOnly?: boolean;
10
+ /**
11
+ * The element to wrap highlighted terms in
12
+ */
13
+ element?: string;
14
+ /**
15
+ * The class name to apply to highlighted terms
16
+ */
17
+ className?: string;
18
+ }
19
+ /**
20
+ * Highlights all occurrences of search terms in a given element.
21
+ * This function will recursively traverse all child nodes of the given element,
22
+ * and apply the highlight to text nodes only.
23
+ *
24
+ * Replaces the 'jquery-highlight' plugin: https://github.com/knownasilya/jquery-highlight/blob/master/jquery.highlight.js
25
+ * @param elem The element to highlight
26
+ * @param terms The search terms to highlight - string or array of strings
27
+ * @param settings Optional settings, @see HighlightTextSettings
28
+ */
29
+ export declare function highlightText(elem: HTMLElement, terms: string | string[], settings?: HighlightTextSettings): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leanix/components",
3
- "version": "0.4.76",
3
+ "version": "0.4.78",
4
4
  "license": "Apache-2.0",
5
5
  "author": "LeanIX GmbH",
6
6
  "repository": {