@oiij/naive-ui 0.0.69 → 0.0.70
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/components/config-providers/ConfigProviders.js +1 -1
- package/dist/components/config-providers/ConfigProviders.vue.d.ts +2 -2
- package/dist/components/config-providers/index.d.ts +1 -1
- package/dist/components/copy-button/CopyButton.vue.d.ts +4 -4
- package/dist/components/data-table-plus/DataTablePlus.js +1 -1
- package/dist/components/data-table-plus/DataTablePlus.vue.d.ts +2 -2
- package/dist/components/data-table-plus/index.d.ts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/loading-provider/LoadingProvider.vue.d.ts +2 -2
- package/dist/components/preset-form/PresetForm.js +1 -1
- package/dist/components/preset-form/PresetForm.vue.d.ts +15 -15
- package/dist/components/preset-form/index.d.ts +2 -2
- package/dist/components/preset-input/PresetInput.vue.d.ts +3 -3
- package/dist/components/preset-picker/PresetPicker.vue.d.ts +1 -1
- package/dist/components/preset-picker/index.d.ts +1 -1
- package/dist/components/preset-select/PresetSelect.js +1 -1
- package/dist/components/preset-select/PresetSelect.vue.d.ts +27 -27
- package/dist/components/preset-select/index.d.ts +1 -1
- package/dist/components/remote-request/RemoteRequest.js +1 -1
- package/dist/components/remote-request/RemoteRequest.vue.d.ts +11 -11
- package/dist/components/remote-request/index.d.ts +1 -1
- package/dist/components/search-input/SearchInput.vue.d.ts +4 -4
- package/dist/components/toggle-input/ToggleInput.vue.d.ts +4 -4
- package/dist/components/tooltip-button/TooltipButton.vue.d.ts +4 -4
- package/dist/components/transition/BaseTransition.vue.d.ts +2 -2
- package/dist/components.d.ts +1 -1
- package/dist/composables/_helper.js +7 -1
- package/dist/composables/index.d.ts +4 -4
- package/dist/composables/index.js +4 -4
- package/dist/composables/{useDataRequest.d.ts → use-data-request.d.ts} +1 -1
- package/dist/composables/{useDataRequest.js → use-data-request.js} +1 -1
- package/dist/composables/{useLoading.d.ts → use-loading.d.ts} +1 -1
- package/dist/composables/{useLoading.js → use-loading.js} +1 -1
- package/dist/composables/{useNaiveForm.d.ts → use-naive-form.d.ts} +2 -2
- package/dist/composables/{useNaiveForm.js → use-naive-form.js} +1 -1
- package/dist/composables/use-naive-theme.d.ts +52 -0
- package/dist/composables/use-naive-theme.js +89 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/package.json +5 -5
- package/dist/composables/useNaiveTheme.d.ts +0 -165
- package/dist/composables/useNaiveTheme.js +0 -86
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import LoadingProvider_default from "../loading-provider/LoadingProvider.js";
|
|
2
2
|
import "../loading-provider/index.js";
|
|
3
|
-
import { useLoading } from "../../composables/
|
|
3
|
+
import { useLoading } from "../../composables/use-loading.js";
|
|
4
4
|
import "../../composables/index.js";
|
|
5
5
|
import { createBlock, createCommentVNode, createVNode, defineComponent, guardReactiveProps, normalizeProps, onMounted, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
6
6
|
import { NConfigProvider, NDialogProvider, NGlobalStyle, NLoadingBarProvider, NMessageProvider, NModalProvider, NNotificationProvider, useDialog, useLoadingBar, useMessage, useModal, useNotification } from "naive-ui";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ConfigProvidersProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue21 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/config-providers/ConfigProviders.vue.d.ts
|
|
5
5
|
declare var __VLS_44: {};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
7
|
default?: (props: typeof __VLS_44) => any;
|
|
8
8
|
};
|
|
9
|
-
declare const __VLS_base:
|
|
9
|
+
declare const __VLS_base: vue21.DefineComponent<ConfigProvidersProps, {}, {}, {}, {}, vue21.ComponentOptionsMixin, vue21.ComponentOptionsMixin, {}, string, vue21.PublicProps, Readonly<ConfigProvidersProps> & Readonly<{}>, {}, {}, {}, {}, string, vue21.ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
11
|
declare const _default: typeof __VLS_export;
|
|
12
12
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClassStyle } from "../data-table-plus/index.js";
|
|
2
2
|
import { LoadingProviderProps } from "../loading-provider/index.js";
|
|
3
|
-
import { useLoading } from "../../composables/
|
|
3
|
+
import { useLoading } from "../../composables/use-loading.js";
|
|
4
4
|
import "../../composables/index.js";
|
|
5
5
|
import { _default } from "./ConfigProviders.vue.js";
|
|
6
6
|
import { ConfigProviderProps, DialogProviderInst, DialogProviderProps, LoadingBarProviderInst, LoadingBarProviderProps, MessageProviderInst, MessageProviderProps, ModalProviderInst, ModalProviderProps, NotificationProviderInst, NotificationProviderProps } from "naive-ui";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CopyButtonProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue55 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/copy-button/CopyButton.vue.d.ts
|
|
5
5
|
declare var __VLS_9: {}, __VLS_18: {}, __VLS_25: {};
|
|
@@ -10,11 +10,11 @@ type __VLS_Slots = {} & {
|
|
|
10
10
|
} & {
|
|
11
11
|
tooltip?: (props: typeof __VLS_25) => any;
|
|
12
12
|
};
|
|
13
|
-
declare const __VLS_base:
|
|
13
|
+
declare const __VLS_base: vue55.DefineComponent<CopyButtonProps, {}, {}, {}, {}, vue55.ComponentOptionsMixin, vue55.ComponentOptionsMixin, {} & {
|
|
14
14
|
copied: (v: string | undefined) => any;
|
|
15
|
-
}, string,
|
|
15
|
+
}, string, vue55.PublicProps, Readonly<CopyButtonProps> & Readonly<{
|
|
16
16
|
onCopied?: ((v: string | undefined) => any) | undefined;
|
|
17
|
-
}>, {}, {}, {}, {}, string,
|
|
17
|
+
}>, {}, {}, {}, {}, string, vue55.ComponentProvideOptions, false, {}, any>;
|
|
18
18
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
19
|
declare const _default: typeof __VLS_export;
|
|
20
20
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useDataRequest } from "../../composables/
|
|
1
|
+
import { useDataRequest } from "../../composables/use-data-request.js";
|
|
2
2
|
import MageArrowUp_default from "../icons/MageArrowUp.js";
|
|
3
3
|
import SearchInput_default from "../search-input/SearchInput.js";
|
|
4
4
|
import "../search-input/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataObject, UseDataRequestPagination } from "../../composables/
|
|
1
|
+
import { DataObject, UseDataRequestPagination } from "../../composables/use-data-request.js";
|
|
2
2
|
import { DataTablePlusEmits, DataTablePlusExpose, DataTablePlusProps } from "./index.js";
|
|
3
3
|
import "../../composables/index.js";
|
|
4
4
|
import * as _vueuse_core31 from "@vueuse/core";
|
|
@@ -12,10 +12,10 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
12
12
|
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
13
13
|
onLoad?: ((row: R) => any) | undefined;
|
|
14
14
|
onScroll?: ((ev: Event) => any) | undefined;
|
|
15
|
+
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
15
16
|
onBefore?: ((params: P[]) => any) | undefined;
|
|
16
17
|
"onUpdate:page"?: ((page: number) => any) | undefined;
|
|
17
18
|
"onUpdate:pageSize"?: ((pageSize: number) => any) | undefined;
|
|
18
|
-
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
19
19
|
onClickRow?: ((row: R, index: number, event: MouseEvent, currentData: R[]) => any) | undefined;
|
|
20
20
|
onContextMenuRow?: ((row: R, index: number, event: MouseEvent, currentData: R[]) => any) | undefined;
|
|
21
21
|
onScrollBottom?: ((ev: Event) => any) | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataObject, DataRequestFields, UseDataRequestReturns } from "../../composables/
|
|
1
|
+
import { DataObject, DataRequestFields, UseDataRequestReturns } from "../../composables/use-data-request.js";
|
|
2
2
|
import { RemoteRequestEmits, RemoteRequestProps } from "../remote-request/index.js";
|
|
3
3
|
import { SearchInputProps } from "../search-input/index.js";
|
|
4
4
|
import { _default } from "./DataTablePlus.vue.js";
|
|
@@ -6,7 +6,7 @@ import { _default as _default$2 } from "./data-table-plus/DataTablePlus.vue.js";
|
|
|
6
6
|
import { ClassStyle, DataTablePlusEmits, DataTablePlusExpose, DataTablePlusFields, DataTablePlusInst, DataTablePlusProps } from "./data-table-plus/index.js";
|
|
7
7
|
import { _default as _default$3 } from "./loading-provider/LoadingProvider.vue.js";
|
|
8
8
|
import { LoadingProviderInst, LoadingProviderProps, loadingProviderInjectionKey } from "./loading-provider/index.js";
|
|
9
|
-
import { NaiveFormRules } from "../composables/
|
|
9
|
+
import { NaiveFormRules } from "../composables/use-naive-form.js";
|
|
10
10
|
import { _default as _default$4 } from "./config-providers/ConfigProviders.vue.js";
|
|
11
11
|
import { ConfigProvidersProps } from "./config-providers/index.js";
|
|
12
12
|
import { _default as _default$5 } from "./copy-button/CopyButton.vue.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LoadingProviderProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue35 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/loading-provider/LoadingProvider.vue.d.ts
|
|
5
5
|
declare var __VLS_26: {}, __VLS_29: {}, __VLS_31: {};
|
|
@@ -10,7 +10,7 @@ type __VLS_Slots = {} & {
|
|
|
10
10
|
} & {
|
|
11
11
|
default?: (props: typeof __VLS_31) => any;
|
|
12
12
|
};
|
|
13
|
-
declare const __VLS_base:
|
|
13
|
+
declare const __VLS_base: vue35.DefineComponent<LoadingProviderProps, {}, {}, {}, {}, vue35.ComponentOptionsMixin, vue35.ComponentOptionsMixin, {}, string, vue35.PublicProps, Readonly<LoadingProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, vue35.ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
15
|
declare const _default: typeof __VLS_export;
|
|
16
16
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useNaiveForm } from "../../composables/
|
|
1
|
+
import { useNaiveForm } from "../../composables/use-naive-form.js";
|
|
2
2
|
import PresetInput_default from "../preset-input/PresetInput.js";
|
|
3
3
|
import "../preset-input/index.js";
|
|
4
4
|
import { mergeRule } from "./_utils.js";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { DataObject } from "../../composables/
|
|
1
|
+
import { DataObject } from "../../composables/use-data-request.js";
|
|
2
2
|
import { PresetFormExpose, PresetFormProps } from "./index.js";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as _vueuse_core8 from "@vueuse/core";
|
|
4
|
+
import * as vue26 from "vue";
|
|
5
5
|
import * as naive_ui0 from "naive-ui";
|
|
6
6
|
import { FormInst } from "naive-ui";
|
|
7
7
|
import * as async_validator0 from "async-validator";
|
|
8
8
|
|
|
9
9
|
//#region src/components/preset-form/PresetForm.vue.d.ts
|
|
10
10
|
declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
11
|
-
props:
|
|
11
|
+
props: vue26.PublicProps & __VLS_PrettifyLocal<PresetFormProps<V> & {
|
|
12
12
|
onValidated?: ((val: V) => any) | undefined;
|
|
13
13
|
}> & (typeof globalThis extends {
|
|
14
14
|
__VLS_PROPS_FALLBACK: infer P;
|
|
15
15
|
} ? P : {});
|
|
16
|
-
expose: (exposed:
|
|
16
|
+
expose: (exposed: vue26.ShallowUnwrapRef<PresetFormExpose<V>>) => void;
|
|
17
17
|
attrs: any;
|
|
18
18
|
slots: {
|
|
19
19
|
header?: (props: {
|
|
@@ -21,8 +21,8 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
21
21
|
formValue: V;
|
|
22
22
|
formRules: Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>;
|
|
23
23
|
formProps: {
|
|
24
|
-
model:
|
|
25
|
-
rules:
|
|
24
|
+
model: vue26.Reactive<V>;
|
|
25
|
+
rules: vue26.Reactive<Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>>;
|
|
26
26
|
};
|
|
27
27
|
setValue: (_value: Partial<V>) => void;
|
|
28
28
|
validate: () => Promise<{
|
|
@@ -32,7 +32,7 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
32
32
|
resetForm: () => void;
|
|
33
33
|
reset: () => void;
|
|
34
34
|
clear: () => void;
|
|
35
|
-
onValidated:
|
|
35
|
+
onValidated: _vueuse_core8.EventHookOn<[V]>;
|
|
36
36
|
}) => any;
|
|
37
37
|
} & {
|
|
38
38
|
default?: (props: {
|
|
@@ -40,8 +40,8 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
40
40
|
formValue: V;
|
|
41
41
|
formRules: Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>;
|
|
42
42
|
formProps: {
|
|
43
|
-
model:
|
|
44
|
-
rules:
|
|
43
|
+
model: vue26.Reactive<V>;
|
|
44
|
+
rules: vue26.Reactive<Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>>;
|
|
45
45
|
};
|
|
46
46
|
setValue: (_value: Partial<V>) => void;
|
|
47
47
|
validate: () => Promise<{
|
|
@@ -51,7 +51,7 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
51
51
|
resetForm: () => void;
|
|
52
52
|
reset: () => void;
|
|
53
53
|
clear: () => void;
|
|
54
|
-
onValidated:
|
|
54
|
+
onValidated: _vueuse_core8.EventHookOn<[V]>;
|
|
55
55
|
}) => any;
|
|
56
56
|
} & {
|
|
57
57
|
footer?: (props: {
|
|
@@ -59,8 +59,8 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
59
59
|
formValue: V;
|
|
60
60
|
formRules: Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>;
|
|
61
61
|
formProps: {
|
|
62
|
-
model:
|
|
63
|
-
rules:
|
|
62
|
+
model: vue26.Reactive<V>;
|
|
63
|
+
rules: vue26.Reactive<Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>>;
|
|
64
64
|
};
|
|
65
65
|
setValue: (_value: Partial<V>) => void;
|
|
66
66
|
validate: () => Promise<{
|
|
@@ -70,11 +70,11 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
70
70
|
resetForm: () => void;
|
|
71
71
|
reset: () => void;
|
|
72
72
|
clear: () => void;
|
|
73
|
-
onValidated:
|
|
73
|
+
onValidated: _vueuse_core8.EventHookOn<[V]>;
|
|
74
74
|
}) => any;
|
|
75
75
|
};
|
|
76
76
|
emit: (e: "validated", val: V) => void;
|
|
77
|
-
}>) =>
|
|
77
|
+
}>) => vue26.VNode & {
|
|
78
78
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
79
79
|
};
|
|
80
80
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DataObject } from "../../composables/
|
|
1
|
+
import { DataObject } from "../../composables/use-data-request.js";
|
|
2
2
|
import { ClassStyle } from "../data-table-plus/index.js";
|
|
3
|
-
import { NaiveFormClearRules, NaiveFormReturns, NaiveFormRules } from "../../composables/
|
|
3
|
+
import { NaiveFormClearRules, NaiveFormReturns, NaiveFormRules } from "../../composables/use-naive-form.js";
|
|
4
4
|
import { PresetInputOptions } from "../preset-input/index.js";
|
|
5
5
|
import { _default } from "./PresetForm.vue.js";
|
|
6
6
|
import { VNode } from "vue";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PresetInputProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue40 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/preset-input/PresetInput.vue.d.ts
|
|
5
5
|
declare const __VLS_export: <V>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
6
|
-
props:
|
|
6
|
+
props: vue40.PublicProps & __VLS_PrettifyLocal<PresetInputProps<V> & {
|
|
7
7
|
"onUpdate:value"?: ((val?: V | undefined) => any) | undefined;
|
|
8
8
|
}> & (typeof globalThis extends {
|
|
9
9
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -12,7 +12,7 @@ declare const __VLS_export: <V>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
12
12
|
attrs: any;
|
|
13
13
|
slots: {};
|
|
14
14
|
emit: (e: "update:value", val?: V) => void;
|
|
15
|
-
}>) =>
|
|
15
|
+
}>) => vue40.VNode & {
|
|
16
16
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
17
17
|
};
|
|
18
18
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataObject } from "../../composables/
|
|
1
|
+
import { DataObject } from "../../composables/use-data-request.js";
|
|
2
2
|
import { PresetPickerEmits, PresetPickerExpose, PresetPickerProps, PresetPickerValue } from "./index.js";
|
|
3
3
|
import * as vue60 from "vue";
|
|
4
4
|
import { DataTableColumns } from "naive-ui";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataObject } from "../../composables/
|
|
1
|
+
import { DataObject } from "../../composables/use-data-request.js";
|
|
2
2
|
import { ClassStyle } from "../data-table-plus/index.js";
|
|
3
3
|
import { _default } from "./PresetPicker.vue.js";
|
|
4
4
|
import { Ref } from "vue";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useDataRequest } from "../../composables/
|
|
1
|
+
import { useDataRequest } from "../../composables/use-data-request.js";
|
|
2
2
|
import { useDebounceFn } from "@vueuse/core";
|
|
3
3
|
import { computed, createBlock, createCommentVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, reactive, ref, renderSlot, toRaw, toValue, unref, useTemplateRef, withCtx } from "vue";
|
|
4
4
|
import { NFlex, NPagination, NSelect } from "naive-ui";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { DataObject, UseDataRequestPagination } from "../../composables/
|
|
1
|
+
import { DataObject, UseDataRequestPagination } from "../../composables/use-data-request.js";
|
|
2
2
|
import { PresetSelectEmits, PresetSelectExpose, PresetSelectProps, PresetSelectValue } from "./index.js";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as _vueuse_core11 from "@vueuse/core";
|
|
4
|
+
import * as vue42 from "vue";
|
|
5
5
|
import { SelectInst, SelectOption } from "naive-ui";
|
|
6
6
|
|
|
7
7
|
//#region src/components/preset-select/PresetSelect.vue.d.ts
|
|
8
8
|
declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject, D extends DataObject, R extends DataObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
9
|
-
props:
|
|
9
|
+
props: vue42.PublicProps & __VLS_PrettifyLocal<PresetSelectProps<V, P, D, R> & {
|
|
10
10
|
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
11
11
|
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
12
12
|
onClear?: (() => any) | undefined;
|
|
@@ -15,15 +15,15 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
15
15
|
onScroll?: ((ev: Event) => any) | undefined;
|
|
16
16
|
"onUpdate:value"?: ((val: V | null, option: SelectOption | SelectOption[] | null, raw: R | R[] | null) => any) | undefined;
|
|
17
17
|
onSearch?: ((value: string) => any) | undefined;
|
|
18
|
+
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
18
19
|
onBefore?: ((params: P[]) => any) | undefined;
|
|
19
20
|
onCreate?: ((label: string) => any) | undefined;
|
|
20
21
|
"onUpdate:page"?: ((page: number) => any) | undefined;
|
|
21
22
|
"onUpdate:pageSize"?: ((pageSize: number) => any) | undefined;
|
|
22
|
-
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
23
23
|
}> & (typeof globalThis extends {
|
|
24
24
|
__VLS_PROPS_FALLBACK: infer P_1;
|
|
25
25
|
} ? P_1 : {});
|
|
26
|
-
expose: (exposed:
|
|
26
|
+
expose: (exposed: vue42.ShallowUnwrapRef<PresetSelectExpose<P, D, R>>) => void;
|
|
27
27
|
attrs: any;
|
|
28
28
|
slots: {
|
|
29
29
|
header?: (props: {
|
|
@@ -47,10 +47,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
47
47
|
setParams: (_params: Partial<P>) => void;
|
|
48
48
|
runParams: (_params: Partial<P>) => void;
|
|
49
49
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
50
|
-
onBefore:
|
|
51
|
-
onSuccess:
|
|
52
|
-
onError:
|
|
53
|
-
onFinally:
|
|
50
|
+
onBefore: _vueuse_core11.EventHookOn<[P[]]>;
|
|
51
|
+
onSuccess: _vueuse_core11.EventHookOn<[D, P[]]>;
|
|
52
|
+
onError: _vueuse_core11.EventHookOn<[Error, P[]]>;
|
|
53
|
+
onFinally: _vueuse_core11.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
54
54
|
}) => any;
|
|
55
55
|
} & {
|
|
56
56
|
footer?: (props: {
|
|
@@ -74,10 +74,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
74
74
|
setParams: (_params: Partial<P>) => void;
|
|
75
75
|
runParams: (_params: Partial<P>) => void;
|
|
76
76
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
77
|
-
onBefore:
|
|
78
|
-
onSuccess:
|
|
79
|
-
onError:
|
|
80
|
-
onFinally:
|
|
77
|
+
onBefore: _vueuse_core11.EventHookOn<[P[]]>;
|
|
78
|
+
onSuccess: _vueuse_core11.EventHookOn<[D, P[]]>;
|
|
79
|
+
onError: _vueuse_core11.EventHookOn<[Error, P[]]>;
|
|
80
|
+
onFinally: _vueuse_core11.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
81
81
|
}) => any;
|
|
82
82
|
} & {
|
|
83
83
|
'footer-extra'?: (props: {
|
|
@@ -101,10 +101,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
101
101
|
setParams: (_params: Partial<P>) => void;
|
|
102
102
|
runParams: (_params: Partial<P>) => void;
|
|
103
103
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
104
|
-
onBefore:
|
|
105
|
-
onSuccess:
|
|
106
|
-
onError:
|
|
107
|
-
onFinally:
|
|
104
|
+
onBefore: _vueuse_core11.EventHookOn<[P[]]>;
|
|
105
|
+
onSuccess: _vueuse_core11.EventHookOn<[D, P[]]>;
|
|
106
|
+
onError: _vueuse_core11.EventHookOn<[Error, P[]]>;
|
|
107
|
+
onFinally: _vueuse_core11.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
108
108
|
}) => any;
|
|
109
109
|
} & {
|
|
110
110
|
empty?: (props: {
|
|
@@ -128,10 +128,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
128
128
|
setParams: (_params: Partial<P>) => void;
|
|
129
129
|
runParams: (_params: Partial<P>) => void;
|
|
130
130
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
131
|
-
onBefore:
|
|
132
|
-
onSuccess:
|
|
133
|
-
onError:
|
|
134
|
-
onFinally:
|
|
131
|
+
onBefore: _vueuse_core11.EventHookOn<[P[]]>;
|
|
132
|
+
onSuccess: _vueuse_core11.EventHookOn<[D, P[]]>;
|
|
133
|
+
onError: _vueuse_core11.EventHookOn<[Error, P[]]>;
|
|
134
|
+
onFinally: _vueuse_core11.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
135
135
|
}) => any;
|
|
136
136
|
} & {
|
|
137
137
|
arrow?: (props: {
|
|
@@ -155,14 +155,14 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
155
155
|
setParams: (_params: Partial<P>) => void;
|
|
156
156
|
runParams: (_params: Partial<P>) => void;
|
|
157
157
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
158
|
-
onBefore:
|
|
159
|
-
onSuccess:
|
|
160
|
-
onError:
|
|
161
|
-
onFinally:
|
|
158
|
+
onBefore: _vueuse_core11.EventHookOn<[P[]]>;
|
|
159
|
+
onSuccess: _vueuse_core11.EventHookOn<[D, P[]]>;
|
|
160
|
+
onError: _vueuse_core11.EventHookOn<[Error, P[]]>;
|
|
161
|
+
onFinally: _vueuse_core11.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
162
162
|
}) => any;
|
|
163
163
|
};
|
|
164
164
|
emit: PresetSelectEmits<V, P, D, R>;
|
|
165
|
-
}>) =>
|
|
165
|
+
}>) => vue42.VNode & {
|
|
166
166
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
167
167
|
};
|
|
168
168
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataObject, DataRequestFields, UseDataRequestReturns } from "../../composables/
|
|
1
|
+
import { DataObject, DataRequestFields, UseDataRequestReturns } from "../../composables/use-data-request.js";
|
|
2
2
|
import { RemoteRequestEmits, RemoteRequestProps } from "../remote-request/index.js";
|
|
3
3
|
import { ClassStyle } from "../data-table-plus/index.js";
|
|
4
4
|
import { _default } from "./PresetSelect.vue.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useDataRequest } from "../../composables/
|
|
1
|
+
import { useDataRequest } from "../../composables/use-data-request.js";
|
|
2
2
|
import { computed, defineComponent, guardReactiveProps, normalizeProps, renderSlot, toValue } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/remote-request/RemoteRequest.vue
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { DataObject, UseDataRequestPagination } from "../../composables/
|
|
1
|
+
import { DataObject, UseDataRequestPagination } from "../../composables/use-data-request.js";
|
|
2
2
|
import { RemoteRequestEmits, RemoteRequestExpose, RemoteRequestProps } from "./index.js";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as _vueuse_core4 from "@vueuse/core";
|
|
4
|
+
import * as vue18 from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/components/remote-request/RemoteRequest.vue.d.ts
|
|
7
7
|
declare const __VLS_export: <P extends DataObject, D extends DataObject, R extends DataObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
8
|
-
props:
|
|
8
|
+
props: vue18.PublicProps & __VLS_PrettifyLocal<RemoteRequestProps<P, D> & {
|
|
9
9
|
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
10
10
|
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
11
|
-
onBefore?: ((params: P[]) => any) | undefined;
|
|
12
11
|
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
12
|
+
onBefore?: ((params: P[]) => any) | undefined;
|
|
13
13
|
}> & (typeof globalThis extends {
|
|
14
14
|
__VLS_PROPS_FALLBACK: infer P_1;
|
|
15
15
|
} ? P_1 : {});
|
|
16
|
-
expose: (exposed:
|
|
16
|
+
expose: (exposed: vue18.ShallowUnwrapRef<RemoteRequestExpose<P, D, R>>) => void;
|
|
17
17
|
attrs: any;
|
|
18
18
|
slots: {
|
|
19
19
|
default?: (props: {
|
|
@@ -36,14 +36,14 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
36
36
|
setParams: (_params: Partial<P>) => void;
|
|
37
37
|
runParams: (_params: Partial<P>) => void;
|
|
38
38
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
39
|
-
onBefore:
|
|
40
|
-
onSuccess:
|
|
41
|
-
onError:
|
|
42
|
-
onFinally:
|
|
39
|
+
onBefore: _vueuse_core4.EventHookOn<[P[]]>;
|
|
40
|
+
onSuccess: _vueuse_core4.EventHookOn<[D, P[]]>;
|
|
41
|
+
onError: _vueuse_core4.EventHookOn<[Error, P[]]>;
|
|
42
|
+
onFinally: _vueuse_core4.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
43
43
|
}) => any;
|
|
44
44
|
};
|
|
45
45
|
emit: RemoteRequestEmits<P, D>;
|
|
46
|
-
}>) =>
|
|
46
|
+
}>) => vue18.VNode & {
|
|
47
47
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
48
48
|
};
|
|
49
49
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataObject, DataRequestFields, UseDataRequestReturns } from "../../composables/
|
|
1
|
+
import { DataObject, DataRequestFields, UseDataRequestReturns } from "../../composables/use-data-request.js";
|
|
2
2
|
import { _default } from "./RemoteRequest.vue.js";
|
|
3
3
|
import { ComponentExposed } from "vue-component-type-helpers";
|
|
4
4
|
import { UseRequestOptions, UseRequestPlugin } from "vue-hooks-plus/es/useRequest/types";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SearchInputProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue50 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/search-input/SearchInput.vue.d.ts
|
|
5
5
|
declare var __VLS_19: {}, __VLS_21: {}, __VLS_28: {
|
|
@@ -15,11 +15,11 @@ type __VLS_Slots = {} & {
|
|
|
15
15
|
} & {
|
|
16
16
|
'button-icon'?: (props: typeof __VLS_39) => any;
|
|
17
17
|
};
|
|
18
|
-
declare const __VLS_base:
|
|
18
|
+
declare const __VLS_base: vue50.DefineComponent<SearchInputProps, {}, {}, {}, {}, vue50.ComponentOptionsMixin, vue50.ComponentOptionsMixin, {} & {
|
|
19
19
|
"update:value": (v: string | null | undefined) => any;
|
|
20
|
-
}, string,
|
|
20
|
+
}, string, vue50.PublicProps, Readonly<SearchInputProps> & Readonly<{
|
|
21
21
|
"onUpdate:value"?: ((v: string | null | undefined) => any) | undefined;
|
|
22
|
-
}>, {}, {}, {}, {}, string,
|
|
22
|
+
}>, {}, {}, {}, {}, string, vue50.ComponentProvideOptions, false, {}, any>;
|
|
23
23
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
25
25
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClassStyle } from "../data-table-plus/index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue13 from "vue";
|
|
3
3
|
import { InputProps } from "naive-ui";
|
|
4
4
|
|
|
5
5
|
//#region src/components/toggle-input/ToggleInput.vue.d.ts
|
|
@@ -27,14 +27,14 @@ type __VLS_Slots = {} & {
|
|
|
27
27
|
} & {
|
|
28
28
|
default?: (props: typeof __VLS_13) => any;
|
|
29
29
|
};
|
|
30
|
-
declare const __VLS_base:
|
|
30
|
+
declare const __VLS_base: vue13.DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, vue13.ComponentOptionsMixin, vue13.ComponentOptionsMixin, {
|
|
31
31
|
"update:value": (value: string | number | undefined) => any;
|
|
32
32
|
} & {
|
|
33
33
|
trigger: () => any;
|
|
34
|
-
}, string,
|
|
34
|
+
}, string, vue13.PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
35
35
|
"onUpdate:value"?: ((value: string | number | undefined) => any) | undefined;
|
|
36
36
|
onTrigger?: (() => any) | undefined;
|
|
37
|
-
}>, {}, {}, {}, {}, string,
|
|
37
|
+
}>, {}, {}, {}, {}, string, vue13.ComponentProvideOptions, false, {}, any>;
|
|
38
38
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
39
39
|
declare const _default: typeof __VLS_export;
|
|
40
40
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TooltipButtonProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue8 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/tooltip-button/TooltipButton.vue.d.ts
|
|
5
5
|
declare var __VLS_17: {}, __VLS_20: {}, __VLS_22: {};
|
|
@@ -10,11 +10,11 @@ type __VLS_Slots = {} & {
|
|
|
10
10
|
} & {
|
|
11
11
|
tooltip?: (props: typeof __VLS_22) => any;
|
|
12
12
|
};
|
|
13
|
-
declare const __VLS_base:
|
|
13
|
+
declare const __VLS_base: vue8.DefineComponent<TooltipButtonProps, {}, {}, {}, {}, vue8.ComponentOptionsMixin, vue8.ComponentOptionsMixin, {} & {
|
|
14
14
|
click: (ev: MouseEvent) => any;
|
|
15
|
-
}, string,
|
|
15
|
+
}, string, vue8.PublicProps, Readonly<TooltipButtonProps> & Readonly<{
|
|
16
16
|
onClick?: ((ev: MouseEvent) => any) | undefined;
|
|
17
|
-
}>, {}, {}, {}, {}, string,
|
|
17
|
+
}>, {}, {}, {}, {}, string, vue8.ComponentProvideOptions, false, {}, any>;
|
|
18
18
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
19
|
declare const _default: typeof __VLS_export;
|
|
20
20
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { TransitionProps as TransitionProps$1 } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue45 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/transition/BaseTransition.vue.d.ts
|
|
5
5
|
declare var __VLS_7: {};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
7
|
default?: (props: typeof __VLS_7) => any;
|
|
8
8
|
};
|
|
9
|
-
declare const __VLS_base:
|
|
9
|
+
declare const __VLS_base: vue45.DefineComponent<TransitionProps$1, {}, {}, {}, {}, vue45.ComponentOptionsMixin, vue45.ComponentOptionsMixin, {}, string, vue45.PublicProps, Readonly<TransitionProps$1> & Readonly<{}>, {}, {}, {}, {}, string, vue45.ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
11
|
declare const _default: typeof __VLS_export;
|
|
12
12
|
type __VLS_WithSlots<T, S> = T & {
|
package/dist/components.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { _default as _default$2 } from "./components/data-table-plus/DataTablePl
|
|
|
6
6
|
import { ClassStyle, DataTablePlusEmits, DataTablePlusExpose, DataTablePlusFields, DataTablePlusInst, DataTablePlusProps } from "./components/data-table-plus/index.js";
|
|
7
7
|
import { _default as _default$3 } from "./components/loading-provider/LoadingProvider.vue.js";
|
|
8
8
|
import { LoadingProviderInst, LoadingProviderProps, loadingProviderInjectionKey } from "./components/loading-provider/index.js";
|
|
9
|
-
import { NaiveFormRules } from "./composables/
|
|
9
|
+
import { NaiveFormRules } from "./composables/use-naive-form.js";
|
|
10
10
|
import { _default } from "./components/config-providers/ConfigProviders.vue.js";
|
|
11
11
|
import { ConfigProvidersProps } from "./components/config-providers/index.js";
|
|
12
12
|
import { _default as _default$1 } from "./components/copy-button/CopyButton.vue.js";
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { colord } from "colord";
|
|
2
2
|
|
|
3
3
|
//#region src/composables/_helper.ts
|
|
4
|
+
function getDarkColor(color) {
|
|
5
|
+
if (!color) return void 0;
|
|
6
|
+
const baseColor = colord(color);
|
|
7
|
+
if (!baseColor.isValid()) return void 0;
|
|
8
|
+
return baseColor.lighten(.2).toHex();
|
|
9
|
+
}
|
|
4
10
|
function getStatusColor(color) {
|
|
5
11
|
if (!color) return void 0;
|
|
6
12
|
const baseColor = colord(color);
|
|
@@ -24,4 +30,4 @@ function getColors(colors) {
|
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
//#endregion
|
|
27
|
-
export { getColors };
|
|
33
|
+
export { getColors, getDarkColor };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataObject, DataRequestFields, UseDataRequestOptions, UseDataRequestPagination, UseDataRequestReturns, useDataRequest } from "./
|
|
2
|
-
import { useLoading } from "./
|
|
3
|
-
import { NaiveFormClearRules, NaiveFormOptions, NaiveFormReturns, NaiveFormRules, useNaiveForm } from "./
|
|
4
|
-
import { NaiveThemeReturns, useNaiveTheme } from "./
|
|
1
|
+
import { DataObject, DataRequestFields, UseDataRequestOptions, UseDataRequestPagination, UseDataRequestReturns, useDataRequest } from "./use-data-request.js";
|
|
2
|
+
import { useLoading } from "./use-loading.js";
|
|
3
|
+
import { NaiveFormClearRules, NaiveFormOptions, NaiveFormReturns, NaiveFormRules, useNaiveForm } from "./use-naive-form.js";
|
|
4
|
+
import { NaiveThemeOptions, NaiveThemeReturns, useNaiveTheme } from "./use-naive-theme.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useDataRequest } from "./
|
|
2
|
-
import { useLoading } from "./
|
|
3
|
-
import { useNaiveForm } from "./
|
|
4
|
-
import { useNaiveTheme } from "./
|
|
1
|
+
import { useDataRequest } from "./use-data-request.js";
|
|
2
|
+
import { useLoading } from "./use-loading.js";
|
|
3
|
+
import { useNaiveForm } from "./use-naive-form.js";
|
|
4
|
+
import { useNaiveTheme } from "./use-naive-theme.js";
|
|
@@ -2,7 +2,7 @@ import * as _vueuse_core0 from "@vueuse/core";
|
|
|
2
2
|
import * as vue0 from "vue";
|
|
3
3
|
import { UseRequestOptions, UseRequestPlugin } from "vue-hooks-plus/es/useRequest/types";
|
|
4
4
|
|
|
5
|
-
//#region src/composables/
|
|
5
|
+
//#region src/composables/use-data-request.d.ts
|
|
6
6
|
type DataObject = Record<string, any>;
|
|
7
7
|
type DataRequestFields = Record<string, string | undefined> & {
|
|
8
8
|
page?: string;
|
|
@@ -2,7 +2,7 @@ import { createEventHook } from "@vueuse/core";
|
|
|
2
2
|
import { computed, ref } from "vue";
|
|
3
3
|
import useRequest from "vue-hooks-plus/es/useRequest";
|
|
4
4
|
|
|
5
|
-
//#region src/composables/
|
|
5
|
+
//#region src/composables/use-data-request.ts
|
|
6
6
|
function useDataRequest(api, options) {
|
|
7
7
|
const { defaultParams, manual, fields, requestOptions, requestPlugins } = options ?? {};
|
|
8
8
|
const _fields = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LoadingProviderInst } from "../components/loading-provider/index.js";
|
|
2
2
|
|
|
3
|
-
//#region src/composables/
|
|
3
|
+
//#region src/composables/use-loading.d.ts
|
|
4
4
|
declare function useLoading(): LoadingProviderInst | undefined;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { useLoading };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { loadingProviderInjectionKey } from "../components/loading-provider/index.js";
|
|
2
2
|
import { inject } from "vue";
|
|
3
3
|
|
|
4
|
-
//#region src/composables/
|
|
4
|
+
//#region src/composables/use-loading.ts
|
|
5
5
|
function useLoading() {
|
|
6
6
|
return inject(loadingProviderInjectionKey);
|
|
7
7
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DataObject } from "./
|
|
1
|
+
import { DataObject } from "./use-data-request.js";
|
|
2
2
|
import * as _vueuse_core3 from "@vueuse/core";
|
|
3
3
|
import * as vue5 from "vue";
|
|
4
4
|
import { Ref, TemplateRef } from "vue";
|
|
5
5
|
import { FormInst, FormItemRule, FormRules } from "naive-ui";
|
|
6
6
|
import { ValidateError } from "async-validator";
|
|
7
7
|
|
|
8
|
-
//#region src/composables/
|
|
8
|
+
//#region src/composables/use-naive-form.d.ts
|
|
9
9
|
type NaiveFormClearRules = {
|
|
10
10
|
string?: string | null;
|
|
11
11
|
number?: number | null;
|
|
@@ -2,7 +2,7 @@ import { createEventHook } from "@vueuse/core";
|
|
|
2
2
|
import { reactive, ref, toRaw, toValue } from "vue";
|
|
3
3
|
import { cloneDeep } from "es-toolkit/object";
|
|
4
4
|
|
|
5
|
-
//#region src/composables/
|
|
5
|
+
//#region src/composables/use-naive-form.ts
|
|
6
6
|
function isObject(value) {
|
|
7
7
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
8
8
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Colors } from "./_helper.js";
|
|
2
|
+
import { ComputedRef, Ref } from "vue";
|
|
3
|
+
import { GlobalThemeOverrides, NDateLocale, zhCN } from "naive-ui";
|
|
4
|
+
import * as naive_ui_es_themes_interface0 from "naive-ui/es/themes/interface";
|
|
5
|
+
|
|
6
|
+
//#region src/composables/use-naive-theme.d.ts
|
|
7
|
+
type Locales<T extends string = string> = Record<T, {
|
|
8
|
+
name: string;
|
|
9
|
+
dateLocale: NDateLocale;
|
|
10
|
+
locale: typeof zhCN;
|
|
11
|
+
}>;
|
|
12
|
+
type NaiveThemeOptions<T extends string> = {
|
|
13
|
+
language?: T | Ref<T>;
|
|
14
|
+
darkMode?: boolean | Ref<boolean>;
|
|
15
|
+
colors?: Colors;
|
|
16
|
+
globalThemeOverrides?: GlobalThemeOverrides;
|
|
17
|
+
locales?: Partial<Locales<T>>;
|
|
18
|
+
};
|
|
19
|
+
declare function useNaiveTheme<T extends string>(options?: NaiveThemeOptions<T>): {
|
|
20
|
+
language: Ref<T, T>;
|
|
21
|
+
darkMode: Ref<boolean | undefined, boolean | undefined>;
|
|
22
|
+
theme: ComputedRef<naive_ui_es_themes_interface0.BuiltInGlobalTheme | undefined>;
|
|
23
|
+
colors: Ref<{
|
|
24
|
+
primary?: string | undefined;
|
|
25
|
+
info?: string | undefined;
|
|
26
|
+
success?: string | undefined;
|
|
27
|
+
warning?: string | undefined;
|
|
28
|
+
error?: string | undefined;
|
|
29
|
+
}, Colors | {
|
|
30
|
+
primary?: string | undefined;
|
|
31
|
+
info?: string | undefined;
|
|
32
|
+
success?: string | undefined;
|
|
33
|
+
warning?: string | undefined;
|
|
34
|
+
error?: string | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
themeColors: ComputedRef<{
|
|
37
|
+
primary?: string | undefined;
|
|
38
|
+
info?: string | undefined;
|
|
39
|
+
success?: string | undefined;
|
|
40
|
+
warning?: string | undefined;
|
|
41
|
+
error?: string | undefined;
|
|
42
|
+
} | {
|
|
43
|
+
[k: string]: string | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
themeOverrides: ComputedRef<GlobalThemeOverrides>;
|
|
46
|
+
locales: Locales<T>;
|
|
47
|
+
locale: ComputedRef<Locales<T>[T]>;
|
|
48
|
+
setColor: (v: Partial<Colors>) => void;
|
|
49
|
+
};
|
|
50
|
+
type NaiveThemeReturns = ReturnType<typeof useNaiveTheme>;
|
|
51
|
+
//#endregion
|
|
52
|
+
export { NaiveThemeOptions, NaiveThemeReturns, useNaiveTheme };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { getColors, getDarkColor } from "./_helper.js";
|
|
2
|
+
import { computed, ref, toValue, watchEffect } from "vue";
|
|
3
|
+
import { darkTheme, dateEnUS, dateZhCN, enUS, zhCN } from "naive-ui";
|
|
4
|
+
|
|
5
|
+
//#region src/composables/use-naive-theme.ts
|
|
6
|
+
const naiveLocaleMap = {
|
|
7
|
+
"zh-CN": {
|
|
8
|
+
name: "简体中文",
|
|
9
|
+
dateLocale: dateZhCN,
|
|
10
|
+
locale: zhCN
|
|
11
|
+
},
|
|
12
|
+
"en-US": {
|
|
13
|
+
name: "English",
|
|
14
|
+
dateLocale: dateEnUS,
|
|
15
|
+
locale: enUS
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function useNaiveTheme(options) {
|
|
19
|
+
const { language = "zh-CN", darkMode, colors, globalThemeOverrides, locales } = options ?? {};
|
|
20
|
+
const languageRef = ref(toValue(language));
|
|
21
|
+
watchEffect(() => {
|
|
22
|
+
languageRef.value = toValue(language);
|
|
23
|
+
});
|
|
24
|
+
const darkModeRef = ref(toValue(darkMode));
|
|
25
|
+
watchEffect(() => {
|
|
26
|
+
darkModeRef.value = toValue(darkMode);
|
|
27
|
+
});
|
|
28
|
+
const { common, ...extra } = globalThemeOverrides ?? {};
|
|
29
|
+
const colorsRef = ref({ ...colors });
|
|
30
|
+
const themeColorsRef = computed(() => {
|
|
31
|
+
return darkModeRef.value ? Object.fromEntries(Object.entries(colorsRef.value).map(([k, v]) => [k, getDarkColor(v)])) : colorsRef.value;
|
|
32
|
+
});
|
|
33
|
+
function setColor(v) {
|
|
34
|
+
colorsRef.value = {
|
|
35
|
+
...colorsRef.value,
|
|
36
|
+
...v
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const theme = computed(() => {
|
|
40
|
+
return darkModeRef?.value ? darkTheme : void 0;
|
|
41
|
+
});
|
|
42
|
+
const themeOverrides = computed(() => {
|
|
43
|
+
const { primary, info, success, warning, error } = getColors(themeColorsRef.value);
|
|
44
|
+
return {
|
|
45
|
+
common: {
|
|
46
|
+
primaryColor: primary?.color,
|
|
47
|
+
primaryColorHover: primary?.hover,
|
|
48
|
+
primaryColorPressed: primary?.pressed,
|
|
49
|
+
primaryColorSuppl: primary?.suppl,
|
|
50
|
+
infoColor: info?.color,
|
|
51
|
+
infoColorHover: info?.hover,
|
|
52
|
+
infoColorPressed: info?.pressed,
|
|
53
|
+
infoColorSuppl: info?.suppl,
|
|
54
|
+
successColor: success?.color,
|
|
55
|
+
successColorHover: success?.hover,
|
|
56
|
+
successColorPressed: success?.pressed,
|
|
57
|
+
successColorSuppl: success?.suppl,
|
|
58
|
+
warningColor: warning?.color,
|
|
59
|
+
warningColorHover: warning?.hover,
|
|
60
|
+
warningColorPressed: warning?.pressed,
|
|
61
|
+
warningColorSuppl: warning?.suppl,
|
|
62
|
+
errorColor: error?.color,
|
|
63
|
+
errorColorHover: error?.hover,
|
|
64
|
+
errorColorPressed: error?.pressed,
|
|
65
|
+
errorColorSuppl: error?.suppl,
|
|
66
|
+
...common
|
|
67
|
+
},
|
|
68
|
+
...extra
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
const _locales = {
|
|
72
|
+
...naiveLocaleMap,
|
|
73
|
+
...locales
|
|
74
|
+
};
|
|
75
|
+
return {
|
|
76
|
+
language: languageRef,
|
|
77
|
+
darkMode: darkModeRef,
|
|
78
|
+
theme,
|
|
79
|
+
colors: colorsRef,
|
|
80
|
+
themeColors: themeColorsRef,
|
|
81
|
+
themeOverrides,
|
|
82
|
+
locales: _locales,
|
|
83
|
+
locale: computed(() => _locales[languageRef.value] ?? naiveLocaleMap["zh-CN"]),
|
|
84
|
+
setColor
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
//#endregion
|
|
89
|
+
export { useNaiveTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DataObject, DataRequestFields, UseDataRequestOptions, UseDataRequestPagination, UseDataRequestReturns, useDataRequest } from "./composables/
|
|
2
|
-
import { useLoading } from "./composables/
|
|
3
|
-
import { NaiveFormClearRules, NaiveFormOptions, NaiveFormReturns, NaiveFormRules, useNaiveForm } from "./composables/
|
|
4
|
-
import { NaiveThemeReturns, useNaiveTheme } from "./composables/
|
|
1
|
+
import { DataObject, DataRequestFields, UseDataRequestOptions, UseDataRequestPagination, UseDataRequestReturns, useDataRequest } from "./composables/use-data-request.js";
|
|
2
|
+
import { useLoading } from "./composables/use-loading.js";
|
|
3
|
+
import { NaiveFormClearRules, NaiveFormOptions, NaiveFormReturns, NaiveFormRules, useNaiveForm } from "./composables/use-naive-form.js";
|
|
4
|
+
import { NaiveThemeOptions, NaiveThemeReturns, useNaiveTheme } from "./composables/use-naive-theme.js";
|
|
5
5
|
import "./composables/index.js";
|
|
6
|
-
export { DataObject, DataRequestFields, NaiveFormClearRules, NaiveFormOptions, NaiveFormReturns, NaiveFormRules, NaiveThemeReturns, UseDataRequestOptions, UseDataRequestPagination, UseDataRequestReturns, useDataRequest, useLoading, useNaiveForm, useNaiveTheme };
|
|
6
|
+
export { DataObject, DataRequestFields, NaiveFormClearRules, NaiveFormOptions, NaiveFormReturns, NaiveFormRules, NaiveThemeOptions, NaiveThemeReturns, UseDataRequestOptions, UseDataRequestPagination, UseDataRequestReturns, useDataRequest, useLoading, useNaiveForm, useNaiveTheme };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useDataRequest } from "./composables/
|
|
2
|
-
import { useLoading } from "./composables/
|
|
3
|
-
import { useNaiveForm } from "./composables/
|
|
4
|
-
import { useNaiveTheme } from "./composables/
|
|
1
|
+
import { useDataRequest } from "./composables/use-data-request.js";
|
|
2
|
+
import { useLoading } from "./composables/use-loading.js";
|
|
3
|
+
import { useNaiveForm } from "./composables/use-naive-form.js";
|
|
4
|
+
import { useNaiveTheme } from "./composables/use-naive-theme.js";
|
|
5
5
|
import "./composables/index.js";
|
|
6
6
|
|
|
7
7
|
export { useDataRequest, useLoading, useNaiveForm, useNaiveTheme };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oiij/naive-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.70",
|
|
5
5
|
"description": "Some Composable Functions And Components for Vue 3",
|
|
6
6
|
"author": "oiij",
|
|
7
7
|
"license": "MIT",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"vue": "^3.5.26",
|
|
46
46
|
"vue-component-type-helpers": "^3.2.1",
|
|
47
47
|
"vue-hooks-plus": "^2.4.1",
|
|
48
|
-
"@oiij/use": "0.0.32",
|
|
49
48
|
"@oiij/css-render": "0.0.9",
|
|
49
|
+
"@oiij/use": "0.0.37",
|
|
50
50
|
"@oiij/markdown-it": "0.0.10"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"vue": "^3.5.26",
|
|
61
61
|
"vue-component-type-helpers": "^3.2.1",
|
|
62
62
|
"vue-hooks-plus": "^2.4.1",
|
|
63
|
-
"@oiij/
|
|
64
|
-
"@oiij/use": "0.0.
|
|
65
|
-
"@oiij/
|
|
63
|
+
"@oiij/css-render": "0.0.9",
|
|
64
|
+
"@oiij/use": "0.0.37",
|
|
65
|
+
"@oiij/markdown-it": "0.0.10"
|
|
66
66
|
},
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { Colors } from "./_helper.js";
|
|
2
|
-
import { ComputedRef, Ref } from "vue";
|
|
3
|
-
import { GlobalThemeOverrides, NDateLocale } from "naive-ui";
|
|
4
|
-
import * as naive_ui_es_themes_interface0 from "naive-ui/es/themes/interface";
|
|
5
|
-
|
|
6
|
-
//#region src/composables/useNaiveTheme.d.ts
|
|
7
|
-
type NaiveThemeOptions = {
|
|
8
|
-
language?: string | Ref<string>;
|
|
9
|
-
darkMode?: boolean | Ref<boolean>;
|
|
10
|
-
colors?: Colors;
|
|
11
|
-
globalThemeOverrides?: GlobalThemeOverrides;
|
|
12
|
-
};
|
|
13
|
-
declare function useNaiveTheme(options?: NaiveThemeOptions): {
|
|
14
|
-
language: Ref<string | undefined, string | undefined>;
|
|
15
|
-
darkMode: Ref<boolean | undefined, boolean | undefined>;
|
|
16
|
-
theme: ComputedRef<naive_ui_es_themes_interface0.BuiltInGlobalTheme | undefined>;
|
|
17
|
-
themeOverrides: ComputedRef<GlobalThemeOverrides>;
|
|
18
|
-
locale: ComputedRef<{
|
|
19
|
-
name: string;
|
|
20
|
-
global: {
|
|
21
|
-
undo: string;
|
|
22
|
-
redo: string;
|
|
23
|
-
confirm: string;
|
|
24
|
-
clear: string;
|
|
25
|
-
};
|
|
26
|
-
Popconfirm: {
|
|
27
|
-
positiveText: string;
|
|
28
|
-
negativeText: string;
|
|
29
|
-
};
|
|
30
|
-
Cascader: {
|
|
31
|
-
placeholder: string;
|
|
32
|
-
loading: string;
|
|
33
|
-
loadingRequiredMessage: (label: string) => string;
|
|
34
|
-
};
|
|
35
|
-
Time: {
|
|
36
|
-
dateFormat: string;
|
|
37
|
-
dateTimeFormat: string;
|
|
38
|
-
};
|
|
39
|
-
DatePicker: {
|
|
40
|
-
yearFormat: string;
|
|
41
|
-
monthFormat: string;
|
|
42
|
-
dayFormat: string;
|
|
43
|
-
yearTypeFormat: string;
|
|
44
|
-
monthTypeFormat: string;
|
|
45
|
-
dateFormat: string;
|
|
46
|
-
dateTimeFormat: string;
|
|
47
|
-
quarterFormat: string;
|
|
48
|
-
weekFormat: string;
|
|
49
|
-
clear: string;
|
|
50
|
-
now: string;
|
|
51
|
-
confirm: string;
|
|
52
|
-
selectTime: string;
|
|
53
|
-
selectDate: string;
|
|
54
|
-
datePlaceholder: string;
|
|
55
|
-
datetimePlaceholder: string;
|
|
56
|
-
monthPlaceholder: string;
|
|
57
|
-
yearPlaceholder: string;
|
|
58
|
-
quarterPlaceholder: string;
|
|
59
|
-
weekPlaceholder: string;
|
|
60
|
-
startDatePlaceholder: string;
|
|
61
|
-
endDatePlaceholder: string;
|
|
62
|
-
startDatetimePlaceholder: string;
|
|
63
|
-
endDatetimePlaceholder: string;
|
|
64
|
-
startMonthPlaceholder: string;
|
|
65
|
-
endMonthPlaceholder: string;
|
|
66
|
-
monthBeforeYear: boolean;
|
|
67
|
-
firstDayOfWeek: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
68
|
-
today: string;
|
|
69
|
-
};
|
|
70
|
-
DataTable: {
|
|
71
|
-
checkTableAll: string;
|
|
72
|
-
uncheckTableAll: string;
|
|
73
|
-
confirm: string;
|
|
74
|
-
clear: string;
|
|
75
|
-
};
|
|
76
|
-
LegacyTransfer: {
|
|
77
|
-
sourceTitle: string;
|
|
78
|
-
targetTitle: string;
|
|
79
|
-
};
|
|
80
|
-
Transfer: {
|
|
81
|
-
selectAll: string;
|
|
82
|
-
unselectAll: string;
|
|
83
|
-
clearAll: string;
|
|
84
|
-
total: (num: number) => string;
|
|
85
|
-
selected: (num: number) => string;
|
|
86
|
-
};
|
|
87
|
-
Empty: {
|
|
88
|
-
description: string;
|
|
89
|
-
};
|
|
90
|
-
Select: {
|
|
91
|
-
placeholder: string;
|
|
92
|
-
};
|
|
93
|
-
TimePicker: {
|
|
94
|
-
placeholder: string;
|
|
95
|
-
positiveText: string;
|
|
96
|
-
negativeText: string;
|
|
97
|
-
now: string;
|
|
98
|
-
clear: string;
|
|
99
|
-
};
|
|
100
|
-
Pagination: {
|
|
101
|
-
goto: string;
|
|
102
|
-
selectionSuffix: string;
|
|
103
|
-
};
|
|
104
|
-
DynamicTags: {
|
|
105
|
-
add: string;
|
|
106
|
-
};
|
|
107
|
-
Log: {
|
|
108
|
-
loading: string;
|
|
109
|
-
};
|
|
110
|
-
Input: {
|
|
111
|
-
placeholder: string;
|
|
112
|
-
};
|
|
113
|
-
InputNumber: {
|
|
114
|
-
placeholder: string;
|
|
115
|
-
};
|
|
116
|
-
DynamicInput: {
|
|
117
|
-
create: string;
|
|
118
|
-
};
|
|
119
|
-
ThemeEditor: {
|
|
120
|
-
title: string;
|
|
121
|
-
clearAllVars: string;
|
|
122
|
-
clearSearch: string;
|
|
123
|
-
filterCompName: string;
|
|
124
|
-
filterVarName: string;
|
|
125
|
-
import: string;
|
|
126
|
-
export: string;
|
|
127
|
-
restore: string;
|
|
128
|
-
};
|
|
129
|
-
Image: {
|
|
130
|
-
tipPrevious: string;
|
|
131
|
-
tipNext: string;
|
|
132
|
-
tipCounterclockwise: string;
|
|
133
|
-
tipClockwise: string;
|
|
134
|
-
tipZoomOut: string;
|
|
135
|
-
tipZoomIn: string;
|
|
136
|
-
tipDownload: string;
|
|
137
|
-
tipClose: string;
|
|
138
|
-
tipOriginalSize: string;
|
|
139
|
-
};
|
|
140
|
-
Heatmap: {
|
|
141
|
-
less: string;
|
|
142
|
-
more: string;
|
|
143
|
-
monthFormat: string;
|
|
144
|
-
weekdayFormat: string;
|
|
145
|
-
};
|
|
146
|
-
}>;
|
|
147
|
-
dateLocale: ComputedRef<NDateLocale>;
|
|
148
|
-
color: Ref<{
|
|
149
|
-
primary?: string | undefined;
|
|
150
|
-
info?: string | undefined;
|
|
151
|
-
success?: string | undefined;
|
|
152
|
-
warning?: string | undefined;
|
|
153
|
-
error?: string | undefined;
|
|
154
|
-
}, Colors | {
|
|
155
|
-
primary?: string | undefined;
|
|
156
|
-
info?: string | undefined;
|
|
157
|
-
success?: string | undefined;
|
|
158
|
-
warning?: string | undefined;
|
|
159
|
-
error?: string | undefined;
|
|
160
|
-
}>;
|
|
161
|
-
setColor: (v: Partial<Colors>) => void;
|
|
162
|
-
};
|
|
163
|
-
type NaiveThemeReturns = ReturnType<typeof useNaiveTheme>;
|
|
164
|
-
//#endregion
|
|
165
|
-
export { NaiveThemeReturns, useNaiveTheme };
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { getColors } from "./_helper.js";
|
|
2
|
-
import { computed, ref, toValue, watchEffect } from "vue";
|
|
3
|
-
import { darkTheme, dateEnUS, dateZhCN, enUS, zhCN } from "naive-ui";
|
|
4
|
-
|
|
5
|
-
//#region src/composables/useNaiveTheme.ts
|
|
6
|
-
const naiveLocaleMap = {
|
|
7
|
-
"zh-CN": {
|
|
8
|
-
name: "简体中文",
|
|
9
|
-
dateLocale: dateZhCN,
|
|
10
|
-
locale: zhCN
|
|
11
|
-
},
|
|
12
|
-
"en-US": {
|
|
13
|
-
name: "English",
|
|
14
|
-
dateLocale: dateEnUS,
|
|
15
|
-
locale: enUS
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
function useNaiveTheme(options) {
|
|
19
|
-
const { language, darkMode, colors, globalThemeOverrides } = options ?? {};
|
|
20
|
-
const languageRef = ref(toValue(language));
|
|
21
|
-
watchEffect(() => {
|
|
22
|
-
languageRef.value = toValue(language);
|
|
23
|
-
});
|
|
24
|
-
const darkModeRef = ref(toValue(darkMode));
|
|
25
|
-
watchEffect(() => {
|
|
26
|
-
darkModeRef.value = toValue(darkMode);
|
|
27
|
-
});
|
|
28
|
-
const { common, ...extra } = globalThemeOverrides ?? {};
|
|
29
|
-
const colorRef = ref({ ...colors });
|
|
30
|
-
function setColor(v) {
|
|
31
|
-
colorRef.value = {
|
|
32
|
-
...colorRef.value,
|
|
33
|
-
...v
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
language: languageRef,
|
|
38
|
-
darkMode: darkModeRef,
|
|
39
|
-
theme: computed(() => {
|
|
40
|
-
return darkModeRef?.value ? darkTheme : void 0;
|
|
41
|
-
}),
|
|
42
|
-
themeOverrides: computed(() => {
|
|
43
|
-
const { primary, info, success, warning, error } = getColors(colorRef.value);
|
|
44
|
-
return {
|
|
45
|
-
common: {
|
|
46
|
-
bodyColor: darkModeRef?.value ? "#1f1f1f" : "#f5f5f5",
|
|
47
|
-
primaryColor: primary?.color,
|
|
48
|
-
primaryColorHover: primary?.hover,
|
|
49
|
-
primaryColorPressed: primary?.pressed,
|
|
50
|
-
primaryColorSuppl: primary?.suppl,
|
|
51
|
-
infoColor: info?.color,
|
|
52
|
-
infoColorHover: info?.hover,
|
|
53
|
-
infoColorPressed: info?.pressed,
|
|
54
|
-
infoColorSuppl: info?.suppl,
|
|
55
|
-
successColor: success?.color,
|
|
56
|
-
successColorHover: success?.hover,
|
|
57
|
-
successColorPressed: success?.pressed,
|
|
58
|
-
successColorSuppl: success?.suppl,
|
|
59
|
-
warningColor: warning?.color,
|
|
60
|
-
warningColorHover: warning?.hover,
|
|
61
|
-
warningColorPressed: warning?.pressed,
|
|
62
|
-
warningColorSuppl: warning?.suppl,
|
|
63
|
-
errorColor: error?.color,
|
|
64
|
-
errorColorHover: error?.hover,
|
|
65
|
-
errorColorPressed: error?.pressed,
|
|
66
|
-
errorColorSuppl: error?.suppl,
|
|
67
|
-
...common
|
|
68
|
-
},
|
|
69
|
-
...extra
|
|
70
|
-
};
|
|
71
|
-
}),
|
|
72
|
-
locale: computed(() => {
|
|
73
|
-
if (!languageRef?.value || !naiveLocaleMap[languageRef.value]) return naiveLocaleMap["zh-CN"].locale;
|
|
74
|
-
return naiveLocaleMap[languageRef.value].locale;
|
|
75
|
-
}),
|
|
76
|
-
dateLocale: computed(() => {
|
|
77
|
-
if (!languageRef?.value || !naiveLocaleMap[languageRef.value]) return naiveLocaleMap["zh-CN"].dateLocale;
|
|
78
|
-
return naiveLocaleMap[languageRef.value].dateLocale;
|
|
79
|
-
}),
|
|
80
|
-
color: colorRef,
|
|
81
|
-
setColor
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
//#endregion
|
|
86
|
-
export { useNaiveTheme };
|