@vue-interface/dropdown-menu 0.9.7 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dropdown-menu.es.js +144 -0
- package/dist/dropdown-menu.umd.js +1 -0
- package/{public → dist}/favicon.ico +0 -0
- package/package.json +28 -19
- package/.eslintrc.js +0 -53
- package/babel.config.js +0 -7
- package/dist/DropdownMenu.common.js +0 -2928
- package/dist/DropdownMenu.common.js.map +0 -1
- package/dist/DropdownMenu.css +0 -1
- package/dist/DropdownMenu.umd.js +0 -2938
- package/dist/DropdownMenu.umd.js.map +0 -1
- package/dist/DropdownMenu.umd.min.js +0 -2
- package/dist/DropdownMenu.umd.min.js.map +0 -1
- package/dist/demo.html +0 -19
- package/docs/.vuepress/config.js +0 -44
- package/docs/.vuepress/dist/404.html +0 -19
- package/docs/.vuepress/dist/assets/css/0.styles.275ee968.css +0 -1
- package/docs/.vuepress/dist/assets/img/search.83621669.svg +0 -1
- package/docs/.vuepress/dist/assets/js/10.5d93d289.js +0 -1
- package/docs/.vuepress/dist/assets/js/11.97ab3884.js +0 -1
- package/docs/.vuepress/dist/assets/js/2.f3d148c3.js +0 -1
- package/docs/.vuepress/dist/assets/js/3.81681fff.js +0 -1
- package/docs/.vuepress/dist/assets/js/4.82fa7382.js +0 -1
- package/docs/.vuepress/dist/assets/js/5.3dae6ad4.js +0 -1
- package/docs/.vuepress/dist/assets/js/6.6a04f815.js +0 -1
- package/docs/.vuepress/dist/assets/js/7.c033cb49.js +0 -1
- package/docs/.vuepress/dist/assets/js/8.6d6eb599.js +0 -1
- package/docs/.vuepress/dist/assets/js/9.eaefe866.js +0 -1
- package/docs/.vuepress/dist/assets/js/app.7ed065d3.js +0 -13
- package/docs/.vuepress/dist/examples/index.html +0 -21
- package/docs/.vuepress/dist/examples/test.html +0 -17
- package/docs/.vuepress/dist/index.html +0 -53
- package/docs/.vuepress/dist/options.html +0 -41
- package/docs/.vuepress/dist/tailwindcss.html +0 -85
- package/docs/README.md +0 -17
- package/docs/examples/README.md +0 -3
- package/docs/options.md +0 -44
- package/index.html +0 -61
- package/index.js +0 -2
- package/main.vue +0 -5
- package/postcss.config.js +0 -1
- package/public/index.html +0 -17
- package/src/DropdownMenu.vue +0 -54
- package/src/DropdownMenuItems.vue +0 -68
- package/src/css/DropdownMenu.css +0 -1
- package/tailwind.config.js +0 -12
- package/tailwindcss/index.js +0 -301
- package/vue.config.js +0 -11
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
2
|
+
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
3
|
+
if (render2) {
|
|
4
|
+
options.render = render2;
|
|
5
|
+
options.staticRenderFns = staticRenderFns2;
|
|
6
|
+
options._compiled = true;
|
|
7
|
+
}
|
|
8
|
+
if (functionalTemplate) {
|
|
9
|
+
options.functional = true;
|
|
10
|
+
}
|
|
11
|
+
if (scopeId) {
|
|
12
|
+
options._scopeId = "data-v-" + scopeId;
|
|
13
|
+
}
|
|
14
|
+
var hook;
|
|
15
|
+
if (moduleIdentifier) {
|
|
16
|
+
hook = function(context) {
|
|
17
|
+
context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
|
|
18
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
|
|
19
|
+
context = __VUE_SSR_CONTEXT__;
|
|
20
|
+
}
|
|
21
|
+
if (injectStyles) {
|
|
22
|
+
injectStyles.call(this, context);
|
|
23
|
+
}
|
|
24
|
+
if (context && context._registeredComponents) {
|
|
25
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
options._ssrRegister = hook;
|
|
29
|
+
} else if (injectStyles) {
|
|
30
|
+
hook = shadowMode ? function() {
|
|
31
|
+
injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
|
|
32
|
+
} : injectStyles;
|
|
33
|
+
}
|
|
34
|
+
if (hook) {
|
|
35
|
+
if (options.functional) {
|
|
36
|
+
options._injectStyles = hook;
|
|
37
|
+
var originalRender = options.render;
|
|
38
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
39
|
+
hook.call(context);
|
|
40
|
+
return originalRender(h, context);
|
|
41
|
+
};
|
|
42
|
+
} else {
|
|
43
|
+
var existing = options.beforeCreate;
|
|
44
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
exports: scriptExports,
|
|
49
|
+
options
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function appendClass(vnode, str) {
|
|
53
|
+
vnode.data.staticClass = `${vnode.data.staticClass || ""} ${str}`.trim();
|
|
54
|
+
}
|
|
55
|
+
function wrap(wrapper, fn) {
|
|
56
|
+
return (e) => {
|
|
57
|
+
if (typeof fn === "function") {
|
|
58
|
+
fn(e);
|
|
59
|
+
}
|
|
60
|
+
if (!e.cancelBubble) {
|
|
61
|
+
wrapper(e);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function listener(vnode, key) {
|
|
66
|
+
return vnode.data.on[key] || vnode.componentOptions && vnode.componentOptions.listeners && vnode.componentOptions.listeners[key];
|
|
67
|
+
}
|
|
68
|
+
const __vue2_script$1 = {
|
|
69
|
+
functional: true,
|
|
70
|
+
render(h, context) {
|
|
71
|
+
context.children.filter((vnode) => !!vnode.tag).forEach((vnode, i) => {
|
|
72
|
+
vnode.data = Object.assign({ staticClass: void 0 }, vnode.data);
|
|
73
|
+
if (!vnode.data.on) {
|
|
74
|
+
vnode.data.on = {};
|
|
75
|
+
}
|
|
76
|
+
const isDropdownItem = vnode.data.staticClass && vnode.data.staticClass.match(/dropdown-item/);
|
|
77
|
+
const isDropdownDivider = vnode.data.staticClass && vnode.data.staticClass.match(/dropdown-divider/);
|
|
78
|
+
vnode.data.on.click = wrap((e) => {
|
|
79
|
+
context.parent.$emit("click-item", e, vnode);
|
|
80
|
+
}, listener(vnode, "click"));
|
|
81
|
+
vnode.data.on.blur = wrap((e) => {
|
|
82
|
+
context.parent.$emit("blur-item", e, vnode);
|
|
83
|
+
}, listener(vnode, "blur"));
|
|
84
|
+
if (vnode.tag.match(/^h\d$/)) {
|
|
85
|
+
appendClass(vnode, "dropdown-header");
|
|
86
|
+
} else if (vnode.tag === "hr" && !isDropdownDivider) {
|
|
87
|
+
vnode.tag = "div";
|
|
88
|
+
appendClass(vnode, "dropdown-divider");
|
|
89
|
+
} else if (!isDropdownItem) {
|
|
90
|
+
appendClass(vnode, "dropdown-item");
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
return context.children;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
let __vue2_render, __vue2_staticRenderFns;
|
|
97
|
+
const __cssModules$1 = {};
|
|
98
|
+
var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, __vue2_render, __vue2_staticRenderFns, false, __vue2_injectStyles$1, null, null, null);
|
|
99
|
+
function __vue2_injectStyles$1(context) {
|
|
100
|
+
for (let o in __cssModules$1) {
|
|
101
|
+
this[o] = __cssModules$1[o];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
var DropdownMenuItems = /* @__PURE__ */ function() {
|
|
105
|
+
return __component__$1.exports;
|
|
106
|
+
}();
|
|
107
|
+
var render = function() {
|
|
108
|
+
var _vm = this;
|
|
109
|
+
var _h = _vm.$createElement;
|
|
110
|
+
var _c = _vm._self._c || _h;
|
|
111
|
+
return _c("div", { staticClass: "dropdown-menu mb-3", class: {
|
|
112
|
+
"dropdown-menu-left": _vm.align === "left",
|
|
113
|
+
"dropdown-menu-right": _vm.align === "right",
|
|
114
|
+
"show": _vm.show
|
|
115
|
+
}, attrs: { "aria-labelledby": _vm.$attrs.id } }, [_c("dropdown-menu-items", [_vm._t("default")], 2)], 1);
|
|
116
|
+
};
|
|
117
|
+
var staticRenderFns = [];
|
|
118
|
+
const __vue2_script = {
|
|
119
|
+
name: "DropdownMenu",
|
|
120
|
+
components: {
|
|
121
|
+
DropdownMenuItems
|
|
122
|
+
},
|
|
123
|
+
props: {
|
|
124
|
+
align: {
|
|
125
|
+
type: String,
|
|
126
|
+
default: "left",
|
|
127
|
+
validate(value) {
|
|
128
|
+
return ["left", "right"].indexOf(value.toLowerCase()) !== -1;
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
show: Boolean
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const __cssModules = {};
|
|
135
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
|
|
136
|
+
function __vue2_injectStyles(context) {
|
|
137
|
+
for (let o in __cssModules) {
|
|
138
|
+
this[o] = __cssModules[o];
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
var DropdownMenu = /* @__PURE__ */ function() {
|
|
142
|
+
return __component__.exports;
|
|
143
|
+
}();
|
|
144
|
+
export { DropdownMenu };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(s,l){typeof exports=="object"&&typeof module!="undefined"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(s=typeof globalThis!="undefined"?globalThis:s||self,l(s.DropdownMenu={}))})(this,function(s){"use strict";function l(e,n,t,m,o,d,u,k){var i=typeof e=="function"?e.options:e;n&&(i.render=n,i.staticRenderFns=t,i._compiled=!0),m&&(i.functional=!0),d&&(i._scopeId="data-v-"+d);var a;if(u?(a=function(r){r=r||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!r&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(r=__VUE_SSR_CONTEXT__),o&&o.call(this,r),r&&r._registeredComponents&&r._registeredComponents.add(u)},i._ssrRegister=a):o&&(a=k?function(){o.call(this,(i.functional?this.parent:this).$root.$options.shadowRoot)}:o),a)if(i.functional){i._injectStyles=a;var E=i.render;i.render=function(F,C){return a.call(C),E(F,C)}}else{var w=i.beforeCreate;i.beforeCreate=w?[].concat(w,a):[a]}return{exports:e,options:i}}function f(e,n){e.data.staticClass=`${e.data.staticClass||""} ${n}`.trim()}function c(e,n){return t=>{typeof n=="function"&&n(t),t.cancelBubble||e(t)}}function _(e,n){return e.data.on[n]||e.componentOptions&&e.componentOptions.listeners&&e.componentOptions.listeners[n]}const $={functional:!0,render(e,n){return n.children.filter(t=>!!t.tag).forEach((t,m)=>{t.data=Object.assign({staticClass:void 0},t.data),t.data.on||(t.data.on={});const o=t.data.staticClass&&t.data.staticClass.match(/dropdown-item/),d=t.data.staticClass&&t.data.staticClass.match(/dropdown-divider/);t.data.on.click=c(u=>{n.parent.$emit("click-item",u,t)},_(t,"click")),t.data.on.blur=c(u=>{n.parent.$emit("blur-item",u,t)},_(t,"blur")),t.tag.match(/^h\d$/)?f(t,"dropdown-header"):t.tag==="hr"&&!d?(t.tag="div",f(t,"dropdown-divider")):o||f(t,"dropdown-item")}),n.children}};let g,b;const p={};var v=l($,g,b,!1,M,null,null,null);function M(e){for(let n in p)this[n]=p[n]}var y=function(){return v.exports}(),D=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"dropdown-menu mb-3",class:{"dropdown-menu-left":e.align==="left","dropdown-menu-right":e.align==="right",show:e.show},attrs:{"aria-labelledby":e.$attrs.id}},[t("dropdown-menu-items",[e._t("default")],2)],1)},O=[];const R={name:"DropdownMenu",components:{DropdownMenuItems:y},props:{align:{type:String,default:"left",validate(e){return["left","right"].indexOf(e.toLowerCase())!==-1}},show:Boolean}},h={};var S=l(R,D,O,!1,T,null,null,null);function T(e){for(let n in h)this[n]=h[n]}var j=function(){return S.exports}();s.DropdownMenu=j,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-interface/dropdown-menu",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A Vue dropdown menu component.",
|
|
5
|
-
"
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"main": "./dist/dropdown-menu.umd.js",
|
|
9
|
+
"module": "./dist/dropdown-menu.es.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/dropdown-menu.es.js",
|
|
13
|
+
"require": "./dist/dropdown-menu.umd.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"browserslist": "last 2 versions, > 0.5%, ie >= 11",
|
|
6
17
|
"scripts": {
|
|
18
|
+
"dev": "vite",
|
|
19
|
+
"build": "vite build",
|
|
20
|
+
"preview": "vite preview",
|
|
7
21
|
"watch": "npm run serve",
|
|
8
22
|
"serve": "vue-cli-service build --target lib --name=DropdownMenu ./main.vue --watch",
|
|
9
|
-
"build": "vue-cli-service build --target lib --name=DropdownMenu ./main.vue",
|
|
10
23
|
"lint": "vue-cli-service lint",
|
|
11
24
|
"fix": "vue-cli-service lint --fix",
|
|
12
25
|
"pre-release": "npm run build; git add . -A; git commit -m 'pre-release commit'",
|
|
@@ -37,27 +50,23 @@
|
|
|
37
50
|
},
|
|
38
51
|
"homepage": "https://github.com/vue-interface/dropdown-menu/docs#readme",
|
|
39
52
|
"dependencies": {
|
|
40
|
-
"@vue-interface/utils": "^0.9.13",
|
|
41
|
-
"@vue-interface/variant": "^1.0.12",
|
|
42
|
-
"color": "^3.1.2",
|
|
43
|
-
"core-js": "^3.6.4",
|
|
44
|
-
"hex-to-rgba": "^2.0.1",
|
|
45
|
-
"tailwindcss": "^1.7.3",
|
|
46
53
|
"vue": "^2.6.12"
|
|
47
54
|
},
|
|
48
55
|
"devDependencies": {
|
|
49
|
-
"@
|
|
50
|
-
"@vue/
|
|
51
|
-
"
|
|
52
|
-
"@vuepress/plugin-register-components": "^1.5.4",
|
|
56
|
+
"@rollup/plugin-babel": "^5.3.0",
|
|
57
|
+
"@vue-interface/tailwindcss": "^0.2.10",
|
|
58
|
+
"autoprefixer": "^10.4.2",
|
|
53
59
|
"babel-eslint": "^10.1.0",
|
|
60
|
+
"babel-preset-vue": "^2.0.2",
|
|
61
|
+
"change-case": "^4.1.2",
|
|
62
|
+
"color": "^4.2.0",
|
|
54
63
|
"eslint": "^6.7.2",
|
|
55
64
|
"eslint-plugin-vue": "^6.2.2",
|
|
56
|
-
"
|
|
57
|
-
"postcss
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
65
|
+
"pascalcase": "^2.0.0",
|
|
66
|
+
"postcss": "^8.4.6",
|
|
67
|
+
"tailwindcss": "^3.0.18",
|
|
68
|
+
"vite": "^2.7.2",
|
|
69
|
+
"vite-plugin-vue2": "^1.9.3",
|
|
70
|
+
"vue-router": "^3.5.3"
|
|
62
71
|
}
|
|
63
72
|
}
|
package/.eslintrc.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
'plugin:vue/recommended'
|
|
4
|
-
],
|
|
5
|
-
parserOptions: {
|
|
6
|
-
'parser': 'babel-eslint'
|
|
7
|
-
},
|
|
8
|
-
// add your custom rules here
|
|
9
|
-
rules: {
|
|
10
|
-
'vue/no-v-html': 0,
|
|
11
|
-
'vue/require-default-prop': 0,
|
|
12
|
-
"vue/max-attributes-per-line": ["error", {
|
|
13
|
-
"singleline": 5,
|
|
14
|
-
"multiline": {
|
|
15
|
-
"max": 1,
|
|
16
|
-
"allowFirstLine": true
|
|
17
|
-
}
|
|
18
|
-
}],
|
|
19
|
-
"vue/html-indent": ["error", 4, {
|
|
20
|
-
"attribute": 1,
|
|
21
|
-
"baseIndent": 1,
|
|
22
|
-
"closeBracket": 1,
|
|
23
|
-
"alignAttributesVertically": false,
|
|
24
|
-
"ignores": []
|
|
25
|
-
}],
|
|
26
|
-
"vue/html-closing-bracket-newline": ["error", {
|
|
27
|
-
"singleline": "never",
|
|
28
|
-
"multiline": "never"
|
|
29
|
-
}],
|
|
30
|
-
// Ensure no space after keywords like if.
|
|
31
|
-
'keyword-spacing': ["error", {
|
|
32
|
-
"overrides": {
|
|
33
|
-
"if": { "after": false },
|
|
34
|
-
"for": { "after": false },
|
|
35
|
-
"while": { "after": false }
|
|
36
|
-
}
|
|
37
|
-
}],
|
|
38
|
-
// Use alternative brace style
|
|
39
|
-
'brace-style': ['error', 'stroustrup'],
|
|
40
|
-
// No spaces before parens
|
|
41
|
-
'space-before-function-paren': ['error', 'never'],
|
|
42
|
-
// Indent for tabs because spaces suck
|
|
43
|
-
'indent': ['error', 4],
|
|
44
|
-
// Semi colons always where they need to be
|
|
45
|
-
'semi': [2,'always'],
|
|
46
|
-
// allow paren-less arrow functions
|
|
47
|
-
'arrow-parens': 0,
|
|
48
|
-
// allow async-await
|
|
49
|
-
'generator-star-spacing': 0,
|
|
50
|
-
// allow debugger during development
|
|
51
|
-
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
|
|
52
|
-
}
|
|
53
|
-
};
|