knt-shared 1.0.0 → 1.1.1
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 +390 -135
- package/dist/components/Description/BasicDescription.vue.d.ts +63 -0
- package/dist/components/Description/BasicDescription.vue.d.ts.map +1 -0
- package/dist/components/Description/index.d.ts +5 -0
- package/dist/components/Description/index.d.ts.map +1 -0
- package/dist/components/Description/types.d.ts +97 -0
- package/dist/components/Description/types.d.ts.map +1 -0
- package/dist/components/Description/useDescription.d.ts +10 -0
- package/dist/components/Description/useDescription.d.ts.map +1 -0
- package/dist/components/Form/componentMap.d.ts +691 -5
- package/dist/components/Form/componentMap.d.ts.map +1 -1
- package/dist/components/Form/types.d.ts +6 -3
- package/dist/components/Form/types.d.ts.map +1 -1
- package/dist/components/Form/useForm.d.ts.map +1 -1
- package/dist/components/Modal/BasicModal.vue.d.ts +118 -0
- package/dist/components/Modal/BasicModal.vue.d.ts.map +1 -0
- package/dist/components/Modal/index.d.ts +5 -0
- package/dist/components/Modal/index.d.ts.map +1 -0
- package/dist/components/Modal/types.d.ts +163 -0
- package/dist/components/Modal/types.d.ts.map +1 -0
- package/dist/components/Modal/useModal.d.ts +10 -0
- package/dist/components/Modal/useModal.d.ts.map +1 -0
- package/dist/components/Modal/useModalInner.d.ts +10 -0
- package/dist/components/Modal/useModalInner.d.ts.map +1 -0
- package/dist/components/Table/BasicTable.vue.d.ts +123 -0
- package/dist/components/Table/BasicTable.vue.d.ts.map +1 -0
- package/dist/components/Table/index.d.ts +7 -0
- package/dist/components/Table/index.d.ts.map +1 -0
- package/dist/components/Table/types.d.ts +337 -0
- package/dist/components/Table/types.d.ts.map +1 -0
- package/dist/components/Table/useTable.d.ts +23 -0
- package/dist/components/Table/useTable.d.ts.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.cjs.js +2845 -121
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +2847 -123
- package/dist/index.esm.js.map +1 -1
- package/dist/style.css +98 -0
- package/dist/utils/debounce.d.ts +23 -0
- package/dist/utils/debounce.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +12 -11
- package/dist/components/Form/BasicForm.vue.d.ts +0 -117
- package/dist/components/Form/BasicForm.vue.d.ts.map +0 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { BasicDescriptionProps, DescriptionMethods } from './types';
|
|
2
|
+
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
title?(_: {}): any;
|
|
5
|
+
extra?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<BasicDescriptionProps>, {
|
|
8
|
+
column: number;
|
|
9
|
+
size: string;
|
|
10
|
+
bordered: boolean;
|
|
11
|
+
layout: string;
|
|
12
|
+
labelAlign: string;
|
|
13
|
+
align: string;
|
|
14
|
+
colon: boolean;
|
|
15
|
+
}>>, {
|
|
16
|
+
setDescriptionProps: (props: Partial<BasicDescriptionProps>) => void;
|
|
17
|
+
getDescriptionProps: () => BasicDescriptionProps;
|
|
18
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
19
|
+
register: (instance: DescriptionMethods) => void;
|
|
20
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<BasicDescriptionProps>, {
|
|
21
|
+
column: number;
|
|
22
|
+
size: string;
|
|
23
|
+
bordered: boolean;
|
|
24
|
+
layout: string;
|
|
25
|
+
labelAlign: string;
|
|
26
|
+
align: string;
|
|
27
|
+
colon: boolean;
|
|
28
|
+
}>>> & Readonly<{
|
|
29
|
+
onRegister?: ((instance: DescriptionMethods) => any) | undefined;
|
|
30
|
+
}>, {
|
|
31
|
+
column: number | Partial<Record<"xxl" | "xl" | "lg" | "md" | "sm" | "xs", number>>;
|
|
32
|
+
labelAlign: "left" | "center" | "right";
|
|
33
|
+
size: "mini" | "small" | "medium" | "large";
|
|
34
|
+
bordered: boolean;
|
|
35
|
+
layout: "horizontal" | "vertical" | "inline-horizontal" | "inline-vertical";
|
|
36
|
+
colon: boolean;
|
|
37
|
+
align: "left" | "center" | "right";
|
|
38
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
39
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
40
|
+
export default _default;
|
|
41
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
42
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
43
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
44
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
45
|
+
} : {
|
|
46
|
+
type: import('vue').PropType<T[K]>;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
type __VLS_WithDefaults<P, D> = {
|
|
51
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
52
|
+
default: D[K];
|
|
53
|
+
}> : P[K];
|
|
54
|
+
};
|
|
55
|
+
type __VLS_Prettify<T> = {
|
|
56
|
+
[K in keyof T]: T[K];
|
|
57
|
+
} & {};
|
|
58
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
59
|
+
new (): {
|
|
60
|
+
$slots: S;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=BasicDescription.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BasicDescription.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Description/BasicDescription.vue"],"names":[],"mappings":"AAyEA;AAKA,OAAO,KAA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AAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Description/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAGrE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,cAAc,SAAS,CAAC;AACxB,YAAY,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { CSSProperties, VNode } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Description 数据项配置(基于 Arco Design Vue Descriptions)
|
|
5
|
+
*/
|
|
6
|
+
export interface DescItem {
|
|
7
|
+
/** 字段名 */
|
|
8
|
+
field: string;
|
|
9
|
+
/** 标签名 */
|
|
10
|
+
label: string;
|
|
11
|
+
/** 标签最小宽度 */
|
|
12
|
+
labelMinWidth?: number;
|
|
13
|
+
/** 内容最小宽度 */
|
|
14
|
+
contentMinWidth?: number;
|
|
15
|
+
/** 标签样式 */
|
|
16
|
+
labelStyle?: CSSProperties;
|
|
17
|
+
/** 内容样式 */
|
|
18
|
+
contentStyle?: CSSProperties;
|
|
19
|
+
/** 包含列的数量 */
|
|
20
|
+
span?: number;
|
|
21
|
+
/** 动态判断当前项是否显示 */
|
|
22
|
+
show?: (data: Recordable) => boolean;
|
|
23
|
+
/** 自定义渲染内容 */
|
|
24
|
+
render?: (val: any, data: Recordable) => VNode | undefined | Element | string | number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 帮助信息配置
|
|
28
|
+
*/
|
|
29
|
+
export interface HelpMessageOptions {
|
|
30
|
+
/** 帮助信息 */
|
|
31
|
+
helpMessage?: string | string[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Description 基础属性(基于 Arco Design Vue Descriptions 属性)
|
|
35
|
+
*/
|
|
36
|
+
export interface BasicDescriptionProps {
|
|
37
|
+
/** 标题 */
|
|
38
|
+
title?: string;
|
|
39
|
+
/** 一行的 DescriptionItems 数量,可以写成数字或对象 */
|
|
40
|
+
column?: number | Partial<Record<'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs', number>>;
|
|
41
|
+
/** Description 的详情项配置 */
|
|
42
|
+
schema?: DescItem[];
|
|
43
|
+
/** 数据源 */
|
|
44
|
+
data?: Recordable;
|
|
45
|
+
/** 帮助信息配置 */
|
|
46
|
+
helpMessageOptions?: HelpMessageOptions;
|
|
47
|
+
/** 设置标签的对齐方式 */
|
|
48
|
+
labelAlign?: 'left' | 'center' | 'right';
|
|
49
|
+
/** Descriptions 的尺寸 */
|
|
50
|
+
size?: 'mini' | 'small' | 'medium' | 'large';
|
|
51
|
+
/** 是否显示边框 */
|
|
52
|
+
bordered?: boolean;
|
|
53
|
+
/** 列表的布局方式 */
|
|
54
|
+
layout?: 'horizontal' | 'vertical' | 'inline-horizontal' | 'inline-vertical';
|
|
55
|
+
/** 是否显示冒号 */
|
|
56
|
+
colon?: boolean;
|
|
57
|
+
/** 标签的文本对齐方式 */
|
|
58
|
+
align?: 'left' | 'center' | 'right';
|
|
59
|
+
/** 自定义样式 */
|
|
60
|
+
style?: CSSProperties;
|
|
61
|
+
/** 自定义类名 */
|
|
62
|
+
class?: string | string[] | Record<string, boolean>;
|
|
63
|
+
/** 标题额外内容 */
|
|
64
|
+
extra?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Description 组件事件
|
|
68
|
+
*/
|
|
69
|
+
export interface DescriptionEmits {
|
|
70
|
+
(e: 'register', instance: DescriptionMethods): void;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Description 实例方法
|
|
74
|
+
*/
|
|
75
|
+
export interface DescriptionMethods {
|
|
76
|
+
/** 设置 Description Props */
|
|
77
|
+
setDescriptionProps: (props: Partial<BasicDescriptionProps>) => void;
|
|
78
|
+
/** 获取 Description Props */
|
|
79
|
+
getDescriptionProps: () => BasicDescriptionProps;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* useDescription 返回值
|
|
83
|
+
*/
|
|
84
|
+
export type UseDescriptionReturnType = [
|
|
85
|
+
(instance: DescriptionMethods) => void,
|
|
86
|
+
{
|
|
87
|
+
/** 设置 Description Props */
|
|
88
|
+
setDescriptionProps: (props: Partial<BasicDescriptionProps>) => void;
|
|
89
|
+
/** 获取 Description Props */
|
|
90
|
+
getDescriptionProps: () => BasicDescriptionProps;
|
|
91
|
+
}
|
|
92
|
+
];
|
|
93
|
+
/**
|
|
94
|
+
* 通用对象类型
|
|
95
|
+
*/
|
|
96
|
+
export type Recordable<T = any> = Record<string, T>;
|
|
97
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Description/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,UAAU;IACV,KAAK,EAAE,MAAM,CAAC;IACd,UAAU;IACV,KAAK,EAAE,MAAM,CAAC;IACd,aAAa;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW;IACX,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,WAAW;IACX,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,aAAa;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC;IACrC,cAAc;IACd,MAAM,CAAC,EAAE,CACP,GAAG,EAAE,GAAG,EACR,I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C;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,CAAC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,2BAA2B;IAC3B,mBAAmB,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IACrE,2BAA2B;IAC3B,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI;IACtC;QACE,2BAA2B;QAC3B,mBAAmB,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;QACrE,2BAA2B;QAC3B,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;KAClD;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BasicDescriptionProps, UseDescriptionReturnType } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* useDescription Hook
|
|
5
|
+
* 用于外部组件调用 Description(参考 Vben Admin 设计)
|
|
6
|
+
* @param props Description 初始配置
|
|
7
|
+
* @returns [register, descriptionMethods]
|
|
8
|
+
*/
|
|
9
|
+
export declare function useDescription(props?: Partial<BasicDescriptionProps>): UseDescriptionReturnType;
|
|
10
|
+
//# sourceMappingURL=useDescription.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDescription.d.ts","sourceRoot":"","sources":["../../../src/components/Description/useDescription.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAsB,MAAM,SAAS,CAAC;AAEnG;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,wBAAwB,CA4D/F"}
|