@nutui/nutui-react 2.0.20 → 2.0.21

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.
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
9
9
  return value;
10
10
  };
11
11
  /*!
12
- * @nutui/nutui-react v2.0.20 Fri Oct 13 2023 14:00:36 GMT+0800 (China Standard Time)
12
+ * @nutui/nutui-react v2.0.21 Wed Oct 18 2023 17:52:14 GMT+0800 (China Standard Time)
13
13
  * (c) 2023 @jdf2e.
14
14
  * Released under the MIT License.
15
15
  */
@@ -16521,13 +16521,16 @@ Please add \`${key}Action\` when creating your handler.`);
16521
16521
  }
16522
16522
  const validator = new Schema(descriptor);
16523
16523
  try {
16524
- this.errors[name] = [];
16525
16524
  await validator.validate({ [name]: (_a2 = this.store) == null ? void 0 : _a2[name] });
16526
16525
  } catch ({ errors }) {
16527
16526
  if (errors) {
16528
16527
  errs.push(...errors);
16529
16528
  this.errors[name] = errors;
16530
16529
  }
16530
+ } finally {
16531
+ if (!errs || errs.length === 0) {
16532
+ this.errors[name] = [];
16533
+ }
16531
16534
  }
16532
16535
  entity.onStoreChange("validate");
16533
16536
  }
@@ -19233,7 +19236,7 @@ Please add \`${key}Action\` when creating your handler.`);
19233
19236
  style: { objectFit: "fill" },
19234
19237
  src: item.url,
19235
19238
  alt: "",
19236
- onClick: () => handleItemClick(item)
19239
+ onClick: () => handleItemClick(item, index)
19237
19240
  }
19238
19241
  )) : /* @__PURE__ */ React.createElement(React.Fragment, null, previewUrl ? /* @__PURE__ */ React.createElement(
19239
19242
  "img",
@@ -19241,12 +19244,12 @@ Please add \`${key}Action\` when creating your handler.`);
19241
19244
  className: "nut-uploader__preview-img__c",
19242
19245
  src: previewUrl,
19243
19246
  alt: "",
19244
- onClick: () => handleItemClick(item)
19247
+ onClick: () => handleItemClick(item, index)
19245
19248
  }
19246
19249
  ) : /* @__PURE__ */ React.createElement("div", { className: "nut-uploader__preview-img__file" }, /* @__PURE__ */ React.createElement(
19247
19250
  "div",
19248
19251
  {
19249
- onClick: () => handleItemClick(item),
19252
+ onClick: () => handleItemClick(item, index),
19250
19253
  className: "nut-uploader__preview-img__file__name"
19251
19254
  },
19252
19255
  /* @__PURE__ */ React.createElement(x$6, { color: "#808080" }),
@@ -19256,7 +19259,7 @@ Please add \`${key}Action\` when creating your handler.`);
19256
19259
  "div",
19257
19260
  {
19258
19261
  className: `nut-uploader__preview-img__file__name ${item.status}`,
19259
- onClick: () => handleItemClick(item)
19262
+ onClick: () => handleItemClick(item, index)
19260
19263
  },
19261
19264
  /* @__PURE__ */ React.createElement(x$6, null),
19262
19265
  /* @__PURE__ */ React.createElement("span", null, " ", item.name)
@@ -19457,7 +19460,7 @@ Please add \`${key}Action\` when creating your handler.`);
19457
19460
  onSuccess == null ? void 0 : onSuccess({
19458
19461
  responseText,
19459
19462
  option,
19460
- fileList: list
19463
+ files: list
19461
19464
  });
19462
19465
  };
19463
19466
  uploadOption.onFailure = (responseText, option) => {
@@ -19473,7 +19476,7 @@ Please add \`${key}Action\` when creating your handler.`);
19473
19476
  onFailure == null ? void 0 : onFailure({
19474
19477
  responseText,
19475
19478
  option,
19476
- fileList: list
19479
+ files: list
19477
19480
  });
19478
19481
  };
19479
19482
  const task = new Upload(uploadOption);
@@ -19569,8 +19572,8 @@ Please add \`${key}Action\` when creating your handler.`);
19569
19572
  clearInputValue($el);
19570
19573
  }
19571
19574
  };
19572
- const handleItemClick = (file) => {
19573
- onFileItemClick == null ? void 0 : onFileItemClick(file);
19575
+ const handleItemClick = (file, index) => {
19576
+ onFileItemClick == null ? void 0 : onFileItemClick(file, index);
19574
19577
  };
19575
19578
  return /* @__PURE__ */ React.createElement("div", { className: classes, ...restProps }, (children || previewType === "list") && /* @__PURE__ */ React.createElement("div", { className: "nut-uploader__slot" }, children || /* @__PURE__ */ React.createElement(Button, { size: "small", type: "primary" }, "上传文件"), maxCount > fileList.length && /* @__PURE__ */ React.createElement(
19576
19579
  "input",
@@ -45,28 +45,7 @@
45
45
  }
46
46
 
47
47
  &-swiper {
48
- swiper {
49
- width: 100%;
50
- height: 100%;
51
- }
52
-
53
- swiper-item {
54
- display: flex;
55
- align-items: center;
56
- justify-content: center;
57
- height: 100%;
58
-
59
- .nut-image-preview-box {
60
- width: 100%;
61
- }
62
-
63
- .nut-video {
64
- video {
65
- object-fit: contain;
66
- }
67
- }
68
- }
69
-
48
+ .nut-imagepreview-swiper-item,
70
49
  .nut-swiper-item {
71
50
  display: flex;
72
51
  align-items: center;
@@ -49,6 +49,18 @@
49
49
  color: $picker-item-text-color;
50
50
  font-size: $picker-item-text-font-size;
51
51
  z-index: 3;
52
+
53
+ &-jdapp {
54
+ height: $picker-item-height;
55
+ border: 0;
56
+
57
+ &::before,
58
+ &::after {
59
+ border: $picker-item-active-line-border;
60
+ border-left: 0;
61
+ border-right: 0;
62
+ }
63
+ }
52
64
  }
53
65
 
54
66
  &-list {
@@ -210,7 +210,7 @@
210
210
  top: 0;
211
211
  left: 0;
212
212
  background: transparent;
213
- z-index: 1999;
213
+ z-index: 999;
214
214
  }
215
215
 
216
216
  .nut-popover-wrapper {