@me-framework/me-ui-antdv-next 0.0.28 → 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.
Files changed (38) hide show
  1. package/dist/chunks/modal-D4Tl-Qzk.js +166 -0
  2. package/dist/chunks/skeleton-D1-aYUPf.js +135 -0
  3. package/dist/code-box/code-item.vue.d.ts +14 -0
  4. package/dist/code-box/index.css +1 -0
  5. package/dist/code-box/index.d.ts +5 -0
  6. package/dist/code-box/index.js +178 -0
  7. package/dist/code-box/index.vue.d.ts +20 -0
  8. package/dist/code-box/types.d.ts +64 -0
  9. package/dist/env.d.ts +12 -0
  10. package/dist/index.d.ts +5 -1
  11. package/dist/input-gps/index.js +1 -1
  12. package/dist/input-gps/index.vue.d.ts +1 -1
  13. package/dist/input-icon-selector/index.vue.d.ts +1 -1
  14. package/dist/input-property/index.css +1 -0
  15. package/dist/input-property/index.d.ts +5 -0
  16. package/dist/input-property/index.js +821 -0
  17. package/dist/input-property/index.vue.d.ts +21 -0
  18. package/dist/input-property/types.d.ts +114 -0
  19. package/dist/input-property/validate.d.ts +75 -0
  20. package/dist/load-json/index.css +1 -1
  21. package/dist/load-json/index.js +89 -123
  22. package/dist/load-json/index.vue.d.ts +3 -3
  23. package/dist/me-ui-antdv-next.js +4934 -1528
  24. package/dist/me-ui-antdv-next.umd.cjs +11 -9
  25. package/dist/message/index.vue.d.ts +1 -1
  26. package/dist/modal/index.css +1 -1
  27. package/dist/modal/index.js +7 -1
  28. package/dist/modal/index.vue.d.ts +26 -5
  29. package/dist/modal/types.d.ts +47 -7
  30. package/dist/nav/index.vue.d.ts +3 -3
  31. package/dist/resolver/index.js +4 -1
  32. package/dist/skeleton/index.js +5 -138
  33. package/dist/style.css +1 -1
  34. package/dist/tree-menu/TreeMenuEdit.vue.d.ts +1 -1
  35. package/dist/tree-menu/index.vue.d.ts +1 -1
  36. package/dist/utils/hljs.d.ts +19 -0
  37. package/package.json +2 -2
  38. package/dist/chunks/modal-KBZYtIHD.js +0 -178
@@ -0,0 +1,166 @@
1
+ import { t as e } from "./skeleton-D1-aYUPf.js";
2
+ import { Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, unref as v, useSlots as y, watch as b, withCtx as x, withModifiers as S } from "vue";
3
+ import { Maximize as C, Minimize as w, X as T } from "@lucide/vue";
4
+ //#region src/components/modal/index.vue?vue&type=script&setup=true&lang.ts
5
+ var E = { class: "me-modal__header" }, D = { class: "me-modal__title-row" }, O = { class: "me-modal__title-text" }, k = { class: "me-modal__actions" }, A = ["title"], j = {
6
+ key: 0,
7
+ class: "me-modal__footer"
8
+ }, M = /* @__PURE__ */ u({
9
+ name: "MeModal",
10
+ __name: "index",
11
+ props: {
12
+ open: {
13
+ type: Boolean,
14
+ default: !1
15
+ },
16
+ width: { default: 520 },
17
+ height: {},
18
+ position: { default: "top" },
19
+ offsetTop: { default: 100 },
20
+ offsetBottom: { default: 48 },
21
+ offsetLeft: { default: 16 },
22
+ offsetRight: { default: 16 },
23
+ title: {},
24
+ mask: {
25
+ type: Boolean,
26
+ default: !0
27
+ },
28
+ maskClosable: {
29
+ type: Boolean,
30
+ default: !0
31
+ },
32
+ maskStyle: {},
33
+ closable: {
34
+ type: Boolean,
35
+ default: !0
36
+ },
37
+ keyboard: {
38
+ type: Boolean,
39
+ default: !0
40
+ },
41
+ fullscreen: {
42
+ type: Boolean,
43
+ default: !0
44
+ },
45
+ defaultFullscreen: {
46
+ type: Boolean,
47
+ default: !1
48
+ },
49
+ loading: {
50
+ type: Boolean,
51
+ default: !1
52
+ },
53
+ okText: { default: "确定" },
54
+ cancelText: { default: "取消" },
55
+ footer: {
56
+ type: Boolean,
57
+ default: !0
58
+ },
59
+ dividers: {
60
+ type: Boolean,
61
+ default: !1
62
+ },
63
+ zIndex: { default: 1e3 },
64
+ bodyStyle: {}
65
+ },
66
+ emits: [
67
+ "update:open",
68
+ "fullscreen-change",
69
+ "ok",
70
+ "cancel"
71
+ ],
72
+ setup(u, { expose: M, emit: N }) {
73
+ let P = u, F = N, I = y(), L = r(() => !!I.loading), R = h(P.defaultFullscreen), z = r(() => {
74
+ let e = {};
75
+ return R.value ? (e.width = "100vw", e.height = "100vh") : (e.width = typeof P.width == "number" ? `${P.width}px` : P.width, P.height != null && (e.height = typeof P.height == "number" ? `${P.height}px` : P.height)), e;
76
+ }), B = r(() => {
77
+ if (R.value) return {
78
+ padding: 0,
79
+ alignItems: "stretch"
80
+ };
81
+ let e = P.position === "bottom" ? "flex-end" : P.position === "center" ? "center" : "flex-start";
82
+ return {
83
+ padding: `${P.offsetTop}px ${P.offsetRight}px ${P.offsetBottom}px ${P.offsetLeft}px`,
84
+ alignItems: e
85
+ };
86
+ }), V = () => {
87
+ R.value = !R.value, F("fullscreen-change", R.value);
88
+ }, H = (e) => {
89
+ F("cancel", e ?? new Event("cancel")), F("update:open", !1);
90
+ }, U = (e) => {
91
+ F("ok", e);
92
+ }, W = (e) => {
93
+ P.mask && P.maskClosable && H(e);
94
+ }, G = (e) => {
95
+ e.key === "Escape" && P.open && P.keyboard && H(e);
96
+ };
97
+ return b(() => P.open, (e) => {
98
+ e ? (document.body.style.overflow = "hidden", P.keyboard && window.addEventListener("keydown", G)) : (document.body.style.overflow = "", window.removeEventListener("keydown", G));
99
+ }), p(() => {
100
+ document.body.style.overflow = "", window.removeEventListener("keydown", G);
101
+ }), M({
102
+ toggleFullscreen: V,
103
+ isFullscreen: R
104
+ }), (r, p) => (m(), i(t, { to: "body" }, [l(n, { name: "me-modal" }, {
105
+ default: x(() => [u.open ? (m(), o("div", {
106
+ key: 0,
107
+ class: d(["me-modal", [`me-modal--${u.position}`, {
108
+ "me-modal--fullscreen": R.value,
109
+ "me-modal--dividers": u.dividers
110
+ }]]),
111
+ style: f({ "--me-modal-z": String(u.zIndex) })
112
+ }, [u.mask ? (m(), o("div", {
113
+ key: 0,
114
+ class: "me-modal__mask",
115
+ style: f(u.maskStyle),
116
+ onClick: W
117
+ }, null, 4)) : a("", !0), s("div", {
118
+ class: "me-modal__wrap",
119
+ style: f(B.value)
120
+ }, [s("div", {
121
+ class: "me-modal__panel",
122
+ style: f(z.value)
123
+ }, [
124
+ s("div", E, [g(r.$slots, "header", {}, () => [s("div", D, [s("span", O, [g(r.$slots, "title", {}, () => [c(_(u.title), 1)])])])]), s("div", k, [u.fullscreen ? (m(), o("button", {
125
+ key: 0,
126
+ class: "me-modal__action-btn",
127
+ type: "button",
128
+ title: R.value ? "退出全屏" : "全屏",
129
+ onClick: S(V, ["stop"])
130
+ }, [R.value ? (m(), i(v(w), {
131
+ key: 1,
132
+ size: 16
133
+ })) : (m(), i(v(C), {
134
+ key: 0,
135
+ size: 16
136
+ }))], 8, A)) : a("", !0), u.closable ? (m(), o("button", {
137
+ key: 1,
138
+ class: "me-modal__action-btn",
139
+ type: "button",
140
+ title: "关闭",
141
+ onClick: S(H, ["stop"])
142
+ }, [l(v(T), { size: 16 })])) : a("", !0)])]),
143
+ s("div", {
144
+ class: "me-modal__body",
145
+ style: f(u.bodyStyle)
146
+ }, [u.loading && L.value ? g(r.$slots, "loading", {}, void 0, void 0, 0) : u.loading ? (m(), i(e, {
147
+ key: 1,
148
+ animated: "",
149
+ preset: "text",
150
+ rows: 4,
151
+ class: "me-modal__skeleton"
152
+ })) : g(r.$slots, "default", {}, void 0, void 0, 2)], 4),
153
+ u.footer ? (m(), o("div", j, [g(r.$slots, "footer", {}, () => [s("span", {
154
+ class: "me-modal__btn me-modal__btn--default",
155
+ onClick: H
156
+ }, _(u.cancelText), 1), s("span", {
157
+ class: "me-modal__btn me-modal__btn--primary",
158
+ onClick: U
159
+ }, _(u.okText), 1)])])) : a("", !0)
160
+ ], 4)], 4)], 6)) : a("", !0)]),
161
+ _: 3
162
+ })]));
163
+ }
164
+ });
165
+ //#endregion
166
+ export { M as t };
@@ -0,0 +1,135 @@
1
+ import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, mergeProps as o, normalizeClass as s, normalizeStyle as c, openBlock as l, renderList as u, renderSlot as d } from "vue";
2
+ //#region src/components/skeleton/index.vue?vue&type=script&setup=true&lang.ts
3
+ var f = { class: "me-skeleton__card-body" }, p = { class: "me-skeleton__avatar-content" }, m = { class: "me-skeleton__list-content" }, h = /* @__PURE__ */ a({
4
+ name: "MeSkeleton",
5
+ __name: "index",
6
+ props: {
7
+ preset: { default: "text" },
8
+ loading: {
9
+ type: Boolean,
10
+ default: !0
11
+ },
12
+ animated: {
13
+ type: Boolean,
14
+ default: !0
15
+ },
16
+ rows: { default: void 0 },
17
+ height: { default: void 0 },
18
+ rowHeight: { default: 16 },
19
+ rowGap: { default: 12 },
20
+ avatar: {
21
+ type: Boolean,
22
+ default: !0
23
+ },
24
+ avatarSize: { default: 36 },
25
+ avatarShape: { default: "circle" },
26
+ titleWidth: { default: .5 },
27
+ lastRowWidth: { default: .7 },
28
+ cardImage: {
29
+ type: Boolean,
30
+ default: !0
31
+ },
32
+ cardImageHeight: { default: 120 }
33
+ },
34
+ setup(a) {
35
+ let h = a, g = t(() => {
36
+ if (h.rows !== void 0 && h.rows > 0) return h.rows;
37
+ if (h.height) {
38
+ let e = typeof h.height == "number" ? h.height : parseFloat(h.height);
39
+ if (!isNaN(e) && e > 0) return Math.max(1, Math.floor((e + h.rowGap) / (h.rowHeight + h.rowGap)));
40
+ }
41
+ return h.preset === "article" ? 5 : (h.preset === "text" || h.preset, 3);
42
+ }), _ = t(() => h.rows !== void 0 && h.rows > 0 ? h.rows : 2), v = t(() => {
43
+ if (h.rows !== void 0 && h.rows > 0) return h.rows;
44
+ if (h.height) {
45
+ let e = typeof h.height == "number" ? h.height : parseFloat(h.height);
46
+ if (!isNaN(e) && e > 0) {
47
+ let t = h.avatarSize + 8;
48
+ return Math.max(1, Math.floor(e / t));
49
+ }
50
+ }
51
+ return 3;
52
+ }), y = t(() => Math.min(1, Math.max(.1, h.titleWidth))), b = t(() => Math.min(1, Math.max(.1, h.lastRowWidth))), x = (e, t) => t <= 1 ? .6 : e === t ? b.value : .85 + (Math.sin(e * 1.7 + .5) * .5 + .5) * .15000000000000002, S = (e, t) => {
53
+ let n = {
54
+ height: `${h.rowHeight}px`,
55
+ width: `${x(e, t) * 100}%`
56
+ };
57
+ return e > 1 && (n.marginTop = `${h.rowGap}px`), n;
58
+ }, C = t(() => {
59
+ let e = {};
60
+ return h.height && h.preset !== "card" && h.preset !== "avatar" && (e.height = typeof h.height == "number" ? `${h.height}px` : h.height), e;
61
+ });
62
+ return (t, b) => h.loading ? (l(), r("div", o({
63
+ key: 0,
64
+ class: ["me-skeleton", [`me-skeleton--${h.preset}`, { "me-skeleton--animated": h.animated }]],
65
+ style: C.value
66
+ }, t.$attrs), [h.preset === "card" ? (l(), r(e, { key: 0 }, [h.cardImage ? (l(), r("div", {
67
+ key: 0,
68
+ class: "me-skeleton__card-image me-skeleton__block",
69
+ style: c({ height: `${h.cardImageHeight}px` })
70
+ }, null, 4)) : n("", !0), i("div", f, [i("div", {
71
+ class: "me-skeleton__row me-skeleton__block me-skeleton__row--title",
72
+ style: c({
73
+ height: `${a.rowHeight}px`,
74
+ width: `${y.value * 100}%`
75
+ })
76
+ }, null, 4), (l(!0), r(e, null, u(_.value, (e) => (l(), r("div", {
77
+ key: e,
78
+ class: "me-skeleton__row me-skeleton__block",
79
+ style: c(S(e, _.value))
80
+ }, null, 4))), 128))])], 64)) : h.preset === "avatar" ? (l(), r(e, { key: 1 }, [h.avatar ? (l(), r("div", {
81
+ key: 0,
82
+ class: s(["me-skeleton__avatar me-skeleton__block", [h.avatarShape === "circle" ? "me-skeleton__avatar--circle" : "me-skeleton__avatar--square"]]),
83
+ style: c({
84
+ width: `${h.avatarSize}px`,
85
+ height: `${h.avatarSize}px`
86
+ })
87
+ }, null, 6)) : n("", !0), i("div", p, [i("div", {
88
+ class: "me-skeleton__row me-skeleton__block me-skeleton__row--title",
89
+ style: c({
90
+ height: `${a.rowHeight}px`,
91
+ width: `${y.value * 100}%`
92
+ })
93
+ }, null, 4), i("div", {
94
+ class: "me-skeleton__row me-skeleton__block",
95
+ style: c({
96
+ height: `${a.rowHeight}px`,
97
+ marginTop: `${a.rowGap}px`,
98
+ width: "85%"
99
+ })
100
+ }, null, 4)])], 64)) : h.preset === "article" ? (l(), r(e, { key: 2 }, [i("div", {
101
+ class: "me-skeleton__row me-skeleton__block me-skeleton__row--title",
102
+ style: c({
103
+ height: `${a.rowHeight}px`,
104
+ width: `${y.value * 100}%`,
105
+ marginBottom: `${a.rowGap + 8}px`
106
+ })
107
+ }, null, 4), (l(!0), r(e, null, u(g.value, (e) => (l(), r("div", {
108
+ key: e,
109
+ class: "me-skeleton__row me-skeleton__block",
110
+ style: c(S(e, g.value))
111
+ }, null, 4))), 128))], 64)) : h.preset === "list" ? (l(!0), r(e, { key: 3 }, u(v.value, (e) => (l(), r("div", {
112
+ key: e,
113
+ class: "me-skeleton__list-item"
114
+ }, [b[0] ||= i("div", { class: "me-skeleton__list-avatar me-skeleton__block" }, null, -1), i("div", m, [i("div", {
115
+ class: "me-skeleton__row me-skeleton__block",
116
+ style: c({
117
+ height: `${a.rowHeight}px`,
118
+ width: `${e % 2 == 0 ? 50 : 40}%`
119
+ })
120
+ }, null, 4), i("div", {
121
+ class: "me-skeleton__row me-skeleton__block",
122
+ style: c({
123
+ height: `${a.rowHeight}px`,
124
+ marginTop: `${a.rowGap}px`,
125
+ width: `${e % 3 == 0 ? 90 : 75}%`
126
+ })
127
+ }, null, 4)])]))), 128)) : (l(!0), r(e, { key: 4 }, u(g.value, (e) => (l(), r("div", {
128
+ key: e,
129
+ class: "me-skeleton__row me-skeleton__block",
130
+ style: c(S(e, g.value))
131
+ }, null, 4))), 128))], 16)) : d(t.$slots, "default", {}, void 0, void 0, 1);
132
+ }
133
+ });
134
+ //#endregion
135
+ export { h as t };
@@ -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,5 @@
1
+ import { default as MeCodeBox } from './index.vue';
2
+ import { default as MeCodeItem } from './code-item.vue';
3
+ export { MeCodeBox, MeCodeItem };
4
+ export default MeCodeBox;
5
+ export * from './types';
@@ -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
@@ -0,0 +1,12 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ interface ImportMetaEnv {
4
+ /** 高德地图 Web 端 Key */
5
+ readonly VITE_AMAP_KEY?: string
6
+ /** 高德地图安全密钥 */
7
+ readonly VITE_AMAP_SECURITY_KEY?: string
8
+ }
9
+
10
+ interface ImportMeta {
11
+ readonly env: ImportMetaEnv
12
+ }
package/dist/index.d.ts CHANGED
@@ -15,8 +15,10 @@ import { default as MeLoadJson } from './load-json';
15
15
  import { default as MeLoginPage } from './login-page';
16
16
  import { default as MeCard } from './card';
17
17
  import { default as MeSkeleton } from './skeleton';
18
+ import { default as MeInputProperty } from './input-property';
19
+ import { default as MeCodeBox, MeCodeItem } from './code-box';
18
20
  declare const install: (app: App) => void;
19
- export { MeMessage, MeMessageComponent, MeIcon, MeBox, MeBreadcrumb, MeBody, MeMenu, MeNav, MeModal, MeTreeMenu, MeInputGps, MeInputIconSelector, MeInputRadio, MeLoadJson, MeLoginPage, MeCard, MeSkeleton, install };
21
+ export { MeMessage, MeMessageComponent, MeIcon, MeBox, MeBreadcrumb, MeBody, MeMenu, MeNav, MeModal, MeTreeMenu, MeInputGps, MeInputIconSelector, MeInputRadio, MeLoadJson, MeLoginPage, MeCard, MeSkeleton, MeInputProperty, MeCodeBox, MeCodeItem, install };
20
22
  export { MeMessage as $message } from './message';
21
23
  export { loadIconfont } from './icon';
22
24
  declare const _default: {
@@ -41,3 +43,5 @@ export * from './load-json';
41
43
  export * from './login-page';
42
44
  export * from './card';
43
45
  export * from './skeleton';
46
+ export * from './input-property';
47
+ export * from './code-box';
@@ -1,5 +1,5 @@
1
1
  import e from "../icon/index.js";
2
- import { t } from "../chunks/modal-KBZYtIHD.js";
2
+ import t from "../modal/index.js";
3
3
  import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, nextTick as d, normalizeStyle as f, onMounted as p, openBlock as m, ref as h, resolveComponent as g, shallowRef as _, toDisplayString as v, unref as y, watch as b, withCtx as x } from "vue";
4
4
  import S from "@amap/amap-jsapi-loader";
5
5
  //#region src/components/input-gps/map.vue?vue&type=script&setup=true&lang.ts
@@ -14,8 +14,8 @@ declare const __VLS_export: import('vue').DefineComponent<MeInputGpsProps, {}, {
14
14
  address: string;
15
15
  }) => any) | undefined;
16
16
  }>, {
17
- placeholder: string;
18
17
  disabled: boolean;
18
+ placeholder: string;
19
19
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
20
20
  declare const _default: typeof __VLS_export;
21
21
  export default _default;
@@ -13,9 +13,9 @@ declare const __VLS_base: import('vue').DefineComponent<MeInputIconSelectorProps
13
13
  size: "large" | "middle" | "small";
14
14
  iconfontPrefix: string;
15
15
  iconfontMode: "class" | "symbol";
16
+ disabled: boolean;
16
17
  modelValue: string;
17
18
  placeholder: string;
18
- disabled: boolean;
19
19
  sources: MeInputIconSelectorSource[];
20
20
  iconfontData: string[];
21
21
  searchPlaceholder: string;
@@ -0,0 +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__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%}