@leanix/components 0.4.748 → 0.4.750

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.
@@ -1103,36 +1103,45 @@ function isFontAwesomeIcon(iconName) {
1103
1103
 
1104
1104
  class IconScaleComponent {
1105
1105
  constructor() {
1106
- this.icon = {
1107
- type: 'star'
1108
- };
1109
- this.numberOfColoredItems = 0;
1110
- this.numberOfItems = 0;
1106
+ /**
1107
+ * The icon to render
1108
+ */
1109
+ this.icon = input({ type: 'star' });
1110
+ /**
1111
+ * The amount of colored (active) icons
1112
+ */
1113
+ this.numberOfColoredItems = input(0);
1114
+ /**
1115
+ * The total amount of icons
1116
+ */
1117
+ this.numberOfItems = input(0);
1118
+ this.isFontAwesomeIcon = computed(() => {
1119
+ const fontAwesomeIconName = `fa-${this.icon().type}`;
1120
+ return !!ICON_MAP[fontAwesomeIconName];
1121
+ });
1122
+ this.iconName = computed(() => {
1123
+ if (this.isFontAwesomeIcon()) {
1124
+ return `fa-${this.icon().type}`;
1125
+ }
1126
+ return this.icon().type;
1127
+ });
1128
+ this.iconArray = computed(() => {
1129
+ return this.createIconArray(this.numberOfColoredItems(), this.numberOfItems(), this.icon().order || 'ASC');
1130
+ });
1111
1131
  /** @internal */
1112
1132
  this.NAME = 'IconScaleComponent';
1113
- /** @internal */
1114
- this.iconArray = [];
1115
- }
1116
- ngOnChanges(_changes) {
1117
- this.iconArray = this.createIconArray(this.numberOfColoredItems, this.numberOfItems, this.icon?.order || 'ASC');
1118
1133
  }
1119
1134
  createIconArray(items, totalItems, order) {
1120
1135
  const coloredItems = order === 'DESC' ? totalItems - items + 1 : items;
1121
1136
  return [...Array(totalItems).keys()].map((index) => index < coloredItems);
1122
1137
  }
1123
1138
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: IconScaleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1124
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: IconScaleComponent, isStandalone: true, selector: "lx-icon-scale", inputs: { icon: "icon", numberOfColoredItems: "numberOfColoredItems", numberOfItems: "numberOfItems" }, usesOnChanges: true, ngImport: i0, template: "@for (isColored of iconArray; track $index) {\n <span data-testid=\"icon-scale\" class=\"iconElement fas fa-{{ icon.type }}\" [style.color]=\"isColored ? icon.color : null\"> </span>\n}\n", styles: [".iconElement{color:#c2c9d6;width:15px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1139
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: IconScaleComponent, isStandalone: true, selector: "lx-icon-scale", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, numberOfColoredItems: { classPropertyName: "numberOfColoredItems", publicName: "numberOfColoredItems", isSignal: true, isRequired: false, transformFunction: null }, numberOfItems: { classPropertyName: "numberOfItems", publicName: "numberOfItems", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@for (isColored of iconArray(); track $index) {\n @if (isFontAwesomeIcon()) {\n <span data-testid=\"icon-scale\" class=\"faIconElement fas {{ iconName() }}\" [style.color]=\"isColored ? icon().color : null\"> </span>\n } @else {\n <ui5-icon data-testid=\"icon-scale\" class=\"iconElement\" [name]=\"iconName()\" [style.color]=\"isColored ? icon().color : null\" />\n }\n}\n", styles: [".iconElement{color:#c2c9d6;vertical-align:middle}.faIconElement{color:#c2c9d6;width:15px}\n"], dependencies: [{ kind: "component", type: IconComponent$1, selector: "ui5-icon", inputs: ["design", "name", "accessibleName", "showTooltip", "mode"], outputs: ["ui5Click"], exportAs: ["ui5Icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1125
1140
  }
1126
1141
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: IconScaleComponent, decorators: [{
1127
1142
  type: Component,
1128
- args: [{ selector: 'lx-icon-scale', changeDetection: ChangeDetectionStrategy.OnPush, template: "@for (isColored of iconArray; track $index) {\n <span data-testid=\"icon-scale\" class=\"iconElement fas fa-{{ icon.type }}\" [style.color]=\"isColored ? icon.color : null\"> </span>\n}\n", styles: [".iconElement{color:#c2c9d6;width:15px}\n"] }]
1129
- }], propDecorators: { icon: [{
1130
- type: Input
1131
- }], numberOfColoredItems: [{
1132
- type: Input
1133
- }], numberOfItems: [{
1134
- type: Input
1135
- }] } });
1143
+ args: [{ selector: 'lx-icon-scale', changeDetection: ChangeDetectionStrategy.OnPush, imports: [IconComponent$1], template: "@for (isColored of iconArray(); track $index) {\n @if (isFontAwesomeIcon()) {\n <span data-testid=\"icon-scale\" class=\"faIconElement fas {{ iconName() }}\" [style.color]=\"isColored ? icon().color : null\"> </span>\n } @else {\n <ui5-icon data-testid=\"icon-scale\" class=\"iconElement\" [name]=\"iconName()\" [style.color]=\"isColored ? icon().color : null\" />\n }\n}\n", styles: [".iconElement{color:#c2c9d6;vertical-align:middle}.faIconElement{color:#c2c9d6;width:15px}\n"] }]
1144
+ }] });
1136
1145
 
1137
1146
  /**
1138
1147
  * The following CSS classes should be used to style this component. The use of the inputs is deprecated.
@@ -2666,6 +2675,7 @@ class LxCoreUiModule {
2666
2675
  ButtonComponent,
2667
2676
  CollapsibleComponent,
2668
2677
  EllipsisComponent,
2678
+ IconScaleComponent,
2669
2679
  StepperComponent,
2670
2680
  TableHeaderComponent,
2671
2681
  EmptyStateComponent] }); }