@arco-design/mobile-react 2.25.4 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/hooks.js +124 -43
- package/cjs/_helpers/index.js +13 -2
- package/cjs/_helpers/react-dom.js +12 -0
- package/cjs/_helpers/render.js +12 -0
- package/cjs/action-sheet/index.d.ts +2 -2
- package/cjs/action-sheet/index.js +30 -10
- package/cjs/action-sheet/methods.js +2 -0
- package/cjs/action-sheet/style/css/index.js +2 -0
- package/cjs/action-sheet/style/index.js +2 -0
- package/cjs/avatar/group.js +24 -12
- package/cjs/avatar/index.js +77 -51
- package/cjs/avatar/style/css/index.js +2 -0
- package/cjs/avatar/style/index.js +2 -0
- package/cjs/badge/index.js +29 -18
- package/cjs/badge/style/css/index.js +1 -0
- package/cjs/badge/style/index.js +1 -0
- package/cjs/button/hooks.js +20 -15
- package/cjs/button/index.js +67 -46
- package/cjs/button/style/css/index.js +2 -0
- package/cjs/button/style/index.js +2 -0
- package/cjs/carousel/index.d.ts +6 -0
- package/cjs/carousel/index.js +342 -184
- package/cjs/carousel/style/css/index.css +50 -15
- package/cjs/carousel/style/css/index.js +1 -0
- package/cjs/carousel/style/index.js +1 -0
- package/cjs/carousel/style/index.less +19 -14
- package/cjs/cell/arrow.js +3 -0
- package/cjs/cell/cell.js +23 -14
- package/cjs/cell/demo/style/css/mobile.css +8 -0
- package/cjs/cell/demo/style/mobile.less +2 -2
- package/cjs/cell/group.js +21 -9
- package/cjs/cell/index.js +7 -1
- package/cjs/cell/style/css/index.css +16 -0
- package/cjs/cell/style/css/index.js +1 -0
- package/cjs/cell/style/index.js +1 -0
- package/cjs/cell/style/index.less +6 -4
- package/cjs/checkbox/checkbox.js +57 -31
- package/cjs/checkbox/group.js +38 -24
- package/cjs/checkbox/hooks/index.js +2 -0
- package/cjs/checkbox/hooks/useMergeProps.js +14 -7
- package/cjs/checkbox/index.js +8 -1
- package/cjs/checkbox/style/css/index.js +1 -0
- package/cjs/checkbox/style/index.js +1 -0
- package/cjs/checkbox/type.js +2 -0
- package/cjs/circle-progress/index.js +57 -37
- package/cjs/circle-progress/style/css/index.js +1 -0
- package/cjs/circle-progress/style/index.js +1 -0
- package/cjs/collapse/collapse.js +56 -27
- package/cjs/collapse/group.js +44 -20
- package/cjs/collapse/index.js +9 -0
- package/cjs/collapse/style/css/index.js +1 -0
- package/cjs/collapse/style/index.js +1 -0
- package/cjs/collapse/utils.js +7 -0
- package/cjs/context-provider/index.d.ts +6 -0
- package/cjs/context-provider/index.js +30 -11
- package/cjs/context-provider/style/css/index.js +1 -0
- package/cjs/context-provider/style/index.js +1 -0
- package/cjs/count-down/hooks.js +43 -24
- package/cjs/count-down/index.js +37 -29
- package/cjs/count-down/singleton.js +12 -2
- package/cjs/count-down/style/css/index.js +1 -0
- package/cjs/count-down/style/index.js +1 -0
- package/cjs/count-down/util.js +47 -33
- package/cjs/date-picker/helper.js +14 -7
- package/cjs/date-picker/index.js +106 -42
- package/cjs/date-picker/style/css/index.js +2 -0
- package/cjs/date-picker/style/index.js +2 -0
- package/cjs/dialog/index.d.ts +2 -2
- package/cjs/dialog/index.js +54 -28
- package/cjs/dialog/methods.js +22 -9
- package/cjs/dialog/style/css/index.js +2 -0
- package/cjs/dialog/style/index.js +2 -0
- package/cjs/divider/demo/style/css/mobile.css +7 -0
- package/cjs/divider/demo/style/mobile.less +12 -0
- package/cjs/divider/index.d.ts +49 -0
- package/cjs/divider/index.js +65 -0
- package/cjs/divider/style/css/index.css +69 -0
- package/cjs/divider/style/css/index.d.ts +2 -0
- package/cjs/divider/style/css/index.js +5 -0
- package/cjs/divider/style/index.d.ts +2 -0
- package/cjs/divider/style/index.js +5 -0
- package/cjs/divider/style/index.less +66 -0
- package/cjs/dropdown/dropdown.js +113 -74
- package/cjs/dropdown/index.js +8 -1
- package/cjs/dropdown/options.js +28 -12
- package/cjs/dropdown/style/css/index.js +1 -0
- package/cjs/dropdown/style/index.js +1 -0
- package/cjs/dropdown-menu/dropdown-menu.js +84 -49
- package/cjs/dropdown-menu/helper.js +27 -6
- package/cjs/dropdown-menu/index.js +6 -0
- package/cjs/dropdown-menu/style/css/index.js +2 -0
- package/cjs/dropdown-menu/style/index.js +2 -0
- package/cjs/ellipsis/components/js-ellipsis.js +72 -33
- package/cjs/ellipsis/components/native-ellipsis.js +15 -9
- package/cjs/ellipsis/index.js +32 -19
- package/cjs/ellipsis/style/css/index.js +1 -0
- package/cjs/ellipsis/style/index.js +1 -0
- package/cjs/ellipsis/utils/dom.js +8 -0
- package/cjs/ellipsis/utils/is.js +5 -1
- package/cjs/form/form-item-context.js +5 -0
- package/cjs/form/form-item.js +124 -42
- package/cjs/form/index.js +35 -17
- package/cjs/form/style/css/index.js +1 -0
- package/cjs/form/style/index.js +1 -0
- package/cjs/form/type.js +3 -0
- package/cjs/form/useForm.js +76 -18
- package/cjs/form/utils.js +10 -3
- package/cjs/grid/index.js +41 -21
- package/cjs/grid/style/css/index.js +1 -0
- package/cjs/grid/style/index.js +1 -0
- package/cjs/icon/IconAdd/index.js +12 -5
- package/cjs/icon/IconArrowBack/index.js +12 -5
- package/cjs/icon/IconArrowDown/index.js +12 -5
- package/cjs/icon/IconArrowIn/index.js +12 -5
- package/cjs/icon/IconArrowUp/index.js +12 -5
- package/cjs/icon/IconCheck/index.js +12 -5
- package/cjs/icon/IconCheckBold/index.js +12 -5
- package/cjs/icon/IconCircleChecked/index.js +12 -5
- package/cjs/icon/IconCircleDisabled/index.js +12 -5
- package/cjs/icon/IconCircleUnchecked/index.js +12 -5
- package/cjs/icon/IconClear/index.js +12 -5
- package/cjs/icon/IconClose/index.js +12 -5
- package/cjs/icon/IconCloseBold/index.js +12 -5
- package/cjs/icon/IconDelete/index.js +12 -5
- package/cjs/icon/IconEdit/index.js +12 -5
- package/cjs/icon/IconErrorCircle/index.js +12 -5
- package/cjs/icon/IconEyeInvisible/index.js +12 -5
- package/cjs/icon/IconEyeVisible/index.js +12 -5
- package/cjs/icon/IconEyelashInvisible/index.js +12 -5
- package/cjs/icon/IconGift/index.js +12 -5
- package/cjs/icon/IconHeart/index.js +12 -5
- package/cjs/icon/IconHome/index.js +12 -5
- package/cjs/icon/IconLikeCircle/index.js +12 -5
- package/cjs/icon/IconMinus/index.js +12 -5
- package/cjs/icon/IconMore/index.js +12 -5
- package/cjs/icon/IconNotice/index.js +12 -5
- package/cjs/icon/IconNoticeOff/index.js +12 -5
- package/cjs/icon/IconPicture/index.js +12 -5
- package/cjs/icon/IconPlay/index.js +12 -5
- package/cjs/icon/IconQuestionCircle/index.js +12 -5
- package/cjs/icon/IconRefresh/index.js +12 -5
- package/cjs/icon/IconSad/index.js +12 -5
- package/cjs/icon/IconScan/index.js +12 -5
- package/cjs/icon/IconSearch/index.js +12 -5
- package/cjs/icon/IconSetting/index.js +12 -5
- package/cjs/icon/IconShop/index.js +12 -5
- package/cjs/icon/IconShopping/index.js +12 -5
- package/cjs/icon/IconSmileFill/index.js +12 -5
- package/cjs/icon/IconSound/index.js +12 -5
- package/cjs/icon/IconSquareChecked/index.js +12 -5
- package/cjs/icon/IconSquareDisabled/index.js +12 -5
- package/cjs/icon/IconSquareUnchecked/index.js +12 -5
- package/cjs/icon/IconStar/index.js +12 -5
- package/cjs/icon/IconStarFill/index.js +12 -5
- package/cjs/icon/IconStarHalf/index.js +12 -5
- package/cjs/icon/IconSubway/index.js +12 -5
- package/cjs/icon/IconSuccessCircle/index.js +12 -5
- package/cjs/icon/IconTriDown/index.js +12 -5
- package/cjs/icon/IconTriUp/index.js +12 -5
- package/cjs/icon/IconUpload/index.js +12 -5
- package/cjs/icon/IconUser/index.js +12 -5
- package/cjs/icon/IconUserFill/index.js +12 -5
- package/cjs/icon/IconWarnCircle/index.js +12 -5
- package/cjs/icon/IconWarnCircleFill/index.js +12 -5
- package/cjs/icon/index.js +111 -0
- package/cjs/image/index.js +92 -56
- package/cjs/image/style/css/index.css +1 -0
- package/cjs/image/style/css/index.js +2 -0
- package/cjs/image/style/index.js +2 -0
- package/cjs/image/style/index.less +1 -0
- package/cjs/image-picker/add-icon.js +3 -0
- package/cjs/image-picker/index.js +96 -52
- package/cjs/image-picker/style/css/index.js +2 -0
- package/cjs/image-picker/style/index.js +2 -0
- package/cjs/image-preview/index.d.ts +2 -2
- package/cjs/image-preview/index.js +239 -119
- package/cjs/image-preview/methods.js +18 -5
- package/cjs/image-preview/style/css/index.js +4 -0
- package/cjs/image-preview/style/index.js +4 -0
- package/cjs/index.d.ts +10 -9
- package/cjs/index.js +132 -19
- package/cjs/input/demo/style/css/mobile.css +5 -1
- package/cjs/input/demo/style/mobile.less +2 -2
- package/cjs/input/hooks.js +104 -42
- package/cjs/input/index.js +40 -26
- package/cjs/input/props.d.ts +6 -0
- package/cjs/input/style/css/index.css +9 -0
- package/cjs/input/style/css/index.js +1 -0
- package/cjs/input/style/index.js +1 -0
- package/cjs/input/style/index.less +2 -2
- package/cjs/load-more/index.js +56 -29
- package/cjs/load-more/style/css/index.js +1 -0
- package/cjs/load-more/style/index.js +1 -0
- package/cjs/loading/index.js +48 -19
- package/cjs/loading/style/css/index.js +1 -0
- package/cjs/loading/style/index.js +1 -0
- package/cjs/masking/index.d.ts +2 -2
- package/cjs/masking/index.js +79 -46
- package/cjs/masking/methods.js +19 -4
- package/cjs/masking/style/css/index.js +2 -0
- package/cjs/masking/style/index.js +2 -0
- package/cjs/nav-bar/back-icon.js +5 -1
- package/cjs/nav-bar/index.js +61 -37
- package/cjs/nav-bar/style/css/index.js +1 -0
- package/cjs/nav-bar/style/index.js +1 -0
- package/cjs/notice-bar/index.js +61 -33
- package/cjs/notice-bar/style/css/index.css +33 -0
- package/cjs/notice-bar/style/css/index.js +1 -0
- package/cjs/notice-bar/style/index.js +1 -0
- package/cjs/notice-bar/style/index.less +16 -3
- package/cjs/notify/index.d.ts +8 -8
- package/cjs/notify/index.js +49 -20
- package/cjs/notify/methods.js +17 -2
- package/cjs/notify/style/css/index.js +1 -0
- package/cjs/notify/style/index.js +1 -0
- package/cjs/pagination/arrow.js +3 -0
- package/cjs/pagination/index.js +58 -27
- package/cjs/pagination/style/css/index.js +1 -0
- package/cjs/pagination/style/index.js +1 -0
- package/cjs/picker/index.js +81 -40
- package/cjs/picker/style/css/index.js +3 -0
- package/cjs/picker/style/index.js +3 -0
- package/cjs/picker-view/components/cascader.js +31 -14
- package/cjs/picker-view/components/multi-picker.js +20 -6
- package/cjs/picker-view/components/picker-cell.js +97 -45
- package/cjs/picker-view/index.js +71 -25
- package/cjs/picker-view/style/css/index.js +1 -0
- package/cjs/picker-view/style/index.js +1 -0
- package/cjs/popover/hooks/index.js +4 -0
- package/cjs/popover/hooks/useEvent.js +49 -25
- package/cjs/popover/hooks/usePosition.js +151 -94
- package/cjs/popover/index.js +8 -1
- package/cjs/popover/menu.js +51 -32
- package/cjs/popover/popover-inner.js +47 -30
- package/cjs/popover/popover.js +101 -69
- package/cjs/popover/style/css/index.js +2 -0
- package/cjs/popover/style/index.js +2 -0
- package/cjs/popup/index.d.ts +2 -2
- package/cjs/popup/index.js +39 -22
- package/cjs/popup/methods.js +2 -0
- package/cjs/popup/style/css/index.js +2 -0
- package/cjs/popup/style/index.js +2 -0
- package/cjs/popup-swiper/index.d.ts +2 -2
- package/cjs/popup-swiper/index.js +80 -38
- package/cjs/popup-swiper/methods.js +2 -0
- package/cjs/popup-swiper/style/css/index.js +2 -0
- package/cjs/popup-swiper/style/index.js +2 -0
- package/cjs/portal/index.js +8 -3
- package/cjs/portal/style/css/index.js +1 -0
- package/cjs/portal/style/index.js +1 -0
- package/cjs/progress/index.js +44 -27
- package/cjs/progress/style/css/index.js +1 -0
- package/cjs/progress/style/index.js +1 -0
- package/cjs/pull-refresh/android-pull-refresh.js +100 -58
- package/cjs/pull-refresh/hooks.js +32 -11
- package/cjs/pull-refresh/index.js +14 -3
- package/cjs/pull-refresh/ios-pull-refresh.js +80 -53
- package/cjs/pull-refresh/model.js +1 -0
- package/cjs/pull-refresh/style/css/index.js +2 -0
- package/cjs/pull-refresh/style/index.js +2 -0
- package/cjs/radio/group.js +34 -20
- package/cjs/radio/index.js +8 -1
- package/cjs/radio/radio.js +10 -0
- package/cjs/radio/style/css/index.js +1 -0
- package/cjs/radio/style/index.js +1 -0
- package/cjs/rate/index.js +50 -24
- package/cjs/rate/style/css/index.js +1 -0
- package/cjs/rate/style/index.js +1 -0
- package/cjs/search-bar/association.js +32 -14
- package/cjs/search-bar/cancel-button.js +16 -8
- package/cjs/search-bar/highlight.js +25 -14
- package/cjs/search-bar/index.js +97 -77
- package/cjs/search-bar/style/css/index.js +1 -0
- package/cjs/search-bar/style/index.js +1 -0
- package/cjs/show-monitor/index.js +93 -34
- package/cjs/show-monitor/style/css/index.js +1 -0
- package/cjs/show-monitor/style/index.js +1 -0
- package/cjs/slider/hooks/index.js +13 -0
- package/cjs/slider/hooks/useSliderEvents.js +55 -26
- package/cjs/slider/hooks/useSliderIcon.js +20 -6
- package/cjs/slider/hooks/useSliderInit.js +52 -32
- package/cjs/slider/hooks/useSliderStyle.js +24 -12
- package/cjs/slider/index.js +72 -46
- package/cjs/slider/marks.js +26 -12
- package/cjs/slider/popover.js +13 -4
- package/cjs/slider/style/css/index.js +2 -0
- package/cjs/slider/style/index.js +2 -0
- package/cjs/slider/thumb.js +23 -8
- package/cjs/stepper/hooks/useButtonClick.js +28 -19
- package/cjs/stepper/hooks/useInputEvent.js +18 -9
- package/cjs/stepper/hooks/useValue.js +14 -9
- package/cjs/stepper/index.js +96 -82
- package/cjs/stepper/style/css/index.js +1 -0
- package/cjs/stepper/style/index.js +1 -0
- package/cjs/steps/index.js +40 -22
- package/cjs/steps/step.js +27 -10
- package/cjs/steps/style/css/index.js +1 -0
- package/cjs/steps/style/index.js +1 -0
- package/cjs/sticky/index.js +65 -36
- package/cjs/sticky/style/css/index.js +1 -0
- package/cjs/sticky/style/index.js +1 -0
- package/cjs/style.d.ts +9 -8
- package/cjs/style.js +64 -8
- package/cjs/swipe-action/index.js +92 -40
- package/cjs/swipe-action/item.js +17 -9
- package/cjs/swipe-action/style/css/index.js +1 -0
- package/cjs/swipe-action/style/index.js +1 -0
- package/cjs/swipe-load/index.js +83 -55
- package/cjs/swipe-load/style/css/index.js +1 -0
- package/cjs/swipe-load/style/index.js +1 -0
- package/cjs/switch/index.js +47 -27
- package/cjs/switch/style/css/index.js +1 -0
- package/cjs/switch/style/index.js +1 -0
- package/cjs/tab-bar/index.js +7 -0
- package/cjs/tab-bar/item.js +24 -6
- package/cjs/tab-bar/style/css/index.js +1 -0
- package/cjs/tab-bar/style/index.js +1 -0
- package/cjs/tab-bar/tab-bar.js +31 -15
- package/cjs/tabs/index.js +195 -129
- package/cjs/tabs/style/css/index.js +1 -0
- package/cjs/tabs/style/index.js +1 -0
- package/cjs/tabs/tab-cell-underline.js +111 -38
- package/cjs/tabs/tab-cell.js +124 -70
- package/cjs/tabs/tab-pane.js +94 -49
- package/cjs/tabs/type.d.ts +18 -2
- package/cjs/tag/index.js +8 -1
- package/cjs/tag/list.js +26 -11
- package/cjs/tag/style/css/index.js +1 -0
- package/cjs/tag/style/index.js +1 -0
- package/cjs/tag/tag.js +32 -20
- package/cjs/textarea/index.js +56 -35
- package/cjs/textarea/style/css/index.js +2 -0
- package/cjs/textarea/style/index.js +2 -0
- package/cjs/toast/index.d.ts +12 -12
- package/cjs/toast/index.js +61 -26
- package/cjs/toast/methods.js +16 -2
- package/cjs/toast/style/css/index.js +3 -0
- package/cjs/toast/style/index.js +3 -0
- package/cjs/transition/index.js +18 -10
- package/cjs/transition/style/css/index.js +1 -0
- package/cjs/transition/style/index.js +1 -0
- package/dist/index.js +21588 -19198
- package/dist/index.min.js +4 -4
- package/dist/style.css +3637 -3501
- package/dist/style.min.css +1 -1
- package/esm/_helpers/hooks.js +103 -42
- package/esm/_helpers/index.js +3 -2
- package/esm/_helpers/react-dom.js +10 -0
- package/esm/_helpers/render.js +7 -0
- package/esm/action-sheet/index.d.ts +2 -2
- package/esm/action-sheet/index.js +16 -10
- package/esm/avatar/group.js +16 -12
- package/esm/avatar/index.js +62 -51
- package/esm/badge/index.js +22 -18
- package/esm/button/hooks.js +18 -15
- package/esm/button/index.js +57 -46
- package/esm/carousel/index.d.ts +6 -0
- package/esm/carousel/index.js +336 -186
- package/esm/carousel/style/css/index.css +50 -15
- package/esm/carousel/style/index.less +19 -14
- package/esm/cell/cell.js +14 -14
- package/esm/cell/demo/style/css/mobile.css +8 -0
- package/esm/cell/demo/style/mobile.less +2 -2
- package/esm/cell/group.js +11 -9
- package/esm/cell/index.js +1 -1
- package/esm/cell/style/css/index.css +16 -0
- package/esm/cell/style/index.less +6 -4
- package/esm/checkbox/checkbox.js +42 -31
- package/esm/checkbox/group.js +28 -24
- package/esm/checkbox/hooks/useMergeProps.js +9 -7
- package/esm/checkbox/index.js +2 -2
- package/esm/checkbox/type.js +1 -0
- package/esm/circle-progress/index.js +49 -37
- package/esm/collapse/collapse.js +46 -27
- package/esm/collapse/group.js +34 -20
- package/esm/collapse/index.js +1 -1
- package/esm/collapse/utils.js +1 -0
- package/esm/context-provider/index.d.ts +6 -0
- package/esm/context-provider/index.js +20 -11
- package/esm/count-down/hooks.js +37 -24
- package/esm/count-down/index.js +29 -30
- package/esm/count-down/singleton.js +5 -2
- package/esm/count-down/util.js +42 -33
- package/esm/date-picker/helper.js +9 -7
- package/esm/date-picker/index.js +93 -42
- package/esm/dialog/index.d.ts +2 -2
- package/esm/dialog/index.js +39 -28
- package/esm/dialog/methods.js +11 -9
- package/esm/divider/demo/style/css/mobile.css +7 -0
- package/esm/divider/demo/style/mobile.less +12 -0
- package/esm/divider/index.d.ts +49 -0
- package/esm/divider/index.js +49 -0
- package/esm/divider/style/css/index.css +69 -0
- package/esm/divider/style/css/index.d.ts +2 -0
- package/esm/divider/style/css/index.js +2 -0
- package/esm/divider/style/index.d.ts +2 -0
- package/esm/divider/style/index.js +2 -0
- package/esm/divider/style/index.less +66 -0
- package/esm/dropdown/dropdown.js +102 -74
- package/esm/dropdown/index.js +1 -1
- package/esm/dropdown/options.js +20 -12
- package/esm/dropdown-menu/dropdown-menu.js +74 -49
- package/esm/dropdown-menu/helper.js +16 -6
- package/esm/dropdown-menu/index.js +1 -1
- package/esm/ellipsis/components/js-ellipsis.js +63 -33
- package/esm/ellipsis/components/native-ellipsis.js +11 -9
- package/esm/ellipsis/index.js +21 -20
- package/esm/ellipsis/utils/dom.js +7 -0
- package/esm/ellipsis/utils/is.js +1 -1
- package/esm/form/form-item.js +110 -42
- package/esm/form/index.js +20 -17
- package/esm/form/type.js +3 -0
- package/esm/form/useForm.js +71 -17
- package/esm/form/utils.js +6 -3
- package/esm/grid/index.js +34 -21
- package/esm/icon/IconAdd/index.js +6 -5
- package/esm/icon/IconArrowBack/index.js +6 -5
- package/esm/icon/IconArrowDown/index.js +6 -5
- package/esm/icon/IconArrowIn/index.js +6 -5
- package/esm/icon/IconArrowUp/index.js +6 -5
- package/esm/icon/IconCheck/index.js +6 -5
- package/esm/icon/IconCheckBold/index.js +6 -5
- package/esm/icon/IconCircleChecked/index.js +6 -5
- package/esm/icon/IconCircleDisabled/index.js +6 -5
- package/esm/icon/IconCircleUnchecked/index.js +6 -5
- package/esm/icon/IconClear/index.js +6 -5
- package/esm/icon/IconClose/index.js +6 -5
- package/esm/icon/IconCloseBold/index.js +6 -5
- package/esm/icon/IconDelete/index.js +6 -5
- package/esm/icon/IconEdit/index.js +6 -5
- package/esm/icon/IconErrorCircle/index.js +6 -5
- package/esm/icon/IconEyeInvisible/index.js +6 -5
- package/esm/icon/IconEyeVisible/index.js +6 -5
- package/esm/icon/IconEyelashInvisible/index.js +6 -5
- package/esm/icon/IconGift/index.js +6 -5
- package/esm/icon/IconHeart/index.js +6 -5
- package/esm/icon/IconHome/index.js +6 -5
- package/esm/icon/IconLikeCircle/index.js +6 -5
- package/esm/icon/IconMinus/index.js +6 -5
- package/esm/icon/IconMore/index.js +6 -5
- package/esm/icon/IconNotice/index.js +6 -5
- package/esm/icon/IconNoticeOff/index.js +6 -5
- package/esm/icon/IconPicture/index.js +6 -5
- package/esm/icon/IconPlay/index.js +6 -5
- package/esm/icon/IconQuestionCircle/index.js +6 -5
- package/esm/icon/IconRefresh/index.js +6 -5
- package/esm/icon/IconSad/index.js +6 -5
- package/esm/icon/IconScan/index.js +6 -5
- package/esm/icon/IconSearch/index.js +6 -5
- package/esm/icon/IconSetting/index.js +6 -5
- package/esm/icon/IconShop/index.js +6 -5
- package/esm/icon/IconShopping/index.js +6 -5
- package/esm/icon/IconSmileFill/index.js +6 -5
- package/esm/icon/IconSound/index.js +6 -5
- package/esm/icon/IconSquareChecked/index.js +6 -5
- package/esm/icon/IconSquareDisabled/index.js +6 -5
- package/esm/icon/IconSquareUnchecked/index.js +6 -5
- package/esm/icon/IconStar/index.js +6 -5
- package/esm/icon/IconStarFill/index.js +6 -5
- package/esm/icon/IconStarHalf/index.js +6 -5
- package/esm/icon/IconSubway/index.js +6 -5
- package/esm/icon/IconSuccessCircle/index.js +6 -5
- package/esm/icon/IconTriDown/index.js +6 -5
- package/esm/icon/IconTriUp/index.js +6 -5
- package/esm/icon/IconUpload/index.js +6 -5
- package/esm/icon/IconUser/index.js +6 -5
- package/esm/icon/IconUserFill/index.js +6 -5
- package/esm/icon/IconWarnCircle/index.js +6 -5
- package/esm/icon/IconWarnCircleFill/index.js +6 -5
- package/esm/image/index.js +84 -57
- package/esm/image/style/css/index.css +1 -0
- package/esm/image/style/index.less +1 -0
- package/esm/image-picker/index.js +80 -52
- package/esm/image-preview/index.d.ts +2 -2
- package/esm/image-preview/index.js +217 -119
- package/esm/image-preview/methods.js +14 -4
- package/esm/index.d.ts +10 -9
- package/esm/index.js +10 -9
- package/esm/input/demo/style/css/mobile.css +5 -1
- package/esm/input/demo/style/mobile.less +2 -2
- package/esm/input/hooks.js +96 -42
- package/esm/input/index.js +30 -26
- package/esm/input/props.d.ts +6 -0
- package/esm/input/style/css/index.css +9 -0
- package/esm/input/style/index.less +2 -2
- package/esm/load-more/index.js +48 -29
- package/esm/loading/index.js +40 -19
- package/esm/masking/index.d.ts +2 -2
- package/esm/masking/index.js +64 -46
- package/esm/masking/methods.js +15 -4
- package/esm/nav-bar/back-icon.js +3 -1
- package/esm/nav-bar/index.js +52 -37
- package/esm/notice-bar/index.js +56 -35
- package/esm/notice-bar/style/css/index.css +33 -0
- package/esm/notice-bar/style/index.less +16 -3
- package/esm/notify/index.d.ts +8 -8
- package/esm/notify/index.js +33 -20
- package/esm/notify/methods.js +13 -2
- package/esm/pagination/index.js +50 -27
- package/esm/picker/index.js +66 -40
- package/esm/picker-view/components/cascader.js +23 -14
- package/esm/picker-view/components/multi-picker.js +16 -6
- package/esm/picker-view/components/picker-cell.js +89 -45
- package/esm/picker-view/index.js +54 -25
- package/esm/popover/hooks/useEvent.js +41 -26
- package/esm/popover/hooks/usePosition.js +144 -94
- package/esm/popover/index.js +2 -2
- package/esm/popover/menu.js +41 -32
- package/esm/popover/popover-inner.js +38 -30
- package/esm/popover/popover.js +90 -69
- package/esm/popup/index.d.ts +2 -2
- package/esm/popup/index.js +25 -22
- package/esm/popup-swiper/index.d.ts +2 -2
- package/esm/popup-swiper/index.js +64 -38
- package/esm/portal/index.js +5 -3
- package/esm/progress/index.js +36 -27
- package/esm/pull-refresh/android-pull-refresh.js +90 -58
- package/esm/pull-refresh/hooks.js +23 -11
- package/esm/pull-refresh/index.js +5 -3
- package/esm/pull-refresh/ios-pull-refresh.js +68 -53
- package/esm/pull-refresh/model.js +1 -0
- package/esm/radio/group.js +24 -20
- package/esm/radio/index.js +2 -2
- package/esm/rate/index.js +39 -24
- package/esm/search-bar/association.js +27 -14
- package/esm/search-bar/cancel-button.js +11 -8
- package/esm/search-bar/highlight.js +20 -14
- package/esm/search-bar/index.js +86 -77
- package/esm/show-monitor/index.js +85 -34
- package/esm/slider/hooks/useSliderEvents.js +51 -26
- package/esm/slider/hooks/useSliderIcon.js +13 -6
- package/esm/slider/hooks/useSliderInit.js +46 -32
- package/esm/slider/hooks/useSliderStyle.js +20 -12
- package/esm/slider/index.js +62 -46
- package/esm/slider/marks.js +18 -12
- package/esm/slider/popover.js +6 -4
- package/esm/slider/thumb.js +15 -8
- package/esm/stepper/hooks/useButtonClick.js +27 -19
- package/esm/stepper/hooks/useInputEvent.js +16 -9
- package/esm/stepper/hooks/useValue.js +12 -9
- package/esm/stepper/index.js +82 -82
- package/esm/steps/index.js +27 -22
- package/esm/steps/step.js +19 -10
- package/esm/sticky/index.js +56 -36
- package/esm/style.d.ts +9 -8
- package/esm/style.js +9 -8
- package/esm/swipe-action/index.js +80 -40
- package/esm/swipe-action/item.js +12 -9
- package/esm/swipe-load/index.js +75 -56
- package/esm/switch/index.js +39 -27
- package/esm/tab-bar/index.js +1 -0
- package/esm/tab-bar/item.js +13 -6
- package/esm/tab-bar/tab-bar.js +21 -15
- package/esm/tabs/index.js +183 -130
- package/esm/tabs/tab-cell-underline.js +103 -38
- package/esm/tabs/tab-cell.js +114 -70
- package/esm/tabs/tab-pane.js +85 -49
- package/esm/tabs/type.d.ts +18 -2
- package/esm/tag/index.js +2 -2
- package/esm/tag/list.js +16 -11
- package/esm/tag/tag.js +22 -20
- package/esm/textarea/index.js +46 -35
- package/esm/toast/index.d.ts +12 -12
- package/esm/toast/index.js +42 -26
- package/esm/toast/methods.js +12 -2
- package/esm/transition/index.js +12 -10
- package/package.json +3 -3
- package/tokens/app/arcodesign/default/css-variables.less +8 -0
- package/tokens/app/arcodesign/default/index.d.ts +8 -0
- package/tokens/app/arcodesign/default/index.js +11 -1
- package/tokens/app/arcodesign/default/index.json +94 -0
- package/tokens/app/arcodesign/default/index.less +8 -0
- package/tokens/mixin/index.less +19 -1
- package/umd/_helpers/hooks.js +121 -43
- package/umd/_helpers/index.js +6 -2
- package/umd/_helpers/react-dom.js +11 -0
- package/umd/_helpers/render.js +9 -0
- package/umd/action-sheet/index.d.ts +2 -2
- package/umd/action-sheet/index.js +22 -10
- package/umd/action-sheet/methods.js +1 -0
- package/umd/avatar/group.js +20 -12
- package/umd/avatar/index.js +68 -51
- package/umd/badge/index.js +25 -18
- package/umd/button/hooks.js +19 -15
- package/umd/button/index.js +60 -46
- package/umd/carousel/index.d.ts +6 -0
- package/umd/carousel/index.js +337 -184
- package/umd/carousel/style/css/index.css +50 -15
- package/umd/carousel/style/index.less +19 -14
- package/umd/cell/arrow.js +2 -0
- package/umd/cell/cell.js +18 -14
- package/umd/cell/demo/style/css/mobile.css +8 -0
- package/umd/cell/demo/style/mobile.less +2 -2
- package/umd/cell/group.js +17 -9
- package/umd/cell/index.js +2 -1
- package/umd/cell/style/css/index.css +16 -0
- package/umd/cell/style/index.less +6 -4
- package/umd/checkbox/checkbox.js +45 -31
- package/umd/checkbox/group.js +34 -24
- package/umd/checkbox/hooks/useMergeProps.js +12 -7
- package/umd/checkbox/index.js +3 -1
- package/umd/checkbox/type.js +2 -0
- package/umd/circle-progress/index.js +52 -37
- package/umd/collapse/collapse.js +50 -27
- package/umd/collapse/group.js +38 -20
- package/umd/collapse/index.js +3 -0
- package/umd/collapse/utils.js +5 -0
- package/umd/context-provider/index.d.ts +6 -0
- package/umd/context-provider/index.js +25 -11
- package/umd/count-down/hooks.js +39 -24
- package/umd/count-down/index.js +31 -29
- package/umd/count-down/singleton.js +10 -2
- package/umd/count-down/util.js +47 -33
- package/umd/date-picker/helper.js +13 -7
- package/umd/date-picker/index.js +97 -42
- package/umd/dialog/index.d.ts +2 -2
- package/umd/dialog/index.js +44 -28
- package/umd/dialog/methods.js +18 -9
- package/umd/divider/demo/style/css/mobile.css +7 -0
- package/umd/divider/demo/style/mobile.less +12 -0
- package/umd/divider/index.d.ts +49 -0
- package/umd/divider/index.js +71 -0
- package/umd/divider/style/css/index.css +69 -0
- package/umd/divider/style/css/index.d.ts +2 -0
- package/umd/divider/style/css/index.js +15 -0
- package/umd/divider/style/index.d.ts +2 -0
- package/umd/divider/style/index.js +15 -0
- package/umd/divider/style/index.less +66 -0
- package/umd/dropdown/dropdown.js +106 -74
- package/umd/dropdown/index.js +3 -1
- package/umd/dropdown/options.js +24 -12
- package/umd/dropdown-menu/dropdown-menu.js +78 -49
- package/umd/dropdown-menu/helper.js +25 -6
- package/umd/dropdown-menu/index.js +2 -0
- package/umd/ellipsis/components/js-ellipsis.js +69 -33
- package/umd/ellipsis/components/native-ellipsis.js +13 -9
- package/umd/ellipsis/index.js +24 -19
- package/umd/ellipsis/utils/dom.js +8 -0
- package/umd/ellipsis/utils/is.js +5 -1
- package/umd/form/form-item-context.js +3 -0
- package/umd/form/form-item.js +114 -42
- package/umd/form/index.js +25 -17
- package/umd/form/type.js +3 -0
- package/umd/form/useForm.js +72 -18
- package/umd/form/utils.js +10 -3
- package/umd/grid/index.js +37 -21
- package/umd/icon/IconAdd/index.js +7 -5
- package/umd/icon/IconArrowBack/index.js +7 -5
- package/umd/icon/IconArrowDown/index.js +7 -5
- package/umd/icon/IconArrowIn/index.js +7 -5
- package/umd/icon/IconArrowUp/index.js +7 -5
- package/umd/icon/IconCheck/index.js +7 -5
- package/umd/icon/IconCheckBold/index.js +7 -5
- package/umd/icon/IconCircleChecked/index.js +7 -5
- package/umd/icon/IconCircleDisabled/index.js +7 -5
- package/umd/icon/IconCircleUnchecked/index.js +7 -5
- package/umd/icon/IconClear/index.js +7 -5
- package/umd/icon/IconClose/index.js +7 -5
- package/umd/icon/IconCloseBold/index.js +7 -5
- package/umd/icon/IconDelete/index.js +7 -5
- package/umd/icon/IconEdit/index.js +7 -5
- package/umd/icon/IconErrorCircle/index.js +7 -5
- package/umd/icon/IconEyeInvisible/index.js +7 -5
- package/umd/icon/IconEyeVisible/index.js +7 -5
- package/umd/icon/IconEyelashInvisible/index.js +7 -5
- package/umd/icon/IconGift/index.js +7 -5
- package/umd/icon/IconHeart/index.js +7 -5
- package/umd/icon/IconHome/index.js +7 -5
- package/umd/icon/IconLikeCircle/index.js +7 -5
- package/umd/icon/IconMinus/index.js +7 -5
- package/umd/icon/IconMore/index.js +7 -5
- package/umd/icon/IconNotice/index.js +7 -5
- package/umd/icon/IconNoticeOff/index.js +7 -5
- package/umd/icon/IconPicture/index.js +7 -5
- package/umd/icon/IconPlay/index.js +7 -5
- package/umd/icon/IconQuestionCircle/index.js +7 -5
- package/umd/icon/IconRefresh/index.js +7 -5
- package/umd/icon/IconSad/index.js +7 -5
- package/umd/icon/IconScan/index.js +7 -5
- package/umd/icon/IconSearch/index.js +7 -5
- package/umd/icon/IconSetting/index.js +7 -5
- package/umd/icon/IconShop/index.js +7 -5
- package/umd/icon/IconShopping/index.js +7 -5
- package/umd/icon/IconSmileFill/index.js +7 -5
- package/umd/icon/IconSound/index.js +7 -5
- package/umd/icon/IconSquareChecked/index.js +7 -5
- package/umd/icon/IconSquareDisabled/index.js +7 -5
- package/umd/icon/IconSquareUnchecked/index.js +7 -5
- package/umd/icon/IconStar/index.js +7 -5
- package/umd/icon/IconStarFill/index.js +7 -5
- package/umd/icon/IconStarHalf/index.js +7 -5
- package/umd/icon/IconSubway/index.js +7 -5
- package/umd/icon/IconSuccessCircle/index.js +7 -5
- package/umd/icon/IconTriDown/index.js +7 -5
- package/umd/icon/IconTriUp/index.js +7 -5
- package/umd/icon/IconUpload/index.js +7 -5
- package/umd/icon/IconUser/index.js +7 -5
- package/umd/icon/IconUserFill/index.js +7 -5
- package/umd/icon/IconWarnCircle/index.js +7 -5
- package/umd/icon/IconWarnCircleFill/index.js +7 -5
- package/umd/icon/index.js +1 -0
- package/umd/image/index.js +86 -56
- package/umd/image/style/css/index.css +1 -0
- package/umd/image/style/index.less +1 -0
- package/umd/image-picker/add-icon.js +2 -0
- package/umd/image-picker/index.js +85 -52
- package/umd/image-preview/index.d.ts +2 -2
- package/umd/image-preview/index.js +224 -119
- package/umd/image-preview/methods.js +15 -5
- package/umd/index.d.ts +10 -9
- package/umd/index.js +26 -23
- package/umd/input/demo/style/css/mobile.css +5 -1
- package/umd/input/demo/style/mobile.less +2 -2
- package/umd/input/hooks.js +100 -42
- package/umd/input/index.js +35 -26
- package/umd/input/props.d.ts +6 -0
- package/umd/input/style/css/index.css +9 -0
- package/umd/input/style/index.less +2 -2
- package/umd/load-more/index.js +51 -29
- package/umd/loading/index.js +43 -19
- package/umd/masking/index.d.ts +2 -2
- package/umd/masking/index.js +71 -46
- package/umd/masking/methods.js +16 -4
- package/umd/nav-bar/back-icon.js +4 -1
- package/umd/nav-bar/index.js +55 -37
- package/umd/notice-bar/index.js +57 -33
- package/umd/notice-bar/style/css/index.css +33 -0
- package/umd/notice-bar/style/index.less +16 -3
- package/umd/notify/index.d.ts +8 -8
- package/umd/notify/index.js +40 -20
- package/umd/notify/methods.js +14 -2
- package/umd/pagination/arrow.js +2 -0
- package/umd/pagination/index.js +53 -27
- package/umd/picker/index.js +70 -40
- package/umd/picker-view/components/cascader.js +27 -14
- package/umd/picker-view/components/multi-picker.js +19 -6
- package/umd/picker-view/components/picker-cell.js +93 -45
- package/umd/picker-view/index.js +58 -25
- package/umd/popover/hooks/useEvent.js +44 -25
- package/umd/popover/hooks/usePosition.js +145 -94
- package/umd/popover/index.js +3 -1
- package/umd/popover/menu.js +45 -32
- package/umd/popover/popover-inner.js +42 -30
- package/umd/popover/popover.js +94 -69
- package/umd/popup/index.d.ts +2 -2
- package/umd/popup/index.js +31 -22
- package/umd/popup/methods.js +1 -0
- package/umd/popup-swiper/index.d.ts +2 -2
- package/umd/popup-swiper/index.js +71 -38
- package/umd/popup-swiper/methods.js +1 -0
- package/umd/portal/index.js +6 -3
- package/umd/progress/index.js +39 -27
- package/umd/pull-refresh/android-pull-refresh.js +93 -58
- package/umd/pull-refresh/hooks.js +29 -11
- package/umd/pull-refresh/index.js +7 -3
- package/umd/pull-refresh/ios-pull-refresh.js +72 -53
- package/umd/pull-refresh/model.js +1 -0
- package/umd/radio/group.js +30 -20
- package/umd/radio/index.js +3 -1
- package/umd/radio/radio.js +5 -0
- package/umd/rate/index.js +44 -24
- package/umd/search-bar/association.js +29 -14
- package/umd/search-bar/cancel-button.js +14 -8
- package/umd/search-bar/highlight.js +21 -14
- package/umd/search-bar/index.js +87 -77
- package/umd/show-monitor/index.js +89 -34
- package/umd/slider/hooks/index.js +4 -0
- package/umd/slider/hooks/useSliderEvents.js +52 -26
- package/umd/slider/hooks/useSliderIcon.js +17 -6
- package/umd/slider/hooks/useSliderInit.js +50 -32
- package/umd/slider/hooks/useSliderStyle.js +22 -12
- package/umd/slider/index.js +65 -46
- package/umd/slider/marks.js +21 -12
- package/umd/slider/popover.js +10 -4
- package/umd/slider/thumb.js +18 -8
- package/umd/stepper/hooks/useButtonClick.js +27 -19
- package/umd/stepper/hooks/useInputEvent.js +17 -9
- package/umd/stepper/hooks/useValue.js +13 -9
- package/umd/stepper/index.js +87 -82
- package/umd/steps/index.js +32 -22
- package/umd/steps/step.js +22 -10
- package/umd/sticky/index.js +59 -36
- package/umd/style.d.ts +9 -8
- package/umd/style.js +4 -4
- package/umd/swipe-action/index.js +84 -40
- package/umd/swipe-action/item.js +14 -9
- package/umd/swipe-load/index.js +77 -55
- package/umd/switch/index.js +43 -27
- package/umd/tab-bar/index.js +2 -0
- package/umd/tab-bar/item.js +19 -6
- package/umd/tab-bar/tab-bar.js +26 -15
- package/umd/tabs/index.js +186 -129
- package/umd/tabs/tab-cell-underline.js +107 -38
- package/umd/tabs/tab-cell.js +119 -70
- package/umd/tabs/tab-pane.js +89 -49
- package/umd/tabs/type.d.ts +18 -2
- package/umd/tag/index.js +3 -1
- package/umd/tag/list.js +20 -11
- package/umd/tag/tag.js +26 -20
- package/umd/textarea/index.js +51 -35
- package/umd/toast/index.d.ts +12 -12
- package/umd/toast/index.js +49 -26
- package/umd/toast/methods.js +13 -2
- package/umd/transition/index.js +12 -10
package/esm/notify/methods.js
CHANGED
@@ -7,27 +7,34 @@ export function notify(Component, type) {
|
|
7
7
|
content: originConfig,
|
8
8
|
type: 'info'
|
9
9
|
} : originConfig;
|
10
|
+
|
10
11
|
if (type !== void 0) {
|
11
12
|
config.type = type;
|
12
13
|
}
|
14
|
+
|
13
15
|
var div = document.createElement('div');
|
14
16
|
var getContainer = config.getContainer;
|
17
|
+
|
15
18
|
if (getContainer) {
|
16
19
|
getContainer().appendChild(div);
|
17
20
|
} else {
|
18
21
|
document.body.appendChild(div);
|
19
22
|
}
|
23
|
+
|
20
24
|
var _ReactDOMRender = new ReactDOMRender(Component, div, context),
|
21
|
-
|
22
|
-
|
25
|
+
render = _ReactDOMRender.render,
|
26
|
+
unmount = _ReactDOMRender.unmount;
|
27
|
+
|
23
28
|
function destroy() {
|
24
29
|
var onClose = config.onClose;
|
25
30
|
onClose && onClose();
|
26
31
|
unmount();
|
32
|
+
|
27
33
|
if (div.parentNode) {
|
28
34
|
div.parentNode.removeChild(div);
|
29
35
|
}
|
30
36
|
}
|
37
|
+
|
31
38
|
var dynamicProps = _extends({}, config, {
|
32
39
|
close: close,
|
33
40
|
onClose: destroy,
|
@@ -36,16 +43,20 @@ export function notify(Component, type) {
|
|
36
43
|
},
|
37
44
|
visible: false
|
38
45
|
});
|
46
|
+
|
39
47
|
var leaving = false;
|
48
|
+
|
40
49
|
function update(newConfig) {
|
41
50
|
dynamicProps = _extends({}, dynamicProps, newConfig);
|
42
51
|
render(dynamicProps);
|
43
52
|
}
|
53
|
+
|
44
54
|
function close() {
|
45
55
|
leaving = true;
|
46
56
|
dynamicProps.visible = false;
|
47
57
|
render(dynamicProps);
|
48
58
|
}
|
59
|
+
|
49
60
|
render(dynamicProps);
|
50
61
|
nextTick(function () {
|
51
62
|
if (leaving) return;
|
package/esm/pagination/index.js
CHANGED
@@ -3,6 +3,7 @@ import { cls } from '@arco-design/mobile-utils';
|
|
3
3
|
import { GlobalContext } from '../context-provider';
|
4
4
|
import { useSystem } from '../_helpers';
|
5
5
|
import Arrow from './arrow';
|
6
|
+
|
6
7
|
/**
|
7
8
|
* 用于数据分页,为完全受控组件
|
8
9
|
* @en The pagination component is used for data paging and is a fully controlled component.
|
@@ -13,35 +14,37 @@ import Arrow from './arrow';
|
|
13
14
|
*/
|
14
15
|
var Pagination = /*#__PURE__*/forwardRef(function (props, ref) {
|
15
16
|
var _cls4;
|
17
|
+
|
16
18
|
var _useContext = useContext(GlobalContext),
|
17
|
-
|
18
|
-
|
19
|
+
prefixCls = _useContext.prefixCls,
|
20
|
+
locale = _useContext.locale;
|
21
|
+
|
19
22
|
var _props$className = props.className,
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
23
|
+
className = _props$className === void 0 ? '' : _props$className,
|
24
|
+
style = props.style,
|
25
|
+
_props$current = props.current,
|
26
|
+
current = _props$current === void 0 ? 1 : _props$current,
|
27
|
+
_props$pageSize = props.pageSize,
|
28
|
+
pageSize = _props$pageSize === void 0 ? 10 : _props$pageSize,
|
29
|
+
_props$total = props.total,
|
30
|
+
total = _props$total === void 0 ? 5 : _props$total,
|
31
|
+
_props$icon = props.icon,
|
32
|
+
icon = _props$icon === void 0 ? false : _props$icon,
|
33
|
+
_props$justify = props.justify,
|
34
|
+
justify = _props$justify === void 0 ? 'side' : _props$justify,
|
35
|
+
_props$hideOnOnePage = props.hideOnOnePage,
|
36
|
+
hideOnOnePage = _props$hideOnOnePage === void 0 ? false : _props$hideOnOnePage,
|
37
|
+
_props$nextFieldType = props.nextFieldType,
|
38
|
+
nextFieldType = _props$nextFieldType === void 0 ? 'default' : _props$nextFieldType,
|
39
|
+
renderPrevField = props.renderPrevField,
|
40
|
+
renderNextField = props.renderNextField,
|
41
|
+
_props$type = props.type,
|
42
|
+
type = _props$type === void 0 ? 'default' : _props$type,
|
43
|
+
_props$prevFieldText = props.prevFieldText,
|
44
|
+
prevFieldText = _props$prevFieldText === void 0 ? locale == null ? void 0 : locale.Pagination.previousPage : _props$prevFieldText,
|
45
|
+
_props$nextFieldText = props.nextFieldText,
|
46
|
+
nextFieldText = _props$nextFieldText === void 0 ? locale == null ? void 0 : locale.Pagination.nextPage : _props$nextFieldText,
|
47
|
+
onChange = props.onChange;
|
45
48
|
var system = useSystem();
|
46
49
|
var pageNum = useMemo(function () {
|
47
50
|
return Math.ceil(total / pageSize);
|
@@ -52,6 +55,7 @@ var Pagination = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
52
55
|
dom: domRef.current
|
53
56
|
};
|
54
57
|
});
|
58
|
+
|
55
59
|
var iconRender = function iconRender(iconType) {
|
56
60
|
if (iconType === 'prev') {
|
57
61
|
if (Array.isArray(icon) && Boolean(icon.length)) {
|
@@ -59,35 +63,44 @@ var Pagination = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
59
63
|
className: "btn-icon"
|
60
64
|
}, icon[0]);
|
61
65
|
}
|
66
|
+
|
62
67
|
if (Object.prototype.toString.call(icon) === '[object Object]') {
|
63
68
|
return /*#__PURE__*/React.createElement("span", {
|
64
69
|
className: "btn-icon"
|
65
70
|
}, icon);
|
66
71
|
}
|
72
|
+
|
67
73
|
return icon ? /*#__PURE__*/React.createElement("span", {
|
68
74
|
className: "btn-icon"
|
69
75
|
}, /*#__PURE__*/React.createElement(Arrow, null)) : null;
|
70
76
|
}
|
77
|
+
|
71
78
|
if (Array.isArray(icon) && Boolean(icon.length)) {
|
72
79
|
return /*#__PURE__*/React.createElement("span", {
|
73
80
|
className: "btn-icon"
|
74
81
|
}, icon.length >= 2 ? icon[1] : icon[0]);
|
75
82
|
}
|
83
|
+
|
76
84
|
if (Object.prototype.toString.call(icon) === '[object Object]') {
|
77
85
|
return /*#__PURE__*/React.createElement("span", {
|
78
86
|
className: "btn-icon next"
|
79
87
|
}, icon);
|
80
88
|
}
|
89
|
+
|
81
90
|
return icon ? /*#__PURE__*/React.createElement("span", {
|
82
91
|
className: "btn-icon next"
|
83
92
|
}, /*#__PURE__*/React.createElement(Arrow, null)) : null;
|
84
93
|
};
|
94
|
+
|
85
95
|
var prevRender = function prevRender(prefix) {
|
86
96
|
var _cls;
|
97
|
+
|
87
98
|
if (type === 'none') {
|
88
99
|
return null;
|
89
100
|
}
|
101
|
+
|
90
102
|
var prevFieldCls = cls(prefix + "-prev-field", (_cls = {}, _cls["flex-" + justify] = true, _cls));
|
103
|
+
|
91
104
|
if (typeof renderPrevField === 'undefined') {
|
92
105
|
return /*#__PURE__*/React.createElement("div", {
|
93
106
|
className: prevFieldCls
|
@@ -101,6 +114,7 @@ var Pagination = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
101
114
|
if (current <= 1) {
|
102
115
|
return;
|
103
116
|
}
|
117
|
+
|
104
118
|
onChange == null ? void 0 : onChange({
|
105
119
|
pageSize: pageSize,
|
106
120
|
pageNum: pageNum,
|
@@ -111,6 +125,7 @@ var Pagination = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
111
125
|
className: "btn-text"
|
112
126
|
}, prevFieldText)));
|
113
127
|
}
|
128
|
+
|
114
129
|
return /*#__PURE__*/React.createElement("div", {
|
115
130
|
className: prevFieldCls
|
116
131
|
}, renderPrevField ? renderPrevField({
|
@@ -119,14 +134,19 @@ var Pagination = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
119
134
|
pageNum: pageNum
|
120
135
|
}) : null);
|
121
136
|
};
|
137
|
+
|
122
138
|
var nextRender = function nextRender(prefix) {
|
123
139
|
var _cls2;
|
140
|
+
|
124
141
|
if (type === 'none') {
|
125
142
|
return null;
|
126
143
|
}
|
144
|
+
|
127
145
|
var nextFieldCls = cls(prefix + "-next-field", (_cls2 = {}, _cls2["flex-" + justify] = true, _cls2));
|
146
|
+
|
128
147
|
if (typeof renderNextField === 'undefined') {
|
129
148
|
var _cls3;
|
149
|
+
|
130
150
|
return /*#__PURE__*/React.createElement("div", {
|
131
151
|
className: nextFieldCls
|
132
152
|
}, /*#__PURE__*/React.createElement("div", {
|
@@ -138,6 +158,7 @@ var Pagination = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
138
158
|
if (current >= pageNum) {
|
139
159
|
return;
|
140
160
|
}
|
161
|
+
|
141
162
|
onChange == null ? void 0 : onChange({
|
142
163
|
pageSize: pageSize,
|
143
164
|
pageNum: pageNum,
|
@@ -148,6 +169,7 @@ var Pagination = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
148
169
|
className: "btn-text"
|
149
170
|
}, nextFieldText), iconRender('next')));
|
150
171
|
}
|
172
|
+
|
151
173
|
var nextItem = renderNextField && renderNextField({
|
152
174
|
current: current,
|
153
175
|
pageSize: pageSize,
|
@@ -157,6 +179,7 @@ var Pagination = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
157
179
|
className: nextFieldCls
|
158
180
|
}, nextItem);
|
159
181
|
};
|
182
|
+
|
160
183
|
var prefix = prefixCls + "-pagination";
|
161
184
|
return !(hideOnOnePage && pageNum === 1) ? /*#__PURE__*/React.createElement("div", {
|
162
185
|
ref: domRef,
|
package/esm/picker/index.js
CHANGED
@@ -9,72 +9,84 @@ import PickerView from '../picker-view';
|
|
9
9
|
import { useListenResize } from '../_helpers';
|
10
10
|
export * from './type';
|
11
11
|
export { MultiPicker, PickerCell, Cascader } from '../picker-view';
|
12
|
+
|
12
13
|
var getInitialValue = function getInitialValue(value, data, cascade) {
|
13
14
|
if (value && value.length) {
|
14
15
|
return value;
|
15
16
|
}
|
17
|
+
|
16
18
|
var computedValue = [];
|
19
|
+
|
17
20
|
if (!cascade) {
|
18
21
|
if (!(data[0] instanceof Array)) {
|
19
22
|
var _data$;
|
23
|
+
|
20
24
|
return (_data$ = data[0]) != null && _data$.value ? [data[0].value] : [];
|
21
25
|
}
|
26
|
+
|
22
27
|
data.map(function (column) {
|
23
28
|
computedValue.push(typeof column[0] === 'object' ? column[0].value : column[0]);
|
24
29
|
});
|
25
30
|
} else {
|
26
31
|
var cascadePickerData = data;
|
32
|
+
|
27
33
|
if (!cascadePickerData || !cascadePickerData.length) {
|
28
34
|
return computedValue;
|
29
35
|
}
|
36
|
+
|
30
37
|
computedValue.push(cascadePickerData[0].value);
|
31
38
|
var traverse = cascadePickerData[0].children;
|
39
|
+
|
32
40
|
while (traverse) {
|
33
41
|
computedValue.push(traverse[0].value);
|
34
42
|
traverse = traverse[0].children;
|
35
43
|
}
|
36
44
|
}
|
45
|
+
|
37
46
|
return computedValue;
|
38
47
|
};
|
48
|
+
|
39
49
|
var Picker = /*#__PURE__*/forwardRef(function (props, ref) {
|
40
50
|
var className = props.className,
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
51
|
+
itemStyle = props.itemStyle,
|
52
|
+
_props$cascade = props.cascade,
|
53
|
+
cascade = _props$cascade === void 0 ? true : _props$cascade,
|
54
|
+
_props$cols = props.cols,
|
55
|
+
cols = _props$cols === void 0 ? 3 : _props$cols,
|
56
|
+
_props$rows = props.rows,
|
57
|
+
rows = _props$rows === void 0 ? 5 : _props$rows,
|
58
|
+
data = props.data,
|
59
|
+
okText = props.okText,
|
60
|
+
dismissText = props.dismissText,
|
61
|
+
_props$disabled = props.disabled,
|
62
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
63
|
+
_props$clickable = props.clickable,
|
64
|
+
clickable = _props$clickable === void 0 ? true : _props$clickable,
|
65
|
+
_props$hideEmptyCols = props.hideEmptyCols,
|
66
|
+
hideEmptyCols = _props$hideEmptyCols === void 0 ? false : _props$hideEmptyCols,
|
67
|
+
_props$title = props.title,
|
68
|
+
title = _props$title === void 0 ? '' : _props$title,
|
69
|
+
_props$visible = props.visible,
|
70
|
+
visible = _props$visible === void 0 ? false : _props$visible,
|
71
|
+
value = props.value,
|
72
|
+
_props$needBottomOffs = props.needBottomOffset,
|
73
|
+
needBottomOffset = _props$needBottomOffs === void 0 ? false : _props$needBottomOffs,
|
74
|
+
onDismiss = props.onDismiss,
|
75
|
+
onOk = props.onOk,
|
76
|
+
onChange = props.onChange,
|
77
|
+
_props$maskClosable = props.maskClosable,
|
78
|
+
maskClosable = _props$maskClosable === void 0 ? false : _props$maskClosable,
|
79
|
+
onHide = props.onHide,
|
80
|
+
onPickerChange = props.onPickerChange,
|
81
|
+
touchToStop = props.touchToStop,
|
82
|
+
_props$gestureOutOfCo = props.gestureOutOfControl,
|
83
|
+
gestureOutOfControl = _props$gestureOutOfCo === void 0 ? true : _props$gestureOutOfCo,
|
84
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
85
|
+
|
75
86
|
var _useState = useState(getInitialValue(value, data, cascade)),
|
76
|
-
|
77
|
-
|
87
|
+
scrollValue = _useState[0],
|
88
|
+
setScrollValue = _useState[1];
|
89
|
+
|
78
90
|
var domRef = useRef(null);
|
79
91
|
var pickerViewRef = useRef(null);
|
80
92
|
useImperativeHandle(ref, function () {
|
@@ -82,68 +94,82 @@ var Picker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
82
94
|
dom: domRef.current,
|
83
95
|
getCellMovingStatus: function getCellMovingStatus() {
|
84
96
|
var _pickerViewRef$curren;
|
97
|
+
|
85
98
|
return ((_pickerViewRef$curren = pickerViewRef.current) == null ? void 0 : _pickerViewRef$curren.getCellMovingStatus()) || [];
|
86
99
|
},
|
87
100
|
getAllColumnValues: function getAllColumnValues() {
|
88
101
|
var _pickerViewRef$curren2;
|
102
|
+
|
89
103
|
return ((_pickerViewRef$curren2 = pickerViewRef.current) == null ? void 0 : _pickerViewRef$curren2.getAllColumnValues()) || [];
|
90
104
|
},
|
91
105
|
getColumnValue: function getColumnValue(index) {
|
92
106
|
var _pickerViewRef$curren3;
|
107
|
+
|
93
108
|
return ((_pickerViewRef$curren3 = pickerViewRef.current) == null ? void 0 : _pickerViewRef$curren3.getColumnValue(index)) || '';
|
94
109
|
},
|
95
110
|
updateLayout: function updateLayout() {
|
96
111
|
var _pickerViewRef$curren4;
|
112
|
+
|
97
113
|
return (_pickerViewRef$curren4 = pickerViewRef.current) == null ? void 0 : _pickerViewRef$curren4.updateLayout();
|
98
114
|
},
|
99
115
|
scrollToCurrentIndex: function scrollToCurrentIndex() {
|
100
116
|
var _pickerViewRef$curren5;
|
117
|
+
|
101
118
|
return (_pickerViewRef$curren5 = pickerViewRef.current) == null ? void 0 : _pickerViewRef$curren5.scrollToCurrentIndex();
|
102
119
|
}
|
103
120
|
};
|
104
121
|
});
|
122
|
+
|
105
123
|
function handleDismiss() {
|
106
124
|
if (onDismiss) {
|
107
125
|
onDismiss();
|
108
126
|
}
|
127
|
+
|
109
128
|
if (onHide) {
|
110
129
|
onHide('dismiss');
|
111
130
|
}
|
112
131
|
}
|
132
|
+
|
113
133
|
var handleConfirm = function handleConfirm() {
|
114
134
|
var _pickerViewRef$curren6;
|
135
|
+
|
115
136
|
(_pickerViewRef$curren6 = pickerViewRef.current) == null ? void 0 : _pickerViewRef$curren6.scrollToCurrentIndex();
|
116
137
|
nextTick(function () {
|
117
138
|
var _pickerViewRef$curren7;
|
139
|
+
|
118
140
|
var val = ((_pickerViewRef$curren7 = pickerViewRef.current) == null ? void 0 : _pickerViewRef$curren7.getAllColumnValues()) || scrollValue;
|
141
|
+
|
119
142
|
if (onOk) {
|
120
143
|
onOk(val);
|
121
144
|
}
|
145
|
+
|
122
146
|
if (onChange) {
|
123
147
|
onChange(val);
|
124
148
|
}
|
149
|
+
|
125
150
|
if (onHide) {
|
126
151
|
onHide('confirm');
|
127
152
|
}
|
128
153
|
});
|
129
154
|
};
|
155
|
+
|
130
156
|
useEffect(function () {
|
131
157
|
setScrollValue(value);
|
132
158
|
}, [value, setScrollValue]);
|
133
|
-
useListenResize(updateLayoutByVisible, [visible]);
|
159
|
+
useListenResize(updateLayoutByVisible, [visible]); // 每次visible从false变为true时需要重新设置scrollValue的值为当前value的值(初始值)
|
134
160
|
|
135
|
-
// 每次visible从false变为true时需要重新设置scrollValue的值为当前value的值(初始值)
|
136
161
|
function updateLayoutByVisible() {
|
137
162
|
if (visible && pickerViewRef.current) {
|
138
163
|
pickerViewRef.current.updateLayout();
|
139
164
|
}
|
140
165
|
}
|
166
|
+
|
141
167
|
useEffect(function () {
|
142
168
|
updateLayoutByVisible();
|
143
169
|
}, [visible]);
|
144
170
|
return /*#__PURE__*/React.createElement(ContextLayout, null, function (_ref) {
|
145
171
|
var prefixCls = _ref.prefixCls,
|
146
|
-
|
172
|
+
locale = _ref.locale;
|
147
173
|
return /*#__PURE__*/React.createElement(Popup, _extends({
|
148
174
|
visible: visible,
|
149
175
|
className: cls(className, prefixCls + "-picker all-border-box"),
|
@@ -183,7 +209,6 @@ var Picker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
183
209
|
})));
|
184
210
|
});
|
185
211
|
});
|
186
|
-
|
187
212
|
/**
|
188
213
|
* 选择器组件,形式是弹起的浮层。
|
189
214
|
* @en The selector component, in the form of a popup layer.
|
@@ -193,4 +218,5 @@ var Picker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
193
218
|
* @name_en Picker
|
194
219
|
* @displayName Picker
|
195
220
|
*/
|
221
|
+
|
196
222
|
export default componentWrapper(Picker, 'Picker');
|
@@ -4,20 +4,20 @@ import MultiPicker from './multi-picker';
|
|
4
4
|
import PickerCell from './picker-cell';
|
5
5
|
var Cascader = /*#__PURE__*/forwardRef(function (props, ref) {
|
6
6
|
var prefixCls = props.prefixCls,
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
7
|
+
itemStyle = props.itemStyle,
|
8
|
+
cols = props.cols,
|
9
|
+
data = props.data,
|
10
|
+
disabled = props.disabled,
|
11
|
+
clickable = props.clickable,
|
12
|
+
itemHeight = props.itemHeight,
|
13
|
+
wrapperHeight = props.wrapperHeight,
|
14
|
+
rows = props.rows,
|
15
|
+
hideEmptyCols = props.hideEmptyCols,
|
16
|
+
onPickerChange = props.onPickerChange,
|
17
|
+
onValueChange = props.onValueChange,
|
18
|
+
_props$selectedValue = props.selectedValue,
|
19
|
+
selectedValue = _props$selectedValue === void 0 ? [] : _props$selectedValue,
|
20
|
+
touchToStop = props.touchToStop;
|
21
21
|
var pickerCellsRef = useRef([]);
|
22
22
|
useImperativeHandle(ref, function () {
|
23
23
|
return {
|
@@ -25,29 +25,35 @@ var Cascader = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
25
25
|
scrollToCurrentIndex: scrollToCurrentIndex
|
26
26
|
};
|
27
27
|
});
|
28
|
+
|
28
29
|
function getCellMovingStatus() {
|
29
30
|
return pickerCellsRef.current.map(function (cell) {
|
30
31
|
return cell.movingStatus;
|
31
32
|
});
|
32
33
|
}
|
34
|
+
|
33
35
|
function scrollToCurrentIndex() {
|
34
36
|
pickerCellsRef.current.forEach(function (cell) {
|
35
37
|
return cell.scrollToCurrentIndex();
|
36
38
|
});
|
37
39
|
}
|
40
|
+
|
38
41
|
function _onValueChange(value, index) {
|
39
42
|
var children = arrayTreeFilter(data, function (item, level) {
|
40
43
|
return level <= index && item.value === value[level];
|
41
44
|
});
|
42
45
|
var child = children[index];
|
43
46
|
var i;
|
47
|
+
|
44
48
|
for (i = index + 1; i < cols && child && child.children; i++) {
|
45
49
|
child = child.children[0];
|
46
50
|
value[i] = child.value;
|
47
51
|
}
|
52
|
+
|
48
53
|
value.length = i;
|
49
54
|
onValueChange == null ? void 0 : onValueChange(value, index);
|
50
55
|
}
|
56
|
+
|
51
57
|
function _formatData() {
|
52
58
|
var childrenTree = arrayTreeFilter(data, function (item, level) {
|
53
59
|
return item.value === selectedValue[level];
|
@@ -55,15 +61,18 @@ var Cascader = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
55
61
|
return item.children;
|
56
62
|
});
|
57
63
|
var needPad = cols - childrenTree.length;
|
64
|
+
|
58
65
|
if (needPad > 0) {
|
59
66
|
for (var i = 0; i < needPad; i++) {
|
60
67
|
childrenTree.push([]);
|
61
68
|
}
|
62
69
|
}
|
70
|
+
|
63
71
|
childrenTree.length = cols - 1;
|
64
72
|
childrenTree.unshift(data);
|
65
73
|
return childrenTree;
|
66
74
|
}
|
75
|
+
|
67
76
|
var formatData = useMemo(function () {
|
68
77
|
return _formatData();
|
69
78
|
}, [data, selectedValue]);
|
@@ -1,42 +1,51 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
export default function MultiPicker(props) {
|
3
3
|
var prefixCls = props.prefixCls,
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
onValueChange = props.onValueChange,
|
5
|
+
onPickerChange = props.onPickerChange,
|
6
|
+
children = props.children,
|
7
|
+
itemHeight = props.itemHeight,
|
8
|
+
selectedValue = props.selectedValue,
|
9
|
+
data = props.data;
|
10
|
+
|
10
11
|
function getValue() {
|
11
12
|
if (selectedValue && selectedValue.length) {
|
12
13
|
return selectedValue;
|
13
14
|
}
|
15
|
+
|
14
16
|
if (data) {
|
15
17
|
return data.map(function (item) {
|
16
18
|
return item && item[0] && item[0].value;
|
17
19
|
});
|
18
20
|
}
|
21
|
+
|
19
22
|
if (!children) {
|
20
23
|
return [];
|
21
24
|
}
|
25
|
+
|
22
26
|
return React.Children.map(children, function (child) {
|
23
27
|
var childrenArray = React.Children.toArray(child.children || child.props.children);
|
24
28
|
return childrenArray && childrenArray[0] && childrenArray[0].props.value;
|
25
29
|
});
|
26
30
|
}
|
31
|
+
|
27
32
|
function onChange(index, value, callback) {
|
28
33
|
var newValue = getValue().concat();
|
29
34
|
newValue[index] = value;
|
35
|
+
|
30
36
|
if (callback) {
|
31
37
|
callback(newValue, index);
|
32
38
|
}
|
33
39
|
}
|
40
|
+
|
34
41
|
function _onValueChange(value, index) {
|
35
42
|
onChange(index, value, onValueChange);
|
36
43
|
}
|
44
|
+
|
37
45
|
function _onScrollChange(value, index) {
|
38
46
|
onChange(index, value, onPickerChange);
|
39
47
|
}
|
48
|
+
|
40
49
|
function renderChild() {
|
41
50
|
var value = getValue();
|
42
51
|
return React.Children.map(children, function (col, index) {
|
@@ -51,6 +60,7 @@ export default function MultiPicker(props) {
|
|
51
60
|
});
|
52
61
|
});
|
53
62
|
}
|
63
|
+
|
54
64
|
return /*#__PURE__*/React.createElement("div", {
|
55
65
|
className: prefixCls + "-multi",
|
56
66
|
style: {
|