@deppon/deppon-template 2.3.4 → 2.3.6

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.
@@ -12,12 +12,22 @@
12
12
  row-gap: 8px;
13
13
  }
14
14
  .field-tag-input .tag-input-input-row .tag-input-input-wrap {
15
- display: inline-flex;
15
+ display: flex;
16
16
  align-items: stretch;
17
- min-width: 240px;
17
+ flex: 1 1 360px;
18
+ width: 100%;
19
+ max-width: 100%;
20
+ min-width: 0;
18
21
  }
19
22
  .field-tag-input .tag-input-input-row .tag-input-input-wrap .tag-input-input {
20
- width: 200px;
23
+ width: 100%;
24
+ min-width: 0;
25
+ }
26
+ .field-tag-input .tag-input-input-row .tag-input-input-wrap .tag-input-input .el-input,
27
+ .field-tag-input .tag-input-input-row .tag-input-input-wrap .tag-input-input .el-input-group,
28
+ .field-tag-input .tag-input-input-row .tag-input-input-wrap .tag-input-input .el-input-group--append {
29
+ width: 100%;
30
+ max-width: 100%;
21
31
  }
22
32
  .field-tag-input .tag-input-input-row .tag-input-input-wrap .tag-input-input .el-input-group__append {
23
33
  padding: 0;
@@ -154,7 +154,9 @@ var script = {
154
154
  var trimmed = (value || '').trim();
155
155
  var rules = addRules.value;
156
156
  if (!rules.length) {
157
- if (!trimmed) return '请输入';
157
+ // 未显式配置添加校验规则时,空输入仅拦截,不展示内部错误,
158
+ // 避免与外层 el-form-item 的必填提示重复显示。
159
+ if (!trimmed) return '';
158
160
  return '';
159
161
  }
160
162
  var _iterator = _createForOfIteratorHelper(rules),
@@ -210,31 +212,41 @@ var script = {
210
212
  raw = (_inputValue$value = inputValue.value) !== null && _inputValue$value !== void 0 ? _inputValue$value : '';
211
213
  name = raw.trim();
212
214
  list = _toConsumableArray(tagList.value);
215
+ if (name) {
216
+ _context.next = 2;
217
+ break;
218
+ }
219
+ // 空值不允许加入;未配置 addRules 时静默拦截,避免与外层必填提示重复。
220
+ if (addRules.value.length) {
221
+ addError.value = validateAddInput(raw, list);
222
+ }
223
+ return _context.abrupt("return");
224
+ case 2:
213
225
  err = validateAddInput(raw, list);
214
226
  if (!err) {
215
- _context.next = 2;
227
+ _context.next = 3;
216
228
  break;
217
229
  }
218
230
  addError.value = err;
219
231
  return _context.abrupt("return");
220
- case 2:
232
+ case 3:
221
233
  if (!(list.length >= maxCount.value)) {
222
- _context.next = 3;
234
+ _context.next = 4;
223
235
  break;
224
236
  }
225
237
  addError.value = "\u6700\u591A\u6DFB\u52A0".concat(maxCount.value, "\u4E2A");
226
238
  return _context.abrupt("return");
227
- case 3:
239
+ case 4:
228
240
  onAdd = (_props$fieldProps1 = props.fieldProps) === null || _props$fieldProps1 === void 0 ? void 0 : _props$fieldProps1.onAdd;
229
241
  if (!(typeof onAdd === 'function')) {
230
- _context.next = 9;
242
+ _context.next = 10;
231
243
  break;
232
244
  }
233
245
  addLoading.value = true;
234
- _context.prev = 4;
235
- _context.next = 5;
246
+ _context.prev = 5;
247
+ _context.next = 6;
236
248
  return Promise.resolve(onAdd(name, list));
237
- case 5:
249
+ case 6:
238
250
  result = _context.sent;
239
251
  if (Array.isArray(result)) {
240
252
  emit('update:text', result);
@@ -254,18 +266,18 @@ var script = {
254
266
  return (_inputRef$value2 = inputRef.value) === null || _inputRef$value2 === void 0 || (_inputRef$value2$focu = _inputRef$value2.focus) === null || _inputRef$value2$focu === void 0 ? void 0 : _inputRef$value2$focu.call(_inputRef$value2);
255
267
  });
256
268
  }
257
- _context.next = 7;
269
+ _context.next = 8;
258
270
  break;
259
- case 6:
260
- _context.prev = 6;
261
- _context["catch"](4);
262
271
  case 7:
263
272
  _context.prev = 7;
264
- addLoading.value = false;
265
- return _context.finish(7);
273
+ _context["catch"](5);
266
274
  case 8:
267
- return _context.abrupt("return");
275
+ _context.prev = 8;
276
+ addLoading.value = false;
277
+ return _context.finish(8);
268
278
  case 9:
279
+ return _context.abrupt("return");
280
+ case 10:
269
281
  list.push(name);
270
282
  emit('update:text', list);
271
283
  inputValue.value = '';
@@ -274,11 +286,11 @@ var script = {
274
286
  var _inputRef$value3, _inputRef$value3$focu;
275
287
  return (_inputRef$value3 = inputRef.value) === null || _inputRef$value3 === void 0 || (_inputRef$value3$focu = _inputRef$value3.focus) === null || _inputRef$value3$focu === void 0 ? void 0 : _inputRef$value3$focu.call(_inputRef$value3);
276
288
  });
277
- case 10:
289
+ case 11:
278
290
  case "end":
279
291
  return _context.stop();
280
292
  }
281
- }, _callee, null, [[4, 6, 7, 8]]);
293
+ }, _callee, null, [[5, 7, 8, 9]]);
282
294
  }));
283
295
  return _addItem.apply(this, arguments);
284
296
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deppon/deppon-template",
3
- "version": "2.3.4",
3
+ "version": "2.3.6",
4
4
  "main": "es/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "es/index.d.ts",
@@ -43,11 +43,11 @@
43
43
  "less": "^4.2.0"
44
44
  },
45
45
  "dependencies": {
46
- "@deppon/deppon-assets": "2.3.4",
47
- "@deppon/deppon-request": "2.3.4",
48
- "@deppon/deppon-router": "2.3.4",
49
- "@deppon/deppon-ui": "2.3.4",
50
- "@deppon/deppon-utils": "2.3.4",
46
+ "@deppon/deppon-assets": "2.3.6",
47
+ "@deppon/deppon-request": "2.3.6",
48
+ "@deppon/deppon-router": "2.3.6",
49
+ "@deppon/deppon-ui": "2.3.6",
50
+ "@deppon/deppon-utils": "2.3.6",
51
51
  "dayjs": "^1.11.10",
52
52
  "lodash-es": "^4.17.21",
53
53
  "mitt": "^3.0.1"