@leanix/components 0.3.134 → 0.3.136
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/esm2020/index.mjs +2 -1
- package/esm2020/lib/core-ui/components/file-download-button/file-download-button.component.mjs +56 -0
- package/esm2020/lib/core-ui/core-ui.module.mjs +12 -5
- package/fesm2015/leanix-components.mjs +62 -7
- package/fesm2015/leanix-components.mjs.map +1 -1
- package/fesm2020/leanix-components.mjs +62 -7
- package/fesm2020/leanix-components.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/core-ui/components/file-download-button/file-download-button.component.d.ts +20 -0
- package/lib/core-ui/core-ui.module.d.ts +5 -3
- package/package.json +1 -1
|
@@ -2,6 +2,8 @@ import * as i1 from '@angular/common';
|
|
|
2
2
|
import { CommonModule, formatDate } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { Component, Input, HostBinding, ChangeDetectionStrategy, EventEmitter, Output, HostListener, Directive, Injectable, InjectionToken, ElementRef, Inject, ViewChild, ContentChildren, SecurityContext, Pipe, Optional, NgModule, ViewChildren, ContentChild, forwardRef, TemplateRef, Self, Host } from '@angular/core';
|
|
5
|
+
import * as i1$2 from '@ngx-translate/core';
|
|
6
|
+
import { TranslatePipe, TranslateModule } from '@ngx-translate/core';
|
|
5
7
|
import * as i1$7 from '@angular/cdk/portal';
|
|
6
8
|
import { ComponentPortal, CdkPortal, PortalModule } from '@angular/cdk/portal';
|
|
7
9
|
import * as i1$1 from '@angular/cdk/overlay';
|
|
@@ -11,8 +13,6 @@ import { escape, trimEnd, sortBy, get, isEqual, toLower, some, padCharsStart, to
|
|
|
11
13
|
import * as i6 from 'rxjs';
|
|
12
14
|
import { BehaviorSubject, timer, Subject, combineLatest, merge, concat, fromEvent, Observable, ReplaySubject, startWith as startWith$1, delay as delay$1, distinctUntilChanged as distinctUntilChanged$1, of, map as map$1 } from 'rxjs';
|
|
13
15
|
import { skipWhile, map, switchMap, startWith, pairwise, filter, take, debounceTime, skip, withLatestFrom, distinctUntilChanged, takeUntil, delay, tap } from 'rxjs/operators';
|
|
14
|
-
import * as i1$2 from '@ngx-translate/core';
|
|
15
|
-
import { TranslatePipe, TranslateModule } from '@ngx-translate/core';
|
|
16
16
|
import * as i1$3 from '@angular/platform-browser';
|
|
17
17
|
import Color from 'color';
|
|
18
18
|
import { format, distanceInWords, startOfDay } from 'date-fns';
|
|
@@ -721,6 +721,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImpor
|
|
|
721
721
|
args: ['showMoreButton', { read: ElementRef }]
|
|
722
722
|
}], content$: [] } });
|
|
723
723
|
|
|
724
|
+
class FileDownloadButtonComponent {
|
|
725
|
+
constructor() {
|
|
726
|
+
this.downloadFinish = new EventEmitter();
|
|
727
|
+
this.downloadStarted = new EventEmitter();
|
|
728
|
+
this.NAME = 'FileDownloadButtonComponent';
|
|
729
|
+
}
|
|
730
|
+
ngOnInit() {
|
|
731
|
+
this.downloadLink = this.initialDownloadLink;
|
|
732
|
+
}
|
|
733
|
+
download(event) {
|
|
734
|
+
this.downloadStarted.emit();
|
|
735
|
+
this.openUrlInNewWindow(this.downloadLink);
|
|
736
|
+
this.downloaded = true;
|
|
737
|
+
event.preventDefault();
|
|
738
|
+
this.downloadFinish.emit(this.downloadLink);
|
|
739
|
+
}
|
|
740
|
+
requestDownload() {
|
|
741
|
+
if (this.downloadRequest) {
|
|
742
|
+
this.downloadRequest(this.refreshKeyUrl).subscribe((downloadUrl) => {
|
|
743
|
+
this.downloadLink = downloadUrl;
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
openUrlInNewWindow(url, target = '_blank', features) {
|
|
748
|
+
const newTab = window.open(url, target, features);
|
|
749
|
+
// In case a popup blocker has blocked the newly opened tab/window, "newTab" will be null
|
|
750
|
+
if (newTab) {
|
|
751
|
+
newTab.opener = null;
|
|
752
|
+
}
|
|
753
|
+
return newTab;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
FileDownloadButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.1", ngImport: i0, type: FileDownloadButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
757
|
+
FileDownloadButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.1", type: FileDownloadButtonComponent, selector: "lx-file-download-button", inputs: { downloadRequest: "downloadRequest", initialDownloadLink: "initialDownloadLink", refreshKeyUrl: "refreshKeyUrl", downloadLabel: "downloadLabel" }, outputs: { downloadFinish: "downloadFinish", downloadStarted: "downloadStarted" }, ngImport: i0, template: "<a class=\"btn btn-primary\" *ngIf=\"!downloaded && !!downloadLink\" [href]=\"downloadLink\" (click)=\"download($event)\">{{\n downloadLabel ? downloadLabel : ('buttons.download' | translate)\n}}</a>\n<button lx-button color=\"light\" size=\"large\" *ngIf=\"(downloaded && refreshKeyUrl) || !downloadLink\" (click)=\"requestDownload()\">\n {{ NAME + '.newDownload' | translate }}\n</button>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonComponent, selector: "button[lx-button]", inputs: ["size", "color", "mode", "pressed", "selected", "square", "circle", "disabled", "showSpinner"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] });
|
|
758
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImport: i0, type: FileDownloadButtonComponent, decorators: [{
|
|
759
|
+
type: Component,
|
|
760
|
+
args: [{ selector: 'lx-file-download-button', template: "<a class=\"btn btn-primary\" *ngIf=\"!downloaded && !!downloadLink\" [href]=\"downloadLink\" (click)=\"download($event)\">{{\n downloadLabel ? downloadLabel : ('buttons.download' | translate)\n}}</a>\n<button lx-button color=\"light\" size=\"large\" *ngIf=\"(downloaded && refreshKeyUrl) || !downloadLink\" (click)=\"requestDownload()\">\n {{ NAME + '.newDownload' | translate }}\n</button>\n" }]
|
|
761
|
+
}], propDecorators: { downloadRequest: [{
|
|
762
|
+
type: Input
|
|
763
|
+
}], initialDownloadLink: [{
|
|
764
|
+
type: Input
|
|
765
|
+
}], refreshKeyUrl: [{
|
|
766
|
+
type: Input
|
|
767
|
+
}], downloadLabel: [{
|
|
768
|
+
type: Input
|
|
769
|
+
}], downloadFinish: [{
|
|
770
|
+
type: Output
|
|
771
|
+
}], downloadStarted: [{
|
|
772
|
+
type: Output
|
|
773
|
+
}] } });
|
|
774
|
+
|
|
724
775
|
class IconScaleComponent {
|
|
725
776
|
constructor() {
|
|
726
777
|
this.icon = {
|
|
@@ -1786,7 +1837,8 @@ LxCoreUiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
1786
1837
|
TranslationBetweenPipe,
|
|
1787
1838
|
SortPipe,
|
|
1788
1839
|
ContrastColorPipe,
|
|
1789
|
-
UnescapeCurlyBracesPipe
|
|
1840
|
+
UnescapeCurlyBracesPipe,
|
|
1841
|
+
FileDownloadButtonComponent], imports: [CommonModule, LxTooltipModule, i1$2.TranslateModule], exports: [LxTooltipModule,
|
|
1790
1842
|
AfterViewInitDirective,
|
|
1791
1843
|
AutocloseDirective,
|
|
1792
1844
|
AutofocusDirective,
|
|
@@ -1806,6 +1858,7 @@ LxCoreUiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
1806
1858
|
LxUnlinkifyPipe,
|
|
1807
1859
|
LxTimeAgo,
|
|
1808
1860
|
LxTranslatePipe,
|
|
1861
|
+
FileDownloadButtonComponent,
|
|
1809
1862
|
MarkdownPipe,
|
|
1810
1863
|
NbspPipe,
|
|
1811
1864
|
LxIsUuidPipe,
|
|
@@ -1820,7 +1873,7 @@ LxCoreUiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
1820
1873
|
SortPipe,
|
|
1821
1874
|
ContrastColorPipe,
|
|
1822
1875
|
UnescapeCurlyBracesPipe] });
|
|
1823
|
-
LxCoreUiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.1", ngImport: i0, type: LxCoreUiModule, providers: [LxTimeAgo, AutocloseGroupService], imports: [CommonModule, LxTooltipModule, LxTooltipModule] });
|
|
1876
|
+
LxCoreUiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.1", ngImport: i0, type: LxCoreUiModule, providers: [LxTimeAgo, AutocloseGroupService], imports: [CommonModule, LxTooltipModule, TranslateModule.forChild(), LxTooltipModule] });
|
|
1824
1877
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImport: i0, type: LxCoreUiModule, decorators: [{
|
|
1825
1878
|
type: NgModule,
|
|
1826
1879
|
args: [{
|
|
@@ -1857,9 +1910,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImpor
|
|
|
1857
1910
|
TranslationBetweenPipe,
|
|
1858
1911
|
SortPipe,
|
|
1859
1912
|
ContrastColorPipe,
|
|
1860
|
-
UnescapeCurlyBracesPipe
|
|
1913
|
+
UnescapeCurlyBracesPipe,
|
|
1914
|
+
FileDownloadButtonComponent
|
|
1861
1915
|
],
|
|
1862
|
-
imports: [CommonModule, LxTooltipModule],
|
|
1916
|
+
imports: [CommonModule, LxTooltipModule, TranslateModule.forChild()],
|
|
1863
1917
|
exports: [
|
|
1864
1918
|
LxTooltipModule,
|
|
1865
1919
|
AfterViewInitDirective,
|
|
@@ -1881,6 +1935,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImpor
|
|
|
1881
1935
|
LxUnlinkifyPipe,
|
|
1882
1936
|
LxTimeAgo,
|
|
1883
1937
|
LxTranslatePipe,
|
|
1938
|
+
FileDownloadButtonComponent,
|
|
1884
1939
|
MarkdownPipe,
|
|
1885
1940
|
NbspPipe,
|
|
1886
1941
|
LxIsUuidPipe,
|
|
@@ -6985,5 +7040,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImpor
|
|
|
6985
7040
|
* Generated bundle index. Do not edit.
|
|
6986
7041
|
*/
|
|
6987
7042
|
|
|
6988
|
-
export { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, AfterViewInitDirective, AutocloseDirective, AutofocusDirective, BACKSPACE, BadgeComponent, BaseSelectDirective, BasicDropdownComponent, BasicDropdownItemComponent, BrPipe, BreadcrumbComponent, ButtonComponent, ButtonGroupComponent, CURRENCY_SYMBOL_MAP, CardComponent, CdkOptionsDropdownComponent, CdkOptionsSubDropdownComponent, CollapsibleComponent, ColoredLabelComponent, ContrastColorPipe, CopyButtonComponent, CurrencyInputComponent, CurrencySymbolComponent, CustomDatePipe, DATE_FN_LOCALE, DATE_FORMATS, DateInputComponent, DragAndDropListComponent, DragAndDropListItemComponent, ENTER, ESCAPE, EllipsisComponent, ErrorMessageComponent, ExpandedDropdownComponent, FORM_CONTROL_ERROR_DISPLAY_STRATEGY, FORM_CONTROL_ERROR_NAMESPACE, FilterSelectionPipe, FilterTermPipe, FormErrorComponent, FormErrorDirective, FormSubmitDirective, FormatNumberPipe, GLOBAL_TRANSLATION_OPTIONS, HighlightRangePipe, HighlightTermPipe, HtmlDirective, IconComponent, IconScaleComponent, KeyboardActionSourceDirective, KeyboardSelectAction, KeyboardSelectDirective, LOCALE_FN, LX_ELLIPSIS_DEBOUNCE_ON_RESIZE, LxCoreUiModule, LxDragAndDropListModule, LxFormsModule, LxIsUuidPipe, LxLinkifyPipe, LxModalModule, LxPopoverUiModule, LxTabUiModule, LxTimeAgo, LxTooltipModule, LxTranslatePipe, LxUnlinkifyPipe, MODAL_CLOSE, MarkInvalidDirective, MarkdownPipe, ModalCloseClickLocation, ModalComponent, ModalContentDirective, ModalFooterComponent, ModalHeaderComponent, MultiSelectComponent, NbspPipe, OptionComponent, OptionGroupComponent, OptionGroupDropdownComponent, OptionsDropdownComponent, OptionsSubDropdownComponent, PickerComponent, PickerOptionComponent, PickerTriggerDirective, PillItemComponent, PillListComponent, PopoverClickDirective, PopoverComponent, PopoverContentDirective, PopoverHoverDirective, RELEVANCE_SORTING_KEY, Required, ResizeObserverService, ResponsiveInputComponent, SPACE, SelectDropdownDirective, SelectListComponent, SelectableItemDirective, SelectedOptionDirective, SingleSelectComponent, SliderToggleComponent, SortPipe, Sorting, SortingDropdownComponent, SortingDropdownTriggerComponent, SpinnerComponent, TAB, TabComponent, TabGroupComponent, TableComponent, TableHeaderComponent, TinySpinnerComponent, TooltipComponent, TooltipDirective, TranslationAfterPipe, TranslationBeforePipe, TranslationBetweenPipe, UnescapeCurlyBracesPipe, ValidateDateInForeseeableFuture, ValidateStringNotInArray, ValidateStringNotInArrayAsync, getContrastColor, getTranslationParts, isValidHexColor, isValidX, isValidY, provideFormControlErrorDisplayStrategy, provideFormControlErrorNamespace, shorthandHexHandle };
|
|
7043
|
+
export { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, AfterViewInitDirective, AutocloseDirective, AutofocusDirective, BACKSPACE, BadgeComponent, BaseSelectDirective, BasicDropdownComponent, BasicDropdownItemComponent, BrPipe, BreadcrumbComponent, ButtonComponent, ButtonGroupComponent, CURRENCY_SYMBOL_MAP, CardComponent, CdkOptionsDropdownComponent, CdkOptionsSubDropdownComponent, CollapsibleComponent, ColoredLabelComponent, ContrastColorPipe, CopyButtonComponent, CurrencyInputComponent, CurrencySymbolComponent, CustomDatePipe, DATE_FN_LOCALE, DATE_FORMATS, DateInputComponent, DragAndDropListComponent, DragAndDropListItemComponent, ENTER, ESCAPE, EllipsisComponent, ErrorMessageComponent, ExpandedDropdownComponent, FORM_CONTROL_ERROR_DISPLAY_STRATEGY, FORM_CONTROL_ERROR_NAMESPACE, FileDownloadButtonComponent, FilterSelectionPipe, FilterTermPipe, FormErrorComponent, FormErrorDirective, FormSubmitDirective, FormatNumberPipe, GLOBAL_TRANSLATION_OPTIONS, HighlightRangePipe, HighlightTermPipe, HtmlDirective, IconComponent, IconScaleComponent, KeyboardActionSourceDirective, KeyboardSelectAction, KeyboardSelectDirective, LOCALE_FN, LX_ELLIPSIS_DEBOUNCE_ON_RESIZE, LxCoreUiModule, LxDragAndDropListModule, LxFormsModule, LxIsUuidPipe, LxLinkifyPipe, LxModalModule, LxPopoverUiModule, LxTabUiModule, LxTimeAgo, LxTooltipModule, LxTranslatePipe, LxUnlinkifyPipe, MODAL_CLOSE, MarkInvalidDirective, MarkdownPipe, ModalCloseClickLocation, ModalComponent, ModalContentDirective, ModalFooterComponent, ModalHeaderComponent, MultiSelectComponent, NbspPipe, OptionComponent, OptionGroupComponent, OptionGroupDropdownComponent, OptionsDropdownComponent, OptionsSubDropdownComponent, PickerComponent, PickerOptionComponent, PickerTriggerDirective, PillItemComponent, PillListComponent, PopoverClickDirective, PopoverComponent, PopoverContentDirective, PopoverHoverDirective, RELEVANCE_SORTING_KEY, Required, ResizeObserverService, ResponsiveInputComponent, SPACE, SelectDropdownDirective, SelectListComponent, SelectableItemDirective, SelectedOptionDirective, SingleSelectComponent, SliderToggleComponent, SortPipe, Sorting, SortingDropdownComponent, SortingDropdownTriggerComponent, SpinnerComponent, TAB, TabComponent, TabGroupComponent, TableComponent, TableHeaderComponent, TinySpinnerComponent, TooltipComponent, TooltipDirective, TranslationAfterPipe, TranslationBeforePipe, TranslationBetweenPipe, UnescapeCurlyBracesPipe, ValidateDateInForeseeableFuture, ValidateStringNotInArray, ValidateStringNotInArrayAsync, getContrastColor, getTranslationParts, isValidHexColor, isValidX, isValidY, provideFormControlErrorDisplayStrategy, provideFormControlErrorNamespace, shorthandHexHandle };
|
|
6989
7044
|
//# sourceMappingURL=leanix-components.mjs.map
|