Merge remote-tracking branch 'upstream/main'

This commit is contained in:
2026-08-26 09:31:34 +08:00
parent 9b8c4bfab6
commit 394eb0285d
34137 changed files with 3589424 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
var States = require("../States");
/**
* Stateful mixin for graphic object
*/
var Stateful = function (opts) {
if (opts.states) {
this.initStates(opts.states);
}
};
Stateful.prototype = {
initStates: function (states) {
this._states = new States({
el: this,
states: states
});
},
setState: function (name) {
this._states && this._states.setState(name);
},
getState: function () {
return this._states && this._states.getState();
},
transitionState: function (name, done) {
this._states && this._states.transitionState(name, done);
}
};
var _default = Stateful;
module.exports = _default;