v-nuxt-ui 0.1.8 → 0.1.9
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/module.json +1 -1
- package/dist/module.mjs +5 -1
- package/dist/runtime/components/form/field/AsyncSelect.vue +1 -1
- package/dist/runtime/components/form/field/AsyncTreeSelect.vue +1 -1
- package/dist/runtime/components/table/query/where/simple/item/opr/AsyncSelect.vue +1 -1
- package/dist/runtime/composables/useSidebarMenu.d.ts +37 -0
- package/dist/runtime/composables/useTheme.js +25 -10
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -37,7 +37,11 @@ const module$1 = defineNuxtModule({
|
|
|
37
37
|
nuxt.options.vite.optimizeDeps.include.push(
|
|
38
38
|
"dayjs",
|
|
39
39
|
"dayjs/plugin/utc",
|
|
40
|
-
"dayjs/plugin/timezone"
|
|
40
|
+
"dayjs/plugin/timezone",
|
|
41
|
+
"defu",
|
|
42
|
+
"@vue-flow/core",
|
|
43
|
+
"maska/vue",
|
|
44
|
+
"sql-formatter"
|
|
41
45
|
);
|
|
42
46
|
nuxt.options.css.push(resolve("./runtime/assets/css/main.css"));
|
|
43
47
|
nuxt.options.css.push(resolve("./runtime/assets/css/transition.css"));
|
|
@@ -3,7 +3,7 @@ import { ref, computed } from "vue";
|
|
|
3
3
|
import { useFetching } from "#v/composables/useBoolean";
|
|
4
4
|
import { isEmptyString } from "#v/utils";
|
|
5
5
|
import { useDebounceFn } from "@vueuse/core";
|
|
6
|
-
import defu from "defu";
|
|
6
|
+
import { defu } from "defu";
|
|
7
7
|
import { useApp } from "#v/composables/useApp";
|
|
8
8
|
const props = defineProps({
|
|
9
9
|
listApi: { type: Function, required: true },
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ref, computed } from "vue";
|
|
3
3
|
import { useFetching } from "#v/composables/useBoolean";
|
|
4
4
|
import { flattenTree, treeifyOptions, isEmptyString } from "#v/utils";
|
|
5
|
-
import defu from "defu";
|
|
5
|
+
import { defu } from "defu";
|
|
6
6
|
const props = defineProps({
|
|
7
7
|
fetchAll: { type: Boolean, required: false },
|
|
8
8
|
listApi: { type: Function, required: true },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref, computed, useTemplateRef } from "vue";
|
|
3
3
|
import { useDebounceFn } from "@vueuse/core";
|
|
4
|
-
import defu from "defu";
|
|
4
|
+
import { defu } from "defu";
|
|
5
5
|
import { useFetching } from "#v/composables/useBoolean";
|
|
6
6
|
import { isEmptyString } from "#v/utils";
|
|
7
7
|
import ButtonDropdown from "#v/components/button/Dropdown.vue";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { BreadcrumbItem, NavigationMenuItem } from '@nuxt/ui';
|
|
2
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
3
|
+
export declare function setGlobalSidebarMenus(opts: {
|
|
4
|
+
constantMenus?: NavigationMenuItem[];
|
|
5
|
+
bizMenus?: NavigationMenuItem[];
|
|
6
|
+
menuMode?: 'static' | 'dynamic';
|
|
7
|
+
}): void;
|
|
8
|
+
export declare const _useSidebarMenus: () => {
|
|
9
|
+
constantMenus: Ref<NavigationMenuItem[]>;
|
|
10
|
+
constantMenuPathSet: ComputedRef<Set<string>>;
|
|
11
|
+
bizMenus: Ref<NavigationMenuItem[]>;
|
|
12
|
+
flattenBizMenus: ComputedRef<NavigationMenuItem[]>;
|
|
13
|
+
bizMenuPathSet: ComputedRef<Set<string>>;
|
|
14
|
+
menusFromUser: Ref<Model.Menu[]>;
|
|
15
|
+
sidebarMenus: Ref<NavigationMenuItem[]>;
|
|
16
|
+
sidebarMenuPathSet: Ref<Set<string>>;
|
|
17
|
+
expandSidebarMenu: (path: string) => void;
|
|
18
|
+
setUserDynamicMenus: (newRolesFromUser: Model.Role[], newMenusFromUser: Model.Menu[]) => void;
|
|
19
|
+
disabledMenuPathSet: ComputedRef<Set<string>>;
|
|
20
|
+
breadcrumbs: Ref<BreadcrumbItem[]>;
|
|
21
|
+
getBreadcrumbs: (current: string, menus?: NavigationMenuItem[]) => BreadcrumbItem[];
|
|
22
|
+
};
|
|
23
|
+
export declare const useSidebarMenus: () => {
|
|
24
|
+
constantMenus: Ref<NavigationMenuItem[]>;
|
|
25
|
+
constantMenuPathSet: ComputedRef<Set<string>>;
|
|
26
|
+
bizMenus: Ref<NavigationMenuItem[]>;
|
|
27
|
+
flattenBizMenus: ComputedRef<NavigationMenuItem[]>;
|
|
28
|
+
bizMenuPathSet: ComputedRef<Set<string>>;
|
|
29
|
+
menusFromUser: Ref<Model.Menu[]>;
|
|
30
|
+
sidebarMenus: Ref<NavigationMenuItem[]>;
|
|
31
|
+
sidebarMenuPathSet: Ref<Set<string>>;
|
|
32
|
+
expandSidebarMenu: (path: string) => void;
|
|
33
|
+
setUserDynamicMenus: (newRolesFromUser: Model.Role[], newMenusFromUser: Model.Menu[]) => void;
|
|
34
|
+
disabledMenuPathSet: ComputedRef<Set<string>>;
|
|
35
|
+
breadcrumbs: Ref<BreadcrumbItem[]>;
|
|
36
|
+
getBreadcrumbs: (current: string, menus?: NavigationMenuItem[]) => BreadcrumbItem[];
|
|
37
|
+
};
|
|
@@ -1,18 +1,35 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
2
|
import { createSharedComposable, useColorMode } from "@vueuse/core";
|
|
3
|
-
import colors from "tailwindcss/colors";
|
|
4
|
-
import { omit } from "@nuxt/ui/utils";
|
|
5
3
|
import { en, zh_cn } from "@nuxt/ui/locale";
|
|
6
4
|
import { useApp } from "./useApp.js";
|
|
7
5
|
import { useAppConfig } from "nuxt/app";
|
|
6
|
+
const twPrimaryColorNames = [
|
|
7
|
+
"red",
|
|
8
|
+
"orange",
|
|
9
|
+
"amber",
|
|
10
|
+
"yellow",
|
|
11
|
+
"lime",
|
|
12
|
+
"green",
|
|
13
|
+
"emerald",
|
|
14
|
+
"teal",
|
|
15
|
+
"cyan",
|
|
16
|
+
"sky",
|
|
17
|
+
"blue",
|
|
18
|
+
"indigo",
|
|
19
|
+
"violet",
|
|
20
|
+
"purple",
|
|
21
|
+
"fuchsia",
|
|
22
|
+
"pink",
|
|
23
|
+
"rose"
|
|
24
|
+
];
|
|
25
|
+
const twNeutralColorNames = ["slate", "gray", "zinc", "neutral", "stone", "taupe", "mauve", "mist", "olive"];
|
|
8
26
|
const _useTheme = () => {
|
|
9
27
|
const appConfig = useAppConfig();
|
|
10
28
|
const colorMode = useColorMode();
|
|
11
29
|
const app = useApp();
|
|
12
|
-
const neutralColors = ["slate", "gray", "zinc", "neutral", "stone", "taupe", "mauve", "mist", "olive"];
|
|
13
30
|
const neutral = computed({
|
|
14
31
|
get() {
|
|
15
|
-
return appConfig.ui
|
|
32
|
+
return appConfig.ui?.colors?.neutral;
|
|
16
33
|
},
|
|
17
34
|
set(option) {
|
|
18
35
|
console.log(option, appConfig);
|
|
@@ -22,15 +39,13 @@ const _useTheme = () => {
|
|
|
22
39
|
});
|
|
23
40
|
const blackAsPrimary = computed({
|
|
24
41
|
get() {
|
|
25
|
-
return appConfig.theme
|
|
42
|
+
return appConfig.theme?.blackAsPrimary;
|
|
26
43
|
},
|
|
27
44
|
set(option) {
|
|
28
45
|
appConfig.theme.blackAsPrimary = option;
|
|
29
46
|
app.updateBlackAsPrimary(option);
|
|
30
47
|
}
|
|
31
48
|
});
|
|
32
|
-
const colorsToOmit = ["inherit", "current", "transparent", "black", "white", ...neutralColors];
|
|
33
|
-
const primaryColors = Object.keys(omit(colors, colorsToOmit));
|
|
34
49
|
const primary = computed({
|
|
35
50
|
get() {
|
|
36
51
|
return appConfig.ui.colors.primary;
|
|
@@ -42,7 +57,7 @@ const _useTheme = () => {
|
|
|
42
57
|
}
|
|
43
58
|
});
|
|
44
59
|
const chartColorVars = computed(() => ["chart-1", "chart-2", "chart-3", "chart-4", "chart-5"].map((c) => `var(--${c})`));
|
|
45
|
-
const primaryColorVars = computed(() =>
|
|
60
|
+
const primaryColorVars = computed(() => twPrimaryColorNames.map((c) => `var(--color-${c}-${colorMode.value === "light" ? "400" : "500"})`));
|
|
46
61
|
const radiuses = [0, 0.125, 0.25, 0.375, 0.5];
|
|
47
62
|
const radius = computed({
|
|
48
63
|
get() {
|
|
@@ -77,9 +92,9 @@ const _useTheme = () => {
|
|
|
77
92
|
});
|
|
78
93
|
return {
|
|
79
94
|
blackAsPrimary,
|
|
80
|
-
neutralColors,
|
|
95
|
+
neutralColors: twNeutralColorNames,
|
|
81
96
|
neutral,
|
|
82
|
-
primaryColors,
|
|
97
|
+
primaryColors: twPrimaryColorNames,
|
|
83
98
|
primary,
|
|
84
99
|
chartColorVars,
|
|
85
100
|
primaryColorVars,
|
package/package.json
CHANGED