@leanix/components 0.4.762 → 0.4.764
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.
|
@@ -1898,14 +1898,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
|
|
|
1898
1898
|
}] });
|
|
1899
1899
|
|
|
1900
1900
|
const DATE_ONLY_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
1901
|
+
/**
|
|
1902
|
+
* Creates a Date object from a date-only string (YYYY-MM-DD) without applying timezone offset.
|
|
1903
|
+
*
|
|
1904
|
+
* This replicates the behavior of date-fns v1.30.0, which extracted year, month, and day
|
|
1905
|
+
* from the string and created a UTC date. In date-fns v4+, plain strings are parsed via
|
|
1906
|
+
* `new Date(value)`, which applies the local timezone - causing dates to shift for users
|
|
1907
|
+
* in negative UTC offset timezones (e.g., US customers seeing the previous day).
|
|
1908
|
+
*
|
|
1909
|
+
* @see https://github.com/date-fns/date-fns/blob/v1.30.0/src/parse/index.js#L231
|
|
1910
|
+
*/
|
|
1901
1911
|
function createLocalDate(dateString) {
|
|
1902
1912
|
const [year, month, day] = dateString.split('-').map(Number);
|
|
1903
1913
|
return new Date(year, month - 1, day);
|
|
1904
1914
|
}
|
|
1915
|
+
/**
|
|
1916
|
+
* Formats dates using date-fns with optional locale support.
|
|
1917
|
+
*
|
|
1918
|
+
* Handles three input types:
|
|
1919
|
+
* - Date objects: formatted directly
|
|
1920
|
+
* - Date-only strings (YYYY-MM-DD): parsed without timezone offset to avoid day-shift issues
|
|
1921
|
+
* - Other strings/numbers: parsed via `new Date()` (timezone-aware)
|
|
1922
|
+
*
|
|
1923
|
+
* @example
|
|
1924
|
+
* ```html
|
|
1925
|
+
* {{ myDate | lxDate:'PP' }}
|
|
1926
|
+
* {{ '2026-01-15' | lxDate:'MMMM d, yyyy' }}
|
|
1927
|
+
* ```
|
|
1928
|
+
*/
|
|
1905
1929
|
class CustomDatePipe {
|
|
1906
1930
|
constructor(getDateFnLocale) {
|
|
1907
1931
|
this.getDateFnLocale = getDateFnLocale;
|
|
1908
1932
|
}
|
|
1933
|
+
/**
|
|
1934
|
+
* @param value - Date, timestamp, or date string to format
|
|
1935
|
+
* @param f - date-fns format string (e.g., 'PP', 'yyyy-MM-dd')
|
|
1936
|
+
* @returns Formatted date string, or empty string if invalid/null
|
|
1937
|
+
*/
|
|
1909
1938
|
transform(value, f) {
|
|
1910
1939
|
if (!value) {
|
|
1911
1940
|
return '';
|
|
@@ -2734,6 +2763,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
|
|
|
2734
2763
|
}]
|
|
2735
2764
|
}] });
|
|
2736
2765
|
|
|
2766
|
+
/**
|
|
2767
|
+
* This pipe can be used to transform Font Awesome icons into SAP icons.
|
|
2768
|
+
* Useful for scenarios in which icon names need to be mapped at runtime,
|
|
2769
|
+
* e.g. because they are stored in the backend.
|
|
2770
|
+
*
|
|
2771
|
+
* @example ```html
|
|
2772
|
+
* <ui5-icon [name]="fontAwesomeIcon() | lxFaToSapIcon" />
|
|
2773
|
+
* ```
|
|
2774
|
+
*/
|
|
2775
|
+
class FaToSapIconPipe {
|
|
2776
|
+
/**
|
|
2777
|
+
* Transforms Font Awesome icons to SAP icons
|
|
2778
|
+
* @param value The Font Awesome icon name, with optional `fa-` prefix
|
|
2779
|
+
* @param isSolid Whether the icon is solid
|
|
2780
|
+
* @returns The SAP icon name, or provided value if no mapped icon found
|
|
2781
|
+
*/
|
|
2782
|
+
transform(value, isSolid = false) {
|
|
2783
|
+
const iconName = value.startsWith('fa-') ? value : `fa-${value}`;
|
|
2784
|
+
const icons = ICON_MAP[iconName];
|
|
2785
|
+
if (!icons || !icons.length) {
|
|
2786
|
+
console.warn(`[FaToSapIconPipe] No SAP icon found for ${value}`);
|
|
2787
|
+
return value;
|
|
2788
|
+
}
|
|
2789
|
+
if (isSolid) {
|
|
2790
|
+
return icons[1] ?? icons[0];
|
|
2791
|
+
}
|
|
2792
|
+
return icons[0];
|
|
2793
|
+
}
|
|
2794
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: FaToSapIconPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2795
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.18", ngImport: i0, type: FaToSapIconPipe, isStandalone: true, name: "lxFaToSapIcon" }); }
|
|
2796
|
+
}
|
|
2797
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: FaToSapIconPipe, decorators: [{
|
|
2798
|
+
type: Pipe,
|
|
2799
|
+
args: [{
|
|
2800
|
+
name: 'lxFaToSapIcon'
|
|
2801
|
+
}]
|
|
2802
|
+
}] });
|
|
2803
|
+
|
|
2737
2804
|
class DisplayAvatarsPipe {
|
|
2738
2805
|
transform(users, type, size, userGroupWidth, autoScale, maxLength) {
|
|
2739
2806
|
if (maxLength) {
|
|
@@ -11924,5 +11991,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
|
|
|
11924
11991
|
* Generated bundle index. Do not edit.
|
|
11925
11992
|
*/
|
|
11926
11993
|
|
|
11927
|
-
export { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, AVATAR_COLORS, AVATAR_SIZE_MAPPING, AfterViewInitDirective, AngularNodeViewComponent, AngularNodeViewRenderer, AutocloseDirective, AutocloseGroupService, AutofocusDirective, AvatarComponent, AvatarGroupComponent, BACKSPACE, BadgeComponent, BannerComponent, BaseSelectDirective, BasicDropdownComponent, BasicDropdownItemComponent, BrPipe, BreadcrumbComponent, ButtonComponent, ButtonGroupComponent, CORE_MODULE_EXPORTS, CURRENCY_SYMBOL_MAP, CardComponent, CdkOptionsDropdownComponent, CdkOptionsSubDropdownComponent, CollapsibleComponent, ContenteditableDirective, ContrastColorPipe, CounterComponent, CurrencyInputComponent, CurrencySymbolComponent, CustomDatePipe, DATEPICKER_CONTROL_VALUE_ACCESSOR, DATE_FN_LOCALE, DATE_FORMATS, DEFAULT_IMAGE_ID, DateFormatter, DateInputComponent, DatePickerComponent, DatepickerConfig, DatepickerUiModule, DragAndDropListComponent, DragAndDropListItemComponent, END, ENTER, ESCAPE, EllipsisComponent, EmptyStateComponent, ErrorMessageComponent, FORMS_MODULE_EXPORTS, FORM_CONTROL_ERROR_DISPLAY_STRATEGY, FORM_CONTROL_ERROR_NAMESPACE, FilterSelectionPipe, FilterTermPipe, FocusEditorDirective, FormErrorComponent, FormErrorDirective, FormSubmitDirective, FormatNumberPipe, GLOBAL_TRANSLATION_OPTIONS, HOME, HighlightRangePipe, HighlightTermDirective, HighlightTermPipe, ICON_MAP, IMAGE_READER, IconComponent, IconScaleComponent, InputComponent, KeyboardActionSourceDirective, KeyboardSelectAction, KeyboardSelectDirective, LOCALE_FN, LX_ELLIPSIS_DEBOUNCE_ON_RESIZE, LxCoreUiModule, LxDragAndDropListModule, LxFormsModule, LxIsUuidPipe, LxLinkifyPipe, LxTimeAgo, LxTranslatePipe, LxUnlinkifyPipe, MODAL_CLOSE, MarkInvalidDirective, MarkdownPipe, MaxLengthCounterDirective, ModalCloseClickLocation, ModalComponent, ModalContentDirective, ModalFooterComponent, ModalHeaderComponent, MultiSelectComponent, NbspPipe, OptionComponent, OptionGroupComponent, OptionGroupDropdownComponent, OptionsDropdownComponent, OptionsSubDropdownComponent, PageHeaderComponent, PickerComponent, PickerOptionComponent, PickerTriggerDirective, PillItemComponent, PillListComponent, PopoverClickDirective, PopoverComponent, PopoverContentDirective, PopoverHoverDirective, RELEVANCE_SORTING_KEY, RemoveMarkdownPipe, ResizeObserverService, ResponsiveInputComponent, RichTextEditorComponent, SPACE, SelectDropdownDirective, SelectableItemDirective, SelectedOptionDirective, SingleSelectComponent, SkeletonComponent, SortPipe, Sorting, SortingDropdownComponent, SortingDropdownTriggerComponent, SpinnerComponent, StepperComponent, SwitchComponent, TAB, TabComponent, TabGroupComponent, TableComponent, TableHeaderComponent, TinySpinnerComponent, TipTapEditorDirective, TokenComponent, TokenizerComponent, TokenizerOverflowPopoverComponent, TooltipComponent, TooltipDirective, TrackingDirective, TranslationAfterPipe, TranslationBeforePipe, TranslationBetweenPipe, TruncateDirective, UnescapeCurlyBracesPipe, ValidateDateInForeseeableFuture, ValidateStringNotInArray, ValidateStringNotInArrayAsync, argsToInterpolatedTemplate, getContrastColor, getInitialsUrl, getKeyboardNavigationEvents, getSapIcon, getTranslationParts, highlightText, isValidHexColor, isValidX, isValidY, markdownToText, provideFormControlErrorDisplayStrategy, provideFormControlErrorNamespace, shorthandHexHandle, stopKeyboardEventPropagation };
|
|
11994
|
+
export { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, AVATAR_COLORS, AVATAR_SIZE_MAPPING, AfterViewInitDirective, AngularNodeViewComponent, AngularNodeViewRenderer, AutocloseDirective, AutocloseGroupService, AutofocusDirective, AvatarComponent, AvatarGroupComponent, BACKSPACE, BadgeComponent, BannerComponent, BaseSelectDirective, BasicDropdownComponent, BasicDropdownItemComponent, BrPipe, BreadcrumbComponent, ButtonComponent, ButtonGroupComponent, CORE_MODULE_EXPORTS, CURRENCY_SYMBOL_MAP, CardComponent, CdkOptionsDropdownComponent, CdkOptionsSubDropdownComponent, CollapsibleComponent, ContenteditableDirective, ContrastColorPipe, CounterComponent, CurrencyInputComponent, CurrencySymbolComponent, CustomDatePipe, DATEPICKER_CONTROL_VALUE_ACCESSOR, DATE_FN_LOCALE, DATE_FORMATS, DEFAULT_IMAGE_ID, DateFormatter, DateInputComponent, DatePickerComponent, DatepickerConfig, DatepickerUiModule, DragAndDropListComponent, DragAndDropListItemComponent, END, ENTER, ESCAPE, EllipsisComponent, EmptyStateComponent, ErrorMessageComponent, FORMS_MODULE_EXPORTS, FORM_CONTROL_ERROR_DISPLAY_STRATEGY, FORM_CONTROL_ERROR_NAMESPACE, FaToSapIconPipe, FilterSelectionPipe, FilterTermPipe, FocusEditorDirective, FormErrorComponent, FormErrorDirective, FormSubmitDirective, FormatNumberPipe, GLOBAL_TRANSLATION_OPTIONS, HOME, HighlightRangePipe, HighlightTermDirective, HighlightTermPipe, ICON_MAP, IMAGE_READER, IconComponent, IconScaleComponent, InputComponent, KeyboardActionSourceDirective, KeyboardSelectAction, KeyboardSelectDirective, LOCALE_FN, LX_ELLIPSIS_DEBOUNCE_ON_RESIZE, LxCoreUiModule, LxDragAndDropListModule, LxFormsModule, LxIsUuidPipe, LxLinkifyPipe, LxTimeAgo, LxTranslatePipe, LxUnlinkifyPipe, MODAL_CLOSE, MarkInvalidDirective, MarkdownPipe, MaxLengthCounterDirective, ModalCloseClickLocation, ModalComponent, ModalContentDirective, ModalFooterComponent, ModalHeaderComponent, MultiSelectComponent, NbspPipe, OptionComponent, OptionGroupComponent, OptionGroupDropdownComponent, OptionsDropdownComponent, OptionsSubDropdownComponent, PageHeaderComponent, PickerComponent, PickerOptionComponent, PickerTriggerDirective, PillItemComponent, PillListComponent, PopoverClickDirective, PopoverComponent, PopoverContentDirective, PopoverHoverDirective, RELEVANCE_SORTING_KEY, RemoveMarkdownPipe, ResizeObserverService, ResponsiveInputComponent, RichTextEditorComponent, SPACE, SelectDropdownDirective, SelectableItemDirective, SelectedOptionDirective, SingleSelectComponent, SkeletonComponent, SortPipe, Sorting, SortingDropdownComponent, SortingDropdownTriggerComponent, SpinnerComponent, StepperComponent, SwitchComponent, TAB, TabComponent, TabGroupComponent, TableComponent, TableHeaderComponent, TinySpinnerComponent, TipTapEditorDirective, TokenComponent, TokenizerComponent, TokenizerOverflowPopoverComponent, TooltipComponent, TooltipDirective, TrackingDirective, TranslationAfterPipe, TranslationBeforePipe, TranslationBetweenPipe, TruncateDirective, UnescapeCurlyBracesPipe, ValidateDateInForeseeableFuture, ValidateStringNotInArray, ValidateStringNotInArrayAsync, argsToInterpolatedTemplate, getContrastColor, getInitialsUrl, getKeyboardNavigationEvents, getSapIcon, getTranslationParts, highlightText, isValidHexColor, isValidX, isValidY, markdownToText, provideFormControlErrorDisplayStrategy, provideFormControlErrorNamespace, shorthandHexHandle, stopKeyboardEventPropagation };
|
|
11928
11995
|
//# sourceMappingURL=leanix-components.mjs.map
|