UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

65 lines (63 loc) 1.8 kB
import { ListSortDirection_$type } from "./ListSortDirection"; import { DataSourceSortDescription as DataSourceSortDescription_internal } from "./DataSourceSortDescription"; import { ensureEnum } from "./componentUtil"; export class IgxDataSourceSortDescription { constructor() { this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } createImplementation() { return new DataSourceSortDescription_internal(0); } /** * @hidden */ get i() { return this._implementation; } onImplementationCreated() { } _provideImplementation(i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); } /** * Gets or sets the property being sorted. */ get field() { return this.i.f; } set field(v) { this.i.f = v; } /** * Gets or sets the direction to sort based on the property. */ get sortDirection() { return this.i.c; } set sortDirection(v) { this.i.c = ensureEnum(ListSortDirection_$type, v); } findByName(name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } return null; } /** * Returns if the SortDescription is equal to another. * @param other * The SortDescription to compare to. */ equals(other) { let iv = this.i.equals(other); return (iv); } }