@nutui/nutui-react 2.6.11 → 2.6.13

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.
@@ -2,7 +2,7 @@
2
2
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react-dom")) : typeof define === "function" && define.amd ? define(["exports", "react", "react-dom"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.nutui = {}, global2.React, global2.ReactDOM));
3
3
  })(this, function(exports2, React, ReactDOM) {
4
4
  "use strict";/*!
5
- * @nutui/nutui-react v2.6.11 Fri Jun 28 2024 15:18:39 GMT+0800 (China Standard Time)
5
+ * @nutui/nutui-react v2.6.13 Fri Jul 12 2024 13:59:44 GMT+0800 (China Standard Time)
6
6
  * (c) 2023 @jdf2e.
7
7
  * Released under the MIT License.
8
8
  */
@@ -10740,6 +10740,7 @@
10740
10740
  }
10741
10741
  const scrollTop = e2.target.scrollTop;
10742
10742
  let current = Math.floor(scrollTop / avgHeight);
10743
+ if (current < 0) return;
10743
10744
  if (!monthsData[current + 1]) return;
10744
10745
  const nextTop = monthsData[current + 1].scrollTop;
10745
10746
  const nextHeight = monthsData[current + 1].cssHeight;
@@ -16713,8 +16714,7 @@
16713
16714
  setUploadQueue(uploadQueue);
16714
16715
  } else {
16715
16716
  setUploadQueue([]);
16716
- fileList.splice(0, fileList.length);
16717
- setFileList([...fileList]);
16717
+ setFileList([]);
16718
16718
  }
16719
16719
  };
16720
16720
  const clearInputValue = (el) => {
@@ -16827,13 +16827,11 @@
16827
16827
  const reader = new FileReader();
16828
16828
  reader.onload = (event) => {
16829
16829
  fileItem.url = event.target.result;
16830
- fileList.push(fileItem);
16831
- setFileList([...fileList]);
16830
+ setFileList([...fileList, fileItem]);
16832
16831
  };
16833
16832
  reader.readAsDataURL(file);
16834
16833
  } else {
16835
- fileList.push(fileItem);
16836
- setFileList([...fileList]);
16834
+ setFileList([...fileList, fileItem]);
16837
16835
  }
16838
16836
  });
16839
16837
  };
@@ -17403,7 +17401,18 @@
17403
17401
  }
17404
17402
  };
17405
17403
  const Drag = (props) => {
17406
- const { attract, direction, boundary, children, className, style, ...reset } = {
17404
+ const {
17405
+ attract,
17406
+ direction,
17407
+ boundary,
17408
+ onDrag,
17409
+ onDragStart,
17410
+ onDragEnd,
17411
+ children,
17412
+ className,
17413
+ style,
17414
+ ...reset
17415
+ } = {
17407
17416
  ...defaultProps$D,
17408
17417
  ...props
17409
17418
  };
@@ -17434,7 +17443,16 @@
17434
17443
  }
17435
17444
  };
17436
17445
  const bind = useDrag(
17437
- ({ down, last, offset: [x, y] }) => {
17446
+ (state) => {
17447
+ const {
17448
+ down,
17449
+ last,
17450
+ offset: [x, y],
17451
+ first
17452
+ } = state;
17453
+ first && (onDragStart == null ? void 0 : onDragStart());
17454
+ onDrag == null ? void 0 : onDrag({ offset: [x, y] });
17455
+ last && (onDragEnd == null ? void 0 : onDragEnd({ offset: [x, y] }));
17438
17456
  api.start({ x, y, immediate: down });
17439
17457
  if (last) {
17440
17458
  if (direction !== "y" && attract) {
@@ -20969,6 +20987,7 @@
20969
20987
  autoPlay: 3e3,
20970
20988
  defaultValue: 0,
20971
20989
  closeOnContentClick: false,
20990
+ pagination: true,
20972
20991
  indicator: false,
20973
20992
  indicatorColor: "#fff",
20974
20993
  closeIcon: false,
@@ -20988,6 +21007,7 @@
20988
21007
  visible,
20989
21008
  defaultValue,
20990
21009
  indicatorColor,
21010
+ pagination,
20991
21011
  indicator,
20992
21012
  autoPlay,
20993
21013
  closeOnContentClick,
@@ -21149,7 +21169,6 @@
21149
21169
  className: classNames(classPrefix2, className),
21150
21170
  style,
21151
21171
  ref,
21152
- onClick: closeOnImg,
21153
21172
  onTouchStart
21154
21173
  },
21155
21174
  showPop ? /* @__PURE__ */ React.createElement(
@@ -21168,15 +21187,29 @@
21168
21187
  indicator
21169
21188
  },
21170
21189
  (videos && videos.length > 0 ? videos.map((item, index) => {
21171
- return /* @__PURE__ */ React.createElement(SwiperItem, { key: index }, /* @__PURE__ */ React.createElement(Video, { source: item.source, options: item.options }));
21190
+ return /* @__PURE__ */ React.createElement(SwiperItem, { key: index }, /* @__PURE__ */ React.createElement(
21191
+ Video,
21192
+ {
21193
+ source: item.source,
21194
+ options: item.options,
21195
+ onClick: closeOnImg
21196
+ }
21197
+ ));
21172
21198
  }) : []).concat(
21173
21199
  images && images.length > 0 ? images.map((item, index) => {
21174
- return /* @__PURE__ */ React.createElement(SwiperItem, { key: index }, /* @__PURE__ */ React.createElement(Image$1, { src: item.src, draggable: false }));
21200
+ return /* @__PURE__ */ React.createElement(SwiperItem, { key: index }, /* @__PURE__ */ React.createElement(
21201
+ Image$1,
21202
+ {
21203
+ src: item.src,
21204
+ draggable: false,
21205
+ onClick: closeOnImg
21206
+ }
21207
+ ));
21175
21208
  }) : []
21176
21209
  )
21177
21210
  ) : null
21178
21211
  ),
21179
- /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-index` }, active, "/", (images ? images.length : 0) + (videos ? videos.length : 0)),
21212
+ pagination ? /* @__PURE__ */ React.createElement("div", { className: `${classPrefix2}-index` }, active, "/", (images ? images.length : 0) + (videos ? videos.length : 0)) : null,
21180
21213
  closeIcon !== false ? /* @__PURE__ */ React.createElement(
21181
21214
  "div",
21182
21215
  {
@@ -11,6 +11,7 @@
11
11
  user-select: none;
12
12
  overflow: hidden;
13
13
  background: $tabs-titles-background-color;
14
+ scrollbar-width: none;
14
15
 
15
16
  &::-webkit-scrollbar {
16
17
  display: none;