@me-framework/me-ui-antdv-next 0.0.29 → 0.0.30
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/code-box/code-item.vue.d.ts +14 -0
- package/dist/code-box/index.css +1 -0
- package/dist/code-box/index.d.ts +5 -0
- package/dist/code-box/index.js +178 -0
- package/dist/code-box/index.vue.d.ts +20 -0
- package/dist/code-box/types.d.ts +64 -0
- package/dist/env.d.ts +12 -0
- package/dist/index.d.ts +3 -1
- package/dist/input-property/index.css +1 -1
- package/dist/input-property/index.js +672 -120
- package/dist/input-property/index.vue.d.ts +6 -3
- package/dist/input-property/types.d.ts +79 -3
- package/dist/input-property/validate.d.ts +62 -5
- package/dist/me-ui-antdv-next.js +3595 -415
- package/dist/me-ui-antdv-next.umd.cjs +11 -9
- package/dist/resolver/index.js +3 -1
- package/dist/style.css +1 -1
- package/dist/utils/hljs.d.ts +19 -0
- package/package.json +2 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MeCodeItemProps } from './types';
|
|
2
|
+
declare var __VLS_1: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_1) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_base: import('vue').DefineComponent<MeCodeItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<MeCodeItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.me-code-box{--me-code-box-bg:#282c34;--me-code-box-header-bg:#21252b;--me-code-box-header-border:#2c313a;--me-code-box-border:#2c313a;--me-code-box-radius:6px;--me-code-box-text:#abb2bf;--me-code-box-text-muted:#5c6370;--me-code-box-tab-color:#8a919b;--me-code-box-tab-active-bg:#2c313a;--me-code-box-tab-active-color:#e6e6e6;--me-code-box-copy-bg:#ffffff1a;--me-code-box-copy-border:#fff3;--me-code-box-copy-color:#abb2bf;--me-code-box-copy-bg-hover:#ffffff26;--me-code-box-copy-color-hover:#fff;--me-code-box-ln-number:#5c6370;--me-code-box-ln-border:#3e4451;--me-code-box-desc-bg:#24282e;--me-code-box-desc-color:#8a919b;border:1px solid var(--me-code-box-border);border-radius:var(--me-code-box-radius);background-color:var(--me-code-box-bg);color:var(--me-code-box-text);font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:13px;line-height:1.6;position:relative;overflow:hidden}.me-code-box__header{background-color:var(--me-code-box-header-bg);border-bottom:1px solid var(--me-code-box-header-border);align-items:center;min-height:38px;padding:0 12px 0 4px;display:flex}.me-code-box__tabs{align-self:stretch;align-items:stretch;min-width:0;display:flex}.me-code-box__tab{border:none;border-right:1px solid var(--me-code-box-header-border);color:var(--me-code-box-tab-color);cursor:pointer;background:0 0;align-items:center;padding:0 16px;font-family:inherit;font-size:13px;transition:background-color .2s,color .2s;display:inline-flex}.me-code-box__tab:hover{color:var(--me-code-box-text)}.me-code-box__tab--active{background-color:var(--me-code-box-tab-active-bg);color:var(--me-code-box-tab-active-color)}.me-code-box__title{color:var(--me-code-box-text);text-overflow:ellipsis;white-space:nowrap;align-items:center;gap:6px;padding:0 4px;font-size:12px;display:inline-flex;overflow:hidden}.me-code-box__spacer{flex:1}.me-code-box__copy{border:1px solid var(--me-code-box-copy-border);background:var(--me-code-box-copy-bg);color:var(--me-code-box-copy-color);cursor:pointer;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;gap:4px;padding:4px 10px;font-family:inherit;font-size:12px;transition:background-color .2s,color .2s;display:inline-flex}.me-code-box__copy:hover{background:var(--me-code-box-copy-bg-hover);color:var(--me-code-box-copy-color-hover)}.me-code-box__desc{background-color:var(--me-code-box-desc-bg);border-bottom:1px solid var(--me-code-box-header-border);color:var(--me-code-box-desc-color);padding:6px 16px;font-size:12px;line-height:1.6}.me-code-box__pre{font-size:inherit;line-height:inherit;background:0 0;margin:0;padding:0;overflow:auto}.me-code-box__pre--pad>code{padding:12px 16px;display:block}.me-code-box__pre>code{display:block}.me-code-box .hljs-ln{border-collapse:collapse;width:auto}.me-code-box .hljs-ln td{background:0 0;border:none;padding:0}.me-code-box .hljs-ln .hljs-ln-numbers,.me-code-box .hljs-ln .hljs-ln-code{vertical-align:top}.me-code-box .hljs-ln .hljs-ln-numbers{text-align:right;width:50px;color:var(--me-code-box-ln-number);-webkit-user-select:none;user-select:none;border-right:1px solid var(--me-code-box-ln-border);padding:12px 8px!important}.me-code-box .hljs-ln .hljs-ln-n{display:block}.me-code-box .hljs-ln .hljs-ln-n:before{content:attr(data-line-number);font-size:12px;line-height:1.6}.me-code-box .hljs-ln .hljs-ln-code{padding:12px 16px!important}.me-code-box .hljs-ln .hljs-ln-line{white-space:pre;min-height:1.6em}.me-code-box .hljs-comment,.me-code-box .hljs-quote{color:#5c6370;font-style:italic}.me-code-box .hljs-doctag,.me-code-box .hljs-keyword,.me-code-box .hljs-formula{color:#c678dd}.me-code-box .hljs-section,.me-code-box .hljs-name,.me-code-box .hljs-selector-tag,.me-code-box .hljs-deletion,.me-code-box .hljs-subst{color:#e06c75}.me-code-box .hljs-literal{color:#56b6c2}.me-code-box .hljs-string,.me-code-box .hljs-regexp,.me-code-box .hljs-addition,.me-code-box .hljs-attribute,.me-code-box .hljs-meta .hljs-string{color:#98c379}.me-code-box .hljs-attr,.me-code-box .hljs-variable,.me-code-box .hljs-template-variable,.me-code-box .hljs-type,.me-code-box .hljs-selector-class,.me-code-box .hljs-selector-attr,.me-code-box .hljs-selector-pseudo,.me-code-box .hljs-number{color:#d19a66}.me-code-box .hljs-symbol,.me-code-box .hljs-bullet,.me-code-box .hljs-link,.me-code-box .hljs-meta,.me-code-box .hljs-selector-id,.me-code-box .hljs-title{color:#61aeee}.me-code-box .hljs-built_in,.me-code-box .hljs-title.class_,.me-code-box .hljs-class .hljs-title{color:#e6c07b}.me-code-box .hljs-emphasis{font-style:italic}.me-code-box .hljs-strong{font-weight:700}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, mergeProps as c, normalizeClass as l, normalizeStyle as u, onUnmounted as d, openBlock as f, ref as p, renderList as m, renderSlot as h, toDisplayString as g, unref as _, useSlots as v, watch as y } from "vue";
|
|
2
|
+
import { Check as b, Copy as x, FileCode as S } from "@lucide/vue";
|
|
3
|
+
import { message as C } from "antdv-next";
|
|
4
|
+
import w from "highlight.js/lib/core";
|
|
5
|
+
import T from "highlight.js/lib/languages/typescript";
|
|
6
|
+
import E from "highlight.js/lib/languages/javascript";
|
|
7
|
+
import D from "highlight.js/lib/languages/xml";
|
|
8
|
+
import O from "highlight.js/lib/languages/css";
|
|
9
|
+
import k from "highlight.js/lib/languages/scss";
|
|
10
|
+
import A from "highlight.js/lib/languages/json";
|
|
11
|
+
import j from "highlight.js/lib/languages/bash";
|
|
12
|
+
w.registerLanguage("ts", T), w.registerLanguage("typescript", T), w.registerLanguage("js", E), w.registerLanguage("javascript", E), w.registerLanguage("html", D), w.registerLanguage("xml", D), w.registerLanguage("vue", D), w.registerLanguage("css", O), w.registerLanguage("scss", k), w.registerLanguage("json", A), w.registerLanguage("bash", j), w.registerLanguage("shell", j);
|
|
13
|
+
var M = /\r\n|\r|\n/g, N = (e) => e.length === 0 ? [] : e.split(M), P = (e) => (e.trim().match(M) || []).length, F = (e) => {
|
|
14
|
+
let t = e.className || "";
|
|
15
|
+
if (!/hljs-/.test(t)) return;
|
|
16
|
+
let n = N(e.innerHTML), r = "";
|
|
17
|
+
for (let e = 0; e < n.length; e++) {
|
|
18
|
+
let i = n[e].length > 0 ? n[e] : " ";
|
|
19
|
+
r += `<span class="${t}">${i}</span>\n`;
|
|
20
|
+
}
|
|
21
|
+
e.innerHTML = r.trim();
|
|
22
|
+
}, I = (e) => {
|
|
23
|
+
let t = Array.from(e.childNodes);
|
|
24
|
+
for (let e of t) {
|
|
25
|
+
if (e.nodeType !== Node.ELEMENT_NODE) continue;
|
|
26
|
+
let t = e;
|
|
27
|
+
P(t.textContent || "") > 0 && (t.childNodes.length > 0 ? I(t) : F(t));
|
|
28
|
+
}
|
|
29
|
+
}, L = (e, t = !0) => {
|
|
30
|
+
if (!e || typeof document > "u") return e;
|
|
31
|
+
let n = document.createElement("code");
|
|
32
|
+
n.innerHTML = e, I(n);
|
|
33
|
+
let r = N(n.innerHTML);
|
|
34
|
+
return r.length > 0 && r[r.length - 1].trim() === "" && r.pop(), r.length <= 1 && !t ? e : `<table class="hljs-ln">${r.map((e, t) => {
|
|
35
|
+
let n = t + 1;
|
|
36
|
+
return `<tr><td class="hljs-ln-line hljs-ln-numbers" data-line-number="${n}"><div class="hljs-ln-n" data-line-number="${n}"></div></td><td class="hljs-ln-line hljs-ln-code" data-line-number="${n}">` + (e.length > 0 ? e : " ") + "</td></tr>";
|
|
37
|
+
}).join("")}</table>`;
|
|
38
|
+
}, R = (e, t) => t && w.getLanguage(t) ? w.highlight(e, { language: t }).value : w.highlightAuto(e).value, z = {
|
|
39
|
+
key: 0,
|
|
40
|
+
class: "me-code-box__header"
|
|
41
|
+
}, B = {
|
|
42
|
+
key: 0,
|
|
43
|
+
class: "me-code-box__tabs",
|
|
44
|
+
role: "tablist"
|
|
45
|
+
}, V = ["aria-selected", "onClick"], H = {
|
|
46
|
+
key: 1,
|
|
47
|
+
class: "me-code-box__title"
|
|
48
|
+
}, U = ["aria-label"], W = {
|
|
49
|
+
key: 1,
|
|
50
|
+
class: "me-code-box__desc"
|
|
51
|
+
}, G = ["innerHTML"], K = /* @__PURE__ */ s({
|
|
52
|
+
name: "MeCodeBox",
|
|
53
|
+
__name: "index",
|
|
54
|
+
props: {
|
|
55
|
+
code: {},
|
|
56
|
+
language: { default: "vue" },
|
|
57
|
+
title: {},
|
|
58
|
+
filename: {},
|
|
59
|
+
description: {},
|
|
60
|
+
items: { default: () => [] },
|
|
61
|
+
activeIndex: {},
|
|
62
|
+
defaultActiveIndex: { default: 0 },
|
|
63
|
+
showLineNumbers: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: !0
|
|
66
|
+
},
|
|
67
|
+
showCopy: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: !0
|
|
70
|
+
},
|
|
71
|
+
copyText: { default: "复制代码" },
|
|
72
|
+
copiedText: { default: "已复制" },
|
|
73
|
+
maxHeight: {}
|
|
74
|
+
},
|
|
75
|
+
emits: [
|
|
76
|
+
"update:activeIndex",
|
|
77
|
+
"change",
|
|
78
|
+
"copy"
|
|
79
|
+
],
|
|
80
|
+
setup(s, { emit: h }) {
|
|
81
|
+
let w = s, T = h, E = v();
|
|
82
|
+
d(() => {
|
|
83
|
+
clearTimeout(X);
|
|
84
|
+
});
|
|
85
|
+
let D = t(() => {
|
|
86
|
+
let e = E.default?.() ?? [], t = [];
|
|
87
|
+
for (let n of e) {
|
|
88
|
+
let e = n.type;
|
|
89
|
+
if (typeof e == "string" || (e?.name || e?.__name) !== "MeCodeItem") continue;
|
|
90
|
+
let r = n.props ?? {};
|
|
91
|
+
r.code != null && t.push({
|
|
92
|
+
label: r.label ?? "",
|
|
93
|
+
code: r.code,
|
|
94
|
+
description: r.description,
|
|
95
|
+
language: r.language ?? w.language
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return t;
|
|
99
|
+
}), O = t(() => w.items?.length ? w.items : D.value), k = t(() => O.value.length > 1), A = p(w.defaultActiveIndex), j = t({
|
|
100
|
+
get: () => w.activeIndex ?? Math.min(A.value, Math.max(O.value.length - 1, 0)),
|
|
101
|
+
set: (e) => {
|
|
102
|
+
A.value = e, T("update:activeIndex", e), T("change", e);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
y(O, () => {
|
|
106
|
+
let e = Math.max(O.value.length - 1, 0);
|
|
107
|
+
(w.activeIndex ?? A.value) > e && (A.value = 0, T("update:activeIndex", 0), T("change", 0));
|
|
108
|
+
});
|
|
109
|
+
let M = t(() => O.value[j.value]), N = t(() => M.value?.label || w.filename || w.title || ""), P = t(() => M.value?.description ?? w.description ?? ""), F = t(() => k.value || !!N.value || w.showCopy), I = t(() => M.value?.language || w.language), K = t(() => {
|
|
110
|
+
let e = M.value?.code ?? w.code ?? "";
|
|
111
|
+
if (!e) return "";
|
|
112
|
+
let t = R(e, I.value || "vue");
|
|
113
|
+
return w.showLineNumbers ? L(t) : t;
|
|
114
|
+
}), q = t(() => w.maxHeight ? { maxHeight: w.maxHeight } : void 0), J = (e) => {
|
|
115
|
+
e !== j.value && (j.value = e);
|
|
116
|
+
}, Y = p(!1), X, Z = async () => {
|
|
117
|
+
let e = M.value?.code ?? w.code ?? "";
|
|
118
|
+
if (e) try {
|
|
119
|
+
await navigator.clipboard.writeText(e), Y.value = !0, T("copy", e), C.success(`${w.copiedText},已复制到剪贴板`), clearTimeout(X), X = setTimeout(() => {
|
|
120
|
+
Y.value = !1;
|
|
121
|
+
}, 2e3);
|
|
122
|
+
} catch {
|
|
123
|
+
C.error("复制失败,请手动复制");
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
return (t, s) => (f(), i("div", c({ class: "me-code-box" }, t.$attrs), [
|
|
127
|
+
F.value ? (f(), i("div", z, [
|
|
128
|
+
k.value ? (f(), i("div", B, [(f(!0), i(e, null, m(O.value, (e, t) => (f(), i("button", {
|
|
129
|
+
key: t,
|
|
130
|
+
type: "button",
|
|
131
|
+
role: "tab",
|
|
132
|
+
class: l(["me-code-box__tab", { "me-code-box__tab--active": t === j.value }]),
|
|
133
|
+
"aria-selected": t === j.value,
|
|
134
|
+
onClick: (e) => J(t)
|
|
135
|
+
}, g(e.label), 11, V))), 128))])) : N.value ? (f(), i("div", H, [o(_(S), { size: 14 }), a("span", null, g(N.value), 1)])) : r("", !0),
|
|
136
|
+
s[0] ||= a("div", { class: "me-code-box__spacer" }, null, -1),
|
|
137
|
+
w.showCopy ? (f(), i("button", {
|
|
138
|
+
key: 2,
|
|
139
|
+
type: "button",
|
|
140
|
+
class: "me-code-box__copy",
|
|
141
|
+
"aria-label": Y.value ? w.copiedText : w.copyText,
|
|
142
|
+
onClick: Z
|
|
143
|
+
}, [Y.value ? (f(), n(_(b), {
|
|
144
|
+
key: 0,
|
|
145
|
+
size: 14
|
|
146
|
+
})) : (f(), n(_(x), {
|
|
147
|
+
key: 1,
|
|
148
|
+
size: 14
|
|
149
|
+
})), a("span", null, g(Y.value ? w.copiedText : w.copyText), 1)], 8, U)) : r("", !0)
|
|
150
|
+
])) : r("", !0),
|
|
151
|
+
P.value ? (f(), i("div", W, g(P.value), 1)) : r("", !0),
|
|
152
|
+
a("pre", {
|
|
153
|
+
class: l(["me-code-box__pre hljs", { "me-code-box__pre--pad": !w.showLineNumbers }]),
|
|
154
|
+
style: u(q.value)
|
|
155
|
+
}, [a("code", { innerHTML: K.value }, null, 8, G)], 6)
|
|
156
|
+
], 16));
|
|
157
|
+
}
|
|
158
|
+
}), q = /* @__PURE__ */ s({
|
|
159
|
+
name: "MeCodeItem",
|
|
160
|
+
__name: "code-item",
|
|
161
|
+
props: {
|
|
162
|
+
label: {},
|
|
163
|
+
code: {},
|
|
164
|
+
description: {},
|
|
165
|
+
language: {}
|
|
166
|
+
},
|
|
167
|
+
setup(e) {
|
|
168
|
+
return (e, t) => h(e.$slots, "default");
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
K.install = (e) => {
|
|
172
|
+
e.component("MeCodeBox", K), e.component("MeCodeItem", q);
|
|
173
|
+
}, q.install = (e) => {
|
|
174
|
+
e.component("MeCodeItem", q);
|
|
175
|
+
};
|
|
176
|
+
var J = K;
|
|
177
|
+
//#endregion
|
|
178
|
+
export { K as MeCodeBox, q as MeCodeItem, J as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MeCodeBoxItem, MeCodeBoxProps } from './types';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<MeCodeBoxProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
3
|
+
change: (index: number) => any;
|
|
4
|
+
"update:activeIndex": (index: number) => any;
|
|
5
|
+
copy: (code: string) => any;
|
|
6
|
+
}, string, import('vue').PublicProps, Readonly<MeCodeBoxProps> & Readonly<{
|
|
7
|
+
onChange?: ((index: number) => any) | undefined;
|
|
8
|
+
"onUpdate:activeIndex"?: ((index: number) => any) | undefined;
|
|
9
|
+
onCopy?: ((code: string) => any) | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
items: MeCodeBoxItem[];
|
|
12
|
+
language: string;
|
|
13
|
+
defaultActiveIndex: number;
|
|
14
|
+
showLineNumbers: boolean;
|
|
15
|
+
showCopy: boolean;
|
|
16
|
+
copyText: string;
|
|
17
|
+
copiedText: string;
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** MeCodeBox 单个代码块(code-group 数据项) */
|
|
2
|
+
export interface MeCodeBoxItem {
|
|
3
|
+
/** tab 标签 */
|
|
4
|
+
label: string;
|
|
5
|
+
/** 代码内容 */
|
|
6
|
+
code: string;
|
|
7
|
+
/** 描述信息(显示在头部下方描述条,跟随激活项) */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** 代码语言,默认继承 MeCodeBox 的 language prop */
|
|
10
|
+
language?: string;
|
|
11
|
+
}
|
|
12
|
+
/** MeCodeBox 组件 Props */
|
|
13
|
+
export interface MeCodeBoxProps {
|
|
14
|
+
/** 单一代码内容(与 items 互斥,items 优先) */
|
|
15
|
+
code?: string;
|
|
16
|
+
/** 单一代码语言,默认 'vue' */
|
|
17
|
+
language?: string;
|
|
18
|
+
/** 头部标题(单一代码模式下作为文件名展示) */
|
|
19
|
+
title?: string;
|
|
20
|
+
/** 文件名(单一代码模式,优先于 title) */
|
|
21
|
+
filename?: string;
|
|
22
|
+
/** 描述信息(显示在头部与代码区之间的描述条;code-group 时取激活项 description,回退到此值) */
|
|
23
|
+
description?: string;
|
|
24
|
+
/** code-group 数据(优先于插槽收集的 MeCodeItem) */
|
|
25
|
+
items?: MeCodeBoxItem[];
|
|
26
|
+
/** 受控激活索引(配合 v-model:activeIndex 使用) */
|
|
27
|
+
activeIndex?: number;
|
|
28
|
+
/** 非受控默认激活索引,默认 0 */
|
|
29
|
+
defaultActiveIndex?: number;
|
|
30
|
+
/** 是否显示行号,默认 true */
|
|
31
|
+
showLineNumbers?: boolean;
|
|
32
|
+
/** 是否显示复制按钮,默认 true */
|
|
33
|
+
showCopy?: boolean;
|
|
34
|
+
/** 复制按钮文案,默认 '复制代码' */
|
|
35
|
+
copyText?: string;
|
|
36
|
+
/** 复制成功文案,默认 '已复制' */
|
|
37
|
+
copiedText?: string;
|
|
38
|
+
/** 代码区最大高度(超出滚动),默认 '' 不限制 */
|
|
39
|
+
maxHeight?: string;
|
|
40
|
+
}
|
|
41
|
+
/** MeCodeBox 组件 Emits */
|
|
42
|
+
export interface MeCodeBoxEmits {
|
|
43
|
+
/** 激活索引变化(受控模式 v-model:activeIndex) */
|
|
44
|
+
(e: 'update:activeIndex', index: number): void;
|
|
45
|
+
/** tab 切换事件 */
|
|
46
|
+
(e: 'change', index: number): void;
|
|
47
|
+
/** 复制成功事件,载荷为被复制的代码原文 */
|
|
48
|
+
(e: 'copy', code: string): void;
|
|
49
|
+
}
|
|
50
|
+
/** MeCodeBox 组件实例类型 */
|
|
51
|
+
export type MeCodeBoxInstance = InstanceType<typeof import('./index.vue').default>;
|
|
52
|
+
/** MeCodeItem 数据载体 Props(插槽形态 code-group 使用,仅携带数据不渲染 DOM) */
|
|
53
|
+
export interface MeCodeItemProps {
|
|
54
|
+
/** tab 标签 */
|
|
55
|
+
label?: string;
|
|
56
|
+
/** 代码内容 */
|
|
57
|
+
code?: string;
|
|
58
|
+
/** 描述信息(显示在头部下方描述条) */
|
|
59
|
+
description?: string;
|
|
60
|
+
/** 代码语言 */
|
|
61
|
+
language?: string;
|
|
62
|
+
}
|
|
63
|
+
/** MeCodeItem 组件实例类型 */
|
|
64
|
+
export type MeCodeItemInstance = InstanceType<typeof import('./code-item.vue').default>;
|
package/dist/env.d.ts
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -16,8 +16,9 @@ import { default as MeLoginPage } from './login-page';
|
|
|
16
16
|
import { default as MeCard } from './card';
|
|
17
17
|
import { default as MeSkeleton } from './skeleton';
|
|
18
18
|
import { default as MeInputProperty } from './input-property';
|
|
19
|
+
import { default as MeCodeBox, MeCodeItem } from './code-box';
|
|
19
20
|
declare const install: (app: App) => void;
|
|
20
|
-
export { MeMessage, MeMessageComponent, MeIcon, MeBox, MeBreadcrumb, MeBody, MeMenu, MeNav, MeModal, MeTreeMenu, MeInputGps, MeInputIconSelector, MeInputRadio, MeLoadJson, MeLoginPage, MeCard, MeSkeleton, MeInputProperty, install };
|
|
21
|
+
export { MeMessage, MeMessageComponent, MeIcon, MeBox, MeBreadcrumb, MeBody, MeMenu, MeNav, MeModal, MeTreeMenu, MeInputGps, MeInputIconSelector, MeInputRadio, MeLoadJson, MeLoginPage, MeCard, MeSkeleton, MeInputProperty, MeCodeBox, MeCodeItem, install };
|
|
21
22
|
export { MeMessage as $message } from './message';
|
|
22
23
|
export { loadIconfont } from './icon';
|
|
23
24
|
declare const _default: {
|
|
@@ -43,3 +44,4 @@ export * from './login-page';
|
|
|
43
44
|
export * from './card';
|
|
44
45
|
export * from './skeleton';
|
|
45
46
|
export * from './input-property';
|
|
47
|
+
export * from './code-box';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.me-input-property{width:100%;position:relative}.me-input-property__toolbar{justify-content:flex-end;margin-bottom:8px;display:flex}.me-input-property__add-btn{font-size:13px}.me-input-property__table{width:100%}.me-input-property__table .ant-table-row.me-input-property__row--ghost td{opacity:.4;background:#1677ff0a}.me-input-property__drop-line{background:var(--me-primary,#1677ff);pointer-events:none;z-index:9;border-radius:2px;height:2px;display:none;position:absolute;left:0;box-shadow:0 0 0 1px #fffc}.me-input-property__drag-fallback{
|
|
1
|
+
.me-input-property{width:100%;position:relative}.me-input-property__toolbar{justify-content:flex-end;margin-bottom:8px;display:flex}.me-input-property__add-btn{font-size:13px}.me-input-property__value{width:100%}.me-input-property__value-type{flex:0 0 95px;width:95px}.me-input-property__value-editor{flex:1;min-width:0}.me-input-property__table{width:100%}.me-input-property__table .ant-table-row.me-input-property__row--ghost td{opacity:.4;background:#1677ff0a}.me-input-property__table .ant-input-status-error,.me-input-property__table .ant-input-number-status-error,.me-input-property__table .ant-picker-status-error{box-shadow:none!important;border-color:#d9d9d9!important}.me-input-property__table .ant-select-status-error{--ant-select-border-color:#d9d9d9!important;--ant-select-background-color:#fff!important;--ant-select-color:inherit!important;box-shadow:none!important}.me-input-property__table .me-input-property__field--error.ant-input,.me-input-property__table .me-input-property__field--error.ant-input-number,.me-input-property__table .me-input-property__field--error.ant-picker{border-color:#ff4d4f!important}.me-input-property__table .me-input-property__value.me-input-property__field--error{border-radius:6px;box-shadow:0 0 0 1px #ff4d4f}.me-input-property__drop-line{background:var(--me-primary,#1677ff);pointer-events:none;z-index:9;border-radius:2px;height:2px;display:none;position:absolute;left:0;box-shadow:0 0 0 1px #fffc}.me-input-property__drag-fallback{table-layout:fixed;border-collapse:separate;border-spacing:0;background:#fff;width:auto;display:table;box-shadow:0 4px 12px #00000026}.me-input-property__drag-fallback td{box-sizing:border-box;vertical-align:middle;background:#fff;border-bottom:1px solid #f0f0f0}.me-input-property__actions{align-items:center;gap:2px;display:inline-flex}.me-input-property__drag{cursor:grab;color:#999;border-radius:4px;justify-content:center;align-items:center;padding:2px;display:inline-flex}.me-input-property__drag:active{cursor:grabbing;color:var(--me-primary,#1677ff)}.me-input-property__drag:hover{color:var(--me-primary,#1677ff);background:#0000000a}.me-input-property__del{color:#999}.me-input-property__del:hover{color:#ff4d4f}.me-input-property__rules-btn{color:#bbb;border-radius:4px}.me-input-property__rules-btn:hover{color:var(--me-primary,#1677ff);background:#0000000a}.me-input-property__rules-btn.is-active{color:var(--me-primary,#1677ff)}.me-input-property__rule-input{width:100%}
|