@nutui/nutui-react 2.3.3 → 2.3.4

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/esm/DatePicker.js +1 -3
  3. package/dist/esm/InfiniteLoading/style/style.css +1 -1
  4. package/dist/esm/InfiniteLoading.js +67 -26
  5. package/dist/esm/Popover/style/style.css +1 -1
  6. package/dist/esm/Popover.js +2 -2
  7. package/dist/esm/Tabbar/style/style.css +1 -1
  8. package/dist/esm/TabbarItem/style/style.css +1 -1
  9. package/dist/esm/Tour/style/style.css +1 -1
  10. package/dist/esm/VirtualList.js +3 -1
  11. package/dist/esm/types/src/packages/infiniteloading/infiniteloading.d.ts +2 -2
  12. package/dist/esm/types/src/packages/infiniteloading/infiniteloading.taro.d.ts +2 -2
  13. package/dist/esm/types/src/packages/virtuallist/utils.d.ts +1 -1
  14. package/dist/esm/types/src/packages/virtuallist/virtuallist.taro.d.ts +1 -0
  15. package/dist/locales/base.js +1 -1
  16. package/dist/locales/en-US.js +1 -1
  17. package/dist/locales/id-ID.js +1 -1
  18. package/dist/locales/tr-TR.js +1 -1
  19. package/dist/locales/zh-CN.js +1 -1
  20. package/dist/locales/zh-TW.js +1 -1
  21. package/dist/locales/zh-UG.js +1 -1
  22. package/dist/nutui.react.es.js +25 -24
  23. package/dist/nutui.react.umd.js +25 -24
  24. package/dist/packages/infiniteloading/infiniteloading.scss +2 -6
  25. package/dist/packages/popover/popover.scss +21 -15
  26. package/dist/packages/tabbaritem/tabbaritem.scss +10 -4
  27. package/dist/style.css +1 -1
  28. package/dist/style.mjs +1 -1
  29. package/dist/types/packages/infiniteloading/infiniteloading.d.ts +2 -2
  30. package/dist/types/packages/infiniteloading/infiniteloading.taro.d.ts +2 -2
  31. package/dist/types/packages/virtuallist/utils.d.ts +1 -1
  32. package/dist/types/packages/virtuallist/virtuallist.taro.d.ts +1 -0
  33. package/package.json +1 -1
@@ -8,7 +8,7 @@ var __publicField = (obj, key, value) => {
8
8
  return value;
9
9
  };
10
10
  /*!
11
- * @nutui/nutui-react v2.3.3 Fri Dec 22 2023 17:49:13 GMT+0800 (China Standard Time)
11
+ * @nutui/nutui-react v2.3.4 Fri Dec 29 2023 14:37:01 GMT+0800 (China Standard Time)
12
12
  * (c) 2023 @jdf2e.
13
13
  * Released under the MIT License.
14
14
  */
@@ -14659,9 +14659,7 @@ Please add \`${key}Action\` when creating your handler.`);
14659
14659
  return val || [];
14660
14660
  };
14661
14661
  React.useEffect(() => {
14662
- if (selectedDate) {
14663
- setPickerOptions(columns());
14664
- }
14662
+ setPickerOptions(columns());
14665
14663
  }, [selectedDate, startDate, endDate]);
14666
14664
  return /* @__PURE__ */ React.createElement("div", { className: `nut-datepicker ${className}`, style, ...rest }, pickerOptions.length && /* @__PURE__ */ React.createElement(
14667
14665
  Picker$1,
@@ -19575,7 +19573,7 @@ Please add \`${key}Action\` when creating your handler.`);
19575
19573
  const [isInfiniting, setIsInfiniting] = React.useState(false);
19576
19574
  const scroller = React.useRef(null);
19577
19575
  const refreshTop = React.useRef(null);
19578
- const scrollEl = React.useRef(window);
19576
+ const scrollEl = React.useRef(null);
19579
19577
  const isTouching = React.useRef(false);
19580
19578
  const beforeScrollTop = React.useRef(0);
19581
19579
  const refreshMaxH = React.useRef(0);
@@ -19583,14 +19581,16 @@ Please add \`${key}Action\` when creating your handler.`);
19583
19581
  const distance = React.useRef(0);
19584
19582
  const classes = classNames(classPrefix$d, className);
19585
19583
  React.useEffect(() => {
19584
+ var _a2;
19586
19585
  if (target && document.getElementById(target)) {
19587
19586
  scrollEl.current = document.getElementById(target);
19588
19587
  } else {
19589
19588
  scrollEl.current = window;
19590
19589
  }
19591
- scrollEl.current.addEventListener("scroll", handleScroll, capture);
19590
+ (_a2 = scrollEl.current) == null ? void 0 : _a2.addEventListener("scroll", handleScroll, capture);
19592
19591
  return () => {
19593
- scrollEl.current.removeEventListener("scroll", handleScroll, capture);
19592
+ var _a3;
19593
+ (_a3 = scrollEl.current) == null ? void 0 : _a3.removeEventListener("scroll", handleScroll, capture);
19594
19594
  };
19595
19595
  }, [hasMore, isInfiniting, onLoadMore]);
19596
19596
  React.useEffect(() => {
@@ -19608,15 +19608,13 @@ Please add \`${key}Action\` when creating your handler.`);
19608
19608
  transition: isTouching.current ? `height 0s cubic-bezier(0.25,0.1,0.25,1)` : `height 0.2s cubic-bezier(0.25,0.1,0.25,1)`
19609
19609
  };
19610
19610
  };
19611
- const handleScroll = () => {
19612
- requestAniFrame$1(() => {
19613
- if (!isScrollAtBottom() || !hasMore || isInfiniting) {
19614
- return false;
19615
- }
19616
- setIsInfiniting(true);
19617
- onLoadMore && onLoadMore(infiniteDone);
19618
- return true;
19619
- });
19611
+ const handleScroll = async () => {
19612
+ if (!isScrollAtBottom() || !hasMore || isInfiniting) {
19613
+ return;
19614
+ }
19615
+ setIsInfiniting(true);
19616
+ await (onLoadMore == null ? void 0 : onLoadMore());
19617
+ infiniteDone();
19620
19618
  };
19621
19619
  const infiniteDone = () => {
19622
19620
  setIsInfiniting(false);
@@ -19653,12 +19651,13 @@ Please add \`${key}Action\` when creating your handler.`);
19653
19651
  isTouching.current = false;
19654
19652
  }
19655
19653
  };
19656
- const touchEnd = () => {
19654
+ const touchEnd = async () => {
19657
19655
  if (distance.current < refreshMaxH.current) {
19658
19656
  distance.current = 0;
19659
19657
  getRefreshTop().style.height = `${distance.current}px`;
19660
19658
  } else {
19661
- onRefresh && onRefresh(refreshDone);
19659
+ await (onRefresh == null ? void 0 : onRefresh());
19660
+ refreshDone();
19662
19661
  }
19663
19662
  };
19664
19663
  const getWindowScrollTop = () => {
@@ -19700,9 +19699,9 @@ Please add \`${key}Action\` when creating your handler.`);
19700
19699
  onTouchEnd: touchEnd,
19701
19700
  ...restProps
19702
19701
  },
19703
- /* @__PURE__ */ React.createElement("div", { className: "nut-infinite-top", ref: refreshTop, style: getStyle() }, /* @__PURE__ */ React.createElement("div", { className: "top-box" }, pullingText || locale.infiniteloading.pullRefreshText)),
19702
+ /* @__PURE__ */ React.createElement("div", { className: "nut-infinite-top", ref: refreshTop, style: getStyle() }, /* @__PURE__ */ React.createElement("div", { className: "nut-infinite-top-tips" }, pullingText || locale.infiniteloading.pullRefreshText)),
19704
19703
  /* @__PURE__ */ React.createElement("div", { className: "nut-infinite-container" }, children),
19705
- /* @__PURE__ */ React.createElement("div", { className: "nut-infinite-bottom" }, isInfiniting ? /* @__PURE__ */ React.createElement("div", { className: "bottom-box" }, loadingText || locale.infiniteloading.loadText) : !hasMore && /* @__PURE__ */ React.createElement("div", { className: "bottom-box" }, loadMoreText || locale.infiniteloading.loadMoreText))
19704
+ /* @__PURE__ */ React.createElement("div", { className: "nut-infinite-bottom" }, isInfiniting ? /* @__PURE__ */ React.createElement("div", { className: "nut-infinite-bottom-tips" }, loadingText || locale.infiniteloading.loadText) : !hasMore && /* @__PURE__ */ React.createElement("div", { className: "nut-infinite-bottom-tips" }, loadMoreText || locale.infiniteloading.loadMoreText))
19706
19705
  );
19707
19706
  };
19708
19707
  InfiniteLoading.defaultProps = defaultProps$B;
@@ -20549,10 +20548,10 @@ Please add \`${key}Action\` when creating your handler.`);
20549
20548
  key: item.key || index,
20550
20549
  onClick: () => handleSelect(item, index)
20551
20550
  },
20552
- item.icon ? /* @__PURE__ */ React.createElement("i", { className: "nut-popover-menu-item-icon" }, item.icon) : null,
20551
+ item.icon ? /* @__PURE__ */ React.createElement("div", { className: "nut-popover-menu-item-icon" }, item.icon) : null,
20553
20552
  /* @__PURE__ */ React.createElement("div", { className: "nut-popover-menu-item-name" }, item.name),
20554
20553
  item.action && item.action.icon ? /* @__PURE__ */ React.createElement(
20555
- "i",
20554
+ "div",
20556
20555
  {
20557
20556
  className: "nut-popover-menu-item-action-icon",
20558
20557
  onClick: (e2) => {
@@ -24029,14 +24028,16 @@ Please add \`${key}Action\` when creating your handler.`);
24029
24028
  tempIndex = tempIndex || 0;
24030
24029
  return tempIndex;
24031
24030
  };
24032
- const updateItemSize = (positions, items, sizeKey) => {
24031
+ const updateItemSize = (positions, items, sizeKey, margin) => {
24033
24032
  const newPos = positions.concat();
24034
24033
  Array.from(items).forEach((item) => {
24035
24034
  const index = Number(item.getAttribute("data-index"));
24036
24035
  const styleVal = item.getAttribute("style");
24037
24036
  if (styleVal && styleVal.includes("none"))
24038
24037
  return;
24039
- const nowSize = item.getBoundingClientRect()[sizeKey];
24038
+ let nowSize = item.getBoundingClientRect()[sizeKey];
24039
+ if (margin)
24040
+ nowSize += margin;
24040
24041
  const oldSize = positions[index][sizeKey];
24041
24042
  const dValue = oldSize - nowSize;
24042
24043
  if (dValue) {
@@ -11,7 +11,7 @@
11
11
  font-size: $font-size-small;
12
12
  color: $infiniteloading-color;
13
13
 
14
- .top-box {
14
+ &-tips {
15
15
  width: 100%;
16
16
  display: flex;
17
17
  flex-direction: column;
@@ -21,8 +21,6 @@
21
21
  display: flex;
22
22
  justify-content: center;
23
23
  align-items: center;
24
- width: $pulltorefresh-icon-width;
25
- height: $pulltorefresh-icon-height;
26
24
  margin-bottom: 4px;
27
25
  }
28
26
  }
@@ -38,14 +36,12 @@
38
36
  color: $infiniteloading-color;
39
37
  text-align: center;
40
38
 
41
- .bottom-box {
39
+ &-tips {
42
40
  display: flex;
43
41
  justify-content: center;
44
42
  align-items: center;
45
43
 
46
44
  &-icons {
47
- width: $infiniteloading-icon-size;
48
- height: $infiniteloading-icon-size;
49
45
  margin-right: 8px;
50
46
  }
51
47
  }
@@ -22,21 +22,6 @@
22
22
  border-bottom-color: $popover-border-color;
23
23
  border-top-width: 0;
24
24
  margin-top: -8px;
25
-
26
- &.nut-popover-arrow-bottom {
27
- left: 50%;
28
- transform: translateX(-50%);
29
- }
30
-
31
- &.nut-popover-arrow-bottom-start {
32
- left: 16px;
33
- transform: translateX(0%);
34
- }
35
-
36
- &.nut-popover-arrow-bottom-end {
37
- right: 16px;
38
- transform: translateX(0%);
39
- }
40
25
  }
41
26
 
42
27
  &-left {
@@ -189,10 +174,31 @@
189
174
  }
190
175
  }
191
176
 
177
+ &-bottom {
178
+ .nut-popover-arrow-bottom {
179
+ left: 50%;
180
+ transform: translateX(-50%);
181
+ }
182
+ }
183
+
192
184
  &-bottom-end {
185
+ .nut-popover-arrow-bottom-end {
186
+ right: 16px;
187
+ transform: translateX(0%);
188
+ }
189
+
193
190
  right: 0;
194
191
  }
195
192
 
193
+ &-bottom-start {
194
+ left: 0;
195
+
196
+ .nut-popover-arrow-bottom-start {
197
+ left: 16px;
198
+ transform: translateX(0%);
199
+ }
200
+ }
201
+
196
202
  &-left-end {
197
203
  bottom: 0;
198
204
  }
@@ -10,10 +10,6 @@
10
10
  color: $tabbar-inactive-color;
11
11
  height: 100%;
12
12
 
13
- &-active {
14
- color: $tabbar-active-color;
15
- }
16
-
17
13
  &-icon-box {
18
14
  padding: 0px;
19
15
  display: flex;
@@ -40,4 +36,14 @@
40
36
  font-weight: $tabbar-text-large-font-weight;
41
37
  }
42
38
  }
39
+
40
+ &-active {
41
+ color: $tabbar-active-color;
42
+ .nut-tabbar-item-icon-box {
43
+ color: inherit;
44
+ .nut-icon {
45
+ color: inherit;
46
+ }
47
+ }
48
+ }
43
49
  }