@nutui/nutui-react-taro 2.0.0-alpha.0 → 2.0.0-alpha.2
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 +35 -627
- package/dist/esm/ActionSheet.js +3 -3
- package/dist/esm/Address.js +4 -4
- package/dist/esm/Animate.js +2 -3
- package/dist/esm/Badge.js +1 -3
- package/dist/esm/Calendar.js +5 -5
- package/dist/esm/Cascader.js +4 -4
- package/dist/esm/Col.js +2 -1
- package/dist/esm/DatePicker.js +5 -5
- package/dist/esm/Divider.js +2 -1
- package/dist/esm/Drag.js +2 -3
- package/dist/esm/Elevator.js +3 -3
- package/dist/esm/ImagePreview.js +5 -5
- package/dist/esm/Menu.js +1 -1
- package/dist/esm/MenuItem.js +3 -4
- package/dist/esm/NavBar.js +1 -4
- package/dist/esm/NumberKeyboard.js +3 -3
- package/dist/esm/Picker.js +4 -4
- package/dist/esm/Popup.js +2 -4
- package/dist/esm/Progress.js +1 -4
- package/dist/esm/Row.js +2 -1
- package/dist/esm/ShortPassword.js +3 -3
- package/dist/esm/SideNavBar.js +3 -8
- package/dist/esm/TimeSelect.js +4 -4
- package/dist/esm/Uploader.js +2 -4
- package/dist/esm/{actionsheet.taro-b76a342e.js → actionsheet.taro-10cc53ee.js} +1 -1
- package/dist/esm/{address.taro-1812caeb.js → address.taro-2f915873.js} +3 -3
- package/dist/esm/{animate.taro-fb7986d6.js → animate.taro-9e65d07a.js} +4 -3
- package/dist/esm/{badge.taro-ae154f41.js → badge.taro-1d5df601.js} +11 -16
- package/dist/esm/{calendar.taro-b6b147ca.js → calendar.taro-099cb4a2.js} +1 -1
- package/dist/esm/{cascader.taro-9c0a1a38.js → cascader.taro-62e764a7.js} +2 -2
- package/dist/esm/{col.taro-53eed3cc.js → col.taro-a99a9171.js} +3 -1
- package/dist/esm/{datepicker.taro-439e2080.js → datepicker.taro-0f2bcf42.js} +1 -1
- package/dist/esm/{divider.taro-6c1657ce.js → divider.taro-67e9f757.js} +2 -0
- package/dist/esm/{drag.taro-79bb8744.js → drag.taro-2d3d9d11.js} +4 -3
- package/dist/esm/{elevator.taro-81a11ecc.js → elevator.taro-588e219b.js} +31 -24
- package/dist/esm/{imagepreview.taro-867ee24a.js → imagepreview.taro-b88fcf41.js} +2 -2
- package/dist/esm/menu.taro-b61442a7.js +111 -0
- package/dist/esm/{menuitem.taro-86a6bb6c.js → menuitem.taro-bca78e07.js} +31 -30
- package/dist/esm/navbar.taro-02c69d66.js +57 -0
- package/dist/esm/{numberkeyboard.taro-81b36e5e.js → numberkeyboard.taro-ed9b2149.js} +2 -2
- package/dist/esm/nutui-react.es.js +26 -26
- package/dist/esm/{picker.taro-5c9030a7.js → picker.taro-5028afcb.js} +1 -1
- package/dist/esm/{popup.taro-124b9bab.js → popup.taro-020bf791.js} +27 -30
- package/dist/esm/progress.taro-1c199fbe.js +40 -0
- package/dist/esm/{row.taro-f64d4a13.js → row.taro-75039d53.js} +5 -3
- package/dist/esm/{shortpassword.taro-9a2c98ad.js → shortpassword.taro-681a33a1.js} +1 -1
- package/dist/esm/{sidenavbar.taro-0265812f.js → sidenavbar.taro-d5c5b331.js} +1 -3
- package/dist/esm/{timeselect.taro-5b047850.js → timeselect.taro-a4b86771.js} +1 -1
- package/dist/esm/{uploader.taro-0cca7e97.js → uploader.taro-17569890.js} +36 -38
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.mjs +795 -892
- package/dist/nutui.react.umd.js +795 -892
- package/dist/packages/audio/audio.scss +2 -15
- package/dist/packages/badge/badge.scss +8 -17
- package/dist/packages/calendar/calendar.scss +0 -30
- package/dist/packages/elevator/elevator.scss +2 -28
- package/dist/packages/menu/menu.scss +44 -55
- package/dist/packages/menuitem/menuitem.scss +16 -26
- package/dist/packages/navbar/navbar.scss +16 -115
- package/dist/packages/popup/popup.scss +0 -16
- package/dist/packages/progress/progress.scss +19 -58
- package/dist/packages/row/row.scss +13 -31
- package/dist/packages/sidenavbar/sidenavbar.scss +0 -19
- package/dist/packages/uploader/uploader.scss +2 -28
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +23 -114
- package/dist/styles/variables.scss +31 -122
- package/dist/types/index.d.ts +43 -78
- package/package.json +1 -1
- package/dist/esm/menu.taro-54951911.js +0 -98
- package/dist/esm/navbar.taro-69f47d51.js +0 -77
- package/dist/esm/progress.taro-24392ef3.js +0 -88
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import React__default, { createContext, useRef, useState, useEffect } from 'react';
|
|
2
2
|
import { nextTick, createSelectorQuery } from '@tarojs/taro';
|
|
3
3
|
import { ScrollView } from '@tarojs/components';
|
|
4
|
-
import
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
5
6
|
|
|
6
7
|
const elevatorContext = createContext({});
|
|
7
8
|
const defaultProps = {
|
|
9
|
+
...ComponentDefaults,
|
|
8
10
|
height: '200px',
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
floorKey: 'title',
|
|
12
|
+
list: [],
|
|
13
|
+
sticky: false,
|
|
12
14
|
spaceHeight: 23,
|
|
13
15
|
titleHeight: 35,
|
|
14
16
|
className: 'weapp-elevator',
|
|
15
17
|
};
|
|
16
18
|
const Elevator = (props) => {
|
|
17
|
-
const { height,
|
|
19
|
+
const { height, floorKey, list, sticky, spaceHeight, titleHeight, className, style, onClickItem, onClickIndex, children, ...rest } = {
|
|
18
20
|
...defaultProps,
|
|
19
21
|
...props,
|
|
20
22
|
};
|
|
21
|
-
const
|
|
23
|
+
const classPrefix = 'nut-elevator';
|
|
22
24
|
const listview = useRef(null);
|
|
23
25
|
const initData = {
|
|
24
26
|
anchorIndex: 0,
|
|
@@ -53,7 +55,7 @@ const Elevator = (props) => {
|
|
|
53
55
|
for (let i = 0; i < state.current.listGroup.length; i++) {
|
|
54
56
|
const query = createSelectorQuery();
|
|
55
57
|
query
|
|
56
|
-
.selectAll(`.${className} .elevator__item__${i}`)
|
|
58
|
+
.selectAll(`.${className} .nut-elevator__item__${i}`)
|
|
57
59
|
.boundingClientRect();
|
|
58
60
|
// eslint-disable-next-line no-loop-func
|
|
59
61
|
query.exec((res) => {
|
|
@@ -148,27 +150,32 @@ const Elevator = (props) => {
|
|
|
148
150
|
});
|
|
149
151
|
}
|
|
150
152
|
}, [listview]);
|
|
151
|
-
return (React__default.createElement("div", { className: `${
|
|
152
|
-
|
|
153
|
-
React__default.createElement("span", { className:
|
|
154
|
-
React__default.createElement("div", { className:
|
|
155
|
-
React__default.createElement(ScrollView, { scrollTop: scrollTop, scrollY: true, type: "list",
|
|
156
|
-
return (React__default.createElement("div", { className: `${
|
|
157
|
-
React__default.createElement("div", { className:
|
|
153
|
+
return (React__default.createElement("div", { className: `${classPrefix} ${className}`, style: style, ...rest },
|
|
154
|
+
sticky && scrollTop > 0 ? (React__default.createElement("div", { className: `${classPrefix}__list__fixed` },
|
|
155
|
+
React__default.createElement("span", { className: `${classPrefix}__list__fixed__title` }, list[currentIndex][floorKey]))) : null,
|
|
156
|
+
React__default.createElement("div", { className: `${classPrefix}__list`, style: { height: Number.isNaN(+height) ? height : `${height}px` } },
|
|
157
|
+
React__default.createElement(ScrollView, { scrollTop: scrollTop, scrollY: true, className: `${classPrefix}__list__inner`, type: "list", ref: listview, onScroll: listViewScroll }, list.map((item, idx) => {
|
|
158
|
+
return (React__default.createElement("div", { className: `${classPrefix}__list__item nut-elevator__item__${idx}`, key: idx },
|
|
159
|
+
React__default.createElement("div", { className: `${classPrefix}__list__item__code` }, item[floorKey]),
|
|
158
160
|
React__default.createElement(React__default.Fragment, null, item.list.map((subitem) => {
|
|
159
|
-
return (React__default.createElement("div", { className:
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
return (React__default.createElement("div", { className: classNames({
|
|
162
|
+
[`${classPrefix}__list__item__name`]: true,
|
|
163
|
+
[`${classPrefix}__list__item__name--highcolor`]: currentData.id === subitem.id &&
|
|
164
|
+
currentKey === item[floorKey],
|
|
165
|
+
}), key: subitem.id, onClick: () => handleClickItem(item[floorKey], subitem) }, children ? (React__default.createElement(React__default.Fragment, null,
|
|
163
166
|
React__default.createElement(elevatorContext.Provider, { value: subitem }, children))) : (subitem.name)));
|
|
164
167
|
}))));
|
|
165
168
|
}))),
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
list.length && scrollStart ? (React__default.createElement("div", { className: classNames({
|
|
170
|
+
[`${classPrefix}__code--current`]: true,
|
|
171
|
+
[`${classPrefix}__code--current--current`]: true,
|
|
172
|
+
}) }, list[codeIndex][floorKey])) : null,
|
|
173
|
+
React__default.createElement("div", { className: `${classPrefix}__bars` },
|
|
174
|
+
React__default.createElement("div", { className: `${classPrefix}__bars__inner`, onTouchStart: (event) => touchStart(event), onTouchMove: (event) => touchMove(event), onTouchEnd: touchEnd, style: { touchAction: 'pan-y' } }, list.map((item, index) => {
|
|
175
|
+
return (React__default.createElement("div", { className: classNames({
|
|
176
|
+
[`${classPrefix}__bars__inner__item`]: true,
|
|
177
|
+
[`${classPrefix}__bars__inner__item--active`]: item[floorKey] === list[currentIndex][floorKey],
|
|
178
|
+
}), "data-index": index, key: index, onClick: () => handleClickIndex(item[floorKey]) }, item[floorKey]));
|
|
172
179
|
})))));
|
|
173
180
|
};
|
|
174
181
|
Elevator.defaultProps = defaultProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default, { useRef, useState, useEffect } from 'react';
|
|
2
|
-
import { P as Popup } from './popup.taro-
|
|
2
|
+
import { P as Popup } from './popup.taro-020bf791.js';
|
|
3
3
|
import { S as Swiper } from './swiper.taro-7a94e211.js';
|
|
4
4
|
import { S as SwiperItem } from './swiperitem-c9e3d0d5.js';
|
|
5
5
|
|
|
@@ -148,7 +148,7 @@ const ImagePreview = (props) => {
|
|
|
148
148
|
onCloseInner();
|
|
149
149
|
}
|
|
150
150
|
};
|
|
151
|
-
return (React__default.createElement(Popup, { visible: showPop,
|
|
151
|
+
return (React__default.createElement(Popup, { visible: showPop, className: "custom-pop", style: { width: '100%' }, onClick: onCloseInner },
|
|
152
152
|
React__default.createElement("div", { className: "nut-imagepreview", ref: nutImagePreview, onClick: closeOnImg, onTouchStart: onTouchStart },
|
|
153
153
|
React__default.createElement(Swiper, { autoPlay: autoplay, className: "nut-imagepreview-swiper", loop: true, isPreventDefault: false, style: { display: showPop ? 'block' : 'none' }, direction: "horizontal", onChange: slideChangeEnd, initPage: initNo && (initNo > maxNo ? maxNo - 1 : initNo - 1), paginationColor: paginationColor, paginationVisible: paginationVisible }, images && images.length > 0
|
|
154
154
|
? images.map((item, index) => {
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import React__default, { useRef, useState, useEffect } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { ArrowUp2, ArrowDown2 } from '@nutui/icons-react-taro';
|
|
4
|
+
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
5
|
+
|
|
6
|
+
const defaultProps = {
|
|
7
|
+
...ComponentDefaults,
|
|
8
|
+
activeColor: '',
|
|
9
|
+
closeOnClickOverlay: true,
|
|
10
|
+
scrollFixed: false,
|
|
11
|
+
lockScroll: true,
|
|
12
|
+
icon: null,
|
|
13
|
+
};
|
|
14
|
+
const Menu = (props) => {
|
|
15
|
+
const { className, icon, scrollFixed, lockScroll, closeOnClickOverlay, children, activeColor, ...rest } = {
|
|
16
|
+
...defaultProps,
|
|
17
|
+
...props,
|
|
18
|
+
};
|
|
19
|
+
const menuRef = useRef(null);
|
|
20
|
+
const [isScrollFixed, setIsScrollFixed] = useState(false);
|
|
21
|
+
const getScrollTop = (el) => {
|
|
22
|
+
return Math.max(0, 'scrollTop' in el ? el.scrollTop : el.pageYOffset);
|
|
23
|
+
};
|
|
24
|
+
const onScroll = () => {
|
|
25
|
+
const { scrollFixed } = props;
|
|
26
|
+
const scrollTop = getScrollTop(window);
|
|
27
|
+
const isFixed = scrollTop > (typeof scrollFixed === 'boolean' ? 30 : Number(scrollFixed));
|
|
28
|
+
setIsScrollFixed(isFixed);
|
|
29
|
+
};
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (scrollFixed) {
|
|
32
|
+
window.addEventListener('scroll', onScroll);
|
|
33
|
+
}
|
|
34
|
+
return () => window.removeEventListener('scroll', onScroll);
|
|
35
|
+
}, []);
|
|
36
|
+
const [showMenuItem, setShowMenuItem] = useState([]);
|
|
37
|
+
const [menuItemTitle, setMenuItemTitle] = useState([]);
|
|
38
|
+
const toggleMenuItem = (index) => {
|
|
39
|
+
showMenuItem[index] = !showMenuItem[index];
|
|
40
|
+
const temp = showMenuItem.map((i, idx) => idx === index ? i : false);
|
|
41
|
+
setShowMenuItem([...temp]);
|
|
42
|
+
};
|
|
43
|
+
const hideMenuItem = (index) => {
|
|
44
|
+
showMenuItem[index] = false;
|
|
45
|
+
setShowMenuItem([...showMenuItem]);
|
|
46
|
+
};
|
|
47
|
+
const updateTitle = (text, index) => {
|
|
48
|
+
menuItemTitle[index] = text;
|
|
49
|
+
setMenuItemTitle([...menuItemTitle]);
|
|
50
|
+
};
|
|
51
|
+
const cloneChildren = () => {
|
|
52
|
+
return React__default.Children.map(children, (child, index) => {
|
|
53
|
+
return React__default.cloneElement(child, {
|
|
54
|
+
show: showMenuItem[index],
|
|
55
|
+
index,
|
|
56
|
+
activeColor,
|
|
57
|
+
parent: {
|
|
58
|
+
closeOnClickOverlay,
|
|
59
|
+
lockScroll,
|
|
60
|
+
toggleMenuItem,
|
|
61
|
+
updateTitle,
|
|
62
|
+
hideMenuItem,
|
|
63
|
+
menuRef,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
const menuTitle = () => {
|
|
69
|
+
return React__default.Children.map(children, (child, index) => {
|
|
70
|
+
if (React__default.isValidElement(child)) {
|
|
71
|
+
const { title, options, value, disabled, direction } = child.props;
|
|
72
|
+
const selected = options?.filter((option) => option.value === value);
|
|
73
|
+
const finallyTitle = () => {
|
|
74
|
+
if (title)
|
|
75
|
+
return title;
|
|
76
|
+
if (menuItemTitle && menuItemTitle[index])
|
|
77
|
+
return menuItemTitle[index];
|
|
78
|
+
if (selected && selected.length && selected[0].text)
|
|
79
|
+
return selected[0].text;
|
|
80
|
+
return '';
|
|
81
|
+
};
|
|
82
|
+
return (React__default.createElement("div", { className: classNames('nut-menu__item ', className, {
|
|
83
|
+
active: showMenuItem[index],
|
|
84
|
+
disabled,
|
|
85
|
+
}), style: { color: showMenuItem[index] ? activeColor : '' }, key: index, onClick: () => {
|
|
86
|
+
!disabled && toggleMenuItem(index);
|
|
87
|
+
} },
|
|
88
|
+
React__default.createElement("div", { className: classNames('nut-menu__title ', {
|
|
89
|
+
active: showMenuItem[index],
|
|
90
|
+
disabled,
|
|
91
|
+
}) },
|
|
92
|
+
React__default.createElement("div", { className: "nut-menu__title-text" }, finallyTitle()),
|
|
93
|
+
icon ||
|
|
94
|
+
(direction === 'up' ? (React__default.createElement(ArrowUp2, { className: "nut-menu__title-icon", size: 10 })) : (React__default.createElement(ArrowDown2, { className: "nut-menu__title-icon", size: 10 }))))));
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
return (React__default.createElement("div", { ...rest, className: classNames(`nut-menu`, className, {
|
|
100
|
+
'scroll-fixed': isScrollFixed,
|
|
101
|
+
}), ref: menuRef },
|
|
102
|
+
React__default.createElement("div", { className: "nut-menu-relative" },
|
|
103
|
+
React__default.createElement("div", { className: classNames('nut-menu__bar', {
|
|
104
|
+
opened: showMenuItem.includes(true),
|
|
105
|
+
}) }, menuTitle()),
|
|
106
|
+
cloneChildren())));
|
|
107
|
+
};
|
|
108
|
+
Menu.defaultProps = defaultProps;
|
|
109
|
+
Menu.displayName = 'NutMenu';
|
|
110
|
+
|
|
111
|
+
export { Menu as M };
|
|
@@ -1,40 +1,37 @@
|
|
|
1
1
|
import React__default, { forwardRef, useState, useEffect, useImperativeHandle } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
+
import { getSystemInfoSync } from '@tarojs/taro';
|
|
3
4
|
import { CSSTransition } from 'react-transition-group';
|
|
4
5
|
import { Check } from '@nutui/icons-react-taro';
|
|
5
|
-
import { u as useConfig } from './configprovider.taro-c8c54556.js';
|
|
6
6
|
import { O as Overlay } from './overlay.taro-ad0d4775.js';
|
|
7
|
+
import { g as getRectByTaro } from './use-client-rect-1f8ed1fe.js';
|
|
7
8
|
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
8
9
|
|
|
9
10
|
const defaultProps = {
|
|
10
11
|
...ComponentDefaults,
|
|
11
|
-
className: '',
|
|
12
|
-
style: {},
|
|
13
12
|
columns: 1,
|
|
14
13
|
direction: 'down',
|
|
15
|
-
|
|
14
|
+
icon: null,
|
|
15
|
+
closeOnClickAway: false,
|
|
16
16
|
activeTitleClass: '',
|
|
17
17
|
inactiveTitleClass: '',
|
|
18
18
|
onChange: (value) => undefined,
|
|
19
19
|
};
|
|
20
20
|
const MenuItem = forwardRef((props, ref) => {
|
|
21
|
-
|
|
22
|
-
const mergedProps = { ...defaultProps, ...props };
|
|
23
|
-
const { style, options, value, columns, title, optionsIcon, direction, onChange, activeTitleClass, inactiveTitleClass, children, } = {
|
|
21
|
+
const { className, style, options, value, columns, title, icon, direction, onChange, activeTitleClass, inactiveTitleClass, closeOnClickAway, children, activeColor, show, parent, index, } = {
|
|
24
22
|
...defaultProps,
|
|
25
23
|
...props,
|
|
26
24
|
};
|
|
27
|
-
const
|
|
28
|
-
const [_showPopup, setShowPopup] = useState(showPopup);
|
|
25
|
+
const [_showPopup, setShowPopup] = useState(show);
|
|
29
26
|
const [_value, setValue] = useState(value);
|
|
30
27
|
useEffect(() => {
|
|
31
|
-
setShowPopup(
|
|
32
|
-
}, [
|
|
28
|
+
setShowPopup(show);
|
|
29
|
+
}, [show]);
|
|
33
30
|
useEffect(() => {
|
|
34
31
|
getParentOffset();
|
|
35
32
|
}, [_showPopup]);
|
|
36
33
|
useImperativeHandle(ref, () => ({
|
|
37
|
-
toggle: parent.
|
|
34
|
+
toggle: parent.toggleMenuItem,
|
|
38
35
|
}));
|
|
39
36
|
const getIconCName = (optionVal, value) => {
|
|
40
37
|
return classNames({
|
|
@@ -44,11 +41,11 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
44
41
|
};
|
|
45
42
|
const setTitle = (text) => {
|
|
46
43
|
if (!title) {
|
|
47
|
-
parent.updateTitle(text,
|
|
44
|
+
parent.updateTitle(text, index);
|
|
48
45
|
}
|
|
49
46
|
};
|
|
50
47
|
const handleClick = (item) => {
|
|
51
|
-
parent.
|
|
48
|
+
parent.toggleMenuItem(index);
|
|
52
49
|
setTitle(item.text);
|
|
53
50
|
setValue(item.value);
|
|
54
51
|
onChange && onChange(item);
|
|
@@ -59,13 +56,13 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
59
56
|
});
|
|
60
57
|
const getParentOffset = () => {
|
|
61
58
|
setTimeout(async () => {
|
|
62
|
-
const p = parent.
|
|
63
|
-
const rect = await p
|
|
59
|
+
const p = parent.menuRef.current;
|
|
60
|
+
const rect = await getRectByTaro(p);
|
|
64
61
|
setPosition({
|
|
65
62
|
height: rect.height,
|
|
66
63
|
top: rect.top,
|
|
67
64
|
});
|
|
68
|
-
});
|
|
65
|
+
}, 100);
|
|
69
66
|
};
|
|
70
67
|
const isShow = () => {
|
|
71
68
|
if (_showPopup)
|
|
@@ -75,34 +72,38 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
75
72
|
const getPosition = () => {
|
|
76
73
|
return direction === 'down'
|
|
77
74
|
? { top: `${position.top + position.height}px` }
|
|
78
|
-
: {
|
|
75
|
+
: {
|
|
76
|
+
bottom: `${getSystemInfoSync().windowHeight - position.top}px`,
|
|
77
|
+
top: 'auto',
|
|
78
|
+
};
|
|
79
79
|
};
|
|
80
80
|
const placeholderStyle = () => {
|
|
81
81
|
if (direction === 'down') {
|
|
82
82
|
return {
|
|
83
83
|
height: `${position.top + position.height}px`,
|
|
84
|
+
top: 0,
|
|
84
85
|
...isShow(),
|
|
85
|
-
...style,
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
return {
|
|
89
|
-
height: `${
|
|
89
|
+
height: `${getSystemInfoSync().windowHeight - position.top}px`,
|
|
90
|
+
bottom: `0px`,
|
|
90
91
|
top: 'auto',
|
|
91
92
|
...isShow(),
|
|
92
|
-
...style,
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
return (React__default.createElement(React__default.Fragment, null,
|
|
96
|
-
React__default.createElement("div", { className: `placeholder-element ${classNames({
|
|
96
|
+
closeOnClickAway ? (React__default.createElement("div", { className: `placeholder-element ${classNames({
|
|
97
97
|
up: direction === 'up',
|
|
98
|
-
})}`, style: placeholderStyle(), onClick: () => parent.
|
|
99
|
-
React__default.createElement(Overlay, { className: "nut-menu__overlay", style: getPosition(), lockScroll: parent.lockScroll, visible: _showPopup, closeOnOverlayClick: parent.
|
|
100
|
-
parent.
|
|
98
|
+
})}`, style: placeholderStyle(), onClick: () => parent.toggleMenuItem(index) })) : null,
|
|
99
|
+
React__default.createElement(Overlay, { className: "nut-menu__overlay", style: getPosition(), lockScroll: parent.lockScroll, visible: _showPopup, closeOnOverlayClick: parent.closeOnOverlayClick, onClick: () => {
|
|
100
|
+
parent.closeOnOverlayClick && parent.toggleMenuItem(index);
|
|
101
101
|
} }),
|
|
102
|
-
React__default.createElement("div", { className:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
React__default.createElement("div", { className: classNames(className, {
|
|
103
|
+
'nut-menu-item__wrap': direction === 'down',
|
|
104
|
+
'nut-menu-item__wrap-up': direction !== 'down',
|
|
105
|
+
}), style: {
|
|
106
|
+
...style,
|
|
106
107
|
...isShow(),
|
|
107
108
|
} },
|
|
108
109
|
React__default.createElement(CSSTransition, { in: _showPopup, timeout: 100, classNames: direction === 'down' ? 'menu-item' : 'menu-item-up' },
|
|
@@ -115,7 +116,7 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
115
116
|
}, onClick: () => {
|
|
116
117
|
handleClick(item);
|
|
117
118
|
} },
|
|
118
|
-
item.value === _value ? (React__default.createElement(React__default.Fragment, null,
|
|
119
|
+
item.value === _value ? (React__default.createElement(React__default.Fragment, null, icon || (React__default.createElement(Check, { color: activeColor, size: 10, className: getIconCName(item.value, value) })))) : null,
|
|
119
120
|
React__default.createElement("div", { className: getIconCName(item.value, value), style: {
|
|
120
121
|
color: `${item.value === _value ? activeColor : ''}`,
|
|
121
122
|
} }, item.text)));
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
4
|
+
|
|
5
|
+
const defaultProps = {
|
|
6
|
+
...ComponentDefaults,
|
|
7
|
+
left: '',
|
|
8
|
+
right: '',
|
|
9
|
+
back: '',
|
|
10
|
+
fixed: false,
|
|
11
|
+
safeAreaInsetTop: false,
|
|
12
|
+
placeholder: false,
|
|
13
|
+
zIndex: 10,
|
|
14
|
+
};
|
|
15
|
+
const NavBar = (props) => {
|
|
16
|
+
const { right, left, className, style, back, fixed, safeAreaInsetTop, placeholder, zIndex, onClickBack, } = {
|
|
17
|
+
...defaultProps,
|
|
18
|
+
...props,
|
|
19
|
+
};
|
|
20
|
+
const classPrefix = 'nut-navbar';
|
|
21
|
+
const children = Array.isArray(props.children)
|
|
22
|
+
? props.children
|
|
23
|
+
: [props.children];
|
|
24
|
+
const styles = () => {
|
|
25
|
+
return {
|
|
26
|
+
...style,
|
|
27
|
+
zIndex,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
const renderLeft = () => {
|
|
31
|
+
return (React__default.createElement("div", { className: `${classPrefix}__left` },
|
|
32
|
+
back && (React__default.createElement("div", { className: `${classPrefix}__left__back`, onClick: (e) => onClickBack(e) }, back)),
|
|
33
|
+
left));
|
|
34
|
+
};
|
|
35
|
+
const renderContent = () => {
|
|
36
|
+
return React__default.createElement("div", { className: `${classPrefix}__title` }, children);
|
|
37
|
+
};
|
|
38
|
+
const renderRight = () => {
|
|
39
|
+
return React__default.createElement("div", { className: `${classPrefix}__right` }, right);
|
|
40
|
+
};
|
|
41
|
+
const renderWrapper = () => {
|
|
42
|
+
return (React__default.createElement("div", { className: cls, style: styles() },
|
|
43
|
+
renderLeft(),
|
|
44
|
+
renderContent(),
|
|
45
|
+
renderRight()));
|
|
46
|
+
};
|
|
47
|
+
const classes = classNames({
|
|
48
|
+
[`${classPrefix}--fixed`]: fixed,
|
|
49
|
+
[`${classPrefix}--safe-area-inset-top`]: safeAreaInsetTop,
|
|
50
|
+
});
|
|
51
|
+
const cls = classNames(classPrefix, classes, className);
|
|
52
|
+
return (React__default.createElement(React__default.Fragment, null, fixed && placeholder ? (React__default.createElement("div", { className: `${classPrefix}--placeholder` }, renderWrapper())) : (renderWrapper())));
|
|
53
|
+
};
|
|
54
|
+
NavBar.defaultProps = defaultProps;
|
|
55
|
+
NavBar.displayName = 'NutNavBar';
|
|
56
|
+
|
|
57
|
+
export { NavBar as N };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useState, useEffect } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { c as cn } from './bem-350c1702.js';
|
|
4
|
-
import { P as Popup } from './popup.taro-
|
|
4
|
+
import { P as Popup } from './popup.taro-020bf791.js';
|
|
5
5
|
import { u as useConfig } from './configprovider.taro-c8c54556.js';
|
|
6
6
|
|
|
7
7
|
const defaultProps = {
|
|
@@ -115,7 +115,7 @@ const NumberKeyboard = (props) => {
|
|
|
115
115
|
setClickKeyIndex(undefined);
|
|
116
116
|
};
|
|
117
117
|
return (React__default.createElement("div", null,
|
|
118
|
-
React__default.createElement(Popup, { visible: show, overlay: overlay, position: "bottom",
|
|
118
|
+
React__default.createElement(Popup, { visible: show, overlay: overlay, position: "bottom", className: popClass, onClickOverlay: onClose, onClickCloseIcon: onClose, overlayStyle: { backgroundColor: 'rgba(0, 0, 0, 0)' } },
|
|
119
119
|
React__default.createElement("div", { className: `${b()} ${className}`, style: { ...style } },
|
|
120
120
|
title ? (React__default.createElement("div", { className: b('header') },
|
|
121
121
|
React__default.createElement("h3", { className: b('header__tit') }, title),
|
|
@@ -4,73 +4,73 @@ export { C as CellGroup } from './cellgroup.taro-6e901b54.js';
|
|
|
4
4
|
export { C as ConfigProvider } from './configprovider.taro-c8c54556.js';
|
|
5
5
|
export { I as Image } from './image.taro-edb572bb.js';
|
|
6
6
|
export { O as Overlay } from './overlay.taro-ad0d4775.js';
|
|
7
|
-
export { P as Popup } from './popup.taro-
|
|
8
|
-
export { C as Col } from './col.taro-
|
|
9
|
-
export { D as Divider } from './divider.taro-
|
|
7
|
+
export { P as Popup } from './popup.taro-020bf791.js';
|
|
8
|
+
export { C as Col } from './col.taro-a99a9171.js';
|
|
9
|
+
export { D as Divider } from './divider.taro-67e9f757.js';
|
|
10
10
|
export { G as Grid } from './grid.taro-3797169c.js';
|
|
11
11
|
export { G as GridItem } from './griditem.taro-04f59ae1.js';
|
|
12
12
|
export { L as Layout } from './layout.taro-9046d093.js';
|
|
13
|
-
export { R as Row } from './row.taro-
|
|
13
|
+
export { R as Row } from './row.taro-75039d53.js';
|
|
14
14
|
export { S as Sticky } from './sticky.taro-b5bde7b1.js';
|
|
15
|
-
export { E as Elevator } from './elevator.taro-
|
|
15
|
+
export { E as Elevator } from './elevator.taro-588e219b.js';
|
|
16
16
|
export { F as FixedNav } from './fixednav.taro-39fbd47a.js';
|
|
17
17
|
export { I as Indicator } from './indicator.taro-c10334e8.js';
|
|
18
|
-
export { M as Menu } from './menu.taro-
|
|
19
|
-
export { M as MenuItem } from './menuitem.taro-
|
|
20
|
-
export { N as NavBar } from './navbar.taro-
|
|
18
|
+
export { M as Menu } from './menu.taro-b61442a7.js';
|
|
19
|
+
export { M as MenuItem } from './menuitem.taro-bca78e07.js';
|
|
20
|
+
export { N as NavBar } from './navbar.taro-02c69d66.js';
|
|
21
21
|
export { P as Pagination } from './pagination.taro-60b22b27.js';
|
|
22
|
-
export { S as SideNavBar } from './sidenavbar.taro-
|
|
22
|
+
export { S as SideNavBar } from './sidenavbar.taro-d5c5b331.js';
|
|
23
23
|
export { S as SideNavBarItem } from './sidenavbaritem.taro-bb80dbf4.js';
|
|
24
24
|
export { S as SubSideNavBar } from './subsidenavbar.taro-3cce8442.js';
|
|
25
25
|
export { T as Tabbar } from './tabbar.taro-9acfc2fa.js';
|
|
26
26
|
export { T as TabbarItem } from './tabbaritem.taro-42ba353f.js';
|
|
27
27
|
export { T as TabPane } from './tabpane.taro-4ca340ef.js';
|
|
28
28
|
export { T as Tabs } from './tabs.taro-be8cacb5.js';
|
|
29
|
-
export { C as Calendar } from './calendar.taro-
|
|
29
|
+
export { C as Calendar } from './calendar.taro-099cb4a2.js';
|
|
30
30
|
export { C as CalendarItem } from './calendaritem.taro-ae167e59.js';
|
|
31
|
-
export { C as Cascader } from './cascader.taro-
|
|
31
|
+
export { C as Cascader } from './cascader.taro-62e764a7.js';
|
|
32
32
|
export { C as Checkbox, a as CheckboxGroup } from './checkbox.taro-785c528b.js';
|
|
33
|
-
export { D as DatePicker } from './datepicker.taro-
|
|
33
|
+
export { D as DatePicker } from './datepicker.taro-0f2bcf42.js';
|
|
34
34
|
export { F as Form } from './form.taro-0d83f1e8.js';
|
|
35
35
|
export { F as FormItem } from './formitem.taro-0de07d1e.js';
|
|
36
36
|
export { I as Input } from './input.taro-10ed5500.js';
|
|
37
37
|
export { I as InputNumber } from './inputnumber.taro-108c4784.js';
|
|
38
|
-
export { N as NumberKeyboard } from './numberkeyboard.taro-
|
|
39
|
-
export { P as Picker } from './picker.taro-
|
|
38
|
+
export { N as NumberKeyboard } from './numberkeyboard.taro-ed9b2149.js';
|
|
39
|
+
export { P as Picker } from './picker.taro-5028afcb.js';
|
|
40
40
|
export { R as Radio, a as RadioGroup } from './radio.taro-51e10152.js';
|
|
41
41
|
export { R as Range } from './range.taro-7a2b6ca1.js';
|
|
42
42
|
export { R as Rate } from './rate.taro-57341aa9.js';
|
|
43
43
|
export { S as SearchBar } from './searchbar.taro-eef468bb.js';
|
|
44
|
-
export { S as ShortPassword } from './shortpassword.taro-
|
|
44
|
+
export { S as ShortPassword } from './shortpassword.taro-681a33a1.js';
|
|
45
45
|
export { T as TextArea } from './textarea.taro-a0f79515.js';
|
|
46
|
-
export { U as Uploader } from './uploader.taro-
|
|
47
|
-
export { A as ActionSheet } from './actionsheet.taro-
|
|
46
|
+
export { U as Uploader } from './uploader.taro-17569890.js';
|
|
47
|
+
export { A as ActionSheet } from './actionsheet.taro-10cc53ee.js';
|
|
48
48
|
export { B as BackTop } from './backtop.taro-ba271b8f.js';
|
|
49
49
|
export { B as Dialog } from './dialog.taro-00ac41fd.js';
|
|
50
|
-
export { D as Drag } from './drag.taro-
|
|
50
|
+
export { D as Drag } from './drag.taro-2d3d9d11.js';
|
|
51
51
|
export { I as Infiniteloading } from './infiniteloading.taro-73c9b8ca.js';
|
|
52
52
|
export { N as Notify } from './notify.taro-e17c6f82.js';
|
|
53
53
|
export { P as PullToRefresh } from './pulltorefresh.taro-d5fcfcb0.js';
|
|
54
54
|
export { S as Swipe } from './swipe.taro-350c9a94.js';
|
|
55
55
|
export { S as Switch } from './switch.taro-34ca8228.js';
|
|
56
56
|
export { T as Toast } from './toast.taro-e4f44812.js';
|
|
57
|
-
export { A as Animate } from './animate.taro-
|
|
57
|
+
export { A as Animate } from './animate.taro-9e65d07a.js';
|
|
58
58
|
export { A as AnimatingNumbers } from './animatingnumbers.taro-03e5d61d.js';
|
|
59
59
|
export { A as Audio } from './audio.taro-f672a68c.js';
|
|
60
60
|
export { A as Avatar } from './avatar.taro-de157a1f.js';
|
|
61
61
|
export { A as AvatarGroup } from './avatargroup-b476ac68.js';
|
|
62
|
-
export { B as Badge } from './badge.taro-
|
|
62
|
+
export { B as Badge } from './badge.taro-1d5df601.js';
|
|
63
63
|
export { C as CircleProgress } from './circleprogress.taro-79854448.js';
|
|
64
64
|
export { C as Collapse } from './collapse.taro-35a8a0d6.js';
|
|
65
65
|
export { C as CollapseItem } from './collapseitem-690eb91c.js';
|
|
66
66
|
export { C as CountDown } from './countdown.taro-0e6bf7a2.js';
|
|
67
67
|
export { E as Ellipsis } from './ellipsis.taro-b6cda065.js';
|
|
68
68
|
export { E as Empty } from './empty.taro-fde835ca.js';
|
|
69
|
-
export { I as ImagePreview } from './imagepreview.taro-
|
|
69
|
+
export { I as ImagePreview } from './imagepreview.taro-b88fcf41.js';
|
|
70
70
|
export { N as NoticeBar } from './noticebar.taro-49e7441f.js';
|
|
71
71
|
export { P as Popover } from './popover.taro-2a57eae4.js';
|
|
72
72
|
export { P as Price } from './price.taro-776ed16e.js';
|
|
73
|
-
export { P as Progress } from './progress.taro-
|
|
73
|
+
export { P as Progress } from './progress.taro-1c199fbe.js';
|
|
74
74
|
export { S as Skeleton } from './skeleton.taro-64e858a2.js';
|
|
75
75
|
export { S as Step } from './step.taro-2ec1f283.js';
|
|
76
76
|
export { S as Steps } from './steps.taro-c82d2252.js';
|
|
@@ -82,13 +82,13 @@ export { T as TrendArrow } from './trendarrow.taro-7cf90def.js';
|
|
|
82
82
|
export { V as Video } from './video-7ed508cc.js';
|
|
83
83
|
export { V as VirtualList } from './virtuallist.taro-35b9bd9a.js';
|
|
84
84
|
export { W as WaterMark } from './watermark.taro-c780d360.js';
|
|
85
|
-
export { A as Address } from './address.taro-
|
|
85
|
+
export { A as Address } from './address.taro-2f915873.js';
|
|
86
86
|
export { B as Barrage } from './barrage.taro-80df08d3.js';
|
|
87
87
|
export { C as Card } from './card.taro-5e9b34c8.js';
|
|
88
88
|
export { S as Signature } from './signature.taro-f01b2b05.js';
|
|
89
89
|
export { T as TimeDetail } from './timedetail.taro-fce4e614.js';
|
|
90
90
|
export { T as TimePannel } from './timepannel.taro-fd3d008d.js';
|
|
91
|
-
export { T as TimeSelect } from './timeselect.taro-
|
|
91
|
+
export { T as TimeSelect } from './timeselect.taro-a4b86771.js';
|
|
92
92
|
import 'react';
|
|
93
93
|
import 'classnames';
|
|
94
94
|
import '@nutui/icons-react-taro';
|
|
@@ -98,8 +98,6 @@ import './zh-CN-b4f493ba.js';
|
|
|
98
98
|
import '@tarojs/components';
|
|
99
99
|
import 'react-dom';
|
|
100
100
|
import 'react-transition-group';
|
|
101
|
-
import './bem-350c1702.js';
|
|
102
|
-
import '@bem-react/classname';
|
|
103
101
|
import './UserContext-0aac9a82.js';
|
|
104
102
|
import '@tarojs/taro';
|
|
105
103
|
import './use-client-rect-1f8ed1fe.js';
|
|
@@ -107,6 +105,8 @@ import './get-scroll-parent-b4a07e65.js';
|
|
|
107
105
|
import './can-use-dom-3eeb5af4.js';
|
|
108
106
|
import './use-props-value-ae7ee726.js';
|
|
109
107
|
import './offsetContext-c2a746fa.js';
|
|
108
|
+
import './bem-350c1702.js';
|
|
109
|
+
import '@bem-react/classname';
|
|
110
110
|
import './use-touch-db24bb5c.js';
|
|
111
111
|
import './supports-passive-c85ef996.js';
|
|
112
112
|
import './index-5bcb0ff8.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useState, useRef, useEffect, useImperativeHandle } from 'react';
|
|
2
2
|
import { View } from '@tarojs/components';
|
|
3
|
-
import { P as Popup } from './popup.taro-
|
|
3
|
+
import { P as Popup } from './popup.taro-020bf791.js';
|
|
4
4
|
import { u as useTouch } from './use-touch-db24bb5c.js';
|
|
5
5
|
import { g as getRectByTaro } from './use-client-rect-1f8ed1fe.js';
|
|
6
6
|
import { p as passiveSupported } from './supports-passive-c85ef996.js';
|