@nutui/nutui-react-taro 3.0.0-beta.5 → 3.0.0-beta.7
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/README.md +39 -9
- package/dist/cjs/packages/actionsheet/actionsheet.js +6 -3
- package/dist/cjs/packages/actionsheet/style/actionsheet.scss +10 -4
- package/dist/cjs/packages/actionsheet/style/style.css +14 -6
- package/dist/cjs/packages/address/style/style.css +60 -92
- package/dist/cjs/packages/animate/style/animate.scss +0 -3
- package/dist/cjs/packages/animate/style/style.css +4 -3
- package/dist/cjs/packages/animatingnumbers/style/style.css +4 -0
- package/dist/cjs/packages/audio/style/style.css +4 -0
- package/dist/cjs/packages/avatar/style/style.css +4 -0
- package/dist/cjs/packages/avatarcropper/style/style.css +4 -0
- package/dist/cjs/packages/avatargroup/style/style.css +4 -0
- package/dist/cjs/packages/backtop/style/style.css +4 -0
- package/dist/cjs/packages/badge/style/style.css +4 -0
- package/dist/cjs/packages/barrage/style/style.css +4 -0
- package/dist/cjs/packages/button/style/style.css +4 -0
- package/dist/cjs/packages/calendar/style/style.css +4 -3
- package/dist/cjs/packages/calendarcard/style/calendarcard.scss +1 -1
- package/dist/cjs/packages/calendarcard/style/style.css +4 -0
- package/dist/cjs/packages/calendaritem/style/style.css +4 -0
- package/dist/cjs/packages/card/style/style.css +4 -0
- package/dist/cjs/packages/cascader/style/style.css +53 -88
- package/dist/cjs/packages/cell/style/style.css +4 -0
- package/dist/cjs/packages/cellgroup/style/style.css +4 -0
- package/dist/cjs/packages/checkbox/style/style.css +4 -0
- package/dist/cjs/packages/checkboxgroup/style/style.css +4 -0
- package/dist/cjs/packages/circleprogress/style/style.css +4 -0
- package/dist/cjs/packages/col/style/style.css +4 -0
- package/dist/cjs/packages/collapse/style/style.css +4 -0
- package/dist/cjs/packages/collapseitem/style/style.css +4 -0
- package/dist/cjs/packages/configprovider/style/style.css +4 -0
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/countdown/countdown.js +1 -1
- package/dist/cjs/packages/countdown/style/countdown.scss +21 -2
- package/dist/cjs/packages/countdown/style/style.css +24 -2
- package/dist/cjs/packages/countup/style/style.css +4 -0
- package/dist/cjs/packages/datepicker/style/style.css +4 -3
- package/dist/cjs/packages/dialog/style/style.css +4 -0
- package/dist/cjs/packages/divider/style/style.css +4 -0
- package/dist/cjs/packages/drag/style/style.css +4 -0
- package/dist/cjs/packages/elevator/elevator.js +28 -19
- package/dist/cjs/packages/elevator/style/elevator.scss +7 -4
- package/dist/cjs/packages/elevator/style/style.css +11 -4
- package/dist/cjs/packages/ellipsis/style/style.css +4 -0
- package/dist/cjs/packages/empty/empty.js +1 -1
- package/dist/cjs/packages/empty/style/empty.scss +9 -5
- package/dist/cjs/packages/empty/style/style.css +16 -7
- package/dist/cjs/packages/fixednav/style/style.css +4 -0
- package/dist/cjs/packages/form/style/style.css +4 -0
- package/dist/cjs/packages/formitem/style/style.css +4 -0
- package/dist/cjs/packages/grid/style/style.css +4 -0
- package/dist/cjs/packages/griditem/style/style.css +4 -0
- package/dist/cjs/packages/hoverbutton/hoverbutton.js +2 -1
- package/dist/cjs/packages/hoverbutton/style/style.css +37 -12
- package/dist/cjs/packages/hoverbutton/utils.d.ts +1 -0
- package/dist/cjs/packages/hoverbutton/utils.js +11 -0
- package/dist/cjs/packages/hoverbuttonitem/hoverbuttonitem.js +16 -8
- package/dist/cjs/packages/hoverbuttonitem/style/hoverbuttonitem.scss +25 -0
- package/dist/cjs/packages/hoverbuttonitem/style/style.css +33 -8
- package/dist/cjs/packages/hoverbuttonitem/utils.d.ts +2 -0
- package/dist/cjs/packages/hoverbuttonitem/utils.js +18 -0
- package/dist/cjs/packages/image/style/style.css +4 -0
- package/dist/cjs/packages/imagepreview/imagepreview.js +8 -7
- package/dist/cjs/packages/imagepreview/style/imagepreview.scss +7 -0
- package/dist/cjs/packages/imagepreview/style/style.css +12 -3
- package/dist/cjs/packages/indicator/style/style.css +4 -0
- package/dist/cjs/packages/infiniteloading/style/style.css +4 -0
- package/dist/cjs/packages/input/style/style.css +4 -0
- package/dist/cjs/packages/inputnumber/inputnumber.js +0 -1
- package/dist/cjs/packages/inputnumber/style/inputnumber.scss +19 -16
- package/dist/cjs/packages/inputnumber/style/style.css +25 -19
- package/dist/cjs/packages/layout/style/style.css +4 -0
- package/dist/cjs/packages/loading/style/style.css +4 -0
- package/dist/cjs/packages/menu/style/style.css +4 -0
- package/dist/cjs/packages/menuitem/style/style.css +4 -0
- package/dist/cjs/packages/navbar/style/style.css +4 -0
- package/dist/cjs/packages/noticebar/style/style.css +4 -0
- package/dist/cjs/packages/notify/style/style.css +4 -0
- package/dist/cjs/packages/numberkeyboard/numberkeyboard.js +6 -5
- package/dist/cjs/packages/numberkeyboard/style/numberkeyboard.scss +10 -1
- package/dist/cjs/packages/numberkeyboard/style/style.css +16 -3
- package/dist/cjs/packages/nutui.react.build.d.ts +3 -1
- package/dist/cjs/packages/nutui.react.build.js +40 -36
- package/dist/cjs/packages/nutui.react.d.ts +4 -1
- package/dist/cjs/packages/nutui.react.js +41 -36
- package/dist/cjs/packages/nutui.react.scss.d.ts +1 -0
- package/dist/cjs/packages/nutui.react.scss.js +1 -0
- package/dist/cjs/packages/overlay/style/style.css +4 -0
- package/dist/cjs/packages/pagination/style/style.css +4 -0
- package/dist/cjs/packages/picker/style/style.css +4 -3
- package/dist/cjs/packages/popover/style/popover.scss +16 -11
- package/dist/cjs/packages/popover/style/style.css +18 -5
- package/dist/cjs/packages/popup/style/popup.scss +0 -3
- package/dist/cjs/packages/popup/style/style.css +4 -3
- package/dist/cjs/packages/price/style/style.css +4 -0
- package/dist/cjs/packages/progress/style/style.css +4 -0
- package/dist/cjs/packages/pulltorefresh/style/style.css +4 -0
- package/dist/cjs/packages/radio/style/style.css +4 -0
- package/dist/cjs/packages/radiogroup/style/style.css +4 -0
- package/dist/cjs/packages/range/style/style.css +4 -0
- package/dist/cjs/packages/rate/index.d.ts +1 -1
- package/dist/cjs/packages/rate/rate.d.ts +2 -16
- package/dist/cjs/packages/rate/rate.js +7 -3
- package/dist/cjs/packages/rate/style/rate.scss +94 -8
- package/dist/cjs/packages/rate/style/style.css +86 -8
- package/dist/cjs/packages/rate/types.d.ts +18 -0
- package/dist/cjs/packages/rate/types.js +4 -0
- package/dist/cjs/packages/resultpage/style/style.css +4 -0
- package/dist/cjs/packages/row/style/style.css +4 -0
- package/dist/cjs/packages/safearea/style/style.css +4 -0
- package/dist/cjs/packages/searchbar/style/style.css +4 -0
- package/dist/cjs/packages/segmented/index.d.ts +3 -0
- package/dist/cjs/packages/segmented/index.js +12 -0
- package/dist/cjs/packages/segmented/segmented.d.ts +3 -0
- package/dist/cjs/packages/segmented/segmented.js +76 -0
- package/dist/cjs/packages/segmented/style/css.js +1 -0
- package/dist/cjs/packages/segmented/style/index.js +1 -0
- package/dist/cjs/packages/segmented/style/segmented.scss +38 -0
- package/dist/cjs/packages/segmented/style/style.css +42 -0
- package/dist/cjs/packages/segmented/types.d.ts +15 -0
- package/dist/cjs/packages/segmented/types.js +4 -0
- package/dist/cjs/packages/shortpassword/style/style.css +4 -3
- package/dist/cjs/packages/sidenavbar/style/style.css +4 -3
- package/dist/cjs/packages/sidenavbaritem/style/style.css +4 -0
- package/dist/cjs/packages/signature/style/style.css +4 -0
- package/dist/cjs/packages/skeleton/style/style.css +4 -0
- package/dist/cjs/packages/space/style/style.css +4 -0
- package/dist/cjs/packages/step/style/style.css +4 -0
- package/dist/cjs/packages/steps/style/style.css +4 -0
- package/dist/cjs/packages/sticky/style/style.css +4 -0
- package/dist/cjs/packages/subsidenavbar/style/style.css +4 -0
- package/dist/cjs/packages/swipe/style/style.css +4 -0
- package/dist/cjs/packages/swiper/style/style.css +4 -0
- package/dist/cjs/packages/swiperitem/style/style.css +4 -0
- package/dist/cjs/packages/switch/style/style.css +50 -30
- package/dist/cjs/packages/switch/style/switch.scss +44 -28
- package/dist/cjs/packages/switch/switch.d.ts +2 -2
- package/dist/cjs/packages/switch/switch.js +3 -11
- package/dist/cjs/packages/tabbar/style/style.css +4 -0
- package/dist/cjs/packages/tabbaritem/style/style.css +4 -0
- package/dist/cjs/packages/table/style/style.css +4 -0
- package/dist/cjs/packages/tabpane/style/style.css +4 -0
- package/dist/cjs/packages/tabs/style/style.css +53 -85
- package/dist/cjs/packages/tabs/style/tabs.scss +68 -106
- package/dist/cjs/packages/tabs/tabs.js +2 -4
- package/dist/cjs/packages/tag/style/style.css +4 -0
- package/dist/cjs/packages/textarea/style/style.css +4 -0
- package/dist/cjs/packages/timedetail/style/style.css +6 -0
- package/dist/cjs/packages/timedetail/style/timedetail.scss +2 -0
- package/dist/cjs/packages/timeselect/style/style.css +6 -3
- package/dist/cjs/packages/toast/style/style.css +17 -10
- package/dist/cjs/packages/toast/style/toast.scss +14 -8
- package/dist/cjs/packages/toast/toast.d.ts +0 -5
- package/dist/cjs/packages/toast/toast.js +10 -24
- package/dist/cjs/packages/tour/style/style.css +18 -5
- package/dist/cjs/packages/trendarrow/style/style.css +4 -0
- package/dist/cjs/packages/uploader/style/style.css +4 -0
- package/dist/cjs/packages/video/style/style.css +4 -0
- package/dist/cjs/packages/virtuallist/style/style.css +4 -0
- package/dist/cjs/packages/watermark/style/style.css +4 -0
- package/dist/es/packages/actionsheet/actionsheet.d.ts +7 -35
- package/dist/es/packages/actionsheet/actionsheet.js +6 -3
- package/dist/es/packages/actionsheet/style/actionsheet.scss +10 -4
- package/dist/es/packages/actionsheet/style/style.css +14 -6
- package/dist/es/packages/address/style/style.css +60 -92
- package/dist/es/packages/animate/style/animate.scss +0 -3
- package/dist/es/packages/animate/style/style.css +4 -3
- package/dist/es/packages/animatingnumbers/style/style.css +4 -0
- package/dist/es/packages/audio/style/style.css +4 -0
- package/dist/es/packages/avatar/style/style.css +4 -0
- package/dist/es/packages/avatarcropper/style/style.css +4 -0
- package/dist/es/packages/avatargroup/style/style.css +4 -0
- package/dist/es/packages/backtop/style/style.css +4 -0
- package/dist/es/packages/badge/style/style.css +4 -0
- package/dist/es/packages/barrage/style/style.css +4 -0
- package/dist/es/packages/button/style/style.css +4 -0
- package/dist/es/packages/calendar/style/style.css +4 -3
- package/dist/es/packages/calendarcard/style/calendarcard.scss +1 -1
- package/dist/es/packages/calendarcard/style/style.css +4 -0
- package/dist/es/packages/calendaritem/style/style.css +4 -0
- package/dist/es/packages/card/style/style.css +4 -0
- package/dist/es/packages/cascader/style/style.css +53 -88
- package/dist/es/packages/cell/style/style.css +4 -0
- package/dist/es/packages/cellgroup/style/style.css +4 -0
- package/dist/es/packages/checkbox/style/style.css +4 -0
- package/dist/es/packages/checkboxgroup/style/style.css +4 -0
- package/dist/es/packages/circleprogress/style/style.css +4 -0
- package/dist/es/packages/col/style/style.css +4 -0
- package/dist/es/packages/collapse/style/style.css +4 -0
- package/dist/es/packages/collapseitem/style/style.css +4 -0
- package/dist/es/packages/configprovider/style/style.css +4 -0
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/countdown/countdown.js +1 -1
- package/dist/es/packages/countdown/style/countdown.scss +21 -2
- package/dist/es/packages/countdown/style/style.css +24 -2
- package/dist/es/packages/countup/style/style.css +4 -0
- package/dist/es/packages/datepicker/style/style.css +4 -3
- package/dist/es/packages/dialog/style/style.css +4 -0
- package/dist/es/packages/divider/style/style.css +4 -0
- package/dist/es/packages/drag/style/style.css +4 -0
- package/dist/es/packages/elevator/elevator.d.ts +9 -45
- package/dist/es/packages/elevator/elevator.js +30 -21
- package/dist/es/packages/elevator/style/elevator.scss +7 -4
- package/dist/es/packages/elevator/style/style.css +11 -4
- package/dist/es/packages/ellipsis/style/style.css +4 -0
- package/dist/es/packages/empty/empty.js +1 -1
- package/dist/es/packages/empty/style/empty.scss +9 -5
- package/dist/es/packages/empty/style/style.css +16 -7
- package/dist/es/packages/fixednav/style/style.css +4 -0
- package/dist/es/packages/form/style/style.css +4 -0
- package/dist/es/packages/formitem/style/style.css +4 -0
- package/dist/es/packages/grid/style/style.css +4 -0
- package/dist/es/packages/griditem/style/style.css +4 -0
- package/dist/es/packages/hoverbutton/hoverbutton.js +2 -1
- package/dist/es/packages/hoverbutton/style/style.css +37 -12
- package/dist/es/packages/hoverbutton/utils.d.ts +1 -0
- package/dist/es/packages/hoverbutton/utils.js +1 -0
- package/dist/es/packages/hoverbuttonitem/hoverbuttonitem.js +17 -9
- package/dist/es/packages/hoverbuttonitem/style/hoverbuttonitem.scss +25 -0
- package/dist/es/packages/hoverbuttonitem/style/style.css +33 -8
- package/dist/es/packages/hoverbuttonitem/utils.d.ts +2 -0
- package/dist/es/packages/hoverbuttonitem/utils.js +7 -0
- package/dist/es/packages/image/style/style.css +4 -0
- package/dist/es/packages/imagepreview/imagepreview.js +4 -3
- package/dist/es/packages/imagepreview/style/imagepreview.scss +7 -0
- package/dist/es/packages/imagepreview/style/style.css +12 -3
- package/dist/es/packages/indicator/style/style.css +4 -0
- package/dist/es/packages/infiniteloading/style/style.css +4 -0
- package/dist/es/packages/input/style/style.css +4 -0
- package/dist/es/packages/inputnumber/inputnumber.js +1 -2
- package/dist/es/packages/inputnumber/style/inputnumber.scss +19 -16
- package/dist/es/packages/inputnumber/style/style.css +25 -19
- package/dist/es/packages/layout/style/style.css +4 -0
- package/dist/es/packages/loading/style/style.css +4 -0
- package/dist/es/packages/menu/style/style.css +4 -0
- package/dist/es/packages/menuitem/style/style.css +4 -0
- package/dist/es/packages/navbar/style/style.css +4 -0
- package/dist/es/packages/noticebar/style/style.css +4 -0
- package/dist/es/packages/notify/style/style.css +4 -0
- package/dist/es/packages/numberkeyboard/numberkeyboard.d.ts +10 -50
- package/dist/es/packages/numberkeyboard/numberkeyboard.js +6 -5
- package/dist/es/packages/numberkeyboard/style/numberkeyboard.scss +10 -1
- package/dist/es/packages/numberkeyboard/style/style.css +16 -3
- package/dist/es/packages/nutui.react.build.d.ts +3 -1
- package/dist/es/packages/nutui.react.build.js +3 -1
- package/dist/es/packages/overlay/style/style.css +4 -0
- package/dist/es/packages/pagination/style/style.css +4 -0
- package/dist/es/packages/picker/style/style.css +4 -3
- package/dist/es/packages/popover/style/popover.scss +16 -11
- package/dist/es/packages/popover/style/style.css +18 -5
- package/dist/es/packages/popup/style/popup.scss +0 -3
- package/dist/es/packages/popup/style/style.css +4 -3
- package/dist/es/packages/price/style/style.css +4 -0
- package/dist/es/packages/progress/style/style.css +4 -0
- package/dist/es/packages/pulltorefresh/style/style.css +4 -0
- package/dist/es/packages/radio/style/style.css +4 -0
- package/dist/es/packages/radiogroup/style/style.css +4 -0
- package/dist/es/packages/range/style/style.css +4 -0
- package/dist/es/packages/rate/index.d.ts +1 -1
- package/dist/es/packages/rate/rate.d.ts +2 -16
- package/dist/es/packages/rate/rate.js +8 -4
- package/dist/es/packages/rate/style/rate.scss +94 -8
- package/dist/es/packages/rate/style/style.css +86 -8
- package/dist/es/packages/rate/types.d.ts +18 -0
- package/dist/es/packages/rate/types.js +1 -0
- package/dist/es/packages/resultpage/style/style.css +4 -0
- package/dist/es/packages/row/style/style.css +4 -0
- package/dist/es/packages/safearea/style/style.css +4 -0
- package/dist/es/packages/searchbar/style/style.css +4 -0
- package/dist/es/packages/segmented/index.d.ts +3 -0
- package/dist/es/packages/segmented/index.js +2 -0
- package/dist/es/packages/segmented/segmented.d.ts +3 -0
- package/dist/es/packages/segmented/segmented.js +64 -0
- package/dist/es/packages/segmented/style/css.js +1 -0
- package/dist/es/packages/segmented/style/index.js +1 -0
- package/dist/es/packages/segmented/style/segmented.scss +38 -0
- package/dist/es/packages/segmented/style/style.css +42 -0
- package/dist/es/packages/segmented/types.d.ts +15 -0
- package/dist/es/packages/segmented/types.js +1 -0
- package/dist/es/packages/shortpassword/style/style.css +4 -3
- package/dist/es/packages/sidenavbar/style/style.css +4 -3
- package/dist/es/packages/sidenavbaritem/style/style.css +4 -0
- package/dist/es/packages/signature/style/style.css +4 -0
- package/dist/es/packages/skeleton/style/style.css +4 -0
- package/dist/es/packages/space/style/style.css +4 -0
- package/dist/es/packages/step/style/style.css +4 -0
- package/dist/es/packages/steps/style/style.css +4 -0
- package/dist/es/packages/sticky/style/style.css +4 -0
- package/dist/es/packages/subsidenavbar/style/style.css +4 -0
- package/dist/es/packages/swipe/style/style.css +4 -0
- package/dist/es/packages/swiper/style/style.css +4 -0
- package/dist/es/packages/swiperitem/style/style.css +4 -0
- package/dist/es/packages/switch/style/style.css +50 -30
- package/dist/es/packages/switch/style/switch.scss +44 -28
- package/dist/es/packages/switch/switch.d.ts +2 -2
- package/dist/es/packages/switch/switch.js +3 -11
- package/dist/es/packages/tabbar/style/style.css +4 -0
- package/dist/es/packages/tabbaritem/style/style.css +4 -0
- package/dist/es/packages/table/style/style.css +4 -0
- package/dist/es/packages/tabpane/style/style.css +4 -0
- package/dist/es/packages/tabpane/tabpane.d.ts +3 -15
- package/dist/es/packages/tabs/style/style.css +53 -85
- package/dist/es/packages/tabs/style/tabs.scss +68 -106
- package/dist/es/packages/tabs/tabs.d.ts +12 -60
- package/dist/es/packages/tabs/tabs.js +2 -4
- package/dist/es/packages/tag/style/style.css +4 -0
- package/dist/es/packages/textarea/style/style.css +4 -0
- package/dist/es/packages/timedetail/style/style.css +6 -0
- package/dist/es/packages/timedetail/style/timedetail.scss +2 -0
- package/dist/es/packages/timeselect/style/style.css +6 -3
- package/dist/es/packages/timeselect/timeselect.d.ts +9 -45
- package/dist/es/packages/toast/style/style.css +17 -10
- package/dist/es/packages/toast/style/toast.scss +14 -8
- package/dist/es/packages/toast/toast.d.ts +0 -5
- package/dist/es/packages/toast/toast.js +10 -24
- package/dist/es/packages/tour/style/style.css +18 -5
- package/dist/es/packages/trendarrow/style/style.css +4 -0
- package/dist/es/packages/uploader/style/style.css +4 -0
- package/dist/es/packages/video/style/style.css +4 -0
- package/dist/es/packages/virtuallist/style/style.css +4 -0
- package/dist/es/packages/watermark/style/style.css +4 -0
- package/dist/nutui.react.umd.js +356 -311
- package/dist/style.css +1 -1
- package/dist/styles/theme-dark.scss +105 -94
- package/dist/styles/theme-default.scss +97 -90
- package/dist/styles/variables.scss +112 -66
- package/package.json +1 -1
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/* #ifdef harmony */
|
|
2
|
+
/* #endif */
|
|
3
|
+
/* #ifndef harmony */
|
|
4
|
+
/* #endif */
|
|
1
5
|
.nut-countdown {
|
|
2
6
|
display: var(--nutui-countdown-display, flex);
|
|
3
7
|
flex-direction: row;
|
|
@@ -10,26 +14,44 @@
|
|
|
10
14
|
align-items: center;
|
|
11
15
|
justify-content: center;
|
|
12
16
|
height: var(--nutui-countdown-height, 16px);
|
|
17
|
+
box-sizing: border-box;
|
|
13
18
|
font-weight: var(--nutui-countdown-font-weight, var(--nutui-font-weight, 400));
|
|
14
19
|
font-size: var(--nutui-countdown-font-size, var(--nutui-font-size-xs, 11px));
|
|
20
|
+
line-height: calc(var(--nutui-countdown-font-size, var(--nutui-font-size-xs, 11px)) + 2px);
|
|
21
|
+
font-family: "JD";
|
|
15
22
|
}
|
|
16
23
|
.nut-countdown-number, .nut-countdown-number-primary {
|
|
24
|
+
position: relative;
|
|
17
25
|
min-width: var(--nutui-countdown-width, 16px);
|
|
18
26
|
padding: var(--nutui-countdown-number-padding, 0 0);
|
|
19
27
|
border-radius: var(--nutui-countdown-number-border-radius, var(--nutui-radius-xxs, 2px));
|
|
20
28
|
margin: var(--nutui-countdown-number-margin, 0 1px);
|
|
21
29
|
text-align: center;
|
|
22
30
|
}
|
|
31
|
+
.nut-countdown-number::after, .nut-countdown-number-primary::after {
|
|
32
|
+
content: "";
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: -50%;
|
|
35
|
+
bottom: -50%;
|
|
36
|
+
left: -50%;
|
|
37
|
+
right: -50%;
|
|
38
|
+
transform: scale(0.5);
|
|
39
|
+
border-radius: calc(var(--nutui-countdown-number-border-radius, var(--nutui-radius-xxs, 2px)) * 2);
|
|
40
|
+
}
|
|
23
41
|
.nut-countdown-number {
|
|
24
|
-
border: 1px solid var(--nutui-countdown-number-border-color, var(--nutui-color-primary-light-pressed, #ffebf1));
|
|
25
42
|
background-color: var(--nutui-countdown-number-background-color, var(--nutui-color-background-overlay, #ffffff));
|
|
26
43
|
color: var(--nutui-countdown-number-color, var(--nutui-color-primary, #ff0f23));
|
|
27
44
|
}
|
|
45
|
+
.nut-countdown-number::after {
|
|
46
|
+
border: 1px solid var(--nutui-countdown-number-border-color, var(--nutui-color-primary-specialdisabled, #ffadbe));
|
|
47
|
+
}
|
|
28
48
|
.nut-countdown-number-primary {
|
|
29
|
-
border: 1px solid var(--nutui-countdown-number-primary-border-color, var(--nutui-color-primary, #ff0f23));
|
|
30
49
|
background-color: var(--nutui-countdown-number-primary-background-color, var(--nutui-color-primary, #ff0f23));
|
|
31
50
|
color: var(--nutui-countdown-number-primary-color, var(--nutui-color-primary-text, #ffffff));
|
|
32
51
|
}
|
|
52
|
+
.nut-countdown-number-primary::after {
|
|
53
|
+
border: 1px solid var(--nutui-countdown-number-primary-border-color, var(--nutui-color-primary, #ff0f23));
|
|
54
|
+
}
|
|
33
55
|
.nut-countdown-number-text {
|
|
34
56
|
border: 0;
|
|
35
57
|
background-color: transparent;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
|
+
/* #ifdef harmony */
|
|
3
|
+
/* #endif */
|
|
4
|
+
/* #ifndef harmony */
|
|
5
|
+
/* #endif */
|
|
2
6
|
.nut-overlay {
|
|
3
7
|
/* #ifdef rn */
|
|
4
8
|
position: absolute;
|
|
@@ -146,9 +150,6 @@
|
|
|
146
150
|
bottom: 0;
|
|
147
151
|
left: 0;
|
|
148
152
|
width: 100%;
|
|
149
|
-
/* #ifdef rn */
|
|
150
|
-
height: 300px;
|
|
151
|
-
/* #endif */
|
|
152
153
|
}
|
|
153
154
|
.nut-popup-bottom.nut-popup-round {
|
|
154
155
|
border-radius: var(--nutui-popup-border-radius, 24px) var(--nutui-popup-border-radius, 24px) 0 0;
|
|
@@ -2,51 +2,15 @@ import React, { FunctionComponent } from 'react';
|
|
|
2
2
|
import { BasicComponent } from "../../utils/typings";
|
|
3
3
|
export declare const elevatorContext: React.Context<ElevatorData>;
|
|
4
4
|
export interface ElevatorProps extends BasicComponent {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
floorKey: string
|
|
15
|
-
/**
|
|
16
|
-
* 索引列表
|
|
17
|
-
* @default [{id: 0, name: ''}]
|
|
18
|
-
*/
|
|
19
|
-
list: any[]
|
|
20
|
-
/**
|
|
21
|
-
* 索引是否吸顶
|
|
22
|
-
* @default false
|
|
23
|
-
*/
|
|
24
|
-
sticky: boolean
|
|
25
|
-
/**
|
|
26
|
-
* 右侧锚点的上下间距
|
|
27
|
-
* @default 23
|
|
28
|
-
*/
|
|
29
|
-
spaceHeight: number
|
|
30
|
-
/**
|
|
31
|
-
* 左侧索引的高度
|
|
32
|
-
* @default 35
|
|
33
|
-
*/
|
|
34
|
-
titleHeight: number
|
|
35
|
-
/**
|
|
36
|
-
* 展示右侧导航
|
|
37
|
-
* @default true
|
|
38
|
-
*/
|
|
39
|
-
showKeys: boolean
|
|
40
|
-
/**
|
|
41
|
-
* 点击内容
|
|
42
|
-
* @default false
|
|
43
|
-
*/
|
|
44
|
-
onItemClick: (key: string, item: ElevatorData) => void
|
|
45
|
-
/**
|
|
46
|
-
* 点击索引
|
|
47
|
-
* @default false
|
|
48
|
-
*/
|
|
49
|
-
onIndexClick: (key: string) => void
|
|
5
|
+
height: number | string;
|
|
6
|
+
floorKey: string;
|
|
7
|
+
list: any[];
|
|
8
|
+
sticky: boolean;
|
|
9
|
+
spaceHeight: number;
|
|
10
|
+
titleHeight: number;
|
|
11
|
+
showKeys: boolean;
|
|
12
|
+
onItemClick: (key: string, item: ElevatorData) => void;
|
|
13
|
+
onIndexClick: (key: string) => void;
|
|
50
14
|
}
|
|
51
15
|
interface ElevatorData {
|
|
52
16
|
name: string;
|
|
@@ -4,11 +4,13 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
|
4
4
|
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
5
5
|
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
6
6
|
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
7
|
-
import React, {
|
|
7
|
+
import React, { useEffect, useRef, useState, createContext, useMemo } from "react";
|
|
8
8
|
import Taro, { nextTick, createSelectorQuery } from "@tarojs/taro";
|
|
9
|
-
import { ScrollView, View } from "@tarojs/components";
|
|
9
|
+
import { ScrollView, View, Text } from "@tarojs/components";
|
|
10
10
|
import classNames from "classnames";
|
|
11
11
|
import { ComponentDefaults } from "../../utils/typings";
|
|
12
|
+
import { harmony } from "../../utils/platform-taro";
|
|
13
|
+
import useUuid from "../../utils/use-uuid";
|
|
12
14
|
export var elevatorContext = /*#__PURE__*/ createContext({});
|
|
13
15
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
14
16
|
height: '200px',
|
|
@@ -35,6 +37,7 @@ export var Elevator = function(props) {
|
|
|
35
37
|
"onIndexClick",
|
|
36
38
|
"children"
|
|
37
39
|
]);
|
|
40
|
+
var uuid = useUuid();
|
|
38
41
|
var classPrefix = 'nut-elevator';
|
|
39
42
|
var listview = useRef(null);
|
|
40
43
|
var initData = {
|
|
@@ -69,7 +72,7 @@ export var Elevator = function(props) {
|
|
|
69
72
|
state.current.listHeight.push(height);
|
|
70
73
|
for(var i = 0; i < state.current.listGroup.length; i++){
|
|
71
74
|
var query = createSelectorQuery();
|
|
72
|
-
query.selectAll(".".concat(
|
|
75
|
+
query.selectAll(".".concat(classPrefix, "-").concat(uuid, " .nut-elevator-item-").concat(i)).boundingClientRect();
|
|
73
76
|
// eslint-disable-next-line no-loop-func
|
|
74
77
|
query.exec(function(res) {
|
|
75
78
|
if (res[0][0]) height += res[0][0].height;
|
|
@@ -102,7 +105,7 @@ export var Elevator = function(props) {
|
|
|
102
105
|
var firstTouch = e.touches[0];
|
|
103
106
|
touchState.current.y2 = firstTouch.pageY;
|
|
104
107
|
var delta = (touchState.current.y2 - touchState.current.y1) / spaceHeight || 0;
|
|
105
|
-
var cacheIndex = state.current.anchorIndex + Math.
|
|
108
|
+
var cacheIndex = state.current.anchorIndex + Math.round(delta);
|
|
106
109
|
setCodeIndex(cacheIndex);
|
|
107
110
|
scrollTo(cacheIndex);
|
|
108
111
|
};
|
|
@@ -129,7 +132,7 @@ export var Elevator = function(props) {
|
|
|
129
132
|
};
|
|
130
133
|
var setListGroup = function() {
|
|
131
134
|
if (listview.current) {
|
|
132
|
-
createSelectorQuery().selectAll(".".concat(
|
|
135
|
+
createSelectorQuery().selectAll(".".concat(classPrefix, "-").concat(uuid, " .nut-elevator-list-item")).node(function(el) {
|
|
133
136
|
state.current.listGroup = _to_consumable_array(Object.keys(el));
|
|
134
137
|
calculateHeight();
|
|
135
138
|
}).exec();
|
|
@@ -156,6 +159,14 @@ export var Elevator = function(props) {
|
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
};
|
|
162
|
+
var getWrapStyle = useMemo(function() {
|
|
163
|
+
var calcHeight = Number.isNaN(+height) ? height : "".concat(height, "px");
|
|
164
|
+
return {
|
|
165
|
+
height: harmony() ? Number(height) : calcHeight
|
|
166
|
+
};
|
|
167
|
+
}, [
|
|
168
|
+
height
|
|
169
|
+
]);
|
|
159
170
|
useEffect(function() {
|
|
160
171
|
if (listview.current) {
|
|
161
172
|
nextTick(function() {
|
|
@@ -167,13 +178,11 @@ export var Elevator = function(props) {
|
|
|
167
178
|
]);
|
|
168
179
|
var _obj;
|
|
169
180
|
return /*#__PURE__*/ React.createElement("div", _object_spread({
|
|
170
|
-
className: "".concat(classPrefix, " ").concat(className),
|
|
181
|
+
className: "".concat(classPrefix, " ").concat(className, " ").concat(classPrefix, "-").concat(uuid),
|
|
171
182
|
style: style
|
|
172
183
|
}, rest), /*#__PURE__*/ React.createElement(View, {
|
|
173
184
|
className: "".concat(classPrefix, "-list"),
|
|
174
|
-
style:
|
|
175
|
-
height: Number.isNaN(+height) ? height : "".concat(height, "px")
|
|
176
|
-
}
|
|
185
|
+
style: getWrapStyle
|
|
177
186
|
}, /*#__PURE__*/ React.createElement(ScrollView, {
|
|
178
187
|
scrollTop: scrollTop,
|
|
179
188
|
scrollY: true,
|
|
@@ -209,17 +218,7 @@ export var Elevator = function(props) {
|
|
|
209
218
|
}, list[codeIndex][floorKey]) : null, /*#__PURE__*/ React.createElement(View, {
|
|
210
219
|
className: "".concat(classPrefix, "-bars")
|
|
211
220
|
}, /*#__PURE__*/ React.createElement(View, {
|
|
212
|
-
className: "".concat(classPrefix, "-bars-inner")
|
|
213
|
-
onTouchStart: function(event) {
|
|
214
|
-
return touchStart(event);
|
|
215
|
-
},
|
|
216
|
-
onTouchMove: function(event) {
|
|
217
|
-
return touchMove(event);
|
|
218
|
-
},
|
|
219
|
-
onTouchEnd: touchEnd,
|
|
220
|
-
style: {
|
|
221
|
-
touchAction: 'pan-y'
|
|
222
|
-
}
|
|
221
|
+
className: "".concat(classPrefix, "-bars-inner")
|
|
223
222
|
}, list.map(function(item, index) {
|
|
224
223
|
var _obj;
|
|
225
224
|
return /*#__PURE__*/ React.createElement(View, {
|
|
@@ -228,11 +227,21 @@ export var Elevator = function(props) {
|
|
|
228
227
|
key: index,
|
|
229
228
|
onClick: function() {
|
|
230
229
|
return handleClickIndex(item[floorKey]);
|
|
230
|
+
},
|
|
231
|
+
onTouchStart: function(event) {
|
|
232
|
+
return touchStart(event);
|
|
233
|
+
},
|
|
234
|
+
onTouchMove: function(event) {
|
|
235
|
+
return touchMove(event);
|
|
236
|
+
},
|
|
237
|
+
onTouchEnd: touchEnd,
|
|
238
|
+
style: {
|
|
239
|
+
touchAction: 'pan-y'
|
|
231
240
|
}
|
|
232
241
|
}, item[floorKey]);
|
|
233
242
|
})))) : null, sticky && scrollY > 0 ? /*#__PURE__*/ React.createElement(View, {
|
|
234
243
|
className: "".concat(classPrefix, "-list-fixed")
|
|
235
|
-
}, /*#__PURE__*/ React.createElement(
|
|
244
|
+
}, /*#__PURE__*/ React.createElement(Text, {
|
|
236
245
|
className: "".concat(classPrefix, "-list-fixed-title")
|
|
237
246
|
}, list[codeIndex][floorKey])) : null);
|
|
238
247
|
};
|
|
@@ -51,6 +51,8 @@
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
&-fixed {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
54
56
|
width: 100%;
|
|
55
57
|
position: absolute;
|
|
56
58
|
top: 0;
|
|
@@ -58,13 +60,14 @@
|
|
|
58
60
|
z-index: 1;
|
|
59
61
|
padding: $elevator-list-item-padding;
|
|
60
62
|
height: $elevator-list-item-code-height;
|
|
61
|
-
line-height: $elevator-list-item-code-line-height;
|
|
62
|
-
font-size: $elevator-list-item-code-font-size;
|
|
63
|
-
color: $elevator-list-fixed-color;
|
|
64
|
-
font-weight: $elevator-list-item-code-font-weight;
|
|
65
63
|
background-color: $elevator-list-fixed-bg-color;
|
|
66
64
|
box-sizing: border-box;
|
|
67
65
|
box-shadow: $elevator-list-fixed-box-shadow;
|
|
66
|
+
&-title {
|
|
67
|
+
font-size: $elevator-list-item-code-font-size;
|
|
68
|
+
color: $elevator-list-fixed-color;
|
|
69
|
+
font-weight: $elevator-list-item-code-font-weight;
|
|
70
|
+
}
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/* #ifdef harmony */
|
|
2
|
+
/* #endif */
|
|
3
|
+
/* #ifndef harmony */
|
|
4
|
+
/* #endif */
|
|
1
5
|
.nut-elevator {
|
|
2
6
|
width: 100%;
|
|
3
7
|
display: block;
|
|
@@ -46,6 +50,8 @@
|
|
|
46
50
|
color: var(--nutui-color-primary, #ff0f23);
|
|
47
51
|
}
|
|
48
52
|
.nut-elevator-list-fixed {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
49
55
|
width: 100%;
|
|
50
56
|
position: absolute;
|
|
51
57
|
top: 0;
|
|
@@ -53,14 +59,15 @@
|
|
|
53
59
|
z-index: 1;
|
|
54
60
|
padding: var(--nutui-elevator-list-item-padding, 0 20px);
|
|
55
61
|
height: var(--nutui-elevator-list-item-code-height, 35px);
|
|
56
|
-
line-height: var(--nutui-elevator-list-item-code-line-height, 35px);
|
|
57
|
-
font-size: var(--nutui-elevator-list-item-code-font-size, var(--nutui-font-size-base, 14px));
|
|
58
|
-
color: var(--nutui-elevator-list-fixed-color, var(--nutui-color-primary, #ff0f23));
|
|
59
|
-
font-weight: var(--nutui-elevator-list-item-code-font-weight, var(--nutui-font-weight-bold, 600));
|
|
60
62
|
background-color: var(--nutui-elevator-list-fixed-bg-color, #ffffff);
|
|
61
63
|
box-sizing: border-box;
|
|
62
64
|
box-shadow: var(--nutui-elevator-list-fixed-box-shadow, 0 0 10px #eee);
|
|
63
65
|
}
|
|
66
|
+
.nut-elevator-list-fixed-title {
|
|
67
|
+
font-size: var(--nutui-elevator-list-item-code-font-size, var(--nutui-font-size-base, 14px));
|
|
68
|
+
color: var(--nutui-elevator-list-fixed-color, var(--nutui-color-primary, #ff0f23));
|
|
69
|
+
font-weight: var(--nutui-elevator-list-item-code-font-weight, var(--nutui-font-weight-bold, 600));
|
|
70
|
+
}
|
|
64
71
|
.nut-elevator-code-current {
|
|
65
72
|
position: absolute;
|
|
66
73
|
right: var(--nutui-elevator-list-item-code-current-right, 60px);
|
|
@@ -65,7 +65,7 @@ export var Empty = function(props) {
|
|
|
65
65
|
}, title) : title, typeof description === 'string' ? /*#__PURE__*/ React.createElement(View, {
|
|
66
66
|
className: "".concat(classPrefix, "-description")
|
|
67
67
|
}, description) : description, actions.length ? /*#__PURE__*/ React.createElement(View, {
|
|
68
|
-
className: "".concat(classPrefix, "-actions")
|
|
68
|
+
className: "".concat(classPrefix, "-actions-").concat(size)
|
|
69
69
|
}, actions.map(function(action, index) {
|
|
70
70
|
var text = action.text, rest = _object_without_properties(action, [
|
|
71
71
|
"text"
|
|
@@ -32,20 +32,24 @@
|
|
|
32
32
|
|
|
33
33
|
&-title {
|
|
34
34
|
margin-top: $empty-title-margin-top;
|
|
35
|
+
font-weight: $font-weight-bold;
|
|
35
36
|
margin-bottom: $empty-title-margin-bottom;
|
|
36
37
|
color: $color-title;
|
|
37
|
-
font-size: $font-size-
|
|
38
|
+
font-size: $font-size-l;
|
|
38
39
|
line-height: $empty-title-line-height;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
&-description {
|
|
42
|
-
|
|
43
|
-
color: $color-text-help;
|
|
43
|
+
color: $color-text;
|
|
44
44
|
font-size: $font-size-s;
|
|
45
45
|
line-height: $empty-description-line-height;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
&-actions-base {
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: row;
|
|
50
|
+
margin-top: 24px;
|
|
51
|
+
}
|
|
52
|
+
&-actions-small {
|
|
49
53
|
display: flex;
|
|
50
54
|
flex-direction: row;
|
|
51
55
|
margin-top: 16px;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/* #ifdef harmony */
|
|
2
|
+
/* #endif */
|
|
3
|
+
/* #ifndef harmony */
|
|
4
|
+
/* #endif */
|
|
1
5
|
.nut-empty {
|
|
2
6
|
box-sizing: border-box;
|
|
3
7
|
width: 100%;
|
|
@@ -28,18 +32,23 @@
|
|
|
28
32
|
}
|
|
29
33
|
.nut-empty-title {
|
|
30
34
|
margin-top: var(--nutui-empty-title-margin-top, 0px);
|
|
31
|
-
|
|
35
|
+
font-weight: var(--nutui-font-weight-bold, 600);
|
|
36
|
+
margin-bottom: var(--nutui-empty-title-margin-bottom, 12px);
|
|
32
37
|
color: var(--nutui-color-title, #1a1a1a);
|
|
33
|
-
font-size: var(--nutui-font-size-
|
|
34
|
-
line-height: var(--nutui-empty-title-line-height, var(--nutui-font-size-
|
|
38
|
+
font-size: var(--nutui-font-size-l, 16px);
|
|
39
|
+
line-height: var(--nutui-empty-title-line-height, var(--nutui-font-size-l, 16px));
|
|
35
40
|
}
|
|
36
41
|
.nut-empty-description {
|
|
37
|
-
|
|
38
|
-
color: var(--nutui-color-text-help, #888b94);
|
|
42
|
+
color: var(--nutui-color-text, #505259);
|
|
39
43
|
font-size: var(--nutui-font-size-s, 12px);
|
|
40
|
-
line-height: var(--nutui-empty-description-line-height, 1
|
|
44
|
+
line-height: var(--nutui-empty-description-line-height, 1);
|
|
41
45
|
}
|
|
42
|
-
.nut-empty-actions {
|
|
46
|
+
.nut-empty-actions-base {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: row;
|
|
49
|
+
margin-top: 24px;
|
|
50
|
+
}
|
|
51
|
+
.nut-empty-actions-small {
|
|
43
52
|
display: flex;
|
|
44
53
|
flex-direction: row;
|
|
45
54
|
margin-top: 16px;
|
|
@@ -9,6 +9,7 @@ import { useRtl } from "../configprovider/index";
|
|
|
9
9
|
import HoverButtonItem from "../hoverbuttonitem/index";
|
|
10
10
|
import SafeArea from "../safearea/index";
|
|
11
11
|
import pxTransform from "../../utils/px-transform";
|
|
12
|
+
import { UI_BOTTOM_DISTANCE } from "./utils";
|
|
12
13
|
var defaultProps = _object_spread({}, ComponentDefaults);
|
|
13
14
|
var classPrefix = 'nut-hoverbutton';
|
|
14
15
|
export var HoverButton = function(props) {
|
|
@@ -16,7 +17,7 @@ export var HoverButton = function(props) {
|
|
|
16
17
|
var rtl = useRtl();
|
|
17
18
|
var baseStyle = _object_spread({}, style);
|
|
18
19
|
if (tabbarHeight) {
|
|
19
|
-
baseStyle.bottom = pxTransform(tabbarHeight +
|
|
20
|
+
baseStyle.bottom = pxTransform(tabbarHeight + UI_BOTTOM_DISTANCE);
|
|
20
21
|
}
|
|
21
22
|
if (typeof zIndex !== 'undefined') {
|
|
22
23
|
baseStyle.zIndex = zIndex;
|
|
@@ -1,45 +1,70 @@
|
|
|
1
|
+
/* #ifdef harmony */
|
|
2
|
+
/* #endif */
|
|
3
|
+
/* #ifndef harmony */
|
|
4
|
+
/* #endif */
|
|
1
5
|
.nut-hoverbutton-item-container {
|
|
2
6
|
width: 40px;
|
|
3
7
|
height: 40px;
|
|
4
8
|
border-radius: 20px;
|
|
5
|
-
border: 1px solid var(--nutui-hoverbutton-item-border-color,
|
|
6
|
-
background-color: var(--nutui-hoverbutton-item-background, var(--nutui-
|
|
9
|
+
border: 1px solid var(--nutui-hoverbutton-item-border-color, rgba(0, 0, 0, 0.12));
|
|
10
|
+
background-color: var(--nutui-hoverbutton-item-background, var(--nutui-white-12));
|
|
7
11
|
}
|
|
8
12
|
.nut-hoverbutton-item-container:active, .nut-hoverbutton-item-container-active {
|
|
9
|
-
background-color: var(--nutui-hoverbutton-item-background-active,
|
|
13
|
+
background-color: var(--nutui-hoverbutton-item-background-active, rgba(247, 248, 252, 0.9));
|
|
10
14
|
}
|
|
11
15
|
.nut-hoverbutton-item-container-harmony {
|
|
12
|
-
margin-bottom: var(--nutui-hoverbutton-spacing, var(--nutui-spacing-
|
|
16
|
+
margin-bottom: var(--nutui-hoverbutton-spacing, var(--nutui-spacing-base, 8px));
|
|
13
17
|
}
|
|
14
18
|
.nut-hoverbutton-item-container-harmony:last-child {
|
|
15
19
|
margin-bottom: 0;
|
|
16
20
|
}
|
|
21
|
+
.nut-hoverbutton-item-container-icontext {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
align-items: center;
|
|
25
|
+
}
|
|
26
|
+
.nut-hoverbutton-item-container-icontext .nut-icon {
|
|
27
|
+
display: block;
|
|
28
|
+
width: 14px;
|
|
29
|
+
height: 14px;
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
}
|
|
17
32
|
.nut-hoverbutton-item-icon {
|
|
18
33
|
width: 20px;
|
|
19
34
|
height: 20px;
|
|
20
35
|
margin: 9px;
|
|
21
|
-
color: var(--nutui-hoverbutton-item-icon-color, var(--nutui-
|
|
22
|
-
fill: var(--nutui-hoverbutton-item-icon-color, var(--nutui-
|
|
36
|
+
color: var(--nutui-hoverbutton-item-icon-color, var(--nutui-color-title, #1a1a1a));
|
|
37
|
+
fill: var(--nutui-hoverbutton-item-icon-color, var(--nutui-color-title, #1a1a1a));
|
|
23
38
|
}
|
|
24
39
|
.nut-hoverbutton-item-icon .nut-icon {
|
|
25
40
|
display: block;
|
|
26
41
|
width: 20px;
|
|
27
42
|
height: 20px;
|
|
43
|
+
font-size: 20px;
|
|
28
44
|
}
|
|
29
45
|
.nut-hoverbutton-item-container:active .nut-hoverbutton-item-icon {
|
|
30
|
-
color: var(--nutui-hoverbutton-item-icon-color-active, var(--nutui-
|
|
31
|
-
fill: var(--nutui-hoverbutton-item-icon-color-active, var(--nutui-
|
|
46
|
+
color: var(--nutui-hoverbutton-item-icon-color-active, var(--nutui-color-title, #1a1a1a));
|
|
47
|
+
fill: var(--nutui-hoverbutton-item-icon-color-active, var(--nutui-color-title, #1a1a1a));
|
|
48
|
+
}
|
|
49
|
+
.nut-hoverbutton-item-text-icon {
|
|
50
|
+
width: 14px;
|
|
51
|
+
height: 5px;
|
|
52
|
+
}
|
|
53
|
+
.nut-hoverbutton-item-text {
|
|
54
|
+
font-size: 10px;
|
|
55
|
+
margin-top: 5px;
|
|
56
|
+
line-height: 9px;
|
|
32
57
|
}
|
|
33
58
|
|
|
34
59
|
.nut-hoverbutton {
|
|
35
60
|
display: flex;
|
|
36
61
|
flex-direction: column;
|
|
37
|
-
gap: var(--nutui-hoverbutton-spacing, var(--nutui-spacing-
|
|
62
|
+
gap: var(--nutui-hoverbutton-spacing, var(--nutui-spacing-base, 8px));
|
|
38
63
|
}
|
|
39
64
|
.nut-hoverbutton-container {
|
|
40
65
|
position: fixed;
|
|
41
|
-
right: var(--nutui-hoverbutton-position-right, var(--nutui-spacing-
|
|
42
|
-
bottom: var(--nutui-hoverbutton-position-bottom,
|
|
66
|
+
right: var(--nutui-hoverbutton-position-right, var(--nutui-spacing-base, 8px));
|
|
67
|
+
bottom: var(--nutui-hoverbutton-position-bottom, 60px);
|
|
43
68
|
z-index: 10;
|
|
44
69
|
}
|
|
45
70
|
.nut-hoverbutton-container-rn {
|
|
@@ -49,5 +74,5 @@
|
|
|
49
74
|
[dir=rtl] .nut-hoverbutton-container,
|
|
50
75
|
.nut-hoverbutton-container-rtl {
|
|
51
76
|
right: auto;
|
|
52
|
-
left: var(--nutui-hoverbutton-position-right, var(--nutui-spacing-
|
|
77
|
+
left: var(--nutui-hoverbutton-position-right, var(--nutui-spacing-base, 8px));
|
|
53
78
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const UI_BOTTOM_DISTANCE = 60;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var UI_BOTTOM_DISTANCE = 60;
|
|
@@ -2,11 +2,12 @@ import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
|
2
2
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
3
3
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
4
4
|
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { useMemo, useState } from "react";
|
|
6
6
|
import classNames from "classnames";
|
|
7
7
|
import { View } from "@tarojs/components";
|
|
8
8
|
import { ComponentDefaults } from "../../utils/typings";
|
|
9
9
|
import { harmony, harmonyAndRn } from "../../utils/platform-taro";
|
|
10
|
+
import { getIcon } from "./utils";
|
|
10
11
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
11
12
|
icon: null,
|
|
12
13
|
onClick: function(value) {}
|
|
@@ -15,7 +16,7 @@ var classPrefix = 'nut-hoverbutton-item';
|
|
|
15
16
|
var isHarmony = harmony();
|
|
16
17
|
var isNative = harmonyAndRn();
|
|
17
18
|
export var HoverButtonItem = function(props) {
|
|
18
|
-
var _$_object_spread = _object_spread({}, defaultProps, props), className = _$_object_spread.className, style = _$_object_spread.style, icon = _$_object_spread.icon, onClick = _$_object_spread.onClick;
|
|
19
|
+
var _$_object_spread = _object_spread({}, defaultProps, props), className = _$_object_spread.className, style = _$_object_spread.style, icon = _$_object_spread.icon, onClick = _$_object_spread.onClick, children = _$_object_spread.children;
|
|
19
20
|
var _useState = _sliced_to_array(useState(false), 2), isTouchStart = _useState[0], setTouchStart = _useState[1];
|
|
20
21
|
// @TODO 待添加暗黑模式及样式变量功能
|
|
21
22
|
var nativeProps = useMemo(function() {
|
|
@@ -34,22 +35,29 @@ export var HoverButtonItem = function(props) {
|
|
|
34
35
|
var handleActiveEnd = function(event) {
|
|
35
36
|
isNative && setTouchStart(false);
|
|
36
37
|
};
|
|
38
|
+
var renderBody = function() {
|
|
39
|
+
if (icon && !children) return /*#__PURE__*/ React.createElement(View, {
|
|
40
|
+
className: "".concat(classPrefix, "-icon")
|
|
41
|
+
}, getIcon(icon));
|
|
42
|
+
if (icon && children) {
|
|
43
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(View, {
|
|
44
|
+
className: classNames(_define_property({}, "".concat(classPrefix, "-text-icon"), true))
|
|
45
|
+
}), getIcon(icon), /*#__PURE__*/ React.createElement(View, {
|
|
46
|
+
className: classNames(_define_property({}, "".concat(classPrefix, "-text"), true))
|
|
47
|
+
}, children));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
37
50
|
var _obj;
|
|
38
51
|
return /*#__PURE__*/ React.createElement(View, {
|
|
39
52
|
className: classNames([
|
|
40
53
|
"".concat(classPrefix, "-container"),
|
|
41
54
|
className
|
|
42
|
-
], (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-container-active"), isNative && isTouchStart), _define_property(_obj, "".concat(classPrefix, "-container-harmony"), isHarmony), _obj)),
|
|
55
|
+
], (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-container-active"), isNative && isTouchStart), _define_property(_obj, "".concat(classPrefix, "-container-harmony"), isHarmony), _define_property(_obj, "".concat(classPrefix, "-container-icontext"), icon && children), _obj)),
|
|
43
56
|
style: style,
|
|
44
57
|
onTouchStart: handleActiveStart,
|
|
45
58
|
onTouchEnd: handleActiveEnd,
|
|
46
59
|
onTouchCancel: handleActiveEnd,
|
|
47
60
|
onClick: handleClick
|
|
48
|
-
},
|
|
49
|
-
className: "".concat(classPrefix, "-icon")
|
|
50
|
-
}, /*#__PURE__*/ React.cloneElement(icon, _object_spread({
|
|
51
|
-
className: 'nut-icon',
|
|
52
|
-
size: 20
|
|
53
|
-
}, nativeProps))));
|
|
61
|
+
}, renderBody());
|
|
54
62
|
};
|
|
55
63
|
HoverButtonItem.displayName = 'NutHoverButtonItem';
|