@ccn-ui-kit/rich-editor 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 +195 -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/rich-editor/src/rich-editor.vue.d.ts +56 -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 +104 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),b={modelValue:{type:String,default:void 0},placeholder:{type:String,default:"请输入内容"},disabled:Boolean,minHeight:{type:[Number,String],default:120},toolbar:{type:Array,default:void 0}},v={"update:modelValue":r=>typeof r=="string",input:r=>typeof r=="string",change:r=>typeof r=="string",focus:()=>!0,blur:()=>!0},M={class:"ui-rich-editor__toolbar",role:"toolbar","aria-label":"格式工具栏"},H={key:0,class:"ui-rich-editor__divider","aria-hidden":"true"},R=["disabled","title","aria-pressed","onClick"],P=["contenteditable","data-placeholder"],p=t.defineComponent({__name:"rich-editor",props:b,emits:v,setup(r,{emit:E}){const i=r,s=E,m=[{key:"bold",group:0,command:"bold",state:"bold",label:"B",title:"加粗"},{key:"italic",group:0,command:"italic",state:"italic",label:"I",title:"斜体"},{key:"underline",group:0,command:"underline",state:"underline",label:"U",title:"下划线"},{key:"strike",group:0,command:"strikeThrough",state:"strikeThrough",label:"S",title:"删除线"},{key:"header",group:1,command:"formatBlock",value:"H2",state:"formatBlock",label:"H2",title:"二级标题"},{key:"paragraph",group:1,command:"formatBlock",value:"P",state:"formatBlock",label:"P",title:"正文"},{key:"ul",group:2,command:"insertUnorderedList",state:"insertUnorderedList",label:"列表",title:"无序列表"},{key:"ol",group:2,command:"insertOrderedList",state:"insertOrderedList",label:"编号",title:"有序列表"},{key:"align-left",group:3,command:"justifyLeft",state:"justifyLeft",label:"左",title:"左对齐"},{key:"align-center",group:3,command:"justifyCenter",state:"justifyCenter",label:"中",title:"居中对齐"},{key:"align-right",group:3,command:"justifyRight",state:"justifyRight",label:"右",title:"右对齐"},{key:"link",group:4,command:"createLink",label:"链接",title:"插入链接",type:"link"},{key:"image",group:4,command:"insertImage",label:"图片",title:"插入图片",type:"image"},{key:"undo",group:5,command:"undo",label:"撤销",title:"撤销"},{key:"redo",group:5,command:"redo",label:"重做",title:"重做"},{key:"clear",group:5,command:"removeFormat",label:"清除",title:"清除格式"}],f=t.ref(i.modelValue??""),a=t.ref(null),d=t.ref(new Set),g=t.ref(!0),B=t.computed(()=>i.toolbar?m.filter(e=>i.toolbar.includes(e.key)):m),_=t.computed(()=>{const e=[];for(const o of B.value)e[o.group]||(e[o.group]=[]),e[o.group].push(o);return e.filter(o=>o.length>0)}),L=t.computed(()=>{const e=i.minHeight;return{minHeight:typeof e=="number"?`${e}px`:e}});function y(){var o;const e=((o=a.value)==null?void 0:o.innerHTML)??"";f.value=e,s("update:modelValue",e),s("input",e),h()}function S(e){const o=a.value;if(!(!o||i.disabled)){if(o.focus(),e.type==="link"){const n=window.prompt("请输入链接地址","https://");n&&document.execCommand("createLink",!1,n)}else if(e.type==="image"){const n=window.prompt("请输入图片地址");n&&document.execCommand("insertImage",!1,n)}else document.execCommand(e.command,!1,e.value);y(),l()}}function l(){const e=a.value;if(!e||document.activeElement!==e){d.value=new Set;return}const o=new Set;for(const n of m)if(n.state)if(n.state==="formatBlock"){const c=String(document.queryCommandValue("formatBlock")||"").toLowerCase();c==="h2"?o.add("header"):c==="p"&&o.add("paragraph")}else C(n.state)&&o.add(n.key);d.value=o}function C(e){try{return document.queryCommandState(e)}catch{return!1}}function h(){const e=a.value;e&&(g.value=e.innerText.trim()==="")}function k(){const e=a.value;if(!e)return;const o=i.modelValue??f.value;e.innerHTML!==o&&(e.innerHTML=o),h()}function T(){y(),l()}function V(){s("focus"),l()}function w(){var e;s("change",((e=a.value)==null?void 0:e.innerHTML)??""),s("blur"),l()}return t.onMounted(()=>{k(),document.addEventListener("selectionchange",l)}),t.onBeforeUnmount(()=>{document.removeEventListener("selectionchange",l)}),t.watch(()=>i.modelValue,k),(e,o)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["ui-rich-editor",{"is-disabled":e.disabled}])},[t.createElementVNode("div",M,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.value,(n,c)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:c},[c>0?(t.openBlock(),t.createElementBlock("span",H)):t.createCommentVNode("v-if",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n,u=>(t.openBlock(),t.createElementBlock("button",{key:u.key,type:"button",class:t.normalizeClass(["ui-rich-editor__tool",{"is-active":d.value.has(u.key)}]),disabled:e.disabled,title:u.title,"aria-pressed":u.state?d.value.has(u.key):void 0,onMousedown:o[0]||(o[0]=t.withModifiers(()=>{},["prevent"])),onClick:F=>S(u)},t.toDisplayString(u.label),43,R))),128))],64))),128))]),t.createElementVNode("div",{ref_key:"editorRef",ref:a,class:t.normalizeClass(["ui-rich-editor__content",{"is-empty":g.value}]),contenteditable:!e.disabled,"data-placeholder":e.placeholder,style:t.normalizeStyle(L.value),onInput:T,onFocus:V,onBlur:w,onKeyup:l,onMouseup:l},null,46,P)],2))}}),j={name:"UiRichEditor",install(r){r.component("UiRichEditor",p)}};exports.RichEditor=p;exports.RichEditorPlugin=j;exports.default=p;exports.richEditorEmits=v;exports.richEditorProps=b;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { defineComponent as U, ref as p, computed as y, onMounted as F, onBeforeUnmount as I, watch as P, openBlock as u, createElementBlock as s, normalizeClass as g, createElementVNode as S, Fragment as h, renderList as C, createCommentVNode as O, withModifiers as q, toDisplayString as x, normalizeStyle as N } from "vue";
|
|
2
|
+
const z = {
|
|
3
|
+
/** 富文本 HTML 内容(v-model) */
|
|
4
|
+
modelValue: { type: String, default: void 0 },
|
|
5
|
+
/** 空内容时的占位文案 */
|
|
6
|
+
placeholder: { type: String, default: "请输入内容" },
|
|
7
|
+
/** 是否禁用 */
|
|
8
|
+
disabled: Boolean,
|
|
9
|
+
/** 编辑区最小高度:数字按 px,字符串作为 CSS 长度 */
|
|
10
|
+
minHeight: { type: [Number, String], default: 120 },
|
|
11
|
+
/** 工具栏按钮子集(key 见 Tool 配置);缺省展示全部 */
|
|
12
|
+
toolbar: { type: Array, default: void 0 }
|
|
13
|
+
}, $ = {
|
|
14
|
+
"update:modelValue": (n) => typeof n == "string",
|
|
15
|
+
/** 内容变化时触发 */
|
|
16
|
+
input: (n) => typeof n == "string",
|
|
17
|
+
/** 失焦时触发(提交值) */
|
|
18
|
+
change: (n) => typeof n == "string",
|
|
19
|
+
focus: () => !0,
|
|
20
|
+
blur: () => !0
|
|
21
|
+
}, A = {
|
|
22
|
+
class: "ui-rich-editor__toolbar",
|
|
23
|
+
role: "toolbar",
|
|
24
|
+
"aria-label": "格式工具栏"
|
|
25
|
+
}, D = {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "ui-rich-editor__divider",
|
|
28
|
+
"aria-hidden": "true"
|
|
29
|
+
}, K = ["disabled", "title", "aria-pressed", "onClick"], G = ["contenteditable", "data-placeholder"], J = /* @__PURE__ */ U({
|
|
30
|
+
__name: "rich-editor",
|
|
31
|
+
props: z,
|
|
32
|
+
emits: $,
|
|
33
|
+
setup(n, { emit: E }) {
|
|
34
|
+
const r = n, d = E, f = [
|
|
35
|
+
{ key: "bold", group: 0, command: "bold", state: "bold", label: "B", title: "加粗" },
|
|
36
|
+
{ key: "italic", group: 0, command: "italic", state: "italic", label: "I", title: "斜体" },
|
|
37
|
+
{ key: "underline", group: 0, command: "underline", state: "underline", label: "U", title: "下划线" },
|
|
38
|
+
{ key: "strike", group: 0, command: "strikeThrough", state: "strikeThrough", label: "S", title: "删除线" },
|
|
39
|
+
{ key: "header", group: 1, command: "formatBlock", value: "H2", state: "formatBlock", label: "H2", title: "二级标题" },
|
|
40
|
+
{ key: "paragraph", group: 1, command: "formatBlock", value: "P", state: "formatBlock", label: "P", title: "正文" },
|
|
41
|
+
{ key: "ul", group: 2, command: "insertUnorderedList", state: "insertUnorderedList", label: "列表", title: "无序列表" },
|
|
42
|
+
{ key: "ol", group: 2, command: "insertOrderedList", state: "insertOrderedList", label: "编号", title: "有序列表" },
|
|
43
|
+
{ key: "align-left", group: 3, command: "justifyLeft", state: "justifyLeft", label: "左", title: "左对齐" },
|
|
44
|
+
{ key: "align-center", group: 3, command: "justifyCenter", state: "justifyCenter", label: "中", title: "居中对齐" },
|
|
45
|
+
{ key: "align-right", group: 3, command: "justifyRight", state: "justifyRight", label: "右", title: "右对齐" },
|
|
46
|
+
{ key: "link", group: 4, command: "createLink", label: "链接", title: "插入链接", type: "link" },
|
|
47
|
+
{ key: "image", group: 4, command: "insertImage", label: "图片", title: "插入图片", type: "image" },
|
|
48
|
+
{ key: "undo", group: 5, command: "undo", label: "撤销", title: "撤销" },
|
|
49
|
+
{ key: "redo", group: 5, command: "redo", label: "重做", title: "重做" },
|
|
50
|
+
{ key: "clear", group: 5, command: "removeFormat", label: "清除", title: "清除格式" }
|
|
51
|
+
], b = p(r.modelValue ?? ""), a = p(null), m = p(/* @__PURE__ */ new Set()), k = p(!0), B = y(() => r.toolbar ? f.filter((e) => r.toolbar.includes(e.key)) : f), T = y(() => {
|
|
52
|
+
const e = [];
|
|
53
|
+
for (const t of B.value)
|
|
54
|
+
e[t.group] || (e[t.group] = []), e[t.group].push(t);
|
|
55
|
+
return e.filter((t) => t.length > 0);
|
|
56
|
+
}), w = y(() => {
|
|
57
|
+
const e = r.minHeight;
|
|
58
|
+
return { minHeight: typeof e == "number" ? `${e}px` : e };
|
|
59
|
+
});
|
|
60
|
+
function v() {
|
|
61
|
+
var t;
|
|
62
|
+
const e = ((t = a.value) == null ? void 0 : t.innerHTML) ?? "";
|
|
63
|
+
b.value = e, d("update:modelValue", e), d("input", e), L();
|
|
64
|
+
}
|
|
65
|
+
function V(e) {
|
|
66
|
+
const t = a.value;
|
|
67
|
+
if (!(!t || r.disabled)) {
|
|
68
|
+
if (t.focus(), e.type === "link") {
|
|
69
|
+
const o = window.prompt("请输入链接地址", "https://");
|
|
70
|
+
o && document.execCommand("createLink", !1, o);
|
|
71
|
+
} else if (e.type === "image") {
|
|
72
|
+
const o = window.prompt("请输入图片地址");
|
|
73
|
+
o && document.execCommand("insertImage", !1, o);
|
|
74
|
+
} else
|
|
75
|
+
document.execCommand(e.command, !1, e.value);
|
|
76
|
+
v(), i();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function i() {
|
|
80
|
+
const e = a.value;
|
|
81
|
+
if (!e || document.activeElement !== e) {
|
|
82
|
+
m.value = /* @__PURE__ */ new Set();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const t = /* @__PURE__ */ new Set();
|
|
86
|
+
for (const o of f)
|
|
87
|
+
if (o.state)
|
|
88
|
+
if (o.state === "formatBlock") {
|
|
89
|
+
const c = String(document.queryCommandValue("formatBlock") || "").toLowerCase();
|
|
90
|
+
c === "h2" ? t.add("header") : c === "p" && t.add("paragraph");
|
|
91
|
+
} else H(o.state) && t.add(o.key);
|
|
92
|
+
m.value = t;
|
|
93
|
+
}
|
|
94
|
+
function H(e) {
|
|
95
|
+
try {
|
|
96
|
+
return document.queryCommandState(e);
|
|
97
|
+
} catch {
|
|
98
|
+
return !1;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function L() {
|
|
102
|
+
const e = a.value;
|
|
103
|
+
e && (k.value = e.innerText.trim() === "");
|
|
104
|
+
}
|
|
105
|
+
function _() {
|
|
106
|
+
const e = a.value;
|
|
107
|
+
if (!e) return;
|
|
108
|
+
const t = r.modelValue ?? b.value;
|
|
109
|
+
e.innerHTML !== t && (e.innerHTML = t), L();
|
|
110
|
+
}
|
|
111
|
+
function M() {
|
|
112
|
+
v(), i();
|
|
113
|
+
}
|
|
114
|
+
function R() {
|
|
115
|
+
d("focus"), i();
|
|
116
|
+
}
|
|
117
|
+
function j() {
|
|
118
|
+
var e;
|
|
119
|
+
d("change", ((e = a.value) == null ? void 0 : e.innerHTML) ?? ""), d("blur"), i();
|
|
120
|
+
}
|
|
121
|
+
return F(() => {
|
|
122
|
+
_(), document.addEventListener("selectionchange", i);
|
|
123
|
+
}), I(() => {
|
|
124
|
+
document.removeEventListener("selectionchange", i);
|
|
125
|
+
}), P(() => r.modelValue, _), (e, t) => (u(), s(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
class: g(["ui-rich-editor", { "is-disabled": e.disabled }])
|
|
129
|
+
},
|
|
130
|
+
[
|
|
131
|
+
S("div", A, [
|
|
132
|
+
(u(!0), s(
|
|
133
|
+
h,
|
|
134
|
+
null,
|
|
135
|
+
C(T.value, (o, c) => (u(), s(
|
|
136
|
+
h,
|
|
137
|
+
{ key: c },
|
|
138
|
+
[
|
|
139
|
+
c > 0 ? (u(), s("span", D)) : O("v-if", !0),
|
|
140
|
+
(u(!0), s(
|
|
141
|
+
h,
|
|
142
|
+
null,
|
|
143
|
+
C(o, (l) => (u(), s("button", {
|
|
144
|
+
key: l.key,
|
|
145
|
+
type: "button",
|
|
146
|
+
class: g(["ui-rich-editor__tool", { "is-active": m.value.has(l.key) }]),
|
|
147
|
+
disabled: e.disabled,
|
|
148
|
+
title: l.title,
|
|
149
|
+
"aria-pressed": l.state ? m.value.has(l.key) : void 0,
|
|
150
|
+
onMousedown: t[0] || (t[0] = q(() => {
|
|
151
|
+
}, ["prevent"])),
|
|
152
|
+
onClick: (Q) => V(l)
|
|
153
|
+
}, x(l.label), 43, K))),
|
|
154
|
+
128
|
|
155
|
+
/* KEYED_FRAGMENT */
|
|
156
|
+
))
|
|
157
|
+
],
|
|
158
|
+
64
|
|
159
|
+
/* STABLE_FRAGMENT */
|
|
160
|
+
))),
|
|
161
|
+
128
|
|
162
|
+
/* KEYED_FRAGMENT */
|
|
163
|
+
))
|
|
164
|
+
]),
|
|
165
|
+
S("div", {
|
|
166
|
+
ref_key: "editorRef",
|
|
167
|
+
ref: a,
|
|
168
|
+
class: g(["ui-rich-editor__content", { "is-empty": k.value }]),
|
|
169
|
+
contenteditable: !e.disabled,
|
|
170
|
+
"data-placeholder": e.placeholder,
|
|
171
|
+
style: N(w.value),
|
|
172
|
+
onInput: M,
|
|
173
|
+
onFocus: R,
|
|
174
|
+
onBlur: j,
|
|
175
|
+
onKeyup: i,
|
|
176
|
+
onMouseup: i
|
|
177
|
+
}, null, 46, G)
|
|
178
|
+
],
|
|
179
|
+
2
|
|
180
|
+
/* CLASS */
|
|
181
|
+
));
|
|
182
|
+
}
|
|
183
|
+
}), X = {
|
|
184
|
+
name: "UiRichEditor",
|
|
185
|
+
install(n) {
|
|
186
|
+
n.component("UiRichEditor", J);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
export {
|
|
190
|
+
J as RichEditor,
|
|
191
|
+
X as RichEditorPlugin,
|
|
192
|
+
J as default,
|
|
193
|
+
$ as richEditorEmits,
|
|
194
|
+
z as richEditorProps
|
|
195
|
+
};
|
|
@@ -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,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,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>;
|