@mtn-ui/components 0.0.6 → 0.0.9
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/button/index.js +1 -1
- package/dist/chunks/{Button.vue_vue_type_script_setup_true_lang-CfbO8ovs.js → Button.vue_vue_type_script_setup_true_lang-C7ip0O23.js} +973 -928
- package/dist/chunks/{Button.vue_vue_type_script_setup_true_lang-CfbO8ovs.js.map → Button.vue_vue_type_script_setup_true_lang-C7ip0O23.js.map} +1 -1
- package/dist/index/index.js +43238 -9546
- package/dist/index/index.js.map +1 -1
- package/dist/index/style.css +1 -1
- package/dist/resolver/index.js +33 -18
- package/dist/resolver/index.js.map +1 -1
- package/dist/types/auto-tooltip/AutoTooltip.d.ts +61 -0
- package/dist/types/auto-tooltip/index.d.ts +2 -0
- package/dist/types/auto-tooltip/types.d.ts +14 -0
- package/dist/types/base-modal/BaseModal.d.ts +25 -0
- package/dist/types/base-modal/index.d.ts +1 -0
- package/dist/types/button/Button.d.ts +1 -1
- package/dist/types/confirm-button/ConfirmButton.d.ts +10 -1
- package/dist/types/confirm-button/types.d.ts +1 -1
- package/dist/types/content-container/ContentContainer.d.ts +48 -0
- package/dist/types/content-container/index.d.ts +2 -0
- package/dist/types/content-container/types.d.ts +12 -0
- package/dist/types/copy-text/CopyText.d.ts +45 -0
- package/dist/types/copy-text/index.d.ts +2 -0
- package/dist/types/copy-text/types.d.ts +15 -0
- package/dist/types/delete-button/DeleteButton.d.ts +8 -0
- package/dist/types/delete-button/types.d.ts +1 -1
- package/dist/types/dict-badge/DictBadge.d.ts +48 -0
- package/dist/types/dict-badge/index.d.ts +2 -0
- package/dist/types/dict-badge/types.d.ts +23 -0
- package/dist/types/dict-checkbox/DictCheckbox.d.ts +54 -0
- package/dist/types/dict-checkbox/index.d.ts +2 -0
- package/dist/types/dict-checkbox/types.d.ts +23 -0
- package/dist/types/dict-radio/DictRadio.d.ts +57 -0
- package/dist/types/dict-radio/index.d.ts +2 -0
- package/dist/types/dict-radio/types.d.ts +25 -0
- package/dist/types/dict-select/DictSelect.d.ts +61 -0
- package/dist/types/dict-select/index.d.ts +2 -0
- package/dist/types/dict-select/types.d.ts +22 -0
- package/dist/types/dict-tag/DictTag.d.ts +48 -0
- package/dist/types/dict-tag/index.d.ts +2 -0
- package/dist/types/dict-tag/types.d.ts +23 -0
- package/dist/types/form/Form.d.ts +34 -0
- package/dist/types/form/context.d.ts +19 -0
- package/dist/types/form/index.d.ts +2 -0
- package/dist/types/form-item/FormItem.d.ts +39 -0
- package/dist/types/form-item/constants.d.ts +9 -0
- package/dist/types/form-item/index.d.ts +4 -0
- package/dist/types/form-item/types.d.ts +46 -0
- package/dist/types/form-item/validator.d.ts +1 -0
- package/dist/types/form-renderer/FormRenderer.d.ts +37 -0
- package/dist/types/form-renderer/helpers.d.ts +9 -0
- package/dist/types/form-renderer/index.d.ts +3 -0
- package/dist/types/form-renderer/types.d.ts +21 -0
- package/dist/types/form-row/FormRow.d.ts +33 -0
- package/dist/types/form-row/index.d.ts +2 -0
- package/dist/types/form-row/types.d.ts +11 -0
- package/dist/types/index.d.ts +32 -1
- package/dist/types/search-bar/SearchBar.d.ts +60 -0
- package/dist/types/search-bar/index.d.ts +2 -0
- package/dist/types/search-bar/types.d.ts +58 -0
- package/dist/types/section-title/SectionTitle.d.ts +42 -0
- package/dist/types/section-title/index.d.ts +2 -0
- package/dist/types/section-title/types.d.ts +12 -0
- package/dist/types/section-title/variants.d.ts +7 -0
- package/dist/types/table/Table.d.ts +84 -0
- package/dist/types/table/components/TableColumnConfigurator.d.ts +50 -0
- package/dist/types/table/components/TableDensityControl.d.ts +34 -0
- package/dist/types/table/components/TableSearchBar.d.ts +46 -0
- package/dist/types/table/components/TableToolbar.d.ts +48 -0
- package/dist/types/table/index.d.ts +5 -0
- package/dist/types/table/types.d.ts +97 -0
- package/dist/types/table-action-group/TableActionGroup.d.ts +33 -0
- package/dist/types/table-action-group/TableActionItem.d.ts +16 -0
- package/dist/types/table-action-group/index.d.ts +2 -0
- package/dist/types/table-action-group/types.d.ts +25 -0
- package/package.json +3 -2
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { DictItem, DictRadioProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DictRadioProps>, {
|
|
4
|
+
modelValue: undefined;
|
|
5
|
+
options: undefined;
|
|
6
|
+
dictType: undefined;
|
|
7
|
+
labelKey: string;
|
|
8
|
+
valueKey: string;
|
|
9
|
+
storageKeyPrefix: string;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
optionType: string;
|
|
12
|
+
direction: string;
|
|
13
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
|
+
"update:modelValue": (value: string | number | undefined) => void;
|
|
15
|
+
change: (value: string | number | undefined) => void;
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DictRadioProps>, {
|
|
17
|
+
modelValue: undefined;
|
|
18
|
+
options: undefined;
|
|
19
|
+
dictType: undefined;
|
|
20
|
+
labelKey: string;
|
|
21
|
+
valueKey: string;
|
|
22
|
+
storageKeyPrefix: string;
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
optionType: string;
|
|
25
|
+
direction: string;
|
|
26
|
+
}>>> & Readonly<{
|
|
27
|
+
"onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
|
|
28
|
+
onChange?: ((value: string | number | undefined) => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
options: DictItem[];
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
direction: "horizontal" | "vertical";
|
|
33
|
+
modelValue: string | number;
|
|
34
|
+
dictType: string;
|
|
35
|
+
labelKey: string;
|
|
36
|
+
valueKey: string;
|
|
37
|
+
storageKeyPrefix: string;
|
|
38
|
+
optionType: "default" | "button";
|
|
39
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
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
|
+
} & {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DictItem } from '../../../utils/src';
|
|
2
|
+
|
|
3
|
+
export type { DictItem };
|
|
4
|
+
export interface DictRadioProps {
|
|
5
|
+
/** 选中的值(对应 dictValue) */
|
|
6
|
+
modelValue?: string | number;
|
|
7
|
+
/** 前端传入的字典列表,优先级高于 dictType */
|
|
8
|
+
options?: DictItem[];
|
|
9
|
+
/** 字典类型,从 localStorage 读取(key = storageKeyPrefix + dictType) */
|
|
10
|
+
dictType?: string;
|
|
11
|
+
/** 展示字段名 */
|
|
12
|
+
labelKey?: string;
|
|
13
|
+
/** 值字段名 */
|
|
14
|
+
valueKey?: string;
|
|
15
|
+
/** localStorage 的 key 前缀 */
|
|
16
|
+
storageKeyPrefix?: string;
|
|
17
|
+
/** 是否禁用 */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** 展示形式:默认圆点 或 按钮样式 */
|
|
20
|
+
optionType?: 'default' | 'button';
|
|
21
|
+
/** 排列方向 */
|
|
22
|
+
direction?: 'horizontal' | 'vertical';
|
|
23
|
+
/** 自定义类名 */
|
|
24
|
+
class?: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { DictItem, DictSelectProps } from './types';
|
|
2
|
+
|
|
3
|
+
type ModelValue = string | number | string[] | number[] | undefined;
|
|
4
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DictSelectProps>, {
|
|
5
|
+
modelValue: undefined;
|
|
6
|
+
options: undefined;
|
|
7
|
+
dictType: undefined;
|
|
8
|
+
labelKey: string;
|
|
9
|
+
valueKey: string;
|
|
10
|
+
storageKeyPrefix: string;
|
|
11
|
+
placeholder: string;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
allowClear: boolean;
|
|
14
|
+
multiple: boolean;
|
|
15
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
|
+
"update:modelValue": (value: ModelValue) => void;
|
|
17
|
+
change: (value: ModelValue) => void;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DictSelectProps>, {
|
|
19
|
+
modelValue: undefined;
|
|
20
|
+
options: undefined;
|
|
21
|
+
dictType: undefined;
|
|
22
|
+
labelKey: string;
|
|
23
|
+
valueKey: string;
|
|
24
|
+
storageKeyPrefix: string;
|
|
25
|
+
placeholder: string;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
allowClear: boolean;
|
|
28
|
+
multiple: boolean;
|
|
29
|
+
}>>> & Readonly<{
|
|
30
|
+
"onUpdate:modelValue"?: ((value: ModelValue) => any) | undefined;
|
|
31
|
+
onChange?: ((value: ModelValue) => any) | undefined;
|
|
32
|
+
}>, {
|
|
33
|
+
options: DictItem[];
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
placeholder: string;
|
|
36
|
+
multiple: boolean;
|
|
37
|
+
modelValue: string | number | (string | number)[];
|
|
38
|
+
dictType: string;
|
|
39
|
+
labelKey: string;
|
|
40
|
+
valueKey: string;
|
|
41
|
+
storageKeyPrefix: string;
|
|
42
|
+
allowClear: boolean;
|
|
43
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
46
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
47
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
48
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
49
|
+
} : {
|
|
50
|
+
type: import('vue').PropType<T[K]>;
|
|
51
|
+
required: true;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
type __VLS_WithDefaults<P, D> = {
|
|
55
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
56
|
+
default: D[K];
|
|
57
|
+
}> : P[K];
|
|
58
|
+
};
|
|
59
|
+
type __VLS_Prettify<T> = {
|
|
60
|
+
[K in keyof T]: T[K];
|
|
61
|
+
} & {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DictItem } from '../../../utils/src';
|
|
2
|
+
|
|
3
|
+
export type { DictItem };
|
|
4
|
+
export interface DictSelectProps {
|
|
5
|
+
/** 选中的值(对应 dictValue) */
|
|
6
|
+
modelValue?: string | number | (string | number)[];
|
|
7
|
+
/** 前端写死的字典列表,优先级高于 dictType */
|
|
8
|
+
options?: DictItem[];
|
|
9
|
+
/** 字典类型,从 localStorage 读取(key = storageKeyPrefix + dictType);options 存在时忽略 */
|
|
10
|
+
dictType?: string;
|
|
11
|
+
/** 展示字段名 */
|
|
12
|
+
labelKey?: string;
|
|
13
|
+
/** 值字段名 */
|
|
14
|
+
valueKey?: string;
|
|
15
|
+
/** localStorage 的 key 前缀,实际 key 为 prefix + dictType */
|
|
16
|
+
storageKeyPrefix?: string;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
allowClear?: boolean;
|
|
20
|
+
/** 是否多选 */
|
|
21
|
+
multiple?: boolean;
|
|
22
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DictItem, DictTagProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DictTagProps>, {
|
|
4
|
+
value: undefined;
|
|
5
|
+
options: undefined;
|
|
6
|
+
dictType: undefined;
|
|
7
|
+
labelKey: string;
|
|
8
|
+
valueKey: string;
|
|
9
|
+
colorKey: string;
|
|
10
|
+
storageKeyPrefix: string;
|
|
11
|
+
placeholder: string;
|
|
12
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DictTagProps>, {
|
|
13
|
+
value: undefined;
|
|
14
|
+
options: undefined;
|
|
15
|
+
dictType: undefined;
|
|
16
|
+
labelKey: string;
|
|
17
|
+
valueKey: string;
|
|
18
|
+
colorKey: string;
|
|
19
|
+
storageKeyPrefix: string;
|
|
20
|
+
placeholder: string;
|
|
21
|
+
}>>> & Readonly<{}>, {
|
|
22
|
+
value: string | number;
|
|
23
|
+
options: DictItem[];
|
|
24
|
+
placeholder: string;
|
|
25
|
+
dictType: string;
|
|
26
|
+
labelKey: string;
|
|
27
|
+
valueKey: string;
|
|
28
|
+
colorKey: string;
|
|
29
|
+
storageKeyPrefix: string;
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
33
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
34
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
35
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
36
|
+
} : {
|
|
37
|
+
type: import('vue').PropType<T[K]>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type __VLS_WithDefaults<P, D> = {
|
|
42
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
43
|
+
default: D[K];
|
|
44
|
+
}> : P[K];
|
|
45
|
+
};
|
|
46
|
+
type __VLS_Prettify<T> = {
|
|
47
|
+
[K in keyof T]: T[K];
|
|
48
|
+
} & {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DictItem } from '../../../utils/src';
|
|
2
|
+
|
|
3
|
+
export type { DictItem };
|
|
4
|
+
export interface DictTagProps {
|
|
5
|
+
/** 要展示的字典值(dictValue),根据此值在字典中查找 label 与 color */
|
|
6
|
+
value?: string | number;
|
|
7
|
+
/** 字典列表,优先级高于 dictType */
|
|
8
|
+
options?: DictItem[];
|
|
9
|
+
/** 字典类型,从 localStorage 读取(key = storageKeyPrefix + dictType) */
|
|
10
|
+
dictType?: string;
|
|
11
|
+
/** 展示字段名 */
|
|
12
|
+
labelKey?: string;
|
|
13
|
+
/** 值字段名 */
|
|
14
|
+
valueKey?: string;
|
|
15
|
+
/** 颜色字段名,用于 Tag 的 color */
|
|
16
|
+
colorKey?: string;
|
|
17
|
+
/** localStorage 的 key 前缀 */
|
|
18
|
+
storageKeyPrefix?: string;
|
|
19
|
+
/** 未匹配到字典项时展示的占位文案 */
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
/** 自定义类名 */
|
|
22
|
+
class?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
default?(_: {}): any;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
labelCol?: {
|
|
6
|
+
span: number;
|
|
7
|
+
};
|
|
8
|
+
wrapperCol?: {
|
|
9
|
+
span: number;
|
|
10
|
+
};
|
|
11
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
12
|
+
labelCol?: {
|
|
13
|
+
span: number;
|
|
14
|
+
};
|
|
15
|
+
wrapperCol?: {
|
|
16
|
+
span: number;
|
|
17
|
+
};
|
|
18
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
19
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
22
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
23
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
24
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
25
|
+
} : {
|
|
26
|
+
type: import('vue').PropType<T[K]>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface MtnFormContext {
|
|
4
|
+
labelCol: ComputedRef<{
|
|
5
|
+
span: number;
|
|
6
|
+
} | undefined>;
|
|
7
|
+
wrapperCol: ComputedRef<{
|
|
8
|
+
span: number;
|
|
9
|
+
} | undefined>;
|
|
10
|
+
}
|
|
11
|
+
export interface MtnFormProps {
|
|
12
|
+
labelCol?: {
|
|
13
|
+
span: number;
|
|
14
|
+
};
|
|
15
|
+
wrapperCol?: {
|
|
16
|
+
span: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare const FormContextKey: InjectionKey<MtnFormContext>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FormItemProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
append?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FormItemProps>, {
|
|
7
|
+
show: boolean;
|
|
8
|
+
showLabel: boolean;
|
|
9
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FormItemProps>, {
|
|
10
|
+
show: boolean;
|
|
11
|
+
showLabel: boolean;
|
|
12
|
+
}>>> & Readonly<{}>, {
|
|
13
|
+
showLabel: boolean;
|
|
14
|
+
show: boolean;
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
20
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
21
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
22
|
+
} : {
|
|
23
|
+
type: import('vue').PropType<T[K]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
type __VLS_WithDefaults<P, D> = {
|
|
28
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
29
|
+
default: D[K];
|
|
30
|
+
}> : P[K];
|
|
31
|
+
};
|
|
32
|
+
type __VLS_Prettify<T> = {
|
|
33
|
+
[K in keyof T]: T[K];
|
|
34
|
+
} & {};
|
|
35
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FormItemType } from './types';
|
|
2
|
+
|
|
3
|
+
export declare const COMPONENT_MAP: Partial<Record<Exclude<FormItemType, 'custom'>, unknown>>;
|
|
4
|
+
/** 不传给 a-form-item 的 props;label 需传给 a-form-item 以便在无 #label 插槽时正常显示 */
|
|
5
|
+
export declare const OMIT_PROPS: readonly ["hidden", "validate", "type", "itemProps", "itemEvents", "span", "labelSpan", "wrapperCol", "name", "formData", "required", "placeholder", "showLabel"];
|
|
6
|
+
export declare const DEFAULT_LAYOUT: {
|
|
7
|
+
readonly labelSpan: 6;
|
|
8
|
+
readonly wrapperCol: 18;
|
|
9
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as FormItem } from './FormItem';
|
|
2
|
+
export type { FormItemType, FormItemTypeBase, FormItemTypeExtended, FormItemConfig, FormItemProps } from './types';
|
|
3
|
+
export { COMPONENT_MAP, DEFAULT_LAYOUT, OMIT_PROPS } from './constants';
|
|
4
|
+
export { validateCondition } from './validator';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormItem 表单项类型定义
|
|
3
|
+
* 参考 MxFormItem,支持可配置 type、嵌套路径、校验等
|
|
4
|
+
*/
|
|
5
|
+
/** 基础表单项类型(Ant Design Vue 组件) */
|
|
6
|
+
export type FormItemTypeBase = 'input' | 'text-area' | 'select' | 'radio' | 'checkbox' | 'date-picker' | 'input-number' | 'input-search';
|
|
7
|
+
/** 扩展类型 */
|
|
8
|
+
export type FormItemTypeExtended = 'tree-select' | 'dict-select' | 'custom';
|
|
9
|
+
/** 表单项 type 枚举 */
|
|
10
|
+
export type FormItemType = FormItemTypeBase | FormItemTypeExtended;
|
|
11
|
+
/** 表单项基础配置 */
|
|
12
|
+
export interface FormItemConfig {
|
|
13
|
+
label: string;
|
|
14
|
+
/** 字段名,字符串为单层路径,数组为嵌套路径如 ['user','address','city'] */
|
|
15
|
+
name?: string | string[];
|
|
16
|
+
/** 占位文案;不传时根据 type 与 label 自动生成(请选择/请输入 + label) */
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
/** 是否显示 label;false 时不渲染标签列(如 SearchBar 仅用 label 参与 placeholder 生成) */
|
|
19
|
+
showLabel?: boolean;
|
|
20
|
+
span?: 24 | 12 | 8;
|
|
21
|
+
labelSpan?: number;
|
|
22
|
+
wrapperCol?: number;
|
|
23
|
+
required?: boolean;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
show?: boolean;
|
|
26
|
+
tooltip?: string;
|
|
27
|
+
rules?: Array<Record<string, unknown>>;
|
|
28
|
+
validate?: Array<{
|
|
29
|
+
condition: string;
|
|
30
|
+
message: string;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
/** FormItem 组件 Props(内部 + 扩展) */
|
|
34
|
+
export interface FormItemProps extends FormItemConfig {
|
|
35
|
+
type: FormItemType;
|
|
36
|
+
customComponent?: unknown;
|
|
37
|
+
itemProps?: Record<string, unknown>;
|
|
38
|
+
itemEvents?: Record<string, (...args: unknown[]) => void>;
|
|
39
|
+
showStr?: string | string[];
|
|
40
|
+
defaultValue?: unknown;
|
|
41
|
+
prefixName?: string[];
|
|
42
|
+
/** 表单数据对象或 ref,用于内部双向绑定 */
|
|
43
|
+
formData?: Record<string, unknown> | {
|
|
44
|
+
value: Record<string, unknown>;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function validateCondition(condition: string, value: unknown): boolean;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FormRendererProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare function __VLS_template(): Partial<Record<string, (_: {}) => any>>;
|
|
4
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FormRendererProps>, {
|
|
5
|
+
cols: number;
|
|
6
|
+
gutter: number;
|
|
7
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FormRendererProps>, {
|
|
8
|
+
cols: number;
|
|
9
|
+
gutter: number;
|
|
10
|
+
}>>> & Readonly<{}>, {
|
|
11
|
+
cols: number;
|
|
12
|
+
gutter: number | [number, number];
|
|
13
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
17
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
18
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
19
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
20
|
+
} : {
|
|
21
|
+
type: import('vue').PropType<T[K]>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
type __VLS_WithDefaults<P, D> = {
|
|
26
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
27
|
+
default: D[K];
|
|
28
|
+
}> : P[K];
|
|
29
|
+
};
|
|
30
|
+
type __VLS_Prettify<T> = {
|
|
31
|
+
[K in keyof T]: T[K];
|
|
32
|
+
} & {};
|
|
33
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
34
|
+
new (): {
|
|
35
|
+
$slots: S;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** 带 show/showStr 的字段项,用于 processHiddenFields(仅约束必要属性,便于 FormItemProps 等传入) */
|
|
2
|
+
export interface FormFieldWithShow {
|
|
3
|
+
show?: boolean;
|
|
4
|
+
showStr?: string | string[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 处理隐藏字段:根据 formData 与 showStr 计算每项的 show,并过滤出需要展示的字段
|
|
8
|
+
*/
|
|
9
|
+
export declare function processHiddenFields<T extends FormFieldWithShow>(fields: T[], formData: Record<string, unknown>): T[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FormItemProps } from '../form-item/types';
|
|
2
|
+
|
|
3
|
+
export type FormRendererFieldConfig = FormItemProps;
|
|
4
|
+
export interface FormRendererProps {
|
|
5
|
+
/** 表单字段配置 */
|
|
6
|
+
fields: FormRendererFieldConfig[];
|
|
7
|
+
/** 表单数据(与 FormItem 双向绑定) */
|
|
8
|
+
formData: Record<string, unknown>;
|
|
9
|
+
/** 列数(传给 FormRow) */
|
|
10
|
+
cols?: number;
|
|
11
|
+
/** 列间距(传给 FormRow) */
|
|
12
|
+
gutter?: number | [number, number];
|
|
13
|
+
/** 标签栅格列数 */
|
|
14
|
+
labelCol?: {
|
|
15
|
+
span: number;
|
|
16
|
+
};
|
|
17
|
+
/** 输入控件栅格列数 */
|
|
18
|
+
wrapperCol?: {
|
|
19
|
+
span: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FormRowProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FormRowProps>, {
|
|
4
|
+
cols: number;
|
|
5
|
+
gutter: number;
|
|
6
|
+
class: undefined;
|
|
7
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FormRowProps>, {
|
|
8
|
+
cols: number;
|
|
9
|
+
gutter: number;
|
|
10
|
+
class: undefined;
|
|
11
|
+
}>>> & Readonly<{}>, {
|
|
12
|
+
class: string;
|
|
13
|
+
cols: number;
|
|
14
|
+
gutter: number | [number, number];
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
18
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
19
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
20
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
21
|
+
} : {
|
|
22
|
+
type: import('vue').PropType<T[K]>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
type __VLS_WithDefaults<P, D> = {
|
|
27
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
28
|
+
default: D[K];
|
|
29
|
+
}> : P[K];
|
|
30
|
+
};
|
|
31
|
+
type __VLS_Prettify<T> = {
|
|
32
|
+
[K in keyof T]: T[K];
|
|
33
|
+
} & {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -10,6 +10,37 @@ export * from './delete-button';
|
|
|
10
10
|
export type * from './delete-button/types';
|
|
11
11
|
export * from './color-picker';
|
|
12
12
|
export type * from './color-picker/types';
|
|
13
|
+
export * from './form-item';
|
|
14
|
+
export type * from './form-item/types';
|
|
15
|
+
export * from './form-row';
|
|
16
|
+
export type * from './form-row/types';
|
|
17
|
+
export * from './form-renderer';
|
|
18
|
+
export type * from './form-renderer/types';
|
|
19
|
+
export * from './form';
|
|
20
|
+
export * from './content-container';
|
|
21
|
+
export type * from './content-container/types';
|
|
22
|
+
export * from './auto-tooltip';
|
|
23
|
+
export type * from './auto-tooltip/types';
|
|
24
|
+
export * from './copy-text';
|
|
25
|
+
export type * from './copy-text/types';
|
|
26
|
+
export * from './table-action-group';
|
|
27
|
+
export type * from './table-action-group/types';
|
|
28
|
+
export * from './section-title';
|
|
29
|
+
export { DictSelect } from './dict-select';
|
|
30
|
+
export type { DictItem, DictSelectProps } from './dict-select/types';
|
|
31
|
+
export { DictRadio } from './dict-radio';
|
|
32
|
+
export type { DictRadioProps } from './dict-radio/types';
|
|
33
|
+
export { DictCheckbox } from './dict-checkbox';
|
|
34
|
+
export type { DictCheckboxProps } from './dict-checkbox/types';
|
|
35
|
+
export { DictBadge } from './dict-badge';
|
|
36
|
+
export type { DictBadgeProps } from './dict-badge/types';
|
|
37
|
+
export { DictTag } from './dict-tag';
|
|
38
|
+
export type { DictTagProps } from './dict-tag/types';
|
|
39
|
+
export { SearchBar } from './search-bar';
|
|
40
|
+
export type { SearchBarProps, SearchConfigItem } from './search-bar/types';
|
|
41
|
+
export * from './table';
|
|
42
|
+
export type * from './table/types';
|
|
43
|
+
export * from './base-modal';
|
|
13
44
|
export type * from './button/types';
|
|
14
45
|
/**
|
|
15
46
|
* MTN UI Vue Plugin
|
|
@@ -26,4 +57,4 @@ declare const MtnUI: Plugin;
|
|
|
26
57
|
export default MtnUI;
|
|
27
58
|
export declare const version = "1.0.0";
|
|
28
59
|
export { MtnUIResolver, default as resolver } from './resolver';
|
|
29
|
-
export { usePermission, type UsePermissionOptions, type UsePermissionReturn, type PermissionAction } from '
|
|
60
|
+
export { usePermission, type UsePermissionOptions, type UsePermissionReturn, type PermissionAction } from '../../utils/src';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { SearchBarProps, SearchConfigItem } from './types';
|
|
2
|
+
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SearchBarProps>, {
|
|
7
|
+
searchList: () => never[];
|
|
8
|
+
cols: number;
|
|
9
|
+
gutter: number;
|
|
10
|
+
searchText: string;
|
|
11
|
+
resetText: string;
|
|
12
|
+
expandText: () => [string, string];
|
|
13
|
+
validateBeforeSearch: boolean;
|
|
14
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
15
|
+
reset: () => void;
|
|
16
|
+
search: (values: Record<string, unknown>) => void;
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SearchBarProps>, {
|
|
18
|
+
searchList: () => never[];
|
|
19
|
+
cols: number;
|
|
20
|
+
gutter: number;
|
|
21
|
+
searchText: string;
|
|
22
|
+
resetText: string;
|
|
23
|
+
expandText: () => [string, string];
|
|
24
|
+
validateBeforeSearch: boolean;
|
|
25
|
+
}>>> & Readonly<{
|
|
26
|
+
onReset?: (() => any) | undefined;
|
|
27
|
+
onSearch?: ((values: Record<string, unknown>) => any) | undefined;
|
|
28
|
+
}>, {
|
|
29
|
+
cols: number;
|
|
30
|
+
gutter: number | [number, number];
|
|
31
|
+
searchList: SearchConfigItem[];
|
|
32
|
+
searchText: string;
|
|
33
|
+
resetText: string;
|
|
34
|
+
expandText: [string, string];
|
|
35
|
+
validateBeforeSearch: boolean;
|
|
36
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
37
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
40
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
41
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
42
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
43
|
+
} : {
|
|
44
|
+
type: import('vue').PropType<T[K]>;
|
|
45
|
+
required: true;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
type __VLS_WithDefaults<P, D> = {
|
|
49
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
50
|
+
default: D[K];
|
|
51
|
+
}> : P[K];
|
|
52
|
+
};
|
|
53
|
+
type __VLS_Prettify<T> = {
|
|
54
|
+
[K in keyof T]: T[K];
|
|
55
|
+
} & {};
|
|
56
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
57
|
+
new (): {
|
|
58
|
+
$slots: S;
|
|
59
|
+
};
|
|
60
|
+
};
|