vue-modal-viewer
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -175,9 +175,2 @@ module.exports = | ||
/***/ "8bbf": | ||
/***/ (function(module, exports) { | ||
module.exports = require("vue"); | ||
/***/ }), | ||
/***/ "fb15": | ||
@@ -214,177 +207,7 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} | ||
var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); | ||
var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_); | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"a8709a1c-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/Modal.vue?vue&type=template&id=77a43fe0& | ||
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"modal"},[_vm._t("default",null,null,{ isShowed: _vm.isShowed })],2)} | ||
var staticRenderFns = [] | ||
// CONCATENATED MODULE: ./src/Modal.vue?vue&type=template&id=77a43fe0& | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/ts-loader??ref--13-2!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/Modal.vue?vue&type=script&lang=ts& | ||
/* harmony default export */ var Modalvue_type_script_lang_ts_ = (external_commonjs_vue_commonjs2_vue_root_Vue_default.a.extend({ | ||
name: "Modal", | ||
props: { | ||
name: { | ||
type: String, | ||
required: true, | ||
}, | ||
}, | ||
data: function () { | ||
return { | ||
isShowed: false, | ||
}; | ||
}, | ||
created: function () { | ||
this.$modalviewer.register(this); | ||
}, | ||
beforeDestroy: function () { | ||
this.$modalviewer.unregister(this); | ||
}, | ||
methods: { | ||
show: function () { | ||
this.isShowed = true; | ||
}, | ||
hide: function () { | ||
this.isShowed = false; | ||
}, | ||
}, | ||
})); | ||
// CONCATENATED MODULE: ./src/Modal.vue?vue&type=script&lang=ts& | ||
/* harmony default export */ var src_Modalvue_type_script_lang_ts_ = (Modalvue_type_script_lang_ts_); | ||
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js | ||
/* globals __VUE_SSR_CONTEXT__ */ | ||
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules). | ||
// This module is a runtime utility for cleaner component module output and will | ||
// be included in the final webpack user bundle. | ||
function normalizeComponent ( | ||
scriptExports, | ||
render, | ||
staticRenderFns, | ||
functionalTemplate, | ||
injectStyles, | ||
scopeId, | ||
moduleIdentifier, /* server only */ | ||
shadowMode /* vue-cli only */ | ||
) { | ||
// Vue.extend constructor export interop | ||
var options = typeof scriptExports === 'function' | ||
? scriptExports.options | ||
: scriptExports | ||
// render functions | ||
if (render) { | ||
options.render = render | ||
options.staticRenderFns = staticRenderFns | ||
options._compiled = true | ||
} | ||
// functional template | ||
if (functionalTemplate) { | ||
options.functional = true | ||
} | ||
// scopedId | ||
if (scopeId) { | ||
options._scopeId = 'data-v-' + scopeId | ||
} | ||
var hook | ||
if (moduleIdentifier) { // server build | ||
hook = function (context) { | ||
// 2.3 injection | ||
context = | ||
context || // cached call | ||
(this.$vnode && this.$vnode.ssrContext) || // stateful | ||
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional | ||
// 2.2 with runInNewContext: true | ||
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { | ||
context = __VUE_SSR_CONTEXT__ | ||
} | ||
// inject component styles | ||
if (injectStyles) { | ||
injectStyles.call(this, context) | ||
} | ||
// register component module identifier for async chunk inferrence | ||
if (context && context._registeredComponents) { | ||
context._registeredComponents.add(moduleIdentifier) | ||
} | ||
} | ||
// used by ssr in case component is cached and beforeCreate | ||
// never gets called | ||
options._ssrRegister = hook | ||
} else if (injectStyles) { | ||
hook = shadowMode | ||
? function () { | ||
injectStyles.call( | ||
this, | ||
(options.functional ? this.parent : this).$root.$options.shadowRoot | ||
) | ||
} | ||
: injectStyles | ||
} | ||
if (hook) { | ||
if (options.functional) { | ||
// for template-only hot-reload because in that case the render fn doesn't | ||
// go through the normalizer | ||
options._injectStyles = hook | ||
// register for functional component in vue file | ||
var originalRender = options.render | ||
options.render = function renderWithStyleInjection (h, context) { | ||
hook.call(context) | ||
return originalRender(h, context) | ||
} | ||
} else { | ||
// inject component registration as beforeCreate hook | ||
var existing = options.beforeCreate | ||
options.beforeCreate = existing | ||
? [].concat(existing, hook) | ||
: [hook] | ||
} | ||
} | ||
return { | ||
exports: scriptExports, | ||
options: options | ||
} | ||
} | ||
// CONCATENATED MODULE: ./src/Modal.vue | ||
/* normalize component */ | ||
var component = normalizeComponent( | ||
src_Modalvue_type_script_lang_ts_, | ||
render, | ||
staticRenderFns, | ||
false, | ||
null, | ||
null, | ||
null | ||
) | ||
/* harmony default export */ var Modal = (component.exports); | ||
// CONCATENATED MODULE: ./src/ModalViewer.ts | ||
var ModalViewer_ModalViewer = /** @class */ (function () { | ||
var ModalViewer = /** @class */ (function () { | ||
function ModalViewer() { | ||
this.modals = {}; | ||
} | ||
ModalViewer.install = function (vue) { | ||
external_commonjs_vue_commonjs2_vue_root_Vue_default.a.component("modal", Modal); | ||
vue.prototype.$modalviewer = new ModalViewer(); | ||
}; | ||
ModalViewer.prototype.register = function (modal) { | ||
@@ -436,5 +259,32 @@ var modalName = modal.name; | ||
}; | ||
ModalViewer.mixin = { | ||
props: { | ||
name: { | ||
type: String, | ||
required: true, | ||
}, | ||
}, | ||
data: function () { | ||
return { | ||
isShowed: false, | ||
}; | ||
}, | ||
created: function () { | ||
this.$modalviewer.register(this); | ||
}, | ||
beforeDestroy: function () { | ||
this.$modalviewer.unregister(this); | ||
}, | ||
methods: { | ||
show: function () { | ||
this.isShowed = true; | ||
}, | ||
hide: function () { | ||
this.isShowed = false; | ||
}, | ||
}, | ||
}; | ||
return ModalViewer; | ||
}()); | ||
/* harmony default export */ var src_ModalViewer = (ModalViewer_ModalViewer); | ||
/* harmony default export */ var src_ModalViewer = (ModalViewer); | ||
@@ -441,0 +291,0 @@ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js |
import Vue from "vue"; | ||
import { ComponentOptions } from "vue/types/options"; | ||
declare module 'vue/types/vue' { | ||
@@ -9,2 +10,3 @@ interface Vue { | ||
name: string; | ||
isShowed: boolean; | ||
show(): void; | ||
@@ -14,3 +16,3 @@ hide(): void; | ||
declare class ModalViewer { | ||
static install(vue: typeof Vue): void; | ||
static readonly mixin: ComponentOptions<Vue>; | ||
private modals; | ||
@@ -17,0 +19,0 @@ register(modal: Modal): void; |
{ | ||
"name": "vue-modal-viewer", | ||
"description": "", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"main": "dist/vue-modal-viewer.common.js", | ||
@@ -6,0 +6,0 @@ "types": "dts/ModalViewer.d.ts", |
Sorry, the diff of this file is not supported yet
7
25537
340