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,17 @@
|
|
|
1
|
+
import { CSSProperties, FC, ReactNode } from 'react';
|
|
2
|
+
export interface AccordionItemProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
style?: CSSProperties;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
duration?: number;
|
|
9
|
+
arrow?: (expanded: boolean) => ReactNode;
|
|
10
|
+
expanded?: boolean;
|
|
11
|
+
defaultExpanded?: boolean;
|
|
12
|
+
onChange?: (expanded: boolean) => void;
|
|
13
|
+
_innerKey?: string | number;
|
|
14
|
+
_multiple?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const AccordionItem: FC<AccordionItemProps>;
|
|
17
|
+
export default AccordionItem;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { View } from '@tarojs/components';
|
|
4
|
+
import { useBem, useEvent, useSelect } from '../use';
|
|
5
|
+
import Collapse from '../collapse';
|
|
6
|
+
import List from '../list';
|
|
7
|
+
import Halfline from '../halfline';
|
|
8
|
+
export const AccordionItem = (props) => {
|
|
9
|
+
const { className, style, children, title, arrow, disabled, duration, expanded, defaultExpanded, onChange, _innerKey, _multiple, ...restProps } = props;
|
|
10
|
+
const [bem] = useBem('accordion');
|
|
11
|
+
const [selected, toggle] = useSelect(_multiple ? 'multiple' : 'single', {
|
|
12
|
+
value: expanded,
|
|
13
|
+
defaultValue: defaultExpanded,
|
|
14
|
+
trigger: onChange,
|
|
15
|
+
initialValue: false,
|
|
16
|
+
clearable: true,
|
|
17
|
+
}, _innerKey);
|
|
18
|
+
const handleClick = useEvent(() => {
|
|
19
|
+
if (!disabled) {
|
|
20
|
+
toggle();
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return (_jsxs(View, { ...restProps, className: classNames(bem.e('item'), className), style: style, children: [_jsx(List.Item, { linkable: true, clickable: !disabled, title: title, arrowDirection: selected ? 'up' : 'down', onClick: handleClick, bodyClass: bem.m('disabled', disabled), footerClass: bem.m('disabled', disabled), className: classNames(bem.e('item-header'), bem.em('item-header', 'disabled', disabled)), arrow: arrow ? arrow(selected) : undefined }), _jsx(Collapse, { duration: duration, visible: selected, children: _jsxs(View, { className: bem.e('item-body'), children: [_jsx(Halfline, { direction: "top", className: bem.e('halfline') }), children] }) })] }));
|
|
24
|
+
};
|
|
25
|
+
export default AccordionItem;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../base';
|
|
3
|
+
import { AccordionItem } from './Item';
|
|
4
|
+
export * from './Item';
|
|
5
|
+
interface AccordionBaseProps extends BaseProps {
|
|
6
|
+
duration?: number;
|
|
7
|
+
arrow?: (expanded: boolean) => ReactNode;
|
|
8
|
+
}
|
|
9
|
+
interface AccordionSingleProps<T = number | string> extends AccordionBaseProps {
|
|
10
|
+
multiple?: false;
|
|
11
|
+
defaultActiveKey?: T;
|
|
12
|
+
activeKey?: T;
|
|
13
|
+
onChange?: (activeKey: T) => void;
|
|
14
|
+
}
|
|
15
|
+
interface AccordionMultipleProps<T = (string | number)[]> extends AccordionBaseProps {
|
|
16
|
+
multiple: true;
|
|
17
|
+
defaultActiveKey?: T;
|
|
18
|
+
activeKey?: T;
|
|
19
|
+
onChange?: (activeKey: T) => void;
|
|
20
|
+
}
|
|
21
|
+
export type AccordionProps = AccordionSingleProps | AccordionMultipleProps;
|
|
22
|
+
export interface AccordionFC extends FC<AccordionProps> {
|
|
23
|
+
Item: typeof AccordionItem;
|
|
24
|
+
}
|
|
25
|
+
export declare const Accordion: AccordionFC;
|
|
26
|
+
export default Accordion;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Children, cloneElement } from 'react';
|
|
3
|
+
import { CustomWrapper } from '@tarojs/components';
|
|
4
|
+
import { useSelectGroup, SelectContext } from '../use';
|
|
5
|
+
import { AccordionItem } from './Item';
|
|
6
|
+
import List from '../list';
|
|
7
|
+
export * from './Item';
|
|
8
|
+
export const Accordion = (props) => {
|
|
9
|
+
const { className, style, children, defaultActiveKey, activeKey, multiple = false, duration = 300, arrow, onChange, ...restProps } = props;
|
|
10
|
+
const context = useSelectGroup({
|
|
11
|
+
value: activeKey,
|
|
12
|
+
defaultValue: defaultActiveKey,
|
|
13
|
+
trigger: onChange,
|
|
14
|
+
initialValue: () => (multiple ? [] : undefined),
|
|
15
|
+
});
|
|
16
|
+
return (_jsx(CustomWrapper, { children: _jsx(SelectContext.Provider, { value: context, children: _jsx(List, { ...restProps, className: className, style: style, children: Children.map(children, (element, index) => {
|
|
17
|
+
const key = element.key ?? index;
|
|
18
|
+
return cloneElement(element, {
|
|
19
|
+
_innerKey: key,
|
|
20
|
+
_multiple: multiple,
|
|
21
|
+
duration: element.props.duration ?? duration,
|
|
22
|
+
arrow: element.props.arrow ?? arrow,
|
|
23
|
+
});
|
|
24
|
+
}) }) }) }));
|
|
25
|
+
};
|
|
26
|
+
Accordion.Item = AccordionItem;
|
|
27
|
+
export default Accordion;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@import '../style/base.scss';
|
|
2
|
+
// #variables
|
|
3
|
+
$sar-accordion-item-body-padding-x: 16px !default;
|
|
4
|
+
$sar-accordion-item-body-padding-y: 16px !default;
|
|
5
|
+
$sar-accordion-item-body-bg-color: $sar-emphasis-bg-color !default;
|
|
6
|
+
|
|
7
|
+
// 暗黑模式
|
|
8
|
+
$sar-accordion-item-body-dark-bg-color: $sar-dark-emphasis-bg-color !default;
|
|
9
|
+
// #endvariables
|
|
10
|
+
|
|
11
|
+
@include bem(accordion) {
|
|
12
|
+
@include e(item) {
|
|
13
|
+
@include universal;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@include e(item-header) {
|
|
17
|
+
@include universal;
|
|
18
|
+
|
|
19
|
+
@include m(disabled) {
|
|
20
|
+
@include ifweb {
|
|
21
|
+
cursor: not-allowed;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@include e(item-body) {
|
|
27
|
+
@include universal;
|
|
28
|
+
padding: $sar-accordion-item-body-padding-y
|
|
29
|
+
$sar-accordion-item-body-padding-x;
|
|
30
|
+
background-color: $sar-accordion-item-body-bg-color;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@include e(halfline) {
|
|
34
|
+
left: $sar-accordion-item-body-padding-x;
|
|
35
|
+
right: $sar-accordion-item-body-padding-x;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@include m(disabled) {
|
|
39
|
+
@include disabled;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@include theme(dark) {
|
|
44
|
+
@include bem(accordion) {
|
|
45
|
+
@include e(item-body) {
|
|
46
|
+
background-color: $sar-accordion-item-body-dark-bg-color;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, PropsWithoutRef, ReactNode, RefAttributes } from 'react';
|
|
2
|
+
import { PopupProps } from '../popup';
|
|
3
|
+
import { ActionSheetItem, ActionSheetItemProps } from './Item';
|
|
4
|
+
import { BaseProps } from '../base';
|
|
5
|
+
export type { ActionSheetItemProps } from './Item';
|
|
6
|
+
export interface ActionSheetProps extends BaseProps, PopupProps {
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
itemList?: (string | ActionSheetItemProps)[];
|
|
9
|
+
cancel?: ReactNode;
|
|
10
|
+
onSelect?: (index: number, item: string | ActionSheetItemProps) => void | Promise<any>;
|
|
11
|
+
onCancel?: () => void | Promise<any>;
|
|
12
|
+
onClose?: () => void | Promise<any>;
|
|
13
|
+
visible?: boolean;
|
|
14
|
+
defaultVisible?: boolean;
|
|
15
|
+
onVisible?: (visible: boolean) => void;
|
|
16
|
+
maskClosable?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ActionSheetRef {
|
|
19
|
+
}
|
|
20
|
+
export interface ActionSheetFC extends ForwardRefExoticComponent<PropsWithoutRef<ActionSheetProps> & RefAttributes<ActionSheetRef>> {
|
|
21
|
+
Item: typeof ActionSheetItem;
|
|
22
|
+
}
|
|
23
|
+
export declare const ActionSheet: ActionSheetFC;
|
|
24
|
+
export default ActionSheet;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { createElement as _createElement } from "react";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Children, cloneElement, forwardRef, useImperativeHandle, } from 'react';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { View } from '@tarojs/components';
|
|
6
|
+
import { useBem, useControllableValue, useEvent } from '../use';
|
|
7
|
+
import { Popup } from '../popup';
|
|
8
|
+
import { ActionSheetItem } from './Item';
|
|
9
|
+
import { isFunction, isNullish, isString, noop } from '../utils';
|
|
10
|
+
import Halfline from '../halfline';
|
|
11
|
+
import Pressable from '../pressable';
|
|
12
|
+
import SafeArea from '../safe-area';
|
|
13
|
+
export const ActionSheet = forwardRef((props, ref) => {
|
|
14
|
+
const { className, style, contentClass, contentStyle, children, onMaskClick, description, itemList, cancel, onSelect, onCancel, onClose, visible, defaultVisible, onVisible, maskClosable = true, ...restProps } = props;
|
|
15
|
+
const [bem] = useBem('action-sheet');
|
|
16
|
+
const [innerVisible, setInnerVisible] = useControllableValue({
|
|
17
|
+
value: visible,
|
|
18
|
+
defaultValue: defaultVisible,
|
|
19
|
+
trigger: onVisible,
|
|
20
|
+
initialValue: false,
|
|
21
|
+
});
|
|
22
|
+
const perhapsClose = (callback) => {
|
|
23
|
+
if (isFunction(callback)) {
|
|
24
|
+
const result = callback();
|
|
25
|
+
if (result instanceof Promise) {
|
|
26
|
+
return result
|
|
27
|
+
.then(() => {
|
|
28
|
+
setInnerVisible?.(false);
|
|
29
|
+
})
|
|
30
|
+
.catch(noop);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
setInnerVisible?.(false);
|
|
34
|
+
};
|
|
35
|
+
const handleItemClick = useEvent((index, item) => {
|
|
36
|
+
perhapsClose(() => {
|
|
37
|
+
return onSelect?.(index, item);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
const handleMaskClick = useEvent((event) => {
|
|
41
|
+
onMaskClick?.(event);
|
|
42
|
+
if (maskClosable) {
|
|
43
|
+
perhapsClose(onClose);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const handleRequestClose = useEvent(() => {
|
|
47
|
+
setInnerVisible(false);
|
|
48
|
+
});
|
|
49
|
+
const handleCancelClick = useEvent(() => {
|
|
50
|
+
perhapsClose(onCancel);
|
|
51
|
+
});
|
|
52
|
+
useImperativeHandle(ref, () => ({}), []);
|
|
53
|
+
return (_jsxs(Popup, { ...restProps, visible: innerVisible, effect: "slide-bottom", className: className, style: style, contentClass: classNames(bem.b(), bem.m('headless', isNullish(description)), contentClass), contentStyle: contentStyle, onMaskClick: handleMaskClick, catchMove: true, onRequestClose: handleRequestClose, children: [!isNullish(description) && (_jsxs(View, { className: bem.e('header'), children: [_jsx(View, { className: bem.e('description'), children: description }), _jsx(Halfline, { direction: "bottom" })] })), _jsx(View, { className: bem.e('body'), children: itemList
|
|
54
|
+
? itemList.map((item, index) => {
|
|
55
|
+
const itemProps = isString(item)
|
|
56
|
+
? {
|
|
57
|
+
name: item,
|
|
58
|
+
}
|
|
59
|
+
: item;
|
|
60
|
+
return (_createElement(ActionSheetItem, { ...itemProps, key: index, _later: index > 0, className: classNames(bem.em('item', 'headless-first', isNullish(description) && index === 0)), onClick: (event) => {
|
|
61
|
+
handleItemClick(index, item);
|
|
62
|
+
if (!isString(item)) {
|
|
63
|
+
item.onClick?.(event);
|
|
64
|
+
}
|
|
65
|
+
} }));
|
|
66
|
+
})
|
|
67
|
+
: Children.map(children, (element, index) => {
|
|
68
|
+
return cloneElement(element, {
|
|
69
|
+
className: classNames(bem.em('item', 'headless-first', isNullish(description) && index === 0)),
|
|
70
|
+
_later: index > 0,
|
|
71
|
+
onClick: (event) => {
|
|
72
|
+
handleItemClick(index, element.props);
|
|
73
|
+
element.props.onClick?.(event);
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
}) }), !isNullish(cancel) && (_jsxs(_Fragment, { children: [_jsx(View, { className: bem.e('gap') }), _jsx(Pressable, { children: ({ pressed }) => (_jsx(View, { className: classNames(bem.e('cancel'), bem.m('pressed', pressed)), onClick: handleCancelClick, children: cancel })) })] })), _jsx(SafeArea, { direction: "bottom" })] }));
|
|
77
|
+
});
|
|
78
|
+
ActionSheet.Item = ActionSheetItem;
|
|
79
|
+
export default ActionSheet;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ActionSheetProps, ActionSheetRef } from './ActionSheet';
|
|
3
|
+
import { AgentProps, MapIdAgent } from '../utils/imperative';
|
|
4
|
+
export declare const mapIdAgent: MapIdAgent<ActionSheetProps, ActionSheetRef>;
|
|
5
|
+
export declare const ActionSheetAgent: (agentProps: AgentProps<ActionSheetProps>) => import("react").CElement<any, import("react").Component<any, any, any>>;
|
|
6
|
+
export default ActionSheetAgent;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionSheet } from './ActionSheet';
|
|
2
|
+
import { useAgent } from '../utils/imperative';
|
|
3
|
+
export const mapIdAgent = {};
|
|
4
|
+
export const ActionSheetAgent = (agentProps) => {
|
|
5
|
+
return useAgent(ActionSheet, agentProps, mapIdAgent, 'actionSheet');
|
|
6
|
+
};
|
|
7
|
+
export default ActionSheetAgent;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { ITouchEvent } from '@tarojs/components';
|
|
3
|
+
import { LoadingProps } from '../loading';
|
|
4
|
+
import { BaseProps } from '../base';
|
|
5
|
+
export interface ActionSheetItemProps extends BaseProps {
|
|
6
|
+
name?: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
color?: string;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
loadingProps?: LoadingProps;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
onClick?: (event: ITouchEvent) => void;
|
|
13
|
+
_later?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const ActionSheetItem: FC<ActionSheetItemProps>;
|
|
16
|
+
export default ActionSheetItem;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { View } from '@tarojs/components';
|
|
4
|
+
import Loading from '../loading';
|
|
5
|
+
import { isNullish } from '../utils';
|
|
6
|
+
import { useBem, useEvent } from '../use';
|
|
7
|
+
import Halfline from '../halfline';
|
|
8
|
+
import Pressable from '../pressable';
|
|
9
|
+
export const ActionSheetItem = (props) => {
|
|
10
|
+
const { className, style, children, name, description, color, loading, loadingProps, disabled, onClick, _later, ...restProps } = props;
|
|
11
|
+
const [bem] = useBem('action-sheet');
|
|
12
|
+
const handleClick = useEvent((event) => {
|
|
13
|
+
if (!disabled && !loading) {
|
|
14
|
+
onClick?.(event);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return (_jsx(Pressable, { disabled: disabled || loading, children: ({ pressed }) => (_jsxs(View, { ...restProps, className: classNames(bem.e('item'), bem.em('item', 'disabled', disabled), bem.em('item', 'loading', loading), bem.m('pressed', pressed), className), style: {
|
|
18
|
+
...style,
|
|
19
|
+
color,
|
|
20
|
+
}, onClick: handleClick, children: [loading ? (_jsx(Loading, { ...loadingProps })) : (_jsxs(_Fragment, { children: [(!isNullish(name) || !isNullish(children)) && (_jsx(View, { className: classNames(bem.e('item-name'), bem.m('disabled', disabled)), children: name ?? children })), !isNullish(description) && (_jsx(View, { className: classNames(bem.e('item-description'), bem.m('disabled', disabled)), children: description }))] })), _later && _jsx(Halfline, { direction: "top" })] })) }));
|
|
21
|
+
};
|
|
22
|
+
export default ActionSheetItem;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionSheetItemProps, ActionSheetProps } from './ActionSheet';
|
|
2
|
+
export interface ActionSheetOptions extends ActionSheetProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const show: (options: ActionSheetOptions) => Promise<{
|
|
6
|
+
index: number;
|
|
7
|
+
item: string | ActionSheetItemProps;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const hide: (id?: string) => void;
|
|
10
|
+
export declare const hideAll: () => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { mapIdAgent } from './Agent';
|
|
2
|
+
export const show = (options) => {
|
|
3
|
+
const { id = 'actionSheet', onSelect } = options;
|
|
4
|
+
return new Promise((resolve) => {
|
|
5
|
+
const ref = mapIdAgent[id];
|
|
6
|
+
if (ref) {
|
|
7
|
+
ref.current?.show({
|
|
8
|
+
...options,
|
|
9
|
+
onSelect(index, item) {
|
|
10
|
+
resolve({ index, item });
|
|
11
|
+
return onSelect?.(index, item);
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export const hide = (id = 'actionSheet') => {
|
|
18
|
+
mapIdAgent[id]?.current?.hide();
|
|
19
|
+
};
|
|
20
|
+
export const hideAll = () => {
|
|
21
|
+
Object.keys(mapIdAgent).forEach((key) => mapIdAgent[key]?.current?.hide());
|
|
22
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ActionSheetFC as ActionSheetOriginFC, ActionSheetProps, ActionSheetRef } from './ActionSheet';
|
|
2
|
+
import { ActionSheetAgent } from './Agent';
|
|
3
|
+
import { hide, hideAll, show } from './imperative';
|
|
4
|
+
interface ActionSheetFC extends ActionSheetOriginFC {
|
|
5
|
+
show: typeof show;
|
|
6
|
+
hide: typeof hide;
|
|
7
|
+
hideAll: typeof hideAll;
|
|
8
|
+
Agent: typeof ActionSheetAgent;
|
|
9
|
+
}
|
|
10
|
+
declare const ActionSheet: ActionSheetFC;
|
|
11
|
+
export { ActionSheet, ActionSheetProps, ActionSheetRef, ActionSheetAgent };
|
|
12
|
+
export default ActionSheet;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionSheet as ActionSheetOrigin } from './ActionSheet';
|
|
2
|
+
import { ActionSheetAgent } from './Agent';
|
|
3
|
+
import { hide, hideAll, show } from './imperative';
|
|
4
|
+
const ActionSheet = ActionSheetOrigin;
|
|
5
|
+
ActionSheet.show = show;
|
|
6
|
+
ActionSheet.hide = hide;
|
|
7
|
+
ActionSheet.hideAll = hideAll;
|
|
8
|
+
ActionSheet.Agent = ActionSheetAgent;
|
|
9
|
+
export { ActionSheet, ActionSheetAgent };
|
|
10
|
+
export default ActionSheet;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
@import '../style/base.scss';
|
|
2
|
+
// #variables
|
|
3
|
+
$sar-action-sheet-border-radius: $sar-rounded-xl !default;
|
|
4
|
+
$sar-action-sheet-bg-color: $sar-emphasis-bg-color !default;
|
|
5
|
+
|
|
6
|
+
$sar-action-sheet-header-padding: 16px !default;
|
|
7
|
+
|
|
8
|
+
$sar-action-sheet-description-font-size: $sar-text-base !default;
|
|
9
|
+
$sar-action-sheet-description-color: $sar-tertiary-color !default;
|
|
10
|
+
|
|
11
|
+
$sar-action-sheet-item-min-height: 48px !default;
|
|
12
|
+
$sar-action-sheet-item-padding: 8px 16px !default;
|
|
13
|
+
|
|
14
|
+
$sar-action-sheet-gap-bg-color: $sar-gray-100 !default;
|
|
15
|
+
$sar-action-sheet-gap-height: 8px !default;
|
|
16
|
+
|
|
17
|
+
$sar-action-sheet-item-name-font-size: $sar-text-lg !default;
|
|
18
|
+
|
|
19
|
+
$sar-action-sheet-item-description-margin-top: 0 !default;
|
|
20
|
+
$sar-action-sheet-item-description-font-size: $sar-text-sm !default;
|
|
21
|
+
$sar-action-sheet-item-description-color: $sar-tertiary-color !default;
|
|
22
|
+
|
|
23
|
+
$sar-action-sheet-cancel-min-height: 48px !default;
|
|
24
|
+
$sar-action-sheet-cancel-padding: 8px 16px !default;
|
|
25
|
+
$sar-action-sheet-cancel-font-size: $sar-text-lg !default;
|
|
26
|
+
|
|
27
|
+
$sar-action-sheet-active-bg-color: $sar-active-bg-color !default;
|
|
28
|
+
|
|
29
|
+
// 暗黑模式
|
|
30
|
+
$sar-action-sheet-dark-bg-color: $sar-dark-emphasis-bg-color !default;
|
|
31
|
+
$sar-action-sheet-description-dark-color: $sar-dark-tertiary-color !default;
|
|
32
|
+
$sar-action-sheet-gap-dark-bg-color: $sar-gray-900 !default;
|
|
33
|
+
$sar-action-sheet-item-description-dark-color: $sar-dark-tertiary-color !default;
|
|
34
|
+
$sar-action-sheet-active-dark-bg-color: $sar-dark-active-bg-color !default;
|
|
35
|
+
// #endvariables
|
|
36
|
+
|
|
37
|
+
@include bem(action-sheet) {
|
|
38
|
+
@include b() {
|
|
39
|
+
border-top-left-radius: $sar-action-sheet-border-radius;
|
|
40
|
+
border-top-right-radius: $sar-action-sheet-border-radius;
|
|
41
|
+
background-color: $sar-action-sheet-bg-color;
|
|
42
|
+
@include ifweb {
|
|
43
|
+
touch-action: none;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@include e(header) {
|
|
48
|
+
@include universal;
|
|
49
|
+
padding: $sar-action-sheet-header-padding;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@include e(description) {
|
|
53
|
+
@include universal;
|
|
54
|
+
font-size: $sar-action-sheet-description-font-size;
|
|
55
|
+
text-align: center;
|
|
56
|
+
color: $sar-action-sheet-description-color;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@include e(gap) {
|
|
60
|
+
@include universal;
|
|
61
|
+
height: $sar-action-sheet-gap-height;
|
|
62
|
+
background-color: $sar-action-sheet-gap-bg-color;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@include e(item) {
|
|
66
|
+
@include universal;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
align-items: center;
|
|
69
|
+
min-height: $sar-action-sheet-item-min-height;
|
|
70
|
+
padding: $sar-action-sheet-item-padding;
|
|
71
|
+
|
|
72
|
+
@include ifweb {
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@include m(disabled, loading) {
|
|
77
|
+
@include ifweb {
|
|
78
|
+
cursor: not-allowed;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@include m(headless-first) {
|
|
83
|
+
border-top-left-radius: $sar-action-sheet-border-radius;
|
|
84
|
+
border-top-right-radius: $sar-action-sheet-border-radius;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@include e(item-name) {
|
|
89
|
+
@include universal;
|
|
90
|
+
font-size: $sar-action-sheet-item-name-font-size;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@include e(item-description) {
|
|
94
|
+
@include universal;
|
|
95
|
+
margin-top: $sar-action-sheet-item-description-margin-top;
|
|
96
|
+
font-size: $sar-action-sheet-item-description-font-size;
|
|
97
|
+
color: $sar-action-sheet-item-description-color;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@include m(disabled) {
|
|
101
|
+
color: $sar-disabled-color;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@include e(cancel) {
|
|
105
|
+
@include universal;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
align-items: center;
|
|
108
|
+
min-height: $sar-action-sheet-cancel-min-height;
|
|
109
|
+
padding: $sar-action-sheet-cancel-padding;
|
|
110
|
+
font-size: $sar-action-sheet-cancel-font-size;
|
|
111
|
+
|
|
112
|
+
@include ifweb {
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@include m(pressed) {
|
|
118
|
+
background-color: $sar-action-sheet-active-bg-color;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@include theme(dark) {
|
|
123
|
+
@include bem(action-sheet) {
|
|
124
|
+
@include b() {
|
|
125
|
+
background-color: $sar-action-sheet-dark-bg-color;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@include e(description) {
|
|
129
|
+
color: $sar-action-sheet-description-dark-color;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@include e(gap) {
|
|
133
|
+
background-color: $sar-action-sheet-gap-dark-bg-color;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@include e(item-description) {
|
|
137
|
+
color: $sar-action-sheet-item-description-dark-color;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@include m(disabled) {
|
|
141
|
+
color: $sar-dark-disabled-color;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@include m(pressed) {
|
|
145
|
+
background-color: $sar-action-sheet-active-dark-bg-color;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AnyFunction } from '../base';
|
|
3
|
+
declare class AnimatedInterpolation {
|
|
4
|
+
constructor(config: Record<string, any>);
|
|
5
|
+
}
|
|
6
|
+
declare class AnimatedValue {
|
|
7
|
+
constructor(value: number, config?: Record<string, any>);
|
|
8
|
+
setValue(value: number): void;
|
|
9
|
+
setOffset(offset: number): void;
|
|
10
|
+
flattenOffset(): void;
|
|
11
|
+
extractOffset(): void;
|
|
12
|
+
interpolate(config: Record<string, any>): AnimatedInterpolation;
|
|
13
|
+
stopAnimation(): void;
|
|
14
|
+
addListener(callback: (state: {
|
|
15
|
+
value: number;
|
|
16
|
+
}) => void): string;
|
|
17
|
+
removeListener(id: string): void;
|
|
18
|
+
removeAllListeners(): void;
|
|
19
|
+
}
|
|
20
|
+
declare class CompositeAnimation {
|
|
21
|
+
constructor(value: any, config?: Record<string, any>);
|
|
22
|
+
start(callback?: (result: {
|
|
23
|
+
finished: boolean;
|
|
24
|
+
}) => void): void;
|
|
25
|
+
stop(): void;
|
|
26
|
+
reset(): void;
|
|
27
|
+
}
|
|
28
|
+
declare function timing(value: AnimatedValue, config: Record<string, any>): CompositeAnimation;
|
|
29
|
+
declare function loop(animation: CompositeAnimation, config?: Record<string, any>): CompositeAnimation;
|
|
30
|
+
declare function parallel(animations: Array<CompositeAnimation>, config?: Record<string, any>): CompositeAnimation;
|
|
31
|
+
declare function sequence(animations: any[]): CompositeAnimation;
|
|
32
|
+
declare function delay(time: number): CompositeAnimation;
|
|
33
|
+
declare class Animated {
|
|
34
|
+
static View: import("react").ComponentType<import("@tarojs/components/types/View").ViewProps>;
|
|
35
|
+
static Text: import("react").ComponentType<import("@tarojs/components/types/Text").TextProps>;
|
|
36
|
+
static Value: typeof AnimatedValue;
|
|
37
|
+
static timing: typeof timing;
|
|
38
|
+
static loop: typeof loop;
|
|
39
|
+
static parallel: typeof parallel;
|
|
40
|
+
static sequence: typeof sequence;
|
|
41
|
+
static delay: typeof delay;
|
|
42
|
+
}
|
|
43
|
+
declare class Easing {
|
|
44
|
+
static step0: AnyFunction;
|
|
45
|
+
static step1: AnyFunction;
|
|
46
|
+
static linear: AnyFunction;
|
|
47
|
+
static ease: AnyFunction;
|
|
48
|
+
static quad: AnyFunction;
|
|
49
|
+
static cubic: AnyFunction;
|
|
50
|
+
static poly: AnyFunction;
|
|
51
|
+
static sin: AnyFunction;
|
|
52
|
+
static circle: AnyFunction;
|
|
53
|
+
static exp: AnyFunction;
|
|
54
|
+
static elastic: AnyFunction;
|
|
55
|
+
static back: AnyFunction;
|
|
56
|
+
static bounce: AnyFunction;
|
|
57
|
+
static bezier: AnyFunction;
|
|
58
|
+
static in: AnyFunction;
|
|
59
|
+
static out: AnyFunction;
|
|
60
|
+
static inOut: AnyFunction;
|
|
61
|
+
}
|
|
62
|
+
export { Easing, Animated };
|