igniteui-react-inputs
Version:
Ignite UI React input components.
353 lines (352 loc) • 10.6 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends } from "tslib";
import { Base, INotifyPropertyChanged_$type, PropertyChangedEventArgs, enumGetBox, markType } from "igniteui-react-core";
import { MultiSliderThumbRangePosition_$type } from "./MultiSliderThumbRangePosition";
import { PropertyUpdatedEventArgs } from "igniteui-react-core";
/**
* @hidden
*/
var MultiSliderThumb = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(MultiSliderThumb, _super);
function MultiSliderThumb() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.m = 0;
_this.o = 0;
_this.f = 1;
_this.h = null;
_this.d = null;
_this.l = 0;
_this.n = 0;
_this.j = false;
_this.k = false;
_this.propertyUpdated = null;
_this.propertyChanged = null;
_this.c = null;
_this.b = null;
return _this;
}
Object.defineProperty(MultiSliderThumb.prototype, "e", {
get: function () {
return this.d;
},
set: function (a) {
var b = this.d;
this.d = a;
if (b != this.d) {
this.u("Owner", b, this.d);
}
},
enumerable: false,
configurable: true
});
MultiSliderThumb.prototype.u = function (a, b, c) {
this.v(a, b, c);
if (this.propertyUpdated != null) {
this.propertyUpdated(this, new PropertyUpdatedEventArgs(a, b, c));
}
if (this.propertyChanged != null) {
this.propertyChanged(this, new PropertyChangedEventArgs(a));
}
};
MultiSliderThumb.prototype.v = function (a, b, c) {
if (this.e != null) {
if (a == "Position") {
this.j = true;
this.p = this.e.updateActualPosition(b, c);
if (!this.k) {
this.s = this.e.updateThumbValue(this.p);
}
this.j = false;
}
if (a == "Value") {
this.k = true;
if (!this.j) {
this.q = this.e.updateThumbPosition(this.s);
this.p = this.e.updateActualPosition(this.q, this.q);
}
this.e.onThumbValueUpdated(this, b, c);
this.k = false;
}
}
this.t();
};
MultiSliderThumb.prototype.r = function (a) {
if (this.q + a > 1) {
a = 1 - this.q;
}
if (this.q + a < 0) {
a = -this.q;
}
if (this.i != null) {
if (this.g == 0) {
a = this.i.q(a);
}
else {
a = this.i.p(a);
}
}
this.q += a;
return a;
};
MultiSliderThumb.prototype.t = function () {
if (this.e == null) {
return;
}
this.e.trackDirty();
};
Object.defineProperty(MultiSliderThumb.prototype, "q", {
get: function () {
return this.m;
},
set: function (a) {
var b = this.m;
this.m = a;
if (b != this.m) {
this.u("Position", b, this.m);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(MultiSliderThumb.prototype, "p", {
get: function () {
return this.l;
},
set: function (a) {
var b = this.l;
this.l = a;
if (b != this.l) {
this.u("ActualPosition", b, this.l);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(MultiSliderThumb.prototype, "s", {
get: function () {
return this.n;
},
set: function (a) {
var b = this.n;
this.n = a;
if (b != this.n) {
this.u("Value", b, this.n);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(MultiSliderThumb.prototype, "g", {
get: function () {
return this.f;
},
set: function (a) {
var b = this.f;
this.f = a;
if (b != this.f) {
this.u("RangePosition", enumGetBox(MultiSliderThumbRangePosition_$type, b), enumGetBox(MultiSliderThumbRangePosition_$type, this.f));
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(MultiSliderThumb.prototype, "i", {
get: function () {
return this.h;
},
set: function (a) {
var b = this.h;
this.h = a;
if (b != this.h) {
this.u("Range", b, this.h);
}
},
enumerable: false,
configurable: true
});
MultiSliderThumb.$t = markType(MultiSliderThumb, 'MultiSliderThumb', Base.$, [INotifyPropertyChanged_$type]);
return MultiSliderThumb;
}(Base));
export { MultiSliderThumb };
/**
* @hidden
*/
var MultiSliderTrackThumbRange = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(MultiSliderTrackThumbRange, _super);
function MultiSliderTrackThumbRange() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.i = 0;
_this.j = 0;
_this.h = 0;
_this.g = 1;
_this.d = null;
_this.c = null;
_this.a = null;
_this.propertyChanged = null;
return _this;
}
MultiSliderTrackThumbRange.prototype.t = function (a, b, c) {
this.u(a, b, c);
if (this.propertyChanged != null) {
this.propertyChanged(this, new PropertyChangedEventArgs(a));
}
};
MultiSliderTrackThumbRange.prototype.u = function (a, b, c) {
this.s();
};
MultiSliderTrackThumbRange.prototype.s = function () {
if (this.b == null) {
return;
}
this.b.trackDirty();
};
Object.defineProperty(MultiSliderTrackThumbRange.prototype, "b", {
get: function () {
return this.a;
},
set: function (a) {
var b = this.a;
this.a = a;
if (b != this.a) {
this.t("Owner", b, this.a);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(MultiSliderTrackThumbRange.prototype, "n", {
get: function () {
return this.i;
},
set: function (a) {
var b = this.i;
this.i = a;
if (b != this.i) {
this.t("Position", b, this.i);
}
},
enumerable: false,
configurable: true
});
MultiSliderTrackThumbRange.prototype.o = function (a) {
if (a > 0 && this.n + (this.r / 2) + a > 1) {
a = 1 - (this.n + (this.r / 2));
}
if (a < 0 && (this.n - (this.r / 2)) + a < 0) {
a = (this.n - (this.r / 2)) * -1;
}
this.f.q += a;
this.e.q += a;
this.n += a;
return a;
};
MultiSliderTrackThumbRange.prototype.p = function (a) {
a = this.k(a);
var b = this.n - this.r / 2;
this.r += a;
this.n = b + this.r / 2;
return a;
};
MultiSliderTrackThumbRange.prototype.k = function (a) {
if (a < 0) {
var b = this.r + a;
if (b < this.m) {
b = this.m;
a = (b - this.r);
}
}
if (a > 0) {
var c = this.r + a;
if (c > this.l) {
c = this.l;
a = (c - this.r);
}
}
return a;
};
MultiSliderTrackThumbRange.prototype.q = function (a) {
a = -1 * this.k(a * -1);
var b = this.n + this.r / 2;
this.r -= a;
this.n = b - this.r / 2;
return a;
};
Object.defineProperty(MultiSliderTrackThumbRange.prototype, "r", {
get: function () {
return this.j;
},
set: function (a) {
var b = this.j;
this.j = a;
if (b != this.j) {
this.t("Width", b, this.j);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(MultiSliderTrackThumbRange.prototype, "m", {
get: function () {
return this.h;
},
set: function (a) {
var b = this.h;
this.h = a;
if (b != this.h) {
this.t("MinWidth", b, this.h);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(MultiSliderTrackThumbRange.prototype, "l", {
get: function () {
return this.g;
},
set: function (a) {
var b = this.g;
this.g = a;
if (b != this.g) {
this.t("MaxWidth", b, this.g);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(MultiSliderTrackThumbRange.prototype, "f", {
get: function () {
return this.d;
},
set: function (a) {
var b = this.d;
this.d = a;
if (b != this.d) {
this.t("LowerThumb", b, this.d);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(MultiSliderTrackThumbRange.prototype, "e", {
get: function () {
return this.c;
},
set: function (a) {
var b = this.c;
this.c = a;
if (b != this.c) {
this.t("HigherThumb", b, this.c);
}
},
enumerable: false,
configurable: true
});
MultiSliderTrackThumbRange.$t = markType(MultiSliderTrackThumbRange, 'MultiSliderTrackThumbRange', Base.$, [INotifyPropertyChanged_$type]);
return MultiSliderTrackThumbRange;
}(Base));
export { MultiSliderTrackThumbRange };