@nutui/nutui-react-taro 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
@@ -1,5 +1,5 @@
1
- import { M as Menu } from './menu.taro-9345dcfd.js';
2
- export { M as default } from './menu.taro-9345dcfd.js';
1
+ import { M as Menu } from './menu.taro-f8ca86db.js';
2
+ export { M as default } from './menu.taro-f8ca86db.js';
3
3
  import 'react';
4
4
  import 'classnames';
5
5
  import './icon.taro-1d0d4fb7.js';
@@ -1,5 +1,5 @@
1
- import { M as MenuItem } from './menuitem.taro-fc0961b7.js';
2
- export { M as default } from './menuitem.taro-fc0961b7.js';
1
+ import { M as MenuItem } from './menuitem.taro-7bf564c9.js';
2
+ export { M as default } from './menuitem.taro-7bf564c9.js';
3
3
  import 'react';
4
4
  import 'classnames';
5
5
  import 'react-transition-group';
@@ -88,6 +88,8 @@ var Menu = function Menu(props) {
88
88
  }, rest), {}, {
89
89
  ref: parentRef
90
90
  }), React__default.createElement("div", {
91
+ className: "nut-menu-relative"
92
+ }, React__default.createElement("div", {
91
93
  className: "nut-menu__bar ".concat(itemShow.includes(true) ? 'opened' : '', " ").concat(className)
92
94
  }, React__default.Children.toArray(children).map(function (child, index) {
93
95
  if (!child) return null;
@@ -132,7 +134,7 @@ var Menu = function Menu(props) {
132
134
  size: "10",
133
135
  name: titleIcon || (direction === 'up' ? 'arrow-up' : 'down-arrow')
134
136
  })));
135
- })), cloneChildren());
137
+ })), cloneChildren()));
136
138
  };
137
139
  Menu.defaultProps = defaultProps;
138
140
  Menu.displayName = 'NutMenu';
@@ -150,12 +150,12 @@ var MenuItem = function MenuItem(props) {
150
150
  parent.closeOnClickOverlay && parent.toggleItemShow(orderKey);
151
151
  }
152
152
  }), React__default.createElement("div", {
153
- className: "nut-menu-item__wrap",
154
- style: _objectSpread(_objectSpread({}, getPosition()), isShow())
153
+ className: direction === 'down' ? 'nut-menu-item__wrap' : 'nut-menu-item__wrap-up',
154
+ style: _objectSpread({}, isShow())
155
155
  }, React__default.createElement(CSSTransition, {
156
156
  "in": _showPopup,
157
157
  timeout: 100,
158
- classNames: "menu-item"
158
+ classNames: direction === 'down' ? 'menu-item' : 'menu-item-up'
159
159
  }, React__default.createElement("div", {
160
160
  className: "nut-menu-item__content"
161
161
  }, options === null || options === void 0 ? void 0 : options.map(function (item, index) {
@@ -24,8 +24,8 @@ export { I as Indicator } from './indicator.taro-183ea169.js';
24
24
  export { S as SideNavBar } from './sidenavbar.taro-87f056cd.js';
25
25
  export { S as SubSideNavBar } from './subsidenavbar.taro-2c1fcf16.js';
26
26
  export { S as SideNavBarItem } from './sidenavbaritem.taro-77e077f4.js';
27
- export { M as Menu } from './menu.taro-9345dcfd.js';
28
- export { M as MenuItem } from './menuitem.taro-fc0961b7.js';
27
+ export { M as Menu } from './menu.taro-f8ca86db.js';
28
+ export { M as MenuItem } from './menuitem.taro-7bf564c9.js';
29
29
  export { R as Range } from './range.taro-fc7c0b6a.js';
30
30
  export { C as Calendar } from './calendar.taro-533b3219.js';
31
31
  export { C as Checkbox } from './checkbox.taro-104557c1.js';
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v1.3.6 Wed Oct 12 2022 18:14:47 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.3.7 Wed Oct 19 2022 16:59:53 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-taro v1.3.6 Wed Oct 12 2022 18:14:47 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.3.7 Wed Oct 19 2022 16:59:53 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-taro v1.3.6 Wed Oct 12 2022 18:14:47 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.3.7 Wed Oct 19 2022 16:59:53 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-taro v1.3.6 Wed Oct 12 2022 18:14:47 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.3.7 Wed Oct 19 2022 16:59:53 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-taro v1.3.6 Wed Oct 12 2022 18:14:47 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.3.7 Wed Oct 19 2022 16:59:53 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-taro v1.3.6 Wed Oct 12 2022 18:14:05 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.3.7 Wed Oct 19 2022 16:59:16 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -3938,6 +3938,8 @@ const Menu = (props) => {
3938
3938
  className: `nut-menu ${className}`,
3939
3939
  ...rest,
3940
3940
  ref: parentRef
3941
+ }, /* @__PURE__ */ React__default.createElement("div", {
3942
+ className: "nut-menu-relative"
3941
3943
  }, /* @__PURE__ */ React__default.createElement("div", {
3942
3944
  className: `nut-menu__bar ${itemShow.includes(true) ? "opened" : ""} ${className}`
3943
3945
  }, React__default.Children.toArray(children).map((child, index) => {
@@ -3980,7 +3982,7 @@ const Menu = (props) => {
3980
3982
  size: "10",
3981
3983
  name: titleIcon || (direction === "up" ? "arrow-up" : "down-arrow")
3982
3984
  })));
3983
- })), cloneChildren());
3985
+ })), cloneChildren()));
3984
3986
  };
3985
3987
  Menu.defaultProps = defaultProps$10;
3986
3988
  Menu.displayName = "NutMenu";
@@ -4098,15 +4100,14 @@ const MenuItem = (props) => {
4098
4100
  parent.closeOnClickOverlay && parent.toggleItemShow(orderKey);
4099
4101
  }
4100
4102
  }), /* @__PURE__ */ React__default.createElement("div", {
4101
- className: "nut-menu-item__wrap",
4103
+ className: direction === "down" ? "nut-menu-item__wrap" : "nut-menu-item__wrap-up",
4102
4104
  style: {
4103
- ...getPosition(),
4104
4105
  ...isShow()
4105
4106
  }
4106
4107
  }, /* @__PURE__ */ React__default.createElement(CSSTransition$1, {
4107
4108
  in: _showPopup,
4108
4109
  timeout: 100,
4109
- classNames: "menu-item"
4110
+ classNames: direction === "down" ? "menu-item" : "menu-item-up"
4110
4111
  }, /* @__PURE__ */ React__default.createElement("div", {
4111
4112
  className: "nut-menu-item__content"
4112
4113
  }, options == null ? void 0 : options.map((item, index) => {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v1.3.6 Wed Oct 12 2022 18:14:05 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.3.7 Wed Oct 19 2022 16:59:16 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -3965,6 +3965,8 @@
3965
3965
  className: `nut-menu ${className}`,
3966
3966
  ...rest,
3967
3967
  ref: parentRef
3968
+ }, /* @__PURE__ */ React__default["default"].createElement("div", {
3969
+ className: "nut-menu-relative"
3968
3970
  }, /* @__PURE__ */ React__default["default"].createElement("div", {
3969
3971
  className: `nut-menu__bar ${itemShow.includes(true) ? "opened" : ""} ${className}`
3970
3972
  }, React__default["default"].Children.toArray(children).map((child, index) => {
@@ -4007,7 +4009,7 @@
4007
4009
  size: "10",
4008
4010
  name: titleIcon || (direction === "up" ? "arrow-up" : "down-arrow")
4009
4011
  })));
4010
- })), cloneChildren());
4012
+ })), cloneChildren()));
4011
4013
  };
4012
4014
  Menu.defaultProps = defaultProps$10;
4013
4015
  Menu.displayName = "NutMenu";
@@ -4125,15 +4127,14 @@
4125
4127
  parent.closeOnClickOverlay && parent.toggleItemShow(orderKey);
4126
4128
  }
4127
4129
  }), /* @__PURE__ */ React__default["default"].createElement("div", {
4128
- className: "nut-menu-item__wrap",
4130
+ className: direction === "down" ? "nut-menu-item__wrap" : "nut-menu-item__wrap-up",
4129
4131
  style: {
4130
- ...getPosition(),
4131
4132
  ...isShow()
4132
4133
  }
4133
4134
  }, /* @__PURE__ */ React__default["default"].createElement(CSSTransition$1, {
4134
4135
  in: _showPopup,
4135
4136
  timeout: 100,
4136
- classNames: "menu-item"
4137
+ classNames: direction === "down" ? "menu-item" : "menu-item-up"
4137
4138
  }, /* @__PURE__ */ React__default["default"].createElement("div", {
4138
4139
  className: "nut-menu-item__content"
4139
4140
  }, options == null ? void 0 : options.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
+ }