xlzw-component 1.0.3 → 1.0.4
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/README.md +1 -1
- package/dist/xlzw-component.js +206 -151
- package/dist/xlzw-component.js.map +1 -1
- package/dist/xlzw-component.umd.cjs +2 -2
- package/dist/xlzw-component.umd.cjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/xlzw-component.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { ref as s, resolveComponent as O, openBlock as x, createElementBlock as T, renderSlot as M, createCommentVNode as N, createBlock as Y, withCtx as k, isRef as J, toRefs as K, customRef as Q, toValue as u, watch as X, computed as A, unref as Z, defineComponent as j, watchEffect as ee, createVNode as P, createElementVNode as B, normalizeStyle as te, resolveDynamicComponent as ne, toDisplayString as I, createTextVNode as W } from "vue";
|
|
2
|
+
import "ant-design-vue";
|
|
3
|
+
const G = (e, l) => {
|
|
4
|
+
const n = e.__vccOpts || e;
|
|
5
|
+
for (const [t, o] of l)
|
|
6
|
+
n[t] = o;
|
|
7
|
+
return n;
|
|
8
|
+
}, oe = {
|
|
8
9
|
key: 0,
|
|
9
10
|
id: "reset"
|
|
10
|
-
},
|
|
11
|
+
}, le = {
|
|
11
12
|
key: 1,
|
|
12
13
|
id: "cancel"
|
|
13
|
-
},
|
|
14
|
+
}, ie = {
|
|
14
15
|
key: 2,
|
|
15
16
|
id: "submit"
|
|
16
17
|
}, ae = {
|
|
17
18
|
key: 3,
|
|
18
19
|
id: "sweep"
|
|
19
|
-
},
|
|
20
|
+
}, re = {
|
|
20
21
|
__name: "xlzw-button",
|
|
21
22
|
props: {
|
|
22
23
|
type: {
|
|
@@ -24,230 +25,284 @@ const W = (e, a) => {
|
|
|
24
25
|
}
|
|
25
26
|
},
|
|
26
27
|
setup(e) {
|
|
27
|
-
const
|
|
28
|
-
return (
|
|
29
|
-
const o =
|
|
30
|
-
return
|
|
31
|
-
e.type == "reset" ? (
|
|
32
|
-
|
|
33
|
-
])) :
|
|
34
|
-
e.type == "cancel" ? (
|
|
35
|
-
|
|
36
|
-
])) : e.type == "submit" ? (
|
|
37
|
-
|
|
38
|
-
])) : e.type == "sweep" ? (
|
|
39
|
-
|
|
40
|
-
])) : e.type == "disabled" ? (
|
|
28
|
+
const l = s(!0);
|
|
29
|
+
return (n, t) => {
|
|
30
|
+
const o = O("a-button");
|
|
31
|
+
return x(), T("div", null, [
|
|
32
|
+
e.type == "reset" ? (x(), T("div", oe, [
|
|
33
|
+
M(n.$slots, "default", {}, void 0, !0)
|
|
34
|
+
])) : N("", !0),
|
|
35
|
+
e.type == "cancel" ? (x(), T("div", le, [
|
|
36
|
+
M(n.$slots, "default", {}, void 0, !0)
|
|
37
|
+
])) : e.type == "submit" ? (x(), T("div", ie, [
|
|
38
|
+
M(n.$slots, "default", {}, void 0, !0)
|
|
39
|
+
])) : e.type == "sweep" ? (x(), T("div", ae, [
|
|
40
|
+
M(n.$slots, "default", {}, void 0, !0)
|
|
41
|
+
])) : e.type == "disabled" ? (x(), Y(o, {
|
|
41
42
|
key: 4,
|
|
42
43
|
type: "primary",
|
|
43
|
-
disabled:
|
|
44
|
+
disabled: l.value
|
|
44
45
|
}, {
|
|
45
|
-
default:
|
|
46
|
-
|
|
46
|
+
default: k(() => [
|
|
47
|
+
M(n.$slots, "default", {}, void 0, !0)
|
|
47
48
|
]),
|
|
48
49
|
_: 3
|
|
49
|
-
}, 8, ["disabled"])) :
|
|
50
|
+
}, 8, ["disabled"])) : N("", !0)
|
|
50
51
|
]);
|
|
51
52
|
};
|
|
52
53
|
}
|
|
53
|
-
},
|
|
54
|
+
}, xe = /* @__PURE__ */ G(re, [["__scopeId", "data-v-b09240e9"]]), H = typeof window < "u" && typeof document < "u";
|
|
54
55
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
55
|
-
const
|
|
56
|
-
function
|
|
56
|
+
const ue = Object.prototype.toString, se = (e) => ue.call(e) === "[object Object]";
|
|
57
|
+
function V(e) {
|
|
57
58
|
return Array.isArray(e) ? e : [e];
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
-
if (!
|
|
61
|
-
const
|
|
62
|
-
for (const
|
|
60
|
+
function de(e, l = {}) {
|
|
61
|
+
if (!J(e)) return K(e);
|
|
62
|
+
const n = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
|
|
63
|
+
for (const t in e.value) n[t] = Q(() => ({
|
|
63
64
|
get() {
|
|
64
|
-
return e.value[
|
|
65
|
+
return e.value[t];
|
|
65
66
|
},
|
|
66
67
|
set(o) {
|
|
67
|
-
var
|
|
68
|
-
if (!((
|
|
69
|
-
const
|
|
70
|
-
|
|
68
|
+
var r;
|
|
69
|
+
if (!((r = u(l.replaceRef)) !== null && r !== void 0) || r) if (Array.isArray(e.value)) {
|
|
70
|
+
const a = [...e.value];
|
|
71
|
+
a[t] = o, e.value = a;
|
|
71
72
|
} else {
|
|
72
|
-
const
|
|
73
|
+
const a = {
|
|
73
74
|
...e.value,
|
|
74
|
-
[
|
|
75
|
+
[t]: o
|
|
75
76
|
};
|
|
76
|
-
Object.setPrototypeOf(
|
|
77
|
+
Object.setPrototypeOf(a, Object.getPrototypeOf(e.value)), e.value = a;
|
|
77
78
|
}
|
|
78
|
-
else e.value[
|
|
79
|
+
else e.value[t] = o;
|
|
79
80
|
}
|
|
80
81
|
}));
|
|
81
|
-
return
|
|
82
|
+
return n;
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
-
return
|
|
85
|
-
...
|
|
84
|
+
function ce(e, l, n) {
|
|
85
|
+
return X(e, l, {
|
|
86
|
+
...n,
|
|
86
87
|
immediate: !0
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
|
-
const
|
|
90
|
-
function
|
|
91
|
-
var
|
|
92
|
-
const
|
|
93
|
-
return (
|
|
90
|
+
const U = H ? window : void 0;
|
|
91
|
+
function ve(e) {
|
|
92
|
+
var l;
|
|
93
|
+
const n = u(e);
|
|
94
|
+
return (l = n == null ? void 0 : n.$el) !== null && l !== void 0 ? l : n;
|
|
94
95
|
}
|
|
95
|
-
function
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
return
|
|
96
|
+
function z(...e) {
|
|
97
|
+
const l = (t, o, r, a) => (t.addEventListener(o, r, a), () => t.removeEventListener(o, r, a)), n = A(() => {
|
|
98
|
+
const t = V(u(e[0])).filter((o) => o != null);
|
|
99
|
+
return t.every((o) => typeof o != "string") ? t : void 0;
|
|
99
100
|
});
|
|
100
|
-
return
|
|
101
|
-
var
|
|
101
|
+
return ce(() => {
|
|
102
|
+
var t, o;
|
|
102
103
|
return [
|
|
103
|
-
(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
u(
|
|
104
|
+
(t = (o = n.value) === null || o === void 0 ? void 0 : o.map((r) => ve(r))) !== null && t !== void 0 ? t : [U].filter((r) => r != null),
|
|
105
|
+
V(u(n.value ? e[1] : e[0])),
|
|
106
|
+
V(Z(n.value ? e[2] : e[1])),
|
|
107
|
+
u(n.value ? e[3] : e[2])
|
|
107
108
|
];
|
|
108
|
-
}, ([
|
|
109
|
-
if (!(
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
}, ([t, o, r, a], d, g) => {
|
|
110
|
+
if (!(t != null && t.length) || !(o != null && o.length) || !(r != null && r.length)) return;
|
|
111
|
+
const b = se(a) ? { ...a } : a, m = t.flatMap((v) => o.flatMap((f) => r.map((_) => l(v, f, _, b))));
|
|
112
|
+
g(() => {
|
|
113
|
+
m.forEach((v) => v());
|
|
113
114
|
});
|
|
114
115
|
}, { flush: "post" });
|
|
115
116
|
}
|
|
116
|
-
function
|
|
117
|
-
var
|
|
118
|
-
const { pointerTypes:
|
|
117
|
+
function fe(e, l = {}) {
|
|
118
|
+
var n;
|
|
119
|
+
const { pointerTypes: t, preventDefault: o, stopPropagation: r, exact: a, onMove: d, onEnd: g, onStart: b, initialValue: m, axis: v = "both", draggingElement: f = U, containerElement: _, handle: D = e, buttons: S = [0] } = l, h = s((n = u(m)) !== null && n !== void 0 ? n : {
|
|
119
120
|
x: 0,
|
|
120
121
|
y: 0
|
|
121
|
-
}),
|
|
122
|
-
u(o) &&
|
|
123
|
-
},
|
|
124
|
-
var
|
|
125
|
-
if (!u(
|
|
126
|
-
const
|
|
127
|
-
x:
|
|
128
|
-
y:
|
|
122
|
+
}), c = s(), E = (i) => t ? t.includes(i.pointerType) : !0, w = (i) => {
|
|
123
|
+
u(o) && i.preventDefault(), u(r) && i.stopPropagation();
|
|
124
|
+
}, R = (i) => {
|
|
125
|
+
var p;
|
|
126
|
+
if (!u(S).includes(i.button) || u(l.disabled) || !E(i) || u(a) && i.target !== u(e)) return;
|
|
127
|
+
const y = u(_), C = y == null || (p = y.getBoundingClientRect) === null || p === void 0 ? void 0 : p.call(y), $ = u(e).getBoundingClientRect(), L = {
|
|
128
|
+
x: i.clientX - (y ? $.left - C.left + y.scrollLeft : $.left),
|
|
129
|
+
y: i.clientY - (y ? $.top - C.top + y.scrollTop : $.top)
|
|
129
130
|
};
|
|
130
|
-
(
|
|
131
|
-
},
|
|
132
|
-
if (u(
|
|
133
|
-
const
|
|
134
|
-
let { x: C, y:
|
|
135
|
-
(
|
|
131
|
+
(b == null ? void 0 : b(L, i)) !== !1 && (c.value = L, w(i));
|
|
132
|
+
}, q = (i) => {
|
|
133
|
+
if (u(l.disabled) || !E(i) || !c.value) return;
|
|
134
|
+
const p = u(_), y = u(e).getBoundingClientRect();
|
|
135
|
+
let { x: C, y: $ } = h.value;
|
|
136
|
+
(v === "x" || v === "both") && (C = i.clientX - c.value.x, p && (C = Math.min(Math.max(0, C), p.scrollWidth - y.width))), (v === "y" || v === "both") && ($ = i.clientY - c.value.y, p && ($ = Math.min(Math.max(0, $), p.scrollHeight - y.height))), h.value = {
|
|
136
137
|
x: C,
|
|
137
|
-
y:
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
u(
|
|
138
|
+
y: $
|
|
139
|
+
}, d == null || d(h.value, i), w(i);
|
|
140
|
+
}, F = (i) => {
|
|
141
|
+
u(l.disabled) || !E(i) || c.value && (c.value = void 0, g == null || g(h.value, i), w(i));
|
|
141
142
|
};
|
|
142
|
-
if (
|
|
143
|
-
const
|
|
144
|
-
var
|
|
143
|
+
if (H) {
|
|
144
|
+
const i = () => {
|
|
145
|
+
var p;
|
|
145
146
|
return {
|
|
146
|
-
capture: (
|
|
147
|
+
capture: (p = l.capture) !== null && p !== void 0 ? p : !0,
|
|
147
148
|
passive: !u(o)
|
|
148
149
|
};
|
|
149
150
|
};
|
|
150
|
-
|
|
151
|
+
z(D, "pointerdown", R, i), z(f, "pointermove", q, i), z(f, "pointerup", F, i);
|
|
151
152
|
}
|
|
152
153
|
return {
|
|
153
|
-
...
|
|
154
|
-
position:
|
|
155
|
-
isDragging:
|
|
156
|
-
style:
|
|
154
|
+
...de(h),
|
|
155
|
+
position: h,
|
|
156
|
+
isDragging: A(() => !!c.value),
|
|
157
|
+
style: A(() => `left:${h.value.x}px;top:${h.value.y}px;`)
|
|
157
158
|
};
|
|
158
159
|
}
|
|
159
|
-
const
|
|
160
|
+
const pe = j({
|
|
160
161
|
props: {
|
|
161
162
|
title: String,
|
|
162
163
|
width: String
|
|
163
164
|
},
|
|
164
165
|
emits: ["resetData"],
|
|
165
|
-
setup(e,
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
}, { x:
|
|
171
|
-
|
|
172
|
-
},
|
|
166
|
+
setup(e, l) {
|
|
167
|
+
const n = s(!1), t = s(null), o = () => {
|
|
168
|
+
n.value = !0;
|
|
169
|
+
}, r = () => {
|
|
170
|
+
l.emit("resetData");
|
|
171
|
+
}, { x: a, y: d, isDragging: g } = fe(t), b = (w) => {
|
|
172
|
+
n.value = !1;
|
|
173
|
+
}, m = s(0), v = s(0), f = s(!1), _ = s(0), D = s(0), S = s(0), h = s(0), c = s({
|
|
173
174
|
left: 0,
|
|
174
175
|
right: 0,
|
|
175
176
|
top: 0,
|
|
176
177
|
bottom: 0
|
|
177
178
|
});
|
|
178
|
-
|
|
179
|
-
if (!
|
|
180
|
-
|
|
181
|
-
const w = document.body.getBoundingClientRect(),
|
|
182
|
-
|
|
179
|
+
X([a, d], () => {
|
|
180
|
+
if (!f.value) {
|
|
181
|
+
m.value = a.value, v.value = d.value;
|
|
182
|
+
const w = document.body.getBoundingClientRect(), R = t.value.getBoundingClientRect();
|
|
183
|
+
c.value.right = w.width - R.width, c.value.bottom = w.height - R.height, S.value = _.value, h.value = D.value;
|
|
183
184
|
}
|
|
184
|
-
|
|
185
|
-
}),
|
|
186
|
-
|
|
187
|
-
}),
|
|
188
|
-
|
|
189
|
-
Math.max(
|
|
190
|
-
|
|
191
|
-
) -
|
|
192
|
-
Math.max(
|
|
193
|
-
|
|
194
|
-
) -
|
|
185
|
+
f.value = !0;
|
|
186
|
+
}), X(g, () => {
|
|
187
|
+
g || (f.value = !1);
|
|
188
|
+
}), ee(() => {
|
|
189
|
+
f.value && (_.value = S.value + Math.min(
|
|
190
|
+
Math.max(c.value.left, a.value),
|
|
191
|
+
c.value.right
|
|
192
|
+
) - m.value, D.value = h.value + Math.min(
|
|
193
|
+
Math.max(c.value.top, d.value),
|
|
194
|
+
c.value.bottom
|
|
195
|
+
) - v.value);
|
|
195
196
|
});
|
|
196
|
-
const
|
|
197
|
-
transform: `translate(${
|
|
197
|
+
const E = A(() => ({
|
|
198
|
+
transform: `translate(${_.value}px, ${D.value}px)`
|
|
198
199
|
}));
|
|
199
200
|
return {
|
|
200
|
-
visible:
|
|
201
|
+
visible: n,
|
|
201
202
|
showModal: o,
|
|
202
|
-
handleCancel:
|
|
203
|
-
modalTitleRef:
|
|
204
|
-
transformStyle:
|
|
205
|
-
cancel:
|
|
203
|
+
handleCancel: b,
|
|
204
|
+
modalTitleRef: t,
|
|
205
|
+
transformStyle: E,
|
|
206
|
+
cancel: r
|
|
206
207
|
};
|
|
207
208
|
}
|
|
208
|
-
}),
|
|
209
|
-
function ye(e,
|
|
210
|
-
const
|
|
211
|
-
return
|
|
212
|
-
|
|
209
|
+
}), me = { style: { background: "#fff", "border-radius": "5px" } }, he = { style: { background: "rgb(255, 255, 255)", height: "44px", display: "flex", "align-items": "center", "justify-content": "end", "margin-top": "10px", padding: "0 10px", "border-radius": "5px" } };
|
|
210
|
+
function ye(e, l, n, t, o, r) {
|
|
211
|
+
const a = O("a-modal");
|
|
212
|
+
return x(), T("div", null, [
|
|
213
|
+
P(a, {
|
|
213
214
|
destroyOnClose: "",
|
|
214
215
|
maskClosable: !1,
|
|
215
216
|
onCancel: e.cancel,
|
|
216
217
|
ref: "modalRef",
|
|
217
218
|
visible: e.visible,
|
|
218
|
-
"onUpdate:visible":
|
|
219
|
+
"onUpdate:visible": l[0] || (l[0] = (d) => e.visible = d),
|
|
219
220
|
"wrap-style": { overflow: "hidden" },
|
|
220
221
|
width: e.width,
|
|
221
222
|
footer: null
|
|
222
223
|
}, {
|
|
223
|
-
title:
|
|
224
|
-
|
|
224
|
+
title: k(() => [
|
|
225
|
+
B("div", {
|
|
225
226
|
ref: "modalTitleRef",
|
|
226
227
|
style: { width: "100%", cursor: "move", color: "#fff" }
|
|
227
|
-
},
|
|
228
|
+
}, I(e.title), 513)
|
|
228
229
|
]),
|
|
229
|
-
modalRender:
|
|
230
|
-
|
|
231
|
-
style:
|
|
230
|
+
modalRender: k(({ originVNode: d }) => [
|
|
231
|
+
B("div", {
|
|
232
|
+
style: te(e.transformStyle)
|
|
232
233
|
}, [
|
|
233
|
-
(
|
|
234
|
+
(x(), Y(ne(d)))
|
|
234
235
|
], 4)
|
|
235
236
|
]),
|
|
236
|
-
default:
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
default: k(() => [
|
|
238
|
+
B("div", me, [
|
|
239
|
+
M(e.$slots, "content", {}, void 0, !0)
|
|
239
240
|
]),
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
B("div", he, [
|
|
242
|
+
M(e.$slots, "footer", {}, void 0, !0)
|
|
242
243
|
])
|
|
243
244
|
]),
|
|
244
245
|
_: 3
|
|
245
246
|
}, 8, ["onCancel", "visible", "width"])
|
|
246
247
|
]);
|
|
247
248
|
}
|
|
248
|
-
const
|
|
249
|
+
const ke = /* @__PURE__ */ G(pe, [["render", ye], ["__scopeId", "data-v-868a4dd6"]]), ge = { style: { "font-size": "13px", "font-weight": "700", padding: "15px 0px", height: "116px" } }, be = { style: { padding: "0 24px" } }, we = {
|
|
250
|
+
__name: "xlzw-deletePrompt",
|
|
251
|
+
emits: ["delOk"],
|
|
252
|
+
setup(e, { expose: l, emit: n }) {
|
|
253
|
+
const t = s(null), o = s("");
|
|
254
|
+
function r() {
|
|
255
|
+
g("delOk"), a();
|
|
256
|
+
}
|
|
257
|
+
function a() {
|
|
258
|
+
o.value = "", t.value.handleCancel();
|
|
259
|
+
}
|
|
260
|
+
function d(b) {
|
|
261
|
+
o.value = b, t.value.showModal();
|
|
262
|
+
}
|
|
263
|
+
const g = n;
|
|
264
|
+
return l({ showModal: d }), (b, m) => {
|
|
265
|
+
const v = O("Title"), f = O("Button"), _ = O("Modal");
|
|
266
|
+
return x(), Y(_, {
|
|
267
|
+
width: "430px",
|
|
268
|
+
ref_key: "modalRef",
|
|
269
|
+
ref: t,
|
|
270
|
+
title: "确认对话框"
|
|
271
|
+
}, {
|
|
272
|
+
content: k(() => [
|
|
273
|
+
B("div", ge, [
|
|
274
|
+
P(v, { title: "提交" }),
|
|
275
|
+
B("div", be, I(o.value), 1)
|
|
276
|
+
])
|
|
277
|
+
]),
|
|
278
|
+
footer: k(() => [
|
|
279
|
+
P(f, {
|
|
280
|
+
type: "reset",
|
|
281
|
+
onClick: a
|
|
282
|
+
}, {
|
|
283
|
+
default: k(() => [...m[0] || (m[0] = [
|
|
284
|
+
W("取消", -1)
|
|
285
|
+
])]),
|
|
286
|
+
_: 1
|
|
287
|
+
}),
|
|
288
|
+
P(f, {
|
|
289
|
+
type: "submit",
|
|
290
|
+
onClick: r
|
|
291
|
+
}, {
|
|
292
|
+
default: k(() => [...m[1] || (m[1] = [
|
|
293
|
+
W("确定", -1)
|
|
294
|
+
])]),
|
|
295
|
+
_: 1
|
|
296
|
+
})
|
|
297
|
+
]),
|
|
298
|
+
_: 1
|
|
299
|
+
}, 512);
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
};
|
|
249
303
|
export {
|
|
250
|
-
|
|
251
|
-
|
|
304
|
+
xe as Button,
|
|
305
|
+
we as DeletePrompt,
|
|
306
|
+
ke as Model
|
|
252
307
|
};
|
|
253
308
|
//# sourceMappingURL=xlzw-component.js.map
|