moodle_local_treestudyplan/amd/build/vue-property-decorator.min.js

3 lines
6.1 KiB
JavaScript
Raw Normal View History

define("local_treestudyplan/vue-property-decorator",["exports","./vue","./vue-class-component"],(function(_exports,_vue,_vueClassComponent){var obj;function _typeof(obj){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}Object.defineProperty(_exports,"__esModule",{value:!0}),Object.defineProperty(_exports,"Component",{enumerable:!0,get:function(){return _vueClassComponent.Component}}),_exports.Emit=function(event){return function(_target,propertyKey,descriptor){var key=hyphenate(propertyKey),original=descriptor.value;descriptor.value=function(){for(var _this=this,args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];var obj,emit=function(returnValue){var emitName=event||key;void 0===returnValue?0===args.length?_this.$emit(emitName):1===args.length?_this.$emit(emitName,args[0]):_this.$emit.apply(_this,[emitName].concat(args)):0===args.length?_this.$emit(emitName,returnValue):1===args.length?_this.$emit(emitName,returnValue,args[0]):_this.$emit.apply(_this,[emitName,returnValue].concat(args))},returnValue=original.apply(this,args);return(obj=returnValue)instanceof Promise||obj&&"function"==typeof obj.then?returnValue.then(emit):emit(returnValue),returnValue}}},_exports.Inject=function(options){return(0,_vueClassComponent.createDecorator)((function(componentOptions,key){void 0===componentOptions.inject&&(componentOptions.inject={}),Array.isArray(componentOptions.inject)||(componentOptions.inject[key]=options||key)}))},_exports.InjectReactive=function(options){return(0,_vueClassComponent.createDecorator)((function(componentOptions,key){if(void 0===componentOptions.inject&&(componentOptions.inject={}),!Array.isArray(componentOptions.inject)){var fromKey_1=options?options.from||options:key,defaultVal_1=!!options&&options.default||void 0;componentOptions.computed||(componentOptions.computed={}),componentOptions.computed[key]=function(){var obj=this[reactiveInjectKey];return obj?obj[fromKey_1]:defaultVal_1},componentOptions.inject[reactiveInjectKey]=reactiveInjectKey}}))},Object.defineProperty(_exports,"Mixins",{enumerable:!0,get:function(){return _vueClassComponent.mixins}}),_exports.Model=function(event,options){void 0===options&&(options={});return function(target,key){applyMetadata(options,target,key),(0,_vueClassComponent.createDecorator)((function(componentOptions,k){(componentOptions.props||(componentOptions.props={}))[k]=options,componentOptions.model={prop:k,event:event||k}}))(target,key)}},_exports.Prop=function(options){void 0===options&&(options={});return function(target,key){applyMetadata(options,target,key),(0,_vueClassComponent.createDecorator)((function(componentOptions,k){(componentOptions.props||(componentOptions.props={}))[k]=options}))(target,key)}},_exports.PropSync=function(propName,options){void 0===options&&(options={});return function(target,key){applyMetadata(options,target,key),(0,_vueClassComponent.createDecorator)((function(componentOptions,k){(componentOptions.props||(componentOptions.props={}))[propName]=options,(componentOptions.computed||(componentOptions.computed={}))[k]={get:function(){return this[propName]},set:function(value){this.$emit("update:"+propName,value)}}}))(target,key)}},_exports.Provide=function(key){return(0,_vueClassComponent.createDecorator)((function(componentOptions,k){var provide=componentOptions.provide;needToProduceProvide(provide)&&(provide=componentOptions.provide=produceProvide(provide)),provide.managed[k]=key||k}))},_exports.ProvideReactive=function(key){return(0,_vueClassComponent.createDecorator)((function(componentOptions,k){var provide=componentOptions.provide;Array.isArray(componentOptions.inject)||(componentOptions.inject=componentOptions.inject||{},componentOptions.inject[reactiveInjectKey]={from:reactiveInjectKey,default:{}}),needToProduceProvide(provide)&&(provide=componentOptions.provide=produceProvide(provide)),provide.managedReactive[k]=key||k}))},_exports.Re
//# sourceMappingURL=vue-property-decorator.min.js.map