vue3-menus
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -205,32 +205,2 @@ module.exports = | ||
/***/ "2789": | ||
/***/ (function(module, exports, __webpack_require__) { | ||
// style-loader: Adds some css to the DOM by adding a <style> tag | ||
// load the styles | ||
var content = __webpack_require__("4187"); | ||
if(content.__esModule) content = content.default; | ||
if(typeof content === 'string') content = [[module.i, content, '']]; | ||
if(content.locals) module.exports = content.locals; | ||
// add the styles to the DOM | ||
var add = __webpack_require__("499e").default | ||
var update = add("4c637b10", content, true, {"sourceMap":false,"shadowMode":false}); | ||
/***/ }), | ||
/***/ "4187": | ||
/***/ (function(module, exports, __webpack_require__) { | ||
// Imports | ||
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("24fb"); | ||
exports = ___CSS_LOADER_API_IMPORT___(false); | ||
// Module | ||
exports.push([module.i, ".menus[data-v-347764fc]{position:fixed;box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04);background:#fff;border-radius:4px;padding:8px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:border-box}.menus_body[data-v-347764fc]{display:block}.menus-fade-enter-active[data-v-347764fc],.menus-fade-leave-active[data-v-347764fc]{transition:opacity .1s ease-in-out}.menus-fade-enter-from[data-v-347764fc],.menus-fade-leave-to[data-v-347764fc]{opacity:0}", ""]); | ||
// Exports | ||
module.exports = exports; | ||
/***/ }), | ||
/***/ "499e": | ||
@@ -502,2 +472,13 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
/***/ "4db7": | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_Menus_vue_vue_type_style_index_0_id_4450c50e_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("b27b"); | ||
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_Menus_vue_vue_type_style_index_0_id_4450c50e_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_Menus_vue_vue_type_style_index_0_id_4450c50e_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__); | ||
/* unused harmony reexport * */ | ||
/***/ }), | ||
/***/ "8875": | ||
@@ -606,13 +587,32 @@ /***/ (function(module, exports, __webpack_require__) { | ||
/***/ "bbcf": | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
/***/ "b27b": | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_Menus_vue_vue_type_style_index_0_id_347764fc_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2789"); | ||
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_Menus_vue_vue_type_style_index_0_id_347764fc_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_Menus_vue_vue_type_style_index_0_id_347764fc_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__); | ||
/* unused harmony reexport * */ | ||
// style-loader: Adds some css to the DOM by adding a <style> tag | ||
// load the styles | ||
var content = __webpack_require__("b53e"); | ||
if(content.__esModule) content = content.default; | ||
if(typeof content === 'string') content = [[module.i, content, '']]; | ||
if(content.locals) module.exports = content.locals; | ||
// add the styles to the DOM | ||
var add = __webpack_require__("499e").default | ||
var update = add("3995fa16", content, true, {"sourceMap":false,"shadowMode":false}); | ||
/***/ }), | ||
/***/ "b53e": | ||
/***/ (function(module, exports, __webpack_require__) { | ||
// Imports | ||
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("24fb"); | ||
exports = ___CSS_LOADER_API_IMPORT___(false); | ||
// Module | ||
exports.push([module.i, ".menus[data-v-4450c50e]{position:fixed;box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04);background:#fff;border-radius:4px;padding:8px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:border-box}.menus_body[data-v-4450c50e]{display:block}.menus-fade-enter-active[data-v-4450c50e],.menus-fade-leave-active[data-v-4450c50e]{transition:opacity .1s ease-in-out}.menus-fade-enter-from[data-v-4450c50e],.menus-fade-leave-to[data-v-4450c50e]{opacity:0}", ""]); | ||
// Exports | ||
module.exports = exports; | ||
/***/ }), | ||
/***/ "d1aa": | ||
@@ -673,11 +673,11 @@ /***/ (function(module, exports, __webpack_require__) { | ||
// CONCATENATED MODULE: ./node_modules/vue-loader-v16/dist/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./package/components/Menus.vue?vue&type=template&id=347764fc&scoped=true | ||
// CONCATENATED MODULE: ./node_modules/vue-loader-v16/dist/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./package/components/Menus.vue?vue&type=template&id=4450c50e&scoped=true | ||
const _withId = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withScopeId"])("data-v-347764fc") | ||
const _withId = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withScopeId"])("data-v-4450c50e") | ||
Object(external_commonjs_vue_commonjs2_vue_root_Vue_["pushScopeId"])("data-v-347764fc") | ||
Object(external_commonjs_vue_commonjs2_vue_root_Vue_["pushScopeId"])("data-v-4450c50e") | ||
const _hoisted_1 = { class: "menus_body" } | ||
Object(external_commonjs_vue_commonjs2_vue_root_Vue_["popScopeId"])() | ||
const Menusvue_type_template_id_347764fc_scoped_true_render = /*#__PURE__*/_withId(function render(_ctx, _cache, $props, $setup, $data, $options) { | ||
const Menusvue_type_template_id_4450c50e_scoped_true_render = /*#__PURE__*/_withId(function render(_ctx, _cache, $props, $setup, $data, $options) { | ||
const _component_MenusItem = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("MenusItem") | ||
@@ -754,3 +754,3 @@ | ||
}) | ||
// CONCATENATED MODULE: ./package/components/Menus.vue?vue&type=template&id=347764fc&scoped=true | ||
// CONCATENATED MODULE: ./package/components/Menus.vue?vue&type=template&id=4450c50e&scoped=true | ||
@@ -1015,4 +1015,4 @@ // CONCATENATED MODULE: ./node_modules/vue-loader-v16/dist/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./package/components/MenusItem.vue?vue&type=template&id=11a672fa | ||
const ctx = {}; | ||
const windowWidth = document.documentElement.clientWidth; | ||
const windowHeight = document.documentElement.clientHeight; | ||
const windowWidth = globalThis.document.documentElement.clientWidth; | ||
const windowHeight = globalThis.document.documentElement.clientHeight; | ||
const _position = props.position.x && props.position.y ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(props.position) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])({ | ||
@@ -1119,3 +1119,3 @@ x: props.event.clientX, | ||
const app = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"])(node); | ||
ctx.instance = app.mount(document.createElement("div")); | ||
ctx.instance = app.mount(globalThis.document.createElement("div")); | ||
ctx.instance.$unmount = app.unmount; | ||
@@ -1151,4 +1151,4 @@ ctx.index = index; | ||
// EXTERNAL MODULE: ./package/components/Menus.vue?vue&type=style&index=0&id=347764fc&scoped=true&lang=css | ||
var Menusvue_type_style_index_0_id_347764fc_scoped_true_lang_css = __webpack_require__("bbcf"); | ||
// EXTERNAL MODULE: ./package/components/Menus.vue?vue&type=style&index=0&id=4450c50e&scoped=true&lang=css | ||
var Menusvue_type_style_index_0_id_4450c50e_scoped_true_lang_css = __webpack_require__("4db7"); | ||
@@ -1161,4 +1161,4 @@ // CONCATENATED MODULE: ./package/components/Menus.vue | ||
Menusvue_type_script_lang_js.render = Menusvue_type_template_id_347764fc_scoped_true_render | ||
Menusvue_type_script_lang_js.__scopeId = "data-v-347764fc" | ||
Menusvue_type_script_lang_js.render = Menusvue_type_template_id_4450c50e_scoped_true_render | ||
Menusvue_type_script_lang_js.__scopeId = "data-v-4450c50e" | ||
@@ -1231,13 +1231,13 @@ /* harmony default export */ var Menus = (Menusvue_type_script_lang_js); | ||
const app = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"])(node); | ||
lastInstance = app.mount(document.createElement("div")); | ||
lastInstance = app.mount(globalThis.document.createElement("div")); | ||
lastInstance.$unmount = app.unmount; | ||
setTimeout(() => { | ||
document.addEventListener("click", mouseEvent); | ||
document.addEventListener("contextmenu", mouseEvent); | ||
document.addEventListener("wheel", mouseEvent); | ||
globalThis.document.addEventListener("click", mouseEvent); | ||
globalThis.document.addEventListener("contextmenu", mouseEvent); | ||
globalThis.document.addEventListener("wheel", mouseEvent); | ||
}, 0); | ||
} else { | ||
document.removeEventListener("click", mouseEvent); | ||
document.removeEventListener("contextmenu", mouseEvent); | ||
document.removeEventListener("wheel", mouseEvent); | ||
globalThis.document.removeEventListener("click", mouseEvent); | ||
globalThis.document.removeEventListener("contextmenu", mouseEvent); | ||
globalThis.document.removeEventListener("wheel", mouseEvent); | ||
} | ||
@@ -1270,5 +1270,5 @@ }) | ||
} | ||
document.removeEventListener("click", event_mouseEvent); | ||
document.removeEventListener("contextmenu", event_mouseEvent); | ||
document.removeEventListener("wheel", event_mouseEvent); | ||
globalThis.document.removeEventListener("click", event_mouseEvent); | ||
globalThis.document.removeEventListener("contextmenu", event_mouseEvent); | ||
globalThis.document.removeEventListener("wheel", event_mouseEvent); | ||
} | ||
@@ -1281,5 +1281,5 @@ | ||
event_lastInstance = null; | ||
document.removeEventListener("click", event_mouseEvent); | ||
document.removeEventListener("contextmenu", event_mouseEvent); | ||
document.removeEventListener("wheel", event_mouseEvent); | ||
globalThis.document.removeEventListener("click", event_mouseEvent); | ||
globalThis.document.removeEventListener("contextmenu", event_mouseEvent); | ||
globalThis.document.removeEventListener("wheel", event_mouseEvent); | ||
} | ||
@@ -1290,3 +1290,3 @@ let instance = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"])(Menus, { | ||
}); | ||
event_lastInstance = instance.mount(document.createElement("div")); | ||
event_lastInstance = instance.mount(globalThis.document.createElement("div")); | ||
event_lastInstance.$unmount = instance.unmount; | ||
@@ -1297,5 +1297,5 @@ if (temp.prevent == undefined || temp.prevent) { | ||
setTimeout(() => { | ||
document.addEventListener("click", event_mouseEvent); | ||
document.addEventListener("contextmenu", event_mouseEvent); | ||
document.addEventListener("wheel", event_mouseEvent); | ||
globalThis.document.addEventListener("click", event_mouseEvent); | ||
globalThis.document.addEventListener("contextmenu", event_mouseEvent); | ||
globalThis.document.addEventListener("wheel", event_mouseEvent); | ||
}, 0); | ||
@@ -1302,0 +1302,0 @@ return event_lastInstance; |
@@ -214,32 +214,2 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/***/ "2789": | ||
/***/ (function(module, exports, __webpack_require__) { | ||
// style-loader: Adds some css to the DOM by adding a <style> tag | ||
// load the styles | ||
var content = __webpack_require__("4187"); | ||
if(content.__esModule) content = content.default; | ||
if(typeof content === 'string') content = [[module.i, content, '']]; | ||
if(content.locals) module.exports = content.locals; | ||
// add the styles to the DOM | ||
var add = __webpack_require__("499e").default | ||
var update = add("4c637b10", content, true, {"sourceMap":false,"shadowMode":false}); | ||
/***/ }), | ||
/***/ "4187": | ||
/***/ (function(module, exports, __webpack_require__) { | ||
// Imports | ||
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("24fb"); | ||
exports = ___CSS_LOADER_API_IMPORT___(false); | ||
// Module | ||
exports.push([module.i, ".menus[data-v-347764fc]{position:fixed;box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04);background:#fff;border-radius:4px;padding:8px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:border-box}.menus_body[data-v-347764fc]{display:block}.menus-fade-enter-active[data-v-347764fc],.menus-fade-leave-active[data-v-347764fc]{transition:opacity .1s ease-in-out}.menus-fade-enter-from[data-v-347764fc],.menus-fade-leave-to[data-v-347764fc]{opacity:0}", ""]); | ||
// Exports | ||
module.exports = exports; | ||
/***/ }), | ||
/***/ "499e": | ||
@@ -511,2 +481,13 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
/***/ "4db7": | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_Menus_vue_vue_type_style_index_0_id_4450c50e_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("b27b"); | ||
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_Menus_vue_vue_type_style_index_0_id_4450c50e_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_Menus_vue_vue_type_style_index_0_id_4450c50e_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__); | ||
/* unused harmony reexport * */ | ||
/***/ }), | ||
/***/ "8875": | ||
@@ -615,13 +596,32 @@ /***/ (function(module, exports, __webpack_require__) { | ||
/***/ "bbcf": | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
/***/ "b27b": | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_Menus_vue_vue_type_style_index_0_id_347764fc_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2789"); | ||
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_Menus_vue_vue_type_style_index_0_id_347764fc_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_Menus_vue_vue_type_style_index_0_id_347764fc_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__); | ||
/* unused harmony reexport * */ | ||
// style-loader: Adds some css to the DOM by adding a <style> tag | ||
// load the styles | ||
var content = __webpack_require__("b53e"); | ||
if(content.__esModule) content = content.default; | ||
if(typeof content === 'string') content = [[module.i, content, '']]; | ||
if(content.locals) module.exports = content.locals; | ||
// add the styles to the DOM | ||
var add = __webpack_require__("499e").default | ||
var update = add("3995fa16", content, true, {"sourceMap":false,"shadowMode":false}); | ||
/***/ }), | ||
/***/ "b53e": | ||
/***/ (function(module, exports, __webpack_require__) { | ||
// Imports | ||
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("24fb"); | ||
exports = ___CSS_LOADER_API_IMPORT___(false); | ||
// Module | ||
exports.push([module.i, ".menus[data-v-4450c50e]{position:fixed;box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04);background:#fff;border-radius:4px;padding:8px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:border-box}.menus_body[data-v-4450c50e]{display:block}.menus-fade-enter-active[data-v-4450c50e],.menus-fade-leave-active[data-v-4450c50e]{transition:opacity .1s ease-in-out}.menus-fade-enter-from[data-v-4450c50e],.menus-fade-leave-to[data-v-4450c50e]{opacity:0}", ""]); | ||
// Exports | ||
module.exports = exports; | ||
/***/ }), | ||
/***/ "d1aa": | ||
@@ -682,11 +682,11 @@ /***/ (function(module, exports, __webpack_require__) { | ||
// CONCATENATED MODULE: ./node_modules/vue-loader-v16/dist/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./package/components/Menus.vue?vue&type=template&id=347764fc&scoped=true | ||
// CONCATENATED MODULE: ./node_modules/vue-loader-v16/dist/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./package/components/Menus.vue?vue&type=template&id=4450c50e&scoped=true | ||
const _withId = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withScopeId"])("data-v-347764fc") | ||
const _withId = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withScopeId"])("data-v-4450c50e") | ||
Object(external_commonjs_vue_commonjs2_vue_root_Vue_["pushScopeId"])("data-v-347764fc") | ||
Object(external_commonjs_vue_commonjs2_vue_root_Vue_["pushScopeId"])("data-v-4450c50e") | ||
const _hoisted_1 = { class: "menus_body" } | ||
Object(external_commonjs_vue_commonjs2_vue_root_Vue_["popScopeId"])() | ||
const Menusvue_type_template_id_347764fc_scoped_true_render = /*#__PURE__*/_withId(function render(_ctx, _cache, $props, $setup, $data, $options) { | ||
const Menusvue_type_template_id_4450c50e_scoped_true_render = /*#__PURE__*/_withId(function render(_ctx, _cache, $props, $setup, $data, $options) { | ||
const _component_MenusItem = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("MenusItem") | ||
@@ -763,3 +763,3 @@ | ||
}) | ||
// CONCATENATED MODULE: ./package/components/Menus.vue?vue&type=template&id=347764fc&scoped=true | ||
// CONCATENATED MODULE: ./package/components/Menus.vue?vue&type=template&id=4450c50e&scoped=true | ||
@@ -1024,4 +1024,4 @@ // CONCATENATED MODULE: ./node_modules/vue-loader-v16/dist/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./package/components/MenusItem.vue?vue&type=template&id=11a672fa | ||
const ctx = {}; | ||
const windowWidth = document.documentElement.clientWidth; | ||
const windowHeight = document.documentElement.clientHeight; | ||
const windowWidth = globalThis.document.documentElement.clientWidth; | ||
const windowHeight = globalThis.document.documentElement.clientHeight; | ||
const _position = props.position.x && props.position.y ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(props.position) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])({ | ||
@@ -1128,3 +1128,3 @@ x: props.event.clientX, | ||
const app = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"])(node); | ||
ctx.instance = app.mount(document.createElement("div")); | ||
ctx.instance = app.mount(globalThis.document.createElement("div")); | ||
ctx.instance.$unmount = app.unmount; | ||
@@ -1160,4 +1160,4 @@ ctx.index = index; | ||
// EXTERNAL MODULE: ./package/components/Menus.vue?vue&type=style&index=0&id=347764fc&scoped=true&lang=css | ||
var Menusvue_type_style_index_0_id_347764fc_scoped_true_lang_css = __webpack_require__("bbcf"); | ||
// EXTERNAL MODULE: ./package/components/Menus.vue?vue&type=style&index=0&id=4450c50e&scoped=true&lang=css | ||
var Menusvue_type_style_index_0_id_4450c50e_scoped_true_lang_css = __webpack_require__("4db7"); | ||
@@ -1170,4 +1170,4 @@ // CONCATENATED MODULE: ./package/components/Menus.vue | ||
Menusvue_type_script_lang_js.render = Menusvue_type_template_id_347764fc_scoped_true_render | ||
Menusvue_type_script_lang_js.__scopeId = "data-v-347764fc" | ||
Menusvue_type_script_lang_js.render = Menusvue_type_template_id_4450c50e_scoped_true_render | ||
Menusvue_type_script_lang_js.__scopeId = "data-v-4450c50e" | ||
@@ -1240,13 +1240,13 @@ /* harmony default export */ var Menus = (Menusvue_type_script_lang_js); | ||
const app = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"])(node); | ||
lastInstance = app.mount(document.createElement("div")); | ||
lastInstance = app.mount(globalThis.document.createElement("div")); | ||
lastInstance.$unmount = app.unmount; | ||
setTimeout(() => { | ||
document.addEventListener("click", mouseEvent); | ||
document.addEventListener("contextmenu", mouseEvent); | ||
document.addEventListener("wheel", mouseEvent); | ||
globalThis.document.addEventListener("click", mouseEvent); | ||
globalThis.document.addEventListener("contextmenu", mouseEvent); | ||
globalThis.document.addEventListener("wheel", mouseEvent); | ||
}, 0); | ||
} else { | ||
document.removeEventListener("click", mouseEvent); | ||
document.removeEventListener("contextmenu", mouseEvent); | ||
document.removeEventListener("wheel", mouseEvent); | ||
globalThis.document.removeEventListener("click", mouseEvent); | ||
globalThis.document.removeEventListener("contextmenu", mouseEvent); | ||
globalThis.document.removeEventListener("wheel", mouseEvent); | ||
} | ||
@@ -1279,5 +1279,5 @@ }) | ||
} | ||
document.removeEventListener("click", event_mouseEvent); | ||
document.removeEventListener("contextmenu", event_mouseEvent); | ||
document.removeEventListener("wheel", event_mouseEvent); | ||
globalThis.document.removeEventListener("click", event_mouseEvent); | ||
globalThis.document.removeEventListener("contextmenu", event_mouseEvent); | ||
globalThis.document.removeEventListener("wheel", event_mouseEvent); | ||
} | ||
@@ -1290,5 +1290,5 @@ | ||
event_lastInstance = null; | ||
document.removeEventListener("click", event_mouseEvent); | ||
document.removeEventListener("contextmenu", event_mouseEvent); | ||
document.removeEventListener("wheel", event_mouseEvent); | ||
globalThis.document.removeEventListener("click", event_mouseEvent); | ||
globalThis.document.removeEventListener("contextmenu", event_mouseEvent); | ||
globalThis.document.removeEventListener("wheel", event_mouseEvent); | ||
} | ||
@@ -1299,3 +1299,3 @@ let instance = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"])(Menus, { | ||
}); | ||
event_lastInstance = instance.mount(document.createElement("div")); | ||
event_lastInstance = instance.mount(globalThis.document.createElement("div")); | ||
event_lastInstance.$unmount = instance.unmount; | ||
@@ -1306,5 +1306,5 @@ if (temp.prevent == undefined || temp.prevent) { | ||
setTimeout(() => { | ||
document.addEventListener("click", event_mouseEvent); | ||
document.addEventListener("contextmenu", event_mouseEvent); | ||
document.addEventListener("wheel", event_mouseEvent); | ||
globalThis.document.addEventListener("click", event_mouseEvent); | ||
globalThis.document.addEventListener("contextmenu", event_mouseEvent); | ||
globalThis.document.addEventListener("wheel", event_mouseEvent); | ||
}, 0); | ||
@@ -1311,0 +1311,0 @@ return event_lastInstance; |
@@ -1,2 +0,2 @@ | ||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["vue3-menus"]=t(require("vue")):e["vue3-menus"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({"21a1":function(e,t,n){var o=n("24fb");t=o(!1),t.push([e.i,".menus-item{display:flex;line-height:2rem;padding:0 1rem;margin:0;font-size:.8rem;outline:0;align-items:center;transition:.2s;box-sizing:border-box;list-style:none;border-bottom:1px solid transparent}.menus-item-divided{border-bottom-color:#ebeef5}.menus-item .menus-item-icon{display:flex;margin-right:.6rem;width:1rem}.menus-item .menus-item-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.menus-item .menus-item-suffix{margin-left:1.5rem;font-size:.39rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.menus-item-available{color:#606266;cursor:pointer}.menus-item-available:hover{background:#ecf5ff;color:#409eff}.menus-item-disabled{color:#c0c4cc;cursor:not-allowed}.menus-item-active{background:#ecf5ff;color:#409eff}.menus-item-tip{font-size:9px;color:#999}",""]),e.exports=t},"24fb":function(e,t,n){"use strict";function o(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"===typeof btoa){var r=i(o),c=o.sources.map((function(e){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(e," */")}));return[n].concat(c).concat([r]).join("\n")}return[n].join("\n")}function i(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t);return"/*# ".concat(n," */")}e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=o(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,o){"string"===typeof e&&(e=[[null,e,""]]);var i={};if(o)for(var r=0;r<this.length;r++){var c=this[r][0];null!=c&&(i[c]=!0)}for(var s=0;s<e.length;s++){var u=[].concat(e[s]);o&&i[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),t.push(u))}},t}},2789:function(e,t,n){var o=n("4187");o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);var i=n("499e").default;i("4c637b10",o,!0,{sourceMap:!1,shadowMode:!1})},4187:function(e,t,n){var o=n("24fb");t=o(!1),t.push([e.i,".menus[data-v-347764fc]{position:fixed;box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04);background:#fff;border-radius:4px;padding:8px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:border-box}.menus_body[data-v-347764fc]{display:block}.menus-fade-enter-active[data-v-347764fc],.menus-fade-leave-active[data-v-347764fc]{transition:opacity .1s ease-in-out}.menus-fade-enter-from[data-v-347764fc],.menus-fade-leave-to[data-v-347764fc]{opacity:0}",""]),e.exports=t},"499e":function(e,t,n){"use strict";function o(e,t){for(var n=[],o={},i=0;i<t.length;i++){var r=t[i],c=r[0],s=r[1],u=r[2],a=r[3],l={id:e+":"+i,css:s,media:u,sourceMap:a};o[c]?o[c].parts.push(l):n.push(o[c]={id:c,parts:[l]})}return n}n.r(t),n.d(t,"default",(function(){return p}));var i="undefined"!==typeof document;if("undefined"!==typeof DEBUG&&DEBUG&&!i)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var r={},c=i&&(document.head||document.getElementsByTagName("head")[0]),s=null,u=0,a=!1,l=function(){},d=null,m="data-vue-ssr-id",f="undefined"!==typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function p(e,t,n,i){a=n,d=i||{};var c=o(e,t);return v(c),function(t){for(var n=[],i=0;i<c.length;i++){var s=c[i],u=r[s.id];u.refs--,n.push(u)}t?(c=o(e,t),v(c)):c=[];for(i=0;i<n.length;i++){u=n[i];if(0===u.refs){for(var a=0;a<u.parts.length;a++)u.parts[a]();delete r[u.id]}}}}function v(e){for(var t=0;t<e.length;t++){var n=e[t],o=r[n.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](n.parts[i]);for(;i<n.parts.length;i++)o.parts.push(h(n.parts[i]));o.parts.length>n.parts.length&&(o.parts.length=n.parts.length)}else{var c=[];for(i=0;i<n.parts.length;i++)c.push(h(n.parts[i]));r[n.id]={id:n.id,refs:1,parts:c}}}}function b(){var e=document.createElement("style");return e.type="text/css",c.appendChild(e),e}function h(e){var t,n,o=document.querySelector("style["+m+'~="'+e.id+'"]');if(o){if(a)return l;o.parentNode.removeChild(o)}if(f){var i=u++;o=s||(s=b()),t=x.bind(null,o,i,!1),n=x.bind(null,o,i,!0)}else o=b(),t=j.bind(null,o),n=function(){o.parentNode.removeChild(o)};return t(e),function(o){if(o){if(o.css===e.css&&o.media===e.media&&o.sourceMap===e.sourceMap)return;t(e=o)}else n()}}var y=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function x(e,t,n,o){var i=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=y(t,i);else{var r=document.createTextNode(i),c=e.childNodes;c[t]&&e.removeChild(c[t]),c.length?e.insertBefore(r,c[t]):e.appendChild(r)}}function j(e,t){var n=t.css,o=t.media,i=t.sourceMap;if(o&&e.setAttribute("media",o),d.ssrId&&e.setAttribute(m,t.id),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{while(e.firstChild)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}},8875:function(e,t,n){var o,i,r;(function(n,c){i=[],o=c,r="function"===typeof o?o.apply(t,i):o,void 0===r||(e.exports=r)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(f){var n,o,i,r=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,c=/@([^@]*):(\d+):(\d+)\s*$/gi,s=r.exec(f.stack)||c.exec(f.stack),u=s&&s[1]||!1,a=s&&s[2]||!1,l=document.location.href.replace(document.location.hash,""),d=document.getElementsByTagName("script");u===l&&(n=document.documentElement.outerHTML,o=new RegExp("(?:[^\\n]+?\\n){0,"+(a-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),i=n.replace(o,"$1").trim());for(var m=0;m<d.length;m++){if("interactive"===d[m].readyState)return d[m];if(d[m].src===u)return d[m];if(u===l&&d[m].innerHTML&&d[m].innerHTML.trim()===i)return d[m]}return null}}return e}))},"8bbf":function(t,n){t.exports=e},"92c7":function(e,t,n){"use strict";n("d1aa")},bbcf:function(e,t,n){"use strict";n("2789")},d1aa:function(e,t,n){var o=n("21a1");o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);var i=n("499e").default;i("10b4684a",o,!0,{sourceMap:!1,shadowMode:!1})},fb15:function(e,t,n){"use strict";if(n.r(t),n.d(t,"Vue3Menus",(function(){return k})),n.d(t,"directive",(function(){return C})),n.d(t,"menusEvent",(function(){return M})),"undefined"!==typeof window){var o=window.document.currentScript,i=n("8875");o=i(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:i});var r=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var c=n("8bbf");const s=Object(c["withScopeId"])("data-v-347764fc");Object(c["pushScopeId"])("data-v-347764fc");const u={class:"menus_body"};Object(c["popScopeId"])();const a=s((function(e,t,n,o,i,r){const a=Object(c["resolveComponent"])("MenusItem");return Object(c["openBlock"])(),Object(c["createBlock"])(c["Teleport"],{to:"body"},[Object(c["createVNode"])(c["Transition"],{name:"menus-fade"},{default:s(()=>[e.open?(Object(c["openBlock"])(),Object(c["createBlock"])("div",{key:0,ref:"menusRef",class:"menus",style:{...e.menusStyle,top:e.style.top+"px",left:e.style.left+"px",minWidth:e.style.minWidth,maxWidth:e.style.maxWidth,zIndex:e.style.zIndex},onContextmenu:t[1]||(t[1]=e=>e.preventDefault()),onMousewheel:t[2]||(t[2]=Object(c["withModifiers"])(()=>{},["stop"]))},[Object(c["createVNode"])("div",u,[(Object(c["openBlock"])(!0),Object(c["createBlock"])(c["Fragment"],null,Object(c["renderList"])(e.menus,(t,n)=>(Object(c["openBlock"])(),Object(c["createBlock"])(c["Fragment"],{key:n},[t.hidden?Object(c["createCommentVNode"])("",!0):(Object(c["openBlock"])(),Object(c["createBlock"])(a,{key:0,item:t,index:n,activeIndex:e.activeIndex,onMenusEnter:e.menusEnter,menusItemClass:e.menusItemClass,hasIcon:e.hasIcon},Object(c["createSlots"])({_:2},[e.slots.default?{name:"default",fn:s(({item:t})=>[Object(c["renderSlot"])(e.$slots,"default",{item:t})])}:void 0,!e.slots.default&&e.slots.icon?{name:"icon",fn:s(({item:t})=>[Object(c["renderSlot"])(e.$slots,"icon",{item:t})])}:void 0,!e.slots.default&&e.slots.label?{name:"label",fn:s(({item:t})=>[Object(c["renderSlot"])(e.$slots,"label",{item:t})])}:void 0,!e.slots.default&&e.slots.suffix?{name:"suffix",fn:s(({item:t})=>[Object(c["renderSlot"])(e.$slots,"suffix",{item:t})])}:void 0]),1032,["item","index","activeIndex","onMenusEnter","menusItemClass","hasIcon"]))],64))),128))])],36)):Object(c["createCommentVNode"])("",!0)]),_:1})])})),l={key:0,class:"menus-item-icon"},d={class:"menus-item-label"},m={class:"menus-item-suffix"},f=Object(c["createTextVNode"])("▶"),p={key:3,class:"menus-item-tip"};function v(e,t,n,o,i,r){const s=Object(c["resolveComponent"])("MenusIcon");return e.slots.default?(Object(c["openBlock"])(),Object(c["createBlock"])("div",{key:0,onMouseenter:t[1]||(t[1]=t=>e.menusEnter(t,e.item)),onClick:t[2]||(t[2]=t=>e.menusClick(t,e.item)),onContextmenu:t[3]||(t[3]=t=>e.menusClick(t,e.item))},[Object(c["renderSlot"])(e.$slots,"default",{item:{activeIndex:e.activeIndex,item:e.item}})],32)):(Object(c["openBlock"])(),Object(c["createBlock"])("div",{key:1,onMouseenter:t[4]||(t[4]=t=>e.menusEnter(t,e.item)),onClick:t[5]||(t[5]=t=>e.menusClick(t,e.item)),onContextmenu:t[6]||(t[6]=t=>e.menusClick(t,e.item)),style:e.item.style?e.item.style:{},class:["menus-item",e.item.disabled?"menus-item-disabled":"menus-item-available",e.item.divided?"menus-divided":null,e.item.disabled||e.activeIndex!==e.index?null:"menus-item-active",e.menusItemClass]},[e.hasIcon?(Object(c["openBlock"])(),Object(c["createBlock"])("div",l,[e.slots.icon?Object(c["renderSlot"])(e.$slots,"icon",{key:0,item:{activeIndex:e.activeIndex,item:e.item}}):e.item.icon?(Object(c["openBlock"])(),Object(c["createBlock"])(c["Fragment"],{key:1},["string"===typeof e.item.icon?(Object(c["openBlock"])(),Object(c["createBlock"])("span",{key:0,innerHTML:e.item.icon},null,8,["innerHTML"])):(Object(c["openBlock"])(),Object(c["createBlock"])(s,{key:1,options:e.item.icon},null,8,["options"]))],64)):Object(c["createCommentVNode"])("",!0)])):Object(c["createCommentVNode"])("",!0),Object(c["createVNode"])("span",d,[e.slots.label?Object(c["renderSlot"])(e.$slots,"label",{key:0,item:{activeIndex:e.activeIndex,item:e.item}}):(Object(c["openBlock"])(),Object(c["createBlock"])(c["Fragment"],{key:1},[Object(c["createTextVNode"])(Object(c["toDisplayString"])(e.item.label),1)],64))]),Object(c["createVNode"])("div",m,[e.item.children&&e.slots.suffix?Object(c["renderSlot"])(e.$slots,"suffix",{key:0,item:{activeIndex:e.activeIndex,item:e.item}}):e.item.children?(Object(c["openBlock"])(),Object(c["createBlock"])(c["Fragment"],{key:1},[f],64)):e.item.tip&&e.slots.suffix?Object(c["renderSlot"])(e.$slots,"suffix",{key:2,item:{activeIndex:e.activeIndex,item:e.item}}):e.item.tip?(Object(c["openBlock"])(),Object(c["createBlock"])("span",p,Object(c["toDisplayString"])(e.item.tip),1)):Object(c["createCommentVNode"])("",!0)])],38))}var b=Object(c["defineComponent"])({name:"Vue3Menus",props:{options:{type:[Function,Object],default:{}}},render(){return"function"===typeof this.$props.options?Object(c["h"])(this.$props.options):"function"==typeof this.$props.options.node||"object"==typeof this.$props.options.node?Object(c["h"])(this.$props.options.node,this.$props.options.option):"object"!==typeof this.$props.options||this.$props.options.node?null:Object(c["h"])(this.$props.options)}}),h=b,y=Object(c["defineComponent"])({name:"menus-item",components:{MenusIcon:h},props:{menusItemClass:{type:String,default:null},hasIcon:{type:Boolean,default:!1},item:{type:Object,default:{}},index:{type:Number,default:0},activeIndex:{type:Number,default:-1}},setup(e,{emit:t,slots:n}){function o(n,o){t("menusEnter",n,o,e.index),n.preventDefault()}function i(e,t){if(e.preventDefault(),t.disabled)e.stopPropagation();else if(t&&!t.disabled&&!t.hidden&&"function"===typeof t.click){const n=t.click(t);!1!==n&&null!==n||e.stopPropagation()}}return{slots:n,menusEnter:o,menusClick:i}}});n("92c7");y.render=v;var x=y,j=Object(c["defineComponent"])({name:"menus",components:{MenusItem:x},props:{menus:{type:Array,default:[]},menusStyle:{type:Object,default:{}},menusItemClass:{type:String,default:null},event:{type:Object,default:{}},position:{type:Object,default:{}},minWidth:{type:[Number,String],default:"none"},maxWidth:{type:[Number,String],default:"none"},zIndex:{type:[Number,String],default:3},direction:{type:String,default:"right"},open:{type:Boolean,default:!1}},setup(e,{slots:t}){const n={},o=document.documentElement.clientWidth,i=document.documentElement.clientHeight,r=e.position.x&&e.position.y?Object(c["ref"])(e.position):Object(c["ref"])({x:e.event.clientX,y:e.event.clientY,width:0,height:0}),s=Object(c["ref"])(null),u=Object(c["ref"])({left:0,top:0,minWidth:e.minWidth+"px",maxWidth:"none"==e.maxWidth?e.maxWidth:e.maxWidth+"px",zIndex:e.zIndex}),a=Object(c["ref"])(e.direction),l=Object(c["ref"])(-1),d=Object(c["ref"])(!1),m=Object(c["ref"])(!1);function f(e){u.value.left=r.value.x-e,a.value="left",u.value.left<0&&(a.value="right",0===r.value.width||void 0===r.value.width?u.value.left=0:u.value.left=r.valuen.x+r.value.width)}function p(e,t){u.value.left=r.value.x+r.value.width,a.value="right",u.value.left+t>e&&(a.value="left",0===r.value.width||void 0===r.value.width?u.value.left=e-t:u.value.left=r.value.x-t)}function v(o,i,r){if(l.value=r,i.disabled)return;if(n.instance){if(n.index===r)return;n.instance.close.bind(n.instance)(),n.instance=null,n.index=null}if(!i.children)return;const s=o.target.getBoundingClientRect(),u=Object(c["h"])(O,{...e,menus:i.children||[],direction:a.value,position:{x:s.x+3,y:s.y-8,width:s.width-6,height:s.width}},t),d=Object(c["createApp"])(u);n.instance=d.mount(document.createElement("div")),n.instance.$unmount=d.unmount,n.index=r,o.preventDefault()}function b(){d.value=!1,this&&this.ctx&&this.ctx.instance&&this.ctx.instance.close(),Object(c["nextTick"])(()=>{this.$unmount()&&this.$unmount()})}return Object(c["onMounted"])(()=>{d.value=!0,e.menus.forEach(e=>{m.value=m.value||void 0!==e.icon,m.value}),Object(c["nextTick"])(()=>{const e=s.value.offsetWidth,t=s.value.offsetHeight;"left"===a.value?f(e):p(o,e),u.value.top=r.value.y,r.value.y+t>i&&(0===r.value.height||void 0===r.value.height?u.value.top=r.value.y-t:u.value.top=i-t)})}),{open:d,hasIcon:m,menusRef:s,style:u,close:b,menusEnter:v,ctx:n,activeIndex:l,slots:t}}});n("bbcf");j.render=a,j.__scopeId="data-v-347764fc";var O=j,g=Object(c["defineComponent"])({name:"Vue3Menus",props:{menus:{type:Array,default:[]},menusStyle:{type:Object,default:{}},menusItemClass:{type:String,default:null},event:{type:Object,default:{}},position:{type:Object,default:{}},minWidth:{type:[Number,String],default:"none"},maxWidth:{type:[Number,String],default:"none"},zIndex:{type:[Number,String],default:2},open:{type:Boolean,default:!1}},setup(e,{emit:t,slots:n}){let o=null;function i(){t("update:open",!1),o&&(o.close(),o=null)}return Object(c["watch"])(()=>e.open,t=>{if(t){o&&(o.close(),o=null);const t=Object(c["h"])(O,{...e},n),r=Object(c["createApp"])(t);o=r.mount(document.createElement("div")),o.$unmount=r.unmount,setTimeout(()=>{document.addEventListener("click",i),document.addEventListener("contextmenu",i),document.addEventListener("wheel",i)},0)}else document.removeEventListener("click",i),document.removeEventListener("contextmenu",i),document.removeEventListener("wheel",i)}),{}},render(){return null}}),k=g;let w=null;function S(){w&&(w.close(),w=null),document.removeEventListener("click",S),document.removeEventListener("contextmenu",S),document.removeEventListener("wheel",S)}function E(e,t){const n=e||{};w&&(w.close(),w=null,document.removeEventListener("click",S),document.removeEventListener("contextmenu",S),document.removeEventListener("wheel",S));let o=Object(c["createApp"])(O,{event:t,...n});return w=o.mount(document.createElement("div")),w.$unmount=o.unmount,(void 0==n.prevent||n.prevent)&&t.preventDefault(),setTimeout(()=>{document.addEventListener("click",S),document.addEventListener("contextmenu",S),document.addEventListener("wheel",S)},0),w}var I=E;k.install=(e,t={})=>{e.component(t.name||k.name,k)};const C={mounted(e,{value:t,arg:n,instance:o}){void 0===n||"right"===n?e.addEventListener("contextmenu",I.bind(o,t)):"left"===n?e.addEventListener("click",I.bind(o,t)):"all"===n&&(e.addEventListener("contextmenu",I.bind(o,t)),e.addEventListener("click",I.bind(o,t)))},unmounted(e,{arg:t}){void 0===t||"right"===t?e.removeEventListener("contextmenu",I):"left"===t?e.removeEventListener("click",I):"all"===t&&(e.removeEventListener("contextmenu",I),e.removeEventListener("click",I))}},B=function(e,t={}){e.component(t.name||k.name,k),e.directive("menus",C),e.config.globalProperties.$menusEvent=(e,t)=>I(t,e)};"undefined"!==typeof window&&window.Vue&&(window.Vue3Menus=B);const M=(e,t)=>I(t,e);var L=B;t["default"]=L}})})); | ||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["vue3-menus"]=t(require("vue")):e["vue3-menus"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({"21a1":function(e,t,n){var o=n("24fb");t=o(!1),t.push([e.i,".menus-item{display:flex;line-height:2rem;padding:0 1rem;margin:0;font-size:.8rem;outline:0;align-items:center;transition:.2s;box-sizing:border-box;list-style:none;border-bottom:1px solid transparent}.menus-item-divided{border-bottom-color:#ebeef5}.menus-item .menus-item-icon{display:flex;margin-right:.6rem;width:1rem}.menus-item .menus-item-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.menus-item .menus-item-suffix{margin-left:1.5rem;font-size:.39rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.menus-item-available{color:#606266;cursor:pointer}.menus-item-available:hover{background:#ecf5ff;color:#409eff}.menus-item-disabled{color:#c0c4cc;cursor:not-allowed}.menus-item-active{background:#ecf5ff;color:#409eff}.menus-item-tip{font-size:9px;color:#999}",""]),e.exports=t},"24fb":function(e,t,n){"use strict";function o(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"===typeof btoa){var r=i(o),c=o.sources.map((function(e){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(e," */")}));return[n].concat(c).concat([r]).join("\n")}return[n].join("\n")}function i(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t);return"/*# ".concat(n," */")}e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=o(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,o){"string"===typeof e&&(e=[[null,e,""]]);var i={};if(o)for(var r=0;r<this.length;r++){var c=this[r][0];null!=c&&(i[c]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);o&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},"499e":function(e,t,n){"use strict";function o(e,t){for(var n=[],o={},i=0;i<t.length;i++){var r=t[i],c=r[0],s=r[1],l=r[2],a=r[3],u={id:e+":"+i,css:s,media:l,sourceMap:a};o[c]?o[c].parts.push(u):n.push(o[c]={id:c,parts:[u]})}return n}n.r(t),n.d(t,"default",(function(){return p}));var i="undefined"!==typeof document;if("undefined"!==typeof DEBUG&&DEBUG&&!i)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var r={},c=i&&(document.head||document.getElementsByTagName("head")[0]),s=null,l=0,a=!1,u=function(){},d=null,m="data-vue-ssr-id",f="undefined"!==typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function p(e,t,n,i){a=n,d=i||{};var c=o(e,t);return v(c),function(t){for(var n=[],i=0;i<c.length;i++){var s=c[i],l=r[s.id];l.refs--,n.push(l)}t?(c=o(e,t),v(c)):c=[];for(i=0;i<n.length;i++){l=n[i];if(0===l.refs){for(var a=0;a<l.parts.length;a++)l.parts[a]();delete r[l.id]}}}}function v(e){for(var t=0;t<e.length;t++){var n=e[t],o=r[n.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](n.parts[i]);for(;i<n.parts.length;i++)o.parts.push(h(n.parts[i]));o.parts.length>n.parts.length&&(o.parts.length=n.parts.length)}else{var c=[];for(i=0;i<n.parts.length;i++)c.push(h(n.parts[i]));r[n.id]={id:n.id,refs:1,parts:c}}}}function b(){var e=document.createElement("style");return e.type="text/css",c.appendChild(e),e}function h(e){var t,n,o=document.querySelector("style["+m+'~="'+e.id+'"]');if(o){if(a)return u;o.parentNode.removeChild(o)}if(f){var i=l++;o=s||(s=b()),t=x.bind(null,o,i,!1),n=x.bind(null,o,i,!0)}else o=b(),t=g.bind(null,o),n=function(){o.parentNode.removeChild(o)};return t(e),function(o){if(o){if(o.css===e.css&&o.media===e.media&&o.sourceMap===e.sourceMap)return;t(e=o)}else n()}}var y=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function x(e,t,n,o){var i=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=y(t,i);else{var r=document.createTextNode(i),c=e.childNodes;c[t]&&e.removeChild(c[t]),c.length?e.insertBefore(r,c[t]):e.appendChild(r)}}function g(e,t){var n=t.css,o=t.media,i=t.sourceMap;if(o&&e.setAttribute("media",o),d.ssrId&&e.setAttribute(m,t.id),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{while(e.firstChild)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}},"4db7":function(e,t,n){"use strict";n("b27b")},8875:function(e,t,n){var o,i,r;(function(n,c){i=[],o=c,r="function"===typeof o?o.apply(t,i):o,void 0===r||(e.exports=r)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(f){var n,o,i,r=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,c=/@([^@]*):(\d+):(\d+)\s*$/gi,s=r.exec(f.stack)||c.exec(f.stack),l=s&&s[1]||!1,a=s&&s[2]||!1,u=document.location.href.replace(document.location.hash,""),d=document.getElementsByTagName("script");l===u&&(n=document.documentElement.outerHTML,o=new RegExp("(?:[^\\n]+?\\n){0,"+(a-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),i=n.replace(o,"$1").trim());for(var m=0;m<d.length;m++){if("interactive"===d[m].readyState)return d[m];if(d[m].src===l)return d[m];if(l===u&&d[m].innerHTML&&d[m].innerHTML.trim()===i)return d[m]}return null}}return e}))},"8bbf":function(t,n){t.exports=e},"92c7":function(e,t,n){"use strict";n("d1aa")},b27b:function(e,t,n){var o=n("b53e");o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);var i=n("499e").default;i("3995fa16",o,!0,{sourceMap:!1,shadowMode:!1})},b53e:function(e,t,n){var o=n("24fb");t=o(!1),t.push([e.i,".menus[data-v-4450c50e]{position:fixed;box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04);background:#fff;border-radius:4px;padding:8px 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:border-box}.menus_body[data-v-4450c50e]{display:block}.menus-fade-enter-active[data-v-4450c50e],.menus-fade-leave-active[data-v-4450c50e]{transition:opacity .1s ease-in-out}.menus-fade-enter-from[data-v-4450c50e],.menus-fade-leave-to[data-v-4450c50e]{opacity:0}",""]),e.exports=t},d1aa:function(e,t,n){var o=n("21a1");o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);var i=n("499e").default;i("10b4684a",o,!0,{sourceMap:!1,shadowMode:!1})},fb15:function(e,t,n){"use strict";if(n.r(t),n.d(t,"Vue3Menus",(function(){return k})),n.d(t,"directive",(function(){return C})),n.d(t,"menusEvent",(function(){return B})),"undefined"!==typeof window){var o=window.document.currentScript,i=n("8875");o=i(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:i});var r=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var c=n("8bbf");const s=Object(c["withScopeId"])("data-v-4450c50e");Object(c["pushScopeId"])("data-v-4450c50e");const l={class:"menus_body"};Object(c["popScopeId"])();const a=s((function(e,t,n,o,i,r){const a=Object(c["resolveComponent"])("MenusItem");return Object(c["openBlock"])(),Object(c["createBlock"])(c["Teleport"],{to:"body"},[Object(c["createVNode"])(c["Transition"],{name:"menus-fade"},{default:s(()=>[e.open?(Object(c["openBlock"])(),Object(c["createBlock"])("div",{key:0,ref:"menusRef",class:"menus",style:{...e.menusStyle,top:e.style.top+"px",left:e.style.left+"px",minWidth:e.style.minWidth,maxWidth:e.style.maxWidth,zIndex:e.style.zIndex},onContextmenu:t[1]||(t[1]=e=>e.preventDefault()),onMousewheel:t[2]||(t[2]=Object(c["withModifiers"])(()=>{},["stop"]))},[Object(c["createVNode"])("div",l,[(Object(c["openBlock"])(!0),Object(c["createBlock"])(c["Fragment"],null,Object(c["renderList"])(e.menus,(t,n)=>(Object(c["openBlock"])(),Object(c["createBlock"])(c["Fragment"],{key:n},[t.hidden?Object(c["createCommentVNode"])("",!0):(Object(c["openBlock"])(),Object(c["createBlock"])(a,{key:0,item:t,index:n,activeIndex:e.activeIndex,onMenusEnter:e.menusEnter,menusItemClass:e.menusItemClass,hasIcon:e.hasIcon},Object(c["createSlots"])({_:2},[e.slots.default?{name:"default",fn:s(({item:t})=>[Object(c["renderSlot"])(e.$slots,"default",{item:t})])}:void 0,!e.slots.default&&e.slots.icon?{name:"icon",fn:s(({item:t})=>[Object(c["renderSlot"])(e.$slots,"icon",{item:t})])}:void 0,!e.slots.default&&e.slots.label?{name:"label",fn:s(({item:t})=>[Object(c["renderSlot"])(e.$slots,"label",{item:t})])}:void 0,!e.slots.default&&e.slots.suffix?{name:"suffix",fn:s(({item:t})=>[Object(c["renderSlot"])(e.$slots,"suffix",{item:t})])}:void 0]),1032,["item","index","activeIndex","onMenusEnter","menusItemClass","hasIcon"]))],64))),128))])],36)):Object(c["createCommentVNode"])("",!0)]),_:1})])})),u={key:0,class:"menus-item-icon"},d={class:"menus-item-label"},m={class:"menus-item-suffix"},f=Object(c["createTextVNode"])("▶"),p={key:3,class:"menus-item-tip"};function v(e,t,n,o,i,r){const s=Object(c["resolveComponent"])("MenusIcon");return e.slots.default?(Object(c["openBlock"])(),Object(c["createBlock"])("div",{key:0,onMouseenter:t[1]||(t[1]=t=>e.menusEnter(t,e.item)),onClick:t[2]||(t[2]=t=>e.menusClick(t,e.item)),onContextmenu:t[3]||(t[3]=t=>e.menusClick(t,e.item))},[Object(c["renderSlot"])(e.$slots,"default",{item:{activeIndex:e.activeIndex,item:e.item}})],32)):(Object(c["openBlock"])(),Object(c["createBlock"])("div",{key:1,onMouseenter:t[4]||(t[4]=t=>e.menusEnter(t,e.item)),onClick:t[5]||(t[5]=t=>e.menusClick(t,e.item)),onContextmenu:t[6]||(t[6]=t=>e.menusClick(t,e.item)),style:e.item.style?e.item.style:{},class:["menus-item",e.item.disabled?"menus-item-disabled":"menus-item-available",e.item.divided?"menus-divided":null,e.item.disabled||e.activeIndex!==e.index?null:"menus-item-active",e.menusItemClass]},[e.hasIcon?(Object(c["openBlock"])(),Object(c["createBlock"])("div",u,[e.slots.icon?Object(c["renderSlot"])(e.$slots,"icon",{key:0,item:{activeIndex:e.activeIndex,item:e.item}}):e.item.icon?(Object(c["openBlock"])(),Object(c["createBlock"])(c["Fragment"],{key:1},["string"===typeof e.item.icon?(Object(c["openBlock"])(),Object(c["createBlock"])("span",{key:0,innerHTML:e.item.icon},null,8,["innerHTML"])):(Object(c["openBlock"])(),Object(c["createBlock"])(s,{key:1,options:e.item.icon},null,8,["options"]))],64)):Object(c["createCommentVNode"])("",!0)])):Object(c["createCommentVNode"])("",!0),Object(c["createVNode"])("span",d,[e.slots.label?Object(c["renderSlot"])(e.$slots,"label",{key:0,item:{activeIndex:e.activeIndex,item:e.item}}):(Object(c["openBlock"])(),Object(c["createBlock"])(c["Fragment"],{key:1},[Object(c["createTextVNode"])(Object(c["toDisplayString"])(e.item.label),1)],64))]),Object(c["createVNode"])("div",m,[e.item.children&&e.slots.suffix?Object(c["renderSlot"])(e.$slots,"suffix",{key:0,item:{activeIndex:e.activeIndex,item:e.item}}):e.item.children?(Object(c["openBlock"])(),Object(c["createBlock"])(c["Fragment"],{key:1},[f],64)):e.item.tip&&e.slots.suffix?Object(c["renderSlot"])(e.$slots,"suffix",{key:2,item:{activeIndex:e.activeIndex,item:e.item}}):e.item.tip?(Object(c["openBlock"])(),Object(c["createBlock"])("span",p,Object(c["toDisplayString"])(e.item.tip),1)):Object(c["createCommentVNode"])("",!0)])],38))}var b=Object(c["defineComponent"])({name:"Vue3Menus",props:{options:{type:[Function,Object],default:{}}},render(){return"function"===typeof this.$props.options?Object(c["h"])(this.$props.options):"function"==typeof this.$props.options.node||"object"==typeof this.$props.options.node?Object(c["h"])(this.$props.options.node,this.$props.options.option):"object"!==typeof this.$props.options||this.$props.options.node?null:Object(c["h"])(this.$props.options)}}),h=b,y=Object(c["defineComponent"])({name:"menus-item",components:{MenusIcon:h},props:{menusItemClass:{type:String,default:null},hasIcon:{type:Boolean,default:!1},item:{type:Object,default:{}},index:{type:Number,default:0},activeIndex:{type:Number,default:-1}},setup(e,{emit:t,slots:n}){function o(n,o){t("menusEnter",n,o,e.index),n.preventDefault()}function i(e,t){if(e.preventDefault(),t.disabled)e.stopPropagation();else if(t&&!t.disabled&&!t.hidden&&"function"===typeof t.click){const n=t.click(t);!1!==n&&null!==n||e.stopPropagation()}}return{slots:n,menusEnter:o,menusClick:i}}});n("92c7");y.render=v;var x=y,g=Object(c["defineComponent"])({name:"menus",components:{MenusItem:x},props:{menus:{type:Array,default:[]},menusStyle:{type:Object,default:{}},menusItemClass:{type:String,default:null},event:{type:Object,default:{}},position:{type:Object,default:{}},minWidth:{type:[Number,String],default:"none"},maxWidth:{type:[Number,String],default:"none"},zIndex:{type:[Number,String],default:3},direction:{type:String,default:"right"},open:{type:Boolean,default:!1}},setup(e,{slots:t}){const n={},o=globalThis.document.documentElement.clientWidth,i=globalThis.document.documentElement.clientHeight,r=e.position.x&&e.position.y?Object(c["ref"])(e.position):Object(c["ref"])({x:e.event.clientX,y:e.event.clientY,width:0,height:0}),s=Object(c["ref"])(null),l=Object(c["ref"])({left:0,top:0,minWidth:e.minWidth+"px",maxWidth:"none"==e.maxWidth?e.maxWidth:e.maxWidth+"px",zIndex:e.zIndex}),a=Object(c["ref"])(e.direction),u=Object(c["ref"])(-1),d=Object(c["ref"])(!1),m=Object(c["ref"])(!1);function f(e){l.value.left=r.value.x-e,a.value="left",l.value.left<0&&(a.value="right",0===r.value.width||void 0===r.value.width?l.value.left=0:l.value.left=r.valuen.x+r.value.width)}function p(e,t){l.value.left=r.value.x+r.value.width,a.value="right",l.value.left+t>e&&(a.value="left",0===r.value.width||void 0===r.value.width?l.value.left=e-t:l.value.left=r.value.x-t)}function v(o,i,r){if(u.value=r,i.disabled)return;if(n.instance){if(n.index===r)return;n.instance.close.bind(n.instance)(),n.instance=null,n.index=null}if(!i.children)return;const s=o.target.getBoundingClientRect(),l=Object(c["h"])(j,{...e,menus:i.children||[],direction:a.value,position:{x:s.x+3,y:s.y-8,width:s.width-6,height:s.width}},t),d=Object(c["createApp"])(l);n.instance=d.mount(globalThis.document.createElement("div")),n.instance.$unmount=d.unmount,n.index=r,o.preventDefault()}function b(){d.value=!1,this&&this.ctx&&this.ctx.instance&&this.ctx.instance.close(),Object(c["nextTick"])(()=>{this.$unmount()&&this.$unmount()})}return Object(c["onMounted"])(()=>{d.value=!0,e.menus.forEach(e=>{m.value=m.value||void 0!==e.icon,m.value}),Object(c["nextTick"])(()=>{const e=s.value.offsetWidth,t=s.value.offsetHeight;"left"===a.value?f(e):p(o,e),l.value.top=r.value.y,r.value.y+t>i&&(0===r.value.height||void 0===r.value.height?l.value.top=r.value.y-t:l.value.top=i-t)})}),{open:d,hasIcon:m,menusRef:s,style:l,close:b,menusEnter:v,ctx:n,activeIndex:u,slots:t}}});n("4db7");g.render=a,g.__scopeId="data-v-4450c50e";var j=g,O=Object(c["defineComponent"])({name:"Vue3Menus",props:{menus:{type:Array,default:[]},menusStyle:{type:Object,default:{}},menusItemClass:{type:String,default:null},event:{type:Object,default:{}},position:{type:Object,default:{}},minWidth:{type:[Number,String],default:"none"},maxWidth:{type:[Number,String],default:"none"},zIndex:{type:[Number,String],default:2},open:{type:Boolean,default:!1}},setup(e,{emit:t,slots:n}){let o=null;function i(){t("update:open",!1),o&&(o.close(),o=null)}return Object(c["watch"])(()=>e.open,t=>{if(t){o&&(o.close(),o=null);const t=Object(c["h"])(j,{...e},n),r=Object(c["createApp"])(t);o=r.mount(globalThis.document.createElement("div")),o.$unmount=r.unmount,setTimeout(()=>{globalThis.document.addEventListener("click",i),globalThis.document.addEventListener("contextmenu",i),globalThis.document.addEventListener("wheel",i)},0)}else globalThis.document.removeEventListener("click",i),globalThis.document.removeEventListener("contextmenu",i),globalThis.document.removeEventListener("wheel",i)}),{}},render(){return null}}),k=O;let w=null;function S(){w&&(w.close(),w=null),globalThis.document.removeEventListener("click",S),globalThis.document.removeEventListener("contextmenu",S),globalThis.document.removeEventListener("wheel",S)}function E(e,t){const n=e||{};w&&(w.close(),w=null,globalThis.document.removeEventListener("click",S),globalThis.document.removeEventListener("contextmenu",S),globalThis.document.removeEventListener("wheel",S));let o=Object(c["createApp"])(j,{event:t,...n});return w=o.mount(globalThis.document.createElement("div")),w.$unmount=o.unmount,(void 0==n.prevent||n.prevent)&&t.preventDefault(),setTimeout(()=>{globalThis.document.addEventListener("click",S),globalThis.document.addEventListener("contextmenu",S),globalThis.document.addEventListener("wheel",S)},0),w}var I=E;k.install=(e,t={})=>{e.component(t.name||k.name,k)};const C={mounted(e,{value:t,arg:n,instance:o}){void 0===n||"right"===n?e.addEventListener("contextmenu",I.bind(o,t)):"left"===n?e.addEventListener("click",I.bind(o,t)):"all"===n&&(e.addEventListener("contextmenu",I.bind(o,t)),e.addEventListener("click",I.bind(o,t)))},unmounted(e,{arg:t}){void 0===t||"right"===t?e.removeEventListener("contextmenu",I):"left"===t?e.removeEventListener("click",I):"all"===t&&(e.removeEventListener("contextmenu",I),e.removeEventListener("click",I))}},T=function(e,t={}){e.component(t.name||k.name,k),e.directive("menus",C),e.config.globalProperties.$menusEvent=(e,t)=>I(t,e)};"undefined"!==typeof window&&window.Vue&&(window.Vue3Menus=T);const B=(e,t)=>I(t,e);var M=T;t["default"]=M}})})); | ||
//# sourceMappingURL=vue3-menus.umd.min.js.map |
{ | ||
"name": "vue3-menus", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"author": "xufangyi", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -416,3 +416,11 @@ # vue3-menus | ||
| :-----: | :--------------: | :-------: | :------: | :-----: | :-----------------------------------------------: | | ||
| open | 控制菜单组件显示 | `boolean` | `true` | `false` | `false` | | ||
| menus | 菜单列表信息 | `MenusItemOptions[]` | `true` | [] | | ||
| menusStyle | 菜单容器的样式 | `object` | `false` | {} | | ||
| menusItemClass | 菜单每一项的`class`名 | `string` | `false` | `null` | | ||
| event | 鼠标事件信息(指令使用时可以不传) | `Event` | 与`position`必填一项 | {} | | ||
| position | 手动传入菜单显示位置(指令使用时可以不传) | `{x: number, y: number}` | 与`event`必填一项 | {} | | ||
| minWidth | 菜单容器最小宽度 | `number` \| `string` | `false` | `none` | | ||
| maxWidth | 菜单容器最打宽度 | `number` \| `string` | `false` | `none` | | ||
| zIndex | 菜单层级 | `number` \| `string` | `false` | `3` | | ||
| open | 控制菜单组件显示: `v-model:open` | `boolean` | `true` | `false` | `false` | | ||
| default | 默认插槽 | `Slot` | `false` | - | `activeIndex`: 当前选中项, `item`: 当前菜单属性值 | | ||
@@ -419,0 +427,0 @@ | icon | 图标插槽 | `Slot` | `false` | - | `activeIndex`: 当前选中项, `item`: 当前菜单属性值 | |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
359823
2471
438