@nutui/nutui-react-taro 2.0.0-alpha.3 → 2.0.0-alpha.5
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 +24 -0
- package/dist/esm/Address.js +3 -5
- package/dist/esm/Audio.js +3 -4
- package/dist/esm/Avatar.js +6 -5
- package/dist/esm/AvatarGroup.js +3 -7
- package/dist/esm/Calendar.js +3 -4
- package/dist/esm/CalendarItem.js +2 -3
- package/dist/esm/CellGroup.js +1 -1
- package/dist/esm/Checkbox.js +3 -3
- package/dist/esm/CheckboxGroup.js +3 -3
- package/dist/esm/CircleProgress.js +2 -3
- package/dist/esm/ConfigProvider.js +2 -3
- package/dist/esm/CountDown.js +2 -3
- package/dist/esm/DatePicker.js +3 -4
- package/dist/esm/Dialog.js +2 -3
- package/dist/esm/Elevator.js +1 -1
- package/dist/esm/Ellipsis.js +3 -4
- package/dist/esm/Empty.js +3 -5
- package/dist/esm/FixedNav.js +2 -3
- package/dist/esm/Form.js +2 -2
- package/dist/esm/Grid.js +3 -4
- package/dist/esm/GridItem.js +2 -3
- package/dist/esm/Image.js +2 -3
- package/dist/esm/Infiniteloading.js +2 -3
- package/dist/esm/Input.js +5 -3
- package/dist/esm/NumberKeyboard.js +2 -3
- package/dist/esm/Pagination.js +2 -3
- package/dist/esm/Picker.js +2 -3
- package/dist/esm/PullToRefresh.js +2 -3
- package/dist/esm/Range.js +2 -3
- package/dist/esm/SearchBar.js +2 -3
- package/dist/esm/ShortPassword.js +2 -3
- package/dist/esm/Signature.js +2 -3
- package/dist/esm/Skeleton.js +8 -5
- package/dist/esm/Swipe.js +1 -1
- package/dist/esm/Tabbar/style/index.js +1 -1
- package/dist/esm/Tabbar.js +6 -3
- package/dist/esm/TabbarItem.js +3 -4
- package/dist/esm/Table.js +2 -3
- package/dist/esm/TextArea.js +2 -3
- package/dist/esm/TimeDetail.js +2 -3
- package/dist/esm/TimePannel.js +2 -3
- package/dist/esm/TimeSelect.js +4 -5
- package/dist/esm/Uploader.js +2 -3
- package/dist/esm/VirtualList.js +2 -3
- package/dist/esm/WaterMark.js +2 -3
- package/dist/esm/{address.taro-67e32c33.js → address.taro-cab0ea22.js} +18 -4
- package/dist/esm/{audio.taro-51eafc9d.js → audio.taro-ff280f5e.js} +2 -2
- package/dist/esm/{avatar.taro-a840f345.js → avatar.taro-6e8f1f5c.js} +31 -29
- package/dist/esm/{avatargroup-0eadb514.js → avatargroup-f4375806.js} +9 -12
- package/dist/esm/{calendar.taro-b3ebdc35.js → calendar.taro-2fc9b899.js} +2 -2
- package/dist/esm/{calendaritem.taro-ab1ec154.js → calendaritem.taro-2d4a8c34.js} +1 -1
- package/dist/esm/{cellgroup.taro-660faffc.js → cellgroup.taro-e05ea802.js} +3 -2
- package/dist/esm/checkbox.taro-9d02f86c.js +175 -0
- package/dist/esm/{circleprogress.taro-d8973ae9.js → circleprogress.taro-d4943109.js} +21 -27
- package/dist/esm/{zh-CN-b4f493ba.js → configprovider.taro-ce34d482.js} +44 -1
- package/dist/esm/{countdown.taro-c14b5c1f.js → countdown.taro-3118ba23.js} +1 -1
- package/dist/esm/{datepicker.taro-7d522ff8.js → datepicker.taro-2e3e955b.js} +2 -2
- package/dist/esm/{dialog.taro-f9ca73a2.js → dialog.taro-eab19eab.js} +1 -1
- package/dist/esm/{elevator.taro-360a831f.js → elevator.taro-1a4e3356.js} +16 -8
- package/dist/esm/{ellipsis.taro-79044d54.js → ellipsis.taro-e1ac99a1.js} +7 -4
- package/dist/esm/{empty.taro-f8585835.js → empty.taro-26363c66.js} +12 -18
- package/dist/esm/{fixednav.taro-cca9a6df.js → fixednav.taro-ddb21e87.js} +1 -1
- package/dist/esm/{form.taro-7413d868.js → form.taro-423b0f0a.js} +1 -1
- package/dist/esm/{grid.taro-10eb7716.js → grid.taro-883a9c35.js} +1 -1
- package/dist/esm/{griditem.taro-fb15eeec.js → griditem.taro-16c7055b.js} +1 -1
- package/dist/esm/{image.taro-b897a058.js → image.taro-3025e659.js} +1 -1
- package/dist/esm/{infiniteloading.taro-cce53c60.js → infiniteloading.taro-721bca1f.js} +1 -1
- package/dist/esm/input.taro-06c1e4d5.js +167 -0
- package/dist/esm/{numberkeyboard.taro-10ab54d6.js → numberkeyboard.taro-d9b1721b.js} +1 -1
- package/dist/esm/nutui-react.es.js +45 -47
- package/dist/esm/{pagination.taro-df441058.js → pagination.taro-94f9be5e.js} +1 -1
- package/dist/esm/{picker.taro-9f1bb6a4.js → picker.taro-e16b4312.js} +1 -1
- package/dist/esm/{pulltorefresh.taro-37dadbc5.js → pulltorefresh.taro-016d0079.js} +1 -1
- package/dist/esm/{range.taro-432d20d7.js → range.taro-8953e8c3.js} +1 -1
- package/dist/esm/{searchbar.taro-4aa300df.js → searchbar.taro-4467040f.js} +1 -1
- package/dist/esm/{shortpassword.taro-99645f99.js → shortpassword.taro-433b86a4.js} +1 -1
- package/dist/esm/{signature.taro-e5ede25a.js → signature.taro-a4d9b5c9.js} +1 -1
- package/dist/esm/{skeleton.taro-fabd423a.js → skeleton.taro-8ec11af9.js} +2 -2
- package/dist/esm/{swipe.taro-b18a73ff.js → swipe.taro-0b8cc872.js} +3 -5
- package/dist/esm/tabbar.taro-48413fb8.js +51 -0
- package/dist/esm/tabbaritem.taro-5afa3562.js +37 -0
- package/dist/esm/{table.taro-eca757f3.js → table.taro-327b4248.js} +1 -1
- package/dist/esm/{textarea.taro-e256e741.js → textarea.taro-add72cf3.js} +1 -1
- package/dist/esm/{timedetail.taro-cae362b9.js → timedetail.taro-82a2900b.js} +1 -1
- package/dist/esm/{timepannel.taro-d6f4cf80.js → timepannel.taro-0573bb65.js} +1 -1
- package/dist/esm/{timeselect.taro-804199f9.js → timeselect.taro-29124a34.js} +3 -3
- package/dist/esm/{uploader.taro-716f9a50.js → uploader.taro-c70d00de.js} +1 -1
- package/dist/esm/{virtuallist.taro-0bd611cb.js → virtuallist.taro-ba8e1f21.js} +1 -1
- package/dist/esm/{watermark.taro-8966896a.js → watermark.taro-168cdac5.js} +1 -1
- 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 +975 -1094
- package/dist/nutui.react.umd.js +973 -1092
- package/dist/packages/badge/badge.scss +0 -1
- package/dist/packages/cellgroup/cellgroup.scss +20 -16
- package/dist/packages/checkbox/checkbox.scss +8 -11
- package/dist/packages/circleprogress/circleprogress.scss +0 -9
- package/dist/packages/empty/empty.scss +0 -9
- package/dist/packages/input/input.scss +13 -180
- package/dist/packages/tabbar/tabbar.scss +16 -22
- package/dist/packages/tabbaritem/tabbaritem.scss +9 -70
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/themes/default.scss +0 -1
- package/dist/styles/variables-jmapp.scss +12 -16
- package/dist/styles/variables.scss +12 -16
- package/dist/types/index.d.ts +86 -129
- package/package.json +1 -1
- package/dist/esm/Icon.js +0 -64
- package/dist/esm/checkbox.taro-ae460d3a.js +0 -168
- package/dist/esm/configprovider-9960f0fb.js +0 -19
- package/dist/esm/configprovider.taro-43a3c646.js +0 -45
- package/dist/esm/input.taro-f4e067f7.js +0 -237
- package/dist/esm/tabbar.taro-eefd0f8e.js +0 -59
- package/dist/esm/tabbaritem.taro-7a97e645.js +0 -55
- package/dist/packages/icon/icon.scss +0 -0
- /package/dist/esm/{AvatarContext-c96afdcc.js → context-c96afdcc.js} +0 -0
|
@@ -2,7 +2,7 @@ import React, { useRef, useState, useEffect } from 'react';
|
|
|
2
2
|
import { getEnv } from '@tarojs/taro';
|
|
3
3
|
import { Search, CircleClose } from '@nutui/icons-react-taro';
|
|
4
4
|
import { c as cn } from './bem-350c1702.js';
|
|
5
|
-
import { u as useConfig } from './configprovider.taro-
|
|
5
|
+
import { u as useConfig } from './configprovider.taro-ce34d482.js';
|
|
6
6
|
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
7
7
|
|
|
8
8
|
const defaultProps = {
|
|
@@ -2,7 +2,7 @@ import React, { useRef, useState, useEffect } from 'react';
|
|
|
2
2
|
import { Tips } from '@nutui/icons-react-taro';
|
|
3
3
|
import { c as cn } from './bem-350c1702.js';
|
|
4
4
|
import { P as Popup } from './popup.taro-89cc342a.js';
|
|
5
|
-
import { u as useConfig } from './configprovider.taro-
|
|
5
|
+
import { u as useConfig } from './configprovider.taro-ce34d482.js';
|
|
6
6
|
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
7
7
|
|
|
8
8
|
const defaultProps = {
|
|
@@ -2,7 +2,7 @@ import React, { useRef, useState, useEffect } from 'react';
|
|
|
2
2
|
import { getEnv, nextTick, createSelectorQuery, canvasToTempFilePath } from '@tarojs/taro';
|
|
3
3
|
import { B as Button } from './button.taro-b50bc217.js';
|
|
4
4
|
import { c as cn } from './bem-350c1702.js';
|
|
5
|
-
import { u as useConfig } from './configprovider.taro-
|
|
5
|
+
import { u as useConfig } from './configprovider.taro-ce34d482.js';
|
|
6
6
|
|
|
7
7
|
/* eslint-disable react/no-unknown-property */
|
|
8
8
|
const defaultProps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import { A as Avatar } from './avatar.taro-
|
|
3
|
+
import { A as Avatar } from './avatar.taro-6e8f1f5c.js';
|
|
4
4
|
import { c as cn } from './bem-350c1702.js';
|
|
5
5
|
|
|
6
6
|
const defaultProps = {
|
|
@@ -48,7 +48,7 @@ const Skeleton = (props) => {
|
|
|
48
48
|
return (React.createElement(React.Fragment, null, loading ? (React.createElement("div", null, children)) : (React.createElement("div", { className: classes, ...restProps },
|
|
49
49
|
animated && React.createElement("div", { className: "skeleton-animation" }),
|
|
50
50
|
React.createElement("div", { className: "nut-skeleton-content" },
|
|
51
|
-
avatar && (React.createElement(Avatar, { className: avatarClass,
|
|
51
|
+
avatar && (React.createElement(Avatar, { className: avatarClass, background: "rgb(239, 239, 239)", shape: avatarShape, style: getStyle() })),
|
|
52
52
|
row === 1 && (React.createElement("div", { className: blockClass, style: { width, height } })),
|
|
53
53
|
React.createElement("div", { className: "skeleton-content-line" },
|
|
54
54
|
title && React.createElement("div", { className: "skeleton-title" }),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { forwardRef, useRef, useState,
|
|
1
|
+
import React, { forwardRef, useRef, useState, useImperativeHandle, useEffect } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { useReady, nextTick } from '@tarojs/taro';
|
|
4
4
|
import { c as cn } from './bem-350c1702.js';
|
|
@@ -15,8 +15,6 @@ function preventDefault(event, isStopPropagation) {
|
|
|
15
15
|
}
|
|
16
16
|
const defaultProps = {
|
|
17
17
|
name: '',
|
|
18
|
-
leftWidth: 0,
|
|
19
|
-
rightWidth: 0,
|
|
20
18
|
};
|
|
21
19
|
const Swipe = forwardRef((props, instanceRef) => {
|
|
22
20
|
const swipeBem = cn('swipe');
|
|
@@ -52,8 +50,8 @@ const Swipe = forwardRef((props, instanceRef) => {
|
|
|
52
50
|
transform: `translate3d(${state.offset}px, 0, 0)`,
|
|
53
51
|
transitionDuration: state.dragging ? '0s' : '.6s',
|
|
54
52
|
};
|
|
55
|
-
const leftWidth =
|
|
56
|
-
const rightWidth =
|
|
53
|
+
const leftWidth = actionWidth.left;
|
|
54
|
+
const rightWidth = actionWidth.right;
|
|
57
55
|
const onTouchStart = async (event) => {
|
|
58
56
|
if (leftWrapper.current) {
|
|
59
57
|
const leftRect = await getRectByTaro(leftWrapper.current);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
4
|
+
import { u as usePropsValue } from './use-props-value-ae7ee726.js';
|
|
5
|
+
import { T as TabbarItem } from './tabbaritem.taro-5afa3562.js';
|
|
6
|
+
|
|
7
|
+
const defaultProps = {
|
|
8
|
+
...ComponentDefaults,
|
|
9
|
+
defaultValue: 0,
|
|
10
|
+
fixed: false,
|
|
11
|
+
inactiveColor: '',
|
|
12
|
+
activeColor: '',
|
|
13
|
+
safeArea: false,
|
|
14
|
+
onSwitch: (value) => { },
|
|
15
|
+
};
|
|
16
|
+
const Tabbar = (props) => {
|
|
17
|
+
const { children, defaultValue, value, fixed, activeColor, inactiveColor, safeArea, className, style, onSwitch, } = {
|
|
18
|
+
...defaultProps,
|
|
19
|
+
...props,
|
|
20
|
+
};
|
|
21
|
+
const classPrefix = 'nut-tabbar';
|
|
22
|
+
const [selectIndex, setSelectIndex] = usePropsValue({
|
|
23
|
+
value,
|
|
24
|
+
defaultValue,
|
|
25
|
+
finalValue: 0,
|
|
26
|
+
onChange: onSwitch,
|
|
27
|
+
});
|
|
28
|
+
return (React.createElement("div", { className: classNames(classPrefix, className, {
|
|
29
|
+
[`${classPrefix}__fixed`]: fixed,
|
|
30
|
+
}), style: style },
|
|
31
|
+
React.createElement("div", { className: `${classPrefix}__wrap` }, React.Children.map(children, (child, idx) => {
|
|
32
|
+
if (!React.isValidElement(child)) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const childProps = {
|
|
36
|
+
...child.props,
|
|
37
|
+
active: idx === selectIndex,
|
|
38
|
+
index: idx,
|
|
39
|
+
inactiveColor,
|
|
40
|
+
activeColor,
|
|
41
|
+
handleClick: setSelectIndex,
|
|
42
|
+
};
|
|
43
|
+
return React.cloneElement(child, childProps);
|
|
44
|
+
})),
|
|
45
|
+
(fixed || safeArea) && React.createElement("div", { className: `${classPrefix}__safe-area` })));
|
|
46
|
+
};
|
|
47
|
+
Tabbar.defaultProps = defaultProps;
|
|
48
|
+
Tabbar.displayName = 'NutTabbar';
|
|
49
|
+
Tabbar.Item = TabbarItem;
|
|
50
|
+
|
|
51
|
+
export { Tabbar as T };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
4
|
+
import { B as Badge } from './badge.taro-e2169fbe.js';
|
|
5
|
+
|
|
6
|
+
const defaultProps = {
|
|
7
|
+
...ComponentDefaults,
|
|
8
|
+
title: '',
|
|
9
|
+
icon: null,
|
|
10
|
+
active: false,
|
|
11
|
+
index: 0,
|
|
12
|
+
handleClick: (idx) => { },
|
|
13
|
+
};
|
|
14
|
+
const TabbarItem = (props) => {
|
|
15
|
+
const { className, style, title, icon, active, activeColor, inactiveColor, index, handleClick, ...rest } = {
|
|
16
|
+
...defaultProps,
|
|
17
|
+
...props,
|
|
18
|
+
};
|
|
19
|
+
const classPrefix = 'nut-tabbar-item';
|
|
20
|
+
const tabbarItemClass = classNames(className, classPrefix, {
|
|
21
|
+
[`${classPrefix}-active`]: active,
|
|
22
|
+
});
|
|
23
|
+
const boxPrefix = `${classPrefix}__icon-box`;
|
|
24
|
+
const titleClass = classNames(boxPrefix, `${boxPrefix}-nav`, {
|
|
25
|
+
[`${boxPrefix}-large`]: !icon,
|
|
26
|
+
});
|
|
27
|
+
return (React.createElement("div", { className: tabbarItemClass, style: {
|
|
28
|
+
color: active ? activeColor : inactiveColor,
|
|
29
|
+
...style,
|
|
30
|
+
}, onClick: () => handleClick(index) }, icon ? (React.createElement(React.Fragment, null,
|
|
31
|
+
React.createElement(Badge, { ...rest },
|
|
32
|
+
React.createElement("div", { className: boxPrefix }, icon)),
|
|
33
|
+
React.createElement("div", { className: titleClass }, title))) : (React.createElement(Badge, { ...rest },
|
|
34
|
+
React.createElement("div", { className: titleClass }, title)))));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { TabbarItem as T };
|
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { DownArrow } from '@nutui/icons-react-taro';
|
|
4
4
|
import { c as cn } from './bem-350c1702.js';
|
|
5
|
-
import { u as useConfig } from './configprovider.taro-
|
|
5
|
+
import { u as useConfig } from './configprovider.taro-ce34d482.js';
|
|
6
6
|
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
7
7
|
|
|
8
8
|
const defaultProps = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useRef, useEffect } from 'react';
|
|
2
|
-
import { u as useConfig } from './configprovider.taro-
|
|
2
|
+
import { u as useConfig } from './configprovider.taro-ce34d482.js';
|
|
3
3
|
import { c as cn } from './bem-350c1702.js';
|
|
4
4
|
|
|
5
5
|
const defaultProps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { c as cn } from './bem-350c1702.js';
|
|
3
|
-
import { u as useConfig } from './configprovider.taro-
|
|
3
|
+
import { u as useConfig } from './configprovider.taro-ce34d482.js';
|
|
4
4
|
|
|
5
5
|
const defaultProps = {
|
|
6
6
|
className: '',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { P as Popup } from './popup.taro-89cc342a.js';
|
|
3
|
-
import { T as TimePannel } from './timepannel.taro-
|
|
4
|
-
import { T as TimeDetail } from './timedetail.taro-
|
|
3
|
+
import { T as TimePannel } from './timepannel.taro-0573bb65.js';
|
|
4
|
+
import { T as TimeDetail } from './timedetail.taro-82a2900b.js';
|
|
5
5
|
import { c as cn } from './bem-350c1702.js';
|
|
6
|
-
import { u as useConfig } from './configprovider.taro-
|
|
6
|
+
import { u as useConfig } from './configprovider.taro-ce34d482.js';
|
|
7
7
|
|
|
8
8
|
const defaultProps = {
|
|
9
9
|
className: '',
|
|
@@ -5,7 +5,7 @@ import { Failure, Loading, Link, Del, Photograph } from '@nutui/icons-react-taro
|
|
|
5
5
|
import { Image } from '@tarojs/components';
|
|
6
6
|
import { B as Button } from './button.taro-b50bc217.js';
|
|
7
7
|
import { P as Progress } from './progress.taro-1a7ac8a4.js';
|
|
8
|
-
import { u as useConfig } from './configprovider.taro-
|
|
8
|
+
import { u as useConfig } from './configprovider.taro-ce34d482.js';
|
|
9
9
|
import { i as isPromise } from './index-5bcb0ff8.js';
|
|
10
10
|
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
11
11
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
2
|
import { ScrollView } from '@tarojs/components';
|
|
3
3
|
import { getSystemInfoSync } from '@tarojs/taro';
|
|
4
|
-
import { u as useConfig } from './configprovider.taro-
|
|
4
|
+
import { u as useConfig } from './configprovider.taro-ce34d482.js';
|
|
5
5
|
|
|
6
6
|
// 缓存列表初始化信息
|
|
7
7
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { getSystemInfo, createOffscreenCanvas } from '@tarojs/taro';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import { u as useConfig } from './configprovider.taro-
|
|
4
|
+
import { u as useConfig } from './configprovider.taro-ce34d482.js';
|
|
5
5
|
import { c as cn } from './bem-350c1702.js';
|
|
6
6
|
|
|
7
7
|
const defaultProps = {
|
package/dist/locales/base.js
CHANGED
package/dist/locales/en-US.js
CHANGED
package/dist/locales/id-ID.js
CHANGED
package/dist/locales/zh-CN.js
CHANGED
package/dist/locales/zh-TW.js
CHANGED
package/dist/locales/zh-UG.js
CHANGED