@web-utils/component 2.8.26 → 2.8.27

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@web-utils/component",
3
3
  "description": "Web Components",
4
- "version": "2.8.26",
4
+ "version": "2.8.27",
5
5
  "author": "Simple",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -31,7 +31,9 @@ var f = function() {
31
31
  }, [e._v(" " + e._s(e.getTagName(s)) + " ")]);
32
32
  }) : e.enable ? e._e() : [n("span", {
33
33
  staticStyle: {
34
- color: "#b5b5b5"
34
+ color: "#b5b5b5",
35
+ "line-height": "16px",
36
+ "margin-left": "4px"
35
37
  }
36
38
  }, [e._v("无")])], e.enable ? n("ElButton", {
37
39
  staticClass: "add-tag",
@@ -92,22 +94,22 @@ const p = {
92
94
  }
93
95
  }
94
96
  }, u = {};
95
- var v = /* @__PURE__ */ g(
97
+ var h = /* @__PURE__ */ g(
96
98
  p,
97
99
  f,
98
100
  d,
99
101
  !1,
100
- h,
102
+ v,
101
103
  null,
102
104
  null,
103
105
  null
104
106
  );
105
- function h(e) {
107
+ function v(e) {
106
108
  for (let t in u)
107
109
  this[t] = u[t];
108
110
  }
109
111
  const $ = /* @__PURE__ */ function() {
110
- return v.exports;
112
+ return h.exports;
111
113
  }();
112
114
  export {
113
115
  $ as default
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.26",
5
+ "version": "2.8.27",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "description-markup": "markdown",
@@ -20086,6 +20086,14 @@
20086
20086
  },
20087
20087
  "default": "','"
20088
20088
  },
20089
+ {
20090
+ "name": "count",
20091
+ "value": {
20092
+ "kind": "expression",
20093
+ "type": "boolean"
20094
+ },
20095
+ "default": "true"
20096
+ },
20089
20097
  {
20090
20098
  "name": "arrayMode",
20091
20099
  "value": {
@@ -1,27 +1,27 @@
1
1
  var f = Object.defineProperty, _ = Object.defineProperties;
2
2
  var v = Object.getOwnPropertyDescriptors;
3
3
  var p = Object.getOwnPropertySymbols;
4
- var y = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
5
- var h = (t, a, e) => a in t ? f(t, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[a] = e, m = (t, a) => {
4
+ var b = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable;
5
+ var h = (t, a, e) => a in t ? f(t, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[a] = e, g = (t, a) => {
6
6
  for (var e in a || (a = {}))
7
- y.call(a, e) && h(t, e, a[e]);
7
+ b.call(a, e) && h(t, e, a[e]);
8
8
  if (p)
9
9
  for (var e of p(a))
10
- b.call(a, e) && h(t, e, a[e]);
10
+ y.call(a, e) && h(t, e, a[e]);
11
11
  return t;
12
- }, d = (t, a) => _(t, v(a));
13
- var u = (t, a, e) => new Promise((s, n) => {
12
+ }, m = (t, a) => _(t, v(a));
13
+ var r = (t, a, e) => new Promise((s, n) => {
14
14
  var o = (i) => {
15
15
  try {
16
16
  l(e.next(i));
17
- } catch (r) {
18
- n(r);
17
+ } catch (u) {
18
+ n(u);
19
19
  }
20
20
  }, c = (i) => {
21
21
  try {
22
22
  l(e.throw(i));
23
- } catch (r) {
24
- n(r);
23
+ } catch (u) {
24
+ n(u);
25
25
  }
26
26
  }, l = (i) => i.done ? s(i.value) : Promise.resolve(i.value).then(o, c);
27
27
  l((e = e.apply(t, a)).next());
@@ -30,13 +30,14 @@ import { n as V } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
30
30
  var w = function() {
31
31
  var t = this, a = t.$createElement, e = t._self._c || a;
32
32
  return e("div", {
33
- staticClass: "fy-input-tag"
34
- }, [t._l(t.tags, function(s, n) {
33
+ staticClass: "x-input-tag"
34
+ }, [t.tags && t.tags.length && t.tags[0] ? t._l(t.tags, function(s, n) {
35
35
  return e("ElTag", {
36
36
  key: s.id,
37
37
  attrs: {
38
- closable: !t.inputDisabled,
39
- "disable-transitions": !t.arrayMode
38
+ size: "medium",
39
+ "disable-transitions": "",
40
+ closable: !t.inputDisabled
40
41
  },
41
42
  on: {
42
43
  close: function(o) {
@@ -44,11 +45,21 @@ var w = function() {
44
45
  }
45
46
  }
46
47
  }, [t._v(" " + t._s(s.tagName) + " ")]);
47
- }), !t.inputDisabled && t.inputVisible ? e("ElInput", {
48
+ }) : t.inputDisabled ? [e("span", {
49
+ staticStyle: {
50
+ color: "#b5b5b5"
51
+ }
52
+ }, [t._v("无")])] : t._e(), t.inputDisabled ? t._e() : e("ElInput", {
53
+ directives: [{
54
+ name: "show",
55
+ rawName: "v-show",
56
+ value: t.inputVisible,
57
+ expression: "inputVisible"
58
+ }],
48
59
  ref: "saveTagInput",
49
60
  staticClass: "input-new-tag",
50
61
  attrs: {
51
- size: "small"
62
+ size: "mini"
52
63
  },
53
64
  on: {
54
65
  blur: t.handleInputConfirm
@@ -65,7 +76,7 @@ var w = function() {
65
76
  },
66
77
  expression: "inputValue"
67
78
  }
68
- }) : t._e(), !t.inputDisabled && !t.inputVisible ? e("ElButton", {
79
+ }), !t.inputDisabled && !t.inputVisible ? e("ElButton", {
69
80
  directives: [{
70
81
  name: "show",
71
82
  rawName: "v-show",
@@ -74,14 +85,16 @@ var w = function() {
74
85
  }],
75
86
  staticClass: "button-new-tag",
76
87
  attrs: {
77
- size: "small"
88
+ size: "mini"
78
89
  },
79
90
  on: {
80
91
  click: t.showInput
81
92
  }
82
- }, [t._v(" + 添加 ")]) : t._e()], 2);
93
+ }, [t._v(" + 添加 ")]) : t._e(), t.count ? e("span", {
94
+ staticClass: "tags-count"
95
+ }, [t._v(t._s(t.tags.length && t.tags[0] ? t.tags.length : ""))]) : t._e()], 2);
83
96
  }, x = [];
84
- const I = {
97
+ const C = {
85
98
  name: "XInputTag",
86
99
  inject: {
87
100
  elForm: {
@@ -101,6 +114,10 @@ const I = {
101
114
  type: String,
102
115
  default: ","
103
116
  },
117
+ count: {
118
+ type: Boolean,
119
+ default: !0
120
+ },
104
121
  arrayMode: {
105
122
  type: Boolean,
106
123
  default: !0
@@ -121,7 +138,7 @@ const I = {
121
138
  get() {
122
139
  var t, a;
123
140
  if (this.arrayMode)
124
- return (t = this.value) != null && t.length ? this.value.map((e) => e.id > 0 ? e : d(m({}, e), { id: Math.random() })) : [];
141
+ return (t = this.value) != null && t.length ? this.value.map((e) => e.id > 0 ? e : m(g({}, e), { id: Math.random() })) : [];
125
142
  {
126
143
  const e = ((a = this.value) == null ? void 0 : a.split(this.separator)) || [];
127
144
  return e.length && e[0] ? e.map((s) => ({ tagName: s, id: Math.random() })) : [];
@@ -131,7 +148,7 @@ const I = {
131
148
  },
132
149
  methods: {
133
150
  showInput() {
134
- return u(this, null, function* () {
151
+ return r(this, null, function* () {
135
152
  this.inputVisible = !0, yield this.$nextTick(), this.$refs.saveTagInput.$refs.input.focus();
136
153
  });
137
154
  },
@@ -140,7 +157,7 @@ const I = {
140
157
  this.$emit("input", this.arrayMode ? a : a.map((e) => e.tagName).join(this.separator));
141
158
  },
142
159
  handleInputConfirm() {
143
- return u(this, null, function* () {
160
+ return r(this, null, function* () {
144
161
  var a;
145
162
  if (this.tags.length >= this.maxTag) {
146
163
  this.$message.warning({ message: "标签已达上限,请删除一些标签再添加!", showClose: !0 }), this.inputVisible = !1, this.inputValue = "";
@@ -159,9 +176,9 @@ const I = {
159
176
  });
160
177
  }
161
178
  }
162
- }, g = {};
163
- var C = /* @__PURE__ */ V(
164
- I,
179
+ }, d = {};
180
+ var I = /* @__PURE__ */ V(
181
+ C,
165
182
  w,
166
183
  x,
167
184
  !1,
@@ -171,11 +188,11 @@ var C = /* @__PURE__ */ V(
171
188
  null
172
189
  );
173
190
  function T(t) {
174
- for (let a in g)
175
- this[a] = g[a];
191
+ for (let a in d)
192
+ this[a] = d[a];
176
193
  }
177
194
  const $ = /* @__PURE__ */ function() {
178
- return C.exports;
195
+ return I.exports;
179
196
  }();
180
197
  export {
181
198
  $ as default
@@ -1 +1 @@
1
- .el-form-item.is-error .fy-input-tag{border-color:#f56c6c}.fy-input-tag{height:120px;padding:0 10px 10px;overflow:auto;border:1px solid var(--border-color);border-radius:4px}.fy-input-tag .el-tag{margin-top:10px;margin-right:10px}.fy-input-tag .el-tag+.el-tag{margin-right:10px}.fy-input-tag .button-new-tag{height:28px;margin-top:10px;padding-top:0;padding-bottom:0;line-height:26px}.fy-input-tag .el-input.input-new-tag{width:170px;height:28px;margin-top:10px;line-height:26px;vertical-align:bottom}
1
+ .el-form-item.is-error .x-input-tag{border-color:#f56c6c}.x-input-tag{height:120px;overflow:auto;border:1px solid var(--border-color);border-radius:4px;line-height:0;padding-top:4px;padding-right:4px}.x-input-tag .el-tag .el-tag__close:hover{background-color:#ee8677}.x-input-tag .el-tag,.x-input-tag .button-new-tag{margin-left:4px;margin-bottom:4px}.x-input-tag .el-input.input-new-tag{width:120px;margin-left:4px;margin-bottom:4px}.x-input-tag .tags-count{position:absolute;right:6px;bottom:10px;color:#b7b7b7;font-size:.9em}