@ccn-ui-kit/upload 0.1.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/dist/index.cjs +1 -0
- package/dist/index.js +512 -0
- package/dist/packages/components/__tests__/loading.spec.d.ts +1 -0
- package/dist/packages/components/badge/index.d.ts +10 -0
- package/dist/packages/components/badge/src/badge.d.ts +25 -0
- package/dist/packages/components/breadcrumb/index.d.ts +12 -0
- package/dist/packages/components/breadcrumb/src/breadcrumb-item.d.ts +13 -0
- package/dist/packages/components/breadcrumb/src/breadcrumb.d.ts +10 -0
- package/dist/packages/components/button/index.d.ts +10 -0
- package/dist/packages/components/button/src/button.d.ts +25 -0
- package/dist/packages/components/date-picker/index.d.ts +10 -0
- package/dist/packages/components/date-picker/src/date-picker.d.ts +20 -0
- package/dist/packages/components/descriptions/index.d.ts +12 -0
- package/dist/packages/components/descriptions/src/descriptions-item.d.ts +13 -0
- package/dist/packages/components/descriptions/src/descriptions.d.ts +17 -0
- package/dist/packages/components/divider/index.d.ts +10 -0
- package/dist/packages/components/divider/src/divider.d.ts +20 -0
- package/dist/packages/components/dropdown/index.d.ts +12 -0
- package/dist/packages/components/dropdown/src/dropdown-item.d.ts +20 -0
- package/dist/packages/components/dropdown/src/dropdown.d.ts +46 -0
- package/dist/packages/components/form/index.d.ts +12 -0
- package/dist/packages/components/form/src/form-item.d.ts +45 -0
- package/dist/packages/components/form/src/form.d.ts +96 -0
- package/dist/packages/components/icon/index.d.ts +11 -0
- package/dist/packages/components/icon/src/icon.d.ts +18 -0
- package/dist/packages/components/icon/src/icons.d.ts +50 -0
- package/dist/packages/components/input/index.d.ts +10 -0
- package/dist/packages/components/input/src/input.d.ts +25 -0
- package/dist/packages/components/link/index.d.ts +10 -0
- package/dist/packages/components/link/src/link.d.ts +25 -0
- package/dist/packages/components/loading/index.d.ts +10 -0
- package/dist/packages/components/loading/src/loading.d.ts +15 -0
- package/dist/packages/components/menu/index.d.ts +14 -0
- package/dist/packages/components/menu/src/menu-item.d.ts +12 -0
- package/dist/packages/components/menu/src/menu.d.ts +40 -0
- package/dist/packages/components/menu/src/sub-menu.d.ts +12 -0
- package/dist/packages/components/message/index.d.ts +12 -0
- package/dist/packages/components/message/src/manager.d.ts +14 -0
- package/dist/packages/components/message/src/message.d.ts +28 -0
- package/dist/packages/components/modal/index.d.ts +10 -0
- package/dist/packages/components/modal/src/modal.d.ts +46 -0
- package/dist/packages/components/notification/index.d.ts +12 -0
- package/dist/packages/components/notification/src/manager.d.ts +14 -0
- package/dist/packages/components/notification/src/notification.d.ts +44 -0
- package/dist/packages/components/pagination/index.d.ts +10 -0
- package/dist/packages/components/pagination/src/pagination.d.ts +30 -0
- package/dist/packages/components/popconfirm/index.d.ts +10 -0
- package/dist/packages/components/popconfirm/src/popconfirm.d.ts +56 -0
- package/dist/packages/components/rich-editor/index.d.ts +10 -0
- package/dist/packages/components/rich-editor/src/rich-editor.d.ts +36 -0
- package/dist/packages/components/select/index.d.ts +10 -0
- package/dist/packages/components/select/src/select.d.ts +45 -0
- package/dist/packages/components/space/index.d.ts +10 -0
- package/dist/packages/components/space/src/space.d.ts +33 -0
- package/dist/packages/components/steps/index.d.ts +12 -0
- package/dist/packages/components/steps/src/step.d.ts +28 -0
- package/dist/packages/components/steps/src/steps.d.ts +46 -0
- package/dist/packages/components/table/index.d.ts +10 -0
- package/dist/packages/components/table/src/table.d.ts +56 -0
- package/dist/packages/components/tabs/index.d.ts +12 -0
- package/dist/packages/components/tabs/src/tab-pane.d.ts +22 -0
- package/dist/packages/components/tabs/src/tabs.d.ts +43 -0
- package/dist/packages/components/tree/index.d.ts +10 -0
- package/dist/packages/components/tree/src/tree.d.ts +134 -0
- package/dist/packages/components/upload/index.d.ts +10 -0
- package/dist/packages/components/upload/src/upload.d.ts +103 -0
- package/dist/packages/components/upload/src/upload.vue.d.ts +135 -0
- package/dist/packages/directives/index.d.ts +2 -0
- package/dist/packages/directives/loading/index.d.ts +11 -0
- package/dist/packages/directives/permission/index.d.ts +3 -0
- package/dist/packages/ui-kit/index.d.ts +34 -0
- package/dist/packages/utils/dom.d.ts +5 -0
- package/dist/packages/utils/index.d.ts +3 -0
- package/dist/packages/utils/types.d.ts +7 -0
- package/dist/packages/utils/vue-helper.d.ts +9 -0
- package/dist/play/main.d.ts +1 -0
- package/dist/play/vite.config.d.ts +2 -0
- package/package.json +27 -0
- package/style/index.scss +241 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const buttonProps: {
|
|
4
|
+
readonly type: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly default: "default";
|
|
7
|
+
};
|
|
8
|
+
readonly size: {
|
|
9
|
+
readonly type: StringConstructor;
|
|
10
|
+
readonly default: "medium";
|
|
11
|
+
};
|
|
12
|
+
readonly plain: BooleanConstructor;
|
|
13
|
+
readonly round: BooleanConstructor;
|
|
14
|
+
readonly disabled: BooleanConstructor;
|
|
15
|
+
readonly loading: BooleanConstructor;
|
|
16
|
+
/** 原生 button 的 type,默认 button(避免误触发表单提交) */
|
|
17
|
+
readonly 'native-type': {
|
|
18
|
+
readonly type: StringConstructor;
|
|
19
|
+
readonly default: "button";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare const buttonEmits: {
|
|
23
|
+
click: (e: MouseEvent) => boolean;
|
|
24
|
+
};
|
|
25
|
+
export type ButtonProps = ExtractPropTypes<typeof buttonProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { default as DatePicker } from './src/date-picker.vue';
|
|
3
|
+
|
|
4
|
+
export declare const DatePickerPlugin: {
|
|
5
|
+
name: string;
|
|
6
|
+
install(app: App): void;
|
|
7
|
+
};
|
|
8
|
+
export { DatePicker };
|
|
9
|
+
export default DatePicker;
|
|
10
|
+
export * from './src/date-picker';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const datePickerProps: {
|
|
4
|
+
readonly modelValue: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly default: undefined;
|
|
7
|
+
};
|
|
8
|
+
readonly placeholder: {
|
|
9
|
+
readonly type: StringConstructor;
|
|
10
|
+
readonly default: "请选择日期";
|
|
11
|
+
};
|
|
12
|
+
readonly disabled: BooleanConstructor;
|
|
13
|
+
readonly clearable: BooleanConstructor;
|
|
14
|
+
};
|
|
15
|
+
export declare const datePickerEmits: {
|
|
16
|
+
'update:modelValue': (val: string) => boolean;
|
|
17
|
+
change: (val: string) => boolean;
|
|
18
|
+
clear: () => boolean;
|
|
19
|
+
};
|
|
20
|
+
export type DatePickerProps = ExtractPropTypes<typeof datePickerProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { default as Descriptions } from './src/descriptions.vue';
|
|
3
|
+
import { default as DescriptionsItem } from './src/descriptions-item.vue';
|
|
4
|
+
|
|
5
|
+
export declare const DescriptionsPlugin: {
|
|
6
|
+
name: string;
|
|
7
|
+
install(app: App): void;
|
|
8
|
+
};
|
|
9
|
+
export { Descriptions, DescriptionsItem };
|
|
10
|
+
export default Descriptions;
|
|
11
|
+
export * from './src/descriptions';
|
|
12
|
+
export * from './src/descriptions-item';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const descriptionsItemProps: {
|
|
4
|
+
readonly label: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly default: "";
|
|
7
|
+
};
|
|
8
|
+
readonly span: {
|
|
9
|
+
readonly type: NumberConstructor;
|
|
10
|
+
readonly default: 1;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type DescriptionsItemProps = ExtractPropTypes<typeof descriptionsItemProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const descriptionsProps: {
|
|
4
|
+
readonly title: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly default: "";
|
|
7
|
+
};
|
|
8
|
+
readonly column: {
|
|
9
|
+
readonly type: NumberConstructor;
|
|
10
|
+
readonly default: 3;
|
|
11
|
+
};
|
|
12
|
+
readonly border: {
|
|
13
|
+
readonly type: BooleanConstructor;
|
|
14
|
+
readonly default: false;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type DescriptionsProps = ExtractPropTypes<typeof descriptionsProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const dividerProps: {
|
|
4
|
+
/** 分割线方向 */
|
|
5
|
+
readonly direction: {
|
|
6
|
+
readonly type: StringConstructor;
|
|
7
|
+
readonly default: "horizontal";
|
|
8
|
+
};
|
|
9
|
+
/** 文案在分割线上的位置 */
|
|
10
|
+
readonly contentPosition: {
|
|
11
|
+
readonly type: StringConstructor;
|
|
12
|
+
readonly default: "center";
|
|
13
|
+
};
|
|
14
|
+
/** 是否使用虚线 */
|
|
15
|
+
readonly dashed: {
|
|
16
|
+
readonly type: BooleanConstructor;
|
|
17
|
+
readonly default: false;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type DividerProps = ExtractPropTypes<typeof dividerProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { default as Dropdown } from './src/dropdown.vue';
|
|
3
|
+
import { default as DropdownItem } from './src/dropdown-item.vue';
|
|
4
|
+
|
|
5
|
+
export declare const DropdownPlugin: {
|
|
6
|
+
name: string;
|
|
7
|
+
install(app: App): void;
|
|
8
|
+
};
|
|
9
|
+
export { Dropdown, DropdownItem };
|
|
10
|
+
export default Dropdown;
|
|
11
|
+
export * from './src/dropdown';
|
|
12
|
+
export * from './src/dropdown-item';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const dropdownItemProps: {
|
|
4
|
+
/** 点击时通过 command 事件回传的标识 */
|
|
5
|
+
readonly command: {
|
|
6
|
+
readonly type: [StringConstructor, NumberConstructor, ObjectConstructor, BooleanConstructor];
|
|
7
|
+
readonly default: undefined;
|
|
8
|
+
};
|
|
9
|
+
/** 是否禁用 */
|
|
10
|
+
readonly disabled: {
|
|
11
|
+
readonly type: BooleanConstructor;
|
|
12
|
+
readonly default: false;
|
|
13
|
+
};
|
|
14
|
+
/** 是否显示上方分隔线 */
|
|
15
|
+
readonly divided: {
|
|
16
|
+
readonly type: BooleanConstructor;
|
|
17
|
+
readonly default: false;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type DropdownItemProps = ExtractPropTypes<typeof dropdownItemProps>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ExtractPropTypes, InjectionKey } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const dropdownProps: {
|
|
4
|
+
/** 触发方式:hover | click | contextmenu */
|
|
5
|
+
readonly trigger: {
|
|
6
|
+
readonly type: StringConstructor;
|
|
7
|
+
readonly default: "hover";
|
|
8
|
+
};
|
|
9
|
+
/** 面板弹出位置 */
|
|
10
|
+
readonly placement: {
|
|
11
|
+
readonly type: StringConstructor;
|
|
12
|
+
readonly default: "bottom-start";
|
|
13
|
+
};
|
|
14
|
+
/** 点击菜单项后是否自动关闭 */
|
|
15
|
+
readonly hideOnClick: {
|
|
16
|
+
readonly type: BooleanConstructor;
|
|
17
|
+
readonly default: true;
|
|
18
|
+
};
|
|
19
|
+
/** hover 打开延迟(ms) */
|
|
20
|
+
readonly showTimeout: {
|
|
21
|
+
readonly type: NumberConstructor;
|
|
22
|
+
readonly default: 150;
|
|
23
|
+
};
|
|
24
|
+
/** hover 关闭延迟(ms) */
|
|
25
|
+
readonly hideTimeout: {
|
|
26
|
+
readonly type: NumberConstructor;
|
|
27
|
+
readonly default: 150;
|
|
28
|
+
};
|
|
29
|
+
/** 是否禁用 */
|
|
30
|
+
readonly disabled: {
|
|
31
|
+
readonly type: BooleanConstructor;
|
|
32
|
+
readonly default: false;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare const dropdownEmits: {
|
|
36
|
+
/** 点击菜单项触发,参数为该项的 command */
|
|
37
|
+
command: (_command: unknown) => boolean;
|
|
38
|
+
/** 面板显隐变化 */
|
|
39
|
+
'visible-change': (_visible: boolean) => boolean;
|
|
40
|
+
};
|
|
41
|
+
export type DropdownProps = ExtractPropTypes<typeof dropdownProps>;
|
|
42
|
+
/** 提供给 DropdownItem 的上下文 */
|
|
43
|
+
export interface DropdownContext {
|
|
44
|
+
handleItemClick: (command: unknown) => void;
|
|
45
|
+
}
|
|
46
|
+
export declare const dropdownContextKey: InjectionKey<DropdownContext>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { default as Form } from './src/form.vue';
|
|
3
|
+
import { default as FormItem } from './src/form-item.vue';
|
|
4
|
+
|
|
5
|
+
export declare const FormPlugin: {
|
|
6
|
+
name: string;
|
|
7
|
+
install(app: App): void;
|
|
8
|
+
};
|
|
9
|
+
export { Form, FormItem };
|
|
10
|
+
export default Form;
|
|
11
|
+
export * from './src/form';
|
|
12
|
+
export * from './src/form-item';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import { FormItemRules, FormLabelPosition } from './form';
|
|
3
|
+
|
|
4
|
+
export declare const formItemProps: {
|
|
5
|
+
/** 字段名(对应 form 的 model 上的 key);留空则仅做布局分组,不参与校验 */
|
|
6
|
+
readonly prop: {
|
|
7
|
+
readonly type: StringConstructor;
|
|
8
|
+
readonly default: "";
|
|
9
|
+
};
|
|
10
|
+
/** 标签文案 */
|
|
11
|
+
readonly label: {
|
|
12
|
+
readonly type: StringConstructor;
|
|
13
|
+
readonly default: "";
|
|
14
|
+
};
|
|
15
|
+
/** 标签宽度(覆盖 form 级 labelWidth) */
|
|
16
|
+
readonly labelWidth: {
|
|
17
|
+
readonly type: [NumberConstructor, StringConstructor];
|
|
18
|
+
readonly default: undefined;
|
|
19
|
+
};
|
|
20
|
+
/** 标签位置(覆盖 form 级 labelPosition) */
|
|
21
|
+
readonly labelPosition: {
|
|
22
|
+
readonly type: PropType<FormLabelPosition>;
|
|
23
|
+
readonly default: undefined;
|
|
24
|
+
};
|
|
25
|
+
/** 便捷必填标记,等价于 rules: [{ required: true }] */
|
|
26
|
+
readonly required: BooleanConstructor;
|
|
27
|
+
/** 校验规则(与 form 级同 prop 规则合并,item 级优先) */
|
|
28
|
+
readonly rules: {
|
|
29
|
+
readonly type: PropType<FormItemRules>;
|
|
30
|
+
readonly default: undefined;
|
|
31
|
+
};
|
|
32
|
+
/** 外部受控错误信息,设置后直接展示 */
|
|
33
|
+
readonly error: {
|
|
34
|
+
readonly type: StringConstructor;
|
|
35
|
+
readonly default: "";
|
|
36
|
+
};
|
|
37
|
+
/** 是否显示校验错误提示 */
|
|
38
|
+
readonly showMessage: {
|
|
39
|
+
readonly type: BooleanConstructor;
|
|
40
|
+
readonly default: true;
|
|
41
|
+
};
|
|
42
|
+
/** 单独禁用 */
|
|
43
|
+
readonly disabled: BooleanConstructor;
|
|
44
|
+
};
|
|
45
|
+
export type FormItemProps = ExtractPropTypes<typeof formItemProps>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ExtractPropTypes, InjectionKey, PropType, Ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
export type FormLabelPosition = 'left' | 'right' | 'top';
|
|
4
|
+
export type ValidateTrigger = 'change' | 'blur' | 'submit';
|
|
5
|
+
export type RuleType = 'string' | 'number' | 'boolean' | 'array' | 'date' | 'email' | 'url';
|
|
6
|
+
export interface FormItemRule {
|
|
7
|
+
/** 必填校验(空值:'' / null / undefined) */
|
|
8
|
+
required?: boolean;
|
|
9
|
+
/** 类型校验(string / number / boolean / array / date / email / url) */
|
|
10
|
+
type?: RuleType;
|
|
11
|
+
/** 最小长度 / 值(string、array 按长度,number 按大小) */
|
|
12
|
+
min?: number;
|
|
13
|
+
/** 最大长度 / 值 */
|
|
14
|
+
max?: number;
|
|
15
|
+
/** 正则校验(仅在值非空时校验) */
|
|
16
|
+
pattern?: RegExp;
|
|
17
|
+
/** 自定义校验:true / undefined 通过,false 不通过,string 作为错误信息;支持返回 Promise(异步校验) */
|
|
18
|
+
validator?: (value: unknown, model: Record<string, unknown>) => boolean | string | void | Promise<boolean | string | void>;
|
|
19
|
+
/** 校验失败提示 */
|
|
20
|
+
message?: string;
|
|
21
|
+
/** 触发时机:change(未声明时的默认值)/ blur / submit,可传数组 */
|
|
22
|
+
trigger?: ValidateTrigger | ValidateTrigger[];
|
|
23
|
+
}
|
|
24
|
+
/** 单条规则或规则数组(item 级 rules 与 form 级同 prop 规则合并) */
|
|
25
|
+
export type FormItemRules = FormItemRule | FormItemRule[];
|
|
26
|
+
/** form 级 rules:prop → 规则 */
|
|
27
|
+
export type FormRules = Record<string, FormItemRules>;
|
|
28
|
+
export type FormValidateCallback = (isValid: boolean, invalidFields?: Record<string, string[]>) => void;
|
|
29
|
+
/** form-item 注册进 form 的契约 */
|
|
30
|
+
export interface FormItemContext {
|
|
31
|
+
getProp: () => string;
|
|
32
|
+
validate: (trigger?: ValidateTrigger) => Promise<boolean>;
|
|
33
|
+
resetField: () => void;
|
|
34
|
+
clearValidate: () => void;
|
|
35
|
+
getErrors: () => string[];
|
|
36
|
+
}
|
|
37
|
+
/** form 通过 provide 提供给 form-item 的上下文 */
|
|
38
|
+
export interface FormContext {
|
|
39
|
+
model: Ref<Record<string, unknown>>;
|
|
40
|
+
rules: Ref<FormRules>;
|
|
41
|
+
labelWidth: Ref<number | string>;
|
|
42
|
+
labelPosition: Ref<FormLabelPosition>;
|
|
43
|
+
inline: Ref<boolean>;
|
|
44
|
+
disabled: Ref<boolean>;
|
|
45
|
+
validateOnChange: Ref<boolean>;
|
|
46
|
+
addField: (field: FormItemContext) => void;
|
|
47
|
+
removeField: (field: FormItemContext) => void;
|
|
48
|
+
resetField: (prop: string) => void;
|
|
49
|
+
clearValidate: (props?: string[]) => void;
|
|
50
|
+
validateField: (props?: string[], callback?: FormValidateCallback) => Promise<boolean>;
|
|
51
|
+
}
|
|
52
|
+
/** form 实例暴露的方法(ref 类型) */
|
|
53
|
+
export interface FormInstance {
|
|
54
|
+
validate: (callback?: FormValidateCallback) => Promise<boolean>;
|
|
55
|
+
validateField: (props?: string[], callback?: FormValidateCallback) => Promise<boolean>;
|
|
56
|
+
resetFields: () => void;
|
|
57
|
+
clearValidate: (props?: string[]) => void;
|
|
58
|
+
scrollToField: (prop: string) => void;
|
|
59
|
+
}
|
|
60
|
+
export declare const formContextKey: InjectionKey<FormContext>;
|
|
61
|
+
export declare const formProps: {
|
|
62
|
+
/** 表单数据(字段值都挂在这个对象上) */
|
|
63
|
+
readonly model: {
|
|
64
|
+
readonly type: PropType<Record<string, unknown>>;
|
|
65
|
+
readonly default: undefined;
|
|
66
|
+
};
|
|
67
|
+
/** 校验规则:{ prop: rule | rule[] } */
|
|
68
|
+
readonly rules: {
|
|
69
|
+
readonly type: PropType<FormRules>;
|
|
70
|
+
readonly default: () => {};
|
|
71
|
+
};
|
|
72
|
+
/** 标签宽度,number(px) 或 string */
|
|
73
|
+
readonly labelWidth: {
|
|
74
|
+
readonly type: [NumberConstructor, StringConstructor];
|
|
75
|
+
readonly default: 90;
|
|
76
|
+
};
|
|
77
|
+
/** 标签位置 */
|
|
78
|
+
readonly labelPosition: {
|
|
79
|
+
readonly type: PropType<FormLabelPosition>;
|
|
80
|
+
readonly default: "right";
|
|
81
|
+
};
|
|
82
|
+
/** 行内布局(表单项水平排列) */
|
|
83
|
+
readonly inline: BooleanConstructor;
|
|
84
|
+
/** 整表禁用(提供到上下文,样式级生效,子控件可自行消费) */
|
|
85
|
+
readonly disabled: BooleanConstructor;
|
|
86
|
+
/** 字段 change / blur 时是否立即校验对应 trigger 的规则 */
|
|
87
|
+
readonly validateOnChange: {
|
|
88
|
+
readonly type: BooleanConstructor;
|
|
89
|
+
readonly default: true;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
export declare const formEmits: {
|
|
93
|
+
/** 原生提交(先做整表校验),参数为是否校验通过 */
|
|
94
|
+
readonly submit: (isValid: boolean, model: Record<string, unknown>) => boolean;
|
|
95
|
+
};
|
|
96
|
+
export type FormProps = ExtractPropTypes<typeof formProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { default as Icon } from './src/icon.vue';
|
|
3
|
+
|
|
4
|
+
export declare const IconPlugin: {
|
|
5
|
+
name: string;
|
|
6
|
+
install(app: App): void;
|
|
7
|
+
};
|
|
8
|
+
export { Icon };
|
|
9
|
+
export default Icon;
|
|
10
|
+
export * from './src/icon';
|
|
11
|
+
export * from './src/icons';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const iconProps: {
|
|
4
|
+
readonly name: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly required: true;
|
|
7
|
+
};
|
|
8
|
+
readonly size: {
|
|
9
|
+
readonly type: [NumberConstructor, StringConstructor];
|
|
10
|
+
readonly default: 16;
|
|
11
|
+
};
|
|
12
|
+
readonly color: {
|
|
13
|
+
readonly type: StringConstructor;
|
|
14
|
+
readonly default: "";
|
|
15
|
+
};
|
|
16
|
+
readonly spin: BooleanConstructor;
|
|
17
|
+
};
|
|
18
|
+
export type IconProps = ExtractPropTypes<typeof iconProps>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare const icons: {
|
|
2
|
+
readonly search: "<circle cx=\"11\" cy=\"11\" r=\"8\" /><line x1=\"21\" y1=\"21\" x2=\"16.65\" y2=\"16.65\" />";
|
|
3
|
+
readonly plus: "<line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\" /><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" />";
|
|
4
|
+
readonly minus: "<line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" />";
|
|
5
|
+
readonly close: "<line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" /><line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />";
|
|
6
|
+
readonly check: "<polyline points=\"20 6 9 17 4 12\" />";
|
|
7
|
+
readonly loading: "<path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />";
|
|
8
|
+
readonly refresh: "<polyline points=\"23 4 23 10 17 10\" /><polyline points=\"1 20 1 14 7 14\" /><path d=\"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15\" />";
|
|
9
|
+
readonly edit: "<path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\" /><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\" />";
|
|
10
|
+
readonly delete: "<polyline points=\"3 6 5 6 21 6\" /><path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\" /><line x1=\"10\" y1=\"11\" x2=\"10\" y2=\"17\" /><line x1=\"14\" y1=\"11\" x2=\"14\" y2=\"17\" />";
|
|
11
|
+
readonly download: "<path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" /><polyline points=\"7 10 12 15 17 10\" /><line x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\" />";
|
|
12
|
+
readonly upload: "<path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" /><polyline points=\"17 8 12 3 7 8\" /><line x1=\"12\" y1=\"3\" x2=\"12\" y2=\"15\" />";
|
|
13
|
+
readonly setting: "<circle cx=\"12\" cy=\"12\" r=\"3\" /><path d=\"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z\" />";
|
|
14
|
+
readonly user: "<path d=\"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2\" /><circle cx=\"12\" cy=\"7\" r=\"4\" />";
|
|
15
|
+
readonly home: "<path d=\"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\" /><polyline points=\"9 22 9 12 15 12 15 22\" />";
|
|
16
|
+
readonly calendar: "<rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\" /><line x1=\"16\" y1=\"2\" x2=\"16\" y2=\"6\" /><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"6\" /><line x1=\"3\" y1=\"10\" x2=\"21\" y2=\"10\" />";
|
|
17
|
+
readonly clock: "<circle cx=\"12\" cy=\"12\" r=\"10\" /><polyline points=\"12 6 12 12 16 14\" />";
|
|
18
|
+
readonly star: "<polygon points=\"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2\" />";
|
|
19
|
+
readonly heart: "<path d=\"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z\" />";
|
|
20
|
+
readonly message: "<path d=\"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z\" />";
|
|
21
|
+
readonly bell: "<path d=\"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9\" /><path d=\"M13.73 21a2 2 0 0 1-3.46 0\" />";
|
|
22
|
+
readonly mail: "<path d=\"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z\" /><polyline points=\"22,6 12,13 2,6\" />";
|
|
23
|
+
readonly eye: "<path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\" /><circle cx=\"12\" cy=\"12\" r=\"3\" />";
|
|
24
|
+
readonly lock: "<rect x=\"3\" y=\"11\" width=\"18\" height=\"11\" rx=\"2\" ry=\"2\" /><path d=\"M7 11V7a5 5 0 0 1 10 0v4\" />";
|
|
25
|
+
readonly link: "<path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\" /><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\" />";
|
|
26
|
+
readonly 'arrow-up': "<line x1=\"12\" y1=\"19\" x2=\"12\" y2=\"5\" /><polyline points=\"5 12 12 5 19 12\" />";
|
|
27
|
+
readonly 'arrow-down': "<line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\" /><polyline points=\"19 12 12 19 5 12\" />";
|
|
28
|
+
readonly 'arrow-left': "<line x1=\"19\" y1=\"12\" x2=\"5\" y2=\"12\" /><polyline points=\"12 19 5 12 12 5\" />";
|
|
29
|
+
readonly 'arrow-right': "<line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" /><polyline points=\"12 5 19 12 12 19\" />";
|
|
30
|
+
readonly 'chevron-up': "<polyline points=\"18 15 12 9 6 15\" />";
|
|
31
|
+
readonly 'chevron-down': "<polyline points=\"6 9 12 15 18 9\" />";
|
|
32
|
+
readonly 'chevron-left': "<polyline points=\"15 18 9 12 15 6\" />";
|
|
33
|
+
readonly 'chevron-right': "<polyline points=\"9 18 15 12 9 6\" />";
|
|
34
|
+
readonly more: "<circle cx=\"12\" cy=\"12\" r=\"1\" /><circle cx=\"19\" cy=\"12\" r=\"1\" /><circle cx=\"5\" cy=\"12\" r=\"1\" />";
|
|
35
|
+
readonly menu: "<line x1=\"3\" y1=\"12\" x2=\"21\" y2=\"12\" /><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\" /><line x1=\"3\" y1=\"18\" x2=\"21\" y2=\"18\" />";
|
|
36
|
+
readonly filter: "<polygon points=\"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3\" />";
|
|
37
|
+
readonly copy: "<rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\" /><path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\" />";
|
|
38
|
+
readonly 'external-link': "<path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" /><polyline points=\"15 3 21 3 21 9\" /><line x1=\"10\" y1=\"14\" x2=\"21\" y2=\"3\" />";
|
|
39
|
+
readonly zap: "<polygon points=\"13 2 3 14 12 14 11 22 21 10 12 10 13 2\" />";
|
|
40
|
+
readonly 'log-out': "<path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\" /><polyline points=\"16 17 21 12 16 7\" /><line x1=\"21\" y1=\"12\" x2=\"9\" y2=\"12\" />";
|
|
41
|
+
readonly grid: "<rect x=\"3\" y=\"3\" width=\"7\" height=\"7\" /><rect x=\"14\" y=\"3\" width=\"7\" height=\"7\" /><rect x=\"14\" y=\"14\" width=\"7\" height=\"7\" /><rect x=\"3\" y=\"14\" width=\"7\" height=\"7\" />";
|
|
42
|
+
readonly info: "<circle cx=\"12\" cy=\"12\" r=\"10\" /><line x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\" /><line x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\" />";
|
|
43
|
+
readonly success: "<path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\" /><polyline points=\"22 4 12 14.01 9 11.01\" />";
|
|
44
|
+
readonly warning: "<path d=\"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\" /><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\" /><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\" />";
|
|
45
|
+
readonly error: "<circle cx=\"12\" cy=\"12\" r=\"10\" /><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\" /><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\" />";
|
|
46
|
+
readonly question: "<circle cx=\"12\" cy=\"12\" r=\"10\" /><path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" /><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\" />";
|
|
47
|
+
readonly 'plus-circle': "<circle cx=\"12\" cy=\"12\" r=\"10\" /><line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"16\" /><line x1=\"8\" y1=\"12\" x2=\"16\" y2=\"12\" />";
|
|
48
|
+
};
|
|
49
|
+
export type IconName = keyof typeof icons;
|
|
50
|
+
export declare function hasIcon(name: string): name is IconName;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const inputProps: {
|
|
4
|
+
readonly modelValue: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly default: undefined;
|
|
7
|
+
};
|
|
8
|
+
readonly type: {
|
|
9
|
+
readonly type: StringConstructor;
|
|
10
|
+
readonly default: "text";
|
|
11
|
+
};
|
|
12
|
+
readonly placeholder: {
|
|
13
|
+
readonly type: StringConstructor;
|
|
14
|
+
readonly default: "";
|
|
15
|
+
};
|
|
16
|
+
readonly disabled: BooleanConstructor;
|
|
17
|
+
readonly clearable: BooleanConstructor;
|
|
18
|
+
};
|
|
19
|
+
export declare const inputEmits: {
|
|
20
|
+
'update:modelValue': (val: string) => boolean;
|
|
21
|
+
input: (val: string) => boolean;
|
|
22
|
+
change: (val: string) => boolean;
|
|
23
|
+
clear: () => boolean;
|
|
24
|
+
};
|
|
25
|
+
export type InputProps = ExtractPropTypes<typeof inputProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const linkProps: {
|
|
4
|
+
readonly type: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly default: "default";
|
|
7
|
+
};
|
|
8
|
+
readonly href: {
|
|
9
|
+
readonly type: StringConstructor;
|
|
10
|
+
readonly default: "";
|
|
11
|
+
};
|
|
12
|
+
readonly target: {
|
|
13
|
+
readonly type: StringConstructor;
|
|
14
|
+
readonly default: "_self";
|
|
15
|
+
};
|
|
16
|
+
readonly underline: {
|
|
17
|
+
readonly type: BooleanConstructor;
|
|
18
|
+
readonly default: true;
|
|
19
|
+
};
|
|
20
|
+
readonly disabled: BooleanConstructor;
|
|
21
|
+
};
|
|
22
|
+
export declare const linkEmits: {
|
|
23
|
+
click: (e: MouseEvent) => boolean;
|
|
24
|
+
};
|
|
25
|
+
export type LinkProps = ExtractPropTypes<typeof linkProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const loadingProps: {
|
|
4
|
+
readonly visible: BooleanConstructor;
|
|
5
|
+
readonly text: {
|
|
6
|
+
readonly type: StringConstructor;
|
|
7
|
+
readonly default: "";
|
|
8
|
+
};
|
|
9
|
+
readonly fullscreen: BooleanConstructor;
|
|
10
|
+
readonly background: {
|
|
11
|
+
readonly type: StringConstructor;
|
|
12
|
+
readonly default: "";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type LoadingProps = ExtractPropTypes<typeof loadingProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { default as Menu } from './src/menu.vue';
|
|
3
|
+
import { default as MenuItem } from './src/menu-item.vue';
|
|
4
|
+
import { default as SubMenu } from './src/sub-menu.vue';
|
|
5
|
+
|
|
6
|
+
export declare const MenuPlugin: {
|
|
7
|
+
name: string;
|
|
8
|
+
install(app: App): void;
|
|
9
|
+
};
|
|
10
|
+
export { Menu, MenuItem, SubMenu };
|
|
11
|
+
export default Menu;
|
|
12
|
+
export * from './src/menu';
|
|
13
|
+
export * from './src/menu-item';
|
|
14
|
+
export * from './src/sub-menu';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const menuItemProps: {
|
|
4
|
+
/** 唯一索引,选中时通过 select 事件回传 */
|
|
5
|
+
readonly index: {
|
|
6
|
+
readonly type: StringConstructor;
|
|
7
|
+
readonly required: true;
|
|
8
|
+
};
|
|
9
|
+
/** 是否禁用 */
|
|
10
|
+
readonly disabled: BooleanConstructor;
|
|
11
|
+
};
|
|
12
|
+
export type MenuItemProps = ExtractPropTypes<typeof menuItemProps>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ExtractPropTypes, InjectionKey, Ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const menuProps: {
|
|
4
|
+
/** 菜单模式:vertical | horizontal */
|
|
5
|
+
readonly mode: {
|
|
6
|
+
readonly type: StringConstructor;
|
|
7
|
+
readonly default: "vertical";
|
|
8
|
+
};
|
|
9
|
+
/** 当前激活菜单项索引 */
|
|
10
|
+
readonly defaultActive: {
|
|
11
|
+
readonly type: StringConstructor;
|
|
12
|
+
readonly default: "";
|
|
13
|
+
};
|
|
14
|
+
/** 是否只允许展开一个子菜单 */
|
|
15
|
+
readonly uniqueOpened: BooleanConstructor;
|
|
16
|
+
};
|
|
17
|
+
export declare const menuEmits: {
|
|
18
|
+
/** 点击菜单项时触发,参数为该菜单项索引 */
|
|
19
|
+
select: (index: string) => boolean;
|
|
20
|
+
/** 子菜单展开时触发 */
|
|
21
|
+
open: (index: string) => boolean;
|
|
22
|
+
/** 子菜单收起时触发 */
|
|
23
|
+
close: (index: string) => boolean;
|
|
24
|
+
};
|
|
25
|
+
export type MenuProps = ExtractPropTypes<typeof menuProps>;
|
|
26
|
+
/** 提供给 MenuItem / SubMenu 的上下文 */
|
|
27
|
+
export interface MenuContext {
|
|
28
|
+
mode: string;
|
|
29
|
+
activeIndex: Ref<string>;
|
|
30
|
+
uniqueOpened: boolean;
|
|
31
|
+
select: (index: string) => void;
|
|
32
|
+
subMenuOpenIndexes: Ref<string[]>;
|
|
33
|
+
/** 垂直模式:点击标题展开/收起(收起时连带关闭子孙) */
|
|
34
|
+
toggleSubMenu: (index: string) => void;
|
|
35
|
+
/** 水平模式:悬停展开(只保留当前一个,联动关闭其他) */
|
|
36
|
+
openSubMenu: (index: string) => void;
|
|
37
|
+
/** 水平模式:移出后收起 */
|
|
38
|
+
closeSubMenu: (index: string) => void;
|
|
39
|
+
}
|
|
40
|
+
export declare const menuContextKey: InjectionKey<MenuContext>;
|