@me-framework/me-ui-antdv-next 0.0.28 → 0.0.29
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/chunks/modal-D4Tl-Qzk.js +166 -0
- package/dist/chunks/skeleton-D1-aYUPf.js +135 -0
- package/dist/index.d.ts +3 -1
- package/dist/input-gps/index.js +1 -1
- package/dist/input-gps/index.vue.d.ts +1 -1
- package/dist/input-icon-selector/index.vue.d.ts +1 -1
- package/dist/input-property/index.css +1 -0
- package/dist/input-property/index.d.ts +5 -0
- package/dist/input-property/index.js +269 -0
- package/dist/input-property/index.vue.d.ts +18 -0
- package/dist/input-property/types.d.ts +38 -0
- package/dist/input-property/validate.d.ts +18 -0
- package/dist/load-json/index.css +1 -1
- package/dist/load-json/index.js +89 -123
- package/dist/load-json/index.vue.d.ts +3 -3
- package/dist/me-ui-antdv-next.js +1758 -1532
- package/dist/me-ui-antdv-next.umd.cjs +2 -2
- package/dist/message/index.vue.d.ts +1 -1
- package/dist/modal/index.css +1 -1
- package/dist/modal/index.js +7 -1
- package/dist/modal/index.vue.d.ts +26 -5
- package/dist/modal/types.d.ts +47 -7
- package/dist/nav/index.vue.d.ts +3 -3
- package/dist/resolver/index.js +2 -1
- package/dist/skeleton/index.js +5 -138
- package/dist/style.css +1 -1
- package/dist/tree-menu/TreeMenuEdit.vue.d.ts +1 -1
- package/dist/tree-menu/index.vue.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunks/modal-KBZYtIHD.js +0 -178
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MeInputProperty 纯函数校验与转换逻辑
|
|
3
|
+
*
|
|
4
|
+
* 此模块不依赖 Vue,便于复用与单测。
|
|
5
|
+
*/
|
|
6
|
+
/** 生成简单唯一 id(组件内部用于定位行,避免用 key 定位导致表格重建丢焦点) */
|
|
7
|
+
export declare function genId(): string;
|
|
8
|
+
/** 将 key 统一为用于比较的小写形式(大小写不敏感) */
|
|
9
|
+
export declare function normalizeKey(key: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* 找出重复的 key(大小写不敏感)。
|
|
12
|
+
* @returns 重复的原始 key 集合(含所有重复出现项的去重字符数组)
|
|
13
|
+
*/
|
|
14
|
+
export declare function checkDuplicateKeys(rows: {
|
|
15
|
+
key: string;
|
|
16
|
+
}[]): string[];
|
|
17
|
+
/** 判断某 key 是否处于重复集合中(大小写不敏感) */
|
|
18
|
+
export declare function isDuplicateKey(key: string, duplicates: string[]): boolean;
|
package/dist/load-json/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.me-load-json{display:inline-block}.me-load-json__editor{flex-direction:column;flex:1;width:100%;height:100%;min-height:400px;display:flex}.me-load-json__editor .editor{flex:1;width:100%;height:100%;min-height:0}.me-load-json
|
|
1
|
+
.me-load-json{display:inline-block}.me-load-json__editor{flex-direction:column;flex:1;width:100%;height:100%;min-height:400px;display:flex}.me-load-json__editor .editor{flex:1;width:100%;height:100%;min-height:0}.me-load-json .me-modal__body{flex-direction:column;display:flex}.me-load-json__footer{justify-content:space-between;align-items:center;gap:12px;width:100%;display:flex}.me-load-json__footer-left,.me-load-json__footer-right{align-items:center;gap:8px;display:flex}
|
package/dist/load-json/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { t as e } from "../chunks/modal-D4Tl-Qzk.js";
|
|
2
|
+
import { createElementBlock as t, createElementVNode as n, createTextVNode as r, createVNode as i, defineComponent as a, openBlock as o, ref as s, renderSlot as c, resolveComponent as l, unref as u, watch as d, withCtx as f } from "vue";
|
|
3
|
+
import { Download as p, Upload as m } from "@lucide/vue";
|
|
4
|
+
import { message as h } from "antdv-next";
|
|
5
|
+
import g from "jsoneditor";
|
|
5
6
|
import "jsoneditor/dist/jsoneditor.min.css";
|
|
6
7
|
//#region src/utils/index.ts
|
|
7
|
-
function
|
|
8
|
+
function _(e = {}) {
|
|
8
9
|
let { accept: t = "*", multiple: n = !1 } = e;
|
|
9
10
|
return new Promise((e) => {
|
|
10
11
|
let r = document.createElement("input");
|
|
@@ -32,7 +33,7 @@ function E(e = {}) {
|
|
|
32
33
|
}
|
|
33
34
|
//#endregion
|
|
34
35
|
//#region src/components/load-json/index.vue?vue&type=script&setup=true&lang.ts
|
|
35
|
-
var
|
|
36
|
+
var v = { class: "me-load-json" }, y = { class: "me-load-json__editor" }, b = { class: "me-load-json__footer" }, x = { class: "me-load-json__footer-left" }, S = { class: "me-load-json__footer-right" }, C = /* @__PURE__ */ a({
|
|
36
37
|
name: "MeLoadJson",
|
|
37
38
|
__name: "index",
|
|
38
39
|
props: {
|
|
@@ -41,35 +42,10 @@ var D = { class: "me-load-json" }, O = { class: "me-load-json__title-row" }, k =
|
|
|
41
42
|
width: { default: 800 }
|
|
42
43
|
},
|
|
43
44
|
emits: ["change"],
|
|
44
|
-
setup(
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
window.dispatchEvent(new Event("resize"));
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}, J = e(() => {
|
|
52
|
-
let e = ["me-load-json-modal-wrap"];
|
|
53
|
-
return K.value && e.push("me-modal-wrap--fullscreen"), e.join(" ");
|
|
54
|
-
}), Y = u(!1), X = () => {
|
|
55
|
-
typeof document < "u" && (Y.value = document.documentElement.classList.contains("dark"));
|
|
56
|
-
}, Z = null;
|
|
57
|
-
s(() => {
|
|
58
|
-
X(), typeof document < "u" && (Z = new MutationObserver(() => {
|
|
59
|
-
X();
|
|
60
|
-
}), Z.observe(document.documentElement, {
|
|
61
|
-
attributes: !0,
|
|
62
|
-
attributeFilter: ["class"]
|
|
63
|
-
}));
|
|
64
|
-
}), c(() => {
|
|
65
|
-
Z?.disconnect(), Z = null;
|
|
66
|
-
});
|
|
67
|
-
let Q = e(() => ({
|
|
68
|
-
algorithm: Y.value ? R : L,
|
|
69
|
-
token: { borderRadius: 6 }
|
|
70
|
-
}));
|
|
71
|
-
g(W, (e) => {
|
|
72
|
-
e ? G = new T(e, {
|
|
45
|
+
setup(a, { expose: C, emit: w }) {
|
|
46
|
+
let T = a, E = w, D = s(!1), O = s(!1), k = s(), A = s(null), j = null;
|
|
47
|
+
d(A, (e) => {
|
|
48
|
+
e ? j = new g(e, {
|
|
73
49
|
mode: "code",
|
|
74
50
|
modes: [
|
|
75
51
|
"tree",
|
|
@@ -81,34 +57,34 @@ var D = { class: "me-load-json" }, O = { class: "me-load-json__title-row" }, k =
|
|
|
81
57
|
language: "zh-CN",
|
|
82
58
|
indentation: 2,
|
|
83
59
|
onChange: () => {
|
|
84
|
-
if (
|
|
85
|
-
|
|
60
|
+
if (j) try {
|
|
61
|
+
j.get(), O.value = !1;
|
|
86
62
|
} catch {
|
|
87
|
-
|
|
63
|
+
O.value = !0;
|
|
88
64
|
}
|
|
89
65
|
},
|
|
90
66
|
onValidationError: (e) => {
|
|
91
|
-
|
|
67
|
+
O.value = e.length > 0;
|
|
92
68
|
}
|
|
93
|
-
},
|
|
94
|
-
}, { flush: "post" }),
|
|
95
|
-
|
|
69
|
+
}, T.data || {}) : (j?.destroy(), j = null);
|
|
70
|
+
}, { flush: "post" }), d(() => T.data, (e) => {
|
|
71
|
+
j && D.value && (j.set(e || {}), O.value = !1);
|
|
96
72
|
});
|
|
97
|
-
let
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
if (
|
|
103
|
-
let e =
|
|
73
|
+
let M = () => {
|
|
74
|
+
D.value = !0;
|
|
75
|
+
}, N = () => {
|
|
76
|
+
D.value = !1;
|
|
77
|
+
}, P = () => {
|
|
78
|
+
if (j) try {
|
|
79
|
+
let e = j.get(), t = new Blob([JSON.stringify(e, null, 2)], { type: "application/json" }), n = URL.createObjectURL(t), r = document.createElement("a");
|
|
104
80
|
r.href = n;
|
|
105
81
|
let i = /* @__PURE__ */ new Date(), a = (e) => e.toString().padStart(2, "0"), o = `${`${i.getFullYear()}-${a(i.getMonth() + 1)}-${a(i.getDate())}`}_${`${a(i.getHours())}:${a(i.getMinutes())}:${a(i.getSeconds())}`}`;
|
|
106
|
-
r.download = `${
|
|
82
|
+
r.download = `${T.title || "data"}_${o}.json`, r.click(), URL.revokeObjectURL(n);
|
|
107
83
|
} catch {
|
|
108
|
-
|
|
84
|
+
h.error("JSON 格式错误,无法导出");
|
|
109
85
|
}
|
|
110
|
-
},
|
|
111
|
-
let e = await
|
|
86
|
+
}, F = async () => {
|
|
87
|
+
let e = await _({
|
|
112
88
|
accept: ".json",
|
|
113
89
|
multiple: !1
|
|
114
90
|
});
|
|
@@ -117,95 +93,85 @@ var D = { class: "me-load-json" }, O = { class: "me-load-json__title-row" }, k =
|
|
|
117
93
|
t.readAsText(e, "utf-8"), t.onload = () => {
|
|
118
94
|
try {
|
|
119
95
|
let e = JSON.parse(t.result);
|
|
120
|
-
|
|
96
|
+
j?.set(e), O.value = !1;
|
|
121
97
|
} catch {
|
|
122
|
-
|
|
98
|
+
h.error("JSON 文件解析失败,请检查文件格式");
|
|
123
99
|
}
|
|
124
100
|
};
|
|
125
|
-
},
|
|
126
|
-
if (
|
|
127
|
-
let e =
|
|
128
|
-
|
|
101
|
+
}, I = () => {
|
|
102
|
+
if (j) try {
|
|
103
|
+
let e = j.get();
|
|
104
|
+
k.value = e, E("change", e), D.value = !1;
|
|
129
105
|
} catch {
|
|
130
|
-
|
|
106
|
+
h.error("JSON 格式错误,请检查");
|
|
131
107
|
}
|
|
132
108
|
};
|
|
133
|
-
return
|
|
134
|
-
getData: () =>
|
|
135
|
-
open:
|
|
136
|
-
}), (
|
|
137
|
-
let
|
|
138
|
-
return
|
|
109
|
+
return C({
|
|
110
|
+
getData: () => k.value,
|
|
111
|
+
open: M
|
|
112
|
+
}), (s, d) => {
|
|
113
|
+
let h = l("a-button");
|
|
114
|
+
return o(), t("div", v, [n("div", { onClick: M }, [c(s.$slots, "default", {}, () => [i(h, {
|
|
139
115
|
type: "primary",
|
|
140
116
|
size: "small"
|
|
141
117
|
}, {
|
|
142
|
-
icon:
|
|
143
|
-
default:
|
|
118
|
+
icon: f(() => [i(u(p), { size: 14 })]),
|
|
119
|
+
default: f(() => [d[1] ||= r(" 导入 JSON ", -1)]),
|
|
144
120
|
_: 1
|
|
145
|
-
})])]),
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
121
|
+
})])]), i(e, {
|
|
122
|
+
open: D.value,
|
|
123
|
+
"onUpdate:open": d[0] ||= (e) => D.value = e,
|
|
124
|
+
title: a.title,
|
|
125
|
+
width: a.width,
|
|
126
|
+
height: "80vh",
|
|
127
|
+
onCancel: N
|
|
128
|
+
}, {
|
|
129
|
+
footer: f(() => [n("div", b, [n("div", x, [c(s.$slots, "footer-left", {}, () => [i(h, {
|
|
130
|
+
size: "small",
|
|
131
|
+
onClick: P
|
|
155
132
|
}, {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
133
|
+
icon: f(() => [i(u(p), { size: 14 })]),
|
|
134
|
+
default: f(() => [d[2] ||= r(" 导出 ", -1)]),
|
|
135
|
+
_: 1
|
|
136
|
+
})])]), n("div", S, [
|
|
137
|
+
i(h, {
|
|
138
|
+
size: "small",
|
|
139
|
+
onClick: F
|
|
140
|
+
}, {
|
|
141
|
+
icon: f(() => [i(u(m), { size: 14 })]),
|
|
142
|
+
default: f(() => [d[3] ||= r(" 导入 ", -1)]),
|
|
143
|
+
_: 1
|
|
144
|
+
}),
|
|
145
|
+
i(h, {
|
|
146
|
+
type: "primary",
|
|
167
147
|
size: "small",
|
|
168
|
-
|
|
148
|
+
disabled: O.value,
|
|
149
|
+
onClick: I
|
|
169
150
|
}, {
|
|
170
|
-
|
|
171
|
-
default: _(() => [s[2] ||= i(" 导出 ", -1)]),
|
|
151
|
+
default: f(() => [...d[4] ||= [r(" 确定 ", -1)]]),
|
|
172
152
|
_: 1
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}),
|
|
182
|
-
a(c, {
|
|
183
|
-
type: "primary",
|
|
184
|
-
size: "small",
|
|
185
|
-
disabled: H.value,
|
|
186
|
-
onClick: re
|
|
187
|
-
}, {
|
|
188
|
-
default: _(() => [...s[4] ||= [i(" 确定 ", -1)]]),
|
|
189
|
-
_: 1
|
|
190
|
-
}, 8, ["disabled"]),
|
|
191
|
-
d(e.$slots, "footer-right")
|
|
192
|
-
])])]),
|
|
193
|
-
_: 3
|
|
194
|
-
}, 8, [
|
|
195
|
-
"open",
|
|
196
|
-
"width",
|
|
197
|
-
"wrap-class-name"
|
|
198
|
-
])]),
|
|
153
|
+
}, 8, ["disabled"]),
|
|
154
|
+
c(s.$slots, "footer-right")
|
|
155
|
+
])])]),
|
|
156
|
+
default: f(() => [n("div", y, [n("div", {
|
|
157
|
+
ref_key: "editorContainerRef",
|
|
158
|
+
ref: A,
|
|
159
|
+
class: "editor"
|
|
160
|
+
}, null, 512)])]),
|
|
199
161
|
_: 3
|
|
200
|
-
}, 8, [
|
|
162
|
+
}, 8, [
|
|
163
|
+
"open",
|
|
164
|
+
"title",
|
|
165
|
+
"width"
|
|
166
|
+
])]);
|
|
201
167
|
};
|
|
202
168
|
}
|
|
203
169
|
});
|
|
204
170
|
//#endregion
|
|
205
171
|
//#region src/components/load-json/index.ts
|
|
206
|
-
|
|
207
|
-
e.component("MeLoadJson",
|
|
172
|
+
C.install = (e) => {
|
|
173
|
+
e.component("MeLoadJson", C);
|
|
208
174
|
};
|
|
209
|
-
var
|
|
175
|
+
var w = C;
|
|
210
176
|
//#endregion
|
|
211
|
-
export {
|
|
177
|
+
export { C as MeLoadJson, w as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { MeLoadJsonProps } from './types';
|
|
2
|
-
declare var __VLS_1: {},
|
|
2
|
+
declare var __VLS_1: {}, __VLS_24: {}, __VLS_62: {};
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
4
|
default?: (props: typeof __VLS_1) => any;
|
|
5
5
|
} & {
|
|
6
|
-
'footer-left'?: (props: typeof
|
|
6
|
+
'footer-left'?: (props: typeof __VLS_24) => any;
|
|
7
7
|
} & {
|
|
8
|
-
'footer-right'?: (props: typeof
|
|
8
|
+
'footer-right'?: (props: typeof __VLS_62) => any;
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_base: import('vue').DefineComponent<MeLoadJsonProps, {
|
|
11
11
|
/** 获取最终结果数据 */
|