1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- "use strict";
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
- var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
- var _emit = _interopRequireDefault(require("./graphic/event/emit"));
- function _createSuper(Derived) { return function () { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
- var Util = require('./util/common');
- var Base = /*#__PURE__*/function (_Emit) {
- (0, _inheritsLoose2["default"])(Base, _Emit);
- var _super = _createSuper(Base);
- var _proto = Base.prototype;
- _proto.getDefaultCfg = function getDefaultCfg() {
- return {};
- };
- function Base(cfg) {
- var _this;
- _this = _Emit.call(this) || this;
- var attrs = {};
- var defaultCfg = _this.getDefaultCfg();
- _this._attrs = attrs;
- Util.mix(attrs, defaultCfg, cfg);
- return _this;
- }
- _proto.get = function get(name) {
- return this._attrs[name];
- };
- _proto.set = function set(name, value) {
- this._attrs[name] = value;
- };
- _proto.destroy = function destroy() {
- this._attrs = {};
- this.destroyed = true;
- };
- return Base;
- }(_emit["default"]);
- module.exports = Base;
|