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,138 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { CustomWrapper, View, } from '@tarojs/components';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { useBem, useControllableValue, useEvent, useLayoutUpdateEffect, } from '../use';
|
|
6
|
+
import { createMouseBinder, isNullish, isPC, isString, minmax } from '../utils';
|
|
7
|
+
import { Icon } from '../icon';
|
|
8
|
+
import { Input } from '../input';
|
|
9
|
+
import Pressable from '../pressable';
|
|
10
|
+
export const Stepper = (props) => {
|
|
11
|
+
const { className, style, value, defaultValue, onChange, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER, valueOnClear, step = 1, precision, inputStyle, inputType = 'number', placeholder, disabled, readOnly, press = true, pressTime = 350, interval = 150, onBlur, onFocus, size = 36, ...restProps } = props;
|
|
12
|
+
const [bem] = useBem('stepper');
|
|
13
|
+
const [innerValue, setInnerValue] = useControllableValue({
|
|
14
|
+
value,
|
|
15
|
+
defaultValue,
|
|
16
|
+
trigger: onChange,
|
|
17
|
+
});
|
|
18
|
+
const [inputValue, setInputValue] = useState(innerValue);
|
|
19
|
+
const isMin = !isNullish(innerValue) && Number(innerValue) <= min;
|
|
20
|
+
const isMax = !isNullish(innerValue) && Number(innerValue) >= max;
|
|
21
|
+
useLayoutUpdateEffect(() => {
|
|
22
|
+
function isZeroAfterCoercionButNotLiteral(target) {
|
|
23
|
+
if (target === null ||
|
|
24
|
+
target === false ||
|
|
25
|
+
(isString(target) && target.trim() === '')) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const nextInputValue = Number(innerValue);
|
|
30
|
+
setInputValue(isNaN(nextInputValue) || isZeroAfterCoercionButNotLiteral(innerValue)
|
|
31
|
+
? ''
|
|
32
|
+
: nextInputValue);
|
|
33
|
+
}, [innerValue]);
|
|
34
|
+
const setValueEnsureSafe = (val) => {
|
|
35
|
+
setInnerValue(val);
|
|
36
|
+
setInputValue(val);
|
|
37
|
+
};
|
|
38
|
+
const normalizedValue = (value) => {
|
|
39
|
+
value = minmax(value, min, max);
|
|
40
|
+
if (precision !== undefined) {
|
|
41
|
+
value = +value.toFixed(precision);
|
|
42
|
+
}
|
|
43
|
+
return value;
|
|
44
|
+
};
|
|
45
|
+
// # 输入框
|
|
46
|
+
const getValueOnClear = () => {
|
|
47
|
+
return valueOnClear === 'min'
|
|
48
|
+
? min
|
|
49
|
+
: valueOnClear === 'max'
|
|
50
|
+
? max
|
|
51
|
+
: valueOnClear;
|
|
52
|
+
};
|
|
53
|
+
const handleInputChange = (value) => {
|
|
54
|
+
setInputValue(value);
|
|
55
|
+
if (value === '') {
|
|
56
|
+
setInnerValue(getValueOnClear());
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const handleBlur = (event) => {
|
|
60
|
+
if (inputValue !== '') {
|
|
61
|
+
const nextValue = Number(inputValue);
|
|
62
|
+
if (isNaN(nextValue)) {
|
|
63
|
+
setInputValue('');
|
|
64
|
+
setInnerValue(getValueOnClear());
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
setValueEnsureSafe(normalizedValue(nextValue));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
onBlur?.(event);
|
|
71
|
+
};
|
|
72
|
+
// # 按钮
|
|
73
|
+
const setByStep = useEvent((delta) => {
|
|
74
|
+
setValueEnsureSafe(normalizedValue((Number(innerValue) || 0) + step * delta));
|
|
75
|
+
});
|
|
76
|
+
const handleClick = (delta, reach) => {
|
|
77
|
+
if (!disabled && !readOnly && !reach) {
|
|
78
|
+
setByStep(delta);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const pressTimer = useRef();
|
|
82
|
+
const isPressing = useRef(false);
|
|
83
|
+
const handleLongPress = (delta) => {
|
|
84
|
+
setTimeout(() => {
|
|
85
|
+
if (isPressing.current) {
|
|
86
|
+
setByStep(delta);
|
|
87
|
+
handleLongPress(delta);
|
|
88
|
+
}
|
|
89
|
+
}, interval);
|
|
90
|
+
};
|
|
91
|
+
const handleTouchStart = useEvent((delta) => {
|
|
92
|
+
if (!press ||
|
|
93
|
+
disabled ||
|
|
94
|
+
readOnly ||
|
|
95
|
+
(delta === -1 && isMin) ||
|
|
96
|
+
(delta === 1 && isMax)) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
isPressing.current = false;
|
|
100
|
+
clearTimeout(pressTimer.current);
|
|
101
|
+
pressTimer.current = setTimeout(() => {
|
|
102
|
+
isPressing.current = true;
|
|
103
|
+
handleLongPress(delta);
|
|
104
|
+
}, pressTime);
|
|
105
|
+
});
|
|
106
|
+
const handleTouchEnd = useEvent((event) => {
|
|
107
|
+
clearTimeout(pressTimer.current);
|
|
108
|
+
if (isPressing.current) {
|
|
109
|
+
isPressing.current = false;
|
|
110
|
+
event.preventDefault?.();
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
const minusMouseBinder = useMemo(() => {
|
|
114
|
+
return isPC
|
|
115
|
+
? createMouseBinder({
|
|
116
|
+
onStart() {
|
|
117
|
+
handleTouchStart(-1);
|
|
118
|
+
},
|
|
119
|
+
onEnd: handleTouchEnd,
|
|
120
|
+
})
|
|
121
|
+
: null;
|
|
122
|
+
}, []);
|
|
123
|
+
const plusMouseBinder = useMemo(() => {
|
|
124
|
+
return isPC
|
|
125
|
+
? createMouseBinder({
|
|
126
|
+
onStart() {
|
|
127
|
+
handleTouchStart(1);
|
|
128
|
+
},
|
|
129
|
+
onEnd: handleTouchEnd,
|
|
130
|
+
})
|
|
131
|
+
: null;
|
|
132
|
+
}, []);
|
|
133
|
+
const renderButton = (delta, icon, reach, cls, mouseBinder) => {
|
|
134
|
+
return (_jsx(Pressable, { disabled: reach || disabled || readOnly, onTouchStart: () => handleTouchStart(delta), onTouchEnd: handleTouchEnd, onTouchCancel: handleTouchEnd, children: ({ pressed }) => (_jsx(View, { className: classNames(bem.e('button'), bem.e(cls), bem.em('button', 'disabled', disabled || reach), bem.em('button', 'readonly', readOnly), bem.em('button', 'pressed', pressed)), style: { width: size, height: size }, onClick: () => handleClick(delta, reach), ...mouseBinder, children: _jsx(Icon, { name: icon, className: classNames(bem.e('icon'), bem.em('icon', 'disabled', disabled)) }) })) }));
|
|
135
|
+
};
|
|
136
|
+
return (_jsx(CustomWrapper, { children: _jsxs(View, { ...restProps, className: classNames(bem.b(), bem.m('disabled', disabled), bem.m('readonly', readOnly), className), style: style, children: [renderButton(-1, 'minus', isMin, 'decrease', minusMouseBinder), _jsx(Input, { type: inputType, className: bem.e('input'), placeholder: placeholder, style: { ...inputStyle, height: size }, value: String(inputValue ?? ''), onChange: handleInputChange, onBlur: handleBlur, onFocus: onFocus, disabled: disabled, readOnly: readOnly }), renderButton(1, 'plus', isMax, 'increase', plusMouseBinder)] }) }));
|
|
137
|
+
};
|
|
138
|
+
export default Stepper;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
@import '../style/base.scss';
|
|
2
|
+
// #variables
|
|
3
|
+
$sar-stepper-height: 36px !default;
|
|
4
|
+
$sar-stepper-bg-color: $sar-secondary-bg-color !default;
|
|
5
|
+
|
|
6
|
+
$sar-stepper-input-gap: 4px !default;
|
|
7
|
+
$sar-stepper-input-width: 50px !default;
|
|
8
|
+
$sar-stepper-input-padding-x: 5px !default;
|
|
9
|
+
|
|
10
|
+
$sar-stepper-button-width: $sar-stepper-height !default;
|
|
11
|
+
$sar-stepper-button-font-size: 18px !default;
|
|
12
|
+
$sar-stepper-button-border-radius: $sar-rounded-sm !default;
|
|
13
|
+
$sar-stepper-button-active-bg-color: $sar-active-deep-bg-color !default;
|
|
14
|
+
|
|
15
|
+
// 暗黑模式
|
|
16
|
+
$sar-stepper-dark-bg-color: $sar-dark-secondary-bg-color !default;
|
|
17
|
+
$sar-stepper-button-active-dark-bg-color: $sar-dark-active-deep-bg-color !default;
|
|
18
|
+
// #endvariables
|
|
19
|
+
|
|
20
|
+
@include bem(stepper) {
|
|
21
|
+
@include b() {
|
|
22
|
+
@include universal;
|
|
23
|
+
flex-direction: row;
|
|
24
|
+
justify-content: flex-start;
|
|
25
|
+
align-items: stretch;
|
|
26
|
+
gap: $sar-stepper-input-gap;
|
|
27
|
+
height: $sar-stepper-height;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@include e(button) {
|
|
31
|
+
@include universal;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
align-items: center;
|
|
34
|
+
width: $sar-stepper-button-width;
|
|
35
|
+
font-size: $sar-stepper-button-font-size;
|
|
36
|
+
background-color: $sar-stepper-bg-color;
|
|
37
|
+
|
|
38
|
+
@include ifweb {
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
|
|
41
|
+
@include m(readonly) {
|
|
42
|
+
cursor: default;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@include m(pressed) {
|
|
47
|
+
background-color: $sar-stepper-button-active-bg-color;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@include m(disabled) {
|
|
51
|
+
background-color: $sar-disabled-shallow-bg-color;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@include e(decrease) {
|
|
56
|
+
flex: none;
|
|
57
|
+
border-top-left-radius: $sar-stepper-button-border-radius;
|
|
58
|
+
border-bottom-left-radius: $sar-stepper-button-border-radius;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@include e(increase) {
|
|
62
|
+
flex: none;
|
|
63
|
+
border-top-right-radius: $sar-stepper-button-border-radius;
|
|
64
|
+
border-bottom-right-radius: $sar-stepper-button-border-radius;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@include e(icon) {
|
|
68
|
+
@include m(disabled) {
|
|
69
|
+
color: $sar-disabled-color;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@include e(input) {
|
|
74
|
+
width: $sar-stepper-input-width;
|
|
75
|
+
padding-top: 0;
|
|
76
|
+
padding-bottom: 0;
|
|
77
|
+
padding-left: $sar-stepper-input-padding-x;
|
|
78
|
+
padding-right: $sar-stepper-input-padding-x;
|
|
79
|
+
border: 0;
|
|
80
|
+
border-radius: 0;
|
|
81
|
+
text-align: center;
|
|
82
|
+
background-color: $sar-stepper-bg-color;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@include theme(dark) {
|
|
87
|
+
@include bem(stepper) {
|
|
88
|
+
@include e(button) {
|
|
89
|
+
background-color: $sar-stepper-dark-bg-color;
|
|
90
|
+
|
|
91
|
+
@include m(pressed) {
|
|
92
|
+
background-color: $sar-stepper-button-active-dark-bg-color;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@include e(input) {
|
|
97
|
+
background-color: $sar-stepper-dark-bg-color;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@include e(icon) {
|
|
101
|
+
@include m(disabled) {
|
|
102
|
+
color: $sar-dark-disabled-color;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { ITouchEvent } from '@tarojs/components';
|
|
3
|
+
import { StepsStatus } from './index';
|
|
4
|
+
import { IconProps } from '../icon';
|
|
5
|
+
import { BaseProps } from '../base';
|
|
6
|
+
export interface StepsStepProps extends Omit<BaseProps, 'children'> {
|
|
7
|
+
children?: ReactNode | ((status: StepsStatus) => ReactNode);
|
|
8
|
+
status?: StepsStatus;
|
|
9
|
+
color?: string;
|
|
10
|
+
lineColor?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
icon?: ReactNode | ((status: StepsStatus) => ReactNode);
|
|
13
|
+
iconProps?: IconProps | ((status: StepsStatus) => IconProps);
|
|
14
|
+
onClick?: (event: ITouchEvent) => void;
|
|
15
|
+
center?: boolean;
|
|
16
|
+
direction?: 'vertical' | 'horizontal';
|
|
17
|
+
clickable?: boolean;
|
|
18
|
+
_placement?: number;
|
|
19
|
+
_first?: boolean;
|
|
20
|
+
_last?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const StepsStep: FC<StepsStepProps>;
|
|
23
|
+
export default StepsStep;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { View } from '@tarojs/components';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { Icon } from '../icon';
|
|
5
|
+
import { useBem, useEvent } from '../use';
|
|
6
|
+
import { filterNullish, isFunction } from '../utils';
|
|
7
|
+
import Pressable from '../pressable';
|
|
8
|
+
const mapStatusIcon = {
|
|
9
|
+
finish: 'check-circle-fill',
|
|
10
|
+
process: 'circle',
|
|
11
|
+
wait: 'circle',
|
|
12
|
+
error: 'x-circle',
|
|
13
|
+
};
|
|
14
|
+
function getPosition(num) {
|
|
15
|
+
return num < 0 ? 'behind' : num === 0 ? 'self' : 'front';
|
|
16
|
+
}
|
|
17
|
+
export const StepsStep = (props) => {
|
|
18
|
+
const { className, style, children, status = 'wait', color, lineColor, disabled = false, icon, iconProps, onClick, center, direction, clickable, _placement, _first, _last, ...restProps } = props;
|
|
19
|
+
const [bem] = useBem('steps');
|
|
20
|
+
const placement = getPosition(_placement);
|
|
21
|
+
const handleClick = useEvent((event) => {
|
|
22
|
+
if (!disabled) {
|
|
23
|
+
onClick?.(event);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const lineClass = classNames(bem.e('line'), bem.em('line', 'behind', placement === 'behind'), bem.em('line', 'last', _last), bem.em('line', 'center-last', center && _last), bem.em('line', direction), bem.em('line', `${direction}-center-last`, center && _last));
|
|
27
|
+
return (_jsx(Pressable, { disabled: !clickable || disabled, children: ({ pressed }) => (_jsxs(View, { ...restProps, className: classNames(bem.e('step'), bem.em('step', 'last', _last), bem.em('step', 'center', center), bem.em('step', 'center-last', center && _last), bem.em('step', `${direction}-center`, center), bem.em('step', `${direction}-center-last`, center && _last), bem.em('step', direction), bem.em('step', `${direction}-last`, _last), bem.em('step', 'clickable', clickable), bem.em('step', 'disabled', disabled), className), style: style, onClick: handleClick, children: [_jsxs(View, { className: classNames(bem.e('header'), bem.em('header', direction), bem.em('header', `${direction}-center`, center)), children: [_jsx(View, { className: classNames(lineClass, bem.e('line-before'), bem.em('line-before', 'self', placement === 'self'), bem.em('line-before', 'first', _first), bem.em('line-before', 'center', center), bem.em('line-before', `${direction}-center`, center)), style: filterNullish({
|
|
28
|
+
backgroundColor: placement === 'behind' || placement === 'self'
|
|
29
|
+
? color
|
|
30
|
+
: lineColor,
|
|
31
|
+
}) }), isFunction(icon)
|
|
32
|
+
? icon(status)
|
|
33
|
+
: icon ?? (_jsx(Icon, { name: mapStatusIcon[status], ...(isFunction(iconProps) ? iconProps(status) : iconProps), color: status === 'finish' || status === 'process'
|
|
34
|
+
? color
|
|
35
|
+
: undefined, className: classNames(bem.e('icon'), bem.em('icon', status), bem.em('icon', 'pressed', pressed)) })), _jsx(View, { className: classNames(lineClass, bem.e('line-after'), bem.em('line-after', 'last', _last), bem.em('line-after', 'center', center), bem.em('line-after', `${direction}-center`, center)), style: filterNullish({
|
|
36
|
+
backgroundColor: placement === 'behind' ? color : lineColor,
|
|
37
|
+
}) })] }), _jsx(View, { className: classNames(bem.e('body'), bem.em('body', direction), bem.em('body', 'center', center), bem.em('body', `${direction}-center`, center), bem.em('body', 'pressed', pressed), bem.em('body', status)), style: filterNullish({
|
|
38
|
+
color: status === 'process' ? color : null,
|
|
39
|
+
}), children: isFunction(children) ? children(status) : children })] })) }));
|
|
40
|
+
};
|
|
41
|
+
export default StepsStep;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { StepsStep } from './Step';
|
|
3
|
+
import { BaseProps } from '../base';
|
|
4
|
+
import { IconProps } from '../icon';
|
|
5
|
+
export * from './Step';
|
|
6
|
+
export type StepsStatus = 'wait' | 'process' | 'error' | 'finish';
|
|
7
|
+
export interface StepsProps extends BaseProps {
|
|
8
|
+
center?: boolean;
|
|
9
|
+
direction?: 'vertical' | 'horizontal';
|
|
10
|
+
current?: number;
|
|
11
|
+
status?: StepsStatus;
|
|
12
|
+
color?: string;
|
|
13
|
+
lineColor?: string;
|
|
14
|
+
clickable?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
icon?: ReactNode | ((status: StepsStatus) => ReactNode);
|
|
17
|
+
iconProps?: IconProps | ((status: StepsStatus) => IconProps);
|
|
18
|
+
}
|
|
19
|
+
export interface StepsFC extends FC<StepsProps> {
|
|
20
|
+
Step: typeof StepsStep;
|
|
21
|
+
}
|
|
22
|
+
export declare const Steps: StepsFC;
|
|
23
|
+
export default Steps;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Children, cloneElement } from 'react';
|
|
3
|
+
import { View } from '@tarojs/components';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { StepsStep } from './Step';
|
|
6
|
+
import { useBem } from '../use';
|
|
7
|
+
import { pickNonNullish } from '../utils';
|
|
8
|
+
export * from './Step';
|
|
9
|
+
export const Steps = (props) => {
|
|
10
|
+
const { className, style, children, center = false, direction = 'horizontal', current = 0, status, color, lineColor, clickable, disabled = false, icon, iconProps, ...restProps } = props;
|
|
11
|
+
const [bem] = useBem('steps');
|
|
12
|
+
const count = Children.count(children);
|
|
13
|
+
return (_jsx(View, { ...restProps, className: classNames(bem.b(), bem.m(direction), className), style: style, children: Children.map(children, (item, index) => {
|
|
14
|
+
return cloneElement(item, {
|
|
15
|
+
status: item.props.status ??
|
|
16
|
+
(index < current
|
|
17
|
+
? 'finish'
|
|
18
|
+
: index === current
|
|
19
|
+
? status ?? 'process'
|
|
20
|
+
: 'wait'),
|
|
21
|
+
...pickNonNullish({
|
|
22
|
+
color,
|
|
23
|
+
lineColor,
|
|
24
|
+
disabled,
|
|
25
|
+
icon,
|
|
26
|
+
iconProps,
|
|
27
|
+
}, item.props),
|
|
28
|
+
center,
|
|
29
|
+
direction,
|
|
30
|
+
clickable,
|
|
31
|
+
_placement: index - current,
|
|
32
|
+
_first: index === 0,
|
|
33
|
+
_last: index === count - 1,
|
|
34
|
+
});
|
|
35
|
+
}) }));
|
|
36
|
+
};
|
|
37
|
+
Steps.Step = StepsStep;
|
|
38
|
+
export default Steps;
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
@import '../style/base.scss';
|
|
3
|
+
// #variables
|
|
4
|
+
$sar-steps-step-font-size: $sar-text-base !default;
|
|
5
|
+
$sar-steps-step-active-opacity: $sar-active-opacity !default;
|
|
6
|
+
|
|
7
|
+
$sar-steps-icon-finish-color: $sar-primary !default;
|
|
8
|
+
$sar-steps-icon-process-color: $sar-primary !default;
|
|
9
|
+
$sar-steps-icon-wait-color: $sar-tertiary-color !default;
|
|
10
|
+
$sar-steps-icon-error-color: $sar-danger !default;
|
|
11
|
+
|
|
12
|
+
$sar-steps-text-finish-color: $sar-body-color !default;
|
|
13
|
+
$sar-steps-text-process-color: $sar-primary !default;
|
|
14
|
+
$sar-steps-text-wait-color: $sar-tertiary-color !default;
|
|
15
|
+
$sar-steps-text-error-color: $sar-danger !default;
|
|
16
|
+
|
|
17
|
+
$sar-steps-header-gap-y: 4px !default;
|
|
18
|
+
$sar-steps-header-gap-x: 12px !default;
|
|
19
|
+
$sar-steps-header-vertical-top: 4px !default;
|
|
20
|
+
|
|
21
|
+
$sar-steps-line-thickness: 1px !default;
|
|
22
|
+
$sar-steps-line-gap: 3px !default;
|
|
23
|
+
$sar-steps-line-color: $sar-border-color !default;
|
|
24
|
+
$sar-steps-line-active-color: $sar-primary !default;
|
|
25
|
+
|
|
26
|
+
$sar-steps-icon-font-size: $sar-text-base !default;
|
|
27
|
+
|
|
28
|
+
$sar-steps-body-padding-x: 8px !default;
|
|
29
|
+
$sar-steps-body-padding-y: 4px !default;
|
|
30
|
+
|
|
31
|
+
// 暗黑模式
|
|
32
|
+
$sar-steps-icon-wait-dark-color: $sar-dark-tertiary-color !default;
|
|
33
|
+
$sar-steps-text-finish-dark-color: $sar-dark-body-color !default;
|
|
34
|
+
$sar-steps-text-wait-dark-color: $sar-dark-tertiary-color !default;
|
|
35
|
+
$sar-steps-line-dark-color: $sar-dark-border-color !default;
|
|
36
|
+
$sar-steps-line-active-dark-color: $sar-primary !default;
|
|
37
|
+
// #endvariables
|
|
38
|
+
|
|
39
|
+
@include bem(steps) {
|
|
40
|
+
@include b() {
|
|
41
|
+
@include universal;
|
|
42
|
+
flex-direction: row;
|
|
43
|
+
flex-wrap: nowrap;
|
|
44
|
+
align-items: flex-start;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@include m(vertical) {
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
align-items: stretch;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@include e(step) {
|
|
53
|
+
@include universal;
|
|
54
|
+
flex: 1;
|
|
55
|
+
font-size: $sar-steps-step-font-size;
|
|
56
|
+
|
|
57
|
+
@include m(last) {
|
|
58
|
+
flex: none;
|
|
59
|
+
@include ifweb {
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@include m(center) {
|
|
65
|
+
justify-content: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@include m(center-last) {
|
|
69
|
+
flex: 1;
|
|
70
|
+
@include ifweb {
|
|
71
|
+
white-space: unset;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@include m(vertical) {
|
|
76
|
+
flex-direction: row;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@include m(vertical-center) {
|
|
80
|
+
justify-content: center;
|
|
81
|
+
align-items: center;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@include m(vertical-center-last) {
|
|
85
|
+
flex: 1;
|
|
86
|
+
@include ifweb {
|
|
87
|
+
white-space: unset;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@include m(clickable) {
|
|
92
|
+
@include ifweb {
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@include m(disabled) {
|
|
98
|
+
@include disabled;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@include e(header) {
|
|
103
|
+
@include universal;
|
|
104
|
+
flex-direction: row;
|
|
105
|
+
align-items: center;
|
|
106
|
+
padding-top: $sar-steps-header-gap-y;
|
|
107
|
+
padding-bottom: $sar-steps-header-gap-y;
|
|
108
|
+
|
|
109
|
+
@include m(vertical) {
|
|
110
|
+
top: $sar-steps-header-vertical-top + $sar-steps-body-padding-y;
|
|
111
|
+
flex: none;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
padding-top: 0;
|
|
114
|
+
padding-bottom: 0;
|
|
115
|
+
padding-left: $sar-steps-header-gap-x;
|
|
116
|
+
padding-right: $sar-steps-header-gap-x;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@include m(vertical-center) {
|
|
120
|
+
top: 0;
|
|
121
|
+
align-self: stretch;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@include e(line) {
|
|
126
|
+
@include universal;
|
|
127
|
+
height: $sar-steps-line-thickness;
|
|
128
|
+
width: 0;
|
|
129
|
+
flex-grow: 1;
|
|
130
|
+
flex-shrink: 1;
|
|
131
|
+
flex-basis: 0;
|
|
132
|
+
margin-left: $sar-steps-line-gap;
|
|
133
|
+
margin-right: $sar-steps-line-gap;
|
|
134
|
+
background-color: $sar-steps-line-color;
|
|
135
|
+
|
|
136
|
+
@include m(behind) {
|
|
137
|
+
background-color: $sar-steps-line-active-color;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@include m(last) {
|
|
141
|
+
display: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@include m(center-last) {
|
|
145
|
+
display: flex;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
@include m(vertical) {
|
|
149
|
+
width: $sar-steps-line-thickness;
|
|
150
|
+
height: 0;
|
|
151
|
+
margin-left: 0;
|
|
152
|
+
margin-right: 0;
|
|
153
|
+
margin-top: $sar-steps-line-gap;
|
|
154
|
+
margin-bottom: $sar-steps-line-gap;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@include m(vertical-last) {
|
|
158
|
+
@include ifweb {
|
|
159
|
+
white-space: unset;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@include m(vertical-center-last) {
|
|
164
|
+
display: flex;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@include e(line-before) {
|
|
169
|
+
display: none;
|
|
170
|
+
|
|
171
|
+
@include m(self) {
|
|
172
|
+
background-color: $sar-steps-line-active-color;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@include m(first) {
|
|
176
|
+
opacity: 0;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@include m(center) {
|
|
180
|
+
display: flex;
|
|
181
|
+
margin-left: 0;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@include m(vertical-center) {
|
|
185
|
+
margin-top: 0;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
@include e(line-after) {
|
|
190
|
+
@include m(last) {
|
|
191
|
+
opacity: 0;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@include m(center) {
|
|
195
|
+
margin-right: 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@include m(vertical-center) {
|
|
199
|
+
margin-bottom: 0;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
@include e(icon) {
|
|
204
|
+
@include universal;
|
|
205
|
+
font-size: $sar-steps-icon-font-size;
|
|
206
|
+
|
|
207
|
+
@include m(finish) {
|
|
208
|
+
color: $sar-steps-icon-finish-color;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@include m(process) {
|
|
212
|
+
color: $sar-steps-icon-process-color;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
@include m(wait) {
|
|
216
|
+
color: $sar-steps-icon-wait-color;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@include m(error) {
|
|
220
|
+
color: $sar-steps-icon-error-color;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@include m(pressed) {
|
|
224
|
+
opacity: $sar-steps-step-active-opacity;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
@include e(body) {
|
|
229
|
+
@include universal;
|
|
230
|
+
|
|
231
|
+
@include m(vertical) {
|
|
232
|
+
flex: 1;
|
|
233
|
+
padding-top: $sar-steps-body-padding-y;
|
|
234
|
+
padding-bottom: $sar-steps-body-padding-y;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
@include m(center) {
|
|
238
|
+
align-items: center;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
@include m(vertical-center) {
|
|
242
|
+
justify-content: center;
|
|
243
|
+
align-items: flex-start;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
@include m(finish) {
|
|
247
|
+
color: $sar-steps-text-finish-color;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
@include m(process) {
|
|
251
|
+
color: $sar-steps-text-process-color;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
@include m(wait) {
|
|
255
|
+
color: $sar-steps-text-wait-color;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
@include m(error) {
|
|
259
|
+
color: $sar-steps-text-error-color;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
@include m(pressed) {
|
|
263
|
+
opacity: $sar-steps-step-active-opacity;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@include theme(dark) {
|
|
269
|
+
@include bem(steps) {
|
|
270
|
+
@include e(line) {
|
|
271
|
+
background-color: $sar-steps-line-dark-color;
|
|
272
|
+
|
|
273
|
+
@include m(behind) {
|
|
274
|
+
background-color: $sar-steps-line-active-dark-color;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
@include e(line-before) {
|
|
279
|
+
@include m(self) {
|
|
280
|
+
background-color: $sar-steps-line-active-dark-color;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
@include e(icon) {
|
|
285
|
+
@include m(wait) {
|
|
286
|
+
color: $sar-steps-icon-wait-dark-color;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
@include e(body) {
|
|
291
|
+
@include m(finish) {
|
|
292
|
+
color: $sar-steps-text-finish-dark-color;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
@include m(wait) {
|
|
296
|
+
color: $sar-steps-text-wait-dark-color;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|