@nutui/nutui-react-taro 1.3.0 → 1.3.1-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.
Files changed (157) hide show
  1. package/dist/esm/Address.js +4 -4
  2. package/dist/esm/Audio/style/index.js +4 -0
  3. package/dist/esm/Audio.js +18 -0
  4. package/dist/esm/AvatarGroup.js +4 -4
  5. package/dist/esm/Calendar/style/index.js +1 -2
  6. package/dist/esm/Calendar.js +6 -5
  7. package/dist/esm/CalendarItem.js +5 -5
  8. package/dist/esm/Cascader/style/index.js +2 -0
  9. package/dist/esm/Cascader.js +14 -0
  10. package/dist/esm/ConfigProvider.js +3 -3
  11. package/dist/esm/CountDown.js +4 -4
  12. package/dist/esm/DatePicker.js +4 -4
  13. package/dist/esm/Dialog.js +4 -4
  14. package/dist/esm/Empty.js +4 -4
  15. package/dist/esm/FixedNav.js +4 -4
  16. package/dist/esm/Grid/style/index.js +2 -0
  17. package/dist/esm/Grid.js +7 -0
  18. package/dist/esm/GridItem/style/index.js +2 -0
  19. package/dist/esm/GridItem.js +8 -0
  20. package/dist/esm/ImagePreview/style/index.js +2 -0
  21. package/dist/esm/ImagePreview.js +15 -0
  22. package/dist/esm/Infiniteloading.js +4 -4
  23. package/dist/esm/Input.js +4 -4
  24. package/dist/esm/Menu/style/index.js +3 -0
  25. package/dist/esm/Menu.js +7 -0
  26. package/dist/esm/MenuItem/style/index.js +3 -0
  27. package/dist/esm/MenuItem.js +11 -0
  28. package/dist/esm/NoticeBar.js +3 -2
  29. package/dist/esm/{Notification-dccc7625.js → Notification-422905bd.js} +2 -1
  30. package/dist/esm/Notify.js +3 -2
  31. package/dist/esm/NumberKeyboard.js +4 -4
  32. package/dist/esm/Pagination.js +4 -4
  33. package/dist/esm/Picker.js +4 -4
  34. package/dist/esm/Popover.js +3 -2
  35. package/dist/esm/Range.js +7 -5
  36. package/dist/esm/SearchBar.js +4 -4
  37. package/dist/esm/ShortPassword.js +4 -4
  38. package/dist/esm/SideNavBar.js +4 -4
  39. package/dist/esm/Signature.js +4 -4
  40. package/dist/esm/Swipe/style/index.js +2 -0
  41. package/dist/esm/Swipe.js +7 -0
  42. package/dist/esm/Swiper.js +3 -2
  43. package/dist/esm/Table.js +4 -4
  44. package/dist/esm/TextArea.js +4 -4
  45. package/dist/esm/TimeDetail.js +4 -4
  46. package/dist/esm/TimePannel.js +4 -4
  47. package/dist/esm/TimeSelect.js +4 -4
  48. package/dist/esm/Toast.js +4 -3
  49. package/dist/esm/Uploader.js +4 -4
  50. package/dist/esm/VirtualList.js +4 -4
  51. package/dist/esm/{address.taro-a1092e30.js → address.taro-4765a826.js} +17 -6
  52. package/dist/esm/audio.taro-cd6cc93b.js +292 -0
  53. package/dist/esm/{avatargroup-65173caa.js → avatargroup-1ca79066.js} +1 -1
  54. package/dist/esm/calendar.taro-1abb1925.js +89 -0
  55. package/dist/esm/{calendaritem.taro-fe84d94b.js → calendaritem.taro-3c06a809.js} +130 -5
  56. package/dist/esm/cascader.taro-31dbc60e.js +786 -0
  57. package/dist/esm/{configprovider-18657611.js → configprovider-9c393a29.js} +1 -1
  58. package/dist/esm/{configprovider.taro-98343012.js → configprovider.taro-1ff7f150.js} +2 -2
  59. package/dist/esm/{countdown.taro-cd6a1bd4.js → countdown.taro-b00d0d46.js} +1 -1
  60. package/dist/esm/{datepicker.taro-c1249537.js → datepicker.taro-e385849d.js} +1 -1
  61. package/dist/esm/{dialog.taro-5b850861.js → dialog.taro-c80b7b5f.js} +12 -18
  62. package/dist/esm/{empty.taro-6f86eda5.js → empty.taro-20b8adac.js} +1 -1
  63. package/dist/esm/{fixednav.taro-ca94fd6a.js → fixednav.taro-75e35339.js} +1 -1
  64. package/dist/esm/grid.taro-7fb43d02.js +90 -0
  65. package/dist/esm/griditem.taro-8020b409.js +98 -0
  66. package/dist/esm/imagepreview.taro-a0ddd8a2.js +813 -0
  67. package/dist/esm/{infiniteloading.taro-d2c0ca14.js → infiniteloading.taro-0a86819e.js} +1 -1
  68. package/dist/esm/{input.taro-2e31ebbb.js → input.taro-1d23861d.js} +1 -1
  69. package/dist/esm/menu.taro-03e3b011.js +153 -0
  70. package/dist/esm/menuitem.taro-56bf3205.js +195 -0
  71. package/dist/esm/{noticebar.taro-ae593896.js → noticebar.taro-1890c693.js} +3 -2
  72. package/dist/esm/{notify.taro-95b5f97e.js → notify.taro-22b8f4cd.js} +2 -1
  73. package/dist/esm/{numberkeyboard.taro-71b2e0eb.js → numberkeyboard.taro-5d685c76.js} +1 -1
  74. package/dist/esm/nutui-react.es.js +45 -36
  75. package/dist/esm/{pagination.taro-abc4a71e.js → pagination.taro-10449c4a.js} +1 -1
  76. package/dist/esm/{picker.taro-0eb8bfa3.js → picker.taro-216cc3cb.js} +1 -1
  77. package/dist/esm/{popover.taro-4c102df6.js → popover.taro-9b3da0fa.js} +17 -71
  78. package/dist/esm/{range.taro-034fcf7a.js → range.taro-fe08c5f4.js} +118 -110
  79. package/dist/esm/render-4a3856cb.js +32 -0
  80. package/dist/esm/{searchbar.taro-4c6091cb.js → searchbar.taro-450d2f88.js} +1 -1
  81. package/dist/esm/{shortpassword.taro-ce46b9cd.js → shortpassword.taro-08a05360.js} +23 -18
  82. package/dist/esm/{sidenavbar.taro-36f1e118.js → sidenavbar.taro-dd471476.js} +1 -1
  83. package/dist/esm/{signature.taro-45aedfa9.js → signature.taro-7cb77bab.js} +1 -1
  84. package/dist/esm/swipe.taro-dfb9a049.js +264 -0
  85. package/dist/esm/{swiper.taro-59bf2777.js → swiper.taro-7a2ef124.js} +2 -1
  86. package/dist/esm/{table.taro-49009dfc.js → table.taro-305e0317.js} +1 -1
  87. package/dist/esm/{textarea.taro-0c40e966.js → textarea.taro-700b04c2.js} +1 -1
  88. package/dist/esm/{timedetail.taro-0e31b4a5.js → timedetail.taro-7cc00243.js} +1 -1
  89. package/dist/esm/{timepannel.taro-2d54b3db.js → timepannel.taro-e24537e4.js} +1 -1
  90. package/dist/esm/{timeselect.taro-c35d3490.js → timeselect.taro-210fd548.js} +1 -1
  91. package/dist/esm/{toast.taro-48539c09.js → toast.taro-bb181833.js} +1 -1
  92. package/dist/esm/{uploader.taro-ece83a00.js → uploader.taro-f7528535.js} +1 -1
  93. package/dist/esm/useClientRect-8b7cc406.js +74 -0
  94. package/dist/esm/{virtuallist.taro-2ff1a5ad.js → virtuallist.taro-ce9619f9.js} +1 -1
  95. package/dist/esm/{zh-CN-f5124686.js → zh-CN-91090ae2.js} +16 -0
  96. package/dist/locales/base.d.ts +16 -0
  97. package/dist/locales/base.js +1 -1
  98. package/dist/locales/en-US.js +17 -1
  99. package/dist/locales/id-ID.js +17 -1
  100. package/dist/locales/zh-CN.js +17 -1
  101. package/dist/locales/zh-TW.js +17 -1
  102. package/dist/nutui.react.es.js +5595 -4062
  103. package/dist/nutui.react.umd.js +20243 -30
  104. package/dist/packages/audio/audio.scss +80 -0
  105. package/dist/packages/calendar/calendar.scss +57 -36
  106. package/dist/packages/calendaritem/calendaritem.scss +0 -191
  107. package/dist/packages/cascader/cascader.scss +69 -0
  108. package/dist/packages/grid/grid.scss +10 -0
  109. package/dist/packages/griditem/griditem.scss +103 -0
  110. package/dist/packages/imagepreview/imagepreview.scss +51 -0
  111. package/dist/packages/menu/menu.scss +72 -0
  112. package/dist/packages/menuitem/menuitem.scss +90 -0
  113. package/dist/packages/popup/popup.scss +1 -1
  114. package/dist/packages/searchbar/searchbar.scss +1 -0
  115. package/dist/packages/shortpassword/shortpassword.scss +6 -1
  116. package/dist/packages/swipe/swipe.scss +33 -0
  117. package/dist/packages/textarea/textarea.scss +16 -1
  118. package/dist/style.css +1 -1
  119. package/dist/style.es.js +1 -1
  120. package/dist/styles/font/iconfont.js +20 -18
  121. package/dist/styles/themes/default.scss +8 -0
  122. package/dist/styles/variables.scss +59 -8
  123. package/dist/types/audio/audio.taro.d.ts +18 -0
  124. package/dist/types/audio/index.taro.d.ts +2 -0
  125. package/dist/types/cascader/cascader.taro.d.ts +25 -0
  126. package/dist/types/cascader/cascaderItem.taro.d.ts +25 -0
  127. package/dist/types/cascader/index.taro.d.ts +2 -0
  128. package/dist/types/checkbox/checkbox.taro.d.ts +2 -2
  129. package/dist/types/checkboxgroup/checkboxgroup.taro.d.ts +2 -2
  130. package/dist/types/dialog/dialog.taro.d.ts +2 -1
  131. package/dist/types/grid/grid.taro.d.ts +16 -0
  132. package/dist/types/grid/index.taro.d.ts +2 -0
  133. package/dist/types/griditem/griditem.taro.d.ts +20 -0
  134. package/dist/types/griditem/index.taro.d.ts +2 -0
  135. package/dist/types/icon/icon.taro.d.ts +1 -2
  136. package/dist/types/imagepreview/imagepreview.taro.d.ts +26 -0
  137. package/dist/types/imagepreview/index.taro.d.ts +2 -0
  138. package/dist/types/menu/index.taro.d.ts +2 -0
  139. package/dist/types/menu/menu.taro.d.ts +12 -0
  140. package/dist/types/menuitem/index.taro.d.ts +2 -0
  141. package/dist/types/menuitem/menuitem.taro.d.ts +23 -0
  142. package/dist/types/notify/notify.taro.d.ts +13 -0
  143. package/dist/types/nutui.react.d.ts +95 -1
  144. package/dist/types/picker/picker.taro.d.ts +2 -2
  145. package/dist/types/popup/popup.taro.d.ts +1 -1
  146. package/dist/types/shortpassword/shortpassword.taro.d.ts +3 -3
  147. package/dist/types/sidenavbar/sidenavbar.taro.d.ts +14 -2
  148. package/dist/types/sidenavbaritem/sidenavbaritem.taro.d.ts +10 -2
  149. package/dist/types/subsidenavbar/subsidenavbar.taro.d.ts +13 -3
  150. package/dist/types/swipe/index.taro.d.ts +2 -0
  151. package/dist/types/swipe/swipe.taro.d.ts +41 -0
  152. package/dist/types/table/table.taro.d.ts +2 -1
  153. package/dist/types/toast/toast.taro.d.ts +18 -0
  154. package/dist/types/virtuallist/virtuallist.taro.d.ts +2 -1
  155. package/package.json +4 -4
  156. package/dist/esm/calendar.taro-4b2103c1.js +0 -621
  157. package/dist/esm/raf-3fbb5f92.js +0 -126
@@ -11,7 +11,7 @@ import React__default, { useState, useRef, useEffect } from 'react';
11
11
  import classNames from 'classnames';
12
12
  import { c as cn } from './bem-893ad28d.js';
13
13
  import { I as Icon } from './icon-8dc4de10.js';
14
- import { u as useConfig } from './configprovider-18657611.js';
14
+ import { u as useConfig } from './configprovider-9c393a29.js';
15
15
  var defaultProps = {
16
16
  hasMore: true,
17
17
  threshold: 200,
@@ -9,7 +9,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
9
9
 
10
10
  import React__default, { useState, useRef, useLayoutEffect, useEffect, useCallback } from 'react';
11
11
  import { I as Icon } from './icon-8dc4de10.js';
12
- import { u as useConfig } from './configprovider-18657611.js';
12
+ import { u as useConfig } from './configprovider-9c393a29.js';
13
13
 
14
14
  function trimExtraChar(value, _char, regExp) {
15
15
  var index = value.indexOf(_char);
@@ -0,0 +1,153 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
+ var _excluded = ["className", "titleIcon", "scrollFixed", "lockScroll", "closeOnClickOverlay", "children", "activeColor"];
6
+
7
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8
+
9
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
+
11
+ import React__default, { useRef, useEffect, useState } from 'react';
12
+ import classNames from 'classnames';
13
+ import { I as Icon } from './icon.taro-1d0d4fb7.js';
14
+ var defaultProps = {
15
+ className: '',
16
+ style: {},
17
+ activeColor: '#F2270C',
18
+ closeOnClickOverlay: true,
19
+ scrollFixed: false,
20
+ lockScroll: true,
21
+ titleIcon: ''
22
+ };
23
+
24
+ var Menu = function Menu(props) {
25
+ var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
26
+ className = _defaultProps$props.className,
27
+ titleIcon = _defaultProps$props.titleIcon,
28
+ scrollFixed = _defaultProps$props.scrollFixed,
29
+ lockScroll = _defaultProps$props.lockScroll,
30
+ closeOnClickOverlay = _defaultProps$props.closeOnClickOverlay,
31
+ children = _defaultProps$props.children,
32
+ activeColor = _defaultProps$props.activeColor,
33
+ rest = _objectWithoutProperties(_defaultProps$props, _excluded);
34
+
35
+ var parentRef = useRef(null);
36
+
37
+ var onScroll = function onScroll() {};
38
+
39
+ useEffect(function () {
40
+ if (scrollFixed) {
41
+ window.addEventListener('scroll', onScroll);
42
+ }
43
+
44
+ return function () {
45
+ return window.removeEventListener('scroll', onScroll);
46
+ };
47
+ }, []);
48
+
49
+ var _useState = useState([]),
50
+ _useState2 = _slicedToArray(_useState, 2),
51
+ itemShow = _useState2[0],
52
+ setItemShow = _useState2[1];
53
+
54
+ var _useState3 = useState([]),
55
+ _useState4 = _slicedToArray(_useState3, 2),
56
+ itemTitle = _useState4[0],
57
+ setItemTitle = _useState4[1];
58
+
59
+ var toggleItemShow = function toggleItemShow(index) {
60
+ itemShow[index] = !itemShow[index];
61
+ var temp = itemShow.map(function (i, idx) {
62
+ return idx === index ? i : false;
63
+ });
64
+ setItemShow(_toConsumableArray(temp));
65
+ };
66
+
67
+ var hideItemShow = function hideItemShow(index) {
68
+ itemShow[index] = false;
69
+ setItemShow(_toConsumableArray(itemShow));
70
+ };
71
+
72
+ var updateTitle = function updateTitle(text, index) {
73
+ itemTitle[index] = text;
74
+ setItemTitle(_toConsumableArray(itemTitle));
75
+ };
76
+
77
+ var parent = function parent() {
78
+ return parentRef;
79
+ };
80
+
81
+ var cloneChildren = function cloneChildren() {
82
+ return React__default.Children.map(children, function (child, index) {
83
+ return React__default.cloneElement(child, {
84
+ showPopup: itemShow[index],
85
+ orderKey: index,
86
+ activeColor: activeColor,
87
+ parent: {
88
+ closeOnClickOverlay: closeOnClickOverlay,
89
+ lockScroll: lockScroll,
90
+ toggleItemShow: toggleItemShow,
91
+ updateTitle: updateTitle,
92
+ hideItemShow: hideItemShow,
93
+ parent: parent
94
+ }
95
+ });
96
+ });
97
+ };
98
+
99
+ return React__default.createElement("div", _objectSpread(_objectSpread({
100
+ className: "nut-menu ".concat(className)
101
+ }, rest), {}, {
102
+ ref: parentRef
103
+ }), React__default.createElement("div", {
104
+ className: "nut-menu__bar ".concat(itemShow.includes(true) ? 'opened' : '', " ").concat(className)
105
+ }, React__default.Children.toArray(children).map(function (child, index) {
106
+ if (!child) return null;
107
+ var _child$props = child.props,
108
+ disabled = _child$props.disabled,
109
+ title = _child$props.title,
110
+ value = _child$props.value,
111
+ direction = _child$props.direction,
112
+ options = _child$props.options;
113
+ var currentTitle = options === null || options === void 0 ? void 0 : options.filter(function (option) {
114
+ return option.value === value;
115
+ });
116
+
117
+ function finallyTitle() {
118
+ if (title) return title;
119
+ if (itemTitle && itemTitle[index]) return itemTitle[index];
120
+ if (currentTitle && currentTitle[0] && currentTitle[0].text) return currentTitle[0].text;
121
+ return '';
122
+ }
123
+
124
+ return React__default.createElement("div", {
125
+ className: "nut-menu__item ".concat(classNames({
126
+ active: itemShow[index],
127
+ disabled: disabled
128
+ })),
129
+ style: {
130
+ color: itemShow[index] ? activeColor : ''
131
+ },
132
+ key: index,
133
+ onClick: function onClick() {
134
+ !disabled && toggleItemShow(index);
135
+ }
136
+ }, React__default.createElement("div", {
137
+ className: "nut-menu__title ".concat(classNames({
138
+ active: itemShow[index],
139
+ disabled: disabled
140
+ }))
141
+ }, React__default.createElement("div", {
142
+ className: "nut-menu__title-text"
143
+ }, finallyTitle()), React__default.createElement(Icon, {
144
+ className: "nut-menu__title-icon",
145
+ size: "10",
146
+ name: titleIcon || (direction === 'up' ? 'arrow-up' : 'down-arrow')
147
+ })));
148
+ })), cloneChildren());
149
+ };
150
+
151
+ Menu.defaultProps = defaultProps;
152
+ Menu.displayName = 'NutMenu';
153
+ export { Menu as M };
@@ -0,0 +1,195 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+
4
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
+
6
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
+
8
+ import React__default, { useState, useEffect } from 'react';
9
+ import classNames from 'classnames';
10
+ import { CSSTransition } from 'react-transition-group';
11
+ import { u as useConfig } from './configprovider-9c393a29.js';
12
+ import { I as Icon } from './icon.taro-1d0d4fb7.js';
13
+ import { O as Overlay } from './overlay.taro-a784329e.js';
14
+ var defaultProps = {
15
+ className: '',
16
+ style: {},
17
+ columns: 1,
18
+ direction: 'down',
19
+ optionsIcon: 'Check',
20
+ activeTitleClass: '',
21
+ inactiveTitleClass: '',
22
+ iconClassPrefix: 'nut-icon',
23
+ fontClassName: 'nutui-iconfont',
24
+ onChange: function onChange(value) {
25
+ return undefined;
26
+ }
27
+ };
28
+
29
+ var MenuItem = function MenuItem(props) {
30
+ useConfig();
31
+
32
+ var mergedProps = _objectSpread(_objectSpread({}, defaultProps), props);
33
+
34
+ var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
35
+ className = _defaultProps$props.className,
36
+ style = _defaultProps$props.style,
37
+ options = _defaultProps$props.options,
38
+ value = _defaultProps$props.value,
39
+ columns = _defaultProps$props.columns,
40
+ title = _defaultProps$props.title,
41
+ iconClassPrefix = _defaultProps$props.iconClassPrefix,
42
+ fontClassName = _defaultProps$props.fontClassName,
43
+ optionsIcon = _defaultProps$props.optionsIcon,
44
+ direction = _defaultProps$props.direction,
45
+ onChange = _defaultProps$props.onChange,
46
+ activeTitleClass = _defaultProps$props.activeTitleClass,
47
+ inactiveTitleClass = _defaultProps$props.inactiveTitleClass,
48
+ children = _defaultProps$props.children;
49
+
50
+ var activeColor = mergedProps.activeColor,
51
+ showPopup = mergedProps.showPopup,
52
+ parent = mergedProps.parent,
53
+ orderKey = mergedProps.orderKey;
54
+
55
+ var _useState = useState(showPopup),
56
+ _useState2 = _slicedToArray(_useState, 2),
57
+ _showPopup = _useState2[0],
58
+ setShowPopup = _useState2[1];
59
+
60
+ var _useState3 = useState(value),
61
+ _useState4 = _slicedToArray(_useState3, 2),
62
+ _value = _useState4[0],
63
+ setValue = _useState4[1];
64
+
65
+ useEffect(function () {
66
+ setShowPopup(showPopup);
67
+ }, [showPopup]);
68
+ useEffect(function () {
69
+ getParentOffset();
70
+ }, [_showPopup]);
71
+
72
+ var getIconCName = function getIconCName(optionVal, value) {
73
+ var _classNames;
74
+
75
+ return classNames((_classNames = {}, _defineProperty(_classNames, activeTitleClass, optionVal === value), _defineProperty(_classNames, inactiveTitleClass, optionVal !== value), _classNames));
76
+ };
77
+
78
+ var setTitle = function setTitle(text) {
79
+ if (!title) {
80
+ parent.updateTitle(text, orderKey);
81
+ }
82
+ };
83
+
84
+ var handleClick = function handleClick(item) {
85
+ parent.toggleItemShow(orderKey);
86
+ setTitle(item.text);
87
+ setValue(item.value);
88
+ onChange && onChange(item);
89
+ };
90
+
91
+ var _useState5 = useState({
92
+ top: 0,
93
+ height: 0
94
+ }),
95
+ _useState6 = _slicedToArray(_useState5, 2),
96
+ position = _useState6[0],
97
+ setPosition = _useState6[1];
98
+
99
+ var getParentOffset = function getParentOffset() {
100
+ setTimeout(function () {
101
+ var p = parent.parent().current;
102
+ var rect = p.getBoundingClientRect();
103
+ console.log(rect, p.offsetTop, window.screenTop);
104
+ setPosition({
105
+ height: rect.height,
106
+ top: rect.top
107
+ });
108
+ });
109
+ };
110
+
111
+ var isShow = function isShow() {
112
+ if (_showPopup) return {};
113
+ return {
114
+ display: 'none'
115
+ };
116
+ };
117
+
118
+ var getPosition = function getPosition() {
119
+ return direction === 'down' ? {
120
+ top: "".concat(position.top + position.height, "px")
121
+ } : {
122
+ bottom: "".concat(window.innerHeight - position.top, "px"),
123
+ top: 'auto'
124
+ };
125
+ };
126
+
127
+ var placeholderStyle = function placeholderStyle() {
128
+ if (direction === 'down') {
129
+ return _objectSpread(_objectSpread({
130
+ height: "".concat(position.top + position.height, "px")
131
+ }, isShow()), style);
132
+ }
133
+
134
+ return _objectSpread(_objectSpread({
135
+ height: "".concat(window.innerHeight - position.top, "px"),
136
+ top: 'auto'
137
+ }, isShow()), style);
138
+ };
139
+
140
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
141
+ className: "placeholder-element ".concat(classNames({
142
+ up: direction === 'up'
143
+ }), " ").concat(className),
144
+ style: placeholderStyle(),
145
+ onClick: function onClick() {
146
+ return parent.toggleItemShow(orderKey);
147
+ }
148
+ }), React__default.createElement(Overlay, {
149
+ overlayClass: "nut-menu__overlay",
150
+ style: getPosition(),
151
+ lockScroll: parent.lockScroll,
152
+ visible: _showPopup,
153
+ closeOnClickOverlay: parent.closeOnClickOverlay,
154
+ onClick: function onClick() {
155
+ parent.closeOnClickOverlay && parent.toggleItemShow(orderKey);
156
+ }
157
+ }), React__default.createElement("div", {
158
+ className: "nut-menu-item__wrap",
159
+ style: _objectSpread(_objectSpread({}, getPosition()), isShow())
160
+ }, React__default.createElement(CSSTransition, {
161
+ "in": _showPopup,
162
+ timeout: 100,
163
+ classNames: "menu-item"
164
+ }, React__default.createElement("div", {
165
+ className: "nut-menu-item__content"
166
+ }, options === null || options === void 0 ? void 0 : options.map(function (item, index) {
167
+ return React__default.createElement("div", {
168
+ className: "nut-menu-item__option ".concat(classNames({
169
+ active: item.value === _value
170
+ })),
171
+ key: item.text,
172
+ style: {
173
+ flexBasis: "".concat(100 / columns, "%")
174
+ },
175
+ onClick: function onClick() {
176
+ handleClick(item);
177
+ }
178
+ }, item.value === _value ? React__default.createElement(Icon, {
179
+ className: getIconCName(item.value, value),
180
+ name: optionsIcon,
181
+ classPrefix: iconClassPrefix,
182
+ fontClassName: fontClassName,
183
+ color: activeColor
184
+ }) : null, React__default.createElement("div", {
185
+ className: getIconCName(item.value, value),
186
+ style: {
187
+ color: "".concat(item.value === _value ? activeColor : '')
188
+ }
189
+ }, item.text));
190
+ }), children))));
191
+ };
192
+
193
+ MenuItem.defaultProps = defaultProps;
194
+ MenuItem.displayName = 'NutMenuItem';
195
+ export { MenuItem as M };
@@ -11,6 +11,7 @@ import React__default, { useRef, useState, useEffect } from 'react';
11
11
  import classNames from 'classnames';
12
12
  import { I as Icon } from './icon-8dc4de10.js';
13
13
  import { c as cn } from './bem-893ad28d.js';
14
+ import { g as getRectByTaro } from './useClientRect-8b7cc406.js';
14
15
  var defaultProps = {
15
16
  // 滚动方向 across 横向 vertical 纵向
16
17
  direction: 'across',
@@ -177,12 +178,12 @@ var NoticeBar = function NoticeBar(props) {
177
178
 
178
179
  case 2:
179
180
  _context.next = 4;
180
- return wrap.current.getBoundingClientRect();
181
+ return getRectByTaro(wrap.current);
181
182
 
182
183
  case 4:
183
184
  warpRes = _context.sent;
184
185
  _context.next = 7;
185
- return content.current.getBoundingClientRect();
186
+ return getRectByTaro(content.current);
186
187
 
187
188
  case 7:
188
189
  contentRes = _context.sent;
@@ -19,6 +19,7 @@ import * as ReactDOM from 'react-dom';
19
19
  import classNames from 'classnames';
20
20
  import { CSSTransition } from 'react-transition-group';
21
21
  import { c as cn } from './bem-893ad28d.js';
22
+ import { r as render } from './render-4a3856cb.js';
22
23
 
23
24
  var Notification = /*#__PURE__*/function (_React$PureComponent) {
24
25
  _inherits(Notification, _React$PureComponent);
@@ -164,7 +165,7 @@ Notification.newInstance = function (properties, callback) {
164
165
  });
165
166
  }
166
167
 
167
- ReactDOM.render(React.createElement(Notification, _objectSpread(_objectSpread({}, properties), {}, {
168
+ render(React.createElement(Notification, _objectSpread(_objectSpread({}, properties), {}, {
168
169
  ref: ref
169
170
  })), element);
170
171
  };
@@ -10,7 +10,7 @@ import React__default, { useState, useEffect } from 'react';
10
10
  import classNames from 'classnames';
11
11
  import { c as cn } from './bem-893ad28d.js';
12
12
  import { P as Popup } from './popup-67173ec6.js';
13
- import { u as useConfig } from './configprovider-18657611.js';
13
+ import { u as useConfig } from './configprovider-9c393a29.js';
14
14
  var defaultProps = {
15
15
  confirmText: '',
16
16
  title: '',
@@ -4,77 +4,85 @@ export { C as CellGroup } from './cellgroup.taro-8c87bf08.js';
4
4
  export { I as Icon } from './icon.taro-1d0d4fb7.js';
5
5
  export { O as Overlay } from './overlay.taro-a784329e.js';
6
6
  export { P as Popup } from './popup.taro-a89dd3a1.js';
7
- export { C as ConfigProvider } from './configprovider.taro-98343012.js';
7
+ export { C as ConfigProvider } from './configprovider.taro-1ff7f150.js';
8
8
  export { L as Layout } from './layout.taro-358f014f.js';
9
9
  export { C as Col } from './col.taro-2a437387.js';
10
10
  export { R as Row } from './row.taro-cec13a7e.js';
11
11
  export { D as Divider } from './divider.taro-5236fe6a.js';
12
+ export { G as Grid } from './grid.taro-7fb43d02.js';
13
+ export { G as GridItem } from './griditem.taro-8020b409.js';
12
14
  export { N as NavBar } from './navbar.taro-f2eae6a6.js';
13
- export { F as FixedNav } from './fixednav.taro-ca94fd6a.js';
15
+ export { F as FixedNav } from './fixednav.taro-75e35339.js';
14
16
  export { T as Tabbar } from './tabbar.taro-da72fa2c.js';
15
17
  export { T as TabbarItem } from './tabbaritem.taro-a88d3ae7.js';
16
18
  export { E as Elevator } from './elevator.taro-15b0d8c2.js';
17
- export { P as Pagination } from './pagination.taro-abc4a71e.js';
19
+ export { P as Pagination } from './pagination.taro-10449c4a.js';
18
20
  export { T as Tabs } from './tabs.taro-d1e85ea5.js';
19
21
  export { T as TabPane } from './tabpane.taro-95aa185b.js';
20
22
  export { I as Indicator } from './indicator.taro-183ea169.js';
21
- export { S as SideNavBar } from './sidenavbar.taro-36f1e118.js';
23
+ export { S as SideNavBar } from './sidenavbar.taro-dd471476.js';
22
24
  export { S as SubSideNavBar } from './subsidenavbar.taro-2c1fcf16.js';
23
25
  export { S as SideNavBarItem } from './sidenavbaritem.taro-77e077f4.js';
24
- export { R as Range } from './range.taro-034fcf7a.js';
25
- export { C as Calendar } from './calendar.taro-4b2103c1.js';
26
+ export { M as Menu } from './menu.taro-03e3b011.js';
27
+ export { M as MenuItem } from './menuitem.taro-56bf3205.js';
28
+ export { R as Range } from './range.taro-fe08c5f4.js';
29
+ export { C as Calendar } from './calendar.taro-1abb1925.js';
26
30
  export { C as Checkbox } from './checkbox.taro-6fbc4b3c.js';
27
31
  export { C as CheckboxGroup } from './checkboxgroup.taro-3d380042.js';
28
- export { D as DatePicker } from './datepicker.taro-c1249537.js';
32
+ export { D as DatePicker } from './datepicker.taro-e385849d.js';
29
33
  export { I as InputNumber } from './inputnumber.taro-75662231.js';
30
- export { I as Input } from './input.taro-2e31ebbb.js';
34
+ export { I as Input } from './input.taro-1d23861d.js';
31
35
  export { R as Radio } from './radio.taro-32cb0172.js';
32
36
  export { R as RadioGroup } from './radiogroup-e698d3df.js';
33
37
  export { R as Rate } from './rate.taro-a0b21714.js';
34
- export { C as CalendarItem } from './calendaritem.taro-fe84d94b.js';
35
- export { P as Picker } from './picker.taro-0eb8bfa3.js';
36
- export { S as ShortPassword } from './shortpassword.taro-ce46b9cd.js';
37
- export { T as TextArea } from './textarea.taro-0c40e966.js';
38
- export { U as Uploader } from './uploader.taro-ece83a00.js';
39
- export { S as SearchBar } from './searchbar.taro-4c6091cb.js';
40
- export { N as NumberKeyboard } from './numberkeyboard.taro-71b2e0eb.js';
38
+ export { C as CalendarItem } from './calendaritem.taro-3c06a809.js';
39
+ export { P as Picker } from './picker.taro-216cc3cb.js';
40
+ export { S as ShortPassword } from './shortpassword.taro-08a05360.js';
41
+ export { T as TextArea } from './textarea.taro-700b04c2.js';
42
+ export { U as Uploader } from './uploader.taro-f7528535.js';
43
+ export { C as Cascader } from './cascader.taro-31dbc60e.js';
44
+ export { S as SearchBar } from './searchbar.taro-450d2f88.js';
45
+ export { N as NumberKeyboard } from './numberkeyboard.taro-5d685c76.js';
41
46
  export { A as ActionSheet } from './actionsheet.taro-f4d407b0.js';
42
47
  export { B as BackTop } from './backtop.taro-0e2e3946.js';
43
48
  export { D as Drag } from './drag.taro-56e8c87a.js';
44
- export { D as Dialog } from './dialog.taro-5b850861.js';
45
- export { I as Infiniteloading } from './infiniteloading.taro-d2c0ca14.js';
46
- export { N as Notify } from './notify.taro-95b5f97e.js';
49
+ export { D as Dialog } from './dialog.taro-c80b7b5f.js';
50
+ export { I as Infiniteloading } from './infiniteloading.taro-0a86819e.js';
51
+ export { N as Notify } from './notify.taro-22b8f4cd.js';
47
52
  export { S as Switch } from './switch.taro-be5eb823.js';
48
- export { T as Toast } from './toast.taro-48539c09.js';
53
+ export { T as Toast } from './toast.taro-bb181833.js';
54
+ export { S as Swipe } from './swipe.taro-dfb9a049.js';
49
55
  export { C as CircleProgress } from './circleprogress.taro-1a38e1c6.js';
50
- export { N as NoticeBar } from './noticebar.taro-ae593896.js';
56
+ export { N as NoticeBar } from './noticebar.taro-1890c693.js';
51
57
  export { S as Steps } from './steps.taro-943f4fbb.js';
52
58
  export { S as Step } from './step-9a048771.js';
53
- export { S as Swiper } from './swiper.taro-59bf2777.js';
59
+ export { S as Swiper } from './swiper.taro-7a2ef124.js';
54
60
  export { S as SwiperItem } from './swiperitem-d00e7513.js';
55
61
  export { A as Avatar } from './avatar.taro-0a0472fd.js';
56
- export { A as AvatarGroup } from './avatargroup-65173caa.js';
62
+ export { A as AvatarGroup } from './avatargroup-1ca79066.js';
57
63
  export { P as Price } from './price.taro-97393d8f.js';
58
64
  export { B as Badge } from './badge.taro-eeac9de8.js';
59
65
  export { T as Tag } from './tag.taro-3bbbb557.js';
60
- export { P as Popover } from './popover.taro-4c102df6.js';
66
+ export { P as Popover } from './popover.taro-9b3da0fa.js';
61
67
  export { S as Skeleton } from './skeleton.taro-5934c7d7.js';
62
- export { C as CountDown } from './countdown.taro-cd6a1bd4.js';
68
+ export { C as CountDown } from './countdown.taro-b00d0d46.js';
63
69
  export { C as Collapse } from './collapse.taro-72e58ba2.js';
64
70
  export { C as CollapseItem } from './collapseitem-5556ec54.js';
65
71
  export { A as AnimatingNumbers } from './animatingnumbers.taro-877baa98.js';
66
- export { E as Empty } from './empty.taro-6f86eda5.js';
67
- export { V as VirtualList } from './virtuallist.taro-2ff1a5ad.js';
68
- export { T as Table } from './table.taro-49009dfc.js';
72
+ export { E as Empty } from './empty.taro-20b8adac.js';
73
+ export { V as VirtualList } from './virtuallist.taro-ce9619f9.js';
74
+ export { T as Table } from './table.taro-305e0317.js';
69
75
  export { V as Video } from './video-c1090c92.js';
70
76
  export { P as Progress } from './progress.taro-dd93ac38.js';
71
- export { A as Address } from './address.taro-a1092e30.js';
77
+ export { A as Audio } from './audio.taro-cd6cc93b.js';
78
+ export { I as ImagePreview } from './imagepreview.taro-a0ddd8a2.js';
79
+ export { A as Address } from './address.taro-4765a826.js';
72
80
  export { B as Barrage } from './barrage.taro-efac8422.js';
73
- export { S as Signature } from './signature.taro-45aedfa9.js';
81
+ export { S as Signature } from './signature.taro-7cb77bab.js';
74
82
  export { C as Card } from './card.taro-0861c7b3.js';
75
- export { T as TimePannel } from './timepannel.taro-2d54b3db.js';
76
- export { T as TimeDetail } from './timedetail.taro-0e31b4a5.js';
77
- export { T as TimeSelect } from './timeselect.taro-c35d3490.js';
83
+ export { T as TimePannel } from './timepannel.taro-e24537e4.js';
84
+ export { T as TimeDetail } from './timedetail.taro-7cc00243.js';
85
+ export { T as TimeSelect } from './timeselect.taro-210fd548.js';
78
86
  import 'react';
79
87
  import './icon-8dc4de10.js';
80
88
  import './bem-893ad28d.js';
@@ -85,14 +93,15 @@ import 'classnames';
85
93
  import 'react-dom';
86
94
  import 'react-transition-group';
87
95
  import './overlay-ed3eb37d.js';
88
- import './zh-CN-f5124686.js';
96
+ import './zh-CN-91090ae2.js';
89
97
  import './UserContext-be8097d2.js';
90
- import './configprovider-18657611.js';
98
+ import './configprovider-9c393a29.js';
91
99
  import './popup-67173ec6.js';
92
100
  import './offsetContext-0e3d04b3.js';
93
101
  import './useTouch-a2ea68c6.js';
94
- import './Notification-dccc7625.js';
95
- import './raf-3fbb5f92.js';
102
+ import './useClientRect-8b7cc406.js';
103
+ import './Notification-422905bd.js';
104
+ import './render-4a3856cb.js';
96
105
  import './pickerSlot-f8e4e542.js';
97
106
  import '@use-gesture/react';
98
107
  import '@react-spring/web';
@@ -8,7 +8,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
8
8
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
9
9
 
10
10
  import React__default, { useState, useEffect } from 'react';
11
- import { u as useConfig } from './configprovider-18657611.js';
11
+ import { u as useConfig } from './configprovider-9c393a29.js';
12
12
  import { c as cn } from './bem-893ad28d.js';
13
13
  var defaultProps = {
14
14
  defaultValue: 1,
@@ -11,7 +11,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
11
11
  import React__default, { useState, useRef, useEffect } from 'react';
12
12
  import { P as Popup } from './popup-67173ec6.js';
13
13
  import { P as PickerSlot } from './pickerSlot-f8e4e542.js';
14
- import { u as useConfig } from './configprovider-18657611.js';
14
+ import { u as useConfig } from './configprovider-9c393a29.js';
15
15
  import { c as cn } from './bem-893ad28d.js';
16
16
 
17
17
  var InternalPicker = function InternalPicker(props, ref) {