|
@@ -1494,6 +1494,9 @@ var splide_Splide = /*#__PURE__*/function () {
|
|
this._o = merge(DEFAULTS, options);
|
|
this._o = merge(DEFAULTS, options);
|
|
this._i = 0;
|
|
this._i = 0;
|
|
this._c = Components;
|
|
this._c = Components;
|
|
|
|
+ this._e = {}; // Extensions
|
|
|
|
+
|
|
|
|
+ this._t = null; // Transition
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
* Compose and mount components.
|
|
* Compose and mount components.
|
|
@@ -1501,7 +1504,7 @@ var splide_Splide = /*#__PURE__*/function () {
|
|
* @param {Object} Extensions - Optional. Additional components.
|
|
* @param {Object} Extensions - Optional. Additional components.
|
|
* @param {function} Transition - Optional. Set a custom transition component.
|
|
* @param {function} Transition - Optional. Set a custom transition component.
|
|
*
|
|
*
|
|
- * @return {Splide|null} - This instance or null if an exception occurred.
|
|
|
|
|
|
+ * @return {Splide|undefined} - This instance or undefined if an exception occurred.
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
@@ -1511,14 +1514,16 @@ var splide_Splide = /*#__PURE__*/function () {
|
|
var _this = this;
|
|
var _this = this;
|
|
|
|
|
|
if (Extensions === void 0) {
|
|
if (Extensions === void 0) {
|
|
- Extensions = {};
|
|
|
|
|
|
+ Extensions = this._e;
|
|
}
|
|
}
|
|
|
|
|
|
if (Transition === void 0) {
|
|
if (Transition === void 0) {
|
|
- Transition = null;
|
|
|
|
|
|
+ Transition = this._t;
|
|
}
|
|
}
|
|
|
|
|
|
- this.Components = this.Components || compose(this, merge(this._c, Extensions), Transition);
|
|
|
|
|
|
+ this._e = Extensions;
|
|
|
|
+ this._t = Transition;
|
|
|
|
+ this.Components = compose(this, merge(this._c, Extensions), Transition);
|
|
|
|
|
|
try {
|
|
try {
|
|
each(this.Components, function (component, key) {
|
|
each(this.Components, function (component, key) {
|
|
@@ -1532,23 +1537,24 @@ var splide_Splide = /*#__PURE__*/function () {
|
|
});
|
|
});
|
|
} catch (e) {
|
|
} catch (e) {
|
|
error_error(e.message);
|
|
error_error(e.message);
|
|
- return null;
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
|
|
- this.State.set(MOUNTED);
|
|
|
|
|
|
+ var State = this.State;
|
|
|
|
+ State.set(MOUNTED);
|
|
each(this.Components, function (component) {
|
|
each(this.Components, function (component) {
|
|
component.mounted && component.mounted();
|
|
component.mounted && component.mounted();
|
|
});
|
|
});
|
|
this.emit('mounted');
|
|
this.emit('mounted');
|
|
- this.State.set(IDLE);
|
|
|
|
|
|
+ State.set(IDLE);
|
|
this.emit('ready');
|
|
this.emit('ready');
|
|
applyStyle(this.root, {
|
|
applyStyle(this.root, {
|
|
visibility: 'visible'
|
|
visibility: 'visible'
|
|
});
|
|
});
|
|
this.on('move drag', function () {
|
|
this.on('move drag', function () {
|
|
- return _this.State.set(MOVING);
|
|
|
|
|
|
+ return State.set(MOVING);
|
|
}).on('moved dragged', function () {
|
|
}).on('moved dragged', function () {
|
|
- return _this.State.set(IDLE);
|
|
|
|
|
|
+ return State.set(IDLE);
|
|
});
|
|
});
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|