@vue-interface/dropdown-menu 3.0.0 → 3.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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Justin Kimbrell
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
+
package/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # Dropdown Menu
2
+
3
+ The `dropdown-menu` component displays a list of actionable or informational items, similar to traditional dropdown lists. It supports headers, dividers, links, and plain text items.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm i @vue-interface/dropdown-menu
9
+ ```
10
+
11
+ ```bash
12
+ yarn add @vue-interface/dropdown-menu
13
+ ```
14
+
15
+ ```bash
16
+ npm i @vue-interface/dropdown-menu
17
+ ```
18
+
19
+ ```bash
20
+ bun i @vue-interface/dropdown-menu
21
+ ```
22
+
23
+ ## Basic Usage
24
+
25
+ ```html
26
+ <div class="dropdown-menu show relative z-1">
27
+ <h3 class="dropdown-header">Vue Router</h3>
28
+ <a href="#" class="dropdown-item active">Item #2</a>
29
+ <a href="#" class="dropdown-item">Item #3</a>
30
+ <hr class="dropdown-divider" />
31
+ <a href="#" class="dropdown-item">Item #4</a>
32
+ </div>
33
+ ```
34
+
35
+ For more comprehensive documentation and examples, please visit the [online documentation](https://vue-interface.github.io/packages/dropdown-menu/).
36
+
@@ -0,0 +1,50 @@
1
+ import { createElementBlock as o, openBlock as t, renderSlot as r, defineComponent as l, normalizeClass as i } from "vue";
2
+ const d = (e, n) => {
3
+ const s = e.__vccOpts || e;
4
+ for (const [c, a] of n)
5
+ s[c] = a;
6
+ return s;
7
+ }, _ = {}, f = { class: "dropdown-header" };
8
+ function u(e, n) {
9
+ return t(), o("h3", f, [
10
+ r(e.$slots, "default")
11
+ ]);
12
+ }
13
+ const b = /* @__PURE__ */ d(_, [["render", u]]), m = {}, p = { class: "dropdown-item" };
14
+ function h(e, n) {
15
+ return t(), o("div", p, [
16
+ r(e.$slots, "default")
17
+ ]);
18
+ }
19
+ const y = /* @__PURE__ */ d(m, [["render", h]]), w = {}, $ = { class: "dropdown-item-text" };
20
+ function g(e, n) {
21
+ return t(), o("div", $, [
22
+ r(e.$slots, "default")
23
+ ]);
24
+ }
25
+ const k = /* @__PURE__ */ d(w, [["render", g]]), v = ["aria-labelledby"], x = /* @__PURE__ */ l({
26
+ __name: "DropdownMenu",
27
+ props: {
28
+ align: { default: "left" },
29
+ show: { type: Boolean }
30
+ },
31
+ setup(e) {
32
+ return (n, s) => (t(), o("div", {
33
+ class: i(["dropdown-menu", {
34
+ "dropdown-menu-left": e.align === "left",
35
+ "dropdown-menu-right": e.align === "right",
36
+ show: e.show
37
+ }]),
38
+ "aria-labelledby": n.$attrs.id
39
+ }, [
40
+ r(n.$slots, "default")
41
+ ], 10, v));
42
+ }
43
+ });
44
+ export {
45
+ b as DropdownHeader,
46
+ y as DropdownItem,
47
+ k as DropdownItemText,
48
+ x as DropdownMenu
49
+ };
50
+ //# sourceMappingURL=dropdown-menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown-menu.js","sources":["../src/DropdownHeader.vue","../src/DropdownItem.vue","../src/DropdownItemText.vue","../src/DropdownMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\n\n</script>\n\n<template>\n <h3 class=\"dropdown-header\">\n <slot />\n </h3>\n</template>","<script setup lang=\"ts\">\n\n</script>\n\n<template>\n <div class=\"dropdown-item\">\n <slot />\n </div>\n</template>","<script setup lang=\"ts\">\n\n</script>\n\n<template>\n <div class=\"dropdown-item-text\">\n <slot />\n </div>\n</template>","<script setup lang=\"ts\">\nexport type DropdownMenuProps = {\n align?: 'left' | 'right',\n show?: boolean\n};\n\nwithDefaults(defineProps<DropdownMenuProps>(), {\n align: 'left'\n});\n</script>\n\n<template>\n <div\n class=\"dropdown-menu\"\n :aria-labelledby=\"($attrs.id as string|undefined)\"\n :class=\"{\n 'dropdown-menu-left': align === 'left',\n 'dropdown-menu-right': align === 'right',\n 'show': show\n }\">\n <slot />\n </div>\n</template>"],"names":["_hoisted_1","_openBlock","_createElementBlock","_renderSlot","_ctx","__props","$attrs"],"mappings":";;;;;;WAKQA,IAAA,EAAA,OAAM,kBAAiB;;AAA3B,SAAAC,EAAA,GAAAC,EAEK,MAFLF,GAEK;AAAA,IADDG,EAAQC,EAAA,QAAA,SAAA;AAAA;;yDCDPJ,IAAA,EAAA,OAAM,gBAAe;;AAA1B,SAAAC,EAAA,GAAAC,EAEM,OAFNF,GAEM;AAAA,IADFG,EAAQC,EAAA,QAAA,SAAA;AAAA;;yDCDPJ,IAAA,EAAA,OAAM,qBAAoB;;AAA/B,SAAAC,EAAA,GAAAC,EAEM,OAFNF,GAEM;AAAA,IADFG,EAAQC,EAAA,QAAA,SAAA;AAAA;;;;;;;;;2BCMZF,EASM,OAAA;AAAA,MARF,UAAM,iBAAe;AAAA,8BAEuBG,EAAA,UAAK;AAAA,+BAAgDA,EAAA,UAAK;AAAA,cAAkCA,EAAA;AAAA,MAAA;MADvI,mBAAkBC,EAAAA,OAAO;AAAA,IAAA;MAM1BH,EAAQC,EAAA,QAAA,SAAA;AAAA,IAAA;;;"}
@@ -0,0 +1,2 @@
1
+ (function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.DropdownMenu={},o.Vue))})(this,(function(o,e){"use strict";const r=(n,t)=>{const d=n.__vccOpts||n;for(const[B,D]of t)d[B]=D;return d},c={},s={class:"dropdown-header"};function l(n,t){return e.openBlock(),e.createElementBlock("h3",s,[e.renderSlot(n.$slots,"default")])}const i=r(c,[["render",l]]),a={},f={class:"dropdown-item"};function _(n,t){return e.openBlock(),e.createElementBlock("div",f,[e.renderSlot(n.$slots,"default")])}const p=r(a,[["render",_]]),m={},u={class:"dropdown-item-text"};function h(n,t){return e.openBlock(),e.createElementBlock("div",u,[e.renderSlot(n.$slots,"default")])}const w=r(m,[["render",h]]),$=["aria-labelledby"],k=e.defineComponent({__name:"DropdownMenu",props:{align:{default:"left"},show:{type:Boolean}},setup(n){return(t,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dropdown-menu",{"dropdown-menu-left":n.align==="left","dropdown-menu-right":n.align==="right",show:n.show}]),"aria-labelledby":t.$attrs.id},[e.renderSlot(t.$slots,"default")],10,$))}});o.DropdownHeader=i,o.DropdownItem=p,o.DropdownItemText=w,o.DropdownMenu=k,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}));
2
+ //# sourceMappingURL=dropdown-menu.umd.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown-menu.umd.cjs","sources":["../src/DropdownHeader.vue","../src/DropdownItem.vue","../src/DropdownItemText.vue","../src/DropdownMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\n\n</script>\n\n<template>\n <h3 class=\"dropdown-header\">\n <slot />\n </h3>\n</template>","<script setup lang=\"ts\">\n\n</script>\n\n<template>\n <div class=\"dropdown-item\">\n <slot />\n </div>\n</template>","<script setup lang=\"ts\">\n\n</script>\n\n<template>\n <div class=\"dropdown-item-text\">\n <slot />\n </div>\n</template>","<script setup lang=\"ts\">\nexport type DropdownMenuProps = {\n align?: 'left' | 'right',\n show?: boolean\n};\n\nwithDefaults(defineProps<DropdownMenuProps>(), {\n align: 'left'\n});\n</script>\n\n<template>\n <div\n class=\"dropdown-menu\"\n :aria-labelledby=\"($attrs.id as string|undefined)\"\n :class=\"{\n 'dropdown-menu-left': align === 'left',\n 'dropdown-menu-right': align === 'right',\n 'show': show\n }\">\n <slot />\n </div>\n</template>"],"names":["_hoisted_1","_openBlock","_createElementBlock","_renderSlot","_ctx","__props","$attrs"],"mappings":"kVAKQA,EAAA,CAAA,MAAM,iBAAiB,kBAA3B,OAAAC,YAAA,EAAAC,qBAEK,KAFLF,EAEK,CADDG,aAAQC,EAAA,OAAA,SAAA,qCCDPJ,EAAA,CAAA,MAAM,eAAe,kBAA1B,OAAAC,YAAA,EAAAC,qBAEM,MAFNF,EAEM,CADFG,aAAQC,EAAA,OAAA,SAAA,qCCDPJ,EAAA,CAAA,MAAM,oBAAoB,kBAA/B,OAAAC,YAAA,EAAAC,qBAEM,MAFNF,EAEM,CADFG,aAAQC,EAAA,OAAA,SAAA,yLCMZF,EAAAA,mBASM,MAAA,CARF,wBAAM,gBAAe,sBAEuBG,EAAA,QAAK,6BAAgDA,EAAA,QAAK,aAAkCA,EAAA,IAAA,IADvI,kBAAkBC,EAAAA,OAAO,EAAA,GAM1BH,aAAQC,EAAA,OAAA,SAAA,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { default as DropdownHeader } from './src/DropdownHeader.vue';
2
+ import { default as DropdownItem } from './src/DropdownItem.vue';
3
+ import { default as DropdownItemText } from './src/DropdownItemText.vue';
4
+ import { default as DropdownMenu } from './src/DropdownMenu.vue';
5
+ export { DropdownHeader, DropdownItem, DropdownItemText, DropdownMenu };
@@ -0,0 +1,17 @@
1
+ declare function __VLS_template(): {
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ default?(_: {}): any;
5
+ };
6
+ refs: {};
7
+ rootEl: HTMLHeadingElement;
8
+ };
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLHeadingElement>;
11
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
12
+ export default _default;
13
+ type __VLS_WithTemplateSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,17 @@
1
+ declare function __VLS_template(): {
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ default?(_: {}): any;
5
+ };
6
+ refs: {};
7
+ rootEl: HTMLDivElement;
8
+ };
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
11
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
12
+ export default _default;
13
+ type __VLS_WithTemplateSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,17 @@
1
+ declare function __VLS_template(): {
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ default?(_: {}): any;
5
+ };
6
+ refs: {};
7
+ rootEl: HTMLDivElement;
8
+ };
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
11
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
12
+ export default _default;
13
+ type __VLS_WithTemplateSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,23 @@
1
+ export type DropdownMenuProps = {
2
+ align?: 'left' | 'right';
3
+ show?: boolean;
4
+ };
5
+ declare function __VLS_template(): {
6
+ attrs: Partial<{}>;
7
+ slots: {
8
+ default?(_: {}): any;
9
+ };
10
+ refs: {};
11
+ rootEl: HTMLDivElement;
12
+ };
13
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
+ declare const __VLS_component: import('vue').DefineComponent<DropdownMenuProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<DropdownMenuProps> & Readonly<{}>, {
15
+ align: "left" | "right";
16
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
17
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
18
+ export default _default;
19
+ type __VLS_WithTemplateSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-interface/dropdown-menu",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "A Vue dropdown menu component.",
5
5
  "type": "module",
6
6
  "main": "./dist/dropdown-menu.umd.cjs",
@@ -18,7 +18,7 @@
18
18
  "browserslist": "last 2 versions, > 0.5%, ie >= 11",
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "git+https://github.com/vue-interface/dropdown-menu"
21
+ "url": "git+https://github.com/vue-interface/vue-interface.github.io"
22
22
  },
23
23
  "keywords": [
24
24
  "Button",
@@ -28,11 +28,18 @@
28
28
  "Bootstrap"
29
29
  ],
30
30
  "author": "Justin Kimbrell",
31
- "license": "ISC",
31
+ "license": "MIT",
32
32
  "bugs": {
33
- "url": "https://github.com/vue-interface/dropdown-menu"
33
+ "url": "https://github.com/vue-interface/vue-interface.github.io"
34
34
  },
35
- "homepage": "https://github.com/vue-interface/vue-interface",
35
+ "homepage": "https://vue-interface.github.io/packages/dropdown-menu",
36
+ "readme": "README.md",
37
+ "files": [
38
+ "dist",
39
+ "index.css",
40
+ "README.md",
41
+ "LICENSE"
42
+ ],
36
43
  "peerDependencies": {
37
44
  "vue": "^3.3.4"
38
45
  },
package/CHANGELOG.md DELETED
@@ -1,7 +0,0 @@
1
- # @vue-interface/dropdown-menu
2
-
3
- ## 3.0.0
4
-
5
- ### Major Changes
6
-
7
- - 7119322: Add support for TailwindCSS v4
package/demo.css DELETED
@@ -1,10 +0,0 @@
1
- @import "tailwindcss";
2
- @import "./index.css";
3
-
4
- @variant dark {
5
- body {
6
- @apply text-white;
7
- }
8
- }
9
-
10
- @custom-variant dark (&:where(.dark, .dark *));
@@ -1,65 +0,0 @@
1
- ---
2
- title: Dropdown Menu
3
- ---
4
-
5
- <script setup>
6
- import '../demo.css'
7
- import { ref, onMounted } from 'vue'
8
-
9
- const item = ref('Nothing')
10
-
11
- onMounted(() => {
12
- document.querySelectorAll('.dropdown-item').forEach(link => {
13
- link.addEventListener('click', e => {
14
- e.preventDefault()
15
- const text = link.textContent.trim()
16
- if (['Item #2', 'Item #3', 'Item #4'].includes(text)) {
17
- item.value = text
18
- }
19
- })
20
- })
21
- })
22
- </script>
23
-
24
- # Dropdown Menu
25
-
26
- The `dropdown-menu` component displays a list of actionable or informational items, similar to traditional dropdown lists. It supports headers, dividers, links, and plain text items.
27
-
28
- ## Basic Usage
29
-
30
- <span>{{ item }} was clicked!</span>
31
-
32
- ::: raw
33
- <div>
34
- <!-- #region basicUsage -->
35
- <div class="dropdown-menu show relative">
36
- <h3 class="dropdown-header">Vue Router</h3>
37
- <h3 class="dropdown-header">Links</h3>
38
- <a href="#" class="dropdown-item active">Item #2</a>
39
- <a href="#" class="dropdown-item">Item #3</a>
40
- <div class="dropdown-item-text">Plain Text</div>
41
- <hr class="dropdown-divider" />
42
- <a href="#" class="dropdown-item">Item #4</a>
43
- <h3 class="dropdown-header">Heading Element</h3>
44
- <div class="dropdown-item"><i>italic text</i></div>
45
- <div class="dropdown-item"><b>bold text</b></div>
46
- <div class="dropdown-item"><em>strong text</em></div>
47
- <div class="dropdown-item"><sub>subscripted text</sub></div><br>
48
- <div class="dropdown-item"><sup>superscripted text</sup></div>
49
- <div class="dropdown-item"><small>small text</small></div>
50
- <div class="dropdown-item"><del>deleted text</del></div>
51
- <div class="dropdown-item"><ins>inserted text</ins></div>
52
- <div class="dropdown-item"><blockquote>quoted text</blockquote></div>
53
- <div class="dropdown-item"><q>short quoted text</q></div>
54
- <div class="dropdown-item"><cite>cited text</cite></div>
55
- <div class="dropdown-item"><address>address</address></div>
56
- <div class="dropdown-item"><abbr title="inserted text">inserted text</abbr></div>
57
- <div class="dropdown-item"><code>code snippet</code></div>
58
- <div class="dropdown-item"><mark>marked text</mark></div>
59
- <div class="dropdown-item-plain">Unstyled text</div>
60
- </div>
61
- <!-- #endregion basicUsage -->
62
- </div>
63
- :::
64
-
65
- <<< @/packages/dropdown-menu/docs/dropdown-menu.md#basicUsage{html}
package/index.html DELETED
@@ -1,63 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6
- <title>Dropdown-menu</title>
7
- </head>
8
- <body class="dark:bg-neutral-900 dark:text-white">
9
- <div id="app" class="relative">
10
- <br><h1 class="text-4xl mb-6">dropdown-menu</h1>
11
-
12
- <h3 class="text-2xl mb-3">Basic Usage</h3>
13
-
14
- <span>{{ item }} was clicked!</span>
15
-
16
- <div class="dropdown-menu show">
17
- <h3 class="dropdown-header">Vue Router</h3>
18
- <h3 class="dropdown-header">Links</h3>
19
- <a href="#" class="dropdown-item active">Item #2</a>
20
- <a href="#" class="dropdown-item">Item #3</a>
21
- <div class="dropdown-item-text">Plain Text</div>
22
- <hr class="dropdown-divider" />
23
- <a href="#" class="dropdown-item">Item #4</a>
24
- <h3 class="dropdown-header">Heading Element</h3>
25
- <div class="dropdown-item"><i>italic text</i></div>
26
- <div class="dropdown-item"><b>bold text</b></div>
27
- <div class="dropdown-item"><em>strong text</em></div>
28
- <div class="dropdown-item"><sub>subscripted text</sub></div><br>
29
- <div class="dropdown-item"><sup>superscripted text</sup></div>
30
- <div class="dropdown-item"><small>small text</small></div>
31
- <div class="dropdown-item"><del>deleted text</del></div>
32
- <div class="dropdown-item"><ins>inserted text</ins></div>
33
- <div class="dropdown-item"><blockquote>quoted text</blockquote></div>
34
- <div class="dropdown-item"><q>short quoted text</q></div>
35
- <div class="dropdown-item"><cite>cited text</cite></div>
36
- <div class="dropdown-item"><address>address</address></div>
37
- <div class="dropdown-item"><abbr title="inserted text">inserted text</abbr></div>
38
- <div class="dropdown-item"><code>code snippet</code></div>
39
- <div class="dropdown-item"><mark>marked text</mark></div>
40
- <div class="dropdown-item-plain">Unstyled text</div>
41
- </div>
42
- </div>
43
-
44
- <script type="module">
45
- import './demo.css';
46
-
47
- //JS testing dropdown menu links
48
- document.addEventListener("DOMContentLoaded", () => {
49
- const span = document.querySelector("span");
50
- document.querySelectorAll(".dropdown-item").forEach(item => {
51
- item.addEventListener("click", e => {
52
- e.preventDefault(); // stop page from jumping to top
53
- const text = item.textContent.trim();
54
- if (["Item #2", "Item #3", "Item #4"].includes(text)) {
55
- span.textContent = `${text} was clicked!`;
56
- }
57
- });
58
- });
59
- });
60
-
61
- </script>
62
- </body>
63
- </html>
package/index.ts DELETED
@@ -1,11 +0,0 @@
1
- import DropdownHeader from './src/DropdownHeader.vue';
2
- import DropdownItem from './src/DropdownItem.vue';
3
- import DropdownItemText from './src/DropdownItemText.vue';
4
- import DropdownMenu from './src/DropdownMenu.vue';
5
-
6
- export {
7
- DropdownHeader,
8
- DropdownItem,
9
- DropdownItemText,
10
- DropdownMenu
11
- };
@@ -1,7 +0,0 @@
1
- <script setup lang="ts">
2
-
3
- </script>
4
-
5
- <template>
6
- <hr class="dropdown-divider">
7
- </template>
@@ -1,9 +0,0 @@
1
- <script setup lang="ts">
2
-
3
- </script>
4
-
5
- <template>
6
- <h3 class="dropdown-header">
7
- <slot />
8
- </h3>
9
- </template>
@@ -1,9 +0,0 @@
1
- <script setup lang="ts">
2
-
3
- </script>
4
-
5
- <template>
6
- <div class="dropdown-item">
7
- <slot />
8
- </div>
9
- </template>
@@ -1,9 +0,0 @@
1
- <script setup lang="ts">
2
-
3
- </script>
4
-
5
- <template>
6
- <div class="dropdown-item-text">
7
- <slot />
8
- </div>
9
- </template>
@@ -1,23 +0,0 @@
1
- <script setup lang="ts">
2
- export type DropdownMenuProps = {
3
- align?: 'left' | 'right',
4
- show?: boolean
5
- };
6
-
7
- withDefaults(defineProps<DropdownMenuProps>(), {
8
- align: 'left'
9
- });
10
- </script>
11
-
12
- <template>
13
- <div
14
- class="dropdown-menu"
15
- :aria-labelledby="($attrs.id as string|undefined)"
16
- :class="{
17
- 'dropdown-menu-left': align === 'left',
18
- 'dropdown-menu-right': align === 'right',
19
- 'show': show
20
- }">
21
- <slot />
22
- </div>
23
- </template>
@@ -1,43 +0,0 @@
1
- <script lang="ts">
2
- import { Fragment, h } from 'vue';
3
-
4
- function appendClass(vnode: any, str: any) {
5
- vnode.props.class = `${vnode.props.class || ''} ${str}`.trim();
6
- }
7
-
8
- function changeMenuItems(items: any) {
9
- for(const vnode of items) {
10
- if(vnode.type === Fragment) {
11
- changeMenuItems(vnode.children);
12
- }
13
-
14
- vnode.props = Object.assign({ class: undefined }, vnode.props);
15
- vnode.attrs = Object.assign({}, vnode.attrs);
16
-
17
- if(!vnode.attrs.on) {
18
- vnode.attrs.on = {};
19
- }
20
-
21
- const isDropdownItem = vnode.props.class && vnode.props.class.match(/dropdown-item/);
22
- const isDropdownDivider = vnode.props.class && vnode.props.class.match(/dropdown-divider/);
23
-
24
- if(typeof vnode.type === 'string' && vnode.type.match(/^h\d$/)) {
25
- appendClass(vnode, 'dropdown-header');
26
- }
27
- else if(vnode.type === 'hr' && !isDropdownDivider) {
28
- vnode.type = 'div';
29
-
30
- appendClass(vnode, 'dropdown-divider');
31
- }
32
- else if(!isDropdownItem && !isDropdownDivider) {
33
- appendClass(vnode, 'dropdown-item');
34
- }
35
- }
36
-
37
- return items;
38
- }
39
-
40
- const DropdownMenuItems = (_: any, context: any) => h('div', {}, changeMenuItems(context.slots.default()));
41
-
42
- export default DropdownMenuItems;
43
- </script>
package/tsconfig.json DELETED
@@ -1,27 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "useDefineForClassFields": true,
5
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
- "module": "ESNext",
7
- "skipLibCheck": true,
8
- "moduleResolution": "bundler",
9
- "customConditions": ["source"],
10
- "allowImportingTsExtensions": true,
11
- "resolveJsonModule": true,
12
- "isolatedModules": true,
13
- "noEmit": true,
14
- "strict": true,
15
- "noUnusedLocals": true,
16
- "noUnusedParameters": true,
17
- "noFallthroughCasesInSwitch": true,
18
- "jsx": "preserve",
19
- "jsxImportSource": "vue"
20
- },
21
- "include": [
22
- "**/*.ts",
23
- "**/*.tsx",
24
- "**/*.vue",
25
- ],
26
- "exclude": ["node_modules", "dist"]
27
- }
package/vite.config.js DELETED
@@ -1,52 +0,0 @@
1
- import tailwindcss from '@tailwindcss/vite';
2
- import vue from '@vitejs/plugin-vue';
3
- import { pascalCase } from 'change-case';
4
- import path from 'path';
5
- import { defineConfig } from 'vite';
6
- import dts from 'vite-plugin-dts';
7
- import pkg from './package.json';
8
-
9
- const fileName = pkg.name.split('/')[1];
10
-
11
- const external = [
12
- ...(pkg.dependencies ? Object.keys(pkg.dependencies) : []),
13
- ...(pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [])
14
- ];
15
-
16
- export default ({ command }) => defineConfig({
17
- build: {
18
- sourcemap: command === 'build',
19
- lib: {
20
- entry: path.resolve(__dirname, 'index.ts'),
21
- name: pascalCase(fileName),
22
- fileName,
23
- },
24
- rollupOptions: {
25
- external,
26
- output: {
27
- globals: external.reduce((carry, dep) => {
28
- return Object.assign(carry, {
29
- [dep]: pascalCase(dep)
30
- });
31
- }, {}),
32
- }
33
- },
34
- watch: !process.env.NODE_ENV && {
35
- include: [
36
- './tailwindcss/**/*.js'
37
- ]
38
- }
39
- },
40
- resolve: {
41
- conditions: process.env.NODE_ENV === 'development'
42
- ? ['source', 'import', 'module', 'browser', 'default']
43
- : ['import', 'module', 'browser', 'default'],
44
- },
45
- plugins: [
46
- vue(),
47
- dts({
48
- entryRoot: path.resolve(__dirname, './'),
49
- }),
50
- tailwindcss()
51
- ]
52
- });