@oiij/naive-ui 0.0.64 → 0.0.66
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/_virtual/_/plugin-vue/export-helper.js +9 -0
- package/dist/components/_utils/cssr-bem.js +7 -0
- package/dist/components/_utils/prismjs.js +16 -0
- package/dist/components/bubble/Bubble.js +67 -0
- package/dist/components/bubble/Bubble.vue.d.ts +51 -46
- package/dist/components/bubble/bubble.cssr.js +23 -0
- package/dist/components/bubble/index.d.ts +19 -15
- package/dist/components/config-providers/ConfigProviders.js +78 -0
- package/dist/components/config-providers/ConfigProviders.vue.d.ts +37 -33
- package/dist/components/config-providers/index.d.ts +28 -24
- package/dist/components/copy-button/CopyButton.js +50 -0
- package/dist/components/copy-button/CopyButton.vue.d.ts +36 -30
- package/dist/components/copy-button/index.d.ts +13 -9
- package/dist/components/data-table-plus/DataTablePlus.js +374 -0
- package/dist/components/data-table-plus/DataTablePlus.vue.d.ts +365 -351
- package/dist/components/data-table-plus/index.d.ts +54 -48
- package/dist/components/full-loading/FullLoading.js +70 -0
- package/dist/components/full-loading/FullLoading.vue.d.ts +36 -32
- package/dist/components/full-loading/full-loading.cssr.js +22 -0
- package/dist/components/full-loading/index.d.ts +16 -12
- package/dist/components/icons/MageArrowUp.js +29 -0
- package/dist/components/icons/MageCopyFill.js +21 -0
- package/dist/components/icons/MageMultiplyCircleFill.js +21 -0
- package/dist/components/icons/MageSearch.js +25 -0
- package/dist/components/index.d.ts +31 -15
- package/dist/components/preset-form/PresetForm.js +176 -0
- package/dist/components/preset-form/PresetForm.vue.d.ts +82 -72
- package/dist/components/preset-form/_utils.js +16 -0
- package/dist/components/preset-form/index.d.ts +34 -29
- package/dist/components/preset-input/PresetInput.js +87 -0
- package/dist/components/preset-input/PresetInput.vue.d.ts +20 -15
- package/dist/components/preset-input/index.d.ts +147 -145
- package/dist/components/preset-picker/PresetPicker.js +213 -0
- package/dist/components/preset-picker/PresetPicker.vue.d.ts +62 -49
- package/dist/components/preset-picker/index.d.ts +56 -49
- package/dist/components/preset-select/PresetSelect.js +274 -0
- package/dist/components/preset-select/PresetSelect.vue.d.ts +190 -180
- package/dist/components/preset-select/index.d.ts +44 -38
- package/dist/components/remote-request/RemoteRequest.js +90 -0
- package/dist/components/remote-request/RemoteRequest.vue.d.ts +55 -49
- package/dist/components/remote-request/index.d.ts +23 -17
- package/dist/components/search-input/SearchInput.js +85 -0
- package/dist/components/search-input/SearchInput.vue.d.ts +48 -2332
- package/dist/components/search-input/index.d.ts +16 -12
- package/dist/components/toggle-input/ToggleInput.js +64 -0
- package/dist/components/toggle-input/ToggleInput.vue.d.ts +46 -0
- package/dist/components/toggle-input/index.d.ts +1 -0
- package/dist/components/tooltip-button/TooltipButton.js +31 -0
- package/dist/components/tooltip-button/TooltipButton.vue.d.ts +33 -28
- package/dist/components/tooltip-button/index.d.ts +11 -7
- package/dist/components/transition/BaseTransition.js +30 -0
- package/dist/components/transition/BaseTransition.vue.d.ts +23 -21
- package/dist/components/transition/index.d.ts +10 -6
- package/dist/components/transition/transition.cssr.js +20 -0
- package/dist/components/type-writer/TypeWriter.js +72 -0
- package/dist/components/type-writer/TypeWriter.vue.d.ts +34 -29
- package/dist/components/type-writer/index.d.ts +12 -8
- package/dist/components/type-writer/type-writer.cssr.js +27 -0
- package/dist/components.d.ts +33 -1
- package/dist/components.js +17 -7893
- package/dist/composables/{index.d.mts → index.d.ts} +3 -3
- package/dist/composables/{useNaiveForm.d.mts → useNaiveForm.d.ts} +1 -1
- package/dist/composables/{useNaiveTheme.d.mts → useNaiveTheme.d.ts} +1 -1
- package/dist/composables/{useNaiveTheme.mjs → useNaiveTheme.js} +1 -1
- package/dist/{index.d.mts → index.d.ts} +4 -4
- package/dist/index.js +5 -0
- package/package.json +14 -13
- package/dist/components/_utils/cssr-bem.d.ts +0 -1
- package/dist/components/_utils/index.d.ts +0 -2
- package/dist/components/_utils/prismjs.d.ts +0 -1
- package/dist/components/bubble/bubble.cssr.d.ts +0 -2
- package/dist/components/full-loading/full-loading.cssr.d.ts +0 -2
- package/dist/components/icons/MageArrowUp.vue.d.ts +0 -2
- package/dist/components/icons/MageCopyFill.vue.d.ts +0 -2
- package/dist/components/icons/MageMultiplyCircleFill.vue.d.ts +0 -2
- package/dist/components/icons/MageSearch.vue.d.ts +0 -2
- package/dist/components/preset-form/_utils.d.ts +0 -8
- package/dist/components/toggle-editor/ToggleEditor.vue.d.ts +0 -1159
- package/dist/components/toggle-editor/index.d.ts +0 -1
- package/dist/components/transition/transition.cssr.d.ts +0 -13
- package/dist/components/type-writer/type-writer.cssr.d.ts +0 -2
- package/dist/index.mjs +0 -5
- /package/dist/composables/{_helper.d.mts → _helper.d.ts} +0 -0
- /package/dist/composables/{_helper.mjs → _helper.js} +0 -0
- /package/dist/composables/{useDataRequest.d.mts → useDataRequest.d.ts} +0 -0
- /package/dist/composables/{useDataRequest.mjs → useDataRequest.js} +0 -0
- /package/dist/composables/{useNaiveForm.mjs → useNaiveForm.js} +0 -0
|
@@ -1,50 +1,56 @@
|
|
|
1
|
-
import { DataObject } from
|
|
2
|
-
import { RemoteRequestEmits, RemoteRequestExpose, RemoteRequestProps } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
import { DataObject } from "../../composables/useDataRequest.js";
|
|
2
|
+
import { RemoteRequestEmits, RemoteRequestExpose, RemoteRequestProps } from "./index.js";
|
|
3
|
+
import * as _vueuse_core57 from "@vueuse/core";
|
|
4
|
+
import * as vue68 from "vue";
|
|
5
|
+
|
|
6
|
+
//#region src/components/remote-request/RemoteRequest.vue.d.ts
|
|
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: __VLS_PrettifyLocal<RemoteRequestProps<P, D> & {
|
|
9
|
+
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
10
|
+
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
11
|
+
onBefore?: ((params: P[]) => any) | undefined;
|
|
12
|
+
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
13
|
+
}> & vue68.PublicProps & (typeof globalThis extends {
|
|
14
|
+
__VLS_PROPS_FALLBACK: infer P_1;
|
|
15
|
+
} ? P_1 : {});
|
|
16
|
+
expose: (exposed: vue68.ShallowUnwrapRef<RemoteRequestExpose<P, D, R>>) => void;
|
|
17
|
+
attrs: any;
|
|
18
|
+
slots: {
|
|
19
|
+
default?: (props: {
|
|
20
|
+
loading: boolean;
|
|
21
|
+
data: D | undefined;
|
|
22
|
+
error: Error | undefined;
|
|
23
|
+
params: [] | P[];
|
|
24
|
+
list: R[];
|
|
25
|
+
pagination: {
|
|
26
|
+
page: number;
|
|
27
|
+
pageSize: number;
|
|
28
|
+
itemCount: number;
|
|
29
|
+
} | {
|
|
30
|
+
page: number;
|
|
31
|
+
pageSize: number;
|
|
32
|
+
itemCount: number;
|
|
33
|
+
};
|
|
34
|
+
run: (...params: P[]) => void;
|
|
35
|
+
runAsync: (...params: P[]) => Promise<D>;
|
|
36
|
+
refresh: () => void;
|
|
37
|
+
refreshAsync: () => Promise<D>;
|
|
38
|
+
cancel: () => void;
|
|
39
|
+
mutate: (data?: D | ((oldData?: D | undefined) => D | undefined) | undefined) => void;
|
|
40
|
+
setParams: (_params: Partial<P>) => void;
|
|
41
|
+
runParams: (_params: Partial<P>) => void;
|
|
42
|
+
runParamsAsync: (_params: Partial<P>) => Promise<D>;
|
|
43
|
+
onBefore: _vueuse_core57.EventHookOn<[P[]]>;
|
|
44
|
+
onSuccess: _vueuse_core57.EventHookOn<[D, P[]]>;
|
|
45
|
+
onError: _vueuse_core57.EventHookOn<[Error, P[]]>;
|
|
46
|
+
onFinally: _vueuse_core57.EventHookOn<[P[], D | undefined, Error | undefined]>;
|
|
47
|
+
}) => any;
|
|
48
|
+
};
|
|
49
|
+
emit: RemoteRequestEmits<P, D>;
|
|
50
|
+
}>) => vue68.VNode & {
|
|
51
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
46
52
|
};
|
|
47
|
-
|
|
48
|
-
type __VLS_PrettifyLocal<T> = {
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
declare const _default: typeof __VLS_export;
|
|
54
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
55
|
+
//#endregion
|
|
56
|
+
export { _default };
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { DataObject, DataRequestFields, UseDataRequestReturns } from "../../composables/useDataRequest.js";
|
|
2
|
+
import { _default } from "./RemoteRequest.vue.js";
|
|
3
|
+
import { ComponentExposed } from "vue-component-type-helpers";
|
|
4
|
+
import { UseRequestOptions, UseRequestPlugin } from "vue-hooks-plus/es/useRequest/types";
|
|
5
|
+
|
|
6
|
+
//#region src/components/remote-request/index.d.ts
|
|
7
|
+
type RemoteRequestFields = DataRequestFields & {};
|
|
8
|
+
type RemoteRequestExpose<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = UseDataRequestReturns<P, D, R>;
|
|
9
|
+
type RemoteRequestProps<P extends DataObject = DataObject, D extends DataObject = DataObject> = {
|
|
10
|
+
api: (...args: P[]) => Promise<D>;
|
|
11
|
+
defaultParams?: Partial<P>;
|
|
12
|
+
manual?: boolean;
|
|
13
|
+
fields?: RemoteRequestFields;
|
|
14
|
+
requestOptions?: UseRequestOptions<D, P[]>;
|
|
15
|
+
requestPlugins?: UseRequestPlugin<D, P[]>[];
|
|
13
16
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
type RemoteRequestEmits<P extends DataObject = DataObject, D extends DataObject = DataObject> = {
|
|
18
|
+
(e: 'before', params: P[]): void;
|
|
19
|
+
(e: 'success', data: D, params: P[]): void;
|
|
20
|
+
(e: 'error', err: Error, params: P[]): void;
|
|
21
|
+
(e: 'finally', params: P[], data?: D, err?: Error): void;
|
|
19
22
|
};
|
|
23
|
+
type RemoteRequestInst = ComponentExposed<typeof _default>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { RemoteRequestEmits, RemoteRequestExpose, RemoteRequestFields, RemoteRequestInst, RemoteRequestProps };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import MageSearch_default from "../icons/MageSearch.js";
|
|
2
|
+
import { useDebounceFn, useTimeoutFn } from "@vueuse/core";
|
|
3
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createSlots, createTextVNode, createVNode, defineComponent, mergeProps, openBlock, ref, renderSlot, unref, useTemplateRef, watch, watchEffect, withCtx } from "vue";
|
|
4
|
+
import { NButton, NInput, NInputGroup } from "naive-ui";
|
|
5
|
+
|
|
6
|
+
//#region src/components/search-input/SearchInput.vue
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "SearchInput",
|
|
9
|
+
props: {
|
|
10
|
+
value: {},
|
|
11
|
+
type: {},
|
|
12
|
+
placeholder: { default: "Type A Search" },
|
|
13
|
+
loading: { type: Boolean },
|
|
14
|
+
autoTrigger: {
|
|
15
|
+
type: [Boolean, Number],
|
|
16
|
+
default: true
|
|
17
|
+
},
|
|
18
|
+
searchButton: { type: [String, Boolean] },
|
|
19
|
+
inputProps: {},
|
|
20
|
+
buttonProps: {}
|
|
21
|
+
},
|
|
22
|
+
emits: ["update:value"],
|
|
23
|
+
setup(__props, { emit: __emit }) {
|
|
24
|
+
const emit = __emit;
|
|
25
|
+
const inputRef = useTemplateRef("input-ref");
|
|
26
|
+
const _value = ref(__props.value ?? null);
|
|
27
|
+
const _searchButtonType = computed(() => typeof __props.searchButton === "boolean" ? "text" : __props.searchButton);
|
|
28
|
+
const { start } = useTimeoutFn(() => {}, typeof __props.autoTrigger === "number" ? __props.autoTrigger : 500);
|
|
29
|
+
watchEffect(() => {
|
|
30
|
+
_value.value = __props.value ?? null;
|
|
31
|
+
});
|
|
32
|
+
const debounceEmit = useDebounceFn(() => {
|
|
33
|
+
emit("update:value", _value.value);
|
|
34
|
+
}, typeof __props.autoTrigger === "number" ? __props.autoTrigger : 500);
|
|
35
|
+
watch(_value, () => {
|
|
36
|
+
start();
|
|
37
|
+
if (__props.autoTrigger) debounceEmit();
|
|
38
|
+
});
|
|
39
|
+
function handleClick() {
|
|
40
|
+
emit("update:value", _value.value);
|
|
41
|
+
}
|
|
42
|
+
function handleKeyDown(e) {
|
|
43
|
+
if (e.key === "Enter") handleClick();
|
|
44
|
+
}
|
|
45
|
+
watchEffect(() => {
|
|
46
|
+
if (!__props.loading && _value.value) inputRef.value?.focus();
|
|
47
|
+
});
|
|
48
|
+
return (_ctx, _cache) => {
|
|
49
|
+
return openBlock(), createBlock(unref(NInputGroup), null, {
|
|
50
|
+
default: withCtx(() => [createVNode(unref(NInput), mergeProps({
|
|
51
|
+
ref: "input-ref",
|
|
52
|
+
value: _value.value,
|
|
53
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => _value.value = $event),
|
|
54
|
+
clearable: "",
|
|
55
|
+
placeholder: __props.placeholder
|
|
56
|
+
}, __props.inputProps, { onKeydown: handleKeyDown }), {
|
|
57
|
+
prefix: withCtx(() => [renderSlot(_ctx.$slots, "prefix", {}, () => [renderSlot(_ctx.$slots, "prefix-icon", {}, () => [createVNode(MageSearch_default, { style: {
|
|
58
|
+
"width": "18px",
|
|
59
|
+
"height": "18px"
|
|
60
|
+
} })])])]),
|
|
61
|
+
_: 3
|
|
62
|
+
}, 16, ["value", "placeholder"]), renderSlot(_ctx.$slots, "button", {
|
|
63
|
+
value: __props.value,
|
|
64
|
+
loading: __props.loading
|
|
65
|
+
}, () => [_searchButtonType.value ? (openBlock(), createBlock(unref(NButton), mergeProps({
|
|
66
|
+
key: 0,
|
|
67
|
+
type: __props.type,
|
|
68
|
+
loading: __props.loading
|
|
69
|
+
}, __props.buttonProps, { onClick: handleClick }), createSlots({
|
|
70
|
+
default: withCtx(() => [_searchButtonType.value === "text" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" 搜索 ")], 64)) : createCommentVNode("v-if", true)]),
|
|
71
|
+
_: 2
|
|
72
|
+
}, [_searchButtonType.value === "icon" ? {
|
|
73
|
+
name: "icon",
|
|
74
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "button-icon", {}, () => [createVNode(MageSearch_default)])]),
|
|
75
|
+
key: "0"
|
|
76
|
+
} : void 0]), 1040, ["type", "loading"])) : createCommentVNode("v-if", true)])]),
|
|
77
|
+
_: 3
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
var SearchInput_default = _sfc_main;
|
|
83
|
+
|
|
84
|
+
//#endregion
|
|
85
|
+
export { SearchInput_default as default };
|