@leanix/components 0.4.730 → 0.4.732
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.
|
@@ -200,6 +200,7 @@ const ICON_MAP = {
|
|
|
200
200
|
'fa-file-video': ['attachment-video'],
|
|
201
201
|
'fa-file-word': ['doc-attachment'],
|
|
202
202
|
'fa-filter': ['filter'],
|
|
203
|
+
'fa-fire': ['business-suite/fire'],
|
|
203
204
|
'fa-fire-alt': ['business-suite/fire'],
|
|
204
205
|
'fa-folder': ['folder-blank'],
|
|
205
206
|
'fa-folder-open': ['open-folder'],
|
|
@@ -223,6 +224,7 @@ const ICON_MAP = {
|
|
|
223
224
|
'fa-info-circle': ['message-information', 'information'],
|
|
224
225
|
'fa-info-square': ['message-information', 'information'],
|
|
225
226
|
'fa-italic': ['italic-text'],
|
|
227
|
+
'fa-key': ['key'],
|
|
226
228
|
'fa-keyboard': ['keyboard-and-mouse'],
|
|
227
229
|
'fa-jira': ['rhombus-milestone'],
|
|
228
230
|
'fa-lemon': ['lx-icons/lemon'],
|
|
@@ -293,6 +295,7 @@ const ICON_MAP = {
|
|
|
293
295
|
'fa-spinner': ['pending'],
|
|
294
296
|
'fa-square': ['border'],
|
|
295
297
|
'fa-star': ['unfavorite', 'favorite'],
|
|
298
|
+
'fa-sticky-note': ['notes'],
|
|
296
299
|
'fa-strikethrough': ['strikethrough'],
|
|
297
300
|
'fa-sync': ['synchronize'],
|
|
298
301
|
'fa-sync-alt': ['synchronize'],
|
|
@@ -542,7 +545,7 @@ class ButtonComponent {
|
|
|
542
545
|
this.icon = input();
|
|
543
546
|
this.iconName = computed(() => this.getIconName(this.icon()));
|
|
544
547
|
this.iconVariant = computed(() => extractFontAwesomeVariant(this.icon()));
|
|
545
|
-
this.iconKind = computed(() => (isFontAwesomeIcon(this.iconName()) ? 'fa' : 'sap'));
|
|
548
|
+
this.iconKind = computed(() => (isFontAwesomeIcon$1(this.iconName()) ? 'fa' : 'sap'));
|
|
546
549
|
/**
|
|
547
550
|
* The icon name (font-awesome) to display inside the button.
|
|
548
551
|
* It is displayed after any additional content.
|
|
@@ -556,7 +559,7 @@ class ButtonComponent {
|
|
|
556
559
|
this.endIcon = input();
|
|
557
560
|
this.endIconName = computed(() => this.getIconName(this.endIcon()));
|
|
558
561
|
this.endIconVariant = computed(() => extractFontAwesomeVariant(this.endIcon()));
|
|
559
|
-
this.endIconKind = computed(() => (isFontAwesomeIcon(this.endIconName()) ? 'fa' : 'sap'));
|
|
562
|
+
this.endIconKind = computed(() => (isFontAwesomeIcon$1(this.endIconName()) ? 'fa' : 'sap'));
|
|
560
563
|
/**
|
|
561
564
|
* This shows a spinner inside the button.
|
|
562
565
|
*/
|
|
@@ -576,7 +579,7 @@ class ButtonComponent {
|
|
|
576
579
|
// `fa-ellipsis-v` --> `overflow` is an intrusive change, therefore using the SAP icon alternative
|
|
577
580
|
return 'overflow';
|
|
578
581
|
}
|
|
579
|
-
if (!isFontAwesomeIcon(iconName)) {
|
|
582
|
+
if (!isFontAwesomeIcon$1(iconName)) {
|
|
580
583
|
// Assuming SAP icon was provided
|
|
581
584
|
return iconName;
|
|
582
585
|
}
|
|
@@ -640,7 +643,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
640
643
|
function isEllipsisVIcon(iconName) {
|
|
641
644
|
return iconName?.includes('fa-ellipsis-v') ?? false;
|
|
642
645
|
}
|
|
643
|
-
function isFontAwesomeIcon(iconName) {
|
|
646
|
+
function isFontAwesomeIcon$1(iconName) {
|
|
644
647
|
return iconName ? /\bfa-\w*\b/.test(iconName) : false;
|
|
645
648
|
}
|
|
646
649
|
function extractFontAwesomeVariant(iconName) {
|
|
@@ -1031,29 +1034,79 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
1031
1034
|
|
|
1032
1035
|
class EmptyStateComponent {
|
|
1033
1036
|
constructor() {
|
|
1037
|
+
/**
|
|
1038
|
+
* The title to be displayed
|
|
1039
|
+
*/
|
|
1034
1040
|
this.title = input.required();
|
|
1041
|
+
/**
|
|
1042
|
+
* The SAP icon to show in the empty state.
|
|
1043
|
+
*
|
|
1044
|
+
* **Important:** Font Awesome icons are not supported anymore.
|
|
1045
|
+
*/
|
|
1035
1046
|
this.icon = input();
|
|
1047
|
+
/**
|
|
1048
|
+
* The main call-to-action button label
|
|
1049
|
+
*/
|
|
1036
1050
|
this.buttonLabel = input();
|
|
1051
|
+
/**
|
|
1052
|
+
* The secondary call-to-action button label
|
|
1053
|
+
*/
|
|
1037
1054
|
this.secondaryButtonLabel = input();
|
|
1055
|
+
/**
|
|
1056
|
+
* Whether the empty state is in a loading state. If true, main call-to-action button will show a spinner
|
|
1057
|
+
*/
|
|
1038
1058
|
this.loading = input(false);
|
|
1059
|
+
/**
|
|
1060
|
+
* The more link label
|
|
1061
|
+
*/
|
|
1039
1062
|
this.moreLinkLabel = input();
|
|
1063
|
+
/**
|
|
1064
|
+
* The URL of the more link
|
|
1065
|
+
*/
|
|
1040
1066
|
this.moreLink = input();
|
|
1067
|
+
/**
|
|
1068
|
+
* Whether the more link should be opened in a new tab
|
|
1069
|
+
*
|
|
1070
|
+
* @default true
|
|
1071
|
+
*/
|
|
1041
1072
|
this.openMoreLinkInNewTab = input(true);
|
|
1073
|
+
/**
|
|
1074
|
+
* The size of the empty state
|
|
1075
|
+
*
|
|
1076
|
+
* @default medium
|
|
1077
|
+
*/
|
|
1042
1078
|
this.size = input('medium');
|
|
1043
1079
|
this.useRouterLink = computed(() => Array.isArray(this.moreLink()));
|
|
1080
|
+
this.iconName = computed(() => {
|
|
1081
|
+
const icon = this.icon();
|
|
1082
|
+
if (!icon) {
|
|
1083
|
+
return null;
|
|
1084
|
+
}
|
|
1085
|
+
// Temporarily map icons, as long as consumers need to be adjusted.
|
|
1086
|
+
return isFontAwesomeIcon(icon) ? mapToSapIcon(icon) : icon;
|
|
1087
|
+
});
|
|
1088
|
+
/**
|
|
1089
|
+
* Emitted when the main call-to-action button is clicked
|
|
1090
|
+
*/
|
|
1044
1091
|
this.buttonClicked = new EventEmitter();
|
|
1092
|
+
/**
|
|
1093
|
+
* Emitted when the secondary call-to-action button is clicked
|
|
1094
|
+
*/
|
|
1045
1095
|
this.secondaryButtonClicked = new EventEmitter();
|
|
1096
|
+
/**
|
|
1097
|
+
* Emitted when the more link is clicked
|
|
1098
|
+
*/
|
|
1046
1099
|
this.moreLinkClicked = new EventEmitter();
|
|
1047
1100
|
}
|
|
1048
1101
|
get _size() {
|
|
1049
1102
|
return this.size();
|
|
1050
1103
|
}
|
|
1051
1104
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EmptyStateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1052
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: EmptyStateComponent, isStandalone: true, selector: "lx-empty-state", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, buttonLabel: { classPropertyName: "buttonLabel", publicName: "buttonLabel", isSignal: true, isRequired: false, transformFunction: null }, secondaryButtonLabel: { classPropertyName: "secondaryButtonLabel", publicName: "secondaryButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, moreLinkLabel: { classPropertyName: "moreLinkLabel", publicName: "moreLinkLabel", isSignal: true, isRequired: false, transformFunction: null }, moreLink: { classPropertyName: "moreLink", publicName: "moreLink", isSignal: true, isRequired: false, transformFunction: null }, openMoreLinkInNewTab: { classPropertyName: "openMoreLinkInNewTab", publicName: "openMoreLinkInNewTab", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { buttonClicked: "buttonClicked", secondaryButtonClicked: "secondaryButtonClicked", moreLinkClicked: "moreLinkClicked" }, host: { properties: { "attr.size": "this._size" } }, ngImport: i0, template: "<div class=\"tw-max-w-[434px] tw-text-center\">\n @if (
|
|
1105
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: EmptyStateComponent, isStandalone: true, selector: "lx-empty-state", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, buttonLabel: { classPropertyName: "buttonLabel", publicName: "buttonLabel", isSignal: true, isRequired: false, transformFunction: null }, secondaryButtonLabel: { classPropertyName: "secondaryButtonLabel", publicName: "secondaryButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, moreLinkLabel: { classPropertyName: "moreLinkLabel", publicName: "moreLinkLabel", isSignal: true, isRequired: false, transformFunction: null }, moreLink: { classPropertyName: "moreLink", publicName: "moreLink", isSignal: true, isRequired: false, transformFunction: null }, openMoreLinkInNewTab: { classPropertyName: "openMoreLinkInNewTab", publicName: "openMoreLinkInNewTab", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { buttonClicked: "buttonClicked", secondaryButtonClicked: "secondaryButtonClicked", moreLinkClicked: "moreLinkClicked" }, host: { properties: { "attr.size": "this._size" } }, ngImport: i0, template: "<div class=\"tw-max-w-[434px] tw-text-center\">\n @if (iconName(); as iconName) {\n <ui5-icon [name]=\"iconName\" design=\"Information\" />\n }\n\n <h3 class=\"empty-state-title tw-mb-m tw-mt-xl tw-text-black\" [innerHTML]=\"title()\"></h3>\n\n <div class=\"empty-state-content tw-leading-[16px] tw-text-gray-50\">\n <ng-content />\n </div>\n\n <div class=\"tw-flex tw-justify-center tw-gap-m\">\n @if (secondaryButtonLabel()) {\n <div class=\"secondaryButton tw-my-xl\">\n <button lx-button size=\"large\" [showSpinner]=\"loading()\" (click)=\"secondaryButtonClicked.emit($event)\">\n {{ secondaryButtonLabel() }}\n </button>\n </div>\n }\n\n @if (buttonLabel()) {\n <div class=\"actionButton tw-my-xl\">\n <button lx-button size=\"large\" color=\"primary\" [showSpinner]=\"loading()\" (click)=\"buttonClicked.emit($event)\">\n {{ buttonLabel() }}\n </button>\n </div>\n }\n </div>\n\n @if (moreLinkLabel() && moreLink()) {\n <div>\n @if (useRouterLink()) {\n <a\n rel=\"noopener noreferrer\"\n class=\"tw-text-size-md tw-text-primary\"\n [routerLink]=\"moreLink()\"\n (click)=\"moreLinkClicked.emit($event)\"\n [target]=\"openMoreLinkInNewTab() ? '_blank' : '_self'\"\n >{{ moreLinkLabel() }}</a\n >\n } @else {\n <a\n rel=\"noopener noreferrer\"\n class=\"tw-text-size-md tw-text-primary\"\n [href]=\"moreLink()\"\n (click)=\"moreLinkClicked.emit($event)\"\n [target]=\"openMoreLinkInNewTab() ? '_blank' : '_self'\"\n >{{ moreLinkLabel() }}</a\n >\n }\n </div>\n }\n</div>\n", styles: [":host{display:flex;justify-content:center}:host[size=small] .empty-state-title{font-size:var(--lxFontSize, 14px)}:host[size=small] .empty-state-content{font-size:var(--lxFontSmallSize, 12px)}:host[size=medium] .empty-state-title{font-size:var(--lxFontHeader2Size, 24px)}:host[size=medium] .empty-state-content{font-size:var(--lxFontSize, 14px)}ui5-icon{position:relative;width:2rem;height:2rem}ui5-icon:after{content:\"\";position:absolute;bottom:-8px;left:50%;transform:translate(-50%);height:6px;width:44px;background-color:#f0f2f5;border-radius:100%}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[lx-button]", inputs: ["size", "color", "mode", "pressed", "selected", "square", "circle", "disabled", "icon", "endIcon", "showSpinner"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: IconComponent$1, selector: "ui5-icon", inputs: ["design", "name", "accessibleName", "showTooltip", "mode"], outputs: ["ui5Click"], exportAs: ["ui5Icon"] }] }); }
|
|
1053
1106
|
}
|
|
1054
1107
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EmptyStateComponent, decorators: [{
|
|
1055
1108
|
type: Component,
|
|
1056
|
-
args: [{ selector: 'lx-empty-state', imports: [ButtonComponent, RouterLink], template: "<div class=\"tw-max-w-[434px] tw-text-center\">\n @if (
|
|
1109
|
+
args: [{ selector: 'lx-empty-state', imports: [ButtonComponent, RouterLink, IconComponent$1], template: "<div class=\"tw-max-w-[434px] tw-text-center\">\n @if (iconName(); as iconName) {\n <ui5-icon [name]=\"iconName\" design=\"Information\" />\n }\n\n <h3 class=\"empty-state-title tw-mb-m tw-mt-xl tw-text-black\" [innerHTML]=\"title()\"></h3>\n\n <div class=\"empty-state-content tw-leading-[16px] tw-text-gray-50\">\n <ng-content />\n </div>\n\n <div class=\"tw-flex tw-justify-center tw-gap-m\">\n @if (secondaryButtonLabel()) {\n <div class=\"secondaryButton tw-my-xl\">\n <button lx-button size=\"large\" [showSpinner]=\"loading()\" (click)=\"secondaryButtonClicked.emit($event)\">\n {{ secondaryButtonLabel() }}\n </button>\n </div>\n }\n\n @if (buttonLabel()) {\n <div class=\"actionButton tw-my-xl\">\n <button lx-button size=\"large\" color=\"primary\" [showSpinner]=\"loading()\" (click)=\"buttonClicked.emit($event)\">\n {{ buttonLabel() }}\n </button>\n </div>\n }\n </div>\n\n @if (moreLinkLabel() && moreLink()) {\n <div>\n @if (useRouterLink()) {\n <a\n rel=\"noopener noreferrer\"\n class=\"tw-text-size-md tw-text-primary\"\n [routerLink]=\"moreLink()\"\n (click)=\"moreLinkClicked.emit($event)\"\n [target]=\"openMoreLinkInNewTab() ? '_blank' : '_self'\"\n >{{ moreLinkLabel() }}</a\n >\n } @else {\n <a\n rel=\"noopener noreferrer\"\n class=\"tw-text-size-md tw-text-primary\"\n [href]=\"moreLink()\"\n (click)=\"moreLinkClicked.emit($event)\"\n [target]=\"openMoreLinkInNewTab() ? '_blank' : '_self'\"\n >{{ moreLinkLabel() }}</a\n >\n }\n </div>\n }\n</div>\n", styles: [":host{display:flex;justify-content:center}:host[size=small] .empty-state-title{font-size:var(--lxFontSize, 14px)}:host[size=small] .empty-state-content{font-size:var(--lxFontSmallSize, 12px)}:host[size=medium] .empty-state-title{font-size:var(--lxFontHeader2Size, 24px)}:host[size=medium] .empty-state-content{font-size:var(--lxFontSize, 14px)}ui5-icon{position:relative;width:2rem;height:2rem}ui5-icon:after{content:\"\";position:absolute;bottom:-8px;left:50%;transform:translate(-50%);height:6px;width:44px;background-color:#f0f2f5;border-radius:100%}\n"] }]
|
|
1057
1110
|
}], propDecorators: { _size: [{
|
|
1058
1111
|
type: HostBinding,
|
|
1059
1112
|
args: ['attr.size']
|
|
@@ -1064,6 +1117,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
1064
1117
|
}], moreLinkClicked: [{
|
|
1065
1118
|
type: Output
|
|
1066
1119
|
}] } });
|
|
1120
|
+
function mapToSapIcon(fontAwesomeIcon) {
|
|
1121
|
+
const sapIcons = ICON_MAP[`fa-${fontAwesomeIcon}`];
|
|
1122
|
+
if (!sapIcons || sapIcons.length === 0) {
|
|
1123
|
+
console.warn(`No SAP icon found for Font Awesome icon fa-${fontAwesomeIcon}`);
|
|
1124
|
+
return null;
|
|
1125
|
+
}
|
|
1126
|
+
const isSolid = true; // Empty state icons were always solid
|
|
1127
|
+
const sapIcon = isSolid && sapIcons[1] ? sapIcons[1] : sapIcons[0];
|
|
1128
|
+
return sapIcon ?? null;
|
|
1129
|
+
}
|
|
1130
|
+
function isFontAwesomeIcon(iconName) {
|
|
1131
|
+
return !!ICON_MAP[`fa-${iconName}`];
|
|
1132
|
+
}
|
|
1067
1133
|
|
|
1068
1134
|
class IconScaleComponent {
|
|
1069
1135
|
constructor() {
|