igniteui-react-grids
Version:
Ignite UI React grid components.
75 lines (73 loc) • 2.11 kB
JavaScript
import { ListSortDirection_$type } from "igniteui-react-core";
import { ColumnSortDescription as ColumnSortDescription_internal } from "./ColumnSortDescription";
import { ensureEnum } from "igniteui-react-core";
/**
* Represents an element in the current sort applied to a data source or provider. Changes to this object are not observed or expected after it is initially assigned to a collection.
*/
export class IgrColumnSortDescription {
createImplementation() {
return new ColumnSortDescription_internal(0);
}
get nativeElement() {
return this._implementation.nativeElement;
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
onImplementationCreated() {
}
constructor() {
this.mounted = false;
this._implementation = this.createImplementation();
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
}
_provideImplementation(i) {
this._implementation = i;
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
}
/**
* 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);
}
}