@me-framework/me-ui-antdv-next 0.0.26 → 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.
Files changed (60) hide show
  1. package/dist/chunks/input-icon-selector-BrrR4KK6.js +228 -0
  2. package/dist/chunks/modal-D4Tl-Qzk.js +166 -0
  3. package/dist/chunks/skeleton-D1-aYUPf.js +135 -0
  4. package/dist/icon/index.js +1 -1
  5. package/dist/index.d.ts +3 -1
  6. package/dist/input-gps/index.js +85 -233
  7. package/dist/input-gps/index.vue.d.ts +4 -2
  8. package/dist/input-gps/map.vue.d.ts +1 -1
  9. package/dist/input-gps/types.d.ts +9 -5
  10. package/dist/input-icon-selector/index.js +1 -1
  11. package/dist/input-icon-selector/index.vue.d.ts +1 -1
  12. package/dist/input-property/index.css +1 -0
  13. package/dist/input-property/index.d.ts +5 -0
  14. package/dist/input-property/index.js +269 -0
  15. package/dist/input-property/index.vue.d.ts +18 -0
  16. package/dist/input-property/types.d.ts +38 -0
  17. package/dist/input-property/validate.d.ts +18 -0
  18. package/dist/load-json/index.css +1 -0
  19. package/dist/load-json/index.js +91 -24319
  20. package/dist/load-json/index.vue.d.ts +3 -3
  21. package/dist/me-ui-antdv-next.js +1791 -1551
  22. package/dist/me-ui-antdv-next.umd.cjs +2 -2
  23. package/dist/message/index.js +1 -1
  24. package/dist/message/index.vue.d.ts +1 -1
  25. package/dist/modal/index.css +1 -0
  26. package/dist/modal/index.js +7 -1
  27. package/dist/modal/index.vue.d.ts +26 -5
  28. package/dist/modal/types.d.ts +47 -7
  29. package/dist/nav/index.js +1 -1
  30. package/dist/nav/index.vue.d.ts +3 -3
  31. package/dist/resolver/index.d.ts +1 -1
  32. package/dist/resolver/index.js +9 -5
  33. package/dist/skeleton/index.js +5 -138
  34. package/dist/style.css +1 -1
  35. package/dist/tree-menu/TreeMenuEdit.vue.d.ts +1 -1
  36. package/dist/tree-menu/index.js +2 -2
  37. package/dist/tree-menu/index.vue.d.ts +1 -1
  38. package/package.json +6 -6
  39. package/dist/chunks/input-icon-selector-D5c45QL8.js +0 -227
  40. package/dist/chunks/modal-Dke8ng3P.js +0 -178
  41. package/dist/chunks/rolldown-runtime-DtPi1Y-2.js +0 -13
  42. package/dist/load-json.css +0 -1
  43. package/dist/modal.css +0 -1
  44. /package/dist/{base.css → base/index.css} +0 -0
  45. /package/dist/{body.css → body/index.css} +0 -0
  46. /package/dist/{box.css → box/index.css} +0 -0
  47. /package/dist/{breadcrumb.css → breadcrumb/index.css} +0 -0
  48. /package/dist/{card.css → card/index.css} +0 -0
  49. /package/dist/chunks/{icon-DdoH0MfT.js → icon-CXjgApCy.js} +0 -0
  50. /package/dist/chunks/{message-CPHX2tAR.js → message-D2zYiiQe.js} +0 -0
  51. /package/dist/{icon.css → icon/index.css} +0 -0
  52. /package/dist/{input-gps.css → input-gps/index.css} +0 -0
  53. /package/dist/{input-icon-selector.css → input-icon-selector/index.css} +0 -0
  54. /package/dist/{input-radio.css → input-radio/index.css} +0 -0
  55. /package/dist/{login-page.css → login-page/index.css} +0 -0
  56. /package/dist/{menu.css → menu/index.css} +0 -0
  57. /package/dist/{message.css → message/index.css} +0 -0
  58. /package/dist/{nav.css → nav/index.css} +0 -0
  59. /package/dist/{skeleton.css → skeleton/index.css} +0 -0
  60. /package/dist/{tree-menu.css → tree-menu/index.css} +0 -0
@@ -0,0 +1,269 @@
1
+ import e from "../icon/index.js";
2
+ import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, nextTick as l, onMounted as u, openBlock as d, reactive as f, ref as p, resolveComponent as m, unref as h, watch as g, withCtx as _ } from "vue";
3
+ import { useDraggable as v } from "vue-draggable-plus";
4
+ //#region src/components/input-property/validate.ts
5
+ function y() {
6
+ return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
7
+ }
8
+ function b(e) {
9
+ return e.trim().toLowerCase();
10
+ }
11
+ function x(e) {
12
+ let t = /* @__PURE__ */ new Map(), n = [];
13
+ for (let r of e) {
14
+ let e = b(r.key);
15
+ if (e) {
16
+ if (t.has(e)) {
17
+ let i = t.get(e);
18
+ n.includes(i) || n.push(i);
19
+ let a = r.key.trim();
20
+ n.includes(a) || n.push(a);
21
+ } else t.set(e, r.key.trim());
22
+ }
23
+ }
24
+ return n;
25
+ }
26
+ function S(e, t) {
27
+ if (!e) return !1;
28
+ let n = b(e);
29
+ return t.some((e) => b(e) === n);
30
+ }
31
+ //#endregion
32
+ //#region src/components/input-property/index.vue?vue&type=script&setup=true&lang.ts
33
+ var C = { class: "me-input-property__toolbar" }, w = {
34
+ key: 0,
35
+ class: "me-input-property__actions"
36
+ }, T = {
37
+ key: 0,
38
+ class: "me-input-property__drag",
39
+ title: "拖拽排序"
40
+ }, E = /* @__PURE__ */ c({
41
+ name: "MeInputProperty",
42
+ __name: "index",
43
+ props: {
44
+ modelValue: { default: () => ({}) },
45
+ disabled: {
46
+ type: Boolean,
47
+ default: !1
48
+ },
49
+ size: { default: "middle" },
50
+ draggable: {
51
+ type: Boolean,
52
+ default: !0
53
+ },
54
+ keyPlaceholder: { default: "请输入 key" },
55
+ valuePlaceholder: { default: "请输入 value" },
56
+ emptyText: { default: "暂无属性,点击「新增属性」添加" }
57
+ },
58
+ emits: ["update:modelValue", "change"],
59
+ setup(c, { emit: b }) {
60
+ let E = c, D = b, O = p([]), k = p([]), A = !1, j = t(() => [
61
+ {
62
+ title: "Key",
63
+ key: "key",
64
+ dataIndex: "key",
65
+ width: 180
66
+ },
67
+ {
68
+ title: "Value",
69
+ key: "value",
70
+ dataIndex: "value"
71
+ },
72
+ {
73
+ title: "操作",
74
+ key: "action",
75
+ dataIndex: "action",
76
+ width: 72,
77
+ align: "center"
78
+ }
79
+ ]), M = t(() => E.draggable && !E.disabled);
80
+ function N(e) {
81
+ O.value = Object.entries(e).map(([e, t]) => ({
82
+ id: y(),
83
+ key: e,
84
+ value: t
85
+ })), z();
86
+ }
87
+ function P() {
88
+ let e = {};
89
+ for (let t of O.value) {
90
+ let n = t.key.trim();
91
+ n && (e[n] = t.value);
92
+ }
93
+ A = !0, D("update:modelValue", e), D("change", e);
94
+ }
95
+ g(() => E.modelValue, (e) => {
96
+ if (e) {
97
+ if (A) {
98
+ A = !1;
99
+ return;
100
+ }
101
+ N(e);
102
+ }
103
+ }, { immediate: !0 });
104
+ function F(e) {
105
+ z(), P();
106
+ }
107
+ function I(e) {
108
+ z(), P();
109
+ }
110
+ function L() {
111
+ O.value = [...O.value, {
112
+ id: y(),
113
+ key: "",
114
+ value: ""
115
+ }], z(), P();
116
+ }
117
+ function R(e) {
118
+ let t = O.value.indexOf(e);
119
+ t !== -1 && (O.value.splice(t, 1), z(), P());
120
+ }
121
+ function z() {
122
+ k.value = x(O.value);
123
+ }
124
+ function B(e) {
125
+ return S(e, k.value);
126
+ }
127
+ function V(e) {
128
+ return B(e) ? "Key 不能重复(忽略大小写)" : "";
129
+ }
130
+ let H = p(null), U = p(null);
131
+ function W() {
132
+ U.value ||= H.value?.querySelector("tbody") ?? null;
133
+ }
134
+ u(async () => {
135
+ await l(), W(), U.value && Y.start(U.value);
136
+ });
137
+ let G = p(null);
138
+ function K() {
139
+ G.value && (G.value.style.display = "none");
140
+ }
141
+ function q(e) {
142
+ let t = U.value, n = H.value, r = G.value, i = e?.related, a = i instanceof Element ? i.closest("tr") : null;
143
+ if (!t || !n || !r || !a || !t.contains(a)) {
144
+ K();
145
+ return;
146
+ }
147
+ let o = a.getBoundingClientRect(), s = n.getBoundingClientRect(), c = e.willInsertAfter ? o.bottom : o.top;
148
+ r.style.top = `${c - s.top - 1}px`, r.style.left = "0px", r.style.width = `${n.clientWidth}px`, r.style.display = "block";
149
+ }
150
+ let J = f({
151
+ handle: ".me-input-property__drag",
152
+ animation: 150,
153
+ forceFallback: !0,
154
+ fallbackOnBody: !0,
155
+ fallbackClass: "me-input-property__drag-fallback",
156
+ ghostClass: "me-input-property__row--ghost",
157
+ disabled: t(() => !M.value),
158
+ onStart: () => K(),
159
+ onMove: ((e) => (q(e), !0)),
160
+ onEnd: () => {
161
+ K(), z(), P();
162
+ }
163
+ }), Y = v(U, O, {
164
+ ...J,
165
+ immediate: !1
166
+ });
167
+ return g(M, (e) => {
168
+ Y.option("disabled", !e);
169
+ }), (t, l) => {
170
+ let u = m("a-button"), f = m("a-input"), p = m("a-tooltip"), g = m("a-table");
171
+ return d(), i("div", {
172
+ ref_key: "rootEl",
173
+ ref: H,
174
+ class: "me-input-property"
175
+ }, [
176
+ a("div", C, [s(u, {
177
+ size: "small",
178
+ class: "me-input-property__add-btn",
179
+ disabled: c.disabled,
180
+ onClick: L
181
+ }, {
182
+ icon: _(() => [s(h(e), {
183
+ name: "Plus",
184
+ size: 14
185
+ })]),
186
+ default: _(() => [l[0] ||= o(" 新增属性 ", -1)]),
187
+ _: 1
188
+ }, 8, ["disabled"])]),
189
+ s(g, {
190
+ columns: j.value,
191
+ "data-source": O.value,
192
+ "row-key": (e) => e.id,
193
+ pagination: !1,
194
+ size: c.size,
195
+ locale: { emptyText: c.emptyText },
196
+ class: "me-input-property__table"
197
+ }, {
198
+ bodyCell: _(({ column: t, record: a }) => [t.key === "action" ? (d(), i("div", w, [M.value ? (d(), i("span", T, [s(h(e), {
199
+ name: "GripVertical",
200
+ size: 14
201
+ })])) : r("", !0), s(u, {
202
+ type: "text",
203
+ size: "small",
204
+ class: "me-input-property__del",
205
+ disabled: c.disabled,
206
+ title: "删除该属性",
207
+ onClick: (e) => R(a)
208
+ }, {
209
+ default: _(() => [s(h(e), {
210
+ name: "Trash2",
211
+ size: 14
212
+ })]),
213
+ _: 1
214
+ }, 8, ["disabled", "onClick"])])) : t.key === "key" ? (d(), n(p, {
215
+ key: 1,
216
+ title: c.disabled ? "" : V(a.key),
217
+ visible: !c.disabled && B(a.key)
218
+ }, {
219
+ default: _(() => [s(f, {
220
+ value: a.key,
221
+ "onUpdate:value": [(e) => a.key = e, (e) => F(a)],
222
+ disabled: c.disabled,
223
+ placeholder: c.keyPlaceholder,
224
+ status: !c.disabled && B(a.key) ? "error" : ""
225
+ }, null, 8, [
226
+ "value",
227
+ "onUpdate:value",
228
+ "disabled",
229
+ "placeholder",
230
+ "status"
231
+ ])]),
232
+ _: 2
233
+ }, 1032, ["title", "visible"])) : t.key === "value" ? (d(), n(f, {
234
+ key: 2,
235
+ value: a.value,
236
+ "onUpdate:value": [(e) => a.value = e, (e) => I(a)],
237
+ disabled: c.disabled,
238
+ placeholder: c.valuePlaceholder
239
+ }, null, 8, [
240
+ "value",
241
+ "onUpdate:value",
242
+ "disabled",
243
+ "placeholder"
244
+ ])) : r("", !0)]),
245
+ _: 1
246
+ }, 8, [
247
+ "columns",
248
+ "data-source",
249
+ "row-key",
250
+ "size",
251
+ "locale"
252
+ ]),
253
+ a("div", {
254
+ ref_key: "dropLineEl",
255
+ ref: G,
256
+ class: "me-input-property__drop-line"
257
+ }, null, 512)
258
+ ], 512);
259
+ };
260
+ }
261
+ });
262
+ //#endregion
263
+ //#region src/components/input-property/index.ts
264
+ E.install = (e) => {
265
+ e.component("MeInputProperty", E);
266
+ };
267
+ var D = E;
268
+ //#endregion
269
+ export { E as MeInputProperty, x as checkDuplicateKeys, D as default, y as genId, S as isDuplicateKey, b as normalizeKey };
@@ -0,0 +1,18 @@
1
+ import { MeInputPropertyProps } from './types';
2
+ declare const __VLS_export: import('vue').DefineComponent<MeInputPropertyProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
3
+ change: (value: Record<string, any>) => any;
4
+ "update:modelValue": (value: Record<string, any>) => any;
5
+ }, string, import('vue').PublicProps, Readonly<MeInputPropertyProps> & Readonly<{
6
+ onChange?: ((value: Record<string, any>) => any) | undefined;
7
+ "onUpdate:modelValue"?: ((value: Record<string, any>) => any) | undefined;
8
+ }>, {
9
+ size: "small" | "middle" | "large";
10
+ disabled: boolean;
11
+ modelValue: Record<string, any>;
12
+ draggable: boolean;
13
+ keyPlaceholder: string;
14
+ valuePlaceholder: string;
15
+ emptyText: string;
16
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * MeInputProperty 属性编辑器组件类型定义
3
+ */
4
+ /** 内部行数据(一维属性项) */
5
+ export interface PropertyKV {
6
+ /** 行唯一 id(组件内部生成,用于定位编辑行,避免 key 变更导致表格重建) */
7
+ id: string | number;
8
+ /** 属性键 */
9
+ key: string;
10
+ /** 属性值(原始值,统一按 string 编辑) */
11
+ value: any;
12
+ }
13
+ /** MeInputProperty Props */
14
+ export interface MeInputPropertyProps {
15
+ /** v-model 绑定的一维 JSON 对象 */
16
+ modelValue?: Record<string, any>;
17
+ /** 是否禁用编辑(只读展示) */
18
+ disabled?: boolean;
19
+ /** 表格尺寸 */
20
+ size?: 'small' | 'middle' | 'large';
21
+ /** 是否允许拖拽排序,默认 true */
22
+ draggable?: boolean;
23
+ /** key 列占位符 */
24
+ keyPlaceholder?: string;
25
+ /** value 列占位符 */
26
+ valuePlaceholder?: string;
27
+ /** 空数据提示 */
28
+ emptyText?: string;
29
+ }
30
+ /** MeInputProperty Events */
31
+ export interface MeInputPropertyEmits {
32
+ /** 更新 v-model 绑定对象 */
33
+ (e: 'update:modelValue', value: Record<string, any>): void;
34
+ /** 数据变更(新增/删除/编辑/排序) */
35
+ (e: 'change', value: Record<string, any>): void;
36
+ }
37
+ /** MeInputProperty 组件实例类型 */
38
+ export type MeInputPropertyInstance = InstanceType<typeof import('./index.vue').default>;
@@ -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;
@@ -0,0 +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 .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}