@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
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Prism from "prismjs";
|
|
2
|
+
|
|
3
|
+
//#region src/components/_utils/prismjs.ts
|
|
4
|
+
if (typeof document !== "undefined") Prism.highlightAll();
|
|
5
|
+
function highlight(code, lang) {
|
|
6
|
+
try {
|
|
7
|
+
const grammar = Prism.languages[lang];
|
|
8
|
+
if (grammar) return `<pre class="language-${lang}"><code class="language-${lang}">${Prism.highlight(code, grammar || Prism.languages.text, lang)}</code></pre>`;
|
|
9
|
+
return code;
|
|
10
|
+
} catch {
|
|
11
|
+
return code;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { highlight };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import BaseTransition_default from "../transition/BaseTransition.js";
|
|
2
|
+
import TypeWriter_default from "../type-writer/TypeWriter.js";
|
|
3
|
+
import { bubbleCssr, cName } from "./bubble.cssr.js";
|
|
4
|
+
import { createBlock, createCommentVNode, createElementVNode, createVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, renderSlot, resolveDynamicComponent, unref, withCtx } from "vue";
|
|
5
|
+
import { NAvatar, NEl, NFlex, NSpin } from "naive-ui";
|
|
6
|
+
import { useStyle } from "@oiij/css-render";
|
|
7
|
+
|
|
8
|
+
//#region src/components/bubble/Bubble.vue
|
|
9
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
|
+
__name: "Bubble",
|
|
11
|
+
props: {
|
|
12
|
+
avatar: {},
|
|
13
|
+
content: {},
|
|
14
|
+
contentClass: {},
|
|
15
|
+
contentStyle: {},
|
|
16
|
+
loading: { type: Boolean },
|
|
17
|
+
typing: { type: Boolean },
|
|
18
|
+
markdown: { type: Boolean },
|
|
19
|
+
placement: {}
|
|
20
|
+
},
|
|
21
|
+
emits: ["typingComplete"],
|
|
22
|
+
setup(__props, { emit: __emit }) {
|
|
23
|
+
const emit = __emit;
|
|
24
|
+
useStyle("n-bubble", bubbleCssr());
|
|
25
|
+
return (_ctx, _cache) => {
|
|
26
|
+
return openBlock(), createBlock(unref(NEl), {
|
|
27
|
+
tag: "div",
|
|
28
|
+
class: normalizeClass([unref(cName), __props.placement === "end" ? `${unref(cName)}--reverse` : ""])
|
|
29
|
+
}, {
|
|
30
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "avatar", {}, () => [__props.avatar ? (openBlock(), createBlock(unref(NAvatar), mergeProps({
|
|
31
|
+
key: 0,
|
|
32
|
+
round: ""
|
|
33
|
+
}, __props.avatar.props), {
|
|
34
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.avatar.icon)))]),
|
|
35
|
+
_: 1
|
|
36
|
+
}, 16)) : createCommentVNode("v-if", true)]), createVNode(unref(NFlex), { vertical: "" }, {
|
|
37
|
+
default: withCtx(() => [
|
|
38
|
+
renderSlot(_ctx.$slots, "header"),
|
|
39
|
+
createVNode(unref(BaseTransition_default), null, {
|
|
40
|
+
default: withCtx(() => [__props.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }, () => [createVNode(unref(NSpin), { style: { "height": "44px" } })]) : renderSlot(_ctx.$slots, "default", { key: 1 }, () => [createElementVNode("div", {
|
|
41
|
+
class: normalizeClass([`${unref(cName)}__content`, __props.contentClass]),
|
|
42
|
+
style: normalizeStyle(__props.contentStyle)
|
|
43
|
+
}, [createVNode(unref(TypeWriter_default), {
|
|
44
|
+
typing: __props.typing,
|
|
45
|
+
markdown: __props.markdown,
|
|
46
|
+
value: __props.content,
|
|
47
|
+
onStop: _cache[0] || (_cache[0] = ($event) => emit("typingComplete"))
|
|
48
|
+
}, null, 8, [
|
|
49
|
+
"typing",
|
|
50
|
+
"markdown",
|
|
51
|
+
"value"
|
|
52
|
+
])], 6)])]),
|
|
53
|
+
_: 3
|
|
54
|
+
}),
|
|
55
|
+
renderSlot(_ctx.$slots, "footer")
|
|
56
|
+
]),
|
|
57
|
+
_: 3
|
|
58
|
+
})]),
|
|
59
|
+
_: 3
|
|
60
|
+
}, 8, ["class"]);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
var Bubble_default = _sfc_main;
|
|
65
|
+
|
|
66
|
+
//#endregion
|
|
67
|
+
export { Bubble_default as default };
|
|
@@ -1,49 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import * as vue25 from "vue";
|
|
2
|
+
import * as naive_ui15 from "naive-ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/bubble/Bubble.vue.d.ts
|
|
5
|
+
declare var __VLS_8: {}, __VLS_27: {}, __VLS_35: {}, __VLS_42: {}, __VLS_51: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
avatar?: (props: typeof __VLS_8) => any;
|
|
8
|
+
} & {
|
|
9
|
+
header?: (props: typeof __VLS_27) => any;
|
|
10
|
+
} & {
|
|
11
|
+
loading?: (props: typeof __VLS_35) => any;
|
|
12
|
+
} & {
|
|
13
|
+
default?: (props: typeof __VLS_42) => any;
|
|
14
|
+
} & {
|
|
15
|
+
footer?: (props: typeof __VLS_51) => any;
|
|
12
16
|
};
|
|
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
|
-
placement?: "start" | "end";
|
|
17
|
+
declare const __VLS_base: vue25.DefineComponent<{
|
|
18
|
+
avatar?: {
|
|
19
|
+
icon?: vue25.VNodeChild;
|
|
20
|
+
props?: naive_ui15.AvatarProps;
|
|
21
|
+
};
|
|
22
|
+
content?: string;
|
|
23
|
+
contentClass?: string;
|
|
24
|
+
contentStyle?: vue25.CSSProperties;
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
typing?: boolean;
|
|
27
|
+
markdown?: boolean;
|
|
28
|
+
placement?: "start" | "end";
|
|
29
|
+
}, {}, {}, {}, {}, vue25.ComponentOptionsMixin, vue25.ComponentOptionsMixin, {} & {
|
|
30
|
+
typingComplete: () => any;
|
|
31
|
+
}, string, vue25.PublicProps, Readonly<{
|
|
32
|
+
avatar?: {
|
|
33
|
+
icon?: vue25.VNodeChild;
|
|
34
|
+
props?: naive_ui15.AvatarProps;
|
|
35
|
+
};
|
|
36
|
+
content?: string;
|
|
37
|
+
contentClass?: string;
|
|
38
|
+
contentStyle?: vue25.CSSProperties;
|
|
39
|
+
loading?: boolean;
|
|
40
|
+
typing?: boolean;
|
|
41
|
+
markdown?: boolean;
|
|
42
|
+
placement?: "start" | "end";
|
|
40
43
|
}> & Readonly<{
|
|
41
|
-
|
|
42
|
-
}>, {}, {}, {}, {}, string,
|
|
43
|
-
declare const
|
|
44
|
-
|
|
45
|
-
type
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
onTypingComplete?: (() => any) | undefined;
|
|
45
|
+
}>, {}, {}, {}, {}, string, vue25.ComponentProvideOptions, false, {}, any>;
|
|
46
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
47
|
+
declare const _default: typeof __VLS_export;
|
|
48
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
49
|
+
new (): {
|
|
50
|
+
$slots: S;
|
|
51
|
+
};
|
|
49
52
|
};
|
|
53
|
+
//#endregion
|
|
54
|
+
export { _default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cssr, namespace, plugin } from "../_utils/cssr-bem.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/bubble/bubble.cssr.ts
|
|
4
|
+
const { c, cB, cE, cM } = {
|
|
5
|
+
...cssr,
|
|
6
|
+
...plugin
|
|
7
|
+
};
|
|
8
|
+
const cName = `${namespace}-bubble`;
|
|
9
|
+
function bubbleCssr() {
|
|
10
|
+
return c([cB("bubble", {
|
|
11
|
+
display: "flex",
|
|
12
|
+
gap: "10px",
|
|
13
|
+
fontSize: "var(--n-font-size);"
|
|
14
|
+
}, [cM("reverse", { flexDirection: "row-reverse" }), cE("content", {
|
|
15
|
+
backgroundColor: "var(--tag-color)",
|
|
16
|
+
padding: "10px",
|
|
17
|
+
borderRadius: "var(--border-radius)",
|
|
18
|
+
minHeight: "44px"
|
|
19
|
+
})])]);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { bubbleCssr, cName };
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CSSProperties, VNodeChild } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { _default } from "./Bubble.vue.js";
|
|
2
|
+
import { CSSProperties, VNodeChild } from "vue";
|
|
3
|
+
import { AvatarProps } from "naive-ui";
|
|
4
|
+
|
|
5
|
+
//#region src/components/bubble/index.d.ts
|
|
6
|
+
type BubbleProps = {
|
|
7
|
+
avatar?: {
|
|
8
|
+
icon?: VNodeChild;
|
|
9
|
+
props?: AvatarProps;
|
|
10
|
+
};
|
|
11
|
+
content?: string;
|
|
12
|
+
contentClass?: string;
|
|
13
|
+
contentStyle?: CSSProperties;
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
typing?: boolean;
|
|
16
|
+
markdown?: boolean;
|
|
17
|
+
placement?: 'start' | 'end';
|
|
16
18
|
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { BubbleProps };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import FullLoading_default from "../full-loading/FullLoading.js";
|
|
2
|
+
import { createBlock, createCommentVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, onMounted, openBlock, ref, renderSlot, unref, withCtx } from "vue";
|
|
3
|
+
import { NConfigProvider, NDialogProvider, NGlobalStyle, NLoadingBarProvider, NMessageProvider, NModalProvider, NNotificationProvider, useDialog, useLoadingBar, useMessage, useModal, useNotification } from "naive-ui";
|
|
4
|
+
|
|
5
|
+
//#region src/components/config-providers/ConfigProviders.vue
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "ConfigProviders",
|
|
8
|
+
props: {
|
|
9
|
+
globalStyle: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: false
|
|
12
|
+
},
|
|
13
|
+
configProviderProps: {},
|
|
14
|
+
loadingBarProps: {},
|
|
15
|
+
fullLoadingProps: {},
|
|
16
|
+
dialogProviderProps: {},
|
|
17
|
+
modalProviderProps: {},
|
|
18
|
+
notificationProviderProps: {},
|
|
19
|
+
messageProviderProps: {}
|
|
20
|
+
},
|
|
21
|
+
setup(__props) {
|
|
22
|
+
const globalLoading = ref(false);
|
|
23
|
+
function registerNaiveTools() {
|
|
24
|
+
window.$dialog = useDialog();
|
|
25
|
+
window.$loadingBar = useLoadingBar();
|
|
26
|
+
window.$message = useMessage();
|
|
27
|
+
window.$modal = useModal();
|
|
28
|
+
window.$notification = useNotification();
|
|
29
|
+
window.$loading = {
|
|
30
|
+
start: () => {
|
|
31
|
+
globalLoading.value = true;
|
|
32
|
+
},
|
|
33
|
+
finish: () => {
|
|
34
|
+
globalLoading.value = false;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const NaiveProviderContent = defineComponent({
|
|
39
|
+
setup() {
|
|
40
|
+
onMounted(() => {
|
|
41
|
+
registerNaiveTools();
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
render() {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return (_ctx, _cache) => {
|
|
49
|
+
return openBlock(), createBlock(unref(NConfigProvider), normalizeProps(guardReactiveProps(__props.configProviderProps)), {
|
|
50
|
+
default: withCtx(() => [
|
|
51
|
+
createVNode(unref(NLoadingBarProvider), normalizeProps(guardReactiveProps(__props.loadingBarProps)), {
|
|
52
|
+
default: withCtx(() => [createVNode(unref(NDialogProvider), normalizeProps(guardReactiveProps(__props.dialogProviderProps)), {
|
|
53
|
+
default: withCtx(() => [createVNode(unref(NModalProvider), normalizeProps(guardReactiveProps(__props.modalProviderProps)), {
|
|
54
|
+
default: withCtx(() => [createVNode(unref(NNotificationProvider), normalizeProps(guardReactiveProps(__props.notificationProviderProps)), {
|
|
55
|
+
default: withCtx(() => [createVNode(unref(NMessageProvider), normalizeProps(guardReactiveProps(__props.messageProviderProps)), {
|
|
56
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default"), createVNode(unref(NaiveProviderContent))]),
|
|
57
|
+
_: 3
|
|
58
|
+
}, 16)]),
|
|
59
|
+
_: 3
|
|
60
|
+
}, 16)]),
|
|
61
|
+
_: 3
|
|
62
|
+
}, 16)]),
|
|
63
|
+
_: 3
|
|
64
|
+
}, 16)]),
|
|
65
|
+
_: 3
|
|
66
|
+
}, 16),
|
|
67
|
+
__props.globalStyle ? (openBlock(), createBlock(unref(NGlobalStyle), { key: 0 })) : createCommentVNode("v-if", true),
|
|
68
|
+
createVNode(unref(FullLoading_default), mergeProps({ show: globalLoading.value }, __props.fullLoadingProps), null, 16, ["show"])
|
|
69
|
+
]),
|
|
70
|
+
_: 3
|
|
71
|
+
}, 16);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
var ConfigProviders_default = _sfc_main;
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
export { ConfigProviders_default as default };
|
|
@@ -1,35 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { ClassStyle } from "../data-table-plus/index.js";
|
|
2
|
+
import { FullLoadingProps } from "../full-loading/index.js";
|
|
3
|
+
import "../../components.js";
|
|
4
|
+
import * as vue18 from "vue";
|
|
5
|
+
import * as naive_ui3 from "naive-ui";
|
|
6
|
+
|
|
7
|
+
//#region src/components/config-providers/ConfigProviders.vue.d.ts
|
|
8
|
+
declare var __VLS_38: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_38) => any;
|
|
8
11
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
declare const _default:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
12
|
+
declare const __VLS_base: vue18.DefineComponent<{
|
|
13
|
+
globalStyle?: boolean;
|
|
14
|
+
configProviderProps?: naive_ui3.ConfigProviderProps & ClassStyle;
|
|
15
|
+
loadingBarProps?: naive_ui3.LoadingBarProviderProps & ClassStyle;
|
|
16
|
+
fullLoadingProps?: FullLoadingProps & ClassStyle;
|
|
17
|
+
dialogProviderProps?: naive_ui3.DialogProviderProps & ClassStyle;
|
|
18
|
+
modalProviderProps?: naive_ui3.ModalProviderProps & ClassStyle;
|
|
19
|
+
notificationProviderProps?: naive_ui3.NotificationProviderProps & ClassStyle;
|
|
20
|
+
messageProviderProps?: naive_ui3.MessageProviderProps & ClassStyle;
|
|
21
|
+
}, {}, {}, {}, {}, vue18.ComponentOptionsMixin, vue18.ComponentOptionsMixin, {}, string, vue18.PublicProps, Readonly<{
|
|
22
|
+
globalStyle?: boolean;
|
|
23
|
+
configProviderProps?: naive_ui3.ConfigProviderProps & ClassStyle;
|
|
24
|
+
loadingBarProps?: naive_ui3.LoadingBarProviderProps & ClassStyle;
|
|
25
|
+
fullLoadingProps?: FullLoadingProps & ClassStyle;
|
|
26
|
+
dialogProviderProps?: naive_ui3.DialogProviderProps & ClassStyle;
|
|
27
|
+
modalProviderProps?: naive_ui3.ModalProviderProps & ClassStyle;
|
|
28
|
+
notificationProviderProps?: naive_ui3.NotificationProviderProps & ClassStyle;
|
|
29
|
+
messageProviderProps?: naive_ui3.MessageProviderProps & ClassStyle;
|
|
30
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, vue18.ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
34
|
+
new (): {
|
|
35
|
+
$slots: S;
|
|
36
|
+
};
|
|
35
37
|
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { _default };
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { ClassStyle } from "../data-table-plus/index.js";
|
|
2
|
+
import { FullLoadingProps } from "../full-loading/index.js";
|
|
3
|
+
import { _default } from "./ConfigProviders.vue.js";
|
|
4
|
+
import { ConfigProviderProps, DialogProviderInst, DialogProviderProps, LoadingBarProviderInst, LoadingBarProviderProps, MessageProviderInst, MessageProviderProps, ModalProviderInst, ModalProviderProps, NotificationProviderInst, NotificationProviderProps } from "naive-ui";
|
|
5
|
+
|
|
6
|
+
//#region src/components/config-providers/index.d.ts
|
|
7
|
+
type ConfigProvidersProps = {
|
|
8
|
+
globalStyle?: boolean;
|
|
9
|
+
configProviderProps?: ConfigProviderProps & ClassStyle;
|
|
10
|
+
loadingBarProps?: LoadingBarProviderProps & ClassStyle;
|
|
11
|
+
fullLoadingProps?: FullLoadingProps & ClassStyle;
|
|
12
|
+
dialogProviderProps?: DialogProviderProps & ClassStyle;
|
|
13
|
+
modalProviderProps?: ModalProviderProps & ClassStyle;
|
|
14
|
+
notificationProviderProps?: NotificationProviderProps & ClassStyle;
|
|
15
|
+
messageProviderProps?: MessageProviderProps & ClassStyle;
|
|
14
16
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
type LoadingIns = {
|
|
18
|
+
start: () => void;
|
|
19
|
+
finish: () => void;
|
|
18
20
|
};
|
|
19
21
|
declare global {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
interface Window {
|
|
23
|
+
$dialog: DialogProviderInst;
|
|
24
|
+
$loading: LoadingIns;
|
|
25
|
+
$loadingBar: LoadingBarProviderInst;
|
|
26
|
+
$message: MessageProviderInst;
|
|
27
|
+
$modal: ModalProviderInst;
|
|
28
|
+
$notification: NotificationProviderInst;
|
|
29
|
+
}
|
|
28
30
|
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { ConfigProvidersProps, LoadingIns };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import MageCopyFill_default from "../icons/MageCopyFill.js";
|
|
2
|
+
import { useClipboard } from "@vueuse/core";
|
|
3
|
+
import { createBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, toDisplayString, unref, watch, withCtx } from "vue";
|
|
4
|
+
import { NButton, NTooltip } from "naive-ui";
|
|
5
|
+
|
|
6
|
+
//#region src/components/copy-button/CopyButton.vue
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "CopyButton",
|
|
9
|
+
props: {
|
|
10
|
+
value: {},
|
|
11
|
+
config: {},
|
|
12
|
+
tooltipProps: {},
|
|
13
|
+
buttonProps: {}
|
|
14
|
+
},
|
|
15
|
+
emits: ["copied"],
|
|
16
|
+
setup(__props, { emit: __emit }) {
|
|
17
|
+
const emit = __emit;
|
|
18
|
+
const { copied, copy } = useClipboard({
|
|
19
|
+
source: __props.value,
|
|
20
|
+
...__props.config
|
|
21
|
+
});
|
|
22
|
+
watch(copied, () => {
|
|
23
|
+
if (copied.value) emit("copied", __props.value);
|
|
24
|
+
});
|
|
25
|
+
function onClick(ev) {
|
|
26
|
+
ev.preventDefault();
|
|
27
|
+
copy();
|
|
28
|
+
}
|
|
29
|
+
return (_ctx, _cache) => {
|
|
30
|
+
return openBlock(), createBlock(unref(NTooltip), normalizeProps(guardReactiveProps(__props.tooltipProps)), {
|
|
31
|
+
trigger: withCtx(() => [createElementVNode("div", {
|
|
32
|
+
style: { cursor: "pointer" },
|
|
33
|
+
onClick
|
|
34
|
+
}, [renderSlot(_ctx.$slots, "default", {}, () => [createVNode(unref(NButton), mergeProps({
|
|
35
|
+
quaternary: "",
|
|
36
|
+
size: "tiny"
|
|
37
|
+
}, __props.buttonProps), {
|
|
38
|
+
icon: withCtx(() => [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(MageCopyFill_default)])]),
|
|
39
|
+
_: 3
|
|
40
|
+
}, 16)])])]),
|
|
41
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "tooltip", {}, () => [createTextVNode(toDisplayString(unref(copied) ? "复制成功" : "复制"), 1)])]),
|
|
42
|
+
_: 3
|
|
43
|
+
}, 16);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
var CopyButton_default = _sfc_main;
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { CopyButton_default as default };
|
|
@@ -1,33 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { ClassStyle } from "../data-table-plus/index.js";
|
|
2
|
+
import "../../components.js";
|
|
3
|
+
import * as _vueuse_core4 from "@vueuse/core";
|
|
4
|
+
import * as vue34 from "vue";
|
|
5
|
+
import * as naive_ui17 from "naive-ui";
|
|
6
|
+
|
|
7
|
+
//#region src/components/copy-button/CopyButton.vue.d.ts
|
|
8
|
+
declare var __VLS_9: {}, __VLS_18: {}, __VLS_25: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_9) => any;
|
|
11
|
+
} & {
|
|
12
|
+
icon?: (props: typeof __VLS_18) => any;
|
|
13
|
+
} & {
|
|
14
|
+
tooltip?: (props: typeof __VLS_25) => any;
|
|
10
15
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
buttonProps?: import('naive-ui').ButtonProps & import('..').ClassStyle;
|
|
16
|
+
declare const __VLS_base: vue34.DefineComponent<{
|
|
17
|
+
value?: string;
|
|
18
|
+
config?: _vueuse_core4.UseClipboardOptions<string | undefined>;
|
|
19
|
+
tooltipProps?: naive_ui17.TooltipProps & ClassStyle;
|
|
20
|
+
buttonProps?: naive_ui17.ButtonProps & ClassStyle;
|
|
21
|
+
}, {}, {}, {}, {}, vue34.ComponentOptionsMixin, vue34.ComponentOptionsMixin, {} & {
|
|
22
|
+
copied: (v: string | undefined) => any;
|
|
23
|
+
}, string, vue34.PublicProps, Readonly<{
|
|
24
|
+
value?: string;
|
|
25
|
+
config?: _vueuse_core4.UseClipboardOptions<string | undefined>;
|
|
26
|
+
tooltipProps?: naive_ui17.TooltipProps & ClassStyle;
|
|
27
|
+
buttonProps?: naive_ui17.ButtonProps & ClassStyle;
|
|
24
28
|
}> & Readonly<{
|
|
25
|
-
|
|
26
|
-
}>, {}, {}, {}, {}, string,
|
|
27
|
-
declare const
|
|
28
|
-
|
|
29
|
-
type
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
onCopied?: ((v: string | undefined) => any) | undefined;
|
|
30
|
+
}>, {}, {}, {}, {}, string, vue34.ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
34
|
+
new (): {
|
|
35
|
+
$slots: S;
|
|
36
|
+
};
|
|
33
37
|
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { _default };
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { ClassStyle } from "../data-table-plus/index.js";
|
|
2
|
+
import { _default } from "./CopyButton.vue.js";
|
|
3
|
+
import { UseClipboardOptions } from "@vueuse/core";
|
|
4
|
+
import { ButtonProps, TooltipProps } from "naive-ui";
|
|
5
|
+
|
|
6
|
+
//#region src/components/copy-button/index.d.ts
|
|
7
|
+
type CopyButtonProps = {
|
|
8
|
+
value?: string;
|
|
9
|
+
config?: UseClipboardOptions<string | undefined>;
|
|
10
|
+
tooltipProps?: TooltipProps & ClassStyle;
|
|
11
|
+
buttonProps?: ButtonProps & ClassStyle;
|
|
10
12
|
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { CopyButtonProps };
|