diff --git a/dist/vuec.js b/dist/vuec.js index 4f91eea..826b762 100644 --- a/dist/vuec.js +++ b/dist/vuec.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vuec=t():e.vuec=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null,n=this.parameters(e);return e.bind.apply(e,[t].concat(r(n)))}}]),e}();t.default=u},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var i=n.parameters(o[o.length-1]),u=o[o.length-1];o[o.length-1]=function(){u.call.apply(u,[this].concat(r(i)))}}},a=function(e,t){void 0!==e.$options.services&&e.$options.services.forEach(function(n){e.$services[n]=t.resolve(n)})},c=new i.default;t.default={production:!0,install:function(e){e.prototype.$services=[],e.prototype.$ioc=c,e.$ioc=c,e.mixin({beforeCreate:function(){a(this,c),u(this,"created",c),u(this,"beforeMount",c),u(this,"mounted",c),u(this,"beforeUpdate",c),u(this,"updated",c),u(this,"beforeDestroy",c),u(this,"destroyed",c)}})}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Container=void 0;var o=n(0);Object.defineProperty(t,"Container",{enumerable:!0,get:function(){return r(o).default}});var i=n(1),u=r(i);t.default=u.default}])}); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vuec=t():e.vuec=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=2)}([function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null,n=this.parameters(e);return e.bind.apply(e,[t].concat(r(n)))}}]),e}();t.default=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var i=n.parameters(r[r.length-1]),u=r[r.length-1];r[r.length-1]=function(){u.call.apply(u,[this].concat(o(i)))}}},c=function(e,t){void 0!==e.$options.services&&e.$options.services.forEach(function(n){e.$services[n]=t.resolve(n)})},f=new u.default;t.default={production:1,install:function(e){e.prototype.$services=[],e.prototype.$ioc=f,e.$ioc=f,e.mixin({beforeCreate:function(){c(this,f),a(this,"created",f),a(this,"beforeMount",f),a(this,"mounted",f),a(this,"beforeUpdate",f),a(this,"updated",f),a(this,"beforeDestroy",f),a(this,"destroyed",f)}})}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Container=void 0;var o=n(0);Object.defineProperty(t,"Container",{enumerable:!0,get:function(){return r(o).default}});var i=n(1),u=r(i);t.default=u.default}])}); //# sourceMappingURL=vuec.js.map \ No newline at end of file diff --git a/dist/vuec.js.map b/dist/vuec.js.map index 9d9e39b..a65acfb 100644 --- a/dist/vuec.js.map +++ b/dist/vuec.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///vuec.js","webpack:///webpack/bootstrap eff007853d09751e7ab6","webpack:///./src/Container.js","webpack:///./src/Vue.js","webpack:///./src/index.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","_toConsumableArray","arr","Array","isArray","arr2","length","from","_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","props","descriptor","writable","key","protoProps","staticProps","Container","$cache","Map","production","Boolean","set","has","delete","entries","Error","func","extracted","toString","match","console","warn","bind","self","undefined","replace","split","filter","dep","map","resolve","arguments","params","parameters","apply","concat","default","_Container","_Container2","obj","patchHook","$vm","hookName","container","hooks","$options","hook","injectServices","services","forEach","service","$services","install","Vue","$ioc","mixin","beforeCreate","_interopRequireDefault","_Vue","_Vue2"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,KAAAD,IAEAD,EAAA,KAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,GAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KA+DA,OAnCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAG,EAAA,SAAAK,GAA2C,MAAAA,IAG3CR,EAAAS,EAAA,SAAAf,EAAAgB,EAAAC,GACAX,EAAAY,E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,EAAQD,EAASM,GAEjC,YAqBA,SAASiG,GAAuBlB,GAAO,MAAOA,IAAOA,EAAI5D,WAAa4D,GAAQH,QAASG,GAlBvFlE,OAAOC,eAAepB,EAAS,cAC7Bc,OAAO,IAETd,EAAQoD,cAAYkB,EAEpB,IAAIa,GAAa7E,EAAoB,EAErCa,QAAOC,eAAepB,EAAS,aAC7BsB,YAAY,EACZC,IAAK,WACH,MAAOgF,GAAuBpB,GIrPzBD,UADT,IAAAsB,GAAAlG,EAAA,GJ4PImG,EAAQF,EAAuBC,EAInCxG,GAAQkF,QAAUuB,EAAMvB","file":"vuec.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"vuec\"] = factory();\n\telse\n\t\troot[\"vuec\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"vuec\"] = factory();\n\telse\n\t\troot[\"vuec\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Container = function () {\n\tfunction Container() {\n\t\t_classCallCheck(this, Container);\n\n\t\tthis.$cache = new Map();\n\t\tthis.production = Boolean(\"production\" === 'production');\n\t}\n\n\t_createClass(Container, [{\n\t\tkey: 'register',\n\t\tvalue: function register(name, value) {\n\t\t\tthis.$cache.set(name, value);\n\t\t}\n\t}, {\n\t\tkey: 'unregister',\n\t\tvalue: function unregister(name) {\n\t\t\tif (this.$cache.has(name)) {\n\t\t\t\tthis.$cache.delete(name);\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'has',\n\t\tvalue: function has(name) {\n\t\t\treturn this.$cache.has(name);\n\t\t}\n\t}, {\n\t\tkey: 'bindings',\n\t\tvalue: function bindings() {\n\t\t\treturn this.$cache.entries();\n\t\t}\n\t}, {\n\t\tkey: 'resolve',\n\t\tvalue: function resolve(name) {\n\t\t\tif (this.$cache.has(name)) {\n\t\t\t\treturn this.$cache.get(name);\n\t\t\t}\n\n\t\t\tif (this.production) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tthrow new Error('Unknown dependency \"' + name + '\"');\n\t\t}\n\t}, {\n\t\tkey: 'parameters',\n\t\tvalue: function parameters(func) {\n\t\t\tvar extracted = func.toString().match(/^(function)?\\s*[^(]*\\(\\s*([^)]*)\\)?/m);\n\t\t\tif (extracted === null) {\n\t\t\t\tconsole.warn('Extraction failed for ' + func.name);\n\t\t\t\treturn func.bind(self);\n\t\t\t}\n\n\t\t\tvar es6Mode = extracted[1] === 'function' || extracted[1] === undefined;\n\n\t\t\treturn (es6Mode ? extracted[2] : extracted[1]).replace(/ /g, '').split(',').filter(function (dep) {\n\t\t\t\treturn dep !== '';\n\t\t\t}).map(this.resolve.bind(this));\n\t\t}\n\t}, {\n\t\tkey: 'prepare',\n\t\tvalue: function prepare(func) {\n\t\t\tvar self = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n\t\t\tvar params = this.parameters(func);\n\n\t\t\treturn func.bind.apply(func, [self].concat(_toConsumableArray(params)));\n\t\t}\n\t}]);\n\n\treturn Container;\n}();\n\nexports.default = Container;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\nvar _Container = __webpack_require__(0);\n\nvar _Container2 = _interopRequireDefault(_Container);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar patchHook = function patchHook($vm, hookName, container) {\n\tvar hooks = $vm.$options[hookName];\n\tif (hooks && hooks.length > 0) {\n\t\tvar params = container.parameters(hooks[hooks.length - 1]);\n\t\tvar hook = hooks[hooks.length - 1];\n\t\thooks[hooks.length - 1] = function () {\n\t\t\thook.call.apply(hook, [this].concat(_toConsumableArray(params)));\n\t\t};\n\t}\n};\n\nvar injectServices = function injectServices($vm, container) {\n\tif ($vm.$options.services !== undefined) {\n\t\t$vm.$options.services.forEach(function (service) {\n\t\t\t$vm.$services[service] = container.resolve(service);\n\t\t});\n\t}\n};\n\nvar container = new _Container2.default(); // eslint-disable-line\nexports.default = {\n\tproduction: \"production\" === 'production',\n\tinstall: function install(Vue) {\n\t\tVue.prototype.$services = [];\n\t\tVue.prototype.$ioc = container;\n\t\tVue.$ioc = container;\n\t\tVue.mixin({\n\t\t\tbeforeCreate: function beforeCreate() {\n\t\t\t\tinjectServices(this, container);\n\t\t\t\tpatchHook(this, 'created', container);\n\t\t\t\tpatchHook(this, 'beforeMount', container);\n\t\t\t\tpatchHook(this, 'mounted', container);\n\t\t\t\tpatchHook(this, 'beforeUpdate', container);\n\t\t\t\tpatchHook(this, 'updated', container);\n\t\t\t\tpatchHook(this, 'beforeDestroy', container);\n\t\t\t\tpatchHook(this, 'destroyed', container);\n\t\t\t}\n\t\t});\n\t}\n};\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Container = undefined;\n\nvar _Container = __webpack_require__(0);\n\nObject.defineProperty(exports, 'Container', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Container).default;\n }\n});\n\nvar _Vue = __webpack_require__(1);\n\nvar _Vue2 = _interopRequireDefault(_Vue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _Vue2.default;\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// vuec.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap eff007853d09751e7ab6","export default class Container {\n\tconstructor() {\n\t\tthis.$cache = new Map();\n\t\tthis.production = Boolean(process.env.NODE_ENV === 'production');\n\t}\n\n\tregister(name, value) {\n\t\tthis.$cache.set(name, value);\n\t}\n\n\tunregister(name) {\n\t\tif (this.$cache.has(name)) {\n\t\t\tthis.$cache.delete(name);\n\t\t}\n\t}\n\n\thas(name) {\n\t\treturn this.$cache.has(name);\n\t}\n\n\tbindings() {\n\t\treturn this.$cache.entries();\n\t}\n\n\tresolve(name) {\n\t\tif (this.$cache.has(name)) {\n\t\t\treturn this.$cache.get(name);\n\t\t}\n\n\t\tif (this.production) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthrow new Error(`Unknown dependency \"${name}\"`);\n\t}\n\n\tparameters(func) {\n\t\tconst extracted = func.toString().match(/^(function)?\\s*[^(]*\\(\\s*([^)]*)\\)?/m);\n\t\tif (extracted === null) {\n\t\t\tconsole.warn(`Extraction failed for ${func.name}`);\n\t\t\treturn func.bind(self);\n\t\t}\n\n\t\tconst es6Mode = extracted[1] === 'function' || extracted[1] === undefined;\n\n\t\treturn (es6Mode ? extracted[2] : extracted[1])\n\t\t\t.replace(/ /g, '')\n\t\t\t.split(',')\n\t\t\t.filter(dep => dep !== '')\n\t\t\t.map(this.resolve.bind(this));\n\t}\n\n\tprepare(func, self = null) {\n\t\tconst params = this.parameters(func);\n\n\t\treturn func.bind(self, ...params);\n\t}\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/Container.js","import Container from './Container';\n\nconst patchHook = ($vm, hookName, container) => {\n\tconst hooks = $vm.$options[hookName];\n\tif (hooks && hooks.length > 0) {\n\t\tconst params = container.parameters(hooks[hooks.length - 1]);\n\t\tconst hook = hooks[hooks.length - 1];\n\t\thooks[hooks.length - 1] = function () {\n\t\t\thook.call(this, ...params);\n\t\t};\n\t}\n};\n\nconst injectServices = ($vm, container) => {\n\tif ($vm.$options.services !== undefined) {\n\t\t$vm.$options.services.forEach(service => {\n\t\t\t$vm.$services[service] = container.resolve(service);\n\t\t});\n\t}\n};\n\nconst container = new Container; // eslint-disable-line\nexport default {\n\tproduction: process.env.NODE_ENV === 'production',\n\tinstall(Vue) {\n\t\tVue.prototype.$services = [];\n\t\tVue.prototype.$ioc = container;\n\t\tVue.$ioc = container;\n\t\tVue.mixin({\n\t\t\tbeforeCreate() {\n\t\t\t\tinjectServices(this, container);\n\t\t\t\tpatchHook(this, 'created', container);\n\t\t\t\tpatchHook(this, 'beforeMount', container);\n\t\t\t\tpatchHook(this, 'mounted', container);\n\t\t\t\tpatchHook(this, 'beforeUpdate', container);\n\t\t\t\tpatchHook(this, 'updated', container);\n\t\t\t\tpatchHook(this, 'beforeDestroy', container);\n\t\t\t\tpatchHook(this, 'destroyed', container);\n\t\t\t},\n\t\t});\n\t},\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/Vue.js","import Vuebindings from './Vue';\nexport { default as Container } from './Container';\n\nexport default Vuebindings;\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///vuec.js","webpack:///webpack/bootstrap eff007853d09751e7ab6","webpack:///./src/Container.js","webpack:///./src/Vue.js","webpack:///./src/index.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","_toConsumableArray","arr","Array","isArray","arr2","length","from","_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","props","descriptor","writable","key","protoProps","staticProps","Container","$cache","Map","production","Boolean","set","has","delete","entries","Error","func","extracted","toString","match","console","warn","bind","self","undefined","replace","split","filter","dep","map","resolve","arguments","params","parameters","apply","concat","default","_interopRequireDefault","obj","_Container","_Container2","patchHook","$vm","hookName","container","hooks","$options","hook","injectServices","services","forEach","service","$services","install","Vue","$ioc","mixin","beforeCreate","_Vue","_Vue2"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,KAAAD,IAEAD,EAAA,KAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,GAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KA+DA,OAnCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAA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AChCH,EAAUnF,KAAM,UAAWsF,GAC3BH,EAAUnF,KAAM,gBAAiBsF,GACjCH,EAAUnF,KAAM,YAAasF,SHkM3B,SAAUzF,EAAQD,EAASM,GAEjC,YAqBA,SAAS6E,GAAuBC,GAAO,MAAOA,IAAOA,EAAI3D,WAAa2D,GAAQF,QAASE,GAlBvFjE,OAAOC,eAAepB,EAAS,cAC7Bc,OAAO,IAETd,EAAQoD,UAAYkB,MAEpB,IAAIe,GAAa/E,EAAoB,EAErCa,QAAOC,eAAepB,EAAS,aAC7BsB,YAAY,EACZC,IAAK,WACH,MAAO4D,GAAuBE,GIrPzBH,UADT,IAAAsB,GAAAlG,EAAA,GJ4PImG,EAAQtB,EAAuBqB,EAInCxG,GAAQkF,QAAUuB,EAAMvB","file":"vuec.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"vuec\"] = factory();\n\telse\n\t\troot[\"vuec\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"vuec\"] = factory();\n\telse\n\t\troot[\"vuec\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Container = function () {\n\tfunction Container() {\n\t\t_classCallCheck(this, Container);\n\n\t\tthis.$cache = new Map();\n\t\tthis.production = Boolean(\"production\" === 'production');\n\t}\n\n\t_createClass(Container, [{\n\t\tkey: 'register',\n\t\tvalue: function register(name, value) {\n\t\t\tthis.$cache.set(name, value);\n\t\t}\n\t}, {\n\t\tkey: 'unregister',\n\t\tvalue: function unregister(name) {\n\t\t\tif (this.$cache.has(name)) {\n\t\t\t\tthis.$cache.delete(name);\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'has',\n\t\tvalue: function has(name) {\n\t\t\treturn this.$cache.has(name);\n\t\t}\n\t}, {\n\t\tkey: 'bindings',\n\t\tvalue: function bindings() {\n\t\t\treturn this.$cache.entries();\n\t\t}\n\t}, {\n\t\tkey: 'resolve',\n\t\tvalue: function resolve(name) {\n\t\t\tif (this.$cache.has(name)) {\n\t\t\t\treturn this.$cache.get(name);\n\t\t\t}\n\n\t\t\tif (this.production) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tthrow new Error('Unknown dependency \"' + name + '\"');\n\t\t}\n\t}, {\n\t\tkey: 'parameters',\n\t\tvalue: function parameters(func) {\n\t\t\tvar extracted = func.toString().match(/^(function)?\\s*[^(]*\\(\\s*([^)]*)\\)?/m);\n\t\t\tif (extracted === null) {\n\t\t\t\tconsole.warn('Extraction failed for ' + func.name);\n\t\t\t\treturn func.bind(self);\n\t\t\t}\n\n\t\t\tvar es6Mode = extracted[1] === 'function' || extracted[1] === undefined;\n\n\t\t\treturn (es6Mode ? extracted[2] : extracted[1]).replace(/ /g, '').split(',').filter(function (dep) {\n\t\t\t\treturn dep !== '';\n\t\t\t}).map(this.resolve.bind(this));\n\t\t}\n\t}, {\n\t\tkey: 'prepare',\n\t\tvalue: function prepare(func) {\n\t\t\tvar self = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n\t\t\tvar params = this.parameters(func);\n\n\t\t\treturn func.bind.apply(func, [self].concat(_toConsumableArray(params)));\n\t\t}\n\t}]);\n\n\treturn Container;\n}();\n\nexports.default = Container;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\nvar _Container = __webpack_require__(0);\n\nvar _Container2 = _interopRequireDefault(_Container);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar patchHook = function patchHook($vm, hookName, container) {\n\tvar hooks = $vm.$options[hookName];\n\tif (hooks && hooks.length > 0) {\n\t\tvar params = container.parameters(hooks[hooks.length - 1]);\n\t\tvar hook = hooks[hooks.length - 1];\n\t\thooks[hooks.length - 1] = function () {\n\t\t\thook.call.apply(hook, [this].concat(_toConsumableArray(params)));\n\t\t};\n\t}\n};\n\nvar injectServices = function injectServices($vm, container) {\n\tif ($vm.$options.services !== undefined) {\n\t\t$vm.$options.services.forEach(function (service) {\n\t\t\t$vm.$services[service] = container.resolve(service);\n\t\t});\n\t}\n};\n\nvar container = new _Container2.default(); // eslint-disable-line\nexports.default = {\n\tproduction: \"production\" === 'production',\n\tinstall: function install(Vue) {\n\t\tVue.prototype.$services = [];\n\t\tVue.prototype.$ioc = container;\n\t\tVue.$ioc = container;\n\t\tVue.mixin({\n\t\t\tbeforeCreate: function beforeCreate() {\n\t\t\t\tinjectServices(this, container);\n\t\t\t\tpatchHook(this, 'created', container);\n\t\t\t\tpatchHook(this, 'beforeMount', container);\n\t\t\t\tpatchHook(this, 'mounted', container);\n\t\t\t\tpatchHook(this, 'beforeUpdate', container);\n\t\t\t\tpatchHook(this, 'updated', container);\n\t\t\t\tpatchHook(this, 'beforeDestroy', container);\n\t\t\t\tpatchHook(this, 'destroyed', container);\n\t\t\t}\n\t\t});\n\t}\n};\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Container = undefined;\n\nvar _Container = __webpack_require__(0);\n\nObject.defineProperty(exports, 'Container', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Container).default;\n }\n});\n\nvar _Vue = __webpack_require__(1);\n\nvar _Vue2 = _interopRequireDefault(_Vue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _Vue2.default;\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// vuec.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap eff007853d09751e7ab6","export default class Container {\n\tconstructor() {\n\t\tthis.$cache = new Map();\n\t\tthis.production = Boolean(process.env.NODE_ENV === 'production');\n\t}\n\n\tregister(name, value) {\n\t\tthis.$cache.set(name, value);\n\t}\n\n\tunregister(name) {\n\t\tif (this.$cache.has(name)) {\n\t\t\tthis.$cache.delete(name);\n\t\t}\n\t}\n\n\thas(name) {\n\t\treturn this.$cache.has(name);\n\t}\n\n\tbindings() {\n\t\treturn this.$cache.entries();\n\t}\n\n\tresolve(name) {\n\t\tif (this.$cache.has(name)) {\n\t\t\treturn this.$cache.get(name);\n\t\t}\n\n\t\tif (this.production) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthrow new Error(`Unknown dependency \"${name}\"`);\n\t}\n\n\tparameters(func) {\n\t\tconst extracted = func.toString().match(/^(function)?\\s*[^(]*\\(\\s*([^)]*)\\)?/m);\n\t\tif (extracted === null) {\n\t\t\tconsole.warn(`Extraction failed for ${func.name}`);\n\t\t\treturn func.bind(self);\n\t\t}\n\n\t\tconst es6Mode = extracted[1] === 'function' || extracted[1] === undefined;\n\n\t\treturn (es6Mode ? extracted[2] : extracted[1])\n\t\t\t.replace(/ /g, '')\n\t\t\t.split(',')\n\t\t\t.filter(dep => dep !== '')\n\t\t\t.map(this.resolve.bind(this));\n\t}\n\n\tprepare(func, self = null) {\n\t\tconst params = this.parameters(func);\n\n\t\treturn func.bind(self, ...params);\n\t}\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/Container.js","import Container from './Container';\n\nconst patchHook = ($vm, hookName, container) => {\n\tconst hooks = $vm.$options[hookName];\n\tif (hooks && hooks.length > 0) {\n\t\tconst params = container.parameters(hooks[hooks.length - 1]);\n\t\tconst hook = hooks[hooks.length - 1];\n\t\thooks[hooks.length - 1] = function () {\n\t\t\thook.call(this, ...params);\n\t\t};\n\t}\n};\n\nconst injectServices = ($vm, container) => {\n\tif ($vm.$options.services !== undefined) {\n\t\t$vm.$options.services.forEach(service => {\n\t\t\t$vm.$services[service] = container.resolve(service);\n\t\t});\n\t}\n};\n\nconst container = new Container; // eslint-disable-line\nexport default {\n\tproduction: process.env.NODE_ENV === 'production',\n\tinstall(Vue) {\n\t\tVue.prototype.$services = [];\n\t\tVue.prototype.$ioc = container;\n\t\tVue.$ioc = container;\n\t\tVue.mixin({\n\t\t\tbeforeCreate() {\n\t\t\t\tinjectServices(this, container);\n\t\t\t\tpatchHook(this, 'created', container);\n\t\t\t\tpatchHook(this, 'beforeMount', container);\n\t\t\t\tpatchHook(this, 'mounted', container);\n\t\t\t\tpatchHook(this, 'beforeUpdate', container);\n\t\t\t\tpatchHook(this, 'updated', container);\n\t\t\t\tpatchHook(this, 'beforeDestroy', container);\n\t\t\t\tpatchHook(this, 'destroyed', container);\n\t\t\t},\n\t\t});\n\t},\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/Vue.js","import Vuebindings from './Vue';\nexport { default as Container } from './Container';\n\nexport default Vuebindings;\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index f055db1..deef8fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-container", - "version": "1.1.0", + "version": "1.1.1", "description": "A simple IoC container for VueJS", "main": "dist/vuec.js", "author": "Wannes Gennar ",