@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.
Files changed (87) hide show
  1. package/dist/_virtual/_/plugin-vue/export-helper.js +9 -0
  2. package/dist/components/_utils/cssr-bem.js +7 -0
  3. package/dist/components/_utils/prismjs.js +16 -0
  4. package/dist/components/bubble/Bubble.js +67 -0
  5. package/dist/components/bubble/Bubble.vue.d.ts +51 -46
  6. package/dist/components/bubble/bubble.cssr.js +23 -0
  7. package/dist/components/bubble/index.d.ts +19 -15
  8. package/dist/components/config-providers/ConfigProviders.js +78 -0
  9. package/dist/components/config-providers/ConfigProviders.vue.d.ts +37 -33
  10. package/dist/components/config-providers/index.d.ts +28 -24
  11. package/dist/components/copy-button/CopyButton.js +50 -0
  12. package/dist/components/copy-button/CopyButton.vue.d.ts +36 -30
  13. package/dist/components/copy-button/index.d.ts +13 -9
  14. package/dist/components/data-table-plus/DataTablePlus.js +374 -0
  15. package/dist/components/data-table-plus/DataTablePlus.vue.d.ts +365 -351
  16. package/dist/components/data-table-plus/index.d.ts +54 -48
  17. package/dist/components/full-loading/FullLoading.js +70 -0
  18. package/dist/components/full-loading/FullLoading.vue.d.ts +36 -32
  19. package/dist/components/full-loading/full-loading.cssr.js +22 -0
  20. package/dist/components/full-loading/index.d.ts +16 -12
  21. package/dist/components/icons/MageArrowUp.js +29 -0
  22. package/dist/components/icons/MageCopyFill.js +21 -0
  23. package/dist/components/icons/MageMultiplyCircleFill.js +21 -0
  24. package/dist/components/icons/MageSearch.js +25 -0
  25. package/dist/components/index.d.ts +31 -15
  26. package/dist/components/preset-form/PresetForm.js +176 -0
  27. package/dist/components/preset-form/PresetForm.vue.d.ts +82 -72
  28. package/dist/components/preset-form/_utils.js +16 -0
  29. package/dist/components/preset-form/index.d.ts +34 -29
  30. package/dist/components/preset-input/PresetInput.js +87 -0
  31. package/dist/components/preset-input/PresetInput.vue.d.ts +20 -15
  32. package/dist/components/preset-input/index.d.ts +147 -145
  33. package/dist/components/preset-picker/PresetPicker.js +213 -0
  34. package/dist/components/preset-picker/PresetPicker.vue.d.ts +62 -49
  35. package/dist/components/preset-picker/index.d.ts +56 -49
  36. package/dist/components/preset-select/PresetSelect.js +274 -0
  37. package/dist/components/preset-select/PresetSelect.vue.d.ts +190 -180
  38. package/dist/components/preset-select/index.d.ts +44 -38
  39. package/dist/components/remote-request/RemoteRequest.js +90 -0
  40. package/dist/components/remote-request/RemoteRequest.vue.d.ts +55 -49
  41. package/dist/components/remote-request/index.d.ts +23 -17
  42. package/dist/components/search-input/SearchInput.js +85 -0
  43. package/dist/components/search-input/SearchInput.vue.d.ts +48 -2332
  44. package/dist/components/search-input/index.d.ts +16 -12
  45. package/dist/components/toggle-input/ToggleInput.js +64 -0
  46. package/dist/components/toggle-input/ToggleInput.vue.d.ts +46 -0
  47. package/dist/components/toggle-input/index.d.ts +1 -0
  48. package/dist/components/tooltip-button/TooltipButton.js +31 -0
  49. package/dist/components/tooltip-button/TooltipButton.vue.d.ts +33 -28
  50. package/dist/components/tooltip-button/index.d.ts +11 -7
  51. package/dist/components/transition/BaseTransition.js +30 -0
  52. package/dist/components/transition/BaseTransition.vue.d.ts +23 -21
  53. package/dist/components/transition/index.d.ts +10 -6
  54. package/dist/components/transition/transition.cssr.js +20 -0
  55. package/dist/components/type-writer/TypeWriter.js +72 -0
  56. package/dist/components/type-writer/TypeWriter.vue.d.ts +34 -29
  57. package/dist/components/type-writer/index.d.ts +12 -8
  58. package/dist/components/type-writer/type-writer.cssr.js +27 -0
  59. package/dist/components.d.ts +33 -1
  60. package/dist/components.js +17 -7893
  61. package/dist/composables/{index.d.mts → index.d.ts} +3 -3
  62. package/dist/composables/{useNaiveForm.d.mts → useNaiveForm.d.ts} +1 -1
  63. package/dist/composables/{useNaiveTheme.d.mts → useNaiveTheme.d.ts} +1 -1
  64. package/dist/composables/{useNaiveTheme.mjs → useNaiveTheme.js} +1 -1
  65. package/dist/{index.d.mts → index.d.ts} +4 -4
  66. package/dist/index.js +5 -0
  67. package/package.json +14 -13
  68. package/dist/components/_utils/cssr-bem.d.ts +0 -1
  69. package/dist/components/_utils/index.d.ts +0 -2
  70. package/dist/components/_utils/prismjs.d.ts +0 -1
  71. package/dist/components/bubble/bubble.cssr.d.ts +0 -2
  72. package/dist/components/full-loading/full-loading.cssr.d.ts +0 -2
  73. package/dist/components/icons/MageArrowUp.vue.d.ts +0 -2
  74. package/dist/components/icons/MageCopyFill.vue.d.ts +0 -2
  75. package/dist/components/icons/MageMultiplyCircleFill.vue.d.ts +0 -2
  76. package/dist/components/icons/MageSearch.vue.d.ts +0 -2
  77. package/dist/components/preset-form/_utils.d.ts +0 -8
  78. package/dist/components/toggle-editor/ToggleEditor.vue.d.ts +0 -1159
  79. package/dist/components/toggle-editor/index.d.ts +0 -1
  80. package/dist/components/transition/transition.cssr.d.ts +0 -13
  81. package/dist/components/type-writer/type-writer.cssr.d.ts +0 -2
  82. package/dist/index.mjs +0 -5
  83. /package/dist/composables/{_helper.d.mts → _helper.d.ts} +0 -0
  84. /package/dist/composables/{_helper.mjs → _helper.js} +0 -0
  85. /package/dist/composables/{useDataRequest.d.mts → useDataRequest.d.ts} +0 -0
  86. /package/dist/composables/{useDataRequest.mjs → useDataRequest.js} +0 -0
  87. /package/dist/composables/{useNaiveForm.mjs → useNaiveForm.js} +0 -0
@@ -0,0 +1,9 @@
1
+ //#region \0/plugin-vue/export-helper
2
+ var export_helper_default = (sfc, props) => {
3
+ const target = sfc.__vccOpts || sfc;
4
+ for (const [key, val] of props) target[key] = val;
5
+ return target;
6
+ };
7
+
8
+ //#endregion
9
+ export { export_helper_default as default };
@@ -0,0 +1,7 @@
1
+ import { useBem } from "@oiij/css-render";
2
+
3
+ //#region src/components/_utils/cssr-bem.ts
4
+ const { cssr, plugin, namespace } = useBem();
5
+
6
+ //#endregion
7
+ export { cssr, namespace, plugin };
@@ -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
- declare function __VLS_template(): {
2
- attrs: Partial<{}>;
3
- slots: {
4
- avatar?(_: {}): any;
5
- header?(_: {}): any;
6
- loading?(_: {}): any;
7
- default?(_: {}): any;
8
- footer?(_: {}): any;
9
- };
10
- refs: {};
11
- rootEl: any;
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
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
- declare const __VLS_component: import('vue').DefineComponent<{
15
- avatar?: {
16
- icon?: import('vue').VNodeChild;
17
- props?: import('naive-ui').AvatarProps;
18
- };
19
- content?: string;
20
- contentClass?: string;
21
- contentStyle?: import('vue').CSSProperties;
22
- loading?: boolean;
23
- typing?: boolean;
24
- markdown?: boolean;
25
- placement?: "start" | "end";
26
- }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
27
- typingComplete: () => any;
28
- }, string, import('vue').PublicProps, Readonly<{
29
- avatar?: {
30
- icon?: import('vue').VNodeChild;
31
- props?: import('naive-ui').AvatarProps;
32
- };
33
- content?: string;
34
- contentClass?: string;
35
- contentStyle?: import('vue').CSSProperties;
36
- loading?: boolean;
37
- typing?: boolean;
38
- markdown?: boolean;
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
- onTypingComplete?: (() => any) | undefined;
42
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
43
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
44
- export default _default;
45
- type __VLS_WithTemplateSlots<T, S> = T & {
46
- new (): {
47
- $slots: S;
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 { AvatarProps } from 'naive-ui';
2
- import { CSSProperties, VNodeChild } from 'vue';
3
- export { default as NBubble } from './Bubble.vue';
4
- export type BubbleProps = {
5
- avatar?: {
6
- icon?: VNodeChild;
7
- props?: AvatarProps;
8
- };
9
- content?: string;
10
- contentClass?: string;
11
- contentStyle?: CSSProperties;
12
- loading?: boolean;
13
- typing?: boolean;
14
- markdown?: boolean;
15
- placement?: 'start' | 'end';
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
- declare function __VLS_template(): {
2
- attrs: Partial<{}>;
3
- slots: {
4
- default?(_: {}): any;
5
- };
6
- refs: {};
7
- rootEl: any;
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
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
- declare const __VLS_component: import('vue').DefineComponent<{
11
- globalStyle?: boolean;
12
- configProviderProps?: import('naive-ui').ConfigProviderProps & import('..').ClassStyle;
13
- loadingBarProps?: import('naive-ui').LoadingBarProviderProps & import('..').ClassStyle;
14
- fullLoadingProps?: import('../full-loading/index').FullLoadingProps & import('..').ClassStyle;
15
- dialogProviderProps?: import('naive-ui').DialogProviderProps & import('..').ClassStyle;
16
- modalProviderProps?: import('naive-ui').ModalProviderProps & import('..').ClassStyle;
17
- notificationProviderProps?: import('naive-ui').NotificationProviderProps & import('..').ClassStyle;
18
- messageProviderProps?: import('naive-ui').MessageProviderProps & import('..').ClassStyle;
19
- }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
20
- globalStyle?: boolean;
21
- configProviderProps?: import('naive-ui').ConfigProviderProps & import('..').ClassStyle;
22
- loadingBarProps?: import('naive-ui').LoadingBarProviderProps & import('..').ClassStyle;
23
- fullLoadingProps?: import('../full-loading/index').FullLoadingProps & import('..').ClassStyle;
24
- dialogProviderProps?: import('naive-ui').DialogProviderProps & import('..').ClassStyle;
25
- modalProviderProps?: import('naive-ui').ModalProviderProps & import('..').ClassStyle;
26
- notificationProviderProps?: import('naive-ui').NotificationProviderProps & import('..').ClassStyle;
27
- messageProviderProps?: import('naive-ui').MessageProviderProps & import('..').ClassStyle;
28
- }> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
29
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
30
- export default _default;
31
- type __VLS_WithTemplateSlots<T, S> = T & {
32
- new (): {
33
- $slots: S;
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 { ConfigProviderProps, DialogProviderInst, DialogProviderProps, LoadingBarProviderInst, LoadingBarProviderProps, MessageProviderInst, MessageProviderProps, ModalProviderInst, ModalProviderProps, NotificationProviderInst, NotificationProviderProps } from 'naive-ui';
2
- import { ClassStyle } from '../data-table-plus';
3
- import { FullLoadingProps } from '../full-loading/index';
4
- export { default as NConfigProviders } from './ConfigProviders.vue';
5
- export type ConfigProvidersProps = {
6
- globalStyle?: boolean;
7
- configProviderProps?: ConfigProviderProps & ClassStyle;
8
- loadingBarProps?: LoadingBarProviderProps & ClassStyle;
9
- fullLoadingProps?: FullLoadingProps & ClassStyle;
10
- dialogProviderProps?: DialogProviderProps & ClassStyle;
11
- modalProviderProps?: ModalProviderProps & ClassStyle;
12
- notificationProviderProps?: NotificationProviderProps & ClassStyle;
13
- messageProviderProps?: MessageProviderProps & ClassStyle;
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
- export type LoadingIns = {
16
- start: () => void;
17
- finish: () => void;
17
+ type LoadingIns = {
18
+ start: () => void;
19
+ finish: () => void;
18
20
  };
19
21
  declare global {
20
- interface Window {
21
- $dialog: DialogProviderInst;
22
- $loading: LoadingIns;
23
- $loadingBar: LoadingBarProviderInst;
24
- $message: MessageProviderInst;
25
- $modal: ModalProviderInst;
26
- $notification: NotificationProviderInst;
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
- declare function __VLS_template(): {
2
- attrs: Partial<{}>;
3
- slots: {
4
- default?(_: {}): any;
5
- icon?(_: {}): any;
6
- tooltip?(_: {}): any;
7
- };
8
- refs: {};
9
- rootEl: any;
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
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
- declare const __VLS_component: import('vue').DefineComponent<{
13
- value?: string;
14
- config?: import('@vueuse/core').UseClipboardOptions<string | undefined>;
15
- tooltipProps?: import('naive-ui').TooltipProps & import('..').ClassStyle;
16
- buttonProps?: import('naive-ui').ButtonProps & import('..').ClassStyle;
17
- }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
18
- copied: (v: string | undefined) => any;
19
- }, string, import('vue').PublicProps, Readonly<{
20
- value?: string;
21
- config?: import('@vueuse/core').UseClipboardOptions<string | undefined>;
22
- tooltipProps?: import('naive-ui').TooltipProps & import('..').ClassStyle;
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
- onCopied?: ((v: string | undefined) => any) | undefined;
26
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
27
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
28
- export default _default;
29
- type __VLS_WithTemplateSlots<T, S> = T & {
30
- new (): {
31
- $slots: S;
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 { UseClipboardOptions } from '@vueuse/core';
2
- import { ButtonProps, TooltipProps } from 'naive-ui';
3
- import { ClassStyle } from '../data-table-plus';
4
- export { default as NCopyButton } from './CopyButton.vue';
5
- export type CopyButtonProps = {
6
- value?: string;
7
- config?: UseClipboardOptions<string | undefined>;
8
- tooltipProps?: TooltipProps & ClassStyle;
9
- buttonProps?: ButtonProps & ClassStyle;
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 };