yangs-ui 0.0.1 → 0.0.2
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/es/button/index.d.ts +33 -0
- package/es/button/src/button.d.ts +6 -0
- package/es/button/src/button.vue.d.ts +21 -0
- package/es/icon/index.d.ts +33 -0
- package/es/icon/src/icon.d.ts +23 -0
- package/es/icon/src/icon.vue.d.ts +21 -0
- package/es/index.d.ts +7 -0
- package/lib/button/index.d.ts +33 -0
- package/lib/button/src/button.d.ts +6 -0
- package/lib/button/src/button.vue.d.ts +21 -0
- package/lib/component.d.ts +3 -0
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/key.d.ts +1 -0
- package/lib/icon/index.d.ts +33 -0
- package/lib/icon/src/icon.d.ts +23 -0
- package/lib/icon/src/icon.vue.d.ts +21 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.prod.d.ts +8 -0
- package/lib/make-install.d.ts +4 -0
- package/lib/theme-chalk/src/index.d.ts +0 -0
- package/lib/utils/create.d.ts +20 -0
- package/lib/utils/with-install.d.ts +3 -0
- package/package.json +2 -6
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const YButton: import('@yangs-ui/utils/with-install').SFCWithInstall<{
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
3
|
+
readonly color: StringConstructor;
|
|
4
|
+
readonly size: import('vue').PropType<number | string>;
|
|
5
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
6
|
+
P: {};
|
|
7
|
+
B: {};
|
|
8
|
+
D: {};
|
|
9
|
+
C: {};
|
|
10
|
+
M: {};
|
|
11
|
+
Defaults: {};
|
|
12
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
13
|
+
readonly color: StringConstructor;
|
|
14
|
+
readonly size: import('vue').PropType<number | string>;
|
|
15
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
16
|
+
__isFragment?: never;
|
|
17
|
+
__isTeleport?: never;
|
|
18
|
+
__isSuspense?: never;
|
|
19
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
+
readonly color: StringConstructor;
|
|
21
|
+
readonly size: import('vue').PropType<number | string>;
|
|
22
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
23
|
+
$slots: {
|
|
24
|
+
default?: (props: {}) => any;
|
|
25
|
+
};
|
|
26
|
+
})>;
|
|
27
|
+
export default YButton;
|
|
28
|
+
export * from './src/button';
|
|
29
|
+
declare module "vue" {
|
|
30
|
+
interface GlobalComponents {
|
|
31
|
+
YButton: typeof YButton;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const __VLS_template: () => {
|
|
2
|
+
__VLS_Slots: {
|
|
3
|
+
default?: (props: {}) => any;
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
7
|
+
declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
8
|
+
readonly color: StringConstructor;
|
|
9
|
+
readonly size: import('vue').PropType<number | string>;
|
|
10
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
11
|
+
readonly color: StringConstructor;
|
|
12
|
+
readonly size: import('vue').PropType<number | string>;
|
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const YIcon: import('@yangs-ui/utils/with-install').SFCWithInstall<{
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
3
|
+
readonly color: StringConstructor;
|
|
4
|
+
readonly size: import('vue').PropType<number | string>;
|
|
5
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
6
|
+
P: {};
|
|
7
|
+
B: {};
|
|
8
|
+
D: {};
|
|
9
|
+
C: {};
|
|
10
|
+
M: {};
|
|
11
|
+
Defaults: {};
|
|
12
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
13
|
+
readonly color: StringConstructor;
|
|
14
|
+
readonly size: import('vue').PropType<number | string>;
|
|
15
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
16
|
+
__isFragment?: never;
|
|
17
|
+
__isTeleport?: never;
|
|
18
|
+
__isSuspense?: never;
|
|
19
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
+
readonly color: StringConstructor;
|
|
21
|
+
readonly size: import('vue').PropType<number | string>;
|
|
22
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
23
|
+
$slots: {
|
|
24
|
+
default?: (props: {}) => any;
|
|
25
|
+
};
|
|
26
|
+
})>;
|
|
27
|
+
export default YIcon;
|
|
28
|
+
export * from './src/icon';
|
|
29
|
+
declare module "vue" {
|
|
30
|
+
interface GlobalComponents {
|
|
31
|
+
YIcon: typeof YIcon;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
export declare const iconProps: {
|
|
3
|
+
readonly color: StringConstructor;
|
|
4
|
+
readonly size: PropType<number | string>;
|
|
5
|
+
};
|
|
6
|
+
export type IconProps = ExtractPropTypes<typeof iconProps>;
|
|
7
|
+
/**
|
|
8
|
+
* const iconProps = {
|
|
9
|
+
color: String,
|
|
10
|
+
size: [Number, String]
|
|
11
|
+
};
|
|
12
|
+
这种写法是在vue组件中定义props时的写法,运行时的写法,只能写一个构造函数。String,Number本身也是构造函数
|
|
13
|
+
|
|
14
|
+
为什么使用as const。ts的类型
|
|
15
|
+
让所有属性变为readonly
|
|
16
|
+
不能直接赋值 iconProps.color = String; // 报错,因为color是readonly属性
|
|
17
|
+
|
|
18
|
+
as PropType<number | string> ts的类型
|
|
19
|
+
返回一个构造函数(构造函数的返回值为number|string)
|
|
20
|
+
如果color是一个对象,可以指定具体对象的属性类型 color: Object as PropType<{ name: string; age: number }>
|
|
21
|
+
如果color是一个函数,color: Function as PropType<(val: string) => void>
|
|
22
|
+
让ExtractPropTypes更好的推导类型,避免手动定义类型
|
|
23
|
+
*/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const __VLS_template: () => {
|
|
2
|
+
__VLS_Slots: {
|
|
3
|
+
default?: (props: {}) => any;
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
7
|
+
declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
8
|
+
readonly color: StringConstructor;
|
|
9
|
+
readonly size: import('vue').PropType<number | string>;
|
|
10
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
11
|
+
readonly color: StringConstructor;
|
|
12
|
+
readonly size: import('vue').PropType<number | string>;
|
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const YButton: import('@yangs-ui/utils/with-install').SFCWithInstall<{
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
3
|
+
readonly color: StringConstructor;
|
|
4
|
+
readonly size: import('vue').PropType<number | string>;
|
|
5
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
6
|
+
P: {};
|
|
7
|
+
B: {};
|
|
8
|
+
D: {};
|
|
9
|
+
C: {};
|
|
10
|
+
M: {};
|
|
11
|
+
Defaults: {};
|
|
12
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
13
|
+
readonly color: StringConstructor;
|
|
14
|
+
readonly size: import('vue').PropType<number | string>;
|
|
15
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
16
|
+
__isFragment?: never;
|
|
17
|
+
__isTeleport?: never;
|
|
18
|
+
__isSuspense?: never;
|
|
19
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
+
readonly color: StringConstructor;
|
|
21
|
+
readonly size: import('vue').PropType<number | string>;
|
|
22
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
23
|
+
$slots: {
|
|
24
|
+
default?: (props: {}) => any;
|
|
25
|
+
};
|
|
26
|
+
})>;
|
|
27
|
+
export default YButton;
|
|
28
|
+
export * from './src/button';
|
|
29
|
+
declare module "vue" {
|
|
30
|
+
interface GlobalComponents {
|
|
31
|
+
YButton: typeof YButton;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const __VLS_template: () => {
|
|
2
|
+
__VLS_Slots: {
|
|
3
|
+
default?: (props: {}) => any;
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
7
|
+
declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
8
|
+
readonly color: StringConstructor;
|
|
9
|
+
readonly size: import('vue').PropType<number | string>;
|
|
10
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
11
|
+
readonly color: StringConstructor;
|
|
12
|
+
readonly size: import('vue').PropType<number | string>;
|
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './key';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const INSTALLED_KEY: unique symbol;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const YIcon: import('@yangs-ui/utils/with-install').SFCWithInstall<{
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
3
|
+
readonly color: StringConstructor;
|
|
4
|
+
readonly size: import('vue').PropType<number | string>;
|
|
5
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
6
|
+
P: {};
|
|
7
|
+
B: {};
|
|
8
|
+
D: {};
|
|
9
|
+
C: {};
|
|
10
|
+
M: {};
|
|
11
|
+
Defaults: {};
|
|
12
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
13
|
+
readonly color: StringConstructor;
|
|
14
|
+
readonly size: import('vue').PropType<number | string>;
|
|
15
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
16
|
+
__isFragment?: never;
|
|
17
|
+
__isTeleport?: never;
|
|
18
|
+
__isSuspense?: never;
|
|
19
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
+
readonly color: StringConstructor;
|
|
21
|
+
readonly size: import('vue').PropType<number | string>;
|
|
22
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
23
|
+
$slots: {
|
|
24
|
+
default?: (props: {}) => any;
|
|
25
|
+
};
|
|
26
|
+
})>;
|
|
27
|
+
export default YIcon;
|
|
28
|
+
export * from './src/icon';
|
|
29
|
+
declare module "vue" {
|
|
30
|
+
interface GlobalComponents {
|
|
31
|
+
YIcon: typeof YIcon;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
export declare const iconProps: {
|
|
3
|
+
readonly color: StringConstructor;
|
|
4
|
+
readonly size: PropType<number | string>;
|
|
5
|
+
};
|
|
6
|
+
export type IconProps = ExtractPropTypes<typeof iconProps>;
|
|
7
|
+
/**
|
|
8
|
+
* const iconProps = {
|
|
9
|
+
color: String,
|
|
10
|
+
size: [Number, String]
|
|
11
|
+
};
|
|
12
|
+
这种写法是在vue组件中定义props时的写法,运行时的写法,只能写一个构造函数。String,Number本身也是构造函数
|
|
13
|
+
|
|
14
|
+
为什么使用as const。ts的类型
|
|
15
|
+
让所有属性变为readonly
|
|
16
|
+
不能直接赋值 iconProps.color = String; // 报错,因为color是readonly属性
|
|
17
|
+
|
|
18
|
+
as PropType<number | string> ts的类型
|
|
19
|
+
返回一个构造函数(构造函数的返回值为number|string)
|
|
20
|
+
如果color是一个对象,可以指定具体对象的属性类型 color: Object as PropType<{ name: string; age: number }>
|
|
21
|
+
如果color是一个函数,color: Function as PropType<(val: string) => void>
|
|
22
|
+
让ExtractPropTypes更好的推导类型,避免手动定义类型
|
|
23
|
+
*/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const __VLS_template: () => {
|
|
2
|
+
__VLS_Slots: {
|
|
3
|
+
default?: (props: {}) => any;
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
7
|
+
declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
8
|
+
readonly color: StringConstructor;
|
|
9
|
+
readonly size: import('vue').PropType<number | string>;
|
|
10
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
11
|
+
readonly color: StringConstructor;
|
|
12
|
+
readonly size: import('vue').PropType<number | string>;
|
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { YIcon } from '@yangs-ui/components/icon';
|
|
2
|
+
import { YButton } from '@yangs-ui/components/button';
|
|
3
|
+
declare const install: (app: any) => void;
|
|
4
|
+
declare const installer: {
|
|
5
|
+
install: (app: any) => void;
|
|
6
|
+
};
|
|
7
|
+
export default installer;
|
|
8
|
+
export { install, YIcon, YButton };
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare function createNameSpace(name: string): {
|
|
2
|
+
b: (blockSuffix?: string) => string;
|
|
3
|
+
e: (element?: string) => string;
|
|
4
|
+
m: (modifier?: string) => string;
|
|
5
|
+
be: (blockSuffix: string, element: string) => string;
|
|
6
|
+
bm: (blockSuffix: string, modifier: string) => string;
|
|
7
|
+
em: (element: string, modifier: string) => string;
|
|
8
|
+
bem: (blockSuffix: string, element: string, modifier: string) => string;
|
|
9
|
+
is: (name: string, state: string | boolean) => string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* const bem = createNameSpace("icon");
|
|
13
|
+
console.log(bem.b("block"));
|
|
14
|
+
console.log(bem.e("element"));
|
|
15
|
+
console.log(bem.m("modifier"));
|
|
16
|
+
console.log(bem.be("block", "element"));
|
|
17
|
+
console.log(bem.bm("block", "modifier"));
|
|
18
|
+
console.log(bem.em("element", "modifier"));
|
|
19
|
+
console.log(bem.bem("block", "element", "modifier"));
|
|
20
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yangs-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.2",
|
|
5
5
|
"description": "A Component Library for Vue 3",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"yangs-ui",
|
|
@@ -13,10 +13,6 @@
|
|
|
13
13
|
"main": "./lib/index.js",
|
|
14
14
|
"module": "./es/index.js",
|
|
15
15
|
"types": "./es/index.d.ts",
|
|
16
|
-
"publishConfig": {
|
|
17
|
-
"access": "public",
|
|
18
|
-
"directory": "dist"
|
|
19
|
-
},
|
|
20
16
|
"peerDependencies": {
|
|
21
17
|
"vue": "^3.5.0"
|
|
22
18
|
},
|
|
@@ -60,4 +56,4 @@
|
|
|
60
56
|
"sideEffects": [
|
|
61
57
|
"**/style/**"
|
|
62
58
|
]
|
|
63
|
-
}
|
|
59
|
+
}
|