Repository URL to install this package:
|
Version:
2.6.18 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const tslib_1 = require("tslib");
const mobx_1 = require("xmobx/mobx");
class GalleryState {
constructor() {
this.startSlideIndex = 0;
this.totalSlidesCount = 0;
this.currentSlideIndex = this.startSlideIndex;
}
onChange(args) {// to each slide change we need trigger this one
}
handlePrevClick(args) {
if (this.currentSlideIndex > 0 && this.currentSlideIndex < this.totalSlidesCount) {
this.currentSlideIndex -= 1;
} // this.onChange(props)
}
handleNextClick(args) {
if (this.currentSlideIndex < this.totalSlidesCount) {
this.currentSlideIndex += 1;
} // this.onChange(props)
}
handleBulletClick(args) {
/**
* @todo need to get the bullet index
*/
// this.currentSlideIndex = bullet_idx
// this.onChange(props)
}
}
tslib_1.__decorate([mobx_1.observable], GalleryState.prototype, "startSlideIndex", void 0);
tslib_1.__decorate([mobx_1.observable], GalleryState.prototype, "totalSlidesCount", void 0);
tslib_1.__decorate([mobx_1.observable], GalleryState.prototype, "currentSlideIndex", void 0);
tslib_1.__decorate([mobx_1.action.bound], GalleryState.prototype, "onChange", null);
tslib_1.__decorate([mobx_1.action.bound], GalleryState.prototype, "handlePrevClick", null);
tslib_1.__decorate([mobx_1.action.bound], GalleryState.prototype, "handleNextClick", null);
tslib_1.__decorate([mobx_1.action.bound], GalleryState.prototype, "handleBulletClick", null);
exports.GalleryState = GalleryState;
exports.default = GalleryState; //# sourceMappingURL=State.js.map