@oiij/naive-ui 0.0.78 → 0.0.80
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.js +18 -15
- package/dist/components/copy-button/CopyButton.vue.d.ts +6 -10
- package/dist/components/data-table-plus/DataTablePlus.vue.d.ts +31 -31
- package/dist/components/loading-provider/LoadingProvider.vue.d.ts +2 -2
- package/dist/components/preset-form/PresetForm.js +14 -14
- package/dist/components/preset-form/PresetForm.vue.d.ts +13 -13
- package/dist/components/preset-form/index.d.ts +1 -1
- 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 +27 -27
- package/dist/components/remote-request/RemoteRequest.vue.d.ts +11 -11
- package/dist/components/search-input/SearchInput.vue.d.ts +4 -4
- package/dist/components/tooltip-button/TooltipButton.js +2 -2
- package/dist/components/tooltip-button/TooltipButton.vue.d.ts +10 -8
- package/dist/components/transition/BaseTransition.vue.d.ts +2 -2
- package/dist/components.js +1 -1
- package/dist/composables/use-data-request.d.ts +3 -2
- package/dist/composables/use-data-request.js +6 -6
- package/dist/composables/use-naive-form.d.ts +3 -3
- package/dist/composables/use-naive-form.js +11 -11
- package/package.json +4 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ConfigProvidersProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue28 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: vue28.DefineComponent<ConfigProvidersProps, {}, {}, {}, {}, vue28.ComponentOptionsMixin, vue28.ComponentOptionsMixin, {}, string, vue28.PublicProps, Readonly<ConfigProvidersProps> & Readonly<{}>, {}, {}, {}, {}, string, vue28.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,7 +1,7 @@
|
|
|
1
1
|
import MageCopyFill_default from "../icons/MageCopyFill.js";
|
|
2
|
+
import TooltipButton_default from "../tooltip-button/TooltipButton.js";
|
|
2
3
|
import { useClipboard } from "@vueuse/core";
|
|
3
|
-
import { createBlock,
|
|
4
|
-
import { NButton, NTooltip } from "naive-ui";
|
|
4
|
+
import { createBlock, createVNode, defineComponent, openBlock, renderSlot, unref, watch, withCtx } from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/components/copy-button/CopyButton.vue
|
|
7
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -27,20 +27,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
27
|
copy();
|
|
28
28
|
}
|
|
29
29
|
return (_ctx, _cache) => {
|
|
30
|
-
return openBlock(), createBlock(unref(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "tooltip", {}, () => [createTextVNode(toDisplayString(unref(copied) ? "复制成功" : "复制"), 1)])]),
|
|
30
|
+
return openBlock(), createBlock(unref(TooltipButton_default), {
|
|
31
|
+
tooltip: unref(copied) ? "复制成功" : "复制",
|
|
32
|
+
"tooltip-props": __props.tooltipProps,
|
|
33
|
+
"button-props": {
|
|
34
|
+
quaternary: true,
|
|
35
|
+
size: "tiny",
|
|
36
|
+
...__props.buttonProps
|
|
37
|
+
},
|
|
38
|
+
onClick: handleClick
|
|
39
|
+
}, {
|
|
40
|
+
icon: withCtx(() => [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(MageCopyFill_default)])]),
|
|
42
41
|
_: 3
|
|
43
|
-
},
|
|
42
|
+
}, 8, [
|
|
43
|
+
"tooltip",
|
|
44
|
+
"tooltip-props",
|
|
45
|
+
"button-props"
|
|
46
|
+
]);
|
|
44
47
|
};
|
|
45
48
|
}
|
|
46
49
|
});
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { CopyButtonProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue46 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/copy-button/CopyButton.vue.d.ts
|
|
5
|
-
declare var
|
|
5
|
+
declare var __VLS_11: {};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
|
-
|
|
8
|
-
} & {
|
|
9
|
-
icon?: (props: typeof __VLS_18) => any;
|
|
10
|
-
} & {
|
|
11
|
-
tooltip?: (props: typeof __VLS_25) => any;
|
|
7
|
+
icon?: (props: typeof __VLS_11) => any;
|
|
12
8
|
};
|
|
13
|
-
declare const __VLS_base:
|
|
9
|
+
declare const __VLS_base: vue46.DefineComponent<CopyButtonProps, {}, {}, {}, {}, vue46.ComponentOptionsMixin, vue46.ComponentOptionsMixin, {} & {
|
|
14
10
|
copied: (v: string | undefined) => any;
|
|
15
|
-
}, string,
|
|
11
|
+
}, string, vue46.PublicProps, Readonly<CopyButtonProps> & Readonly<{
|
|
16
12
|
onCopied?: ((v: string | undefined) => any) | undefined;
|
|
17
|
-
}>, {}, {}, {}, {}, string,
|
|
13
|
+
}>, {}, {}, {}, {}, string, vue46.ComponentProvideOptions, false, {}, any>;
|
|
18
14
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
15
|
declare const _default: typeof __VLS_export;
|
|
20
16
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DataObject } from "../../composables/use-data-request.js";
|
|
2
2
|
import { DataTablePlusEmits, DataTablePlusExpose, DataTablePlusProps } from "./index.js";
|
|
3
3
|
import "../../composables/index.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as _vueuse_core28 from "@vueuse/core";
|
|
5
5
|
import * as vue33 from "vue";
|
|
6
6
|
import { DataTableBaseColumn, DataTableFilterState, DataTableInst, DataTableSortState } from "naive-ui";
|
|
7
7
|
import { RowKey } from "naive-ui/es/data-table/src/interface";
|
|
@@ -9,12 +9,12 @@ import { RowKey } from "naive-ui/es/data-table/src/interface";
|
|
|
9
9
|
//#region src/components/data-table-plus/DataTablePlus.vue.d.ts
|
|
10
10
|
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<{
|
|
11
11
|
props: vue33.PublicProps & __VLS_PrettifyLocal<DataTablePlusProps<P, D, R> & {
|
|
12
|
-
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
13
12
|
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
13
|
+
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
14
|
+
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
14
15
|
onBefore?: ((params: P[]) => any) | undefined;
|
|
15
16
|
"onUpdate:page"?: ((page: number) => any) | undefined;
|
|
16
17
|
"onUpdate:pageSize"?: ((pageSize: number) => any) | undefined;
|
|
17
|
-
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
18
18
|
onClickRow?: ((row: R, index: number, event: MouseEvent, currentData: R[]) => any) | undefined;
|
|
19
19
|
onContextMenuRow?: ((row: R, index: number, event: MouseEvent, currentData: R[]) => any) | undefined;
|
|
20
20
|
"onUpdate:checkedRowKeys"?: ((keys: RowKey[], rows: R[], meta: {
|
|
@@ -53,10 +53,10 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
53
53
|
setParams: (_params: Partial<P>) => void;
|
|
54
54
|
runParams: (_params: Partial<P>) => void;
|
|
55
55
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
56
|
-
onBefore:
|
|
57
|
-
onSuccess:
|
|
58
|
-
onError:
|
|
59
|
-
onFinally:
|
|
56
|
+
onBefore: _vueuse_core28.EventHookOn<[P[]]>;
|
|
57
|
+
onSuccess: _vueuse_core28.EventHookOn<[D, P[]]>;
|
|
58
|
+
onError: _vueuse_core28.EventHookOn<[Error, P[]]>;
|
|
59
|
+
onFinally: _vueuse_core28.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
60
60
|
}) => any;
|
|
61
61
|
} & {
|
|
62
62
|
title?: (props: {}) => any;
|
|
@@ -84,10 +84,10 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
84
84
|
setParams: (_params: Partial<P>) => void;
|
|
85
85
|
runParams: (_params: Partial<P>) => void;
|
|
86
86
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
87
|
-
onBefore:
|
|
88
|
-
onSuccess:
|
|
89
|
-
onError:
|
|
90
|
-
onFinally:
|
|
87
|
+
onBefore: _vueuse_core28.EventHookOn<[P[]]>;
|
|
88
|
+
onSuccess: _vueuse_core28.EventHookOn<[D, P[]]>;
|
|
89
|
+
onError: _vueuse_core28.EventHookOn<[Error, P[]]>;
|
|
90
|
+
onFinally: _vueuse_core28.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
91
91
|
}) => any;
|
|
92
92
|
} & {
|
|
93
93
|
filter?: (props: {
|
|
@@ -113,10 +113,10 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
113
113
|
setParams: (_params: Partial<P>) => void;
|
|
114
114
|
runParams: (_params: Partial<P>) => void;
|
|
115
115
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
116
|
-
onBefore:
|
|
117
|
-
onSuccess:
|
|
118
|
-
onError:
|
|
119
|
-
onFinally:
|
|
116
|
+
onBefore: _vueuse_core28.EventHookOn<[P[]]>;
|
|
117
|
+
onSuccess: _vueuse_core28.EventHookOn<[D, P[]]>;
|
|
118
|
+
onError: _vueuse_core28.EventHookOn<[Error, P[]]>;
|
|
119
|
+
onFinally: _vueuse_core28.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
120
120
|
}) => any;
|
|
121
121
|
} & {
|
|
122
122
|
empty?: (props: {
|
|
@@ -142,10 +142,10 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
142
142
|
setParams: (_params: Partial<P>) => void;
|
|
143
143
|
runParams: (_params: Partial<P>) => void;
|
|
144
144
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
145
|
-
onBefore:
|
|
146
|
-
onSuccess:
|
|
147
|
-
onError:
|
|
148
|
-
onFinally:
|
|
145
|
+
onBefore: _vueuse_core28.EventHookOn<[P[]]>;
|
|
146
|
+
onSuccess: _vueuse_core28.EventHookOn<[D, P[]]>;
|
|
147
|
+
onError: _vueuse_core28.EventHookOn<[Error, P[]]>;
|
|
148
|
+
onFinally: _vueuse_core28.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
149
149
|
}) => any;
|
|
150
150
|
} & {
|
|
151
151
|
loading?: (props: {
|
|
@@ -171,10 +171,10 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
171
171
|
setParams: (_params: Partial<P>) => void;
|
|
172
172
|
runParams: (_params: Partial<P>) => void;
|
|
173
173
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
174
|
-
onBefore:
|
|
175
|
-
onSuccess:
|
|
176
|
-
onError:
|
|
177
|
-
onFinally:
|
|
174
|
+
onBefore: _vueuse_core28.EventHookOn<[P[]]>;
|
|
175
|
+
onSuccess: _vueuse_core28.EventHookOn<[D, P[]]>;
|
|
176
|
+
onError: _vueuse_core28.EventHookOn<[Error, P[]]>;
|
|
177
|
+
onFinally: _vueuse_core28.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
178
178
|
}) => any;
|
|
179
179
|
} & {
|
|
180
180
|
footer?: (props: {
|
|
@@ -200,10 +200,10 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
200
200
|
setParams: (_params: Partial<P>) => void;
|
|
201
201
|
runParams: (_params: Partial<P>) => void;
|
|
202
202
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
203
|
-
onBefore:
|
|
204
|
-
onSuccess:
|
|
205
|
-
onError:
|
|
206
|
-
onFinally:
|
|
203
|
+
onBefore: _vueuse_core28.EventHookOn<[P[]]>;
|
|
204
|
+
onSuccess: _vueuse_core28.EventHookOn<[D, P[]]>;
|
|
205
|
+
onError: _vueuse_core28.EventHookOn<[Error, P[]]>;
|
|
206
|
+
onFinally: _vueuse_core28.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
207
207
|
}) => any;
|
|
208
208
|
} & {
|
|
209
209
|
'footer-extra'?: (props: {
|
|
@@ -229,10 +229,10 @@ declare const __VLS_export: <P extends DataObject, D extends DataObject, R exten
|
|
|
229
229
|
setParams: (_params: Partial<P>) => void;
|
|
230
230
|
runParams: (_params: Partial<P>) => void;
|
|
231
231
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
232
|
-
onBefore:
|
|
233
|
-
onSuccess:
|
|
234
|
-
onError:
|
|
235
|
-
onFinally:
|
|
232
|
+
onBefore: _vueuse_core28.EventHookOn<[P[]]>;
|
|
233
|
+
onSuccess: _vueuse_core28.EventHookOn<[D, P[]]>;
|
|
234
|
+
onError: _vueuse_core28.EventHookOn<[Error, P[]]>;
|
|
235
|
+
onFinally: _vueuse_core28.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
236
236
|
}) => any;
|
|
237
237
|
};
|
|
238
238
|
emit: DataTablePlusEmits<P, D, R>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LoadingProviderProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue54 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: vue54.DefineComponent<LoadingProviderProps, {}, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {}, string, vue54.PublicProps, Readonly<LoadingProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, vue54.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,7 +1,7 @@
|
|
|
1
1
|
import { useNaiveForm } from "../../composables/use-naive-form.js";
|
|
2
2
|
import PresetInput_default from "../preset-input/PresetInput.js";
|
|
3
3
|
import { mergeRule } from "./_utils.js";
|
|
4
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useTemplateRef, withCtx } from "vue";
|
|
4
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toValue, unref, useTemplateRef, withCtx } from "vue";
|
|
5
5
|
import { NButton, NCollapseTransition, NDivider, NForm, NFormItem, NGi, NGrid } from "naive-ui";
|
|
6
6
|
|
|
7
7
|
//#region src/components/preset-form/PresetForm.vue
|
|
@@ -9,7 +9,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9
9
|
__name: "PresetForm",
|
|
10
10
|
props: {
|
|
11
11
|
options: {},
|
|
12
|
-
|
|
12
|
+
values: {},
|
|
13
13
|
rules: {},
|
|
14
14
|
clearRules: {},
|
|
15
15
|
formProps: {},
|
|
@@ -18,8 +18,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18
18
|
emits: ["validated"],
|
|
19
19
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
20
20
|
const emit = __emit;
|
|
21
|
-
const {
|
|
22
|
-
|
|
21
|
+
const { formValues, formRules, formInst, formProps: _formProps, setValue, validate, resetValidation, resetForm, reset, clear, onValidated } = useNaiveForm(useTemplateRef("form-ref"), {
|
|
22
|
+
values: __props.values,
|
|
23
23
|
rules: __props.rules,
|
|
24
24
|
clearRules: __props.clearRules
|
|
25
25
|
});
|
|
@@ -28,13 +28,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
28
28
|
});
|
|
29
29
|
const filterCollapsed = ref(false);
|
|
30
30
|
const visibleOptions = computed(() => {
|
|
31
|
-
return __props.options?.filter((f) =>
|
|
31
|
+
return __props.options?.filter((f) => !toValue(f.hidden)) || [];
|
|
32
32
|
});
|
|
33
33
|
const _options = computed(() => {
|
|
34
|
-
return visibleOptions.value.filter((f) =>
|
|
34
|
+
return visibleOptions.value.filter((f) => !toValue(f.collapsed));
|
|
35
35
|
});
|
|
36
36
|
const _collapsedOptions = computed(() => {
|
|
37
|
-
return visibleOptions.value.filter((f) =>
|
|
37
|
+
return visibleOptions.value.filter((f) => toValue(f.collapsed));
|
|
38
38
|
});
|
|
39
39
|
function onPresetInputUpdate(val, key) {
|
|
40
40
|
if (key) setValue({ [key]: val });
|
|
@@ -45,8 +45,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
45
45
|
const { offset, suffix, ...extraItemProps } = itemProps ?? {};
|
|
46
46
|
return {
|
|
47
47
|
key: typeof key === "string" ? key : void 0,
|
|
48
|
-
label:
|
|
49
|
-
span:
|
|
48
|
+
label: toValue(label),
|
|
49
|
+
span: toValue(span) ?? itemProps?.span,
|
|
50
50
|
required,
|
|
51
51
|
rule,
|
|
52
52
|
offset,
|
|
@@ -59,7 +59,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
59
59
|
}
|
|
60
60
|
const expose = {
|
|
61
61
|
formInst,
|
|
62
|
-
|
|
62
|
+
formValues,
|
|
63
63
|
formRules,
|
|
64
64
|
formProps: _formProps,
|
|
65
65
|
setValue,
|
|
@@ -74,7 +74,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
74
74
|
return {
|
|
75
75
|
...expose,
|
|
76
76
|
formInst: formInst.value,
|
|
77
|
-
|
|
77
|
+
formValues: formValues.value,
|
|
78
78
|
formRules: formRules.value,
|
|
79
79
|
formProps: _formProps
|
|
80
80
|
};
|
|
@@ -83,7 +83,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
83
83
|
return (_ctx, _cache) => {
|
|
84
84
|
return openBlock(), createBlock(unref(NForm), mergeProps({
|
|
85
85
|
ref: "form-ref",
|
|
86
|
-
model: unref(
|
|
86
|
+
model: unref(formValues),
|
|
87
87
|
rules: unref(formRules)
|
|
88
88
|
}, __props.formProps), {
|
|
89
89
|
default: withCtx(() => [
|
|
@@ -113,7 +113,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
113
113
|
})), { key: 0 })) : (openBlock(), createBlock(unref(PresetInput_default), {
|
|
114
114
|
key: 1,
|
|
115
115
|
options: inputOption,
|
|
116
|
-
value: key ? unref(
|
|
116
|
+
value: key ? unref(formValues)[key] : void 0,
|
|
117
117
|
"onUpdate:value": (val) => onPresetInputUpdate(val, key)
|
|
118
118
|
}, null, 8, [
|
|
119
119
|
"options",
|
|
@@ -165,7 +165,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
165
165
|
})), { key: 0 })) : (openBlock(), createBlock(unref(PresetInput_default), {
|
|
166
166
|
key: 1,
|
|
167
167
|
options: inputOption,
|
|
168
|
-
value: key ? unref(
|
|
168
|
+
value: key ? unref(formValues)[key] : void 0,
|
|
169
169
|
"onUpdate:value": (val) => onPresetInputUpdate(val, key)
|
|
170
170
|
}, null, 8, [
|
|
171
171
|
"options",
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { DataObject } from "../../composables/use-data-request.js";
|
|
2
2
|
import { PresetFormExpose, PresetFormProps } from "./index.js";
|
|
3
3
|
import * as _vueuse_core56 from "@vueuse/core";
|
|
4
|
-
import * as
|
|
4
|
+
import * as vue59 from "vue";
|
|
5
5
|
import * as naive_ui1 from "naive-ui";
|
|
6
6
|
import { FormInst, FormRules } 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: vue59.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: vue59.ShallowUnwrapRef<PresetFormExpose<V>>) => void;
|
|
17
17
|
attrs: any;
|
|
18
18
|
slots: {
|
|
19
19
|
header?: (props: {
|
|
20
20
|
formInst: FormInst | null;
|
|
21
|
-
|
|
21
|
+
formValues: V;
|
|
22
22
|
formRules: Partial<Record<keyof V, FormRules | naive_ui1.FormItemRule | naive_ui1.FormItemRule[]>>;
|
|
23
23
|
formProps: {
|
|
24
|
-
model:
|
|
25
|
-
rules:
|
|
24
|
+
model: vue59.Reactive<V>;
|
|
25
|
+
rules: vue59.Reactive<Partial<Record<keyof V, FormRules | naive_ui1.FormItemRule | naive_ui1.FormItemRule[]>>>;
|
|
26
26
|
};
|
|
27
27
|
setValue: (value: Partial<V>) => void;
|
|
28
28
|
validate: () => Promise<{
|
|
@@ -37,11 +37,11 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
37
37
|
} & {
|
|
38
38
|
default?: (props: {
|
|
39
39
|
formInst: FormInst | null;
|
|
40
|
-
|
|
40
|
+
formValues: V;
|
|
41
41
|
formRules: Partial<Record<keyof V, FormRules | naive_ui1.FormItemRule | naive_ui1.FormItemRule[]>>;
|
|
42
42
|
formProps: {
|
|
43
|
-
model:
|
|
44
|
-
rules:
|
|
43
|
+
model: vue59.Reactive<V>;
|
|
44
|
+
rules: vue59.Reactive<Partial<Record<keyof V, FormRules | naive_ui1.FormItemRule | naive_ui1.FormItemRule[]>>>;
|
|
45
45
|
};
|
|
46
46
|
setValue: (value: Partial<V>) => void;
|
|
47
47
|
validate: () => Promise<{
|
|
@@ -56,11 +56,11 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
56
56
|
} & {
|
|
57
57
|
footer?: (props: {
|
|
58
58
|
formInst: FormInst | null;
|
|
59
|
-
|
|
59
|
+
formValues: V;
|
|
60
60
|
formRules: Partial<Record<keyof V, FormRules | naive_ui1.FormItemRule | naive_ui1.FormItemRule[]>>;
|
|
61
61
|
formProps: {
|
|
62
|
-
model:
|
|
63
|
-
rules:
|
|
62
|
+
model: vue59.Reactive<V>;
|
|
63
|
+
rules: vue59.Reactive<Partial<Record<keyof V, FormRules | naive_ui1.FormItemRule | naive_ui1.FormItemRule[]>>>;
|
|
64
64
|
};
|
|
65
65
|
setValue: (value: Partial<V>) => void;
|
|
66
66
|
validate: () => Promise<{
|
|
@@ -74,7 +74,7 @@ declare const __VLS_export: <V extends DataObject>(__VLS_props: NonNullable<Awai
|
|
|
74
74
|
}) => any;
|
|
75
75
|
};
|
|
76
76
|
emit: (e: "validated", val: V) => void;
|
|
77
|
-
}>) =>
|
|
77
|
+
}>) => vue59.VNode & {
|
|
78
78
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
79
79
|
};
|
|
80
80
|
declare const _default: typeof __VLS_export;
|
|
@@ -41,7 +41,7 @@ type PresetFormOptions<V extends DataObject = DataObject> = PresetFormOptionItem
|
|
|
41
41
|
*/
|
|
42
42
|
type PresetFormProps<V extends DataObject = DataObject> = {
|
|
43
43
|
/** 表单选项 */options?: PresetFormOptions<V>; /** 表单值 */
|
|
44
|
-
|
|
44
|
+
values?: V; /** 验证规则 */
|
|
45
45
|
rules?: UseNaiveFormRules<V>; /** 清空规则 */
|
|
46
46
|
clearRules?: UseNaiveFormClearRules; /** 表单属性 */
|
|
47
47
|
formProps?: FormProps & ClassStyle; /** 网格属性 */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PresetInputProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue20 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: vue20.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
|
+
}>) => vue20.VNode & {
|
|
16
16
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
17
17
|
};
|
|
18
18
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,18 +1,18 @@
|
|
|
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 vue51 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: vue51.PublicProps & __VLS_PrettifyLocal<PresetPickerProps<V, R> & {
|
|
9
9
|
"onUpdate:value"?: ((val: V | null, raw: R | R[] | null) => any) | undefined;
|
|
10
10
|
onNegativeClick?: (() => any) | undefined;
|
|
11
11
|
onPositiveClick?: (() => any) | undefined;
|
|
12
12
|
}> & (typeof globalThis extends {
|
|
13
13
|
__VLS_PROPS_FALLBACK: infer P;
|
|
14
14
|
} ? P : {});
|
|
15
|
-
expose: (exposed:
|
|
15
|
+
expose: (exposed: vue51.ShallowUnwrapRef<PresetPickerExpose<R>>) => void;
|
|
16
16
|
attrs: any;
|
|
17
17
|
slots: {
|
|
18
18
|
'button-icon'?: (props: {}) => any;
|
|
@@ -49,7 +49,7 @@ declare const __VLS_export: <V extends PresetPickerValue, R extends DataObject>(
|
|
|
49
49
|
'modal-close'?: (props: {}) => any;
|
|
50
50
|
};
|
|
51
51
|
emit: PresetPickerEmits<V, R>;
|
|
52
|
-
}>) =>
|
|
52
|
+
}>) => vue51.VNode & {
|
|
53
53
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
54
54
|
};
|
|
55
55
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { DataObject } 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_core8 from "@vueuse/core";
|
|
4
|
+
import * as vue25 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:
|
|
10
|
-
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
9
|
+
props: vue25.PublicProps & __VLS_PrettifyLocal<PresetSelectProps<V, P, D, R> & {
|
|
11
10
|
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
11
|
+
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
12
12
|
"onUpdate:value"?: ((val: V | null, option: SelectOption | SelectOption[] | null, raw: R | R[] | null) => any) | undefined;
|
|
13
13
|
onSearch?: ((val: string) => any) | undefined;
|
|
14
|
+
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
14
15
|
onBefore?: ((params: P[]) => any) | undefined;
|
|
15
16
|
"onUpdate:show"?: ((show: boolean) => 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
|
}> & (typeof globalThis extends {
|
|
20
20
|
__VLS_PROPS_FALLBACK: infer P_1;
|
|
21
21
|
} ? P_1 : {});
|
|
22
|
-
expose: (exposed:
|
|
22
|
+
expose: (exposed: vue25.ShallowUnwrapRef<PresetSelectExpose<P, D, R>>) => void;
|
|
23
23
|
attrs: any;
|
|
24
24
|
slots: {
|
|
25
25
|
header?: (props: {
|
|
@@ -43,10 +43,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
43
43
|
setParams: (_params: Partial<P>) => void;
|
|
44
44
|
runParams: (_params: Partial<P>) => void;
|
|
45
45
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
46
|
-
onBefore:
|
|
47
|
-
onSuccess:
|
|
48
|
-
onError:
|
|
49
|
-
onFinally:
|
|
46
|
+
onBefore: _vueuse_core8.EventHookOn<[P[]]>;
|
|
47
|
+
onSuccess: _vueuse_core8.EventHookOn<[D, P[]]>;
|
|
48
|
+
onError: _vueuse_core8.EventHookOn<[Error, P[]]>;
|
|
49
|
+
onFinally: _vueuse_core8.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
50
50
|
}) => any;
|
|
51
51
|
} & {
|
|
52
52
|
footer?: (props: {
|
|
@@ -70,10 +70,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
70
70
|
setParams: (_params: Partial<P>) => void;
|
|
71
71
|
runParams: (_params: Partial<P>) => void;
|
|
72
72
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
73
|
-
onBefore:
|
|
74
|
-
onSuccess:
|
|
75
|
-
onError:
|
|
76
|
-
onFinally:
|
|
73
|
+
onBefore: _vueuse_core8.EventHookOn<[P[]]>;
|
|
74
|
+
onSuccess: _vueuse_core8.EventHookOn<[D, P[]]>;
|
|
75
|
+
onError: _vueuse_core8.EventHookOn<[Error, P[]]>;
|
|
76
|
+
onFinally: _vueuse_core8.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
77
77
|
}) => any;
|
|
78
78
|
} & {
|
|
79
79
|
'footer-extra'?: (props: {
|
|
@@ -97,10 +97,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
97
97
|
setParams: (_params: Partial<P>) => void;
|
|
98
98
|
runParams: (_params: Partial<P>) => void;
|
|
99
99
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
100
|
-
onBefore:
|
|
101
|
-
onSuccess:
|
|
102
|
-
onError:
|
|
103
|
-
onFinally:
|
|
100
|
+
onBefore: _vueuse_core8.EventHookOn<[P[]]>;
|
|
101
|
+
onSuccess: _vueuse_core8.EventHookOn<[D, P[]]>;
|
|
102
|
+
onError: _vueuse_core8.EventHookOn<[Error, P[]]>;
|
|
103
|
+
onFinally: _vueuse_core8.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
104
104
|
}) => any;
|
|
105
105
|
} & {
|
|
106
106
|
empty?: (props: {
|
|
@@ -124,10 +124,10 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
124
124
|
setParams: (_params: Partial<P>) => void;
|
|
125
125
|
runParams: (_params: Partial<P>) => void;
|
|
126
126
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
127
|
-
onBefore:
|
|
128
|
-
onSuccess:
|
|
129
|
-
onError:
|
|
130
|
-
onFinally:
|
|
127
|
+
onBefore: _vueuse_core8.EventHookOn<[P[]]>;
|
|
128
|
+
onSuccess: _vueuse_core8.EventHookOn<[D, P[]]>;
|
|
129
|
+
onError: _vueuse_core8.EventHookOn<[Error, P[]]>;
|
|
130
|
+
onFinally: _vueuse_core8.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
131
131
|
}) => any;
|
|
132
132
|
} & {
|
|
133
133
|
arrow?: (props: {
|
|
@@ -151,14 +151,14 @@ declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject,
|
|
|
151
151
|
setParams: (_params: Partial<P>) => void;
|
|
152
152
|
runParams: (_params: Partial<P>) => void;
|
|
153
153
|
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
154
|
-
onBefore:
|
|
155
|
-
onSuccess:
|
|
156
|
-
onError:
|
|
157
|
-
onFinally:
|
|
154
|
+
onBefore: _vueuse_core8.EventHookOn<[P[]]>;
|
|
155
|
+
onSuccess: _vueuse_core8.EventHookOn<[D, P[]]>;
|
|
156
|
+
onError: _vueuse_core8.EventHookOn<[Error, P[]]>;
|
|
157
|
+
onFinally: _vueuse_core8.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
158
158
|
}) => any;
|
|
159
159
|
};
|
|
160
160
|
emit: PresetSelectEmits<V, P, D, R>;
|
|
161
|
-
}>) =>
|
|
161
|
+
}>) => vue25.VNode & {
|
|
162
162
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
163
163
|
};
|
|
164
164
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { DataObject } 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 vue22 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:
|
|
9
|
-
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
8
|
+
props: vue22.PublicProps & __VLS_PrettifyLocal<RemoteRequestProps<P, D> & {
|
|
10
9
|
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
11
|
-
|
|
10
|
+
onSuccess?: ((data: D, 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: vue22.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
|
+
}>) => vue22.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 vue41 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: vue41.DefineComponent<SearchInputProps, {}, {}, {}, {}, vue41.ComponentOptionsMixin, vue41.ComponentOptionsMixin, {} & {
|
|
19
19
|
"update:value": (v: string | null | undefined) => any;
|
|
20
|
-
}, string,
|
|
20
|
+
}, string, vue41.PublicProps, Readonly<SearchInputProps> & Readonly<{
|
|
21
21
|
"onUpdate:value"?: ((v: string | null | undefined) => any) | undefined;
|
|
22
|
-
}>, {}, {}, {}, {}, string,
|
|
22
|
+
}>, {}, {}, {}, {}, string, vue41.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 & {
|
|
@@ -14,11 +14,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
14
14
|
const emit = __emit;
|
|
15
15
|
return (_ctx, _cache) => {
|
|
16
16
|
return openBlock(), createBlock(unref(NTooltip), normalizeProps(guardReactiveProps(__props.tooltipProps)), {
|
|
17
|
-
trigger: withCtx(() => [createVNode(unref(NButton), mergeProps(__props.buttonProps, { onClick: _cache[0] || (_cache[0] = (ev) => emit("click", ev)) }), {
|
|
17
|
+
trigger: withCtx(() => [renderSlot(_ctx.$slots, "trigger", {}, () => [createVNode(unref(NButton), mergeProps(__props.buttonProps, { onClick: _cache[0] || (_cache[0] = (ev) => emit("click", ev)) }), {
|
|
18
18
|
icon: withCtx(() => [renderSlot(_ctx.$slots, "icon")]),
|
|
19
19
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
20
20
|
_: 3
|
|
21
|
-
}, 16)]),
|
|
21
|
+
}, 16)])]),
|
|
22
22
|
default: withCtx(() => [renderSlot(_ctx.$slots, "tooltip", {}, () => [createTextVNode(toDisplayString(__props.tooltip), 1)])]),
|
|
23
23
|
_: 3
|
|
24
24
|
}, 16);
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { TooltipButtonProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue15 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/tooltip-button/TooltipButton.vue.d.ts
|
|
5
|
-
declare var
|
|
5
|
+
declare var __VLS_9: {}, __VLS_19: {}, __VLS_22: {}, __VLS_24: {};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
|
-
|
|
7
|
+
trigger?: (props: typeof __VLS_9) => any;
|
|
8
8
|
} & {
|
|
9
|
-
|
|
9
|
+
default?: (props: typeof __VLS_19) => any;
|
|
10
10
|
} & {
|
|
11
|
-
|
|
11
|
+
icon?: (props: typeof __VLS_22) => any;
|
|
12
|
+
} & {
|
|
13
|
+
tooltip?: (props: typeof __VLS_24) => any;
|
|
12
14
|
};
|
|
13
|
-
declare const __VLS_base:
|
|
15
|
+
declare const __VLS_base: vue15.DefineComponent<TooltipButtonProps, {}, {}, {}, {}, vue15.ComponentOptionsMixin, vue15.ComponentOptionsMixin, {} & {
|
|
14
16
|
click: (ev: MouseEvent) => any;
|
|
15
|
-
}, string,
|
|
17
|
+
}, string, vue15.PublicProps, Readonly<TooltipButtonProps> & Readonly<{
|
|
16
18
|
onClick?: ((ev: MouseEvent) => any) | undefined;
|
|
17
|
-
}>, {}, {}, {}, {}, string,
|
|
19
|
+
}>, {}, {}, {}, {}, string, vue15.ComponentProvideOptions, false, {}, any>;
|
|
18
20
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
21
|
declare const _default: typeof __VLS_export;
|
|
20
22
|
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 vue36 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: vue36.DefineComponent<TransitionProps$1, {}, {}, {}, {}, vue36.ComponentOptionsMixin, vue36.ComponentOptionsMixin, {}, string, vue36.PublicProps, Readonly<TransitionProps$1> & Readonly<{}>, {}, {}, {}, {}, string, vue36.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.js
CHANGED
|
@@ -2,6 +2,7 @@ import BaseTransition_default from "./components/transition/BaseTransition.js";
|
|
|
2
2
|
import LoadingProvider_default from "./components/loading-provider/LoadingProvider.js";
|
|
3
3
|
import { LOADING_PROVIDER_INJECTION_KEY } from "./components/loading-provider/index.js";
|
|
4
4
|
import ConfigProviders_default from "./components/config-providers/ConfigProviders.js";
|
|
5
|
+
import TooltipButton_default from "./components/tooltip-button/TooltipButton.js";
|
|
5
6
|
import CopyButton_default from "./components/copy-button/CopyButton.js";
|
|
6
7
|
import SearchInput_default from "./components/search-input/SearchInput.js";
|
|
7
8
|
import DataTablePlus_default from "./components/data-table-plus/DataTablePlus.js";
|
|
@@ -11,7 +12,6 @@ import PresetPicker_default from "./components/preset-picker/PresetPicker.js";
|
|
|
11
12
|
import PresetSelect_default from "./components/preset-select/PresetSelect.js";
|
|
12
13
|
import RemoteRequest_default from "./components/remote-request/RemoteRequest.js";
|
|
13
14
|
import ToggleInput_default from "./components/toggle-input/ToggleInput.js";
|
|
14
|
-
import TooltipButton_default from "./components/tooltip-button/TooltipButton.js";
|
|
15
15
|
import { ComponentAttrs, ComponentEmit, ComponentExposed, ComponentProps, ComponentSlots } from "vue-component-type-helpers";
|
|
16
16
|
|
|
17
17
|
export { ComponentAttrs, ComponentEmit, ComponentExposed, ComponentProps, ComponentSlots, LOADING_PROVIDER_INJECTION_KEY, ConfigProviders_default as NConfigProviders, CopyButton_default as NCopyButton, DataTablePlus_default as NDataTablePlus, LoadingProvider_default as NLoadingProvider, PresetForm_default as NPresetForm, PresetInput_default as NPresetInput, PresetPicker_default as NPresetPicker, PresetSelect_default as NPresetSelect, RemoteRequest_default as NRemoteRequest, SearchInput_default as NSearchInput, ToggleInput_default as NToggleInput, TooltipButton_default as NTooltipButton, BaseTransition_default as NTransition };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as _vueuse_core0 from "@vueuse/core";
|
|
2
2
|
import * as vue0 from "vue";
|
|
3
|
+
import { MaybeRefOrGetter } from "vue";
|
|
3
4
|
import { UseRequestOptions, UseRequestPlugin } from "vue-hooks-plus/es/useRequest/types";
|
|
4
5
|
|
|
5
6
|
//#region src/composables/use-data-request.d.ts
|
|
@@ -24,7 +25,7 @@ type DataRequestFields = Record<string, string | undefined> & {
|
|
|
24
25
|
* @template D 响应数据类型
|
|
25
26
|
*/
|
|
26
27
|
type UseDataRequestOptions<P extends DataObject = DataObject, D extends DataObject = DataObject> = {
|
|
27
|
-
/** 默认请求参数 */defaultParams?: Partial<P
|
|
28
|
+
/** 默认请求参数 */defaultParams?: MaybeRefOrGetter<Partial<P>>; /** 是否手动触发请求 */
|
|
28
29
|
manual?: boolean; /** 字段配置 */
|
|
29
30
|
fields?: DataRequestFields; /** useRequest 配置选项 */
|
|
30
31
|
requestOptions?: UseRequestOptions<D, P[]>; /** useRequest 插件 */
|
|
@@ -58,7 +59,7 @@ declare function useDataRequest<P extends DataObject = DataObject, D extends Dat
|
|
|
58
59
|
loading: Readonly<vue0.Ref<boolean, boolean>>;
|
|
59
60
|
data: Readonly<vue0.Ref<D | undefined, D | undefined>>;
|
|
60
61
|
error: Readonly<vue0.Ref<Error | undefined, Error | undefined>>;
|
|
61
|
-
params: Readonly<vue0.Ref<[] |
|
|
62
|
+
params: Readonly<vue0.Ref<P[] | [], P[] | []>>;
|
|
62
63
|
list: vue0.ComputedRef<R[]>;
|
|
63
64
|
pagination: vue0.Ref<{
|
|
64
65
|
page: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createEventHook } from "@vueuse/core";
|
|
2
|
-
import { computed, ref } from "vue";
|
|
2
|
+
import { computed, ref, toValue } from "vue";
|
|
3
3
|
import useRequest from "vue-hooks-plus/es/useRequest";
|
|
4
4
|
|
|
5
5
|
//#region src/composables/use-data-request.ts
|
|
@@ -29,8 +29,8 @@ function useDataRequest(api, options) {
|
|
|
29
29
|
...fields
|
|
30
30
|
};
|
|
31
31
|
const pagination = ref({
|
|
32
|
-
page:
|
|
33
|
-
pageSize:
|
|
32
|
+
page: 1,
|
|
33
|
+
pageSize: 10,
|
|
34
34
|
itemCount: 0
|
|
35
35
|
});
|
|
36
36
|
const onBeforeEvent = createEventHook();
|
|
@@ -39,9 +39,9 @@ function useDataRequest(api, options) {
|
|
|
39
39
|
const onFinallyEvent = createEventHook();
|
|
40
40
|
const { loading, data, error, params, run, runAsync, refresh, refreshAsync, cancel, mutate } = useRequest(api, {
|
|
41
41
|
defaultParams: [{
|
|
42
|
-
[_fields.page]:
|
|
43
|
-
[_fields.pageSize]:
|
|
44
|
-
...defaultParams
|
|
42
|
+
[_fields.page]: 1,
|
|
43
|
+
[_fields.pageSize]: 10,
|
|
44
|
+
...toValue(defaultParams)
|
|
45
45
|
}],
|
|
46
46
|
manual,
|
|
47
47
|
...requestOptions,
|
|
@@ -25,7 +25,7 @@ type UseNaiveFormRules<T extends DataObject> = Partial<Record<keyof T, FormRules
|
|
|
25
25
|
* @template T 表单值类型
|
|
26
26
|
*/
|
|
27
27
|
type UseNaiveFormOptions<T extends DataObject> = {
|
|
28
|
-
/** 表单初始值,支持响应式引用或普通值 */
|
|
28
|
+
/** 表单初始值,支持响应式引用或普通值 */values?: MaybeRefOrGetter<T>; /** 表单验证规则,支持响应式引用或普通值 */
|
|
29
29
|
rules?: MaybeRefOrGetter<UseNaiveFormRules<T>>; /** 表单清空规则 */
|
|
30
30
|
clearRules?: UseNaiveFormClearRules;
|
|
31
31
|
};
|
|
@@ -39,14 +39,14 @@ type UseNaiveFormOptions<T extends DataObject> = {
|
|
|
39
39
|
* ```ts
|
|
40
40
|
* const formRef = ref<FormInst>()
|
|
41
41
|
* const { formValue, formRules, formProps, validate, reset, clear } = useNaiveForm(formRef, {
|
|
42
|
-
*
|
|
42
|
+
* values: { name: '', age: 0 },
|
|
43
43
|
* rules: { name: { required: true, message: '请输入姓名' } }
|
|
44
44
|
* })
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
declare function useNaiveForm<T extends DataObject = DataObject>(formInstRef: TemplateRef<FormInst>, options?: UseNaiveFormOptions<T>): {
|
|
48
48
|
formInst: Readonly<vue5.ShallowRef<FormInst | null>>;
|
|
49
|
-
|
|
49
|
+
formValues: Ref<T, T>;
|
|
50
50
|
formRules: Ref<Partial<Record<keyof T, FormRules | FormItemRule | FormItemRule[]>>, Partial<Record<keyof T, FormRules | FormItemRule | FormItemRule[]>>>;
|
|
51
51
|
formProps: {
|
|
52
52
|
model: vue5.Reactive<T>;
|
|
@@ -29,24 +29,24 @@ function clearObjectValues(obj, rules) {
|
|
|
29
29
|
* ```ts
|
|
30
30
|
* const formRef = ref<FormInst>()
|
|
31
31
|
* const { formValue, formRules, formProps, validate, reset, clear } = useNaiveForm(formRef, {
|
|
32
|
-
*
|
|
32
|
+
* values: { name: '', age: 0 },
|
|
33
33
|
* rules: { name: { required: true, message: '请输入姓名' } }
|
|
34
34
|
* })
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
37
|
function useNaiveForm(formInstRef, options) {
|
|
38
|
-
const {
|
|
39
|
-
const cacheValue = cloneDeep(toValue(
|
|
40
|
-
const
|
|
38
|
+
const { values, rules, clearRules } = options ?? {};
|
|
39
|
+
const cacheValue = cloneDeep(toValue(values) ?? {});
|
|
40
|
+
const formValuesRef = ref(toValue(values) ?? {});
|
|
41
41
|
watchEffect(() => {
|
|
42
|
-
|
|
42
|
+
formValuesRef.value = toValue(values) ?? {};
|
|
43
43
|
});
|
|
44
44
|
const formRulesRef = ref(toValue(rules));
|
|
45
45
|
watchEffect(() => {
|
|
46
46
|
formRulesRef.value = toValue(rules) ?? {};
|
|
47
47
|
});
|
|
48
48
|
const formProps = {
|
|
49
|
-
model: reactive(
|
|
49
|
+
model: reactive(formValuesRef.value),
|
|
50
50
|
rules: reactive(formRulesRef.value)
|
|
51
51
|
};
|
|
52
52
|
const onValidatedEvent = createEventHook();
|
|
@@ -59,7 +59,7 @@ function useNaiveForm(formInstRef, options) {
|
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
61
|
function setValue(value) {
|
|
62
|
-
Object.assign(
|
|
62
|
+
Object.assign(formValuesRef.value, value);
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* 验证表单
|
|
@@ -77,7 +77,7 @@ function useNaiveForm(formInstRef, options) {
|
|
|
77
77
|
if (!formInstRef.value) throw new Error("useNaiveForm: formInstRef is not found.");
|
|
78
78
|
return new Promise((resolve, reject) => {
|
|
79
79
|
formInstRef.value?.validate().then((res) => {
|
|
80
|
-
onValidatedEvent.trigger(toRaw(toValue(
|
|
80
|
+
onValidatedEvent.trigger(toRaw(toValue(formValuesRef)));
|
|
81
81
|
return resolve(res);
|
|
82
82
|
}).catch(reject);
|
|
83
83
|
});
|
|
@@ -100,7 +100,7 @@ function useNaiveForm(formInstRef, options) {
|
|
|
100
100
|
* ```
|
|
101
101
|
*/
|
|
102
102
|
function clear() {
|
|
103
|
-
clearObjectValues(
|
|
103
|
+
clearObjectValues(formValuesRef.value, clearRules);
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
106
106
|
* 重置表单值到初始状态
|
|
@@ -111,7 +111,7 @@ function useNaiveForm(formInstRef, options) {
|
|
|
111
111
|
*/
|
|
112
112
|
function resetForm() {
|
|
113
113
|
clear();
|
|
114
|
-
Object.assign(
|
|
114
|
+
Object.assign(formValuesRef.value, cloneDeep(cacheValue));
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
117
|
* 重置表单验证状态和值
|
|
@@ -126,7 +126,7 @@ function useNaiveForm(formInstRef, options) {
|
|
|
126
126
|
}
|
|
127
127
|
return {
|
|
128
128
|
formInst: formInstRef,
|
|
129
|
-
|
|
129
|
+
formValues: formValuesRef,
|
|
130
130
|
formRules: formRulesRef,
|
|
131
131
|
formProps,
|
|
132
132
|
setValue,
|
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.80",
|
|
5
5
|
"description": "Some Composable Functions And Components for Vue 3",
|
|
6
6
|
"author": "oiij",
|
|
7
7
|
"license": "MIT",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"vue-component-type-helpers": "^3.2.4",
|
|
47
47
|
"vue-hooks-plus": "^2.4.1",
|
|
48
48
|
"vue-router": "^5.0.2",
|
|
49
|
-
"@oiij/
|
|
50
|
-
"@oiij/
|
|
49
|
+
"@oiij/css-render": "0.0.11",
|
|
50
|
+
"@oiij/use": "0.0.49"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/prismjs": "^1.26.5",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"vue-hooks-plus": "^2.4.1",
|
|
63
63
|
"vue-router": "^5.0.2",
|
|
64
64
|
"@oiij/css-render": "0.0.11",
|
|
65
|
-
"@oiij/use": "0.0.
|
|
65
|
+
"@oiij/use": "0.0.49"
|
|
66
66
|
},
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|