@oiij/naive-ui 0.0.72 → 0.0.73
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.vue.d.ts +2 -2
- package/dist/components/copy-button/CopyButton.vue.d.ts +4 -4
- package/dist/components/data-table-plus/DataTablePlus.vue.d.ts +11 -11
- package/dist/components/loading-provider/LoadingProvider.vue.d.ts +2 -2
- package/dist/components/preset-form/PresetForm.js +11 -11
- package/dist/components/preset-form/PresetForm.vue.d.ts +23 -14
- package/dist/components/preset-input/PresetInput.vue.d.ts +3 -3
- package/dist/components/preset-picker/PresetPicker.vue.d.ts +4 -4
- package/dist/components/preset-select/PresetSelect.vue.d.ts +4 -4
- package/dist/components/remote-request/RemoteRequest.vue.d.ts +9 -9
- package/dist/components/search-input/SearchInput.vue.d.ts +4 -4
- package/dist/components/transition/BaseTransition.vue.d.ts +2 -2
- package/dist/components/type-writer/TypeWriter.vue.d.ts +4 -4
- package/dist/composables/use-naive-form.d.ts +4 -4
- package/dist/composables/use-naive-form.js +17 -17
- package/package.json +4 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ConfigProvidersProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue18 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: vue18.DefineComponent<ConfigProvidersProps, {}, {}, {}, {}, vue18.ComponentOptionsMixin, vue18.ComponentOptionsMixin, {}, string, vue18.PublicProps, Readonly<ConfigProvidersProps> & Readonly<{}>, {}, {}, {}, {}, string, vue18.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,5 +1,5 @@
|
|
|
1
1
|
import { CopyButtonProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue28 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: vue28.DefineComponent<CopyButtonProps, {}, {}, {}, {}, vue28.ComponentOptionsMixin, vue28.ComponentOptionsMixin, {} & {
|
|
14
14
|
copied: (v: string | undefined) => any;
|
|
15
|
-
}, string,
|
|
15
|
+
}, string, vue28.PublicProps, Readonly<CopyButtonProps> & Readonly<{
|
|
16
16
|
onCopied?: ((v: string | undefined) => any) | undefined;
|
|
17
|
-
}>, {}, {}, {}, {}, string,
|
|
17
|
+
}>, {}, {}, {}, {}, string, vue28.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 & {
|
|
@@ -2,12 +2,12 @@ import { DataObject, UseDataRequestPagination } from "../../composables/use-data
|
|
|
2
2
|
import { DataTablePlusEmits, DataTablePlusExpose, DataTablePlusProps } from "./index.js";
|
|
3
3
|
import "../../composables/index.js";
|
|
4
4
|
import * as _vueuse_core31 from "@vueuse/core";
|
|
5
|
-
import * as
|
|
5
|
+
import * as vue69 from "vue";
|
|
6
6
|
import { DataTableBaseColumn, DataTableFilterState, DataTableInst, DataTableSortState } from "naive-ui";
|
|
7
7
|
|
|
8
8
|
//#region src/components/data-table-plus/DataTablePlus.vue.d.ts
|
|
9
9
|
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<{
|
|
10
|
-
props:
|
|
10
|
+
props: vue69.PublicProps & __VLS_PrettifyLocal<DataTablePlusProps<P, D, R> & {
|
|
11
11
|
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
12
12
|
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
13
13
|
onLoad?: ((row: R) => any) | undefined;
|
|
@@ -29,7 +29,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
29
29
|
}> & (typeof globalThis extends {
|
|
30
30
|
__VLS_PROPS_FALLBACK: infer P_1;
|
|
31
31
|
} ? P_1 : {});
|
|
32
|
-
expose: (exposed:
|
|
32
|
+
expose: (exposed: vue69.ShallowUnwrapRef<DataTablePlusExpose<P, D, R>>) => void;
|
|
33
33
|
attrs: any;
|
|
34
34
|
slots: {
|
|
35
35
|
header?: (props: {
|
|
@@ -46,7 +46,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
46
46
|
filters: DataTableFilterState | undefined;
|
|
47
47
|
sorters: Record<string, DataTableSortState> | undefined;
|
|
48
48
|
dataTableRef: DataTableInst | null;
|
|
49
|
-
pagination:
|
|
49
|
+
pagination: vue69.Ref<{
|
|
50
50
|
page: number;
|
|
51
51
|
pageSize: number;
|
|
52
52
|
itemCount: number;
|
|
@@ -86,7 +86,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
86
86
|
filters: DataTableFilterState | undefined;
|
|
87
87
|
sorters: Record<string, DataTableSortState> | undefined;
|
|
88
88
|
dataTableRef: DataTableInst | null;
|
|
89
|
-
pagination:
|
|
89
|
+
pagination: vue69.Ref<{
|
|
90
90
|
page: number;
|
|
91
91
|
pageSize: number;
|
|
92
92
|
itemCount: number;
|
|
@@ -124,7 +124,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
124
124
|
filters: DataTableFilterState | undefined;
|
|
125
125
|
sorters: Record<string, DataTableSortState> | undefined;
|
|
126
126
|
dataTableRef: DataTableInst | null;
|
|
127
|
-
pagination:
|
|
127
|
+
pagination: vue69.Ref<{
|
|
128
128
|
page: number;
|
|
129
129
|
pageSize: number;
|
|
130
130
|
itemCount: number;
|
|
@@ -162,7 +162,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
162
162
|
filters: DataTableFilterState | undefined;
|
|
163
163
|
sorters: Record<string, DataTableSortState> | undefined;
|
|
164
164
|
dataTableRef: DataTableInst | null;
|
|
165
|
-
pagination:
|
|
165
|
+
pagination: vue69.Ref<{
|
|
166
166
|
page: number;
|
|
167
167
|
pageSize: number;
|
|
168
168
|
itemCount: number;
|
|
@@ -200,7 +200,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
200
200
|
filters: DataTableFilterState | undefined;
|
|
201
201
|
sorters: Record<string, DataTableSortState> | undefined;
|
|
202
202
|
dataTableRef: DataTableInst | null;
|
|
203
|
-
pagination:
|
|
203
|
+
pagination: vue69.Ref<{
|
|
204
204
|
page: number;
|
|
205
205
|
pageSize: number;
|
|
206
206
|
itemCount: number;
|
|
@@ -238,7 +238,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
238
238
|
filters: DataTableFilterState | undefined;
|
|
239
239
|
sorters: Record<string, DataTableSortState> | undefined;
|
|
240
240
|
dataTableRef: DataTableInst | null;
|
|
241
|
-
pagination:
|
|
241
|
+
pagination: vue69.Ref<{
|
|
242
242
|
page: number;
|
|
243
243
|
pageSize: number;
|
|
244
244
|
itemCount: number;
|
|
@@ -276,7 +276,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
276
276
|
filters: DataTableFilterState | undefined;
|
|
277
277
|
sorters: Record<string, DataTableSortState> | undefined;
|
|
278
278
|
dataTableRef: DataTableInst | null;
|
|
279
|
-
pagination:
|
|
279
|
+
pagination: vue69.Ref<{
|
|
280
280
|
page: number;
|
|
281
281
|
pageSize: number;
|
|
282
282
|
itemCount: number;
|
|
@@ -301,7 +301,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
301
301
|
}) => any;
|
|
302
302
|
};
|
|
303
303
|
emit: DataTablePlusEmits<P, D, R>;
|
|
304
|
-
}>) =>
|
|
304
|
+
}>) => vue69.VNode & {
|
|
305
305
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
306
306
|
};
|
|
307
307
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LoadingProviderProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue33 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: vue33.DefineComponent<LoadingProviderProps, {}, {}, {}, {}, vue33.ComponentOptionsMixin, vue33.ComponentOptionsMixin, {}, string, vue33.PublicProps, Readonly<LoadingProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, vue33.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 & {
|
|
@@ -18,7 +18,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18
18
|
emits: ["validated"],
|
|
19
19
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
20
20
|
const emit = __emit;
|
|
21
|
-
const {
|
|
21
|
+
const { formValueRef, formRulesRef, formInstRef, formProps: _formProps, setValue, validate, resetValidation, resetForm, reset, clear, onValidated } = useNaiveForm(useTemplateRef("form-ref"), {
|
|
22
22
|
value: __props.value,
|
|
23
23
|
rules: __props.rules,
|
|
24
24
|
clearRules: __props.clearRules
|
|
@@ -37,9 +37,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
37
37
|
if (key) setValue({ [key]: val });
|
|
38
38
|
}
|
|
39
39
|
const expose = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
formInstRef,
|
|
41
|
+
formValueRef,
|
|
42
|
+
formRulesRef,
|
|
43
43
|
formProps: _formProps,
|
|
44
44
|
setValue,
|
|
45
45
|
validate,
|
|
@@ -52,9 +52,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
52
52
|
const templateBind = computed(() => {
|
|
53
53
|
return {
|
|
54
54
|
...expose,
|
|
55
|
-
formRef: toValue(
|
|
56
|
-
formValue: toValue(
|
|
57
|
-
formRules: toValue(
|
|
55
|
+
formRef: toValue(formInstRef),
|
|
56
|
+
formValue: toValue(formValueRef),
|
|
57
|
+
formRules: toValue(formRulesRef),
|
|
58
58
|
formProps: toValue(_formProps)
|
|
59
59
|
};
|
|
60
60
|
});
|
|
@@ -62,8 +62,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
62
62
|
return (_ctx, _cache) => {
|
|
63
63
|
return openBlock(), createBlock(unref(NForm), mergeProps({
|
|
64
64
|
ref: "form-ref",
|
|
65
|
-
model: unref(
|
|
66
|
-
rules: unref(
|
|
65
|
+
model: unref(formValueRef),
|
|
66
|
+
rules: unref(formRulesRef)
|
|
67
67
|
}, __props.formProps), {
|
|
68
68
|
default: withCtx(() => [
|
|
69
69
|
renderSlot(_ctx.$slots, "header", normalizeProps(guardReactiveProps(templateBind.value))),
|
|
@@ -92,7 +92,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
92
92
|
})), { key: 0 })) : (openBlock(), createBlock(unref(PresetInput_default), {
|
|
93
93
|
key: 1,
|
|
94
94
|
options: opt,
|
|
95
|
-
value: key ? unref(
|
|
95
|
+
value: key ? unref(formValueRef)[key] : void 0,
|
|
96
96
|
"onUpdate:value": (val) => onPresetInputUpdate(val, key)
|
|
97
97
|
}, null, 8, [
|
|
98
98
|
"options",
|
|
@@ -144,7 +144,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
144
144
|
})), { key: 0 })) : (openBlock(), createBlock(unref(PresetInput_default), {
|
|
145
145
|
key: 1,
|
|
146
146
|
options: opt,
|
|
147
|
-
value: key ? unref(
|
|
147
|
+
value: key ? unref(formValueRef)[key] : void 0,
|
|
148
148
|
"onUpdate:value": (val) => onPresetInputUpdate(val, key)
|
|
149
149
|
}, null, 8, [
|
|
150
150
|
"options",
|
|
@@ -1,19 +1,19 @@
|
|
|
1
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 vue48 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: vue48.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: vue48.ShallowUnwrapRef<PresetFormExpose<V>>) => void;
|
|
17
17
|
attrs: any;
|
|
18
18
|
slots: {
|
|
19
19
|
header?: (props: {
|
|
@@ -21,9 +21,12 @@ 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: vue48.Reactive<V>;
|
|
25
|
+
rules: vue48.Reactive<Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>>;
|
|
26
26
|
};
|
|
27
|
+
formInstRef: Readonly<vue48.ShallowRef<FormInst | null>>;
|
|
28
|
+
formValueRef: vue48.Ref<V, V>;
|
|
29
|
+
formRulesRef: vue48.Ref<Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>, Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>>;
|
|
27
30
|
setValue: (_value: Partial<V>) => void;
|
|
28
31
|
validate: () => Promise<{
|
|
29
32
|
warnings?: async_validator0.ValidateError[][];
|
|
@@ -32,7 +35,7 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
32
35
|
resetForm: () => void;
|
|
33
36
|
reset: () => void;
|
|
34
37
|
clear: () => void;
|
|
35
|
-
onValidated:
|
|
38
|
+
onValidated: _vueuse_core8.EventHookOn<[V]>;
|
|
36
39
|
}) => any;
|
|
37
40
|
} & {
|
|
38
41
|
default?: (props: {
|
|
@@ -40,9 +43,12 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
40
43
|
formValue: V;
|
|
41
44
|
formRules: Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>;
|
|
42
45
|
formProps: {
|
|
43
|
-
model:
|
|
44
|
-
rules:
|
|
46
|
+
model: vue48.Reactive<V>;
|
|
47
|
+
rules: vue48.Reactive<Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>>;
|
|
45
48
|
};
|
|
49
|
+
formInstRef: Readonly<vue48.ShallowRef<FormInst | null>>;
|
|
50
|
+
formValueRef: vue48.Ref<V, V>;
|
|
51
|
+
formRulesRef: vue48.Ref<Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>, Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>>;
|
|
46
52
|
setValue: (_value: Partial<V>) => void;
|
|
47
53
|
validate: () => Promise<{
|
|
48
54
|
warnings?: async_validator0.ValidateError[][];
|
|
@@ -51,7 +57,7 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
51
57
|
resetForm: () => void;
|
|
52
58
|
reset: () => void;
|
|
53
59
|
clear: () => void;
|
|
54
|
-
onValidated:
|
|
60
|
+
onValidated: _vueuse_core8.EventHookOn<[V]>;
|
|
55
61
|
}) => any;
|
|
56
62
|
} & {
|
|
57
63
|
footer?: (props: {
|
|
@@ -59,9 +65,12 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
59
65
|
formValue: V;
|
|
60
66
|
formRules: Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>;
|
|
61
67
|
formProps: {
|
|
62
|
-
model:
|
|
63
|
-
rules:
|
|
68
|
+
model: vue48.Reactive<V>;
|
|
69
|
+
rules: vue48.Reactive<Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>>;
|
|
64
70
|
};
|
|
71
|
+
formInstRef: Readonly<vue48.ShallowRef<FormInst | null>>;
|
|
72
|
+
formValueRef: vue48.Ref<V, V>;
|
|
73
|
+
formRulesRef: vue48.Ref<Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>, Partial<Record<keyof V, naive_ui0.FormRules | naive_ui0.FormItemRule | naive_ui0.FormItemRule[]>>>;
|
|
65
74
|
setValue: (_value: Partial<V>) => void;
|
|
66
75
|
validate: () => Promise<{
|
|
67
76
|
warnings?: async_validator0.ValidateError[][];
|
|
@@ -70,11 +79,11 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
70
79
|
resetForm: () => void;
|
|
71
80
|
reset: () => void;
|
|
72
81
|
clear: () => void;
|
|
73
|
-
onValidated:
|
|
82
|
+
onValidated: _vueuse_core8.EventHookOn<[V]>;
|
|
74
83
|
}) => any;
|
|
75
84
|
};
|
|
76
85
|
emit: (e: "validated", val: V) => void;
|
|
77
|
-
}>) =>
|
|
86
|
+
}>) => vue48.VNode & {
|
|
78
87
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
79
88
|
};
|
|
80
89
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PresetInputProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue46 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: vue46.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
|
+
}>) => vue46.VNode & {
|
|
16
16
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
17
17
|
};
|
|
18
18
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DataObject } from "../../composables/use-data-request.js";
|
|
2
2
|
import { PresetPickerEmits, PresetPickerExpose, PresetPickerProps, PresetPickerValue } from "./index.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as vue79 from "vue";
|
|
4
4
|
import { DataTableColumns } from "naive-ui";
|
|
5
5
|
|
|
6
6
|
//#region src/components/preset-picker/PresetPicker.vue.d.ts
|
|
7
7
|
declare const __VLS_export: <V extends PresetPickerValue, 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: vue79.PublicProps & __VLS_PrettifyLocal<PresetPickerProps<V, R> & {
|
|
9
9
|
onClose?: (() => any) | undefined;
|
|
10
10
|
"onUpdate:value"?: ((val: V | null, raw: R | R[] | null) => any) | undefined;
|
|
11
11
|
onAfterEnter?: (() => any) | undefined;
|
|
@@ -18,7 +18,7 @@ declare const __VLS_export: <V extends PresetPickerValue, R extends DataObject>(
|
|
|
18
18
|
}> & (typeof globalThis extends {
|
|
19
19
|
__VLS_PROPS_FALLBACK: infer P;
|
|
20
20
|
} ? P : {});
|
|
21
|
-
expose: (exposed:
|
|
21
|
+
expose: (exposed: vue79.ShallowUnwrapRef<PresetPickerExpose<R>>) => void;
|
|
22
22
|
attrs: any;
|
|
23
23
|
slots: {
|
|
24
24
|
'button-icon'?: (props: {}) => any;
|
|
@@ -54,7 +54,7 @@ declare const __VLS_export: <V extends PresetPickerValue, R extends DataObject>(
|
|
|
54
54
|
'modal-close'?: (props: {}) => any;
|
|
55
55
|
};
|
|
56
56
|
emit: PresetPickerEmits<V, R>;
|
|
57
|
-
}>) =>
|
|
57
|
+
}>) => vue79.VNode & {
|
|
58
58
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
59
59
|
};
|
|
60
60
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DataObject, UseDataRequestPagination } from "../../composables/use-data-request.js";
|
|
2
2
|
import { PresetSelectEmits, PresetSelectExpose, PresetSelectProps, PresetSelectValue } from "./index.js";
|
|
3
3
|
import * as _vueuse_core11 from "@vueuse/core";
|
|
4
|
-
import * as
|
|
4
|
+
import * as vue66 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: vue66.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;
|
|
@@ -23,7 +23,7 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
23
23
|
}> & (typeof globalThis extends {
|
|
24
24
|
__VLS_PROPS_FALLBACK: infer P_1;
|
|
25
25
|
} ? P_1 : {});
|
|
26
|
-
expose: (exposed:
|
|
26
|
+
expose: (exposed: vue66.ShallowUnwrapRef<PresetSelectExpose<P, D, R>>) => void;
|
|
27
27
|
attrs: any;
|
|
28
28
|
slots: {
|
|
29
29
|
header?: (props: {
|
|
@@ -162,7 +162,7 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
162
162
|
}) => any;
|
|
163
163
|
};
|
|
164
164
|
emit: PresetSelectEmits<V, P, D, R>;
|
|
165
|
-
}>) =>
|
|
165
|
+
}>) => vue66.VNode & {
|
|
166
166
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
167
167
|
};
|
|
168
168
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
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 vue38 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: vue38.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
11
|
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
@@ -13,7 +13,7 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
13
13
|
}> & (typeof globalThis extends {
|
|
14
14
|
__VLS_PROPS_FALLBACK: infer P_1;
|
|
15
15
|
} ? P_1 : {});
|
|
16
|
-
expose: (exposed:
|
|
16
|
+
expose: (exposed: vue38.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
|
+
}>) => vue38.VNode & {
|
|
47
47
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
48
48
|
};
|
|
49
49
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SearchInputProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue23 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: vue23.DefineComponent<SearchInputProps, {}, {}, {}, {}, vue23.ComponentOptionsMixin, vue23.ComponentOptionsMixin, {} & {
|
|
19
19
|
"update:value": (v: string | null | undefined) => any;
|
|
20
|
-
}, string,
|
|
20
|
+
}, string, vue23.PublicProps, Readonly<SearchInputProps> & Readonly<{
|
|
21
21
|
"onUpdate:value"?: ((v: string | null | undefined) => any) | undefined;
|
|
22
|
-
}>, {}, {}, {}, {}, string,
|
|
22
|
+
}>, {}, {}, {}, {}, string, vue23.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,12 +1,12 @@
|
|
|
1
1
|
import { TransitionProps as TransitionProps$1 } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue41 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: vue41.DefineComponent<TransitionProps$1, {}, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {}, string, vue41.PublicProps, Readonly<TransitionProps$1> & Readonly<{}>, {}, {}, {}, {}, string, vue41.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,22 +1,22 @@
|
|
|
1
1
|
import { TypeWriterProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue82 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/type-writer/TypeWriter.vue.d.ts
|
|
5
|
-
declare const __VLS_export:
|
|
5
|
+
declare const __VLS_export: vue82.DefineComponent<TypeWriterProps, {}, {}, {}, {}, vue82.ComponentOptionsMixin, vue82.ComponentOptionsMixin, {} & {
|
|
6
6
|
start: () => any;
|
|
7
7
|
update: (v: {
|
|
8
8
|
index: number;
|
|
9
9
|
value: string;
|
|
10
10
|
}) => any;
|
|
11
11
|
stop: (v: string) => any;
|
|
12
|
-
}, string,
|
|
12
|
+
}, string, vue82.PublicProps, Readonly<TypeWriterProps> & Readonly<{
|
|
13
13
|
onStart?: (() => any) | undefined;
|
|
14
14
|
onUpdate?: ((v: {
|
|
15
15
|
index: number;
|
|
16
16
|
value: string;
|
|
17
17
|
}) => any) | undefined;
|
|
18
18
|
onStop?: ((v: string) => any) | undefined;
|
|
19
|
-
}>, {}, {}, {}, {}, string,
|
|
19
|
+
}>, {}, {}, {}, {}, string, vue82.ComponentProvideOptions, false, {}, any>;
|
|
20
20
|
declare const _default: typeof __VLS_export;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { _default };
|
|
@@ -17,10 +17,10 @@ type UseNaiveFormOptions<T extends DataObject> = {
|
|
|
17
17
|
rules?: MaybeRefOrGetter<UseNaiveFormRules<T>>;
|
|
18
18
|
clearRules?: UseNaiveFormClearRules;
|
|
19
19
|
};
|
|
20
|
-
declare function useNaiveForm<T extends DataObject = DataObject>(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
declare function useNaiveForm<T extends DataObject = DataObject>(formInstRef: TemplateRef<FormInst>, options?: UseNaiveFormOptions<T>): {
|
|
21
|
+
formInstRef: Readonly<vue5.ShallowRef<FormInst | null>>;
|
|
22
|
+
formValueRef: Ref<T, T>;
|
|
23
|
+
formRulesRef: Ref<Partial<Record<keyof T, FormRules | FormItemRule | FormItemRule[]>>, Partial<Record<keyof T, FormRules | FormItemRule | FormItemRule[]>>>;
|
|
24
24
|
formProps: {
|
|
25
25
|
model: vue5.Reactive<T>;
|
|
26
26
|
rules: vue5.Reactive<Partial<Record<keyof T, FormRules | FormItemRule | FormItemRule[]>>>;
|
|
@@ -30,51 +30,51 @@ function deepMerge(target = {}, source = {}) {
|
|
|
30
30
|
}
|
|
31
31
|
return target;
|
|
32
32
|
}
|
|
33
|
-
function useNaiveForm(
|
|
33
|
+
function useNaiveForm(formInstRef, options) {
|
|
34
34
|
const { value, rules, clearRules } = options ?? {};
|
|
35
35
|
const cacheValue = cloneDeep(toValue(value) ?? {});
|
|
36
|
-
const
|
|
36
|
+
const formValueRef = ref(toValue(value) ?? {});
|
|
37
37
|
watchEffect(() => {
|
|
38
|
-
|
|
38
|
+
formValueRef.value = toValue(value) ?? {};
|
|
39
39
|
});
|
|
40
|
-
const
|
|
41
|
-
watchEffect(() =>
|
|
40
|
+
const formRulesRef = ref(toValue(rules));
|
|
41
|
+
watchEffect(() => formRulesRef.value = toValue(rules) ?? {});
|
|
42
42
|
const formProps = {
|
|
43
|
-
model: reactive(
|
|
44
|
-
rules: reactive(
|
|
43
|
+
model: reactive(formValueRef.value),
|
|
44
|
+
rules: reactive(formRulesRef.value)
|
|
45
45
|
};
|
|
46
46
|
const onValidatedEvent = createEventHook();
|
|
47
47
|
function setValue(_value) {
|
|
48
|
-
Object.assign(
|
|
48
|
+
Object.assign(formValueRef.value, _value);
|
|
49
49
|
}
|
|
50
50
|
function validate() {
|
|
51
51
|
return new Promise((resolve, reject) => {
|
|
52
|
-
if (!
|
|
53
|
-
|
|
54
|
-
onValidatedEvent.trigger(toRaw(toValue(
|
|
52
|
+
if (!formInstRef.value) return reject(/* @__PURE__ */ new Error("useNaiveForm: formInstRef is not found."));
|
|
53
|
+
formInstRef.value.validate().then((res) => {
|
|
54
|
+
onValidatedEvent.trigger(toRaw(toValue(formValueRef)));
|
|
55
55
|
return resolve(res);
|
|
56
56
|
}).catch(reject);
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
function resetValidation() {
|
|
60
|
-
|
|
60
|
+
formInstRef.value?.restoreValidation();
|
|
61
61
|
}
|
|
62
62
|
function clear() {
|
|
63
|
-
clearObjectValues(
|
|
63
|
+
clearObjectValues(formValueRef.value, clearRules);
|
|
64
64
|
}
|
|
65
65
|
function resetForm() {
|
|
66
66
|
clear();
|
|
67
67
|
const _cacheValue = cloneDeep(cacheValue);
|
|
68
|
-
deepMerge(
|
|
68
|
+
deepMerge(formValueRef.value, _cacheValue);
|
|
69
69
|
}
|
|
70
70
|
function reset() {
|
|
71
71
|
resetValidation();
|
|
72
72
|
resetForm();
|
|
73
73
|
}
|
|
74
74
|
return {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
formInstRef,
|
|
76
|
+
formValueRef,
|
|
77
|
+
formRulesRef,
|
|
78
78
|
formProps,
|
|
79
79
|
setValue,
|
|
80
80
|
validate,
|
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.73",
|
|
5
5
|
"description": "Some Composable Functions And Components for Vue 3",
|
|
6
6
|
"author": "oiij",
|
|
7
7
|
"license": "MIT",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"vue-hooks-plus": "^2.4.1",
|
|
48
48
|
"@oiij/css-render": "0.0.10",
|
|
49
49
|
"@oiij/markdown-it": "0.0.11",
|
|
50
|
-
"@oiij/use": "0.0.
|
|
50
|
+
"@oiij/use": "0.0.42"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/prismjs": "^1.26.5",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"vue-component-type-helpers": "^3.2.4",
|
|
62
62
|
"vue-hooks-plus": "^2.4.1",
|
|
63
63
|
"@oiij/css-render": "0.0.10",
|
|
64
|
-
"@oiij/
|
|
65
|
-
"@oiij/
|
|
64
|
+
"@oiij/markdown-it": "0.0.11",
|
|
65
|
+
"@oiij/use": "0.0.42"
|
|
66
66
|
},
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|