@web-utils/component 2.8.27 → 2.8.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.
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var h = Object.defineProperty, M = Object.defineProperties;
|
|
2
|
+
var C = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var x = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var b = (e, t, a) => t in e ?
|
|
4
|
+
var D = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var b = (e, t, a) => t in e ? h(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a, w = (e, t) => {
|
|
6
6
|
for (var a in t || (t = {}))
|
|
7
|
-
|
|
7
|
+
D.call(t, a) && b(e, a, t[a]);
|
|
8
8
|
if (x)
|
|
9
9
|
for (var a of x(t))
|
|
10
|
-
|
|
10
|
+
F.call(t, a) && b(e, a, t[a]);
|
|
11
11
|
return e;
|
|
12
|
-
}, S = (e, t) =>
|
|
12
|
+
}, S = (e, t) => M(e, C(t));
|
|
13
13
|
var T = (e, t, a) => new Promise((o, n) => {
|
|
14
14
|
var r = (i) => {
|
|
15
15
|
try {
|
|
@@ -26,29 +26,29 @@ var T = (e, t, a) => new Promise((o, n) => {
|
|
|
26
26
|
}, f = (i) => i.done ? o(i.value) : Promise.resolve(i.value).then(r, c);
|
|
27
27
|
f((a = a.apply(e, t)).next());
|
|
28
28
|
});
|
|
29
|
-
import
|
|
30
|
-
import
|
|
29
|
+
import v from "element-ui/lib/loading";
|
|
30
|
+
import B from "element-ui/lib/message-box";
|
|
31
31
|
import { isFunction as p } from "@web-utils/core";
|
|
32
32
|
function I(e, t, a) {
|
|
33
33
|
return T(this, null, function* () {
|
|
34
|
-
const { stop: o, prevent: n, message: r, loadable: c, loadingText: f, confirmable: i, confirmType: l, confirmText:
|
|
34
|
+
const { stop: o, prevent: n, message: r, loadable: c, loadingText: f, confirmable: i, confirmType: l, confirmText: k } = t;
|
|
35
35
|
o && e.stopPropagation(), n && e.preventDefault();
|
|
36
|
-
const { before:
|
|
37
|
-
if (p(
|
|
36
|
+
const { before: s, click: d, cancel: g, after: m } = a;
|
|
37
|
+
if (p(d))
|
|
38
38
|
try {
|
|
39
39
|
let u = !0;
|
|
40
|
-
if (p(
|
|
40
|
+
if (p(s) && (u = yield s(e)), u === !1)
|
|
41
41
|
return;
|
|
42
|
-
i && (yield
|
|
42
|
+
i && (yield (B.confirm || B.default.confirm)(r || k, { type: l }));
|
|
43
43
|
let y;
|
|
44
|
-
c && (y =
|
|
44
|
+
c && (y = (v.service || v.default.service)({ background: "rgba(0,0,0,0.3)", text: f }));
|
|
45
45
|
try {
|
|
46
|
-
yield
|
|
46
|
+
yield d(e);
|
|
47
47
|
} catch (L) {
|
|
48
48
|
}
|
|
49
49
|
c && y.close(), p(m) && (yield m(e));
|
|
50
50
|
} catch (u) {
|
|
51
|
-
p(
|
|
51
|
+
p(g) && (yield g(u));
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
}
|
package/confirm-button/index.mjs
CHANGED
package/confirmable/index.mjs
CHANGED
package/form-input-tag/index.mjs
CHANGED
|
@@ -1,66 +1,70 @@
|
|
|
1
|
-
var
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
2
|
var a = Object.getOwnPropertySymbols;
|
|
3
|
-
var
|
|
4
|
-
var l = (
|
|
5
|
-
for (var t in
|
|
6
|
-
|
|
3
|
+
var c = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var l = (e, r, t) => r in e ? p(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, n = (e, r) => {
|
|
5
|
+
for (var t in r || (r = {}))
|
|
6
|
+
c.call(r, t) && l(e, t, r[t]);
|
|
7
7
|
if (a)
|
|
8
|
-
for (var t of a(
|
|
9
|
-
|
|
10
|
-
return
|
|
8
|
+
for (var t of a(r))
|
|
9
|
+
m.call(r, t) && l(e, t, r[t]);
|
|
10
|
+
return e;
|
|
11
11
|
};
|
|
12
|
-
import { f as
|
|
13
|
-
import { d, n as
|
|
14
|
-
import
|
|
12
|
+
import { f as d } from "../chunks/form-input-mixin.4632ad36.mjs";
|
|
13
|
+
import { d as f, n as _ } from "../chunks/index.57f871af.mjs";
|
|
14
|
+
import s from "@web-utils/component/x-input-tag";
|
|
15
15
|
import "@web-utils/component/x-input-tag/style.css";
|
|
16
16
|
import { n as y } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
return t("FormItem",
|
|
17
|
+
var b = function() {
|
|
18
|
+
var e = this, r = e.$createElement, t = e._self._c || r;
|
|
19
|
+
return t("FormItem", e._b({
|
|
20
20
|
attrs: {
|
|
21
|
-
block:
|
|
22
|
-
rules:
|
|
23
|
-
disabled:
|
|
21
|
+
block: e.block,
|
|
22
|
+
rules: e.computeRules,
|
|
23
|
+
disabled: e.inputDisabled
|
|
24
24
|
},
|
|
25
|
-
scopedSlots:
|
|
25
|
+
scopedSlots: e._u([{
|
|
26
26
|
key: "default",
|
|
27
27
|
fn: function() {
|
|
28
|
-
return [t("XInputTag",
|
|
28
|
+
return [t("XInputTag", e._g(e._b({
|
|
29
29
|
attrs: {
|
|
30
|
-
value:
|
|
31
|
-
readonly:
|
|
32
|
-
disabled:
|
|
33
|
-
placeholder:
|
|
34
|
-
"array-mode":
|
|
30
|
+
value: e.value,
|
|
31
|
+
readonly: e.readonly,
|
|
32
|
+
disabled: e.inputDisabled,
|
|
33
|
+
placeholder: e.computePlaceholder,
|
|
34
|
+
"array-mode": e.arrayMode,
|
|
35
|
+
"object-mode": e.objectMode
|
|
35
36
|
},
|
|
36
37
|
on: {
|
|
37
38
|
input: function(o) {
|
|
38
|
-
return
|
|
39
|
+
return e.$emit("input", o);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
|
-
}, "XInputTag",
|
|
42
|
+
}, "XInputTag", e.inputProps, !1), e.listeners))];
|
|
42
43
|
},
|
|
43
44
|
proxy: !0
|
|
44
45
|
}, {
|
|
45
46
|
key: "error",
|
|
46
47
|
fn: function(o) {
|
|
47
|
-
var
|
|
48
|
-
return [
|
|
49
|
-
error:
|
|
48
|
+
var i = o.error;
|
|
49
|
+
return [e._t("error", null, {
|
|
50
|
+
error: i
|
|
50
51
|
})];
|
|
51
52
|
}
|
|
52
53
|
}, {
|
|
53
54
|
key: "label",
|
|
54
55
|
fn: function() {
|
|
55
|
-
return [
|
|
56
|
+
return [e._t("label")];
|
|
56
57
|
},
|
|
57
58
|
proxy: !0
|
|
58
59
|
}], null, !0)
|
|
59
|
-
}, "FormItem",
|
|
60
|
-
},
|
|
61
|
-
const I = Object.keys(
|
|
60
|
+
}, "FormItem", e.formItemProps, !1));
|
|
61
|
+
}, v = [];
|
|
62
|
+
const I = Object.keys(s.props).filter((e) => !["value", "placeholder", "disabled"].includes(e)), h = {
|
|
62
63
|
name: "FormInputTag",
|
|
63
|
-
|
|
64
|
+
components: {
|
|
65
|
+
XInputTag: s
|
|
66
|
+
},
|
|
67
|
+
mixins: [d],
|
|
64
68
|
props: {
|
|
65
69
|
value: [Array, String],
|
|
66
70
|
block: {
|
|
@@ -70,27 +74,31 @@ const I = Object.keys(_.props).filter((r) => !["value", "placeholder", "disabled
|
|
|
70
74
|
arrayMode: {
|
|
71
75
|
type: Boolean,
|
|
72
76
|
default: !0
|
|
77
|
+
},
|
|
78
|
+
objectMode: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: !0
|
|
73
81
|
}
|
|
74
82
|
},
|
|
75
83
|
computed: {
|
|
76
84
|
inputProps() {
|
|
77
|
-
return
|
|
85
|
+
return f(n(n({}, _(this.$attrs)), this.$props), I);
|
|
78
86
|
}
|
|
79
87
|
}
|
|
80
88
|
}, u = {};
|
|
81
89
|
var g = /* @__PURE__ */ y(
|
|
82
90
|
h,
|
|
83
|
-
v,
|
|
84
91
|
b,
|
|
92
|
+
v,
|
|
85
93
|
!1,
|
|
86
94
|
k,
|
|
87
95
|
null,
|
|
88
96
|
null,
|
|
89
97
|
null
|
|
90
98
|
);
|
|
91
|
-
function k(
|
|
92
|
-
for (let
|
|
93
|
-
this[
|
|
99
|
+
function k(e) {
|
|
100
|
+
for (let r in u)
|
|
101
|
+
this[r] = u[r];
|
|
94
102
|
}
|
|
95
103
|
const B = /* @__PURE__ */ function() {
|
|
96
104
|
return g.exports;
|
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.8.
|
|
5
|
+
"version": "2.8.29",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"description-markup": "markdown",
|
|
@@ -5894,6 +5894,14 @@
|
|
|
5894
5894
|
"type": "boolean"
|
|
5895
5895
|
},
|
|
5896
5896
|
"default": "true"
|
|
5897
|
+
},
|
|
5898
|
+
{
|
|
5899
|
+
"name": "objectMode",
|
|
5900
|
+
"value": {
|
|
5901
|
+
"kind": "expression",
|
|
5902
|
+
"type": "boolean"
|
|
5903
|
+
},
|
|
5904
|
+
"default": "true"
|
|
5897
5905
|
}
|
|
5898
5906
|
],
|
|
5899
5907
|
"events": [
|
|
@@ -20101,6 +20109,14 @@
|
|
|
20101
20109
|
"type": "boolean"
|
|
20102
20110
|
},
|
|
20103
20111
|
"default": "true"
|
|
20112
|
+
},
|
|
20113
|
+
{
|
|
20114
|
+
"name": "objectMode",
|
|
20115
|
+
"value": {
|
|
20116
|
+
"kind": "expression",
|
|
20117
|
+
"type": "boolean"
|
|
20118
|
+
},
|
|
20119
|
+
"default": "true"
|
|
20104
20120
|
}
|
|
20105
20121
|
],
|
|
20106
20122
|
"events": [
|
package/x-input-tag/index.mjs
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
var f = Object.defineProperty, _ = Object.defineProperties;
|
|
2
|
-
var
|
|
2
|
+
var b = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var p = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var h = (t,
|
|
6
|
-
for (var e in
|
|
7
|
-
|
|
4
|
+
var v = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var h = (t, s, e) => s in t ? f(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e, d = (t, s) => {
|
|
6
|
+
for (var e in s || (s = {}))
|
|
7
|
+
v.call(s, e) && h(t, e, s[e]);
|
|
8
8
|
if (p)
|
|
9
|
-
for (var e of p(
|
|
10
|
-
y.call(
|
|
9
|
+
for (var e of p(s))
|
|
10
|
+
y.call(s, e) && h(t, e, s[e]);
|
|
11
11
|
return t;
|
|
12
|
-
},
|
|
13
|
-
var r = (t,
|
|
14
|
-
var o = (
|
|
12
|
+
}, c = (t, s) => _(t, b(s));
|
|
13
|
+
var r = (t, s, e) => new Promise((a, i) => {
|
|
14
|
+
var o = (n) => {
|
|
15
15
|
try {
|
|
16
|
-
l(e.next(
|
|
16
|
+
l(e.next(n));
|
|
17
17
|
} catch (u) {
|
|
18
|
-
|
|
18
|
+
i(u);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, g = (n) => {
|
|
21
21
|
try {
|
|
22
|
-
l(e.throw(
|
|
22
|
+
l(e.throw(n));
|
|
23
23
|
} catch (u) {
|
|
24
|
-
|
|
24
|
+
i(u);
|
|
25
25
|
}
|
|
26
|
-
}, l = (
|
|
27
|
-
l((e = e.apply(t,
|
|
26
|
+
}, l = (n) => n.done ? a(n.value) : Promise.resolve(n.value).then(o, g);
|
|
27
|
+
l((e = e.apply(t, s)).next());
|
|
28
28
|
});
|
|
29
29
|
import { n as V } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
30
30
|
var w = function() {
|
|
31
|
-
var t = this,
|
|
31
|
+
var t = this, s = t.$createElement, e = t._self._c || s;
|
|
32
32
|
return e("div", {
|
|
33
33
|
staticClass: "x-input-tag"
|
|
34
|
-
}, [t.tags && t.tags.length && t.tags[0] ? t._l(t.tags, function(
|
|
34
|
+
}, [t.tags && t.tags.length && t.tags[0] ? t._l(t.tags, function(a, i) {
|
|
35
35
|
return e("ElTag", {
|
|
36
|
-
key:
|
|
36
|
+
key: a.id || a,
|
|
37
37
|
attrs: {
|
|
38
38
|
size: "medium",
|
|
39
39
|
"disable-transitions": "",
|
|
@@ -41,10 +41,10 @@ var w = function() {
|
|
|
41
41
|
},
|
|
42
42
|
on: {
|
|
43
43
|
close: function(o) {
|
|
44
|
-
return t.handleClose(
|
|
44
|
+
return t.handleClose(a, i);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
}, [t._v(" " + t._s(
|
|
47
|
+
}, [t._v(" " + t._s(a.name || a) + " ")]);
|
|
48
48
|
}) : t.inputDisabled ? [e("span", {
|
|
49
49
|
staticStyle: {
|
|
50
50
|
color: "#b5b5b5"
|
|
@@ -65,14 +65,14 @@ var w = function() {
|
|
|
65
65
|
blur: t.handleInputConfirm
|
|
66
66
|
},
|
|
67
67
|
nativeOn: {
|
|
68
|
-
keyup: function(
|
|
69
|
-
return !
|
|
68
|
+
keyup: function(a) {
|
|
69
|
+
return !a.type.indexOf("key") && t._k(a.keyCode, "enter", 13, a.key, "Enter") ? null : t.handleInputConfirm.apply(null, arguments);
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
model: {
|
|
73
73
|
value: t.inputValue,
|
|
74
|
-
callback: function(
|
|
75
|
-
t.inputValue =
|
|
74
|
+
callback: function(a) {
|
|
75
|
+
t.inputValue = a;
|
|
76
76
|
},
|
|
77
77
|
expression: "inputValue"
|
|
78
78
|
}
|
|
@@ -121,6 +121,10 @@ const C = {
|
|
|
121
121
|
arrayMode: {
|
|
122
122
|
type: Boolean,
|
|
123
123
|
default: !0
|
|
124
|
+
},
|
|
125
|
+
objectMode: {
|
|
126
|
+
type: Boolean,
|
|
127
|
+
default: !0
|
|
124
128
|
}
|
|
125
129
|
},
|
|
126
130
|
data() {
|
|
@@ -136,12 +140,12 @@ const C = {
|
|
|
136
140
|
},
|
|
137
141
|
tags: {
|
|
138
142
|
get() {
|
|
139
|
-
var t,
|
|
143
|
+
var t, s;
|
|
140
144
|
if (this.arrayMode)
|
|
141
|
-
return (t = this.value) != null && t.length ? this.value.map((e) => e.id > 0 ? e :
|
|
145
|
+
return (t = this.value) != null && t.length ? this.objectMode ? this.value.map((e) => e.id > 0 ? e : c(d({}, e), { id: Math.random() })) : this.value : [];
|
|
142
146
|
{
|
|
143
|
-
const e = ((
|
|
144
|
-
return e.length && e[0] ? e.map((
|
|
147
|
+
const e = ((s = this.value) == null ? void 0 : s.split(this.separator)) || [];
|
|
148
|
+
return e.length && e[0] ? e.map((a) => this.objectMode ? { name: a, id: Math.random() } : a) : [];
|
|
145
149
|
}
|
|
146
150
|
}
|
|
147
151
|
}
|
|
@@ -153,30 +157,30 @@ const C = {
|
|
|
153
157
|
});
|
|
154
158
|
},
|
|
155
159
|
handleClose(t) {
|
|
156
|
-
const
|
|
157
|
-
this.$emit("input", this.arrayMode ?
|
|
160
|
+
const s = this.tags.filter((e) => e !== t);
|
|
161
|
+
this.$emit("input", this.arrayMode ? s : s.map((e) => e.name || e).join(this.separator));
|
|
158
162
|
},
|
|
159
163
|
handleInputConfirm() {
|
|
160
164
|
return r(this, null, function* () {
|
|
161
|
-
var
|
|
165
|
+
var s;
|
|
162
166
|
if (this.tags.length >= this.maxTag) {
|
|
163
167
|
this.$message.warning({ message: "标签已达上限,请删除一些标签再添加!", showClose: !0 }), this.inputVisible = !1, this.inputValue = "";
|
|
164
168
|
return;
|
|
165
169
|
}
|
|
166
170
|
const t = this.inputValue;
|
|
167
171
|
if (t) {
|
|
168
|
-
if (this.tags.some((
|
|
172
|
+
if (this.tags.some((a) => (a.name || a) === t)) {
|
|
169
173
|
this.inputVisible = !1, this.inputValue = "", this.$message.warning({ message: "标签已存在!", showClose: !0 });
|
|
170
174
|
return;
|
|
171
175
|
}
|
|
172
176
|
const e = [...this.tags];
|
|
173
|
-
e.push({ id: Date.now(),
|
|
177
|
+
e.push(this.objectMode ? { id: Date.now(), name: this.inputValue } : this.inputValue), this.$emit("input", this.arrayMode ? e : e.map((a) => a.name || a).join(this.separator)), yield this.$nextTick(), (s = this.elFormItem) == null || s.clearValidate();
|
|
174
178
|
}
|
|
175
179
|
this.inputVisible = !1, this.inputValue = "";
|
|
176
180
|
});
|
|
177
181
|
}
|
|
178
182
|
}
|
|
179
|
-
},
|
|
183
|
+
}, m = {};
|
|
180
184
|
var I = /* @__PURE__ */ V(
|
|
181
185
|
C,
|
|
182
186
|
w,
|
|
@@ -188,12 +192,12 @@ var I = /* @__PURE__ */ V(
|
|
|
188
192
|
null
|
|
189
193
|
);
|
|
190
194
|
function T(t) {
|
|
191
|
-
for (let
|
|
192
|
-
this[
|
|
195
|
+
for (let s in m)
|
|
196
|
+
this[s] = m[s];
|
|
193
197
|
}
|
|
194
|
-
const
|
|
198
|
+
const j = /* @__PURE__ */ function() {
|
|
195
199
|
return I.exports;
|
|
196
200
|
}();
|
|
197
201
|
export {
|
|
198
|
-
|
|
202
|
+
j as default
|
|
199
203
|
};
|