12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import { __awaiter, __generator } from "tslib";
- import { Component, triggerEvent, triggerEventOnly } from '../_util/simply';
- import { GuideTourDefaultProps } from './props';
- import mixinValue from '../mixins/value';
- Component(GuideTourDefaultProps, {
- onNext: function () {
- return __awaiter(this, void 0, void 0, function () {
- var currentValue, newCurrent;
- return __generator(this, function (_a) {
- currentValue = this.getValue();
- newCurrent = currentValue + 1;
- if (!this.isControlled()) {
- this.update(newCurrent);
- }
- triggerEvent(this, 'change', newCurrent);
- return [2 /*return*/];
- });
- });
- },
- onPrev: function () {
- return __awaiter(this, void 0, void 0, function () {
- var currentValue, newCurrent;
- return __generator(this, function (_a) {
- currentValue = this.getValue();
- newCurrent = currentValue - 1;
- if (!this.isControlled()) {
- this.update(newCurrent);
- }
- triggerEvent(this, 'change', newCurrent);
- return [2 /*return*/];
- });
- });
- },
- onCancel: function () {
- triggerEventOnly(this, 'cancel');
- },
- onSwiperChange: function (e) {
- return __awaiter(this, void 0, void 0, function () {
- var current;
- return __generator(this, function (_a) {
- current = e.detail.current;
- if (!this.isControlled()) {
- this.update(current);
- }
- triggerEvent(this, 'change', current);
- return [2 /*return*/];
- });
- });
- },
- }, undefined, [
- mixinValue({
- valueKey: 'current',
- defaultValueKey: 'defaultCurrent',
- }),
- ]);
|