@leanix/components 0.2.237 → 0.2.240

Sign up to get free protection for your applications and to get access to all the features.
package/index.d.ts CHANGED
@@ -3,6 +3,8 @@ export * from './lib/core-ui/core-ui.constants';
3
3
  export * from './lib/core-ui/annotations/required';
4
4
  export * from './lib/core-ui/pipes/br.pipe';
5
5
  export * from './lib/core-ui/pipes/custom-date.pipe';
6
+ export * from './lib/core-ui/pipes/linkify/linkify.pipe';
7
+ export * from './lib/core-ui/pipes/linkify/unlinkify.pipe';
6
8
  export * from './lib/core-ui/pipes/lx-is-uuid.pipe';
7
9
  export * from './lib/core-ui/pipes/lx-time-ago.pipe';
8
10
  export * from './lib/core-ui/pipes/lx-translate.pipe';
@@ -37,6 +39,7 @@ export * from './lib/core-ui/tooltip/tooltip.component';
37
39
  export * from './lib/core-ui/tooltip/tooltip.directive';
38
40
  export * from './lib/core-ui/tooltip/tooltip.module';
39
41
  export * from './lib/core-ui/functions/core-css.helpers';
42
+ export * from './lib/core-ui/services/resize-observer.service';
40
43
  export * from './lib/forms-ui/forms-ui.module';
41
44
  export * from './lib/forms-ui/components/basic-dropdown/basic-dropdown.component';
42
45
  export * from './lib/forms-ui/components/basic-dropdown-item/basic-dropdown-item.component';
@@ -1,27 +1,37 @@
1
- import { OnChanges, OnDestroy } from '@angular/core';
2
- import { DomSanitizer } from '@angular/platform-browser';
1
+ import { ChangeDetectorRef, ElementRef, InjectionToken, OnDestroy, OnInit } from '@angular/core';
3
2
  import { TranslateService } from '@ngx-translate/core';
3
+ import { BehaviorSubject, Observable } from 'rxjs';
4
+ import { ResizeObserverService } from '../../services/resize-observer.service';
4
5
  import * as i0 from "@angular/core";
5
- export declare class EllipsisComponent implements OnChanges, OnDestroy {
6
+ export declare const LX_ELLIPSIS_DEBOUNCE_ON_RESIZE: InjectionToken<number>;
7
+ /**
8
+ * You can set a custom max-width CSS property on your lx-ellipsis host element
9
+ * if you want its content to never exceed a specific width,
10
+ * e.g. <lx-ellipsis style="max-width: 300px" content="Hello World[..]"></lx-ellipsis>.
11
+ */
12
+ export declare class EllipsisComponent implements OnInit, OnDestroy {
13
+ private debounceMsAfterResize;
14
+ private cdRef;
15
+ private hostEl;
16
+ private resizeObserverService;
6
17
  private translateService;
7
- private sanitizer;
8
- ellipsisBreakpoint: number;
9
- content?: string;
10
- isDisplayHTML: boolean;
11
- showFullText: boolean;
12
- private readonly showMoreLabel;
13
- private readonly showLessLabel;
14
- displayedText: string | null;
15
- get buttonLabel(): any;
16
- get showToggleButton(): boolean;
17
- constructor(translateService: TranslateService, sanitizer: DomSanitizer);
18
- ngOnChanges(): void;
18
+ static DEFAULT_RESIZE_DEBOUNCE_MS: number;
19
+ content: string;
20
+ private contentSpanEl$;
21
+ contentSpanEl: ElementRef<HTMLSpanElement>;
22
+ private showMoreButtonEl$;
23
+ showMoreButtonEl: ElementRef<HTMLButtonElement>;
24
+ isShowingMore$: BehaviorSubject<boolean>;
25
+ showButton$: Observable<boolean>;
26
+ showMoreButtonLabel$: Observable<string>;
27
+ private content$;
28
+ private destroyed$;
29
+ constructor(debounceMsAfterResize: number, cdRef: ChangeDetectorRef, hostEl: ElementRef, resizeObserverService: ResizeObserverService, translateService: TranslateService);
30
+ ngOnInit(): void;
31
+ onShowMoreToggle(): void;
19
32
  ngOnDestroy(): void;
20
- buttonClicked(): void;
21
- private getDisplayedContent;
22
- private getShortenedText;
23
- private applyEllipsis;
24
- private getContent;
33
+ private detectChangesWhenObservableEmits;
34
+ private isContentOverflowing;
25
35
  static ɵfac: i0.ɵɵFactoryDeclaration<EllipsisComponent, never>;
26
- static ɵcmp: i0.ɵɵComponentDeclaration<EllipsisComponent, "lx-ellipsis", never, { "ellipsisBreakpoint": "ellipsisBreakpoint"; "content": "content"; "isDisplayHTML": "isDisplayHTML"; }, {}, never, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<EllipsisComponent, "lx-ellipsis", never, { "content": "content"; }, {}, never, never>;
27
37
  }
@@ -15,25 +15,27 @@ import * as i13 from "./pipes/highlight-range.pipe";
15
15
  import * as i14 from "./pipes/highlight-term.pipe";
16
16
  import * as i15 from "./directives/html.directive";
17
17
  import * as i16 from "./components/icon-scale/icon-scale.component";
18
- import * as i17 from "./pipes/lx-time-ago.pipe";
19
- import * as i18 from "./pipes/lx-translate.pipe";
20
- import * as i19 from "./pipes/markdown.pipe";
21
- import * as i20 from "./pipes/nbsp.pipe";
22
- import * as i21 from "./pipes/lx-is-uuid.pipe";
23
- import * as i22 from "./components/spinner/spinner.component";
24
- import * as i23 from "./components/table/table.component";
25
- import * as i24 from "./components/table/table-header/table-header.component";
26
- import * as i25 from "./components/tiny-spinner/tiny-spinner.component";
27
- import * as i26 from "./pipes/translation-after.pipe";
28
- import * as i27 from "./pipes/translation-before.pipe";
29
- import * as i28 from "./pipes/translation-between.pipe";
30
- import * as i29 from "./pipes/sort.pipe";
31
- import * as i30 from "./pipes/contrast-color.pipe";
32
- import * as i31 from "./pipes/unescape-curly-braces.pipe";
33
- import * as i32 from "@angular/common";
34
- import * as i33 from "./tooltip/tooltip.module";
18
+ import * as i17 from "./pipes/linkify/linkify.pipe";
19
+ import * as i18 from "./pipes/linkify/unlinkify.pipe";
20
+ import * as i19 from "./pipes/lx-time-ago.pipe";
21
+ import * as i20 from "./pipes/lx-translate.pipe";
22
+ import * as i21 from "./pipes/markdown.pipe";
23
+ import * as i22 from "./pipes/nbsp.pipe";
24
+ import * as i23 from "./pipes/lx-is-uuid.pipe";
25
+ import * as i24 from "./components/spinner/spinner.component";
26
+ import * as i25 from "./components/table/table.component";
27
+ import * as i26 from "./components/table/table-header/table-header.component";
28
+ import * as i27 from "./components/tiny-spinner/tiny-spinner.component";
29
+ import * as i28 from "./pipes/translation-after.pipe";
30
+ import * as i29 from "./pipes/translation-before.pipe";
31
+ import * as i30 from "./pipes/translation-between.pipe";
32
+ import * as i31 from "./pipes/sort.pipe";
33
+ import * as i32 from "./pipes/contrast-color.pipe";
34
+ import * as i33 from "./pipes/unescape-curly-braces.pipe";
35
+ import * as i34 from "@angular/common";
36
+ import * as i35 from "./tooltip/tooltip.module";
35
37
  export declare class LxCoreUiModule {
36
38
  static ɵfac: i0.ɵɵFactoryDeclaration<LxCoreUiModule, never>;
37
- static ɵmod: i0.ɵɵNgModuleDeclaration<LxCoreUiModule, [typeof i1.AfterViewInitDirective, typeof i2.AutocloseDirective, typeof i3.AutofocusDirective, typeof i4.BadgeComponent, typeof i5.ButtonComponent, typeof i6.ButtonGroupComponent, typeof i7.BrPipe, typeof i8.CardComponent, typeof i9.CollapsibleComponent, typeof i10.ColoredLabelComponent, typeof i11.CustomDatePipe, typeof i12.EllipsisComponent, typeof i13.HighlightRangePipe, typeof i14.HighlightTermPipe, typeof i15.HtmlDirective, typeof i16.IconScaleComponent, typeof i17.LxTimeAgo, typeof i18.LxTranslatePipe, typeof i19.MarkdownPipe, typeof i20.NbspPipe, typeof i21.LxIsUuidPipe, typeof i22.SpinnerComponent, typeof i23.TableComponent, typeof i24.TableHeaderComponent, typeof i25.TinySpinnerComponent, typeof i26.TranslationAfterPipe, typeof i27.TranslationBeforePipe, typeof i28.TranslationBetweenPipe, typeof i29.SortPipe, typeof i30.ContrastColorPipe, typeof i31.UnescapeCurlyBracesPipe], [typeof i32.CommonModule, typeof i33.LxTooltipModule], [typeof i33.LxTooltipModule, typeof i1.AfterViewInitDirective, typeof i2.AutocloseDirective, typeof i3.AutofocusDirective, typeof i4.BadgeComponent, typeof i5.ButtonComponent, typeof i7.BrPipe, typeof i6.ButtonGroupComponent, typeof i8.CardComponent, typeof i10.ColoredLabelComponent, typeof i11.CustomDatePipe, typeof i12.EllipsisComponent, typeof i13.HighlightRangePipe, typeof i14.HighlightTermPipe, typeof i15.HtmlDirective, typeof i16.IconScaleComponent, typeof i17.LxTimeAgo, typeof i18.LxTranslatePipe, typeof i19.MarkdownPipe, typeof i20.NbspPipe, typeof i21.LxIsUuidPipe, typeof i22.SpinnerComponent, typeof i23.TableComponent, typeof i24.TableHeaderComponent, typeof i25.TinySpinnerComponent, typeof i26.TranslationAfterPipe, typeof i27.TranslationBeforePipe, typeof i28.TranslationBetweenPipe, typeof i9.CollapsibleComponent, typeof i29.SortPipe, typeof i30.ContrastColorPipe, typeof i31.UnescapeCurlyBracesPipe]>;
39
+ static ɵmod: i0.ɵɵNgModuleDeclaration<LxCoreUiModule, [typeof i1.AfterViewInitDirective, typeof i2.AutocloseDirective, typeof i3.AutofocusDirective, typeof i4.BadgeComponent, typeof i5.ButtonComponent, typeof i6.ButtonGroupComponent, typeof i7.BrPipe, typeof i8.CardComponent, typeof i9.CollapsibleComponent, typeof i10.ColoredLabelComponent, typeof i11.CustomDatePipe, typeof i12.EllipsisComponent, typeof i13.HighlightRangePipe, typeof i14.HighlightTermPipe, typeof i15.HtmlDirective, typeof i16.IconScaleComponent, typeof i17.LxLinkifyPipe, typeof i18.LxUnlinkifyPipe, typeof i19.LxTimeAgo, typeof i20.LxTranslatePipe, typeof i21.MarkdownPipe, typeof i22.NbspPipe, typeof i23.LxIsUuidPipe, typeof i24.SpinnerComponent, typeof i25.TableComponent, typeof i26.TableHeaderComponent, typeof i27.TinySpinnerComponent, typeof i28.TranslationAfterPipe, typeof i29.TranslationBeforePipe, typeof i30.TranslationBetweenPipe, typeof i31.SortPipe, typeof i32.ContrastColorPipe, typeof i33.UnescapeCurlyBracesPipe], [typeof i34.CommonModule, typeof i35.LxTooltipModule], [typeof i35.LxTooltipModule, typeof i1.AfterViewInitDirective, typeof i2.AutocloseDirective, typeof i3.AutofocusDirective, typeof i4.BadgeComponent, typeof i5.ButtonComponent, typeof i7.BrPipe, typeof i6.ButtonGroupComponent, typeof i8.CardComponent, typeof i10.ColoredLabelComponent, typeof i11.CustomDatePipe, typeof i12.EllipsisComponent, typeof i13.HighlightRangePipe, typeof i14.HighlightTermPipe, typeof i15.HtmlDirective, typeof i16.IconScaleComponent, typeof i17.LxLinkifyPipe, typeof i18.LxUnlinkifyPipe, typeof i19.LxTimeAgo, typeof i20.LxTranslatePipe, typeof i21.MarkdownPipe, typeof i22.NbspPipe, typeof i23.LxIsUuidPipe, typeof i24.SpinnerComponent, typeof i25.TableComponent, typeof i26.TableHeaderComponent, typeof i27.TinySpinnerComponent, typeof i28.TranslationAfterPipe, typeof i29.TranslationBeforePipe, typeof i30.TranslationBetweenPipe, typeof i9.CollapsibleComponent, typeof i31.SortPipe, typeof i32.ContrastColorPipe, typeof i33.UnescapeCurlyBracesPipe]>;
38
40
  static ɵinj: i0.ɵɵInjectorDeclaration<LxCoreUiModule>;
39
41
  }
@@ -0,0 +1,46 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * This pipe transforms...
5
+ * - "raw" http(s) links
6
+ * - markdown link syntax
7
+ * ... into clickable anchor elements.
8
+ *
9
+ * You have an user interface where you don't want clickable links but also
10
+ * don't want users to see the "ugly" markdown link syntax?
11
+ * -> Use the 'lxUnlikify' pipe to replace markdown link syntax with just the link name
12
+ */
13
+ export declare class LxLinkifyPipe implements PipeTransform {
14
+ /**
15
+ * This is not the "one URL regex to rule them all", but a more realistic one which should work
16
+ * for any URLs that our customers include in text fields on a Fact Sheet.
17
+ *
18
+ * Regex rules explained in plain text:
19
+ *
20
+ * (?:(?:https?):\/\/) -> Links must start with "https://" or "http://"
21
+ *
22
+ * (?:[^\s/$.?#][^\s]*(?<![\.)])) LET'S SPLIT THIS ONE UP
23
+ *
24
+ * [^\s/$.?#][^\s]* -> Match any legal URL character until the next whitespace
25
+ * (?<![\.)] -> A negative lookahead to prevent matching a dot or parenthesis following a URL
26
+ *
27
+ * Link to regex101: https://regex101.com/r/d3KtfH/1 (NOTE: please update this link when changing the regex)
28
+ */
29
+ static readonly HTTP_LINK_REGEX: RegExp;
30
+ /**
31
+ * This will match the markdown link syntax: [link name](url)
32
+ * Regex rules explained in plain text:
33
+ *
34
+ * (?:\[([^\]]*)\]) -> Match any characters inside square brackets
35
+ * \(([^\s\/$.?#][^\s]*)\) -> Notice that this is the same regex as the HTTP_LINK_REGEX above,
36
+ * but without the requirement for the http protocol.
37
+ * This allows for links without including the protocol or also "mailto:hello@world.de" links
38
+ *
39
+ * Link to regex101: https://regex101.com/r/5UMUH8/1
40
+ */
41
+ static readonly NAMED_LINK_REGEX: RegExp;
42
+ transform(text?: string | null): string | undefined | null;
43
+ private getAllRegexMatches;
44
+ static ɵfac: i0.ɵɵFactoryDeclaration<LxLinkifyPipe, never>;
45
+ static ɵpipe: i0.ɵɵPipeDeclaration<LxLinkifyPipe, "lxLinkify">;
46
+ }
@@ -0,0 +1,20 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * This pipe replaces markdown link syntax with just the link name (omits the link altogether).
5
+ * Example: [Angular documentation](http://angular.io/docs) -> Angular documentation
6
+ *
7
+ * It can also be used for "bridging the gap" until your view is ready to use "lxLinkify"
8
+ * and you just want to get rid of the "useless" markdown syntax fast.
9
+ *
10
+ * While there are views where we want markdown style links to be clickable anchor tags,
11
+ * there are other views where this can degrade the UX.
12
+ * Example: in the Fact Sheet list on the inventory list view, having an arbitrary number
13
+ * of links on the page can slow down the keyboard navigation while navigating through the list.
14
+ */
15
+ export declare class LxUnlinkifyPipe implements PipeTransform {
16
+ transform(text?: string | null): string | undefined | null;
17
+ private getAllRegexMatches;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<LxUnlinkifyPipe, never>;
19
+ static ɵpipe: i0.ɵɵPipeDeclaration<LxUnlinkifyPipe, "lxUnlinkify">;
20
+ }
@@ -0,0 +1,27 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare type LxResizeObserverCallback = (resizedElement: ResizeObserverEntry) => void;
3
+ interface ResizeableElement extends Element {
4
+ handleResize: LxResizeObserverCallback;
5
+ }
6
+ /**
7
+ * Sharing one ResizeObserver object results in much better performance
8
+ * over individual components creating their own ResizeObserver.
9
+ * This is why this service exists.
10
+ * Source:
11
+ * - https://github.com/WICG/resize-observer/issues/59#issuecomment-408098151
12
+ * - https://groups.google.com/a/chromium.org/g/blink-dev/c/z6ienONUb5A/m/F5-VcUZtBAAJ
13
+ *
14
+ * Learn more about the ResizeObserver API:
15
+ * - https://www.w3.org/TR/resize-observer/
16
+ * - https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver
17
+ * - https://www.digitalocean.com/community/tutorials/js-resize-observer
18
+ */
19
+ export declare class ResizeObserverService {
20
+ private resizeObserver?;
21
+ observe(element: ResizeableElement, callback: LxResizeObserverCallback, options?: ResizeObserverOptions): void;
22
+ unobserve(element: HTMLElement): void;
23
+ private resizeObserverCallback;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<ResizeObserverService, never>;
25
+ static ɵprov: i0.ɵɵInjectableDeclaration<ResizeObserverService>;
26
+ }
27
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leanix/components",
3
- "version": "0.2.237",
3
+ "version": "0.2.240",
4
4
  "license": "Apache-2.0",
5
5
  "author": "LeanIX GmbH",
6
6
  "repository": {