@nutui/nutui-react-taro 1.5.1-beta.0 → 2.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -25
- package/dist/esm/ActionSheet.js +6 -6
- package/dist/esm/Address/style/index.js +0 -1
- package/dist/esm/Address.js +11 -12
- package/dist/esm/Audio/style/index.js +0 -1
- package/dist/esm/Audio.js +11 -12
- package/dist/esm/Avatar.js +2 -3
- package/dist/esm/AvatarGroup.js +3 -3
- package/dist/esm/BackTop/style/index.js +1 -1
- package/dist/esm/BackTop.js +4 -5
- package/dist/esm/Badge.js +2 -3
- package/dist/esm/Button/style/index.js +1 -1
- package/dist/esm/Button.js +4 -5
- package/dist/esm/Calendar.js +10 -10
- package/dist/esm/CalendarItem.js +4 -4
- package/dist/esm/Card.js +4 -4
- package/dist/esm/Cascader.js +7 -7
- package/dist/esm/Cell/style/index.js +1 -1
- package/dist/esm/Cell.js +3 -6
- package/dist/esm/CellGroup.js +3 -3
- package/dist/esm/Checkbox/style/index.js +0 -1
- package/dist/esm/Checkbox.js +3 -3
- package/dist/esm/CheckboxGroup.js +3 -3
- package/dist/esm/Collapse.js +1 -1
- package/dist/esm/CollapseItem/style/index.js +1 -1
- package/dist/esm/CollapseItem.js +1 -3
- package/dist/esm/ConfigProvider.js +3 -2
- package/dist/esm/CountDown.js +3 -3
- package/dist/esm/DatePicker.js +10 -12
- package/dist/esm/Dialog.js +6 -8
- package/dist/esm/Divider.js +1 -3
- package/dist/esm/Elevator.js +1 -1
- package/dist/esm/Ellipsis.js +4 -4
- package/dist/esm/Empty.js +3 -3
- package/dist/esm/FixedNav/style/index.js +0 -1
- package/dist/esm/FixedNav.js +6 -8
- package/dist/esm/Form.js +6 -9
- package/dist/esm/FormItem.js +4 -7
- package/dist/esm/Grid/style/index.js +1 -1
- package/dist/esm/Grid.js +4 -6
- package/dist/esm/GridItem.js +3 -8
- package/dist/esm/Icon.js +60 -4
- package/dist/esm/Image.js +4 -6
- package/dist/esm/ImagePreview.js +6 -6
- package/dist/esm/Indicator.js +1 -3
- package/dist/esm/Infiniteloading/style/index.js +1 -1
- package/dist/esm/Infiniteloading.js +4 -5
- package/dist/esm/Input/style/index.js +1 -1
- package/dist/esm/Input.js +5 -7
- package/dist/esm/InputNumber/style/index.js +1 -1
- package/dist/esm/InputNumber.js +4 -5
- package/dist/esm/Menu.js +3 -5
- package/dist/esm/MenuItem/style/index.js +0 -1
- package/dist/esm/MenuItem.js +6 -8
- package/dist/esm/NavBar/style/index.js +1 -1
- package/dist/esm/NavBar.js +3 -3
- package/dist/esm/NoticeBar/style/index.js +1 -1
- package/dist/esm/NoticeBar.js +4 -4
- package/dist/esm/NumberKeyboard.js +7 -7
- package/dist/esm/Overlay.js +2 -3
- package/dist/esm/Pagination.js +6 -5
- package/dist/esm/Picker.js +9 -10
- package/dist/esm/Popover/style/index.js +0 -1
- package/dist/esm/Popover.js +4 -7
- package/dist/esm/Popup/style/index.js +0 -1
- package/dist/esm/Popup.js +5 -5
- package/dist/esm/Progress/style/index.js +1 -1
- package/dist/esm/Progress.js +3 -3
- package/dist/esm/PullToRefresh.js +3 -3
- package/dist/esm/Radio/style/index.js +0 -1
- package/dist/esm/Radio.js +3 -3
- package/dist/esm/RadioGroup.js +3 -3
- package/dist/esm/Range.js +7 -7
- package/dist/esm/Rate/style/index.js +1 -1
- package/dist/esm/Rate.js +4 -5
- package/dist/esm/SearchBar/style/index.js +1 -1
- package/dist/esm/SearchBar.js +5 -5
- package/dist/esm/ShortPassword/style/index.js +0 -1
- package/dist/esm/ShortPassword.js +7 -7
- package/dist/esm/SideNavBar.js +8 -8
- package/dist/esm/SideNavBarItem.js +1 -1
- package/dist/esm/Signature.js +7 -6
- package/dist/esm/Skeleton.js +3 -4
- package/dist/esm/Step/style/index.js +1 -1
- package/dist/esm/Step.js +2 -3
- package/dist/esm/Sticky.js +3 -4
- package/dist/esm/SubSideNavBar.js +1 -1
- package/dist/esm/Swipe.js +3 -3
- package/dist/esm/TabbarItem/style/index.js +1 -1
- package/dist/esm/TabbarItem.js +2 -3
- package/dist/esm/Table/style/index.js +1 -1
- package/dist/esm/Table.js +5 -5
- package/dist/esm/Tabs/style/index.js +1 -2
- package/dist/esm/Tabs.js +3 -3
- package/dist/esm/Tag/style/index.js +1 -1
- package/dist/esm/Tag.js +3 -5
- package/dist/esm/TextArea.js +3 -3
- package/dist/esm/TimeDetail.js +3 -3
- package/dist/esm/TimePannel.js +3 -3
- package/dist/esm/TimeSelect.js +10 -10
- package/dist/esm/Toast/style/index.js +1 -1
- package/dist/esm/Toast.js +2 -2
- package/dist/esm/TrendArrow/style/index.js +1 -1
- package/dist/esm/TrendArrow.js +2 -2
- package/dist/esm/Uploader/style/index.js +0 -1
- package/dist/esm/Uploader.js +8 -8
- package/dist/esm/Video.js +1 -1
- package/dist/esm/VirtualList.js +3 -3
- package/dist/esm/WaterMark.js +3 -3
- package/dist/esm/{actionsheet.taro-e6a51446.js → actionsheet.taro-b76a342e.js} +5 -5
- package/dist/esm/{address.taro-3a9b6396.js → address.taro-1812caeb.js} +24 -24
- package/dist/esm/{audio.taro-87ec8bf2.js → audio.taro-f672a68c.js} +7 -6
- package/dist/esm/{avatar.taro-3676f38f.js → avatar.taro-de157a1f.js} +8 -6
- package/dist/esm/{avatargroup-f3574510.js → avatargroup-b476ac68.js} +1 -1
- package/dist/esm/backtop.taro-ba271b8f.js +52 -0
- package/dist/esm/{badge.taro-a4e59c11.js → badge.taro-ae154f41.js} +4 -6
- package/dist/esm/button.taro-a1c9512f.js +65 -0
- package/dist/esm/{calendar.taro-670842ea.js → calendar.taro-b6b147ca.js} +3 -3
- package/dist/esm/{calendaritem.taro-2a603571.js → calendaritem.taro-ae167e59.js} +3 -3
- package/dist/esm/{card.taro-e4c76dad.js → card.taro-5e9b34c8.js} +1 -1
- package/dist/esm/{cascader.taro-eb1fb011.js → cascader.taro-9c0a1a38.js} +17 -8
- package/dist/esm/cell.taro-26870740.js +43 -0
- package/dist/esm/cellgroup.taro-6e901b54.js +24 -0
- package/dist/esm/{checkbox.taro-6120e3e3.js → checkbox.taro-785c528b.js} +10 -13
- package/dist/esm/{collapse.taro-1a9e4ba2.js → collapse.taro-35a8a0d6.js} +3 -7
- package/dist/esm/{collapseitem-4d0bc55d.js → collapseitem-690eb91c.js} +6 -21
- package/dist/esm/{configprovider-67d19d3a.js → configprovider-9960f0fb.js} +1 -1
- package/dist/esm/{configprovider.taro-8d71eb49.js → configprovider.taro-c8c54556.js} +5 -2
- package/dist/esm/{countdown.taro-dbcb9a4f.js → countdown.taro-0e6bf7a2.js} +1 -1
- package/dist/esm/{datepicker.taro-6e9b4b8f.js → datepicker.taro-439e2080.js} +3 -3
- package/dist/esm/{dialog.taro-a3267d29.js → dialog.taro-00ac41fd.js} +5 -5
- package/dist/esm/divider.taro-6c1657ce.js +31 -0
- package/dist/esm/{elevator.taro-6019669e.js → elevator.taro-81a11ecc.js} +1 -1
- package/dist/esm/{ellipsis.taro-f15f26da.js → ellipsis.taro-b6cda065.js} +2 -2
- package/dist/esm/{empty.taro-04ae4389.js → empty.taro-fde835ca.js} +1 -1
- package/dist/esm/fixednav.taro-39fbd47a.js +54 -0
- package/dist/esm/{form.taro-0c8e7a39.js → form.taro-0d83f1e8.js} +3 -3
- package/dist/esm/{formitem.taro-190a3326.js → formitem.taro-0de07d1e.js} +2 -2
- package/dist/esm/{grid.taro-3503b82c.js → grid.taro-3797169c.js} +12 -24
- package/dist/esm/griditem.taro-04f59ae1.js +80 -0
- package/dist/esm/{image.taro-142cf512.js → image.taro-edb572bb.js} +4 -4
- package/dist/esm/{imagepreview.taro-c50bb0a3.js → imagepreview.taro-867ee24a.js} +1 -1
- package/dist/esm/indicator.taro-c10334e8.js +30 -0
- package/dist/esm/{infiniteloading.taro-e66e3746.js → infiniteloading.taro-73c9b8ca.js} +11 -12
- package/dist/esm/{input.taro-97af6c96.js → input.taro-10ed5500.js} +18 -21
- package/dist/esm/inputnumber.taro-108c4784.js +199 -0
- package/dist/esm/{menu.taro-7e4038a1.js → menu.taro-54951911.js} +6 -7
- package/dist/esm/{menuitem.taro-96cc4f15.js → menuitem.taro-86a6bb6c.js} +8 -10
- package/dist/esm/{navbar.taro-777c4705.js → navbar.taro-69f47d51.js} +8 -10
- package/dist/esm/{noticebar.taro-4a23cdee.js → noticebar.taro-49e7441f.js} +10 -31
- package/dist/esm/{numberkeyboard.taro-1bc24744.js → numberkeyboard.taro-81b36e5e.js} +2 -2
- package/dist/esm/nutui-react.es.js +86 -87
- package/dist/esm/{overlay.taro-21e87fb1.js → overlay.taro-ad0d4775.js} +20 -14
- package/dist/esm/pagination.taro-60b22b27.js +91 -0
- package/dist/esm/{picker.taro-9ad1b7c5.js → picker.taro-5c9030a7.js} +110 -160
- package/dist/esm/{popover.taro-ad5e76ea.js → popover.taro-2a57eae4.js} +12 -15
- package/dist/esm/{popup.taro-01676bff.js → popup.taro-124b9bab.js} +15 -10
- package/dist/esm/{progress.taro-f0ce38e9.js → progress.taro-24392ef3.js} +5 -7
- package/dist/esm/{pulltorefresh.taro-a294f656.js → pulltorefresh.taro-d5fcfcb0.js} +1 -1
- package/dist/esm/{radio.taro-a6eff96c.js → radio.taro-51e10152.js} +16 -7
- package/dist/esm/{range.taro-d8fc7656.js → range.taro-7a2b6ca1.js} +4 -4
- package/dist/esm/rate.taro-57341aa9.js +77 -0
- package/dist/esm/{searchbar.taro-0c25927b.js → searchbar.taro-eef468bb.js} +7 -7
- package/dist/esm/{shortpassword.taro-9ee034f7.js → shortpassword.taro-9a2c98ad.js} +17 -9
- package/dist/esm/{sidenavbar.taro-c307b35e.js → sidenavbar.taro-0265812f.js} +2 -2
- package/dist/esm/{sidenavbaritem.taro-5a7965d0.js → sidenavbaritem.taro-bb80dbf4.js} +2 -2
- package/dist/esm/{signature.taro-ec4e713b.js → signature.taro-f01b2b05.js} +2 -2
- package/dist/esm/{skeleton.taro-76faf63f.js → skeleton.taro-64e858a2.js} +1 -1
- package/dist/esm/{step.taro-b7903e8c.js → step.taro-2ec1f283.js} +5 -6
- package/dist/esm/{sticky.taro-218bda37.js → sticky.taro-b5bde7b1.js} +15 -17
- package/dist/esm/{subsidenavbar.taro-69cb9752.js → subsidenavbar.taro-3cce8442.js} +2 -2
- package/dist/esm/{swipe.taro-ea35f07f.js → swipe.taro-350c9a94.js} +2 -2
- package/dist/esm/{tabbaritem.taro-bf517487.js → tabbaritem.taro-42ba353f.js} +4 -7
- package/dist/esm/{table.taro-91fc0c01.js → table.taro-3946697c.js} +7 -5
- package/dist/esm/{tabs.taro-6a7524a4.js → tabs.taro-be8cacb5.js} +4 -4
- package/dist/esm/{tag.taro-23ba0834.js → tag.taro-0c2567de.js} +10 -10
- package/dist/esm/{textarea.taro-442e7350.js → textarea.taro-a0f79515.js} +1 -1
- package/dist/esm/{timedetail.taro-5b2f2269.js → timedetail.taro-fce4e614.js} +1 -1
- package/dist/esm/{timepannel.taro-d6e40180.js → timepannel.taro-fd3d008d.js} +1 -1
- package/dist/esm/{timeselect.taro-a07036f4.js → timeselect.taro-5b047850.js} +6 -6
- package/dist/esm/{toast.taro-d6c14811.js → toast.taro-e4f44812.js} +6 -7
- package/dist/esm/{trendarrow.taro-b8c5ccd9.js → trendarrow.taro-7cf90def.js} +5 -8
- package/dist/esm/typings-d8491423.js +6 -0
- package/dist/esm/{uploader.taro-c615fd4c.js → uploader.taro-0cca7e97.js} +24 -23
- package/dist/esm/use-props-value-ae7ee726.js +15 -0
- package/dist/esm/{video-f1be8a91.js → video-7ed508cc.js} +4 -4
- package/dist/esm/{virtuallist.taro-f0b0270d.js → virtuallist.taro-35b9bd9a.js} +2 -2
- package/dist/esm/{watermark.taro-9ce2ae37.js → watermark.taro-c780d360.js} +1 -1
- package/dist/esm/{zh-CN-c779e6c1.js → zh-CN-b4f493ba.js} +2 -2
- package/dist/locales/base.d.ts +2 -2
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +3 -3
- package/dist/locales/id-ID.js +3 -3
- package/dist/locales/zh-CN.js +3 -3
- package/dist/locales/zh-TW.js +3 -3
- package/dist/locales/zh-UG.js +3 -3
- package/dist/nutui.react.mjs +7825 -5006
- package/dist/nutui.react.umd.js +7822 -5003
- package/dist/packages/actionsheet/actionsheet.scss +10 -2
- package/dist/packages/backtop/backtop.scss +0 -8
- package/dist/packages/badge/badge.scss +3 -4
- package/dist/packages/button/button.scss +80 -93
- package/dist/packages/cell/cell.scss +18 -90
- package/dist/packages/cellgroup/cellgroup.scss +26 -20
- package/dist/packages/collapseitem/collapseitem.scss +0 -1
- package/dist/packages/dialog/dialog.scss +1 -1
- package/dist/packages/divider/divider.scss +3 -17
- package/dist/packages/grid/grid.scss +1 -0
- package/dist/packages/griditem/griditem.scss +2 -17
- package/dist/packages/icon/icon.scss +0 -132
- package/dist/packages/image/image.scss +0 -12
- package/dist/packages/indicator/indicator.scss +21 -39
- package/dist/packages/infiniteloading/infiniteloading.scss +4 -12
- package/dist/packages/input/input.scss +4 -0
- package/dist/packages/inputnumber/inputnumber.scss +10 -26
- package/dist/packages/menuitem/menuitem.scss +2 -0
- package/dist/packages/navbar/navbar.scss +4 -5
- package/dist/packages/overlay/overlay.scss +0 -19
- package/dist/packages/picker/picker.scss +97 -103
- package/dist/packages/progress/progress.scss +0 -1
- package/dist/packages/radio/radio.scss +8 -0
- package/dist/packages/rate/rate.scss +29 -6
- package/dist/packages/searchbar/searchbar.scss +0 -1
- package/dist/packages/shortpassword/shortpassword.scss +4 -1
- package/dist/packages/step/step.scss +0 -1
- package/dist/packages/sticky/sticky.scss +1 -1
- package/dist/packages/swiper/swiper.scss +8 -0
- package/dist/packages/tabbaritem/tabbaritem.scss +0 -1
- package/dist/packages/table/table.scss +0 -1
- package/dist/packages/tag/tag.scss +9 -2
- package/dist/packages/timedetail/timedetail.scss +9 -3
- package/dist/packages/timeselect/timeselect.scss +1 -1
- package/dist/packages/toast/toast.scss +0 -1
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/font-jmapp/config.json +175 -0
- package/dist/styles/font-jmapp/demo.css +539 -0
- package/dist/styles/font-jmapp/demo_index.html +1821 -0
- package/dist/styles/font-jmapp/iconfont.css +299 -0
- package/dist/styles/font-jmapp/iconfont.eot +0 -0
- package/dist/styles/font-jmapp/iconfont.js +68 -0
- package/dist/styles/font-jmapp/iconfont.json +506 -0
- package/dist/styles/font-jmapp/iconfont.svg +356 -0
- package/dist/styles/font-jmapp/iconfont.ttf +0 -0
- package/dist/styles/font-jmapp/iconfont.woff +0 -0
- package/dist/styles/font-jmapp/iconfont.woff2 +0 -0
- package/dist/styles/theme-default.scss +1 -0
- package/dist/styles/theme-jmapp.scss +41 -0
- package/dist/styles/themes/default.scss +0 -1
- package/dist/styles/variables-jmapp.scss +2601 -0
- package/dist/styles/variables.scss +49 -73
- package/dist/types/index.d.ts +146 -243
- package/package.json +23 -154
- package/dist/esm/Icon/style/index.js +0 -4
- package/dist/esm/backtop.taro-66394a36.js +0 -48
- package/dist/esm/button.taro-9244d065.js +0 -100
- package/dist/esm/cell.taro-a10a74d3.js +0 -64
- package/dist/esm/cellgroup.taro-abe501bc.js +0 -25
- package/dist/esm/divider.taro-26d1d8b4.js +0 -35
- package/dist/esm/fixednav.taro-1f05acaf.js +0 -53
- package/dist/esm/grid.taro.context-c2bbfb4f.js +0 -8
- package/dist/esm/griditem.taro-cdb3f119.js +0 -98
- package/dist/esm/icon-296a1bec.js +0 -63
- package/dist/esm/icon.taro-296a1bec.js +0 -63
- package/dist/esm/indicator.taro-cba8b010.js +0 -37
- package/dist/esm/inputnumber.taro-91f65d17.js +0 -130
- package/dist/esm/pagination.taro-715a173b.js +0 -124
- package/dist/esm/rate.taro-6cdf03bd.js +0 -75
- package/dist/esm/typings-b9828dba.js +0 -9
- /package/dist/esm/{useClientRect-1f8ed1fe.js → use-client-rect-1f8ed1fe.js} +0 -0
- /package/dist/esm/{useTouch-db24bb5c.js → use-touch-db24bb5c.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React__default, { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
|
-
import { u as useTouch } from './
|
|
3
|
-
import { g as getRectByTaro } from './
|
|
4
|
-
import { T as Toast } from './toast.taro-
|
|
5
|
-
import { u as useConfig } from './configprovider.taro-
|
|
2
|
+
import { u as useTouch } from './use-touch-db24bb5c.js';
|
|
3
|
+
import { g as getRectByTaro } from './use-client-rect-1f8ed1fe.js';
|
|
4
|
+
import { T as Toast } from './toast.taro-e4f44812.js';
|
|
5
|
+
import { u as useConfig } from './configprovider.taro-c8c54556.js';
|
|
6
6
|
|
|
7
7
|
const defaultProps = {
|
|
8
8
|
range: false,
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React__default, { useState, useEffect } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { StarFillN } from '@nutui/icons-react-taro';
|
|
4
|
+
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
5
|
+
import { u as usePropsValue } from './use-props-value-ae7ee726.js';
|
|
6
|
+
|
|
7
|
+
const defaultProps = {
|
|
8
|
+
...ComponentDefaults,
|
|
9
|
+
count: 5,
|
|
10
|
+
min: 0,
|
|
11
|
+
checkedIcon: null,
|
|
12
|
+
uncheckedIcon: null,
|
|
13
|
+
disabled: false,
|
|
14
|
+
readOnly: false,
|
|
15
|
+
allowHalf: false,
|
|
16
|
+
};
|
|
17
|
+
const Rate = (props) => {
|
|
18
|
+
const { className, style, count, value, defaultValue, min, checkedIcon, uncheckedIcon, disabled, readOnly, allowHalf, onChange, } = {
|
|
19
|
+
...defaultProps,
|
|
20
|
+
...props,
|
|
21
|
+
};
|
|
22
|
+
const classPrefix = 'nut-rate';
|
|
23
|
+
const [countArray, setCountArray] = useState([1, 2, 3, 4, 5]);
|
|
24
|
+
const [score, setScore] = usePropsValue({
|
|
25
|
+
value,
|
|
26
|
+
defaultValue: Math.max(defaultValue || 0, min),
|
|
27
|
+
finalValue: 0,
|
|
28
|
+
onChange,
|
|
29
|
+
});
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
const tmp = [];
|
|
32
|
+
for (let i = 1; i <= Number(count); i++) {
|
|
33
|
+
tmp.push(i);
|
|
34
|
+
}
|
|
35
|
+
setCountArray(tmp);
|
|
36
|
+
}, [count]);
|
|
37
|
+
const renderIcon = (n) => {
|
|
38
|
+
return n <= score
|
|
39
|
+
? checkedIcon || React__default.createElement(StarFillN, null)
|
|
40
|
+
: uncheckedIcon ||
|
|
41
|
+
(checkedIcon ? (React__default.cloneElement(checkedIcon, {
|
|
42
|
+
color: undefined,
|
|
43
|
+
})) : (React__default.createElement(StarFillN, null)));
|
|
44
|
+
};
|
|
45
|
+
const onClick = (e, index) => {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
e.stopPropagation();
|
|
48
|
+
if (disabled || readOnly)
|
|
49
|
+
return;
|
|
50
|
+
let value = 0;
|
|
51
|
+
if (!(index === 1 && score === index)) {
|
|
52
|
+
value = index;
|
|
53
|
+
}
|
|
54
|
+
value = Math.max(value, min);
|
|
55
|
+
setScore(value);
|
|
56
|
+
};
|
|
57
|
+
const onHalfClick = (event, n) => {
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
event.stopPropagation();
|
|
60
|
+
const value = Math.max(min, n - 0.5);
|
|
61
|
+
setScore(value);
|
|
62
|
+
};
|
|
63
|
+
return (React__default.createElement("div", { className: classNames(classPrefix, className, {
|
|
64
|
+
disabled,
|
|
65
|
+
readonly: readOnly,
|
|
66
|
+
}), style: style }, countArray.map((n) => {
|
|
67
|
+
return (React__default.createElement("div", { className: `${classPrefix}-item`, key: n, onClick: (event) => onClick(event, n) },
|
|
68
|
+
React__default.createElement("div", { className: classNames(`${classPrefix}-item__icon`, {
|
|
69
|
+
[`${classPrefix}-item__icon--disabled`]: disabled || n > score,
|
|
70
|
+
}) }, renderIcon(n)),
|
|
71
|
+
allowHalf && score > n - 1 && (React__default.createElement("div", { className: classNames(`${classPrefix}-item__half`, `${classPrefix}-item__icon`, `${classPrefix}-item__icon--half`), onClick: (event) => onHalfClick(event, n) }, renderIcon(n)))));
|
|
72
|
+
})));
|
|
73
|
+
};
|
|
74
|
+
Rate.defaultProps = defaultProps;
|
|
75
|
+
Rate.displayName = 'NutRate';
|
|
76
|
+
|
|
77
|
+
export { Rate as R };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React__default, { useRef, useState, useEffect } from 'react';
|
|
2
2
|
import { getEnv } from '@tarojs/taro';
|
|
3
|
+
import { Search, CircleClose } from '@nutui/icons-react-taro';
|
|
3
4
|
import { c as cn } from './bem-350c1702.js';
|
|
4
|
-
import { u as useConfig } from './configprovider.taro-
|
|
5
|
-
import {
|
|
6
|
-
import { C as ComponentDefaults } from './typings-b9828dba.js';
|
|
5
|
+
import { u as useConfig } from './configprovider.taro-c8c54556.js';
|
|
6
|
+
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
7
7
|
|
|
8
8
|
const defaultProps = {
|
|
9
9
|
...ComponentDefaults,
|
|
@@ -12,19 +12,19 @@ const defaultProps = {
|
|
|
12
12
|
disabled: false,
|
|
13
13
|
maxLength: 9999,
|
|
14
14
|
clearable: true,
|
|
15
|
-
|
|
15
|
+
clearSize: '12px',
|
|
16
16
|
align: 'left',
|
|
17
17
|
readonly: true,
|
|
18
18
|
autoFocus: false,
|
|
19
19
|
label: '',
|
|
20
|
-
leftinIcon: React__default.createElement(
|
|
20
|
+
leftinIcon: React__default.createElement(Search, { size: "12" }),
|
|
21
21
|
};
|
|
22
22
|
const SearchBar = (props) => {
|
|
23
23
|
const searchbarBem = cn('searchbar');
|
|
24
24
|
const { locale } = useConfig();
|
|
25
25
|
const searchRef = useRef(null);
|
|
26
26
|
const [value, setValue] = useState(() => props.value);
|
|
27
|
-
const { placeholder, shape, className, disabled, maxLength, clearable,
|
|
27
|
+
const { placeholder, shape, className, disabled, maxLength, clearable, clearSize, align, readOnly, autoFocus, label, actionText, leftinIcon, rightinIcon, leftoutIcon, rightoutIcon, onChange, onFocus, onBlur, onClear, onCancel, onSearch, onClickInput, onClickLeftinIcon, onClickLeftoutIcon, onClickRightinIcon, onClickRightoutIcon, } = {
|
|
28
28
|
...defaultProps,
|
|
29
29
|
...props,
|
|
30
30
|
};
|
|
@@ -99,7 +99,7 @@ const SearchBar = (props) => {
|
|
|
99
99
|
};
|
|
100
100
|
const handleClear = () => {
|
|
101
101
|
return (React__default.createElement("div", { className: `${searchbarBem('clear')} ${rightinIcon ? 'pos-right' : ''}`, onClick: (e) => clearaVal(e) },
|
|
102
|
-
React__default.createElement(
|
|
102
|
+
React__default.createElement(CircleClose, { size: clearSize, color: "#555" })));
|
|
103
103
|
};
|
|
104
104
|
const clearaVal = (event) => {
|
|
105
105
|
if (disabled || readOnly) {
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import React__default, { useRef, useState, useEffect } from 'react';
|
|
2
|
+
import { Tips } from '@nutui/icons-react-taro';
|
|
2
3
|
import { c as cn } from './bem-350c1702.js';
|
|
3
|
-
import { P as Popup } from './popup.taro-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { C as ComponentDefaults } from './typings-b9828dba.js';
|
|
4
|
+
import { P as Popup } from './popup.taro-124b9bab.js';
|
|
5
|
+
import { u as useConfig } from './configprovider.taro-c8c54556.js';
|
|
6
|
+
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
7
7
|
|
|
8
8
|
const defaultProps = {
|
|
9
9
|
...ComponentDefaults,
|
|
10
10
|
title: '',
|
|
11
|
-
|
|
11
|
+
description: '',
|
|
12
12
|
tips: '',
|
|
13
|
+
tipsIcon: null,
|
|
14
|
+
iconSize: 11,
|
|
13
15
|
visible: false,
|
|
14
16
|
modelValue: '',
|
|
15
17
|
errorMsg: '',
|
|
@@ -27,7 +29,7 @@ const defaultProps = {
|
|
|
27
29
|
};
|
|
28
30
|
const ShortPassword = (props) => {
|
|
29
31
|
const { locale } = useConfig();
|
|
30
|
-
const { title,
|
|
32
|
+
const { title, description, tips, tipsIcon, iconSize, visible, modelValue, errorMsg, noButton, closeOnClickOverlay, length, style, className, onChange, onOk, onTips, onCancel, onClose, onComplete, autoFocus, ...reset } = props;
|
|
31
33
|
const b = cn('shortpassword');
|
|
32
34
|
const textInput = useRef(null);
|
|
33
35
|
const range = (val) => {
|
|
@@ -81,6 +83,12 @@ const ShortPassword = (props) => {
|
|
|
81
83
|
const sure = () => {
|
|
82
84
|
onOk && onOk(inputValue);
|
|
83
85
|
};
|
|
86
|
+
const renderIcon = (size = '11px') => {
|
|
87
|
+
return React__default.isValidElement(tipsIcon) ? (React__default.cloneElement(tipsIcon, {
|
|
88
|
+
...tipsIcon.props,
|
|
89
|
+
size,
|
|
90
|
+
})) : (React__default.createElement(Tips, { size: size }));
|
|
91
|
+
};
|
|
84
92
|
return (React__default.createElement("div", null,
|
|
85
93
|
React__default.createElement(Popup, { style: {
|
|
86
94
|
padding: '32px 24px 28px 24px',
|
|
@@ -89,7 +97,7 @@ const ShortPassword = (props) => {
|
|
|
89
97
|
}, visible: innerVisible, closeable: true, "close-on-click-overlay": closeOnClickOverlay, onClickOverlay: onClose, onClickCloseIcon: onClose },
|
|
90
98
|
React__default.createElement("div", { className: `${b()} ${className}`, style: { ...style }, ...reset },
|
|
91
99
|
React__default.createElement("div", { className: b('title') }, title || locale.shortpassword.title),
|
|
92
|
-
React__default.createElement("div", { className: b('subtitle') },
|
|
100
|
+
React__default.createElement("div", { className: b('subtitle') }, description || locale.shortpassword.description),
|
|
93
101
|
React__default.createElement("div", { className: b('input') },
|
|
94
102
|
React__default.createElement("input", { ref: textInput, className: b('input-real'), type: "number", style: systemStyle(), maxLength: 6, value: inputValue, autoFocus: autoFocus, onChange: (e) => changeValue(e) }),
|
|
95
103
|
React__default.createElement("div", { className: b('input-site') }),
|
|
@@ -99,8 +107,8 @@ const ShortPassword = (props) => {
|
|
|
99
107
|
React__default.createElement("div", { className: b('message') },
|
|
100
108
|
React__default.createElement("div", { className: b('message__error') }, errorMsg),
|
|
101
109
|
tips || locale.shortpassword.tips ? (React__default.createElement("div", { className: b('message__forget') },
|
|
102
|
-
|
|
103
|
-
React__default.createElement("div", { onClick: onTips }, tips || locale.shortpassword.tips))) : null),
|
|
110
|
+
renderIcon(iconSize),
|
|
111
|
+
React__default.createElement("div", { className: b('message__forget-tips'), onClick: onTips }, tips || locale.shortpassword.tips))) : null),
|
|
104
112
|
!noButton ? (React__default.createElement("div", { className: b('footer') },
|
|
105
113
|
React__default.createElement("div", { className: b('footer__cancel'), onClick: onCancel }, locale.cancel),
|
|
106
114
|
React__default.createElement("div", { className: b('footer__sure'), onClick: () => sure() }, locale.confirm))) : null))));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useState } from 'react';
|
|
2
|
-
import { u as useConfig } from './configprovider.taro-
|
|
3
|
-
import { P as Popup } from './popup.taro-
|
|
2
|
+
import { u as useConfig } from './configprovider.taro-c8c54556.js';
|
|
3
|
+
import { P as Popup } from './popup.taro-124b9bab.js';
|
|
4
4
|
import { O as OffsetContext } from './offsetContext-c2a746fa.js';
|
|
5
5
|
|
|
6
6
|
const defaultProps = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
|
|
3
3
|
const SideNavBarItem = (props) => {
|
|
4
|
-
const { title,
|
|
4
|
+
const { title, key, children, onClick, ...rest } = props;
|
|
5
5
|
const clickFn = (e) => {
|
|
6
6
|
e.stopPropagation();
|
|
7
|
-
onClick && onClick({ title,
|
|
7
|
+
onClick && onClick({ title, key });
|
|
8
8
|
};
|
|
9
9
|
return (React__default.createElement("div", { className: "nut-subsidenavbar__item border-bt", onClick: clickFn, ...rest }, title));
|
|
10
10
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React__default, { useRef, useState, useEffect } from 'react';
|
|
2
2
|
import { getEnv, nextTick, createSelectorQuery, canvasToTempFilePath } from '@tarojs/taro';
|
|
3
|
-
import { B as Button } from './button.taro-
|
|
3
|
+
import { B as Button } from './button.taro-a1c9512f.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-c8c54556.js';
|
|
6
6
|
|
|
7
7
|
/* eslint-disable react/no-unknown-property */
|
|
8
8
|
const defaultProps = {
|
|
@@ -2,8 +2,7 @@ import React__default, { useContext } from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { D as DataContext } from './UserContext-e402e1a6.js';
|
|
4
4
|
import { c as cn } from './bem-350c1702.js';
|
|
5
|
-
import {
|
|
6
|
-
import { C as ComponentDefaults } from './typings-b9828dba.js';
|
|
5
|
+
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
7
6
|
|
|
8
7
|
const defaultProps = {
|
|
9
8
|
...ComponentDefaults,
|
|
@@ -11,11 +10,9 @@ const defaultProps = {
|
|
|
11
10
|
content: '',
|
|
12
11
|
activeIndex: 0,
|
|
13
12
|
icon: '',
|
|
14
|
-
iconColor: '',
|
|
15
|
-
size: '12px',
|
|
16
13
|
};
|
|
17
14
|
const Step = (props) => {
|
|
18
|
-
const { children, title, content, activeIndex, icon,
|
|
15
|
+
const { children, title, content, activeIndex, icon, className, renderContent, ...restProps } = {
|
|
19
16
|
...defaultProps,
|
|
20
17
|
...props,
|
|
21
18
|
};
|
|
@@ -47,7 +44,9 @@ const Step = (props) => {
|
|
|
47
44
|
return (React__default.createElement("div", { className: classes, ...restProps, onClick: handleClickStep },
|
|
48
45
|
React__default.createElement("div", { className: "nut-step-head" },
|
|
49
46
|
React__default.createElement("div", { className: "nut-step-line" }),
|
|
50
|
-
React__default.createElement("div", { className: renderIconClass() },
|
|
47
|
+
React__default.createElement("div", { className: renderIconClass() }, React__default.isValidElement(icon)
|
|
48
|
+
? icon
|
|
49
|
+
: !dot && React__default.createElement("span", { className: "nut-step-inner" }, activeIndex))),
|
|
51
50
|
React__default.createElement("div", { className: "nut-step-main" },
|
|
52
51
|
React__default.createElement("span", { className: "nut-step-title" }, title),
|
|
53
52
|
content && React__default.createElement("span", { className: "nut-step-content" }, content),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React__default, { useRef, useEffect, useState, useMemo, useCallback } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { getEnv, usePageScroll, getSystemInfoSync } from '@tarojs/taro';
|
|
4
|
-
import {
|
|
4
|
+
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
5
|
+
import { g as getRectByTaro } from './use-client-rect-1f8ed1fe.js';
|
|
5
6
|
import { g as getScrollParent } from './get-scroll-parent-b4a07e65.js';
|
|
6
|
-
import { c as cn } from './bem-350c1702.js';
|
|
7
7
|
|
|
8
8
|
function useWatch(dep, callback, config = { immediate: false }) {
|
|
9
9
|
const { immediate } = config;
|
|
@@ -31,17 +31,15 @@ function useWatch(dep, callback, config = { immediate: false }) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
const defaultProps = {
|
|
34
|
+
...ComponentDefaults,
|
|
34
35
|
position: 'top',
|
|
35
|
-
top: 0,
|
|
36
|
-
bottom: 0,
|
|
37
36
|
zIndex: 2000,
|
|
38
37
|
};
|
|
39
|
-
const
|
|
38
|
+
const classPrefix = 'nut-sticky';
|
|
40
39
|
const Sticky = (props) => {
|
|
41
|
-
const { position
|
|
40
|
+
const { position, zIndex, threshold, style, children, container, className, onChange, ...rest } = { ...defaultProps, ...props };
|
|
42
41
|
const stickyRef = useRef(null);
|
|
43
42
|
const rootRef = useRef(null);
|
|
44
|
-
const offset = position === 'top' ? top : bottom;
|
|
45
43
|
const [rootRect, setRootRect] = useState({});
|
|
46
44
|
const [fixed, setFixed] = useState(false);
|
|
47
45
|
const [transform, setTransform] = useState(0); // 相对容器偏移距离
|
|
@@ -72,13 +70,13 @@ const Sticky = (props) => {
|
|
|
72
70
|
[position]: '',
|
|
73
71
|
};
|
|
74
72
|
}
|
|
75
|
-
|
|
73
|
+
const style = {};
|
|
76
74
|
if (rootRect.height)
|
|
77
75
|
style.height = rootRect.height;
|
|
78
76
|
if (rootRect.width)
|
|
79
77
|
style.width = rootRect.width;
|
|
80
78
|
style.transform = `translate3d(0, ${transform}px, 0)`;
|
|
81
|
-
style[position] =
|
|
79
|
+
style[position] = threshold;
|
|
82
80
|
style.zIndex = zIndex;
|
|
83
81
|
return style;
|
|
84
82
|
}, [fixed, rootRect.height, rootRect.width, transform, position]);
|
|
@@ -90,19 +88,19 @@ const Sticky = (props) => {
|
|
|
90
88
|
if (position === 'top') {
|
|
91
89
|
if (container) {
|
|
92
90
|
const containerRect = await getRectByTaro(container.current);
|
|
93
|
-
const difference = containerRect.bottom -
|
|
91
|
+
const difference = containerRect.bottom - threshold - curRootRect.height;
|
|
94
92
|
const curTransform = difference < 0 ? difference : 0;
|
|
95
93
|
setTransform(curTransform);
|
|
96
|
-
const curFixed =
|
|
94
|
+
const curFixed = threshold > curRootRect.top && containerRect.bottom > 0;
|
|
97
95
|
setFixed(curFixed);
|
|
98
96
|
}
|
|
99
97
|
else {
|
|
100
|
-
setFixed(
|
|
98
|
+
setFixed(threshold > curRootRect.top);
|
|
101
99
|
}
|
|
102
100
|
}
|
|
103
101
|
else {
|
|
104
102
|
const windowHeight = getSystemInfoSync().windowHeight;
|
|
105
|
-
setFixed(windowHeight -
|
|
103
|
+
setFixed(windowHeight - threshold < curRootRect.bottom);
|
|
106
104
|
}
|
|
107
105
|
}
|
|
108
106
|
else {
|
|
@@ -127,10 +125,10 @@ const Sticky = (props) => {
|
|
|
127
125
|
handleScroll(res.scrollTop);
|
|
128
126
|
}
|
|
129
127
|
});
|
|
130
|
-
return (React__default.createElement("div", { ref: rootRef, style: rootStyle, className: classNames(
|
|
131
|
-
React__default.createElement("div", {
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
return (React__default.createElement("div", { ref: rootRef, style: rootStyle, className: classNames(classPrefix, className), ...rest },
|
|
129
|
+
React__default.createElement("div", { className: classNames('nut-sticky--box', {
|
|
130
|
+
'nut-sticky--fixed': fixed,
|
|
131
|
+
}), ref: stickyRef, style: stickyStyle }, children)));
|
|
134
132
|
};
|
|
135
133
|
Sticky.defaultProps = defaultProps;
|
|
136
134
|
Sticky.displayName = 'NutSticky';
|
|
@@ -5,7 +5,7 @@ const defaultProps = {
|
|
|
5
5
|
open: true,
|
|
6
6
|
};
|
|
7
7
|
const SubSideNavBar = (props) => {
|
|
8
|
-
const { title,
|
|
8
|
+
const { title, key, children, onClick, open, ...rest } = {
|
|
9
9
|
...defaultProps,
|
|
10
10
|
...props,
|
|
11
11
|
};
|
|
@@ -41,7 +41,7 @@ const SubSideNavBar = (props) => {
|
|
|
41
41
|
e.stopPropagation();
|
|
42
42
|
setSubShow(!subShow);
|
|
43
43
|
const isShow = !subShow;
|
|
44
|
-
onClick && onClick({ title,
|
|
44
|
+
onClick && onClick({ title, key, isShow });
|
|
45
45
|
};
|
|
46
46
|
useEffect(() => {
|
|
47
47
|
const childNodes = listRef.current?.children;
|
|
@@ -2,8 +2,8 @@ import React__default, { forwardRef, useRef, useState, useMemo, useImperativeHan
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { useReady, nextTick } from '@tarojs/taro';
|
|
4
4
|
import { c as cn } from './bem-350c1702.js';
|
|
5
|
-
import { u as useTouch } from './
|
|
6
|
-
import { g as getRectByTaro } from './
|
|
5
|
+
import { u as useTouch } from './use-touch-db24bb5c.js';
|
|
6
|
+
import { g as getRectByTaro } from './use-client-rect-1f8ed1fe.js';
|
|
7
7
|
|
|
8
8
|
function preventDefault(event, isStopPropagation) {
|
|
9
9
|
if (typeof event.cancelable !== 'boolean' || event.cancelable) {
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import React__default, { useEffect } from 'react';
|
|
2
2
|
import Taro from '@tarojs/taro';
|
|
3
3
|
import { c as cn } from './bem-350c1702.js';
|
|
4
|
-
import {
|
|
5
|
-
import { C as ComponentDefaults } from './typings-b9828dba.js';
|
|
4
|
+
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
6
5
|
|
|
7
6
|
const defaultProps = {
|
|
8
7
|
...ComponentDefaults,
|
|
9
8
|
dot: false,
|
|
10
|
-
size: '',
|
|
11
|
-
iconSize: '',
|
|
12
9
|
className: '',
|
|
13
10
|
tabTitle: '',
|
|
14
|
-
icon:
|
|
11
|
+
icon: null,
|
|
15
12
|
href: '',
|
|
16
13
|
to: '',
|
|
17
14
|
num: '',
|
|
@@ -22,7 +19,7 @@ const defaultProps = {
|
|
|
22
19
|
handleClick: (idx) => { },
|
|
23
20
|
};
|
|
24
21
|
const TabbarItem = (props) => {
|
|
25
|
-
const { dot,
|
|
22
|
+
const { dot, className, style, tabTitle, icon, href, to, num, active, activeColor, unactiveColor, index, handleClick, } = {
|
|
26
23
|
...defaultProps,
|
|
27
24
|
...props,
|
|
28
25
|
};
|
|
@@ -49,7 +46,7 @@ const TabbarItem = (props) => {
|
|
|
49
46
|
!dot ? (React__default.createElement(React__default.Fragment, null,
|
|
50
47
|
num && num <= 99 && (React__default.createElement("div", { className: `${bIcon('tips', [bIcon('num')])}` }, num)),
|
|
51
48
|
num && num >= 100 && (React__default.createElement("div", { className: `${bIcon('tips', [bIcon('nums')])}` }, "99+")))) : (React__default.createElement("div", { className: `${bIcon('tips', [bIcon('dot')])}` })),
|
|
52
|
-
icon
|
|
49
|
+
icon || null),
|
|
53
50
|
tabTitle && (React__default.createElement("div", { className: bIcon({ 'nav-word': true }, [
|
|
54
51
|
bIcon({ 'big-word': !icon }),
|
|
55
52
|
]) }, tabTitle))));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React__default, { useState, useEffect } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
+
import { DownArrow } from '@nutui/icons-react-taro';
|
|
3
4
|
import { c as cn } from './bem-350c1702.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { C as ComponentDefaults } from './typings-b9828dba.js';
|
|
5
|
+
import { u as useConfig } from './configprovider.taro-c8c54556.js';
|
|
6
|
+
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
7
7
|
|
|
8
8
|
const defaultProps = {
|
|
9
9
|
...ComponentDefaults,
|
|
@@ -14,12 +14,13 @@ const defaultProps = {
|
|
|
14
14
|
bordered: true,
|
|
15
15
|
striped: false,
|
|
16
16
|
noData: '无数据',
|
|
17
|
+
sorterIcon: null,
|
|
17
18
|
showHeader: true,
|
|
18
19
|
};
|
|
19
20
|
const Table = (props) => {
|
|
20
21
|
const { locale } = useConfig();
|
|
21
22
|
defaultProps.noData = locale.noData;
|
|
22
|
-
const { children, className, style, columns, data, bordered, summary, striped, noData,
|
|
23
|
+
const { children, className, style, columns, data, bordered, summary, striped, noData, sorterIcon, onSorter, showHeader, ...rest } = {
|
|
23
24
|
...defaultProps,
|
|
24
25
|
...props,
|
|
25
26
|
};
|
|
@@ -56,7 +57,8 @@ const Table = (props) => {
|
|
|
56
57
|
return columns.map((item, index) => {
|
|
57
58
|
return (React__default.createElement("span", { className: classNames('nut-table__main__head__tr__th', cellClasses(item)), key: item.key, onClick: () => handleSorterClick(item) },
|
|
58
59
|
item.title,
|
|
59
|
-
|
|
60
|
+
"\u00A0",
|
|
61
|
+
item.sorter && (sorterIcon || React__default.createElement(DownArrow, { size: "12px" }))));
|
|
60
62
|
});
|
|
61
63
|
};
|
|
62
64
|
const sortDataItem = () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
+
import { JoySmile } from '@nutui/icons-react-taro';
|
|
3
4
|
import { c as cn } from './bem-350c1702.js';
|
|
4
|
-
import {
|
|
5
|
-
import { C as ComponentDefaults } from './typings-b9828dba.js';
|
|
5
|
+
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
6
6
|
import { T as TabPane } from './tabpane.taro-4ca340ef.js';
|
|
7
7
|
|
|
8
8
|
class Title {
|
|
@@ -33,7 +33,7 @@ const pxCheck = (value) => {
|
|
|
33
33
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
34
34
|
};
|
|
35
35
|
const Tabs = (props) => {
|
|
36
|
-
const { value, color, tabStyle, background, direction, type, titleScroll, ellipsis, animatedTime, titleGutter, size, leftAlign, titleNode, children, onClick, onChange, className, autoHeight,
|
|
36
|
+
const { value, color, tabStyle, background, direction, type, titleScroll, ellipsis, animatedTime, titleGutter, size, leftAlign, titleNode, children, onClick, onChange, className, autoHeight, ...rest } = {
|
|
37
37
|
...defaultProps,
|
|
38
38
|
...props,
|
|
39
39
|
};
|
|
@@ -107,7 +107,7 @@ const Tabs = (props) => {
|
|
|
107
107
|
}, `${b('')}__titles-item`), key: item.paneKey },
|
|
108
108
|
type === 'line' && (React__default.createElement("div", { className: `${b('')}__titles-item__line`, style: tabsActiveStyle })),
|
|
109
109
|
type === 'smile' && (React__default.createElement("div", { className: `${b('')}__titles-item__smile`, style: tabsActiveStyle },
|
|
110
|
-
React__default.createElement(
|
|
110
|
+
React__default.createElement(JoySmile, { color: color }))),
|
|
111
111
|
React__default.createElement("div", { className: classNames({
|
|
112
112
|
ellipsis: ellipsis &&
|
|
113
113
|
!titleScroll &&
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useState, useEffect } from 'react';
|
|
2
|
+
import { Close } from '@nutui/icons-react-taro';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
|
-
import {
|
|
4
|
-
import { C as ComponentDefaults } from './typings-b9828dba.js';
|
|
4
|
+
import { C as ComponentDefaults } from './typings-d8491423.js';
|
|
5
5
|
|
|
6
6
|
const defaultProps = {
|
|
7
7
|
...ComponentDefaults,
|
|
@@ -12,13 +12,13 @@ const defaultProps = {
|
|
|
12
12
|
round: false,
|
|
13
13
|
mark: false,
|
|
14
14
|
closeable: false,
|
|
15
|
-
|
|
15
|
+
closeIcon: null,
|
|
16
16
|
prefixCls: 'nut-tag',
|
|
17
17
|
onClose: (e) => { },
|
|
18
18
|
onClick: (e) => { },
|
|
19
19
|
};
|
|
20
20
|
const Tag = (props) => {
|
|
21
|
-
const { className, style, color, plain, type, round, prefixCls, children, mark, closeable,
|
|
21
|
+
const { className, style, color, plain, type, round, prefixCls, children, mark, closeable, closeIcon, textColor, onClick, onClose, } = {
|
|
22
22
|
...defaultProps,
|
|
23
23
|
...props,
|
|
24
24
|
};
|
|
@@ -34,7 +34,6 @@ const Tag = (props) => {
|
|
|
34
34
|
round,
|
|
35
35
|
mark,
|
|
36
36
|
closeable,
|
|
37
|
-
iconSize,
|
|
38
37
|
prefixCls,
|
|
39
38
|
onClick,
|
|
40
39
|
onClose,
|
|
@@ -79,12 +78,13 @@ const Tag = (props) => {
|
|
|
79
78
|
};
|
|
80
79
|
return (React__default.createElement(React__default.Fragment, null, closeable ? (isTagShow && (React__default.createElement("div", { className: btnName, style: { ...style, ...getStyle() }, onClick: (e) => handleClick(e) },
|
|
81
80
|
children && React__default.createElement("span", { className: "nut-tag-text" }, children),
|
|
82
|
-
React__default.createElement(
|
|
81
|
+
React__default.isValidElement(closeIcon) ? (React__default.createElement("i", { className: "nut-tag-custom-icon", onClick: (e) => {
|
|
83
82
|
setIsTagShow(false);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
props.onClose && props.onClose(e);
|
|
84
|
+
} }, closeIcon)) : (React__default.createElement(Close, { size: 12, onClick: (e) => {
|
|
85
|
+
setIsTagShow(false);
|
|
86
|
+
props.onClose && props.onClose(e);
|
|
87
|
+
} }))))) : (React__default.createElement("div", { className: btnName, style: { ...style, ...getStyle() }, onClick: (e) => handleClick(e) }, children && React__default.createElement("span", { className: "nut-tag-text" }, children)))));
|
|
88
88
|
};
|
|
89
89
|
Tag.defaultProps = defaultProps;
|
|
90
90
|
Tag.displayName = 'NutTag';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
2
|
-
import { u as useConfig } from './configprovider.taro-
|
|
2
|
+
import { u as useConfig } from './configprovider.taro-c8c54556.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__default, { 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-c8c54556.js';
|
|
4
4
|
|
|
5
5
|
const defaultProps = {
|
|
6
6
|
className: '',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React__default, { useState, useEffect } from 'react';
|
|
2
|
-
import { P as Popup } from './popup.taro-
|
|
3
|
-
import { T as TimePannel } from './timepannel.taro-
|
|
4
|
-
import { T as TimeDetail } from './timedetail.taro-
|
|
2
|
+
import { P as Popup } from './popup.taro-124b9bab.js';
|
|
3
|
+
import { T as TimePannel } from './timepannel.taro-fd3d008d.js';
|
|
4
|
+
import { T as TimeDetail } from './timedetail.taro-fce4e614.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-c8c54556.js';
|
|
7
7
|
|
|
8
8
|
const defaultProps = {
|
|
9
9
|
className: '',
|
|
@@ -108,7 +108,7 @@ const TimeSelect = (props) => {
|
|
|
108
108
|
};
|
|
109
109
|
// 选中的日期增加 active 类名
|
|
110
110
|
const getTimePannelClass = (dataItem) => {
|
|
111
|
-
if (String(dataItem['
|
|
111
|
+
if (String(dataItem['paneKey']) === String(activeKey)) {
|
|
112
112
|
return 'nut-timepannel-active';
|
|
113
113
|
}
|
|
114
114
|
return '';
|
|
@@ -124,7 +124,7 @@ const TimeSelect = (props) => {
|
|
|
124
124
|
React__default.createElement("div", { className: `${b()} ${className || ''}` },
|
|
125
125
|
React__default.createElement("div", { className: "nut-timeselect__title" }, title),
|
|
126
126
|
React__default.createElement("div", { className: "nut-timeselect__content" },
|
|
127
|
-
React__default.createElement("div", { className: "nut-timeselect__content-left" }, dates.map((dataItem, index) => (React__default.createElement(TimePannel, { date: dataItem.date, className: getTimePannelClass(dataItem), key: String(dataItem['
|
|
127
|
+
React__default.createElement("div", { className: "nut-timeselect__content-left" }, dates.map((dataItem, index) => (React__default.createElement(TimePannel, { date: dataItem.date, className: getTimePannelClass(dataItem), key: String(dataItem['paneKey'] || index), curKey: String(dataItem['paneKey'] || index), change: handleChange })))),
|
|
128
128
|
React__default.createElement(TimeDetail, { times: times, currentKey: String(activeKey), currentTime: activeTime, select: handleSelectTime }))))));
|
|
129
129
|
};
|
|
130
130
|
TimeSelect.defaultProps = defaultProps;
|