File

core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.ts

Implements

ControlValueAccessor

Metadata

Index

Properties
Methods
Inputs

Inputs

disabledAggregations
Type : Partial<Record<aggregationType, boolean>>
Default value : {}

Configuration for disabling specific types of aggregation. By default no aggregation type is disabled.

Methods

markAsTouched
markAsTouched()
Returns : void
registerOnChange
registerOnChange(fn: any)
Parameters :
Name Type Optional
fn any No
Returns : void
registerOnTouched
registerOnTouched(onTouched: any)
Parameters :
Name Type Optional
onTouched any No
Returns : void
setDisabledState
setDisabledState(disabled: boolean)
Parameters :
Name Type Optional
disabled boolean No
Returns : void
writeValue
writeValue(value: aggregationType)
Parameters :
Name Type Optional
value aggregationType No
Returns : void

Properties

Readonly AGGREGATION_ICONS
Default value : AGGREGATION_ICONS
Readonly AGGREGATION_TEXTS
Default value : AGGREGATION_TEXTS
Readonly AGGREGATIONS
Default value : AGGREGATIONS
disabled
Default value : false
onChange
Default value : () => {...}
onTouched
Default value : () => {...}
touched
Default value : false
value
Type : aggregationType
<div
  class="dropdown"
  style="border: 0; margin-left: -1px"
  #dropdown="bs-dropdown"
  dropdown
  [insideClick]="true"
  [isDisabled]="disabled"
>
  <button
    class="dropdown-toggle form-control p-t-0 p-b-0 l-h-1 d-flex a-i-center"
    [attr.aria-label]="(value ? AGGREGATION_TEXTS[value] : AGGREGATION_TEXTS.undefined) | translate"
    tooltip="{{
      (value
        ? AGGREGATION_TEXTS[value]
        : disabled
          ? AGGREGATION_TEXTS.disabled
          : AGGREGATION_TEXTS.undefined
      ) | translate
    }}"
    placement="top"
    container="body"
    type="button"
    [adaptivePosition]="false"
    [delay]="500"
    dropdownToggle
  >
    <i
      class="icon-14"
      [c8yIcon]="value ? AGGREGATION_ICONS[value] : AGGREGATION_ICONS.undefined"
    ></i>
    <span class="caret m-r-8 m-l-4"></span>
  </button>

  <ul
    class="dropdown-menu dropdown-menu-right--xs"
    *dropdownMenu
  >
    <li
      *ngFor="let aggregation of AGGREGATIONS"
      [ngClass]="{
        active: aggregation.id === value,
        disabled: disabledAggregations[aggregation.id]
      }"
    >
      <button
        class=""
        (click)="onChange(aggregation.id); dropdown.isOpen = false"
        [disabled]="disabledAggregations[aggregation.id]"
      >
        <i
          class="icon-14"
          [c8yIcon]="
            aggregation.id ? AGGREGATION_ICONS[aggregation.id] : AGGREGATION_ICONS.undefined
          "
        ></i>
        <span>{{ aggregation.title | translate }}</span>
      </button>
    </li>
  </ul>
</div>

results matching ""

    No results matching ""