@nutui/nutui-react-taro 2.0.0-alpha.2 → 2.0.0-alpha.4
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 +21 -0
- package/dist/esm/ActionSheet.js +3 -3
- package/dist/esm/Address.js +5 -5
- package/dist/esm/Animate.js +1 -1
- package/dist/esm/AnimatingNumbers.js +1 -1
- package/dist/esm/Audio.js +5 -5
- package/dist/esm/Avatar.js +1 -1
- package/dist/esm/AvatarGroup.js +1 -1
- package/dist/esm/BackTop.js +1 -1
- package/dist/esm/Badge.js +1 -1
- package/dist/esm/Barrage.js +1 -1
- package/dist/esm/Button.js +1 -1
- package/dist/esm/Calendar.js +5 -5
- package/dist/esm/CalendarItem.js +2 -2
- package/dist/esm/Card.js +3 -3
- package/dist/esm/Cascader.js +6 -5
- package/dist/esm/Cell.js +1 -1
- package/dist/esm/CellGroup.js +1 -1
- package/dist/esm/Checkbox.js +1 -1
- package/dist/esm/CheckboxGroup.js +1 -1
- package/dist/esm/CircleProgress.js +2 -3
- package/dist/esm/Col.js +1 -1
- package/dist/esm/Collapse.js +1 -1
- package/dist/esm/CollapseItem.js +1 -1
- package/dist/esm/ConfigProvider.js +2 -2
- package/dist/esm/CountDown.js +2 -2
- package/dist/esm/DatePicker.js +5 -5
- package/dist/esm/Dialog.js +5 -4
- package/dist/esm/Divider.js +1 -1
- package/dist/esm/Drag.js +1 -1
- package/dist/esm/Elevator.js +1 -1
- package/dist/esm/Ellipsis.js +2 -2
- package/dist/esm/Empty.js +2 -2
- package/dist/esm/FixedNav.js +3 -3
- package/dist/esm/Form.js +4 -4
- package/dist/esm/FormItem.js +2 -2
- package/dist/esm/Grid.js +3 -3
- package/dist/esm/GridItem.js +2 -2
- package/dist/esm/Icon.js +2 -2
- package/dist/esm/Image.js +2 -2
- package/dist/esm/ImagePreview.js +5 -5
- package/dist/esm/Indicator.js +1 -1
- package/dist/esm/Infiniteloading.js +2 -2
- package/dist/esm/Input.js +5 -2
- package/dist/esm/InputNumber.js +1 -1
- package/dist/esm/Layout.js +1 -1
- package/dist/esm/Menu.js +1 -1
- package/dist/esm/MenuItem.js +2 -2
- package/dist/esm/NavBar.js +1 -1
- package/dist/esm/NoticeBar.js +1 -1
- package/dist/esm/Notify.js +1 -1
- package/dist/esm/NumberKeyboard.js +4 -4
- package/dist/esm/Overlay.js +1 -1
- package/dist/esm/Pagination.js +2 -2
- package/dist/esm/Picker.js +4 -4
- package/dist/esm/Popover.js +2 -2
- package/dist/esm/Popup.js +2 -2
- package/dist/esm/Price.js +1 -1
- package/dist/esm/Progress.js +1 -1
- package/dist/esm/PullToRefresh.js +2 -2
- package/dist/esm/Radio.js +1 -1
- package/dist/esm/RadioGroup.js +1 -1
- package/dist/esm/Range.js +3 -3
- package/dist/esm/Rate.js +1 -1
- package/dist/esm/Row.js +1 -1
- package/dist/esm/SearchBar.js +2 -2
- package/dist/esm/ShortPassword.js +4 -4
- package/dist/esm/SideNavBar.js +3 -3
- package/dist/esm/SideNavBarItem.js +1 -1
- package/dist/esm/Signature.js +3 -3
- package/dist/esm/Skeleton.js +2 -2
- package/dist/esm/Step.js +1 -1
- package/dist/esm/Steps.js +1 -1
- package/dist/esm/Sticky.js +1 -1
- package/dist/esm/SubSideNavBar.js +1 -1
- package/dist/esm/Swipe.js +1 -1
- package/dist/esm/Swiper.js +1 -1
- package/dist/esm/SwiperItem.js +1 -1
- package/dist/esm/Switch.js +3 -3
- package/dist/esm/TabPane.js +1 -3
- package/dist/esm/Tabbar.js +6 -3
- package/dist/esm/TabbarItem.js +3 -4
- package/dist/esm/Table.js +2 -2
- package/dist/esm/Tabs.js +4 -4
- package/dist/esm/Tag.js +1 -1
- package/dist/esm/TextArea.js +2 -2
- package/dist/esm/TimeDetail.js +2 -2
- package/dist/esm/TimePannel.js +2 -2
- package/dist/esm/TimeSelect.js +6 -6
- package/dist/esm/Toast.js +1 -1
- package/dist/esm/TrendArrow.js +1 -1
- package/dist/esm/Uploader.js +4 -4
- package/dist/esm/Video.js +1 -1
- package/dist/esm/VirtualList.js +2 -2
- package/dist/esm/WaterMark.js +2 -2
- package/dist/esm/{actionsheet.taro-10cc53ee.js → actionsheet.taro-12cf5a3e.js} +10 -10
- package/dist/esm/{address.taro-2f915873.js → address.taro-67e32c33.js} +37 -37
- package/dist/esm/{animate.taro-9e65d07a.js → animate.taro-485331bb.js} +3 -3
- package/dist/esm/{animatingnumbers.taro-03e5d61d.js → animatingnumbers.taro-f6eaffef.js} +8 -8
- package/dist/esm/{audio.taro-f672a68c.js → audio.taro-51eafc9d.js} +20 -20
- package/dist/esm/{avatar.taro-de157a1f.js → avatar.taro-a840f345.js} +9 -9
- package/dist/esm/{avatargroup-b476ac68.js → avatargroup-0eadb514.js} +3 -3
- package/dist/esm/{backtop.taro-ba271b8f.js → backtop.taro-8ec80d02.js} +3 -3
- package/dist/esm/{badge.taro-1d5df601.js → badge.taro-e2169fbe.js} +5 -5
- package/dist/esm/{barrage.taro-80df08d3.js → barrage.taro-aa08da6c.js} +5 -5
- package/dist/esm/{button.taro-a1c9512f.js → button.taro-b50bc217.js} +6 -6
- package/dist/esm/{calendar.taro-099cb4a2.js → calendar.taro-b3ebdc35.js} +8 -8
- package/dist/esm/{calendaritem.taro-ae167e59.js → calendaritem.taro-ab1ec154.js} +36 -32
- package/dist/esm/card.taro-0e849e94.js +33 -0
- package/dist/esm/{cascader.taro-62e764a7.js → cascader.taro-467910b2.js} +21 -21
- package/dist/esm/{cell.taro-26870740.js → cell.taro-ea725a95.js} +7 -7
- package/dist/esm/{cellgroup.taro-6e901b54.js → cellgroup.taro-660faffc.js} +5 -5
- package/dist/esm/{checkbox.taro-785c528b.js → checkbox.taro-ae460d3a.js} +12 -12
- package/dist/esm/{circleprogress.taro-79854448.js → circleprogress.taro-d4943109.js} +23 -29
- package/dist/esm/{col.taro-a99a9171.js → col.taro-4477c9f7.js} +2 -2
- package/dist/esm/{collapse.taro-35a8a0d6.js → collapse.taro-89bcadf2.js} +4 -4
- package/dist/esm/{collapseitem-690eb91c.js → collapseitem-0e228cec.js} +9 -9
- package/dist/esm/{configprovider.taro-c8c54556.js → configprovider.taro-43a3c646.js} +3 -3
- package/dist/esm/{countdown.taro-0e6bf7a2.js → countdown.taro-c14b5c1f.js} +4 -4
- package/dist/esm/{datepicker.taro-0f2bcf42.js → datepicker.taro-7d522ff8.js} +4 -4
- package/dist/esm/dialog.taro-f9ca73a2.js +107 -0
- package/dist/esm/{divider.taro-67e9f757.js → divider.taro-3993d7d5.js} +2 -2
- package/dist/esm/{drag.taro-2d3d9d11.js → drag.taro-347dfb84.js} +3 -3
- package/dist/esm/{elevator.taro-588e219b.js → elevator.taro-360a831f.js} +16 -16
- package/dist/esm/{ellipsis.taro-b6cda065.js → ellipsis.taro-79044d54.js} +14 -14
- package/dist/esm/{empty.taro-fde835ca.js → empty.taro-f8585835.js} +7 -7
- package/dist/esm/fixednav.taro-cca9a6df.js +54 -0
- package/dist/esm/{form.taro-0d83f1e8.js → form.taro-7413d868.js} +6 -6
- package/dist/esm/{formitem.taro-0de07d1e.js → formitem.taro-b550d29c.js} +12 -12
- package/dist/esm/{grid.taro-3797169c.js → grid.taro-10eb7716.js} +6 -6
- package/dist/esm/{griditem.taro-04f59ae1.js → griditem.taro-fb15eeec.js} +7 -7
- package/dist/esm/{image.taro-edb572bb.js → image.taro-b897a058.js} +6 -6
- package/dist/esm/{imagepreview.taro-b88fcf41.js → imagepreview.taro-d511342c.js} +10 -10
- package/dist/esm/{indicator.taro-c10334e8.js → indicator.taro-bfb21d45.js} +3 -3
- package/dist/esm/{infiniteloading.taro-73c9b8ca.js → infiniteloading.taro-cce53c60.js} +11 -11
- package/dist/esm/input.taro-1aca4a45.js +167 -0
- package/dist/esm/{inputnumber.taro-108c4784.js → inputnumber.taro-1f893d42.js} +7 -7
- package/dist/esm/{layout.taro-9046d093.js → layout.taro-e4bf83cb.js} +2 -2
- package/dist/esm/{menu.taro-b61442a7.js → menu.taro-e5c68cb8.js} +12 -12
- package/dist/esm/{menuitem.taro-bca78e07.js → menuitem.taro-37c18382.js} +11 -11
- package/dist/esm/{navbar.taro-02c69d66.js → navbar.taro-92bab9c4.js} +7 -7
- package/dist/esm/{noticebar.taro-49e7441f.js → noticebar.taro-cbe93c9e.js} +18 -18
- package/dist/esm/{notify.taro-e17c6f82.js → notify.taro-f1079218.js} +4 -4
- package/dist/esm/{numberkeyboard.taro-ed9b2149.js → numberkeyboard.taro-10ab54d6.js} +22 -22
- package/dist/esm/nutui-react.es.js +95 -95
- package/dist/esm/{overlay.taro-ad0d4775.js → overlay.taro-067b7202.js} +12 -14
- package/dist/esm/{pagination.taro-60b22b27.js → pagination.taro-df441058.js} +9 -9
- package/dist/esm/{picker.taro-5028afcb.js → picker.taro-9f1bb6a4.js} +24 -24
- package/dist/esm/{popover.taro-2a57eae4.js → popover.taro-84a55ff9.js} +15 -15
- package/dist/esm/{popup.taro-020bf791.js → popup.taro-89cc342a.js} +9 -9
- package/dist/esm/{price.taro-776ed16e.js → price.taro-959d82f2.js} +6 -6
- package/dist/esm/{progress.taro-1c199fbe.js → progress.taro-1a7ac8a4.js} +4 -4
- package/dist/esm/{pulltorefresh.taro-d5fcfcb0.js → pulltorefresh.taro-37dadbc5.js} +6 -6
- package/dist/esm/{radio.taro-51e10152.js → radio.taro-36438449.js} +16 -16
- package/dist/esm/{range.taro-7a2b6ca1.js → range.taro-432d20d7.js} +16 -16
- package/dist/esm/{rate.taro-57341aa9.js → rate.taro-895bb41c.js} +8 -8
- package/dist/esm/{row.taro-75039d53.js → row.taro-e929ec5c.js} +2 -2
- package/dist/esm/{searchbar.taro-eef468bb.js → searchbar.taro-4aa300df.js} +15 -15
- package/dist/esm/{shortpassword.taro-681a33a1.js → shortpassword.taro-99645f99.js} +22 -22
- package/dist/esm/sidenavbar.taro-f8ffb7dc.js +33 -0
- package/dist/esm/{sidenavbaritem.taro-bb80dbf4.js → sidenavbaritem.taro-6cb0821e.js} +2 -2
- package/dist/esm/{signature.taro-f01b2b05.js → signature.taro-e5ede25a.js} +8 -8
- package/dist/esm/{skeleton.taro-64e858a2.js → skeleton.taro-fabd423a.js} +10 -10
- package/dist/esm/{step.taro-2ec1f283.js → step.taro-7ea33a76.js} +10 -10
- package/dist/esm/{steps.taro-c82d2252.js → steps.taro-86753d36.js} +2 -2
- package/dist/esm/{sticky.taro-b5bde7b1.js → sticky.taro-a142a5f2.js} +3 -3
- package/dist/esm/{subsidenavbar.taro-3cce8442.js → subsidenavbar.taro-85c03291.js} +5 -5
- package/dist/esm/{swipe.taro-350c9a94.js → swipe.taro-b18a73ff.js} +4 -4
- package/dist/esm/{swiper.taro-7a94e211.js → swiper.taro-c0e9a56b.js} +13 -13
- package/dist/esm/{swiperitem-c9e3d0d5.js → swiperitem-abab7606.js} +3 -3
- package/dist/esm/switch.taro-e82809f6.js +38 -0
- package/dist/esm/tabbar.taro-48413fb8.js +51 -0
- package/dist/esm/tabbaritem.taro-5afa3562.js +37 -0
- package/dist/esm/{table.taro-3946697c.js → table.taro-eca757f3.js} +16 -16
- package/dist/esm/tabpane.taro-406cc0d3.js +21 -0
- package/dist/esm/tabs.taro-d47ccfc5.js +120 -0
- package/dist/esm/{tag.taro-0c2567de.js → tag.taro-846ee805.js} +6 -6
- package/dist/esm/{textarea.taro-a0f79515.js → textarea.taro-e256e741.js} +7 -7
- package/dist/esm/{timedetail.taro-fce4e614.js → timedetail.taro-cae362b9.js} +3 -3
- package/dist/esm/{timepannel.taro-fd3d008d.js → timepannel.taro-d6f4cf80.js} +3 -3
- package/dist/esm/{timeselect.taro-a4b86771.js → timeselect.taro-804199f9.js} +12 -12
- package/dist/esm/{toast.taro-e4f44812.js → toast.taro-c509a870.js} +10 -10
- package/dist/esm/{trendarrow.taro-7cf90def.js → trendarrow.taro-dd83ec94.js} +4 -4
- package/dist/esm/{uploader.taro-17569890.js → uploader.taro-716f9a50.js} +31 -31
- package/dist/esm/{video-7ed508cc.js → video-1c6405b4.js} +5 -5
- package/dist/esm/{virtuallist.taro-35b9bd9a.js → virtuallist.taro-0bd611cb.js} +8 -8
- package/dist/esm/{watermark.taro-c780d360.js → watermark.taro-8966896a.js} +3 -3
- 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 +21768 -22442
- package/dist/nutui.react.umd.js +21680 -22354
- package/dist/packages/badge/badge.scss +0 -1
- package/dist/packages/circleprogress/circleprogress.scss +0 -9
- package/dist/packages/dialog/dialog.scss +36 -65
- package/dist/packages/input/input.scss +13 -180
- package/dist/packages/overlay/overlay.scss +11 -4
- package/dist/packages/switch/switch.scss +13 -31
- package/dist/packages/tabbar/tabbar.scss +16 -23
- package/dist/packages/tabbaritem/tabbaritem.scss +9 -70
- package/dist/packages/tabs/tabs.scss +196 -225
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/themes/default.scss +17 -17
- package/dist/styles/variables-jmapp.scss +24 -27
- package/dist/styles/variables.scss +34 -30
- package/dist/types/index.d.ts +398 -457
- package/package.json +2 -2
- package/dist/esm/card.taro-5e9b34c8.js +0 -33
- package/dist/esm/dialog.taro-00ac41fd.js +0 -118
- package/dist/esm/fixednav.taro-39fbd47a.js +0 -54
- package/dist/esm/input.taro-10ed5500.js +0 -237
- package/dist/esm/sidenavbar.taro-d5c5b331.js +0 -33
- package/dist/esm/switch.taro-34ca8228.js +0 -50
- package/dist/esm/tabbar.taro-9acfc2fa.js +0 -59
- package/dist/esm/tabbaritem.taro-42ba353f.js +0 -55
- package/dist/esm/tabpane.taro-4ca340ef.js +0 -23
- package/dist/esm/tabs.taro-be8cacb5.js +0 -140
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
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-43a3c646.js';
|
|
6
6
|
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
7
7
|
|
|
8
8
|
const defaultProps = {
|
|
@@ -55,10 +55,10 @@ const Table = (props) => {
|
|
|
55
55
|
};
|
|
56
56
|
const renderHeadCells = () => {
|
|
57
57
|
return columns.map((item, index) => {
|
|
58
|
-
return (
|
|
58
|
+
return (React.createElement("span", { className: classNames('nut-table__main__head__tr__th', cellClasses(item)), key: item.key, onClick: () => handleSorterClick(item) },
|
|
59
59
|
item.title,
|
|
60
60
|
"\u00A0",
|
|
61
|
-
item.sorter && (sorterIcon ||
|
|
61
|
+
item.sorter && (sorterIcon || React.createElement(DownArrow, { size: "12px" }))));
|
|
62
62
|
});
|
|
63
63
|
};
|
|
64
64
|
const sortDataItem = () => {
|
|
@@ -68,26 +68,26 @@ const Table = (props) => {
|
|
|
68
68
|
};
|
|
69
69
|
const renderBodyTds = (item) => {
|
|
70
70
|
return sortDataItem().map(([value, render], index) => {
|
|
71
|
-
return (
|
|
71
|
+
return (React.createElement("span", { className: classNames('nut-table__main__body__tr__td', cellClasses(getColumnItem(value))), key: value }, typeof item[value] === 'function' || typeof render === 'function' ? (React.createElement("div", null, render ? render(item) : item[value](item))) : (item[value])));
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
74
|
const renderBoyTrs = () => {
|
|
75
75
|
return curData.map((item, index) => {
|
|
76
|
-
return (
|
|
76
|
+
return (React.createElement("div", { className: "nut-table__main__body__tr", key: index }, renderBodyTds(item)));
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
|
-
return (
|
|
80
|
-
|
|
79
|
+
return (React.createElement("div", { className: cls, style: style, ...rest },
|
|
80
|
+
React.createElement("div", { className: classNames('nut-table__main', {
|
|
81
81
|
'nut-table__main--striped': striped,
|
|
82
82
|
}) },
|
|
83
|
-
showHeader && (
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
summary && (
|
|
87
|
-
|
|
88
|
-
curData.length === 0 && (
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
showHeader && (React.createElement("div", { className: "nut-table__main__head" },
|
|
84
|
+
React.createElement("div", { className: "nut-table__main__head__tr" }, renderHeadCells()))),
|
|
85
|
+
React.createElement("div", { className: "nut-table__main__body" }, renderBoyTrs())),
|
|
86
|
+
summary && (React.createElement("div", { className: "nut-table__summary" },
|
|
87
|
+
React.createElement("span", { className: "nut-table__summary__text" }, summary))),
|
|
88
|
+
curData.length === 0 && (React.createElement("div", { className: "nut-table__nodata" },
|
|
89
|
+
React.createElement("div", { className: "nut-table__nodata" },
|
|
90
|
+
React.createElement("div", { className: "nut-table__nodata__text" }, noData))))));
|
|
91
91
|
};
|
|
92
92
|
Table.defaultProps = defaultProps;
|
|
93
93
|
Table.displayName = 'NutTable';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
const defaultProps = {
|
|
5
|
+
title: '',
|
|
6
|
+
value: '',
|
|
7
|
+
disabled: false,
|
|
8
|
+
};
|
|
9
|
+
const TabPane = (props) => {
|
|
10
|
+
const { children, autoHeightClassName, className, disabled } = {
|
|
11
|
+
...defaultProps,
|
|
12
|
+
...props,
|
|
13
|
+
};
|
|
14
|
+
const classPrefix = 'nut-tabpane';
|
|
15
|
+
const classes = classNames({
|
|
16
|
+
active: !disabled && props.active,
|
|
17
|
+
}, classPrefix, autoHeightClassName, className);
|
|
18
|
+
return children ? (React.createElement("div", { className: classes }, !disabled && children)) : null;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { TabPane as T };
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
2
|
+
import { View, ScrollView } from '@tarojs/components';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { JoySmile } from '@nutui/icons-react-taro';
|
|
5
|
+
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
6
|
+
import { T as TabPane } from './tabpane.taro-406cc0d3.js';
|
|
7
|
+
import { u as usePropsValue } from './use-props-value-ae7ee726.js';
|
|
8
|
+
|
|
9
|
+
const defaultProps = {
|
|
10
|
+
...ComponentDefaults,
|
|
11
|
+
tabStyle: {},
|
|
12
|
+
activeColor: '',
|
|
13
|
+
direction: 'horizontal',
|
|
14
|
+
activeType: 'line',
|
|
15
|
+
duration: 300,
|
|
16
|
+
autoHeight: false,
|
|
17
|
+
};
|
|
18
|
+
const classPrefix = 'nut-tabs';
|
|
19
|
+
const Tabs = (props) => {
|
|
20
|
+
const { activeColor, tabStyle, direction, activeType, duration, align, title, children, onClick, onChange, className, autoHeight, ...rest } = {
|
|
21
|
+
...defaultProps,
|
|
22
|
+
...props,
|
|
23
|
+
};
|
|
24
|
+
const [value, setValue] = usePropsValue({
|
|
25
|
+
value: props.value,
|
|
26
|
+
defaultValue: props.defaultValue,
|
|
27
|
+
finalValue: 0,
|
|
28
|
+
onChange,
|
|
29
|
+
});
|
|
30
|
+
const [contentStyle, setContentStyle] = useState({});
|
|
31
|
+
const titleItemsRef = useRef([]);
|
|
32
|
+
const navRef = useRef(null);
|
|
33
|
+
const getTitles = () => {
|
|
34
|
+
const titles = [];
|
|
35
|
+
React.Children.forEach(children, (child, idx) => {
|
|
36
|
+
if (React.isValidElement(child)) {
|
|
37
|
+
const props = child?.props;
|
|
38
|
+
if (props?.title || props?.value) {
|
|
39
|
+
titles.push({
|
|
40
|
+
title: props.title,
|
|
41
|
+
value: props.value || idx,
|
|
42
|
+
disabled: props.disabled,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return titles;
|
|
48
|
+
};
|
|
49
|
+
const titles = useRef(getTitles());
|
|
50
|
+
const classes = classNames(classPrefix, `${classPrefix}--${direction}`, className);
|
|
51
|
+
const classesTitle = classNames(`${classPrefix}__titles`, {
|
|
52
|
+
[`${classPrefix}__titles--${activeType}`]: activeType,
|
|
53
|
+
[`${classPrefix}__titles--scrollable`]: true,
|
|
54
|
+
[`${classPrefix}__titles--${align}`]: align,
|
|
55
|
+
});
|
|
56
|
+
const tabsActiveStyle = {
|
|
57
|
+
color: activeType === 'smile' ? activeColor : '',
|
|
58
|
+
background: activeType === 'line' ? activeColor : '',
|
|
59
|
+
};
|
|
60
|
+
const scrollIntoRef = useRef(0);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
const index = titles.current.findIndex((t) => t.value === value);
|
|
63
|
+
setContentStyle({
|
|
64
|
+
transform: direction === 'horizontal'
|
|
65
|
+
? `translate3d(-${index * 100}%, 0, 0)`
|
|
66
|
+
: `translate3d( 0,-${index * 100}%, 0)`,
|
|
67
|
+
transitionDuration: `${duration}ms`,
|
|
68
|
+
});
|
|
69
|
+
const scrollToIndex = index - 2;
|
|
70
|
+
scrollIntoRef.current = scrollToIndex < 0 ? 0 : scrollToIndex;
|
|
71
|
+
}, [value]);
|
|
72
|
+
const tabChange = (item, index) => {
|
|
73
|
+
onClick && onClick(item.value);
|
|
74
|
+
if (item.disabled) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
setValue(item.value);
|
|
78
|
+
};
|
|
79
|
+
return (React.createElement(View, { className: classes, ...rest },
|
|
80
|
+
React.createElement(ScrollView, { enableFlex: true, scrollX: direction === 'horizontal', scrollY: direction === 'vertical', showScrollbar: false, scrollIntoViewAlignment: "center", scrollWithAnimation: true, scrollIntoView: `scrollIntoView${scrollIntoRef.current}`, className: classesTitle, style: { ...tabStyle }, ref: navRef }, !!title && typeof title === 'function'
|
|
81
|
+
? title()
|
|
82
|
+
: titles.current.map((item, index) => {
|
|
83
|
+
return (React.createElement(View, { ref: (ref) => titleItemsRef.current.push(ref), id: `scrollIntoView${index}`, onClick: (e) => {
|
|
84
|
+
tabChange(item);
|
|
85
|
+
}, className: classNames(`${classPrefix}__titles-item`, {
|
|
86
|
+
[`nut-tabs__titles-item--active`]: !item.disabled && String(item.value) === String(value),
|
|
87
|
+
[`nut-tabs__titles-item--disabled`]: item.disabled,
|
|
88
|
+
[`nut-tabs__titles-item--${align}`]: align,
|
|
89
|
+
}), key: item.value },
|
|
90
|
+
activeType === 'line' && (React.createElement(View, { className: `${classPrefix}__titles-item__line`, style: tabsActiveStyle })),
|
|
91
|
+
activeType === 'smile' && (React.createElement(View, { className: `${classPrefix}__titles-item__smile`, style: tabsActiveStyle },
|
|
92
|
+
React.createElement(JoySmile, { color: activeColor, width: 40, height: 20 }))),
|
|
93
|
+
React.createElement(View, { className: classNames({
|
|
94
|
+
ellipsis: true,
|
|
95
|
+
}, `${classPrefix}__titles-item__text`) }, item.title)));
|
|
96
|
+
})),
|
|
97
|
+
React.createElement(View, { className: `${classPrefix}__content__wrap` },
|
|
98
|
+
React.createElement(View, { className: `${classPrefix}__content`, style: contentStyle }, React.Children.map(children, (child, idx) => {
|
|
99
|
+
if (!React.isValidElement(child)) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
let childProps = {
|
|
103
|
+
...child.props,
|
|
104
|
+
active: value === child.props.value,
|
|
105
|
+
};
|
|
106
|
+
if (String(value) !== String(child.props.value || idx) &&
|
|
107
|
+
autoHeight) {
|
|
108
|
+
childProps = {
|
|
109
|
+
...childProps,
|
|
110
|
+
autoHeightClassName: 'inactive',
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
return React.cloneElement(child, childProps);
|
|
114
|
+
})))));
|
|
115
|
+
};
|
|
116
|
+
Tabs.defaultProps = defaultProps;
|
|
117
|
+
Tabs.displayName = 'NutTabs';
|
|
118
|
+
Tabs.TabPane = TabPane;
|
|
119
|
+
|
|
120
|
+
export { Tabs as T };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { Close } from '@nutui/icons-react-taro';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
@@ -76,15 +76,15 @@ const Tag = (props) => {
|
|
|
76
76
|
}
|
|
77
77
|
return style;
|
|
78
78
|
};
|
|
79
|
-
return (
|
|
80
|
-
children &&
|
|
81
|
-
|
|
79
|
+
return (React.createElement(React.Fragment, null, closeable ? (isTagShow && (React.createElement("div", { className: btnName, style: { ...style, ...getStyle() }, onClick: (e) => handleClick(e) },
|
|
80
|
+
children && React.createElement("span", { className: "nut-tag-text" }, children),
|
|
81
|
+
React.isValidElement(closeIcon) ? (React.createElement("i", { className: "nut-tag-custom-icon", onClick: (e) => {
|
|
82
82
|
setIsTagShow(false);
|
|
83
83
|
props.onClose && props.onClose(e);
|
|
84
|
-
} }, closeIcon)) : (
|
|
84
|
+
} }, closeIcon)) : (React.createElement(Close, { size: 12, onClick: (e) => {
|
|
85
85
|
setIsTagShow(false);
|
|
86
86
|
props.onClose && props.onClose(e);
|
|
87
|
-
} }))))) : (
|
|
87
|
+
} }))))) : (React.createElement("div", { className: btnName, style: { ...style, ...getStyle() }, onClick: (e) => handleClick(e) }, children && React.createElement("span", { className: "nut-tag-text" }, children)))));
|
|
88
88
|
};
|
|
89
89
|
Tag.defaultProps = defaultProps;
|
|
90
90
|
Tag.displayName = 'NutTag';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { u as useConfig } from './configprovider.taro-
|
|
1
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
2
|
+
import { u as useConfig } from './configprovider.taro-43a3c646.js';
|
|
3
3
|
import { c as cn } from './bem-350c1702.js';
|
|
4
4
|
|
|
5
5
|
const defaultProps = {
|
|
@@ -19,8 +19,8 @@ const TextArea = (props) => {
|
|
|
19
19
|
const textareaBem = cn('textarea');
|
|
20
20
|
const [inputValue, SetInputValue] = useState('');
|
|
21
21
|
const compositingRef = useRef(false);
|
|
22
|
-
const [, updateState] =
|
|
23
|
-
const forceUpdate =
|
|
22
|
+
const [, updateState] = React.useState({});
|
|
23
|
+
const forceUpdate = React.useCallback(() => updateState({}), []);
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
let initValue = defaultValue;
|
|
26
26
|
if (initValue && maxlength && [...initValue].length > Number(maxlength)) {
|
|
@@ -69,8 +69,8 @@ const TextArea = (props) => {
|
|
|
69
69
|
const endComposing = () => {
|
|
70
70
|
compositingRef.current = false;
|
|
71
71
|
};
|
|
72
|
-
return (
|
|
73
|
-
|
|
72
|
+
return (React.createElement("div", { className: `${textareaBem()} ${disabled ? textareaBem('disabled') : ''} ${className || ''}` },
|
|
73
|
+
React.createElement("textarea", { className: textareaBem('textarea'), style: {
|
|
74
74
|
textAlign,
|
|
75
75
|
resize: `${autosize ? 'vertical' : 'none'}`,
|
|
76
76
|
...style,
|
|
@@ -83,7 +83,7 @@ const TextArea = (props) => {
|
|
|
83
83
|
}, onFocus: (e) => {
|
|
84
84
|
textFocus(e);
|
|
85
85
|
}, onCompositionEnd: (e) => endComposing(), onCompositionStart: (e) => startComposing(), rows: rows, maxLength: maxlength < 0 ? 0 : maxlength, placeholder: placeholder || locale.placeholder }),
|
|
86
|
-
limitshow ? (
|
|
86
|
+
limitshow ? (React.createElement("div", { className: textareaBem('limit') },
|
|
87
87
|
[...inputValue].length,
|
|
88
88
|
"/",
|
|
89
89
|
maxlength < 0 ? 0 : maxlength)) : null));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
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-43a3c646.js';
|
|
4
4
|
|
|
5
5
|
const defaultProps = {
|
|
6
6
|
className: '',
|
|
@@ -36,7 +36,7 @@ const TimeDetail = (props) => {
|
|
|
36
36
|
}
|
|
37
37
|
return initClass;
|
|
38
38
|
};
|
|
39
|
-
return (
|
|
39
|
+
return (React.createElement("div", { className: `${b()} ${className || ''}` }, renderData.map((item, index) => (React.createElement("span", { className: getDetailClass(item), key: item, onClick: () => handleTime(item) }, item)))));
|
|
40
40
|
};
|
|
41
41
|
TimeDetail.defaultProps = defaultProps;
|
|
42
42
|
TimeDetail.displayName = 'NutTimeDetail';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React 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-43a3c646.js';
|
|
4
4
|
|
|
5
5
|
const defaultProps = {
|
|
6
6
|
className: '',
|
|
@@ -14,7 +14,7 @@ const TimePannel = (props) => {
|
|
|
14
14
|
...props,
|
|
15
15
|
};
|
|
16
16
|
const b = cn('timepannel');
|
|
17
|
-
return (
|
|
17
|
+
return (React.createElement("div", { className: `${b()} ${className || ''}`, onClick: () => change(curKey) }, date));
|
|
18
18
|
};
|
|
19
19
|
TimePannel.defaultProps = defaultProps;
|
|
20
20
|
TimePannel.displayName = 'NutTimePannel';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { P as Popup } from './popup.taro-
|
|
3
|
-
import { T as TimePannel } from './timepannel.taro-
|
|
4
|
-
import { T as TimeDetail } from './timedetail.taro-
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { P as Popup } from './popup.taro-89cc342a.js';
|
|
3
|
+
import { T as TimePannel } from './timepannel.taro-d6f4cf80.js';
|
|
4
|
+
import { T as TimeDetail } from './timedetail.taro-cae362b9.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-43a3c646.js';
|
|
7
7
|
|
|
8
8
|
const defaultProps = {
|
|
9
9
|
className: '',
|
|
@@ -117,15 +117,15 @@ const TimeSelect = (props) => {
|
|
|
117
117
|
useEffect(() => {
|
|
118
118
|
setPopVisible(visible);
|
|
119
119
|
}, [visible]);
|
|
120
|
-
return (
|
|
121
|
-
|
|
120
|
+
return (React.createElement(React.Fragment, null,
|
|
121
|
+
React.createElement(Popup, { closeable: true, round: true, visible: popVisible, position: "bottom", style: popStyle, onClose: () => {
|
|
122
122
|
closeFun();
|
|
123
123
|
} },
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
React.createElement("div", { className: `${b()} ${className || ''}` },
|
|
125
|
+
React.createElement("div", { className: "nut-timeselect__title" }, title),
|
|
126
|
+
React.createElement("div", { className: "nut-timeselect__content" },
|
|
127
|
+
React.createElement("div", { className: "nut-timeselect__content-left" }, dates.map((dataItem, index) => (React.createElement(TimePannel, { date: dataItem.date, className: getTimePannelClass(dataItem), key: String(dataItem['paneKey'] || index), curKey: String(dataItem['paneKey'] || index), change: handleChange })))),
|
|
128
|
+
React.createElement(TimeDetail, { times: times, currentKey: String(activeKey), currentTime: activeTime, select: handleSelectTime }))))));
|
|
129
129
|
};
|
|
130
130
|
TimeSelect.defaultProps = defaultProps;
|
|
131
131
|
TimeSelect.displayName = 'NutTimeSelect';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { Success, Failure, Tips, Loading } from '@nutui/icons-react-taro';
|
|
4
4
|
import { c as cn } from './bem-350c1702.js';
|
|
@@ -73,10 +73,10 @@ const Toast = (props) => {
|
|
|
73
73
|
return icon;
|
|
74
74
|
}
|
|
75
75
|
return {
|
|
76
|
-
success:
|
|
77
|
-
fail:
|
|
78
|
-
warn:
|
|
79
|
-
loading:
|
|
76
|
+
success: React.createElement(Success, { color: "#ffffff", width: iconSize, height: iconSize }),
|
|
77
|
+
fail: React.createElement(Failure, { color: "#ffffff", width: iconSize, height: iconSize }),
|
|
78
|
+
warn: React.createElement(Tips, { color: "#ffffff", width: iconSize, height: iconSize }),
|
|
79
|
+
loading: React.createElement(Loading, { color: "#ffffff", width: iconSize, height: iconSize }),
|
|
80
80
|
}[type];
|
|
81
81
|
};
|
|
82
82
|
const classes = classNames({
|
|
@@ -87,20 +87,20 @@ const Toast = (props) => {
|
|
|
87
87
|
[`${customClass}`]: true,
|
|
88
88
|
[`nut-toast-${size}`]: true,
|
|
89
89
|
});
|
|
90
|
-
return (
|
|
90
|
+
return (React.createElement(React.Fragment, null, openState ? (React.createElement("div", { className: `${toastBem()} ${classes}`, id: id, style: {
|
|
91
91
|
bottom: center ? 'auto' : `${bottom}`,
|
|
92
92
|
backgroundColor: cover ? coverColor : '',
|
|
93
93
|
...style,
|
|
94
94
|
}, onClick: () => {
|
|
95
95
|
clickCover();
|
|
96
96
|
} },
|
|
97
|
-
|
|
97
|
+
React.createElement("div", { className: toastBem('inner'), style: {
|
|
98
98
|
textAlign: textAlignCenter ? 'center' : 'left',
|
|
99
99
|
backgroundColor: bgColor,
|
|
100
100
|
} },
|
|
101
|
-
hasIcon() ? (
|
|
102
|
-
title ?
|
|
103
|
-
|
|
101
|
+
hasIcon() ? (React.createElement("p", { className: toastBem('icon-wrapper') }, iconName())) : null,
|
|
102
|
+
title ? React.createElement("div", { className: "nut-toast-title" }, title) : null,
|
|
103
|
+
React.createElement("span", { className: toastBem('text') }, msg)))) : null));
|
|
104
104
|
};
|
|
105
105
|
Toast.defaultProps = defaultProps;
|
|
106
106
|
Toast.displayName = 'NutToast';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
2
|
import { TriangleUp, TriangleDown } from '@nutui/icons-react-taro';
|
|
3
3
|
import { c as cn } from './bem-350c1702.js';
|
|
4
4
|
|
|
@@ -57,11 +57,11 @@ const TrendArrow = (props) => {
|
|
|
57
57
|
})();
|
|
58
58
|
const renderContent = (arrowLeft) => {
|
|
59
59
|
const classNameSuffix = !arrowLeft ? 'icon-after' : 'icon-before';
|
|
60
|
-
return (
|
|
60
|
+
return (React.createElement("span", { className: `${b(classNameSuffix)} ${b('rate')}`, style: calcStyle }, calcRate));
|
|
61
61
|
};
|
|
62
|
-
return (
|
|
62
|
+
return (React.createElement("div", { className: `${b()} ${className}`, ...rest, onClick: handleClick },
|
|
63
63
|
!arrowLeft && renderContent(!arrowLeft),
|
|
64
|
-
children || (
|
|
64
|
+
children || (React.createElement(React.Fragment, null, Number(rate) !== 0 && (React.createElement(React.Fragment, null, rateTrend ? (React.createElement(TriangleUp, { color: calcIconProps.color })) : (React.createElement(TriangleDown, { color: calcIconProps.color })))))),
|
|
65
65
|
arrowLeft && renderContent(!arrowLeft)));
|
|
66
66
|
};
|
|
67
67
|
TrendArrow.defaultProps = defaultProps;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useState, useEffect, useImperativeHandle } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import Taro, { uploadFile, getEnv, chooseMedia, chooseImage } from '@tarojs/taro';
|
|
4
4
|
import { Failure, Loading, Link, Del, Photograph } from '@nutui/icons-react-taro';
|
|
5
5
|
import { Image } from '@tarojs/components';
|
|
6
|
-
import { B as Button } from './button.taro-
|
|
7
|
-
import { P as Progress } from './progress.taro-
|
|
8
|
-
import { u as useConfig } from './configprovider.taro-
|
|
6
|
+
import { B as Button } from './button.taro-b50bc217.js';
|
|
7
|
+
import { P as Progress } from './progress.taro-1a7ac8a4.js';
|
|
8
|
+
import { u as useConfig } from './configprovider.taro-43a3c646.js';
|
|
9
9
|
import { i as isPromise } from './index-5bcb0ff8.js';
|
|
10
10
|
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
11
11
|
|
|
@@ -449,45 +449,45 @@ const InternalUploader = (props, ref) => {
|
|
|
449
449
|
const handleItemClick = (file) => {
|
|
450
450
|
onFileItemClick && onFileItemClick(file);
|
|
451
451
|
};
|
|
452
|
-
return (
|
|
453
|
-
children && (
|
|
454
|
-
|
|
452
|
+
return (React.createElement("div", { className: classes, ...restProps },
|
|
453
|
+
children && (React.createElement("div", { className: "nut-uploader__slot" },
|
|
454
|
+
React.createElement(React.Fragment, null,
|
|
455
455
|
children,
|
|
456
|
-
maxCount > fileList.length && (
|
|
456
|
+
maxCount > fileList.length && (React.createElement(Button, { className: "nut-uploader__input", onClick: _chooseImage }))))),
|
|
457
457
|
fileList.length !== 0 &&
|
|
458
458
|
fileList.map((item, index) => {
|
|
459
|
-
return (
|
|
460
|
-
previewType === 'picture' && !children && (
|
|
461
|
-
deletable && (
|
|
462
|
-
item.status === 'ready' ? (
|
|
463
|
-
|
|
459
|
+
return (React.createElement("div", { className: `nut-uploader__preview ${previewType}`, key: item.uid },
|
|
460
|
+
previewType === 'picture' && !children && (React.createElement("div", { className: "nut-uploader__preview-img" },
|
|
461
|
+
deletable && (React.createElement(Failure, { color: "rgba(0,0,0,0.6)", className: "close", onClick: () => onDeleteItem(item, index) })),
|
|
462
|
+
item.status === 'ready' ? (React.createElement("div", { className: "nut-uploader__preview__progress" },
|
|
463
|
+
React.createElement("div", { className: "nut-uploader__preview__progress__msg" }, item.message))) : (item.status !== 'success' && (React.createElement("div", { className: "nut-uploader__preview__progress" },
|
|
464
464
|
item.failIcon !== ' ' &&
|
|
465
465
|
item.loadingIcon !== ' ' &&
|
|
466
466
|
(item.status === 'error'
|
|
467
|
-
? item.failIcon ||
|
|
468
|
-
: item.loadingIcon ||
|
|
469
|
-
|
|
470
|
-
item.type.includes('image') ? (
|
|
471
|
-
|
|
472
|
-
|
|
467
|
+
? item.failIcon || React.createElement(Failure, { color: "#fff" })
|
|
468
|
+
: item.loadingIcon || React.createElement(Loading, { color: "#fff" })),
|
|
469
|
+
React.createElement("div", { className: "nut-uploader__preview__progress__msg" }, item.message)))),
|
|
470
|
+
item.type.includes('image') ? (React.createElement(React.Fragment, null, item.url && (React.createElement(Image, { className: "nut-uploader__preview-img__c", style: { objectFit: imageFit }, mode: "aspectFit", src: item.url, onClick: () => handleItemClick(item) })))) : (React.createElement(React.Fragment, null, previewUrl ? (React.createElement(Image, { className: "nut-uploader__preview-img__c", mode: "aspectFit", src: previewUrl, onClick: () => handleItemClick(item) })) : (React.createElement("div", { className: "nut-uploader__preview-img__file" },
|
|
471
|
+
React.createElement("div", { onClick: () => handleItemClick(item), className: "nut-uploader__preview-img__file__name" },
|
|
472
|
+
React.createElement(Link, { color: "#808080" }),
|
|
473
473
|
"\u00A0",
|
|
474
474
|
item.name))))),
|
|
475
|
-
item.status === 'success' ? (
|
|
476
|
-
previewType === 'list' && (
|
|
477
|
-
|
|
478
|
-
|
|
475
|
+
item.status === 'success' ? (React.createElement("div", { className: "tips" }, item.name)) : null)),
|
|
476
|
+
previewType === 'list' && (React.createElement("div", { className: "nut-uploader__preview-list" },
|
|
477
|
+
React.createElement("div", { className: `nut-uploader__preview-img__file__name ${item.status}`, onClick: () => handleItemClick(item) },
|
|
478
|
+
React.createElement(Link, null),
|
|
479
479
|
"\u00A0",
|
|
480
480
|
item.name),
|
|
481
|
-
deletable && (
|
|
482
|
-
item.status === 'uploading' && (
|
|
481
|
+
deletable && (React.createElement(Del, { color: "#808080", className: "nut-uploader__preview-img__file__del", onClick: () => onDeleteItem(item, index) })),
|
|
482
|
+
item.status === 'uploading' && (React.createElement(Progress, { percent: item.percentage, color: "linear-gradient(270deg, rgba(18,126,255,1) 0%,rgba(32,147,255,1) 32.815625%,rgba(13,242,204,1) 100%)", showText: false }))))));
|
|
483
483
|
}),
|
|
484
|
-
maxCount > fileList.length && previewType === 'picture' && !children && (
|
|
485
|
-
|
|
486
|
-
uploadIcon ||
|
|
487
|
-
|
|
488
|
-
|
|
484
|
+
maxCount > fileList.length && previewType === 'picture' && !children && (React.createElement("div", { className: `nut-uploader__upload ${previewType} ${disabled ? 'nut-uploader__upload-disabled' : ''}` },
|
|
485
|
+
React.createElement("div", { className: "nut-uploader__icon" },
|
|
486
|
+
uploadIcon || React.createElement(Photograph, { size: "20px", color: "#808080" }),
|
|
487
|
+
React.createElement("span", { className: "nut-uploader__icon-tip" }, uploadLabel)),
|
|
488
|
+
React.createElement(Button, { className: "nut-uploader__input", onClick: _chooseImage })))));
|
|
489
489
|
};
|
|
490
|
-
const Uploader =
|
|
490
|
+
const Uploader = React.forwardRef(InternalUploader);
|
|
491
491
|
Uploader.defaultProps = defaultProps;
|
|
492
492
|
Uploader.displayName = 'NutUploader';
|
|
493
493
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useRef, useEffect } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { c as cn } from './bem-350c1702.js';
|
|
4
4
|
|
|
@@ -56,10 +56,10 @@ const Video = (props) => {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
return (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
return (React.createElement("div", { className: classes, ...restProps },
|
|
60
|
+
React.createElement("video", { className: "nut-video-player", muted: options.muted, autoPlay: options.autoplay, loop: options.loop, poster: options.poster, controls: options.controls, ref: rootRef, src: source.src },
|
|
61
|
+
React.createElement("source", { src: source.src, type: source.type }),
|
|
62
|
+
React.createElement("track", { kind: "captions" }))));
|
|
63
63
|
};
|
|
64
64
|
Video.defaultProps = defaultProps;
|
|
65
65
|
Video.displayName = 'NutVideo';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
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-43a3c646.js';
|
|
5
5
|
|
|
6
6
|
// 缓存列表初始化信息
|
|
7
7
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
@@ -192,20 +192,20 @@ const VirtualList = (props) => {
|
|
|
192
192
|
}
|
|
193
193
|
setStartOffset(scrollTop - (scrollTop % itemSize));
|
|
194
194
|
};
|
|
195
|
-
return (
|
|
195
|
+
return (React.createElement("div", { className: className ? `${className} nut-virtualList-box` : 'nut-virtualList-box', ...rest, style: {
|
|
196
196
|
height: containerSize ? `${offSetSize}px` : '',
|
|
197
197
|
} },
|
|
198
|
-
|
|
198
|
+
React.createElement(ScrollView, { scrollTop: 0, scrollY: true, type: "list", ref: scrollRef, className: "nut-virtuallist", style: {
|
|
199
199
|
height: `${getContainerHeight()}px`,
|
|
200
200
|
}, onScroll: listScroll },
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
React.createElement("div", { className: "nut-virtuallist-phantom", style: { height: `${listHeight()}px` } }),
|
|
202
|
+
React.createElement("div", { className: "nut-virtuallist-container", ref: itemsRef, style: { transform: `translate3d(0, ${startOffset}px, 0)` } }, visibleData().map((data, index) => {
|
|
203
203
|
const { overStart } = options;
|
|
204
204
|
const dataIndex = overStart + index;
|
|
205
205
|
key && data[key] ? data[key] : dataIndex;
|
|
206
|
-
return (
|
|
206
|
+
return (React.createElement("div", { ref: dataIndex === 0 ? firstItemRef : null, "data-index": `${dataIndex}`, className: "nut-virtuallist-item", key: `${data}`, style: {
|
|
207
207
|
height: `${itemEqualSize ? `${itemSize}px` : 'auto'}`,
|
|
208
|
-
} }, ItemRender ? (
|
|
208
|
+
} }, ItemRender ? (React.createElement(ItemRender, { data: data, index: `${index}` })) : (data)));
|
|
209
209
|
})))));
|
|
210
210
|
};
|
|
211
211
|
VirtualList.defaultProps = defaultProps;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
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-43a3c646.js';
|
|
5
5
|
import { c as cn } from './bem-350c1702.js';
|
|
6
6
|
|
|
7
7
|
const defaultProps = {
|
|
@@ -101,7 +101,7 @@ const WaterMark = (props) => {
|
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
103
|
};
|
|
104
|
-
return (
|
|
104
|
+
return (React.createElement("div", { className: cls, style: {
|
|
105
105
|
zIndex,
|
|
106
106
|
backgroundSize: `${gapX + width}px`,
|
|
107
107
|
backgroundImage: `url('${base64Url}')`,
|
package/dist/locales/base.js
CHANGED
package/dist/locales/en-US.js
CHANGED