@leanix/components 0.3.114 → 0.3.115
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/forms-ui/components/copy-button/copy-button.component.mjs +59 -0
- package/esm2020/lib/forms-ui/forms-ui.module.mjs +6 -1
- package/esm2020/lib/modal-ui/components/modal/modal.component.mjs +4 -2
- package/fesm2015/leanix-components.mjs +64 -2
- package/fesm2015/leanix-components.mjs.map +1 -1
- package/fesm2020/leanix-components.mjs +62 -2
- package/fesm2020/leanix-components.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/forms-ui/components/copy-button/copy-button.component.d.ts +25 -0
- package/lib/forms-ui/forms-ui.module.d.ts +46 -45
- package/package.json +2 -1
|
@@ -2758,6 +2758,60 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImpor
|
|
|
2758
2758
|
args: ['dropdown']
|
|
2759
2759
|
}] } });
|
|
2760
2760
|
|
|
2761
|
+
// todo: replace with Angular CDK clipboard
|
|
2762
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
2763
|
+
const copy = require('clipboard-copy');
|
|
2764
|
+
class CopyButtonComponent {
|
|
2765
|
+
constructor() {
|
|
2766
|
+
/** JSON string or object to be saved/copied as JSON */
|
|
2767
|
+
this.data = '';
|
|
2768
|
+
/** Determine copy button Bootstrap class & color or hide it altogether */
|
|
2769
|
+
this.btn = 'default';
|
|
2770
|
+
this.success = new EventEmitter();
|
|
2771
|
+
this.error = new EventEmitter();
|
|
2772
|
+
this.NAME = 'CopyButtonComponent';
|
|
2773
|
+
// clipboard-copy uses document.execCommand to copy to clipboard. All our _whitelisted_ browsers support it.
|
|
2774
|
+
// The copy still fails on very rare occasions for unknown reasons. In those cases it's good for the user
|
|
2775
|
+
// to be able to try again. So clipboardSupport is not set to false in the catch below any more.
|
|
2776
|
+
this.clipboardSupport = typeof document.execCommand === 'function';
|
|
2777
|
+
}
|
|
2778
|
+
async copy() {
|
|
2779
|
+
try {
|
|
2780
|
+
const json = this.getStringData();
|
|
2781
|
+
await copy(json);
|
|
2782
|
+
this.success.emit({
|
|
2783
|
+
messageKey: this.dataDescription ? `${this.NAME}.dataCopySuccess` : `${this.NAME}.copySuccess`,
|
|
2784
|
+
translateParams: { data: this.dataDescription }
|
|
2785
|
+
});
|
|
2786
|
+
}
|
|
2787
|
+
catch (err) {
|
|
2788
|
+
this.error.emit({
|
|
2789
|
+
messageKey: this.dataDescription ? `${this.NAME}.dataCopyFailure` : `${this.NAME}.copyFailure`,
|
|
2790
|
+
translateParams: { data: this.dataDescription }
|
|
2791
|
+
});
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
getStringData() {
|
|
2795
|
+
return _.isString(this.data) ? this.data : JSON.stringify(this.data, null, '\t');
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
CopyButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.1", ngImport: i0, type: CopyButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2799
|
+
CopyButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.1", type: CopyButtonComponent, selector: "lx-copy-button", inputs: { data: "data", dataDescription: "dataDescription", btn: "btn" }, outputs: { success: "success", error: "error" }, ngImport: i0, template: "<button *ngIf=\"clipboardSupport\" (click)=\"copy()\" class=\"btn btn-{{ btn }} btnCopyJson\">\n <i class=\"far fa-copy\"></i>\n <span>\n {{ 'buttons.copy' | translate }}\n </span>\n</button>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] });
|
|
2800
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImport: i0, type: CopyButtonComponent, decorators: [{
|
|
2801
|
+
type: Component,
|
|
2802
|
+
args: [{ selector: 'lx-copy-button', template: "<button *ngIf=\"clipboardSupport\" (click)=\"copy()\" class=\"btn btn-{{ btn }} btnCopyJson\">\n <i class=\"far fa-copy\"></i>\n <span>\n {{ 'buttons.copy' | translate }}\n </span>\n</button>\n" }]
|
|
2803
|
+
}], ctorParameters: function () { return []; }, propDecorators: { data: [{
|
|
2804
|
+
type: Input
|
|
2805
|
+
}], dataDescription: [{
|
|
2806
|
+
type: Input
|
|
2807
|
+
}], btn: [{
|
|
2808
|
+
type: Input
|
|
2809
|
+
}], success: [{
|
|
2810
|
+
type: Output
|
|
2811
|
+
}], error: [{
|
|
2812
|
+
type: Output
|
|
2813
|
+
}] } });
|
|
2814
|
+
|
|
2761
2815
|
// Currency symbol map extracted from: http://symbologic.info/currency.htm
|
|
2762
2816
|
// Using custom symbology since Angular 2 currency pipe does not support all currency symbols:
|
|
2763
2817
|
// https://github.com/angular/angular/issues/6724
|
|
@@ -5879,6 +5933,7 @@ LxFormsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
5879
5933
|
ExpandedDropdownComponent,
|
|
5880
5934
|
BasicDropdownItemComponent,
|
|
5881
5935
|
BreadcrumbComponent,
|
|
5936
|
+
CopyButtonComponent,
|
|
5882
5937
|
CurrencyInputComponent,
|
|
5883
5938
|
CurrencySymbolComponent,
|
|
5884
5939
|
DateInputComponent,
|
|
@@ -5924,6 +5979,7 @@ LxFormsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
5924
5979
|
ExpandedDropdownComponent,
|
|
5925
5980
|
BasicDropdownItemComponent,
|
|
5926
5981
|
BreadcrumbComponent,
|
|
5982
|
+
CopyButtonComponent,
|
|
5927
5983
|
CurrencyInputComponent,
|
|
5928
5984
|
CurrencySymbolComponent,
|
|
5929
5985
|
DateInputComponent,
|
|
@@ -5977,6 +6033,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImpor
|
|
|
5977
6033
|
ExpandedDropdownComponent,
|
|
5978
6034
|
BasicDropdownItemComponent,
|
|
5979
6035
|
BreadcrumbComponent,
|
|
6036
|
+
CopyButtonComponent,
|
|
5980
6037
|
CurrencyInputComponent,
|
|
5981
6038
|
CurrencySymbolComponent,
|
|
5982
6039
|
DateInputComponent,
|
|
@@ -6030,6 +6087,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImpor
|
|
|
6030
6087
|
ExpandedDropdownComponent,
|
|
6031
6088
|
BasicDropdownItemComponent,
|
|
6032
6089
|
BreadcrumbComponent,
|
|
6090
|
+
CopyButtonComponent,
|
|
6033
6091
|
CurrencyInputComponent,
|
|
6034
6092
|
CurrencySymbolComponent,
|
|
6035
6093
|
DateInputComponent,
|
|
@@ -6213,7 +6271,9 @@ class ModalComponent {
|
|
|
6213
6271
|
return this.explicitContent || this.implicitContent;
|
|
6214
6272
|
}
|
|
6215
6273
|
onEscape() {
|
|
6216
|
-
this.
|
|
6274
|
+
if (this.showCloseButton) {
|
|
6275
|
+
this.closeModal();
|
|
6276
|
+
}
|
|
6217
6277
|
}
|
|
6218
6278
|
ngOnInit() {
|
|
6219
6279
|
this.closeModal$?.pipe(takeUntil(this.destroyed$)).subscribe(() => this.closeModal());
|
|
@@ -6875,5 +6935,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.1", ngImpor
|
|
|
6875
6935
|
* Generated bundle index. Do not edit.
|
|
6876
6936
|
*/
|
|
6877
6937
|
|
|
6878
|
-
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, 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, 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 };
|
|
6938
|
+
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, 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 };
|
|
6879
6939
|
//# sourceMappingURL=leanix-components.mjs.map
|