sard 1.0.0-canary.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/dist/accordion/Item.d.ts +17 -0
- package/dist/accordion/Item.js +25 -0
- package/dist/accordion/index.d.ts +26 -0
- package/dist/accordion/index.js +27 -0
- package/dist/accordion/index.scss +49 -0
- package/dist/action-sheet/ActionSheet.d.ts +24 -0
- package/dist/action-sheet/ActionSheet.js +79 -0
- package/dist/action-sheet/Agent.d.ts +6 -0
- package/dist/action-sheet/Agent.js +7 -0
- package/dist/action-sheet/Item.d.ts +16 -0
- package/dist/action-sheet/Item.js +22 -0
- package/dist/action-sheet/imperative.d.ts +10 -0
- package/dist/action-sheet/imperative.js +22 -0
- package/dist/action-sheet/index.d.ts +12 -0
- package/dist/action-sheet/index.js +10 -0
- package/dist/action-sheet/index.scss +148 -0
- package/dist/animated/index.d.ts +62 -0
- package/dist/animated/index.js +101 -0
- package/dist/animated/index.rn.d.ts +4 -0
- package/dist/animated/index.rn.js +35 -0
- package/dist/avatar/Group.d.ts +9 -0
- package/dist/avatar/Group.js +27 -0
- package/dist/avatar/index.d.ts +17 -0
- package/dist/avatar/index.js +22 -0
- package/dist/avatar/index.scss +82 -0
- package/dist/badge/index.d.ts +13 -0
- package/dist/badge/index.js +16 -0
- package/dist/badge/index.scss +81 -0
- package/dist/base.d.ts +11 -0
- package/dist/base.js +1 -0
- package/dist/button/CustomButton.d.ts +9 -0
- package/dist/button/CustomButton.js +23 -0
- package/dist/button/index.d.ts +21 -0
- package/dist/button/index.js +34 -0
- package/dist/button/index.scss +346 -0
- package/dist/calendar/Day.d.ts +23 -0
- package/dist/calendar/Day.js +70 -0
- package/dist/calendar/MonthPicker.d.ts +13 -0
- package/dist/calendar/MonthPicker.js +22 -0
- package/dist/calendar/Toolbar.d.ts +11 -0
- package/dist/calendar/Toolbar.js +18 -0
- package/dist/calendar/Weeks.d.ts +6 -0
- package/dist/calendar/Weeks.js +18 -0
- package/dist/calendar/index.d.ts +48 -0
- package/dist/calendar/index.js +193 -0
- package/dist/calendar/index.scss +210 -0
- package/dist/card/index.d.ts +15 -0
- package/dist/card/index.js +14 -0
- package/dist/card/index.scss +64 -0
- package/dist/cascader/index.d.ts +43 -0
- package/dist/cascader/index.js +216 -0
- package/dist/cascader/index.scss +130 -0
- package/dist/checkbox/Group.d.ts +5 -0
- package/dist/checkbox/Group.js +5 -0
- package/dist/checkbox/index.d.ts +10 -0
- package/dist/checkbox/index.js +8 -0
- package/dist/checkbox/index.scss +78 -0
- package/dist/collapse/index.d.ts +14 -0
- package/dist/collapse/index.js +61 -0
- package/dist/collapse/index.rn.d.ts +14 -0
- package/dist/collapse/index.rn.js +76 -0
- package/dist/collapse/index.scss +31 -0
- package/dist/components.d.ts +66 -0
- package/dist/components.js +66 -0
- package/dist/components.scss +65 -0
- package/dist/config-provider/index.d.ts +21 -0
- package/dist/config-provider/index.js +20 -0
- package/dist/count-down/index.d.ts +26 -0
- package/dist/count-down/index.js +95 -0
- package/dist/datetime-picker/index.d.ts +36 -0
- package/dist/datetime-picker/index.js +230 -0
- package/dist/dialog/Agent.d.ts +6 -0
- package/dist/dialog/Agent.js +7 -0
- package/dist/dialog/Dialog.d.ts +31 -0
- package/dist/dialog/Dialog.js +103 -0
- package/dist/dialog/imperative.d.ts +17 -0
- package/dist/dialog/imperative.js +35 -0
- package/dist/dialog/index.d.ts +14 -0
- package/dist/dialog/index.js +12 -0
- package/dist/dialog/index.scss +156 -0
- package/dist/dropdown/Item.d.ts +33 -0
- package/dist/dropdown/Item.js +164 -0
- package/dist/dropdown/Option.d.ts +10 -0
- package/dist/dropdown/Option.js +12 -0
- package/dist/dropdown/index.d.ts +20 -0
- package/dist/dropdown/index.js +59 -0
- package/dist/dropdown/index.scss +236 -0
- package/dist/ellipsis/index.d.ts +8 -0
- package/dist/ellipsis/index.js +18 -0
- package/dist/ellipsis/index.scss +23 -0
- package/dist/empty/index.d.ts +10 -0
- package/dist/empty/index.js +14 -0
- package/dist/empty/index.scss +59 -0
- package/dist/footer-bar/index.d.ts +8 -0
- package/dist/footer-bar/index.js +15 -0
- package/dist/footer-bar/index.scss +29 -0
- package/dist/form/CustomForm.d.ts +13 -0
- package/dist/form/CustomForm.js +26 -0
- package/dist/form/ErrorList.d.ts +6 -0
- package/dist/form/ErrorList.js +15 -0
- package/dist/form/Field.d.ts +41 -0
- package/dist/form/Field.js +124 -0
- package/dist/form/FieldContext.d.ts +18 -0
- package/dist/form/FieldContext.js +8 -0
- package/dist/form/List.d.ts +31 -0
- package/dist/form/List.js +87 -0
- package/dist/form/Map.d.ts +17 -0
- package/dist/form/Map.js +24 -0
- package/dist/form/NodeContext.d.ts +12 -0
- package/dist/form/NodeContext.js +14 -0
- package/dist/form/Validator.d.ts +88 -0
- package/dist/form/Validator.js +268 -0
- package/dist/form/createFormStore.d.ts +36 -0
- package/dist/form/createFormStore.js +249 -0
- package/dist/form/index.d.ts +43 -0
- package/dist/form/index.js +109 -0
- package/dist/form/index.scss +200 -0
- package/dist/form/store/Context.d.ts +4 -0
- package/dist/form/store/Context.js +3 -0
- package/dist/form/store/createStore.d.ts +6 -0
- package/dist/form/store/createStore.js +28 -0
- package/dist/form/store/useDispatch.d.ts +2 -0
- package/dist/form/store/useDispatch.js +10 -0
- package/dist/form/store/useSelector.d.ts +7 -0
- package/dist/form/store/useSelector.js +35 -0
- package/dist/form/type.d.ts +20 -0
- package/dist/form/type.js +1 -0
- package/dist/form/useForm.d.ts +27 -0
- package/dist/form/useForm.js +14 -0
- package/dist/form/useInternalWatch.d.ts +3 -0
- package/dist/form/useInternalWatch.js +27 -0
- package/dist/form/useNode.d.ts +49 -0
- package/dist/form/useNode.js +284 -0
- package/dist/form/useValidator.d.ts +23 -0
- package/dist/form/useValidator.js +74 -0
- package/dist/form/useWatch.d.ts +4 -0
- package/dist/form/useWatch.js +24 -0
- package/dist/grid/Col.d.ts +9 -0
- package/dist/grid/Col.js +20 -0
- package/dist/grid/Row.d.ts +11 -0
- package/dist/grid/Row.js +34 -0
- package/dist/grid/index.d.ts +2 -0
- package/dist/grid/index.js +2 -0
- package/dist/grid/index.scss +56 -0
- package/dist/halfline/index.d.ts +10 -0
- package/dist/halfline/index.js +27 -0
- package/dist/halfline/index.scss +80 -0
- package/dist/icon/common.d.ts +15 -0
- package/dist/icon/common.js +1 -0
- package/dist/icon/font/iconfont.json +275 -0
- package/dist/icon/font/iconfont.rn.scss +0 -0
- package/dist/icon/font/iconfont.scss +164 -0
- package/dist/icon/font/iconfont.ttf +0 -0
- package/dist/icon/fontLoader.d.ts +7 -0
- package/dist/icon/fontLoader.js +14 -0
- package/dist/icon/fontLoader.rn.d.ts +6 -0
- package/dist/icon/fontLoader.rn.js +52 -0
- package/dist/icon/index.d.ts +21 -0
- package/dist/icon/index.js +41 -0
- package/dist/icon/index.scss +23 -0
- package/dist/index-bar/Item.d.ts +9 -0
- package/dist/index-bar/Item.js +11 -0
- package/dist/index-bar/Nav.d.ts +13 -0
- package/dist/index-bar/Nav.js +75 -0
- package/dist/index-bar/index.d.ts +19 -0
- package/dist/index-bar/index.js +142 -0
- package/dist/index-bar/index.scss +153 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.scss +1 -0
- package/dist/input/index.d.ts +37 -0
- package/dist/input/index.js +116 -0
- package/dist/input/index.scss +249 -0
- package/dist/linear-gradient/index.d.ts +14 -0
- package/dist/linear-gradient/index.js +30 -0
- package/dist/linear-gradient/index.rn.d.ts +3 -0
- package/dist/linear-gradient/index.rn.js +3 -0
- package/dist/list/Item.d.ts +22 -0
- package/dist/list/Item.js +26 -0
- package/dist/list/ListContext.d.ts +9 -0
- package/dist/list/ListContext.js +2 -0
- package/dist/list/OrderContext.d.ts +8 -0
- package/dist/list/OrderContext.js +6 -0
- package/dist/list/index.d.ts +19 -0
- package/dist/list/index.js +29 -0
- package/dist/list/index.scss +257 -0
- package/dist/loading/index.d.ts +10 -0
- package/dist/loading/index.js +47 -0
- package/dist/loading/index.scss +25 -0
- package/dist/locale/index.d.ts +199 -0
- package/dist/locale/index.js +36 -0
- package/dist/locale/lang/en-US.d.ts +92 -0
- package/dist/locale/lang/en-US.js +92 -0
- package/dist/locale/lang/zh-CN.d.ts +92 -0
- package/dist/locale/lang/zh-CN.js +92 -0
- package/dist/locale/useTranslate.d.ts +7 -0
- package/dist/locale/useTranslate.js +41 -0
- package/dist/mask/index.d.ts +13 -0
- package/dist/mask/index.js +26 -0
- package/dist/mask/index.scss +24 -0
- package/dist/menu/Item.d.ts +15 -0
- package/dist/menu/Item.js +17 -0
- package/dist/menu/index.d.ts +17 -0
- package/dist/menu/index.js +15 -0
- package/dist/menu/index.scss +128 -0
- package/dist/mesh/Item.d.ts +16 -0
- package/dist/mesh/Item.js +16 -0
- package/dist/mesh/index.d.ts +14 -0
- package/dist/mesh/index.js +69 -0
- package/dist/mesh/index.scss +131 -0
- package/dist/mesh/type.d.ts +9 -0
- package/dist/mesh/type.js +1 -0
- package/dist/modal/index.d.ts +8 -0
- package/dist/modal/index.js +9 -0
- package/dist/modal/index.rn.d.ts +8 -0
- package/dist/modal/index.rn.js +8 -0
- package/dist/navbar/Item.d.ts +8 -0
- package/dist/navbar/Item.js +11 -0
- package/dist/navbar/index.d.ts +15 -0
- package/dist/navbar/index.js +16 -0
- package/dist/navbar/index.scss +128 -0
- package/dist/notice-bar/index.d.ts +28 -0
- package/dist/notice-bar/index.js +135 -0
- package/dist/notice-bar/index.scss +109 -0
- package/dist/notify/Agent.d.ts +6 -0
- package/dist/notify/Agent.js +7 -0
- package/dist/notify/Notify.d.ts +22 -0
- package/dist/notify/Notify.js +48 -0
- package/dist/notify/imperative.d.ts +18 -0
- package/dist/notify/imperative.js +35 -0
- package/dist/notify/index.d.ts +15 -0
- package/dist/notify/index.js +13 -0
- package/dist/notify/index.scss +65 -0
- package/dist/number-keyboard/index.d.ts +10 -0
- package/dist/number-keyboard/index.js +51 -0
- package/dist/number-keyboard/index.scss +93 -0
- package/dist/pagination/index.d.ts +20 -0
- package/dist/pagination/index.js +65 -0
- package/dist/pagination/index.scss +131 -0
- package/dist/pan-gesture-detector/index.d.ts +8 -0
- package/dist/pan-gesture-detector/index.js +11 -0
- package/dist/pan-gesture-detector/index.rn.d.ts +8 -0
- package/dist/pan-gesture-detector/index.rn.js +23 -0
- package/dist/pan-gesture-detector/usePan.d.ts +47 -0
- package/dist/pan-gesture-detector/usePan.js +146 -0
- package/dist/password-input/index.d.ts +22 -0
- package/dist/password-input/index.js +91 -0
- package/dist/password-input/index.scss +189 -0
- package/dist/picker/InertialMotion.d.ts +20 -0
- package/dist/picker/InertialMotion.js +141 -0
- package/dist/picker/PickerView.d.ts +1 -0
- package/dist/picker/PickerView.h5.d.ts +17 -0
- package/dist/picker/PickerView.h5.js +36 -0
- package/dist/picker/PickerView.js +1 -0
- package/dist/picker/PickerViewColumn copy.d.ts +9 -0
- package/dist/picker/PickerViewColumn copy.js +143 -0
- package/dist/picker/PickerViewColumn.d.ts +12 -0
- package/dist/picker/PickerViewColumn.js +238 -0
- package/dist/picker/index.d.ts +38 -0
- package/dist/picker/index.js +224 -0
- package/dist/picker/index.rn.scss +0 -0
- package/dist/picker/index.scss +138 -0
- package/dist/popout/index.d.ts +25 -0
- package/dist/popout/index.js +87 -0
- package/dist/popout/index.scss +136 -0
- package/dist/popout-input/index.d.ts +29 -0
- package/dist/popout-input/index.js +91 -0
- package/dist/popout-input/index.scss +53 -0
- package/dist/popover/index.d.ts +35 -0
- package/dist/popover/index.js +193 -0
- package/dist/popover/index.scss +94 -0
- package/dist/popover/utils.d.ts +23 -0
- package/dist/popover/utils.js +124 -0
- package/dist/popup/index.d.ts +29 -0
- package/dist/popup/index.js +60 -0
- package/dist/popup/index.scss +60 -0
- package/dist/pressable/index.d.ts +13 -0
- package/dist/pressable/index.js +58 -0
- package/dist/pressable/index.rn.d.ts +13 -0
- package/dist/pressable/index.rn.js +50 -0
- package/dist/progress-bar/index.d.ts +10 -0
- package/dist/progress-bar/index.js +22 -0
- package/dist/progress-bar/index.scss +45 -0
- package/dist/progress-circle/index.d.ts +11 -0
- package/dist/progress-circle/index.js +54 -0
- package/dist/progress-circle/index.scss +141 -0
- package/dist/radio/Group.d.ts +5 -0
- package/dist/radio/Group.js +5 -0
- package/dist/radio/index.d.ts +10 -0
- package/dist/radio/index.js +8 -0
- package/dist/radio/index.scss +77 -0
- package/dist/rate/index.d.ts +23 -0
- package/dist/rate/index.js +116 -0
- package/dist/rate/index.scss +99 -0
- package/dist/result/index.d.ts +12 -0
- package/dist/result/index.js +19 -0
- package/dist/result/index.scss +88 -0
- package/dist/safe-area/index.d.ts +7 -0
- package/dist/safe-area/index.js +35 -0
- package/dist/safe-area/index.scss +24 -0
- package/dist/scroll-view/index.d.ts +24 -0
- package/dist/scroll-view/index.js +72 -0
- package/dist/scroll-view/index.rn.d.ts +21 -0
- package/dist/scroll-view/index.rn.js +51 -0
- package/dist/search/index.d.ts +26 -0
- package/dist/search/index.js +35 -0
- package/dist/search/index.scss +75 -0
- package/dist/share-sheet/Item.d.ts +15 -0
- package/dist/share-sheet/Item.js +26 -0
- package/dist/share-sheet/Row.d.ts +10 -0
- package/dist/share-sheet/Row.js +26 -0
- package/dist/share-sheet/index.d.ts +26 -0
- package/dist/share-sheet/index.js +76 -0
- package/dist/share-sheet/index.scss +230 -0
- package/dist/skeleton/Avatar.d.ts +7 -0
- package/dist/skeleton/Avatar.js +17 -0
- package/dist/skeleton/Block.d.ts +8 -0
- package/dist/skeleton/Block.js +44 -0
- package/dist/skeleton/Paragraph.d.ts +7 -0
- package/dist/skeleton/Paragraph.js +13 -0
- package/dist/skeleton/Title.d.ts +7 -0
- package/dist/skeleton/Title.js +16 -0
- package/dist/skeleton/index.d.ts +28 -0
- package/dist/skeleton/index.js +22 -0
- package/dist/skeleton/index.scss +108 -0
- package/dist/slider/index.d.ts +36 -0
- package/dist/slider/index.js +187 -0
- package/dist/slider/index.scss +138 -0
- package/dist/space/index.d.ts +13 -0
- package/dist/space/index.js +33 -0
- package/dist/space/index.scss +36 -0
- package/dist/stepper/index.d.ts +26 -0
- package/dist/stepper/index.js +138 -0
- package/dist/stepper/index.scss +106 -0
- package/dist/steps/Step.d.ts +23 -0
- package/dist/steps/Step.js +41 -0
- package/dist/steps/index.d.ts +23 -0
- package/dist/steps/index.js +38 -0
- package/dist/steps/index.scss +300 -0
- package/dist/style/base.scss +3 -0
- package/dist/style/functions.scss +54 -0
- package/dist/style/index.d.ts +2 -0
- package/dist/style/index.js +2 -0
- package/dist/style/index.scss +0 -0
- package/dist/style/mixins/bem.scss +63 -0
- package/dist/style/mixins/border.scss +80 -0
- package/dist/style/mixins/disabled.scss +9 -0
- package/dist/style/mixins/env.rn.scss +11 -0
- package/dist/style/mixins/env.scss +11 -0
- package/dist/style/mixins/fixed.rn.scss +3 -0
- package/dist/style/mixins/fixed.scss +3 -0
- package/dist/style/mixins/sticky.rn.scss +3 -0
- package/dist/style/mixins/sticky.scss +3 -0
- package/dist/style/mixins/theme.scss +11 -0
- package/dist/style/mixins/universal.rn.scss +2 -0
- package/dist/style/mixins/universal.scss +6 -0
- package/dist/style/mixins.scss +8 -0
- package/dist/style/utils.scss +130 -0
- package/dist/style/variables.scss +422 -0
- package/dist/swiper/Item.d.ts +8 -0
- package/dist/swiper/Item.js +10 -0
- package/dist/swiper/index.d.ts +12 -0
- package/dist/swiper/index.js +13 -0
- package/dist/swiper/index.scss +10 -0
- package/dist/switch/index.d.ts +19 -0
- package/dist/switch/index.js +78 -0
- package/dist/switch/index.scss +106 -0
- package/dist/tabbar/Item.d.ts +17 -0
- package/dist/tabbar/Item.js +24 -0
- package/dist/tabbar/index.d.ts +17 -0
- package/dist/tabbar/index.js +33 -0
- package/dist/tabbar/index.scss +89 -0
- package/dist/tabs/Tab.d.ts +12 -0
- package/dist/tabs/Tab.js +17 -0
- package/dist/tabs/index.d.ts +23 -0
- package/dist/tabs/index.js +258 -0
- package/dist/tabs/index.scss +113 -0
- package/dist/tag/index.d.ts +17 -0
- package/dist/tag/index.js +21 -0
- package/dist/tag/index.scss +93 -0
- package/dist/template/index.d.ts +6 -0
- package/dist/template/index.js +10 -0
- package/dist/template/index.scss +16 -0
- package/dist/toast/Agent.d.ts +6 -0
- package/dist/toast/Agent.js +7 -0
- package/dist/toast/Toast.d.ts +24 -0
- package/dist/toast/Toast.js +43 -0
- package/dist/toast/imperative.d.ts +18 -0
- package/dist/toast/imperative.js +35 -0
- package/dist/toast/index.d.ts +15 -0
- package/dist/toast/index.js +13 -0
- package/dist/toast/index.scss +96 -0
- package/dist/transition/CSSTransition.d.ts +7 -0
- package/dist/transition/CSSTransition.js +49 -0
- package/dist/transition/CSSTransition.rn.d.ts +7 -0
- package/dist/transition/CSSTransition.rn.js +312 -0
- package/dist/transition/index.d.ts +43 -0
- package/dist/transition/index.js +156 -0
- package/dist/transition/index.rn.scss +0 -0
- package/dist/transition/index.scss +158 -0
- package/dist/upload/Preview.d.ts +35 -0
- package/dist/upload/Preview.js +41 -0
- package/dist/upload/PreviewVideo.d.ts +7 -0
- package/dist/upload/PreviewVideo.js +38 -0
- package/dist/upload/PreviewVideo.rn.d.ts +6 -0
- package/dist/upload/PreviewVideo.rn.js +24 -0
- package/dist/upload/chooseMedia.d.ts +26 -0
- package/dist/upload/chooseMedia.h5.d.ts +25 -0
- package/dist/upload/chooseMedia.h5.js +117 -0
- package/dist/upload/chooseMedia.js +55 -0
- package/dist/upload/index.d.ts +37 -0
- package/dist/upload/index.js +167 -0
- package/dist/upload/index.scss +247 -0
- package/dist/use/index.d.ts +20 -0
- package/dist/use/index.js +20 -0
- package/dist/use/useAutoplay.d.ts +1 -0
- package/dist/use/useAutoplay.js +34 -0
- package/dist/use/useBem.d.ts +9 -0
- package/dist/use/useBem.js +52 -0
- package/dist/use/useBrush.d.ts +23 -0
- package/dist/use/useBrush.js +61 -0
- package/dist/use/useControllableValue.d.ts +12 -0
- package/dist/use/useControllableValue.js +59 -0
- package/dist/use/useEvent.d.ts +4 -0
- package/dist/use/useEvent.js +12 -0
- package/dist/use/useForceRender.d.ts +5 -0
- package/dist/use/useForceRender.js +8 -0
- package/dist/use/useIndexableMap.d.ts +21 -0
- package/dist/use/useIndexableMap.js +65 -0
- package/dist/use/useInertRef.d.ts +7 -0
- package/dist/use/useInertRef.js +15 -0
- package/dist/use/useInternalSelect.d.ts +42 -0
- package/dist/use/useInternalSelect.js +64 -0
- package/dist/use/useLayoutUpdateEffect.d.ts +5 -0
- package/dist/use/useLayoutUpdateEffect.js +18 -0
- package/dist/use/usePropRef.d.ts +5 -0
- package/dist/use/usePropRef.js +9 -0
- package/dist/use/useResize.d.ts +2 -0
- package/dist/use/useResize.js +14 -0
- package/dist/use/useResizeObserver.d.ts +5 -0
- package/dist/use/useResizeObserver.js +38 -0
- package/dist/use/useSelect.d.ts +15 -0
- package/dist/use/useSelect.js +56 -0
- package/dist/use/useSelectorId.d.ts +1 -0
- package/dist/use/useSelectorId.js +5 -0
- package/dist/use/useSetTimeout.d.ts +10 -0
- package/dist/use/useSetTimeout.js +34 -0
- package/dist/use/useStopMovePropagate.d.ts +5 -0
- package/dist/use/useStopMovePropagate.js +28 -0
- package/dist/use/useThrottle.d.ts +8 -0
- package/dist/use/useThrottle.js +11 -0
- package/dist/use/useUpdateEffect.d.ts +5 -0
- package/dist/use/useUpdateEffect.js +18 -0
- package/dist/use/useUpdateWatchSync.d.ts +5 -0
- package/dist/use/useUpdateWatchSync.js +18 -0
- package/dist/use/useWatchStateSync.d.ts +4 -0
- package/dist/use/useWatchStateSync.js +18 -0
- package/dist/utils/animate.d.ts +28 -0
- package/dist/utils/animate.js +81 -0
- package/dist/utils/createPubSub.d.ts +8 -0
- package/dist/utils/createPubSub.js +53 -0
- package/dist/utils/date.d.ts +13 -0
- package/dist/utils/date.js +87 -0
- package/dist/utils/dom.d.ts +149 -0
- package/dist/utils/dom.js +297 -0
- package/dist/utils/file.d.ts +18 -0
- package/dist/utils/file.js +57 -0
- package/dist/utils/imperative.d.ts +20 -0
- package/dist/utils/imperative.js +37 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/is.d.ts +16 -0
- package/dist/utils/is.js +57 -0
- package/dist/utils/measure.d.ts +8 -0
- package/dist/utils/measure.js +13 -0
- package/dist/utils/measure.rn.d.ts +8 -0
- package/dist/utils/measure.rn.js +15 -0
- package/dist/utils/platform.android.d.ts +2 -0
- package/dist/utils/platform.android.js +2 -0
- package/dist/utils/platform.d.ts +2 -0
- package/dist/utils/platform.ios.d.ts +2 -0
- package/dist/utils/platform.ios.js +2 -0
- package/dist/utils/platform.js +2 -0
- package/dist/utils/style.d.ts +10 -0
- package/dist/utils/style.js +34 -0
- package/dist/utils/utils.d.ts +199 -0
- package/dist/utils/utils.js +639 -0
- package/package.json +30 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
@import '../style/base.scss';
|
|
2
|
+
// #variables
|
|
3
|
+
$sar-pagination-border-radius: $sar-rounded !default;
|
|
4
|
+
|
|
5
|
+
$sar-pagination-item-height: 40px !default;
|
|
6
|
+
$sar-pagination-item-min-width: 40px !default;
|
|
7
|
+
$sar-pagination-item-padding-x: 10px !default;
|
|
8
|
+
$sar-pagination-item-font-size: $sar-text-base !default;
|
|
9
|
+
$sar-pagination-item-color: $sar-primary !default;
|
|
10
|
+
$sar-pagination-item-active-bg-color: $sar-active-bg-color !default;
|
|
11
|
+
|
|
12
|
+
$sar-pagination-item-current-color: $sar-white !default;
|
|
13
|
+
$sar-pagination-item-current-border-color: $sar-primary !default;
|
|
14
|
+
$sar-pagination-item-current-bg-color: $sar-primary !default;
|
|
15
|
+
|
|
16
|
+
$sar-pagination-ratio-height: 40px !default;
|
|
17
|
+
$sar-pagination-ratio-font-size: $sar-text-base !default;
|
|
18
|
+
|
|
19
|
+
// 暗黑模式
|
|
20
|
+
$sar-pagination-item-active-dark-bg-color: $sar-dark-active-bg-color !default;
|
|
21
|
+
// #endvariables
|
|
22
|
+
|
|
23
|
+
@include bem(pagination) {
|
|
24
|
+
@include b() {
|
|
25
|
+
@include universal;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: flex-start;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@include e(item) {
|
|
32
|
+
@include universal;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
flex: none;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
align-items: center;
|
|
37
|
+
height: $sar-pagination-item-height;
|
|
38
|
+
min-width: $sar-pagination-item-min-width;
|
|
39
|
+
padding: 0 $sar-pagination-item-padding-x;
|
|
40
|
+
|
|
41
|
+
@include ifweb {
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@include m(first) {
|
|
46
|
+
border-top-left-radius: $sar-pagination-border-radius;
|
|
47
|
+
border-bottom-left-radius: $sar-pagination-border-radius;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@include m(last) {
|
|
51
|
+
border-top-right-radius: $sar-pagination-border-radius;
|
|
52
|
+
border-bottom-right-radius: $sar-pagination-border-radius;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@include m(current) {
|
|
56
|
+
z-index: 3;
|
|
57
|
+
background-color: $sar-pagination-item-current-bg-color;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@include m(disabled) {
|
|
61
|
+
@include disabled;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@include m(pressed) {
|
|
65
|
+
background-color: $sar-pagination-item-active-bg-color;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@include e(item-text) {
|
|
70
|
+
font-size: $sar-pagination-item-font-size;
|
|
71
|
+
color: $sar-pagination-item-color;
|
|
72
|
+
|
|
73
|
+
@include m(current) {
|
|
74
|
+
color: $sar-pagination-item-current-color;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@include e(halfline) {
|
|
79
|
+
@include m(current) {
|
|
80
|
+
border-color: $sar-pagination-item-current-border-color;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@include e(prev, next) {
|
|
85
|
+
@include universal;
|
|
86
|
+
flex-direction: row;
|
|
87
|
+
flex: 1 0 auto;
|
|
88
|
+
|
|
89
|
+
@include m(simple) {
|
|
90
|
+
flex: 1;
|
|
91
|
+
padding: 0;
|
|
92
|
+
border-radius: $sar-pagination-border-radius;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@include e(ratio) {
|
|
97
|
+
@include universal;
|
|
98
|
+
flex-direction: row;
|
|
99
|
+
flex: 1;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
height: $sar-pagination-ratio-height;
|
|
103
|
+
font-size: $sar-pagination-ratio-font-size;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@include e(halfline) {
|
|
107
|
+
@include m(first) {
|
|
108
|
+
border-top-left-radius: $sar-pagination-border-radius;
|
|
109
|
+
border-bottom-left-radius: $sar-pagination-border-radius;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@include m(last) {
|
|
113
|
+
border-top-right-radius: $sar-pagination-border-radius;
|
|
114
|
+
border-bottom-right-radius: $sar-pagination-border-radius;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@include m(simple) {
|
|
118
|
+
border-radius: $sar-pagination-border-radius;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@include theme(dark) {
|
|
124
|
+
@include bem(pagination) {
|
|
125
|
+
@include e(item) {
|
|
126
|
+
@include m(pressed) {
|
|
127
|
+
background-color: $sar-pagination-item-active-dark-bg-color;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC, ReactElement } from 'react';
|
|
2
|
+
import { Handlers } from './usePan';
|
|
3
|
+
export interface PanGestureDetectorProps {
|
|
4
|
+
children?: ReactElement;
|
|
5
|
+
handlers: Handlers;
|
|
6
|
+
}
|
|
7
|
+
export declare const PanGestureDetector: FC<PanGestureDetectorProps>;
|
|
8
|
+
export default PanGestureDetector;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { cloneElement, isValidElement } from 'react';
|
|
2
|
+
export const PanGestureDetector = (props) => {
|
|
3
|
+
const { children, handlers } = props;
|
|
4
|
+
if (isValidElement(children)) {
|
|
5
|
+
return cloneElement(children, {
|
|
6
|
+
...handlers,
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
return null;
|
|
10
|
+
};
|
|
11
|
+
export default PanGestureDetector;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC, ReactElement } from 'react';
|
|
2
|
+
import { createHandlers } from './usePan';
|
|
3
|
+
export interface PanGestureDetectorProps {
|
|
4
|
+
children?: ReactElement;
|
|
5
|
+
handlers: ReturnType<typeof createHandlers>;
|
|
6
|
+
}
|
|
7
|
+
export declare const PanGestureDetector: FC<PanGestureDetectorProps>;
|
|
8
|
+
export default PanGestureDetector;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { GestureDetector, Gesture } from 'react-native-gesture-handler';
|
|
4
|
+
export const PanGestureDetector = (props) => {
|
|
5
|
+
const { children, handlers } = props;
|
|
6
|
+
const gesture = useMemo(() => {
|
|
7
|
+
return Gesture.Pan()
|
|
8
|
+
.onTouchesDown((event) => {
|
|
9
|
+
handlers.onTouchStart(event);
|
|
10
|
+
})
|
|
11
|
+
.onTouchesMove((event) => {
|
|
12
|
+
handlers.onTouchMove(event);
|
|
13
|
+
})
|
|
14
|
+
.onTouchesUp((event) => {
|
|
15
|
+
handlers.onTouchEnd(event);
|
|
16
|
+
})
|
|
17
|
+
.onTouchesCancelled((event) => {
|
|
18
|
+
handlers.onTouchCancel(event);
|
|
19
|
+
});
|
|
20
|
+
}, []);
|
|
21
|
+
return _jsx(GestureDetector, { gesture: gesture, children: children });
|
|
22
|
+
};
|
|
23
|
+
export default PanGestureDetector;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface PanHandler {
|
|
2
|
+
(event: any): void;
|
|
3
|
+
}
|
|
4
|
+
export interface PanEvent {
|
|
5
|
+
x0: number;
|
|
6
|
+
y0: number;
|
|
7
|
+
moveX: number;
|
|
8
|
+
moveY: number;
|
|
9
|
+
dx: number;
|
|
10
|
+
dy: number;
|
|
11
|
+
vx: number;
|
|
12
|
+
vy: number;
|
|
13
|
+
offsetX: number;
|
|
14
|
+
offsetY: number;
|
|
15
|
+
axis: '' | 'horizontal' | 'vertical';
|
|
16
|
+
timestamp: number;
|
|
17
|
+
}
|
|
18
|
+
export interface PanCallback {
|
|
19
|
+
(event: PanEvent): void;
|
|
20
|
+
}
|
|
21
|
+
export interface UsePanOptions {
|
|
22
|
+
start?: PanCallback;
|
|
23
|
+
move?: PanCallback;
|
|
24
|
+
end?: PanCallback;
|
|
25
|
+
}
|
|
26
|
+
export type Axis = '' | 'horizontal' | 'vertical';
|
|
27
|
+
export interface Handlers {
|
|
28
|
+
onMouseDown?: ((event: any) => void) | undefined;
|
|
29
|
+
onTouchStart: PanHandler;
|
|
30
|
+
onTouchMove: PanHandler;
|
|
31
|
+
onTouchEnd: PanHandler;
|
|
32
|
+
onTouchCancel: PanHandler;
|
|
33
|
+
}
|
|
34
|
+
export declare function createHandlers(onStart: PanHandler, onMove: PanHandler, onEnd: PanHandler, onCancel: PanHandler): {
|
|
35
|
+
onMouseDown: (event: any) => void;
|
|
36
|
+
onTouchStart: PanHandler;
|
|
37
|
+
onTouchMove: PanHandler;
|
|
38
|
+
onTouchEnd: PanHandler;
|
|
39
|
+
onTouchCancel: PanHandler;
|
|
40
|
+
};
|
|
41
|
+
export declare function usePan({ start, move, end }: UsePanOptions): {
|
|
42
|
+
onMouseDown: (event: any) => void;
|
|
43
|
+
onTouchStart: PanHandler;
|
|
44
|
+
onTouchMove: PanHandler;
|
|
45
|
+
onTouchEnd: PanHandler;
|
|
46
|
+
onTouchCancel: PanHandler;
|
|
47
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { isPC, createMouseBinder } from '../utils';
|
|
3
|
+
const minAxisDistance = 5;
|
|
4
|
+
function getDirection(offsetX, offsetY) {
|
|
5
|
+
if (!isPC || offsetX >= minAxisDistance || offsetY >= minAxisDistance) {
|
|
6
|
+
return offsetX > offsetY ? 'horizontal' : 'vertical';
|
|
7
|
+
}
|
|
8
|
+
return '';
|
|
9
|
+
}
|
|
10
|
+
function getTouch(event) {
|
|
11
|
+
let clientX = 0;
|
|
12
|
+
let clientY = 0;
|
|
13
|
+
// rn
|
|
14
|
+
if (event.allTouches) {
|
|
15
|
+
const touch = event.allTouches[0];
|
|
16
|
+
clientX = touch.absoluteX;
|
|
17
|
+
clientY = touch.absoluteY;
|
|
18
|
+
}
|
|
19
|
+
// web mobile
|
|
20
|
+
else if (event.touches) {
|
|
21
|
+
const touch = event.touches[0];
|
|
22
|
+
clientX = touch.clientX;
|
|
23
|
+
clientY = touch.clientY;
|
|
24
|
+
}
|
|
25
|
+
// web pc
|
|
26
|
+
else {
|
|
27
|
+
clientX = event.clientX;
|
|
28
|
+
clientY = event.clientY;
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
clientX: clientX,
|
|
32
|
+
clientY: clientY,
|
|
33
|
+
timestamp: Date.now(),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export function createHandlers(onStart, onMove, onEnd, onCancel) {
|
|
37
|
+
return {
|
|
38
|
+
onTouchStart: onStart,
|
|
39
|
+
onTouchMove: onMove,
|
|
40
|
+
onTouchEnd: onEnd,
|
|
41
|
+
onTouchCancel: onCancel,
|
|
42
|
+
...(isPC
|
|
43
|
+
? createMouseBinder({
|
|
44
|
+
onStart,
|
|
45
|
+
onMove,
|
|
46
|
+
onEnd,
|
|
47
|
+
})
|
|
48
|
+
: null),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function createPan() {
|
|
52
|
+
let x0 = 0;
|
|
53
|
+
let y0 = 0;
|
|
54
|
+
let moveX = 0;
|
|
55
|
+
let moveY = 0;
|
|
56
|
+
let dx = 0;
|
|
57
|
+
let dy = 0;
|
|
58
|
+
let vx = 0;
|
|
59
|
+
let vy = 0;
|
|
60
|
+
let timestamp = 0;
|
|
61
|
+
let axis = '';
|
|
62
|
+
let offsetX = 0;
|
|
63
|
+
let offsetY = 0;
|
|
64
|
+
let onStart;
|
|
65
|
+
let onMove;
|
|
66
|
+
let onEnd;
|
|
67
|
+
let onCancel;
|
|
68
|
+
function startHandler(event) {
|
|
69
|
+
const touch = getTouch(event);
|
|
70
|
+
x0 = touch.clientX;
|
|
71
|
+
y0 = touch.clientY;
|
|
72
|
+
moveX = x0;
|
|
73
|
+
moveY = y0;
|
|
74
|
+
timestamp = touch.timestamp;
|
|
75
|
+
axis = '';
|
|
76
|
+
return onStart?.(createPanGesture());
|
|
77
|
+
}
|
|
78
|
+
function moveHandler(event) {
|
|
79
|
+
const touch = getTouch(event);
|
|
80
|
+
const currentX = touch.clientX;
|
|
81
|
+
const currentY = touch.clientY;
|
|
82
|
+
dx = currentX - x0;
|
|
83
|
+
dy = currentY - y0;
|
|
84
|
+
const duration = touch.timestamp - timestamp;
|
|
85
|
+
vx = (currentX - moveX) / duration;
|
|
86
|
+
vy = (currentY - moveY) / duration;
|
|
87
|
+
moveX = currentX;
|
|
88
|
+
moveY = currentY;
|
|
89
|
+
timestamp = touch.timestamp;
|
|
90
|
+
offsetX = Math.abs(dx);
|
|
91
|
+
offsetY = Math.abs(dy);
|
|
92
|
+
if (axis === '') {
|
|
93
|
+
axis = getDirection(offsetX, offsetY);
|
|
94
|
+
}
|
|
95
|
+
return onMove?.(createPanGesture());
|
|
96
|
+
}
|
|
97
|
+
function endHandler() {
|
|
98
|
+
return onEnd?.(createPanGesture());
|
|
99
|
+
}
|
|
100
|
+
function cancelHandler() {
|
|
101
|
+
return onCancel?.(createPanGesture());
|
|
102
|
+
}
|
|
103
|
+
function setOnStart(callback) {
|
|
104
|
+
onStart = callback;
|
|
105
|
+
}
|
|
106
|
+
function setOnMove(callback) {
|
|
107
|
+
onMove = callback;
|
|
108
|
+
}
|
|
109
|
+
function setOnEnd(callback) {
|
|
110
|
+
onEnd = callback;
|
|
111
|
+
}
|
|
112
|
+
function setOnCancel(callback) {
|
|
113
|
+
onCancel = callback;
|
|
114
|
+
}
|
|
115
|
+
function createPanGesture() {
|
|
116
|
+
return {
|
|
117
|
+
x0,
|
|
118
|
+
y0,
|
|
119
|
+
moveX,
|
|
120
|
+
moveY,
|
|
121
|
+
dx,
|
|
122
|
+
dy,
|
|
123
|
+
vx,
|
|
124
|
+
vy,
|
|
125
|
+
offsetX,
|
|
126
|
+
offsetY,
|
|
127
|
+
axis,
|
|
128
|
+
timestamp,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
const handlers = createHandlers(startHandler, moveHandler, endHandler, cancelHandler);
|
|
132
|
+
return {
|
|
133
|
+
setOnStart,
|
|
134
|
+
setOnMove,
|
|
135
|
+
setOnEnd,
|
|
136
|
+
setOnCancel,
|
|
137
|
+
handlers,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
export function usePan({ start, move, end }) {
|
|
141
|
+
const pan = useMemo(() => createPan(), []);
|
|
142
|
+
start && pan.setOnStart(start);
|
|
143
|
+
move && pan.setOnMove(move);
|
|
144
|
+
end && (pan.setOnEnd(end), pan.setOnCancel(end));
|
|
145
|
+
return pan.handlers;
|
|
146
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ITouchEvent, InputProps } from '@tarojs/components';
|
|
3
|
+
import { BaseProps } from '../base';
|
|
4
|
+
export interface PasswordInputProps extends Omit<BaseProps, 'children'> {
|
|
5
|
+
value?: string;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
onChange?: (value: string) => void;
|
|
8
|
+
length?: number;
|
|
9
|
+
type?: 'border' | 'underline';
|
|
10
|
+
gap?: number | string;
|
|
11
|
+
plainText?: boolean;
|
|
12
|
+
focused?: boolean;
|
|
13
|
+
defaultFocused?: boolean;
|
|
14
|
+
onFocused?: (focused: boolean) => void;
|
|
15
|
+
onClick?: (event: ITouchEvent) => void;
|
|
16
|
+
custom?: boolean;
|
|
17
|
+
inputType?: InputProps['type'];
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
readOnly?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const PasswordInput: FC<PasswordInputProps>;
|
|
22
|
+
export default PasswordInput;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { CustomWrapper, Input, View, } from '@tarojs/components';
|
|
5
|
+
import { useBem, useControllableValue } from '../use';
|
|
6
|
+
import { filterNullish, isRN } from '../utils';
|
|
7
|
+
import { Animated } from '../animated';
|
|
8
|
+
import Halfline from '../halfline';
|
|
9
|
+
const Cursor = (props) => {
|
|
10
|
+
function renderCursor(anim) {
|
|
11
|
+
return (_jsx(Animated.View, { className: props.className, style: {
|
|
12
|
+
...props.style,
|
|
13
|
+
...(isRN
|
|
14
|
+
? {
|
|
15
|
+
opacity: anim,
|
|
16
|
+
}
|
|
17
|
+
: null),
|
|
18
|
+
} }));
|
|
19
|
+
}
|
|
20
|
+
if (!isRN) {
|
|
21
|
+
return renderCursor();
|
|
22
|
+
}
|
|
23
|
+
const anim = useMemo(() => new Animated.Value(0), []);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
Animated.loop(Animated.sequence([
|
|
26
|
+
Animated.timing(anim, {
|
|
27
|
+
toValue: 1,
|
|
28
|
+
duration: 500,
|
|
29
|
+
useNativeDriver: true,
|
|
30
|
+
}),
|
|
31
|
+
Animated.timing(anim, {
|
|
32
|
+
toValue: 0,
|
|
33
|
+
duration: 500,
|
|
34
|
+
useNativeDriver: true,
|
|
35
|
+
}),
|
|
36
|
+
])).start();
|
|
37
|
+
}, []);
|
|
38
|
+
return renderCursor(anim);
|
|
39
|
+
};
|
|
40
|
+
export const PasswordInput = (props) => {
|
|
41
|
+
const { className, style, value, defaultValue, onChange, length = 6, type = 'border', gap, plainText, focused, defaultFocused, onFocused, onClick, custom, inputType = 'number', disabled, readOnly, ...restProps } = props;
|
|
42
|
+
const [bem] = useBem('password-input');
|
|
43
|
+
const [innerValue, setInnerValue] = useControllableValue({
|
|
44
|
+
value,
|
|
45
|
+
defaultValue,
|
|
46
|
+
trigger: onChange,
|
|
47
|
+
initialValue: '',
|
|
48
|
+
postValue(value) {
|
|
49
|
+
return String(value).slice(0, length);
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
const [innerFocused, setInnerFocused] = useControllableValue({
|
|
53
|
+
value: focused,
|
|
54
|
+
defaultValue: defaultFocused,
|
|
55
|
+
trigger: onFocused,
|
|
56
|
+
initialValue: false,
|
|
57
|
+
});
|
|
58
|
+
const handleClick = (event) => {
|
|
59
|
+
onClick?.(event);
|
|
60
|
+
};
|
|
61
|
+
const handleChange = (event) => {
|
|
62
|
+
setInnerValue(event.target.value ??
|
|
63
|
+
event.detail.value);
|
|
64
|
+
};
|
|
65
|
+
const handleFocus = () => {
|
|
66
|
+
setInnerFocused(true);
|
|
67
|
+
};
|
|
68
|
+
const handleBlur = () => {
|
|
69
|
+
setInnerFocused(false);
|
|
70
|
+
};
|
|
71
|
+
const itemsElement = useMemo(() => {
|
|
72
|
+
return Array(length)
|
|
73
|
+
.fill(0)
|
|
74
|
+
.map((_, i) => {
|
|
75
|
+
const active = innerFocused &&
|
|
76
|
+
(i === innerValue.length ||
|
|
77
|
+
(i === innerValue.length - 1 && i === length - 1));
|
|
78
|
+
return (_jsxs(View, { className: classNames(bem.e('item'), bem.em('item', 'active', active), bem.em('item', 'disabled', disabled)), children: [_jsx(Halfline, { direction: "around", className: classNames(bem.e('halfline'), bem.e('halfline'), bem.em('halfline', type), bem.em('halfline', `${type}-active`, active)), style: filterNullish({
|
|
79
|
+
borderLeftColor: gap === 0 && i !== 0 && !active ? 'transparent' : null,
|
|
80
|
+
}) }), i < innerValue.length &&
|
|
81
|
+
(plainText ? (_jsx(View, { className: classNames(bem.e('plaintext'), bem.em('plaintext', 'disabled', disabled)), children: innerValue[i] })) : (_jsx(View, { className: classNames(bem.e('ciphertext'), bem.em('ciphertext', 'disabled', disabled)) }))), innerFocused && i === innerValue.length && (_jsx(Cursor, { className: bem.e('cursor') }))] }, i));
|
|
82
|
+
});
|
|
83
|
+
}, [length, innerFocused, innerValue, type, plainText, gap, disabled]);
|
|
84
|
+
return (_jsx(CustomWrapper, { children: _jsxs(View, { ...restProps, className: classNames(bem.b(), bem.m('readonly', readOnly), bem.m('disabled', disabled), className), onClick: handleClick, style: {
|
|
85
|
+
...style,
|
|
86
|
+
...filterNullish({
|
|
87
|
+
gap,
|
|
88
|
+
}),
|
|
89
|
+
}, children: [itemsElement, !custom && (_jsx(Input, { className: bem.e('input'), disabled: disabled || readOnly, value: innerValue, type: inputType, maxlength: length, onInput: handleChange, onFocus: handleFocus, onBlur: handleBlur }))] }) }));
|
|
90
|
+
};
|
|
91
|
+
export default PasswordInput;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
@import '../style/base.scss';
|
|
2
|
+
// #variables
|
|
3
|
+
$sar-password-input-gap: 10px !default;
|
|
4
|
+
$sar-password-input-border-color: $sar-border-color !default;
|
|
5
|
+
$sar-password-input-active-border-color: $sar-primary !default;
|
|
6
|
+
|
|
7
|
+
$sar-password-input-height: 48px !default;
|
|
8
|
+
$sar-password-input-ciphertext-size: 10px !default;
|
|
9
|
+
$sar-password-input-ciphertext-bg-color: $sar-body-color !default;
|
|
10
|
+
|
|
11
|
+
$sar-password-input-plaintext-font-size: 20px !default;
|
|
12
|
+
|
|
13
|
+
$sar-password-input-cursor-width: 1px !default;
|
|
14
|
+
$sar-password-input-cursor-height: 20px !default;
|
|
15
|
+
$sar-password-input-cursor-color: $sar-body-color !default;
|
|
16
|
+
$sar-password-input-cursor-animation-duration: 1s !default;
|
|
17
|
+
|
|
18
|
+
// 暗黑模式
|
|
19
|
+
$sar-password-input-border-dark-color: $sar-dark-border-color !default;
|
|
20
|
+
$sar-password-input-active-border-dark-color: $sar-primary !default;
|
|
21
|
+
$sar-password-input-ciphertext-dark-bg-color: $sar-dark-body-color !default;
|
|
22
|
+
$sar-password-input-cursor-dark-color: $sar-dark-body-color !default;
|
|
23
|
+
// #endvariables
|
|
24
|
+
|
|
25
|
+
@include bem(password-input) {
|
|
26
|
+
@include b() {
|
|
27
|
+
@include universal;
|
|
28
|
+
flex-direction: row;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
height: $sar-password-input-height;
|
|
32
|
+
gap: $sar-password-input-gap;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@include e(item) {
|
|
37
|
+
@include universal;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
flex: 1;
|
|
41
|
+
height: 100%;
|
|
42
|
+
|
|
43
|
+
@include m(active) {
|
|
44
|
+
z-index: 2;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@include m(disabled) {
|
|
48
|
+
background-color: $sar-disabled-shallow-bg-color;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@include e(halfline) {
|
|
53
|
+
border-color: transparent;
|
|
54
|
+
|
|
55
|
+
@include m(border) {
|
|
56
|
+
border-color: $sar-password-input-border-color;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@include m(border-active) {
|
|
60
|
+
border-color: $sar-password-input-active-border-color;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@include m(underline) {
|
|
64
|
+
border-bottom-color: $sar-password-input-border-color;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@include m(underline-active) {
|
|
68
|
+
border-bottom-color: $sar-password-input-active-border-color;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@include e(plaintext) {
|
|
73
|
+
@include universal;
|
|
74
|
+
font-size: $sar-password-input-plaintext-font-size;
|
|
75
|
+
|
|
76
|
+
@include m(disabled) {
|
|
77
|
+
color: $sar-disabled-color;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@include e(ciphertext) {
|
|
82
|
+
@include universal;
|
|
83
|
+
width: $sar-password-input-ciphertext-size;
|
|
84
|
+
height: $sar-password-input-ciphertext-size;
|
|
85
|
+
border-radius: $sar-rounded-full;
|
|
86
|
+
background-color: $sar-password-input-ciphertext-bg-color;
|
|
87
|
+
|
|
88
|
+
@include m(disabled) {
|
|
89
|
+
color: $sar-disabled-color;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@include e(cursor) {
|
|
94
|
+
@include universal;
|
|
95
|
+
width: $sar-password-input-cursor-width;
|
|
96
|
+
height: $sar-password-input-cursor-height;
|
|
97
|
+
background-color: $sar-password-input-cursor-color;
|
|
98
|
+
@include ifweb {
|
|
99
|
+
animation: $sar-password-input-cursor-animation-duration #{bem-ns(
|
|
100
|
+
password-input-cursor-flicker
|
|
101
|
+
)} infinite;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@include e(input) {
|
|
106
|
+
@include universal;
|
|
107
|
+
position: absolute;
|
|
108
|
+
top: 0;
|
|
109
|
+
z-index: 3;
|
|
110
|
+
left: -100%;
|
|
111
|
+
width: 200%;
|
|
112
|
+
height: 100%;
|
|
113
|
+
margin: 0;
|
|
114
|
+
padding: 0;
|
|
115
|
+
border: 0;
|
|
116
|
+
opacity: 0;
|
|
117
|
+
|
|
118
|
+
@include ifweb {
|
|
119
|
+
.weui-input {
|
|
120
|
+
width: 100%;
|
|
121
|
+
height: 100%;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
input:disabled {
|
|
125
|
+
cursor: not-allowed;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@include ifweb {
|
|
132
|
+
@keyframes #{bem-ns(password-input-cursor-flicker)} {
|
|
133
|
+
0% {
|
|
134
|
+
opacity: 0;
|
|
135
|
+
}
|
|
136
|
+
50% {
|
|
137
|
+
opacity: 1;
|
|
138
|
+
}
|
|
139
|
+
100% {
|
|
140
|
+
opacity: 0;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@include theme(dark) {
|
|
146
|
+
@include bem(password-input) {
|
|
147
|
+
@include e(item) {
|
|
148
|
+
@include m(disabled) {
|
|
149
|
+
background-color: $sar-dark-disabled-shallow-bg-color;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@include e(halfline) {
|
|
154
|
+
@include m(border) {
|
|
155
|
+
border-color: $sar-password-input-border-dark-color;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@include m(border-active) {
|
|
159
|
+
border-color: $sar-password-input-active-border-dark-color;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@include m(underline) {
|
|
163
|
+
border-bottom-color: $sar-password-input-border-dark-color;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
@include m(underline-active) {
|
|
167
|
+
border-bottom-color: $sar-password-input-active-border-dark-color;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@include e(plaintext) {
|
|
172
|
+
@include m(disabled) {
|
|
173
|
+
color: $sar-dark-disabled-color;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@include e(ciphertext) {
|
|
178
|
+
background-color: $sar-password-input-ciphertext-dark-bg-color;
|
|
179
|
+
|
|
180
|
+
@include m(disabled) {
|
|
181
|
+
color: $sar-dark-disabled-color;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@include e(cursor) {
|
|
186
|
+
background-color: $sar-password-input-cursor-dark-color;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface InertialMotionOptions {
|
|
2
|
+
scrollHeight: number;
|
|
3
|
+
contentHeight: number;
|
|
4
|
+
onReset: (offsetY: number, duration: number, bezier: string) => void;
|
|
5
|
+
onStop: () => void;
|
|
6
|
+
onMove: (offsetY: number) => void;
|
|
7
|
+
onOutsideEnd: (offsetY: number) => void;
|
|
8
|
+
onInsideEnd: (offsetY: number) => void;
|
|
9
|
+
beforeMonmentum: (offsetY: number) => number;
|
|
10
|
+
onMomentum: (offsetY: number, duration: number, bezier: string) => void;
|
|
11
|
+
maxOverflowY?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function createInertialMotion(options: InertialMotionOptions): {
|
|
14
|
+
onStart: (clientY: number) => void;
|
|
15
|
+
onMove: (clientY: number) => void;
|
|
16
|
+
onEnd: () => void;
|
|
17
|
+
setCurrentOffsetY: (offsetY: number) => void;
|
|
18
|
+
setSize: (scrollH: number, contentH: number) => void;
|
|
19
|
+
destroy: () => void;
|
|
20
|
+
};
|