vueless 0.0.740 → 0.0.742
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/package.json
CHANGED
package/plugin-vite.js
CHANGED
|
@@ -8,7 +8,7 @@ import UnpluginVueComponents from "unplugin-vue-components/vite";
|
|
|
8
8
|
import { loadSvg } from "./utils/node/loaderSvg.js";
|
|
9
9
|
import { cacheIcons, removeIconsCache, copyIconsCache } from "./utils/node/loaderIcon.js";
|
|
10
10
|
import { createTailwindSafelist, clearTailwindSafelist } from "./utils/node/tailwindSafelist.js";
|
|
11
|
-
import {
|
|
11
|
+
import { getNuxtDirs, getVueDirs, getVuelessConfigDirs } from "./utils/node/helper.js";
|
|
12
12
|
import { componentResolver, directiveResolver } from "./utils/node/vuelessResolver.js";
|
|
13
13
|
import { setCustomPropTypes, removeCustomPropTypes } from "./utils/node/dynamicProps.js";
|
|
14
14
|
import { buildWebTypes } from "./utils/node/webTypes.js";
|
|
@@ -35,7 +35,11 @@ export const Vueless = function (options = {}) {
|
|
|
35
35
|
const isVuelessEnv = env === "vueless";
|
|
36
36
|
const isNuxt = mode === "nuxt-module";
|
|
37
37
|
|
|
38
|
-
const targetFiles = [
|
|
38
|
+
const targetFiles = [
|
|
39
|
+
...(include || []),
|
|
40
|
+
...getVuelessConfigDirs(),
|
|
41
|
+
...(isNuxt ? getNuxtDirs() : getVueDirs()),
|
|
42
|
+
];
|
|
39
43
|
|
|
40
44
|
/* if server stopped by developer (Ctrl+C) */
|
|
41
45
|
process.on("SIGINT", async () => {
|
|
@@ -15,6 +15,7 @@ defineOptions({ inheritAttrs: false });
|
|
|
15
15
|
|
|
16
16
|
const setUTabsSelectedItem = inject<SetUTabsSelectedItem>("setUTabsSelectedItem");
|
|
17
17
|
const getUTabsSelectedItem = inject("getUTabsSelectedItem");
|
|
18
|
+
const getUTabsScrollable = inject<UTabsProps["scrollable"]>("getUTabsScrollable");
|
|
18
19
|
const getUTabsSquare = inject<UTabsProps["square"]>("getUTabsSquare");
|
|
19
20
|
const getUTabsBlock = inject<UTabsProps["block"]>("getUTabsBlock");
|
|
20
21
|
const getUTabsSize = inject<UTabsProps["size"]>("getUTabsSize", "md");
|
|
@@ -26,6 +27,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
26
27
|
const size = computed(() => toValue(getUTabsSize));
|
|
27
28
|
const block = computed(() => toValue(getUTabsBlock));
|
|
28
29
|
const square = computed(() => toValue(getUTabsSquare));
|
|
30
|
+
const scrollable = computed(() => toValue(getUTabsScrollable));
|
|
29
31
|
const isActive = computed(() => toValue(getUTabsSelectedItem) === props.value && !props.disabled);
|
|
30
32
|
|
|
31
33
|
async function onClickSetValue() {
|
|
@@ -42,6 +44,7 @@ const mutatedProps = computed(() => ({
|
|
|
42
44
|
size: size.value,
|
|
43
45
|
block: block.value,
|
|
44
46
|
square: square.value,
|
|
47
|
+
scrollable: scrollable.value,
|
|
45
48
|
/* component state, not a props */
|
|
46
49
|
active: isActive.value,
|
|
47
50
|
}));
|
|
@@ -75,6 +75,7 @@ onUnmounted(() => {
|
|
|
75
75
|
provide("getUTabsSize", () => props.size);
|
|
76
76
|
provide("getUTabsBlock", () => props.block);
|
|
77
77
|
provide("getUTabsSquare", () => props.square);
|
|
78
|
+
provide("getUTabsScrollable", () => props.scrollable);
|
|
78
79
|
provide("getUTabsSelectedItem", () => selectedItem.value);
|
|
79
80
|
provide("setUTabsSelectedItem", (value: string) => (selectedItem.value = value));
|
|
80
81
|
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
|
-
wrapper:
|
|
3
|
-
|
|
4
|
-
base: "flex flex-nowrap border-b border-gray-200 dark:border-gray-700",
|
|
2
|
+
wrapper: {
|
|
3
|
+
base: "mb-6 flex gap-1",
|
|
5
4
|
variants: {
|
|
6
5
|
block: {
|
|
7
6
|
true: "w-full",
|
|
8
7
|
},
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
tabs: {
|
|
11
|
+
base: "flex border-b border-gray-200 dark:border-gray-700",
|
|
12
|
+
variants: {
|
|
9
13
|
scrollable: {
|
|
10
|
-
true: "overflow-hidden scroll-smooth",
|
|
14
|
+
true: "overflow-hidden flex-nowrap scroll-smooth",
|
|
15
|
+
},
|
|
16
|
+
block: {
|
|
17
|
+
true: "w-full",
|
|
11
18
|
},
|
|
12
19
|
},
|
|
13
20
|
},
|
package/utils/node/helper.js
CHANGED
|
@@ -51,7 +51,7 @@ export async function getDirFiles(dirPath, ext, { recursive = true, exclude = []
|
|
|
51
51
|
.filter((filePath) => !statSync(filePath).isDirectory());
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export function
|
|
54
|
+
export function getNuxtDirs() {
|
|
55
55
|
return [
|
|
56
56
|
path.join(cwd(), "composables"),
|
|
57
57
|
path.join(cwd(), "components"),
|
|
@@ -68,10 +68,14 @@ export function getNuxtFiles() {
|
|
|
68
68
|
];
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
export function
|
|
71
|
+
export function getVueDirs() {
|
|
72
72
|
return [path.join(cwd(), "src")];
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
export function getVuelessConfigDirs() {
|
|
76
|
+
return [path.join(cwd(), ".vueless")];
|
|
77
|
+
}
|
|
78
|
+
|
|
75
79
|
export async function getComponentDefaultConfig(name, entryPath) {
|
|
76
80
|
const configOutPath = path.join(cwd(), `${VUELESS_CONFIGS_CACHED_DIR}/${name}.mjs`);
|
|
77
81
|
|