@nutui/nutui-react-taro 2.0.0-alpha.5 → 2.0.0-alpha.6
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 +14 -0
- package/dist/esm/ActionSheet.js +15 -16
- package/dist/esm/Address.js +19 -20
- package/dist/esm/Animate.js +7 -8
- package/dist/esm/AnimatingNumbers.js +8 -9
- package/dist/esm/Audio.js +17 -19
- package/dist/esm/Avatar.js +11 -13
- package/dist/esm/AvatarGroup.js +8 -9
- package/dist/esm/BackTop.js +9 -10
- package/dist/esm/Badge.js +7 -8
- package/dist/esm/Barrage.js +9 -10
- package/dist/esm/Button.js +8 -9
- package/dist/esm/Calendar.js +18 -20
- package/dist/esm/CalendarItem.js +11 -13
- package/dist/esm/Card.js +12 -13
- package/dist/esm/Cascader.js +16 -19
- package/dist/esm/Cell.js +7 -8
- package/dist/esm/CellGroup.js +7 -8
- package/dist/esm/Checkbox.js +9 -10
- package/dist/esm/CheckboxGroup.js +9 -10
- package/dist/esm/CircleProgress.js +8 -9
- package/dist/esm/Col.js +8 -9
- package/dist/esm/Collapse.js +8 -9
- package/dist/esm/CollapseItem.js +7 -8
- package/dist/esm/ConfigProvider.js +9 -8
- package/dist/esm/CountDown.js +8 -10
- package/dist/esm/DatePicker.js +21 -23
- package/dist/esm/Dialog.js +13 -15
- package/dist/esm/Divider.js +7 -8
- package/dist/esm/Drag.js +7 -8
- package/dist/esm/Elevator.js +9 -10
- package/dist/esm/Ellipsis.js +9 -10
- package/dist/esm/Empty.js +7 -9
- package/dist/esm/FixedNav.js +11 -13
- package/dist/esm/Form.js +10 -11
- package/dist/esm/FormItem.js +8 -9
- package/dist/esm/Grid.js +8 -10
- package/dist/esm/GridItem.js +7 -9
- package/dist/esm/Image.js +7 -9
- package/dist/esm/ImagePreview.js +19 -20
- package/dist/esm/Indicator.js +6 -7
- package/dist/esm/Infiniteloading.js +12 -14
- package/dist/esm/Input.js +11 -13
- package/dist/esm/InputNumber.js +9 -10
- package/dist/esm/Layout.js +5 -6
- package/dist/esm/Menu.js +8 -9
- package/dist/esm/MenuItem.js +13 -14
- package/dist/esm/NavBar.js +7 -8
- package/dist/esm/NoticeBar.js +11 -12
- package/dist/esm/Notify.js +9 -10
- package/dist/esm/NumberKeyboard.js +16 -18
- package/dist/esm/Overlay.js +8 -9
- package/dist/esm/Pagination.js +9 -11
- package/dist/esm/Picker.js +20 -22
- package/dist/esm/Popover.js +10 -11
- package/dist/esm/Popup.js +12 -13
- package/dist/esm/Price.js +7 -8
- package/dist/esm/Progress.js +7 -8
- package/dist/esm/PullToRefresh.js +11 -13
- package/dist/esm/Radio.js +9 -10
- package/dist/esm/RadioGroup.js +9 -10
- package/dist/esm/Range.js +13 -15
- package/dist/esm/Rate.js +9 -10
- package/dist/esm/Row.js +8 -9
- package/dist/esm/SearchBar.js +11 -13
- package/dist/esm/ShortPassword.js +16 -18
- package/dist/esm/SideNavBar.js +14 -15
- package/dist/esm/SideNavBarItem.js +5 -6
- package/dist/esm/Signature.js +13 -15
- package/dist/esm/Skeleton.js +14 -16
- package/dist/esm/Step.js +10 -11
- package/dist/esm/Steps.js +9 -10
- package/dist/esm/Sticky.js +11 -12
- package/dist/esm/SubSideNavBar.js +6 -7
- package/dist/esm/Swipe.js +11 -12
- package/dist/esm/Swiper.js +10 -11
- package/dist/esm/SwiperItem.js +9 -10
- package/dist/esm/Switch.js +7 -8
- package/dist/esm/TabPane.js +6 -7
- package/dist/esm/Tabbar.js +10 -11
- package/dist/esm/TabbarItem.js +8 -9
- package/dist/esm/Table.js +9 -13
- package/dist/esm/Tabs.js +11 -12
- package/dist/esm/Tag.js +8 -9
- package/dist/esm/TextArea.js +11 -10
- package/dist/esm/TimeDetail.js +8 -10
- package/dist/esm/TimePannel.js +8 -10
- package/dist/esm/TimeSelect.js +18 -20
- package/dist/esm/Toast.js +9 -10
- package/dist/esm/TrendArrow.js +8 -9
- package/dist/esm/Uploader.js +14 -16
- package/dist/esm/UserContext-735db09f.js +5 -0
- package/dist/esm/UserContext-ab42ba7f.js +5 -0
- package/dist/esm/UserContext-fde5badc.js +5 -0
- package/dist/esm/Video.js +8 -9
- package/dist/esm/VirtualList.js +8 -10
- package/dist/esm/WaterMark.js +10 -12
- package/dist/esm/actionsheet.taro-d2217152.js +61 -0
- package/dist/esm/address.taro-1c534feb.js +470 -0
- package/dist/esm/animate.taro-c8b29242.js +44 -0
- package/dist/esm/animatingnumbers.taro-c2a52dbd.js +103 -0
- package/dist/esm/audio.taro-ec96ef80.js +185 -0
- package/dist/esm/avatar.taro-01536aff.js +100 -0
- package/dist/esm/avatargroup-ad5ffb46.js +34 -0
- package/dist/esm/backtop.taro-7de36464.js +48 -0
- package/dist/esm/badge.taro-872605bf.js +48 -0
- package/dist/esm/barrage.taro-c8cb9864.js +91 -0
- package/dist/esm/bem-cdccae08.js +5 -0
- package/dist/esm/button.taro-01eae688.js +72 -0
- package/dist/esm/calendar.taro-10a6cb11.js +70 -0
- package/dist/esm/calendaritem.taro-3e5f114e.js +732 -0
- package/dist/esm/can-use-dom-0e539bd3.js +4 -0
- package/dist/esm/card.taro-a46fdf25.js +51 -0
- package/dist/esm/cascader.taro-a8d2148e.js +463 -0
- package/dist/esm/cell.taro-4e31d1fa.js +48 -0
- package/dist/esm/cellgroup.taro-a790d91b.js +28 -0
- package/dist/esm/checkbox.taro-016074da.js +177 -0
- package/dist/esm/circleprogress.taro-7149e09d.js +104 -0
- package/dist/esm/col.taro-d6a46a7d.js +41 -0
- package/dist/esm/collapse.taro-3d997680.js +70 -0
- package/dist/esm/collapseitem-f4571575.js +76 -0
- package/dist/esm/configprovider.taro-25758d9f.js +462 -0
- package/dist/esm/context-d0fccf11.js +5 -0
- package/dist/esm/countdown.taro-22200811.js +210 -0
- package/dist/esm/datepicker.taro-3f718964.js +260 -0
- package/dist/esm/dialog.taro-290eb9a6.js +128 -0
- package/dist/esm/divider.taro-0cb5f894.js +31 -0
- package/dist/esm/drag.taro-48e1ff38.js +111 -0
- package/dist/esm/elevator.taro-bc162e4f.js +201 -0
- package/dist/esm/ellipsis.taro-f9688dd7.js +242 -0
- package/dist/esm/empty.taro-ca792f57.js +59 -0
- package/dist/esm/fixednav.taro-28e5f776.js +61 -0
- package/dist/esm/form.taro-b06754e8.js +182 -0
- package/dist/esm/formitem.taro-b326809d.js +108 -0
- package/dist/esm/get-scroll-parent-8da04f2e.js +24 -0
- package/dist/esm/grid.taro-fbbd8618.js +52 -0
- package/dist/esm/griditem.taro-b0c37077.js +85 -0
- package/dist/esm/image.taro-767aa000.js +65 -0
- package/dist/esm/imagepreview.taro-8832dc01.js +163 -0
- package/dist/esm/index-e3184f19.js +9 -0
- package/dist/esm/indicator.taro-f2bd212f.js +30 -0
- package/dist/esm/infiniteloading.taro-f8f23ac6.js +143 -0
- package/dist/esm/input.taro-27d686c9.js +164 -0
- package/dist/esm/inputnumber.taro-877dc947.js +197 -0
- package/dist/esm/layout.taro-9659a928.js +11 -0
- package/dist/esm/menu.taro-cd0fef41.js +122 -0
- package/dist/esm/menuitem.taro-6076bffa.js +142 -0
- package/dist/esm/navbar.taro-5e1a0835.js +61 -0
- package/dist/esm/noticebar.taro-b3bfd4fe.js +408 -0
- package/dist/esm/notify.taro-6b6eb6bf.js +82 -0
- package/dist/esm/numberkeyboard.taro-0a0e866a.js +183 -0
- package/dist/esm/nutui-react.es.js +211 -116
- package/dist/esm/offsetContext-f32a9246.js +5 -0
- package/dist/esm/overlay.taro-75012bd3.js +77 -0
- package/dist/esm/pagination.taro-63607c3b.js +94 -0
- package/dist/esm/picker.taro-a5603921.js +468 -0
- package/dist/esm/popover.taro-ad483372.js +162 -0
- package/dist/esm/popup.taro-e756f3fc.js +150 -0
- package/dist/esm/price.taro-c4f45310.js +80 -0
- package/dist/esm/progress.taro-ff63be75.js +49 -0
- package/dist/esm/pulltorefresh.taro-c611fd92.js +179 -0
- package/dist/esm/radio.taro-3a54f4c8.js +152 -0
- package/dist/esm/range.taro-52cda918.js +325 -0
- package/dist/esm/rate.taro-78c66969.js +77 -0
- package/dist/esm/row.taro-8b7febd4.js +48 -0
- package/dist/esm/searchbar.taro-37ade36e.js +159 -0
- package/dist/esm/shortpassword.taro-f7292032.js +146 -0
- package/dist/esm/sidenavbar.taro-9f210df4.js +51 -0
- package/dist/esm/sidenavbaritem.taro-32a45ce6.js +12 -0
- package/dist/esm/signature.taro-c57469aa.js +146 -0
- package/dist/esm/skeleton.taro-9ff9baf4.js +71 -0
- package/dist/esm/step.taro-3bc01c0c.js +66 -0
- package/dist/esm/steps.taro-77e301ab.js +30 -0
- package/dist/esm/sticky.taro-3c03eb0a.js +134 -0
- package/dist/esm/subsidenavbar.taro-abe07673.js +64 -0
- package/dist/esm/supports-passive-aaaf0eff.js +17 -0
- package/dist/esm/swipe.taro-de80fcd8.js +180 -0
- package/dist/esm/swiper.taro-74cf9306.js +430 -0
- package/dist/esm/swiperitem-80df464a.js +29 -0
- package/dist/esm/switch.taro-f0da73a3.js +44 -0
- package/dist/esm/tabbar.taro-18eee41f.js +55 -0
- package/dist/esm/tabbaritem.taro-89646ca1.js +47 -0
- package/dist/esm/table.taro-15a55c5d.js +100 -0
- package/dist/esm/tabpane.taro-f8d92ece.js +21 -0
- package/dist/esm/tabs.taro-56e46dd3.js +137 -0
- package/dist/esm/tag.taro-1b4134a5.js +92 -0
- package/dist/esm/textarea.taro-c110565e.js +102 -0
- package/dist/esm/timedetail.taro-8d2acbbf.js +41 -0
- package/dist/esm/timepannel.taro-ee4c5dfa.js +22 -0
- package/dist/esm/timeselect.taro-069deedd.js +133 -0
- package/dist/esm/toast.taro-92c10e1d.js +114 -0
- package/dist/esm/trendarrow.taro-0cf43935.js +72 -0
- package/dist/esm/typings-11d83a22.js +7 -0
- package/dist/esm/uploader.taro-92977813.js +519 -0
- package/dist/esm/use-client-rect-f317804e.js +10 -0
- package/dist/esm/use-props-value-7ac1b1b5.js +16 -0
- package/dist/esm/use-touch-ff43512c.js +69 -0
- package/dist/esm/video-5d106e33.js +73 -0
- package/dist/esm/virtuallist.taro-99f03769.js +195 -0
- package/dist/esm/watermark.taro-cef29c03.js +109 -0
- 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 +505 -447
- package/dist/nutui.react.umd.js +504 -446
- package/dist/packages/cascader/cascader.scss +0 -26
- package/dist/packages/picker/picker.scss +66 -137
- package/dist/packages/table/table.scss +0 -56
- package/dist/packages/textarea/textarea.scss +5 -12
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +1 -4
- package/dist/styles/variables.scss +2 -6
- package/dist/types/index.d.ts +42 -46
- package/package.json +1 -1
- package/dist/esm/UserContext-0aac9a82.js +0 -5
- package/dist/esm/UserContext-e402e1a6.js +0 -5
- package/dist/esm/UserContext-e8176108.js +0 -5
- package/dist/esm/actionsheet.taro-12cf5a3e.js +0 -53
- package/dist/esm/address.taro-cab0ea22.js +0 -475
- package/dist/esm/animate.taro-485331bb.js +0 -41
- package/dist/esm/animatingnumbers.taro-f6eaffef.js +0 -104
- package/dist/esm/audio.taro-ff280f5e.js +0 -162
- package/dist/esm/avatar.taro-6e8f1f5c.js +0 -107
- package/dist/esm/avatargroup-f4375806.js +0 -31
- package/dist/esm/backtop.taro-8ec80d02.js +0 -52
- package/dist/esm/badge.taro-e2169fbe.js +0 -45
- package/dist/esm/barrage.taro-aa08da6c.js +0 -94
- package/dist/esm/bem-350c1702.js +0 -5
- package/dist/esm/button.taro-b50bc217.js +0 -65
- package/dist/esm/calendar.taro-2fc9b899.js +0 -65
- package/dist/esm/calendaritem.taro-2d4a8c34.js +0 -791
- package/dist/esm/can-use-dom-3eeb5af4.js +0 -6
- package/dist/esm/card.taro-0e849e94.js +0 -33
- package/dist/esm/cascader.taro-467910b2.js +0 -447
- package/dist/esm/cell.taro-ea725a95.js +0 -43
- package/dist/esm/cellgroup.taro-e05ea802.js +0 -25
- package/dist/esm/checkbox.taro-9d02f86c.js +0 -175
- package/dist/esm/circleprogress.taro-d4943109.js +0 -103
- package/dist/esm/col.taro-4477c9f7.js +0 -43
- package/dist/esm/collapse.taro-89bcadf2.js +0 -79
- package/dist/esm/collapseitem-0e228cec.js +0 -68
- package/dist/esm/configprovider.taro-ce34d482.js +0 -174
- package/dist/esm/context-c96afdcc.js +0 -5
- package/dist/esm/countdown.taro-3118ba23.js +0 -225
- package/dist/esm/datepicker.taro-2e3e955b.js +0 -275
- package/dist/esm/dialog.taro-eab19eab.js +0 -107
- package/dist/esm/divider.taro-3993d7d5.js +0 -33
- package/dist/esm/drag.taro-347dfb84.js +0 -111
- package/dist/esm/elevator.taro-1a4e3356.js +0 -193
- package/dist/esm/ellipsis.taro-e1ac99a1.js +0 -244
- package/dist/esm/empty.taro-26363c66.js +0 -56
- package/dist/esm/fixednav.taro-ddb21e87.js +0 -54
- package/dist/esm/form.taro-423b0f0a.js +0 -179
- package/dist/esm/formitem.taro-b550d29c.js +0 -89
- package/dist/esm/get-scroll-parent-b4a07e65.js +0 -25
- package/dist/esm/grid.taro-883a9c35.js +0 -49
- package/dist/esm/griditem.taro-16c7055b.js +0 -80
- package/dist/esm/image.taro-3025e659.js +0 -64
- package/dist/esm/imagepreview.taro-d511342c.js +0 -167
- package/dist/esm/index-5bcb0ff8.js +0 -7
- package/dist/esm/indicator.taro-bfb21d45.js +0 -30
- package/dist/esm/infiniteloading.taro-721bca1f.js +0 -141
- package/dist/esm/input.taro-06c1e4d5.js +0 -167
- package/dist/esm/inputnumber.taro-1f893d42.js +0 -199
- package/dist/esm/layout.taro-e4bf83cb.js +0 -11
- package/dist/esm/menu.taro-e5c68cb8.js +0 -111
- package/dist/esm/menuitem.taro-37c18382.js +0 -129
- package/dist/esm/navbar.taro-92bab9c4.js +0 -57
- package/dist/esm/noticebar.taro-cbe93c9e.js +0 -427
- package/dist/esm/notify.taro-f1079218.js +0 -75
- package/dist/esm/numberkeyboard.taro-d9b1721b.js +0 -159
- package/dist/esm/offsetContext-c2a746fa.js +0 -5
- package/dist/esm/overlay.taro-067b7202.js +0 -73
- package/dist/esm/pagination.taro-94f9be5e.js +0 -91
- package/dist/esm/picker.taro-e16b4312.js +0 -423
- package/dist/esm/popover.taro-84a55ff9.js +0 -153
- package/dist/esm/popup.taro-89cc342a.js +0 -139
- package/dist/esm/price.taro-959d82f2.js +0 -83
- package/dist/esm/progress.taro-1a7ac8a4.js +0 -40
- package/dist/esm/pulltorefresh.taro-016d0079.js +0 -181
- package/dist/esm/radio.taro-36438449.js +0 -177
- package/dist/esm/range.taro-8953e8c3.js +0 -332
- package/dist/esm/rate.taro-895bb41c.js +0 -77
- package/dist/esm/row.taro-e929ec5c.js +0 -48
- package/dist/esm/searchbar.taro-4467040f.js +0 -152
- package/dist/esm/shortpassword.taro-433b86a4.js +0 -119
- package/dist/esm/sidenavbar.taro-f8ffb7dc.js +0 -33
- package/dist/esm/sidenavbaritem.taro-6cb0821e.js +0 -12
- package/dist/esm/signature.taro-a4d9b5c9.js +0 -143
- package/dist/esm/skeleton.taro-8ec11af9.js +0 -62
- package/dist/esm/step.taro-7ea33a76.js +0 -58
- package/dist/esm/steps.taro-86753d36.js +0 -30
- package/dist/esm/sticky.taro-a142a5f2.js +0 -136
- package/dist/esm/subsidenavbar.taro-85c03291.js +0 -63
- package/dist/esm/supports-passive-c85ef996.js +0 -18
- package/dist/esm/swipe.taro-0b8cc872.js +0 -175
- package/dist/esm/swiper.taro-c0e9a56b.js +0 -451
- package/dist/esm/swiperitem-abab7606.js +0 -29
- package/dist/esm/switch.taro-e82809f6.js +0 -38
- package/dist/esm/tabbar.taro-48413fb8.js +0 -51
- package/dist/esm/tabbaritem.taro-5afa3562.js +0 -37
- package/dist/esm/table.taro-327b4248.js +0 -95
- package/dist/esm/tabpane.taro-406cc0d3.js +0 -21
- package/dist/esm/tabs.taro-d47ccfc5.js +0 -120
- package/dist/esm/tag.taro-846ee805.js +0 -92
- package/dist/esm/textarea.taro-add72cf3.js +0 -94
- package/dist/esm/timedetail.taro-82a2900b.js +0 -44
- package/dist/esm/timepannel.taro-0573bb65.js +0 -22
- package/dist/esm/timeselect.taro-29124a34.js +0 -133
- package/dist/esm/toast.taro-c509a870.js +0 -108
- package/dist/esm/trendarrow.taro-dd83ec94.js +0 -70
- package/dist/esm/typings-d8491423.js +0 -6
- package/dist/esm/uploader.taro-c70d00de.js +0 -494
- package/dist/esm/use-client-rect-1f8ed1fe.js +0 -18
- package/dist/esm/use-props-value-ae7ee726.js +0 -15
- package/dist/esm/use-touch-db24bb5c.js +0 -69
- package/dist/esm/video-1c6405b4.js +0 -67
- package/dist/esm/virtuallist.taro-ba8e1f21.js +0 -214
- package/dist/esm/watermark.taro-168cdac5.js +0 -114
package/dist/nutui.react.mjs
CHANGED
|
@@ -5,13 +5,13 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
/*!
|
|
8
|
-
* @nutui/nutui-react-taro v2.0.0-alpha.
|
|
8
|
+
* @nutui/nutui-react-taro v2.0.0-alpha.6 Fri May 12 2023 15:11:28 GMT+0800 (China Standard Time)
|
|
9
9
|
* (c) 2023 @jdf2e.
|
|
10
10
|
* Released under the MIT License.
|
|
11
11
|
*/
|
|
12
12
|
import * as React from "react";
|
|
13
13
|
import React__default, { useCallback, createContext, useMemo, useContext, useState, useEffect, useRef, isValidElement, useImperativeHandle, forwardRef, useLayoutEffect, Component, memo } from "react";
|
|
14
|
-
import { View, ScrollView, Input as Input$1, Image as Image$2 } from "@tarojs/components";
|
|
14
|
+
import { View, ScrollView, PickerView, PickerViewColumn, Input as Input$1, Textarea, Image as Image$2 } from "@tarojs/components";
|
|
15
15
|
import Taro, { getEnv, usePageScroll, getSystemInfoSync, pageScrollTo, nextTick, createSelectorQuery, ENV_TYPE, canvasToTempFilePath, uploadFile, chooseMedia, chooseImage, useReady, createInnerAudioContext, getSystemInfo, createOffscreenCanvas } from "@tarojs/taro";
|
|
16
16
|
import ReactDOM, { createPortal, unstable_batchedUpdates } from "react-dom";
|
|
17
17
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
@@ -2747,7 +2747,7 @@ const ComponentDefaults = {
|
|
|
2747
2747
|
style: {}
|
|
2748
2748
|
};
|
|
2749
2749
|
const prefixCls = "nut-button";
|
|
2750
|
-
const defaultProps$
|
|
2750
|
+
const defaultProps$1u = {
|
|
2751
2751
|
...ComponentDefaults,
|
|
2752
2752
|
color: "",
|
|
2753
2753
|
type: "default",
|
|
@@ -2779,7 +2779,7 @@ const Button = React__default.forwardRef(
|
|
|
2779
2779
|
style,
|
|
2780
2780
|
...rest
|
|
2781
2781
|
} = {
|
|
2782
|
-
...defaultProps$
|
|
2782
|
+
...defaultProps$1u,
|
|
2783
2783
|
...props
|
|
2784
2784
|
};
|
|
2785
2785
|
const getStyle = useCallback(() => {
|
|
@@ -2838,7 +2838,7 @@ const Button = React__default.forwardRef(
|
|
|
2838
2838
|
}
|
|
2839
2839
|
);
|
|
2840
2840
|
Button.displayName = "NutButton";
|
|
2841
|
-
const defaultProps$
|
|
2841
|
+
const defaultProps$1t = {
|
|
2842
2842
|
...ComponentDefaults,
|
|
2843
2843
|
title: null,
|
|
2844
2844
|
description: null,
|
|
@@ -2862,7 +2862,7 @@ const Cell = (props) => {
|
|
|
2862
2862
|
style,
|
|
2863
2863
|
...rest
|
|
2864
2864
|
} = {
|
|
2865
|
-
...defaultProps$
|
|
2865
|
+
...defaultProps$1t,
|
|
2866
2866
|
...props
|
|
2867
2867
|
};
|
|
2868
2868
|
const handleClick = (event) => {
|
|
@@ -2901,9 +2901,9 @@ const Cell = (props) => {
|
|
|
2901
2901
|
}
|
|
2902
2902
|
);
|
|
2903
2903
|
};
|
|
2904
|
-
Cell.defaultProps = defaultProps$
|
|
2904
|
+
Cell.defaultProps = defaultProps$1t;
|
|
2905
2905
|
Cell.displayName = "NutCell";
|
|
2906
|
-
const defaultProps$
|
|
2906
|
+
const defaultProps$1s = {
|
|
2907
2907
|
...ComponentDefaults,
|
|
2908
2908
|
title: "",
|
|
2909
2909
|
description: "",
|
|
@@ -2912,7 +2912,7 @@ const defaultProps$1r = {
|
|
|
2912
2912
|
const classPrefix$e = "nut-cell-group";
|
|
2913
2913
|
const CellGroup = (props) => {
|
|
2914
2914
|
const { children, className, style, title, description, divider, ...rest } = {
|
|
2915
|
-
...defaultProps$
|
|
2915
|
+
...defaultProps$1s,
|
|
2916
2916
|
...props
|
|
2917
2917
|
};
|
|
2918
2918
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classNames(classPrefix$e, className), ...rest, children: [
|
|
@@ -2927,7 +2927,7 @@ const CellGroup = (props) => {
|
|
|
2927
2927
|
)
|
|
2928
2928
|
] });
|
|
2929
2929
|
};
|
|
2930
|
-
CellGroup.defaultProps = defaultProps$
|
|
2930
|
+
CellGroup.defaultProps = defaultProps$1s;
|
|
2931
2931
|
CellGroup.displayName = "NutCellGroup";
|
|
2932
2932
|
var INFINITY = 1 / 0;
|
|
2933
2933
|
var symbolTag = "[object Symbol]";
|
|
@@ -3342,7 +3342,7 @@ const zhCN = {
|
|
|
3342
3342
|
errorCanvasTips: "当前环境不支持Canvas"
|
|
3343
3343
|
}
|
|
3344
3344
|
};
|
|
3345
|
-
const defaultProps$
|
|
3345
|
+
const defaultProps$1r = {
|
|
3346
3346
|
locale: zhCN
|
|
3347
3347
|
};
|
|
3348
3348
|
const defaultConfigRef$1 = {
|
|
@@ -3365,7 +3365,7 @@ function convertThemeVarsToCSSVars(themeVars) {
|
|
|
3365
3365
|
return cssVars;
|
|
3366
3366
|
}
|
|
3367
3367
|
const ConfigProvider = (props) => {
|
|
3368
|
-
const { children, ...config2 } = { ...defaultProps$
|
|
3368
|
+
const { children, ...config2 } = { ...defaultProps$1r, ...props };
|
|
3369
3369
|
const parentConfig = useConfig$1();
|
|
3370
3370
|
const theme = config2.theme || {};
|
|
3371
3371
|
const style = useMemo(
|
|
@@ -3383,9 +3383,9 @@ const ConfigProvider = (props) => {
|
|
|
3383
3383
|
}
|
|
3384
3384
|
);
|
|
3385
3385
|
};
|
|
3386
|
-
ConfigProvider.defaultProps = defaultProps$
|
|
3386
|
+
ConfigProvider.defaultProps = defaultProps$1r;
|
|
3387
3387
|
ConfigProvider.displayName = "NutConfigProvider";
|
|
3388
|
-
const defaultProps$
|
|
3388
|
+
const defaultProps$1q = {
|
|
3389
3389
|
fit: "fill",
|
|
3390
3390
|
position: "center",
|
|
3391
3391
|
alt: "",
|
|
@@ -3416,7 +3416,7 @@ const Image$1 = (props) => {
|
|
|
3416
3416
|
onClick,
|
|
3417
3417
|
onLoad,
|
|
3418
3418
|
onError
|
|
3419
|
-
} = { ...defaultProps$
|
|
3419
|
+
} = { ...defaultProps$1q, ...props };
|
|
3420
3420
|
const [loading, setLoading] = useState(true);
|
|
3421
3421
|
const [isError, setIsError] = useState(false);
|
|
3422
3422
|
useEffect(() => {
|
|
@@ -3477,7 +3477,7 @@ const Image$1 = (props) => {
|
|
|
3477
3477
|
}
|
|
3478
3478
|
);
|
|
3479
3479
|
};
|
|
3480
|
-
Image$1.defaultProps = defaultProps$
|
|
3480
|
+
Image$1.defaultProps = defaultProps$1q;
|
|
3481
3481
|
Image$1.displayName = "NutImage";
|
|
3482
3482
|
const defaultOverlayProps = {
|
|
3483
3483
|
...ComponentDefaults,
|
|
@@ -3572,7 +3572,7 @@ const Overlay = (props) => {
|
|
|
3572
3572
|
Overlay.defaultProps = defaultOverlayProps;
|
|
3573
3573
|
Overlay.displayName = "NutOverlay";
|
|
3574
3574
|
const DataContext$2 = createContext({});
|
|
3575
|
-
const defaultProps$
|
|
3575
|
+
const defaultProps$1p = {
|
|
3576
3576
|
...ComponentDefaults,
|
|
3577
3577
|
span: "24",
|
|
3578
3578
|
offset: "0",
|
|
@@ -3580,7 +3580,7 @@ const defaultProps$1o = {
|
|
|
3580
3580
|
};
|
|
3581
3581
|
const Col = (props) => {
|
|
3582
3582
|
const { className, style, span, offset, children, onClick } = {
|
|
3583
|
-
...defaultProps$
|
|
3583
|
+
...defaultProps$1p,
|
|
3584
3584
|
...props
|
|
3585
3585
|
};
|
|
3586
3586
|
const [colName, setColName] = useState("");
|
|
@@ -3612,9 +3612,9 @@ const Col = (props) => {
|
|
|
3612
3612
|
}
|
|
3613
3613
|
);
|
|
3614
3614
|
};
|
|
3615
|
-
Col.defaultProps = defaultProps$
|
|
3615
|
+
Col.defaultProps = defaultProps$1p;
|
|
3616
3616
|
Col.displayName = "NutCol";
|
|
3617
|
-
const defaultProps$
|
|
3617
|
+
const defaultProps$1o = {
|
|
3618
3618
|
...ComponentDefaults,
|
|
3619
3619
|
contentPosition: "center",
|
|
3620
3620
|
direction: "horizontal"
|
|
@@ -3622,7 +3622,7 @@ const defaultProps$1n = {
|
|
|
3622
3622
|
const classPrefix$d = `nut-divider`;
|
|
3623
3623
|
const Divider = (props) => {
|
|
3624
3624
|
const { children, contentPosition, style, className, direction, ...rest } = {
|
|
3625
|
-
...defaultProps$
|
|
3625
|
+
...defaultProps$1o,
|
|
3626
3626
|
...props
|
|
3627
3627
|
};
|
|
3628
3628
|
const classes = direction === "horizontal" ? classNames({
|
|
@@ -3637,7 +3637,7 @@ const Divider = (props) => {
|
|
|
3637
3637
|
});
|
|
3638
3638
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classes} ${className || ""}`, style, ...rest, children });
|
|
3639
3639
|
};
|
|
3640
|
-
Divider.defaultProps = defaultProps$
|
|
3640
|
+
Divider.defaultProps = defaultProps$1o;
|
|
3641
3641
|
Divider.displayName = "NutDivider";
|
|
3642
3642
|
const gridContext = {
|
|
3643
3643
|
onClick: (item, index) => {
|
|
@@ -3647,7 +3647,7 @@ const GridContext = React__default.createContext(gridContext);
|
|
|
3647
3647
|
const pxCheck = (value) => {
|
|
3648
3648
|
return Number.isNaN(Number(value)) ? String(value) : `${value}px`;
|
|
3649
3649
|
};
|
|
3650
|
-
const defaultProps$
|
|
3650
|
+
const defaultProps$1n = {
|
|
3651
3651
|
text: "",
|
|
3652
3652
|
columns: 4,
|
|
3653
3653
|
gap: 0,
|
|
@@ -3673,7 +3673,7 @@ const GridItem = (props) => {
|
|
|
3673
3673
|
onClick,
|
|
3674
3674
|
...rest
|
|
3675
3675
|
} = {
|
|
3676
|
-
...defaultProps$
|
|
3676
|
+
...defaultProps$1n,
|
|
3677
3677
|
...props
|
|
3678
3678
|
};
|
|
3679
3679
|
const classPrefix2 = "nut-grid-item";
|
|
@@ -3734,9 +3734,9 @@ const GridItem = (props) => {
|
|
|
3734
3734
|
}
|
|
3735
3735
|
);
|
|
3736
3736
|
};
|
|
3737
|
-
GridItem.defaultProps = defaultProps$
|
|
3737
|
+
GridItem.defaultProps = defaultProps$1n;
|
|
3738
3738
|
GridItem.displayName = "NutGridItem";
|
|
3739
|
-
const defaultProps$
|
|
3739
|
+
const defaultProps$1m = {
|
|
3740
3740
|
columns: 4,
|
|
3741
3741
|
gap: 0,
|
|
3742
3742
|
center: true,
|
|
@@ -3757,7 +3757,7 @@ const Grid = (props) => {
|
|
|
3757
3757
|
className,
|
|
3758
3758
|
onClick,
|
|
3759
3759
|
...rest
|
|
3760
|
-
} = { ...defaultProps$
|
|
3760
|
+
} = { ...defaultProps$1m, ...props };
|
|
3761
3761
|
const childrenDom = React__default.Children.toArray(children);
|
|
3762
3762
|
const classPrefix2 = "nut-grid";
|
|
3763
3763
|
const rootClass = () => {
|
|
@@ -3787,18 +3787,18 @@ const Grid = (props) => {
|
|
|
3787
3787
|
});
|
|
3788
3788
|
}) }) });
|
|
3789
3789
|
};
|
|
3790
|
-
Grid.defaultProps = defaultProps$
|
|
3790
|
+
Grid.defaultProps = defaultProps$1m;
|
|
3791
3791
|
Grid.displayName = "NutGrid";
|
|
3792
3792
|
Grid.Item = GridItem;
|
|
3793
|
-
const defaultProps$
|
|
3793
|
+
const defaultProps$1l = {};
|
|
3794
3794
|
const Layout = (props) => {
|
|
3795
|
-
({ ...defaultProps$
|
|
3795
|
+
({ ...defaultProps$1l, ...props });
|
|
3796
3796
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-layout", children: "Layout" });
|
|
3797
3797
|
};
|
|
3798
|
-
Layout.defaultProps = defaultProps$
|
|
3798
|
+
Layout.defaultProps = defaultProps$1l;
|
|
3799
3799
|
Layout.displayName = "NutLayout";
|
|
3800
3800
|
const classPrefix$c = "nut-row";
|
|
3801
|
-
const defaultProps$
|
|
3801
|
+
const defaultProps$1k = {
|
|
3802
3802
|
...ComponentDefaults,
|
|
3803
3803
|
type: "",
|
|
3804
3804
|
justify: "start",
|
|
@@ -3818,7 +3818,7 @@ const Row = (props) => {
|
|
|
3818
3818
|
gutter,
|
|
3819
3819
|
onClick
|
|
3820
3820
|
} = {
|
|
3821
|
-
...defaultProps$
|
|
3821
|
+
...defaultProps$1k,
|
|
3822
3822
|
...props
|
|
3823
3823
|
};
|
|
3824
3824
|
const getClass = (prefix2, type2) => {
|
|
@@ -3850,7 +3850,7 @@ const Row = (props) => {
|
|
|
3850
3850
|
children
|
|
3851
3851
|
) });
|
|
3852
3852
|
};
|
|
3853
|
-
Row.defaultProps = defaultProps$
|
|
3853
|
+
Row.defaultProps = defaultProps$1k;
|
|
3854
3854
|
Row.displayName = "NutRow";
|
|
3855
3855
|
function useWatch(dep, callback, config2 = { immediate: false }) {
|
|
3856
3856
|
const { immediate } = config2;
|
|
@@ -3903,7 +3903,7 @@ function getScrollParent(el, root2 = defaultRoot) {
|
|
|
3903
3903
|
}
|
|
3904
3904
|
return root2;
|
|
3905
3905
|
}
|
|
3906
|
-
const defaultProps$
|
|
3906
|
+
const defaultProps$1j = {
|
|
3907
3907
|
...ComponentDefaults,
|
|
3908
3908
|
position: "top",
|
|
3909
3909
|
zIndex: 2e3
|
|
@@ -3920,7 +3920,7 @@ const Sticky = (props) => {
|
|
|
3920
3920
|
className,
|
|
3921
3921
|
onChange,
|
|
3922
3922
|
...rest
|
|
3923
|
-
} = { ...defaultProps$
|
|
3923
|
+
} = { ...defaultProps$1j, ...props };
|
|
3924
3924
|
const stickyRef = useRef(null);
|
|
3925
3925
|
const rootRef = useRef(null);
|
|
3926
3926
|
const [rootRect, setRootRect] = useState({});
|
|
@@ -4026,9 +4026,9 @@ const Sticky = (props) => {
|
|
|
4026
4026
|
}
|
|
4027
4027
|
);
|
|
4028
4028
|
};
|
|
4029
|
-
Sticky.defaultProps = defaultProps$
|
|
4029
|
+
Sticky.defaultProps = defaultProps$1j;
|
|
4030
4030
|
Sticky.displayName = "NutSticky";
|
|
4031
|
-
const defaultProps$
|
|
4031
|
+
const defaultProps$1i = {
|
|
4032
4032
|
...ComponentDefaults,
|
|
4033
4033
|
threshold: 200,
|
|
4034
4034
|
zIndex: 10,
|
|
@@ -4036,7 +4036,7 @@ const defaultProps$1h = {
|
|
|
4036
4036
|
};
|
|
4037
4037
|
const BackTop = (props) => {
|
|
4038
4038
|
const { children, threshold, zIndex, className, duration, style, onClick } = {
|
|
4039
|
-
...defaultProps$
|
|
4039
|
+
...defaultProps$1i,
|
|
4040
4040
|
...props
|
|
4041
4041
|
};
|
|
4042
4042
|
const classPrefix2 = "nut-backtop";
|
|
@@ -4074,10 +4074,10 @@ const BackTop = (props) => {
|
|
|
4074
4074
|
}
|
|
4075
4075
|
);
|
|
4076
4076
|
};
|
|
4077
|
-
BackTop.defaultProps = defaultProps$
|
|
4077
|
+
BackTop.defaultProps = defaultProps$1i;
|
|
4078
4078
|
BackTop.displayName = "NutBackTop";
|
|
4079
4079
|
const elevatorContext = createContext({});
|
|
4080
|
-
const defaultProps$
|
|
4080
|
+
const defaultProps$1h = {
|
|
4081
4081
|
...ComponentDefaults,
|
|
4082
4082
|
height: "200px",
|
|
4083
4083
|
floorKey: "title",
|
|
@@ -4102,7 +4102,7 @@ const Elevator = (props) => {
|
|
|
4102
4102
|
children,
|
|
4103
4103
|
...rest
|
|
4104
4104
|
} = {
|
|
4105
|
-
...defaultProps$
|
|
4105
|
+
...defaultProps$1h,
|
|
4106
4106
|
...props
|
|
4107
4107
|
};
|
|
4108
4108
|
const classPrefix2 = "nut-elevator";
|
|
@@ -4321,10 +4321,10 @@ const Elevator = (props) => {
|
|
|
4321
4321
|
sticky && scrollY > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__list__fixed`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `${classPrefix2}__list__fixed__title`, children: list[currentIndex][floorKey] }) }) : null
|
|
4322
4322
|
] });
|
|
4323
4323
|
};
|
|
4324
|
-
Elevator.defaultProps = defaultProps$
|
|
4324
|
+
Elevator.defaultProps = defaultProps$1h;
|
|
4325
4325
|
Elevator.displayName = "NutElevator";
|
|
4326
4326
|
Elevator.Context = elevatorContext;
|
|
4327
|
-
const defaultProps$
|
|
4327
|
+
const defaultProps$1g = {
|
|
4328
4328
|
...ComponentDefaults,
|
|
4329
4329
|
activeText: "",
|
|
4330
4330
|
inactiveText: "",
|
|
@@ -4352,7 +4352,7 @@ const FixedNav = (props) => {
|
|
|
4352
4352
|
content,
|
|
4353
4353
|
...rest
|
|
4354
4354
|
} = {
|
|
4355
|
-
...defaultProps$
|
|
4355
|
+
...defaultProps$1g,
|
|
4356
4356
|
...props
|
|
4357
4357
|
};
|
|
4358
4358
|
const classPrefix2 = "nut-fixednav";
|
|
@@ -4411,9 +4411,9 @@ const FixedNav = (props) => {
|
|
|
4411
4411
|
}
|
|
4412
4412
|
);
|
|
4413
4413
|
};
|
|
4414
|
-
FixedNav.defaultProps = defaultProps$
|
|
4414
|
+
FixedNav.defaultProps = defaultProps$1g;
|
|
4415
4415
|
FixedNav.displayName = "NutFixedNav";
|
|
4416
|
-
const defaultProps$
|
|
4416
|
+
const defaultProps$1f = {
|
|
4417
4417
|
...ComponentDefaults,
|
|
4418
4418
|
left: "",
|
|
4419
4419
|
right: "",
|
|
@@ -4436,7 +4436,7 @@ const NavBar = (props) => {
|
|
|
4436
4436
|
zIndex,
|
|
4437
4437
|
onClickBack
|
|
4438
4438
|
} = {
|
|
4439
|
-
...defaultProps$
|
|
4439
|
+
...defaultProps$1f,
|
|
4440
4440
|
...props
|
|
4441
4441
|
};
|
|
4442
4442
|
const classPrefix2 = "nut-navbar";
|
|
@@ -4480,7 +4480,7 @@ const NavBar = (props) => {
|
|
|
4480
4480
|
const cls = classNames(classPrefix2, classes, className);
|
|
4481
4481
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: fixed && placeholder ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}--placeholder`, children: renderWrapper() }) : renderWrapper() });
|
|
4482
4482
|
};
|
|
4483
|
-
NavBar.defaultProps = defaultProps$
|
|
4483
|
+
NavBar.defaultProps = defaultProps$1f;
|
|
4484
4484
|
NavBar.displayName = "NutNavBar";
|
|
4485
4485
|
function _extends$3() {
|
|
4486
4486
|
_extends$3 = Object.assign ? Object.assign.bind() : function(target) {
|
|
@@ -6223,7 +6223,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$3({},
|
|
|
6223
6223
|
onExited: propTypesExports.func
|
|
6224
6224
|
}) : {};
|
|
6225
6225
|
const CSSTransition$1 = CSSTransition;
|
|
6226
|
-
const defaultProps$
|
|
6226
|
+
const defaultProps$1e = {
|
|
6227
6227
|
...ComponentDefaults,
|
|
6228
6228
|
position: "center",
|
|
6229
6229
|
transition: "",
|
|
@@ -6410,10 +6410,10 @@ const Popup = (props) => {
|
|
|
6410
6410
|
}, [position, transition]);
|
|
6411
6411
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: renderToContainer(portal, renderNode()) });
|
|
6412
6412
|
};
|
|
6413
|
-
Popup.defaultProps = defaultProps$
|
|
6413
|
+
Popup.defaultProps = defaultProps$1e;
|
|
6414
6414
|
Popup.displayName = "NutPopup";
|
|
6415
6415
|
const OffsetContext = createContext(20);
|
|
6416
|
-
const defaultProps$
|
|
6416
|
+
const defaultProps$1d = {
|
|
6417
6417
|
showhead: false,
|
|
6418
6418
|
position: "left",
|
|
6419
6419
|
width: "80%"
|
|
@@ -6430,7 +6430,7 @@ const SideNavBar = (props) => {
|
|
|
6430
6430
|
onClose,
|
|
6431
6431
|
...rest
|
|
6432
6432
|
} = {
|
|
6433
|
-
...defaultProps$
|
|
6433
|
+
...defaultProps$1d,
|
|
6434
6434
|
...props
|
|
6435
6435
|
};
|
|
6436
6436
|
const offset = props.offset ? Number(props.offset) : 20;
|
|
@@ -6481,7 +6481,7 @@ const SideNavBar = (props) => {
|
|
|
6481
6481
|
}
|
|
6482
6482
|
);
|
|
6483
6483
|
};
|
|
6484
|
-
SideNavBar.defaultProps = defaultProps$
|
|
6484
|
+
SideNavBar.defaultProps = defaultProps$1d;
|
|
6485
6485
|
SideNavBar.displayName = "NutSideNavBar";
|
|
6486
6486
|
const SideNavBarItem = (props) => {
|
|
6487
6487
|
const { title, key, children, onClick, ...rest } = props;
|
|
@@ -6499,12 +6499,12 @@ const SideNavBarItem = (props) => {
|
|
|
6499
6499
|
}
|
|
6500
6500
|
);
|
|
6501
6501
|
};
|
|
6502
|
-
const defaultProps$
|
|
6502
|
+
const defaultProps$1c = {
|
|
6503
6503
|
open: true
|
|
6504
6504
|
};
|
|
6505
6505
|
const SubSideNavBar = (props) => {
|
|
6506
6506
|
const { title, key, children, onClick, open, ...rest } = {
|
|
6507
|
-
...defaultProps$
|
|
6507
|
+
...defaultProps$1c,
|
|
6508
6508
|
...props
|
|
6509
6509
|
};
|
|
6510
6510
|
const [subShow, setSubShow] = useState(open);
|
|
@@ -6578,7 +6578,7 @@ function usePropsValue({
|
|
|
6578
6578
|
}
|
|
6579
6579
|
return [uncontrolled, handleUncontrolledChange];
|
|
6580
6580
|
}
|
|
6581
|
-
const defaultProps$
|
|
6581
|
+
const defaultProps$1b = {
|
|
6582
6582
|
...ComponentDefaults,
|
|
6583
6583
|
value: "",
|
|
6584
6584
|
dot: false,
|
|
@@ -6589,7 +6589,7 @@ const defaultProps$1a = {
|
|
|
6589
6589
|
};
|
|
6590
6590
|
const Badge = (props) => {
|
|
6591
6591
|
const { className, style, value, max, children, dot, top, right, color } = {
|
|
6592
|
-
...defaultProps$
|
|
6592
|
+
...defaultProps$1b,
|
|
6593
6593
|
...props
|
|
6594
6594
|
};
|
|
6595
6595
|
const classPrefix2 = "nut-badge";
|
|
@@ -6620,9 +6620,9 @@ const Badge = (props) => {
|
|
|
6620
6620
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: contentClasses, style: getStyle(), children: content() })
|
|
6621
6621
|
] });
|
|
6622
6622
|
};
|
|
6623
|
-
Badge.defaultProps = defaultProps$
|
|
6623
|
+
Badge.defaultProps = defaultProps$1b;
|
|
6624
6624
|
Badge.displayName = "NutBadge";
|
|
6625
|
-
const defaultProps$
|
|
6625
|
+
const defaultProps$1a = {
|
|
6626
6626
|
...ComponentDefaults,
|
|
6627
6627
|
title: "",
|
|
6628
6628
|
icon: null,
|
|
@@ -6644,7 +6644,7 @@ const TabbarItem = (props) => {
|
|
|
6644
6644
|
handleClick,
|
|
6645
6645
|
...rest
|
|
6646
6646
|
} = {
|
|
6647
|
-
...defaultProps$
|
|
6647
|
+
...defaultProps$1a,
|
|
6648
6648
|
...props
|
|
6649
6649
|
};
|
|
6650
6650
|
const classPrefix2 = "nut-tabbar-item";
|
|
@@ -6671,7 +6671,7 @@ const TabbarItem = (props) => {
|
|
|
6671
6671
|
}
|
|
6672
6672
|
);
|
|
6673
6673
|
};
|
|
6674
|
-
const defaultProps$
|
|
6674
|
+
const defaultProps$19 = {
|
|
6675
6675
|
...ComponentDefaults,
|
|
6676
6676
|
defaultValue: 0,
|
|
6677
6677
|
fixed: false,
|
|
@@ -6694,7 +6694,7 @@ const Tabbar = (props) => {
|
|
|
6694
6694
|
style,
|
|
6695
6695
|
onSwitch
|
|
6696
6696
|
} = {
|
|
6697
|
-
...defaultProps$
|
|
6697
|
+
...defaultProps$19,
|
|
6698
6698
|
...props
|
|
6699
6699
|
};
|
|
6700
6700
|
const classPrefix2 = "nut-tabbar";
|
|
@@ -6731,17 +6731,17 @@ const Tabbar = (props) => {
|
|
|
6731
6731
|
}
|
|
6732
6732
|
);
|
|
6733
6733
|
};
|
|
6734
|
-
Tabbar.defaultProps = defaultProps$
|
|
6734
|
+
Tabbar.defaultProps = defaultProps$19;
|
|
6735
6735
|
Tabbar.displayName = "NutTabbar";
|
|
6736
6736
|
Tabbar.Item = TabbarItem;
|
|
6737
|
-
const defaultProps$
|
|
6737
|
+
const defaultProps$18 = {
|
|
6738
6738
|
title: "",
|
|
6739
6739
|
value: "",
|
|
6740
6740
|
disabled: false
|
|
6741
6741
|
};
|
|
6742
6742
|
const TabPane = (props) => {
|
|
6743
6743
|
const { children, autoHeightClassName, className, disabled } = {
|
|
6744
|
-
...defaultProps$
|
|
6744
|
+
...defaultProps$18,
|
|
6745
6745
|
...props
|
|
6746
6746
|
};
|
|
6747
6747
|
const classPrefix2 = "nut-tabpane";
|
|
@@ -6755,7 +6755,7 @@ const TabPane = (props) => {
|
|
|
6755
6755
|
);
|
|
6756
6756
|
return children ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes, children: !disabled && children }) : null;
|
|
6757
6757
|
};
|
|
6758
|
-
const defaultProps$
|
|
6758
|
+
const defaultProps$17 = {
|
|
6759
6759
|
...ComponentDefaults,
|
|
6760
6760
|
tabStyle: {},
|
|
6761
6761
|
activeColor: "",
|
|
@@ -6781,7 +6781,7 @@ const Tabs = (props) => {
|
|
|
6781
6781
|
autoHeight,
|
|
6782
6782
|
...rest
|
|
6783
6783
|
} = {
|
|
6784
|
-
...defaultProps$
|
|
6784
|
+
...defaultProps$17,
|
|
6785
6785
|
...props
|
|
6786
6786
|
};
|
|
6787
6787
|
const [value, setValue] = usePropsValue({
|
|
@@ -6810,6 +6810,16 @@ const Tabs = (props) => {
|
|
|
6810
6810
|
return titles2;
|
|
6811
6811
|
};
|
|
6812
6812
|
const titles = useRef(getTitles());
|
|
6813
|
+
useEffect(() => {
|
|
6814
|
+
titles.current = getTitles();
|
|
6815
|
+
let current = "";
|
|
6816
|
+
titles.current.forEach((title2) => {
|
|
6817
|
+
if (title2.value === value) {
|
|
6818
|
+
current = value;
|
|
6819
|
+
}
|
|
6820
|
+
});
|
|
6821
|
+
setValue(current);
|
|
6822
|
+
}, [children]);
|
|
6813
6823
|
const classes = classNames(
|
|
6814
6824
|
classPrefix$a,
|
|
6815
6825
|
`${classPrefix$a}--${direction}`,
|
|
@@ -6922,7 +6932,7 @@ const Tabs = (props) => {
|
|
|
6922
6932
|
}) }) })
|
|
6923
6933
|
] });
|
|
6924
6934
|
};
|
|
6925
|
-
Tabs.defaultProps = defaultProps$
|
|
6935
|
+
Tabs.defaultProps = defaultProps$17;
|
|
6926
6936
|
Tabs.displayName = "NutTabs";
|
|
6927
6937
|
Tabs.TabPane = TabPane;
|
|
6928
6938
|
var classnameExports = {};
|
|
@@ -7057,7 +7067,7 @@ const ConfigContext = createContext(null);
|
|
|
7057
7067
|
const useConfig = () => {
|
|
7058
7068
|
return useContext(ConfigContext) ?? getDefaultConfig();
|
|
7059
7069
|
};
|
|
7060
|
-
const defaultProps$
|
|
7070
|
+
const defaultProps$16 = {
|
|
7061
7071
|
type: "custom",
|
|
7062
7072
|
existAddress: [],
|
|
7063
7073
|
defaultIcon: null,
|
|
@@ -7079,7 +7089,7 @@ const ExistRender = (props) => {
|
|
|
7079
7089
|
onClose,
|
|
7080
7090
|
onSwitchModule,
|
|
7081
7091
|
...rest
|
|
7082
|
-
} = { ...defaultProps$
|
|
7092
|
+
} = { ...defaultProps$16, ...props };
|
|
7083
7093
|
const b2 = cn("address");
|
|
7084
7094
|
const selectedExist = (item) => {
|
|
7085
7095
|
const copyExistAdd = existAddress;
|
|
@@ -7121,7 +7131,7 @@ const ExistRender = (props) => {
|
|
|
7121
7131
|
isShowCustomAddress && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b2("choose-other"), onClick: onSwitch, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: b2("choose-other-btn"), children: customAndExistTitle || locale.address.chooseAnotherAddress }) })
|
|
7122
7132
|
] });
|
|
7123
7133
|
};
|
|
7124
|
-
const defaultProps$
|
|
7134
|
+
const defaultProps$15 = {
|
|
7125
7135
|
modelValue: [],
|
|
7126
7136
|
type: "custom",
|
|
7127
7137
|
province: [],
|
|
@@ -7146,7 +7156,7 @@ const CustomRender = (props) => {
|
|
|
7146
7156
|
onClose,
|
|
7147
7157
|
...rest
|
|
7148
7158
|
} = {
|
|
7149
|
-
...defaultProps$
|
|
7159
|
+
...defaultProps$15,
|
|
7150
7160
|
...props
|
|
7151
7161
|
};
|
|
7152
7162
|
const b2 = cn("address");
|
|
@@ -7310,28 +7320,28 @@ const CustomRender = (props) => {
|
|
|
7310
7320
|
nextAreaList(item);
|
|
7311
7321
|
};
|
|
7312
7322
|
useEffect(() => {
|
|
7313
|
-
const { province: province2 } = { ...defaultProps$
|
|
7323
|
+
const { province: province2 } = { ...defaultProps$15, ...props };
|
|
7314
7324
|
setRegionList({
|
|
7315
7325
|
...regionList,
|
|
7316
7326
|
province: isCustom2() ? transformData(province2) : province2
|
|
7317
7327
|
});
|
|
7318
7328
|
}, [province]);
|
|
7319
7329
|
useEffect(() => {
|
|
7320
|
-
const { city: city2 } = { ...defaultProps$
|
|
7330
|
+
const { city: city2 } = { ...defaultProps$15, ...props };
|
|
7321
7331
|
setRegionList({
|
|
7322
7332
|
...regionList,
|
|
7323
7333
|
city: isCustom2() ? transformData(city2) : city2
|
|
7324
7334
|
});
|
|
7325
7335
|
}, [city]);
|
|
7326
7336
|
useEffect(() => {
|
|
7327
|
-
const { country: country2 } = { ...defaultProps$
|
|
7337
|
+
const { country: country2 } = { ...defaultProps$15, ...props };
|
|
7328
7338
|
setRegionList({
|
|
7329
7339
|
...regionList,
|
|
7330
7340
|
country: isCustom2() ? transformData(country2) : country2
|
|
7331
7341
|
});
|
|
7332
7342
|
}, [country]);
|
|
7333
7343
|
useEffect(() => {
|
|
7334
|
-
const { town: town2 } = { ...defaultProps$
|
|
7344
|
+
const { town: town2 } = { ...defaultProps$15, ...props };
|
|
7335
7345
|
setRegionList({
|
|
7336
7346
|
...regionList,
|
|
7337
7347
|
town: isCustom2() ? transformData(town2) : town2
|
|
@@ -7404,7 +7414,7 @@ const CustomRender = (props) => {
|
|
|
7404
7414
|
) })
|
|
7405
7415
|
] });
|
|
7406
7416
|
};
|
|
7407
|
-
const defaultProps$
|
|
7417
|
+
const defaultProps$14 = {
|
|
7408
7418
|
...ComponentDefaults,
|
|
7409
7419
|
modelValue: false,
|
|
7410
7420
|
modelSelect: [],
|
|
@@ -7455,7 +7465,7 @@ const Address = (props) => {
|
|
|
7455
7465
|
className,
|
|
7456
7466
|
...rest
|
|
7457
7467
|
} = {
|
|
7458
|
-
...defaultProps$
|
|
7468
|
+
...defaultProps$14,
|
|
7459
7469
|
...props
|
|
7460
7470
|
};
|
|
7461
7471
|
const b2 = cn("address");
|
|
@@ -7613,7 +7623,7 @@ const Address = (props) => {
|
|
|
7613
7623
|
}
|
|
7614
7624
|
) });
|
|
7615
7625
|
};
|
|
7616
|
-
Address.defaultProps = defaultProps$
|
|
7626
|
+
Address.defaultProps = defaultProps$14;
|
|
7617
7627
|
Address.displayName = "NutAddress";
|
|
7618
7628
|
const Utils = {
|
|
7619
7629
|
/**
|
|
@@ -7746,7 +7756,7 @@ function requestAniFrame() {
|
|
|
7746
7756
|
}
|
|
7747
7757
|
}
|
|
7748
7758
|
const requestAniFrame$1 = requestAniFrame();
|
|
7749
|
-
const defaultProps$
|
|
7759
|
+
const defaultProps$13 = {
|
|
7750
7760
|
type: "one",
|
|
7751
7761
|
isAutoBackFill: false,
|
|
7752
7762
|
poppable: true,
|
|
@@ -7798,7 +7808,7 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
7798
7808
|
onUpdate,
|
|
7799
7809
|
onSelected,
|
|
7800
7810
|
onYearMonthChange
|
|
7801
|
-
} = { ...defaultProps$
|
|
7811
|
+
} = { ...defaultProps$13, ...props };
|
|
7802
7812
|
const weeks = locale.calendaritem.weekdays;
|
|
7803
7813
|
const [yearMonthTitle, setYearMonthTitle] = useState("");
|
|
7804
7814
|
const [monthsData, setMonthsData] = useState([]);
|
|
@@ -8403,9 +8413,9 @@ const CalendarItem = React__default.forwardRef((props, ref) => {
|
|
|
8403
8413
|
poppable && !isAutoBackFill ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-calendar-footer", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "calendar-confirm-btn", onClick: confirm, children: confirmText || locale.confirm }) }) : ""
|
|
8404
8414
|
] }) });
|
|
8405
8415
|
});
|
|
8406
|
-
CalendarItem.defaultProps = defaultProps$
|
|
8416
|
+
CalendarItem.defaultProps = defaultProps$13;
|
|
8407
8417
|
CalendarItem.displayName = "NutCalendarItem";
|
|
8408
|
-
const defaultProps$
|
|
8418
|
+
const defaultProps$12 = {
|
|
8409
8419
|
type: "one",
|
|
8410
8420
|
isAutoBackFill: false,
|
|
8411
8421
|
poppable: true,
|
|
@@ -8461,7 +8471,7 @@ const Calendar = React__default.forwardRef((props, ref) => {
|
|
|
8461
8471
|
onChoose,
|
|
8462
8472
|
onSelected,
|
|
8463
8473
|
onYearMonthChange
|
|
8464
|
-
} = { ...defaultProps$
|
|
8474
|
+
} = { ...defaultProps$12, ...props };
|
|
8465
8475
|
const calendarRef = useRef(null);
|
|
8466
8476
|
const close = () => {
|
|
8467
8477
|
onClose && onClose();
|
|
@@ -8531,9 +8541,9 @@ const Calendar = React__default.forwardRef((props, ref) => {
|
|
|
8531
8541
|
}
|
|
8532
8542
|
) : renderItem() });
|
|
8533
8543
|
});
|
|
8534
|
-
Calendar.defaultProps = defaultProps$
|
|
8544
|
+
Calendar.defaultProps = defaultProps$12;
|
|
8535
8545
|
Calendar.displayName = "NutCalendar";
|
|
8536
|
-
const defaultProps$
|
|
8546
|
+
const defaultProps$11 = {
|
|
8537
8547
|
data: {
|
|
8538
8548
|
text: "",
|
|
8539
8549
|
value: "",
|
|
@@ -8544,32 +8554,37 @@ const defaultProps$10 = {
|
|
|
8544
8554
|
},
|
|
8545
8555
|
activeColor: "",
|
|
8546
8556
|
checked: false,
|
|
8547
|
-
|
|
8557
|
+
activeIcon: "checklist",
|
|
8548
8558
|
chooseItem: () => {
|
|
8549
8559
|
}
|
|
8550
8560
|
};
|
|
8551
8561
|
const InternalCascaderItem = (props, ref) => {
|
|
8552
|
-
const { data, checked,
|
|
8553
|
-
...defaultProps$
|
|
8562
|
+
const { data, checked, activeIcon, chooseItem, activeColor } = {
|
|
8563
|
+
...defaultProps$11,
|
|
8554
8564
|
...props
|
|
8555
8565
|
};
|
|
8556
|
-
const
|
|
8566
|
+
const classPrefix2 = "nut-cascader-item";
|
|
8557
8567
|
const classes = classNames(
|
|
8558
8568
|
{
|
|
8559
8569
|
active: checked,
|
|
8560
8570
|
disabled: data.disabled
|
|
8561
8571
|
},
|
|
8562
|
-
|
|
8572
|
+
classPrefix2
|
|
8563
8573
|
);
|
|
8564
8574
|
const classesTitle = classNames({
|
|
8565
|
-
[`${
|
|
8575
|
+
[`${classPrefix2}__title`]: true
|
|
8566
8576
|
});
|
|
8567
8577
|
const renderIcon = () => {
|
|
8568
8578
|
if (checked) {
|
|
8569
|
-
if (isValidElement(
|
|
8570
|
-
return
|
|
8579
|
+
if (isValidElement(activeIcon)) {
|
|
8580
|
+
return activeIcon;
|
|
8571
8581
|
}
|
|
8572
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8582
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8583
|
+
a$q,
|
|
8584
|
+
{
|
|
8585
|
+
className: `${checked ? `${classPrefix2}__icon-check` : ""}`
|
|
8586
|
+
}
|
|
8587
|
+
);
|
|
8573
8588
|
}
|
|
8574
8589
|
return null;
|
|
8575
8590
|
};
|
|
@@ -8589,7 +8604,7 @@ const InternalCascaderItem = (props, ref) => {
|
|
|
8589
8604
|
);
|
|
8590
8605
|
};
|
|
8591
8606
|
const CascaderItem = React__default.forwardRef(InternalCascaderItem);
|
|
8592
|
-
CascaderItem.defaultProps = defaultProps$
|
|
8607
|
+
CascaderItem.defaultProps = defaultProps$11;
|
|
8593
8608
|
CascaderItem.displayName = "NutCascaderItem";
|
|
8594
8609
|
const formatTree = (tree, parent, config2) => tree.map((node) => {
|
|
8595
8610
|
const {
|
|
@@ -8727,26 +8742,22 @@ class Tree {
|
|
|
8727
8742
|
}
|
|
8728
8743
|
}
|
|
8729
8744
|
const Tree$1 = Tree;
|
|
8730
|
-
const defaultProps
|
|
8731
|
-
|
|
8732
|
-
style: {},
|
|
8745
|
+
const defaultProps$10 = {
|
|
8746
|
+
...ComponentDefaults,
|
|
8733
8747
|
activeColor: "",
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
poppable: true,
|
|
8748
|
+
activeIcon: "checklist",
|
|
8749
|
+
popup: true,
|
|
8737
8750
|
visible: false,
|
|
8738
8751
|
options: [],
|
|
8739
8752
|
value: [],
|
|
8740
8753
|
title: "",
|
|
8741
|
-
textKey: "text",
|
|
8742
|
-
|
|
8743
|
-
childrenKey: "children",
|
|
8744
|
-
convertConfig: {},
|
|
8754
|
+
optionKey: { textKey: "text", valueKey: "value", childrenKey: "children" },
|
|
8755
|
+
format: {},
|
|
8745
8756
|
closeable: false,
|
|
8746
8757
|
closeIconPosition: "top-right",
|
|
8747
8758
|
closeIcon: "close",
|
|
8748
8759
|
lazy: false,
|
|
8749
|
-
|
|
8760
|
+
onLoad: () => {
|
|
8750
8761
|
},
|
|
8751
8762
|
onClose: () => {
|
|
8752
8763
|
},
|
|
@@ -8760,28 +8771,25 @@ const InternalCascader = (props, ref) => {
|
|
|
8760
8771
|
const {
|
|
8761
8772
|
className,
|
|
8762
8773
|
style,
|
|
8763
|
-
|
|
8764
|
-
poppable,
|
|
8774
|
+
popup,
|
|
8765
8775
|
visible,
|
|
8766
8776
|
options,
|
|
8767
8777
|
value,
|
|
8768
8778
|
title,
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
childrenKey,
|
|
8772
|
-
convertConfig: convertConfig2,
|
|
8779
|
+
optionKey: optionKey2,
|
|
8780
|
+
format: format2,
|
|
8773
8781
|
closeable,
|
|
8774
8782
|
closeIconPosition,
|
|
8775
8783
|
closeIcon,
|
|
8776
8784
|
lazy,
|
|
8777
|
-
|
|
8785
|
+
onLoad,
|
|
8778
8786
|
onClose,
|
|
8779
8787
|
onChange,
|
|
8780
8788
|
onPathChange
|
|
8781
|
-
} = { ...defaultProps
|
|
8789
|
+
} = { ...defaultProps$10, ...props };
|
|
8782
8790
|
const [tabvalue, setTabvalue] = useState("c1");
|
|
8783
8791
|
const [optionsData, setOptionsData] = useState([]);
|
|
8784
|
-
const isLazy = () => state.configs.lazy && Boolean(state.configs.
|
|
8792
|
+
const isLazy = () => state.configs.lazy && Boolean(state.configs.onLoad);
|
|
8785
8793
|
const [state] = useState({
|
|
8786
8794
|
optionsData: [],
|
|
8787
8795
|
panes: [
|
|
@@ -8799,44 +8807,38 @@ const InternalCascader = (props, ref) => {
|
|
|
8799
8807
|
currentProcessNode: [],
|
|
8800
8808
|
configs: {
|
|
8801
8809
|
lazy,
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
childrenKey,
|
|
8806
|
-
convertConfig: convertConfig2
|
|
8810
|
+
onLoad,
|
|
8811
|
+
optionKey: optionKey2,
|
|
8812
|
+
format: format2
|
|
8807
8813
|
},
|
|
8808
8814
|
lazyLoadMap: /* @__PURE__ */ new Map()
|
|
8809
8815
|
});
|
|
8810
|
-
const
|
|
8811
|
-
const classes = classNames(b2(""));
|
|
8816
|
+
const classPrefix2 = classNames(`nut-cascader`);
|
|
8812
8817
|
const classesPane = classNames({
|
|
8813
|
-
[`${
|
|
8818
|
+
[`${classPrefix2}-pane`]: true
|
|
8814
8819
|
});
|
|
8815
8820
|
useEffect(() => {
|
|
8816
8821
|
initData();
|
|
8817
|
-
}, []);
|
|
8822
|
+
}, [options]);
|
|
8818
8823
|
useEffect(() => {
|
|
8819
8824
|
if (value !== state.innerValue) {
|
|
8820
8825
|
state.innerValue = value;
|
|
8821
8826
|
}
|
|
8822
8827
|
}, [value]);
|
|
8823
|
-
useEffect(() => {
|
|
8824
|
-
initData();
|
|
8825
|
-
}, [options]);
|
|
8826
8828
|
const initData = async () => {
|
|
8827
8829
|
state.lazyLoadMap.clear();
|
|
8828
|
-
if (
|
|
8830
|
+
if (format2 && Object.keys(format2).length > 0) {
|
|
8829
8831
|
state.optionsData = convertListToOptions(
|
|
8830
8832
|
options,
|
|
8831
|
-
|
|
8833
|
+
format2
|
|
8832
8834
|
);
|
|
8833
8835
|
} else {
|
|
8834
8836
|
state.optionsData = options;
|
|
8835
8837
|
}
|
|
8836
8838
|
state.tree = new Tree$1(state.optionsData, {
|
|
8837
|
-
value: state.configs.valueKey,
|
|
8838
|
-
text: state.configs.textKey,
|
|
8839
|
-
children: state.configs.childrenKey
|
|
8839
|
+
value: state.configs.optionKey.valueKey,
|
|
8840
|
+
text: state.configs.optionKey.textKey,
|
|
8841
|
+
children: state.configs.optionKey.childrenKey
|
|
8840
8842
|
});
|
|
8841
8843
|
if (isLazy() && !state.tree.nodes.length) {
|
|
8842
8844
|
await invokeLazyLoad({
|
|
@@ -8902,7 +8904,7 @@ const InternalCascader = (props, ref) => {
|
|
|
8902
8904
|
if (!node) {
|
|
8903
8905
|
return;
|
|
8904
8906
|
}
|
|
8905
|
-
if (!state.configs.
|
|
8907
|
+
if (!state.configs.onLoad) {
|
|
8906
8908
|
node.leaf = true;
|
|
8907
8909
|
return;
|
|
8908
8910
|
}
|
|
@@ -8915,7 +8917,7 @@ const InternalCascader = (props, ref) => {
|
|
|
8915
8917
|
if (!lazyLoadPromise) {
|
|
8916
8918
|
lazyLoadPromise = new Promise((resolve) => {
|
|
8917
8919
|
var _a, _b;
|
|
8918
|
-
(_b = (_a = state.configs).
|
|
8920
|
+
(_b = (_a = state.configs).onLoad) == null ? void 0 : _b.call(_a, node, resolve);
|
|
8919
8921
|
});
|
|
8920
8922
|
state.lazyLoadMap.set(node, lazyLoadPromise);
|
|
8921
8923
|
}
|
|
@@ -8962,8 +8964,8 @@ const InternalCascader = (props, ref) => {
|
|
|
8962
8964
|
selectedNode: null,
|
|
8963
8965
|
paneKey: `c${state.tabsCursor + 1}`
|
|
8964
8966
|
});
|
|
8965
|
-
setTabvalue(`c${state.tabsCursor + 1}`);
|
|
8966
8967
|
setOptionsData(state.panes);
|
|
8968
|
+
setTabvalue(`c${state.tabsCursor + 1}`);
|
|
8967
8969
|
if (!type) {
|
|
8968
8970
|
const pathNodes = state.panes.map((item) => item.selectedNode);
|
|
8969
8971
|
const optionParams = pathNodes.map((item) => item == null ? void 0 : item.value);
|
|
@@ -8983,8 +8985,8 @@ const InternalCascader = (props, ref) => {
|
|
|
8983
8985
|
setOptionsData(state.panes);
|
|
8984
8986
|
};
|
|
8985
8987
|
const renderItem = () => {
|
|
8986
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${
|
|
8987
|
-
|
|
8988
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2} ${className}`, style, children: [
|
|
8989
|
+
popup && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-cascader__title", children: title }),
|
|
8988
8990
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8989
8991
|
Tabs,
|
|
8990
8992
|
{
|
|
@@ -8999,27 +9001,21 @@ const InternalCascader = (props, ref) => {
|
|
|
8999
9001
|
setTabvalue(pane.paneKey);
|
|
9000
9002
|
state.tabsCursor = index;
|
|
9001
9003
|
},
|
|
9002
|
-
className: `nut-tabs__titles-item ${tabvalue === pane.paneKey ? "active" : ""}`,
|
|
9004
|
+
className: `nut-tabs__titles-item ${tabvalue === pane.paneKey ? "nut-tabs__titles-item--active" : ""}`,
|
|
9003
9005
|
children: [
|
|
9004
9006
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "nut-tabs__titles-item__text", children: [
|
|
9005
9007
|
!state.initLoading && state.panes.length && ((_a = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _a.text),
|
|
9006
9008
|
!state.initLoading && state.panes.length && !((_b = pane == null ? void 0 : pane.selectedNode) == null ? void 0 : _b.text) && "请选择",
|
|
9007
9009
|
!(!state.initLoading && state.panes.length) && "Loading..."
|
|
9008
9010
|
] }),
|
|
9009
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9010
|
-
"span",
|
|
9011
|
-
{
|
|
9012
|
-
className: "nut-tabs__titles-item__line",
|
|
9013
|
-
style: { background: tabsColor }
|
|
9014
|
-
}
|
|
9015
|
-
)
|
|
9011
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "nut-tabs__titles-item__line" })
|
|
9016
9012
|
]
|
|
9017
9013
|
},
|
|
9018
9014
|
pane.paneKey
|
|
9019
9015
|
);
|
|
9020
9016
|
});
|
|
9021
9017
|
},
|
|
9022
|
-
children: !state.initLoading && state.panes.length ? optionsData.map((pane) => /* @__PURE__ */ jsxRuntimeExports.jsx(TabPane, { value: pane.paneKey, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesPane, children: pane.nodes && pane.nodes.map((node, index) => {
|
|
9018
|
+
children: !state.initLoading && state.panes.length ? optionsData.map((pane) => /* @__PURE__ */ jsxRuntimeExports.jsx(Tabs.TabPane, { value: pane.paneKey, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesPane, children: pane.nodes && pane.nodes.map((node, index) => {
|
|
9023
9019
|
var _a;
|
|
9024
9020
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9025
9021
|
CascaderItem,
|
|
@@ -9031,18 +9027,18 @@ const InternalCascader = (props, ref) => {
|
|
|
9031
9027
|
},
|
|
9032
9028
|
index
|
|
9033
9029
|
);
|
|
9034
|
-
}) }) }, pane.paneKey)) : /* @__PURE__ */ jsxRuntimeExports.jsx(TabPane, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesPane }) })
|
|
9030
|
+
}) }) }, pane.paneKey)) : /* @__PURE__ */ jsxRuntimeExports.jsx(Tabs.TabPane, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classesPane }) })
|
|
9035
9031
|
}
|
|
9036
9032
|
)
|
|
9037
9033
|
] });
|
|
9038
9034
|
};
|
|
9039
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children:
|
|
9035
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: popup ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9040
9036
|
Popup,
|
|
9041
9037
|
{
|
|
9042
|
-
className: "cascadar-popup",
|
|
9043
9038
|
visible,
|
|
9044
9039
|
position: "bottom",
|
|
9045
9040
|
round: true,
|
|
9041
|
+
closeIcon,
|
|
9046
9042
|
closeable,
|
|
9047
9043
|
closeIconPosition,
|
|
9048
9044
|
onClickOverlay: closePopup,
|
|
@@ -9052,11 +9048,11 @@ const InternalCascader = (props, ref) => {
|
|
|
9052
9048
|
) : renderItem() });
|
|
9053
9049
|
};
|
|
9054
9050
|
const Cascader = React__default.forwardRef(InternalCascader);
|
|
9055
|
-
Cascader.defaultProps = defaultProps
|
|
9051
|
+
Cascader.defaultProps = defaultProps$10;
|
|
9056
9052
|
Cascader.displayName = "NutCascader";
|
|
9057
9053
|
const CheckboxGroupContext = createContext(null);
|
|
9058
9054
|
const Context = CheckboxGroupContext;
|
|
9059
|
-
const defaultProps
|
|
9055
|
+
const defaultProps$$ = {
|
|
9060
9056
|
max: void 0,
|
|
9061
9057
|
labelPosition: "right",
|
|
9062
9058
|
direction: "vertical",
|
|
@@ -9067,7 +9063,7 @@ const defaultProps$_ = {
|
|
|
9067
9063
|
const classPrefix$9 = "nut-checkboxgroup";
|
|
9068
9064
|
const CheckboxGroup = React__default.forwardRef(
|
|
9069
9065
|
(props, ref) => {
|
|
9070
|
-
const { children } = { ...defaultProps
|
|
9066
|
+
const { children } = { ...defaultProps$$, ...props };
|
|
9071
9067
|
const {
|
|
9072
9068
|
className,
|
|
9073
9069
|
disabled,
|
|
@@ -9157,9 +9153,9 @@ const CheckboxGroup = React__default.forwardRef(
|
|
|
9157
9153
|
);
|
|
9158
9154
|
}
|
|
9159
9155
|
);
|
|
9160
|
-
CheckboxGroup.defaultProps = defaultProps
|
|
9156
|
+
CheckboxGroup.defaultProps = defaultProps$$;
|
|
9161
9157
|
CheckboxGroup.displayName = "NutCheckboxGroup";
|
|
9162
|
-
const defaultProps$
|
|
9158
|
+
const defaultProps$_ = {
|
|
9163
9159
|
...ComponentDefaults,
|
|
9164
9160
|
disabled: false,
|
|
9165
9161
|
labelPosition: "right",
|
|
@@ -9172,7 +9168,7 @@ const defaultProps$Z = {
|
|
|
9172
9168
|
const classPrefix$8 = "nut-checkbox";
|
|
9173
9169
|
const Checkbox = (props) => {
|
|
9174
9170
|
const { children } = {
|
|
9175
|
-
...defaultProps$
|
|
9171
|
+
...defaultProps$_,
|
|
9176
9172
|
...props
|
|
9177
9173
|
};
|
|
9178
9174
|
const {
|
|
@@ -9277,7 +9273,7 @@ const Checkbox = (props) => {
|
|
|
9277
9273
|
}
|
|
9278
9274
|
);
|
|
9279
9275
|
};
|
|
9280
|
-
Checkbox.defaultProps = defaultProps$
|
|
9276
|
+
Checkbox.defaultProps = defaultProps$_;
|
|
9281
9277
|
Checkbox.displayName = "NutCheckBox";
|
|
9282
9278
|
Checkbox.Group = CheckboxGroup;
|
|
9283
9279
|
const MIN_DISTANCE = 10;
|
|
@@ -9358,13 +9354,13 @@ if (canUseDom) {
|
|
|
9358
9354
|
console.log(e);
|
|
9359
9355
|
}
|
|
9360
9356
|
}
|
|
9361
|
-
const
|
|
9357
|
+
const InternalPickerPanel = (props, ref) => {
|
|
9362
9358
|
const {
|
|
9363
9359
|
keyIndex = 0,
|
|
9364
9360
|
defaultValue,
|
|
9365
|
-
|
|
9361
|
+
options = [],
|
|
9366
9362
|
threeDimensional = true,
|
|
9367
|
-
|
|
9363
|
+
duration = 1e3,
|
|
9368
9364
|
itemShow = false,
|
|
9369
9365
|
chooseItem
|
|
9370
9366
|
} = props;
|
|
@@ -9379,9 +9375,9 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
9379
9375
|
const rotation = 20;
|
|
9380
9376
|
const moving = useRef(false);
|
|
9381
9377
|
let timer;
|
|
9382
|
-
const
|
|
9378
|
+
const listRef = useRef(null);
|
|
9383
9379
|
const rollerRef = useRef(null);
|
|
9384
|
-
const
|
|
9380
|
+
const PickerPanelRef = useRef(null);
|
|
9385
9381
|
const [startTime, setStartTime] = useState(0);
|
|
9386
9382
|
const [startY, setStartY] = useState(0);
|
|
9387
9383
|
const transformY = useRef(0);
|
|
@@ -9407,8 +9403,8 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
9407
9403
|
if (updateMove > 0) {
|
|
9408
9404
|
updateMove = 0;
|
|
9409
9405
|
}
|
|
9410
|
-
if (updateMove < -(
|
|
9411
|
-
updateMove = -(
|
|
9406
|
+
if (updateMove < -(options.length - 1) * lineSpacing.current) {
|
|
9407
|
+
updateMove = -(options.length - 1) * lineSpacing.current;
|
|
9412
9408
|
}
|
|
9413
9409
|
const endMove = Math.round(updateMove / lineSpacing.current) * lineSpacing.current;
|
|
9414
9410
|
const deg = `${(Math.abs(Math.round(endMove / lineSpacing.current)) + 1) * rotation}deg`;
|
|
@@ -9417,7 +9413,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
9417
9413
|
} else {
|
|
9418
9414
|
let deg = 0;
|
|
9419
9415
|
const currentDeg = (-updateMove / lineSpacing.current + 1) * rotation;
|
|
9420
|
-
const maxDeg = (
|
|
9416
|
+
const maxDeg = (options.length + 1) * rotation;
|
|
9421
9417
|
const minDeg = 0;
|
|
9422
9418
|
deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
|
|
9423
9419
|
if (minDeg < deg && deg < maxDeg) {
|
|
@@ -9427,7 +9423,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
9427
9423
|
}
|
|
9428
9424
|
};
|
|
9429
9425
|
const setChooseValue = (move) => {
|
|
9430
|
-
chooseItem && chooseItem(
|
|
9426
|
+
chooseItem && chooseItem(options == null ? void 0 : options[Math.round(-move / lineSpacing.current)], keyIndex);
|
|
9431
9427
|
};
|
|
9432
9428
|
const touchStart = (event) => {
|
|
9433
9429
|
touch.start(event);
|
|
@@ -9451,7 +9447,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
9451
9447
|
const moveTime = Date.now() - startTime;
|
|
9452
9448
|
if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
|
|
9453
9449
|
const distance = momentum(move, moveTime);
|
|
9454
|
-
setMove(distance, "end", +
|
|
9450
|
+
setMove(distance, "end", +duration);
|
|
9455
9451
|
} else {
|
|
9456
9452
|
setMove(move, "end");
|
|
9457
9453
|
}
|
|
@@ -9459,9 +9455,9 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
9459
9455
|
touch.reset();
|
|
9460
9456
|
}, 0);
|
|
9461
9457
|
};
|
|
9462
|
-
const momentum = (distance,
|
|
9458
|
+
const momentum = (distance, duration2) => {
|
|
9463
9459
|
let nDistance = distance;
|
|
9464
|
-
const speed = Math.abs(nDistance /
|
|
9460
|
+
const speed = Math.abs(nDistance / duration2);
|
|
9465
9461
|
nDistance = speed / 3e-3 * (nDistance < 0 ? -1 : 1);
|
|
9466
9462
|
return nDistance;
|
|
9467
9463
|
};
|
|
@@ -9469,7 +9465,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
9469
9465
|
const value = val || defaultValue;
|
|
9470
9466
|
let index = -1;
|
|
9471
9467
|
if (value) {
|
|
9472
|
-
|
|
9468
|
+
options.some((item, idx) => {
|
|
9473
9469
|
if (item.value === value) {
|
|
9474
9470
|
index = idx;
|
|
9475
9471
|
return true;
|
|
@@ -9477,7 +9473,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
9477
9473
|
return false;
|
|
9478
9474
|
});
|
|
9479
9475
|
} else {
|
|
9480
|
-
|
|
9476
|
+
options.forEach((item, i) => {
|
|
9481
9477
|
if (item.value === defaultValue) {
|
|
9482
9478
|
index = i;
|
|
9483
9479
|
}
|
|
@@ -9502,7 +9498,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
9502
9498
|
}
|
|
9503
9499
|
};
|
|
9504
9500
|
const getReference = async () => {
|
|
9505
|
-
const refe = await getRectByTaro(
|
|
9501
|
+
const refe = await getRectByTaro(listRef == null ? void 0 : listRef.current);
|
|
9506
9502
|
lineSpacing.current = refe.height ? refe.height : 36;
|
|
9507
9503
|
modifyStatus(true);
|
|
9508
9504
|
};
|
|
@@ -9525,7 +9521,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
9525
9521
|
return () => {
|
|
9526
9522
|
clearTimeout(timer);
|
|
9527
9523
|
};
|
|
9528
|
-
}, [
|
|
9524
|
+
}, [options]);
|
|
9529
9525
|
useEffect(() => {
|
|
9530
9526
|
if (itemShow) {
|
|
9531
9527
|
setTimeout(() => {
|
|
@@ -9541,7 +9537,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
9541
9537
|
"div",
|
|
9542
9538
|
{
|
|
9543
9539
|
className: "nut-picker-list",
|
|
9544
|
-
ref:
|
|
9540
|
+
ref: PickerPanelRef,
|
|
9545
9541
|
onTouchStart: touchStart,
|
|
9546
9542
|
onTouchMove: touchMove,
|
|
9547
9543
|
onTouchEnd: touchEnd,
|
|
@@ -9554,7 +9550,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
9554
9550
|
style: threeDimensional ? touchRollerStyle() : touchTileStyle(),
|
|
9555
9551
|
onTransitionEnd: stopMomentum,
|
|
9556
9552
|
children: [
|
|
9557
|
-
threeDimensional &&
|
|
9553
|
+
threeDimensional && options.map((item, index) => {
|
|
9558
9554
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9559
9555
|
"div",
|
|
9560
9556
|
{
|
|
@@ -9569,7 +9565,7 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
9569
9565
|
item.value ? item.value : index
|
|
9570
9566
|
);
|
|
9571
9567
|
}),
|
|
9572
|
-
!threeDimensional &&
|
|
9568
|
+
!threeDimensional && options.map((item, index) => {
|
|
9573
9569
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9574
9570
|
"div",
|
|
9575
9571
|
{
|
|
@@ -9587,13 +9583,13 @@ const InternalPickerSlot = (props, ref) => {
|
|
|
9587
9583
|
}
|
|
9588
9584
|
),
|
|
9589
9585
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-picker-mask" }),
|
|
9590
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-picker-indicator", ref:
|
|
9586
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-picker-indicator", ref: listRef })
|
|
9591
9587
|
]
|
|
9592
9588
|
}
|
|
9593
9589
|
);
|
|
9594
9590
|
};
|
|
9595
|
-
const
|
|
9596
|
-
const
|
|
9591
|
+
const PickerPanel = React__default.forwardRef(InternalPickerPanel);
|
|
9592
|
+
const PickerPanel$1 = PickerPanel;
|
|
9597
9593
|
function useRefs() {
|
|
9598
9594
|
const refs = React__default.useRef([]);
|
|
9599
9595
|
const setRefs = React__default.useCallback(
|
|
@@ -9608,181 +9604,247 @@ function useRefs() {
|
|
|
9608
9604
|
}, []);
|
|
9609
9605
|
return [refs.current, setRefs, reset];
|
|
9610
9606
|
}
|
|
9607
|
+
const defaultProps$Z = {
|
|
9608
|
+
...ComponentDefaults,
|
|
9609
|
+
visible: false,
|
|
9610
|
+
title: "",
|
|
9611
|
+
options: [],
|
|
9612
|
+
value: [],
|
|
9613
|
+
defaultValue: [],
|
|
9614
|
+
threeDimensional: true,
|
|
9615
|
+
duration: 1e3
|
|
9616
|
+
};
|
|
9611
9617
|
const InternalPicker = (props, ref) => {
|
|
9612
9618
|
const { locale } = useConfig$1();
|
|
9613
9619
|
const {
|
|
9614
9620
|
visible,
|
|
9615
9621
|
title,
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
onConfirm,
|
|
9619
|
-
onClose,
|
|
9620
|
-
onCloseUpdate,
|
|
9621
|
-
onChange,
|
|
9622
|
+
options = [],
|
|
9623
|
+
defaultValue = [],
|
|
9622
9624
|
className,
|
|
9623
9625
|
style,
|
|
9624
9626
|
threeDimensional,
|
|
9625
|
-
|
|
9627
|
+
duration,
|
|
9628
|
+
onConfirm,
|
|
9629
|
+
onClose,
|
|
9630
|
+
afterClose,
|
|
9631
|
+
onChange,
|
|
9626
9632
|
...rest
|
|
9627
|
-
} = props;
|
|
9628
|
-
const
|
|
9629
|
-
const
|
|
9633
|
+
} = { ...defaultProps$Z, ...props };
|
|
9634
|
+
const classPrefix2 = "nut-picker";
|
|
9635
|
+
const classes = classNames(classPrefix2, className);
|
|
9636
|
+
const [selectedValue, setSelectedValue] = usePropsValue({
|
|
9637
|
+
value: props.value,
|
|
9638
|
+
defaultValue: [...defaultValue],
|
|
9639
|
+
finalValue: [...defaultValue],
|
|
9640
|
+
onChange: (val) => {
|
|
9641
|
+
var _a;
|
|
9642
|
+
(_a = props.onConfirm) == null ? void 0 : _a.call(props, setSelectedOptions(), val);
|
|
9643
|
+
}
|
|
9644
|
+
});
|
|
9645
|
+
const [currentValue2, setCurrentValue] = useState([]);
|
|
9646
|
+
const [columnIndex, setColumnIndex] = useState(0);
|
|
9630
9647
|
const pickerRef = useRef(null);
|
|
9631
9648
|
const [refs, setRefs] = useRefs();
|
|
9632
9649
|
const [columnsList, setColumnsList] = useState([]);
|
|
9633
|
-
const b2 = cn("picker");
|
|
9634
9650
|
const isConfirmEvent = useRef(false);
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9651
|
+
const formatCascade = (columns, values) => {
|
|
9652
|
+
const formatted = [];
|
|
9653
|
+
let columnOptions = {
|
|
9654
|
+
text: "",
|
|
9655
|
+
value: "",
|
|
9656
|
+
children: columns
|
|
9657
|
+
};
|
|
9658
|
+
let columnIndex2 = 0;
|
|
9659
|
+
while (columnOptions && columnOptions.children) {
|
|
9660
|
+
const options2 = columnOptions.children;
|
|
9661
|
+
const value = values[columnIndex2];
|
|
9662
|
+
let index = options2.findIndex(
|
|
9663
|
+
(columnItem) => columnItem.value === value
|
|
9664
|
+
);
|
|
9665
|
+
if (index === -1)
|
|
9666
|
+
index = 0;
|
|
9667
|
+
columnOptions = columnOptions.children[index];
|
|
9668
|
+
columnIndex2++;
|
|
9669
|
+
formatted.push(options2);
|
|
9640
9670
|
}
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9671
|
+
return formatted;
|
|
9672
|
+
};
|
|
9673
|
+
const columnsType = () => {
|
|
9674
|
+
const firstColumn = options[0];
|
|
9675
|
+
if (firstColumn) {
|
|
9676
|
+
if (Array.isArray(firstColumn)) {
|
|
9677
|
+
return "multiple";
|
|
9678
|
+
}
|
|
9679
|
+
if ("children" in firstColumn) {
|
|
9680
|
+
return "cascade";
|
|
9681
|
+
}
|
|
9647
9682
|
}
|
|
9648
|
-
|
|
9649
|
-
useEffect(() => {
|
|
9650
|
-
init();
|
|
9651
|
-
}, [listData]);
|
|
9652
|
-
const closeActionSheet = () => {
|
|
9653
|
-
onClose && onClose(chooseValueData, selectedOptions());
|
|
9654
|
-
onCloseUpdate && onCloseUpdate(chooseValueData, selectedOptions(), pickerRef);
|
|
9683
|
+
return "single";
|
|
9655
9684
|
};
|
|
9656
|
-
const
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
9685
|
+
const normalListData = () => {
|
|
9686
|
+
const type = columnsType();
|
|
9687
|
+
switch (type) {
|
|
9688
|
+
case "multiple":
|
|
9689
|
+
return options;
|
|
9690
|
+
case "cascade":
|
|
9691
|
+
return formatCascade(options, selectedValue);
|
|
9692
|
+
default:
|
|
9693
|
+
return [options];
|
|
9694
|
+
}
|
|
9695
|
+
};
|
|
9696
|
+
const init = () => {
|
|
9697
|
+
const normalData = normalListData();
|
|
9698
|
+
setColumnsList(normalData);
|
|
9699
|
+
const data = [];
|
|
9700
|
+
normalData.length > 0 && normalData.map((item) => {
|
|
9701
|
+
item[0] && data.push(item[0].value);
|
|
9702
|
+
return item;
|
|
9662
9703
|
});
|
|
9663
|
-
if (
|
|
9664
|
-
|
|
9665
|
-
} else {
|
|
9666
|
-
onConfirm && onConfirm(chooseValueData, selectedOptions());
|
|
9704
|
+
if (!defaultValue.length && selectedValue.length === 0) {
|
|
9705
|
+
setSelectedValue([...data]);
|
|
9667
9706
|
}
|
|
9668
|
-
onClose && onClose(chooseValueData, selectedOptions());
|
|
9669
|
-
setTimeout(() => {
|
|
9670
|
-
isConfirmEvent.current = false;
|
|
9671
|
-
}, 0);
|
|
9672
9707
|
};
|
|
9673
|
-
|
|
9674
|
-
|
|
9675
|
-
|
|
9676
|
-
|
|
9677
|
-
|
|
9678
|
-
|
|
9708
|
+
useEffect(() => {
|
|
9709
|
+
if (!visible) {
|
|
9710
|
+
return;
|
|
9711
|
+
}
|
|
9712
|
+
init();
|
|
9713
|
+
}, [options, visible]);
|
|
9714
|
+
const setSelectedOptions = () => {
|
|
9715
|
+
const options2 = [];
|
|
9716
|
+
let currOptions = [];
|
|
9717
|
+
columnsList.forEach((columnOptions, index) => {
|
|
9718
|
+
currOptions = columnOptions.filter(
|
|
9719
|
+
(item) => item.value === selectedValue[index]
|
|
9679
9720
|
);
|
|
9680
9721
|
if (currOptions[0]) {
|
|
9681
|
-
|
|
9722
|
+
options2.push(currOptions[0]);
|
|
9682
9723
|
} else {
|
|
9683
|
-
|
|
9724
|
+
columnOptions[0] && options2.push(columnOptions[0]);
|
|
9684
9725
|
}
|
|
9685
|
-
return column;
|
|
9686
9726
|
});
|
|
9687
|
-
return
|
|
9727
|
+
return options2;
|
|
9728
|
+
};
|
|
9729
|
+
const defaultValuesConvert = () => {
|
|
9730
|
+
const defaultIndexs = [];
|
|
9731
|
+
if (selectedValue.length > 0) {
|
|
9732
|
+
selectedValue.forEach((value, index) => {
|
|
9733
|
+
var _a;
|
|
9734
|
+
for (let i = 0; i < ((_a = columnsList == null ? void 0 : columnsList[index]) == null ? void 0 : _a.length); i++) {
|
|
9735
|
+
if (columnsList[index][i].value === value) {
|
|
9736
|
+
defaultIndexs.push(i);
|
|
9737
|
+
break;
|
|
9738
|
+
}
|
|
9739
|
+
}
|
|
9740
|
+
});
|
|
9741
|
+
} else if (columnsList && columnsList.length > 0) {
|
|
9742
|
+
columnsList.forEach((item) => {
|
|
9743
|
+
defaultIndexs.push(0);
|
|
9744
|
+
item.length > 0 && selectedValue.push(item[0].value);
|
|
9745
|
+
});
|
|
9746
|
+
}
|
|
9747
|
+
return defaultIndexs;
|
|
9688
9748
|
};
|
|
9689
|
-
|
|
9690
|
-
if (
|
|
9691
|
-
|
|
9749
|
+
useEffect(() => {
|
|
9750
|
+
if (!visible) {
|
|
9751
|
+
return;
|
|
9752
|
+
}
|
|
9753
|
+
Taro.getEnv() !== "WEB" && setCurrentValue(defaultValuesConvert());
|
|
9754
|
+
onChange && onChange(setSelectedOptions(), selectedValue, columnIndex);
|
|
9755
|
+
if (isConfirmEvent.current) {
|
|
9756
|
+
isConfirmEvent.current = false;
|
|
9757
|
+
onConfirm && onConfirm(setSelectedOptions(), selectedValue);
|
|
9758
|
+
}
|
|
9759
|
+
}, [selectedValue, columnsList, visible]);
|
|
9760
|
+
const chooseItem = (columnOptions, columnIndex2) => {
|
|
9761
|
+
var _a, _b;
|
|
9762
|
+
if (columnOptions && Object.keys(columnOptions).length) {
|
|
9763
|
+
if (selectedValue[columnIndex2] !== columnOptions.value) {
|
|
9692
9764
|
if (columnsType() === "cascade") {
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
|
|
9700
|
-
index++;
|
|
9701
|
-
const cc = cursor.children[0];
|
|
9702
|
-
cursor = cc;
|
|
9765
|
+
selectedValue[columnIndex2] = columnOptions.value || "";
|
|
9766
|
+
setSelectedValue([...selectedValue]);
|
|
9767
|
+
while ((_a = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _a[0]) {
|
|
9768
|
+
selectedValue[columnIndex2 + 1] = columnOptions.children[0].value;
|
|
9769
|
+
setSelectedValue([...selectedValue]);
|
|
9770
|
+
columnIndex2++;
|
|
9771
|
+
columnOptions = columnOptions.children[0];
|
|
9703
9772
|
}
|
|
9704
|
-
if (
|
|
9705
|
-
|
|
9706
|
-
|
|
9773
|
+
if ((_b = columnOptions == null ? void 0 : columnOptions.children) == null ? void 0 : _b.length) {
|
|
9774
|
+
selectedValue[columnIndex2 + 1] = "";
|
|
9775
|
+
setSelectedValue([...selectedValue]);
|
|
9707
9776
|
}
|
|
9708
9777
|
setColumnsList(normalListData());
|
|
9709
9778
|
} else {
|
|
9710
|
-
|
|
9779
|
+
setSelectedValue((data) => {
|
|
9711
9780
|
const cdata = [...data];
|
|
9712
9781
|
cdata[columnIndex2] = Object.prototype.hasOwnProperty.call(
|
|
9713
|
-
|
|
9782
|
+
columnOptions,
|
|
9714
9783
|
"value"
|
|
9715
|
-
) ?
|
|
9784
|
+
) ? columnOptions.value : "";
|
|
9716
9785
|
return cdata;
|
|
9717
9786
|
});
|
|
9718
9787
|
}
|
|
9719
|
-
|
|
9788
|
+
setColumnIndex(columnIndex2);
|
|
9720
9789
|
}
|
|
9721
9790
|
}
|
|
9722
9791
|
};
|
|
9723
|
-
const
|
|
9724
|
-
|
|
9725
|
-
|
|
9726
|
-
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
|
|
9792
|
+
const confirm = () => {
|
|
9793
|
+
let movings = false;
|
|
9794
|
+
refs.forEach((ref2) => {
|
|
9795
|
+
if (ref2.moving)
|
|
9796
|
+
movings = true;
|
|
9797
|
+
ref2.stopMomentum();
|
|
9798
|
+
});
|
|
9799
|
+
if (movings) {
|
|
9800
|
+
isConfirmEvent.current = true;
|
|
9801
|
+
} else {
|
|
9802
|
+
onConfirm && onConfirm(setSelectedOptions(), selectedValue);
|
|
9803
|
+
closePicker();
|
|
9732
9804
|
}
|
|
9805
|
+
setTimeout(() => {
|
|
9806
|
+
isConfirmEvent.current = false;
|
|
9807
|
+
}, 0);
|
|
9733
9808
|
};
|
|
9734
|
-
const
|
|
9735
|
-
|
|
9736
|
-
|
|
9737
|
-
if (Array.isArray(firstColumn)) {
|
|
9738
|
-
return "multiple";
|
|
9739
|
-
}
|
|
9740
|
-
if ("children" in firstColumn) {
|
|
9741
|
-
return "cascade";
|
|
9742
|
-
}
|
|
9743
|
-
}
|
|
9744
|
-
return "single";
|
|
9809
|
+
const closePicker = () => {
|
|
9810
|
+
onClose && onClose(setSelectedOptions(), selectedValue);
|
|
9811
|
+
afterClose && afterClose(setSelectedOptions(), selectedValue, pickerRef);
|
|
9745
9812
|
};
|
|
9746
|
-
const
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
);
|
|
9760
|
-
if (index === -1)
|
|
9761
|
-
index = 0;
|
|
9762
|
-
cursor = cursor.children[index];
|
|
9763
|
-
columnIndex2++;
|
|
9764
|
-
formatted.push(options);
|
|
9765
|
-
}
|
|
9766
|
-
return formatted;
|
|
9813
|
+
const renderTitleBar = () => {
|
|
9814
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2}__control`, children: [
|
|
9815
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9816
|
+
"span",
|
|
9817
|
+
{
|
|
9818
|
+
className: `${classPrefix2}__cancel-btn`,
|
|
9819
|
+
onClick: () => closePicker(),
|
|
9820
|
+
children: locale.cancel
|
|
9821
|
+
}
|
|
9822
|
+
),
|
|
9823
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__title`, children: title || "" }),
|
|
9824
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `${classPrefix2}__confirm-btn`, onClick: confirm, children: locale.confirm })
|
|
9825
|
+
] });
|
|
9767
9826
|
};
|
|
9768
|
-
const
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
setColumnsList(normalData);
|
|
9772
|
-
normalData.length > 0 && normalData.map((item) => {
|
|
9773
|
-
item[0] && data.push(item[0].value);
|
|
9774
|
-
return item;
|
|
9775
|
-
});
|
|
9776
|
-
if (!defaultValueData && chooseValueData.length === 0) {
|
|
9777
|
-
setchooseValueData([...data]);
|
|
9778
|
-
}
|
|
9827
|
+
const [pickingStatus, setPickingStatus] = useState(false);
|
|
9828
|
+
const pickerStart = () => {
|
|
9829
|
+
setPickingStatus(true);
|
|
9779
9830
|
};
|
|
9780
|
-
const
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9831
|
+
const pickerEnd = () => {
|
|
9832
|
+
setPickingStatus(false);
|
|
9833
|
+
};
|
|
9834
|
+
const pickerChange = (data) => {
|
|
9835
|
+
const prevDefaultValue = currentValue2;
|
|
9836
|
+
let changeIndex = 0;
|
|
9837
|
+
const list = data.detail.value;
|
|
9838
|
+
for (let i = 0, len = list.length; i < len; i++) {
|
|
9839
|
+
if (prevDefaultValue[i] !== list[i]) {
|
|
9840
|
+
changeIndex = i;
|
|
9841
|
+
break;
|
|
9842
|
+
}
|
|
9843
|
+
}
|
|
9844
|
+
chooseItem(
|
|
9845
|
+
columnsList[changeIndex][data.detail.value[changeIndex]],
|
|
9846
|
+
changeIndex
|
|
9847
|
+
);
|
|
9786
9848
|
};
|
|
9787
9849
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9788
9850
|
Popup,
|
|
@@ -9790,36 +9852,50 @@ const InternalPicker = (props, ref) => {
|
|
|
9790
9852
|
visible,
|
|
9791
9853
|
position: "bottom",
|
|
9792
9854
|
onClose: () => {
|
|
9793
|
-
|
|
9855
|
+
closePicker();
|
|
9794
9856
|
},
|
|
9795
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
9796
|
-
|
|
9797
|
-
{
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9857
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(View, { className: classes, style, ...rest, catchMove: true, children: [
|
|
9858
|
+
renderTitleBar(),
|
|
9859
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__panel`, ref: pickerRef, children: Taro.getEnv() === "WEB" ? columnsList == null ? void 0 : columnsList.map((item, index) => {
|
|
9860
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9861
|
+
PickerPanel$1,
|
|
9862
|
+
{
|
|
9863
|
+
ref: setRefs(index),
|
|
9864
|
+
defaultValue: selectedValue == null ? void 0 : selectedValue[index],
|
|
9865
|
+
options: item,
|
|
9866
|
+
threeDimensional,
|
|
9867
|
+
chooseItem: (value, index2) => chooseItem(value, index2),
|
|
9868
|
+
duration,
|
|
9869
|
+
keyIndex: index,
|
|
9870
|
+
itemShow: visible
|
|
9871
|
+
},
|
|
9872
|
+
index
|
|
9873
|
+
);
|
|
9874
|
+
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9875
|
+
PickerView,
|
|
9876
|
+
{
|
|
9877
|
+
ref: pickerRef,
|
|
9878
|
+
value: currentValue2,
|
|
9879
|
+
immediateChange: true,
|
|
9880
|
+
onPickStart: pickerStart,
|
|
9881
|
+
onChange: pickerChange,
|
|
9882
|
+
onPickEnd: pickerEnd,
|
|
9883
|
+
className: "nut-picker-view-panel",
|
|
9884
|
+
children: columnsList == null ? void 0 : columnsList.map((columnOptions, index) => {
|
|
9885
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(PickerViewColumn, { children: columnOptions.map((item, index2) => {
|
|
9886
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9887
|
+
View,
|
|
9888
|
+
{
|
|
9889
|
+
className: "nut-picker-roller-item-title",
|
|
9890
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: item.text || item })
|
|
9891
|
+
},
|
|
9892
|
+
item.value || index2
|
|
9893
|
+
);
|
|
9894
|
+
}) }, `col${index}`);
|
|
9895
|
+
})
|
|
9896
|
+
}
|
|
9897
|
+
) })
|
|
9898
|
+
] })
|
|
9823
9899
|
}
|
|
9824
9900
|
);
|
|
9825
9901
|
};
|
|
@@ -9864,7 +9940,7 @@ const DatePicker = (props) => {
|
|
|
9864
9940
|
const [show, setShow] = useState(false);
|
|
9865
9941
|
const [currentDate, setCurrentDate] = useState(modelValue);
|
|
9866
9942
|
const [defaultValue, setDefaultValue] = useState([]);
|
|
9867
|
-
const [
|
|
9943
|
+
const [options, setListData] = useState([]);
|
|
9868
9944
|
const pickerRef = useRef(null);
|
|
9869
9945
|
const isDate = (val) => {
|
|
9870
9946
|
return Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
|
|
@@ -9982,7 +10058,7 @@ const DatePicker = (props) => {
|
|
|
9982
10058
|
}
|
|
9983
10059
|
return result;
|
|
9984
10060
|
};
|
|
9985
|
-
const updateChooseValueCustmer = (
|
|
10061
|
+
const updateChooseValueCustmer = (cacheValueData, selectedValue, index) => {
|
|
9986
10062
|
if (["date", "datetime", "datehour", "month-day", "year-month"].includes(
|
|
9987
10063
|
type.toLocaleLowerCase()
|
|
9988
10064
|
)) {
|
|
@@ -10021,7 +10097,7 @@ const DatePicker = (props) => {
|
|
|
10021
10097
|
const isEqual2 = (currentDate == null ? void 0 : currentDate.getTime()) === (date == null ? void 0 : date.getTime());
|
|
10022
10098
|
date && isDate(date) && !isEqual2 && setCurrentDate(formatValue(date));
|
|
10023
10099
|
}
|
|
10024
|
-
props.onChange && props.onChange(
|
|
10100
|
+
props.onChange && props.onChange(cacheValueData, selectedValue, index);
|
|
10025
10101
|
};
|
|
10026
10102
|
const padZero = (num, targetLength = 2) => {
|
|
10027
10103
|
let str = `${num}`;
|
|
@@ -10118,16 +10194,16 @@ const DatePicker = (props) => {
|
|
|
10118
10194
|
style,
|
|
10119
10195
|
catchMove: true,
|
|
10120
10196
|
...rest,
|
|
10121
|
-
children:
|
|
10197
|
+
children: options.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10122
10198
|
Picker$1,
|
|
10123
10199
|
{
|
|
10124
10200
|
title,
|
|
10125
10201
|
visible: show,
|
|
10126
|
-
|
|
10202
|
+
options,
|
|
10127
10203
|
onClose: onCloseDatePicker,
|
|
10128
|
-
|
|
10129
|
-
onConfirm: (
|
|
10130
|
-
onChange: (
|
|
10204
|
+
defaultValue,
|
|
10205
|
+
onConfirm: (options2, values) => onConfirmDatePicker && onConfirmDatePicker(options2, values),
|
|
10206
|
+
onChange: (list, value, index) => updateChooseValueCustmer(list, value, index),
|
|
10131
10207
|
threeDimensional,
|
|
10132
10208
|
ref: pickerRef
|
|
10133
10209
|
}
|
|
@@ -12931,124 +13007,111 @@ const Switch = (props) => {
|
|
|
12931
13007
|
Switch.defaultProps = defaultProps$I;
|
|
12932
13008
|
Switch.displayName = "NutSwitch";
|
|
12933
13009
|
const defaultProps$H = {
|
|
13010
|
+
...ComponentDefaults,
|
|
12934
13011
|
defaultValue: "",
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
maxlength: "",
|
|
12938
|
-
rows: "",
|
|
13012
|
+
showCount: false,
|
|
13013
|
+
maxLength: 140,
|
|
12939
13014
|
placeholder: "",
|
|
12940
|
-
|
|
13015
|
+
readOnly: false,
|
|
12941
13016
|
disabled: false,
|
|
12942
|
-
|
|
13017
|
+
autoSize: false
|
|
12943
13018
|
};
|
|
12944
13019
|
const TextArea = (props) => {
|
|
12945
13020
|
const { locale } = useConfig$1();
|
|
12946
13021
|
const {
|
|
12947
13022
|
className,
|
|
13023
|
+
value,
|
|
12948
13024
|
defaultValue,
|
|
12949
|
-
|
|
12950
|
-
|
|
12951
|
-
maxlength,
|
|
13025
|
+
showCount,
|
|
13026
|
+
maxLength,
|
|
12952
13027
|
rows,
|
|
12953
13028
|
placeholder,
|
|
12954
|
-
|
|
13029
|
+
readOnly,
|
|
12955
13030
|
disabled,
|
|
12956
|
-
|
|
13031
|
+
autoSize,
|
|
12957
13032
|
style,
|
|
12958
13033
|
onChange,
|
|
12959
13034
|
onBlur,
|
|
12960
|
-
onFocus
|
|
13035
|
+
onFocus,
|
|
13036
|
+
...rest
|
|
12961
13037
|
} = { ...defaultProps$H, ...props };
|
|
12962
|
-
const
|
|
12963
|
-
const
|
|
12964
|
-
const
|
|
12965
|
-
|
|
12966
|
-
|
|
12967
|
-
useEffect(() => {
|
|
12968
|
-
let initValue = defaultValue;
|
|
12969
|
-
if (initValue && maxlength && [...initValue].length > Number(maxlength)) {
|
|
12970
|
-
initValue = initValue.substring(0, Number(maxlength));
|
|
13038
|
+
const classPrefix2 = "nut-textarea";
|
|
13039
|
+
const compositionRef = useRef(false);
|
|
13040
|
+
const format = (value2) => {
|
|
13041
|
+
if (maxLength !== void 0 && value2.length > maxLength) {
|
|
13042
|
+
return value2.substring(0, maxLength);
|
|
12971
13043
|
}
|
|
12972
|
-
|
|
12973
|
-
}
|
|
12974
|
-
const
|
|
12975
|
-
|
|
12976
|
-
|
|
12977
|
-
|
|
12978
|
-
|
|
12979
|
-
|
|
12980
|
-
|
|
12981
|
-
|
|
12982
|
-
|
|
12983
|
-
if (text
|
|
12984
|
-
|
|
13044
|
+
return value2;
|
|
13045
|
+
};
|
|
13046
|
+
const [inputValue, setInputValue] = usePropsValue({
|
|
13047
|
+
value,
|
|
13048
|
+
defaultValue,
|
|
13049
|
+
finalValue: format(defaultValue),
|
|
13050
|
+
onChange
|
|
13051
|
+
});
|
|
13052
|
+
const handleChange = (event) => {
|
|
13053
|
+
var _a;
|
|
13054
|
+
const text = (_a = event == null ? void 0 : event.detail) == null ? void 0 : _a.value;
|
|
13055
|
+
if (text) {
|
|
13056
|
+
const value2 = compositionRef.current ? text : format(text);
|
|
13057
|
+
setInputValue(value2);
|
|
12985
13058
|
} else {
|
|
12986
|
-
|
|
13059
|
+
setInputValue("");
|
|
12987
13060
|
}
|
|
12988
|
-
onChange && onChange(text.value, event);
|
|
12989
13061
|
};
|
|
12990
|
-
const
|
|
13062
|
+
const handleFocus = (event) => {
|
|
12991
13063
|
if (disabled)
|
|
12992
13064
|
return;
|
|
12993
|
-
if (
|
|
13065
|
+
if (readOnly)
|
|
12994
13066
|
return;
|
|
12995
13067
|
onFocus && onFocus(event);
|
|
12996
13068
|
};
|
|
12997
|
-
const
|
|
13069
|
+
const handleBlur = (event) => {
|
|
12998
13070
|
if (disabled)
|
|
12999
13071
|
return;
|
|
13000
|
-
if (
|
|
13072
|
+
if (readOnly)
|
|
13001
13073
|
return;
|
|
13002
|
-
const text = event.detail ? event.detail : event.target;
|
|
13003
|
-
onChange && onChange(text.value, event);
|
|
13004
13074
|
onBlur && onBlur(event);
|
|
13005
13075
|
};
|
|
13006
|
-
const startComposing = () => {
|
|
13007
|
-
compositingRef.current = true;
|
|
13008
|
-
};
|
|
13009
|
-
const endComposing = () => {
|
|
13010
|
-
compositingRef.current = false;
|
|
13011
|
-
};
|
|
13012
13076
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
13013
13077
|
"div",
|
|
13014
13078
|
{
|
|
13015
|
-
className:
|
|
13079
|
+
className: classNames(classPrefix2, className, {
|
|
13080
|
+
[`${classPrefix2}__disabled`]: disabled
|
|
13081
|
+
}),
|
|
13016
13082
|
children: [
|
|
13017
13083
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
13018
|
-
|
|
13084
|
+
Textarea,
|
|
13019
13085
|
{
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
|
|
13024
|
-
|
|
13086
|
+
nativeProps: {
|
|
13087
|
+
style,
|
|
13088
|
+
readOnly,
|
|
13089
|
+
rows,
|
|
13090
|
+
onCompositionStart: () => {
|
|
13091
|
+
compositionRef.current = true;
|
|
13092
|
+
},
|
|
13093
|
+
onCompositionEnd: () => {
|
|
13094
|
+
compositionRef.current = false;
|
|
13095
|
+
}
|
|
13025
13096
|
},
|
|
13026
|
-
|
|
13097
|
+
className: `${classPrefix2}__textarea`,
|
|
13098
|
+
style: Taro.getEnv() === "WEB" ? void 0 : style,
|
|
13099
|
+
disabled: Taro.getEnv() === "WEB" ? disabled : disabled || readOnly,
|
|
13027
13100
|
value: inputValue,
|
|
13028
|
-
onInput: (e) =>
|
|
13029
|
-
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
|
|
13034
|
-
|
|
13035
|
-
textBlur(e);
|
|
13036
|
-
},
|
|
13037
|
-
onFocus: (e) => {
|
|
13038
|
-
textFocus(e);
|
|
13039
|
-
},
|
|
13040
|
-
onCompositionEnd: (e) => endComposing(),
|
|
13041
|
-
onCompositionStart: (e) => startComposing(),
|
|
13042
|
-
rows,
|
|
13043
|
-
maxLength: maxlength < 0 ? 0 : maxlength,
|
|
13044
|
-
placeholder: placeholder || locale.placeholder
|
|
13101
|
+
onInput: (e) => handleChange(e),
|
|
13102
|
+
onBlur: (e) => handleBlur(e),
|
|
13103
|
+
onFocus: (e) => handleFocus(e),
|
|
13104
|
+
autoHeight: autoSize,
|
|
13105
|
+
maxlength: maxLength,
|
|
13106
|
+
placeholder: placeholder || locale.placeholder,
|
|
13107
|
+
...rest
|
|
13045
13108
|
}
|
|
13046
13109
|
),
|
|
13047
|
-
|
|
13048
|
-
|
|
13110
|
+
showCount && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${classPrefix2}__limit`, children: [
|
|
13111
|
+
inputValue.length,
|
|
13049
13112
|
"/",
|
|
13050
|
-
|
|
13051
|
-
] })
|
|
13113
|
+
maxLength < 0 ? 0 : maxLength
|
|
13114
|
+
] })
|
|
13052
13115
|
]
|
|
13053
13116
|
}
|
|
13054
13117
|
);
|
|
@@ -22623,13 +22686,11 @@ Steps.defaultProps = defaultProps$a;
|
|
|
22623
22686
|
Steps.displayName = "NutSteps";
|
|
22624
22687
|
const defaultProps$9 = {
|
|
22625
22688
|
...ComponentDefaults,
|
|
22626
|
-
className: "",
|
|
22627
|
-
style: {},
|
|
22628
22689
|
columns: [],
|
|
22629
22690
|
data: [],
|
|
22630
22691
|
bordered: true,
|
|
22631
22692
|
striped: false,
|
|
22632
|
-
noData: "
|
|
22693
|
+
noData: "",
|
|
22633
22694
|
sorterIcon: null,
|
|
22634
22695
|
showHeader: true
|
|
22635
22696
|
};
|
|
@@ -22647,8 +22708,8 @@ const Table = (props) => {
|
|
|
22647
22708
|
striped,
|
|
22648
22709
|
noData,
|
|
22649
22710
|
sorterIcon,
|
|
22650
|
-
onSorter,
|
|
22651
22711
|
showHeader,
|
|
22712
|
+
onSort,
|
|
22652
22713
|
...rest
|
|
22653
22714
|
} = {
|
|
22654
22715
|
...defaultProps$9,
|
|
@@ -22660,12 +22721,13 @@ const Table = (props) => {
|
|
|
22660
22721
|
setCurData(data);
|
|
22661
22722
|
}
|
|
22662
22723
|
}, [data]);
|
|
22663
|
-
const
|
|
22664
|
-
const
|
|
22665
|
-
const
|
|
22724
|
+
const classPrefix2 = "nut-table";
|
|
22725
|
+
const headerClassPrefix = `${classPrefix2}__main__head__tr`;
|
|
22726
|
+
const bodyClassPrefix = `${classPrefix2}__main__body__tr`;
|
|
22727
|
+
const cls = classNames(classPrefix2, className);
|
|
22666
22728
|
const handleSorterClick = (item) => {
|
|
22667
22729
|
if (item.sorter) {
|
|
22668
|
-
|
|
22730
|
+
onSort && onSort(item, curData);
|
|
22669
22731
|
if (typeof item.sorter === "function") {
|
|
22670
22732
|
setCurData(curData.sort(item.sorter));
|
|
22671
22733
|
} else {
|
|
@@ -22675,8 +22737,8 @@ const Table = (props) => {
|
|
|
22675
22737
|
};
|
|
22676
22738
|
const cellClasses = (item) => {
|
|
22677
22739
|
return {
|
|
22678
|
-
|
|
22679
|
-
[
|
|
22740
|
+
[`${headerClassPrefix}--border`]: props.bordered,
|
|
22741
|
+
[`${headerClassPrefix}--align${item.align ? item.align : ""}`]: true
|
|
22680
22742
|
};
|
|
22681
22743
|
};
|
|
22682
22744
|
const getColumnItem = (value) => {
|
|
@@ -22687,10 +22749,7 @@ const Table = (props) => {
|
|
|
22687
22749
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
22688
22750
|
"span",
|
|
22689
22751
|
{
|
|
22690
|
-
className: classNames(
|
|
22691
|
-
"nut-table__main__head__tr__th",
|
|
22692
|
-
cellClasses(item)
|
|
22693
|
-
),
|
|
22752
|
+
className: classNames(`${headerClassPrefix}__th`, cellClasses(item)),
|
|
22694
22753
|
onClick: () => handleSorterClick(item),
|
|
22695
22754
|
children: [
|
|
22696
22755
|
item.title,
|
|
@@ -22713,7 +22772,7 @@ const Table = (props) => {
|
|
|
22713
22772
|
"span",
|
|
22714
22773
|
{
|
|
22715
22774
|
className: classNames(
|
|
22716
|
-
|
|
22775
|
+
`${bodyClassPrefix}__td`,
|
|
22717
22776
|
cellClasses(getColumnItem(value))
|
|
22718
22777
|
),
|
|
22719
22778
|
children: typeof item[value] === "function" || typeof render === "function" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: render ? render(item) : item[value](item) }) : item[value]
|
|
@@ -22724,24 +22783,23 @@ const Table = (props) => {
|
|
|
22724
22783
|
};
|
|
22725
22784
|
const renderBoyTrs = () => {
|
|
22726
22785
|
return curData.map((item, index) => {
|
|
22727
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className:
|
|
22786
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: bodyClassPrefix, children: renderBodyTds(item) }, index);
|
|
22728
22787
|
});
|
|
22729
22788
|
};
|
|
22730
22789
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cls, style, ...rest, children: [
|
|
22731
22790
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
22732
22791
|
"div",
|
|
22733
22792
|
{
|
|
22734
|
-
className: classNames(
|
|
22735
|
-
|
|
22793
|
+
className: classNames(`${classPrefix2}__main`, {
|
|
22794
|
+
[`${classPrefix2}__main--striped`]: striped
|
|
22736
22795
|
}),
|
|
22737
22796
|
children: [
|
|
22738
|
-
showHeader && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className:
|
|
22739
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className:
|
|
22797
|
+
showHeader && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__main__head`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: headerClassPrefix, children: renderHeadCells() }) }),
|
|
22798
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__main__body`, children: renderBoyTrs() })
|
|
22740
22799
|
]
|
|
22741
22800
|
}
|
|
22742
22801
|
),
|
|
22743
|
-
summary
|
|
22744
|
-
curData.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__nodata", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__nodata", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "nut-table__nodata__text", children: noData }) }) })
|
|
22802
|
+
(summary || curData.length === 0) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${classPrefix2}__summary`, children: summary || noData })
|
|
22745
22803
|
] });
|
|
22746
22804
|
};
|
|
22747
22805
|
Table.defaultProps = defaultProps$9;
|