@oiij/naive-ui 0.0.1 → 0.0.3
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/README.md +4 -23
- package/dist/_virtual/rolldown_runtime.cjs +30 -0
- package/dist/components/_utils/cssr-bem.d.ts +1 -0
- package/dist/components/_utils/index.d.ts +3 -0
- package/dist/components/_utils/prismjs.d.ts +1 -0
- package/dist/components/_utils/transition.cssr.d.ts +10 -0
- package/dist/components/bubble/Bubble.vue.d.ts +26 -0
- package/dist/components/bubble/bubble.cssr.d.ts +2 -0
- package/dist/components/bubble/index.d.ts +16 -0
- package/dist/components/config-providers/ConfigProviders.vue.d.ts +18 -0
- package/dist/components/config-providers/index.d.ts +20 -0
- package/dist/components/copy-button/CopyButton.vue.d.ts +24 -0
- package/dist/components/copy-button/index.d.ts +9 -0
- package/dist/components/icons/MageCopyFill.vue.d.ts +2 -0
- package/dist/components/icons/RiSearch2Line.vue.d.ts +2 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/search-input/SearchInput.vue.d.ts +23 -0
- package/dist/components/search-input/index.d.ts +10 -0
- package/dist/components/tooltip-button/TooltipButton.vue.d.ts +24 -0
- package/dist/components/tooltip-button/index.d.ts +7 -0
- package/dist/components/type-writer/TypeWriter.vue.d.ts +17 -0
- package/dist/components/type-writer/index.d.ts +9 -0
- package/dist/components/type-writer/type-writer.cssr.d.ts +2 -0
- package/dist/components.cjs +38 -0
- package/dist/components.d.ts +1 -0
- package/dist/components.js +5686 -0
- package/dist/components.umd.cjs +38 -0
- package/dist/composables/useNaiveForm.cjs +61 -0
- package/dist/composables/useNaiveForm.d.cts +36 -0
- package/dist/composables/useNaiveForm.d.ts +36 -0
- package/dist/composables/useNaiveForm.js +60 -0
- package/dist/composables/useNaiveTheme.cjs +120 -0
- package/dist/composables/useNaiveTheme.d.cts +165 -0
- package/dist/composables/useNaiveTheme.d.ts +165 -0
- package/dist/composables/useNaiveTheme.js +119 -0
- package/dist/index.cjs +4 -172
- package/dist/index.d.cts +3 -178
- package/dist/index.d.ts +3 -178
- package/dist/index.js +3 -150
- package/package.json +72 -93
package/README.md
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Naive-UI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
- Bundle with [tsup](https://github.com/egoist/tsup)
|
|
6
|
-
- Test with [vitest](https://vitest.dev)
|
|
3
|
+
[](https://www.npmjs.com/package/@oiij/naive-ui)
|
|
4
|
+
[](https://github.com/Eiog/@oiij/naive-ui/blob/main/LICENSE)
|
|
7
5
|
|
|
8
6
|
## Usage
|
|
9
7
|
|
|
@@ -11,21 +9,4 @@ Features:
|
|
|
11
9
|
pnpm add @oiij/naive-ui
|
|
12
10
|
```
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
import { useNaiveForm, useNaiveTheme } from '@oiij/naive-ui'
|
|
16
|
-
const { theme, themeOverrides, locale, dateLocale, color, setColor, } = useNaiveTheme()
|
|
17
|
-
const { formRef, formProps, formValue, rules, validate, resetValidation, resetForm, reset, clear, } = useNaiveForm({
|
|
18
|
-
value: {
|
|
19
|
-
foo: ''
|
|
20
|
-
},
|
|
21
|
-
rules: {
|
|
22
|
-
foo: {
|
|
23
|
-
required: true
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
})
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## License
|
|
30
|
-
|
|
31
|
-
MIT
|
|
12
|
+
[在线文档](https://oiij-use.vercel.app/examples/naive-ui/started)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
|
|
25
|
+
Object.defineProperty(exports, '__toESM', {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return __toESM;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cssr: import('@oiij/css-render').CssRenderInstance, plugin: import('@oiij/css-render').CssRenderBemPlugin, namespace: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function highlight(code: string, lang: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CNode } from '@oiij/css-render';
|
|
2
|
+
interface FadeInTransitionOptions {
|
|
3
|
+
name?: string;
|
|
4
|
+
enterDuration?: string;
|
|
5
|
+
leaveDuration?: string;
|
|
6
|
+
enterCubicBezier?: string;
|
|
7
|
+
leaveCubicBezier?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function fadeInTransition({ name, enterDuration, leaveDuration, enterCubicBezier, leaveCubicBezier, }?: FadeInTransitionOptions): CNode[];
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BubbleProps } from './index';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
avatar?(_: {}): any;
|
|
6
|
+
header?(_: {}): any;
|
|
7
|
+
loading?(_: {}): any;
|
|
8
|
+
default?(_: {}): any;
|
|
9
|
+
footer?(_: {}): any;
|
|
10
|
+
};
|
|
11
|
+
refs: {};
|
|
12
|
+
rootEl: any;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
+
declare const __VLS_component: import('vue').DefineComponent<BubbleProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
16
|
+
typingComplete: () => any;
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<BubbleProps> & Readonly<{
|
|
18
|
+
onTypingComplete?: (() => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AvatarProps } from 'naive-ui';
|
|
2
|
+
import { CSSProperties, VNodeChild } from 'vue';
|
|
3
|
+
export { default as NBubble } from './Bubble.vue';
|
|
4
|
+
export interface 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';
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ConfigProvidersProps } from './index';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
refs: {};
|
|
8
|
+
rootEl: any;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<ConfigProvidersProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ConfigProvidersProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ConfigProviderProps, DialogProviderInst, DialogProviderProps, LoadingBarProviderInst, LoadingBarProviderProps, MessageProviderInst, MessageProviderProps, ModalProviderInst, ModalProviderProps, NotificationProviderInst, NotificationProviderProps } from 'naive-ui';
|
|
2
|
+
export { default as NConfigProviders } from './ConfigProviders.vue';
|
|
3
|
+
export interface ConfigProvidersProps {
|
|
4
|
+
globalStyle?: boolean;
|
|
5
|
+
configProviderProps?: ConfigProviderProps;
|
|
6
|
+
loadingBarProps?: LoadingBarProviderProps;
|
|
7
|
+
dialogProviderProps?: DialogProviderProps;
|
|
8
|
+
modalProviderProps?: ModalProviderProps;
|
|
9
|
+
notificationProviderProps?: NotificationProviderProps;
|
|
10
|
+
messageProviderProps?: MessageProviderProps;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
interface Window {
|
|
14
|
+
$dialog: DialogProviderInst;
|
|
15
|
+
$loadingBar: LoadingBarProviderInst;
|
|
16
|
+
$message: MessageProviderInst;
|
|
17
|
+
$modal: ModalProviderInst;
|
|
18
|
+
$notification: NotificationProviderInst;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CopyButtonProps } from './index';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
icon?(_: {}): any;
|
|
7
|
+
tooltip?(_: {}): any;
|
|
8
|
+
};
|
|
9
|
+
refs: {};
|
|
10
|
+
rootEl: any;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
+
declare const __VLS_component: import('vue').DefineComponent<CopyButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
14
|
+
copied: (v: string | undefined) => any;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<CopyButtonProps> & Readonly<{
|
|
16
|
+
onCopied?: ((v: string | undefined) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UseClipboardOptions } from '@vueuse/core';
|
|
2
|
+
import { ButtonProps, TooltipProps } from 'naive-ui';
|
|
3
|
+
export { default as NCopyButton } from './CopyButton.vue';
|
|
4
|
+
export interface CopyButtonProps {
|
|
5
|
+
value?: string;
|
|
6
|
+
config?: UseClipboardOptions<string | undefined>;
|
|
7
|
+
tooltipProps?: TooltipProps;
|
|
8
|
+
buttonProps?: ButtonProps;
|
|
9
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SearchInputProps } from './index';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
icon?(_: {}): any;
|
|
6
|
+
button?(_: {}): any;
|
|
7
|
+
};
|
|
8
|
+
refs: {};
|
|
9
|
+
rootEl: any;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
+
declare const __VLS_component: import('vue').DefineComponent<SearchInputProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
13
|
+
"update:value": (v: string | undefined) => any;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<SearchInputProps> & Readonly<{
|
|
15
|
+
"onUpdate:value"?: ((v: string | undefined) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ButtonProps, InputProps } from 'naive-ui';
|
|
2
|
+
export { default as NSearchInput } from './SearchInput.vue';
|
|
3
|
+
export interface SearchInputProps {
|
|
4
|
+
value?: string;
|
|
5
|
+
type?: ButtonProps['type'];
|
|
6
|
+
autoTrigger?: boolean | number;
|
|
7
|
+
searchButton?: boolean;
|
|
8
|
+
inputProps?: InputProps;
|
|
9
|
+
buttonProps?: ButtonProps;
|
|
10
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TooltipButtonProps } from './index';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
icon?(_: {}): any;
|
|
7
|
+
tooltip?(_: {}): any;
|
|
8
|
+
};
|
|
9
|
+
refs: {};
|
|
10
|
+
rootEl: any;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
+
declare const __VLS_component: import('vue').DefineComponent<TooltipButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
14
|
+
click: (ev: MouseEvent) => any;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<TooltipButtonProps> & Readonly<{
|
|
16
|
+
onClick?: ((ev: MouseEvent) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TypeWriterProps } from './index';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<TypeWriterProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
3
|
+
start: () => any;
|
|
4
|
+
update: (v: {
|
|
5
|
+
index: number;
|
|
6
|
+
value: string;
|
|
7
|
+
}) => any;
|
|
8
|
+
stop: (v: string) => any;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<TypeWriterProps> & Readonly<{
|
|
10
|
+
onStart?: (() => any) | undefined;
|
|
11
|
+
onUpdate?: ((v: {
|
|
12
|
+
index: number;
|
|
13
|
+
value: string;
|
|
14
|
+
}) => any) | undefined;
|
|
15
|
+
onStop?: ((v: string) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
export default _default;
|