vue-composable-ui 0.0.1
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/.github/workflows/deploy.yml +21 -0
- package/.github/workflows/docs.yml +62 -0
- package/.vscode/extensions.json +7 -0
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/docs/.vitepress/config.mts +40 -0
- package/docs/.vitepress/theme/index.js +4 -0
- package/docs/.vitepress/theme/style.scss +155 -0
- package/docs/components/combobox.md +174 -0
- package/docs/components/demos/combobox.vue +142 -0
- package/docs/components/demos/combobox_autocomplete.vue +75 -0
- package/docs/components/demos/combobox_tags.vue +127 -0
- package/docs/components/demos/input.vue +35 -0
- package/docs/components/demos/listbox.vue +64 -0
- package/docs/components/demos/menu.vue +93 -0
- package/docs/components/demos/popover.vue +16 -0
- package/docs/components/demos/tabs.vue +59 -0
- package/docs/components/demos/tooltip.vue +27 -0
- package/docs/components/listbox.md +9 -0
- package/docs/components/menu.md +121 -0
- package/docs/components/popover.md +82 -0
- package/docs/components/tabs.md +9 -0
- package/docs/components/tooltip.md +78 -0
- package/docs/composables/form-control.md +130 -0
- package/docs/composables/list-option.md +47 -0
- package/docs/composables/list.md +192 -0
- package/docs/composables/popover.md +90 -0
- package/docs/index.md +24 -0
- package/docs/intro.md +0 -0
- package/package.json +35 -0
- package/src/components/combobox/combobox.vue +229 -0
- package/src/components/combobox/comboboxFormInput.vue +33 -0
- package/src/components/combobox/comboboxOption.vue +52 -0
- package/src/components/combobox/comboboxOptions.vue +17 -0
- package/src/components/injectionKeys.ts +50 -0
- package/src/components/listbox/listbox.vue +91 -0
- package/src/components/listbox/listboxOption.vue +37 -0
- package/src/components/menu/menu.vue +100 -0
- package/src/components/menu/menuItem.vue +86 -0
- package/src/components/menu/menuItems.vue +51 -0
- package/src/components/popover/popover.vue +68 -0
- package/src/components/popover/popoverDialog.vue +35 -0
- package/src/components/tabs/tab.vue +35 -0
- package/src/components/tabs/tabContainer.vue +50 -0
- package/src/components/tabs/tabList.vue +52 -0
- package/src/components/tabs/tabPanel.vue +36 -0
- package/src/components/tooltip.vue +115 -0
- package/src/composables/formControl.ts +144 -0
- package/src/composables/list.ts +326 -0
- package/src/composables/listOption.ts +80 -0
- package/src/composables/popover.ts +306 -0
- package/src/main.ts +65 -0
- package/src/utils/element.ts +19 -0
- package/src/utils/id.ts +5 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +27 -0
- package/tsconfig.node.json +10 -0
- package/vite.config.ts +28 -0
package/src/main.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Composables
|
|
2
|
+
|
|
3
|
+
import { usePopover } from "./composables/popover";
|
|
4
|
+
import { useList } from "./composables/list";
|
|
5
|
+
import { useListOption } from "./composables/listOption";
|
|
6
|
+
import { useFormControl } from "./composables/formControl";
|
|
7
|
+
|
|
8
|
+
// Utils
|
|
9
|
+
|
|
10
|
+
import { useHTMLElement } from "./utils/element";
|
|
11
|
+
import { useSequentialId } from "./utils/id";
|
|
12
|
+
|
|
13
|
+
// Components
|
|
14
|
+
|
|
15
|
+
import Listbox from "./components/listbox/listbox.vue";
|
|
16
|
+
import ListboxOption from "./components/listbox/listboxOption.vue";
|
|
17
|
+
|
|
18
|
+
import TabContainer from "./components/tabs/tabContainer.vue";
|
|
19
|
+
import TabList from "./components/tabs/tabList.vue";
|
|
20
|
+
import Tab from "./components/tabs/tab.vue";
|
|
21
|
+
import TabPanel from "./components/tabs/tabPanel.vue";
|
|
22
|
+
|
|
23
|
+
import Popover from "./components/popover/popover.vue";
|
|
24
|
+
import PopoverDialog from "./components/popover/popoverDialog.vue";
|
|
25
|
+
|
|
26
|
+
import Tooltip from "./components/tooltip.vue";
|
|
27
|
+
|
|
28
|
+
import Menu from "./components/menu/menu.vue";
|
|
29
|
+
import MenuItems from "./components/menu/menuItems.vue";
|
|
30
|
+
import MenuItem from "./components/menu/menuItem.vue";
|
|
31
|
+
|
|
32
|
+
import Combobox from "./components/combobox/combobox.vue";
|
|
33
|
+
import ComboboxOptions from "./components/combobox/comboboxOptions.vue";
|
|
34
|
+
import ComboboxOption from "./components/combobox/comboboxOption.vue";
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
usePopover,
|
|
38
|
+
useList,
|
|
39
|
+
useListOption,
|
|
40
|
+
useFormControl,
|
|
41
|
+
//
|
|
42
|
+
useHTMLElement,
|
|
43
|
+
useSequentialId,
|
|
44
|
+
//
|
|
45
|
+
Listbox,
|
|
46
|
+
ListboxOption,
|
|
47
|
+
//
|
|
48
|
+
Popover,
|
|
49
|
+
PopoverDialog,
|
|
50
|
+
//
|
|
51
|
+
TabContainer,
|
|
52
|
+
TabList,
|
|
53
|
+
Tab,
|
|
54
|
+
TabPanel,
|
|
55
|
+
//
|
|
56
|
+
Tooltip,
|
|
57
|
+
//
|
|
58
|
+
Menu,
|
|
59
|
+
MenuItems,
|
|
60
|
+
MenuItem,
|
|
61
|
+
//
|
|
62
|
+
Combobox,
|
|
63
|
+
ComboboxOptions,
|
|
64
|
+
ComboboxOption,
|
|
65
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Ref } from "vue";
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
|
|
4
|
+
export type TemplateRefOrSelector<E extends HTMLElement = HTMLElement> =
|
|
5
|
+
| Ref<E | undefined>
|
|
6
|
+
| E
|
|
7
|
+
| string;
|
|
8
|
+
|
|
9
|
+
export function useHTMLElement<E extends HTMLElement = HTMLElement>(
|
|
10
|
+
el: TemplateRefOrSelector<E>
|
|
11
|
+
) {
|
|
12
|
+
if (typeof el === "string") {
|
|
13
|
+
return ref<E | undefined>(document.querySelector<E>(el) || undefined);
|
|
14
|
+
} else if (el instanceof HTMLElement) {
|
|
15
|
+
return ref<E | undefined>(el);
|
|
16
|
+
} else {
|
|
17
|
+
return el;
|
|
18
|
+
}
|
|
19
|
+
}
|
package/src/utils/id.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"outDir": "dist/types",
|
|
11
|
+
"declaration": true,
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"emitDeclarationOnly": true,
|
|
17
|
+
"jsx": "preserve",
|
|
18
|
+
|
|
19
|
+
/* Linting */
|
|
20
|
+
"strict": true,
|
|
21
|
+
"noUnusedLocals": true,
|
|
22
|
+
"noUnusedParameters": true,
|
|
23
|
+
"noFallthroughCasesInSwitch": true
|
|
24
|
+
},
|
|
25
|
+
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
|
|
26
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
27
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { resolve } from "path";
|
|
2
|
+
import { defineConfig } from "vite";
|
|
3
|
+
import vue from "@vitejs/plugin-vue";
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [vue()],
|
|
7
|
+
build: {
|
|
8
|
+
lib: {
|
|
9
|
+
// Could also be a dictionary or array of multiple entry points
|
|
10
|
+
entry: resolve(__dirname, "src/main.ts"),
|
|
11
|
+
name: "Vue Composable UI",
|
|
12
|
+
// the proper extensions will be added
|
|
13
|
+
fileName: "composable-ui",
|
|
14
|
+
},
|
|
15
|
+
rollupOptions: {
|
|
16
|
+
// make sure to externalize deps that shouldn't be bundled
|
|
17
|
+
// into your library
|
|
18
|
+
external: ["vue"],
|
|
19
|
+
output: {
|
|
20
|
+
// Provide global variables to use in the UMD build
|
|
21
|
+
// for externalized deps
|
|
22
|
+
globals: {
|
|
23
|
+
vue: "Vue",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
});
|