@nutui/nutui-react 2.0.18 → 2.0.19-beta.0

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.18 Wed Sep 20 2023 15:07:55 GMT+0800 (China Standard Time)
12
+ * @nutui/nutui-react v2.0.19-beta.0 Mon Sep 25 2023 18:01:43 GMT+0800 (China Standard Time)
13
13
  * (c) 2023 @jdf2e.
14
14
  * Released under the MIT License.
15
15
  */
@@ -17389,7 +17389,8 @@ Please add \`${key}Action\` when creating your handler.`);
17389
17389
  }, [showPopup]);
17390
17390
  React.useImperativeHandle(ref, () => ({
17391
17391
  toggle: (s) => {
17392
- s ? parent.toggleMenuItem(index) : parent.hideMenuItem(index);
17392
+ const from = "REF";
17393
+ s ? parent.toggleMenuItem(index, from) : parent.hideMenuItem(index, from);
17393
17394
  }
17394
17395
  }));
17395
17396
  const getIconCName = (optionVal, value2) => {
@@ -17476,7 +17477,7 @@ Please add \`${key}Action\` when creating your handler.`);
17476
17477
  visible: showPopup,
17477
17478
  closeOnOverlayClick: parent.closeOnOverlayClick,
17478
17479
  onClick: () => {
17479
- parent.closeOnOverlayClick && parent.toggleMenuItem(index);
17480
+ parent.closeOnOverlayClick && parent.hideMenuItem(index);
17480
17481
  }
17481
17482
  }
17482
17483
  ) : null,
@@ -17547,9 +17548,9 @@ Please add \`${key}Action\` when creating your handler.`);
17547
17548
  lockScroll: true,
17548
17549
  overlay: true,
17549
17550
  icon: null,
17550
- onOpen: (index) => {
17551
+ onOpen: (index, from) => {
17551
17552
  },
17552
- onClose: (index) => {
17553
+ onClose: (index, from) => {
17553
17554
  }
17554
17555
  };
17555
17556
  const Menu = (props) => {
@@ -17588,22 +17589,22 @@ Please add \`${key}Action\` when creating your handler.`);
17588
17589
  }, []);
17589
17590
  const [showMenuItem, setShowMenuItem] = React.useState([]);
17590
17591
  const [menuItemTitle, setMenuItemTitle] = React.useState([]);
17591
- const toggleMenuItem = (index) => {
17592
+ const toggleMenuItem = (index, from = "NORMAL") => {
17592
17593
  showMenuItem[index] = !showMenuItem[index];
17593
17594
  if (showMenuItem[index]) {
17594
- onOpen && onOpen(index);
17595
+ onOpen && onOpen(index, from);
17595
17596
  } else {
17596
- onClose && onClose(index);
17597
+ onClose && onClose(index, from);
17597
17598
  }
17598
17599
  const temp = showMenuItem.map(
17599
17600
  (i, idx) => idx === index ? i : false
17600
17601
  );
17601
17602
  setShowMenuItem([...temp]);
17602
17603
  };
17603
- const hideMenuItem = (index) => {
17604
+ const hideMenuItem = (index, from = "NORMAL") => {
17604
17605
  showMenuItem[index] = false;
17605
17606
  setShowMenuItem([...showMenuItem]);
17606
- onClose && onClose(index);
17607
+ onClose && onClose(index, from);
17607
17608
  };
17608
17609
  const updateTitle = (text, index) => {
17609
17610
  menuItemTitle[index] = text;
@@ -23192,7 +23193,7 @@ Please add \`${key}Action\` when creating your handler.`);
23192
23193
  }
23193
23194
  return childs;
23194
23195
  };
23195
- return /* @__PURE__ */ React.createElement("div", { className: classNames(classes, className), ...rest }, renderElement());
23196
+ return /* @__PURE__ */ React.createElement("div", { className: classNames(classPrefix$2, classes, className), ...rest }, renderElement());
23196
23197
  };
23197
23198
  Indicator.defaultProps = defaultProps$h;
23198
23199
  Indicator.displayName = "NutIndicator";
@@ -23692,7 +23693,9 @@ Please add \`${key}Action\` when creating your handler.`);
23692
23693
  });
23693
23694
  const [showPop, setShowPop] = React.useState(visible);
23694
23695
  const [active, setActive] = React.useState(0);
23695
- const [maxNo] = React.useState((images == null ? void 0 : images.length) || 0 + ((videos == null ? void 0 : videos.length) || 0));
23696
+ const [maxNo, setMaxNo] = React.useState(
23697
+ (images == null ? void 0 : images.length) || 0 + ((videos == null ? void 0 : videos.length) || 0)
23698
+ );
23696
23699
  const [store, setStore] = React.useState({
23697
23700
  scale: 1,
23698
23701
  moveable: false
@@ -23781,6 +23784,9 @@ Please add \`${key}Action\` when creating your handler.`);
23781
23784
  React.useEffect(() => {
23782
23785
  setActive(innerNo);
23783
23786
  }, [innerNo]);
23787
+ React.useEffect(() => {
23788
+ setMaxNo((images == null ? void 0 : images.length) || 0 + ((videos == null ? void 0 : videos.length) || 0));
23789
+ }, [images, videos]);
23784
23790
  const scaleNow = () => {
23785
23791
  if (ref.current) {
23786
23792
  ref.current.style.transform = `scale(${store.scale})`;
@@ -23797,7 +23803,7 @@ Please add \`${key}Action\` when creating your handler.`);
23797
23803
  };
23798
23804
  const onCloseInner = () => {
23799
23805
  setShowPop(false);
23800
- setActive(1);
23806
+ setActive(innerNo);
23801
23807
  scaleNow();
23802
23808
  onClose && onClose();
23803
23809
  setStore({
@@ -14,7 +14,7 @@
14
14
  -webkit-appearance: none;
15
15
  user-select: none;
16
16
  touch-action: manipulation;
17
-
17
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
18
18
  color: $button-default-color;
19
19
  background: $button-default-bg-color;
20
20
  border: $button-border-width solid $button-default-border-color;
@@ -1,4 +1,9 @@
1
1
  .nut-indicator {
2
+ display: flex;
3
+ width: auto;
4
+ flex-wrap: nowrap;
5
+ align-items: center;
6
+
2
7
  &__dot {
3
8
  margin: 0 $indicator-dot-margin;
4
9
 
@@ -19,6 +19,7 @@
19
19
  width: 100%;
20
20
  color: $gray1;
21
21
  flex: 1;
22
+ background-color: transparent;
22
23
  padding: 0;
23
24
  border: 0;
24
25
  outline: 0 none;