xlzw-component 1.0.1 → 1.0.2
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/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
#cancel[data-v-
|
|
1
|
+
#cancel[data-v-b09240e9],#submit[data-v-b09240e9],#reset[data-v-b09240e9],#sweep[data-v-b09240e9],#disable[data-v-b09240e9]{font-family:思源黑体 CN-Normal,思源黑体 CN,sans-serif;font-weight:350;font-size:13px;height:36px;line-height:36px;padding:0 20px;border-radius:5px;cursor:pointer;margin:0 5px;display:inline-block;box-sizing:border-box;text-align:center;white-space:nowrap;font-weight:500}#cancel[data-v-b09240e9]{color:#fff;background:#88a6b0}#submit[data-v-b09240e9]{color:#fff;background:#ec4408}#reset[data-v-b09240e9],#sweep[data-v-b09240e9]{color:#000;background:#fff;border:1px solid #88a6b0}#disable[data-v-b09240e9]{color:#ccc;background:#f0f0f0}[data-v-b09240e9]::deep(button){height:36px!important;font-family:思源黑体 CN-Normal,思源黑体 CN,sans-serif;font-weight:350;font-size:13px;background:#f0f0f0;color:#ccc;margin:0 5px}[data-v-0dd67275]::deep(.ant-modal-content){padding:0!important}[data-v-0dd67275]::deep(.ant-modal-close){color:#fff;top:10px;right:10px}[data-v-0dd67275]::deep(.anticon-close){font-size:16px}[data-v-0dd67275]::deep(.ant-modal-close:hover){color:#fff}[data-v-0dd67275]::deep(.ant-modal-header){margin-bottom:0}[data-v-0dd67275]::deep(.ant-modal-title){color:#fff;height:40px;background:#333;display:flex;align-items:center;padding:0 20px;font-size:13px;border-top-left-radius:5px;border-top-right-radius:5px}[data-v-0dd67275]::deep(.ant-modal-body){background:#f0f0f0;padding:10px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}
|
package/dist/xlzw-component.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const
|
|
1
|
+
import { ref as d, resolveComponent as Y, openBlock as $, createElementBlock as E, renderSlot as k, createCommentVNode as z, createBlock as L, withCtx as O, isRef as U, toRefs as q, customRef as F, toValue as u, watch as V, computed as R, unref as J, defineComponent as K, watchEffect as Q, createVNode as Z, createElementVNode as T, normalizeStyle as j, resolveDynamicComponent as ee, toDisplayString as te } from "vue";
|
|
2
|
+
const W = (e, a) => {
|
|
3
3
|
const t = e.__vccOpts || e;
|
|
4
|
-
for (const [
|
|
5
|
-
t[
|
|
4
|
+
for (const [n, o] of a)
|
|
5
|
+
t[n] = o;
|
|
6
6
|
return t;
|
|
7
|
-
},
|
|
7
|
+
}, ne = {
|
|
8
8
|
key: 0,
|
|
9
9
|
id: "reset"
|
|
10
|
-
},
|
|
10
|
+
}, oe = {
|
|
11
11
|
key: 1,
|
|
12
12
|
id: "cancel"
|
|
13
|
-
},
|
|
13
|
+
}, le = {
|
|
14
14
|
key: 2,
|
|
15
15
|
id: "submit"
|
|
16
|
-
},
|
|
16
|
+
}, ae = {
|
|
17
17
|
key: 3,
|
|
18
18
|
id: "sweep"
|
|
19
|
-
},
|
|
19
|
+
}, ie = {
|
|
20
20
|
__name: "xlzw-button",
|
|
21
21
|
props: {
|
|
22
22
|
type: {
|
|
@@ -24,34 +24,230 @@ const y = (e, s) => {
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
setup(e) {
|
|
27
|
-
const
|
|
28
|
-
return (t,
|
|
29
|
-
const
|
|
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" ? (
|
|
27
|
+
const a = d(!0);
|
|
28
|
+
return (t, n) => {
|
|
29
|
+
const o = Y("a-button");
|
|
30
|
+
return $(), E("div", null, [
|
|
31
|
+
e.type == "reset" ? ($(), E("div", ne, [
|
|
32
|
+
k(t.$slots, "default", {}, void 0, !0)
|
|
33
|
+
])) : z("", !0),
|
|
34
|
+
e.type == "cancel" ? ($(), E("div", oe, [
|
|
35
|
+
k(t.$slots, "default", {}, void 0, !0)
|
|
36
|
+
])) : e.type == "submit" ? ($(), E("div", le, [
|
|
37
|
+
k(t.$slots, "default", {}, void 0, !0)
|
|
38
|
+
])) : e.type == "sweep" ? ($(), E("div", ae, [
|
|
39
|
+
k(t.$slots, "default", {}, void 0, !0)
|
|
40
|
+
])) : e.type == "disabled" ? ($(), L(o, {
|
|
41
41
|
key: 4,
|
|
42
42
|
type: "primary",
|
|
43
|
-
disabled:
|
|
43
|
+
disabled: a.value
|
|
44
44
|
}, {
|
|
45
|
-
default:
|
|
46
|
-
|
|
45
|
+
default: O(() => [
|
|
46
|
+
k(t.$slots, "default", {}, void 0, !0)
|
|
47
47
|
]),
|
|
48
48
|
_: 3
|
|
49
|
-
}, 8, ["disabled"])) :
|
|
49
|
+
}, 8, ["disabled"])) : z("", !0)
|
|
50
50
|
]);
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
},
|
|
53
|
+
}, he = /* @__PURE__ */ W(ie, [["__scopeId", "data-v-b09240e9"]]), I = typeof window < "u" && typeof document < "u";
|
|
54
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
55
|
+
const re = Object.prototype.toString, ue = (e) => re.call(e) === "[object Object]";
|
|
56
|
+
function A(e) {
|
|
57
|
+
return Array.isArray(e) ? e : [e];
|
|
58
|
+
}
|
|
59
|
+
function se(e, a = {}) {
|
|
60
|
+
if (!U(e)) return q(e);
|
|
61
|
+
const t = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
|
|
62
|
+
for (const n in e.value) t[n] = F(() => ({
|
|
63
|
+
get() {
|
|
64
|
+
return e.value[n];
|
|
65
|
+
},
|
|
66
|
+
set(o) {
|
|
67
|
+
var i;
|
|
68
|
+
if (!((i = u(a.replaceRef)) !== null && i !== void 0) || i) if (Array.isArray(e.value)) {
|
|
69
|
+
const r = [...e.value];
|
|
70
|
+
r[n] = o, e.value = r;
|
|
71
|
+
} else {
|
|
72
|
+
const r = {
|
|
73
|
+
...e.value,
|
|
74
|
+
[n]: o
|
|
75
|
+
};
|
|
76
|
+
Object.setPrototypeOf(r, Object.getPrototypeOf(e.value)), e.value = r;
|
|
77
|
+
}
|
|
78
|
+
else e.value[n] = o;
|
|
79
|
+
}
|
|
80
|
+
}));
|
|
81
|
+
return t;
|
|
82
|
+
}
|
|
83
|
+
function de(e, a, t) {
|
|
84
|
+
return V(e, a, {
|
|
85
|
+
...t,
|
|
86
|
+
immediate: !0
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
const N = I ? window : void 0;
|
|
90
|
+
function ce(e) {
|
|
91
|
+
var a;
|
|
92
|
+
const t = u(e);
|
|
93
|
+
return (a = t == null ? void 0 : t.$el) !== null && a !== void 0 ? a : t;
|
|
94
|
+
}
|
|
95
|
+
function P(...e) {
|
|
96
|
+
const a = (n, o, i, r) => (n.addEventListener(o, i, r), () => n.removeEventListener(o, i, r)), t = R(() => {
|
|
97
|
+
const n = A(u(e[0])).filter((o) => o != null);
|
|
98
|
+
return n.every((o) => typeof o != "string") ? n : void 0;
|
|
99
|
+
});
|
|
100
|
+
return de(() => {
|
|
101
|
+
var n, o;
|
|
102
|
+
return [
|
|
103
|
+
(n = (o = t.value) === null || o === void 0 ? void 0 : o.map((i) => ce(i))) !== null && n !== void 0 ? n : [N].filter((i) => i != null),
|
|
104
|
+
A(u(t.value ? e[1] : e[0])),
|
|
105
|
+
A(J(t.value ? e[2] : e[1])),
|
|
106
|
+
u(t.value ? e[3] : e[2])
|
|
107
|
+
];
|
|
108
|
+
}, ([n, o, i, r], c, h) => {
|
|
109
|
+
if (!(n != null && n.length) || !(o != null && o.length) || !(i != null && i.length)) return;
|
|
110
|
+
const x = ue(r) ? { ...r } : r, _ = n.flatMap((f) => o.flatMap((y) => i.map((b) => a(f, y, b, x))));
|
|
111
|
+
h(() => {
|
|
112
|
+
_.forEach((f) => f());
|
|
113
|
+
});
|
|
114
|
+
}, { flush: "post" });
|
|
115
|
+
}
|
|
116
|
+
function ve(e, a = {}) {
|
|
117
|
+
var t;
|
|
118
|
+
const { pointerTypes: n, preventDefault: o, stopPropagation: i, exact: r, onMove: c, onEnd: h, onStart: x, initialValue: _, axis: f = "both", draggingElement: y = N, containerElement: b, handle: M = e, buttons: D = [0] } = a, p = d((t = u(_)) !== null && t !== void 0 ? t : {
|
|
119
|
+
x: 0,
|
|
120
|
+
y: 0
|
|
121
|
+
}), s = d(), S = (l) => n ? n.includes(l.pointerType) : !0, w = (l) => {
|
|
122
|
+
u(o) && l.preventDefault(), u(i) && l.stopPropagation();
|
|
123
|
+
}, B = (l) => {
|
|
124
|
+
var v;
|
|
125
|
+
if (!u(D).includes(l.button) || u(a.disabled) || !S(l) || u(r) && l.target !== u(e)) return;
|
|
126
|
+
const m = u(b), C = m == null || (v = m.getBoundingClientRect) === null || v === void 0 ? void 0 : v.call(m), g = u(e).getBoundingClientRect(), X = {
|
|
127
|
+
x: l.clientX - (m ? g.left - C.left + m.scrollLeft : g.left),
|
|
128
|
+
y: l.clientY - (m ? g.top - C.top + m.scrollTop : g.top)
|
|
129
|
+
};
|
|
130
|
+
(x == null ? void 0 : x(X, l)) !== !1 && (s.value = X, w(l));
|
|
131
|
+
}, G = (l) => {
|
|
132
|
+
if (u(a.disabled) || !S(l) || !s.value) return;
|
|
133
|
+
const v = u(b), m = u(e).getBoundingClientRect();
|
|
134
|
+
let { x: C, y: g } = p.value;
|
|
135
|
+
(f === "x" || f === "both") && (C = l.clientX - s.value.x, v && (C = Math.min(Math.max(0, C), v.scrollWidth - m.width))), (f === "y" || f === "both") && (g = l.clientY - s.value.y, v && (g = Math.min(Math.max(0, g), v.scrollHeight - m.height))), p.value = {
|
|
136
|
+
x: C,
|
|
137
|
+
y: g
|
|
138
|
+
}, c == null || c(p.value, l), w(l);
|
|
139
|
+
}, H = (l) => {
|
|
140
|
+
u(a.disabled) || !S(l) || s.value && (s.value = void 0, h == null || h(p.value, l), w(l));
|
|
141
|
+
};
|
|
142
|
+
if (I) {
|
|
143
|
+
const l = () => {
|
|
144
|
+
var v;
|
|
145
|
+
return {
|
|
146
|
+
capture: (v = a.capture) !== null && v !== void 0 ? v : !0,
|
|
147
|
+
passive: !u(o)
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
P(M, "pointerdown", B, l), P(y, "pointermove", G, l), P(y, "pointerup", H, l);
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
...se(p),
|
|
154
|
+
position: p,
|
|
155
|
+
isDragging: R(() => !!s.value),
|
|
156
|
+
style: R(() => `left:${p.value.x}px;top:${p.value.y}px;`)
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
const fe = K({
|
|
160
|
+
props: {
|
|
161
|
+
title: String,
|
|
162
|
+
width: String
|
|
163
|
+
},
|
|
164
|
+
emits: ["resetData"],
|
|
165
|
+
setup(e, a) {
|
|
166
|
+
const t = d(!1), n = d(null), o = () => {
|
|
167
|
+
t.value = !0;
|
|
168
|
+
}, i = () => {
|
|
169
|
+
a.emit("resetData");
|
|
170
|
+
}, { x: r, y: c, isDragging: h } = ve(n), x = (w) => {
|
|
171
|
+
t.value = !1;
|
|
172
|
+
}, _ = d(0), f = d(0), y = d(!1), b = d(0), M = d(0), D = d(0), p = d(0), s = d({
|
|
173
|
+
left: 0,
|
|
174
|
+
right: 0,
|
|
175
|
+
top: 0,
|
|
176
|
+
bottom: 0
|
|
177
|
+
});
|
|
178
|
+
V([r, c], () => {
|
|
179
|
+
if (!y.value) {
|
|
180
|
+
_.value = r.value, f.value = c.value;
|
|
181
|
+
const w = document.body.getBoundingClientRect(), B = n.value.getBoundingClientRect();
|
|
182
|
+
s.value.right = w.width - B.width, s.value.bottom = w.height - B.height, D.value = b.value, p.value = M.value;
|
|
183
|
+
}
|
|
184
|
+
y.value = !0;
|
|
185
|
+
}), V(h, () => {
|
|
186
|
+
h || (y.value = !1);
|
|
187
|
+
}), Q(() => {
|
|
188
|
+
y.value && (b.value = D.value + Math.min(
|
|
189
|
+
Math.max(s.value.left, r.value),
|
|
190
|
+
s.value.right
|
|
191
|
+
) - _.value, M.value = p.value + Math.min(
|
|
192
|
+
Math.max(s.value.top, c.value),
|
|
193
|
+
s.value.bottom
|
|
194
|
+
) - f.value);
|
|
195
|
+
});
|
|
196
|
+
const S = R(() => ({
|
|
197
|
+
transform: `translate(${b.value}px, ${M.value}px)`
|
|
198
|
+
}));
|
|
199
|
+
return {
|
|
200
|
+
visible: t,
|
|
201
|
+
showModal: o,
|
|
202
|
+
handleCancel: x,
|
|
203
|
+
modalTitleRef: n,
|
|
204
|
+
transformStyle: S,
|
|
205
|
+
cancel: i
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}), pe = { style: { background: "#fff", "border-radius": "5px" } }, me = { 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" } };
|
|
209
|
+
function ye(e, a, t, n, o, i) {
|
|
210
|
+
const r = Y("a-modal");
|
|
211
|
+
return $(), E("div", null, [
|
|
212
|
+
Z(r, {
|
|
213
|
+
destroyOnClose: "",
|
|
214
|
+
maskClosable: !1,
|
|
215
|
+
onCancel: e.cancel,
|
|
216
|
+
ref: "modalRef",
|
|
217
|
+
visible: e.visible,
|
|
218
|
+
"onUpdate:visible": a[0] || (a[0] = (c) => e.visible = c),
|
|
219
|
+
"wrap-style": { overflow: "hidden" },
|
|
220
|
+
width: e.width,
|
|
221
|
+
footer: null
|
|
222
|
+
}, {
|
|
223
|
+
title: O(() => [
|
|
224
|
+
T("div", {
|
|
225
|
+
ref: "modalTitleRef",
|
|
226
|
+
style: { width: "100%", cursor: "move", color: "#fff" }
|
|
227
|
+
}, te(e.title), 513)
|
|
228
|
+
]),
|
|
229
|
+
modalRender: O(({ originVNode: c }) => [
|
|
230
|
+
T("div", {
|
|
231
|
+
style: j(e.transformStyle)
|
|
232
|
+
}, [
|
|
233
|
+
($(), L(ee(c)))
|
|
234
|
+
], 4)
|
|
235
|
+
]),
|
|
236
|
+
default: O(() => [
|
|
237
|
+
T("div", pe, [
|
|
238
|
+
k(e.$slots, "content", {}, void 0, !0)
|
|
239
|
+
]),
|
|
240
|
+
T("div", me, [
|
|
241
|
+
k(e.$slots, "footer", {}, void 0, !0)
|
|
242
|
+
])
|
|
243
|
+
]),
|
|
244
|
+
_: 3
|
|
245
|
+
}, 8, ["onCancel", "visible", "width"])
|
|
246
|
+
]);
|
|
247
|
+
}
|
|
248
|
+
const be = /* @__PURE__ */ W(fe, [["render", ye], ["__scopeId", "data-v-0dd67275"]]);
|
|
54
249
|
export {
|
|
55
|
-
|
|
250
|
+
he as XlzwButton,
|
|
251
|
+
be as model
|
|
56
252
|
};
|
|
57
253
|
//# sourceMappingURL=xlzw-component.js.map
|