File

projects/i-components/src/lib/components/xam-grid-settings/xam-grid-sorting.component.ts

Description

Placeholder for the sorting settings template object

Metadata

selector wm-xam-grid-sorting-settings
template
<ng-content></ng-content>
import { Component, Input } from '@angular/core';
import { SortDirection, SortingSettings } from '@mobilize/wms-framework';

/**
 * Placeholder for the sorting settings template object
 *
 * @export
 * @class XamGridSortingSettingsComponent
 */
@Component({
  selector: 'wm-xam-grid-sorting-settings',
  template: `<ng-content></ng-content>`,
})
export class XamGridSortingSettingsComponent {}

/**
 * Xam grid sorting settings as template
 *
 * @export
 * @class SortingSettingsComponent
 */
@Component({
  selector: 'wm-sorting-settings',
  template: ``,
})
export class SortingSettingsComponent {
  /**
   * Enables/disables sorting in the Xam grid.
   *
   * @type {boolean}
   * @memberof SortingSettingsComponent
   */
  @Input()
  get allowSorting(): boolean {
    return this.model.AllowSorting;
  }

  set allowSorting(value: boolean) {
    this.model.AllowSorting = value;
  }

  /**
   * Enables/disables multiple column sorting
   *
   * @type {boolean}
   * @memberof SortingSettingsComponent
   */
  @Input()
  get allowMultipleColumnSorting(): boolean {
    return this.model.AllowMultipleColumnSorting;
  }

  set allowMultipleColumnSorting(value: boolean) {
    this.model.AllowMultipleColumnSorting = value;
  }

  /**
   * Initial sort direction.
   *
   * TBD if we're gonna support this.
   *
   * @type {*}
   * @memberof SortingSettingsComponent
   */
  @Input()
  get firstSortDirection(): SortDirection {
    return this.model.FirstSortDirection;
  }

  set firstSortDirection(value: SortDirection) {
    this.model.FirstSortDirection = value;
  }

  /**
   * Sorting settings model.
   *
   * @memberof SortingSettingsComponent
   */
  public model = new SortingSettings();
}
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""