Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components-dev/app-switcher/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { DevThemeToggle } from '../theme-toggle';
template: `
<app-switcher-overview-example />
<br />
<br />
<app-switcher-sites-example />
`,
changeDetection: ChangeDetectionStrategy.OnPush
Expand Down
2 changes: 2 additions & 0 deletions packages/components-dev/app-switcher/template.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<dev-theme-toggle />
<br />
<br />

<dev-examples />

Expand Down
11 changes: 9 additions & 2 deletions packages/components/app-switcher/app-switcher-dropdown-app.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { NgOptimizedImage } from '@angular/common';
import { ChangeDetectionStrategy, Component, inject, Input, ViewEncapsulation } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { KBQ_TITLE_TEXT_REF } from '@koobiq/components/core';
Expand All @@ -8,10 +9,16 @@ import { KbqAppSwitcherApp } from './app-switcher';
/** @docs-private */
@Component({
selector: '[kbq-app-switcher-dropdown-app]',
imports: [KbqIcon],
imports: [KbqIcon, NgOptimizedImage],
template: `
<i class="kbq kbq-icon" [className]=""></i>
<span class="kbq-app-switcher-dropdown-app__icon" [innerHtml]="getIcon(app.icon)"></span>
@if (app.icon) {
<span class="kbq-app-switcher-dropdown-app__icon" [innerHtml]="getIcon(app.icon)"></span>
} @else if (app.iconSrc) {
<span class="kbq-app-switcher-dropdown-app__icon">
<img alt="{{ app.type }}" width="24" height="24" [ngSrc]="app.iconSrc" />
</span>
}

<div class="kbq-app-switcher-dropdown-app__container">
<div class="kbq-app-switcher-dropdown-app__name">
Expand Down
9 changes: 8 additions & 1 deletion packages/components/app-switcher/app-switcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ export interface KbqAppSwitcherApp {
name: string;
id: string | number;
type?: string | number;
icon: string;
/** Inline SVG markup for the application icon. Use this for SVG icons that should be rendered directly in the DOM. */
icon?: string;
/** Path to the icon file (URL or relative path). */
iconSrc?: string;
caption?: string;
aliases?: KbqAppSwitcherApp[];
link?: string;
Expand All @@ -70,7 +73,10 @@ export interface KbqAppSwitcherSite {
name: string;
id: string | number;
status?: string;
/** Inline SVG markup for the site icon. Use this for SVG icons that should be rendered directly in the DOM. */
icon?: string;
/** Path to the icon file (URL or relative path). */
iconSrc?: string;
apps: KbqAppSwitcherApp[];
}

Expand All @@ -92,6 +98,7 @@ export function defaultGroupBy(
name: appType,
aliases: [app],
icon: app.icon,
iconSrc: app.iconSrc,
id: ''
};
}
Expand Down
14 changes: 11 additions & 3 deletions packages/components/app-switcher/kbq-app-switcher-list-item.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
import { NgOptimizedImage } from '@angular/common';
import { booleanAttribute, ChangeDetectionStrategy, Component, inject, Input, ViewEncapsulation } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { KBQ_TITLE_TEXT_REF } from '@koobiq/components/core';
import { KbqDropdownItem } from '@koobiq/components/dropdown';
import { KbqIcon } from '@koobiq/components/icon';
import { KbqIconModule } from '@koobiq/components/icon';
import { KbqAppSwitcherApp } from './app-switcher';

/** @docs-private */
@Component({
selector: '[kbq-app-switcher-list-item]',
imports: [
KbqIcon
KbqIconModule,
NgOptimizedImage
],
template: `
<span class="kbq-app-switcher-list-item__icon" [innerHtml]="getIcon(app.icon)"></span>
@if (app.icon) {
<span class="kbq-app-switcher-list-item__icon" [innerHtml]="getIcon(app.icon)"></span>
} @else if (app.iconSrc) {
<span class="kbq-app-switcher-list-item__icon">
<img alt="{{ app.type }}" width="24" height="24" [ngSrc]="app.iconSrc" />
</span>
}

<div class="kbq-app-switcher-list-item__container">
<div class="kbq-app-switcher-list-item__name">{{ app.name }}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ export class AppSwitcherOverviewExample {
name: 'Byte Sentinel',
caption: 'Byte 001',
id: 'SZFO_01',
icon: this.SVGIcon
iconSrc: 'https://koobiq.io/assets/images/favicons/icon.svg'
},
{
name: 'CryptoWall',
id: 'SZFO_02',
icon: this.SVGIcon
iconSrc: 'https://koobiq.io/assets/images/favicons/icon.svg'
},
{
name: 'App Instance 1',
caption: 'Instance Alias One',
id: 'SZFO_03',
icon: this.SVGIcon
iconSrc: 'https://koobiq.io/assets/images/favicons/icon.svg'
},
{
name: 'App Instance 2',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class AppSwitcherSitesExample {
caption: 'Byte 001',
id: 'SZFO_01',
type: 'NAD',
icon: this.SVGIcon
iconSrc: 'https://koobiq.io/assets/images/favicons/icon.svg'
},
{
name: 'CryptoWall',
Expand Down Expand Up @@ -110,7 +110,7 @@ export class AppSwitcherSitesExample {
caption: 'Byte 001',
id: 'UFO_01',
type: 'SIEM',
icon: this.SVGIcon
iconSrc: 'https://koobiq.io/assets/images/favicons/icon.svg'
},
{
name: 'CryptoWall',
Expand Down
6 changes: 3 additions & 3 deletions tools/public_api_guard/components/app-switcher.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export interface KbqAppSwitcherApp {
aliases?: KbqAppSwitcherApp[];
// (undocumented)
caption?: string;
// (undocumented)
icon: string;
icon?: string;
iconSrc?: string;
// (undocumented)
id: string | number;
// (undocumented)
Expand Down Expand Up @@ -178,8 +178,8 @@ export function kbqAppSwitcherScrollStrategyFactory(overlay: Overlay): () => Scr
export interface KbqAppSwitcherSite {
// (undocumented)
apps: KbqAppSwitcherApp[];
// (undocumented)
icon?: string;
iconSrc?: string;
// (undocumented)
id: string | number;
// (undocumented)
Expand Down