@ccn-ui-kit/breadcrumb 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 +64 -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-item.vue.d.ts +32 -0
- package/dist/packages/components/breadcrumb/src/breadcrumb.d.ts +10 -0
- package/dist/packages/components/breadcrumb/src/breadcrumb.vue.d.ts +23 -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/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 +40 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u={separator:{type:String,default:"/"}},n=Symbol("ui-breadcrumb-separator"),d={class:"ui-breadcrumb","aria-label":"breadcrumb"},m={class:"ui-breadcrumb__list"},c=e.defineComponent({__name:"breadcrumb",props:u,setup(t){const r=t;return e.provide(n,r.separator),(o,s)=>(e.openBlock(),e.createElementBlock("nav",d,[e.createElementVNode("ol",m,[e.renderSlot(o.$slots,"default")])]))}}),l={to:{type:String,default:""},replace:{type:Boolean,default:!1}},p={class:"ui-breadcrumb__item"},b={class:"ui-breadcrumb__separator"},i=e.defineComponent({__name:"breadcrumb-item",props:l,setup(t){const r=t,o=e.inject(n,"/");function s(a){r.to&&!r.replace&&(window.history.pushState(null,"",r.to),window.dispatchEvent(new PopStateEvent("popstate")),a.preventDefault())}return(a,f)=>(e.openBlock(),e.createElementBlock("li",p,[e.createCommentVNode(" 当前页(无 to)用 span,可点击项(有 to)用 a "),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.to?"a":"span"),{class:"ui-breadcrumb__inner",href:r.to,onClick:e.withModifiers(s,["prevent"])},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["href"])),e.createElementVNode("span",b,e.toDisplayString(e.unref(o)),1)]))}}),_={name:"UiBreadcrumb",install(t){t.component("UiBreadcrumb",c),t.component("UiBreadcrumbItem",i)}};exports.Breadcrumb=c;exports.BreadcrumbItem=i;exports.BreadcrumbPlugin=_;exports.breadcrumbItemProps=l;exports.breadcrumbProps=u;exports.breadcrumbSeparatorKey=n;exports.default=c;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { defineComponent as s, provide as l, openBlock as o, createElementBlock as c, createElementVNode as i, renderSlot as u, inject as m, createCommentVNode as d, createBlock as b, resolveDynamicComponent as _, withModifiers as f, withCtx as h, toDisplayString as B, unref as y } from "vue";
|
|
2
|
+
const S = {
|
|
3
|
+
separator: { type: String, default: "/" }
|
|
4
|
+
}, p = Symbol("ui-breadcrumb-separator"), v = {
|
|
5
|
+
class: "ui-breadcrumb",
|
|
6
|
+
"aria-label": "breadcrumb"
|
|
7
|
+
}, w = { class: "ui-breadcrumb__list" }, C = /* @__PURE__ */ s({
|
|
8
|
+
__name: "breadcrumb",
|
|
9
|
+
props: S,
|
|
10
|
+
setup(e) {
|
|
11
|
+
return l(p, e.separator), (r, n) => (o(), c("nav", v, [
|
|
12
|
+
i("ol", w, [
|
|
13
|
+
u(r.$slots, "default")
|
|
14
|
+
])
|
|
15
|
+
]));
|
|
16
|
+
}
|
|
17
|
+
}), k = {
|
|
18
|
+
to: { type: String, default: "" },
|
|
19
|
+
replace: { type: Boolean, default: !1 }
|
|
20
|
+
}, $ = { class: "ui-breadcrumb__item" }, g = { class: "ui-breadcrumb__separator" }, E = /* @__PURE__ */ s({
|
|
21
|
+
__name: "breadcrumb-item",
|
|
22
|
+
props: k,
|
|
23
|
+
setup(e) {
|
|
24
|
+
const t = e, r = m(p, "/");
|
|
25
|
+
function n(a) {
|
|
26
|
+
t.to && !t.replace && (window.history.pushState(null, "", t.to), window.dispatchEvent(new PopStateEvent("popstate")), a.preventDefault());
|
|
27
|
+
}
|
|
28
|
+
return (a, P) => (o(), c("li", $, [
|
|
29
|
+
d(" 当前页(无 to)用 span,可点击项(有 to)用 a "),
|
|
30
|
+
(o(), b(_(t.to ? "a" : "span"), {
|
|
31
|
+
class: "ui-breadcrumb__inner",
|
|
32
|
+
href: t.to,
|
|
33
|
+
onClick: f(n, ["prevent"])
|
|
34
|
+
}, {
|
|
35
|
+
default: h(() => [
|
|
36
|
+
u(a.$slots, "default")
|
|
37
|
+
]),
|
|
38
|
+
_: 3
|
|
39
|
+
/* FORWARDED */
|
|
40
|
+
}, 8, ["href"])),
|
|
41
|
+
i(
|
|
42
|
+
"span",
|
|
43
|
+
g,
|
|
44
|
+
B(y(r)),
|
|
45
|
+
1
|
|
46
|
+
/* TEXT */
|
|
47
|
+
)
|
|
48
|
+
]));
|
|
49
|
+
}
|
|
50
|
+
}), I = {
|
|
51
|
+
name: "UiBreadcrumb",
|
|
52
|
+
install(e) {
|
|
53
|
+
e.component("UiBreadcrumb", C), e.component("UiBreadcrumbItem", E);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
C as Breadcrumb,
|
|
58
|
+
E as BreadcrumbItem,
|
|
59
|
+
I as BreadcrumbPlugin,
|
|
60
|
+
k as breadcrumbItemProps,
|
|
61
|
+
S as breadcrumbProps,
|
|
62
|
+
p as breadcrumbSeparatorKey,
|
|
63
|
+
C as default
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const badgeProps: {
|
|
4
|
+
readonly value: {
|
|
5
|
+
readonly type: [NumberConstructor, StringConstructor];
|
|
6
|
+
readonly default: 0;
|
|
7
|
+
};
|
|
8
|
+
readonly max: {
|
|
9
|
+
readonly type: NumberConstructor;
|
|
10
|
+
readonly default: undefined;
|
|
11
|
+
};
|
|
12
|
+
readonly isDot: {
|
|
13
|
+
readonly type: BooleanConstructor;
|
|
14
|
+
readonly default: false;
|
|
15
|
+
};
|
|
16
|
+
readonly hidden: {
|
|
17
|
+
readonly type: BooleanConstructor;
|
|
18
|
+
readonly default: false;
|
|
19
|
+
};
|
|
20
|
+
readonly type: {
|
|
21
|
+
readonly type: StringConstructor;
|
|
22
|
+
readonly default: "danger";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export type BadgeProps = ExtractPropTypes<typeof badgeProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { default as Breadcrumb } from './src/breadcrumb.vue';
|
|
3
|
+
import { default as BreadcrumbItem } from './src/breadcrumb-item.vue';
|
|
4
|
+
|
|
5
|
+
export declare const BreadcrumbPlugin: {
|
|
6
|
+
name: string;
|
|
7
|
+
install(app: App): void;
|
|
8
|
+
};
|
|
9
|
+
export { Breadcrumb, BreadcrumbItem };
|
|
10
|
+
export default Breadcrumb;
|
|
11
|
+
export * from './src/breadcrumb';
|
|
12
|
+
export * from './src/breadcrumb-item';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const breadcrumbItemProps: {
|
|
4
|
+
readonly to: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly default: "";
|
|
7
|
+
};
|
|
8
|
+
readonly replace: {
|
|
9
|
+
readonly type: BooleanConstructor;
|
|
10
|
+
readonly default: false;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type BreadcrumbItemProps = ExtractPropTypes<typeof breadcrumbItemProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
default?(_: {}): any;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
5
|
+
readonly to: {
|
|
6
|
+
readonly type: StringConstructor;
|
|
7
|
+
readonly default: "";
|
|
8
|
+
};
|
|
9
|
+
readonly replace: {
|
|
10
|
+
readonly type: BooleanConstructor;
|
|
11
|
+
readonly default: false;
|
|
12
|
+
};
|
|
13
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
14
|
+
readonly to: {
|
|
15
|
+
readonly type: StringConstructor;
|
|
16
|
+
readonly default: "";
|
|
17
|
+
};
|
|
18
|
+
readonly replace: {
|
|
19
|
+
readonly type: BooleanConstructor;
|
|
20
|
+
readonly default: false;
|
|
21
|
+
};
|
|
22
|
+
}>> & Readonly<{}>, {
|
|
23
|
+
readonly to: string;
|
|
24
|
+
readonly replace: boolean;
|
|
25
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
26
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ExtractPropTypes, InjectionKey } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const breadcrumbProps: {
|
|
4
|
+
readonly separator: {
|
|
5
|
+
readonly type: StringConstructor;
|
|
6
|
+
readonly default: "/";
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export type BreadcrumbProps = ExtractPropTypes<typeof breadcrumbProps>;
|
|
10
|
+
export declare const breadcrumbSeparatorKey: InjectionKey<string>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
default?(_: {}): any;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
5
|
+
readonly separator: {
|
|
6
|
+
readonly type: StringConstructor;
|
|
7
|
+
readonly default: "/";
|
|
8
|
+
};
|
|
9
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
10
|
+
readonly separator: {
|
|
11
|
+
readonly type: StringConstructor;
|
|
12
|
+
readonly default: "/";
|
|
13
|
+
};
|
|
14
|
+
}>> & Readonly<{}>, {
|
|
15
|
+
readonly separator: string;
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
17
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -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>;
|