├── .browserslistrc ├── docs ├── favicon.ico ├── index.html ├── css │ └── app.ab729f6d.css └── js │ ├── app.9813dfc7.js │ ├── app.9813dfc7.js.map │ └── chunk-vendors.bd4bde2f.js ├── public ├── favicon.ico └── index.html ├── src ├── components │ ├── bus.ts │ ├── hideContext.ts │ ├── emitContext.ts │ ├── directive.ts │ ├── ContextMenuItem.vue │ ├── ContextMenuSubmenu.vue │ └── ContextMenu.vue ├── shims-vue.d.ts ├── main.ts ├── index.ts └── App.vue ├── babel.config.js ├── vue.config.js ├── .editorconfig ├── types └── vue3-contextmenu.d.ts ├── dist ├── demo.html ├── vue3-contextmenu.css └── vue3-contextmenu.umd.min.js ├── .gitignore ├── .eslintrc.js ├── tsconfig.json ├── LICENSE ├── package.json └── README.md /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hunlongyu/vue3-contextmenu/HEAD/docs/favicon.ico -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hunlongyu/vue3-contextmenu/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /src/components/bus.ts: -------------------------------------------------------------------------------- 1 | import mitt from 'mitt' 2 | const emitter = mitt() 3 | export default emitter 4 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /src/components/hideContext.ts: -------------------------------------------------------------------------------- 1 | import bus from './bus' 2 | 3 | export default function () { 4 | bus.emit('hide-contextmenu') 5 | } 6 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | publicPath: './' 3 | // outputDir: 'docs' // close: build lib. open: build docs site 4 | } 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{js,jsx,ts,tsx,vue}] 2 | indent_style = space 3 | indent_size = 2 4 | trim_trailing_whitespace = true 5 | insert_final_newline = true 6 | -------------------------------------------------------------------------------- /src/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import type { DefineComponent } from 'vue' 3 | const component: DefineComponent<{}, {}, any> 4 | export default component 5 | } 6 | -------------------------------------------------------------------------------- /types/vue3-contextmenu.d.ts: -------------------------------------------------------------------------------- 1 | import { DefineComponent, Plugin } from 'vue'; 2 | 3 | declare const vue3Contextmenu: DefineComponent & { install: Exclude }; 4 | export default vue3Contextmenu; 5 | -------------------------------------------------------------------------------- /dist/demo.html: -------------------------------------------------------------------------------- 1 | 2 | vue3-contextmenu demo 3 | 4 | 5 | 6 | 7 | 8 | 11 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import contextmenu from './index' 4 | // import contextmenu from 'vue3-contextmenu' 5 | // import 'vue3-contextmenu/dist/vue3-contextmenu.css' 6 | const app = createApp(App) 7 | app.use(contextmenu) 8 | app.mount('#app') 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | pnpm-debug.log* 14 | 15 | # Editor directories and files 16 | .idea 17 | .vscode 18 | *.suo 19 | *.ntvs* 20 | *.njsproj 21 | *.sln 22 | *.sw? 23 | -------------------------------------------------------------------------------- /src/components/emitContext.ts: -------------------------------------------------------------------------------- 1 | import bus from './bus' 2 | 3 | export default function ($event: MouseEvent, value: Record) { 4 | $event.preventDefault() 5 | bus.emit('add-contextmenu', { x: $event.clientX, y: $event.clientY, value }) 6 | document.addEventListener('click', () => { bus.emit('hide-contextmenu') }) 7 | } 8 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | extends: [ 7 | 'plugin:vue/vue3-essential', 8 | '@vue/standard', 9 | '@vue/typescript/recommended' 10 | ], 11 | parserOptions: { 12 | ecmaVersion: 2020 13 | }, 14 | rules: { 15 | 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 16 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off' 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/components/directive.ts: -------------------------------------------------------------------------------- 1 | import bus from './bus' 2 | import { DirectiveBinding } from 'vue' 3 | const onMounted = (el: HTMLElement, binding: DirectiveBinding) => { 4 | el.addEventListener('contextmenu', e => { 5 | e.preventDefault() 6 | bus.emit('add-contextmenu', { x: e.clientX, y: e.clientY, value: binding.value }) 7 | }) 8 | document.addEventListener('click', () => { 9 | bus.emit('hide-contextmenu') 10 | }) 11 | } 12 | 13 | const unmounted = () => { 14 | bus.emit('hide-contextmenu') 15 | } 16 | 17 | export default { 18 | mounted: onMounted, 19 | unmounted: unmounted 20 | } 21 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | vue3-contextmenu
-------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "esnext", 5 | "strict": true, 6 | "jsx": "preserve", 7 | "importHelpers": true, 8 | "moduleResolution": "node", 9 | "skipLibCheck": true, 10 | "esModuleInterop": true, 11 | "allowSyntheticDefaultImports": true, 12 | "sourceMap": true, 13 | "baseUrl": ".", 14 | "types": [ 15 | "webpack-env" 16 | ], 17 | "paths": { 18 | "@/*": [ 19 | "src/*" 20 | ] 21 | }, 22 | "lib": [ 23 | "esnext", 24 | "dom", 25 | "dom.iterable", 26 | "scripthost" 27 | ] 28 | }, 29 | "include": [ 30 | "src/**/*.ts", 31 | "src/**/*.tsx", 32 | "src/**/*.vue", 33 | "tests/**/*.ts", 34 | "tests/**/*.tsx"], 35 | "exclude": [ 36 | "node_modules" 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import directive from './components/directive' 3 | import emitContext from './components/emitContext' 4 | import hideContext from './components/hideContext' 5 | 6 | import Contextmenu from './components/ContextMenu.vue' 7 | import ContextmenuItem from './components/ContextMenuItem.vue' 8 | import ContextmenuSubmenu from './components/ContextMenuSubmenu.vue' 9 | 10 | const install = (app: App): void => { 11 | app.provide('emitContext', emitContext) 12 | app.provide('hideContext', hideContext) 13 | app.directive('contextmenu', directive) 14 | app.component(Contextmenu.name, Contextmenu) 15 | app.component(ContextmenuItem.name, ContextmenuItem) 16 | app.component(ContextmenuSubmenu.name, ContextmenuSubmenu) 17 | } 18 | 19 | export { 20 | emitContext, 21 | hideContext, 22 | directive, 23 | Contextmenu, 24 | ContextmenuItem, 25 | ContextmenuSubmenu 26 | } 27 | 28 | export default { 29 | install 30 | } 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Hunlongyu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dist/vue3-contextmenu.css: -------------------------------------------------------------------------------- 1 | .v-contextmenu[data-v-f9312e22]{position:fixed;top:0;left:0;color:#444;display:inline-block;background-color:#fff;box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04)}.v-contextmenu-item[data-v-3470b981]{cursor:pointer;background-color:#fff;padding:10px 20px;font-size:14px;white-space:nowrap}.v-contextmenu-item[data-v-3470b981]:hover{color:#409eff;background-color:#f2f8fe}.v-contextmenu-item--disabled[data-v-3470b981]{color:#c0c4cc;cursor:not-allowed;pointer-events:none}.v-contextmenu-divider[data-v-3470b981]{border-bottom:1px solid #ebebeb;box-sizing:border-box;height:1px}.v-contextmenu-submenu[data-v-589b6ec6]{position:relative}.v-contextmenu-submenu--hover>.v-contextmenu-submenu-label[data-v-589b6ec6]{color:#409eff;background-color:#f2f8fe}.v-contextmenu-submenu-label[data-v-589b6ec6]{cursor:pointer;padding:10px 20px;font-size:14px;display:flex;justify-content:space-between;white-space:nowrap}.v-contextmenu-submenu-children[data-v-589b6ec6]{position:absolute;left:100%;top:0;box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04)}.v-contextmenu-submenu-right[data-v-589b6ec6]{box-sizing:border-box;position:relative;display:block;width:14px;height:14px;border:2px solid transparent;border-radius:100px;margin-left:30px;margin-right:-8px}.v-contextmenu-submenu-right[data-v-589b6ec6]:after{content:"";display:block;box-sizing:border-box;position:absolute;width:7px;height:7px;border-bottom:2px solid;border-right:2px solid;transform:rotate(-45deg);right:6px;top:4px;opacity:.6}.v-contextmenu-divider[data-v-589b6ec6]{border-bottom:1px solid #ebebeb;box-sizing:border-box;height:1px} -------------------------------------------------------------------------------- /src/components/ContextMenuItem.vue: -------------------------------------------------------------------------------- 1 | 9 | 42 | 65 | -------------------------------------------------------------------------------- /docs/css/app.ab729f6d.css: -------------------------------------------------------------------------------- 1 | #app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50;margin-top:60px}.demo{width:400px;height:200px;background-color:#ddd;display:flex;margin:100px auto;justify-content:center;align-items:center}.v-contextmenu[data-v-f9312e22]{position:fixed;top:0;left:0;color:#444;display:inline-block;background-color:#fff;box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04)}.v-contextmenu-item[data-v-3470b981]{cursor:pointer;background-color:#fff;padding:10px 20px;font-size:14px;white-space:nowrap}.v-contextmenu-item[data-v-3470b981]:hover{color:#409eff;background-color:#f2f8fe}.v-contextmenu-item--disabled[data-v-3470b981]{color:#c0c4cc;cursor:not-allowed;pointer-events:none}.v-contextmenu-divider[data-v-3470b981]{border-bottom:1px solid #ebebeb;box-sizing:border-box;height:1px}.v-contextmenu-submenu[data-v-589b6ec6]{position:relative}.v-contextmenu-submenu--hover>.v-contextmenu-submenu-label[data-v-589b6ec6]{color:#409eff;background-color:#f2f8fe}.v-contextmenu-submenu-label[data-v-589b6ec6]{cursor:pointer;padding:10px 20px;font-size:14px;display:flex;justify-content:space-between;white-space:nowrap}.v-contextmenu-submenu-children[data-v-589b6ec6]{position:absolute;left:100%;top:0;box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04)}.v-contextmenu-submenu-right[data-v-589b6ec6]{box-sizing:border-box;position:relative;display:block;width:14px;height:14px;border:2px solid transparent;border-radius:100px;margin-left:30px;margin-right:-8px}.v-contextmenu-submenu-right[data-v-589b6ec6]:after{content:"";display:block;box-sizing:border-box;position:absolute;width:7px;height:7px;border-bottom:2px solid;border-right:2px solid;transform:rotate(-45deg);right:6px;top:4px;opacity:.6}.v-contextmenu-divider[data-v-589b6ec6]{border-bottom:1px solid #ebebeb;box-sizing:border-box;height:1px} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue3-contextmenu", 3 | "version": "0.2.12", 4 | "private": false, 5 | "description": "vue3 contextmenu, vue3 右键菜单", 6 | "homepage": "https://hunlongyu.github.io/vue3-contextmenu/", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/Hunlongyu/vue3-contextmenu.git" 10 | }, 11 | "bugs": { 12 | "url": "https://github.com/Hunlongyu/vue3-contextmenu/issues", 13 | "email": "hunlongyu@gmail.com" 14 | }, 15 | "keywords": [ 16 | "vue3", 17 | "vue", 18 | "typescript", 19 | "contextmenu", 20 | "右键菜单", 21 | "菜单", 22 | "context", 23 | "menu" 24 | ], 25 | "author": { 26 | "name": "hunlongyu", 27 | "email": "hunlongyu@gmail.com", 28 | "url": "https://github.com/Hunlongyu" 29 | }, 30 | "license": "MIT", 31 | "main": "./dist/vue3-contextmenu.common.js", 32 | "typings": "dist/vue3-contextmenu.d.ts", 33 | "types": "dist/vue3-contextmenu.d.ts", 34 | "files": [ 35 | "dist" 36 | ], 37 | "scripts": { 38 | "serve": "vue-cli-service serve", 39 | "build": "vue-cli-service build", 40 | "lint": "vue-cli-service lint", 41 | "build:lib": "vue-cli-service build --target lib --vue3-contextmenu main ./src/index.ts" 42 | }, 43 | "dependencies": { 44 | "core-js": "^3.6.5", 45 | "mitt": "^2.1.0", 46 | "vue": "^3.0.0" 47 | }, 48 | "devDependencies": { 49 | "@typescript-eslint/eslint-plugin": "^2.33.0", 50 | "@typescript-eslint/parser": "^2.33.0", 51 | "@vue/cli-plugin-babel": "~4.5.0", 52 | "@vue/cli-plugin-eslint": "~4.5.0", 53 | "@vue/cli-plugin-typescript": "~4.5.0", 54 | "@vue/cli-service": "~4.5.0", 55 | "@vue/compiler-sfc": "^3.0.0", 56 | "@vue/eslint-config-standard": "^5.1.2", 57 | "@vue/eslint-config-typescript": "^5.0.2", 58 | "eslint": "^6.7.2", 59 | "eslint-plugin-import": "^2.20.2", 60 | "eslint-plugin-node": "^11.1.0", 61 | "eslint-plugin-promise": "^4.2.1", 62 | "eslint-plugin-standard": "^4.0.0", 63 | "eslint-plugin-vue": "^7.0.0-0", 64 | "typescript": "~3.9.3" 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/components/ContextMenuSubmenu.vue: -------------------------------------------------------------------------------- 1 | 15 | 41 | 95 | -------------------------------------------------------------------------------- /src/components/ContextMenu.vue: -------------------------------------------------------------------------------- 1 | 8 | 79 | 90 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 56 | 57 | 82 | 83 | 102 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 注意 `同页面多菜单--->需传参指定ContextMenu Name` 2 | 3 | # vue3-contextmenu 4 | 5 | 由 Vue3 和 Typescript 编写的 Contextmenu 右键菜单组件。 6 | 7 | [官网 & 文档 & 示例](https://hunlongyu.github.io/vue3-contextmenu/) 8 | 9 | ### 截图 10 | ![vue3-contextmenu.png](https://i.loli.net/2021/01/06/n8JgY9MW5bqeax2.png) 11 | 12 | ### 安装 13 | ```bash 14 | $ npm i -S vue3-contextmenu 15 | 16 | # or 17 | 18 | $ yarn add vue3-contextmenu 19 | ``` 20 | 21 | ### 使用 22 | 23 | mian.ts 24 | ```js 25 | import contextmenu from 'vue3-contextmenu' 26 | import 'vue3-contextmenu/dist/vue3-contextmenu.css' 27 | app.use(contextmenu) 28 | ``` 29 | 30 | app.vue 31 | ```html 32 | 66 | 67 | 92 | ``` 93 | 94 | ### 说明 95 | 96 | | 参数 | 说明 | 类型 | 默认值 | 97 | | -------- | -------------------- | ------- | ------- | 98 | | label | 子菜单标题文字 | String | `null` | 99 | | disabled | 是否禁用菜单 | Boolean | `false` | 100 | | divider | 是否在下方显示分割线 | Boolean | `false` | 101 | | itemClickHandle | 菜单绑定的点击事件, 参数为自定义数据。如: `{ id: 123 }` | any | `undefinded` | 102 | 103 | 104 | 可根据 `class` 自定义样式覆盖 105 | 106 | * `v-contextmenu`: 根元素 107 | * `v-contextmenu-item`: 单个菜单 108 | * `v-contextmenu-item:hover`: 单个菜单鼠标悬浮激活状态 109 | * `v-contextmenu-item--disabled`: 单个菜单禁用状态 110 | * `v-contextmenu-divider`: 分割线 111 | * `v-contextmenu-submenu-label`: 子菜单标题 112 | * `v-contextmenu-submenu-right`: 子菜单向右箭头 113 | * `v-contextmenu-submenu-children`: 子菜单容器 114 | 115 | 116 | 117 | 118 | ## Project setup 119 | ``` 120 | yarn install 121 | yarn serve 122 | yarn build 123 | yarn lint 124 | ``` 125 | 126 | 127 | # vue3-contextmenu (ENGLISH TRANSLATION) 128 | 129 | English translation (with the help of google translator) !ONLY! 130 | 131 | Right-click menu component for Vue3 writte in Typescript 132 | 133 | Official website, documentation and example in chinese (https://hunlongyu.github.io/vue3-contextmenu/) 134 | 135 | ### Screenshot 136 | ![vue3-contextmenu.png](https://i.loli.net/2021/01/06/n8JgY9MW5bqeax2.png) 137 | 138 | ### Installation 139 | ```bash 140 | $ npm i -S vue3-contextmenu 141 | 142 | # or 143 | 144 | $ yarn add vue3-contextmenu 145 | ``` 146 | 147 | ### How-To 148 | 149 | main.ts 150 | ```js 151 | import contextmenu from 'vue3-contextmenu' 152 | import 'vue3-contextmenu/dist/vue3-contextmenu.css' 153 | app.use(contextmenu) 154 | ``` 155 | 156 | app.vue 157 | ```html 158 | 192 | 193 | 218 | ``` 219 | 220 | ### 说明 221 | 222 | | 参数 | 说明 | 类型 | 默认值 | 223 | | -------- | -------------------- | ------- | ------- | 224 | | label | Submenu title text | String | `null` | 225 | | disabled | Toggle enable_/disable of menu | Boolean | `false` | 226 | | divider | Show dividing line below item | Boolean | `false` | 227 | | itemClickHandle | Event on element click, contains custom id as event attribute `id´ | any | `undefinded` | 228 | 229 | 230 | Css classes that may be customized 231 | 232 | * `v-contextmenu`: Root element 233 | * `v-contextmenu-item`: contextmenu item 234 | * `v-contextmenu-item:hover`: contextmenu item, in hovered state 235 | * `v-contextmenu-item--disabled`: contextmenu item, disabled state 236 | * `v-contextmenu-divider`: menu divider line 237 | * `v-contextmenu-submenu-label`: Submenu title 238 | * `v-contextmenu-submenu-right`: Right arrow in submenu 239 | * `v-contextmenu-submenu-children`: submenu container 240 | 241 | 242 | 243 | 244 | ## Project setup 245 | ``` 246 | yarn install 247 | yarn serve 248 | yarn build 249 | yarn lint 250 | ``` 251 | -------------------------------------------------------------------------------- /docs/js/app.9813dfc7.js: -------------------------------------------------------------------------------- 1 | (function(e){function t(t){for(var c,o,i=t[0],l=t[1],a=t[2],f=0,d=[];fo&&(c.top-=a),e+l>r&&(c.left-=l),c.top<0&&(c.top=a\r\n
\r\n

Vue3-contextmenu 右键菜单

\r\n
右键 - ContextMenu 1
\r\n
右键 - ContextMenu 2
\r\n
右键点击区域{ id: [1, 2, 3]}
\r\n \r\n \r\n 图标\r\n 列表\r\n 详细信息\r\n \r\n \r\n 名称\r\n 日期\r\n 类型\r\n 大小\r\n 时长\r\n \r\n 刷新\r\n 停止\r\n \r\n 二级菜单\r\n \r\n 三级菜单\r\n 嵌套菜单\r\n \r\n \r\n \r\n 新建文件\r\n 新建文件夹\r\n 快捷方式\r\n \r\n 属性\r\n \r\n\r\n \r\n \r\n 图标\r\n 列表\r\n 详细信息\r\n \r\n 属性\r\n \r\n\r\n \r\n \r\n 图标\r\n 列表\r\n 详细信息\r\n \r\n 属性\r\n \r\n
\r\n\r\n\r\n\r\n\r\n\r\n","\r\n\r\nimport { inject } from 'vue'\r\n\r\nexport default {\r\n name: 'App',\r\n setup () {\r\n const emitContext = inject('emitContext') as (event: Event, dataId: Record) => void\r\n\r\n function refresh () {\r\n alert('刷新')\r\n }\r\n\r\n function openContextMenu (e: any) {\r\n emitContext(e, { name: 'context-menu-3', id: [1, 2, 3] })\r\n }\r\n\r\n function itemClickEvent (e: any) {\r\n console.log('停止,自定义id:' + e.id)\r\n }\r\n\r\n return { refresh, itemClickEvent, openContextMenu }\r\n }\r\n}\r\n","import { render } from \"./App.vue?vue&type=template&id=9826fb66\"\nimport script from \"./App.vue?vue&type=script&lang=ts\"\nexport * from \"./App.vue?vue&type=script&lang=ts\"\n\nimport \"./App.vue?vue&type=style&index=0&id=9826fb66&lang=css\"\nscript.render = render\n\nexport default script","import mitt from 'mitt'\r\nconst emitter = mitt()\r\nexport default emitter\r\n","import bus from './bus'\r\nimport { DirectiveBinding } from 'vue'\r\nconst onMounted = (el: HTMLElement, binding: DirectiveBinding) => {\r\n el.addEventListener('contextmenu', e => {\r\n e.preventDefault()\r\n bus.emit('add-contextmenu', { x: e.clientX, y: e.clientY, value: binding.value })\r\n })\r\n document.addEventListener('click', () => {\r\n bus.emit('hide-contextmenu')\r\n })\r\n}\r\n\r\nconst unmounted = () => {\r\n bus.emit('hide-contextmenu')\r\n}\r\n\r\nexport default {\r\n mounted: onMounted,\r\n unmounted: unmounted\r\n}\r\n","import bus from './bus'\r\n\r\nexport default function ($event: MouseEvent, value: Record) {\r\n $event.preventDefault()\r\n bus.emit('add-contextmenu', { x: $event.clientX, y: $event.clientY, value })\r\n document.addEventListener('click', () => { bus.emit('hide-contextmenu') })\r\n}\r\n","import bus from './bus'\r\n\r\nexport default function ($event: MouseEvent) {\r\n $event.preventDefault()\r\n bus.emit('hide-contextmenu')\r\n}\r\n","\r\n\r\n\r\n","\r\nimport { defineComponent, ref, onMounted, nextTick } from 'vue'\r\nimport bus from './bus'\r\nexport default defineComponent({\r\n name: 'ContextMenu',\r\n props: {\r\n cutomClass: String,\r\n name: String\r\n },\r\n setup () {\r\n const show = ref(false)\r\n const contextmenu = ref()\r\n const bindingValue = ref()\r\n\r\n function getPosition (x: number, y: number) {\r\n const style = { top: y, left: x }\r\n const { innerWidth, innerHeight } = window\r\n if (contextmenu.value) {\r\n const el: HTMLDivElement = contextmenu.value\r\n const { clientWidth: elWidth, clientHeight: elHeight } = el\r\n if (y + elHeight > innerHeight) {\r\n style.top -= elHeight\r\n }\r\n if (x + elWidth > innerWidth) {\r\n style.left -= elWidth\r\n }\r\n if (style.top < 0) {\r\n style.top = elHeight < innerHeight ? (innerHeight - elHeight) / 2 : 0\r\n }\r\n if (style.left < 0) {\r\n style.left = elWidth < innerWidth ? (innerWidth - elWidth) / 2 : 0\r\n }\r\n return style\r\n }\r\n }\r\n\r\n async function showMenu (x: number, y: number, val?: object) {\r\n show.value = true\r\n bindingValue.value = { ...val }\r\n bus.emit('bindValue', bindingValue.value)\r\n await nextTick()\r\n if (contextmenu.value) {\r\n const el: HTMLDivElement = contextmenu.value\r\n const p = getPosition(x, y)\r\n if (p) {\r\n el.style.top = `${p.top + 5}px`\r\n el.style.left = `${p.left + 5}px`\r\n }\r\n }\r\n }\r\n\r\n function hideMenu () {\r\n show.value = false\r\n }\r\n\r\n onMounted(() => {\r\n bus.on('add-contextmenu', e => {\r\n showMenu(e.x, e.y, e.value)\r\n })\r\n bus.on('hide-contextmenu', () => {\r\n hideMenu()\r\n })\r\n bus.on('item-click', () => {\r\n show.value = false\r\n })\r\n })\r\n\r\n return { bindingValue, show, contextmenu }\r\n }\r\n})\r\n","import { render } from \"./ContextMenu.vue?vue&type=template&id=f9312e22&scoped=true\"\nimport script from \"./ContextMenu.vue?vue&type=script&lang=ts\"\nexport * from \"./ContextMenu.vue?vue&type=script&lang=ts\"\n\nimport \"./ContextMenu.vue?vue&type=style&index=0&id=f9312e22&scoped=true&lang=css\"\nscript.render = render\nscript.__scopeId = \"data-v-f9312e22\"\n\nexport default script","\r\n\r\n\r\n","\r\nimport { reactive, computed, defineComponent, onMounted } from 'vue'\r\nimport bus from './bus'\r\nexport default defineComponent({\r\n name: 'ContextMenuItem',\r\n props: {\r\n disabled: Boolean,\r\n divider: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n setup (props, { emit }) {\r\n const val = reactive({ value: {} })\r\n function handleClick () {\r\n emit('itemClickHandle', val.value)\r\n bus.emit('item-click')\r\n }\r\n\r\n onMounted(() => {\r\n bus.on('bindValue', e => {\r\n val.value = e\r\n })\r\n })\r\n\r\n const itemClass = reactive({\r\n 'v-contextmenu-item--disabled': computed(() => props.disabled)\r\n })\r\n\r\n return { itemClass, handleClick }\r\n }\r\n})\r\n","import { render } from \"./ContextMenuItem.vue?vue&type=template&id=3470b981&scoped=true\"\nimport script from \"./ContextMenuItem.vue?vue&type=script&lang=ts\"\nexport * from \"./ContextMenuItem.vue?vue&type=script&lang=ts\"\n\nimport \"./ContextMenuItem.vue?vue&type=style&index=0&id=3470b981&scoped=true&lang=css\"\nscript.render = render\nscript.__scopeId = \"data-v-3470b981\"\n\nexport default script","\r\n\r\n\r\n","\r\nimport { defineComponent, ref } from 'vue'\r\nexport default defineComponent({\r\n name: 'ContextMenuSubmenu',\r\n props: {\r\n label: String,\r\n divider: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n setup () {\r\n const hover = ref(false)\r\n\r\n function mouseEnterEvent () {\r\n hover.value = true\r\n }\r\n\r\n function mouseLeaveEvent () {\r\n hover.value = false\r\n }\r\n\r\n return { hover, mouseEnterEvent, mouseLeaveEvent }\r\n }\r\n})\r\n","import { render } from \"./ContextMenuSubmenu.vue?vue&type=template&id=589b6ec6&scoped=true\"\nimport script from \"./ContextMenuSubmenu.vue?vue&type=script&lang=ts\"\nexport * from \"./ContextMenuSubmenu.vue?vue&type=script&lang=ts\"\n\nimport \"./ContextMenuSubmenu.vue?vue&type=style&index=0&id=589b6ec6&scoped=true&lang=css\"\nscript.render = render\nscript.__scopeId = \"data-v-589b6ec6\"\n\nexport default script","import { App } from 'vue'\r\nimport directive from './components/directive'\r\nimport emitContext from './components/emitContext'\r\nimport hideContext from './components/hideContext'\r\n\r\nimport Contextmenu from './components/ContextMenu.vue'\r\nimport ContextmenuItem from './components/ContextMenuItem.vue'\r\nimport ContextmenuSubmenu from './components/ContextMenuSubmenu.vue'\r\n\r\nconst install = (app: App): void => {\r\n app.provide('emitContext', emitContext)\r\n app.provide('hideContext', hideContext)\r\n app.directive('contextmenu', directive)\r\n app.component(Contextmenu.name, Contextmenu)\r\n app.component(ContextmenuItem.name, ContextmenuItem)\r\n app.component(ContextmenuSubmenu.name, ContextmenuSubmenu)\r\n}\r\n\r\nexport {\r\n emitContext,\r\n hideContext,\r\n directive,\r\n Contextmenu,\r\n ContextmenuItem,\r\n ContextmenuSubmenu\r\n}\r\n\r\nexport default {\r\n install\r\n}\r\n","import { createApp } from 'vue'\r\nimport App from './App.vue'\r\nimport contextmenu from './index'\r\n// import contextmenu from 'vue3-contextmenu'\r\n// import 'vue3-contextmenu/dist/vue3-contextmenu.css'\r\nconst app = createApp(App)\r\napp.use(contextmenu)\r\napp.mount('#app')\r\n","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.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/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./ContextMenuItem.vue?vue&type=style&index=0&id=3470b981&scoped=true&lang=css\""],"sourceRoot":""} -------------------------------------------------------------------------------- /dist/vue3-contextmenu.umd.min.js: -------------------------------------------------------------------------------- 1 | (function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("vue")):"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["vue3-contextmenu"]=e(require("vue")):t["vue3-contextmenu"]=e(t["Vue"])})("undefined"!==typeof self?self:this,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({"00ee":function(t,e,n){var r=n("b622"),o=r("toStringTag"),i={};i[o]="z",t.exports="[object z]"===String(i)},"0366":function(t,e,n){var r=n("1c0b");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},"057f":function(t,e,n){var r=n("fc6a"),o=n("241c").f,i={}.toString,c="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],u=function(t){try{return o(t)}catch(e){return c.slice()}};t.exports.f=function(t){return c&&"[object Window]"==i.call(t)?u(t):o(r(t))}},"06cf":function(t,e,n){var r=n("83ab"),o=n("d1e7"),i=n("5c6c"),c=n("fc6a"),u=n("c04e"),a=n("5135"),f=n("0cfb"),s=Object.getOwnPropertyDescriptor;e.f=r?s:function(t,e){if(t=c(t),e=u(e,!0),f)try{return s(t,e)}catch(n){}if(a(t,e))return i(!o.f.call(t,e),t[e])}},"0cfb":function(t,e,n){var r=n("83ab"),o=n("d039"),i=n("cc12");t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},"159b":function(t,e,n){var r=n("da84"),o=n("fdbc"),i=n("17c2"),c=n("9112");for(var u in o){var a=r[u],f=a&&a.prototype;if(f&&f.forEach!==i)try{c(f,"forEach",i)}catch(s){f.forEach=i}}},"17c2":function(t,e,n){"use strict";var r=n("b727").forEach,o=n("a640"),i=n("ae40"),c=o("forEach"),u=i("forEach");t.exports=c&&u?[].forEach:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}},"19aa":function(t,e){t.exports=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t}},"1be4":function(t,e,n){var r=n("d066");t.exports=r("document","documentElement")},"1c0b":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},"1c7e":function(t,e,n){var r=n("b622"),o=r("iterator"),i=!1;try{var c=0,u={next:function(){return{done:!!c++}},return:function(){i=!0}};u[o]=function(){return this},Array.from(u,(function(){throw 2}))}catch(a){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var r={};r[o]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(a){}return n}},"1cdc":function(t,e,n){var r=n("342f");t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)},"1d80":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"1dde":function(t,e,n){var r=n("d039"),o=n("b622"),i=n("2d00"),c=o("species");t.exports=function(t){return i>=51||!r((function(){var e=[],n=e.constructor={};return n[c]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},2266:function(t,e,n){var r=n("825a"),o=n("e95a"),i=n("50c4"),c=n("0366"),u=n("35a1"),a=n("2a62"),f=function(t,e){this.stopped=t,this.result=e};t.exports=function(t,e,n){var s,l,p,d,v,h,b,y=n&&n.that,m=!(!n||!n.AS_ENTRIES),g=!(!n||!n.IS_ITERATOR),x=!(!n||!n.INTERRUPTED),w=c(e,y,1+m+x),O=function(t){return s&&a(s),new f(!0,t)},j=function(t){return m?(r(t),x?w(t[0],t[1],O):w(t[0],t[1])):x?w(t,O):w(t)};if(g)s=t;else{if(l=u(t),"function"!=typeof l)throw TypeError("Target is not iterable");if(o(l)){for(p=0,d=i(t.length);d>p;p++)if(v=j(t[p]),v&&v instanceof f)return v;return new f(!1)}s=l.call(t)}h=s.next;while(!(b=h.call(s)).done){try{v=j(b.value)}catch(S){throw a(s),S}if("object"==typeof v&&v&&v instanceof f)return v}return new f(!1)}},"23cb":function(t,e,n){var r=n("a691"),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},"23e7":function(t,e,n){var r=n("da84"),o=n("06cf").f,i=n("9112"),c=n("6eeb"),u=n("ce4e"),a=n("e893"),f=n("94ca");t.exports=function(t,e){var n,s,l,p,d,v,h=t.target,b=t.global,y=t.stat;if(s=b?r:y?r[h]||u(h,{}):(r[h]||{}).prototype,s)for(l in e){if(d=e[l],t.noTargetGet?(v=o(s,l),p=v&&v.value):p=s[l],n=f(b?l:h+(y?".":"#")+l,t.forced),!n&&void 0!==p){if(typeof d===typeof p)continue;a(d,p)}(t.sham||p&&p.sham)&&i(d,"sham",!0),c(s,l,d,t)}}},"241c":function(t,e,n){var r=n("ca84"),o=n("7839"),i=o.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},2626:function(t,e,n){"use strict";var r=n("d066"),o=n("9bf2"),i=n("b622"),c=n("83ab"),u=i("species");t.exports=function(t){var e=r(t),n=o.f;c&&e&&!e[u]&&n(e,u,{configurable:!0,get:function(){return this}})}},"2a62":function(t,e,n){var r=n("825a");t.exports=function(t){var e=t["return"];if(void 0!==e)return r(e.call(t)).value}},"2cf4":function(t,e,n){var r,o,i,c=n("da84"),u=n("d039"),a=n("0366"),f=n("1be4"),s=n("cc12"),l=n("1cdc"),p=n("605d"),d=c.location,v=c.setImmediate,h=c.clearImmediate,b=c.process,y=c.MessageChannel,m=c.Dispatch,g=0,x={},w="onreadystatechange",O=function(t){if(x.hasOwnProperty(t)){var e=x[t];delete x[t],e()}},j=function(t){return function(){O(t)}},S=function(t){O(t.data)},E=function(t){c.postMessage(t+"",d.protocol+"//"+d.host)};v&&h||(v=function(t){var e=[],n=1;while(arguments.length>n)e.push(arguments[n++]);return x[++g]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},r(g),g},h=function(t){delete x[t]},p?r=function(t){b.nextTick(j(t))}:m&&m.now?r=function(t){m.now(j(t))}:y&&!l?(o=new y,i=o.port2,o.port1.onmessage=S,r=a(i.postMessage,i,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts&&d&&"file:"!==d.protocol&&!u(E)?(r=E,c.addEventListener("message",S,!1)):r=w in s("script")?function(t){f.appendChild(s("script"))[w]=function(){f.removeChild(this),O(t)}}:function(t){setTimeout(j(t),0)}),t.exports={set:v,clear:h}},"2d00":function(t,e,n){var r,o,i=n("da84"),c=n("342f"),u=i.process,a=u&&u.versions,f=a&&a.v8;f?(r=f.split("."),o=r[0]+r[1]):c&&(r=c.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=c.match(/Chrome\/(\d+)/),r&&(o=r[1]))),t.exports=o&&+o},"342f":function(t,e,n){var r=n("d066");t.exports=r("navigator","userAgent")||""},"350a":function(t,e,n){"use strict";n("c383")},"35a1":function(t,e,n){var r=n("f5df"),o=n("3f8c"),i=n("b622"),c=i("iterator");t.exports=function(t){if(void 0!=t)return t[c]||t["@@iterator"]||o[r(t)]}},"37e8":function(t,e,n){var r=n("83ab"),o=n("9bf2"),i=n("825a"),c=n("df75");t.exports=r?Object.defineProperties:function(t,e){i(t);var n,r=c(e),u=r.length,a=0;while(u>a)o.f(t,n=r[a++],e[n]);return t}},"3b8e":function(t,e,n){},"3d3b":function(t,e,n){"use strict";n("482a")},"3f8c":function(t,e){t.exports={}},4160:function(t,e,n){"use strict";var r=n("23e7"),o=n("17c2");r({target:"Array",proto:!0,forced:[].forEach!=o},{forEach:o})},"428f":function(t,e,n){var r=n("da84");t.exports=r},"44ad":function(t,e,n){var r=n("d039"),o=n("c6b6"),i="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},"44de":function(t,e,n){var r=n("da84");t.exports=function(t,e){var n=r.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}},"482a":function(t,e,n){},4840:function(t,e,n){var r=n("825a"),o=n("1c0b"),i=n("b622"),c=i("species");t.exports=function(t,e){var n,i=r(t).constructor;return void 0===i||void 0==(n=r(i)[c])?e:o(n)}},4930:function(t,e,n){var r=n("d039");t.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},"4d64":function(t,e,n){var r=n("fc6a"),o=n("50c4"),i=n("23cb"),c=function(t){return function(e,n,c){var u,a=r(e),f=o(a.length),s=i(c,f);if(t&&n!=n){while(f>s)if(u=a[s++],u!=u)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===n)return t||s||0;return!t&&-1}};t.exports={includes:c(!0),indexOf:c(!1)}},"4de4":function(t,e,n){"use strict";var r=n("23e7"),o=n("b727").filter,i=n("1dde"),c=n("ae40"),u=i("filter"),a=c("filter");r({target:"Array",proto:!0,forced:!u||!a},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},"50c4":function(t,e,n){var r=n("a691"),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},5135:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},5692:function(t,e,n){var r=n("c430"),o=n("c6cd");(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.8.1",mode:r?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"56ef":function(t,e,n){var r=n("d066"),o=n("241c"),i=n("7418"),c=n("825a");t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(c(t)),n=i.f;return n?e.concat(n(t)):e}},"5c6c":function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"605d":function(t,e,n){var r=n("c6b6"),o=n("da84");t.exports="process"==r(o.process)},"65f0":function(t,e,n){var r=n("861d"),o=n("e8b5"),i=n("b622"),c=i("species");t.exports=function(t,e){var n;return o(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!o(n.prototype)?r(n)&&(n=n[c],null===n&&(n=void 0)):n=void 0),new(void 0===n?Array:n)(0===e?0:e)}},"69f3":function(t,e,n){var r,o,i,c=n("7f9a"),u=n("da84"),a=n("861d"),f=n("9112"),s=n("5135"),l=n("c6cd"),p=n("f772"),d=n("d012"),v=u.WeakMap,h=function(t){return i(t)?o(t):r(t,{})},b=function(t){return function(e){var n;if(!a(e)||(n=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}};if(c){var y=l.state||(l.state=new v),m=y.get,g=y.has,x=y.set;r=function(t,e){return e.facade=t,x.call(y,t,e),e},o=function(t){return m.call(y,t)||{}},i=function(t){return g.call(y,t)}}else{var w=p("state");d[w]=!0,r=function(t,e){return e.facade=t,f(t,w,e),e},o=function(t){return s(t,w)?t[w]:{}},i=function(t){return s(t,w)}}t.exports={set:r,get:o,has:i,enforce:h,getterFor:b}},"6eeb":function(t,e,n){var r=n("da84"),o=n("9112"),i=n("5135"),c=n("ce4e"),u=n("8925"),a=n("69f3"),f=a.get,s=a.enforce,l=String(String).split("String");(t.exports=function(t,e,n,u){var a,f=!!u&&!!u.unsafe,p=!!u&&!!u.enumerable,d=!!u&&!!u.noTargetGet;"function"==typeof n&&("string"!=typeof e||i(n,"name")||o(n,"name",e),a=s(n),a.source||(a.source=l.join("string"==typeof e?e:""))),t!==r?(f?!d&&t[e]&&(p=!0):delete t[e],p?t[e]=n:o(t,e,n)):p?t[e]=n:c(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&f(this).source||u(this)}))},7418:function(t,e){e.f=Object.getOwnPropertySymbols},"746f":function(t,e,n){var r=n("428f"),o=n("5135"),i=n("e538"),c=n("9bf2").f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});o(e,t)||c(e,t,{value:i.f(t)})}},7839:function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(t,e,n){var r=n("1d80");t.exports=function(t){return Object(r(t))}},"7c73":function(t,e,n){var r,o=n("825a"),i=n("37e8"),c=n("7839"),u=n("d012"),a=n("1be4"),f=n("cc12"),s=n("f772"),l=">",p="<",d="prototype",v="script",h=s("IE_PROTO"),b=function(){},y=function(t){return p+v+l+t+p+"/"+v+l},m=function(t){t.write(y("")),t.close();var e=t.parentWindow.Object;return t=null,e},g=function(){var t,e=f("iframe"),n="java"+v+":";return e.style.display="none",a.appendChild(e),e.src=String(n),t=e.contentWindow.document,t.open(),t.write(y("document.F=Object")),t.close(),t.F},x=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}x=r?m(r):g();var t=c.length;while(t--)delete x[d][c[t]];return x()};u[h]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(b[d]=o(t),n=new b,b[d]=null,n[h]=t):n=x(),void 0===e?n:i(n,e)}},"7f9a":function(t,e,n){var r=n("da84"),o=n("8925"),i=r.WeakMap;t.exports="function"===typeof i&&/native code/.test(o(i))},"825a":function(t,e,n){var r=n("861d");t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},"83ab":function(t,e,n){var r=n("d039");t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},8418:function(t,e,n){"use strict";var r=n("c04e"),o=n("9bf2"),i=n("5c6c");t.exports=function(t,e,n){var c=r(e);c in t?o.f(t,c,i(0,n)):t[c]=n}},"861d":function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},8875:function(t,e,n){var r,o,i;(function(n,c){o=[],r=c,i="function"===typeof r?r.apply(e,o):r,void 0===i||(t.exports=i)})("undefined"!==typeof self&&self,(function(){function t(){var e=Object.getOwnPropertyDescriptor(document,"currentScript");if(!e&&"currentScript"in document&&document.currentScript)return document.currentScript;if(e&&e.get!==t&&document.currentScript)return document.currentScript;try{throw new Error}catch(d){var n,r,o,i=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,c=/@([^@]*):(\d+):(\d+)\s*$/gi,u=i.exec(d.stack)||c.exec(d.stack),a=u&&u[1]||!1,f=u&&u[2]||!1,s=document.location.href.replace(document.location.hash,""),l=document.getElementsByTagName("script");a===s&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(f-2)+"}[^<]*