core/status-bar/status-bar.component.ts

Description

Outlet that renders the shell-level status bar shown above the page tabs and below the breadcrumbs. In a c8ycli app it is placed once on the bootstrap component.

Bars are added via StatusBarService (hookStatusBar) and content via StatusBarItemService (hookStatusBarItem).

Example

Metadata

Relationships

@let bar = activeBar();

<div class="c8y-status-bar__inner">
  @if (bar?.options; as options) {
    @let barIcon = options.icon;
    <span
      class="c8y-status-bar__icon"
      [class.c8y-status-bar__icon--stacked]="barIcon"
      aria-hidden="true"
      data-cy="c8y-status-bar--icon"
    >
      @if (barIcon) {
        <span class="c8y-status-bar__icon-status">
          <i
            class="stroked-icon"
            [c8yIcon]="themeIcons[theme()]"
          ></i>
        </span>
        <i
          class="c8y-status-bar__icon-base"
          [c8yIcon]="barIcon"
        ></i>
      } @else {
        <i
          class="c8y-status-bar__icon-status"
          [c8yIcon]="themeIcons[theme()]"
        ></i>
      }
    </span>
  }

  <div
    class="c8y-status-bar__main"
    [attr.role]="theme() === 'danger' ? 'alert' : 'status'"
  >
    @if (bar?.options; as options) {
      <span
        class="c8y-status-bar__state text-label-small l-h-1"
        data-cy="c8y-status-bar--state"
        >{{ options.label | translate }}</span
      >
    }
    <div class="d-flex a-i-center gap-8 min-width-0">
      @if (bar?.options; as options) {
        <span
          class="c8y-status-bar__message text-truncate"
          data-cy="c8y-status-bar--message"
          >{{ options.message | translate }}</span
        >
      }
      <ul class="d-flex a-i-center gap-8 m-0 list-unstyled">
        @for (item of leftItems(); track item) {
          <li [class]="item.options?.itemClass">
            <ng-container
              *c8yOutlet="item.component || item.template; injector: item.injector"
            ></ng-container>
          </li>
        }
      </ul>
    </div>
  </div>

  @let rightList = rightItems();
  @let moreList = moreItems();
  @if (rightList.length || moreList.length) {
    <ul class="c8y-status-bar__actions d-flex a-i-center gap-8 m-0 list-unstyled">
      @for (item of rightList; track item) {
        <li [class]="item.options?.itemClass">
          <ng-container
            *c8yOutlet="item.component || item.template; injector: item.injector"
          ></ng-container>
        </li>
      }

      @if (moreList.length === 1) {
        @let onlyMore = moreList[0];
        <li [class]="onlyMore.options?.itemClass">
          <ng-container
            *c8yOutlet="onlyMore.component || onlyMore.template; injector: onlyMore.injector"
          ></ng-container>
        </li>
      } @else if (moreList.length > 1) {
        <li
          class="c8y-status-bar__more dropdown"
          placement="bottom right"
          container="body"
          c8yDropdownFocusTrap
          dropdown
        >
          <button
            class="dropdown-toggle c8y-dropdown d-flex a-i-center"
            title="{{ 'More…' | translate }}"
            [attr.aria-label]="'More actions' | translate"
            aria-haspopup="true"
            type="button"
            dropdownToggle
          >
            <span
              class="text-truncate"
              translate
            >
              More…
            </span>
            <i
              [c8yIcon]="'caret-down'"
              aria-hidden="true"
            ></i>
          </button>
          <ul
            class="dropdown-menu dropdown-menu-right"
            *dropdownMenu
          >
            @for (item of moreList; track item) {
              <li [class]="item.options?.itemClass">
                <ng-container
                  *c8yOutlet="item.component || item.template; injector: item.injector"
                ></ng-container>
              </li>
            }
          </ul>
        </li>
      }
    </ul>
  }
</div>

results matching ""

    No results matching ""