File

core/list-display-switch/list-display-switch.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods
Inputs
Outputs
Accessors

Constructor

constructor(location: Location)
Parameters :
Name Type Optional
location Location No

Inputs

filterPipe
Type : any
Default value : pipe(tap())
listKey
Type : string
listLength
Type : number

Outputs

onListClassChange
Type : EventEmitter<string>

Methods

ngOnInit
ngOnInit()
Returns : void
onOptionSelect
onOptionSelect(option: DisplayOption)
Parameters :
Name Type Optional
option DisplayOption No
Returns : void

Properties

Readonly DISPLAY_OPTIONS
Type : DisplayOption[]
Default value : [ { name: 'AUTO', value: 'auto', label: gettext('Auto'), default: true, getListClass: () => { const option = this._listLength > this.AUTO_GRID_ITEMS_LIMIT ? this.DISPLAY_OPTIONS.find(opt => opt.name === 'LIST') : this.DISPLAY_OPTIONS.find(opt => opt.name === 'GRID'); return option.getListClass(); } }, { name: 'GRID', value: 'grid', label: gettext('Grid'), getListClass: () => 'interact-grid' }, { name: 'LIST', value: 'list', label: gettext('List'), getListClass: () => 'interact-list' } ]
selectedOption
Type : DisplayOption

Accessors

listLength
setlistLength(val: number)
Parameters :
Name Type Optional
val number No
Returns : void
<div class="form-group">
  <label class="m-r-8" id="listLabel">
    {{ 'Display as' | translate }}
  </label>
  <div class="c8y-select-wrapper">
    <select
      aria-labelledby="listLabel"
      name="listLabel"
      class="form-control"
      [ngModel]="selectedOption"
      (ngModelChange)="onOptionSelect($event)"
      [attr.aria-label]="'Display mode' | translate"
    >
      <option *ngFor="let option of DISPLAY_OPTIONS" [ngValue]="option">
        {{ option.label | translate }}
      </option>
    </select>
    <span></span>
  </div>
</div>

results matching ""

    No results matching ""