@nutui/nutui-react 1.3.6 → 1.3.7

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # v1.3.7
2
+ `2022-10-19`
3
+ * :sparkles: feat: 优化 menu 组件的弹出动画效果 (#341) @oasis-cloud
4
+ * :sparkles: chore: add issue template (#334) @oasis-cloud
5
+ * :bug: fix: feat: Audio 组件 Demo 变量名修改 (#340) @libin0824
6
+ * :bug: fix: Collapse 改变变量的名字 (#336) @zhenyulei
7
+
1
8
  # v1.3.6
2
9
  `2022-10-12`
3
10
  * :sparkles: feat: Swipe 组件适配小程序,Searchbar 增加 onCancel 回调函数 (#311) @Ymm0008
package/dist/esm/Menu.js CHANGED
@@ -41,7 +41,6 @@ var Menu = function Menu(props) {
41
41
  var onScroll = function onScroll() {
42
42
  var scrollFixed = props.scrollFixed;
43
43
  var scrollTop = getScrollTop(window);
44
- console.log(scrollTop);
45
44
  var isFixed = scrollTop > (typeof scrollFixed === 'boolean' ? 30 : Number(scrollFixed));
46
45
  setIsScrollFixed(isFixed);
47
46
  };
@@ -96,12 +95,13 @@ var Menu = function Menu(props) {
96
95
  });
97
96
  });
98
97
  };
99
- console.log('isScrollFixed', isScrollFixed);
100
98
  return React__default.createElement("div", _objectSpread(_objectSpread({
101
99
  className: "nut-menu ".concat(className, " ").concat(isScrollFixed ? 'scroll-fixed' : '')
102
100
  }, rest), {}, {
103
101
  ref: parentRef
104
102
  }), React__default.createElement("div", {
103
+ className: "nut-menu-relative"
104
+ }, React__default.createElement("div", {
105
105
  className: "nut-menu__bar ".concat(itemShow.includes(true) ? 'opened' : '', " ").concat(className)
106
106
  }, React__default.Children.toArray(children).map(function (child, index) {
107
107
  if (!child) return null;
@@ -146,7 +146,7 @@ var Menu = function Menu(props) {
146
146
  size: "10",
147
147
  name: titleIcon || (direction === 'up' ? 'arrow-up' : 'down-arrow')
148
148
  })));
149
- })), cloneChildren());
149
+ })), cloneChildren()));
150
150
  };
151
151
  Menu.defaultProps = defaultProps;
152
152
  Menu.displayName = 'NutMenu';
@@ -87,7 +87,6 @@ var MenuItem = function MenuItem(props) {
87
87
  setTimeout(function () {
88
88
  var p = parent.parent().current;
89
89
  var rect = p.getBoundingClientRect();
90
- console.log(rect, p.offsetTop, window.screenTop);
91
90
  setPosition({
92
91
  height: rect.height,
93
92
  top: rect.top
@@ -137,12 +136,12 @@ var MenuItem = function MenuItem(props) {
137
136
  parent.closeOnClickOverlay && parent.toggleItemShow(orderKey);
138
137
  }
139
138
  }), React__default.createElement("div", {
140
- className: "nut-menu-item__wrap",
141
- style: _objectSpread(_objectSpread({}, getPosition()), isShow())
139
+ className: direction === 'down' ? 'nut-menu-item__wrap' : 'nut-menu-item__wrap-up',
140
+ style: _objectSpread({}, isShow())
142
141
  }, React__default.createElement(CSSTransition, {
143
142
  "in": _showPopup,
144
143
  timeout: 100,
145
- classNames: "menu-item"
144
+ classNames: direction === 'down' ? 'menu-item' : 'menu-item-up'
146
145
  }, React__default.createElement("div", {
147
146
  className: "nut-menu-item__content"
148
147
  }, options === null || options === void 0 ? void 0 : options.map(function (item, index) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v1.3.6 Wed Oct 12 2022 18:07:13 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v1.3.7 Wed Oct 19 2022 16:55:35 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v1.3.6 Wed Oct 12 2022 18:07:13 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v1.3.7 Wed Oct 19 2022 16:55:35 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v1.3.6 Wed Oct 12 2022 18:07:13 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v1.3.7 Wed Oct 19 2022 16:55:35 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v1.3.6 Wed Oct 12 2022 18:07:13 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v1.3.7 Wed Oct 19 2022 16:55:35 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v1.3.6 Wed Oct 12 2022 18:07:13 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v1.3.7 Wed Oct 19 2022 16:55:35 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v1.3.6 Wed Oct 12 2022 18:06:20 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v1.3.7 Wed Oct 19 2022 16:54:53 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -9054,7 +9054,6 @@ const Menu = (props) => {
9054
9054
  const onScroll = () => {
9055
9055
  const { scrollFixed: scrollFixed2 } = props;
9056
9056
  const scrollTop = getScrollTop(window);
9057
- console.log(scrollTop);
9058
9057
  const isFixed = scrollTop > (typeof scrollFixed2 === "boolean" ? 30 : Number(scrollFixed2));
9059
9058
  setIsScrollFixed(isFixed);
9060
9059
  };
@@ -9099,11 +9098,12 @@ const Menu = (props) => {
9099
9098
  });
9100
9099
  });
9101
9100
  };
9102
- console.log("isScrollFixed", isScrollFixed);
9103
9101
  return /* @__PURE__ */ React__default.createElement("div", {
9104
9102
  className: `nut-menu ${className} ${isScrollFixed ? "scroll-fixed" : ""}`,
9105
9103
  ...rest,
9106
9104
  ref: parentRef
9105
+ }, /* @__PURE__ */ React__default.createElement("div", {
9106
+ className: "nut-menu-relative"
9107
9107
  }, /* @__PURE__ */ React__default.createElement("div", {
9108
9108
  className: `nut-menu__bar ${itemShow.includes(true) ? "opened" : ""} ${className}`
9109
9109
  }, React__default.Children.toArray(children).map((child, index) => {
@@ -9146,7 +9146,7 @@ const Menu = (props) => {
9146
9146
  size: "10",
9147
9147
  name: titleIcon || (direction === "up" ? "arrow-up" : "down-arrow")
9148
9148
  })));
9149
- })), cloneChildren());
9149
+ })), cloneChildren()));
9150
9150
  };
9151
9151
  Menu.defaultProps = defaultProps$_;
9152
9152
  Menu.displayName = "NutMenu";
@@ -9219,7 +9219,6 @@ const MenuItem = (props) => {
9219
9219
  setTimeout(() => {
9220
9220
  const p2 = parent.parent().current;
9221
9221
  const rect = p2.getBoundingClientRect();
9222
- console.log(rect, p2.offsetTop, window.screenTop);
9223
9222
  setPosition({
9224
9223
  height: rect.height,
9225
9224
  top: rect.top
@@ -9265,15 +9264,14 @@ const MenuItem = (props) => {
9265
9264
  parent.closeOnClickOverlay && parent.toggleItemShow(orderKey);
9266
9265
  }
9267
9266
  }), /* @__PURE__ */ React__default.createElement("div", {
9268
- className: "nut-menu-item__wrap",
9267
+ className: direction === "down" ? "nut-menu-item__wrap" : "nut-menu-item__wrap-up",
9269
9268
  style: {
9270
- ...getPosition(),
9271
9269
  ...isShow()
9272
9270
  }
9273
9271
  }, /* @__PURE__ */ React__default.createElement(CSSTransition$1, {
9274
9272
  in: _showPopup,
9275
9273
  timeout: 100,
9276
- classNames: "menu-item"
9274
+ classNames: direction === "down" ? "menu-item" : "menu-item-up"
9277
9275
  }, /* @__PURE__ */ React__default.createElement("div", {
9278
9276
  className: "nut-menu-item__content"
9279
9277
  }, options2 == null ? void 0 : options2.map((item, index) => {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v1.3.6 Wed Oct 12 2022 18:06:20 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v1.3.7 Wed Oct 19 2022 16:54:53 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -9081,7 +9081,6 @@
9081
9081
  const onScroll = () => {
9082
9082
  const { scrollFixed: scrollFixed2 } = props;
9083
9083
  const scrollTop = getScrollTop(window);
9084
- console.log(scrollTop);
9085
9084
  const isFixed = scrollTop > (typeof scrollFixed2 === "boolean" ? 30 : Number(scrollFixed2));
9086
9085
  setIsScrollFixed(isFixed);
9087
9086
  };
@@ -9126,11 +9125,12 @@
9126
9125
  });
9127
9126
  });
9128
9127
  };
9129
- console.log("isScrollFixed", isScrollFixed);
9130
9128
  return /* @__PURE__ */ React__default["default"].createElement("div", {
9131
9129
  className: `nut-menu ${className} ${isScrollFixed ? "scroll-fixed" : ""}`,
9132
9130
  ...rest,
9133
9131
  ref: parentRef
9132
+ }, /* @__PURE__ */ React__default["default"].createElement("div", {
9133
+ className: "nut-menu-relative"
9134
9134
  }, /* @__PURE__ */ React__default["default"].createElement("div", {
9135
9135
  className: `nut-menu__bar ${itemShow.includes(true) ? "opened" : ""} ${className}`
9136
9136
  }, React__default["default"].Children.toArray(children).map((child, index) => {
@@ -9173,7 +9173,7 @@
9173
9173
  size: "10",
9174
9174
  name: titleIcon || (direction === "up" ? "arrow-up" : "down-arrow")
9175
9175
  })));
9176
- })), cloneChildren());
9176
+ })), cloneChildren()));
9177
9177
  };
9178
9178
  Menu.defaultProps = defaultProps$_;
9179
9179
  Menu.displayName = "NutMenu";
@@ -9246,7 +9246,6 @@
9246
9246
  setTimeout(() => {
9247
9247
  const p2 = parent.parent().current;
9248
9248
  const rect = p2.getBoundingClientRect();
9249
- console.log(rect, p2.offsetTop, window.screenTop);
9250
9249
  setPosition({
9251
9250
  height: rect.height,
9252
9251
  top: rect.top
@@ -9292,15 +9291,14 @@
9292
9291
  parent.closeOnClickOverlay && parent.toggleItemShow(orderKey);
9293
9292
  }
9294
9293
  }), /* @__PURE__ */ React__default["default"].createElement("div", {
9295
- className: "nut-menu-item__wrap",
9294
+ className: direction === "down" ? "nut-menu-item__wrap" : "nut-menu-item__wrap-up",
9296
9295
  style: {
9297
- ...getPosition(),
9298
9296
  ...isShow()
9299
9297
  }
9300
9298
  }, /* @__PURE__ */ React__default["default"].createElement(CSSTransition$1, {
9301
9299
  in: _showPopup,
9302
9300
  timeout: 100,
9303
- classNames: "menu-item"
9301
+ classNames: direction === "down" ? "menu-item" : "menu-item-up"
9304
9302
  }, /* @__PURE__ */ React__default["default"].createElement("div", {
9305
9303
  className: "nut-menu-item__content"
9306
9304
  }, options2 == null ? void 0 : options2.map((item, index) => {
@@ -20,6 +20,10 @@
20
20
  width: 100%;
21
21
  }
22
22
 
23
+ .nut-menu-relative {
24
+ position: relative;
25
+ }
26
+
23
27
  .nut-menu__bar {
24
28
  position: relative;
25
29
  display: flex;
@@ -40,12 +40,16 @@
40
40
  }
41
41
  }
42
42
 
43
- .nut-menu-item__wrap {
44
- position: fixed;
43
+ .nut-menu-item__wrap,
44
+ .nut-menu-item__wrap-up {
45
+ position: absolute;
45
46
  width: 100%;
46
47
  z-index: 2052;
47
48
  overflow: hidden;
48
49
  }
50
+ .nut-menu-item__wrap-up {
51
+ bottom: $menu-bar-line-height;
52
+ }
49
53
 
50
54
  .overlay-fade-enter-active.nut-menu__overlay {
51
55
  top: auto;
@@ -72,10 +76,12 @@
72
76
 
73
77
  .menu-item-enter {
74
78
  opacity: 0;
79
+ transform: translate(0, -30px);
75
80
  }
76
81
 
77
82
  .menu-item-enter-done {
78
83
  opacity: 1;
84
+ transform: translate(0, 0);
79
85
  transition: all 100ms;
80
86
  }
81
87
 
@@ -88,3 +94,22 @@
88
94
  opacity: 0;
89
95
  transition: all 100ms;
90
96
  }
97
+
98
+ .menu-item-up-enter {
99
+ opacity: 0;
100
+ transform: translate(0, 30px);
101
+ }
102
+ .menu-item-up-enter-done {
103
+ opacity: 1;
104
+ transform: translate(0, 0);
105
+ transition: all 100ms;
106
+ }
107
+ .menu-item-up-exit {
108
+ opacity: 1;
109
+ transition: all 100ms;
110
+ }
111
+
112
+ .menu-item-up-exit-done {
113
+ opacity: 0;
114
+ transition: all 100ms;
115
+ }