@web-utils/component 2.9.0 → 2.9.1
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/context-menu/index.mjs +17 -15
- package/element-dialog/index.mjs +42 -26
- package/package.json +1 -1
- package/web-types.json +10 -2
package/context-menu/index.mjs
CHANGED
|
@@ -68,7 +68,7 @@ var d = function() {
|
|
|
68
68
|
}, [e("div", {
|
|
69
69
|
class: t.secondLeft ? "cm-left" : "",
|
|
70
70
|
on: {
|
|
71
|
-
click: function(
|
|
71
|
+
click: function(o) {
|
|
72
72
|
return t.onItemClick(n, [l, r]);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -90,22 +90,22 @@ var d = function() {
|
|
|
90
90
|
staticClass: "cm-ul cm-ul-3 easy-cm-ul",
|
|
91
91
|
class: t.underline ? "cm-underline" : "",
|
|
92
92
|
style: t.thirdBorderCheck(l, r)
|
|
93
|
-
}, t._l(n.children, function(
|
|
93
|
+
}, t._l(n.children, function(o, h) {
|
|
94
94
|
return e("li", {
|
|
95
|
-
key:
|
|
95
|
+
key: h,
|
|
96
96
|
style: t.liStyle
|
|
97
97
|
}, [e("div", {
|
|
98
98
|
on: {
|
|
99
|
-
click: function(
|
|
100
|
-
return t.onItemClick(
|
|
99
|
+
click: function(p) {
|
|
100
|
+
return t.onItemClick(o, [l, r, h]);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}, [e("i", {
|
|
104
104
|
staticClass: "cm-item-icon",
|
|
105
|
-
class:
|
|
105
|
+
class: o.icon
|
|
106
106
|
}), e("span", {
|
|
107
107
|
staticClass: "cm-item-label"
|
|
108
|
-
}, [t._v(t._s(
|
|
108
|
+
}, [t._v(t._s(o.text))])])]);
|
|
109
109
|
}), 0) : t._e()]);
|
|
110
110
|
}), 0) : t._e()]);
|
|
111
111
|
}), 0)]) : t._e();
|
|
@@ -118,10 +118,8 @@ const m = {
|
|
|
118
118
|
required: !0
|
|
119
119
|
},
|
|
120
120
|
// 是否开启下划线
|
|
121
|
-
underline:
|
|
122
|
-
|
|
123
|
-
default: !1
|
|
124
|
-
},
|
|
121
|
+
underline: Boolean,
|
|
122
|
+
appendToBody: Boolean,
|
|
125
123
|
// 是否开启箭头
|
|
126
124
|
arrow: {
|
|
127
125
|
type: Boolean,
|
|
@@ -205,6 +203,10 @@ const m = {
|
|
|
205
203
|
}
|
|
206
204
|
}
|
|
207
205
|
},
|
|
206
|
+
destroyed() {
|
|
207
|
+
var t;
|
|
208
|
+
this.appendToBody && ((t = this.$el) != null && t.parentNode) && this.$el.parentNode.removeChild(this.$el);
|
|
209
|
+
},
|
|
208
210
|
methods: {
|
|
209
211
|
secondBorderCheck(t) {
|
|
210
212
|
const i = document.body.offsetWidth, e = document.body.offsetHeight, s = this.axis.y + (t + this.list[t].children.length) * this.itemHeight;
|
|
@@ -221,7 +223,7 @@ const m = {
|
|
|
221
223
|
};
|
|
222
224
|
},
|
|
223
225
|
show(t) {
|
|
224
|
-
document.addEventListener("click", this.hide, !0), this.axis = { x: t.clientX, y: t.clientY }, this.rendered = !0, this.visible = !0;
|
|
226
|
+
document.addEventListener("click", this.hide, !0), this.axis = { x: t.clientX, y: t.clientY }, this.rendered = !0, this.visible = !0, this.appendToBody && document.body.appendChild(this.$el);
|
|
225
227
|
},
|
|
226
228
|
hide() {
|
|
227
229
|
this.visible = !1, document.removeEventListener("click", this.hide);
|
|
@@ -230,7 +232,7 @@ const m = {
|
|
|
230
232
|
this.$emit("on-item-click", t, i);
|
|
231
233
|
}
|
|
232
234
|
}
|
|
233
|
-
},
|
|
235
|
+
}, c = {};
|
|
234
236
|
var f = /* @__PURE__ */ a(
|
|
235
237
|
m,
|
|
236
238
|
d,
|
|
@@ -242,8 +244,8 @@ var f = /* @__PURE__ */ a(
|
|
|
242
244
|
null
|
|
243
245
|
);
|
|
244
246
|
function y(t) {
|
|
245
|
-
for (let i in
|
|
246
|
-
this[i] =
|
|
247
|
+
for (let i in c)
|
|
248
|
+
this[i] = c[i];
|
|
247
249
|
}
|
|
248
250
|
const _ = /* @__PURE__ */ function() {
|
|
249
251
|
return f.exports;
|
package/element-dialog/index.mjs
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var r = (e, l, t) => new Promise((i, n) => {
|
|
2
|
+
var c = (o) => {
|
|
3
|
+
try {
|
|
4
|
+
a(t.next(o));
|
|
5
|
+
} catch (s) {
|
|
6
|
+
n(s);
|
|
7
|
+
}
|
|
8
|
+
}, p = (o) => {
|
|
9
|
+
try {
|
|
10
|
+
a(t.throw(o));
|
|
11
|
+
} catch (s) {
|
|
12
|
+
n(s);
|
|
13
|
+
}
|
|
14
|
+
}, a = (o) => o.done ? i(o.value) : Promise.resolve(o.value).then(c, p);
|
|
15
|
+
a((t = t.apply(e, l)).next());
|
|
16
|
+
});
|
|
17
|
+
import d from "element-ui/lib/dialog";
|
|
18
|
+
import { dialogDrag as h } from "@web-utils/vue/directives/dialog-drag";
|
|
19
|
+
import { n as f } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
20
|
+
var m = function() {
|
|
5
21
|
var e = this, l = e.$createElement, t = e._self._c || l;
|
|
6
22
|
return t("Transition", {
|
|
7
23
|
attrs: {
|
|
@@ -28,8 +44,8 @@ var r = function() {
|
|
|
28
44
|
}],
|
|
29
45
|
staticClass: "el-dialog__wrapper",
|
|
30
46
|
on: {
|
|
31
|
-
click: function(
|
|
32
|
-
return
|
|
47
|
+
click: function(i) {
|
|
48
|
+
return i.target !== i.currentTarget ? null : e.handleWrapperClick.apply(null, arguments);
|
|
33
49
|
}
|
|
34
50
|
}
|
|
35
51
|
}, [t("div", {
|
|
@@ -88,8 +104,8 @@ var r = function() {
|
|
|
88
104
|
}, [e._t("footer", null, {
|
|
89
105
|
handleClose: e.handleClose
|
|
90
106
|
})], 2) : e._e()])])]);
|
|
91
|
-
},
|
|
92
|
-
const
|
|
107
|
+
}, g = [];
|
|
108
|
+
const y = {
|
|
93
109
|
props: {
|
|
94
110
|
visible: {
|
|
95
111
|
type: Boolean,
|
|
@@ -124,12 +140,12 @@ const u = {
|
|
|
124
140
|
default: "76vh"
|
|
125
141
|
}
|
|
126
142
|
}
|
|
127
|
-
},
|
|
143
|
+
}, _ = {
|
|
128
144
|
name: "ElementDialog",
|
|
129
145
|
directives: {
|
|
130
|
-
dialogDrag:
|
|
146
|
+
dialogDrag: h
|
|
131
147
|
},
|
|
132
|
-
mixins: [...
|
|
148
|
+
mixins: [...d.mixins || d.default.mixins, y],
|
|
133
149
|
props: {
|
|
134
150
|
title: {
|
|
135
151
|
type: String,
|
|
@@ -194,9 +210,9 @@ const u = {
|
|
|
194
210
|
},
|
|
195
211
|
watch: {
|
|
196
212
|
visible(e) {
|
|
197
|
-
|
|
198
|
-
this.$refs.dialog.scrollTop = 0;
|
|
199
|
-
})
|
|
213
|
+
return r(this, null, function* () {
|
|
214
|
+
e ? (this.closed = !1, this.$emit("open"), this.$el.addEventListener("scroll", this.updatePopper), yield this.$nextTick(), this.$refs.dialog.scrollTop = 0, this.appendToBody && document.body.appendChild(this.$el)) : (this.$el.removeEventListener("scroll", this.updatePopper), this.closed || this.$emit("close"));
|
|
215
|
+
});
|
|
200
216
|
}
|
|
201
217
|
},
|
|
202
218
|
mounted() {
|
|
@@ -238,24 +254,24 @@ const u = {
|
|
|
238
254
|
this.exitFullScreen(), this.$emit("closed");
|
|
239
255
|
}
|
|
240
256
|
}
|
|
241
|
-
},
|
|
242
|
-
var
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
257
|
+
}, u = {};
|
|
258
|
+
var v = /* @__PURE__ */ f(
|
|
259
|
+
_,
|
|
260
|
+
m,
|
|
261
|
+
g,
|
|
246
262
|
!1,
|
|
247
|
-
|
|
263
|
+
C,
|
|
248
264
|
null,
|
|
249
265
|
null,
|
|
250
266
|
null
|
|
251
267
|
);
|
|
252
|
-
function
|
|
253
|
-
for (let l in
|
|
254
|
-
this[l] =
|
|
268
|
+
function C(e) {
|
|
269
|
+
for (let l in u)
|
|
270
|
+
this[l] = u[l];
|
|
255
271
|
}
|
|
256
|
-
const
|
|
257
|
-
return
|
|
272
|
+
const B = /* @__PURE__ */ function() {
|
|
273
|
+
return v.exports;
|
|
258
274
|
}();
|
|
259
275
|
export {
|
|
260
|
-
|
|
276
|
+
B as default
|
|
261
277
|
};
|
package/package.json
CHANGED
package/web-types.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "@web-utils/component",
|
|
5
|
-
"version": "2.9.
|
|
5
|
+
"version": "2.9.1",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"description-markup": "markdown",
|
|
@@ -889,7 +889,15 @@
|
|
|
889
889
|
"kind": "expression",
|
|
890
890
|
"type": "boolean"
|
|
891
891
|
},
|
|
892
|
-
"default": "
|
|
892
|
+
"default": ""
|
|
893
|
+
},
|
|
894
|
+
{
|
|
895
|
+
"name": "appendToBody",
|
|
896
|
+
"value": {
|
|
897
|
+
"kind": "expression",
|
|
898
|
+
"type": "boolean"
|
|
899
|
+
},
|
|
900
|
+
"default": ""
|
|
893
901
|
},
|
|
894
902
|
{
|
|
895
903
|
"name": "arrow",
|